From d16232bd66fc9f07d2674ab00b2381e2ff6d5243 Mon Sep 17 00:00:00 2001 From: yileifeng Date: Thu, 9 Jan 2025 21:03:28 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20ramp4-pc?= =?UTF-8?q?ar4/story-ramp@5a0c643947bbbefc69af214c93a51937c2b287c5=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...=> AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js} | 2 +- ...sI.js => APIKeyMixin-BUMSx9ny-C9ZHhLj0.js} | 2 +- ...8PmkR.js => Analysis-BPgJ-FCw-CJ_Utx59.js} | 2 +- ... ArcGISCachedService-C64Ko1TY-COmlLbBz.js} | 2 +- ....js => ArcGISService-BYA-y6X6-DNHMEBm_.js} | 2 +- ...js => AttachmentInfo-D9RFO8W2-CMU9-WNo.js} | 2 +- ...js => AttributeArray-BWXEft_i-lURl2Jp5.js} | 12 ++-- ...js => AttributeStore-DjyP9U7y-Cmhm9XHS.js} | 2 +- ...aseDynamicLayerView2D-AQ-6l0DU-CktIES_E.js | 1 + ...aseDynamicLayerView2D-AQ-6l0DU-fdOF1reR.js | 1 - ...O9ub1-.js => Basemap-BEqqSTw9-yGsB1EL7.js} | 4 +- ....js => BingMapsLayer-BigMnKl_-BCPSKyeE.js} | 2 +- ...Lh1p.js => BinsQuery-DjwQZqB8-Ch0CPJ5I.js} | 2 +- ...qft9oF3.js => Bitmap-CcqmzvfR-C22fE2NY.js} | 2 +- ...s => BitmapContainer-BC8fvmFc-C6Z_3UuF.js} | 2 +- ...eoW.js => BlendLayer-D1WkSmwP-BeUsb4u9.js} | 2 +- ...Gj.js => BoundsStore--N6o1xkF-CQrhMeDa.js} | 2 +- ...y.js => BufferObject-BM_7mcDb-EYaqMhmk.js} | 2 +- ...lAO.js => BufferView-PQoE3GL7-B9DLdqO9.js} | 2 +- ...> BuildingSceneLayer-IIePcdNz-BJDsdW-f.js} | 2 +- ...VmrxfGx.js => Button-MQvwxOnj-Bxdd1k4u.js} | 2 +- ...GsKHu.js => CSVLayer-CJQy-BsL-SmEBKuSE.js} | 2 +- ...s => CSVSourceWorker-Bks0IzRc-Se00vRoI.js} | 2 +- ...amicGroupLayerView2D-Cf-H7gda-BH_FQvA5.js} | 2 +- ...gFootprintLayerView2D-C0bBWVdF-CXy1ArWp.js | 1 + ...gFootprintLayerView2D-C0bBWVdF-CeR3Mj-n.js | 1 - ...O.js => CatalogLayer-BeO1fLsl-B5ozPHOs.js} | 2 +- .../CatalogLayerView2D-DaUVeBuS-B6e9UrTB.js | 1 + .../CatalogLayerView2D-DaUVeBuS-ZiacRCRh.js | 1 - ...lassBreaksDefinition-bYRgYgPp-VhoiAZje.js} | 2 +- ... CollectionFlattener-DkHuHn5E-dp3hDI2N.js} | 2 +- ...s => ColorBackground-gVZldRLm-Dca2T4QI.js} | 2 +- ...AktW1.js => ColorSet-DkIwOmgs-Bdz0YXw-.js} | 2 +- ...Qv25.js => Container-BcuL1ZEG-DVZvemLA.js} | 2 +- ...ustomParametersMixin-vdKsTHer-5EfrrVMH.js} | 2 +- ...v9oo8.js => Cyclical-C_9rKUUQ-DyGueJyk.js} | 2 +- ...Material_COLOR_GAMMA-D0o2czi9-k4xDAsKM.js} | 2 +- ...e.js => DefaultTheme-Bt5OI-Ht-BKAw1o4a.js} | 2 +- ...rwardEditsParameters-C-_YAZEH-BmXPSua1.js} | 2 +- ...js => DimensionLayer-DFh7fPYo-BMjvVx5w.js} | 2 +- ...EdgeProcessingWorker-DpfeS31e-BlB2l1n2.js} | 2 +- ...l.js => EditBusLayer-Df29OyJh-OmdJOLws.js} | 4 +- ....js => ElevationInfo-yv2-9tj6-CkIHeL1t.js} | 2 +- ...js => ElevationLayer-G6y-P-jo-DIAelIek.js} | 4 +- ...js => ElevationQuery-qAsmERYh-BsVTa_m3.js} | 2 +- ...evationSamplerWorker-BA9k6xuc-BNksF2gT.js} | 2 +- ...xportImageParameters-DxyNGQ57-D1Dwm6AT.js} | 2 +- ...js => ExportStrategy-BNE7Gp0u-CHHOPUHq.js} | 2 +- ...rtWMSImageParameters-CMk80WSM-wEv_P_PY.js} | 2 +- ...LSnKi.js => External-D_wl4XAw-DrOy4LUr.js} | 2 +- ... FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js} | 2 +- ....js => FeatureEffect-CDEk9Es7-Cd4-I1fy.js} | 2 +- ...> FeatureEffectLayer-Cro89IEC-B2s0Xww8.js} | 2 +- ....js => FeatureFilter-BCFHgLVU-DwigNbnH.js} | 2 +- ...0.js => FeatureLayer-BrRKw5Si-DuA2fyE_.js} | 4 +- ... => FeatureLayerBase-vvYyZTfh-DJHk8NKC.js} | 2 +- ...> FeatureLayerSource-k4WMYop1-B19OqXBO.js} | 4 +- ...> FeatureLayerView2D-NmRd_IhT-DLbw0NYz.js} | 2 +- ...eaturePipelineWorker-7KRvCyaS-AamvJuNL.js} | 2 +- ...eatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js} | 2 +- ...reReductionSelection-BjX3h7Sz-B6ZLbiBW.js} | 2 +- ...SnappingSourceWorker-DUCI4USj-Dmeq1rSE.js} | 2 +- ...--W.js => FeatureSet-BkVNthuN-DPQqwkNN.js} | 2 +- ...J.js => FeatureStore-Co2V0sVE-BK6XAR3o.js} | 2 +- ...s => FeatureTemplate-SPHPD45f-CZ7E6_6b.js} | 2 +- ...Ce.js => FeatureType-C9hJmS6_-CNlvn5D1.js} | 2 +- ...CpGOU6Y4.js => Field-C6hA1tZj-CkWoRbmp.js} | 2 +- ...vd.js => FieldsIndex-HmzMbJQG-Du7S47uJ.js} | 2 +- ....js => FloatingArrow-BG9llDYg-Ct2kNlPu.js} | 2 +- ...N.js => GeoJSONLayer-BFFwDRph-C3_g8RHm.js} | 4 +- ... GeoJSONSourceWorker-CLrugTuD-DAF3mwCs.js} | 2 +- ...g_.js => GeoRSSLayer-DgF8xnYi-Cl1Qae5D.js} | 2 +- .../GeoRSSLayerView2D-BLTYupUX-BfrBO27g.js | 1 - .../GeoRSSLayerView2D-BLTYupUX-D6HtIAUl.js | 1 + ....js => GeometryUtils-NHgB9gGQ-DtpzGERq.js} | 2 +- ... => GraphicContainer-DuOHUciE-XlTfJEn3.js} | 2 +- ...> GraphicsCollection-CWTXNZOX-BdlDfR8M.js} | 2 +- ....js => GraphicsLayer-DfeGaYc1-DRpZ_f0G.js} | 2 +- .../GraphicsLayerView2D-CGXlTqHO-BL8cF9rd.js | 1 + .../GraphicsLayerView2D-CGXlTqHO-C-E0GBj7.js | 1 - ...js => GraphicsView2D-C4wYE2ut-DdVMjjMv.js} | 2 +- ...cle.js => GridShader-75bC4UUM-BeEFXp4m.js} | 2 +- ...Yf2.js => GroupLayer-ER-XzoYr-DlHeNdGj.js} | 4 +- ... => GroupLayerView2D-BR-kLeLa-CBq3r1hE.js} | 2 +- ... => HUDMaterial.glsl-BLhEaLk5-DktRuv0T.js} | 2 +- ...s => HeightModelInfo-C5vFqzyF-BH6aliHn.js} | 2 +- ...ightGraphicContainer-Dt5r6lMq-CwALk6za.js} | 2 +- ...s => I3SBinaryReader-DEbI3cKZ-0ASBQHPj.js} | 2 +- ... I3SLayerDefinitions-CwLXCKtU-BdHWzf5u.js} | 2 +- ...-Cczln.js => I3SUtil-Bq8KpP2j--Kmryq4i.js} | 2 +- ...s => IdentityManager-DCHYmv7j-Cs8dnbbY.js} | 4 +- ...r.js => ImageryLayer-B-bJb8lU-DBN_Mc6Q.js} | 4 +- ...> ImageryLayerView2D-CVDvTIGY-BlDqRH6r.js} | 2 +- ... => ImageryTileLayer-DixyNESc-BQ0NIE-T.js} | 6 +- ...ageryTileLayerView2D-nEz2YhMc-DxH8Z9x7.js} | 2 +- ...Nk6xPZ.js => Indices-DEr2HrWx-cFTwC5-9.js} | 2 +- ...atedMesh3DTilesLayer-BEcgXCkk-B81HIVpX.js} | 2 +- ... IntegratedMeshLayer-C-XaBbXd-BuHI7xrr.js} | 2 +- ...=> InterleavedLayout-DXzw3B2n-BlOPeZMB.js} | 2 +- ...69meo.js => KMLLayer-DwQXpcMB-Bnm-cRpP.js} | 2 +- ...js => KMLLayerView2D-hWgNYT5J-BiL2CcA0.js} | 2 +- ... KnowledgeGraphLayer-BjNFJGLf-CnmSgfq3.js} | 2 +- ...ledgeGraphLayerView2D-BnEbgXue-BmCZP-QP.js | 1 + ...ledgeGraphLayerView2D-BnEbgXue-PzhwY4G0.js | 1 - ...owledgeGraphSublayer-DPj4igi1-BoqyUmfs.js} | 2 +- ...6drRf.js => LRUCache-C3erQTWv-grHgYSP-.js} | 2 +- ...zp.js => LabelMetric-BeluzH3o-Br-5CSAC.js} | 2 +- ...CQTFmFQa.js => Layer-ChoECxvZ-BmDHBjO8.js} | 4 +- ...js => LayerFloorInfo-DRJ8wfwx-DKergZyZ.js} | 2 +- ...UWF4.js => LayerView-Bish-E63-DK1SFHE3.js} | 2 +- ...WbM.js => LercWorker-C1_0ReXV-C4s5fobc.js} | 2 +- ... => LineOfSightLayer-D6sUQaEP-83QjyQPT.js} | 2 +- ...js => LinkChartLayer-KcYDvLxD-DTFlqiUN.js} | 2 +- ...Mz.js => Lyr3DWorker-K2Vldrif-DyLstWvT.js} | 2 +- ...O-D2wK6924.js => Map-1zd11DKO-Bme1mjOQ.js} | 4 +- ....js => MapImageLayer-B_rP0PhA-BDp1ZtcT.js} | 2 +- .../MapImageLayerView2D-LI7T-1xm-CBbeiZP3.js | 1 - .../MapImageLayerView2D-LI7T-1xm-ZTi6guUq.js | 1 + ....js => MapNotesLayer-DauvjDLM-CxPThSsi.js} | 2 +- ... MapNotesLayerView2D-EusnP8A_-53usLcYc.js} | 2 +- ...rviceLayerViewHelper-bw3M4B8s-UNSGy25k.js} | 4 +- ...HA1w96.js => MapView-BGOJJ8ch-CJtpe3RS.js} | 6 +- ...ysn.js => MediaLayer-DiCs97gD-S0-qCmPh.js} | 4 +- ...MediaLayerInteraction-BecfG-sO-CDwMElaJ.js | 2 - ...MediaLayerInteraction-BecfG-sO-CtX1hIb1.js | 2 + ... => MediaLayerView2D-COWFkA3m-B8oTarjg.js} | 4 +- ...> MemorySourceWorker-C9E3Klf8-DZ295OVS.js} | 2 +- ...-COeC-iS-.js => Mesh-DLzjDUIO-BwXS6N6_.js} | 4 +- ...MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js} | 2 +- ....js => MeshTransform-C--IG09w-Bbqagf1g.js} | 2 +- ...MeshVertexAttributes-CbNpPur2-c8zcl8rF.js} | 2 +- ...> MeshWriterRegistry-CIC9Yk_f-7OXlu7fG.js} | 2 +- ...ltiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js} | 2 +- ...NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js} | 2 +- ...s => OGCFeatureLayer-DPXQjO1S-CQDhGgy_.js} | 2 +- ...OGCFeatureLayerView2D-CpSy5D2s-DSwmstmQ.js | 1 + ...OGCFeatureLayerView2D-CpSy5D2s-nBaV6Pmc.js | 1 - ...Bqt3mh_.js => Octree-CJNwbhg4-DECX_J2V.js} | 2 +- ...> OpenStreetMapLayer-Bx4EhJij-WBr50b29.js} | 2 +- ... => OperationalLayer-B5IXiMa2-DTTV2F9z.js} | 2 +- ...T-.js => OrderByInfo-GD2XnU8e-BaEpZLaO.js} | 2 +- ...z.js => OrderedLayer-6Qsmrd_l-Ck8MCw7w.js} | 2 +- ...OrientedImageryLayer-CwG5o4Di--YfSXT-B.js} | 2 +- ... => OverlayContainer-BEHcBpu0-4o7Hmqgb.js} | 2 +- ...js => OverrideHelper-DWRbVlj1-BnPmqHJ3.js} | 2 +- ... => PBFDecoderWorker-J6PBo4mo-DjON05MV.js} | 2 +- ...> PieChartMeshWriter-C5yLDFwp-5CAejpYY.js} | 2 +- ...s => PointCloudLayer-CkxImr5P-DqGHCOp3.js} | 2 +- ...dUniqueValueRenderer-C-5hwEaR-CgVBPOu4.js} | 2 +- ... => PointCloudWorker-DB5ewy0Y-CRq7Firo.js} | 2 +- ... PolynomialTransform-C3nWCu0l-BJIAAiDA.js} | 4 +- ...Ae.js => PooledRBush-DbfAmeLn-CPHfm9op.js} | 2 +- ...DfLtnQ8W.js => Popup-DFFZHG5j-Bitz07Ss.js} | 6 +- ...ZYq.js => PortalItem-CctGdnxF-CfFOGshS.js} | 4 +- ...YV.js => PortalLayer-CElnYuSQ-CCe4TMEA.js} | 4 +- ...hIaFuM.js => Program-DLVwTiPA-DI0GKSfI.js} | 2 +- ...s => ProgramTemplate-DQOm6Omy-yxBgwK3o.js} | 2 +- ...DoFNfkjX.js => Query-BrwMGK8U-BPr0_G9t.js} | 2 +- ...56.js => QueryEngine-CH5uUhZK-DRGPyg2C.js} | 2 +- ...efoW.js => QueryTask-CwHwH2rS-D4f5dsGo.js} | 4 +- ...js => QueueProcessor-DbfV9fLy-2F5OgLgJ.js} | 2 +- ...rPresetRendererMixin-D6W9pUY6-Bm_m_CYY.js} | 2 +- ... => RasterSymbolizer-BVys6HkM-DCN-TPRo.js} | 2 +- ...asterVFDisplayObject-CnriTVT9-CVvMEEVD.js} | 2 +- ...E.js => RasterWorker-CzIELPA8-Co7HHa3v.js} | 2 +- ....js => RawBlockCache-Cj_tmHDm-gcQCDGFb.js} | 2 +- ...2a.js => ReactiveMap-CFk6jPfN-CSefy1PZ.js} | 2 +- ...LT.js => ReactiveSet-QxEZenFW-tC7C9rTp.js} | 2 +- ... => RefreshableLayer-a8BQ58Xh-CxfquKbp.js} | 2 +- ...RefreshableLayerView-BdQpGYly-DxrmlBaQ.js} | 2 +- ...7.js => Relationship-Db9GUmYx-B84JspfN.js} | 2 +- ...x.js => Relationship-PyhUibYK-DN6K3ukS.js} | 2 +- ...=> RelationshipQuery-DJsz3K0U-BKFa46R1.js} | 2 +- ...endererLegendOptions-K3md58-X-JLOOdHLz.js} | 2 +- ... => RenderingContext-DbCVbtGZ-Bdgqeuyk.js} | 2 +- ...kYw.js => RouteLayer-BQQ6WxtH-DV30CZ3n.js} | 2 +- ... => RouteLayerView2D-Bpui7Ggx-Dq8ar2NW.js} | 2 +- ...Nf2Z.js => SDFHelper-B6k8Ig6R-CgiA_-9V.js} | 2 +- ...s => ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js} | 2 +- ...0yu.js => SceneLayer-DOh9PmQy-BMYFGe4d.js} | 4 +- ...SnappingSourceWorker-Bt0_pTWo-BD404DAo.js} | 2 +- ... => SceneLayerWorker-BC8rXiXB-DXBHmcTP.js} | 4 +- ...O.js => SceneService-BZqGtWmG-BBytd6YJ.js} | 2 +- ...MKpm.js => Scheduler-B7UX7Wr5-DriQgzLZ.js} | 2 +- ...s => SourceLayerData-BT_Ywuvg-D7mjpcmo.js} | 2 +- ....js => SpatialFilter-BlQBFhwz-B_LMwz1c.js} | 2 +- ...-CGB43GGR.js => Stop-he5xSAJJ-BA1tUkNc.js} | 2 +- ...7_.js => StreamLayer-Bqnt-d3H-Cf1JxEuo.js} | 4 +- ...=> StreamLayerView2D-Bh_aEalU-wWSqPGq-.js} | 2 +- ...s => StyleRepository-D3WuVprR-B1BVbhGB.js} | 2 +- ...js => SublayersOwner-DfTaMJ5V-DrC0bgDm.js} | 4 +- ...=> SubtypeGroupLayer-D1vAbwEU-D1p0P2KY.js} | 4 +- ...btypeGroupLayerView2D-Byn0xzbb-DtCv0vxF.js | 7 +++ ...btypeGroupLayerView2D-Byn0xzbb-Qz-0ZBbK.js | 7 --- ...TR.js => TablesMixin-C8RojhYs-LCBvmsnP.js} | 2 +- ...=> TechniqueInstance-DGTKoOL6-CABoCcdk.js} | 2 +- ... => TelemetryDisplay-Bq2PXfI8-BY_FrklG.js} | 2 +- ....js => TemporalLayer-CpOrN_w9-8nvJFP_-.js} | 2 +- ...4XzHg_.js => Texture-BCt2hphT-Dk2JyWCy.js} | 2 +- ...D2UsCNGl.js => Theme-rblUnB2V-Dc7wtY6B.js} | 2 +- ...-DY4eRS4C.js => Tick-DUHqbpyB-Dd2p6esB.js} | 2 +- ...-Dj1SOP3K.js => Tile-D75RMC64-g8Sx5TPr.js} | 2 +- ....js => TileContainer-D48pXXgL-BzDz3Uqo.js} | 2 +- ...C-9e9.js => TileInfo-CWIRDhZl-RqA7tkOZ.js} | 2 +- ...TileInfoTilemapCache-D1SExPij-BDoYZo_V.js} | 2 +- ...MvJ-lJ.js => TileKey-C5IL-JBr-BGwa3-Dg.js} | 2 +- ...OU3u.js => TileLayer-Be5tWeN5-CUL4Ato2.js} | 2 +- ...s => TileLayerView2D-CT-Yu10P-B6hAJ5mA.js} | 2 +- ...n.js => TilemapCache-CRRxws77-CCC00Yar.js} | 2 +- ...Fxu.js => TimeExtent-Cn0Jofqr-BcCXKjqL.js} | 2 +- ...tzBPZ.js => TimeInfo-w_HB2CsF-B2qHZyfS.js} | 2 +- ...RNYWc.js => TimeOnly-DSMefxKy-BHvJbNji.js} | 2 +- ...ksLaF6.js => Tooltip-B0HefZ7r-CZdyswYp.js} | 2 +- ... => TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js} | 2 +- ...QeJ4.js => TurboLine-CIlsAy5m-C6Kc2De-.js} | 2 +- ... UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js} | 2 +- ...4.js => UnknownLayer-DwWK383_-ChM426K1.js} | 2 +- ...s => UnknownTimeZone-C--TOcPG-9of9030I.js} | 2 +- ... => UnsupportedLayer-CCUtmZ2i-Cmkro0SF.js} | 2 +- ... => UpdateTracking2D-Du_WIf4G-a2xUHmYe.js} | 2 +- ...s => UpdatingHandles-CUu3u1ms-DHvcjtvD.js} | 2 +- ...s => VectorTileLayer-DruyQukp-BQMpjmuu.js} | 2 +- ...ectorTileLayerView2D-B9OYHbL4-ANKZ9nt1.js} | 2 +- ...gg6ENz.js => Version-CoKzbupV-BDyz4v43.js} | 2 +- ...=> VertexArrayObject-M4iRGGoi-BvRnjYBj.js} | 2 +- ...iM5.js => VideoLayer-Dxs-NJSn-NbdKBg3Z.js} | 2 +- ... => VideoLayerView2D-CLcxq4ZA-C6WSWoOW.js} | 2 +- ....js => ViewshedLayer-BYX-h7eL-BRcm_3EL.js} | 2 +- ...Yli.js => VoxelLayer-KL84GttA-C5r9pgtQ.js} | 2 +- ...ZsJwu.js => WFSLayer-DKnx5V8b-BsCCMHBG.js} | 2 +- ...s => WFSSourceWorker-CI7-tY7M-CZ8uM4i-.js} | 2 +- ...3.js => WGLContainer-LxgEo4I_-uPdq0FyK.js} | 2 +- ...ckqqP.js => WMSLayer-C8eYRV4V-lRsRDNhJ.js} | 2 +- ...js => WMSLayerView2D-Dz-z-fa9-D5YTL9WO.js} | 2 +- ...fTlG.js => WMTSLayer-DJY_jjIE-CgOVZJxi.js} | 2 +- ...s => WMTSLayerView2D-Bl5FUDUu-DwwTnV3d.js} | 2 +- ...i.js => WebTileLayer-CUoicUjK-DGq3QB_9.js} | 2 +- ...m2.js => WhereClause-DxwoyBMS-Cwdb_WC4.js} | 2 +- ...=> WorkerTileHandler-DLznBxmP-BNSWrcCp.js} | 2 +- ...K-V5fzo.js => action-GCQoufcz-DQvoWHlv.js} | 2 +- ...o.js => action-group-DhwU7QZv-CXvhCgpT.js} | 2 +- ...3_.js => action-menu-DTIJuZNc-DnQvHied.js} | 2 +- ...-BAEONUn6.js => apng-DuERAVke-D1GuG4Xy.js} | 2 +- ...fTmGx37.js => arcade-CaGqU4sP-DcIDNIme.js} | 2 +- ...> arcadeAsyncRuntime-B-LnqhTo-BP4d9xu9.js} | 2 +- ...TL.js => arcadeUtils-DpP0k7IY-C-RKTwge.js} | 8 +-- ...js => arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js} | 2 +- ...3.js => arcgisLayers-CL8_MH7S-u1jA7AmV.js} | 4 +- ...dFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js} | 2 +- ...h.js => boundedPlane-DlvE0eNx-BQ9Xop25.js} | 2 +- .../calcite-action-2fclGKoO-DEiRzt3o.js | 1 + .../calcite-action-2fclGKoO-DO9-6_VR.js | 1 - ...> calcite-action-bar-ugh74qU5-C59I7NOF.js} | 2 +- .../calcite-action-group-qlkUfh_o-H6U8Q6wA.js | 1 + .../calcite-action-group-qlkUfh_o-wUTthgYu.js | 1 - ...js => calcite-button-Cm9_TJei-DvwKP8jU.js} | 2 +- ...j.js => calcite-chip-DE_c-1hr-DI1-84AU.js} | 2 +- ...js => calcite-dialog-DAngwHC1-C6d9gJgf.js} | 2 +- ... => calcite-dropdown-CLrG397W-Dl2b91G4.js} | 2 +- ...lcite-dropdown-group-0sIPwaDd-DiD7sdrQ.js} | 2 +- ...alcite-dropdown-item-DpLfv4A0-CIOTjei7.js} | 2 +- ...y.js => calcite-flow-CAdorlph-DQjwYgyL.js} | 2 +- ...=> calcite-flow-item-uRuGc3ks-Cp1dKuD0.js} | 2 +- .../assets/calcite-icon-laqhdRBY-8qK5FfMb.js | 1 + .../assets/calcite-icon-laqhdRBY-Dn93dMQE.js | 1 - .../assets/calcite-input-BKRd7MCS-BhvpT25V.js | 1 + .../assets/calcite-input-BKRd7MCS-DN64wHsO.js | 1 - ....js => calcite-label-DMj3M4QR-BaEG55cn.js} | 2 +- ...=> calcite-list-item-VYBhSMxV-C8kSjE5V.js} | 2 +- ...cite-list-item-group-CuQ2MPLW-CwdP7Iq_.js} | 2 +- ...H.js => calcite-list-rnu1YzAl-DCH8F59s.js} | 2 +- .../calcite-loader-CtpHSU2--B8aaTEnB.js | 1 + .../calcite-loader-CtpHSU2--Bzq4cVWG.js | 1 - ...js => calcite-notice-DeAGopAs-BI9wdRMa.js} | 2 +- ...s => calcite-tooltip-63c9fmIw-BI9m24xG.js} | 2 +- ...MI.js => chartCommon-rWfJsTPl-C_UBBu0e.js} | 2 +- ....js => chartUtilsAm5-CtY-kHPy-KDNsYH7z.js} | 2 +- ...js => cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js} | 2 +- ...> clientSideDefaults-BqqayPct-Vv2Kv9CL.js} | 2 +- ...xZS.js => colorRamps-q0bZVhs2-BnivlaV9.js} | 2 +- ...H1b.js => colorUtils-Cthpxcks-cHaMZbaf.js} | 2 +- ... => commonProperties-BtIqvFU_-DbZji2Rx.js} | 2 +- .../assets/compilerUtils-CV1QYWI8-C9dYdAV0.js | 1 - .../assets/compilerUtils-CV1QYWI8-VdY86_Y-.js | 1 + ...nToOriginAndRotation-wF0y9WQG-CNvG_ff4.js} | 2 +- ...s => conditionalSlot-DsCzytJ4-DM7mn4Oa.js} | 2 +- ...onvertMeshVertexSpace-BO7NR5uA-DNqSWhor.js | 1 - ...onvertMeshVertexSpace-BO7NR5uA-DneeGgyd.js | 1 + ... => createConnection-CrkuTLXs-CK5s-xN-.js} | 4 +- ...Ixnj.js => dataUtils-BkPy4R3C-Dzc1QGGb.js} | 2 +- ...ab.js => deduplicate-D2d-E5Pw-CTlujluz.js} | 2 +- ...> deleteForwardEdits-BHWvOnK8-P72OARG2.js} | 2 +- ...js => details-screen-DE85sbTV-BZ2qdeGe.js} | 2 +- ...3Qm4.js => diffUtils-Cz3Fi8Xb-Cwe8AFcX.js} | 2 +- ...fJ.js => drapedUtils-BZ1SGPtE-bBUh2hex.js} | 2 +- ...js => edgeProcessing-CALv8P-b-sDvNynj9.js} | 2 +- ...js => editingSupport-gUqP9iyf-C_ld1skV.js} | 2 +- ...V.js => editingTools-BZ3yVmXf-C6oQif6A.js} | 4 +- ...iY.js => editsZScale-BDsX6vv--C-4n90TZ.js} | 2 +- ...> elevationInfoUtils-mOZsPH2J-BlRQDLDN.js} | 2 +- ... => executeBinsQuery-26-59HNS-DKYB7wBm.js} | 2 +- .../assets/executeForIds-Z1gkLduF-CrWEksFG.js | 1 + .../assets/executeForIds-Z1gkLduF-D8DZG8qZ.js | 1 - .../executeForTopCount-Dx1gCDe1-BVXGJFEi.js | 1 + .../executeForTopCount-Dx1gCDe1-JhF_sU0m.js | 1 - .../executeForTopExtents-3NOTiZTn-7q7qEr0x.js | 1 + .../executeForTopExtents-3NOTiZTn-K-9KTgQh.js | 1 - .../executeForTopIds-BWxBZygF-D-DeY4Tc.js | 1 + .../executeForTopIds-BWxBZygF-myXyOtDE.js | 1 - .../executeQueryJSON-CcHnccia-BW7_NQxl.js | 1 - .../executeQueryJSON-CcHnccia-M-vnTvKl.js | 1 + ...s => executeQueryPBF-o8010HS9-B7Z-YQyg.js} | 2 +- ...uteRelationshipQuery-BlX9_g4g-QPs1Jx7X.js} | 2 +- ...ecuteTopFeaturesQuery-CjTd36wS-B31_Gdx0.js | 1 - ...ecuteTopFeaturesQuery-CjTd36wS-CcVA1k2F.js | 1 + ...C2TWXwY.js => fabric-Df28hv38-DoClkw8Q.js} | 2 +- ...atureConversionUtils-D6hFQ4Af-qxGGE-I8.js} | 2 +- ...=> featureLayerUtils-BlPdhYbm-B3ZkIjKd.js} | 2 +- ...=> featureLayerUtils-DgfQQyK4-Cfw8eI8B.js} | 4 +- ...eatureReferenceUtils-Ct4KY5u7-DuNl8LtH.js} | 2 +- ...s => featureSetUtils-wd4FcF3A-Bjqg1VXd.js} | 2 +- ...js => featuresetbase-BDDCCC0O---spEhjc.js} | 2 +- ...js => featuresetgeom-BftbGgg3-BLGpCbU5.js} | 2 +- ...s => featuresetstats-CY6YJ8Jt-BEjsGFcp.js} | 2 +- ... => featuresetstring-DFELZWNA-DaxbyWAc.js} | 2 +- ...J.js => fetchService-DbaKmJhP-Ccg-phWf.js} | 4 +- ...s => fieldProperties-Bq26w7gt-BiKrD4ue.js} | 2 +- ...CO5s.js => fieldType-CD2CL2hr-Do9kp-dx.js} | 2 +- ...aPaZ.js => floatRGBA-4pIJN00G-Cz2BV8ih.js} | 2 +- ..._R.js => floating-ui-DKFFlLv3-8lk8tQD2.js} | 2 +- ...-DZVFUlxN.js => form-CRSw616T-wY3ZjFlq.js} | 2 +- ....js => geodesicUtils-B8mFUfTk-BNOCxMeb.js} | 2 +- ...F87hyc.js => geojson-CNt_qtQf-X0105Nc8.js} | 2 +- ...korn.js => geomasync-uGYsifQH-B8w8CEL3.js} | 2 +- ...js => geometryEngine-CdPoFSE4-ChEr_3ja.js} | 2 +- ... geometryEngineAsync-D7oEu5dd-CZIKaTd9.js} | 2 +- ...geometryServiceUtils-nsujb7BH-BeXUhRCo.js} | 2 +- ...2-DsEs7FgS.js => gif-BZzSowd2-49ll32ZF.js} | 2 +- ...bRp.js => gltfexport-Dj6nF2RN-CAFBwudx.js} | 2 +- ...s => groupLayerUtils-D-25JsA_-CvTWRcG7.js} | 2 +- ...xobs4.js => grouping-RwmXkHDc-CCFLL7L_.js} | 2 +- ...BrTtAlS.js => header-BRE2xzQs-CjQ_sd4f.js} | 2 +- ...L.js => heatmapUtils-seiMkkkR-CrSLbaQx.js} | 2 +- ...5_ysY.js => hydrated-CplJC1Fs-McBHp1Y5.js} | 2 +- ...-BUyrjp8g.js => icon-BXFbBbop-Bq4Zv26A.js} | 2 +- ... => imageBitmapUtils-DA36kg39-BfNbbEDs.js} | 2 +- ...mEY.js => imageUtils-BA2D6Uf1-CYx0DlwL.js} | 4 +- ...-vs.js => imageUtils-Co-ELErj-D3GFlUnZ.js} | 2 +- ...Z.js => imageryUtils-6MVSqijr-2ufISwt4.js} | 2 +- ...D5qo9Ek1.js => index--i98kM5n-wnGfY6-E.js} | 2 +- ...DXktt_T1.js => index-5nGe0Bgx-PuzIaK3Y.js} | 2 +- ...DVsFK_oh.js => index-7blUq_oP-dtZV9W0P.js} | 2 +- ...BsOnjtDb.js => index-98it_ulG-w2DJElWd.js} | 2 +- ...C5AduZae.js => index-B0lfXXMz-B4yTazBh.js} | 2 +- ...Dm0i0OJc.js => index-BAU9PUzR-GOdyBPEe.js} | 4 +- ...BPmciRPg.js => index-BCHMro24-CwIpWYn_.js} | 4 +- ...DyyAtPyf.js => index-BSr9u_6r-ynd9tPq5.js} | 4 +- ...B5GWFE2k.js => index-Bo-4afBP-DBinFmis.js} | 2 +- ...rV_P8aO5.js => index-CDhNyq-A-E2rRJpfZ.js} | 4 +- ...ChyOSGzz.js => index-CMEOtVDx-BTZ-Taoh.js} | 4 +- ...D1Fjorzw.js => index-CRabsHaP-BfTKXoCA.js} | 2 +- ...dFHsYLYO.js => index-CWPzg1w2-Duz60wim.js} | 2 +- ...rJJ_H7b3.js => index-CfINOE3J-D35QOhUy.js} | 2 +- ...m0hgXXvs.js => index-ChMe1Rap-CzOnqpfO.js} | 4 +- ...hm1bMD7r.js => index-CobT58Py-D8ewubJk.js} | 4 +- ...DyH65FLJ.js => index-CuDicHX--VLwELiqf.js} | 2 +- ...o1pa2FUA.js => index-Czft7XuG-BLbk_j4S.js} | 2 +- ...C3tgdysx.js => index-DDW2D8Uj-BucO7Mr0.js} | 2 +- ...BUFT5eJ2.js => index-DH-yVcMF-o6W3s-NP.js} | 2 +- ...q_J35KkL.js => index-DLWeBByc-DDoUT1cR.js} | 2 +- ...CqvPwsqc.js => index-DMxHNnSm-Dbw9Xbwt.js} | 4 +- ...BJGx8CJ2.js => index-DRrktYRZ-Cdk3b_aC.js} | 2 +- ...CNSHrnyD.js => index-DY4XJa1m-CinpT_5l.js} | 2 +- ...BlZPQ9vY.js => index-DfBq89c3-eMYAVigg.js} | 4 +- ...CFxZGX5E.js => index-DmuJEjwc-CFoy2sko.js} | 4 +- ...Dd8g4fh-.js => index-DxH-DOHz-BNodbAX5.js} | 4 +- ...ztAvlKEH.js => index-I3HFsMjx-DYqxaWUq.js} | 2 +- ...VEDWJShX.js => index-WLSkOrf3-CdD0dr9H.js} | 4 +- ...DdarRIaz.js => index-sFd78-sx-Df2sAvfD.js} | 2 +- ...wuPmAAc.js => input2-eOtqu-iO-DiRyHCWP.js} | 2 +- ...jA.js => interactive-DqhNilgd-BbTDbq0n.js} | 2 +- ...-BK_A0qEn.js => item-DaimTDdD-CosqhjDY.js} | 2 +- ...Sw.js => jsonContext-BA8GHqVk-BsXRY5es.js} | 2 +- ...8NjK.js => jsonUtils-C64Zfu7c-BtrwAD3_.js} | 2 +- ...vCCq.js => jsonUtils-wIllKWI4-MQQ-E5fj.js} | 2 +- ...sC6o.js => jszip.min-C61Pcz7i-CEwjNmOq.js} | 2 +- ...zFJRs.js => kmlUtils-C5oIEoOy-CPvy9nME.js} | 2 +- ...nowledgeGraphService-DOJz0fzA-BlihQLi8.js} | 2 +- ...js => knowledgegraph-Dt7zfNlJ-CqBwig9B.js} | 4 +- ...VJn.js => labelUtils-BW14kBqX-Tk7uOiPw.js} | 2 +- ...q.js => labelingInfo-DGVNul26-BDBqWm17.js} | 2 +- ....js => languageUtils-BYxF9hRA-DnySuvAL.js} | 2 +- ...js => layerViewUtils-DURAPenP-BGA3o1Pf.js} | 2 +- ....js => layersCreator-CW56kDKc-CkfoFLoQ.js} | 2 +- ...s.js => layersLoader-CYI-LpLl-CUvaEb6F.js} | 2 +- ...wl.js => lengthUtils-DKpMe5qR-CsqJSDh_.js} | 2 +- ...GC.js => lineSegment-CcqvCARM-CDEWcAzV.js} | 2 +- ...tGGDtb.js => loadAll-e978YItg-4pMG3qU7.js} | 2 +- ...a.js => loadGLTFMesh-C3-0Tu0H-DZasI2OI.js} | 2 +- ...SNQAA.js => loadable-DbNDKH4r-CSXrQx_7.js} | 2 +- ...UAf9YhQ.js => loader-Ch7Jr16w-CF4bv9QO.js} | 2 +- ...WQrU9Z8.js => loader-CkLCe-E_-BkhKaKBj.js} | 2 +- ...r3RKmd3.js => locale-Cn_GDVD_-CCUxSwPB.js} | 2 +- .../{main-ugzBrWNm.js => main-QGPoLsvl.js} | 4 +- ...j9.js => mapViewDeps-CUVU8gUp-CjUjdWc1.js} | 6 +- ...-DVqdGrVU.js => mat4-DX7gBViE-6clJxb1Q.js} | 2 +- ...s => mediaLayerUtils-CasWezAG-xuUSkW-V.js} | 2 +- ...eshFeatureAttributes-BwKR5odo-DaS-LG48.js} | 2 +- ...js => meshFeatureSet-zeR2pNmE-Cmclz5Cy.js} | 2 +- ...lReferenceScaleUtils-B1zR72Os-ndChBRyc.js} | 2 +- ...meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js} | 2 +- ...ultidimensionalUtils-BwTugeu7-C75LYPc9.js} | 2 +- ...js => normalizeUtils-Bxmy9MNI-fHOpXwKi.js} | 2 +- ...normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js} | 2 +- ...> normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js} | 2 +- ...I8aiR_7.js => number-eRKYXfX9-bCdnHRN-.js} | 2 +- ... objectResourceUtils-CelAKRU2-CPIFq_KQ.js} | 4 +- ...ivHR.js => observers-BigwqTsw-CfIXp3Nz.js} | 2 +- ...s => ogcFeatureUtils-Bs12bZY3-bQ3aM3rZ.js} | 2 +- ...> openCloseComponent-BGQ6h7vg-BO0gc3O8.js} | 2 +- ...reQueryEngineAdapter-DFdaawxC-BTfsw2OK.js} | 2 +- ... orientedBoundingBox-oHezdpWm-ilptOsP0.js} | 2 +- ...rW.js => p2-screen-1-CQoqpp13-CqrIhWtO.js} | 2 +- custom-toc-highlight/assets/panel-DET9aFON.js | 1 + ...Bbd7sTo9.js => panel-DRUEhsxp-KxESJ732.js} | 2 +- custom-toc-highlight/assets/panel-DyBVvGsg.js | 1 - ...9jRH52J.js => parser-DyDJ-rlI-CvOs11Ip.js} | 2 +- ...O-DQKnyfOm.js => pbf-D-y3_eZO-CpHdkhuD.js} | 2 +- ....js => pbfQueryUtils-F4ZE8-K8-vP84FrXE.js} | 2 +- ...4h.js => persistable-C6RBwzJi-CrVVP3ny.js} | 2 +- ... => perspectiveUtils-Bu88xlbg-Cn6YpKwC.js} | 2 +- ...Sy6JQ.js => pieChart-qcxaoQkv-jYI0rZLi.js} | 2 +- ...CVSP2GQG.js => plane-Dt8R0KeE-Bqc6oVGz.js} | 2 +- ...byj.js => popupUtils-B0uZcXX0-DHyOz1jC.js} | 2 +- ...cHP.js => popupUtils-nV1O8RUO-BYG2KoFf.js} | 2 +- ...s => portalItemUtils-B8bw6SAG-DF460C0Y.js} | 2 +- ...4.js => portalLayers-Bh9bAhk4-Y1T2RWf3.js} | 2 +- .../assets/portalUtils-CKN9iXwH-B2zCer9u.js | 1 - .../assets/portalUtils-CKN9iXwH-BDO5uTJS.js | 1 + ...iiXhMD.js => project-DQKhruav-CyFgbMSU.js} | 2 +- ....js => projectBuffer-CvCBvJ6W-KqAd8Vef.js} | 2 +- ...ctMeshVertexPositions-CFs_XMKX-CCginunE.js | 1 - ...ctMeshVertexPositions-CFs_XMKX-Dz5wYyNf.js | 1 + ...projectPointToVector-B2UUY9SE-BIKNGLey.js} | 2 +- ...rojectVectorToVector-sIYLNlex-DexDhaq1.js} | 2 +- ...VXt.js => projection-BA9M1R7d-CAbqHZiw.js} | 4 +- ...=> quantizationUtils-bJy1cRwp-DFYZs_ns.js} | 2 +- ...-BrXZAXDf.js => quat-BODLR7mS-BQk2dgMZ.js} | 2 +- .../assets/query-BAUG6dav-B_Pyr3t8.js | 1 + .../assets/query-BAUG6dav-DJjDADlE.js | 1 - ...gbjlxRZk.js => query-DFW9-NG_-C3TyGmiM.js} | 2 +- ... => queryAttachments-Bgvu3RnK-BeW9ZnXf.js} | 2 +- ... => queryTopFeatures-IbhAPJlP-DZGdrKJR.js} | 2 +- ...P5X.js => queryUtils-Brxu6254-CDiE0zms.js} | 2 +- ...5B.js => queryZScale-BiYV6Pr6-B7zp5L1G.js} | 2 +- ...sterProjectionHelper-Calp0o_1-DLz-N_Wv.js} | 4 +- ...HL.js => rasterUtils-DqAu9qES-Be2s-rDn.js} | 2 +- ... => rasterizingUtils-BmlDdKBf-BP52xgN-.js} | 2 +- ...xRJBjh.js => request-5gjwL9xx-Di1pi9yX.js} | 2 +- ...=> requestImageUtils-Ut4YcoNU-CZnNufeN.js} | 2 +- ...=> resourceExtension-CdQvIDKV-DCvzsrJt.js} | 2 +- ....js => resourceUtils-BmW6QqlX-D_AxNrCI.js} | 4 +- ....js => resourceUtils-Ds65naCv-PY5SfRMU.js} | 2 +- ....js => resourceUtils-rTM6Iemx-GPPQBysx.js} | 2 +- ...ewby.js => saveUtils-CIYk-dsQ-Br9QCJTX.js} | 2 +- ...5W4.js => scaleUtils-DxsfQwK1-CzyfErWH.js} | 2 +- ...o1xWElA.js => screen-BGsID61t-BTqeBZJo.js} | 2 +- ...c6n_y5I.js => screen-CcinMdyM-CM_vb3KL.js} | 2 +- ...xLtN1_r.js => screen-CmNk4p3g-CWwKxIyL.js} | 2 +- ...qBjqxx_.js => screen-D-fcMt_1-D3QyEveF.js} | 2 +- ...f21b3uS.js => screen-DOMT-YVI-wvT49eu9.js} | 2 +- ...tDirMSz.js => screen-DTrOvIb7-CxTZcnC-.js} | 4 +- ...EJO0pOT.js => screen-N-CoZlcH-D0u53zN0.js} | 2 +- ...6NVgv_3.js => screen-NGXXpKUs-DF8RN7bq.js} | 2 +- ...7Z9GxGM.js => screen-bYjBkDBU-CqvHQESh.js} | 2 +- ...DGs-Ow3.js => screen-oq2ZVtwf-B7xZh-jW.js} | 2 +- ...piHFK6N.js => screen-x-yg_fPu-CAXKOE6F.js} | 2 +- ...DU79ospE.js => scrim-BscQh4v9-CloQFru7.js} | 2 +- ...iceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js} | 2 +- ...8KlJvO_.js => shared-D1w-26bA-BBIRhcUQ.js} | 2 +- ...6Bxjq9.js => shp.min-rg-oXwj1-yfa7dGlo.js} | 2 +- ...hpyJ8yp.js => signal-CETehA7D-DQA5V72u.js} | 2 +- ...rC.js => sourceUtils-BMeqkJ5g-DcR3VPl5.js} | 2 +- ...erenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js} | 2 +- ...aZ5Vv8x.js => sphere-BenPORjV-B4uz1SYF.js} | 2 +- ...BF.js => statsWorker-C0rnMAI--CdD2XdJS.js} | 2 +- ...{story-D5JOvNzl.css => story-DbFhYdqg.css} | 2 +- .../{story-BfX8CRfG.js => story-Doly9N9p.js} | 60 +++++++++---------- ... => streamLayerUtils-CLc_16nt-qAXYcZQO.js} | 2 +- ...Rgz.js => styleUtils-BtpNqZyT-Bnq2S5kK.js} | 2 +- ...rWd.js => styleUtils-ChrJTYIw-C6xq7Jeu.js} | 2 +- ....js => sublayerUtils-CyM0QC5B-B1ryunQi.js} | 2 +- ...avp.js => substitute-j49H6mVR-DTufu01J.js} | 2 +- .../symbolLayerUtils-DAaEQEr6-Bj3jPwWU.js | 2 + .../symbolLayerUtils-DAaEQEr6-Dvu4w6pW.js | 2 - ...J-D4zmKT16.js => t9n-C_hcZMZJ-Du2NPCXI.js} | 2 +- ...VGPremultipliedAlpha-DoZe_f0d-BwcxFsN9.js} | 2 +- ...Es2.js => themeUtils-YjM7iIiX-DGrOr3vp.js} | 2 +- ...VI.js => timeSupport-jPViR5jn-7bshRI7L.js} | 2 +- ...gT.js => timeSupport-ohWmWReZ-D2lpSlXU.js} | 2 +- ...oggle-switch-control-B4JzuvHa-B1HiDvC7.js} | 2 +- ...Ohwz3.js => triangle-hqU-Tc1X-CaBFJROi.js} | 2 +- ...A.js => uploadAssets-fBa6NH35-BYiJ1e4f.js} | 2 +- ...KicvrT8N.js => utils-9sQxfkoa-D8FX0sO8.js} | 2 +- ...Btpo3M9u.js => utils-BVWK2jiA-i-Dn2Ad8.js} | 2 +- ...-_SaacS5.js => utils-Bq23Xwmj-CKlS81kz.js} | 2 +- ...CAwuJg76.js => utils-DPtQ14k3-CBDffBYM.js} | 4 +- ...-a87iok1.js => utils-Dcs650Ic-LHpLlTO1.js} | 2 +- ...BQ5pghrp.js => utils-DyydRFHu-1ITtOELE.js} | 2 +- ...wUwu1nm1.js => utils-HtkT8Fn3-Dd_0rdy5.js} | 2 +- ...B3hR8LxB.js => utils-SPbpQbmm-CiwW7WzR.js} | 2 +- ...B78XlSIE.js => utils-tNxq3jkf-nfQcZo7O.js} | 2 +- ...T4-U7N_.js => utils3-BSH0zqNl-90fd1I_b.js} | 2 +- ...-PdcGTXFi.js => vec3-BazNroeq-CRjQH4Pj.js} | 2 +- ...BjayBdwt.js => vec32-D9GsKZ1t-BPSFE14A.js} | 2 +- ...-BagfV9qf.js => vec4-DWDdg1fj-BHg6FqkT.js} | 2 +- ...g.js => versionUtils-LZYZz-38-B8C5OAjF.js} | 2 +- ...ertexSpaceConversion-CiKaVq_u-BlKMsg2c.js} | 2 +- ... visualVariableUtils-D3kZJRyn-tyrXoPjU.js} | 2 +- .../vue.esm-bundler-D2erd_gM-C7Afc0Sc.js | 1 + .../vue.esm-bundler-D2erd_gM-D0q3-bhf.js | 1 - ... webStyleSymbolUtils-BxoWoVrm-BPh4zlRp.js} | 2 +- ...gmjx.js => webglDeps-Bgavuh0h-31Q0Fngh.js} | 2 +- ...jDgDj.js => wfsUtils-DoLaqXsj-DBVQwnFp.js} | 2 +- ...kDTJa3.js => workers-PiCjreoO-Dc6Tqm-o.js} | 4 +- ...mf9.js => writeUtils-D5qlLkwk-enZap9KW.js} | 2 +- ...tGK0KM.js => xyChart-Ch-p5aUf-CLpax4aT.js} | 2 +- custom-toc-highlight/index-ca-en.html | 2 +- custom-toc-highlight/index-ca-fr.html | 2 +- custom-toc-highlight/index.html | 2 +- 530 files changed, 605 insertions(+), 605 deletions(-) rename custom-toc-highlight/assets/{AGraphicContainer-LUCT6Gle-Dvv0TF4N.js => AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js} (88%) rename custom-toc-highlight/assets/{APIKeyMixin-BUMSx9ny-D_H-H5sI.js => APIKeyMixin-BUMSx9ny-C9ZHhLj0.js} (86%) rename custom-toc-highlight/assets/{Analysis-BPgJ-FCw-D6W8PmkR.js => Analysis-BPgJ-FCw-CJ_Utx59.js} (92%) rename custom-toc-highlight/assets/{ArcGISCachedService-C64Ko1TY-9EmQxNmS.js => ArcGISCachedService-C64Ko1TY-COmlLbBz.js} (86%) rename custom-toc-highlight/assets/{ArcGISService-BYA-y6X6-C_YhndKK.js => ArcGISService-BYA-y6X6-DNHMEBm_.js} (78%) rename custom-toc-highlight/assets/{AttachmentInfo-D9RFO8W2-DYgfjXim.js => AttachmentInfo-D9RFO8W2-CMU9-WNo.js} (96%) rename custom-toc-highlight/assets/{AttributeArray-BWXEft_i-ZluJi335.js => AttributeArray-BWXEft_i-lURl2Jp5.js} (97%) rename custom-toc-highlight/assets/{AttributeStore-DjyP9U7y-CD_qG3Wh.js => AttributeStore-DjyP9U7y-Cmhm9XHS.js} (98%) create mode 100644 custom-toc-highlight/assets/BaseDynamicLayerView2D-AQ-6l0DU-CktIES_E.js delete mode 100644 custom-toc-highlight/assets/BaseDynamicLayerView2D-AQ-6l0DU-fdOF1reR.js rename custom-toc-highlight/assets/{Basemap-BEqqSTw9-B5O9ub1-.js => Basemap-BEqqSTw9-yGsB1EL7.js} (97%) rename custom-toc-highlight/assets/{BingMapsLayer-BigMnKl_-CZ_oLWcb.js => BingMapsLayer-BigMnKl_-BCPSKyeE.js} (89%) rename custom-toc-highlight/assets/{BinsQuery-DjwQZqB8-DL4eLh1p.js => BinsQuery-DjwQZqB8-Ch0CPJ5I.js} (94%) rename custom-toc-highlight/assets/{Bitmap-CcqmzvfR-Bqft9oF3.js => Bitmap-CcqmzvfR-C22fE2NY.js} (94%) rename custom-toc-highlight/assets/{BitmapContainer-BC8fvmFc-myTzpniv.js => BitmapContainer-BC8fvmFc-C6Z_3UuF.js} (82%) rename custom-toc-highlight/assets/{BlendLayer-D1WkSmwP-Bad8_eoW.js => BlendLayer-D1WkSmwP-BeUsb4u9.js} (86%) rename custom-toc-highlight/assets/{BoundsStore--N6o1xkF-BnCtocGj.js => BoundsStore--N6o1xkF-CQrhMeDa.js} (93%) rename custom-toc-highlight/assets/{BufferObject-BM_7mcDb-Dq7c9k7y.js => BufferObject-BM_7mcDb-EYaqMhmk.js} (96%) rename custom-toc-highlight/assets/{BufferView-PQoE3GL7-Duht5lAO.js => BufferView-PQoE3GL7-B9DLdqO9.js} (99%) rename custom-toc-highlight/assets/{BuildingSceneLayer-IIePcdNz-52pkRQg3.js => BuildingSceneLayer-IIePcdNz-BJDsdW-f.js} (80%) rename custom-toc-highlight/assets/{Button-MQvwxOnj-CVmrxfGx.js => Button-MQvwxOnj-Bxdd1k4u.js} (96%) rename custom-toc-highlight/assets/{CSVLayer-CJQy-BsL-BUdGsKHu.js => CSVLayer-CJQy-BsL-SmEBKuSE.js} (66%) rename custom-toc-highlight/assets/{CSVSourceWorker-Bks0IzRc-Bvmv8LHM.js => CSVSourceWorker-Bks0IzRc-Se00vRoI.js} (83%) rename custom-toc-highlight/assets/{CatalogDynamicGroupLayerView2D-Cf-H7gda-CFkeOMDr.js => CatalogDynamicGroupLayerView2D-Cf-H7gda-BH_FQvA5.js} (58%) create mode 100644 custom-toc-highlight/assets/CatalogFootprintLayerView2D-C0bBWVdF-CXy1ArWp.js delete mode 100644 custom-toc-highlight/assets/CatalogFootprintLayerView2D-C0bBWVdF-CeR3Mj-n.js rename custom-toc-highlight/assets/{CatalogLayer-BeO1fLsl-idS3vnNO.js => CatalogLayer-BeO1fLsl-B5ozPHOs.js} (79%) create mode 100644 custom-toc-highlight/assets/CatalogLayerView2D-DaUVeBuS-B6e9UrTB.js delete mode 100644 custom-toc-highlight/assets/CatalogLayerView2D-DaUVeBuS-ZiacRCRh.js rename custom-toc-highlight/assets/{ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js => ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js} (95%) rename custom-toc-highlight/assets/{CollectionFlattener-DkHuHn5E-BKutaakg.js => CollectionFlattener-DkHuHn5E-dp3hDI2N.js} (93%) rename custom-toc-highlight/assets/{ColorBackground-gVZldRLm-C2pKGijH.js => ColorBackground-gVZldRLm-Dca2T4QI.js} (66%) rename custom-toc-highlight/assets/{ColorSet-DkIwOmgs-C-GAktW1.js => ColorSet-DkIwOmgs-Bdz0YXw-.js} (95%) rename custom-toc-highlight/assets/{Container-BcuL1ZEG-DxXVQv25.js => Container-BcuL1ZEG-DVZvemLA.js} (98%) rename custom-toc-highlight/assets/{CustomParametersMixin-vdKsTHer-BOFVTNLw.js => CustomParametersMixin-vdKsTHer-5EfrrVMH.js} (82%) rename custom-toc-highlight/assets/{Cyclical-C_9rKUUQ-Dl9v9oo8.js => Cyclical-C_9rKUUQ-DyGueJyk.js} (92%) rename custom-toc-highlight/assets/{DefaultMaterial_COLOR_GAMMA-D0o2czi9-9voYmtHA.js => DefaultMaterial_COLOR_GAMMA-D0o2czi9-k4xDAsKM.js} (96%) rename custom-toc-highlight/assets/{DefaultTheme-Bt5OI-Ht-Dfb13wye.js => DefaultTheme-Bt5OI-Ht-BKAw1o4a.js} (99%) rename custom-toc-highlight/assets/{DeleteForwardEditsParameters-C-_YAZEH-CFtVONl6.js => DeleteForwardEditsParameters-C-_YAZEH-BmXPSua1.js} (75%) rename custom-toc-highlight/assets/{DimensionLayer-DFh7fPYo-D38O23av.js => DimensionLayer-DFh7fPYo-BMjvVx5w.js} (89%) rename custom-toc-highlight/assets/{EdgeProcessingWorker-DpfeS31e-DC_uae2i.js => EdgeProcessingWorker-DpfeS31e-BlB2l1n2.js} (86%) rename custom-toc-highlight/assets/{EditBusLayer-Df29OyJh-DkVkxUAl.js => EditBusLayer-Df29OyJh-OmdJOLws.js} (88%) rename custom-toc-highlight/assets/{ElevationInfo-yv2-9tj6-C2hC6Vpl.js => ElevationInfo-yv2-9tj6-CkIHeL1t.js} (95%) rename custom-toc-highlight/assets/{ElevationLayer-G6y-P-jo-Dn65xXOv.js => ElevationLayer-G6y-P-jo-DIAelIek.js} (81%) rename custom-toc-highlight/assets/{ElevationQuery-qAsmERYh-BRPoXapf.js => ElevationQuery-qAsmERYh-BsVTa_m3.js} (98%) rename custom-toc-highlight/assets/{ElevationSamplerWorker-BA9k6xuc-Eny38BBu.js => ElevationSamplerWorker-BA9k6xuc-BNksF2gT.js} (64%) rename custom-toc-highlight/assets/{ExportImageParameters-DxyNGQ57-0etxSPmv.js => ExportImageParameters-DxyNGQ57-D1Dwm6AT.js} (93%) rename custom-toc-highlight/assets/{ExportStrategy-BNE7Gp0u-j76jQ8Ao.js => ExportStrategy-BNE7Gp0u-CHHOPUHq.js} (93%) rename custom-toc-highlight/assets/{ExportWMSImageParameters-CMk80WSM-sFuOAfxa.js => ExportWMSImageParameters-CMk80WSM-wEv_P_PY.js} (95%) rename custom-toc-highlight/assets/{External-D_wl4XAw-P7VLSnKi.js => External-D_wl4XAw-DrOy4LUr.js} (96%) rename custom-toc-highlight/assets/{FeatureCommandQueue-DzV-HBIG-BApspUo_.js => FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js} (98%) rename custom-toc-highlight/assets/{FeatureEffect-CDEk9Es7-CEiHf7-6.js => FeatureEffect-CDEk9Es7-Cd4-I1fy.js} (90%) rename custom-toc-highlight/assets/{FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js => FeatureEffectLayer-Cro89IEC-B2s0Xww8.js} (68%) rename custom-toc-highlight/assets/{FeatureFilter-BCFHgLVU-CXZvxasm.js => FeatureFilter-BCFHgLVU-DwigNbnH.js} (89%) rename custom-toc-highlight/assets/{FeatureLayer-BrRKw5Si-D6Z5CL70.js => FeatureLayer-BrRKw5Si-DuA2fyE_.js} (80%) rename custom-toc-highlight/assets/{FeatureLayerBase-vvYyZTfh-j6CuO_ok.js => FeatureLayerBase-vvYyZTfh-DJHk8NKC.js} (98%) rename custom-toc-highlight/assets/{FeatureLayerSource-k4WMYop1-BFUwA-tw.js => FeatureLayerSource-k4WMYop1-B19OqXBO.js} (81%) rename custom-toc-highlight/assets/{FeatureLayerView2D-NmRd_IhT-CufQiRFK.js => FeatureLayerView2D-NmRd_IhT-DLbw0NYz.js} (95%) rename custom-toc-highlight/assets/{FeaturePipelineWorker-7KRvCyaS-Coq5DT_2.js => FeaturePipelineWorker-7KRvCyaS-AamvJuNL.js} (97%) rename custom-toc-highlight/assets/{FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js => FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js} (96%) rename custom-toc-highlight/assets/{FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js => FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js} (88%) rename custom-toc-highlight/assets/{FeatureServiceSnappingSourceWorker-DUCI4USj-CfrNArvR.js => FeatureServiceSnappingSourceWorker-DUCI4USj-Dmeq1rSE.js} (92%) rename custom-toc-highlight/assets/{FeatureSet-BkVNthuN-CwS44--W.js => FeatureSet-BkVNthuN-DPQqwkNN.js} (97%) rename custom-toc-highlight/assets/{FeatureStore-Co2V0sVE-BwnfsIjJ.js => FeatureStore-Co2V0sVE-BK6XAR3o.js} (89%) rename custom-toc-highlight/assets/{FeatureTemplate-SPHPD45f-DFBQobBO.js => FeatureTemplate-SPHPD45f-CZ7E6_6b.js} (94%) rename custom-toc-highlight/assets/{FeatureType-C9hJmS6_-BXWT6QCe.js => FeatureType-C9hJmS6_-CNlvn5D1.js} (85%) rename custom-toc-highlight/assets/{Field-C6hA1tZj-CpGOU6Y4.js => Field-C6hA1tZj-CkWoRbmp.js} (97%) rename custom-toc-highlight/assets/{FieldsIndex-HmzMbJQG-DZuFWLvd.js => FieldsIndex-HmzMbJQG-Du7S47uJ.js} (96%) rename custom-toc-highlight/assets/{FloatingArrow-BG9llDYg-iM1y-TMJ.js => FloatingArrow-BG9llDYg-Ct2kNlPu.js} (88%) rename custom-toc-highlight/assets/{GeoJSONLayer-BFFwDRph-DcfWJyiN.js => GeoJSONLayer-BFFwDRph-C3_g8RHm.js} (75%) rename custom-toc-highlight/assets/{GeoJSONSourceWorker-CLrugTuD-BI2XPEIw.js => GeoJSONSourceWorker-CLrugTuD-DAF3mwCs.js} (81%) rename custom-toc-highlight/assets/{GeoRSSLayer-DgF8xnYi-BcGrr8g_.js => GeoRSSLayer-DgF8xnYi-Cl1Qae5D.js} (76%) delete mode 100644 custom-toc-highlight/assets/GeoRSSLayerView2D-BLTYupUX-BfrBO27g.js create mode 100644 custom-toc-highlight/assets/GeoRSSLayerView2D-BLTYupUX-D6HtIAUl.js rename custom-toc-highlight/assets/{GeometryUtils-NHgB9gGQ-DrtZFKub.js => GeometryUtils-NHgB9gGQ-DtpzGERq.js} (99%) rename custom-toc-highlight/assets/{GraphicContainer-DuOHUciE-sEoQdKXZ.js => GraphicContainer-DuOHUciE-XlTfJEn3.js} (77%) rename custom-toc-highlight/assets/{GraphicsCollection-CWTXNZOX-Bo9O0MYR.js => GraphicsCollection-CWTXNZOX-BdlDfR8M.js} (94%) rename custom-toc-highlight/assets/{GraphicsLayer-DfeGaYc1-BYhO2Zs8.js => GraphicsLayer-DfeGaYc1-DRpZ_f0G.js} (58%) create mode 100644 custom-toc-highlight/assets/GraphicsLayerView2D-CGXlTqHO-BL8cF9rd.js delete mode 100644 custom-toc-highlight/assets/GraphicsLayerView2D-CGXlTqHO-C-E0GBj7.js rename custom-toc-highlight/assets/{GraphicsView2D-C4wYE2ut-DMrrhOCh.js => GraphicsView2D-C4wYE2ut-DdVMjjMv.js} (96%) rename custom-toc-highlight/assets/{GridShader-75bC4UUM-nIA27cle.js => GridShader-75bC4UUM-BeEFXp4m.js} (98%) rename custom-toc-highlight/assets/{GroupLayer-ER-XzoYr-LPsQSYf2.js => GroupLayer-ER-XzoYr-DlHeNdGj.js} (72%) rename custom-toc-highlight/assets/{GroupLayerView2D-BR-kLeLa-BQ6LGY1P.js => GroupLayerView2D-BR-kLeLa-CBq3r1hE.js} (59%) rename custom-toc-highlight/assets/{HUDMaterial.glsl-BLhEaLk5-CpaRLlUD.js => HUDMaterial.glsl-BLhEaLk5-DktRuv0T.js} (97%) rename custom-toc-highlight/assets/{HeightModelInfo-C5vFqzyF-CupKpfDx.js => HeightModelInfo-C5vFqzyF-BH6aliHn.js} (97%) rename custom-toc-highlight/assets/{HighlightGraphicContainer-Dt5r6lMq-KuyTjNqc.js => HighlightGraphicContainer-Dt5r6lMq-CwALk6za.js} (65%) rename custom-toc-highlight/assets/{I3SBinaryReader-DEbI3cKZ-Bdob26G6.js => I3SBinaryReader-DEbI3cKZ-0ASBQHPj.js} (99%) rename custom-toc-highlight/assets/{I3SLayerDefinitions-CwLXCKtU-CvmIU1C5.js => I3SLayerDefinitions-CwLXCKtU-BdHWzf5u.js} (98%) rename custom-toc-highlight/assets/{I3SUtil-Bq8KpP2j-BW-Cczln.js => I3SUtil-Bq8KpP2j--Kmryq4i.js} (70%) rename custom-toc-highlight/assets/{IdentityManager-DCHYmv7j-DhMuCvZ8.js => IdentityManager-DCHYmv7j-Cs8dnbbY.js} (95%) rename custom-toc-highlight/assets/{ImageryLayer-B-bJb8lU-DAjXPfZr.js => ImageryLayer-B-bJb8lU-DBN_Mc6Q.js} (96%) rename custom-toc-highlight/assets/{ImageryLayerView2D-CVDvTIGY-DlSiRq0n.js => ImageryLayerView2D-CVDvTIGY-BlDqRH6r.js} (75%) rename custom-toc-highlight/assets/{ImageryTileLayer-DixyNESc-DnXgKCIh.js => ImageryTileLayer-DixyNESc-BQ0NIE-T.js} (95%) rename custom-toc-highlight/assets/{ImageryTileLayerView2D-nEz2YhMc-CG0NmUYm.js => ImageryTileLayerView2D-nEz2YhMc-DxH8Z9x7.js} (94%) rename custom-toc-highlight/assets/{Indices-DEr2HrWx-BuNk6xPZ.js => Indices-DEr2HrWx-cFTwC5-9.js} (94%) rename custom-toc-highlight/assets/{IntegratedMesh3DTilesLayer-BEcgXCkk-v3TYApnj.js => IntegratedMesh3DTilesLayer-BEcgXCkk-B81HIVpX.js} (77%) rename custom-toc-highlight/assets/{IntegratedMeshLayer-C-XaBbXd-Bw4BDqVq.js => IntegratedMeshLayer-C-XaBbXd-BuHI7xrr.js} (78%) rename custom-toc-highlight/assets/{InterleavedLayout-DXzw3B2n-iCEii9j9.js => InterleavedLayout-DXzw3B2n-BlOPeZMB.js} (98%) rename custom-toc-highlight/assets/{KMLLayer-DwQXpcMB-3uH69meo.js => KMLLayer-DwQXpcMB-Bnm-cRpP.js} (72%) rename custom-toc-highlight/assets/{KMLLayerView2D-hWgNYT5J-D43neN7r.js => KMLLayerView2D-hWgNYT5J-BiL2CcA0.js} (68%) rename custom-toc-highlight/assets/{KnowledgeGraphLayer-BjNFJGLf-2GmTU8yN.js => KnowledgeGraphLayer-BjNFJGLf-CnmSgfq3.js} (64%) create mode 100644 custom-toc-highlight/assets/KnowledgeGraphLayerView2D-BnEbgXue-BmCZP-QP.js delete mode 100644 custom-toc-highlight/assets/KnowledgeGraphLayerView2D-BnEbgXue-PzhwY4G0.js rename custom-toc-highlight/assets/{KnowledgeGraphSublayer-DPj4igi1-BV31Zmdo.js => KnowledgeGraphSublayer-DPj4igi1-BoqyUmfs.js} (94%) rename custom-toc-highlight/assets/{LRUCache-C3erQTWv-0wD6drRf.js => LRUCache-C3erQTWv-grHgYSP-.js} (98%) rename custom-toc-highlight/assets/{LabelMetric-BeluzH3o-C3fDXNzp.js => LabelMetric-BeluzH3o-Br-5CSAC.js} (98%) rename custom-toc-highlight/assets/{Layer-ChoECxvZ-CQTFmFQa.js => Layer-ChoECxvZ-BmDHBjO8.js} (80%) rename custom-toc-highlight/assets/{LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js => LayerFloorInfo-DRJ8wfwx-DKergZyZ.js} (89%) rename custom-toc-highlight/assets/{LayerView-Bish-E63-rB2WUWF4.js => LayerView-Bish-E63-DK1SFHE3.js} (96%) rename custom-toc-highlight/assets/{LercWorker-C1_0ReXV-BnFiBWbM.js => LercWorker-C1_0ReXV-C4s5fobc.js} (98%) rename custom-toc-highlight/assets/{LineOfSightLayer-D6sUQaEP-aejAAhNq.js => LineOfSightLayer-D6sUQaEP-83QjyQPT.js} (80%) rename custom-toc-highlight/assets/{LinkChartLayer-KcYDvLxD-c7VHqPSL.js => LinkChartLayer-KcYDvLxD-DTFlqiUN.js} (85%) rename custom-toc-highlight/assets/{Lyr3DWorker-K2Vldrif-OgNJMBMz.js => Lyr3DWorker-K2Vldrif-DyLstWvT.js} (96%) rename custom-toc-highlight/assets/{Map-1zd11DKO-D2wK6924.js => Map-1zd11DKO-Bme1mjOQ.js} (83%) rename custom-toc-highlight/assets/{MapImageLayer-B_rP0PhA-D0-dI6ut.js => MapImageLayer-B_rP0PhA-BDp1ZtcT.js} (61%) delete mode 100644 custom-toc-highlight/assets/MapImageLayerView2D-LI7T-1xm-CBbeiZP3.js create mode 100644 custom-toc-highlight/assets/MapImageLayerView2D-LI7T-1xm-ZTi6guUq.js rename custom-toc-highlight/assets/{MapNotesLayer-DauvjDLM-CHkiPy5B.js => MapNotesLayer-DauvjDLM-CxPThSsi.js} (70%) rename custom-toc-highlight/assets/{MapNotesLayerView2D-EusnP8A_-vtvY-W3D.js => MapNotesLayerView2D-EusnP8A_-53usLcYc.js} (53%) rename custom-toc-highlight/assets/{MapServiceLayerViewHelper-bw3M4B8s-2ec3v39J.js => MapServiceLayerViewHelper-bw3M4B8s-UNSGy25k.js} (93%) rename custom-toc-highlight/assets/{MapView-BGOJJ8ch-DcHA1w96.js => MapView-BGOJJ8ch-CJtpe3RS.js} (94%) rename custom-toc-highlight/assets/{MediaLayer-DiCs97gD-D8BtJysn.js => MediaLayer-DiCs97gD-S0-qCmPh.js} (92%) delete mode 100644 custom-toc-highlight/assets/MediaLayerInteraction-BecfG-sO-CDwMElaJ.js create mode 100644 custom-toc-highlight/assets/MediaLayerInteraction-BecfG-sO-CtX1hIb1.js rename custom-toc-highlight/assets/{MediaLayerView2D-COWFkA3m-_gATxPeF.js => MediaLayerView2D-COWFkA3m-B8oTarjg.js} (63%) rename custom-toc-highlight/assets/{MemorySourceWorker-C9E3Klf8-BjvMRwdY.js => MemorySourceWorker-C9E3Klf8-DZ295OVS.js} (80%) rename custom-toc-highlight/assets/{Mesh-DLzjDUIO-COeC-iS-.js => Mesh-DLzjDUIO-BwXS6N6_.js} (92%) rename custom-toc-highlight/assets/{MeshLocalVertexSpace-BqgocsoS-Dycut332.js => MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js} (91%) rename custom-toc-highlight/assets/{MeshTransform-C--IG09w-DoQndDth.js => MeshTransform-C--IG09w-Bbqagf1g.js} (84%) rename custom-toc-highlight/assets/{MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js => MeshVertexAttributes-CbNpPur2-c8zcl8rF.js} (97%) rename custom-toc-highlight/assets/{MeshWriterRegistry-CIC9Yk_f-CqQZshM0.js => MeshWriterRegistry-CIC9Yk_f-7OXlu7fG.js} (97%) rename custom-toc-highlight/assets/{MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js => MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js} (97%) rename custom-toc-highlight/assets/{NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js => NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js} (93%) rename custom-toc-highlight/assets/{OGCFeatureLayer-DPXQjO1S-DQtwLAZb.js => OGCFeatureLayer-DPXQjO1S-CQDhGgy_.js} (74%) create mode 100644 custom-toc-highlight/assets/OGCFeatureLayerView2D-CpSy5D2s-DSwmstmQ.js delete mode 100644 custom-toc-highlight/assets/OGCFeatureLayerView2D-CpSy5D2s-nBaV6Pmc.js rename custom-toc-highlight/assets/{Octree-CJNwbhg4-kBqt3mh_.js => Octree-CJNwbhg4-DECX_J2V.js} (97%) rename custom-toc-highlight/assets/{OpenStreetMapLayer-Bx4EhJij-Ob9DgNzQ.js => OpenStreetMapLayer-Bx4EhJij-WBr50b29.js} (72%) rename custom-toc-highlight/assets/{OperationalLayer-B5IXiMa2-9OHGXI1g.js => OperationalLayer-B5IXiMa2-DTTV2F9z.js} (96%) rename custom-toc-highlight/assets/{OrderByInfo-GD2XnU8e-NtCi3yT-.js => OrderByInfo-GD2XnU8e-BaEpZLaO.js} (90%) rename custom-toc-highlight/assets/{OrderedLayer-6Qsmrd_l-BG3Yganz.js => OrderedLayer-6Qsmrd_l-Ck8MCw7w.js} (80%) rename custom-toc-highlight/assets/{OrientedImageryLayer-CwG5o4Di-DoKQbTo3.js => OrientedImageryLayer-CwG5o4Di--YfSXT-B.js} (81%) rename custom-toc-highlight/assets/{OverlayContainer-BEHcBpu0-DjERf_U-.js => OverlayContainer-BEHcBpu0-4o7Hmqgb.js} (91%) rename custom-toc-highlight/assets/{OverrideHelper-DWRbVlj1-BZq72sbX.js => OverrideHelper-DWRbVlj1-BnPmqHJ3.js} (95%) rename custom-toc-highlight/assets/{PBFDecoderWorker-J6PBo4mo-CqVvvaAg.js => PBFDecoderWorker-J6PBo4mo-DjON05MV.js} (91%) rename custom-toc-highlight/assets/{PieChartMeshWriter-C5yLDFwp-CqRHPq7x.js => PieChartMeshWriter-C5yLDFwp-5CAejpYY.js} (98%) rename custom-toc-highlight/assets/{PointCloudLayer-CkxImr5P-JsLK1ZeI.js => PointCloudLayer-CkxImr5P-DqGHCOp3.js} (82%) rename custom-toc-highlight/assets/{PointCloudUniqueValueRenderer-C-5hwEaR-CLxe58O_.js => PointCloudUniqueValueRenderer-C-5hwEaR-CgVBPOu4.js} (98%) rename custom-toc-highlight/assets/{PointCloudWorker-DB5ewy0Y-C0Gh_TE0.js => PointCloudWorker-DB5ewy0Y-CRq7Firo.js} (87%) rename custom-toc-highlight/assets/{PolynomialTransform-C3nWCu0l-CtkqeHeV.js => PolynomialTransform-C3nWCu0l-BJIAAiDA.js} (99%) rename custom-toc-highlight/assets/{PooledRBush-DbfAmeLn-B9Pkw5Ae.js => PooledRBush-DbfAmeLn-CPHfm9op.js} (98%) rename custom-toc-highlight/assets/{Popup-DFFZHG5j-DfLtnQ8W.js => Popup-DFFZHG5j-Bitz07Ss.js} (93%) rename custom-toc-highlight/assets/{PortalItem-CctGdnxF-C7IJrZYq.js => PortalItem-CctGdnxF-CfFOGshS.js} (97%) rename custom-toc-highlight/assets/{PortalLayer-CElnYuSQ-DvpreqYV.js => PortalLayer-CElnYuSQ-CCe4TMEA.js} (83%) rename custom-toc-highlight/assets/{Program-DLVwTiPA-C1hIaFuM.js => Program-DLVwTiPA-DI0GKSfI.js} (99%) rename custom-toc-highlight/assets/{ProgramTemplate-DQOm6Omy-Qewg1YCG.js => ProgramTemplate-DQOm6Omy-yxBgwK3o.js} (91%) rename custom-toc-highlight/assets/{Query-BrwMGK8U-DoFNfkjX.js => Query-BrwMGK8U-BPr0_G9t.js} (98%) rename custom-toc-highlight/assets/{QueryEngine-CH5uUhZK-BP95Dm56.js => QueryEngine-CH5uUhZK-DRGPyg2C.js} (97%) rename custom-toc-highlight/assets/{QueryTask-CwHwH2rS-B8khefoW.js => QueryTask-CwHwH2rS-D4f5dsGo.js} (60%) rename custom-toc-highlight/assets/{QueueProcessor-DbfV9fLy-CxiRQqTa.js => QueueProcessor-DbfV9fLy-2F5OgLgJ.js} (94%) rename custom-toc-highlight/assets/{RasterPresetRendererMixin-D6W9pUY6-DKpsAOdT.js => RasterPresetRendererMixin-D6W9pUY6-Bm_m_CYY.js} (98%) rename custom-toc-highlight/assets/{RasterSymbolizer-BVys6HkM-BrCOeMHl.js => RasterSymbolizer-BVys6HkM-DCN-TPRo.js} (99%) rename custom-toc-highlight/assets/{RasterVFDisplayObject-CnriTVT9-CjUrEqNq.js => RasterVFDisplayObject-CnriTVT9-CVvMEEVD.js} (97%) rename custom-toc-highlight/assets/{RasterWorker-CzIELPA8-rYzNCfmE.js => RasterWorker-CzIELPA8-Co7HHa3v.js} (82%) rename custom-toc-highlight/assets/{RawBlockCache-Cj_tmHDm-CHpXSnmO.js => RawBlockCache-Cj_tmHDm-gcQCDGFb.js} (97%) rename custom-toc-highlight/assets/{ReactiveMap-CFk6jPfN-Du1XE-2a.js => ReactiveMap-CFk6jPfN-CSefy1PZ.js} (92%) rename custom-toc-highlight/assets/{ReactiveSet-QxEZenFW-DlICHtLT.js => ReactiveSet-QxEZenFW-tC7C9rTp.js} (96%) rename custom-toc-highlight/assets/{RefreshableLayer-a8BQ58Xh-D1Kebw4J.js => RefreshableLayer-a8BQ58Xh-CxfquKbp.js} (93%) rename custom-toc-highlight/assets/{RefreshableLayerView-BdQpGYly-Bg8to7IY.js => RefreshableLayerView-BdQpGYly-DxrmlBaQ.js} (63%) rename custom-toc-highlight/assets/{Relationship-Db9GUmYx-Cq6n6OX7.js => Relationship-Db9GUmYx-B84JspfN.js} (97%) rename custom-toc-highlight/assets/{Relationship-PyhUibYK-BgFx3_5x.js => Relationship-PyhUibYK-DN6K3ukS.js} (94%) rename custom-toc-highlight/assets/{RelationshipQuery-DJsz3K0U-yAwL-qLW.js => RelationshipQuery-DJsz3K0U-BKFa46R1.js} (94%) rename custom-toc-highlight/assets/{RendererLegendOptions-K3md58-X-Dj9JPZ6J.js => RendererLegendOptions-K3md58-X-JLOOdHLz.js} (93%) rename custom-toc-highlight/assets/{RenderingContext-DbCVbtGZ-rMiiZHPo.js => RenderingContext-DbCVbtGZ-Bdgqeuyk.js} (98%) rename custom-toc-highlight/assets/{RouteLayer-BQQ6WxtH-gcXmCkYw.js => RouteLayer-BQQ6WxtH-DV30CZ3n.js} (94%) rename custom-toc-highlight/assets/{RouteLayerView2D-Bpui7Ggx-fxzuJ6ql.js => RouteLayerView2D-Bpui7Ggx-Dq8ar2NW.js} (58%) rename custom-toc-highlight/assets/{SDFHelper-B6k8Ig6R-BNeqNf2Z.js => SDFHelper-B6k8Ig6R-CgiA_-9V.js} (95%) rename custom-toc-highlight/assets/{ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js => ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js} (93%) rename custom-toc-highlight/assets/{SceneLayer-DOh9PmQy-CNOlY0yu.js => SceneLayer-DOh9PmQy-BMYFGe4d.js} (83%) rename custom-toc-highlight/assets/{SceneLayerSnappingSourceWorker-Bt0_pTWo-CsMJBbDT.js => SceneLayerSnappingSourceWorker-Bt0_pTWo-BD404DAo.js} (79%) rename custom-toc-highlight/assets/{SceneLayerWorker-BC8rXiXB-BF_f0zdV.js => SceneLayerWorker-BC8rXiXB-DXBHmcTP.js} (75%) rename custom-toc-highlight/assets/{SceneService-BZqGtWmG-BWCHkX1O.js => SceneService-BZqGtWmG-BBytd6YJ.js} (94%) rename custom-toc-highlight/assets/{Scheduler-B7UX7Wr5-DQCcMKpm.js => Scheduler-B7UX7Wr5-DriQgzLZ.js} (98%) rename custom-toc-highlight/assets/{SourceLayerData-BT_Ywuvg-DFNndgqY.js => SourceLayerData-BT_Ywuvg-D7mjpcmo.js} (96%) rename custom-toc-highlight/assets/{SpatialFilter-BlQBFhwz-BhB6yT4Z.js => SpatialFilter-BlQBFhwz-B_LMwz1c.js} (99%) rename custom-toc-highlight/assets/{Stop-he5xSAJJ-CGB43GGR.js => Stop-he5xSAJJ-BA1tUkNc.js} (99%) rename custom-toc-highlight/assets/{StreamLayer-Bqnt-d3H-Dsh94g7_.js => StreamLayer-Bqnt-d3H-Cf1JxEuo.js} (68%) rename custom-toc-highlight/assets/{StreamLayerView2D-Bh_aEalU-D-95GXg2.js => StreamLayerView2D-Bh_aEalU-wWSqPGq-.js} (54%) rename custom-toc-highlight/assets/{StyleRepository-D3WuVprR-SmpmvCua.js => StyleRepository-D3WuVprR-B1BVbhGB.js} (99%) rename custom-toc-highlight/assets/{SublayersOwner-DfTaMJ5V-DMBhnxeT.js => SublayersOwner-DfTaMJ5V-DrC0bgDm.js} (86%) rename custom-toc-highlight/assets/{SubtypeGroupLayer-D1vAbwEU-CDpC08_d.js => SubtypeGroupLayer-D1vAbwEU-D1p0P2KY.js} (76%) create mode 100644 custom-toc-highlight/assets/SubtypeGroupLayerView2D-Byn0xzbb-DtCv0vxF.js delete mode 100644 custom-toc-highlight/assets/SubtypeGroupLayerView2D-Byn0xzbb-Qz-0ZBbK.js rename custom-toc-highlight/assets/{TablesMixin-C8RojhYs-AdFcW_TR.js => TablesMixin-C8RojhYs-LCBvmsnP.js} (96%) rename custom-toc-highlight/assets/{TechniqueInstance-DGTKoOL6-ftnhwAAz.js => TechniqueInstance-DGTKoOL6-CABoCcdk.js} (95%) rename custom-toc-highlight/assets/{TelemetryDisplay-Bq2PXfI8-Z2CK355L.js => TelemetryDisplay-Bq2PXfI8-BY_FrklG.js} (90%) rename custom-toc-highlight/assets/{TemporalLayer-CpOrN_w9-BDEJ3v2O.js => TemporalLayer-CpOrN_w9-8nvJFP_-.js} (78%) rename custom-toc-highlight/assets/{Texture-BCt2hphT-hC4XzHg_.js => Texture-BCt2hphT-Dk2JyWCy.js} (99%) rename custom-toc-highlight/assets/{Theme-rblUnB2V-D2UsCNGl.js => Theme-rblUnB2V-Dc7wtY6B.js} (99%) rename custom-toc-highlight/assets/{Tick-DUHqbpyB-DY4eRS4C.js => Tick-DUHqbpyB-Dd2p6esB.js} (99%) rename custom-toc-highlight/assets/{Tile-D75RMC64-Dj1SOP3K.js => Tile-D75RMC64-g8Sx5TPr.js} (98%) rename custom-toc-highlight/assets/{TileContainer-D48pXXgL-CdMiwPkS.js => TileContainer-D48pXXgL-BzDz3Uqo.js} (82%) rename custom-toc-highlight/assets/{TileInfo-CWIRDhZl-BkCC-9e9.js => TileInfo-CWIRDhZl-RqA7tkOZ.js} (99%) rename custom-toc-highlight/assets/{TileInfoTilemapCache-D1SExPij-BhR83GZf.js => TileInfoTilemapCache-D1SExPij-BDoYZo_V.js} (94%) rename custom-toc-highlight/assets/{TileKey-C5IL-JBr-CJMvJ-lJ.js => TileKey-C5IL-JBr-BGwa3-Dg.js} (96%) rename custom-toc-highlight/assets/{TileLayer-Be5tWeN5-CZVaOU3u.js => TileLayer-Be5tWeN5-CUL4Ato2.js} (60%) rename custom-toc-highlight/assets/{TileLayerView2D-CT-Yu10P-BdNTZA0Y.js => TileLayerView2D-CT-Yu10P-B6hAJ5mA.js} (54%) rename custom-toc-highlight/assets/{TilemapCache-CRRxws77-BBkZHUXn.js => TilemapCache-CRRxws77-CCC00Yar.js} (98%) rename custom-toc-highlight/assets/{TimeExtent-Cn0Jofqr-D2z4zFxu.js => TimeExtent-Cn0Jofqr-BcCXKjqL.js} (98%) rename custom-toc-highlight/assets/{TimeInfo-w_HB2CsF-CZutzBPZ.js => TimeInfo-w_HB2CsF-B2qHZyfS.js} (95%) rename custom-toc-highlight/assets/{TimeOnly-DSMefxKy-BU7RNYWc.js => TimeOnly-DSMefxKy-BHvJbNji.js} (99%) rename custom-toc-highlight/assets/{Tooltip-B0HefZ7r-yfksLaF6.js => Tooltip-B0HefZ7r-CZdyswYp.js} (99%) rename custom-toc-highlight/assets/{TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js => TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js} (97%) rename custom-toc-highlight/assets/{TurboLine-CIlsAy5m-Cxo-QeJ4.js => TurboLine-CIlsAy5m-C6Kc2De-.js} (98%) rename custom-toc-highlight/assets/{UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js => UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js} (99%) rename custom-toc-highlight/assets/{UnknownLayer-DwWK383_-yIdidO-4.js => UnknownLayer-DwWK383_-ChM426K1.js} (55%) rename custom-toc-highlight/assets/{UnknownTimeZone-C--TOcPG-D3CAoWPX.js => UnknownTimeZone-C--TOcPG-9of9030I.js} (73%) rename custom-toc-highlight/assets/{UnsupportedLayer-CCUtmZ2i-DjI3xgYe.js => UnsupportedLayer-CCUtmZ2i-Cmkro0SF.js} (63%) rename custom-toc-highlight/assets/{UpdateTracking2D-Du_WIf4G-CsaWDyks.js => UpdateTracking2D-Du_WIf4G-a2xUHmYe.js} (99%) rename custom-toc-highlight/assets/{UpdatingHandles-CUu3u1ms-CruZWJRY.js => UpdatingHandles-CUu3u1ms-DHvcjtvD.js} (96%) rename custom-toc-highlight/assets/{VectorTileLayer-DruyQukp-O9fRyiwY.js => VectorTileLayer-DruyQukp-BQMpjmuu.js} (91%) rename custom-toc-highlight/assets/{VectorTileLayerView2D-B9OYHbL4-Ctr5GCiP.js => VectorTileLayerView2D-B9OYHbL4-ANKZ9nt1.js} (95%) rename custom-toc-highlight/assets/{Version-CoKzbupV-9-gg6ENz.js => Version-CoKzbupV-BDyz4v43.js} (93%) rename custom-toc-highlight/assets/{VertexArrayObject-M4iRGGoi-THP-veuo.js => VertexArrayObject-M4iRGGoi-BvRnjYBj.js} (93%) rename custom-toc-highlight/assets/{VideoLayer-Dxs-NJSn--54x1iM5.js => VideoLayer-Dxs-NJSn-NbdKBg3Z.js} (99%) rename custom-toc-highlight/assets/{VideoLayerView2D-CLcxq4ZA-ZAPPyz9l.js => VideoLayerView2D-CLcxq4ZA-C6WSWoOW.js} (68%) rename custom-toc-highlight/assets/{ViewshedLayer-BYX-h7eL-C8exBQCc.js => ViewshedLayer-BYX-h7eL-BRcm_3EL.js} (84%) rename custom-toc-highlight/assets/{VoxelLayer-KL84GttA-aMQGBYli.js => VoxelLayer-KL84GttA-C5r9pgtQ.js} (94%) rename custom-toc-highlight/assets/{WFSLayer-DKnx5V8b-CqaZsJwu.js => WFSLayer-DKnx5V8b-BsCCMHBG.js} (77%) rename custom-toc-highlight/assets/{WFSSourceWorker-CI7-tY7M-B1raNSo8.js => WFSSourceWorker-CI7-tY7M-CZ8uM4i-.js} (73%) rename custom-toc-highlight/assets/{WGLContainer-LxgEo4I_-C81rKEy3.js => WGLContainer-LxgEo4I_-uPdq0FyK.js} (99%) rename custom-toc-highlight/assets/{WMSLayer-C8eYRV4V-DczckqqP.js => WMSLayer-C8eYRV4V-lRsRDNhJ.js} (94%) rename custom-toc-highlight/assets/{WMSLayerView2D-Dz-z-fa9-B7OZ7TF_.js => WMSLayerView2D-Dz-z-fa9-D5YTL9WO.js} (52%) rename custom-toc-highlight/assets/{WMTSLayer-DJY_jjIE-CRE9fTlG.js => WMTSLayer-DJY_jjIE-CgOVZJxi.js} (94%) rename custom-toc-highlight/assets/{WMTSLayerView2D-Bl5FUDUu-DLQ4k-_a.js => WMTSLayerView2D-Bl5FUDUu-DwwTnV3d.js} (58%) rename custom-toc-highlight/assets/{WebTileLayer-CUoicUjK-CNTqPpZi.js => WebTileLayer-CUoicUjK-DGq3QB_9.js} (85%) rename custom-toc-highlight/assets/{WhereClause-DxwoyBMS-DnXKVpm2.js => WhereClause-DxwoyBMS-Cwdb_WC4.js} (99%) rename custom-toc-highlight/assets/{WorkerTileHandler-DLznBxmP-CJAvtX2q.js => WorkerTileHandler-DLznBxmP-BNSWrcCp.js} (98%) rename custom-toc-highlight/assets/{action-GCQoufcz-CK-V5fzo.js => action-GCQoufcz-DQvoWHlv.js} (96%) rename custom-toc-highlight/assets/{action-group-DhwU7QZv-gljbsXvo.js => action-group-DhwU7QZv-CXvhCgpT.js} (88%) rename custom-toc-highlight/assets/{action-menu-DTIJuZNc-C8BNxu3_.js => action-menu-DTIJuZNc-DnQvHied.js} (97%) rename custom-toc-highlight/assets/{apng-DuERAVke-BAEONUn6.js => apng-DuERAVke-D1GuG4Xy.js} (98%) rename custom-toc-highlight/assets/{arcade-CaGqU4sP-CfTmGx37.js => arcade-CaGqU4sP-DcIDNIme.js} (61%) rename custom-toc-highlight/assets/{arcadeAsyncRuntime-B-LnqhTo-DU6gqwwh.js => arcadeAsyncRuntime-B-LnqhTo-BP4d9xu9.js} (95%) rename custom-toc-highlight/assets/{arcadeUtils-DpP0k7IY-BXaTThTL.js => arcadeUtils-DpP0k7IY-C-RKTwge.js} (97%) rename custom-toc-highlight/assets/{arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js => arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js} (94%) rename custom-toc-highlight/assets/{arcgisLayers-CL8_MH7S-D1YV7ss3.js => arcgisLayers-CL8_MH7S-u1jA7AmV.js} (76%) rename custom-toc-highlight/assets/{associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js => associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js} (92%) rename custom-toc-highlight/assets/{boundedPlane-DlvE0eNx-dpkNyaGh.js => boundedPlane-DlvE0eNx-BQ9Xop25.js} (93%) create mode 100644 custom-toc-highlight/assets/calcite-action-2fclGKoO-DEiRzt3o.js delete mode 100644 custom-toc-highlight/assets/calcite-action-2fclGKoO-DO9-6_VR.js rename custom-toc-highlight/assets/{calcite-action-bar-ugh74qU5-trFy58rx.js => calcite-action-bar-ugh74qU5-C59I7NOF.js} (90%) create mode 100644 custom-toc-highlight/assets/calcite-action-group-qlkUfh_o-H6U8Q6wA.js delete mode 100644 custom-toc-highlight/assets/calcite-action-group-qlkUfh_o-wUTthgYu.js rename custom-toc-highlight/assets/{calcite-button-Cm9_TJei-By40tgvH.js => calcite-button-Cm9_TJei-DvwKP8jU.js} (97%) rename custom-toc-highlight/assets/{calcite-chip-DE_c-1hr-BB941sYj.js => calcite-chip-DE_c-1hr-DI1-84AU.js} (97%) rename custom-toc-highlight/assets/{calcite-dialog-DAngwHC1-BqNAvWKZ.js => calcite-dialog-DAngwHC1-C6d9gJgf.js} (99%) rename custom-toc-highlight/assets/{calcite-dropdown-CLrG397W-CnAw_6_z.js => calcite-dropdown-CLrG397W-Dl2b91G4.js} (96%) rename custom-toc-highlight/assets/{calcite-dropdown-group-0sIPwaDd-Bs73CRS2.js => calcite-dropdown-group-0sIPwaDd-DiD7sdrQ.js} (94%) rename custom-toc-highlight/assets/{calcite-dropdown-item-DpLfv4A0-C0tcRIAy.js => calcite-dropdown-item-DpLfv4A0-CIOTjei7.js} (95%) rename custom-toc-highlight/assets/{calcite-flow-CAdorlph-NGgeuOPy.js => calcite-flow-CAdorlph-DQjwYgyL.js} (92%) rename custom-toc-highlight/assets/{calcite-flow-item-uRuGc3ks-DCl4Mpal.js => calcite-flow-item-uRuGc3ks-Cp1dKuD0.js} (88%) create mode 100644 custom-toc-highlight/assets/calcite-icon-laqhdRBY-8qK5FfMb.js delete mode 100644 custom-toc-highlight/assets/calcite-icon-laqhdRBY-Dn93dMQE.js create mode 100644 custom-toc-highlight/assets/calcite-input-BKRd7MCS-BhvpT25V.js delete mode 100644 custom-toc-highlight/assets/calcite-input-BKRd7MCS-DN64wHsO.js rename custom-toc-highlight/assets/{calcite-label-DMj3M4QR-C-hEqjQX.js => calcite-label-DMj3M4QR-BaEG55cn.js} (94%) rename custom-toc-highlight/assets/{calcite-list-item-VYBhSMxV-CrZ_qcBF.js => calcite-list-item-VYBhSMxV-C8kSjE5V.js} (97%) rename custom-toc-highlight/assets/{calcite-list-item-group-CuQ2MPLW-DacaGEdY.js => calcite-list-item-group-CuQ2MPLW-CwdP7Iq_.js} (91%) rename custom-toc-highlight/assets/{calcite-list-rnu1YzAl-CeNaNcvH.js => calcite-list-rnu1YzAl-DCH8F59s.js} (98%) create mode 100644 custom-toc-highlight/assets/calcite-loader-CtpHSU2--B8aaTEnB.js delete mode 100644 custom-toc-highlight/assets/calcite-loader-CtpHSU2--Bzq4cVWG.js rename custom-toc-highlight/assets/{calcite-notice-DeAGopAs-Cd7Uc4RY.js => calcite-notice-DeAGopAs-BI9wdRMa.js} (94%) rename custom-toc-highlight/assets/{calcite-tooltip-63c9fmIw-DyfFML0E.js => calcite-tooltip-63c9fmIw-BI9m24xG.js} (97%) rename custom-toc-highlight/assets/{chartCommon-rWfJsTPl-BkhcWsMI.js => chartCommon-rWfJsTPl-C_UBBu0e.js} (98%) rename custom-toc-highlight/assets/{chartUtilsAm5-CtY-kHPy-B6BgNVnq.js => chartUtilsAm5-CtY-kHPy-KDNsYH7z.js} (99%) rename custom-toc-highlight/assets/{cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js => cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js} (91%) rename custom-toc-highlight/assets/{clientSideDefaults-BqqayPct-B-0mBem3.js => clientSideDefaults-BqqayPct-Vv2Kv9CL.js} (93%) rename custom-toc-highlight/assets/{colorRamps-q0bZVhs2-DQZn2xZS.js => colorRamps-q0bZVhs2-BnivlaV9.js} (95%) rename custom-toc-highlight/assets/{colorUtils-Cthpxcks-ZRnr1H1b.js => colorUtils-Cthpxcks-cHaMZbaf.js} (98%) rename custom-toc-highlight/assets/{commonProperties-BtIqvFU_-DVH0kGN9.js => commonProperties-BtIqvFU_-DbZji2Rx.js} (98%) delete mode 100644 custom-toc-highlight/assets/compilerUtils-CV1QYWI8-C9dYdAV0.js create mode 100644 custom-toc-highlight/assets/compilerUtils-CV1QYWI8-VdY86_Y-.js rename custom-toc-highlight/assets/{computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js => computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js} (78%) rename custom-toc-highlight/assets/{conditionalSlot-DsCzytJ4-8LGFSrPC.js => conditionalSlot-DsCzytJ4-DM7mn4Oa.js} (55%) delete mode 100644 custom-toc-highlight/assets/convertMeshVertexSpace-BO7NR5uA-DNqSWhor.js create mode 100644 custom-toc-highlight/assets/convertMeshVertexSpace-BO7NR5uA-DneeGgyd.js rename custom-toc-highlight/assets/{createConnection-CrkuTLXs-DgS-Wx7n.js => createConnection-CrkuTLXs-CK5s-xN-.js} (74%) rename custom-toc-highlight/assets/{dataUtils-BkPy4R3C-Cb9EIxnj.js => dataUtils-BkPy4R3C-Dzc1QGGb.js} (99%) rename custom-toc-highlight/assets/{deduplicate-D2d-E5Pw-CQcmF3ab.js => deduplicate-D2d-E5Pw-CTlujluz.js} (92%) rename custom-toc-highlight/assets/{deleteForwardEdits-BHWvOnK8-C0YwmPr6.js => deleteForwardEdits-BHWvOnK8-P72OARG2.js} (59%) rename custom-toc-highlight/assets/{details-screen-DE85sbTV-D3mJWX0Z.js => details-screen-DE85sbTV-BZ2qdeGe.js} (99%) rename custom-toc-highlight/assets/{diffUtils-Cz3Fi8Xb-BE5g3Qm4.js => diffUtils-Cz3Fi8Xb-Cwe8AFcX.js} (96%) rename custom-toc-highlight/assets/{drapedUtils-BZ1SGPtE-B2FavufJ.js => drapedUtils-BZ1SGPtE-bBUh2hex.js} (95%) rename custom-toc-highlight/assets/{edgeProcessing-CALv8P-b-BbEOWK4a.js => edgeProcessing-CALv8P-b-sDvNynj9.js} (96%) rename custom-toc-highlight/assets/{editingSupport-gUqP9iyf-BcQn3A1C.js => editingSupport-gUqP9iyf-C_ld1skV.js} (96%) rename custom-toc-highlight/assets/{editingTools-BZ3yVmXf-C2YZAZMV.js => editingTools-BZ3yVmXf-C6oQif6A.js} (97%) rename custom-toc-highlight/assets/{editsZScale-BDsX6vv--CttUpViY.js => editsZScale-BDsX6vv--C-4n90TZ.js} (89%) rename custom-toc-highlight/assets/{elevationInfoUtils-mOZsPH2J-If61I1du.js => elevationInfoUtils-mOZsPH2J-BlRQDLDN.js} (95%) rename custom-toc-highlight/assets/{executeBinsQuery-26-59HNS-BdRaQbV5.js => executeBinsQuery-26-59HNS-DKYB7wBm.js} (50%) create mode 100644 custom-toc-highlight/assets/executeForIds-Z1gkLduF-CrWEksFG.js delete mode 100644 custom-toc-highlight/assets/executeForIds-Z1gkLduF-D8DZG8qZ.js create mode 100644 custom-toc-highlight/assets/executeForTopCount-Dx1gCDe1-BVXGJFEi.js delete mode 100644 custom-toc-highlight/assets/executeForTopCount-Dx1gCDe1-JhF_sU0m.js create mode 100644 custom-toc-highlight/assets/executeForTopExtents-3NOTiZTn-7q7qEr0x.js delete mode 100644 custom-toc-highlight/assets/executeForTopExtents-3NOTiZTn-K-9KTgQh.js create mode 100644 custom-toc-highlight/assets/executeForTopIds-BWxBZygF-D-DeY4Tc.js delete mode 100644 custom-toc-highlight/assets/executeForTopIds-BWxBZygF-myXyOtDE.js delete mode 100644 custom-toc-highlight/assets/executeQueryJSON-CcHnccia-BW7_NQxl.js create mode 100644 custom-toc-highlight/assets/executeQueryJSON-CcHnccia-M-vnTvKl.js rename custom-toc-highlight/assets/{executeQueryPBF-o8010HS9-BgTBXvCY.js => executeQueryPBF-o8010HS9-B7Z-YQyg.js} (92%) rename custom-toc-highlight/assets/{executeRelationshipQuery-BlX9_g4g-CUgaAeUL.js => executeRelationshipQuery-BlX9_g4g-QPs1Jx7X.js} (64%) delete mode 100644 custom-toc-highlight/assets/executeTopFeaturesQuery-CjTd36wS-B31_Gdx0.js create mode 100644 custom-toc-highlight/assets/executeTopFeaturesQuery-CjTd36wS-CcVA1k2F.js rename custom-toc-highlight/assets/{fabric-Df28hv38-CC2TWXwY.js => fabric-Df28hv38-DoClkw8Q.js} (99%) rename custom-toc-highlight/assets/{featureConversionUtils-D6hFQ4Af-C2GV38KQ.js => featureConversionUtils-D6hFQ4Af-qxGGE-I8.js} (99%) rename custom-toc-highlight/assets/{featureLayerUtils-BlPdhYbm-2gXi28Q5.js => featureLayerUtils-BlPdhYbm-B3ZkIjKd.js} (84%) rename custom-toc-highlight/assets/{featureLayerUtils-DgfQQyK4-Ba-CbhYv.js => featureLayerUtils-DgfQQyK4-Cfw8eI8B.js} (91%) rename custom-toc-highlight/assets/{featureReferenceUtils-Ct4KY5u7-cLRdtKlb.js => featureReferenceUtils-Ct4KY5u7-DuNl8LtH.js} (75%) rename custom-toc-highlight/assets/{featureSetUtils-wd4FcF3A-33TmIeRJ.js => featureSetUtils-wd4FcF3A-Bjqg1VXd.js} (95%) rename custom-toc-highlight/assets/{featuresetbase-BDDCCC0O-CfxSVZfS.js => featuresetbase-BDDCCC0O---spEhjc.js} (84%) rename custom-toc-highlight/assets/{featuresetgeom-BftbGgg3-DE0snMCi.js => featuresetgeom-BftbGgg3-BLGpCbU5.js} (74%) rename custom-toc-highlight/assets/{featuresetstats-CY6YJ8Jt-BoMAU3Jh.js => featuresetstats-CY6YJ8Jt-BEjsGFcp.js} (76%) rename custom-toc-highlight/assets/{featuresetstring-DFELZWNA-CM9MGIid.js => featuresetstring-DFELZWNA-DaxbyWAc.js} (80%) rename custom-toc-highlight/assets/{fetchService-DbaKmJhP-W7rGyykJ.js => fetchService-DbaKmJhP-Ccg-phWf.js} (50%) rename custom-toc-highlight/assets/{fieldProperties-Bq26w7gt-CFQbsGDX.js => fieldProperties-Bq26w7gt-BiKrD4ue.js} (84%) rename custom-toc-highlight/assets/{fieldType-CD2CL2hr-CMChCO5s.js => fieldType-CD2CL2hr-Do9kp-dx.js} (89%) rename custom-toc-highlight/assets/{floatRGBA-4pIJN00G-BsIUaPaZ.js => floatRGBA-4pIJN00G-Cz2BV8ih.js} (83%) rename custom-toc-highlight/assets/{floating-ui-DKFFlLv3--KXNPa_R.js => floating-ui-DKFFlLv3-8lk8tQD2.js} (99%) rename custom-toc-highlight/assets/{form-CRSw616T-DZVFUlxN.js => form-CRSw616T-wY3ZjFlq.js} (98%) rename custom-toc-highlight/assets/{geodesicUtils-B8mFUfTk-DkviSp9u.js => geodesicUtils-B8mFUfTk-BNOCxMeb.js} (97%) rename custom-toc-highlight/assets/{geojson-CNt_qtQf-B9F87hyc.js => geojson-CNt_qtQf-X0105Nc8.js} (98%) rename custom-toc-highlight/assets/{geomasync-uGYsifQH-DIhokorn.js => geomasync-uGYsifQH-B8w8CEL3.js} (94%) rename custom-toc-highlight/assets/{geometryEngine-CdPoFSE4-zj0NdzY3.js => geometryEngine-CdPoFSE4-ChEr_3ja.js} (94%) rename custom-toc-highlight/assets/{geometryEngineAsync-D7oEu5dd-B6AE24vD.js => geometryEngineAsync-D7oEu5dd-CZIKaTd9.js} (97%) rename custom-toc-highlight/assets/{geometryServiceUtils-nsujb7BH-C2AslH-O.js => geometryServiceUtils-nsujb7BH-BeXUhRCo.js} (69%) rename custom-toc-highlight/assets/{gif-BZzSowd2-DsEs7FgS.js => gif-BZzSowd2-49ll32ZF.js} (99%) rename custom-toc-highlight/assets/{gltfexport-Dj6nF2RN-B_wJbbRp.js => gltfexport-Dj6nF2RN-CAFBwudx.js} (93%) rename custom-toc-highlight/assets/{groupLayerUtils-D-25JsA_-D02uFLM4.js => groupLayerUtils-D-25JsA_-CvTWRcG7.js} (65%) rename custom-toc-highlight/assets/{grouping-RwmXkHDc-Binxobs4.js => grouping-RwmXkHDc-CCFLL7L_.js} (75%) rename custom-toc-highlight/assets/{header-BRE2xzQs-fBrTtAlS.js => header-BRE2xzQs-CjQ_sd4f.js} (96%) rename custom-toc-highlight/assets/{heatmapUtils-seiMkkkR-Cj1KmweL.js => heatmapUtils-seiMkkkR-CrSLbaQx.js} (93%) rename custom-toc-highlight/assets/{hydrated-CplJC1Fs-BIb5_ysY.js => hydrated-CplJC1Fs-McBHp1Y5.js} (90%) rename custom-toc-highlight/assets/{icon-BXFbBbop-BUyrjp8g.js => icon-BXFbBbop-Bq4Zv26A.js} (96%) rename custom-toc-highlight/assets/{imageBitmapUtils-DA36kg39-CZPhYtU7.js => imageBitmapUtils-DA36kg39-BfNbbEDs.js} (84%) rename custom-toc-highlight/assets/{imageUtils-BA2D6Uf1-DgLNtmEY.js => imageUtils-BA2D6Uf1-CYx0DlwL.js} (75%) rename custom-toc-highlight/assets/{imageUtils-Co-ELErj-Dh62T-vs.js => imageUtils-Co-ELErj-D3GFlUnZ.js} (88%) rename custom-toc-highlight/assets/{imageryUtils-6MVSqijr-B_Ii3EHZ.js => imageryUtils-6MVSqijr-2ufISwt4.js} (75%) rename custom-toc-highlight/assets/{index--i98kM5n-D5qo9Ek1.js => index--i98kM5n-wnGfY6-E.js} (69%) rename custom-toc-highlight/assets/{index-5nGe0Bgx-DXktt_T1.js => index-5nGe0Bgx-PuzIaK3Y.js} (96%) rename custom-toc-highlight/assets/{index-7blUq_oP-DVsFK_oh.js => index-7blUq_oP-dtZV9W0P.js} (83%) rename custom-toc-highlight/assets/{index-98it_ulG-BsOnjtDb.js => index-98it_ulG-w2DJElWd.js} (94%) rename custom-toc-highlight/assets/{index-B0lfXXMz-C5AduZae.js => index-B0lfXXMz-B4yTazBh.js} (77%) rename custom-toc-highlight/assets/{index-BAU9PUzR-Dm0i0OJc.js => index-BAU9PUzR-GOdyBPEe.js} (86%) rename custom-toc-highlight/assets/{index-BCHMro24-BPmciRPg.js => index-BCHMro24-CwIpWYn_.js} (94%) rename custom-toc-highlight/assets/{index-BSr9u_6r-DyyAtPyf.js => index-BSr9u_6r-ynd9tPq5.js} (88%) rename custom-toc-highlight/assets/{index-Bo-4afBP-B5GWFE2k.js => index-Bo-4afBP-DBinFmis.js} (99%) rename custom-toc-highlight/assets/{index-CDhNyq-A-rV_P8aO5.js => index-CDhNyq-A-E2rRJpfZ.js} (89%) rename custom-toc-highlight/assets/{index-CMEOtVDx-ChyOSGzz.js => index-CMEOtVDx-BTZ-Taoh.js} (91%) rename custom-toc-highlight/assets/{index-CRabsHaP-D1Fjorzw.js => index-CRabsHaP-BfTKXoCA.js} (96%) rename custom-toc-highlight/assets/{index-CWPzg1w2-dFHsYLYO.js => index-CWPzg1w2-Duz60wim.js} (75%) rename custom-toc-highlight/assets/{index-CfINOE3J-rJJ_H7b3.js => index-CfINOE3J-D35QOhUy.js} (92%) rename custom-toc-highlight/assets/{index-ChMe1Rap-m0hgXXvs.js => index-ChMe1Rap-CzOnqpfO.js} (84%) rename custom-toc-highlight/assets/{index-CobT58Py-hm1bMD7r.js => index-CobT58Py-D8ewubJk.js} (96%) rename custom-toc-highlight/assets/{index-CuDicHX--DyH65FLJ.js => index-CuDicHX--VLwELiqf.js} (98%) rename custom-toc-highlight/assets/{index-Czft7XuG-o1pa2FUA.js => index-Czft7XuG-BLbk_j4S.js} (96%) rename custom-toc-highlight/assets/{index-DDW2D8Uj-C3tgdysx.js => index-DDW2D8Uj-BucO7Mr0.js} (86%) rename custom-toc-highlight/assets/{index-DH-yVcMF-BUFT5eJ2.js => index-DH-yVcMF-o6W3s-NP.js} (96%) rename custom-toc-highlight/assets/{index-DLWeBByc-q_J35KkL.js => index-DLWeBByc-DDoUT1cR.js} (95%) rename custom-toc-highlight/assets/{index-DMxHNnSm-CqvPwsqc.js => index-DMxHNnSm-Dbw9Xbwt.js} (97%) rename custom-toc-highlight/assets/{index-DRrktYRZ-BJGx8CJ2.js => index-DRrktYRZ-Cdk3b_aC.js} (88%) rename custom-toc-highlight/assets/{index-DY4XJa1m-CNSHrnyD.js => index-DY4XJa1m-CinpT_5l.js} (76%) rename custom-toc-highlight/assets/{index-DfBq89c3-BlZPQ9vY.js => index-DfBq89c3-eMYAVigg.js} (83%) rename custom-toc-highlight/assets/{index-DmuJEjwc-CFxZGX5E.js => index-DmuJEjwc-CFoy2sko.js} (95%) rename custom-toc-highlight/assets/{index-DxH-DOHz-Dd8g4fh-.js => index-DxH-DOHz-BNodbAX5.js} (93%) rename custom-toc-highlight/assets/{index-I3HFsMjx-ztAvlKEH.js => index-I3HFsMjx-DYqxaWUq.js} (92%) rename custom-toc-highlight/assets/{index-WLSkOrf3-VEDWJShX.js => index-WLSkOrf3-CdD0dr9H.js} (87%) rename custom-toc-highlight/assets/{index-sFd78-sx-DdarRIaz.js => index-sFd78-sx-Df2sAvfD.js} (96%) rename custom-toc-highlight/assets/{input2-eOtqu-iO-DwuPmAAc.js => input2-eOtqu-iO-DiRyHCWP.js} (98%) rename custom-toc-highlight/assets/{interactive-DqhNilgd-BPt2o3jA.js => interactive-DqhNilgd-BbTDbq0n.js} (93%) rename custom-toc-highlight/assets/{item-DaimTDdD-BK_A0qEn.js => item-DaimTDdD-CosqhjDY.js} (99%) rename custom-toc-highlight/assets/{jsonContext-BA8GHqVk-CWQlLGSw.js => jsonContext-BA8GHqVk-BsXRY5es.js} (86%) rename custom-toc-highlight/assets/{jsonUtils-C64Zfu7c-CitE8NjK.js => jsonUtils-C64Zfu7c-BtrwAD3_.js} (95%) rename custom-toc-highlight/assets/{jsonUtils-wIllKWI4-DrGIvCCq.js => jsonUtils-wIllKWI4-MQQ-E5fj.js} (91%) rename custom-toc-highlight/assets/{jszip.min-C61Pcz7i-B7gysC6o.js => jszip.min-C61Pcz7i-CEwjNmOq.js} (99%) rename custom-toc-highlight/assets/{kmlUtils-C5oIEoOy-BsvzFJRs.js => kmlUtils-C5oIEoOy-CPvy9nME.js} (93%) rename custom-toc-highlight/assets/{knowledgeGraphService-DOJz0fzA-DDr_20o0.js => knowledgeGraphService-DOJz0fzA-BlihQLi8.js} (99%) rename custom-toc-highlight/assets/{knowledgegraph-Dt7zfNlJ-BeekZJr0.js => knowledgegraph-Dt7zfNlJ-CqBwig9B.js} (72%) rename custom-toc-highlight/assets/{labelUtils-BW14kBqX-BkXd4VJn.js => labelUtils-BW14kBqX-Tk7uOiPw.js} (96%) rename custom-toc-highlight/assets/{labelingInfo-DGVNul26-zkvIaBlq.js => labelingInfo-DGVNul26-BDBqWm17.js} (98%) rename custom-toc-highlight/assets/{languageUtils-BYxF9hRA-BBstOXAc.js => languageUtils-BYxF9hRA-DnySuvAL.js} (99%) rename custom-toc-highlight/assets/{layerViewUtils-DURAPenP-CfS78eqb.js => layerViewUtils-DURAPenP-BGA3o1Pf.js} (83%) rename custom-toc-highlight/assets/{layersCreator-CW56kDKc-BGMnYi1N.js => layersCreator-CW56kDKc-CkfoFLoQ.js} (90%) rename custom-toc-highlight/assets/{layersLoader-CYI-LpLl-CLVN0BVs.js => layersLoader-CYI-LpLl-CUvaEb6F.js} (87%) rename custom-toc-highlight/assets/{lengthUtils-DKpMe5qR-C2NPRwwl.js => lengthUtils-DKpMe5qR-CsqJSDh_.js} (87%) rename custom-toc-highlight/assets/{lineSegment-CcqvCARM-CF4YE8GC.js => lineSegment-CcqvCARM-CDEWcAzV.js} (66%) rename custom-toc-highlight/assets/{loadAll-e978YItg-CdtGGDtb.js => loadAll-e978YItg-4pMG3qU7.js} (87%) rename custom-toc-highlight/assets/{loadGLTFMesh-C3-0Tu0H-B2ltp3ha.js => loadGLTFMesh-C3-0Tu0H-DZasI2OI.js} (77%) rename custom-toc-highlight/assets/{loadable-DbNDKH4r-D4CSNQAA.js => loadable-DbNDKH4r-CSXrQx_7.js} (80%) rename custom-toc-highlight/assets/{loader-Ch7Jr16w-DUAf9YhQ.js => loader-Ch7Jr16w-CF4bv9QO.js} (97%) rename custom-toc-highlight/assets/{loader-CkLCe-E_-QWQrU9Z8.js => loader-CkLCe-E_-BkhKaKBj.js} (97%) rename custom-toc-highlight/assets/{locale-Cn_GDVD_-Ar3RKmd3.js => locale-Cn_GDVD_-CCUxSwPB.js} (99%) rename custom-toc-highlight/assets/{main-ugzBrWNm.js => main-QGPoLsvl.js} (99%) rename custom-toc-highlight/assets/{mapViewDeps-CUVU8gUp-Ccomlwj9.js => mapViewDeps-CUVU8gUp-CjUjdWc1.js} (94%) rename custom-toc-highlight/assets/{mat4-DX7gBViE-DVqdGrVU.js => mat4-DX7gBViE-6clJxb1Q.js} (99%) rename custom-toc-highlight/assets/{mediaLayerUtils-CasWezAG-eGCMpSgm.js => mediaLayerUtils-CasWezAG-xuUSkW-V.js} (59%) rename custom-toc-highlight/assets/{meshFeatureAttributes-BwKR5odo-BBs3r8iT.js => meshFeatureAttributes-BwKR5odo-DaS-LG48.js} (82%) rename custom-toc-highlight/assets/{meshFeatureSet-zeR2pNmE-C8YqWSZl.js => meshFeatureSet-zeR2pNmE-Cmclz5Cy.js} (56%) rename custom-toc-highlight/assets/{meshSpatialReferenceScaleUtils-B1zR72Os-D-3pcUSm.js => meshSpatialReferenceScaleUtils-B1zR72Os-ndChBRyc.js} (92%) rename custom-toc-highlight/assets/{meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js => meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js} (82%) rename custom-toc-highlight/assets/{multidimensionalUtils-BwTugeu7-BTG9Of02.js => multidimensionalUtils-BwTugeu7-C75LYPc9.js} (99%) rename custom-toc-highlight/assets/{normalizeUtils-Bxmy9MNI-BT8FD-bF.js => normalizeUtils-Bxmy9MNI-fHOpXwKi.js} (96%) rename custom-toc-highlight/assets/{normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js => normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js} (92%) rename custom-toc-highlight/assets/{normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js => normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js} (97%) rename custom-toc-highlight/assets/{number-eRKYXfX9-eI8aiR_7.js => number-eRKYXfX9-bCdnHRN-.js} (98%) rename custom-toc-highlight/assets/{objectResourceUtils-CelAKRU2-D0g6fjBV.js => objectResourceUtils-CelAKRU2-CPIFq_KQ.js} (88%) rename custom-toc-highlight/assets/{observers-BigwqTsw-BNRQivHR.js => observers-BigwqTsw-CfIXp3Nz.js} (90%) rename custom-toc-highlight/assets/{ogcFeatureUtils-Bs12bZY3-BXRrRRmn.js => ogcFeatureUtils-Bs12bZY3-bQ3aM3rZ.js} (94%) rename custom-toc-highlight/assets/{openCloseComponent-BGQ6h7vg-COvbZ7sG.js => openCloseComponent-BGQ6h7vg-BO0gc3O8.js} (80%) rename custom-toc-highlight/assets/{optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js => optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js} (84%) rename custom-toc-highlight/assets/{orientedBoundingBox-oHezdpWm-BCiifXla.js => orientedBoundingBox-oHezdpWm-ilptOsP0.js} (96%) rename custom-toc-highlight/assets/{p2-screen-1-CQoqpp13-mlPgztrW.js => p2-screen-1-CQoqpp13-CqrIhWtO.js} (86%) create mode 100644 custom-toc-highlight/assets/panel-DET9aFON.js rename custom-toc-highlight/assets/{panel-DRUEhsxp-Bbd7sTo9.js => panel-DRUEhsxp-KxESJ732.js} (95%) delete mode 100644 custom-toc-highlight/assets/panel-DyBVvGsg.js rename custom-toc-highlight/assets/{parser-DyDJ-rlI-C9jRH52J.js => parser-DyDJ-rlI-CvOs11Ip.js} (98%) rename custom-toc-highlight/assets/{pbf-D-y3_eZO-DQKnyfOm.js => pbf-D-y3_eZO-CpHdkhuD.js} (98%) rename custom-toc-highlight/assets/{pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js => pbfQueryUtils-F4ZE8-K8-vP84FrXE.js} (98%) rename custom-toc-highlight/assets/{persistable-C6RBwzJi-CMdP5i4h.js => persistable-C6RBwzJi-CrVVP3ny.js} (96%) rename custom-toc-highlight/assets/{perspectiveUtils-Bu88xlbg-DGihQXe_.js => perspectiveUtils-Bu88xlbg-Cn6YpKwC.js} (84%) rename custom-toc-highlight/assets/{pieChart-qcxaoQkv-D93Sy6JQ.js => pieChart-qcxaoQkv-jYI0rZLi.js} (98%) rename custom-toc-highlight/assets/{plane-Dt8R0KeE-CVSP2GQG.js => plane-Dt8R0KeE-Bqc6oVGz.js} (97%) rename custom-toc-highlight/assets/{popupUtils-B0uZcXX0-DtBp-byj.js => popupUtils-B0uZcXX0-DHyOz1jC.js} (96%) rename custom-toc-highlight/assets/{popupUtils-nV1O8RUO-DAL58cHP.js => popupUtils-nV1O8RUO-BYG2KoFf.js} (91%) rename custom-toc-highlight/assets/{portalItemUtils-B8bw6SAG-CuS3mZw4.js => portalItemUtils-B8bw6SAG-DF460C0Y.js} (90%) rename custom-toc-highlight/assets/{portalLayers-Bh9bAhk4-BP6A8Lj4.js => portalLayers-Bh9bAhk4-Y1T2RWf3.js} (93%) delete mode 100644 custom-toc-highlight/assets/portalUtils-CKN9iXwH-B2zCer9u.js create mode 100644 custom-toc-highlight/assets/portalUtils-CKN9iXwH-BDO5uTJS.js rename custom-toc-highlight/assets/{project-DQKhruav-DBiiXhMD.js => project-DQKhruav-CyFgbMSU.js} (89%) rename custom-toc-highlight/assets/{projectBuffer-CvCBvJ6W-dLD7ajBt.js => projectBuffer-CvCBvJ6W-KqAd8Vef.js} (98%) delete mode 100644 custom-toc-highlight/assets/projectMeshVertexPositions-CFs_XMKX-CCginunE.js create mode 100644 custom-toc-highlight/assets/projectMeshVertexPositions-CFs_XMKX-Dz5wYyNf.js rename custom-toc-highlight/assets/{projectPointToVector-B2UUY9SE-BChPjj6-.js => projectPointToVector-B2UUY9SE-BIKNGLey.js} (50%) rename custom-toc-highlight/assets/{projectVectorToVector-sIYLNlex-B_PqSyiH.js => projectVectorToVector-sIYLNlex-DexDhaq1.js} (61%) rename custom-toc-highlight/assets/{projection-BA9M1R7d-BYoCXVXt.js => projection-BA9M1R7d-CAbqHZiw.js} (94%) rename custom-toc-highlight/assets/{quantizationUtils-bJy1cRwp-B-lEhyoX.js => quantizationUtils-bJy1cRwp-DFYZs_ns.js} (97%) rename custom-toc-highlight/assets/{quat-BODLR7mS-BrXZAXDf.js => quat-BODLR7mS-BQk2dgMZ.js} (96%) create mode 100644 custom-toc-highlight/assets/query-BAUG6dav-B_Pyr3t8.js delete mode 100644 custom-toc-highlight/assets/query-BAUG6dav-DJjDADlE.js rename custom-toc-highlight/assets/{query-DFW9-NG_-gbjlxRZk.js => query-DFW9-NG_-C3TyGmiM.js} (93%) rename custom-toc-highlight/assets/{queryAttachments-Bgvu3RnK-DnTvMlg4.js => queryAttachments-Bgvu3RnK-BeW9ZnXf.js} (63%) rename custom-toc-highlight/assets/{queryTopFeatures-IbhAPJlP-DYmbt-VV.js => queryTopFeatures-IbhAPJlP-DZGdrKJR.js} (88%) rename custom-toc-highlight/assets/{queryUtils-Brxu6254-PPvpiP5X.js => queryUtils-Brxu6254-CDiE0zms.js} (94%) rename custom-toc-highlight/assets/{queryZScale-BiYV6Pr6-B5UMbu5B.js => queryZScale-BiYV6Pr6-B7zp5L1G.js} (71%) rename custom-toc-highlight/assets/{rasterProjectionHelper-Calp0o_1-DktPwJyi.js => rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js} (96%) rename custom-toc-highlight/assets/{rasterUtils-DqAu9qES-Du-esSHL.js => rasterUtils-DqAu9qES-Be2s-rDn.js} (98%) rename custom-toc-highlight/assets/{rasterizingUtils-BmlDdKBf-CpGlbhM3.js => rasterizingUtils-BmlDdKBf-BP52xgN-.js} (94%) rename custom-toc-highlight/assets/{request-5gjwL9xx-CWxRJBjh.js => request-5gjwL9xx-Di1pi9yX.js} (93%) rename custom-toc-highlight/assets/{requestImageUtils-Ut4YcoNU-BtID-_Ic.js => requestImageUtils-Ut4YcoNU-CZnNufeN.js} (54%) rename custom-toc-highlight/assets/{resourceExtension-CdQvIDKV-BNH6JkTz.js => resourceExtension-CdQvIDKV-DCvzsrJt.js} (88%) rename custom-toc-highlight/assets/{resourceUtils-BmW6QqlX-B1DAUGNs.js => resourceUtils-BmW6QqlX-D_AxNrCI.js} (82%) rename custom-toc-highlight/assets/{resourceUtils-Ds65naCv-jCWWLIQy.js => resourceUtils-Ds65naCv-PY5SfRMU.js} (92%) rename custom-toc-highlight/assets/{resourceUtils-rTM6Iemx-BROWZCZ1.js => resourceUtils-rTM6Iemx-GPPQBysx.js} (94%) rename custom-toc-highlight/assets/{saveUtils-CIYk-dsQ-VGcOewby.js => saveUtils-CIYk-dsQ-Br9QCJTX.js} (93%) rename custom-toc-highlight/assets/{scaleUtils-DxsfQwK1-D7ZZd5W4.js => scaleUtils-DxsfQwK1-CzyfErWH.js} (81%) rename custom-toc-highlight/assets/{screen-BGsID61t-Co1xWElA.js => screen-BGsID61t-BTqeBZJo.js} (99%) rename custom-toc-highlight/assets/{screen-CcinMdyM-Bc6n_y5I.js => screen-CcinMdyM-CM_vb3KL.js} (97%) rename custom-toc-highlight/assets/{screen-CmNk4p3g-sxLtN1_r.js => screen-CmNk4p3g-CWwKxIyL.js} (97%) rename custom-toc-highlight/assets/{screen-D-fcMt_1-CqBjqxx_.js => screen-D-fcMt_1-D3QyEveF.js} (99%) rename custom-toc-highlight/assets/{screen-DOMT-YVI-Bf21b3uS.js => screen-DOMT-YVI-wvT49eu9.js} (99%) rename custom-toc-highlight/assets/{screen-DTrOvIb7-BtDirMSz.js => screen-DTrOvIb7-CxTZcnC-.js} (72%) rename custom-toc-highlight/assets/{screen-N-CoZlcH-DEJO0pOT.js => screen-N-CoZlcH-D0u53zN0.js} (99%) rename custom-toc-highlight/assets/{screen-NGXXpKUs-C6NVgv_3.js => screen-NGXXpKUs-DF8RN7bq.js} (99%) rename custom-toc-highlight/assets/{screen-bYjBkDBU-C7Z9GxGM.js => screen-bYjBkDBU-CqvHQESh.js} (95%) rename custom-toc-highlight/assets/{screen-oq2ZVtwf-pDGs-Ow3.js => screen-oq2ZVtwf-B7xZh-jW.js} (98%) rename custom-toc-highlight/assets/{screen-x-yg_fPu-DpiHFK6N.js => screen-x-yg_fPu-CAXKOE6F.js} (96%) rename custom-toc-highlight/assets/{scrim-BscQh4v9-DU79ospE.js => scrim-BscQh4v9-CloQFru7.js} (89%) rename custom-toc-highlight/assets/{serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js => serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js} (98%) rename custom-toc-highlight/assets/{shared-D1w-26bA-B8KlJvO_.js => shared-D1w-26bA-BBIRhcUQ.js} (96%) rename custom-toc-highlight/assets/{shp.min-rg-oXwj1-ah6Bxjq9.js => shp.min-rg-oXwj1-yfa7dGlo.js} (99%) rename custom-toc-highlight/assets/{signal-CETehA7D-DhpyJ8yp.js => signal-CETehA7D-DQA5V72u.js} (83%) rename custom-toc-highlight/assets/{sourceUtils-BMeqkJ5g-DxP4qerC.js => sourceUtils-BMeqkJ5g-DcR3VPl5.js} (92%) rename custom-toc-highlight/assets/{spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js => spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js} (87%) rename custom-toc-highlight/assets/{sphere-BenPORjV-DaZ5Vv8x.js => sphere-BenPORjV-B4uz1SYF.js} (95%) rename custom-toc-highlight/assets/{statsWorker-C0rnMAI--GTjEuZBF.js => statsWorker-C0rnMAI--CdD2XdJS.js} (78%) rename custom-toc-highlight/assets/{story-D5JOvNzl.css => story-DbFhYdqg.css} (88%) rename custom-toc-highlight/assets/{story-BfX8CRfG.js => story-Doly9N9p.js} (92%) rename custom-toc-highlight/assets/{streamLayerUtils-CLc_16nt-D4AKQJ_S.js => streamLayerUtils-CLc_16nt-qAXYcZQO.js} (70%) rename custom-toc-highlight/assets/{styleUtils-BtpNqZyT-D2Hj1Rgz.js => styleUtils-BtpNqZyT-Bnq2S5kK.js} (96%) rename custom-toc-highlight/assets/{styleUtils-ChrJTYIw-BfDrXrWd.js => styleUtils-ChrJTYIw-C6xq7Jeu.js} (86%) rename custom-toc-highlight/assets/{sublayerUtils-CyM0QC5B-D9HVKWXR.js => sublayerUtils-CyM0QC5B-B1ryunQi.js} (94%) rename custom-toc-highlight/assets/{substitute-j49H6mVR-CJn4Lavp.js => substitute-j49H6mVR-DTufu01J.js} (87%) create mode 100644 custom-toc-highlight/assets/symbolLayerUtils-DAaEQEr6-Bj3jPwWU.js delete mode 100644 custom-toc-highlight/assets/symbolLayerUtils-DAaEQEr6-Dvu4w6pW.js rename custom-toc-highlight/assets/{t9n-C_hcZMZJ-D4zmKT16.js => t9n-C_hcZMZJ-Du2NPCXI.js} (84%) rename custom-toc-highlight/assets/{testSVGPremultipliedAlpha-DoZe_f0d-DBs2wvPw.js => testSVGPremultipliedAlpha-DoZe_f0d-BwcxFsN9.js} (88%) rename custom-toc-highlight/assets/{themeUtils-YjM7iIiX-3_GiOEs2.js => themeUtils-YjM7iIiX-DGrOr3vp.js} (99%) rename custom-toc-highlight/assets/{timeSupport-jPViR5jn-GyoVmGVI.js => timeSupport-jPViR5jn-7bshRI7L.js} (96%) rename custom-toc-highlight/assets/{timeSupport-ohWmWReZ-ByDHlqgT.js => timeSupport-ohWmWReZ-D2lpSlXU.js} (83%) rename custom-toc-highlight/assets/{toggle-switch-control-B4JzuvHa-xR5vylCb.js => toggle-switch-control-B4JzuvHa-B1HiDvC7.js} (99%) rename custom-toc-highlight/assets/{triangle-hqU-Tc1X-DLjOhwz3.js => triangle-hqU-Tc1X-CaBFJROi.js} (53%) rename custom-toc-highlight/assets/{uploadAssets-fBa6NH35-CH6CgKuA.js => uploadAssets-fBa6NH35-BYiJ1e4f.js} (93%) rename custom-toc-highlight/assets/{utils-9sQxfkoa-KicvrT8N.js => utils-9sQxfkoa-D8FX0sO8.js} (87%) rename custom-toc-highlight/assets/{utils-BVWK2jiA-Btpo3M9u.js => utils-BVWK2jiA-i-Dn2Ad8.js} (90%) rename custom-toc-highlight/assets/{utils-Bq23Xwmj--_SaacS5.js => utils-Bq23Xwmj-CKlS81kz.js} (74%) rename custom-toc-highlight/assets/{utils-DPtQ14k3-CAwuJg76.js => utils-DPtQ14k3-CBDffBYM.js} (83%) rename custom-toc-highlight/assets/{utils-Dcs650Ic--a87iok1.js => utils-Dcs650Ic-LHpLlTO1.js} (95%) rename custom-toc-highlight/assets/{utils-DyydRFHu-BQ5pghrp.js => utils-DyydRFHu-1ITtOELE.js} (83%) rename custom-toc-highlight/assets/{utils-HtkT8Fn3-wUwu1nm1.js => utils-HtkT8Fn3-Dd_0rdy5.js} (86%) rename custom-toc-highlight/assets/{utils-SPbpQbmm-B3hR8LxB.js => utils-SPbpQbmm-CiwW7WzR.js} (99%) rename custom-toc-highlight/assets/{utils-tNxq3jkf-B78XlSIE.js => utils-tNxq3jkf-nfQcZo7O.js} (98%) rename custom-toc-highlight/assets/{utils3-BSH0zqNl-7T4-U7N_.js => utils3-BSH0zqNl-90fd1I_b.js} (92%) rename custom-toc-highlight/assets/{vec3-BazNroeq-PdcGTXFi.js => vec3-BazNroeq-CRjQH4Pj.js} (96%) rename custom-toc-highlight/assets/{vec32-D9GsKZ1t-BjayBdwt.js => vec32-D9GsKZ1t-BPSFE14A.js} (98%) rename custom-toc-highlight/assets/{vec4-DWDdg1fj-BagfV9qf.js => vec4-DWDdg1fj-BHg6FqkT.js} (96%) rename custom-toc-highlight/assets/{versionUtils-LZYZz-38-DxOZEoAg.js => versionUtils-LZYZz-38-B8C5OAjF.js} (97%) rename custom-toc-highlight/assets/{vertexSpaceConversion-CiKaVq_u-D2kQTb17.js => vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js} (89%) rename custom-toc-highlight/assets/{visualVariableUtils-D3kZJRyn-23qzp7zg.js => visualVariableUtils-D3kZJRyn-tyrXoPjU.js} (96%) create mode 100644 custom-toc-highlight/assets/vue.esm-bundler-D2erd_gM-C7Afc0Sc.js delete mode 100644 custom-toc-highlight/assets/vue.esm-bundler-D2erd_gM-D0q3-bhf.js rename custom-toc-highlight/assets/{webStyleSymbolUtils-BxoWoVrm-C1lXrtRo.js => webStyleSymbolUtils-BxoWoVrm-BPh4zlRp.js} (88%) rename custom-toc-highlight/assets/{webglDeps-Bgavuh0h-CPBMgmjx.js => webglDeps-Bgavuh0h-31Q0Fngh.js} (70%) rename custom-toc-highlight/assets/{wfsUtils-DoLaqXsj-B0NjDgDj.js => wfsUtils-DoLaqXsj-DBVQwnFp.js} (97%) rename custom-toc-highlight/assets/{workers-PiCjreoO-idkDTJa3.js => workers-PiCjreoO-Dc6Tqm-o.js} (77%) rename custom-toc-highlight/assets/{writeUtils-D5qlLkwk-xd5TEmf9.js => writeUtils-D5qlLkwk-enZap9KW.js} (96%) rename custom-toc-highlight/assets/{xyChart-Ch-p5aUf-DytGK0KM.js => xyChart-Ch-p5aUf-CLpax4aT.js} (99%) diff --git a/custom-toc-highlight/assets/AGraphicContainer-LUCT6Gle-Dvv0TF4N.js b/custom-toc-highlight/assets/AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js similarity index 88% rename from custom-toc-highlight/assets/AGraphicContainer-LUCT6Gle-Dvv0TF4N.js rename to custom-toc-highlight/assets/AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js index 4f3309d8..a6151526 100644 --- a/custom-toc-highlight/assets/AGraphicContainer-LUCT6Gle-Dvv0TF4N.js +++ b/custom-toc-highlight/assets/AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js @@ -1,4 +1,4 @@ -import{aA as O,hT as D}from"./story-BfX8CRfG.js";import{j as I,Z as V,G as z}from"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import{N as C,e as g}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{o as h}from"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import{R as T,E as w,C as E,G as N,D as G}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as L}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{t as $}from"./vec3f32-BS0cezmI-B_madU1n.js";import{l as k}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{T as F}from"./Container-BcuL1ZEG-DxXVQv25.js";import{G as P}from"./LabelMetric-BeluzH3o-C3fDXNzp.js";import{r as v}from"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import{A as b,T as U,I as R,n as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as j}from"./VertexArrayObject-M4iRGGoi-THP-veuo.js";let H=0;function c(f,t){return new V(z(H++),f,t)}const d={visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null,visualVariableSizeOutlineScaleStops:null};class W{constructor(){this.instances={fill:c(h.fill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),marker:c(h.marker,{uniforms:d,optionalAttributes:{zoomRange:!0}}),line:c(h.line,{uniforms:d,optionalAttributes:{zoomRange:!0}}),text:c(h.text,{uniforms:d,optionalAttributes:{zoomRange:!0,referenceSymbol:!1,clipAngle:!1}}),complexFill:c(h.complexFill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),texturedLine:c(h.texturedLine,{uniforms:d,optionalAttributes:{zoomRange:!0}}),animatedMarker:c(h.animatedMarker,{uniforms:d,optionalAttributes:{zoomRange:!0}})},this._instancesById=Object.values(this.instances).reduce((t,e)=>(t.set(e.instanceId,e),t),new Map)}getInstance(t){return this._instancesById.get(t)}}const q=Math.PI/180,Y=4;class J extends F{constructor(t){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=g(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=D(this._program)}doRender(t){const{context:e}=t,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,r),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(b.ONE,b.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0);const a=this._program;e.bindVAO(this._vao),e.useProgram(a),a.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(U.LINES,8*r.length,R.UNSIGNED_INT,0),e.bindVAO()}_createTransforms(){return{displayViewScreenMat3:g()}}_createShaderProgram(t){if(this._program)return;const e=`precision highp float; +import{aA as O,hT as D}from"./story-Doly9N9p.js";import{j as I,Z as V,G as z}from"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import{N as C,e as g}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{o as h}from"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import{R as T,E as w,C as E,G as N,D as G}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as L}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{t as $}from"./vec3f32-BS0cezmI-B_madU1n.js";import{l as k}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{T as F}from"./Container-BcuL1ZEG-DVZvemLA.js";import{G as P}from"./LabelMetric-BeluzH3o-Br-5CSAC.js";import{r as v}from"./BufferObject-BM_7mcDb-EYaqMhmk.js";import{A as b,T as U,I as R,n as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as j}from"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";let H=0;function c(f,t){return new V(z(H++),f,t)}const d={visualVariableColor:null,visualVariableOpacity:null,visualVariableSizeMinMaxValue:null,visualVariableSizeScaleStops:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null,visualVariableRotation:null,visualVariableSizeOutlineScaleStops:null};class W{constructor(){this.instances={fill:c(h.fill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),marker:c(h.marker,{uniforms:d,optionalAttributes:{zoomRange:!0}}),line:c(h.line,{uniforms:d,optionalAttributes:{zoomRange:!0}}),text:c(h.text,{uniforms:d,optionalAttributes:{zoomRange:!0,referenceSymbol:!1,clipAngle:!1}}),complexFill:c(h.complexFill,{uniforms:d,optionalAttributes:{zoomRange:!0}}),texturedLine:c(h.texturedLine,{uniforms:d,optionalAttributes:{zoomRange:!0}}),animatedMarker:c(h.animatedMarker,{uniforms:d,optionalAttributes:{zoomRange:!0}})},this._instancesById=Object.values(this.instances).reduce((t,e)=>(t.set(e.instanceId,e),t),new Map)}getInstance(t){return this._instancesById.get(t)}}const q=Math.PI/180,Y=4;class J extends F{constructor(t){super(),this._program=null,this._vao=null,this._vertexBuffer=null,this._indexBuffer=null,this._dvsMat3=g(),this._localOrigin={x:0,y:0},this._getBounds=t}destroy(){this._vao&&(this._vao.dispose(),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program=D(this._program)}doRender(t){const{context:e}=t,r=this._getBounds();if(r.length<1)return;this._createShaderProgram(e),this._updateMatricesAndLocalOrigin(t),this._updateBufferData(e,r),e.setBlendingEnabled(!0),e.setDepthTestEnabled(!1),e.setStencilWriteMask(0),e.setStencilTestEnabled(!1),e.setBlendFunction(b.ONE,b.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0);const a=this._program;e.bindVAO(this._vao),e.useProgram(a),a.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),e.gl.lineWidth(1),e.drawElements(U.LINES,8*r.length,R.UNSIGNED_INT,0),e.bindVAO()}_createTransforms(){return{displayViewScreenMat3:g()}}_createShaderProgram(t){if(this._program)return;const e=`precision highp float; uniform mat3 u_dvsMat3; attribute vec2 a_position; diff --git a/custom-toc-highlight/assets/APIKeyMixin-BUMSx9ny-D_H-H5sI.js b/custom-toc-highlight/assets/APIKeyMixin-BUMSx9ny-C9ZHhLj0.js similarity index 86% rename from custom-toc-highlight/assets/APIKeyMixin-BUMSx9ny-D_H-H5sI.js rename to custom-toc-highlight/assets/APIKeyMixin-BUMSx9ny-C9ZHhLj0.js index 8060b462..1656df3d 100644 --- a/custom-toc-highlight/assets/APIKeyMixin-BUMSx9ny-D_H-H5sI.js +++ b/custom-toc-highlight/assets/APIKeyMixin-BUMSx9ny-C9ZHhLj0.js @@ -1 +1 @@ -import{v as r,S as s,i as a}from"./story-BfX8CRfG.js";function n(i){return"portalItem"in i}const l=i=>{let e=class extends i{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):n(this)?this.portalItem?.apiKey:null}set apiKey(t){t!=null?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return r([s({type:String})],e.prototype,"apiKey",null),e=r([a("esri.layers.mixins.APIKeyMixin")],e),e};export{l as n}; +import{v as r,S as s,i as a}from"./story-Doly9N9p.js";function n(i){return"portalItem"in i}const l=i=>{let e=class extends i{get apiKey(){return this._isOverridden("apiKey")?this._get("apiKey"):n(this)?this.portalItem?.apiKey:null}set apiKey(t){t!=null?this._override("apiKey",t):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return r([s({type:String})],e.prototype,"apiKey",null),e=r([a("esri.layers.mixins.APIKeyMixin")],e),e};export{l as n}; diff --git a/custom-toc-highlight/assets/Analysis-BPgJ-FCw-D6W8PmkR.js b/custom-toc-highlight/assets/Analysis-BPgJ-FCw-CJ_Utx59.js similarity index 92% rename from custom-toc-highlight/assets/Analysis-BPgJ-FCw-D6W8PmkR.js rename to custom-toc-highlight/assets/Analysis-BPgJ-FCw-CJ_Utx59.js index 0f6e40c7..b4202059 100644 --- a/custom-toc-highlight/assets/Analysis-BPgJ-FCw-D6W8PmkR.js +++ b/custom-toc-highlight/assets/Analysis-BPgJ-FCw-CJ_Utx59.js @@ -1 +1 @@ -import{bA as n,aa as r,bR as l,aq as o,v as s,S as i,i as p,j as y}from"./story-BfX8CRfG.js";let c=0,e=class extends n(r(l(y))){constructor(a){super(a),this.id=`${Date.now().toString(16)}-analysis-${c++}`,this.title=null}get parent(){return this._get("parent")}set parent(a){const t=this.parent;if(t!=null)switch(t.type){case"line-of-sight":case"dimension":case"viewshed":t.releaseAnalysis(this);break;case"2d":case"3d":t.analyses.includes(this)&&t.analyses.remove(this)}this._set("parent",a)}get isEditable(){return this.requiredPropertiesForEditing.every(o)}};s([i({type:String,constructOnly:!0,clonable:!1})],e.prototype,"id",void 0),s([i({type:String})],e.prototype,"title",void 0),s([i({clonable:!1,value:null})],e.prototype,"parent",null),s([i({readOnly:!0})],e.prototype,"isEditable",null),e=s([p("esri.analysis.Analysis")],e);const u=e;export{u as y}; +import{bA as n,aa as r,bR as l,aq as o,v as s,S as i,i as p,j as y}from"./story-Doly9N9p.js";let c=0,e=class extends n(r(l(y))){constructor(a){super(a),this.id=`${Date.now().toString(16)}-analysis-${c++}`,this.title=null}get parent(){return this._get("parent")}set parent(a){const t=this.parent;if(t!=null)switch(t.type){case"line-of-sight":case"dimension":case"viewshed":t.releaseAnalysis(this);break;case"2d":case"3d":t.analyses.includes(this)&&t.analyses.remove(this)}this._set("parent",a)}get isEditable(){return this.requiredPropertiesForEditing.every(o)}};s([i({type:String,constructOnly:!0,clonable:!1})],e.prototype,"id",void 0),s([i({type:String})],e.prototype,"title",void 0),s([i({clonable:!1,value:null})],e.prototype,"parent",null),s([i({readOnly:!0})],e.prototype,"isEditable",null),e=s([p("esri.analysis.Analysis")],e);const u=e;export{u as y}; diff --git a/custom-toc-highlight/assets/ArcGISCachedService-C64Ko1TY-9EmQxNmS.js b/custom-toc-highlight/assets/ArcGISCachedService-C64Ko1TY-COmlLbBz.js similarity index 86% rename from custom-toc-highlight/assets/ArcGISCachedService-C64Ko1TY-9EmQxNmS.js rename to custom-toc-highlight/assets/ArcGISCachedService-C64Ko1TY-COmlLbBz.js index 90e5c2aa..c842eff2 100644 --- a/custom-toc-highlight/assets/ArcGISCachedService-C64Ko1TY-9EmQxNmS.js +++ b/custom-toc-highlight/assets/ArcGISCachedService-C64Ko1TY-COmlLbBz.js @@ -1 +1 @@ -import{v as l,S as i,a0 as m,J as v,i as S}from"./story-BfX8CRfG.js";import{V as d}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import{c as x}from"./TileInfoTilemapCache-D1SExPij-BhR83GZf.js";import{f as I}from"./TilemapCache-CRRxws77-BBkZHUXn.js";const g=y=>{let e=class extends y{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}readMaxScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(s,t,f){const h=t.capabilities?.includes("Tilemap");let{minLOD:r,maxLOD:a,minScale:p,maxScale:c}=t;if(r==null&&a==null&&p!==0&&c!==0){const o=n=>Math.round(1e4*n)/1e4;p=o(p||t.tileInfo.lods[0].scale),c=o(c||t.tileInfo.lods[t.tileInfo.lods.length-1].scale);for(const n of t.tileInfo.lods){const u=o(n.scale);r=u>=p?n.level:r,a=u>=c?n.level:a}}if(h)return new I({layer:this,minLOD:r,maxLOD:a});if(t.tileInfo){const o=new d;return o.read(t.tileInfo,f),new x(o,r,a)}return null}};return l([i({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),l([i()],e.prototype,"minScale",void 0),l([m("service","minScale")],e.prototype,"readMinScale",null),l([i()],e.prototype,"maxScale",void 0),l([m("service","maxScale")],e.prototype,"readMaxScale",null),l([i({type:v})],e.prototype,"spatialReference",void 0),l([i({readOnly:!0})],e.prototype,"supportsBlankTile",null),l([i({type:d})],e.prototype,"tileInfo",void 0),l([i()],e.prototype,"tilemapCache",void 0),l([m("service","tilemapCache",["capabilities","tileInfo"])],e.prototype,"readTilemapCache",null),l([i()],e.prototype,"version",void 0),e=l([S("esri.layers.mixins.ArcGISCachedService")],e),e};export{g as O}; +import{v as l,S as i,a0 as m,J as v,i as S}from"./story-Doly9N9p.js";import{V as d}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import{c as x}from"./TileInfoTilemapCache-D1SExPij-BDoYZo_V.js";import{f as I}from"./TilemapCache-CRRxws77-CCC00Yar.js";const g=y=>{let e=class extends y{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}destroy(){this.tilemapCache?.destroy?.()}readMinScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}readMaxScale(s,t){return t.minLOD!=null&&t.maxLOD!=null?s:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(s,t,f){const h=t.capabilities?.includes("Tilemap");let{minLOD:r,maxLOD:a,minScale:p,maxScale:c}=t;if(r==null&&a==null&&p!==0&&c!==0){const o=n=>Math.round(1e4*n)/1e4;p=o(p||t.tileInfo.lods[0].scale),c=o(c||t.tileInfo.lods[t.tileInfo.lods.length-1].scale);for(const n of t.tileInfo.lods){const u=o(n.scale);r=u>=p?n.level:r,a=u>=c?n.level:a}}if(h)return new I({layer:this,minLOD:r,maxLOD:a});if(t.tileInfo){const o=new d;return o.read(t.tileInfo,f),new x(o,r,a)}return null}};return l([i({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),l([i()],e.prototype,"minScale",void 0),l([m("service","minScale")],e.prototype,"readMinScale",null),l([i()],e.prototype,"maxScale",void 0),l([m("service","maxScale")],e.prototype,"readMaxScale",null),l([i({type:v})],e.prototype,"spatialReference",void 0),l([i({readOnly:!0})],e.prototype,"supportsBlankTile",null),l([i({type:d})],e.prototype,"tileInfo",void 0),l([i()],e.prototype,"tilemapCache",void 0),l([m("service","tilemapCache",["capabilities","tileInfo"])],e.prototype,"readTilemapCache",null),l([i()],e.prototype,"version",void 0),e=l([S("esri.layers.mixins.ArcGISCachedService")],e),e};export{g as O}; diff --git a/custom-toc-highlight/assets/ArcGISService-BYA-y6X6-C_YhndKK.js b/custom-toc-highlight/assets/ArcGISService-BYA-y6X6-DNHMEBm_.js similarity index 78% rename from custom-toc-highlight/assets/ArcGISService-BYA-y6X6-C_YhndKK.js rename to custom-toc-highlight/assets/ArcGISService-BYA-y6X6-DNHMEBm_.js index 714af0c5..178eb924 100644 --- a/custom-toc-highlight/assets/ArcGISService-BYA-y6X6-C_YhndKK.js +++ b/custom-toc-highlight/assets/ArcGISService-BYA-y6X6-DNHMEBm_.js @@ -1 +1 @@ -import{v as i,S as r,i as s,a1 as n}from"./story-BfX8CRfG.js";import{i as o,j as u}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";const h=l=>{let e=class extends l{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const t=o(this.url);if(t!=null&&t.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",u(t,n.getLogger(this)))}};return i([r()],e.prototype,"title",null),i([r({type:String})],e.prototype,"url",null),e=i([s("esri.layers.mixins.ArcGISService")],e),e};export{h as a}; +import{v as i,S as r,i as s,a1 as n}from"./story-Doly9N9p.js";import{i as o,j as u}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";const h=l=>{let e=class extends l{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const t=o(this.url);if(t!=null&&t.title)return t.title}return this._get("title")||""}set title(t){this._set("title",t)}set url(t){this._set("url",u(t,n.getLogger(this)))}};return i([r()],e.prototype,"title",null),i([r({type:String})],e.prototype,"url",null),e=i([s("esri.layers.mixins.ArcGISService")],e),e};export{h as a}; diff --git a/custom-toc-highlight/assets/AttachmentInfo-D9RFO8W2-DYgfjXim.js b/custom-toc-highlight/assets/AttachmentInfo-D9RFO8W2-CMU9-WNo.js similarity index 96% rename from custom-toc-highlight/assets/AttachmentInfo-D9RFO8W2-DYgfjXim.js rename to custom-toc-highlight/assets/AttachmentInfo-D9RFO8W2-CMU9-WNo.js index 6b083259..c41dbaf8 100644 --- a/custom-toc-highlight/assets/AttachmentInfo-D9RFO8W2-DYgfjXim.js +++ b/custom-toc-highlight/assets/AttachmentInfo-D9RFO8W2-CMU9-WNo.js @@ -1 +1 @@ -import{v as o,S as e,bB as s,i as u,e as f}from"./story-BfX8CRfG.js";function y(n){const{exifInfo:i,exifName:r,tagName:a}=n;if(!i||!r||!a)return null;const d=i.find(p=>p.name===r);return d?m({tagName:a,tags:d.tags}):null}function m(n){const{tagName:i,tags:r}=n;return!r||!i?null:r.find(a=>a.name===i)?.value||null}var l;const I={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 t=l=class extends f{constructor(n){super(n),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:n}=this,i=y({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:n});return I[i]||null}clone(){return new l({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})}};o([e({type:String})],t.prototype,"contentType",void 0),o([e()],t.prototype,"exifInfo",void 0),o([e({readOnly:!0})],t.prototype,"orientationInfo",null),o([e({type:s})],t.prototype,"id",void 0),o([e({type:String})],t.prototype,"globalId",void 0),o([e({type:String})],t.prototype,"keywords",void 0),o([e({type:String})],t.prototype,"name",void 0),o([e({json:{read:!1}})],t.prototype,"parentGlobalId",void 0),o([e({json:{read:!1}})],t.prototype,"parentObjectId",void 0),o([e({type:s})],t.prototype,"size",void 0),o([e({json:{read:!1}})],t.prototype,"url",void 0),t=l=o([u("esri.rest.query.support.AttachmentInfo")],t);const c=t;export{c as h}; +import{v as o,S as e,bB as s,i as u,e as f}from"./story-Doly9N9p.js";function y(n){const{exifInfo:i,exifName:r,tagName:a}=n;if(!i||!r||!a)return null;const d=i.find(p=>p.name===r);return d?m({tagName:a,tags:d.tags}):null}function m(n){const{tagName:i,tags:r}=n;return!r||!i?null:r.find(a=>a.name===i)?.value||null}var l;const I={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 t=l=class extends f{constructor(n){super(n),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:n}=this,i=y({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:n});return I[i]||null}clone(){return new l({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})}};o([e({type:String})],t.prototype,"contentType",void 0),o([e()],t.prototype,"exifInfo",void 0),o([e({readOnly:!0})],t.prototype,"orientationInfo",null),o([e({type:s})],t.prototype,"id",void 0),o([e({type:String})],t.prototype,"globalId",void 0),o([e({type:String})],t.prototype,"keywords",void 0),o([e({type:String})],t.prototype,"name",void 0),o([e({json:{read:!1}})],t.prototype,"parentGlobalId",void 0),o([e({json:{read:!1}})],t.prototype,"parentObjectId",void 0),o([e({type:s})],t.prototype,"size",void 0),o([e({json:{read:!1}})],t.prototype,"url",void 0),t=l=o([u("esri.rest.query.support.AttachmentInfo")],t);const c=t;export{c as h}; diff --git a/custom-toc-highlight/assets/AttributeArray-BWXEft_i-ZluJi335.js b/custom-toc-highlight/assets/AttributeArray-BWXEft_i-lURl2Jp5.js similarity index 97% rename from custom-toc-highlight/assets/AttributeArray-BWXEft_i-ZluJi335.js rename to custom-toc-highlight/assets/AttributeArray-BWXEft_i-lURl2Jp5.js index dbbd0caf..38d16a26 100644 --- a/custom-toc-highlight/assets/AttributeArray-BWXEft_i-ZluJi335.js +++ b/custom-toc-highlight/assets/AttributeArray-BWXEft_i-lURl2Jp5.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./HUDMaterial.glsl-BLhEaLk5-CpaRLlUD.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./QueryEngine-CH5uUhZK-BP95Dm56.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-9sQxfkoa-KicvrT8N.js","./utils-Bq23Xwmj--_SaacS5.js","./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./LRUCache-C3erQTWv-0wD6drRf.js","./WhereClause-DxwoyBMS-DnXKVpm2.js","./TimeOnly-DSMefxKy-BU7RNYWc.js","./UnknownTimeZone-C--TOcPG-D3CAoWPX.js","./fieldType-CD2CL2hr-CMChCO5s.js","./timeSupport-jPViR5jn-GyoVmGVI.js","./queryUtils-Brxu6254-PPvpiP5X.js","./json-BI97KiBB-Ce5cWfI2.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./quantizationUtils-bJy1cRwp-B-lEhyoX.js","./utils-HtkT8Fn3-wUwu1nm1.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./heatmapUtils-seiMkkkR-Cj1KmweL.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-DyydRFHu-BQ5pghrp.js","./Basemap-BEqqSTw9-B5O9ub1-.js","./loadAll-e978YItg-CdtGGDtb.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./writeUtils-D5qlLkwk-xd5TEmf9.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-DVqdGrVU.js","./utils-tNxq3jkf-B78XlSIE.js","./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js","./FieldsIndex-HmzMbJQG-DZuFWLvd.js","./Scheduler-B7UX7Wr5-DQCcMKpm.js","./signal-CETehA7D-DhpyJ8yp.js","./Query-BrwMGK8U-DoFNfkjX.js","./Field-C6hA1tZj-CpGOU6Y4.js","./ReactiveMap-CFk6jPfN-Du1XE-2a.js","./PooledRBush-DbfAmeLn-B9Pkw5Ae.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./query-DFW9-NG_-gbjlxRZk.js","./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js","./pbf-D-y3_eZO-DQKnyfOm.js","./queryZScale-BiYV6Pr6-B5UMbu5B.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./Indices-DEr2HrWx-BuNk6xPZ.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./glUtil-n1JOrdV3-CRAZdee5.js","./enums-DBi1-Mm2-CUS1pvQe.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./VertexAttribute-DqD5S0a2-3q90nikV.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./NestedMap-Ddo7BfvO-BpVPk8mz.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./Util-BjGjeg6f-08Szkf4F.js","./vec32-D9GsKZ1t-BjayBdwt.js","./InterleavedLayout-DXzw3B2n-iCEii9j9.js","./BufferView-PQoE3GL7-Duht5lAO.js","./types-ChhhI6OU-Cxh6dPlX.js","./Octree-CJNwbhg4-kBqt3mh_.js","./sphere-BenPORjV-DaZ5Vv8x.js","./mat3-CC4Foazl-BWjyqE2v.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./plane-Dt8R0KeE-CVSP2GQG.js","./quatf64-C16JxGFv-BKWK1F8U.js","./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js","./BufferObject-BM_7mcDb-Dq7c9k7y.js","./Texture-BCt2hphT-hC4XzHg_.js","./boundedPlane-DlvE0eNx-dpkNyaGh.js","./lineSegment-CcqvCARM-CF4YE8GC.js","./VertexArrayObject-M4iRGGoi-THP-veuo.js","./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js","./floatRGBA-4pIJN00G-BsIUaPaZ.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./renderState-Dap0WV9P-D4IHxyei.js","./projectVectorToVector-sIYLNlex-B_PqSyiH.js","./projectPointToVector-B2UUY9SE-BChPjj6-.js","./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js","./MeshLocalVertexSpace-BqgocsoS-Dycut332.js","./vec3f32-BS0cezmI-B_madU1n.js","./orientedBoundingBox-oHezdpWm-BCiifXla.js","./quat-BODLR7mS-BrXZAXDf.js","./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js","./triangle-hqU-Tc1X-DLjOhwz3.js","./BindType-9iOk18Ed-CRW1cdX4.js","./requestImageUtils-Ut4YcoNU-BtID-_Ic.js","./lengthUtils-DKpMe5qR-C2NPRwwl.js"])))=>i.map(i=>d[i]); -import{_ as _t}from"./main-ugzBrWNm.js";import{v as m,S as z,i as ur,gU as go,c$ as si,j as li,dg as I,ah as ci,aL as xo,o as Te,aN as St,hT as Rt,d2 as di,h_ as Ke,i0 as ut,hZ as It,K as _o,hB as To,bl as bo,ae as hr,U as Oe,t as Eo,I as So,cO as Ir,cw as Ao,hU as rt,hY as it,$ as Lr,iy as Co,E as wo,aS as Mo,iz as Oo,iA as yo,hq as ui,i8 as Ro,hc as Io,hV as Lo,a1 as hi,al as No,bw as Po}from"./story-BfX8CRfG.js";import{r as Do}from"./requestImageUtils-Ut4YcoNU-BtID-_Ic.js";import{i as ve,N as ge,e as Tt,s as Ft,O as Qt,t as er,D as Ve}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{A as At,L as de,D as ae,G as ht,U as Ie,s as Fo,R as Bo,T as zo,f as Go,M as Je,X as ye,t as pe}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as mi,V as ke,F as Vo,X as Ho}from"./Texture-BCt2hphT-hC4XzHg_.js";import{h as W}from"./Util-BjGjeg6f-08Szkf4F.js";import{b as xe,_ as Y,N as He,R as fi,Y as mt,j as Uo,r as nt,A as yt,l as mr,L as Nr,y as Wo,Z as jo,k as Ye,S as pi,X as Pr,p as $o}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{l as tr}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{R as qo}from"./InterleavedLayout-DXzw3B2n-iCEii9j9.js";import{o as F,t as Q,c as ft,S as Bt,i as fe,h as vi,g as Dr,p as kt,f as ko}from"./NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js";import{t as zt}from"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import{e as s,c as y,i as Qe}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{a as R}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{o as be}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./boundedPlane-DlvE0eNx-dpkNyaGh.js";import{b as gi,F as _e}from"./sphere-BenPORjV-DaZ5Vv8x.js";import{f as Yo,K as Gt,B as Xo,m as Vt,y as Jo,D as Zo,N as Ko}from"./renderState-Dap0WV9P-D4IHxyei.js";import{U as Qo}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as bt,u as et}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{H as rr,i as xi,c as _i}from"./mat4-DX7gBViE-DVqdGrVU.js";import{t as fr,u as Fr}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{i as ea,v as ta}from"./orientedBoundingBox-oHezdpWm-BCiifXla.js";import{L as Ti,X as Br,J as ra,p as ia,j as oa,l as zr}from"./BufferView-PQoE3GL7-Duht5lAO.js";import{o as Ht,e as aa}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{l as na,r as sa}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{y as oe}from"./vec42-D8CJyqHG-DnfLTeQH.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import{o as Ut,l as la}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as Pe}from"./vec2-tHZ6OaOy-xCj1obDt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";function Wl(e,t=!1){return e<=di?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function ca(e){e.vertex.code.add(s` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./HUDMaterial.glsl-BLhEaLk5-DktRuv0T.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./QueryEngine-CH5uUhZK-DRGPyg2C.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./LRUCache-C3erQTWv-grHgYSP-.js","./WhereClause-DxwoyBMS-Cwdb_WC4.js","./TimeOnly-DSMefxKy-BHvJbNji.js","./UnknownTimeZone-C--TOcPG-9of9030I.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./timeSupport-jPViR5jn-7bshRI7L.js","./queryUtils-Brxu6254-CDiE0zms.js","./json-BI97KiBB-Ce5cWfI2.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./quantizationUtils-bJy1cRwp-DFYZs_ns.js","./utils-HtkT8Fn3-Dd_0rdy5.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./heatmapUtils-seiMkkkR-CrSLbaQx.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-DyydRFHu-1ITtOELE.js","./Basemap-BEqqSTw9-yGsB1EL7.js","./loadAll-e978YItg-4pMG3qU7.js","./PortalItem-CctGdnxF-CfFOGshS.js","./writeUtils-D5qlLkwk-enZap9KW.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-6clJxb1Q.js","./utils-tNxq3jkf-nfQcZo7O.js","./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js","./FieldsIndex-HmzMbJQG-Du7S47uJ.js","./Scheduler-B7UX7Wr5-DriQgzLZ.js","./signal-CETehA7D-DQA5V72u.js","./Query-BrwMGK8U-BPr0_G9t.js","./Field-C6hA1tZj-CkWoRbmp.js","./ReactiveMap-CFk6jPfN-CSefy1PZ.js","./PooledRBush-DbfAmeLn-CPHfm9op.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./query-DFW9-NG_-C3TyGmiM.js","./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js","./pbf-D-y3_eZO-CpHdkhuD.js","./queryZScale-BiYV6Pr6-B7zp5L1G.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./Indices-DEr2HrWx-cFTwC5-9.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./glUtil-n1JOrdV3-CRAZdee5.js","./enums-DBi1-Mm2-CUS1pvQe.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./VertexAttribute-DqD5S0a2-3q90nikV.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./NestedMap-Ddo7BfvO-BpVPk8mz.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./Util-BjGjeg6f-08Szkf4F.js","./vec32-D9GsKZ1t-BPSFE14A.js","./InterleavedLayout-DXzw3B2n-BlOPeZMB.js","./BufferView-PQoE3GL7-B9DLdqO9.js","./types-ChhhI6OU-Cxh6dPlX.js","./Octree-CJNwbhg4-DECX_J2V.js","./sphere-BenPORjV-B4uz1SYF.js","./mat3-CC4Foazl-BWjyqE2v.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./plane-Dt8R0KeE-Bqc6oVGz.js","./quatf64-C16JxGFv-BKWK1F8U.js","./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js","./BufferObject-BM_7mcDb-EYaqMhmk.js","./Texture-BCt2hphT-Dk2JyWCy.js","./boundedPlane-DlvE0eNx-BQ9Xop25.js","./lineSegment-CcqvCARM-CDEWcAzV.js","./VertexArrayObject-M4iRGGoi-BvRnjYBj.js","./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js","./floatRGBA-4pIJN00G-Cz2BV8ih.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./renderState-Dap0WV9P-D4IHxyei.js","./projectVectorToVector-sIYLNlex-DexDhaq1.js","./projectPointToVector-B2UUY9SE-BIKNGLey.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js","./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js","./vec3f32-BS0cezmI-B_madU1n.js","./orientedBoundingBox-oHezdpWm-ilptOsP0.js","./quat-BODLR7mS-BQk2dgMZ.js","./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js","./triangle-hqU-Tc1X-CaBFJROi.js","./BindType-9iOk18Ed-CRW1cdX4.js","./requestImageUtils-Ut4YcoNU-CZnNufeN.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js"])))=>i.map(i=>d[i]); +import{_ as _t}from"./main-QGPoLsvl.js";import{v as m,S as z,i as ur,gU as go,c$ as si,j as li,dg as I,ah as ci,aL as xo,o as Te,aN as St,hT as Rt,d2 as di,h_ as Ke,i0 as ut,hZ as It,K as _o,hB as To,bl as bo,ae as hr,U as Oe,t as Eo,I as So,cO as Ir,cw as Ao,hU as rt,hY as it,$ as Lr,iy as Co,E as wo,aS as Mo,iz as Oo,iA as yo,hq as ui,i8 as Ro,hc as Io,hV as Lo,a1 as hi,al as No,bw as Po}from"./story-Doly9N9p.js";import{r as Do}from"./requestImageUtils-Ut4YcoNU-CZnNufeN.js";import{i as ve,N as ge,e as Tt,s as Ft,O as Qt,t as er,D as Ve}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{A as At,L as de,D as ae,G as ht,U as Ie,s as Fo,R as Bo,T as zo,f as Go,M as Je,X as ye,t as pe}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as mi,V as ke,F as Vo,X as Ho}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{h as W}from"./Util-BjGjeg6f-08Szkf4F.js";import{b as xe,_ as Y,N as He,R as fi,Y as mt,j as Uo,r as nt,A as yt,l as mr,L as Nr,y as Wo,Z as jo,k as Ye,S as pi,X as Pr,p as $o}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{l as tr}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{R as qo}from"./InterleavedLayout-DXzw3B2n-BlOPeZMB.js";import{o as F,t as Q,c as ft,S as Bt,i as fe,h as vi,g as Dr,p as kt,f as ko}from"./NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js";import{t as zt}from"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import{e as s,c as y,i as Qe}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{a as R}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{o as be}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./boundedPlane-DlvE0eNx-BQ9Xop25.js";import{b as gi,F as _e}from"./sphere-BenPORjV-B4uz1SYF.js";import{f as Yo,K as Gt,B as Xo,m as Vt,y as Jo,D as Zo,N as Ko}from"./renderState-Dap0WV9P-D4IHxyei.js";import{U as Qo}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as bt,u as et}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{H as rr,i as xi,c as _i}from"./mat4-DX7gBViE-6clJxb1Q.js";import{t as fr,u as Fr}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{i as ea,v as ta}from"./orientedBoundingBox-oHezdpWm-ilptOsP0.js";import{L as Ti,X as Br,J as ra,p as ia,j as oa,l as zr}from"./BufferView-PQoE3GL7-B9DLdqO9.js";import{o as Ht,e as aa}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{l as na,r as sa}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{y as oe}from"./vec42-D8CJyqHG-DnfLTeQH.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import{o as Ut,l as la}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as Pe}from"./vec2-tHZ6OaOy-xCj1obDt.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";function Wl(e,t=!1){return e<=di?t?new Array(e).fill(0):new Array(e):new Float32Array(e)}function ca(e){e.vertex.code.add(s` vec4 decodeSymbolColor(vec4 symbolColor, out int colorMixMode) { float symbolAlpha = 0.0; @@ -491,7 +491,7 @@ precision highp sampler2D;`,Jt=4;function xn(){const e=new jt,t=e.fragment;e.inc vec2 uvOffset = uv + rf * blurSize; blurFunction(uvOffset, rf, center_d, sharpness, w_total, b); } - fragBlur = b / w_total;`),e}const _n=Object.freeze(Object.defineProperty({__proto__:null,build:xn},Symbol.toStringTag,{value:"Module"}));let Zr=class extends vr{constructor(e,t,r){super(e,t,new Wt(_n,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-CpaRLlUD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(i=>i.S)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const Tn="eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM";let bn=class extends Qe{constructor(){super(...arguments),this.projScale=1}},En=class extends bn{constructor(){super(...arguments),this.intensity=1}},Sn=class extends Qe{},An=class extends Sn{constructor(){super(...arguments),this.blurSize=Ut()}};function Cn(e){e.fragment.uniforms.add(new te("projInfo",(t,r)=>wn(r.camera))),e.fragment.uniforms.add(new Ze("zScale",(t,r)=>Mn(r.camera))),e.fragment.code.add(s`vec3 reconstructPosition(vec2 fragCoord, float depth) { + fragBlur = b / w_total;`),e}const _n=Object.freeze(Object.defineProperty({__proto__:null,build:xn},Symbol.toStringTag,{value:"Module"}));let Zr=class extends vr{constructor(e,t,r){super(e,t,new Wt(_n,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-DktRuv0T.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(i=>i.S)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const Tn="eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM";let bn=class extends Qe{constructor(){super(...arguments),this.projScale=1}},En=class extends bn{constructor(){super(...arguments),this.intensity=1}},Sn=class extends Qe{},An=class extends Sn{constructor(){super(...arguments),this.blurSize=Ut()}};function Cn(e){e.fragment.uniforms.add(new te("projInfo",(t,r)=>wn(r.camera))),e.fragment.uniforms.add(new Ze("zScale",(t,r)=>Mn(r.camera))),e.fragment.code.add(s`vec3 reconstructPosition(vec2 fragCoord, float depth) { return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth); }`)}function wn(e){const t=e.projectionMatrix;return t[11]===0?oe(Kr,2/(e.fullWidth*t[0]),2/(e.fullHeight*t[5]),(1+t[12])/t[0],(1+t[13])/t[5]):oe(Kr,-2/(e.fullWidth*t[0]),-2/(e.fullHeight*t[5]),(1-t[8])/t[0],(1-t[9])/t[5])}const Kr=Ht();function Mn(e){return e.projectionMatrix[11]===0?Pe(Qr,0,1):Pe(Qr,1,0)}const Qr=Ut(),ei=16;function On(){const e=new jt,t=e.fragment;return e.include(qi),e.include(Cn),t.include(_r),t.uniforms.add(new ie("radius",(r,i)=>Tr(i.camera))).code.add(s`vec3 sphere[16] = vec3[16]( vec3(0.186937, 0.0, 0.0), @@ -573,7 +573,7 @@ return fallOffFunction(vv, vn, 0.1); // Anti-tone map to reduce contrast and drag dark region farther: (x^0.2 + 1.2 * x^4) / 2.2 A = (pow(A, 0.2) + 1.2 * A * A * A * A) / 2.2; - fragOcclusion = A;`),e}function Tr(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const ti=Ut(),yn=Object.freeze(Object.defineProperty({__proto__:null,build:On,getRadius:Tr},Symbol.toStringTag,{value:"Module"}));let ri=class extends vr{constructor(e,t,r){super(e,t,new Wt(yn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-CpaRLlUD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(i=>i.a)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const ot=2;let ze=class extends on{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=ct.SSAO,this.isEnabled=()=>!1,this._enableTime=St(0),this._passParameters=new En,this._drawParameters=new An}initialize(){const e=Uint8Array.from(atob(Tn),r=>r.charCodeAt(0)),t=new mi;t.wrapMode=ht.CLAMP_TO_EDGE,t.pixelFormat=Ie.RGB,t.wrapMode=ht.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new ke(this.renderingContext,t,e),this.techniques.precompile(ri),this.techniques.precompile(Zr),this.addHandles(ci(()=>this.isEnabled(),()=>this._enableTime=St(0)))}destroy(){this._passParameters.noiseTexture=Rt(this._passParameters.noiseTexture)}render(e){const t=this.bindParameters,r=e.find(({name:w})=>w==="normals"),i=r?.getTexture(),o=r?.getTexture(Fo),a=this.fboCache,n=t.camera,l=n.fullViewport[2],c=n.fullViewport[3],u=Math.round(l/ot),d=Math.round(c/ot),h=this.techniques.acquire(ri),v=this.techniques.acquire(Zr);if(!h.compiled||!v.compiled)return this._enableTime=St(performance.now()),this.requestRender(Qt.UPDATE),h.release(),v.release(),a.acquire(u,d,ct.SSAO,qe.RED);this._enableTime===0&&(this._enableTime=St(performance.now()));const f=this.renderingContext,T=this.view.qualitySettings.fadeDuration,_=n.relativeElevation,x=hr((Xr-_)/(Xr-an),0,1),V=T>0?Math.min(T,performance.now()-this._enableTime)/T:1,D=V*x;this._passParameters.normalTexture=i,this._passParameters.depthTexture=o,this._passParameters.projScale=1/n.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Rn/Tr(n)**6*D;const B=a.acquire(l,c,"ssao input",qe.RG);f.bindFramebuffer(B.fbo),f.setViewport(0,0,l,c),f.bindTechnique(h,t,this._passParameters,this._drawParameters),f.screen.draw(),h.release();const P=a.acquire(u,d,"ssao blur",qe.RED);f.bindFramebuffer(P.fbo),this._drawParameters.colorTexture=B.getTexture(),Pe(this._drawParameters.blurSize,0,ot/c),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),B.release();const G=a.acquire(u,d,ct.SSAO,qe.RED);return f.bindFramebuffer(G.fbo),f.setViewport(0,0,l,c),f.setClearColor(1,1,1,0),f.clear(Bo.COLOR),this._drawParameters.colorTexture=P.getTexture(),Pe(this._drawParameters.blurSize,ot/l,0),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),v.release(),f.setViewport4fv(n.fullViewport),P.release(),V<1&&this.requestRender(Qt.UPDATE),G}};m([z()],ze.prototype,"consumes",void 0),m([z()],ze.prototype,"produces",void 0),m([z({constructOnly:!0})],ze.prototype,"techniques",void 0),m([z({constructOnly:!0})],ze.prototype,"isEnabled",void 0),ze=m([ur("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ze);const Rn=.5;function br(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new X("ssaoTex",(i,o)=>o.ssao?.getTexture())),r.constants.add("blurSizePixelsInverse","float",1/ot),r.code.add(s`float evaluateAmbientOcclusionInverse() { + fragOcclusion = A;`),e}function Tr(e){return Math.max(10,20*e.computeScreenPixelSizeAtDist(Math.abs(4*e.relativeElevation)))}const ti=Ut(),yn=Object.freeze(Object.defineProperty({__proto__:null,build:On,getRadius:Tr},Symbol.toStringTag,{value:"Module"}));let ri=class extends vr{constructor(e,t,r){super(e,t,new Wt(yn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-DktRuv0T.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(i=>i.a)),r)}initializePipeline(){return Gt({colorWrite:Vt})}};const ot=2;let ze=class extends on{constructor(e){super(e),this.consumes={required:["normals"]},this.produces=ct.SSAO,this.isEnabled=()=>!1,this._enableTime=St(0),this._passParameters=new En,this._drawParameters=new An}initialize(){const e=Uint8Array.from(atob(Tn),r=>r.charCodeAt(0)),t=new mi;t.wrapMode=ht.CLAMP_TO_EDGE,t.pixelFormat=Ie.RGB,t.wrapMode=ht.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new ke(this.renderingContext,t,e),this.techniques.precompile(ri),this.techniques.precompile(Zr),this.addHandles(ci(()=>this.isEnabled(),()=>this._enableTime=St(0)))}destroy(){this._passParameters.noiseTexture=Rt(this._passParameters.noiseTexture)}render(e){const t=this.bindParameters,r=e.find(({name:w})=>w==="normals"),i=r?.getTexture(),o=r?.getTexture(Fo),a=this.fboCache,n=t.camera,l=n.fullViewport[2],c=n.fullViewport[3],u=Math.round(l/ot),d=Math.round(c/ot),h=this.techniques.acquire(ri),v=this.techniques.acquire(Zr);if(!h.compiled||!v.compiled)return this._enableTime=St(performance.now()),this.requestRender(Qt.UPDATE),h.release(),v.release(),a.acquire(u,d,ct.SSAO,qe.RED);this._enableTime===0&&(this._enableTime=St(performance.now()));const f=this.renderingContext,T=this.view.qualitySettings.fadeDuration,_=n.relativeElevation,x=hr((Xr-_)/(Xr-an),0,1),V=T>0?Math.min(T,performance.now()-this._enableTime)/T:1,D=V*x;this._passParameters.normalTexture=i,this._passParameters.depthTexture=o,this._passParameters.projScale=1/n.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*Rn/Tr(n)**6*D;const B=a.acquire(l,c,"ssao input",qe.RG);f.bindFramebuffer(B.fbo),f.setViewport(0,0,l,c),f.bindTechnique(h,t,this._passParameters,this._drawParameters),f.screen.draw(),h.release();const P=a.acquire(u,d,"ssao blur",qe.RED);f.bindFramebuffer(P.fbo),this._drawParameters.colorTexture=B.getTexture(),Pe(this._drawParameters.blurSize,0,ot/c),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),B.release();const G=a.acquire(u,d,ct.SSAO,qe.RED);return f.bindFramebuffer(G.fbo),f.setViewport(0,0,l,c),f.setClearColor(1,1,1,0),f.clear(Bo.COLOR),this._drawParameters.colorTexture=P.getTexture(),Pe(this._drawParameters.blurSize,ot/l,0),f.bindTechnique(v,t,this._passParameters,this._drawParameters),f.setViewport(0,0,u,d),f.screen.draw(),v.release(),f.setViewport4fv(n.fullViewport),P.release(),V<1&&this.requestRender(Qt.UPDATE),G}};m([z()],ze.prototype,"consumes",void 0),m([z()],ze.prototype,"produces",void 0),m([z({constructOnly:!0})],ze.prototype,"techniques",void 0),m([z({constructOnly:!0})],ze.prototype,"isEnabled",void 0),ze=m([ur("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ze);const Rn=.5;function br(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new X("ssaoTex",(i,o)=>o.ssao?.getTexture())),r.constants.add("blurSizePixelsInverse","float",1/ot),r.code.add(s`float evaluateAmbientOcclusionInverse() { vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0)); return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r; } @@ -1010,7 +1010,7 @@ return max(c.x, max(c.y, c.z)); vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, shadingParams.viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:s`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} vec4 finalColor = vec4(shadedColor, opacity_); outputColorHighlightOID(finalColor, vpos); - `),t}const Xn=Object.freeze(Object.defineProperty({__proto__:null,build:Yn},Symbol.toStringTag,{value:"Module"}));let Jn=class extends fa{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Fa,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=Tt.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=Ke,this.instancedDoublePrecision=!1,this.normalType=Q.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=ut(.2,.2,.2),this.diffuse=ut(.8,.8,.8),this.externalColor=aa(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.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=Ft.Less,this.textureAlphaMode=ge.Blend,this.textureAlphaCutoff=be,this.textureAlphaPremultiplied=!1,this.renderOccluded=ir.Occlude,this.isDecoration=!1}},ec=class extends pa{constructor(){super(...arguments),this.origin=I(),this.slicePlaneLocalOrigin=this.origin}},oo=class extends vr{constructor(e,t,r,i=new Wt(Xn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-CpaRLlUD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(o=>o.D))){super(e,t,i,r),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:o,cullFace:a,customDepthTest:n,hasOccludees:l,enableOffset:c}=e,u=r===k.NONE,d=r===k.FrontFace;return Gt({blending:ft(i)&&o?wa(r):null,culling:Kn(e)?Jo(a):null,depthTest:{func:Ia(r,Zn(n))},depthWrite:Ma(e),drawBuffers:i===F.Depth?{buffers:[Go.NONE]}:La(r,i),colorWrite:Vt,stencilWrite:l?Na:null,stencilTest:l?t?Da:Pa:null,polygonOffset:u||d?null:Ra(c)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};function Zn(e){return e===Ft.Lequal?de.LEQUAL:de.LESS}function Kn(e){return e.cullFace!==Tt.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Qn(){return oi??=(async()=>{const e=await _t(()=>import("./basis_transcoder-BQKD9Nty-CAkTxthP.js"),[],import.meta.url),t=await e.default({locateFile:r=>Po(`esri/libs/basisu/${r}`)});return t.initializeBasis(),t})(),oi}let oi;var Le;(function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"})(Le||(Le={}));let ce=null,wt=null;async function ao(){return wt==null&&(wt=Qn(),ce=await wt),wt}function es(e,t){if(ce==null)return e.byteLength;const r=new ce.BasisFile(new Uint8Array(e)),i=so(r)?no(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function ts(e,t){if(ce==null)return e.byteLength;const r=new ce.KTX2File(new Uint8Array(e)),i=lo(r)?no(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function no(e,t,r,i,o){const a=Ho(t?pe.COMPRESSED_RGBA8_ETC2_EAC:pe.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function so(e){return e.getNumImages()>=1&&!e.isUASTC()}function lo(e){return e.getFaces()>=1&&e.isETC1S()}async function rs(e,t,r){ce==null&&(ce=await ao());const i=new ce.BasisFile(new Uint8Array(r));if(!so(i))return null;i.startTranscoding();const o=co(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(a,n)=>i.getImageTranscodedSizeInBytes(0,a,n),(a,n,l)=>i.transcodeImage(l,0,a,n,0,0));return i.close(),i.delete(),o}async function is(e,t,r){ce==null&&(ce=await ao());const i=new ce.KTX2File(new Uint8Array(r));if(!lo(i))return null;i.startTranscoding();const o=co(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(a,n)=>i.getImageTranscodedSizeInBytes(a,0,0,n),(a,n,l)=>i.transcodeImage(l,a,0,0,n,0,-1,-1));return i.close(),i.delete(),o}function co(e,t,r,i,o,a,n,l){const{compressedTextureETC:c,compressedTextureS3TC:u}=e.capabilities,[d,h]=c?i?[Le.ETC2_RGBA,pe.COMPRESSED_RGBA8_ETC2_EAC]:[Le.ETC1_RGB,pe.COMPRESSED_RGB8_ETC2]:u?i?[Le.BC3_RGBA,pe.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[Le.BC1_RGB,pe.COMPRESSED_RGB_S3TC_DXT1_EXT]:[Le.RGBA32,Ie.RGBA],v=t.hasMipmap?r:Math.min(1,r),f=[];for(let T=0;T1,t.samplingMode=t.hasMipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.width=o,t.height=a,new ke(e,t,{type:"compressed",levels:f})}const Mt=()=>hi.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),os=542327876,as=131072,ns=4;function Cr(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function ss(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}const ls=Cr("DXT1"),cs=Cr("DXT3"),ds=Cr("DXT5"),us=31,hs=0,ms=1,fs=2,ps=3,vs=4,gs=7,xs=20,_s=21;function Ts(e,t,r){const i=bs(r,t.hasMipmap??!1);if(i==null)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:l}=i;return t.samplingMode=o.levels.length>1?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=l,new ke(e,t,o)}function bs(e,t){const r=new Int32Array(e.buffer,e.byteOffset,us);if(r[hs]!==os)return Mt().error("Invalid magic number in DDS header"),null;if(!(r[xs]&ns))return Mt().error("Unsupported format, must contain a FourCC code"),null;const i=r[_s];let o,a;switch(i){case ls:o=8,a=pe.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case cs:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case ds:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Mt().error("Unsupported FourCC code:",ss(i)),null}let n=1,l=r[vs],c=r[ps];(3&l||3&c)&&(Mt().warn("Rounding up compressed texture size to nearest multiple of 4."),l=l+3&-4,c=c+3&-4);const u=l,d=c;let h,v;r[fs]&as&&t!==!1&&(n=Math.max(1,r[gs]));let f=e.byteOffset+r[ms]+4;const T=[];for(let _=0;_>2)*(c+3>>2)*o,h=new Uint8Array(e.buffer,f,v),T.push(h),f+=v,l=Math.max(1,l>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:T},internalFormat:a,width:u,height:d}}function Es(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?uo(e):e;let i=e.width,o=e.height;do i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o;while(r>1048576||t!=null&&(i>t||o>t));return wr(e,i,o)}function Ss(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return wr(e,Math.round(e.width*i),Math.round(e.height*i))}function wr(e,t,r){if(e instanceof ImageData)return wr(uo(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function uo(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(r==null)throw new Te("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}let tc=class extends Ci{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=vt.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new So,this._parameters={...Cs,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){e!=null&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!(Ir(e.src)||e.preload==="auto"&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const r=()=>{e.removeEventListener("canplay",r),e.play()};e.addEventListener("canplay",r)}}}_startPreloadImageElement(e){Ao(e.src)||Ir(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new mi;return t.wrapMode=this._parameters.wrap??ht.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||As(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return t==null?(this._glTexture=new ke(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),typeof t=="string"?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):rt(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,t):it(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):(it(t)||rt(t))&&this._parameters.encoding===Ve.KTX2_ENCODING?this._loadFromKTX2(e,t):(it(t)||rt(t))&&this._parameters.encoding===Ve.BASIS_ENCODING?this._loadFromBasis(e,t):rt(t)?this._loadFromPixelData(e,t):it(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return this._glTexture==null||e.readyStateis(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromBasis(e,t){return this._loadAsync(()=>rs(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromPixelData(e,t){W(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=this._parameters.components===1?Ie.LUMINANCE:this._parameters.components===3?Ie.RGB:Ie.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new ke(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await Do(t,{signal:r});return Lr(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await Co(t,t.src,!1,r);return Lr(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=dt.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",l),No(c)},n=()=>{t.readyState>=dt.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},l=u=>{a(),o(u||new Te("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",l);const c=wo(r,()=>l(Mo()))}))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:a}=e.parameters;r=this._parameters.downsampleUncompressed?Es(r,a):Ss(r,a)}const i=ho(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=this._parameters.components===3?Ie.RGB:Ie.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new ke(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=Rt(this._glTexture),this._loadingController!=null){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}};function As(e,t){if(e==null)return 0;if(it(e)||rt(e))return t.encoding===Ve.KTX2_ENCODING?ts(e,!!t.mipmap):t.encoding===Ve.BASIS_ENCODING?es(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?ho(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}function ho(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}var dt;(function(e){e[e.HAVE_NOTHING=0]="HAVE_NOTHING",e[e.HAVE_METADATA=1]="HAVE_METADATA",e[e.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",e[e.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",e[e.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(dt||(dt={}));const Cs={wrap:{s:ht.REPEAT,t:ht.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};class ws{constructor(t=!1,r=!0){this.isVerticalRay=t,this.normalRequired=r}}const Ot=go();function Ms(e,t,r,i,o,a){if(!e.visible)return;const n=Ye(Hs,i,r),l=(u,d,h)=>{a(u,h,d,!1)},c=new ws(!1,t.options.normalRequired);if(e.boundingInfo){W(e.type===vt.Mesh);const u=t.tolerance;mo(e.boundingInfo,r,n,u,o,c,l)}else{const u=e.attributes.get(p.POSITION),d=u.indices;Rs(r,n,0,d.length/3,d,u.data,u.stride,o,c,l)}}const Os=I();function mo(e,t,r,i,o,a,n){if(e==null)return;const l=Fs(r,Os);if(Oo(Ot,e.bbMin),yo(Ot,e.bbMax),o?.applyToAabb(Ot),Bs(Ot,t,l,i)){const{primitiveIndices:c,position:u}=e,d=c?c.length:u.indices.length/3;if(d>Gs){const h=e.getChildren();if(h!==void 0){for(const v of h)mo(v,t,r,i,o,a,n);return}}ys(t,r,0,d,u.indices,u.data,u.stride,c,o,a,n)}}const at=I();function ys(e,t,r,i,o,a,n,l,c,u,d){const h=e[0],v=e[1],f=e[2],T=t[0],_=t[1],x=t[2],{normalRequired:V}=u;for(let D=r;D0){if(Be<0||Be>ne)continue}else if(Be>0||Be0){if(Et<0||Be+Et>ne)continue}else if(Et>0||Be+Et=0&&d(Rr,B,V?Ps(ee,Ee,Se,Ae,Ce,he,at):null)}}function Rs(e,t,r,i,o,a,n,l,c,u){const d=t,h=Us,v=Math.abs(d[0]),f=Math.abs(d[1]),T=Math.abs(d[2]),_=v>=f?v>=T?0:2:f>=T?1:2,x=_,V=d[x]<0?2:1,D=(_+V)%3,B=(_+(3-V))%3,P=d[D]/d[x],G=d[B]/d[x],w=1/d[x],S=Is,E=Ls,M=Ns,{normalRequired:O}=c;for(let g=r;g0||we>0||Me>0))continue;const De=he+we+Me;if(De===0)continue;const ne=he*(w*S[x])+we*(w*E[x])+Me*(w*M[x]);if(ne*Math.sign(De)<0)continue;const Fe=ne/De;Fe>=0&&u(Fe,g,O?Ds(h):null)}}const Is=I(),Ls=I(),Ns=I();function Ps(e,t,r,i,o,a,n){return Y(Pt,e,t,r),Y(Dt,i,o,a),pi(n,Pt,Dt),mr(n,n),n}function Ds(e){return Ye(Pt,e[1],e[0]),Ye(Dt,e[2],e[0]),pi(at,Pt,Dt),mr(at,at),at}const Pt=I(),Dt=I();function Fs(e,t){return Y(t,1/e[0],1/e[1],1/e[2])}function Bs(e,t,r,i){return zs(e,t,r,i,1/0)}function zs(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let l=Math.min(a,n),c=Math.max(a,n);const u=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(c=Math.min(c,Math.max(u,d)),c<0||(l=Math.max(l,Math.min(u,d)),l>c))return!1;const h=(e[2]-i-t[2])*r[2],v=(e[5]+i-t[2])*r[2];return c=Math.min(c,Math.max(h,v)),!(c<0)&&(l=Math.max(l,Math.min(h,v)),!(l>c)&&l{w=a[O]+B,S=a[O+1]+P,E=a[O+2]+G}:O=>{const g=a[O],L=a[O+1],C=a[O+2];w=d*g+f*L+x*C+B,S=h*g+T*L+V*C+P,E=v*g+_*L+D*C+G};if(o===1)for(let O=0;O{S=a[g],E=a[g+1],M=a[g+2]}:g=>{const L=a[g],C=a[g+1],H=a[g+2];S=h*L+T*C+V*H,E=v*L+_*C+D*H,M=f*L+x*C+B*H};if(o===1)if(P)for(let g=0;gG){const C=1/Math.sqrt(L);c[i]=S*C,c[i+1]=E*C,c[i+2]=M*C}else c[i]=S,c[i+1]=E,c[i+2]=M;i+=u}else for(let g=0;gG){const C=1/Math.sqrt(L);S*=C,E*=C,M*=C}}for(let L=0;LG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}c[i]=C,c[i+1]=H,c[i+2]=$,c[i+3]=L,i+=u}else for(let S=0;SG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}for(let Z=0;Z0)??[],this._parameterNames??=[]}get key(){return this._key??=new Ks(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map(i=>` ${i}: ${this[i]}`).join(` + `),t}const Xn=Object.freeze(Object.defineProperty({__proto__:null,build:Yn},Symbol.toStringTag,{value:"Module"}));let Jn=class extends fa{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Fa,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=Tt.Back,this.isInstanced=!1,this.hasInstancedColor=!1,this.emissiveFactor=Ke,this.instancedDoublePrecision=!1,this.normalType=Q.Attribute,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=ut(.2,.2,.2),this.diffuse=ut(.8,.8,.8),this.externalColor=aa(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.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.transparent=!1,this.writeDepth=!0,this.customDepthTest=Ft.Less,this.textureAlphaMode=ge.Blend,this.textureAlphaCutoff=be,this.textureAlphaPremultiplied=!1,this.renderOccluded=ir.Occlude,this.isDecoration=!1}},ec=class extends pa{constructor(){super(...arguments),this.origin=I(),this.slicePlaneLocalOrigin=this.origin}},oo=class extends vr{constructor(e,t,r,i=new Wt(Xn,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-DktRuv0T.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(o=>o.D))){super(e,t,i,r),this.type="DefaultMaterialTechnique"}_makePipeline(e,t){const{oitPass:r,output:i,transparent:o,cullFace:a,customDepthTest:n,hasOccludees:l,enableOffset:c}=e,u=r===k.NONE,d=r===k.FrontFace;return Gt({blending:ft(i)&&o?wa(r):null,culling:Kn(e)?Jo(a):null,depthTest:{func:Ia(r,Zn(n))},depthWrite:Ma(e),drawBuffers:i===F.Depth?{buffers:[Go.NONE]}:La(r,i),colorWrite:Vt,stencilWrite:l?Na:null,stencilTest:l?t?Da:Pa:null,polygonOffset:u||d?null:Ra(c)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e){return e?this._occludeePipelineState:super.getPipeline()}};function Zn(e){return e===Ft.Lequal?de.LEQUAL:de.LESS}function Kn(e){return e.cullFace!==Tt.None||!e.hasSlicePlane&&!e.transparent&&!e.doubleSidedMode}function Qn(){return oi??=(async()=>{const e=await _t(()=>import("./basis_transcoder-BQKD9Nty-CAkTxthP.js"),[],import.meta.url),t=await e.default({locateFile:r=>Po(`esri/libs/basisu/${r}`)});return t.initializeBasis(),t})(),oi}let oi;var Le;(function(e){e[e.ETC1_RGB=0]="ETC1_RGB",e[e.ETC2_RGBA=1]="ETC2_RGBA",e[e.BC1_RGB=2]="BC1_RGB",e[e.BC3_RGBA=3]="BC3_RGBA",e[e.BC4_R=4]="BC4_R",e[e.BC5_RG=5]="BC5_RG",e[e.BC7_M6_RGB=6]="BC7_M6_RGB",e[e.BC7_M5_RGBA=7]="BC7_M5_RGBA",e[e.PVRTC1_4_RGB=8]="PVRTC1_4_RGB",e[e.PVRTC1_4_RGBA=9]="PVRTC1_4_RGBA",e[e.ASTC_4x4_RGBA=10]="ASTC_4x4_RGBA",e[e.ATC_RGB=11]="ATC_RGB",e[e.ATC_RGBA=12]="ATC_RGBA",e[e.FXT1_RGB=17]="FXT1_RGB",e[e.PVRTC2_4_RGB=18]="PVRTC2_4_RGB",e[e.PVRTC2_4_RGBA=19]="PVRTC2_4_RGBA",e[e.ETC2_EAC_R11=20]="ETC2_EAC_R11",e[e.ETC2_EAC_RG11=21]="ETC2_EAC_RG11",e[e.RGBA32=13]="RGBA32",e[e.RGB565=14]="RGB565",e[e.BGR565=15]="BGR565",e[e.RGBA4444=16]="RGBA4444"})(Le||(Le={}));let ce=null,wt=null;async function ao(){return wt==null&&(wt=Qn(),ce=await wt),wt}function es(e,t){if(ce==null)return e.byteLength;const r=new ce.BasisFile(new Uint8Array(e)),i=so(r)?no(r.getNumLevels(0),r.getHasAlpha(),r.getImageWidth(0,0),r.getImageHeight(0,0),t):0;return r.close(),r.delete(),i}function ts(e,t){if(ce==null)return e.byteLength;const r=new ce.KTX2File(new Uint8Array(e)),i=lo(r)?no(r.getLevels(),r.getHasAlpha(),r.getWidth(),r.getHeight(),t):0;return r.close(),r.delete(),i}function no(e,t,r,i,o){const a=Ho(t?pe.COMPRESSED_RGBA8_ETC2_EAC:pe.COMPRESSED_RGB8_ETC2),n=o&&e>1?(4**e-1)/(3*4**(e-1)):1;return Math.ceil(r*i*a*n)}function so(e){return e.getNumImages()>=1&&!e.isUASTC()}function lo(e){return e.getFaces()>=1&&e.isETC1S()}async function rs(e,t,r){ce==null&&(ce=await ao());const i=new ce.BasisFile(new Uint8Array(r));if(!so(i))return null;i.startTranscoding();const o=co(e,t,i.getNumLevels(0),i.getHasAlpha(),i.getImageWidth(0,0),i.getImageHeight(0,0),(a,n)=>i.getImageTranscodedSizeInBytes(0,a,n),(a,n,l)=>i.transcodeImage(l,0,a,n,0,0));return i.close(),i.delete(),o}async function is(e,t,r){ce==null&&(ce=await ao());const i=new ce.KTX2File(new Uint8Array(r));if(!lo(i))return null;i.startTranscoding();const o=co(e,t,i.getLevels(),i.getHasAlpha(),i.getWidth(),i.getHeight(),(a,n)=>i.getImageTranscodedSizeInBytes(a,0,0,n),(a,n,l)=>i.transcodeImage(l,a,0,0,n,0,-1,-1));return i.close(),i.delete(),o}function co(e,t,r,i,o,a,n,l){const{compressedTextureETC:c,compressedTextureS3TC:u}=e.capabilities,[d,h]=c?i?[Le.ETC2_RGBA,pe.COMPRESSED_RGBA8_ETC2_EAC]:[Le.ETC1_RGB,pe.COMPRESSED_RGB8_ETC2]:u?i?[Le.BC3_RGBA,pe.COMPRESSED_RGBA_S3TC_DXT5_EXT]:[Le.BC1_RGB,pe.COMPRESSED_RGB_S3TC_DXT1_EXT]:[Le.RGBA32,Ie.RGBA],v=t.hasMipmap?r:Math.min(1,r),f=[];for(let T=0;T1,t.samplingMode=t.hasMipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.width=o,t.height=a,new ke(e,t,{type:"compressed",levels:f})}const Mt=()=>hi.getLogger("esri.views.3d.webgl-engine.lib.DDSUtil"),os=542327876,as=131072,ns=4;function Cr(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}function ss(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}const ls=Cr("DXT1"),cs=Cr("DXT3"),ds=Cr("DXT5"),us=31,hs=0,ms=1,fs=2,ps=3,vs=4,gs=7,xs=20,_s=21;function Ts(e,t,r){const i=bs(r,t.hasMipmap??!1);if(i==null)throw new Error("DDS texture data is null");const{textureData:o,internalFormat:a,width:n,height:l}=i;return t.samplingMode=o.levels.length>1?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=o.levels.length>1,t.internalFormat=a,t.width=n,t.height=l,new ke(e,t,o)}function bs(e,t){const r=new Int32Array(e.buffer,e.byteOffset,us);if(r[hs]!==os)return Mt().error("Invalid magic number in DDS header"),null;if(!(r[xs]&ns))return Mt().error("Unsupported format, must contain a FourCC code"),null;const i=r[_s];let o,a;switch(i){case ls:o=8,a=pe.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case cs:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case ds:o=16,a=pe.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return Mt().error("Unsupported FourCC code:",ss(i)),null}let n=1,l=r[vs],c=r[ps];(3&l||3&c)&&(Mt().warn("Rounding up compressed texture size to nearest multiple of 4."),l=l+3&-4,c=c+3&-4);const u=l,d=c;let h,v;r[fs]&as&&t!==!1&&(n=Math.max(1,r[gs]));let f=e.byteOffset+r[ms]+4;const T=[];for(let _=0;_>2)*(c+3>>2)*o,h=new Uint8Array(e.buffer,f,v),T.push(h),f+=v,l=Math.max(1,l>>1),c=Math.max(1,c>>1);return{textureData:{type:"compressed",levels:T},internalFormat:a,width:u,height:d}}function Es(e,t){let r=e.width*e.height;if(r<4096)return e instanceof ImageData?uo(e):e;let i=e.width,o=e.height;do i=Math.ceil(i/2),o=Math.ceil(o/2),r=i*o;while(r>1048576||t!=null&&(i>t||o>t));return wr(e,i,o)}function Ss(e,t){const r=Math.max(e.width,e.height);if(r<=t)return e;const i=t/r;return wr(e,Math.round(e.width*i),Math.round(e.height*i))}function wr(e,t,r){if(e instanceof ImageData)return wr(uo(e),t,r);const i=document.createElement("canvas");return i.width=t,i.height=r,i.getContext("2d").drawImage(e,0,0,i.width,i.height),i}function uo(e){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const r=t.getContext("2d");if(r==null)throw new Te("Failed to create 2d context from HTMLCanvasElement");return r.putImageData(e,0,0),t}let tc=class extends Ci{get parameters(){return this._parameters}constructor(e,t){super(),this._data=e,this.type=vt.Texture,this._glTexture=null,this._loadingPromise=null,this._loadingController=null,this.events=new So,this._parameters={...Cs,...t},this._startPreload(e)}dispose(){this.unload(),this._data=this.frameUpdate=void 0}_startPreload(e){e!=null&&(e instanceof HTMLVideoElement?(this.frameUpdate=t=>this._frameUpdate(e,t),this._startPreloadVideoElement(e)):e instanceof HTMLImageElement&&this._startPreloadImageElement(e))}_startPreloadVideoElement(e){if(!(Ir(e.src)||e.preload==="auto"&&e.crossOrigin)){e.preload="auto",e.crossOrigin="anonymous";const t=!e.paused;if(e.src=e.src,t&&e.autoplay){const r=()=>{e.removeEventListener("canplay",r),e.play()};e.addEventListener("canplay",r)}}}_startPreloadImageElement(e){Ao(e.src)||Ir(e.src)||e.crossOrigin||(e.crossOrigin="anonymous",e.src=e.src)}_createDescriptor(e){const t=new mi;return t.wrapMode=this._parameters.wrap??ht.REPEAT,t.flipped=!this._parameters.noUnpackFlip,t.samplingMode=this._parameters.mipmap?Je.LINEAR_MIPMAP_LINEAR:Je.LINEAR,t.hasMipmap=!!this._parameters.mipmap,t.preMultiplyAlpha=!!this._parameters.preMultiplyAlpha,t.maxAnisotropy=this._parameters.maxAnisotropy??(this._parameters.mipmap?e.parameters.maxMaxAnisotropy:1),t}get glTexture(){return this._glTexture}get memoryEstimate(){return this._glTexture?.usedMemory||As(this._data,this._parameters)}load(e){if(this._glTexture)return this._glTexture;if(this._loadingPromise)return this._loadingPromise;const t=this._data;return t==null?(this._glTexture=new ke(e,this._createDescriptor(e),null),this._glTexture):(this._parameters.reloadable||(this._data=void 0),typeof t=="string"?this._loadFromURL(e,t):t instanceof Image?this._loadFromImageElement(e,t):t instanceof HTMLVideoElement?this._loadFromVideoElement(e,t):t instanceof ImageData||t instanceof HTMLCanvasElement?this._loadFromImage(e,t):rt(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,t):it(t)&&this._parameters.encoding===Ve.DDS_ENCODING?this._loadFromDDSData(e,new Uint8Array(t)):(it(t)||rt(t))&&this._parameters.encoding===Ve.KTX2_ENCODING?this._loadFromKTX2(e,t):(it(t)||rt(t))&&this._parameters.encoding===Ve.BASIS_ENCODING?this._loadFromBasis(e,t):rt(t)?this._loadFromPixelData(e,t):it(t)?this._loadFromPixelData(e,new Uint8Array(t)):null)}_frameUpdate(e,t){return this._glTexture==null||e.readyStateis(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromBasis(e,t){return this._loadAsync(()=>rs(e,this._createDescriptor(e),t).then(r=>(this._glTexture=r,r)))}_loadFromPixelData(e,t){W(this._parameters.width>0&&this._parameters.height>0);const r=this._createDescriptor(e);return r.pixelFormat=this._parameters.components===1?Ie.LUMINANCE:this._parameters.components===3?Ie.RGB:Ie.RGBA,r.width=this._parameters.width??0,r.height=this._parameters.height??0,this._glTexture=new ke(e,r,t),this._glTexture}_loadFromURL(e,t){return this._loadAsync(async r=>{const i=await Do(t,{signal:r});return Lr(r),this._loadFromImage(e,i)})}_loadFromImageElement(e,t){return t.complete?this._loadFromImage(e,t):this._loadAsync(async r=>{const i=await Co(t,t.src,!1,r);return Lr(r),this._loadFromImage(e,i)})}_loadFromVideoElement(e,t){return t.readyState>=dt.HAVE_CURRENT_DATA?this._loadFromImage(e,t):this._loadFromVideoElementAsync(e,t)}_loadFromVideoElementAsync(e,t){return this._loadAsync(r=>new Promise((i,o)=>{const a=()=>{t.removeEventListener("loadeddata",n),t.removeEventListener("error",l),No(c)},n=()=>{t.readyState>=dt.HAVE_CURRENT_DATA&&(a(),i(this._loadFromImage(e,t)))},l=u=>{a(),o(u||new Te("Failed to load video"))};t.addEventListener("loadeddata",n),t.addEventListener("error",l);const c=wo(r,()=>l(Mo()))}))}_loadFromImage(e,t){let r=t;if(!(r instanceof HTMLVideoElement)){const{maxTextureSize:a}=e.parameters;r=this._parameters.downsampleUncompressed?Es(r,a):Ss(r,a)}const i=ho(r);this._parameters.width=i.width,this._parameters.height=i.height;const o=this._createDescriptor(e);return o.pixelFormat=this._parameters.components===3?Ie.RGB:Ie.RGBA,o.width=i.width,o.height=i.height,this._glTexture=new ke(e,o,r),this._glTexture}_loadAsync(e){const t=new AbortController;this._loadingController=t;const r=e(t.signal);this._loadingPromise=r;const i=()=>{this._loadingController===t&&(this._loadingController=null),this._loadingPromise===r&&(this._loadingPromise=null)};return r.then(i,i),r}unload(){if(this._glTexture=Rt(this._glTexture),this._loadingController!=null){const e=this._loadingController;this._loadingController=null,this._loadingPromise=null,e.abort()}this.events.emit("unloaded")}};function As(e,t){if(e==null)return 0;if(it(e)||rt(e))return t.encoding===Ve.KTX2_ENCODING?ts(e,!!t.mipmap):t.encoding===Ve.BASIS_ENCODING?es(e,!!t.mipmap):e.byteLength;const{width:r,height:i}=e instanceof Image||e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement?ho(e):t;return(t.mipmap?4/3:1)*r*i*(t.components||4)||0}function ho(e){return e instanceof HTMLVideoElement?{width:e.videoWidth,height:e.videoHeight}:e}var dt;(function(e){e[e.HAVE_NOTHING=0]="HAVE_NOTHING",e[e.HAVE_METADATA=1]="HAVE_METADATA",e[e.HAVE_CURRENT_DATA=2]="HAVE_CURRENT_DATA",e[e.HAVE_FUTURE_DATA=3]="HAVE_FUTURE_DATA",e[e.HAVE_ENOUGH_DATA=4]="HAVE_ENOUGH_DATA"})(dt||(dt={}));const Cs={wrap:{s:ht.REPEAT,t:ht.REPEAT},mipmap:!0,noUnpackFlip:!1,preMultiplyAlpha:!1,downsampleUncompressed:!1};class ws{constructor(t=!1,r=!0){this.isVerticalRay=t,this.normalRequired=r}}const Ot=go();function Ms(e,t,r,i,o,a){if(!e.visible)return;const n=Ye(Hs,i,r),l=(u,d,h)=>{a(u,h,d,!1)},c=new ws(!1,t.options.normalRequired);if(e.boundingInfo){W(e.type===vt.Mesh);const u=t.tolerance;mo(e.boundingInfo,r,n,u,o,c,l)}else{const u=e.attributes.get(p.POSITION),d=u.indices;Rs(r,n,0,d.length/3,d,u.data,u.stride,o,c,l)}}const Os=I();function mo(e,t,r,i,o,a,n){if(e==null)return;const l=Fs(r,Os);if(Oo(Ot,e.bbMin),yo(Ot,e.bbMax),o?.applyToAabb(Ot),Bs(Ot,t,l,i)){const{primitiveIndices:c,position:u}=e,d=c?c.length:u.indices.length/3;if(d>Gs){const h=e.getChildren();if(h!==void 0){for(const v of h)mo(v,t,r,i,o,a,n);return}}ys(t,r,0,d,u.indices,u.data,u.stride,c,o,a,n)}}const at=I();function ys(e,t,r,i,o,a,n,l,c,u,d){const h=e[0],v=e[1],f=e[2],T=t[0],_=t[1],x=t[2],{normalRequired:V}=u;for(let D=r;D0){if(Be<0||Be>ne)continue}else if(Be>0||Be0){if(Et<0||Be+Et>ne)continue}else if(Et>0||Be+Et=0&&d(Rr,B,V?Ps(ee,Ee,Se,Ae,Ce,he,at):null)}}function Rs(e,t,r,i,o,a,n,l,c,u){const d=t,h=Us,v=Math.abs(d[0]),f=Math.abs(d[1]),T=Math.abs(d[2]),_=v>=f?v>=T?0:2:f>=T?1:2,x=_,V=d[x]<0?2:1,D=(_+V)%3,B=(_+(3-V))%3,P=d[D]/d[x],G=d[B]/d[x],w=1/d[x],S=Is,E=Ls,M=Ns,{normalRequired:O}=c;for(let g=r;g0||we>0||Me>0))continue;const De=he+we+Me;if(De===0)continue;const ne=he*(w*S[x])+we*(w*E[x])+Me*(w*M[x]);if(ne*Math.sign(De)<0)continue;const Fe=ne/De;Fe>=0&&u(Fe,g,O?Ds(h):null)}}const Is=I(),Ls=I(),Ns=I();function Ps(e,t,r,i,o,a,n){return Y(Pt,e,t,r),Y(Dt,i,o,a),pi(n,Pt,Dt),mr(n,n),n}function Ds(e){return Ye(Pt,e[1],e[0]),Ye(Dt,e[2],e[0]),pi(at,Pt,Dt),mr(at,at),at}const Pt=I(),Dt=I();function Fs(e,t){return Y(t,1/e[0],1/e[1],1/e[2])}function Bs(e,t,r,i){return zs(e,t,r,i,1/0)}function zs(e,t,r,i,o){const a=(e[0]-i-t[0])*r[0],n=(e[3]+i-t[0])*r[0];let l=Math.min(a,n),c=Math.max(a,n);const u=(e[1]-i-t[1])*r[1],d=(e[4]+i-t[1])*r[1];if(c=Math.min(c,Math.max(u,d)),c<0||(l=Math.max(l,Math.min(u,d)),l>c))return!1;const h=(e[2]-i-t[2])*r[2],v=(e[5]+i-t[2])*r[2];return c=Math.min(c,Math.max(h,v)),!(c<0)&&(l=Math.max(l,Math.min(h,v)),!(l>c)&&l{w=a[O]+B,S=a[O+1]+P,E=a[O+2]+G}:O=>{const g=a[O],L=a[O+1],C=a[O+2];w=d*g+f*L+x*C+B,S=h*g+T*L+V*C+P,E=v*g+_*L+D*C+G};if(o===1)for(let O=0;O{S=a[g],E=a[g+1],M=a[g+2]}:g=>{const L=a[g],C=a[g+1],H=a[g+2];S=h*L+T*C+V*H,E=v*L+_*C+D*H,M=f*L+x*C+B*H};if(o===1)if(P)for(let g=0;gG){const C=1/Math.sqrt(L);c[i]=S*C,c[i+1]=E*C,c[i+2]=M*C}else c[i]=S,c[i+1]=E,c[i+2]=M;i+=u}else for(let g=0;gG){const C=1/Math.sqrt(L);S*=C,E*=C,M*=C}}for(let L=0;LG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}c[i]=C,c[i+1]=H,c[i+2]=$,c[i+3]=L,i+=u}else for(let S=0;SG){const ee=1/Math.sqrt(Z);C*=ee,H*=ee,$*=ee}}for(let Z=0;Z0)??[],this._parameterNames??=[]}get key(){return this._key??=new Ks(this._parameterBits),this._key}decode(e=this.key){const t=this._parameterBits;this._parameterBits=[...e.bits];const r=this._parameterNames.map(i=>` ${i}: ${this[i]}`).join(` `);return this._parameterBits=t,r}};function b(e={}){return(t,r)=>{t.hasOwnProperty("_parameterNames")||Object.defineProperty(t,"_parameterNames",{value:t._parameterNames?.slice()??[],configurable:!0,writable:!0}),t.hasOwnProperty("_parameterBits")||Object.defineProperty(t,"_parameterBits",{value:t._parameterBits?.slice()??[0],configurable:!0,writable:!0}),t._parameterNames.push(r);const i=e.count||2,o=Math.ceil(Math.log2(i)),a=t._parameterBits;let n=0;for(;a[n]+o>16;)n++,n>=a.length&&a.push(0);const l=a[n],c=(1<>l},set(u){if(this[r]!==u){if(this._key=null,this._parameterBits[n]=this._parameterBits[n]&~c|+u<>l)},set(u){if(this[r]!==u&&(this._key=null,this._parameterBits[n]=this._parameterBits[n]&~c|+u<v.externalColor)),o.add("vcolorExt","vec4"),r.main.add(s` forwardNormalizedVertexColor(); vcolorExt = externalColor; @@ -1065,4 +1065,4 @@ return max(c.x, max(c.y, c.z)); vec4 emission = ${u?"vec4(0.0)":"getEmissions()"}; vec3 shadedColor = evaluateSceneLightingPBR(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight, viewDirection, normalGround, mrr, emission, additionalAmbientIrradiance);`:s`vec3 shadedColor = evaluateSceneLighting(shadingNormal, albedo, shadow, 1.0 - ssao, additionalLight);`} vec4 finalColor = vec4(shadedColor, opacity_); - outputColorHighlightOID(finalColor, vpos);`)}return t.include($i,e),t}const tl=Object.freeze(Object.defineProperty({__proto__:null,build:el},Symbol.toStringTag,{value:"Module"}));class rl extends oo{constructor(t,r,i){super(t,r,i,new Wt(tl,()=>_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-CpaRLlUD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(o=>o.R))),this.type="RealisticTreeTechnique"}}class oc extends Ca{constructor(t,r){super(t,ol),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[st.OPAQUE_MATERIAL,i=>(Dr(i)||kt(i))&&!this.parameters.transparent],[st.TRANSPARENT_MATERIAL,i=>(Dr(i)||kt(i))&&this.parameters.transparent&&this.parameters.writeDepth],[st.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,i=>(ko(i)||kt(i))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=nl(this.parameters),this._configuration=new A(r.spherical,r.doublePrecisionRequiresObfuscation)}isVisibleForOutput(t){return t!==F.Shadow&&t!==F.ShadowExcludeHighlight&&t!==F.ShadowHighlight||this.parameters.castShadows}get visible(){const t=this.parameters;if(t.layerOpacity=be;if(i&&n)return l||c;const u=t.externalColor&&t.externalColor[3]>=be;return i?l?u:c:n?l||c:l?u:c}get hasEmissions(){return!!this.parameters.emissiveTextureId||!fi(this.parameters.emissiveFactor,Ke)}getConfiguration(t,r){const i=this.parameters,{treeRendering:o,doubleSided:a,doubleSidedType:n}=i;return this._configuration.output=t,this._configuration.hasNormalTexture=!o&&!!i.normalTextureId,this._configuration.hasColorTexture=!!i.textureId,this._configuration.hasVertexTangents=!o&&i.hasVertexTangents,this._configuration.instanced=i.isInstanced,this._configuration.instancedDoublePrecision=i.instancedDoublePrecision,this._configuration.vvSize=!!i.vvSize,this._configuration.hasVerticalOffset=i.verticalOffset!=null,this._configuration.hasScreenSizePerspective=i.screenSizePerspective!=null,this._configuration.hasSlicePlane=i.hasSlicePlane,this._configuration.hasSliceHighlight=i.hasSliceHighlight,this._configuration.alphaDiscardMode=i.textureAlphaMode,this._configuration.normalType=o?Q.Attribute:i.normalType,this._configuration.transparent=i.transparent,this._configuration.writeDepth=i.writeDepth,i.customDepthTest!=null&&(this._configuration.customDepthTest=i.customDepthTest),this._configuration.hasOccludees=r.hasOccludees,this._configuration.cullFace=i.hasSlicePlane?Tt.None:i.cullFace,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.hasModelTransformation=!o&&i.modelTransformation!=null,this._configuration.hasVertexColors=i.hasVertexColors,this._configuration.hasSymbolColors=i.hasSymbolColors,this._configuration.doubleSidedMode=o?re.WindingOrder:a&&n==="normal"?re.View:a&&n==="winding-order"?re.WindingOrder:re.None,this._configuration.instancedColor=i.hasInstancedColor,this._configuration.receiveShadows=i.receiveShadows&&i.receiveShadows,this._configuration.receiveAmbientOcclusion=i.receiveAmbientOcclusion&&r.ssao!=null,this._configuration.vvColor=!!i.vvColor,this._configuration.textureAlphaPremultiplied=!!i.textureAlphaPremultiplied,this._configuration.pbrMode=i.usePBR?i.isSchematic?N.Schematic:N.Normal:N.Disabled,this._configuration.hasMetallicRoughnessTexture=!o&&!!i.metallicRoughnessTextureId,this._configuration.emissionSource=o?se.None:i.emissiveTextureId!=null?se.Texture:i.usePBR?se.Value:se.None,this._configuration.hasOcclusionTexture=!o&&!!i.occlusionTextureId,this._configuration.offsetBackfaces=!(!i.transparent||!i.offsetTransparentBackfaces),this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation=1),W(i.size===3||i.size===4);const{data:o,size:a,indices:n}=i;W(n.length%this._numIndexPerPrimitive==0),W(n.length>=t.length*this._numIndexPerPrimitive);const l=t.length;let c=a*n[this._numIndexPerPrimitive*t[0]];Re.clear(),Re.push(c);const u=It(o[c],o[c+1],o[c+2]),d=Ro(u);for(let f=0;f0&&++c;if(c<2)return;const u=new Array(8);for(let d=0;d<8;++d)u[d]=o[d]>0?new Uint32Array(o[d]):void 0;for(let d=0;d<8;++d)o[d]=0;for(let d=0;d_t(()=>import("./HUDMaterial.glsl-BLhEaLk5-DktRuv0T.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98]),import.meta.url).then(o=>o.R))),this.type="RealisticTreeTechnique"}}class oc extends Ca{constructor(t,r){super(t,ol),this.materialType="default",this.supportsEdges=!0,this.produces=new Map([[st.OPAQUE_MATERIAL,i=>(Dr(i)||kt(i))&&!this.parameters.transparent],[st.TRANSPARENT_MATERIAL,i=>(Dr(i)||kt(i))&&this.parameters.transparent&&this.parameters.writeDepth],[st.TRANSPARENT_MATERIAL_WITHOUT_DEPTH,i=>(ko(i)||kt(i))&&this.parameters.transparent&&!this.parameters.writeDepth]]),this._vertexBufferLayout=nl(this.parameters),this._configuration=new A(r.spherical,r.doublePrecisionRequiresObfuscation)}isVisibleForOutput(t){return t!==F.Shadow&&t!==F.ShadowExcludeHighlight&&t!==F.ShadowHighlight||this.parameters.castShadows}get visible(){const t=this.parameters;if(t.layerOpacity=be;if(i&&n)return l||c;const u=t.externalColor&&t.externalColor[3]>=be;return i?l?u:c:n?l||c:l?u:c}get hasEmissions(){return!!this.parameters.emissiveTextureId||!fi(this.parameters.emissiveFactor,Ke)}getConfiguration(t,r){const i=this.parameters,{treeRendering:o,doubleSided:a,doubleSidedType:n}=i;return this._configuration.output=t,this._configuration.hasNormalTexture=!o&&!!i.normalTextureId,this._configuration.hasColorTexture=!!i.textureId,this._configuration.hasVertexTangents=!o&&i.hasVertexTangents,this._configuration.instanced=i.isInstanced,this._configuration.instancedDoublePrecision=i.instancedDoublePrecision,this._configuration.vvSize=!!i.vvSize,this._configuration.hasVerticalOffset=i.verticalOffset!=null,this._configuration.hasScreenSizePerspective=i.screenSizePerspective!=null,this._configuration.hasSlicePlane=i.hasSlicePlane,this._configuration.hasSliceHighlight=i.hasSliceHighlight,this._configuration.alphaDiscardMode=i.textureAlphaMode,this._configuration.normalType=o?Q.Attribute:i.normalType,this._configuration.transparent=i.transparent,this._configuration.writeDepth=i.writeDepth,i.customDepthTest!=null&&(this._configuration.customDepthTest=i.customDepthTest),this._configuration.hasOccludees=r.hasOccludees,this._configuration.cullFace=i.hasSlicePlane?Tt.None:i.cullFace,this._configuration.terrainDepthTest=r.terrainDepthTest,this._configuration.cullAboveTerrain=r.cullAboveTerrain,this._configuration.hasModelTransformation=!o&&i.modelTransformation!=null,this._configuration.hasVertexColors=i.hasVertexColors,this._configuration.hasSymbolColors=i.hasSymbolColors,this._configuration.doubleSidedMode=o?re.WindingOrder:a&&n==="normal"?re.View:a&&n==="winding-order"?re.WindingOrder:re.None,this._configuration.instancedColor=i.hasInstancedColor,this._configuration.receiveShadows=i.receiveShadows&&i.receiveShadows,this._configuration.receiveAmbientOcclusion=i.receiveAmbientOcclusion&&r.ssao!=null,this._configuration.vvColor=!!i.vvColor,this._configuration.textureAlphaPremultiplied=!!i.textureAlphaPremultiplied,this._configuration.pbrMode=i.usePBR?i.isSchematic?N.Schematic:N.Normal:N.Disabled,this._configuration.hasMetallicRoughnessTexture=!o&&!!i.metallicRoughnessTextureId,this._configuration.emissionSource=o?se.None:i.emissiveTextureId!=null?se.Texture:i.usePBR?se.Value:se.None,this._configuration.hasOcclusionTexture=!o&&!!i.occlusionTextureId,this._configuration.offsetBackfaces=!(!i.transparent||!i.offsetTransparentBackfaces),this._configuration.oitPass=r.oitPass,this._configuration.enableOffset=r.camera.relativeElevation=1),W(i.size===3||i.size===4);const{data:o,size:a,indices:n}=i;W(n.length%this._numIndexPerPrimitive==0),W(n.length>=t.length*this._numIndexPerPrimitive);const l=t.length;let c=a*n[this._numIndexPerPrimitive*t[0]];Re.clear(),Re.push(c);const u=It(o[c],o[c+1],o[c+2]),d=Ro(u);for(let f=0;f0&&++c;if(c<2)return;const u=new Array(8);for(let d=0;d<8;++d)u[d]=o[d]>0?new Uint32Array(o[d]):void 0;for(let d=0;d<8;++d)o[d]=0;for(let d=0;d=this._buffer.length){const e=this._roundToNearest((this._array.byteLength+i*this._buffer.BYTES_PER_ELEMENT)*Ge,this._buffer.BYTES_PER_ELEMENT),t=new ArrayBuffer(e),r=new this._ctor(t);r.set(this._buffer,0),this._array=t,this._buffer=r,this._i16View=new Int16Array(this._array)}}ensureSize(i){this._ensureSize(i)}writeF32(i){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=i,this._pos++,e}push(i){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=i,e}writeFixed(i){this._buffer[this._pos++]=i}setValue(i,e){this._buffer[i]=e}i1616Add(i,e,t){this._i16View[2*i]+=e,this._i16View[2*i+1]+=t}getValue(i){return this._buffer[i]}getValueF32(i){return new Float32Array(this._array,4*i,1)[0]}incr(i){if(this._buffer.lengtha.name==="pos"||a.name==="position");if(!o)throw new Error("InternalError: Unable to find position attribute");this.layout={...e,position:o},this._indices=new v(Uint32Array,r),this._vertices=new v(Uint32Array,s),this._metrics=new v(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=n,this._instanceId=i}serialize(i){const e=this._indices.buffer(),t=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null;return i.push(e,t),{instanceId:this._instanceId,layout:this.layout,indices:e,vertices:t,metrics:r}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(i){this._vertices.ensureSize(i)}indexEnsureSize(i){this._indices.ensureSize(i)}writeIndex(i){this._indices.push(i)}writeVertex(i){this._vertices.push(i)}writeVertexRegion(i){this._vertices.writeRegion(i)}writeVertexF32(i){this._vertices.writeF32(i)}writeMetric(i){this._metrics.incr(this._metricCountOffset),i.serialize(this._metrics)}},Et=class{constructor(i,e=0){this._id=i,this._sizeHint=e,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._didEntityStart=!1,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new v(Uint32Array,this._sizeHint*ne.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const i=new Array,e=[],t=this._entities.buffer();for(const r of this._instanceIdToVertexData.values())e.push(r.serialize(i));return{message:{data:e,entities:t},transferList:i}}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(i){this._current.writer.vertexEnsureSize(i)}indexEnsureSize(i){this._current.writer.indexEnsureSize(i)}vertexWrite(i){this._current.writer.writeVertex(i)}vertexWriteRegion(i){this._current.writer.writeVertexRegion(i)}vertexWriteF32(i){this._current.writer.writeVertexF32(i)}recordBounds(i,e,t,r){}indexWrite(i){this._current.writer.writeIndex(i)}metricStart(i){this._current.metric=i}metricEnd(){const i=this._current.writer;this._current.metric.bounds.length&&i.writeMetric(this._current.metric)}metricBoxWrite(i){this._current.metric.bounds.push(i)}entityStart(i,e=i){this._entityIdIndex=this._entities.push(i),this._entitySortKeyIndex=this._entities.writeF32(e),this._entityRecordCountOffset=this._entities.push(0),this._didEntityStart=!0}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this._didEntityStart&&(this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset),this._didEntityStart=!1)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(i,e,t=0){this._current.writer=this._getVertexWriter(i,e),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=i,this._current.layoutHash=e.hash,this._current.textureKey=t}recordEnd(i=0){const e=this._current.vertexStart,t=this._current.writer.vertexCount-e;if(!t)return!1;const r=this._current.indexStart,s=this._current.writer.indexCount-r;return this._recordIndexStart=r,this._recordIndexCount=s,this._recordVertexStart=e,this._recordVertexCount=t,this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,r,s,e,t,i),!0}copyLast(i,e){const t=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,t,this._recordVertexCount,0);const r=this._current.writer.indexWriter,s=this._current.writer.vertexWriter,n=this._recordIndexStart+this._recordIndexCount,o=this._recordVertexCount;for(let _=this._recordIndexStart;_!==n;_++){const l=r.getValue(_);r.push(l+o)}const a=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,h=this._recordVertexStart*a,d=(this._recordVertexStart+this._recordVertexCount)*a;for(let _=h;_!==d;_++){const l=s.getValue(_);s.push(l)}const u=this._current.writer.layout.position,y=u.packPrecisionFactor??1,p=u.offset/Uint32Array.BYTES_PER_ELEMENT,x=i*y,f=e*y;for(let _=t*a;_<=s.length;_+=a)s.i1616Add(_+p,x,f)}copyLastFrom(i,e,t){const r=i._entities.getValue(i._entityIdIndex);if(r!==this._entities.getValue(this._entityIdIndex)){const l=i._entities.getValueF32(i._entitySortKeyIndex);this.entityStart(r,l)}this.recordStart(i._current.instanceId,i._current.writer.layout,i._current.textureKey);const s=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,n=this._current.vertexStart,o=i._current.vertexStart-n,a=this._current.writer.indexWriter,h=this._current.writer.vertexWriter,d=i._current.writer.indexWriter,u=i._current.writer.vertexWriter;for(let l=i._current.indexStart;l!==d.length;l++){const O=d.getValue(l);a.push(O-o)}for(let l=i._current.vertexStart*s;l!==u.length;l++){const O=u.getValue(l);h.push(O)}const y=this._current.writer.layout.position,p=y.packPrecisionFactor??1,x=y.offset/Uint32Array.BYTES_PER_ELEMENT,f=e*p,_=t*p;for(let l=n*s;l<=h.length;l+=s)h.i1616Add(l+x,f,_);this.recordEnd()}_getVertexWriter(i,e){const t=this._instanceIdToVertexData;return t.has(i)||t.set(i,new ke(i,e,this._sizeHint)),t.get(i)}},Ne=class{},Ct=class extends Ne{constructor(i){super(),this._fetcher=i,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(i){const e=oe(i.resource),t=q(JSON.stringify(e));return this._pendingIds.has(t)||(this._pendingIds.add(t),this._pendingRequests.push({...i,resourceId:t})),t}async fetchEnqueuedResources(){const i=this._pendingRequests;this._pendingIds.clear(),this._pendingRequests=[];const e=await this._fetcher.fetch(i,this._abortOptions);for(let t=0;t>>=1,s++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}},We=class{constructor(i){this._valid=W.create(i),this._data=new Array(i)}has(i){return this._valid.has(i)}set(i,e){this._valid.set(i),this._data[i]=e}get(i){return this._data[i]}};const M=m("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],Le=M[0],Pe=M[1],Ue=M[2],Ye=M[3],L=m("featurelayer-simplify-payload-size-factors")??[1,2,4],$e=L[0],Ze=L[1],He=L[2],Xe=m("featurelayer-simplify-mobile-factor")??2,Je=m("esri-mobile"),Q=4294967295;function Qe(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}class At{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=Je?Xe:1;t>4e6?r=He*s:t>1e6?r=Ze*s:t>5e5?r=$e*s:t>1e5&&(r=s);let n=0;return e>4e3?n=Ye*r:e>2e3?n=Ue*r:e>100?n=Pe:e>15&&(n=Le),n}getBounds(e){if(Qe(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===Q)return!1;if(this.getBoundsXMin()===0){const o=this.readGeometryWorldSpace();if(!o)return this.setBoundsXMin(Q),!1;let a=1/0,h=1/0,d=-1/0,u=-1/0;return o.forEachVertex((y,p)=>{a=Math.min(a,y),h=Math.min(h,p),d=Math.max(d,y),u=Math.max(u,p)}),this.setBoundsXMin(a),this.setBoundsYMin(h),this.setBoundsXMax(d),this.setBoundsYMax(u),j(e,a,h,d,u),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),n=this.getBoundsYMax();return j(e,t,r,s,n),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return typeof t=="string"?new Date(t).getTime():typeof t=="number"||t==null?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(r!==void 0)return r;for(const s of this._joined){s.setIndex(this.getIndex());const n=s._readAttribute(e,t);if(n!==void 0)return n}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const s of Object.keys(r))e[s]=r[s]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(this._objectIdToIndex==null){const r=new Map,s=this.getCursor();for(;s.next();){const n=s.getObjectId();_e(n),r.set(n,s.getIndex())}this._objectIdToIndex=r}const t=this._objectIdToIndex;for(const r of e.values())t.has(r)&&this._removeAtIndex(t.get(r))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new ze(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return R(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const t=this._createGeometryFromServerCentroid();return t?t.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return r!=null&&H(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return s!=null&&H(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);t==null&&(t=new We(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return this.geometryType!=="esriGeometryPoint"&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=R(e,this.geometryType,this.hasZ,this.hasM),r=fe(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?F.unknownDateJSToArcadeDate(t):F.dateJSAndZoneToArcadeDate(t,this.contextTimeZone??ye):t}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===pe}field(e){let t=this.fields.get(e);if(t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(this.readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(this.readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(this.readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,this.readAttribute(e,!0));default:return this.readAttribute(e,!1)}for(const r of this._joined)if(r.setIndex(this.getIndex()),t=r.fields.get(e),t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(r._readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(r._readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(r._readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,r._readAttribute(e,!0));default:return this.readAttribute(e,!1)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const n=r.attributes[s];n instanceof Date&&(r.attributes[s]=n.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:e?.keepGeometryType===!0?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(this.getInTransform()==null)return ve(new E,e,this.hasM,this.hasZ);const t=Fe.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=Ee(t);return r?(r[1]*=-1,new E([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return R(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return this.geometryType==="esriGeometryPolyline"?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new E([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new E([2],[e-1,t+1,1,-1])}_removeAtIndex(e){this._deleted==null&&(this._deleted=W.create(this.getSize())),this._deleted.set(e)}}let Ke=class extends B{constructor(i){super(),this._field=i}resize(i){throw new Error("Method not implemented.")}read(i,e){return i.readAttribute(this._field)}readWithDefault(i,e){return i.readAttribute(this._field)}referencesScale(){return!1}referencesGeometry(){return!1}},qe=class te extends B{static async create(e,t){const r=await he(e,t.spatialReference,t.fields),s=q(e);return new te(r,s)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.referencesScale()||t.$view.timeZone!=="system"?X(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,r){return this.referencesScale()||t.$view.timeZone!=="system"?J(this._compiled,e,t,r):this._readWithDefaultCached(e,t,r)}referencesScale(){return this._compiled?.referencesScale()??!1}referencesGeometry(){return this._compiled?.referencesGeometry()??!1}_readCached(e,t){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const r=X(this._compiled,e,t);return e.setCachedValue(r),r}_readWithDefaultCached(e,t,r){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const s=J(this._compiled,e,t,r);return e.setCachedValue(s),s}};function et(i,e){if(i==null)return"";const t=e.domain;if(t){if(t.type==="codedValue"||t.type==="coded-value"){const s=i;for(const n of t.codedValues)if(n.code===s)return n.name}else if(t.type==="range"){const{max:s,min:n}=me(e),o=+i;if(n!=null&&s!=null&&n<=o&&o<=s)return t.name}}let r=i;return ge(e)?r=be(r,xe("short-date")):Ie(e)&&(r=we(+r)),r||""}let tt=class ie extends B{static async create(e,t){const r=De(e);return new ie(s=>r.replaceAll(/{[^}]*}/g,n=>{const o=n.slice(1,-1),a=s.metadata.fieldsIndex.get(o);if(a==null)return n;const h=s.readAttribute(o);return h==null?"":et(h,a)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,r){const s=this._evaluator(e);return ee(s)?r:s}referencesScale(){return!1}referencesGeometry(){return!1}};class it extends B{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}referencesScale(){return!1}referencesGeometry(){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(t==null)return null;const{normalizationField:r,normalizationTotal:s,normalizationType:n}=this._normalizationInfo,o=e.readAttribute(r);switch(n??"esriNormalizeByField"){case"esriNormalizeByField":return o?o?t/o:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return s?t/s*100:null}}}const V=()=>T.getLogger("esri.views.2d.layers.features.support.whereUtils"),rt={getAttribute:(i,e)=>i.readAttribute(e)};async function re(i,e){try{const t=await ue(i,e);if(!t.isStandardized){const r=new S("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",t);V().error(r)}return r=>{const s=r.readArcadeFeature();try{return t.testFeature(s,rt)}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),!0}}}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),t=>!0}}const K=()=>T.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),g=4294967295;function A(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}let vt=class{constructor(i){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=i}createBitset(){const i=this._bitsets.length;return this._bitsets.push(W.create(this._allocatedSize,c)),i+1}async createComputedField(i,e=!1){if(i.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return e?await tt.create(i.expression,this.compilationOptions):await qe.create(i.expression,this.compilationOptions)}catch(r){const s=new S("featurelayer","Failed to compile arcade expression",{error:r,expression:i.expression});return K().error(s),null}if(i.normalizationType||i.normalizationField)return new it(i.field,i);if(i.field)return new Ke(i.field);const t=new S("featurelayer","Unable to create computed field. No expression or field found",{info:i});return K().error(t),null}async createWhereClause(i){return i?re(i,this.compilationOptions.fields):null}getBitset(i){return this._bitsets[i-1]}getComputedNumeric(i,e){return this.getComputedNumericAtIndex(i&c,0)}setComputedNumeric(i,e,t){return this.setComputedNumericAtIndex(i&c,t,0)}getComputedString(i,e){return this.getComputedStringAtIndex(i&c,0)}setComputedString(i,e,t){return this.setComputedStringAtIndex(i&c,0,t)}getComputedNumericAtIndex(i,e){const t=i&c;return this._ensureNumeric(e,t),this._numerics[e][t]}setComputedNumericAtIndex(i,e,t){const r=i&c;this._ensureNumeric(e,r),this._numerics[e][r]=t}getPackedChunkId(i){const e=i&c;return this._ensureInstanceId(e),this._instanceIds[e]}setPackedChunkId(i,e){const t=i&c;this._ensureInstanceId(t),this._instanceIds[t]=e}getComputedStringAtIndex(i,e){const t=i&c;return this._ensureString(e,t),this._strings[e][t]}setComputedStringAtIndex(i,e,t){const r=i&c;this._ensureString(e,r),this._strings[e][r]=t}getXMin(i){return this._bounds[4*(i&c)]}getYMin(i){return this._bounds[4*(i&c)+1]}getXMax(i){return this._bounds[4*(i&c)+2]}getYMax(i){return this._bounds[4*(i&c)+3]}setBounds(i,e,t=!1){const r=i&c;if(!t&&!this._dirtyBitset.has(i))return this._bounds[4*r]!==g;this._dirtyBitset.unset(i);const s=e.readGeometryWorldSpace();if(A(this._bounds,4*r+4,0),!s||!s.coords.length)return this._bounds[4*r]=g,this._bounds[4*r+1]=g,this._bounds[4*r+2]=g,this._bounds[4*r+3]=g,!1;let n=1/0,o=1/0,a=-1/0,h=-1/0;return s.forEachVertex((d,u)=>{n=Math.min(n,d),o=Math.min(o,u),a=Math.max(a,d),h=Math.max(h,u)}),this._bounds[4*r]=n,this._bounds[4*r+1]=o,this._bounds[4*r+2]=a,this._bounds[4*r+3]=h,!0}getBounds(i,e){const t=this.getXMin(e),r=this.getYMin(e),s=this.getXMax(e),n=this.getYMax(e);return j(i,t,r,s,n),t!==g}_ensureNumeric(i,e){this._numerics[i]||(this._numerics[i]=[]),A(this._numerics[i],e,0)}_ensureInstanceId(i){A(this._instanceIds,i,0)}_ensureString(i,e){this._strings[i]||(this._strings[i]=[]),A(this._strings[i],e,null)}},N=class{getObjectId(i){return i.getObjectId()}getAttributes(i){return i.readAttributes()}getAttribute(i,e){return i.readAttribute(e)}getAttributeAsTimestamp(i,e){return i.readAttributeAsTimestamp(e)}cloneWithGeometry(i,e){return i}getGeometry(i){return i.readGeometryWorldSpace()}getCentroid(i,e){return i.readCentroidForDisplay()}};N.Shared=new N;const w=1,st=2;class P{constructor(e){this._geometryBounds=de(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new P(e);return await t.update(e.filterJSON,e.spatialReference),t}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,w)}setTrue(e){const t=[],r=[],s=new Set(e);return this._idToVisibility.forEach((n,o)=>{const a=!!(this._idToVisibility.get(o)&w),h=s.has(o);!a&&h?t.push(o):a&&!h&&r.push(o),this._idToVisibility.set(o,h?w|st:0)}),{show:t,hide:r}}createQuery(){const{geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n}=this;return Re.fromJSON({geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n})}async update(e,t){this._hash=JSON.stringify(e);const r=await Oe(e,null,t);await Promise.all([this._setGeometryFilter(r),this._setIdFilter(r),this._setAttributeFilter(r),this._setTimeFilter(r)])}async _setAttributeFilter(e){if(!e?.where)return this._clause=null,void(this.where=null);this._clause=await re(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e?.objectIds&&new Set(e.objectIds),this._idsToHide=e?.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e?.objectIds}async _setGeometryFilter(e){if(!e?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,r=e.spatialRel||"esriSpatialRelIntersects",s=await Ce(r,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);le(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=r}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e?.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=Ae(this._serviceInfo.timeInfo,e.timeExtent,N.Shared);else{const t=new S("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);T.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?.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,r)=>{t&w||(this._idToVisibility.set(r,w),e.push(r))}),e}}class D{static minimal(e,t,r=[]){return new D({geometryType:e,fieldsIndex:new k(r).toJSON(),objectIdField:t,subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null})}static createFeature(e){return new D(e)}constructor(e){this._options=e,this._fieldsIndex=k.fromJSON(e.fieldsIndex),e.spatialReference&&(this._spatialReference=ce.fromJSON(e.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType==="esriGeometryMultiPatch"?"esriGeometryPolygon":this._options.geometryType}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}}let zt=class se extends D{static createGraphics(e){return new se({fieldsIndex:new k().toJSON(),objectIdField:"uid",geometryType:null,spatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}};const nt=(i,e)=>()=>null,ot=!1;class at{constructor(e){this.data=e,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return this._referenceCount===0}}class ht{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new at(Te(this._getFreeId(),!1)),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}getDisplayIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);return t!=null?t.data:null}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}function ut(i,e){if(!i||!e)return i;switch(e){case"radius":case"distance":return 2*i;case"diameter":case"width":return i;case"area":return Math.sqrt(i)}return i}const U=()=>T.getLogger("esri.views.layers.2d.features.support.AttributeStore"),dt=nt(ot,U());m("esri-shared-array-buffer"),m("esri-atomics");class lt{constructor(e,t,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:n,textureOnly:o}=t;this.textureOnly=o||!1,this.pixelType=s,this.layout=n,this._resetRange(),this.size=e,this.isLocal=r,o||(this.data=this._initData(s,e))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){const r=this.data;for(let s=0;st)return null;this._resetRange();const s=!this.isLocal,n=this.pixelType,o=this.layout,a=this.data;return{start:e,end:t,data:s&&a.slice(e*r,(t+1)*r)||null,pixelType:n,layout:o}}_initData(e,t){const r=ArrayBuffer,s=ae(e),n=new s(new r(t*t*4*s.BYTES_PER_ELEMENT));for(let o=0;onull)}get referencesScale(){return this._referencesScale}get referencesGeometry(){return this._referencesGeometry}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}getDisplayIdForObjectId(e){return this._idGenerator.getDisplayIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,s,n=0){const o=Be(this._schema,e);if(this.version=n,o&&(m("esri-2d-update-debug")&&console.debug(`Version[${n}] AttributeStore.update`,{changed:o}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),e!=null))if(r&&(this._filters=await Promise.all(e.filters.map(a=>a?P.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:s??r.spatialReference,filterJSON:a}):null))),e.type!=="subtype")this._attributeComputeInfo={isSubtype:!1,map:new Map},await Promise.all(e.bindings.map(async a=>{const h=await this._bind(t,a);this._referencesGeometry=this._referencesGeometry||(h?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(h?.referencesScale()??!1)}));else{this._attributeComputeInfo={isSubtype:!0,subtypeField:e.subtypeField,map:new Map},this._referencesScale=!1,this._referencesGeometry=!1;for(const a in e.bindings){const h=e.bindings[a];await Promise.all(h.map(async d=>{const u=await this._bind(t,d,parseInt(a,10));this._referencesGeometry=this._referencesGeometry||(u?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(u?.referencesScale()??!1)}))}}}setHighlight(e,t){const r=this._getBlock(0);r.unsetComponentAllTexels(0,(1<{const y=u*o%a,p=Math.floor(u*o/a),x=this._getBlock(p+C.VV);let f=d.field?.read(t,r);d.valueRepresentation&&(f=ut(f,d.valueRepresentation)),(f===null||isNaN(f)||f===1/0||f===-1/0)&&(f=Se),x.setData(s,y,f)}))}get epoch(){return this._epoch}sendUpdates(){const e=this._blocks.map(r=>r!=null?r.toMessage():null),t=this._getInitArgs();m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,r){const s=await e.createComputedField(t),{valueRepresentation:n}=t,o=this._attributeComputeInfo;if(o.isSubtype){const a=o.map.get(r)??new Map;a.set(t.binding,{field:s,valueRepresentation:n}),o.map.set(r,a)}else o.map.set(t.binding,{field:s,valueRepresentation:n});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(C.Animation),this._getBlock(C.GPGPU),this._getBlock(C.LocalTimeOrigin),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e!=null?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;const r=new lt(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=r,this._initialized=!1,r}_expand(){if(this._size=this._buffer.length){const e=this._roundToNearest((this._array.byteLength+i*this._buffer.BYTES_PER_ELEMENT)*Ge,this._buffer.BYTES_PER_ELEMENT),t=new ArrayBuffer(e),r=new this._ctor(t);r.set(this._buffer,0),this._array=t,this._buffer=r,this._i16View=new Int16Array(this._array)}}ensureSize(i){this._ensureSize(i)}writeF32(i){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=i,this._pos++,e}push(i){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=i,e}writeFixed(i){this._buffer[this._pos++]=i}setValue(i,e){this._buffer[i]=e}i1616Add(i,e,t){this._i16View[2*i]+=e,this._i16View[2*i+1]+=t}getValue(i){return this._buffer[i]}getValueF32(i){return new Float32Array(this._array,4*i,1)[0]}incr(i){if(this._buffer.lengtha.name==="pos"||a.name==="position");if(!o)throw new Error("InternalError: Unable to find position attribute");this.layout={...e,position:o},this._indices=new v(Uint32Array,r),this._vertices=new v(Uint32Array,s),this._metrics=new v(Uint32Array,0),this._metricCountOffset=this._metrics.push(0),this._strideInt=n,this._instanceId=i}serialize(i){const e=this._indices.buffer(),t=this._vertices.buffer(),r=this._metrics.length?this._metrics.buffer():null;return i.push(e,t),{instanceId:this._instanceId,layout:this.layout,indices:e,vertices:t,metrics:r}}get strideInt(){return this._strideInt}get vertexCount(){return this._vertices.length/this._strideInt}get indexCount(){return this._indices.length}get indexWriter(){return this._indices}get vertexWriter(){return this._vertices}get metricWriter(){return this._metrics}vertexEnsureSize(i){this._vertices.ensureSize(i)}indexEnsureSize(i){this._indices.ensureSize(i)}writeIndex(i){this._indices.push(i)}writeVertex(i){this._vertices.push(i)}writeVertexRegion(i){this._vertices.writeRegion(i)}writeVertexF32(i){this._vertices.writeF32(i)}writeMetric(i){this._metrics.incr(this._metricCountOffset),i.serialize(this._metrics)}},Et=class{constructor(i,e=0){this._id=i,this._sizeHint=e,this._entityRecordCountOffset=0,this._entityCountOffset=0,this._entityIdIndex=0,this._entitySortKeyIndex=0,this._didEntityStart=!1,this._instanceIdToVertexData=new Map,this._recordIndexStart=0,this._recordIndexCount=0,this._recordVertexStart=0,this._recordVertexCount=0,this._current={metric:null,writer:null,start:0,sortKey:0,instanceId:0,layoutHash:0,indexStart:0,vertexStart:0,textureKey:0,metricBoxLenPointer:0},this._entities=new v(Uint32Array,this._sizeHint*ne.byteSizeHint),this._entityCountOffset=this._entities.push(0)}get id(){return this._id}serialize(){const i=new Array,e=[],t=this._entities.buffer();for(const r of this._instanceIdToVertexData.values())e.push(r.serialize(i));return{message:{data:e,entities:t},transferList:i}}vertexCount(){return this._current.writer?.vertexCount??0}indexCount(){return this._current.writer?.indexCount??0}vertexEnsureSize(i){this._current.writer.vertexEnsureSize(i)}indexEnsureSize(i){this._current.writer.indexEnsureSize(i)}vertexWrite(i){this._current.writer.writeVertex(i)}vertexWriteRegion(i){this._current.writer.writeVertexRegion(i)}vertexWriteF32(i){this._current.writer.writeVertexF32(i)}recordBounds(i,e,t,r){}indexWrite(i){this._current.writer.writeIndex(i)}metricStart(i){this._current.metric=i}metricEnd(){const i=this._current.writer;this._current.metric.bounds.length&&i.writeMetric(this._current.metric)}metricBoxWrite(i){this._current.metric.bounds.push(i)}entityStart(i,e=i){this._entityIdIndex=this._entities.push(i),this._entitySortKeyIndex=this._entities.writeF32(e),this._entityRecordCountOffset=this._entities.push(0),this._didEntityStart=!0}entityRecordCount(){return this._entities.getValue(this._entityRecordCountOffset)}entityEnd(){this._didEntityStart&&(this.entityRecordCount()===0?this._entities.seek(this._entityIdIndex):this._entities.incr(this._entityCountOffset),this._didEntityStart=!1)}recordCount(){return this._entities.getValue(this._entityRecordCountOffset)}recordStart(i,e,t=0){this._current.writer=this._getVertexWriter(i,e),this._current.indexStart=this._current.writer.indexCount,this._current.vertexStart=this._current.writer.vertexCount,this._current.instanceId=i,this._current.layoutHash=e.hash,this._current.textureKey=t}recordEnd(i=0){const e=this._current.vertexStart,t=this._current.writer.vertexCount-e;if(!t)return!1;const r=this._current.indexStart,s=this._current.writer.indexCount-r;return this._recordIndexStart=r,this._recordIndexCount=s,this._recordVertexStart=e,this._recordVertexCount=t,this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,r,s,e,t,i),!0}copyLast(i,e){const t=this._recordVertexStart+this._recordVertexCount;this._entities.incr(this._entityRecordCountOffset),Y.write(this._entities,this._current.instanceId,this._current.textureKey,this._recordIndexStart+this._recordIndexCount,this._recordIndexCount,t,this._recordVertexCount,0);const r=this._current.writer.indexWriter,s=this._current.writer.vertexWriter,n=this._recordIndexStart+this._recordIndexCount,o=this._recordVertexCount;for(let _=this._recordIndexStart;_!==n;_++){const l=r.getValue(_);r.push(l+o)}const a=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,h=this._recordVertexStart*a,d=(this._recordVertexStart+this._recordVertexCount)*a;for(let _=h;_!==d;_++){const l=s.getValue(_);s.push(l)}const u=this._current.writer.layout.position,y=u.packPrecisionFactor??1,p=u.offset/Uint32Array.BYTES_PER_ELEMENT,x=i*y,f=e*y;for(let _=t*a;_<=s.length;_+=a)s.i1616Add(_+p,x,f)}copyLastFrom(i,e,t){const r=i._entities.getValue(i._entityIdIndex);if(r!==this._entities.getValue(this._entityIdIndex)){const l=i._entities.getValueF32(i._entitySortKeyIndex);this.entityStart(r,l)}this.recordStart(i._current.instanceId,i._current.writer.layout,i._current.textureKey);const s=this._current.writer.layout.stride/Uint32Array.BYTES_PER_ELEMENT,n=this._current.vertexStart,o=i._current.vertexStart-n,a=this._current.writer.indexWriter,h=this._current.writer.vertexWriter,d=i._current.writer.indexWriter,u=i._current.writer.vertexWriter;for(let l=i._current.indexStart;l!==d.length;l++){const O=d.getValue(l);a.push(O-o)}for(let l=i._current.vertexStart*s;l!==u.length;l++){const O=u.getValue(l);h.push(O)}const y=this._current.writer.layout.position,p=y.packPrecisionFactor??1,x=y.offset/Uint32Array.BYTES_PER_ELEMENT,f=e*p,_=t*p;for(let l=n*s;l<=h.length;l+=s)h.i1616Add(l+x,f,_);this.recordEnd()}_getVertexWriter(i,e){const t=this._instanceIdToVertexData;return t.has(i)||t.set(i,new ke(i,e,this._sizeHint)),t.get(i)}},Ne=class{},Ct=class extends Ne{constructor(i){super(),this._fetcher=i,this._controller=new AbortController,this._pendingIds=new Set,this._pendingRequests=[],this._resourceIdToResource=new Map}destroy(){this._controller.abort()}get _abortOptions(){return{signal:this._controller.signal}}enqueueRequest(i){const e=oe(i.resource),t=q(JSON.stringify(e));return this._pendingIds.has(t)||(this._pendingIds.add(t),this._pendingRequests.push({...i,resourceId:t})),t}async fetchEnqueuedResources(){const i=this._pendingRequests;this._pendingIds.clear(),this._pendingRequests=[];const e=await this._fetcher.fetch(i,this._abortOptions);for(let t=0;t>>=1,s++}}countSet(){let e=0;return this.forEachSet(t=>{e++}),e}},We=class{constructor(i){this._valid=W.create(i),this._data=new Array(i)}has(i){return this._valid.has(i)}set(i,e){this._valid.set(i),this._data[i]=e}get(i){return this._data[i]}};const M=m("featurelayer-simplify-thresholds")??[.5,.5,.5,.5],Le=M[0],Pe=M[1],Ue=M[2],Ye=M[3],L=m("featurelayer-simplify-payload-size-factors")??[1,2,4],$e=L[0],Ze=L[1],He=L[2],Xe=m("featurelayer-simplify-mobile-factor")??2,Je=m("esri-mobile"),Q=4294967295;function Qe(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}class At{constructor(e){this.metadata=e,this.type="FeatureSetReader",this._deleted=null,this._joined=[],this._objectIdToIndex=null,this._boundsBuffer=[],this._caches=new Map,this.arcadeDeclaredClass="esri.arcade.Feature",this._contextTimeZone=null}destroy(){}[Symbol.dispose](){this.destroy()}get isEmpty(){return this._deleted!=null&&this._deleted.countSet()===this.getSize()}getAreaSimplificationThreshold(e,t){let r=1;const s=Je?Xe:1;t>4e6?r=He*s:t>1e6?r=Ze*s:t>5e5?r=$e*s:t>1e5&&(r=s);let n=0;return e>4e3?n=Ye*r:e>2e3?n=Ue*r:e>100?n=Pe:e>15&&(n=Le),n}getBounds(e){if(Qe(this._boundsBuffer,4*this.getIndex()+4,0),this.getBoundsXMin()===Q)return!1;if(this.getBoundsXMin()===0){const o=this.readGeometryWorldSpace();if(!o)return this.setBoundsXMin(Q),!1;let a=1/0,h=1/0,d=-1/0,u=-1/0;return o.forEachVertex((y,p)=>{a=Math.min(a,y),h=Math.min(h,p),d=Math.max(d,y),u=Math.max(u,p)}),this.setBoundsXMin(a),this.setBoundsYMin(h),this.setBoundsXMax(d),this.setBoundsYMax(u),j(e,a,h,d,u),!0}const t=this.getBoundsXMin(),r=this.getBoundsYMin(),s=this.getBoundsXMax(),n=this.getBoundsYMax();return j(e,t,r,s,n),!0}getBoundsXMin(){return this._boundsBuffer[4*this.getIndex()]}setBoundsXMin(e){this._boundsBuffer[4*this.getIndex()]=e}getBoundsYMin(){return this._boundsBuffer[4*this.getIndex()+1]}setBoundsYMin(e){this._boundsBuffer[4*this.getIndex()+1]=e}getBoundsXMax(){return this._boundsBuffer[4*this.getIndex()+2]}setBoundsXMax(e){this._boundsBuffer[4*this.getIndex()+2]=e}getBoundsYMax(){return this._boundsBuffer[4*this.getIndex()+3]}setBoundsYMax(e){this._boundsBuffer[4*this.getIndex()+3]=e}readAttributeAsTimestamp(e){const t=this.readAttribute(e);return typeof t=="string"?new Date(t).getTime():typeof t=="number"||t==null?t:null}readAttribute(e,t=!1){const r=this._readAttribute(e,t);if(r!==void 0)return r;for(const s of this._joined){s.setIndex(this.getIndex());const n=s._readAttribute(e,t);if(n!==void 0)return n}}readAttributes(){const e=this._readAttributes();for(const t of this._joined){t.setIndex(this.getIndex());const r=t._readAttributes();for(const s of Object.keys(r))e[s]=r[s]}return e}joinAttributes(e){this._joined.push(e)}removeIds(e){if(this._objectIdToIndex==null){const r=new Map,s=this.getCursor();for(;s.next();){const n=s.getObjectId();_e(n),r.set(n,s.getIndex())}this._objectIdToIndex=r}const t=this._objectIdToIndex;for(const r of e.values())t.has(r)&&this._removeAtIndex(t.get(r))}readOptimizedFeatureWorldSpace(){const e=this.readGeometryWorldSpace(),t=this.readAttributes(),r=this.readCentroidWorldSpace(),s=new ze(e,t,r);return s.objectId=this.getObjectId(),s.displayId=this.getDisplayId(),s}readLegacyFeatureForDisplay(){const e=this.readCentroidForDisplay();return{attributes:this.readAttributes(),geometry:this.readLegacyGeometryForDisplay(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyFeatureWorldSpace(){const e=this.readCentroidWorldSpace();return{attributes:this.readAttributes(),geometry:this._readLegacyGeometryWorldSpace(),centroid:(e&&{x:e.coords[0],y:e.coords[1]})??null}}readLegacyGeometryForDisplay(){const e=this.readGeometryForDisplay();return R(e,this.geometryType,!1,!1)}readXForDisplay(){return this._readX()}readYForDisplay(){return this._readY()}readXWorldSpace(){const e=this._readX(),t=this.getInTransform();return t==null?e:e*t.scale[0]+t.translate[0]}readYWorldSpace(){const e=this._readY(),t=this.getInTransform();return t==null?e:t.translate[1]-e*t.scale[1]}readGeometryForDisplay(){const e=this._readGeometryDeltaDecoded(!0);if(!e){const t=this._createGeometryFromServerCentroid();return t?t.deltaDecode():null}return e}readGeometryWorldSpace(){let e=this._readGeometry();if(e||(e=this._createGeometryFromServerCentroid()),!e)return null;const t=e.clone(),r=this.getInTransform();return r!=null&&H(t,t,this.hasZ,this.hasM,r),t}readCentroidForDisplay(){const e=this.readGeometryForDisplay();return e?this._computeDisplayCentroid(e):this._readServerCentroid()}readCentroidWorldSpace(){const e=this.readGeometryForDisplay(),t=e?this._computeDisplayCentroid(e):this._readServerCentroid();if(!t)return null;const r=t.clone(),s=this.getInTransform();return s!=null&&H(r,r,this.hasZ,this.hasM,s),r}setCache(e){let t=this._caches.get(e);t==null&&(t=new We(this.getSize()),this._caches.set(e,t)),this._activeCache=t}setCachedValue(e){this._activeCache.set(this.getIndex(),e)}hasCachedValue(){return this._activeCache.has(this.getIndex())}getCachedValue(){return this._activeCache.get(this.getIndex())}_readGeometryDeltaDecoded(e){const t=this._readGeometry(e);return this.geometryType!=="esriGeometryPoint"&&t&&this.getInTransform()?t.deltaDecode():t}get contextTimeZone(){return this._contextTimeZone}set contextTimeZone(e){this._contextTimeZone=e}readArcadeFeature(){return this}hasField(e){return this.fields.has(e)||this._joined.some(t=>t.hasField(e))}geometry(){const e=this.readGeometryWorldSpace(),t=R(e,this.geometryType,this.hasZ,this.hasM),r=fe(t);if(r){if(!this.metadata.spatialReference)throw new Error("InternalError: Expected spatial reference to be defined");r.spatialReference=this.metadata.spatialReference}return r}autocastArcadeDate(e,t){return t&&t instanceof Date?this.isUnknownDateTimeField(e)?F.unknownDateJSToArcadeDate(t):F.dateJSAndZoneToArcadeDate(t,this.contextTimeZone??ye):t}isUnknownDateTimeField(e){return this.metadata.fieldsIndex.getTimeZone(e)===pe}field(e){let t=this.fields.get(e);if(t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(this.readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(this.readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(this.readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,this.readAttribute(e,!0));default:return this.readAttribute(e,!1)}for(const r of this._joined)if(r.setIndex(this.getIndex()),t=r.fields.get(e),t)switch(t.type){case"date-only":case"esriFieldTypeDateOnly":return Z.fromReader(r._readAttribute(e,!1));case"time-only":case"esriFieldTypeTimeOnly":return $.fromReader(r._readAttribute(e,!1));case"esriFieldTypeTimestampOffset":case"timestamp-offset":return F.fromReaderAsTimeStampOffset(r._readAttribute(e,!1));case"date":case"esriFieldTypeDate":return this.autocastArcadeDate(e,r._readAttribute(e,!0));default:return this.readAttribute(e,!1)}throw new Error(`Field ${e} does not exist`)}setField(e,t){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.fields.fields.map(e=>e.name)}castToText(e=!1){if(!e)return JSON.stringify(this.readLegacyFeatureForDisplay());const t=this.readLegacyFeatureForDisplay();if(!t)return JSON.stringify(null);const r={geometry:t.geometry,attributes:{...t.attributes??{}}};for(const s in r.attributes){const n=r.attributes[s];n instanceof Date&&(r.attributes[s]=n.getTime())}return JSON.stringify(r)}gdbVersion(){return null}fullSchema(){return this.metadata.arcadeSchema}castAsJson(e=null){return{attributes:this._readAttributes(),geometry:e?.keepGeometryType===!0?this.geometry():this.geometry()?.toJSON()??null}}castAsJsonAsync(e=null,t=null){return Promise.resolve(this.castAsJson(t))}_getExists(){return this._deleted==null||!this._deleted.has(this.getIndex())}_computeDisplayCentroid(e){if(this.getInTransform()==null)return ve(new E,e,this.hasM,this.hasZ);const t=Fe.fromOptimized(e,this.geometryType);t.yFactor*=-1;const r=Ee(t);return r?(r[1]*=-1,new E([],r)):null}copyInto(e){e._joined=this._joined,e._deleted=this._deleted,e._objectIdToIndex=this._objectIdToIndex,e._boundsBuffer=this._boundsBuffer,e._activeCache=this._activeCache,e._caches=this._caches,e._contextTimeZone=this._contextTimeZone}_readLegacyGeometryWorldSpace(){const e=this.readGeometryWorldSpace();return R(e,this.geometryType,!1,!1)}_createGeometryFromServerCentroid(){const e=this._readServerCentroid();if(!e)return null;const[t,r]=e.coords;return this._createQuantizedExtrudedGeometry(t,r)}_createQuantizedExtrudedGeometry(e,t){return this.geometryType==="esriGeometryPolyline"?this._createQuantizedExtrudedLine(e,t):this._createQuantizedExtrudedQuad(e,t)}_createQuantizedExtrudedQuad(e,t){return new E([5],[e-1,t,1,-1,1,1,-1,1,-1,-1])}_createQuantizedExtrudedLine(e,t){return new E([2],[e-1,t+1,1,-1])}_removeAtIndex(e){this._deleted==null&&(this._deleted=W.create(this.getSize())),this._deleted.set(e)}}let Ke=class extends B{constructor(i){super(),this._field=i}resize(i){throw new Error("Method not implemented.")}read(i,e){return i.readAttribute(this._field)}readWithDefault(i,e){return i.readAttribute(this._field)}referencesScale(){return!1}referencesGeometry(){return!1}},qe=class te extends B{static async create(e,t){const r=await he(e,t.spatialReference,t.fields),s=q(e);return new te(r,s)}constructor(e,t){super(),this._compiled=e,this._cacheKey=t}resize(e){}read(e,t){return this.referencesScale()||t.$view.timeZone!=="system"?X(this._compiled,e,t):this._readCached(e,t)}readWithDefault(e,t,r){return this.referencesScale()||t.$view.timeZone!=="system"?J(this._compiled,e,t,r):this._readWithDefaultCached(e,t,r)}referencesScale(){return this._compiled?.referencesScale()??!1}referencesGeometry(){return this._compiled?.referencesGeometry()??!1}_readCached(e,t){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const r=X(this._compiled,e,t);return e.setCachedValue(r),r}_readWithDefaultCached(e,t,r){if(e.setCache(this._cacheKey),e.hasCachedValue())return e.getCachedValue();const s=J(this._compiled,e,t,r);return e.setCachedValue(s),s}};function et(i,e){if(i==null)return"";const t=e.domain;if(t){if(t.type==="codedValue"||t.type==="coded-value"){const s=i;for(const n of t.codedValues)if(n.code===s)return n.name}else if(t.type==="range"){const{max:s,min:n}=me(e),o=+i;if(n!=null&&s!=null&&n<=o&&o<=s)return t.name}}let r=i;return ge(e)?r=be(r,xe("short-date")):Ie(e)&&(r=we(+r)),r||""}let tt=class ie extends B{static async create(e,t){const r=De(e);return new ie(s=>r.replaceAll(/{[^}]*}/g,n=>{const o=n.slice(1,-1),a=s.metadata.fieldsIndex.get(o);if(a==null)return n;const h=s.readAttribute(o);return h==null?"":et(h,a)}))}constructor(e){super(),this._evaluator=e}resize(e){}read(e,t){return this._evaluator(e)}readWithDefault(e,t,r){const s=this._evaluator(e);return ee(s)?r:s}referencesScale(){return!1}referencesGeometry(){return!1}};class it extends B{constructor(e,t){super(),this._field=e,this._normalizationInfo=t}resize(e){throw new Error("Method not implemented.")}read(e,t){return this._readNormalized(e)}readWithDefault(e,t){return this._readNormalized(e)}referencesScale(){return!1}referencesGeometry(){return!1}_readNormalized(e){const t=e.readAttribute(this._field);if(t==null)return null;const{normalizationField:r,normalizationTotal:s,normalizationType:n}=this._normalizationInfo,o=e.readAttribute(r);switch(n??"esriNormalizeByField"){case"esriNormalizeByField":return o?o?t/o:void 0:null;case"esriNormalizeByLog":return Math.log(t)*Math.LOG10E;case"esriNormalizeByPercentOfTotal":return s?t/s*100:null}}}const V=()=>T.getLogger("esri.views.2d.layers.features.support.whereUtils"),rt={getAttribute:(i,e)=>i.readAttribute(e)};async function re(i,e){try{const t=await ue(i,e);if(!t.isStandardized){const r=new S("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",t);V().error(r)}return r=>{const s=r.readArcadeFeature();try{return t.testFeature(s,rt)}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),!0}}}catch{return V().warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",i),t=>!0}}const K=()=>T.getLogger("esri.views.2d.layers.features.support.ComputedAttributeStorage"),g=4294967295;function A(i,e,t){if(!(i.length>e))for(;i.length<=e;)i.push(t)}let vt=class{constructor(i){this._numerics=[],this._strings=[],this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[],this._dirtyBitset=this.getBitset(this.createBitset()),this.compilationOptions=i}createBitset(){const i=this._bitsets.length;return this._bitsets.push(W.create(this._allocatedSize,c)),i+1}async createComputedField(i,e=!1){if(i.expression)try{if(!this.compilationOptions)throw new Error("InternalError: Compilation options not defined");return e?await tt.create(i.expression,this.compilationOptions):await qe.create(i.expression,this.compilationOptions)}catch(r){const s=new S("featurelayer","Failed to compile arcade expression",{error:r,expression:i.expression});return K().error(s),null}if(i.normalizationType||i.normalizationField)return new it(i.field,i);if(i.field)return new Ke(i.field);const t=new S("featurelayer","Unable to create computed field. No expression or field found",{info:i});return K().error(t),null}async createWhereClause(i){return i?re(i,this.compilationOptions.fields):null}getBitset(i){return this._bitsets[i-1]}getComputedNumeric(i,e){return this.getComputedNumericAtIndex(i&c,0)}setComputedNumeric(i,e,t){return this.setComputedNumericAtIndex(i&c,t,0)}getComputedString(i,e){return this.getComputedStringAtIndex(i&c,0)}setComputedString(i,e,t){return this.setComputedStringAtIndex(i&c,0,t)}getComputedNumericAtIndex(i,e){const t=i&c;return this._ensureNumeric(e,t),this._numerics[e][t]}setComputedNumericAtIndex(i,e,t){const r=i&c;this._ensureNumeric(e,r),this._numerics[e][r]=t}getPackedChunkId(i){const e=i&c;return this._ensureInstanceId(e),this._instanceIds[e]}setPackedChunkId(i,e){const t=i&c;this._ensureInstanceId(t),this._instanceIds[t]=e}getComputedStringAtIndex(i,e){const t=i&c;return this._ensureString(e,t),this._strings[e][t]}setComputedStringAtIndex(i,e,t){const r=i&c;this._ensureString(e,r),this._strings[e][r]=t}getXMin(i){return this._bounds[4*(i&c)]}getYMin(i){return this._bounds[4*(i&c)+1]}getXMax(i){return this._bounds[4*(i&c)+2]}getYMax(i){return this._bounds[4*(i&c)+3]}setBounds(i,e,t=!1){const r=i&c;if(!t&&!this._dirtyBitset.has(i))return this._bounds[4*r]!==g;this._dirtyBitset.unset(i);const s=e.readGeometryWorldSpace();if(A(this._bounds,4*r+4,0),!s||!s.coords.length)return this._bounds[4*r]=g,this._bounds[4*r+1]=g,this._bounds[4*r+2]=g,this._bounds[4*r+3]=g,!1;let n=1/0,o=1/0,a=-1/0,h=-1/0;return s.forEachVertex((d,u)=>{n=Math.min(n,d),o=Math.min(o,u),a=Math.max(a,d),h=Math.max(h,u)}),this._bounds[4*r]=n,this._bounds[4*r+1]=o,this._bounds[4*r+2]=a,this._bounds[4*r+3]=h,!0}getBounds(i,e){const t=this.getXMin(e),r=this.getYMin(e),s=this.getXMax(e),n=this.getYMax(e);return j(i,t,r,s,n),t!==g}_ensureNumeric(i,e){this._numerics[i]||(this._numerics[i]=[]),A(this._numerics[i],e,0)}_ensureInstanceId(i){A(this._instanceIds,i,0)}_ensureString(i,e){this._strings[i]||(this._strings[i]=[]),A(this._strings[i],e,null)}},N=class{getObjectId(i){return i.getObjectId()}getAttributes(i){return i.readAttributes()}getAttribute(i,e){return i.readAttribute(e)}getAttributeAsTimestamp(i,e){return i.readAttributeAsTimestamp(e)}cloneWithGeometry(i,e){return i}getGeometry(i){return i.readGeometryWorldSpace()}getCentroid(i,e){return i.readCentroidForDisplay()}};N.Shared=new N;const w=1,st=2;class P{constructor(e){this._geometryBounds=de(),this._idToVisibility=new Map,this._serviceInfo=e}static async create(e){const t=new P(e);return await t.update(e.filterJSON,e.spatialReference),t}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,w)}setTrue(e){const t=[],r=[],s=new Set(e);return this._idToVisibility.forEach((n,o)=>{const a=!!(this._idToVisibility.get(o)&w),h=s.has(o);!a&&h?t.push(o):a&&!h&&r.push(o),this._idToVisibility.set(o,h?w|st:0)}),{show:t,hide:r}}createQuery(){const{geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n}=this;return Re.fromJSON({geometry:e,spatialRel:t,where:r,timeExtent:s,objectIds:n})}async update(e,t){this._hash=JSON.stringify(e);const r=await Oe(e,null,t);await Promise.all([this._setGeometryFilter(r),this._setIdFilter(r),this._setAttributeFilter(r),this._setTimeFilter(r)])}async _setAttributeFilter(e){if(!e?.where)return this._clause=null,void(this.where=null);this._clause=await re(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e?.objectIds&&new Set(e.objectIds),this._idsToHide=e?.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e?.objectIds}async _setGeometryFilter(e){if(!e?.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,r=e.spatialRel||"esriSpatialRelIntersects",s=await Ce(r,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);le(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=r}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e?.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=Ae(this._serviceInfo.timeInfo,e.timeExtent,N.Shared);else{const t=new S("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);T.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?.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow?.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readGeometryWorldSpace();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return this._timeOperator==null||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,r)=>{t&w||(this._idToVisibility.set(r,w),e.push(r))}),e}}class D{static minimal(e,t,r=[]){return new D({geometryType:e,fieldsIndex:new k(r).toJSON(),objectIdField:t,subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null})}static createFeature(e){return new D(e)}constructor(e){this._options=e,this._fieldsIndex=k.fromJSON(e.fieldsIndex),e.spatialReference&&(this._spatialReference=ce.fromJSON(e.spatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return this._options.geometryType==="esriGeometryMultiPatch"?"esriGeometryPolygon":this._options.geometryType}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}}let zt=class se extends D{static createGraphics(e){return new se({fieldsIndex:new k().toJSON(),objectIdField:"uid",geometryType:null,spatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null})}};const nt=(i,e)=>()=>null,ot=!1;class at{constructor(e){this.data=e,this._referenceCount=0}increment(){this._referenceCount+=1}decrement(){this._referenceCount-=1}empty(){return this._referenceCount===0}}class ht{constructor(){this._freeIdsGenerationA=[],this._freeIdsGenerationB=[],this._idCounter=1,this._freeIds=this._freeIdsGenerationA,this._objectIdToDisplayId=new Map}createIdForObjectId(e){let t=this._objectIdToDisplayId.get(e);return t?t.increment():(t=new at(Te(this._getFreeId(),!1)),t.increment(),this._objectIdToDisplayId.set(e,t)),t.data}releaseIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);t&&(t.decrement(),t.empty()&&(this._objectIdToDisplayId.delete(e),this._freeIds.push(t.data)))}getDisplayIdForObjectId(e){const t=this._objectIdToDisplayId.get(e);return t!=null?t.data:null}releaseAll(){for(const e of this._objectIdToDisplayId.values())this._freeIds.push(e.data);this._objectIdToDisplayId.clear()}incrementGeneration(){this._freeIds=this._freeIds===this._freeIdsGenerationA?this._freeIdsGenerationB:this._freeIdsGenerationA}_getFreeId(){return this._freeIds.length?this._freeIds.pop():this._idCounter++}}function ut(i,e){if(!i||!e)return i;switch(e){case"radius":case"distance":return 2*i;case"diameter":case"width":return i;case"area":return Math.sqrt(i)}return i}const U=()=>T.getLogger("esri.views.layers.2d.features.support.AttributeStore"),dt=nt(ot,U());m("esri-shared-array-buffer"),m("esri-atomics");class lt{constructor(e,t,r){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:n,textureOnly:o}=t;this.textureOnly=o||!1,this.pixelType=s,this.layout=n,this._resetRange(),this.size=e,this.isLocal=r,o||(this.data=this._initData(s,e))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(e,t){const r=this.data;for(let s=0;st)return null;this._resetRange();const s=!this.isLocal,n=this.pixelType,o=this.layout,a=this.data;return{start:e,end:t,data:s&&a.slice(e*r,(t+1)*r)||null,pixelType:n,layout:o}}_initData(e,t){const r=ArrayBuffer,s=ae(e),n=new s(new r(t*t*4*s.BYTES_PER_ELEMENT));for(let o=0;onull)}get referencesScale(){return this._referencesScale}get referencesGeometry(){return this._referencesGeometry}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(e){return this._idGenerator.createIdForObjectId(e)}releaseDisplayIdForObjectId(e){return this._idGenerator.releaseIdForObjectId(e)}getDisplayIdForObjectId(e){return this._idGenerator.getDisplayIdForObjectId(e)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}releaseAllIds(){this._idGenerator.releaseAll()}async update(e,t,r,s,n=0){const o=Be(this._schema,e);if(this.version=n,o&&(m("esri-2d-update-debug")&&console.debug(`Version[${n}] AttributeStore.update`,{changed:o}),this._schema=e,this._attributeComputeInfo=null,this._initialize(),e!=null))if(r&&(this._filters=await Promise.all(e.filters.map(a=>a?P.create({geometryType:r.geometryType,hasM:!1,hasZ:!1,timeInfo:r.timeInfo,fieldsIndex:r.fieldsIndex,spatialReference:s??r.spatialReference,filterJSON:a}):null))),e.type!=="subtype")this._attributeComputeInfo={isSubtype:!1,map:new Map},await Promise.all(e.bindings.map(async a=>{const h=await this._bind(t,a);this._referencesGeometry=this._referencesGeometry||(h?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(h?.referencesScale()??!1)}));else{this._attributeComputeInfo={isSubtype:!0,subtypeField:e.subtypeField,map:new Map},this._referencesScale=!1,this._referencesGeometry=!1;for(const a in e.bindings){const h=e.bindings[a];await Promise.all(h.map(async d=>{const u=await this._bind(t,d,parseInt(a,10));this._referencesGeometry=this._referencesGeometry||(u?.referencesGeometry()??!1),this._referencesScale=this._referencesScale||(u?.referencesScale()??!1)}))}}}setHighlight(e,t){const r=this._getBlock(0);r.unsetComponentAllTexels(0,(1<{const y=u*o%a,p=Math.floor(u*o/a),x=this._getBlock(p+C.VV);let f=d.field?.read(t,r);d.valueRepresentation&&(f=ut(f,d.valueRepresentation)),(f===null||isNaN(f)||f===1/0||f===-1/0)&&(f=Se),x.setData(s,y,f)}))}get epoch(){return this._epoch}sendUpdates(){const e=this._blocks.map(r=>r!=null?r.toMessage():null),t=this._getInitArgs();m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:t,blockData:e,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,m("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(e){for(;e>=this._size*this._size;)if(this._expand())return}async _bind(e,t,r){const s=await e.createComputedField(t),{valueRepresentation:n}=t,o=this._attributeComputeInfo;if(o.isSubtype){const a=o.map.get(r)??new Map;a.set(t.binding,{field:s,valueRepresentation:n}),o.map.set(r,a)}else o.map.set(t.binding,{field:s,valueRepresentation:n});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(C.Animation),this._getBlock(C.GPGPU),this._getBlock(C.LocalTimeOrigin),{blockSize:this._size,blockDescriptors:this._blocks.map(e=>e!=null?{textureOnly:e.textureOnly,buffer:e.buffer,pixelType:e.pixelType}:null)})}_getBlock(e){const t=this._blocks[e];if(t!=null)return t;const r=new lt(this._size,this._blockDescriptors[e],this._client.isLocal);return this._blocks[e]=r,this._initialized=!1,r}_expand(){if(this._size{e(i)||a.getLogger(this).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new n,this.container.addChild(this._bitmapContainer),this._strategy=new g({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()}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(r,i,m){return this.layer.fetchImageBitmap(r,i,m)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};o([p()],t.prototype,"_strategy",void 0),o([p()],t.prototype,"updating",void 0),t=o([s("esri.views.2d.layers.BaseDynamicLayerView2D")],t);const jt=t;export{jt as default}; diff --git a/custom-toc-highlight/assets/BaseDynamicLayerView2D-AQ-6l0DU-fdOF1reR.js b/custom-toc-highlight/assets/BaseDynamicLayerView2D-AQ-6l0DU-fdOF1reR.js deleted file mode 100644 index 6ef65819..00000000 --- a/custom-toc-highlight/assets/BaseDynamicLayerView2D-AQ-6l0DU-fdOF1reR.js +++ /dev/null @@ -1 +0,0 @@ -import{aU as e,a1 as a,v as o,S as p,i as s}from"./story-BfX8CRfG.js";import{d as n}from"./BitmapContainer-BC8fvmFc-myTzpniv.js";import{X as h,Y as d}from"./LayerView-Bish-E63-rB2WUWF4.js";import{K as g}from"./ExportStrategy-BNE7Gp0u-j76jQ8Ao.js";import{n as u}from"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";import"./main-ugzBrWNm.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./Bitmap-CcqmzvfR-Bqft9oF3.js";let t=class extends u(h(d)){update(r){this._strategy.update(r).catch(i=>{e(i)||a.getLogger(this).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new n,this.container.addChild(this._bitmapContainer),this._strategy=new g({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()}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(r,i,m){return this.layer.fetchImageBitmap(r,i,m)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};o([p()],t.prototype,"_strategy",void 0),o([p()],t.prototype,"updating",void 0),t=o([s("esri.views.2d.layers.BaseDynamicLayerView2D")],t);const jt=t;export{jt as default}; diff --git a/custom-toc-highlight/assets/Basemap-BEqqSTw9-B5O9ub1-.js b/custom-toc-highlight/assets/Basemap-BEqqSTw9-yGsB1EL7.js similarity index 97% rename from custom-toc-highlight/assets/Basemap-BEqqSTw9-B5O9ub1-.js rename to custom-toc-highlight/assets/Basemap-BEqqSTw9-yGsB1EL7.js index 9c808405..6f664225 100644 --- a/custom-toc-highlight/assets/Basemap-BEqqSTw9-B5O9ub1-.js +++ b/custom-toc-highlight/assets/Basemap-BEqqSTw9-yGsB1EL7.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersCreator-CW56kDKc-BGMnYi1N.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./portalLayers-Bh9bAhk4-BP6A8Lj4.js","./associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./fetchService-DbaKmJhP-W7rGyykJ.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./styleUtils-ChrJTYIw-BfDrXrWd.js"])))=>i.map(i=>d[i]); -import{_ as A}from"./main-ugzBrWNm.js";import{bw as t,v as l,bA as O,ag as h,a1 as u,aA as k,am as S,cz as L,P as D,cA as f,$ as T,a as M,r as I,f as B,S as c,ac as V,bq as W,i as G,J as R,j,h as H,cB as N,aB as C}from"./story-BfX8CRfG.js";import{y as P}from"./loadAll-e978YItg-CdtGGDtb.js";import x from"./PortalItem-CctGdnxF-C7IJrZYq.js";import{y as w}from"./writeUtils-D5qlLkwk-xd5TEmf9.js";async function E(e){if(!e)return;const r=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,s=await W("esri/t9n/basemaps");return s[e]||s[r]}const F={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return t("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 t("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 t("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}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return t("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}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return t("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 t("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}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return t("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}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return t("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}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return t("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}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return t("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 t("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 t("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}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"arcgis-imagery":{get thumbnailUrl(){return t("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 t("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 t("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 t("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 t("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 t("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 t("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 t("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 t("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 t("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}]}},$=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let y=class extends j{constructor(e){super(e),this.apiKey=null,this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps",this.worldview=null}getLanguageParamValue(){if(this.language)return this.language;const e=H().toLowerCase();switch(e){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const r=N(e);return r==="pt"?"pt-BR":r&&$.has(r)?r:"global"}};l([c()],y.prototype,"apiKey",void 0),l([c()],y.prototype,"id",void 0),l([c()],y.prototype,"language",void 0),l([c()],y.prototype,"places",void 0),l([c()],y.prototype,"serviceUrl",void 0),l([c()],y.prototype,"worldview",void 0),y=l([G("esri.support.BasemapStyle")],y);const z=y;var d;let J=0,p=d=class extends O(C){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+J++,this.baseLayers=new h,this.referenceLayers=new h;const r=a=>{a.parent&&a.parent!==this&&"remove"in a.parent&&a.parent.remove(a),a.parent=this,a.type==="elevation"&&u.getLogger(this).error(`Layer '${a.title}, id:${a.id}' of type '${a.type}' is not supported as a basemap layer and will therefore be ignored.`)},s=a=>{a.parent=null};this.addHandles([this.baseLayers.on("after-add",a=>r(a.item)),this.referenceLayers.on("after-add",a=>r(a.item)),this.baseLayers.on("after-remove",a=>s(a.item)),this.referenceLayers.on("after-remove",a=>s(a.item))])}initialize(){this.when().catch(e=>{u.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const s of e)s.destroy();const r=this.referenceLayers.toArray();for(const s of r)s.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=k(this.portalItem)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",S(e,this._get("baseLayers")))}_writeBaseLayers(e,r,s){const a=[];e&&(s={...s,layerContainerType:"basemap"},this.baseLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&a.push(o)}),this.referenceLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&(i.type!=="scene"&&(o.isReference=!0),a.push(o))})),r.baseMapLayers=a}set referenceLayers(e){this._set("referenceLayers",S(e,this._get("referenceLayers")))}writeTitle(e,r){r.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return P(this,e=>{e(this.baseLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(r=>L(r)?r.clone():r),referenceLayers:this.referenceLayers.map(r=>L(r)?r.clone():r)};return this.loaded&&(e.loadStatus="loaded"),new d({resourceInfo:this.resourceInfo}).set(e)}read(e,r){this.resourceInfo||this._set("resourceInfo",{data:e,context:r}),super.read(e,r)}write(e,r){return e=e||{},r?.origin||(r={origin:"web-map",...r}),super.write(e,r),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(s=>{const a=D(s);return a.url&&f(a.url)&&(a.url=`https:${a.url}`),a.templateUrl&&f(a.templateUrl)&&(a.templateUrl=`https:${a.templateUrl}`),a})),e}async _loadFromSource(e){const{resourceInfo:r,portalItem:s,style:a}=this;T(e);const i=[];if(r){const o=r.context?r.context.url:null;if(i.push(this._loadLayersFromJSON(r.data,o,e)),r.data.id&&!r.data.title){const g=r.data.id;i.push(E(g).then(n=>{n&&this.read({title:n},r.context)}))}}else s?i.push(this._loadFromItem(s,e)):a&&i.push(this._loadFromStylesService(a,e));await Promise.all(i)}async _loadLayersFromJSON(e,r,s){const a=this.resourceInfo?.context,i=this.portalItem?.portal||a?.portal||null,o=q[a?.origin||""]??"web-map",{populateOperationalLayers:g}=await A(async()=>{const{populateOperationalLayers:b}=await import("./layersCreator-CW56kDKc-BGMnYi1N.js");return{populateOperationalLayers:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),n=[];if(T(s),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const b={context:{...a,origin:o,url:r,portal:i,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},v=m=>o==="web-scene"&&m.layerType==="ArcGISSceneServiceLayer"||m.isReference,_=g(this.baseLayers,e.baseMapLayers.filter(m=>!v(m)),b);n.push(_);const U=g(this.referenceLayers,e.baseMapLayers.filter(v),b);n.push(U)}await Promise.allSettled(n)}async _loadFromItem(e,r){const s=await e.load(r),a=await s.fetchData("json",r),i=M(e.itemUrl??"");return this._set("resourceInfo",{data:a.baseMap??{},context:{origin:K[e.type||""]??"web-map",portal:e.portal||I.getDefault(),url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||I.getDefault(),url:i}),this._loadLayersFromJSON(this.resourceInfo.data,i,r)}async _loadFromStylesService(e,r){const s=`${e.serviceUrl}/${e.id}`,a=(await B(s,{query:{language:e.getLanguageParamValue(),places:e.places,worldview:e.worldview,token:e.apiKey},signal:r?.signal})).data,i=M(s);if(this._set("resourceInfo",{data:a.baseMap??{},context:{origin:"web-map",url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),await this._loadLayersFromJSON(this.resourceInfo.data,i,r),e.apiKey)for(const o of[...this.baseLayers,...this.referenceLayers])"apiKey"in o&&(o.apiKey=e.apiKey)}static fromId(e){const r=F[e];return r?r.itemId?new d({portalItem:{id:r.itemId,portal:{url:"https://www.arcgis.com"}}}):d.fromJSON(r,{origin:r.is3d?"web-scene":"web-map"}):null}};l([c({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,r,s,a){this._writeBaseLayers(e,r,a)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:h}},writer(e,r,s,a){this._writeBaseLayers(e,r,a)}}}}}})],p.prototype,"baseLayers",null),l([c({type:String,json:{origins:{"web-scene":{write:!0}}}})],p.prototype,"id",void 0),l([c({type:x})],p.prototype,"portalItem",void 0),l([c()],p.prototype,"referenceLayers",null),l([c({readOnly:!0})],p.prototype,"resourceInfo",void 0),l([c({type:R})],p.prototype,"spatialReference",void 0),l([c({type:z})],p.prototype,"style",void 0),l([c()],p.prototype,"thumbnailUrl",void 0),l([c({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],p.prototype,"title",void 0),l([V("title")],p.prototype,"writeTitle",null),p=d=l([G("esri.Basemap")],p);const K={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},q={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},Q=p,ae=Object.freeze(Object.defineProperty({__proto__:null,default:Q},Symbol.toStringTag,{value:"Module"}));export{ae as B,Q as F,F as s}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersCreator-CW56kDKc-CkfoFLoQ.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./portalLayers-Bh9bAhk4-Y1T2RWf3.js","./associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./PortalItem-CctGdnxF-CfFOGshS.js","./fetchService-DbaKmJhP-Ccg-phWf.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./styleUtils-ChrJTYIw-C6xq7Jeu.js"])))=>i.map(i=>d[i]); +import{_ as A}from"./main-QGPoLsvl.js";import{bw as t,v as l,bA as O,ag as h,a1 as u,aA as k,am as S,cz as L,P as D,cA as f,$ as T,a as M,r as I,f as B,S as c,ac as V,bq as W,i as G,J as R,j,h as H,cB as N,aB as C}from"./story-Doly9N9p.js";import{y as P}from"./loadAll-e978YItg-4pMG3qU7.js";import x from"./PortalItem-CctGdnxF-CfFOGshS.js";import{y as w}from"./writeUtils-D5qlLkwk-enZap9KW.js";async function E(e){if(!e)return;const r=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e.includes("-3d")?e.slice(0,e.indexOf("-3d")):e,s=await W("esri/t9n/basemaps");return s[e]||s[r]}const F={satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return t("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 t("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 t("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}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return t("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}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return t("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 t("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}]},get"dark-gray"(){return{...this["dark-gray-vector"],id:"dark-gray"}},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return t("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}]},get gray(){return{...this["gray-vector"],id:"gray"}},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return t("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}]},get streets(){return{...this["streets-vector"],id:"streets"}},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return t("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}]},get topo(){return{...this["topo-vector"],id:"topo"}},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return t("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 t("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 t("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}]},"topo-3d":{id:"topo-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/topo-3d.png")},baseMapLayers:[{id:"topo-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/1e7d1784d1ef4b79ba6764d0bd6c3150/resources/styles/root.json",layerType:"VectorTileLayer",title:"Topographic",visibility:!0,opacity:1},{id:"topo-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"topo-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-3d":{id:"navigation-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/navigation-3d.jpg")},baseMapLayers:[{id:"navigation-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/ccc904ff872b4144b94934e55e32784b/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation",visibility:!0,opacity:1},{id:"navigation-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-3d":{id:"streets-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/streets-3d.png")},baseMapLayers:[{id:"streets-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/198298c4c64c4cb19de5b46aa00c198d/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"streets-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"streets-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"osm-3d":{id:"osm-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/osm-3d.png")},baseMapLayers:[{id:"osm-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/8628d259c9d14bdc848771c23c513940/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap",visibility:!0,opacity:1},{id:"osm-3d-trees",title:"Trees",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Trees_Thematic_v1/SceneServer",itemId:"f75fef56b2d944fe92ef9f7737b4f953",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"osm-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"gray-3d":{id:"gray-3d",is3d:!0,get thumbnailUrl(){return t("esri/images/basemap/gray-3d.png")},baseMapLayers:[{id:"gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/01a14b466345455ba4176d2e6390db92/resources/styles/root.json",layerType:"VectorTileLayer",title:"Streets",visibility:!0,opacity:1},{id:"gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_DarkLabels_v1/SceneServer",itemId:"a84404ad39c64c328d0596e361ec459b",layerType:"ArcGISSceneServiceLayer"},{id:"gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"navigation-dark-3d":{id:"navigation-dark-3d",itemId:"5a1365328b4943f09a54cf5fd1205707",is3d:!0,baseMapLayers:[{id:"navigation-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/451a1777ab3f4bf095fae24a117439d9/resources/styles/root.json",layerType:"VectorTileLayer",title:"Navigation Dark"},{id:"navigation-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"navigation-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"streets-dark-3d":{id:"streets-dark-3d",itemId:"8a4efa2c20484ec9b4557895e65736ff",is3d:!0,baseMapLayers:[{id:"streets-dark-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/bc599b6d741a4ac084b7eea7bf8c5938/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Streets Night (for 3D)"},{id:"streets-dark-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"streets-dark-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"dark-gray-3d":{id:"dark-gray-3d",itemId:"a8b7322a5fe94002bb0f5e0eeb0c5c18",is3d:!0,baseMapLayers:[{id:"dark-gray-3d-base-layer",styleUrl:"https://www.arcgis.com/sharing/rest/content/items/4178f71acb934fb89f169e7d667c20c6/resources/styles/root.json",layerType:"VectorTileLayer",title:"OpenStreetMap Dark Gray Canvas (for 3D)"},{id:"dark-gray-3d-places-and-labels",title:"Places and Labels",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_LightLabels_v1/SceneServer/layers/0",itemId:"f364b70b012a4da5a4b5921e193eac4a",layerType:"ArcGISSceneServiceLayer"},{id:"dark-gray-3d-buildings",title:"Buildings",url:"https://basemaps3d.arcgis.com/arcgis/rest/services/OpenStreetMap3D_Buildings_v1/SceneServer",itemId:"ca0470dbbddb4db28bad74ed39949e25",layerType:"ArcGISSceneServiceLayer"}]},"arcgis-imagery":{get thumbnailUrl(){return t("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 t("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 t("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 t("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 t("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 t("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 t("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 t("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 t("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 t("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}]}},$=new Set(["ar","bs","ca","hr","cs","da","nl","en","et","fi","fr","de","el","he","hu","id","it","ja","ko","lv","lt","nb","pl","ro","ru","sr","es","sv","th","tr","uk","vi"]);let y=class extends j{constructor(e){super(e),this.apiKey=null,this.id=null,this.language=null,this.places=null,this.serviceUrl="https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps",this.worldview=null}getLanguageParamValue(){if(this.language)return this.language;const e=H().toLowerCase();switch(e){case"pt-br":return"pt-BR";case"pt-pt":return"pt-PT";case"zh-cn":return"zh-CN";case"zh-hk":return"zh-HK";case"zh-tw":return"zh-TW"}const r=N(e);return r==="pt"?"pt-BR":r&&$.has(r)?r:"global"}};l([c()],y.prototype,"apiKey",void 0),l([c()],y.prototype,"id",void 0),l([c()],y.prototype,"language",void 0),l([c()],y.prototype,"places",void 0),l([c()],y.prototype,"serviceUrl",void 0),l([c()],y.prototype,"worldview",void 0),y=l([G("esri.support.BasemapStyle")],y);const z=y;var d;let J=0,p=d=class extends O(C){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.style=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+J++,this.baseLayers=new h,this.referenceLayers=new h;const r=a=>{a.parent&&a.parent!==this&&"remove"in a.parent&&a.parent.remove(a),a.parent=this,a.type==="elevation"&&u.getLogger(this).error(`Layer '${a.title}, id:${a.id}' of type '${a.type}' is not supported as a basemap layer and will therefore be ignored.`)},s=a=>{a.parent=null};this.addHandles([this.baseLayers.on("after-add",a=>r(a.item)),this.referenceLayers.on("after-add",a=>r(a.item)),this.baseLayers.on("after-remove",a=>s(a.item)),this.referenceLayers.on("after-remove",a=>s(a.item))])}initialize(){this.when().catch(e=>{u.getLogger(this).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.baseLayers.toArray();for(const s of e)s.destroy();const r=this.referenceLayers.toArray();for(const s of r)s.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),this.portalItem=k(this.portalItem)}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",S(e,this._get("baseLayers")))}_writeBaseLayers(e,r,s){const a=[];e&&(s={...s,layerContainerType:"basemap"},this.baseLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&a.push(o)}),this.referenceLayers.forEach(i=>{const o=w(i,s.webmap?s.webmap.getLayerJSONFromResourceInfo(i):null,s);o!=null&&(i.type!=="scene"&&(o.isReference=!0),a.push(o))})),r.baseMapLayers=a}set referenceLayers(e){this._set("referenceLayers",S(e,this._get("referenceLayers")))}writeTitle(e,r){r.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return P(this,e=>{e(this.baseLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.map(r=>L(r)?r.clone():r),referenceLayers:this.referenceLayers.map(r=>L(r)?r.clone():r)};return this.loaded&&(e.loadStatus="loaded"),new d({resourceInfo:this.resourceInfo}).set(e)}read(e,r){this.resourceInfo||this._set("resourceInfo",{data:e,context:r}),super.read(e,r)}write(e,r){return e=e||{},r?.origin||(r={origin:"web-map",...r}),super.write(e,r),!this.loaded&&this.resourceInfo?.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(s=>{const a=D(s);return a.url&&f(a.url)&&(a.url=`https:${a.url}`),a.templateUrl&&f(a.templateUrl)&&(a.templateUrl=`https:${a.templateUrl}`),a})),e}async _loadFromSource(e){const{resourceInfo:r,portalItem:s,style:a}=this;T(e);const i=[];if(r){const o=r.context?r.context.url:null;if(i.push(this._loadLayersFromJSON(r.data,o,e)),r.data.id&&!r.data.title){const g=r.data.id;i.push(E(g).then(n=>{n&&this.read({title:n},r.context)}))}}else s?i.push(this._loadFromItem(s,e)):a&&i.push(this._loadFromStylesService(a,e));await Promise.all(i)}async _loadLayersFromJSON(e,r,s){const a=this.resourceInfo?.context,i=this.portalItem?.portal||a?.portal||null,o=q[a?.origin||""]??"web-map",{populateOperationalLayers:g}=await A(async()=>{const{populateOperationalLayers:b}=await import("./layersCreator-CW56kDKc-CkfoFLoQ.js");return{populateOperationalLayers:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url),n=[];if(T(s),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const b={context:{...a,origin:o,url:r,portal:i,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},v=m=>o==="web-scene"&&m.layerType==="ArcGISSceneServiceLayer"||m.isReference,_=g(this.baseLayers,e.baseMapLayers.filter(m=>!v(m)),b);n.push(_);const U=g(this.referenceLayers,e.baseMapLayers.filter(v),b);n.push(U)}await Promise.allSettled(n)}async _loadFromItem(e,r){const s=await e.load(r),a=await s.fetchData("json",r),i=M(e.itemUrl??"");return this._set("resourceInfo",{data:a.baseMap??{},context:{origin:K[e.type||""]??"web-map",portal:e.portal||I.getDefault(),url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||I.getDefault(),url:i}),this._loadLayersFromJSON(this.resourceInfo.data,i,r)}async _loadFromStylesService(e,r){const s=`${e.serviceUrl}/${e.id}`,a=(await B(s,{query:{language:e.getLanguageParamValue(),places:e.places,worldview:e.worldview,token:e.apiKey},signal:r?.signal})).data,i=M(s);if(this._set("resourceInfo",{data:a.baseMap??{},context:{origin:"web-map",url:i}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:a.spatialReference},this.resourceInfo.context),await this._loadLayersFromJSON(this.resourceInfo.data,i,r),e.apiKey)for(const o of[...this.baseLayers,...this.referenceLayers])"apiKey"in o&&(o.apiKey=e.apiKey)}static fromId(e){const r=F[e];return r?r.itemId?new d({portalItem:{id:r.itemId,portal:{url:"https://www.arcgis.com"}}}):d.fromJSON(r,{origin:r.is3d?"web-scene":"web-map"}):null}};l([c({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,r,s,a){this._writeBaseLayers(e,r,a)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:h}},writer(e,r,s,a){this._writeBaseLayers(e,r,a)}}}}}})],p.prototype,"baseLayers",null),l([c({type:String,json:{origins:{"web-scene":{write:!0}}}})],p.prototype,"id",void 0),l([c({type:x})],p.prototype,"portalItem",void 0),l([c()],p.prototype,"referenceLayers",null),l([c({readOnly:!0})],p.prototype,"resourceInfo",void 0),l([c({type:R})],p.prototype,"spatialReference",void 0),l([c({type:z})],p.prototype,"style",void 0),l([c()],p.prototype,"thumbnailUrl",void 0),l([c({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],p.prototype,"title",void 0),l([V("title")],p.prototype,"writeTitle",null),p=d=l([G("esri.Basemap")],p);const K={"Web Scene":"web-scene","Web Map":"web-map","Link Chart":"link-chart"},q={"web-scene":"web-scene","web-map":"web-map","link-chart":"link-chart"},Q=p,ae=Object.freeze(Object.defineProperty({__proto__:null,default:Q},Symbol.toStringTag,{value:"Module"}));export{ae as B,Q as F,F as s}; diff --git a/custom-toc-highlight/assets/BingMapsLayer-BigMnKl_-CZ_oLWcb.js b/custom-toc-highlight/assets/BingMapsLayer-BigMnKl_-BCPSKyeE.js similarity index 89% rename from custom-toc-highlight/assets/BingMapsLayer-BigMnKl_-CZ_oLWcb.js rename to custom-toc-highlight/assets/BingMapsLayer-BigMnKl_-BCPSKyeE.js index 78edd35f..3c7941c6 100644 --- a/custom-toc-highlight/assets/BingMapsLayer-BigMnKl_-CZ_oLWcb.js +++ b/custom-toc-highlight/assets/BingMapsLayer-BigMnKl_-BCPSKyeE.js @@ -1 +1 @@ -import{J as h,n as j,bh as x,f as c,o as u,v as a,S as o,i as M,aK as B,w as U}from"./story-BfX8CRfG.js";import{m as P}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as R}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{u as T}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{T as k}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as I}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{u as f}from"./imageBitmapUtils-DA36kg39-CZPhYtU7.js";import{V as m,d as r}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import{e as L}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import{E as _}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";var v;const y=new L("0/0/0",0,0,0,void 0);let g=v=class extends T(I(k(R))){constructor(){super(...arguments),this.tileInfo=m.create({spatialReference:h.WebMercator,size:256}),this.type="base-tile",this.fullExtent=new j(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,h.WebMercator),this.spatialReference=h.WebMercator}getTileBounds(e,t,i,l){const s=l||x();return y.level=e,y.row=t,y.col=i,y.extent=s,this.tileInfo.updateTileInfo(y),y.extent=void 0,s}fetchTile(e,t,i,l={}){const{signal:s}=l,p=this.getTileUrl(e,t,i),d={responseType:"image",signal:s,query:{...this.refreshParameters}};return c(p??"",d).then(b=>b.data)}async fetchImageBitmapTile(e,t,i,l={}){const{signal:s}=l;if(this.fetchTile!==v.prototype.fetchTile){const S=await this.fetchTile(e,t,i,l);return f(S,e,t,i,s)}const p=this.getTileUrl(e,t,i)??"",d={responseType:"blob",signal:s,query:{...this.refreshParameters}},{data:b}=await c(p,d);return f(b,e,t,i,s)}getTileUrl(){throw new u("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};a([o({type:m})],g.prototype,"tileInfo",void 0),a([o({type:["show","hide"]})],g.prototype,"listMode",void 0),a([o({readOnly:!0,value:"base-tile"})],g.prototype,"type",void 0),a([o({nonNullable:!0})],g.prototype,"fullExtent",void 0),a([o()],g.prototype,"spatialReference",void 0),g=v=a([M("esri.layers.BaseTileLayer")],g);const O=g,w=new B({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),z="https://dev.virtualearth.net";let n=class extends T(_(P(O))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new m({size:[256,256],dpi:96,origin:new U({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:h.WebMercator}),spatialReference:h.WebMercator,lods:[new r({level:1,resolution:78271.5169639999,scale:295828763795777e-6}),new r({level:2,resolution:39135.7584820001,scale:147914381897889e-6}),new r({level:3,resolution:19567.8792409999,scale:73957190948944e-6}),new r({level:4,resolution:9783.93962049996,scale:36978595474472e-6}),new r({level:5,resolution:4891.96981024998,scale:18489297737236e-6}),new r({level:6,resolution:2445.98490512499,scale:9244648868618e-6}),new r({level:7,resolution:1222.99245256249,scale:4622324434309e-6}),new r({level:8,resolution:611.49622628138,scale:2311162217155e-6}),new r({level:9,resolution:305.748113140558,scale:1155581108577e-6}),new r({level:10,resolution:152.874056570411,scale:577790.554289}),new r({level:11,resolution:76.4370282850732,scale:288895.277144}),new r({level:12,resolution:38.2185141425366,scale:144447.638572}),new r({level:13,resolution:19.1092570712683,scale:72223.819286}),new r({level:14,resolution:9.55462853563415,scale:36111.909643}),new r({level:15,resolution:4.77731426794937,scale:18055.954822}),new r({level:16,resolution:2.38865713397468,scale:9027.977411}),new r({level:17,resolution:1.19432856685505,scale:4513.988705}),new r({level:18,resolution:.597164283559817,scale:2256.994353}),new r({level:19,resolution:.298582141647617,scale:1128.497176}),new r({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(e){this._set("bingMetadata",e)}get copyright(){return this.bingMetadata!=null?this.bingMetadata.copyright:null}get operationalLayerType(){return w.toJSON(this.style)}get bingLogo(){return this.bingMetadata!=null?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new u("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||this.bingMetadata==null)return null;const l=this.bingMetadata.resourceSets[0].resources[0],s=l.imageUrlSubdomains[t%l.imageUrlSubdomains.length],p=this._getQuadKey(e,t,i);return l.imageUrl.replace("{subdomain}",s).replace("{quadkey}",p)}async fetchAttributionData(){return this.load().then(()=>this.bingMetadata==null?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(t=>({zoomMin:t.zoomMin,zoomMax:t.zoomMax,score:1,bbox:[t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]]}))}))})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return c(`${z}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(t=>{const i=t.data;if(i.statusCode!==200)throw new u("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new u("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new u("bingmapslayer:getmetadata","no bing resources")}).catch(t=>{throw new u("bingmapslayer:getmetadata",t.message)})}_getPortalBingKey(){return c(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new u("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new u("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,i){let l="";for(let s=e;s>0;s--){let p=0;const d=1<b.data)}async fetchImageBitmapTile(e,t,i,l={}){const{signal:s}=l;if(this.fetchTile!==v.prototype.fetchTile){const S=await this.fetchTile(e,t,i,l);return f(S,e,t,i,s)}const p=this.getTileUrl(e,t,i)??"",d={responseType:"blob",signal:s,query:{...this.refreshParameters}},{data:b}=await c(p,d);return f(b,e,t,i,s)}getTileUrl(){throw new u("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};a([o({type:m})],g.prototype,"tileInfo",void 0),a([o({type:["show","hide"]})],g.prototype,"listMode",void 0),a([o({readOnly:!0,value:"base-tile"})],g.prototype,"type",void 0),a([o({nonNullable:!0})],g.prototype,"fullExtent",void 0),a([o()],g.prototype,"spatialReference",void 0),g=v=a([M("esri.layers.BaseTileLayer")],g);const O=g,w=new B({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),z="https://dev.virtualearth.net";let n=class extends T(_(P(O))){constructor(e){super(e),this.type="bing-maps",this.tileInfo=new m({size:[256,256],dpi:96,origin:new U({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:h.WebMercator}),spatialReference:h.WebMercator,lods:[new r({level:1,resolution:78271.5169639999,scale:295828763795777e-6}),new r({level:2,resolution:39135.7584820001,scale:147914381897889e-6}),new r({level:3,resolution:19567.8792409999,scale:73957190948944e-6}),new r({level:4,resolution:9783.93962049996,scale:36978595474472e-6}),new r({level:5,resolution:4891.96981024998,scale:18489297737236e-6}),new r({level:6,resolution:2445.98490512499,scale:9244648868618e-6}),new r({level:7,resolution:1222.99245256249,scale:4622324434309e-6}),new r({level:8,resolution:611.49622628138,scale:2311162217155e-6}),new r({level:9,resolution:305.748113140558,scale:1155581108577e-6}),new r({level:10,resolution:152.874056570411,scale:577790.554289}),new r({level:11,resolution:76.4370282850732,scale:288895.277144}),new r({level:12,resolution:38.2185141425366,scale:144447.638572}),new r({level:13,resolution:19.1092570712683,scale:72223.819286}),new r({level:14,resolution:9.55462853563415,scale:36111.909643}),new r({level:15,resolution:4.77731426794937,scale:18055.954822}),new r({level:16,resolution:2.38865713397468,scale:9027.977411}),new r({level:17,resolution:1.19432856685505,scale:4513.988705}),new r({level:18,resolution:.597164283559817,scale:2256.994353}),new r({level:19,resolution:.298582141647617,scale:1128.497176}),new r({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(e){this._set("bingMetadata",e)}get copyright(){return this.bingMetadata!=null?this.bingMetadata.copyright:null}get operationalLayerType(){return w.toJSON(this.style)}get bingLogo(){return this.bingMetadata!=null?this.bingMetadata.brandLogoUri:null}load(e){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new u("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(e,t,i){if(!this.loaded||this.bingMetadata==null)return null;const l=this.bingMetadata.resourceSets[0].resources[0],s=l.imageUrlSubdomains[t%l.imageUrlSubdomains.length],p=this._getQuadKey(e,t,i);return l.imageUrl.replace("{subdomain}",s).replace("{quadkey}",p)}async fetchAttributionData(){return this.load().then(()=>this.bingMetadata==null?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(e=>({attribution:e.attribution,coverageAreas:e.coverageAreas.map(t=>({zoomMin:t.zoomMin,zoomMax:t.zoomMax,score:1,bbox:[t.bbox[0],t.bbox[1],t.bbox[2],t.bbox[3]]}))}))})}_getMetadata(){const e={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return c(`${z}/REST/v1/Imagery/Metadata/${e}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(t=>{const i=t.data;if(i.statusCode!==200)throw new u("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new u("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new u("bingmapslayer:getmetadata","no bing resources")}).catch(t=>{throw new u("bingmapslayer:getmetadata",t.message)})}_getPortalBingKey(){return c(this.portalUrl??"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new u("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new u("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(e,t,i){let l="";for(let s=e;s>0;s--){let p=0;const d=1<{t.field!=null&&(i.splitByField=t.field),t.expression!=null&&(i.splitBy=t.expression),t.alias!=null&&(i.splitByAlias=t.alias)}},read:{source:["splitBy","splitByField","splitByAlias"],reader:(t,i)=>new w({field:i.splitByField,expression:i.splitBy,alias:i.splitByAlias})}}})],s.prototype,"splitByAttributes",void 0),e([r({type:w,json:{write:{target:{stackBy:{type:String},stackByField:{type:String},stackByAlias:{type:String},jsonStyle:{type:String}},writer:(t,i)=>{t.field!=null&&(i.stackByField=t.field),t.expression!=null&&(i.stackBy=t.expression),t.alias!=null&&(i.stackByAlias=t.alias),t.responseType!=null&&(i.jsonStyle=t.responseType)},overridePolicy(){return{enabled:this.stackByAttributes?.field!=null||this.stackByAttributes?.expression!=null}}},read:{source:["stackBy","stackByField","stackByAlias","jsonStyle"],reader:(t,i)=>new w({field:i.stackByField,expression:i.stackBy,alias:i.stackByAlias,responseType:i.jsonStyle})}}})],s.prototype,"stackByAttributes",void 0),e([d(K)],s.prototype,"transformation",void 0),s=e([y("esri.rest.support.BinParametersBase")],s);const f=s,H=O()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),T="percent-of-total",z="field",q=t=>{let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let o=this._get("normalizationType");const v=!!this.normalizationField,b=this.normalizationTotal!=null;return v||b?(o=v&&z||b&&T||null,v&&b&&N.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):o!==z&&o!==T||(o=null),o}set normalizationType(o){this._set("normalizationType",o)}};return e([r({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),e([r({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),e([d(H,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=e([y("esri.rest.support.NormalizationBinParametersMixin")],i),i};function A(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let p=class extends q(f){constructor(t){super(t),this.bins=null,this.end=null,this.start=null,this.type="auto-interval"}};e([r({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],p.prototype,"bins",void 0),e([r({json:{name:"parameters.end",write:{writer:A}}})],p.prototype,"end",void 0),e([r({json:{name:"parameters.start",write:{writer:A}}})],p.prototype,"start",void 0),e([d({autoIntervalBin:"auto-interval"},{readOnly:!0})],p.prototype,"type",void 0),p=e([y("esri.rest.support.AutoIntervalBinParameters")],p);const U=p;p.from=h(p);const _=O()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"});let m=class extends B(g){constructor(t){super(t),this.value=null,this.units=null}};e([r({type:Number,json:{name:"number",write:!0}})],m.prototype,"value",void 0),e([d(_,{name:"unit"})],m.prototype,"units",void 0),m=e([y("esri.rest.support.DateBinTimeInterval")],m);const k=m;m.from=h(m);function F(t,i,o){j(o,typeof t=="string"?t:t?.getTime(),i)}function P(t,i){const o=t.parameters[i];return o?typeof o=="string"?o:new Date(o):null}let a=class extends f{constructor(t){super(t),this.end=null,this.interval=null,this.offset=null,this.start=null,this.type="date"}};e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.end",read:{reader:(t,i)=>P(i,"end")},write:{writer:F}}})],a.prototype,"end",void 0),e([r({type:k,json:{name:"parameters",write:!0}})],a.prototype,"interval",void 0),e([r({type:k,json:{name:"parameters.offset",write:!0}})],a.prototype,"offset",void 0),e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.start",read:{reader:(t,i)=>P(i,"start")},write:{writer:F}}})],a.prototype,"start",void 0),e([d({dateBin:"date"},{readOnly:!0})],a.prototype,"type",void 0),a=e([y("esri.rest.support.DateBinParameters")],a);const G=a;a.from=h(a);function J(t){return t[0]instanceof Date}function W(t,i,o){j(o,t&&J(t)?t.map(v=>v.getTime()):t,i)}let c=class extends f{constructor(t){super(t),this.boundaries=null,this.type="fixed-boundaries"}};e([r({json:{name:"parameters.boundaries",write:{writer:W}}})],c.prototype,"boundaries",void 0),e([d({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=e([y("esri.rest.support.FixedBoundariesBinParameters")],c);const C=c;c.from=h(c);function D(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let u=class extends q(f){constructor(t){super(t),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};e([r({json:{name:"parameters.end",write:{writer:D}}})],u.prototype,"end",void 0),e([r({type:Number,json:{name:"parameters.interval",write:!0}})],u.prototype,"interval",void 0),e([r({json:{name:"parameters.start",write:{writer:D}}})],u.prototype,"start",void 0),e([d({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],u.prototype,"type",void 0),u=e([y("esri.rest.support.FixedIntervalBinParameters")],u);const E=u;u.from=h(u);const Q=new R({asc:"ascending",desc:"descending"}),X={base:f,key:"type",typeMap:{"auto-interval":U,date:G,"fixed-boundaries":C,"fixed-interval":E}};let n=class extends B(g){constructor(t){super(t),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.quantizationParameters=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(t){this._set("outTimeZone",t),t&&!M(t)&&N.getLogger(this).warn("#outTimeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}};e([r({types:X,json:{name:"bin",write:!0}})],n.prototype,"binParameters",void 0),e([d(Q)],n.prototype,"binOrder",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"cacheHint",void 0),e([r({json:{write:!0}})],n.prototype,"datumTransformation",void 0),e([r({type:x,json:{name:"defaultSR",write:!0}})],n.prototype,"defaultSpatialReference",void 0),e([r({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],n.prototype,"distance",void 0),e([r({types:V,json:{read:I,write:!0}})],n.prototype,"geometry",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"lowerBoundaryAlias",void 0),e([r({type:x,json:{name:"outSR",write:!0}})],n.prototype,"outSpatialReference",void 0),e([r({type:[Z],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],n.prototype,"outStatistics",void 0),e([r({value:null,json:{name:"outTimeReference",read:{reader:t=>t.ianaTimeZone},write:{writer:(t,i,o)=>{t&&(i[o]={ianaTimeZone:t})}}}})],n.prototype,"outTimeZone",null),e([r({type:L,json:{write:!0}})],n.prototype,"quantizationParameters",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"returnDistinctValues",void 0),e([d($,{name:"spatialRel"})],n.prototype,"spatialRelationship",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"upperBoundaryAlias",void 0),e([r({type:String,json:{read:S.read,write:{writer:S.write,overridePolicy(t){return{enabled:t!=null&&this.distance!=null&&this.distance>0}}}}})],n.prototype,"units",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"where",void 0),n=e([y("esri.rest.support.BinsQuery")],n);const mt=n;n.from=h(n);export{mt as default}; +import{aa as B,e as g,v as e,S as r,i as y,bG as h,aK as R,bz as d,cr as O,aE as M,a1 as N,J as x,af as V,g as I,dK as j}from"./story-Doly9N9p.js";import{Z as S}from"./queryUtils-Brxu6254-CDiE0zms.js";import{m as Z,a as L,s as $}from"./Query-BrwMGK8U-BPr0_G9t.js";import"./main-QGPoLsvl.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";let l=class extends B(g){constructor(t){super(t),this.alias=null,this.expression=null,this.field=null,this.responseType=null}};e([r({type:String,json:{write:!0}})],l.prototype,"alias",void 0),e([r({type:String,json:{write:!0}})],l.prototype,"expression",void 0),e([r({type:String,json:{write:!0}})],l.prototype,"field",void 0),e([r({type:String,json:{write:!0}})],l.prototype,"responseType",void 0),l=e([y("esri.rest.support.BinParametersAttributes")],l);const w=l;l.from=h(l);const K=new R({naturalLog:"natural-log",squareRoot:"square-root"});let s=class extends B(g){constructor(t){super(t),this.expression=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitByAttributes=null,this.stackByAttributes=null,this.transformation=null}};e([r({type:String,json:{write:!0}})],s.prototype,"expression",void 0),e([r({type:String,json:{name:"onField",write:!0}})],s.prototype,"field",void 0),e([r({type:String,json:{write:!0}})],s.prototype,"firstDayOfWeek",void 0),e([r({type:String,json:{write:!0}})],s.prototype,"hideUpperBound",void 0),e([r({type:w,json:{write:{target:{splitBy:{type:String},splitByField:{type:String},splitByAlias:{type:String}},writer:(t,i)=>{t.field!=null&&(i.splitByField=t.field),t.expression!=null&&(i.splitBy=t.expression),t.alias!=null&&(i.splitByAlias=t.alias)}},read:{source:["splitBy","splitByField","splitByAlias"],reader:(t,i)=>new w({field:i.splitByField,expression:i.splitBy,alias:i.splitByAlias})}}})],s.prototype,"splitByAttributes",void 0),e([r({type:w,json:{write:{target:{stackBy:{type:String},stackByField:{type:String},stackByAlias:{type:String},jsonStyle:{type:String}},writer:(t,i)=>{t.field!=null&&(i.stackByField=t.field),t.expression!=null&&(i.stackBy=t.expression),t.alias!=null&&(i.stackByAlias=t.alias),t.responseType!=null&&(i.jsonStyle=t.responseType)},overridePolicy(){return{enabled:this.stackByAttributes?.field!=null||this.stackByAttributes?.expression!=null}}},read:{source:["stackBy","stackByField","stackByAlias","jsonStyle"],reader:(t,i)=>new w({field:i.stackByField,expression:i.stackBy,alias:i.stackByAlias,responseType:i.jsonStyle})}}})],s.prototype,"stackByAttributes",void 0),e([d(K)],s.prototype,"transformation",void 0),s=e([y("esri.rest.support.BinParametersBase")],s);const f=s,H=O()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),T="percent-of-total",z="field",q=t=>{let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let o=this._get("normalizationType");const v=!!this.normalizationField,b=this.normalizationTotal!=null;return v||b?(o=v&&z||b&&T||null,v&&b&&N.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):o!==z&&o!==T||(o=null),o}set normalizationType(o){this._set("normalizationType",o)}};return e([r({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),e([r({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),e([r({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),e([d(H,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=e([y("esri.rest.support.NormalizationBinParametersMixin")],i),i};function A(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let p=class extends q(f){constructor(t){super(t),this.bins=null,this.end=null,this.start=null,this.type="auto-interval"}};e([r({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],p.prototype,"bins",void 0),e([r({json:{name:"parameters.end",write:{writer:A}}})],p.prototype,"end",void 0),e([r({json:{name:"parameters.start",write:{writer:A}}})],p.prototype,"start",void 0),e([d({autoIntervalBin:"auto-interval"},{readOnly:!0})],p.prototype,"type",void 0),p=e([y("esri.rest.support.AutoIntervalBinParameters")],p);const U=p;p.from=h(p);const _=O()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"});let m=class extends B(g){constructor(t){super(t),this.value=null,this.units=null}};e([r({type:Number,json:{name:"number",write:!0}})],m.prototype,"value",void 0),e([d(_,{name:"unit"})],m.prototype,"units",void 0),m=e([y("esri.rest.support.DateBinTimeInterval")],m);const k=m;m.from=h(m);function F(t,i,o){j(o,typeof t=="string"?t:t?.getTime(),i)}function P(t,i){const o=t.parameters[i];return o?typeof o=="string"?o:new Date(o):null}let a=class extends f{constructor(t){super(t),this.end=null,this.interval=null,this.offset=null,this.start=null,this.type="date"}};e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.end",read:{reader:(t,i)=>P(i,"end")},write:{writer:F}}})],a.prototype,"end",void 0),e([r({type:k,json:{name:"parameters",write:!0}})],a.prototype,"interval",void 0),e([r({type:k,json:{name:"parameters.offset",write:!0}})],a.prototype,"offset",void 0),e([r({cast:t=>t?typeof t=="string"?t:new Date(t):null,json:{name:"parameters.start",read:{reader:(t,i)=>P(i,"start")},write:{writer:F}}})],a.prototype,"start",void 0),e([d({dateBin:"date"},{readOnly:!0})],a.prototype,"type",void 0),a=e([y("esri.rest.support.DateBinParameters")],a);const G=a;a.from=h(a);function J(t){return t[0]instanceof Date}function W(t,i,o){j(o,t&&J(t)?t.map(v=>v.getTime()):t,i)}let c=class extends f{constructor(t){super(t),this.boundaries=null,this.type="fixed-boundaries"}};e([r({json:{name:"parameters.boundaries",write:{writer:W}}})],c.prototype,"boundaries",void 0),e([d({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=e([y("esri.rest.support.FixedBoundariesBinParameters")],c);const C=c;c.from=h(c);function D(t,i,o){j(o,t instanceof Date?t.getTime():t,i)}let u=class extends q(f){constructor(t){super(t),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};e([r({json:{name:"parameters.end",write:{writer:D}}})],u.prototype,"end",void 0),e([r({type:Number,json:{name:"parameters.interval",write:!0}})],u.prototype,"interval",void 0),e([r({json:{name:"parameters.start",write:{writer:D}}})],u.prototype,"start",void 0),e([d({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],u.prototype,"type",void 0),u=e([y("esri.rest.support.FixedIntervalBinParameters")],u);const E=u;u.from=h(u);const Q=new R({asc:"ascending",desc:"descending"}),X={base:f,key:"type",typeMap:{"auto-interval":U,date:G,"fixed-boundaries":C,"fixed-interval":E}};let n=class extends B(g){constructor(t){super(t),this.binParameters=null,this.binOrder="ascending",this.cacheHint=void 0,this.datumTransformation=null,this.defaultSpatialReference=null,this.distance=void 0,this.geometry=null,this.lowerBoundaryAlias=null,this.outSpatialReference=null,this.outStatistics=null,this.quantizationParameters=null,this.returnDistinctValues=null,this.spatialRelationship="intersects",this.upperBoundaryAlias=null,this.units=null,this.where="1=1"}set outTimeZone(t){this._set("outTimeZone",t),t&&!M(t)&&N.getLogger(this).warn("#outTimeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}};e([r({types:X,json:{name:"bin",write:!0}})],n.prototype,"binParameters",void 0),e([d(Q)],n.prototype,"binOrder",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"cacheHint",void 0),e([r({json:{write:!0}})],n.prototype,"datumTransformation",void 0),e([r({type:x,json:{name:"defaultSR",write:!0}})],n.prototype,"defaultSpatialReference",void 0),e([r({type:Number,json:{write:{overridePolicy:t=>({enabled:t>0})}}})],n.prototype,"distance",void 0),e([r({types:V,json:{read:I,write:!0}})],n.prototype,"geometry",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"lowerBoundaryAlias",void 0),e([r({type:x,json:{name:"outSR",write:!0}})],n.prototype,"outSpatialReference",void 0),e([r({type:[Z],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],n.prototype,"outStatistics",void 0),e([r({value:null,json:{name:"outTimeReference",read:{reader:t=>t.ianaTimeZone},write:{writer:(t,i,o)=>{t&&(i[o]={ianaTimeZone:t})}}}})],n.prototype,"outTimeZone",null),e([r({type:L,json:{write:!0}})],n.prototype,"quantizationParameters",void 0),e([r({type:Boolean,json:{write:!0}})],n.prototype,"returnDistinctValues",void 0),e([d($,{name:"spatialRel"})],n.prototype,"spatialRelationship",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"upperBoundaryAlias",void 0),e([r({type:String,json:{read:S.read,write:{writer:S.write,overridePolicy(t){return{enabled:t!=null&&this.distance!=null&&this.distance>0}}}}})],n.prototype,"units",void 0),e([r({type:String,json:{write:!0}})],n.prototype,"where",void 0),n=e([y("esri.rest.support.BinsQuery")],n);const mt=n;n.from=h(n);export{mt as default}; diff --git a/custom-toc-highlight/assets/Bitmap-CcqmzvfR-Bqft9oF3.js b/custom-toc-highlight/assets/Bitmap-CcqmzvfR-C22fE2NY.js similarity index 94% rename from custom-toc-highlight/assets/Bitmap-CcqmzvfR-Bqft9oF3.js rename to custom-toc-highlight/assets/Bitmap-CcqmzvfR-C22fE2NY.js index b6924714..8ca8fd59 100644 --- a/custom-toc-highlight/assets/Bitmap-CcqmzvfR-Bqft9oF3.js +++ b/custom-toc-highlight/assets/Bitmap-CcqmzvfR-C22fE2NY.js @@ -1 +1 @@ -import{b as p,cW as c,bt as x}from"./story-BfX8CRfG.js";import{R as _,C as a,D as g,H as m,E as f}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as w}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{e as n}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as B}from"./Container-BcuL1ZEG-DxXVQv25.js";import{B as k,U as S,G as R}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as b,V as v}from"./Texture-BCt2hphT-hC4XzHg_.js";class y{constructor(t,e,i){this.pixelBlock=t,this.extent=e,this.originalPixelBlock=i}get width(){return this.pixelBlock!=null?this.pixelBlock.width:0}get height(){return this.pixelBlock!=null?this.pixelBlock.height:0}render(t){const e=this.pixelBlock;if(e==null)return;const i=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??e});if(i.pixelBlock==null)return;i.pixelBlock.maskIsAlpha&&(i.pixelBlock.premultiplyAlpha=!0);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({extent:this.extent,pixelBlock:this.pixelBlock});return t.pixelBlock==null?null:(t.pixelBlock.maskIsAlpha&&(t.pixelBlock.premultiplyAlpha=!0),{width:t.pixelBlock.width,height:t.pixelBlock.height,renderedRasterPixels:new Uint8Array(t.pixelBlock.getAsRGBA().buffer)})}}function T(s){return s&&"render"in s}function A(s){const t=document.createElement("canvas");return t.width=s.width,t.height=s.height,s.render(t.getContext("2d")),t}function I(s){return T(s)?s instanceof y?s.getRenderedRasterPixels()?.renderedRasterPixels:A(s):s}class C extends B{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this._texture=null,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=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),this._uploadStatus!=null&&(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.invalidateTexture(),this.requestRender())}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){this._uploadStatus!=null&&this._uploadStatus.controller.abort();const i=new AbortController,r=p();return c(e,()=>i.abort()),c(i,h=>r.reject(h)),this._uploadStatus={controller:i,resolver:r},this.source=t,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}transitionStep(t,e){t>=64&&(this.fadeTransitionEnabled=!1),super.transitionStep(t,e)}setTransform(t){const e=_(this.transforms.displayViewScreenMat3),[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/t.resolution,o=h*this.width,l=h*this.height,u=Math.PI*this.rotation/180;a(e,e,n(i,r)),a(e,e,n(o/2,l/2)),g(e,e,-u),a(e,e,n(-o/2,-l/2)),m(e,e,n(o,l)),f(this.transforms.displayViewScreenMat3,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=I(this.source);try{if(this._uploadStatus!=null){const{controller:r,resolver:h}=this._uploadStatus,o={signal:r.signal},{width:l,height:u}=this,d=this._texture;await e.textureUploadManager.enqueueTextureUpdate({data:i,texture:d,width:l,height:u},o),h.resolve(),this._uploadStatus=null}else this._texture.setData(i);this.ready()}catch(r){x(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:w()}}_createTexture(t){const e=this.immutable,i=new b;return i.internalFormat=e?k.RGBA8:S.RGBA,i.wrapMode=R.CLAMP_TO_EDGE,i.isImmutable=e,i.width=this._sourceWidth,i.height=this._sourceHeight,new v(t,i)}}export{C as I,y as d,T as p,A as x}; +import{b as p,cW as c,bt as x}from"./story-Doly9N9p.js";import{R as _,C as a,D as g,H as m,E as f}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as w}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{e as n}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as B}from"./Container-BcuL1ZEG-DVZvemLA.js";import{B as k,U as S,G as R}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as b,V as v}from"./Texture-BCt2hphT-Dk2JyWCy.js";class y{constructor(t,e,i){this.pixelBlock=t,this.extent=e,this.originalPixelBlock=i}get width(){return this.pixelBlock!=null?this.pixelBlock.width:0}get height(){return this.pixelBlock!=null?this.pixelBlock.height:0}render(t){const e=this.pixelBlock;if(e==null)return;const i=this.filter({extent:this.extent,pixelBlock:this.originalPixelBlock??e});if(i.pixelBlock==null)return;i.pixelBlock.maskIsAlpha&&(i.pixelBlock.premultiplyAlpha=!0);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({extent:this.extent,pixelBlock:this.pixelBlock});return t.pixelBlock==null?null:(t.pixelBlock.maskIsAlpha&&(t.pixelBlock.premultiplyAlpha=!0),{width:t.pixelBlock.width,height:t.pixelBlock.height,renderedRasterPixels:new Uint8Array(t.pixelBlock.getAsRGBA().buffer)})}}function T(s){return s&&"render"in s}function A(s){const t=document.createElement("canvas");return t.width=s.width,t.height=s.height,s.render(t.getContext("2d")),t}function I(s){return T(s)?s instanceof y?s.getRenderedRasterPixels()?.renderedRasterPixels:A(s):s}class C extends B{constructor(t=null,e=!1){super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this._texture=null,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=e,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),this._uploadStatus!=null&&(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.invalidateTexture(),this.requestRender())}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){this._uploadStatus!=null&&this._uploadStatus.controller.abort();const i=new AbortController,r=p();return c(e,()=>i.abort()),c(i,h=>r.reject(h)),this._uploadStatus={controller:i,resolver:r},this.source=t,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):this._source&&(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width))}transitionStep(t,e){t>=64&&(this.fadeTransitionEnabled=!1),super.transitionStep(t,e)}setTransform(t){const e=_(this.transforms.displayViewScreenMat3),[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/t.resolution,o=h*this.width,l=h*this.height,u=Math.PI*this.rotation/180;a(e,e,n(i,r)),a(e,e,n(o/2,l/2)),g(e,e,-u),a(e,e,n(-o/2,-l/2)),m(e,e,n(o,l)),f(this.transforms.displayViewScreenMat3,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=I(this.source);try{if(this._uploadStatus!=null){const{controller:r,resolver:h}=this._uploadStatus,o={signal:r.signal},{width:l,height:u}=this,d=this._texture;await e.textureUploadManager.enqueueTextureUpdate({data:i,texture:d,width:l,height:u},o),h.resolve(),this._uploadStatus=null}else this._texture.setData(i);this.ready()}catch(r){x(r)}}onDetach(){this.destroy()}_createTransforms(){return{displayViewScreenMat3:w()}}_createTexture(t){const e=this.immutable,i=new b;return i.internalFormat=e?k.RGBA8:S.RGBA,i.wrapMode=R.CLAMP_TO_EDGE,i.isImmutable=e,i.width=this._sourceWidth,i.height=this._sourceHeight,new v(t,i)}}export{C as I,y as d,T as p,A as x}; diff --git a/custom-toc-highlight/assets/BitmapContainer-BC8fvmFc-myTzpniv.js b/custom-toc-highlight/assets/BitmapContainer-BC8fvmFc-C6Z_3UuF.js similarity index 82% rename from custom-toc-highlight/assets/BitmapContainer-BC8fvmFc-myTzpniv.js rename to custom-toc-highlight/assets/BitmapContainer-BC8fvmFc-C6Z_3UuF.js index 781252c2..9508203c 100644 --- a/custom-toc-highlight/assets/BitmapContainer-BC8fvmFc-myTzpniv.js +++ b/custom-toc-highlight/assets/BitmapContainer-BC8fvmFc-C6Z_3UuF.js @@ -1 +1 @@ -import{N as r,s as a}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{E as t}from"./MapView-BGOJJ8ch-DcHA1w96.js";let h=class extends r{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||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 d}; +import{N as r,s as a}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{E as t}from"./MapView-BGOJJ8ch-CJtpe3RS.js";let h=class extends r{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return super.requiresDedicatedFBO||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 d}; diff --git a/custom-toc-highlight/assets/BlendLayer-D1WkSmwP-Bad8_eoW.js b/custom-toc-highlight/assets/BlendLayer-D1WkSmwP-BeUsb4u9.js similarity index 86% rename from custom-toc-highlight/assets/BlendLayer-D1WkSmwP-Bad8_eoW.js rename to custom-toc-highlight/assets/BlendLayer-D1WkSmwP-BeUsb4u9.js index 568bba5f..443eb50d 100644 --- a/custom-toc-highlight/assets/BlendLayer-D1WkSmwP-Bad8_eoW.js +++ b/custom-toc-highlight/assets/BlendLayer-D1WkSmwP-BeUsb4u9.js @@ -1 +1 @@ -import{v as r,S as t,i as n}from"./story-BfX8CRfG.js";import{l,p as a}from"./jsonUtils-wIllKWI4-DrGIvCCq.js";const s={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}}}},o={read:{reader:l},write:{allowNull:!0,writer:a}},d={json:{read:!1,write:!1,origins:{"web-map":o,"portal-item":o}}},c=i=>{let e=class extends i{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return r([t(s)],e.prototype,"blendMode",void 0),r([t(d)],e.prototype,"effect",void 0),e=r([n("esri.layers.mixins.BlendLayer")],e),e};export{d as a,s as o,c as u}; +import{v as r,S as t,i as n}from"./story-Doly9N9p.js";import{l,p as a}from"./jsonUtils-wIllKWI4-MQQ-E5fj.js";const s={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}}}},o={read:{reader:l},write:{allowNull:!0,writer:a}},d={json:{read:!1,write:!1,origins:{"web-map":o,"portal-item":o}}},c=i=>{let e=class extends i{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return r([t(s)],e.prototype,"blendMode",void 0),r([t(d)],e.prototype,"effect",void 0),e=r([n("esri.layers.mixins.BlendLayer")],e),e};export{d as a,s as o,c as u}; diff --git a/custom-toc-highlight/assets/BoundsStore--N6o1xkF-BnCtocGj.js b/custom-toc-highlight/assets/BoundsStore--N6o1xkF-CQrhMeDa.js similarity index 93% rename from custom-toc-highlight/assets/BoundsStore--N6o1xkF-BnCtocGj.js rename to custom-toc-highlight/assets/BoundsStore--N6o1xkF-CQrhMeDa.js index 9737d84c..8f5c0213 100644 --- a/custom-toc-highlight/assets/BoundsStore--N6o1xkF-BnCtocGj.js +++ b/custom-toc-highlight/assets/BoundsStore--N6o1xkF-CQrhMeDa.js @@ -1 +1 @@ -import{K as o,h6 as h}from"./story-BfX8CRfG.js";import{N as a}from"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";const _=5e4,n={minX:0,minY:0,maxX:0,maxY:0};function u(d){n.minX=d[0],n.minY=d[1],n.maxX=d[2],n.maxY=d[3]}function l(d,i,s){u(i),d.search(n,s)}class B{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new a(9,o("esri-csp-restrictions")?i=>({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const i=new Array(this._idByBounds.size);let s=0;this._idByBounds.forEach((t,e)=>{i[s++]=e}),this._indexInvalid=!1,this._index.clear(),this._index.load(i)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(i=>this._idByBounds.has(i))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const i=h();for(const s of this._boundsById.values())s&&(i[0]=Math.min(s[0],i[0]),i[1]=Math.min(s[1],i[1]),i[2]=Math.max(s[2],i[2]),i[3]=Math.max(s[3],i[3]));return i}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(i){const s=this._boundsById.get(i);this._boundsById.delete(i),s&&(this._idByBounds.delete(s),this._indexInvalid||this._index.remove(s))}forEachInBounds(i,s){this._loadIndex(),l(this._index,i,t=>s(this._idByBounds.get(t)))}get(i){return this._boundsById.get(i)}has(i){return this._boundsById.has(i)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(i,s){if(!this._indexInvalid){const t=this._boundsById.get(i);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(i,s),s&&(this._idByBounds.set(s,i),this._indexInvalid||(this._boundsToLoad.push(s),this._boundsToLoad.length>_&&this._loadIndex()))}}export{B as r}; +import{K as o,h6 as h}from"./story-Doly9N9p.js";import{N as a}from"./PooledRBush-DbfAmeLn-CPHfm9op.js";const _=5e4,n={minX:0,minY:0,maxX:0,maxY:0};function u(d){n.minX=d[0],n.minY=d[1],n.maxX=d[2],n.maxY=d[3]}function l(d,i,s){u(i),d.search(n,s)}class B{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new a(9,o("esri-csp-restrictions")?i=>({minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const i=new Array(this._idByBounds.size);let s=0;this._idByBounds.forEach((t,e)=>{i[s++]=e}),this._indexInvalid=!1,this._index.clear(),this._index.load(i)}else this._boundsToLoad.length&&(this._index.load(Array.from(new Set(this._boundsToLoad.filter(i=>this._idByBounds.has(i))))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const i=h();for(const s of this._boundsById.values())s&&(i[0]=Math.min(s[0],i[0]),i[1]=Math.min(s[1],i[1]),i[2]=Math.max(s[2],i[2]),i[3]=Math.max(s[3],i[3]));return i}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(i){const s=this._boundsById.get(i);this._boundsById.delete(i),s&&(this._idByBounds.delete(s),this._indexInvalid||this._index.remove(s))}forEachInBounds(i,s){this._loadIndex(),l(this._index,i,t=>s(this._idByBounds.get(t)))}get(i){return this._boundsById.get(i)}has(i){return this._boundsById.has(i)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(i,s){if(!this._indexInvalid){const t=this._boundsById.get(i);t&&(this._index.remove(t),this._idByBounds.delete(t))}this._boundsById.set(i,s),s&&(this._idByBounds.set(s,i),this._indexInvalid||(this._boundsToLoad.push(s),this._boundsToLoad.length>_&&this._loadIndex()))}}export{B as r}; diff --git a/custom-toc-highlight/assets/BufferObject-BM_7mcDb-Dq7c9k7y.js b/custom-toc-highlight/assets/BufferObject-BM_7mcDb-EYaqMhmk.js similarity index 96% rename from custom-toc-highlight/assets/BufferObject-BM_7mcDb-Dq7c9k7y.js rename to custom-toc-highlight/assets/BufferObject-BM_7mcDb-EYaqMhmk.js index 695a6cfc..1a35b0eb 100644 --- a/custom-toc-highlight/assets/BufferObject-BM_7mcDb-Dq7c9k7y.js +++ b/custom-toc-highlight/assets/BufferObject-BM_7mcDb-EYaqMhmk.js @@ -1 +1 @@ -import{hU as R,hV as A,hW as F,hX as b,a1 as T}from"./story-BfX8CRfG.js";import{N as h}from"./Texture-BCt2hphT-hC4XzHg_.js";import{S as n,n as f,V as E,I as r}from"./enums-DBi1-Mm2-CUS1pvQe.js";const c=()=>T.getLogger("esri.views.webgl.BufferObject");class _{static createIndex(e,t,i){return new _(e,n.ELEMENT_ARRAY_BUFFER,t,i)}static createVertex(e,t,i){return new _(e,n.ARRAY_BUFFER,t,i)}static createUniform(e,t,i){return new _(e,n.UNIFORM_BUFFER,t,i)}static createPixelPack(e,t=f.STREAM_READ,i){const s=new _(e,n.PIXEL_PACK_BUFFER,t);return i&&s.setSize(i),s}static createPixelUnpack(e,t=f.STREAM_DRAW,i){return new _(e,n.PIXEL_UNPACK_BUFFER,t,i)}static createTransformFeedback(e,t=f.STATIC_DRAW,i){const s=new _(e,n.TRANSFORM_FEEDBACK_BUFFER,t);return s.setSize(i),s}constructor(e,t,i,s){this._context=e,this.bufferType=t,this.usage=i,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(E.BufferObject,this),this._glName=this._context.gl.createBuffer(),h(this._context.gl),s&&this.setData(s)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER){if(this._indexType===r.UNSIGNED_INT)return 4*this._size;if(this._indexType===r.UNSIGNED_SHORT)return 2*this._size}return this._size}get _isVAOAware(){return this.bufferType===n.ELEMENT_ARRAY_BUFFER||this.bufferType===n.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(E.BufferObject,this),this._context=null):this._glName&&c().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER&&t!=null)switch(this._indexType=t,t){case r.UNSIGNED_SHORT:e*=2;break;case r.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===n.ELEMENT_ARRAY_BUFFER&&(R(e)?this._indexType=r.UNSIGNED_BYTE:A(e)?(t/=2,this._indexType=r.UNSIGNED_SHORT):F(e)&&(t/=4,this._indexType=r.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const s=this._context.gl;t!=null?s.bufferData(this.bufferType,t,this.usage):s.bufferData(this.bufferType,e,this.usage),h(s),this._isVAOAware&&this._context.bindVAO(i)}setSubData(e,t,i,s){if(!e)return;const u=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:a}=this._context;a.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,i,s-i),h(a),this._isVAOAware&&this._context.bindVAO(u)}getSubData(e,t=0,i,s){if(i<0||s<0)return;const u=B(e)?e.BYTES_PER_ELEMENT:1;if(u*((i??0)+(s??0))>e.byteLength)return;t+u*(s??0)>this.usedMemory&&c().warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;this.bufferType===n.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,n.TRANSFORM_FEEDBACK_BUFFER),a.getBufferSubData(n.TRANSFORM_FEEDBACK_BUFFER,t,e,i,s),this._context.unbindBuffer(n.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,n.COPY_READ_BUFFER),a.getBufferSubData(n.COPY_READ_BUFFER,t,e,i,s),this._context.unbindBuffer(n.COPY_READ_BUFFER))}async getSubDataAsync(e,t=0,i,s){await this._context.clientWaitAsync(),this.getSubData(e,t,i,s)}}function B(o){return b(o)}export{_ as r}; +import{hU as R,hV as A,hW as F,hX as b,a1 as T}from"./story-Doly9N9p.js";import{N as h}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{S as n,n as f,V as E,I as r}from"./enums-DBi1-Mm2-CUS1pvQe.js";const c=()=>T.getLogger("esri.views.webgl.BufferObject");class _{static createIndex(e,t,i){return new _(e,n.ELEMENT_ARRAY_BUFFER,t,i)}static createVertex(e,t,i){return new _(e,n.ARRAY_BUFFER,t,i)}static createUniform(e,t,i){return new _(e,n.UNIFORM_BUFFER,t,i)}static createPixelPack(e,t=f.STREAM_READ,i){const s=new _(e,n.PIXEL_PACK_BUFFER,t);return i&&s.setSize(i),s}static createPixelUnpack(e,t=f.STREAM_DRAW,i){return new _(e,n.PIXEL_UNPACK_BUFFER,t,i)}static createTransformFeedback(e,t=f.STATIC_DRAW,i){const s=new _(e,n.TRANSFORM_FEEDBACK_BUFFER,t);return s.setSize(i),s}constructor(e,t,i,s){this._context=e,this.bufferType=t,this.usage=i,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(E.BufferObject,this),this._glName=this._context.gl.createBuffer(),h(this._context.gl),s&&this.setData(s)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER){if(this._indexType===r.UNSIGNED_INT)return 4*this._size;if(this._indexType===r.UNSIGNED_SHORT)return 2*this._size}return this._size}get _isVAOAware(){return this.bufferType===n.ELEMENT_ARRAY_BUFFER||this.bufferType===n.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(E.BufferObject,this),this._context=null):this._glName&&c().warn("Leaked WebGL buffer object")}setSize(e,t=null){if(this.bufferType===n.ELEMENT_ARRAY_BUFFER&&t!=null)switch(this._indexType=t,t){case r.UNSIGNED_SHORT:e*=2;break;case r.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===n.ELEMENT_ARRAY_BUFFER&&(R(e)?this._indexType=r.UNSIGNED_BYTE:A(e)?(t/=2,this._indexType=r.UNSIGNED_SHORT):F(e)&&(t/=4,this._indexType=r.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const s=this._context.gl;t!=null?s.bufferData(this.bufferType,t,this.usage):s.bufferData(this.bufferType,e,this.usage),h(s),this._isVAOAware&&this._context.bindVAO(i)}setSubData(e,t,i,s){if(!e)return;const u=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const{gl:a}=this._context;a.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,i,s-i),h(a),this._isVAOAware&&this._context.bindVAO(u)}getSubData(e,t=0,i,s){if(i<0||s<0)return;const u=B(e)?e.BYTES_PER_ELEMENT:1;if(u*((i??0)+(s??0))>e.byteLength)return;t+u*(s??0)>this.usedMemory&&c().warn("Potential problem getting subdata: requested data exceeds buffer size!");const a=this._context.gl;this.bufferType===n.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,n.TRANSFORM_FEEDBACK_BUFFER),a.getBufferSubData(n.TRANSFORM_FEEDBACK_BUFFER,t,e,i,s),this._context.unbindBuffer(n.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,n.COPY_READ_BUFFER),a.getBufferSubData(n.COPY_READ_BUFFER,t,e,i,s),this._context.unbindBuffer(n.COPY_READ_BUFFER))}async getSubDataAsync(e,t=0,i,s){await this._context.clientWaitAsync(),this.getSubData(e,t,i,s)}}function B(o){return b(o)}export{_ as r}; diff --git a/custom-toc-highlight/assets/BufferView-PQoE3GL7-Duht5lAO.js b/custom-toc-highlight/assets/BufferView-PQoE3GL7-B9DLdqO9.js similarity index 99% rename from custom-toc-highlight/assets/BufferView-PQoE3GL7-Duht5lAO.js rename to custom-toc-highlight/assets/BufferView-PQoE3GL7-B9DLdqO9.js index adb29251..2815fdb7 100644 --- a/custom-toc-highlight/assets/BufferView-PQoE3GL7-Duht5lAO.js +++ b/custom-toc-highlight/assets/BufferView-PQoE3GL7-B9DLdqO9.js @@ -1 +1 @@ -import{m as D}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{_ as G}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{y as H}from"./vec42-D8CJyqHG-DnfLTeQH.js";let k=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=9;const i=this.TypedArrayConstructor;r===void 0&&(r=9*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;for(let y=0;y<9;++y)r[i++]=s[u++]}get buffer(){return this.typedBuffer.buffer}};k.ElementCount=9;let q=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=16;const i=this.TypedArrayConstructor;r===void 0&&(r=16*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){this.copyFromTypedBuffer(f,e.typedBuffer,t*e.typedBufferStride)}copyFromTypedBuffer(f,e,t){const r=this.typedBuffer;let s=f*this.typedBufferStride;for(let i=0;i<16;++i)r[s++]=e[t++]}get buffer(){return this.typedBuffer.buffer}};q.ElementCount=16;class n{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=1;const u=this.TypedArrayConstructor;s===void 0&&(s=u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.stride=s,this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*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}}n.ElementCount=1;let h=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=2;const i=this.TypedArrayConstructor;r===void 0&&(r=2*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,D(e,this.typedBuffer[f],this.typedBuffer[f+1])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f]=e[1]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};h.ElementCount=2;let c=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=3;const i=this.TypedArrayConstructor;r===void 0&&(r=3*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,G(e,this.typedBuffer[f],this.typedBuffer[f+1],this.typedBuffer[f+2])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f++]=e[1],this.typedBuffer[f]=e[2]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t,r){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f++]=t,this.typedBuffer[f]=r}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};c.ElementCount=3;class d{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;const u=this.TypedArrayConstructor;s===void 0&&(s=4*u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,H(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,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,s,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=s,this.typedBuffer[e]=i}copyFrom(e,t,r){const s=this.typedBuffer,i=t.typedBuffer;let u=e*this.typedBufferStride,y=r*t.typedBufferStride;s[u++]=i[y++],s[u++]=i[y++],s[u++]=i[y++],s[u]=i[y]}get buffer(){return this.typedBuffer.buffer}}d.ElementCount=4;class z extends n{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}static fromTypedArray(e,t){return new z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}z.ElementType="f32";class p extends h{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}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="f32";class l extends c{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),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";let _=class j extends d{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}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)}};_.ElementType="f32";class o extends k{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),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 B extends k{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),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 a extends q{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),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 q{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),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 n{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}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="f64";class E extends h{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),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 c{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),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 d{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),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 n{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}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="u8";class S extends h{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}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="u8";class g extends c{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),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 d{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),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 n{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}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="u16";class x extends h{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}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="u16";class M extends c{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),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 d{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),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 n{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}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="u32";class P extends h{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}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="u32";class R extends c{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),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 d{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),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 n{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}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="i8";class I extends h{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}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="i8";class U extends c{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),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 d{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),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 v extends n{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}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="i16";class K extends h{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),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 c{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}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="i16";class W extends d{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}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="i16";class X extends n{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),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 $ extends h{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer($,e,t)}static fromTypedArray(e,t){return new $(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}$.ElementType="i32";class J extends c{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}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="i32";class Z extends d{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),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{A,a as B,C,X as D,E,F,$ as G,J as H,I,z as J,L,M,N,O,P,R,S,T,U,V,_ as X,Y,B as a,b,g,K as j,Q as k,l,m,o,p,W as q,v,w,x,Z as z}; +import{m as D}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{_ as G}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{y as H}from"./vec42-D8CJyqHG-DnfLTeQH.js";let k=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=9;const i=this.TypedArrayConstructor;r===void 0&&(r=9*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<9;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;for(let y=0;y<9;++y)r[i++]=s[u++]}get buffer(){return this.typedBuffer.buffer}};k.ElementCount=9;let q=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=16;const i=this.TypedArrayConstructor;r===void 0&&(r=16*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)e[r]=this.typedBuffer[t++];return e}setMat(f,e){let t=f*this.typedBufferStride;for(let r=0;r<16;r++)this.typedBuffer[t++]=e[r]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}copyFrom(f,e,t){this.copyFromTypedBuffer(f,e.typedBuffer,t*e.typedBufferStride)}copyFromTypedBuffer(f,e,t){const r=this.typedBuffer;let s=f*this.typedBufferStride;for(let i=0;i<16;++i)r[s++]=e[t++]}get buffer(){return this.typedBuffer.buffer}};q.ElementCount=16;class n{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.elementCount=1;const u=this.TypedArrayConstructor;s===void 0&&(s=u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.stride=s,this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*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}}n.ElementCount=1;let h=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=2;const i=this.TypedArrayConstructor;r===void 0&&(r=2*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,D(e,this.typedBuffer[f],this.typedBuffer[f+1])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f]=e[1]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f]=t}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};h.ElementCount=2;let c=class{constructor(f,e,t=0,r,s){this.TypedArrayConstructor=f,this.elementCount=3;const i=this.TypedArrayConstructor;r===void 0&&(r=3*i.BYTES_PER_ELEMENT);const u=e.byteLength===0?0:t;this.typedBuffer=s==null?new i(e,u):new i(e,u,(s-t)/i.BYTES_PER_ELEMENT),this.typedBufferStride=r/i.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(f,e,t=this.count-e){const r=this.typedBuffer.byteOffset+e*this.stride;return new f(this.buffer,r,this.stride,r+t*this.stride)}getVec(f,e){return f*=this.typedBufferStride,G(e,this.typedBuffer[f],this.typedBuffer[f+1],this.typedBuffer[f+2])}setVec(f,e){f*=this.typedBufferStride,this.typedBuffer[f++]=e[0],this.typedBuffer[f++]=e[1],this.typedBuffer[f]=e[2]}get(f,e){return this.typedBuffer[f*this.typedBufferStride+e]}set(f,e,t){this.typedBuffer[f*this.typedBufferStride+e]=t}setValues(f,e,t,r){f*=this.typedBufferStride,this.typedBuffer[f++]=e,this.typedBuffer[f++]=t,this.typedBuffer[f]=r}copyFrom(f,e,t){const r=this.typedBuffer,s=e.typedBuffer;let i=f*this.typedBufferStride,u=t*e.typedBufferStride;r[i++]=s[u++],r[i++]=s[u++],r[i]=s[u]}get buffer(){return this.typedBuffer.buffer}};c.ElementCount=3;class d{constructor(e,t,r=0,s,i){this.TypedArrayConstructor=e,this.start=r,this.elementCount=4;const u=this.TypedArrayConstructor;s===void 0&&(s=4*u.BYTES_PER_ELEMENT);const y=t.byteLength===0?0:r;this.typedBuffer=i==null?new u(t,y):new u(t,y,(i-r)/u.BYTES_PER_ELEMENT),this.typedBufferStride=s/u.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,r=this.count-t){const s=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,s,this.stride,s+r*this.stride)}getVec(e,t){return e*=this.typedBufferStride,H(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,r){this.typedBuffer[e*this.typedBufferStride+t]=r}setValues(e,t,r,s,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=r,this.typedBuffer[e++]=s,this.typedBuffer[e]=i}copyFrom(e,t,r){const s=this.typedBuffer,i=t.typedBuffer;let u=e*this.typedBufferStride,y=r*t.typedBufferStride;s[u++]=i[y++],s[u++]=i[y++],s[u++]=i[y++],s[u]=i[y]}get buffer(){return this.typedBuffer.buffer}}d.ElementCount=4;class z extends n{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}static fromTypedArray(e,t){return new z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}z.ElementType="f32";class p extends h{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}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="f32";class l extends c{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),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";let _=class j extends d{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),this.elementType="f32"}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)}};_.ElementType="f32";class o extends k{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),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 B extends k{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),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 a extends q{constructor(e,t=0,r,s){super(Float32Array,e,t,r,s),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 q{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),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 n{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),this.elementType="f64"}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="f64";class E extends h{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),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 c{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),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 d{constructor(e,t=0,r,s){super(Float64Array,e,t,r,s),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 n{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}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="u8";class S extends h{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),this.elementType="u8"}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="u8";class g extends c{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),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 d{constructor(e,t=0,r,s){super(Uint8Array,e,t,r,s),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 n{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}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="u16";class x extends h{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),this.elementType="u16"}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="u16";class M extends c{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),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 d{constructor(e,t=0,r,s){super(Uint16Array,e,t,r,s),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 n{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}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="u32";class P extends h{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),this.elementType="u32"}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="u32";class R extends c{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),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 d{constructor(e,t=0,r,s){super(Uint32Array,e,t,r,s),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 n{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}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="i8";class I extends h{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),this.elementType="i8"}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="i8";class U extends c{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),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 d{constructor(e,t=0,r,s){super(Int8Array,e,t,r,s),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 v extends n{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}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="i16";class K extends h{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),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 c{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}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="i16";class W extends d{constructor(e,t=0,r,s){super(Int16Array,e,t,r,s),this.elementType="i16"}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="i16";class X extends n{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),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 $ extends h{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}slice(e,t){return this.sliceBuffer($,e,t)}static fromTypedArray(e,t){return new $(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}$.ElementType="i32";class J extends c{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),this.elementType="i32"}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="i32";class Z extends d{constructor(e,t=0,r,s){super(Int32Array,e,t,r,s),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{A,a as B,C,X as D,E,F,$ as G,J as H,I,z as J,L,M,N,O,P,R,S,T,U,V,_ as X,Y,B as a,b,g,K as j,Q as k,l,m,o,p,W as q,v,w,x,Z as z}; diff --git a/custom-toc-highlight/assets/BuildingSceneLayer-IIePcdNz-52pkRQg3.js b/custom-toc-highlight/assets/BuildingSceneLayer-IIePcdNz-BJDsdW-f.js similarity index 80% rename from custom-toc-highlight/assets/BuildingSceneLayer-IIePcdNz-52pkRQg3.js rename to custom-toc-highlight/assets/BuildingSceneLayer-IIePcdNz-BJDsdW-f.js index 4d3ecad6..e16e27e6 100644 --- a/custom-toc-highlight/assets/BuildingSceneLayer-IIePcdNz-52pkRQg3.js +++ b/custom-toc-highlight/assets/BuildingSceneLayer-IIePcdNz-BJDsdW-f.js @@ -1 +1 @@ -import{bR as de,v as t,S as i,a0 as I,bB as ce,i as p,aB as Y,at as ee,a1 as x,f as te,j3 as me,o as F,bi as he,n as fe,J as re,bL as ge,bz as ie,aK as ve,ag as v,jv as be,P as d,bX as Se,W as we,b0 as Oe,e as h}from"./story-BfX8CRfG.js";import{f as je}from"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import{y as xe,s as Fe}from"./loadAll-e978YItg-CdtGGDtb.js";import{m as Ie,_ as Le}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as Te}from"./Layer-ChoECxvZ-CQTFmFQa.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{u as Be}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import oe from"./FeatureLayer-BrRKw5Si-D6Z5CL70.js";import{H as P,X as Ee,Q as _e,_ as Ae,$ as $e}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{t as Pe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{f as qe}from"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import{o as Re}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{T as Ne,W as ke,f as J}from"./SceneService-BZqGtWmG-BWCHkX1O.js";import{y as Me,o as Qe,d as De,m as Ke}from"./I3SLayerDefinitions-CwLXCKtU-CvmIU1C5.js";import{b as Ce}from"./Query-BrwMGK8U-DoFNfkjX.js";import{w as Ue}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import{q as Ve}from"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import{_ as Je}from"./I3SUtil-Bq8KpP2j-BW-Cczln.js";import{h as He,m as Ze}from"./popupUtils-nV1O8RUO-DAL58cHP.js";import{n as Ge}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{a as We}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{i as Xe}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{E as ze}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as Ye}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{S as et}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{b as tt}from"./associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js";import{r as rt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{k as H,R as it,j as ot}from"./elevationInfoUtils-mOZsPH2J-If61I1du.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import"./Relationship-PyhUibYK-BgFx3_5x.js";import"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./editsZScale-BDsX6vv--CttUpViY.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./EditBusLayer-Df29OyJh-DkVkxUAl.js";import"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import"./FeatureType-C9hJmS6_-BXWT6QCe.js";import"./versionUtils-LZYZz-38-DxOZEoAg.js";import"./styleUtils-ChrJTYIw-BfDrXrWd.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./jsonContext-BA8GHqVk-CWQlLGSw.js";import"./resourceUtils-BmW6QqlX-B1DAUGNs.js";import"./resourceUtils-rTM6Iemx-BROWZCZ1.js";import"./saveUtils-CIYk-dsQ-VGcOewby.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./projectVectorToVector-sIYLNlex-B_PqSyiH.js";import"./projectPointToVector-B2UUY9SE-BChPjj6-.js";import"./sphere-BenPORjV-DaZ5Vv8x.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-CVSP2GQG.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./I3SBinaryReader-DEbI3cKZ-Bdob26G6.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-BCiifXla.js";import"./quat-BODLR7mS-BrXZAXDf.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";let y=class extends de(Le){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,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([i({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],y.prototype,"title",void 0),t([I("service","title",["alias","name"])],y.prototype,"readTitle",null),t([i()],y.prototype,"layer",void 0),t([i({type:ce,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],y.prototype,"id",void 0),t([I("service","id")],y.prototype,"readIdOnlyOnce",null),t([i(P(String))],y.prototype,"modelName",void 0),t([i(P(Boolean))],y.prototype,"isEmpty",void 0),t([i({type:Boolean,nonNullable:!0})],y.prototype,"legendEnabled",void 0),t([i({type:Boolean,json:{name:"visibility",write:!0}})],y.prototype,"visible",void 0),t([i({type:Number,json:{write:!0}})],y.prototype,"opacity",void 0),y=t([p("esri.layers.buildingSublayers.BuildingSublayer")],y);const se=y,Z=qe();let s=class extends Y.LoadableMixin(ee(se)){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(){return this.layer?{path:`${this.layer.parsedUrl?.path}/sublayers/${this.id}`,query:this.layer.parsedUrl?.query}:{path:""}}get fieldsIndex(){return new Re(this.fields)}readAssociatedLayer(e,r){const o=this.layer.associatedFeatureServiceItem,a=r.associatedLayerID;return o!=null&&typeof a=="number"?new oe({portalItem:o,customParameters:this.customParameters,layerId:a}):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 this.associatedLayer!=null?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get customParameters(){return this.layer.customParameters}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=e!=null?e.signal:null,o=this._fetchService(r).then(()=>{this.indexInfo=Ne(this.parsedUrl.path,this.rootNode,this.nodePages,this.customParameters,this.apiKey,x.getLogger(this),r)});return this.addResolvingPromise(o),Promise.resolve(this)}createPopupTemplate(e){return Ue(this,e)}async _fetchService(e){const r=(await te(this.parsedUrl.path,{query:{f:"json",...this.customParameters,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){const o=this.getFeatureType(r?.feature)?.domains?.[e];return o&&o.type!=="inherited"?o:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer!=null?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer!=null?this.associatedLayer.types??[]:[]}get typeIdField(){return this.associatedLayer!=null?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=this.associatedLayer!=null&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:Pe,{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}=e;return{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}}createQuery(){const e=new Ce;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(o=>o.queryExtent(e||this.createQuery(),r))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatureCount(e||this.createQuery(),r))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatures(e||this.createQuery(),r)).then(o=>{if(o?.features)for(const a of o.features)a.layer=this.layer,a.sourceLayer=this;return o})}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryObjectIds(e||this.createQuery(),r))}async queryCachedAttributes(e,r){const o=me(this.fieldsIndex,await He(this,Ze(this)));return Je(this.parsedUrl.path,this.attributeStorageInfo,e,r,o,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const o=await this.queryCachedAttributes(e,[r]);if(!o||o.length===0)throw new F("scenelayer:feature-not-in-cached-data","Feature not found in cached data");return new he({attributes:o[0],layer:this,sourceLayer:this})}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:this.associatedLayer!=null}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),this.associatedLayer==null)throw new F("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 F("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([i({readOnly:!0})],s.prototype,"parsedUrl",null),t([i({type:Me,readOnly:!0})],s.prototype,"nodePages",void 0),t([i({type:[Qe],readOnly:!0})],s.prototype,"materialDefinitions",void 0),t([i({type:[De],readOnly:!0})],s.prototype,"textureSetDefinitions",void 0),t([i({type:[Ke],readOnly:!0})],s.prototype,"geometryDefinitions",void 0),t([i({readOnly:!0})],s.prototype,"serviceUpdateTimeStamp",void 0),t([i({readOnly:!0})],s.prototype,"store",void 0),t([i({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],s.prototype,"rootNode",void 0),t([i({readOnly:!0})],s.prototype,"attributeStorageInfo",void 0),t([i(Z.fields)],s.prototype,"fields",void 0),t([i({readOnly:!0})],s.prototype,"fieldsIndex",null),t([i({readOnly:!0,type:oe})],s.prototype,"associatedLayer",void 0),t([I("service","associatedLayer",["associatedLayerID"])],s.prototype,"readAssociatedLayer",null),t([i(Z.outFields)],s.prototype,"outFields",void 0),t([i({type:String,readOnly:!0})],s.prototype,"objectIdField",null),t([i({readOnly:!0,type:String,json:{read:!1}})],s.prototype,"displayField",null),t([i({readOnly:!0,type:String})],s.prototype,"apiKey",null),t([i({readOnly:!0,type:String})],s.prototype,"customParameters",null),t([i({readOnly:!0,type:fe})],s.prototype,"fullExtent",null),t([i({readOnly:!0,type:re})],s.prototype,"spatialReference",null),t([i({readOnly:!0})],s.prototype,"version",null),t([i({readOnly:!0,type:Ve})],s.prototype,"elevationInfo",null),t([i({readOnly:!0,type:Number})],s.prototype,"minScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"maxScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"effectiveScaleRange",null),t([i({type:["hide","show"],json:{write:!0}})],s.prototype,"listMode",void 0),t([i({types:Be,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],s.prototype,"renderer",void 0),t([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],s.prototype,"definitionExpression",void 0),t([i(Ee)],s.prototype,"popupEnabled",void 0),t([i({type:ge,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],s.prototype,"popupTemplate",void 0),t([i({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],s.prototype,"normalReferenceFrame",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"defaultPopupTemplate",null),t([i()],s.prototype,"types",null),t([i()],s.prototype,"typeIdField",null),t([i({json:{write:!1}}),ie(new ve({"3DObject":"3d-object",Point:"point"}))],s.prototype,"layerType",void 0),t([i()],s.prototype,"geometryType",null),t([i()],s.prototype,"profile",null),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"capabilities",null),t([i({readOnly:!0})],s.prototype,"statisticsInfo",void 0),s=t([p("esri.layers.buildingSublayers.BuildingComponentSublayer")],s);const q=s;var R;const G={type:v,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:ae}}},read:!1}};function ae(e,r,o){if(e&&Array.isArray(e))return new v(e.map(a=>{const l=st(a);if(l){const b=new l;return b.read(a,o),b}return o?.messages&&a&&o.messages.push(new Oe("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(a.type||"unknown")+"' are not supported",{definition:a,context:o})),null}))}let m=R=class extends se{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return Fe(this,e=>R.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}))}};function st(e){return e.layerType==="group"?m:q}t([i({type:["hide","show","hide-children"],json:{write:!0}})],m.prototype,"listMode",void 0),t([i(G)],m.prototype,"sublayers",void 0),m=R=t([p("esri.layers.buildingSublayers.BuildingGroupSublayer")],m),function(e){function r(o,a){o.forEach(l=>{a(l),l.type==="building-group"&&r(l.sublayers,a)})}e.sublayersProperty=G,e.readSublayers=ae,e.forEachSublayer=r}(m||(m={}));const g=m;let L=class extends h{constructor(){super(...arguments),this.type=null}};t([i({type:String,readOnly:!0,json:{write:!0}})],L.prototype,"type",void 0),L=t([p("esri.layers.support.BuildingFilterAuthoringInfo")],L);const ne=L;var N;let S=N=class extends h{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new N({filterType:this.filterType,filterValues:d(this.filterValues)})}};t([i({type:String,json:{write:!0}})],S.prototype,"filterType",void 0),t([i({type:[String],json:{write:!0}})],S.prototype,"filterValues",void 0),S=N=t([p("esri.layers.support.BuildingFilterAuthoringInfoType")],S);const at=S;var k;const nt=v.ofType(at);let T=k=class extends h{clone(){return new k({filterTypes:d(this.filterTypes)})}};t([i({type:nt,json:{write:!0}})],T.prototype,"filterTypes",void 0),T=k=t([p("esri.layers.support.BuildingFilterAuthoringInfoBlock")],T);const lt=T;var M;const pt=v.ofType(lt);let w=M=class extends ne{constructor(){super(...arguments),this.type="checkbox"}clone(){return new M({filterBlocks:d(this.filterBlocks)})}};t([i({type:["checkbox"]})],w.prototype,"type",void 0),t([i({type:pt,json:{write:!0}})],w.prototype,"filterBlocks",void 0),w=M=t([p("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],w);const W=w;let B=class extends h{};t([i({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),B=t([p("esri.layers.support.BuildingFilterMode")],B);const A=B;var Q;let E=Q=class extends A{constructor(){super(...arguments),this.type="solid"}clone(){return new Q}};t([i({type:["solid"],readOnly:!0,json:{write:!0}})],E.prototype,"type",void 0),E=Q=t([p("esri.layers.support.BuildingFilterModeSolid")],E);const D=E;var K;let O=K=class extends A{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new K({edges:d(this.edges)})}};t([ie({wireFrame:"wire-frame"})],O.prototype,"type",void 0),t([i(be)],O.prototype,"edges",void 0),O=K=t([p("esri.layers.support.BuildingFilterModeWireFrame")],O);const X=O;var C;let _=C=class extends A{constructor(){super(...arguments),this.type="x-ray"}clone(){return new C}};t([i({type:["x-ray"],readOnly:!0,json:{write:!0}})],_.prototype,"type",void 0),_=C=t([p("esri.layers.support.BuildingFilterModeXRay")],_);const z=_;var U;const yt={nonNullable:!0,types:{key:"type",base:A,typeMap:{solid:D,"wire-frame":X,"x-ray":z}},json:{read:e=>{switch(e?.type){case"solid":return D.fromJSON(e);case"wireFrame":return X.fromJSON(e);case"x-ray":return z.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let f=U=class extends h{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new D,this.title=""}clone(){return new U({filterExpression:this.filterExpression,filterMode:d(this.filterMode),title:this.title})}};t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"filterExpression",void 0),t([i(yt)],f.prototype,"filterMode",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"title",void 0),f=U=t([p("esri.layers.support.BuildingFilterBlock")],f);const ut=f;var V;const dt=v.ofType(ut);let c=V=class extends h{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=rt(),this.name=null}clone(){return new V({description:this.description,filterBlocks:d(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:d(this.filterAuthoringInfo)})}};t([i({type:String,json:{write:!0}})],c.prototype,"description",void 0),t([i({type:dt,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"filterBlocks",void 0),t([i({types:{key:"type",base:ne,typeMap:{checkbox:W}},json:{read:e=>e?.type==="checkbox"?W.fromJSON(e):null,write:!0}})],c.prototype,"filterAuthoringInfo",void 0),t([i({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"id",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"name",void 0),c=V=t([p("esri.layers.support.BuildingFilter")],c);const ct=c;let u=class extends h{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([i({type:String})],u.prototype,"fieldName",void 0),t([i({type:String})],u.prototype,"modelName",void 0),t([i({type:String})],u.prototype,"label",void 0),t([i({type:Number})],u.prototype,"min",void 0),t([i({type:Number})],u.prototype,"max",void 0),t([i({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([i({type:[Number]})],u.prototype,"subLayerIds",void 0),u=t([p("esri.layers.support.BuildingSummaryStatistics.BuildingFieldStatistics")],u);let j=class extends Y.LoadableMixin(ee(h)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(x.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await te(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([i({constructOnly:!0,type:String})],j.prototype,"url",void 0),t([i({readOnly:!0,type:[u],json:{read:{source:"summary"}}})],j.prototype,"fields",null),j=t([p("esri.layers.support.BuildingSummaryStatistics")],j);const le=j,pe=v.ofType(ct),ye=d(g.sublayersProperty),$=ye.json?.origins;$&&($["web-scene"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},$["portal-item"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let n=class extends ke(We(ze(Ye(et(Ie(Xe(Ge(Te)))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new je({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._allSublayerOverrides=null,this.filters=new pe,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,o){const a=g.readSublayers(e,r,o);return g.forEachSublayer(a,l=>l.layer=this),this._allSublayerOverrides&&(mt(a,this._allSublayerOverrides),this._allSublayerOverrides=null),a}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?ft(this.sublayers,e,r):this._allSublayerOverrides&>(this._allSublayerOverrides,e,r)),e}read(e,r){if(super.read(e,r),(r?.origin==="web-scene"||r?.origin==="portal-item")&&Array.isArray(e?.sublayers)){const o=ht(e.sublayers,r);this.sublayers?ue(this.sublayers,o):(this._allSublayerOverrides??=new Map,this._allSublayerOverrides.set(r.origin,o))}}readSummaryStatistics(e,r){if(typeof r.statisticsHRef=="string"){const o=Se(this.parsedUrl?.path,r.statisticsHRef);return new le({url:o})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=e!=null?e.signal:null,o=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(we).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(o),Promise.resolve(this)}loadAll(){return xe(this,e=>{g.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(J.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(J.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new F("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:r}=await tt(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=r}catch(r){x.getLogger(this).warn("Associated feature service item could not be loaded",r)}}_validateElevationInfo(){const e=this.elevationInfo,r="Building scene layers";H(x.getLogger(this),it(r,"absolute-height",e)),H(x.getLogger(this),ot(r,e))}};function mt(e,r){r.forEach(o=>ue(e,o))}function ue(e,r){const{overrides:o,context:a}=r;g.forEachSublayer(e,l=>l.read(o.get(l.id),a))}function ht(e,r){const o=new Map;for(const a of e)a!=null&&typeof a=="object"&&typeof a.id=="number"?o.set(a.id,a):r.messages?.push(new F("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:a}));return{overrides:o,context:r}}function ft(e,r,o){const a=[];g.forEachSublayer(e,l=>{const b=l.write({},o);Object.keys(b).length>1&&a.push(b)}),a.length>0&&(r.sublayers=a)}function gt(e,r,o){const a=o?.origin&&e.get(o.origin);a&&(r.sublayers=[],a.overrides.forEach(l=>{r.sublayers.push(d(l))}))}t([i({type:["BuildingSceneLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({readOnly:!0})],n.prototype,"allSublayers",void 0),t([i(ye)],n.prototype,"sublayers",void 0),t([I("service","sublayers")],n.prototype,"readSublayers",null),t([i({type:pe,nonNullable:!0,json:{write:!0}})],n.prototype,"filters",void 0),t([i({type:String,json:{write:!0}})],n.prototype,"activeFilterId",void 0),t([i({readOnly:!0,type:le})],n.prototype,"summaryStatistics",void 0),t([I("summaryStatistics",["statisticsHRef"])],n.prototype,"readSummaryStatistics",null),t([i({type:[String],json:{read:!1}})],n.prototype,"outFields",void 0),t([i(_e)],n.prototype,"fullExtent",void 0),t([i(Ae)],n.prototype,"legendEnabled",void 0),t([i({type:["show","hide","hide-children"]})],n.prototype,"listMode",void 0),t([i(P(re))],n.prototype,"spatialReference",void 0),t([i($e)],n.prototype,"elevationInfo",null),t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i()],n.prototype,"associatedFeatureServiceItem",void 0),n=t([p("esri.layers.BuildingSceneLayer")],n);const Ei=n;export{Ei as default}; +import{bR as de,v as t,S as i,a0 as I,bB as ce,i as p,aB as Y,at as ee,a1 as x,f as te,j3 as me,o as F,bi as he,n as fe,J as re,bL as ge,bz as ie,aK as ve,ag as v,jv as be,P as d,bX as Se,W as we,b0 as Oe,e as h}from"./story-Doly9N9p.js";import{f as je}from"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import{y as xe,s as Fe}from"./loadAll-e978YItg-4pMG3qU7.js";import{m as Ie,_ as Le}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as Te}from"./Layer-ChoECxvZ-BmDHBjO8.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{u as Be}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import oe from"./FeatureLayer-BrRKw5Si-DuA2fyE_.js";import{H as P,X as Ee,Q as _e,_ as Ae,$ as $e}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{t as Pe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{f as qe}from"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import{o as Re}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{T as Ne,W as ke,f as J}from"./SceneService-BZqGtWmG-BBytd6YJ.js";import{y as Me,o as Qe,d as De,m as Ke}from"./I3SLayerDefinitions-CwLXCKtU-BdHWzf5u.js";import{b as Ce}from"./Query-BrwMGK8U-BPr0_G9t.js";import{w as Ue}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import{q as Ve}from"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import{_ as Je}from"./I3SUtil-Bq8KpP2j--Kmryq4i.js";import{h as He,m as Ze}from"./popupUtils-nV1O8RUO-BYG2KoFf.js";import{n as Ge}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{a as We}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{i as Xe}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{E as ze}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as Ye}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{S as et}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{b as tt}from"./associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js";import{r as rt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{k as H,R as it,j as ot}from"./elevationInfoUtils-mOZsPH2J-BlRQDLDN.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./editsZScale-BDsX6vv--C-4n90TZ.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./EditBusLayer-Df29OyJh-OmdJOLws.js";import"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import"./FeatureType-C9hJmS6_-CNlvn5D1.js";import"./versionUtils-LZYZz-38-B8C5OAjF.js";import"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./jsonContext-BA8GHqVk-BsXRY5es.js";import"./resourceUtils-BmW6QqlX-D_AxNrCI.js";import"./resourceUtils-rTM6Iemx-GPPQBysx.js";import"./saveUtils-CIYk-dsQ-Br9QCJTX.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./projectVectorToVector-sIYLNlex-DexDhaq1.js";import"./projectPointToVector-B2UUY9SE-BIKNGLey.js";import"./sphere-BenPORjV-B4uz1SYF.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-Bqc6oVGz.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./I3SBinaryReader-DEbI3cKZ-0ASBQHPj.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-ilptOsP0.js";import"./quat-BODLR7mS-BQk2dgMZ.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";let y=class extends de(Le){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.legendEnabled=!0,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([i({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],y.prototype,"title",void 0),t([I("service","title",["alias","name"])],y.prototype,"readTitle",null),t([i()],y.prototype,"layer",void 0),t([i({type:ce,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],y.prototype,"id",void 0),t([I("service","id")],y.prototype,"readIdOnlyOnce",null),t([i(P(String))],y.prototype,"modelName",void 0),t([i(P(Boolean))],y.prototype,"isEmpty",void 0),t([i({type:Boolean,nonNullable:!0})],y.prototype,"legendEnabled",void 0),t([i({type:Boolean,json:{name:"visibility",write:!0}})],y.prototype,"visible",void 0),t([i({type:Number,json:{write:!0}})],y.prototype,"opacity",void 0),y=t([p("esri.layers.buildingSublayers.BuildingSublayer")],y);const se=y,Z=qe();let s=class extends Y.LoadableMixin(ee(se)){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(){return this.layer?{path:`${this.layer.parsedUrl?.path}/sublayers/${this.id}`,query:this.layer.parsedUrl?.query}:{path:""}}get fieldsIndex(){return new Re(this.fields)}readAssociatedLayer(e,r){const o=this.layer.associatedFeatureServiceItem,a=r.associatedLayerID;return o!=null&&typeof a=="number"?new oe({portalItem:o,customParameters:this.customParameters,layerId:a}):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 this.associatedLayer!=null?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get customParameters(){return this.layer.customParameters}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=e!=null?e.signal:null,o=this._fetchService(r).then(()=>{this.indexInfo=Ne(this.parsedUrl.path,this.rootNode,this.nodePages,this.customParameters,this.apiKey,x.getLogger(this),r)});return this.addResolvingPromise(o),Promise.resolve(this)}createPopupTemplate(e){return Ue(this,e)}async _fetchService(e){const r=(await te(this.parsedUrl.path,{query:{f:"json",...this.customParameters,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){const o=this.getFeatureType(r?.feature)?.domains?.[e];return o&&o.type!=="inherited"?o:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer!=null?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer!=null?this.associatedLayer.types??[]:[]}get typeIdField(){return this.associatedLayer!=null?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=this.associatedLayer!=null&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:Pe,{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}=e;return{query:r,data:{supportsZ:o,supportsM:a,isVersioned:l}}}createQuery(){const e=new Ce;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(o=>o.queryExtent(e||this.createQuery(),r))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatureCount(e||this.createQuery(),r))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryFeatures(e||this.createQuery(),r)).then(o=>{if(o?.features)for(const a of o.features)a.layer=this.layer,a.sourceLayer=this;return o})}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then(o=>o.queryObjectIds(e||this.createQuery(),r))}async queryCachedAttributes(e,r){const o=me(this.fieldsIndex,await He(this,Ze(this)));return Je(this.parsedUrl.path,this.attributeStorageInfo,e,r,o,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const o=await this.queryCachedAttributes(e,[r]);if(!o||o.length===0)throw new F("scenelayer:feature-not-in-cached-data","Feature not found in cached data");return new he({attributes:o[0],layer:this,sourceLayer:this})}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:this.associatedLayer!=null}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e!=null&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),this.associatedLayer==null)throw new F("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 F("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([i({readOnly:!0})],s.prototype,"parsedUrl",null),t([i({type:Me,readOnly:!0})],s.prototype,"nodePages",void 0),t([i({type:[Qe],readOnly:!0})],s.prototype,"materialDefinitions",void 0),t([i({type:[De],readOnly:!0})],s.prototype,"textureSetDefinitions",void 0),t([i({type:[Ke],readOnly:!0})],s.prototype,"geometryDefinitions",void 0),t([i({readOnly:!0})],s.prototype,"serviceUpdateTimeStamp",void 0),t([i({readOnly:!0})],s.prototype,"store",void 0),t([i({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],s.prototype,"rootNode",void 0),t([i({readOnly:!0})],s.prototype,"attributeStorageInfo",void 0),t([i(Z.fields)],s.prototype,"fields",void 0),t([i({readOnly:!0})],s.prototype,"fieldsIndex",null),t([i({readOnly:!0,type:oe})],s.prototype,"associatedLayer",void 0),t([I("service","associatedLayer",["associatedLayerID"])],s.prototype,"readAssociatedLayer",null),t([i(Z.outFields)],s.prototype,"outFields",void 0),t([i({type:String,readOnly:!0})],s.prototype,"objectIdField",null),t([i({readOnly:!0,type:String,json:{read:!1}})],s.prototype,"displayField",null),t([i({readOnly:!0,type:String})],s.prototype,"apiKey",null),t([i({readOnly:!0,type:String})],s.prototype,"customParameters",null),t([i({readOnly:!0,type:fe})],s.prototype,"fullExtent",null),t([i({readOnly:!0,type:re})],s.prototype,"spatialReference",null),t([i({readOnly:!0})],s.prototype,"version",null),t([i({readOnly:!0,type:Ve})],s.prototype,"elevationInfo",null),t([i({readOnly:!0,type:Number})],s.prototype,"minScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"maxScale",null),t([i({readOnly:!0,type:Number})],s.prototype,"effectiveScaleRange",null),t([i({type:["hide","show"],json:{write:!0}})],s.prototype,"listMode",void 0),t([i({types:Be,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],s.prototype,"renderer",void 0),t([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],s.prototype,"definitionExpression",void 0),t([i(Ee)],s.prototype,"popupEnabled",void 0),t([i({type:ge,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],s.prototype,"popupTemplate",void 0),t([i({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],s.prototype,"normalReferenceFrame",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"defaultPopupTemplate",null),t([i()],s.prototype,"types",null),t([i()],s.prototype,"typeIdField",null),t([i({json:{write:!1}}),ie(new ve({"3DObject":"3d-object",Point:"point"}))],s.prototype,"layerType",void 0),t([i()],s.prototype,"geometryType",null),t([i()],s.prototype,"profile",null),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"capabilities",null),t([i({readOnly:!0})],s.prototype,"statisticsInfo",void 0),s=t([p("esri.layers.buildingSublayers.BuildingComponentSublayer")],s);const q=s;var R;const G={type:v,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:ae}}},read:!1}};function ae(e,r,o){if(e&&Array.isArray(e))return new v(e.map(a=>{const l=st(a);if(l){const b=new l;return b.read(a,o),b}return o?.messages&&a&&o.messages.push(new Oe("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(a.type||"unknown")+"' are not supported",{definition:a,context:o})),null}))}let m=R=class extends se{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return Fe(this,e=>R.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}))}};function st(e){return e.layerType==="group"?m:q}t([i({type:["hide","show","hide-children"],json:{write:!0}})],m.prototype,"listMode",void 0),t([i(G)],m.prototype,"sublayers",void 0),m=R=t([p("esri.layers.buildingSublayers.BuildingGroupSublayer")],m),function(e){function r(o,a){o.forEach(l=>{a(l),l.type==="building-group"&&r(l.sublayers,a)})}e.sublayersProperty=G,e.readSublayers=ae,e.forEachSublayer=r}(m||(m={}));const g=m;let L=class extends h{constructor(){super(...arguments),this.type=null}};t([i({type:String,readOnly:!0,json:{write:!0}})],L.prototype,"type",void 0),L=t([p("esri.layers.support.BuildingFilterAuthoringInfo")],L);const ne=L;var N;let S=N=class extends h{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new N({filterType:this.filterType,filterValues:d(this.filterValues)})}};t([i({type:String,json:{write:!0}})],S.prototype,"filterType",void 0),t([i({type:[String],json:{write:!0}})],S.prototype,"filterValues",void 0),S=N=t([p("esri.layers.support.BuildingFilterAuthoringInfoType")],S);const at=S;var k;const nt=v.ofType(at);let T=k=class extends h{clone(){return new k({filterTypes:d(this.filterTypes)})}};t([i({type:nt,json:{write:!0}})],T.prototype,"filterTypes",void 0),T=k=t([p("esri.layers.support.BuildingFilterAuthoringInfoBlock")],T);const lt=T;var M;const pt=v.ofType(lt);let w=M=class extends ne{constructor(){super(...arguments),this.type="checkbox"}clone(){return new M({filterBlocks:d(this.filterBlocks)})}};t([i({type:["checkbox"]})],w.prototype,"type",void 0),t([i({type:pt,json:{write:!0}})],w.prototype,"filterBlocks",void 0),w=M=t([p("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],w);const W=w;let B=class extends h{};t([i({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),B=t([p("esri.layers.support.BuildingFilterMode")],B);const A=B;var Q;let E=Q=class extends A{constructor(){super(...arguments),this.type="solid"}clone(){return new Q}};t([i({type:["solid"],readOnly:!0,json:{write:!0}})],E.prototype,"type",void 0),E=Q=t([p("esri.layers.support.BuildingFilterModeSolid")],E);const D=E;var K;let O=K=class extends A{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new K({edges:d(this.edges)})}};t([ie({wireFrame:"wire-frame"})],O.prototype,"type",void 0),t([i(be)],O.prototype,"edges",void 0),O=K=t([p("esri.layers.support.BuildingFilterModeWireFrame")],O);const X=O;var C;let _=C=class extends A{constructor(){super(...arguments),this.type="x-ray"}clone(){return new C}};t([i({type:["x-ray"],readOnly:!0,json:{write:!0}})],_.prototype,"type",void 0),_=C=t([p("esri.layers.support.BuildingFilterModeXRay")],_);const z=_;var U;const yt={nonNullable:!0,types:{key:"type",base:A,typeMap:{solid:D,"wire-frame":X,"x-ray":z}},json:{read:e=>{switch(e?.type){case"solid":return D.fromJSON(e);case"wireFrame":return X.fromJSON(e);case"x-ray":return z.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let f=U=class extends h{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new D,this.title=""}clone(){return new U({filterExpression:this.filterExpression,filterMode:d(this.filterMode),title:this.title})}};t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"filterExpression",void 0),t([i(yt)],f.prototype,"filterMode",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"title",void 0),f=U=t([p("esri.layers.support.BuildingFilterBlock")],f);const ut=f;var V;const dt=v.ofType(ut);let c=V=class extends h{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=rt(),this.name=null}clone(){return new V({description:this.description,filterBlocks:d(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:d(this.filterAuthoringInfo)})}};t([i({type:String,json:{write:!0}})],c.prototype,"description",void 0),t([i({type:dt,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"filterBlocks",void 0),t([i({types:{key:"type",base:ne,typeMap:{checkbox:W}},json:{read:e=>e?.type==="checkbox"?W.fromJSON(e):null,write:!0}})],c.prototype,"filterAuthoringInfo",void 0),t([i({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"id",void 0),t([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],c.prototype,"name",void 0),c=V=t([p("esri.layers.support.BuildingFilter")],c);const ct=c;let u=class extends h{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([i({type:String})],u.prototype,"fieldName",void 0),t([i({type:String})],u.prototype,"modelName",void 0),t([i({type:String})],u.prototype,"label",void 0),t([i({type:Number})],u.prototype,"min",void 0),t([i({type:Number})],u.prototype,"max",void 0),t([i({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([i({type:[Number]})],u.prototype,"subLayerIds",void 0),u=t([p("esri.layers.support.BuildingSummaryStatistics.BuildingFieldStatistics")],u);let j=class extends Y.LoadableMixin(ee(h)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(x.getLogger(this).error("building summary statistics are not loaded"),null)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await te(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([i({constructOnly:!0,type:String})],j.prototype,"url",void 0),t([i({readOnly:!0,type:[u],json:{read:{source:"summary"}}})],j.prototype,"fields",null),j=t([p("esri.layers.support.BuildingSummaryStatistics")],j);const le=j,pe=v.ofType(ct),ye=d(g.sublayersProperty),$=ye.json?.origins;$&&($["web-scene"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},$["portal-item"]={type:[q],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}});let n=class extends ke(We(ze(Ye(et(Ie(Xe(Ge(Te)))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new je({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._allSublayerOverrides=null,this.filters=new pe,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.legendEnabled=!0,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e??{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,o){const a=g.readSublayers(e,r,o);return g.forEachSublayer(a,l=>l.layer=this),this._allSublayerOverrides&&(mt(a,this._allSublayerOverrides),this._allSublayerOverrides=null),a}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?ft(this.sublayers,e,r):this._allSublayerOverrides&>(this._allSublayerOverrides,e,r)),e}read(e,r){if(super.read(e,r),(r?.origin==="web-scene"||r?.origin==="portal-item")&&Array.isArray(e?.sublayers)){const o=ht(e.sublayers,r);this.sublayers?ue(this.sublayers,o):(this._allSublayerOverrides??=new Map,this._allSublayerOverrides.set(r.origin,o))}}readSummaryStatistics(e,r){if(typeof r.statisticsHRef=="string"){const o=Se(this.parsedUrl?.path,r.statisticsHRef);return new le({url:o})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=e!=null?e.signal:null,o=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(we).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(o),Promise.resolve(this)}loadAll(){return xe(this,e=>{g.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(J.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(J.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new F("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}async _fetchAssociatedFeatureService(e){try{const{portalItem:r}=await tt(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e});this.associatedFeatureServiceItem=r}catch(r){x.getLogger(this).warn("Associated feature service item could not be loaded",r)}}_validateElevationInfo(){const e=this.elevationInfo,r="Building scene layers";H(x.getLogger(this),it(r,"absolute-height",e)),H(x.getLogger(this),ot(r,e))}};function mt(e,r){r.forEach(o=>ue(e,o))}function ue(e,r){const{overrides:o,context:a}=r;g.forEachSublayer(e,l=>l.read(o.get(l.id),a))}function ht(e,r){const o=new Map;for(const a of e)a!=null&&typeof a=="object"&&typeof a.id=="number"?o.set(a.id,a):r.messages?.push(new F("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:a}));return{overrides:o,context:r}}function ft(e,r,o){const a=[];g.forEachSublayer(e,l=>{const b=l.write({},o);Object.keys(b).length>1&&a.push(b)}),a.length>0&&(r.sublayers=a)}function gt(e,r,o){const a=o?.origin&&e.get(o.origin);a&&(r.sublayers=[],a.overrides.forEach(l=>{r.sublayers.push(d(l))}))}t([i({type:["BuildingSceneLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({readOnly:!0})],n.prototype,"allSublayers",void 0),t([i(ye)],n.prototype,"sublayers",void 0),t([I("service","sublayers")],n.prototype,"readSublayers",null),t([i({type:pe,nonNullable:!0,json:{write:!0}})],n.prototype,"filters",void 0),t([i({type:String,json:{write:!0}})],n.prototype,"activeFilterId",void 0),t([i({readOnly:!0,type:le})],n.prototype,"summaryStatistics",void 0),t([I("summaryStatistics",["statisticsHRef"])],n.prototype,"readSummaryStatistics",null),t([i({type:[String],json:{read:!1}})],n.prototype,"outFields",void 0),t([i(_e)],n.prototype,"fullExtent",void 0),t([i(Ae)],n.prototype,"legendEnabled",void 0),t([i({type:["show","hide","hide-children"]})],n.prototype,"listMode",void 0),t([i(P(re))],n.prototype,"spatialReference",void 0),t([i($e)],n.prototype,"elevationInfo",null),t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i()],n.prototype,"associatedFeatureServiceItem",void 0),n=t([p("esri.layers.BuildingSceneLayer")],n);const Ei=n;export{Ei as default}; diff --git a/custom-toc-highlight/assets/Button-MQvwxOnj-CVmrxfGx.js b/custom-toc-highlight/assets/Button-MQvwxOnj-Bxdd1k4u.js similarity index 96% rename from custom-toc-highlight/assets/Button-MQvwxOnj-CVmrxfGx.js rename to custom-toc-highlight/assets/Button-MQvwxOnj-Bxdd1k4u.js index ca68ecea..948686c0 100644 --- a/custom-toc-highlight/assets/Button-MQvwxOnj-CVmrxfGx.js +++ b/custom-toc-highlight/assets/Button-MQvwxOnj-Bxdd1k4u.js @@ -1 +1 @@ -import{K as f,H as R,B as _,aw as b,ao as T,aq as g}from"./Theme-rblUnB2V-D2UsCNGl.js";class p extends f{_beforeChanged(){super._beforeChanged(),(this.isDirty("cornerRadiusTL")||this.isDirty("cornerRadiusTR")||this.isDirty("cornerRadiusBR")||this.isDirty("cornerRadiusBL"))&&(this._clear=!0)}_draw(){let s=this.width(),e=this.height(),t=s,i=e,c=t/Math.abs(s),l=i/Math.abs(e);if(_(t)&&_(i)){let d=Math.min(t,i)/2,r=b(this.get("cornerRadiusTL",8),d),n=b(this.get("cornerRadiusTR",8),d),o=b(this.get("cornerRadiusBR",8),d),h=b(this.get("cornerRadiusBL",8),d),u=Math.min(Math.abs(t/2),Math.abs(i/2));r=g(r,0,u),n=g(n,0,u),o=g(o,0,u),h=g(h,0,u);const a=this._display;a.moveTo(r*c,0),a.lineTo(t-n*c,0),n>0&&a.arcTo(t,0,t,n*l,n),a.lineTo(t,i-o*l),o>0&&a.arcTo(t,i,t-o*c,i,o),a.lineTo(h*c,i),h>0&&a.arcTo(0,i,0,i-h*l,h),a.lineTo(0,r*l),r>0&&a.arcTo(0,0,r*c,0,r),a.closePath()}}}Object.defineProperty(p,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RoundedRectangle"}),Object.defineProperty(p,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:f.classNames.concat([p.className])});class m extends R{_afterNew(){this._settings.themeTags=T(this._settings.themeTags,["button"]),super._afterNew(),this._settings.background||this.set("background",p.new(this._root,{themeTags:T(this._settings.themeTags,["background"])})),this.setPrivate("trustBounds",!0)}_prepareChildren(){if(super._prepareChildren(),this.isDirty("icon")){const s=this._prevSettings.icon,e=this.get("icon");e!==s&&(this._disposeProperty("icon"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.icon=e)}if(this.isDirty("label")){const s=this._prevSettings.label,e=this.get("label");e!==s&&(this._disposeProperty("label"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.label=e)}}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Button"}),Object.defineProperty(m,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:R.classNames.concat([m.className])});export{p as l,m}; +import{K as f,H as R,B as _,aw as b,ao as T,aq as g}from"./Theme-rblUnB2V-Dc7wtY6B.js";class p extends f{_beforeChanged(){super._beforeChanged(),(this.isDirty("cornerRadiusTL")||this.isDirty("cornerRadiusTR")||this.isDirty("cornerRadiusBR")||this.isDirty("cornerRadiusBL"))&&(this._clear=!0)}_draw(){let s=this.width(),e=this.height(),t=s,i=e,c=t/Math.abs(s),l=i/Math.abs(e);if(_(t)&&_(i)){let d=Math.min(t,i)/2,r=b(this.get("cornerRadiusTL",8),d),n=b(this.get("cornerRadiusTR",8),d),o=b(this.get("cornerRadiusBR",8),d),h=b(this.get("cornerRadiusBL",8),d),u=Math.min(Math.abs(t/2),Math.abs(i/2));r=g(r,0,u),n=g(n,0,u),o=g(o,0,u),h=g(h,0,u);const a=this._display;a.moveTo(r*c,0),a.lineTo(t-n*c,0),n>0&&a.arcTo(t,0,t,n*l,n),a.lineTo(t,i-o*l),o>0&&a.arcTo(t,i,t-o*c,i,o),a.lineTo(h*c,i),h>0&&a.arcTo(0,i,0,i-h*l,h),a.lineTo(0,r*l),r>0&&a.arcTo(0,0,r*c,0,r),a.closePath()}}}Object.defineProperty(p,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RoundedRectangle"}),Object.defineProperty(p,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:f.classNames.concat([p.className])});class m extends R{_afterNew(){this._settings.themeTags=T(this._settings.themeTags,["button"]),super._afterNew(),this._settings.background||this.set("background",p.new(this._root,{themeTags:T(this._settings.themeTags,["background"])})),this.setPrivate("trustBounds",!0)}_prepareChildren(){if(super._prepareChildren(),this.isDirty("icon")){const s=this._prevSettings.icon,e=this.get("icon");e!==s&&(this._disposeProperty("icon"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.icon=e)}if(this.isDirty("label")){const s=this._prevSettings.label,e=this.get("label");e!==s&&(this._disposeProperty("label"),s&&s.dispose(),e&&this.children.push(e),this._prevSettings.label=e)}}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Button"}),Object.defineProperty(m,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:R.classNames.concat([m.className])});export{p as l,m}; diff --git a/custom-toc-highlight/assets/CSVLayer-CJQy-BsL-BUdGsKHu.js b/custom-toc-highlight/assets/CSVLayer-CJQy-BsL-SmEBKuSE.js similarity index 66% rename from custom-toc-highlight/assets/CSVLayer-CJQy-BsL-BUdGsKHu.js rename to custom-toc-highlight/assets/CSVLayer-CJQy-BsL-SmEBKuSE.js index f0d0aff5..a2964ff0 100644 --- a/custom-toc-highlight/assets/CSVLayer-CJQy-BsL-BUdGsKHu.js +++ b/custom-toc-highlight/assets/CSVLayer-CJQy-BsL-SmEBKuSE.js @@ -1 +1 @@ -import{v as i,S as r,i as d,a0 as v,jy as w,cS as S,aB as O,bp as F,n as b,K as q,J as I,W as N,a as _,o as c}from"./story-BfX8CRfG.js";import J from"./FeatureLayer-BrRKw5Si-D6Z5CL70.js";import{q as C}from"./workers-PiCjreoO-idkDTJa3.js";import{O as P}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{$ as j}from"./clientSideDefaults-BqqayPct-B-0mBem3.js";import{b as l}from"./Query-BrwMGK8U-DoFNfkjX.js";import"./main-ugzBrWNm.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import"./Relationship-PyhUibYK-BgFx3_5x.js";import"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./editsZScale-BDsX6vv--CttUpViY.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import"./ArcGISService-BYA-y6X6-C_YhndKK.js";import"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import"./EditBusLayer-Df29OyJh-DkVkxUAl.js";import"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./PortalLayer-CElnYuSQ-DvpreqYV.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import"./FeatureType-C9hJmS6_-BXWT6QCe.js";import"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import"./versionUtils-LZYZz-38-DxOZEoAg.js";import"./styleUtils-ChrJTYIw-BfDrXrWd.js";import"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";let n=class extends O{constructor(t){super(t),this.type="csv",this.refresh=F(async e=>{await this.load();const{extent:s,timeExtent:a}=await this._connection.invoke("refresh",e);return s&&(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(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this._startWorker(e)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(t,e={}){await this.load(e);const s=await this._connection.invoke("queryFeatures",t?t.toJSON():null,e);return P.fromJSON(s)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._connection.invoke("queryFeatures",t?t.toJSON():null,e)}async queryFeatureCount(t,e={}){return await this.load(e),this._connection.invoke("queryFeatureCount",t?t.toJSON():null,e)}async queryObjectIds(t,e={}){return await this.load(e),this._connection.invoke("queryObjectIds",t?t.toJSON():null,e)}async queryExtent(t,e={}){await this.load(e);const s=await this._connection.invoke("queryExtent",t?t.toJSON():null,e);return{count:s.count,extent:b.fromJSON(s.extent)}}async querySnapping(t,e={}){return await this.load(e),this._connection.invoke("querySnapping",t,e)}async _startWorker(t){this._connection=await C("CSVSourceWorker",{strategy:q("feature-layers-workers")?"dedicated":"local",signal:t,registryTarget:this});const{url:e,delimiter:s,fields:a,latitudeField:m,longitudeField:h,spatialReference:y,timeInfo:f}=this.loadOptions,p=await this._connection.invoke("load",{url:e,customParameters:this.customParameters,parsingOptions:{delimiter:s,fields:a?.map(g=>g.toJSON()),latitudeField:m,longitudeField:h,spatialReference:y?.toJSON(),timeInfo:f?.toJSON()}},{signal:t});this.locationInfo=p.locationInfo,this.sourceJSON=p.layerDefinition,this.delimiter=p.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([d("esri.layers.graphics.sources.CSVSource")],n);function u(t,e){throw new c(e,`CSVLayer (title: ${t.title}, id: ${t.id}) cannot be saved to a portal item`)}let o=class extends J{constructor(...t){super(...t),this.geometryType="point",this.capabilities=j(!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=I.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null,s=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},t).catch(N).then(async()=>this.initLayerProperties(await this.createGraphicsSource(e)));return this.addResolvingPromise(s),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(t,e){return e.showLabels!=null?e.showLabels:!!e.layerDefinition?.drawingInfo?.labelingInfo}set url(t){if(!t)return void this._set("url",t);const e=_(t);this._set("url",e.path),e.query&&(this.customParameters={...this.customParameters,...e.query})}async createGraphicsSource(t){const e=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",e),await e.load({signal:t}),this.read({locationInfo:e.locationInfo,columnDelimiter:e.delimiter},{origin:"service",url:this.parsedUrl}),e}queryFeatures(t,e){return this.load().then(()=>this.source.queryFeatures(l.from(t)||this.createQuery())).then(s=>{if(s?.features)for(const a of s.features)a.layer=a.sourceLayer=this;return s})}queryObjectIds(t,e){return this.load().then(()=>this.source.queryObjectIds(l.from(t)||this.createQuery()))}queryFeatureCount(t,e){return this.load().then(()=>this.source.queryFeatureCount(l.from(t)||this.createQuery()))}queryExtent(t,e){return this.load().then(()=>this.source.queryExtent(l.from(t)||this.createQuery()))}read(t,e){super.read(t,e),e&&e.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(t,e){return super.write(t,{...e,writeLayerSchema:!0})}clone(){throw new c("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(t){return u(this,"csv-layer:save")}async saveAs(t,e){return u(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:t,updates:e}=await this.source.refresh(this.customParameters);return e!=null&&this.read(e,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),t}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([v("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:w,write:{isRequired:!0,ignoreOrigin:!0,writer:S}}})],o.prototype,"url",null),o=i([d("esri.layers.CSVLayer")],o);const de=o;export{de as default}; +import{v as i,S as r,i as d,a0 as v,jy as w,cS as S,aB as O,bp as F,n as b,K as q,J as I,W as N,a as _,o as c}from"./story-Doly9N9p.js";import J from"./FeatureLayer-BrRKw5Si-DuA2fyE_.js";import{q as C}from"./workers-PiCjreoO-Dc6Tqm-o.js";import{O as P}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{$ as j}from"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import{b as l}from"./Query-BrwMGK8U-BPr0_G9t.js";import"./main-QGPoLsvl.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./editsZScale-BDsX6vv--C-4n90TZ.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import"./EditBusLayer-Df29OyJh-OmdJOLws.js";import"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import"./FeatureType-C9hJmS6_-CNlvn5D1.js";import"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import"./versionUtils-LZYZz-38-B8C5OAjF.js";import"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";let n=class extends O{constructor(t){super(t),this.type="csv",this.refresh=F(async e=>{await this.load();const{extent:s,timeExtent:a}=await this._connection.invoke("refresh",e);return s&&(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(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this._startWorker(e)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(t,e={}){await this.load(e);const s=await this._connection.invoke("queryFeatures",t?t.toJSON():null,e);return P.fromJSON(s)}async queryFeaturesJSON(t,e={}){return await this.load(e),this._connection.invoke("queryFeatures",t?t.toJSON():null,e)}async queryFeatureCount(t,e={}){return await this.load(e),this._connection.invoke("queryFeatureCount",t?t.toJSON():null,e)}async queryObjectIds(t,e={}){return await this.load(e),this._connection.invoke("queryObjectIds",t?t.toJSON():null,e)}async queryExtent(t,e={}){await this.load(e);const s=await this._connection.invoke("queryExtent",t?t.toJSON():null,e);return{count:s.count,extent:b.fromJSON(s.extent)}}async querySnapping(t,e={}){return await this.load(e),this._connection.invoke("querySnapping",t,e)}async _startWorker(t){this._connection=await C("CSVSourceWorker",{strategy:q("feature-layers-workers")?"dedicated":"local",signal:t,registryTarget:this});const{url:e,delimiter:s,fields:a,latitudeField:m,longitudeField:h,spatialReference:y,timeInfo:f}=this.loadOptions,p=await this._connection.invoke("load",{url:e,customParameters:this.customParameters,parsingOptions:{delimiter:s,fields:a?.map(g=>g.toJSON()),latitudeField:m,longitudeField:h,spatialReference:y?.toJSON(),timeInfo:f?.toJSON()}},{signal:t});this.locationInfo=p.locationInfo,this.sourceJSON=p.layerDefinition,this.delimiter=p.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([d("esri.layers.graphics.sources.CSVSource")],n);function u(t,e){throw new c(e,`CSVLayer (title: ${t.title}, id: ${t.id}) cannot be saved to a portal item`)}let o=class extends J{constructor(...t){super(...t),this.geometryType="point",this.capabilities=j(!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=I.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null,s=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},t).catch(N).then(async()=>this.initLayerProperties(await this.createGraphicsSource(e)));return this.addResolvingPromise(s),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(t,e){return e.showLabels!=null?e.showLabels:!!e.layerDefinition?.drawingInfo?.labelingInfo}set url(t){if(!t)return void this._set("url",t);const e=_(t);this._set("url",e.path),e.query&&(this.customParameters={...this.customParameters,...e.query})}async createGraphicsSource(t){const e=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField??void 0,longitudeField:this.longitudeField??void 0,spatialReference:this.spatialReference??void 0,timeInfo:this.timeInfo??void 0,url:this.url},customParameters:this.customParameters??void 0});return this._set("source",e),await e.load({signal:t}),this.read({locationInfo:e.locationInfo,columnDelimiter:e.delimiter},{origin:"service",url:this.parsedUrl}),e}queryFeatures(t,e){return this.load().then(()=>this.source.queryFeatures(l.from(t)||this.createQuery())).then(s=>{if(s?.features)for(const a of s.features)a.layer=a.sourceLayer=this;return s})}queryObjectIds(t,e){return this.load().then(()=>this.source.queryObjectIds(l.from(t)||this.createQuery()))}queryFeatureCount(t,e){return this.load().then(()=>this.source.queryFeatureCount(l.from(t)||this.createQuery()))}queryExtent(t,e){return this.load().then(()=>this.source.queryExtent(l.from(t)||this.createQuery()))}read(t,e){super.read(t,e),e&&e.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(t,e){return super.write(t,{...e,writeLayerSchema:!0})}clone(){throw new c("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(t){return u(this,"csv-layer:save")}async saveAs(t,e){return u(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:t,updates:e}=await this.source.refresh(this.customParameters);return e!=null&&this.read(e,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),t}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([v("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:w,write:{isRequired:!0,ignoreOrigin:!0,writer:S}}})],o.prototype,"url",null),o=i([d("esri.layers.CSVLayer")],o);const de=o;export{de as default}; diff --git a/custom-toc-highlight/assets/CSVSourceWorker-Bks0IzRc-Bvmv8LHM.js b/custom-toc-highlight/assets/CSVSourceWorker-Bks0IzRc-Se00vRoI.js similarity index 83% rename from custom-toc-highlight/assets/CSVSourceWorker-Bks0IzRc-Bvmv8LHM.js rename to custom-toc-highlight/assets/CSVSourceWorker-Bks0IzRc-Se00vRoI.js index db6c2541..74fb8e57 100644 --- a/custom-toc-highlight/assets/CSVSourceWorker-Bks0IzRc-Bvmv8LHM.js +++ b/custom-toc-highlight/assets/CSVSourceWorker-Bks0IzRc-Se00vRoI.js @@ -1,4 +1,4 @@ -import{o as F,ay as j,aU as V,a1 as L,a as P,f as R,cl as T,ck as $,aC as A,dd as G,eM as M,J as Q,eS as Y,gK as Z,cp as I,gT as J}from"./story-BfX8CRfG.js";import{h as B,b as U}from"./date-Cqvy-TgA-DIf-QFLz.js";import{O as z}from"./projection-BA9M1R7d-BYoCXVXt.js";import{a as H}from"./json-BI97KiBB-Ce5cWfI2.js";import{i as K,c as W}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{I as X}from"./FeatureStore-Co2V0sVE-BwnfsIjJ.js";import{f as ee}from"./queryUtils-Brxu6254-PPvpiP5X.js";import{Z as te}from"./QueryEngine-CH5uUhZK-BP95Dm56.js";import{N as ie}from"./number-eRKYXfX9-eI8aiR_7.js";import{f as ne,d as re}from"./clientSideDefaults-BqqayPct-B-0mBem3.js";import{o as _}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./main-ugzBrWNm.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-BnCtocGj.js";import"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./WhereClause-DxwoyBMS-DnXKVpm2.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./utils-HtkT8Fn3-wUwu1nm1.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-BQ5pghrp.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./utils-tNxq3jkf-B78XlSIE.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";function oe(o,i,e){i=I(i)?.toLowerCase(),e=I(e)?.toLowerCase();const t=o.map(s=>s.toLowerCase()),n=i?o[t.indexOf(i)]:null,a=e?o[t.indexOf(e)]:null;return{longitudeFieldName:n||o[t.indexOf(ae.find(s=>t.includes(s)))],latitudeFieldName:a||o[t.indexOf(se.find(s=>t.includes(s)))]}}const se=["lat","lat83","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],ae=["lon","lng","lng83","long","long83","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"],b=/^\s*"([\S\s]*)"\s*$/,E=/""/g,S=` +import{o as F,ay as j,aU as V,a1 as L,a as P,f as R,cl as T,ck as $,aC as A,dd as G,eM as M,J as Q,eS as Y,gK as Z,cp as I,gT as J}from"./story-Doly9N9p.js";import{h as B,b as U}from"./date-Cqvy-TgA-DIf-QFLz.js";import{O as z}from"./projection-BA9M1R7d-CAbqHZiw.js";import{a as H}from"./json-BI97KiBB-Ce5cWfI2.js";import{i as K,c as W}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{I as X}from"./FeatureStore-Co2V0sVE-BK6XAR3o.js";import{f as ee}from"./queryUtils-Brxu6254-CDiE0zms.js";import{Z as te}from"./QueryEngine-CH5uUhZK-DRGPyg2C.js";import{N as ie}from"./number-eRKYXfX9-bCdnHRN-.js";import{f as ne,d as re}from"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import{o as _}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./main-QGPoLsvl.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-CQrhMeDa.js";import"./PooledRBush-DbfAmeLn-CPHfm9op.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./utils-HtkT8Fn3-Dd_0rdy5.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-1ITtOELE.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./utils-tNxq3jkf-nfQcZo7O.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";function oe(o,i,e){i=I(i)?.toLowerCase(),e=I(e)?.toLowerCase();const t=o.map(s=>s.toLowerCase()),n=i?o[t.indexOf(i)]:null,a=e?o[t.indexOf(e)]:null;return{longitudeFieldName:n||o[t.indexOf(ae.find(s=>t.includes(s)))],latitudeFieldName:a||o[t.indexOf(se.find(s=>t.includes(s)))]}}const se=["lat","lat83","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],ae=["lon","lng","lng83","long","long83","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"],b=/^\s*"([\S\s]*)"\s*$/,E=/""/g,S=` `,le=[","," ",";","|"," "];function*O(o,i,e){let t=0;for(;t<=o.length;){const n=o.indexOf(i,t),a=o.slice(t,n>-1?n:void 0);t+=a.length+i.length,e&&!a.trim()||(yield a)}}function C(o){const i=o.includes(`\r `)?`\r `:S;return O(o,i,!0)}function q(o,i){return O(o,i,!1)}function ce(o,i,e){o=o.trim(),i=i?.trim();const t=[],n=Array.from(new Set([e?.delimiter,...le])).filter(s=>s!=null);for(const s of n){const l=N(o,s).length,c=N(i,s).length??l;l>1&&t.push({weight:Math.min(l,c),delimiter:s})}const a=t.sort(({weight:s},{weight:l})=>l-s).map(({delimiter:s})=>s);for(const s of a){const l=k(o,s).names,c=oe(l,e?.longitudeField,e?.latitudeField);if(c.longitudeFieldName&&c.latitudeFieldName)return{delimiter:s,locationInfo:c}}return{delimiter:a[0],locationInfo:null}}function*v(o,i,e,t=()=>Object.create(null)){const n=C(o);n.next();let a="",s="",l=0,c=t(),d=0;e:for(const y of n){const f=q(y,e);for(const p of f)if(a+=s+p,s="",l+=D(p),l%2==0){if(l>0){const h=b.exec(a);if(!h){c=t(),d=0,a="",l=0;continue e}c[i[d]]=h[1].replaceAll(E,'"'),d++}else c[i[d]]=a,d++;a="",l=0}else s=e;l===0?(yield c,c=t(),d=0):s=S}}function k(o,i){const e=N(o,i).filter(n=>n!=null),t=e.map(n=>I(n));for(let n=t.length-1;n>=0;n--)t[n]||(t.splice(n,1),e.splice(n,1));return{names:t,aliases:e}}function N(o,i){if(!o?.length)return[];const e=[];let t="",n="",a=0;const s=q(o,i);for(const l of s)if(t+=n+l,n="",a+=D(l),a%2==0){if(a>0){const c=b.exec(t);c&&e.push(c[1].replaceAll(E,'"'))}else e.push(t);t="",a=0}else n=i;return e}function D(o){let i=0,e=0;for(e=o.indexOf('"',e);e>=0;)i++,e=o.indexOf('"',e+1);return i}function ue(o,i,e,t,n){const a=[],s=v(o,e,i),l=[];for(const c of s){if(l.length===10)break;l.push(c)}for(let c=0;cp[d]))){case"integer":f="esriFieldTypeInteger";break;case"double":f="esriFieldTypeDouble";break;case"date":f="esriFieldTypeDate";break;default:f="esriFieldTypeString"}a.push({name:d,type:f,alias:y,length:J(f)})}}return a}function de(o){if(!o.length)return"string";const i=/[^+\-.,0-9]/;return o.map(e=>{if(e!==""){if(!i.test(e)){let t=w(e);if(!isNaN(t))return/[.,]/.test(e)||!Number.isInteger(t)||t>214783647||t<-214783648?"double":"integer";if(e.includes("E")&&(t=Number(e),!Number.isNaN(t)||e.includes(",")&&(e=e.replace(",","."),t=Number(e),!Number.isNaN(t))))return"double"}return U(e)?"date":"string"}}).reduce((e,t)=>e===void 0?t:t===void 0?e:e===t?t:e==="string"||t==="string"?"string":e==="double"||t==="double"?"double":void 0)}const w=function(){const o=ie(),i=new RegExp("^"+o.regexp+"$"),e=new RegExp("["+o.group+"\\s\\xa0]","g"),t=o.factor;return n=>{const a=i.exec(n);if(o.factor=t,!a)return NaN;let s=a[1];if(!a[1]){if(!a[2])return NaN;s=a[2],o.factor*=-1}return s=s.replace(e,"").replace(o.decimal,"."),+s*o.factor}}();function me(o){return JSON.parse(JSON.stringify(o))}const fe=re("esriGeometryPoint"),pe=["csv"],he=[0,0];class ye{constructor(i,e){this.x=i,this.y=e}}class ft{constructor(){this._queryEngine=null,this._snapshotFeatures=async i=>{const e=await this._fetch(i);return this._createFeatures(e)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(i,e={}){this._loadOptions=i;const[t]=await Promise.all([this._fetch(e.signal),this._checkProjection(i?.parsingOptions?.spatialReference)]),n=ge(t,i);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const a=await this._createFeatures(t);this._queryEngine.featureStore.addMany(a);const{fullExtent:s,timeExtent:l}=await this._queryEngine.fetchRecomputedExtents();if(n.layerDefinition.extent=s,l){const{start:c,end:d}=l;n.layerDefinition.timeInfo.timeExtent=[c,d]}return n}async applyEdits(){throw new F("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(i,e.signal)}async queryFeatureCount(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(i,e.signal)}async queryObjectIds(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(i,e.signal)}async queryExtent(i={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(i,e.signal)}async querySnapping(i,e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(i,e.signal)}async refresh(i){this._loadOptions.customParameters=i,this._snapshotTask?.abort(),this._snapshotTask=j(this._snapshotFeatures),this._snapshotTask.promise.then(n=>{this._queryEngine.featureStore.clear(),n&&this._queryEngine.featureStore.addMany(n)},n=>{this._queryEngine.featureStore.clear(),V(n)||L.getLogger("esri.layers.CSVLayer").error(new F("csv-layer:refresh","An error occurred during refresh",{error:n}))}),await this._waitSnapshotComplete();const{fullExtent:e,timeExtent:t}=await this._queryEngine.fetchRecomputedExtents();return{extent:e,timeExtent:t}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(i){const{url:e,customParameters:t}=this._loadOptions;if(!e)throw new F("csv-layer:invalid-source","url not defined");const n=P(e);return(await R(n.path,{query:{...n.query,...t},responseType:"text",signal:i})).data}_createQueryEngine(i){const{objectIdField:e,fields:t,extent:n,timeInfo:a}=i.layerDefinition,s=new X({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new te({fieldsIndex:_.fromLayerJSON({fields:t,dateFieldsTimeReference:{timeZoneIANA:T}}),geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:a,objectIdField:e,spatialReference:n.spatialReference||{wkid:4326},featureStore:s})}async _createFeatures(i){const{latitudeFieldName:e,longitudeFieldName:t}=this._locationInfo,{objectIdField:n,fieldsIndex:a,spatialReference:s}=this._queryEngine;let l=[];const c=[],d=a.fields.filter(r=>r.name!==n).map(r=>r.name);let y=0;const f={};for(const r of a.fields)if(r.type!=="esriFieldTypeOID"&&r.type!=="esriFieldTypeGlobalID"){const u=$(r);u!==void 0&&(f[r.name]=u)}const p=v(i,d,this._delimiter,ne(f,n));for(const r of p){const u=this._parseCoordinateValue(r[e]),g=this._parseCoordinateValue(r[t]);if(g!=null&&u!=null&&!isNaN(u)&&!isNaN(g)){r[e]=u,r[t]=g;for(const m in r)if(m!==e&&m!==t)if(a.isDateField(m))r[m]=B(r[m]);else if(a.isNumericField(m)){const x=w(r[m]);isNaN(x)?r[m]=null:r[m]=x}else r[m]!=null&&(r[m]=me(r[m]));r[n]=y,y++,l.push(new ye(g,u)),c.push(r)}}if(!A({wkid:4326},s))if(G(s))for(const r of l)[r.x,r.y]=M(r.x,r.y,he);else l=z(H,l,Q.WGS84,s,null,null);const h=[];for(let r=0;r181)&&(e=parseFloat(i)),e}async _checkProjection(i){try{await ee(Y,i)}catch{throw new F("csv-layer:projection-not-supported","Projection not supported")}}}function ge(o,i){const e=i.parsingOptions||{},t={delimiter:e.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:e.latitudeField,longitudeFieldName:e.longitudeField}},n=t.layerDefinition={name:Z(i.url,pe)||"csv",dateFieldsTimeReference:{timeZoneIANA:T},drawingInfo:fe,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:4326}}},a=C(o),s=a.next().value?.trim(),l=a.next().value?.trim();if(!s)throw new F("csv-layer:empty-csv","CSV is empty",{csv:o});const{delimiter:c,locationInfo:d}=ce(s,l,e);if(!c)throw new F("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:s,secondLine:l,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:s,secondLine:l,parsingOptions:e});t.locationInfo=d,t.delimiter=c;const{names:y,aliases:f}=k(s,c),p=ue(o,t.delimiter,y,f,t.locationInfo);if(e.fields?.length){const r=new _(e.fields);for(const u of p){const g=r.get(u.name);g&&Object.assign(u,g)}}if(!p.some(r=>r.type==="esriFieldTypeOID"&&(n.objectIdField=r.name,!0))){const r={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=r.name,p.unshift(r)}n.fields=p;const h=new _(n.fields);if(t.locationInfo&&(t.locationInfo.latitudeFieldName=h.get(t.locationInfo.latitudeFieldName).name,t.locationInfo.longitudeFieldName=h.get(t.locationInfo.longitudeFieldName).name),n.timeInfo){const r=n.timeInfo;if(r.startTimeField){const u=h.get(r.startTimeField);u?(r.startTimeField=u.name,u.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const u=h.get(r.endTimeField);u?(r.endTimeField=u.name,u.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const u=h.get(r.trackIdField);r.trackIdField=u?u.name:null}r.startTimeField||r.endTimeField||(n.timeInfo=null)}return t}export{ft as default}; diff --git a/custom-toc-highlight/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-CFkeOMDr.js b/custom-toc-highlight/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-BH_FQvA5.js similarity index 58% rename from custom-toc-highlight/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-CFkeOMDr.js rename to custom-toc-highlight/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-BH_FQvA5.js index cb3e14b3..69b2fc1b 100644 --- a/custom-toc-highlight/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-CFkeOMDr.js +++ b/custom-toc-highlight/assets/CatalogDynamicGroupLayerView2D-Cf-H7gda-BH_FQvA5.js @@ -1 +1 @@ -import{ag as f,v as i,i as V,S as a,bp as F,bo as C,a2 as U,b9 as H,a1 as _,bV as w}from"./story-BfX8CRfG.js";import{X as x,Y as I}from"./LayerView-Bish-E63-rB2WUWF4.js";import"./main-ugzBrWNm.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";const y=Symbol(),O=n=>{let e=class extends n{constructor(){super(...arguments),this.layerViews=new f,this._debouncedUpdate=F(async()=>{const{layer:r,parent:o}=this,s=o?.footprintLayerView;let p=[];const d=this._createQuery();if(d&&s){const{features:h}=await s.queryFeatures(d);this.suspended||(p=h.map(u=>r.acquireLayer(u)))}this.removeHandles(y),this.addHandles(p,y)})}get creatingLayerViews(){return this.view?.layerViewManager.isCreatingLayerViewsForLayer(this.layer)??!1}isUpdating(){return this.creatingLayerViews||this.layer.updating||this.layerViews.some(r=>r.updating)}enableLayerUpdates(){return C([this._updatingHandles.addWhen(()=>this.parent?.footprintLayerView?.dataUpdating===!1,()=>this.updateLayers()),this._updatingHandles.add(()=>[this.layer.maximumVisibleSublayers,this.layer.parent?.orderBy,this.parent?.footprintLayerView?.filter,this.parent?.footprintLayerView?.timeExtent,this.suspended],()=>this.updateLayers()),U(()=>this.removeHandles(y))])}updateLayers(){this.suspended?this.removeHandles(y):this._updatingHandles.addPromise(H(this._debouncedUpdate()).catch(r=>{_.getLogger(this).error(r)}))}_createQuery(){const r=this.parent?.footprintLayerView,o=this.layer?.parent;if(!r||!o||o.destroyed)return null;const{layer:{maximumVisibleSublayers:s},view:{scale:p}}=this;if(!s)return null;const{itemTypeField:d,itemSourceField:h,itemNameField:u,minScaleField:c,maxScaleField:L,objectIdField:v,orderBy:S}=o,$=w(`${c} IS NULL OR ${p} <= ${c} OR ${c} = 0`,`${L} IS NULL OR ${p} >= ${L}`),m=S?.find(l=>l.field&&!l.valueExpression),t=r.createQuery();if(t.returnGeometry=!1,t.num=s,t.outFields=[v,h,u],t.where=w(t.where,$),this.unsupportedItemTypes!=null){const l=`${d} NOT IN (${this.unsupportedItemTypes.map(b=>`'${b}'`)})`;t.where=w(t.where,l)}return m?.field&&(t.orderByFields=[`${m.field} ${m.order==="descending"?"DESC":"ASC"}`],t.outFields.push(m.field)),t}};return i([a({readOnly:!0})],e.prototype,"creatingLayerViews",null),i([a()],e.prototype,"layer",void 0),i([a()],e.prototype,"layerViews",void 0),i([a({readOnly:!0})],e.prototype,"unsupportedItemTypes",void 0),i([a()],e.prototype,"parent",void 0),i([a({readOnly:!0})],e.prototype,"isUpdating",null),e=i([V("esri.views.layers.CatalogDynamicGroupLayerView")],e),e};let g=class extends O(x(I)){constructor(){super(...arguments),this.unsupportedItemTypes=["Scene Service"],this.layerViews=new f}attach(){this.addAttachHandles([this.layerViews.on("after-changes",()=>this._updateStageChildren()),this.enableLayerUpdates()])}detach(){this.container.removeAllChildren()}update(n){this.updateLayers()}viewChange(){}moveEnd(){this.requestUpdate()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((n,e)=>this.container.addChildAt(n.container,e))}};g=i([V("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],g);const Be=g;export{Be as default}; +import{ag as f,v as i,i as V,S as a,bp as F,bo as C,a2 as U,b9 as H,a1 as _,bV as w}from"./story-Doly9N9p.js";import{X as x,Y as I}from"./LayerView-Bish-E63-DK1SFHE3.js";import"./main-QGPoLsvl.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";const y=Symbol(),O=n=>{let e=class extends n{constructor(){super(...arguments),this.layerViews=new f,this._debouncedUpdate=F(async()=>{const{layer:r,parent:o}=this,s=o?.footprintLayerView;let p=[];const d=this._createQuery();if(d&&s){const{features:h}=await s.queryFeatures(d);this.suspended||(p=h.map(u=>r.acquireLayer(u)))}this.removeHandles(y),this.addHandles(p,y)})}get creatingLayerViews(){return this.view?.layerViewManager.isCreatingLayerViewsForLayer(this.layer)??!1}isUpdating(){return this.creatingLayerViews||this.layer.updating||this.layerViews.some(r=>r.updating)}enableLayerUpdates(){return C([this._updatingHandles.addWhen(()=>this.parent?.footprintLayerView?.dataUpdating===!1,()=>this.updateLayers()),this._updatingHandles.add(()=>[this.layer.maximumVisibleSublayers,this.layer.parent?.orderBy,this.parent?.footprintLayerView?.filter,this.parent?.footprintLayerView?.timeExtent,this.suspended],()=>this.updateLayers()),U(()=>this.removeHandles(y))])}updateLayers(){this.suspended?this.removeHandles(y):this._updatingHandles.addPromise(H(this._debouncedUpdate()).catch(r=>{_.getLogger(this).error(r)}))}_createQuery(){const r=this.parent?.footprintLayerView,o=this.layer?.parent;if(!r||!o||o.destroyed)return null;const{layer:{maximumVisibleSublayers:s},view:{scale:p}}=this;if(!s)return null;const{itemTypeField:d,itemSourceField:h,itemNameField:u,minScaleField:c,maxScaleField:L,objectIdField:v,orderBy:S}=o,$=w(`${c} IS NULL OR ${p} <= ${c} OR ${c} = 0`,`${L} IS NULL OR ${p} >= ${L}`),m=S?.find(l=>l.field&&!l.valueExpression),t=r.createQuery();if(t.returnGeometry=!1,t.num=s,t.outFields=[v,h,u],t.where=w(t.where,$),this.unsupportedItemTypes!=null){const l=`${d} NOT IN (${this.unsupportedItemTypes.map(b=>`'${b}'`)})`;t.where=w(t.where,l)}return m?.field&&(t.orderByFields=[`${m.field} ${m.order==="descending"?"DESC":"ASC"}`],t.outFields.push(m.field)),t}};return i([a({readOnly:!0})],e.prototype,"creatingLayerViews",null),i([a()],e.prototype,"layer",void 0),i([a()],e.prototype,"layerViews",void 0),i([a({readOnly:!0})],e.prototype,"unsupportedItemTypes",void 0),i([a()],e.prototype,"parent",void 0),i([a({readOnly:!0})],e.prototype,"isUpdating",null),e=i([V("esri.views.layers.CatalogDynamicGroupLayerView")],e),e};let g=class extends O(x(I)){constructor(){super(...arguments),this.unsupportedItemTypes=["Scene Service"],this.layerViews=new f}attach(){this.addAttachHandles([this.layerViews.on("after-changes",()=>this._updateStageChildren()),this.enableLayerUpdates()])}detach(){this.container.removeAllChildren()}update(n){this.updateLayers()}viewChange(){}moveEnd(){this.requestUpdate()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((n,e)=>this.container.addChildAt(n.container,e))}};g=i([V("esri.views.2d.layers.CatalogDynamicGroupLayerView2D")],g);const Be=g;export{Be as default}; diff --git a/custom-toc-highlight/assets/CatalogFootprintLayerView2D-C0bBWVdF-CXy1ArWp.js b/custom-toc-highlight/assets/CatalogFootprintLayerView2D-C0bBWVdF-CXy1ArWp.js new file mode 100644 index 00000000..22f86808 --- /dev/null +++ b/custom-toc-highlight/assets/CatalogFootprintLayerView2D-C0bBWVdF-CXy1ArWp.js @@ -0,0 +1 @@ +import{v as r,i as m,S as p}from"./story-Doly9N9p.js";import{r as s}from"./FeatureLayerView2D-NmRd_IhT-DLbw0NYz.js";import"./main-QGPoLsvl.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./timeSupport-ohWmWReZ-D2lpSlXU.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./LayerView-Bish-E63-DK1SFHE3.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./SDFHelper-B6k8Ig6R-CgiA_-9V.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-BYG2KoFf.js";import"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";const a=e=>{let t=class extends e{constructor(...o){super(...o)}get updateSuspended(){const o=this.parent?.dynamicGroupLayerView;return this.suspended&&(!o||o.suspended===!0)}};return r([p()],t.prototype,"layer",void 0),r([p()],t.prototype,"parent",void 0),r([p()],t.prototype,"updateSuspended",null),t=r([m("esri.views.layers.CatalogFootprintLayerView")],t),t};let i=class extends a(s){};i=r([m("esri.views.2d.layers.CatalogFootprintLayerView2D")],i);const ar=i;export{ar as default}; diff --git a/custom-toc-highlight/assets/CatalogFootprintLayerView2D-C0bBWVdF-CeR3Mj-n.js b/custom-toc-highlight/assets/CatalogFootprintLayerView2D-C0bBWVdF-CeR3Mj-n.js deleted file mode 100644 index 927a4472..00000000 --- a/custom-toc-highlight/assets/CatalogFootprintLayerView2D-C0bBWVdF-CeR3Mj-n.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r,i as m,S as p}from"./story-BfX8CRfG.js";import{r as s}from"./FeatureLayerView2D-NmRd_IhT-CufQiRFK.js";import"./main-ugzBrWNm.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./timeSupport-ohWmWReZ-ByDHlqgT.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./LayerView-Bish-E63-rB2WUWF4.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./SDFHelper-B6k8Ig6R-BNeqNf2Z.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-DAL58cHP.js";import"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";const a=e=>{let t=class extends e{constructor(...o){super(...o)}get updateSuspended(){const o=this.parent?.dynamicGroupLayerView;return this.suspended&&(!o||o.suspended===!0)}};return r([p()],t.prototype,"layer",void 0),r([p()],t.prototype,"parent",void 0),r([p()],t.prototype,"updateSuspended",null),t=r([m("esri.views.layers.CatalogFootprintLayerView")],t),t};let i=class extends a(s){};i=r([m("esri.views.2d.layers.CatalogFootprintLayerView2D")],i);const ar=i;export{ar as default}; diff --git a/custom-toc-highlight/assets/CatalogLayer-BeO1fLsl-idS3vnNO.js b/custom-toc-highlight/assets/CatalogLayer-BeO1fLsl-B5ozPHOs.js similarity index 79% rename from custom-toc-highlight/assets/CatalogLayer-BeO1fLsl-idS3vnNO.js rename to custom-toc-highlight/assets/CatalogLayer-BeO1fLsl-B5ozPHOs.js index 0d2bd0f1..6b705618 100644 --- a/custom-toc-highlight/assets/CatalogLayer-BeO1fLsl-idS3vnNO.js +++ b/custom-toc-highlight/assets/CatalogLayer-BeO1fLsl-B5ozPHOs.js @@ -1 +1 @@ -import{ag as q,ah as Q,aT as A,a2 as S,an as R,v as t,S as r,bB as D,i as w,bT as L,P as g,bL as U,bP as Z,W as M,o as f,a as G,bX as N,f as k,Z as H,r as x,Q as j,d$ as z}from"./story-BfX8CRfG.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as h}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{b as J}from"./LRUCache-C3erQTWv-0wD6drRf.js";import{h as K}from"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import{o as W}from"./signal-CETehA7D-DhpyJ8yp.js";import{u as I}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{S as O}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{_,E as V,i as X,$ as Y,Y as ee,n as te,t as re,X as ie,e as oe}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{p as ne}from"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import{k as C}from"./utils-tNxq3jkf-B78XlSIE.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{m as ae,u as se,p as le}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{H as pe,$ as de}from"./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js";import{l as ye}from"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import{C as ue,q as me}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{w as he}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import ce from"./FeatureLayerSource-k4WMYop1-BFUwA-tw.js";import{n as fe}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{a as ge}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{i as be}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{C as ve}from"./EditBusLayer-Df29OyJh-DkVkxUAl.js";import{E as we}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{p as Fe}from"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import{C as Ie}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as Oe}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{x as _e}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{c as Te,U as Ee,f as Se,e as Le}from"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import{y as xe}from"./FeatureType-C9hJmS6_-BXWT6QCe.js";import{f as je}from"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import{p as Ce}from"./fetchService-DbaKmJhP-W7rGyykJ.js";import{a as Pe}from"./versionUtils-LZYZz-38-DxOZEoAg.js";import qe from"./PortalItem-CctGdnxF-C7IJrZYq.js";import{b as m}from"./Query-BrwMGK8U-DoFNfkjX.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import"./Relationship-PyhUibYK-BgFx3_5x.js";import"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import"./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./External-D_wl4XAw-P7VLSnKi.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./MeshTransform-C--IG09w-DoQndDth.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BrXZAXDf.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./editingSupport-gUqP9iyf-BcQn3A1C.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./clientSideDefaults-BqqayPct-B-0mBem3.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./QueryTask-CwHwH2rS-B8khefoW.js";import"./executeForIds-Z1gkLduF-D8DZG8qZ.js";import"./query-DFW9-NG_-gbjlxRZk.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./executeQueryPBF-o8010HS9-BgTBXvCY.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./executeQueryJSON-CcHnccia-BW7_NQxl.js";import"./editsZScale-BDsX6vv--CttUpViY.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./FeatureTemplate-SPHPD45f-DFBQobBO.js";let d=class extends O(I(F(h))){constructor(e){super(e),this._layerCache=new J(20,i=>i.destroy()),this._oidToReference=new K,this._layerToReference=new Map,this.legendEnabled=!0,this.layers=new q,this.maximumVisibleSublayers=10,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.title="Layers in view",this.type="catalog-dynamic-group",this.visible=!0}initialize(){this.addHandles([this.layers.on("after-add",({item:e})=>{e.parent=this}),this.layers.on("after-remove",({item:e})=>{e.parent=null}),Q(()=>this._orderBy,()=>{this._updateLayerSortValues(),this._sortAllLayers()})])}load(e){return this.addResolvingPromise(this.parent.load()),Promise.resolve(this)}destroy(){this._layerCache.destroy(),this._oidToReference.clear(),this._layerToReference.clear()}get _orderBy(){return this.parent?this.parent.orderBy?.find(e=>!e.valueExpression&&e.field)??new ne({field:this.parent.objectIdField}):null}get _referenceComparator(){const e=this._orderBy;if(!this.parent||!e)return()=>0;const i=this.parent.fieldsIndex.get(e.field),a=C(i?.toJSON().type,e.order==="descending"),n=C("esriFieldTypeOID",e.order==="descending");return(l,p)=>a(p.sortValue,l.sortValue)||n(p.objectId,l.objectId)}get fullExtent(){return this.parent?.fullExtent??null}get updating(){return A(this._oidToReference,({pending:e})=>e!=null)}acquireLayer(e){if(this.destroyed)return S();const i=this._getLayerReference(e);return i.count++,S(()=>{i.count--,i.count||this._destroyLayerReference(i)})}_getLayerReference(e){const i=e.getObjectId();return R(this._oidToReference,i,()=>{const a=e.getObjectId(),n=`${a}`,l=e.getAttribute(this.parent.itemSourceField),p=new Re(e,a,l),y=this._layerCache.pop(n);return y?(this._addLayer(p,y),p):(p.pending=this.parent.createLayerFromFootprint(e).then(u=>{p.count?this._addLayer(p,u):(this.destroyed||this._layerCache.get(n)||this._layerCache.put(n,u),p.layer=null)}).catch(()=>{}).finally(()=>{p.pending=null}),p)})}_destroyLayerReference(e){e.layer&&(this._layerToReference.delete(e.layer),this.layers.remove(e.layer),this.destroyed?e.layer.destroy():this._layerCache.put(`${e.objectId}`,e.layer),e.layer=null),this._oidToReference.delete(e.objectId)}_addLayer(e,i){e.layer=i,i.persistenceEnabled=!1,this._layerToReference.set(i,e),this._updateLayerSortValue(e),this.layers.add(i),this._sortAllLayers()}_updateLayerSortValues(){for(const e of this._layerToReference.values())this._updateLayerSortValue(e)}_updateLayerSortValue(e){this._orderBy&&(e.sortValue=e.footprint.getAttribute(this._orderBy.field))}_sortAllLayers(){this.layers.sort((e,i)=>this._referenceComparator(this._layerToReference.get(e),this._layerToReference.get(i)))}};t([r()],d.prototype,"_orderBy",null),t([r({readOnly:!0})],d.prototype,"_referenceComparator",null),t([r(_)],d.prototype,"legendEnabled",void 0),t([r({type:["show","hide","hide-children"],json:{write:!0}})],d.prototype,"listMode",void 0),t([r({readOnly:!0})],d.prototype,"fullExtent",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],d.prototype,"id",void 0),t([r({readOnly:!0})],d.prototype,"layers",void 0),t([r({type:D,range:{min:0,max:50},json:{write:!0,default:10}})],d.prototype,"maximumVisibleSublayers",void 0),t([r(V)],d.prototype,"opacity",void 0),t([r({clonable:!1})],d.prototype,"parent",void 0),t([r({type:String,nonNullable:!0,json:{write:{ignoreOrigin:!0,isRequired:!0}}})],d.prototype,"title",void 0),t([r({json:{read:!1}})],d.prototype,"type",void 0),t([r({readOnly:!0})],d.prototype,"updating",null),t([r({type:Boolean,json:{name:"visibility",write:!0}})],d.prototype,"visible",void 0),d=t([w("esri.layers.catalog.CatalogDynamicGroupLayer")],d);const $=d;class Re{constructor(i,a,n){this.footprint=i,this.objectId=a,this.itemSource=n,this.count=0,this.layer=null,this.sortValue=void 0,this._pending=W(null)}get pending(){return this._pending.value}set pending(i){this._pending.value=i}}function Ve(){const e=new z({style:"solid",color:[0,0,0,0],outline:{style:"solid",color:[96,96,96,.75],width:.75}});return new le({symbol:e})}let o=class extends O(ye(I(F(h)))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.elevationInfo=null,this.formTemplate=null,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.title="Footprints",this.type="catalog-footprint",this.visible=!0}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.parent.load(e),L(this.renderer,this.fieldsIndex),this.addHandles([this.parent.on("apply-edits",i=>this.emit("apply-edits",i)),this.parent.on("edits",i=>this.emit("edits",i)),this.parent.on("refresh",i=>this.emit("refresh",i))])}get apiKey(){return this.parent?.apiKey}get capabilities(){return this.parent?.capabilities}get customParameters(){return this.parent?.customParameters}get dateFieldsTimeZone(){return this.parent?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this.parent?.datesInUnknownTimezone??!1}get definitionExpression(){return this.parent?.definitionExpression}get editingInfo(){return this.parent?.editingInfo}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get createQueryVersion(){return this.parent?.createQueryVersion}get defaultPopupTemplate(){return this.createPopupTemplate()}get displayField(){return this.parent?.displayField}get effectiveEditingEnabled(){return!1}get fields(){return this.parent?.fields}get fieldsIndex(){return this.parent?.fieldsIndex}get fullExtent(){return this.parent?.fullExtent}get geometryFieldsInfo(){return this.parent?.geometryFieldsInfo}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?.globalIdField}get hasM(){return this.parent?.hasM??!1}get hasZ(){return this.parent?.hasZ??!1}get objectIdField(){return this.parent?.objectIdField}get orderBy(){return this.parent?.orderBy??null}get outFields(){return this.parent?.outFields}get parsedUrl(){return this.parent?.parsedUrl??null}get preferredTimeZone(){return this.parent?.preferredTimeZone??null}set renderer(e){L(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):Ve()}get returnM(){return this.parent?.returnM}get returnZ(){return this.parent?.returnZ}get source(){return this.parent?.source}get timeExtent(){return this.parent?.timeExtent}get timeInfo(){return this.parent?.timeInfo}get timeOffset(){return this.parent?.timeOffset}get typeIdField(){return this.parent?.typeIdField}get types(){return this.parent?.types}get useViewTime(){return this.parent?.useViewTime??!0}get version(){return this.parent?.version}async applyEdits(e,i){return await this.load(),this.parent.applyEdits(e,i)}createPopupTemplate(e){const i={fields:this.fields,objectIdField:this.objectIdField,title:this.title};return he(i,e)}createQuery(){return this.parent?.createQuery()}getField(e){return this.parent?.getField(e)}getFieldDomain(e,i){return this.parent?.getFieldDomain(e,i)}async queryExtent(e,i){return await this.load(),this.parent.queryExtent(e,i)}async queryFeatures(e,i){return await this.load(),this.parent.queryFeatures(e,i)}async queryFeatureCount(e,i){return await this.load(),this.parent.queryFeatureCount(e,i)}async queryObjectIds(e,i){return await this.load(),this.parent.queryObjectIds(e,i)}};t([r(X)],o.prototype,"attributeTableTemplate",void 0),t([r({readOnly:!0})],o.prototype,"apiKey",null),t([r({readOnly:!0})],o.prototype,"capabilities",null),t([r({readOnly:!0})],o.prototype,"customParameters",null),t([r()],o.prototype,"dateFieldsTimeZone",null),t([r({readOnly:!0})],o.prototype,"datesInUnknownTimezone",null),t([r({readOnly:!0})],o.prototype,"definitionExpression",null),t([r({readOnly:!0})],o.prototype,"editingInfo",null),t([r({readOnly:!0})],o.prototype,"effectiveCapabilities",null),t([r({json:{origins:{"web-scene":{write:!1}},write:!0}})],o.prototype,"charts",void 0),t([r({readOnly:!0})],o.prototype,"createQueryVersion",null),t([r({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),t([r()],o.prototype,"displayField",null),t([r({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),t([r({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),t([r((()=>{const e=g(Y);return e.json.origins["web-map"]={read:!1,write:!1},e})())],o.prototype,"elevationInfo",void 0),t([r({readOnly:!0})],o.prototype,"fields",null),t([r({readOnly:!0})],o.prototype,"fieldsIndex",null),t([r({type:pe,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"formTemplate",void 0),t([r({readOnly:!0})],o.prototype,"fullExtent",null),t([r({readOnly:!0})],o.prototype,"geometryFieldsInfo",null),t([r({readOnly:!0})],o.prototype,"geometryType",null),t([r({readOnly:!0})],o.prototype,"globalIdField",null),t([r({readOnly:!0})],o.prototype,"hasM",null),t([r({readOnly:!0})],o.prototype,"hasZ",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],o.prototype,"id",void 0),t([r({type:[ue],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:me,write:!0}})],o.prototype,"labelingInfo",void 0),t([r(ee)],o.prototype,"labelsVisible",void 0),t([r(_)],o.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{write:!0}})],o.prototype,"listMode",void 0),t([r((()=>{const e=g(te);return e.json.origins.service.read=!1,e})())],o.prototype,"maxScale",void 0),t([r((()=>{const e=g(re);return e.json.origins.service.read=!1,e})())],o.prototype,"minScale",void 0),t([r({readOnly:!0})],o.prototype,"objectIdField",null),t([r(V)],o.prototype,"opacity",void 0),t([r({readOnly:!0})],o.prototype,"orderBy",null),t([r({readOnly:!0})],o.prototype,"outFields",null),t([r({clonable:!1})],o.prototype,"parent",void 0),t([r({readOnly:!0})],o.prototype,"parsedUrl",null),t([r(ie)],o.prototype,"popupEnabled",void 0),t([r({type:U,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),t([r({readOnly:!0})],o.prototype,"preferredTimeZone",null),t([r({types:ae,json:{origins:{"web-scene":{types:se}},name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(e,i){return{ignoreOrigin:this.originIdOf(i){const{url:n,source:l,portalItem:p}=this;if(!n)throw new f("catalog-layer:missing-url","Catalog layer must be created with a url");if(this.layerId==null){const u=await this._fetchFirstValidLayerId(i);if(u==null)throw new f("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:n});this.layerId=u}await l.load({signal:i});const{sourceJSON:y}=l;y&&(this.sourceJSON=y,this.read(y,{origin:"service",portalItem:p,portal:p?.portal,url:this.parsedUrl}))}).then(()=>{const n=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],l=n.filter(p=>!this.fieldsIndex.has(p));if(l.length)throw new f("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:n,missingFields:l})}).then(()=>Te(this,"load",e));return this.addResolvingPromise(a),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}get parsedUrl(){const e=G(this.url);return e!=null&&this.layerId!=null&&(e.path=N(e.path,this.layerId.toString())),e}async applyEdits(e,i){return Ee(this,e,i)}on(e,i){return super.on(e,i)}async createLayerFromFootprint(e){const i=await this._createLayer(e);return this._configureLayer(i,e),this._layerToFootprint.set(i,e),i}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new m,i=this.capabilities?.query;e.returnGeometry=!0,i&&(e.compactGeometryEnabled=i.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=i.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:a,timeExtent:n}=this;return e.timeExtent=a!=null&&n!=null?n.offset(-a.value,a.unit):n||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return Se(this.types,this.typeIdField,e)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){const a=i?.feature,n=this.getFeatureType(a);if(n){const l=n.domains&&n.domains[e];if(l&&l.type!=="inherited")return l}return this.getField(e)?.domain}async hasDataChanged(){return Le(this)}async queryFeatures(e,i){const a=await this.load(),n=await a.source.queryFeatures(m.from(e)??a.createQuery(),i);if(n?.features)for(const l of n.features)l.layer=l.sourceLayer=a.footprintLayer;return n}async queryObjectIds(e,i){return(await this.load()).source.queryObjectIds(m.from(e)??this.createQuery(),i)}async queryFeatureCount(e,i){return(await this.load()).source.queryFeatureCount(m.from(e)??this.createQuery(),i)}async queryExtent(e,i){return(await this.load()).source.queryExtent(m.from(e)??this.createQuery(),i)}serviceSupportsSpatialReference(e){return this.loaded&&Pe(this,e)}read(e,i){if(super.read(e,i),e){const{footprintLayer:a,dynamicGroupLayer:n}=e;a&&this.footprintLayer.read(a,i),n&&this.dynamicGroupLayer.read(n,i)}}async _fetchFirstValidLayerId(e){const{data:i}=await k(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(Array.isArray(i?.layers))return i.layers.find(({type:a})=>this.supportedSourceTypes.has(a))?.id}async _createLayer(e){const i=e.getAttribute(this.itemSourceField);if(!i)throw new f("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const a=JSON.parse(i);if($e(a)){const{itemId:n,portalUrl:l}=a,p=H(l),y=this.portalItem?.portal,u=x.getDefault();let c,T=!0;y&&j(l,y.url)?c=y:j(l,u.url)?c=u:(c=R(this._portals,p,()=>new x({url:p})),T=!1);const E=await h.fromPortalItem(new qe({id:n,portal:c}));return T||await v(E),E}return Be(a)?h.fromArcGISServerUrl({url:a.url}):new(await Ce.UnsupportedLayer())}_configureLayer(e,i){const a=i.getAttribute(this.itemNameField);a&&(e.title=a);const n=i.getAttribute(this.maxScaleField);n!=null&&"maxScale"in e&&(e.maxScale=n);const l=i.getAttribute(this.minScaleField);l!=null&&"minScale"in e&&(e.minScale=l)}};async function v(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,e.type==="group"&&await Promise.allSettled([...e.layers.map(i=>v(i)),...e.tables.map(i=>v(i))])}}t([r(_)],s.prototype,"legendEnabled",void 0),t([r({readOnly:!0})],s.prototype,"createQueryVersion",null),t([r({readOnly:!0})],s.prototype,"drawOrderField",void 0),t([r({type:$,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"dynamicGroupLayer",void 0),t([r({readOnly:!0})],s.prototype,"editingEnabled",null),t([r({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),t([r({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],s.prototype,"elevationInfo",void 0),t([r({...b.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"fields",void 0),t([r(b.fieldsIndex)],s.prototype,"fieldsIndex",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],s.prototype,"floorInfo",void 0),t([r({type:B,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"footprintLayer",void 0),t([r(oe)],s.prototype,"id",void 0),t([r({readOnly:!0})],s.prototype,"itemNameField",void 0),t([r({readOnly:!0})],s.prototype,"itemSourceField",void 0),t([r({readOnly:!0})],s.prototype,"itemTypeField",void 0),t([r({readOnly:!0})],s.prototype,"layers",void 0),t([r({type:["show","hide","hide-children"]})],s.prototype,"listMode",void 0),t([r({readOnly:!0})],s.prototype,"maxScaleField",void 0),t([r({readOnly:!0})],s.prototype,"minScaleField",void 0),t([r({value:"CatalogLayer",type:["CatalogLayer"]})],s.prototype,"operationalLayerType",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],s.prototype,"orderBy",void 0),t([r(b.outFields)],s.prototype,"outFields",void 0),t([r({readOnly:!0})],s.prototype,"parsedUrl",null),t([r({readOnly:!0})],s.prototype,"source",void 0),t([r({json:{read:!1}})],s.prototype,"type",void 0),t([r({type:String})],s.prototype,"typeIdField",void 0),t([r({type:[xe]})],s.prototype,"types",void 0),s=t([w("esri.layers.CatalogLayer")],s);const Ur=s;export{Ur as default}; +import{ag as q,ah as Q,aT as A,a2 as S,an as R,v as t,S as r,bB as D,i as w,bT as L,P as g,bL as U,bP as Z,W as M,o as f,a as G,bX as N,f as k,Z as H,r as x,Q as j,d$ as z}from"./story-Doly9N9p.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as h}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{b as J}from"./LRUCache-C3erQTWv-grHgYSP-.js";import{h as K}from"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import{o as W}from"./signal-CETehA7D-DQA5V72u.js";import{u as I}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{S as O}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{_,E as V,i as X,$ as Y,Y as ee,n as te,t as re,X as ie,e as oe}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{p as ne}from"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import{k as C}from"./utils-tNxq3jkf-nfQcZo7O.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{m as ae,u as se,p as le}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{H as pe,$ as de}from"./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js";import{l as ye}from"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import{C as ue,q as me}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{w as he}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import ce from"./FeatureLayerSource-k4WMYop1-B19OqXBO.js";import{n as fe}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{a as ge}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{i as be}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{C as ve}from"./EditBusLayer-Df29OyJh-OmdJOLws.js";import{E as we}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{p as Fe}from"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import{C as Ie}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as Oe}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{x as _e}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{c as Te,U as Ee,f as Se,e as Le}from"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import{y as xe}from"./FeatureType-C9hJmS6_-CNlvn5D1.js";import{f as je}from"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import{p as Ce}from"./fetchService-DbaKmJhP-Ccg-phWf.js";import{a as Pe}from"./versionUtils-LZYZz-38-B8C5OAjF.js";import qe from"./PortalItem-CctGdnxF-CfFOGshS.js";import{b as m}from"./Query-BrwMGK8U-BPr0_G9t.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import"./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./External-D_wl4XAw-DrOy4LUr.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./MeshTransform-C--IG09w-Bbqagf1g.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BQk2dgMZ.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./editingSupport-gUqP9iyf-C_ld1skV.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./QueryTask-CwHwH2rS-D4f5dsGo.js";import"./executeForIds-Z1gkLduF-CrWEksFG.js";import"./query-DFW9-NG_-C3TyGmiM.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./executeQueryPBF-o8010HS9-B7Z-YQyg.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./executeQueryJSON-CcHnccia-M-vnTvKl.js";import"./editsZScale-BDsX6vv--C-4n90TZ.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";let d=class extends O(I(F(h))){constructor(e){super(e),this._layerCache=new J(20,i=>i.destroy()),this._oidToReference=new K,this._layerToReference=new Map,this.legendEnabled=!0,this.layers=new q,this.maximumVisibleSublayers=10,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.title="Layers in view",this.type="catalog-dynamic-group",this.visible=!0}initialize(){this.addHandles([this.layers.on("after-add",({item:e})=>{e.parent=this}),this.layers.on("after-remove",({item:e})=>{e.parent=null}),Q(()=>this._orderBy,()=>{this._updateLayerSortValues(),this._sortAllLayers()})])}load(e){return this.addResolvingPromise(this.parent.load()),Promise.resolve(this)}destroy(){this._layerCache.destroy(),this._oidToReference.clear(),this._layerToReference.clear()}get _orderBy(){return this.parent?this.parent.orderBy?.find(e=>!e.valueExpression&&e.field)??new ne({field:this.parent.objectIdField}):null}get _referenceComparator(){const e=this._orderBy;if(!this.parent||!e)return()=>0;const i=this.parent.fieldsIndex.get(e.field),a=C(i?.toJSON().type,e.order==="descending"),n=C("esriFieldTypeOID",e.order==="descending");return(l,p)=>a(p.sortValue,l.sortValue)||n(p.objectId,l.objectId)}get fullExtent(){return this.parent?.fullExtent??null}get updating(){return A(this._oidToReference,({pending:e})=>e!=null)}acquireLayer(e){if(this.destroyed)return S();const i=this._getLayerReference(e);return i.count++,S(()=>{i.count--,i.count||this._destroyLayerReference(i)})}_getLayerReference(e){const i=e.getObjectId();return R(this._oidToReference,i,()=>{const a=e.getObjectId(),n=`${a}`,l=e.getAttribute(this.parent.itemSourceField),p=new Re(e,a,l),y=this._layerCache.pop(n);return y?(this._addLayer(p,y),p):(p.pending=this.parent.createLayerFromFootprint(e).then(u=>{p.count?this._addLayer(p,u):(this.destroyed||this._layerCache.get(n)||this._layerCache.put(n,u),p.layer=null)}).catch(()=>{}).finally(()=>{p.pending=null}),p)})}_destroyLayerReference(e){e.layer&&(this._layerToReference.delete(e.layer),this.layers.remove(e.layer),this.destroyed?e.layer.destroy():this._layerCache.put(`${e.objectId}`,e.layer),e.layer=null),this._oidToReference.delete(e.objectId)}_addLayer(e,i){e.layer=i,i.persistenceEnabled=!1,this._layerToReference.set(i,e),this._updateLayerSortValue(e),this.layers.add(i),this._sortAllLayers()}_updateLayerSortValues(){for(const e of this._layerToReference.values())this._updateLayerSortValue(e)}_updateLayerSortValue(e){this._orderBy&&(e.sortValue=e.footprint.getAttribute(this._orderBy.field))}_sortAllLayers(){this.layers.sort((e,i)=>this._referenceComparator(this._layerToReference.get(e),this._layerToReference.get(i)))}};t([r()],d.prototype,"_orderBy",null),t([r({readOnly:!0})],d.prototype,"_referenceComparator",null),t([r(_)],d.prototype,"legendEnabled",void 0),t([r({type:["show","hide","hide-children"],json:{write:!0}})],d.prototype,"listMode",void 0),t([r({readOnly:!0})],d.prototype,"fullExtent",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],d.prototype,"id",void 0),t([r({readOnly:!0})],d.prototype,"layers",void 0),t([r({type:D,range:{min:0,max:50},json:{write:!0,default:10}})],d.prototype,"maximumVisibleSublayers",void 0),t([r(V)],d.prototype,"opacity",void 0),t([r({clonable:!1})],d.prototype,"parent",void 0),t([r({type:String,nonNullable:!0,json:{write:{ignoreOrigin:!0,isRequired:!0}}})],d.prototype,"title",void 0),t([r({json:{read:!1}})],d.prototype,"type",void 0),t([r({readOnly:!0})],d.prototype,"updating",null),t([r({type:Boolean,json:{name:"visibility",write:!0}})],d.prototype,"visible",void 0),d=t([w("esri.layers.catalog.CatalogDynamicGroupLayer")],d);const $=d;class Re{constructor(i,a,n){this.footprint=i,this.objectId=a,this.itemSource=n,this.count=0,this.layer=null,this.sortValue=void 0,this._pending=W(null)}get pending(){return this._pending.value}set pending(i){this._pending.value=i}}function Ve(){const e=new z({style:"solid",color:[0,0,0,0],outline:{style:"solid",color:[96,96,96,.75],width:.75}});return new le({symbol:e})}let o=class extends O(ye(I(F(h)))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.elevationInfo=null,this.formTemplate=null,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.opacity=1,this.parent=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.title="Footprints",this.type="catalog-footprint",this.visible=!0}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.parent.load(e),L(this.renderer,this.fieldsIndex),this.addHandles([this.parent.on("apply-edits",i=>this.emit("apply-edits",i)),this.parent.on("edits",i=>this.emit("edits",i)),this.parent.on("refresh",i=>this.emit("refresh",i))])}get apiKey(){return this.parent?.apiKey}get capabilities(){return this.parent?.capabilities}get customParameters(){return this.parent?.customParameters}get dateFieldsTimeZone(){return this.parent?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this.parent?.datesInUnknownTimezone??!1}get definitionExpression(){return this.parent?.definitionExpression}get editingInfo(){return this.parent?.editingInfo}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get createQueryVersion(){return this.parent?.createQueryVersion}get defaultPopupTemplate(){return this.createPopupTemplate()}get displayField(){return this.parent?.displayField}get effectiveEditingEnabled(){return!1}get fields(){return this.parent?.fields}get fieldsIndex(){return this.parent?.fieldsIndex}get fullExtent(){return this.parent?.fullExtent}get geometryFieldsInfo(){return this.parent?.geometryFieldsInfo}get geometryType(){return this.parent?.geometryType}get globalIdField(){return this.parent?.globalIdField}get hasM(){return this.parent?.hasM??!1}get hasZ(){return this.parent?.hasZ??!1}get objectIdField(){return this.parent?.objectIdField}get orderBy(){return this.parent?.orderBy??null}get outFields(){return this.parent?.outFields}get parsedUrl(){return this.parent?.parsedUrl??null}get preferredTimeZone(){return this.parent?.preferredTimeZone??null}set renderer(e){L(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):Ve()}get returnM(){return this.parent?.returnM}get returnZ(){return this.parent?.returnZ}get source(){return this.parent?.source}get timeExtent(){return this.parent?.timeExtent}get timeInfo(){return this.parent?.timeInfo}get timeOffset(){return this.parent?.timeOffset}get typeIdField(){return this.parent?.typeIdField}get types(){return this.parent?.types}get useViewTime(){return this.parent?.useViewTime??!0}get version(){return this.parent?.version}async applyEdits(e,i){return await this.load(),this.parent.applyEdits(e,i)}createPopupTemplate(e){const i={fields:this.fields,objectIdField:this.objectIdField,title:this.title};return he(i,e)}createQuery(){return this.parent?.createQuery()}getField(e){return this.parent?.getField(e)}getFieldDomain(e,i){return this.parent?.getFieldDomain(e,i)}async queryExtent(e,i){return await this.load(),this.parent.queryExtent(e,i)}async queryFeatures(e,i){return await this.load(),this.parent.queryFeatures(e,i)}async queryFeatureCount(e,i){return await this.load(),this.parent.queryFeatureCount(e,i)}async queryObjectIds(e,i){return await this.load(),this.parent.queryObjectIds(e,i)}};t([r(X)],o.prototype,"attributeTableTemplate",void 0),t([r({readOnly:!0})],o.prototype,"apiKey",null),t([r({readOnly:!0})],o.prototype,"capabilities",null),t([r({readOnly:!0})],o.prototype,"customParameters",null),t([r()],o.prototype,"dateFieldsTimeZone",null),t([r({readOnly:!0})],o.prototype,"datesInUnknownTimezone",null),t([r({readOnly:!0})],o.prototype,"definitionExpression",null),t([r({readOnly:!0})],o.prototype,"editingInfo",null),t([r({readOnly:!0})],o.prototype,"effectiveCapabilities",null),t([r({json:{origins:{"web-scene":{write:!1}},write:!0}})],o.prototype,"charts",void 0),t([r({readOnly:!0})],o.prototype,"createQueryVersion",null),t([r({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),t([r()],o.prototype,"displayField",null),t([r({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),t([r({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),t([r((()=>{const e=g(Y);return e.json.origins["web-map"]={read:!1,write:!1},e})())],o.prototype,"elevationInfo",void 0),t([r({readOnly:!0})],o.prototype,"fields",null),t([r({readOnly:!0})],o.prototype,"fieldsIndex",null),t([r({type:pe,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"formTemplate",void 0),t([r({readOnly:!0})],o.prototype,"fullExtent",null),t([r({readOnly:!0})],o.prototype,"geometryFieldsInfo",null),t([r({readOnly:!0})],o.prototype,"geometryType",null),t([r({readOnly:!0})],o.prototype,"globalIdField",null),t([r({readOnly:!0})],o.prototype,"hasM",null),t([r({readOnly:!0})],o.prototype,"hasZ",null),t([r({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],o.prototype,"id",void 0),t([r({type:[ue],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:me,write:!0}})],o.prototype,"labelingInfo",void 0),t([r(ee)],o.prototype,"labelsVisible",void 0),t([r(_)],o.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{write:!0}})],o.prototype,"listMode",void 0),t([r((()=>{const e=g(te);return e.json.origins.service.read=!1,e})())],o.prototype,"maxScale",void 0),t([r((()=>{const e=g(re);return e.json.origins.service.read=!1,e})())],o.prototype,"minScale",void 0),t([r({readOnly:!0})],o.prototype,"objectIdField",null),t([r(V)],o.prototype,"opacity",void 0),t([r({readOnly:!0})],o.prototype,"orderBy",null),t([r({readOnly:!0})],o.prototype,"outFields",null),t([r({clonable:!1})],o.prototype,"parent",void 0),t([r({readOnly:!0})],o.prototype,"parsedUrl",null),t([r(ie)],o.prototype,"popupEnabled",void 0),t([r({type:U,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),t([r({readOnly:!0})],o.prototype,"preferredTimeZone",null),t([r({types:ae,json:{origins:{"web-scene":{types:se}},name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(e,i){return{ignoreOrigin:this.originIdOf(i){const{url:n,source:l,portalItem:p}=this;if(!n)throw new f("catalog-layer:missing-url","Catalog layer must be created with a url");if(this.layerId==null){const u=await this._fetchFirstValidLayerId(i);if(u==null)throw new f("catalog-layer:missing-layerId","There is no Catalog Layer in the service",{service:n});this.layerId=u}await l.load({signal:i});const{sourceJSON:y}=l;y&&(this.sourceJSON=y,this.read(y,{origin:"service",portalItem:p,portal:p?.portal,url:this.parsedUrl}))}).then(()=>{const n=[this.itemNameField,this.itemSourceField,this.itemTypeField,this.minScaleField,this.maxScaleField],l=n.filter(p=>!this.fieldsIndex.has(p));if(l.length)throw new f("catalog-layer:missing-fields","There are missing fields to operate properly",{requiredFields:n,missingFields:l})}).then(()=>Te(this,"load",e));return this.addResolvingPromise(a),Promise.resolve(this)}destroy(){this.footprintLayer.destroy(),this.dynamicGroupLayer.destroy();for(const e of this._portals.values())e.destroy();this._portals.clear()}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return!1}get parsedUrl(){const e=G(this.url);return e!=null&&this.layerId!=null&&(e.path=N(e.path,this.layerId.toString())),e}async applyEdits(e,i){return Ee(this,e,i)}on(e,i){return super.on(e,i)}async createLayerFromFootprint(e){const i=await this._createLayer(e);return this._configureLayer(i,e),this._layerToFootprint.set(i,e),i}createFootprintFromLayer(e){return this._layerToFootprint.get(e)?.clone()}createQuery(){const e=new m,i=this.capabilities?.query;e.returnGeometry=!0,i&&(e.compactGeometryEnabled=i.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=i.supportsDefaultSpatialReference),e.outFields=["*"];const{timeOffset:a,timeExtent:n}=this;return e.timeExtent=a!=null&&n!=null?n.offset(-a.value,a.unit):n||null,e.where=this.definitionExpression||"1=1",e}getFeatureType(e){return Se(this.types,this.typeIdField,e)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){const a=i?.feature,n=this.getFeatureType(a);if(n){const l=n.domains&&n.domains[e];if(l&&l.type!=="inherited")return l}return this.getField(e)?.domain}async hasDataChanged(){return Le(this)}async queryFeatures(e,i){const a=await this.load(),n=await a.source.queryFeatures(m.from(e)??a.createQuery(),i);if(n?.features)for(const l of n.features)l.layer=l.sourceLayer=a.footprintLayer;return n}async queryObjectIds(e,i){return(await this.load()).source.queryObjectIds(m.from(e)??this.createQuery(),i)}async queryFeatureCount(e,i){return(await this.load()).source.queryFeatureCount(m.from(e)??this.createQuery(),i)}async queryExtent(e,i){return(await this.load()).source.queryExtent(m.from(e)??this.createQuery(),i)}serviceSupportsSpatialReference(e){return this.loaded&&Pe(this,e)}read(e,i){if(super.read(e,i),e){const{footprintLayer:a,dynamicGroupLayer:n}=e;a&&this.footprintLayer.read(a,i),n&&this.dynamicGroupLayer.read(n,i)}}async _fetchFirstValidLayerId(e){const{data:i}=await k(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e});if(Array.isArray(i?.layers))return i.layers.find(({type:a})=>this.supportedSourceTypes.has(a))?.id}async _createLayer(e){const i=e.getAttribute(this.itemSourceField);if(!i)throw new f("catalog-layer:item-source-missing",`The footprint is missing the "${this.itemSourceField}" attribute`);const a=JSON.parse(i);if($e(a)){const{itemId:n,portalUrl:l}=a,p=H(l),y=this.portalItem?.portal,u=x.getDefault();let c,T=!0;y&&j(l,y.url)?c=y:j(l,u.url)?c=u:(c=R(this._portals,p,()=>new x({url:p})),T=!1);const E=await h.fromPortalItem(new qe({id:n,portal:c}));return T||await v(E),E}return Be(a)?h.fromArcGISServerUrl({url:a.url}):new(await Ce.UnsupportedLayer())}_configureLayer(e,i){const a=i.getAttribute(this.itemNameField);a&&(e.title=a);const n=i.getAttribute(this.maxScaleField);n!=null&&"maxScale"in e&&(e.maxScale=n);const l=i.getAttribute(this.minScaleField);l!=null&&"minScale"in e&&(e.minScale=l)}};async function v(e){if("portalItem"in e&&e.portalItem){try{await e.load()}catch{}e.portalItem=null,e.type==="group"&&await Promise.allSettled([...e.layers.map(i=>v(i)),...e.tables.map(i=>v(i))])}}t([r(_)],s.prototype,"legendEnabled",void 0),t([r({readOnly:!0})],s.prototype,"createQueryVersion",null),t([r({readOnly:!0})],s.prototype,"drawOrderField",void 0),t([r({type:$,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"dynamicGroupLayer",void 0),t([r({readOnly:!0})],s.prototype,"editingEnabled",null),t([r({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),t([r({json:{origins:{"web-scene":{name:"layerDefinition.elevationInfo",read:!1,write:!1}}}})],s.prototype,"elevationInfo",void 0),t([r({...b.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"fields",void 0),t([r(b.fieldsIndex)],s.prototype,"fieldsIndex",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.floorInfo",read:!1,write:!1}}}})],s.prototype,"floorInfo",void 0),t([r({type:B,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:P}}})],s.prototype,"footprintLayer",void 0),t([r(oe)],s.prototype,"id",void 0),t([r({readOnly:!0})],s.prototype,"itemNameField",void 0),t([r({readOnly:!0})],s.prototype,"itemSourceField",void 0),t([r({readOnly:!0})],s.prototype,"itemTypeField",void 0),t([r({readOnly:!0})],s.prototype,"layers",void 0),t([r({type:["show","hide","hide-children"]})],s.prototype,"listMode",void 0),t([r({readOnly:!0})],s.prototype,"maxScaleField",void 0),t([r({readOnly:!0})],s.prototype,"minScaleField",void 0),t([r({value:"CatalogLayer",type:["CatalogLayer"]})],s.prototype,"operationalLayerType",void 0),t([r({json:{origins:{"web-scene":{name:"layerDefinition.orderBy",write:!0,read:!0}}}})],s.prototype,"orderBy",void 0),t([r(b.outFields)],s.prototype,"outFields",void 0),t([r({readOnly:!0})],s.prototype,"parsedUrl",null),t([r({readOnly:!0})],s.prototype,"source",void 0),t([r({json:{read:!1}})],s.prototype,"type",void 0),t([r({type:String})],s.prototype,"typeIdField",void 0),t([r({type:[xe]})],s.prototype,"types",void 0),s=t([w("esri.layers.CatalogLayer")],s);const Ur=s;export{Ur as default}; diff --git a/custom-toc-highlight/assets/CatalogLayerView2D-DaUVeBuS-B6e9UrTB.js b/custom-toc-highlight/assets/CatalogLayerView2D-DaUVeBuS-B6e9UrTB.js new file mode 100644 index 00000000..b2fc6ca6 --- /dev/null +++ b/custom-toc-highlight/assets/CatalogLayerView2D-DaUVeBuS-B6e9UrTB.js @@ -0,0 +1 @@ +import{ag as a,v as i,S as o,i as m}from"./story-Doly9N9p.js";import{X as n,Y as s}from"./LayerView-Bish-E63-DK1SFHE3.js";import"./main-QGPoLsvl.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";const l=e=>{let t=class extends e{constructor(...r){super(...r),this.layerViews=new a}get dynamicGroupLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.dynamicGroupLayer)}get footprintLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.footprintLayer)}isUpdating(){return!this.dynamicGroupLayerView||!this.footprintLayerView||this.dynamicGroupLayerView.updating||this.footprintLayerView.updating}};return i([o()],t.prototype,"layer",void 0),i([o()],t.prototype,"layerViews",void 0),i([o({readOnly:!0})],t.prototype,"dynamicGroupLayerView",null),i([o({readOnly:!0})],t.prototype,"footprintLayerView",null),t=i([m("esri.views.layers.CatalogLayerView")],t),t};let p=class extends l(n(s)){constructor(){super(...arguments),this.layerViews=new a}update(e){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};i([o()],p.prototype,"layerViews",void 0),p=i([m("esri.views.2d.layers.CatalogLayerView2D")],p);const Vt=p;export{Vt as default}; diff --git a/custom-toc-highlight/assets/CatalogLayerView2D-DaUVeBuS-ZiacRCRh.js b/custom-toc-highlight/assets/CatalogLayerView2D-DaUVeBuS-ZiacRCRh.js deleted file mode 100644 index 4a5562b8..00000000 --- a/custom-toc-highlight/assets/CatalogLayerView2D-DaUVeBuS-ZiacRCRh.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as a,v as i,S as o,i as m}from"./story-BfX8CRfG.js";import{X as n,Y as s}from"./LayerView-Bish-E63-rB2WUWF4.js";import"./main-ugzBrWNm.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";const l=e=>{let t=class extends e{constructor(...r){super(...r),this.layerViews=new a}get dynamicGroupLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.dynamicGroupLayer)}get footprintLayerView(){return this.layerViews.find(r=>r.layer===this.layer?.footprintLayer)}isUpdating(){return!this.dynamicGroupLayerView||!this.footprintLayerView||this.dynamicGroupLayerView.updating||this.footprintLayerView.updating}};return i([o()],t.prototype,"layer",void 0),i([o()],t.prototype,"layerViews",void 0),i([o({readOnly:!0})],t.prototype,"dynamicGroupLayerView",null),i([o({readOnly:!0})],t.prototype,"footprintLayerView",null),t=i([m("esri.views.layers.CatalogLayerView")],t),t};let p=class extends l(n(s)){constructor(){super(...arguments),this.layerViews=new a}update(e){}viewChange(){}moveEnd(){}attach(){this.addAttachHandles([this._updatingHandles.addOnCollectionChange(()=>this.layerViews,()=>this._updateStageChildren(),{initial:!0})])}detach(){this.container.removeAllChildren()}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((e,t)=>this.container.addChildAt(e.container,t))}};i([o()],p.prototype,"layerViews",void 0),p=i([m("esri.views.2d.layers.CatalogLayerView2D")],p);const Vt=p;export{Vt as default}; diff --git a/custom-toc-highlight/assets/ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js b/custom-toc-highlight/assets/ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js similarity index 95% rename from custom-toc-highlight/assets/ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js rename to custom-toc-highlight/assets/ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js index 512c6958..9ca6de21 100644 --- a/custom-toc-highlight/assets/ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js +++ b/custom-toc-highlight/assets/ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js @@ -1 +1 @@ -import{aK as r,v as i,bz as o,S as t,i as l,e as d}from"./story-BfX8CRfG.js";const s=new r({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),n=new r({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let e=class extends d{constructor(a){super(a),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(a){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",a)}set definedInterval(a){this.classificationMethod==="defined-interval"&&this._set("definedInterval",a)}};i([o({classBreaksDef:"class-breaks-definition"})],e.prototype,"type",void 0),i([t({json:{write:!0}})],e.prototype,"breakCount",void 0),i([t({json:{write:!0}})],e.prototype,"classificationField",void 0),i([t({type:String,json:{read:s.read,write:s.write}})],e.prototype,"classificationMethod",void 0),i([t({json:{write:!0}})],e.prototype,"normalizationField",void 0),i([t({json:{read:n.read,write:n.write}})],e.prototype,"normalizationType",void 0),i([t({value:null,json:{write:!0}})],e.prototype,"standardDeviationInterval",null),i([t({value:null,json:{write:!0}})],e.prototype,"definedInterval",null),e=i([l("esri.rest.support.ClassBreaksDefinition")],e);const f=e;export{f as p}; +import{aK as r,v as i,bz as o,S as t,i as l,e as d}from"./story-Doly9N9p.js";const s=new r({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),n=new r({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let e=class extends d{constructor(a){super(a),this.type="class-breaks-definition",this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null}set standardDeviationInterval(a){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",a)}set definedInterval(a){this.classificationMethod==="defined-interval"&&this._set("definedInterval",a)}};i([o({classBreaksDef:"class-breaks-definition"})],e.prototype,"type",void 0),i([t({json:{write:!0}})],e.prototype,"breakCount",void 0),i([t({json:{write:!0}})],e.prototype,"classificationField",void 0),i([t({type:String,json:{read:s.read,write:s.write}})],e.prototype,"classificationMethod",void 0),i([t({json:{write:!0}})],e.prototype,"normalizationField",void 0),i([t({json:{read:n.read,write:n.write}})],e.prototype,"normalizationType",void 0),i([t({value:null,json:{write:!0}})],e.prototype,"standardDeviationInterval",null),i([t({value:null,json:{write:!0}})],e.prototype,"definedInterval",null),e=i([l("esri.rest.support.ClassBreaksDefinition")],e);const f=e;export{f as p}; diff --git a/custom-toc-highlight/assets/CollectionFlattener-DkHuHn5E-BKutaakg.js b/custom-toc-highlight/assets/CollectionFlattener-DkHuHn5E-dp3hDI2N.js similarity index 93% rename from custom-toc-highlight/assets/CollectionFlattener-DkHuHn5E-BKutaakg.js rename to custom-toc-highlight/assets/CollectionFlattener-DkHuHn5E-dp3hDI2N.js index a8aa1666..6721e5f2 100644 --- a/custom-toc-highlight/assets/CollectionFlattener-DkHuHn5E-BKutaakg.js +++ b/custom-toc-highlight/assets/CollectionFlattener-DkHuHn5E-dp3hDI2N.js @@ -1 +1 @@ -import{v as l,S as r,i as d,ag as c,dx as f,av as u}from"./story-BfX8CRfG.js";let s=class extends c{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles(f(()=>this._refresh(),u))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections!=null?this.getCollections():null;if(e==null)return void this.removeAll();let o=0;for(const n of e)n!=null&&(o=this._processCollection(o,n));this.splice(o,this.length)}_createNewInstance(e){return new c(e)}_processCollection(e,o){if(!o)return e;const n=this.itemFilterFunction??(t=>!!t);for(const t of o)if(t){if(n(t)){const i=this.indexOf(t,e);i>=0?i!==e&&this.reorder(t,e):this.add(t,e),++e}if(this.getChildrenFunction){const i=this.getChildrenFunction(t);if(Array.isArray(i))for(const h of i)e=this._processCollection(e,h);else e=this._processCollection(e,i)}}return e}};l([r()],s.prototype,"getCollections",void 0),l([r()],s.prototype,"getChildrenFunction",void 0),l([r()],s.prototype,"itemFilterFunction",void 0),s=l([d("esri.core.CollectionFlattener")],s);const p=s;export{p as f}; +import{v as l,S as r,i as d,ag as c,dx as f,av as u}from"./story-Doly9N9p.js";let s=class extends c{constructor(e){super(e),this.getCollections=null}initialize(){this.addHandles(f(()=>this._refresh(),u))}destroy(){this.getCollections=null}_refresh(){const e=this.getCollections!=null?this.getCollections():null;if(e==null)return void this.removeAll();let o=0;for(const n of e)n!=null&&(o=this._processCollection(o,n));this.splice(o,this.length)}_createNewInstance(e){return new c(e)}_processCollection(e,o){if(!o)return e;const n=this.itemFilterFunction??(t=>!!t);for(const t of o)if(t){if(n(t)){const i=this.indexOf(t,e);i>=0?i!==e&&this.reorder(t,e):this.add(t,e),++e}if(this.getChildrenFunction){const i=this.getChildrenFunction(t);if(Array.isArray(i))for(const h of i)e=this._processCollection(e,h);else e=this._processCollection(e,i)}}return e}};l([r()],s.prototype,"getCollections",void 0),l([r()],s.prototype,"getChildrenFunction",void 0),l([r()],s.prototype,"itemFilterFunction",void 0),s=l([d("esri.core.CollectionFlattener")],s);const p=s;export{p as f}; diff --git a/custom-toc-highlight/assets/ColorBackground-gVZldRLm-C2pKGijH.js b/custom-toc-highlight/assets/ColorBackground-gVZldRLm-Dca2T4QI.js similarity index 66% rename from custom-toc-highlight/assets/ColorBackground-gVZldRLm-C2pKGijH.js rename to custom-toc-highlight/assets/ColorBackground-gVZldRLm-Dca2T4QI.js index 4532a892..a0b393e7 100644 --- a/custom-toc-highlight/assets/ColorBackground-gVZldRLm-C2pKGijH.js +++ b/custom-toc-highlight/assets/ColorBackground-gVZldRLm-Dca2T4QI.js @@ -1 +1 @@ -import{v as e,S as a,ar as t,i as c,e as i,P as n}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";var r;let o=r=class extends i{constructor(s){super(s),this.color=new t([0,0,0,1])}clone(){return new r(n({color:this.color}))}};e([a({type:t,json:{write:!0}})],o.prototype,"color",void 0),o=r=e([c("esri.webmap.background.ColorBackground")],o);const u=o;export{u as default}; +import{v as e,S as a,ar as t,i as c,e as i,P as n}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";var r;let o=r=class extends i{constructor(s){super(s),this.color=new t([0,0,0,1])}clone(){return new r(n({color:this.color}))}};e([a({type:t,json:{write:!0}})],o.prototype,"color",void 0),o=r=e([c("esri.webmap.background.ColorBackground")],o);const u=o;export{u as default}; diff --git a/custom-toc-highlight/assets/ColorSet-DkIwOmgs-C-GAktW1.js b/custom-toc-highlight/assets/ColorSet-DkIwOmgs-Bdz0YXw-.js similarity index 95% rename from custom-toc-highlight/assets/ColorSet-DkIwOmgs-C-GAktW1.js rename to custom-toc-highlight/assets/ColorSet-DkIwOmgs-Bdz0YXw-.js index 7b27b7ba..f879fb81 100644 --- a/custom-toc-highlight/assets/ColorSet-DkIwOmgs-C-GAktW1.js +++ b/custom-toc-highlight/assets/ColorSet-DkIwOmgs-Bdz0YXw-.js @@ -1 +1 @@ -import{E as c,a8 as h}from"./Theme-rblUnB2V-D2UsCNGl.js";class u extends c{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty("colors")&&this.reset()}generateColors(){this.setPrivate("currentPass",this.getPrivate("currentPass",0)+1);const e=this.getPrivate("currentPass"),t=this.get("colors",[this.get("baseColor",h.fromHex(16711680))]);this.getPrivate("numColors")||this.setPrivate("numColors",t.length);const r=this.getPrivate("numColors"),g=0,a=this.get("passOptions"),P=this.get("reuse");for(let i=g;i1;)n-=1;let s=o.s+(a.saturation||0)*e;s>1&&(s=1),s<0&&(s=0);let l=o.l+(a.lightness||0)*e;for(;l>1;)l-=1;t.push(h.fromHSL(n,s,l))}}getIndex(e){const t=this.get("colors",[]),r=this.get("saturation");return e>=t.length?(this.generateColors(),this.getIndex(e)):r!=null?h.saturate(t[e],r):t[e]}next(){let e=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",e+this.get("step",1)),this.getIndex(e)}reset(){this.setPrivate("currentStep",this.get("startIndex",0)),this.setPrivate("currentPass",0)}}Object.defineProperty(u,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColorSet"}),Object.defineProperty(u,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:c.classNames.concat([u.className])});export{u as i}; +import{E as c,a8 as h}from"./Theme-rblUnB2V-Dc7wtY6B.js";class u extends c{_afterNew(){super._afterNewApplyThemes(),this._dirty.colors=!1}_beforeChanged(){this.isDirty("colors")&&this.reset()}generateColors(){this.setPrivate("currentPass",this.getPrivate("currentPass",0)+1);const e=this.getPrivate("currentPass"),t=this.get("colors",[this.get("baseColor",h.fromHex(16711680))]);this.getPrivate("numColors")||this.setPrivate("numColors",t.length);const r=this.getPrivate("numColors"),g=0,a=this.get("passOptions"),P=this.get("reuse");for(let i=g;i1;)n-=1;let s=o.s+(a.saturation||0)*e;s>1&&(s=1),s<0&&(s=0);let l=o.l+(a.lightness||0)*e;for(;l>1;)l-=1;t.push(h.fromHSL(n,s,l))}}getIndex(e){const t=this.get("colors",[]),r=this.get("saturation");return e>=t.length?(this.generateColors(),this.getIndex(e)):r!=null?h.saturate(t[e],r):t[e]}next(){let e=this.getPrivate("currentStep",this.get("startIndex",0));return this.setPrivate("currentStep",e+this.get("step",1)),this.getIndex(e)}reset(){this.setPrivate("currentStep",this.get("startIndex",0)),this.setPrivate("currentPass",0)}}Object.defineProperty(u,"className",{enumerable:!0,configurable:!0,writable:!0,value:"ColorSet"}),Object.defineProperty(u,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:c.classNames.concat([u.className])});export{u as i}; diff --git a/custom-toc-highlight/assets/Container-BcuL1ZEG-DxXVQv25.js b/custom-toc-highlight/assets/Container-BcuL1ZEG-DVZvemLA.js similarity index 98% rename from custom-toc-highlight/assets/Container-BcuL1ZEG-DxXVQv25.js rename to custom-toc-highlight/assets/Container-BcuL1ZEG-DVZvemLA.js index e2a1096d..5a138cc9 100644 --- a/custom-toc-highlight/assets/Container-BcuL1ZEG-DxXVQv25.js +++ b/custom-toc-highlight/assets/Container-BcuL1ZEG-DVZvemLA.js @@ -1 +1 @@ -import{v as a,S as o,i as m,j as v,K as R,a1 as O,P as _,b as p,I as S,a3 as q,cU as w,cV as g}from"./story-BfX8CRfG.js";import{e as I}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{c as V,C as F,O as M}from"./parser-DyDJ-rlI-C9jRH52J.js";const u=-1;let c=class extends v{constructor(t){super(t),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=R("mapview-transitions-duration"),this.effects=[]}set effect(t){if(this._get("effect")!==(t=t||"")){this._set("effect",t);try{this._transitionTo(y(t))}catch(e){this._transitionTo([]),O.getLogger(this).warn("Invalid Effect",{effect:t,error:e})}}}get final(){return this._final}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(t){this._updateForScale(t)}get transitioning(){return this._to!==null}canTransitionTo(t){try{return this.scale>0&&b(this._current,y(t),this.scale)}catch{return!1}}transitionStep(t,e){this._applyTimeTransition(t),this._updateForScale(e)}endTransition(){this._applyTimeTransition(this.duration)}_transitionTo(t){this.scale>0&&b(this._current,t,this.scale)?(this._final=t,this._to=_(t),C(this._current,this._to,this.scale),this._from=_(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=t),this._set("effects",this._current[0]?_(this._current[0].effects):[])}_applyTimeTransition(t){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=t;const e=Math.min(1,this._time/this.duration);for(let i=0;i=e[0].scale)s=r=e[0].effects;else if(t<=e[i].scale)s=r=e[i].effects;else for(let n=0;n=t&&h.scale<=t){l=(t-f.scale)/(h.scale-f.scale),r=f.effects,s=h.effects;break}}for(let n=0;n1||e.length>1)&&i<=0)&&F(t[0].effects,e[0].effects)}function C(t,e,i){const r=t.length>e.length?t:e,s=t.length>e.length?e:t,l=s[s.length-1],n=l?.scale??i,f=l?.effects??[];for(let h=s.length;hs?Math.max(s,l-n):Math.min(s,l+n),this.computedVisible=this.computedOpacity>0}}this.transitioning||(this._fadeInResolver?.(),this._fadeOutResolver?.(),this._fadeOutResolver=this._fadeInResolver=null)}};a([o()],d.prototype,"computedOpacity",void 0),a([o()],d.prototype,"computedVisible",void 0),a([o()],d.prototype,"opacity",void 0),a([o()],d.prototype,"visible",void 0),a([o()],d.prototype,"transitioning",null),a([o()],d.prototype,"_fadeOutResolver",void 0),a([o()],d.prototype,"_fadeInResolver",void 0),d=a([m("esri.views.2d.engine.transitions.FadeTransition")],d);class D extends S{constructor(){super(...arguments),this._transitionables=null,this._clips=null,this._fadeTransition=null,this._isReady=!1,this._opacity=1,this.parent=null,this._stage=null,this._visible=!0}get computedOpacity(){return this._fadeTransition?.computedOpacity??this.opacity}get clips(){return this._clips}set clips(e){this._clips=e,this.requestRender()}get fadeTransitionEnabled(){return this._fadeTransition!==null}set fadeTransitionEnabled(e){!this._fadeTransition&&e?(this._fadeTransition=new d({opacity:this.opacity,visible:this.visible}),this.addTransitionable(this._fadeTransition)):this._fadeTransition&&!e&&(this.removeTransitionable(this._fadeTransition),this._fadeTransition=null)}get inFadeTransition(){return this._fadeTransition?.transitioning??!1}get isReady(){return this._isReady}get opacity(){return this._opacity}set opacity(e){this._opacity!==e&&(this._opacity=Math.min(1,Math.max(e,0)),this._fadeTransition&&(this._fadeTransition.opacity=this._opacity),this.requestRender())}get stage(){return this._stage}set stage(e){if(this._stage===e)return;const i=this._stage;this._stage=e,e?this._stage?.untrashDisplayObject(this)||(this.onAttach(),this.emit("attach")):i?.trashDisplayObject(this)}get transforms(){return this._transforms==null&&(this._transforms=this._createTransforms()),this._transforms}get transitioning(){return this.isTransitioning()}get visible(){return this._visible}set visible(e){this._visible!==e&&(this._visible=e,this._fadeTransition&&(this._fadeTransition.visible=this._visible),this.requestRender())}get hasLabels(){return!1}get hasHighlight(){return!1}get hasBlending(){return!1}addTransitionable(e){this._transitionables??=[],this._transitionables.push(e),this.requestRender()}removeTransitionable(e){e.endTransition(),this._transitionables&&q(this._transitionables,e),this.requestRender()}fadeIn(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeIn();return this.opacity=1,this.requestRender(),e}fadeOut(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeOut();return this.opacity=0,this.requestRender(),e}endTransitions(){if(this._transitionables){for(const e of this._transitionables)e.endTransition();this.requestRender()}}beforeRender(e){this.transitionStep(e.deltaTime,e.state.scale),this.setTransform(e.state)}afterRender(e){this.transitioning&&this.requestRender()}remove(){this.parent?.removeChild(this)}setTransform(e){}processRender(e){this.stage&&(this._fadeTransition?.computedVisible??this.visible)&&this.doRender(e)}requestRender(){this.stage&&this.stage.requestRender()}processDetach(){this.endTransitions(),this.onDetach(),this.emit("detach")}isTransitioning(){return this._transitionables?.some(e=>e.transitioning)??!1}transitionStep(e,i){if(this._transitionables)for(const r of this._transitionables)r.transitionStep(e,i)}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}}let B=class extends D{constructor(){super(...arguments),this._childrenSet=new Set,this._needsSort=!1,this._children=[],this._childrenObservable=new w,this._effectView=null,this._highlightGradient=null}get blendMode(){return this._blendMode}set blendMode(t){this._blendMode=t,this.requestRender()}get children(){return g(this._childrenObservable),this._children}get clips(){return this._clips}set clips(t){this._clips=t,this.children.forEach(e=>e.clips=t)}get computedEffects(){return this._effectView?.effects??null}get effect(){return this._effectView?.effect??""}set effect(t){(this._effectView||t)&&(this._effectView||(this._effectView=new c,this.addTransitionable(this._effectView)),this._effectView.effect=t,this.requestRender())}get highlightGradient(){return this._highlightGradient}set highlightGradient(t){this._highlightGradient=t,this.requestRender()}get hasBlending(){return!!this.blendMode}get hasHighlight(){return this.children.some(t=>t.hasHighlight)}get hasLabels(){return this.children.some(t=>t.hasLabels)}get requiresDedicatedFBO(){return this.children.some(t=>"blendMode"in t&&t.blendMode&&t.blendMode!=="normal")}get isReady(){return this.children.every(t=>t.isReady)}get sortFunction(){return this._sortFunction}set sortFunction(t){this._sortFunction=t,t&&(this._needsSort=!0)}doRender(t){const e=this.createRenderParams(t),{painter:i}=e;i.beforeRenderLayer(e,this._clips?.length?255:0,this.computedOpacity),this.renderChildren(e),i.afterRenderLayer(e,this.computedOpacity)}addChild(t){return this.addChildAt(t,this.children.length)}addChildAt(t,e=this.children.length){if(!t||this.contains(t))return t;this._needsSort=!0;const i=t.parent;return i&&i!==this&&i.removeChild(t),e>=this.children.length?this.children.push(t):this.children.splice(e,0,t),this._childrenSet.add(t),t.parent=this,t.stage=this.stage,this!==this.stage&&(t.clips=this.clips),this.requestRender(),this._childrenObservable.notify(),t}contains(t){return g(this._childrenObservable),this._childrenSet.has(t)}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const t of this.children)this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null;this.children.length=0,this._childrenObservable.notify()}removeChild(t){return this.contains(t)?this.removeChildAt(this.children.indexOf(t)):t}removeChildAt(t){if(t<0||t>=this.children.length)return null;this._needsSort=!0;const e=this.children.splice(t,1)[0];return this._childrenSet.delete(e),this!==this.stage&&(e.clips=null),e.stage=null,e.parent=null,this._childrenObservable.notify(),e}beforeRender(t){super.beforeRender(t),this.sortFunction&&this._needsSort&&(this.children.sort(this.sortFunction),this._needsSort=!1,this._childrenObservable.notify());for(const e of this.children)e.beforeRender(t)}afterRender(t){super.afterRender(t);for(const e of this.children)e.afterRender(t)}_createTransforms(){return{displayViewScreenMat3:I()}}onAttach(){super.onAttach();const t=this.stage;for(const e of this.children)e.stage=t}onDetach(){super.onDetach();for(const t of this.children)t.stage=null}renderChildren(t){for(const e of this.children)e.processRender(t)}createRenderParams(t){return{...t,requireFBO:this.requiresDedicatedFBO,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:t.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||t.highlightGradient}}isTransitioning(){return super.isTransitioning()||this.children.some(t=>t.transitioning)}};export{D as T,c,B as x}; +import{v as a,S as o,i as m,j as v,K as R,a1 as O,P as _,b as p,I as S,a3 as q,cU as w,cV as g}from"./story-Doly9N9p.js";import{e as I}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{c as V,C as F,O as M}from"./parser-DyDJ-rlI-CvOs11Ip.js";const u=-1;let c=class extends v{constructor(t){super(t),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=R("mapview-transitions-duration"),this.effects=[]}set effect(t){if(this._get("effect")!==(t=t||"")){this._set("effect",t);try{this._transitionTo(y(t))}catch(e){this._transitionTo([]),O.getLogger(this).warn("Invalid Effect",{effect:t,error:e})}}}get final(){return this._final}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(t){this._updateForScale(t)}get transitioning(){return this._to!==null}canTransitionTo(t){try{return this.scale>0&&b(this._current,y(t),this.scale)}catch{return!1}}transitionStep(t,e){this._applyTimeTransition(t),this._updateForScale(e)}endTransition(){this._applyTimeTransition(this.duration)}_transitionTo(t){this.scale>0&&b(this._current,t,this.scale)?(this._final=t,this._to=_(t),C(this._current,this._to,this.scale),this._from=_(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=t),this._set("effects",this._current[0]?_(this._current[0].effects):[])}_applyTimeTransition(t){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=t;const e=Math.min(1,this._time/this.duration);for(let i=0;i=e[0].scale)s=r=e[0].effects;else if(t<=e[i].scale)s=r=e[i].effects;else for(let n=0;n=t&&h.scale<=t){l=(t-f.scale)/(h.scale-f.scale),r=f.effects,s=h.effects;break}}for(let n=0;n1||e.length>1)&&i<=0)&&F(t[0].effects,e[0].effects)}function C(t,e,i){const r=t.length>e.length?t:e,s=t.length>e.length?e:t,l=s[s.length-1],n=l?.scale??i,f=l?.effects??[];for(let h=s.length;hs?Math.max(s,l-n):Math.min(s,l+n),this.computedVisible=this.computedOpacity>0}}this.transitioning||(this._fadeInResolver?.(),this._fadeOutResolver?.(),this._fadeOutResolver=this._fadeInResolver=null)}};a([o()],d.prototype,"computedOpacity",void 0),a([o()],d.prototype,"computedVisible",void 0),a([o()],d.prototype,"opacity",void 0),a([o()],d.prototype,"visible",void 0),a([o()],d.prototype,"transitioning",null),a([o()],d.prototype,"_fadeOutResolver",void 0),a([o()],d.prototype,"_fadeInResolver",void 0),d=a([m("esri.views.2d.engine.transitions.FadeTransition")],d);class D extends S{constructor(){super(...arguments),this._transitionables=null,this._clips=null,this._fadeTransition=null,this._isReady=!1,this._opacity=1,this.parent=null,this._stage=null,this._visible=!0}get computedOpacity(){return this._fadeTransition?.computedOpacity??this.opacity}get clips(){return this._clips}set clips(e){this._clips=e,this.requestRender()}get fadeTransitionEnabled(){return this._fadeTransition!==null}set fadeTransitionEnabled(e){!this._fadeTransition&&e?(this._fadeTransition=new d({opacity:this.opacity,visible:this.visible}),this.addTransitionable(this._fadeTransition)):this._fadeTransition&&!e&&(this.removeTransitionable(this._fadeTransition),this._fadeTransition=null)}get inFadeTransition(){return this._fadeTransition?.transitioning??!1}get isReady(){return this._isReady}get opacity(){return this._opacity}set opacity(e){this._opacity!==e&&(this._opacity=Math.min(1,Math.max(e,0)),this._fadeTransition&&(this._fadeTransition.opacity=this._opacity),this.requestRender())}get stage(){return this._stage}set stage(e){if(this._stage===e)return;const i=this._stage;this._stage=e,e?this._stage?.untrashDisplayObject(this)||(this.onAttach(),this.emit("attach")):i?.trashDisplayObject(this)}get transforms(){return this._transforms==null&&(this._transforms=this._createTransforms()),this._transforms}get transitioning(){return this.isTransitioning()}get visible(){return this._visible}set visible(e){this._visible!==e&&(this._visible=e,this._fadeTransition&&(this._fadeTransition.visible=this._visible),this.requestRender())}get hasLabels(){return!1}get hasHighlight(){return!1}get hasBlending(){return!1}addTransitionable(e){this._transitionables??=[],this._transitionables.push(e),this.requestRender()}removeTransitionable(e){e.endTransition(),this._transitionables&&q(this._transitionables,e),this.requestRender()}fadeIn(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeIn();return this.opacity=1,this.requestRender(),e}fadeOut(){this.fadeTransitionEnabled=!0;const e=this._fadeTransition.fadeOut();return this.opacity=0,this.requestRender(),e}endTransitions(){if(this._transitionables){for(const e of this._transitionables)e.endTransition();this.requestRender()}}beforeRender(e){this.transitionStep(e.deltaTime,e.state.scale),this.setTransform(e.state)}afterRender(e){this.transitioning&&this.requestRender()}remove(){this.parent?.removeChild(this)}setTransform(e){}processRender(e){this.stage&&(this._fadeTransition?.computedVisible??this.visible)&&this.doRender(e)}requestRender(){this.stage&&this.stage.requestRender()}processDetach(){this.endTransitions(),this.onDetach(),this.emit("detach")}isTransitioning(){return this._transitionables?.some(e=>e.transitioning)??!1}transitionStep(e,i){if(this._transitionables)for(const r of this._transitionables)r.transitionStep(e,i)}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}}let B=class extends D{constructor(){super(...arguments),this._childrenSet=new Set,this._needsSort=!1,this._children=[],this._childrenObservable=new w,this._effectView=null,this._highlightGradient=null}get blendMode(){return this._blendMode}set blendMode(t){this._blendMode=t,this.requestRender()}get children(){return g(this._childrenObservable),this._children}get clips(){return this._clips}set clips(t){this._clips=t,this.children.forEach(e=>e.clips=t)}get computedEffects(){return this._effectView?.effects??null}get effect(){return this._effectView?.effect??""}set effect(t){(this._effectView||t)&&(this._effectView||(this._effectView=new c,this.addTransitionable(this._effectView)),this._effectView.effect=t,this.requestRender())}get highlightGradient(){return this._highlightGradient}set highlightGradient(t){this._highlightGradient=t,this.requestRender()}get hasBlending(){return!!this.blendMode}get hasHighlight(){return this.children.some(t=>t.hasHighlight)}get hasLabels(){return this.children.some(t=>t.hasLabels)}get requiresDedicatedFBO(){return this.children.some(t=>"blendMode"in t&&t.blendMode&&t.blendMode!=="normal")}get isReady(){return this.children.every(t=>t.isReady)}get sortFunction(){return this._sortFunction}set sortFunction(t){this._sortFunction=t,t&&(this._needsSort=!0)}doRender(t){const e=this.createRenderParams(t),{painter:i}=e;i.beforeRenderLayer(e,this._clips?.length?255:0,this.computedOpacity),this.renderChildren(e),i.afterRenderLayer(e,this.computedOpacity)}addChild(t){return this.addChildAt(t,this.children.length)}addChildAt(t,e=this.children.length){if(!t||this.contains(t))return t;this._needsSort=!0;const i=t.parent;return i&&i!==this&&i.removeChild(t),e>=this.children.length?this.children.push(t):this.children.splice(e,0,t),this._childrenSet.add(t),t.parent=this,t.stage=this.stage,this!==this.stage&&(t.clips=this.clips),this.requestRender(),this._childrenObservable.notify(),t}contains(t){return g(this._childrenObservable),this._childrenSet.has(t)}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const t of this.children)this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null;this.children.length=0,this._childrenObservable.notify()}removeChild(t){return this.contains(t)?this.removeChildAt(this.children.indexOf(t)):t}removeChildAt(t){if(t<0||t>=this.children.length)return null;this._needsSort=!0;const e=this.children.splice(t,1)[0];return this._childrenSet.delete(e),this!==this.stage&&(e.clips=null),e.stage=null,e.parent=null,this._childrenObservable.notify(),e}beforeRender(t){super.beforeRender(t),this.sortFunction&&this._needsSort&&(this.children.sort(this.sortFunction),this._needsSort=!1,this._childrenObservable.notify());for(const e of this.children)e.beforeRender(t)}afterRender(t){super.afterRender(t);for(const e of this.children)e.afterRender(t)}_createTransforms(){return{displayViewScreenMat3:I()}}onAttach(){super.onAttach();const t=this.stage;for(const e of this.children)e.stage=t}onDetach(){super.onDetach();for(const t of this.children)t.stage=null}renderChildren(t){for(const e of this.children)e.processRender(t)}createRenderParams(t){return{...t,requireFBO:this.requiresDedicatedFBO,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:t.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition,highlightGradient:this._highlightGradient||t.highlightGradient}}isTransitioning(){return super.isTransitioning()||this.children.some(t=>t.transitioning)}};export{D as T,c,B as x}; diff --git a/custom-toc-highlight/assets/CustomParametersMixin-vdKsTHer-BOFVTNLw.js b/custom-toc-highlight/assets/CustomParametersMixin-vdKsTHer-5EfrrVMH.js similarity index 82% rename from custom-toc-highlight/assets/CustomParametersMixin-vdKsTHer-BOFVTNLw.js rename to custom-toc-highlight/assets/CustomParametersMixin-vdKsTHer-5EfrrVMH.js index 1257c437..20dd446a 100644 --- a/custom-toc-highlight/assets/CustomParametersMixin-vdKsTHer-BOFVTNLw.js +++ b/custom-toc-highlight/assets/CustomParametersMixin-vdKsTHer-5EfrrVMH.js @@ -1 +1 @@ -import{v as r,S as o,i}from"./story-BfX8CRfG.js";const n=s=>{let e=class extends s{constructor(){super(...arguments),this.customParameters=null}};return r([o({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=r([i("esri.layers.mixins.CustomParametersMixin")],e),e};export{n as i}; +import{v as r,S as o,i}from"./story-Doly9N9p.js";const n=s=>{let e=class extends s{constructor(){super(...arguments),this.customParameters=null}};return r([o({type:Object,json:{write:{overridePolicy:t=>({enabled:!!(t&&Object.keys(t).length>0)})}}})],e.prototype,"customParameters",void 0),e=r([i("esri.layers.mixins.CustomParametersMixin")],e),e};export{n as i}; diff --git a/custom-toc-highlight/assets/Cyclical-C_9rKUUQ-Dl9v9oo8.js b/custom-toc-highlight/assets/Cyclical-C_9rKUUQ-DyGueJyk.js similarity index 92% rename from custom-toc-highlight/assets/Cyclical-C_9rKUUQ-Dl9v9oo8.js rename to custom-toc-highlight/assets/Cyclical-C_9rKUUQ-DyGueJyk.js index 2ef7e505..5decc337 100644 --- a/custom-toc-highlight/assets/Cyclical-C_9rKUUQ-Dl9v9oo8.js +++ b/custom-toc-highlight/assets/Cyclical-C_9rKUUQ-DyGueJyk.js @@ -1 +1 @@ -import{ae as r}from"./story-BfX8CRfG.js";class h{constructor(n,i){this.min=n,this.max=i,this.range=i-n}normalize(n,i=0,o=!1){return e(this.range,this.min,this.max,n,i,o)}clamp(n,i=0){return r(n-i,this.min,this.max)+i}monotonic(n,i,o){return nn&&oi&&(o-=a(t,o-i)),m&&o===i&&(o=n),o+s}function a(t,n,i=0){return Math.ceil((n-i)/t)*t+i}const u=new h(0,360);export{u as c,h as o}; +import{ae as r}from"./story-Doly9N9p.js";class h{constructor(n,i){this.min=n,this.max=i,this.range=i-n}normalize(n,i=0,o=!1){return e(this.range,this.min,this.max,n,i,o)}clamp(n,i=0){return r(n-i,this.min,this.max)+i}monotonic(n,i,o){return nn&&oi&&(o-=a(t,o-i)),m&&o===i&&(o=n),o+s}function a(t,n,i=0){return Math.ceil((n-i)/t)*t+i}const u=new h(0,360);export{u as c,h as o}; diff --git a/custom-toc-highlight/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-9voYmtHA.js b/custom-toc-highlight/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-k4xDAsKM.js similarity index 96% rename from custom-toc-highlight/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-9voYmtHA.js rename to custom-toc-highlight/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-k4xDAsKM.js index 3506d523..689c9ffd 100644 --- a/custom-toc-highlight/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-9voYmtHA.js +++ b/custom-toc-highlight/assets/DefaultMaterial_COLOR_GAMMA-D0o2czi9-k4xDAsKM.js @@ -1 +1 @@ -import{hc as m,k4 as B,k5 as _,k6 as b,cw as g,$ as h,k7 as S,f as w,b6 as j,W as I,o as A,hU as T}from"./story-BfX8CRfG.js";import{A as R,h as O}from"./Indices-DEr2HrWx-BuNk6xPZ.js";import{T as l}from"./enums-DBi1-Mm2-CUS1pvQe.js";function k(e,r){d(e.typedBuffer,r.typedBuffer,e.typedBufferStride,r.typedBufferStride)}function d(e,r,f=2,n=f){const o=r.length/2;let t=0,u=0;if(m(r)||B(r)){for(let i=0;i{g.set(s,p)})}class b extends R{setupDefaultRules(){super.setupDefaultRules();const s=this._root.language,o=this._root.interfaceColors,d=this._root.horizontalLayout,p=this._root.verticalLayout,e=this.rule.bind(this);e("InterfaceColors").setAll({stroke:i.fromHex(15066597),fill:i.fromHex(15987699),primaryButton:i.fromHex(6788316),primaryButtonHover:i.fromHex(6779356),primaryButtonDown:i.fromHex(6872182),primaryButtonActive:i.fromHex(6872182),primaryButtonDisabled:i.fromHex(14342874),primaryButtonTextDisabled:i.fromHex(16777215),primaryButtonText:i.fromHex(16777215),primaryButtonStroke:i.fromHex(16777215),secondaryButton:i.fromHex(14277081),secondaryButtonHover:i.fromHex(10724259),secondaryButtonDown:i.fromHex(9276813),secondaryButtonActive:i.fromHex(15132390),secondaryButtonText:i.fromHex(0),secondaryButtonStroke:i.fromHex(16777215),grid:i.fromHex(0),background:i.fromHex(16777215),alternativeBackground:i.fromHex(0),text:i.fromHex(0),alternativeText:i.fromHex(16777215),disabled:i.fromHex(11382189),positive:i.fromHex(5288704),negative:i.fromHex(11730944)});{const t=e("ColorSet");t.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[i.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),t.setPrivate("currentStep",0),t.setPrivate("currentPass",0)}e("Entity").setAll({stateAnimationDuration:0,stateAnimationEasing:c(u)}),e("Component").setAll({interpolationDuration:0,interpolationEasing:c(u)}),e("Sprite").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:"relative",tooltipX:n,tooltipY:n,tooltipPosition:"fixed",isMeasured:!0}),e("Sprite").states.create("default",{visible:!0,opacity:1}),e("Container").setAll({interactiveChildren:!0,setStateOnChildren:!1}),e("Graphics").setAll({strokeWidth:1}),e("Chart").setAll({width:r,height:r,interactiveChildren:!1}),e("ZoomableContainer").setAll({width:r,height:r,wheelable:!0,pinchZoom:!0,maxZoomLevel:32,minZoomLevel:1,zoomStep:2,animationEasing:c(u),animationDuration:600,maxPanOut:.4}),e("Sprite",["horizontal","center"]).setAll({centerX:n,x:n}),e("Sprite",["vertical","center"]).setAll({centerY:n,y:n}),e("Container",["horizontal","layout"]).setAll({layout:d}),e("Container",["vertical","layout"]).setAll({layout:p}),e("Pattern").setAll({repetition:"repeat",width:50,height:50,rotation:0,fillOpacity:1}),e("LinePattern").setAll({gap:6,colorOpacity:1,width:49,height:49}),e("RectanglePattern").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),e("CirclePattern").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),e("GrainPattern").setAll({width:200,height:200,colors:[i.fromHex(0)],size:1,horizontalGap:0,verticalGap:0,density:1,minOpacity:0,maxOpacity:.2});{const t=e("PatternSet");t.setAll({step:1}),a(t,"color",o,"stroke")}e("LinearGradient").setAll({rotation:90}),e("Legend").setAll({fillField:"fill",strokeField:"stroke",nameField:"name",layout:m.new(this._root,{}),layer:30,clickTarget:"itemContainer"}),e("Container",["legend","item","itemcontainer"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:d,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:s.translate("Press ENTER to toggle"),role:"checkbox"});{const t=e("Rectangle",["legend","item","background"]);t.setAll({fillOpacity:0}),a(t,"fill",o,"background")}e("Container",["legend","marker"]).setAll({setStateOnChildren:!0,centerY:n,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),e("RoundedRectangle",["legend","marker","rectangle"]).setAll({width:r,height:r,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const t=e("RoundedRectangle",["legend","marker","rectangle"]).states.create("disabled",{});a(t,"fill",o,"disabled"),a(t,"stroke",o,"disabled")}e("Label",["legend","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0}),a(e("Label",["legend","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("Label",["legend","value","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:r,populateText:!0}),a(e("Label",["legend","value","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("HeatLegend").setAll({stepCount:1}),e("RoundedRectangle",["heatlegend","marker"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),e("RoundedRectangle",["vertical","heatlegend","marker"]).setAll({height:r,width:15}),e("RoundedRectangle",["horizontal","heatlegend","marker"]).setAll({width:r,height:15}),e("HeatLegend",["vertical"]).setAll({height:r}),e("HeatLegend",["horizontal"]).setAll({width:r}),e("Label",["heatlegend","start"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),e("Label",["heatlegend","end"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const t=e("Label");t.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"1em",populateText:!1}),a(t,"fill",o,"text")}e("RadialLabel").setAll({textType:"regular",centerY:n,centerX:n,inside:!1,radius:0,baseRadius:r,orientation:"auto",textAlign:"center"}),e("EditableLabel").setAll({editOn:"click",themeTags:["editablelabel"],multiLine:!0}),e("RoundedRectangle",["editablelabel","background"]).setAll({fillOpacity:0,fill:i.fromHex(0),cornerRadiusBL:3,cornerRadiusBR:3,cornerRadiusTL:3,cornerRadiusTR:3,strokeOpacity:0,stroke:i.fromHex(0)}),e("RoundedRectangle",["editablelabel","background"]).states.create("active",{strokeOpacity:.2}),e("RoundedRectangle").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),e("PointedRectangle").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),e("Slice").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const t=e("Tick");t.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:"absolute",crisp:!0}),a(t,"stroke",o,"grid")}e("Bullet").setAll({locationX:.5,locationY:.5}),e("Tooltip").setAll({position:"absolute",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:"vertical",centerX:n,centerY:n,animationEasing:c(u),exportable:!1}),e("Polygon").setAll({animationEasing:c(u)}),e("PointedRectangle",["tooltip","background"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:i.fromHex(16777215)});{const t=e("Label",["tooltip"]);t.setAll({role:"tooltip",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),a(t,"fill",o,"alternativeText")}e("Button").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:d,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),e("Button").states.create("hover",{}),e("Button").states.create("down",{stateAnimationDuration:0}),e("Button").states.create("active",{}),e("Button").states.create("disabled",{forceInactive:!0});{const t=e("RoundedRectangle",["button","background"]);a(t,"fill",o,"primaryButton"),a(t,"stroke",o,"primaryButtonStroke")}a(e("RoundedRectangle",["button","background"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["button","background"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown"),a(e("RoundedRectangle",["button","background"]).states.create("active",{}),"fill",o,"primaryButtonActive"),a(e("RoundedRectangle",["button","background"]).states.create("disabled",{}),"fill",o,"primaryButtonDisabled"),a(e("Graphics",["button","icon"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled"),a(e("Label",["button"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled");{const t=e("Graphics",["button","icon"]);t.setAll({forceInactive:!0}),a(t,"stroke",o,"primaryButtonText")}a(e("Label",["button"]),"fill",o,"primaryButtonText"),e("Button",["zoom"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:r,role:"button",ariaLabel:s.translate("Zoom Out"),layer:30});{const t=e("RoundedRectangle",["background","button","zoom"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"primaryButton")}a(e("RoundedRectangle",["background","button","zoom"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["background","button","zoom"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown");{const t=e("Graphics",["icon","button","zoom"]);t.setAll({crisp:!0,strokeOpacity:.7,draw:l=>{l.moveTo(0,0),l.lineTo(12,0)}}),a(t,"stroke",o,"primaryButtonText")}e("Button",["resize"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:n,centerY:n,position:"absolute",role:"slider",ariaValueMin:"0",ariaValueMax:"100",ariaLabel:s.translate("Use up and down arrows to move selection")});{const t=e("RoundedRectangle",["background","resize","button"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"secondaryButton"),a(t,"stroke",o,"secondaryButtonStroke")}a(e("RoundedRectangle",["background","resize","button"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["background","resize","button"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown");{const t=e("Graphics",["resize","button","icon"]);t.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),a(t,"stroke",o,"secondaryButtonText")}e("Button",["resize","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize"}),e("Button",["resize","horizontal"]).setAll({cursorOverStyle:"ew-resize"}),e("Button",["play"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:s.translate("Play"),toggleKey:"active"});{const t=e("RoundedRectangle",["play","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Graphics",["play","icon"]);t.setAll({stateAnimationDuration:0,dx:1,draw:l=>{l.moveTo(0,-5),l.lineTo(8,0),l.lineTo(0,5),l.lineTo(0,-5)}}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["play","icon"]).states.create("default",{stateAnimationDuration:0}),e("Graphics",["play","icon"]).states.create("active",{stateAnimationDuration:0,draw:t=>{t.moveTo(-4,-5),t.lineTo(-1,-5),t.lineTo(-1,5),t.lineTo(-4,5),t.lineTo(-4,-5),t.moveTo(4,-5),t.lineTo(1,-5),t.lineTo(1,5),t.lineTo(4,5),t.lineTo(4,-5)}}),e("Button",["switch"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:s.translate("Press ENTER to toggle"),toggleKey:"active",width:40,height:24,layout:null});{const t=e("RoundedRectangle",["switch","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Circle",["switch","icon"]);t.setAll({radius:8,centerY:0,centerX:0,dx:0}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["switch","icon"]).states.create("active",{dx:16}),e("Scrollbar").setAll({start:0,end:1,layer:30,animationEasing:c(u)}),e("Scrollbar",["vertical"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:r}),e("Scrollbar",["horizontal"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:r}),this.rule("Button",["scrollbar"]).setAll({exportable:!1});{const t=e("RoundedRectangle",["scrollbar","main","background"]);t.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),a(t,"fill",o,"fill")}{const t=e("RoundedRectangle",["scrollbar","thumb"]);t.setAll({role:"slider",ariaLive:"polite",position:"absolute",draggable:!0}),a(t,"fill",o,"secondaryButton")}a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown"),e("RoundedRectangle",["scrollbar","thumb","vertical"]).setAll({x:n,width:r,centerX:n,ariaLabel:s.translate("Use up and down arrows to move selection")}),e("RoundedRectangle",["scrollbar","thumb","horizontal"]).setAll({y:n,centerY:n,height:r,ariaLabel:s.translate("Use left and right arrows to move selection")});{const t=e("PointedRectangle",["axis","tooltip","background"]);t.setAll({cornerRadius:0}),a(t,"fill",o,"alternativeBackground")}e("Label",["axis","tooltip"]).setAll({role:void 0}),e("Label",["axis","tooltip","y"]).setAll({textAlign:"right"}),e("Label",["axis","tooltip","y","opposite"]).setAll({textAlign:"left"}),e("Label",["axis","tooltip","x"]).setAll({textAlign:"center"}),e("Tooltip",["categoryaxis"]).setAll({labelText:"{category}"}),e("Star").setAll({spikes:5,innerRadius:5,radius:10}),e("Tooltip",["stock"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),e("PointedRectangle",["tooltip","stock","axis"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),e("Label",["tooltip","stock"]).setAll({fontSize:"0.8em"}),e("SpriteResizer").setAll({rotationStep:10,isMeasured:!1}),e("Container",["resizer","grip"]).states.create("hover",{});{const t=e("RoundedRectangle",["resizer","grip"]);t.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),a(t,"fill",o,"background"),a(t,"stroke",o,"alternativeBackground")}{const t=e("RoundedRectangle",["resizer","grip","outline"]);t.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),t.states.create("hover",{fillOpacity:.3}),a(t,"fill",o,"alternativeBackground")}e("RoundedRectangle",["resizer","grip","left"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),e("RoundedRectangle",["resizer","grip","right"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const t=e("Rectangle",["resizer","rectangle"]);t.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),a(t,"stroke",o,"alternativeBackground")}e("Graphics",["button","plus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0),t.moveTo(0,-4),t.lineTo(0,4)}}),e("Graphics",["button","minus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0)}}),e("Graphics",["button","home","icon"]).setAll({x:n,y:n,svgPath:"M 8 -1 L 6 -1 L 6 7 L 2 7 L 2 1 L -2 1 L -2 7 L -6 7 L -6 -1 L -8 -1 L 0 -9 L 8 -1 Z M 8 -1"}),e("Button",["zoomtools"]).setAll({marginTop:1,marginBottom:2}),e("ZoomTools").setAll({x:r,centerX:r,y:r,centerY:r,paddingRight:10,paddingBottom:10})}}export{b as h,a as o}; +import{ar as R,a8 as i,as as c,at as n,U as r,Y as m,au as u}from"./Theme-rblUnB2V-Dc7wtY6B.js";function a(g,s,o,d){g.set(s,o.get(d)),o.on(d,p=>{g.set(s,p)})}class b extends R{setupDefaultRules(){super.setupDefaultRules();const s=this._root.language,o=this._root.interfaceColors,d=this._root.horizontalLayout,p=this._root.verticalLayout,e=this.rule.bind(this);e("InterfaceColors").setAll({stroke:i.fromHex(15066597),fill:i.fromHex(15987699),primaryButton:i.fromHex(6788316),primaryButtonHover:i.fromHex(6779356),primaryButtonDown:i.fromHex(6872182),primaryButtonActive:i.fromHex(6872182),primaryButtonDisabled:i.fromHex(14342874),primaryButtonTextDisabled:i.fromHex(16777215),primaryButtonText:i.fromHex(16777215),primaryButtonStroke:i.fromHex(16777215),secondaryButton:i.fromHex(14277081),secondaryButtonHover:i.fromHex(10724259),secondaryButtonDown:i.fromHex(9276813),secondaryButtonActive:i.fromHex(15132390),secondaryButtonText:i.fromHex(0),secondaryButtonStroke:i.fromHex(16777215),grid:i.fromHex(0),background:i.fromHex(16777215),alternativeBackground:i.fromHex(0),text:i.fromHex(0),alternativeText:i.fromHex(16777215),disabled:i.fromHex(11382189),positive:i.fromHex(5288704),negative:i.fromHex(11730944)});{const t=e("ColorSet");t.setAll({passOptions:{hue:.05,saturation:0,lightness:0},colors:[i.fromHex(6797276)],step:1,reuse:!1,startIndex:0}),t.setPrivate("currentStep",0),t.setPrivate("currentPass",0)}e("Entity").setAll({stateAnimationDuration:0,stateAnimationEasing:c(u)}),e("Component").setAll({interpolationDuration:0,interpolationEasing:c(u)}),e("Sprite").setAll({visible:!0,scale:1,opacity:1,rotation:0,position:"relative",tooltipX:n,tooltipY:n,tooltipPosition:"fixed",isMeasured:!0}),e("Sprite").states.create("default",{visible:!0,opacity:1}),e("Container").setAll({interactiveChildren:!0,setStateOnChildren:!1}),e("Graphics").setAll({strokeWidth:1}),e("Chart").setAll({width:r,height:r,interactiveChildren:!1}),e("ZoomableContainer").setAll({width:r,height:r,wheelable:!0,pinchZoom:!0,maxZoomLevel:32,minZoomLevel:1,zoomStep:2,animationEasing:c(u),animationDuration:600,maxPanOut:.4}),e("Sprite",["horizontal","center"]).setAll({centerX:n,x:n}),e("Sprite",["vertical","center"]).setAll({centerY:n,y:n}),e("Container",["horizontal","layout"]).setAll({layout:d}),e("Container",["vertical","layout"]).setAll({layout:p}),e("Pattern").setAll({repetition:"repeat",width:50,height:50,rotation:0,fillOpacity:1}),e("LinePattern").setAll({gap:6,colorOpacity:1,width:49,height:49}),e("RectanglePattern").setAll({gap:6,checkered:!1,centered:!0,maxWidth:5,maxHeight:5,width:48,height:48,strokeWidth:0}),e("CirclePattern").setAll({gap:5,checkered:!1,centered:!1,radius:3,strokeWidth:0,width:45,height:45}),e("GrainPattern").setAll({width:200,height:200,colors:[i.fromHex(0)],size:1,horizontalGap:0,verticalGap:0,density:1,minOpacity:0,maxOpacity:.2});{const t=e("PatternSet");t.setAll({step:1}),a(t,"color",o,"stroke")}e("LinearGradient").setAll({rotation:90}),e("Legend").setAll({fillField:"fill",strokeField:"stroke",nameField:"name",layout:m.new(this._root,{}),layer:30,clickTarget:"itemContainer"}),e("Container",["legend","item","itemcontainer"]).setAll({paddingLeft:5,paddingRight:5,paddingBottom:5,paddingTop:5,layout:d,setStateOnChildren:!0,interactiveChildren:!1,ariaChecked:!0,focusable:!0,ariaLabel:s.translate("Press ENTER to toggle"),role:"checkbox"});{const t=e("Rectangle",["legend","item","background"]);t.setAll({fillOpacity:0}),a(t,"fill",o,"background")}e("Container",["legend","marker"]).setAll({setStateOnChildren:!0,centerY:n,paddingLeft:0,paddingRight:0,paddingBottom:0,paddingTop:0,width:18,height:18}),e("RoundedRectangle",["legend","marker","rectangle"]).setAll({width:r,height:r,cornerRadiusBL:3,cornerRadiusTL:3,cornerRadiusBR:3,cornerRadiusTR:3});{const t=e("RoundedRectangle",["legend","marker","rectangle"]).states.create("disabled",{});a(t,"fill",o,"disabled"),a(t,"stroke",o,"disabled")}e("Label",["legend","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,populateText:!0}),a(e("Label",["legend","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("Label",["legend","value","label"]).setAll({centerY:n,marginLeft:5,paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:0,width:50,centerX:r,populateText:!0}),a(e("Label",["legend","value","label"]).states.create("disabled",{}),"fill",o,"disabled"),e("HeatLegend").setAll({stepCount:1}),e("RoundedRectangle",["heatlegend","marker"]).setAll({cornerRadiusTR:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusBL:0}),e("RoundedRectangle",["vertical","heatlegend","marker"]).setAll({height:r,width:15}),e("RoundedRectangle",["horizontal","heatlegend","marker"]).setAll({width:r,height:15}),e("HeatLegend",["vertical"]).setAll({height:r}),e("HeatLegend",["horizontal"]).setAll({width:r}),e("Label",["heatlegend","start"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5}),e("Label",["heatlegend","end"]).setAll({paddingLeft:5,paddingRight:5,paddingTop:5,paddingBottom:5});{const t=e("Label");t.setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"1em",populateText:!1}),a(t,"fill",o,"text")}e("RadialLabel").setAll({textType:"regular",centerY:n,centerX:n,inside:!1,radius:0,baseRadius:r,orientation:"auto",textAlign:"center"}),e("EditableLabel").setAll({editOn:"click",themeTags:["editablelabel"],multiLine:!0}),e("RoundedRectangle",["editablelabel","background"]).setAll({fillOpacity:0,fill:i.fromHex(0),cornerRadiusBL:3,cornerRadiusBR:3,cornerRadiusTL:3,cornerRadiusTR:3,strokeOpacity:0,stroke:i.fromHex(0)}),e("RoundedRectangle",["editablelabel","background"]).states.create("active",{strokeOpacity:.2}),e("RoundedRectangle").setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8}),e("PointedRectangle").setAll({pointerBaseWidth:15,pointerLength:10,cornerRadius:8}),e("Slice").setAll({shiftRadius:0,dRadius:0,dInnerRadius:0});{const t=e("Tick");t.setAll({strokeOpacity:.15,isMeasured:!1,length:4.5,position:"absolute",crisp:!0}),a(t,"stroke",o,"grid")}e("Bullet").setAll({locationX:.5,locationY:.5}),e("Tooltip").setAll({position:"absolute",getFillFromSprite:!0,getStrokeFromSprite:!1,autoTextColor:!0,paddingTop:9,paddingBottom:8,paddingLeft:10,paddingRight:10,marginBottom:5,pointerOrientation:"vertical",centerX:n,centerY:n,animationEasing:c(u),exportable:!1}),e("Polygon").setAll({animationEasing:c(u)}),e("PointedRectangle",["tooltip","background"]).setAll({strokeOpacity:.9,cornerRadius:4,pointerLength:4,pointerBaseWidth:8,fillOpacity:.9,stroke:i.fromHex(16777215)});{const t=e("Label",["tooltip"]);t.setAll({role:"tooltip",populateText:!0,paddingRight:0,paddingTop:0,paddingLeft:0,paddingBottom:0}),a(t,"fill",o,"alternativeText")}e("Button").setAll({paddingTop:8,paddingBottom:8,paddingLeft:10,paddingRight:10,interactive:!0,layout:d,interactiveChildren:!1,setStateOnChildren:!0,focusable:!0}),e("Button").states.create("hover",{}),e("Button").states.create("down",{stateAnimationDuration:0}),e("Button").states.create("active",{}),e("Button").states.create("disabled",{forceInactive:!0});{const t=e("RoundedRectangle",["button","background"]);a(t,"fill",o,"primaryButton"),a(t,"stroke",o,"primaryButtonStroke")}a(e("RoundedRectangle",["button","background"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["button","background"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown"),a(e("RoundedRectangle",["button","background"]).states.create("active",{}),"fill",o,"primaryButtonActive"),a(e("RoundedRectangle",["button","background"]).states.create("disabled",{}),"fill",o,"primaryButtonDisabled"),a(e("Graphics",["button","icon"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled"),a(e("Label",["button"]).states.create("disabled",{}),"fill",o,"primaryButtonTextDisabled");{const t=e("Graphics",["button","icon"]);t.setAll({forceInactive:!0}),a(t,"stroke",o,"primaryButtonText")}a(e("Label",["button"]),"fill",o,"primaryButtonText"),e("Button",["zoom"]).setAll({paddingTop:18,paddingBottom:18,paddingLeft:12,paddingRight:12,centerX:46,centerY:-10,y:0,x:r,role:"button",ariaLabel:s.translate("Zoom Out"),layer:30});{const t=e("RoundedRectangle",["background","button","zoom"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"primaryButton")}a(e("RoundedRectangle",["background","button","zoom"]).states.create("hover",{}),"fill",o,"primaryButtonHover"),a(e("RoundedRectangle",["background","button","zoom"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"primaryButtonDown");{const t=e("Graphics",["icon","button","zoom"]);t.setAll({crisp:!0,strokeOpacity:.7,draw:l=>{l.moveTo(0,0),l.lineTo(12,0)}}),a(t,"stroke",o,"primaryButtonText")}e("Button",["resize"]).setAll({paddingTop:9,paddingBottom:9,paddingLeft:13,paddingRight:13,draggable:!0,centerX:n,centerY:n,position:"absolute",role:"slider",ariaValueMin:"0",ariaValueMax:"100",ariaLabel:s.translate("Use up and down arrows to move selection")});{const t=e("RoundedRectangle",["background","resize","button"]);t.setAll({cornerRadiusBL:40,cornerRadiusBR:40,cornerRadiusTL:40,cornerRadiusTR:40}),a(t,"fill",o,"secondaryButton"),a(t,"stroke",o,"secondaryButtonStroke")}a(e("RoundedRectangle",["background","resize","button"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["background","resize","button"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown");{const t=e("Graphics",["resize","button","icon"]);t.setAll({interactive:!1,crisp:!0,strokeOpacity:.5,draw:l=>{l.moveTo(0,.5),l.lineTo(0,12.5),l.moveTo(4,.5),l.lineTo(4,12.5)}}),a(t,"stroke",o,"secondaryButtonText")}e("Button",["resize","vertical"]).setAll({rotation:90,cursorOverStyle:"ns-resize"}),e("Button",["resize","horizontal"]).setAll({cursorOverStyle:"ew-resize"}),e("Button",["play"]).setAll({paddingTop:13,paddingBottom:13,paddingLeft:14,paddingRight:14,ariaLabel:s.translate("Play"),toggleKey:"active"});{const t=e("RoundedRectangle",["play","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Graphics",["play","icon"]);t.setAll({stateAnimationDuration:0,dx:1,draw:l=>{l.moveTo(0,-5),l.lineTo(8,0),l.lineTo(0,5),l.lineTo(0,-5)}}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["play","icon"]).states.create("default",{stateAnimationDuration:0}),e("Graphics",["play","icon"]).states.create("active",{stateAnimationDuration:0,draw:t=>{t.moveTo(-4,-5),t.lineTo(-1,-5),t.lineTo(-1,5),t.lineTo(-4,5),t.lineTo(-4,-5),t.moveTo(4,-5),t.lineTo(1,-5),t.lineTo(1,5),t.lineTo(4,5),t.lineTo(4,-5)}}),e("Button",["switch"]).setAll({paddingTop:4,paddingBottom:4,paddingLeft:4,paddingRight:4,ariaLabel:s.translate("Press ENTER to toggle"),toggleKey:"active",width:40,height:24,layout:null});{const t=e("RoundedRectangle",["switch","background"]);t.setAll({strokeOpacity:.5,cornerRadiusBL:100,cornerRadiusBR:100,cornerRadiusTL:100,cornerRadiusTR:100}),a(t,"fill",o,"primaryButton")}{const t=e("Circle",["switch","icon"]);t.setAll({radius:8,centerY:0,centerX:0,dx:0}),a(t,"fill",o,"primaryButtonText")}e("Graphics",["switch","icon"]).states.create("active",{dx:16}),e("Scrollbar").setAll({start:0,end:1,layer:30,animationEasing:c(u)}),e("Scrollbar",["vertical"]).setAll({marginRight:13,marginLeft:13,minWidth:12,height:r}),e("Scrollbar",["horizontal"]).setAll({marginTop:13,marginBottom:13,minHeight:12,width:r}),this.rule("Button",["scrollbar"]).setAll({exportable:!1});{const t=e("RoundedRectangle",["scrollbar","main","background"]);t.setAll({cornerRadiusTL:8,cornerRadiusBL:8,cornerRadiusTR:8,cornerRadiusBR:8,fillOpacity:.8}),a(t,"fill",o,"fill")}{const t=e("RoundedRectangle",["scrollbar","thumb"]);t.setAll({role:"slider",ariaLive:"polite",position:"absolute",draggable:!0}),a(t,"fill",o,"secondaryButton")}a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("hover",{}),"fill",o,"secondaryButtonHover"),a(e("RoundedRectangle",["scrollbar","thumb"]).states.create("down",{stateAnimationDuration:0}),"fill",o,"secondaryButtonDown"),e("RoundedRectangle",["scrollbar","thumb","vertical"]).setAll({x:n,width:r,centerX:n,ariaLabel:s.translate("Use up and down arrows to move selection")}),e("RoundedRectangle",["scrollbar","thumb","horizontal"]).setAll({y:n,centerY:n,height:r,ariaLabel:s.translate("Use left and right arrows to move selection")});{const t=e("PointedRectangle",["axis","tooltip","background"]);t.setAll({cornerRadius:0}),a(t,"fill",o,"alternativeBackground")}e("Label",["axis","tooltip"]).setAll({role:void 0}),e("Label",["axis","tooltip","y"]).setAll({textAlign:"right"}),e("Label",["axis","tooltip","y","opposite"]).setAll({textAlign:"left"}),e("Label",["axis","tooltip","x"]).setAll({textAlign:"center"}),e("Tooltip",["categoryaxis"]).setAll({labelText:"{category}"}),e("Star").setAll({spikes:5,innerRadius:5,radius:10}),e("Tooltip",["stock"]).setAll({paddingTop:6,paddingBottom:5,paddingLeft:7,paddingRight:7}),e("PointedRectangle",["tooltip","stock","axis"]).setAll({pointerLength:0,pointerBaseWidth:0,cornerRadius:3}),e("Label",["tooltip","stock"]).setAll({fontSize:"0.8em"}),e("SpriteResizer").setAll({rotationStep:10,isMeasured:!1}),e("Container",["resizer","grip"]).states.create("hover",{});{const t=e("RoundedRectangle",["resizer","grip"]);t.setAll({strokeOpacity:.7,strokeWidth:1,fillOpacity:1,width:12,height:12}),a(t,"fill",o,"background"),a(t,"stroke",o,"alternativeBackground")}{const t=e("RoundedRectangle",["resizer","grip","outline"]);t.setAll({strokeOpacity:0,fillOpacity:0,width:20,height:20}),t.states.create("hover",{fillOpacity:.3}),a(t,"fill",o,"alternativeBackground")}e("RoundedRectangle",["resizer","grip","left"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0}),e("RoundedRectangle",["resizer","grip","right"]).setAll({cornerRadiusBL:0,cornerRadiusBR:0,cornerRadiusTL:0,cornerRadiusTR:0});{const t=e("Rectangle",["resizer","rectangle"]);t.setAll({strokeDasharray:[2,2],strokeOpacity:.5,strokeWidth:1}),a(t,"stroke",o,"alternativeBackground")}e("Graphics",["button","plus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0),t.moveTo(0,-4),t.lineTo(0,4)}}),e("Graphics",["button","minus","icon"]).setAll({x:n,y:n,draw:t=>{t.moveTo(-4,0),t.lineTo(4,0)}}),e("Graphics",["button","home","icon"]).setAll({x:n,y:n,svgPath:"M 8 -1 L 6 -1 L 6 7 L 2 7 L 2 1 L -2 1 L -2 7 L -6 7 L -6 -1 L -8 -1 L 0 -9 L 8 -1 Z M 8 -1"}),e("Button",["zoomtools"]).setAll({marginTop:1,marginBottom:2}),e("ZoomTools").setAll({x:r,centerX:r,y:r,centerY:r,paddingRight:10,paddingBottom:10})}}export{b as h,a as o}; diff --git a/custom-toc-highlight/assets/DeleteForwardEditsParameters-C-_YAZEH-CFtVONl6.js b/custom-toc-highlight/assets/DeleteForwardEditsParameters-C-_YAZEH-BmXPSua1.js similarity index 75% rename from custom-toc-highlight/assets/DeleteForwardEditsParameters-C-_YAZEH-CFtVONl6.js rename to custom-toc-highlight/assets/DeleteForwardEditsParameters-C-_YAZEH-BmXPSua1.js index 618ae419..f7f6489d 100644 --- a/custom-toc-highlight/assets/DeleteForwardEditsParameters-C-_YAZEH-CFtVONl6.js +++ b/custom-toc-highlight/assets/DeleteForwardEditsParameters-C-_YAZEH-BmXPSua1.js @@ -1 +1 @@ -import{v as r,S as o,i as n,e as a,aO as m}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";var s;let t=s=class extends a{static from(e){return m(s,e)}constructor(e){super(e),this.sessionId=void 0,this.moment=null}};r([o({type:String,json:{write:!0}})],t.prototype,"sessionId",void 0),r([o({type:Date,json:{type:Number,write:{writer:(e,i)=>{i.moment=e?e.getTime():null}}}})],t.prototype,"moment",void 0),t=s=r([n("esri.rest.versionManagement.gdbVersion.support.DeleteForwardEditsParameters")],t);const l=t;export{l as default}; +import{v as r,S as o,i as n,e as a,aO as m}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";var s;let t=s=class extends a{static from(e){return m(s,e)}constructor(e){super(e),this.sessionId=void 0,this.moment=null}};r([o({type:String,json:{write:!0}})],t.prototype,"sessionId",void 0),r([o({type:Date,json:{type:Number,write:{writer:(e,i)=>{i.moment=e?e.getTime():null}}}})],t.prototype,"moment",void 0),t=s=r([n("esri.rest.versionManagement.gdbVersion.support.DeleteForwardEditsParameters")],t);const l=t;export{l as default}; diff --git a/custom-toc-highlight/assets/DimensionLayer-DFh7fPYo-D38O23av.js b/custom-toc-highlight/assets/DimensionLayer-DFh7fPYo-BMjvVx5w.js similarity index 89% rename from custom-toc-highlight/assets/DimensionLayer-DFh7fPYo-D38O23av.js rename to custom-toc-highlight/assets/DimensionLayer-DFh7fPYo-BMjvVx5w.js index 318e7adf..60eef2f6 100644 --- a/custom-toc-highlight/assets/DimensionLayer-DFh7fPYo-D38O23av.js +++ b/custom-toc-highlight/assets/DimensionLayer-DFh7fPYo-BMjvVx5w.js @@ -1 +1 @@ -import{bA as P,ar as d,v as t,S as n,bB as h,dN as w,es as D,i as m,w as v,ad as S,ab as z,ag as R,dA as E,ah as N,ax as j,ac as A,aP as O,am as _,n as b}from"./story-BfX8CRfG.js";import{y as k}from"./Analysis-BPgJ-FCw-D6W8PmkR.js";import{c as C}from"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import{X as L}from"./projection-BA9M1R7d-BYoCXVXt.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as B}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{E as H}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import"./main-ugzBrWNm.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";let r=class extends P(O){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([n({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],r.prototype,"type",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"color",void 0),t([n({type:Number,cast:w,nonNullable:!0,range:{min:D(1)},json:{write:{isRequired:!0}}})],r.prototype,"lineSize",void 0),t([n({type:Number,cast:w,nonNullable:!0,json:{write:{isRequired:!0}}})],r.prototype,"fontSize",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textColor",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textBackgroundColor",void 0),r=t([m("esri.analysis.DimensionSimpleStyle")],r);const g=r;var y;(function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Direct="direct"})(y||(y={}));const F=[y.Horizontal,y.Vertical,y.Direct];let l=class extends P(O){constructor(e){super(e),this.type="length",this.startPoint=null,this.endPoint=null,this.measureType=y.Direct,this.offset=0,this.orientation=0}};t([n({type:["length"],json:{write:{isRequired:!0}}})],l.prototype,"type",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"startPoint",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"endPoint",void 0),t([n({type:F,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"measureType",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"offset",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),S(e=>C.normalize(z(e),0,!0))],l.prototype,"orientation",void 0),l=t([m("esri.analysis.LengthDimension")],l);const q=l,f=R.ofType(q);let p=class extends k{constructor(e){super(e),this.type="dimension",this.style=new g,this.extent=null}initialize(){this.addHandles(N(()=>this._computeExtent(),e=>{e?.pending==null&&this._set("extent",e!=null?e.extent:null)},j))}get dimensions(){return this._get("dimensions")||new f}set dimensions(e){this._set("dimensions",_(e,this.dimensions,f))}get spatialReference(){for(const e of this.dimensions){if(e.startPoint!=null)return e.startPoint.spatialReference;if(e.endPoint!=null)return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,i)=>(e.push(i.startPoint,i.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(e==null)return{pending:null,extent:null};const i=[];for(const o of this.dimensions)o.startPoint!=null&&i.push(o.startPoint),o.endPoint!=null&&i.push(o.endPoint);const a=L(i,e);if(a.pending!=null)return{pending:a.pending,extent:null};let c=null;return a.geometries!=null&&(c=a.geometries.reduce((o,u)=>o==null?u!=null?b.fromPoint(u):null:u!=null?o.union(b.fromPoint(u)):o,null)),{pending:null,extent:c}}clear(){this.dimensions.removeAll()}};t([n({type:["dimension"]})],p.prototype,"type",void 0),t([n({cast:E,type:f,nonNullable:!0})],p.prototype,"dimensions",null),t([n({readOnly:!0})],p.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},nonNullable:!0})],p.prototype,"style",void 0),t([n({value:null,readOnly:!0})],p.prototype,"extent",void 0),t([n({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([m("esri.analysis.DimensionAnalysis")],p);const x=p;let s=class extends H(T(B)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new x,this.opacity=1,e){const{source:i,style:a}=e;i&&a&&(i.style=a)}}initialize(){this.addHandles([N(()=>this.source,(e,i)=>{i!=null&&i.parent===this&&(i.parent=null),e!=null&&(e.parent=this)},j)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return 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 x)}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,i,a,c){i.dimensions=e.filter(({startPoint:o,endPoint:u})=>o!=null&&u!=null).map(o=>o.toJSON(c)).toJSON()}};t([n({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),t([n({type:["ArcGISDimensionLayer"]})],s.prototype,"operationalLayerType",void 0),t([n({nonNullable:!0})],s.prototype,"source",void 0),t([n({readOnly:!0})],s.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},json:{write:{ignoreOrigin:!0}}})],s.prototype,"style",null),t([n({readOnly:!0})],s.prototype,"fullExtent",null),t([n({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}}}})],s.prototype,"opacity",void 0),t([n({type:["show","hide"]})],s.prototype,"listMode",void 0),t([n({type:R.ofType(q),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],s.prototype,"dimensions",null),t([A("web-scene","dimensions")],s.prototype,"writeDimensions",null),s=t([m("esri.layers.DimensionLayer")],s);const ee=s;export{ee as default}; +import{bA as P,ar as d,v as t,S as n,bB as h,dN as w,es as D,i as m,w as v,ad as S,ab as z,ag as R,dA as E,ah as N,ax as j,ac as A,aP as O,am as _,n as b}from"./story-Doly9N9p.js";import{y as k}from"./Analysis-BPgJ-FCw-CJ_Utx59.js";import{c as C}from"./Cyclical-C_9rKUUQ-DyGueJyk.js";import{X as L}from"./projection-BA9M1R7d-CAbqHZiw.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as B}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{E as H}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import"./main-QGPoLsvl.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";let r=class extends P(O){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([n({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],r.prototype,"type",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"color",void 0),t([n({type:Number,cast:w,nonNullable:!0,range:{min:D(1)},json:{write:{isRequired:!0}}})],r.prototype,"lineSize",void 0),t([n({type:Number,cast:w,nonNullable:!0,json:{write:{isRequired:!0}}})],r.prototype,"fontSize",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textColor",void 0),t([n({type:d,nonNullable:!0,json:{type:[h],write:{isRequired:!0}}})],r.prototype,"textBackgroundColor",void 0),r=t([m("esri.analysis.DimensionSimpleStyle")],r);const g=r;var y;(function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Direct="direct"})(y||(y={}));const F=[y.Horizontal,y.Vertical,y.Direct];let l=class extends P(O){constructor(e){super(e),this.type="length",this.startPoint=null,this.endPoint=null,this.measureType=y.Direct,this.offset=0,this.orientation=0}};t([n({type:["length"],json:{write:{isRequired:!0}}})],l.prototype,"type",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"startPoint",void 0),t([n({type:v,json:{write:!0}})],l.prototype,"endPoint",void 0),t([n({type:F,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"measureType",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"offset",void 0),t([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),S(e=>C.normalize(z(e),0,!0))],l.prototype,"orientation",void 0),l=t([m("esri.analysis.LengthDimension")],l);const q=l,f=R.ofType(q);let p=class extends k{constructor(e){super(e),this.type="dimension",this.style=new g,this.extent=null}initialize(){this.addHandles(N(()=>this._computeExtent(),e=>{e?.pending==null&&this._set("extent",e!=null?e.extent:null)},j))}get dimensions(){return this._get("dimensions")||new f}set dimensions(e){this._set("dimensions",_(e,this.dimensions,f))}get spatialReference(){for(const e of this.dimensions){if(e.startPoint!=null)return e.startPoint.spatialReference;if(e.endPoint!=null)return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,i)=>(e.push(i.startPoint,i.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return e!=null?e.pending:Promise.resolve()}_computeExtent(){const e=this.spatialReference;if(e==null)return{pending:null,extent:null};const i=[];for(const o of this.dimensions)o.startPoint!=null&&i.push(o.startPoint),o.endPoint!=null&&i.push(o.endPoint);const a=L(i,e);if(a.pending!=null)return{pending:a.pending,extent:null};let c=null;return a.geometries!=null&&(c=a.geometries.reduce((o,u)=>o==null?u!=null?b.fromPoint(u):null:u!=null?o.union(b.fromPoint(u)):o,null)),{pending:null,extent:c}}clear(){this.dimensions.removeAll()}};t([n({type:["dimension"]})],p.prototype,"type",void 0),t([n({cast:E,type:f,nonNullable:!0})],p.prototype,"dimensions",null),t([n({readOnly:!0})],p.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},nonNullable:!0})],p.prototype,"style",void 0),t([n({value:null,readOnly:!0})],p.prototype,"extent",void 0),t([n({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([m("esri.analysis.DimensionAnalysis")],p);const x=p;let s=class extends H(T(B)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new x,this.opacity=1,e){const{source:i,style:a}=e;i&&a&&(i.style=a)}}initialize(){this.addHandles([N(()=>this.source,(e,i)=>{i!=null&&i.parent===this&&(i.parent=null),e!=null&&(e.parent=this)},j)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return 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 x)}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,i,a,c){i.dimensions=e.filter(({startPoint:o,endPoint:u})=>o!=null&&u!=null).map(o=>o.toJSON(c)).toJSON()}};t([n({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),t([n({type:["ArcGISDimensionLayer"]})],s.prototype,"operationalLayerType",void 0),t([n({nonNullable:!0})],s.prototype,"source",void 0),t([n({readOnly:!0})],s.prototype,"spatialReference",null),t([n({types:{key:"type",base:null,typeMap:{simple:g}},json:{write:{ignoreOrigin:!0}}})],s.prototype,"style",null),t([n({readOnly:!0})],s.prototype,"fullExtent",null),t([n({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}}}})],s.prototype,"opacity",void 0),t([n({type:["show","hide"]})],s.prototype,"listMode",void 0),t([n({type:R.ofType(q),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],s.prototype,"dimensions",null),t([A("web-scene","dimensions")],s.prototype,"writeDimensions",null),s=t([m("esri.layers.DimensionLayer")],s);const ee=s;export{ee as default}; diff --git a/custom-toc-highlight/assets/EdgeProcessingWorker-DpfeS31e-DC_uae2i.js b/custom-toc-highlight/assets/EdgeProcessingWorker-DpfeS31e-BlB2l1n2.js similarity index 86% rename from custom-toc-highlight/assets/EdgeProcessingWorker-DpfeS31e-DC_uae2i.js rename to custom-toc-highlight/assets/EdgeProcessingWorker-DpfeS31e-BlB2l1n2.js index 63152b3f..331bae4a 100644 --- a/custom-toc-highlight/assets/EdgeProcessingWorker-DpfeS31e-DC_uae2i.js +++ b/custom-toc-highlight/assets/EdgeProcessingWorker-DpfeS31e-BlB2l1n2.js @@ -1 +1 @@ -import{W as p}from"./InterleavedLayout-DXzw3B2n-iCEii9j9.js";import{W as l,m as c,u,l as f,H as d,k as m}from"./edgeProcessing-CALv8P-b-BbEOWK4a.js";import"./BufferView-PQoE3GL7-Duht5lAO.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-CQcmF3ab.js";import"./Indices-DEr2HrWx-BuNk6xPZ.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./glUtil-n1JOrdV3-CRAZdee5.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";function a(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:new p(t.layout)}}class F{async extract(e){const i=o(e),r=l(i),n=[i.data.buffer];return{result:g(r,n),transferList:n}}async extractComponentsEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,w),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}async extractEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,L),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}}function o(t){return{data:f.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 g(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 h{allocate(e){return d.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1)}}class y{allocate(e){return m.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1),e.componentIndex.set(i,r.componentIndex)}}const L=new h,w=new y;export{F as default}; +import{W as p}from"./InterleavedLayout-DXzw3B2n-BlOPeZMB.js";import{W as l,m as c,u,l as f,H as d,k as m}from"./edgeProcessing-CALv8P-b-sDvNynj9.js";import"./BufferView-PQoE3GL7-B9DLdqO9.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-CTlujluz.js";import"./Indices-DEr2HrWx-cFTwC5-9.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./glUtil-n1JOrdV3-CRAZdee5.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";function a(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:new p(t.layout)}}class F{async extract(e){const i=o(e),r=l(i),n=[i.data.buffer];return{result:g(r,n),transferList:n}}async extractComponentsEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,w),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}async extractEdgeLocations(e){const i=o(e),r=c(i.data,i.skipDeduplicate,i.indices,i.indicesLength),n=u(r,L),s=[];return{result:a(n.regular.instancesData,s),transferList:s}}}function o(t){return{data:f.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 g(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 h{allocate(e){return d.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1)}}class y{allocate(e){return m.createBuffer(e)}trim(e,i){return e.slice(0,i)}write(e,i,r){e.position0.setVec(i,r.position0),e.position1.setVec(i,r.position1),e.componentIndex.set(i,r.componentIndex)}}const L=new h,w=new y;export{F as default}; diff --git a/custom-toc-highlight/assets/EditBusLayer-Df29OyJh-DkVkxUAl.js b/custom-toc-highlight/assets/EditBusLayer-Df29OyJh-OmdJOLws.js similarity index 88% rename from custom-toc-highlight/assets/EditBusLayer-Df29OyJh-DkVkxUAl.js rename to custom-toc-highlight/assets/EditBusLayer-Df29OyJh-OmdJOLws.js index 10999506..7fc79896 100644 --- a/custom-toc-highlight/assets/EditBusLayer-Df29OyJh-DkVkxUAl.js +++ b/custom-toc-highlight/assets/EditBusLayer-Df29OyJh-OmdJOLws.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./deleteForwardEdits-BHWvOnK8-C0YwmPr6.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./utils-9sQxfkoa-KicvrT8N.js","./DeleteForwardEditsParameters-C-_YAZEH-CFtVONl6.js"])))=>i.map(i=>d[i]); -import{_ as E}from"./main-ugzBrWNm.js";import{I as R,v as w,S as L,i as k,f as P,b as T,P as m}from"./story-BfX8CRfG.js";import{c as x}from"./uuid-Dj9mdEVg-BaKSCiyT.js";const D=x(),j=new Map,V=new Map;async function z(e,r,d){if(!e||!d)return!1;if(!r)return!0;const s=new URL(e).host;let i=j.get(s);if(!i){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");i=(await P(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return i===r}async function C(e,r,d=!1){if(!e||!r)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=V.get(s)?.entries();if(i){for(const[t,o]of i)if(o.name===r){const a=!o.stack?.hasForwardEdits();if(!a&&d){const[{deleteForwardEdits:u},{default:h}]=await Promise.all([E(()=>import("./deleteForwardEdits-BHWvOnK8-C0YwmPr6.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),E(()=>import("./DeleteForwardEditsParameters-C-_YAZEH-CFtVONl6.js"),__vite__mapDeps([6,1,2,3,4]),import.meta.url)]),c=await u(s,t,new h({sessionId:D,moment:o.moment}));return c.success&&o.stack?.clearForwardEdits(),c.success}return a}}return!0}function $(e,r){if(!e)return!1;const d=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),s=V.get(d)?.entries();if(s){for(const[i,t]of s)if(t.name===r)return t.lockType==="edit"}return!1}const I=new R.EventEmitter;function N(e){return I.on("apply-edits",new WeakRef(e))}function W(e){return I.on("update-moment",new WeakRef(e))}function G(e,r,d=null,s=!1){const i=T();return s=r==null||s,I.emit("apply-edits",{serviceUrl:e,layerId:r,gdbVersion:d,mayReceiveServiceEdits:s,result:i.promise}),i}const A=Symbol();function J(e){return e!=null&&typeof e=="object"&&A in e}function p(e){return e!=null&&typeof e=="object"&&"gdbVersion"in e}function g(e,r,d){const s=new URL(e).host,i=j.get(s),t=o=>!o||o===i;return t(r)&&t(d)||r===d}const K=e=>{var r;let d=class extends e{constructor(...s){super(...s),this[r]=!0,this._applyEditsHandler=i=>{const{serviceUrl:t,layerId:o,gdbVersion:a,mayReceiveServiceEdits:u,result:h}=i,c=t===this.url,f=o!=null&&this.layerId!=null&&o===this.layerId,S=p(this),H=p(this)&&g(t,a,this.gdbVersion);if(!c||S&&!H||!f&&!u)return;const U=h.then(n=>{if(this.lastEditsEventDate=new Date,f&&(n.addedFeatures.length||n.updatedFeatures.length||n.deletedFeatures.length||n.addedAttachments.length||n.updatedAttachments.length||n.deletedAttachments.length))return this.emit("edits",m(n)),n;const M=n.editedFeatures?.find(({layerId:F})=>F===this.layerId);if(M){const{adds:F,updates:y,deletes:v}=M.editedFeatures,_={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:F?F.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],deletedFeatures:v?v.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],updatedFeatures:y?y.map(({current:{attributes:l}})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return this.emit("edits",_),_}const b={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,b.historicMoment)&&this.emit("edits",b),b}).then(n=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,n.historicMoment)&&(this.historicMoment=n.historicMoment),n));this.emit("apply-edits",{result:U})},this._updateMomentHandler=i=>{const{serviceUrl:t,gdbVersion:o,moment:a}=i,u=t===this.url,h=p(this),c=p(this)&&g(t,o,this.gdbVersion),f=p(this)&&!g(t,this.gdbVersion,null);u&&h&&c&&f&&"historicMoment"in this&&this.historicMoment!==a&&(this.historicMoment=a)},this.when().then(()=>{this.addHandles(N(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(W(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(s,i,t){return"historicMoment"in this&&this.historicMoment!==t&&$(s,i)}};return r=A,w([L()],d.prototype,"lastEditsEventDate",void 0),d=w([k("esri.layers.mixins.EditBusLayer")],d),d};export{J as B,K as C,$ as H,z as P,C as W,D as j,G as z}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./deleteForwardEdits-BHWvOnK8-P72OARG2.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./utils-9sQxfkoa-D8FX0sO8.js","./DeleteForwardEditsParameters-C-_YAZEH-BmXPSua1.js"])))=>i.map(i=>d[i]); +import{_ as E}from"./main-QGPoLsvl.js";import{I as R,v as w,S as L,i as k,f as P,b as T,P as m}from"./story-Doly9N9p.js";import{c as x}from"./uuid-Dj9mdEVg-BaKSCiyT.js";const D=x(),j=new Map,V=new Map;async function z(e,r,d){if(!e||!d)return!1;if(!r)return!0;const s=new URL(e).host;let i=j.get(s);if(!i){const t=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");i=(await P(t,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}return i===r}async function C(e,r,d=!1){if(!e||!r)return!0;const s=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),i=V.get(s)?.entries();if(i){for(const[t,o]of i)if(o.name===r){const a=!o.stack?.hasForwardEdits();if(!a&&d){const[{deleteForwardEdits:u},{default:h}]=await Promise.all([E(()=>import("./deleteForwardEdits-BHWvOnK8-P72OARG2.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),E(()=>import("./DeleteForwardEditsParameters-C-_YAZEH-BmXPSua1.js"),__vite__mapDeps([6,1,2,3,4]),import.meta.url)]),c=await u(s,t,new h({sessionId:D,moment:o.moment}));return c.success&&o.stack?.clearForwardEdits(),c.success}return a}}return!0}function $(e,r){if(!e)return!1;const d=e.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,""),s=V.get(d)?.entries();if(s){for(const[i,t]of s)if(t.name===r)return t.lockType==="edit"}return!1}const I=new R.EventEmitter;function N(e){return I.on("apply-edits",new WeakRef(e))}function W(e){return I.on("update-moment",new WeakRef(e))}function G(e,r,d=null,s=!1){const i=T();return s=r==null||s,I.emit("apply-edits",{serviceUrl:e,layerId:r,gdbVersion:d,mayReceiveServiceEdits:s,result:i.promise}),i}const A=Symbol();function J(e){return e!=null&&typeof e=="object"&&A in e}function p(e){return e!=null&&typeof e=="object"&&"gdbVersion"in e}function g(e,r,d){const s=new URL(e).host,i=j.get(s),t=o=>!o||o===i;return t(r)&&t(d)||r===d}const K=e=>{var r;let d=class extends e{constructor(...s){super(...s),this[r]=!0,this._applyEditsHandler=i=>{const{serviceUrl:t,layerId:o,gdbVersion:a,mayReceiveServiceEdits:u,result:h}=i,c=t===this.url,f=o!=null&&this.layerId!=null&&o===this.layerId,S=p(this),H=p(this)&&g(t,a,this.gdbVersion);if(!c||S&&!H||!f&&!u)return;const U=h.then(n=>{if(this.lastEditsEventDate=new Date,f&&(n.addedFeatures.length||n.updatedFeatures.length||n.deletedFeatures.length||n.addedAttachments.length||n.updatedAttachments.length||n.deletedAttachments.length))return this.emit("edits",m(n)),n;const M=n.editedFeatures?.find(({layerId:F})=>F===this.layerId);if(M){const{adds:F,updates:y,deletes:v}=M.editedFeatures,_={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:F?F.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],deletedFeatures:v?v.map(({attributes:l})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],updatedFeatures:y?y.map(({current:{attributes:l}})=>({objectId:this.objectIdField&&l[this.objectIdField],globalId:this.globalIdField&&l[this.globalIdField]})):[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return this.emit("edits",_),_}const b={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:m(n.editedFeatures),exceededTransferLimit:!1,historicMoment:m(n.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,b.historicMoment)&&this.emit("edits",b),b}).then(n=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(t,a,n.historicMoment)&&(this.historicMoment=n.historicMoment),n));this.emit("apply-edits",{result:U})},this._updateMomentHandler=i=>{const{serviceUrl:t,gdbVersion:o,moment:a}=i,u=t===this.url,h=p(this),c=p(this)&&g(t,o,this.gdbVersion),f=p(this)&&!g(t,this.gdbVersion,null);u&&h&&c&&f&&"historicMoment"in this&&this.historicMoment!==a&&(this.historicMoment=a)},this.when().then(()=>{this.addHandles(N(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(W(this._updateMomentHandler))},()=>{})}_shouldUpdateHistoricMoment(s,i,t){return"historicMoment"in this&&this.historicMoment!==t&&$(s,i)}};return r=A,w([L()],d.prototype,"lastEditsEventDate",void 0),d=w([k("esri.layers.mixins.EditBusLayer")],d),d};export{J as B,K as C,$ as H,z as P,C as W,D as j,G as z}; diff --git a/custom-toc-highlight/assets/ElevationInfo-yv2-9tj6-C2hC6Vpl.js b/custom-toc-highlight/assets/ElevationInfo-yv2-9tj6-CkIHeL1t.js similarity index 95% rename from custom-toc-highlight/assets/ElevationInfo-yv2-9tj6-C2hC6Vpl.js rename to custom-toc-highlight/assets/ElevationInfo-yv2-9tj6-CkIHeL1t.js index b29c1160..826ab6a8 100644 --- a/custom-toc-highlight/assets/ElevationInfo-yv2-9tj6-C2hC6Vpl.js +++ b/custom-toc-highlight/assets/ElevationInfo-yv2-9tj6-CkIHeL1t.js @@ -1 +1 @@ -import{v as s,S as o,cr as m,aK as y,a0 as E,ac as v,e as l,d7 as I,i as d,a3 as w,d8 as g}from"./story-BfX8CRfG.js";import{m as x}from"./lengthUtils-DKpMe5qR-C2NPRwwl.js";var u;let i=u=class extends l{constructor(e){super(e)}async collectRequiredFields(e,t){return I(e,t,this.expression)}clone(){return new u({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};s([o({type:String,json:{write:!0}})],i.prototype,"expression",void 0),s([o({type:String,json:{write:!0}})],i.prototype,"title",void 0),i=u=s([d("esri.symbols.support.FeatureExpressionInfo")],i);const p=i;function S(e){return 1/(x[e]||1)}function j(){const e=Object.keys(x);return w(e,"decimal-degrees"),e.sort(),e}const b=j();var a;const n=m()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),f=new y({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let r=a=class extends l{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return e??(t.featureExpression&&t.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(e,t,h,c){t[h]=e.write({},c),e.expression==="0"&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):e!=null||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 a({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&&g(this.featureExpressionInfo,e.featureExpressionInfo)}};s([o({type:p,json:{write:!0}})],r.prototype,"featureExpressionInfo",void 0),s([E("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],r.prototype,"readFeatureExpressionInfo",null),s([v("featureExpressionInfo",{featureExpressionInfo:{type:p},"featureExpression.value":{type:[0]}})],r.prototype,"writeFeatureExpressionInfo",null),s([o({type:n.apiValues,nonNullable:!0,json:{type:n.jsonValues,read:n.read,write:{writer:n.write,isRequired:!0}}})],r.prototype,"mode",null),s([o({type:Number,json:{write:!0}})],r.prototype,"offset",void 0),s([o({type:b,json:{type:String,read:f.read,write:f.write}})],r.prototype,"unit",null),r=a=s([d("esri.symbols.support.ElevationInfo")],r);const _=r;export{S as j,_ as q}; +import{v as s,S as o,cr as m,aK as y,a0 as E,ac as v,e as l,d7 as I,i as d,a3 as w,d8 as g}from"./story-Doly9N9p.js";import{m as x}from"./lengthUtils-DKpMe5qR-CsqJSDh_.js";var u;let i=u=class extends l{constructor(e){super(e)}async collectRequiredFields(e,t){return I(e,t,this.expression)}clone(){return new u({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};s([o({type:String,json:{write:!0}})],i.prototype,"expression",void 0),s([o({type:String,json:{write:!0}})],i.prototype,"title",void 0),i=u=s([d("esri.symbols.support.FeatureExpressionInfo")],i);const p=i;function S(e){return 1/(x[e]||1)}function j(){const e=Object.keys(x);return w(e,"decimal-degrees"),e.sort(),e}const b=j();var a;const n=m()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),f=new y({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let r=a=class extends l{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return e??(t.featureExpression&&t.featureExpression.value===0?{expression:"0"}:void 0)}writeFeatureExpressionInfo(e,t,h,c){t[h]=e.write({},c),e.expression==="0"&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):e!=null||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 a({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&&g(this.featureExpressionInfo,e.featureExpressionInfo)}};s([o({type:p,json:{write:!0}})],r.prototype,"featureExpressionInfo",void 0),s([E("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],r.prototype,"readFeatureExpressionInfo",null),s([v("featureExpressionInfo",{featureExpressionInfo:{type:p},"featureExpression.value":{type:[0]}})],r.prototype,"writeFeatureExpressionInfo",null),s([o({type:n.apiValues,nonNullable:!0,json:{type:n.jsonValues,read:n.read,write:{writer:n.write,isRequired:!0}}})],r.prototype,"mode",null),s([o({type:Number,json:{write:!0}})],r.prototype,"offset",void 0),s([o({type:b,json:{type:String,read:f.read,write:f.write}})],r.prototype,"unit",null),r=a=s([d("esri.symbols.support.ElevationInfo")],r);const _=r;export{S as j,_ as q}; diff --git a/custom-toc-highlight/assets/ElevationLayer-G6y-P-jo-Dn65xXOv.js b/custom-toc-highlight/assets/ElevationLayer-G6y-P-jo-DIAelIek.js similarity index 81% rename from custom-toc-highlight/assets/ElevationLayer-G6y-P-jo-Dn65xXOv.js rename to custom-toc-highlight/assets/ElevationLayer-G6y-P-jo-DIAelIek.js index eeedb790..240d7df7 100644 --- a/custom-toc-highlight/assets/ElevationLayer-G6y-P-jo-Dn65xXOv.js +++ b/custom-toc-highlight/assets/ElevationLayer-G6y-P-jo-DIAelIek.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-BRPoXapf.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./TileKey-B_6qmYK--BtZdR-Xy.js"])))=>i.map(i=>d[i]); -import{_ as c}from"./main-ugzBrWNm.js";import{U as f,o as g,W as w,f as m,X as V,$ as u,v as o,S as l,a0 as y,i as b,a1 as T,a2 as D,a3 as S}from"./story-BfX8CRfG.js";import{m as L}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{M as x}from"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import{D as E}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{O as $}from"./ArcGISCachedService-C64Ko1TY-9EmQxNmS.js";import{a as k}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{E as I}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as M}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{Z as O}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{q as N}from"./workers-PiCjreoO-idkDTJa3.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-BhR83GZf.js";import"./TilemapCache-CRRxws77-BBkZHUXn.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";class A{constructor(e,t,i,a){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=t,this.height=i,this.noDataValue=a)}get hasNoDataValues(){if(this._hasNoDataValues==null){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(this._minValue!=null)return;const{noDataValue:e,values:t}=this;let i=1/0,a=-1/0,h=!0;for(const n of t)n===e?this._hasNoDataValues=!0:(i=na?n:a,h=!1);h?(this._minValue=0,this._maxValue=0):(this._minValue=i,this._maxValue=a>-3e38?a:0)}}class C{constructor(e,t,i,a,h={}){this._mainMethod=t,this._transferLists=i,this._listeners=[],this._promise=N(e,{...h,schedule:a}).then(n=>{if(this._thread===void 0){this._thread=n,this._promise=null,h.hasInitialize&&this.broadcast({},"initialize");for(const p of this._listeners)this._connectListener(p)}else n.close()}),this._promise.catch(n=>T.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${n}`))}on(e,t){const i={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(i),this._connectListener(i),D(()=>{i.removed=!0,S(this._listeners,i),this._thread&&i.threadHandle!=null&&i.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,i){if(this._thread){const a=this._transferLists[e],h=a?a(t):[];return this._thread.invoke(e,t,{transferList:h,signal:i})}return this._promise?this._promise.then(()=>(u(i),this.invokeMethod(e,t,i))):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 v extends C{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,i){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},i):Promise.resolve(null)}release(){--this.ref<=0&&(d.forEach((e,t)=>{e===this&&d.delete(t)}),this.destroy())}}const d=new Map;function P(r=null){let e=d.get(r);return e||(r!=null?(e=new v(t=>r.immediate.schedule(t)),d.set(r,e)):(e=new v,d.set(null,e))),++e.ref,e}let s=class extends $(k(I(M(L(E))))){constructor(...r){super(...r),this.capabilities={operations:{supportsTileMap:!1}},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=P()}normalizeCtorArgs(r,e){return typeof r=="string"?{url:r,...e}:r}destroy(){this._lercDecoder=f(this._lercDecoder)}readCapabilities(r,e){const t=e.capabilities&&e.capabilities.split(",").map(i=>i.toLowerCase().trim());return t?{operations:{supportsTileMap:t.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(r,e){let t=e.currentVersion;return t||(t=9.3),t}load(r){const e=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:t=>{if(t.typeKeywords){for(let i=0;ithis._fetchImageService(e))),Promise.resolve(this)}fetchTile(r,e,t,i){const a=(i=i||{signal:null}).signal!=null?i.signal:i.signal=new AbortController().signal,h={responseType:"array-buffer",signal:a},n={noDataValue:i.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(r,e,t,i)).then(()=>m(this.getTileUrl(r,e,t),h)).then(p=>this._lercDecoder.decode(p.data,n,a)).then(p=>new A(p))}getTileUrl(r,e,t){const i=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,a=V({...this.parsedUrl.query,blankTile:!i&&null});return`${this.parsedUrl.path}/tile/${r}/${e}/${t}${a?"?"+a:""}`}async queryElevation(r,e){const{ElevationQuery:t}=await c(()=>import("./ElevationQuery-qAsmERYh-BRPoXapf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return u(e),new t().query(this,r,e)}async createElevationSampler(r,e){const{ElevationQuery:t}=await c(()=>import("./ElevationQuery-qAsmERYh-BRPoXapf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return u(e),new t().createSampler(this,r,e)}_fetchTileAvailability(r,e,t,i){return this.tilemapCache?this.tilemapCache.fetchAvailability(r,e,t,i):Promise.resolve("unknown")}async _fetchImageService(r){if(this.sourceJSON)return this.sourceJSON;const e={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:r},t=await m(this.parsedUrl.path,e);t.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[_]}};o([l({readOnly:!0})],s.prototype,"capabilities",void 0),o([y("service","capabilities",["capabilities"])],s.prototype,"readCapabilities",null),o([l({json:{read:{source:"copyrightText"}}})],s.prototype,"copyright",void 0),o([l({readOnly:!0,type:x})],s.prototype,"heightModelInfo",void 0),o([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([l({type:["show","hide"]})],s.prototype,"listMode",void 0),o([l({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),o([l({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),o([l({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),o([l({type:["ArcGISTiledElevationServiceLayer"]})],s.prototype,"operationalLayerType",void 0),o([l()],s.prototype,"sourceJSON",void 0),o([l({json:{read:!1},value:"elevation",readOnly:!0})],s.prototype,"type",void 0),o([l(O)],s.prototype,"url",void 0),o([l()],s.prototype,"version",void 0),o([y("version",["currentVersion"])],s.prototype,"readVersion",null),s=o([b("esri.layers.ElevationLayer")],s);const _=Symbol("default-fetch-tile");s.prototype.fetchTile[_]=!0;const he=s;export{he as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-BsVTa_m3.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./TileKey-B_6qmYK--BtZdR-Xy.js"])))=>i.map(i=>d[i]); +import{_ as c}from"./main-QGPoLsvl.js";import{U as f,o as g,W as w,f as m,X as V,$ as u,v as o,S as l,a0 as y,i as b,a1 as T,a2 as D,a3 as S}from"./story-Doly9N9p.js";import{m as L}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{M as x}from"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import{D as E}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{O as $}from"./ArcGISCachedService-C64Ko1TY-COmlLbBz.js";import{a as k}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{E as I}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as M}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{Z as O}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{q as N}from"./workers-PiCjreoO-Dc6Tqm-o.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-BDoYZo_V.js";import"./TilemapCache-CRRxws77-CCC00Yar.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";class A{constructor(e,t,i,a){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in e?(this.values=e.pixelData,this.width=e.width,this.height=e.height,this.noDataValue=e.noDataValue):(this.values=e,this.width=t,this.height=i,this.noDataValue=a)}get hasNoDataValues(){if(this._hasNoDataValues==null){const e=this.noDataValue;this._hasNoDataValues=this.values.includes(e)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(this._minValue!=null)return;const{noDataValue:e,values:t}=this;let i=1/0,a=-1/0,h=!0;for(const n of t)n===e?this._hasNoDataValues=!0:(i=na?n:a,h=!1);h?(this._minValue=0,this._maxValue=0):(this._minValue=i,this._maxValue=a>-3e38?a:0)}}class C{constructor(e,t,i,a,h={}){this._mainMethod=t,this._transferLists=i,this._listeners=[],this._promise=N(e,{...h,schedule:a}).then(n=>{if(this._thread===void 0){this._thread=n,this._promise=null,h.hasInitialize&&this.broadcast({},"initialize");for(const p of this._listeners)this._connectListener(p)}else n.close()}),this._promise.catch(n=>T.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${n}`))}on(e,t){const i={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(i),this._connectListener(i),D(()=>{i.removed=!0,S(this._listeners,i),this._thread&&i.threadHandle!=null&&i.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null,this._listeners.length=0,this._transferLists={}}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,i){if(this._thread){const a=this._transferLists[e],h=a?a(t):[];return this._thread.invoke(e,t,{transferList:h,signal:i})}return this._promise?this._promise.then(()=>(u(i),this.invokeMethod(e,t,i))):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 v extends C{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,i){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},i):Promise.resolve(null)}release(){--this.ref<=0&&(d.forEach((e,t)=>{e===this&&d.delete(t)}),this.destroy())}}const d=new Map;function P(r=null){let e=d.get(r);return e||(r!=null?(e=new v(t=>r.immediate.schedule(t)),d.set(r,e)):(e=new v,d.set(null,e))),++e.ref,e}let s=class extends $(k(I(M(L(E))))){constructor(...r){super(...r),this.capabilities={operations:{supportsTileMap:!1}},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=P()}normalizeCtorArgs(r,e){return typeof r=="string"?{url:r,...e}:r}destroy(){this._lercDecoder=f(this._lercDecoder)}readCapabilities(r,e){const t=e.capabilities&&e.capabilities.split(",").map(i=>i.toLowerCase().trim());return t?{operations:{supportsTileMap:t.includes("tilemap")}}:{operations:{supportsTileMap:!1}}}readVersion(r,e){let t=e.currentVersion;return t||(t=9.3),t}load(r){const e=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:t=>{if(t.typeKeywords){for(let i=0;ithis._fetchImageService(e))),Promise.resolve(this)}fetchTile(r,e,t,i){const a=(i=i||{signal:null}).signal!=null?i.signal:i.signal=new AbortController().signal,h={responseType:"array-buffer",signal:a},n={noDataValue:i.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(r,e,t,i)).then(()=>m(this.getTileUrl(r,e,t),h)).then(p=>this._lercDecoder.decode(p.data,n,a)).then(p=>new A(p))}getTileUrl(r,e,t){const i=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,a=V({...this.parsedUrl.query,blankTile:!i&&null});return`${this.parsedUrl.path}/tile/${r}/${e}/${t}${a?"?"+a:""}`}async queryElevation(r,e){const{ElevationQuery:t}=await c(()=>import("./ElevationQuery-qAsmERYh-BsVTa_m3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return u(e),new t().query(this,r,e)}async createElevationSampler(r,e){const{ElevationQuery:t}=await c(()=>import("./ElevationQuery-qAsmERYh-BsVTa_m3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return u(e),new t().createSampler(this,r,e)}_fetchTileAvailability(r,e,t,i){return this.tilemapCache?this.tilemapCache.fetchAvailability(r,e,t,i):Promise.resolve("unknown")}async _fetchImageService(r){if(this.sourceJSON)return this.sourceJSON;const e={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:r},t=await m(this.parsedUrl.path,e);t.ssl&&(this.url=this.url?.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile[_]}};o([l({readOnly:!0})],s.prototype,"capabilities",void 0),o([y("service","capabilities",["capabilities"])],s.prototype,"readCapabilities",null),o([l({json:{read:{source:"copyrightText"}}})],s.prototype,"copyright",void 0),o([l({readOnly:!0,type:x})],s.prototype,"heightModelInfo",void 0),o([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([l({type:["show","hide"]})],s.prototype,"listMode",void 0),o([l({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),o([l({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),o([l({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),o([l({type:["ArcGISTiledElevationServiceLayer"]})],s.prototype,"operationalLayerType",void 0),o([l()],s.prototype,"sourceJSON",void 0),o([l({json:{read:!1},value:"elevation",readOnly:!0})],s.prototype,"type",void 0),o([l(O)],s.prototype,"url",void 0),o([l()],s.prototype,"version",void 0),o([y("version",["currentVersion"])],s.prototype,"readVersion",null),s=o([b("esri.layers.ElevationLayer")],s);const _=Symbol("default-fetch-tile");s.prototype.fetchTile[_]=!0;const he=s;export{he as default}; diff --git a/custom-toc-highlight/assets/ElevationQuery-qAsmERYh-BRPoXapf.js b/custom-toc-highlight/assets/ElevationQuery-qAsmERYh-BsVTa_m3.js similarity index 98% rename from custom-toc-highlight/assets/ElevationQuery-qAsmERYh-BRPoXapf.js rename to custom-toc-highlight/assets/ElevationQuery-qAsmERYh-BsVTa_m3.js index 6400643d..99231848 100644 --- a/custom-toc-highlight/assets/ElevationQuery-qAsmERYh-BRPoXapf.js +++ b/custom-toc-highlight/assets/ElevationQuery-qAsmERYh-BsVTa_m3.js @@ -1 +1 @@ -import{w as q,o as d,gH as Y,O as G,a_ as I,W as Z,bh as N,b6 as ee,G as D,m as te,dD as U,p as R,gI as W,a1 as ne,a2 as ie,gJ as se,b8 as ae}from"./story-BfX8CRfG.js";import{N as z,K as M}from"./projection-BA9M1R7d-BYoCXVXt.js";import{e as B}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./main-ugzBrWNm.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";const V=()=>ne.getLogger("esri.layers.support.ElevationSampler");class H{queryElevation(e){return oe(e.clone(),this)}on(){return ie()}projectIfRequired(e,t){return J(e,t)}}class le extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){super(),this.tile=e,this.noDataValue=n;const i=e.tile.extent;this.extent=W(i,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=i;const s=R(t.spatialReference),a=t.lodAt(e.tile.level).resolution*s;this.demResolution={min:a,max:a}}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return t!=null&&this.containsAt(t.x,t.y)}containsAt(e,t){return se(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const n=this.extent,i=`${n.xmin}, ${n.ymin}, ${n.xmax}, ${n.ymax}`;return V().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${i})`),this.noDataValue}return this.tile.sample(e,t)??this.noDataValue}}class O extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){let i;super(),typeof t=="number"?(this.noDataValue=t,i=null):(i=t,this.noDataValue=n),this.samplers=i?e.map(a=>new le(a,i,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:a,max:o}=s.demResolution;this.demResolution={min:a,max:o};for(let r=1;rt?t:l}class Ie{async queryAll(e,t,n){if(!(e=n?.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 i=x.fromGeometry(t);let s=!1;n?.returnSampleInfo||(s=!0);const a={...g,...n,returnSampleInfo:!0},o=await this.query(e[e.length-1],i,a),r=await this._queryAllContinue(e,o,a);return r.geometry=r.geometry.export(),s&&delete r.sampleInfo,r}async query(e,t,n){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 i={...g,...n},s=new fe(e,t.spatialReference,i),a=i.signal;return await e.load({signal:a}),await me(s,t,a),await this._selectTiles(s,a),await T(s,a),ge(s),Te(s,a)}async createSampler(e,t,n){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 i={...g,...n};return this._createSampler(e,t,i)}async createSamplerAll(e,t,n){if(!(e=n?.ignoreInvisibleLayers?e.filter(a=>a.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 i={...g,...n,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],t,i);return this._createSamplerAllContinue(e,t,s,i)}async _createSampler(e,t,n,i){const s=n.signal;await e.load({signal:s});const a=t.spatialReference,o=e.tileInfo.spatialReference;a.equals(o)||(await z([{source:a,dest:o}],{signal:s}),t=M(t,o));const r=new pe(e,t,n,i);return await this._selectTiles(r,s),await T(r,s),new O(r.elevationTiles,r.layer.tileInfo,r.options.noDataValue)}async _createSamplerAllContinue(e,t,n,i){if(e.pop(),!e.length)return n;const s=n.samplers.filter(c=>!c.tile.hasNoDataValues).map(c=>Y(c.extent)),a=await this._createSampler(e[e.length-1],t,i,s);if(a.samplers.length===0)return n;const o=n.samplers.concat(a.samplers),r=new O(o,i.noDataValue);return this._createSamplerAllContinue(e,t,r,i)}async _queryAllContinue(e,t,n){const i=e.pop(),s=t.geometry.coordinates,a=t.sampleInfo;G(a);const o=[],r=[];for(let f=0;f=0?h.source||(h.source=i):e.length&&(o.push(s[f]),r.push(f))}if(!e.length||o.length===0)return t;const c=t.geometry.clone(o),u=await this.query(e[e.length-1],c,n),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return r.forEach((f,h)=>{s[f].z=u.geometry.coordinates[h].z,a[f].demResolution=m[h].demResolution}),this._queryAllContinue(e,t,n)}async _selectTiles(e,t){e.type==="geometry"&&de(e);const n=e.options.demResolution;if(typeof n=="number")xe(e,n);else if(n==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(n!=="auto")throw new d("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${n}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}async _selectTilesFinestContiguous(e,t){const{tileInfo:n,tilemapCache:i}=e.layer,s=X(n,i,e.options.minDemResolution);await this._selectTilesFinestContiguousAt(e,s,t)}async _selectTilesFinestContiguousAt(e,t,n){const i=e.layer;if(e.selectTilesAtLOD(t),t<0)return;const s=i.tilemapCache,a=e.getTilesToFetch();try{if(s&&!C(s))await I(Promise.all(a.map(o=>s.fetchAvailability(o.level,o.row,o.col,{signal:n}))),n);else if(await T(e,n),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new d("elevation-query:has-unavailable-tiles")}catch(o){Z(o),await this._selectTilesFinestContiguousAt(e,t-1,n)}}async _selectTilesAuto(e,t){we(e),ve(e);const n=e.layer.tilemapCache;if(!n||C(n))return this._selectTilesAutoPrefetchUpsample(e,t);const i=e.getTilesToFetch(),s={},a=i.map(async o=>{const r=new B(null,0,0,0,N()),c=await ee(n.fetchAvailabilityUpsample(o.level,o.row,o.col,r,{signal:t}));c.ok!==!1?o.id!=null&&(s[o.id]=r):Z(c.error)});await I(Promise.all(a),t),e.remapTiles(s)}async _selectTilesAutoPrefetchUpsample(e,t){const n=e.layer.tileInfo;await T(e,t);let i=!1;e.forEachTileToFetch((s,a)=>{n.upsampleTile(s)?i=!0:a()}),i&&await this._selectTilesAutoPrefetchUpsample(e,t)}}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(n=>n.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await z([{source:this.spatialReference,dest:e}],{signal:t});const n=new D({spatialReference:this.spatialReference,points:this.coordinates.map(o=>[o.x,o.y])}),i=M(n,e);if(!i)return null;const s=this.coordinates.map((o,r)=>{const c=o.clone(),u=i.points[r];return c.x=u[0],c.y=u[1],c}),a=this.clone(s);return a.spatialReference=e,a}static fromGeometry(e){const t=new x;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof x)t.coordinates=e.coordinates.map(n=>n.clone()),t._exporter=(n,i)=>{const s=e.clone(n);return s.spatialReference=i,s};else switch(e.type){case"point":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?[new p(n.x,n.y,n.z,n.m)]:i?[new p(n.x,n.y,n.z)]:s?[new p(n.x,n.y,null,n.m)]:[new p(n.x,n.y)],t._exporter=(a,o)=>e.hasM?new q(a[0].x,a[0].y,a[0].z,a[0].m,o):new q(a[0].x,a[0].y,a[0].z,o);break}case"multipoint":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?n.points.map(a=>new p(a[0],a[1],a[2],a[3])):i?n.points.map(a=>new p(a[0],a[1],a[2])):s?n.points.map(a=>new p(a[0],a[1],null,a[2])):n.points.map(a=>new p(a[0],a[1])),t._exporter=(a,o)=>e.hasM?new D({points:a.map(r=>[r.x,r.y,r.z,r.m]),hasZ:!0,hasM:!0,spatialReference:o}):new D(a.map(r=>[r.x,r.y,r.z]),o);break}case"polyline":{const n=e,i=[],s=[],{hasZ:a,hasM:o}=e;let r=0;for(const c of n.paths)if(s.push([r,r+c.length]),r+=c.length,a&&o)for(const u of c)i.push(new p(u[0],u[1],u[2],u[3]));else if(a)for(const u of c)i.push(new p(u[0],u[1],u[2]));else if(o)for(const u of c)i.push(new p(u[0],u[1],null,u[2]));else for(const u of c)i.push(new p(u[0],u[1]));t.coordinates=i,t._exporter=(c,u)=>{const m=e.hasM?c.map(h=>[h.x,h.y,h.z??0,h.m??0]):c.map(h=>[h.x,h.y,h.z??0]),f=s.map(h=>m.slice(h[0],h[1]));return new te({paths:f,hasM:e.hasM,hasZ:!0,spatialReference:u})};break}}return t}}class p{constructor(e,t,n=null,i=null,s=null,a=null){this.x=e,this.y=t,this.z=n,this.m=i,this.tile=s,this.elevationTile=a}clone(){return new p(this.x,this.y,this.z,this.m)}}class Q{constructor(e,t){this.layer=e,this.options=t}}class fe extends Q{constructor(e,t,n){super(e,n),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>t.tile=null);else{const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n)[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){for(const t of this.geometry.coordinates)!t.elevationTile&&t.tile?.id&&(t.elevationTile=e[t.tile.id])}remapTiles(e){for(const t of this.geometry.coordinates){const n=t.tile?.id;t.tile=n?e[n]:null}}getTilesToFetch(){const e={},t=[];for(const n of this.geometry.coordinates){const i=n.tile;if(!i)continue;const s=n.tile?.id;n.elevationTile||!s||e[s]||(e[s]=i,t.push(i))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}}class pe extends Q{constructor(e,t,n,i){super(e,n),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent),this.maskExtents=i}selectTilesAtLOD(e,t){const n=this._maximumLodForRequests(t),i=Math.min(n,e);i<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(i)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n);if(!e)return i.length-1;const s=this.extent;if(s==null)return-1;for(let a=i.length-1;a>=0;a--){const o=i[a],r=o.resolution*t.size[0],c=o.resolution*t.size[1];if(Math.ceil(s.width/r)*Math.ceil(s.height/c)<=e)return a}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 n=t.id&&e[t.id];n&&(this._fetchedCandidates.add(t),this.elevationTiles.push(n))}}remapTiles(e){this._candidateTiles=j(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const n=this._candidateTiles;this._candidateTiles=[],n.forEach(i=>{if(this._fetchedCandidates.has(i))return void(t&&t(i));let s=!1;e(i,()=>s=!0),s?t&&t(i):this._candidateTiles.push(i)}),this._candidateTiles=j(this._candidateTiles,t)}_selectCandidateTilesCoveringExtentAt(e){this._candidateTiles.length=0;const t=this.extent;if(t==null)return;const{tileInfo:n,tilemapCache:i}=this.layer,s=v(n,i)[e],a=n.tileAt(s.level,t.xmin,t.ymin),o=a.extent;if(o==null)return;const r=s.resolution*n.size[0],c=s.resolution*n.size[1],u=Math.ceil((t.xmax-o[0])/r),m=Math.ceil((t.ymax-o[1])/c);for(let f=0;fe.extent&&U(t,e.extent))}}function X(l,e,t=0){const n=v(l,e);let i=n.length-1;if(t>0){const s=t/R(l.spatialReference),a=n.findIndex(o=>o.resolution0&&(i=a-1)}return i}const g={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};async function me(l,e,t){let n;const i=l.layer.tileInfo.spatialReference;if(e instanceof x?n=await e.project(i,t):(await z([{source:e.spatialReference,dest:i}],{signal:t}),n=M(e,i)),!n)throw new d("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${e.spatialReference.wkid}' on an elevation service in '${i.wkid}'`);l.geometry=x.fromGeometry(n)}function de(l){if(l.layer.fullExtent==null)return;const e=new K(null);e.sample=()=>l.options.noDataValue,l.outsideExtentTile=e;const t=l.layer.fullExtent;l.geometry.coordinates.forEach(n=>{const i=n.x,s=n.y;(it.xmax||st.ymax)&&(n.elevationTile=e)})}function ye(l,e){const{tileInfo:t,tilemapCache:n}=l.layer,i=e/R(t.spatialReference),s=v(t,n);let a=s[0],o=0;for(let r=1;rs.level>=n&&s.level<=i)}return t}async function T(l,e){const t=l.getTilesToFetch(),n={},i=l.options.cache,s=l.options.noDataValue,a=t.map(async o=>{if(o.id==null)return;const r=`${l.layer.uid}:${o.id}:${s}`,c=i!=null?i.get(r):null,u=c??await l.layer.fetchTile(o.level,o.row,o.col,{noDataValue:s,signal:e});i?.put(r,u),n[o.id]=new K(o,u)});await I(Promise.allSettled(a),e),l.populateElevationTiles(n)}function ve(l){const e=l.layer.tileInfo;let t=0;const n={},i=o=>{o.id!=null&&(o.id in n?n[o.id]++:(n[o.id]=1,t++))},s=o=>{if(o.id==null)return;const r=n[o.id];r===1?(delete n[o.id],t--):n[o.id]=r-1};l.forEachTileToFetch(i,s);let a=!0;for(;a&&(a=!1,l.forEachTileToFetch(o=>{t<=l.options.maximumAutoTileRequests||(s(o),e.upsampleTile(o)&&(a=!0),i(o))},s),a););}function ge(l){l.geometry.coordinates.forEach(e=>{const t=e.elevationTile;let n=l.options.noDataValue;if(t){const i=t.sample(e.x,e.y);i!=null?n=i:e.elevationTile=null}e.z=n})}function j(l,e){const t={},n=[];for(const s of l){const a=s.id;a&&!t[a]?(t[a]=s,n.push(s)):e&&e(s)}const i=n.sort((s,a)=>s.level-a.level);return i.filter((s,a)=>{for(let o=0;o{i.tile=null,i.elevationTile=null}),n}function Re(l){const e=l.layer.tileInfo,t=R(e.spatialReference);return l.geometry.coordinates.map(n=>{let i=-1;return n.elevationTile&&n.elevationTile!==l.outsideExtentTile&&(i=e.lodAt(n.elevationTile.tile.level).resolution*t),{demResolution:i}})}function C(l){return l?.tileInfo!=null}export{Ie as ElevationQuery,x as GeometryDescriptor,X as getFinestLodIndex}; +import{w as q,o as d,gH as Y,O as G,a_ as I,W as Z,bh as N,b6 as ee,G as D,m as te,dD as U,p as R,gI as W,a1 as ne,a2 as ie,gJ as se,b8 as ae}from"./story-Doly9N9p.js";import{N as z,K as M}from"./projection-BA9M1R7d-CAbqHZiw.js";import{e as B}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./main-QGPoLsvl.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";const V=()=>ne.getLogger("esri.layers.support.ElevationSampler");class H{queryElevation(e){return oe(e.clone(),this)}on(){return ie()}projectIfRequired(e,t){return J(e,t)}}class le extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){super(),this.tile=e,this.noDataValue=n;const i=e.tile.extent;this.extent=W(i,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=i;const s=R(t.spatialReference),a=t.lodAt(e.tile.level).resolution*s;this.demResolution={min:a,max:a}}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return t!=null&&this.containsAt(t.x,t.y)}containsAt(e,t){return se(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const n=this.extent,i=`${n.xmin}, ${n.ymin}, ${n.xmax}, ${n.ymax}`;return V().warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${i})`),this.noDataValue}return this.tile.sample(e,t)??this.noDataValue}}class O extends H{get spatialReference(){return this.extent.spatialReference}constructor(e,t,n){let i;super(),typeof t=="number"?(this.noDataValue=t,i=null):(i=t,this.noDataValue=n),this.samplers=i?e.map(a=>new le(a,i,this.noDataValue)):e;const s=this.samplers[0];if(s){this.extent=s.extent.clone();const{min:a,max:o}=s.demResolution;this.demResolution={min:a,max:o};for(let r=1;rt?t:l}class Ie{async queryAll(e,t,n){if(!(e=n?.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 i=x.fromGeometry(t);let s=!1;n?.returnSampleInfo||(s=!0);const a={...g,...n,returnSampleInfo:!0},o=await this.query(e[e.length-1],i,a),r=await this._queryAllContinue(e,o,a);return r.geometry=r.geometry.export(),s&&delete r.sampleInfo,r}async query(e,t,n){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 i={...g,...n},s=new fe(e,t.spatialReference,i),a=i.signal;return await e.load({signal:a}),await me(s,t,a),await this._selectTiles(s,a),await T(s,a),ge(s),Te(s,a)}async createSampler(e,t,n){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 i={...g,...n};return this._createSampler(e,t,i)}async createSamplerAll(e,t,n){if(!(e=n?.ignoreInvisibleLayers?e.filter(a=>a.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 i={...g,...n,returnSampleInfo:!0},s=await this._createSampler(e[e.length-1],t,i);return this._createSamplerAllContinue(e,t,s,i)}async _createSampler(e,t,n,i){const s=n.signal;await e.load({signal:s});const a=t.spatialReference,o=e.tileInfo.spatialReference;a.equals(o)||(await z([{source:a,dest:o}],{signal:s}),t=M(t,o));const r=new pe(e,t,n,i);return await this._selectTiles(r,s),await T(r,s),new O(r.elevationTiles,r.layer.tileInfo,r.options.noDataValue)}async _createSamplerAllContinue(e,t,n,i){if(e.pop(),!e.length)return n;const s=n.samplers.filter(c=>!c.tile.hasNoDataValues).map(c=>Y(c.extent)),a=await this._createSampler(e[e.length-1],t,i,s);if(a.samplers.length===0)return n;const o=n.samplers.concat(a.samplers),r=new O(o,i.noDataValue);return this._createSamplerAllContinue(e,t,r,i)}async _queryAllContinue(e,t,n){const i=e.pop(),s=t.geometry.coordinates,a=t.sampleInfo;G(a);const o=[],r=[];for(let f=0;f=0?h.source||(h.source=i):e.length&&(o.push(s[f]),r.push(f))}if(!e.length||o.length===0)return t;const c=t.geometry.clone(o),u=await this.query(e[e.length-1],c,n),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return r.forEach((f,h)=>{s[f].z=u.geometry.coordinates[h].z,a[f].demResolution=m[h].demResolution}),this._queryAllContinue(e,t,n)}async _selectTiles(e,t){e.type==="geometry"&&de(e);const n=e.options.demResolution;if(typeof n=="number")xe(e,n);else if(n==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(n!=="auto")throw new d("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${n}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}async _selectTilesFinestContiguous(e,t){const{tileInfo:n,tilemapCache:i}=e.layer,s=X(n,i,e.options.minDemResolution);await this._selectTilesFinestContiguousAt(e,s,t)}async _selectTilesFinestContiguousAt(e,t,n){const i=e.layer;if(e.selectTilesAtLOD(t),t<0)return;const s=i.tilemapCache,a=e.getTilesToFetch();try{if(s&&!C(s))await I(Promise.all(a.map(o=>s.fetchAvailability(o.level,o.row,o.col,{signal:n}))),n);else if(await T(e,n),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new d("elevation-query:has-unavailable-tiles")}catch(o){Z(o),await this._selectTilesFinestContiguousAt(e,t-1,n)}}async _selectTilesAuto(e,t){we(e),ve(e);const n=e.layer.tilemapCache;if(!n||C(n))return this._selectTilesAutoPrefetchUpsample(e,t);const i=e.getTilesToFetch(),s={},a=i.map(async o=>{const r=new B(null,0,0,0,N()),c=await ee(n.fetchAvailabilityUpsample(o.level,o.row,o.col,r,{signal:t}));c.ok!==!1?o.id!=null&&(s[o.id]=r):Z(c.error)});await I(Promise.all(a),t),e.remapTiles(s)}async _selectTilesAutoPrefetchUpsample(e,t){const n=e.layer.tileInfo;await T(e,t);let i=!1;e.forEachTileToFetch((s,a)=>{n.upsampleTile(s)?i=!0:a()}),i&&await this._selectTilesAutoPrefetchUpsample(e,t)}}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(n=>n.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await z([{source:this.spatialReference,dest:e}],{signal:t});const n=new D({spatialReference:this.spatialReference,points:this.coordinates.map(o=>[o.x,o.y])}),i=M(n,e);if(!i)return null;const s=this.coordinates.map((o,r)=>{const c=o.clone(),u=i.points[r];return c.x=u[0],c.y=u[1],c}),a=this.clone(s);return a.spatialReference=e,a}static fromGeometry(e){const t=new x;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof x)t.coordinates=e.coordinates.map(n=>n.clone()),t._exporter=(n,i)=>{const s=e.clone(n);return s.spatialReference=i,s};else switch(e.type){case"point":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?[new p(n.x,n.y,n.z,n.m)]:i?[new p(n.x,n.y,n.z)]:s?[new p(n.x,n.y,null,n.m)]:[new p(n.x,n.y)],t._exporter=(a,o)=>e.hasM?new q(a[0].x,a[0].y,a[0].z,a[0].m,o):new q(a[0].x,a[0].y,a[0].z,o);break}case"multipoint":{const n=e,{hasZ:i,hasM:s}=n;t.coordinates=i&&s?n.points.map(a=>new p(a[0],a[1],a[2],a[3])):i?n.points.map(a=>new p(a[0],a[1],a[2])):s?n.points.map(a=>new p(a[0],a[1],null,a[2])):n.points.map(a=>new p(a[0],a[1])),t._exporter=(a,o)=>e.hasM?new D({points:a.map(r=>[r.x,r.y,r.z,r.m]),hasZ:!0,hasM:!0,spatialReference:o}):new D(a.map(r=>[r.x,r.y,r.z]),o);break}case"polyline":{const n=e,i=[],s=[],{hasZ:a,hasM:o}=e;let r=0;for(const c of n.paths)if(s.push([r,r+c.length]),r+=c.length,a&&o)for(const u of c)i.push(new p(u[0],u[1],u[2],u[3]));else if(a)for(const u of c)i.push(new p(u[0],u[1],u[2]));else if(o)for(const u of c)i.push(new p(u[0],u[1],null,u[2]));else for(const u of c)i.push(new p(u[0],u[1]));t.coordinates=i,t._exporter=(c,u)=>{const m=e.hasM?c.map(h=>[h.x,h.y,h.z??0,h.m??0]):c.map(h=>[h.x,h.y,h.z??0]),f=s.map(h=>m.slice(h[0],h[1]));return new te({paths:f,hasM:e.hasM,hasZ:!0,spatialReference:u})};break}}return t}}class p{constructor(e,t,n=null,i=null,s=null,a=null){this.x=e,this.y=t,this.z=n,this.m=i,this.tile=s,this.elevationTile=a}clone(){return new p(this.x,this.y,this.z,this.m)}}class Q{constructor(e,t){this.layer=e,this.options=t}}class fe extends Q{constructor(e,t,n){super(e,n),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>t.tile=null);else{const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n)[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){for(const t of this.geometry.coordinates)!t.elevationTile&&t.tile?.id&&(t.elevationTile=e[t.tile.id])}remapTiles(e){for(const t of this.geometry.coordinates){const n=t.tile?.id;t.tile=n?e[n]:null}}getTilesToFetch(){const e={},t=[];for(const n of this.geometry.coordinates){const i=n.tile;if(!i)continue;const s=n.tile?.id;n.elevationTile||!s||e[s]||(e[s]=i,t.push(i))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}}class pe extends Q{constructor(e,t,n,i){super(e,n),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.clone().intersection(e.fullExtent),this.maskExtents=i}selectTilesAtLOD(e,t){const n=this._maximumLodForRequests(t),i=Math.min(n,e);i<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(i)}_maximumLodForRequests(e){const{tileInfo:t,tilemapCache:n}=this.layer,i=v(t,n);if(!e)return i.length-1;const s=this.extent;if(s==null)return-1;for(let a=i.length-1;a>=0;a--){const o=i[a],r=o.resolution*t.size[0],c=o.resolution*t.size[1];if(Math.ceil(s.width/r)*Math.ceil(s.height/c)<=e)return a}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 n=t.id&&e[t.id];n&&(this._fetchedCandidates.add(t),this.elevationTiles.push(n))}}remapTiles(e){this._candidateTiles=j(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const n=this._candidateTiles;this._candidateTiles=[],n.forEach(i=>{if(this._fetchedCandidates.has(i))return void(t&&t(i));let s=!1;e(i,()=>s=!0),s?t&&t(i):this._candidateTiles.push(i)}),this._candidateTiles=j(this._candidateTiles,t)}_selectCandidateTilesCoveringExtentAt(e){this._candidateTiles.length=0;const t=this.extent;if(t==null)return;const{tileInfo:n,tilemapCache:i}=this.layer,s=v(n,i)[e],a=n.tileAt(s.level,t.xmin,t.ymin),o=a.extent;if(o==null)return;const r=s.resolution*n.size[0],c=s.resolution*n.size[1],u=Math.ceil((t.xmax-o[0])/r),m=Math.ceil((t.ymax-o[1])/c);for(let f=0;fe.extent&&U(t,e.extent))}}function X(l,e,t=0){const n=v(l,e);let i=n.length-1;if(t>0){const s=t/R(l.spatialReference),a=n.findIndex(o=>o.resolution0&&(i=a-1)}return i}const g={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};async function me(l,e,t){let n;const i=l.layer.tileInfo.spatialReference;if(e instanceof x?n=await e.project(i,t):(await z([{source:e.spatialReference,dest:i}],{signal:t}),n=M(e,i)),!n)throw new d("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${e.spatialReference.wkid}' on an elevation service in '${i.wkid}'`);l.geometry=x.fromGeometry(n)}function de(l){if(l.layer.fullExtent==null)return;const e=new K(null);e.sample=()=>l.options.noDataValue,l.outsideExtentTile=e;const t=l.layer.fullExtent;l.geometry.coordinates.forEach(n=>{const i=n.x,s=n.y;(it.xmax||st.ymax)&&(n.elevationTile=e)})}function ye(l,e){const{tileInfo:t,tilemapCache:n}=l.layer,i=e/R(t.spatialReference),s=v(t,n);let a=s[0],o=0;for(let r=1;rs.level>=n&&s.level<=i)}return t}async function T(l,e){const t=l.getTilesToFetch(),n={},i=l.options.cache,s=l.options.noDataValue,a=t.map(async o=>{if(o.id==null)return;const r=`${l.layer.uid}:${o.id}:${s}`,c=i!=null?i.get(r):null,u=c??await l.layer.fetchTile(o.level,o.row,o.col,{noDataValue:s,signal:e});i?.put(r,u),n[o.id]=new K(o,u)});await I(Promise.allSettled(a),e),l.populateElevationTiles(n)}function ve(l){const e=l.layer.tileInfo;let t=0;const n={},i=o=>{o.id!=null&&(o.id in n?n[o.id]++:(n[o.id]=1,t++))},s=o=>{if(o.id==null)return;const r=n[o.id];r===1?(delete n[o.id],t--):n[o.id]=r-1};l.forEachTileToFetch(i,s);let a=!0;for(;a&&(a=!1,l.forEachTileToFetch(o=>{t<=l.options.maximumAutoTileRequests||(s(o),e.upsampleTile(o)&&(a=!0),i(o))},s),a););}function ge(l){l.geometry.coordinates.forEach(e=>{const t=e.elevationTile;let n=l.options.noDataValue;if(t){const i=t.sample(e.x,e.y);i!=null?n=i:e.elevationTile=null}e.z=n})}function j(l,e){const t={},n=[];for(const s of l){const a=s.id;a&&!t[a]?(t[a]=s,n.push(s)):e&&e(s)}const i=n.sort((s,a)=>s.level-a.level);return i.filter((s,a)=>{for(let o=0;o{i.tile=null,i.elevationTile=null}),n}function Re(l){const e=l.layer.tileInfo,t=R(e.spatialReference);return l.geometry.coordinates.map(n=>{let i=-1;return n.elevationTile&&n.elevationTile!==l.outsideExtentTile&&(i=e.lodAt(n.elevationTile.tile.level).resolution*t),{demResolution:i}})}function C(l){return l?.tileInfo!=null}export{Ie as ElevationQuery,x as GeometryDescriptor,X as getFinestLodIndex}; diff --git a/custom-toc-highlight/assets/ElevationSamplerWorker-BA9k6xuc-Eny38BBu.js b/custom-toc-highlight/assets/ElevationSamplerWorker-BA9k6xuc-BNksF2gT.js similarity index 64% rename from custom-toc-highlight/assets/ElevationSamplerWorker-BA9k6xuc-Eny38BBu.js rename to custom-toc-highlight/assets/ElevationSamplerWorker-BA9k6xuc-BNksF2gT.js index 199ab526..e21b603d 100644 --- a/custom-toc-highlight/assets/ElevationSamplerWorker-BA9k6xuc-Eny38BBu.js +++ b/custom-toc-highlight/assets/ElevationSamplerWorker-BA9k6xuc-BNksF2gT.js @@ -1 +1 @@ -import{K as f}from"./story-BfX8CRfG.js";import{N as p}from"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";import{y as u}from"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import{b as l}from"./vertexSpaceConversion-CiKaVq_u-D2kQTb17.js";import"./main-ugzBrWNm.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./projectPointToVector-B2UUY9SE-BChPjj6-.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js";import"./vec3-BazNroeq-PdcGTXFi.js";import"./BufferView-PQoE3GL7-Duht5lAO.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-BagfV9qf.js";class q{async createIndex(o,r){const n=new Array;if(!o.vertexAttributes?.position)return new p;const i=d(o),s=r!=null?await r.invoke("createIndexThread",i,{transferList:n}):this.createIndexThread(i).result;return a().fromJSON(s)}createIndexThread(o){const r=a();if(!o)return{result:r.toJSON()};const n=new Float64Array(o.position);return o.components?h(r,n,o.components.map(i=>new Uint32Array(i))):x(r,n)}}function x(t,o){const r=new Array(o.length/9);let n=0;for(let i=0;i!e.faces)?{position:s.buffer}:{position:s.buffer,components:t.components.map(e=>e.faces)}:null}function a(){return new p(9,f("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}function c(t,o,r,n){return{minX:Math.min(t[o],t[r],t[n]),maxX:Math.max(t[o],t[r],t[n]),minY:Math.min(t[o+1],t[r+1],t[n+1]),maxY:Math.max(t[o+1],t[r+1],t[n+1]),p0:[t[o],t[o+1],t[o+2]],p1:[t[r],t[r+1],t[r+2]],p2:[t[n],t[n+1],t[n+2]]}}export{q as default}; +import{K as f}from"./story-Doly9N9p.js";import{N as p}from"./PooledRBush-DbfAmeLn-CPHfm9op.js";import{y as u}from"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import{b as l}from"./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js";import"./main-QGPoLsvl.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./projectPointToVector-B2UUY9SE-BIKNGLey.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js";import"./vec3-BazNroeq-CRjQH4Pj.js";import"./BufferView-PQoE3GL7-B9DLdqO9.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-BHg6FqkT.js";class q{async createIndex(o,r){const n=new Array;if(!o.vertexAttributes?.position)return new p;const i=d(o),s=r!=null?await r.invoke("createIndexThread",i,{transferList:n}):this.createIndexThread(i).result;return a().fromJSON(s)}createIndexThread(o){const r=a();if(!o)return{result:r.toJSON()};const n=new Float64Array(o.position);return o.components?h(r,n,o.components.map(i=>new Uint32Array(i))):x(r,n)}}function x(t,o){const r=new Array(o.length/9);let n=0;for(let i=0;i!e.faces)?{position:s.buffer}:{position:s.buffer,components:t.components.map(e=>e.faces)}:null}function a(){return new p(9,f("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}function c(t,o,r,n){return{minX:Math.min(t[o],t[r],t[n]),maxX:Math.max(t[o],t[r],t[n]),minY:Math.min(t[o+1],t[r+1],t[n+1]),maxY:Math.max(t[o+1],t[r+1],t[n+1]),p0:[t[o],t[o+1],t[o+2]],p1:[t[r],t[r+1],t[r+2]],p2:[t[n],t[n+1],t[n+2]]}}export{q as default}; diff --git a/custom-toc-highlight/assets/ExportImageParameters-DxyNGQ57-0etxSPmv.js b/custom-toc-highlight/assets/ExportImageParameters-DxyNGQ57-D1Dwm6AT.js similarity index 93% rename from custom-toc-highlight/assets/ExportImageParameters-DxyNGQ57-0etxSPmv.js rename to custom-toc-highlight/assets/ExportImageParameters-DxyNGQ57-D1Dwm6AT.js index 7c98f4de..419f7430 100644 --- a/custom-toc-highlight/assets/ExportImageParameters-DxyNGQ57-0etxSPmv.js +++ b/custom-toc-highlight/assets/ExportImageParameters-DxyNGQ57-D1Dwm6AT.js @@ -1 +1 @@ -import{v as a,S as l,i as m,j as u,bV as c}from"./story-BfX8CRfG.js";import{b as p}from"./scaleUtils-DxsfQwK1-D7ZZd5W4.js";import{e as y}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{s as b}from"./sublayerUtils-CyM0QC5B-D9HVKWXR.js";const d={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let i=class extends u{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(r=>{const t=y(this.floors,r);return r.toExportImageJSON(t)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&b(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",r=>this.notifyChange(d[r.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(r=>r.id).join(","):"show:-1":null}get layerDefs(){const e=!!this.floors?.length,r=this.visibleSublayers.filter(t=>t.definitionExpression!=null||e&&t.floorInfo!=null);return r.length?JSON.stringify(r.reduce((t,n)=>{const o=y(this.floors,n),s=c(o,n.definitionExpression);return s!=null&&(t[n.id]=s),t},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers");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 r=this.layer.sublayers,t=this.scale,n=s=>{s.visible&&(t===0||p(t,s.minScale,s.maxScale))&&(s.sublayers?s.sublayers.forEach(n):e.unshift(s))};r&&r.forEach(n);const o=this._get("visibleSublayers");return!o||o.length!==e.length||o.some((s,h)=>e[h]!==s)?e:o}toJSON(){const e=this.layer;let r={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?r.dynamicLayers=this.dynamicLayers:r={...r,layers:this.layers,layerDefs:this.layerDefs},r}};a([l({readOnly:!0})],i.prototype,"dynamicLayers",null),a([l()],i.prototype,"floors",void 0),a([l({readOnly:!0})],i.prototype,"hasDynamicLayers",null),a([l()],i.prototype,"layer",null),a([l({readOnly:!0})],i.prototype,"layers",null),a([l({readOnly:!0})],i.prototype,"layerDefs",null),a([l({type:Number})],i.prototype,"scale",void 0),a([l({readOnly:!0})],i.prototype,"version",null),a([l({readOnly:!0})],i.prototype,"visibleSublayers",null),i=a([m("esri.layers.support.ExportImageParameters")],i);export{i as r}; +import{v as a,S as l,i as m,j as u,bV as c}from"./story-Doly9N9p.js";import{b as p}from"./scaleUtils-DxsfQwK1-CzyfErWH.js";import{e as y}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{s as b}from"./sublayerUtils-CyM0QC5B-B1ryunQi.js";const d={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let i=class extends u{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(r=>{const t=y(this.floors,r);return r.toExportImageJSON(t)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&b(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",r=>this.notifyChange(d[r.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(r=>r.id).join(","):"show:-1":null}get layerDefs(){const e=!!this.floors?.length,r=this.visibleSublayers.filter(t=>t.definitionExpression!=null||e&&t.floorInfo!=null);return r.length?JSON.stringify(r.reduce((t,n)=>{const o=y(this.floors,n),s=c(o,n.definitionExpression);return s!=null&&(t[n.id]=s),t},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers");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 r=this.layer.sublayers,t=this.scale,n=s=>{s.visible&&(t===0||p(t,s.minScale,s.maxScale))&&(s.sublayers?s.sublayers.forEach(n):e.unshift(s))};r&&r.forEach(n);const o=this._get("visibleSublayers");return!o||o.length!==e.length||o.some((s,h)=>e[h]!==s)?e:o}toJSON(){const e=this.layer;let r={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?r.dynamicLayers=this.dynamicLayers:r={...r,layers:this.layers,layerDefs:this.layerDefs},r}};a([l({readOnly:!0})],i.prototype,"dynamicLayers",null),a([l()],i.prototype,"floors",void 0),a([l({readOnly:!0})],i.prototype,"hasDynamicLayers",null),a([l()],i.prototype,"layer",null),a([l({readOnly:!0})],i.prototype,"layers",null),a([l({readOnly:!0})],i.prototype,"layerDefs",null),a([l({type:Number})],i.prototype,"scale",void 0),a([l({readOnly:!0})],i.prototype,"version",null),a([l({readOnly:!0})],i.prototype,"visibleSublayers",null),i=a([m("esri.layers.support.ExportImageParameters")],i);export{i as r}; diff --git a/custom-toc-highlight/assets/ExportStrategy-BNE7Gp0u-j76jQ8Ao.js b/custom-toc-highlight/assets/ExportStrategy-BNE7Gp0u-CHHOPUHq.js similarity index 93% rename from custom-toc-highlight/assets/ExportStrategy-BNE7Gp0u-j76jQ8Ao.js rename to custom-toc-highlight/assets/ExportStrategy-BNE7Gp0u-CHHOPUHq.js index 896e81bd..140de033 100644 --- a/custom-toc-highlight/assets/ExportStrategy-BNE7Gp0u-j76jQ8Ao.js +++ b/custom-toc-highlight/assets/ExportStrategy-BNE7Gp0u-CHHOPUHq.js @@ -1 +1 @@ -import{bh as E,v as d,S as l,i as N,j as H,bp as P,$ as v,aG as I,W as T,iF as $,gI as z}from"./story-BfX8CRfG.js";import{V as q}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import{I as B}from"./Bitmap-CcqmzvfR-Bqft9oF3.js";import{Q as U}from"./Tile-D75RMC64-Dj1SOP3K.js";import{s as V}from"./TileKey-C5IL-JBr-CJMvJ-lJ.js";const j=Math.PI/180;function C(e){return e*j}function F(e,i){const r=C(i.rotation),t=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r)),[o,n]=i.size;return e[0]=Math.round(n*s+o*t),e[1]=Math.round(n*t+o*s),e}function G(e,i,r,t){const[s,o]=i,[n,a]=t,m=.5*r;return e[0]=s-m*n,e[1]=o-m*a,e[2]=s+m*n,e[3]=o+m*a,e}const u=E(),c=[0,0],w=new V(0,0,0,0),y={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let h=class extends H{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=y.hidpi,this.imageMaxWidth=y.imageMaxWidth,this.imageMaxHeight=y.imageMaxHeight,this.imageRotationSupported=y.imageRotationSupported,this.imageNormalizationSupported=y.imageNormalizationSupported,this.update=P(async(i,r)=>{if(v(r),!i.stationary||this.destroyed)return;const t=i.state,s=I(t.spatialReference),o=this.hidpi?i.pixelRatio:1,n=t.worldScreenWidth>0,a=n&&this.imageNormalizationSupported&&t.worldScreenWidthm||Math.floor(c[1])>f,S=s&&(t.extent.xmins.valid[1]),_=!this.imageNormalizationSupported&&S,x=!M&&!_,W=this.imageRotationSupported?t.rotation:0,b=this.container.children.slice();if(x){const p=a?t.paddedViewState.center:t.center;this._imagePromise=this._singleExport(t,c,p,t.resolution,W,o,r)}else{let p=Math.min(m,f);n&&(p=Math.min(t.worldScreenWidth,p),p=Math.round(t.worldScreenWidth/Math.ceil(t.worldScreenWidth/p))),this._imagePromise=this._tiledExport(t,p,o,r)}try{const p=await this._imagePromise??[];v(r);const R=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=p;for(const g of b)p.includes(g)||R.push(g.fadeOut().then(()=>{g.remove(),g.destroy()}));for(const g of p)R.push(g.fadeIn());await Promise.all(R)}catch(p){this._imagePromise=null,T(p)}},5e3),this.updateExports=P(async i=>{const r=[];for(const t of this.container.children){if(!t.visible||!t.stage)return;r.push(i(t).then(()=>{t.invalidateTexture(),t.requestRender()}))}this._imagePromise=$(r).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,r,t,s,o){const n=await this.fetchSource(e,Math.floor(i*s),Math.floor(r*s),{rotation:t,pixelRatio:s,signal:o});v(o);const a=new B(null,!0);return a.x=e.xmin,a.y=e.ymax,a.resolution=e.width/i,a.rotation=t,a.pixelRatio=s,a.opacity=0,this.container.addChild(a),await a.setSourceAsync(n,o),v(o),a}async _singleExport(e,i,r,t,s,o,n){G(u,r,t,i);const a=z(u,e.spatialReference);return[await this._export(a,i[0],i[1],s,o,n)]}_tiledExport(e,i,r,t){const s=q.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new U(s),n=o.getTileCoverage(e);if(!n)return null;const a=[];return n.forEach((m,f,M,S)=>{w.set(m,f,M,0),o.getTileBounds(u,w);const _=z(u,e.spatialReference);a.push(this._export(_,i,i,0,r,t).then(x=>(S!==0&&(w.set(m,f,M,S),o.getTileBounds(u,w),x.x=u[0],x.y=u[3]),x)))}),Promise.all(a)}};d([l()],h.prototype,"_imagePromise",void 0),d([l()],h.prototype,"bitmaps",void 0),d([l()],h.prototype,"container",void 0),d([l()],h.prototype,"fetchSource",void 0),d([l()],h.prototype,"hidpi",void 0),d([l()],h.prototype,"imageMaxWidth",void 0),d([l()],h.prototype,"imageMaxHeight",void 0),d([l()],h.prototype,"imageRotationSupported",void 0),d([l()],h.prototype,"imageNormalizationSupported",void 0),d([l()],h.prototype,"requestUpdate",void 0),d([l()],h.prototype,"updating",null),h=d([N("esri.views.2d.layers.support.ExportStrategy")],h);const O=h;export{O as K}; +import{bh as E,v as d,S as l,i as N,j as H,bp as P,$ as v,aG as I,W as T,iF as $,gI as z}from"./story-Doly9N9p.js";import{V as q}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import{I as B}from"./Bitmap-CcqmzvfR-C22fE2NY.js";import{Q as U}from"./Tile-D75RMC64-g8Sx5TPr.js";import{s as V}from"./TileKey-C5IL-JBr-BGwa3-Dg.js";const j=Math.PI/180;function C(e){return e*j}function F(e,i){const r=C(i.rotation),t=Math.abs(Math.cos(r)),s=Math.abs(Math.sin(r)),[o,n]=i.size;return e[0]=Math.round(n*s+o*t),e[1]=Math.round(n*t+o*s),e}function G(e,i,r,t){const[s,o]=i,[n,a]=t,m=.5*r;return e[0]=s-m*n,e[1]=o-m*a,e[2]=s+m*n,e[3]=o+m*a,e}const u=E(),c=[0,0],w=new V(0,0,0,0),y={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let h=class extends H{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=y.hidpi,this.imageMaxWidth=y.imageMaxWidth,this.imageMaxHeight=y.imageMaxHeight,this.imageRotationSupported=y.imageRotationSupported,this.imageNormalizationSupported=y.imageNormalizationSupported,this.update=P(async(i,r)=>{if(v(r),!i.stationary||this.destroyed)return;const t=i.state,s=I(t.spatialReference),o=this.hidpi?i.pixelRatio:1,n=t.worldScreenWidth>0,a=n&&this.imageNormalizationSupported&&t.worldScreenWidthm||Math.floor(c[1])>f,S=s&&(t.extent.xmins.valid[1]),_=!this.imageNormalizationSupported&&S,x=!M&&!_,W=this.imageRotationSupported?t.rotation:0,b=this.container.children.slice();if(x){const p=a?t.paddedViewState.center:t.center;this._imagePromise=this._singleExport(t,c,p,t.resolution,W,o,r)}else{let p=Math.min(m,f);n&&(p=Math.min(t.worldScreenWidth,p),p=Math.round(t.worldScreenWidth/Math.ceil(t.worldScreenWidth/p))),this._imagePromise=this._tiledExport(t,p,o,r)}try{const p=await this._imagePromise??[];v(r);const R=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=p;for(const g of b)p.includes(g)||R.push(g.fadeOut().then(()=>{g.remove(),g.destroy()}));for(const g of p)R.push(g.fadeIn());await Promise.all(R)}catch(p){this._imagePromise=null,T(p)}},5e3),this.updateExports=P(async i=>{const r=[];for(const t of this.container.children){if(!t.visible||!t.stage)return;r.push(i(t).then(()=>{t.invalidateTexture(),t.requestRender()}))}this._imagePromise=$(r).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,r,t,s,o){const n=await this.fetchSource(e,Math.floor(i*s),Math.floor(r*s),{rotation:t,pixelRatio:s,signal:o});v(o);const a=new B(null,!0);return a.x=e.xmin,a.y=e.ymax,a.resolution=e.width/i,a.rotation=t,a.pixelRatio=s,a.opacity=0,this.container.addChild(a),await a.setSourceAsync(n,o),v(o),a}async _singleExport(e,i,r,t,s,o,n){G(u,r,t,i);const a=z(u,e.spatialReference);return[await this._export(a,i[0],i[1],s,o,n)]}_tiledExport(e,i,r,t){const s=q.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new U(s),n=o.getTileCoverage(e);if(!n)return null;const a=[];return n.forEach((m,f,M,S)=>{w.set(m,f,M,0),o.getTileBounds(u,w);const _=z(u,e.spatialReference);a.push(this._export(_,i,i,0,r,t).then(x=>(S!==0&&(w.set(m,f,M,S),o.getTileBounds(u,w),x.x=u[0],x.y=u[3]),x)))}),Promise.all(a)}};d([l()],h.prototype,"_imagePromise",void 0),d([l()],h.prototype,"bitmaps",void 0),d([l()],h.prototype,"container",void 0),d([l()],h.prototype,"fetchSource",void 0),d([l()],h.prototype,"hidpi",void 0),d([l()],h.prototype,"imageMaxWidth",void 0),d([l()],h.prototype,"imageMaxHeight",void 0),d([l()],h.prototype,"imageRotationSupported",void 0),d([l()],h.prototype,"imageNormalizationSupported",void 0),d([l()],h.prototype,"requestUpdate",void 0),d([l()],h.prototype,"updating",null),h=d([N("esri.views.2d.layers.support.ExportStrategy")],h);const O=h;export{O as K}; diff --git a/custom-toc-highlight/assets/ExportWMSImageParameters-CMk80WSM-sFuOAfxa.js b/custom-toc-highlight/assets/ExportWMSImageParameters-CMk80WSM-wEv_P_PY.js similarity index 95% rename from custom-toc-highlight/assets/ExportWMSImageParameters-CMk80WSM-sFuOAfxa.js rename to custom-toc-highlight/assets/ExportWMSImageParameters-CMk80WSM-wEv_P_PY.js index 9b4fa1b2..df1ada68 100644 --- a/custom-toc-highlight/assets/ExportWMSImageParameters-CMk80WSM-sFuOAfxa.js +++ b/custom-toc-highlight/assets/ExportWMSImageParameters-CMk80WSM-wEv_P_PY.js @@ -1 +1 @@ -import{v as t,S as a,i as c,j as h}from"./story-BfX8CRfG.js";const b={visible:"visibleSublayers"};let s=class extends h{constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",r=>this.notifyChange(b[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,o=e?.sublayers,l=[],i=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(i):l.push(n))};return o?.forEach(i),l}toJSON(){const{layer:e,layers:r}=this,{imageFormat:o,imageTransparency:l,version:i}=e;return{format:o,request:"GetMap",service:"WMS",styles:"",transparent:l?"TRUE":"FALSE",version:i,layers:r}}};t([a()],s.prototype,"layer",null),t([a({readOnly:!0})],s.prototype,"layers",null),t([a({type:Number})],s.prototype,"scale",void 0),t([a({readOnly:!0})],s.prototype,"version",null),t([a({readOnly:!0})],s.prototype,"visibleSublayers",null),s=t([c("esri.layers.support.ExportWMSImageParameters")],s);export{s as r}; +import{v as t,S as a,i as c,j as h}from"./story-Doly9N9p.js";const b={visible:"visibleSublayers"};let s=class extends h{constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.removeHandles("layer"),e&&this.addHandles([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",r=>this.notifyChange(b[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,o=e?.sublayers,l=[],i=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(i):l.push(n))};return o?.forEach(i),l}toJSON(){const{layer:e,layers:r}=this,{imageFormat:o,imageTransparency:l,version:i}=e;return{format:o,request:"GetMap",service:"WMS",styles:"",transparent:l?"TRUE":"FALSE",version:i,layers:r}}};t([a()],s.prototype,"layer",null),t([a({readOnly:!0})],s.prototype,"layers",null),t([a({type:Number})],s.prototype,"scale",void 0),t([a({readOnly:!0})],s.prototype,"version",null),t([a({readOnly:!0})],s.prototype,"visibleSublayers",null),s=t([c("esri.layers.support.ExportWMSImageParameters")],s);export{s as r}; diff --git a/custom-toc-highlight/assets/External-D_wl4XAw-P7VLSnKi.js b/custom-toc-highlight/assets/External-D_wl4XAw-DrOy4LUr.js similarity index 96% rename from custom-toc-highlight/assets/External-D_wl4XAw-P7VLSnKi.js rename to custom-toc-highlight/assets/External-D_wl4XAw-DrOy4LUr.js index 46b55ca2..d884a76a 100644 --- a/custom-toc-highlight/assets/External-D_wl4XAw-P7VLSnKi.js +++ b/custom-toc-highlight/assets/External-D_wl4XAw-DrOy4LUr.js @@ -1 +1 @@ -import{hq as g,$ as p,f as b}from"./story-BfX8CRfG.js";import{c as N,o as v}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";class m{constructor(t,e,s){this.assetName=t,this.assetMimeType=e,this.parts=s}equals(t){return this===t||this.assetName===t.assetName&&this.assetMimeType===t.assetMimeType&&g(this.parts,t.parts,(e,s)=>e.equals(s))}isOnService(t){return this.parts.every(e=>e.isOnService(t))}makeHash(){let t="";for(const e of this.parts)t+=e.partHash;return t}async toBlob(t){const{parts:e}=this;if(e.length===1)return e[0].toBlob(t);const s=await Promise.all(e.map(a=>a.toBlob(t)));return p(t),new Blob(s)}}class H{constructor(t,e){this.partUrl=t,this.partHash=e}equals(t){return this===t||this.partUrl===t.partUrl&&this.partHash===t.partHash}isOnService(t){return this.partUrl.startsWith(`${t.path}/assets/`)}async toBlob(t){const{data:e}=await b(this.partUrl,{responseType:"blob"});return p(t),e}}function M(r){return A(r?.source)}function u(r){return Array.isArray(r)?r.every(t=>t instanceof m):!1}const c=/^(model\/gltf\+json)|(model\/gltf-binary)$/,l=/\.(gltf|glb)/i;function A(r){return r?Array.isArray(r)?r.some(f):f(r):!1}function f(r){if(r instanceof File){const{type:t,name:e}=r;return c.test(t)||l.test(e)}return c.test(r.assetMimeType)||l.test(r.assetName)}function U(r,t){if(!r)return!1;const{source:e}=r;return B(e,t)}function O(r,t){if(r===t)return!0;const{source:e}=r,{source:s}=t;if(e===s)return!0;if(u(e)&&u(s)){if(e.length!==s.length)return!1;const a=(n,o)=>n.assetNameo.assetName?1:0,i=[...e].sort(a),y=[...s].sort(a);for(let n=0;n0&&e.every(s=>h(s,t))}return h(r,t)}function h(r,t){return r instanceof m&&r.isOnService(t)}function S(r,t){return r instanceof File?N(r,t):v(r.assetMimeType,r.assetName,t)}function d(r){return Array.isArray(r)?r:[r]}function w(r){return!!r.original}export{M as B,U as M,d as O,w as S,O as T,m as i,S as q,H as v}; +import{hq as g,$ as p,f as b}from"./story-Doly9N9p.js";import{c as N,o as v}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";class m{constructor(t,e,s){this.assetName=t,this.assetMimeType=e,this.parts=s}equals(t){return this===t||this.assetName===t.assetName&&this.assetMimeType===t.assetMimeType&&g(this.parts,t.parts,(e,s)=>e.equals(s))}isOnService(t){return this.parts.every(e=>e.isOnService(t))}makeHash(){let t="";for(const e of this.parts)t+=e.partHash;return t}async toBlob(t){const{parts:e}=this;if(e.length===1)return e[0].toBlob(t);const s=await Promise.all(e.map(a=>a.toBlob(t)));return p(t),new Blob(s)}}class H{constructor(t,e){this.partUrl=t,this.partHash=e}equals(t){return this===t||this.partUrl===t.partUrl&&this.partHash===t.partHash}isOnService(t){return this.partUrl.startsWith(`${t.path}/assets/`)}async toBlob(t){const{data:e}=await b(this.partUrl,{responseType:"blob"});return p(t),e}}function M(r){return A(r?.source)}function u(r){return Array.isArray(r)?r.every(t=>t instanceof m):!1}const c=/^(model\/gltf\+json)|(model\/gltf-binary)$/,l=/\.(gltf|glb)/i;function A(r){return r?Array.isArray(r)?r.some(f):f(r):!1}function f(r){if(r instanceof File){const{type:t,name:e}=r;return c.test(t)||l.test(e)}return c.test(r.assetMimeType)||l.test(r.assetName)}function U(r,t){if(!r)return!1;const{source:e}=r;return B(e,t)}function O(r,t){if(r===t)return!0;const{source:e}=r,{source:s}=t;if(e===s)return!0;if(u(e)&&u(s)){if(e.length!==s.length)return!1;const a=(n,o)=>n.assetNameo.assetName?1:0,i=[...e].sort(a),y=[...s].sort(a);for(let n=0;n0&&e.every(s=>h(s,t))}return h(r,t)}function h(r,t){return r instanceof m&&r.isOnService(t)}function S(r,t){return r instanceof File?N(r,t):v(r.assetMimeType,r.assetName,t)}function d(r){return Array.isArray(r)?r:[r]}function w(r){return!!r.original}export{M as B,U as M,d as O,w as S,O as T,m as i,S as q,H as v}; diff --git a/custom-toc-highlight/assets/FeatureCommandQueue-DzV-HBIG-BApspUo_.js b/custom-toc-highlight/assets/FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js similarity index 98% rename from custom-toc-highlight/assets/FeatureCommandQueue-DzV-HBIG-BApspUo_.js rename to custom-toc-highlight/assets/FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js index 131910c2..05ed8fed 100644 --- a/custom-toc-highlight/assets/FeatureCommandQueue-DzV-HBIG-BApspUo_.js +++ b/custom-toc-highlight/assets/FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js @@ -1,3 +1,3 @@ -import{v as V,t as w,w as O,z as ne,L as S,A as Ce,C as fe,F as Y,I as Je,$ as Ut,M as B,N as me,S as n,T as mt,V as He,a0 as Ge,a1 as Gi,a2 as Be,a3 as Ne,a4 as A,a5 as qi,a6 as Mt,a7 as Q,a8 as Pt,a9 as ni,aa as $e,ab as At,ac as Ct,ad as Z,ae as Wi,_ as li,af as et,ag as ui,ah as ci,ai as ft,aj as pi,ak as Re,al as di,am as mi,an as fi,ao as Rt,ap as Ie,aq as E,ar as v,as as ie,at as L,au as K,av as ot,aw as F,D as G,ax as hi,ay as yi,az as xe,aA as vi,aB as bi,aC as ht,aD as Ht,aE as xi,aF as ji,aG as Ki,aH as Xi,aI as Zi,aJ as Yi,aK as Qi,aL as yt,aM as Ji,aN as Gt,aO as gi,aP as qt,aQ as ut,aR as es,aS as ts,aT as wi,aU as is,aV as Wt,aW as ss,aX as os,aY as as,aZ as rs,a as ns,a_ as j,a$ as jt,b0 as ls,b1 as us,b2 as at,b3 as It,b4 as Ot,b5 as Ft,b6 as Dt,b7 as Et,b8 as Lt,u as le,b9 as kt,ba as cs,bb as Oe,Y as ps,W as ds,X as ms,U as fs,x as hs,bc as ys,k as vs,bd as bs,be as xs}from"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import{w as gs}from"./utils-SPbpQbmm-B3hR8LxB.js";import{r as ws}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{v as l,hF as D,et as be,b9 as Ss,hT as Kt,K as Fe,eE as Vs,o as Ke,a1 as Si,hm as zs,aq as _s,p as Ts,dN as Xt}from"./story-BfX8CRfG.js";import{k as Ms,E as Ps}from"./mat3-CC4Foazl-BWjyqE2v.js";import{D as As,o as k,B as $,C as N,M as H,F as Cs,z as J,H as rt,E as ue,S as we,e as Zt,L as We}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{t as X,v as Yt,x as Rs,K as Qt,g as Is,o as Os}from"./definitions-DJSdSb77-DkoRHaVx.js";import{I as te,F as Ue,M as ge,U as ye,L as Fs,D as ct,R as vt,T as Vi,G as bt,H as zi,n as Jt,B as ei}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{r as ti}from"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import{c as Ds}from"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import{n as Es}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{a as Ls,E as _i,G as Ti}from"./Program-DLVwTiPA-C1hIaFuM.js";import{H as tt,V as Mi}from"./Texture-BCt2hphT-hC4XzHg_.js";import{t as ks,c as Bs}from"./constants-Bqe1QJ4u-F8oTIn7N.js";import{o as ii}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{m as Ns}from"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import{n as Bt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{k as $s}from"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";class Us{get forceStaticPath(){return Fe("esri-cim-animations-enable-status")==="disabled"}get forceAnimatedPath(){return Fe("esri-cim-animations-enable-status")==="forced"}get freezeGlobalTime(){return Fe("esri-cim-animations-freeze-time")??!1}get spotlightAnimatedSymbols(){return!!Fe("esri-cim-animations-spotlight")}get forceGlobalTimeOrigin(){return Fe("esri-cim-animations-freeze-time")!==!1}}const Nt=new Us;function Hs(e){return e.locationsMap}const Da={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};let Gs=class{constructor(){this.drawPhase=ue.MAP|ue.HITTEST|ue.HIGHLIGHT|ue.DEBUG}startup(){}shutdown(e){}};const xt={[te.BYTE]:1,[te.UNSIGNED_BYTE]:1,[te.SHORT]:2,[te.UNSIGNED_SHORT]:2,[te.HALF_FLOAT]:2,[te.INT]:4,[te.UNSIGNED_INT]:4,[te.FLOAT]:4};let qs=class{constructor(e,t){this._boundPart=null,this.vertexBuffers=new Map;for(const[s,o]of Object.entries(t.vertex)){const a=ti.createVertex(e,Jt.STATIC_DRAW,o);this.vertexBuffers.set(s,a)}const i=new Map;for(const[s,o]of Object.entries(t.index??{})){const a=ti.createIndex(e,Jt.STATIC_DRAW,o);i.set(s,a)}this.groups=[];for(const s of t.groups){let o;if(s.index!=null){if(!t.index?.[s.index])throw new Error("No index data.");const{BYTES_PER_ELEMENT:d}=t.index[s.index];d===2?o=te.UNSIGNED_SHORT:d===4&&(o=te.UNSIGNED_INT)}const a=s.index!=null?i.get(s.index):null,r=new Map,u=new Map;for(const d of s.attributes){const{name:p,count:m,type:f,offset:x,normalized:h,divisor:y,stride:b,vertex:g,location:P}=d;let I=u.get(g);I||(I=[],u.set(g,I));const C=new Es(p,m,f,x,b,h,y);I.push(C),r.set(p,P)}const c=new Ds(e,r,u,this.vertexBuffers,a);this.groups.push({...s,vertexArray:c,locations:r,layout:u,indexing:o})}this.parts=t.parts}bind(e,t){this._boundPart=t;const{group:i}=this.parts[this._boundPart],{vertexArray:s}=this.groups[i];e.bindVAO(s)}draw(e){if(this._boundPart==null)throw new Error("Mesh.bind() has not been called.");const{start:t,count:i}=this.parts[this._boundPart],{group:s}=this.parts[this._boundPart],{indexing:o,primitive:a}=this.groups[s];o?e.drawElements(a,i,o,t*xt[o]):e.drawArrays(a,t,i)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArray:e}of this.groups)e.dispose()}};const Ws={position:{type:te.SHORT,count:2}};let js=class gt extends qs{static create(t,i,s){const o=[];let{stride:a}=i;if(a==null){a=0;for(const[m,{count:f,type:x,offset:h}]of Object.entries(i.layout)){if(h!=null)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");a+=f*xt[x]}}let r=0;for(const[m,{count:f,offset:x,type:h,normalized:y}]of Object.entries(i.layout)){x!=null&&(r=x);const b=s.get(m);if(b==null)throw new Error("Locations must be specified at mesh initialization.");const g={name:m,location:b,vertex:"vertexData",count:f,type:h,offset:r,stride:a,divisor:0,normalized:y!=null&&y};o.push(g),r+=f*xt[h]}const u={attributes:o,primitive:i.primitive};i.index!=null&&(u.index="indexData");let{count:c}=i;if(c==null&&(c=i.index?i.index.length:i.vertex.byteLength/a,Math.floor(c)!==c))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${a}.`);const d={start:0,count:c,group:0,primitive:i.primitive},p={vertex:{vertexData:i.vertex},parts:[d],groups:[u]};return i.index!=null&&(p.index={indexData:i.index}),new gt(t,p,i.layout)}static fromVertexStream(t,i){return gt.create(t,{primitive:Vi.TRIANGLE_STRIP,vertex:new Uint16Array(i),layout:Ws},new Map([["position",0]]))}constructor(t,i,s){super(t,i),this._spec=s}bind(t,i=0){super.bind(t,i)}},he=class extends fe{};l([V(n)],he.prototype,"globalTime",void 0),l([V(v)],he.prototype,"animationTextureSize",void 0),l([V(j)],he.prototype,"animationTexture",void 0),l([V(B)],he.prototype,"toScreen",void 0),l([V(B)],he.prototype,"toNdc",void 0),l([V(n)],he.prototype,"mapRotation",void 0),l([V(n)],he.prototype,"pixelRatio",void 0);let nt=class extends fe{getVVRotationMat4(e){return Y(Ut(e),Je.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new Je(s,i,0,0,i.multiply(new n(-1)),s,0,0,0,0,1,0,0,0,0,1)})}getVVRotationMat3(e){return Y(Ut(e),B.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new B(s,i,0,i.multiply(new n(-1)),s,0,0,0,1)})}getNormalizedAngle(e){const t=me(this.rotationType,new n(mt.Arithmatic));return Y(t,new n(90).subtract(e),e)}};l([V(n)],nt.prototype,"rotationType",void 0);class wt extends He{}l([w(3,S)],wt.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),l([w(4,v)],wt.prototype,"zoomRange",void 0);class Ks extends Oe{}class re extends Ge{_getScreenPosition(t){const{pos:i,translation:s,rotation:o,scale:a,offset:r,id:u,vvScale:c}=t,d=Gi(this,u).multiply(Math.PI/180),p=s.x.multiply(4/3),m=s.y.multiply(-1).multiply(4/3),f=Be(o.subtract(d)),x=Ne(o.subtract(d)),h=new n(0),y=new n(1),{pixelRatio:b}=this.animationInfo,g=new B(y,h,h,h,y,h,p.multiply(b),m.multiply(b),y),P=new B(x,f.multiply(-1),h,f,x,h,0,0,y),I=a.multiply(c).multiply(b).multiply(4/3),C=P.multiply(I),_=this.animationInfo.toScreen.multiply(new A(i,1)),T=g.multiply(_).xy,M=C.multiply(new A(r,0)).xy;return T.add(M)}_clip(t,i){let s=super.clip(t,i);const o=qi(this._getLocalTimeOrigin(t),new n(0));return Nt.forceGlobalTimeOrigin||(s=s.add(Mt([o,()=>new n(2)],[!0,()=>new n(0)]))),s}_getLocalTimeOrigin(t){return this.storage.getLocalTimeOrigin(t)}_toNdc(t){return this.animationInfo.toNdc.multiply(new A(t,1)).xy}_getEvalParams(t,i){const{globalTime:s,animationTextureSize:o,animationTexture:a}=this.animationInfo;return{globalTime:s,localTimeOrigin:this._getLocalTimeOrigin(t.id),animationTextureSize:o,animationTexture:a,pixelDimensions:i}}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a),u=i.outlineSize.multiply(.5),c=At(o).subtract(u),d=$e(new n(.5).subtract(c),new n(0),new n(1)),p=i.outlineColor.multiply(d);return new n(1).subtract(p.a).multiply(r).add(p)}}function Ve(e,t,i){const s=e.add(new v(t,0)),o=Q(i.animationTexture,s.add(.5).divide(i.animationTextureSize)).xy;return e=e.add(o),ls({animationPointer:e,...i},S,null,a=>{const{out:r}=a;if(!r)throw new Error("out is null");return us({...a,out:r})})}l([V(at)],re.prototype,"mosaicInfo",void 0),l([V(he)],re.prototype,"animationInfo",void 0),l([O(It)],re.prototype,"visualVariableColor",void 0),l([O(Ot)],re.prototype,"visualVariableOpacity",void 0),l([O(Ft)],re.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],re.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],re.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],re.prototype,"visualVariableSizeUnitValue",void 0),l([O(nt)],re.prototype,"visualVariableRotation",void 0);var ve;(function(e){e[e.transform=0]="transform",e[e.fromColor=1]="fromColor",e[e.toColor=2]="toColor",e[e.colorMix=3]="colorMix",e[e.toOpacity=4]="toOpacity",e[e.opacityMix=5]="opacityMix"})(ve||(ve={}));let De=class extends wt{};l([w(5,v)],De.prototype,"offset",void 0),l([w(6,v)],De.prototype,"uv",void 0),l([w(7,S)],De.prototype,"sizing",void 0),l([w(8,n)],De.prototype,"angle",void 0);class Ee extends Ct{}l([w(12,v)],Ee.prototype,"offsetNextVertex1",void 0),l([w(13,v)],Ee.prototype,"offsetNextVertex2",void 0),l([w(14,v)],Ee.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],Ee.prototype,"textureUVNextVertex2",void 0);class Xs extends Ks{}function ce(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}let St=class extends re{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}_vertexPreamble(e){const{id:t,pos:i,offset:s,animationPointerAndBaseSizeAndReferenceSize:o,uv:a,sizing:r,angle:u}=e,c=o.xy,d=o.z,p=o.w,m=r.xy,f=r.z,x=Z(e.bitset,le.bitset.isStroke),h=r.w,y=Z(e.bitset,le.bitset.scaleSymbolsProportionally),b=this._getEvalParams(e,m),g=Ve(c,ve.transform,b),P=Mt([me(Z(e.bitset,le.bitset.isMapAligned),new n(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new n(0)]),I=new Wi(Ne(P),Be(P.multiply(-1)),Be(P),Ne(P)).multiply(g.xy),C=g.z.subtract(P).subtract(u.multiply(li)),_=g.w,T=Z(e.bitset,le.bitset.isSDF),M=et(this,t,new n(p)).divide(new n(p));return{baseSize:d,animationPointer:c,strokeWidth:f,isOutline:x,unscaledDistanceToPx:h,scaleSymbolsProportionally:y,isSDF:T,position:this._getScreenPosition({id:t,pos:i,offset:s,referenceSize:p,translation:I,rotation:C,scale:_,vvScale:M}),uv:a,evalParams:b,vvScale:M,scale:_}}vertex(e,t){const{position:i,animationPointer:s,evalParams:o,isOutline:a,unscaledDistanceToPx:r,vvScale:u,uv:c,strokeWidth:d,scaleSymbolsProportionally:p,scale:m,isSDF:f,baseSize:x}=this._vertexPreamble(e),h=this._toNdc(i);let y=Ve(s,ve.fromColor,o);y=new S(y.rgb.multiply(y.a),y.a);let b=Ve(s,ve.toColor,o);b=new S(b.rgb.multiply(b.a),b.a);let g=Ve(s,ve.colorMix,o);g=new S(g.rgb.multiply(g.a),g.a);const P=Ve(s,ve.toOpacity,o).a,I=Ve(s,ve.opacityMix,o).a,C=ui(this,e.id,y,ci(pi(e.bitset,le.bitset.colorLocked),new ft(a))),_=Re(C,b,g),T=di(this,e.id),M=Re(T,P,I),z=_.multiply(M),R=this.clip(e.id,e.zoomRange),Se=r.multiply(u);return{glPosition:new S(h,R,1),uv:c.divide(this.mosaicInfo.size),color:z.multiply(new n(1).subtract(a)),outlineColor:z.multiply(a),distanceToPx:Se,strokeWidth:d.multiply(Re(new n(1),m,p)),isOutline:a,isSDF:f,...this.maybeRunHittest(e,t,{pos:e.pos,size:x,sizeCorrection:new n(1),isMapAligned:new n(1),vvRotationMat3:new B(1,0,0,0,1,0,0,0,1),placementMat3:new B(1,0,0,0,1,0,0,0,1),outlineSize:new n(1),distanceToPx:Se,isSDF:f})}}fragment(e){let t=this._getColor(e.uv,{color:e.color,distanceToPx:e.distanceToPx,isSDF:e.isSDF,outlineColor:e.outlineColor,outlineSize:e.strokeWidth});return Nt.spotlightAnimatedSymbols&&(t=t.add(new S(0,.3,0,.3))),this.getFragmentOutput(t,e)}hittest(e,t,i){return Y(mi(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,i),this._hittestMarker(e,t,i))}_hittestSmallMarker(e,t,i){const{position:s,distance:o,smallSymbolDistance:a}=this.hittestRequest,r=o.subtract(a),{viewMat3:u,tileMat3:c}=this.view,d=u.multiply(c).multiply(new A(i.pos,1)).xy,p=i.size.multiply(.5);return fi(d,s).subtract(p).add(r)}_hittestMarker(e,t,i){const s=this._vertexPreamble({...e}).position,o=this._vertexPreamble({...e,offset:t.offsetNextVertex1,uv:t.textureUVNextVertex1}).position,a=this._vertexPreamble({...e,offset:t.offsetNextVertex2,uv:t.textureUVNextVertex2}).position,r=this.hittestRequest.position,u=this.hittestRequest.distance,c=Rt(r,s,o,a);return Y(Ie(c,u),c,this._hittestSamples(s,o,a,e,t,i))}_hittestSamples(e,t,i,s,o,a){const{outlineSize:r,isSDF:u,distanceToPx:c}=a,d=this.hittestRequest.position,p=this.hittestRequest.distance,m=E(d.add(new v(ie(p),ie(p))),e,t,i),f=E(d.add(new v(0,ie(p))),e,t,i),x=E(d.add(new v(p,ie(p))),e,t,i),h=E(d.add(new v(ie(p),0)),e,t,i),y=E(d,e,t,i),b=E(d.add(new v(p,0)),e,t,i),g=E(d.add(new v(ie(p),p)),e,t,i),P=E(d.add(new v(0,p)),e,t,i),I=E(d.add(new v(p,p)),e,t,i),C=s.uv.divide(this.mosaicInfo.size),_=o.textureUVNextVertex1.divide(this.mosaicInfo.size),T=o.textureUVNextVertex2.divide(this.mosaicInfo.size),M={color:new S(1,1,1,1),outlineSize:r,outlineColor:new S(1,1,1,1),isSDF:u,distanceToPx:c};let z=new n(0);return z=z.add(L(m).multiply(this._getColor(ce(m,C,_,T),M).a)),z=z.add(L(f).multiply(this._getColor(ce(f,C,_,T),M).a)),z=z.add(L(x).multiply(this._getColor(ce(x,C,_,T),M).a)),z=z.add(L(h).multiply(this._getColor(ce(h,C,_,T),M).a)),z=z.add(L(y).multiply(this._getColor(ce(y,C,_,T),M).a)),z=z.add(L(b).multiply(this._getColor(ce(b,C,_,T),M).a)),z=z.add(L(g).multiply(this._getColor(ce(g,C,_,T),M).a)),z=z.add(L(P).multiply(this._getColor(ce(P,C,_,T),M).a)),z=z.add(L(I).multiply(this._getColor(ce(I,C,_,T),M).a)),K(z,new n(.05)).multiply(ot(this.hittestRequest))}};l([D(0,F(De)),D(1,F(Ee))],St.prototype,"vertex",null),l([D(0,F(Xs))],St.prototype,"fragment",null);let q=class extends Gs{constructor(){super(...arguments),this.symbologyPlane=we.FILL,this._input=null}},Zs=class extends q{render(e,t){const{context:i,painter:s}=e,{target:o}=t,{freezeGlobalTime:a}=Nt,r=0,u=s.textureManager.animationStore.getTexture(i,r),c=[2/e.state.size[0],0,0,0,-2/e.state.size[1],0,-1,1,1],d=Array.from(Ms(Zt(),c)),p=Array.from(Ps(Zt(),d,o.transforms.displayViewScreenMat3)),m=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,m.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0),animationInfo:{globalTime:a===!1?e.time/1e3:a,animationTextureSize:[u.descriptor.width,u.descriptor.height],animationTexture:{unit:6,texture:u},toScreen:p,toNdc:c,mapRotation:e.state.rotation,pixelRatio:e.state.pixelRatio}},defines:{...N(e)},optionalAttributes:{zoomRange:!0},useComputeBuffer:!0}),s.setPipelineState({...H(e)}),s.submitDraw(e,t),a===!1&&o.requestRender()}},Ys=class extends Zs{constructor(){super(...arguments),this.type=G.AnimatedMarker,this.shaders={geometry:new St}}},Pi=class extends hi{};l([w(0,v)],Pi.prototype,"pos",void 0);let Qs=class extends Oe{};class Ai extends fe{}l([V(n)],Ai.prototype,"dotSize",void 0);let Xe=class extends fe{};l([V(j)],Xe.prototype,"locations",void 0),l([V(n)],Xe.prototype,"pixelRatio",void 0),l([V(n)],Xe.prototype,"tileZoomFactor",void 0);const Js=1e-6;class _e extends yi{vertex(t){const i=new B(1,0,0,0,-1,0,0,1,1).multiply(new A(t.pos.xy.divide(X),1)),s=Q(this.draw.locations,i.xy),o=xe(this.instance.dotSize.divide(2),new n(1));let a=new n(0);a=a.add(K(s.a,new n(Js)).multiply(2));let r=o.add(this.instance.dotSize);const u=this.view.displayViewScreenMat3.multiply(new A(t.pos.add(.5),1)),c=new S(u.xy,a,1),d=this.instance.dotSize.divide(r),p=new n(-1).divide(o.divide(r));return r=r.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:c,glPointSize:r,color:s,ratio:d,invEdgeRatio:p}}fragment(t){const i=vi(t.glPointCoord.subtract(.5)).multiply(2),s=bi(new n(0),new n(1),t.invEdgeRatio.multiply(i.subtract(t.ratio)).add(1)),o=new kt;return o.glFragColor=t.color.multiply(s),o}}l([V(Ai)],_e.prototype,"instance",void 0),l([V(Xe)],_e.prototype,"draw",void 0),l([V(cs)],_e.prototype,"view",void 0),l([D(0,F(Pi))],_e.prototype,"vertex",null),l([D(0,F(Qs))],_e.prototype,"fragment",null);class Ci extends He{}l([w(3,n)],Ci.prototype,"inverseArea",void 0);let Ze=class extends fe{};l([V(ne.ofType(S,2))],Ze.prototype,"isActive",void 0),l([V(ne.ofType(S,8))],Ze.prototype,"colors",void 0),l([V(n)],Ze.prototype,"dotValue",void 0);let Te=class extends fe{};l([V(j)],Te.prototype,"dotTexture0",void 0),l([V(j)],Te.prototype,"dotTexture1",void 0),l([V(n)],Te.prototype,"tileZoomFactor",void 0),l([V(n)],Te.prototype,"pixelRatio",void 0),l([V(n)],Te.prototype,"tileDotsOverArea",void 0);let Me=class extends Ge{_dotThreshold(e,t,i){return e.divide(t).divide(i)}vertex(e){const t=new B(2/X,0,0,0,-2/X,0,-1,1,1).multiply(new A(e.pos,1)),i=this.clip(e.id),s=new S(t.xy,i,1),o=this.storage.getVVData(e.id).multiply(this.instance.isActive.get(0)).multiply(e.inverseArea),a=this.storage.getDataDrivenData0(e.id).multiply(this.instance.isActive.get(1)).multiply(e.inverseArea),r=this.draw.tileZoomFactor.multiply(X).divide(this.draw.pixelRatio),u=this._dotThreshold(o,this.instance.dotValue,this.draw.tileDotsOverArea),c=this._dotThreshold(a,this.instance.dotValue,this.draw.tileDotsOverArea),d=e.pos.add(.5).divide(r);return{glPosition:s,color:new S(0,0,0,0),textureCoords:d,thresholds0:u,thresholds1:c}}fragment(e){const t=new kt,i=Q(this.draw.dotTexture0,e.textureCoords),s=Q(this.draw.dotTexture1,e.textureCoords),o=e.thresholds0.subtract(i),a=e.thresholds1.subtract(s);let r;const u=Je.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),c=Je.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const d=K(new n(0),o),p=K(new n(0),a),m=ht(d,o).add(ht(p,a)),f=K(m,new n(0)),x=new n(1).subtract(f),h=m.add(f),y=o.multiply(d).divide(h),b=a.multiply(p).divide(h),g=u.multiply(y).add(c.multiply(b));r=x.multiply(g)}else{const d=xe(Ht(o),Ht(a)),p=K(d,new n(0)),m=new n(1).subtract(p),f=K(d,o),x=K(d,a),h=u.multiply(f).add(c.multiply(x));r=m.multiply(h)}return t.glFragColor=r,t}hittest(e){return ot(this.hittestRequest)}};l([Ce],Me.prototype,"blending",void 0),l([V(Ze)],Me.prototype,"instance",void 0),l([V(Te)],Me.prototype,"draw",void 0),l([D(0,F(Ci))],Me.prototype,"vertex",null),l([D(0,F(Oe))],Me.prototype,"fragment",null);const eo={pos:{count:2,type:te.UNSIGNED_SHORT}};let to=class{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(e){if(this._dotFBO==null){const t=X,i=X,s=new tt(t,i);s.samplingMode=ge.NEAREST,s.wrapMode=bt.CLAMP_TO_EDGE;const o=new Ls(e,new _i(zi.DEPTH_STENCIL,t,i));this._dotFBO=new Ti(e,s,o)}return this._dotFBO}getDotDensityMesh(e,t){if(this._dotMesh==null){const i=X,s=i*i,o=2,a=new Int16Array(s*o);for(let r=0;rSi.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");let po=class{destroy(){this._accumulateFramebuffer=Kt(this._accumulateFramebuffer),this._resolveGradientTexture=Kt(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return this._accumulateFramebuffer!=null&&this._resolveGradientTexture!=null}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(this._qualityProfile==null){const t=uo(e,co());this._qualityProfile={...t,defines:{usesHalfFloatPrecision:t.dataType!==Ue.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,t,i){if(this._accumulateFramebuffer==null){const{dataType:s,samplingMode:o,pixelFormat:a,internalFormat:r}=this.loadQualityProfile(e),u=new tt(t,i);u.pixelFormat=a,u.internalFormat=r,u.dataType=s,u.samplingMode=o,u.wrapMode=bt.CLAMP_TO_EDGE;const c=new _i(zi.DEPTH_STENCIL,t,i);this._accumulateFramebuffer=new Ti(e,u,c)}else{const{width:s,height:o}=this._accumulateFramebuffer;s===t&&o===i||this._accumulateFramebuffer.resize(t,i)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,t,i){if(this._resolveGradientTexture==null){const s=new tt;s.wrapMode=bt.CLAMP_TO_EDGE,this._resolveGradientTexture=new Mi(e,s)}else this._prevGradientHash!==t&&(this._resolveGradientTexture.resize(i.length/4,1),this._resolveGradientTexture.setData(i),this._prevGradientHash=t);return this._resolveGradientTexture}};function Ri(e){return e?.25:1}let Ii=class extends He{};l([w(5,v)],Ii.prototype,"offset",void 0);let mo=class extends Oe{},zt=class extends fe{};l([V(n)],zt.prototype,"radius",void 0),l([V(n)],zt.prototype,"isFieldActive",void 0);class Le extends Ge{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(t){const{radius:i,isFieldActive:s}=this.kernelControls,o=t.offset,a=s.multiply(this.storage.getVVData(t.id).x).add(new n(1).subtract(s)),r=this.view.displayViewScreenMat3.multiply(new A(t.pos,1)).add(this.view.displayViewMat3.multiply(new A(o,0)).multiply(i)),u=this.clip(t.id);return{glPosition:new S(r.xy,u,1),offset:o,fieldValue:a,color:new S(0),...this.maybeRunHittest(t,{},null)}}fragment(t){const{offset:i,fieldValue:s}=t,o=vi(i),a=K(o,new n(1)),r=new n(1).subtract(o.multiply(o)),u=r.multiply(r),c=a.multiply(u).multiply(s).multiply(new n(Ri(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new S(c),t)}hittest(t){const{viewMat3:i,tileMat3:s}=this.view,o=i.multiply(s).multiply(new A(t.pos,1));return Qi(o.xy,this.kernelControls.radius,this.hittestRequest.position)}}l([Ce],Le.prototype,"usesHalfFloatPrecision",void 0),l([V(zt)],Le.prototype,"kernelControls",void 0),l([D(0,F(Ii))],Le.prototype,"vertex",null),l([D(0,F(mo))],Le.prototype,"fragment",null);let Oi=class extends hi{};l([w(0,v)],Oi.prototype,"position",void 0);let fo=class extends bs{},Ye=class extends fe{};l([V(j)],Ye.prototype,"texture",void 0),l([V(v)],Ye.prototype,"minAndInvRange",void 0),l([V(n)],Ye.prototype,"normalization",void 0);let Fi=class extends fe{};l([V(j)],Fi.prototype,"texture",void 0);let Pe=class extends yi{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){return{glPosition:new S(e.position.multiply(2).subtract(1),1,1),uv:e.position}}fragment(e){const{accumulatedDensity:t,gradient:i}=this;let s=Q(t.texture,e.uv).r.divide(new n(Ri(this.usesHalfFloatPrecision)));s=s.multiply(t.normalization),s=s.subtract(t.minAndInvRange.x).multiply(t.minAndInvRange.y);const o=Q(i.texture,new v(s,.5)),a=new kt;return a.glFragColor=new S(o.rgb.multiply(o.a),o.a),a}};l([Ce],Pe.prototype,"usesHalfFloatPrecision",void 0),l([V(Ye)],Pe.prototype,"accumulatedDensity",void 0),l([V(Fi)],Pe.prototype,"gradient",void 0),l([D(0,F(Oi))],Pe.prototype,"vertex",null),l([D(0,F(fo))],Pe.prototype,"fragment",null);let ho=class extends q{constructor(){super(...arguments),this.type=G.Heatmap,this.drawPhase=ue.MAP|ue.HITTEST|ue.DEBUG,this.shaders={accumulate:new Le,resolve:new Pe},this._isBound=!1,this._resources=new Map}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e),this._prevFBO=null,this._unbind()}render(e,t){const{context:i,painter:s,state:o}=e,a=t.instance.getInput(),{isFieldActive:r}=a.uniforms,u=this._getOrCreateResourcesRecord(i),c=u.loadQualityProfile(i);k(e)||this._bind(e,u,a),s.setShader({shader:this.shaders.accumulate,uniforms:{...$(e,t.target),kernelControls:{radius:si(a,o),isFieldActive:r?1:0}},defines:{...N(e),...c.defines},optionalAttributes:{},useComputeBuffer:k(e)});const d=k(e)?vo:Ei;s.setPipelineState(d),s.submitDraw(e,t)}getStencilReference(e){return Di(e)}renderResolvePass(e,t){if(k(e))return;const{context:i,painter:s}=e,o=this._resources.get(i);if(this._prevFBO==null||this._prevViewport==null||!o?.initialized)return;const{defines:a}=o.loadQualityProfile(i),{minDensity:r,maxDensity:u,radius:c}=t.getInput().uniforms,d=8,p=9,m=o.accumulateFramebuffer,f=o.resolveGradientTexture,x={shader:this.shaders.resolve,uniforms:{accumulatedDensity:{texture:{unit:d,texture:m.colorTexture},minAndInvRange:[r,1/(u-r)],normalization:3/(c*c*Math.PI)},gradient:{texture:{unit:p,texture:f}}},defines:a,optionalAttributes:{},useComputeBuffer:!1};i.bindFramebuffer(this._prevFBO),i.setViewport(0,0,this._prevViewport.width,this._prevViewport.height),i.bindTexture(m.colorTexture,d),i.bindTexture(f,p),s.setPipelineState(bo),s.submitDrawMesh(i,x,s.quadMesh),this._unbind()}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return t==null&&(t=new po,this._resources.set(e,t)),t}_unbind(){this._prevFBO=null,this._prevViewport=null,this._isBound=!1}_bind(e,t,i){if(this._isBound)return;const{context:s,state:o,pixelRatio:a}=e,r=s.getBoundFramebufferObject(),u=s.getViewport();this._prevFBO=r,this._prevViewport=u;const{gradient:c,gradientHash:d}=i.uniforms;t.ensureResolveGradientTexture(s,d,c);const{width:p,height:m}=u,f=yo(si(i,o),a),x=p*f,h=m*f,y=t.ensureAccumulateFBO(s,x,h);s.blitFramebuffer(r,y,0,0,r.width,r.height,0,0,y.width,y.height,vt.STENCIL,ge.NEAREST),s.bindFramebuffer(y),s.setViewport(0,0,y.width,y.height),s.setColorMask(!0,!0,!0,!0),s.setClearColor(0,0,0,0),s.clear(vt.COLOR),this._isBound=!0}};function yo(e,t){const i=t>1.5?.25:.5;return e<1/(2*i)?1:i}function Di(e){return e.key.level+1}const Ei={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:{write:!1,test:{ref:Di,compare:Fs.GEQUAL,mask:255,op:{fail:ct.KEEP,zFail:ct.KEEP,zPass:ct.REPLACE}}}},vo={...Ei,stencil:!1},bo={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};function si(e,t){const{referenceScale:i,radius:s}=e.uniforms;return s*(i!==0?i/t.scale:1)}const xo=360/254;var W;(function(e){e[e.Color=0]="Color",e[e.Outline=1]="Outline",e[e.Halo=2]="Halo"})(W||(W={}));let ee=class extends He{};l([w(3,S)],ee.prototype,"color",void 0),l([w(4,v)],ee.prototype,"offset",void 0),l([w(5,v)],ee.prototype,"textureUV",void 0),l([w(6,n)],ee.prototype,"fontSize",void 0),l([w(7,n)],ee.prototype,"referenceSize",void 0),l([w(8,S)],ee.prototype,"outlineColor",void 0),l([w(9,S)],ee.prototype,"haloColor",void 0),l([w(10,v)],ee.prototype,"outlineAndHaloSize",void 0),l([w(11,v)],ee.prototype,"zoomRange",void 0),l([w(12,n)],ee.prototype,"clipAngle",void 0),l([w(13,S)],ee.prototype,"referenceSymbol",void 0);let _t=class extends Ct{};l([w(14,v)],_t.prototype,"offsetNextVertex1",void 0),l([w(15,v)],_t.prototype,"offsetNextVertex2",void 0);let go=class extends Oe{},U=class extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.textRenderPassType=W.Color,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t,i){const s=t.multiply(xo),o=At(this.view.rotation.subtract(s)),a=yt(new n(360).subtract(o),o);let r=new n(0);const u=Ji(this.view.currentZoom.multiply(Qt)).divide(Qt),c=e.x,d=e.y,p=new n(1).subtract(K(c,u)).multiply(2),m=K(new n(90),a).multiply(2),f=new n(2).multiply(new n(1).subtract(K(u,d)));return r=r.add(i.multiply(p)),r=r.add(i.multiply(m)),r=r.add(f),r}vertex(e,t){const i=Z(e.bitset,ps),s=new n(1).subtract(i);let o=e.fontSize,a=o.divide(Gt);const r=this.textRenderPassType===W.Outline?e.outlineColor:this.textRenderPassType===W.Halo?e.haloColor:this._getVertexColor(e),u=this.isLabel?this.storage.getLabelVisibility(e.id):new n(1),c=this.isLabel?r.multiply(u):r,d=this.view.displayViewScreenMat3.multiply(new A(e.pos,1));let p=e.offset,m=new n(1),f=B.identity(),x=new v(0);if(this.isLabel){if(!e.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const _=e.referenceSymbol,T=_.xy,M=_.z,z=this._unpackDirection(_.w),R=et(this,e.id,M).divide(2),Se=z.multiply(R.add(Is));x=T.add(Se),p=p.add(x)}else m=et(this,e.id,e.referenceSize).divide(e.referenceSize),o=o.multiply(m),a=a.multiply(m),p=p.multiply(m),f=gi(this,e.id),p=f.multiply(new A(p,0)).xy;const h=Z(e.bitset,ds),y=this._getViewRotationMatrix(h).multiply(new A(p,0));let b=this.isLabel?this.clipLabel(e.zoomRange,e.clipAngle,h):this.clip(e.id,e.zoomRange);b=this.isBackgroundPass?b.add(s.multiply(2)):b.add(i.multiply(2));const g=this.isLabel?ci(Ie(b,new n(1)),me(u,new n(0))):new ft(!1),P=new S(d.xy.add(y.xy),b,1),I=e.textureUV.divide(this.mosaicInfo.size);let C=new n(0);if(this.textRenderPassType===W.Outline&&(me(e.outlineAndHaloSize.x,new n(0))&&(b=b.add(new n(2))),C=new n(e.outlineAndHaloSize.x).divide(a).divide(qt)),this.textRenderPassType===W.Halo){const _=e.outlineAndHaloSize.x,T=new n(e.outlineAndHaloSize.y);me(T,new n(0))&&(b=b.add(new n(2))),C=T.add(_).divide(a).divide(qt)}return{glPosition:P,color:c,size:a,textureUV:I,antialiasingWidth:new n(.105*Gt).divide(o).divide(this.view.pixelRatio),outlineDistanceOffset:C,...this.maybeRunHittest(e,t,{vvSizeAdjustment:m,vvRotation:f,labelOffset:x,labelClipped:g})}}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,i=this.view.displayMat3,s=new n(1).subtract(e);return t.multiply(e).add(i.multiply(s))}fragment(e){const t=new n(.25),i=new n(1).subtract(t),s=Q(this.mosaicInfo.texture,e.textureUV).a;let o=i.subtract(e.outlineDistanceOffset);this.highlight&&(o=o.divide(2));const a=e.antialiasingWidth,r=bi(o.subtract(a),o.add(a),s);return this.getFragmentOutput(e.color.multiply(r),e)}hittest(e,t,{vvSizeAdjustment:i,vvRotation:s,labelOffset:o,labelClipped:a}){let r,u,c;this.isLabel?(r=new A(e.offset.add(o),0),u=new A(t.offsetNextVertex1.add(o),0),c=new A(t.offsetNextVertex2.add(o),0)):(r=s.multiply(new A(e.offset.multiply(i),0)),u=s.multiply(new A(t.offsetNextVertex1.multiply(i),0)),c=s.multiply(new A(t.offsetNextVertex2.multiply(i),0)));const{viewMat3:d,tileMat3:p}=this.view,m=d.multiply(p).multiply(new A(e.pos,1)),f=m.add(p.multiply(r)).xy,x=m.add(p.multiply(u)).xy,h=m.add(p.multiply(c)).xy,y=Rt(this.hittestRequest.position,f.xy,x.xy,h.xy);return this.isLabel?Y(a,ot(this.hittestRequest),y):y}_unpackDirection(e){const t=new ut(e),i=es(t,new ut(2)),s=ts(t,new ut(3));return new v(new n(i).subtract(1),new n(s).subtract(1))}_getVertexColor(e){let t=e.color;if(this.visualVariableColor){const i=this.storage.getColorValue(e.id);t=this.visualVariableColor.getColor(i,e.color,new ft(!1))}if(this.visualVariableOpacity){const i=this.storage.getOpacityValue(e.id),s=this.visualVariableOpacity.getOpacity(i);t=t.multiply(s)}return t}};l([O(It)],U.prototype,"visualVariableColor",void 0),l([O(Ot)],U.prototype,"visualVariableOpacity",void 0),l([O(nt)],U.prototype,"visualVariableRotation",void 0),l([O(Ft)],U.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],U.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],U.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],U.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],U.prototype,"mosaicInfo",void 0),l([Ce],U.prototype,"textRenderPassType",void 0),l([Ce],U.prototype,"isBackgroundPass",void 0),l([Ce],U.prototype,"isLabel",void 0),l([D(0,F(ee)),D(1,F(_t))],U.prototype,"vertex",null),l([D(0,F(go))],U.prototype,"fragment",null);let wo=class extends q{constructor(){super(...arguments),this.type=G.Label,this.shaders={geometry:new U},this.drawPhase=ue.LABEL|ue.LABEL_ALPHA|ue.HITTEST,this.symbologyPlane=we.TEXT}render(e,t){const{context:i,painter:s}=e,o=N(e),a={...H(e)},r=t.instance.getInput(),u={shader:this.shaders.geometry,uniforms:{...J(e,t.target,r.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!0,isLabel:!0},optionalAttributes:r.optionalAttributes,useComputeBuffer:k(e)};s.setShader(u),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Halo,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t)}},So=class extends q{constructor(){super(...arguments),this.type=G.Line,this.shaders={geometry:new wi},this.symbologyPlane=we.LINE}render(e,t){const{painter:i,pixelRatio:s}=e,o=t.instance.getInput();i.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),antialiasingControls:qe(s)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),i.setPipelineState(H(e)),i.submitDraw(e,t)}};class Ae extends is{}l([w(9,n)],Ae.prototype,"accumulatedDistance",void 0),l([w(10,v)],Ae.prototype,"segmentDirection",void 0),l([w(11,n)],Ae.prototype,"offsetAlongLine",void 0),l([w(12,n)],Ae.prototype,"capType",void 0),l([w(13,S)],Ae.prototype,"tlbr",void 0);class Tt extends wi{_getDistanceRatio(t,i){const s=Z(t.bitset,ms);return s.multiply(xe(i,new n(.25)).multiply(new n(2))).add(new n(1).subtract(s).multiply(be(1)))}_getSDFAlpha(t){const{halfWidth:i,normal:s,tlbr:o,patternSize:a,accumulatedDistance:r,offsetAlongLine:u,dashToPx:c,capType:d}=t,p=a.x.divide(ks).multiply(c),m=Wt(r.add(u).divide(p)),f=Re(o.xy,o.zw,new v(m,.5)),x=Pt(Q(this.mosaicInfo.texture,f)).multiply(2).subtract(1).multiply(Bs).multiply(c),h=s.y.multiply(i),y=Mt([me(d,new n(1)),x.subtract(i)],[me(d,new n(2)),ss(os(xe(x,new n(0)),new n(2)).add(h.multiply(h))).subtract(i)],[!0,x]),b=$e(new n(.25).subtract(y),new n(0),new n(1));return new S(b)}_getPatternColor(t){const{halfWidth:i,normal:s,color:o,accumulatedDistance:a,patternSize:r,sampleAlphaOnly:u,tlbr:c}=t,d=r.y.multiply(new n(2).multiply(i).divide(r.x)),p=Wt(a.divide(d)),m=new n(.5).multiply(s.y).add(new n(.5)),f=Re(c.xy,c.zw,new v(m,p));let x=Q(this.mosaicInfo.texture,f);return this.visualVariableColor!=null&&(x=Y(Ie(u,new n(.5)),new S(o.a),o)),x}vertex(t,i){const{segmentDirection:s,tlbr:o,bitset:a}=t,r=as(this,t),u=t.accumulatedDistance.divide(this.view.displayZoomFactor).add(ht(s,r.scaledOffset)),c=new v(o.z.subtract(o.x),o.w.subtract(o.y)),d=o.divide(this.mosaicInfo.size.xyxy),p=Z(a,fs),m=Z(a,hs),f=Y(Ie(p,new n(.5)),this._getDistanceRatio(t,r.scaledHalfWidth),new n(1));return{...r,tlbr:d,patternSize:c,accumulatedDistance:u,isSDF:p,sampleAlphaOnly:m,dashToPx:f,offsetAlongLine:t.offsetAlongLine,capType:t.capType,...this.maybeRunHittest(t,i,r.halfWidth)}}fragment(t){const{color:i,opacity:s,isSDF:o}=t,a=rs(t,this.antialiasingControls.blur),r=Y(Ie(o,new n(.5)),this._getSDFAlpha(t),this._getPatternColor(t)),u=i.multiply(s).multiply(a).multiply(r);return this.getFragmentOutput(u,t)}}l([V(at)],Tt.prototype,"mosaicInfo",void 0),l([D(0,F(Ae)),D(1,F(ys))],Tt.prototype,"vertex",null);let Vo=class extends q{constructor(){super(...arguments),this.type=G.TexturedLine,this.shaders={geometry:new Tt},this.symbologyPlane=we.LINE}render(e,t){const{context:i,painter:s,pixelRatio:o}=e,a=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,a.uniforms),...$(e,t.target),antialiasingControls:qe(o),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...N(e)},optionalAttributes:a.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}};class de extends He{}l([w(3,S)],de.prototype,"color",void 0),l([w(4,S)],de.prototype,"outlineColor",void 0),l([w(5,v)],de.prototype,"offset",void 0),l([w(6,v)],de.prototype,"textureUV",void 0),l([w(7,S)],de.prototype,"sizing",void 0),l([w(8,n)],de.prototype,"placementAngle",void 0),l([w(9,n)],de.prototype,"sdfDecodeCoeff",void 0),l([w(10,v)],de.prototype,"zoomRange",void 0);class ke extends Ct{}l([w(12,v)],ke.prototype,"offsetNextVertex1",void 0),l([w(13,v)],ke.prototype,"offsetNextVertex2",void 0),l([w(14,v)],ke.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],ke.prototype,"textureUVNextVertex2",void 0);class zo extends Oe{}function pe(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}function pt(e){return e.multiply(e).divide(128)}class se extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,i){const s=pt(t.sizing.x),o=pt(t.sizing.y),a=pt(t.sizing.z),r=t.placementAngle,u=Z(t.bitset,le.bitset.isSDF),c=Z(t.bitset,le.bitset.isMapAligned),d=Z(t.bitset,le.bitset.scaleSymbolsProportionally),p=pi(t.bitset,le.bitset.colorLocked),m=di(this,t.id),f=ui(this,t.id,t.color,p).multiply(m),x=this.view.displayViewScreenMat3.multiply(new A(t.pos.xy,1)),h=et(this,t.id,a).divide(a),y=s.multiply(h),b=t.offset.xy.multiply(h);let g=o.multiply(d.multiply(h.subtract(1)).add(1));g=yt(g,xe(y.subtract(.99),new n(0)));const P=xe(g,new n(1)),I=yt(g,new n(1)),C=B.fromRotation(r.multiply(li)),_=gi(this,t.id),T=this._getViewRotationMatrix(c).multiply(_).multiply(C).multiply(new A(b.xy,0)),M=this.clip(t.id,t.zoomRange),z=new S(x.xy.add(T.xy),M,1),R=t.textureUV.divide(this.mosaicInfo.size),Se=t.outlineColor.multiply(I),Hi=Z(t.bitset,le.bitset.overrideOutlineColor),$t=t.sdfDecodeCoeff.multiply(y);return{glPosition:z,color:f,textureUV:R,outlineColor:Se,outlineSize:P,distanceToPx:$t,isSDF:u,overrideOutlineColor:Hi,...this.maybeRunHittest(t,i,{pos:t.pos,size:y,sizeCorrection:h,isMapAligned:c,vvRotationMat3:_,placementMat3:C,outlineSize:P,distanceToPx:$t,isSDF:u})}}fragment(t){const i=this._getColor(t.textureUV,t);return this.getFragmentOutput(i,t)}hittest(t,i,s){return Y(mi(s.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,i,s),this._hittestMarker(t,i,s))}_getViewRotationMatrix(t){const i=this.view.displayViewMat3,s=this.view.displayMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getViewScreenMatrix(t){const i=this.view.viewMat3.multiply(this.view.tileMat3),s=this.view.tileMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a);let u=i.outlineSize;this.highlight&&(u=xe(u,i.overrideOutlineColor.multiply(4)));const c=u.multiply(.5),d=At(o).subtract(c),p=$e(new n(.5).subtract(d),new n(0),new n(1)),m=Re(i.outlineColor,i.color,i.overrideOutlineColor).multiply(p);return new n(1).subtract(m.a).multiply(r).add(m)}_hittestSmallMarker(t,i,s){const{position:o,distance:a,smallSymbolDistance:r}=this.hittestRequest,u=a.subtract(r),{viewMat3:c,tileMat3:d}=this.view,p=c.multiply(d).multiply(new A(s.pos,1)).xy,m=s.size.multiply(.5);return fi(p,o).subtract(m).add(u)}_hittestMarker(t,i,s){const{pos:o,sizeCorrection:a,isMapAligned:r}=s,u=new A(t.offset.multiply(a),0),c=new A(i.offsetNextVertex1.multiply(a),0),d=new A(i.offsetNextVertex2.multiply(a),0),{viewMat3:p,tileMat3:m}=this.view,f=p.multiply(m).multiply(new A(o,1)),x=this._getViewScreenMatrix(r).multiply(s.vvRotationMat3).multiply(s.placementMat3),h=f.add(x.multiply(u)).xy,y=f.add(x.multiply(c)).xy,b=f.add(x.multiply(d)).xy,g=this.hittestRequest.position,P=this.hittestRequest.distance,I=Rt(g,h,y,b);return Y(Ie(I,P),I,this._hittestSamples(h,y,b,t,i,s))}_hittestSamples(t,i,s,o,a,r){const{outlineSize:u,isSDF:c,distanceToPx:d}=r,p=this.hittestRequest.position,m=this.hittestRequest.distance,f=E(p.add(new v(ie(m),ie(m))),t,i,s),x=E(p.add(new v(0,ie(m))),t,i,s),h=E(p.add(new v(m,ie(m))),t,i,s),y=E(p.add(new v(ie(m),0)),t,i,s),b=E(p,t,i,s),g=E(p.add(new v(m,0)),t,i,s),P=E(p.add(new v(ie(m),m)),t,i,s),I=E(p.add(new v(0,m)),t,i,s),C=E(p.add(new v(m,m)),t,i,s),_=o.textureUV.divide(this.mosaicInfo.size),T=a.textureUVNextVertex1.divide(this.mosaicInfo.size),M=a.textureUVNextVertex2.divide(this.mosaicInfo.size),z={color:new S(1),outlineColor:new S(1),overrideOutlineColor:new n(1),outlineSize:u,distanceToPx:d,isSDF:c};let R=new n(0);return R=R.add(L(f).multiply(this._getColor(pe(f,_,T,M),z).a)),R=R.add(L(x).multiply(this._getColor(pe(x,_,T,M),z).a)),R=R.add(L(h).multiply(this._getColor(pe(h,_,T,M),z).a)),R=R.add(L(y).multiply(this._getColor(pe(y,_,T,M),z).a)),R=R.add(L(b).multiply(this._getColor(pe(b,_,T,M),z).a)),R=R.add(L(g).multiply(this._getColor(pe(g,_,T,M),z).a)),R=R.add(L(P).multiply(this._getColor(pe(P,_,T,M),z).a)),R=R.add(L(I).multiply(this._getColor(pe(I,_,T,M),z).a)),R=R.add(L(C).multiply(this._getColor(pe(C,_,T,M),z).a)),K(R,new n(.05)).multiply(ot(this.hittestRequest))}}l([O(It)],se.prototype,"visualVariableColor",void 0),l([O(Ot)],se.prototype,"visualVariableOpacity",void 0),l([O(nt)],se.prototype,"visualVariableRotation",void 0),l([O(Ft)],se.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],se.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],se.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],se.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],se.prototype,"mosaicInfo",void 0),l([D(0,F(de)),D(1,F(ke))],se.prototype,"vertex",null),l([D(0,F(zo))],se.prototype,"fragment",null);let _o=class extends q{constructor(){super(...arguments),this.type=G.Marker,this.shaders={geometry:new se},this.symbologyPlane=we.MARKER}render(e,t){const{context:i,painter:s}=e,o=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}},To=class{constructor(){this.computeAttributes={}}get locationsMap(){const e=new Map;for(const t in this.locations)e.set(t,this.locations[t].index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set(Object.keys(this.options));this._optionPropertyKeys=e}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([s,o])=>`${s}.${o}`).join("."),i=zs(t);this._locationInfo={hash:i,locations:e,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const[t,i]of this.locationsMap.entries())e.set("a_"+t,i);return e}getShaderKey(e,t,i){return`${Object.keys(e).map(s=>`${s}.${e[s]}`).join(".")}.${Object.keys(i).filter(s=>i[s]).map(s=>`${s}_${i[s].toString()}`).join(".")}.${Object.keys(t).filter(s=>this.optionPropertyKeys.has(s)).join(".")}`}getProgram(e,t,i,s){let o="",a="";for(const r in i)if(i[r]){const u=typeof i[r]=="boolean"?`#define ${r} +import{v as V,t as w,w as O,z as ne,L as S,A as Ce,C as fe,F as Y,I as Je,$ as Ut,M as B,N as me,S as n,T as mt,V as He,a0 as Ge,a1 as Gi,a2 as Be,a3 as Ne,a4 as A,a5 as qi,a6 as Mt,a7 as Q,a8 as Pt,a9 as ni,aa as $e,ab as At,ac as Ct,ad as Z,ae as Wi,_ as li,af as et,ag as ui,ah as ci,ai as ft,aj as pi,ak as Re,al as di,am as mi,an as fi,ao as Rt,ap as Ie,aq as E,ar as v,as as ie,at as L,au as K,av as ot,aw as F,D as G,ax as hi,ay as yi,az as xe,aA as vi,aB as bi,aC as ht,aD as Ht,aE as xi,aF as ji,aG as Ki,aH as Xi,aI as Zi,aJ as Yi,aK as Qi,aL as yt,aM as Ji,aN as Gt,aO as gi,aP as qt,aQ as ut,aR as es,aS as ts,aT as wi,aU as is,aV as Wt,aW as ss,aX as os,aY as as,aZ as rs,a as ns,a_ as j,a$ as jt,b0 as ls,b1 as us,b2 as at,b3 as It,b4 as Ot,b5 as Ft,b6 as Dt,b7 as Et,b8 as Lt,u as le,b9 as kt,ba as cs,bb as Oe,Y as ps,W as ds,X as ms,U as fs,x as hs,bc as ys,k as vs,bd as bs,be as xs}from"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import{w as gs}from"./utils-SPbpQbmm-CiwW7WzR.js";import{r as ws}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{v as l,hF as D,et as be,b9 as Ss,hT as Kt,K as Fe,eE as Vs,o as Ke,a1 as Si,hm as zs,aq as _s,p as Ts,dN as Xt}from"./story-Doly9N9p.js";import{k as Ms,E as Ps}from"./mat3-CC4Foazl-BWjyqE2v.js";import{D as As,o as k,B as $,C as N,M as H,F as Cs,z as J,H as rt,E as ue,S as we,e as Zt,L as We}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{t as X,v as Yt,x as Rs,K as Qt,g as Is,o as Os}from"./definitions-DJSdSb77-DkoRHaVx.js";import{I as te,F as Ue,M as ge,U as ye,L as Fs,D as ct,R as vt,T as Vi,G as bt,H as zi,n as Jt,B as ei}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{r as ti}from"./BufferObject-BM_7mcDb-EYaqMhmk.js";import{c as Ds}from"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import{n as Es}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{a as Ls,E as _i,G as Ti}from"./Program-DLVwTiPA-DI0GKSfI.js";import{H as tt,V as Mi}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{t as ks,c as Bs}from"./constants-Bqe1QJ4u-F8oTIn7N.js";import{o as ii}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{m as Ns}from"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import{n as Bt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{k as $s}from"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";class Us{get forceStaticPath(){return Fe("esri-cim-animations-enable-status")==="disabled"}get forceAnimatedPath(){return Fe("esri-cim-animations-enable-status")==="forced"}get freezeGlobalTime(){return Fe("esri-cim-animations-freeze-time")??!1}get spotlightAnimatedSymbols(){return!!Fe("esri-cim-animations-spotlight")}get forceGlobalTimeOrigin(){return Fe("esri-cim-animations-freeze-time")!==!1}}const Nt=new Us;function Hs(e){return e.locationsMap}const Da={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};let Gs=class{constructor(){this.drawPhase=ue.MAP|ue.HITTEST|ue.HIGHLIGHT|ue.DEBUG}startup(){}shutdown(e){}};const xt={[te.BYTE]:1,[te.UNSIGNED_BYTE]:1,[te.SHORT]:2,[te.UNSIGNED_SHORT]:2,[te.HALF_FLOAT]:2,[te.INT]:4,[te.UNSIGNED_INT]:4,[te.FLOAT]:4};let qs=class{constructor(e,t){this._boundPart=null,this.vertexBuffers=new Map;for(const[s,o]of Object.entries(t.vertex)){const a=ti.createVertex(e,Jt.STATIC_DRAW,o);this.vertexBuffers.set(s,a)}const i=new Map;for(const[s,o]of Object.entries(t.index??{})){const a=ti.createIndex(e,Jt.STATIC_DRAW,o);i.set(s,a)}this.groups=[];for(const s of t.groups){let o;if(s.index!=null){if(!t.index?.[s.index])throw new Error("No index data.");const{BYTES_PER_ELEMENT:d}=t.index[s.index];d===2?o=te.UNSIGNED_SHORT:d===4&&(o=te.UNSIGNED_INT)}const a=s.index!=null?i.get(s.index):null,r=new Map,u=new Map;for(const d of s.attributes){const{name:p,count:m,type:f,offset:x,normalized:h,divisor:y,stride:b,vertex:g,location:P}=d;let I=u.get(g);I||(I=[],u.set(g,I));const C=new Es(p,m,f,x,b,h,y);I.push(C),r.set(p,P)}const c=new Ds(e,r,u,this.vertexBuffers,a);this.groups.push({...s,vertexArray:c,locations:r,layout:u,indexing:o})}this.parts=t.parts}bind(e,t){this._boundPart=t;const{group:i}=this.parts[this._boundPart],{vertexArray:s}=this.groups[i];e.bindVAO(s)}draw(e){if(this._boundPart==null)throw new Error("Mesh.bind() has not been called.");const{start:t,count:i}=this.parts[this._boundPart],{group:s}=this.parts[this._boundPart],{indexing:o,primitive:a}=this.groups[s];o?e.drawElements(a,i,o,t*xt[o]):e.drawArrays(a,t,i)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArray:e}of this.groups)e.dispose()}};const Ws={position:{type:te.SHORT,count:2}};let js=class gt extends qs{static create(t,i,s){const o=[];let{stride:a}=i;if(a==null){a=0;for(const[m,{count:f,type:x,offset:h}]of Object.entries(i.layout)){if(h!=null)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");a+=f*xt[x]}}let r=0;for(const[m,{count:f,offset:x,type:h,normalized:y}]of Object.entries(i.layout)){x!=null&&(r=x);const b=s.get(m);if(b==null)throw new Error("Locations must be specified at mesh initialization.");const g={name:m,location:b,vertex:"vertexData",count:f,type:h,offset:r,stride:a,divisor:0,normalized:y!=null&&y};o.push(g),r+=f*xt[h]}const u={attributes:o,primitive:i.primitive};i.index!=null&&(u.index="indexData");let{count:c}=i;if(c==null&&(c=i.index?i.index.length:i.vertex.byteLength/a,Math.floor(c)!==c))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${a}.`);const d={start:0,count:c,group:0,primitive:i.primitive},p={vertex:{vertexData:i.vertex},parts:[d],groups:[u]};return i.index!=null&&(p.index={indexData:i.index}),new gt(t,p,i.layout)}static fromVertexStream(t,i){return gt.create(t,{primitive:Vi.TRIANGLE_STRIP,vertex:new Uint16Array(i),layout:Ws},new Map([["position",0]]))}constructor(t,i,s){super(t,i),this._spec=s}bind(t,i=0){super.bind(t,i)}},he=class extends fe{};l([V(n)],he.prototype,"globalTime",void 0),l([V(v)],he.prototype,"animationTextureSize",void 0),l([V(j)],he.prototype,"animationTexture",void 0),l([V(B)],he.prototype,"toScreen",void 0),l([V(B)],he.prototype,"toNdc",void 0),l([V(n)],he.prototype,"mapRotation",void 0),l([V(n)],he.prototype,"pixelRatio",void 0);let nt=class extends fe{getVVRotationMat4(e){return Y(Ut(e),Je.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new Je(s,i,0,0,i.multiply(new n(-1)),s,0,0,0,0,1,0,0,0,0,1)})}getVVRotationMat3(e){return Y(Ut(e),B.identity(),()=>{const t=this.getNormalizedAngle(e).multiply(jt),i=Be(t),s=Ne(t);return new B(s,i,0,i.multiply(new n(-1)),s,0,0,0,1)})}getNormalizedAngle(e){const t=me(this.rotationType,new n(mt.Arithmatic));return Y(t,new n(90).subtract(e),e)}};l([V(n)],nt.prototype,"rotationType",void 0);class wt extends He{}l([w(3,S)],wt.prototype,"animationPointerAndBaseSizeAndReferenceSize",void 0),l([w(4,v)],wt.prototype,"zoomRange",void 0);class Ks extends Oe{}class re extends Ge{_getScreenPosition(t){const{pos:i,translation:s,rotation:o,scale:a,offset:r,id:u,vvScale:c}=t,d=Gi(this,u).multiply(Math.PI/180),p=s.x.multiply(4/3),m=s.y.multiply(-1).multiply(4/3),f=Be(o.subtract(d)),x=Ne(o.subtract(d)),h=new n(0),y=new n(1),{pixelRatio:b}=this.animationInfo,g=new B(y,h,h,h,y,h,p.multiply(b),m.multiply(b),y),P=new B(x,f.multiply(-1),h,f,x,h,0,0,y),I=a.multiply(c).multiply(b).multiply(4/3),C=P.multiply(I),_=this.animationInfo.toScreen.multiply(new A(i,1)),T=g.multiply(_).xy,M=C.multiply(new A(r,0)).xy;return T.add(M)}_clip(t,i){let s=super.clip(t,i);const o=qi(this._getLocalTimeOrigin(t),new n(0));return Nt.forceGlobalTimeOrigin||(s=s.add(Mt([o,()=>new n(2)],[!0,()=>new n(0)]))),s}_getLocalTimeOrigin(t){return this.storage.getLocalTimeOrigin(t)}_toNdc(t){return this.animationInfo.toNdc.multiply(new A(t,1)).xy}_getEvalParams(t,i){const{globalTime:s,animationTextureSize:o,animationTexture:a}=this.animationInfo;return{globalTime:s,localTimeOrigin:this._getLocalTimeOrigin(t.id),animationTextureSize:o,animationTexture:a,pixelDimensions:i}}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a),u=i.outlineSize.multiply(.5),c=At(o).subtract(u),d=$e(new n(.5).subtract(c),new n(0),new n(1)),p=i.outlineColor.multiply(d);return new n(1).subtract(p.a).multiply(r).add(p)}}function Ve(e,t,i){const s=e.add(new v(t,0)),o=Q(i.animationTexture,s.add(.5).divide(i.animationTextureSize)).xy;return e=e.add(o),ls({animationPointer:e,...i},S,null,a=>{const{out:r}=a;if(!r)throw new Error("out is null");return us({...a,out:r})})}l([V(at)],re.prototype,"mosaicInfo",void 0),l([V(he)],re.prototype,"animationInfo",void 0),l([O(It)],re.prototype,"visualVariableColor",void 0),l([O(Ot)],re.prototype,"visualVariableOpacity",void 0),l([O(Ft)],re.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],re.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],re.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],re.prototype,"visualVariableSizeUnitValue",void 0),l([O(nt)],re.prototype,"visualVariableRotation",void 0);var ve;(function(e){e[e.transform=0]="transform",e[e.fromColor=1]="fromColor",e[e.toColor=2]="toColor",e[e.colorMix=3]="colorMix",e[e.toOpacity=4]="toOpacity",e[e.opacityMix=5]="opacityMix"})(ve||(ve={}));let De=class extends wt{};l([w(5,v)],De.prototype,"offset",void 0),l([w(6,v)],De.prototype,"uv",void 0),l([w(7,S)],De.prototype,"sizing",void 0),l([w(8,n)],De.prototype,"angle",void 0);class Ee extends Ct{}l([w(12,v)],Ee.prototype,"offsetNextVertex1",void 0),l([w(13,v)],Ee.prototype,"offsetNextVertex2",void 0),l([w(14,v)],Ee.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],Ee.prototype,"textureUVNextVertex2",void 0);class Xs extends Ks{}function ce(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}let St=class extends re{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],uv:["textureUVNextVertex1","textureUVNextVertex2"]}}_vertexPreamble(e){const{id:t,pos:i,offset:s,animationPointerAndBaseSizeAndReferenceSize:o,uv:a,sizing:r,angle:u}=e,c=o.xy,d=o.z,p=o.w,m=r.xy,f=r.z,x=Z(e.bitset,le.bitset.isStroke),h=r.w,y=Z(e.bitset,le.bitset.scaleSymbolsProportionally),b=this._getEvalParams(e,m),g=Ve(c,ve.transform,b),P=Mt([me(Z(e.bitset,le.bitset.isMapAligned),new n(1)),this.view.rotation.divide(180).multiply(Math.PI)],[!0,new n(0)]),I=new Wi(Ne(P),Be(P.multiply(-1)),Be(P),Ne(P)).multiply(g.xy),C=g.z.subtract(P).subtract(u.multiply(li)),_=g.w,T=Z(e.bitset,le.bitset.isSDF),M=et(this,t,new n(p)).divide(new n(p));return{baseSize:d,animationPointer:c,strokeWidth:f,isOutline:x,unscaledDistanceToPx:h,scaleSymbolsProportionally:y,isSDF:T,position:this._getScreenPosition({id:t,pos:i,offset:s,referenceSize:p,translation:I,rotation:C,scale:_,vvScale:M}),uv:a,evalParams:b,vvScale:M,scale:_}}vertex(e,t){const{position:i,animationPointer:s,evalParams:o,isOutline:a,unscaledDistanceToPx:r,vvScale:u,uv:c,strokeWidth:d,scaleSymbolsProportionally:p,scale:m,isSDF:f,baseSize:x}=this._vertexPreamble(e),h=this._toNdc(i);let y=Ve(s,ve.fromColor,o);y=new S(y.rgb.multiply(y.a),y.a);let b=Ve(s,ve.toColor,o);b=new S(b.rgb.multiply(b.a),b.a);let g=Ve(s,ve.colorMix,o);g=new S(g.rgb.multiply(g.a),g.a);const P=Ve(s,ve.toOpacity,o).a,I=Ve(s,ve.opacityMix,o).a,C=ui(this,e.id,y,ci(pi(e.bitset,le.bitset.colorLocked),new ft(a))),_=Re(C,b,g),T=di(this,e.id),M=Re(T,P,I),z=_.multiply(M),R=this.clip(e.id,e.zoomRange),Se=r.multiply(u);return{glPosition:new S(h,R,1),uv:c.divide(this.mosaicInfo.size),color:z.multiply(new n(1).subtract(a)),outlineColor:z.multiply(a),distanceToPx:Se,strokeWidth:d.multiply(Re(new n(1),m,p)),isOutline:a,isSDF:f,...this.maybeRunHittest(e,t,{pos:e.pos,size:x,sizeCorrection:new n(1),isMapAligned:new n(1),vvRotationMat3:new B(1,0,0,0,1,0,0,0,1),placementMat3:new B(1,0,0,0,1,0,0,0,1),outlineSize:new n(1),distanceToPx:Se,isSDF:f})}}fragment(e){let t=this._getColor(e.uv,{color:e.color,distanceToPx:e.distanceToPx,isSDF:e.isSDF,outlineColor:e.outlineColor,outlineSize:e.strokeWidth});return Nt.spotlightAnimatedSymbols&&(t=t.add(new S(0,.3,0,.3))),this.getFragmentOutput(t,e)}hittest(e,t,i){return Y(mi(i.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,i),this._hittestMarker(e,t,i))}_hittestSmallMarker(e,t,i){const{position:s,distance:o,smallSymbolDistance:a}=this.hittestRequest,r=o.subtract(a),{viewMat3:u,tileMat3:c}=this.view,d=u.multiply(c).multiply(new A(i.pos,1)).xy,p=i.size.multiply(.5);return fi(d,s).subtract(p).add(r)}_hittestMarker(e,t,i){const s=this._vertexPreamble({...e}).position,o=this._vertexPreamble({...e,offset:t.offsetNextVertex1,uv:t.textureUVNextVertex1}).position,a=this._vertexPreamble({...e,offset:t.offsetNextVertex2,uv:t.textureUVNextVertex2}).position,r=this.hittestRequest.position,u=this.hittestRequest.distance,c=Rt(r,s,o,a);return Y(Ie(c,u),c,this._hittestSamples(s,o,a,e,t,i))}_hittestSamples(e,t,i,s,o,a){const{outlineSize:r,isSDF:u,distanceToPx:c}=a,d=this.hittestRequest.position,p=this.hittestRequest.distance,m=E(d.add(new v(ie(p),ie(p))),e,t,i),f=E(d.add(new v(0,ie(p))),e,t,i),x=E(d.add(new v(p,ie(p))),e,t,i),h=E(d.add(new v(ie(p),0)),e,t,i),y=E(d,e,t,i),b=E(d.add(new v(p,0)),e,t,i),g=E(d.add(new v(ie(p),p)),e,t,i),P=E(d.add(new v(0,p)),e,t,i),I=E(d.add(new v(p,p)),e,t,i),C=s.uv.divide(this.mosaicInfo.size),_=o.textureUVNextVertex1.divide(this.mosaicInfo.size),T=o.textureUVNextVertex2.divide(this.mosaicInfo.size),M={color:new S(1,1,1,1),outlineSize:r,outlineColor:new S(1,1,1,1),isSDF:u,distanceToPx:c};let z=new n(0);return z=z.add(L(m).multiply(this._getColor(ce(m,C,_,T),M).a)),z=z.add(L(f).multiply(this._getColor(ce(f,C,_,T),M).a)),z=z.add(L(x).multiply(this._getColor(ce(x,C,_,T),M).a)),z=z.add(L(h).multiply(this._getColor(ce(h,C,_,T),M).a)),z=z.add(L(y).multiply(this._getColor(ce(y,C,_,T),M).a)),z=z.add(L(b).multiply(this._getColor(ce(b,C,_,T),M).a)),z=z.add(L(g).multiply(this._getColor(ce(g,C,_,T),M).a)),z=z.add(L(P).multiply(this._getColor(ce(P,C,_,T),M).a)),z=z.add(L(I).multiply(this._getColor(ce(I,C,_,T),M).a)),K(z,new n(.05)).multiply(ot(this.hittestRequest))}};l([D(0,F(De)),D(1,F(Ee))],St.prototype,"vertex",null),l([D(0,F(Xs))],St.prototype,"fragment",null);let q=class extends Gs{constructor(){super(...arguments),this.symbologyPlane=we.FILL,this._input=null}},Zs=class extends q{render(e,t){const{context:i,painter:s}=e,{target:o}=t,{freezeGlobalTime:a}=Nt,r=0,u=s.textureManager.animationStore.getTexture(i,r),c=[2/e.state.size[0],0,0,0,-2/e.state.size[1],0,-1,1,1],d=Array.from(Ms(Zt(),c)),p=Array.from(Ps(Zt(),d,o.transforms.displayViewScreenMat3)),m=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,m.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0),animationInfo:{globalTime:a===!1?e.time/1e3:a,animationTextureSize:[u.descriptor.width,u.descriptor.height],animationTexture:{unit:6,texture:u},toScreen:p,toNdc:c,mapRotation:e.state.rotation,pixelRatio:e.state.pixelRatio}},defines:{...N(e)},optionalAttributes:{zoomRange:!0},useComputeBuffer:!0}),s.setPipelineState({...H(e)}),s.submitDraw(e,t),a===!1&&o.requestRender()}},Ys=class extends Zs{constructor(){super(...arguments),this.type=G.AnimatedMarker,this.shaders={geometry:new St}}},Pi=class extends hi{};l([w(0,v)],Pi.prototype,"pos",void 0);let Qs=class extends Oe{};class Ai extends fe{}l([V(n)],Ai.prototype,"dotSize",void 0);let Xe=class extends fe{};l([V(j)],Xe.prototype,"locations",void 0),l([V(n)],Xe.prototype,"pixelRatio",void 0),l([V(n)],Xe.prototype,"tileZoomFactor",void 0);const Js=1e-6;class _e extends yi{vertex(t){const i=new B(1,0,0,0,-1,0,0,1,1).multiply(new A(t.pos.xy.divide(X),1)),s=Q(this.draw.locations,i.xy),o=xe(this.instance.dotSize.divide(2),new n(1));let a=new n(0);a=a.add(K(s.a,new n(Js)).multiply(2));let r=o.add(this.instance.dotSize);const u=this.view.displayViewScreenMat3.multiply(new A(t.pos.add(.5),1)),c=new S(u.xy,a,1),d=this.instance.dotSize.divide(r),p=new n(-1).divide(o.divide(r));return r=r.multiply(this.draw.pixelRatio.multiply(this.draw.tileZoomFactor)),{glPosition:c,glPointSize:r,color:s,ratio:d,invEdgeRatio:p}}fragment(t){const i=vi(t.glPointCoord.subtract(.5)).multiply(2),s=bi(new n(0),new n(1),t.invEdgeRatio.multiply(i.subtract(t.ratio)).add(1)),o=new kt;return o.glFragColor=t.color.multiply(s),o}}l([V(Ai)],_e.prototype,"instance",void 0),l([V(Xe)],_e.prototype,"draw",void 0),l([V(cs)],_e.prototype,"view",void 0),l([D(0,F(Pi))],_e.prototype,"vertex",null),l([D(0,F(Qs))],_e.prototype,"fragment",null);class Ci extends He{}l([w(3,n)],Ci.prototype,"inverseArea",void 0);let Ze=class extends fe{};l([V(ne.ofType(S,2))],Ze.prototype,"isActive",void 0),l([V(ne.ofType(S,8))],Ze.prototype,"colors",void 0),l([V(n)],Ze.prototype,"dotValue",void 0);let Te=class extends fe{};l([V(j)],Te.prototype,"dotTexture0",void 0),l([V(j)],Te.prototype,"dotTexture1",void 0),l([V(n)],Te.prototype,"tileZoomFactor",void 0),l([V(n)],Te.prototype,"pixelRatio",void 0),l([V(n)],Te.prototype,"tileDotsOverArea",void 0);let Me=class extends Ge{_dotThreshold(e,t,i){return e.divide(t).divide(i)}vertex(e){const t=new B(2/X,0,0,0,-2/X,0,-1,1,1).multiply(new A(e.pos,1)),i=this.clip(e.id),s=new S(t.xy,i,1),o=this.storage.getVVData(e.id).multiply(this.instance.isActive.get(0)).multiply(e.inverseArea),a=this.storage.getDataDrivenData0(e.id).multiply(this.instance.isActive.get(1)).multiply(e.inverseArea),r=this.draw.tileZoomFactor.multiply(X).divide(this.draw.pixelRatio),u=this._dotThreshold(o,this.instance.dotValue,this.draw.tileDotsOverArea),c=this._dotThreshold(a,this.instance.dotValue,this.draw.tileDotsOverArea),d=e.pos.add(.5).divide(r);return{glPosition:s,color:new S(0,0,0,0),textureCoords:d,thresholds0:u,thresholds1:c}}fragment(e){const t=new kt,i=Q(this.draw.dotTexture0,e.textureCoords),s=Q(this.draw.dotTexture1,e.textureCoords),o=e.thresholds0.subtract(i),a=e.thresholds1.subtract(s);let r;const u=Je.fromColumns(this.instance.colors[0],this.instance.colors[1],this.instance.colors[2],this.instance.colors[3]),c=Je.fromColumns(this.instance.colors[4],this.instance.colors[5],this.instance.colors[6],this.instance.colors[7]);if(this.blending){const d=K(new n(0),o),p=K(new n(0),a),m=ht(d,o).add(ht(p,a)),f=K(m,new n(0)),x=new n(1).subtract(f),h=m.add(f),y=o.multiply(d).divide(h),b=a.multiply(p).divide(h),g=u.multiply(y).add(c.multiply(b));r=x.multiply(g)}else{const d=xe(Ht(o),Ht(a)),p=K(d,new n(0)),m=new n(1).subtract(p),f=K(d,o),x=K(d,a),h=u.multiply(f).add(c.multiply(x));r=m.multiply(h)}return t.glFragColor=r,t}hittest(e){return ot(this.hittestRequest)}};l([Ce],Me.prototype,"blending",void 0),l([V(Ze)],Me.prototype,"instance",void 0),l([V(Te)],Me.prototype,"draw",void 0),l([D(0,F(Ci))],Me.prototype,"vertex",null),l([D(0,F(Oe))],Me.prototype,"fragment",null);const eo={pos:{count:2,type:te.UNSIGNED_SHORT}};let to=class{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(e){if(this._dotFBO==null){const t=X,i=X,s=new tt(t,i);s.samplingMode=ge.NEAREST,s.wrapMode=bt.CLAMP_TO_EDGE;const o=new Ls(e,new _i(zi.DEPTH_STENCIL,t,i));this._dotFBO=new Ti(e,s,o)}return this._dotFBO}getDotDensityMesh(e,t){if(this._dotMesh==null){const i=X,s=i*i,o=2,a=new Int16Array(s*o);for(let r=0;rSi.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.heatmap.HeatmapResources");let po=class{destroy(){this._accumulateFramebuffer=Kt(this._accumulateFramebuffer),this._resolveGradientTexture=Kt(this._resolveGradientTexture),this._prevGradientHash=null,this._qualityProfile=null}get initialized(){return this._accumulateFramebuffer!=null&&this._resolveGradientTexture!=null}get accumulateFramebuffer(){return this._accumulateFramebuffer}get resolveGradientTexture(){return this._resolveGradientTexture}loadQualityProfile(e){if(this._qualityProfile==null){const t=uo(e,co());this._qualityProfile={...t,defines:{usesHalfFloatPrecision:t.dataType!==Ue.FLOAT}}}return this._qualityProfile}ensureAccumulateFBO(e,t,i){if(this._accumulateFramebuffer==null){const{dataType:s,samplingMode:o,pixelFormat:a,internalFormat:r}=this.loadQualityProfile(e),u=new tt(t,i);u.pixelFormat=a,u.internalFormat=r,u.dataType=s,u.samplingMode=o,u.wrapMode=bt.CLAMP_TO_EDGE;const c=new _i(zi.DEPTH_STENCIL,t,i);this._accumulateFramebuffer=new Ti(e,u,c)}else{const{width:s,height:o}=this._accumulateFramebuffer;s===t&&o===i||this._accumulateFramebuffer.resize(t,i)}return this._accumulateFramebuffer}ensureResolveGradientTexture(e,t,i){if(this._resolveGradientTexture==null){const s=new tt;s.wrapMode=bt.CLAMP_TO_EDGE,this._resolveGradientTexture=new Mi(e,s)}else this._prevGradientHash!==t&&(this._resolveGradientTexture.resize(i.length/4,1),this._resolveGradientTexture.setData(i),this._prevGradientHash=t);return this._resolveGradientTexture}};function Ri(e){return e?.25:1}let Ii=class extends He{};l([w(5,v)],Ii.prototype,"offset",void 0);let mo=class extends Oe{},zt=class extends fe{};l([V(n)],zt.prototype,"radius",void 0),l([V(n)],zt.prototype,"isFieldActive",void 0);class Le extends Ge{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(t){const{radius:i,isFieldActive:s}=this.kernelControls,o=t.offset,a=s.multiply(this.storage.getVVData(t.id).x).add(new n(1).subtract(s)),r=this.view.displayViewScreenMat3.multiply(new A(t.pos,1)).add(this.view.displayViewMat3.multiply(new A(o,0)).multiply(i)),u=this.clip(t.id);return{glPosition:new S(r.xy,u,1),offset:o,fieldValue:a,color:new S(0),...this.maybeRunHittest(t,{},null)}}fragment(t){const{offset:i,fieldValue:s}=t,o=vi(i),a=K(o,new n(1)),r=new n(1).subtract(o.multiply(o)),u=r.multiply(r),c=a.multiply(u).multiply(s).multiply(new n(Ri(this.usesHalfFloatPrecision)));return this.getFragmentOutput(new S(c),t)}hittest(t){const{viewMat3:i,tileMat3:s}=this.view,o=i.multiply(s).multiply(new A(t.pos,1));return Qi(o.xy,this.kernelControls.radius,this.hittestRequest.position)}}l([Ce],Le.prototype,"usesHalfFloatPrecision",void 0),l([V(zt)],Le.prototype,"kernelControls",void 0),l([D(0,F(Ii))],Le.prototype,"vertex",null),l([D(0,F(mo))],Le.prototype,"fragment",null);let Oi=class extends hi{};l([w(0,v)],Oi.prototype,"position",void 0);let fo=class extends bs{},Ye=class extends fe{};l([V(j)],Ye.prototype,"texture",void 0),l([V(v)],Ye.prototype,"minAndInvRange",void 0),l([V(n)],Ye.prototype,"normalization",void 0);let Fi=class extends fe{};l([V(j)],Fi.prototype,"texture",void 0);let Pe=class extends yi{constructor(){super(...arguments),this.usesHalfFloatPrecision=!1}vertex(e){return{glPosition:new S(e.position.multiply(2).subtract(1),1,1),uv:e.position}}fragment(e){const{accumulatedDensity:t,gradient:i}=this;let s=Q(t.texture,e.uv).r.divide(new n(Ri(this.usesHalfFloatPrecision)));s=s.multiply(t.normalization),s=s.subtract(t.minAndInvRange.x).multiply(t.minAndInvRange.y);const o=Q(i.texture,new v(s,.5)),a=new kt;return a.glFragColor=new S(o.rgb.multiply(o.a),o.a),a}};l([Ce],Pe.prototype,"usesHalfFloatPrecision",void 0),l([V(Ye)],Pe.prototype,"accumulatedDensity",void 0),l([V(Fi)],Pe.prototype,"gradient",void 0),l([D(0,F(Oi))],Pe.prototype,"vertex",null),l([D(0,F(fo))],Pe.prototype,"fragment",null);let ho=class extends q{constructor(){super(...arguments),this.type=G.Heatmap,this.drawPhase=ue.MAP|ue.HITTEST|ue.DEBUG,this.shaders={accumulate:new Le,resolve:new Pe},this._isBound=!1,this._resources=new Map}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e),this._prevFBO=null,this._unbind()}render(e,t){const{context:i,painter:s,state:o}=e,a=t.instance.getInput(),{isFieldActive:r}=a.uniforms,u=this._getOrCreateResourcesRecord(i),c=u.loadQualityProfile(i);k(e)||this._bind(e,u,a),s.setShader({shader:this.shaders.accumulate,uniforms:{...$(e,t.target),kernelControls:{radius:si(a,o),isFieldActive:r?1:0}},defines:{...N(e),...c.defines},optionalAttributes:{},useComputeBuffer:k(e)});const d=k(e)?vo:Ei;s.setPipelineState(d),s.submitDraw(e,t)}getStencilReference(e){return Di(e)}renderResolvePass(e,t){if(k(e))return;const{context:i,painter:s}=e,o=this._resources.get(i);if(this._prevFBO==null||this._prevViewport==null||!o?.initialized)return;const{defines:a}=o.loadQualityProfile(i),{minDensity:r,maxDensity:u,radius:c}=t.getInput().uniforms,d=8,p=9,m=o.accumulateFramebuffer,f=o.resolveGradientTexture,x={shader:this.shaders.resolve,uniforms:{accumulatedDensity:{texture:{unit:d,texture:m.colorTexture},minAndInvRange:[r,1/(u-r)],normalization:3/(c*c*Math.PI)},gradient:{texture:{unit:p,texture:f}}},defines:a,optionalAttributes:{},useComputeBuffer:!1};i.bindFramebuffer(this._prevFBO),i.setViewport(0,0,this._prevViewport.width,this._prevViewport.height),i.bindTexture(m.colorTexture,d),i.bindTexture(f,p),s.setPipelineState(bo),s.submitDrawMesh(i,x,s.quadMesh),this._unbind()}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return t==null&&(t=new po,this._resources.set(e,t)),t}_unbind(){this._prevFBO=null,this._prevViewport=null,this._isBound=!1}_bind(e,t,i){if(this._isBound)return;const{context:s,state:o,pixelRatio:a}=e,r=s.getBoundFramebufferObject(),u=s.getViewport();this._prevFBO=r,this._prevViewport=u;const{gradient:c,gradientHash:d}=i.uniforms;t.ensureResolveGradientTexture(s,d,c);const{width:p,height:m}=u,f=yo(si(i,o),a),x=p*f,h=m*f,y=t.ensureAccumulateFBO(s,x,h);s.blitFramebuffer(r,y,0,0,r.width,r.height,0,0,y.width,y.height,vt.STENCIL,ge.NEAREST),s.bindFramebuffer(y),s.setViewport(0,0,y.width,y.height),s.setColorMask(!0,!0,!0,!0),s.setClearColor(0,0,0,0),s.clear(vt.COLOR),this._isBound=!0}};function yo(e,t){const i=t>1.5?.25:.5;return e<1/(2*i)?1:i}function Di(e){return e.key.level+1}const Ei={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:{write:!1,test:{ref:Di,compare:Fs.GEQUAL,mask:255,op:{fail:ct.KEEP,zFail:ct.KEEP,zPass:ct.REPLACE}}}},vo={...Ei,stencil:!1},bo={color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1};function si(e,t){const{referenceScale:i,radius:s}=e.uniforms;return s*(i!==0?i/t.scale:1)}const xo=360/254;var W;(function(e){e[e.Color=0]="Color",e[e.Outline=1]="Outline",e[e.Halo=2]="Halo"})(W||(W={}));let ee=class extends He{};l([w(3,S)],ee.prototype,"color",void 0),l([w(4,v)],ee.prototype,"offset",void 0),l([w(5,v)],ee.prototype,"textureUV",void 0),l([w(6,n)],ee.prototype,"fontSize",void 0),l([w(7,n)],ee.prototype,"referenceSize",void 0),l([w(8,S)],ee.prototype,"outlineColor",void 0),l([w(9,S)],ee.prototype,"haloColor",void 0),l([w(10,v)],ee.prototype,"outlineAndHaloSize",void 0),l([w(11,v)],ee.prototype,"zoomRange",void 0),l([w(12,n)],ee.prototype,"clipAngle",void 0),l([w(13,S)],ee.prototype,"referenceSymbol",void 0);let _t=class extends Ct{};l([w(14,v)],_t.prototype,"offsetNextVertex1",void 0),l([w(15,v)],_t.prototype,"offsetNextVertex2",void 0);let go=class extends Oe{},U=class extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"]},this.textRenderPassType=W.Color,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t,i){const s=t.multiply(xo),o=At(this.view.rotation.subtract(s)),a=yt(new n(360).subtract(o),o);let r=new n(0);const u=Ji(this.view.currentZoom.multiply(Qt)).divide(Qt),c=e.x,d=e.y,p=new n(1).subtract(K(c,u)).multiply(2),m=K(new n(90),a).multiply(2),f=new n(2).multiply(new n(1).subtract(K(u,d)));return r=r.add(i.multiply(p)),r=r.add(i.multiply(m)),r=r.add(f),r}vertex(e,t){const i=Z(e.bitset,ps),s=new n(1).subtract(i);let o=e.fontSize,a=o.divide(Gt);const r=this.textRenderPassType===W.Outline?e.outlineColor:this.textRenderPassType===W.Halo?e.haloColor:this._getVertexColor(e),u=this.isLabel?this.storage.getLabelVisibility(e.id):new n(1),c=this.isLabel?r.multiply(u):r,d=this.view.displayViewScreenMat3.multiply(new A(e.pos,1));let p=e.offset,m=new n(1),f=B.identity(),x=new v(0);if(this.isLabel){if(!e.referenceSymbol)throw new Error("InternalError: Optional attribute 'referenceSymbol' expected for labels");const _=e.referenceSymbol,T=_.xy,M=_.z,z=this._unpackDirection(_.w),R=et(this,e.id,M).divide(2),Se=z.multiply(R.add(Is));x=T.add(Se),p=p.add(x)}else m=et(this,e.id,e.referenceSize).divide(e.referenceSize),o=o.multiply(m),a=a.multiply(m),p=p.multiply(m),f=gi(this,e.id),p=f.multiply(new A(p,0)).xy;const h=Z(e.bitset,ds),y=this._getViewRotationMatrix(h).multiply(new A(p,0));let b=this.isLabel?this.clipLabel(e.zoomRange,e.clipAngle,h):this.clip(e.id,e.zoomRange);b=this.isBackgroundPass?b.add(s.multiply(2)):b.add(i.multiply(2));const g=this.isLabel?ci(Ie(b,new n(1)),me(u,new n(0))):new ft(!1),P=new S(d.xy.add(y.xy),b,1),I=e.textureUV.divide(this.mosaicInfo.size);let C=new n(0);if(this.textRenderPassType===W.Outline&&(me(e.outlineAndHaloSize.x,new n(0))&&(b=b.add(new n(2))),C=new n(e.outlineAndHaloSize.x).divide(a).divide(qt)),this.textRenderPassType===W.Halo){const _=e.outlineAndHaloSize.x,T=new n(e.outlineAndHaloSize.y);me(T,new n(0))&&(b=b.add(new n(2))),C=T.add(_).divide(a).divide(qt)}return{glPosition:P,color:c,size:a,textureUV:I,antialiasingWidth:new n(.105*Gt).divide(o).divide(this.view.pixelRatio),outlineDistanceOffset:C,...this.maybeRunHittest(e,t,{vvSizeAdjustment:m,vvRotation:f,labelOffset:x,labelClipped:g})}}_getViewRotationMatrix(e){const t=this.view.displayViewMat3,i=this.view.displayMat3,s=new n(1).subtract(e);return t.multiply(e).add(i.multiply(s))}fragment(e){const t=new n(.25),i=new n(1).subtract(t),s=Q(this.mosaicInfo.texture,e.textureUV).a;let o=i.subtract(e.outlineDistanceOffset);this.highlight&&(o=o.divide(2));const a=e.antialiasingWidth,r=bi(o.subtract(a),o.add(a),s);return this.getFragmentOutput(e.color.multiply(r),e)}hittest(e,t,{vvSizeAdjustment:i,vvRotation:s,labelOffset:o,labelClipped:a}){let r,u,c;this.isLabel?(r=new A(e.offset.add(o),0),u=new A(t.offsetNextVertex1.add(o),0),c=new A(t.offsetNextVertex2.add(o),0)):(r=s.multiply(new A(e.offset.multiply(i),0)),u=s.multiply(new A(t.offsetNextVertex1.multiply(i),0)),c=s.multiply(new A(t.offsetNextVertex2.multiply(i),0)));const{viewMat3:d,tileMat3:p}=this.view,m=d.multiply(p).multiply(new A(e.pos,1)),f=m.add(p.multiply(r)).xy,x=m.add(p.multiply(u)).xy,h=m.add(p.multiply(c)).xy,y=Rt(this.hittestRequest.position,f.xy,x.xy,h.xy);return this.isLabel?Y(a,ot(this.hittestRequest),y):y}_unpackDirection(e){const t=new ut(e),i=es(t,new ut(2)),s=ts(t,new ut(3));return new v(new n(i).subtract(1),new n(s).subtract(1))}_getVertexColor(e){let t=e.color;if(this.visualVariableColor){const i=this.storage.getColorValue(e.id);t=this.visualVariableColor.getColor(i,e.color,new ft(!1))}if(this.visualVariableOpacity){const i=this.storage.getOpacityValue(e.id),s=this.visualVariableOpacity.getOpacity(i);t=t.multiply(s)}return t}};l([O(It)],U.prototype,"visualVariableColor",void 0),l([O(Ot)],U.prototype,"visualVariableOpacity",void 0),l([O(nt)],U.prototype,"visualVariableRotation",void 0),l([O(Ft)],U.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],U.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],U.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],U.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],U.prototype,"mosaicInfo",void 0),l([Ce],U.prototype,"textRenderPassType",void 0),l([Ce],U.prototype,"isBackgroundPass",void 0),l([Ce],U.prototype,"isLabel",void 0),l([D(0,F(ee)),D(1,F(_t))],U.prototype,"vertex",null),l([D(0,F(go))],U.prototype,"fragment",null);let wo=class extends q{constructor(){super(...arguments),this.type=G.Label,this.shaders={geometry:new U},this.drawPhase=ue.LABEL|ue.LABEL_ALPHA|ue.HITTEST,this.symbologyPlane=we.TEXT}render(e,t){const{context:i,painter:s}=e,o=N(e),a={...H(e)},r=t.instance.getInput(),u={shader:this.shaders.geometry,uniforms:{...J(e,t.target,r.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!0,isLabel:!0},optionalAttributes:r.optionalAttributes,useComputeBuffer:k(e)};s.setShader(u),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Halo,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t),s.setShader({...u,defines:{...o,textRenderPassType:W.Color,isBackgroundPass:!1,isLabel:!0}}),s.setPipelineState(a),s.submitDraw(e,t)}},So=class extends q{constructor(){super(...arguments),this.type=G.Line,this.shaders={geometry:new wi},this.symbologyPlane=we.LINE}render(e,t){const{painter:i,pixelRatio:s}=e,o=t.instance.getInput();i.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),antialiasingControls:qe(s)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),i.setPipelineState(H(e)),i.submitDraw(e,t)}};class Ae extends is{}l([w(9,n)],Ae.prototype,"accumulatedDistance",void 0),l([w(10,v)],Ae.prototype,"segmentDirection",void 0),l([w(11,n)],Ae.prototype,"offsetAlongLine",void 0),l([w(12,n)],Ae.prototype,"capType",void 0),l([w(13,S)],Ae.prototype,"tlbr",void 0);class Tt extends wi{_getDistanceRatio(t,i){const s=Z(t.bitset,ms);return s.multiply(xe(i,new n(.25)).multiply(new n(2))).add(new n(1).subtract(s).multiply(be(1)))}_getSDFAlpha(t){const{halfWidth:i,normal:s,tlbr:o,patternSize:a,accumulatedDistance:r,offsetAlongLine:u,dashToPx:c,capType:d}=t,p=a.x.divide(ks).multiply(c),m=Wt(r.add(u).divide(p)),f=Re(o.xy,o.zw,new v(m,.5)),x=Pt(Q(this.mosaicInfo.texture,f)).multiply(2).subtract(1).multiply(Bs).multiply(c),h=s.y.multiply(i),y=Mt([me(d,new n(1)),x.subtract(i)],[me(d,new n(2)),ss(os(xe(x,new n(0)),new n(2)).add(h.multiply(h))).subtract(i)],[!0,x]),b=$e(new n(.25).subtract(y),new n(0),new n(1));return new S(b)}_getPatternColor(t){const{halfWidth:i,normal:s,color:o,accumulatedDistance:a,patternSize:r,sampleAlphaOnly:u,tlbr:c}=t,d=r.y.multiply(new n(2).multiply(i).divide(r.x)),p=Wt(a.divide(d)),m=new n(.5).multiply(s.y).add(new n(.5)),f=Re(c.xy,c.zw,new v(m,p));let x=Q(this.mosaicInfo.texture,f);return this.visualVariableColor!=null&&(x=Y(Ie(u,new n(.5)),new S(o.a),o)),x}vertex(t,i){const{segmentDirection:s,tlbr:o,bitset:a}=t,r=as(this,t),u=t.accumulatedDistance.divide(this.view.displayZoomFactor).add(ht(s,r.scaledOffset)),c=new v(o.z.subtract(o.x),o.w.subtract(o.y)),d=o.divide(this.mosaicInfo.size.xyxy),p=Z(a,fs),m=Z(a,hs),f=Y(Ie(p,new n(.5)),this._getDistanceRatio(t,r.scaledHalfWidth),new n(1));return{...r,tlbr:d,patternSize:c,accumulatedDistance:u,isSDF:p,sampleAlphaOnly:m,dashToPx:f,offsetAlongLine:t.offsetAlongLine,capType:t.capType,...this.maybeRunHittest(t,i,r.halfWidth)}}fragment(t){const{color:i,opacity:s,isSDF:o}=t,a=rs(t,this.antialiasingControls.blur),r=Y(Ie(o,new n(.5)),this._getSDFAlpha(t),this._getPatternColor(t)),u=i.multiply(s).multiply(a).multiply(r);return this.getFragmentOutput(u,t)}}l([V(at)],Tt.prototype,"mosaicInfo",void 0),l([D(0,F(Ae)),D(1,F(ys))],Tt.prototype,"vertex",null);let Vo=class extends q{constructor(){super(...arguments),this.type=G.TexturedLine,this.shaders={geometry:new Tt},this.symbologyPlane=we.LINE}render(e,t){const{context:i,painter:s,pixelRatio:o}=e,a=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,a.uniforms),...$(e,t.target),antialiasingControls:qe(o),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...N(e)},optionalAttributes:a.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}};class de extends He{}l([w(3,S)],de.prototype,"color",void 0),l([w(4,S)],de.prototype,"outlineColor",void 0),l([w(5,v)],de.prototype,"offset",void 0),l([w(6,v)],de.prototype,"textureUV",void 0),l([w(7,S)],de.prototype,"sizing",void 0),l([w(8,n)],de.prototype,"placementAngle",void 0),l([w(9,n)],de.prototype,"sdfDecodeCoeff",void 0),l([w(10,v)],de.prototype,"zoomRange",void 0);class ke extends Ct{}l([w(12,v)],ke.prototype,"offsetNextVertex1",void 0),l([w(13,v)],ke.prototype,"offsetNextVertex2",void 0),l([w(14,v)],ke.prototype,"textureUVNextVertex1",void 0),l([w(15,v)],ke.prototype,"textureUVNextVertex2",void 0);class zo extends Oe{}function pe(e,t,i,s){return t.multiply(e.x).add(i.multiply(e.y)).add(s.multiply(e.z))}function pt(e){return e.multiply(e).divide(128)}class se extends Ge{constructor(){super(...arguments),this.computeAttributes={offset:["offsetNextVertex1","offsetNextVertex2"],textureUV:["textureUVNextVertex1","textureUVNextVertex2"]}}vertex(t,i){const s=pt(t.sizing.x),o=pt(t.sizing.y),a=pt(t.sizing.z),r=t.placementAngle,u=Z(t.bitset,le.bitset.isSDF),c=Z(t.bitset,le.bitset.isMapAligned),d=Z(t.bitset,le.bitset.scaleSymbolsProportionally),p=pi(t.bitset,le.bitset.colorLocked),m=di(this,t.id),f=ui(this,t.id,t.color,p).multiply(m),x=this.view.displayViewScreenMat3.multiply(new A(t.pos.xy,1)),h=et(this,t.id,a).divide(a),y=s.multiply(h),b=t.offset.xy.multiply(h);let g=o.multiply(d.multiply(h.subtract(1)).add(1));g=yt(g,xe(y.subtract(.99),new n(0)));const P=xe(g,new n(1)),I=yt(g,new n(1)),C=B.fromRotation(r.multiply(li)),_=gi(this,t.id),T=this._getViewRotationMatrix(c).multiply(_).multiply(C).multiply(new A(b.xy,0)),M=this.clip(t.id,t.zoomRange),z=new S(x.xy.add(T.xy),M,1),R=t.textureUV.divide(this.mosaicInfo.size),Se=t.outlineColor.multiply(I),Hi=Z(t.bitset,le.bitset.overrideOutlineColor),$t=t.sdfDecodeCoeff.multiply(y);return{glPosition:z,color:f,textureUV:R,outlineColor:Se,outlineSize:P,distanceToPx:$t,isSDF:u,overrideOutlineColor:Hi,...this.maybeRunHittest(t,i,{pos:t.pos,size:y,sizeCorrection:h,isMapAligned:c,vvRotationMat3:_,placementMat3:C,outlineSize:P,distanceToPx:$t,isSDF:u})}}fragment(t){const i=this._getColor(t.textureUV,t);return this.getFragmentOutput(i,t)}hittest(t,i,s){return Y(mi(s.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(t,i,s),this._hittestMarker(t,i,s))}_getViewRotationMatrix(t){const i=this.view.displayViewMat3,s=this.view.displayMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getViewScreenMatrix(t){const i=this.view.viewMat3.multiply(this.view.tileMat3),s=this.view.tileMat3,o=new n(1).subtract(t);return i.multiply(t).add(s.multiply(o))}_getColor(t,i){return Y(me(i.isSDF,new n(1)),this._getSDFColor(t,i),this._getSpriteColor(t,i))}_getSpriteColor(t,i){return Q(this.mosaicInfo.texture,t).multiply(i.color)}_getSDFColor(t,i){const s=Q(this.mosaicInfo.texture,t),o=new n(.5).subtract(Pt(s)).multiply(i.distanceToPx).multiply(ni),a=$e(new n(.5).subtract(o),new n(0),new n(1)),r=i.color.multiply(a);let u=i.outlineSize;this.highlight&&(u=xe(u,i.overrideOutlineColor.multiply(4)));const c=u.multiply(.5),d=At(o).subtract(c),p=$e(new n(.5).subtract(d),new n(0),new n(1)),m=Re(i.outlineColor,i.color,i.overrideOutlineColor).multiply(p);return new n(1).subtract(m.a).multiply(r).add(m)}_hittestSmallMarker(t,i,s){const{position:o,distance:a,smallSymbolDistance:r}=this.hittestRequest,u=a.subtract(r),{viewMat3:c,tileMat3:d}=this.view,p=c.multiply(d).multiply(new A(s.pos,1)).xy,m=s.size.multiply(.5);return fi(p,o).subtract(m).add(u)}_hittestMarker(t,i,s){const{pos:o,sizeCorrection:a,isMapAligned:r}=s,u=new A(t.offset.multiply(a),0),c=new A(i.offsetNextVertex1.multiply(a),0),d=new A(i.offsetNextVertex2.multiply(a),0),{viewMat3:p,tileMat3:m}=this.view,f=p.multiply(m).multiply(new A(o,1)),x=this._getViewScreenMatrix(r).multiply(s.vvRotationMat3).multiply(s.placementMat3),h=f.add(x.multiply(u)).xy,y=f.add(x.multiply(c)).xy,b=f.add(x.multiply(d)).xy,g=this.hittestRequest.position,P=this.hittestRequest.distance,I=Rt(g,h,y,b);return Y(Ie(I,P),I,this._hittestSamples(h,y,b,t,i,s))}_hittestSamples(t,i,s,o,a,r){const{outlineSize:u,isSDF:c,distanceToPx:d}=r,p=this.hittestRequest.position,m=this.hittestRequest.distance,f=E(p.add(new v(ie(m),ie(m))),t,i,s),x=E(p.add(new v(0,ie(m))),t,i,s),h=E(p.add(new v(m,ie(m))),t,i,s),y=E(p.add(new v(ie(m),0)),t,i,s),b=E(p,t,i,s),g=E(p.add(new v(m,0)),t,i,s),P=E(p.add(new v(ie(m),m)),t,i,s),I=E(p.add(new v(0,m)),t,i,s),C=E(p.add(new v(m,m)),t,i,s),_=o.textureUV.divide(this.mosaicInfo.size),T=a.textureUVNextVertex1.divide(this.mosaicInfo.size),M=a.textureUVNextVertex2.divide(this.mosaicInfo.size),z={color:new S(1),outlineColor:new S(1),overrideOutlineColor:new n(1),outlineSize:u,distanceToPx:d,isSDF:c};let R=new n(0);return R=R.add(L(f).multiply(this._getColor(pe(f,_,T,M),z).a)),R=R.add(L(x).multiply(this._getColor(pe(x,_,T,M),z).a)),R=R.add(L(h).multiply(this._getColor(pe(h,_,T,M),z).a)),R=R.add(L(y).multiply(this._getColor(pe(y,_,T,M),z).a)),R=R.add(L(b).multiply(this._getColor(pe(b,_,T,M),z).a)),R=R.add(L(g).multiply(this._getColor(pe(g,_,T,M),z).a)),R=R.add(L(P).multiply(this._getColor(pe(P,_,T,M),z).a)),R=R.add(L(I).multiply(this._getColor(pe(I,_,T,M),z).a)),R=R.add(L(C).multiply(this._getColor(pe(C,_,T,M),z).a)),K(R,new n(.05)).multiply(ot(this.hittestRequest))}}l([O(It)],se.prototype,"visualVariableColor",void 0),l([O(Ot)],se.prototype,"visualVariableOpacity",void 0),l([O(nt)],se.prototype,"visualVariableRotation",void 0),l([O(Ft)],se.prototype,"visualVariableSizeMinMaxValue",void 0),l([O(Dt)],se.prototype,"visualVariableSizeScaleStops",void 0),l([O(Et)],se.prototype,"visualVariableSizeStops",void 0),l([O(Lt)],se.prototype,"visualVariableSizeUnitValue",void 0),l([V(at)],se.prototype,"mosaicInfo",void 0),l([D(0,F(de)),D(1,F(ke))],se.prototype,"vertex",null),l([D(0,F(zo))],se.prototype,"fragment",null);let _o=class extends q{constructor(){super(...arguments),this.type=G.Marker,this.shaders={geometry:new se},this.symbologyPlane=we.MARKER}render(e,t){const{context:i,painter:s}=e,o=t.instance.getInput();s.setShader({shader:this.shaders.geometry,uniforms:{...J(e,t.target,o.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey,!0)},defines:{...N(e)},optionalAttributes:o.optionalAttributes,useComputeBuffer:k(e)}),s.setPipelineState(H(e)),s.submitDraw(e,t)}},To=class{constructor(){this.computeAttributes={}}get locationsMap(){const e=new Map;for(const t in this.locations)e.set(t,this.locations[t].index);return e}get optionPropertyKeys(){if(!this._optionPropertyKeys){const e=new Set(Object.keys(this.options));this._optionPropertyKeys=e}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,t=Array.from(e.entries()).map(([s,o])=>`${s}.${o}`).join("."),i=zs(t);this._locationInfo={hash:i,locations:e,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const e=new Map;for(const[t,i]of this.locationsMap.entries())e.set("a_"+t,i);return e}getShaderKey(e,t,i){return`${Object.keys(e).map(s=>`${s}.${e[s]}`).join(".")}.${Object.keys(i).filter(s=>i[s]).map(s=>`${s}_${i[s].toString()}`).join(".")}.${Object.keys(t).filter(s=>this.optionPropertyKeys.has(s)).join(".")}`}getProgram(e,t,i,s){let o="",a="";for(const r in i)if(i[r]){const u=typeof i[r]=="boolean"?`#define ${r} `:`#define ${r} ${i[r]} `;o+=u,a+=u}return o+=this.vertexShader,a+=this.fragmentShader,new xs(o,a,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(t),this._transformFeedbackBindings)}_getUniformBindings(e){const t=[];for(const i in this.required){const s=this.required[i];t.push({uniformHydrated:null,shaderModulePath:i,uniformName:i,uniformType:s.type,uniformArrayElementType:oi(s),uniformArrayLength:ai(s)})}for(const i in e){const s=this.options[i];if(e[i])for(const o in s){const a=s[o];t.push({uniformHydrated:null,shaderModulePath:`${i}.${o}`,uniformName:o,uniformType:a.type,uniformArrayElementType:oi(a),uniformArrayLength:ai(a)})}}return t}};const oi=e=>e.type==="array"?e.elementType?.type:void 0,ai=e=>e.type==="array"?e.size:void 0,Mo={hittestDist:n,hittestPos:v},Po={filterFlags:j,animation:j,visualVariableData:j,dataDriven0:j,dataDriven1:j,dataDriven2:j,gpgpu:j,size:n},Ao={displayViewScreenMat3:B,displayViewMat3:B,displayMat3:B,viewMat3:B,tileMat3:B,displayZoomFactor:n,requiredZoomFactor:n,tileOffset:v,currentScale:n,currentZoom:n,metersPerSRUnit:n};let Co=class extends To{constructor(){super(...arguments),this.vertexShader=ii("materials/pie/pie.vert"),this.fragmentShader=ii("materials/pie/pie.frag"),this.required={...Po,...Ao,outlineWidth:n,colors:ne,defaultColor:S,othersColor:S,outlineColor:S,donutRatio:n,sectorThreshold:n},this.options={hittestUniforms:Mo,visualVariableSizeMinMaxValue:{minMaxValueAndSize:S},visualVariableSizeScaleStops:{sizes:{...ne.ofType(n,8),type:"array",elementType:n,size:8},values:{...ne.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeStops:{sizes:{...ne.ofType(n,8),type:"array",elementType:n,size:8},values:{...ne.ofType(n,8),type:"array",elementType:n,size:8}},visualVariableSizeUnitValue:{unitValueToPixelsRatio:n},visualVariableOpacity:{opacities:{...ne.ofType(n,8),type:"array",elementType:n,size:8},opacityValues:{...ne.ofType(n,8),type:"array",elementType:n,size:8}}},this.locations={pos:{index:0,type:v},id:{index:1,type:A},bitset:{index:2,type:n},offset:{index:3,type:v},texCoords:{index:4,type:v},size:{index:5,type:v},referenceSize:{index:6,type:n},zoomRange:{index:7,type:v}},this.defines={VV_SIZE_MIN_MAX_VALUE:"boolean",VV_SIZE_SCALE_STOPS:"boolean",VV_SIZE_FIELD_STOPS:"boolean",VV_SIZE_UNIT_VALUE:"boolean",VV_OPACITY:"boolean",HITTEST:"boolean",numberOfFields:"number",highlight:"boolean",inside:"boolean",outside:"boolean"}}setNumberOfFields(e){this.required.colors={...ne.ofType(S,e),type:"array",elementType:S,size:e}}},Ro=class extends q{constructor(){super(...arguments),this.type=G.PieChart,this.shaders={geometry:new Co},this.symbologyPlane=we.MARKER}render(e,t){const{painter:i}=e,{instance:s,target:o}=t,a=this.shaders.geometry,r=s.getInput(),u=r.uniforms.numberOfFields,c=k(e),d=$(e,o),p=N(e);a.setNumberOfFields(u),i.setShader({shader:a,uniforms:{...J(e,t.target,r.uniforms.shader),...d.storage,...d.view,hittestUniforms:d.hittestRequest?{hittestDist:d.hittestRequest?.distance,hittestPos:d.hittestRequest?.position}:null},defines:{VV_SIZE_MIN_MAX_VALUE:!!r.uniforms.shader.visualVariableSizeMinMaxValue,VV_SIZE_SCALE_STOPS:!!r.uniforms.shader.visualVariableSizeScaleStops,VV_SIZE_FIELD_STOPS:!!r.uniforms.shader.visualVariableSizeStops,VV_SIZE_UNIT_VALUE:!!r.uniforms.shader.visualVariableSizeUnitValue,VV_OPACITY:!!r.uniforms.shader.visualVariableOpacity,HITTEST:c,highlight:d.highlight?1:0,...p,numberOfFields:u},optionalAttributes:{},useComputeBuffer:c}),i.setPipelineState(H(e)),i.submitDraw(e,t)}},Io=class extends q{constructor(){super(...arguments),this.type=G.Text,this.shaders={geometry:new U},this.symbologyPlane=we.TEXT}render(e,t){const{context:i,painter:s}=e,o=N(e),a=t.instance.getInput(),r={shader:this.shaders.geometry,uniforms:{...J(e,t.target,a.uniforms),...$(e,t.target),mosaicInfo:s.textureManager.getMosaicInfo(i,t.textureKey)},defines:{...o,isBackgroundPass:!0,isLabel:!1,textRenderPassType:W.Color},optionalAttributes:a.optionalAttributes,useComputeBuffer:k(e)};s.setShader(r),s.setPipelineState(H(e)),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Halo}}),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Outline}}),s.submitDraw(e,t),s.setShader({...r,defines:{...o,isBackgroundPass:!1,isLabel:!1,textRenderPassType:W.Color}}),s.submitDraw(e,t)}};const ae={fill:new ao,patternFill:new no,complexFill:new so,outlineFill:new ro,patternOutlineFill:new lo,complexOutlineFill:new oo,marker:new _o,pieChart:new Ro,line:new So,texturedLine:new Vo,text:new Io,label:new wo,heatmap:new ho,dotDensity:new io,animatedMarker:new Ys};function Ea(){for(const e in ae)ae[e].startup()}function La(e){for(const t in ae)ae[t].shutdown(e)}function it(e,t){const i=e.slice(0,t),s=t-i.length;for(let o=0;oSi.getLogger("esri.views.2d.layers.features.support.rendererUtils");function Bi(e){return e.map(t=>Fo(t)?Do(t.clone()):t)}function Fo(e){return(e.type==="size"||e.type==="color"||e.type==="opacity")&&e.stops!=null}function Do(e){return e.stops=ko(e.type,e.stops??[]),e}function ze(e,t,i){return(1-i)*e+i*t}function Eo(e,t){const[i,...s]=t,o=s.pop(),a=s[0].value,r=s[s.length-1].value,u=(r-a)/Li,c=[];for(let d=a;d=s[p].value;)p++;const m=s[p],f=t[p-1],x=d-f.value,h=m.value===f.value?1:x/(m.value-f.value);if(e==="color"){const y=s[p],b=t[p-1],g=y.color.clone();g.r=ze(b.color.r,g.r,h),g.g=ze(b.color.g,g.g,h),g.b=ze(b.color.b,g.b,h),g.a=ze(b.color.a,g.a,h),c.push({value:d,color:g,label:y.label})}else if(e==="size"){const y=s[p],b=t[p-1],g=Xt(y.size),P=ze(Xt(b.size),g,h);c.push({value:d,size:P,label:y.label})}else{const y=s[p],b=ze(t[p-1].opacity,y.opacity,h);c.push({value:d,opacity:b,label:y.label})}}return[i,...c,o]}function Lo(e){const[t,...i]=e,s=i.pop();for(;i.length>Li;){let o=0,a=0;for(let r=1;ra&&(a=d,o=r)}i.splice(o,1)}return[t,...i,s]}function ko(e,t){return t.length<=Qe?t:(ki().warn(`Found ${t.length} Visual Variable stops, but MapView only supports ${Qe}. Displayed stops will be simplified.`),t.length>2*Qe?Eo(e,t):Lo(t))}function Bo(){const{supportsColorBufferFloat:e,supportsColorBufferFloatBlend:t,supportsColorBufferHalfFloat:i}=Bt();return e&&t||i}function ka(e){if(!e)return!0;switch(e.type){case"dot-density":break;case"heatmap":if(!Bo()){const t=Bt(),i=["supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(s=>!t[s]).join(", ");return ki().errorOnce(new Ke("webgl-missing-extension",`Missing WebGL2 requirements for Heatmap: ${i}`)),!1}}return!0}const No=1.25,je=128,$o=128;function Uo(e){if(!e.stops?.length)return null;const t=e.stops.sort((a,r)=>a.value-r.value),i=it(t,8),s=i.map(({value:a})=>a),o=i.map(({color:a})=>Oo(a));return{values:s,colors:o}}function Ho(e){if(!e.stops?.length)return null;const t=e.stops.sort((s,o)=>s.value-o.value),i=it(t,8);return{opacityValues:i.map(({value:s})=>s),opacities:i.map(({opacity:s})=>s)}}function Go(e){return{rotationType:e.rotationType==="geographic"?mt.Geographic:mt.Arithmatic}}function dt(e){if(!e.stops?.length)return null;if(e.stops.some(s=>s.useMaxValue||s.useMinValue))return(s,o)=>{const a=s.statisticsByLevel.get(o.key.level),r=e.stops.map(c=>({value:c.useMaxValue?a?.get(e.field)?.maxValue??0:c.useMinValue?a?.get(e.field)?.minValue??0:c.value,size:c.size?be(c.size):Os})).sort((c,d)=>c.value-d.value),u=it(r,8);return{values:u.map(({value:c})=>c),sizes:u.map(({size:c})=>c)}};const t=e.stops.sort((s,o)=>s.value-o.value),i=it(t,8);return{values:i.map(({value:s})=>s),sizes:i.map(({size:s})=>be(s))}}function qo(e){return t=>{const{state:i}=t;return{unitValueToPixelsRatio:Ts(i.spatialReference)/Ns[e.valueUnit??"meters"]/i.resolution}}}function ri(e,t){const i=t.length;if(e{const u=a.state.scale,c=be(ri(u,s.stops)),d=be(ri(u,o.stops));return{minMaxValueAndSize:[t,i,c,d]}};if(typeof s=="object"||typeof o=="object")throw new Error("InternalError: Found a partial VisualVariableSizeMinMaxValue");return{minMaxValueAndSize:[t,i,be(s),be(o)]}}const st={visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:null,visualVariableSizeStops:null,visualVariableSizeScaleStops:null,visualVariableSizeOutlineScaleStops:null,visualVariableSizeUnitValue:null,visualVariableSizeMinMaxValue:null};function Ni(e,t=$o,i=No){if(e.visualVariableSizeMinMaxValue)return e.visualVariableSizeMinMaxValue instanceof Function?je:Math.max(e.visualVariableSizeMinMaxValue.minMaxValueAndSize[3]*i,t);if(e.visualVariableSizeScaleStops){if(e.visualVariableSizeScaleStops instanceof Function)return je;const s=e.visualVariableSizeScaleStops.sizes;return Math.max(s[s.length-1]*i,t)}if(e.visualVariableSizeStops){if(e.visualVariableSizeStops instanceof Function)return je;const s=e.visualVariableSizeStops.sizes;return Math.max(s[s.length-1]*i,t)}return e.visualVariableSizeUnitValue?2*je:0}function Ba(e){const t={...st};if(!e||!("visualVariables"in e)||!e.visualVariables)return t;for(const i of Bi(e.visualVariables))switch(i.type){case"color":t.visualVariableColor=Uo(i);break;case"opacity":t.visualVariableOpacity=Ho(i);break;case"rotation":t.visualVariableRotation=Go(i);break;case"size":switch(jo(i)){case"field-stops":t.visualVariableSizeStops=dt(i);break;case"scale-stops":i.target==="outline"?t.visualVariableSizeOutlineScaleStops=dt(i):t.visualVariableSizeScaleStops=dt(i);break;case"min-max":t.visualVariableSizeMinMaxValue=Wo(i);break;case"unit-value":t.visualVariableSizeUnitValue=qo(i)}break}return t}function jo(e){return typeof e.minDataValue=="number"&&typeof e.maxDataValue=="number"&&e.minSize!=null&&e.maxSize!=null?"min-max":e?.valueExpression==="$view.scale"&&Array.isArray(e.stops)?"scale-stops":e.field==null&&e?.valueExpression==="$view.scale"||!(Array.isArray(e.stops)||"levels"in e&&e.levels)?e.field!=null||e?.valueExpression!=="$view.scale"?"unit-value":null:"field-stops"}function Ko(e){return!!(e.visualVariableSizeMinMaxValue||e.visualVariableSizeScaleStops||e.visualVariableSizeStops||e.visualVariableSizeUnitValue||e.visualVariableSizeOutlineScaleStops)}function Na(e){return!!e.visualVariableRotation}function Xo(e){return e.minScale||e.maxScale?{minScale:e.minScale??0,maxScale:e.maxScale??0}:null}function oe(e){if(e==null)return null;if(Array.isArray(e)){const[t,i,s,o]=e;return[t,i,s,255*o]}return typeof e=="string"?e:{...e,defaultValue:oe(e?.defaultValue)}}async function $a(e,t){const{cimResourceManager:i,cimAnalyzer:s,scaleExpression:o}=t.schemaOptions;await Promise.all(vs.fetchResources(e.symbol,i,[]));const a=s.analyzeSymbolReference(e,!1),r={scaleInfo:Xo(e),scaleExpression:o},u=[];for(const c of a)switch(c.type){case"marker":u.push(...Zo(c,t,r));break;case"fill":u.push(...ta(c,t,r));break;case"line":u.push(...sa(c,t,r));break;case"text":u.push(...ra(c,t,r))}return u}function Zo(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o,r=e.isOutline?{...st,visualVariableSizeScaleStops:s.visualVariableSizeOutlineScaleStops}:{visualVariableColor:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,visualVariableRotation:s.visualVariableRotation};return e.animationParams?Yo(a.ensureInstance(ae.animatedMarker,{uniforms:r,optionalAttributes:{zoomRange:!0}}),e,st,i):Qo(a.ensureInstance(ae.marker,{uniforms:r,optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,s,i)}function Yo(e,t,i,s){return t.animationParams?[e.createMeshInfo({pixelDimensions:t.pixelDimensions,texelDimensions:t.texelDimensions,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,sprite:t.spriteRasterizationParam,animations:t.animationParams,scaleInfo:s.scaleInfo,scaleSymbolsProportionally:t.scaleSymbolsProportionally,strokeWidth:t.outlineWidth,isMapAligned:t.alignment===ws.MAP,colorLocked:t.colorLocked,isStroke:t.isStroke,baseSize:t.baseSize,referenceSize:t.referenceSize,angleToLine:!!t.markerPlacement&&t.markerPlacement.placement&&"angleToLine"in t.markerPlacement.placement&&t.markerPlacement.placement.angleToLine,sizeRatio:t.sizeRatio})]:[]}function Qo(e,t,i,{scaleInfo:s,scaleExpression:o}){const a=Ko(i);return[e.createMeshInfo({size:t.size,scaleX:t.scaleX,anchorX:t.anchorPoint.x,anchorY:t.anchorPoint.y,angle:t.rotation,color:oe(t.color)??[0,0,0,0],colorLocked:t.colorLocked,frameHeight:t.frameHeight,widthRatio:t.widthRatio,scaleInfo:s,offsetX:t.offsetX,offsetY:t.offsetY,outlineColor:oe(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineWidth,referenceSize:t.referenceSize||gs.CIMVectorMarker.size,rotateClockwise:t.rotateClockwise,scaleFactor:o??1,sizeRatio:t.sizeRatio,alignment:t.alignment,isAbsoluteAnchorPoint:t.isAbsoluteAnchorPoint,scaleSymbolsProportionally:t.scaleSymbolsProportionally,sprite:t.spriteRasterizationParam,hasSizeVV:a,placement:t.markerPlacement,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,transforms:t.transform,minPixelBuffer:Ni(i)})]}function Jo(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return ea(a.ensureInstance(ae.fill,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,i)}function ea(e,t,{scaleInfo:i}){return[e.createMeshInfo({color:oe(t.color)??[0,0,0,0],scaleInfo:i,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null})]}function ta(e,t,i){if(!e.spriteRasterizationParam)return Jo(e,t,i);const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return ia(a.ensureInstance(ae.complexFill,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity},optionalAttributes:{zoomRange:!!i.scaleInfo}}),e,s.visualVariableColor!=null,i)}function ia(e,t,i,{scaleInfo:s}){if(!t.spriteRasterizationParam)throw new Error("InternalError: Sprite should always be defined");const o=!!t.hasUnresolvedReplacementColor&&(!i||t.colorLocked),a=t.sampleAlphaOnly&&!o,r=t.spriteRasterizationParam;return[e.createMeshInfo({color:oe(t.color)??[0,0,0,0],height:t.height,aspectRatio:t.scaleX,offsetX:t.offsetX,offsetY:t.offsetY,scaleX:1,scaleY:1,angle:t.angle,applyRandomOffset:t.applyRandomOffset,sampleAlphaOnly:a,scaleProportionally:r.resource.type==="CIMHatchFill",sprite:r,scaleInfo:s,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null})]}function sa(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o,r=e.isOutline?{...st,visualVariableSizeScaleStops:s.visualVariableSizeOutlineScaleStops}:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue},u={uniforms:r,optionalAttributes:{zoomRange:!!i.scaleInfo}},c=!!(r.visualVariableSizeMinMaxValue||r.visualVariableSizeScaleStops||r.visualVariableSizeStops||r.visualVariableSizeUnitValue);return e.spriteRasterizationParam?aa(a.ensureInstance(ae.texturedLine,u),e,c,i):oa(a.ensureInstance(ae.line,u),e,c,i)}function $i(e,t,{scaleInfo:i}){return{color:oe(e.color)??[0,0,0,0],width:e.width,referenceWidth:e.referenceWidth,capType:e.cap,joinType:e.join,miterLimit:e.miterLimit,scaleInfo:i,hasSizeVV:t,effects:e.effects?{type:"cim-effect-infos",effectInfos:e.effects}:null}}function oa(e,t,i,s){if(t.spriteRasterizationParam)throw new Error("InternalError: Sprite should not be defined");const o=$i(t,i,s);return[e.createMeshInfo(o)]}function aa(e,t,i,s){const{spriteRasterizationParam:o,scaleDash:a,sampleAlphaOnly:r}=t;if(!o)throw new Error("InternalError: Sprite should be defined");return[e.createMeshInfo({...$i(t,i,s),offsetAlongLine:t.offsetAlongLine??0,shouldScaleDash:a??!1,shouldSampleAlphaOnly:r,isSDF:o.resource.type!=="CIMPictureStroke",sprite:o})]}function ra(e,t,i){const{uniforms:s,schemaOptions:o}=t,{store:a}=o;return na(a.ensureInstance(ae.text,{uniforms:{visualVariableColor:e.colorLocked?null:s.visualVariableColor,visualVariableOpacity:s.visualVariableOpacity,visualVariableRotation:s.visualVariableRotation,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!!i.scaleInfo,referenceSymbol:!1,clipAngle:!1}}),e,s,i)}function na(e,t,i,{scaleInfo:s,scaleExpression:o}){return[e.createMeshInfo({boxBackgroundColor:oe(t.backgroundColor),boxBorderLineColor:oe(t.borderLineColor),boxBorderLineSize:t.borderLineWidth??0,color:oe(t.color)??[0,0,0,0],offsetX:t.offsetX,offsetY:t.offsetY,postAngle:t.angle,fontSize:t.size,referenceSize:t.referenceSize,decoration:t.decoration,haloColor:oe(t.haloColor)??[0,0,0,0],haloSize:t.haloSize??0,outlineColor:oe(t.outlineColor)??[0,0,0,0],outlineSize:t.outlineSize,lineWidth:t.lineWidth||512,lineHeightRatio:1,horizontalAlignment:t.horizontalAlignment??"center",verticalAlignment:t.verticalAlignment??"baseline",useCIMAngleBehavior:!1,glyphs:t.textRasterizationParam,scaleInfo:s,effects:t.effects?{type:"cim-effect-infos",effectInfos:t.effects}:null,placement:t.markerPlacement,transforms:t.transform,scaleFactor:o??1,minPixelBuffer:Ni(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null})]}function Ua(e,t){return{type:"simple",filters:t,capabilities:{maxTextureSize:Bt().maxTextureSize},bindings:la(e)}}function lt(e){switch(e){case"opacity":return We.OPACITY;case"color":return We.COLOR;case"rotation":return We.ROTATION;case"size":return We.SIZE;default:return null}}function la(e){if(!e)return[];switch(e.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":return Ui(e);case"dot-density":return ua(e);case"pie-chart":return ca(e);case"heatmap":return pa(e)}}function ua(e){const t=[];for(const i of e.attributes)t.push({binding:t.length,expression:i.valueExpression,field:i.field});return t}function ca(e){const t=Ui(e);let i=4;for(const s of e.attributes)t.push({binding:i++,expression:s.valueExpression,field:s.field});return t}function pa({valueExpression:e,field:t}){return e||t?[{binding:0,expression:e,field:t}]:[]}function Ui(e){return!("visualVariables"in e)||!e.visualVariables?.length?[]:Bi(e.visualVariables).map(t=>ya(t)).filter(_s)}function da(e){return e.valueExpression==="$view.scale"?null:{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression,valueRepresentation:e.valueRepresentation}}function ma(e){return{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression}}function fa(e){return{binding:lt(e.type),field:e.field,normalizationField:e.normalizationField,expression:e.valueExpression}}function ha(e){return{binding:lt(e.type),expression:e.valueExpression,field:e.field}}function ya(e){switch(e.type){case"size":return da(e);case"color":return ma(e);case"opacity":return fa(e);case"rotation":return ha(e)}}class Ha{constructor(t){this.updateTracking=new ns({debugName:"FeatureCommandQueue"}),this._queueProcessor=new $s({concurrency:1,process:t.process})}destroy(){this.updateTracking.destroy(),this._queueProcessor.destroy(),this.clear()}clear(){this._queueProcessor.clear()}async push(t){return Ss(this.updateTracking.addPromise(this._doPush(t)))}async _doPush(t){const i=this._queueProcessor,s=i.last();switch(t.type){case"update":case"highlight":return s?.type===t.type?void 0:i.push(t);case"edit-by-id":case"edit-by-feature":return i.push(t)}}}export{La as $,oa as J,Qo as K,js as M,Ni as N,qs as P,ka as Q,Gs as T,Ui as U,st as W,Yo as X,ia as Y,ea as Z,Ha as _,na as a,Oo as b,Ko as c,aa as e,Ua as h,Xo as j,Na as l,ae as o,Ea as q,Ba as r,Da as s,Nt as t,$a as u}; diff --git a/custom-toc-highlight/assets/FeatureEffect-CDEk9Es7-CEiHf7-6.js b/custom-toc-highlight/assets/FeatureEffect-CDEk9Es7-Cd4-I1fy.js similarity index 90% rename from custom-toc-highlight/assets/FeatureEffect-CDEk9Es7-CEiHf7-6.js rename to custom-toc-highlight/assets/FeatureEffect-CDEk9Es7-Cd4-I1fy.js index fc4581e1..588e3677 100644 --- a/custom-toc-highlight/assets/FeatureEffect-CDEk9Es7-CEiHf7-6.js +++ b/custom-toc-highlight/assets/FeatureEffect-CDEk9Es7-Cd4-I1fy.js @@ -1 +1 @@ -import{v as i,S as o,dK as c,i as b,e as y,o as f}from"./story-BfX8CRfG.js";import{l as u,p as d}from"./jsonUtils-wIllKWI4-DrGIvCCq.js";import m from"./FeatureFilter-BCFHgLVU-CXZvxasm.js";var a;const p={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},w={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},h={name:"showExcludedLabels",default:!0};let t=a=class extends y{constructor(r){super(r),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(r,e){const l=super.write(r,e);if(e?.origin){if(l.filter){const s=Object.keys(l.filter);if(s.length>1||s[0]!=="where")return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:e.layer,effect:this})),null}if("showExcludedLabels"in l)return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return l}clone(){return new a({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};i([o({type:m,json:{write:{allowNull:!0,writer(r,e,l,s){const n=r?.write({},s);n&&Object.keys(n).length!==0?c(l,n,e):c(l,null,e)}}}})],t.prototype,"filter",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":p,"portal-item":p}}})],t.prototype,"includedEffect",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":w,"portal-item":w}}})],t.prototype,"excludedEffect",void 0),i([o({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":h,"portal-item":h}}})],t.prototype,"excludedLabelsVisible",void 0),t=a=i([b("esri.layers.support.FeatureEffect")],t);const g=t;export{g as x}; +import{v as i,S as o,dK as c,i as b,e as y,o as f}from"./story-Doly9N9p.js";import{l as u,p as d}from"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import m from"./FeatureFilter-BCFHgLVU-DwigNbnH.js";var a;const p={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},w={read:{reader:u},write:{writer:d,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},h={name:"showExcludedLabels",default:!0};let t=a=class extends y{constructor(r){super(r),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(r,e){const l=super.write(r,e);if(e?.origin){if(l.filter){const s=Object.keys(l.filter);if(s.length>1||s[0]!=="where")return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:e.layer,effect:this})),null}if("showExcludedLabels"in l)return e.messages?.push(new f("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:e.layer,effect:this})),null}return l}clone(){return new a({filter:this.filter!=null?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};i([o({type:m,json:{write:{allowNull:!0,writer(r,e,l,s){const n=r?.write({},s);n&&Object.keys(n).length!==0?c(l,n,e):c(l,null,e)}}}})],t.prototype,"filter",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":p,"portal-item":p}}})],t.prototype,"includedEffect",void 0),i([o({json:{read:u,write:{writer:d,allowNull:!0},origins:{"web-map":w,"portal-item":w}}})],t.prototype,"excludedEffect",void 0),i([o({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":h,"portal-item":h}}})],t.prototype,"excludedLabelsVisible",void 0),t=a=i([b("esri.layers.support.FeatureEffect")],t);const g=t;export{g as x}; diff --git a/custom-toc-highlight/assets/FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js b/custom-toc-highlight/assets/FeatureEffectLayer-Cro89IEC-B2s0Xww8.js similarity index 68% rename from custom-toc-highlight/assets/FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js rename to custom-toc-highlight/assets/FeatureEffectLayer-Cro89IEC-B2s0Xww8.js index 2d2aee51..a33bd7f7 100644 --- a/custom-toc-highlight/assets/FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js +++ b/custom-toc-highlight/assets/FeatureEffectLayer-Cro89IEC-B2s0Xww8.js @@ -1 +1 @@ -import{v as t,S as s,i}from"./story-BfX8CRfG.js";import{x as a}from"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";const r={write:{allowNull:!0}},l={type:a,json:{origins:{"web-map":r,"portal-item":r}}},p=o=>{let e=class extends o{constructor(){super(...arguments),this.featureEffect=null}};return t([s(l)],e.prototype,"featureEffect",void 0),e=t([i("esri.layers.mixins.FeatureEffectLayer")],e),e};export{p as l,l as s}; +import{v as t,S as s,i}from"./story-Doly9N9p.js";import{x as a}from"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";const r={write:{allowNull:!0}},l={type:a,json:{origins:{"web-map":r,"portal-item":r}}},p=o=>{let e=class extends o{constructor(){super(...arguments),this.featureEffect=null}};return t([s(l)],e.prototype,"featureEffect",void 0),e=t([i("esri.layers.mixins.FeatureEffectLayer")],e),e};export{p as l,l as s}; diff --git a/custom-toc-highlight/assets/FeatureFilter-BCFHgLVU-CXZvxasm.js b/custom-toc-highlight/assets/FeatureFilter-BCFHgLVU-DwigNbnH.js similarity index 89% rename from custom-toc-highlight/assets/FeatureFilter-BCFHgLVU-CXZvxasm.js rename to custom-toc-highlight/assets/FeatureFilter-BCFHgLVU-DwigNbnH.js index e59c6370..a4a0020d 100644 --- a/custom-toc-highlight/assets/FeatureFilter-BCFHgLVU-CXZvxasm.js +++ b/custom-toc-highlight/assets/FeatureFilter-BCFHgLVU-DwigNbnH.js @@ -1 +1 @@ -import{aK as y,v as i,S as s,af as R,i as w,e as S,P as r}from"./story-BfX8CRfG.js";import{b as v}from"./Query-BrwMGK8U-DoFNfkjX.js";import{k as j}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./main-ugzBrWNm.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";var m;const c=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let e=m=class extends S{constructor(t){super(t),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(t={}){const{where:o,geometry:n,spatialRelationship:a,timeExtent:l,objectIds:p,units:u,distance:h}=this;return new v({geometry:r(n),objectIds:r(p),spatialRelationship:a,timeExtent:r(l),where:o,units:u,distance:h,...t})}clone(){const{where:t,geometry:o,spatialRelationship:n,timeExtent:a,objectIds:l,units:p,distance:u}=this;return new m({geometry:r(o),objectIds:r(l),spatialRelationship:n,timeExtent:r(a),where:t,units:p,distance:u})}};i([s({type:String,json:{write:!0}})],e.prototype,"where",void 0),i([s({types:R,json:{write:!0}})],e.prototype,"geometry",void 0),i([s({type:c.apiValues,json:{name:"spatialRel",read:{reader:c.read},write:{allowNull:!1,writer:c.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],e.prototype,"spatialRelationship",void 0),i([s({type:Number,json:{write:{overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"distance",void 0),i([s({type:[Number],json:{write:!0}})],e.prototype,"objectIds",void 0),i([s({type:d.apiValues,json:{read:d.read,write:{writer:d.write,overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"units",void 0),i([s({type:j,json:{write:!0}})],e.prototype,"timeExtent",void 0),e=m=i([w("esri.layers.support.FeatureFilter")],e);const _=e;export{_ as default}; +import{aK as y,v as i,S as s,af as R,i as w,e as S,P as r}from"./story-Doly9N9p.js";import{b as v}from"./Query-BrwMGK8U-BPr0_G9t.js";import{k as j}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./main-QGPoLsvl.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";var m;const c=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let e=m=class extends S{constructor(t){super(t),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(t={}){const{where:o,geometry:n,spatialRelationship:a,timeExtent:l,objectIds:p,units:u,distance:h}=this;return new v({geometry:r(n),objectIds:r(p),spatialRelationship:a,timeExtent:r(l),where:o,units:u,distance:h,...t})}clone(){const{where:t,geometry:o,spatialRelationship:n,timeExtent:a,objectIds:l,units:p,distance:u}=this;return new m({geometry:r(o),objectIds:r(l),spatialRelationship:n,timeExtent:r(a),where:t,units:p,distance:u})}};i([s({type:String,json:{write:!0}})],e.prototype,"where",void 0),i([s({types:R,json:{write:!0}})],e.prototype,"geometry",void 0),i([s({type:c.apiValues,json:{name:"spatialRel",read:{reader:c.read},write:{allowNull:!1,writer:c.write,overridePolicy(){return{enabled:this.geometry!=null}}}}})],e.prototype,"spatialRelationship",void 0),i([s({type:Number,json:{write:{overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"distance",void 0),i([s({type:[Number],json:{write:!0}})],e.prototype,"objectIds",void 0),i([s({type:d.apiValues,json:{read:d.read,write:{writer:d.write,overridePolicy(t){return{enabled:t!=null&&this.geometry!=null}}}}})],e.prototype,"units",void 0),i([s({type:j,json:{write:!0}})],e.prototype,"timeExtent",void 0),e=m=i([w("esri.layers.support.FeatureFilter")],e);const _=e;export{_ as default}; diff --git a/custom-toc-highlight/assets/FeatureLayer-BrRKw5Si-D6Z5CL70.js b/custom-toc-highlight/assets/FeatureLayer-BrRKw5Si-DuA2fyE_.js similarity index 80% rename from custom-toc-highlight/assets/FeatureLayer-BrRKw5Si-D6Z5CL70.js rename to custom-toc-highlight/assets/FeatureLayer-BrRKw5Si-DuA2fyE_.js index 1e128197..99842e88 100644 --- a/custom-toc-highlight/assets/FeatureLayer-BrRKw5Si-D6Z5CL70.js +++ b/custom-toc-highlight/assets/FeatureLayer-BrRKw5Si-DuA2fyE_.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-2gXi28Q5.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./utils-BVWK2jiA-Btpo3M9u.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./jsonContext-BA8GHqVk-CWQlLGSw.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./saveUtils-CIYk-dsQ-VGcOewby.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./fetchService-DbaKmJhP-W7rGyykJ.js","./FeatureLayerSource-k4WMYop1-BFUwA-tw.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-Dycut332.js","./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js","./vec32-D9GsKZ1t-BjayBdwt.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-P7VLSnKi.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-DoQndDth.js","./mat4-DX7gBViE-DVqdGrVU.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BrXZAXDf.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-BcQn3A1C.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-9sQxfkoa-KicvrT8N.js","./utils-Bq23Xwmj--_SaacS5.js","./EditBusLayer-Df29OyJh-DkVkxUAl.js","./clientSideDefaults-BqqayPct-B-0mBem3.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-B8khefoW.js","./Query-BrwMGK8U-DoFNfkjX.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./executeForIds-Z1gkLduF-D8DZG8qZ.js","./query-DFW9-NG_-gbjlxRZk.js","./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js","./pbf-D-y3_eZO-DQKnyfOm.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-B5UMbu5B.js","./executeQueryPBF-o8010HS9-BgTBXvCY.js","./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js","./FeatureSet-BkVNthuN-CwS44--W.js","./executeQueryJSON-CcHnccia-BW7_NQxl.js","./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js","./jsonUtils-C64Zfu7c-CitE8NjK.js","./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js","./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js","./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js","./colorRamps-q0bZVhs2-DQZn2xZS.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-23qzp7zg.js","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./lengthUtils-DKpMe5qR-C2NPRwwl.js","./styleUtils-BtpNqZyT-D2Hj1Rgz.js","./LRUCache-C3erQTWv-0wD6drRf.js","./Version-CoKzbupV-9-gg6ENz.js","./FieldsIndex-HmzMbJQG-DZuFWLvd.js","./UnknownTimeZone-C--TOcPG-D3CAoWPX.js","./OverrideHelper-DWRbVlj1-BZq72sbX.js","./colorUtils-Cthpxcks-ZRnr1H1b.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-B3hR8LxB.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-B-lEhyoX.js","./heatmapUtils-seiMkkkR-Cj1KmweL.js","./RelationshipQuery-DJsz3K0U-yAwL-qLW.js","./editsZScale-BDsX6vv--CttUpViY.js","./TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js","./BinsQuery-DjwQZqB8-DL4eLh1p.js","./queryUtils-Brxu6254-PPvpiP5X.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); -import{_ as b}from"./main-ugzBrWNm.js";import{aB as W,at as H,ag as j,o as m,n as K,l as z,K as Z,a1 as F,dJ as R,v as o,dz as B,bi as $,bG as U,S as n,i as E,aa as Y,J as X,bp as ee,W as te,b0 as re,dK as I,a as ie,bX as P,bT as x,a_ as oe,bV as se,f as ae,dL as ne,a0 as y,dM as le,ac as D,P as O,bD as ue,bL as pe,ad as de,j as ye}from"./story-BfX8CRfG.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{o as ce,m as he,u as me}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{m as fe}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{i as ge,e as be,Y as we,s as G,K as _e,_ as ve,r as Te,X as Se,V as Fe}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{$ as Ie,H as Ee}from"./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js";import{D as De}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{q as Oe}from"./workers-PiCjreoO-idkDTJa3.js";import{c as Le}from"./editsZScale-BDsX6vv--CttUpViY.js";import{n as A}from"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import{O as V}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{n as Ce}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{a as qe}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{u as je}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as Me}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{C as Re}from"./EditBusLayer-Df29OyJh-DkVkxUAl.js";import{l as $e}from"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import{v as Pe}from"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import{E as xe}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{p as Ge}from"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import{C as Ae}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as Je}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as Ne}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{x as Ve}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{I as ke,i as Qe,o as We}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{c as He,l as Ke,n as ze,r as Ze,p as Be,Q as Ue,$ as Ye,U as Xe,Z as et,t as tt,_ as rt,z as it,f as ot,s as st,o as at,i as nt,B as lt,H as ut,K as pt,X as dt,W as yt,Y as ct,m as ht,e as mt,k as J}from"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import{p as k}from"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import{y as Q}from"./FeatureType-C9hJmS6_-BXWT6QCe.js";import{f as ft}from"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import{C as gt,q as L}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{x as bt}from"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import{w as wt}from"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import{a as _t}from"./versionUtils-LZYZz-38-DxOZEoAg.js";import{b as vt,K as Tt}from"./Query-BrwMGK8U-DoFNfkjX.js";import{g as St}from"./styleUtils-ChrJTYIw-BfDrXrWd.js";import{w as Ft}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import{o as It}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{E as T}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import"./Relationship-PyhUibYK-BgFx3_5x.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";let Et=0,f=class extends W.LoadableMixin(H(j)){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.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 r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);A(e,this.layer.spatialReference,r);const i=V.fromJSON(r);if(!this._requiresClientGraphicMapping())return i;const a=this.layer.objectIdField;for(const l of i.features){const u=l.attributes[a],p=this._idToClientGraphic.get(u);p&&(l.geometry=p.geometry)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new m("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return A(e,this.layer.spatialReference,r),r}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(r=>({count:r.count,extent:K.fromJSON(r.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new m("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let r=null;const i=[],a=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const l=d=>"objectId"in d&&d.objectId!=null?d.objectId:"attributes"in d&&d.attributes[t]!=null?d.attributes[t]:null;if(e.addFeatures&&(r=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const d of e.deleteFeatures){const g=l(d);g!=null&&i.push(g)}const u=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const d of e.updateFeatures)if(a.push(this._serializeFeature(d)),u){const g=l(d);g!=null&&u.set(g,d)}}Le(r?r.features:null,a,this.layer.spatialReference);const{fullExtent:p,featureEditResults:h}=await this._connection.invoke("applyEdits",{adds:r?r.features:[],updates:a,deletes:i});return this.fullExtent=p,r&&r.finish(h.uidToObjectId),this._updateClientGraphicIds(u,h),this._createEditsResult(h)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const r=[];for(const{geometry:i}of e)i==null||i.type!=="mesh"||i.hasExtent||i.loaded||r.push(i.load({signal:t}));r.length&&await Promise.all(r)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const r of t.updateResults){if(!r.success)continue;const i=e.get(r.objectId);i!=null&&this._addIdToClientGraphic(i)}for(const r of t.deleteResults)r.success&&this._idToClientGraphic.delete(r.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 m("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,r=new Array(e.length);let i=null;for(let l=0;l{F.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),_.preventDefault()}));const g={features:d.features,fields:t?.map(_=>_.toJSON()),geometryType:R.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&a,hasZ:this._layerOrSourceGeometryType==="mesh"||l,objectIdField:i,spatialReference:h?null:r&&r.toJSON(),timeInfo:u?.toJSON()??null,dateFieldsTimeZone:p},w=await this._connection.invoke("load",g,{signal:e});for(const _ of w.warnings)F.getLogger(this.layer).warn("#load()",`${_.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:_});w.featureErrors.length&&F.getLogger(this.layer).warn("#load()",`Encountered ${w.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:w.featureErrors});const M=w.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(M.geometryType=R.toJSON(d.inferredGeometryType)),this.sourceJSON=M,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),d.finish(w.assignedObjectIds)}};o([B({Type:$,ensureType:U($)})],f.prototype,"itemType",void 0),o([n()],f.prototype,"type",void 0),o([n({constructOnly:!0})],f.prototype,"layer",void 0),o([n({readOnly:!0})],f.prototype,"_workerGeometryType",null),o([n()],f.prototype,"sourceJSON",void 0),f=o([E("esri.layers.graphics.sources.MemorySource")],f);let v=class extends ye{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};o([n()],v.prototype,"updating",void 0),o([n()],v.prototype,"status",void 0),v=o([E("esri.layers.support.PublishingInfo")],v);const Dt=v,Ot=Symbol(),Lt=e=>{var t;let r=class extends e{constructor(){super(...arguments),this[t]=!0}get publishingInfo(){if(this.destroyed)return null;const i=this._get("publishingInfo");if(i)return i;const a=new Dt;return this._checkPublishingStatus(a),a}_checkPublishingStatus(i){let a=0;const l=async p=>{let h;i.updating=!0;try{h=await this.fetchPublishingStatus()}catch{h="unavailable"}h!=="published"&&h!=="unavailable"||(i.status==="publishing"&&this.refresh(),u.remove()),i.status=h,i.updating=!1,u.removed||(a=setTimeout(l,p,p+125))},u={removed:!1,remove(){this.removed=!0,clearTimeout(a)}};this.when().catch(()=>u.remove()),l(250),this.addHandles(u)}};return t=Ot,o([n({readOnly:!0,clonable:!1})],r.prototype,"publishingInfo",null),r=o([E("esri.layers.mixins.PublishableLayer")],r),r},c="FeatureLayer";function S(e,t){return new m("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function N(e){return e&&e instanceof j}const C=ft();function q(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let s=class extends Ie(Pe($e(Lt(Re(je(Ge(Ve(Ne(Je(qe(xe(Ae(fe(Me(Ce(Y(De))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,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.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=X.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),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,this._debouncedSaveOperations=ee(async(t,r,i)=>{const{save:a,saveAs:l}=await b(()=>import("./featureLayerUtils-BlPdhYbm-2gXi28Q5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);switch(t){case T.SAVE:return a(this,r);case T.SAVE_AS:return l(this,i,r)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(i=>this.initLayerProperties(i))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(te).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const i=await this._fetchFirstValidLayerId(t);i!=null&&(this.layerId=i)}if(!this.url&&!this._hasMemorySource())throw new m("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(()=>He(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}warnInvisibleDrapedSymbols(){this.elevationInfo?.mode==="on-the-ground"&&this.renderer?.type==="simple"&&this.renderer.symbol?.type==="polygon-3d"&&this.renderer.symbol.symbolLayers.some(e=>e.type==="fill"&&e.material!=null&&(!e.material.color||e.material.color.a*this.opacityk.fromJSON(l)),this._fixTemplates(e,i),this._fixTemplates(e,a),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const a=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?ke(this.url,r):r;let l=r;if(!l&&this.url){const u=Qe(this.url);u!=null&&(l=u.title)}return l?(this.sublayerTitleMode==="item-title-and-service-name"&&a&&a!==l&&(l=a+" - "+l),We(l)):void 0}if(this.sublayerTitleMode==="item-title"&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(a=>a.name.toLowerCase()===r);i&&(r=i.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,a=r?.editorField;return e?.map(l=>(l=Q.fromJSON(l),this._fixTemplates(l.templates,i),this._fixTemplates(l.templates,a),l))}readVisible(e,t){return t.layerDefinition?.defaultVisibility!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){const r=await Ue(this,e,t,c);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await Ye(this,e,t,r,c);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return Xe(this,e,t)}async uploadAssets(e,t){return et(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Ft(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await oe(b(()=>import("./FeatureLayerSource-k4WMYop1-BFUwA-tw.js"),__vite__mapDeps([16,2,3,1,4,17,18,19,20,21,22,23,11,12,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,14,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=tt(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,r=se(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await rt(this,e,t,c);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return it(this,e,c)}getFeatureType(e){return ot(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=!!this.subtypes?.length;if(i&&!t?.excludeImpliedDomains){const p=st(this,e);if(p)return p}const a=i&&at(this,r);if(a){const p=a?.domains?.[e];return p?.type==="inherited"?this._getLayerDomain(e):p}const l=this.getFeatureType(r),u=this._getLayerDomain(e);if(l){const p=l.domains&&l.domains[e];if(p&&p?.type!=="inherited")return p}if(u)return u;if(!t?.excludeImpliedDomains){const p=nt(this,e);if(p)return p}return null}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return lt(this,e,t,c)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(vt.from(e)??r.createQuery(),t);if(i?.features)for(const a of i.features)a.layer=a.sourceLayer=r;return i}async queryObjectIds(e,t){return ut(this,e,t,c)}async queryFeatureCount(e,t){return pt(this,e,t,c)}async queryExtent(e,t){return dt(this,e,t,c)}async queryRelatedFeatures(e,t){return yt(this,e,t,c)}async queryRelatedFeaturesCount(e,t){return ct(this,e,t,c)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopFeatures capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url),l=await r.queryTopFeatures(a.default.from(e),t);if(l?.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryBins||!i?.operations?.supportsQueryBins)throw new m(c,"Layer source does not support queryBins capability");ht(e,i,c);const a=await b(()=>import("./BinsQuery-DjwQZqB8-DL4eLh1p.js"),__vite__mapDeps([81,1,2,3,4,82,11,12,32,33,34,35,83,41,42,43,44]),import.meta.url),l=await r.queryBins(a.default.from(e),t);if(l.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopObjectIds capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopObjectIds(a.default.from(e),t)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopExtents capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopExtents(a.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryFeatureCount capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopCount(a.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||e.type==="Feature Collection")&&(this.resourceInfo=e),r){const i=r.layers;i&&i.length===1&&(super.read(i[0],t),r.showLegend!=null&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:a}=t;if(this.dynamicDataSource)return a?.push(S(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if((r==="web-map"||r==="web-scene")&&i!=="tables")return a?.push(S(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return a?.push(S(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&(r==="web-map"||r==="web-scene")&&i==="tables")return a?.push(S(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new m(c,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&(this.source?.type==="memory"||_t(this,e))}async save(e){return this._debouncedSaveOperations(T.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(T.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&r?.origin==="web-map"&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const a=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";I("layerDefinition.capabilities",a,t),r&&!i?.writeLayerSchema&&(t.capabilities=a)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return ae(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const r=t.data;if(r)return this.findFirstValidLayerId(r)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),x(this.renderer,this.fieldsIndex),ne(this.timeInfo,this.fieldsIndex),St(this,{origin:"service"})}async hasDataChanged(){return mt(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.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(r=>{const i=r.prototype?.attributes;i&&t&&delete i[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new m("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 m("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.addHandles([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.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};o([n(ge)],s.prototype,"attributeTableTemplate",void 0),o([y("service","capabilities")],s.prototype,"readCapabilities",null),o([n({json:{origins:{"web-scene":{write:!1}},write:!0}})],s.prototype,"charts",void 0),o([n({readOnly:!0})],s.prototype,"createQueryVersion",null),o([n({json:{read:{source:"layerDefinition.copyrightText"}}})],s.prototype,"copyright",void 0),o([n({json:{read:{source:"layerDefinition.displayField"}}})],s.prototype,"displayField",void 0),o([n({types:le,readOnly:!0})],s.prototype,"defaultSymbol",void 0),o([n({type:Tt})],s.prototype,"dynamicDataSource",void 0),o([n({type:Boolean})],s.prototype,"editingEnabled",null),o([y(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],s.prototype,"readEditingEnabled",null),o([y("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],s.prototype,"readEditingEnabledFromWebMap",null),o([D(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabled",null),o([D("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabledToWebMap",null),o([n({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),o([n({...C.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:q}}}}})],s.prototype,"fields",void 0),o([n(C.fieldsIndex)],s.prototype,"fieldsIndex",void 0),o([n({type:Ee,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],s.prototype,"formTemplate",void 0),o([n({json:{read:{source:"layerDefinition.extent"}}})],s.prototype,"fullExtent",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:q,writer(e,t,r){const i=e?J.toJSON(e):null;i&&I(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:J.read}}})],s.prototype,"geometryType",void 0),o([n({json:{read:{source:"layerDefinition.hasM"}}})],s.prototype,"hasM",void 0),o([n({json:{read:{source:"layerDefinition.hasZ"}}})],s.prototype,"hasZ",void 0),o([n(be)],s.prototype,"id",void 0),o([n({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"infoFor3D",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],s.prototype,"isTable",void 0),o([y("service","isTable",["type","geometryType"]),y("isTable",["layerDefinition.type","layerDefinition.geometryType"])],s.prototype,"readIsTable",null),o([D("web-map","isTable")],s.prototype,"writeIsTable",null),o([n(we)],s.prototype,"labelsVisible",void 0),o([n({type:[gt],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:L,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:{enabled:!0,layerContainerTypes:G}}},name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:!0}})],s.prototype,"labelingInfo",void 0),o([n((()=>{const e=O(_e);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,r,i){I(i,ue(t),r)}}},e})())],s.prototype,"opacity",void 0),o([n(ve)],s.prototype,"legendEnabled",void 0),o([n({type:["show","hide"],json:(()=>{const e=O(Te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],s.prototype,"listMode",void 0),o([y("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],s.prototype,"readGlobalIdField",null),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:q}}}}})],s.prototype,"objectIdField",void 0),o([y("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],s.prototype,"readObjectIdField",null),o([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],s.prototype,"operationalLayerType",void 0),o([n(C.outFields)],s.prototype,"outFields",void 0),o([n({readOnly:!0})],s.prototype,"parsedUrl",null),o([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([n(Se)],s.prototype,"popupEnabled",void 0),o([n({type:pe,json:{name:"popupInfo",write:!0}})],s.prototype,"popupTemplate",void 0),o([n({readOnly:!0})],s.prototype,"defaultPopupTemplate",null),o([n({types:he,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:me,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:G,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],s.prototype,"renderer",null),o([y("service","renderer",["drawingInfo.renderer","defaultSymbol"]),y("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],s.prototype,"readRenderer",null),o([n()],s.prototype,"resourceInfo",void 0),o([n((()=>{const e=O(Fe);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],s.prototype,"screenSizePerspectiveEnabled",void 0),o([n({clonable:!1})],s.prototype,"source",null),o([de("source")],s.prototype,"castSource",null),o([y("portal-item","source",["featureSet"]),y("web-map","source",["featureSet"])],s.prototype,"readSource",null),o([n({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],s.prototype,"spatialReference",void 0),o([n({type:Number})],s.prototype,"subtypeCode",void 0),o([n({type:[k]})],s.prototype,"templates",void 0),o([y("templates",["editFieldsInfo","creatorField","editorField","templates"])],s.prototype,"readTemplates",null),o([n({type:wt})],s.prototype,"timeInfo",void 0),o([n()],s.prototype,"title",void 0),o([y("service","title",["name"]),y("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],s.prototype,"readTitle",null),o([y("web-map","title",["layerDefinition.name","title"])],s.prototype,"readTitleFromWebMap",null),o([n({type:String})],s.prototype,"sublayerTitleMode",void 0),o([n({json:{read:!1}})],s.prototype,"type",void 0),o([n({type:String})],s.prototype,"typeIdField",void 0),o([y("service","typeIdField"),y("typeIdField",["layerDefinition.typeIdField"])],s.prototype,"readTypeIdField",null),o([n({type:[Q]})],s.prototype,"types",void 0),o([y("service","types",["types"]),y("types",["layerDefinition.types"])],s.prototype,"readTypes",null),o([n({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],s.prototype,"visible",void 0),o([y("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],s.prototype,"readVisible",null),s=o([E("esri.layers.FeatureLayer")],s);const si=s;export{si as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-B3ZkIjKd.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./utils-BVWK2jiA-i-Dn2Ad8.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CfFOGshS.js","./jsonContext-BA8GHqVk-BsXRY5es.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./saveUtils-CIYk-dsQ-Br9QCJTX.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./fetchService-DbaKmJhP-Ccg-phWf.js","./FeatureLayerSource-k4WMYop1-B19OqXBO.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js","./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js","./vec32-D9GsKZ1t-BPSFE14A.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-DrOy4LUr.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-Bbqagf1g.js","./mat4-DX7gBViE-6clJxb1Q.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BQk2dgMZ.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-C_ld1skV.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./EditBusLayer-Df29OyJh-OmdJOLws.js","./clientSideDefaults-BqqayPct-Vv2Kv9CL.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-D4f5dsGo.js","./Query-BrwMGK8U-BPr0_G9t.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./executeForIds-Z1gkLduF-CrWEksFG.js","./query-DFW9-NG_-C3TyGmiM.js","./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js","./pbf-D-y3_eZO-CpHdkhuD.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-B7zp5L1G.js","./executeQueryPBF-o8010HS9-B7Z-YQyg.js","./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js","./FeatureSet-BkVNthuN-DPQqwkNN.js","./executeQueryJSON-CcHnccia-M-vnTvKl.js","./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js","./jsonUtils-C64Zfu7c-BtrwAD3_.js","./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js","./RendererLegendOptions-K3md58-X-JLOOdHLz.js","./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js","./colorRamps-q0bZVhs2-BnivlaV9.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-tyrXoPjU.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js","./styleUtils-BtpNqZyT-Bnq2S5kK.js","./LRUCache-C3erQTWv-grHgYSP-.js","./Version-CoKzbupV-BDyz4v43.js","./FieldsIndex-HmzMbJQG-Du7S47uJ.js","./UnknownTimeZone-C--TOcPG-9of9030I.js","./OverrideHelper-DWRbVlj1-BnPmqHJ3.js","./colorUtils-Cthpxcks-cHaMZbaf.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-CiwW7WzR.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-DFYZs_ns.js","./heatmapUtils-seiMkkkR-CrSLbaQx.js","./RelationshipQuery-DJsz3K0U-BKFa46R1.js","./editsZScale-BDsX6vv--C-4n90TZ.js","./TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js","./BinsQuery-DjwQZqB8-Ch0CPJ5I.js","./queryUtils-Brxu6254-CDiE0zms.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); +import{_ as b}from"./main-QGPoLsvl.js";import{aB as W,at as H,ag as j,o as m,n as K,l as z,K as Z,a1 as F,dJ as R,v as o,dz as B,bi as $,bG as U,S as n,i as E,aa as Y,J as X,bp as ee,W as te,b0 as re,dK as I,a as ie,bX as P,bT as x,a_ as oe,bV as se,f as ae,dL as ne,a0 as y,dM as le,ac as D,P as O,bD as ue,bL as pe,ad as de,j as ye}from"./story-Doly9N9p.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{o as ce,m as he,u as me}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{m as fe}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{i as ge,e as be,Y as we,s as G,K as _e,_ as ve,r as Te,X as Se,V as Fe}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{$ as Ie,H as Ee}from"./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js";import{D as De}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{q as Oe}from"./workers-PiCjreoO-Dc6Tqm-o.js";import{c as Le}from"./editsZScale-BDsX6vv--C-4n90TZ.js";import{n as A}from"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import{O as V}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{n as Ce}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{a as qe}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{u as je}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as Me}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{C as Re}from"./EditBusLayer-Df29OyJh-OmdJOLws.js";import{l as $e}from"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import{v as Pe}from"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import{E as xe}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{p as Ge}from"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import{C as Ae}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as Je}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as Ne}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{x as Ve}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{I as ke,i as Qe,o as We}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{c as He,l as Ke,n as ze,r as Ze,p as Be,Q as Ue,$ as Ye,U as Xe,Z as et,t as tt,_ as rt,z as it,f as ot,s as st,o as at,i as nt,B as lt,H as ut,K as pt,X as dt,W as yt,Y as ct,m as ht,e as mt,k as J}from"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import{p as k}from"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import{y as Q}from"./FeatureType-C9hJmS6_-CNlvn5D1.js";import{f as ft}from"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import{C as gt,q as L}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{x as bt}from"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import{w as wt}from"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import{a as _t}from"./versionUtils-LZYZz-38-B8C5OAjF.js";import{b as vt,K as Tt}from"./Query-BrwMGK8U-BPr0_G9t.js";import{g as St}from"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import{w as Ft}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import{o as It}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{E as T}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";let Et=0,f=class extends W.LoadableMixin(H(j)){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){const e=this.layer?.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 r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);A(e,this.layer.spatialReference,r);const i=V.fromJSON(r);if(!this._requiresClientGraphicMapping())return i;const a=this.layer.objectIdField;for(const l of i.features){const u=l.attributes[a],p=this._idToClientGraphic.get(u);p&&(l.geometry=p.geometry)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new m("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const r=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return A(e,this.layer.spatialReference,r),r}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(r=>({count:r.count,extent:K.fromJSON(r.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new m("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let r=null;const i=[],a=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const l=d=>"objectId"in d&&d.objectId!=null?d.objectId:"attributes"in d&&d.attributes[t]!=null?d.attributes[t]:null;if(e.addFeatures&&(r=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const d of e.deleteFeatures){const g=l(d);g!=null&&i.push(g)}const u=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const d of e.updateFeatures)if(a.push(this._serializeFeature(d)),u){const g=l(d);g!=null&&u.set(g,d)}}Le(r?r.features:null,a,this.layer.spatialReference);const{fullExtent:p,featureEditResults:h}=await this._connection.invoke("applyEdits",{adds:r?r.features:[],updates:a,deletes:i});return this.fullExtent=p,r&&r.finish(h.uidToObjectId),this._updateClientGraphicIds(u,h),this._createEditsResult(h)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||e==null)return;const r=[];for(const{geometry:i}of e)i==null||i.type!=="mesh"||i.hasExtent||i.loaded||r.push(i.load({signal:t}));r.length&&await Promise.all(r)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const r of t.updateResults){if(!r.success)continue;const i=e.get(r.objectId);i!=null&&this._addIdToClientGraphic(i)}for(const r of t.deleteResults)r.success&&this._idToClientGraphic.delete(r.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 m("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,r=new Array(e.length);let i=null;for(let l=0;l{F.getLogger(this).error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),_.preventDefault()}));const g={features:d.features,fields:t?.map(_=>_.toJSON()),geometryType:R.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&a,hasZ:this._layerOrSourceGeometryType==="mesh"||l,objectIdField:i,spatialReference:h?null:r&&r.toJSON(),timeInfo:u?.toJSON()??null,dateFieldsTimeZone:p},w=await this._connection.invoke("load",g,{signal:e});for(const _ of w.warnings)F.getLogger(this.layer).warn("#load()",`${_.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:_});w.featureErrors.length&&F.getLogger(this.layer).warn("#load()",`Encountered ${w.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:w.featureErrors});const M=w.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(M.geometryType=R.toJSON(d.inferredGeometryType)),this.sourceJSON=M,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),d.finish(w.assignedObjectIds)}};o([B({Type:$,ensureType:U($)})],f.prototype,"itemType",void 0),o([n()],f.prototype,"type",void 0),o([n({constructOnly:!0})],f.prototype,"layer",void 0),o([n({readOnly:!0})],f.prototype,"_workerGeometryType",null),o([n()],f.prototype,"sourceJSON",void 0),f=o([E("esri.layers.graphics.sources.MemorySource")],f);let v=class extends ye{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};o([n()],v.prototype,"updating",void 0),o([n()],v.prototype,"status",void 0),v=o([E("esri.layers.support.PublishingInfo")],v);const Dt=v,Ot=Symbol(),Lt=e=>{var t;let r=class extends e{constructor(){super(...arguments),this[t]=!0}get publishingInfo(){if(this.destroyed)return null;const i=this._get("publishingInfo");if(i)return i;const a=new Dt;return this._checkPublishingStatus(a),a}_checkPublishingStatus(i){let a=0;const l=async p=>{let h;i.updating=!0;try{h=await this.fetchPublishingStatus()}catch{h="unavailable"}h!=="published"&&h!=="unavailable"||(i.status==="publishing"&&this.refresh(),u.remove()),i.status=h,i.updating=!1,u.removed||(a=setTimeout(l,p,p+125))},u={removed:!1,remove(){this.removed=!0,clearTimeout(a)}};this.when().catch(()=>u.remove()),l(250),this.addHandles(u)}};return t=Ot,o([n({readOnly:!0,clonable:!1})],r.prototype,"publishingInfo",null),r=o([E("esri.layers.mixins.PublishableLayer")],r),r},c="FeatureLayer";function S(e,t){return new m("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function N(e){return e&&e instanceof j}const C=ft();function q(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let s=class extends Ie(Pe($e(Lt(Re(je(Ge(Ve(Ne(Je(qe(xe(Ae(fe(Me(Ce(Y(De))))))))))))))))){constructor(...e){super(...e),this.attributeTableTemplate=null,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.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=X.WGS84,this.subtypeCode=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),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,this._debouncedSaveOperations=ee(async(t,r,i)=>{const{save:a,saveAs:l}=await b(()=>import("./featureLayerUtils-BlPdhYbm-B3ZkIjKd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);switch(t){case T.SAVE:return a(this,r);case T.SAVE_AS:return l(this,i,r)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(i=>this.initLayerProperties(i))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(te).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const i=await this._fetchFirstValidLayerId(t);i!=null&&(this.layerId=i)}if(!this.url&&!this._hasMemorySource())throw new m("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(()=>He(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}warnInvisibleDrapedSymbols(){this.elevationInfo?.mode==="on-the-ground"&&this.renderer?.type==="simple"&&this.renderer.symbol?.type==="polygon-3d"&&this.renderer.symbol.symbolLayers.some(e=>e.type==="fill"&&e.material!=null&&(!e.material.color||e.material.color.a*this.opacityk.fromJSON(l)),this._fixTemplates(e,i),this._fixTemplates(e,a),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){const a=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?ke(this.url,r):r;let l=r;if(!l&&this.url){const u=Qe(this.url);u!=null&&(l=u.title)}return l?(this.sublayerTitleMode==="item-title-and-service-name"&&a&&a!==l&&(l=a+" - "+l),We(l)):void 0}if(this.sublayerTitleMode==="item-title"&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(a=>a.name.toLowerCase()===r);i&&(r=i.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,a=r?.editorField;return e?.map(l=>(l=Q.fromJSON(l),this._fixTemplates(l.templates,i),this._fixTemplates(l.templates,a),l))}readVisible(e,t){return t.layerDefinition?.defaultVisibility!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){const r=await Ue(this,e,t,c);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await Ye(this,e,t,r,c);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return Xe(this,e,t)}async uploadAssets(e,t){return et(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Ft(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await oe(b(()=>import("./FeatureLayerSource-k4WMYop1-B19OqXBO.js"),__vite__mapDeps([16,2,3,1,4,17,18,19,20,21,22,23,11,12,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,14,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=tt(this);e.dynamicDataSource=this.dynamicDataSource;const t=this.subtypeCode!=null?`${this.subtypeField} = ${this.subtypeCode}`:null,r=se(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await rt(this,e,t,c);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return it(this,e,c)}getFeatureType(e){return ot(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=!!this.subtypes?.length;if(i&&!t?.excludeImpliedDomains){const p=st(this,e);if(p)return p}const a=i&&at(this,r);if(a){const p=a?.domains?.[e];return p?.type==="inherited"?this._getLayerDomain(e):p}const l=this.getFeatureType(r),u=this._getLayerDomain(e);if(l){const p=l.domains&&l.domains[e];if(p&&p?.type!=="inherited")return p}if(u)return u;if(!t?.excludeImpliedDomains){const p=nt(this,e);if(p)return p}return null}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return lt(this,e,t,c)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(vt.from(e)??r.createQuery(),t);if(i?.features)for(const a of i.features)a.layer=a.sourceLayer=r;return i}async queryObjectIds(e,t){return ut(this,e,t,c)}async queryFeatureCount(e,t){return pt(this,e,t,c)}async queryExtent(e,t){return dt(this,e,t,c)}async queryRelatedFeatures(e,t){return yt(this,e,t,c)}async queryRelatedFeaturesCount(e,t){return ct(this,e,t,c)}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopFeatures capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url),l=await r.queryTopFeatures(a.default.from(e),t);if(l?.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryBins||!i?.operations?.supportsQueryBins)throw new m(c,"Layer source does not support queryBins capability");ht(e,i,c);const a=await b(()=>import("./BinsQuery-DjwQZqB8-Ch0CPJ5I.js"),__vite__mapDeps([81,1,2,3,4,82,11,12,32,33,34,35,83,41,42,43,44]),import.meta.url),l=await r.queryBins(a.default.from(e),t);if(l.features)for(const u of l.features)u.layer=u.sourceLayer=this;return l}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopObjectIds capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopObjectIds(a.default.from(e),t)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryTopExtents capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopExtents(a.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new m(c,"Layer source does not support queryFeatureCount capability");const a=await b(()=>import("./TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js"),__vite__mapDeps([80,1,2,3,4,44]),import.meta.url);return r.queryTopCount(a.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||e.type==="Feature Collection")&&(this.resourceInfo=e),r){const i=r.layers;i&&i.length===1&&(super.read(i[0],t),r.showLegend!=null&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&(this.revert(["objectIdField","fields","timeInfo","dateFieldsTimeZone"],"service"),this.spatialReference||this.revert(["spatialReference"],"service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i,messages:a}=t;if(this.dynamicDataSource)return a?.push(S(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if((r==="web-map"||r==="web-scene")&&i!=="tables")return a?.push(S(this,`a table source can only be written to tables, not ${i}`)),null;if(this._hasMemorySource())return a?.push(S(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&(r==="web-map"||r==="web-scene")&&i==="tables")return a?.push(S(this,"using a non-table source cannot be written to tables in web maps or web scenes")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new m(c,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&(this.source?.type==="memory"||_t(this,e))}async save(e){return this._debouncedSaveOperations(T.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(T.SAVE_AS,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&r?.origin==="web-map"&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const a=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";I("layerDefinition.capabilities",a,t),r&&!i?.writeLayerSchema&&(t.capabilities=a)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstValidLayerId(e){return ae(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const r=t.data;if(r)return this.findFirstValidLayerId(r)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),x(this.renderer,this.fieldsIndex),ne(this.timeInfo,this.fieldsIndex),St(this,{origin:"service"})}async hasDataChanged(){return mt(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.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(r=>{const i=r.prototype?.attributes;i&&t&&delete i[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new m("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 m("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.addHandles([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.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){return Array.isArray(e.layers)&&e.layers.length>0?e.layers[0].id:Array.isArray(e.tables)&&e.tables.length>0?e.tables[0].id:void 0}};o([n(ge)],s.prototype,"attributeTableTemplate",void 0),o([y("service","capabilities")],s.prototype,"readCapabilities",null),o([n({json:{origins:{"web-scene":{write:!1}},write:!0}})],s.prototype,"charts",void 0),o([n({readOnly:!0})],s.prototype,"createQueryVersion",null),o([n({json:{read:{source:"layerDefinition.copyrightText"}}})],s.prototype,"copyright",void 0),o([n({json:{read:{source:"layerDefinition.displayField"}}})],s.prototype,"displayField",void 0),o([n({types:le,readOnly:!0})],s.prototype,"defaultSymbol",void 0),o([n({type:Tt})],s.prototype,"dynamicDataSource",void 0),o([n({type:Boolean})],s.prototype,"editingEnabled",null),o([y(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],s.prototype,"readEditingEnabled",null),o([y("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],s.prototype,"readEditingEnabledFromWebMap",null),o([D(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabled",null),o([D("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],s.prototype,"writeEditingEnabledToWebMap",null),o([n({readOnly:!0})],s.prototype,"effectiveEditingEnabled",null),o([n({...C.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:q}}}}})],s.prototype,"fields",void 0),o([n(C.fieldsIndex)],s.prototype,"fieldsIndex",void 0),o([n({type:Ee,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],s.prototype,"formTemplate",void 0),o([n({json:{read:{source:"layerDefinition.extent"}}})],s.prototype,"fullExtent",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:q,writer(e,t,r){const i=e?J.toJSON(e):null;i&&I(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:J.read}}})],s.prototype,"geometryType",void 0),o([n({json:{read:{source:"layerDefinition.hasM"}}})],s.prototype,"hasM",void 0),o([n({json:{read:{source:"layerDefinition.hasZ"}}})],s.prototype,"hasZ",void 0),o([n(be)],s.prototype,"id",void 0),o([n({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],s.prototype,"infoFor3D",void 0),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],s.prototype,"isTable",void 0),o([y("service","isTable",["type","geometryType"]),y("isTable",["layerDefinition.type","layerDefinition.geometryType"])],s.prototype,"readIsTable",null),o([D("web-map","isTable")],s.prototype,"writeIsTable",null),o([n(we)],s.prototype,"labelsVisible",void 0),o([n({type:[gt],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:L,write:!1},"web-scene":{name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:{enabled:!0,layerContainerTypes:G}}},name:"layerDefinition.drawingInfo.labelingInfo",read:L,write:!0}})],s.prototype,"labelingInfo",void 0),o([n((()=>{const e=O(_e);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,r,i){I(i,ue(t),r)}}},e})())],s.prototype,"opacity",void 0),o([n(ve)],s.prototype,"legendEnabled",void 0),o([n({type:["show","hide"],json:(()=>{const e=O(Te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],s.prototype,"listMode",void 0),o([y("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],s.prototype,"readGlobalIdField",null),o([n({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:q}}}}})],s.prototype,"objectIdField",void 0),o([y("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],s.prototype,"readObjectIdField",null),o([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],s.prototype,"operationalLayerType",void 0),o([n(C.outFields)],s.prototype,"outFields",void 0),o([n({readOnly:!0})],s.prototype,"parsedUrl",null),o([n({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),o([n(Se)],s.prototype,"popupEnabled",void 0),o([n({type:pe,json:{name:"popupInfo",write:!0}})],s.prototype,"popupTemplate",void 0),o([n({readOnly:!0})],s.prototype,"defaultPopupTemplate",null),o([n({types:he,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:me,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:G,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema})}}})],s.prototype,"renderer",null),o([y("service","renderer",["drawingInfo.renderer","defaultSymbol"]),y("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],s.prototype,"readRenderer",null),o([n()],s.prototype,"resourceInfo",void 0),o([n((()=>{const e=O(Fe);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],s.prototype,"screenSizePerspectiveEnabled",void 0),o([n({clonable:!1})],s.prototype,"source",null),o([de("source")],s.prototype,"castSource",null),o([y("portal-item","source",["featureSet"]),y("web-map","source",["featureSet"])],s.prototype,"readSource",null),o([n({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],s.prototype,"spatialReference",void 0),o([n({type:Number})],s.prototype,"subtypeCode",void 0),o([n({type:[k]})],s.prototype,"templates",void 0),o([y("templates",["editFieldsInfo","creatorField","editorField","templates"])],s.prototype,"readTemplates",null),o([n({type:wt})],s.prototype,"timeInfo",void 0),o([n()],s.prototype,"title",void 0),o([y("service","title",["name"]),y("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],s.prototype,"readTitle",null),o([y("web-map","title",["layerDefinition.name","title"])],s.prototype,"readTitleFromWebMap",null),o([n({type:String})],s.prototype,"sublayerTitleMode",void 0),o([n({json:{read:!1}})],s.prototype,"type",void 0),o([n({type:String})],s.prototype,"typeIdField",void 0),o([y("service","typeIdField"),y("typeIdField",["layerDefinition.typeIdField"])],s.prototype,"readTypeIdField",null),o([n({type:[Q]})],s.prototype,"types",void 0),o([y("service","types",["types"]),y("types",["layerDefinition.types"])],s.prototype,"readTypes",null),o([n({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],s.prototype,"visible",void 0),o([y("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],s.prototype,"readVisible",null),s=o([E("esri.layers.FeatureLayer")],s);const si=s;export{si as default}; diff --git a/custom-toc-highlight/assets/FeatureLayerBase-vvYyZTfh-j6CuO_ok.js b/custom-toc-highlight/assets/FeatureLayerBase-vvYyZTfh-DJHk8NKC.js similarity index 98% rename from custom-toc-highlight/assets/FeatureLayerBase-vvYyZTfh-j6CuO_ok.js rename to custom-toc-highlight/assets/FeatureLayerBase-vvYyZTfh-DJHk8NKC.js index d0972c8a..a2b02f1e 100644 --- a/custom-toc-highlight/assets/FeatureLayerBase-vvYyZTfh-j6CuO_ok.js +++ b/custom-toc-highlight/assets/FeatureLayerBase-vvYyZTfh-DJHk8NKC.js @@ -1 +1 @@ -import{v as e,S as i,i as p,aa as P,e as I,ad as Ie,a0 as l,ac as a,e3 as tt,bQ as re,bI as it,bH as ot,P as C,n as nt,ag as Fe,J as Te,d7 as st,dX as Oe,e4 as Pe,e5 as Me,e6 as Re,e7 as rt,a1 as pt,cs as Ze}from"./story-BfX8CRfG.js";import{n as lt,i as ze}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{$ as at,s as ut,n as dt,t as yt,Z as ct}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{M as mt}from"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import{x as ht,T as vt}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{k as xt,d as ft,O as X,n as wt,r as gt,a as bt}from"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import{v as jt}from"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import{p as St}from"./Relationship-PyhUibYK-BgFx3_5x.js";import{x as It}from"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";var pe;let T=pe=class extends I{constructor(t){super(t),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new pe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};e([i({type:String,json:{write:!0}})],T.prototype,"expression",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"name",void 0),e([i({type:["boolean","date","number","string"],json:{write:!0}})],T.prototype,"returnType",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"title",void 0),T=pe=e([p("esri.form.ExpressionInfo")],T);const Et=T;let O=class extends I{constructor(t){super(t),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};e([i({type:String,json:{write:!0}})],O.prototype,"description",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"label",void 0),e([i()],O.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"visibilityExpression",void 0),O=e([p("esri.form.elements.Element")],O);const M=O;let Z=class extends P(I){constructor(t){super(t),this.type=null}};e([i()],Z.prototype,"type",void 0),Z=e([p("esri.form.elements.inputs.attachments.Input")],Z);const F=Z,K=["any","capture","upload"];let D=class extends F{constructor(t){super(t),this.type="audio",this.inputMethod="any",this.maxDuration=null}};e([i({type:["audio"],readOnly:!0,json:{write:!0}})],D.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],D.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],D.prototype,"maxDuration",void 0),D=e([p("esri.form.elements.inputs.attachments.AudioInput")],D);const De=D;let $=class extends F{constructor(t){super(t),this.type="document",this.maxFileSize=null}};e([i({type:["document"],readOnly:!0,json:{write:!0}})],$.prototype,"type",void 0),e([i({type:Number,json:{write:!0}})],$.prototype,"maxFileSize",void 0),$=e([p("esri.form.elements.inputs.attachments.DocumentInput")],$);const Ve=$;let V=class extends F{constructor(t){super(t),this.type="image",this.inputMethod="any",this.maxImageSize=null}};e([i({type:["image"],readOnly:!0,json:{write:!0}})],V.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],V.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],V.prototype,"maxImageSize",void 0),V=e([p("esri.form.elements.inputs.attachments.ImageInput")],V);const Ne=V;let G=class extends F{constructor(t){super(t),this.type="signature",this.inputMethod="any"}};e([i({type:["signature"],readOnly:!0,json:{write:!0}})],G.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],G.prototype,"inputMethod",void 0),G=e([p("esri.form.elements.inputs.attachments.SignatureInput")],G);const Be=G;let N=class extends F{constructor(t){super(t),this.type="video",this.inputMethod="any",this.maxDuration=null}};e([i({type:["video"],readOnly:!0,json:{write:!0}})],N.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],N.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],N.prototype,"maxDuration",void 0),N=e([p("esri.form.elements.inputs.attachments.VideoInput")],N);const ke=N;function qe(t){return{nestableTypes:{base:F,key:"type",typeMap:{audio:De,document:Ve,image:Ne,signature:Be,video:ke}},allTypes:{base:F,key:"type",typeMap:{attachment:t,audio:De,document:Ve,image:Ne,signature:Be,video:ke}}}}function Ft(t,o,s){return t?t.map(n=>Ze(o.nestableTypes,n)):null}function Tt(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ot(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}let f=class extends F{constructor(t){super(t),this.type="attachment",this.attachmentAssociationType="exact",this.inputTypes=null}castInputs(t){return Ft(t,Y)}readInputs(t,o){return Tt(o.inputTypes,Y)}writeInputs(t,o){o.inputTypes=Ot(t,Y)}};e([i({type:["attachment"],readOnly:!0,json:{write:!0}})],f.prototype,"type",void 0),e([i({type:["any","exact","exactOrNone"],json:{write:!0}})],f.prototype,"attachmentAssociationType",void 0),e([i({json:{write:{isRequired:!0}}})],f.prototype,"inputTypes",void 0),e([Ie("inputTypes")],f.prototype,"castInputs",null),e([l("inputTypes")],f.prototype,"readInputs",null),e([a("inputTypes")],f.prototype,"writeInputs",null),f=e([p("esri.form.elements.inputs.attachments.AttachmentInput")],f);const Y=qe(f),Mt=f;var le;const Rt=qe(Mt);let d=le=class extends M{constructor(t){super(t),this.allowUserRename=!0,this.attachmentKeyword=null,this.displayFilename=!1,this.editableExpression=null,this.filenameExpression="{attachmentKeyword}_{now}",this.input=null,this.maxAttachmentCount=null,this.minAttachmentCount=null,this.type="attachment",this.useOriginalFilename=!0}clone(){return new le({allowUserRename:this.allowUserRename,attachmentKeyword:this.attachmentKeyword,description:this.description,displayFilename:this.displayFilename,editableExpression:this.editableExpression,filenameExpression:this.filenameExpression,input:this.input?.clone(),label:this.label,maxAttachmentCount:this.maxAttachmentCount,minAttachmentCount:this.minAttachmentCount,useOriginalFilename:this.useOriginalFilename,visibilityExpression:this.visibilityExpression})}};e([i({type:Boolean,json:{write:!0}})],d.prototype,"allowUserRename",void 0),e([i({type:String,json:{write:{isRequired:!0}}})],d.prototype,"attachmentKeyword",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"displayFilename",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"filenameExpression",void 0),e([i({types:Rt.allTypes,json:{read:{source:"inputType"},write:{target:"inputType",isRequired:!0}}})],d.prototype,"input",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"maxAttachmentCount",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"minAttachmentCount",void 0),e([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],d.prototype,"type",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"useOriginalFilename",void 0),d=le=e([p("esri.form.elements.AttachmentElement")],d);const Ae=d;let z=class extends I{constructor(t){super(t),this.type=null}};e([i()],z.prototype,"type",void 0),z=e([p("esri.form.elements.inputs.Input")],z);const E=z;let Q=class extends E{constructor(t){super(t),this.maxLength=null,this.minLength=0}};e([i({type:Number,json:{write:!0}})],Q.prototype,"maxLength",void 0),e([i({type:Number,json:{write:!0}})],Q.prototype,"minLength",void 0),Q=e([p("esri.form.elements.inputs.TextInput")],Q);const Ee=Q;var ae;let q=ae=class extends Ee{constructor(t){super(t),this.type="barcode-scanner"}clone(){return new ae({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["barcode-scanner"],json:{read:!1,write:!0}})],q.prototype,"type",void 0),q=ae=e([p("esri.form.elements.inputs.BarcodeScannerInput")],q);const Dt=q;var ue;let B=ue=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new ue({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};e([i({type:String,json:{write:!0}})],B.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],B.prototype,"showNoValueOption",void 0),e([i({type:["combo-box"],json:{read:!1,write:!0}})],B.prototype,"type",void 0),B=ue=e([p("esri.form.elements.inputs.ComboBoxInput")],B);const Vt=B;var de;function Ue(t){return t??null}function Le(t){return t??null}let x=de=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.type="date-picker"}readMax(t,o){return Ue(o.max)}writeMax(t,o){o.max=Le(t)}readMin(t,o){return Ue(o.min)}writeMin(t,o){o.min=Le(t)}clone(){return new de({max:this.max,min:this.min})}};e([i({type:String,json:{type:String,write:!0}})],x.prototype,"max",void 0),e([l("max")],x.prototype,"readMax",null),e([a("max")],x.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],x.prototype,"min",void 0),e([l("min")],x.prototype,"readMin",null),e([a("min")],x.prototype,"writeMin",null),e([i({type:["date-picker"],json:{read:!1,write:!0}})],x.prototype,"type",void 0),x=de=e([p("esri.form.elements.inputs.DatePickerInput")],x);const Nt=x;var ye;function ee(t){return t??null}function te(t){return t??null}let u=ye=class extends E{constructor(t){super(t),this.includeTimeOffset=!0,this.max=null,this.min=null,this.timeResolution="minutes",this.type="datetimeoffset-picker"}readMax(t,o){return ee(o.max)}writeMax(t,o){o.max=te(t)}readMin(t,o){return ee(o.min)}writeMin(t,o){o.min=te(t)}readTimeResolution(t,o){return ee(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=te(t)}clone(){return new ye({includeTimeOffset:this.includeTimeOffset,max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:Boolean,json:{write:!0}})],u.prototype,"includeTimeOffset",void 0),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"max",void 0),e([l("max")],u.prototype,"readMax",null),e([a("max")],u.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"min",void 0),e([l("min")],u.prototype,"readMin",null),e([a("min")],u.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"timeResolution",void 0),e([l("timeResolution")],u.prototype,"readTimeResolution",null),e([a("timeResolution")],u.prototype,"writeTimeResolution",null),e([i({type:["datetimeoffset-picker"],json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=ye=e([p("esri.form.elements.inputs.DateTimeOffsetPickerInput")],u);const Bt=u;var ce;function Ce(t){return t!=null?new Date(t):null}function $e(t){return t?t.getTime():null}let h=ce=class extends E{constructor(t){super(t),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(t,o){return Ce(o.max)}writeMax(t,o){o.max=$e(t)}readMin(t,o){return Ce(o.min)}writeMin(t,o){o.min=$e(t)}clone(){return new ce({includeTime:this.includeTime,max:this.max,min:this.min})}};e([i({type:Boolean,json:{write:!0}})],h.prototype,"includeTime",void 0),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"max",void 0),e([l("max")],h.prototype,"readMax",null),e([a("max")],h.prototype,"writeMax",null),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"min",void 0),e([l("min")],h.prototype,"readMin",null),e([a("min")],h.prototype,"writeMin",null),e([i({type:["datetime-picker"],json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=ce=e([p("esri.form.elements.inputs.DateTimePickerInput")],h);const kt=h;var me;let k=me=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new me({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};e([i({type:String,json:{write:!0}})],k.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],k.prototype,"showNoValueOption",void 0),e([i({type:["radio-buttons"],json:{read:!1,write:!0}})],k.prototype,"type",void 0),k=me=e([p("esri.form.elements.inputs.RadioButtonsInput")],k);const At=k;var he;let A=he=class extends E{constructor(t){super(t),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new he({offValue:this.offValue,onValue:this.onValue})}};e([i({type:[String,Number],json:{write:!0}})],A.prototype,"offValue",void 0),e([i({type:[String,Number],json:{write:!0}})],A.prototype,"onValue",void 0),e([i({type:["switch"],json:{read:!1,write:!0}})],A.prototype,"type",void 0),A=he=e([p("esri.form.elements.inputs.SwitchInput")],A);const Ut=A;var ve;let H=ve=class extends Ee{constructor(t){super(t),this.type="text-area"}clone(){return new ve({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-area"],json:{read:!1,write:!0}})],H.prototype,"type",void 0),H=ve=e([p("esri.form.elements.inputs.TextAreaInput")],H);const Lt=H;var xe;let J=xe=class extends Ee{constructor(t){super(t),this.type="text-box"}clone(){return new xe({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-box"],json:{read:!1,write:!0}})],J.prototype,"type",void 0),J=xe=e([p("esri.form.elements.inputs.TextBoxInput")],J);const Ct=J;var fe;function ie(t){return t??null}function oe(t){return t??null}let y=fe=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.timeResolution="minutes",this.type="time-picker"}readMax(t,o){return ie(o.max)}writeMax(t,o){o.max=oe(t)}readMin(t,o){return ie(o.min)}writeMin(t,o){o.min=oe(t)}readTimeResolution(t,o){return ie(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=oe(t)}clone(){return new fe({max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:String,json:{type:String,write:!0}})],y.prototype,"max",void 0),e([l("max")],y.prototype,"readMax",null),e([a("max")],y.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"min",void 0),e([l("min")],y.prototype,"readMin",null),e([a("min")],y.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"timeResolution",void 0),e([l("timeResolution")],y.prototype,"readTimeResolution",null),e([a("timeResolution")],y.prototype,"writeTimeResolution",null),e([i({type:["time-picker"],json:{read:!1,write:!0}})],y.prototype,"type",void 0),y=fe=e([p("esri.form.elements.inputs.TimePickerInput")],y);const $t=y,Gt={base:E,key:"type",typeMap:{"barcode-scanner":Dt,"combo-box":Vt,"date-picker":Nt,"datetime-picker":kt,"datetimeoffset-picker":Bt,"radio-buttons":At,switch:Ut,"text-area":Lt,"text-box":Ct,"time-picker":$t}};var we;let m=we=class extends M{constructor(t){super(t),this.domain=null,this.editable=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}clone(){return new we({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})}};e([i({types:lt,json:{read:{reader:ze},write:!0}})],m.prototype,"domain",void 0),e([i({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"hint",void 0),e([i({types:Gt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],m.prototype,"input",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"requiredExpression",void 0),e([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"valueExpression",void 0),m=we=e([p("esri.form.elements.FieldElement")],m);const Ge=m;var ge;let b=ge=class extends M{constructor(t){super(t),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new ge({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:C(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};e([i({type:Number,json:{write:!0}})],b.prototype,"displayCount",void 0),e([i({type:["list"],json:{write:!0}})],b.prototype,"displayType",void 0),e([i({type:String,json:{write:!0}})],b.prototype,"editableExpression",void 0),e([i({type:[tt],json:{write:!0}})],b.prototype,"orderByFields",void 0),e([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),e([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=ge=e([p("esri.form.elements.RelationshipElement")],b);const Qe=b;var be;let U=be=class extends M{constructor(t){super(t),this.text=null,this.textFormat="plain-text",this.type="text"}clone(){return new be({text:this.text,textFormat:this.textFormat,visibilityExpression:this.visibilityExpression})}};e([i({type:String,json:{write:!0}})],U.prototype,"text",void 0),e([i({type:String,json:{write:!0}})],U.prototype,"textFormat",void 0),e([i({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],U.prototype,"type",void 0),U=be=e([p("esri.form.elements.TextElement")],U);const We=U;function He(t){return{typesWithGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,group:t,relationship:Qe,text:We}},typesWithoutGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,relationship:Qe,text:We}}}}function Je(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ke(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}function _e(t,o,s=!0){return t?t.map(n=>Ze(s?o.typesWithGroup:o.typesWithoutGroup,n)):null}var je;let w=je=class extends M{constructor(t){super(t),this.elements=null,this.initialState="expanded",this.type="group"}castElements(t){return _e(t,ne,!1)}readElements(t,o){return Je(o.formElements,ne,!1)}writeElements(t,o){o.formElements=Ke(t,ne,!1)}clone(){return new je({description:this.description,elements:C(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([i({json:{write:!0}})],w.prototype,"elements",void 0),e([Ie("elements")],w.prototype,"castElements",null),e([l("elements",["formElements"])],w.prototype,"readElements",null),e([a("elements")],w.prototype,"writeElements",null),e([i({type:["collapsed","expanded"],json:{write:!0}})],w.prototype,"initialState",void 0),e([i({type:String,json:{read:!1,write:!0}})],w.prototype,"type",void 0),w=je=e([p("esri.form.elements.GroupElement")],w);const ne=He(w),Qt=w,Wt=t=>t.type==="field",Pt=t=>t.type==="group",Zt=t=>t.type==="text";var Se;const se=He(Qt);let v=Se=class extends I{constructor(t){super(t),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(t){return _e(t,se)}readElements(t,o){return Je(o.formElements,se)}writeElements(t,o){o.formElements=Ke(t,se)}clone(){return new Se({description:this.description,expressionInfos:C(this.expressionInfos),elements:C(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}async getFieldsUsed(t,o){const s=new Set,{description:n,elements:r,expressionInfos:c,title:R}=this;if(W(s,t,n),W(s,t,R),!r)return[];const et=zt(r,c).map(_=>st(s,t,_));await Promise.all(et);for(const _ of r)Xe(s,{fieldsIndex:t,relationships:o},_);return Array.from(s).sort()}};function Xe(t,o,s){const{fieldsIndex:n}=o;if(!n||n.fields.length!==t.size)switch(W(t,n,s.label),W(t,n,s.description),s.type){case"field":Oe(t,n,s.fieldName);break;case"group":s.elements.forEach(r=>Xe(t,o,r));break;case"relationship":if(o.relationships){const r=o.relationships.find(c=>c.id===s.relationshipId);r&&Oe(t,n,r.keyField)}Pe(t,n,s.orderByFields?.map(r=>r.field));break;case"text":W(t,n,s.text)}}function zt(t,o){if(!o||o.length===0)return[];const s=Ye(t),n=[];for(const r of o)s.has(r.name)&&n.push(r.expression);return n}function Ye(t){const o=new Set;for(const s of t)if(Me(o,s.visibilityExpression),!Zt(s)){if(Pt(s))Re(o,Ye(s.elements));else if(Me(o,s.editableExpression),Wt(s)){const{requiredExpression:n,valueExpression:r}=s;Re(o,[n,r])}}return o}function W(t,o,s){Pe(t,o,rt(s))}e([i({type:String,json:{write:!0}})],v.prototype,"description",void 0),e([i({json:{write:!0}})],v.prototype,"elements",void 0),e([Ie("elements")],v.prototype,"castElements",null),e([l("elements",["formElements"])],v.prototype,"readElements",null),e([a("elements")],v.prototype,"writeElements",null),e([i({type:[Et],json:{write:!0}})],v.prototype,"expressionInfos",void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],v.prototype,"preserveFieldValuesWhenHidden",void 0),e([i({type:String,json:{write:!0}})],v.prototype,"title",void 0),v=Se=e([p("esri.form.FormTemplate")],v);const si=v;let j=class extends P(I){constructor(t){super(t),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};e([i()],j.prototype,"creatorField",void 0),e([i()],j.prototype,"creationDateField",void 0),e([i()],j.prototype,"editorField",void 0),e([i()],j.prototype,"editDateField",void 0),e([i()],j.prototype,"realm",void 0),e([i(re("dateFieldsTimeReference",!0))],j.prototype,"timeZone",void 0),j=e([p("esri.layers.support.EditFieldsInfo")],j);const qt=j;let g=class extends P(I){constructor(t){super(t)}};e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"name",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"fields",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isAscending",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"indexType",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isUnique",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"description",void 0),g=e([p("esri.layers.support.FeatureIndex")],g);let L=class extends P(I){constructor(t){super(t),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};e([i({type:String,json:{read:{source:"shapeAreaFieldName"}}})],L.prototype,"shapeAreaField",void 0),e([i({type:String,json:{read:{source:"shapeLengthFieldName"}}})],L.prototype,"shapeLengthField",void 0),e([i({type:String,json:{read:t=>it.read(t)||ot.read(t)}})],L.prototype,"units",void 0),L=e([p("esri.layers.support.GeometryFieldsInfo")],L);const Ht=L;let S=class extends P(I){constructor(t){super(t),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(t){if(!t)return null;const o={};for(const s of Object.keys(t))o[s]=ze(t[s]);return o}writeDomains(t,o){if(!t)return;const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());o.domains=s}};e([i({type:Number,json:{write:!0}})],S.prototype,"code",void 0),e([i({type:Object,json:{write:!0}})],S.prototype,"defaultValues",void 0),e([i({json:{write:!0}})],S.prototype,"domains",void 0),e([l("domains")],S.prototype,"readDomains",null),e([a("domains")],S.prototype,"writeDomains",null),e([i({type:String,json:{write:!0}})],S.prototype,"name",void 0),S=e([p("esri.layers.support.Subtype")],S);const Jt=S,ri=t=>{let o=class extends t{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=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.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(Fe.ofType(g)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=Te.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:s}=this;if(s){const{query:r,operations:c,editing:R}=s;if(!r.supportsQueryByOthers||!r.supportsQueryByAnonymous||c.supportsEditing&&!(R.supportsUpdateByOthers&&R.supportsUpdateByAnonymous&&R.supportsDeleteByOthers&&R.supportsDeleteByAnonymous))return"load"}if(this.serviceDefinitionExpression?.toLowerCase().includes("current_user"))return"load";if(this.userHasUpdateItemPrivileges){if(ft(this))return"load";if(this.hasUpdateItemRestrictions)return s.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const n=this.editFieldsInfo;return(n?.creatorField||n?.editorField)&&s?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(s,n){return It(n,this.url)}readEditingInfo(s,n){const{editingInfo:r}=n;return r?{lastEditDate:r.lastEditDate!=null?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const s=this.capabilities;if(!s)return null;const n=C(s),{operations:r,editing:c}=n;return X(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),n):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=c.supportsDeleteByOthers=c.supportsGeometryUpdate=c.supportsUpdateByOthers=!0,n):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=c.supportsGeometryUpdate=!0),n)}readGlobalIdFieldFromService(s,n){return wt(n)}get hasFullEditingRestrictions(){const s=this.capabilities;if(!s||X(this))return!1;const{operations:n,editing:r}=s;return n.supportsEditing&&!(n.supportsAdd&&n.supportsDelete&&n.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const s=this.capabilities;if(!s)return!1;const{operations:n,editing:r}=s;return X(this)?!n.supportsQuery:!(n.supportsAdd&&n.supportsDelete&&n.supportsEditing&&n.supportsQuery&&n.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(s,n){return n.type==="Table"}readMaxScale(s,n){return n.effectiveMaxScale||s||0}readMinScale(s,n){return n.effectiveMinScale||s||0}readObjectIdFieldFromService(s,n){return gt(n)}readServiceDefinitionExpression(s,n){return n.definitionQuery||n.definitionExpression}set url(s){if(s==null)return void this._set("url",s);const n=ht({layer:this,url:s,nonStandardUrlAllowed:!0,logger:pt.getLogger(this)});this._set("url",n.url),n.layerId!=null&&this._set("layerId",n.layerId)}writeUrl(s,n,r,c){vt(this,s,null,n,c)}readVersion(s,n){return bt(n)}};return e([i({readOnly:!0})],o.prototype,"authenticationTriggerEvent",null),e([i({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],o.prototype,"copyright",void 0),e([i({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],o.prototype,"capabilities",void 0),e([l("service","capabilities")],o.prototype,"readCapabilitiesFromService",null),e([i(re("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),e([i({type:Boolean})],o.prototype,"datesInUnknownTimezone",void 0),e([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),e([i({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],o.prototype,"displayField",void 0),e([i({readOnly:!0,type:qt})],o.prototype,"editFieldsInfo",void 0),e([i({readOnly:!0})],o.prototype,"editingInfo",void 0),e([l("editingInfo")],o.prototype,"readEditingInfo",null),e([i({readOnly:!0})],o.prototype,"effectiveCapabilities",null),e([i((()=>{const s=C(at),n=s.json.origins;return n["web-map"]={read:!1,write:!1},n["portal-item"]={read:!1,write:!1},s})())],o.prototype,"elevationInfo",void 0),e([i({type:jt,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:ut}}}}})],o.prototype,"floorInfo",void 0),e([i({type:nt,json:{origins:{service:{read:{source:"extent"}}}}})],o.prototype,"fullExtent",void 0),e([i()],o.prototype,"gdbVersion",void 0),e([i({readOnly:!0,type:Ht,json:{read:{source:"geometryProperties"}}})],o.prototype,"geometryFieldsInfo",void 0),e([i({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:xt.read}}}})],o.prototype,"geometryType",void 0),e([i({type:String})],o.prototype,"globalIdField",void 0),e([l("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdFieldFromService",null),e([i({readOnly:!0})],o.prototype,"hasFullEditingRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasM",void 0),e([i({readOnly:!0})],o.prototype,"hasUpdateItemRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasZ",void 0),e([i({readOnly:!0,type:mt})],o.prototype,"heightModelInfo",void 0),e([i({type:Date})],o.prototype,"historicMoment",void 0),e([i({type:Fe.ofType(g),readOnly:!0})],o.prototype,"indexes",void 0),e([i({readOnly:!0})],o.prototype,"isTable",void 0),e([l("service","isTable",["type"])],o.prototype,"readIsTableFromService",null),e([i({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],o.prototype,"layerId",void 0),e([i(dt)],o.prototype,"maxScale",void 0),e([l("service","maxScale",["maxScale","effectiveMaxScale"])],o.prototype,"readMaxScale",null),e([i(yt)],o.prototype,"minScale",void 0),e([l("service","minScale",["minScale","effectiveMinScale"])],o.prototype,"readMinScale",null),e([i({type:String})],o.prototype,"objectIdField",void 0),e([l("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdFieldFromService",null),e([i(re("preferredTimeReference"))],o.prototype,"preferredTimeZone",void 0),e([i({type:[St],readOnly:!0})],o.prototype,"relationships",void 0),e([i({type:Boolean})],o.prototype,"returnM",void 0),e([i({type:Boolean})],o.prototype,"returnZ",void 0),e([i({readOnly:!0,json:{write:!1}})],o.prototype,"serverGens",void 0),e([i({readOnly:!0})],o.prototype,"serviceDefinitionExpression",void 0),e([l("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],o.prototype,"readServiceDefinitionExpression",null),e([i({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),e([i()],o.prototype,"sourceJSON",void 0),e([i({type:Te,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),e([i({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"subtypeField",void 0),e([i({type:[Jt],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"subtypes",void 0),e([i({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],o.prototype,"trackIdField",void 0),e([i(ct)],o.prototype,"url",null),e([a("url")],o.prototype,"writeUrl",null),e([i({json:{origins:{service:{read:!0}},read:!1}})],o.prototype,"version",void 0),e([l("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],o.prototype,"readVersion",null),o=e([p("esri.layers.mixins.FeatureLayerBase")],o),o};export{ri as $,si as H}; +import{v as e,S as i,i as p,aa as P,e as I,ad as Ie,a0 as l,ac as a,e3 as tt,bQ as re,bI as it,bH as ot,P as C,n as nt,ag as Fe,J as Te,d7 as st,dX as Oe,e4 as Pe,e5 as Me,e6 as Re,e7 as rt,a1 as pt,cs as Ze}from"./story-Doly9N9p.js";import{n as lt,i as ze}from"./Field-C6hA1tZj-CkWoRbmp.js";import{$ as at,s as ut,n as dt,t as yt,Z as ct}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{M as mt}from"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import{x as ht,T as vt}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{k as xt,d as ft,O as X,n as wt,r as gt,a as bt}from"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import{v as jt}from"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import{p as St}from"./Relationship-PyhUibYK-DN6K3ukS.js";import{x as It}from"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";var pe;let T=pe=class extends I{constructor(t){super(t),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new pe({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};e([i({type:String,json:{write:!0}})],T.prototype,"expression",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"name",void 0),e([i({type:["boolean","date","number","string"],json:{write:!0}})],T.prototype,"returnType",void 0),e([i({type:String,json:{write:!0}})],T.prototype,"title",void 0),T=pe=e([p("esri.form.ExpressionInfo")],T);const Et=T;let O=class extends I{constructor(t){super(t),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};e([i({type:String,json:{write:!0}})],O.prototype,"description",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"label",void 0),e([i()],O.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],O.prototype,"visibilityExpression",void 0),O=e([p("esri.form.elements.Element")],O);const M=O;let Z=class extends P(I){constructor(t){super(t),this.type=null}};e([i()],Z.prototype,"type",void 0),Z=e([p("esri.form.elements.inputs.attachments.Input")],Z);const F=Z,K=["any","capture","upload"];let D=class extends F{constructor(t){super(t),this.type="audio",this.inputMethod="any",this.maxDuration=null}};e([i({type:["audio"],readOnly:!0,json:{write:!0}})],D.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],D.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],D.prototype,"maxDuration",void 0),D=e([p("esri.form.elements.inputs.attachments.AudioInput")],D);const De=D;let $=class extends F{constructor(t){super(t),this.type="document",this.maxFileSize=null}};e([i({type:["document"],readOnly:!0,json:{write:!0}})],$.prototype,"type",void 0),e([i({type:Number,json:{write:!0}})],$.prototype,"maxFileSize",void 0),$=e([p("esri.form.elements.inputs.attachments.DocumentInput")],$);const Ve=$;let V=class extends F{constructor(t){super(t),this.type="image",this.inputMethod="any",this.maxImageSize=null}};e([i({type:["image"],readOnly:!0,json:{write:!0}})],V.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],V.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],V.prototype,"maxImageSize",void 0),V=e([p("esri.form.elements.inputs.attachments.ImageInput")],V);const Ne=V;let G=class extends F{constructor(t){super(t),this.type="signature",this.inputMethod="any"}};e([i({type:["signature"],readOnly:!0,json:{write:!0}})],G.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],G.prototype,"inputMethod",void 0),G=e([p("esri.form.elements.inputs.attachments.SignatureInput")],G);const Be=G;let N=class extends F{constructor(t){super(t),this.type="video",this.inputMethod="any",this.maxDuration=null}};e([i({type:["video"],readOnly:!0,json:{write:!0}})],N.prototype,"type",void 0),e([i({type:K,json:{write:!0}})],N.prototype,"inputMethod",void 0),e([i({type:Number,json:{write:!0}})],N.prototype,"maxDuration",void 0),N=e([p("esri.form.elements.inputs.attachments.VideoInput")],N);const ke=N;function qe(t){return{nestableTypes:{base:F,key:"type",typeMap:{audio:De,document:Ve,image:Ne,signature:Be,video:ke}},allTypes:{base:F,key:"type",typeMap:{attachment:t,audio:De,document:Ve,image:Ne,signature:Be,video:ke}}}}function Ft(t,o,s){return t?t.map(n=>Ze(o.nestableTypes,n)):null}function Tt(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ot(t,o,s){if(!t)return null;const n=o.nestableTypes.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}let f=class extends F{constructor(t){super(t),this.type="attachment",this.attachmentAssociationType="exact",this.inputTypes=null}castInputs(t){return Ft(t,Y)}readInputs(t,o){return Tt(o.inputTypes,Y)}writeInputs(t,o){o.inputTypes=Ot(t,Y)}};e([i({type:["attachment"],readOnly:!0,json:{write:!0}})],f.prototype,"type",void 0),e([i({type:["any","exact","exactOrNone"],json:{write:!0}})],f.prototype,"attachmentAssociationType",void 0),e([i({json:{write:{isRequired:!0}}})],f.prototype,"inputTypes",void 0),e([Ie("inputTypes")],f.prototype,"castInputs",null),e([l("inputTypes")],f.prototype,"readInputs",null),e([a("inputTypes")],f.prototype,"writeInputs",null),f=e([p("esri.form.elements.inputs.attachments.AttachmentInput")],f);const Y=qe(f),Mt=f;var le;const Rt=qe(Mt);let d=le=class extends M{constructor(t){super(t),this.allowUserRename=!0,this.attachmentKeyword=null,this.displayFilename=!1,this.editableExpression=null,this.filenameExpression="{attachmentKeyword}_{now}",this.input=null,this.maxAttachmentCount=null,this.minAttachmentCount=null,this.type="attachment",this.useOriginalFilename=!0}clone(){return new le({allowUserRename:this.allowUserRename,attachmentKeyword:this.attachmentKeyword,description:this.description,displayFilename:this.displayFilename,editableExpression:this.editableExpression,filenameExpression:this.filenameExpression,input:this.input?.clone(),label:this.label,maxAttachmentCount:this.maxAttachmentCount,minAttachmentCount:this.minAttachmentCount,useOriginalFilename:this.useOriginalFilename,visibilityExpression:this.visibilityExpression})}};e([i({type:Boolean,json:{write:!0}})],d.prototype,"allowUserRename",void 0),e([i({type:String,json:{write:{isRequired:!0}}})],d.prototype,"attachmentKeyword",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"displayFilename",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],d.prototype,"filenameExpression",void 0),e([i({types:Rt.allTypes,json:{read:{source:"inputType"},write:{target:"inputType",isRequired:!0}}})],d.prototype,"input",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"maxAttachmentCount",void 0),e([i({type:Number,json:{write:!0}})],d.prototype,"minAttachmentCount",void 0),e([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],d.prototype,"type",void 0),e([i({type:Boolean,json:{write:!0}})],d.prototype,"useOriginalFilename",void 0),d=le=e([p("esri.form.elements.AttachmentElement")],d);const Ae=d;let z=class extends I{constructor(t){super(t),this.type=null}};e([i()],z.prototype,"type",void 0),z=e([p("esri.form.elements.inputs.Input")],z);const E=z;let Q=class extends E{constructor(t){super(t),this.maxLength=null,this.minLength=0}};e([i({type:Number,json:{write:!0}})],Q.prototype,"maxLength",void 0),e([i({type:Number,json:{write:!0}})],Q.prototype,"minLength",void 0),Q=e([p("esri.form.elements.inputs.TextInput")],Q);const Ee=Q;var ae;let q=ae=class extends Ee{constructor(t){super(t),this.type="barcode-scanner"}clone(){return new ae({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["barcode-scanner"],json:{read:!1,write:!0}})],q.prototype,"type",void 0),q=ae=e([p("esri.form.elements.inputs.BarcodeScannerInput")],q);const Dt=q;var ue;let B=ue=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new ue({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};e([i({type:String,json:{write:!0}})],B.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],B.prototype,"showNoValueOption",void 0),e([i({type:["combo-box"],json:{read:!1,write:!0}})],B.prototype,"type",void 0),B=ue=e([p("esri.form.elements.inputs.ComboBoxInput")],B);const Vt=B;var de;function Ue(t){return t??null}function Le(t){return t??null}let x=de=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.type="date-picker"}readMax(t,o){return Ue(o.max)}writeMax(t,o){o.max=Le(t)}readMin(t,o){return Ue(o.min)}writeMin(t,o){o.min=Le(t)}clone(){return new de({max:this.max,min:this.min})}};e([i({type:String,json:{type:String,write:!0}})],x.prototype,"max",void 0),e([l("max")],x.prototype,"readMax",null),e([a("max")],x.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],x.prototype,"min",void 0),e([l("min")],x.prototype,"readMin",null),e([a("min")],x.prototype,"writeMin",null),e([i({type:["date-picker"],json:{read:!1,write:!0}})],x.prototype,"type",void 0),x=de=e([p("esri.form.elements.inputs.DatePickerInput")],x);const Nt=x;var ye;function ee(t){return t??null}function te(t){return t??null}let u=ye=class extends E{constructor(t){super(t),this.includeTimeOffset=!0,this.max=null,this.min=null,this.timeResolution="minutes",this.type="datetimeoffset-picker"}readMax(t,o){return ee(o.max)}writeMax(t,o){o.max=te(t)}readMin(t,o){return ee(o.min)}writeMin(t,o){o.min=te(t)}readTimeResolution(t,o){return ee(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=te(t)}clone(){return new ye({includeTimeOffset:this.includeTimeOffset,max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:Boolean,json:{write:!0}})],u.prototype,"includeTimeOffset",void 0),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"max",void 0),e([l("max")],u.prototype,"readMax",null),e([a("max")],u.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"min",void 0),e([l("min")],u.prototype,"readMin",null),e([a("min")],u.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],u.prototype,"timeResolution",void 0),e([l("timeResolution")],u.prototype,"readTimeResolution",null),e([a("timeResolution")],u.prototype,"writeTimeResolution",null),e([i({type:["datetimeoffset-picker"],json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=ye=e([p("esri.form.elements.inputs.DateTimeOffsetPickerInput")],u);const Bt=u;var ce;function Ce(t){return t!=null?new Date(t):null}function $e(t){return t?t.getTime():null}let h=ce=class extends E{constructor(t){super(t),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(t,o){return Ce(o.max)}writeMax(t,o){o.max=$e(t)}readMin(t,o){return Ce(o.min)}writeMin(t,o){o.min=$e(t)}clone(){return new ce({includeTime:this.includeTime,max:this.max,min:this.min})}};e([i({type:Boolean,json:{write:!0}})],h.prototype,"includeTime",void 0),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"max",void 0),e([l("max")],h.prototype,"readMax",null),e([a("max")],h.prototype,"writeMax",null),e([i({type:Date,json:{type:Number,write:!0}})],h.prototype,"min",void 0),e([l("min")],h.prototype,"readMin",null),e([a("min")],h.prototype,"writeMin",null),e([i({type:["datetime-picker"],json:{read:!1,write:!0}})],h.prototype,"type",void 0),h=ce=e([p("esri.form.elements.inputs.DateTimePickerInput")],h);const kt=h;var me;let k=me=class extends E{constructor(t){super(t),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new me({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};e([i({type:String,json:{write:!0}})],k.prototype,"noValueOptionLabel",void 0),e([i({type:Boolean,json:{write:!0}})],k.prototype,"showNoValueOption",void 0),e([i({type:["radio-buttons"],json:{read:!1,write:!0}})],k.prototype,"type",void 0),k=me=e([p("esri.form.elements.inputs.RadioButtonsInput")],k);const At=k;var he;let A=he=class extends E{constructor(t){super(t),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new he({offValue:this.offValue,onValue:this.onValue})}};e([i({type:[String,Number],json:{write:!0}})],A.prototype,"offValue",void 0),e([i({type:[String,Number],json:{write:!0}})],A.prototype,"onValue",void 0),e([i({type:["switch"],json:{read:!1,write:!0}})],A.prototype,"type",void 0),A=he=e([p("esri.form.elements.inputs.SwitchInput")],A);const Ut=A;var ve;let H=ve=class extends Ee{constructor(t){super(t),this.type="text-area"}clone(){return new ve({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-area"],json:{read:!1,write:!0}})],H.prototype,"type",void 0),H=ve=e([p("esri.form.elements.inputs.TextAreaInput")],H);const Lt=H;var xe;let J=xe=class extends Ee{constructor(t){super(t),this.type="text-box"}clone(){return new xe({maxLength:this.maxLength,minLength:this.minLength})}};e([i({type:["text-box"],json:{read:!1,write:!0}})],J.prototype,"type",void 0),J=xe=e([p("esri.form.elements.inputs.TextBoxInput")],J);const Ct=J;var fe;function ie(t){return t??null}function oe(t){return t??null}let y=fe=class extends E{constructor(t){super(t),this.max=null,this.min=null,this.timeResolution="minutes",this.type="time-picker"}readMax(t,o){return ie(o.max)}writeMax(t,o){o.max=oe(t)}readMin(t,o){return ie(o.min)}writeMin(t,o){o.min=oe(t)}readTimeResolution(t,o){return ie(o.timeResolution)}writeTimeResolution(t,o){o.timeResolution=oe(t)}clone(){return new fe({max:this.max,min:this.min,timeResolution:this.timeResolution})}};e([i({type:String,json:{type:String,write:!0}})],y.prototype,"max",void 0),e([l("max")],y.prototype,"readMax",null),e([a("max")],y.prototype,"writeMax",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"min",void 0),e([l("min")],y.prototype,"readMin",null),e([a("min")],y.prototype,"writeMin",null),e([i({type:String,json:{type:String,write:!0}})],y.prototype,"timeResolution",void 0),e([l("timeResolution")],y.prototype,"readTimeResolution",null),e([a("timeResolution")],y.prototype,"writeTimeResolution",null),e([i({type:["time-picker"],json:{read:!1,write:!0}})],y.prototype,"type",void 0),y=fe=e([p("esri.form.elements.inputs.TimePickerInput")],y);const $t=y,Gt={base:E,key:"type",typeMap:{"barcode-scanner":Dt,"combo-box":Vt,"date-picker":Nt,"datetime-picker":kt,"datetimeoffset-picker":Bt,"radio-buttons":At,switch:Ut,"text-area":Lt,"text-box":Ct,"time-picker":$t}};var we;let m=we=class extends M{constructor(t){super(t),this.domain=null,this.editable=null,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}clone(){return new we({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})}};e([i({types:lt,json:{read:{reader:ze},write:!0}})],m.prototype,"domain",void 0),e([i({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"editableExpression",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"hint",void 0),e([i({types:Gt,json:{read:{source:"inputType"},write:{target:"inputType"}}})],m.prototype,"input",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"requiredExpression",void 0),e([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],m.prototype,"valueExpression",void 0),m=we=e([p("esri.form.elements.FieldElement")],m);const Ge=m;var ge;let b=ge=class extends M{constructor(t){super(t),this.displayCount=null,this.displayType="list",this.editableExpression=null,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new ge({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editableExpression:this.editableExpression,label:this.label,orderByFields:C(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};e([i({type:Number,json:{write:!0}})],b.prototype,"displayCount",void 0),e([i({type:["list"],json:{write:!0}})],b.prototype,"displayType",void 0),e([i({type:String,json:{write:!0}})],b.prototype,"editableExpression",void 0),e([i({type:[tt],json:{write:!0}})],b.prototype,"orderByFields",void 0),e([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),e([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=ge=e([p("esri.form.elements.RelationshipElement")],b);const Qe=b;var be;let U=be=class extends M{constructor(t){super(t),this.text=null,this.textFormat="plain-text",this.type="text"}clone(){return new be({text:this.text,textFormat:this.textFormat,visibilityExpression:this.visibilityExpression})}};e([i({type:String,json:{write:!0}})],U.prototype,"text",void 0),e([i({type:String,json:{write:!0}})],U.prototype,"textFormat",void 0),e([i({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],U.prototype,"type",void 0),U=be=e([p("esri.form.elements.TextElement")],U);const We=U;function He(t){return{typesWithGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,group:t,relationship:Qe,text:We}},typesWithoutGroup:{base:M,key:"type",typeMap:{attachment:Ae,field:Ge,relationship:Qe,text:We}}}}function Je(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>n[r.type].fromJSON(r))}function Ke(t,o,s=!0){if(!t)return null;const n=s?o.typesWithGroup.typeMap:o.typesWithoutGroup.typeMap;return t.filter(r=>n[r.type]).map(r=>r.toJSON())}function _e(t,o,s=!0){return t?t.map(n=>Ze(s?o.typesWithGroup:o.typesWithoutGroup,n)):null}var je;let w=je=class extends M{constructor(t){super(t),this.elements=null,this.initialState="expanded",this.type="group"}castElements(t){return _e(t,ne,!1)}readElements(t,o){return Je(o.formElements,ne,!1)}writeElements(t,o){o.formElements=Ke(t,ne,!1)}clone(){return new je({description:this.description,elements:C(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};e([i({json:{write:!0}})],w.prototype,"elements",void 0),e([Ie("elements")],w.prototype,"castElements",null),e([l("elements",["formElements"])],w.prototype,"readElements",null),e([a("elements")],w.prototype,"writeElements",null),e([i({type:["collapsed","expanded"],json:{write:!0}})],w.prototype,"initialState",void 0),e([i({type:String,json:{read:!1,write:!0}})],w.prototype,"type",void 0),w=je=e([p("esri.form.elements.GroupElement")],w);const ne=He(w),Qt=w,Wt=t=>t.type==="field",Pt=t=>t.type==="group",Zt=t=>t.type==="text";var Se;const se=He(Qt);let v=Se=class extends I{constructor(t){super(t),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(t){return _e(t,se)}readElements(t,o){return Je(o.formElements,se)}writeElements(t,o){o.formElements=Ke(t,se)}clone(){return new Se({description:this.description,expressionInfos:C(this.expressionInfos),elements:C(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}async getFieldsUsed(t,o){const s=new Set,{description:n,elements:r,expressionInfos:c,title:R}=this;if(W(s,t,n),W(s,t,R),!r)return[];const et=zt(r,c).map(_=>st(s,t,_));await Promise.all(et);for(const _ of r)Xe(s,{fieldsIndex:t,relationships:o},_);return Array.from(s).sort()}};function Xe(t,o,s){const{fieldsIndex:n}=o;if(!n||n.fields.length!==t.size)switch(W(t,n,s.label),W(t,n,s.description),s.type){case"field":Oe(t,n,s.fieldName);break;case"group":s.elements.forEach(r=>Xe(t,o,r));break;case"relationship":if(o.relationships){const r=o.relationships.find(c=>c.id===s.relationshipId);r&&Oe(t,n,r.keyField)}Pe(t,n,s.orderByFields?.map(r=>r.field));break;case"text":W(t,n,s.text)}}function zt(t,o){if(!o||o.length===0)return[];const s=Ye(t),n=[];for(const r of o)s.has(r.name)&&n.push(r.expression);return n}function Ye(t){const o=new Set;for(const s of t)if(Me(o,s.visibilityExpression),!Zt(s)){if(Pt(s))Re(o,Ye(s.elements));else if(Me(o,s.editableExpression),Wt(s)){const{requiredExpression:n,valueExpression:r}=s;Re(o,[n,r])}}return o}function W(t,o,s){Pe(t,o,rt(s))}e([i({type:String,json:{write:!0}})],v.prototype,"description",void 0),e([i({json:{write:!0}})],v.prototype,"elements",void 0),e([Ie("elements")],v.prototype,"castElements",null),e([l("elements",["formElements"])],v.prototype,"readElements",null),e([a("elements")],v.prototype,"writeElements",null),e([i({type:[Et],json:{write:!0}})],v.prototype,"expressionInfos",void 0),e([i({type:Boolean,json:{default:!1,write:!0}})],v.prototype,"preserveFieldValuesWhenHidden",void 0),e([i({type:String,json:{write:!0}})],v.prototype,"title",void 0),v=Se=e([p("esri.form.FormTemplate")],v);const si=v;let j=class extends P(I){constructor(t){super(t),this.creatorField=null,this.creationDateField=null,this.editorField=null,this.editDateField=null,this.realm=null,this.timeZone=null}};e([i()],j.prototype,"creatorField",void 0),e([i()],j.prototype,"creationDateField",void 0),e([i()],j.prototype,"editorField",void 0),e([i()],j.prototype,"editDateField",void 0),e([i()],j.prototype,"realm",void 0),e([i(re("dateFieldsTimeReference",!0))],j.prototype,"timeZone",void 0),j=e([p("esri.layers.support.EditFieldsInfo")],j);const qt=j;let g=class extends P(I){constructor(t){super(t)}};e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"name",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"fields",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isAscending",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"indexType",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"isUnique",void 0),e([i({constructOnly:!0,json:{write:!0}})],g.prototype,"description",void 0),g=e([p("esri.layers.support.FeatureIndex")],g);let L=class extends P(I){constructor(t){super(t),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};e([i({type:String,json:{read:{source:"shapeAreaFieldName"}}})],L.prototype,"shapeAreaField",void 0),e([i({type:String,json:{read:{source:"shapeLengthFieldName"}}})],L.prototype,"shapeLengthField",void 0),e([i({type:String,json:{read:t=>it.read(t)||ot.read(t)}})],L.prototype,"units",void 0),L=e([p("esri.layers.support.GeometryFieldsInfo")],L);const Ht=L;let S=class extends P(I){constructor(t){super(t),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(t){if(!t)return null;const o={};for(const s of Object.keys(t))o[s]=ze(t[s]);return o}writeDomains(t,o){if(!t)return;const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());o.domains=s}};e([i({type:Number,json:{write:!0}})],S.prototype,"code",void 0),e([i({type:Object,json:{write:!0}})],S.prototype,"defaultValues",void 0),e([i({json:{write:!0}})],S.prototype,"domains",void 0),e([l("domains")],S.prototype,"readDomains",null),e([a("domains")],S.prototype,"writeDomains",null),e([i({type:String,json:{write:!0}})],S.prototype,"name",void 0),S=e([p("esri.layers.support.Subtype")],S);const Jt=S,ri=t=>{let o=class extends t{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=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.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(Fe.ofType(g)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=Te.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:s}=this;if(s){const{query:r,operations:c,editing:R}=s;if(!r.supportsQueryByOthers||!r.supportsQueryByAnonymous||c.supportsEditing&&!(R.supportsUpdateByOthers&&R.supportsUpdateByAnonymous&&R.supportsDeleteByOthers&&R.supportsDeleteByAnonymous))return"load"}if(this.serviceDefinitionExpression?.toLowerCase().includes("current_user"))return"load";if(this.userHasUpdateItemPrivileges){if(ft(this))return"load";if(this.hasUpdateItemRestrictions)return s.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const n=this.editFieldsInfo;return(n?.creatorField||n?.editorField)&&s?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(s,n){return It(n,this.url)}readEditingInfo(s,n){const{editingInfo:r}=n;return r?{lastEditDate:r.lastEditDate!=null?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const s=this.capabilities;if(!s)return null;const n=C(s),{operations:r,editing:c}=n;return X(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),n):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=c.supportsDeleteByOthers=c.supportsGeometryUpdate=c.supportsUpdateByOthers=!0,n):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=c.supportsGeometryUpdate=!0),n)}readGlobalIdFieldFromService(s,n){return wt(n)}get hasFullEditingRestrictions(){const s=this.capabilities;if(!s||X(this))return!1;const{operations:n,editing:r}=s;return n.supportsEditing&&!(n.supportsAdd&&n.supportsDelete&&n.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const s=this.capabilities;if(!s)return!1;const{operations:n,editing:r}=s;return X(this)?!n.supportsQuery:!(n.supportsAdd&&n.supportsDelete&&n.supportsEditing&&n.supportsQuery&&n.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(s,n){return n.type==="Table"}readMaxScale(s,n){return n.effectiveMaxScale||s||0}readMinScale(s,n){return n.effectiveMinScale||s||0}readObjectIdFieldFromService(s,n){return gt(n)}readServiceDefinitionExpression(s,n){return n.definitionQuery||n.definitionExpression}set url(s){if(s==null)return void this._set("url",s);const n=ht({layer:this,url:s,nonStandardUrlAllowed:!0,logger:pt.getLogger(this)});this._set("url",n.url),n.layerId!=null&&this._set("layerId",n.layerId)}writeUrl(s,n,r,c){vt(this,s,null,n,c)}readVersion(s,n){return bt(n)}};return e([i({readOnly:!0})],o.prototype,"authenticationTriggerEvent",null),e([i({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],o.prototype,"copyright",void 0),e([i({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],o.prototype,"capabilities",void 0),e([l("service","capabilities")],o.prototype,"readCapabilitiesFromService",null),e([i(re("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),e([i({type:Boolean})],o.prototype,"datesInUnknownTimezone",void 0),e([i({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),e([i({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],o.prototype,"displayField",void 0),e([i({readOnly:!0,type:qt})],o.prototype,"editFieldsInfo",void 0),e([i({readOnly:!0})],o.prototype,"editingInfo",void 0),e([l("editingInfo")],o.prototype,"readEditingInfo",null),e([i({readOnly:!0})],o.prototype,"effectiveCapabilities",null),e([i((()=>{const s=C(at),n=s.json.origins;return n["web-map"]={read:!1,write:!1},n["portal-item"]={read:!1,write:!1},s})())],o.prototype,"elevationInfo",void 0),e([i({type:jt,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:ut}}}}})],o.prototype,"floorInfo",void 0),e([i({type:nt,json:{origins:{service:{read:{source:"extent"}}}}})],o.prototype,"fullExtent",void 0),e([i()],o.prototype,"gdbVersion",void 0),e([i({readOnly:!0,type:Ht,json:{read:{source:"geometryProperties"}}})],o.prototype,"geometryFieldsInfo",void 0),e([i({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:xt.read}}}})],o.prototype,"geometryType",void 0),e([i({type:String})],o.prototype,"globalIdField",void 0),e([l("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdFieldFromService",null),e([i({readOnly:!0})],o.prototype,"hasFullEditingRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasM",void 0),e([i({readOnly:!0})],o.prototype,"hasUpdateItemRestrictions",null),e([i({type:Boolean,json:{origins:{service:{read:!0}}}})],o.prototype,"hasZ",void 0),e([i({readOnly:!0,type:mt})],o.prototype,"heightModelInfo",void 0),e([i({type:Date})],o.prototype,"historicMoment",void 0),e([i({type:Fe.ofType(g),readOnly:!0})],o.prototype,"indexes",void 0),e([i({readOnly:!0})],o.prototype,"isTable",void 0),e([l("service","isTable",["type"])],o.prototype,"readIsTableFromService",null),e([i({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],o.prototype,"layerId",void 0),e([i(dt)],o.prototype,"maxScale",void 0),e([l("service","maxScale",["maxScale","effectiveMaxScale"])],o.prototype,"readMaxScale",null),e([i(yt)],o.prototype,"minScale",void 0),e([l("service","minScale",["minScale","effectiveMinScale"])],o.prototype,"readMinScale",null),e([i({type:String})],o.prototype,"objectIdField",void 0),e([l("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdFieldFromService",null),e([i(re("preferredTimeReference"))],o.prototype,"preferredTimeZone",void 0),e([i({type:[St],readOnly:!0})],o.prototype,"relationships",void 0),e([i({type:Boolean})],o.prototype,"returnM",void 0),e([i({type:Boolean})],o.prototype,"returnZ",void 0),e([i({readOnly:!0,json:{write:!1}})],o.prototype,"serverGens",void 0),e([i({readOnly:!0})],o.prototype,"serviceDefinitionExpression",void 0),e([l("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],o.prototype,"readServiceDefinitionExpression",null),e([i({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),e([i()],o.prototype,"sourceJSON",void 0),e([i({type:Te,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),e([i({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"subtypeField",void 0),e([i({type:[Jt],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"subtypes",void 0),e([i({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],o.prototype,"trackIdField",void 0),e([i(ct)],o.prototype,"url",null),e([a("url")],o.prototype,"writeUrl",null),e([i({json:{origins:{service:{read:!0}},read:!1}})],o.prototype,"version",void 0),e([l("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],o.prototype,"readVersion",null),o=e([p("esri.layers.mixins.FeatureLayerBase")],o),o};export{ri as $,si as H}; diff --git a/custom-toc-highlight/assets/FeatureLayerSource-k4WMYop1-BFUwA-tw.js b/custom-toc-highlight/assets/FeatureLayerSource-k4WMYop1-B19OqXBO.js similarity index 81% rename from custom-toc-highlight/assets/FeatureLayerSource-k4WMYop1-BFUwA-tw.js rename to custom-toc-highlight/assets/FeatureLayerSource-k4WMYop1-B19OqXBO.js index 44efbac1..7b8ee035 100644 --- a/custom-toc-highlight/assets/FeatureLayerSource-k4WMYop1-BFUwA-tw.js +++ b/custom-toc-highlight/assets/FeatureLayerSource-k4WMYop1-B19OqXBO.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./uploadAssets-fBa6NH35-CH6CgKuA.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./External-D_wl4XAw-P7VLSnKi.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./meshSpatialReferenceScaleUtils-B1zR72Os-D-3pcUSm.js","./MeshTransform-C--IG09w-DoQndDth.js","./mat4-DX7gBViE-DVqdGrVU.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BrXZAXDf.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-BjayBdwt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./meshFeatureAttributes-BwKR5odo-BBs3r8iT.js","./convertMeshVertexSpace-BO7NR5uA-DNqSWhor.js","./MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js","./vertexSpaceConversion-CiKaVq_u-D2kQTb17.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js","./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./projectPointToVector-B2UUY9SE-BChPjj6-.js","./projection-BA9M1R7d-BYoCXVXt.js","./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js","./MeshLocalVertexSpace-BqgocsoS-Dycut332.js","./vec3-BazNroeq-PdcGTXFi.js","./BufferView-PQoE3GL7-Duht5lAO.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-BagfV9qf.js"])))=>i.map(i=>d[i]); -import{_ as M}from"./main-ugzBrWNm.js";import{aK as k,v as E,S as O,i as Q,aB as U,bp as P,ah as $,K as N,f,aq as v,o as S,n as V,bX as T,C,a3 as G,az as B,dK as H,W as z,a1 as x,J as K,aC as W,he as J,jd as X,bi as Z,g as Y}from"./story-BfX8CRfG.js";import{a as ee}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{y as te}from"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import{t as ae}from"./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js";import{S as se}from"./External-D_wl4XAw-P7VLSnKi.js";import{L as re,J as ie,Q as ne}from"./projection-BA9M1R7d-BYoCXVXt.js";import{V as oe}from"./MeshTransform-C--IG09w-DoQndDth.js";import{isFeatureIdentifierArrayWithGlobalId as ue,isFeatureIdentifierArrayWithObjectId as le}from"./editingSupport-gUqP9iyf-BcQn3A1C.js";import{d as de}from"./clientSideDefaults-BqqayPct-B-0mBem3.js";import{C as ce}from"./QueryTask-CwHwH2rS-B8khefoW.js";import{L as pe}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{c as A}from"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import{S as he}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{u as ye}from"./executeQueryJSON-CcHnccia-BW7_NQxl.js";import{c as me}from"./editsZScale-BDsX6vv--CttUpViY.js";import{b as fe}from"./Query-BrwMGK8U-DoFNfkjX.js";import{k as ge}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import{W as we,H as be,P as qe,j as Ie}from"./EditBusLayer-Df29OyJh-DkVkxUAl.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BrXZAXDf.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./executeForIds-Z1gkLduF-D8DZG8qZ.js";import"./query-DFW9-NG_-gbjlxRZk.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./executeQueryPBF-o8010HS9-BgTBXvCY.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";async function D(t,e,a){const{geometry:r}=e,s={...e.attributes};if(a!=null&&r?.type==="mesh"){const{transformFieldRoles:i}=a,{origin:n,spatialReference:o,vertexSpace:u}=r,d=r.transform??new oe,l=u.type==="local",p=t.spatialReference,q=p.isGeographic,I=W(p,o),h=re(o,p)&&ie(o,p);if(!(l&&q&&h||!l&&!q&&I))return null;const c=ne(n,o,p);if(c==null)return null;if(s[i.originX]=c.x,s[i.originY]=c.y,s[i.originZ]=c.z??0,d!=null){const{translation:R,scale:y,rotation:g}=d,m=l?1:J(o)/J(p);s[i.translationX]=R[0]*m,s[i.translationY]=R[2]*m,s[i.translationZ]=-R[1]*m,s[i.scaleX]=y[0],s[i.scaleY]=y[2],s[i.scaleZ]=y[1],s[i.rotationX]=g[0],s[i.rotationY]=g[2],s[i.rotationZ]=-g[1],s[i.rotationDeg]=g[3]}return{attributes:s}}return r==null?{attributes:s}:r.type==="mesh"||r.type==="extent"?null:{geometry:r.toJSON(),attributes:s}}async function Re(t,e){const a=await Promise.all((e.addAttachments??[]).map(i=>L(t,i))),r=await Promise.all((e.updateAttachments??[]).map(i=>L(t,i))),s=e.deleteAttachments??[];return a.length||r.length||s.length?{adds:a,updates:r,deletes:[...s]}:null}async function L(t,e){const{feature:a,attachment:r}=e,{globalId:s,name:i,contentType:n,data:o,uploadId:u}=r,d={globalId:s};if(a&&("attributes"in a?d.parentGlobalId=a.attributes?.[t.globalIdField]:a.globalId&&(d.parentGlobalId=a.globalId)),u)d.uploadId=u;else if(o){const l=await X(o);l&&(d.contentType=l.mediaType,d.data=l.data),o instanceof File&&(d.name=o.name)}return i&&(d.name=i),n&&(d.contentType=n),d}function Se(t,e,a){if(!e||e.length===0)return[];if(a&&ue(e))return e.map(s=>s.globalId);if(le(e))return e.map(s=>s.objectId);const r=a?t.globalIdField:t.objectIdField;return r?e.map(s=>s.getAttribute(r)):[]}function _e(t){const e=t?.assetMaps;if(e){for(const s of e.addResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`);for(const s of e.updateResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`)}const a=t?.attachments,r={addFeatureResults:t?.addResults?.map(b)??[],updateFeatureResults:t?.updateResults?.map(b)??[],deleteFeatureResults:t?.deleteResults?.map(b)??[],addAttachmentResults:a?.addResults?a.addResults.map(b):[],updateAttachmentResults:a?.updateResults?a.updateResults.map(b):[],deleteAttachmentResults:a?.deleteResults?a.deleteResults.map(b):[]};return t?.editMoment&&(r.editMoment=t.editMoment),r}function b(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 S("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function F(t,e){return new Z({attributes:t.attributes,geometry:Y({...t.geometry,spatialReference:e})})}function Ee(t,e){return{adds:t?.adds?.map(a=>F(a,e))||[],updates:t?.updates?.map(a=>({original:F(a[0],e),current:F(a[1],e)}))||[],deletes:t?.deletes?.map(a=>F(a,e))||[],spatialReference:e}}function Oe(t){const e=t.details.raw,a=+e.code,r=+e.extendedCode;return a===500&&(r===-2147217144||r===-2147467261)}const Ae=new k({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),Fe=new k({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let _=class extends U{constructor(t){super(t),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=P(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const a=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:a,updates:a?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(t){const e=this.layer.sourceJSON,a=this._fetchService(e,{...t}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,t)).then(()=>this._ensureLatestMetadata(t));return this.addResolvingPromise(a),Promise.resolve(this)}initialize(){this.addHandles([$(()=>{const t=this.layer;return t&&"lastEditsEventDate"in t?t.lastEditsEventDate:null},t=>this._handleLastEditsEventChange(t))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:t,parsedUrl:e,gdbVersion:a,spatialReference:r,fieldsIndex:s}=this.layer,i="infoFor3D"in this.layer?this.layer.infoFor3D:null,n="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,o=N("featurelayer-pbf")&&t?.query.supportsFormatPBF&&i==null,u=t?.operations?.supportsQueryAttachments??!1;return new ce({url:e.path,pbfSupported:o,fieldsIndex:s,infoFor3D:i,dynamicDataSource:n,gdbVersion:a,sourceSpatialReference:r,queryAttachmentsSupported:u})}async addAttachment(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/addAttachment",i=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(e,i.query);try{const o=await f(s,{body:n});return b(o.data.addAttachmentResult)}catch(o){throw this._createAttachmentErrorResult(r,o)}}async updateAttachment(t,e,a){await this.load();const{layer:r}=this;await A(r,"editing");const s=t.attributes[r.objectIdField],i=r.parsedUrl.path+"/"+s+"/updateAttachment",n=this._getLayerRequestOptions({query:{attachmentId:e}}),o=this._getFormDataForAttachment(a,n.query);try{const u=await f(i,{body:o});return b(u.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(s,u)}}async applyEdits(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r="infoFor3D"in a?a.infoFor3D:null,s=r!=null,i=s||(e?.globalIdUsed??!1),n=s?await this._uploadMeshesAndGetAssetMapEditsJSON(t):null,o=t.addFeatures?.map(w=>D(this.layer,w,r))??[],u=(await Promise.all(o)).filter(v),d=t.updateFeatures?.map(w=>D(this.layer,w,r))??[],l=(await Promise.all(d)).filter(v),p=Se(this.layer,t.deleteFeatures,i);me(u,l,a.spatialReference);const q=await Re(this.layer,t),I=a.capabilities.editing.supportsAsyncApplyEdits&&s,h=e?.gdbVersion||a.gdbVersion,c={gdbVersion:h,rollbackOnFailure:e?.rollbackOnFailureEnabled,useGlobalIds:i,returnEditMoment:e?.returnEditMoment,usePreviousEditMoment:e?.usePreviousEditMoment,async:I};await we(this.layer.url,h,!0);const R=be(this.layer.url,h||null);if(await qe(a.url,h,a.historicMoment))throw new S("feature-layer-source:historic-version","Editing a historic version is not allowed");e?.returnServiceEditsOption?(c.edits=JSON.stringify([{id:a.layerId,adds:u.length?u:null,updates:l.length?l:null,deletes:p.length?p:null,attachments:q,assetMaps:n}]),c.returnServiceEditsOption=Ae.toJSON(e?.returnServiceEditsOption),c.returnServiceEditsInSourceSR=e?.returnServiceEditsInSourceSR):(c.adds=u.length?JSON.stringify(u):null,c.updates=l.length?JSON.stringify(l):null,c.deletes=p.length?i?JSON.stringify(p):p.join(","):null,c.attachments=q&&JSON.stringify(q),c.assetMaps=n!=null?JSON.stringify(n):void 0);const y=this._getLayerRequestOptions({method:"post",query:c});R&&(y.authMode="immediate",y.query.returnEditMoment=!0,y.query.sessionId=Ie);const g=e?.returnServiceEditsOption?a.url:a.parsedUrl.path;let m;try{m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}catch(w){if(!Oe(w))throw w;y.authMode="immediate",m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}return this._createEditsResult(m)}async deleteAttachments(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/deleteAttachments";try{return(await f(s,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(b)}catch(i){throw this._createAttachmentErrorResult(r,i)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const a=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:i}=await f(`${s}/${r}`,a),{id:n,extent:o,fullExtent:u,timeExtent:d}=i,l=o||u;return{id:n,fullExtent:l&&V.fromJSON(l),timeExtent:d&&ge.fromJSON({start:d[0],end:d[1]})}})}async queryAttachments(t,e={}){await this.load();const a=this._getLayerRequestOptions(e);return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){await this.load();const a=await this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)});return t.outStatistics?.length&&a.features.length&&a.features.forEach(r=>{const s=r.attributes;t.outStatistics?.forEach(({outStatisticFieldName:i})=>{if(i){const n=i.toLowerCase();n&&n in s&&i!==n&&(s[i]=s[n],delete s[n])}})}),a}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 queryBins(t,e){return await this.load(),this.queryTask.executeBinsQuery(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(!pe(this.layer.url))return"unavailable";const t=T(this.layer.url,"status"),e=await f(t,{query:{f:"json"}});return Fe.fromJSON(e.data.status)}async uploadAssets(t,e){const{uploadAssets:a}=await M(()=>import("./uploadAssets-fBa6NH35-CH6CgKuA.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url);return a(t,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},e)}_handleLastEditsEventChange(t){const e=this.layer;if(t==null||!("capabilities"in e)||!("effectiveCapabilities"in e)||!(!e.capabilities?.operations?.supportsEditing&&e.effectiveCapabilities?.operations?.supportsEditing))return;const a=e.url;a!=null&&("layerId"in e&&T(a,e.layerId.toString()),this._getOrCreateEditInterceptor(a).before=r=>{const s=r.requestOptions.method??"auto";if(s==="auto"||s==="head"){const i=r.requestOptions.query??{};i._ts=t.getTime(),r.requestOptions.query=i}})}_getOrCreateEditInterceptor(t){return this._editInterceptor==null&&(this._editInterceptor={urls:t},C.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){this._editInterceptor!=null&&(G(C.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(t,e){const a=(await f(t,e)).data.statusUrl;for(;;){const r=(await f(a,{query:{f:"json"},responseType:"json"})).data;switch(r.status){case"Completed":return f(r.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new S("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new S("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await B(xe)}}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t?.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const r={};N("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),e?.cacheBust&&(r._ts=Date.now());const{data:s}=await f(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:e?.signal}));t=s}this.sourceJSON=await this._patchServiceJSON(t,e?.signal);const a=t.type;if(!this.supportedSourceTypes.has(a))throw new S("feature-layer-source:unsupported-type",`Source type "${a}" is not supported`)}async _patchServiceJSON(t,e){if(t.type!=="Table"&&t.geometryType&&!t?.drawingInfo?.renderer&&!t.defaultSymbol){const a=de(t.geometryType).renderer;H("drawingInfo.renderer",a,t)}if(t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t.extent==null)try{const{data:a}=await f(this.layer.url,this._getLayerRequestOptions({signal:e}));a.spatialReference&&(t.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:a.spatialReference})}catch(a){z(a)}return t}async _ensureLatestMetadata(t){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...t,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(t){const{addAssetFeatures:e}=t;if(!e?.length||await this._areAllAssetsAlreadyMapped(e))return null;const a=t.addFeatures.filter(i=>i.geometry);if(e.length!==a.length+t.updateFeatures.length)throw new S("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const r=new Array,s=new Map;for(const i of e){const{geometry:n}=i,{vertexSpace:o}=n;if(ae(o))r.push(n);else{const u=n.origin,{convertMeshVertexSpace:d}=await M(async()=>{const{convertMeshVertexSpace:p}=await import("./convertMeshVertexSpace-BO7NR5uA-DNqSWhor.js");return{convertMeshVertexSpace:p}},__vite__mapDeps([20,1,2,3,4,21,22,23,11,14,10,12,16,24,25,26,27,28,29,30,31,32,33,17,34]),import.meta.url),l=await d(n,new te({origin:[u.x,u.y,u.z??0]}));s.set(l,n),i.geometry=l,r.push(l)}}await this.uploadAssets(r);for(const[i,n]of s)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(e),updates:[],deletes:[]}}_getAssetMapEditsJSON(t){const e=new Array,a=this.layer.globalIdField,r=this.layer.parsedUrl;for(const s of t){const i=s.geometry,{metadata:n}=i,o=n.getExternalSourcesOnService(r),u=s.getAttribute(a);if(o.length===0){x.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:d}=o.find(se)??o[0];for(const l of d)l.parts.length===1?e.push({globalId:ee(),parentGlobalId:u,assetName:l.assetName,assetHash:l.parts[0].partHash,flags:[]}):x.getLogger(this).error(`Skipping asset ${l.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return e}_createEditsResult(t){const e=t.data,{layerId:a}=this.layer,r=[];let s=null;if(Array.isArray(e))for(const n of e)r.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===a&&(s={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else s=e;const i=_e(s);if(r.length>0){i.editedFeatureResults=[];for(const n of r){const{editedFeatures:o}=n,u=o?.spatialReference?new K(o.spatialReference):null;i.editedFeatureResults.push({layerId:n.id,editedFeatures:Ee(o,u)})}}return i}_createAttachmentErrorResult(t,e){const a=e.details.messages?.[0]||e.message,r=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new S("feature-layer-source:attachment-failure",a,{code:r})}}_getFormDataForAttachment(t,e){const a=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(a)for(const r in e){const s=e[r];s!=null&&(a.set?a.set(r,s):a.append(r,s))}return a}_getLayerRequestOptions(t={}){const{layer:e,layer:{parsedUrl:a,gdbVersion:r}}=this;return{...t,query:{gdbVersion:r,layer:"dynamicDataSource"in e&&e.dynamicDataSource?JSON.stringify({source:e.dynamicDataSource}):void 0,...a.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}async _areAllAssetsAlreadyMapped(t){const{layer:e}=this,{globalIdField:a,parsedUrl:r}=e,s="infoFor3D"in e?e.infoFor3D:null;if(s==null||a==null)return!1;const i=he(s);if(i==null)return!1;const n=T(r.path,`../${i.id}`),o=new Array;for(const h of t){if(!(h.geometry.metadata.getExternalSourcesOnService(r).length>0))return!1;o.push(h)}const u=o.map(h=>h.getAttribute(a)).filter(v);if(u.length===0)return!1;const{assetMapFieldRoles:{parentGlobalId:d,assetHash:l}}=s,p=new fe({where:`${d} IN (${u.map(h=>`'${h}'`)})`,outFields:[l,d],returnGeometry:!1}),q=await ye(n,p),{features:I}=q;return I.length!==0&&!o.some(h=>{const c=h.getAttribute(a);if(!c)return!0;const{metadata:R}=h.geometry,y=I.filter(m=>m.getAttribute(d)===c);if(y.length===0)return!0;const g=y.map(m=>m.getAttribute(l));return R.getExternalSourcesOnService(r).flatMap(({source:m})=>m.flatMap(w=>w.parts.map(j=>j.partHash))).some(m=>g.every(w=>m!==w))})}};E([O()],_.prototype,"type",void 0),E([O({constructOnly:!0})],_.prototype,"layer",void 0),E([O({constructOnly:!0})],_.prototype,"supportedSourceTypes",void 0),E([O({readOnly:!0})],_.prototype,"queryTask",null),_=E([Q("esri.layers.graphics.sources.FeatureLayerSource")],_);const xe=1e3,Vt=_;export{Vt as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./uploadAssets-fBa6NH35-BYiJ1e4f.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./External-D_wl4XAw-DrOy4LUr.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./meshSpatialReferenceScaleUtils-B1zR72Os-ndChBRyc.js","./MeshTransform-C--IG09w-Bbqagf1g.js","./mat4-DX7gBViE-6clJxb1Q.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BQk2dgMZ.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-BPSFE14A.js","./vec42-D8CJyqHG-DnfLTeQH.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./meshFeatureAttributes-BwKR5odo-DaS-LG48.js","./convertMeshVertexSpace-BO7NR5uA-DneeGgyd.js","./MeshVertexAttributes-CbNpPur2-c8zcl8rF.js","./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./projectPointToVector-B2UUY9SE-BIKNGLey.js","./projection-BA9M1R7d-CAbqHZiw.js","./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js","./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js","./vec3-BazNroeq-CRjQH4Pj.js","./BufferView-PQoE3GL7-B9DLdqO9.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-BHg6FqkT.js"])))=>i.map(i=>d[i]); +import{_ as M}from"./main-QGPoLsvl.js";import{aK as k,v as E,S as O,i as Q,aB as U,bp as P,ah as $,K as N,f,aq as v,o as S,n as V,bX as T,C,a3 as G,az as B,dK as H,W as z,a1 as x,J as K,aC as W,he as J,jd as X,bi as Z,g as Y}from"./story-Doly9N9p.js";import{a as ee}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{y as te}from"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import{t as ae}from"./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js";import{S as se}from"./External-D_wl4XAw-DrOy4LUr.js";import{L as re,J as ie,Q as ne}from"./projection-BA9M1R7d-CAbqHZiw.js";import{V as oe}from"./MeshTransform-C--IG09w-Bbqagf1g.js";import{isFeatureIdentifierArrayWithGlobalId as ue,isFeatureIdentifierArrayWithObjectId as le}from"./editingSupport-gUqP9iyf-C_ld1skV.js";import{d as de}from"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import{C as ce}from"./QueryTask-CwHwH2rS-D4f5dsGo.js";import{L as pe}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{c as A}from"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import{S as he}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{u as ye}from"./executeQueryJSON-CcHnccia-M-vnTvKl.js";import{c as me}from"./editsZScale-BDsX6vv--C-4n90TZ.js";import{b as fe}from"./Query-BrwMGK8U-BPr0_G9t.js";import{k as ge}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import{W as we,H as be,P as qe,j as Ie}from"./EditBusLayer-Df29OyJh-OmdJOLws.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BQk2dgMZ.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./executeForIds-Z1gkLduF-CrWEksFG.js";import"./query-DFW9-NG_-C3TyGmiM.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./executeQueryPBF-o8010HS9-B7Z-YQyg.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";async function D(t,e,a){const{geometry:r}=e,s={...e.attributes};if(a!=null&&r?.type==="mesh"){const{transformFieldRoles:i}=a,{origin:n,spatialReference:o,vertexSpace:u}=r,d=r.transform??new oe,l=u.type==="local",p=t.spatialReference,q=p.isGeographic,I=W(p,o),h=re(o,p)&&ie(o,p);if(!(l&&q&&h||!l&&!q&&I))return null;const c=ne(n,o,p);if(c==null)return null;if(s[i.originX]=c.x,s[i.originY]=c.y,s[i.originZ]=c.z??0,d!=null){const{translation:R,scale:y,rotation:g}=d,m=l?1:J(o)/J(p);s[i.translationX]=R[0]*m,s[i.translationY]=R[2]*m,s[i.translationZ]=-R[1]*m,s[i.scaleX]=y[0],s[i.scaleY]=y[2],s[i.scaleZ]=y[1],s[i.rotationX]=g[0],s[i.rotationY]=g[2],s[i.rotationZ]=-g[1],s[i.rotationDeg]=g[3]}return{attributes:s}}return r==null?{attributes:s}:r.type==="mesh"||r.type==="extent"?null:{geometry:r.toJSON(),attributes:s}}async function Re(t,e){const a=await Promise.all((e.addAttachments??[]).map(i=>L(t,i))),r=await Promise.all((e.updateAttachments??[]).map(i=>L(t,i))),s=e.deleteAttachments??[];return a.length||r.length||s.length?{adds:a,updates:r,deletes:[...s]}:null}async function L(t,e){const{feature:a,attachment:r}=e,{globalId:s,name:i,contentType:n,data:o,uploadId:u}=r,d={globalId:s};if(a&&("attributes"in a?d.parentGlobalId=a.attributes?.[t.globalIdField]:a.globalId&&(d.parentGlobalId=a.globalId)),u)d.uploadId=u;else if(o){const l=await X(o);l&&(d.contentType=l.mediaType,d.data=l.data),o instanceof File&&(d.name=o.name)}return i&&(d.name=i),n&&(d.contentType=n),d}function Se(t,e,a){if(!e||e.length===0)return[];if(a&&ue(e))return e.map(s=>s.globalId);if(le(e))return e.map(s=>s.objectId);const r=a?t.globalIdField:t.objectIdField;return r?e.map(s=>s.getAttribute(r)):[]}function _e(t){const e=t?.assetMaps;if(e){for(const s of e.addResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`);for(const s of e.updateResults)s.success||x.getLogger("esri.layers.graphics.sources.support.sourceUtils").error(`Failed to map asset to feature with globalId ${s.globalId}.`)}const a=t?.attachments,r={addFeatureResults:t?.addResults?.map(b)??[],updateFeatureResults:t?.updateResults?.map(b)??[],deleteFeatureResults:t?.deleteResults?.map(b)??[],addAttachmentResults:a?.addResults?a.addResults.map(b):[],updateAttachmentResults:a?.updateResults?a.updateResults.map(b):[],deleteAttachmentResults:a?.deleteResults?a.deleteResults.map(b):[]};return t?.editMoment&&(r.editMoment=t.editMoment),r}function b(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 S("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}function F(t,e){return new Z({attributes:t.attributes,geometry:Y({...t.geometry,spatialReference:e})})}function Ee(t,e){return{adds:t?.adds?.map(a=>F(a,e))||[],updates:t?.updates?.map(a=>({original:F(a[0],e),current:F(a[1],e)}))||[],deletes:t?.deletes?.map(a=>F(a,e))||[],spatialReference:e}}function Oe(t){const e=t.details.raw,a=+e.code,r=+e.extendedCode;return a===500&&(r===-2147217144||r===-2147467261)}const Ae=new k({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),Fe=new k({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let _=class extends U{constructor(t){super(t),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=P(async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const a=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:a,updates:a?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(t){const e=this.layer.sourceJSON,a=this._fetchService(e,{...t}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,t)).then(()=>this._ensureLatestMetadata(t));return this.addResolvingPromise(a),Promise.resolve(this)}initialize(){this.addHandles([$(()=>{const t=this.layer;return t&&"lastEditsEventDate"in t?t.lastEditsEventDate:null},t=>this._handleLastEditsEventChange(t))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:t,parsedUrl:e,gdbVersion:a,spatialReference:r,fieldsIndex:s}=this.layer,i="infoFor3D"in this.layer?this.layer.infoFor3D:null,n="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,o=N("featurelayer-pbf")&&t?.query.supportsFormatPBF&&i==null,u=t?.operations?.supportsQueryAttachments??!1;return new ce({url:e.path,pbfSupported:o,fieldsIndex:s,infoFor3D:i,dynamicDataSource:n,gdbVersion:a,sourceSpatialReference:r,queryAttachmentsSupported:u})}async addAttachment(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/addAttachment",i=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(e,i.query);try{const o=await f(s,{body:n});return b(o.data.addAttachmentResult)}catch(o){throw this._createAttachmentErrorResult(r,o)}}async updateAttachment(t,e,a){await this.load();const{layer:r}=this;await A(r,"editing");const s=t.attributes[r.objectIdField],i=r.parsedUrl.path+"/"+s+"/updateAttachment",n=this._getLayerRequestOptions({query:{attachmentId:e}}),o=this._getFormDataForAttachment(a,n.query);try{const u=await f(i,{body:o});return b(u.data.updateAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(s,u)}}async applyEdits(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r="infoFor3D"in a?a.infoFor3D:null,s=r!=null,i=s||(e?.globalIdUsed??!1),n=s?await this._uploadMeshesAndGetAssetMapEditsJSON(t):null,o=t.addFeatures?.map(w=>D(this.layer,w,r))??[],u=(await Promise.all(o)).filter(v),d=t.updateFeatures?.map(w=>D(this.layer,w,r))??[],l=(await Promise.all(d)).filter(v),p=Se(this.layer,t.deleteFeatures,i);me(u,l,a.spatialReference);const q=await Re(this.layer,t),I=a.capabilities.editing.supportsAsyncApplyEdits&&s,h=e?.gdbVersion||a.gdbVersion,c={gdbVersion:h,rollbackOnFailure:e?.rollbackOnFailureEnabled,useGlobalIds:i,returnEditMoment:e?.returnEditMoment,usePreviousEditMoment:e?.usePreviousEditMoment,async:I};await we(this.layer.url,h,!0);const R=be(this.layer.url,h||null);if(await qe(a.url,h,a.historicMoment))throw new S("feature-layer-source:historic-version","Editing a historic version is not allowed");e?.returnServiceEditsOption?(c.edits=JSON.stringify([{id:a.layerId,adds:u.length?u:null,updates:l.length?l:null,deletes:p.length?p:null,attachments:q,assetMaps:n}]),c.returnServiceEditsOption=Ae.toJSON(e?.returnServiceEditsOption),c.returnServiceEditsInSourceSR=e?.returnServiceEditsInSourceSR):(c.adds=u.length?JSON.stringify(u):null,c.updates=l.length?JSON.stringify(l):null,c.deletes=p.length?i?JSON.stringify(p):p.join(","):null,c.attachments=q&&JSON.stringify(q),c.assetMaps=n!=null?JSON.stringify(n):void 0);const y=this._getLayerRequestOptions({method:"post",query:c});R&&(y.authMode="immediate",y.query.returnEditMoment=!0,y.query.sessionId=Ie);const g=e?.returnServiceEditsOption?a.url:a.parsedUrl.path;let m;try{m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}catch(w){if(!Oe(w))throw w;y.authMode="immediate",m=I?await this._asyncApplyEdits(g+"/applyEdits",y):await f(g+"/applyEdits",y)}return this._createEditsResult(m)}async deleteAttachments(t,e){await this.load();const{layer:a}=this;await A(a,"editing");const r=t.attributes[a.objectIdField],s=a.parsedUrl.path+"/"+r+"/deleteAttachments";try{return(await f(s,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(b)}catch(i){throw this._createAttachmentErrorResult(r,i)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const a=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:r,url:s}=this.layer,{data:i}=await f(`${s}/${r}`,a),{id:n,extent:o,fullExtent:u,timeExtent:d}=i,l=o||u;return{id:n,fullExtent:l&&V.fromJSON(l),timeExtent:d&&ge.fromJSON({start:d[0],end:d[1]})}})}async queryAttachments(t,e={}){await this.load();const a=this._getLayerRequestOptions(e);return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){await this.load();const a=await this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)});return t.outStatistics?.length&&a.features.length&&a.features.forEach(r=>{const s=r.attributes;t.outStatistics?.forEach(({outStatisticFieldName:i})=>{if(i){const n=i.toLowerCase();n&&n in s&&i!==n&&(s[i]=s[n],delete s[n])}})}),a}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 queryBins(t,e){return await this.load(),this.queryTask.executeBinsQuery(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(!pe(this.layer.url))return"unavailable";const t=T(this.layer.url,"status"),e=await f(t,{query:{f:"json"}});return Fe.fromJSON(e.data.status)}async uploadAssets(t,e){const{uploadAssets:a}=await M(()=>import("./uploadAssets-fBa6NH35-BYiJ1e4f.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url);return a(t,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},e)}_handleLastEditsEventChange(t){const e=this.layer;if(t==null||!("capabilities"in e)||!("effectiveCapabilities"in e)||!(!e.capabilities?.operations?.supportsEditing&&e.effectiveCapabilities?.operations?.supportsEditing))return;const a=e.url;a!=null&&("layerId"in e&&T(a,e.layerId.toString()),this._getOrCreateEditInterceptor(a).before=r=>{const s=r.requestOptions.method??"auto";if(s==="auto"||s==="head"){const i=r.requestOptions.query??{};i._ts=t.getTime(),r.requestOptions.query=i}})}_getOrCreateEditInterceptor(t){return this._editInterceptor==null&&(this._editInterceptor={urls:t},C.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){this._editInterceptor!=null&&(G(C.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(t,e){const a=(await f(t,e)).data.statusUrl;for(;;){const r=(await f(a,{query:{f:"json"},responseType:"json"})).data;switch(r.status){case"Completed":return f(r.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new S("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new S("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await B(xe)}}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t?.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const r={};N("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),e?.cacheBust&&(r._ts=Date.now());const{data:s}=await f(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:e?.signal}));t=s}this.sourceJSON=await this._patchServiceJSON(t,e?.signal);const a=t.type;if(!this.supportedSourceTypes.has(a))throw new S("feature-layer-source:unsupported-type",`Source type "${a}" is not supported`)}async _patchServiceJSON(t,e){if(t.type!=="Table"&&t.geometryType&&!t?.drawingInfo?.renderer&&!t.defaultSymbol){const a=de(t.geometryType).renderer;H("drawingInfo.renderer",a,t)}if(t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t.extent==null)try{const{data:a}=await f(this.layer.url,this._getLayerRequestOptions({signal:e}));a.spatialReference&&(t.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:a.spatialReference})}catch(a){z(a)}return t}async _ensureLatestMetadata(t){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...t,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(t){const{addAssetFeatures:e}=t;if(!e?.length||await this._areAllAssetsAlreadyMapped(e))return null;const a=t.addFeatures.filter(i=>i.geometry);if(e.length!==a.length+t.updateFeatures.length)throw new S("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const r=new Array,s=new Map;for(const i of e){const{geometry:n}=i,{vertexSpace:o}=n;if(ae(o))r.push(n);else{const u=n.origin,{convertMeshVertexSpace:d}=await M(async()=>{const{convertMeshVertexSpace:p}=await import("./convertMeshVertexSpace-BO7NR5uA-DneeGgyd.js");return{convertMeshVertexSpace:p}},__vite__mapDeps([20,1,2,3,4,21,22,23,11,14,10,12,16,24,25,26,27,28,29,30,31,32,33,17,34]),import.meta.url),l=await d(n,new te({origin:[u.x,u.y,u.z??0]}));s.set(l,n),i.geometry=l,r.push(l)}}await this.uploadAssets(r);for(const[i,n]of s)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(e),updates:[],deletes:[]}}_getAssetMapEditsJSON(t){const e=new Array,a=this.layer.globalIdField,r=this.layer.parsedUrl;for(const s of t){const i=s.geometry,{metadata:n}=i,o=n.getExternalSourcesOnService(r),u=s.getAttribute(a);if(o.length===0){x.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:d}=o.find(se)??o[0];for(const l of d)l.parts.length===1?e.push({globalId:ee(),parentGlobalId:u,assetName:l.assetName,assetHash:l.parts[0].partHash,flags:[]}):x.getLogger(this).error(`Skipping asset ${l.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return e}_createEditsResult(t){const e=t.data,{layerId:a}=this.layer,r=[];let s=null;if(Array.isArray(e))for(const n of e)r.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===a&&(s={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else s=e;const i=_e(s);if(r.length>0){i.editedFeatureResults=[];for(const n of r){const{editedFeatures:o}=n,u=o?.spatialReference?new K(o.spatialReference):null;i.editedFeatureResults.push({layerId:n.id,editedFeatures:Ee(o,u)})}}return i}_createAttachmentErrorResult(t,e){const a=e.details.messages?.[0]||e.message,r=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new S("feature-layer-source:attachment-failure",a,{code:r})}}_getFormDataForAttachment(t,e){const a=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(a)for(const r in e){const s=e[r];s!=null&&(a.set?a.set(r,s):a.append(r,s))}return a}_getLayerRequestOptions(t={}){const{layer:e,layer:{parsedUrl:a,gdbVersion:r}}=this;return{...t,query:{gdbVersion:r,layer:"dynamicDataSource"in e&&e.dynamicDataSource?JSON.stringify({source:e.dynamicDataSource}):void 0,...a.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}async _areAllAssetsAlreadyMapped(t){const{layer:e}=this,{globalIdField:a,parsedUrl:r}=e,s="infoFor3D"in e?e.infoFor3D:null;if(s==null||a==null)return!1;const i=he(s);if(i==null)return!1;const n=T(r.path,`../${i.id}`),o=new Array;for(const h of t){if(!(h.geometry.metadata.getExternalSourcesOnService(r).length>0))return!1;o.push(h)}const u=o.map(h=>h.getAttribute(a)).filter(v);if(u.length===0)return!1;const{assetMapFieldRoles:{parentGlobalId:d,assetHash:l}}=s,p=new fe({where:`${d} IN (${u.map(h=>`'${h}'`)})`,outFields:[l,d],returnGeometry:!1}),q=await ye(n,p),{features:I}=q;return I.length!==0&&!o.some(h=>{const c=h.getAttribute(a);if(!c)return!0;const{metadata:R}=h.geometry,y=I.filter(m=>m.getAttribute(d)===c);if(y.length===0)return!0;const g=y.map(m=>m.getAttribute(l));return R.getExternalSourcesOnService(r).flatMap(({source:m})=>m.flatMap(w=>w.parts.map(j=>j.partHash))).some(m=>g.every(w=>m!==w))})}};E([O()],_.prototype,"type",void 0),E([O({constructOnly:!0})],_.prototype,"layer",void 0),E([O({constructOnly:!0})],_.prototype,"supportedSourceTypes",void 0),E([O({readOnly:!0})],_.prototype,"queryTask",null),_=E([Q("esri.layers.graphics.sources.FeatureLayerSource")],_);const xe=1e3,Vt=_;export{Vt as default}; diff --git a/custom-toc-highlight/assets/FeatureLayerView2D-NmRd_IhT-CufQiRFK.js b/custom-toc-highlight/assets/FeatureLayerView2D-NmRd_IhT-DLbw0NYz.js similarity index 95% rename from custom-toc-highlight/assets/FeatureLayerView2D-NmRd_IhT-CufQiRFK.js rename to custom-toc-highlight/assets/FeatureLayerView2D-NmRd_IhT-DLbw0NYz.js index a0fd1516..4047fa1f 100644 --- a/custom-toc-highlight/assets/FeatureLayerView2D-NmRd_IhT-CufQiRFK.js +++ b/custom-toc-highlight/assets/FeatureLayerView2D-NmRd_IhT-DLbw0NYz.js @@ -1,4 +1,4 @@ -import{v as h,S as f,i as Q,a0 as ut,aS as Ae,b as ye,b9 as K,o as C,bE as ct,bt as Me,bi as we,ag as dt,aq as pt,a2 as Pe,n as ht,K as g,ah as pe,aL as ft,aA as yt,a1 as x,hC as ke,aU as Ne,j2 as mt,j as et,J as gt,$ as he,I as bt,P as ae,bV as Fe,eK as Ue,hm as St,bh as vt,et as H,ax as _t,ai as Be,ed as Le,j3 as De,dW as wt,j4 as je,j5 as It,j6 as Je,j7 as Vt,j8 as Ft,e4 as oe,dX as ve,iJ as xt,ae as tt,d$ as it,e0 as Et,d_ as Rt}from"./story-BfX8CRfG.js";import{t as Ot}from"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import{c as $e}from"./Container-BcuL1ZEG-DxXVQv25.js";import{k as Qe}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import ee from"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import{T as Ct}from"./timeSupport-ohWmWReZ-ByDHlqgT.js";import{O as Ie}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{b as me}from"./Query-BrwMGK8U-DoFNfkjX.js";import{X as Tt,Y as zt}from"./LayerView-Bish-E63-rB2WUWF4.js";import{i as qt}from"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import{j as At,Z as He,G as Ge}from"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import{s as Mt,E as le,R as L,h as Pt,N as We}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{_ as kt,u as te,o as S,Q as A,h as xe,r as E,W as ge,U as Nt,b as ue,N as k,c as ie,l as Ee}from"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import{D as Re,k as G,bt as Ut,bu as Bt}from"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import{i as rt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import{s as Y}from"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import{i as Lt}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{q as Dt}from"./workers-PiCjreoO-idkDTJa3.js";import{h as jt}from"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import{L as be}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{m as Jt}from"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import{i as q}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{p as $t}from"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import{Q as Qt}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{x as Ht}from"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import{r as j,o as ce}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{V as Gt}from"./SDFHelper-B6k8Ig6R-BNeqNf2Z.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import{l as de}from"./definitions-DJSdSb77-DkoRHaVx.js";import{n as Wt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{i as Kt}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import{x as Zt}from"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import{i as Ke}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{m as _e,h as Yt}from"./popupUtils-nV1O8RUO-DAL58cHP.js";import{n as Xt}from"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";import"./main-ugzBrWNm.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";let fe=class extends we{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.sourceLayer?.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};h([f({type:Boolean})],fe.prototype,"isAggregate",void 0),fe=h([Q("esri.AggregateGraphic")],fe);const Oe=fe;let v=class extends et{constructor(e){super(e),this._filter=null,this.duration=g("mapview-transitions-duration"),this._excludedEffectView=new $e(e),this._includedEffectView=new $e(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){return this._filter||this.featureEffect?.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}get transitioningToEmpty(){return!this._excludedEffectView.final&&!this._includedEffectView.final}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)}endTransition(){this._includedEffectView.endTransition(),this._excludedEffectView.endTransition(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),i=e,r=i?.includedEffect,s=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?.filter||t?.filter||null,a||this.endTransition()}};h([f()],v.prototype,"_filter",void 0),h([f()],v.prototype,"_excludedEffectView",void 0),h([f()],v.prototype,"_includedEffectView",void 0),h([f()],v.prototype,"duration",void 0),h([f()],v.prototype,"excludedEffects",null),h([f()],v.prototype,"featureEffect",null),h([f()],v.prototype,"filter",null),h([f()],v.prototype,"hasEffects",null),h([f()],v.prototype,"includedEffects",null),h([f({value:0})],v.prototype,"scale",null),h([f()],v.prototype,"transitioning",null),h([f()],v.prototype,"transitioningToEmpty",null),v=h([Q("esri.layers.effects.FeatureEffectView")],v);const ei=v;let X=class extends Ie{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){const i=gt.fromJSON(t.spatialReference),r=[];for(let s=0;se)break;this._updateTile(t),this._pendingUpdates.dequeue()}}removeTile(e){const t=this._tiles.get(e);g("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t?.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}flush(){for(;this._pendingUpdates.size;){const e=this._pendingUpdates.dequeue();e!=null&&this._updateTile(e)}for(const e of this._tiles.values())e.upload()}_updateTile(e){const{inner:t,objectIdMap:i}=e,r=this.getSubscriptionVersion(t.id);if(r!==t.subscriptionVesrion){if(g("esri-2d-update-debug")){const o=`${t.subscriptionVesrion} != ${r}`;console.debug(`Version[${o}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}if(g("esri-2d-update-debug")){const o=t.debugInfo?.chunkId??"";console.debug(`Version[${t.version}] Tile[${t.id}] Chunk[${o}] RenderState.updateTile [${t.type}]`,t)}const s=this._ensureTile(t.id);if(t.type==="update"){const[o,...l]=t.modify;s.onMessage({type:"update",modify:o,remove:t.remove,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const u of l){const d=this._tiles.get(u.tileId);d&&d.onMessage({type:"update",modify:u,remove:t.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}return}if(t.append==null)return void s.onMessage({type:"append",clear:t.clear,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});const[a,...n]=t.append;s.onMessage({type:"append",clear:t.clear,append:a,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const o of n){const l=this._tiles.get(o.tileId);l&&l.onMessage({type:"update",modify:o,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){g("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const t=new Y(e),i=this._tileInfoView.getTileBounds(vt(),t),r=this._tileInfoView.getTileResolution(t.level),s=new Lt(t,r,i[0],i[3],!0);if(s.stage=this.getStage(),!s.stage){const a=new C("featurelayerview:webgl","Cannot create tile with empty stage");x.getLogger("esri.views.2d.layers.features.RenderState").error(a)}return s}_copyPixelBufferedEntitiesInto(e){let t=7;const i=this._tileInfoView.getLODInfoAt(e.key);for(let r=-1;r<=1;r++)for(let s=-1;s<=1;s++){if(r===0&&s===0)continue;const a=e.key.getNormalizedNeighbor(s,r,i).id,n=this._tiles.get(a);if(n!=null){const o=1<i.needsUpload);t.length&&(t[Math.floor(Math.random()*t.length)].upload(),t.length>=2&&this.requestRender());for(const i of this._renderState.tiles())i.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(i.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case le.MAP:return this._renderMapPhase(e);case le.HIGHLIGHT:return this._renderHighlightPhase(e);case le.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(this._instanceStore==null||!(e.drawPhase&S.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(oi(t))return t;return null}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:i}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=i;else{const r=new ai(t,i);this._subscriptions.set(t,r),this.updatingHandles.addPromise(r.promise)}for(const t of e.unsubscribe)this._subscriptions.get(t)?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){g("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new si(()=>this._stage,t=>this._subscriptions.get(t)?.version,e,this.tileInfoView)}getDisplayStatistics(e,t){const i=this._statisticsByLevel.get(e);return i?i.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let i=this._statisticsByLevel.get(e);i||(i=new Map,this._statisticsByLevel.set(e,i));for(const r of t)i.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){this._renderStateNext&&(g("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState&&this._renderState.flush(),this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(e,t){he(t);const i=e.inner;if(!this._subscriptions.has(i.id))return;const r=this._subscriptions.get(i.id);if(r.version!==i.subscriptionVesrion){if(g("esri-2d-update-debug")){const a=`${i.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${a}] Tile[${i.id}] FeatureContainer - Dropping message, outdated version]`,i)}return}const s=this._renderStateNext??this._renderState;if(!s)throw new Error("InternalError: No renderState defined");s.version!==i.version&&console.error(`InternalError: Version mismatch. [renderState: ${s.version}, message: ${i.version}]`),s.enqueueUpdate(e),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:r,y:s})=>r===e.x&&s===e.y);const i=ye();return t?t.resolvers.push(i):(t={x:e.x,y:e.y,resolvers:[i]},this._hitTestsRequests.push(t)),this.requestRender(),i.promise}getSortKeys(e){const t=new Set(e),i=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach((s,a)=>i.set(a,s)),i.size===t.size)break;return i}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:i}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=i&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(this._getHeatmapInstance(e)==null)super.setStencilReference(e);else for(const t of this.children)t.stencilRef=S.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,L.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&Pt(e,!1,t=>{this._renderFeatures(t,L.Highlight)})}_renderLabelPhase(e){this._renderFeatures(e,L.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,L.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,L.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,i=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),s=t.getViewport(),a=e.passOptions,n=e.drawPhase;i.bind(e),e.passOptions=i.createOptions(e,this._hitTestsRequests),e.drawPhase=le.HITTEST;const{distance:o,smallSymbolDistance:l}=e.passOptions,u=Math.max(o,l);for(const d of this.children)d.visible&&d.containsScreenPoint(e.state,e.passOptions.position,2*u)&&this._renderTile(d,e,L.All);i.draw(e),i.unbind(),t.bindFramebuffer(r),t.restoreViewport(s),e.passOptions=a,e.drawPhase=n}_renderFeatures(e,t){const i=this._getHeatmapInstance(e);i!=null?this._renderHeatmapFeatures(e,t,i):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const i of this.children)i.visible&&this._renderTile(i,e,t)}_renderHeatmapFeatures(e,t,i){for(const r of this.children)r.visible&&this._renderTile(r,e,t,Re.Heatmap);i.techniqueRef.renderResolvePass(e,i)}_renderTile(e,t,i,r){const s=g("featurelayer-force-marker-text-draw-order")?We.STRICT_MARKERS_AND_TEXT:We.BATCHING,a=e.getDisplayList(this._instanceStore,s);t.selection=i,a?.render(t,r)}};function oi(e){return e.techniqueRef.type===Re.Heatmap}async function li(e){const t=await Dt("FeaturePipelineWorker",{client:e,strategy:"dedicated"});return new ui(t)}let ui=class{constructor(e){this._connection=e,this.pipeline=this._connection.createInvokeProxy(),this.features=this._connection.createInvokeProxy("features"),this.aggregates=this._connection.createInvokeProxy("aggregates"),this.streamMessenger=this._connection.createInvokeProxy("streamMessenger")}destroy(){this._connection.destroy()}get closed(){return this._connection.closed}};const ci=10;let O=class extends et{constructor(){super(...arguments),this.events=new bt,this._updatingStrategy=!0,this._tileToEvent=new jt,this._fetchStatus={outstanding:0,done:0}}get hasAllFeatures(){return this._hasAllData()&&(this._strategyInfo?.willQueryAllFeatures??!1)}get hasAllFeaturesInView(){return this._hasAllData()}get hasFullGeometries(){return this._hasAllData()&&(this._strategyInfo?.willQueryFullResolutionGeometry??!1)}onEvent(e){switch(e.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(e);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=e.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",e);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),e.done&&(this._fetchStatus={done:0,outstanding:0})}}_hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}_hasAllTileData(){for(const e of this._tileToEvent.values())if(e.peekLast()?.type!=="loaded")return!1;return!0}_handleTileEvent(e){switch(e.type){case"subscribe":{const t=new rt(ci);t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"unsubscribe":this._tileToEvent.delete(e.tile);break;case"loaded":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"error":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t),this.events.emit("error",e);break}}}};h([f({readOnly:!0})],O.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],O.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],O.prototype,"hasFullGeometries",null),h([f()],O.prototype,"_updatingStrategy",void 0),h([f()],O.prototype,"_strategyInfo",void 0),h([f()],O.prototype,"_tileToEvent",void 0),O=h([Q("esri.views.2d.layers.features.FeatureSourceEventLog")],O);function R(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":return"esriGeometryPolygon";case"multipatch":return"esriGeometryMultiPatch";case"multipoint":return"esriGeometryMultipoint";default:return null}}function w(e,t){const i=e.featureReduction;return i&&i.type!=="selection"&&(!("maxScale"in i)||!i.maxScale||i.maxScale=r?n:a+s*(n-a)}function yi(e,t){const i=e/t.minDataValue,r=F(t.minSize,e),s=F(t.maxSize,e);let a=null;return a=i*r,tt(a,r,s)}function mi(e,t){const[i,r,s]=bi(e,t.cache.ipData);if(i===r)return F(t.stops[i].size,e);{const a=F(t.stops[i].size,e);return a+(F(t.stops[r].size,e)-a)*s}}function gi(e,t){const i=Jt[t.valueUnit],r=F(t.minSize,e),s=F(t.maxSize,e),{valueRepresentation:a}=t;let n=null;return n=a==="area"?2*Math.sqrt(e/di)/i:a==="radius"||a==="distance"?2*e/i:e/i,tt(n,r,s)}function bi(e,t){if(!t)return;let i=0,r=t.length-1;return t.some((s,a)=>et.deconflictionStrategy!=="none"))??!1}function N(e,t){const i=w(e,t);if(i?.labelsVisible&&i.labelingInfo?.length)return i.labelingInfo.every(r=>r.deconflictionStrategy!=="none")}function Si(e){return t=>H(st(t,e))}function M(e){const t=e!=null&&"visualVariables"in e&&e.visualVariables;if(!t)return null;for(const i of t)if(i.type==="size")return Si(i);return null}function U(e,t,i,r){const s=e.subtypeCode!=null?`${e.subtypeField} = ${e.subtypeCode}`:null,a=Fe(e.definitionExpression,s),n=e.customParameters??{};return r&&(n.token=r),{type:"feature",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{queryScaleRanges:e.queryScaleRanges??[],definitionExpression:a,gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),timeExtent:e.timeExtent?.toJSON(),customParameters:n}}}}function vi(e,t,i=0){if(t==null)return e[i]=0,e[i+1]=0,e[i+2]=0,void(e[i+3]=0);const{r,g:s,b:a,a:n}=t;e[i]=r*n/255,e[i+1]=s*n/255,e[i+2]=a*n/255,e[i+3]=n}async function T(e,t){if(!e)return[];switch(e.type){case"simple-fill":return Ve(e,t);case"picture-fill":return Ci(e,t);case"simple-marker":return Ze(e,t);case"picture-marker":return Vi(e,t);case"simple-line":return J(e,t,!1);case"text":return xi(e,t);case"label":return Ei(e,t);case"cim":return te(e.data,t);case"web-style":{const i=await e.fetchCIMSymbol();return te(i.data,t)}case"line-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-line`),J(new Rt,t,!1);case"point-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-marker`),Ze(new Et,t);case"polygon-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-fill`),Ve(new it,t);case"mesh-3d":case"label-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function _i(e,t){const{schemaOptions:i}=t,{store:r}=i,s=new Array(de),a=new Array(de/4);for(let c=0;cue(n.color)),visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:e.attributes.length},optionalAttributes:{}}).createMeshInfo({size:e.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:k(s)});return[...e.backgroundFillSymbol?await Ve(e.backgroundFillSymbol,{schemaOptions:t,path:"",uniforms:ge}):[],a]}function at(e){if(e.style==="path"){if(e.path==null)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const t=G.fromSimpleMarker(e);if("outline"in e&&e.outline&&e.outline.style!=="none"&&e.outline.style!=="solid"){if(!t||!t.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:t.symbolLayers[0],overrides:[]}}return{type:"sprite-rasterization-param",resource:Gt(t),overrides:[]}}async function Ze(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;if(e.style==="path"||e.outline&&e.outline.style!=="solid"&&e.outline.style!=="none"){const p=G.fromSimpleMarker(e);if(!p||!p.symbolLayers)throw new Error("Error handling marker! ");if(i.visualVariableRotation&&(p.angleAlignment="Map"),e.style!=="path"){const y=p.symbolLayers[0];if(ie(t.uniforms)){const m=k(t.uniforms,0,1);if(m>y.size){const I=m/y.size;y.size=m;const V=y.markerGraphics?.[0].symbol;(V.symbolLayers&&V.symbolLayers[0]).width*=I}}}return te({type:"CIMSymbolReference",symbol:p},t)}const a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=at(e);let o=e.color?.toArray()??[0,0,0,0];n.resource.type==="CIMVectorMarker"&&(o=[255,255,255,255]);const l=e.style==="triangle"?124/116:1,u=e.size,d=u*l,c=i.visualVariableColor!=null&&(e.style==="cross"||e.style==="x");return[a.createMeshInfo({type:"simple",color:o,height:u,width:d,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:u,sprite:n,overrideOutlineColor:c,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]}function Vi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=G.createPictureMarkerRasterizationParam(e);return n?[a.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:n,overrideOutlineColor:!1,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]:[]}function Fi(e,t,i){const{uniforms:r,schemaOptions:s}=i,{store:a}=s,n=a.ensureInstance(S.marker,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),o=at(e),l=6,u=l*t.width,d=u,c=e.color?.toArray()??t.color?.toArray()??[0,0,0,0],p=e.style==="cross"||e.style==="x";let y;switch(e.placement){case"begin-end":y=ce.Both;break;case"begin":y=ce.JustBegin;break;case"end":y=ce.JustEnd;break;default:y=ce.None}const m={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:y,offsetAlongLine:0},overrides:[]};return[n.createMeshInfo({type:"simple",color:c,height:d,width:u,offsetX:0,offsetY:0,angle:0,alignment:Ee(r)?j.MAP:j.SCREEN,outlineColor:c,outlineSize:p?t.width:0,referenceSize:d/l,sprite:o,overrideOutlineColor:p&&r.visualVariableColor!=null,hasSizeVV:ie(r),placement:m,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:k(r)})]}function xi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;return[s.ensureInstance(S.text,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableRotation:i.visualVariableRotation,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}}).createMeshInfo({boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:G.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:k(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null})]}function Ei(e,t){const{schemaOptions:i,uniforms:r}=t,{store:s}=i,a=e.symbol,{allowOverrun:n,repeatLabel:o,repeatLabelDistance:l}=e,u={maxScale:e.maxScale??0,minScale:e.minScale??0},d=s.ensureInstance(S.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}}),c=e.labelPlacement,[p,y]=Ut(c);return[d.createMeshInfo({boxBackgroundColor:a.backgroundColor?.toArray(),boxBorderLineColor:a.borderLineColor?.toArray(),boxBorderLineSize:a.borderLineSize??0,color:a.color?.toArray()??[0,0,0,0],offsetX:a.xoffset,offsetY:a.yoffset,postAngle:a.angle,fontSize:a.font.size,decoration:a.font.decoration,outlineColor:[0,0,0,0],outlineSize:0,haloColor:a.haloColor?.toArray()??[0,0,0,0],haloSize:a.haloSize??0,lineWidth:a.lineWidth,lineHeightRatio:a.lineHeight,horizontalAlignment:p,verticalAlignment:y,repeatLabel:o,repeatLabelDistance:H(l),allowOverrun:n,labelPosition:e.labelPosition,scaleInfo:u,minPixelBuffer:k(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:a.font.toJSON(),textString:a.text,symbol:G.createCIMTextSymbolfromTextSymbol(a),primitiveName:"label-override"},useLegacyLabelEvaluationRules:e.labelExpressionInfo?.expression==null,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1})]}function Ce(e,t){const i=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:i,referenceWidth:i,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:t}}function Ri(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0],n={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if(e.outline?.style==="solid")return[s.ensureInstance(S.patternOutlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),sprite:n,scaleInfo:null,effects:null})];const o=[],l=s.ensureInstance(S.patternFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:n,scaleInfo:null,effects:null});return o.push(l),e.outline&&o.push(...J(e.outline,t,!0)),o}function Oi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0];if(e.style!=="none"&&e.outline?.style==="solid")return[s.ensureInstance(S.outlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})];const n=[];if(e.style!=="none"){const o=s.ensureInstance(S.fill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,scaleInfo:null,effects:null});n.push(o)}return e.outline&&n.push(...J(e.outline,t,!0)),n}async function Ve(e,t){if(e.type==="cim")return te(e.data,t);const{style:i}=e;return i&&i!=="none"&&i!=="solid"?Ri(e,t):Oi(e,t)}function Ci(e,t){const{outline:i}=e,{uniforms:r,schemaOptions:s}=t,{store:a}=s,n=[],o=G.createPictureFillRasterizationParam(e);if(!o)return[];const{width:l,height:u,xoffset:d,yoffset:c,xscale:p,yscale:y}=e,m={color:[255,255,255,255],sprite:o,height:u,aspectRatio:l/u,offsetX:d,offsetY:c,scaleX:p,scaleY:y,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if(i?.style==="solid")return[a.ensureInstance(S.complexOutlineFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...m,...Ce(i,!!r.visualVariableSizeOutlineScaleStops)})];const I=a.ensureInstance(S.complexFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return n.push(I.createMeshInfo(m)),i&&n.push(...J(i,t,!0)),n}function J(e,t,i){const{color:r,style:s,width:a,cap:n,join:o}=e,{schemaOptions:l}=t,{store:u}=l,d=[],c=i?{...ge,visualVariableSizeScaleStops:t.uniforms.visualVariableSizeOutlineScaleStops}:t.uniforms,p={uniforms:{visualVariableColor:c.visualVariableColor,visualVariableOpacity:c.visualVariableOpacity,visualVariableSizeMinMaxValue:c.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:c.visualVariableSizeScaleStops,visualVariableSizeStops:c.visualVariableSizeStops,visualVariableSizeUnitValue:c.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},y={color:r?.toArray()??[0,0,0,0],width:a,referenceWidth:a,capType:n,joinType:o,miterLimit:e.miterLimit,hasSizeVV:ie(c),effects:null,scaleInfo:null};if(s==null||s==="solid"){const m=u.ensureInstance(S.line,p).createMeshInfo(y);d.push(m)}else if(s!=="none"){const m=u.ensureInstance(S.texturedLine,p).createMeshInfo({...y,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:Bt(s,n)},overrides:[]}});d.push(m)}return e.marker!=null&&d.push(...Fi(e.marker,e,t)),d}async function re(e,t,i){const r=t.labelsVisible&&t.labelingInfo||[],s=R(t),a=Qt(r,s);return{type:"label",classes:await Promise.all(a.map((n,o)=>Ti(e,n,o,i)))}}async function Ti(e,t,i,r){const s=await T(t,{path:`${i}`,schemaOptions:e,uniforms:r});return{maxScale:t.maxScale,minScale:t.minScale,expression:t.labelExpressionInfo?.expression??t.labelExpression,where:t.where,meshes:s}}async function se(e,t){if(!t)return{type:"simple",meshes:[]};switch(t.type){case"simple":return zi(e,t);case"dot-density":return qi(e,t);case"class-breaks":return Ai(e,t);case"unique-value":return Mi(e,t);case"dictionary":return Pi(t);case"heatmap":return ki(e,t);case"pie-chart":return Ni(e,t)}}async function zi(e,t){const i=t.getSymbols(),r=i.length?i[0]:null,s=E(t);return{type:"simple",meshes:await T(r,{schemaOptions:e,uniforms:s,path:"renderer.symbol"})}}async function qi(e,t){const i=E(t);return{type:"dot-density",meshes:await _i(t,{schemaOptions:e,uniforms:i,path:"renderer.symbol"})}}async function Ai(e,t){const i=E(t),r=t.backgroundFillSymbol,s=t.normalizationType,a=s==="log"?"esriNormalizeByLog":s==="percent-of-total"?"esriNormalizeByPercentOfTotal":s==="field"?"esriNormalizeByField":null,n=t.classBreakInfos.map(async d=>({meshes:await T(d.symbol,{path:`renderer-stop-${d.minValue}-${d.maxValue}`,schemaOptions:e,uniforms:i}),min:d.minValue,max:d.maxValue})),o=(await Promise.all(n)).sort((d,c)=>d.min-c.min),l=await T(r,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:i.visualVariableSizeOutlineScaleStops}}),u=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:i});return{type:"interval",field:t.field,expression:t.valueExpression,backgroundFill:l,defaultSymbol:u,intervals:o,normalizationField:t.normalizationField,normalizationTotal:t.normalizationTotal,normalizationType:a,isMaxInclusive:t.isMaxInclusive}}async function Mi(e,t){const i=[],r=E(t),s=await T(t.backgroundFillSymbol,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:r.visualVariableSizeOutlineScaleStops}}),a=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:r});for(const n of t.uniqueValueInfos??[]){const o=await T(n.symbol,{path:`renderer-unique-value-${n.value}`,schemaOptions:e,uniforms:r});i.push({value:""+n.value,symbol:o})}return{type:"map",field:t.field,expression:t.valueExpression,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,backgroundFill:s,defaultSymbol:a,map:i}}function Pi(e){const t=E(e),i=e.scaleExpression,r=i!=null&&i!=="1"?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",fieldMap:e.fieldMap,scaleExpression:r,visualVariableUniforms:t}}async function ki(e,t){return{type:"heatmap",meshes:await wi(t,e)}}async function Ni(e,t){return{type:"pie-chart",meshes:await Ii(t,e)}}async function Ui(e,t){const i=t.renderer,r=E(i);return{symbology:await se(e,i),labels:await re(e,t,r)}}async function P(e,t,i,r){const s=i.featureReduction;if(s)switch(s.type){case"binning":return Li(s,e,t,i,r);case"cluster":return Di(s,e,t,i,r)}const a=ji(i.orderBy,i.renderer,i.objectIdField),n=xe(i.renderer,t.filters),o=await Ui(e,i),l=Te(o.symbology);return{storage:n,mesh:{properties:{sortKey:a,timeZone:t.timeZone,returnMeshObjectId:l,displayRefreshVersion:r},strategy:{type:"feature"},factory:o}}}function nt(e,t){return e.fields.map(i=>({...i.toJSON(),type:Bi(i,t)}))}function Bi(e,t){const{onStatisticExpression:i,onStatisticField:r,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:n}=i;return n?n==="string"?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const a=t.find(n=>n.name===r);return a?a.type:"esriFieldTypeString"}}}async function Li(e,t,i,r,s){const a=nt(e,r.fields),n=e.renderer,o=await se(t,n),l=xe(n,[null,null]),u=E(n),d=await re(t,{geometryType:"polygon",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},u),c=Te(o),p=e.binType==="geohash"?{type:"geohash",fixBinLevel:e.fixedBinLevel??3}:{type:"grid",size:H(e.size),fixedBinLevel:e.fixedBinLevel};return{storage:l,mesh:{properties:{sortKey:null,timeZone:i.timeZone,returnMeshObjectId:c,displayRefreshVersion:s},strategy:{type:"binning",fields:a,index:p,featureFilter:i.filters[0]},factory:{labels:d,symbology:o}}}}async function Di(e,t,i,r,s){const a=nt(e,r.fields),n={type:"cluster",feature:await se(t,e.effectiveFeatureRenderer),cluster:await se(t,e.effectiveClusterRenderer)},o=E(e.effectiveFeatureRenderer),l={type:"cluster",feature:await re(t,r,o),cluster:await re(t,{geometryType:"point",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},o)},u=xe(e.effectiveFeatureRenderer,[null,null]),d=Te(n);return{storage:u,mesh:{properties:{sortKey:null,timeZone:i.timeZone,displayRefreshVersion:s,returnMeshObjectId:d},strategy:{type:"cluster",fields:a,featureFilter:i.filters[0],clusterRadius:H(e.clusterRadius/2)},factory:{labels:l,symbology:n}}}}function ji(e,t,i){const r=t!=null&&t.type==="unique-value"&&t.orderByClassesEnabled;if(e!=="default"||r||(e=[new $t({field:i,order:"descending"})]),e!=="default"&&e?.length){e.length;const s=e[0],a=s.order==="ascending"?"asc":"desc";return s.field?{field:s.field,order:a}:s.valueExpression?{expression:s.valueExpression,order:a}:null}return r?{byRenderer:!0,order:"asc"}:null}function Z(e){return e.techniqueType===Re.AnimatedMarker}function Te(e){return!!(e.type==="simple"&&e.meshes.some(Z)||e.type==="interval"&&(e.intervals.some(t=>t.meshes.some(Z))||e.backgroundFill.some(Z))||e.type==="map"&&(e.map.some(t=>t.symbol.some(Z))||e.backgroundFill.some(Z)))}let Ji=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,globalIdField:a,datesInUnknownTimezone:n,orderBy:o,parsedUrl:l}=t,u=t.fieldsIndex.toJSON(),d=R(t),c=t.timeInfo?.toJSON(),p=t.spatialReference.toJSON(),y=ae(l);let m=s;if(o?.length){const I=!o[0].valueExpression&&o[0].field;I&&(m=I)}return{type:"feature-service",source:y,isSourceHosted:be(y.path),orderByFields:m,outSpatialReference:e.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:n,globalIdField:a,fieldsIndex:u,geometryType:d,objectIdField:s,timeInfo:c,spatialReference:p,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s,apiKey:a}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,a)}createProcessorSchema(e,t,i){const{fields:r,geometryType:s,orderBy:a,objectIdField:n,renderer:o,labelingInfo:l,labelsVisible:u}=this.layer,d={featureReduction:null,fields:r.map(c=>c.toJSON()),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:n,orderBy:a??"default",renderer:o?.clone()};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,apiKey:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,apiKey:r,customParameters:n,definitionExpression:i,labelingInfo:a,orderBy:o,renderer:s}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}};function ze(e,t){const i=e.extent,r=t?.clone().intersection(i),s=r!=null?r.width*r.height:0,a=t?t.width*t.height:0,n=a===0?0:s/a,o=g("featurelayer-snapshot-point-coverage");return!isNaN(n)&&n>=o}function $(e,t){return e.floorInfo!=null&&(e.floorInfo.viewAllLevelIds.length>0||t.floors.length>0)}function qe(e,t,i){const r=$i(e,t?.where,i);return r&&(t??=new ee,t.where=r),t}function $i(e,t,i){if(e.floorInfo==null||!i.floors?.length)return t;let r=i.floors;const{floorField:s,viewAllLevelIds:a}=e.floorInfo;a.length&&(r=a);const n=r.filter(l=>l!=="").map(l=>"'"+l+"'");if(n.push("''"),t?.includes(s)){let l=new RegExp("AND \\("+s+".*NULL\\)","g");t=t.replace(l,""),l=new RegExp("\\("+s+".*NULL\\)","g"),t=(t=t.replace(l,"")).replaceAll(/\s+/g," ").trim()}let o="("+s+" IN ({ids}) OR "+s+" IS NULL)";return o=o.replace("{ids}",n.join(", ")),Fe(t,o)}let Qi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,typeIdField:a,globalIdField:n,datesInUnknownTimezone:o,orderBy:l,subtypeField:u,refreshInterval:d}=t,c=t.fieldsIndex.toJSON(),p=R(t),y=t.timeInfo?.toJSON(),m=t.spatialReference.toJSON(),I=t.types?.map(B=>B.toJSON()),V=ae(this.layer.parsedUrl);this.layer.dynamicDataSource&&(V.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let W=this.layer.objectIdField;if(l?.length){const B=!l[0].valueExpression&&l[0].field;B&&(W=B)}const Se=r?.lastEditDate==null&&d>0,ne=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!Se,lt=ne&&ze(e,t.fullExtent);return{type:"feature-service",source:V,isSourceHosted:be(V.path),orderByFields:W,outSpatialReference:e.spatialReference.toJSON(),metadata:{typeIdField:a??void 0,types:I,timeReferenceUnknownClient:o,subtypeField:u,globalIdField:n,fieldsIndex:c,geometryType:p,objectIdField:s,timeInfo:y,spatialReference:m,subtypes:this.layer.subtypes?.map(B=>B.toJSON())},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:ne,supportsSnapshotMaxThreshold:lt,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer;return U({definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l},e,t,u)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,gdbVersion:s,apiKey:a,subtypeCode:n}=t,o=this.layer.labelsVisible?this.layer.labelingInfo:null,l=t.historicMoment?.getTime()??void 0,u=JSON.stringify(t.customParameters),d=w(t,e),c=JSON.stringify(t.orderBy),p=$(this.layer,e)?e.floors:null;return{outFields:this.layer.outFields,apiKey:a,customParameters:u,definitionExpression:i,featureReduction:d,floors:p,gdbVersion:s,historicMoment:l,labelingInfo:o,orderBy:c,renderer:r,subtypeCode:n}}};function Hi(e){if(!("openPorts"in e))throw new C("source-not-supported")}class Ye{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.timeInfo?.toJSON(),l=i.spatialReference.toJSON();return Hi(i.source),{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,timeInfo:o,spatialReference:l,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r,timeExtent:s}=this.layer;return U({definitionExpression:r,timeExtent:s,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,orderBy:u,objectIdField:d}=this.layer,c={fields:s.map(p=>p.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:d,orderBy:u??"default"};return P(t,i,c,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=w(i,t),o=JSON.stringify(i.orderBy);return{outFields:this.layer.outFields,orderBy:o,definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:n}}}class Gi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.spatialReference.toJSON();return{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:i.timeInfo?.toJSON(),timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r}=this.layer;return U({definitionExpression:r,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i;return{definitionExpression:r,renderer:s,labelingInfo:this.layer.labelsVisible?this.layer.labelingInfo:null,featureReduction:w(i,t)}}}let Wi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r}=t,s=t.fieldsIndex.toJSON(),a=R(t),n=t.timeInfo?.toJSON(),o=t.spatialReference.toJSON(),l=t.source.getSource(),u=this.layer.objectIdField,d=ae(i);return d.query.maxRecordCount=l.maxRecordCount,{type:"ogc",source:l,orderByFields:u,outSpatialReference:e.spatialReference.toJSON(),metadata:{fieldsIndex:s,geometryType:a,objectIdField:r,timeInfo:n,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:d.query.maxRecordCount,supportsCompactGeometry:d.query.supportsCompactGeometry,supportsDefaultSpatialReference:d.query.supportsDefaultSpatialReference,supportsFormatPBF:d.query.supportsFormatPBF,supportsMaxRecordCountFactor:d.query.supportsMaxRecordCountFactor,supportsQuantization:d.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t){const{customParameters:i,timeExtent:r,apiKey:s}=this.layer;return U({customParameters:i,timeExtent:r},e,t,s)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{renderer:i,apiKey:r}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:r,customParameters:JSON.stringify(t.customParameters),featureReduction:w(t,e),labelingInfo:s,orderBy:JSON.stringify(t.orderBy),renderer:i}}},Ki=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r,globalIdField:s,orderBy:a,refreshInterval:n}=t,o=t.fieldsIndex.toJSON(),l=R(t),u=t.timeInfo?.toJSON(),d=t.spatialReference.toJSON(),c=ae(this.layer.parsedUrl);let p=this.layer.objectIdField;if(a?.length){const V=!a[0].valueExpression&&a[0].field;V&&(p=V)}const y=n>0,m=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!y,I=m&&ze(e,t.fullExtent);return{type:"feature-service",source:c,isSourceHosted:be(c.path),orderByFields:p,outSpatialReference:e.spatialReference.toJSON(),metadata:{globalIdField:s,fieldsIndex:o,geometryType:l,objectIdField:r,timeInfo:u,spatialReference:d,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:m,supportsSnapshotMaxThreshold:I,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,null)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,outFields:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=w(t,e);return{outFields:s,orderBy:JSON.stringify(t.orderBy),definitionExpression:i,renderer:r,labelingInfo:a,featureReduction:o,customParameters:n,floors:$(this.layer,e)?e.floors:null}}},Zi=class{constructor(e){this.layer=e}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}getUpdateHashProperties(e){const t=this.layer,{renderer:i}=t,r=this.layer.labelsVisible?this.layer.labelingInfo:null,s=JSON.stringify(t.customParameters),a=w(t,e),n=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,labelingInfo:r,featureReduction:a,customParameters:s,orderBy:n,renderer:i}}async createServiceOptions(e){const t=R(this.layer);return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:e.spatialReference.toJSON(),geometryInfo:this.layer.source.geometryInfo,metadata:{spatialReference:this.layer.spatialReference,fieldsIndex:this.layer.fieldsIndex.toJSON(),objectIdField:this.layer.objectIdField,geometryType:t,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null}}}createSourceSchema(e,t){return{type:"parquet",mutable:{sourceRefreshVersion:t,availableFields:e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,t,i){const r={fields:this.layer.fields.map(s=>s.toJSON()),renderer:this.layer.renderer?.clone(),featureReduction:w(this.layer,t),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return P(e,t,r,i)}};class Yi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{objectIdField:r}=i,s=R(i),a=i.timeInfo?.toJSON()||null,n=i.spatialReference?i.spatialReference.toJSON():null;return{type:"stream",source:this.layer.parsedUrl,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:s,objectIdField:r,timeInfo:a,timeReferenceUnknownClient:null,spatialReference:n,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(t,i){const{definitionExpression:r,geometryDefinition:s,customParameters:a}=this.layer;return{type:"stream",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{geometryDefinition:s?.toJSON(),definitionExpression:r,customParameters:a??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(i.customParameters);return{definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:w(i,t),customParameters:n,geometryDefinition:i.geometryDefinition,definitionExpressoin:i.definitionExpression}}}async function Xi(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(({renderer:s})=>se(e,s)));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}function er(e,t){const i=Wt();return{type:"subtype",filters:e.filters,capabilities:{maxTextureSize:i.maxTextureSize},subtypeField:t.subtypeField,target:"feature",bindings:t.sublayers.reduce((r,{renderer:s,subtypeCode:a})=>{const n=Nt(s);return{...r,[a]:n}},{})}}async function tr(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(s=>{const a=E(s.renderer),n={...s,geometryType:s.geometryType??null};return re(e,n,a)}));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}async function ir(e,t,i,r){return{storage:er(t,i),mesh:{properties:{timeZone:t.timeZone,displayRefreshVersion:r,returnMeshObjectId:!1,sortKey:null},strategy:{type:"feature"},factory:{symbology:await Xi(e,i),labels:await tr(e,i)}}}}class rr{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every(i=>z(i))}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,datesInUnknownTimezone:s,editingInfo:a,globalIdField:n,objectIdField:o,refreshInterval:l,subtypeField:u}=i,d=i.fieldsIndex.toJSON(),c=R(i),p=i.timeInfo?.toJSON(),y=i.spatialReference.toJSON(),m=ae(this.layer.parsedUrl),I=o,V=a?.lastEditDate==null&&l>0,W=!!g("featurelayer-snapshot-enabled")&&i.geometryType==="point"&&r?.query.supportsPagination&&!r?.operations.supportsEditing&&!V,Se=W&&ze(t,i.fullExtent);return{type:"feature-service",source:m,isSourceHosted:be(m.path),orderByFields:I,outSpatialReference:t.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:s,subtypeField:u,globalIdField:n,fieldsIndex:d,geometryType:c,objectIdField:o,timeInfo:p,spatialReference:y,subtypes:this.layer.subtypes?.map(ne=>ne.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:a?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:W,supportsSnapshotMaxThreshold:Se,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(t,i){const{definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer,d={queryScaleRanges:this.layer.sublayers.items.map(c=>({subtypeCode:c.subtypeCode,minScale:c.minScale,maxScale:c.maxScale})),definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l};return U(d,t,i,u)}createProcessorSchema(t,i,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,a=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:a.labelingInfo,labelsVisible:a.labelsVisible,renderer:a.renderer,subtypeCode:a.subtypeCode,orderBy:null}))};return ir(t,i,s,r)}hasFilters(t){return $(this.layer,t)||sr(this.layer,t)}addFilters(t,i){t=qe(this.layer,t,i);const r=this.layer.sublayers.filter(a=>!ot(a,i)).map(a=>a.subtypeCode);if(!r.length)return t;t??=new ee;const s=`NOT ${this.layer.subtypeField} IN (${r.join(",")})`;return t.where=Fe(t.where,s),t}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:a}=i,n=i.historicMoment?.getTime()??void 0,o=JSON.stringify(i.customParameters),l=$(this.layer,t)?t.floors:null,u=this.layer.sublayers.map(({renderer:d,labelsVisible:c,labelingInfo:p,visible:y})=>({renderer:d,labelsVisible:c,labelingInfo:p,visible:y}));return{outFields:this.layer.outFields,gdbVersion:s,definitionExpression:r,historicMoment:n,customParameters:o,apiKey:a,sublayers:u,floors:l}}setGraphicOrigin(t){const i=this.layer.fieldsIndex.get(this.layer.subtypeField),r=t.attributes[i.name],s=this.layer.sublayers.find(a=>a.subtypeCode===r);t.layer=t.sourceLayer=s}}function sr(e,t){return e.sublayers.some(i=>!ot(i,t))}function ot(e,t){return e.visible&&(e.minScale===0||Ue(t.scale,e.minScale)||t.scalee.maxScale)}async function b(e,t){try{return await e}catch(i){if(i.name!=="no-queryEngine")throw i;return t}}function D(e,t){const i=new Set;for(const r of e instanceof Set?e.values():e.keys())t.has(r)||i.add(r);return i}class ar{constructor(t,i,r){const s=r?t.getTileCoverage(r,0,!0,"closest"):null,a=t.getTileCoverage(i,0,!0,"closest");if(this._tileKeys=new Map,s)for(const n of s.keys())this._tileKeys.set(n.id,n);if(a)for(const n of a.keys())this._tileKeys.set(n.id,n)}get coverageSet(){return new Set(this._tileKeys.keys())}keys(){return this._tileKeys.values()}}class nr{constructor(t){this.version=t}}class or{constructor(t){this._subscriptions=new Map,this._visible=new Set,this._paused=new Set,this._version=0,this._config=t}destroy(){}get _coverageSet(){return this._coverage?.coverageSet??new Set}suspend(){this._suspendedOverage=this._coverage,this._coverage=null,this._updateSubscriptions()}resume(){this._coverage==null&&(this._coverage=this._suspendedOverage,this._suspendedOverage=null,this._updateSubscriptions())}update(t,i){return this._version=(this._version+1)%Number.MAX_SAFE_INTEGER,this._updateCoverage(t,i),this._updateSubscriptions(),new Set(this._visible)}_updateCoverage(t,i){this._coverage=new ar(this._config.tileInfoView,t,i)}_updateSubscriptions(){const t=this._coverageSet,i=this._updateVisibility(),r=D(i,t),s=D(this._subscriptions,i),a=D(t,this._subscriptions),n=D(s,t),o=D(r,n),l=D(o,this._paused);this._visible=i;for(const u of a.values())this._subscriptions.set(u,new nr(this._version));for(const u of l.values())this._paused.add(u);for(const u of n.values())this._subscriptions.delete(u),this._paused.delete(u);(a.size||n.size||l.size)&&this._sendUpdateSubscriptions(a,n,l)}_sendUpdateSubscriptions(t,i,r){const s=Array.from(t.values()).map(a=>({tileId:a,version:this._subscriptions.get(a).version}));this._config.updateSubscriptions({subscribe:s,unsubscribe:Array.from(i.values()),pause:Array.from(r.values())})}_updateVisibility(){const t=new Set,i=new Set;if(!this._coverage)return t;for(const a of this._coverage.keys()){if(this._config.isDone(a)){t.add(a.id);continue}this._addVisibleParent(t,i,a)||this._addVisibleChildren(t,a)||t.add(a.id)}const r=new Y(0,0,0,0),s=new Y(0,0,0,0);for(const a of i){r.id=a;for(const n of t)s.id=n,r.containsChild(s)&&t.delete(n)}return t}_addVisibleParent(t,i,r){let s=!1;for(const a of this._visible.values())new Y(a).containsChild(r)&&(t.add(a),i.add(a),s=!0);return s}_addVisibleChildren(t,i){let r=!1;for(const s of this._visible.values()){const a=new Y(s);i.containsChild(a)&&(t.add(s),r=!0)}return r}}const lr=e=>{let t=class extends e{constructor(...i){super(...i),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([pe(()=>{const i=this.layer;return[i&&"elevationInfo"in i?i.elevationInfo?.featureExpressionInfo:null,i&&"displayField"in i?i.displayField:null,i&&"timeInfo"in i&&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(),_t),Be(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),Be(()=>{const i=this.layer;return i&&"sublayers"in i?i.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){if(!this.layer)return[];const{layer:i,layer:{fieldsIndex:r},requiredFields:s}=this;return"outFields"in i&&i.outFields?Le(r,[...De(r,i.outFields),...s]):Le(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){x.getLogger(this).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=this.filter!=null?this.filter.createQuery(i):new me(i);if("floorInfo"in this.layer&&this.layer.floorInfo){const s=Ke(this);s!=null&&(r.where=r.where?`(${r.where}) AND (${s})`:s)}return this.timeExtent!=null&&(r.timeExtent=r.timeExtent!=null?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new me(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 fetchPopupFeaturesFromGraphics(i,r){return this._validateFetchPopupFeatures(i,r),this._fetchPopupFeatures(i,r)}_loadArcadeModules(i){return i.expressionInfos?.length||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression")?wt():Promise.resolve()}_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,d=await Promise.allSettled([n?n.collectRequiredFields(u,s):null,je(u,r),i&&"elevationInfo"in r?It(u,r):null,this.filter!=null?Je(u,r,this.filter):null,i||this.featureEffect==null?null:Je(u,r,this.featureEffect.filter),!i&&l?Vt(u,r,l):null,!i&&o?Ft(u,r,o):null]);if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&oe(u,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"floorInfo"in r&&r.floorInfo&&oe(u,r.fieldsIndex,[r.floorInfo.floorField]),r.type==="feature"&&i&&r.infoFor3D!=null&&(r.globalIdField==null&&x.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),oe(u,r.fieldsIndex,[r.globalIdField])),r.type==="subtype-group"){ve(u,s,r.subtypeField);const p=r.sublayers.map(y=>Promise.all([y.renderer?.collectRequiredFields(u,s),je(u,y)]));await Promise.allSettled(p)}if(r.type==="catalog-footprint"&&r.parent){const p=r.parent;oe(u,s,[p.itemNameField,p.itemSourceField,p.itemTypeField,p.maxScaleField,p.minScaleField])}for(const p of d)p.status==="rejected"&&x.getLogger(this).error(p.reason);ve(u,s,a),i&&"displayField"in r&&r.displayField&&ve(u,s,r.displayField);const c=Array.from(u).sort();this._set("requiredFields",c)}_validateFetchPopupFeatures(i,r){if(r!=null)for(const s of i){const a=s.origin&&"layer"in s.origin?s.origin.layer:s.layer;if("popupEnabled"in a&&!a.popupEnabled)throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a});if(s.isAggregate){const n="featureReduction"in a?a.featureReduction:null;if(!(n&&"popupTemplate"in n&&n.popupEnabled&&n.popupTemplate))throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a})}else if("popupTemplate"in a&&!_e(a,r))throw new C("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:a})}}_popupFeatureHasRequiredFields(i,r){return xt(r,i)}async _fetchPopupFeatures(i,r){const s=new Array(i.length),a=new Map,n=await this._createPopupQuery(i.map(o=>o.origin?.layer??o.layer),r);for(let o=0;oi.add(r)),t&&t.forEach(r=>i.add(r)),i.has("*")?["*"]:Array.from(i)}const Xe=4294967294;let _=class extends lr(Xt(Tt(zt))){constructor(){super(...arguments),this._commandsQueue=new kt({process:e=>{switch(e.type){case"edit-by-feature":case"edit-by-id":return this._doEdit(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._highlightCounter=new Kt,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new O,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._fields=null,this.featureEffectView=new ei}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(Ae()),this._commandsQueue.destroy()}initialize(){this._workerAttached=ye(),K(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new C("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(e.geometryType==="mesh")throw new C("featurelayerview:geometry-type-not-supported",`Geometry type of ${e.geometryType} is not supported`,{layer:e});if((e.type==="feature"||e.type==="subtype-group")&&ct(e)?.operations.supportsQuery===!1)throw new C("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await li(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(i){this._workerAttached.reject(Ae()),Me(i)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasFullGeometries}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,i=!this.suspended;return e.map(({vvEvaluators:r,deconflictionEnabled:s})=>({container:this.featureContainer,vvEvaluators:r,deconflictionEnabled:s,geometryType:t,visible:i}))}get layerAdapter(){switch(this.layer.type){case"feature":return this.layer.source.type==="memory"?new Ye(this.layer):new Qi(this.layer);case"geojson":case"csv":case"wfs":return new Ye(this.layer);case"parquet":return new Zi(this.layer);case"subtype-group":return new rr(this.layer);case"ogc-feature":return new Wi(this.layer);case"stream":return new Yi(this.layer);case"oriented-imagery":return new Ki(this.layer);case"knowledge-graph-sublayer":return new Gi(this.layer);case"catalog-footprint":return new Ji(this.layer);default:Ot(this.layer)}return null}get timeExtent(){return Ct(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t="default"){let i;e instanceof we?i=[e.getObjectId()]:typeof e=="number"||typeof e=="string"?i=[e]:dt.isCollection(e)&&e.length>0?i=e.map(s=>s?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i=typeof e[0]=="number"||typeof e[0]=="string"?e:e.map(s=>s?.getObjectId()));const r=i?.filter(pt);return r?.length?(this._addHighlights(r,t),Pe(()=>this._removeHighlights(r,t))):Pe()}getHighlightIds(){return Array.from(this._highlightCounter.ids())}hasHighlight(){return!this._highlightCounter.empty}async hitTest(e,t){const i=await this.featureContainer.hitTest(t);if(i.length===0)return null;const r=await this.getWorker(),{features:s,aggregates:a}=await r.pipeline.getDisplayFeatures(i),n=this.featureContainer.getSortKeys(i),o=({displayId:l},{displayId:u})=>n.has(l)&&n.has(u)?n.get(l)-n.get(u):l-u;return s.sort(o).reverse(),a.sort(o).reverse(),[...a.map(l=>this._createGraphicHit(e,Oe.fromJSON(l))),...s.map(l=>this._createGraphicHit(e,we.fromJSON(l)))]}async queryStatistics(){const e=await this.getWorker();return b(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,i);return b(a,{})}async queryAggregateSummaryStatistics(e,t,i){const r={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),r,i);return b(s,{})}async queryUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForHistogram(this._cleanUpQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(i=>{const r=Ie.fromJSON(i);return r.features.forEach(s=>this._setLayersForFeature(s)),r})}async queryVisibleFeatures(e,t){const i=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),r=await b(i,{features:[]}),s=Ie.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregates(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),r=await b(i,{features:[]}),s=ti.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregateIds(e,t){const i=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return b(i,[])}async queryAggregateCount(e,t){const i=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return b(i,0)}async queryAggregateJSON(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return b(i,{features:[]})}async queryFeaturesJSON(e,t){const i=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return b(i,{features:[]})}async queryObjectIds(e,t){const i=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return b(i,[])}async queryFeatureCount(e,t){const i=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return b(i,0)}async queryExtent(e,t){const i=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),r=await b(i,{count:0,extent:null});return{count:r.count,extent:ht.fromJSON(r.extent)}}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this._subscriptionManager.update(e.targetState,this._lastTargetState);this.featureContainer.setVisibleTiles(t)}attach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),K(this._updatingHandles.addPromise(this._workerAttached.promise)),K(this._attachProxy()),this.featureContainer=new ni(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new or({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),K(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([pe(()=>JSON.stringify({displayRefreshVersion:this._displayRefreshVersion,timeExtent:this.timeExtent,clips:this.clips,filter:this.filter,featureEffect:this.featureEffect,sourceRefreshVersion:this._sourceRefreshVersion,timeZone:this.view.timeZone,effect:this.featureEffect,...this.layerAdapter.getUpdateHashProperties(this.view)}),()=>this._update(),ft),pe(()=>this.updateSuspended,e=>{e||(this._subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),pe(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this.layer.type!=="stream"&&this.layer.type!=="parquet"&&this.layer.type!=="catalog-footprint"&&this.addAttachHandles(this.layer.on("edits",e=>this._edit(e)))}detach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=yt(this._subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=ye(),K(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&this.layer.renderer!=null,t=this._commandsQueue.updateTracking.updating,i=this._updatingRequiredFieldsPromise!=null,r=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||i)||r||this._pipelineUpdating||this.dataUpdating;if(g("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s} +import{v as h,S as f,i as Q,a0 as ut,aS as Ae,b as ye,b9 as K,o as C,bE as ct,bt as Me,bi as we,ag as dt,aq as pt,a2 as Pe,n as ht,K as g,ah as pe,aL as ft,aA as yt,a1 as x,hC as ke,aU as Ne,j2 as mt,j as et,J as gt,$ as he,I as bt,P as ae,bV as Fe,eK as Ue,hm as St,bh as vt,et as H,ax as _t,ai as Be,ed as Le,j3 as De,dW as wt,j4 as je,j5 as It,j6 as Je,j7 as Vt,j8 as Ft,e4 as oe,dX as ve,iJ as xt,ae as tt,d$ as it,e0 as Et,d_ as Rt}from"./story-Doly9N9p.js";import{t as Ot}from"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import{c as $e}from"./Container-BcuL1ZEG-DVZvemLA.js";import{k as Qe}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import ee from"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import{T as Ct}from"./timeSupport-ohWmWReZ-D2lpSlXU.js";import{O as Ie}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{b as me}from"./Query-BrwMGK8U-BPr0_G9t.js";import{X as Tt,Y as zt}from"./LayerView-Bish-E63-DK1SFHE3.js";import{i as qt}from"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import{j as At,Z as He,G as Ge}from"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import{s as Mt,E as le,R as L,h as Pt,N as We}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{_ as kt,u as te,o as S,Q as A,h as xe,r as E,W as ge,U as Nt,b as ue,N as k,c as ie,l as Ee}from"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import{D as Re,k as G,bt as Ut,bu as Bt}from"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import{i as rt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import{s as Y}from"./TileKey-C5IL-JBr-BGwa3-Dg.js";import{i as Lt}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{q as Dt}from"./workers-PiCjreoO-Dc6Tqm-o.js";import{h as jt}from"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import{L as be}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{m as Jt}from"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import{i as q}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{p as $t}from"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import{Q as Qt}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{x as Ht}from"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import{r as j,o as ce}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{V as Gt}from"./SDFHelper-B6k8Ig6R-CgiA_-9V.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import{l as de}from"./definitions-DJSdSb77-DkoRHaVx.js";import{n as Wt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{i as Kt}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import{x as Zt}from"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import{i as Ke}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{m as _e,h as Yt}from"./popupUtils-nV1O8RUO-BYG2KoFf.js";import{n as Xt}from"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";import"./main-QGPoLsvl.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";let fe=class extends we{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.sourceLayer?.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};h([f({type:Boolean})],fe.prototype,"isAggregate",void 0),fe=h([Q("esri.AggregateGraphic")],fe);const Oe=fe;let v=class extends et{constructor(e){super(e),this._filter=null,this.duration=g("mapview-transitions-duration"),this._excludedEffectView=new $e(e),this._includedEffectView=new $e(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){return this._filter||this.featureEffect?.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}get transitioningToEmpty(){return!this._excludedEffectView.final&&!this._includedEffectView.final}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)}endTransition(){this._includedEffectView.endTransition(),this._excludedEffectView.endTransition(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),i=e,r=i?.includedEffect,s=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?.filter||t?.filter||null,a||this.endTransition()}};h([f()],v.prototype,"_filter",void 0),h([f()],v.prototype,"_excludedEffectView",void 0),h([f()],v.prototype,"_includedEffectView",void 0),h([f()],v.prototype,"duration",void 0),h([f()],v.prototype,"excludedEffects",null),h([f()],v.prototype,"featureEffect",null),h([f()],v.prototype,"filter",null),h([f()],v.prototype,"hasEffects",null),h([f()],v.prototype,"includedEffects",null),h([f({value:0})],v.prototype,"scale",null),h([f()],v.prototype,"transitioning",null),h([f()],v.prototype,"transitioningToEmpty",null),v=h([Q("esri.layers.effects.FeatureEffectView")],v);const ei=v;let X=class extends Ie{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){const i=gt.fromJSON(t.spatialReference),r=[];for(let s=0;se)break;this._updateTile(t),this._pendingUpdates.dequeue()}}removeTile(e){const t=this._tiles.get(e);g("esri-2d-update-debug")&&console.debug(`Tile[${e}] RenderState.removeTile`),t?.destroy(),this._tiles.delete(e)}isTileDone(e){const t=this._tiles.get(e.id);return!!t&&t.isReady}flush(){for(;this._pendingUpdates.size;){const e=this._pendingUpdates.dequeue();e!=null&&this._updateTile(e)}for(const e of this._tiles.values())e.upload()}_updateTile(e){const{inner:t,objectIdMap:i}=e,r=this.getSubscriptionVersion(t.id);if(r!==t.subscriptionVesrion){if(g("esri-2d-update-debug")){const o=`${t.subscriptionVesrion} != ${r}`;console.debug(`Version[${o}] Tile[${t.id}] FeatureContainer - Dropping message, outdated version]`,t)}return}if(g("esri-2d-update-debug")){const o=t.debugInfo?.chunkId??"";console.debug(`Version[${t.version}] Tile[${t.id}] Chunk[${o}] RenderState.updateTile [${t.type}]`,t)}const s=this._ensureTile(t.id);if(t.type==="update"){const[o,...l]=t.modify;s.onMessage({type:"update",modify:o,remove:t.remove,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const u of l){const d=this._tiles.get(u.tileId);d&&d.onMessage({type:"update",modify:u,remove:t.remove,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}return}if(t.append==null)return void s.onMessage({type:"append",clear:t.clear,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});const[a,...n]=t.append;s.onMessage({type:"append",clear:t.clear,append:a,debugInfo:t.debugInfo,end:t.end,attributeEpoch:t.attributeEpoch,objectIdMap:i});for(const o of n){const l=this._tiles.get(o.tileId);l&&l.onMessage({type:"update",modify:o,remove:[],sort:!1,end:!1,isPixelBuffer:!0,attributeEpoch:null,objectIdMap:i})}}_ensureTile(e){if(!this._tiles.has(e)){const t=this._createTile(e);this._copyPixelBufferedEntitiesInto(t),this._tiles.set(e,t)}return this._tiles.get(e)}_createTile(e){g("esri-2d-update-debug")&&console.debug(`Version[${this.version}] Tile[${e}] RenderState.createTile`);const t=new Y(e),i=this._tileInfoView.getTileBounds(vt(),t),r=this._tileInfoView.getTileResolution(t.level),s=new Lt(t,r,i[0],i[3],!0);if(s.stage=this.getStage(),!s.stage){const a=new C("featurelayerview:webgl","Cannot create tile with empty stage");x.getLogger("esri.views.2d.layers.features.RenderState").error(a)}return s}_copyPixelBufferedEntitiesInto(e){let t=7;const i=this._tileInfoView.getLODInfoAt(e.key);for(let r=-1;r<=1;r++)for(let s=-1;s<=1;s++){if(r===0&&s===0)continue;const a=e.key.getNormalizedNeighbor(s,r,i).id,n=this._tiles.get(a);if(n!=null){const o=1<i.needsUpload);t.length&&(t[Math.floor(Math.random()*t.length)].upload(),t.length>=2&&this.requestRender());for(const i of this._renderState.tiles())i.tryReady(this.attributeView.currentEpoch)&&(this._subscriptions.get(i.key.id)?.end(),this._layerView.requestUpdate(),this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this.requestRender())}for(const t of this.children)t.setTransform(e.state);switch(super.renderChildren(e),e.drawPhase){case le.MAP:return this._renderMapPhase(e);case le.HIGHLIGHT:return this._renderHighlightPhase(e);case le.LABEL:return this._renderLabelPhase(e)}}subscriptions(){return this._subscriptions.values()}get _instanceStore(){return this._store}get instanceStore(){return this._store}get layerView(){return this._layerView}get hasLabels(){return this._layerView.labelingCollisionInfos.length>0}get hasHighlight(){return this._layerView.hasHighlight()}get _layer(){return this._layerView.layer}_getHeatmapInstance(e){if(this._instanceStore==null||!(e.drawPhase&S.heatmap.drawPhase))return null;for(const t of this._instanceStore.values())if(oi(t))return t;return null}get children(){return this._renderState?Array.from(this._renderState.tiles()).filter(e=>this._visibleTiles.has(e.key.id)):[]}updateAttributeView(e){this.requestRender(),this.attributeView.requestUpdate(e),this.hasLabels&&this._layerView.view.labelManager.requestUpdate()}updateSubscriptions(e){for(const{tileId:t,version:i}of e.subscribe)if(this._subscriptions.has(t))this._subscriptions.get(t).version=i;else{const r=new ai(t,i);this._subscriptions.set(t,r),this.updatingHandles.addPromise(r.promise)}for(const t of e.unsubscribe)this._subscriptions.get(t)?.destroy(),this._subscriptions.delete(t),this.removeTile(t)}isDone(e){return!!this._renderState&&this._renderState.isTileDone(e)}async updateRenderState(e){g("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureContainer.updateRenderState`),this._renderStateNext=new si(()=>this._stage,t=>this._subscriptions.get(t)?.version,e,this.tileInfoView)}getDisplayStatistics(e,t){const i=this._statisticsByLevel.get(e);return i?i.get(t):null}updateStatistics(e,t){if(this._lockStatisticUpdates)return void this._updateStatisticsRequests.push({level:e,statistics:t});let i=this._statisticsByLevel.get(e);i||(i=new Map,this._statisticsByLevel.set(e,i));for(const r of t)i.set(r.fieldName,{minValue:r.minValue,maxValue:r.maxValue})}editStart(){this._renderState?.lockUploads(),this.attributeView.lockTextureUploads(),this._lockStatisticUpdates=!0}editEnd(){this._renderState?.unlockUploads(),this.attributeView.unlockTextureUploads(),this._lockStatisticUpdates=!1;for(const e of this._updateStatisticsRequests)this.updateStatistics(e.level,e.statistics);this._updateStatisticsRequests=[],this.requestRender()}swapRenderState(){this._renderStateNext&&(g("esri-2d-update-debug")&&console.debug(`Version[${this._renderStateNext.version}] FeatureContainer.update.swapRenderState`),this._renderState?.destroy(),this._renderState=this._renderStateNext,this._renderStateNext=null),this._renderState&&this._renderState.flush(),this.requestRender()}setVisibleTiles(e){this._visibleTiles=e}async onMessage(e,t){he(t);const i=e.inner;if(!this._subscriptions.has(i.id))return;const r=this._subscriptions.get(i.id);if(r.version!==i.subscriptionVesrion){if(g("esri-2d-update-debug")){const a=`${i.subscriptionVesrion} != ${r.version}`;console.debug(`Version[${a}] Tile[${i.id}] FeatureContainer - Dropping message, outdated version]`,i)}return}const s=this._renderStateNext??this._renderState;if(!s)throw new Error("InternalError: No renderState defined");s.version!==i.version&&console.error(`InternalError: Version mismatch. [renderState: ${s.version}, message: ${i.version}]`),s.enqueueUpdate(e),this.requestRender(),this._layerView.view.labelManager.requestUpdate(),this._layerView.requestUpdate()}removeTile(e){(this._renderState||this._renderStateNext)&&(this._renderState&&this._renderState.removeTile(e),this._renderStateNext&&this._renderStateNext.removeTile(e))}hitTest(e){let t=this._hitTestsRequests.find(({x:r,y:s})=>r===e.x&&s===e.y);const i=ye();return t?t.resolvers.push(i):(t={x:e.x,y:e.y,resolvers:[i]},this._hitTestsRequests.push(t)),this.requestRender(),i.promise}getSortKeys(e){const t=new Set(e),i=new Map;for(const r of this.children)if(r.getSortKeys(t).forEach((s,a)=>i.set(a,s)),i.size===t.size)break;return i}get hasAnimation(){return this.hasLabels}doRender(e){const{minScale:t,maxScale:i}=this._layer.effectiveScaleRange,r=e.state.scale;r<=(t||1/0)&&r>=i&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}setStencilReference(e){if(this._getHeatmapInstance(e)==null)super.setStencilReference(e);else for(const t of this.children)t.stencilRef=S.heatmap.getStencilReference(t)}_renderMapPhase(e){this._layerView.featureEffectView.hasEffects?(this._renderOutsideEffect(e),this._renderInsideEffect(e)):this._renderFeatures(e,L.All),this._hitTestsRequests.length>0&&this._renderHittest(e)}_renderHighlightPhase(e){this.hasHighlight&&Pt(e,!1,t=>{this._renderFeatures(t,L.Highlight)})}_renderLabelPhase(e){this._renderFeatures(e,L.All)}_renderInsideEffect(e){const t=e.painter.effects.insideEffect;t.bind(e),this._renderFeatures(e,L.InsideEffect),t.draw(e,this._layerView.featureEffectView.includedEffects),t.unbind()}_renderOutsideEffect(e){const t=e.painter.effects.outsideEffect;t.bind(e),this._renderFeatures(e,L.OutsideEffect),t.draw(e,this._layerView.featureEffectView.excludedEffects),t.unbind()}_renderHittest(e){const{context:t}=e,i=e.painter.effects.hittest,r=t.getBoundFramebufferObject(),s=t.getViewport(),a=e.passOptions,n=e.drawPhase;i.bind(e),e.passOptions=i.createOptions(e,this._hitTestsRequests),e.drawPhase=le.HITTEST;const{distance:o,smallSymbolDistance:l}=e.passOptions,u=Math.max(o,l);for(const d of this.children)d.visible&&d.containsScreenPoint(e.state,e.passOptions.position,2*u)&&this._renderTile(d,e,L.All);i.draw(e),i.unbind(),t.bindFramebuffer(r),t.restoreViewport(s),e.passOptions=a,e.drawPhase=n}_renderFeatures(e,t){const i=this._getHeatmapInstance(e);i!=null?this._renderHeatmapFeatures(e,t,i):this._renderGeometryFeatures(e,t)}_renderGeometryFeatures(e,t){for(const i of this.children)i.visible&&this._renderTile(i,e,t)}_renderHeatmapFeatures(e,t,i){for(const r of this.children)r.visible&&this._renderTile(r,e,t,Re.Heatmap);i.techniqueRef.renderResolvePass(e,i)}_renderTile(e,t,i,r){const s=g("featurelayer-force-marker-text-draw-order")?We.STRICT_MARKERS_AND_TEXT:We.BATCHING,a=e.getDisplayList(this._instanceStore,s);t.selection=i,a?.render(t,r)}};function oi(e){return e.techniqueRef.type===Re.Heatmap}async function li(e){const t=await Dt("FeaturePipelineWorker",{client:e,strategy:"dedicated"});return new ui(t)}let ui=class{constructor(e){this._connection=e,this.pipeline=this._connection.createInvokeProxy(),this.features=this._connection.createInvokeProxy("features"),this.aggregates=this._connection.createInvokeProxy("aggregates"),this.streamMessenger=this._connection.createInvokeProxy("streamMessenger")}destroy(){this._connection.destroy()}get closed(){return this._connection.closed}};const ci=10;let O=class extends et{constructor(){super(...arguments),this.events=new bt,this._updatingStrategy=!0,this._tileToEvent=new jt,this._fetchStatus={outstanding:0,done:0}}get hasAllFeatures(){return this._hasAllData()&&(this._strategyInfo?.willQueryAllFeatures??!1)}get hasAllFeaturesInView(){return this._hasAllData()}get hasFullGeometries(){return this._hasAllData()&&(this._strategyInfo?.willQueryFullResolutionGeometry??!1)}onEvent(e){switch(e.type){case"subscribe":case"unsubscribe":case"loaded":case"error":this._handleTileEvent(e);break;case"updateStrategyStart":this._updatingStrategy=!0,this._fetchStatus={done:0,outstanding:0},this._strategyInfo=e.about;break;case"updateStrategyEnd":this._updatingStrategy=!1;break;case"updateFieldsStart":this._fetchStatus={done:0,outstanding:0};break;case"updateFieldsEnd":break;case"updateFieldsError":this.events.emit("error",e);break;case"fetchStart":this._fetchStatus.outstanding+=1,this.events.emit("status",this._fetchStatus);break;case"fetchEnd":this._fetchStatus.done+=1,this.events.emit("status",this._fetchStatus),e.done&&(this._fetchStatus={done:0,outstanding:0})}}_hasAllData(){return!this._updatingStrategy&&this._hasAllTileData()}_hasAllTileData(){for(const e of this._tileToEvent.values())if(e.peekLast()?.type!=="loaded")return!1;return!0}_handleTileEvent(e){switch(e.type){case"subscribe":{const t=new rt(ci);t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"unsubscribe":this._tileToEvent.delete(e.tile);break;case"loaded":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t);break}case"error":{const t=this._tileToEvent.get(e.tile);if(!t)return;t.enqueue(e),this._tileToEvent.set(e.tile,t),this.events.emit("error",e);break}}}};h([f({readOnly:!0})],O.prototype,"hasAllFeatures",null),h([f({readOnly:!0})],O.prototype,"hasAllFeaturesInView",null),h([f({readOnly:!0})],O.prototype,"hasFullGeometries",null),h([f()],O.prototype,"_updatingStrategy",void 0),h([f()],O.prototype,"_strategyInfo",void 0),h([f()],O.prototype,"_tileToEvent",void 0),O=h([Q("esri.views.2d.layers.features.FeatureSourceEventLog")],O);function R(e){switch(e.geometryType){case"point":return"esriGeometryPoint";case"polyline":return"esriGeometryPolyline";case"polygon":return"esriGeometryPolygon";case"multipatch":return"esriGeometryMultiPatch";case"multipoint":return"esriGeometryMultipoint";default:return null}}function w(e,t){const i=e.featureReduction;return i&&i.type!=="selection"&&(!("maxScale"in i)||!i.maxScale||i.maxScale=r?n:a+s*(n-a)}function yi(e,t){const i=e/t.minDataValue,r=F(t.minSize,e),s=F(t.maxSize,e);let a=null;return a=i*r,tt(a,r,s)}function mi(e,t){const[i,r,s]=bi(e,t.cache.ipData);if(i===r)return F(t.stops[i].size,e);{const a=F(t.stops[i].size,e);return a+(F(t.stops[r].size,e)-a)*s}}function gi(e,t){const i=Jt[t.valueUnit],r=F(t.minSize,e),s=F(t.maxSize,e),{valueRepresentation:a}=t;let n=null;return n=a==="area"?2*Math.sqrt(e/di)/i:a==="radius"||a==="distance"?2*e/i:e/i,tt(n,r,s)}function bi(e,t){if(!t)return;let i=0,r=t.length-1;return t.some((s,a)=>et.deconflictionStrategy!=="none"))??!1}function N(e,t){const i=w(e,t);if(i?.labelsVisible&&i.labelingInfo?.length)return i.labelingInfo.every(r=>r.deconflictionStrategy!=="none")}function Si(e){return t=>H(st(t,e))}function M(e){const t=e!=null&&"visualVariables"in e&&e.visualVariables;if(!t)return null;for(const i of t)if(i.type==="size")return Si(i);return null}function U(e,t,i,r){const s=e.subtypeCode!=null?`${e.subtypeField} = ${e.subtypeCode}`:null,a=Fe(e.definitionExpression,s),n=e.customParameters??{};return r&&(n.token=r),{type:"feature",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{queryScaleRanges:e.queryScaleRanges??[],definitionExpression:a,gdbVersion:e.gdbVersion,historicMoment:e.historicMoment?.getTime(),timeExtent:e.timeExtent?.toJSON(),customParameters:n}}}}function vi(e,t,i=0){if(t==null)return e[i]=0,e[i+1]=0,e[i+2]=0,void(e[i+3]=0);const{r,g:s,b:a,a:n}=t;e[i]=r*n/255,e[i+1]=s*n/255,e[i+2]=a*n/255,e[i+3]=n}async function T(e,t){if(!e)return[];switch(e.type){case"simple-fill":return Ve(e,t);case"picture-fill":return Ci(e,t);case"simple-marker":return Ze(e,t);case"picture-marker":return Vi(e,t);case"simple-line":return J(e,t,!1);case"text":return xi(e,t);case"label":return Ei(e,t);case"cim":return te(e.data,t);case"web-style":{const i=await e.fetchCIMSymbol();return te(i.data,t)}case"line-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-line`),J(new Rt,t,!1);case"point-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-marker`),Ze(new Et,t);case"polygon-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Defaulting to simple-fill`),Ve(new it,t);case"mesh-3d":case"label-3d":return x.getLogger("esri.views.layers.FeatureLayerView").warn("unsupported-symbol",`Symbol of type "${e.type}" unsupported in MapView. Ignoring`),[];case"CIMSymbolReference":throw new Error("InternalError: CIMSymbolReference should already be resolved")}}async function _i(e,t){const{schemaOptions:i}=t,{store:r}=i,s=new Array(de),a=new Array(de/4);for(let c=0;cue(n.color)),visualVariableOpacity:s.visualVariableOpacity,visualVariableSizeMinMaxValue:s.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:s.visualVariableSizeScaleStops,visualVariableSizeStops:s.visualVariableSizeStops,visualVariableSizeUnitValue:s.visualVariableSizeUnitValue,hittestUniforms:null},numberOfFields:e.attributes.length},optionalAttributes:{}}).createMeshInfo({size:e.size,outlineWidth:r,effects:null,scaleInfo:null,minPixelBuffer:k(s)});return[...e.backgroundFillSymbol?await Ve(e.backgroundFillSymbol,{schemaOptions:t,path:"",uniforms:ge}):[],a]}function at(e){if(e.style==="path"){if(e.path==null)throw new Error("Symbol with a style of type path must define a path");return{type:"sprite-rasterization-param",overrides:[],resource:{type:"path",path:e.path,asFill:!0}}}const t=G.fromSimpleMarker(e);if("outline"in e&&e.outline&&e.outline.style!=="none"&&e.outline.style!=="solid"){if(!t||!t.symbolLayers)throw new Error("Error handling marker! ");return{type:"sprite-rasterization-param",resource:t.symbolLayers[0],overrides:[]}}return{type:"sprite-rasterization-param",resource:Gt(t),overrides:[]}}async function Ze(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;if(e.style==="path"||e.outline&&e.outline.style!=="solid"&&e.outline.style!=="none"){const p=G.fromSimpleMarker(e);if(!p||!p.symbolLayers)throw new Error("Error handling marker! ");if(i.visualVariableRotation&&(p.angleAlignment="Map"),e.style!=="path"){const y=p.symbolLayers[0];if(ie(t.uniforms)){const m=k(t.uniforms,0,1);if(m>y.size){const I=m/y.size;y.size=m;const V=y.markerGraphics?.[0].symbol;(V.symbolLayers&&V.symbolLayers[0]).width*=I}}}return te({type:"CIMSymbolReference",symbol:p},t)}const a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=at(e);let o=e.color?.toArray()??[0,0,0,0];n.resource.type==="CIMVectorMarker"&&(o=[255,255,255,255]);const l=e.style==="triangle"?124/116:1,u=e.size,d=u*l,c=i.visualVariableColor!=null&&(e.style==="cross"||e.style==="x");return[a.createMeshInfo({type:"simple",color:o,height:u,width:d,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:e.outline?.color?.toArray()??[0,0,0,0],outlineSize:e.outline?.width??1,referenceSize:u,sprite:n,overrideOutlineColor:c,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]}function Vi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=s.ensureInstance(S.marker,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue,visualVariableRotation:i.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),n=G.createPictureMarkerRasterizationParam(e);return n?[a.createMeshInfo({type:"picture",color:[255,255,255,255],height:e.height,width:e.width,offsetX:e.xoffset,offsetY:e.yoffset,angle:e.angle,alignment:Ee(i)?j.MAP:j.SCREEN,outlineColor:null,outlineSize:0,referenceSize:e.height,sprite:n,overrideOutlineColor:!1,hasSizeVV:ie(i),placement:null,effects:null,transforms:null,scaleInfo:null,minPixelBuffer:k(i)})]:[]}function Fi(e,t,i){const{uniforms:r,schemaOptions:s}=i,{store:a}=s,n=a.ensureInstance(S.marker,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue,visualVariableRotation:r.visualVariableRotation},optionalAttributes:{zoomRange:!1}}),o=at(e),l=6,u=l*t.width,d=u,c=e.color?.toArray()??t.color?.toArray()??[0,0,0,0],p=e.style==="cross"||e.style==="x";let y;switch(e.placement){case"begin-end":y=ce.Both;break;case"begin":y=ce.JustBegin;break;case"end":y=ce.JustEnd;break;default:y=ce.None}const m={type:"cim-marker-placement-param",placement:{type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:y,offsetAlongLine:0},overrides:[]};return[n.createMeshInfo({type:"simple",color:c,height:d,width:u,offsetX:0,offsetY:0,angle:0,alignment:Ee(r)?j.MAP:j.SCREEN,outlineColor:c,outlineSize:p?t.width:0,referenceSize:d/l,sprite:o,overrideOutlineColor:p&&r.visualVariableColor!=null,hasSizeVV:ie(r),placement:m,transforms:null,effects:null,scaleInfo:null,minPixelBuffer:k(r)})]}function xi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r;return[s.ensureInstance(S.text,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableRotation:i.visualVariableRotation,visualVariableSizeMinMaxValue:i.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:i.visualVariableSizeScaleStops,visualVariableSizeStops:i.visualVariableSizeStops,visualVariableSizeUnitValue:i.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1,clipAngle:!1,referenceSymbol:!1}}).createMeshInfo({boxBackgroundColor:e.backgroundColor?.toArray(),boxBorderLineColor:e.borderLineColor?.toArray(),boxBorderLineSize:e.borderLineSize??0,color:e.color?.toArray()??[0,0,0,0],offsetX:e.xoffset,offsetY:e.yoffset,postAngle:e.angle,fontSize:e.font.size,decoration:e.font.decoration,haloColor:e.haloColor?.toArray()??[0,0,0,0],haloSize:e.haloSize??0,outlineColor:[0,0,0,0],outlineSize:0,lineWidth:e.lineWidth,lineHeightRatio:e.lineHeight,horizontalAlignment:e.horizontalAlignment,verticalAlignment:e.verticalAlignment,useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:e.font.toJSON(),textString:e.text,symbol:G.createCIMTextSymbolfromTextSymbol(e)},overrides:[]},referenceSize:null,effects:null,placement:null,scaleInfo:null,transforms:null,scaleFactor:1,minPixelBuffer:k(i),repeatLabel:null,repeatLabelDistance:null,allowOverrun:null,labelPosition:null})]}function Ei(e,t){const{schemaOptions:i,uniforms:r}=t,{store:s}=i,a=e.symbol,{allowOverrun:n,repeatLabel:o,repeatLabelDistance:l}=e,u={maxScale:e.maxScale??0,minScale:e.minScale??0},d=s.ensureInstance(S.label,{uniforms:{visualVariableColor:null,visualVariableOpacity:null,visualVariableRotation:r.visualVariableRotation,visualVariableSizeMinMaxValue:r.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:r.visualVariableSizeScaleStops,visualVariableSizeStops:r.visualVariableSizeStops,visualVariableSizeUnitValue:r.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!0,clipAngle:!0,referenceSymbol:!0}}),c=e.labelPlacement,[p,y]=Ut(c);return[d.createMeshInfo({boxBackgroundColor:a.backgroundColor?.toArray(),boxBorderLineColor:a.borderLineColor?.toArray(),boxBorderLineSize:a.borderLineSize??0,color:a.color?.toArray()??[0,0,0,0],offsetX:a.xoffset,offsetY:a.yoffset,postAngle:a.angle,fontSize:a.font.size,decoration:a.font.decoration,outlineColor:[0,0,0,0],outlineSize:0,haloColor:a.haloColor?.toArray()??[0,0,0,0],haloSize:a.haloSize??0,lineWidth:a.lineWidth,lineHeightRatio:a.lineHeight,horizontalAlignment:p,verticalAlignment:y,repeatLabel:o,repeatLabelDistance:H(l),allowOverrun:n,labelPosition:e.labelPosition,scaleInfo:u,minPixelBuffer:k(r),useCIMAngleBehavior:!1,glyphs:{type:"text-rasterization-param",resource:{type:"text",font:a.font.toJSON(),textString:a.text,symbol:G.createCIMTextSymbolfromTextSymbol(a),primitiveName:"label-override"},useLegacyLabelEvaluationRules:e.labelExpressionInfo?.expression==null,overrides:[{type:"CIMPrimitiveOverride",valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.labelExpressionInfo?.expression??e.labelExpression,returnType:"String"},primitiveName:"label-override",propertyName:"textString",defaultValue:""}]},referenceSize:null,effects:null,placement:null,transforms:null,scaleFactor:1})]}function Ce(e,t){const i=e.width;return{outlineColor:e.color?.toArray()||[0,0,0,1],width:i,referenceWidth:i,capType:e.cap??"round",joinType:e.join??"round",miterLimit:e.miterLimit,hasSizeVV:t}}function Ri(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0],n={type:"sprite-rasterization-param",resource:{type:"fill-style",style:e.style},overrides:[]};if(e.outline?.style==="solid")return[s.ensureInstance(S.patternOutlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),sprite:n,scaleInfo:null,effects:null})];const o=[],l=s.ensureInstance(S.patternFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:e.color?.toArray()??[0,0,0,0],sprite:n,scaleInfo:null,effects:null});return o.push(l),e.outline&&o.push(...J(e.outline,t,!0)),o}function Oi(e,t){const{uniforms:i,schemaOptions:r}=t,{store:s}=r,a=e.color?.toArray()??[0,0,0,0];if(e.style!=="none"&&e.outline?.style==="solid")return[s.ensureInstance(S.outlineFill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity,visualVariableSizeScaleStops:i.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,...Ce(e.outline,!!i.visualVariableSizeOutlineScaleStops),scaleInfo:null,effects:null})];const n=[];if(e.style!=="none"){const o=s.ensureInstance(S.fill,{uniforms:{visualVariableColor:i.visualVariableColor,visualVariableOpacity:i.visualVariableOpacity},optionalAttributes:{zoomRange:!1}}).createMeshInfo({color:a,scaleInfo:null,effects:null});n.push(o)}return e.outline&&n.push(...J(e.outline,t,!0)),n}async function Ve(e,t){if(e.type==="cim")return te(e.data,t);const{style:i}=e;return i&&i!=="none"&&i!=="solid"?Ri(e,t):Oi(e,t)}function Ci(e,t){const{outline:i}=e,{uniforms:r,schemaOptions:s}=t,{store:a}=s,n=[],o=G.createPictureFillRasterizationParam(e);if(!o)return[];const{width:l,height:u,xoffset:d,yoffset:c,xscale:p,yscale:y}=e,m={color:[255,255,255,255],sprite:o,height:u,aspectRatio:l/u,offsetX:d,offsetY:c,scaleX:p,scaleY:y,angle:0,applyRandomOffset:!1,sampleAlphaOnly:!1,scaleProportionally:!1,effects:null,scaleInfo:null};if(i?.style==="solid")return[a.ensureInstance(S.complexOutlineFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity,visualVariableSizeScaleStops:r.visualVariableSizeOutlineScaleStops,visualVariableSizeMinMaxValue:null,visualVariableSizeStops:null,visualVariableSizeUnitValue:null},optionalAttributes:{zoomRange:!1}}).createMeshInfo({...m,...Ce(i,!!r.visualVariableSizeOutlineScaleStops)})];const I=a.ensureInstance(S.complexFill,{uniforms:{visualVariableColor:r.visualVariableColor,visualVariableOpacity:r.visualVariableOpacity},optionalAttributes:{zoomRange:!1}});return n.push(I.createMeshInfo(m)),i&&n.push(...J(i,t,!0)),n}function J(e,t,i){const{color:r,style:s,width:a,cap:n,join:o}=e,{schemaOptions:l}=t,{store:u}=l,d=[],c=i?{...ge,visualVariableSizeScaleStops:t.uniforms.visualVariableSizeOutlineScaleStops}:t.uniforms,p={uniforms:{visualVariableColor:c.visualVariableColor,visualVariableOpacity:c.visualVariableOpacity,visualVariableSizeMinMaxValue:c.visualVariableSizeMinMaxValue,visualVariableSizeScaleStops:c.visualVariableSizeScaleStops,visualVariableSizeStops:c.visualVariableSizeStops,visualVariableSizeUnitValue:c.visualVariableSizeUnitValue},optionalAttributes:{zoomRange:!1}},y={color:r?.toArray()??[0,0,0,0],width:a,referenceWidth:a,capType:n,joinType:o,miterLimit:e.miterLimit,hasSizeVV:ie(c),effects:null,scaleInfo:null};if(s==null||s==="solid"){const m=u.ensureInstance(S.line,p).createMeshInfo(y);d.push(m)}else if(s!=="none"){const m=u.ensureInstance(S.texturedLine,p).createMeshInfo({...y,offsetAlongLine:0,shouldScaleDash:!0,shouldSampleAlphaOnly:!1,isSDF:!0,sprite:{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:Bt(s,n)},overrides:[]}});d.push(m)}return e.marker!=null&&d.push(...Fi(e.marker,e,t)),d}async function re(e,t,i){const r=t.labelsVisible&&t.labelingInfo||[],s=R(t),a=Qt(r,s);return{type:"label",classes:await Promise.all(a.map((n,o)=>Ti(e,n,o,i)))}}async function Ti(e,t,i,r){const s=await T(t,{path:`${i}`,schemaOptions:e,uniforms:r});return{maxScale:t.maxScale,minScale:t.minScale,expression:t.labelExpressionInfo?.expression??t.labelExpression,where:t.where,meshes:s}}async function se(e,t){if(!t)return{type:"simple",meshes:[]};switch(t.type){case"simple":return zi(e,t);case"dot-density":return qi(e,t);case"class-breaks":return Ai(e,t);case"unique-value":return Mi(e,t);case"dictionary":return Pi(t);case"heatmap":return ki(e,t);case"pie-chart":return Ni(e,t)}}async function zi(e,t){const i=t.getSymbols(),r=i.length?i[0]:null,s=E(t);return{type:"simple",meshes:await T(r,{schemaOptions:e,uniforms:s,path:"renderer.symbol"})}}async function qi(e,t){const i=E(t);return{type:"dot-density",meshes:await _i(t,{schemaOptions:e,uniforms:i,path:"renderer.symbol"})}}async function Ai(e,t){const i=E(t),r=t.backgroundFillSymbol,s=t.normalizationType,a=s==="log"?"esriNormalizeByLog":s==="percent-of-total"?"esriNormalizeByPercentOfTotal":s==="field"?"esriNormalizeByField":null,n=t.classBreakInfos.map(async d=>({meshes:await T(d.symbol,{path:`renderer-stop-${d.minValue}-${d.maxValue}`,schemaOptions:e,uniforms:i}),min:d.minValue,max:d.maxValue})),o=(await Promise.all(n)).sort((d,c)=>d.min-c.min),l=await T(r,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:i.visualVariableSizeOutlineScaleStops}}),u=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:i});return{type:"interval",field:t.field,expression:t.valueExpression,backgroundFill:l,defaultSymbol:u,intervals:o,normalizationField:t.normalizationField,normalizationTotal:t.normalizationTotal,normalizationType:a,isMaxInclusive:t.isMaxInclusive}}async function Mi(e,t){const i=[],r=E(t),s=await T(t.backgroundFillSymbol,{schemaOptions:e,path:"renderer.backgroundFill",uniforms:{...ge,visualVariableSizeOutlineScaleStops:r.visualVariableSizeOutlineScaleStops}}),a=await T(t.defaultSymbol,{schemaOptions:e,path:"renderer.defaultSymbol",uniforms:r});for(const n of t.uniqueValueInfos??[]){const o=await T(n.symbol,{path:`renderer-unique-value-${n.value}`,schemaOptions:e,uniforms:r});i.push({value:""+n.value,symbol:o})}return{type:"map",field:t.field,expression:t.valueExpression,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,backgroundFill:s,defaultSymbol:a,map:i}}function Pi(e){const t=E(e),i=e.scaleExpression,r=i!=null&&i!=="1"?{valueExpressionInfo:{type:"CIMExpressionInfo",expression:e.scaleExpression,returnType:"Numeric"},defaultValue:1}:void 0;return{type:"dictionary",fieldMap:e.fieldMap,scaleExpression:r,visualVariableUniforms:t}}async function ki(e,t){return{type:"heatmap",meshes:await wi(t,e)}}async function Ni(e,t){return{type:"pie-chart",meshes:await Ii(t,e)}}async function Ui(e,t){const i=t.renderer,r=E(i);return{symbology:await se(e,i),labels:await re(e,t,r)}}async function P(e,t,i,r){const s=i.featureReduction;if(s)switch(s.type){case"binning":return Li(s,e,t,i,r);case"cluster":return Di(s,e,t,i,r)}const a=ji(i.orderBy,i.renderer,i.objectIdField),n=xe(i.renderer,t.filters),o=await Ui(e,i),l=Te(o.symbology);return{storage:n,mesh:{properties:{sortKey:a,timeZone:t.timeZone,returnMeshObjectId:l,displayRefreshVersion:r},strategy:{type:"feature"},factory:o}}}function nt(e,t){return e.fields.map(i=>({...i.toJSON(),type:Bi(i,t)}))}function Bi(e,t){const{onStatisticExpression:i,onStatisticField:r,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:n}=i;return n?n==="string"?"esriFieldTypeString":"esriFieldTypeDouble":"esriFieldTypeString"}const a=t.find(n=>n.name===r);return a?a.type:"esriFieldTypeString"}}}async function Li(e,t,i,r,s){const a=nt(e,r.fields),n=e.renderer,o=await se(t,n),l=xe(n,[null,null]),u=E(n),d=await re(t,{geometryType:"polygon",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},u),c=Te(o),p=e.binType==="geohash"?{type:"geohash",fixBinLevel:e.fixedBinLevel??3}:{type:"grid",size:H(e.size),fixedBinLevel:e.fixedBinLevel};return{storage:l,mesh:{properties:{sortKey:null,timeZone:i.timeZone,returnMeshObjectId:c,displayRefreshVersion:s},strategy:{type:"binning",fields:a,index:p,featureFilter:i.filters[0]},factory:{labels:d,symbology:o}}}}async function Di(e,t,i,r,s){const a=nt(e,r.fields),n={type:"cluster",feature:await se(t,e.effectiveFeatureRenderer),cluster:await se(t,e.effectiveClusterRenderer)},o=E(e.effectiveFeatureRenderer),l={type:"cluster",feature:await re(t,r,o),cluster:await re(t,{geometryType:"point",labelingInfo:e.labelingInfo,labelsVisible:e.labelsVisible},o)},u=xe(e.effectiveFeatureRenderer,[null,null]),d=Te(n);return{storage:u,mesh:{properties:{sortKey:null,timeZone:i.timeZone,displayRefreshVersion:s,returnMeshObjectId:d},strategy:{type:"cluster",fields:a,featureFilter:i.filters[0],clusterRadius:H(e.clusterRadius/2)},factory:{labels:l,symbology:n}}}}function ji(e,t,i){const r=t!=null&&t.type==="unique-value"&&t.orderByClassesEnabled;if(e!=="default"||r||(e=[new $t({field:i,order:"descending"})]),e!=="default"&&e?.length){e.length;const s=e[0],a=s.order==="ascending"?"asc":"desc";return s.field?{field:s.field,order:a}:s.valueExpression?{expression:s.valueExpression,order:a}:null}return r?{byRenderer:!0,order:"asc"}:null}function Z(e){return e.techniqueType===Re.AnimatedMarker}function Te(e){return!!(e.type==="simple"&&e.meshes.some(Z)||e.type==="interval"&&(e.intervals.some(t=>t.meshes.some(Z))||e.backgroundFill.some(Z))||e.type==="map"&&(e.map.some(t=>t.symbol.some(Z))||e.backgroundFill.some(Z)))}let Ji=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,globalIdField:a,datesInUnknownTimezone:n,orderBy:o,parsedUrl:l}=t,u=t.fieldsIndex.toJSON(),d=R(t),c=t.timeInfo?.toJSON(),p=t.spatialReference.toJSON(),y=ae(l);let m=s;if(o?.length){const I=!o[0].valueExpression&&o[0].field;I&&(m=I)}return{type:"feature-service",source:y,isSourceHosted:be(y.path),orderByFields:m,outSpatialReference:e.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:n,globalIdField:a,fieldsIndex:u,geometryType:d,objectIdField:s,timeInfo:c,spatialReference:p,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:null}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s,apiKey:a}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,a)}createProcessorSchema(e,t,i){const{fields:r,geometryType:s,orderBy:a,objectIdField:n,renderer:o,labelingInfo:l,labelsVisible:u}=this.layer,d={featureReduction:null,fields:r.map(c=>c.toJSON()),geometryType:s,labelingInfo:l,labelsVisible:u,objectIdField:n,orderBy:a??"default",renderer:o?.clone()};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,apiKey:r,renderer:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,apiKey:r,customParameters:n,definitionExpression:i,labelingInfo:a,orderBy:o,renderer:s}}setGraphicOrigin(e){e.origin={type:"catalog",layer:this.layer}}};function ze(e,t){const i=e.extent,r=t?.clone().intersection(i),s=r!=null?r.width*r.height:0,a=t?t.width*t.height:0,n=a===0?0:s/a,o=g("featurelayer-snapshot-point-coverage");return!isNaN(n)&&n>=o}function $(e,t){return e.floorInfo!=null&&(e.floorInfo.viewAllLevelIds.length>0||t.floors.length>0)}function qe(e,t,i){const r=$i(e,t?.where,i);return r&&(t??=new ee,t.where=r),t}function $i(e,t,i){if(e.floorInfo==null||!i.floors?.length)return t;let r=i.floors;const{floorField:s,viewAllLevelIds:a}=e.floorInfo;a.length&&(r=a);const n=r.filter(l=>l!=="").map(l=>"'"+l+"'");if(n.push("''"),t?.includes(s)){let l=new RegExp("AND \\("+s+".*NULL\\)","g");t=t.replace(l,""),l=new RegExp("\\("+s+".*NULL\\)","g"),t=(t=t.replace(l,"")).replaceAll(/\s+/g," ").trim()}let o="("+s+" IN ({ids}) OR "+s+" IS NULL)";return o=o.replace("{ids}",n.join(", ")),Fe(t,o)}let Qi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,editingInfo:r,objectIdField:s,typeIdField:a,globalIdField:n,datesInUnknownTimezone:o,orderBy:l,subtypeField:u,refreshInterval:d}=t,c=t.fieldsIndex.toJSON(),p=R(t),y=t.timeInfo?.toJSON(),m=t.spatialReference.toJSON(),I=t.types?.map(B=>B.toJSON()),V=ae(this.layer.parsedUrl);this.layer.dynamicDataSource&&(V.query={layer:JSON.stringify({source:this.layer.dynamicDataSource})});let W=this.layer.objectIdField;if(l?.length){const B=!l[0].valueExpression&&l[0].field;B&&(W=B)}const Se=r?.lastEditDate==null&&d>0,ne=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!Se,lt=ne&&ze(e,t.fullExtent);return{type:"feature-service",source:V,isSourceHosted:be(V.path),orderByFields:W,outSpatialReference:e.spatialReference.toJSON(),metadata:{typeIdField:a??void 0,types:I,timeReferenceUnknownClient:o,subtypeField:u,globalIdField:n,fieldsIndex:c,geometryType:p,objectIdField:s,timeInfo:y,spatialReference:m,subtypes:this.layer.subtypes?.map(B=>B.toJSON())},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:r?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:ne,supportsSnapshotMaxThreshold:lt,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer;return U({definitionExpression:i,customParameters:r,gdbVersion:s,historicMoment:a,subtypeCode:n,subtypeField:o,timeExtent:l},e,t,u)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,gdbVersion:s,apiKey:a,subtypeCode:n}=t,o=this.layer.labelsVisible?this.layer.labelingInfo:null,l=t.historicMoment?.getTime()??void 0,u=JSON.stringify(t.customParameters),d=w(t,e),c=JSON.stringify(t.orderBy),p=$(this.layer,e)?e.floors:null;return{outFields:this.layer.outFields,apiKey:a,customParameters:u,definitionExpression:i,featureReduction:d,floors:p,gdbVersion:s,historicMoment:l,labelingInfo:o,orderBy:c,renderer:r,subtypeCode:n}}};function Hi(e){if(!("openPorts"in e))throw new C("source-not-supported")}class Ye{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.timeInfo?.toJSON(),l=i.spatialReference.toJSON();return Hi(i.source),{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,timeInfo:o,spatialReference:l,subtypes:null,subtypeField:null,globalIdField:null,typeIdField:null,types:null,timeReferenceUnknownClient:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r,timeExtent:s}=this.layer;return U({definitionExpression:r,timeExtent:s,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,orderBy:u,objectIdField:d}=this.layer,c={fields:s.map(p=>p.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:d,orderBy:u??"default"};return P(t,i,c,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=w(i,t),o=JSON.stringify(i.orderBy);return{outFields:this.layer.outFields,orderBy:o,definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:n}}}class Gi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,objectIdField:s}=i,a=i.fieldsIndex.toJSON(),n=R(i),o=i.spatialReference.toJSON();return{type:"memory",source:await i.source.openPorts(),orderByFields:s,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:a,geometryType:n,objectIdField:s,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:i.timeInfo?.toJSON(),timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(t,i){const{definitionExpression:r}=this.layer;return U({definitionExpression:r,customParameters:null},t,i,null)}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i;return{definitionExpression:r,renderer:s,labelingInfo:this.layer.labelsVisible?this.layer.labelingInfo:null,featureReduction:w(i,t)}}}let Wi=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r}=t,s=t.fieldsIndex.toJSON(),a=R(t),n=t.timeInfo?.toJSON(),o=t.spatialReference.toJSON(),l=t.source.getSource(),u=this.layer.objectIdField,d=ae(i);return d.query.maxRecordCount=l.maxRecordCount,{type:"ogc",source:l,orderByFields:u,outSpatialReference:e.spatialReference.toJSON(),metadata:{fieldsIndex:s,geometryType:a,objectIdField:r,timeInfo:n,spatialReference:o,globalIdField:null,subtypeField:null,subtypes:null,timeReferenceUnknownClient:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:d.query.maxRecordCount,supportsCompactGeometry:d.query.supportsCompactGeometry,supportsDefaultSpatialReference:d.query.supportsDefaultSpatialReference,supportsFormatPBF:d.query.supportsFormatPBF,supportsMaxRecordCountFactor:d.query.supportsMaxRecordCountFactor,supportsQuantization:d.query.supportsQuantization,lastEditDate:null,snapshotInfo:null}}}createSourceSchema(e,t){const{customParameters:i,timeExtent:r,apiKey:s}=this.layer;return U({customParameters:i,timeExtent:r},e,t,s)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(e){const t=this.layer,{renderer:i,apiKey:r}=t,s=this.layer.labelsVisible?this.layer.labelingInfo:null;return{apiKey:r,customParameters:JSON.stringify(t.customParameters),featureReduction:w(t,e),labelingInfo:s,orderBy:JSON.stringify(t.orderBy),renderer:i}}},Ki=class{constructor(e){this.layer=e}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}async createServiceOptions(e){const t=this.layer,{capabilities:i,objectIdField:r,globalIdField:s,orderBy:a,refreshInterval:n}=t,o=t.fieldsIndex.toJSON(),l=R(t),u=t.timeInfo?.toJSON(),d=t.spatialReference.toJSON(),c=ae(this.layer.parsedUrl);let p=this.layer.objectIdField;if(a?.length){const V=!a[0].valueExpression&&a[0].field;V&&(p=V)}const y=n>0,m=!!g("featurelayer-snapshot-enabled")&&t.geometryType==="point"&&i?.query.supportsPagination&&!i?.operations.supportsEditing&&!y,I=m&&ze(e,t.fullExtent);return{type:"feature-service",source:c,isSourceHosted:be(c.path),orderByFields:p,outSpatialReference:e.spatialReference.toJSON(),metadata:{globalIdField:s,fieldsIndex:o,geometryType:l,objectIdField:r,timeInfo:u,spatialReference:d,timeReferenceUnknownClient:!1,subtypeField:null,subtypes:null,typeIdField:null,types:null},queryMetadata:{maxRecordCount:i.query.maxRecordCount,supportsCompactGeometry:i.query.supportsCompactGeometry,supportsDefaultSpatialReference:i.query.supportsDefaultSpatialReference,supportsFormatPBF:i.query.supportsFormatPBF,supportsMaxRecordCountFactor:i.query.supportsMaxRecordCountFactor,supportsQuantization:i.query.supportsQuantization,lastEditDate:null,snapshotInfo:{supportsSnapshotMinThreshold:m,supportsSnapshotMaxThreshold:I,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(e,t){const{definitionExpression:i,customParameters:r,timeExtent:s}=this.layer;return U({definitionExpression:i,customParameters:r,timeExtent:s},e,t,null)}createProcessorSchema(e,t,i){const{fields:r,renderer:s,geometryType:a,labelingInfo:n,labelsVisible:o,orderBy:l,objectIdField:u}=this.layer,d={fields:r.map(c=>c.toJSON()),renderer:s?.clone(),featureReduction:w(this.layer,t),geometryType:a,labelingInfo:n,labelsVisible:o,objectIdField:u,orderBy:l??"default"};return P(e,t,d,i)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}hasFilters(e){return $(this.layer,e)}addFilters(e,t){return qe(this.layer,e,t)}getUpdateHashProperties(e){const t=this.layer,{definitionExpression:i,renderer:r,outFields:s}=t,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(t.customParameters),o=w(t,e);return{outFields:s,orderBy:JSON.stringify(t.orderBy),definitionExpression:i,renderer:r,labelingInfo:a,featureReduction:o,customParameters:n,floors:$(this.layer,e)?e.floors:null}}},Zi=class{constructor(e){this.layer=e}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return null}getLabelingDeconflictionInfo(e){const t=this.layer,i=N(t,e)??z(t);return[{vvEvaluators:{0:M(t.renderer)},deconflictionEnabled:i}]}getUpdateHashProperties(e){const t=this.layer,{renderer:i}=t,r=this.layer.labelsVisible?this.layer.labelingInfo:null,s=JSON.stringify(t.customParameters),a=w(t,e),n=JSON.stringify(t.orderBy);return{outFields:this.layer.outFields,labelingInfo:r,featureReduction:a,customParameters:s,orderBy:n,renderer:i}}async createServiceOptions(e){const t=R(this.layer);return{type:"parquet",source:{urls:this.layer.urls.items},outSpatialReference:e.spatialReference.toJSON(),geometryInfo:this.layer.source.geometryInfo,metadata:{spatialReference:this.layer.spatialReference,fieldsIndex:this.layer.fieldsIndex.toJSON(),objectIdField:this.layer.objectIdField,geometryType:t,types:null,subtypes:null,timeInfo:null,typeIdField:null,subtypeField:null,globalIdField:null,timeReferenceUnknownClient:null}}}createSourceSchema(e,t){return{type:"parquet",mutable:{sourceRefreshVersion:t,availableFields:e.availableFields,dataFilter:{customParameters:this.layer.customParameters??null}}}}createProcessorSchema(e,t,i){const r={fields:this.layer.fields.map(s=>s.toJSON()),renderer:this.layer.renderer?.clone(),featureReduction:w(this.layer,t),geometryType:this.layer.geometryType,labelingInfo:this.layer.labelingInfo,labelsVisible:this.layer.labelsVisible,objectIdField:this.layer.objectIdField,orderBy:this.layer.orderBy};return P(e,t,r,i)}};class Yi{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){const i=this.layer,r=N(i,t)??z(i);return[{vvEvaluators:{0:M(i.renderer)},deconflictionEnabled:r}]}async createServiceOptions(t){const i=this.layer,{objectIdField:r}=i,s=R(i),a=i.timeInfo?.toJSON()||null,n=i.spatialReference?i.spatialReference.toJSON():null;return{type:"stream",source:this.layer.parsedUrl,outSpatialReference:t.spatialReference.toJSON(),metadata:{fieldsIndex:this.layer.fieldsIndex.toJSON(),geometryType:s,objectIdField:r,timeInfo:a,timeReferenceUnknownClient:null,spatialReference:n,subtypeField:null,subtypes:null,globalIdField:null,typeIdField:null,types:null}}}createSourceSchema(t,i){const{definitionExpression:r,geometryDefinition:s,customParameters:a}=this.layer;return{type:"stream",mutable:{sourceRefreshVersion:i,availableFields:t.availableFields,dataFilter:{geometryDefinition:s?.toJSON(),definitionExpression:r,customParameters:a??null,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,purgeOptions:this.layer.purgeOptions.toJSON()}}}}createProcessorSchema(t,i,r){const{fields:s,renderer:a,geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u}=this.layer,d={fields:s.map(c=>c.toJSON()),renderer:a?.clone(),featureReduction:w(this.layer,i),geometryType:n,labelingInfo:o,labelsVisible:l,objectIdField:u,orderBy:"default"};return P(t,i,d,r)}get hasRequiredSupport(){return A(this.layer.renderer)}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,renderer:s}=i,a=this.layer.labelsVisible?this.layer.labelingInfo:null,n=JSON.stringify(i.customParameters);return{definitionExpression:r,renderer:s,labelingInfo:a,featureReduction:w(i,t),customParameters:n,geometryDefinition:i.geometryDefinition,definitionExpressoin:i.definitionExpression}}}async function Xi(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(({renderer:s})=>se(e,s)));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}function er(e,t){const i=Wt();return{type:"subtype",filters:e.filters,capabilities:{maxTextureSize:i.maxTextureSize},subtypeField:t.subtypeField,target:"feature",bindings:t.sublayers.reduce((r,{renderer:s,subtypeCode:a})=>{const n=Nt(s);return{...r,[a]:n}},{})}}async function tr(e,{subtypeField:t,sublayers:i}){const r=await Promise.all(i.map(s=>{const a=E(s.renderer),n={...s,geometryType:s.geometryType??null};return re(e,n,a)}));return{type:"subtype",subtypeField:t,renderers:i.reduce((s,{subtypeCode:a},n)=>({...s,[a]:r[n]}),{})}}async function ir(e,t,i,r){return{storage:er(t,i),mesh:{properties:{timeZone:t.timeZone,displayRefreshVersion:r,returnMeshObjectId:!1,sortKey:null},strategy:{type:"feature"},factory:{symbology:await Xi(e,i),labels:await tr(e,i)}}}}class rr{constructor(t){this.layer=t}getLabelingDeconflictionInfo(t){return[{vvEvaluators:{},deconflictionEnabled:this.layer.sublayers.every(i=>z(i))}]}async createServiceOptions(t){const i=this.layer,{capabilities:r,datesInUnknownTimezone:s,editingInfo:a,globalIdField:n,objectIdField:o,refreshInterval:l,subtypeField:u}=i,d=i.fieldsIndex.toJSON(),c=R(i),p=i.timeInfo?.toJSON(),y=i.spatialReference.toJSON(),m=ae(this.layer.parsedUrl),I=o,V=a?.lastEditDate==null&&l>0,W=!!g("featurelayer-snapshot-enabled")&&i.geometryType==="point"&&r?.query.supportsPagination&&!r?.operations.supportsEditing&&!V,Se=W&&ze(t,i.fullExtent);return{type:"feature-service",source:m,isSourceHosted:be(m.path),orderByFields:I,outSpatialReference:t.spatialReference.toJSON(),metadata:{timeReferenceUnknownClient:s,subtypeField:u,globalIdField:n,fieldsIndex:d,geometryType:c,objectIdField:o,timeInfo:p,spatialReference:y,subtypes:this.layer.subtypes?.map(ne=>ne.toJSON()),typeIdField:null,types:null},queryMetadata:{maxRecordCount:r.query.maxRecordCount,supportsCompactGeometry:r.query.supportsCompactGeometry,supportsDefaultSpatialReference:r.query.supportsDefaultSpatialReference,supportsFormatPBF:r.query.supportsFormatPBF,supportsMaxRecordCountFactor:r.query.supportsMaxRecordCountFactor,supportsQuantization:r.query.supportsQuantization,lastEditDate:a?.lastEditDate?.getTime(),snapshotInfo:{supportsSnapshotMinThreshold:W,supportsSnapshotMaxThreshold:Se,snapshotCountThresholds:{min:g("featurelayer-snapshot-point-min-threshold"),max:g("featurelayer-snapshot-point-max-threshold")}}}}}createSourceSchema(t,i){const{definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l,apiKey:u}=this.layer,d={queryScaleRanges:this.layer.sublayers.items.map(c=>({subtypeCode:c.subtypeCode,minScale:c.minScale,maxScale:c.maxScale})),definitionExpression:r,customParameters:s,gdbVersion:a,historicMoment:n,subtypeField:o,timeExtent:l};return U(d,t,i,u)}createProcessorSchema(t,i,r){const s={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers,a=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:a.labelingInfo,labelsVisible:a.labelsVisible,renderer:a.renderer,subtypeCode:a.subtypeCode,orderBy:null}))};return ir(t,i,s,r)}hasFilters(t){return $(this.layer,t)||sr(this.layer,t)}addFilters(t,i){t=qe(this.layer,t,i);const r=this.layer.sublayers.filter(a=>!ot(a,i)).map(a=>a.subtypeCode);if(!r.length)return t;t??=new ee;const s=`NOT ${this.layer.subtypeField} IN (${r.join(",")})`;return t.where=Fe(t.where,s),t}get hasRequiredSupport(){return!0}get timeOptions(){return this.layer}getUpdateHashProperties(t){const i=this.layer,{definitionExpression:r,gdbVersion:s,apiKey:a}=i,n=i.historicMoment?.getTime()??void 0,o=JSON.stringify(i.customParameters),l=$(this.layer,t)?t.floors:null,u=this.layer.sublayers.map(({renderer:d,labelsVisible:c,labelingInfo:p,visible:y})=>({renderer:d,labelsVisible:c,labelingInfo:p,visible:y}));return{outFields:this.layer.outFields,gdbVersion:s,definitionExpression:r,historicMoment:n,customParameters:o,apiKey:a,sublayers:u,floors:l}}setGraphicOrigin(t){const i=this.layer.fieldsIndex.get(this.layer.subtypeField),r=t.attributes[i.name],s=this.layer.sublayers.find(a=>a.subtypeCode===r);t.layer=t.sourceLayer=s}}function sr(e,t){return e.sublayers.some(i=>!ot(i,t))}function ot(e,t){return e.visible&&(e.minScale===0||Ue(t.scale,e.minScale)||t.scalee.maxScale)}async function b(e,t){try{return await e}catch(i){if(i.name!=="no-queryEngine")throw i;return t}}function D(e,t){const i=new Set;for(const r of e instanceof Set?e.values():e.keys())t.has(r)||i.add(r);return i}class ar{constructor(t,i,r){const s=r?t.getTileCoverage(r,0,!0,"closest"):null,a=t.getTileCoverage(i,0,!0,"closest");if(this._tileKeys=new Map,s)for(const n of s.keys())this._tileKeys.set(n.id,n);if(a)for(const n of a.keys())this._tileKeys.set(n.id,n)}get coverageSet(){return new Set(this._tileKeys.keys())}keys(){return this._tileKeys.values()}}class nr{constructor(t){this.version=t}}class or{constructor(t){this._subscriptions=new Map,this._visible=new Set,this._paused=new Set,this._version=0,this._config=t}destroy(){}get _coverageSet(){return this._coverage?.coverageSet??new Set}suspend(){this._suspendedOverage=this._coverage,this._coverage=null,this._updateSubscriptions()}resume(){this._coverage==null&&(this._coverage=this._suspendedOverage,this._suspendedOverage=null,this._updateSubscriptions())}update(t,i){return this._version=(this._version+1)%Number.MAX_SAFE_INTEGER,this._updateCoverage(t,i),this._updateSubscriptions(),new Set(this._visible)}_updateCoverage(t,i){this._coverage=new ar(this._config.tileInfoView,t,i)}_updateSubscriptions(){const t=this._coverageSet,i=this._updateVisibility(),r=D(i,t),s=D(this._subscriptions,i),a=D(t,this._subscriptions),n=D(s,t),o=D(r,n),l=D(o,this._paused);this._visible=i;for(const u of a.values())this._subscriptions.set(u,new nr(this._version));for(const u of l.values())this._paused.add(u);for(const u of n.values())this._subscriptions.delete(u),this._paused.delete(u);(a.size||n.size||l.size)&&this._sendUpdateSubscriptions(a,n,l)}_sendUpdateSubscriptions(t,i,r){const s=Array.from(t.values()).map(a=>({tileId:a,version:this._subscriptions.get(a).version}));this._config.updateSubscriptions({subscribe:s,unsubscribe:Array.from(i.values()),pause:Array.from(r.values())})}_updateVisibility(){const t=new Set,i=new Set;if(!this._coverage)return t;for(const a of this._coverage.keys()){if(this._config.isDone(a)){t.add(a.id);continue}this._addVisibleParent(t,i,a)||this._addVisibleChildren(t,a)||t.add(a.id)}const r=new Y(0,0,0,0),s=new Y(0,0,0,0);for(const a of i){r.id=a;for(const n of t)s.id=n,r.containsChild(s)&&t.delete(n)}return t}_addVisibleParent(t,i,r){let s=!1;for(const a of this._visible.values())new Y(a).containsChild(r)&&(t.add(a),i.add(a),s=!0);return s}_addVisibleChildren(t,i){let r=!1;for(const s of this._visible.values()){const a=new Y(s);i.containsChild(a)&&(t.add(s),r=!0)}return r}}const lr=e=>{let t=class extends e{constructor(...i){super(...i),this._updatingRequiredFieldsPromise=null,this.dataUpdating=!1,this.filter=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.addHandles([pe(()=>{const i=this.layer;return[i&&"elevationInfo"in i?i.elevationInfo?.featureExpressionInfo:null,i&&"displayField"in i?i.displayField:null,i&&"timeInfo"in i&&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(),_t),Be(()=>this.view?.floors,"change",()=>this._handleRequiredFieldsChange()),Be(()=>{const i=this.layer;return i&&"sublayers"in i?i.sublayers:null},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){if(!this.layer)return[];const{layer:i,layer:{fieldsIndex:r},requiredFields:s}=this;return"outFields"in i&&i.outFields?Le(r,[...De(r,i.outFields),...s]):Le(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){x.getLogger(this).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=this.filter!=null?this.filter.createQuery(i):new me(i);if("floorInfo"in this.layer&&this.layer.floorInfo){const s=Ke(this);s!=null&&(r.where=r.where?`(${r.where}) AND (${s})`:s)}return this.timeExtent!=null&&(r.timeExtent=r.timeExtent!=null?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new me(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 fetchPopupFeaturesFromGraphics(i,r){return this._validateFetchPopupFeatures(i,r),this._fetchPopupFeatures(i,r)}_loadArcadeModules(i){return i.expressionInfos?.length||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression")?wt():Promise.resolve()}_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,d=await Promise.allSettled([n?n.collectRequiredFields(u,s):null,je(u,r),i&&"elevationInfo"in r?It(u,r):null,this.filter!=null?Je(u,r,this.filter):null,i||this.featureEffect==null?null:Je(u,r,this.featureEffect.filter),!i&&l?Vt(u,r,l):null,!i&&o?Ft(u,r,o):null]);if("timeInfo"in r&&r.timeInfo&&this.timeExtent&&oe(u,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),"floorInfo"in r&&r.floorInfo&&oe(u,r.fieldsIndex,[r.floorInfo.floorField]),r.type==="feature"&&i&&r.infoFor3D!=null&&(r.globalIdField==null&&x.getLogger(this).error("globalIdField missing on 3DObjectFeatureLayer"),oe(u,r.fieldsIndex,[r.globalIdField])),r.type==="subtype-group"){ve(u,s,r.subtypeField);const p=r.sublayers.map(y=>Promise.all([y.renderer?.collectRequiredFields(u,s),je(u,y)]));await Promise.allSettled(p)}if(r.type==="catalog-footprint"&&r.parent){const p=r.parent;oe(u,s,[p.itemNameField,p.itemSourceField,p.itemTypeField,p.maxScaleField,p.minScaleField])}for(const p of d)p.status==="rejected"&&x.getLogger(this).error(p.reason);ve(u,s,a),i&&"displayField"in r&&r.displayField&&ve(u,s,r.displayField);const c=Array.from(u).sort();this._set("requiredFields",c)}_validateFetchPopupFeatures(i,r){if(r!=null)for(const s of i){const a=s.origin&&"layer"in s.origin?s.origin.layer:s.layer;if("popupEnabled"in a&&!a.popupEnabled)throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a});if(s.isAggregate){const n="featureReduction"in a?a.featureReduction:null;if(!(n&&"popupTemplate"in n&&n.popupEnabled&&n.popupTemplate))throw new C("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:a})}else if("popupTemplate"in a&&!_e(a,r))throw new C("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:a})}}_popupFeatureHasRequiredFields(i,r){return xt(r,i)}async _fetchPopupFeatures(i,r){const s=new Array(i.length),a=new Map,n=await this._createPopupQuery(i.map(o=>o.origin?.layer??o.layer),r);for(let o=0;oi.add(r)),t&&t.forEach(r=>i.add(r)),i.has("*")?["*"]:Array.from(i)}const Xe=4294967294;let _=class extends lr(Xt(Tt(zt))){constructor(){super(...arguments),this._commandsQueue=new kt({process:e=>{switch(e.type){case"edit-by-feature":case"edit-by-id":return this._doEdit(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._highlightCounter=new Kt,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new O,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._fields=null,this.featureEffectView=new ei}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(Ae()),this._commandsQueue.destroy()}initialize(){this._workerAttached=ye(),K(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new C("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(e.geometryType==="mesh")throw new C("featurelayerview:geometry-type-not-supported",`Geometry type of ${e.geometryType} is not supported`,{layer:e});if((e.type==="feature"||e.type==="subtype-group")&&ct(e)?.operations.supportsQuery===!1)throw new C("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await li(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(i){this._workerAttached.reject(Ae()),Me(i)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeatures}get hasAllFeaturesInView(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllFeaturesInView}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasFullGeometries}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,i=!this.suspended;return e.map(({vvEvaluators:r,deconflictionEnabled:s})=>({container:this.featureContainer,vvEvaluators:r,deconflictionEnabled:s,geometryType:t,visible:i}))}get layerAdapter(){switch(this.layer.type){case"feature":return this.layer.source.type==="memory"?new Ye(this.layer):new Qi(this.layer);case"geojson":case"csv":case"wfs":return new Ye(this.layer);case"parquet":return new Zi(this.layer);case"subtype-group":return new rr(this.layer);case"ogc-feature":return new Wi(this.layer);case"stream":return new Yi(this.layer);case"oriented-imagery":return new Ki(this.layer);case"knowledge-graph-sublayer":return new Gi(this.layer);case"catalog-footprint":return new Ji(this.layer);default:Ot(this.layer)}return null}get timeExtent(){return Ct(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t="default"){let i;e instanceof we?i=[e.getObjectId()]:typeof e=="number"||typeof e=="string"?i=[e]:dt.isCollection(e)&&e.length>0?i=e.map(s=>s?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(i=typeof e[0]=="number"||typeof e[0]=="string"?e:e.map(s=>s?.getObjectId()));const r=i?.filter(pt);return r?.length?(this._addHighlights(r,t),Pe(()=>this._removeHighlights(r,t))):Pe()}getHighlightIds(){return Array.from(this._highlightCounter.ids())}hasHighlight(){return!this._highlightCounter.empty}async hitTest(e,t){const i=await this.featureContainer.hitTest(t);if(i.length===0)return null;const r=await this.getWorker(),{features:s,aggregates:a}=await r.pipeline.getDisplayFeatures(i),n=this.featureContainer.getSortKeys(i),o=({displayId:l},{displayId:u})=>n.has(l)&&n.has(u)?n.get(l)-n.get(u):l-u;return s.sort(o).reverse(),a.sort(o).reverse(),[...a.map(l=>this._createGraphicHit(e,Oe.fromJSON(l))),...s.map(l=>this._createGraphicHit(e,we.fromJSON(l)))]}async queryStatistics(){const e=await this.getWorker();return b(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),s,i);return b(a,{})}async queryAggregateSummaryStatistics(e,t,i){const r={...t,scale:this.view.scale},s=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),r,i);return b(s,{})}async queryUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForUniqueValues(this._cleanUpQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),s,i);return b(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForClassBreaks(this._cleanUpQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),s,i);return b(a,{classBreakInfos:[]})}async queryHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.features.executeQueryForHistogram(this._cleanUpQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,i){const r=await this.getWorker(),s={...t,scale:this.view.scale},a=r.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),s,i);return b(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(i=>{const r=Ie.fromJSON(i);return r.features.forEach(s=>this._setLayersForFeature(s)),r})}async queryVisibleFeatures(e,t){const i=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),r=await b(i,{features:[]}),s=Ie.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregates(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),r=await b(i,{features:[]}),s=ti.fromJSON(r);return s.features.forEach(a=>this._setLayersForFeature(a)),s}async queryAggregateIds(e,t){const i=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return b(i,[])}async queryAggregateCount(e,t){const i=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return b(i,0)}async queryAggregateJSON(e,t){const i=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return b(i,{features:[]})}async queryFeaturesJSON(e,t){const i=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return b(i,{features:[]})}async queryObjectIds(e,t){const i=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return b(i,[])}async queryFeatureCount(e,t){const i=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return b(i,0)}async queryExtent(e,t){const i=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),r=await b(i,{count:0,extent:null});return{count:r.count,extent:ht.fromJSON(r.extent)}}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this._subscriptionManager.update(e.targetState,this._lastTargetState);this.featureContainer.setVisibleTiles(t)}attach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),K(this._updatingHandles.addPromise(this._workerAttached.promise)),K(this._attachProxy()),this.featureContainer=new ni(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._subscriptionManager=new or({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),K(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([pe(()=>JSON.stringify({displayRefreshVersion:this._displayRefreshVersion,timeExtent:this.timeExtent,clips:this.clips,filter:this.filter,featureEffect:this.featureEffect,sourceRefreshVersion:this._sourceRefreshVersion,timeZone:this.view.timeZone,effect:this.featureEffect,...this.layerAdapter.getUpdateHashProperties(this.view)}),()=>this._update(),ft),pe(()=>this.updateSuspended,e=>{e||(this._subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),pe(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this.layer.type!=="stream"&&this.layer.type!=="parquet"&&this.layer.type!=="catalog-footprint"&&this.addAttachHandles(this.layer.on("edits",e=>this._edit(e)))}detach(){g("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this._subscriptionManager=yt(this._subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=ye(),K(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){const e="renderer"in this.layer&&this.layer.renderer!=null,t=this._commandsQueue.updateTracking.updating,i=this._updatingRequiredFieldsPromise!=null,r=this.featureContainer.updatingHandles.updating,s=this.updateRequested||e&&(t||i)||r||this._pipelineUpdating||this.dataUpdating;if(g("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${s} -> updateRequested ${this.updateRequested} -> hasRenderer ${e} -> updatingRequiredFields ${i} diff --git a/custom-toc-highlight/assets/FeaturePipelineWorker-7KRvCyaS-Coq5DT_2.js b/custom-toc-highlight/assets/FeaturePipelineWorker-7KRvCyaS-AamvJuNL.js similarity index 97% rename from custom-toc-highlight/assets/FeaturePipelineWorker-7KRvCyaS-Coq5DT_2.js rename to custom-toc-highlight/assets/FeaturePipelineWorker-7KRvCyaS-AamvJuNL.js index 2d94b189..f9f46e8f 100644 --- a/custom-toc-highlight/assets/FeaturePipelineWorker-7KRvCyaS-Coq5DT_2.js +++ b/custom-toc-highlight/assets/FeaturePipelineWorker-7KRvCyaS-AamvJuNL.js @@ -1 +1 @@ -import{v as V,S as ge,i as Xt,K as w,bo as Se,ah as Ne,b9 as Qt,o as W,et as Qs,cY as Zs,bt as et,hC as le,J as P,aA as Zt,$ as Z,j as Ht,f as tt,b as Hs,eE as Jt,bV as Js,x as Ks,hr as er,hn as tr,I as st,gU as rt,E as we,eM as sr,p as rr,eJ as ir,bw as nr,ae as ar,O as or,l as dr,n as ur,B as ft,dk as yt,a1 as cr}from"./story-BfX8CRfG.js";import{M as it,t as lr}from"./workers-PiCjreoO-idkDTJa3.js";import{V as hr}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import{Q as _r,Z as pr,V as gr}from"./Tile-D75RMC64-Dj1SOP3K.js";import{s as nt}from"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import{t as T}from"./definitions-DJSdSb77-DkoRHaVx.js";import{P as Kt,C as mt,S as bt}from"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import{P as fr,m as yr,o as at,E as ot,W as wt,e as Fe,G as es,O as mr,q as br,L as wr}from"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import{d as Ir,g as vr}from"./MeshWriterRegistry-CIC9Yk_f-CqQZshM0.js";import{k as ts}from"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import{A as xr,q as ss,d as Sr,j as rs,V as Fr,D as kr,e as Cr,f as Tr,C as Q,$ as is,n as Mr,O as ns,X as qr}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{i as Y,a as he,c as M}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{f as Er,h as Ie}from"./queryUtils-Brxu6254-PPvpiP5X.js";import{o as de}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{s as Or}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js";import{Z as as}from"./QueryEngine-CH5uUhZK-BP95Dm56.js";import{P as Rr,p as Ar,q as It}from"./query-DFW9-NG_-gbjlxRZk.js";import{L as Pr}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{b as os}from"./Query-BrwMGK8U-DoFNfkjX.js";import{k as jr}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import{z as ds}from"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import{_ as vt}from"./ogcFeatureUtils-Bs12bZY3-BXRrRRmn.js";import{o as Dr}from"./pbf-D-y3_eZO-DQKnyfOm.js";import{k as Lr,m as zr}from"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import{i as xt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import{createConnection as Ur}from"./createConnection-CrkuTLXs-DgS-Wx7n.js";import{a as Wr}from"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./main-ugzBrWNm.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./PieChartMeshWriter-C5yLDFwp-CqRHPq7x.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./TurboLine-CIlsAy5m-Cxo-QeJ4.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./grouping-RwmXkHDc-Binxobs4.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./WhereClause-DxwoyBMS-DnXKVpm2.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-wUwu1nm1.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-BQ5pghrp.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./utils-tNxq3jkf-B78XlSIE.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./geojson-CNt_qtQf-B9F87hyc.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-B-0mBem3.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./sourceUtils-BMeqkJ5g-DxP4qerC.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";let Gr=class{constructor(s){this._client=s,this.layerView=this._client.createInvokeProxy(""),this.container=this._client.createInvokeProxy("container"),this._eventLog=this._client.createInvokeProxy("eventLog")}onEvent(s){it(this._eventLog.onEvent(s))}};const ke=1,dt=2,Ce=4,ut=8,ct=16,Te=32,lt=64,Me=128;function je(s){switch(s){case ke:case ut:case Te:return-1;case dt:case lt:return 0;case Ce:case ct:case Me:return 1}}function De(s){switch(s){case ke:case dt:case Ce:return-1;case ut:case ct:return 0;case Te:case lt:case Me:return 1}}const St=ke|ut|Te,Ft=Ce|ct|Me,kt=ke|dt|Ce,Ct=Te|lt|Me;let Nr=class{constructor(s,e,t,r,i=0){this.tileKey=s,this._bufferingEnabled=e,this._sizeHint=i,this._meshes={self:new wt(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0;const n=r?1:0;this._copyBufferedDataIntoSelf=t&&this._bufferingEnabled&&s.level===n}get id(){return this.tileKey.id}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(s){this._meshes.self.indexEnsureSize(s)}entityStart(s,e=s){this._currentEntityOverlaps=0,this._meshes.self.entityStart(s,e)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let s=0;s<8;s++){const e=1<{const n=r.serialize(),a=1<=T-i?St:Ft|St)|(e<0+n?Ct:e>=T-n?kt:Ct|kt));this._currentRecordOverlaps|=a}_copyIntoNeighbors(){for(let s=0;s<8;s++){const e=1<0){const i=this.getBackgroundFill();if(i)return[...i,...r]}return r}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t){}},Br=class cs extends G{static async fromDictionaryRenderer(e,t){return new cs(e,t)}constructor(e,t){super(),this._context=e,this._schema=t,this._hashToGroup=new Map}get fieldMap(){return this._schema.fieldMap}async fetchResources(e,t){const r=t.getCursor(),i=[];for(;r.next();)i.push(this._updateMeshWriterGroup(e,r));await Promise.all(i)}match(e,t){const r=e.getAttributeHash();return this._hashToGroup.get(r)}async _updateMeshWriterGroup(e,t){const r=t.readLegacyFeatureForDisplay(),i=t.getAttributeHash();if(this._hashToGroup.has(i))return;this._hashToGroup.set(i,null);const n=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",feature:r});if(!n)return;const a=await this._context.createMeshWriters(n.meshes);this._hashToGroup.set(i,a)}},Vr=class ls extends G{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t){const r=await e.storage.createComputedField(t),i=new ls(r,t.isMaxInclusive);await Promise.all(t.intervals.map(async o=>{const d=await e.createMeshWriters(o.meshes);i.add(o,d)}));const n=await e.createMeshWriters(t.defaultSymbol);i.setDefault(n);const a=await e.createMeshWriters(t.backgroundFill);return i.setBackgroundFill(a),i}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((r,i)=>r.interval.min-i.interval.min)}size(){return super.size()+this._intervals.length}doMatch(e,t){const r=this._field?.read(e,t);if(r==null||isNaN(r)||r===1/0||r===-1/0)return null;for(let i=0;i=n.min,d=this._isMaxInclusive?r<=n.max:r{const a=await e.createMeshWriters(n.meshes);return{minScale:n.minScale,maxScale:n.maxScale,meshes:a,expression:null,where:await e.storage.createWhereClause(n.where)}}),i=await Promise.all(r);return new hs(i)}constructor(e){super(),this._labels=e}match(e,t){if(!this._labels.length)return null;const r=this._getLabels(t.$view.scale),i=[];for(const n of r)n.where&&!n.where(e)||i.push(...n.meshes);return i}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const r=t-t/4,i=t+t/2;return(!e.minScale||e.minScale>=r)&&(!e.maxScale||e.maxScale<=i)}},Xr=class _s extends G{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t){const r=t.expression?[e.storage.createComputedField({expression:t.expression})]:[t.field?e.storage.createComputedField({field:t.field}):null,t.field2?e.storage.createComputedField({field:t.field2}):null,t.field3?e.storage.createComputedField({field:t.field3}):null],i=(await Promise.all(r)).filter(d=>!!d),n=new _s(i,t.fieldDelimiter),a=await e.createMeshWriters(t.defaultSymbol);n.setDefault(a);const o=await e.createMeshWriters(t.backgroundFill);return n.setBackgroundFill(o),await Promise.all(t.map.map(async(d,u)=>{const h=await e.createMeshWriters(d.symbol);d.value===""?n.setNullResult(h):n.add(d.value,h,u+1)})),n}setNullResult(e){this._nullResult=e}getSortKey(e,t){const r=this._getValueFromFields(e,t);if(r==null||r===""||r==="")return 0;const i=this._resultsMap.get(r.toString());return i?i.sortKey:this._defaultSymbolSortKey}add(e,t,r){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:r}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,r+1)}size(){return super.size()+this._resultsMap.size}doMatch(e,t){const r=this._getValueFromFields(e,t);if(this._nullResult!==null&&(r==null||r===""||r===""))return this._nullResult;if(r==null)return null;const i=r.toString();return this._resultsMap.get(i)?.meshWriters}_getValueFromFields(e,t){const r=[];for(const i of this._fields){const n=i.read(e,t);n==null||n===""?r.push(""):r.push(n)}return r.join(this._separator)}};async function ae(s,e){switch(e.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return G.from(s,e);case"interval":return Vr.fromIntervalSchema(s,e);case"dictionary":return Br.fromDictionaryRenderer(s,e);case"label":return Yr.fromLabelSchema(s,e);case"map":return Xr.fromMatcherSchema(s,e);case"subtype":return Qr.fromSubtypes(s,e);case"cluster":return Zr.fromClusterSchema(s,e);default:throw new Error("Impl")}}let Qr=class ps extends G{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t){const r=new Map,i=[];for(const n in t.renderers){const a=parseInt(n,10),o=ae(e,t.renderers[n]).then(d=>r.set(a,d));i.push(o)}return await Promise.all(i),new ps(r,t.subtypeField)}match(e,t){const r=e.readAttribute(this._subtypeField),i=this._subMatchers.get(r);return i?i.match(e,t):null}},Zr=class gs extends G{static async fromClusterSchema(e,t){const[r,i]=await Promise.all([ae(e,t.feature),ae(e,t.cluster)]);return new gs(r,i)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t){return e.readAttribute("cluster_count")===1?this._featureMatcher.match(e,t):this._clusterMatcher.match(e,t)}},Hr=class fs extends $r{static async create(e,t){const r=await ae(e,t.symbology),i=t.labels?await ae(e,t.labels):null;return new fs(r,i)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,r){const i=this._symbology.match(t,r);if(i){for(const n of i)n.enqueueRequest(e,t,r);if(this._labels){const n=this._labels.match(t,r);if(!n)return;for(const a of n)a.enqueueRequest(e,t,r)}}}write(e,t,r,i,n){const a=this._symbology.match(r,i);if(a){for(const o of a)o.write(e,t,r,i,n);if(e.entityRecordCount()>=1&&this._labels){const o=this._labels.match(r,i);if(!o)return;for(const d of o)d.setReferences(a),d.write(e,t,r,i,n)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}},Jr=class{constructor(s,e,t,r){this.storage=s,this.proxy=e,this.viewParams=t,this.registry=r}async createMeshWriters(s){const e=s.map(t=>this.registry.createMeshWriter(this.storage,this.proxy,this.viewParams,t));return Promise.all(e)}},Kr=class{constructor(s){this._outstandingMessages=[],this._queue=new ts({concurrency:s.concurrency,process:e=>s.process(e)})}async push(s){if(s.end)return await Promise.all(this._outstandingMessages),await this._queue.push(s),void(this._outstandingMessages=[]);const e=this._queue.push(s);return this._outstandingMessages.push(e),e}},ys=class $e{static async create(e,t){if(t.statisticType==="count"){const i=new vr(1);return new $e(t.name,t.alias,t.type,t.statisticType,i)}const r=await e.createComputedField({expression:t.onStatisticExpression?.expression,field:t.onStatisticField});return new $e(t.name,t.alias,t.type,t.statisticType,r)}constructor(e,t,r,i,n){this.name=e,this.alias=t,this.type=r,this.statisticType=i,this.computed=n}},ht=class{constructor(s){this.subscription=s,this.handledChunks=new Set}destroy(){}},ms=class{constructor(s,e){this._source=s,this._attributeStore=e,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}onSubscribe(s){const e=this.createState(s);this._sendStates.set(s.key.id,e),this.updateChunks()}onUnsubscribe(s){this._sendStates.get(s.key.id)?.destroy(),this._sendStates.delete(s.key.id)}invalidate(){const s=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of s)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(){}getFeatureObjectIdsForAggregate(s){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(s){return this.displayMap(s,e=>e,e=>e)}getDisplayAndObjectIds(s){return this.displayMap(s,e=>e,(e,t,r)=>[e,r])}beforeUpdateChunks(){}afterUpdateChunks(){}},bs=class extends ms{constructor(s,e,t,r){super(s,e),this.spatialReference=t,this.aggregateFields=r,this.events=new st,this.featureAdapter=Or}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new as({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,objectIdField:this._metadata.objectIdField,spatialReference:this.spatialReference})),this._aggregateQueryEngine}removeChunks(s){}forEach(s){return this.forEachAggregateWorldSpace(s)}forEachInBounds(s,e){}forEachBounds(s,e){const t=rt();for(const r of s){const i=Fr(t,r.geometry,!1,!1);i&&e(i)}}},_t=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.clear=t,this.end=r,this.debugInfo=i,this.type="append"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"append",clear:this.clear,id:this.id,append:s,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:e,attributeEpoch:t}}},Be=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.remove=t,this.end=r,this.debugInfo=i,this.type="update"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"update",id:this.id,modify:s,debugInfo:this.debugInfo,remove:this.remove,version:e,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:t}}},ei=class ws{static fromReader(e){const t=[],r=e.copy(),i=rt();for(;r.next();)r.getBounds(i)&&t.push(r.getIndex());const n=gr(9,a=>(r.setIndex(a),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()}));return n.load(t),new ws(n)}constructor(e){this._index=e}search(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}};const ti=64;function si(s,e,t,r){const i=[s.xmin,s.ymin,s.xmax,s.ymax],n=dr.fromExtent(ur.fromBounds(i,r)),a=Ie(n,r,P.WGS84,{densificationStep:e*ti});if(!a)return null;const o=ns(new M,a,!1,!1),d=o.coords.filter((y,v)=>!(v%2)),u=o.coords.filter((y,v)=>v%2),h=Math.min(...d),l=Math.min(...u),p=Math.max(...d),g=Math.max(...u),_=Ve(h,l,t,P.WGS84),f=Ve(p,g,t,P.WGS84);return _&&f?{bounds:i,geohashBounds:{xLL:_[0],yLL:_[1],xTR:f[0],yTR:f[1]},level:t}:null}function Ve(s,e,t,r){if(r.isWebMercator){const a=ft(s/yt.radius),o=a-360*Math.floor((a+180)/360),d=[0,0];return Tt(d,0,ft(Math.PI/2-2*Math.atan(Math.exp(-e/yt.radius))),o,t),d}const i=Ie({x:s,y:e},r,P.WGS84);if(!i)return null;const n=[0,0];return Tt(n,0,i.y,i.x,t),n}function ri(s,e){let t=-90,r=90,i=-180,n=180;for(let a=0;a>h,y=(_&s.geohashY)>>l;for(let v=p-1;v>=0;v--){const b=(i+n)/2,F=f&1<=0;v--){const b=(t+r)/2,F=y&1<g?1:0;n|=_<<29-(p+5*l),u=(1-_)*u+_*g,h=(1-_)*g+_*h}for(let p=0;p<5;p++){const g=(o+d)/2,_=t>g?1:0;a|=_<<29-(p+5*l),o=(1-_)*o+_*g,d=(1-_)*g+_*d}}s[2*e]=n,s[2*e+1]=a}let Is=class{constructor(s){this._statistics=s}get statistics(){return this._statistics}};const Mt=Math.PI/180;let vs=class Ye{static create(e){return new Ye(e.map(t=>ii(t)))}constructor(e){this._statistics=e}values(){return this._statistics.values()}insert(e,t){for(const r of this._statistics)r.insert(e,t)}merge(e){for(let t=0;te.clone()))}};function ii(s){switch(s.statisticType){case"min":return new ni(s);case"max":return new ai(s);case"avg":return new di(s);case"avg_angle":return new ui(s);case"sum":case"count":return new oi(s);case"mode":return new ci(s)}}let K=class{constructor(s){this.field=s}insert(s,e){if(!this.field.computed)return;const t=this.field.computed.read(s,e);wr(t)||this._insertValue(t)}},ni=class xs extends K{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(e){this.value=Math.min(this.value,e)}merge(e){this.value=Math.min(this.value,e.value)}clone(){const e=new xs(this.field);return e.value=this.value,e}},ai=class Ss extends K{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(e){this.value=Math.max(this.value,e)}merge(e){this.value=Math.max(this.value,e.value)}clone(){const e=new Ss(this.field);return e.value=this.value,e}},oi=class Fs extends K{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(e){this.value+=e}merge(e){this.value+=e.value}clone(){const e=new Fs(this.field);return e.value=this.value,e}},di=class ks extends K{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(e){this._total+=e,this._count+=1}merge(e){this._total+=e._total,this._count+=e._count}clone(){const e=new ks(this.field);return e._total=this._total,e._count=this._count,e}},ui=class Cs extends K{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const e=this._x/this._count,t=this._y/this._count,r=180/Math.PI;return Math.atan2(t,e)*r}_insertValue(e){this._x=this._x+Math.cos(e*Mt),this._y=this._y+Math.sin(e*Mt),this._count+=1}merge(e){this._x+=e._x,this._y+=e._y,this._count+=e._count}clone(){const e=new Cs(this.field);return e._x=this._x,e._y=this._y,e._count=this._count,e}},ci=class Ts extends K{constructor(){super(...arguments),this._frequencies=new Map}get value(){let e,t=0;for(const[r,i]of this._frequencies.entries())i>t&&(t=i,e=r);return e}_insertValue(e){const t=this._frequencies.get(e);t!=null?this._frequencies.set(e,t+1):this._frequencies.set(e,1)}merge(e){for(const[t,r]of e._frequencies.entries()){const i=this._frequencies.get(t);i!=null?this._frequencies.set(t,i+r):this._frequencies.set(t,r)}}clone(){const e=new Ts(this.field);return e._frequencies=new Map(this._frequencies),e}},qt=class Xe extends Is{static create(e,t,r,i){const n=vs.create(e),a=new Array(32);for(let o=0;o=r)return this;const o=1-i%2,d=3*o+2*(1-o),u=2*o+3*(1-o),h=30-n-d,l=30-a-u,p=((e&7*o+3*(1-o)<>h)+((t&3*o+7*(1-o)<>l)*(8*o+4*(1-o)),g=this.children[p];return g==null?null:g.find(e,t,r,i+1,n+d,a+u)}_getLngLatBounds(){const e=this.depth,t=Math.ceil(e/2),r=Math.floor(e/2),i=30-(3*t+2*r),n=30-(2*t+3*r),a=this.xNode<=a)return;const p=Math.ceil((u+1)/2),g=Math.floor((u+1)/2),_=1-u%2,f=30-(3*p+2*g),y=30-(2*p+3*g),v=(i&7*_+3*(1-_)<>f,b=(n&3*_+7*(1-_)<>y,F=v+b*(8*_+4*(1-_));h=h<<3*_+2*(1-_)|v,l=l<<2*_+3*(1-_)|b,d.children[F]==null&&(d.children[F]=qt.create(this._fields,h,l,u+1),this._depth=Math.max(this._depth,u+1),this._size+=1),u+=1,d=d.children[F]}}putBins(e,t){for(const r of this.getNodes(t)){const i=e.get(r.id);i?i.merge(r):e.set(r.id,r.clone())}}getNodes(e){const t=[],{geohashBounds:r,level:i}=e;let n=this._root;for(;n!==null;){const a=n.depth,o=n.xNode,d=n.yNode;if(a>=i){t.push(n),n=n.next;continue}const u=Math.ceil((a+1)/2),h=Math.floor((a+1)/2),l=1-a%2,p=30-(3*u+2*h),g=30-(2*u+3*h),_=~((1<>p,v=(r.yLL&f)>>g,b=(r.xTR&_)>>p,F=(r.yTR&f)>>g,C=o<<3*l+2*(1-l),x=d<<2*l+3*(1-l),S=C+8*l+4*(1-l),k=x+4*l+8*(1-l),E=Math.max(C,y),L=Math.max(x,v),R=Math.min(S,b),N=Math.min(k,F);let ce=null,Re=null;for(let Ae=L;Ae<=N;Ae++)for(let Pe=E;Pe<=R;Pe++){const Xs=Pe-C+(Ae-x)*(8*l+4*(1-l)),te=n.children[Xs];te&&(ce||(ce=te,ce.next=n.next),Re&&(Re.next=te),Re=te,te.next=n.next)}n=ce||n.next}return t}}let Ms=class{constructor(s){this._options=s}insert(s,e){const t=s.getCursor(),r={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;t.next();)this._insertFeature(t,r,e)}_insertFeature(s,e,t){const{featureFilter:r}=this._options;if(r!==null&&!r.check(s))return;let i=0,n=0;if(s.geometryType==="esriGeometryPoint")i=s.readXWorldSpace(),n=s.readYWorldSpace();else{if(t){const o=s.readCentroidForDisplay();if(o==null)return;const[d,u]=o.coords;if(d<0||d>T||u<0||u>T)return}const a=s.readCentroidWorldSpace();if(a==null)return;i=a.coords[0],n=a.coords[1]}this._insert(s,i,n,e)}},hi=class extends Ms{constructor(s){super(s),this._tree=new li(this._options.fields)}put(s){throw new Error("Geohash tree does not support put")}putBounded(s,e,t){const{geohashLevel:r,spatialReference:i}=this._options,n=si(e,t,r,i);n!=null&&this._tree.putBins(s,n)}_insert(s,e,t,r){const{geohashLevel:i,spatialReference:n}=this._options,a=Ve(e,t,i,n);a&&this._tree.insert(s,e,t,a[0],a[1],i,r)}},Qe=class fe extends Is{static createId(e,t){return`${e}.${t}`}static create(e,t,r,i){return new fe(e,t,vs.create(r),i)}constructor(e,t,r,i){super(r),this.gridX=e,this.gridY=t,this._worldUnitsPerCell=i,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return fe.createId(this.gridX,this.gridY)}get containedObjectIds(){return this._objectIds}get count(){return this._count}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}clone(){const e=new fe(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return e._count=this._count,e._xWorldTotal=this._xWorldTotal,e._yWorldTotal=this._yWorldTotal,e._firstFeatureAttributes=this._firstFeatureAttributes,e._objectIds=new Set(this._objectIds),e}insert(e,t,r,i){this._count===0?this._firstFeatureAttributes=e.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=r,this._yWorldTotal+=i,this._statistics.insert(e,t),this._objectIds.add(e.getObjectId())}merge(e){if(e._count!==0){this._count+=e._count,this._firstFeatureAttributes=e._firstFeatureAttributes,this._xWorldTotal+=e._xWorldTotal,this._yWorldTotal+=e._yWorldTotal,this._statistics.merge(e._statistics);for(const t of e._objectIds.values())this._objectIds.add(t)}}getCentroidX(e){return e==null?this.centroidXWorld:Cr(e,this.centroidXWorld)}getCentroidY(e){return e==null?this.centroidYWorld:Tr(e,this.centroidYWorld)}getGeometry(e,t){const r=this.gridX*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell,n=new M([4],[r,i,r+this._worldUnitsPerCell,i,r+this._worldUnitsPerCell,i+this._worldUnitsPerCell,r,i+this._worldUnitsPerCell]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPolygon",t)}return n}getCentroid(e){const t=new M([],[this.centroidXWorld,this.centroidYWorld]);if(e!=null){const r=new M;return Q(r,t,!1,!1,"esriGeometryPoint",e)}return t}getGeometricCentroid(e,t){const r=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,n=new M([],[r,i]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPoint",t)}return n}getAttributes(){const e={aggregateId:this.id};for(const t of this._statistics.values())e[t.field.name]=t.value;return this._firstFeatureAttributes!=null?{...e,...this._firstFeatureAttributes}:e}};const _i=96;function Ze(s,e){return rr(s)*ir*_i/e}let pi=class extends Ms{constructor(s){super(s),this._cells=new Map,this._pixelsPerMapUnit=Ze(s.spatialReference,s.scale)}put(s){for(const e of this._cells.values()){const t=s.get(e.id);t?t.merge(e):s.set(e.id,e.clone())}}putBounded(s,e,t){const r=[e.xmin,e.ymin,e.xmax,e.ymax],[i,n,a,o]=r,d=Math.floor(i*this._pixelsPerMapUnit/this._options.cellSize),u=Math.floor(n*this._pixelsPerMapUnit/this._options.cellSize),h=Math.ceil(a*this._pixelsPerMapUnit/this._options.cellSize),l=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize);for(let p=u;p<=l;p++)for(let g=d;g<=h;g++){const _=`${g}.${p}`,f=this._cells.get(_);if(!f)continue;const y=s.get(f.id);y?f&&!s.has(f.id)&&y.merge(f):s.set(f.id,f.clone())}}_insert(s,e,t,r){const i=e*this._pixelsPerMapUnit,n=t*this._pixelsPerMapUnit,a=Math.floor(i/this._options.cellSize),o=Math.floor(n/this._options.cellSize);this._getCellOrCreate(a,o).insert(s,r,e,t)}_getCellOrCreate(s,e){const t=Qe.createId(s,e);let r=this._cells.get(t);if(!r){const i=1*this._options.cellSize/this._pixelsPerMapUnit;r=Qe.create(s,e,this._options.fields,i),this._cells.set(t,r)}return r}},gi=class He extends Fe{static from(e,t){return new He(e.copy(),t)}constructor(e,t){super(e.metadata),this._currentIndex=-1,this._displayTranslationX=0,this._displayTranslationY=0,this._displayScaleX=1,this._displayScaleY=1,this._reader=e,this._indices=t,this._isPoint=e.geometryType==="esriGeometryPoint"}setTransformForDisplay(e){const t=this._reader.getInTransform();if(t==null){const[l,p]=e.scale,[g,_]=e.translate;return this._displayTranslationX=-g/l,this._displayScaleX=1/l,this._displayTranslationY=_/p,this._displayScaleY=1/-p,void(this._displayTransform=e)}const[r,i]=t.scale,[n,a]=t.translate,[o,d]=e.scale,[u,h]=e.translate;if(this._displayScaleX=r/o,this._displayTranslationX=(n-u)/o,this._displayScaleY=i/d,this._displayTranslationY=(-a+h)/d,!this._isPoint&&t)throw new Error("InternalError: Relative transformations not supported for non-point features");this._displayTransform=e}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1!(r.objectId!=null&&t.has(r.objectId)))}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new z(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndex!t.has(r.objectId))}getTileReader(s){if(!this._features.length)return null;const e=this.queryFeaturesInBounds(s.bounds);return e.setTransformForDisplay(s.transform),e}_onChange(){this.invalidate()}},fi=class extends ht{constructor(s,e){super(s),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=e}reset(){this.destroy(),this.done=!1}invaldateForLocalEditDropped(){this.handledChunks.clear(),this.bins.clear()}destroy(){const s=this.subscription.tile.key.level;for(const e of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${e}.${s}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const s of this.featureCache.values()){const e=s.clone();e.geometry&&kr(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}},yi=class Es extends bs{static async create(e,t,r,i,n){const a=new at({spatialReference:t}),o=await Promise.all(e.fields.map(async u=>ys.create(a,u))),d=e.featureFilter?await es.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return e.index.type==="geohash"&&await Er(t,P.WGS84),new Es(e,d,n,o,t,r,i)}constructor(e,t,r,i,n,a,o){super(a,o,n,i),this._schema=e,this._featureFilter=t,this._timeZone=r,this._metadata=ot.createFeature({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fieldsIndex:new de(e.fields).toJSON(),globalIdField:null,spatialReference:a.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new fi(e,this._attributeStore)}async*applyLocalEdit(e){for(const t of this._sendStates.values())t.reset(),yield new _t(t.subscription,q.empty(this._source.metadata),!0,!1,{})}displayMap(e,t,r){const i=new Map(e.map(a=>[t(a),a])),n=[];for(const a of this._sendStates.values())for(const o of a.featuresWorldSpace()){const{objectId:d,displayId:u}=o,h=i.get(d);if(h!=null){const l=r(u,h,d);n.push(l),i.delete(d)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[];for(const n of this._sendStates.values())for(const a of n.featuresWorldSpace())t.has(a.displayId)&&!r.has(a.objectId)&&(a.geometry&&i.push({...rs(a,this._metadata.geometryType,!1,!1),displayId:a.displayId}),r.add(a.objectId));return{features:[],aggregates:i}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const r of t.bins.values())if(r.id===e)return Array.from(r.containedObjectIds);return[]}beforeUpdateChunks(){const e=this._source.chunks();if(!e.length)return;let t=!1;for(const r of e)qs(r)&&r.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this._lastHandledLocalEdit=r.lastLocalEditDropped,t=!0);if(t)for(const r of this._sendStates.values())r.invaldateForLocalEditDropped()}async*updateChunks(){for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){const t=new Set;for(const r of this._sendStates.values())for(const i of r.featuresWorldSpace())t.has(i.objectId)||(e(i),t.add(i.objectId))}_createIndexOptions(e){switch(this._schema.index.type){case"geohash":return{type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:e.scale};case"grid":{const t=this._schema.index.fixedBinLevel,r=t!=null?e.tileInfoView.getLODInfoAt(t).scale:e.scale;return{type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:r}}}}async*_update(e,t){const{handledChunks:r,subscription:i,bins:n,featureCache:a}=e,o=i.tile;if(e.done)return;for(const _ of t.chunks()){if(r.has(_.chunkId))continue;r.add(_.chunkId);const f=_.queryInfo;if("tileId"in f){const y=new nt(f.tileId);if(y.level!==o.level||y.world!==o.key.world)continue}_.getAggregateIndex(this._createIndexOptions(e.tile)).putBounded(n,e.tile.extent,e.tile.resolution)}const d=[],u=i.tile.transform,h=i.tile.key.level;for(const _ of n.values()){let f=a.get(_.id);if(f)f.attributes=_.getAttributes();else{const y=_.getGeometry(this.spatialReference,u);f=new Y(y,_.getAttributes(),null),y||(f.centroid=_.getGeometricCentroid(this.spatialReference,u)),f.objectId=_.id,f.displayId=this._attributeStore.createDisplayIdForObjectId(`${f.objectId}.${h}`),a.set(_.id,f)}d.push(f)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const l=q.fromOptimizedFeatures(d,this._metadata,u),p=l.getCursor(),g=e.subscription.tile.createArcadeEvaluationOptions(this._timeZone);for(;p.next();)this._attributeStore.setAttributeData(p.getDisplayId(),p,g);yield new Be(e.subscription,l,[],e.done,{})}},mi=class{constructor(s,e){this.inner=s,this.displayId=e}};const _e=128;let bi=class extends ht{constructor(s){super(s),this.didSend=!1,this.done=!1}},wi=class{constructor(s,e,t,r,i){this._level=s,this._scale=e,this._indexOptions=t,this._clusterRadius=r,this._store=i,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const s of this._clusters.values())this._store.releaseDisplayIdForObjectId(s.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const s of this._clusters.values()){const e=s.inner.getCentroid(null),t=new Y(e,s.inner.getAttributes(),null);t.objectId=s.inner.id,t.displayId=s.displayId,yield t}}clusters(){return this._clusters.values()}updateChunks(s,e){let t=!1;for(const a of s){const o=a.queryInfo;"tileId"in o&&new nt(o.tileId).level!==this._level||this._handledChunks.has(a.normalizedChunkId)||(this._handledChunks.add(a.normalizedChunkId),t=!0,a.getAggregateIndex({...this._indexOptions,scale:this._scale}).put(this._cells))}const r={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},i=Ze(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:a}of e){const o=a.tile.bounds,d=Math.floor(o[0]*i/n),u=Math.floor(o[1]*i/n),h=Math.ceil(o[2]*i/n),l=Math.ceil(o[3]*i/n);r.xMin=Math.min(r.xMin,d),r.yMin=Math.min(r.yMin,u),r.xMax=Math.max(r.xMax,h),r.yMax=Math.max(r.yMax,l)}return this._lastCellBounds!=null&&r.xMin===this._lastCellBounds.xMin&&r.yMin===this._lastCellBounds.yMin&&r.yMin===this._lastCellBounds.yMin&&r.yMax===this._lastCellBounds.yMax||(t=!0,this._lastCellBounds=r),t&&this._clusterCells(r),t}async updateStatistics(s){let e=!1;for(const t of this._clusters.values())t.inner.count>1&&(e=this._updateAggregateStatistics(this._statistics,t.inner)||e);if(e){const t=Array.from(this._statistics.entries()).map(([r,i])=>({fieldName:r,minValue:i.minValue,maxValue:i.maxValue}));await s.container.updateStatistics(this._level,t)}}createAggregateFeatures(s,e){const t=s.subscription,r=[],i=t.tile.transform;for(const n of this._clusters.values()){let a=n.inner.getCentroidX(i);const o=n.inner.getCentroidY(i),d=t.tile.lod,u=d.wrap?d.worldSize[0]:null,h=n.inner.count===1?n.inner.firstObjectId:n.inner.id,l=n.displayId;if(u!=null)if(u===1){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.geometry.coords[0]-=T,g.objectId=h,g.displayId=l,r.push(g);const _=new M([],[a,o]),f=new Y(_,n.inner.getAttributes(),null);f.geometry.coords[0]+=T,f.objectId=h,f.displayId=l,r.push(f)}else a>T+T/2?a-=u*T:a<-T/2&&(a+=u*T);if(a=-_e&&o=-_e){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.objectId=h,g.displayId=l,r.push(g)}}return q.fromOptimizedFeatures(r,e,t.tile.transform)}_clusterCells(s){let e=Array.from(this._cells.values());e=e.sort((a,o)=>o.count-a.count);const t=[];for(const a of this._clusters.values())t.push(a.inner.id);this._clusters.clear();const r=this._clusterRadius*(1/Ze(this._indexOptions.spatialReference,this._scale)),i=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const a of e){if(n.has(a.id)||a.gridXs.xMax||a.gridYs.yMax)continue;const o=this._store.createDisplayIdForObjectId(a.id),d=new mi(a.clone(),o);n.add(a.id),this._clusters.set(a.id,d);const u=a.centroidXWorld,h=a.centroidYWorld;for(let l=a.gridY-i;l<=a.gridY+i;l++)for(let p=a.gridX-i;p<=a.gridX+i;p++){if(l===a.gridY&&p===a.gridX)continue;const g=this._cells.get(Qe.createId(p,l));if(!g||n.has(g.id))continue;const _=Math.abs(g.centroidXWorld-u),f=Math.abs(g.centroidYWorld-h);_ys.create(o,u))),spatialReference:r,featureFilter:t.featureFilter?await es.create({geometryType:i.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:i.metadata.timeInfo,fieldsIndex:i.metadata.fieldsIndex,spatialReference:r,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:a};return new Os(e,t.clusterRadius,d,t.fields,i,n)}constructor(e,t,r,i,n,a){super(n,a,r.spatialReference,r.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=r,this._cellsPerScale=new Map,this._metadata=ot.createFeature({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fieldsIndex:new de([...i,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:n.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new bi(e)}async*applyLocalEdit(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,r){const i=new Map(e.map(o=>[t(o),o])),n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.clusters()){const d=i.get(o.inner.id);if(d==null){if(o.inner.count===1){const u=i.get(o.inner.firstObjectId);if(u!=null){const h=r(o.displayId,u,o.inner.firstObjectId);n.push(h),i.delete(o.inner.firstObjectId)}}}else{const u=r(o.displayId,d,o.inner.id);n.push(u),i.delete(o.inner.id)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[],n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.aggregatesWorldSpace())if(t.has(o.displayId)&&!r.has(o.displayId)){const d=rs(o,this._metadata.geometryType,!1,!1);if(r.add(o.displayId),d.attributes.cluster_count===1){i.push({...d,displayId:o.displayId});continue}n.push({...d,displayId:o.displayId})}return{features:i,aggregates:n}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.clusters())if(r.inner.id===e)return Array.from(r.inner.containedObjectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;for(const a of e)qs(a)&&a.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this.invalidate(),this._lastHandledLocalEdit=a.lastLocalEditDropped);const t=this._getClusterState(this._requiredLevel,this._requiredScale),r=Array.from(this._sendStates.values()).filter(a=>a.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,r)||!this._source.updateTracking.updating)for(const a of r)a.subscription.tile.level===this._requiredLevel&&(a.didSend=!1,a.done=!1);const i=Array.from(this._sendStates.values()).filter(a=>a.done).map(a=>a.subscription.tile.key),n=new Set(i);for(const a of this._sendStates.values())this._source.updateTracking.updating&&(i.some(o=>o.containsChild(a.subscription.tile.key))||a.subscription.tile.key.getChildKeys().every(o=>n.has(o)))||a.didSend||a.subscription.tile.level!==this._requiredLevel||(a.didSend=!0,yield*this._update(a,t,this._source));await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(this._requiredLevel==null||this._requiredScale==null)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.aggregatesWorldSpace())e(r)}_getClusterState(e,t){if(e==null||t==null)throw new Error("InternalError: Level and scale must be defined");let r=this._cellsPerScale.get(t);return r||(r=new wi(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,r)),r}async*_update(e,t,r){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!r.updateTracking.updating;const n=i.getCursor(),a=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;n.next();)this._attributeStore.setAttributeData(n.getDisplayId(),n,a);yield new _t(e.subscription,i,!0,e.done,{})}},vi=class extends ht{},xi=class extends ms{constructor(s,e,t){super(s,e),this._timeZone=t,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const s of this._source.chunks())this._cleanupChunkIds(s)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(s){super.onSubscribe(s),this._evalOptions=s.tile.createArcadeEvaluationOptions(this._timeZone)}createState(s){return new vi(s)}get aggregateQueryEngine(){return null}displayMap(s,e,t){const r=new Map(s.map(n=>[e(n),n])),i=[];for(const n of this._source.chunks()){const a=n.reader.getCursor();for(;a.next();){const o=a.getObjectId(),d=a.getDisplayId(),u=r.get(o);if(u!=null){const h=t(d,u,o);i.push(h),r.delete(o)}}}return i}getDisplayFeatures(s){const e=new Set(s),t=new Set,r=[];for(const i of this._source.chunks()){const n=i.reader.getCursor();for(;n.next();){const a=n.getObjectId(),o=n.getDisplayId();e.has(o)&&!t.has(a)&&(r.push({...n.readLegacyFeatureWorldSpace(),displayId:o}),t.add(a))}}return{features:r,aggregates:[]}}async*applyLocalEdit(s){const e=[],t=s.reader.getCursor();for(;t.next();){const n=t.getObjectId(),a=this._attributeStore.createDisplayIdForObjectId(n);t.setDisplayId(a),this._attributeStore.setAttributeData(a,t,this._evalOptions),e.push(a)}const r=[];for(const n of s.removed){const a=this._attributeStore.getDisplayIdForObjectId(n);a!=null&&r.push(a)}w("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:s,modifiedDisplayIds:e,removedDisplayIds:r});const i=new Je(this._source.metadata,"localEdit");i.applyOverrides(s),this.handledChunks.add(i.chunkId),this.handledChunksForAttributeData.add(i.chunkId),this.handledChunksForIdCreation.add(i.chunkId);for(const n of this._sendStates.values())n.handledChunks.add(i.chunkId),yield new Be(n.subscription,null,e,!1,i.queryInfo);for(const n of this._sendStates.values()){const a=i.getTileReader(n.subscription.tile);yield new Be(n.subscription,a,r,!1,i.queryInfo)}for(const n of s.removed)this._attributeStore.releaseDisplayIdForObjectId(n)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const s of this._sendStates.values())yield*this._update(s)}}removeChunks(s){for(const e of s)this.handledChunks.delete(e.chunkId),this.handledChunksForAttributeData.delete(e.chunkId),this._cleanupChunkIds(e)}afterUpdateChunks(){for(const s of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(s);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(s){if(this.handledChunksForIdCreation.has(s.chunkId)){const e=s.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(t):this._attributeStore.releaseDisplayIdForObjectId(t)}this.handledChunksForIdCreation.delete(s.chunkId)}}async _updateAttributeData(){for(const s of this._source.chunks()){const{chunkId:e,reader:t}=s;if(!this.handledChunksForIdCreation.has(e)){this.handledChunksForIdCreation.add(e);const r=t.getCursor();for(;r.next();){const i=this._attributeStore.createDisplayIdForObjectId(r.getObjectId());r.setDisplayId(i)}}}for(const s of this._source.chunks())if(!this.handledChunksForAttributeData.has(s.chunkId)){this.handledChunksForAttributeData.add(s.chunkId);const e=s.reader.getCursor();for(;e.next();){const t=e.getDisplayId();this._attributeStore.setAttributeData(t,e,this._evalOptions)}}}*_update(s){const{subscription:e,handledChunks:t}=s;for(const r of this._source.chunks()){const{chunkId:i}=r;if(t.has(i))continue;t.add(i);const n=r.getTileReader(e.tile);n&&(yield new _t(s.subscription,n,!1,r.end,r.queryInfo))}}},Si=class{constructor(s,e){this._connection=s,this._source=e,this._version=1,this._registry=new Ir,this._proxy=new fr({fetch:(t,r)=>this._connection.layerView.fetch(t,r),fetchDictionary:(t,r)=>this._connection.layerView.fetchDictionary(t,r)}),this._attributeStore=new yr({isLocal:!1,update:t=>it(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(s){return this._strategy?this._strategy.getDisplayFeatures(s):{features:[],aggregates:[]}}getDisplayIds(s){const e={};return this._strategy&&this._strategy.displayMap(s,t=>t,(t,r,i)=>{e[i]=t}),e}getFeatureObjectIdsForAggregate(s){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(s):[]}onSubscribe(s){this._strategy?.onSubscribe(s)}onUnsubscribe(s){this._strategy?.onUnsubscribe(s)}async update(s,e,t,r,i){const n=s.processor,a=le(this._schema?.storage,n.storage),o=le(this._schema?.mesh.properties,n.mesh.properties),d=le(this._schema?.mesh.factory,n.mesh.factory),u=le(this._schema?.mesh.strategy,n.mesh.strategy),h=o||d||u;if(!(a||h)&&!r)return;w("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:Kt(this._schema,n),schema:n}),this._schema=n;const l=P.fromJSON(this._source.service.outSpatialReference),p=new at({fields:this._source.metadata.fieldsIndex,spatialReference:l});if(await this._attributeStore.update(n.storage,p,this._source.metadata,l,e),this._strategy?.invalidateAttributeData(),!r&&!h)return;(u||o)&&await this._updateStrategy(n.mesh.strategy,l,i,n.mesh.properties.timeZone),this._updateSortKey(p,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const g=new Jr(p,this._proxy,t,this._registry);return(d||n.mesh.factory.symbology.type==="dictionary")&&(this._factory=await Hr.create(g,n.mesh.factory)),this._invalidate(),this._version=e,this._connection.container.updateRenderState(this._version)}async applyLocalEdit(s){if(!this._strategy)return;const e=this._strategy.applyLocalEdit(s);for await(const t of e)try{await this._process(t)}catch{}}async updateChunks(){this._strategy?.beforeUpdateChunks(),await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(s){this._strategy?.removeChunks(s),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:s}){if(!this._strategy)return void this._attributeStore.setHighlight(s.map(({objectId:t,highlightFlags:r})=>({objectId:t,highlightFlags:r,displayId:-1})),s);const e=this._strategy.displayMap(s,({objectId:t})=>t,(t,{highlightFlags:r},i)=>({objectId:i,displayId:t,highlightFlags:r}));this._attributeStore.setHighlight(e,s)}async _doUpdateChunks(){if(!this._strategy)return;const s=this._strategy.updateChunks(),e=[],t=new Map;for await(const r of s){let i=t.get(r.id);i==null&&(i=new Kr({concurrency:16,process:a=>this._process(a)}),t.set(r.id,i));const n=i.push(r).catch(a=>et(a));e.push(n)}try{await Promise.all(e)}catch{}w("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(s,e,t,r){switch(this._strategy?.destroy(),s.type){case"feature":this._strategy=new xi(this._source,this._attributeStore,r);break;case"binning":this._strategy=await yi.create(s,e,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await Ii.create(this._connection,s,e,this._source,this._attributeStore,r)}for(const i of t)this._strategy.onSubscribe(i)}async _updateSortKey(s,e){if(this._sortInfo=Zt(this._sortInfo?.computed),e!=null){const t=e.byRenderer?null:await s.createComputedField(e);this._sortInfo={...e,computed:t}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(s){const e=s.subscription;if(w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process`)}await this._fetchResources(s),Z(e.signal);const t=await this._write(s,e.tile.createArcadeEvaluationOptions(this._schema?.mesh.properties.timeZone)),r=e.tile.tileInfoView.getLODInfoAt(e.tile.key),{message:i,transferList:n}=t.serialize(r),a={objectIdMap:null,inner:s.createMessage(i,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){a.objectIdMap={};const o=s.reader?.getCursor();if(o)for(;o.next();)a.objectIdMap[o.getDisplayId()]=o.getObjectId()}if(Z(e.signal),await this._connection.container.onMessage(a,{signal:e.signal,transferList:n}),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process.await`)}}async _fetchResources(s){await this._fetchMatcherResources(s),await this._fetchWriterResources(s)}async _fetchMatcherResources(s){if(s.reader)return this._factory.enqueueMatcherRequests(this._proxy,s.reader)}async _fetchWriterResources(s){if(!s.reader)return;const e=s.reader.getCursor(),t=s.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;e.next();)this._factory.enqueueWriterRequests(this._proxy,e,t);await this._proxy.fetchEnqueuedResources()}async _write(s,e){const t=s.subscription.tile,r=s.reader?.getCursor(),i=r?.getSize()??0,n=t.tileInfoView.tileInfo.isWrappable,a=t.tileInfoView.tileInfo.spatialReference.isWGS84,o=new Nr(t.key,this._strategy.enablePixelBuffering,n,a,i);if(!r)return o;const d=t.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;r.next();){const u=this._getSortKeyValue(r,e);o.entityStart(r.getDisplayId(),u),this._factory.write(o,this._proxy,r,d,t.level),o.entityEnd()}return o}_getSortKeyValue(s,e){if(!this._sortInfo)return 0;const{computed:t,order:r,byRenderer:i}=this._sortInfo,n=i?this._factory.getSortKey(s,e):t?.read(s,e);return n==null||isNaN(n)?0:n*(r==="asc"?-1:1)}},Fi=class Rs{static from(e){let t=0,r=0,i=0;return e.forEach(n=>{const a=n._readGeometry();a&&(r+=a.isPoint?1:a.lengths.reduce((o,d)=>o+d,0),i+=a.isPoint?1:a.lengths.length,t+=1)}),new Rs(t,r,i)}constructor(e,t,r){this.featureCount=e,this.vertexCount=t,this.ringCount=r}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}};const Le=4;function ki(s,e,t){const r=s.orderByFields??t.objectIdField+" ASC",i=s.source,n={returnCentroid:!(i!==null&&typeof i=="object"&&"path"in i&&Pr(i.path))&&t.serviceGeometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:t.timeReferenceUnknownClient??void 0,outSpatialReference:P.fromJSON(s.outSpatialReference),orderByFields:s.type==="memory"?[]:[r],where:e.mutable.dataFilter.definitionExpression??"1=1",outFields:e.mutable.availableFields,multipatchOption:t.serviceGeometryType==="esriGeometryMultiPatch"?"xyFootprint":null};if(e.type==="feature"){const{gdbVersion:a,historicMoment:o,timeExtent:d}=e.mutable.dataFilter;return{...n,gdbVersion:a,historicMoment:o?new Date(o):null,timeExtent:d?jr.fromJSON(d):null,outFields:e.mutable.availableFields}}return n}let Ci=class As{static fromSchema(e,t,r){const i=t.type==="feature"?t.mutable.dataFilter.queryScaleRanges:[];return new As(ki(e,t,r),i,r.subtypeField,t.mutable.dataFilter.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,i,n,a){this._queryParams=e,this._queryScaleRanges=t,this._subtypeField=r,this._customParameters=i,this._geometryType=n,this._queryMetadata=a}get pageSize(){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?Le:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){if(!t.getSize())return null;const r=e.clone();if(this._queryParams.outFields[0]==="*"){if((r.outFields??[])[0]==="*")return null;r.outFields=this._queryParams.outFields}else{const i=new Set(this._queryParams.outFields),n=[];for(const a of i)t.hasField(a)||n.push(a);if(n.length===0)return null;r.outFields=n}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new os({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support tile queries");const r=this.createQuery(t),i=r.inner;if(this._queryScaleRanges.length){const n=this._queryScaleRanges.filter(a=>(!a.minScale||a.minScale>=e.maxScale)&&(!a.maxScale||a.maxScale<=e.minScale)).map(a=>a.subtypeCode);if(n.length){const a=`${this._subtypeField} IN (${n})`;i.where=Js(i.where,a)}}if(i.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.extent,this._queryMetadata.supportsQuantization?this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset=e.resolution*w("feature-polyline-generalization-factor")):this._geometryType!=="esriGeometryPolyline"&&this._geometryType!=="esriGeometryPolygon"||(i.maxAllowableOffset=e.resolution,this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset*=w("feature-polyline-generalization-factor"))),i.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,i.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(i.maxRecordCountFactor=Le),w("esri-tiles-debug")){const n=e.id.replaceAll("/",".");r.customParameters=r.customParameters?{...r.customParameters,tileId:n}:{tileId:n}}return r}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:Le})}};const Ti=2500;let ye=class extends Ht{constructor(s){super(),this._connection=s,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this._queuedCommands=[],this.addHandles([Ne(()=>this._strategy?.connectionStatus??"disconnected",e=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:e})},{initial:!0}),Ne(()=>this._strategy?.errorString||null,e=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:e}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(s){this._strategy==null&&this._resetUpdateInfo(performance.now());const e="event-handles";this.removeHandles(e),s!=null&&(this.addHandles([s.events.on("data-received",t=>this._onFeature(t)),s.events.on("message-received",t=>this._onWebSocketMessage(t)),s.events.on("features-updated",t=>this._onUpdate(t)),s.events.on("tick",()=>this._onTick())],e),this._queuedCommands.forEach(t=>t(s)),this._queuedCommands=[]),this._strategy=s}updateCustomParameters(s){s!=null&&this._callOrEnqueue(e=>e.updateCustomParameters(s))}sendMessageToSocket(s){this._callOrEnqueue(e=>e.sendMessageToSocket(s))}sendMessageToClient(s){this._callOrEnqueue(e=>e.sendMessageToClient(s))}enableEvent(s,e){e?this._enabledEventTypes.add(s):this._enabledEventTypes.delete(s)}disconnect(){this._strategy?.disconnect()}connect(){this._strategy?.connect()}clear(){this._strategy?.clear()}_onWebSocketMessage(s){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:s})}_onFeature(s){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:s.attributes,centroid:s.centroid,geometry:s.geometry}})}_onUpdate(s){this._updateInfo.client+=s}_onTick(){const s=performance.now(),e=s-this._lastTime;if(e>Ti){const t=Math.round(this._updateInfo.client/(e/1e3)),r=Math.round(this._updateInfo.websocket/(e/1e3));this._resetUpdateInfo(s),this._layerView.emitEvent({name:"update-rate",event:{client:t,websocket:r}})}}_resetUpdateInfo(s){this._lastTime=s,this._updateInfo.client=0,this._updateInfo.websocket=0}_callOrEnqueue(s){this._strategy!=null?s(this._strategy):this._queuedCommands.push(s)}};V([ge()],ye.prototype,"_strategy",void 0),ye=V([Xt("esri.views.2d.layers.features.sources.StreamMessenger")],ye);let pt=class{constructor(s){this._store=s,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}unsafeSetQueryHistoricMoment(s){throw new Error("InternalError: LoadStrategy does not support query info")}async queryOverride(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async queryByObjectId(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async addParquetFile(s){throw new Error("InternalError: LoadStrategy does not support loading blobs")}};const ze=268435455;let Mi=class{constructor(){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}};function qi(s,e,t=!1){const r=s.asUnsafe(),i=r.pos(),n=new Mi;let a=0,o=0;const d=1,u=2,h=4,l=3;let p=null,g=null,_=null,f=!1;const y=[];for(;r.next();)switch(r.tag()){case 1:p=r.getString();break;case 3:g=r.getString();break;case 12:_=r.processMessage(zr);break;case 9:if(n.exceededTransferLimit=r.getBool(),n.exceededTransferLimit){n.offsets.geometry=t?new Float64Array(8e3):new Int32Array(8e3),n.centroid=t?new Float64Array(16e3):new Int32Array(16e3);for(let b=0;b0:!1}let ji=class Ke extends Fe{static fromBuffer(e,t,r=!1){const i=t.geometryType,n=Oi(e),a=qi(n,i==="esriGeometryPoint",r);return new Ke(n,a,t)}constructor(e,t,r){super(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._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){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="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new Ke(e,this._header,this.metadata);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndexu.length)for(let y=0;y=y?(h+=-.5*(R-C)*(N+x),b>1&&Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k):(u[d++]=S,u[d++]=k,b++),C=R,x=N):(E+=S,L+=k),S=E,k=L,v++}b<3||F?d-=2*b:(h+=-.5*(C+S-C)*(x+k+x),Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k,a.push(b)):(u[d++]=S,u[d++]=k,a.push(++b)))}else{let y=0,v=t.getSInt32(),b=t.getSInt32();this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32(),u[d++]=v,u[d++]=b,y+=1;for(let F=1;F2&&Ue(g,u[d-2],u[d-1],C,x)?(u[d-2]+=C,u[d-1]+=x):(u[d++]=C,u[d++]=x,y+=1),v=S,b=k}a.push(y)}break}default:t.skip()}return this._cache.area=h,a.length?new M(a,u):u!=null?this._createQuantizedExtrudedGeometry(u[0],u[1]):null}},qe=class{constructor(s,e){this.service=s,this._metadata=e}destroy(){}};function Di(s,e){switch(s.type){case"memory":return new zi(s,e);case"ogc":return new Gi(s,e);case"feature-service":return s.queryMetadata.supportsFormatPBF&&w("featurelayer-pbf")?new Ui(s,e):new Wi(s,e)}}async function Li(s){const e=new lr;return await e.open(s,{}),e}let zi=class extends qe{constructor(s,e){super(s,e),this._portsOpen=Li(s.source).then(t=>this.client=t)}destroy(){this.client.close(),this.client=null}async executeQuery(s,e){await this._portsOpen;const t=await this.client.invoke("queryFeatures",s.toJSON(),e);return q.fromFeatureSet(t,this._metadata)}},Ui=class extends qe{async executeQuery(s,e){const{data:t}=await Ar(this.service.source,s,e),r=!s.quantizationParameters;return ji.fromBuffer(t,this._metadata,r)}},Wi=class extends qe{async executeQuery(s,e){const{source:t,queryMetadata:r}=this.service;if(s.quantizationParameters!=null&&!r.supportsQuantization){const n=s.clone(),a=ds(n.quantizationParameters);n.quantizationParameters=null;const{data:o}=await It(t,n,this._metadata.spatialReference,e),d=ss(o,this._metadata.objectIdField);return is(a,d),q.fromOptimizedFeatureSet(d,this._metadata)}const{data:i}=await It(t,s,this._metadata.spatialReference,e);return this._metadata.geometryType==="esriGeometryPoint"&&(i.features=i.features?.filter(n=>{if(n.geometry!=null){const a=n.geometry;return Number.isFinite(a.x)&&Number.isFinite(a.y)}return!0})),q.fromFeatureSet(i,this._metadata)}},Gi=class extends qe{async executeQuery(s,e){if(s.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const r=s.clone(),i=ds(r.quantizationParameters);r.quantizationParameters=null;const n=await vt(this.service.source,s,e);return is(i,n),q.fromOptimizedFeatureSet(n,this._metadata)}const t=await vt(this.service.source,s,e);return q.fromOptimizedFeatureSet(t,this._metadata)}},Ps=class extends pt{constructor(s,e,t,r,i){super(t),this._serviceInfo=s,this._queryInfo=e,this._metadata=r,this._connection=i,this._queue=new ts({concurrency:16,process:async n=>{const a={signal:n.options?.signal,query:n.query.customParameters};return this._adapter.executeQuery(n.query.inner,a)}}),this._adapter=Di(s,r)}unsafeSetQueryHistoricMoment(s){this._queryInfo.updateHistoricMoment(s)}async updateFields(s){this._queryInfo.updateFields(s);const e=Array.from(this._store.chunks()).map(async r=>{const i=os.fromJSON(r.queryInfo.queryJSON);if(i)try{return await this._tryUpdateFields(r.reader,i),null}catch(n){return n}}),t=(await Promise.all(e)).filter(r=>r);if(t.length)throw new W("featurelayer-query","Encountered errors when downloading fields",{errors:t})}async queryByObjectId(s){if(s.length===0)return q.empty(this._metadata);const e=this._queryInfo.createQuery({objectIds:s});return this._fetch(e)}async _fetch(s,e){const t=await this._enqueue(s,e);return await this._tryUpdateFields(t,s.inner),t}async _tryUpdateFields(s,e){const t=this._queryInfo.createPatchFieldsQuery(e,s);if(!t)return;const r=await this._enqueue(t,this._options);s.joinAttributes(r)}async _enqueue(s,e){return this._connection.onEvent({type:"fetchStart"}),this._queue.push({query:s,options:e}).finally(()=>{this._connection.onEvent({type:"fetchEnd",done:this._queue.length===0})})}},js=class extends Ps{constructor(){super(...arguments),this._chunksById=new Map}unload(s){this._removeChunks(s.tile)}_addChunk(s){const e=s.tile.id;this._chunksById.has(e)||this._chunksById.set(e,[]);const t=s.size();(t||s.first||s.end)&&(w("esri-2d-update-debug")&&console.debug(`Chunk[${s.chunkId}] ATileLoadStrategy.addChunk [count=${t}]`),this._chunksById.get(e).push(s),this._store.insert(s))}_removeChunks(s){const e=this._chunksById.get(s.key.id)??[];for(const t of e)w("esri-2d-update-debug")&&console.debug(`Tile[${s.key.id}] Chunk[${t.chunkId}] ATileLoadStrategy.removeChunk`),this._store.remove(t);this._chunksById.delete(s.key.id)}},Pt=class extends ue{constructor(s,e,t,r,i,n){super(),this._reader=s,this._queryJSON=e,this._tile=t,this._sourceTile=r,this._sourceTileDepth=i,this._end=n,this.chunkId=`${this._tile.key.id}.${this._sourceTile?.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._sourceTile?.key.normalizedId}${this._end?"e":""}`}get queryInfo(){return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:this._sourceTile?.key.id,size:this.size(),end:this.end}}get first(){return this._sourceTileDepth===0}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(s){return this._tile.key.id===s.key.id?this.reader:null}},Ni=class{constructor(s,e){this.subscription=s,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=Se([we(s.signal,()=>this._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(s){return this._tileIdToResult.get(s)}set(s,e){this._tileIdToResult.set(s,e)}get options(){return{signal:this._controller.signal}}},$i=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Ni(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{for await(const i of this._fetchChunkInfos(e,s.tile,0)){const{queryJSON:n,reader:a,sourceTile:o,sourceTileDepth:d,tile:u}=i,h=new Pt(a,n,u,o,d,!1);Z(e.options),this._addChunk(h)}}catch(i){t=i}const r=new Pt(q.empty(this._metadata),null,s.tile,null,-1,!0);if(this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async*_fetchChunkInfos(s,e,t){let r=s.get(e.id);const i=!!r;if(r||(r=await this._fetchChunkInfo(s,e,t),s.set(e.id,r)),r.reader.exceededTransferLimit&&tthis._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let s=-1;for(const e of this._pages.values())s=Math.max(s,e);return s+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(s,e){this._pages.add(s),this._done=this._done||e}},Vi=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Bi(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{await this._fetchPages(e)}catch(i){t=i}const r=new jt(q.empty(this._metadata),null,s.tile,-1,!0);if(Ks(e.options)||this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async _fetchPages(s){let e=0,t=s.pageStart,r=1;for(;e<20&&!s.done;){const i=[];for(let a=0;a{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Ds.decode();let se=null;function me(){return se!==null&&se.byteLength!==0||(se=new Uint8Array(c.memory.buffer)),se}function X(s,e){return s>>>=0,Ds.decode(me().subarray(s,s+e))}const Dt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>{c.__wbindgen_export_0.get(s.dtor)(s.a,s.b)});function Xi(s,e,t,r){const i={a:s,b:e,cnt:1,dtor:t},n=(...a)=>{i.cnt++;const o=i.a;i.a=0;try{return r(o,i.b,...a)}finally{--i.cnt==0?(c.__wbindgen_export_0.get(i.dtor)(o,i.b),Dt.unregister(i)):i.a=o}};return n.original=i,Dt.register(n,i,i),n}function Qi(s,e,t){c._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7be72b1871260ae2(s,e,m(t))}function Zi(){c.enableTracing()}let O=0;const be=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Hi=typeof be.encodeInto=="function"?function(s,e){return be.encodeInto(s,e)}:function(s,e){const t=be.encode(s);return e.set(t),{read:s.length,written:t.length}};function oe(s,e,t){if(t===void 0){const o=be.encode(s),d=e(o.length,1)>>>0;return me().subarray(d,d+o.length).set(o),O=o.length,d}let r=s.length,i=e(r,1)>>>0;const n=me();let a=0;for(;a127)break;n[i+a]=o}if(a!==r){a!==0&&(s=s.slice(a)),i=t(i,r,r=a+3*s.length,1)>>>0;const o=me().subarray(i+a,i+r);a+=Hi(s,o).written,i=t(i,r,a,1)>>>0}return O=a,i}let U=null;function H(){return(U===null||U.buffer.detached===!0||U.buffer.detached===void 0&&U.buffer!==c.memory.buffer)&&(U=new DataView(c.memory.buffer)),U}function j(s,e){try{return s.apply(this,e)}catch(t){c.__wbindgen_exn_store(m(t))}}function Ji(s,e,t,r){c.wasm_bindgen__convert__closures__invoke2_mut__h35729c14da098d24(s,e,m(t),m(r))}let re=null;function Ki(){return re!==null&&re.byteLength!==0||(re=new Uint16Array(c.memory.buffer)),re}function Lt(s,e){const t=e(2*s.length,2)>>>0;return Ki().set(s,t/2),O=s.length,t}function Ls(s,e,t){const r=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;return D(c.readMetadata(r,i,m(e),m(t)))}function zt(s,e){if(!(s instanceof e))throw new Error(`expected instance of ${e.name}`);return s.ptr}function en(s,e,t,r,i){const n=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;zt(r,ee);var o=r.__destroy_into_raw();zt(i,J);var d=i.__destroy_into_raw();return D(c.readFile(n,a,m(e),m(t),o,d))}function We(s){return s==null}const Ut=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_fieldmetadata_free(s>>>0,1));class Ee{static __wrap(e){e>>>=0;const t=Object.create(Ee.prototype);return t.__wbg_ptr=e,Ut.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Ut.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_fieldmetadata_free(e,0)}get name(){let e,t;try{const n=c.__wbindgen_add_to_stack_pointer(-16);c.fieldmetadata_name(n,this.__wbg_ptr);var r=H().getInt32(n+0,!0),i=H().getInt32(n+4,!0);return e=r,t=i,X(r,i)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_free(e,t,1)}}get index(){return c.fieldmetadata_index(this.__wbg_ptr)}get type(){return["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"][c.fieldmetadata_esri_type(this.__wbg_ptr)]}}const Wt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_filemetadata_free(s>>>0,1));class ee{static __wrap(e){e>>>=0;const t=Object.create(ee.prototype);return t.__wbg_ptr=e,Wt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Wt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_filemetadata_free(e,0)}version(){return c.filemetadata_version(this.__wbg_ptr)}numRows(){return c.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return c.filemetadata_numFields(this.__wbg_ptr)>>>0}keyValueMetadata(e){try{const i=c.__wbindgen_add_to_stack_pointer(-16),n=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;c.filemetadata_keyValueMetadata(i,this.__wbg_ptr,n,a);var t=H().getInt32(i+0,!0),r=H().getInt32(i+4,!0);let o;return t!==0&&(o=X(t,r).slice(),c.__wbindgen_free(t,1*r,1)),o}finally{c.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(e){const t=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),r=O,i=c.filemetadata_getFieldIndex(this.__wbg_ptr,t,r);return i===16777215?void 0:i}getFieldByIndex(e){const t=c.filemetadata_getFieldByIndex(this.__wbg_ptr,e);return t===0?void 0:Ee.__wrap(t)}}const Gt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_geometryinfodescriptor_free(s>>>0,1));class J{static __wrap(e){e>>>=0;const t=Object.create(J.prototype);return t.__wbg_ptr=e,Gt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Gt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_geometryinfodescriptor_free(e,0)}get wkbIndex(){const e=c.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return e===16777215?void 0:e}set wkbIndex(e){c.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,We(e)?16777215:e)}get lngIndex(){const e=c.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return e===16777215?void 0:e}set lngIndex(e){c.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,We(e)?16777215:e)}get latIndex(){const e=c.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return e===16777215?void 0:e}set latIndex(e){c.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,We(e)?16777215:e)}static new(){const e=c.geometryinfodescriptor_new();return J.__wrap(e)}}const Nt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetchunk_free(s>>>0,1));class Oe{static __wrap(e){e>>>=0;const t=Object.create(Oe.prototype);return t.__wbg_ptr=e,Nt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Nt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetchunk_free(e,0)}size(){return c.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(e){return c.parquetchunk_hasField(this.__wbg_ptr,e)!==0}readX(e){return c.parquetchunk_readX(this.__wbg_ptr,e)}readY(e){return c.parquetchunk_readY(this.__wbg_ptr,e)}readAttributes(e){return D(c.parquetchunk_readAttributes(this.__wbg_ptr,e))}readAttribute(e,t){return D(c.parquetchunk_readAttribute(this.__wbg_ptr,e,t))}}const $t=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetfile_free(s>>>0,1));let zs=class Us{static __wrap(e){e>>>=0;const t=Object.create(Us.prototype);return t.__wbg_ptr=e,$t.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,$t.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetfile_free(e,0)}metadata(){const e=c.parquetfile_metadata(this.__wbg_ptr);return ee.__wrap(e)}readChunksWithCallback(e,t){const r=Lt(e,c.__wbindgen_malloc),i=O;return D(c.parquetfile_readChunksWithCallback(this.__wbg_ptr,r,i,m(t)))}updateChunks(e){const t=Lt(e,c.__wbindgen_malloc),r=O;return D(c.parquetfile_updateChunks(this.__wbg_ptr,t,r))}};const Bt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_rangeproviderjs_free(s>>>0,1));class ne{static __wrap(e){e>>>=0;const t=Object.create(ne.prototype);return t.__wbg_ptr=e,Bt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Bt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_rangeproviderjs_free(e,0)}static new(e,t){const r=c.rangeproviderjs_new(m(e),m(t));return ne.__wrap(r)}static withFetch(){const e=c.rangeproviderjs_withFetch();return ne.__wrap(e)}}async function tn(s,e){if(typeof Response=="function"&&s instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(s,e)}catch(r){if(s.headers.get("Content-Type")=="application/wasm")throw r;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r)}const t=await s.arrayBuffer();return await WebAssembly.instantiate(t,e)}{const t=await WebAssembly.instantiate(s,e);return t instanceof WebAssembly.Instance?{instance:t,module:s}:t}}function Ws(){const s={wbg:{}};return s.wbg.__wbg_new_abda76e883ba8a5f=function(){return m(new Error)},s.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const r=oe(I(t).stack,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;H().setInt32(e+4,i,!0),H().setInt32(e+0,r,!0)},s.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let r,i;try{r=e,i=t,console.error(X(e,t))}finally{c.__wbindgen_free(r,i,1)}},s.wbg.__wbindgen_object_drop_ref=function(e){D(e)},s.wbg.__wbindgen_is_function=function(e){return typeof I(e)=="function"},s.wbg.__wbg_self_3093d5d1f7bcb682=function(){return j(function(){return m(self.self)},arguments)},s.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return j(function(){return m(window.window)},arguments)},s.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return j(function(){return m(globalThis.globalThis)},arguments)},s.wbg.__wbg_global_e5a3fe56f8be9485=function(){return j(function(){return m(global.global)},arguments)},s.wbg.__wbindgen_is_undefined=function(e){return I(e)===void 0},s.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){return m(new Function(X(e,t)))},s.wbg.__wbindgen_object_clone_ref=function(e){return m(I(e))},s.wbg.__wbindgen_number_new=function(e){return m(e)},s.wbg.__wbg_new_525245e2b9901204=function(){return m(new Object)},s.wbg.__wbindgen_string_new=function(e,t){return m(X(e,t))},s.wbg.__wbg_call_1084a111329e68ce=function(){return j(function(e,t){return m(I(e).call(I(t)))},arguments)},s.wbg.__wbg_call_89af060b4e1523f2=function(){return j(function(e,t,r){return m(I(e).call(I(t),I(r)))},arguments)},s.wbg.__wbg_call_7de908392845a9a5=function(){return j(function(e,t,r,i,n){return m(I(e).call(I(t),I(r),I(i),I(n)))},arguments)},s.wbg.__wbg_valueOf_563b3487b1b116aa=function(e){return I(e).valueOf()},s.wbg.__wbg_set_eacc7d73fefaafdf=function(){return j(function(e,t,r){return Reflect.set(I(e),I(t),I(r))},arguments)},s.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){return m(I(e).buffer)},s.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var r={a:e,b:t},i=(n,a)=>{const o=r.a;r.a=0;try{return Ji(o,r.b,n,a)}finally{r.a=o}};return m(new Promise(i))}finally{r.a=r.b=0}},s.wbg.__wbg_resolve_570458cb99d56a43=function(e){return m(Promise.resolve(I(e)))},s.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){return m(I(e).then(I(t)))},s.wbg.__wbg_then_876bb3c633745cc6=function(e,t,r){return m(I(e).then(I(t),I(r)))},s.wbg.__wbg_new_ea1883e1e5e86686=function(e){return m(new Uint8Array(I(e)))},s.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return I(e).length},s.wbg.__wbg_set_d1e79e2388520f18=function(e,t,r){I(e).set(I(t),r>>>0)},s.wbg.__wbindgen_throw=function(e,t){throw new Error(X(e,t))},s.wbg.__wbindgen_memory=function(){return m(c.memory)},s.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){return m(I(e).queueMicrotask)},s.wbg.__wbindgen_cb_drop=function(e){const t=D(e).original;return t.cnt--==1?(t.a=0,!0):!1},s.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(I(e))},s.wbg.__wbg_parquetchunk_new=function(e){return m(Oe.__wrap(e))},s.wbg.__wbindgen_bigint_from_i64=function(e){return m(e)},s.wbg.__wbg_parquetfile_new=function(e){return m(zs.__wrap(e))},s.wbg.__wbg_filemetadata_new=function(e){return m(ee.__wrap(e))},s.wbg.__wbindgen_closure_wrapper1401=function(e,t,r){return m(Xi(e,t,74,Qi))},s}function Gs(s,e){return c=s.exports,Ns.__wbindgen_wasm_module=e,U=null,re=null,se=null,c}function sn(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module:s}=s:console.warn("using deprecated parameters for `initSync()`; pass a single object instead");const e=Ws();return s instanceof WebAssembly.Module||(s=new WebAssembly.Module(s)),Gs(new WebAssembly.Instance(s,e),s)}async function Ns(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module_or_path:s}=s:console.warn("using deprecated parameters for the initialization function; pass a single object instead");const e=Ws();(typeof s=="string"||typeof Request=="function"&&s instanceof Request||typeof URL=="function"&&s instanceof URL)&&(s=fetch(s));const{instance:t,module:r}=await tn(await s,e);return Gs(t,r)}const rn=Object.freeze(Object.defineProperty({__proto__:null,FieldMetadata:Ee,FileMetadata:ee,GeometryInfoDescriptor:J,ParquetChunk:Oe,ParquetFile:zs,RangeProviderJs:ne,default:Ns,enableTracing:Zi,initSync:sn,readFile:en,readMetadata:Ls},Symbol.toStringTag,{value:"Module"}));let Ge=null;async function $s(){return Ge||(Ge=nn()),Ge}async function nn(){const s=await Promise.resolve().then(()=>rn);return await s.default({module_or_path:nr("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),s.enableTracing(),s}const Bs=s=>async function(e,t,r){const i=s(),{data:n}=await tt(e,{responseType:"array-buffer",query:i,headers:{range:`bytes=${t}-${r}`}});return n},Vs=s=>async function(e){const t=s(),{data:r}=await tt(e,{responseType:"native",method:"head",query:t}),i=r.headers.get("Content-Length");if(i==null)throw new Error("Unable to parse content length");return parseInt(i,10)};class ve{static async create(e,t){const r=await $s(),i=await r.readMetadata(e,Bs(t),Vs(t));return ve.fromFileMetadata(i)}static fromFileMetadata(e){const t=[];for(let r=0;r65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return"esriGeometryPoint"}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._objectIdFieldIndex!=null?this._inner.readAttribute(this._index,this._objectIdFieldIndex):this._index<<16|this._chunkId}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(;++this._index{const n=Array.from(r).map(a=>i.metadata.getFieldIndex(a));return i.inner.updateChunks(new Uint16Array(n))}))}async load(e){return this._promise==null&&(this._promise=this._download()),this._promise}unload(e){}async addParquetFile(e){this._insert(e)}async _insert(e){const t=await gt.create(e,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters}),{geometryInfo:r}=this._service;Z(this._options);const{fields:i,timeZoneByFieldName:n}=this._service.metadata.fieldsIndex,a=i.map(u=>({...u,index:t.metadata.getFieldIndex(u.name)})),o=de.fromJSON({fields:a,timeZoneByFieldName:n}),d=new Uint16Array(Array.from(this._availableFields.values()).map(u=>o.get(u)?.index));await t.inner.readChunksWithCallback(d,u=>{const h=this._chunkId++,l=new an(this._metadata,o,r,u,h),p=new xe(l,null,h,!1);this._store.insert(p)}),this._files.push(t)}async _download(){try{await Promise.all(this._service.source.urls.map(t=>this._insert(t)));const e=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(e)}catch(e){throw console.error(e),e}}}class dn extends Ps{constructor(e,t,r,i,n,a){super(e,t,r,n,a),this._random=new Jt(1e3),this._featureCount=i}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}load(e){return this._promise==null&&(this._promise=this._downloadPages(this._featureCount)),this._promise}unload(e){}async _downloadPages(e){const t=Math.ceil(e/this._queryInfo.pageSize),r=Array.from({length:t},(o,d)=>d).sort((o,d)=>this._random.getInt()-this._random.getInt()),i=await Promise.all(r.map(o=>this._downloadPage(o))),n=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(n);const a=i.filter(o=>o);if(a.length)throw new W("featurelayer-query","Encountered errors when downloading data",{errors:a})}async _downloadPage(e){try{const t=this._queryInfo.createPagedQuery(e),r=await this._fetch(t,this._options),i=new xe(r,t.inner.toJSON(),e,!1);return Z(this._options),this._store.insert(i),null}catch(t){return t}}}const un="__esri_stream_id__",Vt="__esri_timestamp__",Yt=1e3;class cn{constructor(e,t,r,i,n=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=r,this._purgeOptions=i,this.store=e,this.objectIdField=t,this.purgeInterval=n,this._useGeneratedIds=this.objectIdField===un}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const r of t.entries)this._removed.push(r)}add(e){if(this._useGeneratedIds){const a=this._nextId();e.attributes[this.objectIdField]=a,e.objectId=a}else e.objectId=e.attributes[this.objectIdField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new xt(1e5)),void this._trackIdLessObservations.enqueue(t);const r=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(r)){const a=this._purgeOptions?.maxObservations!=null?this._purgeOptions.maxObservations:Yt,o=ar(a,0,Yt);this._trackIdToObservations.set(r,new xt(o))}const i=this._trackIdToObservations.get(r),n=i?.enqueue(t);n!=null&&(this._addOrUpdated.has(n)?this._addOrUpdated.delete(n):this._removed.push(n))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),r=performance.now();r-this._lastPurge>=this.purgeInterval&&(this._purge(r),this._lastPurge=r);const i=[];if(t!=null)for(const a of t){const o=this.store.removeById(a);o!=null&&i.push(o)}const n=[];if(e!=null){const a=new Set(t??[]);for(const o of e)a.has(o.objectId)||(o.attributes[Vt]=r,this.store.add(o),n.push(o))}return!(!n.length&&!i?.length)&&(this.store.update(n,i),!0)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(r=>e[t++]=r),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;t!=null&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField){for(const r of this._trackIdToObservations.values())if(t>e.displayCount&&r.size){const i=r.dequeue();this._removed.push(i),t--}}if(this._trackIdLessObservations!=null){let r=t-e.displayCount;for(;r-- >0;){const i=this._trackIdLessObservations.dequeue();i!=null&&this._removed.push(i)}}}}_purgeByAge(e){const t=this._timeInfo?.startTimeField;if(!e.age||!t)return;const r=60*e.age*1e3,i=this._maxAge-r;this.store.forEach(n=>{n.attributes[t]{i.attributes[Vt]{e.size===0&&this._trackIdToObservations.delete(t)})}}let B=class extends Ht{constructor(s){super(s)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};V([ge()],B.prototype,"connection",void 0),V([ge()],B.prototype,"connectionStatus",null),V([ge()],B.prototype,"errorString",null),B=V([Xt("esri.views.2d.layers.features.sources.StreamConnectionState")],B);let ln=class{constructor(s,e){this._metadata=s,this._onUpdate=e,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return q.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(s){this._objectIdToFeature.set(s.objectId,s)}forEach(s){this._objectIdToFeature.forEach(s)}removeById(s){const e=this._objectIdToFeature.get(s);return e?(this._objectIdToFeature.delete(s),e):null}clear(){this._objectIdToFeature=new Map}update(s,e){this._onUpdate(s?.length??0)}};class hn extends ue{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class _n extends pt{constructor(e,t,r,i,n){super(r),this._service=e,this._dataFilter=t,this._streamOptions=i,this._metadata=n,this._connectionState=new B,this._forceRefresh=!1,this.events=new st;const{objectIdField:a,timeInfo:o}=this._metadata,{purgeOptions:d}=t;this._stagingStore=new ln(this._metadata,u=>this.events.emit("features-updated",u)),this._manager=new cn(this._stagingStore,a,o,d),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const e=this._chunk!=null;this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new hn(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick")):this.events.emit("tick")}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){this._connection=Zt(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(this._connection!=null)return;const{geometryType:e,spatialReference:t}=this._metadata,{maxReconnectionAttempts:r,maxReconnectionInterval:i,geometryDefinition:n,definitionExpression:a,customParameters:o}=this._dataFilter;this._connection=Ur(this._service.source,t,this._streamOptions.outSR,e,a,n,r,i,o),this._handlesGroup=Se([this._connection.on("data-received",d=>this._onFeature(d)),this._connection.on("message-received",d=>this._onWebSocketMessage(d))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._connection?.updateCustomParameters(e)}sendMessageToSocket(e){this._connection?.sendMessageToSocket(e)}sendMessageToClient(e){this._connection?.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch{}}}class pn{constructor(e){this._onChange=e,this._chunks=new Map,this._chunksToRemove=[],this.events=new st,this.featureAdapter=new mr}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._localEditChunk!=null&&this._chunksToRemove.push(this._localEditChunk),this._localEditChunk=null}*chunks(){this._localEditChunk&&(yield this._localEditChunk),this._localOverridesChunk&&(yield this._localOverridesChunk),yield*this._chunks.values()}dataChunks(){return this._chunks.values()}insert(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._localOverridesChunk?.overriddenIds.size&&(e.reader.removeIds(this._localOverridesChunk.overriddenIds),e.invalidate()),this._localEditChunk?.overriddenIds.size&&this._localEditChunk.removeOverrides(e),this._chunks.set(e.chunkId,e),this.events.emit("changed"),this._onChange()}remove(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanupRemovedChunks(){const e=this._chunksToRemove;return this._chunksToRemove=[],e}applyLocalOverrides(e,t){this._localOverridesChunk==null&&(this._localOverridesChunk=new Je(t,"localOverride")),this._localOverridesChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localOverridesChunk.overriddenIds),r.invalidate();this.events.emit("changed")}applyLocalEdit(e,t){this._localEditChunk==null&&(this._localEditChunk=new Je(t,"localEdit")),this._localEditChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localEditChunk.overriddenIds),r.invalidate();this.events.emit("changed")}forEach(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i.copy()),t.add(n))}}}forEachUnsafe(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i),t.add(n))}}}forEachInBounds(e,t){const r=new Set;for(const i of this.chunks()){const n=i.queryFeaturesInBounds(e);for(;n.next();){const a=n.getObjectId();r.has(a)||(t(n.copy()),r.add(a))}}}forEachBounds(e,t){const r=rt();for(const i of e)i.getBounds(r)&&t(r)}}class gn{constructor(e,t,r,i,n){this.service=e,this._aggregateAdapter=t,this._subscriptions=r,this._onChange=i,this._connection=n,this._updateTracking=new Wr({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._store=new pn(this._onChange),this._metadata=ot.createFeature(e.metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),this.service.type==="memory"&&this.service.source.map(e=>e.close())}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return this._streamMessenger==null&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return Fi.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,r=this._metadata;this._queryEngine=new as({featureStore:this._store,fieldsIndex:r.fieldsIndex,geometryType:r.geometryType,objectIdField:r.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:r.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return this._schema.type==="stream"}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(r=>this._connection.onEvent({type:"error",tile:e.tile.id,error:r})),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(Qt(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}getLocalEdit(e){return this._updateTracking.addPromise(this._getGetLocalEdit(e))}applyLocalEdit(e){this._didInvalidateData=!0,this._store.applyLocalEdit(e,this.metadata)}async update(e,t){const r=e.source,i=Kt(this._schema?.mutable,r.mutable);if(!i)return!1;if(w("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:i}),this._schema=r,this._queryEngine?.destroy(),this._queryEngine=null,this.service.type==="feature-service"&&this.service.queryMetadata.lastEditDate!=null&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),this._streamMessenger==null&&this._schema.type==="stream"&&this._initStreamMessenger(),mt(i,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),!0;if((r.type==="feature"||r.type==="parquet")&&mt(i,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(r.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(n){this._connection.onEvent({type:"updateFieldsError",error:n})}}return!1}return!(!bt(i,"dataFilter")&&!bt(i,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){this._strategy.addParquetFile(e)}_initStreamMessenger(){this._streamMessenger==null&&(this._streamMessenger=new ye(this._connection))}async _getGetLocalEdit(e){if(e.historicMoment&&this._schema.type==="feature"&&(this._schema.mutable.dataFilter.historicMoment=e.historicMoment,this._strategy.unsafeSetQueryHistoricMoment(new Date(e.historicMoment))),e.type==="edit-by-feature"){const i=[...e.added,...e.updated].map(n=>Y.fromJSON(n,this.metadata.objectIdField));return{reader:q.fromOptimizedFeatures(i,this.metadata),removed:this._resolveIdentifiers(e.removed)}}const t=this._resolveIdentifiers(e.removed);if(!e.updated.length&&!e.added.length)return{reader:q.empty(this.metadata),removed:t};const r=this._resolveIdentifiers([...e.added,...e.updated]);return{reader:await this._strategy.queryByObjectId(r),removed:t}}_resolveIdentifiers(e){const t=[],r=[];for(const i of e)i.objectId!=null&&i.objectId!==-1?r.push(i.objectId):t.push(i.globalId);if(t.length){const i=new Set(t),n=this.metadata.globalIdField;if(n==null)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");this._store.forEachUnsafe(a=>{const o=a.readAttribute(n);i.has(o)&&r.push(a.getObjectId())})}return r}async _queryLastEditDateChanged(){if(this._lastEditDate==null)return!1;const e=this.service.source,t={...e.query,f:"json"},r=(await tt(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),r=this.service.source&&"collection"in this.service.source,i=e||t||r;if(this._schema.type==="stream"){const d=new _n(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=d,d}if(this._schema.type==="parquet"){const d=this.service;return new on(d,this._metadata,this._schema,this._store)}const n=this.service,a=Ci.fromSchema(n,this._schema,this._metadata),o=await this._supportSnapshotMode(n,a);return o?new dn(n,a,this._store,o.featureCount,this.metadata,this._connection):i?new Vi(n,a,this._store,this.metadata,this._connection):new $i(n,a,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const i=Array.from(this._subscriptions.values());if(!i.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const n=Promise.all(i.map(a=>this._strategy.load(a).then(()=>this._connection.onEvent({type:"loaded",tile:a.tile.id})).catch(o=>this._connection.onEvent({type:"error",tile:a.tile.id,error:o}))));this._updateTracking.addPromise(n);try{r&&await n}catch(a){et(a)}this._connection.onEvent({type:"updateStrategyEnd"}),w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:r}=e,i=r.snapshotInfo;if(!i||!i.supportsSnapshotMinThreshold||!i.snapshotCountThresholds)return null;const n=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const o=(await Rr(n,a.inner,{query:a.customParameters})).data.count,{min:d,max:u}=i.snapshotCountThresholds;return o<=d||i.supportsSnapshotMaxThreshold&&othis._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateLocalEditsRequest=null,this._tileInfoView=null}onAttach(e){w("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const t=this._connection,r=hr.fromJSON(e.tileInfoJSON);this._tileInfoView=new _r(r),this._source=new gn(e.service,this._aggregateAdapter,this._subscriptions,()=>this._requestUpdate(),t),this._processor=new Si(t,this._source),this._handles=Se([Ne(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),Qt(this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){w("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new Gr(e)}get features(){const e=this._source?.queryEngine;if(!e)throw new W("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor?.aggregateQueryEngine;if(!e)throw new W("no-queryEngine","No aggregate query engine defined");return e}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}async updateSchema(e,t){return w("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new pe({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new pe(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new pe(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onEdits(e){if(this._updateLocalEditsRequest!=null)throw new W("InternalError - Already processing an edit");this._updateLocalEditsRequest=new pe(e);const t=this._updateLocalEditsRequest.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(Qs(e.radius));let r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const n=typeof e.fieldOffset=="string",a=e.fieldOffset??0,o=Array.from(this._subscriptions.values()),d=this._source.chunks(),u=t**2,h=3/(Math.PI*u),l=2*t,p=Math.ceil(T/l);for(const g of o){const _=g.tile,f=new Float64Array(p*p);for(const y of d){const v=y.getTileReader(_);if(!v)continue;const b=v.getCursor();for(;b.next();){let F=1;if(e.field!=null){const R=b.readAttribute(e.field);F=n?-1*+R:+R+a}const C=b.readXForDisplay()/l,x=b.readYForDisplay()/l,S=Math.floor(C),k=Math.floor(x);if(S<0||k<0||S>=p||k>=p)continue;const E=((.5+S-C)*l)**2+((.5+k-x)*l)**2;if(E>u)continue;const L=F*(h*(1-E/u)**2);f[k+S*p]+=L}}for(let y=0;yd+u.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const d=[];return this._source.store.forEachUnsafe(u=>d.push(u.readLegacyFeatureWorldSpace())),d}return null}const r=new Set,i=[],n=t.map(d=>d.reader.getCursor()),a=new Jt,o=3*e.sampleSize;for(let d=0;d=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,Zs(()=>this._scheduleNextUpdate()))}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=it(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;w("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const r=new pr(this._tileInfoView,t),i=new fn(r,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(w("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const i=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const n of i)this._doUpdateSubscriptions(n.inner),n.resolver.resolve()}const e=this._updateSchemaRequest;if(this._updateSchemaRequest=null,e!=null){const{schema:i,version:n}=e.inner;await this._doUpdateSchema(i,n)}const t=this._updateLocalEditsRequest;if(this._updateLocalEditsRequest=null,t!=null){w("esri-2d-update-debug")&&console.debug("Pipeline.applyEditOverride",t.inner);const i=await this._source.getLocalEdit(t.inner);await this._processor.applyLocalEdit(i),this._source.applyLocalEdit(i),w("esri-2d-update-debug")&&console.debug("Pipeline.endEditOverride",t.inner)}if(this._updateHighlightRequests.length){const i=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const n of i)this._processor.updateHighlight(n.inner),n.resolver.resolve()}const r=this._source.cleanupRemovedChunks();this._processor.removeChunks(r);try{this._subscriptions.size&&(w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(i){et(i)}t?.resolver.resolve(),e?.resolver.resolve(),this._updateRequested?(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})):(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const r={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),n=Array.from(this._subscriptions.values());await this._processor.update(e,t,r,i,n),w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){w("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{to as default}; +import{v as V,S as ge,i as Xt,K as w,bo as Se,ah as Ne,b9 as Qt,o as W,et as Qs,cY as Zs,bt as et,hC as le,J as P,aA as Zt,$ as Z,j as Ht,f as tt,b as Hs,eE as Jt,bV as Js,x as Ks,hr as er,hn as tr,I as st,gU as rt,E as we,eM as sr,p as rr,eJ as ir,bw as nr,ae as ar,O as or,l as dr,n as ur,B as ft,dk as yt,a1 as cr}from"./story-Doly9N9p.js";import{M as it,t as lr}from"./workers-PiCjreoO-Dc6Tqm-o.js";import{V as hr}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import{Q as _r,Z as pr,V as gr}from"./Tile-D75RMC64-g8Sx5TPr.js";import{s as nt}from"./TileKey-C5IL-JBr-BGwa3-Dg.js";import{t as T}from"./definitions-DJSdSb77-DkoRHaVx.js";import{P as Kt,C as mt,S as bt}from"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import{P as fr,m as yr,o as at,E as ot,W as wt,e as Fe,G as es,O as mr,q as br,L as wr}from"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import{d as Ir,g as vr}from"./MeshWriterRegistry-CIC9Yk_f-7OXlu7fG.js";import{k as ts}from"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import{A as xr,q as ss,d as Sr,j as rs,V as Fr,D as kr,e as Cr,f as Tr,C as Q,$ as is,n as Mr,O as ns,X as qr}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{i as Y,a as he,c as M}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{f as Er,h as Ie}from"./queryUtils-Brxu6254-CDiE0zms.js";import{o as de}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{s as Or}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js";import{Z as as}from"./QueryEngine-CH5uUhZK-DRGPyg2C.js";import{P as Rr,p as Ar,q as It}from"./query-DFW9-NG_-C3TyGmiM.js";import{L as Pr}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{b as os}from"./Query-BrwMGK8U-BPr0_G9t.js";import{k as jr}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import{z as ds}from"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import{_ as vt}from"./ogcFeatureUtils-Bs12bZY3-bQ3aM3rZ.js";import{o as Dr}from"./pbf-D-y3_eZO-CpHdkhuD.js";import{k as Lr,m as zr}from"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import{i as xt}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import{createConnection as Ur}from"./createConnection-CrkuTLXs-CK5s-xN-.js";import{a as Wr}from"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./main-QGPoLsvl.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./PieChartMeshWriter-C5yLDFwp-5CAejpYY.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./TurboLine-CIlsAy5m-C6Kc2De-.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./grouping-RwmXkHDc-CCFLL7L_.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-Dd_0rdy5.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-1ITtOELE.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./utils-tNxq3jkf-nfQcZo7O.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./geojson-CNt_qtQf-X0105Nc8.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./sourceUtils-BMeqkJ5g-DcR3VPl5.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";let Gr=class{constructor(s){this._client=s,this.layerView=this._client.createInvokeProxy(""),this.container=this._client.createInvokeProxy("container"),this._eventLog=this._client.createInvokeProxy("eventLog")}onEvent(s){it(this._eventLog.onEvent(s))}};const ke=1,dt=2,Ce=4,ut=8,ct=16,Te=32,lt=64,Me=128;function je(s){switch(s){case ke:case ut:case Te:return-1;case dt:case lt:return 0;case Ce:case ct:case Me:return 1}}function De(s){switch(s){case ke:case dt:case Ce:return-1;case ut:case ct:return 0;case Te:case lt:case Me:return 1}}const St=ke|ut|Te,Ft=Ce|ct|Me,kt=ke|dt|Ce,Ct=Te|lt|Me;let Nr=class{constructor(s,e,t,r,i=0){this.tileKey=s,this._bufferingEnabled=e,this._sizeHint=i,this._meshes={self:new wt(this.id,this._sizeHint),neighbors:new Array},this._currentRecordOverlaps=0,this._currentEntityOverlaps=0;const n=r?1:0;this._copyBufferedDataIntoSelf=t&&this._bufferingEnabled&&s.level===n}get id(){return this.tileKey.id}vertexCount(){return this._meshes.self.vertexCount()}indexCount(){return this._meshes.self.indexCount()}indexEnsureSize(s){this._meshes.self.indexEnsureSize(s)}entityStart(s,e=s){this._currentEntityOverlaps=0,this._meshes.self.entityStart(s,e)}entityRecordCount(){return this._meshes.self.entityRecordCount()}entityEnd(){if(this._meshes.self.entityEnd(),this._bufferingEnabled){if(this._copyBufferedDataIntoSelf)return;for(let s=0;s<8;s++){const e=1<{const n=r.serialize(),a=1<=T-i?St:Ft|St)|(e<0+n?Ct:e>=T-n?kt:Ct|kt));this._currentRecordOverlaps|=a}_copyIntoNeighbors(){for(let s=0;s<8;s++){const e=1<0){const i=this.getBackgroundFill();if(i)return[...i,...r]}return r}getSortKey(e,t){return 0}doMatch(e,t){return null}async fetchResources(e,t){}},Br=class cs extends G{static async fromDictionaryRenderer(e,t){return new cs(e,t)}constructor(e,t){super(),this._context=e,this._schema=t,this._hashToGroup=new Map}get fieldMap(){return this._schema.fieldMap}async fetchResources(e,t){const r=t.getCursor(),i=[];for(;r.next();)i.push(this._updateMeshWriterGroup(e,r));await Promise.all(i)}match(e,t){const r=e.getAttributeHash();return this._hashToGroup.get(r)}async _updateMeshWriterGroup(e,t){const r=t.readLegacyFeatureForDisplay(),i=t.getAttributeHash();if(this._hashToGroup.has(i))return;this._hashToGroup.set(i,null);const n=await e.fetchDictionaryResourceImmediate({type:"dictionary-request",feature:r});if(!n)return;const a=await this._context.createMeshWriters(n.meshes);this._hashToGroup.set(i,a)}},Vr=class ls extends G{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,t){const r=await e.storage.createComputedField(t),i=new ls(r,t.isMaxInclusive);await Promise.all(t.intervals.map(async o=>{const d=await e.createMeshWriters(o.meshes);i.add(o,d)}));const n=await e.createMeshWriters(t.defaultSymbol);i.setDefault(n);const a=await e.createMeshWriters(t.backgroundFill);return i.setBackgroundFill(a),i}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((r,i)=>r.interval.min-i.interval.min)}size(){return super.size()+this._intervals.length}doMatch(e,t){const r=this._field?.read(e,t);if(r==null||isNaN(r)||r===1/0||r===-1/0)return null;for(let i=0;i=n.min,d=this._isMaxInclusive?r<=n.max:r{const a=await e.createMeshWriters(n.meshes);return{minScale:n.minScale,maxScale:n.maxScale,meshes:a,expression:null,where:await e.storage.createWhereClause(n.where)}}),i=await Promise.all(r);return new hs(i)}constructor(e){super(),this._labels=e}match(e,t){if(!this._labels.length)return null;const r=this._getLabels(t.$view.scale),i=[];for(const n of r)n.where&&!n.where(e)||i.push(...n.meshes);return i}_getLabels(e){return this._labels.filter(t=>this._validForTileScale(t,e))}_validForTileScale(e,t){const r=t-t/4,i=t+t/2;return(!e.minScale||e.minScale>=r)&&(!e.maxScale||e.maxScale<=i)}},Xr=class _s extends G{constructor(e,t){super(),this._defaultSymbolSortKey=0,this._nullResult=null,this._resultsMap=new Map,this._fields=[],this._fields=e,this._separator=t||""}static async fromMatcherSchema(e,t){const r=t.expression?[e.storage.createComputedField({expression:t.expression})]:[t.field?e.storage.createComputedField({field:t.field}):null,t.field2?e.storage.createComputedField({field:t.field2}):null,t.field3?e.storage.createComputedField({field:t.field3}):null],i=(await Promise.all(r)).filter(d=>!!d),n=new _s(i,t.fieldDelimiter),a=await e.createMeshWriters(t.defaultSymbol);n.setDefault(a);const o=await e.createMeshWriters(t.backgroundFill);return n.setBackgroundFill(o),await Promise.all(t.map.map(async(d,u)=>{const h=await e.createMeshWriters(d.symbol);d.value===""?n.setNullResult(h):n.add(d.value,h,u+1)})),n}setNullResult(e){this._nullResult=e}getSortKey(e,t){const r=this._getValueFromFields(e,t);if(r==null||r===""||r==="")return 0;const i=this._resultsMap.get(r.toString());return i?i.sortKey:this._defaultSymbolSortKey}add(e,t,r){this._resultsMap.set(e.toString(),{meshWriters:t,sortKey:r}),this._defaultSymbolSortKey=Math.max(this._defaultSymbolSortKey,r+1)}size(){return super.size()+this._resultsMap.size}doMatch(e,t){const r=this._getValueFromFields(e,t);if(this._nullResult!==null&&(r==null||r===""||r===""))return this._nullResult;if(r==null)return null;const i=r.toString();return this._resultsMap.get(i)?.meshWriters}_getValueFromFields(e,t){const r=[];for(const i of this._fields){const n=i.read(e,t);n==null||n===""?r.push(""):r.push(n)}return r.join(this._separator)}};async function ae(s,e){switch(e.type){case"simple":case"heatmap":case"dot-density":case"pie-chart":return G.from(s,e);case"interval":return Vr.fromIntervalSchema(s,e);case"dictionary":return Br.fromDictionaryRenderer(s,e);case"label":return Yr.fromLabelSchema(s,e);case"map":return Xr.fromMatcherSchema(s,e);case"subtype":return Qr.fromSubtypes(s,e);case"cluster":return Zr.fromClusterSchema(s,e);default:throw new Error("Impl")}}let Qr=class ps extends G{constructor(e,t){super(),this._subMatchers=e,this._subtypeField=t}static async fromSubtypes(e,t){const r=new Map,i=[];for(const n in t.renderers){const a=parseInt(n,10),o=ae(e,t.renderers[n]).then(d=>r.set(a,d));i.push(o)}return await Promise.all(i),new ps(r,t.subtypeField)}match(e,t){const r=e.readAttribute(this._subtypeField),i=this._subMatchers.get(r);return i?i.match(e,t):null}},Zr=class gs extends G{static async fromClusterSchema(e,t){const[r,i]=await Promise.all([ae(e,t.feature),ae(e,t.cluster)]);return new gs(r,i)}constructor(e,t){super(),this._featureMatcher=e,this._clusterMatcher=t}match(e,t){return e.readAttribute("cluster_count")===1?this._featureMatcher.match(e,t):this._clusterMatcher.match(e,t)}},Hr=class fs extends $r{static async create(e,t){const r=await ae(e,t.symbology),i=t.labels?await ae(e,t.labels):null;return new fs(r,i)}constructor(e,t){super(),this._symbology=e,this._labels=t}destroy(){}async enqueueMatcherRequests(e,t){await Promise.all([this._symbology.fetchResources(e,t),this._labels?.fetchResources(e,t)])}enqueueWriterRequests(e,t,r){const i=this._symbology.match(t,r);if(i){for(const n of i)n.enqueueRequest(e,t,r);if(this._labels){const n=this._labels.match(t,r);if(!n)return;for(const a of n)a.enqueueRequest(e,t,r)}}}write(e,t,r,i,n){const a=this._symbology.match(r,i);if(a){for(const o of a)o.write(e,t,r,i,n);if(e.entityRecordCount()>=1&&this._labels){const o=this._labels.match(r,i);if(!o)return;for(const d of o)d.setReferences(a),d.write(e,t,r,i,n)}}}getSortKey(e,t){return this._symbology.getSortKey(e,t)}},Jr=class{constructor(s,e,t,r){this.storage=s,this.proxy=e,this.viewParams=t,this.registry=r}async createMeshWriters(s){const e=s.map(t=>this.registry.createMeshWriter(this.storage,this.proxy,this.viewParams,t));return Promise.all(e)}},Kr=class{constructor(s){this._outstandingMessages=[],this._queue=new ts({concurrency:s.concurrency,process:e=>s.process(e)})}async push(s){if(s.end)return await Promise.all(this._outstandingMessages),await this._queue.push(s),void(this._outstandingMessages=[]);const e=this._queue.push(s);return this._outstandingMessages.push(e),e}},ys=class $e{static async create(e,t){if(t.statisticType==="count"){const i=new vr(1);return new $e(t.name,t.alias,t.type,t.statisticType,i)}const r=await e.createComputedField({expression:t.onStatisticExpression?.expression,field:t.onStatisticField});return new $e(t.name,t.alias,t.type,t.statisticType,r)}constructor(e,t,r,i,n){this.name=e,this.alias=t,this.type=r,this.statisticType=i,this.computed=n}},ht=class{constructor(s){this.subscription=s,this.handledChunks=new Set}destroy(){}},ms=class{constructor(s,e){this._source=s,this._attributeStore=e,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}onSubscribe(s){const e=this.createState(s);this._sendStates.set(s.key.id,e),this.updateChunks()}onUnsubscribe(s){this._sendStates.get(s.key.id)?.destroy(),this._sendStates.delete(s.key.id)}invalidate(){const s=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of s)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(){}getFeatureObjectIdsForAggregate(s){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(s){return this.displayMap(s,e=>e,e=>e)}getDisplayAndObjectIds(s){return this.displayMap(s,e=>e,(e,t,r)=>[e,r])}beforeUpdateChunks(){}afterUpdateChunks(){}},bs=class extends ms{constructor(s,e,t,r){super(s,e),this.spatialReference=t,this.aggregateFields=r,this.events=new st,this.featureAdapter=Or}get aggregateQueryEngine(){return this._aggregateQueryEngine||(this._aggregateQueryEngine=new as({featureStore:this,fieldsIndex:this._metadata.fieldsIndex,geometryType:this._metadata.geometryType,objectIdField:this._metadata.objectIdField,spatialReference:this.spatialReference})),this._aggregateQueryEngine}removeChunks(s){}forEach(s){return this.forEachAggregateWorldSpace(s)}forEachInBounds(s,e){}forEachBounds(s,e){const t=rt();for(const r of s){const i=Fr(t,r.geometry,!1,!1);i&&e(i)}}},_t=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.clear=t,this.end=r,this.debugInfo=i,this.type="append"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"append",clear:this.clear,id:this.id,append:s,end:this.end,debugInfo:this.debugInfo,subscriptionVesrion:this.subscription.version,version:e,attributeEpoch:t}}},Be=class{constructor(s,e,t,r,i){this.subscription=s,this.reader=e,this.remove=t,this.end=r,this.debugInfo=i,this.type="update"}get id(){return this.subscription.tile.id}createMessage(s,e,t){return{type:"update",id:this.id,modify:s,debugInfo:this.debugInfo,remove:this.remove,version:e,subscriptionVesrion:this.subscription.version,end:this.end,attributeEpoch:t}}},ei=class ws{static fromReader(e){const t=[],r=e.copy(),i=rt();for(;r.next();)r.getBounds(i)&&t.push(r.getIndex());const n=gr(9,a=>(r.setIndex(a),{minX:r.getBoundsXMin(),minY:r.getBoundsYMin(),maxX:r.getBoundsXMax(),maxY:r.getBoundsYMax()}));return n.load(t),new ws(n)}constructor(e){this._index=e}search(e){const t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this._index.search(t)}};const ti=64;function si(s,e,t,r){const i=[s.xmin,s.ymin,s.xmax,s.ymax],n=dr.fromExtent(ur.fromBounds(i,r)),a=Ie(n,r,P.WGS84,{densificationStep:e*ti});if(!a)return null;const o=ns(new M,a,!1,!1),d=o.coords.filter((y,v)=>!(v%2)),u=o.coords.filter((y,v)=>v%2),h=Math.min(...d),l=Math.min(...u),p=Math.max(...d),g=Math.max(...u),_=Ve(h,l,t,P.WGS84),f=Ve(p,g,t,P.WGS84);return _&&f?{bounds:i,geohashBounds:{xLL:_[0],yLL:_[1],xTR:f[0],yTR:f[1]},level:t}:null}function Ve(s,e,t,r){if(r.isWebMercator){const a=ft(s/yt.radius),o=a-360*Math.floor((a+180)/360),d=[0,0];return Tt(d,0,ft(Math.PI/2-2*Math.atan(Math.exp(-e/yt.radius))),o,t),d}const i=Ie({x:s,y:e},r,P.WGS84);if(!i)return null;const n=[0,0];return Tt(n,0,i.y,i.x,t),n}function ri(s,e){let t=-90,r=90,i=-180,n=180;for(let a=0;a>h,y=(_&s.geohashY)>>l;for(let v=p-1;v>=0;v--){const b=(i+n)/2,F=f&1<=0;v--){const b=(t+r)/2,F=y&1<g?1:0;n|=_<<29-(p+5*l),u=(1-_)*u+_*g,h=(1-_)*g+_*h}for(let p=0;p<5;p++){const g=(o+d)/2,_=t>g?1:0;a|=_<<29-(p+5*l),o=(1-_)*o+_*g,d=(1-_)*g+_*d}}s[2*e]=n,s[2*e+1]=a}let Is=class{constructor(s){this._statistics=s}get statistics(){return this._statistics}};const Mt=Math.PI/180;let vs=class Ye{static create(e){return new Ye(e.map(t=>ii(t)))}constructor(e){this._statistics=e}values(){return this._statistics.values()}insert(e,t){for(const r of this._statistics)r.insert(e,t)}merge(e){for(let t=0;te.clone()))}};function ii(s){switch(s.statisticType){case"min":return new ni(s);case"max":return new ai(s);case"avg":return new di(s);case"avg_angle":return new ui(s);case"sum":case"count":return new oi(s);case"mode":return new ci(s)}}let K=class{constructor(s){this.field=s}insert(s,e){if(!this.field.computed)return;const t=this.field.computed.read(s,e);wr(t)||this._insertValue(t)}},ni=class xs extends K{constructor(){super(...arguments),this.type="min",this.value=Number.MAX_VALUE}_insertValue(e){this.value=Math.min(this.value,e)}merge(e){this.value=Math.min(this.value,e.value)}clone(){const e=new xs(this.field);return e.value=this.value,e}},ai=class Ss extends K{constructor(){super(...arguments),this.type="max",this.value=Number.MIN_VALUE}_insertValue(e){this.value=Math.max(this.value,e)}merge(e){this.value=Math.max(this.value,e.value)}clone(){const e=new Ss(this.field);return e.value=this.value,e}},oi=class Fs extends K{constructor(){super(...arguments),this.type="sum",this.value=0}_insertValue(e){this.value+=e}merge(e){this.value+=e.value}clone(){const e=new Fs(this.field);return e.value=this.value,e}},di=class ks extends K{constructor(){super(...arguments),this.type="avg",this._total=0,this._count=0}get value(){return this._total/this._count}_insertValue(e){this._total+=e,this._count+=1}merge(e){this._total+=e._total,this._count+=e._count}clone(){const e=new ks(this.field);return e._total=this._total,e._count=this._count,e}},ui=class Cs extends K{constructor(){super(...arguments),this.type="avg_angle",this._x=0,this._y=0,this._count=0}get value(){const e=this._x/this._count,t=this._y/this._count,r=180/Math.PI;return Math.atan2(t,e)*r}_insertValue(e){this._x=this._x+Math.cos(e*Mt),this._y=this._y+Math.sin(e*Mt),this._count+=1}merge(e){this._x+=e._x,this._y+=e._y,this._count+=e._count}clone(){const e=new Cs(this.field);return e._x=this._x,e._y=this._y,e._count=this._count,e}},ci=class Ts extends K{constructor(){super(...arguments),this._frequencies=new Map}get value(){let e,t=0;for(const[r,i]of this._frequencies.entries())i>t&&(t=i,e=r);return e}_insertValue(e){const t=this._frequencies.get(e);t!=null?this._frequencies.set(e,t+1):this._frequencies.set(e,1)}merge(e){for(const[t,r]of e._frequencies.entries()){const i=this._frequencies.get(t);i!=null?this._frequencies.set(t,i+r):this._frequencies.set(t,r)}}clone(){const e=new Ts(this.field);return e._frequencies=new Map(this._frequencies),e}},qt=class Xe extends Is{static create(e,t,r,i){const n=vs.create(e),a=new Array(32);for(let o=0;o=r)return this;const o=1-i%2,d=3*o+2*(1-o),u=2*o+3*(1-o),h=30-n-d,l=30-a-u,p=((e&7*o+3*(1-o)<>h)+((t&3*o+7*(1-o)<>l)*(8*o+4*(1-o)),g=this.children[p];return g==null?null:g.find(e,t,r,i+1,n+d,a+u)}_getLngLatBounds(){const e=this.depth,t=Math.ceil(e/2),r=Math.floor(e/2),i=30-(3*t+2*r),n=30-(2*t+3*r),a=this.xNode<=a)return;const p=Math.ceil((u+1)/2),g=Math.floor((u+1)/2),_=1-u%2,f=30-(3*p+2*g),y=30-(2*p+3*g),v=(i&7*_+3*(1-_)<>f,b=(n&3*_+7*(1-_)<>y,F=v+b*(8*_+4*(1-_));h=h<<3*_+2*(1-_)|v,l=l<<2*_+3*(1-_)|b,d.children[F]==null&&(d.children[F]=qt.create(this._fields,h,l,u+1),this._depth=Math.max(this._depth,u+1),this._size+=1),u+=1,d=d.children[F]}}putBins(e,t){for(const r of this.getNodes(t)){const i=e.get(r.id);i?i.merge(r):e.set(r.id,r.clone())}}getNodes(e){const t=[],{geohashBounds:r,level:i}=e;let n=this._root;for(;n!==null;){const a=n.depth,o=n.xNode,d=n.yNode;if(a>=i){t.push(n),n=n.next;continue}const u=Math.ceil((a+1)/2),h=Math.floor((a+1)/2),l=1-a%2,p=30-(3*u+2*h),g=30-(2*u+3*h),_=~((1<>p,v=(r.yLL&f)>>g,b=(r.xTR&_)>>p,F=(r.yTR&f)>>g,C=o<<3*l+2*(1-l),x=d<<2*l+3*(1-l),S=C+8*l+4*(1-l),k=x+4*l+8*(1-l),E=Math.max(C,y),L=Math.max(x,v),R=Math.min(S,b),N=Math.min(k,F);let ce=null,Re=null;for(let Ae=L;Ae<=N;Ae++)for(let Pe=E;Pe<=R;Pe++){const Xs=Pe-C+(Ae-x)*(8*l+4*(1-l)),te=n.children[Xs];te&&(ce||(ce=te,ce.next=n.next),Re&&(Re.next=te),Re=te,te.next=n.next)}n=ce||n.next}return t}}let Ms=class{constructor(s){this._options=s}insert(s,e){const t=s.getCursor(),r={$view:{scale:this._options.scale,timeZone:this._options.timeZone}};for(;t.next();)this._insertFeature(t,r,e)}_insertFeature(s,e,t){const{featureFilter:r}=this._options;if(r!==null&&!r.check(s))return;let i=0,n=0;if(s.geometryType==="esriGeometryPoint")i=s.readXWorldSpace(),n=s.readYWorldSpace();else{if(t){const o=s.readCentroidForDisplay();if(o==null)return;const[d,u]=o.coords;if(d<0||d>T||u<0||u>T)return}const a=s.readCentroidWorldSpace();if(a==null)return;i=a.coords[0],n=a.coords[1]}this._insert(s,i,n,e)}},hi=class extends Ms{constructor(s){super(s),this._tree=new li(this._options.fields)}put(s){throw new Error("Geohash tree does not support put")}putBounded(s,e,t){const{geohashLevel:r,spatialReference:i}=this._options,n=si(e,t,r,i);n!=null&&this._tree.putBins(s,n)}_insert(s,e,t,r){const{geohashLevel:i,spatialReference:n}=this._options,a=Ve(e,t,i,n);a&&this._tree.insert(s,e,t,a[0],a[1],i,r)}},Qe=class fe extends Is{static createId(e,t){return`${e}.${t}`}static create(e,t,r,i){return new fe(e,t,vs.create(r),i)}constructor(e,t,r,i){super(r),this.gridX=e,this.gridY=t,this._worldUnitsPerCell=i,this._count=0,this._xWorldTotal=0,this._yWorldTotal=0,this._objectIds=new Set}get id(){return fe.createId(this.gridX,this.gridY)}get containedObjectIds(){return this._objectIds}get count(){return this._count}get firstObjectId(){return this._objectIds.values().next().value}get centroidXWorld(){return this._xWorldTotal/this._count}get centroidYWorld(){return this._yWorldTotal/this._count}clone(){const e=new fe(this.gridX,this.gridY,this._statistics.clone(),this._worldUnitsPerCell);return e._count=this._count,e._xWorldTotal=this._xWorldTotal,e._yWorldTotal=this._yWorldTotal,e._firstFeatureAttributes=this._firstFeatureAttributes,e._objectIds=new Set(this._objectIds),e}insert(e,t,r,i){this._count===0?this._firstFeatureAttributes=e.readAttributes():this._firstFeatureAttributes=null,this._count+=1,this._xWorldTotal+=r,this._yWorldTotal+=i,this._statistics.insert(e,t),this._objectIds.add(e.getObjectId())}merge(e){if(e._count!==0){this._count+=e._count,this._firstFeatureAttributes=e._firstFeatureAttributes,this._xWorldTotal+=e._xWorldTotal,this._yWorldTotal+=e._yWorldTotal,this._statistics.merge(e._statistics);for(const t of e._objectIds.values())this._objectIds.add(t)}}getCentroidX(e){return e==null?this.centroidXWorld:Cr(e,this.centroidXWorld)}getCentroidY(e){return e==null?this.centroidYWorld:Tr(e,this.centroidYWorld)}getGeometry(e,t){const r=this.gridX*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell,n=new M([4],[r,i,r+this._worldUnitsPerCell,i,r+this._worldUnitsPerCell,i+this._worldUnitsPerCell,r,i+this._worldUnitsPerCell]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPolygon",t)}return n}getCentroid(e){const t=new M([],[this.centroidXWorld,this.centroidYWorld]);if(e!=null){const r=new M;return Q(r,t,!1,!1,"esriGeometryPoint",e)}return t}getGeometricCentroid(e,t){const r=this.gridX*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,i=this.gridY*this._worldUnitsPerCell+.5*this._worldUnitsPerCell,n=new M([],[r,i]);if(t!=null){const a=new M;return Q(a,n,!1,!1,"esriGeometryPoint",t)}return n}getAttributes(){const e={aggregateId:this.id};for(const t of this._statistics.values())e[t.field.name]=t.value;return this._firstFeatureAttributes!=null?{...e,...this._firstFeatureAttributes}:e}};const _i=96;function Ze(s,e){return rr(s)*ir*_i/e}let pi=class extends Ms{constructor(s){super(s),this._cells=new Map,this._pixelsPerMapUnit=Ze(s.spatialReference,s.scale)}put(s){for(const e of this._cells.values()){const t=s.get(e.id);t?t.merge(e):s.set(e.id,e.clone())}}putBounded(s,e,t){const r=[e.xmin,e.ymin,e.xmax,e.ymax],[i,n,a,o]=r,d=Math.floor(i*this._pixelsPerMapUnit/this._options.cellSize),u=Math.floor(n*this._pixelsPerMapUnit/this._options.cellSize),h=Math.ceil(a*this._pixelsPerMapUnit/this._options.cellSize),l=Math.ceil(o*this._pixelsPerMapUnit/this._options.cellSize);for(let p=u;p<=l;p++)for(let g=d;g<=h;g++){const _=`${g}.${p}`,f=this._cells.get(_);if(!f)continue;const y=s.get(f.id);y?f&&!s.has(f.id)&&y.merge(f):s.set(f.id,f.clone())}}_insert(s,e,t,r){const i=e*this._pixelsPerMapUnit,n=t*this._pixelsPerMapUnit,a=Math.floor(i/this._options.cellSize),o=Math.floor(n/this._options.cellSize);this._getCellOrCreate(a,o).insert(s,r,e,t)}_getCellOrCreate(s,e){const t=Qe.createId(s,e);let r=this._cells.get(t);if(!r){const i=1*this._options.cellSize/this._pixelsPerMapUnit;r=Qe.create(s,e,this._options.fields,i),this._cells.set(t,r)}return r}},gi=class He extends Fe{static from(e,t){return new He(e.copy(),t)}constructor(e,t){super(e.metadata),this._currentIndex=-1,this._displayTranslationX=0,this._displayTranslationY=0,this._displayScaleX=1,this._displayScaleY=1,this._reader=e,this._indices=t,this._isPoint=e.geometryType==="esriGeometryPoint"}setTransformForDisplay(e){const t=this._reader.getInTransform();if(t==null){const[l,p]=e.scale,[g,_]=e.translate;return this._displayTranslationX=-g/l,this._displayScaleX=1/l,this._displayTranslationY=_/p,this._displayScaleY=1/-p,void(this._displayTransform=e)}const[r,i]=t.scale,[n,a]=t.translate,[o,d]=e.scale,[u,h]=e.translate;if(this._displayScaleX=r/o,this._displayTranslationX=(n-u)/o,this._displayScaleY=i/d,this._displayTranslationY=(-a+h)/d,!this._isPoint&&t)throw new Error("InternalError: Relative transformations not supported for non-point features");this._displayTransform=e}getInTransform(){return this._reader.getInTransform()}get fields(){return this._reader.fields}get hasNext(){return this._currentIndex+1!(r.objectId!=null&&t.has(r.objectId)))}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new z(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndex!t.has(r.objectId))}getTileReader(s){if(!this._features.length)return null;const e=this.queryFeaturesInBounds(s.bounds);return e.setTransformForDisplay(s.transform),e}_onChange(){this.invalidate()}},fi=class extends ht{constructor(s,e){super(s),this.bins=new Map,this.featureCache=new Map,this.done=!1,this._store=e}reset(){this.destroy(),this.done=!1}invaldateForLocalEditDropped(){this.handledChunks.clear(),this.bins.clear()}destroy(){const s=this.subscription.tile.key.level;for(const e of this.featureCache.keys())this._store.releaseDisplayIdForObjectId(`${e}.${s}`);this.bins.clear(),this.featureCache.clear(),this.handledChunks.clear()}get tile(){return this.subscription.tile}*featuresWorldSpace(){for(const s of this.featureCache.values()){const e=s.clone();e.geometry&&kr(e.geometry,e.geometry,!1,!1,this.subscription.tile.transform),yield e}}},yi=class Es extends bs{static async create(e,t,r,i,n){const a=new at({spatialReference:t}),o=await Promise.all(e.fields.map(async u=>ys.create(a,u))),d=e.featureFilter?await es.create({geometryType:r.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:r.metadata.timeInfo,fieldsIndex:r.metadata.fieldsIndex,spatialReference:t,filterJSON:e.featureFilter}):null;return e.index.type==="geohash"&&await Er(t,P.WGS84),new Es(e,d,n,o,t,r,i)}constructor(e,t,r,i,n,a,o){super(a,o,n,i),this._schema=e,this._featureFilter=t,this._timeZone=r,this._metadata=ot.createFeature({geometryType:"esriGeometryPolygon",objectIdField:"aggregateId",fieldsIndex:new de(e.fields).toJSON(),globalIdField:null,spatialReference:a.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}createState(e){return new fi(e,this._attributeStore)}async*applyLocalEdit(e){for(const t of this._sendStates.values())t.reset(),yield new _t(t.subscription,q.empty(this._source.metadata),!0,!1,{})}displayMap(e,t,r){const i=new Map(e.map(a=>[t(a),a])),n=[];for(const a of this._sendStates.values())for(const o of a.featuresWorldSpace()){const{objectId:d,displayId:u}=o,h=i.get(d);if(h!=null){const l=r(u,h,d);n.push(l),i.delete(d)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[];for(const n of this._sendStates.values())for(const a of n.featuresWorldSpace())t.has(a.displayId)&&!r.has(a.objectId)&&(a.geometry&&i.push({...rs(a,this._metadata.geometryType,!1,!1),displayId:a.displayId}),r.add(a.objectId));return{features:[],aggregates:i}}getFeatureObjectIdsForAggregate(e){for(const t of this._sendStates.values())for(const r of t.bins.values())if(r.id===e)return Array.from(r.containedObjectIds);return[]}beforeUpdateChunks(){const e=this._source.chunks();if(!e.length)return;let t=!1;for(const r of e)qs(r)&&r.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this._lastHandledLocalEdit=r.lastLocalEditDropped,t=!0);if(t)for(const r of this._sendStates.values())r.invaldateForLocalEditDropped()}async*updateChunks(){for(const e of this._sendStates.values())yield*this._update(e,this._source)}forEachAggregateWorldSpace(e){const t=new Set;for(const r of this._sendStates.values())for(const i of r.featuresWorldSpace())t.has(i.objectId)||(e(i),t.add(i.objectId))}_createIndexOptions(e){switch(this._schema.index.type){case"geohash":return{type:"geohash",fields:this.aggregateFields,featureFilter:this._featureFilter,geohashLevel:this._schema.index.fixBinLevel,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:e.scale};case"grid":{const t=this._schema.index.fixedBinLevel,r=t!=null?e.tileInfoView.getLODInfoAt(t).scale:e.scale;return{type:"grid",fields:this.aggregateFields,cellSize:this._schema.index.size,featureFilter:this._featureFilter,spatialReference:this.spatialReference,timeZone:this._timeZone,scale:r}}}}async*_update(e,t){const{handledChunks:r,subscription:i,bins:n,featureCache:a}=e,o=i.tile;if(e.done)return;for(const _ of t.chunks()){if(r.has(_.chunkId))continue;r.add(_.chunkId);const f=_.queryInfo;if("tileId"in f){const y=new nt(f.tileId);if(y.level!==o.level||y.world!==o.key.world)continue}_.getAggregateIndex(this._createIndexOptions(e.tile)).putBounded(n,e.tile.extent,e.tile.resolution)}const d=[],u=i.tile.transform,h=i.tile.key.level;for(const _ of n.values()){let f=a.get(_.id);if(f)f.attributes=_.getAttributes();else{const y=_.getGeometry(this.spatialReference,u);f=new Y(y,_.getAttributes(),null),y||(f.centroid=_.getGeometricCentroid(this.spatialReference,u)),f.objectId=_.id,f.displayId=this._attributeStore.createDisplayIdForObjectId(`${f.objectId}.${h}`),a.set(_.id,f)}d.push(f)}this.events.emit("changed"),e.done=!t.updateTracking.updating;const l=q.fromOptimizedFeatures(d,this._metadata,u),p=l.getCursor(),g=e.subscription.tile.createArcadeEvaluationOptions(this._timeZone);for(;p.next();)this._attributeStore.setAttributeData(p.getDisplayId(),p,g);yield new Be(e.subscription,l,[],e.done,{})}},mi=class{constructor(s,e){this.inner=s,this.displayId=e}};const _e=128;let bi=class extends ht{constructor(s){super(s),this.didSend=!1,this.done=!1}},wi=class{constructor(s,e,t,r,i){this._level=s,this._scale=e,this._indexOptions=t,this._clusterRadius=r,this._store=i,this._cells=new Map,this._handledChunks=new Set,this._statistics=new Map,this._clusters=new Map}destroy(){this._clearClusters()}_clearClusters(){for(const s of this._clusters.values())this._store.releaseDisplayIdForObjectId(s.inner.id);this._clusters.clear()}*aggregatesWorldSpace(){for(const s of this._clusters.values()){const e=s.inner.getCentroid(null),t=new Y(e,s.inner.getAttributes(),null);t.objectId=s.inner.id,t.displayId=s.displayId,yield t}}clusters(){return this._clusters.values()}updateChunks(s,e){let t=!1;for(const a of s){const o=a.queryInfo;"tileId"in o&&new nt(o.tileId).level!==this._level||this._handledChunks.has(a.normalizedChunkId)||(this._handledChunks.add(a.normalizedChunkId),t=!0,a.getAggregateIndex({...this._indexOptions,scale:this._scale}).put(this._cells))}const r={xMin:1/0,yMin:1/0,xMax:-1/0,yMax:-1/0},i=Ze(this._indexOptions.spatialReference,this._scale),n=this._indexOptions.cellSize;for(const{subscription:a}of e){const o=a.tile.bounds,d=Math.floor(o[0]*i/n),u=Math.floor(o[1]*i/n),h=Math.ceil(o[2]*i/n),l=Math.ceil(o[3]*i/n);r.xMin=Math.min(r.xMin,d),r.yMin=Math.min(r.yMin,u),r.xMax=Math.max(r.xMax,h),r.yMax=Math.max(r.yMax,l)}return this._lastCellBounds!=null&&r.xMin===this._lastCellBounds.xMin&&r.yMin===this._lastCellBounds.yMin&&r.yMin===this._lastCellBounds.yMin&&r.yMax===this._lastCellBounds.yMax||(t=!0,this._lastCellBounds=r),t&&this._clusterCells(r),t}async updateStatistics(s){let e=!1;for(const t of this._clusters.values())t.inner.count>1&&(e=this._updateAggregateStatistics(this._statistics,t.inner)||e);if(e){const t=Array.from(this._statistics.entries()).map(([r,i])=>({fieldName:r,minValue:i.minValue,maxValue:i.maxValue}));await s.container.updateStatistics(this._level,t)}}createAggregateFeatures(s,e){const t=s.subscription,r=[],i=t.tile.transform;for(const n of this._clusters.values()){let a=n.inner.getCentroidX(i);const o=n.inner.getCentroidY(i),d=t.tile.lod,u=d.wrap?d.worldSize[0]:null,h=n.inner.count===1?n.inner.firstObjectId:n.inner.id,l=n.displayId;if(u!=null)if(u===1){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.geometry.coords[0]-=T,g.objectId=h,g.displayId=l,r.push(g);const _=new M([],[a,o]),f=new Y(_,n.inner.getAttributes(),null);f.geometry.coords[0]+=T,f.objectId=h,f.displayId=l,r.push(f)}else a>T+T/2?a-=u*T:a<-T/2&&(a+=u*T);if(a=-_e&&o=-_e){const p=new M([],[a,o]),g=new Y(p,n.inner.getAttributes(),null);g.objectId=h,g.displayId=l,r.push(g)}}return q.fromOptimizedFeatures(r,e,t.tile.transform)}_clusterCells(s){let e=Array.from(this._cells.values());e=e.sort((a,o)=>o.count-a.count);const t=[];for(const a of this._clusters.values())t.push(a.inner.id);this._clusters.clear();const r=this._clusterRadius*(1/Ze(this._indexOptions.spatialReference,this._scale)),i=1+this._clusterRadius/this._indexOptions.cellSize,n=new Set;for(const a of e){if(n.has(a.id)||a.gridXs.xMax||a.gridYs.yMax)continue;const o=this._store.createDisplayIdForObjectId(a.id),d=new mi(a.clone(),o);n.add(a.id),this._clusters.set(a.id,d);const u=a.centroidXWorld,h=a.centroidYWorld;for(let l=a.gridY-i;l<=a.gridY+i;l++)for(let p=a.gridX-i;p<=a.gridX+i;p++){if(l===a.gridY&&p===a.gridX)continue;const g=this._cells.get(Qe.createId(p,l));if(!g||n.has(g.id))continue;const _=Math.abs(g.centroidXWorld-u),f=Math.abs(g.centroidYWorld-h);_ys.create(o,u))),spatialReference:r,featureFilter:t.featureFilter?await es.create({geometryType:i.metadata.geometryType,hasM:!1,hasZ:!1,timeInfo:i.metadata.timeInfo,fieldsIndex:i.metadata.fieldsIndex,spatialReference:r,filterJSON:t.featureFilter}):null,cellSize:t.clusterRadius/4,timeZone:a};return new Os(e,t.clusterRadius,d,t.fields,i,n)}constructor(e,t,r,i,n,a){super(n,a,r.spatialReference,r.fields),this._connection=e,this._clusterRadius=t,this._indexOptions=r,this._cellsPerScale=new Map,this._metadata=ot.createFeature({geometryType:"esriGeometryPoint",objectIdField:"aggregateId",fieldsIndex:new de([...i,...this._source.metadata.fieldsIndex.fields,{name:"aggregateId",alias:"aggregateId",type:"esriFieldTypeOID"}]).toJSON(),globalIdField:null,spatialReference:n.metadata.spatialReference,subtypeField:null,subtypes:null,timeInfo:null,timeReferenceUnknownClient:null,typeIdField:null,types:null})}get enablePixelBuffering(){return!1}invalidate(){super.invalidate();for(const e of this._cellsPerScale.values())e.destroy();this._cellsPerScale.clear()}onSubscribe(e){super.onSubscribe(e),this._requiredLevel=e.tile.level,this._requiredScale=e.tile.scale}createState(e){return new bi(e)}async*applyLocalEdit(e){for(const t of this._cellsPerScale.values())t.destroy();this._cellsPerScale.clear();for(const t of this._sendStates.values())t.done=!1}displayMap(e,t,r){const i=new Map(e.map(o=>[t(o),o])),n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.clusters()){const d=i.get(o.inner.id);if(d==null){if(o.inner.count===1){const u=i.get(o.inner.firstObjectId);if(u!=null){const h=r(o.displayId,u,o.inner.firstObjectId);n.push(h),i.delete(o.inner.firstObjectId)}}}else{const u=r(o.displayId,d,o.inner.id);n.push(u),i.delete(o.inner.id)}}return n}getDisplayFeatures(e){const t=new Set(e),r=new Set,i=[],n=[],a=this._getClusterState(this._requiredLevel,this._requiredScale);for(const o of a.aggregatesWorldSpace())if(t.has(o.displayId)&&!r.has(o.displayId)){const d=rs(o,this._metadata.geometryType,!1,!1);if(r.add(o.displayId),d.attributes.cluster_count===1){i.push({...d,displayId:o.displayId});continue}n.push({...d,displayId:o.displayId})}return{features:i,aggregates:n}}getFeatureObjectIdsForAggregate(e){const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.clusters())if(r.inner.id===e)return Array.from(r.inner.containedObjectIds);return[]}async*updateChunks(){const e=this._source.chunks();if(!e.length)return;for(const a of e)qs(a)&&a.lastLocalEditDropped!==this._lastHandledLocalEdit&&(this.invalidate(),this._lastHandledLocalEdit=a.lastLocalEditDropped);const t=this._getClusterState(this._requiredLevel,this._requiredScale),r=Array.from(this._sendStates.values()).filter(a=>a.subscription.tile.level===this._requiredLevel);if(t.updateChunks(e,r)||!this._source.updateTracking.updating)for(const a of r)a.subscription.tile.level===this._requiredLevel&&(a.didSend=!1,a.done=!1);const i=Array.from(this._sendStates.values()).filter(a=>a.done).map(a=>a.subscription.tile.key),n=new Set(i);for(const a of this._sendStates.values())this._source.updateTracking.updating&&(i.some(o=>o.containsChild(a.subscription.tile.key))||a.subscription.tile.key.getChildKeys().every(o=>n.has(o)))||a.didSend||a.subscription.tile.level!==this._requiredLevel||(a.didSend=!0,yield*this._update(a,t,this._source));await t.updateStatistics(this._connection)}forEachAggregateWorldSpace(e){if(this._requiredLevel==null||this._requiredScale==null)return;const t=this._getClusterState(this._requiredLevel,this._requiredScale);for(const r of t.aggregatesWorldSpace())e(r)}_getClusterState(e,t){if(e==null||t==null)throw new Error("InternalError: Level and scale must be defined");let r=this._cellsPerScale.get(t);return r||(r=new wi(e,t,this._indexOptions,this._clusterRadius,this._attributeStore),this._cellsPerScale.set(t,r)),r}async*_update(e,t,r){if(e.done)return;const i=t.createAggregateFeatures(e,this._metadata);this.events.emit("changed"),e.done=!r.updateTracking.updating;const n=i.getCursor(),a=e.subscription.tile.createArcadeEvaluationOptions(this._indexOptions.timeZone);for(;n.next();)this._attributeStore.setAttributeData(n.getDisplayId(),n,a);yield new _t(e.subscription,i,!0,e.done,{})}},vi=class extends ht{},xi=class extends ms{constructor(s,e,t){super(s,e),this._timeZone=t,this.handledChunks=new Set,this.handledChunksForIdCreation=new Set,this.handledChunksForAttributeData=new Set,this._streamLayerDeferredObjectIdsToRemove=[]}destroy(){super.destroy();for(const s of this._source.chunks())this._cleanupChunkIds(s)}invalidateAttributeData(){this.handledChunksForAttributeData.clear()}onSubscribe(s){super.onSubscribe(s),this._evalOptions=s.tile.createArcadeEvaluationOptions(this._timeZone)}createState(s){return new vi(s)}get aggregateQueryEngine(){return null}displayMap(s,e,t){const r=new Map(s.map(n=>[e(n),n])),i=[];for(const n of this._source.chunks()){const a=n.reader.getCursor();for(;a.next();){const o=a.getObjectId(),d=a.getDisplayId(),u=r.get(o);if(u!=null){const h=t(d,u,o);i.push(h),r.delete(o)}}}return i}getDisplayFeatures(s){const e=new Set(s),t=new Set,r=[];for(const i of this._source.chunks()){const n=i.reader.getCursor();for(;n.next();){const a=n.getObjectId(),o=n.getDisplayId();e.has(o)&&!t.has(a)&&(r.push({...n.readLegacyFeatureWorldSpace(),displayId:o}),t.add(a))}}return{features:r,aggregates:[]}}async*applyLocalEdit(s){const e=[],t=s.reader.getCursor();for(;t.next();){const n=t.getObjectId(),a=this._attributeStore.createDisplayIdForObjectId(n);t.setDisplayId(a),this._attributeStore.setAttributeData(a,t,this._evalOptions),e.push(a)}const r=[];for(const n of s.removed){const a=this._attributeStore.getDisplayIdForObjectId(n);a!=null&&r.push(a)}w("esri-2d-update-debug")&&console.debug("FeatureUpdateStrategy.applyLocalEdit",{message:s,modifiedDisplayIds:e,removedDisplayIds:r});const i=new Je(this._source.metadata,"localEdit");i.applyOverrides(s),this.handledChunks.add(i.chunkId),this.handledChunksForAttributeData.add(i.chunkId),this.handledChunksForIdCreation.add(i.chunkId);for(const n of this._sendStates.values())n.handledChunks.add(i.chunkId),yield new Be(n.subscription,null,e,!1,i.queryInfo);for(const n of this._sendStates.values()){const a=i.getTileReader(n.subscription.tile);yield new Be(n.subscription,a,r,!1,i.queryInfo)}for(const n of s.removed)this._attributeStore.releaseDisplayIdForObjectId(n)}async*updateChunks(){if(this._source.chunks().length){await this._updateAttributeData();for(const s of this._sendStates.values())yield*this._update(s)}}removeChunks(s){for(const e of s)this.handledChunks.delete(e.chunkId),this.handledChunksForAttributeData.delete(e.chunkId),this._cleanupChunkIds(e)}afterUpdateChunks(){for(const s of this._streamLayerDeferredObjectIdsToRemove)this._attributeStore.releaseDisplayIdForObjectId(s);this._streamLayerDeferredObjectIdsToRemove=[]}_cleanupChunkIds(s){if(this.handledChunksForIdCreation.has(s.chunkId)){const e=s.reader.getCursor();for(;e.next();){const t=e.getObjectId();this._source.isStream?this._streamLayerDeferredObjectIdsToRemove.push(t):this._attributeStore.releaseDisplayIdForObjectId(t)}this.handledChunksForIdCreation.delete(s.chunkId)}}async _updateAttributeData(){for(const s of this._source.chunks()){const{chunkId:e,reader:t}=s;if(!this.handledChunksForIdCreation.has(e)){this.handledChunksForIdCreation.add(e);const r=t.getCursor();for(;r.next();){const i=this._attributeStore.createDisplayIdForObjectId(r.getObjectId());r.setDisplayId(i)}}}for(const s of this._source.chunks())if(!this.handledChunksForAttributeData.has(s.chunkId)){this.handledChunksForAttributeData.add(s.chunkId);const e=s.reader.getCursor();for(;e.next();){const t=e.getDisplayId();this._attributeStore.setAttributeData(t,e,this._evalOptions)}}}*_update(s){const{subscription:e,handledChunks:t}=s;for(const r of this._source.chunks()){const{chunkId:i}=r;if(t.has(i))continue;t.add(i);const n=r.getTileReader(e.tile);n&&(yield new _t(s.subscription,n,!1,r.end,r.queryInfo))}}},Si=class{constructor(s,e){this._connection=s,this._source=e,this._version=1,this._registry=new Ir,this._proxy=new fr({fetch:(t,r)=>this._connection.layerView.fetch(t,r),fetchDictionary:(t,r)=>this._connection.layerView.fetchDictionary(t,r)}),this._attributeStore=new yr({isLocal:!1,update:t=>it(this._connection.container.updateAttributeView(t))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}getDisplayFeatures(s){return this._strategy?this._strategy.getDisplayFeatures(s):{features:[],aggregates:[]}}getDisplayIds(s){const e={};return this._strategy&&this._strategy.displayMap(s,t=>t,(t,r,i)=>{e[i]=t}),e}getFeatureObjectIdsForAggregate(s){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(s):[]}onSubscribe(s){this._strategy?.onSubscribe(s)}onUnsubscribe(s){this._strategy?.onUnsubscribe(s)}async update(s,e,t,r,i){const n=s.processor,a=le(this._schema?.storage,n.storage),o=le(this._schema?.mesh.properties,n.mesh.properties),d=le(this._schema?.mesh.factory,n.mesh.factory),u=le(this._schema?.mesh.strategy,n.mesh.strategy),h=o||d||u;if(!(a||h)&&!r)return;w("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:Kt(this._schema,n),schema:n}),this._schema=n;const l=P.fromJSON(this._source.service.outSpatialReference),p=new at({fields:this._source.metadata.fieldsIndex,spatialReference:l});if(await this._attributeStore.update(n.storage,p,this._source.metadata,l,e),this._strategy?.invalidateAttributeData(),!r&&!h)return;(u||o)&&await this._updateStrategy(n.mesh.strategy,l,i,n.mesh.properties.timeZone),this._updateSortKey(p,"sortKey"in n.mesh.properties?n.mesh.properties.sortKey:null);const g=new Jr(p,this._proxy,t,this._registry);return(d||n.mesh.factory.symbology.type==="dictionary")&&(this._factory=await Hr.create(g,n.mesh.factory)),this._invalidate(),this._version=e,this._connection.container.updateRenderState(this._version)}async applyLocalEdit(s){if(!this._strategy)return;const e=this._strategy.applyLocalEdit(s);for await(const t of e)try{await this._process(t)}catch{}}async updateChunks(){this._strategy?.beforeUpdateChunks(),await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(s){this._strategy?.removeChunks(s),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:s}){if(!this._strategy)return void this._attributeStore.setHighlight(s.map(({objectId:t,highlightFlags:r})=>({objectId:t,highlightFlags:r,displayId:-1})),s);const e=this._strategy.displayMap(s,({objectId:t})=>t,(t,{highlightFlags:r},i)=>({objectId:i,displayId:t,highlightFlags:r}));this._attributeStore.setHighlight(e,s)}async _doUpdateChunks(){if(!this._strategy)return;const s=this._strategy.updateChunks(),e=[],t=new Map;for await(const r of s){let i=t.get(r.id);i==null&&(i=new Kr({concurrency:16,process:a=>this._process(a)}),t.set(r.id,i));const n=i.push(r).catch(a=>et(a));e.push(n)}try{await Promise.all(e)}catch{}w("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(s,e,t,r){switch(this._strategy?.destroy(),s.type){case"feature":this._strategy=new xi(this._source,this._attributeStore,r);break;case"binning":this._strategy=await yi.create(s,e,this._source,this._attributeStore,r);break;case"cluster":this._strategy=await Ii.create(this._connection,s,e,this._source,this._attributeStore,r)}for(const i of t)this._strategy.onSubscribe(i)}async _updateSortKey(s,e){if(this._sortInfo=Zt(this._sortInfo?.computed),e!=null){const t=e.byRenderer?null:await s.createComputedField(e);this._sortInfo={...e,computed:t}}}_invalidate(){this._strategy&&this._strategy.invalidate()}async _process(s){const e=s.subscription;if(w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process`)}await this._fetchResources(s),Z(e.signal);const t=await this._write(s,e.tile.createArcadeEvaluationOptions(this._schema?.mesh.properties.timeZone)),r=e.tile.tileInfoView.getLODInfoAt(e.tile.key),{message:i,transferList:n}=t.serialize(r),a={objectIdMap:null,inner:s.createMessage(i,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){a.objectIdMap={};const o=s.reader?.getCursor();if(o)for(;o.next();)a.objectIdMap[o.getDisplayId()]=o.getObjectId()}if(Z(e.signal),await this._connection.container.onMessage(a,{signal:e.signal,transferList:n}),this._attributeStore.sendUpdates(),w("esri-2d-update-debug")){const o=e.tile;console.debug(`Version[${this._version}] Tile[${o.key.id}, end=${s.end}] Processor._process.await`)}}async _fetchResources(s){await this._fetchMatcherResources(s),await this._fetchWriterResources(s)}async _fetchMatcherResources(s){if(s.reader)return this._factory.enqueueMatcherRequests(this._proxy,s.reader)}async _fetchWriterResources(s){if(!s.reader)return;const e=s.reader.getCursor(),t=s.subscription.tile.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;e.next();)this._factory.enqueueWriterRequests(this._proxy,e,t);await this._proxy.fetchEnqueuedResources()}async _write(s,e){const t=s.subscription.tile,r=s.reader?.getCursor(),i=r?.getSize()??0,n=t.tileInfoView.tileInfo.isWrappable,a=t.tileInfoView.tileInfo.spatialReference.isWGS84,o=new Nr(t.key,this._strategy.enablePixelBuffering,n,a,i);if(!r)return o;const d=t.createArcadeEvaluationOptions(this._schema.mesh.properties.timeZone);for(;r.next();){const u=this._getSortKeyValue(r,e);o.entityStart(r.getDisplayId(),u),this._factory.write(o,this._proxy,r,d,t.level),o.entityEnd()}return o}_getSortKeyValue(s,e){if(!this._sortInfo)return 0;const{computed:t,order:r,byRenderer:i}=this._sortInfo,n=i?this._factory.getSortKey(s,e):t?.read(s,e);return n==null||isNaN(n)?0:n*(r==="asc"?-1:1)}},Fi=class Rs{static from(e){let t=0,r=0,i=0;return e.forEach(n=>{const a=n._readGeometry();a&&(r+=a.isPoint?1:a.lengths.reduce((o,d)=>o+d,0),i+=a.isPoint?1:a.lengths.length,t+=1)}),new Rs(t,r,i)}constructor(e,t,r){this.featureCount=e,this.vertexCount=t,this.ringCount=r}toJSON(){return{featureCount:this.featureCount,ringCount:this.featureCount,vertexCount:this.featureCount}}};const Le=4;function ki(s,e,t){const r=s.orderByFields??t.objectIdField+" ASC",i=s.source,n={returnCentroid:!(i!==null&&typeof i=="object"&&"path"in i&&Pr(i.path))&&t.serviceGeometryType==="esriGeometryPolygon",returnGeometry:!0,timeReferenceUnknownClient:t.timeReferenceUnknownClient??void 0,outSpatialReference:P.fromJSON(s.outSpatialReference),orderByFields:s.type==="memory"?[]:[r],where:e.mutable.dataFilter.definitionExpression??"1=1",outFields:e.mutable.availableFields,multipatchOption:t.serviceGeometryType==="esriGeometryMultiPatch"?"xyFootprint":null};if(e.type==="feature"){const{gdbVersion:a,historicMoment:o,timeExtent:d}=e.mutable.dataFilter;return{...n,gdbVersion:a,historicMoment:o?new Date(o):null,timeExtent:d?jr.fromJSON(d):null,outFields:e.mutable.availableFields}}return n}let Ci=class As{static fromSchema(e,t,r){const i=t.type==="feature"?t.mutable.dataFilter.queryScaleRanges:[];return new As(ki(e,t,r),i,r.subtypeField,t.mutable.dataFilter.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,i,n,a){this._queryParams=e,this._queryScaleRanges=t,this._subtypeField=r,this._customParameters=i,this._geometryType=n,this._queryMetadata=a}get pageSize(){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?Le:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t){if(!t.getSize())return null;const r=e.clone();if(this._queryParams.outFields[0]==="*"){if((r.outFields??[])[0]==="*")return null;r.outFields=this._queryParams.outFields}else{const i=new Set(this._queryParams.outFields),n=[];for(const a of i)t.hasField(a)||n.push(a);if(n.length===0)return null;r.outFields=n}return r.returnGeometry=!1,r.returnCentroid=!1,r.quantizationParameters=null,r.cacheHint=!0,{inner:r,customParameters:this._customParameters}}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new os({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(e,t){if(this._queryMetadata==null)throw new Error("InternalError: Service does not support tile queries");const r=this.createQuery(t),i=r.inner;if(this._queryScaleRanges.length){const n=this._queryScaleRanges.filter(a=>(!a.minScale||a.minScale>=e.maxScale)&&(!a.maxScale||a.maxScale<=e.minScale)).map(a=>a.subtypeCode);if(n.length){const a=`${this._subtypeField} IN (${n})`;i.where=Js(i.where,a)}}if(i.quantizationParameters=t.quantizationParameters??e.getQuantizationParameters(),i.resultType="tile",i.geometry=e.extent,this._queryMetadata.supportsQuantization?this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset=e.resolution*w("feature-polyline-generalization-factor")):this._geometryType!=="esriGeometryPolyline"&&this._geometryType!=="esriGeometryPolygon"||(i.maxAllowableOffset=e.resolution,this._geometryType==="esriGeometryPolyline"&&(i.maxAllowableOffset*=w("feature-polyline-generalization-factor"))),i.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,i.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(i.maxRecordCountFactor=Le),w("esri-tiles-debug")){const n=e.id.replaceAll("/",".");r.customParameters=r.customParameters?{...r.customParameters,tileId:n}:{tileId:n}}return r}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e){const t=this.pageSize;return this.createQuery({start:t*e,num:t,returnExceededLimitFeatures:!0,maxRecordCountFactor:Le})}};const Ti=2500;let ye=class extends Ht{constructor(s){super(),this._connection=s,this._enabledEventTypes=new Set,this._updateInfo={websocket:0,client:0},this._lastTime=performance.now(),this._queuedCommands=[],this.addHandles([Ne(()=>this._strategy?.connectionStatus??"disconnected",e=>{this._layerView.setProperty({propertyName:"pipelineConnectionStatus",value:e})},{initial:!0}),Ne(()=>this._strategy?.errorString||null,e=>this._layerView.setProperty({propertyName:"pipelineErrorString",value:e}),{initial:!0})])}destroy(){this._strategy=null,this.removeAllHandles()}get _layerView(){return this._connection.layerView}set strategy(s){this._strategy==null&&this._resetUpdateInfo(performance.now());const e="event-handles";this.removeHandles(e),s!=null&&(this.addHandles([s.events.on("data-received",t=>this._onFeature(t)),s.events.on("message-received",t=>this._onWebSocketMessage(t)),s.events.on("features-updated",t=>this._onUpdate(t)),s.events.on("tick",()=>this._onTick())],e),this._queuedCommands.forEach(t=>t(s)),this._queuedCommands=[]),this._strategy=s}updateCustomParameters(s){s!=null&&this._callOrEnqueue(e=>e.updateCustomParameters(s))}sendMessageToSocket(s){this._callOrEnqueue(e=>e.sendMessageToSocket(s))}sendMessageToClient(s){this._callOrEnqueue(e=>e.sendMessageToClient(s))}enableEvent(s,e){e?this._enabledEventTypes.add(s):this._enabledEventTypes.delete(s)}disconnect(){this._strategy?.disconnect()}connect(){this._strategy?.connect()}clear(){this._strategy?.clear()}_onWebSocketMessage(s){this._enabledEventTypes.has("message-received")&&this._layerView.emitEvent({name:"message-received",event:s})}_onFeature(s){this._updateInfo.websocket++,this._enabledEventTypes.has("data-received")&&this._layerView.emitEvent({name:"data-received",event:{attributes:s.attributes,centroid:s.centroid,geometry:s.geometry}})}_onUpdate(s){this._updateInfo.client+=s}_onTick(){const s=performance.now(),e=s-this._lastTime;if(e>Ti){const t=Math.round(this._updateInfo.client/(e/1e3)),r=Math.round(this._updateInfo.websocket/(e/1e3));this._resetUpdateInfo(s),this._layerView.emitEvent({name:"update-rate",event:{client:t,websocket:r}})}}_resetUpdateInfo(s){this._lastTime=s,this._updateInfo.client=0,this._updateInfo.websocket=0}_callOrEnqueue(s){this._strategy!=null?s(this._strategy):this._queuedCommands.push(s)}};V([ge()],ye.prototype,"_strategy",void 0),ye=V([Xt("esri.views.2d.layers.features.sources.StreamMessenger")],ye);let pt=class{constructor(s){this._store=s,this._controller=new AbortController}destroy(){this._controller.abort()}get _options(){return{signal:this._controller.signal}}unsafeSetQueryHistoricMoment(s){throw new Error("InternalError: LoadStrategy does not support query info")}async queryOverride(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async queryByObjectId(s){throw new Error("InternalError: LoadStrategy does not support fetching")}async addParquetFile(s){throw new Error("InternalError: LoadStrategy does not support loading blobs")}};const ze=268435455;let Mi=class{constructor(){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}};function qi(s,e,t=!1){const r=s.asUnsafe(),i=r.pos(),n=new Mi;let a=0,o=0;const d=1,u=2,h=4,l=3;let p=null,g=null,_=null,f=!1;const y=[];for(;r.next();)switch(r.tag()){case 1:p=r.getString();break;case 3:g=r.getString();break;case 12:_=r.processMessage(zr);break;case 9:if(n.exceededTransferLimit=r.getBool(),n.exceededTransferLimit){n.offsets.geometry=t?new Float64Array(8e3):new Int32Array(8e3),n.centroid=t?new Float64Array(16e3):new Int32Array(16e3);for(let b=0;b0:!1}let ji=class Ke extends Fe{static fromBuffer(e,t,r=!1){const i=t.geometryType,n=Oi(e),a=qi(n,i==="esriGeometryPoint",r);return new Ke(n,a,t)}constructor(e,t,r){super(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._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){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="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new Ke(e,this._header,this.metadata);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._cache.centroid=void 0,this._cache.legacyFeature=void 0,this._cache.optFeature=void 0;++this._featureIndexu.length)for(let y=0;y=y?(h+=-.5*(R-C)*(N+x),b>1&&Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k):(u[d++]=S,u[d++]=k,b++),C=R,x=N):(E+=S,L+=k),S=E,k=L,v++}b<3||F?d-=2*b:(h+=-.5*(C+S-C)*(x+k+x),Ue(g,u[d-2],u[d-1],S,k)?(u[d-2]+=S,u[d-1]+=k,a.push(b)):(u[d++]=S,u[d++]=k,a.push(++b)))}else{let y=0,v=t.getSInt32(),b=t.getSInt32();this.hasZ&&t.getSInt32(),this.hasM&&t.getSInt32(),u[d++]=v,u[d++]=b,y+=1;for(let F=1;F2&&Ue(g,u[d-2],u[d-1],C,x)?(u[d-2]+=C,u[d-1]+=x):(u[d++]=C,u[d++]=x,y+=1),v=S,b=k}a.push(y)}break}default:t.skip()}return this._cache.area=h,a.length?new M(a,u):u!=null?this._createQuantizedExtrudedGeometry(u[0],u[1]):null}},qe=class{constructor(s,e){this.service=s,this._metadata=e}destroy(){}};function Di(s,e){switch(s.type){case"memory":return new zi(s,e);case"ogc":return new Gi(s,e);case"feature-service":return s.queryMetadata.supportsFormatPBF&&w("featurelayer-pbf")?new Ui(s,e):new Wi(s,e)}}async function Li(s){const e=new lr;return await e.open(s,{}),e}let zi=class extends qe{constructor(s,e){super(s,e),this._portsOpen=Li(s.source).then(t=>this.client=t)}destroy(){this.client.close(),this.client=null}async executeQuery(s,e){await this._portsOpen;const t=await this.client.invoke("queryFeatures",s.toJSON(),e);return q.fromFeatureSet(t,this._metadata)}},Ui=class extends qe{async executeQuery(s,e){const{data:t}=await Ar(this.service.source,s,e),r=!s.quantizationParameters;return ji.fromBuffer(t,this._metadata,r)}},Wi=class extends qe{async executeQuery(s,e){const{source:t,queryMetadata:r}=this.service;if(s.quantizationParameters!=null&&!r.supportsQuantization){const n=s.clone(),a=ds(n.quantizationParameters);n.quantizationParameters=null;const{data:o}=await It(t,n,this._metadata.spatialReference,e),d=ss(o,this._metadata.objectIdField);return is(a,d),q.fromOptimizedFeatureSet(d,this._metadata)}const{data:i}=await It(t,s,this._metadata.spatialReference,e);return this._metadata.geometryType==="esriGeometryPoint"&&(i.features=i.features?.filter(n=>{if(n.geometry!=null){const a=n.geometry;return Number.isFinite(a.x)&&Number.isFinite(a.y)}return!0})),q.fromFeatureSet(i,this._metadata)}},Gi=class extends qe{async executeQuery(s,e){if(s.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const r=s.clone(),i=ds(r.quantizationParameters);r.quantizationParameters=null;const n=await vt(this.service.source,s,e);return is(i,n),q.fromOptimizedFeatureSet(n,this._metadata)}const t=await vt(this.service.source,s,e);return q.fromOptimizedFeatureSet(t,this._metadata)}},Ps=class extends pt{constructor(s,e,t,r,i){super(t),this._serviceInfo=s,this._queryInfo=e,this._metadata=r,this._connection=i,this._queue=new ts({concurrency:16,process:async n=>{const a={signal:n.options?.signal,query:n.query.customParameters};return this._adapter.executeQuery(n.query.inner,a)}}),this._adapter=Di(s,r)}unsafeSetQueryHistoricMoment(s){this._queryInfo.updateHistoricMoment(s)}async updateFields(s){this._queryInfo.updateFields(s);const e=Array.from(this._store.chunks()).map(async r=>{const i=os.fromJSON(r.queryInfo.queryJSON);if(i)try{return await this._tryUpdateFields(r.reader,i),null}catch(n){return n}}),t=(await Promise.all(e)).filter(r=>r);if(t.length)throw new W("featurelayer-query","Encountered errors when downloading fields",{errors:t})}async queryByObjectId(s){if(s.length===0)return q.empty(this._metadata);const e=this._queryInfo.createQuery({objectIds:s});return this._fetch(e)}async _fetch(s,e){const t=await this._enqueue(s,e);return await this._tryUpdateFields(t,s.inner),t}async _tryUpdateFields(s,e){const t=this._queryInfo.createPatchFieldsQuery(e,s);if(!t)return;const r=await this._enqueue(t,this._options);s.joinAttributes(r)}async _enqueue(s,e){return this._connection.onEvent({type:"fetchStart"}),this._queue.push({query:s,options:e}).finally(()=>{this._connection.onEvent({type:"fetchEnd",done:this._queue.length===0})})}},js=class extends Ps{constructor(){super(...arguments),this._chunksById=new Map}unload(s){this._removeChunks(s.tile)}_addChunk(s){const e=s.tile.id;this._chunksById.has(e)||this._chunksById.set(e,[]);const t=s.size();(t||s.first||s.end)&&(w("esri-2d-update-debug")&&console.debug(`Chunk[${s.chunkId}] ATileLoadStrategy.addChunk [count=${t}]`),this._chunksById.get(e).push(s),this._store.insert(s))}_removeChunks(s){const e=this._chunksById.get(s.key.id)??[];for(const t of e)w("esri-2d-update-debug")&&console.debug(`Tile[${s.key.id}] Chunk[${t.chunkId}] ATileLoadStrategy.removeChunk`),this._store.remove(t);this._chunksById.delete(s.key.id)}},Pt=class extends ue{constructor(s,e,t,r,i,n){super(),this._reader=s,this._queryJSON=e,this._tile=t,this._sourceTile=r,this._sourceTileDepth=i,this._end=n,this.chunkId=`${this._tile.key.id}.${this._sourceTile?.key.id}${this._end?"e":""}`,this.normalizedChunkId=`${this._tile.key.normalizedId}.${this._sourceTile?.key.normalizedId}${this._end?"e":""}`}get queryInfo(){return{type:"drill-down-tile",chunkId:this.chunkId,tileId:this._tile.key.id,queryJSON:this._queryJSON,sourceTileDepth:this._sourceTileDepth,sourceTileId:this._sourceTile?.key.id,size:this.size(),end:this.end}}get first(){return this._sourceTileDepth===0}get reader(){return this._reader}get end(){return this._end}get tile(){return this._tile}get isTiled(){return!0}getTileReader(s){return this._tile.key.id===s.key.id?this.reader:null}},Ni=class{constructor(s,e){this.subscription=s,this._tileIdToResult=new Map,this._controller=new AbortController,this._handles=Se([we(s.signal,()=>this._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get(s){return this._tileIdToResult.get(s)}set(s,e){this._tileIdToResult.set(s,e)}get options(){return{signal:this._controller.signal}}},$i=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Ni(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{for await(const i of this._fetchChunkInfos(e,s.tile,0)){const{queryJSON:n,reader:a,sourceTile:o,sourceTileDepth:d,tile:u}=i,h=new Pt(a,n,u,o,d,!1);Z(e.options),this._addChunk(h)}}catch(i){t=i}const r=new Pt(q.empty(this._metadata),null,s.tile,null,-1,!0);if(this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async*_fetchChunkInfos(s,e,t){let r=s.get(e.id);const i=!!r;if(r||(r=await this._fetchChunkInfo(s,e,t),s.set(e.id,r)),r.reader.exceededTransferLimit&&tthis._controller.abort()),we(e,()=>this._controller.abort())])}destroy(){this._controller.abort(),this._handles.remove()}get pageStart(){let s=-1;for(const e of this._pages.values())s=Math.max(s,e);return s+1}get done(){return this._done}get options(){return{signal:this._controller.signal}}add(s,e){this._pages.add(s),this._done=this._done||e}},Vi=class extends js{constructor(){super(...arguments),this._loadStates=new Map}destroy(){super.destroy();for(const s of this._loadStates.values())s.destroy();this._loadStates.clear()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}async load(s){this._loadStates.has(s.key.id)||this._loadStates.set(s.key.id,new Bi(s,this._options));const e=this._loadStates.get(s.key.id);let t;try{await this._fetchPages(e)}catch(i){t=i}const r=new jt(q.empty(this._metadata),null,s.tile,-1,!0);if(Ks(e.options)||this._addChunk(r),t)throw t}unload(s){super.unload(s),this._loadStates.get(s.key.id)?.destroy(),this._loadStates.delete(s.key.id)}async _fetchPages(s){let e=0,t=s.pageStart,r=1;for(;e<20&&!s.done;){const i=[];for(let a=0;a{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&Ds.decode();let se=null;function me(){return se!==null&&se.byteLength!==0||(se=new Uint8Array(c.memory.buffer)),se}function X(s,e){return s>>>=0,Ds.decode(me().subarray(s,s+e))}const Dt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>{c.__wbindgen_export_0.get(s.dtor)(s.a,s.b)});function Xi(s,e,t,r){const i={a:s,b:e,cnt:1,dtor:t},n=(...a)=>{i.cnt++;const o=i.a;i.a=0;try{return r(o,i.b,...a)}finally{--i.cnt==0?(c.__wbindgen_export_0.get(i.dtor)(o,i.b),Dt.unregister(i)):i.a=o}};return n.original=i,Dt.register(n,i,i),n}function Qi(s,e,t){c._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h7be72b1871260ae2(s,e,m(t))}function Zi(){c.enableTracing()}let O=0;const be=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Hi=typeof be.encodeInto=="function"?function(s,e){return be.encodeInto(s,e)}:function(s,e){const t=be.encode(s);return e.set(t),{read:s.length,written:t.length}};function oe(s,e,t){if(t===void 0){const o=be.encode(s),d=e(o.length,1)>>>0;return me().subarray(d,d+o.length).set(o),O=o.length,d}let r=s.length,i=e(r,1)>>>0;const n=me();let a=0;for(;a127)break;n[i+a]=o}if(a!==r){a!==0&&(s=s.slice(a)),i=t(i,r,r=a+3*s.length,1)>>>0;const o=me().subarray(i+a,i+r);a+=Hi(s,o).written,i=t(i,r,a,1)>>>0}return O=a,i}let U=null;function H(){return(U===null||U.buffer.detached===!0||U.buffer.detached===void 0&&U.buffer!==c.memory.buffer)&&(U=new DataView(c.memory.buffer)),U}function j(s,e){try{return s.apply(this,e)}catch(t){c.__wbindgen_exn_store(m(t))}}function Ji(s,e,t,r){c.wasm_bindgen__convert__closures__invoke2_mut__h35729c14da098d24(s,e,m(t),m(r))}let re=null;function Ki(){return re!==null&&re.byteLength!==0||(re=new Uint16Array(c.memory.buffer)),re}function Lt(s,e){const t=e(2*s.length,2)>>>0;return Ki().set(s,t/2),O=s.length,t}function Ls(s,e,t){const r=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;return D(c.readMetadata(r,i,m(e),m(t)))}function zt(s,e){if(!(s instanceof e))throw new Error(`expected instance of ${e.name}`);return s.ptr}function en(s,e,t,r,i){const n=oe(s,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;zt(r,ee);var o=r.__destroy_into_raw();zt(i,J);var d=i.__destroy_into_raw();return D(c.readFile(n,a,m(e),m(t),o,d))}function We(s){return s==null}const Ut=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_fieldmetadata_free(s>>>0,1));class Ee{static __wrap(e){e>>>=0;const t=Object.create(Ee.prototype);return t.__wbg_ptr=e,Ut.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Ut.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_fieldmetadata_free(e,0)}get name(){let e,t;try{const n=c.__wbindgen_add_to_stack_pointer(-16);c.fieldmetadata_name(n,this.__wbg_ptr);var r=H().getInt32(n+0,!0),i=H().getInt32(n+4,!0);return e=r,t=i,X(r,i)}finally{c.__wbindgen_add_to_stack_pointer(16),c.__wbindgen_free(e,t,1)}}get index(){return c.fieldmetadata_index(this.__wbg_ptr)}get type(){return["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"][c.fieldmetadata_esri_type(this.__wbg_ptr)]}}const Wt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_filemetadata_free(s>>>0,1));class ee{static __wrap(e){e>>>=0;const t=Object.create(ee.prototype);return t.__wbg_ptr=e,Wt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Wt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_filemetadata_free(e,0)}version(){return c.filemetadata_version(this.__wbg_ptr)}numRows(){return c.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return c.filemetadata_numFields(this.__wbg_ptr)>>>0}keyValueMetadata(e){try{const i=c.__wbindgen_add_to_stack_pointer(-16),n=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),a=O;c.filemetadata_keyValueMetadata(i,this.__wbg_ptr,n,a);var t=H().getInt32(i+0,!0),r=H().getInt32(i+4,!0);let o;return t!==0&&(o=X(t,r).slice(),c.__wbindgen_free(t,1*r,1)),o}finally{c.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(e){const t=oe(e,c.__wbindgen_malloc,c.__wbindgen_realloc),r=O,i=c.filemetadata_getFieldIndex(this.__wbg_ptr,t,r);return i===16777215?void 0:i}getFieldByIndex(e){const t=c.filemetadata_getFieldByIndex(this.__wbg_ptr,e);return t===0?void 0:Ee.__wrap(t)}}const Gt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_geometryinfodescriptor_free(s>>>0,1));class J{static __wrap(e){e>>>=0;const t=Object.create(J.prototype);return t.__wbg_ptr=e,Gt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Gt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_geometryinfodescriptor_free(e,0)}get wkbIndex(){const e=c.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return e===16777215?void 0:e}set wkbIndex(e){c.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,We(e)?16777215:e)}get lngIndex(){const e=c.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return e===16777215?void 0:e}set lngIndex(e){c.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,We(e)?16777215:e)}get latIndex(){const e=c.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return e===16777215?void 0:e}set latIndex(e){c.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,We(e)?16777215:e)}static new(){const e=c.geometryinfodescriptor_new();return J.__wrap(e)}}const Nt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetchunk_free(s>>>0,1));class Oe{static __wrap(e){e>>>=0;const t=Object.create(Oe.prototype);return t.__wbg_ptr=e,Nt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Nt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetchunk_free(e,0)}size(){return c.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(e){return c.parquetchunk_hasField(this.__wbg_ptr,e)!==0}readX(e){return c.parquetchunk_readX(this.__wbg_ptr,e)}readY(e){return c.parquetchunk_readY(this.__wbg_ptr,e)}readAttributes(e){return D(c.parquetchunk_readAttributes(this.__wbg_ptr,e))}readAttribute(e,t){return D(c.parquetchunk_readAttribute(this.__wbg_ptr,e,t))}}const $t=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_parquetfile_free(s>>>0,1));let zs=class Us{static __wrap(e){e>>>=0;const t=Object.create(Us.prototype);return t.__wbg_ptr=e,$t.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,$t.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_parquetfile_free(e,0)}metadata(){const e=c.parquetfile_metadata(this.__wbg_ptr);return ee.__wrap(e)}readChunksWithCallback(e,t){const r=Lt(e,c.__wbindgen_malloc),i=O;return D(c.parquetfile_readChunksWithCallback(this.__wbg_ptr,r,i,m(t)))}updateChunks(e){const t=Lt(e,c.__wbindgen_malloc),r=O;return D(c.parquetfile_updateChunks(this.__wbg_ptr,t,r))}};const Bt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(s=>c.__wbg_rangeproviderjs_free(s>>>0,1));class ne{static __wrap(e){e>>>=0;const t=Object.create(ne.prototype);return t.__wbg_ptr=e,Bt.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Bt.unregister(this),e}free(){const e=this.__destroy_into_raw();c.__wbg_rangeproviderjs_free(e,0)}static new(e,t){const r=c.rangeproviderjs_new(m(e),m(t));return ne.__wrap(r)}static withFetch(){const e=c.rangeproviderjs_withFetch();return ne.__wrap(e)}}async function tn(s,e){if(typeof Response=="function"&&s instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(s,e)}catch(r){if(s.headers.get("Content-Type")=="application/wasm")throw r;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r)}const t=await s.arrayBuffer();return await WebAssembly.instantiate(t,e)}{const t=await WebAssembly.instantiate(s,e);return t instanceof WebAssembly.Instance?{instance:t,module:s}:t}}function Ws(){const s={wbg:{}};return s.wbg.__wbg_new_abda76e883ba8a5f=function(){return m(new Error)},s.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const r=oe(I(t).stack,c.__wbindgen_malloc,c.__wbindgen_realloc),i=O;H().setInt32(e+4,i,!0),H().setInt32(e+0,r,!0)},s.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let r,i;try{r=e,i=t,console.error(X(e,t))}finally{c.__wbindgen_free(r,i,1)}},s.wbg.__wbindgen_object_drop_ref=function(e){D(e)},s.wbg.__wbindgen_is_function=function(e){return typeof I(e)=="function"},s.wbg.__wbg_self_3093d5d1f7bcb682=function(){return j(function(){return m(self.self)},arguments)},s.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return j(function(){return m(window.window)},arguments)},s.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return j(function(){return m(globalThis.globalThis)},arguments)},s.wbg.__wbg_global_e5a3fe56f8be9485=function(){return j(function(){return m(global.global)},arguments)},s.wbg.__wbindgen_is_undefined=function(e){return I(e)===void 0},s.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){return m(new Function(X(e,t)))},s.wbg.__wbindgen_object_clone_ref=function(e){return m(I(e))},s.wbg.__wbindgen_number_new=function(e){return m(e)},s.wbg.__wbg_new_525245e2b9901204=function(){return m(new Object)},s.wbg.__wbindgen_string_new=function(e,t){return m(X(e,t))},s.wbg.__wbg_call_1084a111329e68ce=function(){return j(function(e,t){return m(I(e).call(I(t)))},arguments)},s.wbg.__wbg_call_89af060b4e1523f2=function(){return j(function(e,t,r){return m(I(e).call(I(t),I(r)))},arguments)},s.wbg.__wbg_call_7de908392845a9a5=function(){return j(function(e,t,r,i,n){return m(I(e).call(I(t),I(r),I(i),I(n)))},arguments)},s.wbg.__wbg_valueOf_563b3487b1b116aa=function(e){return I(e).valueOf()},s.wbg.__wbg_set_eacc7d73fefaafdf=function(){return j(function(e,t,r){return Reflect.set(I(e),I(t),I(r))},arguments)},s.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){return m(I(e).buffer)},s.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var r={a:e,b:t},i=(n,a)=>{const o=r.a;r.a=0;try{return Ji(o,r.b,n,a)}finally{r.a=o}};return m(new Promise(i))}finally{r.a=r.b=0}},s.wbg.__wbg_resolve_570458cb99d56a43=function(e){return m(Promise.resolve(I(e)))},s.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){return m(I(e).then(I(t)))},s.wbg.__wbg_then_876bb3c633745cc6=function(e,t,r){return m(I(e).then(I(t),I(r)))},s.wbg.__wbg_new_ea1883e1e5e86686=function(e){return m(new Uint8Array(I(e)))},s.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return I(e).length},s.wbg.__wbg_set_d1e79e2388520f18=function(e,t,r){I(e).set(I(t),r>>>0)},s.wbg.__wbindgen_throw=function(e,t){throw new Error(X(e,t))},s.wbg.__wbindgen_memory=function(){return m(c.memory)},s.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){return m(I(e).queueMicrotask)},s.wbg.__wbindgen_cb_drop=function(e){const t=D(e).original;return t.cnt--==1?(t.a=0,!0):!1},s.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(I(e))},s.wbg.__wbg_parquetchunk_new=function(e){return m(Oe.__wrap(e))},s.wbg.__wbindgen_bigint_from_i64=function(e){return m(e)},s.wbg.__wbg_parquetfile_new=function(e){return m(zs.__wrap(e))},s.wbg.__wbg_filemetadata_new=function(e){return m(ee.__wrap(e))},s.wbg.__wbindgen_closure_wrapper1401=function(e,t,r){return m(Xi(e,t,74,Qi))},s}function Gs(s,e){return c=s.exports,Ns.__wbindgen_wasm_module=e,U=null,re=null,se=null,c}function sn(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module:s}=s:console.warn("using deprecated parameters for `initSync()`; pass a single object instead");const e=Ws();return s instanceof WebAssembly.Module||(s=new WebAssembly.Module(s)),Gs(new WebAssembly.Instance(s,e),s)}async function Ns(s){if(c!==void 0)return c;s!==void 0&&Object.getPrototypeOf(s)===Object.prototype?{module_or_path:s}=s:console.warn("using deprecated parameters for the initialization function; pass a single object instead");const e=Ws();(typeof s=="string"||typeof Request=="function"&&s instanceof Request||typeof URL=="function"&&s instanceof URL)&&(s=fetch(s));const{instance:t,module:r}=await tn(await s,e);return Gs(t,r)}const rn=Object.freeze(Object.defineProperty({__proto__:null,FieldMetadata:Ee,FileMetadata:ee,GeometryInfoDescriptor:J,ParquetChunk:Oe,ParquetFile:zs,RangeProviderJs:ne,default:Ns,enableTracing:Zi,initSync:sn,readFile:en,readMetadata:Ls},Symbol.toStringTag,{value:"Module"}));let Ge=null;async function $s(){return Ge||(Ge=nn()),Ge}async function nn(){const s=await Promise.resolve().then(()=>rn);return await s.default({module_or_path:nr("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),s.enableTracing(),s}const Bs=s=>async function(e,t,r){const i=s(),{data:n}=await tt(e,{responseType:"array-buffer",query:i,headers:{range:`bytes=${t}-${r}`}});return n},Vs=s=>async function(e){const t=s(),{data:r}=await tt(e,{responseType:"native",method:"head",query:t}),i=r.headers.get("Content-Length");if(i==null)throw new Error("Unable to parse content length");return parseInt(i,10)};class ve{static async create(e,t){const r=await $s(),i=await r.readMetadata(e,Bs(t),Vs(t));return ve.fromFileMetadata(i)}static fromFileMetadata(e){const t=[];for(let r=0;r65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return"esriGeometryPoint"}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return this._objectIdFieldIndex!=null?this._inner.readAttribute(this._index,this._objectIdFieldIndex):this._index<<16|this._chunkId}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getIndex(){return this._index}next(){for(;++this._index{const n=Array.from(r).map(a=>i.metadata.getFieldIndex(a));return i.inner.updateChunks(new Uint16Array(n))}))}async load(e){return this._promise==null&&(this._promise=this._download()),this._promise}unload(e){}async addParquetFile(e){this._insert(e)}async _insert(e){const t=await gt.create(e,{geometryInfo:this._service.geometryInfo,outSpatialReference:this._service.outSpatialReference,getCustomParameters:()=>this._schema.mutable.dataFilter.customParameters}),{geometryInfo:r}=this._service;Z(this._options);const{fields:i,timeZoneByFieldName:n}=this._service.metadata.fieldsIndex,a=i.map(u=>({...u,index:t.metadata.getFieldIndex(u.name)})),o=de.fromJSON({fields:a,timeZoneByFieldName:n}),d=new Uint16Array(Array.from(this._availableFields.values()).map(u=>o.get(u)?.index));await t.inner.readChunksWithCallback(d,u=>{const h=this._chunkId++,l=new an(this._metadata,o,r,u,h),p=new xe(l,null,h,!1);this._store.insert(p)}),this._files.push(t)}async _download(){try{await Promise.all(this._service.source.urls.map(t=>this._insert(t)));const e=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(e)}catch(e){throw console.error(e),e}}}class dn extends Ps{constructor(e,t,r,i,n,a){super(e,t,r,n,a),this._random=new Jt(1e3),this._featureCount=i}get about(){return{willQueryAllFeatures:!0,willQueryFullResolutionGeometry:!0}}load(e){return this._promise==null&&(this._promise=this._downloadPages(this._featureCount)),this._promise}unload(e){}async _downloadPages(e){const t=Math.ceil(e/this._queryInfo.pageSize),r=Array.from({length:t},(o,d)=>d).sort((o,d)=>this._random.getInt()-this._random.getInt()),i=await Promise.all(r.map(o=>this._downloadPage(o))),n=new xe(q.empty(this._metadata),null,-1,!0);this._store.insert(n);const a=i.filter(o=>o);if(a.length)throw new W("featurelayer-query","Encountered errors when downloading data",{errors:a})}async _downloadPage(e){try{const t=this._queryInfo.createPagedQuery(e),r=await this._fetch(t,this._options),i=new xe(r,t.inner.toJSON(),e,!1);return Z(this._options),this._store.insert(i),null}catch(t){return t}}}const un="__esri_stream_id__",Vt="__esri_timestamp__",Yt=1e3;class cn{constructor(e,t,r,i,n=128){this._trackIdToObservations=new Map,this._idCounter=0,this._lastPurge=performance.now(),this._addOrUpdated=new Map,this._removed=[],this._maxAge=0,this._timeInfo=r,this._purgeOptions=i,this.store=e,this.objectIdField=t,this.purgeInterval=n,this._useGeneratedIds=this.objectIdField===un}removeById(e){this._removed.push(e)}removeByTrackId(e){const t=this._trackIdToObservations.get(e);if(t)for(const r of t.entries)this._removed.push(r)}add(e){if(this._useGeneratedIds){const a=this._nextId();e.attributes[this.objectIdField]=a,e.objectId=a}else e.objectId=e.attributes[this.objectIdField];const t=e.objectId;if(this._addOrUpdated.set(t,e),this._maxAge=Math.max(this._maxAge,e.attributes[this._timeInfo.startTimeField]),!this._timeInfo.trackIdField)return this._trackIdLessObservations==null&&(this._trackIdLessObservations=new xt(1e5)),void this._trackIdLessObservations.enqueue(t);const r=e.attributes[this._timeInfo.trackIdField];if(!this._trackIdToObservations.has(r)){const a=this._purgeOptions?.maxObservations!=null?this._purgeOptions.maxObservations:Yt,o=ar(a,0,Yt);this._trackIdToObservations.set(r,new xt(o))}const i=this._trackIdToObservations.get(r),n=i?.enqueue(t);n!=null&&(this._addOrUpdated.has(n)?this._addOrUpdated.delete(n):this._removed.push(n))}checkForUpdates(){const e=this._getToAdd(),t=this._getToRemove(),r=performance.now();r-this._lastPurge>=this.purgeInterval&&(this._purge(r),this._lastPurge=r);const i=[];if(t!=null)for(const a of t){const o=this.store.removeById(a);o!=null&&i.push(o)}const n=[];if(e!=null){const a=new Set(t??[]);for(const o of e)a.has(o.objectId)||(o.attributes[Vt]=r,this.store.add(o),n.push(o))}return!(!n.length&&!i?.length)&&(this.store.update(n,i),!0)}_getToAdd(){if(!this._addOrUpdated.size)return null;const e=new Array(this._addOrUpdated.size);let t=0;return this._addOrUpdated.forEach(r=>e[t++]=r),this._addOrUpdated.clear(),e}_getToRemove(){const e=this._removed;return this._removed.length?(this._removed=[],e):null}_nextId(){const e=this._idCounter;return this._idCounter=(this._idCounter+1)%4294967294+1,e}_purge(e){const t=this._purgeOptions;t!=null&&(this._purgeSomeByDisplayCount(t),this._purgeByAge(t),this._purgeByAgeReceived(e,t),this._purgeTracks())}_purgeSomeByDisplayCount(e){if(!e.displayCount)return;let t=this.store.size;if(t>e.displayCount){if(this._timeInfo.trackIdField){for(const r of this._trackIdToObservations.values())if(t>e.displayCount&&r.size){const i=r.dequeue();this._removed.push(i),t--}}if(this._trackIdLessObservations!=null){let r=t-e.displayCount;for(;r-- >0;){const i=this._trackIdLessObservations.dequeue();i!=null&&this._removed.push(i)}}}}_purgeByAge(e){const t=this._timeInfo?.startTimeField;if(!e.age||!t)return;const r=60*e.age*1e3,i=this._maxAge-r;this.store.forEach(n=>{n.attributes[t]{i.attributes[Vt]{e.size===0&&this._trackIdToObservations.delete(t)})}}let B=class extends Ht{constructor(s){super(s)}get connectionStatus(){return this.connection?.connectionStatus}get errorString(){return this.connection?.errorString}};V([ge()],B.prototype,"connection",void 0),V([ge()],B.prototype,"connectionStatus",null),V([ge()],B.prototype,"errorString",null),B=V([Xt("esri.views.2d.layers.features.sources.StreamConnectionState")],B);let ln=class{constructor(s,e){this._metadata=s,this._onUpdate=e,this._objectIdToFeature=new Map}get size(){return this._objectIdToFeature.size}get reader(){return q.fromFeatures([...this._objectIdToFeature.values()],this._metadata)}add(s){this._objectIdToFeature.set(s.objectId,s)}forEach(s){this._objectIdToFeature.forEach(s)}removeById(s){const e=this._objectIdToFeature.get(s);return e?(this._objectIdToFeature.delete(s),e):null}clear(){this._objectIdToFeature=new Map}update(s,e){this._onUpdate(s?.length??0)}};class hn extends ue{constructor(e){super(),this._reader=e,this.chunkId="stream-chunk",this.normalizedChunkId="stream-chunk"}get reader(){return this._reader}get first(){return!0}get end(){return!0}get queryInfo(){return{type:"stream",chunkId:this.chunkId,size:this.size(),end:this.end}}get isTiled(){return!1}getTileReader(e){const t=this.queryFeaturesInBounds(e.bounds);return t.setTransformForDisplay(e.transform),t}}class _n extends pt{constructor(e,t,r,i,n){super(r),this._service=e,this._dataFilter=t,this._streamOptions=i,this._metadata=n,this._connectionState=new B,this._forceRefresh=!1,this.events=new st;const{objectIdField:a,timeInfo:o}=this._metadata,{purgeOptions:d}=t;this._stagingStore=new ln(this._metadata,u=>this.events.emit("features-updated",u)),this._manager=new cn(this._stagingStore,a,o,d),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const e=this._chunk!=null;this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new hn(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick")):this.events.emit("tick")}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){this._connection=Zt(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(this._connection!=null)return;const{geometryType:e,spatialReference:t}=this._metadata,{maxReconnectionAttempts:r,maxReconnectionInterval:i,geometryDefinition:n,definitionExpression:a,customParameters:o}=this._dataFilter;this._connection=Ur(this._service.source,t,this._streamOptions.outSR,e,a,n,r,i,o),this._handlesGroup=Se([this._connection.on("data-received",d=>this._onFeature(d)),this._connection.on("message-received",d=>this._onWebSocketMessage(d))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._connection?.updateCustomParameters(e)}sendMessageToSocket(e){this._connection?.sendMessageToSocket(e)}sendMessageToClient(e){this._connection?.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch{}}}class pn{constructor(e){this._onChange=e,this._chunks=new Map,this._chunksToRemove=[],this.events=new st,this.featureAdapter=new mr}destroy(){this.clear()}clear(){for(const e of this._chunks.values())this._chunksToRemove.push(e);this._chunks.clear(),this._localEditChunk!=null&&this._chunksToRemove.push(this._localEditChunk),this._localEditChunk=null}*chunks(){this._localEditChunk&&(yield this._localEditChunk),this._localOverridesChunk&&(yield this._localOverridesChunk),yield*this._chunks.values()}dataChunks(){return this._chunks.values()}insert(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.insert`),this._localOverridesChunk?.overriddenIds.size&&(e.reader.removeIds(this._localOverridesChunk.overriddenIds),e.invalidate()),this._localEditChunk?.overriddenIds.size&&this._localEditChunk.removeOverrides(e),this._chunks.set(e.chunkId,e),this.events.emit("changed"),this._onChange()}remove(e){w("esri-2d-update-debug")&&console.debug(`Chunk[${e.chunkId}] SourceChunkStore.remove`),this._chunks.delete(e.chunkId),this._chunksToRemove.push(e)}cleanupRemovedChunks(){const e=this._chunksToRemove;return this._chunksToRemove=[],e}applyLocalOverrides(e,t){this._localOverridesChunk==null&&(this._localOverridesChunk=new Je(t,"localOverride")),this._localOverridesChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localOverridesChunk.overriddenIds),r.invalidate();this.events.emit("changed")}applyLocalEdit(e,t){this._localEditChunk==null&&(this._localEditChunk=new Je(t,"localEdit")),this._localEditChunk.applyOverrides(e);for(const r of this._chunks.values())r.reader.removeIds(this._localEditChunk.overriddenIds),r.invalidate();this.events.emit("changed")}forEach(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i.copy()),t.add(n))}}}forEachUnsafe(e){const t=new Set;for(const r of this.chunks()){const i=r.reader.getCursor();for(;i.next();){const n=i.getObjectId();t.has(n)||(e(i),t.add(n))}}}forEachInBounds(e,t){const r=new Set;for(const i of this.chunks()){const n=i.queryFeaturesInBounds(e);for(;n.next();){const a=n.getObjectId();r.has(a)||(t(n.copy()),r.add(a))}}}forEachBounds(e,t){const r=rt();for(const i of e)i.getBounds(r)&&t(r)}}class gn{constructor(e,t,r,i,n){this.service=e,this._aggregateAdapter=t,this._subscriptions=r,this._onChange=i,this._connection=n,this._updateTracking=new Wr({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._store=new pn(this._onChange),this._metadata=ot.createFeature(e.metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),this.service.type==="memory"&&this.service.source.map(e=>e.close())}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return this._streamMessenger==null&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return Fi.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,r=this._metadata;this._queryEngine=new as({featureStore:this._store,fieldsIndex:r.fieldsIndex,geometryType:r.geometryType,objectIdField:r.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:r.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return this._schema.type==="stream"}chunks(){return Array.from(this._store.chunks())}cleanupRemovedChunks(){return this._store.cleanupRemovedChunks()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then(()=>this._connection.onEvent({type:"loaded",tile:e.tile.id})).catch(r=>this._connection.onEvent({type:"error",tile:e.tile.id,error:r})),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(Qt(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}getLocalEdit(e){return this._updateTracking.addPromise(this._getGetLocalEdit(e))}applyLocalEdit(e){this._didInvalidateData=!0,this._store.applyLocalEdit(e,this.metadata)}async update(e,t){const r=e.source,i=Kt(this._schema?.mutable,r.mutable);if(!i)return!1;if(w("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:i}),this._schema=r,this._queryEngine?.destroy(),this._queryEngine=null,this.service.type==="feature-service"&&this.service.queryMetadata.lastEditDate!=null&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),this._streamMessenger==null&&this._schema.type==="stream"&&this._initStreamMessenger(),mt(i,"sourceRefreshVersion")&&this._strategy?.refresh)return await this._strategy.refresh(),!0;if((r.type==="feature"||r.type==="parquet")&&mt(i,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(r.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(n){this._connection.onEvent({type:"updateFieldsError",error:n})}}return!1}return!(!bt(i,"dataFilter")&&!bt(i,"sourceRefreshVersion"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){this._strategy.addParquetFile(e)}_initStreamMessenger(){this._streamMessenger==null&&(this._streamMessenger=new ye(this._connection))}async _getGetLocalEdit(e){if(e.historicMoment&&this._schema.type==="feature"&&(this._schema.mutable.dataFilter.historicMoment=e.historicMoment,this._strategy.unsafeSetQueryHistoricMoment(new Date(e.historicMoment))),e.type==="edit-by-feature"){const i=[...e.added,...e.updated].map(n=>Y.fromJSON(n,this.metadata.objectIdField));return{reader:q.fromOptimizedFeatures(i,this.metadata),removed:this._resolveIdentifiers(e.removed)}}const t=this._resolveIdentifiers(e.removed);if(!e.updated.length&&!e.added.length)return{reader:q.empty(this.metadata),removed:t};const r=this._resolveIdentifiers([...e.added,...e.updated]);return{reader:await this._strategy.queryByObjectId(r),removed:t}}_resolveIdentifiers(e){const t=[],r=[];for(const i of e)i.objectId!=null&&i.objectId!==-1?r.push(i.objectId):t.push(i.globalId);if(t.length){const i=new Set(t),n=this.metadata.globalIdField;if(n==null)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");this._store.forEachUnsafe(a=>{const o=a.readAttribute(n);i.has(o)&&r.push(a.getObjectId())})}return r}async _queryLastEditDateChanged(){if(this._lastEditDate==null)return!1;const e=this.service.source,t={...e.query,f:"json"},r=(await tt(e.path,{query:t,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),r=this.service.source&&"collection"in this.service.source,i=e||t||r;if(this._schema.type==="stream"){const d=new _n(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=d,d}if(this._schema.type==="parquet"){const d=this.service;return new on(d,this._metadata,this._schema,this._store)}const n=this.service,a=Ci.fromSchema(n,this._schema,this._metadata),o=await this._supportSnapshotMode(n,a);return o?new dn(n,a,this._store,o.featureCount,this.metadata,this._connection):i?new Vi(n,a,this._store,this.metadata,this._connection):new $i(n,a,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const i=Array.from(this._subscriptions.values());if(!i.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const n=Promise.all(i.map(a=>this._strategy.load(a).then(()=>this._connection.onEvent({type:"loaded",tile:a.tile.id})).catch(o=>this._connection.onEvent({type:"error",tile:a.tile.id,error:o}))));this._updateTracking.addPromise(n);try{r&&await n}catch(a){et(a)}this._connection.onEvent({type:"updateStrategyEnd"}),w("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:r}=e,i=r.snapshotInfo;if(!i||!i.supportsSnapshotMinThreshold||!i.snapshotCountThresholds)return null;const n=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const o=(await Rr(n,a.inner,{query:a.customParameters})).data.count,{min:d,max:u}=i.snapshotCountThresholds;return o<=d||i.supportsSnapshotMaxThreshold&&othis._processor.getFeatureObjectIdsForAggregate(e)},this._subscriptions=new Map,this._updateRequested=!1,this._updateSubscriptionRequests=[],this._updateHighlightRequests=[]}destroy(){this._subscriptions.clear(),this._processor?.destroy(),this._source?.destroy(),this._handles?.remove(),this._updateLocalEditsRequest=null,this._tileInfoView=null}onAttach(e){w("esri-2d-update-debug")&&console.debug("Pipeline.onAttach");const t=this._connection,r=hr.fromJSON(e.tileInfoJSON);this._tileInfoView=new _r(r),this._source=new gn(e.service,this._aggregateAdapter,this._subscriptions,()=>this._requestUpdate(),t),this._processor=new Si(t,this._source),this._handles=Se([Ne(()=>this._source.updateTracking.updating,()=>{this._requestUpdate(),Qt(this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}))})])}onDetach(){w("esri-2d-update-debug")&&console.debug("Pipeline.onDetach"),this.destroy()}set remoteClient(e){this._connection=new Gr(e)}get features(){const e=this._source?.queryEngine;if(!e)throw new W("no-queryEngine","No query engine defined");return e}get aggregates(){const e=this._processor?.aggregateQueryEngine;if(!e)throw new W("no-queryEngine","No aggregate query engine defined");return e}get processor(){return this._processor}get streamMessenger(){return this._source.streamMessenger}getDisplayFeatures(e){return this._processor.getDisplayFeatures(e)}getDisplayIds(e){return this._processor.getDisplayIds(e)}async updateSchema(e,t){return w("esri-2d-update-debug")&&this._updateSchemaRequest&&console.error("InternalError: Schema already updating"),this._updateSchemaRequest=new pe({schema:e,version:t}),this._requestUpdate(),this._updateSchemaRequest.resolver.promise}updateSubscriptions(e){const t=new pe(e);return this._updateSubscriptionRequests.push(t),this._requestUpdate(),t.resolver.promise}updateHighlight(e){const t=new pe(e);return this._updateHighlightRequests.push(t),this._requestUpdate(),t.resolver.promise}async addParquetFile(e){return this._source.addParquetFile(e)}async onEdits(e){if(this._updateLocalEditsRequest!=null)throw new W("InternalError - Already processing an edit");this._updateLocalEditsRequest=new pe(e);const t=this._updateLocalEditsRequest.resolver.promise;return this._requestUpdate(),t}queryStatistics(){return this._source.statistics.toJSON()}async queryVisibleFeatures(e,t){return this.features.executeQuery(e,t)}async queryHeatmapStatistics(e){const t=Math.round(Qs(e.radius));let r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;const n=typeof e.fieldOffset=="string",a=e.fieldOffset??0,o=Array.from(this._subscriptions.values()),d=this._source.chunks(),u=t**2,h=3/(Math.PI*u),l=2*t,p=Math.ceil(T/l);for(const g of o){const _=g.tile,f=new Float64Array(p*p);for(const y of d){const v=y.getTileReader(_);if(!v)continue;const b=v.getCursor();for(;b.next();){let F=1;if(e.field!=null){const R=b.readAttribute(e.field);F=n?-1*+R:+R+a}const C=b.readXForDisplay()/l,x=b.readYForDisplay()/l,S=Math.floor(C),k=Math.floor(x);if(S<0||k<0||S>=p||k>=p)continue;const E=((.5+S-C)*l)**2+((.5+k-x)*l)**2;if(E>u)continue;const L=F*(h*(1-E/u)**2);f[k+S*p]+=L}}for(let y=0;yd+u.size(),0)<=e.minFeatureCount){if(!this._source.updateTracking.updating){const d=[];return this._source.store.forEachUnsafe(u=>d.push(u.readLegacyFeatureWorldSpace())),d}return null}const r=new Set,i=[],n=t.map(d=>d.reader.getCursor()),a=new Jt,o=3*e.sampleSize;for(let d=0;d=e.sampleSize?i:null}_requestUpdate(){this._updateRequested||(this._updateRequested=!0,Zs(()=>this._scheduleNextUpdate()))}_scheduleNextUpdate(){this._updateRequested&&(this._ongoingUpdate||(this._ongoingUpdate=it(this._doUpdate()).finally(()=>{this._ongoingUpdate=null,this._scheduleNextUpdate()}),this._updateRequested=!1))}_subscribe(e){const t=e.tileId;if(this._subscriptions.has(t))return;w("esri-2d-update-debug")&&console.debug(`Tile[${t}] Pipeline.subscribe`);const r=new pr(this._tileInfoView,t),i=new fn(r,e.version);this._subscriptions.set(t,i),this._source.onSubscribe(i),this._processor.onSubscribe(i)}_unsubscribe(e){const t=this._subscriptions.get(e);t&&(w("esri-2d-update-debug")&&console.debug(`Tile[${e}] Pipeline.unsubscribe`),t.abort(),this._source.onUnsubscribe(t),this._processor.onUnsubscribe(t),this._subscriptions.delete(t.key.id))}async _doUpdate(){if(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateStart"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0}),this._updateSubscriptionRequests.length){const i=this._updateSubscriptionRequests;this._updateSubscriptionRequests=[];for(const n of i)this._doUpdateSubscriptions(n.inner),n.resolver.resolve()}const e=this._updateSchemaRequest;if(this._updateSchemaRequest=null,e!=null){const{schema:i,version:n}=e.inner;await this._doUpdateSchema(i,n)}const t=this._updateLocalEditsRequest;if(this._updateLocalEditsRequest=null,t!=null){w("esri-2d-update-debug")&&console.debug("Pipeline.applyEditOverride",t.inner);const i=await this._source.getLocalEdit(t.inner);await this._processor.applyLocalEdit(i),this._source.applyLocalEdit(i),w("esri-2d-update-debug")&&console.debug("Pipeline.endEditOverride",t.inner)}if(this._updateHighlightRequests.length){const i=this._updateHighlightRequests;this._updateHighlightRequests=[];for(const n of i)this._processor.updateHighlight(n.inner),n.resolver.resolve()}const r=this._source.cleanupRemovedChunks();this._processor.removeChunks(r);try{this._subscriptions.size&&(w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksStart"),await this._processor.updateChunks(),w("esri-2d-update-debug")&&console.debug("Pipeline.updateChunksEnd"))}catch(i){et(i)}t?.resolver.resolve(),e?.resolver.resolve(),this._updateRequested?(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=true]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:!0})):(w("esri-2d-update-debug")&&console.debug("Pipeline._doUpdateEnd [updateRequested=false, After flush]"),await this._connection.layerView.setUpdating({data:this._source.updateTracking.updating,pipeline:this._updateRequested}))}async _doUpdateSchema(e,t){w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateStart`,{schema:e});const r={tileInfo:this._tileInfoView?.tileInfo},i=await this._source.update(e,t),n=Array.from(this._subscriptions.values());await this._processor.update(e,t,r,i,n),w("esri-2d-update-debug")&&console.debug(`Version[${t}] Pipeline.updateEnd`)}_doUpdateSubscriptions(e){w("esri-2d-update-debug")&&console.debug("Pipeline.updateSubscriptions",e);for(const t of e.subscribe)this._subscribe(t);for(const t of e.unsubscribe)this._unsubscribe(t)}}export{to as default}; diff --git a/custom-toc-highlight/assets/FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js b/custom-toc-highlight/assets/FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js similarity index 96% rename from custom-toc-highlight/assets/FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js rename to custom-toc-highlight/assets/FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js index cbfe069e..be81ea63 100644 --- a/custom-toc-highlight/assets/FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js +++ b/custom-toc-highlight/assets/FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js @@ -1 +1 @@ -import{aa as te,e as j,v as n,S as o,i as g,bz as M,bL as B,ab as K,dN as f,ac as _,a0 as x,e8 as ie,K as J,P as p,dK as O,ah as re,av as se,e0 as ne,o as oe,a1 as ae}from"./story-BfX8CRfG.js";import{G as le,y as R,h as ue}from"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{m as U,o as F,p as $}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{Y as X,X as D,s as pe}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{e as S,c as k}from"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import{p as H}from"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import{C as P}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{k as Q}from"./MD5-CHHr-oed-SuyrCYQ0.js";let v=class extends te(j){constructor(i){super(i),this.expression=null,this.title=null,this.returnType=null}};n([o({type:String,json:{write:!0}})],v.prototype,"expression",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"title",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"returnType",void 0),v=n([g("esri.layers.support.ExpressionInfo")],v);const C=v;var V;let c=V=class extends j{constructor(i){super(i),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new V({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:p(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};n([o({type:Boolean,json:{write:!0}})],c.prototype,"isAutoGenerated",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"name",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"alias",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"onStatisticField",void 0),n([o({type:C,json:{write:!0}})],c.prototype,"onStatisticExpression",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"statisticType",void 0),c=V=n([g("esri.layers.support.AggregateField")],c);const m=c;var z;let u=z=class extends S{constructor(i){super(i),this.type="binning",this.binType="geohash",this.fixedBinLevel=null,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.size=f("12px"),this.fields=[],this.renderer=null}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?F(t,s,e)??void 0:H(s,e)}clone(){return new z({fields:p(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate),renderer:p(this.renderer),binType:p(this.binType),size:this.size})}};n([M({binning:"binning"})],u.prototype,"type",void 0),n([M({geohash:"geohash",square:"square"}),o({type:["geohash","square"]})],u.prototype,"binType",void 0),n([o({type:Number,json:{write:!0}})],u.prototype,"fixedBinLevel",void 0),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],u.prototype,"labelingInfo",void 0),n([o(X)],u.prototype,"labelsVisible",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],u.prototype,"maxScale",void 0),n([o(D)],u.prototype,"popupEnabled",void 0),n([o({type:B,json:{name:"popupInfo",write:!0}})],u.prototype,"popupTemplate",void 0),n([o({cast:i=>i==="auto"?i:K(f(i))})],u.prototype,"size",void 0),n([o({type:[m],json:{write:!0}})],u.prototype,"fields",void 0),n([_("fields")],u.prototype,"writeFields",null),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],u.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],u.prototype,"readRenderer",null),u=z=n([g("esri.layers.support.FeatureReductionBinning")],u);const Z=u;var T;function L(i){return i.type==="simple"&&!i.visualVariables?.length}let l=T=class extends j{constructor(i){super(i),this.type="cluster",this.clusterRadius=f("80px"),this.clusterMinSize=f("12px"),this.clusterMaxSize=f("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=[]}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t?L(t)?null:F(t,s,e)??void 0:H(s,e)}readSymbol(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t&&L(t)?F(t,s,e)?.symbol:null}writeSymbol(i,s,e,t){const r=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||r){const a=new $({symbol:i});s.drawingInfo={renderer:a.write({},t)}}}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readFields(i,s,e){return i.filter(t=>!t.isAutoGenerated).map(t=>m.fromJSON(t))}clone(){return new T({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,fields:p(this.fields),maxScale:this.maxScale,renderer:p(this.renderer),symbol:p(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate)})}};n([o({type:["cluster"],readOnly:!0,json:{write:!0}})],l.prototype,"type",void 0),n([o({cast:i=>i==="auto"?i:K(f(i)),json:{write:!0}})],l.prototype,"clusterRadius",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMinSize",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMaxSize",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],l.prototype,"maxScale",void 0),n([o(D)],l.prototype,"popupEnabled",void 0),n([o({type:B,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],l.prototype,"popupTemplate",void 0),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],l.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],l.prototype,"readRenderer",null),n([o({types:ie})],l.prototype,"symbol",void 0),n([x("symbol",["drawingInfo.renderer"])],l.prototype,"readSymbol",null),n([_("symbol")],l.prototype,"writeSymbol",null),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],l.prototype,"labelingInfo",void 0),n([o(X)],l.prototype,"labelsVisible",void 0),n([o({type:[m],json:{write:!0}})],l.prototype,"fields",void 0),n([_("fields")],l.prototype,"writeFields",null),n([x("fields")],l.prototype,"readFields",null),l=T=n([g("esri.layers.support.FeatureReductionCluster")],l);const W=l,N={key:"type",base:S,typeMap:{cluster:W,binning:Z}},de={types:{key:"type",base:S,typeMap:{selection:k,cluster:W,binning:Z}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:N},"portal-item":{types:N},"web-scene":{types:{key:"type",base:S,typeMap:{selection:k}},name:"layerDefinition.featureReduction",write:{layerContainerTypes:pe}}}}},ce=()=>ae.getLogger("esri.views.2d.layers.support.clusterUtils");J.add("esri-cluster-arcade-enabled",!0);const fe=J("esri-cluster-arcade-enabled"),ye=new Set(["simple-line","simple-fill","picture-fill"]);function q(i,s){let e=s.clone();if(!me(e))return e;if(s.getSymbols().some(t=>ye.has(t.type))&&(e=new $({symbol:new ne})),e.authoringInfo||(e.authoringInfo=new ue),e.authoringInfo.isAutoGenerated=!0,"visualVariables"in e){const t=(e.visualVariables||[]).filter(r=>r.valueExpression!=="$view.scale");t.forEach(r=>{r.type==="rotation"?r.field?r.field=y(i,r.field,"avg_angle","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg_angle","number"),r.valueExpression=null):r.normalizationField?(r.field=y(i,r.field,"avg_norm","number",r.normalizationField),r.normalizationField=null):r.field?r.field=y(i,r.field,"avg","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg","number"),r.valueExpression=null)}),e.visualVariables=t}switch(e.type){case"simple":break;case"pie-chart":for(const t of e.attributes)t.field?t.field=y(i,t.field,"sum","number"):t.valueExpression&&(t.field=h(i,t.valueExpression,"sum","number"),t.valueExpression=null);break;case"unique-value":e.field?e.field=y(i,e.field,"mode","string"):e.valueExpression&&(e.field=h(i,e.valueExpression,"mode","string"),e.valueExpression=null);break;case"class-breaks":e.normalizationField?(e.field=y(i,e.field,"avg_norm","number",e.normalizationField),e.normalizationField=null):e.field?e.field=y(i,e.field,"avg","number"):e.valueExpression&&(e.field=h(i,e.valueExpression,"avg","number"),e.valueExpression=null)}return e}const me=i=>{const s=e=>ce().error(new oe("Unsupported-renderer",e,{renderer:i}));if(!i)return!1;switch(i.type){case"unique-value":if(i.field2||i.field3)return s("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(i.normalizationField){const e=i.normalizationType;if(e!=="field")return s(`FeatureReductionCluster does not support a normalizationType of ${e}`),!1}break;case"simple":case"pie-chart":break;default:return s(`FeatureReductionCluster does not support renderers of type ${i.type}`),!1}if(!fe){if("valueExpression"in i&&i.valueExpression)return s("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in i&&i.visualVariables||[]).some(e=>!(!("valueExpression"in e)||!e.valueExpression)))return s("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function be(i,s,e){switch(i){case"sum":return`cluster_sum_${s}`;case"avg":case"avg_angle":return`cluster_avg_${s}`;case"mode":return`cluster_type_${s}`;case"avg_norm":{const t=e,r="field",a=s.toLowerCase()+",norm:"+r+","+t.toLowerCase();return"cluster_avg_"+Q(a)}}}function h(i,s,e,t){const r=Q(s),a=e==="mode"?`cluster_type_${r}`:e==="sum"?`cluster_sum_${r}`:`cluster_avg_${r}`;return i.some(d=>d.name===a)||i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:s,returnType:t}),statisticType:e})),a}function y(i,s,e,t,r){if(s==="cluster_count"||i.some(d=>d.name===s))return s;const a=be(e,s,r);return i.some(d=>d.name===a)||(e==="avg_norm"?i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:`$feature.${s} / $feature.${r}`,returnType:t}),statisticType:"avg"})):i.push(new m({name:a,isAutoGenerated:!0,onStatisticField:s,statisticType:e}))),a}const Re=i=>{let s=class extends i{constructor(...e){super(...e),this.addHandles(re(()=>this.renderer,()=>{if(this.featureReduction){const t=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",t)}},se))}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}set renderer(e){}_withClusterVariable(e,t,r){const a=e.clone();return"visualVariables"in a&&(a.visualVariables||(a.visualVariables=[]),a.visualVariables.some(d=>d.type==="size")||a.visualVariables.push(new le({field:"cluster_count",stops:[new R({value:1}),new R({useMinValue:!0,size:t}),new R({useMaxValue:!0,size:r})]}))),a}_normalizeFeatureReduction(e){if(e?.type!=="cluster")return e;const t=e.clone(),r=[new m({name:"cluster_count",alias:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],a=(t.fields??[]).filter(b=>!b.isAutoGenerated),d=e.renderer&&!e.renderer.authoringInfo?.isAutoGenerated,{clusterMinSize:E,clusterMaxSize:I}=t;if(d){t.fields=[...r,...a];const b=this._withClusterVariable(t.renderer,E,I);return t.effectiveFeatureRenderer=b,t.effectiveClusterRenderer=b,t}if(e.symbol){if(t.fields=[...r,...a],t.renderer=null,!this.renderer)return t.effectiveFeatureRenderer=null,t.effectiveClusterRenderer=null,t;const b=q(r,this.renderer),w=this._withClusterVariable(b,E,I),Y="visualVariables"in w&&w.visualVariables?w.visualVariables:[],ee=new $({symbol:e.symbol,visualVariables:Y});return t.fields=[...r,...a],t.effectiveFeatureRenderer=w,t.effectiveClusterRenderer=ee,t}if(!this.renderer)return e;const G=q(r,this.renderer);t.fields=[...r,...a],t.renderer=G;const A=this._withClusterVariable(G,E,I);return t.effectiveFeatureRenderer=A,t.effectiveClusterRenderer=A,t}};return n([o(de)],s.prototype,"featureReduction",null),s=n([g("esri.layers.mixins.FeatureReductionLayer")],s),s};export{de as X,Re as v}; +import{aa as te,e as j,v as n,S as o,i as g,bz as M,bL as B,ab as K,dN as f,ac as _,a0 as x,e8 as ie,K as J,P as p,dK as O,ah as re,av as se,e0 as ne,o as oe,a1 as ae}from"./story-Doly9N9p.js";import{G as le,y as R,h as ue}from"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{m as U,o as F,p as $}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{Y as X,X as D,s as pe}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{e as S,c as k}from"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import{p as H}from"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import{C as P}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{k as Q}from"./MD5-CHHr-oed-SuyrCYQ0.js";let v=class extends te(j){constructor(i){super(i),this.expression=null,this.title=null,this.returnType=null}};n([o({type:String,json:{write:!0}})],v.prototype,"expression",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"title",void 0),n([o({type:String,json:{write:!0}})],v.prototype,"returnType",void 0),v=n([g("esri.layers.support.ExpressionInfo")],v);const C=v;var V;let c=V=class extends j{constructor(i){super(i),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new V({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:p(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};n([o({type:Boolean,json:{write:!0}})],c.prototype,"isAutoGenerated",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"name",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"alias",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"onStatisticField",void 0),n([o({type:C,json:{write:!0}})],c.prototype,"onStatisticExpression",void 0),n([o({type:String,json:{write:!0}})],c.prototype,"statisticType",void 0),c=V=n([g("esri.layers.support.AggregateField")],c);const m=c;var z;let u=z=class extends S{constructor(i){super(i),this.type="binning",this.binType="geohash",this.fixedBinLevel=null,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.size=f("12px"),this.fields=[],this.renderer=null}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?F(t,s,e)??void 0:H(s,e)}clone(){return new z({fields:p(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate),renderer:p(this.renderer),binType:p(this.binType),size:this.size})}};n([M({binning:"binning"})],u.prototype,"type",void 0),n([M({geohash:"geohash",square:"square"}),o({type:["geohash","square"]})],u.prototype,"binType",void 0),n([o({type:Number,json:{write:!0}})],u.prototype,"fixedBinLevel",void 0),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],u.prototype,"labelingInfo",void 0),n([o(X)],u.prototype,"labelsVisible",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],u.prototype,"maxScale",void 0),n([o(D)],u.prototype,"popupEnabled",void 0),n([o({type:B,json:{name:"popupInfo",write:!0}})],u.prototype,"popupTemplate",void 0),n([o({cast:i=>i==="auto"?i:K(f(i))})],u.prototype,"size",void 0),n([o({type:[m],json:{write:!0}})],u.prototype,"fields",void 0),n([_("fields")],u.prototype,"writeFields",null),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],u.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],u.prototype,"readRenderer",null),u=z=n([g("esri.layers.support.FeatureReductionBinning")],u);const Z=u;var T;function L(i){return i.type==="simple"&&!i.visualVariables?.length}let l=T=class extends j{constructor(i){super(i),this.type="cluster",this.clusterRadius=f("80px"),this.clusterMinSize=f("12px"),this.clusterMaxSize=f("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=[]}readRenderer(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t?L(t)?null:F(t,s,e)??void 0:H(s,e)}readSymbol(i,s,e){const t=s.drawingInfo?.renderer;return t?.authoringInfo?.isAutoGenerated?null:t&&L(t)?F(t,s,e)?.symbol:null}writeSymbol(i,s,e,t){const r=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||r){const a=new $({symbol:i});s.drawingInfo={renderer:a.write({},t)}}}writeFields(i,s,e){const t=i.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());O(e,t,s)}readFields(i,s,e){return i.filter(t=>!t.isAutoGenerated).map(t=>m.fromJSON(t))}clone(){return new T({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:p(this.labelingInfo),labelsVisible:this.labelsVisible,fields:p(this.fields),maxScale:this.maxScale,renderer:p(this.renderer),symbol:p(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:p(this.popupTemplate)})}};n([o({type:["cluster"],readOnly:!0,json:{write:!0}})],l.prototype,"type",void 0),n([o({cast:i=>i==="auto"?i:K(f(i)),json:{write:!0}})],l.prototype,"clusterRadius",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMinSize",void 0),n([o({type:Number,cast:f,json:{write:!0}})],l.prototype,"clusterMaxSize",void 0),n([o({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],l.prototype,"maxScale",void 0),n([o(D)],l.prototype,"popupEnabled",void 0),n([o({type:B,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],l.prototype,"popupTemplate",void 0),n([o({types:U,json:{write:{target:"drawingInfo.renderer"}}})],l.prototype,"renderer",void 0),n([x("renderer",["drawingInfo.renderer"])],l.prototype,"readRenderer",null),n([o({types:ie})],l.prototype,"symbol",void 0),n([x("symbol",["drawingInfo.renderer"])],l.prototype,"readSymbol",null),n([_("symbol")],l.prototype,"writeSymbol",null),n([o({type:[P],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],l.prototype,"labelingInfo",void 0),n([o(X)],l.prototype,"labelsVisible",void 0),n([o({type:[m],json:{write:!0}})],l.prototype,"fields",void 0),n([_("fields")],l.prototype,"writeFields",null),n([x("fields")],l.prototype,"readFields",null),l=T=n([g("esri.layers.support.FeatureReductionCluster")],l);const W=l,N={key:"type",base:S,typeMap:{cluster:W,binning:Z}},de={types:{key:"type",base:S,typeMap:{selection:k,cluster:W,binning:Z}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:N},"portal-item":{types:N},"web-scene":{types:{key:"type",base:S,typeMap:{selection:k}},name:"layerDefinition.featureReduction",write:{layerContainerTypes:pe}}}}},ce=()=>ae.getLogger("esri.views.2d.layers.support.clusterUtils");J.add("esri-cluster-arcade-enabled",!0);const fe=J("esri-cluster-arcade-enabled"),ye=new Set(["simple-line","simple-fill","picture-fill"]);function q(i,s){let e=s.clone();if(!me(e))return e;if(s.getSymbols().some(t=>ye.has(t.type))&&(e=new $({symbol:new ne})),e.authoringInfo||(e.authoringInfo=new ue),e.authoringInfo.isAutoGenerated=!0,"visualVariables"in e){const t=(e.visualVariables||[]).filter(r=>r.valueExpression!=="$view.scale");t.forEach(r=>{r.type==="rotation"?r.field?r.field=y(i,r.field,"avg_angle","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg_angle","number"),r.valueExpression=null):r.normalizationField?(r.field=y(i,r.field,"avg_norm","number",r.normalizationField),r.normalizationField=null):r.field?r.field=y(i,r.field,"avg","number"):r.valueExpression&&(r.field=h(i,r.valueExpression,"avg","number"),r.valueExpression=null)}),e.visualVariables=t}switch(e.type){case"simple":break;case"pie-chart":for(const t of e.attributes)t.field?t.field=y(i,t.field,"sum","number"):t.valueExpression&&(t.field=h(i,t.valueExpression,"sum","number"),t.valueExpression=null);break;case"unique-value":e.field?e.field=y(i,e.field,"mode","string"):e.valueExpression&&(e.field=h(i,e.valueExpression,"mode","string"),e.valueExpression=null);break;case"class-breaks":e.normalizationField?(e.field=y(i,e.field,"avg_norm","number",e.normalizationField),e.normalizationField=null):e.field?e.field=y(i,e.field,"avg","number"):e.valueExpression&&(e.field=h(i,e.valueExpression,"avg","number"),e.valueExpression=null)}return e}const me=i=>{const s=e=>ce().error(new oe("Unsupported-renderer",e,{renderer:i}));if(!i)return!1;switch(i.type){case"unique-value":if(i.field2||i.field3)return s("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(i.normalizationField){const e=i.normalizationType;if(e!=="field")return s(`FeatureReductionCluster does not support a normalizationType of ${e}`),!1}break;case"simple":case"pie-chart":break;default:return s(`FeatureReductionCluster does not support renderers of type ${i.type}`),!1}if(!fe){if("valueExpression"in i&&i.valueExpression)return s("FeatureReductionCluster does not currently support renderer.valueExpression. Support will be added in a future release"),!1;if(("visualVariables"in i&&i.visualVariables||[]).some(e=>!(!("valueExpression"in e)||!e.valueExpression)))return s("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function be(i,s,e){switch(i){case"sum":return`cluster_sum_${s}`;case"avg":case"avg_angle":return`cluster_avg_${s}`;case"mode":return`cluster_type_${s}`;case"avg_norm":{const t=e,r="field",a=s.toLowerCase()+",norm:"+r+","+t.toLowerCase();return"cluster_avg_"+Q(a)}}}function h(i,s,e,t){const r=Q(s),a=e==="mode"?`cluster_type_${r}`:e==="sum"?`cluster_sum_${r}`:`cluster_avg_${r}`;return i.some(d=>d.name===a)||i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:s,returnType:t}),statisticType:e})),a}function y(i,s,e,t,r){if(s==="cluster_count"||i.some(d=>d.name===s))return s;const a=be(e,s,r);return i.some(d=>d.name===a)||(e==="avg_norm"?i.push(new m({name:a,isAutoGenerated:!0,onStatisticExpression:new C({expression:`$feature.${s} / $feature.${r}`,returnType:t}),statisticType:"avg"})):i.push(new m({name:a,isAutoGenerated:!0,onStatisticField:s,statisticType:e}))),a}const Re=i=>{let s=class extends i{constructor(...e){super(...e),this.addHandles(re(()=>this.renderer,()=>{if(this.featureReduction){const t=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",t)}},se))}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}set renderer(e){}_withClusterVariable(e,t,r){const a=e.clone();return"visualVariables"in a&&(a.visualVariables||(a.visualVariables=[]),a.visualVariables.some(d=>d.type==="size")||a.visualVariables.push(new le({field:"cluster_count",stops:[new R({value:1}),new R({useMinValue:!0,size:t}),new R({useMaxValue:!0,size:r})]}))),a}_normalizeFeatureReduction(e){if(e?.type!=="cluster")return e;const t=e.clone(),r=[new m({name:"cluster_count",alias:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],a=(t.fields??[]).filter(b=>!b.isAutoGenerated),d=e.renderer&&!e.renderer.authoringInfo?.isAutoGenerated,{clusterMinSize:E,clusterMaxSize:I}=t;if(d){t.fields=[...r,...a];const b=this._withClusterVariable(t.renderer,E,I);return t.effectiveFeatureRenderer=b,t.effectiveClusterRenderer=b,t}if(e.symbol){if(t.fields=[...r,...a],t.renderer=null,!this.renderer)return t.effectiveFeatureRenderer=null,t.effectiveClusterRenderer=null,t;const b=q(r,this.renderer),w=this._withClusterVariable(b,E,I),Y="visualVariables"in w&&w.visualVariables?w.visualVariables:[],ee=new $({symbol:e.symbol,visualVariables:Y});return t.fields=[...r,...a],t.effectiveFeatureRenderer=w,t.effectiveClusterRenderer=ee,t}if(!this.renderer)return e;const G=q(r,this.renderer);t.fields=[...r,...a],t.renderer=G;const A=this._withClusterVariable(G,E,I);return t.effectiveFeatureRenderer=A,t.effectiveClusterRenderer=A,t}};return n([o(de)],s.prototype,"featureReduction",null),s=n([g("esri.layers.mixins.FeatureReductionLayer")],s),s};export{de as X,Re as v}; diff --git a/custom-toc-highlight/assets/FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js b/custom-toc-highlight/assets/FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js similarity index 88% rename from custom-toc-highlight/assets/FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js rename to custom-toc-highlight/assets/FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js index c2768480..74554de6 100644 --- a/custom-toc-highlight/assets/FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js +++ b/custom-toc-highlight/assets/FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js @@ -1 +1 @@ -import{e as p,v as r,S as o,i as n}from"./story-BfX8CRfG.js";let e=class extends p{constructor(){super(...arguments),this.type=null}};r([o({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],e.prototype,"type",void 0),e=r([n("esri.layers.support.FeatureReduction")],e);var s;let t=s=class extends e{constructor(i){super(i),this.type="selection"}clone(){return new s}};r([o({type:["selection"]})],t.prototype,"type",void 0),t=s=r([n("esri.layers.support.FeatureReductionSelection")],t);const l=t;export{l as c,e}; +import{e as p,v as r,S as o,i as n}from"./story-Doly9N9p.js";let e=class extends p{constructor(){super(...arguments),this.type=null}};r([o({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],e.prototype,"type",void 0),e=r([n("esri.layers.support.FeatureReduction")],e);var s;let t=s=class extends e{constructor(i){super(i),this.type="selection"}clone(){return new s}};r([o({type:["selection"]})],t.prototype,"type",void 0),t=s=r([n("esri.layers.support.FeatureReductionSelection")],t);const l=t;export{l as c,e}; diff --git a/custom-toc-highlight/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CfrNArvR.js b/custom-toc-highlight/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-Dmeq1rSE.js similarity index 92% rename from custom-toc-highlight/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CfrNArvR.js rename to custom-toc-highlight/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-Dmeq1rSE.js index 678591ae..36ed7d4e 100644 --- a/custom-toc-highlight/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-CfrNArvR.js +++ b/custom-toc-highlight/assets/FeatureServiceSnappingSourceWorker-DUCI4USj-Dmeq1rSE.js @@ -1 +1 @@ -import{bh as W,v as d,S as p,i as R,I as se,b as ie,$ as g,J as v,ah as P,av as K,aw as re,g as ne,an as oe,dh as ae,P as z,hm as D,j as X,hn as M,ho as le,hp as O,hq as ue,aF as he,ay as b,W as N,a1 as j,n as ce,hr as de,gI as pe,hs as U,ht as A,gH as H,hu as fe,hv as q,hw as Y,ec as B}from"./story-BfX8CRfG.js";import{i as ee}from"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import{I as _e}from"./FeatureStore-Co2V0sVE-BwnfsIjJ.js";import{Z as ge}from"./QueryEngine-CH5uUhZK-BP95Dm56.js";import{V as I}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import{b as S}from"./Query-BrwMGK8U-DoFNfkjX.js";import{q as ye,j as me}from"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import{b as te}from"./LRUCache-C3erQTWv-0wD6drRf.js";import{s as V}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{L as Fe,q as Ce,V as Ee}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{L as Te}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{U as ve}from"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import{w as Se,J as be,q as Ie,P as we}from"./query-DFW9-NG_-gbjlxRZk.js";import{G as Oe}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{r as xe}from"./BoundsStore--N6o1xkF-BnCtocGj.js";import{e as Re}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./main-ugzBrWNm.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js";import"./WhereClause-DxwoyBMS-DnXKVpm2.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./utils-HtkT8Fn3-wUwu1nm1.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-BQ5pghrp.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./utils-tNxq3jkf-B78XlSIE.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";function $(e=!1,t){if(e){const{elevationInfo:s,alignPointsInFeatures:i}=t;return new Pe(s,i)}return new Ae}let Ae=class{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}};const He=1024;let Pe=class{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new te(He),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return i==null||i.mode!=="absolute-height"||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(De(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const _ of e)oe(i,_.objectId,Me).push(_);const[r,n,o]=this._prepareQuery(i,t),a=await this._alignPointsInFeatures(r,s);if(g(s),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(r,a,n);const{drapedObjectIds:l,failedObjectIds:h}=a,c=[];for(const _ of e){const{objectId:y}=_;l.has(y)&&_.type==="edge"&&(_.draped=!0),h.has(y)||c.push(_)}return c}_prepareQuery(e,t){const s=[],i=[];for(const[r,n]of e){const o=[];for(const a of n)this._addToQueriesOrCachedResult(r,a.target,o,i),a.type==="edge"&&(this._addToQueriesOrCachedResult(r,a.start,o,i),this._addToQueriesOrCachedResult(r,a.end,o,i));o.length!==0&&s.push({objectId:r,points:o})}return[{spatialReference:t.toJSON(),pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const r=k(e,t),n=this._alignmentsCache.get(r);n==null?s.push(t):i.push(new ze(t,n))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},r){for(const a of r)a.apply();let n=0;const o=this._alignmentsCache;for(const{objectId:a,points:l}of e.pointsInFeatures){if(i.has(a)){n+=l.length;continue}const h=!s.has(a);for(const c of l){const _=k(a,c),y=t[n++];c.z=y,h&&o.put(_,y,1)}}}};class ze{constructor(t,s){this.point=t,this.z=s}apply(){this.point.z=this.z}}function k(e,{x:t,y:s,z:i,spatialReference:r}){return`${e}-${t}-${s}-${i??0}}-wkid:${r?.wkid}`}function De(e,t,s){const{offset:i,unit:r}=s;if(i==null)return;const n=ae(t),o=i*(me(r??"meters")/n);for(const a of e)switch(a.type){case"edge":a.start.z+=o,a.end.z+=o;continue;case"vertex":a.target.z+=o;continue}}function Me(){return[]}let Ne=class{filter(e,t){return t}notifyElevationSourceChange(){}},je=class{filter(e,t){const{point:s,distance:i}=e,{z:r}=s;if(r==null||t.length===0)return t;const n=$e(i),o=this._updateCandidatesTo3D(t,s,n).filter(Ue);return o.sort(ke),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":qe(i,t,s);continue;case"vertex":Ve(i,t,s);continue}return e}};function Ue(e){return e.distance<=1}function L(e=!1){return e?new je:new Ne}function qe(e,t,{x:s,y:i,z:r}){const{start:n,end:o,target:a}=e;e.draped||Be(a,t,n,o);const l=(t.x-a.x)/s,h=(t.y-a.y)/i,c=(t.z-a.z)/r;e.distance=Math.sqrt(l*l+h*h+c*c)}function Be(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,o=i.z-s.z,a=r*r+n*n+o*o,l=(t.x-s.x)*r+(t.y-s.y)*n+o*(t.z-s.z),h=Math.min(1,Math.max(0,l/a)),c=s.x+r*h,_=s.y+n*h,y=s.z+o*h;e.x=c,e.y=_,e.z=y}function Ve(e,t,{x:s,y:i,z:r}){const{target:n}=e,o=(t.x-n.x)/s,a=(t.y-n.y)/i,l=(t.z-n.z)/r,h=Math.sqrt(o*o+a*a+l*l);e.distance=h}function $e(e){return typeof e=="number"?{x:e,y:e,z:e}:e}function ke(e,t){return e.distance-t.distance}function J(e=!1,t){return e?new Qe(t):new Le}class Le{async fetch(){return[]}notifySymbologyChange(){}}const Je=1024;let Qe=class{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new te(Je),this._cacheVersion=0}async fetch(e,t){if(e.length===0)return[];const s=[],i=[],r=this._candidatesCache;for(const c of e){const _=Q(c),y=r.get(_);if(y)for(const E of y)i.push(z(E));else s.push(c),r.put(_,[],1)}if(s.length===0)return i;const n=this._cacheVersion,{candidates:o,sourceCandidateIndices:a}=await this._getSymbologyCandidates(s,t);if(g(t),n!==this._cacheVersion)return this.fetch(e,t);const l=[],{length:h}=o;for(let c=0;c{const r=await B(s.fetchCount(this,i));this.state.type===u.FETCH_COUNT&&(this.state=Ge(this.state,r.ok?r.value:1/0))})}}_gotoFetchFeatures(t,s){return{type:u.FETCH_FEATURES,previous:t,task:b(async i=>{const r=await B(s.fetchFeatures(this,t.featureCount,i));this.state.type===u.FETCH_FEATURES&&(this.state=We(this.state,r.ok?r.value:[]))})}}_goToDone(t,s){return s.finish(this,t.features),{type:u.DONE,previous:t}}reset(){const t=this.state;switch(this.state={type:u.CREATED},t.type){case u.CREATED:case u.FETCHED_COUNT:case u.FETCHED_FEATURES:case u.DONE:break;case u.FETCH_COUNT:case u.FETCH_FEATURES:t.task.abort()}}intersects(t){return t==null||!this.data.extent||(H(t,Z),A(this.data.extent,Z))}}function Ge(e,t){return{type:u.FETCHED_COUNT,featureCount:t,previous:e}}function We(e,t){return{type:u.FETCHED_FEATURES,previous:e,features:t}}var u;(function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"})(u||(u={}));const Z=W();let f=class extends X{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=M(e,this._mandatoryOutFields);le(s,t)||(this._set("outFields",s),O(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(e!=null&&t!=null&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new ee}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,(e,t)=>{ue(e,t,({id:s},{id:i})=>s===i)||this._process()},K),this.addHandles(he(()=>!this.suspended,()=>this._process()))}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const i of this._pendingTiles.values())i.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:i,globalId:r})=>i&&i!==-1?i:this._lookupObjectIdByGlobalId(r))},s=b(async i=>{try{await this.store.processEdits(t,(r,n)=>this._queryFeaturesById(r,n),i),this._processPendingTiles()}catch(r){N(r),j.getLogger(this).warn("Failed to apply edits",r)}});this.addHandles(s),await this._updatingHandles.addPromise(s.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!Te(this.url))return;const e=b(async t=>{try{const s=await Se(this.url,new S({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:t});this.store.extent=ce.fromJSON(s.data?.extent)}catch(s){N(s),j.getLogger(this).warn("Failed to fetch data extent",s)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(e==null?1:e.coveredArea/e.fullArea),e!=null)for(const{data:t,resolution:s}of e.missingTiles){const i=this._pendingTiles.get(t.id);i?(i.resolution=s,i.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,(r,n)=>this._verifyTileComplexity(r,n),this.outFields);e==null?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(t,s)=>this._fetchCount(t,s),fetchFeatures:(t,s,i)=>this._fetchFeatures(t,s,i),finish:(t,s)=>this._finishPendingTile(t,s),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature{r===V(n.attributes[t])&&(i=n.objectId??n.attributes[s])}),i==null)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await be(this.url,e,new ve({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:w,signal:t});return Fe(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await Ie(this.url,e,s,{query:this._configuration.customParameters,timeout:w,signal:t});return Ce(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=e?.data!=null?this.store.getAttributesForTile(e?.data?.id):null,i=M(de(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,e!=null&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new S({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:this.tileInfo!=null&&e!=null?pe(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return s!=null&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?S.MAX_MAX_RECORD_COUNT_FACTOR:1,h=l*((a||r)&&n?n:o||Ke);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/h)),e.num=Math.min(s,e.maxRecordCountFactor*h)):e.num=Math.min(s,h),!0}};d([p({constructOnly:!0})],f.prototype,"url",void 0),d([p({constructOnly:!0})],f.prototype,"objectIdField",void 0),d([p({constructOnly:!0})],f.prototype,"globalIdField",void 0),d([p({constructOnly:!0})],f.prototype,"capabilities",void 0),d([p({constructOnly:!0})],f.prototype,"sourceSpatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"spatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"store",void 0),d([p({readOnly:!0})],f.prototype,"_minimumVerticesPerFeature",null),d([p()],f.prototype,"_mandatoryOutFields",null),d([p()],f.prototype,"outFields",null),d([p()],f.prototype,"suspended",void 0),d([p()],f.prototype,"_historicMoment",void 0),d([p()],f.prototype,"filter",null),d([p()],f.prototype,"customParameters",null),d([p({readOnly:!0})],f.prototype,"_configuration",null),d([p()],f.prototype,"tileInfo",null),d([p()],f.prototype,"tileSize",null),d([p()],f.prototype,"tilesOfInterest",void 0),d([p({readOnly:!0})],f.prototype,"updating",null),d([p({readOnly:!0})],f.prototype,"availability",void 0),d([p()],f.prototype,"hasZ",null),f=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],f);const Ke=2e3,w=6e5,Xe=1e6,Ye=25,et=1;class tt{constructor(){this._store=new Map,this._byteSize=0}set(t,s){this.delete(t),this._store.set(t,s),this._byteSize+=s.byteSize}delete(t){const s=this._store.get(t);return!!this._store.delete(t)&&(s!=null&&(this._byteSize-=s.byteSize),!0)}get(t){return this._used(t),this._store.get(t)}has(t){return this._used(t),this._store.has(t)}clear(){this._store.clear()}applyByteSizeLimit(t,s){for(const[i,r]of this._store){if(this._byteSize<=t)break;this.delete(i),s(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(t){const s=this._store.get(t);s&&(this._store.delete(t),this._store.set(t,s))}}let F=class extends X{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*Oe.MEGABYTES,this._tileBounds=new xe,this._tiles=new tt,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=W()}add(e,t){for(const r of t)this._referenceFeature(r.objectId);const s=this.featureStore.upsertMany(t),i=s.map(r=>new Set(Object.keys(r.attributes))).reduce((r,n)=>U(r,n),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map(r=>r.objectId)),it(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,r=>this._removeTileStorage(r))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}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(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const r=e.id;this._tiles.set(r,new ot(e,t,s,i)),this._tileBounds.set(r,e.extent),this._tileFeatureCounts.set(r,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)this._unreferenceFeature(i)===C.REMOVED&&t.push(i);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const o of i){const a=Ee(this._tmpBoundingRect,o.geometry,r,n);a!=null&&this._tileBounds.forEachInBounds(a,l=>{const h=this._tiles.get(l);this.featureStore.add(o);const c=o.objectId;h.objectIds.has(c)||(h.objectIds.add(c),this._referenceFeature(c),this._tileFeatureCounts.set(h.data.id,h.objectIds.size))})}}process(e,t=()=>!0,s){if(this.tileInfo==null||!e.extent||this.extent!=null&&!A(H(this.extent,this._tmpBoundingRect),e.extent))return new x(e);const i=this.getAttributesForTile(e.id);if(O(s,i))return new x(e);const r=this._createTileTree(e,this.tileInfo);return this._simplify(r,t,null,0,1),this._collectMissingTiles(e,r,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(r!=null)return r;const n=await we(t,s,i);return this._tileFeatureCounts.set(e.id,n.data.count),n.data.count}_createTileTree(e,t){const s=new G(e.level,e.row,e.col);return t.updateTileInfo(s,I.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.data;r&&st(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const n=t.row>>r,o=t.col>>r,a=e.row<<1,l=o-(e.col<<1)+(n-a<<1),h=e.children[l];if(h!=null)this._populateChildren(h,t,s,i);else{const c=new G(e.level+1,n,o);s.updateTileInfo(c,I.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=c,this._populateChildren(c,t,s,i)}}_simplify(e,t,s,i,r){const n=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),s!=null&&(s.children[i]=null),n);const o=r/2,a=o*o;let l=0;for(let h=0;h{const n=this._tiles.get(r.id);if(n){s=s?U(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const o of n.objectIds)t.has(o)||(t.add(o),this._referenceFeature(o));this._remove(r)}}),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)s!=null&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(e!=null)if(e.isLeaf)this._remove(e);else for(let t=0;t>1),(e.col<<1)+(1&a),o):this._collectMissingTilesRecurse(l,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),t===1?C.ADDED:C.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return t===0?(this._refCounts.delete(e),C.REMOVED):(t>0&&this._refCounts.set(e,t),C.UNCHANGED)}get test(){}};function st(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.levelt+rt(s),0)}function rt(e){return 32+nt(e.geometry)+fe(e.attributes)}function nt(e){if(e==null)return 0;const t=q(e.lengths,4);return 32+q(e.coords,8)+t}d([p({constructOnly:!0})],F.prototype,"featureStore",void 0),d([p()],F.prototype,"tileInfo",void 0),d([p()],F.prototype,"extent",void 0),d([p()],F.prototype,"maximumByteSize",void 0),F=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],F);let ot=class{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}};class G{constructor(t,s,i){this.level=t,this.row=s,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}}let x=class{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=Y(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}},at=class{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new x(t),s!=null&&(this._extent=H(s))}addMissing(e,t,s,i){const r=new Re(null,e,t,s);this._tileInfo.updateTileInfo(r,I.ExtrapolateOptions.POWER_OF_TWO),r.extent==null||this._extent!=null&&!A(this._extent,r.extent)||(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=Y(r.extent))}};const lt=.18751;var C;(function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"})(C||(C={}));let T=class extends se.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=ie(),this._elevationAligner=$(),this._elevationFilter=L(),this._symbologyCandidatesFetcher=J(),this._updatingHandles=new ee,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return g(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return g(t),i}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:r}=e.serviceInfo,{hasZ:n}=e,o=v.fromJSON(e.spatialReference);this._spatialReference=o,this._featureStore=new _e({...e.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new ge({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new f({store:new F({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:o,sourceSpatialReference:v.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const a=e.configuration.viewType==="3d";return this._elevationAligner=$(a,{elevationInfo:e.elevationInfo!=null?ye.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=L(a),this.addHandles([P(()=>this._featureFetcher.availability,l=>this.emit("notify-availability",{availability:l}),K),P(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),m}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.suspended=e,m}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.outFields=new Set(e??[]),m}async fetchCandidates(e,t){await this._whenSetup.promise,g(t);const s=ut(e),i=t?.signal,r=await this._queryEngine.executeQueryForSnapping(s,i);g(i);const n=await this._elevationAligner.alignCandidates(r.candidates,v.fromJSON(e.point.spatialReference)??v.WGS84,i);g(i);const o=await this._symbologyCandidatesFetcher.fetch(n,i);g(i);const a=o.length===0?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(s,a)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=e.tileInfo!=null?I.fromJSON(e.tileInfo):null,m}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.refresh(),m}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await re(()=>!this.updating,t),g(t),m}async getDebugInfo(e,t){return g(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),g(t),m}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),m}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),m}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),m}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=J(e,this._getSymbologyCandidates),m}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=e.filter!=null?S.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};d([p({readOnly:!0})],T.prototype,"updating",null),d([p()],T.prototype,"_isInitializing",void 0),T=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],T);const _s=T;function ut(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:r,timeExtent:n,objectIds:o}=e.filter,a={geometry:e.filter.geometry?ne(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:n,objectIds:o,where:r??"1=1"};return{...e,query:a}}const m={result:{}};export{_s as default}; +import{bh as W,v as d,S as p,i as R,I as se,b as ie,$ as g,J as v,ah as P,av as K,aw as re,g as ne,an as oe,dh as ae,P as z,hm as D,j as X,hn as M,ho as le,hp as O,hq as ue,aF as he,ay as b,W as N,a1 as j,n as ce,hr as de,gI as pe,hs as U,ht as A,gH as H,hu as fe,hv as q,hw as Y,ec as B}from"./story-Doly9N9p.js";import{i as ee}from"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import{I as _e}from"./FeatureStore-Co2V0sVE-BK6XAR3o.js";import{Z as ge}from"./QueryEngine-CH5uUhZK-DRGPyg2C.js";import{V as I}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import{b as S}from"./Query-BrwMGK8U-BPr0_G9t.js";import{q as ye,j as me}from"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import{b as te}from"./LRUCache-C3erQTWv-grHgYSP-.js";import{s as V}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{L as Fe,q as Ce,V as Ee}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{L as Te}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{U as ve}from"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import{w as Se,J as be,q as Ie,P as we}from"./query-DFW9-NG_-C3TyGmiM.js";import{G as Oe}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{r as xe}from"./BoundsStore--N6o1xkF-CQrhMeDa.js";import{e as Re}from"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./main-QGPoLsvl.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js";import"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./utils-HtkT8Fn3-Dd_0rdy5.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-1ITtOELE.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./utils-tNxq3jkf-nfQcZo7O.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./PooledRBush-DbfAmeLn-CPHfm9op.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";function $(e=!1,t){if(e){const{elevationInfo:s,alignPointsInFeatures:i}=t;return new Pe(s,i)}return new Ae}let Ae=class{async alignCandidates(e,t,s){return e}notifyElevationSourceChange(){}};const He=1024;let Pe=class{constructor(e,t){this._elevationInfo=e,this._alignPointsInFeatures=t,this._alignmentsCache=new te(He),this._cacheVersion=0}async alignCandidates(e,t,s){const i=this._elevationInfo;return i==null||i.mode!=="absolute-height"||i.featureExpressionInfo?this._alignComputedElevationCandidates(e,t,s):(De(e,t,i),e)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}async _alignComputedElevationCandidates(e,t,s){const i=new Map;for(const _ of e)oe(i,_.objectId,Me).push(_);const[r,n,o]=this._prepareQuery(i,t),a=await this._alignPointsInFeatures(r,s);if(g(s),o!==this._cacheVersion)return this._alignComputedElevationCandidates(e,t,s);this._applyCacheAndResponse(r,a,n);const{drapedObjectIds:l,failedObjectIds:h}=a,c=[];for(const _ of e){const{objectId:y}=_;l.has(y)&&_.type==="edge"&&(_.draped=!0),h.has(y)||c.push(_)}return c}_prepareQuery(e,t){const s=[],i=[];for(const[r,n]of e){const o=[];for(const a of n)this._addToQueriesOrCachedResult(r,a.target,o,i),a.type==="edge"&&(this._addToQueriesOrCachedResult(r,a.start,o,i),this._addToQueriesOrCachedResult(r,a.end,o,i));o.length!==0&&s.push({objectId:r,points:o})}return[{spatialReference:t.toJSON(),pointsInFeatures:s},i,this._cacheVersion]}_addToQueriesOrCachedResult(e,t,s,i){const r=k(e,t),n=this._alignmentsCache.get(r);n==null?s.push(t):i.push(new ze(t,n))}_applyCacheAndResponse(e,{elevations:t,drapedObjectIds:s,failedObjectIds:i},r){for(const a of r)a.apply();let n=0;const o=this._alignmentsCache;for(const{objectId:a,points:l}of e.pointsInFeatures){if(i.has(a)){n+=l.length;continue}const h=!s.has(a);for(const c of l){const _=k(a,c),y=t[n++];c.z=y,h&&o.put(_,y,1)}}}};class ze{constructor(t,s){this.point=t,this.z=s}apply(){this.point.z=this.z}}function k(e,{x:t,y:s,z:i,spatialReference:r}){return`${e}-${t}-${s}-${i??0}}-wkid:${r?.wkid}`}function De(e,t,s){const{offset:i,unit:r}=s;if(i==null)return;const n=ae(t),o=i*(me(r??"meters")/n);for(const a of e)switch(a.type){case"edge":a.start.z+=o,a.end.z+=o;continue;case"vertex":a.target.z+=o;continue}}function Me(){return[]}let Ne=class{filter(e,t){return t}notifyElevationSourceChange(){}},je=class{filter(e,t){const{point:s,distance:i}=e,{z:r}=s;if(r==null||t.length===0)return t;const n=$e(i),o=this._updateCandidatesTo3D(t,s,n).filter(Ue);return o.sort(ke),o}_updateCandidatesTo3D(e,t,s){for(const i of e)switch(i.type){case"edge":qe(i,t,s);continue;case"vertex":Ve(i,t,s);continue}return e}};function Ue(e){return e.distance<=1}function L(e=!1){return e?new je:new Ne}function qe(e,t,{x:s,y:i,z:r}){const{start:n,end:o,target:a}=e;e.draped||Be(a,t,n,o);const l=(t.x-a.x)/s,h=(t.y-a.y)/i,c=(t.z-a.z)/r;e.distance=Math.sqrt(l*l+h*h+c*c)}function Be(e,t,s,i){const r=i.x-s.x,n=i.y-s.y,o=i.z-s.z,a=r*r+n*n+o*o,l=(t.x-s.x)*r+(t.y-s.y)*n+o*(t.z-s.z),h=Math.min(1,Math.max(0,l/a)),c=s.x+r*h,_=s.y+n*h,y=s.z+o*h;e.x=c,e.y=_,e.z=y}function Ve(e,t,{x:s,y:i,z:r}){const{target:n}=e,o=(t.x-n.x)/s,a=(t.y-n.y)/i,l=(t.z-n.z)/r,h=Math.sqrt(o*o+a*a+l*l);e.distance=h}function $e(e){return typeof e=="number"?{x:e,y:e,z:e}:e}function ke(e,t){return e.distance-t.distance}function J(e=!1,t){return e?new Qe(t):new Le}class Le{async fetch(){return[]}notifySymbologyChange(){}}const Je=1024;let Qe=class{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new te(Je),this._cacheVersion=0}async fetch(e,t){if(e.length===0)return[];const s=[],i=[],r=this._candidatesCache;for(const c of e){const _=Q(c),y=r.get(_);if(y)for(const E of y)i.push(z(E));else s.push(c),r.put(_,[],1)}if(s.length===0)return i;const n=this._cacheVersion,{candidates:o,sourceCandidateIndices:a}=await this._getSymbologyCandidates(s,t);if(g(t),n!==this._cacheVersion)return this.fetch(e,t);const l=[],{length:h}=o;for(let c=0;c{const r=await B(s.fetchCount(this,i));this.state.type===u.FETCH_COUNT&&(this.state=Ge(this.state,r.ok?r.value:1/0))})}}_gotoFetchFeatures(t,s){return{type:u.FETCH_FEATURES,previous:t,task:b(async i=>{const r=await B(s.fetchFeatures(this,t.featureCount,i));this.state.type===u.FETCH_FEATURES&&(this.state=We(this.state,r.ok?r.value:[]))})}}_goToDone(t,s){return s.finish(this,t.features),{type:u.DONE,previous:t}}reset(){const t=this.state;switch(this.state={type:u.CREATED},t.type){case u.CREATED:case u.FETCHED_COUNT:case u.FETCHED_FEATURES:case u.DONE:break;case u.FETCH_COUNT:case u.FETCH_FEATURES:t.task.abort()}}intersects(t){return t==null||!this.data.extent||(H(t,Z),A(this.data.extent,Z))}}function Ge(e,t){return{type:u.FETCHED_COUNT,featureCount:t,previous:e}}function We(e,t){return{type:u.FETCHED_FEATURES,previous:e,features:t}}var u;(function(e){e[e.CREATED=0]="CREATED",e[e.FETCH_COUNT=1]="FETCH_COUNT",e[e.FETCHED_COUNT=2]="FETCHED_COUNT",e[e.FETCH_FEATURES=3]="FETCH_FEATURES",e[e.FETCHED_FEATURES=4]="FETCHED_FEATURES",e[e.DONE=5]="DONE"})(u||(u={}));const Z=W();let f=class extends X{get _minimumVerticesPerFeature(){switch(this.store?.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}get _mandatoryOutFields(){const e=new Set;return this.objectIdField&&e.add(this.objectIdField),this.globalIdField&&e.add(this.globalIdField),e}set outFields(e){const t=this._get("outFields"),s=M(e,this._mandatoryOutFields);le(s,t)||(this._set("outFields",s),O(s,t)||this.refresh())}get outFields(){return this._get("outFields")??this._mandatoryOutFields}set filter(e){const t=this._get("filter"),s=this._filterProperties(e);JSON.stringify(t)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(e){const t=this._get("customParameters");JSON.stringify(t)!==JSON.stringify(e)&&this._set("customParameters",e)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(e){const t=this._get("tileInfo");t!==e&&(e!=null&&t!=null&&JSON.stringify(e)===JSON.stringify(t)||(this._set("tileInfo",e),this.store.tileInfo=e))}set tileSize(e){this._get("tileSize")!==e&&this._set("tileSize",e)}get updating(){return this._updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}constructor(e){super(e),this.suspended=!0,this._historicMoment=null,this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._updatingHandles=new ee}initialize(){this._initializeFetchExtent(),this._updatingHandles.add(()=>this._configuration,()=>this.refresh()),this._updatingHandles.add(()=>this.tilesOfInterest,(e,t)=>{ue(e,t,({id:s},{id:i})=>s===i)||this._process()},K),this.addHandles(he(()=>!this.suspended,()=>this._process()))}destroy(){this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._updatingHandles.destroy()}refresh(){this.store.refresh(),this._pendingTiles.forEach(e=>this._deletePendingTile(e)),this._process()}async handleEdits(e){if(e.historicMoment&&(this._historicMoment=e.historicMoment),!e.addedFeatures.length&&!e.updatedFeatures.length&&!e.deletedFeatures.length)return;for(const i of this._pendingTiles.values())i.reset();const t={...e,deletedFeatures:e.deletedFeatures.map(({objectId:i,globalId:r})=>i&&i!==-1?i:this._lookupObjectIdByGlobalId(r))},s=b(async i=>{try{await this.store.processEdits(t,(r,n)=>this._queryFeaturesById(r,n),i),this._processPendingTiles()}catch(r){N(r),j.getLogger(this).warn("Failed to apply edits",r)}});this.addHandles(s),await this._updatingHandles.addPromise(s.promise)}setHistoricMoment(e){e?.getTime()!==this._historicMoment?.getTime()&&(this._historicMoment=e,this.refresh())}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!Te(this.url))return;const e=b(async t=>{try{const s=await Se(this.url,new S({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:this.capabilities.query.supportsCacheHint??void 0}),{query:this._configuration.customParameters,signal:t});this.store.extent=ce.fromJSON(s.data?.extent)}catch(s){N(s),j.getLogger(this).warn("Failed to fetch data extent",s)}});this._updatingHandles.addPromise(e.promise.then(()=>this._process())),this.addHandles(e)}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(e=>e.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const e of this._pendingTiles.values())e.alive=!1}_createPendingTiles(){if(this.suspended)return;const e=this._collectMissingTilesInfo();if(this._setAvailability(e==null?1:e.coveredArea/e.fullArea),e!=null)for(const{data:t,resolution:s}of e.missingTiles){const i=this._pendingTiles.get(t.id);i?(i.resolution=s,i.alive=!0):this._createPendingTile(t,s)}}_collectMissingTilesInfo(){let e=null;for(let t=this.tilesOfInterest.length-1;t>=0;t--){const s=this.tilesOfInterest[t],i=this.store.process(s,(r,n)=>this._verifyTileComplexity(r,n),this.outFields);e==null?e=i:e.prepend(i)}return e}_deletePendingTiles(){for(const e of this._pendingTiles.values())e.alive||this._deletePendingTile(e)}_processPendingTiles(){const e={fetchCount:(t,s)=>this._fetchCount(t,s),fetchFeatures:(t,s,i)=>this._fetchFeatures(t,s,i),finish:(t,s)=>this._finishPendingTile(t,s),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(e))for(const t of this._pendingTiles.values())this._verifyTileComplexity(this.store.getFeatureCount(t.data),t.resolution)&&this._updatingHandles.addPromise(t.process(e))}_verifyTileComplexity(e,t){return this._verifyVertexComplexity(e)&&this._verifyFeatureDensity(e,t)}_verifyVertexComplexity(e){return e*this._minimumVerticesPerFeature{r===V(n.attributes[t])&&(i=n.objectId??n.attributes[s])}),i==null)throw new Error(`Expected to find a feature with globalId ${e}`);return i}_queryFeaturesById(e,t){const s=this._createFeaturesQuery();return s.objectIds=e,this._queryFeatures(s,t)}_queryFeatures(e,t){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(e,t):this._queryFeaturesJSON(e,t)}async _queryFeaturesPBF(e,t){const{sourceSpatialReference:s}=this,{data:i}=await be(this.url,e,new ve({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:w,signal:t});return Fe(i)}async _queryFeaturesJSON(e,t){const{sourceSpatialReference:s}=this,{data:i}=await Ie(this.url,e,s,{query:this._configuration.customParameters,timeout:w,signal:t});return Ce(i,this.objectIdField)}_createCountQuery(e){const t=this._createBaseQuery(e);return this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0),t}_createFeaturesQuery(e=null){const t=this._createBaseQuery(e),s=e?.data!=null?this.store.getAttributesForTile(e?.data?.id):null,i=M(de(this.outFields,s??new Set),this._mandatoryOutFields);return t.outFields=Array.from(i),t.returnGeometry=!0,e!=null&&(this.capabilities.query.supportsResultType?t.resultType="tile":this.capabilities.query.supportsCacheHint&&(t.cacheHint=!0)),t}_createBaseQuery(e){const t=new S({returnZ:this.hasZ,returnM:!1,historicMoment:this._historicMoment,geometry:this.tileInfo!=null&&e!=null?pe(e.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return s!=null&&(t.where=s.where,t.gdbVersion=s.gdbVersion,t.timeExtent=s.timeExtent),t.outSpatialReference=this.spatialReference,t}_setPagingParameters(e,t,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:o,supportsResultType:a}=this.capabilities.query,l=i?S.MAX_MAX_RECORD_COUNT_FACTOR:1,h=l*((a||r)&&n?n:o||Ke);return e.start=t,i?(e.maxRecordCountFactor=Math.min(l,Math.ceil(s/h)),e.num=Math.min(s,e.maxRecordCountFactor*h)):e.num=Math.min(s,h),!0}};d([p({constructOnly:!0})],f.prototype,"url",void 0),d([p({constructOnly:!0})],f.prototype,"objectIdField",void 0),d([p({constructOnly:!0})],f.prototype,"globalIdField",void 0),d([p({constructOnly:!0})],f.prototype,"capabilities",void 0),d([p({constructOnly:!0})],f.prototype,"sourceSpatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"spatialReference",void 0),d([p({constructOnly:!0})],f.prototype,"store",void 0),d([p({readOnly:!0})],f.prototype,"_minimumVerticesPerFeature",null),d([p()],f.prototype,"_mandatoryOutFields",null),d([p()],f.prototype,"outFields",null),d([p()],f.prototype,"suspended",void 0),d([p()],f.prototype,"_historicMoment",void 0),d([p()],f.prototype,"filter",null),d([p()],f.prototype,"customParameters",null),d([p({readOnly:!0})],f.prototype,"_configuration",null),d([p()],f.prototype,"tileInfo",null),d([p()],f.prototype,"tileSize",null),d([p()],f.prototype,"tilesOfInterest",void 0),d([p({readOnly:!0})],f.prototype,"updating",null),d([p({readOnly:!0})],f.prototype,"availability",void 0),d([p()],f.prototype,"hasZ",null),f=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],f);const Ke=2e3,w=6e5,Xe=1e6,Ye=25,et=1;class tt{constructor(){this._store=new Map,this._byteSize=0}set(t,s){this.delete(t),this._store.set(t,s),this._byteSize+=s.byteSize}delete(t){const s=this._store.get(t);return!!this._store.delete(t)&&(s!=null&&(this._byteSize-=s.byteSize),!0)}get(t){return this._used(t),this._store.get(t)}has(t){return this._used(t),this._store.has(t)}clear(){this._store.clear()}applyByteSizeLimit(t,s){for(const[i,r]of this._store){if(this._byteSize<=t)break;this.delete(i),s(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(t){const s=this._store.get(t);s&&(this._store.delete(t),this._store.set(t,s))}}let F=class extends X{constructor(e){super(e),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*Oe.MEGABYTES,this._tileBounds=new xe,this._tiles=new tt,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=W()}add(e,t){for(const r of t)this._referenceFeature(r.objectId);const s=this.featureStore.upsertMany(t),i=s.map(r=>new Set(Object.keys(r.attributes))).reduce((r,n)=>U(r,n),new Set(Object.keys(s[0]?.attributes??[])));this._addTileStorage(e,new Set(s.map(r=>r.objectId)),it(s),i),this._tiles.applyByteSizeLimit(this.maximumByteSize,r=>this._removeTileStorage(r))}getAttributesForTile(e){return e?this._tiles.get(e)?.attributeKeys:null}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(e,t,s){return this._processEditsDelete(e.deletedFeatures.concat(e.updatedFeatures)),this._processEditsRefetch(e.addedFeatures.concat(e.updatedFeatures),t,s)}_addTileStorage(e,t,s,i){const r=e.id;this._tiles.set(r,new ot(e,t,s,i)),this._tileBounds.set(r,e.extent),this._tileFeatureCounts.set(r,t.size)}_remove({id:e}){const t=this._tiles.get(e);t&&this._removeTileStorage(t)}_removeTileStorage(e){const t=[];for(const i of e.objectIds)this._unreferenceFeature(i)===C.REMOVED&&t.push(i);this.featureStore.removeManyById(t);const s=e.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(e){this.featureStore.removeManyById(e);for(const t of this._tiles.values()){for(const s of e)t.objectIds.delete(s);this._tileFeatureCounts.set(t.data.id,t.objectIds.size)}for(const t of e)this._refCounts.delete(t)}async _processEditsRefetch(e,t,s){if(!e.length)return;const i=(await t(e,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const o of i){const a=Ee(this._tmpBoundingRect,o.geometry,r,n);a!=null&&this._tileBounds.forEachInBounds(a,l=>{const h=this._tiles.get(l);this.featureStore.add(o);const c=o.objectId;h.objectIds.has(c)||(h.objectIds.add(c),this._referenceFeature(c),this._tileFeatureCounts.set(h.data.id,h.objectIds.size))})}}process(e,t=()=>!0,s){if(this.tileInfo==null||!e.extent||this.extent!=null&&!A(H(this.extent,this._tmpBoundingRect),e.extent))return new x(e);const i=this.getAttributesForTile(e.id);if(O(s,i))return new x(e);const r=this._createTileTree(e,this.tileInfo);return this._simplify(r,t,null,0,1),this._collectMissingTiles(e,r,this.tileInfo,s)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:e})=>({data:e,featureCount:this._tileFeatureCounts.get(e.id)||0}))}getFeatureCount(e){return this._tileFeatureCounts.get(e.id)??0}async fetchCount(e,t,s,i){const r=this._tileFeatureCounts.get(e.id);if(r!=null)return r;const n=await we(t,s,i);return this._tileFeatureCounts.set(e.id,n.data.count),n.data.count}_createTileTree(e,t){const s=new G(e.level,e.row,e.col);return t.updateTileInfo(s,I.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(e.extent,i=>{const r=this._tiles.get(i)?.data;r&&st(e,r)&&this._populateChildren(s,r,t,this._tileFeatureCounts.get(r.id)||0)}),s}_populateChildren(e,t,s,i){const r=t.level-e.level-1;if(r<0)return void(e.isLeaf=!0);const n=t.row>>r,o=t.col>>r,a=e.row<<1,l=o-(e.col<<1)+(n-a<<1),h=e.children[l];if(h!=null)this._populateChildren(h,t,s,i);else{const c=new G(e.level+1,n,o);s.updateTileInfo(c,I.ExtrapolateOptions.POWER_OF_TWO),e.children[l]=c,this._populateChildren(c,t,s,i)}}_simplify(e,t,s,i,r){const n=r*r;if(e.isLeaf)return t(this.getFeatureCount(e),r)?0:(this._remove(e),s!=null&&(s.children[i]=null),n);const o=r/2,a=o*o;let l=0;for(let h=0;h{const n=this._tiles.get(r.id);if(n){s=s?U(s,n.attributeKeys):new Set(n.attributeKeys),i+=n.byteSize;for(const o of n.objectIds)t.has(o)||(t.add(o),this._referenceFeature(o));this._remove(r)}}),this._addTileStorage(e,t,i,s??new Set),e.isLeaf=!0,e.children[0]=e.children[1]=e.children[2]=e.children[3]=null,this._tileFeatureCounts.set(e.id,t.size)}_forEachLeaf(e,t){for(const s of e.children)s!=null&&(s.isLeaf?t(s):this._forEachLeaf(s,t))}_purge(e){if(e!=null)if(e.isLeaf)this._remove(e);else for(let t=0;t>1),(e.col<<1)+(1&a),o):this._collectMissingTilesRecurse(l,t,o,i)}}_referenceFeature(e){const t=(this._refCounts.get(e)||0)+1;return this._refCounts.set(e,t),t===1?C.ADDED:C.UNCHANGED}_unreferenceFeature(e){const t=(this._refCounts.get(e)||0)-1;return t===0?(this._refCounts.delete(e),C.REMOVED):(t>0&&this._refCounts.set(e,t),C.UNCHANGED)}get test(){}};function st(e,t){if(!e||!t)return!1;if(e.level===t.level)return e.row===t.row&&e.col===t.col;const s=e.levelt+rt(s),0)}function rt(e){return 32+nt(e.geometry)+fe(e.attributes)}function nt(e){if(e==null)return 0;const t=q(e.lengths,4);return 32+q(e.coords,8)+t}d([p({constructOnly:!0})],F.prototype,"featureStore",void 0),d([p()],F.prototype,"tileInfo",void 0),d([p()],F.prototype,"extent",void 0),d([p()],F.prototype,"maximumByteSize",void 0),F=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],F);let ot=class{constructor(e,t,s,i){this.data=e,this.objectIds=t,this.byteSize=s,this.attributeKeys=i}};class G{constructor(t,s,i){this.level=t,this.row=s,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(this.children[0]!=null||this.children[1]!=null||this.children[2]!=null||this.children[3]!=null)}}let x=class{constructor(e,t=[]){this.missingTiles=t,this.fullArea=0,this.coveredArea=0,this.fullArea=Y(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}},at=class{constructor(e,t,s){this._tileInfo=e,this._extent=null,this.info=new x(t),s!=null&&(this._extent=H(s))}addMissing(e,t,s,i){const r=new Re(null,e,t,s);this._tileInfo.updateTileInfo(r,I.ExtrapolateOptions.POWER_OF_TWO),r.extent==null||this._extent!=null&&!A(this._extent,r.extent)||(this.info.missingTiles.push({data:r,resolution:i}),this.info.coveredArea-=Y(r.extent))}};const lt=.18751;var C;(function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.UNCHANGED=2]="UNCHANGED"})(C||(C={}));let T=class extends se.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=ie(),this._elevationAligner=$(),this._elevationFilter=L(),this._symbologyCandidatesFetcher=J(),this._updatingHandles=new ee,this._alignPointsInFeatures=async(e,t)=>{const s={query:e},i=await this.remoteClient.invoke("alignElevation",s,{signal:t});return g(t),i},this._getSymbologyCandidates=async(e,t)=>{const s={candidates:e,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:t});return g(t),i}}get updating(){return this._isInitializing||this._updatingHandles.updating||this._featureFetcher.updating}destroy(){this._featureFetcher?.destroy(),this._queryEngine?.destroy(),this._featureStore?.clear()}async setup(e){if(this.destroyed)return{result:{}};const{geometryType:t,objectIdField:s,timeInfo:i,fieldsIndex:r}=e.serviceInfo,{hasZ:n}=e,o=v.fromJSON(e.spatialReference);this._spatialReference=o,this._featureStore=new _e({...e.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new ge({spatialReference:e.spatialReference,featureStore:this._featureStore,geometryType:t,fieldsIndex:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i}),this._featureFetcher=new f({store:new F({featureStore:this._featureStore}),url:e.serviceInfo.url,objectIdField:e.serviceInfo.objectIdField,globalIdField:e.serviceInfo.globalIdField,capabilities:e.serviceInfo.capabilities,spatialReference:o,sourceSpatialReference:v.fromJSON(e.serviceInfo.spatialReference),customParameters:e.configuration.customParameters});const a=e.configuration.viewType==="3d";return this._elevationAligner=$(a,{elevationInfo:e.elevationInfo!=null?ye.fromJSON(e.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures}),this._elevationFilter=L(a),this.addHandles([P(()=>this._featureFetcher.availability,l=>this.emit("notify-availability",{availability:l}),K),P(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(e.configuration)}async configure(e){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(e),m}async setSuspended(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.suspended=e,m}async updateOutFields(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.outFields=new Set(e??[]),m}async fetchCandidates(e,t){await this._whenSetup.promise,g(t);const s=ut(e),i=t?.signal,r=await this._queryEngine.executeQueryForSnapping(s,i);g(i);const n=await this._elevationAligner.alignCandidates(r.candidates,v.fromJSON(e.point.spatialReference)??v.WGS84,i);g(i);const o=await this._symbologyCandidatesFetcher.fetch(n,i);g(i);const a=o.length===0?n:n.concat(o);return{result:{candidates:this._elevationFilter.filter(s,a)}}}async updateTiles(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.tileSize=e.tileSize,this._featureFetcher.tilesOfInterest=e.tiles,this._featureFetcher.tileInfo=e.tileInfo!=null?I.fromJSON(e.tileInfo):null,m}async refresh(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),this._featureFetcher.refresh(),m}async whenNotUpdating(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await re(()=>!this.updating,t),g(t),m}async getDebugInfo(e,t){return g(t),{result:this._featureFetcher.debugInfo}}async handleEdits(e,t){return await this._updatingHandles.addPromise(this._whenSetup.promise),g(t),await this._updatingHandles.addPromise(this._featureFetcher.handleEdits(e)),g(t),m}async setHistoricMoment(e,t){return this._featureFetcher.setHistoricMoment(e.moment),m}async notifyElevationSourceChange(e,t){return this._elevationAligner.notifyElevationSourceChange(),m}async notifySymbologyChange(e,t){return this._symbologyCandidatesFetcher.notifySymbologyChange(),m}async setSymbologySnappingSupported(e){return this._symbologyCandidatesFetcher=J(e,this._getSymbologyCandidates),m}_updateFeatureFetcherConfiguration(e){this._featureFetcher.filter=e.filter!=null?S.fromJSON(e.filter):null,this._featureFetcher.customParameters=e.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};d([p({readOnly:!0})],T.prototype,"updating",null),d([p()],T.prototype,"_isInitializing",void 0),T=d([R("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],T);const _s=T;function ut(e){if(!e.filter)return{...e,query:{where:"1=1"}};const{distance:t,units:s,spatialRel:i,where:r,timeExtent:n,objectIds:o}=e.filter,a={geometry:e.filter.geometry?ne(e.filter.geometry):void 0,distance:t,units:s,spatialRel:i,timeExtent:n,objectIds:o,where:r??"1=1"};return{...e,query:a}}const m={result:{}};export{_s as default}; diff --git a/custom-toc-highlight/assets/FeatureSet-BkVNthuN-CwS44--W.js b/custom-toc-highlight/assets/FeatureSet-BkVNthuN-DPQqwkNN.js similarity index 97% rename from custom-toc-highlight/assets/FeatureSet-BkVNthuN-CwS44--W.js rename to custom-toc-highlight/assets/FeatureSet-BkVNthuN-DPQqwkNN.js index 2568146f..9b7b3735 100644 --- a/custom-toc-highlight/assets/FeatureSet-BkVNthuN-CwS44--W.js +++ b/custom-toc-highlight/assets/FeatureSet-BkVNthuN-DPQqwkNN.js @@ -1 +1 @@ -import{aK as T,v as h,S as d,bi as S,a0 as G,ac as z,af as N,J as R,i as P,e as j,g as F,P as J,ca as x}from"./story-BfX8CRfG.js";import{y as q}from"./Field-C6hA1tZj-CpGOU6Y4.js";var v;const w=new T({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let c=v=class extends j{constructor(n){super(n),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(n,a){const o=R.fromJSON(a.spatialReference),e=[];for(let s=0;s0)for(let o=0;oMath.round((t-e)/a),i=t=>Math.round((s-t)/o),m=this.features,u=this._getQuantizationFunction(this.geometryType,r,i);for(let t=0,y=m.length;tp*r+e,u=p=>s-p*i;let t=null,y=null;if(this.hasZ&&o?.scale?.[2]!=null){const{translate:[,,p],scale:[,,g]}=o;t=f=>f*g+p}if(this.hasM&&o?.scale?.[3]!=null){const{translate:[,,,p],scale:[,,,g]}=o;y=f=>f==null?f:f*g+p}const l=this._getHydrationFunction(n,m,u,t,y);for(const{geometry:p}of a)p!=null&&l&&l(p);return this.transform=null,this}_quantizePoints(n,a,o){let e,s;const r=[];for(let i=0,m=n.length;i0){const t=a(u[0]),y=o(u[1]);t===e&&y===s||(r.push([t-e,y-s]),e=t,s=y)}else e=a(u[0]),s=o(u[1]),r.push([e,s])}return r.length>0?r:null}_getQuantizationFunction(n,a,o){return n==="point"?e=>(e.x=a(e.x),e.y=o(e.y),e):n==="polyline"||n==="polygon"?e=>{const s=x(e)?e.rings:e.paths,r=[];for(let i=0,m=s.length;i0?(x(e)?e.rings=r:e.paths=r,e):null}:n==="multipoint"?e=>{const s=this._quantizePoints(e.points,a,o);return s&&s.length>0?(e.points=s,e):null}:n==="extent"?e=>e:null}_getHydrationFunction(n,a,o,e,s){return n==="point"?r=>{r.x=a(r.x),r.y=o(r.y),e&&(r.z=e(r.z))}:n==="polyline"||n==="polygon"?r=>{const i=x(r)?r.rings:r.paths;let m,u;for(let t=0,y=i.length;t0?(m+=f[0],u+=f[1]):(m=f[0],u=f[1]),f[0]=a(m),f[1]=o(u)}}if(e&&s)for(let t=0,y=i.length;t{r.xmin=a(r.xmin),r.ymin=o(r.ymin),r.xmax=a(r.xmax),r.ymax=o(r.ymax),e&&r.zmax!=null&&r.zmin!=null&&(r.zmax=e(r.zmax),r.zmin=e(r.zmin)),s&&r.mmax!=null&&r.mmin!=null&&(r.mmax=s(r.mmax),r.mmin=s(r.mmin))}:n==="multipoint"?r=>{const i=r.points;let m,u;for(let t=0,y=i.length;t0?(m+=l[0],u+=l[1]):(m=l[0],u=l[1]),l[0]=a(m),l[1]=o(u)}if(e&&s)for(let t=0,y=i.length;t({enabled:n})}}})],c.prototype,"exceededTransferLimit",void 0),h([d({type:[S],json:{write:!0}})],c.prototype,"features",void 0),h([G("features")],c.prototype,"readFeatures",null),h([d({type:[q],json:{write:!0}})],c.prototype,"fields",void 0),h([d({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],c.prototype,"geometryType",void 0),h([z("geometryType")],c.prototype,"writeGeometryType",null),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasM",void 0),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasZ",void 0),h([d({types:N,json:{write:!0}})],c.prototype,"queryGeometry",void 0),h([G("queryGeometry")],c.prototype,"readQueryGeometry",null),h([d({type:R,json:{write:!0}})],c.prototype,"spatialReference",void 0),h([z("spatialReference")],c.prototype,"writeSpatialReference",null),h([d({json:{write:!0}})],c.prototype,"transform",void 0),c=v=h([P("esri.rest.support.FeatureSet")],c),c.prototype.toJSON.isDefaultToJSON=!0;const M=c;export{M as O}; +import{aK as T,v as h,S as d,bi as S,a0 as G,ac as z,af as N,J as R,i as P,e as j,g as F,P as J,ca as x}from"./story-Doly9N9p.js";import{y as q}from"./Field-C6hA1tZj-CkWoRbmp.js";var v;const w=new T({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let c=v=class extends j{constructor(n){super(n),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(n,a){const o=R.fromJSON(a.spatialReference),e=[];for(let s=0;s0)for(let o=0;oMath.round((t-e)/a),i=t=>Math.round((s-t)/o),m=this.features,u=this._getQuantizationFunction(this.geometryType,r,i);for(let t=0,y=m.length;tp*r+e,u=p=>s-p*i;let t=null,y=null;if(this.hasZ&&o?.scale?.[2]!=null){const{translate:[,,p],scale:[,,g]}=o;t=f=>f*g+p}if(this.hasM&&o?.scale?.[3]!=null){const{translate:[,,,p],scale:[,,,g]}=o;y=f=>f==null?f:f*g+p}const l=this._getHydrationFunction(n,m,u,t,y);for(const{geometry:p}of a)p!=null&&l&&l(p);return this.transform=null,this}_quantizePoints(n,a,o){let e,s;const r=[];for(let i=0,m=n.length;i0){const t=a(u[0]),y=o(u[1]);t===e&&y===s||(r.push([t-e,y-s]),e=t,s=y)}else e=a(u[0]),s=o(u[1]),r.push([e,s])}return r.length>0?r:null}_getQuantizationFunction(n,a,o){return n==="point"?e=>(e.x=a(e.x),e.y=o(e.y),e):n==="polyline"||n==="polygon"?e=>{const s=x(e)?e.rings:e.paths,r=[];for(let i=0,m=s.length;i0?(x(e)?e.rings=r:e.paths=r,e):null}:n==="multipoint"?e=>{const s=this._quantizePoints(e.points,a,o);return s&&s.length>0?(e.points=s,e):null}:n==="extent"?e=>e:null}_getHydrationFunction(n,a,o,e,s){return n==="point"?r=>{r.x=a(r.x),r.y=o(r.y),e&&(r.z=e(r.z))}:n==="polyline"||n==="polygon"?r=>{const i=x(r)?r.rings:r.paths;let m,u;for(let t=0,y=i.length;t0?(m+=f[0],u+=f[1]):(m=f[0],u=f[1]),f[0]=a(m),f[1]=o(u)}}if(e&&s)for(let t=0,y=i.length;t{r.xmin=a(r.xmin),r.ymin=o(r.ymin),r.xmax=a(r.xmax),r.ymax=o(r.ymax),e&&r.zmax!=null&&r.zmin!=null&&(r.zmax=e(r.zmax),r.zmin=e(r.zmin)),s&&r.mmax!=null&&r.mmin!=null&&(r.mmax=s(r.mmax),r.mmin=s(r.mmin))}:n==="multipoint"?r=>{const i=r.points;let m,u;for(let t=0,y=i.length;t0?(m+=l[0],u+=l[1]):(m=l[0],u=l[1]),l[0]=a(m),l[1]=o(u)}if(e&&s)for(let t=0,y=i.length;t({enabled:n})}}})],c.prototype,"exceededTransferLimit",void 0),h([d({type:[S],json:{write:!0}})],c.prototype,"features",void 0),h([G("features")],c.prototype,"readFeatures",null),h([d({type:[q],json:{write:!0}})],c.prototype,"fields",void 0),h([d({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:w.read}}})],c.prototype,"geometryType",void 0),h([z("geometryType")],c.prototype,"writeGeometryType",null),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasM",void 0),h([d({type:Boolean,json:{write:{overridePolicy:n=>({enabled:n})}}})],c.prototype,"hasZ",void 0),h([d({types:N,json:{write:!0}})],c.prototype,"queryGeometry",void 0),h([G("queryGeometry")],c.prototype,"readQueryGeometry",null),h([d({type:R,json:{write:!0}})],c.prototype,"spatialReference",void 0),h([z("spatialReference")],c.prototype,"writeSpatialReference",null),h([d({json:{write:!0}})],c.prototype,"transform",void 0),c=v=h([P("esri.rest.support.FeatureSet")],c),c.prototype.toJSON.isDefaultToJSON=!0;const M=c;export{M as O}; diff --git a/custom-toc-highlight/assets/FeatureStore-Co2V0sVE-BwnfsIjJ.js b/custom-toc-highlight/assets/FeatureStore-Co2V0sVE-BK6XAR3o.js similarity index 89% rename from custom-toc-highlight/assets/FeatureStore-Co2V0sVE-BwnfsIjJ.js rename to custom-toc-highlight/assets/FeatureStore-Co2V0sVE-BK6XAR3o.js index 3b3ad5f6..7145e5a7 100644 --- a/custom-toc-highlight/assets/FeatureStore-Co2V0sVE-BwnfsIjJ.js +++ b/custom-toc-highlight/assets/FeatureStore-Co2V0sVE-BK6XAR3o.js @@ -1 +1 @@ -import{gU as d,I as f,aq as g,gV as l,a1 as i,o as a,bh as u}from"./story-BfX8CRfG.js";import{V as h}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{r as m}from"./BoundsStore--N6o1xkF-BnCtocGj.js";import{r as y}from"./timeSupport-jPViR5jn-GyoVmGVI.js";import{s as _}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js";const c=d();class M{constructor(t){this.geometryInfo=t,this._boundsStore=new m,this._featuresById=new Map,this.events=new f,this.featureAdapter=_}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 t=0;return this._featuresById.forEach(e=>{e.geometry!=null&&e.geometry.coords&&(t+=e.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:t/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(t){if(this.fullBounds==null)return null;const[e,s,r,o]=this.fullBounds;return{xmin:e,ymin:s,xmax:r,ymax:o,spatialReference:y(t)}}add(t){this._add(t),this._emitChanged()}addMany(t){for(const e of t)this._add(e);this._emitChanged()}upsertMany(t){const e=t.map(s=>this._upsert(s));return this._emitChanged(),e.filter(g)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(t){const e=this._featuresById.get(t);return e?(this._remove(e),this._emitChanged(),e):null}removeManyById(t){this._boundsStore.invalidateIndex();for(const e of t){const s=this._featuresById.get(e);s&&this._remove(s)}this._emitChanged()}forEachBounds(t,e){for(const s of t){const r=this._boundsStore.get(s.objectId);r&&e(l(c,r))}}getFeature(t){return this._featuresById.get(t)}has(t){return this._featuresById.has(t)}forEach(t){this._featuresById.forEach(e=>t(e))}forEachInBounds(t,e){this._boundsStore.forEachInBounds(t,s=>{e(this._featuresById.get(s))})}_emitChanged(){this.events.emit("changed",void 0)}_add(t){if(!t)return;const e=t.objectId;if(e==null)return void i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t}));const s=this._featuresById.get(e);let r;if(s?(t.displayId=s.displayId,r=this._boundsStore.get(e),this._boundsStore.delete(e)):this.onFeatureAdd!=null&&this.onFeatureAdd(t),!t.geometry?.coords?.length)return this._boundsStore.set(e,null),void this._featuresById.set(e,t);r=h(r??u(),t.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),r!=null&&this._boundsStore.set(e,r),this._featuresById.set(e,t)}_upsert(t){const e=t?.objectId;if(e==null)return i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t})),null;const s=this._featuresById.get(e);if(!s)return this._add(t),t;const{geometry:r,attributes:o}=t;for(const n in o)s.attributes[n]=o[n];return r&&(s.geometry=r,this._boundsStore.set(e,h(u(),r,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(t){this.onFeatureRemove!=null&&this.onFeatureRemove(t);const e=t.objectId;return this._boundsStore.delete(e),this._featuresById.delete(e),t}}export{M as I}; +import{gU as d,I as f,aq as g,gV as l,a1 as i,o as a,bh as u}from"./story-Doly9N9p.js";import{V as h}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{r as m}from"./BoundsStore--N6o1xkF-CQrhMeDa.js";import{r as y}from"./timeSupport-jPViR5jn-7bshRI7L.js";import{s as _}from"./optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js";const c=d();class M{constructor(t){this.geometryInfo=t,this._boundsStore=new m,this._featuresById=new Map,this.events=new f,this.featureAdapter=_}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 t=0;return this._featuresById.forEach(e=>{e.geometry!=null&&e.geometry.coords&&(t+=e.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:t/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}getFullExtent(t){if(this.fullBounds==null)return null;const[e,s,r,o]=this.fullBounds;return{xmin:e,ymin:s,xmax:r,ymax:o,spatialReference:y(t)}}add(t){this._add(t),this._emitChanged()}addMany(t){for(const e of t)this._add(e);this._emitChanged()}upsertMany(t){const e=t.map(s=>this._upsert(s));return this._emitChanged(),e.filter(g)}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(t){const e=this._featuresById.get(t);return e?(this._remove(e),this._emitChanged(),e):null}removeManyById(t){this._boundsStore.invalidateIndex();for(const e of t){const s=this._featuresById.get(e);s&&this._remove(s)}this._emitChanged()}forEachBounds(t,e){for(const s of t){const r=this._boundsStore.get(s.objectId);r&&e(l(c,r))}}getFeature(t){return this._featuresById.get(t)}has(t){return this._featuresById.has(t)}forEach(t){this._featuresById.forEach(e=>t(e))}forEachInBounds(t,e){this._boundsStore.forEachInBounds(t,s=>{e(this._featuresById.get(s))})}_emitChanged(){this.events.emit("changed",void 0)}_add(t){if(!t)return;const e=t.objectId;if(e==null)return void i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t}));const s=this._featuresById.get(e);let r;if(s?(t.displayId=s.displayId,r=this._boundsStore.get(e),this._boundsStore.delete(e)):this.onFeatureAdd!=null&&this.onFeatureAdd(t),!t.geometry?.coords?.length)return this._boundsStore.set(e,null),void this._featuresById.set(e,t);r=h(r??u(),t.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),r!=null&&this._boundsStore.set(e,r),this._featuresById.set(e,t)}_upsert(t){const e=t?.objectId;if(e==null)return i.getLogger("esri.layers.graphics.data.FeatureStore").error(new a("featurestore:invalid-feature","feature id is missing",{feature:t})),null;const s=this._featuresById.get(e);if(!s)return this._add(t),t;const{geometry:r,attributes:o}=t;for(const n in o)s.attributes[n]=o[n];return r&&(s.geometry=r,this._boundsStore.set(e,h(u(),r,this.geometryInfo.hasZ,this.geometryInfo.hasM)??null)),s}_remove(t){this.onFeatureRemove!=null&&this.onFeatureRemove(t);const e=t.objectId;return this._boundsStore.delete(e),this._featuresById.delete(e),t}}export{M as I}; diff --git a/custom-toc-highlight/assets/FeatureTemplate-SPHPD45f-DFBQobBO.js b/custom-toc-highlight/assets/FeatureTemplate-SPHPD45f-CZ7E6_6b.js similarity index 94% rename from custom-toc-highlight/assets/FeatureTemplate-SPHPD45f-DFBQobBO.js rename to custom-toc-highlight/assets/FeatureTemplate-SPHPD45f-CZ7E6_6b.js index 060c283c..677f090d 100644 --- a/custom-toc-highlight/assets/FeatureTemplate-SPHPD45f-DFBQobBO.js +++ b/custom-toc-highlight/assets/FeatureTemplate-SPHPD45f-CZ7E6_6b.js @@ -1 +1 @@ -import{aK as l,aa as a,e as s,v as o,S as r,i as n}from"./story-BfX8CRfG.js";const t=new l({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 e=class extends a(s){constructor(i){super(i),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};o([r({json:{write:!0}})],e.prototype,"name",void 0),o([r({json:{write:!0}})],e.prototype,"description",void 0),o([r({json:{read:t.read,write:t.write}})],e.prototype,"drawingTool",void 0),o([r({json:{write:!0}})],e.prototype,"prototype",void 0),o([r({json:{write:!0}})],e.prototype,"thumbnail",void 0),e=o([n("esri.layers.support.FeatureTemplate")],e);const d=e;export{d as p}; +import{aK as l,aa as a,e as s,v as o,S as r,i as n}from"./story-Doly9N9p.js";const t=new l({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 e=class extends a(s){constructor(i){super(i),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};o([r({json:{write:!0}})],e.prototype,"name",void 0),o([r({json:{write:!0}})],e.prototype,"description",void 0),o([r({json:{read:t.read,write:t.write}})],e.prototype,"drawingTool",void 0),o([r({json:{write:!0}})],e.prototype,"prototype",void 0),o([r({json:{write:!0}})],e.prototype,"thumbnail",void 0),e=o([n("esri.layers.support.FeatureTemplate")],e);const d=e;export{d as p}; diff --git a/custom-toc-highlight/assets/FeatureType-C9hJmS6_-BXWT6QCe.js b/custom-toc-highlight/assets/FeatureType-C9hJmS6_-CNlvn5D1.js similarity index 85% rename from custom-toc-highlight/assets/FeatureType-C9hJmS6_-BXWT6QCe.js rename to custom-toc-highlight/assets/FeatureType-C9hJmS6_-CNlvn5D1.js index 1cb65a57..2e34aaa0 100644 --- a/custom-toc-highlight/assets/FeatureType-C9hJmS6_-BXWT6QCe.js +++ b/custom-toc-highlight/assets/FeatureType-C9hJmS6_-CNlvn5D1.js @@ -1 +1 @@ -import{aa as a,e as p,v as e,S as i,a0 as m,ac as l,i as d}from"./story-BfX8CRfG.js";import{i as y}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{p as c}from"./FeatureTemplate-SPHPD45f-DFBQobBO.js";let o=class extends a(p){constructor(t){super(t),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(t){const r={};for(const s of Object.keys(t))r[s]=y(t[s]);return r}writeDomains(t,r){const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());r.domains=s}};e([i({json:{write:!0}})],o.prototype,"id",void 0),e([i({json:{write:!0}})],o.prototype,"name",void 0),e([i({json:{write:!0}})],o.prototype,"domains",void 0),e([m("domains")],o.prototype,"readDomains",null),e([l("domains")],o.prototype,"writeDomains",null),e([i({type:[c],json:{write:!0}})],o.prototype,"templates",void 0),o=e([d("esri.layers.support.FeatureType")],o);const w=o;export{w as y}; +import{aa as a,e as p,v as e,S as i,a0 as m,ac as l,i as d}from"./story-Doly9N9p.js";import{i as y}from"./Field-C6hA1tZj-CkWoRbmp.js";import{p as c}from"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";let o=class extends a(p){constructor(t){super(t),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(t){const r={};for(const s of Object.keys(t))r[s]=y(t[s]);return r}writeDomains(t,r){const s={};for(const n of Object.keys(t))t[n]&&(s[n]=t[n]?.toJSON());r.domains=s}};e([i({json:{write:!0}})],o.prototype,"id",void 0),e([i({json:{write:!0}})],o.prototype,"name",void 0),e([i({json:{write:!0}})],o.prototype,"domains",void 0),e([m("domains")],o.prototype,"readDomains",null),e([l("domains")],o.prototype,"writeDomains",null),e([i({type:[c],json:{write:!0}})],o.prototype,"templates",void 0),o=e([d("esri.layers.support.FeatureType")],o);const w=o;export{w as y}; diff --git a/custom-toc-highlight/assets/Field-C6hA1tZj-CpGOU6Y4.js b/custom-toc-highlight/assets/Field-C6hA1tZj-CkWoRbmp.js similarity index 97% rename from custom-toc-highlight/assets/Field-C6hA1tZj-CpGOU6Y4.js rename to custom-toc-highlight/assets/Field-C6hA1tZj-CkWoRbmp.js index 91fbd292..37c30b36 100644 --- a/custom-toc-highlight/assets/Field-C6hA1tZj-CpGOU6Y4.js +++ b/custom-toc-highlight/assets/Field-C6hA1tZj-CkWoRbmp.js @@ -1 +1 @@ -import{v as t,S as o,i as l,aK as j,bz as u,a0 as f,bB as x,e as b,P as T}from"./story-BfX8CRfG.js";import{i as D}from"./fieldType-CD2CL2hr-CMChCO5s.js";import"./main-ugzBrWNm.js";var m;let s=m=class extends b{constructor(e){super(e),this.name=null,this.code=null}clone(){return new m({name:this.name,code:this.code})}};t([o({type:String,json:{write:!0}})],s.prototype,"name",void 0),t([o({type:[String,Number],json:{write:!0}})],s.prototype,"code",void 0),s=m=t([l("esri.layers.support.CodedValue")],s);const J=new j({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends b{constructor(e){super(e),this.name=null,this.type=null}};t([o({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([u(J)],d.prototype,"type",void 0),d=t([l("esri.layers.support.Domain")],d);const y=d;var h;let p=h=class extends y{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let r=null;if(this.codedValues){const i=String(e);this.codedValues.some(w=>(String(w.code)===i&&(r=w.name),!!r))}return r}clone(){return new h({codedValues:T(this.codedValues),name:this.name})}};t([o({type:[s],json:{write:!0}})],p.prototype,"codedValues",void 0),t([u({codedValue:"coded-value"})],p.prototype,"type",void 0),p=h=t([l("esri.layers.support.CodedValueDomain")],p);const S=p;var v;let c=v=class extends y{constructor(e){super(e),this.type="inherited"}clone(){return new v}};t([u({inherited:"inherited"})],c.prototype,"type",void 0),c=v=t([l("esri.layers.support.InheritedDomain")],c);const O=c;var g;let a=g=class extends y{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new g({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(e,r,i){r[i]=[this.minValue||0,e]}}}})],a.prototype,"maxValue",void 0),t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[0]},write:{target:"range",writer(e,r,i){r[i]=[e,this.maxValue||0]}}}})],a.prototype,"minValue",void 0),t([u({range:"range"})],a.prototype,"type",void 0),a=g=t([l("esri.layers.support.RangeDomain")],a);const N=a,B={key:"type",base:y,typeMap:{range:N,"coded-value":S,inherited:O}};function P(e){if(!e?.type)return null;switch(e.type){case"range":return N.fromJSON(e);case"codedValue":return S.fromJSON(e);case"inherited":return O.fromJSON(e)}return null}var V;const _=new j({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 n=V=class extends b{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?.value??null}readValueType(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?_.fromJSON(i.fieldValueType):null}clone(){return new V({alias:this.alias,defaultValue:this.defaultValue,description:this.description,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})}};t([o({type:String,json:{write:!0}})],n.prototype,"alias",void 0),t([o({type:[String,Number],json:{write:{allowNull:!0}}})],n.prototype,"defaultValue",void 0),t([o()],n.prototype,"description",void 0),t([f("description")],n.prototype,"readDescription",null),t([o({types:B,json:{read:{reader:P},write:!0}})],n.prototype,"domain",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"editable",void 0),t([o({type:x,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],n.prototype,"length",void 0),t([o({type:String,json:{write:!0}})],n.prototype,"name",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"nullable",void 0),t([u(D)],n.prototype,"type",void 0),t([o()],n.prototype,"valueType",void 0),t([f("valueType",["description"])],n.prototype,"readValueType",null),t([o({type:Boolean,json:{read:!1}})],n.prototype,"visible",void 0),n=V=t([l("esri.layers.support.Field")],n);const F=n,q=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));export{q as F,S as a,P as i,B as n,s as p,F as y}; +import{v as t,S as o,i as l,aK as j,bz as u,a0 as f,bB as x,e as b,P as T}from"./story-Doly9N9p.js";import{i as D}from"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./main-QGPoLsvl.js";var m;let s=m=class extends b{constructor(e){super(e),this.name=null,this.code=null}clone(){return new m({name:this.name,code:this.code})}};t([o({type:String,json:{write:!0}})],s.prototype,"name",void 0),t([o({type:[String,Number],json:{write:!0}})],s.prototype,"code",void 0),s=m=t([l("esri.layers.support.CodedValue")],s);const J=new j({inherited:"inherited",codedValue:"coded-value",range:"range"});let d=class extends b{constructor(e){super(e),this.name=null,this.type=null}};t([o({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([u(J)],d.prototype,"type",void 0),d=t([l("esri.layers.support.Domain")],d);const y=d;var h;let p=h=class extends y{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let r=null;if(this.codedValues){const i=String(e);this.codedValues.some(w=>(String(w.code)===i&&(r=w.name),!!r))}return r}clone(){return new h({codedValues:T(this.codedValues),name:this.name})}};t([o({type:[s],json:{write:!0}})],p.prototype,"codedValues",void 0),t([u({codedValue:"coded-value"})],p.prototype,"type",void 0),p=h=t([l("esri.layers.support.CodedValueDomain")],p);const S=p;var v;let c=v=class extends y{constructor(e){super(e),this.type="inherited"}clone(){return new v}};t([u({inherited:"inherited"})],c.prototype,"type",void 0),c=v=t([l("esri.layers.support.InheritedDomain")],c);const O=c;var g;let a=g=class extends y{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new g({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(e,r,i){r[i]=[this.minValue||0,e]}}}})],a.prototype,"maxValue",void 0),t([o({json:{type:[Number],read:{source:"range",reader:(e,r)=>r.range?.[0]},write:{target:"range",writer(e,r,i){r[i]=[e,this.maxValue||0]}}}})],a.prototype,"minValue",void 0),t([u({range:"range"})],a.prototype,"type",void 0),a=g=t([l("esri.layers.support.RangeDomain")],a);const N=a,B={key:"type",base:y,typeMap:{range:N,"coded-value":S,inherited:O}};function P(e){if(!e?.type)return null;switch(e.type){case"range":return N.fromJSON(e);case"codedValue":return S.fromJSON(e);case"inherited":return O.fromJSON(e)}return null}var V;const _=new j({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 n=V=class extends b{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?.value??null}readValueType(e,{description:r}){let i=null;try{i=r?JSON.parse(r):null}catch{}return i?_.fromJSON(i.fieldValueType):null}clone(){return new V({alias:this.alias,defaultValue:this.defaultValue,description:this.description,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})}};t([o({type:String,json:{write:!0}})],n.prototype,"alias",void 0),t([o({type:[String,Number],json:{write:{allowNull:!0}}})],n.prototype,"defaultValue",void 0),t([o()],n.prototype,"description",void 0),t([f("description")],n.prototype,"readDescription",null),t([o({types:B,json:{read:{reader:P},write:!0}})],n.prototype,"domain",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"editable",void 0),t([o({type:x,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],n.prototype,"length",void 0),t([o({type:String,json:{write:!0}})],n.prototype,"name",void 0),t([o({type:Boolean,json:{write:!0}})],n.prototype,"nullable",void 0),t([u(D)],n.prototype,"type",void 0),t([o()],n.prototype,"valueType",void 0),t([f("valueType",["description"])],n.prototype,"readValueType",null),t([o({type:Boolean,json:{read:!1}})],n.prototype,"visible",void 0),n=V=t([l("esri.layers.support.Field")],n);const F=n,q=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));export{q as F,S as a,P as i,B as n,s as p,F as y}; diff --git a/custom-toc-highlight/assets/FieldsIndex-HmzMbJQG-DZuFWLvd.js b/custom-toc-highlight/assets/FieldsIndex-HmzMbJQG-Du7S47uJ.js similarity index 96% rename from custom-toc-highlight/assets/FieldsIndex-HmzMbJQG-DZuFWLvd.js rename to custom-toc-highlight/assets/FieldsIndex-HmzMbJQG-Du7S47uJ.js index 700cd7fe..4a00f293 100644 --- a/custom-toc-highlight/assets/FieldsIndex-HmzMbJQG-DZuFWLvd.js +++ b/custom-toc-highlight/assets/FieldsIndex-HmzMbJQG-Du7S47uJ.js @@ -1 +1 @@ -import{cg as N,ch as S,ci as y,cj as _,ck as b,a1 as B,o as q,cl as h,cm as u,b_ as z,an as J,c7 as O,cn as L,co as $,cp as D,cq as c}from"./story-BfX8CRfG.js";import{t as R}from"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";function I(s){return"timeZone"in s}function x(s){return"timeZone"in s}function C(s){return"dateFieldsTimeZone"in s}const j=new Map;let A=class m{static fromJSON(e){return new m(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new m(e.fields??[],T(e))}static fromLayerJSON(e){return new m(e.fields??[],T(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const i of this.fields){const r=i?.name,o=g(r);if(r&&o){const l=a(r);this._fieldsMap.set(r,i),this._fieldsMap.set(l,i),this._normalizedFieldsMap.set(o,i),n.push(`${l}:${i.type}:${this._timeZoneByFieldName?.get(r)}`),N(i)?(this.dateFields.push(i),this._dateFieldsSet.add(i)):S(i)&&(this._numericFieldsSet.add(i),this.numericFields.push(i)),y(i)||_(i)||(i.editable=i.editable==null||!!i.editable,i.nullable=i.nullable==null||!!i.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)y(e)||_(e)||e.nullable||b(e)!==void 0||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return this.get(e)!=null}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(a(e))??this._normalizedFieldsMap.get(g(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&typeof e!="string"?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):t.type==="date"||t.type==="esriFieldTypeDate"?(B.getLogger("esri.layers.support.FieldsIndex").error(new q("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),h):Z.has(t.type)?u:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u?R.instance:t===h?z.utcInstance:J(j,t,()=>O.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return L(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>$(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}};function a(s){return s.trim().toLowerCase()}function g(s){return D(s)?.toLowerCase()??""}const Z=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function T(s){const e=new Map;if(!s.fields)return e;const t=s.datesInUnknownTimezone===!0,{timeInfo:n,editFieldsInfo:i}=s,r=(n?"startField"in n?n.startField:n.startTimeField:"")??"",o=(n?"endField"in n?n.endField:n.endTimeField:"")??"",l=C(s)?s.dateFieldsTimeZone??null:s.dateFieldsTimeReference?c(s.dateFieldsTimeReference):null,F=i?I(i)?i.timeZone??l:i.dateFieldsTimeReference?c(i.dateFieldsTimeReference):l??h:null,p=n?x(n)?n.timeZone??l:n.timeReference?c(n.timeReference):l:null,w=new Map([[a(i?.creationDateField??""),F],[a(i?.editDateField??""),F],[a(r),p],[a(o),p]]);for(const{name:d,type:f}of s.fields)if(Z.has(f))e.set(d,u);else if(f!=="date"&&f!=="esriFieldTypeDate")e.set(d,null);else if(t)e.set(d,u);else{const M=w.get(a(d??""))??l;e.set(d,M)}return e}export{A as o}; +import{cg as N,ch as S,ci as y,cj as _,ck as b,a1 as B,o as q,cl as h,cm as u,b_ as z,an as J,c7 as O,cn as L,co as $,cp as D,cq as c}from"./story-Doly9N9p.js";import{t as R}from"./UnknownTimeZone-C--TOcPG-9of9030I.js";function I(s){return"timeZone"in s}function x(s){return"timeZone"in s}function C(s){return"dateFieldsTimeZone"in s}const j=new Map;let A=class m{static fromJSON(e){return new m(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new m(e.fields??[],T(e))}static fromLayerJSON(e){return new m(e.fields??[],T(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const n=[];for(const i of this.fields){const r=i?.name,o=g(r);if(r&&o){const l=a(r);this._fieldsMap.set(r,i),this._fieldsMap.set(l,i),this._normalizedFieldsMap.set(o,i),n.push(`${l}:${i.type}:${this._timeZoneByFieldName?.get(r)}`),N(i)?(this.dateFields.push(i),this._dateFieldsSet.add(i)):S(i)&&(this._numericFieldsSet.add(i),this.numericFields.push(i)),y(i)||_(i)||(i.editable=i.editable==null||!!i.editable,i.nullable=i.nullable==null||!!i.nullable)}}n.sort(),this.uid=n.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)y(e)||_(e)||e.nullable||b(e)!==void 0||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return this.get(e)!=null}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(a(e))??this._normalizedFieldsMap.get(g(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&typeof e!="string"?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):t.type==="date"||t.type==="esriFieldTypeDate"?(B.getLogger("esri.layers.support.FieldsIndex").error(new q("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),h):Z.has(t.type)?u:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u?R.instance:t===h?z.utcInstance:J(j,t,()=>O.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return L(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>$(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}};function a(s){return s.trim().toLowerCase()}function g(s){return D(s)?.toLowerCase()??""}const Z=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function T(s){const e=new Map;if(!s.fields)return e;const t=s.datesInUnknownTimezone===!0,{timeInfo:n,editFieldsInfo:i}=s,r=(n?"startField"in n?n.startField:n.startTimeField:"")??"",o=(n?"endField"in n?n.endField:n.endTimeField:"")??"",l=C(s)?s.dateFieldsTimeZone??null:s.dateFieldsTimeReference?c(s.dateFieldsTimeReference):null,F=i?I(i)?i.timeZone??l:i.dateFieldsTimeReference?c(i.dateFieldsTimeReference):l??h:null,p=n?x(n)?n.timeZone??l:n.timeReference?c(n.timeReference):l:null,w=new Map([[a(i?.creationDateField??""),F],[a(i?.editDateField??""),F],[a(r),p],[a(o),p]]);for(const{name:d,type:f}of s.fields)if(Z.has(f))e.set(d,u);else if(f!=="date"&&f!=="esriFieldTypeDate")e.set(d,null);else if(t)e.set(d,u);else{const M=w.get(a(d??""))??l;e.set(d,M)}return e}export{A as o}; diff --git a/custom-toc-highlight/assets/FloatingArrow-BG9llDYg-iM1y-TMJ.js b/custom-toc-highlight/assets/FloatingArrow-BG9llDYg-Ct2kNlPu.js similarity index 88% rename from custom-toc-highlight/assets/FloatingArrow-BG9llDYg-iM1y-TMJ.js rename to custom-toc-highlight/assets/FloatingArrow-BG9llDYg-Ct2kNlPu.js index a7dd29ae..55f38d99 100644 --- a/custom-toc-highlight/assets/FloatingArrow-BG9llDYg-iM1y-TMJ.js +++ b/custom-toc-highlight/assets/FloatingArrow-BG9llDYg-Ct2kNlPu.js @@ -1 +1 @@ -import{a}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";const s={arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"},d={width:12,height:6,strokeWidth:1},c=({floatingLayout:l,key:n,ref:w})=>{const{width:t,height:e,strokeWidth:r}=d,o=t/2,i=l==="vertical",h=`M0,0 H${t} L${t-o},${e} Q${o},${e} ${o},${e} Z`;return a("svg",{"aria-hidden":"true",class:s.arrow,height:t,key:n,ref:w,viewBox:`0 0 ${t} ${t+(i?0:r)}`,width:t+(i?r:0)},r>0&&a("path",{class:s.arrowStroke,d:h,fill:"none","stroke-width":r+1}),a("path",{d:h,stroke:"none"}))};export{c as $}; +import{a}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";const s={arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"},d={width:12,height:6,strokeWidth:1},c=({floatingLayout:l,key:n,ref:w})=>{const{width:t,height:e,strokeWidth:r}=d,o=t/2,i=l==="vertical",h=`M0,0 H${t} L${t-o},${e} Q${o},${e} ${o},${e} Z`;return a("svg",{"aria-hidden":"true",class:s.arrow,height:t,key:n,ref:w,viewBox:`0 0 ${t} ${t+(i?0:r)}`,width:t+(i?r:0)},r>0&&a("path",{class:s.arrowStroke,d:h,fill:"none","stroke-width":r+1}),a("path",{d:h,stroke:"none"}))};export{c as $}; diff --git a/custom-toc-highlight/assets/GeoJSONLayer-BFFwDRph-DcfWJyiN.js b/custom-toc-highlight/assets/GeoJSONLayer-BFFwDRph-C3_g8RHm.js similarity index 75% rename from custom-toc-highlight/assets/GeoJSONLayer-BFFwDRph-DcfWJyiN.js rename to custom-toc-highlight/assets/GeoJSONLayer-BFFwDRph-C3_g8RHm.js index 8fb8d9fc..b20016b7 100644 --- a/custom-toc-highlight/assets/GeoJSONLayer-BFFwDRph-DcfWJyiN.js +++ b/custom-toc-highlight/assets/GeoJSONLayer-BFFwDRph-C3_g8RHm.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-BcQn3A1C.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-9sQxfkoa-KicvrT8N.js","./utils-Bq23Xwmj--_SaacS5.js","./EditBusLayer-Df29OyJh-DkVkxUAl.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); -import{_ as w}from"./main-ugzBrWNm.js";import{v as r,S as i,i as E,J as O,W as J,bT as y,dL as N,a as f,bQ as j,n as S,bW as F,bL as R,aB as T,bp as q,o as g,l as P,K as $,a1 as v}from"./story-BfX8CRfG.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{m as D,u as k}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as L}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{q as Q}from"./workers-PiCjreoO-idkDTJa3.js";import{$ as G}from"./clientSideDefaults-BqqayPct-B-0mBem3.js";import{O as Z}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{u as z}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as V}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{l as W}from"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import{v as A}from"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import{E as B}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{p as U}from"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import{C as Y}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as M}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as X}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{x as H}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{i as K,$ as ee,e as te,Y as re,_ as ie,E as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{p as le}from"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import{y as pe}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{f as ue}from"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import{C as de,q as he}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{b as d}from"./Query-BrwMGK8U-DoFNfkjX.js";import{w as me}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";let l=class extends T{constructor(){super(...arguments),this.type="geojson",this.refresh=q(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=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.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=>Z.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:S.fromJSON(s.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new g("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,s=[],n=[],h=[];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)h.push(this._serializeFeature(a));return this._connection.invoke("applyEdits",{adds:s,updates:h,deletes:n}).then(({extent:a,timeExtent:p,featureEditResults:m})=>(this.sourceJSON.extent=a,p&&(this.sourceJSON.timeInfo.timeExtent=[p.start,p.end]),this._createEditsResult(m)))}_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 g("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 t==null?null:t.type==="mesh"||t.type==="extent"?P.fromExtent(t.extent):t}async _startWorker(e){this._connection=await Q("GeoJSONSourceWorker",{strategy:$("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:s,hasZ:n,geometryType:h,objectIdField:a,url:p,timeInfo:m,customParameters:I}=this.layer,x=this.layer.originOf("spatialReference")==="defaults",_={url:p,customParameters:I,fields:t&&t.map(c=>c.toJSON()),geometryType:F.toJSON(h),hasZ:n,objectIdField:a,timeInfo:m?m.toJSON():null,spatialReference:x?null:s&&s.toJSON()},u=await this._connection.invoke("load",_,{signal:e});for(const c of u.warnings)v.getLogger(this.layer).warn("#load()",`${c.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:c});u.featureErrors.length&&v.getLogger(this.layer).warn("#load()",`Encountered ${u.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:u.featureErrors}),this.sourceJSON=u.layerDefinition,this.capabilities=G(this.sourceJSON.hasZ,!0)}};r([i()],l.prototype,"capabilities",void 0),r([i()],l.prototype,"type",void 0),r([i({constructOnly:!0})],l.prototype,"layer",void 0),r([i()],l.prototype,"sourceJSON",void 0),l=r([E("esri.layers.graphics.sources.GeoJSONSource")],l);const b=ue();let o=class extends U(V(A(W(z(H(X(M(B(Y(C(L))))))))))){constructor(e){super(e),this.attributeTableTemplate=null,this.copyright=null,this.dateFieldsTimeZone=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.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new l({layer:this}),this.spatialReference=O.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){this.source?.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(J).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),y(this.renderer,this.fieldsIndex),N(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?f(this.url):null}set renderer(e){y(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=f(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:s}=await w(()=>import("./editingSupport-gUqP9iyf-BcQn3A1C.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);await this.load();const n=await s(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 me(this,e)}createQuery(){const e=new d,t=this.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){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(d.from(e)||this.createQuery(),t)).then(s=>{if(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(d.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(d.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(d.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};r([i(K)],o.prototype,"attributeTableTemplate",void 0),r([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",null),r([i({type:String})],o.prototype,"copyright",void 0),r([i({readOnly:!0})],o.prototype,"createQueryVersion",null),r([i(j("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),r([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),r([i({type:String})],o.prototype,"displayField",void 0),r([i({type:Boolean})],o.prototype,"editingEnabled",void 0),r([i(ee)],o.prototype,"elevationInfo",void 0),r([i({type:[pe],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),r([i(b.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([i({type:S,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),r([i({type:["point","polygon","polyline","multipoint"],json:{read:{reader:F.read}}})],o.prototype,"geometryType",void 0),r([i({type:Boolean})],o.prototype,"hasZ",void 0),r([i(te)],o.prototype,"id",void 0),r([i({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([i(re)],o.prototype,"labelsVisible",void 0),r([i({type:[de],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:he},write:!0}})],o.prototype,"labelingInfo",void 0),r([i(ie)],o.prototype,"legendEnabled",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([i(oe)],o.prototype,"opacity",void 0),r([i({type:["GeoJSON"]})],o.prototype,"operationalLayerType",void 0),r([i(b.outFields)],o.prototype,"outFields",void 0),r([i({readOnly:!0})],o.prototype,"parsedUrl",null),r([i(se)],o.prototype,"popupEnabled",void 0),r([i({type:R,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({types:D,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:k}}}})],o.prototype,"renderer",null),r([i(ne)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([i({readOnly:!0})],o.prototype,"source",void 0),r([i({type:O})],o.prototype,"spatialReference",void 0),r([i({type:[le]})],o.prototype,"templates",void 0),r([i()],o.prototype,"title",void 0),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),r([i(ae)],o.prototype,"url",null),o=r([E("esri.layers.GeoJSONLayer")],o);const jt=o;export{jt as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-C_ld1skV.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./EditBusLayer-Df29OyJh-OmdJOLws.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); +import{_ as w}from"./main-QGPoLsvl.js";import{v as r,S as i,i as E,J as O,W as J,bT as y,dL as N,a as f,bQ as j,n as S,bW as F,bL as R,aB as T,bp as q,o as g,l as P,K as $,a1 as v}from"./story-Doly9N9p.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{m as D,u as k}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as L}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{q as Q}from"./workers-PiCjreoO-Dc6Tqm-o.js";import{$ as G}from"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import{O as Z}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{u as z}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as V}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{l as W}from"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import{v as A}from"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import{E as B}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{p as U}from"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import{C as Y}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as M}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as X}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{x as H}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{i as K,$ as ee,e as te,Y as re,_ as ie,E as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{p as le}from"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import{y as pe}from"./Field-C6hA1tZj-CkWoRbmp.js";import{f as ue}from"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import{C as de,q as he}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{b as d}from"./Query-BrwMGK8U-BPr0_G9t.js";import{w as me}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";let l=class extends T{constructor(){super(...arguments),this.type="geojson",this.refresh=q(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=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.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=>Z.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:S.fromJSON(s.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new g("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,s=[],n=[],h=[];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)h.push(this._serializeFeature(a));return this._connection.invoke("applyEdits",{adds:s,updates:h,deletes:n}).then(({extent:a,timeExtent:p,featureEditResults:m})=>(this.sourceJSON.extent=a,p&&(this.sourceJSON.timeInfo.timeExtent=[p.start,p.end]),this._createEditsResult(m)))}_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 g("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 t==null?null:t.type==="mesh"||t.type==="extent"?P.fromExtent(t.extent):t}async _startWorker(e){this._connection=await Q("GeoJSONSourceWorker",{strategy:$("feature-layers-workers")?"dedicated":"local",signal:e,registryTarget:this});const{fields:t,spatialReference:s,hasZ:n,geometryType:h,objectIdField:a,url:p,timeInfo:m,customParameters:I}=this.layer,x=this.layer.originOf("spatialReference")==="defaults",_={url:p,customParameters:I,fields:t&&t.map(c=>c.toJSON()),geometryType:F.toJSON(h),hasZ:n,objectIdField:a,timeInfo:m?m.toJSON():null,spatialReference:x?null:s&&s.toJSON()},u=await this._connection.invoke("load",_,{signal:e});for(const c of u.warnings)v.getLogger(this.layer).warn("#load()",`${c.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:c});u.featureErrors.length&&v.getLogger(this.layer).warn("#load()",`Encountered ${u.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{errors:u.featureErrors}),this.sourceJSON=u.layerDefinition,this.capabilities=G(this.sourceJSON.hasZ,!0)}};r([i()],l.prototype,"capabilities",void 0),r([i()],l.prototype,"type",void 0),r([i({constructOnly:!0})],l.prototype,"layer",void 0),r([i()],l.prototype,"sourceJSON",void 0),l=r([E("esri.layers.graphics.sources.GeoJSONSource")],l);const b=ue();let o=class extends U(V(A(W(z(H(X(M(B(Y(C(L))))))))))){constructor(e){super(e),this.attributeTableTemplate=null,this.copyright=null,this.dateFieldsTimeZone=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.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new l({layer:this}),this.spatialReference=O.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson"}destroy(){this.source?.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(J).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),y(this.renderer,this.fieldsIndex),N(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?f(this.url):null}set renderer(e){y(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=f(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const{applyEdits:s}=await w(()=>import("./editingSupport-gUqP9iyf-C_ld1skV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);await this.load();const n=await s(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 me(this,e)}createQuery(){const e=new d,t=this.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){return this.getField(e)?.domain}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(d.from(e)||this.createQuery(),t)).then(s=>{if(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(d.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(d.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(d.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return t!=null&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};r([i(K)],o.prototype,"attributeTableTemplate",void 0),r([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",null),r([i({type:String})],o.prototype,"copyright",void 0),r([i({readOnly:!0})],o.prototype,"createQueryVersion",null),r([i(j("dateFieldsTimeReference"))],o.prototype,"dateFieldsTimeZone",void 0),r([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),r([i({type:String})],o.prototype,"displayField",void 0),r([i({type:Boolean})],o.prototype,"editingEnabled",void 0),r([i(ee)],o.prototype,"elevationInfo",void 0),r([i({type:[pe],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),r([i(b.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([i({type:S,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),r([i({type:["point","polygon","polyline","multipoint"],json:{read:{reader:F.read}}})],o.prototype,"geometryType",void 0),r([i({type:Boolean})],o.prototype,"hasZ",void 0),r([i(te)],o.prototype,"id",void 0),r([i({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([i(re)],o.prototype,"labelsVisible",void 0),r([i({type:[de],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:he},write:!0}})],o.prototype,"labelingInfo",void 0),r([i(ie)],o.prototype,"legendEnabled",void 0),r([i({type:["show","hide"]})],o.prototype,"listMode",void 0),r([i({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([i(oe)],o.prototype,"opacity",void 0),r([i({type:["GeoJSON"]})],o.prototype,"operationalLayerType",void 0),r([i(b.outFields)],o.prototype,"outFields",void 0),r([i({readOnly:!0})],o.prototype,"parsedUrl",null),r([i(se)],o.prototype,"popupEnabled",void 0),r([i({type:R,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({types:D,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:k}}}})],o.prototype,"renderer",null),r([i(ne)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([i({readOnly:!0})],o.prototype,"source",void 0),r([i({type:O})],o.prototype,"spatialReference",void 0),r([i({type:[le]})],o.prototype,"templates",void 0),r([i()],o.prototype,"title",void 0),r([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),r([i(ae)],o.prototype,"url",null),o=r([E("esri.layers.GeoJSONLayer")],o);const jt=o;export{jt as default}; diff --git a/custom-toc-highlight/assets/GeoJSONSourceWorker-CLrugTuD-BI2XPEIw.js b/custom-toc-highlight/assets/GeoJSONSourceWorker-CLrugTuD-DAF3mwCs.js similarity index 81% rename from custom-toc-highlight/assets/GeoJSONSourceWorker-CLrugTuD-BI2XPEIw.js rename to custom-toc-highlight/assets/GeoJSONSourceWorker-CLrugTuD-DAF3mwCs.js index e8485d45..bc6ce7aa 100644 --- a/custom-toc-highlight/assets/GeoJSONSourceWorker-CLrugTuD-BI2XPEIw.js +++ b/custom-toc-highlight/assets/GeoJSONSourceWorker-CLrugTuD-DAF3mwCs.js @@ -1 +1 @@ -import{eS as _,o as I,ck as A,gT as Z,cl as Q,ay as $,aU as v,a1 as G,aC as P,f as M,bK as R}from"./story-BfX8CRfG.js";import{z,n as N,A as H,j as L,k as Y}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{I as B}from"./FeatureStore-Co2V0sVE-BwnfsIjJ.js";import{f as E,h as b}from"./queryUtils-Brxu6254-PPvpiP5X.js";import{Z as J}from"./QueryEngine-CH5uUhZK-BP95Dm56.js";import{Y as U,_ as V,X as W}from"./geojson-CNt_qtQf-B9F87hyc.js";import{A as K,f as X,d as ee}from"./clientSideDefaults-BqqayPct-B-0mBem3.js";import{G as te,F as T,j,c as F,x as k}from"./sourceUtils-BMeqkJ5g-DxP4qerC.js";import{o as C}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{i as ie}from"./fieldType-CD2CL2hr-CMChCO5s.js";import"./main-ugzBrWNm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-BnCtocGj.js";import"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./WhereClause-DxwoyBMS-DnXKVpm2.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./utils-HtkT8Fn3-wUwu1nm1.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-BQ5pghrp.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./utils-tNxq3jkf-B78XlSIE.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";const se={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsQueryWithResultType:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class tt{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const s=[],[i]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),r=U(i,{geometryType:e.geometryType}),l=e.fields||r.fields||[],p=e.hasZ!=null?e.hasZ:r.hasZ,d=r.geometryType;let c=e.objectIdField||r.objectIdFieldName||"__OBJECTID";const h=e.spatialReference||_;let a=e.timeInfo;l===r.fields&&r.unknownFields.length>0&&s.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:r.unknownFields}});const o=new C(l);let u=o.get(c);u?(u.type!=="esriFieldTypeString"&&(u.type="esriFieldTypeOID"),u.editable=!1,u.nullable=!1,c=u.name):(u={alias:c,name:c,type:r.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},l.unshift(u));const y={};for(const n of l){if(n.name==null&&(n.name=n.alias),n.alias==null&&(n.alias=n.name),!n.name)throw new I("geojson-layer:invalid-field-name","field name is missing",{field:n});if(!ie.jsonValues.includes(n.type))throw new I("geojson-layer:invalid-field-type",`invalid type for field "${n.name}"`,{field:n});if(n.name!==u.name){const g=A(n);g!==void 0&&(y[n.name]=g)}n.length==null&&(n.length=Z(n))}if(a){if(a.startTimeField){const n=o.get(a.startTimeField);n?(a.startTimeField=n.name,n.type="esriFieldTypeDate"):a.startTimeField=null}if(a.endTimeField){const n=o.get(a.endTimeField);n?(a.endTimeField=n.name,n.type="esriFieldTypeDate"):a.endTimeField=null}if(a.trackIdField){const n=o.get(a.trackIdField);n?a.trackIdField=n.name:(a.trackIdField=null,s.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:a}}))}a.startTimeField||a.endTimeField||(s.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:a}}),a=null)}const m=d?ee(d):void 0,w=o.dateFields.length?{timeZoneIANA:Q}:null,f={warnings:s,featureErrors:[],layerDefinition:{...se,drawingInfo:m??void 0,templates:K(y),extent:void 0,geometryType:d,objectIdField:c,fields:l,hasZ:!!p,timeInfo:a,dateFieldsTimeReference:w}};this._queryEngine=new J({fieldsIndex:C.fromLayerJSON({fields:l,timeInfo:a,dateFieldsTimeReference:w}),geometryType:d,hasM:!1,hasZ:p,objectIdField:c,spatialReference:h,timeInfo:a,featureStore:new B({geometryType:d,hasM:!1,hasZ:p})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(u);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=X(y,c);const x=await this._createFeatures(i);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const O=this._normalizeFeatures(x,f.featureErrors);this._queryEngine.featureStore.addMany(O);const{fullExtent:D,timeExtent:S}=await this._queryEngine.fetchRecomputedExtents();if(f.layerDefinition.extent=D,S){const{start:n,end:g}=S;f.layerDefinition.timeInfo.timeExtent=[n,g]}return f}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([te(t,s),E(e.adds,t),E(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){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=$(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,i);const r=this._normalizeFeatures(i);r&&this._queryEngine.featureStore.addMany(r)},i=>{this._queryEngine.featureStore.clear(),v(i)||G.getLogger("esri.layers.GeoJSONLayer").error(new I("geojson-layer:refresh","An error occurred during refresh",{error:i}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:s}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:s}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,r=V(e,{geometryType:t,hasZ:s,objectIdField:i});if(!P(this._queryEngine.spatialReference,_))for(const l of r)l.geometry!=null&&(l.geometry=z(b(N(l.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),_,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:s}=this._loadOptions,i=(await M(t??"",{responseType:"json",query:{...s},signal:e})).data;return W(i),i}_normalizeFeatures(e,t){const{objectIdField:s,fieldsIndex:i}=this._queryEngine,r=[];for(const l of e){const p=this._createDefaultAttributes(),d=T(i,p,l.attributes,!0);d?t?.push(d):(this._assignObjectId(p,l.attributes,!0),l.attributes=p,l.objectId=p[s],r.push(l))}return r}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const d of i)r.deleteResults.push(j(d));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:l,timeExtent:p}=await this._queryEngine.fetchRecomputedExtents();return{extent:l,timeExtent:p,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:l,objectIdField:p,spatialReference:d,featureStore:c,fieldsIndex:h}=this._queryEngine,a=[];for(const o of t){if(o.geometry&&i!==R(o.geometry)){s.push(F("Incorrect geometry type."));continue}const u=this._createDefaultAttributes(),y=T(h,u,o.attributes);if(y)s.push(y);else{if(this._assignObjectId(u,o.attributes),o.attributes=u,o.uid!=null){const m=o.attributes[p];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??d;o.geometry=b(k(o.geometry,m),m,d)}a.push(o),s.push(j(o.attributes[p]))}}c.addMany(H([],a,i,l,r,p))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:l,spatialReference:p,featureStore:d,fieldsIndex:c}=this._queryEngine;for(const h of t){const{attributes:a,geometry:o}=h,u=a?.[l];if(u==null){e.push(F(`Identifier field ${l} missing`));continue}if(!d.has(u)){e.push(F(`Feature with object id ${u} missing`));continue}const y=L(d.getFeature(u),s,r,i);if(o!=null){if(s!==R(o)){e.push(F("Incorrect geometry type."));continue}const m=o.spatialReference??p;y.geometry=b(k(o,m),m,p)}if(a){const m=T(c,y.attributes,a);if(m){e.push(m);continue}}d.add(Y(y,s,r,i,l)),e.push(j(u))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if(s.type==="esriFieldTypeString")return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await E(_,e)}catch{throw new I("geojson-layer","Projection not supported")}}}export{tt as default}; +import{eS as _,o as I,ck as A,gT as Z,cl as Q,ay as $,aU as v,a1 as G,aC as P,f as M,bK as R}from"./story-Doly9N9p.js";import{z,n as N,A as H,j as L,k as Y}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{I as B}from"./FeatureStore-Co2V0sVE-BK6XAR3o.js";import{f as E,h as b}from"./queryUtils-Brxu6254-CDiE0zms.js";import{Z as J}from"./QueryEngine-CH5uUhZK-DRGPyg2C.js";import{Y as U,_ as V,X as W}from"./geojson-CNt_qtQf-X0105Nc8.js";import{A as K,f as X,d as ee}from"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import{G as te,F as T,j,c as F,x as k}from"./sourceUtils-BMeqkJ5g-DcR3VPl5.js";import{o as C}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{i as ie}from"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./main-QGPoLsvl.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-CQrhMeDa.js";import"./PooledRBush-DbfAmeLn-CPHfm9op.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./utils-HtkT8Fn3-Dd_0rdy5.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-1ITtOELE.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./utils-tNxq3jkf-nfQcZo7O.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";const se={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsQueryWithResultType:!0,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class tt{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const s=[],[i]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),r=U(i,{geometryType:e.geometryType}),l=e.fields||r.fields||[],p=e.hasZ!=null?e.hasZ:r.hasZ,d=r.geometryType;let c=e.objectIdField||r.objectIdFieldName||"__OBJECTID";const h=e.spatialReference||_;let a=e.timeInfo;l===r.fields&&r.unknownFields.length>0&&s.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:r.unknownFields}});const o=new C(l);let u=o.get(c);u?(u.type!=="esriFieldTypeString"&&(u.type="esriFieldTypeOID"),u.editable=!1,u.nullable=!1,c=u.name):(u={alias:c,name:c,type:r.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},l.unshift(u));const y={};for(const n of l){if(n.name==null&&(n.name=n.alias),n.alias==null&&(n.alias=n.name),!n.name)throw new I("geojson-layer:invalid-field-name","field name is missing",{field:n});if(!ie.jsonValues.includes(n.type))throw new I("geojson-layer:invalid-field-type",`invalid type for field "${n.name}"`,{field:n});if(n.name!==u.name){const g=A(n);g!==void 0&&(y[n.name]=g)}n.length==null&&(n.length=Z(n))}if(a){if(a.startTimeField){const n=o.get(a.startTimeField);n?(a.startTimeField=n.name,n.type="esriFieldTypeDate"):a.startTimeField=null}if(a.endTimeField){const n=o.get(a.endTimeField);n?(a.endTimeField=n.name,n.type="esriFieldTypeDate"):a.endTimeField=null}if(a.trackIdField){const n=o.get(a.trackIdField);n?a.trackIdField=n.name:(a.trackIdField=null,s.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:a}}))}a.startTimeField||a.endTimeField||(s.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:a}}),a=null)}const m=d?ee(d):void 0,w=o.dateFields.length?{timeZoneIANA:Q}:null,f={warnings:s,featureErrors:[],layerDefinition:{...se,drawingInfo:m??void 0,templates:K(y),extent:void 0,geometryType:d,objectIdField:c,fields:l,hasZ:!!p,timeInfo:a,dateFieldsTimeReference:w}};this._queryEngine=new J({fieldsIndex:C.fromLayerJSON({fields:l,timeInfo:a,dateFieldsTimeReference:w}),geometryType:d,hasM:!1,hasZ:p,objectIdField:c,spatialReference:h,timeInfo:a,featureStore:new B({geometryType:d,hasM:!1,hasZ:p})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(u);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=X(y,c);const x=await this._createFeatures(i);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const O=this._normalizeFeatures(x,f.featureErrors);this._queryEngine.featureStore.addMany(O);const{fullExtent:D,timeExtent:S}=await this._queryEngine.fetchRecomputedExtents();if(f.layerDefinition.extent=D,S){const{start:n,end:g}=S;f.layerDefinition.timeInfo.timeExtent=[n,g]}return f}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([te(t,s),E(e.adds,t),E(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){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=$(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,i);const r=this._normalizeFeatures(i);r&&this._queryEngine.featureStore.addMany(r)},i=>{this._queryEngine.featureStore.clear(),v(i)||G.getLogger("esri.layers.GeoJSONLayer").error(new I("geojson-layer:refresh","An error occurred during refresh",{error:i}))}),await this._waitSnapshotComplete();const{fullExtent:t,timeExtent:s}=await this._queryEngine.fetchRecomputedExtents();return{extent:t,timeExtent:s}}async _createFeatures(e){if(e==null)return[];const{geometryType:t,hasZ:s,objectIdField:i}=this._queryEngine,r=V(e,{geometryType:t,hasZ:s,objectIdField:i});if(!P(this._queryEngine.spatialReference,_))for(const l of r)l.geometry!=null&&(l.geometry=z(b(N(l.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),_,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:s}=this._loadOptions,i=(await M(t??"",{responseType:"json",query:{...s},signal:e})).data;return W(i),i}_normalizeFeatures(e,t){const{objectIdField:s,fieldsIndex:i}=this._queryEngine,r=[];for(const l of e){const p=this._createDefaultAttributes(),d=T(i,p,l.attributes,!0);d?t?.push(d):(this._assignObjectId(p,l.attributes,!0),l.attributes=p,l.objectId=p[s],r.push(l))}return r}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const d of i)r.deleteResults.push(j(d));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:l,timeExtent:p}=await this._queryEngine.fetchRecomputedExtents();return{extent:l,timeExtent:p,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:l,objectIdField:p,spatialReference:d,featureStore:c,fieldsIndex:h}=this._queryEngine,a=[];for(const o of t){if(o.geometry&&i!==R(o.geometry)){s.push(F("Incorrect geometry type."));continue}const u=this._createDefaultAttributes(),y=T(h,u,o.attributes);if(y)s.push(y);else{if(this._assignObjectId(u,o.attributes),o.attributes=u,o.uid!=null){const m=o.attributes[p];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??d;o.geometry=b(k(o.geometry,m),m,d)}a.push(o),s.push(j(o.attributes[p]))}}c.addMany(H([],a,i,l,r,p))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,objectIdField:l,spatialReference:p,featureStore:d,fieldsIndex:c}=this._queryEngine;for(const h of t){const{attributes:a,geometry:o}=h,u=a?.[l];if(u==null){e.push(F(`Identifier field ${l} missing`));continue}if(!d.has(u)){e.push(F(`Feature with object id ${u} missing`));continue}const y=L(d.getFeature(u),s,r,i);if(o!=null){if(s!==R(o)){e.push(F("Incorrect geometry type."));continue}const m=o.spatialReference??p;y.geometry=b(k(o,m),m,p)}if(a){const m=T(c,y.attributes,a);if(m){e.push(m);continue}}d.add(Y(y,s,r,i,l)),e.push(j(u))}}_createObjectIdGenerator(e,t){const s=e.fieldsIndex.get(e.objectIdField);if(s.type==="esriFieldTypeString")return()=>s.name+"-"+Date.now().toString(16);let i=Number.NEGATIVE_INFINITY;for(const r of t)r.objectId&&(i=Math.max(i,r.objectId));return i=Math.max(0,i)+1,()=>i++}_assignObjectId(e,t,s=!1){const i=this._queryEngine.objectIdField;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await E(_,e)}catch{throw new I("geojson-layer","Projection not supported")}}}export{tt as default}; diff --git a/custom-toc-highlight/assets/GeoRSSLayer-DgF8xnYi-BcGrr8g_.js b/custom-toc-highlight/assets/GeoRSSLayer-DgF8xnYi-Cl1Qae5D.js similarity index 76% rename from custom-toc-highlight/assets/GeoRSSLayer-DgF8xnYi-BcGrr8g_.js rename to custom-toc-highlight/assets/GeoRSSLayer-DgF8xnYi-Cl1Qae5D.js index 5c26bb4c..9682e7fc 100644 --- a/custom-toc-highlight/assets/GeoRSSLayer-DgF8xnYi-BcGrr8g_.js +++ b/custom-toc-highlight/assets/GeoRSSLayer-DgF8xnYi-Cl1Qae5D.js @@ -1 +1 @@ -import{gK as n,W as p,f as y,dc as m,C as u,v as o,S as i,a0 as d,n as h,i as c,dS as a,d_ as S,eB as f,e0 as g,d$ as v}from"./story-BfX8CRfG.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as b}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{u as G}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{E as _}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as F}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as x}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as E}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{e as P,_ as k,Z as w}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";const R=["atom","xml"],j={base:a,key:"type",typeMap:{"simple-line":S},errorContext:"symbol"},M={base:a,key:"type",typeMap:{"picture-marker":f,"simple-marker":g},errorContext:"symbol"},D={base:a,key:"type",typeMap:{"simple-fill":v},errorContext:"symbol"};let t=class extends G(x(_(F(E(C(b)))))){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(s=>{const l=s.layerDefinition.drawingInfo.renderer.symbol;l&&l.type==="esriSFS"&&l.outline?.style.includes("esriSFS")&&(l.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?n(this.url,R)||"GeoRSS":e}set title(e){this._set("title",e)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(p).then(()=>this._fetchService(r)).then(s=>{this.read(s,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){const r=this.spatialReference,{data:s}=await y(u.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:m(r)?void 0:r.wkid??JSON.stringify(r)},signal:e});return s}_hasGeometry(e){return this.featureCollections?.some(r=>r.featureSet?.geometryType===e&&r.featureSet.features?.length>0)??!1}};o([i()],t.prototype,"description",void 0),o([i()],t.prototype,"featureCollections",void 0),o([d("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([i({type:h,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([i(P)],t.prototype,"id",void 0),o([i(k)],t.prototype,"legendEnabled",void 0),o([i({types:j,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({types:M,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([i({types:D,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([i({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([i(w)],t.prototype,"url",void 0),o([i({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([i({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([c("esri.layers.GeoRSSLayer")],t);const oe=t;export{oe as default}; +import{gK as n,W as p,f as y,dc as m,C as u,v as o,S as i,a0 as d,n as h,i as c,dS as a,d_ as S,eB as f,e0 as g,d$ as v}from"./story-Doly9N9p.js";import{m as C}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as b}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{u as G}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{E as _}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as F}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as x}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as E}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{e as P,_ as k,Z as w}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";const R=["atom","xml"],j={base:a,key:"type",typeMap:{"simple-line":S},errorContext:"symbol"},M={base:a,key:"type",typeMap:{"picture-marker":f,"simple-marker":g},errorContext:"symbol"},D={base:a,key:"type",typeMap:{"simple-fill":v},errorContext:"symbol"};let t=class extends G(x(_(F(E(C(b)))))){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(s=>{const l=s.layerDefinition.drawingInfo.renderer.symbol;l&&l.type==="esriSFS"&&l.outline?.style.includes("esriSFS")&&(l.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?n(this.url,R)||"GeoRSS":e}set title(e){this._set("title",e)}load(e){const r=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(p).then(()=>this._fetchService(r)).then(s=>{this.read(s,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){const r=this.spatialReference,{data:s}=await y(u.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:m(r)?void 0:r.wkid??JSON.stringify(r)},signal:e});return s}_hasGeometry(e){return this.featureCollections?.some(r=>r.featureSet?.geometryType===e&&r.featureSet.features?.length>0)??!1}};o([i()],t.prototype,"description",void 0),o([i()],t.prototype,"featureCollections",void 0),o([d("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([i({type:h,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([i(P)],t.prototype,"id",void 0),o([i(k)],t.prototype,"legendEnabled",void 0),o([i({types:j,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({types:M,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([i({types:D,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([i({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([i(w)],t.prototype,"url",void 0),o([i({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([i({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([c("esri.layers.GeoRSSLayer")],t);const oe=t;export{oe as default}; diff --git a/custom-toc-highlight/assets/GeoRSSLayerView2D-BLTYupUX-BfrBO27g.js b/custom-toc-highlight/assets/GeoRSSLayerView2D-BLTYupUX-BfrBO27g.js deleted file mode 100644 index 992f1f3d..00000000 --- a/custom-toc-highlight/assets/GeoRSSLayerView2D-BLTYupUX-BfrBO27g.js +++ /dev/null @@ -1 +0,0 @@ -import{ah as l,aL as h,ag as g,bL as w,v as f,i as d}from"./story-BfX8CRfG.js";import{t as u,p as n}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{O as b}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{X as V,Y as S}from"./LayerView-Bish-E63-rB2WUWF4.js";import{d as _}from"./GraphicContainer-DuOHUciE-sEoQdKXZ.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-DMrrhOCh.js";import"./main-ugzBrWNm.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./AGraphicContainer-LUCT6Gle-Dvv0TF4N.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";let y=class extends V(S){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(t,o){if(!this.graphicsViews.length)return null;const p=this.layer;return this.graphicsViews.reverse().flatMap(r=>{const i=this._popupTemplates.get(r),e=r.hitTest(t);for(const m of e)m.layer=p,m.sourceLayer=p,m.popupTemplate=i;return e}).map(r=>({type:"graphic",graphic:r,layer:p,mapPoint:t}))}update(t){if(this.graphicsViews)for(const o of this.graphicsViews)o.processUpdate(t)}attach(){this.addAttachHandles([l(()=>this.layer?.featureCollections,t=>{this._clear();for(const{popupInfo:o,featureSet:p,layerDefinition:r}of t){const i=b.fromJSON(p),e=new g(i.features),m=r.drawingInfo,c=o?w.fromJSON(o):null,s=u(m.renderer),a=new v({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:e,renderer:s,container:new _(this.view.featuresTilingScheme)});this._graphicsViewMap[i.geometryType]=a,this._popupTemplates.set(a,c),i.geometryType!=="polygon"||this.layer.polygonSymbol?i.geometryType!=="polyline"||this.layer.lineSymbol?i.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=s.symbol):this.layer.lineSymbol=s.symbol:this.layer.polygonSymbol=s.symbol,this.graphicsViews.push(a),this.container.addChild(a.container)}},h),l(()=>this.layer?.polygonSymbol,t=>{this._graphicsViewMap.polygon.renderer=new n({symbol:t})},h),l(()=>this.layer?.lineSymbol,t=>{this._graphicsViewMap.polyline.renderer=new n({symbol:t})},h),l(()=>this.layer?.pointSymbol,t=>{this._graphicsViewMap.point.renderer=new n({symbol:t})},h)])}detach(){this._clear()}moveEnd(){}viewChange(){for(const t of this.graphicsViews)t.viewChange()}_clear(){this.container.removeAllChildren();for(const t of this.graphicsViews)t.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};y=f([d("esri.views.2d.layers.GeoRSSLayerView2D")],y);const qi=y;export{qi as default}; diff --git a/custom-toc-highlight/assets/GeoRSSLayerView2D-BLTYupUX-D6HtIAUl.js b/custom-toc-highlight/assets/GeoRSSLayerView2D-BLTYupUX-D6HtIAUl.js new file mode 100644 index 00000000..2419c5de --- /dev/null +++ b/custom-toc-highlight/assets/GeoRSSLayerView2D-BLTYupUX-D6HtIAUl.js @@ -0,0 +1 @@ +import{ah as l,aL as h,ag as g,bL as w,v as f,i as d}from"./story-Doly9N9p.js";import{t as u,p as n}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{O as b}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{X as V,Y as S}from"./LayerView-Bish-E63-DK1SFHE3.js";import{d as _}from"./GraphicContainer-DuOHUciE-XlTfJEn3.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-DdVMjjMv.js";import"./main-QGPoLsvl.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";let y=class extends V(S){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(t,o){if(!this.graphicsViews.length)return null;const p=this.layer;return this.graphicsViews.reverse().flatMap(r=>{const i=this._popupTemplates.get(r),e=r.hitTest(t);for(const m of e)m.layer=p,m.sourceLayer=p,m.popupTemplate=i;return e}).map(r=>({type:"graphic",graphic:r,layer:p,mapPoint:t}))}update(t){if(this.graphicsViews)for(const o of this.graphicsViews)o.processUpdate(t)}attach(){this.addAttachHandles([l(()=>this.layer?.featureCollections,t=>{this._clear();for(const{popupInfo:o,featureSet:p,layerDefinition:r}of t){const i=b.fromJSON(p),e=new g(i.features),m=r.drawingInfo,c=o?w.fromJSON(o):null,s=u(m.renderer),a=new v({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:e,renderer:s,container:new _(this.view.featuresTilingScheme)});this._graphicsViewMap[i.geometryType]=a,this._popupTemplates.set(a,c),i.geometryType!=="polygon"||this.layer.polygonSymbol?i.geometryType!=="polyline"||this.layer.lineSymbol?i.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=s.symbol):this.layer.lineSymbol=s.symbol:this.layer.polygonSymbol=s.symbol,this.graphicsViews.push(a),this.container.addChild(a.container)}},h),l(()=>this.layer?.polygonSymbol,t=>{this._graphicsViewMap.polygon.renderer=new n({symbol:t})},h),l(()=>this.layer?.lineSymbol,t=>{this._graphicsViewMap.polyline.renderer=new n({symbol:t})},h),l(()=>this.layer?.pointSymbol,t=>{this._graphicsViewMap.point.renderer=new n({symbol:t})},h)])}detach(){this._clear()}moveEnd(){}viewChange(){for(const t of this.graphicsViews)t.viewChange()}_clear(){this.container.removeAllChildren();for(const t of this.graphicsViews)t.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};y=f([d("esri.views.2d.layers.GeoRSSLayerView2D")],y);const qi=y;export{qi as default}; diff --git a/custom-toc-highlight/assets/GeometryUtils-NHgB9gGQ-DrtZFKub.js b/custom-toc-highlight/assets/GeometryUtils-NHgB9gGQ-DtpzGERq.js similarity index 99% rename from custom-toc-highlight/assets/GeometryUtils-NHgB9gGQ-DrtZFKub.js rename to custom-toc-highlight/assets/GeometryUtils-NHgB9gGQ-DtpzGERq.js index 41bb11e6..9a5affcf 100644 --- a/custom-toc-highlight/assets/GeometryUtils-NHgB9gGQ-DrtZFKub.js +++ b/custom-toc-highlight/assets/GeometryUtils-NHgB9gGQ-DtpzGERq.js @@ -1 +1 @@ -import{hS as S}from"./story-BfX8CRfG.js";const z=512;var P,p;(function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon"})(P||(P={}));let f=class R{constructor(i,s){this.x=i,this.y=s}clone(){return new R(this.x,this.y)}equals(i,s){return i===this.x&&s===this.y}isEqual(i){return i.x===this.x&&i.y===this.y}setCoords(i,s){return this.x=i,this.y=s,this}normalize(){const i=this.x,s=this.y,h=Math.sqrt(i*i+s*s);return this.x/=h,this.y/=h,this}rightPerpendicular(){const i=this.x;return this.x=this.y,this.y=-i,this}leftPerpendicular(){const i=this.x;return this.x=-this.y,this.y=i,this}move(i,s){return this.x+=i,this.y+=s,this}assign(i){return this.x=i.x,this.y=i.y,this}assignAdd(i,s){return this.x=i.x+s.x,this.y=i.y+s.y,this}assignSub(i,s){return this.x=i.x-s.x,this.y=i.y-s.y,this}rotate(i,s){const h=this.x,e=this.y;return this.x=h*i-e*s,this.y=h*s+e*i,this}scale(i){return this.x*=i,this.y*=i,this}length(){const i=this.x,s=this.y;return Math.sqrt(i*i+s*s)}sub(i){return this.x-=i.x,this.y-=i.y,this}add(i){return this.x+=i.x,this.y+=i.y,this}static distance(i,s){const h=s.x-i.x,e=s.y-i.y;return Math.sqrt(h*h+e*e)}static add(i,s){return new R(i.x+s.x,i.y+s.y)}static sub(i,s){return new R(i.x-s.x,i.y-s.y)}};class v{constructor(i,s,h){this.ratio=i,this.x=s,this.y=h}}let C=class{constructor(t,i,s,h=8,e=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=h,this._pixelMargin=e,this._tileSize=z*h,this._dz=t,this._yPos=i,this._xPos=s}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>s&&(i=s),this._margin=i,this._xmin=s*this._xPos-i,this._ymin=s*this._yPos-i,this._xmax=this._xmin+s+2*i,this._ymax=this._ymin+s+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 f(t,i),this._firstPt=new f(t,i),this._dist=0}lineTo(t,i){const s=this._isIn(t,i),h=new f(t,i),e=f.distance(this._prevPt,h);let l,n,x,_,r,g,m,u;if(s)this._prevIsIn?this._lineTo(t,i,!0):(l=this._prevPt,n=h,x=this._intersect(n,l),this._start=this._dist+e*(1-this._r),this._lineTo(x.x,x.y,!0),this._lineTo(n.x,n.y,!0));else if(this._prevIsIn)n=this._prevPt,l=h,x=this._intersect(n,l),this._lineTo(x.x,x.y,!0),this._lineTo(l.x,l.y,!1);else{const a=this._prevPt,o=h;if(a.x<=this._xmin&&o.x<=this._xmin||a.x>=this._xmax&&o.x>=this._xmax||a.y<=this._ymin&&o.y<=this._ymin||a.y>=this._ymax&&o.y>=this._ymax)this._lineTo(o.x,o.y,!1);else{const y=[];if((a.xthis._xmin||a.x>this._xmin&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmin,u))),(a.xthis._xmax||a.x>this._xmax&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmax,u))),(a.ythis._ymin||a.y>this._ymin&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymin))),(a.ythis._ymax||a.y>this._ymax&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymax))),y.length===0)r?g?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):g?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(y.length>1&&y[0].ratio>y[1].ratio)this._start=this._dist+e*y[1].ratio,this._lineTo(y[1].x,y[1].y,!0),this._lineTo(y[0].x,y[0].y,!0);else{this._start=this._dist+e*y[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 s=this._line;let h=s.length;for(;h>=4&&(s[0].x===s[1].x&&s[0].x===s[h-2].x||s[0].y===s[1].y&&s[0].y===s[h-2].y);)s.pop(),s[0].x=s[h-2].x,s[0].y=s[h-2].y,--h}}result(t=!0){return this._pushLine(),this._lines.length===0?null:(this._type===P.Polygon&&t&&D.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==P.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,i=t.length;if(i===0)return null;const s=[];for(let h=0;h=this._xmin&&t<=this._xmax&&i>=this._ymin&&i<=this._ymax}_intersect(t,i){let s,h,e;if(i.x>=this._xmin&&i.x<=this._xmax)h=i.y<=this._ymin?this._ymin:this._ymax,e=(h-t.y)/(i.y-t.y),s=t.x+e*(i.x-t.x);else if(i.y>=this._ymin&&i.y<=this._ymax)s=i.x<=this._xmin?this._xmin:this._xmax,e=(s-t.x)/(i.x-t.x),h=t.y+e*(i.y-t.y);else{h=i.y<=this._ymin?this._ymin:this._ymax,s=i.x<=this._xmin?this._xmin:this._xmax;const l=(s-t.x)/(i.x-t.x),n=(h-t.y)/(i.y-t.y);l0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,i,s){this._type!==P.Polygon?s&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new f(t,i))):(s||(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 f(t,i)),this._isH=!1,this._isV=!1)}_lineTo(t,i,s){let h,e;if(this._type!==P.Polygon)if(s){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 f(t,i))}else this._line&&this._line.length>0&&this._pushLine();else if(s||(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 l=h.x===t,n=h.y===i;if(l&&n)return;this._isH&&l||this._isV&&n?(h.x=t,h.y=i,e=this._line[this._line.length-2],e.x===t&&e.y===i?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(e=this._line[this._line.length-2],this._isH=e.x===t,this._isV=e.y===i)):(this._isH=e.x===t,this._isV=e.y===i)):(this._line.push(new f(t,i)),this._isH=l,this._isV=n)}else this._line.push(new f(t,i))}};class A{setExtent(i){this._ratio=i===4096?1:4096/i}get validateTessellation(){return this._ratio<1}reset(i){this._lines=[],this._line=null}moveTo(i,s){this._line&&this._lines.push(this._line),this._line=[];const h=this._ratio;this._line.push(new f(i*h,s*h))}lineTo(i,s){const h=this._ratio;this._line.push(new f(i*h,s*h))}close(){const i=this._line;i&&!i[0].isEqual(i[i.length-1])&&i.push(i[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}}(function(t){t[t.sideLeft=0]="sideLeft",t[t.sideRight=1]="sideRight",t[t.sideTop=2]="sideTop",t[t.sideBottom=3]="sideBottom"})(p||(p={}));let D=class T{static simplify(i,s,h){if(!h)return;const e=-s,l=i+s,n=-s,x=i+s,_=[],r=[],g=h.length;for(let u=0;uo.y?(_.push(u),_.push(c),_.push(p.sideLeft),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideLeft),r.push(-1))),y.x>=l&&(y.y=x&&(y.x>o.x?(_.push(u),_.push(c),_.push(p.sideBottom),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideBottom),r.push(-1)))),y=o}if(_.length===0||r.length===0)return;T.fillParent(h,r,_),T.fillParent(h,_,r);const m=[];T.calcDeltas(m,r,_),T.calcDeltas(m,_,r),T.addDeltas(m,h)}static fillParent(i,s,h){const e=h.length,l=s.length;for(let n=0;n1&&e[n-2]===l?0:(e.push(l),T.calcDelta(l,h,s,e)+1)}static addDeltas(i,s){const h=i.length;let e=0;for(let l=0;le&&(e=n)}for(let l=0;lt>=i&&t<=s||t>=s&&t<=i,O=Number.POSITIVE_INFINITY,L=Math.PI,U=2*L,q=128/L,E=256/360,F=L/180,N=1/Math.LN2;function b(t,i){return(t%=i)>=0?t:t+i}function W(t){return b(t*q,256)}function Y(t){return b(t*E,256)}function j(t){return Math.log(t)*N}function G(t,i,s){return t*(1-s)+i*s}const V=8,k=14,B=16;function J(t){return V+Math.max((t-k)*B,0)}function K(t,i,s){let h,e,l,n=0;for(const x of s){h=x.length;for(let _=1;_i!=l.y>i&&((l.x-e.x)*(i-e.y)-(l.y-e.y)*(t-e.x)>0?n++:n--)}return n!==0}function Q(t,i,s,h){let e,l,n,x;const _=h*h;for(const r of s){const g=r.length;if(!(g<2)){e=r[0].x,l=r[0].y;for(let m=1;m>this._dz;i>s&&(i=s),this._margin=i,this._xmin=s*this._xPos-i,this._ymin=s*this._yPos-i,this._xmax=this._xmin+s+2*i,this._ymax=this._ymin+s+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 f(t,i),this._firstPt=new f(t,i),this._dist=0}lineTo(t,i){const s=this._isIn(t,i),h=new f(t,i),e=f.distance(this._prevPt,h);let l,n,x,_,r,g,m,u;if(s)this._prevIsIn?this._lineTo(t,i,!0):(l=this._prevPt,n=h,x=this._intersect(n,l),this._start=this._dist+e*(1-this._r),this._lineTo(x.x,x.y,!0),this._lineTo(n.x,n.y,!0));else if(this._prevIsIn)n=this._prevPt,l=h,x=this._intersect(n,l),this._lineTo(x.x,x.y,!0),this._lineTo(l.x,l.y,!1);else{const a=this._prevPt,o=h;if(a.x<=this._xmin&&o.x<=this._xmin||a.x>=this._xmax&&o.x>=this._xmax||a.y<=this._ymin&&o.y<=this._ymin||a.y>=this._ymax&&o.y>=this._ymax)this._lineTo(o.x,o.y,!1);else{const y=[];if((a.xthis._xmin||a.x>this._xmin&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmin,u))),(a.xthis._xmax||a.x>this._xmax&&o.x=this._ymax?g=!0:y.push(new v(_,this._xmax,u))),(a.ythis._ymin||a.y>this._ymin&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymin))),(a.ythis._ymax||a.y>this._ymax&&o.y=this._xmax?r=!0:y.push(new v(_,m,this._ymax))),y.length===0)r?g?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):g?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(y.length>1&&y[0].ratio>y[1].ratio)this._start=this._dist+e*y[1].ratio,this._lineTo(y[1].x,y[1].y,!0),this._lineTo(y[0].x,y[0].y,!0);else{this._start=this._dist+e*y[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 s=this._line;let h=s.length;for(;h>=4&&(s[0].x===s[1].x&&s[0].x===s[h-2].x||s[0].y===s[1].y&&s[0].y===s[h-2].y);)s.pop(),s[0].x=s[h-2].x,s[0].y=s[h-2].y,--h}}result(t=!0){return this._pushLine(),this._lines.length===0?null:(this._type===P.Polygon&&t&&D.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==P.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,i=t.length;if(i===0)return null;const s=[];for(let h=0;h=this._xmin&&t<=this._xmax&&i>=this._ymin&&i<=this._ymax}_intersect(t,i){let s,h,e;if(i.x>=this._xmin&&i.x<=this._xmax)h=i.y<=this._ymin?this._ymin:this._ymax,e=(h-t.y)/(i.y-t.y),s=t.x+e*(i.x-t.x);else if(i.y>=this._ymin&&i.y<=this._ymax)s=i.x<=this._xmin?this._xmin:this._xmax,e=(s-t.x)/(i.x-t.x),h=t.y+e*(i.y-t.y);else{h=i.y<=this._ymin?this._ymin:this._ymax,s=i.x<=this._xmin?this._xmin:this._xmax;const l=(s-t.x)/(i.x-t.x),n=(h-t.y)/(i.y-t.y);l0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===P.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,i,s){this._type!==P.Polygon?s&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new f(t,i))):(s||(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 f(t,i)),this._isH=!1,this._isV=!1)}_lineTo(t,i,s){let h,e;if(this._type!==P.Polygon)if(s){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 f(t,i))}else this._line&&this._line.length>0&&this._pushLine();else if(s||(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 l=h.x===t,n=h.y===i;if(l&&n)return;this._isH&&l||this._isV&&n?(h.x=t,h.y=i,e=this._line[this._line.length-2],e.x===t&&e.y===i?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(e=this._line[this._line.length-2],this._isH=e.x===t,this._isV=e.y===i)):(this._isH=e.x===t,this._isV=e.y===i)):(this._line.push(new f(t,i)),this._isH=l,this._isV=n)}else this._line.push(new f(t,i))}};class A{setExtent(i){this._ratio=i===4096?1:4096/i}get validateTessellation(){return this._ratio<1}reset(i){this._lines=[],this._line=null}moveTo(i,s){this._line&&this._lines.push(this._line),this._line=[];const h=this._ratio;this._line.push(new f(i*h,s*h))}lineTo(i,s){const h=this._ratio;this._line.push(new f(i*h,s*h))}close(){const i=this._line;i&&!i[0].isEqual(i[i.length-1])&&i.push(i[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}}(function(t){t[t.sideLeft=0]="sideLeft",t[t.sideRight=1]="sideRight",t[t.sideTop=2]="sideTop",t[t.sideBottom=3]="sideBottom"})(p||(p={}));let D=class T{static simplify(i,s,h){if(!h)return;const e=-s,l=i+s,n=-s,x=i+s,_=[],r=[],g=h.length;for(let u=0;uo.y?(_.push(u),_.push(c),_.push(p.sideLeft),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideLeft),r.push(-1))),y.x>=l&&(y.y=x&&(y.x>o.x?(_.push(u),_.push(c),_.push(p.sideBottom),_.push(-1)):(r.push(u),r.push(c),r.push(p.sideBottom),r.push(-1)))),y=o}if(_.length===0||r.length===0)return;T.fillParent(h,r,_),T.fillParent(h,_,r);const m=[];T.calcDeltas(m,r,_),T.calcDeltas(m,_,r),T.addDeltas(m,h)}static fillParent(i,s,h){const e=h.length,l=s.length;for(let n=0;n1&&e[n-2]===l?0:(e.push(l),T.calcDelta(l,h,s,e)+1)}static addDeltas(i,s){const h=i.length;let e=0;for(let l=0;le&&(e=n)}for(let l=0;lt>=i&&t<=s||t>=s&&t<=i,O=Number.POSITIVE_INFINITY,L=Math.PI,U=2*L,q=128/L,E=256/360,F=L/180,N=1/Math.LN2;function b(t,i){return(t%=i)>=0?t:t+i}function W(t){return b(t*q,256)}function Y(t){return b(t*E,256)}function j(t){return Math.log(t)*N}function G(t,i,s){return t*(1-s)+i*s}const V=8,k=14,B=16;function J(t){return V+Math.max((t-k)*B,0)}function K(t,i,s){let h,e,l,n=0;for(const x of s){h=x.length;for(let _=1;_i!=l.y>i&&((l.x-e.x)*(i-e.y)-(l.y-e.y)*(t-e.x)>0?n++:n--)}return n!==0}function Q(t,i,s,h){let e,l,n,x;const _=h*h;for(const r of s){const g=r.length;if(!(g<2)){e=r[0].x,l=r[0].y;for(let m=1;mr.hasData)){switch(e.drawPhase){case s.MAP:this._renderChildren(e,i.All);break;case s.HIGHLIGHT:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){t(e,!1,r=>{this._renderChildren(r,i.Highlight)})}};export{l as d}; +import{E as s,R as i,h as t}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{K as h}from"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";let l=class extends h{renderChildren(e){for(const r of this.children)r.setTransform(e.state);if(super.renderChildren(e),this._updateAttributeView(),this.children.some(r=>r.hasData)){switch(e.drawPhase){case s.MAP:this._renderChildren(e,i.All);break;case s.HIGHLIGHT:this.hasHighlight&&this._renderHighlight(e)}this._boundsRenderer&&this._boundsRenderer.doRender(e)}}_renderHighlight(e){t(e,!1,r=>{this._renderChildren(r,i.Highlight)})}};export{l as d}; diff --git a/custom-toc-highlight/assets/GraphicsCollection-CWTXNZOX-Bo9O0MYR.js b/custom-toc-highlight/assets/GraphicsCollection-CWTXNZOX-BdlDfR8M.js similarity index 94% rename from custom-toc-highlight/assets/GraphicsCollection-CWTXNZOX-Bo9O0MYR.js rename to custom-toc-highlight/assets/GraphicsCollection-CWTXNZOX-BdlDfR8M.js index 4c9b395c..b82c5c1d 100644 --- a/custom-toc-highlight/assets/GraphicsCollection-CWTXNZOX-Bo9O0MYR.js +++ b/custom-toc-highlight/assets/GraphicsCollection-CWTXNZOX-BdlDfR8M.js @@ -1 +1 @@ -import{v as r,S as p,i as a,dz as w,bi as l,bG as y,ag as o,dA as _,am as c}from"./story-BfX8CRfG.js";let s=class extends o{constructor(e){super(e),this.addHandles([this.on("before-add",t=>{t.item==null&&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(o.ofType(this.itemType.Type))(e):new o(e)}};function u(e,t){return{type:e,cast:_,set(h){const n=c(h,this._get(t),e);n.owner=this,this._set(t,n)}}}r([p()],s.prototype,"owner",null),s=r([a("esri.core.support.OwningCollection")],s);let i=class extends s{_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)}};r([w({Type:l,ensureType:y(l)})],i.prototype,"itemType",void 0),i=r([a("esri.support.GraphicsCollection")],i);export{i as o,s,u}; +import{v as r,S as p,i as a,dz as w,bi as l,bG as y,ag as o,dA as _,am as c}from"./story-Doly9N9p.js";let s=class extends o{constructor(e){super(e),this.addHandles([this.on("before-add",t=>{t.item==null&&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(o.ofType(this.itemType.Type))(e):new o(e)}};function u(e,t){return{type:e,cast:_,set(h){const n=c(h,this._get(t),e);n.owner=this,this._set(t,n)}}}r([p()],s.prototype,"owner",null),s=r([a("esri.core.support.OwningCollection")],s);let i=class extends s{_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)}};r([w({Type:l,ensureType:y(l)})],i.prototype,"itemType",void 0),i=r([a("esri.support.GraphicsCollection")],i);export{i as o,s,u}; diff --git a/custom-toc-highlight/assets/GraphicsLayer-DfeGaYc1-BYhO2Zs8.js b/custom-toc-highlight/assets/GraphicsLayer-DfeGaYc1-DRpZ_f0G.js similarity index 58% rename from custom-toc-highlight/assets/GraphicsLayer-DfeGaYc1-BYhO2Zs8.js rename to custom-toc-highlight/assets/GraphicsLayer-DfeGaYc1-DRpZ_f0G.js index 1bd2e62f..c40eede1 100644 --- a/custom-toc-highlight/assets/GraphicsLayer-DfeGaYc1-BYhO2Zs8.js +++ b/custom-toc-highlight/assets/GraphicsLayer-DfeGaYc1-DRpZ_f0G.js @@ -1 +1 @@ -import{v as e,S as i,i as s}from"./story-BfX8CRfG.js";import{o,u as a}from"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import{D as h}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{u as n}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{S as m}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{q as d}from"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";let t=class extends n(m(h)){constructor(r){super(r),this.elevationInfo=null,this.graphics=new o,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(r){return this.graphics.add(r),this}addMany(r){return this.graphics.addMany(r),this}removeAll(){return this.graphics.removeAll(),this}remove(r){this.graphics.remove(r)}removeMany(r){this.graphics.removeMany(r)}on(r,p){return super.on(r,p)}graphicChanged(r){this.emit("graphic-update",r)}};e([i({type:d})],t.prototype,"elevationInfo",void 0),e([i(a(o,"graphics"))],t.prototype,"graphics",void 0),e([i({type:["show","hide"]})],t.prototype,"listMode",void 0),e([i()],t.prototype,"screenSizePerspectiveEnabled",void 0),e([i({readOnly:!0})],t.prototype,"type",void 0),e([i({constructOnly:!0})],t.prototype,"internal",void 0),t=e([s("esri.layers.GraphicsLayer")],t);const E=t;export{E as default}; +import{v as e,S as i,i as s}from"./story-Doly9N9p.js";import{o,u as a}from"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import{D as h}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{u as n}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{S as m}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{q as d}from"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";let t=class extends n(m(h)){constructor(r){super(r),this.elevationInfo=null,this.graphics=new o,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(r){return this.graphics.add(r),this}addMany(r){return this.graphics.addMany(r),this}removeAll(){return this.graphics.removeAll(),this}remove(r){this.graphics.remove(r)}removeMany(r){this.graphics.removeMany(r)}on(r,p){return super.on(r,p)}graphicChanged(r){this.emit("graphic-update",r)}};e([i({type:d})],t.prototype,"elevationInfo",void 0),e([i(a(o,"graphics"))],t.prototype,"graphics",void 0),e([i({type:["show","hide"]})],t.prototype,"listMode",void 0),e([i()],t.prototype,"screenSizePerspectiveEnabled",void 0),e([i({readOnly:!0})],t.prototype,"type",void 0),e([i({constructOnly:!0})],t.prototype,"internal",void 0),t=e([s("esri.layers.GraphicsLayer")],t);const E=t;export{E as default}; diff --git a/custom-toc-highlight/assets/GraphicsLayerView2D-CGXlTqHO-BL8cF9rd.js b/custom-toc-highlight/assets/GraphicsLayerView2D-CGXlTqHO-BL8cF9rd.js new file mode 100644 index 00000000..3a1b4917 --- /dev/null +++ b/custom-toc-highlight/assets/GraphicsLayerView2D-CGXlTqHO-BL8cF9rd.js @@ -0,0 +1 @@ +import{aA as s,bi as a,ag as g,aq as l,a2 as h,v as m,S as n,i as c}from"./story-Doly9N9p.js";import{X as d,Y as u}from"./LayerView-Bish-E63-DK1SFHE3.js";import{d as w}from"./GraphicContainer-DuOHUciE-XlTfJEn3.js";import{X as y}from"./GraphicsView2D-C4wYE2ut-DdVMjjMv.js";import{i as V}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./main-QGPoLsvl.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";let e=class extends d(u){constructor(){super(...arguments),this._highlightCounter=new V}attach(){this.graphicsView=new y({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new w(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles([this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),this.watch("layer.visible",i=>{i&&(this.graphicsView.update({state:this.view.state}),this.graphicsView.pushUpdate())})]),this._updateHighlights()}detach(){this.container.removeAllChildren(),this.graphicsView=s(this.graphicsView)}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i).map(t=>({type:"graphic",graphic:t,mapPoint:i,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i,t="default"){let r;typeof i=="number"?r=[i]:i instanceof a?r=[i.uid]:Array.isArray(i)&&i.length>0?r=typeof i[0]=="number"?i:i.map(o=>o&&o.uid):g.isCollection(i)&&i.length>0&&(r=i.map(o=>o&&o.uid).toArray());const p=r?.filter(l);return p?.length?(this._addHighlight(p,t),h(()=>this._removeHighlight(p,t))):h()}_addHighlight(i,t){this._highlightCounter.addGroup(i,t),this._updateHighlights()}_removeHighlight(i,t){this._highlightCounter.deleteGroup(i,t),this._updateHighlights()}_updateHighlights(){const i=[];for(const t of this._highlightCounter.ids()){const r=this._highlightCounter.getHighlightGroups(t),p=this._getHighlightBits(r);i.push({objectId:t,highlightFlags:p})}this.graphicsView?.setHighlight(i)}};m([n()],e.prototype,"graphicsView",void 0),e=m([c("esri.views.2d.layers.GraphicsLayerView2D")],e);const yt=e;export{yt as default}; diff --git a/custom-toc-highlight/assets/GraphicsLayerView2D-CGXlTqHO-C-E0GBj7.js b/custom-toc-highlight/assets/GraphicsLayerView2D-CGXlTqHO-C-E0GBj7.js deleted file mode 100644 index 8581c066..00000000 --- a/custom-toc-highlight/assets/GraphicsLayerView2D-CGXlTqHO-C-E0GBj7.js +++ /dev/null @@ -1 +0,0 @@ -import{aA as s,bi as a,ag as g,aq as l,a2 as h,v as m,S as n,i as c}from"./story-BfX8CRfG.js";import{X as d,Y as u}from"./LayerView-Bish-E63-rB2WUWF4.js";import{d as w}from"./GraphicContainer-DuOHUciE-sEoQdKXZ.js";import{X as y}from"./GraphicsView2D-C4wYE2ut-DMrrhOCh.js";import{i as V}from"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./main-ugzBrWNm.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./AGraphicContainer-LUCT6Gle-Dvv0TF4N.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";let e=class extends d(u){constructor(){super(...arguments),this._highlightCounter=new V}attach(){this.graphicsView=new y({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new w(this.view.featuresTilingScheme),layerId:this.layer.id}),this.container.addChild(this.graphicsView.container),this.addAttachHandles([this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),this.watch("layer.visible",i=>{i&&(this.graphicsView.update({state:this.view.state}),this.graphicsView.pushUpdate())})]),this._updateHighlights()}detach(){this.container.removeAllChildren(),this.graphicsView=s(this.graphicsView)}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i).map(t=>({type:"graphic",graphic:t,mapPoint:i,layer:this.layer})):null}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i,t="default"){let r;typeof i=="number"?r=[i]:i instanceof a?r=[i.uid]:Array.isArray(i)&&i.length>0?r=typeof i[0]=="number"?i:i.map(o=>o&&o.uid):g.isCollection(i)&&i.length>0&&(r=i.map(o=>o&&o.uid).toArray());const p=r?.filter(l);return p?.length?(this._addHighlight(p,t),h(()=>this._removeHighlight(p,t))):h()}_addHighlight(i,t){this._highlightCounter.addGroup(i,t),this._updateHighlights()}_removeHighlight(i,t){this._highlightCounter.deleteGroup(i,t),this._updateHighlights()}_updateHighlights(){const i=[];for(const t of this._highlightCounter.ids()){const r=this._highlightCounter.getHighlightGroups(t),p=this._getHighlightBits(r);i.push({objectId:t,highlightFlags:p})}this.graphicsView?.setHighlight(i)}};m([n()],e.prototype,"graphicsView",void 0),e=m([c("esri.views.2d.layers.GraphicsLayerView2D")],e);const yt=e;export{yt as default}; diff --git a/custom-toc-highlight/assets/GraphicsView2D-C4wYE2ut-DMrrhOCh.js b/custom-toc-highlight/assets/GraphicsView2D-C4wYE2ut-DdVMjjMv.js similarity index 96% rename from custom-toc-highlight/assets/GraphicsView2D-C4wYE2ut-DMrrhOCh.js rename to custom-toc-highlight/assets/GraphicsView2D-C4wYE2ut-DdVMjjMv.js index 347581c2..172b6891 100644 --- a/custom-toc-highlight/assets/GraphicsView2D-C4wYE2ut-DMrrhOCh.js +++ b/custom-toc-highlight/assets/GraphicsView2D-C4wYE2ut-DdVMjjMv.js @@ -1,3 +1,3 @@ -import{bR as W,j as L,K as y,ah as X,aq as B,b9 as Y,$ as N,bh as g,cb as Q,iX as J,ca as K,eQ as V,iY as ee,iZ as te,bK as E,O as se,v as m,S as _,i as re,ht as ie,aG as oe,g_ as ae,et as T,i_ as ne,h0 as he,i$ as de}from"./story-BfX8CRfG.js";import{o as ce}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{a as le,bo as ue,k as pe,bp as me,bq as z,br as q,bs as A}from"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import{c as _e}from"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import{D as ye,t as v,h as ge,j as fe,k as be}from"./definitions-DJSdSb77-DkoRHaVx.js";import{i as we}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{o as Ie,m as ve,u as Se,P as xe,W as Re,e as Me}from"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import{_ as Te,h as Ge,j as je,a as Ce,e as ze,J as Pe,Z as Ue,Y as ke,X as $e,K as qe,W as P}from"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import{z as Ae,R as Oe,C as U}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{c as x}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{V as Ve}from"./Tile-D75RMC64-Dj1SOP3K.js";import{l as Ee}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{H as De}from"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";import{f as Fe,h as Ze}from"./queryUtils-Brxu6254-PPvpiP5X.js";async function He(r,e,t){const s=[],i={scaleInfo:je(r),scaleExpression:null};for(const o of e)switch(o.type){case"marker":if(o.animationParams){s.push(...$e(t.instances.animatedMarker,o,P,i));break}s.push(...qe(t.instances.marker,o,P,i));break;case"fill":o.spriteRasterizationParam==null?s.push(...Ue(t.instances.fill,o,i)):s.push(...ke(t.instances.complexFill,o,!1,i));break;case"line":o.spriteRasterizationParam?s.push(...ze(t.instances.texturedLine,o,!1,i)):s.push(...Pe(t.instances.line,o,!1,i));break;case"text":s.push(...Ce(t.instances.text,o,P,i))}return s}class G extends Me{static from(e,t,s){return new G(e,t,s)}constructor(e,t,s){super(s),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const i=t.lod;i.wrap&&(this._wrappingInfo={worldSizeX:i.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(e){return this._current.attributes[e]!=null}field(e){return this.readAttribute(e)}get geometryType(){const e=E(this._current.geometry);return e==="esriGeometryPoint"?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new G(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1v*(i-1)&&(e[o]=a-v*i)}_readX(){const e=this._readGeometry();return e!=null?e.coords[0]:0}_readY(){const e=this._readGeometry();return e!=null?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=he(this._current.projectedGeometry),t=new x([],e);return U(new x,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const e=this._current.projectedGeometry,t=ne(e.paths,this.hasZ),s=new x([],t);return U(new x,s,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const s=this._current.attributes[e];if(s!==void 0)return s;const i=e.toLowerCase();for(const o in this._current.attributes)if(o.toLowerCase()===i)return this._current.attributes[o]}_readAttributes(){return this._current.attributes}}class k{static fromGraphic(e,t,s,i){return new k(e.geometry,t,e.attributes,e.visible,e.uid,e.version,s,i)}constructor(e,t,s,i,o,a,n,l){this.geometry=e,this.symbol=t,this.attributes=s,this.visible=i,this.objectId=o,this._version=a,this.zOrder=n,this.displayId=l,this.bounds=g(),this.prevBounds=g(),this.size=[0,0,0,0]}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}get hasAnimations(){const{linearCIM:e}=this;return!!e&&e.some(t=>"animationParams"in t&&!!t.animationParams)}update(e,t,s){return(this._version!==e.version||this.zOrder!==s||this.symbol!==t)&&(this.prevBounds=this.bounds,this.bounds=g(),this.zOrder=s,this.geometry=e.geometry,this.attributes=e.attributes,this.symbol=t,this.visible=e.visible,this._version=e.version,this.symbolResource=null,this.projectedGeometry=null,!0)}async projectAndNormalize(e){let t=this.geometry;if(!t||!t.spatialReference||t.type==="mesh")return;t.type==="extent"&&(t=A(t)),await Fe(t.spatialReference,e);const s=De(t);if(!s)return;const i=Ze(s,t.spatialReference,e);i&&de(i),this.projectedGeometry=V(i)?A(i):i}}class We{constructor(e,t,s){this.added=e,this.updated=t,this.removed=s}hasAnyUpdate(){return!!(this.added.length||this.updated.length||this.removed.length)}}const O=1e-5;function Le(r,e){return e.zOrder-r.zOrder}class Xe{constructor(e,t,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=e,this._cimResourceManager=t,this._hittestDrawHelper=new me(t),this._tileInfoView=s,this._store=o;const a=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(a.level)}destroy(){this._hittestDrawHelper.destroy()}items(){return this._items.values()}getItem(e){return this._items.get(e)}async update(e,t,s){const i=[],o=[],a=[],n=new Set,l=[];let d=0;for(const h of e.items){d++;const c=h.uid,u=this._items.get(c),f=t(h);if(n.add(c),u){u.update(h,f,d)&&(o.push(u),l.push(this._updateItem(u,s)));continue}const b=this._store.createDisplayIdForObjectId(c),w=k.fromGraphic(h,f,d,b);l.push(this._updateItem(w,s)),this._items.set(w.objectId,w),i.push(w)}for(const[h,c]of this._items.entries())n.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),a.push(c));return await Promise.all(l),this._index=null,new We(i,o,a)}updateLevel(e){this._resolution!==e&&(this._index=null,this._boundsDirty=!0,this._resolution=e)}hitTest(e,t,s,i,o){const a=y("esri-mobile"),n=a?ge:fe,l=n+(a?0:be);e=Ee(e,this._tileInfoView.spatialReference);const d=i*window.devicePixelRatio*l,h=g();h[0]=e-d,h[1]=t-d,h[2]=e+d,h[3]=t+d;const c=i*window.devicePixelRatio*n,u=g();u[0]=e-c,u[1]=t-c,u[2]=e+c,u[3]=t+c;const f=.5*i*(l+z),b=this._searchIndex(e-f,t-f,e+f,t+f);if(!b||b.length===0)return[];const w=[],$=g(),R=g();for(const I of b){if(!I.visible)continue;const{projectedGeometry:C,symbolResource:M}=I;this._getSymbolBounds($,M,C,R,o),R[3]=R[2]=R[1]=R[0]=0,ie($,h)&&w.push(I)}if(w.length===0)return[];const D=this._hittestDrawHelper,j=[];for(const I of w){const{projectedGeometry:C,symbolResource:M}=I;if(!M)continue;const{textInfo:F,symbolInfo:Z}=M,H=Z.cimSymbol;D.hitTest(u,H.symbol,C,F,o,i)&&j.push(I)}return j.sort(Le),j.map(I=>I.objectId)}queryItems(e){return this._items.size===0?[]:this._searchForItems(e)}clear(){this._items.clear(),this._index=null}async _updateItem(e,t){await e.projectAndNormalize(this._outSpatialReference),await t(e);const{size:s}=e;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(e.bounds,e.symbolResource,e.projectedGeometry,e.size,0)}_searchIndex(e,t,s,i){return this._boundsDirty&&(this._items.forEach(o=>this._getSymbolBounds(o.bounds,o.symbolResource,o.projectedGeometry,o.size,0)),this._boundsDirty=!1),this._index||(this._index=Ve(9,o=>({minX:o.bounds[0],minY:o.bounds[1],maxX:o.bounds[2],maxY:o.bounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:e,minY:t,maxX:s,maxY:i})}_searchForItems(e){const t=this._tileInfoView.spatialReference,s=e.bounds,i=oe(t);if(i&&t.isWrappable){const[o,a]=i.valid,n=Math.abs(s[2]-a){if(e.type==="update")return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new Ie({spatialReference:this.view.spatialReference,fields:new ce}),this._attributeStore=new ve({isLocal:!0,update:e=>{y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const r=Ge(null,[]);this._attributeStore.update(r,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=Se.createGraphics(this.view.spatialReference),this._resourceProxy=new xe({fetch:e=>Promise.all(e.map(t=>this.view.stage.textureManager.rasterizeItem(t))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([X(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new Xe(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const r=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:r,removed:[]})}get _effectiveRenderer(){return typeof this.renderer=="function"?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const r=!this._attached||this._updateTracking.updating;return y("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${r} +import{bR as W,j as L,K as y,ah as X,aq as B,b9 as Y,$ as N,bh as g,cb as Q,iX as J,ca as K,eQ as V,iY as ee,iZ as te,bK as E,O as se,v as m,S as _,i as re,ht as ie,aG as oe,g_ as ae,et as T,i_ as ne,h0 as he,i$ as de}from"./story-Doly9N9p.js";import{o as ce}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{a as le,bo as ue,k as pe,bp as me,bq as z,br as q,bs as A}from"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import{c as _e}from"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import{D as ye,t as v,h as ge,j as fe,k as be}from"./definitions-DJSdSb77-DkoRHaVx.js";import{i as we}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{o as Ie,m as ve,u as Se,P as xe,W as Re,e as Me}from"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import{_ as Te,h as Ge,j as je,a as Ce,e as ze,J as Pe,Z as Ue,Y as ke,X as $e,K as qe,W as P}from"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import{z as Ae,R as Oe,C as U}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{c as x}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{V as Ve}from"./Tile-D75RMC64-g8Sx5TPr.js";import{l as Ee}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{H as De}from"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";import{f as Fe,h as Ze}from"./queryUtils-Brxu6254-CDiE0zms.js";async function He(r,e,t){const s=[],i={scaleInfo:je(r),scaleExpression:null};for(const o of e)switch(o.type){case"marker":if(o.animationParams){s.push(...$e(t.instances.animatedMarker,o,P,i));break}s.push(...qe(t.instances.marker,o,P,i));break;case"fill":o.spriteRasterizationParam==null?s.push(...Ue(t.instances.fill,o,i)):s.push(...ke(t.instances.complexFill,o,!1,i));break;case"line":o.spriteRasterizationParam?s.push(...ze(t.instances.texturedLine,o,!1,i)):s.push(...Pe(t.instances.line,o,!1,i));break;case"text":s.push(...Ce(t.instances.text,o,P,i))}return s}class G extends Me{static from(e,t,s){return new G(e,t,s)}constructor(e,t,s){super(s),this._items=e,this._tile=t,this._index=-1,this._cachedGeometry=null;const i=t.lod;i.wrap&&(this._wrappingInfo={worldSizeX:i.worldSize[0]})}get _current(){return this._items[this._index]}getItem(){return this._current}getZOrder(){return this._current.zOrder}getMeshWriters(){return this._current.symbolResource?.symbolInfo.meshWriters??[]}hasField(e){return this._current.attributes[e]!=null}field(e){return this.readAttribute(e)}get geometryType(){const e=E(this._current.geometry);return e==="esriGeometryPoint"?"esriGeometryMultipoint":e}getCursor(){return this.copy()}copy(){const e=new G(this._items,this._tile,this.metadata);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._cachedGeometry=this._cachedGeometry,e._index=this._index}get fields(){throw new Error("Fields reading not supported to graphics.")}get hasFeatures(){return!!this._items.length}get hasNext(){return this._index+1v*(i-1)&&(e[o]=a-v*i)}_readX(){const e=this._readGeometry();return e!=null?e.coords[0]:0}_readY(){const e=this._readGeometry();return e!=null?e.coords[1]:0}_readServerCentroid(){switch(this.geometryType){case"esriGeometryPolygon":{const e=he(this._current.projectedGeometry),t=new x([],e);return U(new x,t,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}case"esriGeometryPolyline":{const e=this._current.projectedGeometry,t=ne(e.paths,this.hasZ),s=new x([],t);return U(new x,s,this.hasZ,this.hasM,this.geometryType,this._tile.transform)}}return null}_readAttribute(e,t){const s=this._current.attributes[e];if(s!==void 0)return s;const i=e.toLowerCase();for(const o in this._current.attributes)if(o.toLowerCase()===i)return this._current.attributes[o]}_readAttributes(){return this._current.attributes}}class k{static fromGraphic(e,t,s,i){return new k(e.geometry,t,e.attributes,e.visible,e.uid,e.version,s,i)}constructor(e,t,s,i,o,a,n,l){this.geometry=e,this.symbol=t,this.attributes=s,this.visible=i,this.objectId=o,this._version=a,this.zOrder=n,this.displayId=l,this.bounds=g(),this.prevBounds=g(),this.size=[0,0,0,0]}get linearCIM(){return this.symbolResource?.symbolInfo.linearCIM}get hasAnimations(){const{linearCIM:e}=this;return!!e&&e.some(t=>"animationParams"in t&&!!t.animationParams)}update(e,t,s){return(this._version!==e.version||this.zOrder!==s||this.symbol!==t)&&(this.prevBounds=this.bounds,this.bounds=g(),this.zOrder=s,this.geometry=e.geometry,this.attributes=e.attributes,this.symbol=t,this.visible=e.visible,this._version=e.version,this.symbolResource=null,this.projectedGeometry=null,!0)}async projectAndNormalize(e){let t=this.geometry;if(!t||!t.spatialReference||t.type==="mesh")return;t.type==="extent"&&(t=A(t)),await Fe(t.spatialReference,e);const s=De(t);if(!s)return;const i=Ze(s,t.spatialReference,e);i&&de(i),this.projectedGeometry=V(i)?A(i):i}}class We{constructor(e,t,s){this.added=e,this.updated=t,this.removed=s}hasAnyUpdate(){return!!(this.added.length||this.updated.length||this.removed.length)}}const O=1e-5;function Le(r,e){return e.zOrder-r.zOrder}class Xe{constructor(e,t,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=e,this._cimResourceManager=t,this._hittestDrawHelper=new me(t),this._tileInfoView=s,this._store=o;const a=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(a.level)}destroy(){this._hittestDrawHelper.destroy()}items(){return this._items.values()}getItem(e){return this._items.get(e)}async update(e,t,s){const i=[],o=[],a=[],n=new Set,l=[];let d=0;for(const h of e.items){d++;const c=h.uid,u=this._items.get(c),f=t(h);if(n.add(c),u){u.update(h,f,d)&&(o.push(u),l.push(this._updateItem(u,s)));continue}const b=this._store.createDisplayIdForObjectId(c),w=k.fromGraphic(h,f,d,b);l.push(this._updateItem(w,s)),this._items.set(w.objectId,w),i.push(w)}for(const[h,c]of this._items.entries())n.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),a.push(c));return await Promise.all(l),this._index=null,new We(i,o,a)}updateLevel(e){this._resolution!==e&&(this._index=null,this._boundsDirty=!0,this._resolution=e)}hitTest(e,t,s,i,o){const a=y("esri-mobile"),n=a?ge:fe,l=n+(a?0:be);e=Ee(e,this._tileInfoView.spatialReference);const d=i*window.devicePixelRatio*l,h=g();h[0]=e-d,h[1]=t-d,h[2]=e+d,h[3]=t+d;const c=i*window.devicePixelRatio*n,u=g();u[0]=e-c,u[1]=t-c,u[2]=e+c,u[3]=t+c;const f=.5*i*(l+z),b=this._searchIndex(e-f,t-f,e+f,t+f);if(!b||b.length===0)return[];const w=[],$=g(),R=g();for(const I of b){if(!I.visible)continue;const{projectedGeometry:C,symbolResource:M}=I;this._getSymbolBounds($,M,C,R,o),R[3]=R[2]=R[1]=R[0]=0,ie($,h)&&w.push(I)}if(w.length===0)return[];const D=this._hittestDrawHelper,j=[];for(const I of w){const{projectedGeometry:C,symbolResource:M}=I;if(!M)continue;const{textInfo:F,symbolInfo:Z}=M,H=Z.cimSymbol;D.hitTest(u,H.symbol,C,F,o,i)&&j.push(I)}return j.sort(Le),j.map(I=>I.objectId)}queryItems(e){return this._items.size===0?[]:this._searchForItems(e)}clear(){this._items.clear(),this._index=null}async _updateItem(e,t){await e.projectAndNormalize(this._outSpatialReference),await t(e);const{size:s}=e;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(e.bounds,e.symbolResource,e.projectedGeometry,e.size,0)}_searchIndex(e,t,s,i){return this._boundsDirty&&(this._items.forEach(o=>this._getSymbolBounds(o.bounds,o.symbolResource,o.projectedGeometry,o.size,0)),this._boundsDirty=!1),this._index||(this._index=Ve(9,o=>({minX:o.bounds[0],minY:o.bounds[1],maxX:o.bounds[2],maxY:o.bounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:e,minY:t,maxX:s,maxY:i})}_searchForItems(e){const t=this._tileInfoView.spatialReference,s=e.bounds,i=oe(t);if(i&&t.isWrappable){const[o,a]=i.valid,n=Math.abs(s[2]-a){if(e.type==="update")return this._update();throw new Error("InternalError: Unsupported command")}}),this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this.container.destroy(),this.view=null,this.renderer=null,this._set("graphics",null),this._controller.abort(),this._graphicStore.clear(),this._graphicStore.destroy(),this._attributeStore=null,this._hashToSymbolInfo.clear(),this._updateTracking.destroy(),this._commandQueue.destroy()}_initAttributeStore(){this._storage=new Ie({spatialReference:this.view.spatialReference,fields:new ce}),this._attributeStore=new ve({isLocal:!0,update:e=>{y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateStart`,{message:e}),this.container.attributeView.requestUpdate(e),this.container.requestRender(),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView2D.AttributeStoreView.updateEnd`,{message:e})}});const r=Ge(null,[]);this._attributeStore.update(r,this._storage,null),this.container.checkHighlight=()=>this._attributeStore.hasHighlight}initialize(){this._initAttributeStore(),this._metadata=Se.createGraphics(this.view.spatialReference),this._resourceProxy=new xe({fetch:e=>Promise.all(e.map(t=>this.view.stage.textureManager.rasterizeItem(t))),fetchDictionary:e=>{throw new Error("InternalError: Graphics do not support Dictionary requests")}}),this.addHandles([X(()=>this._effectiveRenderer,()=>this._pushUpdate()),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{this.addHandles([this.graphics.on("change",()=>this._pushUpdate())]),this._graphicStore?.destroy(),this._graphicStore=new Xe(this.view.spatialReference,this._cimResourceManager,this.view.featuresTilingScheme,this.view.state.scale,this._attributeStore),this._attached=!0,this.requestUpdate(),this._pushUpdate()})]),this._updateTracking.addUpdateTracking("CommandQueue",this._commandQueue.updateTracking);const r=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:r,removed:[]})}get _effectiveRenderer(){return typeof this.renderer=="function"?this.renderer():this.renderer}get _cimResourceManager(){return this.view.stage.textureManager.resourceManager}get updating(){const r=!this._attached||this._updateTracking.updating;return y("esri-2d-log-updating")&&console.log(`Updating GraphicsView2D: ${r} -> attaching ${!this._attached} -> updateTracking ${this._updateTracking.updating}`),r}hitTest(r){if(!this.view||this.view.suspended)return[];const{resolution:e,rotation:t}=this.view.state,s=this._graphicStore.hitTest(r.x,r.y,2,e,t),i=new Set(s),o=this.graphics.items.reduce((a,n)=>(i.has(n.uid)&&a.set(n.uid,n),a),new Map);return s.map(a=>o.get(a)).filter(B)}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback()),this.notifyChange("updating")}processUpdate(r){this.updateRequested&&(this.updateRequested=!1,this.update(r))}viewChange(){this.requestUpdate()}setHighlight(r){const e=[];for(const{objectId:t,highlightFlags:s}of r){const i=this._graphicStore.getItem(t)?.displayId;e.push({objectId:t,highlightFlags:s,displayId:i})}this._attributeStore.setHighlight(e,r),this._pushUpdate()}graphicUpdateHandler(r){this._pushUpdate()}update(r){this.updateRequested=!1,this._attached&&this._graphicStore.updateLevel(r.state.resolution)}pushUpdate(){this._pushUpdate()}_pushUpdate(){Y(this._commandQueue.push({type:"update"}))}async _update(){try{y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView._update start`);const r=await this._graphicStore.update(this.graphics,t=>this._getSymbolForGraphic(t),t=>this._ensureSymbolResource(t));for(const t of r.updated)this.container.restartAnimation(t.objectId);if(!r.hasAnyUpdate())return void this._attributeStore.sendUpdates();r.removed.length&&(this._cleanupRequired=!0),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView updateMessage`,r);const e=this._createTileMessages(r);await this._fetchResources(e),this._write(e);for(const t of r.added)this._setFilterState(t);for(const t of r.updated)this._setFilterState(t);y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate`,r),this._attributeStore.sendUpdates(),y("esri-2d-update-debug")&&console.debug(`[Id: ${this.layerId}] GraphicsView sendUpdate.await`,r)}catch{}this._cleanupSharedResources()}_createTileMessages(r){const e=new Map;for(const t of r.added){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)S.getOrCreate(i,e,this._metadata).append(t)}for(const t of r.updated){const s=this.view.graphicsTileStore.getIntersectingTiles(t.prevBounds),i=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const o of s)S.getOrCreate(o,e,this._metadata).removed.push(t.displayId);for(const o of i)S.getOrCreate(o,e,this._metadata).append(t)}for(const t of r.removed){const s=this.view.graphicsTileStore.getIntersectingTiles(t.bounds);for(const i of s)S.getOrCreate(i,e,this._metadata).removed.push(t.displayId)}return Array.from(e.values())}async _fetchResources(r){for(const{tile:e,reader:t}of r){y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.id}] GraphicsView fetchResources`,r);const s=t.getCursor();for(;s.next();)for(const i of s.getMeshWriters())i.enqueueRequest(this._resourceProxy,s,e.createArcadeEvaluationOptions(this.view.timeZone))}await this._resourceProxy.fetchEnqueuedResources()}_write(r){for(const e of r){y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView write`,e);const t=this._writeMeshes(e);let s=this._tiles.get(e.tile.key);s||(s=this._createFeatureTile(e.tile.key)),y("esri-2d-update-debug")&&console.debug(`Id[${this.layerId}] Tile[${e.tile.id}] GraphicsView onTileData`,e),this.container.onTileData(s,{type:"update",modify:t,remove:e.removed,end:!1,attributeEpoch:this._attributeStore.epoch,objectIdMap:e.objectIdMap}),this.container.requestRender()}}_writeMeshes(r){const e=new Re(r.tile.id),t=r.reader.getCursor();for(;t.next();){e.entityStart(t.getDisplayId(),t.getZOrder());for(const s of t.getMeshWriters())s.write(e,this._resourceProxy,t,r.tile.createArcadeEvaluationOptions(this.view.timeZone),r.tile.level);e.entityEnd()}return{...e.serialize().message,tileId:r.tile.id}}_setFilterState(r){const e=r.displayId,t=this._attributeStore.getHighlightFlags(r.objectId);this._attributeStore.setData(e,0,0,t|(r.visible?ye:0))}_getSymbolForGraphic(r){return r.symbol!=null?r.symbol:this._effectiveRenderer!=null?this._effectiveRenderer.getSymbol(r):this._getNullSymbol(r)}async _ensureSymbolResource(r){if(!r.symbol)return;const e=await this._getSymbolInfo(r.symbol);if(!e)return;const t=e.linearCIM.filter(s=>s.type==="text");if(t.length>0){const s=await this._getTextResources(r,t);r.symbolResource={symbolInfo:e,textInfo:s}}else r.symbolResource={symbolInfo:e}}_getSymbolInfo(r){const e=r.hash();return this._hashToSymbolInfo.has(e)||this._hashToSymbolInfo.set(e,this._createSymbolInfo(e,r).catch(t=>null)),this._hashToSymbolInfo.get(e)}async _createSymbolInfo(r,e){const t=await this._convertToCIMSymbol(e),s=await this._createLinearCIM(t);return{hash:r,cimSymbol:t,linearCIM:s,meshWriters:await this._createMeshWriters(t,s)}}async _convertToCIMSymbol(r){const e=ue(r);return e.type==="web-style"?(await e.fetchCIMSymbol()).data:e}async _createLinearCIM(r){return await Promise.all(pe.fetchResources(r.symbol,this._cimResourceManager,[])),this.view.stage.cimAnalyzer.analyzeSymbolReference(r,!1)}async _createMeshWriters(r,e){N(this._controller.signal);const t=this.container.instanceStore,s=this.view.stage.meshWriterRegistry,i=await He(r,e,t);return Promise.all(i.map(o=>s.createMeshWriter(this._storage,this._resourceProxy,{tileInfo:this.view.featuresTilingScheme.tileInfo},o)))}_onTileUpdate(r){if(r.added&&r.added.length>0)for(const e of r.added)this._updateTracking.addPromise(this._addTile(e));if(r.removed&&r.removed.length>0)for(const e of r.removed)this._removeTile(e.key)}_createFeatureTile(r){const e=this.view.featuresTilingScheme.getTileBounds(g(),r),t=this.view.featuresTilingScheme.getTileResolution(r.level),s=new we(r,t,e[0],e[3]);return this._tiles.set(r,s),this.container.addChild(s),s}async _addTile(r){if(!this._attached)return;const e=this._graphicStore.queryItems(r);if(!e.length)return;const t=this._createFeatureTile(r.key),s=S.fromItems(r,e,this._metadata);await this._fetchResources([s]);const i=this._writeMeshes(s);t.onMessage({type:"append",append:i,clear:!1,end:!0,attributeEpoch:this._attributeStore.epoch,objectIdMap:s.objectIdMap})}_removeTile(r){if(!this._tiles.has(r))return;const e=this._tiles.get(r);this.container.removeChild(e),e.destroy(),this._tiles.delete(r)}_getNullSymbol(r){const e=r.geometry;return Q(e)?J:K(e)||V(e)?ee:this.defaultPointSymbolEnabled?te:null}async _getTextResources(r,e){const t=new Array,s=new Array;for(let n=0;n0){const c=_e.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:h,symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,size:d.symbol.height,anchorPointUnits:"Relative",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:d.symbol,textString:d.textString}],scaleSymbolsProportionally:!0,respectFrame:!0}]}},r,this.view.spatialReference,null,E(r.projectedGeometry),null,null);c.then(u=>{const f=u.symbolLayers[0],{textString:b}=f.markerGraphics[0];s.push({type:"cim-rasterization-info",resource:{type:"text",textString:b||"",font:d.font}}),l.text=d.textString=b||""}),t.push(c)}else s.push({type:"cim-rasterization-info",resource:d})}t.length>0&&await Promise.all(t);const i=s.map(n=>this.view.stage.textureManager.rasterizeItem(n)),o=await Promise.all(i);se(o);const a=new Map;for(let n=0;n{const i=new h(2).multiply(e),s=d(i),a=d(t);return t.subtract(s.multiply(t).multiply(a))}],[Qt(t,new h(.25)),()=>{const i=new h(2).multiply(e),s=Kt(i).multiply(t),a=new h(16).multiply(t).subtract(new h(12)).multiply(t).add(new h(3));return t.add(s.multiply(a))}],[!0,()=>{const i=new h(2).multiply(e),s=Kt(i),a=Ie(t).subtract(t);return t.add(s.multiply(a))}])}function Lt(t,e){const i=d(P(new h(.5),e)).multiply(vt(t,new h(2).multiply(e))),s=P(new h(.5),e).multiply(wt(t,new h(2).multiply(Ve(e,.5))));return i.add(s)}function Yt(t){return F(F(t.r,t.g),t.b)}function ye(t){return Nt(Nt(t.r,t.g),t.b)}function Ut(t){return Pe(t,new b(.3,.59,.11))}function se(t){return ye(t).subtract(Yt(t))}function ri(t){const e=Ut(t),i=Yt(t),s=ye(t);return me([de(i,new h(0)),()=>{const a=t.subtract(e).multiply(e),o=e.subtract(i);return e.add(a.divide(o))}],[Xt(s,new h(1)),()=>{const a=t.subtract(e),o=d(e),n=a.multiply(o),l=s.subtract(e);return e.add(n.divide(l))}],[!0,t])}function Gt(t,e){const i=Ut(t),s=Ut(e).subtract(i);return ri(t.add(new b(s)))}function ne(t,e,i){const s=Yt(t),a=se(t),o=se(e);return Gt(C(Xt(a,new h(0)),()=>t.subtract(s).multiply(o).divide(a),new b(0)),i)}function zt(t,e){return C(D(e,new h(1)),e,()=>{const i=d(e),s=t.multiply(t).divide(i);return F(s,new h(1))})}c([De],dt.prototype,"blendMode",void 0),c([w(J)],dt.prototype,"config",void 0),c([I(0,A(_e))],dt.prototype,"vertex",null),c([I(0,A(ai))],dt.prototype,"fragment",null);class we extends Ct{}c([Mt(0,S)],we.prototype,"position",void 0);class li extends Ft{}let jt=class extends ot{};c([w(j)],jt.prototype,"layerTexture",void 0),c([w(h)],jt.prototype,"opacity",void 0);let Rt=class extends Tt{vertex(t){return{uv:t.position,glPosition:new y(t.position.subtract(new S(.5)).multiply(2),0,1)}}fragment(t){const e=new kt;return e.glFragColor=G(this.config.layerTexture,t.uv).multiply(this.config.opacity),e}};c([w(jt)],Rt.prototype,"config",void 0),c([I(0,A(we))],Rt.prototype,"vertex",null),c([I(0,A(li))],Rt.prototype,"fragment",null);const Pi={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},Ai={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},k=!!Wt("esri-2d-profiler");let Zi=class{constructor(t,e){if(this._events=new Te,this._entries=new Map,this._timings=new Ge(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!k)return;this._ext=je(t.gl,{}),this._debugOutput=e;const i=t.gl;if(!this.enableCommandLogging)return;let s;for(s in i)if(typeof i[s]=="function"){const a=i[s],o=s.includes("draw");i[s]=(...n)=>(this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:s,args:n,isDrawCommand:o}),this._currentSummary&&(this._currentSummary.commands++,o&&this._currentSummary.drawCommands++),a.apply(i,n))}}get enableCommandLogging(){return!(typeof k=="object"&&k.disableCommands)}recordContainerStart(t){k&&(this._currentContainer=t)}recordContainerEnd(){k&&(this._currentContainer=null)}recordPassStart(t){k&&(this._currentPass=t,this._initSummary())}recordPassEnd(){k&&(this._currentPass=null,this._emitSummary())}recordBrushStart(t){k&&(this._currentBrush=t)}recordBrushEnd(){k&&(this._currentBrush=null)}recordStart(t){if(k&&this._ext!=null){if(this._entries.has(t)){const i=this._entries.get(t),s=this._ext.resultAvailable(i.query),a=this._ext.disjoint();if(s&&!a){const o=this._ext.getResult(i.query)/1e6;let n=0;if(this._timings.enqueue(o)!=null){const u=this._timings.entries,m=u.length;let _=0;for(const p of u)_+=p;n=_/m}const l=o.toFixed(2),r=n?n.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${t}, ${l} ms (${r} last 10 avg) +import{o as $}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{v as c,hF as I,K as Wt,j as W,S as f,i as X,w as xt,I as Te,as as ke,dg as ue,aF as he,aA as mt,ae as L,ih as Fe,hZ as Se}from"./story-Doly9N9p.js";import{t as Mt,v as w,A as De,ax as Ct,C as ot,ay as Tt,L as y,bf as Ee,a7 as G,F as C,N as D,S as h,aa as Z,a4 as b,bg as d,ab as ce,az as Nt,aL as F,au as P,a6 as me,a5 as Qt,bh as Kt,bi as Ve,ap as Xt,aw as A,ar as S,aV as Le,aB as ze,aQ as Bt,bj as Jt,bk as te,am as de,bl as Re,ak as $e,a_ as j,b9 as kt,aW as Ie,aC as Pe,bm as Ae,aX as Ze,bn as Ne,aA as Be,a3 as Oe,a2 as qe,M as Ue,bd as Ft}from"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import{i as Ge}from"./CircularArray-DaQg3PQl-BXS52LZy.js";import{b as je}from"./testSVGPremultipliedAlpha-DoZe_f0d-BwcxFsN9.js";import{D as We,b as Xe,g as Ye}from"./definitions-DJSdSb77-DkoRHaVx.js";import{f as St,_ as ee,d as pe,k as ft,g as He,G as Qe,$ as Ke,j as Ot,p as Je,n as ie,L as ti}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{B as ei}from"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import{L as ge,_ as ii,b as si}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{m as qt,b as ni,d as oi}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as nt}from"./vec2f64-CeODonrJ-CkkJCdRC.js";const $i={shaders:{vertexShader:$("bitBlit/bitBlit.vert"),fragmentShader:$("bitBlit/bitBlit.frag")},attributes:new Map([["a_pos",0],["a_tex",1]])},Ii={shaders:{vertexShader:$("stencil/stencil.vert"),fragmentShader:$("stencil/stencil.frag")},attributes:new Map([["a_pos",0]])};class _e extends Ct{}c([Mt(0,S)],_e.prototype,"position",void 0);class ai extends Ft{}class J extends ot{}c([w(j)],J.prototype,"layerTexture",void 0),c([w(j)],J.prototype,"backbufferTexture",void 0),c([w(h)],J.prototype,"opacity",void 0),c([w(h)],J.prototype,"inFadeOpacity",void 0);class dt extends Tt{vertex(e){return{uv:e.position,glPosition:new y(Ee(e.position),0,1)}}fragment(e){const i=new kt,s=G(this.config.layerTexture,e.uv),a=G(this.config.backbufferTexture,e.uv),o=C(D(s.a,new h(0)),s.rgb,s.rgb.divide(s.a)),n=C(D(a.a,new h(0)),a.rgb,a.rgb.divide(a.a)),l=this.config.opacity.multiply(s.a),r=a.a;switch(this.blendMode){case"destination-over":i.glFragColor=new y(o.multiply(l).multiply(d(r)).add(n.multiply(r)),l.add(r).subtract(l.multiply(r)));break;case"source-in":{const u=new y(o.multiply(l).multiply(r),l.multiply(r)),m=new y(n.multiply(r),r).multiply(d(this.config.opacity)).multiply(this.config.inFadeOpacity);i.glFragColor=u.add(m)}break;case"destination-in":{const u=new y(n.multiply(r).multiply(l),r.multiply(l)),m=new y(n.multiply(r),r).multiply(new y(d(this.config.opacity).multiply(this.config.inFadeOpacity)));i.glFragColor=u.add(m)}break;case"source-out":i.glFragColor=new y(o.multiply(l).multiply(d(r)),l.multiply(d(r)));break;case"destination-out":i.glFragColor=new y(n.multiply(r).multiply(d(l)),r.multiply(d(l)));break;case"source-atop":i.glFragColor=new y(o.multiply(l).multiply(r).add(n.multiply(r.multiply(d(l)))),r);break;case"destination-atop":i.glFragColor=new y(o.multiply(l.multiply(d(r))).add(n.multiply(r).multiply(l)),l);break;case"xor":i.glFragColor=new y(o.multiply(l.multiply(d(r))).add(n.multiply(r.multiply(d(l)))),l.multiply(d(r)).add(r.multiply(d(l))));break;case"multiply":i.glFragColor=new y(o.multiply(l).multiply(n.multiply(r)).add(o.multiply(l).multiply(d(r))).add(n.multiply(r).multiply(d(l))),l.add(r.multiply(d(l))));break;case"screen":i.glFragColor=new y(o.add(n).subtract(o.multiply(n)).multiply(l.multiply(r)).add(o.multiply(l).multiply(d(r))).add(n.multiply(r).multiply(d(l))),l.add(r.multiply(d(l))));break;case"overlay":{const u=new b(Dt(n.r,o.r),Dt(n.g,o.g),Dt(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"darken":{const u=F(o,n);i.glFragColor=x(u,o,n,l,r)}break;case"lighter":i.glFragColor=new y(o.multiply(l).add(n.multiply(r)),l.add(r));break;case"lighten":{const u=Nt(o,n);i.glFragColor=x(u,o,n,l,r)}break;case"color-dodge":{const u=Z(new b(wt(n.r,o.r),wt(n.g,o.g),wt(n.b,o.b)),new b(0),new b(1));i.glFragColor=x(u,o,n,l,r)}break;case"color-burn":{const u=new b(vt(n.r,o.r),vt(n.g,o.g),vt(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"hard-light":{const u=new b(Et(n.r,o.r),Et(n.g,o.g),Et(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"soft-light":{const u=new b(Vt(n.r,o.r),Vt(n.g,o.g),Vt(n.b,o.b));i.glFragColor=x(u,o,n,l,r)}break;case"difference":{const u=ce(n.subtract(o));i.glFragColor=x(u,o,n,l,r)}break;case"exclusion":{const u=o.add(n).subtract(new h(2).multiply(o).multiply(n));i.glFragColor=x(u,o,n,l,r)}break;case"invert":i.glFragColor=new y(new b(1).subtract(n).multiply(l).multiply(r).add(n.multiply(r).multiply(d(l))),r);break;case"vivid-light":{const u=new b(Z(Lt(n.r,o.r),new h(0),new h(1)),Z(Lt(n.g,o.g),new h(0),new h(1)),Z(Lt(n.b,o.b),new h(0),new h(1)));i.glFragColor=x(u,o,n,l,r)}break;case"hue":{const u=ne(o,n,n);i.glFragColor=x(u,o,n,l,r)}break;case"saturation":{const u=ne(n,o,n);i.glFragColor=x(u,o,n,l,r)}break;case"color":{const u=Gt(o,n);i.glFragColor=x(u,o,n,l,r)}break;case"luminosity":{const u=Gt(n,o);i.glFragColor=x(u,o,n,l,r)}break;case"plus":i.glFragColor=Z(new y(s.r.add(n.r),s.g.add(n.g),s.b.add(n.b),l.add(r)),new y(0),new y(1));break;case"minus":i.glFragColor=new y(Z(new b(n.r.subtract(s.r),n.g.subtract(s.g),n.b.subtract(s.b)),new b(0),new b(1)),r.multiply(l));break;case"average":{const u=n.add(o).divide(2);i.glFragColor=x(u,o,n,l,r)}break;case"reflect":{const u=Z(new b(zt(n.r,o.r),zt(n.g,o.g),zt(n.b,o.b)),new b(0),new b(1));i.glFragColor=x(u,o,n,l,r)}break;default:i.glFragColor=s.multiply(this.config.opacity)}return i}}function x(t,e,i,s,a){return new y(t.multiply(s).multiply(a).add(e.multiply(s).multiply(d(a))).add(i.multiply(a).multiply(d(s))),s.add(a.multiply(d(s))))}function Dt(t,e){return new h(1).subtract(P(new h(.5),e)).multiply(d(new h(2).multiply(d(e).multiply(d(t))))).add(P(new h(.5),e).multiply(new h(2).multiply(e).multiply(t)))}function wt(t,e){return C(D(t,new h(0)),new h(0),C(D(e,new h(1)),new h(1),F(new h(1),t.divide(new h(1).subtract(e)))))}function vt(t,e){return C(D(t,new h(1)),new h(1),C(D(e,new h(0)),new h(0),d(F(new h(1),d(t).divide(e)))))}function Et(t,e){return new h(1).subtract(P(new h(.5),e)).multiply(new h(2).multiply(e).multiply(t)).add(P(new h(.5),e).multiply(d(new h(2).multiply(d(e).multiply(d(t))))))}function Vt(t,e){return me([Qt(e,new h(.5)),()=>{const i=new h(2).multiply(e),s=d(i),a=d(t);return t.subtract(s.multiply(t).multiply(a))}],[Qt(t,new h(.25)),()=>{const i=new h(2).multiply(e),s=Kt(i).multiply(t),a=new h(16).multiply(t).subtract(new h(12)).multiply(t).add(new h(3));return t.add(s.multiply(a))}],[!0,()=>{const i=new h(2).multiply(e),s=Kt(i),a=Ie(t).subtract(t);return t.add(s.multiply(a))}])}function Lt(t,e){const i=d(P(new h(.5),e)).multiply(vt(t,new h(2).multiply(e))),s=P(new h(.5),e).multiply(wt(t,new h(2).multiply(Ve(e,.5))));return i.add(s)}function Yt(t){return F(F(t.r,t.g),t.b)}function ye(t){return Nt(Nt(t.r,t.g),t.b)}function Ut(t){return Pe(t,new b(.3,.59,.11))}function se(t){return ye(t).subtract(Yt(t))}function ri(t){const e=Ut(t),i=Yt(t),s=ye(t);return me([de(i,new h(0)),()=>{const a=t.subtract(e).multiply(e),o=e.subtract(i);return e.add(a.divide(o))}],[Xt(s,new h(1)),()=>{const a=t.subtract(e),o=d(e),n=a.multiply(o),l=s.subtract(e);return e.add(n.divide(l))}],[!0,t])}function Gt(t,e){const i=Ut(t),s=Ut(e).subtract(i);return ri(t.add(new b(s)))}function ne(t,e,i){const s=Yt(t),a=se(t),o=se(e);return Gt(C(Xt(a,new h(0)),()=>t.subtract(s).multiply(o).divide(a),new b(0)),i)}function zt(t,e){return C(D(e,new h(1)),e,()=>{const i=d(e),s=t.multiply(t).divide(i);return F(s,new h(1))})}c([De],dt.prototype,"blendMode",void 0),c([w(J)],dt.prototype,"config",void 0),c([I(0,A(_e))],dt.prototype,"vertex",null),c([I(0,A(ai))],dt.prototype,"fragment",null);class we extends Ct{}c([Mt(0,S)],we.prototype,"position",void 0);class li extends Ft{}let jt=class extends ot{};c([w(j)],jt.prototype,"layerTexture",void 0),c([w(h)],jt.prototype,"opacity",void 0);let Rt=class extends Tt{vertex(t){return{uv:t.position,glPosition:new y(t.position.subtract(new S(.5)).multiply(2),0,1)}}fragment(t){const e=new kt;return e.glFragColor=G(this.config.layerTexture,t.uv).multiply(this.config.opacity),e}};c([w(jt)],Rt.prototype,"config",void 0),c([I(0,A(we))],Rt.prototype,"vertex",null),c([I(0,A(li))],Rt.prototype,"fragment",null);const Pi={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/highlight.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},Ai={shaders:{vertexShader:$("highlight/textured.vert"),fragmentShader:$("highlight/blur.frag")},attributes:new Map([["a_position",0],["a_texcoord",1]])},k=!!Wt("esri-2d-profiler");let Zi=class{constructor(t,e){if(this._events=new Te,this._entries=new Map,this._timings=new Ge(10),this._currentContainer=null,this._currentPass=null,this._currentBrush=null,this._currentSummary=null,!k)return;this._ext=je(t.gl,{}),this._debugOutput=e;const i=t.gl;if(!this.enableCommandLogging)return;let s;for(s in i)if(typeof i[s]=="function"){const a=i[s],o=s.includes("draw");i[s]=(...n)=>(this._events.emit("command",{container:this._currentContainer,pass:this._currentPass,brush:this._currentBrush,method:s,args:n,isDrawCommand:o}),this._currentSummary&&(this._currentSummary.commands++,o&&this._currentSummary.drawCommands++),a.apply(i,n))}}get enableCommandLogging(){return!(typeof k=="object"&&k.disableCommands)}recordContainerStart(t){k&&(this._currentContainer=t)}recordContainerEnd(){k&&(this._currentContainer=null)}recordPassStart(t){k&&(this._currentPass=t,this._initSummary())}recordPassEnd(){k&&(this._currentPass=null,this._emitSummary())}recordBrushStart(t){k&&(this._currentBrush=t)}recordBrushEnd(){k&&(this._currentBrush=null)}recordStart(t){if(k&&this._ext!=null){if(this._entries.has(t)){const i=this._entries.get(t),s=this._ext.resultAvailable(i.query),a=this._ext.disjoint();if(s&&!a){const o=this._ext.getResult(i.query)/1e6;let n=0;if(this._timings.enqueue(o)!=null){const u=this._timings.entries,m=u.length;let _=0;for(const p of u)_+=p;n=_/m}const l=o.toFixed(2),r=n?n.toFixed(2):"--";this.enableCommandLogging?(console.groupCollapsed(`Frame report for ${t}, ${l} ms (${r} last 10 avg) ${i.commandsLen} Commands (${i.drawCommands} draw)`),console.log("RenderPass breakdown: "),console.table(i.summaries),console.log("Commands: ",i.commands),console.groupEnd()):console.log(`Frame report for ${t}, ${l} ms (${r} last 10 avg)`),this._debugOutput.innerHTML=`${l} (${r})`}for(const o of i.handles)o.remove();this._ext.deleteQuery(i.query),this._entries.delete(t)}const e={name:t,query:this._ext.createQuery(),commands:[],commandsLen:0,drawCommands:0,summaries:[],handles:[]};this.enableCommandLogging&&(e.handles.push(this._events.on("command",i=>{e.commandsLen++,e.commands.push(i),i.isDrawCommand&&e.drawCommands++})),e.handles.push(this._events.on("summary",i=>{e.summaries.push(i)}))),this._ext.beginTimeElapsed(e.query),this._entries.set(t,e)}}recordEnd(t){k&&this._ext!=null&&this._entries.has(t)&&this._ext.endTimeElapsed()}_initSummary(){this.enableCommandLogging&&(this._currentSummary={container:this._currentContainer,pass:this._currentPass,drawCommands:0,commands:0})}_emitSummary(){this.enableCommandLogging&&this._currentSummary&&this._events.emit("summary",this._currentSummary)}};const E=1,bt=0,it=1,st=2;let ui=class{constructor(t,e,i){this._width=t*i,this._height=e*i,this._pixelRatio=i;const s=Math.ceil(this._width/E),a=Math.ceil(this._height/E);this._cols=s,this._rows=a,this._cells=ei.create(s*a)}insertMetrics(t){this._markMetrics(t)}hasCollision(t){let e=0;for(const{transformedX:i,transformedY:s,width:a,height:o}of t.bounds){const n=a*this._pixelRatio,l=o*this._pixelRatio,r=i*this._pixelRatio,u=s*this._pixelRatio;switch(this._collide(r,u,n,l)){case st:return st;case it:e++}}return e===t.bounds.length?it:bt}getCellId(t,e){return t+e*this._cols}has(t){return this._cells.has(t)}hasRange(t,e){return this._cells.hasRange(t,e)}set(t){this._cells.set(t)}setRange(t,e){this._cells.setRange(t,e)}_collide(t,e,i,s){const a=t-i/2,o=e-s/2,n=a+i,l=o+s;if(n<0||l<0||a>this._width||o>this._height)return it;const r=L(Math.floor(a/E),0,this._cols),u=L(Math.floor(o/E),0,this._rows),m=L(Math.ceil(n/E),0,this._cols),_=L(Math.ceil(l/E),0,this._rows);for(let p=u;p<=_;p++)for(let g=r;g<=m;g++){const v=this.getCellId(g,p);if(this.has(v))return st}return bt}_mark(t,e,i,s){const a=t-i/2,o=e-s/2,n=a+i,l=o+s,r=L(Math.floor(a/E),0,this._cols),u=L(Math.floor(o/E),0,this._rows),m=L(Math.ceil(n/E),0,this._cols),_=L(Math.ceil(l/E),0,this._rows);for(let p=u;p<=_;p++)for(let g=r;g<=m;g++){const v=this.getCellId(g,p);this.set(v)}return!1}_markMetrics(t){for(const{transformedX:e,transformedY:i,width:s,height:a}of t.bounds){const o=s*this._pixelRatio,n=a*this._pixelRatio,l=e*this._pixelRatio,r=i*this._pixelRatio;this._mark(l,r,o,n)}}};const H=254,pt=255,Q=0;function B(t,e){const i=t.children.slice();i.sort((s,a)=>s.tileAge-a.tileAge),i.forEach(s=>{s.labelMetrics!=null&&s.isReady&&e(s,s.labelMetrics)})}function oe(t,e){return(!t.minScale||t.minScale>=e)&&(!t.maxScale||t.maxScale<=e)}class hi{run(e,i,s,a){const o=[];for(let n=e.length-1;n>=0;n--){const l=e[n];l.labelingCollisionInfos?.length&&o.push(...l.labelingCollisionInfos)}Wt("esri-2d-update-debug")&&o.length&&console.debug("CollisionEngine.run"),this._transformMetrics(o),this._runCollision(o,i,s,a);for(const n of o)n.container.requestRender()}_runCollision(e,i,s,a){const[o,n]=i.state.size,l=new ui(o,n,i.pixelRatio);for(const{container:r,deconflictionEnabled:u,visible:m}of e){const _=r.attributeView;u?m?(this._prepare(r),this._collideVisible(l,r,s,a),this._collideInvisible(l,r)):B(r,(p,g)=>{for(const v of g)_.setLabelMinZoom(v.entityTexel,pt)}):B(r,(p,g)=>{for(const v of g)oe(v,s)?(_.setLabelMinZoom(v.entityTexel,Q),m&&l.insertMetrics(v)):_.setLabelMinZoom(v.entityTexel,H)})}}_isFiltered(e,i,s){const a=i.getFilterFlags(e),o=!s.hasFilter||!!(a&We),n=s.featureEffect==null||s.featureEffect.excludedLabelsVisible||!!(a&Xe);return!(o&&n)}_prepare(e){const i=e.attributeView,s=new Set;B(e,(a,o)=>{for(const n of o){const l=n.entityTexel;if(!s.has(l)){if(s.add(l),this._isFiltered(l,i,e.layerView)){i.setLabelMinZoom(l,H);continue}i.getLabelMinZoom(l)!==Q?i.setLabelMinZoom(l,pt):i.setLabelMinZoom(l,Q)}}})}_collideVisible(e,i,s,a){const o=i.attributeView,n=new Set;B(i,(l,r)=>{for(let u=0;u{for(let l=0;l{const l=i.attributeView,r=o.transforms.labelMat2d;r[4]=Math.round(r[4]),r[5]=Math.round(r[5]);const u=s==="polyline";for(const m of n){const{entityTexel:_,anchorX:p,anchorY:g}=m;let v=m.referenceBounds?.size??0;const T=a[0];if(T!=null){const M=T(l.getVisualVariableData(_,ti.SIZE));v=isNaN(M)||M==null||M===1/0?v:M}const at=Ye+v/2,rt=m.directionX*at,Y=m.directionY*at;for(const M of m.bounds){let lt=p,ut=g;if(u){const ht=p+M.x+rt,ct=g+M.y+Y;lt=r[0]*ht+r[2]*ct+r[4],ut=r[1]*ht+r[3]*ct+r[5];const Me=lt,Ce=ut;M.transformedX=Math.floor(Me),M.transformedY=Math.floor(Ce)}else{lt=r[0]*p+r[2]*g+r[4],ut=r[1]*p+r[3]*g+r[5];const ht=lt+M.x+rt,ct=ut+M.y+Y;M.transformedX=ht,M.transformedY=ct}}}})}}const ci=32;let K=class extends W{constructor(t){super(t),this._lastUpdate=0,this.collisionEngine=new hi,this.lastUpdateId=-1,this.updateRequested=!1,this.view=null}get updating(){return Wt("esri-2d-log-updating")&&console.log(`Updating LabelManager ${this.updateRequested}: -> updateRequested: ${this.updateRequested}`),this.updateRequested}update(t){const e=performance.now();e-this._lastUpdate>=ci?(this._lastUpdate=e,this.doUpdate(t)):this.requestUpdate()}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view?.requestUpdate())}processUpdate(t){this.updateRequested&&(this.updateRequested=!1,this.update(t))}doUpdate(t){const e=this.view;if(e)try{const i=t.state.scale,s=e.featuresTilingScheme.getClosestInfoForScale(i).level;this.collisionEngine.run(e.allLayerViews.items,t,i,s)}catch{}}};c([f()],K.prototype,"updateRequested",void 0),c([f()],K.prototype,"updating",null),c([f()],K.prototype,"view",void 0),K=c([X("esri.views.2d.LabelManager")],K);const gt="esri-zoom-box",_t={container:`${gt}__container`,overlay:`${gt}__overlay`,background:`${gt}__overlay-background`,box:`${gt}__outline`},$t={zoom:"Shift",counter:"Control"};let tt=class extends W{constructor(t){super(t),this._container=null,this._overlay=null,this._backgroundShape=null,this._boxShape=null,this._box={x:0,y:0,width:0,height:0},this._rafId=null,this._redraw=this._redraw.bind(this)}destroy(){this.view=null}set view(t){this.removeAllHandles(),this._destroyOverlay(),this._set("view",t),t&&this.addHandles([t.on("drag",[$t.zoom],e=>this._handleDrag(e,1),ee.INTERNAL),t.on("drag",[$t.zoom,$t.counter],e=>this._handleDrag(e,-1),ee.INTERNAL)])}_start(){this._createContainer(),this._createOverlay(),this.navigation.begin()}_update(t,e,i,s){this._box.x=t,this._box.y=e,this._box.width=i,this._box.height=s,this._rafId||(this._rafId=requestAnimationFrame(this._redraw))}_end(t,e,i,s,a){const o=this.view,n=o.toMap(ke(t+.5*i,e+.5*s));let l=Math.max(i/o.width,s/o.height);a===-1&&(l=1/l),this._destroyOverlay(),this.navigation.end(),o.goTo({center:n,scale:o.scale*l},{animationMode:"always",duration:pe()})}_updateBox(t,e,i,s){const a=this._boxShape;a.setAttributeNS(null,"x",""+t),a.setAttributeNS(null,"y",""+e),a.setAttributeNS(null,"width",""+i),a.setAttributeNS(null,"height",""+s),a.setAttributeNS(null,"class",_t.box)}_updateBackground(t,e,i,s){this._backgroundShape.setAttributeNS(null,"d",this._toSVGPath(t,e,i,s,this.view.width,this.view.height))}_createContainer(){const t=document.createElement("div");t.className=_t.container,this.view.root.appendChild(t),this._container=t}_createOverlay(){const t=this.view.width,e=this.view.height,i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttributeNS(null,"d","M 0 0 L "+t+" 0 L "+t+" "+e+" L 0 "+e+" Z"),i.setAttributeNS(null,"class",_t.background);const s=document.createElementNS("http://www.w3.org/2000/svg","rect"),a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),a.setAttributeNS(null,"class",_t.overlay),a.appendChild(i),a.appendChild(s),this._container.appendChild(a),this._backgroundShape=i,this._boxShape=s,this._overlay=a}_destroyOverlay(){this._container&&this._container.parentNode&&this._container.parentNode.removeChild(this._container),this._container=this._backgroundShape=this._boxShape=this._overlay=null}_toSVGPath(t,e,i,s,a,o){const n=t+i,l=e+s;return"M 0 0 L "+a+" 0 L "+a+" "+o+" L 0 "+o+" ZM "+t+" "+e+" L "+t+" "+l+" L "+n+" "+l+" L "+n+" "+e+" Z"}_handleDrag(t,e){const i=t.x,s=t.y,a=t.origin.x,o=t.origin.y;let n,l,r,u;switch(i>a?(n=a,r=i-a):(n=i,r=a-i),s>o?(l=o,u=s-o):(l=s,u=o-s),t.action){case"start":this._start();break;case"update":this._update(n,l,r,u);break;case"end":this._end(n,l,r,u,e)}t.stopPropagation()}_redraw(){if(!this._rafId||(this._rafId=null,!this._overlay))return;const{x:t,y:e,width:i,height:s}=this._box;this._updateBox(t,e,i,s),this._updateBackground(t,e,i,s),this._rafId=requestAnimationFrame(this._redraw)}};c([f()],tt.prototype,"navigation",void 0),c([f()],tt.prototype,"view",null),tt=c([X("esri.views.2d.navigation.ZoomBox")],tt);const mi=tt;let R=class{constructor(t){this._gain=t,this.lastValue=void 0,this.filteredDelta=void 0}update(t){if(this.hasLastValue()){const e=this.computeDelta(t);this._updateDelta(e)}this.lastValue=t}reset(){this.lastValue=void 0,this.filteredDelta=void 0}hasLastValue(){return this.lastValue!==void 0}hasFilteredDelta(){return this.filteredDelta!==void 0}computeDelta(t){return this.lastValue===void 0?NaN:t-this.lastValue}_updateDelta(t){this.filteredDelta!==void 0?this.filteredDelta=(1-this._gain)*this.filteredDelta+this._gain*t:this.filteredDelta=t}};class Ht{constructor(e,i,s){this._initialVelocity=e,this._stopVelocity=i,this._friction=s,this._duration=Math.abs(Math.log(Math.abs(this._initialVelocity)/this._stopVelocity)/Math.log(1-this._friction))}get duration(){return this._duration}isFinished(e){return e>this.duration}get friction(){return this._friction}value(e){return this.valueFromInitialVelocity(this._initialVelocity,e)}valueDelta(e,i){const s=this.value(e);return this.value(e+i)-s}valueFromInitialVelocity(e,i){i=Math.min(i,this.duration);const s=1-this.friction;return e*(s**i-1)/Math.log(s)}}class di extends Ht{constructor(e,i,s,a,o){super(e,i,s),this._sceneVelocity=a,this.direction=o}value(e){return super.valueFromInitialVelocity(this._sceneVelocity,e)}}class pi{constructor(e=300,i=12,s=.84){this._minimumInitialVelocity=e,this._stopVelocity=i,this._friction=s,this.enabled=!0,this._time=new R(.6),this._screen=[new R(.4),new R(.4)],this._scene=[new R(.6),new R(.6),new R(.6)],this._tmpDirection=ue()}add(e,i,s){if(this.enabled){if(this._time.hasLastValue()&&this._time.computeDelta(s)<.015)return;this._screen[0].update(e[0]),this._screen[1].update(e[1]),this._scene[0].update(i[0]),this._scene[1].update(i[1]),this._scene[2].update(i[2]),this._time.update(s)}}reset(){this._screen[0].reset(),this._screen[1].reset(),this._scene[0].reset(),this._scene[1].reset(),this._scene[2].reset(),this._time.reset()}evaluateMomentum(){if(!this.enabled||!this._screen[0].hasFilteredDelta()||!this._time.hasFilteredDelta())return null;const e=this._screen[0].filteredDelta,i=this._screen[1].filteredDelta,s=e==null||i==null?0:Math.sqrt(e*e+i*i),a=this._time.filteredDelta,o=a==null||s==null?0:s/a;return Math.abs(o)0&&ge(this._tmpDirection,this._tmpDirection,1/a);const o=this._time.filteredDelta;return new di(e,i,s,o==null?0:a/o,this._tmpDirection)}}let q=class extends W{constructor(t){super(t),this.animationTime=0,this.momentumEstimator=new pi(500,6,.92),this.momentum=null,this.tmpMomentum=ue(),this.momentumFinished=!1,this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0}),this._previousDrag=null,he(()=>this.momentumFinished,()=>this.navigation.stop())}begin(t,e){this.navigation.begin(),this.momentumEstimator.reset(),this.addToEstimator(e),this._previousDrag=e}update(t,e){this.addToEstimator(e);let i=e.center.x,s=e.center.y;const a=this._previousDrag;i=a?a.center.x-i:-i,s=a?s-a.center.y:s,t.viewpoint=ft(this.viewpoint,t.viewpoint,[i||0,s||0]),this._previousDrag=e}end(t,e){this.addToEstimator(e);const i=t.navigation.effectiveMomentumEnabled;this.momentum=i?this.momentumEstimator.evaluateMomentum():null,this.animationTime=0,this.momentum&&this.onAnimationUpdate(t),this._previousDrag=null,this.navigation.end()}addToEstimator(t){const e=t.center.x,i=t.center.y,s=Fe(-e,i),a=Se(-e,i,0);this.momentumEstimator.add(s,a,.001*t.timestamp)}onAnimationUpdate(t){this.navigation.animationManager?.animateContinuous(t.viewpoint,(e,i)=>{const{momentum:s,animationTime:a,tmpMomentum:o}=this,n=.001*i;if(!(this.momentumFinished=!s||s.isFinished(a))){const l=s.valueDelta(a,n);ge(o,s.direction,l),ft(e,e,o),t.constraints.constrainByGeometry(e)}this.animationTime+=n})}stopMomentumNavigation(){this.momentum&&(this.momentumEstimator.reset(),this.momentum=null,this.navigation.stop())}};c([f()],q.prototype,"momentumFinished",void 0),c([f()],q.prototype,"viewpoint",void 0),c([f()],q.prototype,"navigation",void 0),q=c([X("esri.views.2d.navigation.actions.Pan")],q);const gi=q;let ve=class{constructor(t=2.5,e=.01,i=.95,s=12){this._minimumInitialVelocity=t,this._stopVelocity=e,this._friction=i,this._maxVelocity=s,this.enabled=!0,this.value=new R(.8),this.time=new R(.3)}add(t,e){if(this.enabled&&e!=null){if(this.time.hasLastValue()){if(this.time.computeDelta(e)<.01)return;if(this.value.hasFilteredDelta()){const i=this.value.computeDelta(t);this.value.filteredDelta*i<0&&this.value.reset()}}this.time.update(e),this.value.update(t)}}reset(){this.value.reset(),this.time.reset()}evaluateMomentum(){if(!this.enabled||!this.value.hasFilteredDelta()||!this.time.hasFilteredDelta())return null;let t=this.value.filteredDelta/this.time.filteredDelta;return t=L(t,-this._maxVelocity,this._maxVelocity),Math.abs(t)Math.PI;)a-=2*Math.PI;for(;a<-Math.PI;)a+=2*Math.PI;e=s+a}super.add(e,i)}}class yi extends Ht{constructor(e,i,s){super(e,i,s)}value(e){const i=super.value(e);return Math.exp(i)}valueDelta(e,i){const s=super.value(e),a=super.value(e+i)-s;return Math.exp(a)}}class wi extends ve{constructor(e=2.5,i=.01,s=.95,a=12){super(e,i,s,a)}add(e,i){super.add(Math.log(e),i)}createMomentum(e,i,s){return new yi(e,i,s)}}let U=class extends W{constructor(t){super(t),this._animationTime=0,this._momentumFinished=!1,this._previousAngle=0,this._previousRadius=0,this._previousCenter=null,this._rotationMomentumEstimator=new _i(.6,.15,.95),this._rotationDirection=1,this._startAngle=0,this._startRadius=0,this._updateTimestamp=null,this._zoomDirection=1,this._zoomMomentumEstimator=new wi,this._zoomOnly=null,this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0}),this.zoomMomentum=null,this.rotateMomentum=null,this.addHandles(he(()=>this._momentumFinished,()=>this.navigation.stop()))}begin(t,e){this.navigation.begin(),this._rotationMomentumEstimator.reset(),this._zoomMomentumEstimator.reset(),this._zoomOnly=null,this._previousAngle=this._startAngle=e.angle,this._previousRadius=this._startRadius=e.radius,this._previousCenter=e.center,this._updateTimestamp=null,t.constraints.rotationEnabled&&this.addToRotateEstimator(0,e.timestamp),this.addToZoomEstimator(e,1)}update(t,e){this._updateTimestamp===null&&(this._updateTimestamp=e.timestamp);const i=e.angle,s=e.radius,a=e.center,o=Math.abs(180*(i-this._startAngle)/Math.PI),n=Math.abs(s-this._startRadius),l=this._startRadius/s;if(this._previousRadius&&this._previousCenter){const r=s/this._previousRadius;let u=180*(i-this._previousAngle)/Math.PI;this._rotationDirection=u>=0?1:-1,this._zoomDirection=r>=1?1:-1,t.constraints.rotationEnabled?(this._zoomOnly===null&&e.timestamp-this._updateTimestamp>200&&(this._zoomOnly=n-o>0),this._zoomOnly===null||this._zoomOnly?u=0:this.addToRotateEstimator(i-this._startAngle,e.timestamp)):u=0,this.addToZoomEstimator(e,l),this.navigation.setViewpoint([a.x,a.y],1/r,u,[this._previousCenter.x-a.x,a.y-this._previousCenter.y])}this._previousAngle=i,this._previousRadius=s,this._previousCenter=a}end(t){this.rotateMomentum=this._rotationMomentumEstimator.evaluateMomentum(),this.zoomMomentum=this._zoomMomentumEstimator.evaluateMomentum(),this._animationTime=0,(this.rotateMomentum||this.zoomMomentum)&&this.onAnimationUpdate(t),this.navigation.end()}addToRotateEstimator(t,e){this._rotationMomentumEstimator.add(t,.001*e)}addToZoomEstimator(t,e){this._zoomMomentumEstimator.add(e,.001*t.timestamp)}canZoomIn(t){const e=t.scale,i=t.constraints.effectiveMaxScale;return i===0||e>i}canZoomOut(t){const e=t.scale,i=t.constraints.effectiveMinScale;return i===0||e{const s=!this.canZoomIn(t)&&this._zoomDirection>1||!this.canZoomOut(t)&&this._zoomDirection<1,a=!this.rotateMomentum||this.rotateMomentum.isFinished(this._animationTime),o=s||!this.zoomMomentum||this.zoomMomentum.isFinished(this._animationTime),n=.001*i;if(this._momentumFinished=a&&o,!this._momentumFinished){const l=this.rotateMomentum?Math.abs(this.rotateMomentum.valueDelta(this._animationTime,n))*this._rotationDirection*180/Math.PI:0;let r=this.zoomMomentum?Math.abs(this.zoomMomentum.valueDelta(this._animationTime,n)):1;const u=nt(),m=nt();if(this._previousCenter){qt(u,this._previousCenter.x,this._previousCenter.y),He(m,t.size,t.padding),ni(u,u,m);const{constraints:_,scale:p}=t,g=p*r;r<1&&!_.canZoomInTo(g)?(r=p/_.effectiveMaxScale,this.zoomMomentum=null,this.rotateMomentum=null):r>1&&!_.canZoomOutTo(g)&&(r=p/_.effectiveMinScale,this.zoomMomentum=null,this.rotateMomentum=null),Qe(e,t.viewpoint,r,l,u,t.size),t.constraints.constrainByGeometry(e)}}this._animationTime+=n})}stopMomentumNavigation(){(this.rotateMomentum||this.zoomMomentum)&&(this.rotateMomentum&&(this._rotationMomentumEstimator.reset(),this.rotateMomentum=null),this.zoomMomentum&&(this._zoomMomentumEstimator.reset(),this.zoomMomentum=null),this.navigation.stop())}};c([f()],U.prototype,"_momentumFinished",void 0),c([f()],U.prototype,"viewpoint",void 0),c([f()],U.prototype,"navigation",void 0),U=c([X("esri.views.2d.navigation.actions.Pinch")],U);const vi=U,It=nt(),ae=nt();let et=class extends W{constructor(t){super(t),this._previousCenter=nt(),this.viewpoint=new St({targetGeometry:new xt,scale:0,rotation:0})}begin(t,e){this.navigation.begin(),qt(this._previousCenter,e.center.x,e.center.y)}update(t,e){const{state:{size:i,padding:s}}=t;qt(It,e.center.x,e.center.y),Ke(ae,i,s),t.viewpoint=Ot(this.viewpoint,t.state.paddedViewState.viewpoint,Je(ae,this._previousCenter,It)),oi(this._previousCenter,It)}end(){this.navigation.end()}};c([f()],et.prototype,"viewpoint",void 0),c([f()],et.prototype,"navigation",void 0),et=c([X("esri.views.2d.navigation.actions.Rotate")],et);const fi=et,O=10,re=1,Pt=new St({targetGeometry:new xt}),At=[0,0],le=250;let V=class extends W{constructor(t){super(t),this._endTimer=null,this._lastEventTimestamp=null,this.animationManager=null,this.interacting=!1}initialize(){this.pan=new gi({navigation:this}),this.rotate=new fi({navigation:this}),this.pinch=new vi({navigation:this}),this.zoomBox=new mi({view:this.view,navigation:this})}destroy(){this.pan=mt(this.pan),this.rotate=mt(this.rotate),this.pinch=mt(this.pinch),this.zoomBox=mt(this.zoomBox),this.animationManager=null}begin(){this.stop(),this._set("interacting",!0)}end(){this._lastEventTimestamp=performance.now(),this._startTimer(le)}async zoom(t,e=this._getDefaultAnchor()){if(this.begin(),this.view.constraints.snapToZoom&&this.view.constraints.effectiveLODs)return t<1?this.zoomIn(e):this.zoomOut(e);this.setViewpoint(e,t,0,[0,0])}async zoomIn(t){const e=this.view,i=e.constraints.snapToNextScale(e.scale);return this._zoomToScale(i,t)}async zoomOut(t){const e=this.view,i=e.constraints.snapToPreviousScale(e.scale);return this._zoomToScale(i,t)}setViewpoint(t,e,i,s){this.begin(),this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,t,e,i,s),this.end()}setViewpointImmediate(t,e=0,i=[0,0],s=this._getDefaultAnchor()){this.view.stateManager.state.viewpoint=this._scaleRotateTranslateViewpoint(this.view.viewpoint,s,t,e,i)}continuousRotateClockwise(){const t=this.view.viewpoint;this.animationManager?.animateContinuous(t,e=>{Ot(e,e,-re)})}continuousRotateCounterclockwise(){const t=this.view.viewpoint;this.animationManager?.animateContinuous(t,e=>{Ot(e,e,re)})}resetRotation(){this.view.constraints.rotationEnabled&&(this.view.rotation=0)}continuousPanLeft(){this._continuousPan([-O,0])}continuousPanRight(){this._continuousPan([O,0])}continuousPanUp(){this._continuousPan([0,O])}continuousPanDown(){this._continuousPan([0,-O])}continuousPanVector({x:t,y:e}){this._continuousPan([t*O,e*O])}stop(){this.pan.stopMomentumNavigation(),this.animationManager?.stop(),this.end(),this._endTimer!==null&&(clearTimeout(this._endTimer),this._endTimer=null,this._set("interacting",!1))}_continuousPan(t){const e=this.view.viewpoint;this.animationManager?.animateContinuous(e,i=>{ft(i,i,t),this.view.constraints.constrainByGeometry(i)})}_startTimer(t){return this._endTimer!==null||(this._endTimer=setTimeout(()=>{this._endTimer=null;const e=performance.now()-(this._lastEventTimestamp??0);ea&&!u))return ie(Pt,o,t/a,0,e,n,l),s.constrainByGeometry(Pt),i.goTo(Pt,{animate:!0,animationMode:"always",duration:pe(),pickClosestTarget:!1})}_scaleRotateTranslateViewpoint(t,e,i,s,a){const{view:o}=this,{size:n,padding:l,constraints:r,scale:u,viewpoint:m}=o,_=u*i,p=r.canZoomInTo(_),g=r.canZoomOutTo(_);return(i<1&&!p||i>1&&!g)&&(i=1),ft(m,m,a),ie(t,m,i,s,e,n,l),r.constrainByGeometry(t)}};c([f()],V.prototype,"animationManager",void 0),c([f({type:Boolean,readOnly:!0})],V.prototype,"interacting",void 0),c([f()],V.prototype,"pan",void 0),c([f()],V.prototype,"pinch",void 0),c([f()],V.prototype,"rotate",void 0),c([f()],V.prototype,"view",void 0),c([f()],V.prototype,"zoomBox",void 0),V=c([X("esri.views.2d.navigation.MapViewNavigation")],V);const Ni=V;class fe extends Ct{}c([Mt(0,S)],fe.prototype,"position",void 0);class bi extends Ft{}class z extends ot{}c([w(j)],z.prototype,"readbackTexture",void 0),c([w(j)],z.prototype,"maskTexture",void 0),c([w(j)],z.prototype,"overlayTexture",void 0),c([w(y)],z.prototype,"background",void 0),c([w(y)],z.prototype,"drawPos",void 0),c([w(h)],z.prototype,"maskEnabled",void 0),c([w(h)],z.prototype,"overlayEnabled",void 0);class Zt extends Tt{vertex(e){const i=e.position,s=e.position.subtract(new S(.5)).multiply(this.config.drawPos.zw),a=this.config.drawPos.xy.add(s);return{glPosition:new y(a,0,1),texCoord:i}}fragment(e){let i=G(this.config.readbackTexture,xi(e.texCoord));i=i.add(new h(1).subtract(i.a)).multiply(this.config.background);const s=C(D(this.config.maskEnabled,new h(1)),G(this.config.maskTexture,e.texCoord).a,new h(1));i=i.multiply(s);const a=C(D(this.config.overlayEnabled,new h(1)),G(this.config.overlayTexture,e.texCoord),new y(0)),o=new kt;return o.glFragColor=a.add(new h(1).subtract(a.a).multiply(i)),o}}function xi(t){const e=t.multiply(new S(2)).subtract(1);return C(D(e.x,new h(0)).and(D(e.y,new h(0))),new S(.5),()=>{const i=Ae(e.y,e.x),s=Ze(Be(e),new h(Ne)),a=new S(Oe(i),qe(i));return s.multiply(a).multiply(new S(.5)).add(new h(.5))})}c([w(z)],Zt.prototype,"config",void 0),c([I(0,A(fe))],Zt.prototype,"vertex",null),c([I(0,A(bi))],Zt.prototype,"fragment",null);class be extends Ct{}c([Mt(0,S)],be.prototype,"position",void 0);class Mi extends Ft{}class xe extends ot{}c([w(Ue)],xe.prototype,"dvs",void 0);class N extends ot{}c([w(h)],N.prototype,"halfWidth",void 0),c([w(h)],N.prototype,"aaWidth",void 0),c([w(h)],N.prototype,"pxPerCell",void 0),c([w(y)],N.prototype,"minorLineColor",void 0),c([w(y)],N.prototype,"majorLineColor",void 0),c([w(Bt)],N.prototype,"majorLineInterval",void 0);class yt extends Tt{vertex(e){const i=e.position.multiply(2).subtract(1);return{gridPos:this.transform.dvs.multiply(new b(i,1)).xy,glPosition:new y(i,0,1)}}fragment(e){const i=ce(e.gridPos),s=Le(i),a=F(s.x,new h(1).subtract(s.x)),o=F(s.y,new h(1).subtract(s.y)),n=new S(a,o).multiply(this.config.pxPerCell).subtract(this.config.halfWidth),l=F(n.x,n.y),r=new h(1).subtract(ze(new h(0),this.config.aaWidth,l)),u=new Bt(Jt(i.x)),m=new Bt(Jt(i.y)),_=new h(te(u,this.config.majorLineInterval)),p=new h(te(m,this.config.majorLineInterval)),g=C(de(n.x,n.y),_,p),v=Xt(Re(P(n.x,this.config.aaWidth),P(n.y,this.config.aaWidth)),new h(.5)),T=F(_,p),at=C(v,T,g),rt=$e(this.config.majorLineColor,this.config.minorLineColor,F(at,new h(1))),Y=new kt;return Y.glFragColor=rt.multiply(r),Y}}c([w(xe)],yt.prototype,"transform",void 0),c([w(N)],yt.prototype,"config",void 0),c([I(0,A(be))],yt.prototype,"vertex",null),c([I(0,A(Mi))],yt.prototype,"fragment",null);export{Zt as E,Ni as F,Rt as T,$i as a,Ii as b,Pi as c,Zi as d,K as j,Ai as m,yt as r,dt as t}; diff --git a/custom-toc-highlight/assets/GroupLayer-ER-XzoYr-LPsQSYf2.js b/custom-toc-highlight/assets/GroupLayer-ER-XzoYr-DlHeNdGj.js similarity index 72% rename from custom-toc-highlight/assets/GroupLayer-ER-XzoYr-LPsQSYf2.js rename to custom-toc-highlight/assets/GroupLayer-ER-XzoYr-DlHeNdGj.js index f6d013f5..9c8caa26 100644 --- a/custom-toc-highlight/assets/GroupLayer-ER-XzoYr-LPsQSYf2.js +++ b/custom-toc-highlight/assets/GroupLayer-ER-XzoYr-DlHeNdGj.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./groupLayerUtils-D-25JsA_-D02uFLM4.js","./utils-BVWK2jiA-Btpo3M9u.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./jsonContext-BA8GHqVk-CWQlLGSw.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./saveUtils-CIYk-dsQ-VGcOewby.js","./resourceUtils-BmW6QqlX-B1DAUGNs.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-BROWZCZ1.js"])))=>i.map(i=>d[i]); -import{_ as u}from"./main-ugzBrWNm.js";import{bp as b,ah as d,bP as v,W as c,bU as f,v as s,S as l,ac as h,a0 as _,ax as w,ai as g,av as m,i as L,a1 as I}from"./story-BfX8CRfG.js";import{f as O}from"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import{y as S}from"./loadAll-e978YItg-CdtGGDtb.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as P}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{u as V}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{E as A}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as M}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{S as x}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{p as C}from"./fetchService-DbaKmJhP-W7rGyykJ.js";import R from"./PortalItem-CctGdnxF-C7IJrZYq.js";import{x as T,L as $,g as G}from"./TablesMixin-C8RojhYs-AdFcW_TR.js";import{E as p}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import{i as F}from"./saveUtils-CIYk-dsQ-VGcOewby.js";import{y as H}from"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";const j=Symbol("WebScene");let r=class extends V(x(A(M(T($(E(P))))))){constructor(e){super(e),this.allLayers=new O({getCollections:()=>[this.layers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=G(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=b(async(i,t,o)=>{const{save:a,saveAs:n}=await u(()=>import("./groupLayerUtils-D-25JsA_-D02uFLM4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);switch(i){case p.SAVE:return a(this,t);case p.SAVE_AS:return n(this,o,t)}})}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([d(()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&j in e},e=>{const i="prevent-adding-tables";this.removeHandles(i),e&&(this.tables.removeAll(),this.addHandles(g(()=>this.tables,"before-add",t=>{t.preventDefault(),I.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")}),i))},w),d(()=>this.visible,this._onVisibilityChange.bind(this),m)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===v.USER}_writeLayers(e,i,t,o){const a=[];if(!e)return a;e.forEach(n=>{const y=H(n,o.webmap?o.webmap.getLayerJSONFromResourceInfo(n):null,o);y?.layerType&&a.push(y)}),i.layers=a}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,i,t){const{itemId:o,layerType:a}=i;if(a==="GroupLayer"&&o)return new R({id:o,portal:t?.portal})}writePortalItem(e,i){e?.id&&(i.itemId=e.id)}set visibilityMode(e){const i=this._get("visibilityMode")!==e;this._set("visibilityMode",e),i&&this._enforceVisibility(e,this.visible)}async beforeSave(){return F(this)}load(e){const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service"],layerModuleTypeMap:C},e).catch(t=>{if(c(t),this.sourceIsPortalItem)throw t});return this.addResolvingPromise(i),Promise.resolve(this)}async loadAll(){return S(this,e=>{e(this.layers,this.tables)})}async save(e){return this._debouncedSaveOperations(p.SAVE,e)}async saveAs(e,i){return this._debouncedSaveOperations(p.SAVE_AS,i,e)}layerAdded(e){e.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(e):this.visibilityMode==="inherited"&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer read to Grouplayer: uid=${e.uid}`):this.addHandles(d(()=>e.visible,i=>this._onChildVisibilityChange(e,i),m),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach(i=>{i!==e&&(i.visible=!1)})}_enforceVisibility(e,i){if(!f(this).initialized)return;const t=this.layers;let o=t.find(a=>a.visible);switch(e){case"exclusive":t.length&&!o&&(o=t.at(0),o.visible=!0),this._turnOffOtherLayers(o);break;case"inherited":t.forEach(a=>{a.visible=i})}}_onVisibilityChange(e){this.visibilityMode==="inherited"&&this.layers.forEach(i=>{i.visible=e})}_onChildVisibilityChange(e,i){switch(this.visibilityMode){case"exclusive":i?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(e=>e.visible)}};s([l({readOnly:!0,dependsOn:[]})],r.prototype,"allLayers",void 0),s([l({readOnly:!0})],r.prototype,"allTables",void 0),s([l({json:{read:!0,write:!0}})],r.prototype,"blendMode",void 0),s([l()],r.prototype,"fullExtent",void 0),s([l({readOnly:!0})],r.prototype,"sourceIsPortalItem",null),s([l({json:{read:!1,write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([h("layers")],r.prototype,"_writeLayers",null),s([l({type:["GroupLayer"]})],r.prototype,"operationalLayerType",void 0),s([l({json:{origins:{"web-map":{read:!1,write:{overridePolicy(e,i,t){return{enabled:e?.type==="Group Layer"&&t?.initiator!==this}}}},"web-scene":{read:!1,write:!1}}}})],r.prototype,"portalItem",null),s([_("web-map","portalItem",["itemId"])],r.prototype,"readPortalItem",null),s([h("web-map","portalItem",{itemId:{type:String}})],r.prototype,"writePortalItem",null),s([l()],r.prototype,"spatialReference",void 0),s([l({json:{read:!1},readOnly:!0,value:"group"})],r.prototype,"type",void 0),s([l({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,i,t)=>{e!=="inherited"&&(i[t]=e)}}}}})],r.prototype,"visibilityMode",null),r=s([L("esri.layers.GroupLayer")],r);const ue=r;export{ue as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./groupLayerUtils-D-25JsA_-CvTWRcG7.js","./utils-BVWK2jiA-i-Dn2Ad8.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CfFOGshS.js","./jsonContext-BA8GHqVk-BsXRY5es.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./saveUtils-CIYk-dsQ-Br9QCJTX.js","./resourceUtils-BmW6QqlX-D_AxNrCI.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-GPPQBysx.js"])))=>i.map(i=>d[i]); +import{_ as u}from"./main-QGPoLsvl.js";import{bp as b,ah as d,bP as v,W as c,bU as f,v as s,S as l,ac as h,a0 as _,ax as w,ai as g,av as m,i as L,a1 as I}from"./story-Doly9N9p.js";import{f as O}from"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import{y as S}from"./loadAll-e978YItg-4pMG3qU7.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as P}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{u as V}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{E as A}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as M}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{S as x}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{p as C}from"./fetchService-DbaKmJhP-Ccg-phWf.js";import R from"./PortalItem-CctGdnxF-CfFOGshS.js";import{x as T,L as $,g as G}from"./TablesMixin-C8RojhYs-LCBvmsnP.js";import{E as p}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import{i as F}from"./saveUtils-CIYk-dsQ-Br9QCJTX.js";import{y as H}from"./writeUtils-D5qlLkwk-enZap9KW.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";const j=Symbol("WebScene");let r=class extends V(x(A(M(T($(E(P))))))){constructor(e){super(e),this.allLayers=new O({getCollections:()=>[this.layers],getChildrenFunction:i=>"layers"in i?i.layers:null}),this.allTables=G(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group",this._debouncedSaveOperations=b(async(i,t,o)=>{const{save:a,saveAs:n}=await u(()=>import("./groupLayerUtils-D-25JsA_-CvTWRcG7.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);switch(i){case p.SAVE:return a(this,t);case p.SAVE_AS:return n(this,o,t)}})}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles([d(()=>{let e=this.parent;for(;e&&"parent"in e&&e.parent;)e=e.parent;return e&&j in e},e=>{const i="prevent-adding-tables";this.removeHandles(i),e&&(this.tables.removeAll(),this.addHandles(g(()=>this.tables,"before-add",t=>{t.preventDefault(),I.getLogger(this).errorOnce("tables","tables in group layers in a webscene are not supported. Please move the tables from the group layer to the webscene if you want to persist them.")}),i))},w),d(()=>this.visible,this._onVisibilityChange.bind(this),m)])}destroy(){this.allLayers.destroy(),this.allTables.destroy()}get sourceIsPortalItem(){return this.portalItem&&this.originIdOf("portalItem")===v.USER}_writeLayers(e,i,t,o){const a=[];if(!e)return a;e.forEach(n=>{const y=H(n,o.webmap?o.webmap.getLayerJSONFromResourceInfo(n):null,o);y?.layerType&&a.push(y)}),i.layers=a}set portalItem(e){this._set("portalItem",e)}readPortalItem(e,i,t){const{itemId:o,layerType:a}=i;if(a==="GroupLayer"&&o)return new R({id:o,portal:t?.portal})}writePortalItem(e,i){e?.id&&(i.itemId=e.id)}set visibilityMode(e){const i=this._get("visibilityMode")!==e;this._set("visibilityMode",e),i&&this._enforceVisibility(e,this.visible)}async beforeSave(){return F(this)}load(e){const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Group Layer","Scene Service"],layerModuleTypeMap:C},e).catch(t=>{if(c(t),this.sourceIsPortalItem)throw t});return this.addResolvingPromise(i),Promise.resolve(this)}async loadAll(){return S(this,e=>{e(this.layers,this.tables)})}async save(e){return this._debouncedSaveOperations(p.SAVE,e)}async saveAs(e,i){return this._debouncedSaveOperations(p.SAVE_AS,i,e)}layerAdded(e){e.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(e):this.visibilityMode==="inherited"&&(e.visible=this.visible),this.hasHandles(e.uid)?console.error(`Layer read to Grouplayer: uid=${e.uid}`):this.addHandles(d(()=>e.visible,i=>this._onChildVisibilityChange(e,i),m),e.uid)}layerRemoved(e){this.removeHandles(e.uid),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(e){this.layers.forEach(i=>{i!==e&&(i.visible=!1)})}_enforceVisibility(e,i){if(!f(this).initialized)return;const t=this.layers;let o=t.find(a=>a.visible);switch(e){case"exclusive":t.length&&!o&&(o=t.at(0),o.visible=!0),this._turnOffOtherLayers(o);break;case"inherited":t.forEach(a=>{a.visible=i})}}_onVisibilityChange(e){this.visibilityMode==="inherited"&&this.layers.forEach(i=>{i.visible=e})}_onChildVisibilityChange(e,i){switch(this.visibilityMode){case"exclusive":i?this._turnOffOtherLayers(e):this._isAnyLayerVisible()||(e.visible=!0);break;case"inherited":e.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(e=>e.visible)}};s([l({readOnly:!0,dependsOn:[]})],r.prototype,"allLayers",void 0),s([l({readOnly:!0})],r.prototype,"allTables",void 0),s([l({json:{read:!0,write:!0}})],r.prototype,"blendMode",void 0),s([l()],r.prototype,"fullExtent",void 0),s([l({readOnly:!0})],r.prototype,"sourceIsPortalItem",null),s([l({json:{read:!1,write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([h("layers")],r.prototype,"_writeLayers",null),s([l({type:["GroupLayer"]})],r.prototype,"operationalLayerType",void 0),s([l({json:{origins:{"web-map":{read:!1,write:{overridePolicy(e,i,t){return{enabled:e?.type==="Group Layer"&&t?.initiator!==this}}}},"web-scene":{read:!1,write:!1}}}})],r.prototype,"portalItem",null),s([_("web-map","portalItem",["itemId"])],r.prototype,"readPortalItem",null),s([h("web-map","portalItem",{itemId:{type:String}})],r.prototype,"writePortalItem",null),s([l()],r.prototype,"spatialReference",void 0),s([l({json:{read:!1},readOnly:!0,value:"group"})],r.prototype,"type",void 0),s([l({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{type:["independent","exclusive"],write:(e,i,t)=>{e!=="inherited"&&(i[t]=e)}}}}})],r.prototype,"visibilityMode",null),r=s([L("esri.layers.GroupLayer")],r);const ue=r;export{ue as default}; diff --git a/custom-toc-highlight/assets/GroupLayerView2D-BR-kLeLa-BQ6LGY1P.js b/custom-toc-highlight/assets/GroupLayerView2D-BR-kLeLa-CBq3r1hE.js similarity index 59% rename from custom-toc-highlight/assets/GroupLayerView2D-BR-kLeLa-BQ6LGY1P.js rename to custom-toc-highlight/assets/GroupLayerView2D-BR-kLeLa-CBq3r1hE.js index 7cc4b08c..20740242 100644 --- a/custom-toc-highlight/assets/GroupLayerView2D-BR-kLeLa-BQ6LGY1P.js +++ b/custom-toc-highlight/assets/GroupLayerView2D-BR-kLeLa-CBq3r1hE.js @@ -1 +1 @@ -import{v as t,S as s,dA as n,i as h,ag as m,ah as l,av as o,am as d}from"./story-BfX8CRfG.js";import{X as V,Y as w}from"./LayerView-Bish-E63-rB2WUWF4.js";import"./main-ugzBrWNm.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";let r=class extends w{constructor(i){super(i),this.type="group",this.layerViews=new m}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.addHandles([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),l(()=>this.layer?.visibilityMode,()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},o),l(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},o)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}get creatingLayerViews(){return this.view?.layerViewManager?.isCreatingLayerViewsForLayer(this.layer)??!1}set layerViews(i){this._set("layerViews",d(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.creatingLayerViews||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=>!!this._findLayerViewForLayer(e)?.visible);return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){i==null&&(i=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map(a=>l(()=>a.visible,y=>this._applyVisibility(()=>{y!==this.visible&&(a.visible=this.visible)},()=>this._applyExclusiveVisibility(y?a:null)),o)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e?.visible?e:null))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&(this.layer?.visibilityMode==="inherited"?i():this.layer?.visibilityMode==="exclusive"&&e())}};t([s({readOnly:!0})],r.prototype,"creatingLayerViews",null),t([s({cast:n})],r.prototype,"layerViews",null),t([s({readOnly:!0})],r.prototype,"updatingProgress",null),t([s()],r.prototype,"view",void 0),r=t([h("esri.views.layers.GroupLayerView")],r);const v=r;let p=class extends V(v){attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(i){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((i,e)=>this.container.addChildAt(i.container,e))}};p=t([h("esri.views.2d.layers.GroupLayerView2D")],p);const fi=p;export{fi as default}; +import{v as t,S as s,dA as n,i as h,ag as m,ah as l,av as o,am as d}from"./story-Doly9N9p.js";import{X as V,Y as w}from"./LayerView-Bish-E63-DK1SFHE3.js";import"./main-QGPoLsvl.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";let r=class extends w{constructor(i){super(i),this.type="group",this.layerViews=new m}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.addHandles([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),l(()=>this.layer?.visibilityMode,()=>{this.layer&&this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null))},o),l(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},o)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}get creatingLayerViews(){return this.view?.layerViewManager?.isCreatingLayerViewsForLayer(this.layer)??!1}set layerViews(i){this._set("layerViews",d(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.creatingLayerViews||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=>!!this._findLayerViewForLayer(e)?.visible);return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){i==null&&(i=this._firstVisibleOnLayerOrder())==null&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map(a=>l(()=>a.visible,y=>this._applyVisibility(()=>{y!==this.visible&&(a.visible=this.visible)},()=>this._applyExclusiveVisibility(y?a:null)),o)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e?.visible?e:null))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&(this.layer?.visibilityMode==="inherited"?i():this.layer?.visibilityMode==="exclusive"&&e())}};t([s({readOnly:!0})],r.prototype,"creatingLayerViews",null),t([s({cast:n})],r.prototype,"layerViews",null),t([s({readOnly:!0})],r.prototype,"updatingProgress",null),t([s()],r.prototype,"view",void 0),r=t([h("esri.views.layers.GroupLayerView")],r);const v=r;let p=class extends V(v){attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(i){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((i,e)=>this.container.addChildAt(i.container,e))}};p=t([h("esri.views.2d.layers.GroupLayerView2D")],p);const fi=p;export{fi as default}; diff --git a/custom-toc-highlight/assets/HUDMaterial.glsl-BLhEaLk5-CpaRLlUD.js b/custom-toc-highlight/assets/HUDMaterial.glsl-BLhEaLk5-DktRuv0T.js similarity index 97% rename from custom-toc-highlight/assets/HUDMaterial.glsl-BLhEaLk5-CpaRLlUD.js rename to custom-toc-highlight/assets/HUDMaterial.glsl-BLhEaLk5-DktRuv0T.js index 0f100547..32976d33 100644 --- a/custom-toc-highlight/assets/HUDMaterial.glsl-BLhEaLk5-CpaRLlUD.js +++ b/custom-toc-highlight/assets/HUDMaterial.glsl-BLhEaLk5-DktRuv0T.js @@ -1,4 +1,4 @@ -import{v as m,S as v,i as K,c$ as nr,I as ar,J as wr,ah as ns,aL as as,$ as ve,j as ye,ay as os,gI as ls,hT as cs,cJ as br,e6 as hs,ig as ds,hb as us,dg as A,ih as fs,bl as Xe,a1 as ps,ii as ms,ij as wi,aq as bi,x as xi,aT as gs,aA as _s,o as Ut,K as vs,dk as ys,a2 as ws,U as bs,gU as xs,ik as Is,il as $t,im as Cs,io as Ts,ip as Ss,iq as Os,ir as Rs,is as As,it as xr,iu as Es,iv as Ms,iw as or,ae as Ds,bh as Ii,bj as Ps,hZ as Fs,eI as qt,h$ as Ci,i9 as je,B as Ls,p as Ns,he as Ir,ix as zs,i1 as Bs}from"./story-BfX8CRfG.js";import{Z as Gs}from"./QueryEngine-CH5uUhZK-BP95Dm56.js";import{b as Cr}from"./Query-BrwMGK8U-DoFNfkjX.js";import{h as Vs}from"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import{N as js,R as Ti}from"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";import{n as Hs}from"./timeSupport-jPViR5jn-GyoVmGVI.js";import{c as kt}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{p as Us}from"./query-DFW9-NG_-gbjlxRZk.js";import{o as $s}from"./pbf-D-y3_eZO-DQKnyfOm.js";import{g as qs}from"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import{o as ks}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{k as Ws,m as Ys}from"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import{l as ne}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{A as Qs,w as Js}from"./Indices-DEr2HrWx-BuNk6xPZ.js";import{e as ae,o as le,T as Xs,c as Zs,i as Tr,m as Ks}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{d as Si,D as en,m as ft,P as tn}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as X,o as lr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{h as rn,b as F,Q as sn,i as nn,V as an,_ as on,F as ln,J as W,N as Wt,v as cn,x as hn,a as dn,z as Oi,e as un,j as fn,A as pn,t as Me,L as Sr,r as ge,c as Ri,m as mn,G as Ai,d as Yt,u as gn,k as Ue,f as _n,Z as vn,n as yn,g as Ei,X as wn,l as bn,o as Qt,s as pt,p as xn,P as In,q as Cn,U as Tn,w as Sn,y as On,S as Rn,B as An,C as En,$ as Mn,W as Or,D as Dn,T as Pn,E as Fn,H as Ln,I as Nn,K as zn,M as Bn,O as Gn,R as Vn,Y as jn,a0 as Rr,a1 as Ar,a2 as Hn,a3 as Un,a4 as $n,a5 as qn,a6 as kn,a7 as Wn,a8 as Yn,a9 as Qn,aa as Er}from"./AttributeArray-BWXEft_i-ZluJi335.js";import{p as xt}from"./glUtil-n1JOrdV3-CRAZdee5.js";import{o as E,s as Ct}from"./NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js";import{e as Mr,t as Jn}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{s as Xn}from"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import{k as ce,z as Pe,G as cr,B as Jt,a as Zn,M as Kn,n as ea,Z as ta,N as ra,E as ia}from"./mat4-DX7gBViE-DVqdGrVU.js";import{t as L,u as sa}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{h as N}from"./Util-BjGjeg6f-08Szkf4F.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{r as Y,S as $e,l as he,_ as ie,g as Mi,A as j,R as Ze,k as Dr,y as qe,G as Pr,C as na,L as Z,b as me,W as aa,Y as _e,j as ht,Z as oa}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{R as hr}from"./InterleavedLayout-DXzw3B2n-iCEii9j9.js";import{o as Fr,O as Lr,E as Tt,p as Ke,b as Nr,D as He}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{N as la,S as ca,B as ha,y as Xt}from"./Octree-CJNwbhg4-kBqt3mh_.js";import{d as Di,D as da,b as ua,F as fa,H as pa,V as ma,_ as zr}from"./sphere-BenPORjV-DaZ5Vv8x.js";import{l as ga,I as _a,u as va,f as de,r as ya,M as wa}from"./plane-Dt8R0KeE-CVSP2GQG.js";import{I as Fe,A as Br}from"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import{P as dr,k as ba,V as xa}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as ur}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{b as Gr,m as Ia,o as mt,p as Ca,A as Ta,X as Pi,L as ke,O as Vr,l as jr}from"./BufferView-PQoE3GL7-Duht5lAO.js";import{r as Fi}from"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import{G as Hr,n as Li,T as Ur,L as Sa}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{q as Oa,R as Ra}from"./boundedPlane-DlvE0eNx-dpkNyaGh.js";import{c as Aa}from"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import{f as Ea}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{i as Ma,p as Da}from"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import{r as Pa,i as Fa}from"./Texture-BCt2hphT-hC4XzHg_.js";import{l as La}from"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import{o as oe}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{N as Na,K as za,B as Ba,m as Ga}from"./renderState-Dap0WV9P-D4IHxyei.js";import{n as Va}from"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import{p as gt}from"./projectVectorToVector-sIYLNlex-B_PqSyiH.js";import{G as ja}from"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import{t as re,o as Ye}from"./vec3f32-BS0cezmI-B_madU1n.js";import{M as se}from"./orientedBoundingBox-oHezdpWm-BCiifXla.js";import"./triangle-hqU-Tc1X-DLjOhwz3.js";import{x as Ha}from"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import{p as Ua}from"./projectPointToVector-B2UUY9SE-BChPjj6-.js";import{e as w,c as z}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{a as $a}from"./BindType-9iOk18Ed-CRW1cdX4.js";import"./main-ugzBrWNm.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./WhereClause-DxwoyBMS-DnXKVpm2.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-wUwu1nm1.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./utils-DyydRFHu-BQ5pghrp.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./utils-tNxq3jkf-B78XlSIE.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./requestImageUtils-Ut4YcoNU-BtID-_Ic.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./lineSegment-CcqvCARM-CF4YE8GC.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./quat-BODLR7mS-BrXZAXDf.js";function qa(e){e.code.add(w`const float MAX_RGBA_FLOAT = +import{v as m,S as v,i as K,c$ as nr,I as ar,J as wr,ah as ns,aL as as,$ as ve,j as ye,ay as os,gI as ls,hT as cs,cJ as br,e6 as hs,ig as ds,hb as us,dg as A,ih as fs,bl as Xe,a1 as ps,ii as ms,ij as wi,aq as bi,x as xi,aT as gs,aA as _s,o as Ut,K as vs,dk as ys,a2 as ws,U as bs,gU as xs,ik as Is,il as $t,im as Cs,io as Ts,ip as Ss,iq as Os,ir as Rs,is as As,it as xr,iu as Es,iv as Ms,iw as or,ae as Ds,bh as Ii,bj as Ps,hZ as Fs,eI as qt,h$ as Ci,i9 as je,B as Ls,p as Ns,he as Ir,ix as zs,i1 as Bs}from"./story-Doly9N9p.js";import{Z as Gs}from"./QueryEngine-CH5uUhZK-DRGPyg2C.js";import{b as Cr}from"./Query-BrwMGK8U-BPr0_G9t.js";import{h as Vs}from"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import{N as js,R as Ti}from"./PooledRBush-DbfAmeLn-CPHfm9op.js";import{n as Hs}from"./timeSupport-jPViR5jn-7bshRI7L.js";import{c as kt}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{p as Us}from"./query-DFW9-NG_-C3TyGmiM.js";import{o as $s}from"./pbf-D-y3_eZO-CpHdkhuD.js";import{g as qs}from"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import{o as ks}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{k as Ws,m as Ys}from"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import{l as ne}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{A as Qs,w as Js}from"./Indices-DEr2HrWx-cFTwC5-9.js";import{e as ae,o as le,T as Xs,c as Zs,i as Tr,m as Ks}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{d as Si,D as en,m as ft,P as tn}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as X,o as lr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{h as rn,b as F,Q as sn,i as nn,V as an,_ as on,F as ln,J as W,N as Wt,v as cn,x as hn,a as dn,z as Oi,e as un,j as fn,A as pn,t as Me,L as Sr,r as ge,c as Ri,m as mn,G as Ai,d as Yt,u as gn,k as Ue,f as _n,Z as vn,n as yn,g as Ei,X as wn,l as bn,o as Qt,s as pt,p as xn,P as In,q as Cn,U as Tn,w as Sn,y as On,S as Rn,B as An,C as En,$ as Mn,W as Or,D as Dn,T as Pn,E as Fn,H as Ln,I as Nn,K as zn,M as Bn,O as Gn,R as Vn,Y as jn,a0 as Rr,a1 as Ar,a2 as Hn,a3 as Un,a4 as $n,a5 as qn,a6 as kn,a7 as Wn,a8 as Yn,a9 as Qn,aa as Er}from"./AttributeArray-BWXEft_i-lURl2Jp5.js";import{p as xt}from"./glUtil-n1JOrdV3-CRAZdee5.js";import{o as E,s as Ct}from"./NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js";import{e as Mr,t as Jn}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{s as Xn}from"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import{k as ce,z as Pe,G as cr,B as Jt,a as Zn,M as Kn,n as ea,Z as ta,N as ra,E as ia}from"./mat4-DX7gBViE-6clJxb1Q.js";import{t as L,u as sa}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{h as N}from"./Util-BjGjeg6f-08Szkf4F.js";import{T as p}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{r as Y,S as $e,l as he,_ as ie,g as Mi,A as j,R as Ze,k as Dr,y as qe,G as Pr,C as na,L as Z,b as me,W as aa,Y as _e,j as ht,Z as oa}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{R as hr}from"./InterleavedLayout-DXzw3B2n-BlOPeZMB.js";import{o as Fr,O as Lr,E as Tt,p as Ke,b as Nr,D as He}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{N as la,S as ca,B as ha,y as Xt}from"./Octree-CJNwbhg4-DECX_J2V.js";import{d as Di,D as da,b as ua,F as fa,H as pa,V as ma,_ as zr}from"./sphere-BenPORjV-B4uz1SYF.js";import{l as ga,I as _a,u as va,f as de,r as ya,M as wa}from"./plane-Dt8R0KeE-Bqc6oVGz.js";import{I as Fe,A as Br}from"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import{P as dr,k as ba,V as xa}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as ur}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{b as Gr,m as Ia,o as mt,p as Ca,A as Ta,X as Pi,L as ke,O as Vr,l as jr}from"./BufferView-PQoE3GL7-B9DLdqO9.js";import{r as Fi}from"./BufferObject-BM_7mcDb-EYaqMhmk.js";import{G as Hr,n as Li,T as Ur,L as Sa}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{q as Oa,R as Ra}from"./boundedPlane-DlvE0eNx-BQ9Xop25.js";import{c as Aa}from"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import{f as Ea}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{i as Ma,p as Da}from"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import{r as Pa,i as Fa}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{l as La}from"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import{o as oe}from"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import{N as Na,K as za,B as Ba,m as Ga}from"./renderState-Dap0WV9P-D4IHxyei.js";import{n as Va}from"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import{p as gt}from"./projectVectorToVector-sIYLNlex-DexDhaq1.js";import{G as ja}from"./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js";import"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import{t as re,o as Ye}from"./vec3f32-BS0cezmI-B_madU1n.js";import{M as se}from"./orientedBoundingBox-oHezdpWm-ilptOsP0.js";import"./triangle-hqU-Tc1X-CaBFJROi.js";import{x as Ha}from"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import{p as Ua}from"./projectPointToVector-B2UUY9SE-BIKNGLey.js";import{e as w,c as z}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{a as $a}from"./BindType-9iOk18Ed-CRW1cdX4.js";import"./main-QGPoLsvl.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-Dd_0rdy5.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./utils-DyydRFHu-1ITtOELE.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./utils-tNxq3jkf-nfQcZo7O.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./requestImageUtils-Ut4YcoNU-CZnNufeN.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./lineSegment-CcqvCARM-CDEWcAzV.js";import"./signal-CETehA7D-DQA5V72u.js";import"./quat-BODLR7mS-BQk2dgMZ.js";function qa(e){e.code.add(w`const float MAX_RGBA_FLOAT = 255.0 / 256.0 + 255.0 / 256.0 / 256.0 + 255.0 / 256.0 / 256.0 / 256.0 + diff --git a/custom-toc-highlight/assets/HeightModelInfo-C5vFqzyF-CupKpfDx.js b/custom-toc-highlight/assets/HeightModelInfo-C5vFqzyF-BH6aliHn.js similarity index 97% rename from custom-toc-highlight/assets/HeightModelInfo-C5vFqzyF-CupKpfDx.js rename to custom-toc-highlight/assets/HeightModelInfo-C5vFqzyF-BH6aliHn.js index f65b10db..355d1db9 100644 --- a/custom-toc-highlight/assets/HeightModelInfo-C5vFqzyF-CupKpfDx.js +++ b/custom-toc-highlight/assets/HeightModelInfo-C5vFqzyF-BH6aliHn.js @@ -1 +1 @@ -import{cr as c,cJ as p,v as s,S as l,ac as v,a0 as a,e as y,cK as m,cL as w,b0 as g,i as S}from"./story-BfX8CRfG.js";var n;const h=c()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),u=h.jsonValues.slice();p(u,"orthometric");const o=c()({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 r=n=class extends y{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return h.write(e,t,i)}readHeightModel(e,t,i){return h.read(e)||(i?.messages&&i.messages.push(f(e,{context:i})),null)}readHeightUnit(e,t,i){return o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readHeightUnitService(e,t,i){return m(e)||o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new n({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=w(t);return new n({heightModel:e.heightModel,heightUnit:i??void 0,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 n;return t.read(e,{origin:"web-scene"}),t}};function d(e,t){return new g("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}function f(e,t){return new g("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}s([l({type:h.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:u,default:"ellipsoidal"}}}})],r.prototype,"heightModel",void 0),s([v("web-scene","heightModel")],r.prototype,"writeHeightModel",null),s([a(["web-scene","service"],"heightModel")],r.prototype,"readHeightModel",null),s([l({type:o.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:o.jsonValues,write:o.write}}}})],r.prototype,"heightUnit",void 0),s([a("web-scene","heightUnit")],r.prototype,"readHeightUnit",null),s([a("service","heightUnit")],r.prototype,"readHeightUnitService",null),s([l({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],r.prototype,"vertCRS",void 0),s([a("service","vertCRS",["vertCRS","ellipsoid","geoid"])],r.prototype,"readVertCRS",null),r=n=s([S("esri.geometry.HeightModelInfo")],r);const U=r;export{U as M}; +import{cr as c,cJ as p,v as s,S as l,ac as v,a0 as a,e as y,cK as m,cL as w,b0 as g,i as S}from"./story-Doly9N9p.js";var n;const h=c()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),u=h.jsonValues.slice();p(u,"orthometric");const o=c()({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 r=n=class extends y{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return h.write(e,t,i)}readHeightModel(e,t,i){return h.read(e)||(i?.messages&&i.messages.push(f(e,{context:i})),null)}readHeightUnit(e,t,i){return o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readHeightUnitService(e,t,i){return m(e)||o.read(e)||(i?.messages&&i.messages.push(d(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new n({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=w(t);return new n({heightModel:e.heightModel,heightUnit:i??void 0,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 n;return t.read(e,{origin:"web-scene"}),t}};function d(e,t){return new g("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}function f(e,t){return new g("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}s([l({type:h.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:u,default:"ellipsoidal"}}}})],r.prototype,"heightModel",void 0),s([v("web-scene","heightModel")],r.prototype,"writeHeightModel",null),s([a(["web-scene","service"],"heightModel")],r.prototype,"readHeightModel",null),s([l({type:o.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:o.jsonValues,write:o.write}}}})],r.prototype,"heightUnit",void 0),s([a("web-scene","heightUnit")],r.prototype,"readHeightUnit",null),s([a("service","heightUnit")],r.prototype,"readHeightUnitService",null),s([l({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],r.prototype,"vertCRS",void 0),s([a("service","vertCRS",["vertCRS","ellipsoid","geoid"])],r.prototype,"readVertCRS",null),r=n=s([S("esri.geometry.HeightModelInfo")],r);const U=r;export{U as M}; diff --git a/custom-toc-highlight/assets/HighlightGraphicContainer-Dt5r6lMq-KuyTjNqc.js b/custom-toc-highlight/assets/HighlightGraphicContainer-Dt5r6lMq-CwALk6za.js similarity index 65% rename from custom-toc-highlight/assets/HighlightGraphicContainer-Dt5r6lMq-KuyTjNqc.js rename to custom-toc-highlight/assets/HighlightGraphicContainer-Dt5r6lMq-CwALk6za.js index b51abf34..3b9833b7 100644 --- a/custom-toc-highlight/assets/HighlightGraphicContainer-Dt5r6lMq-KuyTjNqc.js +++ b/custom-toc-highlight/assets/HighlightGraphicContainer-Dt5r6lMq-CwALk6za.js @@ -1 +1 @@ -import{v as i,i as s}from"./story-BfX8CRfG.js";import{E as a,h,R as n}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{K as l}from"./AGraphicContainer-LUCT6Gle-Dvv0TF4N.js";let r=class extends l{get hasHighlight(){return this.children.some(e=>e.hasData)}renderChildren(e){this.attributeView.update(),e.drawPhase===a.HIGHLIGHT&&this.children.some(t=>t.hasData)&&(super.renderChildren(e),e.context.setColorMask(!0,!0,!0,!0),h(e,!0,t=>{this._renderChildren(t,n.All)},0))}};r=i([s("esri.views.2d.layers.graphics.HighlightGraphicContainer")],r);const m=r;export{m as l}; +import{v as i,i as s}from"./story-Doly9N9p.js";import{E as a,h,R as n}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{K as l}from"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";let r=class extends l{get hasHighlight(){return this.children.some(e=>e.hasData)}renderChildren(e){this.attributeView.update(),e.drawPhase===a.HIGHLIGHT&&this.children.some(t=>t.hasData)&&(super.renderChildren(e),e.context.setColorMask(!0,!0,!0,!0),h(e,!0,t=>{this._renderChildren(t,n.All)},0))}};r=i([s("esri.views.2d.layers.graphics.HighlightGraphicContainer")],r);const m=r;export{m as l}; diff --git a/custom-toc-highlight/assets/I3SBinaryReader-DEbI3cKZ-Bdob26G6.js b/custom-toc-highlight/assets/I3SBinaryReader-DEbI3cKZ-0ASBQHPj.js similarity index 99% rename from custom-toc-highlight/assets/I3SBinaryReader-DEbI3cKZ-Bdob26G6.js rename to custom-toc-highlight/assets/I3SBinaryReader-DEbI3cKZ-0ASBQHPj.js index e8dde094..39933ed3 100644 --- a/custom-toc-highlight/assets/I3SBinaryReader-DEbI3cKZ-Bdob26G6.js +++ b/custom-toc-highlight/assets/I3SBinaryReader-DEbI3cKZ-0ASBQHPj.js @@ -1,2 +1,2 @@ -import{o as f,a1 as D,P as S}from"./story-BfX8CRfG.js";import{T as U}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";const d=!0,m={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function z(t,e,r){return{identifier:String.fromCharCode.apply(null,new Uint8Array(t,r+m.identifierOffset,m.identifierLength)),version:e.getUint16(r+m.versionOffset,d),checksum:e.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 k(t,e){return{sizeLo:t.getUint32(e+y.sizeLo,d),sizeHi:t.getUint32(e+y.sizeHi,d),minX:t.getFloat64(e+y.minX,d),minY:t.getFloat64(e+y.minY,d),minZ:t.getFloat64(e+y.minZ,d),maxX:t.getFloat64(e+y.maxX,d),maxY:t.getFloat64(e+y.maxY,d),maxZ:t.getFloat64(e+y.maxZ,d),errorX:t.getFloat64(e+y.errorX,d),errorY:t.getFloat64(e+y.errorY,d),errorZ:t.getFloat64(e+y.errorZ,d),count:t.getUint32(e+y.count,d),reserved:t.getUint32(e+y.reserved,d)}}function q(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=z(t,e,r);if(r+=m.byteCount,c!=="LEPCC ")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=k(e,r);if(r+=y.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Float64Array(3*n.count),a=[],i=[],u=[],l=[];if(r=I(t,r,a),r=I(t,r,i),r=I(t,r,u),r=I(t,r,l),r!==t.byteLength)throw new f("lepcc-decode-error","Bad length");let g=0,w=0;for(let b=0;b>6;let i=0;if(a===0)i=c.getUint32(1,d),e+=5;else if(a===1)i=c.getUint16(1,d),e+=3;else{if(a!==2)throw new f("lepcc-decode-error","Bad count type");i=c.getUint8(1),e+=2}if(s)throw new f("lepcc-decode-error","LUT not implemented");const u=Math.ceil(i*n/8),l=new Uint8Array(t,e,u);let g=0,w=0,b=0;const v=-1>>>32-n;for(let C=0;C>>=n,w-=n,w+n>32&&(g|=l[b-1]>>8-w)}return e+b}const h={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function Y(t,e){return{sizeLo:t.getUint32(e+h.sizeLo,d),sizeHi:t.getUint32(e+h.sizeHi,d),count:t.getUint32(e+h.count,d),colorMapCount:t.getUint16(e+h.colorMapCount,d),lookupMethod:t.getUint8(e+h.lookupMethod),compressionMethod:t.getUint8(e+h.compressionMethod)}}function V(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=z(t,e,r);if(r+=m.byteCount,c!=="ClusterRGB")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=Y(e,r);if(r+=h.byteCount,n.sizeHi*2**32+n.sizeLo!==t.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!==t.byteLength||n.colorMapCount>256)throw new f("lepcc-decode-error","Bad count");const s=new Uint8Array(t,r,3*n.colorMapCount),a=new Uint8Array(t,r+3*n.colorMapCount,n.count),i=new Uint8Array(3*n.count);for(let u=0;u1)throw new f("lepcc-decode-error","Unknown version");const n=X(e,r);if(r+=p.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Uint16Array(n.count);if(n.bitsPerPoint===8){if(n.count+r!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const a=new Uint8Array(t,r,n.count);for(let i=0;iD.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function H(t,e,r){let c="",o=0;for(;o=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&t[e+o+1];c+=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&t[e+o+1])<<6|63&t[e+o+2];c+=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&t[e+o+1])<<12|(63&t[e+o+2])<<6|63&t[e+o+3];if(s>=65536){const a=55296+(s-65536>>10),i=56320+(1023&s);c+=String.fromCharCode(a,i)}else c+=String.fromCharCode(s);o+=4}}}return c}function B(t,e){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let c=0;for(let o=0;o{const o=c?Date.parse(c):null;return o==null||Number.isNaN(o)?null:o})}function T(t,e,r){const c=[];let o,n,s=0;for(n=0;n0){if(c.push(H(r,s,o-1)),r[s+o-1]!==0)throw new f("string-array-error","Invalid string array: missing null termination.")}else c.push(null);s+=o}return c}function F(t,e){return new L[e.valueType](t,e.byteOffset,e.count*e.valuesPerElement)}function j(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}function R(t,e,r){const c=e.header!=null?B(t,e.header):{byteOffset:0,byteCount:0,fields:{count:r}},o={header:c,byteOffset:c.byteCount,byteCount:0,entries:Object.create(null)};let n=c.byteCount;for(let s=0;s1)throw new f("lepcc-decode-error","Unknown version");const n=k(e,r);if(r+=y.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Float64Array(3*n.count),a=[],i=[],u=[],l=[];if(r=I(t,r,a),r=I(t,r,i),r=I(t,r,u),r=I(t,r,l),r!==t.byteLength)throw new f("lepcc-decode-error","Bad length");let g=0,w=0;for(let b=0;b>6;let i=0;if(a===0)i=c.getUint32(1,d),e+=5;else if(a===1)i=c.getUint16(1,d),e+=3;else{if(a!==2)throw new f("lepcc-decode-error","Bad count type");i=c.getUint8(1),e+=2}if(s)throw new f("lepcc-decode-error","LUT not implemented");const u=Math.ceil(i*n/8),l=new Uint8Array(t,e,u);let g=0,w=0,b=0;const v=-1>>>32-n;for(let C=0;C>>=n,w-=n,w+n>32&&(g|=l[b-1]>>8-w)}return e+b}const h={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function Y(t,e){return{sizeLo:t.getUint32(e+h.sizeLo,d),sizeHi:t.getUint32(e+h.sizeHi,d),count:t.getUint32(e+h.count,d),colorMapCount:t.getUint16(e+h.colorMapCount,d),lookupMethod:t.getUint8(e+h.lookupMethod),compressionMethod:t.getUint8(e+h.compressionMethod)}}function V(t){const e=new DataView(t,0);let r=0;const{identifier:c,version:o}=z(t,e,r);if(r+=m.byteCount,c!=="ClusterRGB")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=Y(e,r);if(r+=h.byteCount,n.sizeHi*2**32+n.sizeLo!==t.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!==t.byteLength||n.colorMapCount>256)throw new f("lepcc-decode-error","Bad count");const s=new Uint8Array(t,r,3*n.colorMapCount),a=new Uint8Array(t,r+3*n.colorMapCount,n.count),i=new Uint8Array(3*n.count);for(let u=0;u1)throw new f("lepcc-decode-error","Unknown version");const n=X(e,r);if(r+=p.byteCount,n.sizeHi*2**32+n.sizeLo!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Uint16Array(n.count);if(n.bitsPerPoint===8){if(n.count+r!==t.byteLength)throw new f("lepcc-decode-error","Bad size");const a=new Uint8Array(t,r,n.count);for(let i=0;iD.getLogger("esri.views.3d.layers.i3s.I3SBinaryReader");function H(t,e,r){let c="",o=0;for(;o=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&t[e+o+1];c+=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&t[e+o+1])<<6|63&t[e+o+2];c+=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&t[e+o+1])<<12|(63&t[e+o+2])<<6|63&t[e+o+3];if(s>=65536){const a=55296+(s-65536>>10),i=56320+(1023&s);c+=String.fromCharCode(a,i)}else c+=String.fromCharCode(s);o+=4}}}return c}function B(t,e){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let c=0;for(let o=0;o{const o=c?Date.parse(c):null;return o==null||Number.isNaN(o)?null:o})}function T(t,e,r){const c=[];let o,n,s=0;for(n=0;n0){if(c.push(H(r,s,o-1)),r[s+o-1]!==0)throw new f("string-array-error","Invalid string array: missing null termination.")}else c.push(null);s+=o}return c}function F(t,e){return new L[e.valueType](t,e.byteOffset,e.count*e.valuesPerElement)}function j(t,e){return new Uint8Array(t,e.byteOffset,e.byteCount)}function R(t,e,r){const c=e.header!=null?B(t,e.header):{byteOffset:0,byteCount:0,fields:{count:r}},o={header:c,byteOffset:c.byteCount,byteCount:0,entries:Object.create(null)};let n=c.byteCount;for(let s=0;snew DataView(t,0).getFloat32(e,!0),Float64:(t,e)=>new DataView(t,0).getFloat64(e,!0),UInt8:(t,e)=>new DataView(t,0).getUint8(e),Int8:(t,e)=>new DataView(t,0).getInt8(e),UInt16:(t,e)=>new DataView(t,0).getUint16(e,!0),Int16:(t,e)=>new DataView(t,0).getInt16(e,!0),UInt32:(t,e)=>new DataView(t,0).getUint32(e,!0),Int32:(t,e)=>new DataView(t,0).getInt32(e,!0)};function P(t){return L.hasOwnProperty(t)}function A(t){return P(t)?L[t].BYTES_PER_ELEMENT:0}export{J as $,F,K as G,q as Y}; diff --git a/custom-toc-highlight/assets/I3SLayerDefinitions-CwLXCKtU-CvmIU1C5.js b/custom-toc-highlight/assets/I3SLayerDefinitions-CwLXCKtU-BdHWzf5u.js similarity index 98% rename from custom-toc-highlight/assets/I3SLayerDefinitions-CwLXCKtU-CvmIU1C5.js rename to custom-toc-highlight/assets/I3SLayerDefinitions-CwLXCKtU-BdHWzf5u.js index 7e767f98..08352ecd 100644 --- a/custom-toc-highlight/assets/I3SLayerDefinitions-CwLXCKtU-CvmIU1C5.js +++ b/custom-toc-highlight/assets/I3SLayerDefinitions-CwLXCKtU-BdHWzf5u.js @@ -1 +1 @@ -import{v as e,S as t,i,bz as l,e as p}from"./story-BfX8CRfG.js";let y=class extends p{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};e([t({type:Number})],y.prototype,"nodesPerPage",void 0),e([t({type:Number})],y.prototype,"rootIndex",void 0),e([t({type:String})],y.prototype,"lodSelectionMetricType",void 0),y=e([i("esri.layers.support.I3SLayerDefinitions.I3SNodePageDefinition")],y);let n=class extends p{constructor(){super(...arguments),this.factor=1}};e([t({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],n.prototype,"id",void 0),e([t({type:Number})],n.prototype,"factor",void 0),n=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialTexture")],n);let a=class extends p{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]})],a.prototype,"baseColorFactor",void 0),e([t({type:n})],a.prototype,"baseColorTexture",void 0),e([t({type:n})],a.prototype,"metallicRoughnessTexture",void 0),e([t({type:Number})],a.prototype,"metallicFactor",void 0),e([t({type:Number})],a.prototype,"roughnessFactor",void 0),a=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialPBRMetallicRoughness")],a);let o=class extends p{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([l({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([l({none:"none",back:"back",front:"front"})],o.prototype,"cullFace",void 0),e([t({type:n})],o.prototype,"normalTexture",void 0),e([t({type:n})],o.prototype,"occlusionTexture",void 0),e([t({type:n})],o.prototype,"emissiveTexture",void 0),e([t({type:[Number]})],o.prototype,"emissiveFactor",void 0),e([t({type:a})],o.prototype,"pbrMetallicRoughness",void 0),o=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialDefinition")],o);let u=class extends p{};e([t({type:String,json:{read:{source:["name","index"],reader:(v,f)=>v??`${f.index}`}}})],u.prototype,"name",void 0),e([l({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],u.prototype,"format",void 0),u=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureFormat")],u);let c=class extends p{constructor(){super(...arguments),this.atlas=!1}};e([t({type:[u]})],c.prototype,"formats",void 0),e([t({type:Boolean})],c.prototype,"atlas",void 0),c=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureSetDefinition")],c);let s=class extends p{};e([l({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],s.prototype,"type",void 0),e([t({type:Number})],s.prototype,"component",void 0),s=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryAttribute")],s);let d=class extends p{};e([l({draco:"draco"})],d.prototype,"encoding",void 0),e([t({type:[String]})],d.prototype,"attributes",void 0),d=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryCompressedAttributes")],d);let r=class extends p{constructor(){super(...arguments),this.offset=0}};e([t({type:Number})],r.prototype,"offset",void 0),e([t({type:s})],r.prototype,"position",void 0),e([t({type:s})],r.prototype,"normal",void 0),e([t({type:s})],r.prototype,"uv0",void 0),e([t({type:s})],r.prototype,"color",void 0),e([t({type:s})],r.prototype,"uvRegion",void 0),e([t({type:s})],r.prototype,"featureId",void 0),e([t({type:s})],r.prototype,"faceRange",void 0),e([t({type:d})],r.prototype,"compressedAttributes",void 0),r=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryBuffer")],r);let m=class extends p{};e([l({triangle:"triangle"})],m.prototype,"topology",void 0),e([t()],m.prototype,"geometryBuffers",void 0),m=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryDefinition")],m);export{c as d,m,o,y}; +import{v as e,S as t,i,bz as l,e as p}from"./story-Doly9N9p.js";let y=class extends p{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};e([t({type:Number})],y.prototype,"nodesPerPage",void 0),e([t({type:Number})],y.prototype,"rootIndex",void 0),e([t({type:String})],y.prototype,"lodSelectionMetricType",void 0),y=e([i("esri.layers.support.I3SLayerDefinitions.I3SNodePageDefinition")],y);let n=class extends p{constructor(){super(...arguments),this.factor=1}};e([t({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],n.prototype,"id",void 0),e([t({type:Number})],n.prototype,"factor",void 0),n=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialTexture")],n);let a=class extends p{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]})],a.prototype,"baseColorFactor",void 0),e([t({type:n})],a.prototype,"baseColorTexture",void 0),e([t({type:n})],a.prototype,"metallicRoughnessTexture",void 0),e([t({type:Number})],a.prototype,"metallicFactor",void 0),e([t({type:Number})],a.prototype,"roughnessFactor",void 0),a=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialPBRMetallicRoughness")],a);let o=class extends p{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([l({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([l({none:"none",back:"back",front:"front"})],o.prototype,"cullFace",void 0),e([t({type:n})],o.prototype,"normalTexture",void 0),e([t({type:n})],o.prototype,"occlusionTexture",void 0),e([t({type:n})],o.prototype,"emissiveTexture",void 0),e([t({type:[Number]})],o.prototype,"emissiveFactor",void 0),e([t({type:a})],o.prototype,"pbrMetallicRoughness",void 0),o=e([i("esri.layers.support.I3SLayerDefinitions.I3SMaterialDefinition")],o);let u=class extends p{};e([t({type:String,json:{read:{source:["name","index"],reader:(v,f)=>v??`${f.index}`}}})],u.prototype,"name",void 0),e([l({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],u.prototype,"format",void 0),u=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureFormat")],u);let c=class extends p{constructor(){super(...arguments),this.atlas=!1}};e([t({type:[u]})],c.prototype,"formats",void 0),e([t({type:Boolean})],c.prototype,"atlas",void 0),c=e([i("esri.layers.support.I3SLayerDefinitions.I3STextureSetDefinition")],c);let s=class extends p{};e([l({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],s.prototype,"type",void 0),e([t({type:Number})],s.prototype,"component",void 0),s=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryAttribute")],s);let d=class extends p{};e([l({draco:"draco"})],d.prototype,"encoding",void 0),e([t({type:[String]})],d.prototype,"attributes",void 0),d=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryCompressedAttributes")],d);let r=class extends p{constructor(){super(...arguments),this.offset=0}};e([t({type:Number})],r.prototype,"offset",void 0),e([t({type:s})],r.prototype,"position",void 0),e([t({type:s})],r.prototype,"normal",void 0),e([t({type:s})],r.prototype,"uv0",void 0),e([t({type:s})],r.prototype,"color",void 0),e([t({type:s})],r.prototype,"uvRegion",void 0),e([t({type:s})],r.prototype,"featureId",void 0),e([t({type:s})],r.prototype,"faceRange",void 0),e([t({type:d})],r.prototype,"compressedAttributes",void 0),r=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryBuffer")],r);let m=class extends p{};e([l({triangle:"triangle"})],m.prototype,"topology",void 0),e([t()],m.prototype,"geometryBuffers",void 0),m=e([i("esri.layers.support.I3SLayerDefinitions.I3SGeometryDefinition")],m);export{c as d,m,o,y}; diff --git a/custom-toc-highlight/assets/I3SUtil-Bq8KpP2j-BW-Cczln.js b/custom-toc-highlight/assets/I3SUtil-Bq8KpP2j--Kmryq4i.js similarity index 70% rename from custom-toc-highlight/assets/I3SUtil-Bq8KpP2j-BW-Cczln.js rename to custom-toc-highlight/assets/I3SUtil-Bq8KpP2j--Kmryq4i.js index b1d759b8..1eb2c83e 100644 --- a/custom-toc-highlight/assets/I3SUtil-Bq8KpP2j-BW-Cczln.js +++ b/custom-toc-highlight/assets/I3SUtil-Bq8KpP2j--Kmryq4i.js @@ -1 +1 @@ -import{bh as s,f as C,ia as y,ib as A}from"./story-BfX8CRfG.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./projectVectorToVector-sIYLNlex-B_PqSyiH.js";import"./sphere-BenPORjV-DaZ5Vv8x.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import{G as d}from"./I3SBinaryReader-DEbI3cKZ-Bdob26G6.js";import{e as h}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{i as g}from"./orientedBoundingBox-oHezdpWm-BCiifXla.js";var o;(function(t){t[t.TRANSPARENT=0]="TRANSPARENT",t[t.OPAQUE=1]="OPAQUE"})(o||(o={}));var u;(function(t){t[t.Uniform=0]="Uniform",t[t.Varying=1]="Varying",t[t.COUNT=2]="COUNT"})(u||(u={}));var f,S;(function(t){t[t.Solid=0]="Solid",t[t.Sketch=1]="Sketch",t[t.Mixed=2]="Mixed",t[t.COUNT=3]="COUNT"})(f||(f={})),function(t){t[t.REGULAR=0]="REGULAR",t[t.SILHOUETTE=1]="SILHOUETTE"}(S||(S={}));function D(t){return{...P,...t,type:f.Solid}}const P={color:h(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:o.OPAQUE,hasSlicePlane:!1};o.OPAQUE,s();var m;async function K(t,a,n,p,I,N,U,R){const E=[];for(const r of a)if(r&&I.includes(r.name)){const i=`${t}/nodes/${n}/attributes/${r.key}/0`;E.push({url:i,storageInfo:r})}const c=await Promise.allSettled(E.map(r=>C(r.url,{responseType:"array-buffer",query:{...U,token:N},signal:R?.signal}).then(i=>d(r.storageInfo,i.data)))),T=[];for(const r of p){const i={};for(let e=0;eC(r.url,{responseType:"array-buffer",query:{...U,token:N},signal:R?.signal}).then(i=>d(r.storageInfo,i.data)))),T=[];for(const r of p){const i={};for(let e=0;ei.map(i=>d[i]); -import{_ as C}from"./main-ugzBrWNm.js";import{v as u,S as _,i as z,I as ne,M as ae,z as ue,e as he,a as $,b as E,E as D,o as A,x as pe,s as R,c as b,f as P,u as j,T as H,L as F,X as ee,H as _e,Z as te,C as J,k as fe,A as ge,N,Y as se,y as me,V}from"./story-BfX8CRfG.js";import{_ as re,R as ve,k as we,P as O,x as Se,X as Ie}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{b as ye}from"./substitute-j49H6mVR-CJn4Lavp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const W="esri-identity-modal",G={base:W,info:`${W}__info`,notice:`${W}__notice`},ke="ArcGIS Online";let T=class extends ve{constructor(d,e){super(d,e),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return we({button:()=>C(()=>import("./calcite-button-Cm9_TJei-By40tgvH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),dialog:()=>C(()=>import("./calcite-dialog-DAngwHC1-BqNAvWKZ.js"),__vite__mapDeps([20,1,2,3,4,5,6,8,21,19,14,12,22,9,13,15,11,16,17,18,23,24,25,26,27,28]),import.meta.url),input:()=>C(()=>import("./calcite-input-BKRd7MCS-DN64wHsO.js"),__vite__mapDeps([29,30,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url),label:()=>C(()=>import("./calcite-label-DMj3M4QR-C-hEqjQX.js"),__vite__mapDeps([31,1,2,3,4,5,6,10,8,11]),import.meta.url),notice:()=>C(()=>import("./calcite-notice-DeAGopAs-Cd7Uc4RY.js"),__vite__mapDeps([32,1,2,3,4,5,6,33,15,8,12,13,14,16,25,11,17]),import.meta.url)})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:d,title:e,messages:s,signingIn:t,oAuthPrompt:r,server:i,resource:n,error:h}=this,{info:p,oAuthInfo:o,lblItem:l,invalidUser:c,noAuthService:a,lblUser:f,lblPwd:g,lblCancel:v,lblSigning:w,lblOk:k}=s;return O("div",{class:this.classes(G.base,Se())},O("form",{bind:this,onsubmit:this._submit},O("calcite-dialog",{bind:this,heading:e,modal:!0,open:d,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},O("div",{class:G.info},ye(r?o:p,{server:i&&/\.arcgis\.com/i.test(i)?ke:i,resource:`(${n||l})`})),h?O("calcite-notice",{class:G.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},O("div",{slot:"message"},h.details?.httpStatus?c:a)):null,r?null:[O("calcite-label",null,f,O("calcite-input",{afterCreate:m=>this._usernameInputNode=m,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),O("calcite-label",null,g,O("calcite-input",{afterCreate:m=>this._passwordInputNode=m,bind:this,name:"password",required:!0,type:"password",value:""}))],O("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},v),O("calcite-button",{loading:!!t,slot:"footer-end",type:"submit"},t?w:k))))}_focusUsernameInput(){return Ie(()=>this._usernameInputNode)}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(d){d.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",e)}};u([_({readOnly:!0})],T.prototype,"container",void 0),u([_(),re("esri/t9n/common")],T.prototype,"commonMessages",void 0),u([_()],T.prototype,"error",void 0),u([_(),re("esri/identity/t9n/identity")],T.prototype,"messages",void 0),u([_()],T.prototype,"oAuthPrompt",void 0),u([_()],T.prototype,"open",void 0),u([_()],T.prototype,"signingIn",void 0),u([_()],T.prototype,"server",void 0),u([_({readOnly:!0})],T.prototype,"title",null),u([_()],T.prototype,"resource",void 0),T=u([z("esri.identity.IdentityModal")],T);const ie=T,X="esriJSAPIOAuth";class K{constructor(e,s){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=s,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const s=Date.now();this.expires>s&&(this.expires-s)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t||(t=e[s.authNamespace]={}),this.appId||(this.appId=s.appId),t[s.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(X,JSON.stringify(e))}catch(r){return console.warn(r),!1}return!0}return!1}destroy(){const e=this._load(),s=this.oAuthInfo;if(s?.appId&&s?.portalUrl&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const t=s.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",s.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(t,r);else{const i=new XMLHttpRequest;i.open("POST",t),i.send(r)}}if(s?.authNamespace&&s.portalUrl&&this.storage){const t=e[s.authNamespace];if(t){delete t[s.portalUrl];try{this.storage.setItem(X,JSON.stringify(e))}catch(r){console.log(r)}}}s&&(s._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t&&(t=t[s.portalUrl],t&&(this.appId=t.appId,this.codeVerifier=t.codeVerifier,this.expires=t.expires,this.refreshToken=t.refreshToken,this.ssl=t.ssl,this.stateUID=t.stateUID,this.token=t.token,this.userId=t.userId))}}_load(){let e={};if(this.storage){const s=this.storage.getItem(X);if(s)try{e=JSON.parse(s)}catch(t){console.warn(t)}}return e}}K.prototype.declaredClass="esri.identity.OAuthCredential";var Q;let U=Q=class extends he{constructor(d){super(d),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Q.fromJSON(this.toJSON())}};u([_({json:{write:!0}})],U.prototype,"appId",void 0),u([_({json:{write:!0}})],U.prototype,"authNamespace",void 0),u([_({json:{write:!0}})],U.prototype,"expiration",void 0),u([_({json:{write:!0}})],U.prototype,"flowType",void 0),u([_({json:{write:!0}})],U.prototype,"forceLogin",void 0),u([_({json:{write:!0}})],U.prototype,"forceUserId",void 0),u([_({json:{write:!0}})],U.prototype,"locale",void 0),u([_({json:{write:!0}})],U.prototype,"minTimeUntilExpiration",void 0),u([_({json:{write:!0}})],U.prototype,"popup",void 0),u([_({json:{write:!0}})],U.prototype,"popupCallbackUrl",void 0),u([_({json:{write:!0}})],U.prototype,"popupWindowFeatures",void 0),u([_({json:{write:!0}})],U.prototype,"portalUrl",void 0),u([_({json:{write:!0}})],U.prototype,"preserveUrlHash",void 0),u([_({json:{write:!0}})],U.prototype,"userId",void 0),U=Q=u([z("esri.identity.OAuthInfo")],U);const oe=U;let x=class extends he{constructor(d){super(d),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};u([_({json:{write:!0}})],x.prototype,"adminTokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"currentVersion",void 0),u([_({json:{write:!0}})],x.prototype,"hasPortal",void 0),u([_({json:{write:!0}})],x.prototype,"hasServer",void 0),u([_({json:{write:!0}})],x.prototype,"owningSystemUrl",void 0),u([_({json:{write:!0}})],x.prototype,"owningTenant",void 0),u([_({json:{write:!0}})],x.prototype,"server",void 0),u([_({json:{write:!0}})],x.prototype,"shortLivedTokenValidity",void 0),u([_({json:{write:!0}})],x.prototype,"tokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"webTierAuth",void 0),x=u([z("esri.identity.ServerInfo")],x);const Y=x,L={},le=d=>{const e=new b(d.owningSystemUrl).host,s=new b(d.server).host,t=/.+\.arcgis\.com$/i;return t.test(e)&&t.test(s)},Z=(d,e)=>!!(le(d)&&e&&e.some(s=>s.test(d.server)));let M=null,B=null;try{M=window.localStorage,B=window.sessionStorage}catch{}class ce extends ne{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=$(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const s=this.serverInfos;s?(e=e.filter(t=>!this.findServerInfo(t.server)),this.serverInfos=s.concat(e)):this.serverInfos=e,e.forEach(t=>{t.owningSystemUrl&&this._portals.push(t.owningSystemUrl),t.hasPortal&&this._portals.push(t.server)})}registerOAuthInfos(e){const s=this.oAuthInfos;if(s){for(const t of e){const r=this.findOAuthInfo(t.portalUrl);r&&s.splice(s.indexOf(r),1)}this.oAuthInfos=s.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const s=this._sanitizeUrl(e.server),t=this._isServerRsrc(s);let r,i=this.findServerInfo(s),n=!0;i||(i=new Y,i.server=this._getServerInstanceRoot(s),t?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(s),i.hasPortal=!0),this.registerServers([i])),r=this._findCredential(s),r?(delete e.server,Object.assign(r,e),n=!1):(r=new I({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:t?"server":"portal"}),r.resources=[s],this.credentials.push(r)),r.emitTokenChange(!1),n||r.refreshServerTokens()}toJSON(){return ae({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const s=e.serverInfos,t=e.oAuthInfos,r=e.credentials;if(s){const i=[];s.forEach(n=>{n.server&&n.tokenServiceUrl&&i.push(n.declaredClass?n:new Y(n))}),i.length&&this.registerServers(i)}if(t){const i=[];t.forEach(n=>{n.appId&&i.push(n.declaredClass?n:new oe(n))}),i.length&&this.registerOAuthInfos(i)}r&&r.forEach(i=>{i.server&&i.token&&i.expires&&i.expires>Date.now()&&((i=i.declaredClass?i:new I(i)).emitTokenChange(),this.credentials.push(i))})}findServerInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.serverInfos)if(this._hasSameServerInstance(t.server,e)){s=t;break}return s}findOAuthInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.oAuthInfos)if(this._hasSameServerInstance(t.portalUrl,e)){s=t;break}return s}findCredential(e,s){if(!e)return;let t;e=this._sanitizeUrl(e);const r=this._isServerRsrc(e)?"server":"portal";if(s){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&s===i.userId&&i.scope===r){t=i;break}}else for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&this._getIdenticalSvcIdx(e,i)!==-1&&i.scope===r){t=i;break}return t}getCredential(e,s){let t,r,i=!0;s&&(t=!!s.token,r=s.error,i=s.prompt!==!1),s={...s},e=this._sanitizeUrl(e);const n=new AbortController,h=E();if(s.signal&&D(s.signal,()=>{n.abort()}),D(n,()=>{h.reject(new A("identity-manager:user-aborted","ABORTED"))}),pe(n))return h.promise;s.signal=n.signal;const p=this._isAdminResource(e),o=t?this.findCredential(e):null;let l;if(o&&r&&r.details&&r.details.httpStatus===498)o.destroy();else if(o)return l=new A("identity-manager:not-authorized","You are currently signed in as: '"+o.userId+"'. You do not have access to this resource: "+e,{error:r}),h.reject(l),h.promise;const c=this._findCredential(e,s);if(c)return h.resolve(c),h.promise;let a=this.findServerInfo(e);if(a)!a.hasPortal&&a.server&&a.owningSystemUrl&&this._hasSameServerInstance(a.server,a.owningSystemUrl)&&(a.hasPortal=!0),!a.hasServer&&this._isServerRsrc(e)&&(a._restInfoPms=this._getTokenSvcUrl(e),a.hasServer=!0);else{const f=this._getTokenSvcUrl(e);if(!f)return l=new A("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),h.reject(l),h.promise;a=new Y,a.server=this._getServerInstanceRoot(e),typeof f=="string"?(a.tokenServiceUrl=f,a.hasPortal=!0):(a._restInfoPms=f,a.hasServer=!0),this.registerServers([a])}return a.hasPortal&&a._selfReq===void 0&&(i||R(a.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(f=>f.tokenServiceUrl===a.tokenServiceUrl))&&(a._selfReq={owningTenant:s?.owningTenant,selfDfd:this._getPortalSelf(a.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,a,s,h,p)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,s,t){const r=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new b(this._appOrigin),n=e.shortLivedTokenValidity;let h,p,o,l,c,a,f,g;s&&(g=this.tokenValidity||n||this._defaultTokenValidity,g>n&&n>0&&(g=n)),t&&(h=t.isAdmin,p=t.serverUrl,o=t.token,a=t.signal,f=t.ssl,e.customParameters=t.customParameters),h?l=e.adminTokenServiceUrl:(l=e.tokenServiceUrl,c=new b(l.toLowerCase()),e.webTierAuth&&t?.serverUrl&&!f&&i.scheme==="http"&&(R(i.uri,l,!0)||c.scheme==="https"&&i.host===c.host&&i.port==="7080"&&c.port==="7443")&&(l=l.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:s?.username,password:s?.password,serverUrl:p,token:o,expiration:g,referer:h||r?this._appOrigin:null,client:h?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,t),signal:a,...t?.ioArgs};return r||(v.withCredentials=!1),P(l,v).then(w=>{const k=w.data;if(!k?.token)return new A("identity-manager:authentication-failed","Unable to generate token");const m=e.server;return L[m]||(L[m]={}),s&&(L[m][s.username]=s.password),k.validity=g,k})}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,s,t){let r=!1;return this.getCredential(e,{prompt:!1}).then(i=>{let n;const h={f:"json"};if(i.scope==="portal")if(s&&(this._doPortalSignIn(e)||t?.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",h.client_id=s;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(h.token=i.token),P(n,{query:h,authMode:"anonymous"}).then(p=>{if(p.data.valid===!1)throw new A("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,p.data);return r=!!p.data.viewOnlyUserTypeApp,{credential:i}}).catch(p=>{if(p.name==="identity-manager:not-authorized")throw p;const o=p.details?.httpStatus;if(o===498)throw i.destroy(),new A("identity-manager:not-authenticated","User is not signed in.");if(o===400)throw new A("identity-manager:invalid-request");return{credential:i}})}).then(i=>({credential:i.credential,viewOnly:r}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,s,t={}){const r=E(),i=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=p=o=null},n=()=>{i(),this._oAuthDfd=null,r.reject(new A("identity-manager:user-aborted","ABORTED"))};t.signal&&D(t.signal,()=>{n()});const h=new ie({open:!0,resource:this.getResourceName(e),server:s.server});this.dialog=h,this.emit("dialog-create");let p=h.on("cancel",n),o=h.on("submit",l=>{this.generateToken(s,l,{isAdmin:t.isAdmin,signal:t.signal}).then(c=>{i();const a=new I({userId:l.username,server:s.server??void 0,token:c.token,expires:c.expires!=null?Number(c.expires):null,ssl:!!c.ssl,isAdmin:t.isAdmin,validity:c.validity});r.resolve(a)}).catch(c=>{h.error=c,h.signingIn=!1})});return r.promise}oAuthSignIn(e,s,t,r){this._oAuthDfd=E();const i=this._oAuthDfd;let n;r?.signal&&D(r.signal,()=>{const a=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;a&&!a.closed?a.close():this.dialog&&l()}),i.resUrl_=e,i.sinfo_=s,i.oinfo_=t;const h=t._oAuthCred;if(h.storage&&(t.flowType==="authorization-code"||t.flowType==="auto"&&s.currentVersion>=8.4)){let a=crypto.getRandomValues(new Uint8Array(32));n=H(a),h.codeVerifier=n,a=crypto.getRandomValues(new Uint8Array(32)),h.stateUID=H(a),h.save()||(h.codeVerifier=n=null)}else h.codeVerifier=null;let p,o;this._getCodeChallenge(n).then(a=>{const f=!r||r.oAuthPopupConfirmation!==!1;if(!t.popup||!f)return void this._doOAuthSignIn(e,s,t,a);const g=new ie({oAuthPrompt:!0,server:s.server,open:!0});this.dialog=g,this.emit("dialog-create"),p=g.on("cancel",l),o=g.on("submit",()=>{c(),this._doOAuthSignIn(e,s,t,a)})});const l=()=>{c(),this._oAuthDfd=null,i.reject(new A("identity-manager:user-aborted","ABORTED"))},c=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=F(window,"message",s=>{if((s.origin===this._appOrigin||s.origin.endsWith(".arcgis.com"))&&s.data?.type==="arcgis:auth:requestCredential"){const t=s.source;this.getCredential(e).then(r=>{t.postMessage({type:"arcgis:auth:credential",credential:{expires:r.expires,server:r.server,ssl:r.ssl,token:r.token,userId:r.userId}},s.origin)}).catch(r=>{t.postMessage({type:"arcgis:auth:error",error:{name:r.name,message:r.message}},s.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.slice(1));const t=j(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let s=window.location.search;if(s){s.charAt(0)==="?"&&(s=s.slice(1));const t=j(s);let r=!1;if(t.code&&t.state)try{t.state=JSON.parse(t.state),t.state.portalUrl&&t.state.uid&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}if(r){const i={...t};["code","error","error_description","message_code","persist","state"].forEach(p=>{delete i[p]});const n=ee(i),h=window.location.pathname+(n?`?${n}`:"")+(t.state?.hash||"");window.history.replaceState(window.history.state,"",h)}}}_getOAuthToken(e,s,t,r,i){return e=e.replace(/^http:/i,"https:"),P(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:r&&i?{grant_type:"authorization_code",code:s,redirect_uri:r,client_id:t,code_verifier:i}:{grant_type:"refresh_token",refresh_token:s,client_id:t}}).then(n=>n.data)}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const s=new TextEncoder().encode(e),t=await crypto.subtle.digest("SHA-256",s);return H(new Uint8Array(t))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const s=new A("identity-manager:user-aborted","ABORTED");this._errbackFunc(s)}}_findCredential(e,s){let t,r,i,n,h=-1;const p=s?.token,o=s?.resource,l=this._isServerRsrc(e)?"server":"portal",c=this.credentials.filter(a=>this._hasSameServerInstance(a.server,e)&&a.scope===l);if(e=o||e,c.length)if(c.length===1){if(t=c[0],i=this.findServerInfo(t.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,t.userId):void 0,h=this._getIdenticalSvcIdx(e,t),!p)return h===-1&&t.resources.push(e),this._addResource(e,n),t;h!==-1&&(t.resources.splice(h,1),this._removeResource(e,n))}else{let a,f;if(c.some(g=>(f=this._getIdenticalSvcIdx(e,g),f!==-1&&(a=g,i=this.findServerInfo(a.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,a.userId):void 0,h=f,!0))),p)a&&(a.resources.splice(h,1),this._removeResource(e,n));else if(a)return this._addResource(e,n),a}}_findOAuthInfo(e){let s=this.findOAuthInfo(e);if(!s){for(const t of this.oAuthInfos)if(this._isIdProvider(t.portalUrl,e)){s=t;break}}return s}_addResource(e,s){s&&this._getIdenticalSvcIdx(e,s)===-1&&s.resources.push(e)}_removeResource(e,s){let t=-1;s&&(t=this._getIdenticalSvcIdx(e,s),t>-1&&s.resources.splice(t,1))}_useProxy(e,s){return s?.isAdmin&&!R(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!R(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const s=new b(e);return s.scheme+"://"+s.host+(s.port!=null?":"+s.port:"")}_getServerInstanceRoot(e){const s=e.toLowerCase();let t=s.indexOf(this._agsRest);return t===-1&&this._isAdminResource(e)&&(t=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),t!==-1||_e(s)||(t=s.indexOf("/sharing")),t===-1&&s.endsWith("/")&&(t=s.length-1),t>-1?e.slice(0,t):e}_hasSameServerInstance(e,s){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),s=this._getServerInstanceRoot(s).toLowerCase(),e=te(e),s=te(s),(e=e.slice(Math.max(0,e.indexOf(":"))))===(s=s.slice(Math.max(0,s.indexOf(":"))))}_sanitizeUrl(e){const s=(J.request.proxyUrl||"").toLowerCase(),t=s?e.toLowerCase().indexOf(s+"?"):-1;return t!==-1&&(e=e.slice(t+s.length+1)),e=fe(e),$(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,s){let t=!1;if(this._isRESTService(e)&&this._isRESTService(s)){const r=this._getSuffix(e).toLowerCase(),i=this._getSuffix(s).toLowerCase();if(t=r===i,!t){const n=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;t=r.replaceAll(n,"$1")===i.replaceAll(n,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(s)?t=!0:this._isServerRsrc(e)||this._isServerRsrc(s)||!this._isPortalDomain(e)||(t=!0);return t}_isPortalDomain(e){const s=new b(e.toLowerCase()),t=this._portalConfig;let r=this._gwDomains.some(i=>i.regex.test(s.uri));return!r&&t&&(r=this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),s.uri)),r||J.portalUrl&&(r=R(s,J.portalUrl,!0)),r||(r=this._portals.some(i=>this._hasSameServerInstance(i,s.uri))),r=r||this._agsPortal.test(s.path),r}_isIdProvider(e,s){let t=-1,r=-1;this._gwDomains.forEach((n,h)=>{t===-1&&n.regex.test(e)&&(t=h),r===-1&&n.regex.test(s)&&(r=h)});let i=!1;if(t>-1&&r>-1&&(t===0||t===4?r!==0&&r!==4||(i=!0):t===1?r!==1&&r!==2||(i=!0):t===2?r===2&&(i=!0):t===3&&r===3&&(i=!0)),!i){const n=this.findServerInfo(s),h=n?.owningSystemUrl;h&&le(n)&&this._isPortalDomain(h)&&this._isIdProvider(e,h)&&(i=!0)}return i}_getIdenticalSvcIdx(e,s){let t=-1;for(let r=0;rn.data),{adminUrl:s,promise:t}}if(this._isPortalDomain(e)){let i="";if(this._gwDomains.some(n=>(n.regex.test(e)&&(i=n.tokenServiceUrl),!!i)),i||this._portals.some(n=>(this._hasSameServerInstance(n,e)&&(i=n+this._gwTokenUrl),!!i)),i||(r=e.toLowerCase().indexOf("/sharing"),r!==-1&&(i=e.slice(0,r)+this._gwTokenUrl)),i||(i=this._getOrigin(e)+this._gwTokenUrl),i){const n=new b(e).port;/^http:\/\//i.test(e)&&n==="7080"&&(i=i.replace(/:7080/i,":7443")),i=i.replace(/http:/i,"https:")}return i}}_processOAuthResponseParams(e,s,t){const r=s._oAuthCred;if(e.code){const n=r.codeVerifier;return r.codeVerifier=null,r.stateUID=null,r.save(),this._getOAuthToken(t.server,e.code,s.appId,this._getRedirectURI(s,!0),n).then(h=>{const p=new I({userId:h.username,server:t.server??void 0,token:h.access_token,expires:Date.now()+1e3*h.expires_in,ssl:h.ssl,oAuthState:e.state,_oAuthCred:r});return s.userId=p.userId,r.storage=h.persist?M:B,r.refreshToken=h.refresh_token,r.token=null,r.expires=h.refresh_token_expires_in?Date.now()+1e3*h.refresh_token_expires_in:null,r.userId=p.userId,r.ssl=p.ssl,r.save(),p})}const i=new I({userId:e.username,server:t.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:r});return s.userId=i.userId,r.storage=e.persist?M:B,r.refreshToken=null,r.token=i.token,r.expires=i.expires,r.userId=i.userId,r.ssl=i.ssl,r.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const s=this._oAuthDfd;if(this._oAuthDfd=null,s)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const t=e.error==="access_denied",r=new A(t?"identity-manager:user-aborted":"identity-manager:authentication-failed",t?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);s.reject(r)}else this._processOAuthResponseParams(e,s.oinfo_,s.sinfo_).then(t=>{s.resolve(t)}).catch(t=>{s.reject(t)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}async _exchangeToken(e,s,t){return(await P(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:s,token:t}})).data.token}async _getPlatformSelf(e,s){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const t=await P(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":s,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,t.data}catch(t){throw t.details?.messageCode==="OAUTH_0066"&&(this._getPlatformSelfError=[t,Date.now()]),t}}_getPortalSelf(e,s){let t;return this._gwDomains.some(r=>(r.regex.test(e)&&(t=r.customBaseUrl),!!t)),t?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:t,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(s)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),P(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(r=>r.data))}_doPortalSignIn(e){const s=this._portalConfig,t=window.location.href,r=this.findServerInfo(e);return!(!s&&!this._isPortalDomain(t)||!(r?r.hasPortal||r.owningSystemUrl&&this._isPortalDomain(r.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(t,e)||s&&(this._hasSameServerInstance(this._getServerInstanceRoot(s.restBaseUrl),e)||this._isIdProvider(s.restBaseUrl,e))||R(t,e,!0)))}_checkProtocol(e,s,t,r){let i=!0;const n=r?s.adminTokenServiceUrl:s.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&ge(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:s}),!i)&&t(new A("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,s,t,r,i,n){return r||(r=E()),r.resUrl_=e,r.sinfo_=s,r.options_=t,r.admin_=i,r.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(r)):this._xoReqs.push(r):this._doSignIn(r),r.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const s=o=>{const l=e.options_?.resource,c=e.resUrl_,a=e.refresh_;let f=!1;this.credentials.includes(o)||(a&&this.credentials.includes(a)?(a.userId=o.userId,a.token=o.token,a.expires=o.expires,a.validity=o.validity,a.ssl=o.ssl,a.creationTime=o.creationTime,f=!0,o=a):this.credentials.push(o)),o.resources||(o.resources=[]),o.resources.includes(l||c)||o.resources.push(l||c),o.scope=this._isServerRsrc(c)?"server":"portal",o.emitTokenChange();const g=this._soReqs,v={};this._soReqs=[],g.forEach(w=>{if(!this._isIdenticalService(c,w.resUrl_)){const k=this._getSuffix(w.resUrl_);v[k]||(v[k]=!0,o.resources.push(w.resUrl_))}}),e.resolve(o),g.forEach(w=>{this._hasSameServerInstance(this._getServerInstanceRoot(c),w.resUrl_)?w.resolve(o):this._soReqs.push(w)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,f||this.emit("credential-create",{credential:o}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},t=o=>{e.reject(o),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=(o,l,c,a)=>{const f=e.sinfo_,g=!e.options_||e.options_.prompt!==!1,v=f.hasPortal&&this._findOAuthInfo(e.resUrl_);let w,k;if(o)s(new I({userId:o,server:f.server??void 0,token:c??void 0,expires:a!=null?Number(a):null,ssl:!!l}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const m=F(window,"message",y=>{y.source===window.parent&&y.data&&(y.data.type==="arcgis:auth:credential"?(m.remove(),y.data.credential.expires{m.remove()})}else if(v){let m=v._oAuthCred;if(!m){const y=new K(v,M),S=new K(v,B);y.isValid()&&S.isValid()?y.expires>S.expires?(m=y,S.destroy()):(m=S,y.destroy()):m=y.isValid()?y:S,v._oAuthCred=m}if(m.isValid()){w=new I({userId:m.userId??void 0,server:f.server??void 0,token:m.token??void 0,expires:m.expires,ssl:m.ssl??void 0,_oAuthCred:m});const y=v.appId!==m.appId&&this._doPortalSignIn(e.resUrl_);y||m.refreshToken?(e._pendingDfd=m.refreshToken?this._getOAuthToken(f.server,m.refreshToken,m.appId).then(S=>(w.expires=Date.now()+1e3*S.expires_in,w.token=S.access_token,w)):Promise.resolve(w),e._pendingDfd.then(S=>y?this._exchangeToken(S.server,v.appId,S.token).then(q=>(S.token=q,S)).catch(()=>S):S).then(S=>{s(S)}).catch(S=>{const q=S.details?.httpStatus;q>0&&q!==404?(m.destroy(),r()):t(S)})):s(w)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(v.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===m.stateUID&&m.codeVerifier)){const y=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(y,v,f).then(S=>{s(S)}).catch(t)}else{const y=()=>{g?e._pendingDfd=this.oAuthSignIn(e.resUrl_,f,v,e.options_).then(s,t):(k=new A("identity-manager:not-authenticated","User is not signed in."),t(k))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(f.server,v.appId).then(S=>{R(S.portalUrl,this._appOrigin,!0)?(w=new I({userId:S.username,server:f.server??void 0,expires:Date.now()+1e3*S.expires_in,token:S.token}),s(w)):y()}).catch(y):y()}}else if(g){if(this._checkProtocol(e.resUrl_,f,t,e.admin_)){let m=e.options_;e.admin_&&(m=m||{},m.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,f,m).then(s,t)}}else k=new A("identity-manager:not-authenticated","User is not signed in."),t(k)},i=()=>{const o=e.sinfo_,l=o.owningSystemUrl,c=e.options_;let a,f,g,v;if(c&&(a=c.token,f=c.error,g=c.prompt),v=this._findCredential(l,{token:a,resource:e.resUrl_}),!v){for(const w of this.credentials)if(this._isIdProvider(l,w.server)){v=w;break}}if(v){const w=this.findCredential(e.resUrl_,v.userId);if(w)s(w);else if(Z(o,this._legacyFed)){const k=v.toJSON();k.server=o.server,k.resources=null,s(new I(k))}else(e._pendingDfd=this.generateToken(this.findServerInfo(v.server),null,{serverUrl:e.resUrl_,token:v.token,signal:e.options_.signal,ssl:v.ssl})).then(k=>{s(new I({userId:v?.userId,server:o.server??void 0,token:k.token,expires:k.expires!=null?Number(k.expires):null,ssl:!!k.ssl,isAdmin:e.admin_,validity:k.validity}))},t)}else this._busy=null,a&&(e.options_.token=null),(e._pendingDfd=this.getCredential(l.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:o.owningTenant,signal:e.options_.signal,token:a,error:f,prompt:g})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},w=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(w)})};this._errbackFunc=t;const n=e.sinfo_.owningSystemUrl,h=this._isServerRsrc(e.resUrl_),p=e.sinfo_._restInfoPms;p?p.promise.then(o=>{const l=e.sinfo_;if(l._restInfoPms){l.adminTokenServiceUrl=l._restInfoPms.adminUrl,l._restInfoPms=null,l.tokenServiceUrl=(N("authInfo.tokenServicesUrl",o)||N("authInfo.tokenServiceUrl",o)||N("tokenServiceUrl",o))??null,l.shortLivedTokenValidity=N("authInfo.shortLivedTokenValidity",o)??null,l.currentVersion=o.currentVersion,l.owningTenant=o.owningTenant;const c=l.owningSystemUrl=o.owningSystemUrl;c&&this._portals.push(c)}h&&l.owningSystemUrl?i():r()},()=>{e.sinfo_._restInfoPms=null;const o=new A("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");t(o)}):h&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(o=>{const l={};let c,a,f,g;return o&&(c=o.user?.username,l.username=c,l.allSSL=o.allSSL,a=o.supportsOAuth,g=parseFloat(o.currentVersion),o.portalMode==="multitenant"&&(f=o.customBaseUrl),e.sinfo_.currentVersion=g),e.sinfo_.webTierAuth=!!c,c&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:l.allSSL}).catch(()=>null).then(v=>(l.portalToken=v?.token,l.tokenExpiration=v?.expires,l)):!c&&a&&g>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:f,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>l):l}).catch(()=>null).then(o=>{e.sinfo_._selfReq=null,o?r(o.username,o.allSSL,o.portalToken,o.tokenExpiration):r()}):r()}_generateOAuthInfo(e){let s,t=null,r=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,h=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(h){t=window.location.href;let p=t.indexOf("?");p>-1&&(t=t.slice(0,p)),p=t.search(/\/(apps|home)\//),t=p>-1?t.slice(0,p):null}return h&&t?(this._hasTestedIfAppIsOnPortal=!0,s=P(t+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new oe({appId:"arcgisonline",popupCallbackUrl:t+"/home/oauth-callback.html"})})):s=Promise.resolve(),s.then(()=>{if(this._defaultOAuthInfo)return r=r.replace(/^http:/i,"https:"),P(r+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:se(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(p=>{if(p.data.valid){const o=this._defaultOAuthInfo.clone();p.data.urlKey&&i?o.portalUrl="https://"+p.data.urlKey.toLowerCase()+"."+i:o.portalUrl=r,o.popup=window!==window.top||!(R(r,this._appOrigin)||this._gwDomains.some(l=>l.regex.test(r)&&l.regex.test(this._appOrigin))),this.oAuthInfos.push(o)}})})}_doOAuthSignIn(e,s,t,r){const i=t._oAuthCred,n={portalUrl:t.portalUrl};!t.popup&&t.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const h={client_id:t.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:t.expiration,locale:t.locale,redirect_uri:this._getRedirectURI(t,!!i.codeVerifier)};t.forceLogin&&(h.force_login=!0),t.forceUserId&&t.userId&&(h.prepopulatedusername=t.userId),!t.popup&&this._doPortalSignIn(e)&&(h.redirectToUserOrgUrl=!0),i.codeVerifier&&(h.code_challenge=r||i.codeVerifier,h.code_challenge_method=r?"S256":"plain");const p=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",o=p+"?"+ee(h);if(t.popup){const l=window.open(o,"esriJSAPIOAuth",t.popupWindowFeatures);if(l)l.focus(),this._oAuthDfd.oAuthWin_=l,this._oAuthIntervalId=setInterval(()=>{if(l.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const c=this._oAuthDfd;if(c){const a=new A("identity-manager:user-aborted","ABORTED");c.reject(a)}}},500),this._oAuthOnPopupHandle=F(window,["arcgis:auth:hash","arcgis:auth:location:search"],c=>{c.type==="arcgis:auth:hash"?this.setOAuthResponseHash(c.detail):this._setOAuthResponseQueryString(c.detail)});else{const c=new A("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(c)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:h,authorizeUrl:p,resourceUrl:e,serverInfo:s,oAuthInfo:t}):window.location.href=o}_getRedirectURI(e,s){const t=window.location.href.replace(/#.*$/,"");if(e.popup)return se(e.popupCallbackUrl);if(s){const r=$(t);return r.query&&["code","error","error_description","message_code","persist","state"].forEach(i=>{delete r.query[i]}),me(r.path,r.query)}return t}}ce.prototype.declaredClass="esri.identity.IdentityManagerBase";let I=class extends ne.EventedAccessor{constructor(d){super(d),this._oAuthCred=null,this.tokenRefreshBuffer=2,d?._oAuthCred&&(this._oAuthCred=d._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const d=V,e=d.findServerInfo(this.server),s=e?.owningSystemUrl,t=!!s&&this.scope==="server",r=t&&Z(e,d._legacyFed),i=e.webTierAuth,n=i&&d.normalizeWebTierAuth,h=L[this.server],p=h?.[this.userId];let o,l=this.resources&&this.resources[0],c=t?d.findServerInfo(s):null,a={username:this.userId,password:p};if(i&&!n)return;t&&!c&&d.serverInfos.some(g=>(d._isIdProvider(s,g.server)&&(c=g),!!c));const f=c?d.findCredential(c.server,this.userId):null;if(!t||f){if(!r){if(t)o={serverUrl:l,token:f?.token,ssl:f?.ssl};else if(n)a=null,o={ssl:this.ssl};else{if(!p){let g;return l&&(l=d._sanitizeUrl(l),this._enqueued=1,g=d._enqueue(l,e,null,null,this.isAdmin,this),g.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),g}this.isAdmin&&(o={isAdmin:!0})}return d.generateToken(t?c:e,t?null:a,o).then(g=>{this.token=g.token,this.expires=g.expires!=null?Number(g.expires):null,this.creationTime=Date.now(),this.validity=g.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}f?.refreshToken()}}refreshServerTokens(){if(this.scope==="portal"){const d=V;d.credentials.forEach(e=>{const s=d.findServerInfo(e.server),t=s?.owningSystemUrl;e!==this&&e.userId===this.userId&&t&&e.scope==="server"&&(d._hasSameServerInstance(this.server,t)||d._isIdProvider(t,this.server))&&(Z(s,d._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())})}}emitTokenChange(d){clearTimeout(this._refreshTimer);const e=V,s=this.server?e.findServerInfo(this.server):null,t=s?.owningSystemUrl,r=t?e.findServerInfo(t):null;d===!1||t&&this.scope!=="portal"&&(!r?.webTierAuth||e.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const d=V,e=d.credentials.indexOf(this);e>-1&&d.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const d=ae({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),e=this.resources;return e&&e.length>0&&(d.resources=e.slice()),d}_startRefreshTimer(){clearTimeout(this._refreshTimer);const d=6e4*this.tokenRefreshBuffer,e=2**31-1;let s=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();s<0?s=0:s>e&&(s=e),this._refreshTimer=setTimeout(this.refreshToken.bind(this),s>d?s-d:s)}};u([_()],I.prototype,"creationTime",void 0),u([_()],I.prototype,"expires",void 0),u([_()],I.prototype,"isAdmin",void 0),u([_()],I.prototype,"oAuthState",void 0),u([_()],I.prototype,"resources",void 0),u([_()],I.prototype,"scope",void 0),u([_()],I.prototype,"server",void 0),u([_()],I.prototype,"ssl",void 0),u([_()],I.prototype,"token",void 0),u([_()],I.prototype,"tokenRefreshBuffer",void 0),u([_()],I.prototype,"userId",void 0),u([_()],I.prototype,"validity",void 0),I=u([z("esri.identity.Credential")],I);class de extends ce{}de.prototype.declaredClass="esri.identity.IdentityManager";const Ae=new de;ue(Ae);export{Ae as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-button-Cm9_TJei-DvwKP8jU.js","./themeUtils-YjM7iIiX-DGrOr3vp.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./form-CRSw616T-wY3ZjFlq.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-BbTDbq0n.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-CSXrQx_7.js","./locale-Cn_GDVD_-CCUxSwPB.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-CfIXp3Nz.js","./t9n-C_hcZMZJ-Du2NPCXI.js","./icon-BXFbBbop-Bq4Zv26A.js","./loader-Ch7Jr16w-CF4bv9QO.js","./guid-Dls486Er-CBh637k4.js","./calcite-dialog-DAngwHC1-C6d9gJgf.js","./action-menu-DTIJuZNc-DnQvHied.js","./action-GCQoufcz-DQvoWHlv.js","./floating-ui-DKFFlLv3-8lk8tQD2.js","./debounce-27Hmkkyg-Th7bw3mg.js","./openCloseComponent-BGQ6h7vg-BO0gc3O8.js","./FloatingArrow-BG9llDYg-Ct2kNlPu.js","./panel-DRUEhsxp-KxESJ732.js","./scrim-BscQh4v9-CloQFru7.js","./calcite-input-BKRd7MCS-BhvpT25V.js","./input2-eOtqu-iO-DiRyHCWP.js","./calcite-label-DMj3M4QR-BaEG55cn.js","./calcite-notice-DeAGopAs-BI9wdRMa.js","./conditionalSlot-DsCzytJ4-DM7mn4Oa.js"])))=>i.map(i=>d[i]); +import{_ as C}from"./main-QGPoLsvl.js";import{v as u,S as _,i as z,I as ne,M as ae,z as ue,e as he,a as $,b as E,E as D,o as A,x as pe,s as R,c as b,f as P,u as j,T as H,L as F,X as ee,H as _e,Z as te,C as J,k as fe,A as ge,N,Y as se,y as me,V}from"./story-Doly9N9p.js";import{_ as re,R as ve,k as we,P as O,x as Se,X as Ie}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{b as ye}from"./substitute-j49H6mVR-DTufu01J.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const W="esri-identity-modal",G={base:W,info:`${W}__info`,notice:`${W}__notice`},ke="ArcGIS Online";let T=class extends ve{constructor(d,e){super(d,e),this.container=document.createElement("div"),this.error=null,this.oAuthPrompt=!1,this.open=!1,this.signingIn=!1,this.server=null,this.resource=null,this._usernameInputNode=null,this._passwordInputNode=null,document.body.appendChild(this.container)}loadDependencies(){return we({button:()=>C(()=>import("./calcite-button-Cm9_TJei-DvwKP8jU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),dialog:()=>C(()=>import("./calcite-dialog-DAngwHC1-C6d9gJgf.js"),__vite__mapDeps([20,1,2,3,4,5,6,8,21,19,14,12,22,9,13,15,11,16,17,18,23,24,25,26,27,28]),import.meta.url),input:()=>C(()=>import("./calcite-input-BKRd7MCS-BhvpT25V.js"),__vite__mapDeps([29,30,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url),label:()=>C(()=>import("./calcite-label-DMj3M4QR-BaEG55cn.js"),__vite__mapDeps([31,1,2,3,4,5,6,10,8,11]),import.meta.url),notice:()=>C(()=>import("./calcite-notice-DeAGopAs-BI9wdRMa.js"),__vite__mapDeps([32,1,2,3,4,5,6,33,15,8,12,13,14,16,25,11,17]),import.meta.url)})}get title(){return this.commonMessages?.auth.signIn}render(){const{open:d,title:e,messages:s,signingIn:t,oAuthPrompt:r,server:i,resource:n,error:h}=this,{info:p,oAuthInfo:o,lblItem:l,invalidUser:c,noAuthService:a,lblUser:f,lblPwd:g,lblCancel:v,lblSigning:w,lblOk:k}=s;return O("div",{class:this.classes(G.base,Se())},O("form",{bind:this,onsubmit:this._submit},O("calcite-dialog",{bind:this,heading:e,modal:!0,open:d,outsideCloseDisabled:!0,scale:"s",widthScale:"s",onCalciteDialogClose:this._cancel,onCalciteDialogOpen:this._focusUsernameInput},O("div",{class:G.info},ye(r?o:p,{server:i&&/\.arcgis\.com/i.test(i)?ke:i,resource:`(${n||l})`})),h?O("calcite-notice",{class:G.notice,icon:"exclamation-mark-triangle",kind:"danger",open:!0},O("div",{slot:"message"},h.details?.httpStatus?c:a)):null,r?null:[O("calcite-label",null,f,O("calcite-input",{afterCreate:m=>this._usernameInputNode=m,autocomplete:"off",bind:this,name:"username",required:!0,spellcheck:!1,type:"text",value:""})),O("calcite-label",null,g,O("calcite-input",{afterCreate:m=>this._passwordInputNode=m,bind:this,name:"password",required:!0,type:"password",value:""}))],O("calcite-button",{appearance:"outline",bind:this,onclick:this._cancel,slot:"footer-end",type:"button"},v),O("calcite-button",{loading:!!t,slot:"footer-end",type:"submit"},t?w:k))))}_focusUsernameInput(){return Ie(()=>this._usernameInputNode)}_cancel(){this._set("signingIn",!1),this.open=!1,this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(d){d.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode?.value,password:this._passwordInputNode?.value};this.emit("submit",e)}};u([_({readOnly:!0})],T.prototype,"container",void 0),u([_(),re("esri/t9n/common")],T.prototype,"commonMessages",void 0),u([_()],T.prototype,"error",void 0),u([_(),re("esri/identity/t9n/identity")],T.prototype,"messages",void 0),u([_()],T.prototype,"oAuthPrompt",void 0),u([_()],T.prototype,"open",void 0),u([_()],T.prototype,"signingIn",void 0),u([_()],T.prototype,"server",void 0),u([_({readOnly:!0})],T.prototype,"title",null),u([_()],T.prototype,"resource",void 0),T=u([z("esri.identity.IdentityModal")],T);const ie=T,X="esriJSAPIOAuth";class K{constructor(e,s){this.oAuthInfo=null,this.storage=null,this.appId=null,this.codeVerifier=null,this.expires=null,this.refreshToken=null,this.ssl=null,this.stateUID=null,this.token=null,this.userId=null,this.oAuthInfo=e,this.storage=s,this._init()}isValid(){let e=!1;if(this.oAuthInfo&&this.userId&&(this.refreshToken||this.token)){if(this.expires==null&&this.refreshToken)e=!0;else if(this.expires){const s=Date.now();this.expires>s&&(this.expires-s)/1e3>60*this.oAuthInfo.minTimeUntilExpiration&&(e=!0)}}return e}save(){if(!this.storage)return!1;const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t||(t=e[s.authNamespace]={}),this.appId||(this.appId=s.appId),t[s.portalUrl]={appId:this.appId,codeVerifier:this.codeVerifier,expires:this.expires,refreshToken:this.refreshToken,ssl:this.ssl,stateUID:this.stateUID,token:this.token,userId:this.userId};try{this.storage.setItem(X,JSON.stringify(e))}catch(r){return console.warn(r),!1}return!0}return!1}destroy(){const e=this._load(),s=this.oAuthInfo;if(s?.appId&&s?.portalUrl&&(this.expires==null||this.expires>Date.now())&&(this.refreshToken||this.token)){const t=s.portalUrl.replace(/^http:/i,"https:")+"/sharing/rest/oauth2/revokeToken",r=new FormData;if(r.append("f","json"),r.append("auth_token",this.refreshToken||this.token),r.append("client_id",s.appId),r.append("token_type_hint",this.refreshToken?"refresh_token":"access_token"),typeof navigator.sendBeacon=="function")navigator.sendBeacon(t,r);else{const i=new XMLHttpRequest;i.open("POST",t),i.send(r)}}if(s?.authNamespace&&s.portalUrl&&this.storage){const t=e[s.authNamespace];if(t){delete t[s.portalUrl];try{this.storage.setItem(X,JSON.stringify(e))}catch(r){console.log(r)}}}s&&(s._oAuthCred=null,this.oAuthInfo=null)}_init(){const e=this._load(),s=this.oAuthInfo;if(s?.authNamespace&&s.portalUrl){let t=e[s.authNamespace];t&&(t=t[s.portalUrl],t&&(this.appId=t.appId,this.codeVerifier=t.codeVerifier,this.expires=t.expires,this.refreshToken=t.refreshToken,this.ssl=t.ssl,this.stateUID=t.stateUID,this.token=t.token,this.userId=t.userId))}}_load(){let e={};if(this.storage){const s=this.storage.getItem(X);if(s)try{e=JSON.parse(s)}catch(t){console.warn(t)}}return e}}K.prototype.declaredClass="esri.identity.OAuthCredential";var Q;let U=Q=class extends he{constructor(d){super(d),this._oAuthCred=null,this.appId=null,this.authNamespace="/",this.expiration=20160,this.flowType="auto",this.forceLogin=!1,this.forceUserId=!1,this.locale=null,this.minTimeUntilExpiration=30,this.popup=!1,this.popupCallbackUrl="oauth-callback.html",this.popupWindowFeatures="height=490,width=800,resizable,scrollbars,status",this.portalUrl="https://www.arcgis.com",this.preserveUrlHash=!1,this.userId=null}clone(){return Q.fromJSON(this.toJSON())}};u([_({json:{write:!0}})],U.prototype,"appId",void 0),u([_({json:{write:!0}})],U.prototype,"authNamespace",void 0),u([_({json:{write:!0}})],U.prototype,"expiration",void 0),u([_({json:{write:!0}})],U.prototype,"flowType",void 0),u([_({json:{write:!0}})],U.prototype,"forceLogin",void 0),u([_({json:{write:!0}})],U.prototype,"forceUserId",void 0),u([_({json:{write:!0}})],U.prototype,"locale",void 0),u([_({json:{write:!0}})],U.prototype,"minTimeUntilExpiration",void 0),u([_({json:{write:!0}})],U.prototype,"popup",void 0),u([_({json:{write:!0}})],U.prototype,"popupCallbackUrl",void 0),u([_({json:{write:!0}})],U.prototype,"popupWindowFeatures",void 0),u([_({json:{write:!0}})],U.prototype,"portalUrl",void 0),u([_({json:{write:!0}})],U.prototype,"preserveUrlHash",void 0),u([_({json:{write:!0}})],U.prototype,"userId",void 0),U=Q=u([z("esri.identity.OAuthInfo")],U);const oe=U;let x=class extends he{constructor(d){super(d),this.adminTokenServiceUrl=null,this.currentVersion=null,this.hasPortal=null,this.hasServer=null,this.owningSystemUrl=null,this.owningTenant=null,this.server=null,this.shortLivedTokenValidity=null,this.tokenServiceUrl=null,this.webTierAuth=null}};u([_({json:{write:!0}})],x.prototype,"adminTokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"currentVersion",void 0),u([_({json:{write:!0}})],x.prototype,"hasPortal",void 0),u([_({json:{write:!0}})],x.prototype,"hasServer",void 0),u([_({json:{write:!0}})],x.prototype,"owningSystemUrl",void 0),u([_({json:{write:!0}})],x.prototype,"owningTenant",void 0),u([_({json:{write:!0}})],x.prototype,"server",void 0),u([_({json:{write:!0}})],x.prototype,"shortLivedTokenValidity",void 0),u([_({json:{write:!0}})],x.prototype,"tokenServiceUrl",void 0),u([_({json:{write:!0}})],x.prototype,"webTierAuth",void 0),x=u([z("esri.identity.ServerInfo")],x);const Y=x,L={},le=d=>{const e=new b(d.owningSystemUrl).host,s=new b(d.server).host,t=/.+\.arcgis\.com$/i;return t.test(e)&&t.test(s)},Z=(d,e)=>!!(le(d)&&e&&e.some(s=>s.test(d.server)));let M=null,B=null;try{M=window.localStorage,B=window.sessionStorage}catch{}class ce extends ne{constructor(){super(),this._portalConfig=globalThis.esriGeowConfig,this.serverInfos=[],this.oAuthInfos=[],this.credentials=[],this._soReqs=[],this._xoReqs=[],this._portals=[],this._defaultOAuthInfo=null,this._defaultTokenValidity=60,this.dialog=null,this.tokenValidity=null,this.normalizeWebTierAuth=!1,this._appOrigin=window.origin!=="null"?window.origin:window.location.origin,this._appUrlObj=$(window.location.href),this._busy=null,this._rejectOnPersistedPageShow=!1,this._oAuthLocationParams=null,this._gwTokenUrl="/sharing/rest/generateToken",this._agsRest="/rest/services",this._agsPortal=/\/sharing(\/|$)/i,this._agsAdmin=/(https?:\/\/[^/]+\/[^/]+)\/admin\/?(\/.*)?$/i,this._adminSvcs=/\/rest\/admin\/services(\/|$)/i,this._gwDomains=[{regex:/^https?:\/\/www\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:dev|[a-z\d-]+\.mapsdev)\.arcgis\.com/i,customBaseUrl:"mapsdev.arcgis.com",tokenServiceUrl:"https://dev.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:devext|[a-z\d-]+\.mapsdevext)\.arcgis\.com/i,customBaseUrl:"mapsdevext.arcgis.com",tokenServiceUrl:"https://devext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/(?:qaext|[a-z\d-]+\.mapsqa)\.arcgis\.com/i,customBaseUrl:"mapsqa.arcgis.com",tokenServiceUrl:"https://qaext.arcgis.com/sharing/rest/generateToken"},{regex:/^https?:\/\/[a-z\d-]+\.maps\.arcgis\.com/i,customBaseUrl:"maps.arcgis.com",tokenServiceUrl:"https://www.arcgis.com/sharing/rest/generateToken"}],this._legacyFed=[],this._regexSDirUrl=/http.+\/rest\/services\/?/gi,this._regexServerType=/(\/(FeatureServer|GPServer|GeoDataServer|GeocodeServer|GeoenrichmentServer|GeometryServer|GlobeServer|ImageServer|KnowledgeGraphServer|MapServer|MissionServer|MobileServer|NAServer|NetworkDiagramServer|OGCFeatureServer|ParcelFabricServer|RelationalCatalogServer|SceneServer|StreamServer|UtilityNetworkServer|ValidationServer|VectorTileServer|VersionManagementServer|VideoServer)).*/gi,this._gwUser=/http.+\/users\/([^/]+).*/i,this._gwItem=/http.+\/items\/([^/]+).*/i,this._gwGroup=/http.+\/groups\/([^/]+).*/i,this._rePortalTokenSvc=/\/sharing(\/rest)?\/generatetoken/i,this._createDefaultOAuthInfo=!0,this._hasTestedIfAppIsOnPortal=!1,this._getPlatformSelfError=null,this._getOAuthLocationParams(),window.addEventListener("pageshow",e=>{this._pageShowHandler(e)})}registerServers(e){const s=this.serverInfos;s?(e=e.filter(t=>!this.findServerInfo(t.server)),this.serverInfos=s.concat(e)):this.serverInfos=e,e.forEach(t=>{t.owningSystemUrl&&this._portals.push(t.owningSystemUrl),t.hasPortal&&this._portals.push(t.server)})}registerOAuthInfos(e){const s=this.oAuthInfos;if(s){for(const t of e){const r=this.findOAuthInfo(t.portalUrl);r&&s.splice(s.indexOf(r),1)}this.oAuthInfos=s.concat(e)}else this.oAuthInfos=e}registerToken(e){e={...e};const s=this._sanitizeUrl(e.server),t=this._isServerRsrc(s);let r,i=this.findServerInfo(s),n=!0;i||(i=new Y,i.server=this._getServerInstanceRoot(s),t?i.hasServer=!0:(i.tokenServiceUrl=this._getTokenSvcUrl(s),i.hasPortal=!0),this.registerServers([i])),r=this._findCredential(s),r?(delete e.server,Object.assign(r,e),n=!1):(r=new I({userId:e.userId,server:i.server??void 0,token:e.token,expires:e.expires,ssl:e.ssl,scope:t?"server":"portal"}),r.resources=[s],this.credentials.push(r)),r.emitTokenChange(!1),n||r.refreshServerTokens()}toJSON(){return ae({serverInfos:this.serverInfos.map(e=>e.toJSON()),oAuthInfos:this.oAuthInfos.map(e=>e.toJSON()),credentials:this.credentials.map(e=>e.toJSON())})}initialize(e){if(!e)return;typeof e=="string"&&(e=JSON.parse(e));const s=e.serverInfos,t=e.oAuthInfos,r=e.credentials;if(s){const i=[];s.forEach(n=>{n.server&&n.tokenServiceUrl&&i.push(n.declaredClass?n:new Y(n))}),i.length&&this.registerServers(i)}if(t){const i=[];t.forEach(n=>{n.appId&&i.push(n.declaredClass?n:new oe(n))}),i.length&&this.registerOAuthInfos(i)}r&&r.forEach(i=>{i.server&&i.token&&i.expires&&i.expires>Date.now()&&((i=i.declaredClass?i:new I(i)).emitTokenChange(),this.credentials.push(i))})}findServerInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.serverInfos)if(this._hasSameServerInstance(t.server,e)){s=t;break}return s}findOAuthInfo(e){let s;e=this._sanitizeUrl(e);for(const t of this.oAuthInfos)if(this._hasSameServerInstance(t.portalUrl,e)){s=t;break}return s}findCredential(e,s){if(!e)return;let t;e=this._sanitizeUrl(e);const r=this._isServerRsrc(e)?"server":"portal";if(s){for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&s===i.userId&&i.scope===r){t=i;break}}else for(const i of this.credentials)if(this._hasSameServerInstance(i.server,e)&&this._getIdenticalSvcIdx(e,i)!==-1&&i.scope===r){t=i;break}return t}getCredential(e,s){let t,r,i=!0;s&&(t=!!s.token,r=s.error,i=s.prompt!==!1),s={...s},e=this._sanitizeUrl(e);const n=new AbortController,h=E();if(s.signal&&D(s.signal,()=>{n.abort()}),D(n,()=>{h.reject(new A("identity-manager:user-aborted","ABORTED"))}),pe(n))return h.promise;s.signal=n.signal;const p=this._isAdminResource(e),o=t?this.findCredential(e):null;let l;if(o&&r&&r.details&&r.details.httpStatus===498)o.destroy();else if(o)return l=new A("identity-manager:not-authorized","You are currently signed in as: '"+o.userId+"'. You do not have access to this resource: "+e,{error:r}),h.reject(l),h.promise;const c=this._findCredential(e,s);if(c)return h.resolve(c),h.promise;let a=this.findServerInfo(e);if(a)!a.hasPortal&&a.server&&a.owningSystemUrl&&this._hasSameServerInstance(a.server,a.owningSystemUrl)&&(a.hasPortal=!0),!a.hasServer&&this._isServerRsrc(e)&&(a._restInfoPms=this._getTokenSvcUrl(e),a.hasServer=!0);else{const f=this._getTokenSvcUrl(e);if(!f)return l=new A("identity-manager:unknown-resource","Unknown resource - could not find token service endpoint."),h.reject(l),h.promise;a=new Y,a.server=this._getServerInstanceRoot(e),typeof f=="string"?(a.tokenServiceUrl=f,a.hasPortal=!0):(a._restInfoPms=f,a.hasServer=!0),this.registerServers([a])}return a.hasPortal&&a._selfReq===void 0&&(i||R(a.tokenServiceUrl,this._appOrigin)||this._gwDomains.some(f=>f.tokenServiceUrl===a.tokenServiceUrl))&&(a._selfReq={owningTenant:s?.owningTenant,selfDfd:this._getPortalSelf(a.tokenServiceUrl.replace(this._rePortalTokenSvc,"/sharing/rest/portals/self"),e)}),this._enqueue(e,a,s,h,p)}getResourceName(e){return this._isRESTService(e)?e.replace(this._regexSDirUrl,"").replace(this._regexServerType,"")||"":this._gwUser.test(e)&&e.replace(this._gwUser,"$1")||this._gwItem.test(e)&&e.replace(this._gwItem,"$1")||this._gwGroup.test(e)&&e.replace(this._gwGroup,"$1")||""}generateToken(e,s,t){const r=this._rePortalTokenSvc.test(e.tokenServiceUrl),i=new b(this._appOrigin),n=e.shortLivedTokenValidity;let h,p,o,l,c,a,f,g;s&&(g=this.tokenValidity||n||this._defaultTokenValidity,g>n&&n>0&&(g=n)),t&&(h=t.isAdmin,p=t.serverUrl,o=t.token,a=t.signal,f=t.ssl,e.customParameters=t.customParameters),h?l=e.adminTokenServiceUrl:(l=e.tokenServiceUrl,c=new b(l.toLowerCase()),e.webTierAuth&&t?.serverUrl&&!f&&i.scheme==="http"&&(R(i.uri,l,!0)||c.scheme==="https"&&i.host===c.host&&i.port==="7080"&&c.port==="7443")&&(l=l.replace(/^https:/i,"http:").replace(/:7443/i,":7080")));const v={query:{request:"getToken",username:s?.username,password:s?.password,serverUrl:p,token:o,expiration:g,referer:h||r?this._appOrigin:null,client:h?"referer":null,f:"json",...e.customParameters},method:"post",authMode:"anonymous",useProxy:this._useProxy(e,t),signal:a,...t?.ioArgs};return r||(v.withCredentials=!1),P(l,v).then(w=>{const k=w.data;if(!k?.token)return new A("identity-manager:authentication-failed","Unable to generate token");const m=e.server;return L[m]||(L[m]={}),s&&(L[m][s.username]=s.password),k.validity=g,k})}isBusy(){return!!this._busy}async checkSignInStatus(e){return(await this.checkAppAccess(e,"")).credential}checkAppAccess(e,s,t){let r=!1;return this.getCredential(e,{prompt:!1}).then(i=>{let n;const h={f:"json"};if(i.scope==="portal")if(s&&(this._doPortalSignIn(e)||t?.force))n=i.server+"/sharing/rest/oauth2/validateAppAccess",h.client_id=s;else{if(!i.token)return{credential:i};n=i.server+"/sharing/rest"}else{if(!i.token)return{credential:i};n=i.server+"/rest/services"}return i.token&&(h.token=i.token),P(n,{query:h,authMode:"anonymous"}).then(p=>{if(p.data.valid===!1)throw new A("identity-manager:not-authorized",`You are currently signed in as: '${i.userId}'.`,p.data);return r=!!p.data.viewOnlyUserTypeApp,{credential:i}}).catch(p=>{if(p.name==="identity-manager:not-authorized")throw p;const o=p.details?.httpStatus;if(o===498)throw i.destroy(),new A("identity-manager:not-authenticated","User is not signed in.");if(o===400)throw new A("identity-manager:invalid-request");return{credential:i}})}).then(i=>({credential:i.credential,viewOnly:r}))}setOAuthResponseHash(e){e&&(e.charAt(0)==="#"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}setOAuthRedirectionHandler(e){this._oAuthRedirectFunc=e}setProtocolErrorHandler(e){this._protocolFunc=e}signIn(e,s,t={}){const r=E(),i=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=p=o=null},n=()=>{i(),this._oAuthDfd=null,r.reject(new A("identity-manager:user-aborted","ABORTED"))};t.signal&&D(t.signal,()=>{n()});const h=new ie({open:!0,resource:this.getResourceName(e),server:s.server});this.dialog=h,this.emit("dialog-create");let p=h.on("cancel",n),o=h.on("submit",l=>{this.generateToken(s,l,{isAdmin:t.isAdmin,signal:t.signal}).then(c=>{i();const a=new I({userId:l.username,server:s.server??void 0,token:c.token,expires:c.expires!=null?Number(c.expires):null,ssl:!!c.ssl,isAdmin:t.isAdmin,validity:c.validity});r.resolve(a)}).catch(c=>{h.error=c,h.signingIn=!1})});return r.promise}oAuthSignIn(e,s,t,r){this._oAuthDfd=E();const i=this._oAuthDfd;let n;r?.signal&&D(r.signal,()=>{const a=this._oAuthDfd&&this._oAuthDfd.oAuthWin_;a&&!a.closed?a.close():this.dialog&&l()}),i.resUrl_=e,i.sinfo_=s,i.oinfo_=t;const h=t._oAuthCred;if(h.storage&&(t.flowType==="authorization-code"||t.flowType==="auto"&&s.currentVersion>=8.4)){let a=crypto.getRandomValues(new Uint8Array(32));n=H(a),h.codeVerifier=n,a=crypto.getRandomValues(new Uint8Array(32)),h.stateUID=H(a),h.save()||(h.codeVerifier=n=null)}else h.codeVerifier=null;let p,o;this._getCodeChallenge(n).then(a=>{const f=!r||r.oAuthPopupConfirmation!==!1;if(!t.popup||!f)return void this._doOAuthSignIn(e,s,t,a);const g=new ie({oAuthPrompt:!0,server:s.server,open:!0});this.dialog=g,this.emit("dialog-create"),p=g.on("cancel",l),o=g.on("submit",()=>{c(),this._doOAuthSignIn(e,s,t,a)})});const l=()=>{c(),this._oAuthDfd=null,i.reject(new A("identity-manager:user-aborted","ABORTED"))},c=()=>{p?.remove(),o?.remove(),this.dialog?.destroy(),this.dialog=null};return i.promise}destroyCredentials(){this.credentials&&this.credentials.slice().forEach(e=>{e.destroy()}),this.emit("credentials-destroy")}enablePostMessageAuth(e="https://www.arcgis.com/sharing/rest"){this._postMessageAuthHandle&&this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=F(window,"message",s=>{if((s.origin===this._appOrigin||s.origin.endsWith(".arcgis.com"))&&s.data?.type==="arcgis:auth:requestCredential"){const t=s.source;this.getCredential(e).then(r=>{t.postMessage({type:"arcgis:auth:credential",credential:{expires:r.expires,server:r.server,ssl:r.ssl,token:r.token,userId:r.userId}},s.origin)}).catch(r=>{t.postMessage({type:"arcgis:auth:error",error:{name:r.name,message:r.message}},s.origin)})}})}disablePostMessageAuth(){this._postMessageAuthHandle&&(this._postMessageAuthHandle.remove(),this._postMessageAuthHandle=null)}_getOAuthLocationParams(){let e=window.location.hash;if(e){e.charAt(0)==="#"&&(e=e.slice(1));const t=j(e);let r=!1;if(t.access_token&&t.expires_in&&t.state&&t.hasOwnProperty("username"))try{t.state=JSON.parse(t.state),t.state.portalUrl&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}r&&(window.location.hash=t.state?.hash||"")}let s=window.location.search;if(s){s.charAt(0)==="?"&&(s=s.slice(1));const t=j(s);let r=!1;if(t.code&&t.state)try{t.state=JSON.parse(t.state),t.state.portalUrl&&t.state.uid&&(this._oAuthLocationParams=t,r=!0)}catch{}else if(t.error&&t.error_description&&(console.log("IdentityManager OAuth Error: ",t.error," - ",t.error_description),t.error==="access_denied"&&(r=!0,t.state)))try{t.state=JSON.parse(t.state)}catch{}if(r){const i={...t};["code","error","error_description","message_code","persist","state"].forEach(p=>{delete i[p]});const n=ee(i),h=window.location.pathname+(n?`?${n}`:"")+(t.state?.hash||"");window.history.replaceState(window.history.state,"",h)}}}_getOAuthToken(e,s,t,r,i){return e=e.replace(/^http:/i,"https:"),P(`${e}/sharing/rest/oauth2/token`,{authMode:"anonymous",method:"post",query:r&&i?{grant_type:"authorization_code",code:s,redirect_uri:r,client_id:t,code_verifier:i}:{grant_type:"refresh_token",refresh_token:s,client_id:t}}).then(n=>n.data)}async _getCodeChallenge(e){if(e&&globalThis.isSecureContext){const s=new TextEncoder().encode(e),t=await crypto.subtle.digest("SHA-256",s);return H(new Uint8Array(t))}return null}_pageShowHandler(e){if(e.persisted&&this.isBusy()&&this._rejectOnPersistedPageShow){const s=new A("identity-manager:user-aborted","ABORTED");this._errbackFunc(s)}}_findCredential(e,s){let t,r,i,n,h=-1;const p=s?.token,o=s?.resource,l=this._isServerRsrc(e)?"server":"portal",c=this.credentials.filter(a=>this._hasSameServerInstance(a.server,e)&&a.scope===l);if(e=o||e,c.length)if(c.length===1){if(t=c[0],i=this.findServerInfo(t.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,t.userId):void 0,h=this._getIdenticalSvcIdx(e,t),!p)return h===-1&&t.resources.push(e),this._addResource(e,n),t;h!==-1&&(t.resources.splice(h,1),this._removeResource(e,n))}else{let a,f;if(c.some(g=>(f=this._getIdenticalSvcIdx(e,g),f!==-1&&(a=g,i=this.findServerInfo(a.server),r=i?.owningSystemUrl,n=r?this.findCredential(r,a.userId):void 0,h=f,!0))),p)a&&(a.resources.splice(h,1),this._removeResource(e,n));else if(a)return this._addResource(e,n),a}}_findOAuthInfo(e){let s=this.findOAuthInfo(e);if(!s){for(const t of this.oAuthInfos)if(this._isIdProvider(t.portalUrl,e)){s=t;break}}return s}_addResource(e,s){s&&this._getIdenticalSvcIdx(e,s)===-1&&s.resources.push(e)}_removeResource(e,s){let t=-1;s&&(t=this._getIdenticalSvcIdx(e,s),t>-1&&s.resources.splice(t,1))}_useProxy(e,s){return s?.isAdmin&&!R(e.adminTokenServiceUrl,this._appOrigin)||!this._isPortalDomain(e.tokenServiceUrl)&&String(e.currentVersion)==="10.1"&&!R(e.tokenServiceUrl,this._appOrigin)}_getOrigin(e){const s=new b(e);return s.scheme+"://"+s.host+(s.port!=null?":"+s.port:"")}_getServerInstanceRoot(e){const s=e.toLowerCase();let t=s.indexOf(this._agsRest);return t===-1&&this._isAdminResource(e)&&(t=this._agsAdmin.test(e)?e.replace(this._agsAdmin,"$1").length:e.search(this._adminSvcs)),t!==-1||_e(s)||(t=s.indexOf("/sharing")),t===-1&&s.endsWith("/")&&(t=s.length-1),t>-1?e.slice(0,t):e}_hasSameServerInstance(e,s){return e.endsWith("/")&&(e=e.slice(0,-1)),e=e.toLowerCase(),s=this._getServerInstanceRoot(s).toLowerCase(),e=te(e),s=te(s),(e=e.slice(Math.max(0,e.indexOf(":"))))===(s=s.slice(Math.max(0,s.indexOf(":"))))}_sanitizeUrl(e){const s=(J.request.proxyUrl||"").toLowerCase(),t=s?e.toLowerCase().indexOf(s+"?"):-1;return t!==-1&&(e=e.slice(t+s.length+1)),e=fe(e),$(e).path}_isRESTService(e){return e.includes(this._agsRest)}_isAdminResource(e){return this._agsAdmin.test(e)||this._adminSvcs.test(e)}_isServerRsrc(e){return this._isRESTService(e)||this._isAdminResource(e)}_isIdenticalService(e,s){let t=!1;if(this._isRESTService(e)&&this._isRESTService(s)){const r=this._getSuffix(e).toLowerCase(),i=this._getSuffix(s).toLowerCase();if(t=r===i,!t){const n=/(.*)\/(MapServer|FeatureServer|UtilityNetworkServer).*/gi;t=r.replaceAll(n,"$1")===i.replaceAll(n,"$1")}}else this._isAdminResource(e)&&this._isAdminResource(s)?t=!0:this._isServerRsrc(e)||this._isServerRsrc(s)||!this._isPortalDomain(e)||(t=!0);return t}_isPortalDomain(e){const s=new b(e.toLowerCase()),t=this._portalConfig;let r=this._gwDomains.some(i=>i.regex.test(s.uri));return!r&&t&&(r=this._hasSameServerInstance(this._getServerInstanceRoot(t.restBaseUrl),s.uri)),r||J.portalUrl&&(r=R(s,J.portalUrl,!0)),r||(r=this._portals.some(i=>this._hasSameServerInstance(i,s.uri))),r=r||this._agsPortal.test(s.path),r}_isIdProvider(e,s){let t=-1,r=-1;this._gwDomains.forEach((n,h)=>{t===-1&&n.regex.test(e)&&(t=h),r===-1&&n.regex.test(s)&&(r=h)});let i=!1;if(t>-1&&r>-1&&(t===0||t===4?r!==0&&r!==4||(i=!0):t===1?r!==1&&r!==2||(i=!0):t===2?r===2&&(i=!0):t===3&&r===3&&(i=!0)),!i){const n=this.findServerInfo(s),h=n?.owningSystemUrl;h&&le(n)&&this._isPortalDomain(h)&&this._isIdProvider(e,h)&&(i=!0)}return i}_getIdenticalSvcIdx(e,s){let t=-1;for(let r=0;rn.data),{adminUrl:s,promise:t}}if(this._isPortalDomain(e)){let i="";if(this._gwDomains.some(n=>(n.regex.test(e)&&(i=n.tokenServiceUrl),!!i)),i||this._portals.some(n=>(this._hasSameServerInstance(n,e)&&(i=n+this._gwTokenUrl),!!i)),i||(r=e.toLowerCase().indexOf("/sharing"),r!==-1&&(i=e.slice(0,r)+this._gwTokenUrl)),i||(i=this._getOrigin(e)+this._gwTokenUrl),i){const n=new b(e).port;/^http:\/\//i.test(e)&&n==="7080"&&(i=i.replace(/:7080/i,":7443")),i=i.replace(/http:/i,"https:")}return i}}_processOAuthResponseParams(e,s,t){const r=s._oAuthCred;if(e.code){const n=r.codeVerifier;return r.codeVerifier=null,r.stateUID=null,r.save(),this._getOAuthToken(t.server,e.code,s.appId,this._getRedirectURI(s,!0),n).then(h=>{const p=new I({userId:h.username,server:t.server??void 0,token:h.access_token,expires:Date.now()+1e3*h.expires_in,ssl:h.ssl,oAuthState:e.state,_oAuthCred:r});return s.userId=p.userId,r.storage=h.persist?M:B,r.refreshToken=h.refresh_token,r.token=null,r.expires=h.refresh_token_expires_in?Date.now()+1e3*h.refresh_token_expires_in:null,r.userId=p.userId,r.ssl=p.ssl,r.save(),p})}const i=new I({userId:e.username,server:t.server??void 0,token:e.access_token,expires:Date.now()+1e3*Number(e.expires_in),ssl:e.ssl==="true",oAuthState:e.state,_oAuthCred:r});return s.userId=i.userId,r.storage=e.persist?M:B,r.refreshToken=null,r.token=i.token,r.expires=i.expires,r.userId=i.userId,r.ssl=i.ssl,r.save(),Promise.resolve(i)}_processOAuthPopupParams(e){const s=this._oAuthDfd;if(this._oAuthDfd=null,s)if(clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle?.remove(),e.error){const t=e.error==="access_denied",r=new A(t?"identity-manager:user-aborted":"identity-manager:authentication-failed",t?"ABORTED":"OAuth: "+e.error+" - "+e.error_description);s.reject(r)}else this._processOAuthResponseParams(e,s.oinfo_,s.sinfo_).then(t=>{s.resolve(t)}).catch(t=>{s.reject(t)})}_setOAuthResponseQueryString(e){e&&(e.charAt(0)==="?"&&(e=e.slice(1)),this._processOAuthPopupParams(j(e)))}async _exchangeToken(e,s,t){return(await P(`${e}/sharing/rest/oauth2/exchangeToken`,{authMode:"anonymous",method:"post",query:{f:"json",client_id:s,token:t}})).data.token}async _getPlatformSelf(e,s){if(this._getPlatformSelfError&&Date.now()-this._getPlatformSelfError[1]<1e3)throw this._getPlatformSelfError[0];e=e.replace(/^http:/i,"https:");try{const t=await P(`${e}/sharing/rest/oauth2/platformSelf`,{authMode:"anonymous",headers:{"X-Esri-Auth-Client-Id":s,"X-Esri-Auth-Redirect-Uri":window.location.href.replace(/#.*$/,"")},method:"post",query:{f:"json",expiration:30},withCredentials:!0});return this._getPlatformSelfError=null,t.data}catch(t){throw t.details?.messageCode==="OAUTH_0066"&&(this._getPlatformSelfError=[t,Date.now()]),t}}_getPortalSelf(e,s){let t;return this._gwDomains.some(r=>(r.regex.test(e)&&(t=r.customBaseUrl),!!t)),t?Promise.resolve({allSSL:!0,currentVersion:"8.4",customBaseUrl:t,portalMode:"multitenant",supportsOAuth:!0}):(this._appOrigin.startsWith("https:")?e=e.replace(/^http:/i,"https:").replace(/:7080/i,":7443"):/^http:/i.test(s)&&(e=e.replace(/^https:/i,"http:").replace(/:7443/i,":7080")),P(e,{query:{f:"json"},authMode:"anonymous",withCredentials:!0}).then(r=>r.data))}_doPortalSignIn(e){const s=this._portalConfig,t=window.location.href,r=this.findServerInfo(e);return!(!s&&!this._isPortalDomain(t)||!(r?r.hasPortal||r.owningSystemUrl&&this._isPortalDomain(r.owningSystemUrl):this._isPortalDomain(e))||!(this._isIdProvider(t,e)||s&&(this._hasSameServerInstance(this._getServerInstanceRoot(s.restBaseUrl),e)||this._isIdProvider(s.restBaseUrl,e))||R(t,e,!0)))}_checkProtocol(e,s,t,r){let i=!0;const n=r?s.adminTokenServiceUrl:s.tokenServiceUrl;return n.trim().toLowerCase().startsWith("https:")&&!this._appOrigin.startsWith("https:")&&ge(n)&&(i=!!this._protocolFunc&&!!this._protocolFunc({resourceUrl:e,serverInfo:s}),!i)&&t(new A("identity-manager:aborted","Aborted the Sign-In process to avoid sending password over insecure connection.")),i}_enqueue(e,s,t,r,i,n){return r||(r=E()),r.resUrl_=e,r.sinfo_=s,r.options_=t,r.admin_=i,r.refresh_=n,this._busy?this._hasSameServerInstance(this._getServerInstanceRoot(e),this._busy.resUrl_)?(this._oAuthDfd&&this._oAuthDfd.oAuthWin_&&this._oAuthDfd.oAuthWin_.focus(),this._soReqs.push(r)):this._xoReqs.push(r):this._doSignIn(r),r.promise}_doSignIn(e){this._busy=e,this._rejectOnPersistedPageShow=!1;const s=o=>{const l=e.options_?.resource,c=e.resUrl_,a=e.refresh_;let f=!1;this.credentials.includes(o)||(a&&this.credentials.includes(a)?(a.userId=o.userId,a.token=o.token,a.expires=o.expires,a.validity=o.validity,a.ssl=o.ssl,a.creationTime=o.creationTime,f=!0,o=a):this.credentials.push(o)),o.resources||(o.resources=[]),o.resources.includes(l||c)||o.resources.push(l||c),o.scope=this._isServerRsrc(c)?"server":"portal",o.emitTokenChange();const g=this._soReqs,v={};this._soReqs=[],g.forEach(w=>{if(!this._isIdenticalService(c,w.resUrl_)){const k=this._getSuffix(w.resUrl_);v[k]||(v[k]=!0,o.resources.push(w.resUrl_))}}),e.resolve(o),g.forEach(w=>{this._hasSameServerInstance(this._getServerInstanceRoot(c),w.resUrl_)?w.resolve(o):this._soReqs.push(w)}),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,f||this.emit("credential-create",{credential:o}),this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},t=o=>{e.reject(o),this._busy=e.resUrl_=e.sinfo_=e.refresh_=null,this._soReqs.length?this._doSignIn(this._soReqs.shift()):this._xoReqs.length&&this._doSignIn(this._xoReqs.shift())},r=(o,l,c,a)=>{const f=e.sinfo_,g=!e.options_||e.options_.prompt!==!1,v=f.hasPortal&&this._findOAuthInfo(e.resUrl_);let w,k;if(o)s(new I({userId:o,server:f.server??void 0,token:c??void 0,expires:a!=null?Number(a):null,ssl:!!l}));else if(window!==window.parent&&this._appUrlObj.query?.["arcgis-auth-origin"]&&this._appUrlObj.query?.["arcgis-auth-portal"]&&this._hasSameServerInstance(this._getServerInstanceRoot(this._appUrlObj.query["arcgis-auth-portal"]),e.resUrl_)){window.parent.postMessage({type:"arcgis:auth:requestCredential"},this._appUrlObj.query["arcgis-auth-origin"]);const m=F(window,"message",y=>{y.source===window.parent&&y.data&&(y.data.type==="arcgis:auth:credential"?(m.remove(),y.data.credential.expires{m.remove()})}else if(v){let m=v._oAuthCred;if(!m){const y=new K(v,M),S=new K(v,B);y.isValid()&&S.isValid()?y.expires>S.expires?(m=y,S.destroy()):(m=S,y.destroy()):m=y.isValid()?y:S,v._oAuthCred=m}if(m.isValid()){w=new I({userId:m.userId??void 0,server:f.server??void 0,token:m.token??void 0,expires:m.expires,ssl:m.ssl??void 0,_oAuthCred:m});const y=v.appId!==m.appId&&this._doPortalSignIn(e.resUrl_);y||m.refreshToken?(e._pendingDfd=m.refreshToken?this._getOAuthToken(f.server,m.refreshToken,m.appId).then(S=>(w.expires=Date.now()+1e3*S.expires_in,w.token=S.access_token,w)):Promise.resolve(w),e._pendingDfd.then(S=>y?this._exchangeToken(S.server,v.appId,S.token).then(q=>(S.token=q,S)).catch(()=>S):S).then(S=>{s(S)}).catch(S=>{const q=S.details?.httpStatus;q>0&&q!==404?(m.destroy(),r()):t(S)})):s(w)}else if(this._oAuthLocationParams&&this._hasSameServerInstance(v.portalUrl,this._oAuthLocationParams.state.portalUrl)&&(this._oAuthLocationParams.access_token||this._oAuthLocationParams.code&&this._oAuthLocationParams.state.uid===m.stateUID&&m.codeVerifier)){const y=this._oAuthLocationParams;this._oAuthLocationParams=null,e._pendingDfd=this._processOAuthResponseParams(y,v,f).then(S=>{s(S)}).catch(t)}else{const y=()=>{g?e._pendingDfd=this.oAuthSignIn(e.resUrl_,f,v,e.options_).then(s,t):(k=new A("identity-manager:not-authenticated","User is not signed in."),t(k))};this._doPortalSignIn(e.resUrl_)?e._pendingDfd=this._getPlatformSelf(f.server,v.appId).then(S=>{R(S.portalUrl,this._appOrigin,!0)?(w=new I({userId:S.username,server:f.server??void 0,expires:Date.now()+1e3*S.expires_in,token:S.token}),s(w)):y()}).catch(y):y()}}else if(g){if(this._checkProtocol(e.resUrl_,f,t,e.admin_)){let m=e.options_;e.admin_&&(m=m||{},m.isAdmin=!0),e._pendingDfd=this.signIn(e.resUrl_,f,m).then(s,t)}}else k=new A("identity-manager:not-authenticated","User is not signed in."),t(k)},i=()=>{const o=e.sinfo_,l=o.owningSystemUrl,c=e.options_;let a,f,g,v;if(c&&(a=c.token,f=c.error,g=c.prompt),v=this._findCredential(l,{token:a,resource:e.resUrl_}),!v){for(const w of this.credentials)if(this._isIdProvider(l,w.server)){v=w;break}}if(v){const w=this.findCredential(e.resUrl_,v.userId);if(w)s(w);else if(Z(o,this._legacyFed)){const k=v.toJSON();k.server=o.server,k.resources=null,s(new I(k))}else(e._pendingDfd=this.generateToken(this.findServerInfo(v.server),null,{serverUrl:e.resUrl_,token:v.token,signal:e.options_.signal,ssl:v.ssl})).then(k=>{s(new I({userId:v?.userId,server:o.server??void 0,token:k.token,expires:k.expires!=null?Number(k.expires):null,ssl:!!k.ssl,isAdmin:e.admin_,validity:k.validity}))},t)}else this._busy=null,a&&(e.options_.token=null),(e._pendingDfd=this.getCredential(l.replace(/\/?$/,"/sharing"),{resource:e.resUrl_,owningTenant:o.owningTenant,signal:e.options_.signal,token:a,error:f,prompt:g})).then(()=>{this._enqueue(e.resUrl_,e.sinfo_,e.options_,e,e.admin_)},w=>{e.resUrl_=e.sinfo_=e.refresh_=null,e.reject(w)})};this._errbackFunc=t;const n=e.sinfo_.owningSystemUrl,h=this._isServerRsrc(e.resUrl_),p=e.sinfo_._restInfoPms;p?p.promise.then(o=>{const l=e.sinfo_;if(l._restInfoPms){l.adminTokenServiceUrl=l._restInfoPms.adminUrl,l._restInfoPms=null,l.tokenServiceUrl=(N("authInfo.tokenServicesUrl",o)||N("authInfo.tokenServiceUrl",o)||N("tokenServiceUrl",o))??null,l.shortLivedTokenValidity=N("authInfo.shortLivedTokenValidity",o)??null,l.currentVersion=o.currentVersion,l.owningTenant=o.owningTenant;const c=l.owningSystemUrl=o.owningSystemUrl;c&&this._portals.push(c)}h&&l.owningSystemUrl?i():r()},()=>{e.sinfo_._restInfoPms=null;const o=new A("identity-manager:server-identification-failed","Unknown resource - could not find token service endpoint.");t(o)}):h&&n?i():e.sinfo_._selfReq?e.sinfo_._selfReq.selfDfd.then(o=>{const l={};let c,a,f,g;return o&&(c=o.user?.username,l.username=c,l.allSSL=o.allSSL,a=o.supportsOAuth,g=parseFloat(o.currentVersion),o.portalMode==="multitenant"&&(f=o.customBaseUrl),e.sinfo_.currentVersion=g),e.sinfo_.webTierAuth=!!c,c&&this.normalizeWebTierAuth?this.generateToken(e.sinfo_,null,{ssl:l.allSSL}).catch(()=>null).then(v=>(l.portalToken=v?.token,l.tokenExpiration=v?.expires,l)):!c&&a&&g>=4.4&&!this._findOAuthInfo(e.resUrl_)?this._generateOAuthInfo({portalUrl:e.sinfo_.server,customBaseUrl:f,owningTenant:e.sinfo_._selfReq.owningTenant}).catch(()=>null).then(()=>l):l}).catch(()=>null).then(o=>{e.sinfo_._selfReq=null,o?r(o.username,o.allSSL,o.portalToken,o.tokenExpiration):r()}):r()}_generateOAuthInfo(e){let s,t=null,r=e.portalUrl;const i=e.customBaseUrl,n=e.owningTenant,h=!this._defaultOAuthInfo&&this._createDefaultOAuthInfo&&!this._hasTestedIfAppIsOnPortal;if(h){t=window.location.href;let p=t.indexOf("?");p>-1&&(t=t.slice(0,p)),p=t.search(/\/(apps|home)\//),t=p>-1?t.slice(0,p):null}return h&&t?(this._hasTestedIfAppIsOnPortal=!0,s=P(t+"/sharing/rest",{query:{f:"json"}}).then(()=>{this._defaultOAuthInfo=new oe({appId:"arcgisonline",popupCallbackUrl:t+"/home/oauth-callback.html"})})):s=Promise.resolve(),s.then(()=>{if(this._defaultOAuthInfo)return r=r.replace(/^http:/i,"https:"),P(r+"/sharing/rest/oauth2/validateRedirectUri",{query:{accountId:n,client_id:this._defaultOAuthInfo.appId,redirect_uri:se(this._defaultOAuthInfo.popupCallbackUrl),f:"json"}}).then(p=>{if(p.data.valid){const o=this._defaultOAuthInfo.clone();p.data.urlKey&&i?o.portalUrl="https://"+p.data.urlKey.toLowerCase()+"."+i:o.portalUrl=r,o.popup=window!==window.top||!(R(r,this._appOrigin)||this._gwDomains.some(l=>l.regex.test(r)&&l.regex.test(this._appOrigin))),this.oAuthInfos.push(o)}})})}_doOAuthSignIn(e,s,t,r){const i=t._oAuthCred,n={portalUrl:t.portalUrl};!t.popup&&t.preserveUrlHash&&window.location.hash&&(n.hash=window.location.hash),i.stateUID&&(n.uid=i.stateUID);const h={client_id:t.appId,response_type:i.codeVerifier?"code":"token",state:JSON.stringify(n),expiration:t.expiration,locale:t.locale,redirect_uri:this._getRedirectURI(t,!!i.codeVerifier)};t.forceLogin&&(h.force_login=!0),t.forceUserId&&t.userId&&(h.prepopulatedusername=t.userId),!t.popup&&this._doPortalSignIn(e)&&(h.redirectToUserOrgUrl=!0),i.codeVerifier&&(h.code_challenge=r||i.codeVerifier,h.code_challenge_method=r?"S256":"plain");const p=t.portalUrl.replace(/^http:/i,"https:")+"/sharing/oauth2/authorize",o=p+"?"+ee(h);if(t.popup){const l=window.open(o,"esriJSAPIOAuth",t.popupWindowFeatures);if(l)l.focus(),this._oAuthDfd.oAuthWin_=l,this._oAuthIntervalId=setInterval(()=>{if(l.closed){clearInterval(this._oAuthIntervalId),this._oAuthOnPopupHandle.remove();const c=this._oAuthDfd;if(c){const a=new A("identity-manager:user-aborted","ABORTED");c.reject(a)}}},500),this._oAuthOnPopupHandle=F(window,["arcgis:auth:hash","arcgis:auth:location:search"],c=>{c.type==="arcgis:auth:hash"?this.setOAuthResponseHash(c.detail):this._setOAuthResponseQueryString(c.detail)});else{const c=new A("identity-manager:popup-blocked","ABORTED");this._oAuthDfd.reject(c)}}else this._rejectOnPersistedPageShow=!0,this._oAuthRedirectFunc?this._oAuthRedirectFunc({authorizeParams:h,authorizeUrl:p,resourceUrl:e,serverInfo:s,oAuthInfo:t}):window.location.href=o}_getRedirectURI(e,s){const t=window.location.href.replace(/#.*$/,"");if(e.popup)return se(e.popupCallbackUrl);if(s){const r=$(t);return r.query&&["code","error","error_description","message_code","persist","state"].forEach(i=>{delete r.query[i]}),me(r.path,r.query)}return t}}ce.prototype.declaredClass="esri.identity.IdentityManagerBase";let I=class extends ne.EventedAccessor{constructor(d){super(d),this._oAuthCred=null,this.tokenRefreshBuffer=2,d?._oAuthCred&&(this._oAuthCred=d._oAuthCred)}initialize(){this.resources=this.resources||[],this.creationTime==null&&(this.creationTime=Date.now())}refreshToken(){const d=V,e=d.findServerInfo(this.server),s=e?.owningSystemUrl,t=!!s&&this.scope==="server",r=t&&Z(e,d._legacyFed),i=e.webTierAuth,n=i&&d.normalizeWebTierAuth,h=L[this.server],p=h?.[this.userId];let o,l=this.resources&&this.resources[0],c=t?d.findServerInfo(s):null,a={username:this.userId,password:p};if(i&&!n)return;t&&!c&&d.serverInfos.some(g=>(d._isIdProvider(s,g.server)&&(c=g),!!c));const f=c?d.findCredential(c.server,this.userId):null;if(!t||f){if(!r){if(t)o={serverUrl:l,token:f?.token,ssl:f?.ssl};else if(n)a=null,o={ssl:this.ssl};else{if(!p){let g;return l&&(l=d._sanitizeUrl(l),this._enqueued=1,g=d._enqueue(l,e,null,null,this.isAdmin,this),g.then(()=>{this._enqueued=0,this.refreshServerTokens()}).catch(()=>{this._enqueued=0})),g}this.isAdmin&&(o={isAdmin:!0})}return d.generateToken(t?c:e,t?null:a,o).then(g=>{this.token=g.token,this.expires=g.expires!=null?Number(g.expires):null,this.creationTime=Date.now(),this.validity=g.validity,this.emitTokenChange(),this.refreshServerTokens()}).catch(()=>{})}f?.refreshToken()}}refreshServerTokens(){if(this.scope==="portal"){const d=V;d.credentials.forEach(e=>{const s=d.findServerInfo(e.server),t=s?.owningSystemUrl;e!==this&&e.userId===this.userId&&t&&e.scope==="server"&&(d._hasSameServerInstance(this.server,t)||d._isIdProvider(t,this.server))&&(Z(s,d._legacyFed)?(e.token=this.token,e.expires=this.expires,e.creationTime=this.creationTime,e.validity=this.validity,e.emitTokenChange()):e.refreshToken())})}}emitTokenChange(d){clearTimeout(this._refreshTimer);const e=V,s=this.server?e.findServerInfo(this.server):null,t=s?.owningSystemUrl,r=t?e.findServerInfo(t):null;d===!1||t&&this.scope!=="portal"&&(!r?.webTierAuth||e.normalizeWebTierAuth)||this.expires==null&&this.validity==null||this._startRefreshTimer(),this.emit("token-change")}destroy(){this.userId=this.server=this.token=this.expires=this.validity=this.resources=this.creationTime=null,this._oAuthCred&&(this._oAuthCred.destroy(),this._oAuthCred=null);const d=V,e=d.credentials.indexOf(this);e>-1&&d.credentials.splice(e,1),this.emitTokenChange(),this.emit("destroy")}toJSON(){const d=ae({userId:this.userId,server:this.server,token:this.token,expires:this.expires,validity:this.validity,ssl:this.ssl,isAdmin:this.isAdmin,creationTime:this.creationTime,scope:this.scope}),e=this.resources;return e&&e.length>0&&(d.resources=e.slice()),d}_startRefreshTimer(){clearTimeout(this._refreshTimer);const d=6e4*this.tokenRefreshBuffer,e=2**31-1;let s=(this.validity?this.creationTime+6e4*this.validity:this.expires)-Date.now();s<0?s=0:s>e&&(s=e),this._refreshTimer=setTimeout(this.refreshToken.bind(this),s>d?s-d:s)}};u([_()],I.prototype,"creationTime",void 0),u([_()],I.prototype,"expires",void 0),u([_()],I.prototype,"isAdmin",void 0),u([_()],I.prototype,"oAuthState",void 0),u([_()],I.prototype,"resources",void 0),u([_()],I.prototype,"scope",void 0),u([_()],I.prototype,"server",void 0),u([_()],I.prototype,"ssl",void 0),u([_()],I.prototype,"token",void 0),u([_()],I.prototype,"tokenRefreshBuffer",void 0),u([_()],I.prototype,"userId",void 0),u([_()],I.prototype,"validity",void 0),I=u([z("esri.identity.Credential")],I);class de extends ce{}de.prototype.declaredClass="esri.identity.IdentityManager";const Ae=new de;ue(Ae);export{Ae as default}; diff --git a/custom-toc-highlight/assets/ImageryLayer-B-bJb8lU-DAjXPfZr.js b/custom-toc-highlight/assets/ImageryLayer-B-bJb8lU-DBN_Mc6Q.js similarity index 96% rename from custom-toc-highlight/assets/ImageryLayer-B-bJb8lU-DAjXPfZr.js rename to custom-toc-highlight/assets/ImageryLayer-B-bJb8lU-DBN_Mc6Q.js index 95e75c55..227acdc3 100644 --- a/custom-toc-highlight/assets/ImageryLayer-B-bJb8lU-DAjXPfZr.js +++ b/custom-toc-highlight/assets/ImageryLayer-B-bJb8lU-DBN_Mc6Q.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./imageryUtils-6MVSqijr-B_Ii3EHZ.js","./utils-BVWK2jiA-Btpo3M9u.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./jsonContext-BA8GHqVk-CWQlLGSw.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./saveUtils-CIYk-dsQ-VGcOewby.js"])))=>i.map(i=>d[i]); -import{_ as $t}from"./main-ugzBrWNm.js";import{v as s,S as a,ac as I,i as R,aa as fe,e as F,w as V,J as re,bB as Le,aK as zt,af as ne,bH as ge,bI as et,bJ as tt,a0 as E,bK as Y,g as ee,bz as Ut,bp as Ht,W as Bt,o as b,bL as Qt,P as C,l as ut,n as Ee,G as kt,a as Wt,a1 as It,f as x,bM as pt,aO as M,ah as Kt,bi as Zt,bN as Xt,ab as Yt}from"./story-BfX8CRfG.js";import{m as er}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as tr}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{p as he,d as qe,M as H,k as S,J as rr,A as ir,l as sr,c as nr,u as nt,a as ar,E as Ft,P as or,V as lr,j as ur,v as pr,w as cr,S as mr,b as dr,f as yr,Z as hr}from"./RasterPresetRendererMixin-D6W9pUY6-DKpsAOdT.js";import{_ as gr,X as fr,E as wr,Z as Rr}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{E as at,z as vr,g as br,j as Sr}from"./multidimensionalUtils-BwTugeu7-BTG9Of02.js";import{n as xr,D as ot,R as Ir,x as Fr}from"./dataUtils-BkPy4R3C-Cb9EIxnj.js";import{W as Nt,K as _t,i as Ot,Y as Dr,B as Tr,a as Pr,t as jr,V as Dt,b as Nr,c as _r}from"./RasterSymbolizer-BVys6HkM-BrCOeMHl.js";import{G as Or}from"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{y as we}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{o as Cr}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{i as Tt}from"./imageBitmapUtils-DA36kg39-CZPhYtU7.js";import{B as xe}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{y as q,n as L,a as $}from"./utils-9sQxfkoa-KicvrT8N.js";import{s as Ar,b as lt}from"./Query-BrwMGK8U-DoFNfkjX.js";import{k as bt}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import{O as Ct}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{e as Vr,i as Mr}from"./executeForIds-Z1gkLduF-D8DZG8qZ.js";import{u as Jr}from"./executeQueryJSON-CcHnccia-BW7_NQxl.js";import{a as Er}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{u as qr}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as Gr}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{E as Lr}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as $r}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as zr}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as Ur}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{x as Hr}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{a as Br}from"./versionUtils-LZYZz-38-DxOZEoAg.js";import{w as Qr}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import{E as Ue}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./utils-DPtQ14k3-CAwuJg76.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./query-DFW9-NG_-gbjlxRZk.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";const kr={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:""}},Wr=new Set(["u1","u2","u4","u8","s8","u16","s16"]),Kr={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)"},Zr=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function At(i){return Zr.has(i.type)}function ct(i,t){if(!i||!t)return C(i||t);const o=C(i);if(o.functionDefinition&&t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=void 0),Vt(o.functionDefinition.arguments,t),o.rasterFunctionDefinition=o.functionDefinition.toJSON()}else t.functionName?.toLowerCase()!=="none"&&(Mt(o.functionArguments).Raster=t);return o}function Vt(i,t){for(const o in i)o.toLowerCase()==="raster"&&(i[o].type==="RasterFunctionVariable"?(i[o]=t.rasterFunctionDefinition,i[o].type="RasterFunctionTemplate"):i[o].type==="RasterFunctionTemplate"&&Vt(i[o].arguments,t))}function ie(i){const t=C(kr[i.functionName+"Function"]),o=i.functionArguments;for(const e in o)e.toLowerCase()==="raster"?(t.arguments[e]=ie(o[e]),t.arguments[e].type="RasterFunctionTemplate"):e.toLowerCase()==="colormap"?(t.arguments[e].value=ni(o[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=o[e];return t}function Xr(i,t){switch(t=t||{},i.type){case"raster-stretch":return ti(i,t);case"class-breaks":return ri(i,t);case"unique-value":return ii(i,t);case"raster-colormap":return si(i,t);case"vector-field":return Yr(i,t);case"raster-shaded-relief":return ei(i,t);case"flow":throw new Error("Unsupported rendering rule.")}}function Mt(i){const t=i?.Raster??i?.raster;return t&&t.declaredClass==="esri.layers.support.RasterFunction"?Mt(t.functionArguments):i}const Ce={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function Yr(i,t){const o=new S;o.functionName="VectorFieldRenderer";const{dataType:e,bandNames:r}=t,n=e==="vector-uv";let l,u;if(r&&r.length===2){const h=r.map(f=>f.toLowerCase());l=h.indexOf("magnitude"),u=h.indexOf("direction")}l!==-1&&l!==null||(l=0,u=1);const p=i.rotationType==="arithmetic"?1:2,m=i.flowRepresentation==="flow-from"?0:1,c=i.visualVariables?i.visualVariables.find(h=>h.field==="Magnitude"):new Or,d={magnitudeBandID:l,directionBandID:u,isUVComponents:n,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:Kr[i.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};o.functionArguments=d;const g=ie(o);return t.convertToRFT?S.fromJSON({rasterFunctionDefinition:g}):o}function ei(i,t){const o=t.convertToRFT;if(t.dataType!=="elevation"&&(t.dataType!=="generic"||t.bandCount!==1||t.pixelType!=="s16"&&t.pixelType!=="s32"&&t.pixelType!=="f32"&&t.pixelType!=="f64"))return new S;const e=new S;e.functionName="Hillshade";const r=i.hillshadeType==="traditional"?0:1,n=i.scalingType==="none"?1:3,l={HillshadeType:r,SlopeType:n,ZFactor:i.zFactor};return r===0&&(l.Azimuth=i.azimuth,l.Altitude=i.altitude),n===3&&(l.PSPower=i.pixelSizePower,l.PSZFactor=i.pixelSizeFactor),e.functionArguments=l,e.variableName="Raster",i.colorRamp&&(e.functionName="ShadedRelief",o?l.ColorRamp=_t(i.colorRamp):l.Colormap=Ot(i.colorRamp)),o?new S({rasterFunctionDefinition:ie(e)}):e}function ti(i,t){const o=t.convertToRFT,e=new S;e.functionName="Stretch";const r=Ce[Dr.toJSON(i.stretchType)],n="u8",l=i.customStatistics?.map(p=>[p.min,p.max,p.avg??0,p.stddev??1]),u={StretchType:r,Statistics:l,DRA:i.dynamicRangeAdjustment,UseGamma:i.useGamma,Gamma:i.gamma,ComputeGamma:i.computeGamma};if(i.outputMin!=null&&(u.Min=i.outputMin),i.outputMax!=null&&(u.Max=i.outputMax),r===Ce.standardDeviation?(u.NumberOfStandardDeviations=i.numberOfStandardDeviations,e.outputPixelType=n):r===Ce.percentClip?(u.MinPercent=i.minPercent,u.MaxPercent=i.maxPercent,e.outputPixelType=n):r===Ce.minMax?e.outputPixelType=n:r===Ce.sigmoid&&(u.SigmoidStrengthLevel=i.sigmoidStrengthLevel),e.functionArguments=u,e.variableName="Raster",i.colorRamp){const p=i.colorRamp,m=new S;if(o)m.functionArguments={ColorRamp:_t(p)};else{const c=Tr(p,!0);if(c)m.functionArguments={colorRampName:c};else if(!t.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=i.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&d.colorRamps?.length&&d.colorRamps.forEach(g=>g.algorithm=g.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:Ot(p)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,o?new S({rasterFunctionDefinition:ie(m)}):m}return o?new S({rasterFunctionDefinition:ie(e)}):e}function ri(i,t){const o=[],e=[],r=[],n=[],{pixelType:l,rasterAttributeTable:u}=t,p=u==null?null:u.features,m=Jt(u);if(m&&p&&Array.isArray(p)&&i.classBreakInfos){i.classBreakInfos.forEach((y,v)=>{const w=y.symbol?.color;let T;w?.a&&y.minValue!=null&&y.maxValue!=null&&p.forEach(j=>{y.minValue!=null&&y.maxValue!=null&&(T=j.attributes[i.field],(T>=y.minValue&&T=y.minValue)&&n.push([j.attributes[m],w.r,w.g,w.b]))})});const h=l?rt(n,l):n,f=new S;return f.functionName="Colormap",f.functionArguments={},f.functionArguments.Colormap=h,f.variableName="Raster",t.convertToRFT?new S({rasterFunctionDefinition:ie(f)}):f}i.classBreakInfos.forEach((h,f)=>{if(h.minValue==null||h.maxValue==null)return;const y=h.symbol&&h.symbol.color;y?.a?(f===0?o.push(h.minValue,h.maxValue+1e-4):o.push(h.minValue+1e-4,h.maxValue+1e-4),e.push(f),n.push([f,y.r,y.g,y.b])):r.push(h.minValue,h.maxValue)});const c=l?rt(n,l):n,d=new S;d.functionName="Remap",d.functionArguments={InputRanges:o,OutputValues:e,NoDataRanges:r},d.variableName="Raster";const g=new S;return g.functionName="Colormap",g.functionArguments={Colormap:c,Raster:d},t.convertToRFT?new S({rasterFunctionDefinition:ie(g)}):g}function rt(i,t){const o=Wr.has(t)?xr(t):null;return o&&i.push([Math.floor(o[0]-1),0,0,0],[Math.ceil(o[1]+1),0,0,0]),i}function Jt(i){if(i==null)return;const{fields:t}=i;return t?.find(o=>o?.name&&o.name.toLowerCase()==="value")?.name}function ii(i,t){const o=[],{pixelType:e,rasterAttributeTable:r}=t,n=r==null?null:r.features,l=Jt(r),u=i.defaultSymbol?.color?.toRgb(),p=i.uniqueValueInfos;if(p)if(n){if(l){const d=new Map;p.forEach(h=>{const f=h.value,y=Pt(h);f!=null&&y?.a&&d.set(String(f),y.toRgb())});const g=i.field;g&&n.forEach(({attributes:h})=>{const f=String(h[g]),y=h[l],v=d.get(f);v?o.push([y,...v]):u&&o.push([y,...u])})}}else for(let d=0;dt.type==="fill")?.material?.color:i.symbol?.color}function si(i,t){const o=i.extractColormap();if(!o||o.length===0)return null;const{pixelType:e}=t,r=e?rt(o,e):o,n=new S;return n.functionName="Colormap",n.functionArguments={},n.functionArguments.Colormap=r,t.convertToRFT?new S({rasterFunctionDefinition:ie(n)}):n}function ni(i){const t=[],o=[];return i.forEach(e=>{t.push(e[0]),o.push(Pr([...e.slice(1),255]))}),{type:"RasterColormap",values:t,colors:o}}let _=class extends F{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(i,t,o){this.layer.version<10.3||(t[o]=i)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(i,t,o){this.format&&this.format.toLowerCase().includes("jpg")&&i!=null&&(t[o]=i)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(i,t,o){this.format==="lerc"&&i!=null&&(t[o]=i)}get format(){return this.layer.renderer?.type==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(i,t,o){this.format==="lerc"&&this.layer.version>=10.5&&(t[o]=i)}get version(){const i=this.layer;return i.commitProperty("bandIds"),i.commitProperty("format"),i.commitProperty("compressionQuality"),i.commitProperty("compressionTolerance"),i.commitProperty("interpolation"),i.commitProperty("noData"),i.commitProperty("noDataInterpretation"),i.commitProperty("mosaicRule"),i.commitProperty("rasterFunction"),i.commitProperty("adjustAspectRatio"),i.commitProperty("pixelFilter"),i.commitProperty("definitionExpression"),i.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(i){this._set("version",i)}get mosaicRule(){const i=this.layer;let t=i.mosaicRule;const o=i.definitionExpression;return t?o&&o!==t.where&&(t=t.clone(),t.where=o):o&&(t=new H({where:o})),t}get rasterFunction(){const i=this.layer;let{rasterFunction:t}=i;const o=i.pixelFilter,e=!i.format||i.format.includes("jpg")||i.format.includes("png");t=this._addResampleRasterFunction(t);const r=i.multidimensionalSubset?.areaOfInterest;return r&&(t=ai(t,r)),e&&!o&&i.renderer?.type!=="vector-field"&&(t=this.combineRendererWithRenderingRule(t)),t}combineRendererWithRenderingRule(i){const t=this.layer,{rasterInfo:o,renderer:e}=t;return i=i||t.rasterFunction,!e||!At(e)?i:ct(Xr(e,{rasterAttributeTable:o.attributeTable,pixelType:o.pixelType,dataType:o.dataType,bandNames:o.bandInfos.map(({name:r})=>r),convertColorRampToColormap:t.version<10.6,convertToRFT:!!i?.rasterFunctionDefinition,bandCount:o.bandCount}),i)}_addResampleRasterFunction(i){if(this.layer.renderer?.type!=="vector-field"||i?.functionName==="Resample")return i;const t=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,o=this.layer.serviceRasterInfo.pixelSize;let e=new S({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:o}});return e=i?.rasterFunctionDefinition?new S({rasterFunctionDefinition:ie(e)}):e,ct(e,i)}};function ai(i,t){const o=new S({functionName:"Clip",functionArguments:{ClippingGeometry:t.toJSON(),ClippingType:1}});return ct(o,i)}s([a()],_.prototype,"layer",void 0),s([a({json:{write:!0}})],_.prototype,"adjustAspectRatio",null),s([I("adjustAspectRatio")],_.prototype,"writeAdjustAspectRatio",null),s([a({json:{write:!0}})],_.prototype,"bandIds",null),s([a({json:{write:!0}})],_.prototype,"compression",void 0),s([a({json:{write:!0}})],_.prototype,"compressionQuality",null),s([I("compressionQuality")],_.prototype,"writeCompressionQuality",null),s([a({json:{write:!0}})],_.prototype,"compressionTolerance",null),s([I("compressionTolerance")],_.prototype,"writeCompressionTolerance",null),s([a({json:{write:!0}})],_.prototype,"format",null),s([a({type:String,json:{read:{reader:he.read},write:{writer:he.write}}})],_.prototype,"interpolation",null),s([a({json:{write:!0}})],_.prototype,"noData",null),s([a({type:String,json:{read:{reader:qe.read},write:{writer:qe.write}}})],_.prototype,"noDataInterpretation",null),s([a({json:{write:!0}})],_.prototype,"pixelType",void 0),s([a({json:{write:!0}})],_.prototype,"lercVersion",void 0),s([I("lercVersion")],_.prototype,"writeLercVersion",null),s([a({type:Number})],_.prototype,"version",null),s([a({json:{write:!0}})],_.prototype,"mosaicRule",null),s([a({json:{write:!0,name:"renderingRule"}})],_.prototype,"rasterFunction",null),_=s([R("esri.layers.support.ExportImageServiceParameters")],_);let ce=class extends fe(F){constructor(){super(...arguments),this.fromGeometry=null,this.toGeometry=null,this.objectIds=null,this.where=null,this.maxCount=null}};s([a({type:V,json:{read:!0}})],ce.prototype,"fromGeometry",void 0),s([a({type:V,json:{read:!0,write:!0}})],ce.prototype,"toGeometry",void 0),s([a({json:{write:!0}})],ce.prototype,"objectIds",void 0),s([a({type:String,json:{write:!0}})],ce.prototype,"where",void 0),s([a({type:Number,json:{write:!0}})],ce.prototype,"maxCount",void 0),ce=s([R("esri.rest.support.FindImagesParameters")],ce);const oi=ce,Et=i=>{let t=class extends i{constructor(){super(...arguments),this.make=null,this.model=null,this.focalLength=null,this.pixelSize=null,this.rows=null,this.cols=null}};return s([a({json:{write:!0}})],t.prototype,"make",void 0),s([a({json:{write:!0}})],t.prototype,"model",void 0),s([a({json:{write:!0}})],t.prototype,"focalLength",void 0),s([a({json:{write:!0}})],t.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],t.prototype,"rows",void 0),s([a({json:{write:!0}})],t.prototype,"cols",void 0),t=s([R("esri.rest.support.CameraInfoMixin")],t),t};let W=class extends Et(F){constructor(){super(...arguments),this.id=null,this.referenceUri=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.perspectiveCenter=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],W.prototype,"id",void 0),s([a({json:{name:"uri",write:!0}})],W.prototype,"referenceUri",void 0),s([a({type:Date,json:{write:!0}})],W.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],W.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],W.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"center",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"perspectiveCenter",void 0),s([a({json:{write:!0}})],W.prototype,"orientation",void 0),W=s([R("esri.rest.support.ImageInspectionInfo")],W);const li=W;let He=class extends F{constructor(){super(...arguments),this.images=null}};s([a({type:[li],json:{write:!0}})],He.prototype,"images",void 0),He=s([R("esri.rest.support.FindImagesResult")],He);const ui=He;var mt;let Re=mt=class extends F{constructor(i){super(i),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new mt(C({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};s([a({type:[String],json:{name:"angleName",write:!0}})],Re.prototype,"angleNames",void 0),s([a({type:V,json:{write:!0}})],Re.prototype,"point",void 0),s([a({type:re,json:{write:!0}})],Re.prototype,"spatialReference",void 0),s([a({type:Le,json:{write:!0}})],Re.prototype,"rasterId",void 0),Re=mt=s([R("esri.rest.support.ImageAngleParameters")],Re);const pi=Re;let Fe=class extends F{constructor(i){super(i),this.north=null,this.up=null,this.spatialReference=null}};s([a({type:Number,json:{write:!0}})],Fe.prototype,"north",void 0),s([a({type:Number,json:{write:!0}})],Fe.prototype,"up",void 0),s([a({type:re,json:{write:!0}})],Fe.prototype,"spatialReference",void 0),Fe=s([R("esri.rest.support.ImageAngleResult")],Fe);const ci=Fe,B=new zt({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let X=class extends F{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};s([a()],X.prototype,"type",void 0),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],X.prototype,"measureOperation",void 0),s([a({type:H,json:{write:!0}})],X.prototype,"mosaicRule",void 0),s([a({type:V,json:{write:!0}})],X.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],X.prototype,"raster",void 0),X=s([R("esri.rest.support.BaseImageMeasureParameters")],X);var dt;let ae=dt=class extends X{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new dt(C({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:!0,write:!0}})],ae.prototype,"geometry",void 0),s([I("geometry")],ae.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{write:B.write}})],ae.prototype,"measureOperation",null),s([a({json:{read:!0}})],ae.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],ae.prototype,"linearUnit",void 0),s([a({type:String,json:{read:et.read,write:et.write}})],ae.prototype,"areaUnit",void 0),ae=dt=s([R("esri.rest.support.ImageAreaParameters")],ae);const mi=ae;let de=class extends F{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"value",void 0),s([a({type:String,json:{read:!0,write:!0}})],de.prototype,"displayValue",void 0),s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"uncertainty",void 0),de=s([R("esri.rest.support.BaseImageMeasureResult.BaseImageMeasureResultValue")],de);let Ne=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:ge.read,write:ge.write}})],Ne.prototype,"unit",void 0),Ne=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultLengthValue")],Ne);let Be=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:et.read,write:et.write}})],Be.prototype,"unit",void 0),Be=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAreaValue")],Be);let Ge=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:tt.read,write:tt.write}})],Ge.prototype,"unit",void 0),Ge=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAngleValue")],Ge);let ye=class extends F{constructor(){super(...arguments),this.name=null,this.sensorName=null}};s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"name",void 0),s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"sensorName",void 0),ye=s([R("esri.rest.support.BaseImageMeasureResult")],ye);let Ae=class extends ye{constructor(){super(...arguments),this.area=null,this.perimeter=null}};s([a({type:Be,json:{read:!0,write:!0}})],Ae.prototype,"area",void 0),s([a({type:Ne,json:{read:!0,write:!0}})],Ae.prototype,"perimeter",void 0),Ae=s([R("esri.rest.support.ImageAreaResult")],Ae);const di=Ae;let Qe=class extends fe(F){constructor(){super(...arguments),this.outSpatialReference=null}};s([a({type:re,json:{name:"outSR",write:!0}})],Qe.prototype,"outSpatialReference",void 0),Qe=s([R("esri.rest.support.ImageBoundaryParameters")],Qe);const yi=Qe;let De=class extends F{constructor(){super(...arguments),this.area=null,this.geometry=null}readGeometry(i,t){return i==null?null:i.rings?ut.fromJSON(i):Ee.fromJSON(i)}};s([a({type:Number,json:{write:!0}})],De.prototype,"area",void 0),s([a({json:{name:"shape",write:!0}})],De.prototype,"geometry",void 0),s([E("geometry")],De.prototype,"readGeometry",null),De=s([R("esri.rest.support.ImageBoundaryResult")],De);const hi=De;var yt;let te=yt=class extends X{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new yt(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"fromGeometry",void 0),s([I("fromGeometry")],te.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],te.prototype,"measureOperation",null),s([a({json:{read:!0}})],te.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],te.prototype,"linearUnit",void 0),s([a({type:String,json:{read:tt.read,write:tt.write}})],te.prototype,"angularUnit",void 0),te=yt=s([R("esri.rest.support.ImageDistanceParameters")],te);const gi=te;let Te=class extends ye{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};s([a({type:Ne,json:{read:!0,write:!0}})],Te.prototype,"distance",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"azimuthAngle",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"elevationAngle",void 0),Te=s([R("esri.rest.support.ImageDistanceResult")],Te);const fi=Te;let oe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.objectIds=null,this.spatialRelationship="intersects",this.timeExtent=null,this.where=null}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}};s([a({types:ne,json:{read:ee,write:!0}})],oe.prototype,"geometry",void 0),s([I("geometry")],oe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],oe.prototype,"objectIds",void 0),s([Ut(Ar,{ignoreUnknown:!1,name:"spatialRel"})],oe.prototype,"spatialRelationship",void 0),s([a({type:bt,json:{name:"time",write:!0}})],oe.prototype,"timeExtent",void 0),s([a({type:String,json:{write:!0}})],oe.prototype,"where",void 0),oe=s([R("esri.rest.support.ImageGPSInfoParameters")],oe);const wi=oe;let ke=class extends Et(F){constructor(){super(...arguments),this.id=null}};s([a({json:{write:!0}})],ke.prototype,"id",void 0),ke=s([R("esri.rest.support.CameraInfo")],ke);const Ri=ke;let K=class extends F{constructor(){super(...arguments),this.id=null,this.name=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.gps=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],K.prototype,"id",void 0),s([a({json:{write:!0}})],K.prototype,"name",void 0),s([a({type:Date,json:{write:!0}})],K.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],K.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],K.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],K.prototype,"center",void 0),s([a({json:{write:!0}})],K.prototype,"gps",void 0),s([a({json:{write:!0}})],K.prototype,"orientation",void 0),K=s([R("esri.rest.support.ImageGPSInfo")],K);const vi=K;let Ve=class extends F{constructor(){super(...arguments),this.images=null,this.cameras=null}};s([a({type:[vi],json:{write:!0}})],Ve.prototype,"images",void 0),s([a({type:[Ri],json:{write:!0}})],Ve.prototype,"cameras",void 0),Ve=s([R("esri.rest.support.ImageGPSInfoResult")],Ve);const bi=Ve;var ht;let le=ht=class extends X{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.operationType}clone(){return new ht(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0}})],le.prototype,"fromGeometry",void 0),s([I("fromGeometry")],le.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],le.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],le.prototype,"measureOperation",null),s([a({json:{read:!0}})],le.prototype,"operationType",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],le.prototype,"linearUnit",void 0),le=ht=s([R("esri.rest.support.ImageHeightParameters")],le);const Si=le;let We=class extends ye{constructor(){super(...arguments),this.height=null}};s([a({type:Ne,json:{read:!0,write:!0}})],We.prototype,"height",void 0),We=s([R("esri.rest.support.ImageHeightResult")],We);const xi=We;var gt;let O=gt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=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(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}set mosaicRule(i){let t=i;t?.mosaicMethod&&(t=H.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON()))}set rasterFunction(i){let t=i;t?.rasterFunction&&(t=S.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}writeRasterFunction(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON())),i.rasterFunctionDefinition&&(t[o]=JSON.stringify(i.rasterFunctionDefinition))}writeRasterFunctions(i,t,o){i!=null&&(t[o]=JSON.stringify(i.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(i,t,o){i!=null&&(t[o]=JSON.stringify(i))}writeTimeExtent(i,t,o){if(i!=null){const e=i.start!=null?i.start.getTime():null,r=i.end!=null?i.end.getTime():null;t[o]=e!=null?r!=null?`${e},${r}`:`${e}`:null}}clone(){return new gt(C({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,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}))}};s([a({json:{write:!0}})],O.prototype,"geometry",void 0),s([I("geometry")],O.prototype,"writeGeometry",null),s([a({type:H,json:{write:!0}})],O.prototype,"mosaicRule",null),s([I("mosaicRule")],O.prototype,"writeMosaicRule",null),s([a({type:S,json:{write:!0,name:"renderingRule"}})],O.prototype,"rasterFunction",null),s([I("rasterFunction")],O.prototype,"writeRasterFunction",null),s([a({type:[S],json:{write:!0,name:"renderingRules"}})],O.prototype,"rasterFunctions",void 0),s([I("rasterFunctions")],O.prototype,"writeRasterFunctions",null),s([a({type:V,json:{write:!0}})],O.prototype,"pixelSize",void 0),s([I("pixelSize")],O.prototype,"writePixelSize",null),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnGeometry",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnCatalogItems",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnPixelValues",void 0),s([a({type:Number,json:{write:!0}})],O.prototype,"maxItemCount",void 0),s([a({type:bt,json:{write:{target:"time"}}})],O.prototype,"timeExtent",void 0),s([I("timeExtent")],O.prototype,"writeTimeExtent",null),s([a({json:{write:!0}})],O.prototype,"raster",void 0),s([a({json:{write:!0}})],O.prototype,"viewId",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"processAsMultidimensional",void 0),O=gt=s([R("esri.rest.support.ImageIdentifyParameters")],O);const qt=O;let Z=class extends F{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}};s([a({json:{write:!0}})],Z.prototype,"catalogItemVisibilities",void 0),s([a({type:Ct,json:{write:!0}})],Z.prototype,"catalogItems",void 0),s([a({type:V,json:{write:!0}})],Z.prototype,"location",void 0),s([a({json:{write:!0}})],Z.prototype,"name",void 0),s([a({json:{write:!0}})],Z.prototype,"objectId",void 0),s([a({json:{write:!0}})],Z.prototype,"processedValues",void 0),s([a({json:{write:!0}})],Z.prototype,"properties",void 0),s([a({json:{write:!0}})],Z.prototype,"value",void 0),Z=s([R("esri.rest.support.ImageIdentifyResult")],Z);const Ii=Z;var ft;let Pe=ft=class extends F{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(i,t,o){t.geometries={geometryType:"esriGeometryPoint",geometries:i.map(e=>e.toJSON())}}clone(){return new ft({geometries:this.geometries?.map(i=>i.clone())??[],rasterId:this.rasterId})}};s([a({type:[V],json:{write:!0}})],Pe.prototype,"geometries",void 0),s([I("geometries")],Pe.prototype,"writeGeometry",null),s([a({type:Le,json:{write:!0}})],Pe.prototype,"rasterId",void 0),Pe=ft=s([R("esri.rest.support.ImagePixelLocationParameters")],Pe);const Fi=Pe;let Ke=class extends F{constructor(){super(...arguments),this.geometries=null}};s([a({json:{write:!0}})],Ke.prototype,"geometries",void 0),Ke=s([R("esri.rest.support.ImagePixelLocationResult")],Ke);const Di=Ke;var wt;let ve=wt=class extends X{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){const{is3D:i,geometry:t}=this;return t.type==="point"?i?"point-3D":"point":i?"centroid-3D":"centroid"}clone(){return new wt(C({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:ee}})],ve.prototype,"geometry",void 0),s([I("geometry")],ve.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],ve.prototype,"measureOperation",null),s([a({json:{read:!0}})],ve.prototype,"is3D",void 0),ve=wt=s([R("esri.rest.support.ImagePointParameters")],ve);const Ti=ve;let Ze=class extends ye{constructor(){super(...arguments),this.point=null}};s([a({type:V,json:{name:"point.value",read:!0,write:!0}})],Ze.prototype,"point",void 0),Ze=s([R("esri.rest.support.ImagePointResult")],Ze);const Pi=Ze;var Rt;let G=Rt=class extends F{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(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}set locations(i){if(i?.length){const t=new kt({spatialReference:i[0].spatialReference,points:i.map(({x:o,y:e})=>[o,e])});this._set("locations",i),this.geometry=t}}clone(){return new Rt(C({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}))}};s([a({types:ne,json:{read:ee}})],G.prototype,"geometry",void 0),s([I("geometry")],G.prototype,"writeGeometry",null),s([a()],G.prototype,"locations",null),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],G.prototype,"interpolation",void 0),s([a({type:H,json:{write:!0}})],G.prototype,"mosaicRule",void 0),s([a({type:[String],json:{write:!0}})],G.prototype,"outFields",void 0),s([a({type:V,json:{write:!0}})],G.prototype,"pixelSize",void 0),s([a({type:String,json:{write:!0}})],G.prototype,"raster",void 0),s([a({type:Boolean,json:{write:!0}})],G.prototype,"returnFirstValueOnly",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleDistance",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleCount",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sliceId",void 0),s([a({type:bt,json:{read:{source:"time"},write:{target:"time"}}})],G.prototype,"timeExtent",void 0),G=Rt=s([R("esri.rest.support.ImageSampleParameters")],G);const ji=G;let ue=class extends F{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};s([a({json:{write:!0}})],ue.prototype,"attributes",void 0),s([a({type:V,json:{write:!0}})],ue.prototype,"location",void 0),s([a({json:{write:!0}})],ue.prototype,"locationId",void 0),s([a({json:{write:!0}})],ue.prototype,"rasterId",void 0),s([a({json:{write:!0}})],ue.prototype,"resolution",void 0),s([a({json:{write:!0}})],ue.prototype,"pixelValue",void 0),ue=s([R("esri.rest.support.ImageSample")],ue);const Ni=ue;let Xe=class extends F{constructor(){super(...arguments),this.samples=null}};s([a({type:[Ni],json:{write:!0}})],Xe.prototype,"samples",void 0),Xe=s([R("esri.rest.support.ImageSampleResult")],Xe);const _i=Xe;let be=class extends fe(F){constructor(){super(...arguments),this.geometries=[],this.rasterIds=null,this.outSpatialReference=null}writeGeometries(i,t,o){t.geometries=i?.length?{geometryType:Y(i[0]),geometries:i.map(e=>({...e.toJSON(),spatialReference:void 0}))}:null}};s([a({types:[ne]})],be.prototype,"geometries",void 0),s([I("geometries")],be.prototype,"writeGeometries",null),s([a({type:[Le],json:{write:!0}})],be.prototype,"rasterIds",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],be.prototype,"outSpatialReference",void 0),be=s([R("esri.rest.support.ImageToMapMultirayParameters")],be);const Oi=be;let pe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.outSpatialReference=null,this.depthOffset=0,this.adjust=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}};s([a({types:ne,json:{read:ee,write:!0}})],pe.prototype,"geometry",void 0),s([I("geometry")],pe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],pe.prototype,"rasterId",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],pe.prototype,"outSpatialReference",void 0),s([a({json:{name:"options.DOff",write:!0}})],pe.prototype,"depthOffset",void 0),s([a({json:{name:"options.Adjust",write:!0}})],pe.prototype,"adjust",void 0),pe=s([R("esri.rest.support.ImageToMapParameters")],pe);const Ci=pe;let Me=class extends fe(F){constructor(){super(...arguments),this.referenceUri=null,this.rasterId=null}};s([a({type:String,json:{name:"uri",write:!0}})],Me.prototype,"referenceUri",void 0),s([a({type:Number,json:{write:!0}})],Me.prototype,"rasterId",void 0),Me=s([R("esri.rest.support.ImageUrlParameters")],Me);const Ai=Me;let Ye=class extends F{constructor(){super(...arguments),this.url=null}};s([a({json:{name:"imageURL",write:!0}})],Ye.prototype,"url",void 0),Ye=s([R("esri.rest.support.ImageUrlResult")],Ye);const Vi=Ye;let Se=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.visibleOnly=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i))}};s([a({types:ne,json:{read:ee,write:!0}})],Se.prototype,"geometry",void 0),s([I("geometry")],Se.prototype,"writeGeometry",null),s([a({json:{write:!0}})],Se.prototype,"rasterId",void 0),s([a({json:{name:"options.VisibleOnly",write:!0}})],Se.prototype,"visibleOnly",void 0),Se=s([R("esri.rest.support.MapToImageParameters")],Se);const Mi=Se;let me=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null,this.area=null,this.center=null}readCenter(i,t){return i.spatialReference||(i={...i,spatialReference:t.Shape.spatialReference}),V.fromJSON(i)}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],me.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],me.prototype,"length",void 0),s([a({json:{name:"Area",write:!0}})],me.prototype,"area",void 0),s([a({json:{name:"Center",write:!0}})],me.prototype,"center",void 0),s([E("center")],me.prototype,"readCenter",null),me=s([R("esri.rest.support.MeasureAreaFromImageResult")],me);const Ji=me;var vt;let je=vt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterId=void 0}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}clone(){const i=C({geometry:this.geometry,rasterId:this.rasterId});return new vt(i)}};s([a({types:ne,json:{name:"fromGeometry",read:ee,write:!0}})],je.prototype,"geometry",void 0),s([I("geometry")],je.prototype,"writeGeometry",null),s([a({json:{write:!0}})],je.prototype,"rasterId",void 0),je=vt=s([R("esri.rest.support.MeasureFromImageParameters")],je);const Ei=je;let Je=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],Je.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],Je.prototype,"length",void 0),Je=s([R("esri.rest.support.MeasureLengthFromImageResult")],Je);const qi=Je;function St(i){const t=i?.time;if(t&&(t.start!=null||t.end!=null)){const o=[];t.start!=null&&o.push(t.start),t.end==null||o.includes(t.end)||o.push(t.end),i.time=o.join(",")}}async function Gt(i,t,o){t=M(hr,t);const e=q(i),r=t.geometry?[t.geometry]:[],n=await xe(r),l=t.toJSON();St(l);const u=n?.[0];u!=null&&(l.geometry=se(u));const p=L({...e.query,f:"json",...l});return $(p,o)}async function Gi(i,t,o){const e=(t=M(pi,t)).toJSON();e.angleName!=null&&(e.angleName=e.angleName.join(",")),t?.point?.spatialReference?.imageCoordinateSystem&&(e.point.spatialReference=st(t.point.spatialReference)),t?.spatialReference?.imageCoordinateSystem&&(e.spatialReference=_e(t.spatialReference));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/computeAngles`,l);return u.spatialReference=u.spatialReference?u.spatialReference.geodataXform!=null?new re({wkid:0,imageCoordinateSystem:u.spatialReference}):re.fromJSON(u.spatialReference):null,u.north==="NaN"&&(u.north=null),u.up==="NaN"&&(u.up=null),new ci(u)}async function Li(i,t,o){const e=(t=M(Fi,t)).toJSON(),{geometries:r}=t;if(r)for(let m=0;m{u.avg=u.mean,u.stddev=u.standardDeviation}),{statistics:l,histograms:n.histograms}}async function zi(i,t,o){const e=await Gt(i,t,o),r=q(i),{data:n}=await x(`${r.path}/computeHistograms`,e);return{histograms:n.histograms}}async function Ui(i,t,o){const e=(t=M(ji,t)).toJSON();St(e),e.outFields?.length&&(e.outFields=e.outFields.join(","));const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=q(i),u=L({...l.query,f:"json",...e}),p=$(u,o),{data:m}=await x(`${l.path}/getSamples`,p),c=m?.samples?.map(d=>{const g=d.value==="NaN"||d.value===""?null:d.value.split(" ").map(h=>Number(h));return{...d,pixelValue:g}});return _i.fromJSON({samples:c})}async function jt(i,t,o){t=M(qt,t);const e=q(i),r=t.geometry?[t.geometry]:[];return xe(r).then(n=>{const l=t.toJSON(),u=n?.[0];u!=null&&(l.geometry=JSON.stringify(se(u)));const p=L({...e.query,f:"json",...l}),m=$(p,o);return x(e.path+"/identify",m)}).then(n=>Ii.fromJSON(n.data))}async function Hi(i,t,o){t=M(Si,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return xi.fromJSON(e)}async function Bi(i,t,o){t=M(mi,t);const e=await it(i,t,[t.geometry],o);return di.fromJSON(e)}async function Qi(i,t,o){t=M(Ti,t);const e=await it(i,t,[t.geometry],o);return Pi.fromJSON(e)}async function ki(i,t,o){t=M(gi,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return fi.fromJSON(e)}async function it(i,t,o,e){const r=q(i),n=await xe(o),l=t.toJSON();n[0]!=null&&(l.fromGeometry=JSON.stringify(se(n[0]))),n[1]!=null&&(l.toGeometry=JSON.stringify(se(n[1])));const u=L({...r.query,f:"json",...l}),p=$(u,e),{data:m}=await x(r.path+"/measure",p);return m}async function Wi(i,t,o){const e=await Lt(i,t,o);return qi.fromJSON(e)}async function Ki(i,t,o){const e=await Lt(i,t,o);return Ji.fromJSON(e)}async function Lt(i,t,o){t=M(Ei,t);const e=q(i),r=t.toJSON(),n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/measureFromImage",l);return u}function se(i){const t=i.toJSON();return i.spatialReference?.imageCoordinateSystem&&(t.spatialReference=st(i.spatialReference)),t}function st(i){const{imageCoordinateSystem:t}=i;if(t){const{id:o,referenceServiceName:e}=t;return o!=null?e?{icsid:o,icsns:e}:{icsid:o}:{ics:t}}return i.toJSON()}function _e(i,t){if(!i.imageCoordinateSystem)return pt(i);const o=st(i),{icsid:e,icsns:r}=o;return e==null||r!=null&&!t?.toLowerCase().includes("/"+r.toLowerCase()+"/")?JSON.stringify(o):`0:${e}`}async function Zi(i,t,o){t=M(yi,t);const e=q(i),r=t.toJSON();t.outSpatialReference&&(r.outSR=_e(t.outSpatialReference));const n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/queryBoundary",l);return hi.fromJSON(u)}async function Xi(i,t,o){const e=(t=M(wi,t)).toJSON();St(e),e.objectIds?.length&&(e.objectIds=e.objectIds.join(",")),e.geometry||e.objectIds||e.time||e.where||(e.where="1=1");const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/queryGPSInfo`,m);return bi.fromJSON(c)}async function Yi(i,t,o){const e=(t=M(Ci,t)).toJSON();t.geometry.spatialReference.imageCoordinateSystem&&(e.geometry=se(t.geometry)),t.depthOffset&&t.adjust||delete e.options;const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMap`,l);return ee(u)}async function es(i,t,o){const e=(t=M(Oi,t)).toJSON();t.rasterIds?.length&&(e.rasterIds=t.rasterIds.join(","));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMapMultiray`,l);return ee(u)}async function ts(i,t,o){const e=(t=M(Mi,t)).toJSON(),r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n)),t.visibleOnly||delete e.options;const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/mapToImage`,m);return ee(c)}async function rs(i,t,o){const e=(t=M(Ai,t)).toJSON(),r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/getImageUrl`,l);return Vi.fromJSON(u)}async function is(i,t,o){const e=(t=M(oi,t)).toJSON(),r=await xe([t.fromGeometry,t.toGeometry]);r[0]!=null&&(e.fromGeometry=se(r[0]),r[0].spatialReference&&(e.inSR=_e(r[0].spatialReference))),r[1]!=null&&(e.toGeometry=se(r[1])),t.objectIds?.length&&(e.objectIds=e.objectIds.join(","));const n=q(i),l=L({...n.query,f:"json",...e}),u=$(l,o),{data:p}=await x(`${n.path}/find`,u);return ui.fromJSON(p)}async function ss(i,t,o){const e=q(i),r=L({...e?.query,f:"json"}),n=$(r,o),l=`${e?.path}/${t}/info`,u=x(`${l}`,n),p=x(`${l}/keyProperties`,n),m=await Promise.allSettled([u,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let g=null;c.statistics?.length&&(g=c.statistics.map(J=>({min:J[0],max:J[1],avg:J[2],stddev:J[3]})));const h=Ee.fromJSON(c.extent),f=Math.ceil(h.width/c.pixelSizeX-.1),y=Math.ceil(h.height/c.pixelSizeY-.1),v=h.spatialReference,w=new V({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:v}),T=c.histograms?.length?c.histograms:null,j=new _r({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new Nt({width:f,height:y,bandCount:c.bandCount,extent:h,spatialReference:v,pixelSize:w,pixelType:c.pixelType.toLowerCase(),statistics:g,histograms:T,keyProperties:d,storageInfo:j})}const ns=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),as=Xt(Yt,{min:0,max:255});function os(i){const t=JSON.stringify(i),o=t.includes('"rasterFunctionDefinition":{'),e=o?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi),r=e?.map(n=>o?n.slice(8,-18):n.slice(18,-1));return r?r.join("/"):null}const ls=i=>{let t=class extends i{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.multidimensionalInfo=null,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 _({layer:this}))}readServiceSupportsMosaicRule(e,r){return this._isMosaicRuleSupported(r)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(r=>{e.set(r.name.toLowerCase().replaceAll(/ /gi,"_"),r.name)}),e}readBandIds(e,r){if(Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="number"))return e}readCapabilities(e,r){return this._readCapabilities(r)}writeCompressionQuality(e,r,n){e!=null&&this.format!=="lerc"&&(r[n]=e)}writeCompressionTolerance(e,r,n){this.format==="lerc"&&e!=null&&(r[n]=e)}readDefaultMosaicRule(e,r){return this._serviceSupportsMosaicRule?H.fromJSON(r):null}get fieldsIndex(){return this.fields?new Cr(this.fields):null}set format(e){e&&ns.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,r){return r.serviceDataType==="esriImageServiceDataTypeVector-UV"||r.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}readMaxScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}set mosaicRule(e){let r=e;r?.mosaicMethod&&(r=H.fromJSON({...r.toJSON(),mosaicMethod:r.mosaicMethod,mosaicOperation:r.mosaicOperation})),this._set("mosaicRule",r)}readMosaicRule(e,r){const n=e||r.mosaicRule;return n?H.fromJSON(n):this._isMosaicRuleSupported(r)?H.fromJSON(r):null}writeMosaicRule(e,r,n){let l=this.mosaicRule;const u=this.definitionExpression;l?u&&u!==l.where&&(l=l.clone(),l.where=u):u&&(l=new H({where:u})),this._isValidCustomizedMosaicRule(l)&&(r[n]=l.toJSON())}writeNoData(e,r,n){e!=null&&typeof e=="number"&&(r[n]=as(e))}readObjectIdField(e,r){return e||(e=r.fields.find(n=>n.type==="esriFieldTypeOID"||n.type==="oid")?.name),e}get parsedUrl(){return Wt(this.url)}readSourceType(e,r){return this._isMosaicDataset(r)?"mosaic-dataset":"raster-dataset"}get renderer(){const{activePresetRendererName:e,presetRenderers:r}=this;return e?r?.find(({name:n})=>n===e)?.renderer.clone():this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("internalRenderer",e)}readRenderer(e,r,n){const l=r?.layerDefinition?.drawingInfo?.renderer,u=ar(l,n);return u==null?null:(u.type==="vector-field"&&r.symbolTileSize&&!l.symbolTileSize&&(u.symbolTileSize=r.symbolTileSize),At(u)||It.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),u)}writeRenderer(e,r,n){r.layerDefinition=r.layerDefinition||{},r.layerDefinition.drawingInfo=r.layerDefinition.drawingInfo||{},r.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(r.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this._rasterAttributeTableFieldPrefix,r=new we({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),n=new we({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),l=new we({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let u=this.fields?C(this.fields):[];u.push(n),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&u.push(r),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(m=>m.name.toLowerCase()==="none")&&u.push(l),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(m=>m.name.toLowerCase()!=="none").forEach(m=>{u.push(new we({name:"Raster.ServicePixelValue."+m.name,alias:m.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(u.push(new we({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),u.push(new we({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=this.rasterInfo??{};if(p!=null){const m=p.fields.filter(c=>c.type!=="esriFieldTypeOID"&&c.name.toLowerCase()!=="value").map(c=>{const d=C(c);return d.name=e+c.name,d});u=u.concat(m)}return u}set rasterFunction(e){let r=e;r?.rasterFunction&&(r=S.fromJSON({...r.toJSON(),rasterFunction:r.rasterFunction,rasterFunctionArguments:r.rasterFunctionArguments})),this._set("rasterFunction",r)}readRasterFunction(e,r){const n=r.rasterFunctionInfos;return r.renderingRule||n?.length&&n[0].name!=="None"?this._isRFTJson(r.renderingRule)?S.fromJSON({rasterFunctionDefinition:r.renderingRule}):S.fromJSON(r.renderingRule||{rasterFunctionInfos:r.rasterFunctionInfos}):null}readSpatialReference(e,r){const n=e||r.extent.spatialReference;return n?re.fromJSON(n):null}readPixelType(e){return nt.fromJSON(e)||e}writePixelType(e,r,n){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(r[n]=nt.toJSON(e))}readVersion(e,r){let n=r.currentVersion;return n||(n=r.hasOwnProperty("fields")||r.hasOwnProperty("timeInfo")?10:9.3),n}applyFilter(e){let r=e;return this.pixelFilter&&(r=this._clonePixelData(e),this.pixelFilter(r)),r}async applyRenderer(e,r){let n=e;const{renderer:l,symbolizer:u,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&l&&u&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(l.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(u.bind(),await d.updateSymbolizer(u,r),this._cachedRendererJson=l.toJSON());const g=await d.symbolize({bandIds:m,...e},r);n={extent:e.extent,pixelBlock:g}}else n={extent:e.extent,pixelBlock:u.symbolize({bandIds:m,...e})}}return n}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeAngles)throw new b("imagery-layer:compute-angles","this operation is not supported on the input image service");return Gi(this.url,e,this._getRequestOptions(r))}async computePixelSpaceLocations(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputePixelLocation)throw new b("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return Li(this.url,e,this._getRequestOptions(r))}async computeHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeHistograms)throw new b("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),zi(this.url,e,this._getRequestOptions(r))}async computeStatisticsHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeStatisticsHistograms)throw new b("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),$i(this.url,e,this._getRequestOptions(r))}async measureHeight(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(e.operationType==="base-and-top"?n.mensuration.supportsHeightFromBaseAndTop:e.operationType==="base-and-top-shadow"?n.mensuration.supportsHeightFromBaseAndTopShadow:n.mensuration.supportsHeightFromTopAndTopShadow))throw new b("imagery-layer:measure-height","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Hi(this.url,e,this._getRequestOptions(r))}async measureAreaAndPerimeter(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsAreaAndPerimeter&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Bi(this.url,e,this._getRequestOptions(r))}async measureDistanceAndAngle(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsDistanceAndAngle&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),ki(this.url,e,this._getRequestOptions(r))}async measurePointOrCentroid(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsPointOrCentroid&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Qi(this.url,e,this._getRequestOptions(r))}async measureLengthFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polyline")throw new b("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return Wi(this.url,e,this._getRequestOptions(r))}async measureAreaFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polygon")throw new b("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return Ki(this.url,e,this._getRequestOptions(r))}getField(e){const{fieldsIndex:r}=this;return r?.get(e)}getFieldDomain(e,r){const n=this.getField(e);return n?n.domain:null}async fetchImage(e,r,n,l={}){if(e==null||r==null||n==null)throw new b("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 d=await this._generateRasterInfo(this.rasterFunction,{signal:l.signal});d&&(this.rasterInfo=d)}const u=this.getExportImageServiceParameters(e,r,n,l.timeExtent);if(u==null){if(l.requestAsImageElement&&this._canRequestImageElement(this.format)){const w=document.createElement("canvas");return w.width=r,w.height=n,l.returnImageBitmap?{imageBitmap:await Tt(w,`${o(this.parsedUrl)}/exportImage`,l.signal)}:{imageOrCanvasElement:w}}const{bandIds:d,rasterInfo:g}=this,h=(d?.length||g.bandCount)??0,f=r*n,y=g.pixelType,v=[];for(let w=0;w=10.3?e?.rasterFunction:null})}).then(r=>r.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new b("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):x(o(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(r=>Ct.fromJSON(r.data))}getCatalogItemRasterInfo(e,r){const n={...r,query:this._getQueryParams()};return ss(o(this.parsedUrl),e,n)}async getCatalogItemICSInfo(e,r){const{data:n}=await x(o(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...r}),l=n?.ics;if(!l)return;let u=null;try{u=(await x(o(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...r})).data.extent}catch{}if(!u?.spatialReference)return{ics:l,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?x(o(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...r}).then(P=>P.data).catch(()=>({})):{},m=u.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[u]}),inSR:pt(m),outSR:"0:"+e},d=x(o(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...r}).then(P=>P.data).catch(()=>({})),g=5,h=(u.xmin+u.xmax)/2,f=(u.ymax-u.ymin)/(g+1),y=u.ymin+f,v=[];for(let P=0;PP.data).catch(()=>({})),j=await Promise.all([p,d,T]);let J=j[0].ipxf;if(J==null){const P=l.geodataXform?.xf_0;P?.name?.toLowerCase()==="topup"&&P?.coefficients?.length===6&&(J={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:P.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const N=Ee.fromJSON(j[1]?.geometries?.[0]);N&&(N.spatialReference=new re({wkid:0,imageCoordinateSystem:l}));const D=j[2].geometries?j[2].geometries.filter(P=>P?.x!=null&&P.y!=null&&P.x!=="NaN"&&P.y!=="NaN"):[],A=D.length;if(A<3)return{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:null};let U=0,Oe=0,$e=0,ze=0;for(let P=0;PD[0].x,xt=D[g-1].y>D[0].y;return Q===1/0?k=xt?90:270:Q===0?k=Ie?0:180:Q>0?k=Ie?180*Math.atan(Q)/Math.PI:180*Math.atan(Q)/Math.PI+180:Q<0&&(k=xt?180+180*Math.atan(Q)/Math.PI:360+180*Math.atan(Q)/Math.PI),{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:k}}async generateRasterInfo(e,r){e=M(S,e);const n={...r,query:this._getQueryParams()};if(!e||e.functionName?.toLowerCase()==="none"||this._isVectorFieldResampleFunction(e))return this.serviceRasterInfo??Ft(o(this.parsedUrl),this.sourceJSON,n);const l=os(e);if(!l)throw new b("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[l])return this._functionRasterInfos[l];const u=or(o(this.parsedUrl),e,n);this._functionRasterInfos[l]=u;try{return await u}catch(p){throw this._functionRasterInfos[l]=null,p}}getExportImageServiceParameters(e,r,n,l){e=e.clone().shiftCentralMeridian();const u=_e(e.spatialReference,o(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const g=this.rasterFunction?.rasterFunctionDefinition,h=this.renderer?.type,f=!h||h==="raster-stretch"||h==="raster-colormap"||h==="unique-value"||h==="class-breaks"||h==="raster-shaded-relief";if(m?.length&&this._hasRasterFunction(this.rasterFunction)&&!g&&f){const w={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")w.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=w;else if(d.rasterFunction==="Colormap"){const T=d.rasterFunctionArguments.Raster;T?.rasterFunction==="Stretch"?(w.rasterFunctionArguments.Raster=T.rasterFunctionArguments.Raster,T.rasterFunctionArguments.Raster=w):(w.rasterFunctionArguments.Raster=T,d.rasterFunctionArguments.Raster=w)}else w.rasterFunctionArguments.Raster=d,d=w;p.bandIds=void 0}else p.bandIds=m?.join(",");Array.isArray(c)&&c.length>0&&(p.noData=c.join(","));const y=this._processMultidimensionalIntersection(null,l,this.exportImageServiceParameters.mosaicRule);if(y.isOutSide)return null;p.mosaicRule=y.mosaicRule!=null?JSON.stringify(y.mosaicRule):null,l=y.timeExtent,p.renderingRule=this._getRenderingRuleString(S.fromJSON(d));const v={};if(l!=null){const{start:w,end:T}=l.toJSON();w&&T&&w===T?v.time=""+w:w==null&&T==null||(v.time=`${w??"null"},${T??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:u,imageSR:u,size:r+","+n,...p,...v}}async getSamples(e,r){if(!(await this._fetchCapabilities(r?.signal))?.operations.supportsGetSamples)throw new b("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=C(e);const{raster:n}=this;return n&&e.raster==null&&(e.raster=n),Ui(this.url,e,this._getRequestOptions(r))}async identify(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsIdentify)throw new b("imagery-layer:identify","identify operation is not supported on the input image service");e=C(e),this.version<10.91&&e.geometry?.type==="extent"&&(e.geometry=ut.fromExtent(e.geometry));const n=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(n.isOutSide)throw new b("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=n.timeExtent,e.mosaicRule=n.mosaicRule;const{raster:l,rasterFunction:u}=this;return u&&e.rasterFunction==null&&(e.rasterFunction=u),l&&e.raster==null&&(e.raster=l),jt(this.url,e,this._getRequestOptions(r))}async imageToMap(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMap)throw new b("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return Yi(o(this.parsedUrl),e,this._getRequestOptions(r))}async imageToMapMultiray(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMapMultiray)throw new b("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return es(o(this.parsedUrl),e,this._getRequestOptions(r))}async mapToImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMapToImage)throw new b("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return ts(o(this.parsedUrl),e,this._getRequestOptions(r))}async findImages(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsFindImages)throw new b("imagery-layer:find-images","findImages operation is not supported on the input image service");return is(o(this.parsedUrl),e,this._getRequestOptions(r))}async getImageUrl(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsGetImageUrl)throw new b("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return rs(o(this.parsedUrl),e,this._getRequestOptions(r))}createQuery(){return new lt({outFields:["*"],returnGeometry:!0,where:this.definitionExpression||"1=1"})}async queryBoundary(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryBoundary)throw new b("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=e??{outSpatialReference:this.spatialReference},Zi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasters(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Jr(this.url,e,r)}async queryObjectIds(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Vr(this.url,e,r)}async queryGPSInfo(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryGPSInfo)throw new b("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=e??{where:"1=1"},Xi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasterCount(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Mr(this.url,e,r)}async queryVisibleRasters(e,r){if(!e)throw new b("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:n,returnDomainValues:l,returnTopmostRaster:u,showNoDataRecords:p}=r||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let m=!1,c=null,d=null;const g="raster.servicepixelvalue",h=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(m=e.outFields.some(N=>!N.toLowerCase().includes(g)),this.version>=10.4)){const N=e.outFields.filter(A=>A.toLowerCase().includes(g)&&A.length>g.length).map(A=>{const U=A.slice(g.length+1);return[this._updateRenderingRulesFunctionName(U,h),U]});c=N.map(A=>new S({functionName:A[0]})),d=N.map(A=>A[1]);const{rasterFunction:D}=this;c.length===0?D?.functionName?(c.push(D),d.push(D.functionName)):c=null:D?.functionName&&!c.some(A=>A.functionName===D.functionName)&&(c.push(D),d.push(D.functionName))}const f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:y}=this;let v=e.timeExtent||this.timeExtent;if(y){const{isOutside:N,intersection:D}=at(y,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(N)throw new b("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");D?.timeExtent!=null&&(v=D.timeExtent)}const w=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,v);let T=e.geometry;this.version<10.91&&T?.type==="extent"&&(T=ut.fromExtent(T));const j=this._getQueryParams({geometry:T,timeExtent:v,mosaicRule:w,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:n,returnCatalogItems:m,returnGeometry:f,raster:this.raster,maxItemCount:u?1:null});delete j.f;const J=new qt(j);try{await this._generateRasterInfo(this.rasterFunction);const N=await jt(this.url,J,{signal:r?.signal,query:{...this.customParameters}}),D=e.outFields,A=N.value!=null&&N.value.toLowerCase().includes("nodata");if(!(m&&!f&&N?.catalogItems?.features.length&&(p||!A)))return this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D});const U=this.objectIdField||"ObjectId",Oe=N.catalogItems?.features??[],$e=Oe.map(k=>k.attributes?.[U]),ze=new lt({objectIds:$e,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[U]}),Q=await this.queryRasters(ze);return Q?.features?.length&&Q.features.forEach(k=>{Oe.forEach(Ie=>{Ie.attributes[U]===k.attributes[U]&&k.geometry&&(Ie.geometry=k.geometry.clone(),e.outSpatialReference!=null&&(Ie.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D})}catch{throw new b("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,r){const n=x(o(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.statistics),l=x(o(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.histograms),u=await Promise.all([n,l]);return u[0]&&u[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:u[0]||null,histograms:u[1]||null}}async createFlowMesh(e,r){const n=this._rasterJobHandler.instance;return n?n.createFlowMesh(e,r):Ir(e.meshType,e.simulationSettings,e.flowData,r.signal!=null?r.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const r=e??this.serviceRasterInfo.multidimensionalInfo;return vr(this.multidimensionalSubset,r)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const r=this.sourceJSON,n=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):Ft(o(this.parsedUrl),r,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),this._set("multidimensionalInfo",p.multidimensionalInfo),lr(p,r),p)),l=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,u=this._getRasterFunctionInfos();return Promise.all([n,l,u]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set("internalRenderer",null),It.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("internalRenderer",this._configRenderer(this.renderer)),this.addHandles([Kt(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,r){const n=this.timeInfo,{multidimensionalInfo:l}=this.serviceRasterInfo;if(e==null||l==null||r==null||n?.startField==null)return e;const{startField:u}=n,p=l.variables.some(y=>y.dimensions.some(v=>v.name===u))?u:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(y=>y.dimensionName!==p),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const m=e.multidimensionalDefinition.filter(y=>y.dimensionName===p),c=r.start!=null?r.start.getTime():null,d=r.end!=null?r.end.getTime():null,g=c==null||d==null||c===d,h=g?[c||d]:[[c,d]],f=this.version>=10.8;if(m.length)m.forEach(y=>{y.dimensionName===p&&(f?(y.dimensionName=null,y.isSlice=!1,y.values=[]):(y.isSlice=g,y.values=h))});else if(!f){const y=e.multidimensionalDefinition.filter(v=>v.variableName!=null&&v.dimensionName==null);y.length?y.forEach(v=>{v.dimensionName=p,v.isSlice=g,v.values=h}):e.multidimensionalDefinition.push(new br({variableName:"",dimensionName:p,isSlice:g,values:h}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(r=>!(!r.variableName&&!r.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQuery)throw new b("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=e!=null?M(lt,e):this.createQuery(),r=this._getRequestOptions(r),this.raster&&(r.query={...r.query,raster:this.raster}),{query:e,requestOptions:r}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new yr;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:r,rasterFunction:n}=this;return e.type==="unique-value"&&this._hasRasterFunction(n)&&r?.bandCount===1&&["u8","s8"].includes(r.pixelType)||r!=null&&e!=null&&ur(r).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let r=this.sourceJSON;if(!r){const{data:n,ssl:l}=await x(o(this.parsedUrl),{query:this._getQueryParams(),signal:e});r=n,this.sourceJSON=r,l&&(this.url=this.url.replace(/^http:/i,"https:"))}if(r.capabilities?.toLowerCase().split(",").map(n=>n.trim()).indexOf("tilesonly")>-1)throw new b("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(r,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const r=this._isMosaicDataset(e),n=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return r||n}_isVectorFieldResampleFunction(e){if(e==null)return!1;const{functionName:r,functionArguments:n}=e,l=r?.toLowerCase()==="resample",u=n?.ResampleType||n?.resampleType;return l&&(u===7||u===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){const r=this._isPicture(),{rasterInfo:n}=this;if(!r&&!this.pixelFilter||this._isVectorDataSet()){const l=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,u=pr({variableName:l,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&n.bandCount>=3){const m=u?.bandIds??cr(n);!m||n.bandCount===3&&m[0]===0&&m[1]===1&&m[2]===2||(this.bandIds=m)}e||(e=u?.renderer??mr(n,{bandIds:this.bandIds,variableName:this.rasterFunction?null:l}));const p=dr(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=p,this.symbolizer.rasterInfo=n):this.symbolizer=new jr({rendererJSON:p,rasterInfo:n}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock!=null?e.pixelBlock.clone():null}}_getQueryParams(e){e?.renderingRule!=null&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:r,viewId:n}=this;return{raster:r,viewId:n,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,r,n){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:r}):Dt(e,r,n)}async _getRasterFunctionInfos(e){const r=this.sourceJSON.rasterFunctionInfos;return this.loaded?r:r&&this.version>=10.3?r.length===1&&r[0].name.toLowerCase()==="none"?r:(await x(o(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:r,requestAsImageElement:n,returnImageBitmap:l,signal:u}=e;if(n&&this._canRequestImageElement(r.format)){const f=`${o(this.parsedUrl)}/exportImage`,{data:y}=await x(f,{responseType:l?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:u});return y instanceof Blob?{imageBitmap:await Tt(y,f,u),params:r}:{imageOrCanvasElement:y,params:r}}const p=this._initJobHandler(),m=x(o(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:u}),c=(await Promise.all([m,p]))[0].data,d=r.format||"jpgpng";let g=d;if(g!=="bsq"&&g!=="bip"&&(g=Nr(c)),!g)throw new b("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const h={signal:u};return{pixelData:{pixelBlock:await(d==="gif"||d==="bmp"||d.includes("png")&&(g==="png"||g==="jpg")?Dt(c,{useCanvas:!0,...r},h):this._decodePixelBlock(c,{width:r.width,height:r.height,planes:null,pixelType:null,noDataValue:null,format:d},h)),extent:r.extent},params:r}}_generateRasterInfo(e,r){return this.generateRasterInfo(e,r).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let r=Sr(e,{multidimensionalSubset:this.multidimensionalSubset});if(r!=null&&r.length>0){this.mosaicRule=this.mosaicRule||new H;const n=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&this.rasterFunction.functionName?.toLowerCase()!=="none"&&r.forEach(l=>l.variableName=""),r=r.filter(({variableName:l,dimensionName:u})=>l&&l!=="*"||u),!n?.length&&r.length&&(this.mosaicRule.multidimensionalDefinition=r)}}_processVisibleRastersResponse(e,r){r=r||{};const n=e.value,{templateRRFunctionNames:l,showNoDataRecords:u,returnDomainValues:p,templateFields:m}=r,c=e.processedValues;let d=e.catalogItems?.features,g=e.properties?.Values?.map(j=>j.replaceAll(/ /gi,", "))||[];const h=this.objectIdField||"ObjectId",f=typeof n=="string"&&n.toLowerCase().includes("nodata"),y=[];if(n&&!d&&!f){const j={};j[h]=0,g=[n],d=[new Zt({geometry:this.fullExtent,attributes:j})]}if(!d)return[];let v,w,T;this._updateResponseFieldNames(d,m),f&&!u&&(d=[]);for(let j=0;j0&&l&&l.length>0&&l.includes(this.rasterFunction.functionName)?c[l.indexOf(this.rasterFunction.functionName)]:n,w.toLowerCase()==="nodata"&&!u)continue;const J="Raster.ItemPixelValue",N="Raster.ServicePixelValue";v.attributes[J]=w,v.attributes[N]=T,this._updateFeatureWithMagDirValues(v,w);const D=this.fields&&this.fields.length>0;let A=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?D?w:n:T;this.rasterFunction||(A=D?w:n),this._updateFeatureWithRasterAttributeTableValues(v,A)}if(v.sourceLayer=v.layer=this,p&&this._updateFeatureWithDomainValues(v),l&&c&&l.length===c.length)for(let J=0;Jc.name).find(c=>c.toLowerCase()==="value");if(!p)return;const m=l.filter(c=>c.attributes[p]===(r!=null?parseInt(r,10):null));m&&m[0]&&u.forEach(c=>{const d=this._rasterAttributeTableFieldPrefix+c.name;e.attributes[d]=m[0].attributes[c.name]})}_updateFeatureWithMagDirValues(e,r){if(!this._isVectorDataSet())return;const n=r.split(/,\s*/).map(c=>parseFloat(c)),l=n.map(c=>[c]),u=n.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new ot({height:1,width:1,pixelType:"f32",pixels:l,statistics:u});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new Ee(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:Fr([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){(this.fields&&this.fields.filter(r=>r.domain&&r.domain.type==="coded-value"))?.forEach(r=>{const n=e.attributes[r.name];if(n!=null){const l=r.domain.codedValues.find(u=>u.code===n);l&&(e.attributes[r.name]=l.name)}})}_updateResponseFieldNames(e,r){if(!r||r.length<1)return;const n=this.fieldsIndex;n!=null&&e.forEach(l=>{if(l?.attributes)for(const u of r){const p=n.get(u)?.name;p&&p!==u&&(l.attributes[u]=l.attributes[p],delete l.attributes[p])}})}_getRenderingRuleString(e){if(e){let r=e.toJSON();return r=r.rasterFunctionDefinition??r,(r.thumbnail||r.thumbnailEx)&&(r.thumbnail=r.thumbnailEx=null),JSON.stringify(r)}return null}_hasRasterFunction(e){return e?.functionName!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,r){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const n=e.toLowerCase().replaceAll(/ /gi,"_");return r.has(n)?r.get(n):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(e){const{raster:r,mosaicRule:n,rasterFunction:l}=this;l&&"rasterFunction"in e&&e.rasterFunction==null&&(e.rasterFunction=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),r&&e.raster==null&&(e.raster=r)}_readCapabilities(e){const r=e.capabilities?e.capabilities.toLowerCase().split(",").map(w=>w.trim()):["image","catalog"],{currentVersion:n,advancedQueryCapabilities:l,maxRecordCount:u}=e,p=r.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!(!e.spatialReference&&!e.extent?.spatialReference),d=r.includes("edit"),g=r.includes("mensuration")&&c,h=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(",").map(w=>w.trim()),f=g&&h.includes("basic"),y=this._isMosaicDataset(e)&&r.includes("catalog"),v=r.includes("download");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsImageToMap:n>=11.2&&y,supportsImageToMapMultiray:n>=11.2&&y,supportsMapToImage:n>=11.2&&y,supportsFindImages:n>=11.2&&y,supportsGetImageUrl:n>=11.3&&v,supportsMeasure:g,supportsMeasureFromImage:n>=11.2,supportsDownload:v,supportsQuery:y&&e.fields&&e.fields.length>0,supportsGetSamples:n>=10.2&&p,supportsProject:n>=10.3&&p,supportsComputeStatisticsHistograms:n>=10.4&&p,supportsQueryBoundary:n>=10.6&&p,supportsCalculateVolume:n>=10.7&&m,supportsComputePixelLocation:n>=10.7&&y,supportsComputeAngles:n>=10.91,supportsQueryGPSInfo:n>=11.2&&y,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,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:u,maxRecordCountFactor:void 0,supportsStatistics:!!l?.supportsStatistics,supportsOrderBy:!!l?.supportsOrderBy,supportsDistinct:!!l?.supportsDistinct,supportsPagination:!!l?.supportsPagination,supportsStandardizedQueriesOnly:!!l?.useStandardizedQueries,supportsPercentileStatistics:!!l?.supportsPercentileStatistics,supportsCentroid:!!l?.supportsReturningGeometryCentroid,supportsDistance:!!l?.supportsQueryWithDistance,supportsExtent:!!l?.supportsReturningQueryExtent,supportsGeometryProperties:!!l?.supportsReturningGeometryProperties,supportsHavingClause:!!l?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!l?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:f,supportsAreaAndPerimeter:f,supportsPointOrCentroid:f,supportsHeightFromBaseAndTop:g&&h.includes("base-top height"),supportsHeightFromBaseAndTopShadow:g&&h.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:g&&h.includes("top-top shadow height"),supports3D:g&&h.includes("3d")}}}};function o(e){return e?.path??""}return s([a({clonable:!1})],t.prototype,"_functionRasterInfos",void 0),s([a({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),s([a({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),s([a({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),s([E("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),s([a({readOnly:!0})],t.prototype,"_rasterAttributeTableFieldPrefix",void 0),s([a({readOnly:!0})],t.prototype,"_rasterFunctionNamesIndex",null),s([a()],t.prototype,"adjustAspectRatio",void 0),s([a({type:[Le],json:{write:!0}})],t.prototype,"bandIds",void 0),s([E("bandIds")],t.prototype,"readBandIds",null),s([a({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),s([E("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),s([a({type:Number})],t.prototype,"compressionQuality",void 0),s([I("compressionQuality")],t.prototype,"writeCompressionQuality",null),s([a({type:Number})],t.prototype,"compressionTolerance",void 0),s([I("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),s([a({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),s([a({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"defaultMosaicRule",void 0),s([E("defaultMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultMosaicRule",null),s([a({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),s([a({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),s([a()],t.prototype,"rasterInfo",void 0),s([a({readOnly:!0,type:[we]})],t.prototype,"fields",void 0),s([a({readOnly:!0})],t.prototype,"fieldsIndex",null),s([a({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff","bip","bsq"],json:{write:!0}})],t.prototype,"format",null),s([E("service","format",["serviceDataType"])],t.prototype,"readFormat",null),s([a({type:Ee})],t.prototype,"fullExtent",void 0),s([a({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),s([a({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),s([a({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],t.prototype,"interpolation",void 0),s([a()],t.prototype,"minScale",void 0),s([E("service","minScale")],t.prototype,"readMinScale",null),s([a()],t.prototype,"maxScale",void 0),s([E("service","maxScale")],t.prototype,"readMaxScale",null),s([a({type:H})],t.prototype,"mosaicRule",null),s([E("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),s([I("mosaicRule")],t.prototype,"writeMosaicRule",null),s([a()],t.prototype,"multidimensionalInfo",void 0),s([a({type:ir,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),s([a({json:{type:Le}})],t.prototype,"noData",void 0),s([I("noData")],t.prototype,"writeNoData",null),s([a({type:String,json:{type:qe.jsonValues,read:qe.read,write:qe.write}})],t.prototype,"noDataInterpretation",void 0),s([a({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),s([E("objectIdField")],t.prototype,"readObjectIdField",null),s([a({readOnly:!0})],t.prototype,"geometryType",void 0),s([a({})],t.prototype,"typeIdField",void 0),s([a({})],t.prototype,"types",void 0),s([a({readOnly:!0})],t.prototype,"parsedUrl",null),s([a({type:Function})],t.prototype,"pixelFilter",void 0),s([a()],t.prototype,"raster",void 0),s([a({readOnly:!0})],t.prototype,"sourceType",void 0),s([E("sourceType",["serviceSourceType","fields"])],t.prototype,"readSourceType",null),s([a()],t.prototype,"viewId",void 0),s([a()],t.prototype,"renderer",null),s([a({types:sr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:nr,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],t.prototype,"internalRenderer",null),s([E("internalRenderer")],t.prototype,"readRenderer",null),s([I("internalRenderer")],t.prototype,"writeRenderer",null),s([a({clonable:!1})],t.prototype,"symbolizer",void 0),s([a(wr)],t.prototype,"opacity",void 0),s([a({readOnly:!0})],t.prototype,"rasterFields",null),s([a({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),s([a({type:S,json:{name:"renderingRule"}})],t.prototype,"rasterFunction",null),s([E("rasterFunction",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRasterFunction",null),s([a({readOnly:!0})],t.prototype,"serviceDataType",void 0),s([a({readOnly:!0,type:re})],t.prototype,"spatialReference",void 0),s([E("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),s([a({json:{type:nt.jsonValues}})],t.prototype,"pixelType",void 0),s([E("pixelType")],t.prototype,"readPixelType",null),s([I("pixelType")],t.prototype,"writePixelType",null),s([a({constructOnly:!0,type:Nt})],t.prototype,"serviceRasterInfo",void 0),s([a()],t.prototype,"sourceJSON",void 0),s([a(Rr)],t.prototype,"url",void 0),s([a({readOnly:!0})],t.prototype,"version",void 0),s([E("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=s([R("esri.layers.mixins.ArcGISImageService")],t),t};let z=class extends qr(Hr(Ur(Lr($r(rr(ls(zr(Gr(Er(er(fe(tr)))))))))))){constructor(...i){super(...i),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=Ht(async(t,o,e)=>{const{save:r,saveAs:n}=await $t(()=>import("./imageryUtils-6MVSqijr-B_Ii3EHZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(t){case Ue.SAVE:return r(this,o);case Ue.SAVE_AS:return n(this,e,o)}})}normalizeCtorArgs(i,t){return typeof i=="string"?{url:i,...t}:i}load(i){const t=i!=null?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},i).catch(Bt).then(()=>this._fetchService(t))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(i){this._set("legendEnabled",i)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(i){this._set("listMode",i)}writeOperationalLayerType(i,t,o){const e=this.renderer?.type==="vector-field";t[o]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(i){const t=this.rasterFields,o=this.title,e=new Set;let r=!1,n=!1;this.capabilities&&(r=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,n=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const l=new Set;r&&l.add("raster.itempixelvalue");for(const p of t){const m=p.name.toLowerCase();l.has(m)||m.includes("raster.servicepixelvalue.")||e.add(p.name)}n&&e.add("raster.magnitude").add("raster.direction");const u=Qr({fields:t,title:o},{...i,visibleFieldNames:e});return u?.fieldInfos&&this.rasterInfo?.pixelType.startsWith("f")&&u.fieldInfos.forEach(({format:p,fieldName:m})=>{p&&m&&/^raster\.(item|service)pixelvalue/i.test(m)&&(p.places=2)}),u}queryFeatures(i,t){return this.queryRasters(i,t).then(o=>{if(o?.features)for(const e of o.features)e.layer=e.sourceLayer=this;return o})}queryFeatureCount(i,t){return this.queryRasterCount(i,t)}redraw(){this.emit("redraw")}async save(i){return this._debouncedSaveOperations(Ue.SAVE,i)}async saveAs(i,t){return this._debouncedSaveOperations(Ue.SAVE_AS,t,i)}serviceSupportsSpatialReference(i){return Br(this,i)}write(i,t){if(!this._isPreviewLayer)return super.write(i,t);if(t?.messages){const o=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new b("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this}))}return null}};s([a(gr)],z.prototype,"legendEnabled",null),s([a({type:["show","hide"]})],z.prototype,"listMode",null),s([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],z.prototype,"isReference",void 0),s([a({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],z.prototype,"operationalLayerType",void 0),s([I("web-map","operationalLayerType")],z.prototype,"writeOperationalLayerType",null),s([a(fr)],z.prototype,"popupEnabled",void 0),s([a({type:Qt,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],z.prototype,"popupTemplate",void 0),s([a({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),s([a({readOnly:!0,json:{read:!1}})],z.prototype,"type",void 0),s([a({readOnly:!0})],z.prototype,"_isPreviewLayer",null),z=s([R("esri.layers.ImageryLayer")],z);const Pn=z;export{Pn as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./imageryUtils-6MVSqijr-2ufISwt4.js","./utils-BVWK2jiA-i-Dn2Ad8.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CfFOGshS.js","./jsonContext-BA8GHqVk-BsXRY5es.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./saveUtils-CIYk-dsQ-Br9QCJTX.js"])))=>i.map(i=>d[i]); +import{_ as $t}from"./main-QGPoLsvl.js";import{v as s,S as a,ac as I,i as R,aa as fe,e as F,w as V,J as re,bB as Le,aK as zt,af as ne,bH as ge,bI as et,bJ as tt,a0 as E,bK as Y,g as ee,bz as Ut,bp as Ht,W as Bt,o as b,bL as Qt,P as C,l as ut,n as Ee,G as kt,a as Wt,a1 as It,f as x,bM as pt,aO as M,ah as Kt,bi as Zt,bN as Xt,ab as Yt}from"./story-Doly9N9p.js";import{m as er}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as tr}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{p as he,d as qe,M as H,k as S,J as rr,A as ir,l as sr,c as nr,u as nt,a as ar,E as Ft,P as or,V as lr,j as ur,v as pr,w as cr,S as mr,b as dr,f as yr,Z as hr}from"./RasterPresetRendererMixin-D6W9pUY6-Bm_m_CYY.js";import{_ as gr,X as fr,E as wr,Z as Rr}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{E as at,z as vr,g as br,j as Sr}from"./multidimensionalUtils-BwTugeu7-C75LYPc9.js";import{n as xr,D as ot,R as Ir,x as Fr}from"./dataUtils-BkPy4R3C-Dzc1QGGb.js";import{W as Nt,K as _t,i as Ot,Y as Dr,B as Tr,a as Pr,t as jr,V as Dt,b as Nr,c as _r}from"./RasterSymbolizer-BVys6HkM-DCN-TPRo.js";import{G as Or}from"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{y as we}from"./Field-C6hA1tZj-CkWoRbmp.js";import{o as Cr}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{i as Tt}from"./imageBitmapUtils-DA36kg39-BfNbbEDs.js";import{B as xe}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{y as q,n as L,a as $}from"./utils-9sQxfkoa-D8FX0sO8.js";import{s as Ar,b as lt}from"./Query-BrwMGK8U-BPr0_G9t.js";import{k as bt}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import{O as Ct}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{e as Vr,i as Mr}from"./executeForIds-Z1gkLduF-CrWEksFG.js";import{u as Jr}from"./executeQueryJSON-CcHnccia-M-vnTvKl.js";import{a as Er}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{u as qr}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as Gr}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{E as Lr}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as $r}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as zr}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as Ur}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{x as Hr}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{a as Br}from"./versionUtils-LZYZz-38-B8C5OAjF.js";import{w as Qr}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import{E as Ue}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./utils-DPtQ14k3-CBDffBYM.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./query-DFW9-NG_-C3TyGmiM.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";const kr={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:""}},Wr=new Set(["u1","u2","u4","u8","s8","u16","s16"]),Kr={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)"},Zr=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function At(i){return Zr.has(i.type)}function ct(i,t){if(!i||!t)return C(i||t);const o=C(i);if(o.functionDefinition&&t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=void 0),Vt(o.functionDefinition.arguments,t),o.rasterFunctionDefinition=o.functionDefinition.toJSON()}else t.functionName?.toLowerCase()!=="none"&&(Mt(o.functionArguments).Raster=t);return o}function Vt(i,t){for(const o in i)o.toLowerCase()==="raster"&&(i[o].type==="RasterFunctionVariable"?(i[o]=t.rasterFunctionDefinition,i[o].type="RasterFunctionTemplate"):i[o].type==="RasterFunctionTemplate"&&Vt(i[o].arguments,t))}function ie(i){const t=C(kr[i.functionName+"Function"]),o=i.functionArguments;for(const e in o)e.toLowerCase()==="raster"?(t.arguments[e]=ie(o[e]),t.arguments[e].type="RasterFunctionTemplate"):e.toLowerCase()==="colormap"?(t.arguments[e].value=ni(o[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=o[e];return t}function Xr(i,t){switch(t=t||{},i.type){case"raster-stretch":return ti(i,t);case"class-breaks":return ri(i,t);case"unique-value":return ii(i,t);case"raster-colormap":return si(i,t);case"vector-field":return Yr(i,t);case"raster-shaded-relief":return ei(i,t);case"flow":throw new Error("Unsupported rendering rule.")}}function Mt(i){const t=i?.Raster??i?.raster;return t&&t.declaredClass==="esri.layers.support.RasterFunction"?Mt(t.functionArguments):i}const Ce={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function Yr(i,t){const o=new S;o.functionName="VectorFieldRenderer";const{dataType:e,bandNames:r}=t,n=e==="vector-uv";let l,u;if(r&&r.length===2){const h=r.map(f=>f.toLowerCase());l=h.indexOf("magnitude"),u=h.indexOf("direction")}l!==-1&&l!==null||(l=0,u=1);const p=i.rotationType==="arithmetic"?1:2,m=i.flowRepresentation==="flow-from"?0:1,c=i.visualVariables?i.visualVariables.find(h=>h.field==="Magnitude"):new Or,d={magnitudeBandID:l,directionBandID:u,isUVComponents:n,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:Kr[i.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};o.functionArguments=d;const g=ie(o);return t.convertToRFT?S.fromJSON({rasterFunctionDefinition:g}):o}function ei(i,t){const o=t.convertToRFT;if(t.dataType!=="elevation"&&(t.dataType!=="generic"||t.bandCount!==1||t.pixelType!=="s16"&&t.pixelType!=="s32"&&t.pixelType!=="f32"&&t.pixelType!=="f64"))return new S;const e=new S;e.functionName="Hillshade";const r=i.hillshadeType==="traditional"?0:1,n=i.scalingType==="none"?1:3,l={HillshadeType:r,SlopeType:n,ZFactor:i.zFactor};return r===0&&(l.Azimuth=i.azimuth,l.Altitude=i.altitude),n===3&&(l.PSPower=i.pixelSizePower,l.PSZFactor=i.pixelSizeFactor),e.functionArguments=l,e.variableName="Raster",i.colorRamp&&(e.functionName="ShadedRelief",o?l.ColorRamp=_t(i.colorRamp):l.Colormap=Ot(i.colorRamp)),o?new S({rasterFunctionDefinition:ie(e)}):e}function ti(i,t){const o=t.convertToRFT,e=new S;e.functionName="Stretch";const r=Ce[Dr.toJSON(i.stretchType)],n="u8",l=i.customStatistics?.map(p=>[p.min,p.max,p.avg??0,p.stddev??1]),u={StretchType:r,Statistics:l,DRA:i.dynamicRangeAdjustment,UseGamma:i.useGamma,Gamma:i.gamma,ComputeGamma:i.computeGamma};if(i.outputMin!=null&&(u.Min=i.outputMin),i.outputMax!=null&&(u.Max=i.outputMax),r===Ce.standardDeviation?(u.NumberOfStandardDeviations=i.numberOfStandardDeviations,e.outputPixelType=n):r===Ce.percentClip?(u.MinPercent=i.minPercent,u.MaxPercent=i.maxPercent,e.outputPixelType=n):r===Ce.minMax?e.outputPixelType=n:r===Ce.sigmoid&&(u.SigmoidStrengthLevel=i.sigmoidStrengthLevel),e.functionArguments=u,e.variableName="Raster",i.colorRamp){const p=i.colorRamp,m=new S;if(o)m.functionArguments={ColorRamp:_t(p)};else{const c=Tr(p,!0);if(c)m.functionArguments={colorRampName:c};else if(!t.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=i.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&d.colorRamps?.length&&d.colorRamps.forEach(g=>g.algorithm=g.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:Ot(p)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,o?new S({rasterFunctionDefinition:ie(m)}):m}return o?new S({rasterFunctionDefinition:ie(e)}):e}function ri(i,t){const o=[],e=[],r=[],n=[],{pixelType:l,rasterAttributeTable:u}=t,p=u==null?null:u.features,m=Jt(u);if(m&&p&&Array.isArray(p)&&i.classBreakInfos){i.classBreakInfos.forEach((y,v)=>{const w=y.symbol?.color;let T;w?.a&&y.minValue!=null&&y.maxValue!=null&&p.forEach(j=>{y.minValue!=null&&y.maxValue!=null&&(T=j.attributes[i.field],(T>=y.minValue&&T=y.minValue)&&n.push([j.attributes[m],w.r,w.g,w.b]))})});const h=l?rt(n,l):n,f=new S;return f.functionName="Colormap",f.functionArguments={},f.functionArguments.Colormap=h,f.variableName="Raster",t.convertToRFT?new S({rasterFunctionDefinition:ie(f)}):f}i.classBreakInfos.forEach((h,f)=>{if(h.minValue==null||h.maxValue==null)return;const y=h.symbol&&h.symbol.color;y?.a?(f===0?o.push(h.minValue,h.maxValue+1e-4):o.push(h.minValue+1e-4,h.maxValue+1e-4),e.push(f),n.push([f,y.r,y.g,y.b])):r.push(h.minValue,h.maxValue)});const c=l?rt(n,l):n,d=new S;d.functionName="Remap",d.functionArguments={InputRanges:o,OutputValues:e,NoDataRanges:r},d.variableName="Raster";const g=new S;return g.functionName="Colormap",g.functionArguments={Colormap:c,Raster:d},t.convertToRFT?new S({rasterFunctionDefinition:ie(g)}):g}function rt(i,t){const o=Wr.has(t)?xr(t):null;return o&&i.push([Math.floor(o[0]-1),0,0,0],[Math.ceil(o[1]+1),0,0,0]),i}function Jt(i){if(i==null)return;const{fields:t}=i;return t?.find(o=>o?.name&&o.name.toLowerCase()==="value")?.name}function ii(i,t){const o=[],{pixelType:e,rasterAttributeTable:r}=t,n=r==null?null:r.features,l=Jt(r),u=i.defaultSymbol?.color?.toRgb(),p=i.uniqueValueInfos;if(p)if(n){if(l){const d=new Map;p.forEach(h=>{const f=h.value,y=Pt(h);f!=null&&y?.a&&d.set(String(f),y.toRgb())});const g=i.field;g&&n.forEach(({attributes:h})=>{const f=String(h[g]),y=h[l],v=d.get(f);v?o.push([y,...v]):u&&o.push([y,...u])})}}else for(let d=0;dt.type==="fill")?.material?.color:i.symbol?.color}function si(i,t){const o=i.extractColormap();if(!o||o.length===0)return null;const{pixelType:e}=t,r=e?rt(o,e):o,n=new S;return n.functionName="Colormap",n.functionArguments={},n.functionArguments.Colormap=r,t.convertToRFT?new S({rasterFunctionDefinition:ie(n)}):n}function ni(i){const t=[],o=[];return i.forEach(e=>{t.push(e[0]),o.push(Pr([...e.slice(1),255]))}),{type:"RasterColormap",values:t,colors:o}}let _=class extends F{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(i,t,o){this.layer.version<10.3||(t[o]=i)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(i,t,o){this.format&&this.format.toLowerCase().includes("jpg")&&i!=null&&(t[o]=i)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(i,t,o){this.format==="lerc"&&i!=null&&(t[o]=i)}get format(){return this.layer.renderer?.type==="vector-field"?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(i,t,o){this.format==="lerc"&&this.layer.version>=10.5&&(t[o]=i)}get version(){const i=this.layer;return i.commitProperty("bandIds"),i.commitProperty("format"),i.commitProperty("compressionQuality"),i.commitProperty("compressionTolerance"),i.commitProperty("interpolation"),i.commitProperty("noData"),i.commitProperty("noDataInterpretation"),i.commitProperty("mosaicRule"),i.commitProperty("rasterFunction"),i.commitProperty("adjustAspectRatio"),i.commitProperty("pixelFilter"),i.commitProperty("definitionExpression"),i.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(i){this._set("version",i)}get mosaicRule(){const i=this.layer;let t=i.mosaicRule;const o=i.definitionExpression;return t?o&&o!==t.where&&(t=t.clone(),t.where=o):o&&(t=new H({where:o})),t}get rasterFunction(){const i=this.layer;let{rasterFunction:t}=i;const o=i.pixelFilter,e=!i.format||i.format.includes("jpg")||i.format.includes("png");t=this._addResampleRasterFunction(t);const r=i.multidimensionalSubset?.areaOfInterest;return r&&(t=ai(t,r)),e&&!o&&i.renderer?.type!=="vector-field"&&(t=this.combineRendererWithRenderingRule(t)),t}combineRendererWithRenderingRule(i){const t=this.layer,{rasterInfo:o,renderer:e}=t;return i=i||t.rasterFunction,!e||!At(e)?i:ct(Xr(e,{rasterAttributeTable:o.attributeTable,pixelType:o.pixelType,dataType:o.dataType,bandNames:o.bandInfos.map(({name:r})=>r),convertColorRampToColormap:t.version<10.6,convertToRFT:!!i?.rasterFunctionDefinition,bandCount:o.bandCount}),i)}_addResampleRasterFunction(i){if(this.layer.renderer?.type!=="vector-field"||i?.functionName==="Resample")return i;const t=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,o=this.layer.serviceRasterInfo.pixelSize;let e=new S({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:o}});return e=i?.rasterFunctionDefinition?new S({rasterFunctionDefinition:ie(e)}):e,ct(e,i)}};function ai(i,t){const o=new S({functionName:"Clip",functionArguments:{ClippingGeometry:t.toJSON(),ClippingType:1}});return ct(o,i)}s([a()],_.prototype,"layer",void 0),s([a({json:{write:!0}})],_.prototype,"adjustAspectRatio",null),s([I("adjustAspectRatio")],_.prototype,"writeAdjustAspectRatio",null),s([a({json:{write:!0}})],_.prototype,"bandIds",null),s([a({json:{write:!0}})],_.prototype,"compression",void 0),s([a({json:{write:!0}})],_.prototype,"compressionQuality",null),s([I("compressionQuality")],_.prototype,"writeCompressionQuality",null),s([a({json:{write:!0}})],_.prototype,"compressionTolerance",null),s([I("compressionTolerance")],_.prototype,"writeCompressionTolerance",null),s([a({json:{write:!0}})],_.prototype,"format",null),s([a({type:String,json:{read:{reader:he.read},write:{writer:he.write}}})],_.prototype,"interpolation",null),s([a({json:{write:!0}})],_.prototype,"noData",null),s([a({type:String,json:{read:{reader:qe.read},write:{writer:qe.write}}})],_.prototype,"noDataInterpretation",null),s([a({json:{write:!0}})],_.prototype,"pixelType",void 0),s([a({json:{write:!0}})],_.prototype,"lercVersion",void 0),s([I("lercVersion")],_.prototype,"writeLercVersion",null),s([a({type:Number})],_.prototype,"version",null),s([a({json:{write:!0}})],_.prototype,"mosaicRule",null),s([a({json:{write:!0,name:"renderingRule"}})],_.prototype,"rasterFunction",null),_=s([R("esri.layers.support.ExportImageServiceParameters")],_);let ce=class extends fe(F){constructor(){super(...arguments),this.fromGeometry=null,this.toGeometry=null,this.objectIds=null,this.where=null,this.maxCount=null}};s([a({type:V,json:{read:!0}})],ce.prototype,"fromGeometry",void 0),s([a({type:V,json:{read:!0,write:!0}})],ce.prototype,"toGeometry",void 0),s([a({json:{write:!0}})],ce.prototype,"objectIds",void 0),s([a({type:String,json:{write:!0}})],ce.prototype,"where",void 0),s([a({type:Number,json:{write:!0}})],ce.prototype,"maxCount",void 0),ce=s([R("esri.rest.support.FindImagesParameters")],ce);const oi=ce,Et=i=>{let t=class extends i{constructor(){super(...arguments),this.make=null,this.model=null,this.focalLength=null,this.pixelSize=null,this.rows=null,this.cols=null}};return s([a({json:{write:!0}})],t.prototype,"make",void 0),s([a({json:{write:!0}})],t.prototype,"model",void 0),s([a({json:{write:!0}})],t.prototype,"focalLength",void 0),s([a({json:{write:!0}})],t.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],t.prototype,"rows",void 0),s([a({json:{write:!0}})],t.prototype,"cols",void 0),t=s([R("esri.rest.support.CameraInfoMixin")],t),t};let W=class extends Et(F){constructor(){super(...arguments),this.id=null,this.referenceUri=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.perspectiveCenter=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],W.prototype,"id",void 0),s([a({json:{name:"uri",write:!0}})],W.prototype,"referenceUri",void 0),s([a({type:Date,json:{write:!0}})],W.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],W.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],W.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"center",void 0),s([a({type:V,json:{write:!0}})],W.prototype,"perspectiveCenter",void 0),s([a({json:{write:!0}})],W.prototype,"orientation",void 0),W=s([R("esri.rest.support.ImageInspectionInfo")],W);const li=W;let He=class extends F{constructor(){super(...arguments),this.images=null}};s([a({type:[li],json:{write:!0}})],He.prototype,"images",void 0),He=s([R("esri.rest.support.FindImagesResult")],He);const ui=He;var mt;let Re=mt=class extends F{constructor(i){super(i),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new mt(C({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};s([a({type:[String],json:{name:"angleName",write:!0}})],Re.prototype,"angleNames",void 0),s([a({type:V,json:{write:!0}})],Re.prototype,"point",void 0),s([a({type:re,json:{write:!0}})],Re.prototype,"spatialReference",void 0),s([a({type:Le,json:{write:!0}})],Re.prototype,"rasterId",void 0),Re=mt=s([R("esri.rest.support.ImageAngleParameters")],Re);const pi=Re;let Fe=class extends F{constructor(i){super(i),this.north=null,this.up=null,this.spatialReference=null}};s([a({type:Number,json:{write:!0}})],Fe.prototype,"north",void 0),s([a({type:Number,json:{write:!0}})],Fe.prototype,"up",void 0),s([a({type:re,json:{write:!0}})],Fe.prototype,"spatialReference",void 0),Fe=s([R("esri.rest.support.ImageAngleResult")],Fe);const ci=Fe,B=new zt({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let X=class extends F{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};s([a()],X.prototype,"type",void 0),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],X.prototype,"measureOperation",void 0),s([a({type:H,json:{write:!0}})],X.prototype,"mosaicRule",void 0),s([a({type:V,json:{write:!0}})],X.prototype,"pixelSize",void 0),s([a({json:{write:!0}})],X.prototype,"raster",void 0),X=s([R("esri.rest.support.BaseImageMeasureParameters")],X);var dt;let ae=dt=class extends X{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new dt(C({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:!0,write:!0}})],ae.prototype,"geometry",void 0),s([I("geometry")],ae.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{write:B.write}})],ae.prototype,"measureOperation",null),s([a({json:{read:!0}})],ae.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],ae.prototype,"linearUnit",void 0),s([a({type:String,json:{read:et.read,write:et.write}})],ae.prototype,"areaUnit",void 0),ae=dt=s([R("esri.rest.support.ImageAreaParameters")],ae);const mi=ae;let de=class extends F{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"value",void 0),s([a({type:String,json:{read:!0,write:!0}})],de.prototype,"displayValue",void 0),s([a({type:Number,json:{read:!0,write:!0}})],de.prototype,"uncertainty",void 0),de=s([R("esri.rest.support.BaseImageMeasureResult.BaseImageMeasureResultValue")],de);let Ne=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:ge.read,write:ge.write}})],Ne.prototype,"unit",void 0),Ne=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultLengthValue")],Ne);let Be=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:et.read,write:et.write}})],Be.prototype,"unit",void 0),Be=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAreaValue")],Be);let Ge=class extends de{constructor(){super(...arguments),this.unit=null}};s([a({type:String,json:{read:tt.read,write:tt.write}})],Ge.prototype,"unit",void 0),Ge=s([R("esri.rest.support.BaseImageMeasureResult.ImageMeasureResultAngleValue")],Ge);let ye=class extends F{constructor(){super(...arguments),this.name=null,this.sensorName=null}};s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"name",void 0),s([a({type:String,json:{read:!0,write:!0}})],ye.prototype,"sensorName",void 0),ye=s([R("esri.rest.support.BaseImageMeasureResult")],ye);let Ae=class extends ye{constructor(){super(...arguments),this.area=null,this.perimeter=null}};s([a({type:Be,json:{read:!0,write:!0}})],Ae.prototype,"area",void 0),s([a({type:Ne,json:{read:!0,write:!0}})],Ae.prototype,"perimeter",void 0),Ae=s([R("esri.rest.support.ImageAreaResult")],Ae);const di=Ae;let Qe=class extends fe(F){constructor(){super(...arguments),this.outSpatialReference=null}};s([a({type:re,json:{name:"outSR",write:!0}})],Qe.prototype,"outSpatialReference",void 0),Qe=s([R("esri.rest.support.ImageBoundaryParameters")],Qe);const yi=Qe;let De=class extends F{constructor(){super(...arguments),this.area=null,this.geometry=null}readGeometry(i,t){return i==null?null:i.rings?ut.fromJSON(i):Ee.fromJSON(i)}};s([a({type:Number,json:{write:!0}})],De.prototype,"area",void 0),s([a({json:{name:"shape",write:!0}})],De.prototype,"geometry",void 0),s([E("geometry")],De.prototype,"readGeometry",null),De=s([R("esri.rest.support.ImageBoundaryResult")],De);const hi=De;var yt;let te=yt=class extends X{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new yt(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"fromGeometry",void 0),s([I("fromGeometry")],te.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],te.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],te.prototype,"measureOperation",null),s([a({json:{read:!0}})],te.prototype,"is3D",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],te.prototype,"linearUnit",void 0),s([a({type:String,json:{read:tt.read,write:tt.write}})],te.prototype,"angularUnit",void 0),te=yt=s([R("esri.rest.support.ImageDistanceParameters")],te);const gi=te;let Te=class extends ye{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};s([a({type:Ne,json:{read:!0,write:!0}})],Te.prototype,"distance",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"azimuthAngle",void 0),s([a({type:Ge,json:{read:!0,write:!0}})],Te.prototype,"elevationAngle",void 0),Te=s([R("esri.rest.support.ImageDistanceResult")],Te);const fi=Te;let oe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.objectIds=null,this.spatialRelationship="intersects",this.timeExtent=null,this.where=null}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}};s([a({types:ne,json:{read:ee,write:!0}})],oe.prototype,"geometry",void 0),s([I("geometry")],oe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],oe.prototype,"objectIds",void 0),s([Ut(Ar,{ignoreUnknown:!1,name:"spatialRel"})],oe.prototype,"spatialRelationship",void 0),s([a({type:bt,json:{name:"time",write:!0}})],oe.prototype,"timeExtent",void 0),s([a({type:String,json:{write:!0}})],oe.prototype,"where",void 0),oe=s([R("esri.rest.support.ImageGPSInfoParameters")],oe);const wi=oe;let ke=class extends Et(F){constructor(){super(...arguments),this.id=null}};s([a({json:{write:!0}})],ke.prototype,"id",void 0),ke=s([R("esri.rest.support.CameraInfo")],ke);const Ri=ke;let K=class extends F{constructor(){super(...arguments),this.id=null,this.name=null,this.acquisitionDate=null,this.cameraID=null,this.center=null,this.gps=null,this.orientation=null}writeAcquisitionDate(i,t){t.acquisitionDate=i?.getTime()}};s([a({json:{write:!0}})],K.prototype,"id",void 0),s([a({json:{write:!0}})],K.prototype,"name",void 0),s([a({type:Date,json:{write:!0}})],K.prototype,"acquisitionDate",void 0),s([I("acquisitionDate")],K.prototype,"writeAcquisitionDate",null),s([a({json:{write:!0}})],K.prototype,"cameraID",void 0),s([a({type:V,json:{write:!0}})],K.prototype,"center",void 0),s([a({json:{write:!0}})],K.prototype,"gps",void 0),s([a({json:{write:!0}})],K.prototype,"orientation",void 0),K=s([R("esri.rest.support.ImageGPSInfo")],K);const vi=K;let Ve=class extends F{constructor(){super(...arguments),this.images=null,this.cameras=null}};s([a({type:[vi],json:{write:!0}})],Ve.prototype,"images",void 0),s([a({type:[Ri],json:{write:!0}})],Ve.prototype,"cameras",void 0),Ve=s([R("esri.rest.support.ImageGPSInfoResult")],Ve);const bi=Ve;var ht;let le=ht=class extends X{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){return this.operationType}clone(){return new ht(C({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({type:V,json:{read:!0}})],le.prototype,"fromGeometry",void 0),s([I("fromGeometry")],le.prototype,"writeFromGeometry",null),s([a({type:V,json:{read:!0,write:!0}})],le.prototype,"toGeometry",void 0),s([a({type:B.apiValues,json:{write:B.write}})],le.prototype,"measureOperation",null),s([a({json:{read:!0}})],le.prototype,"operationType",void 0),s([a({type:String,json:{read:ge.read,write:ge.write}})],le.prototype,"linearUnit",void 0),le=ht=s([R("esri.rest.support.ImageHeightParameters")],le);const Si=le;let We=class extends ye{constructor(){super(...arguments),this.height=null}};s([a({type:Ne,json:{read:!0,write:!0}})],We.prototype,"height",void 0),We=s([R("esri.rest.support.ImageHeightResult")],We);const xi=We;var gt;let O=gt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=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(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i.toJSON()))}set mosaicRule(i){let t=i;t?.mosaicMethod&&(t=H.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON()))}set rasterFunction(i){let t=i;t?.rasterFunction&&(t=S.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}writeRasterFunction(i,t,o){i!=null&&(t[o]=JSON.stringify(i.toJSON())),i.rasterFunctionDefinition&&(t[o]=JSON.stringify(i.rasterFunctionDefinition))}writeRasterFunctions(i,t,o){i!=null&&(t[o]=JSON.stringify(i.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(i,t,o){i!=null&&(t[o]=JSON.stringify(i))}writeTimeExtent(i,t,o){if(i!=null){const e=i.start!=null?i.start.getTime():null,r=i.end!=null?i.end.getTime():null;t[o]=e!=null?r!=null?`${e},${r}`:`${e}`:null}}clone(){return new gt(C({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,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}))}};s([a({json:{write:!0}})],O.prototype,"geometry",void 0),s([I("geometry")],O.prototype,"writeGeometry",null),s([a({type:H,json:{write:!0}})],O.prototype,"mosaicRule",null),s([I("mosaicRule")],O.prototype,"writeMosaicRule",null),s([a({type:S,json:{write:!0,name:"renderingRule"}})],O.prototype,"rasterFunction",null),s([I("rasterFunction")],O.prototype,"writeRasterFunction",null),s([a({type:[S],json:{write:!0,name:"renderingRules"}})],O.prototype,"rasterFunctions",void 0),s([I("rasterFunctions")],O.prototype,"writeRasterFunctions",null),s([a({type:V,json:{write:!0}})],O.prototype,"pixelSize",void 0),s([I("pixelSize")],O.prototype,"writePixelSize",null),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnGeometry",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnCatalogItems",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"returnPixelValues",void 0),s([a({type:Number,json:{write:!0}})],O.prototype,"maxItemCount",void 0),s([a({type:bt,json:{write:{target:"time"}}})],O.prototype,"timeExtent",void 0),s([I("timeExtent")],O.prototype,"writeTimeExtent",null),s([a({json:{write:!0}})],O.prototype,"raster",void 0),s([a({json:{write:!0}})],O.prototype,"viewId",void 0),s([a({type:Boolean,json:{write:!0}})],O.prototype,"processAsMultidimensional",void 0),O=gt=s([R("esri.rest.support.ImageIdentifyParameters")],O);const qt=O;let Z=class extends F{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}};s([a({json:{write:!0}})],Z.prototype,"catalogItemVisibilities",void 0),s([a({type:Ct,json:{write:!0}})],Z.prototype,"catalogItems",void 0),s([a({type:V,json:{write:!0}})],Z.prototype,"location",void 0),s([a({json:{write:!0}})],Z.prototype,"name",void 0),s([a({json:{write:!0}})],Z.prototype,"objectId",void 0),s([a({json:{write:!0}})],Z.prototype,"processedValues",void 0),s([a({json:{write:!0}})],Z.prototype,"properties",void 0),s([a({json:{write:!0}})],Z.prototype,"value",void 0),Z=s([R("esri.rest.support.ImageIdentifyResult")],Z);const Ii=Z;var ft;let Pe=ft=class extends F{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(i,t,o){t.geometries={geometryType:"esriGeometryPoint",geometries:i.map(e=>e.toJSON())}}clone(){return new ft({geometries:this.geometries?.map(i=>i.clone())??[],rasterId:this.rasterId})}};s([a({type:[V],json:{write:!0}})],Pe.prototype,"geometries",void 0),s([I("geometries")],Pe.prototype,"writeGeometry",null),s([a({type:Le,json:{write:!0}})],Pe.prototype,"rasterId",void 0),Pe=ft=s([R("esri.rest.support.ImagePixelLocationParameters")],Pe);const Fi=Pe;let Ke=class extends F{constructor(){super(...arguments),this.geometries=null}};s([a({json:{write:!0}})],Ke.prototype,"geometries",void 0),Ke=s([R("esri.rest.support.ImagePixelLocationResult")],Ke);const Di=Ke;var wt;let ve=wt=class extends X{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}get measureOperation(){const{is3D:i,geometry:t}=this;return t.type==="point"?i?"point-3D":"point":i?"centroid-3D":"centroid"}clone(){return new wt(C({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};s([a({types:ne,json:{name:"fromGeometry",read:ee}})],ve.prototype,"geometry",void 0),s([I("geometry")],ve.prototype,"writeGeometry",null),s([a({type:B.apiValues,json:{read:B.read,write:B.write}})],ve.prototype,"measureOperation",null),s([a({json:{read:!0}})],ve.prototype,"is3D",void 0),ve=wt=s([R("esri.rest.support.ImagePointParameters")],ve);const Ti=ve;let Ze=class extends ye{constructor(){super(...arguments),this.point=null}};s([a({type:V,json:{name:"point.value",read:!0,write:!0}})],Ze.prototype,"point",void 0),Ze=s([R("esri.rest.support.ImagePointResult")],Ze);const Pi=Ze;var Rt;let G=Rt=class extends F{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(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=i.toJSON())}set locations(i){if(i?.length){const t=new kt({spatialReference:i[0].spatialReference,points:i.map(({x:o,y:e})=>[o,e])});this._set("locations",i),this.geometry=t}}clone(){return new Rt(C({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}))}};s([a({types:ne,json:{read:ee}})],G.prototype,"geometry",void 0),s([I("geometry")],G.prototype,"writeGeometry",null),s([a()],G.prototype,"locations",null),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],G.prototype,"interpolation",void 0),s([a({type:H,json:{write:!0}})],G.prototype,"mosaicRule",void 0),s([a({type:[String],json:{write:!0}})],G.prototype,"outFields",void 0),s([a({type:V,json:{write:!0}})],G.prototype,"pixelSize",void 0),s([a({type:String,json:{write:!0}})],G.prototype,"raster",void 0),s([a({type:Boolean,json:{write:!0}})],G.prototype,"returnFirstValueOnly",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleDistance",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sampleCount",void 0),s([a({type:Number,json:{write:!0}})],G.prototype,"sliceId",void 0),s([a({type:bt,json:{read:{source:"time"},write:{target:"time"}}})],G.prototype,"timeExtent",void 0),G=Rt=s([R("esri.rest.support.ImageSampleParameters")],G);const ji=G;let ue=class extends F{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};s([a({json:{write:!0}})],ue.prototype,"attributes",void 0),s([a({type:V,json:{write:!0}})],ue.prototype,"location",void 0),s([a({json:{write:!0}})],ue.prototype,"locationId",void 0),s([a({json:{write:!0}})],ue.prototype,"rasterId",void 0),s([a({json:{write:!0}})],ue.prototype,"resolution",void 0),s([a({json:{write:!0}})],ue.prototype,"pixelValue",void 0),ue=s([R("esri.rest.support.ImageSample")],ue);const Ni=ue;let Xe=class extends F{constructor(){super(...arguments),this.samples=null}};s([a({type:[Ni],json:{write:!0}})],Xe.prototype,"samples",void 0),Xe=s([R("esri.rest.support.ImageSampleResult")],Xe);const _i=Xe;let be=class extends fe(F){constructor(){super(...arguments),this.geometries=[],this.rasterIds=null,this.outSpatialReference=null}writeGeometries(i,t,o){t.geometries=i?.length?{geometryType:Y(i[0]),geometries:i.map(e=>({...e.toJSON(),spatialReference:void 0}))}:null}};s([a({types:[ne]})],be.prototype,"geometries",void 0),s([I("geometries")],be.prototype,"writeGeometries",null),s([a({type:[Le],json:{write:!0}})],be.prototype,"rasterIds",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],be.prototype,"outSpatialReference",void 0),be=s([R("esri.rest.support.ImageToMapMultirayParameters")],be);const Oi=be;let pe=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.outSpatialReference=null,this.depthOffset=0,this.adjust=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}};s([a({types:ne,json:{read:ee,write:!0}})],pe.prototype,"geometry",void 0),s([I("geometry")],pe.prototype,"writeGeometry",null),s([a({json:{write:!0}})],pe.prototype,"rasterId",void 0),s([a({type:re,json:{name:"outSR",write:!0}})],pe.prototype,"outSpatialReference",void 0),s([a({json:{name:"options.DOff",write:!0}})],pe.prototype,"depthOffset",void 0),s([a({json:{name:"options.Adjust",write:!0}})],pe.prototype,"adjust",void 0),pe=s([R("esri.rest.support.ImageToMapParameters")],pe);const Ci=pe;let Me=class extends fe(F){constructor(){super(...arguments),this.referenceUri=null,this.rasterId=null}};s([a({type:String,json:{name:"uri",write:!0}})],Me.prototype,"referenceUri",void 0),s([a({type:Number,json:{write:!0}})],Me.prototype,"rasterId",void 0),Me=s([R("esri.rest.support.ImageUrlParameters")],Me);const Ai=Me;let Ye=class extends F{constructor(){super(...arguments),this.url=null}};s([a({json:{name:"imageURL",write:!0}})],Ye.prototype,"url",void 0),Ye=s([R("esri.rest.support.ImageUrlResult")],Ye);const Vi=Ye;let Se=class extends fe(F){constructor(){super(...arguments),this.geometry=null,this.rasterId=null,this.visibleOnly=!1}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]=JSON.stringify(i))}};s([a({types:ne,json:{read:ee,write:!0}})],Se.prototype,"geometry",void 0),s([I("geometry")],Se.prototype,"writeGeometry",null),s([a({json:{write:!0}})],Se.prototype,"rasterId",void 0),s([a({json:{name:"options.VisibleOnly",write:!0}})],Se.prototype,"visibleOnly",void 0),Se=s([R("esri.rest.support.MapToImageParameters")],Se);const Mi=Se;let me=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null,this.area=null,this.center=null}readCenter(i,t){return i.spatialReference||(i={...i,spatialReference:t.Shape.spatialReference}),V.fromJSON(i)}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],me.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],me.prototype,"length",void 0),s([a({json:{name:"Area",write:!0}})],me.prototype,"area",void 0),s([a({json:{name:"Center",write:!0}})],me.prototype,"center",void 0),s([E("center")],me.prototype,"readCenter",null),me=s([R("esri.rest.support.MeasureAreaFromImageResult")],me);const Ji=me;var vt;let je=vt=class extends F{constructor(){super(...arguments),this.geometry=null,this.rasterId=void 0}writeGeometry(i,t,o){i!=null&&(t.geometryType=Y(i),t[o]={...i.toJSON(),spatialReference:void 0})}clone(){const i=C({geometry:this.geometry,rasterId:this.rasterId});return new vt(i)}};s([a({types:ne,json:{name:"fromGeometry",read:ee,write:!0}})],je.prototype,"geometry",void 0),s([I("geometry")],je.prototype,"writeGeometry",null),s([a({json:{write:!0}})],je.prototype,"rasterId",void 0),je=vt=s([R("esri.rest.support.MeasureFromImageParameters")],je);const Ei=je;let Je=class extends F{constructor(){super(...arguments),this.geometry=null,this.length=null}};s([a({types:ne,json:{name:"Shape",read:ee,write:!0}})],Je.prototype,"geometry",void 0),s([a({json:{name:"Length",write:!0}})],Je.prototype,"length",void 0),Je=s([R("esri.rest.support.MeasureLengthFromImageResult")],Je);const qi=Je;function St(i){const t=i?.time;if(t&&(t.start!=null||t.end!=null)){const o=[];t.start!=null&&o.push(t.start),t.end==null||o.includes(t.end)||o.push(t.end),i.time=o.join(",")}}async function Gt(i,t,o){t=M(hr,t);const e=q(i),r=t.geometry?[t.geometry]:[],n=await xe(r),l=t.toJSON();St(l);const u=n?.[0];u!=null&&(l.geometry=se(u));const p=L({...e.query,f:"json",...l});return $(p,o)}async function Gi(i,t,o){const e=(t=M(pi,t)).toJSON();e.angleName!=null&&(e.angleName=e.angleName.join(",")),t?.point?.spatialReference?.imageCoordinateSystem&&(e.point.spatialReference=st(t.point.spatialReference)),t?.spatialReference?.imageCoordinateSystem&&(e.spatialReference=_e(t.spatialReference));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/computeAngles`,l);return u.spatialReference=u.spatialReference?u.spatialReference.geodataXform!=null?new re({wkid:0,imageCoordinateSystem:u.spatialReference}):re.fromJSON(u.spatialReference):null,u.north==="NaN"&&(u.north=null),u.up==="NaN"&&(u.up=null),new ci(u)}async function Li(i,t,o){const e=(t=M(Fi,t)).toJSON(),{geometries:r}=t;if(r)for(let m=0;m{u.avg=u.mean,u.stddev=u.standardDeviation}),{statistics:l,histograms:n.histograms}}async function zi(i,t,o){const e=await Gt(i,t,o),r=q(i),{data:n}=await x(`${r.path}/computeHistograms`,e);return{histograms:n.histograms}}async function Ui(i,t,o){const e=(t=M(ji,t)).toJSON();St(e),e.outFields?.length&&(e.outFields=e.outFields.join(","));const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=q(i),u=L({...l.query,f:"json",...e}),p=$(u,o),{data:m}=await x(`${l.path}/getSamples`,p),c=m?.samples?.map(d=>{const g=d.value==="NaN"||d.value===""?null:d.value.split(" ").map(h=>Number(h));return{...d,pixelValue:g}});return _i.fromJSON({samples:c})}async function jt(i,t,o){t=M(qt,t);const e=q(i),r=t.geometry?[t.geometry]:[];return xe(r).then(n=>{const l=t.toJSON(),u=n?.[0];u!=null&&(l.geometry=JSON.stringify(se(u)));const p=L({...e.query,f:"json",...l}),m=$(p,o);return x(e.path+"/identify",m)}).then(n=>Ii.fromJSON(n.data))}async function Hi(i,t,o){t=M(Si,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return xi.fromJSON(e)}async function Bi(i,t,o){t=M(mi,t);const e=await it(i,t,[t.geometry],o);return di.fromJSON(e)}async function Qi(i,t,o){t=M(Ti,t);const e=await it(i,t,[t.geometry],o);return Pi.fromJSON(e)}async function ki(i,t,o){t=M(gi,t);const e=await it(i,t,[t.fromGeometry,t.toGeometry],o);return fi.fromJSON(e)}async function it(i,t,o,e){const r=q(i),n=await xe(o),l=t.toJSON();n[0]!=null&&(l.fromGeometry=JSON.stringify(se(n[0]))),n[1]!=null&&(l.toGeometry=JSON.stringify(se(n[1])));const u=L({...r.query,f:"json",...l}),p=$(u,e),{data:m}=await x(r.path+"/measure",p);return m}async function Wi(i,t,o){const e=await Lt(i,t,o);return qi.fromJSON(e)}async function Ki(i,t,o){const e=await Lt(i,t,o);return Ji.fromJSON(e)}async function Lt(i,t,o){t=M(Ei,t);const e=q(i),r=t.toJSON(),n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/measureFromImage",l);return u}function se(i){const t=i.toJSON();return i.spatialReference?.imageCoordinateSystem&&(t.spatialReference=st(i.spatialReference)),t}function st(i){const{imageCoordinateSystem:t}=i;if(t){const{id:o,referenceServiceName:e}=t;return o!=null?e?{icsid:o,icsns:e}:{icsid:o}:{ics:t}}return i.toJSON()}function _e(i,t){if(!i.imageCoordinateSystem)return pt(i);const o=st(i),{icsid:e,icsns:r}=o;return e==null||r!=null&&!t?.toLowerCase().includes("/"+r.toLowerCase()+"/")?JSON.stringify(o):`0:${e}`}async function Zi(i,t,o){t=M(yi,t);const e=q(i),r=t.toJSON();t.outSpatialReference&&(r.outSR=_e(t.outSpatialReference));const n=L({...e.query,f:"json",...r}),l=$(n,o),{data:u}=await x(e.path+"/queryBoundary",l);return hi.fromJSON(u)}async function Xi(i,t,o){const e=(t=M(wi,t)).toJSON();St(e),e.objectIds?.length&&(e.objectIds=e.objectIds.join(",")),e.geometry||e.objectIds||e.time||e.where||(e.where="1=1");const r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n));const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/queryGPSInfo`,m);return bi.fromJSON(c)}async function Yi(i,t,o){const e=(t=M(Ci,t)).toJSON();t.geometry.spatialReference.imageCoordinateSystem&&(e.geometry=se(t.geometry)),t.depthOffset&&t.adjust||delete e.options;const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMap`,l);return ee(u)}async function es(i,t,o){const e=(t=M(Oi,t)).toJSON();t.rasterIds?.length&&(e.rasterIds=t.rasterIds.join(","));const r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/imageToMapMultiray`,l);return ee(u)}async function ts(i,t,o){const e=(t=M(Mi,t)).toJSON(),r=await xe(t.geometry),n=r?.[0];n!=null&&(e.geometry=se(n)),t.visibleOnly||delete e.options;const l=n?.spatialReference??t.geometry?.spatialReference;l&&(e.inSR=_e(l));const u=q(i),p=L({...u.query,f:"json",...e}),m=$(p,o),{data:c}=await x(`${u.path}/mapToImage`,m);return ee(c)}async function rs(i,t,o){const e=(t=M(Ai,t)).toJSON(),r=q(i),n=L({...r.query,f:"json",...e}),l=$(n,o),{data:u}=await x(`${r.path}/getImageUrl`,l);return Vi.fromJSON(u)}async function is(i,t,o){const e=(t=M(oi,t)).toJSON(),r=await xe([t.fromGeometry,t.toGeometry]);r[0]!=null&&(e.fromGeometry=se(r[0]),r[0].spatialReference&&(e.inSR=_e(r[0].spatialReference))),r[1]!=null&&(e.toGeometry=se(r[1])),t.objectIds?.length&&(e.objectIds=e.objectIds.join(","));const n=q(i),l=L({...n.query,f:"json",...e}),u=$(l,o),{data:p}=await x(`${n.path}/find`,u);return ui.fromJSON(p)}async function ss(i,t,o){const e=q(i),r=L({...e?.query,f:"json"}),n=$(r,o),l=`${e?.path}/${t}/info`,u=x(`${l}`,n),p=x(`${l}/keyProperties`,n),m=await Promise.allSettled([u,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let g=null;c.statistics?.length&&(g=c.statistics.map(J=>({min:J[0],max:J[1],avg:J[2],stddev:J[3]})));const h=Ee.fromJSON(c.extent),f=Math.ceil(h.width/c.pixelSizeX-.1),y=Math.ceil(h.height/c.pixelSizeY-.1),v=h.spatialReference,w=new V({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:v}),T=c.histograms?.length?c.histograms:null,j=new _r({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new Nt({width:f,height:y,bandCount:c.bandCount,extent:h,spatialReference:v,pixelSize:w,pixelType:c.pixelType.toLowerCase(),statistics:g,histograms:T,keyProperties:d,storageInfo:j})}const ns=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),as=Xt(Yt,{min:0,max:255});function os(i){const t=JSON.stringify(i),o=t.includes('"rasterFunctionDefinition":{'),e=o?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi),r=e?.map(n=>o?n.slice(8,-18):n.slice(18,-1));return r?r.join("/"):null}const ls=i=>{let t=class extends i{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.multidimensionalInfo=null,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 _({layer:this}))}readServiceSupportsMosaicRule(e,r){return this._isMosaicRuleSupported(r)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(r=>{e.set(r.name.toLowerCase().replaceAll(/ /gi,"_"),r.name)}),e}readBandIds(e,r){if(Array.isArray(e)&&e.length>0&&e.every(n=>typeof n=="number"))return e}readCapabilities(e,r){return this._readCapabilities(r)}writeCompressionQuality(e,r,n){e!=null&&this.format!=="lerc"&&(r[n]=e)}writeCompressionTolerance(e,r,n){this.format==="lerc"&&e!=null&&(r[n]=e)}readDefaultMosaicRule(e,r){return this._serviceSupportsMosaicRule?H.fromJSON(r):null}get fieldsIndex(){return this.fields?new Cr(this.fields):null}set format(e){e&&ns.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,r){return r.serviceDataType==="esriImageServiceDataTypeVector-UV"||r.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}readMaxScale(e,r){return r.minLOD!=null&&r.maxLOD!=null?e:0}set mosaicRule(e){let r=e;r?.mosaicMethod&&(r=H.fromJSON({...r.toJSON(),mosaicMethod:r.mosaicMethod,mosaicOperation:r.mosaicOperation})),this._set("mosaicRule",r)}readMosaicRule(e,r){const n=e||r.mosaicRule;return n?H.fromJSON(n):this._isMosaicRuleSupported(r)?H.fromJSON(r):null}writeMosaicRule(e,r,n){let l=this.mosaicRule;const u=this.definitionExpression;l?u&&u!==l.where&&(l=l.clone(),l.where=u):u&&(l=new H({where:u})),this._isValidCustomizedMosaicRule(l)&&(r[n]=l.toJSON())}writeNoData(e,r,n){e!=null&&typeof e=="number"&&(r[n]=as(e))}readObjectIdField(e,r){return e||(e=r.fields.find(n=>n.type==="esriFieldTypeOID"||n.type==="oid")?.name),e}get parsedUrl(){return Wt(this.url)}readSourceType(e,r){return this._isMosaicDataset(r)?"mosaic-dataset":"raster-dataset"}get renderer(){const{activePresetRendererName:e,presetRenderers:r}=this;return e?r?.find(({name:n})=>n===e)?.renderer.clone():this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("internalRenderer",e)}readRenderer(e,r,n){const l=r?.layerDefinition?.drawingInfo?.renderer,u=ar(l,n);return u==null?null:(u.type==="vector-field"&&r.symbolTileSize&&!l.symbolTileSize&&(u.symbolTileSize=r.symbolTileSize),At(u)||It.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),u)}writeRenderer(e,r,n){r.layerDefinition=r.layerDefinition||{},r.layerDefinition.drawingInfo=r.layerDefinition.drawingInfo||{},r.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(r.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this._rasterAttributeTableFieldPrefix,r=new we({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),n=new we({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),l=new we({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let u=this.fields?C(this.fields):[];u.push(n),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&u.push(r),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(m=>m.name.toLowerCase()==="none")&&u.push(l),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(m=>m.name.toLowerCase()!=="none").forEach(m=>{u.push(new we({name:"Raster.ServicePixelValue."+m.name,alias:m.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(u.push(new we({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),u.push(new we({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=this.rasterInfo??{};if(p!=null){const m=p.fields.filter(c=>c.type!=="esriFieldTypeOID"&&c.name.toLowerCase()!=="value").map(c=>{const d=C(c);return d.name=e+c.name,d});u=u.concat(m)}return u}set rasterFunction(e){let r=e;r?.rasterFunction&&(r=S.fromJSON({...r.toJSON(),rasterFunction:r.rasterFunction,rasterFunctionArguments:r.rasterFunctionArguments})),this._set("rasterFunction",r)}readRasterFunction(e,r){const n=r.rasterFunctionInfos;return r.renderingRule||n?.length&&n[0].name!=="None"?this._isRFTJson(r.renderingRule)?S.fromJSON({rasterFunctionDefinition:r.renderingRule}):S.fromJSON(r.renderingRule||{rasterFunctionInfos:r.rasterFunctionInfos}):null}readSpatialReference(e,r){const n=e||r.extent.spatialReference;return n?re.fromJSON(n):null}readPixelType(e){return nt.fromJSON(e)||e}writePixelType(e,r,n){this.serviceRasterInfo!=null&&this.pixelType===this.serviceRasterInfo.pixelType||(r[n]=nt.toJSON(e))}readVersion(e,r){let n=r.currentVersion;return n||(n=r.hasOwnProperty("fields")||r.hasOwnProperty("timeInfo")?10:9.3),n}applyFilter(e){let r=e;return this.pixelFilter&&(r=this._clonePixelData(e),this.pixelFilter(r)),r}async applyRenderer(e,r){let n=e;const{renderer:l,symbolizer:u,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&l&&u&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(l.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(u.bind(),await d.updateSymbolizer(u,r),this._cachedRendererJson=l.toJSON());const g=await d.symbolize({bandIds:m,...e},r);n={extent:e.extent,pixelBlock:g}}else n={extent:e.extent,pixelBlock:u.symbolize({bandIds:m,...e})}}return n}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeAngles)throw new b("imagery-layer:compute-angles","this operation is not supported on the input image service");return Gi(this.url,e,this._getRequestOptions(r))}async computePixelSpaceLocations(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputePixelLocation)throw new b("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return Li(this.url,e,this._getRequestOptions(r))}async computeHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeHistograms)throw new b("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),zi(this.url,e,this._getRequestOptions(r))}async computeStatisticsHistograms(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsComputeStatisticsHistograms)throw new b("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),$i(this.url,e,this._getRequestOptions(r))}async measureHeight(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(e.operationType==="base-and-top"?n.mensuration.supportsHeightFromBaseAndTop:e.operationType==="base-and-top-shadow"?n.mensuration.supportsHeightFromBaseAndTopShadow:n.mensuration.supportsHeightFromTopAndTopShadow))throw new b("imagery-layer:measure-height","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Hi(this.url,e,this._getRequestOptions(r))}async measureAreaAndPerimeter(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsAreaAndPerimeter&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Bi(this.url,e,this._getRequestOptions(r))}async measureDistanceAndAngle(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsDistanceAndAngle&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),ki(this.url,e,this._getRequestOptions(r))}async measurePointOrCentroid(e,r){const n=await this._fetchCapabilities(r?.signal);if(!(n.mensuration.supportsPointOrCentroid&&(!e.is3D||n.mensuration.supports3D)))throw new b("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=C(e),this._applyMosaicAndRenderingRules(e),Qi(this.url,e,this._getRequestOptions(r))}async measureLengthFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-length-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polyline")throw new b("imagery-layer:measure-length-from-image","this input geometry must be a polyline");return Wi(this.url,e,this._getRequestOptions(r))}async measureAreaFromImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMeasureFromImage)throw new b("imagery-layer:measure-area-from-image","this operation is not supported on the input image service");if(e.geometry.type!=="polygon")throw new b("imagery-layer:measure-area-from-image","this input geometry must be a polygon");return Ki(this.url,e,this._getRequestOptions(r))}getField(e){const{fieldsIndex:r}=this;return r?.get(e)}getFieldDomain(e,r){const n=this.getField(e);return n?n.domain:null}async fetchImage(e,r,n,l={}){if(e==null||r==null||n==null)throw new b("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 d=await this._generateRasterInfo(this.rasterFunction,{signal:l.signal});d&&(this.rasterInfo=d)}const u=this.getExportImageServiceParameters(e,r,n,l.timeExtent);if(u==null){if(l.requestAsImageElement&&this._canRequestImageElement(this.format)){const w=document.createElement("canvas");return w.width=r,w.height=n,l.returnImageBitmap?{imageBitmap:await Tt(w,`${o(this.parsedUrl)}/exportImage`,l.signal)}:{imageOrCanvasElement:w}}const{bandIds:d,rasterInfo:g}=this,h=(d?.length||g.bandCount)??0,f=r*n,y=g.pixelType,v=[];for(let w=0;w=10.3?e?.rasterFunction:null})}).then(r=>r.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new b("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):x(o(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(r=>Ct.fromJSON(r.data))}getCatalogItemRasterInfo(e,r){const n={...r,query:this._getQueryParams()};return ss(o(this.parsedUrl),e,n)}async getCatalogItemICSInfo(e,r){const{data:n}=await x(o(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...r}),l=n?.ics;if(!l)return;let u=null;try{u=(await x(o(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...r})).data.extent}catch{}if(!u?.spatialReference)return{ics:l,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?x(o(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...r}).then(P=>P.data).catch(()=>({})):{},m=u.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[u]}),inSR:pt(m),outSR:"0:"+e},d=x(o(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...r}).then(P=>P.data).catch(()=>({})),g=5,h=(u.xmin+u.xmax)/2,f=(u.ymax-u.ymin)/(g+1),y=u.ymin+f,v=[];for(let P=0;PP.data).catch(()=>({})),j=await Promise.all([p,d,T]);let J=j[0].ipxf;if(J==null){const P=l.geodataXform?.xf_0;P?.name?.toLowerCase()==="topup"&&P?.coefficients?.length===6&&(J={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:P.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const N=Ee.fromJSON(j[1]?.geometries?.[0]);N&&(N.spatialReference=new re({wkid:0,imageCoordinateSystem:l}));const D=j[2].geometries?j[2].geometries.filter(P=>P?.x!=null&&P.y!=null&&P.x!=="NaN"&&P.y!=="NaN"):[],A=D.length;if(A<3)return{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:null};let U=0,Oe=0,$e=0,ze=0;for(let P=0;PD[0].x,xt=D[g-1].y>D[0].y;return Q===1/0?k=xt?90:270:Q===0?k=Ie?0:180:Q>0?k=Ie?180*Math.atan(Q)/Math.PI:180*Math.atan(Q)/Math.PI+180:Q<0&&(k=xt?180+180*Math.atan(Q)/Math.PI:360+180*Math.atan(Q)/Math.PI),{ics:l,icsToPixelTransform:J,icsExtent:N,northDirection:k}}async generateRasterInfo(e,r){e=M(S,e);const n={...r,query:this._getQueryParams()};if(!e||e.functionName?.toLowerCase()==="none"||this._isVectorFieldResampleFunction(e))return this.serviceRasterInfo??Ft(o(this.parsedUrl),this.sourceJSON,n);const l=os(e);if(!l)throw new b("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[l])return this._functionRasterInfos[l];const u=or(o(this.parsedUrl),e,n);this._functionRasterInfos[l]=u;try{return await u}catch(p){throw this._functionRasterInfos[l]=null,p}}getExportImageServiceParameters(e,r,n,l){e=e.clone().shiftCentralMeridian();const u=_e(e.spatialReference,o(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const g=this.rasterFunction?.rasterFunctionDefinition,h=this.renderer?.type,f=!h||h==="raster-stretch"||h==="raster-colormap"||h==="unique-value"||h==="class-breaks"||h==="raster-shaded-relief";if(m?.length&&this._hasRasterFunction(this.rasterFunction)&&!g&&f){const w={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")w.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=w;else if(d.rasterFunction==="Colormap"){const T=d.rasterFunctionArguments.Raster;T?.rasterFunction==="Stretch"?(w.rasterFunctionArguments.Raster=T.rasterFunctionArguments.Raster,T.rasterFunctionArguments.Raster=w):(w.rasterFunctionArguments.Raster=T,d.rasterFunctionArguments.Raster=w)}else w.rasterFunctionArguments.Raster=d,d=w;p.bandIds=void 0}else p.bandIds=m?.join(",");Array.isArray(c)&&c.length>0&&(p.noData=c.join(","));const y=this._processMultidimensionalIntersection(null,l,this.exportImageServiceParameters.mosaicRule);if(y.isOutSide)return null;p.mosaicRule=y.mosaicRule!=null?JSON.stringify(y.mosaicRule):null,l=y.timeExtent,p.renderingRule=this._getRenderingRuleString(S.fromJSON(d));const v={};if(l!=null){const{start:w,end:T}=l.toJSON();w&&T&&w===T?v.time=""+w:w==null&&T==null||(v.time=`${w??"null"},${T??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:u,imageSR:u,size:r+","+n,...p,...v}}async getSamples(e,r){if(!(await this._fetchCapabilities(r?.signal))?.operations.supportsGetSamples)throw new b("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=C(e);const{raster:n}=this;return n&&e.raster==null&&(e.raster=n),Ui(this.url,e,this._getRequestOptions(r))}async identify(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsIdentify)throw new b("imagery-layer:identify","identify operation is not supported on the input image service");e=C(e),this.version<10.91&&e.geometry?.type==="extent"&&(e.geometry=ut.fromExtent(e.geometry));const n=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(n.isOutSide)throw new b("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=n.timeExtent,e.mosaicRule=n.mosaicRule;const{raster:l,rasterFunction:u}=this;return u&&e.rasterFunction==null&&(e.rasterFunction=u),l&&e.raster==null&&(e.raster=l),jt(this.url,e,this._getRequestOptions(r))}async imageToMap(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMap)throw new b("imagery-layer:image-to-map","imageToMap operation is not supported on the input image service");return Yi(o(this.parsedUrl),e,this._getRequestOptions(r))}async imageToMapMultiray(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsImageToMapMultiray)throw new b("imagery-layer:image-to-map-multiray","imageToMapMultiray operation is not supported on the input image service");return es(o(this.parsedUrl),e,this._getRequestOptions(r))}async mapToImage(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsMapToImage)throw new b("imagery-layer:map-to-image","mapToImage operation is not supported on the input image service");return ts(o(this.parsedUrl),e,this._getRequestOptions(r))}async findImages(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsFindImages)throw new b("imagery-layer:find-images","findImages operation is not supported on the input image service");return is(o(this.parsedUrl),e,this._getRequestOptions(r))}async getImageUrl(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsGetImageUrl)throw new b("imagery-layer:get-image-url","getImageUrl operation is not supported on the input image service");return rs(o(this.parsedUrl),e,this._getRequestOptions(r))}createQuery(){return new lt({outFields:["*"],returnGeometry:!0,where:this.definitionExpression||"1=1"})}async queryBoundary(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryBoundary)throw new b("imagery-layer:query-boundary","queryBoundary operation is not supported on the input image service");return e=e??{outSpatialReference:this.spatialReference},Zi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasters(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Jr(this.url,e,r)}async queryObjectIds(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Vr(this.url,e,r)}async queryGPSInfo(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQueryGPSInfo)throw new b("imagery-layer:query-gps-info","queryGPSInfo operation is not supported on the input image service");return e=e??{where:"1=1"},Xi(o(this.parsedUrl),e,this._getRequestOptions(r))}async queryRasterCount(e,r){return{query:e,requestOptions:r}=await this._prepareForQuery(e,r),Mr(this.url,e,r)}async queryVisibleRasters(e,r){if(!e)throw new b("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:n,returnDomainValues:l,returnTopmostRaster:u,showNoDataRecords:p}=r||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let m=!1,c=null,d=null;const g="raster.servicepixelvalue",h=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(m=e.outFields.some(N=>!N.toLowerCase().includes(g)),this.version>=10.4)){const N=e.outFields.filter(A=>A.toLowerCase().includes(g)&&A.length>g.length).map(A=>{const U=A.slice(g.length+1);return[this._updateRenderingRulesFunctionName(U,h),U]});c=N.map(A=>new S({functionName:A[0]})),d=N.map(A=>A[1]);const{rasterFunction:D}=this;c.length===0?D?.functionName?(c.push(D),d.push(D.functionName)):c=null:D?.functionName&&!c.some(A=>A.functionName===D.functionName)&&(c.push(D),d.push(D.functionName))}const f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:y}=this;let v=e.timeExtent||this.timeExtent;if(y){const{isOutside:N,intersection:D}=at(y,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(N)throw new b("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");D?.timeExtent!=null&&(v=D.timeExtent)}const w=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,v);let T=e.geometry;this.version<10.91&&T?.type==="extent"&&(T=ut.fromExtent(T));const j=this._getQueryParams({geometry:T,timeExtent:v,mosaicRule:w,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:n,returnCatalogItems:m,returnGeometry:f,raster:this.raster,maxItemCount:u?1:null});delete j.f;const J=new qt(j);try{await this._generateRasterInfo(this.rasterFunction);const N=await jt(this.url,J,{signal:r?.signal,query:{...this.customParameters}}),D=e.outFields,A=N.value!=null&&N.value.toLowerCase().includes("nodata");if(!(m&&!f&&N?.catalogItems?.features.length&&(p||!A)))return this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D});const U=this.objectIdField||"ObjectId",Oe=N.catalogItems?.features??[],$e=Oe.map(k=>k.attributes?.[U]),ze=new lt({objectIds:$e,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[U]}),Q=await this.queryRasters(ze);return Q?.features?.length&&Q.features.forEach(k=>{Oe.forEach(Ie=>{Ie.attributes[U]===k.attributes[U]&&k.geometry&&(Ie.geometry=k.geometry.clone(),e.outSpatialReference!=null&&(Ie.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(N,{returnDomainValues:l,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:D})}catch{throw new b("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,r){const n=x(o(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.statistics),l=x(o(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:r}).then(p=>p.data?.histograms),u=await Promise.all([n,l]);return u[0]&&u[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:u[0]||null,histograms:u[1]||null}}async createFlowMesh(e,r){const n=this._rasterJobHandler.instance;return n?n.createFlowMesh(e,r):Ir(e.meshType,e.simulationSettings,e.flowData,r.signal!=null?r.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const r=e??this.serviceRasterInfo.multidimensionalInfo;return vr(this.multidimensionalSubset,r)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const r=this.sourceJSON,n=this.serviceRasterInfo!=null?Promise.resolve(this.serviceRasterInfo):Ft(o(this.parsedUrl),r,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),this._set("multidimensionalInfo",p.multidimensionalInfo),lr(p,r),p)),l=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,u=this._getRasterFunctionInfos();return Promise.all([n,l,u]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set("internalRenderer",null),It.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("internalRenderer",this._configRenderer(this.renderer)),this.addHandles([Kt(()=>this.rasterFunction,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,r){const n=this.timeInfo,{multidimensionalInfo:l}=this.serviceRasterInfo;if(e==null||l==null||r==null||n?.startField==null)return e;const{startField:u}=n,p=l.variables.some(y=>y.dimensions.some(v=>v.name===u))?u:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(y=>y.dimensionName!==p),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const m=e.multidimensionalDefinition.filter(y=>y.dimensionName===p),c=r.start!=null?r.start.getTime():null,d=r.end!=null?r.end.getTime():null,g=c==null||d==null||c===d,h=g?[c||d]:[[c,d]],f=this.version>=10.8;if(m.length)m.forEach(y=>{y.dimensionName===p&&(f?(y.dimensionName=null,y.isSlice=!1,y.values=[]):(y.isSlice=g,y.values=h))});else if(!f){const y=e.multidimensionalDefinition.filter(v=>v.variableName!=null&&v.dimensionName==null);y.length?y.forEach(v=>{v.dimensionName=p,v.isSlice=g,v.values=h}):e.multidimensionalDefinition.push(new br({variableName:"",dimensionName:p,isSlice:g,values:h}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(r=>!(!r.variableName&&!r.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,r){if(!(await this._fetchCapabilities(r?.signal)).operations.supportsQuery)throw new b("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=e!=null?M(lt,e):this.createQuery(),r=this._getRequestOptions(r),this.raster&&(r.query={...r.query,raster:this.raster}),{query:e,requestOptions:r}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new yr;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:r,rasterFunction:n}=this;return e.type==="unique-value"&&this._hasRasterFunction(n)&&r?.bandCount===1&&["u8","s8"].includes(r.pixelType)||r!=null&&e!=null&&ur(r).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let r=this.sourceJSON;if(!r){const{data:n,ssl:l}=await x(o(this.parsedUrl),{query:this._getQueryParams(),signal:e});r=n,this.sourceJSON=r,l&&(this.url=this.url.replace(/^http:/i,"https:"))}if(r.capabilities?.toLowerCase().split(",").map(n=>n.trim()).indexOf("tilesonly")>-1)throw new b("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(r,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const r=this._isMosaicDataset(e),n=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return r||n}_isVectorFieldResampleFunction(e){if(e==null)return!1;const{functionName:r,functionArguments:n}=e,l=r?.toLowerCase()==="resample",u=n?.ResampleType||n?.resampleType;return l&&(u===7||u===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){const r=this._isPicture(),{rasterInfo:n}=this;if(!r&&!this.pixelFilter||this._isVectorDataSet()){const l=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,u=pr({variableName:l,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&n.bandCount>=3){const m=u?.bandIds??cr(n);!m||n.bandCount===3&&m[0]===0&&m[1]===1&&m[2]===2||(this.bandIds=m)}e||(e=u?.renderer??mr(n,{bandIds:this.bandIds,variableName:this.rasterFunction?null:l}));const p=dr(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=p,this.symbolizer.rasterInfo=n):this.symbolizer=new jr({rendererJSON:p,rasterInfo:n}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock!=null?e.pixelBlock.clone():null}}_getQueryParams(e){e?.renderingRule!=null&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:r,viewId:n}=this;return{raster:r,viewId:n,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,r,n){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:r}):Dt(e,r,n)}async _getRasterFunctionInfos(e){const r=this.sourceJSON.rasterFunctionInfos;return this.loaded?r:r&&this.version>=10.3?r.length===1&&r[0].name.toLowerCase()==="none"?r:(await x(o(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:r,requestAsImageElement:n,returnImageBitmap:l,signal:u}=e;if(n&&this._canRequestImageElement(r.format)){const f=`${o(this.parsedUrl)}/exportImage`,{data:y}=await x(f,{responseType:l?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:u});return y instanceof Blob?{imageBitmap:await Tt(y,f,u),params:r}:{imageOrCanvasElement:y,params:r}}const p=this._initJobHandler(),m=x(o(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:u}),c=(await Promise.all([m,p]))[0].data,d=r.format||"jpgpng";let g=d;if(g!=="bsq"&&g!=="bip"&&(g=Nr(c)),!g)throw new b("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(c)));const h={signal:u};return{pixelData:{pixelBlock:await(d==="gif"||d==="bmp"||d.includes("png")&&(g==="png"||g==="jpg")?Dt(c,{useCanvas:!0,...r},h):this._decodePixelBlock(c,{width:r.width,height:r.height,planes:null,pixelType:null,noDataValue:null,format:d},h)),extent:r.extent},params:r}}_generateRasterInfo(e,r){return this.generateRasterInfo(e,r).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let r=Sr(e,{multidimensionalSubset:this.multidimensionalSubset});if(r!=null&&r.length>0){this.mosaicRule=this.mosaicRule||new H;const n=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&this.rasterFunction.functionName?.toLowerCase()!=="none"&&r.forEach(l=>l.variableName=""),r=r.filter(({variableName:l,dimensionName:u})=>l&&l!=="*"||u),!n?.length&&r.length&&(this.mosaicRule.multidimensionalDefinition=r)}}_processVisibleRastersResponse(e,r){r=r||{};const n=e.value,{templateRRFunctionNames:l,showNoDataRecords:u,returnDomainValues:p,templateFields:m}=r,c=e.processedValues;let d=e.catalogItems?.features,g=e.properties?.Values?.map(j=>j.replaceAll(/ /gi,", "))||[];const h=this.objectIdField||"ObjectId",f=typeof n=="string"&&n.toLowerCase().includes("nodata"),y=[];if(n&&!d&&!f){const j={};j[h]=0,g=[n],d=[new Zt({geometry:this.fullExtent,attributes:j})]}if(!d)return[];let v,w,T;this._updateResponseFieldNames(d,m),f&&!u&&(d=[]);for(let j=0;j0&&l&&l.length>0&&l.includes(this.rasterFunction.functionName)?c[l.indexOf(this.rasterFunction.functionName)]:n,w.toLowerCase()==="nodata"&&!u)continue;const J="Raster.ItemPixelValue",N="Raster.ServicePixelValue";v.attributes[J]=w,v.attributes[N]=T,this._updateFeatureWithMagDirValues(v,w);const D=this.fields&&this.fields.length>0;let A=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?D?w:n:T;this.rasterFunction||(A=D?w:n),this._updateFeatureWithRasterAttributeTableValues(v,A)}if(v.sourceLayer=v.layer=this,p&&this._updateFeatureWithDomainValues(v),l&&c&&l.length===c.length)for(let J=0;Jc.name).find(c=>c.toLowerCase()==="value");if(!p)return;const m=l.filter(c=>c.attributes[p]===(r!=null?parseInt(r,10):null));m&&m[0]&&u.forEach(c=>{const d=this._rasterAttributeTableFieldPrefix+c.name;e.attributes[d]=m[0].attributes[c.name]})}_updateFeatureWithMagDirValues(e,r){if(!this._isVectorDataSet())return;const n=r.split(/,\s*/).map(c=>parseFloat(c)),l=n.map(c=>[c]),u=n.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new ot({height:1,width:1,pixelType:"f32",pixels:l,statistics:u});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new Ee(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:Fr([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){(this.fields&&this.fields.filter(r=>r.domain&&r.domain.type==="coded-value"))?.forEach(r=>{const n=e.attributes[r.name];if(n!=null){const l=r.domain.codedValues.find(u=>u.code===n);l&&(e.attributes[r.name]=l.name)}})}_updateResponseFieldNames(e,r){if(!r||r.length<1)return;const n=this.fieldsIndex;n!=null&&e.forEach(l=>{if(l?.attributes)for(const u of r){const p=n.get(u)?.name;p&&p!==u&&(l.attributes[u]=l.attributes[p],delete l.attributes[p])}})}_getRenderingRuleString(e){if(e){let r=e.toJSON();return r=r.rasterFunctionDefinition??r,(r.thumbnail||r.thumbnailEx)&&(r.thumbnail=r.thumbnailEx=null),JSON.stringify(r)}return null}_hasRasterFunction(e){return e?.functionName!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,r){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const n=e.toLowerCase().replaceAll(/ /gi,"_");return r.has(n)?r.get(n):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_applyMosaicAndRenderingRules(e){const{raster:r,mosaicRule:n,rasterFunction:l}=this;l&&"rasterFunction"in e&&e.rasterFunction==null&&(e.rasterFunction=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),r&&e.raster==null&&(e.raster=r)}_readCapabilities(e){const r=e.capabilities?e.capabilities.toLowerCase().split(",").map(w=>w.trim()):["image","catalog"],{currentVersion:n,advancedQueryCapabilities:l,maxRecordCount:u}=e,p=r.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!(!e.spatialReference&&!e.extent?.spatialReference),d=r.includes("edit"),g=r.includes("mensuration")&&c,h=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(",").map(w=>w.trim()),f=g&&h.includes("basic"),y=this._isMosaicDataset(e)&&r.includes("catalog"),v=r.includes("download");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsImageToMap:n>=11.2&&y,supportsImageToMapMultiray:n>=11.2&&y,supportsMapToImage:n>=11.2&&y,supportsFindImages:n>=11.2&&y,supportsGetImageUrl:n>=11.3&&v,supportsMeasure:g,supportsMeasureFromImage:n>=11.2,supportsDownload:v,supportsQuery:y&&e.fields&&e.fields.length>0,supportsGetSamples:n>=10.2&&p,supportsProject:n>=10.3&&p,supportsComputeStatisticsHistograms:n>=10.4&&p,supportsQueryBoundary:n>=10.6&&p,supportsCalculateVolume:n>=10.7&&m,supportsComputePixelLocation:n>=10.7&&y,supportsComputeAngles:n>=10.91,supportsQueryGPSInfo:n>=11.2&&y,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,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:u,maxRecordCountFactor:void 0,supportsStatistics:!!l?.supportsStatistics,supportsOrderBy:!!l?.supportsOrderBy,supportsDistinct:!!l?.supportsDistinct,supportsPagination:!!l?.supportsPagination,supportsStandardizedQueriesOnly:!!l?.useStandardizedQueries,supportsPercentileStatistics:!!l?.supportsPercentileStatistics,supportsCentroid:!!l?.supportsReturningGeometryCentroid,supportsDistance:!!l?.supportsQueryWithDistance,supportsExtent:!!l?.supportsReturningQueryExtent,supportsGeometryProperties:!!l?.supportsReturningGeometryProperties,supportsHavingClause:!!l?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!l?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:f,supportsAreaAndPerimeter:f,supportsPointOrCentroid:f,supportsHeightFromBaseAndTop:g&&h.includes("base-top height"),supportsHeightFromBaseAndTopShadow:g&&h.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:g&&h.includes("top-top shadow height"),supports3D:g&&h.includes("3d")}}}};function o(e){return e?.path??""}return s([a({clonable:!1})],t.prototype,"_functionRasterInfos",void 0),s([a({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),s([a({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),s([a({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),s([E("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),s([a({readOnly:!0})],t.prototype,"_rasterAttributeTableFieldPrefix",void 0),s([a({readOnly:!0})],t.prototype,"_rasterFunctionNamesIndex",null),s([a()],t.prototype,"adjustAspectRatio",void 0),s([a({type:[Le],json:{write:!0}})],t.prototype,"bandIds",void 0),s([E("bandIds")],t.prototype,"readBandIds",null),s([a({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),s([E("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),s([a({type:Number})],t.prototype,"compressionQuality",void 0),s([I("compressionQuality")],t.prototype,"writeCompressionQuality",null),s([a({type:Number})],t.prototype,"compressionTolerance",void 0),s([I("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),s([a({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),s([a({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"defaultMosaicRule",void 0),s([E("defaultMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultMosaicRule",null),s([a({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),s([a({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),s([a()],t.prototype,"rasterInfo",void 0),s([a({readOnly:!0,type:[we]})],t.prototype,"fields",void 0),s([a({readOnly:!0})],t.prototype,"fieldsIndex",null),s([a({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff","bip","bsq"],json:{write:!0}})],t.prototype,"format",null),s([E("service","format",["serviceDataType"])],t.prototype,"readFormat",null),s([a({type:Ee})],t.prototype,"fullExtent",void 0),s([a({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),s([a({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),s([a({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),s([a({type:String,json:{type:he.jsonValues,read:he.read,write:he.write}})],t.prototype,"interpolation",void 0),s([a()],t.prototype,"minScale",void 0),s([E("service","minScale")],t.prototype,"readMinScale",null),s([a()],t.prototype,"maxScale",void 0),s([E("service","maxScale")],t.prototype,"readMaxScale",null),s([a({type:H})],t.prototype,"mosaicRule",null),s([E("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),s([I("mosaicRule")],t.prototype,"writeMosaicRule",null),s([a()],t.prototype,"multidimensionalInfo",void 0),s([a({type:ir,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),s([a({json:{type:Le}})],t.prototype,"noData",void 0),s([I("noData")],t.prototype,"writeNoData",null),s([a({type:String,json:{type:qe.jsonValues,read:qe.read,write:qe.write}})],t.prototype,"noDataInterpretation",void 0),s([a({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),s([E("objectIdField")],t.prototype,"readObjectIdField",null),s([a({readOnly:!0})],t.prototype,"geometryType",void 0),s([a({})],t.prototype,"typeIdField",void 0),s([a({})],t.prototype,"types",void 0),s([a({readOnly:!0})],t.prototype,"parsedUrl",null),s([a({type:Function})],t.prototype,"pixelFilter",void 0),s([a()],t.prototype,"raster",void 0),s([a({readOnly:!0})],t.prototype,"sourceType",void 0),s([E("sourceType",["serviceSourceType","fields"])],t.prototype,"readSourceType",null),s([a()],t.prototype,"viewId",void 0),s([a()],t.prototype,"renderer",null),s([a({types:sr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:nr,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],t.prototype,"internalRenderer",null),s([E("internalRenderer")],t.prototype,"readRenderer",null),s([I("internalRenderer")],t.prototype,"writeRenderer",null),s([a({clonable:!1})],t.prototype,"symbolizer",void 0),s([a(wr)],t.prototype,"opacity",void 0),s([a({readOnly:!0})],t.prototype,"rasterFields",null),s([a({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),s([a({type:S,json:{name:"renderingRule"}})],t.prototype,"rasterFunction",null),s([E("rasterFunction",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRasterFunction",null),s([a({readOnly:!0})],t.prototype,"serviceDataType",void 0),s([a({readOnly:!0,type:re})],t.prototype,"spatialReference",void 0),s([E("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),s([a({json:{type:nt.jsonValues}})],t.prototype,"pixelType",void 0),s([E("pixelType")],t.prototype,"readPixelType",null),s([I("pixelType")],t.prototype,"writePixelType",null),s([a({constructOnly:!0,type:Nt})],t.prototype,"serviceRasterInfo",void 0),s([a()],t.prototype,"sourceJSON",void 0),s([a(Rr)],t.prototype,"url",void 0),s([a({readOnly:!0})],t.prototype,"version",void 0),s([E("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=s([R("esri.layers.mixins.ArcGISImageService")],t),t};let z=class extends qr(Hr(Ur(Lr($r(rr(ls(zr(Gr(Er(er(fe(tr)))))))))))){constructor(...i){super(...i),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=Ht(async(t,o,e)=>{const{save:r,saveAs:n}=await $t(()=>import("./imageryUtils-6MVSqijr-2ufISwt4.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(t){case Ue.SAVE:return r(this,o);case Ue.SAVE_AS:return n(this,e,o)}})}normalizeCtorArgs(i,t){return typeof i=="string"?{url:i,...t}:i}load(i){const t=i!=null?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},i).catch(Bt).then(()=>this._fetchService(t))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(i){this._set("legendEnabled",i)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(i){this._set("listMode",i)}writeOperationalLayerType(i,t,o){const e=this.renderer?.type==="vector-field";t[o]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(i){const t=this.rasterFields,o=this.title,e=new Set;let r=!1,n=!1;this.capabilities&&(r=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,n=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const l=new Set;r&&l.add("raster.itempixelvalue");for(const p of t){const m=p.name.toLowerCase();l.has(m)||m.includes("raster.servicepixelvalue.")||e.add(p.name)}n&&e.add("raster.magnitude").add("raster.direction");const u=Qr({fields:t,title:o},{...i,visibleFieldNames:e});return u?.fieldInfos&&this.rasterInfo?.pixelType.startsWith("f")&&u.fieldInfos.forEach(({format:p,fieldName:m})=>{p&&m&&/^raster\.(item|service)pixelvalue/i.test(m)&&(p.places=2)}),u}queryFeatures(i,t){return this.queryRasters(i,t).then(o=>{if(o?.features)for(const e of o.features)e.layer=e.sourceLayer=this;return o})}queryFeatureCount(i,t){return this.queryRasterCount(i,t)}redraw(){this.emit("redraw")}async save(i){return this._debouncedSaveOperations(Ue.SAVE,i)}async saveAs(i,t){return this._debouncedSaveOperations(Ue.SAVE_AS,t,i)}serviceSupportsSpatialReference(i){return Br(this,i)}write(i,t){if(!this._isPreviewLayer)return super.write(i,t);if(t?.messages){const o=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new b("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this}))}return null}};s([a(gr)],z.prototype,"legendEnabled",null),s([a({type:["show","hide"]})],z.prototype,"listMode",null),s([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],z.prototype,"isReference",void 0),s([a({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],z.prototype,"operationalLayerType",void 0),s([I("web-map","operationalLayerType")],z.prototype,"writeOperationalLayerType",null),s([a(fr)],z.prototype,"popupEnabled",void 0),s([a({type:Qt,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],z.prototype,"popupTemplate",void 0),s([a({readOnly:!0})],z.prototype,"defaultPopupTemplate",null),s([a({readOnly:!0,json:{read:!1}})],z.prototype,"type",void 0),s([a({readOnly:!0})],z.prototype,"_isPreviewLayer",null),z=s([R("esri.layers.ImageryLayer")],z);const Pn=z;export{Pn as default}; diff --git a/custom-toc-highlight/assets/ImageryLayerView2D-CVDvTIGY-DlSiRq0n.js b/custom-toc-highlight/assets/ImageryLayerView2D-CVDvTIGY-BlDqRH6r.js similarity index 75% rename from custom-toc-highlight/assets/ImageryLayerView2D-CVDvTIGY-DlSiRq0n.js rename to custom-toc-highlight/assets/ImageryLayerView2D-CVDvTIGY-BlDqRH6r.js index 845a9e86..76b81981 100644 --- a/custom-toc-highlight/assets/ImageryLayerView2D-CVDvTIGY-DlSiRq0n.js +++ b/custom-toc-highlight/assets/ImageryLayerView2D-CVDvTIGY-BlDqRH6r.js @@ -1,4 +1,4 @@ -import{v as s,S as o,i as w,ah as f,av as V,ag as E,bi as b,a2 as S,K as F,j as R,aU as _,a1 as P,bp as I,n as D,ax as $,f as A,bM as U,o as C,$ as L,w as q}from"./story-BfX8CRfG.js";import{o as M}from"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import{o as N,c as O,l as j}from"./RasterVFDisplayObject-CnriTVT9-CjUrEqNq.js";import{X as H,Y as G}from"./LayerView-Bish-E63-rB2WUWF4.js";import{X as J}from"./GraphicsView2D-C4wYE2ut-DMrrhOCh.js";import{l as W}from"./HighlightGraphicContainer-Dt5r6lMq-KuyTjNqc.js";import{z as X,P as K,w as Q}from"./dataUtils-BkPy4R3C-Cb9EIxnj.js";import{d as Y}from"./BitmapContainer-BC8fvmFc-myTzpniv.js";import{x as Z}from"./Container-BcuL1ZEG-DxXVQv25.js";import{d as tt}from"./Bitmap-CcqmzvfR-Bqft9oF3.js";import{K as et}from"./ExportStrategy-BNE7Gp0u-j76jQ8Ao.js";import{o as it}from"./rasterProjectionHelper-Calp0o_1-DktPwJyi.js";import{E as B}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{N as rt}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{T as st}from"./timeSupport-ohWmWReZ-ByDHlqgT.js";import{b as at}from"./Query-BrwMGK8U-DoFNfkjX.js";import{m as ot}from"./popupUtils-nV1O8RUO-DAL58cHP.js";import{n as nt}from"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";import"./main-ugzBrWNm.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";import"./AGraphicContainer-LUCT6Gle-Dvv0TF4N.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";let h=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new Z,this.updateRequested=!1,this.type="imagery",this._bitmapView=new Y}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.strategy.update(t).catch(e=>{_(e)||P.getLogger(this).error(e)})}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new et({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,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 t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=await this.layer.applyRenderer({extent:e.extent,pixelBlock:e.originalPixelBlock??e.pixelBlock});e.filter=r=>this.layer.pixelFilter?this.layer.applyFilter(r):{...i,extent:e.extent}}).catch(t=>{_(t)||P.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(t.length===1&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(a=>a.source).filter(a=>a.extent&&a.extent.intersects(e)).map(a=>({extent:a.extent,pixelBlock:a.originalPixelBlock})),r=X(i,e);return r!=null?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent,r.requestAsImageElement=!0,r.returnImageBitmap=!0;const a=await this.layer.fetchImage(t,e,i,r);if(a.imageBitmap)return a.imageBitmap;const n=await this.layer.applyRenderer(a.pixelData,{signal:r.signal}),l=new tt(n.pixelBlock,n.extent?.clone(),a.pixelData.pixelBlock);return l.filter=u=>this.layer.applyFilter(u),l}};s([o()],h.prototype,"attached",void 0),s([o()],h.prototype,"container",void 0),s([o()],h.prototype,"layer",void 0),s([o()],h.prototype,"strategy",void 0),s([o()],h.prototype,"timeExtent",void 0),s([o()],h.prototype,"view",void 0),s([o()],h.prototype,"updateRequested",void 0),s([o()],h.prototype,"updating",null),s([o()],h.prototype,"type",void 0),h=s([w("esri.views.2d.layers.imagery.ImageryView2D")],h);const lt=h;class ht extends rt{constructor(){super(...arguments),this.symbolTypes=["triangle"]}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (vf)",brushes:[j],target:()=>this.children,drawPhase:B.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===B.MAP&&this.symbolTypes.forEach(i=>{e.renderPass=i,super.doRender(e)})}}let y=class extends R{constructor(t){super(t),this._loading=null,this.update=I((e,i)=>this._update(e,i).catch(r=>{_(r)||P.getLogger(this).error(r)}))}get updating(){return!!this._loading}redraw(t){if(!this.container.children.length)return;const e=this.container.children[0];e.symbolizerParameters=t,e.invalidateVAO(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(t,e,i){if(!t.stationary)return;const{extent:r,spatialReference:a}=t.state,n=new D({xmin:r.xmin,ymin:r.ymin,xmax:r.xmax,ymax:r.ymax,spatialReference:a}),[l,u]=t.state.size;this._loading=this.fetchPixels(n,l,u,i);const m=await this._loading;this._addToDisplay(m,e,t.state),this._loading=null}_addToDisplay(t,e,i){if(t.pixelBlock==null)return this.container.children.forEach(l=>l.destroy()),void this.container.removeAllChildren();const{extent:r,pixelBlock:a}=t,n=new O(a);n.offset=[0,0],n.symbolizerParameters=e,n.rawPixelData=t,n.invalidateVAO(),n.x=r.xmin,n.y=r.ymax,n.pixelRatio=i.pixelRatio,n.rotation=i.rotation,n.resolution=i.resolution,n.width=a.width*e.symbolTileSize,n.height=a.height*e.symbolTileSize,this.container.children.forEach(l=>l.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(n)}};s([o()],y.prototype,"fetchPixels",void 0),s([o()],y.prototype,"container",void 0),s([o()],y.prototype,"_loading",void 0),s([o()],y.prototype,"updating",null),y=s([w("esri.views.2d.layers.imagery.ImageryVFStrategy")],y);const pt=y;let p=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new ht,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(t,e,i,r)=>{const a=await this._projectFullExtentPromise,{symbolTileSize:n}=this.layer.renderer,{extent:l,width:u,height:m}=K(t,e,i,n,a);if(a!=null&&!a.intersects(t))return{extent:l,pixelBlock:null};const d={bbox:`${l.xmin}, ${l.ymin}, ${l.xmax}, ${l.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:n,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(d)){const c=this.getPixelData();if(c!=null&&`${c.extent.xmin}, ${c.extent.ymin}, ${c.extent.xmax}, ${c.extent.ymax}`===d.bbox)return c}const{pixelData:v}=await this.layer.fetchImage(l,u,m,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:r});this._dataParameters=d;const g=v?.pixelBlock;return g==null?{extent:l,pixelBlock:null}:{extent:l,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?Q(g,"vector-uv"):g}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new pt({container:this.container,fetchPixels:this._fetchpixels}),this.addHandles(f(()=>this.layer.renderer,t=>this._updateSymbolizerParams(t),$),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(t=>t.destroy()),this.container.removeAllChildren(),this.removeHandles("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const t=this.container.children[0]?.rawPixelData;if(this.updating||!t)return null;const{extent:e,pixelBlock:i}=t;return{extent:e,pixelBlock:i}}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}update(t){this._strategy.update(t,this._symbolizerParams).catch(e=>{_(e)||P.getLogger(this).error(e)})}redraw(){const{renderer:t}=this.layer;t&&(this._updateSymbolizerParams(t),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(t){const e=this._dataParameters.exportParametersVersion===t.exportParametersVersion,i=this._dataParameters.time===t.time,r=this._dataParameters.symbolTileSize===t.symbolTileSize,a=this._dataParameters.bbox===t.bbox;return e&&i&&r&&a}async _getProjectedFullExtent(t){try{return it(this.layer.fullExtent,t)}catch{try{const e=(await A(this.layer.url,{query:{option:"footprints",outSR:U(t),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return e?D.fromJSON(e):null}catch{return null}}}_updateSymbolizerParams(t){t.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};s([o()],p.prototype,"attached",void 0),s([o()],p.prototype,"container",void 0),s([o()],p.prototype,"layer",void 0),s([o()],p.prototype,"timeExtent",void 0),s([o()],p.prototype,"type",void 0),s([o()],p.prototype,"view",void 0),s([o()],p.prototype,"updating",null),p=s([w("esri.views.2d.layers.imagery.VectorFieldView2D")],p);const mt=p,dt=t=>{let e=class extends t{constructor(){super(...arguments),this.view=null}get timeExtent(){return st(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,r){const{layer:a}=this;if(!i)throw new C("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:n}=a,l=ot(a,r);if(!n||l==null)return[];const u=await l.getRequiredFields();L(r);const m=new at;m.timeExtent=this.timeExtent,m.geometry=i,m.outFields=u,m.outSpatialReference=i.spatialReference;const{resolution:d,spatialReference:v}=this.view,g=this.view.type==="2d"?new q(d,d,v):new q(.5*d,.5*d,v),{returnTopmostRaster:c,showNoDataRecords:k}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},z={returnDomainValues:!0,returnTopmostRaster:c,pixelSize:g,showNoDataRecords:k,signal:r?.signal};return a.queryVisibleRasters(m,z).then(T=>T)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return s([o()],e.prototype,"layer",void 0),s([o()],e.prototype,"suspended",void 0),s([o({readOnly:!0})],e.prototype,"timeExtent",null),s([o()],e.prototype,"view",void 0),e=s([w("esri.views.layers.ImageryLayerView")],e),e};let x=class extends dt(nt(H(G))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new M,this._highlightView=void 0,this.layer=null,this.subview=null}get pixelData(){const{subview:t}=this;return this.updating||!t?null:"getPixelData"in t?t.getPixelData():null}update(t){this.subview?.update(t)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new J({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new W(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([f(()=>this.layer.exportImageServiceParameters.version,t=>{t&&this._exportImageVersion!==t&&(this._exportImageVersion=t,this.requestUpdate())},V),f(()=>this.timeExtent,t=>{const{subview:e}=this;e&&(e.timeExtent=t,"redraw"in e?this.requestUpdate():e.redrawOrRefetch())},V),this.layer.on("redraw",()=>{const{subview:t}=this;t&&("redraw"in t?t.redraw():t.redrawOrRefetch())}),f(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(t,e){if(!((Array.isArray(t)?t[0]:E.isCollection(t)?t.at(0):t)instanceof b))return S();let i=[];return Array.isArray(t)||E.isCollection(t)?i=t.map(r=>r.clone()):t instanceof b&&(i=[t.clone()]),this._highlightGraphics.addMany(i),S(()=>this._highlightGraphics.removeMany(i))}async doRefresh(){this.requestUpdate()}isUpdating(){const t=!this.subview||this.subview.updating||!!this._highlightView?.updating;return F("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${t} +import{v as s,S as o,i as w,ah as f,av as V,ag as E,bi as b,a2 as S,K as F,j as R,aU as _,a1 as P,bp as I,n as D,ax as $,f as A,bM as U,o as C,$ as L,w as q}from"./story-Doly9N9p.js";import{o as M}from"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import{o as N,c as O,l as j}from"./RasterVFDisplayObject-CnriTVT9-CVvMEEVD.js";import{X as H,Y as G}from"./LayerView-Bish-E63-DK1SFHE3.js";import{X as J}from"./GraphicsView2D-C4wYE2ut-DdVMjjMv.js";import{l as W}from"./HighlightGraphicContainer-Dt5r6lMq-CwALk6za.js";import{z as X,P as K,w as Q}from"./dataUtils-BkPy4R3C-Dzc1QGGb.js";import{d as Y}from"./BitmapContainer-BC8fvmFc-C6Z_3UuF.js";import{x as Z}from"./Container-BcuL1ZEG-DVZvemLA.js";import{d as tt}from"./Bitmap-CcqmzvfR-C22fE2NY.js";import{K as et}from"./ExportStrategy-BNE7Gp0u-CHHOPUHq.js";import{o as it}from"./rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js";import{E as B}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{N as rt}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{T as st}from"./timeSupport-ohWmWReZ-D2lpSlXU.js";import{b as at}from"./Query-BrwMGK8U-BPr0_G9t.js";import{m as ot}from"./popupUtils-nV1O8RUO-BYG2KoFf.js";import{n as nt}from"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";import"./main-QGPoLsvl.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";import"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";let h=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new Z,this.updateRequested=!1,this.type="imagery",this._bitmapView=new Y}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(t){this.strategy.update(t).catch(e=>{_(e)||P.getLogger(this).error(e)})}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const t=this.layer.version>=10,e=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new et({container:this._bitmapView,imageNormalizationSupported:t,imageMaxHeight:e,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 t=>{const{source:e}=t;if(!e||e instanceof ImageBitmap)return;const i=await this.layer.applyRenderer({extent:e.extent,pixelBlock:e.originalPixelBlock??e.pixelBlock});e.filter=r=>this.layer.pixelFilter?this.layer.applyFilter(r):{...i,extent:e.extent}}).catch(t=>{_(t)||P.getLogger(this).error(t)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const t=this.strategy.bitmaps;if(t.length===1&&t[0].source)return{extent:t[0].source.extent,pixelBlock:t[0].source.originalPixelBlock};if(t.length>1){const e=this.view.extent,i=t.map(a=>a.source).filter(a=>a.extent&&a.extent.intersects(e)).map(a=>({extent:a.extent,pixelBlock:a.originalPixelBlock})),r=X(i,e);return r!=null?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}async _fetchImage(t,e,i,r){(r=r||{}).timeExtent=this.timeExtent,r.requestAsImageElement=!0,r.returnImageBitmap=!0;const a=await this.layer.fetchImage(t,e,i,r);if(a.imageBitmap)return a.imageBitmap;const n=await this.layer.applyRenderer(a.pixelData,{signal:r.signal}),l=new tt(n.pixelBlock,n.extent?.clone(),a.pixelData.pixelBlock);return l.filter=u=>this.layer.applyFilter(u),l}};s([o()],h.prototype,"attached",void 0),s([o()],h.prototype,"container",void 0),s([o()],h.prototype,"layer",void 0),s([o()],h.prototype,"strategy",void 0),s([o()],h.prototype,"timeExtent",void 0),s([o()],h.prototype,"view",void 0),s([o()],h.prototype,"updateRequested",void 0),s([o()],h.prototype,"updating",null),s([o()],h.prototype,"type",void 0),h=s([w("esri.views.2d.layers.imagery.ImageryView2D")],h);const lt=h;class ht extends rt{constructor(){super(...arguments),this.symbolTypes=["triangle"]}prepareRenderPasses(e){const i=e.registerRenderPass({name:"imagery (vf)",brushes:[j],target:()=>this.children,drawPhase:B.MAP});return[...super.prepareRenderPasses(e),i]}doRender(e){this.visible&&e.drawPhase===B.MAP&&this.symbolTypes.forEach(i=>{e.renderPass=i,super.doRender(e)})}}let y=class extends R{constructor(t){super(t),this._loading=null,this.update=I((e,i)=>this._update(e,i).catch(r=>{_(r)||P.getLogger(this).error(r)}))}get updating(){return!!this._loading}redraw(t){if(!this.container.children.length)return;const e=this.container.children[0];e.symbolizerParameters=t,e.invalidateVAO(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(t,e,i){if(!t.stationary)return;const{extent:r,spatialReference:a}=t.state,n=new D({xmin:r.xmin,ymin:r.ymin,xmax:r.xmax,ymax:r.ymax,spatialReference:a}),[l,u]=t.state.size;this._loading=this.fetchPixels(n,l,u,i);const m=await this._loading;this._addToDisplay(m,e,t.state),this._loading=null}_addToDisplay(t,e,i){if(t.pixelBlock==null)return this.container.children.forEach(l=>l.destroy()),void this.container.removeAllChildren();const{extent:r,pixelBlock:a}=t,n=new O(a);n.offset=[0,0],n.symbolizerParameters=e,n.rawPixelData=t,n.invalidateVAO(),n.x=r.xmin,n.y=r.ymax,n.pixelRatio=i.pixelRatio,n.rotation=i.rotation,n.resolution=i.resolution,n.width=a.width*e.symbolTileSize,n.height=a.height*e.symbolTileSize,this.container.children.forEach(l=>l.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(n)}};s([o()],y.prototype,"fetchPixels",void 0),s([o()],y.prototype,"container",void 0),s([o()],y.prototype,"_loading",void 0),s([o()],y.prototype,"updating",null),y=s([w("esri.views.2d.layers.imagery.ImageryVFStrategy")],y);const pt=y;let p=class extends R{constructor(){super(...arguments),this.attached=!1,this.container=new ht,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(t,e,i,r)=>{const a=await this._projectFullExtentPromise,{symbolTileSize:n}=this.layer.renderer,{extent:l,width:u,height:m}=K(t,e,i,n,a);if(a!=null&&!a.intersects(t))return{extent:l,pixelBlock:null};const d={bbox:`${l.xmin}, ${l.ymin}, ${l.xmax}, ${l.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:n,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(d)){const c=this.getPixelData();if(c!=null&&`${c.extent.xmin}, ${c.extent.ymin}, ${c.extent.xmax}, ${c.extent.ymax}`===d.bbox)return c}const{pixelData:v}=await this.layer.fetchImage(l,u,m,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:r});this._dataParameters=d;const g=v?.pixelBlock;return g==null?{extent:l,pixelBlock:null}:{extent:l,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?Q(g,"vector-uv"):g}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new pt({container:this.container,fetchPixels:this._fetchpixels}),this.addHandles(f(()=>this.layer.renderer,t=>this._updateSymbolizerParams(t),$),"attach")}detach(){this._strategy.destroy(),this.container.children.forEach(t=>t.destroy()),this.container.removeAllChildren(),this.removeHandles("attach"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){const t=this.container.children[0]?.rawPixelData;if(this.updating||!t)return null;const{extent:e,pixelBlock:i}=t;return{extent:e,pixelBlock:i}}hitTest(t){return new b({attributes:{},geometry:t.clone(),layer:this.layer})}update(t){this._strategy.update(t,this._symbolizerParams).catch(e=>{_(e)||P.getLogger(this).error(e)})}redraw(){const{renderer:t}=this.layer;t&&(this._updateSymbolizerParams(t),this._strategy.redraw(this._symbolizerParams))}_canReuseVectorFieldData(t){const e=this._dataParameters.exportParametersVersion===t.exportParametersVersion,i=this._dataParameters.time===t.time,r=this._dataParameters.symbolTileSize===t.symbolTileSize,a=this._dataParameters.bbox===t.bbox;return e&&i&&r&&a}async _getProjectedFullExtent(t){try{return it(this.layer.fullExtent,t)}catch{try{const e=(await A(this.layer.url,{query:{option:"footprints",outSR:U(t),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return e?D.fromJSON(e):null}catch{return null}}}_updateSymbolizerParams(t){t.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};s([o()],p.prototype,"attached",void 0),s([o()],p.prototype,"container",void 0),s([o()],p.prototype,"layer",void 0),s([o()],p.prototype,"timeExtent",void 0),s([o()],p.prototype,"type",void 0),s([o()],p.prototype,"view",void 0),s([o()],p.prototype,"updating",null),p=s([w("esri.views.2d.layers.imagery.VectorFieldView2D")],p);const mt=p,dt=t=>{let e=class extends t{constructor(){super(...arguments),this.view=null}get timeExtent(){return st(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,r){const{layer:a}=this;if(!i)throw new C("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:n}=a,l=ot(a,r);if(!n||l==null)return[];const u=await l.getRequiredFields();L(r);const m=new at;m.timeExtent=this.timeExtent,m.geometry=i,m.outFields=u,m.outSpatialReference=i.spatialReference;const{resolution:d,spatialReference:v}=this.view,g=this.view.type==="2d"?new q(d,d,v):new q(.5*d,.5*d,v),{returnTopmostRaster:c,showNoDataRecords:k}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},z={returnDomainValues:!0,returnTopmostRaster:c,pixelSize:g,showNoDataRecords:k,signal:r?.signal};return a.queryVisibleRasters(m,z).then(T=>T)}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return s([o()],e.prototype,"layer",void 0),s([o()],e.prototype,"suspended",void 0),s([o({readOnly:!0})],e.prototype,"timeExtent",null),s([o()],e.prototype,"view",void 0),e=s([w("esri.views.layers.ImageryLayerView")],e),e};let x=class extends dt(nt(H(G))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new M,this._highlightView=void 0,this.layer=null,this.subview=null}get pixelData(){const{subview:t}=this;return this.updating||!t?null:"getPixelData"in t?t.getPixelData():null}update(t){this.subview?.update(t)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new J({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new W(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.addAttachHandles([f(()=>this.layer.exportImageServiceParameters.version,t=>{t&&this._exportImageVersion!==t&&(this._exportImageVersion=t,this.requestUpdate())},V),f(()=>this.timeExtent,t=>{const{subview:e}=this;e&&(e.timeExtent=t,"redraw"in e?this.requestUpdate():e.redrawOrRefetch())},V),this.layer.on("redraw",()=>{const{subview:t}=this;t&&("redraw"in t?t.redraw():t.redrawOrRefetch())}),f(()=>this.layer.renderer,()=>this._setSubView())])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null,this._highlightView?.destroy(),this._exportImageVersion=-1}viewChange(){}moveEnd(){this.requestUpdate()}highlight(t,e){if(!((Array.isArray(t)?t[0]:E.isCollection(t)?t.at(0):t)instanceof b))return S();let i=[];return Array.isArray(t)||E.isCollection(t)?i=t.map(r=>r.clone()):t instanceof b&&(i=[t.clone()]),this._highlightGraphics.addMany(i),S(()=>this._highlightGraphics.removeMany(i))}async doRefresh(){this.requestUpdate()}isUpdating(){const t=!this.subview||this.subview.updating||!!this._highlightView?.updating;return F("esri-2d-log-updating")&&console.log(`Updating ImageryLayerView2D (${this.layer.id}): ${t} -> subview ${!this.subview||this.subview.updating} -> higlightView ${this._highlightView?.updating} `),t}_setSubView(){if(!this.view)return;const t=this.layer.renderer?.type;let e="imagery";if(t==="vector-field"?e="imageryVF":t==="flow"&&(e="flow"),this.subview){const{type:i}=this.subview;if(i===e)return this._attachSubview(this.subview),void(i==="flow"?this.subview.redrawOrRefetch():i==="imagery"&&this.layer.format==="lerc"?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),this.subview?.destroy()}this.subview=e==="imagery"?new lt({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):e==="imageryVF"?new mt({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new N({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}};s([o()],x.prototype,"pixelData",null),s([o()],x.prototype,"subview",void 0),x=s([w("esri.views.2d.layers.ImageryLayerView2D")],x);const vi=x;export{vi as default}; diff --git a/custom-toc-highlight/assets/ImageryTileLayer-DixyNESc-DnXgKCIh.js b/custom-toc-highlight/assets/ImageryTileLayer-DixyNESc-BQ0NIE-T.js similarity index 95% rename from custom-toc-highlight/assets/ImageryTileLayer-DixyNESc-DnXgKCIh.js rename to custom-toc-highlight/assets/ImageryTileLayer-DixyNESc-BQ0NIE-T.js index 28217f03..7ab21332 100644 --- a/custom-toc-highlight/assets/ImageryTileLayer-DixyNESc-DnXgKCIh.js +++ b/custom-toc-highlight/assets/ImageryTileLayer-DixyNESc-BQ0NIE-T.js @@ -1,3 +1,3 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-zj0NdzY3.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-BIb5_ysY.js","./imageryUtils-6MVSqijr-B_Ii3EHZ.js","./utils-BVWK2jiA-Btpo3M9u.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./jsonContext-BA8GHqVk-CWQlLGSw.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./saveUtils-CIYk-dsQ-VGcOewby.js"])))=>i.map(i=>d[i]); -import{_ as at}from"./main-ugzBrWNm.js";import{v as w,S as b,i as K,aa as wt,bp as It,W as bt,aO as Ae,o as C,ah as Rt,a1 as ne,bL as vt,e as St,w as A,n as W,f as ot,J as L,E as Tt,l as _t,bB as Ft,bz as kt,a0 as Ct,iF as lt,K as Ot,aS as Pt,O as Mt,a as Nt,aq as Me,eC as Dt,aG as Et,jz as Bt,ar as Jt,cB as At}from"./story-BfX8CRfG.js";import{m as Lt}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as Ht}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{a as zt}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{u as Wt}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as Gt}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{J as $t,k as Ne,p as qt,A as Vt,l as jt,c as Ut,V as Yt,E as Kt,a as Xt,Z as Qt,b as je,I as Ue,T as Zt,v as ei,w as ti,C as ii,S as Ye,f as si}from"./RasterPresetRendererMixin-D6W9pUY6-DKpsAOdT.js";import{j as ct}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{Z as ut,_ as ri}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{R as ht,J as mt,Y as ni,I as ai,g as Le,j as Ke,p as oi,T as Xe,z as li}from"./multidimensionalUtils-BwTugeu7-BTG9Of02.js";import{V as ee,d as ci}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import{V as ui,c as Re,W as ve,S as hi,d as He,s as ze,b as mi,u as fi,v as pi,A as di,D as yi,E as pe,F as gi,H as xi,N as wi,J as Ii,t as bi,L as Qe}from"./RasterSymbolizer-BVys6HkM-BrCOeMHl.js";import{K as Ze,U as et,V as tt,X as Ri,Q as vi}from"./RawBlockCache-Cj_tmHDm-CHpXSnmO.js";import{f as Te,A as ft,M as Si,v as Ti,x as _i,b as Fi,k as ki,y as Ci,E as Oi,D as we,w as Pi,R as Mi,K as Ni}from"./dataUtils-BkPy4R3C-Cb9EIxnj.js";import{k as de,L as De,n as it,Q as st,X as Di,s as _e,o as Ie,K as Ei,Y as Bi,W as Ji,F as Ee}from"./rasterProjectionHelper-Calp0o_1-DktPwJyi.js";import{k as Ai}from"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import{D as Li,h as pt,E as Be,v as We,x as Hi,B as zi}from"./PolynomialTransform-C3nWCu0l-CtkqeHeV.js";import{O as Ge}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{E as Wi}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as Gi}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as $i}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as qi}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{x as Vi}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{y as ce}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{f as ji}from"./TilemapCache-CRRxws77-BBkZHUXn.js";import{w as Ui}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import{E as ye}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./utils-DPtQ14k3-CAwuJg76.js";import"./cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";const rt=8,Yi=256;let Ki=0,B=class extends St{constructor(){super(...arguments),this._tileFetchQueue=new Ai({concurrency:32,process:(t,e)=>this._fetchRawTile(t.pyramidLevel,t.row,t.col,{...t.options,signal:e})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(t){return t?.ioConfig&&(t={...t,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:ee.create(),...t.ioConfig}}),t}get _isGlobalWrappableSource(){const{rasterInfo:t}=this,e=de(t.spatialReference);return e!=null&&t.extent.width>=e/2}get _hasNoneOrGCSShiftTransform(){const{transform:t}=this.rasterInfo;return t==null||t.type==="gcs-shift"}set rasterJobHandler(t){this._set("rasterJobHandler",t),this.datasetFormat==="Function"&&this.primaryRasters?.rasters?.forEach(e=>e.rasterJobHandler=t)}get rasterId(){return this.url||"rasterId-"+Ki++}set url(t){this._set("url",ct(t,ne.getLogger(this)))}async open(t){return this._openPromise??=De().then(()=>this._open(t)),this._openPromise}async fetchTile(t,e,r,i={}){const s=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,a=this.getTileExtentFromTileInfo(t,e,r,s);return i={noClip:!0,...i},this.fetchPixels(a,s.size[0],s.size[1],i)}async identify(t,e={}){t=Ae(A,t).clone().normalize();const{multidimensionalDefinition:r,timeExtent:i}=e,{rasterInfo:s}=this,{hasMultidimensionalTranspose:a,multidimensionalInfo:n}=s;let{transposedVariableName:l}=e;const o=n!=null&&a&&(i!=null||ht(r));o&&!l&&(l=r!=null&&r.length>0?r[0].variableName??void 0:n.variables[0].name,e={...e,transposedVariableName:l}),e=this._getRequestOptionsWithSliceId(e);const{spatialReference:c,extent:u}=s,{datumTransformation:f}=e;let h=it(t,c,f);if(!u.intersects(h))return{location:h,value:null};if(s.transform!=null){const F=s.transform.inverseTransform(h);if(!s.nativeExtent.intersects(F))return{location:F,value:null};h=F}let m=0;const y=l!=null&&n!=null&&s.hasMultidimensionalTranspose;if(this.datasetFormat==="Function"){const F=this.primaryRasters.rasters[0];if(y)return F.identify(h,e);const{pixelSize:M}=s,O=3,N=M.x*O/2,D=M.y*O/2,J=new W({xmin:h.x-N,xmax:h.x+N,ymin:h.y-D,ymax:h.y+D,spatialReference:c}),z={interpolation:"nearest",multidimensionalDefinition:r,sliceId:e.sliceId},{pixelBlock:j}=await F.fetchPixels(J,O,O,z),{pixelBlock:G}=await this.fetchPixels(J,O,O,z);if(j==null)return{location:h,value:null};const $=Math.floor(O*O*.5),X=!j.mask||j.mask[$]?j.pixels.map(V=>V[$]):null;let te;return G!=null&&(te=!G.mask||G.mask[$]?G.pixels.map(V=>V[$]):void 0),{location:h,value:X,processedValue:te,pyramidLevel:0}}if(!y){if(e.srcResolution)m=st(e.srcResolution,s,this.ioConfig.sampling).pyramidLevel;else if(m=await this.computeBestPyramidLevelForLocation(t,e),m==null)return{location:h,value:null}}const g=this.identifyPixelLocation(h,m,null,y);if(g===null)return{location:h,value:null};const{row:p,col:d,rowOffset:x,colOffset:I,blockWidth:R}=g,S=l??e.sliceId,T=Ze(this.rasterId,S),v=`${m}/${p}/${d}`;let k=et(T,null,v);k==null&&(k=this.fetchRawTile(m,p,d,e),tt(T,null,v,k));const _=await k;if(!_?.pixels?.length)return{location:h,value:null};const P=x*R+I;return this._processIdentifyResult(_,{srcLocation:h,position:P,pyramidLevel:m,useTransposedTile:!!y,requestSomeSlices:o,identifyOptions:e})}async fetchPixels(t,e,r,i={}){t=Di(t),i=this._getRequestOptionsWithSliceId(i);const{_hasNoneOrGCSShiftTransform:s}=this;if(i.requestRawData&&s)return this._fetchPixels(t,e,r,i);const a=de(t.spatialReference),n=_e(t);if(a==null||n===0||n===1&&this._isGlobalWrappableSource&&s)return this._fetchPixels(t,e,r,i);if(n>=3)return{extent:t,pixelBlock:null};const l=[],{xmin:o,xmax:c}=t,u=Math.round(a/(c-o)*e),f=u-Math.round((a/2-o)/(c-o)*e);let h=0;const m=[];for(let d=0;d<=n;d++){const x=new W({xmin:d===0?o:-a/2,xmax:d===n?c-a*d:a/2,ymin:t.ymin,ymax:t.ymax,spatialReference:t.spatialReference}),I=d===0?u-f:d===n?e-h:u;h+=I,m.push(I);const R=i.disableWrapAround&&d>0?null:this._fetchPixels(x,I,r,i);l.push(R)}const y=(await Promise.all(l)).map(d=>d?.pixelBlock);let g=null;const p={width:e,height:r};return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:y,srcMosaicSize:p,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:m},i)).pixelBlock:g=Te(y,p,{blockWidths:m}),{extent:t,srcExtent:Ie(t,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:g}}async fetchRawPixels(t,e,r,i={}){e={x:Math.floor(e.x),y:Math.floor(e.y)};const s=await this._fetchRawTiles(t,e,r,i),{nativeExtent:a,nativePixelSize:n,storageInfo:l}=this.rasterInfo,o=2**t,c=n.x*o,u=n.y*o,f=new W({xmin:a.xmin+c*e.x,xmax:a.xmin+c*(e.x+r.width-1),ymin:a.ymax-u*(e.y+r.height-1),ymax:a.ymax-u*e.y,spatialReference:a.spatialReference});if(!s)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:h,mosaicSize:m}=s;if(h.length===1&&h[0]!=null&&h[0].width===r.width&&h[0].height===r.height)return{extent:f,srcExtent:f,pixelBlock:s.pixelBlocks[0]};const y=t>0?l.pyramidBlockWidth:l.blockWidth,g=t>0?l.pyramidBlockHeight:l.blockHeight,p={x:e.x%y,y:e.y%g};let d;return this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:h,srcMosaicSize:m,destDimension:r,clipOffset:p,clipSize:r,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:d=Te(h,m,{clipOffset:p,clipSize:r}),{extent:f,srcExtent:f,pixelBlock:d}}fetchRawTile(t,e,r,i){throw new C("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(t){return Ie(this.rasterInfo.extent,t)}decodePixelBlock(t,e){return!this.rasterJobHandler||e.useCanvas?ui(t,e):this.rasterJobHandler.decode({data:t,options:e})}async request(t,e,r=0){const{customFetchParameters:i}=this.ioConfig,{range:s,query:a,headers:n}=e;r=r??e.retryCount??this.ioConfig.retryCount;const l=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await ot(t,{...e,query:{...a,...i},headers:{...n,...l}})}catch(o){if(r>0)return r--,this.request(t,e,r);throw o}}getSliceIndex(t){const{multidimensionalInfo:e}=this.rasterInfo;return e==null||t==null||t.length===0?null:mt(t,e)}getTileExtentFromTileInfo(t,e,r,i){const s=i.lodAt(t);return this.getTileExtent({x:s.resolution,y:s.resolution},e,r,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:t,spatialReference:e,extent:r,pixelSize:i}=this.rasterInfo,{pyramidResolutions:s}=t;if(!t.tileInfo){const a=[],n=t.maximumPyramidLevel||0;let l=(i.x+i.y)/2,o=1/.0254*96*l;for(let u=0;u<=n&&(a.unshift(new ci({level:n-u,resolution:l,scale:o})),u!==n);u++)if(s){const f=(s[u].x+s[u].y)/2;o*=f/l,l=f}else l*=2,o*=2;const c=new A({x:r.xmin,y:r.ymax,spatialReference:e});t.tileInfo=new ee({origin:c,size:[t.blockWidth,t.blockHeight],spatialReference:e,lods:a}),t.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(t,e=512,r=512,i){const{width:s,height:a,nativeExtent:n,pixelSize:l,spatialReference:o}=t,c=new A({x:n.xmin,y:n.ymax,spatialReference:o});i==null&&(i=Math.max(0,Math.round(Math.log(Math.max(s,a))/Math.LN2-8)));const u=this.computeBlockBoundary(n,512,512,{x:n.xmin,y:n.ymax},[l],i);t.storageInfo=new Re({blockWidth:e,blockHeight:r,pyramidBlockWidth:e,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:u})}async computeBestPyramidLevelForLocation(t,e={}){return 0}computeBlockBoundary(t,e,r,i,s,a=0,n=2){if(s.length===1&&a>0){s=[...s];let{x:u,y:f}=s[0];for(let h=0;hl)return null;const m=this.getPyramidPixelSize(e),{x:y,y:g}=m,p=(o.y-h.y)/g/f,d=(h.x-o.x)/y/u,x=Math.min(f-1,Math.floor((p-Math.floor(p))*f)),I=Math.min(u-1,Math.floor((d-Math.floor(d))*u));return{pyramidLevel:e,row:Math.floor(p),col:Math.floor(d),rowOffset:x,colOffset:I,blockWidth:u,srcLocation:h}}getTileExtent(t,e,r,i,s,a){const[n,l]=a,o=i.x+r*n*t.x,c=o+n*t.x,u=i.y-e*l*t.y,f=u-l*t.y;return new W({xmin:o,xmax:c,ymin:f,ymax:u,spatialReference:s})}getBlockWidthHeight(t){return{blockWidth:t>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:t>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(t,e,r){const i=this.rasterInfo.storageInfo.blockBoundary[t];return!i||i.maxRowe||i.minCol>r}updateImageSpaceRasterInfo(t){const{pixelSize:e}=t,{width:r,height:i}=t,s=L.WebMercator;t.spatialReference=s,t.extent=t.nativeExtent=new W({xmin:-.5,ymax:.5,xmax:r-.5,ymin:.5-i,spatialReference:s}),t.isPseudoSpatialReference=!0,t.transform=null,t.pixelSize=new A({x:1,y:1,spatialReference:s});const{extent:a,storageInfo:n}=t;if(n){n.origin=new A({x:a.xmin,y:a.ymax,spatialReference:s});const{pyramidResolutions:l,tileInfo:o}=n;if(l&&l.forEach(c=>{c.x/=e.x,c.y/=e.y}),o){o.origin=n.origin;const c=(t.nativePixelSize.x+t.nativePixelSize.y)/2;o.lods.forEach((u,f)=>{u.resolution=c*2**f,u.scale=96*u.resolution/.0254})}}}async _fetchPixels(t,e,r,i={}){let s=_e(t);if(s>=2)return{extent:t,pixelBlock:null};const a=this._getSourceDataInfo(t,e,r,i),{pyramidLevel:n,srcResolution:l,srcExtent:o,srcWidth:c,srcHeight:u,ul:f}=a;if(c===0||u===0)return{extent:t,srcExtent:o,pixelBlock:null};const{rasterInfo:h}=this,m=h.transform,y=m?.type==="gcs-shift",g=de(t.spatialReference)!=null;!y&&g||(s=_e(a.srcExtent,y));const p=await this._fetchRawTiles(n,f,{width:c,height:u,wrapCount:s},i);if(!p)return{extent:t,srcExtent:o,pixelBlock:null};const d=h.storageInfo,x=n>0?d.pyramidBlockWidth:d.blockWidth,I=n>0?d.pyramidBlockHeight:d.blockHeight;let{x:R,y:S}=h.pixelSize;if(n>0){const{pyramidResolutions:Q,pyramidScalingFactor:xt}=d;if(Q!=null&&Q[n-1])({x:R,y:S}=Q[n-1]);else{const Ve=xt**n;R*=Ve,S*=Ve}}const T=h.spatialReference,v=new A({x:R,y:S,spatialReference:T}),k=x===c&&I===u&&f.x%x==0&&f.y%I==0,_=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference}),P=!t.spatialReference.equals(T),F=T.isGeographic?1e-9:1e-4,{datumTransformation:M}=i;if(!P&&k&&p.pixelBlocks.length===1&&x===e&&I===r&&Xi(l,_,F))return{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:p.pixelBlocks[0]};const O=g&&de(o.spatialReference)!=null&&this._hasNoneOrGCSShiftTransform,N=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");N&&!this.rasterJobHandler&&await De();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_.toJSON(),datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:N},i):Ei({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_,datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:!1,includeGCSGrid:N});let J;const z=!i.requestRawData,j={rows:D.spacing[0],cols:D.spacing[1]},G=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(n,p.extent.xmin):void 0,{pixelBlocks:$,mosaicSize:X,isPartiallyFilled:te}=p;let V=null;if(this.rasterJobHandler)({pixelBlock:J,localNorthDirections:V}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:$,srcMosaicSize:X,destDimension:z?{width:e,height:r}:null,coefs:z?D.coefficients:null,sampleSpacing:z?j:null,projectDirections:N,gcsGrid:N?D.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:i.interpolation,alignmentInfo:G,blockWidths:null},i));else{const Q=Te($,X,{alignmentInfo:G});J=z?ft(Q,{width:e,height:r},D.coefficients,j,i.interpolation):Q,N&&D.gcsGrid&&(V=Si({width:e,height:r},D.gcsGrid),J=Ti(J,this.rasterInfo.dataType,V))}return i.requestRawData||N?{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:J,transformGrid:D,localNorthDirections:V,isPartiallyFilled:te}:{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:J}}async _fetchRawTiles(t,e,r,i){const{origin:s,blockBoundary:a}=this.rasterInfo.storageInfo,{blockWidth:n,blockHeight:l}=this.getBlockWidthHeight(t);let{x:o,y:c}=e,{width:u,height:f,wrapCount:h}=r;const m=this._getRasterTileAlignmentInfo(t,0);i.buffer&&(o-=i.buffer.cols,c-=i.buffer.rows,u+=2*i.buffer.cols,f+=2*i.buffer.rows);let y=0,g=0,p=0;h&&m!=null&&({worldColumnCountFromOrigin:g,originColumnOffset:p,rightPadding:y}=m,g*m.blockWidth-y>=o+u&&(y=0));const d=Math.floor(o/n),x=Math.floor(c/l),I=Math.floor((o+u+y-1)/n),R=Math.floor((c+f+y-1)/l),S=a[t];if(!S)return null;const{minRow:T,minCol:v,maxCol:k,maxRow:_}=S;if(h===0&&(R_||d>k))return null;const P=new Array;let F=!1;const M=this.ioConfig.allowPartialFill==null?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let G=x;G<=R;G++)for(let $=d;$<=I;$++){let X=$;if(!i.disableWrapAround&&h&&m!=null&&g<=$&&(X=$-g-p),G>=T&&X>=v&&_>=G&&k>=X){const te=this._tileFetchQueue.push({pyramidLevel:t,row:G,col:X,options:i},{signal:i.signal});M?P.push(new Promise(V=>{te.then(Q=>V(Q)).catch(()=>{F=!0,V(null)})})):P.push(te)}else P.push(Promise.resolve(null))}if(P.length===0)return null;const O=await Promise.all(P),N={height:(R-x+1)*l,width:(I-d+1)*n},{spatialReference:D}=this.rasterInfo,J=this.getPyramidPixelSize(t),{x:z,y:j}=J;return{extent:new W({xmin:s.x+d*n*z,xmax:s.x+(I+1)*n*z,ymin:s.y-(R+1)*l*j,ymax:s.y-x*l*j,spatialReference:D}),pixelBlocks:O,mosaicSize:N,isPartiallyFilled:F}}_fetchRawTile(t,e,r,i){const s=this.rasterInfo.storageInfo.blockBoundary[t];if(!s)return Promise.resolve(null);const{minRow:a,minCol:n,maxCol:l,maxRow:o}=s;if(eo||r>l)return Promise.resolve(null);const c=Ze(this.rasterId,i.sliceId),u=`${t}/${e}/${r}`;let f=et(c,i.registryId,u);if(f==null){const h=new AbortController;f=this.fetchRawTile(t,e,r,{...i,signal:h.signal}),tt(c,i.registryId,u,f,h),f.catch(()=>Ri(c,i.registryId,u))}return i.signal&&Tt(i,()=>{vi(c,i.registryId,u)}),f}_computeMagDirValues(t){const{bandCount:e,dataType:r}=this.rasterInfo;if(!(e===2&&r==="vector-magdir"||r==="vector-uv")||t?.length!==2||!t[0]?.length)return null;const i=t[0].length;if(r==="vector-magdir"){const o=t[1].map(c=>(c+360)%360);return[t[0],o]}const[s,a]=t,n=[],l=[];for(let o=0;o=16,h=o===a&&this._requireTooManySrcTiles(n,l,e,r);if(f||h||n===0||l===0){const m=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference});let y=Ji(m,this.rasterInfo.spatialReference,t,s.datumTransformation);const g=!y||i.srcResolution&&y.x+y.y=p){const d=2**p;y={x:i.srcResolution.x*d,y:i.srcResolution.y*d}}}y&&(s.srcResolution=y,this._updateSourceDataInfo(t,s))}return this._requireTooManySrcTiles(s.srcWidth,s.srcHeight,e,r)&&(s.srcWidth=0,s.srcHeight=0),s}_requireTooManySrcTiles(t,e,r,i){const{tileInfo:s}=this.rasterInfo.storageInfo,a=Math.ceil(t/s.size[0])*Math.ceil(e/s.size[1]),n=t/r,l=e/i,o=Math.max(1,(r+i)/1024);return a>=Yi*o||n>rt||l>rt}_updateSourceDataInfo(t,e){e.srcWidth=0,e.srcHeight=0;const{rasterInfo:r}=this,i=r.spatialReference,{srcResolution:s,datumTransformation:a}=e,{pyramidLevel:n,pyramidResolution:l,excessiveReading:o}=st(s,r,this.ioConfig.sampling);if(o)return;let c=e.srcExtent||Ie(t,i,a);if(c==null)return;const u=r.transform;u&&(c=u.inverseTransform(c)),e.srcExtent=c;const{x:f,y:h}=r.storageInfo.origin,m=Math.floor((c.xmin-f)/l.x+.1),y=Math.floor((h-c.ymax)/l.y+.1),g=Math.floor((c.xmax-f)/l.x-.1),p=Math.floor((h-c.ymin)/l.y-.1),d=c.width<.1*l.x?0:g-m+1,x=c.height<.1*l.y?0:p-y+1;e.pyramidLevel=n,e.pyramidResolution=l,e.srcWidth=d,e.srcHeight=x,e.ul={x:m,y}}_getRequestOptionsWithSliceId(t){return this.rasterInfo.multidimensionalInfo!=null&&t.sliceId==null&&(t={...t,sliceId:this.getSliceIndex(t.multidimensionalDefinition)}),t}_processIdentifyResult(t,e){const{srcLocation:r,position:i,pyramidLevel:s,useTransposedTile:a}=e,n=t.pixels[0].length/t.width/t.height;if(!(!t.mask||t.mask[i]))return{location:r,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(l==null||!a){const p=t.pixels.map(I=>I[i]),d={location:r,value:p,pyramidLevel:s},x=this._computeMagDirValues(p.map(I=>[I]));return x?.length&&(d.magdirValue=x.map(I=>I[0])),d}let o=t.pixels.map(p=>p.slice(i*n,i*n+n)),c=this._computeMagDirValues(o);const{requestSomeSlices:u,identifyOptions:f}=e;let h=ni(l,f.transposedVariableName);if(u){const p=ai(h,f.multidimensionalDefinition,f.timeExtent);o=o.map(d=>p.map(x=>d[x])),c=c?.map(d=>p.map(x=>d[x])),h=p.map(d=>h[d])}const m=t.noDataValues||this.rasterInfo.noDataValue,y={pixels:o,pixelType:t.pixelType};let g;return m!=null&&(Fi(y,m),g=y.mask),{location:r,value:null,dataSeries:h.map((p,d)=>{const x={value:g?.[d]===0?null:o.map(I=>I[d]),multidimensionalDefinition:p.multidimensionalDefinition.map(I=>new Le({...I,isSlice:!0}))};return c?.length&&(x.magdirValue=[c[0][d],c[1][d]]),x}),pyramidLevel:s}}};function Xi(t,e,r){return Math.abs(t.x-e.x)I.fetchPixels(t,e,r,i)),u=await Promise.all(c),f=u.map(I=>I.pixelBlock),h=n||i.requestRawData?u.map(I=>I.srcTilePixelSize):null;if(i.skipRasterFunction||f.every(I=>I==null))return u[0];const m=u.find(I=>I.pixelBlock!=null)?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a}):this.rasterFunction.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a});const{transformGrid:g}=u[0];if(!n||y==null||g==null){const I=i.noClip?null:this.getClippingGeometry(m.spatialReference);return i.noClip||i.requestRawData||y==null||!I||(y=await Be(y,m,I)),{...u[0],pixelBlock:y}}const p={rows:g.spacing[0],cols:g.spacing[1]};let d;this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:p,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},i)).pixelBlock:d=ft(y,{width:e,height:r},g.coefficients,p,l);const x=i.noClip?null:this.getClippingGeometry(t.spatialReference);return i.noClip||i.requestRawData||d==null||x==null||(d=await Be(d,t,x)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:d}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=es(t);let i=this._clippingGeometry.get(r);return i!=null||(i=t.equals(e.spatialReference)?e:Ee(e,t),this._clippingGeometry.set(r,i)),i}async _open(t){const{rasterFunction:e}=this;this.primaryRasters?.rasters?.length?e.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=e.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(c=>c.rasterJobHandler=this.rasterJobHandler));const{rasters:r,rasterIds:i}=this.primaryRasters,s=r.map(c=>c.rasterInfo?void 0:c.open(t));await Promise.all(s);const a=r.map(({rasterInfo:c})=>c),n=e.bind({rasterInfos:a,rasterIds:i});if(e.rawSourceRasterInfos=a,!n.success||a.length===0)throw new C("raster-function:open",`cannot bind the function: ${n.error??""}`);const l=e.functionName==="Table"?e:e.functionArguments?.raster;l?.functionName==="Table"&&(e.rasterInfo.attributeTable=Ge.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const o=a[0];this.hasUniqueSourceStorageInfo=a.length===1||a.slice(1).every(c=>Zi(c,o)),this.set("sourceJSON",r[0].sourceJSON),this.set("rasterInfo",e.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&t.clippingType==="inside"){const{extent:r}=this.rasterInfo,{difference:i,densify:s}=await at(async()=>{const{difference:n,densify:l}=await import("./geometryEngine-CdPoFSE4-zj0NdzY3.js");return{difference:n,densify:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);let a=s(_t.fromExtent(r),2*(r.width+r.height)/Qi);a=Ee(a,e.spatialReference),e=i(a,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};w([b({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),w([b()],ie.prototype,"tileType",void 0),w([b()],ie.prototype,"rasterFunction",void 0),w([b()],ie.prototype,"primaryRasters",void 0),ie=w([K("esri.layers.support.rasterDatasets.FunctionRaster")],ie);const dt=ie;function Zi(t,e){const{storageInfo:r,pixelSize:i,spatialReference:s,extent:a}=t,{storageInfo:n,pixelSize:l,spatialReference:o,extent:c}=e;return i.x===l.x&&i.y===l.y&&s.equals(o)&&a.equals(c)&&r.blockHeight===n.blockHeight&&r.blockWidth===n.blockWidth&&r.maximumPyramidLevel===n.maximumPyramidLevel}function es(t){return String(t.wkid??t.wkt??t.wkt2)}const ts=t=>{let e=class extends t{constructor(...i){super(...i),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=i[0]?.raster?.datasetFormat==="Function"}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(i){this._set("multidimensionalDefinition",i),this.updateRenderer()}set rasterFunction(i){i?.functionName?.toLowerCase()==="none"&&(i=void 0),this._set("rasterFunction",i),this.updateRasterFunction()}get rasterInfo(){return Dt(ne.getLogger(this),"rasterInfo",{replacement:"serviceRasterInfo",version:"4.29",warnOnce:!0}),this._get("serviceRasterInfo")}set url(i){this._set("url",ct(i,ne.getLogger(this)))}get renderer(){if(this.type!=="imagery-tile")return this.internalRenderer;const{activePresetRendererName:i,presetRenderers:s}=this;return i?s?.find(({name:a})=>a===i)?.renderer.clone():this.internalRenderer}set renderer(i){this.type==="imagery-tile"&&(this.activePresetRendererName=null),this.internalRenderer=i}set internalRenderer(i){i==null&&this.rasterFunction==null?this._configDefaultRenderer("override"):(this._set("internalRenderer",i),this.updateRenderer())}readRenderer(i,s,a){const n=s?.layerDefinition?.drawingInfo?.renderer;return Xt(n,a)||void 0}async convertVectorFieldData(i,s){const{serviceRasterInfo:a}=this;if(i==null||!a)return null;const n=this._rasterJobHandler.instance,l=a.dataType;return n?n.convertVectorFieldData({pixelBlock:i,dataType:l},s):Pi(i,l)}async computeStatisticsHistograms(i,s){await this.load(s),i=Ae(Qt,i).clone();const{serviceRasterInfo:a}=this;if(a==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:n}=i;if(n==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let l=n;const{spatialReference:o}=a;n.spatialReference.equals(o)||(await De(),l=n.type==="extent"?Ie(n,o):Ee(n,o));const c=i.pixelSize??new A({x:a.pixelSize.x,y:a.pixelSize.y,spatialReference:o}),{extent:u,width:f,height:h}=zi(a,l,c),m=await this.fetchPixels(u,f,h,{...s,interpolation:"nearest"});if(m.pixelBlock==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const y=await Be(m.pixelBlock,u,l),g=this._rasterJobHandler.instance;return g?g.computeStatisticsHistograms({pixelBlock:y},s):He(y)}async createFlowMesh(i,s){const a=this._rasterJobHandler.instance;return a?a.createFlowMesh(i,s):Mi(i.meshType,i.simulationSettings,i.flowData,s.signal!=null?s.signal:new AbortController().signal)}normalizeRasterFetchOptions(i){const{multidimensionalInfo:s}=this.serviceRasterInfo??{};if(s==null)return i;let a=i.multidimensionalDefinition||this.multidimensionalDefinition;a?.length||(a=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const n=i.timeExtent||this.timeExtent;if(a!=null&&n!=null&&(n.start!=null||n.end!=null)){a=a.map(g=>g.clone());const l=s.variables.find(({name:g})=>g===a[0].variableName)?.dimensions?.find(({name:g})=>g==="StdTime"),o=a.find(({dimensionName:g})=>g==="StdTime");if(!l||!o)return{...i,multidimensionalDefinition:null};const{start:c,end:u}=n,f=c==null?null:c.getTime(),h=u==null?null:u.getTime(),m=f??h,y=h??f;if(l.values!=null){const g=l.values.filter(p=>{if(Array.isArray(p)){if(m===y)return p[0]<=m&&p[1]>=m;const d=p[0]<=m&&p[1]>m||p[0]=y,x=p[0]>=m&&p[1]<=y||p[0]y;return d||x}return m===y?p===m:p>=m&&p<=y});if(g.length){const p=g.sort((d,x)=>{const I=Array.isArray(d)?d[0]:d,R=Array.isArray(d)?d[1]:d,S=Array.isArray(x)?x[0]:x,T=Array.isArray(x)?x[1]:x;return m===y?I-S:Math.abs(R-y)-Math.abs(T-y)})[0];o.values=[p]}else a=null}else if(l.hasRegularIntervals&&l.extent){const[g,p]=l.extent;m>p||y1&&i.forEach(m=>u[m.url]=m);const f=pt(n.functionDefinition?.toJSON()??n.toJSON(),u),h=new dt({rasterFunction:f});h.rasterJobHandler=this._rasterJobHandler.instance,await h.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=h}else this.raster=s,this._cachedRasterFunctionJson=null,await s.open();if(this._cachedRendererJson=null,!a&&!n)return;const{bandIds:l}=this,{bandCount:o}=this.raster.rasterInfo,c=l?.length?l.some(u=>u>=o):o>=3;l&&(c||this.renderer&&this.renderer.type!=="raster-stretch")&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:i,symbolizer:s}=this;if(!i||!s||!this.renderer)return;const{rasterInfo:a}=this.raster,n=Xe(a,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),l=n?.name,o=je({...this.renderer.toJSON(),variableName:l});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(o))return;const c=this._rasterJobHandler.instance;c&&(s.rasterInfo=Ue(a,l),s.rendererJSON=o,s.bind(),await c.updateSymbolizer(s),this._cachedRendererJson=o)}async applyRenderer(i,s){const a=i?.pixelBlock;if(!(a!=null&&a.pixels&&a.pixels.length>0))return null;let n;await this.updateRenderer();const l=this._rasterJobHandler.instance,o=this.bandIds??[];return n=l?await l.symbolize({...i,simpleStretchParams:s,bandIds:o}):this.symbolizer.symbolize({...i,simpleStretchParams:s,bandIds:o}),n}getTileUrl(i,s,a){return this.raster.datasetFormat==="RasterTileServer"?`${this.url}/tile/${i}/${s}/${a}`:""}getCompatibleTileInfo(i,s,a=!1){if(!this.loaded||s==null)return null;if(a&&i.equals(this.spatialReference))return this.tileInfo;const n=Et(i);return ee.create({size:256,spatialReference:i,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:s.xmin,y:s.ymax}})}getCompatibleFullExtent(i){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(i)||(this._compatibleFullExtent=this.raster.computeExtent(i)),this._compatibleFullExtent):null}async fetchTile(i,s,a,n={}){if(r(this),n.requestAsImageElement){const o=this.getTileUrl(i,s,a);return ot(o,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then(c=>c.data)}const{serviceRasterInfo:l}=this;if(l.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null){const o=n.tileInfo||l.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(i,s,a,o),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),this.renderer?.type==="raster-shaded-relief"&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(i,s,a,n)}async fetchPixels(i,s,a,n={}){return this.serviceRasterInfo.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null?{extent:i,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),s=Math.round(s),a=Math.round(a),this.raster.fetchPixels(i,s,a,n))}async identify(i,s={}){await this.load();const{raster:a,serviceRasterInfo:n}=this;if(n?.multidimensionalInfo!=null&&!(n.hasMultidimensionalTranspose&&(ht(s.multidimensionalDefinition)||s.transposedVariableName||s.timeExtent))&&(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition==null)return{location:i,value:null};const l=this.multidimensionalSubset?.areaOfInterest;if(l&&!l.contains(i))throw new C("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return a.identify(i,s)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const i=this.serviceRasterInfo?.multidimensionalInfo;if(i==null||this.serviceRasterInfo?.dataType!=="standard-time")return!1;const s=this.multidimensionalDefinition,a=s?.[0]?.variableName;return i.variables.some(n=>n.name===a&&(!s?.[0].dimensionName||n.dimensions.some(l=>l.name==="StdTime")))}getStandardTimeValue(i){return new Date(24*(i-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(i){const s=i??this.serviceRasterInfo?.multidimensionalInfo;return li(this.multidimensionalSubset,s)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&this.raster.datasetFormat==="Function"&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const i=new si;return this._rasterJobHandler.connectionPromise=i.initialize().then(async()=>{r(this),this._rasterJobHandler.instance=i,this.raster.rasterJobHandler=i,this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).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(){if(this.interpolation==null){r(this);const{raster:i}=this,s=Zt(i.rasterInfo,i.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",s)}}_configDefaultRenderer(i="no"){r(this);const{rasterInfo:s}=this.raster,a=Xe(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=a?.name,l=ei({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&s.bandCount>1&&(this.bandIds=l?.bandIds??ti(s)),!this.renderer||i==="override"){const f=ii(this.raster),h=l?.renderer??Ye(s,{bandIds:this.bandIds,variableName:n,rasterFunctionColorRamp:f}),m=s.statistics,y=m&&m.length>0?m[0]:null,g=y?.max??0,p=y?.min??0;this.raster.datasetFormat==="WCSServer"&&h.type==="raster-stretch"&&(g>1e24||p<-1e24)&&(h.dynamicRangeAdjustment=!0,h.customStatistics=null,h.stretchType==="none"&&(h.stretchType="min-max")),this.renderer=h}const o=je({...this.renderer.toJSON(),variableName:n}),c=Ue(s,n);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=c):this.symbolizer=new bi({rendererJSON:o,rasterInfo:c});const u=this.symbolizer.bind();if(u.success){if(i==="auto"){const{colormap:f}=this.raster.rasterInfo,h=this.renderer;if(f!=null&&h.type==="raster-colormap"){const m=Ye(this.raster.rasterInfo);JSON.stringify(m)!==JSON.stringify(h)&&this._configDefaultRenderer("override")}else if(h.type==="raster-stretch"){const m=this.bandIds?.length,y=h.customStatistics?.length;!h.dynamicRangeAdjustment&&y&&m&&y!==m&&this._configDefaultRenderer("override")}}}else ne.getLogger(this).warn("imagery-tile-mixin",u.error||"The given renderer is not supported by the layer."),i==="auto"&&this._configDefaultRenderer("override")}};function r(i){if(!i.raster||!i.serviceRasterInfo)throw new C("imagery-tile","no raster")}return w([b({clonable:!1})],e.prototype,"_cachedRendererJson",void 0),w([b({clonable:!1})],e.prototype,"_cachedRasterFunctionJson",void 0),w([b({clonable:!1})],e.prototype,"_compatibleFullExtent",void 0),w([b({clonable:!1})],e.prototype,"_isConstructedFromFunctionRaster",void 0),w([b({clonable:!1})],e.prototype,"_rasterJobHandler",void 0),w([b({type:[Ft],json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.bandIds?.join(",")!=="0,1,2"}}}}})],e.prototype,"bandIds",void 0),w([b({json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),w([b({json:{read:!1}})],e.prototype,"fullExtent",null),w([b({json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.interpolation!=="bilinear"}}}}}),kt(qt)],e.prototype,"interpolation",void 0),w([b()],e.prototype,"ioConfig",void 0),w([b({type:[Le],json:{write:!0}})],e.prototype,"multidimensionalDefinition",null),w([b({type:Vt,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),w([b()],e.prototype,"raster",void 0),w([b({type:Ne,json:{name:"renderingRule",write:!0}})],e.prototype,"rasterFunction",null),w([b({readOnly:!0})],e.prototype,"rasterInfo",null),w([b()],e.prototype,"serviceRasterInfo",void 0),w([b()],e.prototype,"sourceJSON",void 0),w([b({readOnly:!0,type:L,json:{read:!1}})],e.prototype,"spatialReference",void 0),w([b({type:ee})],e.prototype,"tileInfo",void 0),w([b(ut)],e.prototype,"url",null),w([b()],e.prototype,"renderer",null),w([b({types:jt,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const i=this.renderer?.type==="raster-stretch"&&this.renderer.stretchType==="none"&&!this.renderer.useGamma;return{enabled:!this.loaded||this.raster.tileType==="Raster"||!i}}},origins:{"web-scene":{types:Ut,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:i=>({enabled:i&&i.type!=="vector-field"&&i.type!=="flow"})}}}}})],e.prototype,"internalRenderer",null),w([Ct("internalRenderer")],e.prototype,"readRenderer",null),w([b({clonable:!1})],e.prototype,"symbolizer",void 0),e=w([K("esri.layers.mixins.ImageryTileMixin")],e),e};function yt(t){return["x","e","east","long","longitude"].includes(t.toLowerCase())}function gt(t){return["y","n","west","lat","latitude"].includes(t.toLowerCase())}function is(t){const{axes:e}=t.domain,r=Object.keys(e),i=[],s=[];let a=-1,n=-1,l=[];for(let x=0;xS.push(typeof v=="string"?new Date(v).getTime():v));const T=S[1]-S[0];i.push([S[0]-.5*T,S[S.length-1]+.5*T]),s.push(T)}else{const{start:T,stop:v,num:k}=R,_=(v-T)/(k-1);i.push([T-.5*_,v+.5*_]),s.push(_);for(let P=0;P-1&&n===-1?n=a===0?1:0:n>-1&&a===-1?a=n===0?1:0:n===-1&&a===-1&&(a=0,n=1),l=l.filter((x,I)=>!(I===a||I===n));const{referencing:o}=t.domain,c=o.find(x=>x.coordinates.includes(r[a])).system.id,u=c?.slice(c.lastIndexOf("/")+1),f=u==null||u==="CRS84"?4326:Number(u),h=new L({wkid:f}),[m,y]=i[a],[g,p]=i[n],d=new W({xmin:m,xmax:y,ymin:g,ymax:p,spatialReference:h});return{width:Math.round(d.width/s[a]),height:Math.round(d.height/s[n]),extent:d,dimensions:l}}function Fe(t){const e=At();return e?t[e]??Object.values(t)[0]:Object.values(t)[0]}function ke(){return Math.round(255*Math.random())}function ss(t){const e={},{parameters:r}=t;if(!r)return e;for(const[i,s]of Object.entries(r)){const{type:a,description:n,unit:l,categoryEncoding:o,observedProperty:c}=s;if(a==="Parameter"&&(e[i]={},n&&(e[i].description=Fe(n)),l&&(e[i].unit=l.label?Fe(l.label):null,e[i].symbol=l.symbol?.value),o)){const u=Object.entries(o).map((m,y)=>({OID:y,Value:Number(m[1]),ClassName:m[0].slice(m[0].lastIndexOf("/")+1),Count:1}));let f=!1;c?.categories?.length&&(c.categories.forEach(m=>{if(!m.id)return;const y=m.id.slice(m.id.lastIndexOf("/")+1),g=u.find(d=>d.ClassName===y);if(!g)return;const p=m.label?Fe(m.label):null;if(g.Label=p,m.preferredColor){const d=Jt.fromHex(m.preferredColor);d&&(f=!0,g.Red=d.r,g.Green=d.g,g.Blue=d.b)}}),f&&u.forEach(m=>{m.Red==null&&(m.Red=ke(),m.Green=ke(),m.Blue=ke())}));const h={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:u.map(m=>({attributes:m}))};f&&h.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),e[i].attributeTable=h}}return e}function rs(t){let e=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let i=0;ir&&(r=s))}return Ni(e,r)}function ns(t,e,r){const i=t.map((o,c)=>({name:o,count:e[c]})).sort((o,c)=>o.name>c.name?-1:1),s=(a=1,o=>a*=o.count);var a;const n=[...i.slice(1),{name:"",count:1}].reverse().map(s).reverse();let l=0;for(let o=t.length-1;o>=0;o--)l+=n[i.findIndex(({name:c})=>c===t[o])]*(r%e[o]),r=Math.floor(r/e[o]);return l}function as(t){const{width:e,height:r,extent:i,dimensions:s}=is(t),{ranges:a}=t,n=Object.keys(a).sort((h,m)=>ho[h.name]&&Object.assign(h,o[h.name]));const c=l.length?{variables:l}:void 0,u=[];for(let h=0;h2?h*d.slice(0,-2).reduce((k,_)=>k*_):0,I=p.slice(0,-2),R=d.slice(0,-2),S=g==="float"?"f32":rs(y),T=e*r,v=y.length/T;for(let k=0;kh.attributeTable)?.attributeTable;return{extent:i,pixelBlocks:u,multidimensionalInfo:c,attributeTable:f,bandNames:c?void 0:n}}let oe=class extends ae{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(t,e,r,i={}){if(!this._pixelBlockTiles){const{rasterInfo:a}=this,[n,l]=a.storageInfo.tileInfo.size,{sliceId:o}=i,{pixelBlocks:c}=this.source,u={pixelBlock:o==null?c[0]:c[o],useBilinear:a.dataType!=="thematic",tileSize:{width:n,height:l},level:t,row:e,col:r},f=this.rasterJobHandler?this.rasterJobHandler.clipTile(u,i):ki(u);return Promise.resolve(f)}const s=this._pixelBlockTiles.get(`${t}/${e}/${r}`);return Promise.resolve(s)}async _open(t){const e=this.source,{pixelBlocks:r,attributeTable:i,statistics:s,histograms:a,name:n,nativeExtent:l,transform:o}=e,c=r[0],{width:u,height:f,pixelType:h}=c,m=e.extent??new W({xmin:-.5,ymin:.5,xmax:u-.5,ymax:f-.5,spatialReference:new L({wkid:3857})}),y=e.isPseudoSpatialReference??!e.extent,g={x:m.width/u,y:m.height/f},p={...e.keyProperties};i&&(p.DataType="Thematic");const d=new ve({width:u,height:f,pixelType:h,extent:m,nativeExtent:l,attributeTable:i,transform:o,pixelSize:g,spatialReference:m.spatialReference,bandCount:c.pixels.length,keyProperties:p,multidimensionalInfo:e.multidimensionalInfo,statistics:s,isPseudoSpatialReference:y,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(d),this.createRemoteDatasetStorageInfo(d,512,512),this._set("rasterInfo",d),this.updateTileInfo(),d.multidimensionalInfo?await this._buildMDimStats(e.pixelBlocks,d.multidimensionalInfo):await this._buildInMemoryRaster(c,{width:512,height:512},t),d.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(t,e,r){const{rasterInfo:i}=this,s=i.storageInfo.maximumPyramidLevel??0,a=i.dataType!=="thematic",n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:e,maximumPyramidLevel:s,useBilinear:a},r):Promise.resolve(Ci(t,e,s,a)),l=i.statistics!=null,o=i.histograms!=null,c=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},r):Promise.resolve(hi(t)),u=await lt([n,c]);if(!u[0].value&&u[1].value)throw new C("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,l||(i.statistics=u[1].value?.statistics),o||(i.histograms=u[1].value?.histograms)}async _buildMDimStats(t,e,r){for(let i=0;inew Le({variableName:s.name,dimensionName:c.name,values:[c.values?.[0]??c.extent?.[0]],isSlice:!0})),n=mt(a,e),l=n==null?null:t[n];if(l==null)continue;const o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},r):He(l);s.statistics=o.statistics,s.histograms||(s.histograms=o.histograms)}}};w([b({type:String,json:{write:!0}})],oe.prototype,"datasetFormat",void 0),w([b()],oe.prototype,"source",void 0),w([b()],oe.prototype,"url",null),oe=w([K("esri.layers.support.rasterDatasets.InMemoryRaster")],oe);const $e=oe;let he=class extends ae{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const{extent:e,pixelBlocks:r,multidimensionalInfo:i,attributeTable:s,bandNames:a}=await this._fetchData(t),{statistics:n,histograms:l}=He(r[0]),o=a?.map(h=>({BandName:h})),c={DataType:s?"Thematic":i?"Scientific":"Generic",BandProperties:o},u=new $e({source:{extent:e,pixelBlocks:r,attributeTable:s?Ge.fromJSON(s):null,multidimensionalInfo:i,statistics:n,histograms:l,keyProperties:c,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(t){const e=this.source??(await this.request(this.url,{signal:t?.signal})).data,r="imagery-tile-layer:open-coverage-json";if(e.type?.toLowerCase()!=="coverage"||e.domain?.domainType?.toLowerCase()!=="grid")throw new C(r,"Only coverage with Grid domain type is supported");if(!e.ranges)throw new C(r,"Missing ranges in the grid coverage data");if(!e.domain.referencing?.length)throw new C(r,"Missing domain referencing in the grid coverage data");const i=Object.values(e.ranges);for(let s=0;si.push(l));return i}const s=t.getElementsByTagNameNS("*",r);if(!s||s.length===0)return[];for(let a=0;a0?e?q(i[0],e):i[0]:null}function Y(t,e=null){const r=e?q(t,e):t;let i;return r?(i=r.textContent||r.nodeValue,i?i.trim():null):null}function ls(t,e){const r=ue(t,e),i=[];let s;for(let a=0;aNumber(r))}function re(t,e){const r=Y(t,e);return Number(r)}function Ce(t,e){const r=t?.nodeName?.toLowerCase(),i=e.toLowerCase();return r.slice(r.lastIndexOf(":")+1)===i}function nt(t,e){if(!t||!e)return null;const r=[];for(let i=0;iNumber(h));let l,o,c,u;ue(t,"Metadata/MDI").forEach(h=>{const m=Number(h.textContent??h.nodeValue);switch(h.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":l=m;break;case"STATISTICS_MAXIMUM":o=m;break;case"STATISTICS_MEAN":c=m;break;case"STATISTICS_STDDEV":u=m}});const f=re(t,"Metadata/SourceBandIndex");return{noDataValue:e,histogram:n?.length&&i!=null&&s!=null?{min:i,max:s,size:a||n.length,counts:n}:null,sourceBandIndex:f,statistics:l!=null&&o!=null?{min:l,max:o,avg:c,stddev:u}:null}}function Se(t){if(!t)return null;let e=Number(t);if(!isNaN(e)&&e!==0)return new L({wkid:e});if(t=String(t).trim(),Bt(t))return new L({wkt2:t});const r=t.toUpperCase();if(r.startsWith("COMPD_CS")){if(!r.includes("VERTCS")||!r.includes("GEOGCS")&&!r.startsWith("PROJCS"))return null;const i=r.indexOf("VERTCS"),s=r.indexOf("PROJCS"),a=s>-1?s:r.indexOf("GEOGCS");if(a===-1)return null;const n=t.slice(a,t.lastIndexOf("]",i)+1).trim(),l=t.slice(i,t.lastIndexOf("]")).trim();e=Oe(n);const o=new L(e?{wkid:e}:{wkt:n}),c=Oe(l);return c&&(o.vcsWkid=c),o}return r.startsWith("GEOGCS")||r.startsWith("PROJCS")?(e=Oe(t),new L(e!==0?{wkid:e}:{wkt:t})):null}function Oe(t){const e=t.replaceAll("]","[").replaceAll('"',"").split("[").map(s=>s.trim()).filter(s=>s!==""),r=e[e.length-1].split(","),i=r[0]?.toLowerCase();if((i==="epsg"||i==="esri")&&t.endsWith('"]]')){const s=Number(r[1]);if(!isNaN(s)&&s!==0)return s}return 0}function qe(t){if(t?.documentElement.tagName?.toLowerCase()!=="pamdataset")return{};const e={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};t.documentElement.childNodes.forEach(i=>{if(i.nodeType===1){if(Ce(i,"SRS")){if(!e.spatialReference){const s=Y(i);e.spatialReference=Se(s)}}else if(Ce(i,"Metadata"))if(i.getAttribute("domain")==="xml:ESRI"){const{spatialReference:s,transform:a}=cs(i);e.transform=a,e.spatialReference||(e.spatialReference=s)}else ue(i,"MDI").forEach(s=>e.metadata[s.getAttribute("key")]=Y(s));else if(Ce(i,"PAMRasterBand")){const s=us(i);s.sourceBandIndex!=null&&e.rasterBands[s.sourceBandIndex]==null?e.rasterBands[s.sourceBandIndex]=s:e.rasterBands.push(s)}}});const r=e.rasterBands;if(r.length){const i=!!r[0].statistics;e.statistics=i?r.map(a=>a.statistics).filter(Me):null;const s=!!r[0].histogram;e.histograms=s?r.map(a=>a.histogram).filter(Me):null}return e}let be=class extends ae{fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const e=await this._fetchData(t);let{spatialReference:r,statistics:i,histograms:s,transform:a}=await this._fetchAuxiliaryData(t);const n=!r;n&&(r=new L({wkid:3857})),s?.length&&i==null&&(i=ze(s));const{width:l,height:o}=e;let c=new W({xmin:-.5,ymin:.5-o,xmax:l-.5,ymax:.5,spatialReference:r});const u=a?a.forwardTransform(c):c;let f=!0;if(a){const m=a.forwardCoefficients;f=m&&m[1]===0&&m[2]===0,f&&(a=null,c=u)}const h=new $e({source:{extent:u,nativeExtent:c,transform:a,pixelBlocks:[e],statistics:i,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:n},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(h.ioConfig.skipMapInfo=!0),await h.open(),h.source=null,this._set("rasterInfo",h.rasterInfo),this._inMemoryRaster=h}async _fetchData(t){const{data:e}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),r=mi(e).toUpperCase();if(r!=="JPG"&&r!=="PNG"&&r!=="GIF"&&r!=="BMP")throw new C("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r);const i=r.toLowerCase(),s=i==="gif"||i==="bmp"||!Ot("ios"),a=await this.decodePixelBlock(e,{format:i,useCanvas:s,hasNoZlibMask:!0});if(a==null)throw new C("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(t){const e=t?.signal,{skipExtensions:r=[],skipMapInfo:i}=this.ioConfig,s=i||r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),a=this.datasetFormat,n=a==="JPG"?"jgw":a==="PNG"?"pgw":a==="BMP"?"bpw":null,l=n&&r.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:e}),o=await lt([s,l]);if(e?.aborted)throw Pt();const c=qe(o[0].value?.data);if(!c.transform){const u=o[1].value?o[1].value.data.split(` -`).slice(0,6).map(f=>Number(f)):null;c.transform=u?.length===6?new We({forwardCoefficients:[u[4],u[5],u[0],-u[1],u[2],-u[3]]}):null}return c}};w([b({type:String,json:{write:!0}})],be.prototype,"datasetFormat",void 0),be=w([K("esri.layers.support.rasterDatasets.ImageAuxRaster")],be);const xe=be;let me=class extends ae{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(t,e,r,i={}){const{storageInfo:s,extent:a}=this.rasterInfo,{transposeInfo:n}=s,l=n!=null&&!!i.transposedVariableName;if(this._slices&&!l&&i.sliceId==null)return null;const o=l?0:s.maximumPyramidLevel-t+this._levelOffset,c=`${this.url}/tile/${o}/${e}/${r}`,u=this._slices?l?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,{data:f}=await this.request(c,{query:u,responseType:"array-buffer",signal:i.signal});if(!f)return null;const h=l?n.tileSize:s.tileInfo.size,m=await this.decodePixelBlock(f,{width:h[0],height:h[1],planes:null,pixelType:null,isPoint:this.tileType==="Elevation",returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue});if(m==null)return null;const y=s.blockBoundary[t];if(s.compression!=="jpg"||r>y.minCol&&ry.minRow&&e{const a=e.find(n=>s.variableName===n.variableName&&n.dimensionName===s.dimensionName);return a?(Array.isArray(s.values[0])?`${s.values[0][0]}-${s.values[0][1]}`:s.values[0])!==(Array.isArray(a.values[0])?`${a.values[0][0]}-${a.values[0][1]}`:a.values[0]):!0}))return r}return null}async fetchVariableStatisticsHistograms(t,e){const r=this.request(this.url+"/statistics",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.statistics),i=this.request(this.url+"/histograms",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.histograms),s=await Promise.all([r,i]);return s[0]&&s[0].forEach(a=>{a.avg=a.mean,a.stddev=a.standardDeviation}),s[1]?.[0]?.counts?.length||(s[1]=null),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(t,e={}){if(!this._tilemapCache)return 0;let r=this.identifyPixelLocation(t,0,e.datumTransformation);if(r===null)return null;let i=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let a=s-i+this._levelOffset;const n=r.srcLocation;for(;a>=0;){try{if(await this._tilemapCache.fetchAvailability(a,r.row,r.col,e)==="available")break}catch{}if(a--,i++,r=this.identifyPixelLocation(n,i,e.datumTransformation),r===null)return null}return a===-1||r==null?null:i}async _open(t){const e=t?.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:e});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const i=r.data;if(this.sourceJSON=i,!i)throw new C("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!i.tileInfo)throw new C("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const s=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=i.cacheType,this.tileType==null&&(s.includes(i.tileInfo.format.toLowerCase())?this.tileType="Map":i.tileInfo.format.toLowerCase()==="lerc"?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=i.name?.slice(i.name.indexOf("/")+1)??"";const a=await this._fetchRasterInfo({signal:e});if(a==null)throw new C("image-server-raster:open","cannot initialize image service");Yt(a,i);const n=this.tileType==="Map"?hs(i.tileInfo,i):ee.fromJSON(i.tileInfo);Mt(n);const[l,o]=this._computeMinMaxLOD(a,n),{extent:c,pixelSize:u}=a,f=.5/a.width*u.x,h=Math.max(u.x,u.y),{lods:m}=n;(this.tileType!=="Map"&&i.maxScale!==0||Math.abs(u.x-u.y)>f||!m.some(v=>Math.abs(v.resolution-h){v.level>=o.level&&v.level<=l.level&&d.push({x:v.resolution,y:v.resolution}),kv.x-k.x);const I=this.computeBlockBoundary(c,g,p,n.origin,d,y),R=d.length>1?d.slice(1):null;let S;i.transposeInfo&&(S={tileSize:[i.transposeInfo.rows,i.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});const T=x.length<=1||x.length>=3&&x.slice(0,-1).every(v=>v===x[0])?x[0]??2:Math.round(10/(o.resolution/l.resolution)**(-1/y))/10;if(a.storageInfo=new Re({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:R,pyramidScalingFactor:T,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:y,tileInfo:n,transposeInfo:S,blockBoundary:I}),ms(a),this._set("rasterInfo",a),i.capabilities.toLowerCase().includes("tilemap")){const v={tileInfo:a.storageInfo.tileInfo,parsedUrl:Nt(this.url),url:this.url,tileServers:[]};this._tilemapCache=new ji({layer:v})}}async _fetchRasterInfo(t){const e=this.sourceJSON;if(this.tileType==="Map"){const n=e.fullExtent||e.extent,l=Math.ceil((n.xmax-n.xmin)/e.pixelSizeX-.1),o=Math.ceil((n.ymax-n.ymin)/e.pixelSizeY-.1),c=L.fromJSON(e.spatialReference||n.spatialReference),u=new A({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:c});return new ve({width:l,height:o,bandCount:3,extent:W.fromJSON(n),spatialReference:c,pixelSize:u,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:r}=t,i=Kt(this.url,this.sourceJSON,{signal:r,query:this.ioConfig.customFetchParameters}),s=e.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:r}).then(n=>n.data?.slices).catch(()=>null):null,a=await Promise.all([i,s]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:t}=this;t.minScale&&t.minScale<0&&(t.minScale=0),t.maxScale&&t.maxScale<0&&(t.maxScale=0)}_computeMinMaxLOD(t,e){const{pixelSize:r}=t,i=.5/t.width*r.x,{lods:s}=e,a=e.lodAt(Math.max.apply(null,s.map(h=>h.level))),n=e.lodAt(Math.min.apply(null,s.map(h=>h.level))),{tileType:l}=this;if(l==="Map")return this._levelOffset=s[0].level,[a,n];if(l==="Raster")return[s.find(h=>h.resolution===r.x)??a,n];const{minScale:o,maxScale:c}=this.sourceJSON;let u=a;c>0&&(u=s.find(h=>Math.abs(h.scale-c)h.scale>c).sort((h,m)=>h.scale>m.scale?1:-1)[0]??a));let f=n;return o>0&&(f=s.find(h=>Math.abs(h.scale-o)n!=null&&n>=s&&n<=a)});if(r!==0&&i!==0){const n=c=>Math.round(1e4*c)/1e4,l=r?n(r):1/0,o=i?n(i):-1/0;return ee.fromJSON({...t,lods:t.lods.filter(c=>{const u=n(c.scale);return u<=l&&u>=o})})}return ee.fromJSON(t)}function ms(t){const{extent:e,spatialReference:r}=t;e.xmin>-1&&e.xmax>181&&r?.wkid&&r.isGeographic&&(t.nativeExtent=t.extent,t.transform=new Hi,t.extent=t.transform.forwardTransform(e))}w([b({type:String,json:{write:!0}})],me.prototype,"datasetFormat",void 0),w([b()],me.prototype,"tileType",void 0),me=w([K("esri.layers.support.rasterDatasets.ImageServerRaster")],me);const fs=me,U=new Map;U.set("Int8","s8"),U.set("UInt8","u8"),U.set("Int16","s16"),U.set("UInt16","u16"),U.set("Int32","s32"),U.set("UInt32","u32"),U.set("Float32","f32"),U.set("Float64","f32"),U.set("Double64","f32");const Z=new Map;Z.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Z.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Z.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Z.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let le=class extends ae{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(t,e,r,i={}){const{blockWidth:s,blockHeight:a,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[t];if(!l||l.maxRowe||l.minCol>r)return null;const{bandCount:o,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:f,actualTileHeight:h}=this._getTileLocation(t,e,r);if(!u||u.length===0)return null;if(u[0].from===0&&u[0].to===0){const F=new Uint8Array(s*a);return new we({width:s,height:a,pixels:void 0,mask:F,validPixelCount:0})}const{bandIds:m}=this.ioConfig,y=this._getBandSegmentCount(),g=[];let p=0;for(p=0;pF.data.byteLength).reduce((F,M)=>F+M),I=new Uint8Array(x),R=[];let S=0;for(p=0;p1e24)for(p=0;p1e-6&&(M[p]=1);else for(p=0;p0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}_getBandSegmentCount(){return Z.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,r){const{blockWidth:i,blockHeight:s,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:n,height:l}=this.rasterInfo,o=this._getBandSegmentCount();let c,u,f,h=0,m=0;for(f=0;fparseFloat(F)))),q(t,"MRF_META/CachedSource"))throw new C("mrf:open","currently does not support MRF referencing other data files");const g=q(t,"MRF_META/GeoTags"),p=q(g,"BoundingBox");let d,x=!1;if(p!=null){const F=parseFloat(p.getAttribute("minx")),M=parseFloat(p.getAttribute("miny")),O=parseFloat(p.getAttribute("maxx")),N=parseFloat(p.getAttribute("maxy")),D=Y(g,"Projection")||"";let J=L.WGS84;if(D!=="LOCAL_CS[]")if(D.toLowerCase().startsWith("epsg:")){const z=Number(D.slice(5));isNaN(z)||z===0||(J=new L({wkid:z}))}else J=Se(D)??L.WGS84;else x=!0,J=new L({wkid:3857});d=new W(F,M,O,N),d.spatialReference=J}else x=!0,d=new W({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:new L({wkid:3857})});const I=q(t,"MRF_META/Rsets"),R=parseInt(I?.getAttribute("scale")||"2",10),S=d.spatialReference,T=new Re({origin:new A({x:d.xmin,y:d.ymax,spatialReference:S}),blockWidth:u,blockHeight:f,pyramidBlockWidth:u,pyramidBlockHeight:f,compression:n,pyramidScalingFactor:R}),v=new A({x:d.width/i,y:d.height/s,spatialReference:S}),k=new ve({width:i,height:s,extent:d,isPseudoSpatialReference:x,spatialReference:S,bandCount:a,pixelType:o,pixelSize:v,noDataValue:m,storageInfo:T}),_=Y(t,"datafile"),P=Y(t,"IndexFile");return{rasterInfo:k,files:{mrf:this.url,index:P||this.url.replace(".mrf",".idx"),data:_||this.url.replace(".mrf",Z.get(n).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return qe(e)}catch{return null}}};function ps(t){if(t.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let e,r,i,s,a,n;if(fi){for(r=new Uint8Array(t),s=new ArrayBuffer(t.byteLength),i=new Uint8Array(s),a=0;ac.name.toLowerCase()==="oid")?"OBJECTID":"OID",s=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(e.map(c=>({name:c.name,type:"esriFieldType"+c.typeName,alias:c.name}))),a=s.map(c=>c.name),n=[];let l=0,o=0;return r.forEach(c=>{const u={};for(u[i]=l++,o=1;o0)for(;u.lengthn;){const h=[];r.getUint8(o)===32?(o+=1,c.forEach(m=>{if(m.type==="C")h.push(Qe(new Uint8Array(e,o,m.length)).trim());else if(m.type==="N")h.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim(),10));else if(m.type==="F")h.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim()));else if(m.type==="D"){const y=String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim();h.push(new Date(parseInt(y.slice(0,4),10),parseInt(y.slice(4,6),10)-1,parseInt(y.slice(6,8),10)))}o+=m.length}),u.push(h)):o+=n}}return{header:l,fields:c,records:u,recordSet:ys({fields:c,records:u})}}}const Je=(t,e)=>t.get(e)?.values,fe=(t,e)=>t.get(e)?.values?.[0];let se=class extends ae{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async fetchRawTile(t,e,r,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(t,e,r))return null;const s=await this._fetchRawTiffTile(t,e,r,!1,i);if(s!=null&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(t,e,r,!0,i);a!=null&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}async _open(t){const e=t?t.signal:null,{data:r}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:e});if(!r)throw new C("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:i,firstIFDPos:s,isBigTiff:a}=pi(r),n=[];await this._readIFDs(n,r,i,s,0,a?8:4,e);const{imageInfo:l,rasterInfo:o}=xs(n),c=di(n),u=yi(n);if(this._headerInfo={littleEndian:i,isBigTiff:a,ifds:n,pyramidIFDs:c,maskIFDs:u,...l},this._set("rasterInfo",o),!l.isSupported)throw new C("tiffraster:open","this tiff is not supported: "+l.message);if(!l.tileWidth)throw new C("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");o.isPseudoSpatialReference&&ne.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const f=n[0].get("PREDICTOR")?.values?.[0];if(n[0].get("SAMPLEFORMAT")?.values?.[0]===3&&f===2)throw new C("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:h,skipExtensions:m=[]}=this.ioConfig;if(!m.includes("aux.xml")&&!h){const y=await this._fetchAuxiliaryMetaData(t);y!=null&&ws(y,o)}m.includes("vat.dbf")||o.bandCount!==1||o.pixelType!=="u8"||h||(o.attributeTable=await this._fetchAuxiliaryTable(t),o.attributeTable!=null&&(o.keyProperties.DataType="thematic")),h&&this.updateImageSpaceRasterInfo(o),this.updateTileInfo()}async _readIFDs(t,e,r,i,s,a=4,n){if(!i)return null;(i>=e.byteLength||i<0)&&(e=(await this.request(this.url,{range:{from:i+s,to:i+s+this._bufferSize},responseType:"array-buffer",signal:n})).data,s=i+s,i=0);const l=await this._readIFD(e,r,i,s,pe.tiffTags,a,n);if(t.push(l.ifd),!l.nextIFD)return null;await this._readIFDs(t,e,r,l.nextIFD-s,s,a,n)}async _readIFD(t,e,r,i,s=pe.tiffTags,a=4,n){if(!t)return null;const l=gi(t,e,r,i,s,a);if(l.success){const o=[];if(l.ifd?.forEach(c=>{c.values||o.push(c)}),o.length>0){const c=o.map(f=>f.offlineOffsetSize).filter(Me),u=Math.min.apply(null,c.map(f=>f[0]));if(Math.min.apply(null,c.map(f=>f[0]+f[1]))-u<=this._bufferSize){const{data:f}=await this.request(this.url,{range:{from:u,to:u+this._bufferSize},responseType:"array-buffer",signal:n});t=f,i=u,o.forEach(h=>xi(t,e,h,i))}}if(l.ifd?.has("GEOKEYDIRECTORY")){const c=l.ifd.get("GEOKEYDIRECTORY"),u=c?.values;if(u&&u.length>4){const f=u[0]+"."+u[1]+"."+u[2],h=await this._readIFD(t,e,c.valueOffset+6-i,i,pe.geoKeys,2,n);c.data=h.ifd,c.data&&c.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[f]})}}return l}if(l.requiredBufferSize&&l.requiredBufferSize!==t.byteLength)return(t=(await this.request(this.url,{range:{from:i,to:i+l.requiredBufferSize+4},responseType:"array-buffer",signal:n})).data).byteLengththis.request(this.url,{range:T,responseType:"array-buffer",signal:s.signal})),f=await Promise.all(u),h=f.map(T=>T.data.byteLength).reduce((T,v)=>T+v),m=f.length===1?f[0].data:new ArrayBuffer(h),y=[0],g=[0];if(f.length>1){const T=new Uint8Array(m);for(let v=0,k=0;vy||r>g||e3&&F.length%3==0){_=[];const O=F.length/3;for(let N=0;N>>8,F[N+O]>>>8,F[N+2*O]>>>8])}const M=new ve({width:r,height:i,bandCount:n,pixelType:l,pixelSize:v,storageInfo:T,spatialReference:x,isPseudoSpatialReference:I,keyProperties:k,extent:R,colormap:_,statistics:p?p.statistics:null});if(g?.length&&(M.nativeExtent=new W({xmin:-.5,ymin:.5-i,xmax:r-.5,ymax:.5,spatialReference:x}),M.transform=new We({polynomialOrder:1,forwardCoefficients:[g[2]+g[0]/2,g[5]-g[3]/2,g[0],g[3],-g[1],-g[4]]}),M.extent=M.transform.forwardTransform(M.nativeExtent),M.pixelSize=new A({x:(R.xmax-R.xmin)/r,y:(R.ymax-R.ymin)/i,spatialReference:x}),T.origin.x=-.5,T.origin.y=.5),m){const{x:O,y:N}=M.pixelSize;m.forEach(D=>{D.x*=O,D.y*=N})}return{imageInfo:e,rasterInfo:M}}function ws(t,e){if(e.statistics=t.statistics??e.statistics,e.histograms=t.histograms,t.histograms&&e.statistics==null&&(e.statistics=ze(t.histograms)),t.transform&&e.transform==null){e.transform=t.transform,e.nativeExtent=e.extent;const r=e.transform.forwardTransform(e.nativeExtent);e.pixelSize=new A({x:(r.xmax-r.xmin)/e.width,y:(r.ymax-r.ymin)/e.height,spatialReference:e.spatialReference}),e.extent=r}e.isPseudoSpatialReference&&t.spatialReference&&(e.spatialReference=t.spatialReference,e.extent.spatialReference=e.nativeExtent.spatialReference=e.storageInfo.origin.spatialReference=e.spatialReference)}w([b()],se.prototype,"_files",void 0),w([b()],se.prototype,"_headerInfo",void 0),w([b()],se.prototype,"_bufferSize",void 0),w([b({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),se=w([K("esri.layers.support.rasterDatasets.TIFFRaster")],se);const Is=se,H=new Map;H.set("MRF",{desc:"Meta Raster Format",constructor:ds}),H.set("TIFF",{desc:"GeoTIFF",constructor:Is}),H.set("RasterTileServer",{desc:"Raster Tile Server",constructor:fs}),H.set("JPG",{desc:"JPG Raster Format",constructor:xe}),H.set("PNG",{desc:"PNG Raster Format",constructor:xe}),H.set("GIF",{desc:"GIF Raster Format",constructor:xe}),H.set("BMP",{desc:"BMP Raster Format",constructor:xe}),H.set("CovJSON",{desc:"COVJSON Raster Format",constructor:os}),H.set("MEMORY",{desc:"In Memory Raster Format",constructor:$e});class Pe{static get supportedFormats(){const e=new Set;return H.forEach((r,i)=>e.add(i)),e}static async open(e){const{url:r,ioConfig:i,source:s,sourceJSON:a}=e;let n=e.datasetFormat??i?.datasetFormat;n==null&&(r.includes(".")?n=r.slice(r.lastIndexOf(".")+1).toUpperCase():s?.type?.toLowerCase()==="coverage"?n="CovJSON":s?.extent&&s.pixelblocks&&(n="MEMORY")),n==="OVR"||n==="TIF"?n="TIFF":n==="JPG"||n==="JPEG"||n==="JFIF"?n="JPG":n==="COVJSON"&&(n="CovJSON"),r.toLowerCase().includes("/imageserver")&&!r.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const l={url:r,source:s,sourceJSON:a,datasetFormat:n,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(f=>{l[f]==null&&delete l[f]}),n){if(!this.supportedFormats.has(n))throw new C("rasterfactory:open","not a supported format "+n);if(n==="CRF")throw new C("rasterfactory:open",`cannot open raster: ${r}`);const f=new(H.get(n)).constructor(l);return await f.open({signal:e.signal}),f}const o=Array.from(H.keys()).filter(f=>f!=="CovJSON"&&f!=="Memory");let c=0;const u=()=>{if(n=o[c++],!n||n==="CRF")return null;const f=new(H.get(n)).constructor(l);return f.open({signal:e.signal}).then(()=>f).catch(()=>u())};return u()}static register(e,r,i){H.has(e.toUpperCase())||H.set(e.toUpperCase(),{desc:r,constructor:i})}}let E=class extends Wt(qi(Wi(Gi($t(Gt(ts(Vi(zt($i(Lt(wt(Ht)))))))))))){constructor(...t){super(...t),this._primaryRasters=[],this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=It(async(e,r,i)=>{const{save:s,saveAs:a}=await at(()=>import("./imageryUtils-6MVSqijr-B_Ii3EHZ.js"),__vite__mapDeps([8,9,1,2,3,4,10,11,12,13,14,15,16,17]),import.meta.url);switch(e){case ye.SAVE:return s(this,r);case ye.SAVE_AS:return a(this,i,r)}})}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},t).catch(bt).then(()=>this._openRaster(e))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const t=[new ce({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new ce({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],e=this.raster?.rasterInfo??this.serviceRasterInfo,r=e?.attributeTable,i=r!=null?r.fields:null,s="Raster.";if(i){const l=i.filter(o=>o.type!=="oid"&&o.name.toLowerCase()!=="value").map(o=>{const c=o.clone();return c.name=s+o.name,c});t.push(...l)}const a=e?.dataType,n=e?.multidimensionalInfo;if((a==="vector-magdir"||a==="vector-uv")&&n!=null){const l=n.variables[0].unit?.trim(),o="Magnitude"+(l?` (${l})`:"");t.push(new ce({name:"Raster.Magnitude",alias:o,domain:null,editable:!1,type:"double"})),t.push(new ce({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return t}createPopupTemplate(t){const{rasterFields:e}=this,r=t?.visibleFieldNames??new Set(e.map(({name:a})=>a).filter(a=>a.toLowerCase()!=="raster.servicepixelvalue.raw")),i=Ui({fields:e,title:this.title},{...t,visibleFieldNames:r}),{rasterInfo:s}=this.raster;return i?.fieldInfos&&s?.pixelType.startsWith("f")&&i.fieldInfos.forEach(({format:a,fieldName:n})=>{a&&n&&/^raster\.(item|service)pixelvalue/i.test(n)&&(a.places=2)}),i}async generateRasterInfo(t,e){if(t=Ae(Ne,t),await this.load(),!t||t.functionName?.toLowerCase()==="none")return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(t,e);return r}catch(r){throw r instanceof C?r:new C("imagery-tile-layer","the given raster function is not supported")}}async save(t){return this._debouncedSaveOperations(ye.SAVE,t)}async saveAs(t,e){return this._debouncedSaveOperations(ye.SAVE_AS,e,t)}write(t,e){const r=this._primaryRasters[0]??this.raster;if(this.loaded?r.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(t,e);if(e?.messages){const i=`${e.origin}/${e.layerContainerType||"operational-layers"}`;e.messages.push(new C("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(t){let e=!1;if(this.raster)await this._openFromRaster(this.raster,t),e=this.raster.datasetFormat==="Function",!e&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:i,rasterFunction:s,source:a}=this;if(!i&&!a)throw new C("imagery-tile-layer:open","missing url or source parameter");a?await this._openFromSource(a,t):s?await this._openFromUrlWithRasterFunction(i,s,t):await this._openFromUrl(i,t)}const r=this.raster.rasterInfo;if(!r)throw new C("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",e?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){const i=this.raster.tileType==="Map"&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(i,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),this.raster.tileType==="Map"&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(Rt(()=>this.customParameters,i=>{this.raster&&(this.raster.ioConfig.customFetchParameters=i)}))}async _openFromRaster(t,e){t.rasterInfo||await t.open({signal:e}),this._primaryRasters=t.datasetFormat==="Function"?t.primaryRasters.rasters:[t],this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(t,e,r){const i=[t];e&&Li(e.toJSON(),i);const s=await Promise.all(i.map(n=>Pe.open({url:n,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=s.findIndex(n=>n==null);if(a>-1)throw new C("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=s,this._initializeWithFunctionRaster(e)}async _openFromUrl(t,e){const r=await Pe.open({url:t,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(r==null)throw new C("imagery-tile-layer:open",`cannot open raster: ${t}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(t,e){const r="the tiled imagery data source is not supported",i=t.type?.toLowerCase()==="coverage"?"CovJSON":t.extent&&t.pixelBlock?"MEMORY":null;if(!i)throw new C("imagery-tile-layer:open",r);i==="MEMORY"&&(t={...t,pixelBlock:void 0,pixelBlocks:[t.pixelBlock]});const s=await Pe.open({url:"",source:t,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(s==null)throw new C("imagery-tile-layer:open",r);this._primaryRasters=[s],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=s}async _openFunctionRaster(t,e){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(a=>r[a.url]=a);const i=pt(t.functionDefinition?.toJSON()??t.toJSON(),r),s=new dt({rasterFunction:i});return await s.open(e),s}async _initializeWithFunctionRaster(t,e){try{this.raster=await this._openFunctionRaster(t,e)}catch(r){r instanceof C&&ne.getLogger(this).error("imagery-tile-layer:open",r.message),ne.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}};w([b({clonable:!1})],E.prototype,"_primaryRasters",void 0),w([b(ri)],E.prototype,"legendEnabled",void 0),w([b({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],E.prototype,"isReference",void 0),w([b({type:["show","hide"]})],E.prototype,"listMode",void 0),w([b({json:{read:!0,write:!0}})],E.prototype,"blendMode",void 0),w([b()],E.prototype,"sourceJSON",void 0),w([b({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],E.prototype,"version",void 0),w([b({readOnly:!0,json:{read:!1}})],E.prototype,"type",void 0),w([b({type:["ArcGISTiledImageServiceLayer"]})],E.prototype,"operationalLayerType",void 0),w([b({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(t,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}},writer(t,e,r){e[r]=!t}}}})],E.prototype,"popupEnabled",void 0),w([b({type:vt,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}}}}})],E.prototype,"popupTemplate",void 0),w([b({readOnly:!0})],E.prototype,"defaultPopupTemplate",null),w([b({readOnly:!0,type:[ce]})],E.prototype,"fields",void 0),w([b({readOnly:!0,type:[ce]})],E.prototype,"rasterFields",null),w([b({constructOnly:!0})],E.prototype,"source",void 0),E=w([K("esri.layers.ImageryTileLayer")],E);const Br=E;export{Br as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-ChEr_3ja.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-McBHp1Y5.js","./imageryUtils-6MVSqijr-2ufISwt4.js","./utils-BVWK2jiA-i-Dn2Ad8.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CfFOGshS.js","./jsonContext-BA8GHqVk-BsXRY5es.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./saveUtils-CIYk-dsQ-Br9QCJTX.js"])))=>i.map(i=>d[i]); +import{_ as at}from"./main-QGPoLsvl.js";import{v as w,S as b,i as K,aa as wt,bp as It,W as bt,aO as Ae,o as C,ah as Rt,a1 as ne,bL as vt,e as St,w as A,n as W,f as ot,J as L,E as Tt,l as _t,bB as Ft,bz as kt,a0 as Ct,iF as lt,K as Ot,aS as Pt,O as Mt,a as Nt,aq as Me,eC as Dt,aG as Et,jz as Bt,ar as Jt,cB as At}from"./story-Doly9N9p.js";import{m as Lt}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as Ht}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{a as zt}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{u as Wt}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as Gt}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{J as $t,k as Ne,p as qt,A as Vt,l as jt,c as Ut,V as Yt,E as Kt,a as Xt,Z as Qt,b as je,I as Ue,T as Zt,v as ei,w as ti,C as ii,S as Ye,f as si}from"./RasterPresetRendererMixin-D6W9pUY6-Bm_m_CYY.js";import{j as ct}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{Z as ut,_ as ri}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{R as ht,J as mt,Y as ni,I as ai,g as Le,j as Ke,p as oi,T as Xe,z as li}from"./multidimensionalUtils-BwTugeu7-C75LYPc9.js";import{V as ee,d as ci}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import{V as ui,c as Re,W as ve,S as hi,d as He,s as ze,b as mi,u as fi,v as pi,A as di,D as yi,E as pe,F as gi,H as xi,N as wi,J as Ii,t as bi,L as Qe}from"./RasterSymbolizer-BVys6HkM-DCN-TPRo.js";import{K as Ze,U as et,V as tt,X as Ri,Q as vi}from"./RawBlockCache-Cj_tmHDm-gcQCDGFb.js";import{f as Te,A as ft,M as Si,v as Ti,x as _i,b as Fi,k as ki,y as Ci,E as Oi,D as we,w as Pi,R as Mi,K as Ni}from"./dataUtils-BkPy4R3C-Dzc1QGGb.js";import{k as de,L as De,n as it,Q as st,X as Di,s as _e,o as Ie,K as Ei,Y as Bi,W as Ji,F as Ee}from"./rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js";import{k as Ai}from"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import{D as Li,h as pt,E as Be,v as We,x as Hi,B as zi}from"./PolynomialTransform-C3nWCu0l-BJIAAiDA.js";import{O as Ge}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{E as Wi}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as Gi}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as $i}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as qi}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{x as Vi}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{y as ce}from"./Field-C6hA1tZj-CkWoRbmp.js";import{f as ji}from"./TilemapCache-CRRxws77-CCC00Yar.js";import{w as Ui}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import{E as ye}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./utils-DPtQ14k3-CBDffBYM.js";import"./cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";const rt=8,Yi=256;let Ki=0,B=class extends St{constructor(){super(...arguments),this._tileFetchQueue=new Ai({concurrency:32,process:(t,e)=>this._fetchRawTile(t.pyramidLevel,t.row,t.col,{...t.options,signal:e})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(t){return t?.ioConfig&&(t={...t,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:ee.create(),...t.ioConfig}}),t}get _isGlobalWrappableSource(){const{rasterInfo:t}=this,e=de(t.spatialReference);return e!=null&&t.extent.width>=e/2}get _hasNoneOrGCSShiftTransform(){const{transform:t}=this.rasterInfo;return t==null||t.type==="gcs-shift"}set rasterJobHandler(t){this._set("rasterJobHandler",t),this.datasetFormat==="Function"&&this.primaryRasters?.rasters?.forEach(e=>e.rasterJobHandler=t)}get rasterId(){return this.url||"rasterId-"+Ki++}set url(t){this._set("url",ct(t,ne.getLogger(this)))}async open(t){return this._openPromise??=De().then(()=>this._open(t)),this._openPromise}async fetchTile(t,e,r,i={}){const s=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,a=this.getTileExtentFromTileInfo(t,e,r,s);return i={noClip:!0,...i},this.fetchPixels(a,s.size[0],s.size[1],i)}async identify(t,e={}){t=Ae(A,t).clone().normalize();const{multidimensionalDefinition:r,timeExtent:i}=e,{rasterInfo:s}=this,{hasMultidimensionalTranspose:a,multidimensionalInfo:n}=s;let{transposedVariableName:l}=e;const o=n!=null&&a&&(i!=null||ht(r));o&&!l&&(l=r!=null&&r.length>0?r[0].variableName??void 0:n.variables[0].name,e={...e,transposedVariableName:l}),e=this._getRequestOptionsWithSliceId(e);const{spatialReference:c,extent:u}=s,{datumTransformation:f}=e;let h=it(t,c,f);if(!u.intersects(h))return{location:h,value:null};if(s.transform!=null){const F=s.transform.inverseTransform(h);if(!s.nativeExtent.intersects(F))return{location:F,value:null};h=F}let m=0;const y=l!=null&&n!=null&&s.hasMultidimensionalTranspose;if(this.datasetFormat==="Function"){const F=this.primaryRasters.rasters[0];if(y)return F.identify(h,e);const{pixelSize:M}=s,O=3,N=M.x*O/2,D=M.y*O/2,J=new W({xmin:h.x-N,xmax:h.x+N,ymin:h.y-D,ymax:h.y+D,spatialReference:c}),z={interpolation:"nearest",multidimensionalDefinition:r,sliceId:e.sliceId},{pixelBlock:j}=await F.fetchPixels(J,O,O,z),{pixelBlock:G}=await this.fetchPixels(J,O,O,z);if(j==null)return{location:h,value:null};const $=Math.floor(O*O*.5),X=!j.mask||j.mask[$]?j.pixels.map(V=>V[$]):null;let te;return G!=null&&(te=!G.mask||G.mask[$]?G.pixels.map(V=>V[$]):void 0),{location:h,value:X,processedValue:te,pyramidLevel:0}}if(!y){if(e.srcResolution)m=st(e.srcResolution,s,this.ioConfig.sampling).pyramidLevel;else if(m=await this.computeBestPyramidLevelForLocation(t,e),m==null)return{location:h,value:null}}const g=this.identifyPixelLocation(h,m,null,y);if(g===null)return{location:h,value:null};const{row:p,col:d,rowOffset:x,colOffset:I,blockWidth:R}=g,S=l??e.sliceId,T=Ze(this.rasterId,S),v=`${m}/${p}/${d}`;let k=et(T,null,v);k==null&&(k=this.fetchRawTile(m,p,d,e),tt(T,null,v,k));const _=await k;if(!_?.pixels?.length)return{location:h,value:null};const P=x*R+I;return this._processIdentifyResult(_,{srcLocation:h,position:P,pyramidLevel:m,useTransposedTile:!!y,requestSomeSlices:o,identifyOptions:e})}async fetchPixels(t,e,r,i={}){t=Di(t),i=this._getRequestOptionsWithSliceId(i);const{_hasNoneOrGCSShiftTransform:s}=this;if(i.requestRawData&&s)return this._fetchPixels(t,e,r,i);const a=de(t.spatialReference),n=_e(t);if(a==null||n===0||n===1&&this._isGlobalWrappableSource&&s)return this._fetchPixels(t,e,r,i);if(n>=3)return{extent:t,pixelBlock:null};const l=[],{xmin:o,xmax:c}=t,u=Math.round(a/(c-o)*e),f=u-Math.round((a/2-o)/(c-o)*e);let h=0;const m=[];for(let d=0;d<=n;d++){const x=new W({xmin:d===0?o:-a/2,xmax:d===n?c-a*d:a/2,ymin:t.ymin,ymax:t.ymax,spatialReference:t.spatialReference}),I=d===0?u-f:d===n?e-h:u;h+=I,m.push(I);const R=i.disableWrapAround&&d>0?null:this._fetchPixels(x,I,r,i);l.push(R)}const y=(await Promise.all(l)).map(d=>d?.pixelBlock);let g=null;const p={width:e,height:r};return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:y,srcMosaicSize:p,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:m},i)).pixelBlock:g=Te(y,p,{blockWidths:m}),{extent:t,srcExtent:Ie(t,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:g}}async fetchRawPixels(t,e,r,i={}){e={x:Math.floor(e.x),y:Math.floor(e.y)};const s=await this._fetchRawTiles(t,e,r,i),{nativeExtent:a,nativePixelSize:n,storageInfo:l}=this.rasterInfo,o=2**t,c=n.x*o,u=n.y*o,f=new W({xmin:a.xmin+c*e.x,xmax:a.xmin+c*(e.x+r.width-1),ymin:a.ymax-u*(e.y+r.height-1),ymax:a.ymax-u*e.y,spatialReference:a.spatialReference});if(!s)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:h,mosaicSize:m}=s;if(h.length===1&&h[0]!=null&&h[0].width===r.width&&h[0].height===r.height)return{extent:f,srcExtent:f,pixelBlock:s.pixelBlocks[0]};const y=t>0?l.pyramidBlockWidth:l.blockWidth,g=t>0?l.pyramidBlockHeight:l.blockHeight,p={x:e.x%y,y:e.y%g};let d;return this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:h,srcMosaicSize:m,destDimension:r,clipOffset:p,clipSize:r,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:d=Te(h,m,{clipOffset:p,clipSize:r}),{extent:f,srcExtent:f,pixelBlock:d}}fetchRawTile(t,e,r,i){throw new C("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(t){return Ie(this.rasterInfo.extent,t)}decodePixelBlock(t,e){return!this.rasterJobHandler||e.useCanvas?ui(t,e):this.rasterJobHandler.decode({data:t,options:e})}async request(t,e,r=0){const{customFetchParameters:i}=this.ioConfig,{range:s,query:a,headers:n}=e;r=r??e.retryCount??this.ioConfig.retryCount;const l=s?{Range:`bytes=${s.from}-${s.to}`}:null;try{return await ot(t,{...e,query:{...a,...i},headers:{...n,...l}})}catch(o){if(r>0)return r--,this.request(t,e,r);throw o}}getSliceIndex(t){const{multidimensionalInfo:e}=this.rasterInfo;return e==null||t==null||t.length===0?null:mt(t,e)}getTileExtentFromTileInfo(t,e,r,i){const s=i.lodAt(t);return this.getTileExtent({x:s.resolution,y:s.resolution},e,r,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:t,spatialReference:e,extent:r,pixelSize:i}=this.rasterInfo,{pyramidResolutions:s}=t;if(!t.tileInfo){const a=[],n=t.maximumPyramidLevel||0;let l=(i.x+i.y)/2,o=1/.0254*96*l;for(let u=0;u<=n&&(a.unshift(new ci({level:n-u,resolution:l,scale:o})),u!==n);u++)if(s){const f=(s[u].x+s[u].y)/2;o*=f/l,l=f}else l*=2,o*=2;const c=new A({x:r.xmin,y:r.ymax,spatialReference:e});t.tileInfo=new ee({origin:c,size:[t.blockWidth,t.blockHeight],spatialReference:e,lods:a}),t.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(t,e=512,r=512,i){const{width:s,height:a,nativeExtent:n,pixelSize:l,spatialReference:o}=t,c=new A({x:n.xmin,y:n.ymax,spatialReference:o});i==null&&(i=Math.max(0,Math.round(Math.log(Math.max(s,a))/Math.LN2-8)));const u=this.computeBlockBoundary(n,512,512,{x:n.xmin,y:n.ymax},[l],i);t.storageInfo=new Re({blockWidth:e,blockHeight:r,pyramidBlockWidth:e,pyramidBlockHeight:r,origin:c,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:u})}async computeBestPyramidLevelForLocation(t,e={}){return 0}computeBlockBoundary(t,e,r,i,s,a=0,n=2){if(s.length===1&&a>0){s=[...s];let{x:u,y:f}=s[0];for(let h=0;hl)return null;const m=this.getPyramidPixelSize(e),{x:y,y:g}=m,p=(o.y-h.y)/g/f,d=(h.x-o.x)/y/u,x=Math.min(f-1,Math.floor((p-Math.floor(p))*f)),I=Math.min(u-1,Math.floor((d-Math.floor(d))*u));return{pyramidLevel:e,row:Math.floor(p),col:Math.floor(d),rowOffset:x,colOffset:I,blockWidth:u,srcLocation:h}}getTileExtent(t,e,r,i,s,a){const[n,l]=a,o=i.x+r*n*t.x,c=o+n*t.x,u=i.y-e*l*t.y,f=u-l*t.y;return new W({xmin:o,xmax:c,ymin:f,ymax:u,spatialReference:s})}getBlockWidthHeight(t){return{blockWidth:t>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:t>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(t,e,r){const i=this.rasterInfo.storageInfo.blockBoundary[t];return!i||i.maxRowe||i.minCol>r}updateImageSpaceRasterInfo(t){const{pixelSize:e}=t,{width:r,height:i}=t,s=L.WebMercator;t.spatialReference=s,t.extent=t.nativeExtent=new W({xmin:-.5,ymax:.5,xmax:r-.5,ymin:.5-i,spatialReference:s}),t.isPseudoSpatialReference=!0,t.transform=null,t.pixelSize=new A({x:1,y:1,spatialReference:s});const{extent:a,storageInfo:n}=t;if(n){n.origin=new A({x:a.xmin,y:a.ymax,spatialReference:s});const{pyramidResolutions:l,tileInfo:o}=n;if(l&&l.forEach(c=>{c.x/=e.x,c.y/=e.y}),o){o.origin=n.origin;const c=(t.nativePixelSize.x+t.nativePixelSize.y)/2;o.lods.forEach((u,f)=>{u.resolution=c*2**f,u.scale=96*u.resolution/.0254})}}}async _fetchPixels(t,e,r,i={}){let s=_e(t);if(s>=2)return{extent:t,pixelBlock:null};const a=this._getSourceDataInfo(t,e,r,i),{pyramidLevel:n,srcResolution:l,srcExtent:o,srcWidth:c,srcHeight:u,ul:f}=a;if(c===0||u===0)return{extent:t,srcExtent:o,pixelBlock:null};const{rasterInfo:h}=this,m=h.transform,y=m?.type==="gcs-shift",g=de(t.spatialReference)!=null;!y&&g||(s=_e(a.srcExtent,y));const p=await this._fetchRawTiles(n,f,{width:c,height:u,wrapCount:s},i);if(!p)return{extent:t,srcExtent:o,pixelBlock:null};const d=h.storageInfo,x=n>0?d.pyramidBlockWidth:d.blockWidth,I=n>0?d.pyramidBlockHeight:d.blockHeight;let{x:R,y:S}=h.pixelSize;if(n>0){const{pyramidResolutions:Q,pyramidScalingFactor:xt}=d;if(Q!=null&&Q[n-1])({x:R,y:S}=Q[n-1]);else{const Ve=xt**n;R*=Ve,S*=Ve}}const T=h.spatialReference,v=new A({x:R,y:S,spatialReference:T}),k=x===c&&I===u&&f.x%x==0&&f.y%I==0,_=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference}),P=!t.spatialReference.equals(T),F=T.isGeographic?1e-9:1e-4,{datumTransformation:M}=i;if(!P&&k&&p.pixelBlocks.length===1&&x===e&&I===r&&Xi(l,_,F))return{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:p.pixelBlocks[0]};const O=g&&de(o.spatialReference)!=null&&this._hasNoneOrGCSShiftTransform,N=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");N&&!this.rasterJobHandler&&await De();const D=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_.toJSON(),datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:N},i):Ei({projectedExtent:t,srcBufferExtent:p.extent,pixelSize:_,datumTransformation:M,rasterTransform:m,hasWrapAround:s>0||O,isAdaptive:!1,includeGCSGrid:N});let J;const z=!i.requestRawData,j={rows:D.spacing[0],cols:D.spacing[1]},G=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(n,p.extent.xmin):void 0,{pixelBlocks:$,mosaicSize:X,isPartiallyFilled:te}=p;let V=null;if(this.rasterJobHandler)({pixelBlock:J,localNorthDirections:V}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:$,srcMosaicSize:X,destDimension:z?{width:e,height:r}:null,coefs:z?D.coefficients:null,sampleSpacing:z?j:null,projectDirections:N,gcsGrid:N?D.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:i.interpolation,alignmentInfo:G,blockWidths:null},i));else{const Q=Te($,X,{alignmentInfo:G});J=z?ft(Q,{width:e,height:r},D.coefficients,j,i.interpolation):Q,N&&D.gcsGrid&&(V=Si({width:e,height:r},D.gcsGrid),J=Ti(J,this.rasterInfo.dataType,V))}return i.requestRawData||N?{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:J,transformGrid:D,localNorthDirections:V,isPartiallyFilled:te}:{extent:t,srcExtent:o,srcTilePixelSize:v,pixelBlock:J}}async _fetchRawTiles(t,e,r,i){const{origin:s,blockBoundary:a}=this.rasterInfo.storageInfo,{blockWidth:n,blockHeight:l}=this.getBlockWidthHeight(t);let{x:o,y:c}=e,{width:u,height:f,wrapCount:h}=r;const m=this._getRasterTileAlignmentInfo(t,0);i.buffer&&(o-=i.buffer.cols,c-=i.buffer.rows,u+=2*i.buffer.cols,f+=2*i.buffer.rows);let y=0,g=0,p=0;h&&m!=null&&({worldColumnCountFromOrigin:g,originColumnOffset:p,rightPadding:y}=m,g*m.blockWidth-y>=o+u&&(y=0));const d=Math.floor(o/n),x=Math.floor(c/l),I=Math.floor((o+u+y-1)/n),R=Math.floor((c+f+y-1)/l),S=a[t];if(!S)return null;const{minRow:T,minCol:v,maxCol:k,maxRow:_}=S;if(h===0&&(R_||d>k))return null;const P=new Array;let F=!1;const M=this.ioConfig.allowPartialFill==null?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let G=x;G<=R;G++)for(let $=d;$<=I;$++){let X=$;if(!i.disableWrapAround&&h&&m!=null&&g<=$&&(X=$-g-p),G>=T&&X>=v&&_>=G&&k>=X){const te=this._tileFetchQueue.push({pyramidLevel:t,row:G,col:X,options:i},{signal:i.signal});M?P.push(new Promise(V=>{te.then(Q=>V(Q)).catch(()=>{F=!0,V(null)})})):P.push(te)}else P.push(Promise.resolve(null))}if(P.length===0)return null;const O=await Promise.all(P),N={height:(R-x+1)*l,width:(I-d+1)*n},{spatialReference:D}=this.rasterInfo,J=this.getPyramidPixelSize(t),{x:z,y:j}=J;return{extent:new W({xmin:s.x+d*n*z,xmax:s.x+(I+1)*n*z,ymin:s.y-(R+1)*l*j,ymax:s.y-x*l*j,spatialReference:D}),pixelBlocks:O,mosaicSize:N,isPartiallyFilled:F}}_fetchRawTile(t,e,r,i){const s=this.rasterInfo.storageInfo.blockBoundary[t];if(!s)return Promise.resolve(null);const{minRow:a,minCol:n,maxCol:l,maxRow:o}=s;if(eo||r>l)return Promise.resolve(null);const c=Ze(this.rasterId,i.sliceId),u=`${t}/${e}/${r}`;let f=et(c,i.registryId,u);if(f==null){const h=new AbortController;f=this.fetchRawTile(t,e,r,{...i,signal:h.signal}),tt(c,i.registryId,u,f,h),f.catch(()=>Ri(c,i.registryId,u))}return i.signal&&Tt(i,()=>{vi(c,i.registryId,u)}),f}_computeMagDirValues(t){const{bandCount:e,dataType:r}=this.rasterInfo;if(!(e===2&&r==="vector-magdir"||r==="vector-uv")||t?.length!==2||!t[0]?.length)return null;const i=t[0].length;if(r==="vector-magdir"){const o=t[1].map(c=>(c+360)%360);return[t[0],o]}const[s,a]=t,n=[],l=[];for(let o=0;o=16,h=o===a&&this._requireTooManySrcTiles(n,l,e,r);if(f||h||n===0||l===0){const m=new A({x:(t.xmax-t.xmin)/e,y:(t.ymax-t.ymin)/r,spatialReference:t.spatialReference});let y=Ji(m,this.rasterInfo.spatialReference,t,s.datumTransformation);const g=!y||i.srcResolution&&y.x+y.y=p){const d=2**p;y={x:i.srcResolution.x*d,y:i.srcResolution.y*d}}}y&&(s.srcResolution=y,this._updateSourceDataInfo(t,s))}return this._requireTooManySrcTiles(s.srcWidth,s.srcHeight,e,r)&&(s.srcWidth=0,s.srcHeight=0),s}_requireTooManySrcTiles(t,e,r,i){const{tileInfo:s}=this.rasterInfo.storageInfo,a=Math.ceil(t/s.size[0])*Math.ceil(e/s.size[1]),n=t/r,l=e/i,o=Math.max(1,(r+i)/1024);return a>=Yi*o||n>rt||l>rt}_updateSourceDataInfo(t,e){e.srcWidth=0,e.srcHeight=0;const{rasterInfo:r}=this,i=r.spatialReference,{srcResolution:s,datumTransformation:a}=e,{pyramidLevel:n,pyramidResolution:l,excessiveReading:o}=st(s,r,this.ioConfig.sampling);if(o)return;let c=e.srcExtent||Ie(t,i,a);if(c==null)return;const u=r.transform;u&&(c=u.inverseTransform(c)),e.srcExtent=c;const{x:f,y:h}=r.storageInfo.origin,m=Math.floor((c.xmin-f)/l.x+.1),y=Math.floor((h-c.ymax)/l.y+.1),g=Math.floor((c.xmax-f)/l.x-.1),p=Math.floor((h-c.ymin)/l.y-.1),d=c.width<.1*l.x?0:g-m+1,x=c.height<.1*l.y?0:p-y+1;e.pyramidLevel=n,e.pyramidResolution=l,e.srcWidth=d,e.srcHeight=x,e.ul={x:m,y}}_getRequestOptionsWithSliceId(t){return this.rasterInfo.multidimensionalInfo!=null&&t.sliceId==null&&(t={...t,sliceId:this.getSliceIndex(t.multidimensionalDefinition)}),t}_processIdentifyResult(t,e){const{srcLocation:r,position:i,pyramidLevel:s,useTransposedTile:a}=e,n=t.pixels[0].length/t.width/t.height;if(!(!t.mask||t.mask[i]))return{location:r,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(l==null||!a){const p=t.pixels.map(I=>I[i]),d={location:r,value:p,pyramidLevel:s},x=this._computeMagDirValues(p.map(I=>[I]));return x?.length&&(d.magdirValue=x.map(I=>I[0])),d}let o=t.pixels.map(p=>p.slice(i*n,i*n+n)),c=this._computeMagDirValues(o);const{requestSomeSlices:u,identifyOptions:f}=e;let h=ni(l,f.transposedVariableName);if(u){const p=ai(h,f.multidimensionalDefinition,f.timeExtent);o=o.map(d=>p.map(x=>d[x])),c=c?.map(d=>p.map(x=>d[x])),h=p.map(d=>h[d])}const m=t.noDataValues||this.rasterInfo.noDataValue,y={pixels:o,pixelType:t.pixelType};let g;return m!=null&&(Fi(y,m),g=y.mask),{location:r,value:null,dataSeries:h.map((p,d)=>{const x={value:g?.[d]===0?null:o.map(I=>I[d]),multidimensionalDefinition:p.multidimensionalDefinition.map(I=>new Le({...I,isSlice:!0}))};return c?.length&&(x.magdirValue=[c[0][d],c[1][d]]),x}),pyramidLevel:s}}};function Xi(t,e,r){return Math.abs(t.x-e.x)I.fetchPixels(t,e,r,i)),u=await Promise.all(c),f=u.map(I=>I.pixelBlock),h=n||i.requestRawData?u.map(I=>I.srcTilePixelSize):null;if(i.skipRasterFunction||f.every(I=>I==null))return u[0];const m=u.find(I=>I.pixelBlock!=null)?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a}):this.rasterFunction.process({extent:m,primaryPixelBlocks:f,primaryPixelSizes:h,primaryRasterIds:a});const{transformGrid:g}=u[0];if(!n||y==null||g==null){const I=i.noClip?null:this.getClippingGeometry(m.spatialReference);return i.noClip||i.requestRawData||y==null||!I||(y=await Be(y,m,I)),{...u[0],pixelBlock:y}}const p={rows:g.spacing[0],cols:g.spacing[1]};let d;this.rasterJobHandler?d=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:p,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:l,alignmentInfo:void 0,blockWidths:null},i)).pixelBlock:d=ft(y,{width:e,height:r},g.coefficients,p,l);const x=i.noClip?null:this.getClippingGeometry(t.spatialReference);return i.noClip||i.requestRawData||d==null||x==null||(d=await Be(d,t,x)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:d}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=es(t);let i=this._clippingGeometry.get(r);return i!=null||(i=t.equals(e.spatialReference)?e:Ee(e,t),this._clippingGeometry.set(r,i)),i}async _open(t){const{rasterFunction:e}=this;this.primaryRasters?.rasters?.length?e.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=e.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(c=>c.rasterJobHandler=this.rasterJobHandler));const{rasters:r,rasterIds:i}=this.primaryRasters,s=r.map(c=>c.rasterInfo?void 0:c.open(t));await Promise.all(s);const a=r.map(({rasterInfo:c})=>c),n=e.bind({rasterInfos:a,rasterIds:i});if(e.rawSourceRasterInfos=a,!n.success||a.length===0)throw new C("raster-function:open",`cannot bind the function: ${n.error??""}`);const l=e.functionName==="Table"?e:e.functionArguments?.raster;l?.functionName==="Table"&&(e.rasterInfo.attributeTable=Ge.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const o=a[0];this.hasUniqueSourceStorageInfo=a.length===1||a.slice(1).every(c=>Zi(c,o)),this.set("sourceJSON",r[0].sourceJSON),this.set("rasterInfo",e.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&t.clippingType==="inside"){const{extent:r}=this.rasterInfo,{difference:i,densify:s}=await at(async()=>{const{difference:n,densify:l}=await import("./geometryEngine-CdPoFSE4-ChEr_3ja.js");return{difference:n,densify:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);let a=s(_t.fromExtent(r),2*(r.width+r.height)/Qi);a=Ee(a,e.spatialReference),e=i(a,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};w([b({type:String,json:{write:!0}})],ie.prototype,"datasetFormat",void 0),w([b()],ie.prototype,"tileType",void 0),w([b()],ie.prototype,"rasterFunction",void 0),w([b()],ie.prototype,"primaryRasters",void 0),ie=w([K("esri.layers.support.rasterDatasets.FunctionRaster")],ie);const dt=ie;function Zi(t,e){const{storageInfo:r,pixelSize:i,spatialReference:s,extent:a}=t,{storageInfo:n,pixelSize:l,spatialReference:o,extent:c}=e;return i.x===l.x&&i.y===l.y&&s.equals(o)&&a.equals(c)&&r.blockHeight===n.blockHeight&&r.blockWidth===n.blockWidth&&r.maximumPyramidLevel===n.maximumPyramidLevel}function es(t){return String(t.wkid??t.wkt??t.wkt2)}const ts=t=>{let e=class extends t{constructor(...i){super(...i),this._isConstructedFromFunctionRaster=!1,this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=i[0]?.raster?.datasetFormat==="Function"}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(i){this._set("multidimensionalDefinition",i),this.updateRenderer()}set rasterFunction(i){i?.functionName?.toLowerCase()==="none"&&(i=void 0),this._set("rasterFunction",i),this.updateRasterFunction()}get rasterInfo(){return Dt(ne.getLogger(this),"rasterInfo",{replacement:"serviceRasterInfo",version:"4.29",warnOnce:!0}),this._get("serviceRasterInfo")}set url(i){this._set("url",ct(i,ne.getLogger(this)))}get renderer(){if(this.type!=="imagery-tile")return this.internalRenderer;const{activePresetRendererName:i,presetRenderers:s}=this;return i?s?.find(({name:a})=>a===i)?.renderer.clone():this.internalRenderer}set renderer(i){this.type==="imagery-tile"&&(this.activePresetRendererName=null),this.internalRenderer=i}set internalRenderer(i){i==null&&this.rasterFunction==null?this._configDefaultRenderer("override"):(this._set("internalRenderer",i),this.updateRenderer())}readRenderer(i,s,a){const n=s?.layerDefinition?.drawingInfo?.renderer;return Xt(n,a)||void 0}async convertVectorFieldData(i,s){const{serviceRasterInfo:a}=this;if(i==null||!a)return null;const n=this._rasterJobHandler.instance,l=a.dataType;return n?n.convertVectorFieldData({pixelBlock:i,dataType:l},s):Pi(i,l)}async computeStatisticsHistograms(i,s){await this.load(s),i=Ae(Qt,i).clone();const{serviceRasterInfo:a}=this;if(a==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:n}=i;if(n==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let l=n;const{spatialReference:o}=a;n.spatialReference.equals(o)||(await De(),l=n.type==="extent"?Ie(n,o):Ee(n,o));const c=i.pixelSize??new A({x:a.pixelSize.x,y:a.pixelSize.y,spatialReference:o}),{extent:u,width:f,height:h}=zi(a,l,c),m=await this.fetchPixels(u,f,h,{...s,interpolation:"nearest"});if(m.pixelBlock==null)throw new C("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const y=await Be(m.pixelBlock,u,l),g=this._rasterJobHandler.instance;return g?g.computeStatisticsHistograms({pixelBlock:y},s):He(y)}async createFlowMesh(i,s){const a=this._rasterJobHandler.instance;return a?a.createFlowMesh(i,s):Mi(i.meshType,i.simulationSettings,i.flowData,s.signal!=null?s.signal:new AbortController().signal)}normalizeRasterFetchOptions(i){const{multidimensionalInfo:s}=this.serviceRasterInfo??{};if(s==null)return i;let a=i.multidimensionalDefinition||this.multidimensionalDefinition;a?.length||(a=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const n=i.timeExtent||this.timeExtent;if(a!=null&&n!=null&&(n.start!=null||n.end!=null)){a=a.map(g=>g.clone());const l=s.variables.find(({name:g})=>g===a[0].variableName)?.dimensions?.find(({name:g})=>g==="StdTime"),o=a.find(({dimensionName:g})=>g==="StdTime");if(!l||!o)return{...i,multidimensionalDefinition:null};const{start:c,end:u}=n,f=c==null?null:c.getTime(),h=u==null?null:u.getTime(),m=f??h,y=h??f;if(l.values!=null){const g=l.values.filter(p=>{if(Array.isArray(p)){if(m===y)return p[0]<=m&&p[1]>=m;const d=p[0]<=m&&p[1]>m||p[0]=y,x=p[0]>=m&&p[1]<=y||p[0]y;return d||x}return m===y?p===m:p>=m&&p<=y});if(g.length){const p=g.sort((d,x)=>{const I=Array.isArray(d)?d[0]:d,R=Array.isArray(d)?d[1]:d,S=Array.isArray(x)?x[0]:x,T=Array.isArray(x)?x[1]:x;return m===y?I-S:Math.abs(R-y)-Math.abs(T-y)})[0];o.values=[p]}else a=null}else if(l.hasRegularIntervals&&l.extent){const[g,p]=l.extent;m>p||y1&&i.forEach(m=>u[m.url]=m);const f=pt(n.functionDefinition?.toJSON()??n.toJSON(),u),h=new dt({rasterFunction:f});h.rasterJobHandler=this._rasterJobHandler.instance,await h.open(),this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this.raster=h}else this.raster=s,this._cachedRasterFunctionJson=null,await s.open();if(this._cachedRendererJson=null,!a&&!n)return;const{bandIds:l}=this,{bandCount:o}=this.raster.rasterInfo,c=l?.length?l.some(u=>u>=o):o>=3;l&&(c||this.renderer&&this.renderer.type!=="raster-stretch")&&this._set("bandIds",null),this._configDefaultRenderer("auto")}async updateRenderer(){const{loaded:i,symbolizer:s}=this;if(!i||!s||!this.renderer)return;const{rasterInfo:a}=this.raster,n=Xe(a,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),l=n?.name,o=je({...this.renderer.toJSON(),variableName:l});if(JSON.stringify(this._cachedRendererJson)===JSON.stringify(o))return;const c=this._rasterJobHandler.instance;c&&(s.rasterInfo=Ue(a,l),s.rendererJSON=o,s.bind(),await c.updateSymbolizer(s),this._cachedRendererJson=o)}async applyRenderer(i,s){const a=i?.pixelBlock;if(!(a!=null&&a.pixels&&a.pixels.length>0))return null;let n;await this.updateRenderer();const l=this._rasterJobHandler.instance,o=this.bandIds??[];return n=l?await l.symbolize({...i,simpleStretchParams:s,bandIds:o}):this.symbolizer.symbolize({...i,simpleStretchParams:s,bandIds:o}),n}getTileUrl(i,s,a){return this.raster.datasetFormat==="RasterTileServer"?`${this.url}/tile/${i}/${s}/${a}`:""}getCompatibleTileInfo(i,s,a=!1){if(!this.loaded||s==null)return null;if(a&&i.equals(this.spatialReference))return this.tileInfo;const n=Et(i);return ee.create({size:256,spatialReference:i,origin:n?{x:n.origin[0],y:n.origin[1]}:{x:s.xmin,y:s.ymax}})}getCompatibleFullExtent(i){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(i)||(this._compatibleFullExtent=this.raster.computeExtent(i)),this._compatibleFullExtent):null}async fetchTile(i,s,a,n={}){if(r(this),n.requestAsImageElement){const o=this.getTileUrl(i,s,a);return ot(o,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then(c=>c.data)}const{serviceRasterInfo:l}=this;if(l.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null){const o=n.tileInfo||l.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(i,s,a,o),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),this.renderer?.type==="raster-shaded-relief"&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(i,s,a,n)}async fetchPixels(i,s,a,n={}){return this.serviceRasterInfo.multidimensionalInfo!=null&&(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition==null?{extent:i,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),s=Math.round(s),a=Math.round(a),this.raster.fetchPixels(i,s,a,n))}async identify(i,s={}){await this.load();const{raster:a,serviceRasterInfo:n}=this;if(n?.multidimensionalInfo!=null&&!(n.hasMultidimensionalTranspose&&(ht(s.multidimensionalDefinition)||s.transposedVariableName||s.timeExtent))&&(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition==null)return{location:i,value:null};const l=this.multidimensionalSubset?.areaOfInterest;if(l&&!l.contains(i))throw new C("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return a.identify(i,s)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){const i=this.serviceRasterInfo?.multidimensionalInfo;if(i==null||this.serviceRasterInfo?.dataType!=="standard-time")return!1;const s=this.multidimensionalDefinition,a=s?.[0]?.variableName;return i.variables.some(n=>n.name===a&&(!s?.[0].dimensionName||n.dimensions.some(l=>l.name==="StdTime")))}getStandardTimeValue(i){return new Date(24*(i-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(i){const s=i??this.serviceRasterInfo?.multidimensionalInfo;return li(this.multidimensionalSubset,s)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=Ke(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&this.raster.datasetFormat==="Function"&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const i=new si;return this._rasterJobHandler.connectionPromise=i.initialize().then(async()=>{r(this),this._rasterJobHandler.instance=i,this.raster.rasterJobHandler=i,this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).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(){if(this.interpolation==null){r(this);const{raster:i}=this,s=Zt(i.rasterInfo,i.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",s)}}_configDefaultRenderer(i="no"){r(this);const{rasterInfo:s}=this.raster,a=Xe(s,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=a?.name,l=ei({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&s.bandCount>1&&(this.bandIds=l?.bandIds??ti(s)),!this.renderer||i==="override"){const f=ii(this.raster),h=l?.renderer??Ye(s,{bandIds:this.bandIds,variableName:n,rasterFunctionColorRamp:f}),m=s.statistics,y=m&&m.length>0?m[0]:null,g=y?.max??0,p=y?.min??0;this.raster.datasetFormat==="WCSServer"&&h.type==="raster-stretch"&&(g>1e24||p<-1e24)&&(h.dynamicRangeAdjustment=!0,h.customStatistics=null,h.stretchType==="none"&&(h.stretchType="min-max")),this.renderer=h}const o=je({...this.renderer.toJSON(),variableName:n}),c=Ue(s,n);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=c):this.symbolizer=new bi({rendererJSON:o,rasterInfo:c});const u=this.symbolizer.bind();if(u.success){if(i==="auto"){const{colormap:f}=this.raster.rasterInfo,h=this.renderer;if(f!=null&&h.type==="raster-colormap"){const m=Ye(this.raster.rasterInfo);JSON.stringify(m)!==JSON.stringify(h)&&this._configDefaultRenderer("override")}else if(h.type==="raster-stretch"){const m=this.bandIds?.length,y=h.customStatistics?.length;!h.dynamicRangeAdjustment&&y&&m&&y!==m&&this._configDefaultRenderer("override")}}}else ne.getLogger(this).warn("imagery-tile-mixin",u.error||"The given renderer is not supported by the layer."),i==="auto"&&this._configDefaultRenderer("override")}};function r(i){if(!i.raster||!i.serviceRasterInfo)throw new C("imagery-tile","no raster")}return w([b({clonable:!1})],e.prototype,"_cachedRendererJson",void 0),w([b({clonable:!1})],e.prototype,"_cachedRasterFunctionJson",void 0),w([b({clonable:!1})],e.prototype,"_compatibleFullExtent",void 0),w([b({clonable:!1})],e.prototype,"_isConstructedFromFunctionRaster",void 0),w([b({clonable:!1})],e.prototype,"_rasterJobHandler",void 0),w([b({type:[Ft],json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.bandIds?.join(",")!=="0,1,2"}}}}})],e.prototype,"bandIds",void 0),w([b({json:{origins:{service:{read:{source:"copyrightText"}}}}})],e.prototype,"copyright",void 0),w([b({json:{read:!1}})],e.prototype,"fullExtent",null),w([b({json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.interpolation!=="bilinear"}}}}}),kt(qt)],e.prototype,"interpolation",void 0),w([b()],e.prototype,"ioConfig",void 0),w([b({type:[Le],json:{write:!0}})],e.prototype,"multidimensionalDefinition",null),w([b({type:Vt,json:{write:!0}})],e.prototype,"multidimensionalSubset",void 0),w([b()],e.prototype,"raster",void 0),w([b({type:Ne,json:{name:"renderingRule",write:!0}})],e.prototype,"rasterFunction",null),w([b({readOnly:!0})],e.prototype,"rasterInfo",null),w([b()],e.prototype,"serviceRasterInfo",void 0),w([b()],e.prototype,"sourceJSON",void 0),w([b({readOnly:!0,type:L,json:{read:!1}})],e.prototype,"spatialReference",void 0),w([b({type:ee})],e.prototype,"tileInfo",void 0),w([b(ut)],e.prototype,"url",null),w([b()],e.prototype,"renderer",null),w([b({types:jt,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const i=this.renderer?.type==="raster-stretch"&&this.renderer.stretchType==="none"&&!this.renderer.useGamma;return{enabled:!this.loaded||this.raster.tileType==="Raster"||!i}}},origins:{"web-scene":{types:Ut,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:i=>({enabled:i&&i.type!=="vector-field"&&i.type!=="flow"})}}}}})],e.prototype,"internalRenderer",null),w([Ct("internalRenderer")],e.prototype,"readRenderer",null),w([b({clonable:!1})],e.prototype,"symbolizer",void 0),e=w([K("esri.layers.mixins.ImageryTileMixin")],e),e};function yt(t){return["x","e","east","long","longitude"].includes(t.toLowerCase())}function gt(t){return["y","n","west","lat","latitude"].includes(t.toLowerCase())}function is(t){const{axes:e}=t.domain,r=Object.keys(e),i=[],s=[];let a=-1,n=-1,l=[];for(let x=0;xS.push(typeof v=="string"?new Date(v).getTime():v));const T=S[1]-S[0];i.push([S[0]-.5*T,S[S.length-1]+.5*T]),s.push(T)}else{const{start:T,stop:v,num:k}=R,_=(v-T)/(k-1);i.push([T-.5*_,v+.5*_]),s.push(_);for(let P=0;P-1&&n===-1?n=a===0?1:0:n>-1&&a===-1?a=n===0?1:0:n===-1&&a===-1&&(a=0,n=1),l=l.filter((x,I)=>!(I===a||I===n));const{referencing:o}=t.domain,c=o.find(x=>x.coordinates.includes(r[a])).system.id,u=c?.slice(c.lastIndexOf("/")+1),f=u==null||u==="CRS84"?4326:Number(u),h=new L({wkid:f}),[m,y]=i[a],[g,p]=i[n],d=new W({xmin:m,xmax:y,ymin:g,ymax:p,spatialReference:h});return{width:Math.round(d.width/s[a]),height:Math.round(d.height/s[n]),extent:d,dimensions:l}}function Fe(t){const e=At();return e?t[e]??Object.values(t)[0]:Object.values(t)[0]}function ke(){return Math.round(255*Math.random())}function ss(t){const e={},{parameters:r}=t;if(!r)return e;for(const[i,s]of Object.entries(r)){const{type:a,description:n,unit:l,categoryEncoding:o,observedProperty:c}=s;if(a==="Parameter"&&(e[i]={},n&&(e[i].description=Fe(n)),l&&(e[i].unit=l.label?Fe(l.label):null,e[i].symbol=l.symbol?.value),o)){const u=Object.entries(o).map((m,y)=>({OID:y,Value:Number(m[1]),ClassName:m[0].slice(m[0].lastIndexOf("/")+1),Count:1}));let f=!1;c?.categories?.length&&(c.categories.forEach(m=>{if(!m.id)return;const y=m.id.slice(m.id.lastIndexOf("/")+1),g=u.find(d=>d.ClassName===y);if(!g)return;const p=m.label?Fe(m.label):null;if(g.Label=p,m.preferredColor){const d=Jt.fromHex(m.preferredColor);d&&(f=!0,g.Red=d.r,g.Green=d.g,g.Blue=d.b)}}),f&&u.forEach(m=>{m.Red==null&&(m.Red=ke(),m.Green=ke(),m.Blue=ke())}));const h={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:u.map(m=>({attributes:m}))};f&&h.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),e[i].attributeTable=h}}return e}function rs(t){let e=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let i=0;ir&&(r=s))}return Ni(e,r)}function ns(t,e,r){const i=t.map((o,c)=>({name:o,count:e[c]})).sort((o,c)=>o.name>c.name?-1:1),s=(a=1,o=>a*=o.count);var a;const n=[...i.slice(1),{name:"",count:1}].reverse().map(s).reverse();let l=0;for(let o=t.length-1;o>=0;o--)l+=n[i.findIndex(({name:c})=>c===t[o])]*(r%e[o]),r=Math.floor(r/e[o]);return l}function as(t){const{width:e,height:r,extent:i,dimensions:s}=is(t),{ranges:a}=t,n=Object.keys(a).sort((h,m)=>ho[h.name]&&Object.assign(h,o[h.name]));const c=l.length?{variables:l}:void 0,u=[];for(let h=0;h2?h*d.slice(0,-2).reduce((k,_)=>k*_):0,I=p.slice(0,-2),R=d.slice(0,-2),S=g==="float"?"f32":rs(y),T=e*r,v=y.length/T;for(let k=0;kh.attributeTable)?.attributeTable;return{extent:i,pixelBlocks:u,multidimensionalInfo:c,attributeTable:f,bandNames:c?void 0:n}}let oe=class extends ae{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(t,e,r,i={}){if(!this._pixelBlockTiles){const{rasterInfo:a}=this,[n,l]=a.storageInfo.tileInfo.size,{sliceId:o}=i,{pixelBlocks:c}=this.source,u={pixelBlock:o==null?c[0]:c[o],useBilinear:a.dataType!=="thematic",tileSize:{width:n,height:l},level:t,row:e,col:r},f=this.rasterJobHandler?this.rasterJobHandler.clipTile(u,i):ki(u);return Promise.resolve(f)}const s=this._pixelBlockTiles.get(`${t}/${e}/${r}`);return Promise.resolve(s)}async _open(t){const e=this.source,{pixelBlocks:r,attributeTable:i,statistics:s,histograms:a,name:n,nativeExtent:l,transform:o}=e,c=r[0],{width:u,height:f,pixelType:h}=c,m=e.extent??new W({xmin:-.5,ymin:.5,xmax:u-.5,ymax:f-.5,spatialReference:new L({wkid:3857})}),y=e.isPseudoSpatialReference??!e.extent,g={x:m.width/u,y:m.height/f},p={...e.keyProperties};i&&(p.DataType="Thematic");const d=new ve({width:u,height:f,pixelType:h,extent:m,nativeExtent:l,attributeTable:i,transform:o,pixelSize:g,spatialReference:m.spatialReference,bandCount:c.pixels.length,keyProperties:p,multidimensionalInfo:e.multidimensionalInfo,statistics:s,isPseudoSpatialReference:y,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(d),this.createRemoteDatasetStorageInfo(d,512,512),this._set("rasterInfo",d),this.updateTileInfo(),d.multidimensionalInfo?await this._buildMDimStats(e.pixelBlocks,d.multidimensionalInfo):await this._buildInMemoryRaster(c,{width:512,height:512},t),d.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(t,e,r){const{rasterInfo:i}=this,s=i.storageInfo.maximumPyramidLevel??0,a=i.dataType!=="thematic",n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:e,maximumPyramidLevel:s,useBilinear:a},r):Promise.resolve(Ci(t,e,s,a)),l=i.statistics!=null,o=i.histograms!=null,c=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},r):Promise.resolve(hi(t)),u=await lt([n,c]);if(!u[0].value&&u[1].value)throw new C("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=u[0].value,l||(i.statistics=u[1].value?.statistics),o||(i.histograms=u[1].value?.histograms)}async _buildMDimStats(t,e,r){for(let i=0;inew Le({variableName:s.name,dimensionName:c.name,values:[c.values?.[0]??c.extent?.[0]],isSlice:!0})),n=mt(a,e),l=n==null?null:t[n];if(l==null)continue;const o=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:l},r):He(l);s.statistics=o.statistics,s.histograms||(s.histograms=o.histograms)}}};w([b({type:String,json:{write:!0}})],oe.prototype,"datasetFormat",void 0),w([b()],oe.prototype,"source",void 0),w([b()],oe.prototype,"url",null),oe=w([K("esri.layers.support.rasterDatasets.InMemoryRaster")],oe);const $e=oe;let he=class extends ae{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const{extent:e,pixelBlocks:r,multidimensionalInfo:i,attributeTable:s,bandNames:a}=await this._fetchData(t),{statistics:n,histograms:l}=He(r[0]),o=a?.map(h=>({BandName:h})),c={DataType:s?"Thematic":i?"Scientific":"Generic",BandProperties:o},u=new $e({source:{extent:e,pixelBlocks:r,attributeTable:s?Ge.fromJSON(s):null,multidimensionalInfo:i,statistics:n,histograms:l,keyProperties:c,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(t){const e=this.source??(await this.request(this.url,{signal:t?.signal})).data,r="imagery-tile-layer:open-coverage-json";if(e.type?.toLowerCase()!=="coverage"||e.domain?.domainType?.toLowerCase()!=="grid")throw new C(r,"Only coverage with Grid domain type is supported");if(!e.ranges)throw new C(r,"Missing ranges in the grid coverage data");if(!e.domain.referencing?.length)throw new C(r,"Missing domain referencing in the grid coverage data");const i=Object.values(e.ranges);for(let s=0;si.push(l));return i}const s=t.getElementsByTagNameNS("*",r);if(!s||s.length===0)return[];for(let a=0;a0?e?q(i[0],e):i[0]:null}function Y(t,e=null){const r=e?q(t,e):t;let i;return r?(i=r.textContent||r.nodeValue,i?i.trim():null):null}function ls(t,e){const r=ue(t,e),i=[];let s;for(let a=0;aNumber(r))}function re(t,e){const r=Y(t,e);return Number(r)}function Ce(t,e){const r=t?.nodeName?.toLowerCase(),i=e.toLowerCase();return r.slice(r.lastIndexOf(":")+1)===i}function nt(t,e){if(!t||!e)return null;const r=[];for(let i=0;iNumber(h));let l,o,c,u;ue(t,"Metadata/MDI").forEach(h=>{const m=Number(h.textContent??h.nodeValue);switch(h.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":l=m;break;case"STATISTICS_MAXIMUM":o=m;break;case"STATISTICS_MEAN":c=m;break;case"STATISTICS_STDDEV":u=m}});const f=re(t,"Metadata/SourceBandIndex");return{noDataValue:e,histogram:n?.length&&i!=null&&s!=null?{min:i,max:s,size:a||n.length,counts:n}:null,sourceBandIndex:f,statistics:l!=null&&o!=null?{min:l,max:o,avg:c,stddev:u}:null}}function Se(t){if(!t)return null;let e=Number(t);if(!isNaN(e)&&e!==0)return new L({wkid:e});if(t=String(t).trim(),Bt(t))return new L({wkt2:t});const r=t.toUpperCase();if(r.startsWith("COMPD_CS")){if(!r.includes("VERTCS")||!r.includes("GEOGCS")&&!r.startsWith("PROJCS"))return null;const i=r.indexOf("VERTCS"),s=r.indexOf("PROJCS"),a=s>-1?s:r.indexOf("GEOGCS");if(a===-1)return null;const n=t.slice(a,t.lastIndexOf("]",i)+1).trim(),l=t.slice(i,t.lastIndexOf("]")).trim();e=Oe(n);const o=new L(e?{wkid:e}:{wkt:n}),c=Oe(l);return c&&(o.vcsWkid=c),o}return r.startsWith("GEOGCS")||r.startsWith("PROJCS")?(e=Oe(t),new L(e!==0?{wkid:e}:{wkt:t})):null}function Oe(t){const e=t.replaceAll("]","[").replaceAll('"',"").split("[").map(s=>s.trim()).filter(s=>s!==""),r=e[e.length-1].split(","),i=r[0]?.toLowerCase();if((i==="epsg"||i==="esri")&&t.endsWith('"]]')){const s=Number(r[1]);if(!isNaN(s)&&s!==0)return s}return 0}function qe(t){if(t?.documentElement.tagName?.toLowerCase()!=="pamdataset")return{};const e={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};t.documentElement.childNodes.forEach(i=>{if(i.nodeType===1){if(Ce(i,"SRS")){if(!e.spatialReference){const s=Y(i);e.spatialReference=Se(s)}}else if(Ce(i,"Metadata"))if(i.getAttribute("domain")==="xml:ESRI"){const{spatialReference:s,transform:a}=cs(i);e.transform=a,e.spatialReference||(e.spatialReference=s)}else ue(i,"MDI").forEach(s=>e.metadata[s.getAttribute("key")]=Y(s));else if(Ce(i,"PAMRasterBand")){const s=us(i);s.sourceBandIndex!=null&&e.rasterBands[s.sourceBandIndex]==null?e.rasterBands[s.sourceBandIndex]=s:e.rasterBands.push(s)}}});const r=e.rasterBands;if(r.length){const i=!!r[0].statistics;e.statistics=i?r.map(a=>a.statistics).filter(Me):null;const s=!!r[0].histogram;e.histograms=s?r.map(a=>a.histogram).filter(Me):null}return e}let be=class extends ae{fetchRawTile(t,e,r,i={}){return this._inMemoryRaster.fetchRawTile(t,e,r,i)}async _open(t){const e=await this._fetchData(t);let{spatialReference:r,statistics:i,histograms:s,transform:a}=await this._fetchAuxiliaryData(t);const n=!r;n&&(r=new L({wkid:3857})),s?.length&&i==null&&(i=ze(s));const{width:l,height:o}=e;let c=new W({xmin:-.5,ymin:.5-o,xmax:l-.5,ymax:.5,spatialReference:r});const u=a?a.forwardTransform(c):c;let f=!0;if(a){const m=a.forwardCoefficients;f=m&&m[1]===0&&m[2]===0,f&&(a=null,c=u)}const h=new $e({source:{extent:u,nativeExtent:c,transform:a,pixelBlocks:[e],statistics:i,histograms:s,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:n},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(h.ioConfig.skipMapInfo=!0),await h.open(),h.source=null,this._set("rasterInfo",h.rasterInfo),this._inMemoryRaster=h}async _fetchData(t){const{data:e}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),r=mi(e).toUpperCase();if(r!=="JPG"&&r!=="PNG"&&r!=="GIF"&&r!=="BMP")throw new C("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r);const i=r.toLowerCase(),s=i==="gif"||i==="bmp"||!Ot("ios"),a=await this.decodePixelBlock(e,{format:i,useCanvas:s,hasNoZlibMask:!0});if(a==null)throw new C("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(t){const e=t?.signal,{skipExtensions:r=[],skipMapInfo:i}=this.ioConfig,s=i||r.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),a=this.datasetFormat,n=a==="JPG"?"jgw":a==="PNG"?"pgw":a==="BMP"?"bpw":null,l=n&&r.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:e}),o=await lt([s,l]);if(e?.aborted)throw Pt();const c=qe(o[0].value?.data);if(!c.transform){const u=o[1].value?o[1].value.data.split(` +`).slice(0,6).map(f=>Number(f)):null;c.transform=u?.length===6?new We({forwardCoefficients:[u[4],u[5],u[0],-u[1],u[2],-u[3]]}):null}return c}};w([b({type:String,json:{write:!0}})],be.prototype,"datasetFormat",void 0),be=w([K("esri.layers.support.rasterDatasets.ImageAuxRaster")],be);const xe=be;let me=class extends ae{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(t,e,r,i={}){const{storageInfo:s,extent:a}=this.rasterInfo,{transposeInfo:n}=s,l=n!=null&&!!i.transposedVariableName;if(this._slices&&!l&&i.sliceId==null)return null;const o=l?0:s.maximumPyramidLevel-t+this._levelOffset,c=`${this.url}/tile/${o}/${e}/${r}`,u=this._slices?l?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,{data:f}=await this.request(c,{query:u,responseType:"array-buffer",signal:i.signal});if(!f)return null;const h=l?n.tileSize:s.tileInfo.size,m=await this.decodePixelBlock(f,{width:h[0],height:h[1],planes:null,pixelType:null,isPoint:this.tileType==="Elevation",returnInterleaved:l,noDataValue:this.rasterInfo.noDataValue});if(m==null)return null;const y=s.blockBoundary[t];if(s.compression!=="jpg"||r>y.minCol&&ry.minRow&&e{const a=e.find(n=>s.variableName===n.variableName&&n.dimensionName===s.dimensionName);return a?(Array.isArray(s.values[0])?`${s.values[0][0]}-${s.values[0][1]}`:s.values[0])!==(Array.isArray(a.values[0])?`${a.values[0][0]}-${a.values[0][1]}`:a.values[0]):!0}))return r}return null}async fetchVariableStatisticsHistograms(t,e){const r=this.request(this.url+"/statistics",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.statistics),i=this.request(this.url+"/histograms",{query:{variable:t,f:"json"},signal:e}).then(a=>a.data?.histograms),s=await Promise.all([r,i]);return s[0]&&s[0].forEach(a=>{a.avg=a.mean,a.stddev=a.standardDeviation}),s[1]?.[0]?.counts?.length||(s[1]=null),{statistics:s[0]||null,histograms:s[1]||null}}async computeBestPyramidLevelForLocation(t,e={}){if(!this._tilemapCache)return 0;let r=this.identifyPixelLocation(t,0,e.datumTransformation);if(r===null)return null;let i=0;const{maximumPyramidLevel:s}=this.rasterInfo.storageInfo;let a=s-i+this._levelOffset;const n=r.srcLocation;for(;a>=0;){try{if(await this._tilemapCache.fetchAvailability(a,r.row,r.col,e)==="available")break}catch{}if(a--,i++,r=this.identifyPixelLocation(n,i,e.datumTransformation),r===null)return null}return a===-1||r==null?null:i}async _open(t){const e=t?.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:e});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const i=r.data;if(this.sourceJSON=i,!i)throw new C("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!i.tileInfo)throw new C("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const s=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=i.cacheType,this.tileType==null&&(s.includes(i.tileInfo.format.toLowerCase())?this.tileType="Map":i.tileInfo.format.toLowerCase()==="lerc"?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=i.name?.slice(i.name.indexOf("/")+1)??"";const a=await this._fetchRasterInfo({signal:e});if(a==null)throw new C("image-server-raster:open","cannot initialize image service");Yt(a,i);const n=this.tileType==="Map"?hs(i.tileInfo,i):ee.fromJSON(i.tileInfo);Mt(n);const[l,o]=this._computeMinMaxLOD(a,n),{extent:c,pixelSize:u}=a,f=.5/a.width*u.x,h=Math.max(u.x,u.y),{lods:m}=n;(this.tileType!=="Map"&&i.maxScale!==0||Math.abs(u.x-u.y)>f||!m.some(v=>Math.abs(v.resolution-h){v.level>=o.level&&v.level<=l.level&&d.push({x:v.resolution,y:v.resolution}),kv.x-k.x);const I=this.computeBlockBoundary(c,g,p,n.origin,d,y),R=d.length>1?d.slice(1):null;let S;i.transposeInfo&&(S={tileSize:[i.transposeInfo.rows,i.transposeInfo.cols],packetSize:a.keyProperties?._yxs.PacketSize??0});const T=x.length<=1||x.length>=3&&x.slice(0,-1).every(v=>v===x[0])?x[0]??2:Math.round(10/(o.resolution/l.resolution)**(-1/y))/10;if(a.storageInfo=new Re({blockWidth:n.size[0],blockHeight:n.size[1],pyramidBlockWidth:n.size[0],pyramidBlockHeight:n.size[1],pyramidResolutions:R,pyramidScalingFactor:T,compression:n.format,origin:n.origin,firstPyramidLevel:1,maximumPyramidLevel:y,tileInfo:n,transposeInfo:S,blockBoundary:I}),ms(a),this._set("rasterInfo",a),i.capabilities.toLowerCase().includes("tilemap")){const v={tileInfo:a.storageInfo.tileInfo,parsedUrl:Nt(this.url),url:this.url,tileServers:[]};this._tilemapCache=new ji({layer:v})}}async _fetchRasterInfo(t){const e=this.sourceJSON;if(this.tileType==="Map"){const n=e.fullExtent||e.extent,l=Math.ceil((n.xmax-n.xmin)/e.pixelSizeX-.1),o=Math.ceil((n.ymax-n.ymin)/e.pixelSizeY-.1),c=L.fromJSON(e.spatialReference||n.spatialReference),u=new A({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:c});return new ve({width:l,height:o,bandCount:3,extent:W.fromJSON(n),spatialReference:c,pixelSize:u,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:r}=t,i=Kt(this.url,this.sourceJSON,{signal:r,query:this.ioConfig.customFetchParameters}),s=e.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:r}).then(n=>n.data?.slices).catch(()=>null):null,a=await Promise.all([i,s]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:t}=this;t.minScale&&t.minScale<0&&(t.minScale=0),t.maxScale&&t.maxScale<0&&(t.maxScale=0)}_computeMinMaxLOD(t,e){const{pixelSize:r}=t,i=.5/t.width*r.x,{lods:s}=e,a=e.lodAt(Math.max.apply(null,s.map(h=>h.level))),n=e.lodAt(Math.min.apply(null,s.map(h=>h.level))),{tileType:l}=this;if(l==="Map")return this._levelOffset=s[0].level,[a,n];if(l==="Raster")return[s.find(h=>h.resolution===r.x)??a,n];const{minScale:o,maxScale:c}=this.sourceJSON;let u=a;c>0&&(u=s.find(h=>Math.abs(h.scale-c)h.scale>c).sort((h,m)=>h.scale>m.scale?1:-1)[0]??a));let f=n;return o>0&&(f=s.find(h=>Math.abs(h.scale-o)n!=null&&n>=s&&n<=a)});if(r!==0&&i!==0){const n=c=>Math.round(1e4*c)/1e4,l=r?n(r):1/0,o=i?n(i):-1/0;return ee.fromJSON({...t,lods:t.lods.filter(c=>{const u=n(c.scale);return u<=l&&u>=o})})}return ee.fromJSON(t)}function ms(t){const{extent:e,spatialReference:r}=t;e.xmin>-1&&e.xmax>181&&r?.wkid&&r.isGeographic&&(t.nativeExtent=t.extent,t.transform=new Hi,t.extent=t.transform.forwardTransform(e))}w([b({type:String,json:{write:!0}})],me.prototype,"datasetFormat",void 0),w([b()],me.prototype,"tileType",void 0),me=w([K("esri.layers.support.rasterDatasets.ImageServerRaster")],me);const fs=me,U=new Map;U.set("Int8","s8"),U.set("UInt8","u8"),U.set("Int16","s16"),U.set("UInt16","u16"),U.set("Int32","s32"),U.set("UInt32","u32"),U.set("Float32","f32"),U.set("Float64","f32"),U.set("Double64","f32");const Z=new Map;Z.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Z.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Z.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Z.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let le=class extends ae{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(t,e,r,i={}){const{blockWidth:s,blockHeight:a,blockBoundary:n}=this.rasterInfo.storageInfo,l=n[t];if(!l||l.maxRowe||l.minCol>r)return null;const{bandCount:o,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:f,actualTileHeight:h}=this._getTileLocation(t,e,r);if(!u||u.length===0)return null;if(u[0].from===0&&u[0].to===0){const F=new Uint8Array(s*a);return new we({width:s,height:a,pixels:void 0,mask:F,validPixelCount:0})}const{bandIds:m}=this.ioConfig,y=this._getBandSegmentCount(),g=[];let p=0;for(p=0;pF.data.byteLength).reduce((F,M)=>F+M),I=new Uint8Array(x),R=[];let S=0;for(p=0;p1e24)for(p=0;p1e-6&&(M[p]=1);else for(p=0;p0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}_getBandSegmentCount(){return Z.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,r){const{blockWidth:i,blockHeight:s,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:n,height:l}=this.rasterInfo,o=this._getBandSegmentCount();let c,u,f,h=0,m=0;for(f=0;fparseFloat(F)))),q(t,"MRF_META/CachedSource"))throw new C("mrf:open","currently does not support MRF referencing other data files");const g=q(t,"MRF_META/GeoTags"),p=q(g,"BoundingBox");let d,x=!1;if(p!=null){const F=parseFloat(p.getAttribute("minx")),M=parseFloat(p.getAttribute("miny")),O=parseFloat(p.getAttribute("maxx")),N=parseFloat(p.getAttribute("maxy")),D=Y(g,"Projection")||"";let J=L.WGS84;if(D!=="LOCAL_CS[]")if(D.toLowerCase().startsWith("epsg:")){const z=Number(D.slice(5));isNaN(z)||z===0||(J=new L({wkid:z}))}else J=Se(D)??L.WGS84;else x=!0,J=new L({wkid:3857});d=new W(F,M,O,N),d.spatialReference=J}else x=!0,d=new W({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:new L({wkid:3857})});const I=q(t,"MRF_META/Rsets"),R=parseInt(I?.getAttribute("scale")||"2",10),S=d.spatialReference,T=new Re({origin:new A({x:d.xmin,y:d.ymax,spatialReference:S}),blockWidth:u,blockHeight:f,pyramidBlockWidth:u,pyramidBlockHeight:f,compression:n,pyramidScalingFactor:R}),v=new A({x:d.width/i,y:d.height/s,spatialReference:S}),k=new ve({width:i,height:s,extent:d,isPseudoSpatialReference:x,spatialReference:S,bandCount:a,pixelType:o,pixelSize:v,noDataValue:m,storageInfo:T}),_=Y(t,"datafile"),P=Y(t,"IndexFile");return{rasterInfo:k,files:{mrf:this.url,index:P||this.url.replace(".mrf",".idx"),data:_||this.url.replace(".mrf",Z.get(n).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return qe(e)}catch{return null}}};function ps(t){if(t.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let e,r,i,s,a,n;if(fi){for(r=new Uint8Array(t),s=new ArrayBuffer(t.byteLength),i=new Uint8Array(s),a=0;ac.name.toLowerCase()==="oid")?"OBJECTID":"OID",s=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(e.map(c=>({name:c.name,type:"esriFieldType"+c.typeName,alias:c.name}))),a=s.map(c=>c.name),n=[];let l=0,o=0;return r.forEach(c=>{const u={};for(u[i]=l++,o=1;o0)for(;u.lengthn;){const h=[];r.getUint8(o)===32?(o+=1,c.forEach(m=>{if(m.type==="C")h.push(Qe(new Uint8Array(e,o,m.length)).trim());else if(m.type==="N")h.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim(),10));else if(m.type==="F")h.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim()));else if(m.type==="D"){const y=String.fromCharCode.apply(null,new Uint8Array(e,o,m.length)).trim();h.push(new Date(parseInt(y.slice(0,4),10),parseInt(y.slice(4,6),10)-1,parseInt(y.slice(6,8),10)))}o+=m.length}),u.push(h)):o+=n}}return{header:l,fields:c,records:u,recordSet:ys({fields:c,records:u})}}}const Je=(t,e)=>t.get(e)?.values,fe=(t,e)=>t.get(e)?.values?.[0];let se=class extends ae{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async fetchRawTile(t,e,r,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(t,e,r))return null;const s=await this._fetchRawTiffTile(t,e,r,!1,i);if(s!=null&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(t,e,r,!0,i);a!=null&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}async _open(t){const e=t?t.signal:null,{data:r}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:e});if(!r)throw new C("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:i,firstIFDPos:s,isBigTiff:a}=pi(r),n=[];await this._readIFDs(n,r,i,s,0,a?8:4,e);const{imageInfo:l,rasterInfo:o}=xs(n),c=di(n),u=yi(n);if(this._headerInfo={littleEndian:i,isBigTiff:a,ifds:n,pyramidIFDs:c,maskIFDs:u,...l},this._set("rasterInfo",o),!l.isSupported)throw new C("tiffraster:open","this tiff is not supported: "+l.message);if(!l.tileWidth)throw new C("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");o.isPseudoSpatialReference&&ne.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const f=n[0].get("PREDICTOR")?.values?.[0];if(n[0].get("SAMPLEFORMAT")?.values?.[0]===3&&f===2)throw new C("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:h,skipExtensions:m=[]}=this.ioConfig;if(!m.includes("aux.xml")&&!h){const y=await this._fetchAuxiliaryMetaData(t);y!=null&&ws(y,o)}m.includes("vat.dbf")||o.bandCount!==1||o.pixelType!=="u8"||h||(o.attributeTable=await this._fetchAuxiliaryTable(t),o.attributeTable!=null&&(o.keyProperties.DataType="thematic")),h&&this.updateImageSpaceRasterInfo(o),this.updateTileInfo()}async _readIFDs(t,e,r,i,s,a=4,n){if(!i)return null;(i>=e.byteLength||i<0)&&(e=(await this.request(this.url,{range:{from:i+s,to:i+s+this._bufferSize},responseType:"array-buffer",signal:n})).data,s=i+s,i=0);const l=await this._readIFD(e,r,i,s,pe.tiffTags,a,n);if(t.push(l.ifd),!l.nextIFD)return null;await this._readIFDs(t,e,r,l.nextIFD-s,s,a,n)}async _readIFD(t,e,r,i,s=pe.tiffTags,a=4,n){if(!t)return null;const l=gi(t,e,r,i,s,a);if(l.success){const o=[];if(l.ifd?.forEach(c=>{c.values||o.push(c)}),o.length>0){const c=o.map(f=>f.offlineOffsetSize).filter(Me),u=Math.min.apply(null,c.map(f=>f[0]));if(Math.min.apply(null,c.map(f=>f[0]+f[1]))-u<=this._bufferSize){const{data:f}=await this.request(this.url,{range:{from:u,to:u+this._bufferSize},responseType:"array-buffer",signal:n});t=f,i=u,o.forEach(h=>xi(t,e,h,i))}}if(l.ifd?.has("GEOKEYDIRECTORY")){const c=l.ifd.get("GEOKEYDIRECTORY"),u=c?.values;if(u&&u.length>4){const f=u[0]+"."+u[1]+"."+u[2],h=await this._readIFD(t,e,c.valueOffset+6-i,i,pe.geoKeys,2,n);c.data=h.ifd,c.data&&c.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[f]})}}return l}if(l.requiredBufferSize&&l.requiredBufferSize!==t.byteLength)return(t=(await this.request(this.url,{range:{from:i,to:i+l.requiredBufferSize+4},responseType:"array-buffer",signal:n})).data).byteLengththis.request(this.url,{range:T,responseType:"array-buffer",signal:s.signal})),f=await Promise.all(u),h=f.map(T=>T.data.byteLength).reduce((T,v)=>T+v),m=f.length===1?f[0].data:new ArrayBuffer(h),y=[0],g=[0];if(f.length>1){const T=new Uint8Array(m);for(let v=0,k=0;vy||r>g||e3&&F.length%3==0){_=[];const O=F.length/3;for(let N=0;N>>8,F[N+O]>>>8,F[N+2*O]>>>8])}const M=new ve({width:r,height:i,bandCount:n,pixelType:l,pixelSize:v,storageInfo:T,spatialReference:x,isPseudoSpatialReference:I,keyProperties:k,extent:R,colormap:_,statistics:p?p.statistics:null});if(g?.length&&(M.nativeExtent=new W({xmin:-.5,ymin:.5-i,xmax:r-.5,ymax:.5,spatialReference:x}),M.transform=new We({polynomialOrder:1,forwardCoefficients:[g[2]+g[0]/2,g[5]-g[3]/2,g[0],g[3],-g[1],-g[4]]}),M.extent=M.transform.forwardTransform(M.nativeExtent),M.pixelSize=new A({x:(R.xmax-R.xmin)/r,y:(R.ymax-R.ymin)/i,spatialReference:x}),T.origin.x=-.5,T.origin.y=.5),m){const{x:O,y:N}=M.pixelSize;m.forEach(D=>{D.x*=O,D.y*=N})}return{imageInfo:e,rasterInfo:M}}function ws(t,e){if(e.statistics=t.statistics??e.statistics,e.histograms=t.histograms,t.histograms&&e.statistics==null&&(e.statistics=ze(t.histograms)),t.transform&&e.transform==null){e.transform=t.transform,e.nativeExtent=e.extent;const r=e.transform.forwardTransform(e.nativeExtent);e.pixelSize=new A({x:(r.xmax-r.xmin)/e.width,y:(r.ymax-r.ymin)/e.height,spatialReference:e.spatialReference}),e.extent=r}e.isPseudoSpatialReference&&t.spatialReference&&(e.spatialReference=t.spatialReference,e.extent.spatialReference=e.nativeExtent.spatialReference=e.storageInfo.origin.spatialReference=e.spatialReference)}w([b()],se.prototype,"_files",void 0),w([b()],se.prototype,"_headerInfo",void 0),w([b()],se.prototype,"_bufferSize",void 0),w([b({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),se=w([K("esri.layers.support.rasterDatasets.TIFFRaster")],se);const Is=se,H=new Map;H.set("MRF",{desc:"Meta Raster Format",constructor:ds}),H.set("TIFF",{desc:"GeoTIFF",constructor:Is}),H.set("RasterTileServer",{desc:"Raster Tile Server",constructor:fs}),H.set("JPG",{desc:"JPG Raster Format",constructor:xe}),H.set("PNG",{desc:"PNG Raster Format",constructor:xe}),H.set("GIF",{desc:"GIF Raster Format",constructor:xe}),H.set("BMP",{desc:"BMP Raster Format",constructor:xe}),H.set("CovJSON",{desc:"COVJSON Raster Format",constructor:os}),H.set("MEMORY",{desc:"In Memory Raster Format",constructor:$e});class Pe{static get supportedFormats(){const e=new Set;return H.forEach((r,i)=>e.add(i)),e}static async open(e){const{url:r,ioConfig:i,source:s,sourceJSON:a}=e;let n=e.datasetFormat??i?.datasetFormat;n==null&&(r.includes(".")?n=r.slice(r.lastIndexOf(".")+1).toUpperCase():s?.type?.toLowerCase()==="coverage"?n="CovJSON":s?.extent&&s.pixelblocks&&(n="MEMORY")),n==="OVR"||n==="TIF"?n="TIFF":n==="JPG"||n==="JPEG"||n==="JFIF"?n="JPG":n==="COVJSON"&&(n="CovJSON"),r.toLowerCase().includes("/imageserver")&&!r.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const l={url:r,source:s,sourceJSON:a,datasetFormat:n,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(l).forEach(f=>{l[f]==null&&delete l[f]}),n){if(!this.supportedFormats.has(n))throw new C("rasterfactory:open","not a supported format "+n);if(n==="CRF")throw new C("rasterfactory:open",`cannot open raster: ${r}`);const f=new(H.get(n)).constructor(l);return await f.open({signal:e.signal}),f}const o=Array.from(H.keys()).filter(f=>f!=="CovJSON"&&f!=="Memory");let c=0;const u=()=>{if(n=o[c++],!n||n==="CRF")return null;const f=new(H.get(n)).constructor(l);return f.open({signal:e.signal}).then(()=>f).catch(()=>u())};return u()}static register(e,r,i){H.has(e.toUpperCase())||H.set(e.toUpperCase(),{desc:r,constructor:i})}}let E=class extends Wt(qi(Wi(Gi($t(Gt(ts(Vi(zt($i(Lt(wt(Ht)))))))))))){constructor(...t){super(...t),this._primaryRasters=[],this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this.source=void 0,this._debouncedSaveOperations=It(async(e,r,i)=>{const{save:s,saveAs:a}=await at(()=>import("./imageryUtils-6MVSqijr-2ufISwt4.js"),__vite__mapDeps([8,9,1,2,3,4,10,11,12,13,14,15,16,17]),import.meta.url);switch(e){case ye.SAVE:return s(this,r);case ye.SAVE_AS:return a(this,i,r)}})}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},t).catch(bt).then(()=>this._openRaster(e))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const t=[new ce({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"}),new ce({name:"Raster.ServicePixelValue.Raw",alias:"Raw Pixel Value",domain:null,editable:!1,length:50,type:"string"})],e=this.raster?.rasterInfo??this.serviceRasterInfo,r=e?.attributeTable,i=r!=null?r.fields:null,s="Raster.";if(i){const l=i.filter(o=>o.type!=="oid"&&o.name.toLowerCase()!=="value").map(o=>{const c=o.clone();return c.name=s+o.name,c});t.push(...l)}const a=e?.dataType,n=e?.multidimensionalInfo;if((a==="vector-magdir"||a==="vector-uv")&&n!=null){const l=n.variables[0].unit?.trim(),o="Magnitude"+(l?` (${l})`:"");t.push(new ce({name:"Raster.Magnitude",alias:o,domain:null,editable:!1,type:"double"})),t.push(new ce({name:"Raster.Direction",alias:"Direction (°)",domain:null,editable:!1,type:"double"}))}return t}createPopupTemplate(t){const{rasterFields:e}=this,r=t?.visibleFieldNames??new Set(e.map(({name:a})=>a).filter(a=>a.toLowerCase()!=="raster.servicepixelvalue.raw")),i=Ui({fields:e,title:this.title},{...t,visibleFieldNames:r}),{rasterInfo:s}=this.raster;return i?.fieldInfos&&s?.pixelType.startsWith("f")&&i.fieldInfos.forEach(({format:a,fieldName:n})=>{a&&n&&/^raster\.(item|service)pixelvalue/i.test(n)&&(a.places=2)}),i}async generateRasterInfo(t,e){if(t=Ae(Ne,t),await this.load(),!t||t.functionName?.toLowerCase()==="none")return this.serviceRasterInfo;try{const{rasterInfo:r}=await this._openFunctionRaster(t,e);return r}catch(r){throw r instanceof C?r:new C("imagery-tile-layer","the given raster function is not supported")}}async save(t){return this._debouncedSaveOperations(ye.SAVE,t)}async saveAs(t,e){return this._debouncedSaveOperations(ye.SAVE_AS,e,t)}write(t,e){const r=this._primaryRasters[0]??this.raster;if(this.loaded?r.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(t,e);if(e?.messages){const i=`${e.origin}/${e.layerContainerType||"operational-layers"}`;e.messages.push(new C("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(t){let e=!1;if(this.raster)await this._openFromRaster(this.raster,t),e=this.raster.datasetFormat==="Function",!e&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:i,rasterFunction:s,source:a}=this;if(!i&&!a)throw new C("imagery-tile-layer:open","missing url or source parameter");a?await this._openFromSource(a,t):s?await this._openFromUrlWithRasterFunction(i,s,t):await this._openFromUrl(i,t)}const r=this.raster.rasterInfo;if(!r)throw new C("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",e?r:this._primaryRasters[0].rasterInfo),this._set("spatialReference",r.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){const i=this.raster.tileType==="Map"&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(i,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),this.raster.tileType==="Map"&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(Rt(()=>this.customParameters,i=>{this.raster&&(this.raster.ioConfig.customFetchParameters=i)}))}async _openFromRaster(t,e){t.rasterInfo||await t.open({signal:e}),this._primaryRasters=t.datasetFormat==="Function"?t.primaryRasters.rasters:[t],this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(t,e,r){const i=[t];e&&Li(e.toJSON(),i);const s=await Promise.all(i.map(n=>Pe.open({url:n,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:r}))),a=s.findIndex(n=>n==null);if(a>-1)throw new C("imagery-tile-layer:open",`cannot open raster: ${i[a]}`);return this._primaryRasters=s,this._initializeWithFunctionRaster(e)}async _openFromUrl(t,e){const r=await Pe.open({url:t,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(r==null)throw new C("imagery-tile-layer:open",`cannot open raster: ${t}`);this._primaryRasters=[r],this.raster=r}async _openFromSource(t,e){const r="the tiled imagery data source is not supported",i=t.type?.toLowerCase()==="coverage"?"CovJSON":t.extent&&t.pixelBlock?"MEMORY":null;if(!i)throw new C("imagery-tile-layer:open",r);i==="MEMORY"&&(t={...t,pixelBlock:void 0,pixelBlocks:[t.pixelBlock]});const s=await Pe.open({url:"",source:t,datasetFormat:i,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(s==null)throw new C("imagery-tile-layer:open",r);this._primaryRasters=[s],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=s}async _openFunctionRaster(t,e){const r={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(a=>r[a.url]=a);const i=pt(t.functionDefinition?.toJSON()??t.toJSON(),r),s=new dt({rasterFunction:i});return await s.open(e),s}async _initializeWithFunctionRaster(t,e){try{this.raster=await this._openFunctionRaster(t,e)}catch(r){r instanceof C&&ne.getLogger(this).error("imagery-tile-layer:open",r.message),ne.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}};w([b({clonable:!1})],E.prototype,"_primaryRasters",void 0),w([b(ri)],E.prototype,"legendEnabled",void 0),w([b({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],E.prototype,"isReference",void 0),w([b({type:["show","hide"]})],E.prototype,"listMode",void 0),w([b({json:{read:!0,write:!0}})],E.prototype,"blendMode",void 0),w([b()],E.prototype,"sourceJSON",void 0),w([b({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],E.prototype,"version",void 0),w([b({readOnly:!0,json:{read:!1}})],E.prototype,"type",void 0),w([b({type:["ArcGISTiledImageServiceLayer"]})],E.prototype,"operationalLayerType",void 0),w([b({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(t,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}},writer(t,e,r){e[r]=!t}}}})],E.prototype,"popupEnabled",void 0),w([b({type:vt,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}}}}})],E.prototype,"popupTemplate",void 0),w([b({readOnly:!0})],E.prototype,"defaultPopupTemplate",null),w([b({readOnly:!0,type:[ce]})],E.prototype,"fields",void 0),w([b({readOnly:!0,type:[ce]})],E.prototype,"rasterFields",null),w([b({constructOnly:!0})],E.prototype,"source",void 0),E=w([K("esri.layers.ImageryTileLayer")],E);const Br=E;export{Br as default}; diff --git a/custom-toc-highlight/assets/ImageryTileLayerView2D-nEz2YhMc-CG0NmUYm.js b/custom-toc-highlight/assets/ImageryTileLayerView2D-nEz2YhMc-DxH8Z9x7.js similarity index 94% rename from custom-toc-highlight/assets/ImageryTileLayerView2D-nEz2YhMc-CG0NmUYm.js rename to custom-toc-highlight/assets/ImageryTileLayerView2D-nEz2YhMc-DxH8Z9x7.js index 1d2dc42c..07ed36b5 100644 --- a/custom-toc-highlight/assets/ImageryTileLayerView2D-nEz2YhMc-CG0NmUYm.js +++ b/custom-toc-highlight/assets/ImageryTileLayerView2D-nEz2YhMc-DxH8Z9x7.js @@ -1 +1 @@ -import{v as h,S as p,i as M,ah as L,aU as R,a1 as I,av as ge,aL as _e,j as ye,bp as xe,n as be,O as we,w as ve,bh as ne,o as Te,bi as Pe,hT as F}from"./story-BfX8CRfG.js";import{p as Z}from"./multidimensionalUtils-BwTugeu7-BTG9Of02.js";import{o as Se,l as Ue,c as Re}from"./RasterVFDisplayObject-CnriTVT9-CjUrEqNq.js";import{X as Ie,A as Fe,Y as Ce}from"./LayerView-Bish-E63-rB2WUWF4.js";import{t as oe,E as k,m as ze,e as z}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{Q as Me,E as le,R as Ve,C as E,D as Be,H as Ge}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as B}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as Le}from"./Container-BcuL1ZEG-DxXVQv25.js";import{A as G,L as J,M as A,B as Oe,F as ke,G as De}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{N as U,k as w,w as q,G as Ee,x as Ae,U as j,b as je,V as qe,M as We,L as Ne,F as $e}from"./rasterUtils-DqAu9qES-Du-esSHL.js";import{s as Y}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{H as Qe,V as He}from"./Texture-BCt2hphT-hC4XzHg_.js";import{t as C}from"./definitions-DJSdSb77-DkoRHaVx.js";import{k as Ze,F as K,K as ue}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{G as Je}from"./Program-DLVwTiPA-C1hIaFuM.js";import{h as ce}from"./TileContainer-D48pXXgL-CdMiwPkS.js";import{i as Ye}from"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import{D as Ke,B as Xe}from"./dataUtils-BkPy4R3C-Cb9EIxnj.js";import{V as X}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import{Z as ee,P as te,K as et,O as tt}from"./RawBlockCache-Cj_tmHDm-CHpXSnmO.js";import{k as rt,U as st,p as it,r as re}from"./rasterProjectionHelper-Calp0o_1-DktPwJyi.js";import{a as se,Q as at,$ as nt}from"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import{i as ot}from"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import{n as lt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{T as ut}from"./timeSupport-ohWmWReZ-ByDHlqgT.js";import{m as ct}from"./popupUtils-nV1O8RUO-DAL58cHP.js";import{n as ht}from"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";import"./main-ugzBrWNm.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";const dt={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 mt extends Le{constructor(e=null,r=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!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=r,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){this._rasterTexture!==e&&(this._rasterTexture?.dispose(),this._rasterTexture=e),e==null&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(F(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||dt}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}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.commonUniforms=null,this.projected=!1,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.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e||"nearest")==="bilinear"?A.LINEAR:A.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=F(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(e=!1){const r=e||this.projected;return[r?this.width:this.source?.width||this.width,r?this.height:this.source?.height||this.height]}getRasterCellSize(){const e=this.rawPixelData?.srcPixelSize,{projected:r,resolution:s}=this;return e&&!r?[e.x,e.y]:[s,s]}_createTransforms(){return{displayViewScreenMat3:z()}}setTransform(e){const r=Ve(this.transforms.displayViewScreenMat3),[s,i]=e.toScreenNoRotation([0,0],[this.x,this.y]),a=this.resolution/this.pixelRatio/e.resolution,n=a*this.width,o=a*this.height,l=Math.PI*this.rotation/180;E(r,r,B(s,i)),E(r,r,B(n/2,o/2)),Be(r,r,-l),E(r,r,B(-n/2,-o/2)),Ge(r,r,B(n,o)),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,r)}getTextures({forProcessing:e=!1,useProcessedTexture:r=!1}={}){const s=r?this._processedTexture??this._rasterTexture:this._rasterTexture,i=[],a=[];return s?(this._transformGridTexture&&!this.projected&&(a.push(this._transformGridTexture),i.push("u_transformGrid")),r?(a.push(s),i.push("u_image"),this._colormapTexture&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a}):(a.push(s),i.push("u_image"),this._colormapTexture&&!e&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a})):{names:i,textures:a}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const r=this._isValidSource(this.source);r&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(r?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=We(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;e.length!==0&&(this.processedTexture=e.shift(),e.forEach(r=>r?.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){const r=this.source?.extractBands(this.bandIds);if(!this._isValidSource(r))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!e.capabilities.textureFloatLinear;const i=this._getTextureSamplingMethod(this.interpolation),a=this.isRendereredSource;this._rasterTexture=Ne(e,r,i,a),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(e){const r=this._rasterTextureBandIds;return!(r==null&&e==null||r&&e&&r.join("")===e.join(""))}_isValidSource(e){return e!=null&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:r}=this.symbolizerParameters,s=r==="lut"&&!this.symbolizerParameters.isClassBreaks||r==="hillshade"||r==="stretch"&&this.symbolizerParameters.bandCount===1;return!this._supportsBilinearTexture||s||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const r=this._colormap,s=this.symbolizerParameters.colormap;return s?r?s.length!==r.length||s.some((i,a)=>i!==r[a])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=j(e,s),void(this._colormap=s)):void 0:(this._colormapTexture=j(e,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){!this._transformGridTexture||e&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}function pt(t){return t.source!=null}function W(t){const e=[];return t&&(e.push("applyProjection"),t.spacing[0]===1&&e.push("lookupProjection")),e}function he(t,e,r){const s=!r.capabilities.textureFloatLinear,i=[];return t==="cubic"?i.push("bicubic"):t==="bilinear"&&(e?(i.push("bilinear"),i.push("nnedge")):s&&i.push("bilinear")),i}const ft={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function gt(t,e,r){const s=r?[]:W(e.transformGrid);return{defines:s,program:t.painter.materialManager.getProgram(ft,s)}}function _t(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const{colormap:o,colormapOffset:l}=r.symbolizerParameters,c=q(o,l);w(e,s,c)}const yt={createProgram:gt,bindTextureAndUniforms:_t},xt={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function bt(t,e,r){const{colormap:s}=e.symbolizerParameters,i=[...r?[]:W(e.transformGrid),...he(e.interpolation,!0,t.context)];return s!=null&&i.push("applyColormap"),{defines:i,program:t.painter.materialManager.getProgram(xt,i)}}function wt(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ee(o);w(e,s,{...d,u_scaling:1})}const vt={createProgram:bt,bindTextureAndUniforms:wt},Tt={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pt(t,e,r){const{colormap:s,bandCount:i}=e.symbolizerParameters,a=[...r?[]:W(e.transformGrid),...he(e.interpolation,i===1,t.context)];return e.isRendereredSource&&!r?a.push("noop"):s!=null&&a.push("applyColormap"),{defines:a,program:t.painter.materialManager.getProgram(Tt,a)}}function St(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ae(o);w(e,s,d)}const Ut={createProgram:Pt,bindTextureAndUniforms:St},O=new Map;function Rt(t){return O.get(t)}O.set("lut",yt),O.set("hillshade",vt),O.set("stretch",Ut);const It=[1,1],Ft=[2,0,0,0,2,0,-1,-1,0];function x(t,e,r,s){const{context:i,rasterFunction:a,hasBranches:n}=t,{raster:o}=a.parameters,l=n?o?.id??-1:0,c=[r.functionTextures[l]??r.rasterTexture],d=["u_image"];if(s){const u=j(i,s);r.functionTextures[100]=u,c.push(u),d.push("u_colormap")}U(i,e,d,c)}function N(t,e,r){const{rasters:s}=t.rasterFunction.parameters;if(!s)return;if(s.length<2)return x(t,e,r);const i=s.filter(a=>a.name!=="Constant").map(a=>a.id!=null&&a.name!=="Identity"?r.functionTextures[a.id]:r.rasterTexture);if(U(t.context,e,["u_image","u_image1","u_image2"].slice(0,i.length),i),i.length!==s.length){if(s.length===2){const a=s.findIndex(l=>l.name==="Constant"),n=a===0?[0,1,0,1,0,0,0,0,0]:[1,0,0,0,1,0,0,0,0],{value:o}=s[a].parameters;e.setUniform1f("u_image1Const",o),e.setUniformMatrix3fv("u_imageSwap",n)}else if(s.length===3){const a=[];if(s.forEach((n,o)=>n.name==="Constant"&&a.push(o)),a.length===1){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const o=a[0]===0?[0,1,0,0,0,1,1,0,0]:a[0]===1?[1,0,0,0,0,1,0,1,0]:[1,0,0,0,1,0,0,0,1];e.setUniformMatrix3fv("u_imageSwap",o)}else if(a.length===2){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const{value:o}=s[a[1]].parameters;e.setUniform1f("u_image2Const",o);const l=s.findIndex(d=>d.name!=="Constant"),c=l===0?[1,0,0,0,1,0,0,0,1]:l===1?[0,1,0,1,0,0,0,0,1]:[0,0,1,1,0,0,0,1,0];e.setUniformMatrix3fv("u_imageSwap",c)}}}}function y(t){t.setUniform2fv("u_coordScale",It),t.setUniformMatrix3fv("u_dvsMat3",Ft)}const Ct={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zt(t,e){return t.painter.materialManager.getProgram(Ct,[])}function Mt(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i)}const Vt={createProgram:zt,bindTextureAndUniforms:Mt},Bt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gt(t,e){const{painter:r,rasterFunction:s}=t,{indexType:i,isOutputRounded:a}=s.parameters,n=[i];return a&&n.push("roundOutput"),r.materialManager.getProgram(Bt,n)}function Lt(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s,adjustments:i}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s),e.setUniform1fv("u_adjustments",i)}const Ot={createProgram:Gt,bindTextureAndUniforms:Lt},kt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/colormap2rgb",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dt(t){const{painter:e}=t;return e.materialManager.getProgram(kt,[])}function Et(t,e,r){const{indexedColormap:s,offset:i}=t.rasterFunction.parameters;x(t,e,r,s),y(e),e.setUniform1f("u_colormapOffset",i),e.setUniform1f("u_colormapMaxIndex",s.length/4-1)}const At={createProgram:Dt,bindTextureAndUniforms:Et},jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qt(t,e){const r=t.rasterFunction.parameters.rasters.filter(i=>i.name==="Constant"),s=[];return r.length&&(s.push("oneConstant"),r.length===2&&s.push("twoConstant")),t.painter.materialManager.getProgram(jt,s)}function Wt(t,e,r){N(t,e,r),y(e)}const Nt={createProgram:qt,bindTextureAndUniforms:Wt},$t={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/computechange",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qt(t){const{painter:e,rasterFunction:r}=t,{method:s,rasters:i,isOutputRounded:a}=r.parameters,n=[s.includes("-")?s.slice(0,s.indexOf("-")):s];return i.filter(o=>o.name==="Constant").length&&n.push("oneConstant"),a&&n.push("roundOutput"),e.materialManager.getProgram($t,n)}function Ht(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const Zt={createProgram:Qt,bindTextureAndUniforms:Ht},Jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/contrast",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Yt(t,e){return t.painter.materialManager.getProgram(Jt,[])}function Kt(t,e,r){x(t,e,r),y(e);const{contrastOffset:s,brightnessOffset:i}=t.rasterFunction.parameters;e.setUniform1f("u_contrastOffset",s),e.setUniform1f("u_brightnessOffset",i)}const Xt={createProgram:Yt,bindTextureAndUniforms:Kt},er={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function tr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a}=s.parameters,n=[{name:"rows",value:i},{name:"cols",value:a}];return r.materialManager.getProgram(er,n)}function rr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{kernel:s,clampRange:i}=t.rasterFunction.parameters;e.setUniform1fv("u_kernel",s),e.setUniform2fv("u_clampRange",i)}const sr={createProgram:tr,bindTextureAndUniforms:rr},ir={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/curvature",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ar(t,e){const{painter:r,rasterFunction:s}=t,{curvatureType:i}=s.parameters,a=[i];return r.materialManager.getProgram(ir,a)}function nr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const{zFactor:i}=t.rasterFunction.parameters,a=r.getRasterCellSize();e.setUniform1f("u_zlFactor",200*i/a[0]/a[1])}const or={createProgram:ar,bindTextureAndUniforms:nr},lr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ur(t,e){return t.painter.materialManager.getProgram(lr,[])}function cr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const hr={createProgram:ur,bindTextureAndUniforms:cr},dr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/focalstatistics",attributes:new Map([["a_position",0],["a_texcoord",1]])};function mr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a,fillNoDataOnly:n,statisticsType:o}=s.parameters,l=[{name:"rows",value:i},{name:"cols",value:a},o];return n&&l.push("fill"),r.materialManager.getProgram(dr,l)}function pr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{clampRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_clampRange",s)}const fr={createProgram:mr,bindTextureAndUniforms:pr},gr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/grayscale",attributes:new Map([["a_position",0],["a_texcoord",1]])};function _r(t,e){return t.painter.materialManager.getProgram(gr,[])}function yr(t,e,r){x(t,e,r),y(e);const{weights:s}=t.rasterFunction.parameters;e.setUniform3fv("u_weights",s)}const xr={createProgram:_r,bindTextureAndUniforms:yr},br={vsPath:"raster/rfx/vs",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function wr(t,e){const{indexedColormap:r}=t.rasterFunction.parameters,s=[];return r?.length&&s.push("applyColormap"),t.painter.materialManager.getProgram(br,s)}function vr(t,e,r){const s=t.rasterFunction.parameters,{indexedColormap:i}=s;x(t,e,r,i),y(e);const a=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",a);const n=r.getRasterCellSize();e.setUniform2fv("u_cellSize",n);const{pixelSizeFactor:o}=s;if(o===0)e.setUniform2fv("u_factor",[s.factor[0]/n[0],s.factor[1]/n[1]]);else{const{zFactor:l,pixelSizePower:c,gcsFactor:d}=s,u=n[0]*d,m=n[1]*d,f=(l+u**c*o)/(8*u),_=(l+m**c*o)/(8*m);e.setUniform2fv("u_factor",[f,_])}e.setUniform1i("u_hillshadeType",s.hillshadeType),e.setUniform1fv("u_sinZcosAs",s.sinZcosAs),e.setUniform1fv("u_sinZsinAs",s.sinZsinAs),e.setUniform1fv("u_cosZs",s.cosZs),e.setUniform1fv("u_weights",s.weights),e.setUniform1f("u_opacity",1),e.setUniform1i("u_flipY",0),e.setUniform1f("u_scaling",255),e.setUniform1f("u_minValue",s.minValue),e.setUniform1f("u_maxValue",s.maxValue),i&&(e.setUniform1f("u_colormapOffset",s.offset),e.setUniform1f("u_colormapMaxIndex",i.length/4-1))}const ie={createProgram:wr,bindTextureAndUniforms:vr},Tr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pr(t){const{painter:e,rasterFunction:r}=t,{imageCount:s,operationName:i,rasters:a,isOutputRounded:n}=r.parameters,o=[i.toLowerCase()];s===2&&o.push("twoImages");const l=a.filter(c=>c.name==="Constant");return l.length&&(o.push("oneConstant"),l.length===2&&o.push("twoConstant")),n&&o.push("roundOutput"),e.materialManager.getProgram(Tr,o)}function Sr(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const ae={createProgram:Pr,bindTextureAndUniforms:Sr},Ur={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Rr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.bandCount>1?["multiBand"]:[];return r.materialManager.getProgram(Ur,i)}function Ir(t,e,r){x(t,e,r),y(e);const{includedRanges:s,noDataValues:i}=t.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",s),e.setUniform1fv("u_noDataValues",i)}const Fr={createProgram:Rr,bindTextureAndUniforms:Ir},Cr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.scaled?["scaled"]:[];return r.materialManager.getProgram(Cr,i)}function Mr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const Vr={createProgram:zr,bindTextureAndUniforms:Mr},Br={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gr(t,e){return t.painter.materialManager.getProgram(Br,[])}function Lr(t,e,r){x(t,e,r),y(e);const{noDataRanges:s,rangeMaps:i,allowUnmatched:a,clampRange:n}=t.rasterFunction.parameters;e.setUniform1fv("u_noDataRanges",s),e.setUniform1fv("u_rangeMaps",i),e.setUniform1f("u_unmatchMask",a?1:0),e.setUniform2fv("u_clampRange",n)}const Or={createProgram:Gr,bindTextureAndUniforms:Lr},kr={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dr(t,e){const{painter:r}=t,s=[],{interpolation:i,transformGrid:a}=e,n=t.rasterFunction?.parameters;return i==="cubic"?s.push("bicubic"):i==="bilinear"&&(s.push("bilinear"),n?.requireNNEdge&&s.push("nnedge")),a&&(s.push("applyProjection"),a.spacing[0]===1&&s.push("lookupProjection")),r.materialManager.getProgram(kr,s)}function Er(t,e,r){const{names:s,textures:i}=r.getTextures({forProcessing:!0});U(t.context,e,s,i),e.setUniform1f("u_scale",1),e.setUniform2fv("u_offset",[0,0]),e.setUniform2fv("u_coordScale",[1,1]),e.setUniformMatrix3fv("u_dvsMat3",[2,0,0,0,2,0,-1,-1,0]),e.setUniform1i("u_flipY",0),e.setUniform1f("u_opacity",1);const{width:a,height:n,source:o,transformGrid:l}=r;e.setUniform2fv("u_srcImageSize",[o.width,o.height]),e.setUniform2fv("u_targetImageSize",[a,n]),e.setUniform2fv("u_transformSpacing",l?l.spacing:Y),e.setUniform2fv("u_transformGridSize",l?l.size:Y)}const Ar={createProgram:Dr,bindTextureAndUniforms:Er},jr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qr(t,e){const{painter:r,rasterFunction:s}=t,{slopeType:i,isOutputRounded:a}=s.parameters,n=[];return i==="percent-rise"&&n.push("percentRise"),a&&n.push("roundOutput"),r.materialManager.getProgram(jr,n)}function Wr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i);const{zFactor:a,slopeType:n,pixelSizePower:o,pixelSizeFactor:l}=t.rasterFunction.parameters;e.setUniform1f("u_zFactor",a),e.setUniform1f("u_pixelSizePower",n==="adjusted"?o:0),e.setUniform1f("u_pixelSizeFactor",n==="adjusted"?l:0)}const Nr={createProgram:qr,bindTextureAndUniforms:Wr},$r={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qr(t,e){const{useGamma:r,bandCount:s,isOutputRounded:i}=t.rasterFunction.parameters,a=[];return r&&a.push("useGamma"),s>1&&a.push("multiBand"),i&&a.push("roundOutput"),t.painter.materialManager.getProgram($r,a)}function Hr(t,e,r){x(t,e,r),y(e);const{width:s,height:i}=r,a=t.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[s,i]),e.setUniform1f("u_minOutput",a.outMin),e.setUniform1f("u_maxOutput",a.outMax),e.setUniform1fv("u_factor",a.factor),e.setUniform1fv("u_minCutOff",a.minCutOff),e.setUniform1fv("u_maxCutOff",a.maxCutOff),e.setUniform1fv("u_gamma",a.gamma),e.setUniform1fv("u_gammaCorrection",a.gammaCorrection)}const Zr={createProgram:Qr,bindTextureAndUniforms:Hr},g=new Map;function de(t,e){const r=new Qe;return r.width=t,r.height=e,r.internalFormat=Oe.RGBA32F,r.samplingMode=A.NEAREST,r.dataType=ke.FLOAT,r.isImmutable=!0,r.wrapMode=De.CLAMP_TO_EDGE,r}function Jr(t,e,r,s){const{context:i,requestRender:a,allowDelayedRender:n}=t,o=s.createProgram(t,r);return n&&a!=null&&!o.compiled?(a(),null):(i.bindFramebuffer(e),i.setViewport(0,0,e.width,e.height),i.useProgram(o),o)}function Yr(t){return g.get(t.toLowerCase())}function Kr(t,e,r,s){const i=t.rasterFunction.name.toLowerCase(),a=i==="reproject"?Ar:Yr(i);if(a==null)return;const n=Jr(t,r,s,a);if(!n)return;a.bindTextureAndUniforms(t,n,s);const{interpolation:o}=s;i==="reproject"&&(s.interpolation="nearest"),e.draw();const[l,c]=s.getRasterTextureSize(i==="reproject"),d=de(l,c),u=new He(t.context,d);if(r.copyToTexture(0,0,l,c,0,0,u),i==="reproject")s.rasterTexture=u,s.projected=!0,s.interpolation=o;else{const m=t.hasBranches?t.rasterFunction.id:0;s.functionTextures[m]=u}}g.set("arithmetic",ae),g.set("aspect",Vt),g.set("bandarithmetic",Ot),g.set("colormaptorgb",At),g.set("computechange",Zt),g.set("compositeband",Nt),g.set("convolution",sr),g.set("contrastbrightness",Xt),g.set("curvature",or),g.set("extractband",hr),g.set("statistics",fr),g.set("grayscale",xr),g.set("hillshade",ie),g.set("shadedrelief",ie),g.set("local",ae),g.set("mask",Fr),g.set("ndvi",Vr),g.set("remap",Or),g.set("slope",Nr),g.set("stretch",Zr);class Xr extends Ze{constructor(){super(...arguments),this.name="raster",this._quad=null,this._rendererUniformInfos=new Map,this._fbo=null}dispose(){F(this._quad),F(this._fbo)}prepareState(e){const{context:r,renderPass:s}=e,i=s==="raster";r.setBlendingEnabled(!i),r.setBlendFunctionSeparate(G.ONE,G.ONE_MINUS_SRC_ALPHA,G.ONE,G.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0),r.setStencilWriteMask(0),r.setStencilTestEnabled(!i)}draw(e,r){if(!pt(r)||r.suspended)return;const{renderPass:s}=e;if(s!=="raster-bitmap")return s==="raster"?this._process(e,r):void this._drawBitmap(e,r,!0);this._drawBitmap(e,r)}_process(e,r){const{rasterFunction:s}=e,i=s.name==="Reproject";if(!(i?!(r.rasterTexture&&r.projected):!r.processed))return;const{timeline:a,context:n}=e;a.begin(this.name);const o=n.getBoundFramebufferObject(),l=n.getViewport();i||(r.processedTexture=F(r.processedTexture)),n.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),this._initQuad(n);const[c,d]=r.getRasterTextureSize(i),{isStandardRasterTileSize:u,fbo:m}=this._getRasterFBO(n,c,d);Kr(e,this._quad,m,r),u||m.dispose(),n.bindFramebuffer(o),n.setViewport(l.x,l.y,l.width,l.height),a.end(this.name)}_drawBitmap(e,r,s=!1){const{timeline:i,context:a}=e;if(i.begin(this.name),a.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),s&&!r.processedTexture){if(r.updateProcessedTexture(),!r.processedTexture)return void i.end(this.name);r.processed=!0}this._initBitmapCommonUniforms(r);const n=r.symbolizerParameters.type,o=Rt(n),{requestRender:l,allowDelayedRender:c}=e,{defines:d,program:u}=o.createProgram(e,r,r.projected&&s);if(c&&l!=null&&!u.compiled)return void l();a.useProgram(u);const m=this._getUniformInfos(n,a,u,d);this._quad||(this._quad=new K(a,[0,0,1,0,0,1,1,1])),o.bindTextureAndUniforms(e,u,r,m,s),this._quad.draw(),i.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const r=$e(1,[0,0]),{transformGrid:s,width:i,height:a}=e,n=je(s,[i,a],[e.source.width,e.source.height],1,!1);e.commonUniforms={...r,...n,u_coordScale:e.coordScale}}}_getRasterFBO(e,r,s){const i=r===C&&s===C;return i?(this._fbo||(this._fbo=this._createNewFBO(e,r,s)),{isStandardRasterTileSize:i,fbo:this._fbo}):{isStandardRasterTileSize:i,fbo:this._createNewFBO(e,r,s)}}_createNewFBO(e,r,s){const i=de(r,s);return new Je(e,i)}_initQuad(e){this._quad||(this._quad=new K(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,r,s,i){const a=i.length>0?e+"-"+i.join("-"):e;if(this._rendererUniformInfos.has(a))return this._rendererUniformInfos.get(a);const n=qe(r,s);return this._rendererUniformInfos.set(a,n),n}}class es extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.bitmap=null,this.bitmap=new mt(o,null,null),this.bitmap.coordScale=[a,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}let ts=class extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(t){const e=this._getTileBounds(t),[r,s]=this.tileInfoView.tileInfo.size,i=this.tileInfoView.getTileResolution(t.level);return new es(t,i,e[0],e[3],r,s)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"imagery (tile)",brushes:[Xr],target:()=>this.children.map(r=>r.bitmap),drawPhase:k.MAP});return[...super.prepareRenderPasses(t),e]}doRender(t){if(!this.visible||t.drawPhase!==k.MAP)return;const{rasterFunctionChain:e}=this;if(!e)return t.renderPass="raster-bitmap",void super.doRender(t);if(!e.hasFocalFunction){const[r,s]=this.tileInfoView.tileInfo.size;t.renderPass="raster",t.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,s],requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(t)}if(e?.functions.length){const{functions:r,hasBranches:s}=e;for(let i=0;i{const e=this._rasterFunctionState;if(t.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const r=this._rasterFunctionState,{type:s}=this;return t.refetch||s!=="raster"&&t.reprocess||r==="cpu"||e==="cpu"?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(t.signal))})}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(t){this._set("useWebGLForProcessing",t)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(t){if(this._tileStrategy&&this.useProgressiveUpdate!==t){this._tileStrategy.destroy(),this.container.removeAllChildren();const e=this._getCacheSize(t);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:e,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",t),this.layerView.requestUpdate()}}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume();const{extent:e,resolution:r,scale:s}=t.state,i=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const a=this._srcResolutions[i.level],n=e.toJSON?e:be.fromJSON(e);ee(this._blockCacheRegistryUrl,this._blockCacheRegistryId,n,r,a,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==i.level&&(this.previousLOD=i,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 t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(t),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const t=lt();this._maxIndexedColormapSize=4*(t.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new at(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new nt({tileInfoView:this._tileInfoView,concurrency:e,process:(s,i)=>this._fetchTile(s,i),priority:ot.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const r=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:s=>this.acquireTile(s),releaseTile:s=>this.releaseTile(s),cacheSize:r,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(t){const e=this.container.createTile(t);return this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,e}releaseTile(t){this._fetchQueue.abort(t.key.id),this.container.removeChild(t),t.once("detach",()=>{t.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(t=null){const e=t==null||t.join(",")===this._tileInfoView.tileInfo.size.join(",");if(e&&this._emptyTilePixelBlock!=null)return this._emptyTilePixelBlock;t=t||this._tileInfoView.tileInfo.size;const[r,s]=t,i=new Ke({width:r,height:s,pixels:[new Uint8Array(r*s)],mask:new Uint8Array(r*s),pixelType:"u8"});return e&&(this._emptyTilePixelBlock=i),i}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:t,raster:e}=this.layer,r="rasterFunction"in e?e.rasterFunction.rawInputBandIds:null;return t?.length&&r?.length&&e.rasterInfo.bandCount!==1?t.map(s=>r[Math.min(s,r.length-1)]):t||r}updateRasterFunctionParameters(){}_fetchTile(t,e){const r=this._getFetchOptions(t.level,e.signal);return this.fetchTile(t,r)}_getFetchOptions(t,e){const r=this.canUseWebGLForProcessing(),{layerView:s}=this,{tileInfo:i}=s,a=!i.isWrappable&&rt(s.view.spatialReference)!=null,n=r&&this.layer.raster.hasUniqueSourceStorageInfo;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:r?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:n,skipRasterFunction:this.type==="raster"&&this.container.rasterFunctionChain!=null,signal:e,srcResolution:this._srcResolutions[t],timeExtent:s.timeExtent,tileInfo:i,disableWrapAround:a}}_getCacheSize(t){return t?40:0}_initializeTileInfo(){const{layerView:t}=this,e=t.view.spatialReference;if(this._canUseLayerLODs()){const{origin:c,lods:d}=this.layer.tileInfo,u=d.map(({scale:f})=>f),m=X.create({spatialReference:e,size:C,scales:u,origin:c});return t.set("tileInfo",m),void(this._srcResolutions=d.map(({resolution:f})=>({x:f,y:f})))}const{scales:r,srcResolutions:s,isCustomTilingScheme:i}=st(this.layer.serviceRasterInfo,e,{tileSize:C,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),a=X.create({spatialReference:e,size:C,scales:r}),n=a.origin.x===0;we(t.fullExtent);const{xmin:o,ymax:l}=t.fullExtent;(n||i&&a.origin.x>o)&&(a.origin=new ve({x:o,y:l,spatialReference:e})),this._isCustomTilingScheme=i,t.set("tileInfo",a),this._srcResolutions=s??[]}_canUseLayerLODs(){const{layer:t,layerView:e}=this;if(t.raster.tileType!=="Map")return!1;const{lods:r}=t.tileInfo,s=e.view.constraints?.effectiveLODs;return s?.length===r.length&&s.every(({scale:i},a)=>Math.abs(i-r[a].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:t}=this.layer.serviceRasterInfo.storageInfo,e=t[t.length-1];return(e.maxCol-e.minCol+1)*(e.maxRow-e.minRow+1)>64?2:10}async _enqueueTileFetch(t,e){if(!this._fetchQueue.has(t.key.id)){try{const r=await this._fetchQueue.push(t.key),s=this._getBandIds();let i=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){i=!1;try{await this._redrawImage(this._abortController?.signal)}catch(o){R(o)&&I.getLogger(this).error(o)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const a=this._tileInfoView.getTileCoords(rs,t.key),n=this._tileInfoView.getTileResolution(t.key);await this.updateTileSource(t,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:i,bandIds:s,coords:a,resolution:n}),t.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(t)}catch(r){R(r)||I.getLogger(this).error(r)}this.layerView.requestUpdate()}}async _redrawImage(t){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(t):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const e=this.container.children.map(async r=>this.updateTileSymbolizerParameters(r,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Promise.allSettled(e),this.container.requestRender()}async _updateGlobalSymbolizerParams(t){const e=this._getFetchOptions(this.previousLOD.level,t),r=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,{...e,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:s}=this.previousLOD,i=this._getBandIds(),a=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(i),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:s,y:s},bandIds:i});!this.canUseWebGLForProcessing()&&a&&a.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(a.factor=a.factor.map(n=>255*n),a.outMin=Math.round(255*a.outMin),a.outMax=Math.round(255*a.outMax)),this._globalSymbolizerParams=a}_updateSymbolizerParams(){const{resolution:t}=this.previousLOD,e=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:e})}_updateBlockCacheRegistry(t=!1){const{layer:e,layerView:r}=this,{raster:s}=e,{multidimensionalDefinition:i}=e.normalizeRasterFetchOptions({multidimensionalDefinition:e.multidimensionalDefinition,timeExtent:r.timeExtent}),a=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(i):null,n=et(s.rasterId,a);if(n!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=tt(n,s.rasterInfo),t){const{view:o}=r,l=this._tileInfoView.getClosestInfoForScale(o.scale),c=this._srcResolutions[l.level];ee(n,this._blockCacheRegistryId,o.extent,o.resolution,c,s.ioConfig.sampling)}this._blockCacheRegistryUrl=n}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const t=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh(e=>t.push(this._enqueueTileFetch(e))),await this._updatingHandles.addPromise(Promise.allSettled(t))}};h([p()],b.prototype,"_globalUpdateRequested",void 0),h([p()],b.prototype,"attached",void 0),h([p()],b.prototype,"container",void 0),h([p()],b.prototype,"layer",void 0),h([p()],b.prototype,"layerView",void 0),h([p()],b.prototype,"scheduler",void 0),h([p()],b.prototype,"type",void 0),h([p()],b.prototype,"useWebGLForProcessing",null),h([p()],b.prototype,"useProgressiveUpdate",null),h([p()],b.prototype,"timeExtent",void 0),h([p()],b.prototype,"updating",null),b=h([M("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],b);let P=class extends b{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new ts(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){const{symbolizer:t}=this.layer,e=t.lookup?.colormapLut?.indexedColormap,r=e&&e.length>this._maxIndexedColormapSize;return this.useWebGLForProcessing&&t.canRenderInWebGL&&!r&&!(this.layer.interpolation==="majority"&&oe(this.layer))}fetchTile(t,e){return this.layer.fetchTile(t.level,t.row,t.col,e)}updateRasterFunctionParameters(){const{clips:t,view:e}=this.layerView;this._geometry!=null&&t.remove(this._geometry);const{raster:r,type:s}=this.layer;if(r.datasetFormat==="Function"){const f=r.getClippingGeometry(e.spatialReference);if(f){const _=new Fe({geometry:f});t.add(_),this._geometry=_}}const{container:i}=this;if(r.datasetFormat!=="Function"||s==="wcs")return i.rasterFunctionChain=null,i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=!0,_.processed=!1,_.projected&&(_.invalidateTexture(),_.rasterTexture=null))}),void(this._rasterFunctionState="na");const a=this._rasterFunctionState,{rasterFunction:n,primaryRasters:o}=r,l=n.supportsGPU&&(!o||o.rasters.length<=1),c=l?n.flatWebGLFunctionChain:null,{renderer:d}=this.layer,u=!l||!c?.functions.length||d?.type==="raster-stretch"&&d.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();i.rasterFunctionChain=u?null:c;const m=n==null?"na":i.rasterFunctionChain?"gpu":"cpu";i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=a!==m,_.processed=!1,_.processedTexture=null)}),this._rasterFunctionState=m}async updateTileSource(t,e){const r=this._getBandIds(),s=this._getLayerInterpolation(),i=this.canUseWebGLForProcessing(),{source:a,globalSymbolizerParams:n,suspended:o,coords:l,resolution:c}=e,d=this.layerView.hasTilingEffects?n:e.symbolizerParams,{bitmap:u}=t;if([u.x,u.y]=l,u.resolution=c,a?.pixelBlock!=null){const m={extent:a.extent,pixelBlock:a.pixelBlock,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=m,i)u.source=a.pixelBlock,u.isRendereredSource=!1;else{const f=await this.layer.applyRenderer(m,n?.type==="stretch"?n:void 0);u.source=f,u.isRendereredSource=!0}u.symbolizerParameters=i?d:null,u.transformGrid=i?a.transformGrid:null}else{const m=this.createEmptyTilePixelBlock();u.source=m,u.symbolizerParameters=i?d:null,u.transformGrid=null}u.bandIds=i?r:null,u.width=this._tileInfoView.tileInfo.size[0],u.height=this._tileInfoView.tileInfo.size[1],u.interpolation=s,u.suspended=o,u.invalidateTexture()}async updateTileSymbolizerParameters(t,e){const{local:r,global:s}=e,i=this._getBandIds(),a=this._getLayerInterpolation(),n=this.canUseWebGLForProcessing(),{bitmap:o}=t,{rawPixelData:l}=o;n||l==null?(o.isRendereredSource&&l!=null&&(o.source=l.pixelBlock),o.isRendereredSource=!1):(o.source=await this.layer.applyRenderer(l,s?.type==="stretch"?s:void 0),o.isRendereredSource=!0),o.symbolizerParameters=n?this.layerView.hasTilingEffects?s:r:null,o.bandIds=n?i:null,o.interpolation=a,o.suspended=!1}_getLayerInterpolation(){const{interpolation:t,renderer:e}=this.layer;if(!e)return t;const r=e.type;return r==="raster-colormap"||r==="unique-value"?"nearest":e.type==="raster-stretch"&&e.colorRamp!=null?t==="bilinear"||t==="cubic"?"bilinear":"nearest":t}};h([p()],P.prototype,"container",void 0),h([p()],P.prototype,"layer",void 0),h([p()],P.prototype,"type",void 0),P=h([M("esri.views.2d.layers.imagery.ImageryTileView2D")],P);const ss=P;class is extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.tileData=new Re(o),this.tileData.coordScale=[a,n],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(e){this.tileData.stencilRef=e}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}setTransform(e){super.setTransform(e);const r=this.resolution/(e.resolution*e.pixelRatio),s=this.transforms.tileMat3,[i,a]=this.tileData.offset,n=[this.x+i*this.resolution,this.y-a*this.resolution],[o,l]=e.toScreenNoRotation([0,0],n),{symbolTileSize:c}=this.tileData.symbolizerParameters,d=Math.round((this.width-this.tileData.offset[0])/c)*c,u=Math.round((this.height-this.tileData.offset[1])/c)*c,m=d/this.rangeX*r,f=u/this.rangeY*r;Me(s,m,0,0,0,f,0,o,l,1),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,s),this.tileData.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}class as extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const r=this.tileInfoView.getTileBounds(ne(),e),[s,i]=this.tileInfoView.tileInfo.size,a=this.tileInfoView.getTileResolution(e.level);return new is(e,a,r[0],r[3],s,i)}prepareRenderPasses(e){const r=e.registerRenderPass({name:"imagery (vf tile)",brushes:[Ue],target:()=>this.children.map(s=>s.tileData),drawPhase:k.MAP});return[...super.prepareRenderPasses(e),r]}doRender(e){this.visible&&e.drawPhase===k.MAP&&this.symbolTypes.forEach(r=>{e.renderPass=r,super.doRender(e)})}}let S=class extends b{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(t,e){e={...e,interpolation:"nearest",requestProjectedLocalDirections:!0};const r=await this.layer.fetchTile(t.level,t.row,t.col,e);return this.layer.serviceRasterInfo?.dataType==="vector-magdir"&&r?.pixelBlock&&(r.pixelBlock=await this.layer.convertVectorFieldData(r.pixelBlock,e)),r}updateTileSource(t,e){const r=e.symbolizerParams,{tileData:s}=t;s.key=t.key,s.width=this._tileInfoView.tileInfo.size[0],s.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:i}=r,{source:a}=e;if(s.offset=this._getTileSymbolOffset(s.key,i),a?.pixelBlock!=null){const n={extent:a.extent,pixelBlock:a.pixelBlock};s.rawPixelData=n,s.symbolizerParameters=r,s.source=this._sampleVectorFieldData(a.pixelBlock,r,s.offset)}else{const n=[Math.round((this._tileInfoView.tileInfo.size[0]-s.offset[0])/i),Math.round((this._tileInfoView.tileInfo.size[1]-s.offset[1])/i)],o=this.createEmptyTilePixelBlock(n);s.source=o,s.symbolizerParameters=r}return s.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(t,e){const r=e.local,{symbolTileSize:s}=r,{tileData:i}=t;i.offset=this._getTileSymbolOffset(i.key,s);const a=i.symbolizerParameters.symbolTileSize;i.symbolizerParameters=r;const n=i.rawPixelData?.pixelBlock;return n!=null&&a!==s&&(i.source=this._sampleVectorFieldData(n,i.symbolizerParameters,i.offset)),Promise.resolve()}attach(){super.attach(),this.container=new as(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=L(()=>this.layer.renderer,t=>this._updateSymbolType(t))}detach(){super.detach(),this.container.removeAllChildren(),this._handle?.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(t,e){const r=t.col*this._tileInfoView.tileInfo.size[0]%e,s=t.row*this._tileInfoView.tileInfo.size[1]%e;return[r>e/2?e-r:-r,s>e/2?e-s:-s]}_sampleVectorFieldData(t,e,r){const{symbolTileSize:s}=e;return Xe(t,"vector-uv",s,r)}_updateSymbolType(t){t.type==="vector-field"&&(this.container.symbolTypes=t.style==="wind-barb"?["scalar","triangle"]:t.style==="simple-scalar"?["scalar"]:["triangle"])}};h([p()],S.prototype,"container",void 0),h([p()],S.prototype,"layer",void 0),h([p()],S.prototype,"type",void 0),S=h([M("esri.views.2d.layers.imagery.VectorFieldTileView2D")],S);const ns=S,os=t=>{let e=class extends t{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return ut(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?it(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(r){try{return!this.layer.loaded||!!re(this.layer.serviceRasterInfo,r)}catch{return!1}}async fetchPopupFeaturesAtLocation(r,s){const{layer:i}=this;if(!r)throw new Te("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:a}=i,n=ct(i,s);if(!a||n==null)return[];const o=[],{value:l,magdirValue:c,processedValue:d}=await i.identify(r,{timeExtent:this.timeExtent,signal:s?.signal});let u="";if(l?.length){u=i.type==="imagery-tile"&&i.hasStandardTime()&&l[0]!=null?l.map(D=>i.getStandardTimeValue(D)).join(", "):l.join(", ");const m={ObjectId:0},f="Raster.ServicePixelValue";m[f]=i.type==="imagery-tile"&&i.raster.datasetFormat==="Function"?d?.join(", "):u,m[f+".Raw"]=u;const _=i.raster?.rasterInfo??i.serviceRasterInfo,$=_?.attributeTable;if($!=null){const{fields:D,features:pe}=$,H=D.find(({name:v})=>v.toLowerCase()==="value"),fe=m[f],V=H?pe.find(v=>String(v.attributes[H.name])===fe):null;if(V)for(const v in V.attributes)V.attributes.hasOwnProperty(v)&&(m[this._rasterFieldPrefix+v]=V.attributes[v])}const Q=_?.dataType;Q!=="vector-magdir"&&Q!=="vector-uv"||(m["Raster.Magnitude"]=c?.[0],m["Raster.Direction"]=c?.[1]);const me=new Pe({geometry:this.fullExtent?.clone(),attributes:m,layer:i,sourceLayer:i});o.push(me)}return o}_getFullExtent(){return re(this.layer.serviceRasterInfo,this.view.spatialReference)}};return h([p()],e.prototype,"fullExtent",null),h([p()],e.prototype,"layer",void 0),h([p({readOnly:!0})],e.prototype,"timeExtent",null),h([p()],e.prototype,"tileInfo",void 0),h([p({readOnly:!0})],e.prototype,"hasTilingEffects",null),h([p()],e.prototype,"datumTransformation",null),e=h([M("esri.views.layers.ImageryTileLayerView")],e),e};let T=class extends os(ht(Ie(Ce))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(t){this._useWebGLForProcessing=t,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=t)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(t){this._useProgressiveUpdate=t,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=t)}get displayParameters(){const{layer:t}=this,e=this._get("displayParameters");return t.renderer?{bandIds:t.bandIds,renderer:t.renderer,interpolation:t.interpolation,multidimensionalDefinition:t.multidimensionalDefinition,rasterFunction:t.type==="imagery-tile"?t.rasterFunction:null}:e}update(t){this.subview?.update(t),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([L(()=>this.displayParameters,(t,e)=>{const r=t.interpolation!==e?.interpolation&&(t.interpolation==="majority"||e?.interpolation==="majority")&&oe(this.layer),s=t.renderer!==e?.renderer&&this._getSubviewType(e?.renderer)!==this._getSubviewType(t.renderer);s&&this._updateSubview();const i=t.multidimensionalDefinition!==e?.multidimensionalDefinition,a=t.rasterFunction!==e?.rasterFunction,n=a&&!this._useWebGLForProcessing,o=i||r||s||n;this.subview.redrawOrRefetch({refetch:o,reprocess:a}).catch(l=>{R(l)||I.getLogger(this).error(l)}),this.notifyChange("updating")}),L(()=>this.layer.multidimensionalSubset??null,(t,e)=>{const{multidimensionalDefinition:r}=this.layer;r!=null&&Z(r,t)!==Z(r,e)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(s=>{R(s)||I.getLogger(this).error(s)}),this.notifyChange("updating"))},ge),L(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(t=>{R(t)||I.getLogger(this).error(t)})},_e)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:t}=this.layer;if(!t)return;const e=this._getSubviewType(t);if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:r}=this;let s;if(s=e==="rasterVF"?new ns({layer:r,layerView:this,scheduler:this.scheduler}):e==="flow"?new Se({layer:r,layerView:this,scheduler:this.scheduler}):new ss({layer:r,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s){const{subview:i}=this;s.previousLOD=i&&"previousLOD"in i?i.previousLOD:null}this._attachSubview(s),this.subview=s,this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}_getSubviewType(t){const e=t?.type;return e==="vector-field"?"rasterVF":e==="flow"?"flow":"raster"}};h([p()],T.prototype,"subview",void 0),h([p()],T.prototype,"useWebGLForProcessing",null),h([p()],T.prototype,"useProgressiveUpdate",null),h([p({readOnly:!0})],T.prototype,"displayParameters",null),T=h([M("esri.views.2d.layers.ImageryTileLayerView2D")],T);const Di=T;export{Di as default}; +import{v as h,S as p,i as M,ah as L,aU as R,a1 as I,av as ge,aL as _e,j as ye,bp as xe,n as be,O as we,w as ve,bh as ne,o as Te,bi as Pe,hT as F}from"./story-Doly9N9p.js";import{p as Z}from"./multidimensionalUtils-BwTugeu7-C75LYPc9.js";import{o as Se,l as Ue,c as Re}from"./RasterVFDisplayObject-CnriTVT9-CVvMEEVD.js";import{X as Ie,A as Fe,Y as Ce}from"./LayerView-Bish-E63-DK1SFHE3.js";import{t as oe,E as k,m as ze,e as z}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{Q as Me,E as le,R as Ve,C as E,D as Be,H as Ge}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as B}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{T as Le}from"./Container-BcuL1ZEG-DVZvemLA.js";import{A as G,L as J,M as A,B as Oe,F as ke,G as De}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{N as U,k as w,w as q,G as Ee,x as Ae,U as j,b as je,V as qe,M as We,L as Ne,F as $e}from"./rasterUtils-DqAu9qES-Be2s-rDn.js";import{s as Y}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{H as Qe,V as He}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{t as C}from"./definitions-DJSdSb77-DkoRHaVx.js";import{k as Ze,F as K,K as ue}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{G as Je}from"./Program-DLVwTiPA-DI0GKSfI.js";import{h as ce}from"./TileContainer-D48pXXgL-BzDz3Uqo.js";import{i as Ye}from"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import{D as Ke,B as Xe}from"./dataUtils-BkPy4R3C-Dzc1QGGb.js";import{V as X}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import{Z as ee,P as te,K as et,O as tt}from"./RawBlockCache-Cj_tmHDm-gcQCDGFb.js";import{k as rt,U as st,p as it,r as re}from"./rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js";import{a as se,Q as at,$ as nt}from"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import{i as ot}from"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import{n as lt}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{T as ut}from"./timeSupport-ohWmWReZ-D2lpSlXU.js";import{m as ct}from"./popupUtils-nV1O8RUO-BYG2KoFf.js";import{n as ht}from"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";import"./main-QGPoLsvl.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";const dt={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 mt extends Le{constructor(e=null,r=null,s=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,this._colormapTexture=null,this._colormap=null,this._supportsBilinearTexture=!0,this._processedTexture=null,this.functionTextures=[],this.projected=!1,this.stencilRef=0,this.coordScale=[1,1],this._processed=!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=r,this.interpolation=s}destroy(){this._disposeTextures()}get processedTexture(){return this._processedTexture}set processedTexture(e){this._processedTexture!==e&&(this._disposeTextures(!0),this._processedTexture=e)}get rasterTexture(){return this._rasterTexture}set rasterTexture(e){this._rasterTexture!==e&&(this._rasterTexture?.dispose(),this._rasterTexture=e),e==null&&(this.projected=!1)}get processed(){return this._processed}set processed(e){this._processed=e,e||(F(this.processedTexture),this.invalidateTexture())}get symbolizerParameters(){return this._symbolizerParameters||dt}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0,this.commonUniforms=null)}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.commonUniforms=null,this.projected=!1,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.projected=!1,this.invalidateTexture())}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e||"nearest")==="bilinear"?A.LINEAR:A.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid!==e&&(this._transformGrid=e,this._transformGridTexture=F(this._transformGridTexture))}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}getRasterTextureSize(e=!1){const r=e||this.projected;return[r?this.width:this.source?.width||this.width,r?this.height:this.source?.height||this.height]}getRasterCellSize(){const e=this.rawPixelData?.srcPixelSize,{projected:r,resolution:s}=this;return e&&!r?[e.x,e.y]:[s,s]}_createTransforms(){return{displayViewScreenMat3:z()}}setTransform(e){const r=Ve(this.transforms.displayViewScreenMat3),[s,i]=e.toScreenNoRotation([0,0],[this.x,this.y]),a=this.resolution/this.pixelRatio/e.resolution,n=a*this.width,o=a*this.height,l=Math.PI*this.rotation/180;E(r,r,B(s,i)),E(r,r,B(n/2,o/2)),Be(r,r,-l),E(r,r,B(-n/2,-o/2)),Ge(r,r,B(n,o)),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,r)}getTextures({forProcessing:e=!1,useProcessedTexture:r=!1}={}){const s=r?this._processedTexture??this._rasterTexture:this._rasterTexture,i=[],a=[];return s?(this._transformGridTexture&&!this.projected&&(a.push(this._transformGridTexture),i.push("u_transformGrid")),r?(a.push(s),i.push("u_image"),this._colormapTexture&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a}):(a.push(s),i.push("u_image"),this._colormapTexture&&!e&&(a.push(this._colormapTexture),i.push("u_colormap")),{names:i,textures:a})):{names:i,textures:a}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){if(!this.stage)return void this._disposeTextures();const r=this._isValidSource(this.source);r&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(r?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=We(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}updateProcessedTexture(){const{functionTextures:e}=this;e.length!==0&&(this.processedTexture=e.shift(),e.forEach(r=>r?.dispose()),e.length=0)}_createOrDestroyRasterTexture(e){const r=this.source?.extractBands(this.bandIds);if(!this._isValidSource(r))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const s=!this._isBandIdsChanged(this.bandIds);if(this._rasterTexture){if(s)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=!!e.capabilities.textureFloatLinear;const i=this._getTextureSamplingMethod(this.interpolation),a=this.isRendereredSource;this._rasterTexture=Ne(e,r,i,a),this.projected=!1,this._processed=!1,this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdsChanged(e){const r=this._rasterTextureBandIds;return!(r==null&&e==null||r&&e&&r.join("")===e.join(""))}_isValidSource(e){return e!=null&&e.pixels?.length>0}_getTextureSamplingMethod(e){const{type:r}=this.symbolizerParameters,s=r==="lut"&&!this.symbolizerParameters.isClassBreaks||r==="hillshade"||r==="stretch"&&this.symbolizerParameters.bandCount===1;return!this._supportsBilinearTexture||s||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const r=this._colormap,s=this.symbolizerParameters.colormap;return s?r?s.length!==r.length||s.some((i,a)=>i!==r[a])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=j(e,s),void(this._colormap=s)):void 0:(this._colormapTexture=j(e,s),void(this._colormap=s)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}_disposeTextures(e=!1){!this._transformGridTexture||e&&!this.projected||(this._transformGridTexture.dispose(),this._transformGridTexture=null),!e&&this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null,this._colormap=null,this._colormapTextureInvalidated=!0),!e&&this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this._processedTexture&&(this._processedTexture.dispose(),this._processedTexture=null)}}function pt(t){return t.source!=null}function W(t){const e=[];return t&&(e.push("applyProjection"),t.spacing[0]===1&&e.push("lookupProjection")),e}function he(t,e,r){const s=!r.capabilities.textureFloatLinear,i=[];return t==="cubic"?i.push("bicubic"):t==="bilinear"&&(e?(i.push("bilinear"),i.push("nnedge")):s&&i.push("bilinear")),i}const ft={vsPath:"raster/common",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])};function gt(t,e,r){const s=r?[]:W(e.transformGrid);return{defines:s,program:t.painter.materialManager.getProgram(ft,s)}}function _t(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const{colormap:o,colormapOffset:l}=r.symbolizerParameters,c=q(o,l);w(e,s,c)}const yt={createProgram:gt,bindTextureAndUniforms:_t},xt={vsPath:"raster/common",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function bt(t,e,r){const{colormap:s}=e.symbolizerParameters,i=[...r?[]:W(e.transformGrid),...he(e.interpolation,!0,t.context)];return s!=null&&i.push("applyColormap"),{defines:i,program:t.painter.materialManager.getProgram(xt,i)}}function wt(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ee(o);w(e,s,{...d,u_scaling:1})}const vt={createProgram:bt,bindTextureAndUniforms:wt},Tt={vsPath:"raster/common",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pt(t,e,r){const{colormap:s,bandCount:i}=e.symbolizerParameters,a=[...r?[]:W(e.transformGrid),...he(e.interpolation,i===1,t.context)];return e.isRendereredSource&&!r?a.push("noop"):s!=null&&a.push("applyColormap"),{defines:a,program:t.painter.materialManager.getProgram(Tt,a)}}function St(t,e,r,s,i=!1){const{names:a,textures:n}=r.getTextures({useProcessedTexture:i});U(t.context,e,a,n),w(e,s,r.commonUniforms),e.setUniformMatrix3fv("u_dvsMat3",r.transforms.displayViewScreenMat3);const o=r.symbolizerParameters,{colormap:l,colormapOffset:c}=o;if(l!=null){const u=q(l,c);w(e,s,u)}const d=Ae(o);w(e,s,d)}const Ut={createProgram:Pt,bindTextureAndUniforms:St},O=new Map;function Rt(t){return O.get(t)}O.set("lut",yt),O.set("hillshade",vt),O.set("stretch",Ut);const It=[1,1],Ft=[2,0,0,0,2,0,-1,-1,0];function x(t,e,r,s){const{context:i,rasterFunction:a,hasBranches:n}=t,{raster:o}=a.parameters,l=n?o?.id??-1:0,c=[r.functionTextures[l]??r.rasterTexture],d=["u_image"];if(s){const u=j(i,s);r.functionTextures[100]=u,c.push(u),d.push("u_colormap")}U(i,e,d,c)}function N(t,e,r){const{rasters:s}=t.rasterFunction.parameters;if(!s)return;if(s.length<2)return x(t,e,r);const i=s.filter(a=>a.name!=="Constant").map(a=>a.id!=null&&a.name!=="Identity"?r.functionTextures[a.id]:r.rasterTexture);if(U(t.context,e,["u_image","u_image1","u_image2"].slice(0,i.length),i),i.length!==s.length){if(s.length===2){const a=s.findIndex(l=>l.name==="Constant"),n=a===0?[0,1,0,1,0,0,0,0,0]:[1,0,0,0,1,0,0,0,0],{value:o}=s[a].parameters;e.setUniform1f("u_image1Const",o),e.setUniformMatrix3fv("u_imageSwap",n)}else if(s.length===3){const a=[];if(s.forEach((n,o)=>n.name==="Constant"&&a.push(o)),a.length===1){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const o=a[0]===0?[0,1,0,0,0,1,1,0,0]:a[0]===1?[1,0,0,0,0,1,0,1,0]:[1,0,0,0,1,0,0,0,1];e.setUniformMatrix3fv("u_imageSwap",o)}else if(a.length===2){const{value:n}=s[a[0]].parameters;e.setUniform1f("u_image1Const",n);const{value:o}=s[a[1]].parameters;e.setUniform1f("u_image2Const",o);const l=s.findIndex(d=>d.name!=="Constant"),c=l===0?[1,0,0,0,1,0,0,0,1]:l===1?[0,1,0,1,0,0,0,0,1]:[0,0,1,1,0,0,0,1,0];e.setUniformMatrix3fv("u_imageSwap",c)}}}}function y(t){t.setUniform2fv("u_coordScale",It),t.setUniformMatrix3fv("u_dvsMat3",Ft)}const Ct={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/aspect",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zt(t,e){return t.painter.materialManager.getProgram(Ct,[])}function Mt(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i)}const Vt={createProgram:zt,bindTextureAndUniforms:Mt},Bt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/bandarithmetic",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gt(t,e){const{painter:r,rasterFunction:s}=t,{indexType:i,isOutputRounded:a}=s.parameters,n=[i];return a&&n.push("roundOutput"),r.materialManager.getProgram(Bt,n)}function Lt(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s,adjustments:i}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s),e.setUniform1fv("u_adjustments",i)}const Ot={createProgram:Gt,bindTextureAndUniforms:Lt},kt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/colormap2rgb",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dt(t){const{painter:e}=t;return e.materialManager.getProgram(kt,[])}function Et(t,e,r){const{indexedColormap:s,offset:i}=t.rasterFunction.parameters;x(t,e,r,s),y(e),e.setUniform1f("u_colormapOffset",i),e.setUniform1f("u_colormapMaxIndex",s.length/4-1)}const At={createProgram:Dt,bindTextureAndUniforms:Et},jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/compositeband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qt(t,e){const r=t.rasterFunction.parameters.rasters.filter(i=>i.name==="Constant"),s=[];return r.length&&(s.push("oneConstant"),r.length===2&&s.push("twoConstant")),t.painter.materialManager.getProgram(jt,s)}function Wt(t,e,r){N(t,e,r),y(e)}const Nt={createProgram:qt,bindTextureAndUniforms:Wt},$t={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/computechange",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qt(t){const{painter:e,rasterFunction:r}=t,{method:s,rasters:i,isOutputRounded:a}=r.parameters,n=[s.includes("-")?s.slice(0,s.indexOf("-")):s];return i.filter(o=>o.name==="Constant").length&&n.push("oneConstant"),a&&n.push("roundOutput"),e.materialManager.getProgram($t,n)}function Ht(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const Zt={createProgram:Qt,bindTextureAndUniforms:Ht},Jt={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/contrast",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Yt(t,e){return t.painter.materialManager.getProgram(Jt,[])}function Kt(t,e,r){x(t,e,r),y(e);const{contrastOffset:s,brightnessOffset:i}=t.rasterFunction.parameters;e.setUniform1f("u_contrastOffset",s),e.setUniform1f("u_brightnessOffset",i)}const Xt={createProgram:Yt,bindTextureAndUniforms:Kt},er={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/convolution",attributes:new Map([["a_position",0],["a_texcoord",1]])};function tr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a}=s.parameters,n=[{name:"rows",value:i},{name:"cols",value:a}];return r.materialManager.getProgram(er,n)}function rr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{kernel:s,clampRange:i}=t.rasterFunction.parameters;e.setUniform1fv("u_kernel",s),e.setUniform2fv("u_clampRange",i)}const sr={createProgram:tr,bindTextureAndUniforms:rr},ir={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/curvature",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ar(t,e){const{painter:r,rasterFunction:s}=t,{curvatureType:i}=s.parameters,a=[i];return r.materialManager.getProgram(ir,a)}function nr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const{zFactor:i}=t.rasterFunction.parameters,a=r.getRasterCellSize();e.setUniform1f("u_zlFactor",200*i/a[0]/a[1])}const or={createProgram:ar,bindTextureAndUniforms:nr},lr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/extractband",attributes:new Map([["a_position",0],["a_texcoord",1]])};function ur(t,e){return t.painter.materialManager.getProgram(lr,[])}function cr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const hr={createProgram:ur,bindTextureAndUniforms:cr},dr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/focalstatistics",attributes:new Map([["a_position",0],["a_texcoord",1]])};function mr(t,e){const{painter:r,rasterFunction:s}=t,{kernelRows:i,kernelCols:a,fillNoDataOnly:n,statisticsType:o}=s.parameters,l=[{name:"rows",value:i},{name:"cols",value:a},o];return n&&l.push("fill"),r.materialManager.getProgram(dr,l)}function pr(t,e,r){x(t,e,r),y(e),e.setUniform2fv("u_srcImageSize",[r.width,r.height]);const{clampRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_clampRange",s)}const fr={createProgram:mr,bindTextureAndUniforms:pr},gr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/grayscale",attributes:new Map([["a_position",0],["a_texcoord",1]])};function _r(t,e){return t.painter.materialManager.getProgram(gr,[])}function yr(t,e,r){x(t,e,r),y(e);const{weights:s}=t.rasterFunction.parameters;e.setUniform3fv("u_weights",s)}const xr={createProgram:_r,bindTextureAndUniforms:yr},br={vsPath:"raster/rfx/vs",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])};function wr(t,e){const{indexedColormap:r}=t.rasterFunction.parameters,s=[];return r?.length&&s.push("applyColormap"),t.painter.materialManager.getProgram(br,s)}function vr(t,e,r){const s=t.rasterFunction.parameters,{indexedColormap:i}=s;x(t,e,r,i),y(e);const a=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",a);const n=r.getRasterCellSize();e.setUniform2fv("u_cellSize",n);const{pixelSizeFactor:o}=s;if(o===0)e.setUniform2fv("u_factor",[s.factor[0]/n[0],s.factor[1]/n[1]]);else{const{zFactor:l,pixelSizePower:c,gcsFactor:d}=s,u=n[0]*d,m=n[1]*d,f=(l+u**c*o)/(8*u),_=(l+m**c*o)/(8*m);e.setUniform2fv("u_factor",[f,_])}e.setUniform1i("u_hillshadeType",s.hillshadeType),e.setUniform1fv("u_sinZcosAs",s.sinZcosAs),e.setUniform1fv("u_sinZsinAs",s.sinZsinAs),e.setUniform1fv("u_cosZs",s.cosZs),e.setUniform1fv("u_weights",s.weights),e.setUniform1f("u_opacity",1),e.setUniform1i("u_flipY",0),e.setUniform1f("u_scaling",255),e.setUniform1f("u_minValue",s.minValue),e.setUniform1f("u_maxValue",s.maxValue),i&&(e.setUniform1f("u_colormapOffset",s.offset),e.setUniform1f("u_colormapMaxIndex",i.length/4-1))}const ie={createProgram:wr,bindTextureAndUniforms:vr},Tr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/local",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Pr(t){const{painter:e,rasterFunction:r}=t,{imageCount:s,operationName:i,rasters:a,isOutputRounded:n}=r.parameters,o=[i.toLowerCase()];s===2&&o.push("twoImages");const l=a.filter(c=>c.name==="Constant");return l.length&&(o.push("oneConstant"),l.length===2&&o.push("twoConstant")),n&&o.push("roundOutput"),e.materialManager.getProgram(Tr,o)}function Sr(t,e,r){N(t,e,r),y(e);const{domainRange:s}=t.rasterFunction.parameters;e.setUniform2fv("u_domainRange",s)}const ae={createProgram:Pr,bindTextureAndUniforms:Sr},Ur={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/mask",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Rr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.bandCount>1?["multiBand"]:[];return r.materialManager.getProgram(Ur,i)}function Ir(t,e,r){x(t,e,r),y(e);const{includedRanges:s,noDataValues:i}=t.rasterFunction.parameters;e.setUniform1fv("u_includedRanges",s),e.setUniform1fv("u_noDataValues",i)}const Fr={createProgram:Rr,bindTextureAndUniforms:Ir},Cr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/ndvi",attributes:new Map([["a_position",0],["a_texcoord",1]])};function zr(t,e){const{painter:r,rasterFunction:s}=t,i=s.parameters.scaled?["scaled"]:[];return r.materialManager.getProgram(Cr,i)}function Mr(t,e,r){x(t,e,r),y(e);const{bandIndexMat3:s}=t.rasterFunction.parameters;e.setUniformMatrix3fv("u_bandIndexMat3",s)}const Vr={createProgram:zr,bindTextureAndUniforms:Mr},Br={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/remap",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Gr(t,e){return t.painter.materialManager.getProgram(Br,[])}function Lr(t,e,r){x(t,e,r),y(e);const{noDataRanges:s,rangeMaps:i,allowUnmatched:a,clampRange:n}=t.rasterFunction.parameters;e.setUniform1fv("u_noDataRanges",s),e.setUniform1fv("u_rangeMaps",i),e.setUniform1f("u_unmatchMask",a?1:0),e.setUniform2fv("u_clampRange",n)}const Or={createProgram:Gr,bindTextureAndUniforms:Lr},kr={vsPath:"raster/common",fsPath:"raster/reproject",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Dr(t,e){const{painter:r}=t,s=[],{interpolation:i,transformGrid:a}=e,n=t.rasterFunction?.parameters;return i==="cubic"?s.push("bicubic"):i==="bilinear"&&(s.push("bilinear"),n?.requireNNEdge&&s.push("nnedge")),a&&(s.push("applyProjection"),a.spacing[0]===1&&s.push("lookupProjection")),r.materialManager.getProgram(kr,s)}function Er(t,e,r){const{names:s,textures:i}=r.getTextures({forProcessing:!0});U(t.context,e,s,i),e.setUniform1f("u_scale",1),e.setUniform2fv("u_offset",[0,0]),e.setUniform2fv("u_coordScale",[1,1]),e.setUniformMatrix3fv("u_dvsMat3",[2,0,0,0,2,0,-1,-1,0]),e.setUniform1i("u_flipY",0),e.setUniform1f("u_opacity",1);const{width:a,height:n,source:o,transformGrid:l}=r;e.setUniform2fv("u_srcImageSize",[o.width,o.height]),e.setUniform2fv("u_targetImageSize",[a,n]),e.setUniform2fv("u_transformSpacing",l?l.spacing:Y),e.setUniform2fv("u_transformGridSize",l?l.size:Y)}const Ar={createProgram:Dr,bindTextureAndUniforms:Er},jr={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/slope",attributes:new Map([["a_position",0],["a_texcoord",1]])};function qr(t,e){const{painter:r,rasterFunction:s}=t,{slopeType:i,isOutputRounded:a}=s.parameters,n=[];return i==="percent-rise"&&n.push("percentRise"),a&&n.push("roundOutput"),r.materialManager.getProgram(jr,n)}function Wr(t,e,r){x(t,e,r),y(e);const s=r.getRasterTextureSize();e.setUniform2fv("u_srcImageSize",s);const i=r.getRasterCellSize();e.setUniform2fv("u_cellSize",i);const{zFactor:a,slopeType:n,pixelSizePower:o,pixelSizeFactor:l}=t.rasterFunction.parameters;e.setUniform1f("u_zFactor",a),e.setUniform1f("u_pixelSizePower",n==="adjusted"?o:0),e.setUniform1f("u_pixelSizeFactor",n==="adjusted"?l:0)}const Nr={createProgram:qr,bindTextureAndUniforms:Wr},$r={vsPath:"raster/rfx/vs",fsPath:"raster/rfx/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])};function Qr(t,e){const{useGamma:r,bandCount:s,isOutputRounded:i}=t.rasterFunction.parameters,a=[];return r&&a.push("useGamma"),s>1&&a.push("multiBand"),i&&a.push("roundOutput"),t.painter.materialManager.getProgram($r,a)}function Hr(t,e,r){x(t,e,r),y(e);const{width:s,height:i}=r,a=t.rasterFunction.parameters;e.setUniform2fv("u_srcImageSize",[s,i]),e.setUniform1f("u_minOutput",a.outMin),e.setUniform1f("u_maxOutput",a.outMax),e.setUniform1fv("u_factor",a.factor),e.setUniform1fv("u_minCutOff",a.minCutOff),e.setUniform1fv("u_maxCutOff",a.maxCutOff),e.setUniform1fv("u_gamma",a.gamma),e.setUniform1fv("u_gammaCorrection",a.gammaCorrection)}const Zr={createProgram:Qr,bindTextureAndUniforms:Hr},g=new Map;function de(t,e){const r=new Qe;return r.width=t,r.height=e,r.internalFormat=Oe.RGBA32F,r.samplingMode=A.NEAREST,r.dataType=ke.FLOAT,r.isImmutable=!0,r.wrapMode=De.CLAMP_TO_EDGE,r}function Jr(t,e,r,s){const{context:i,requestRender:a,allowDelayedRender:n}=t,o=s.createProgram(t,r);return n&&a!=null&&!o.compiled?(a(),null):(i.bindFramebuffer(e),i.setViewport(0,0,e.width,e.height),i.useProgram(o),o)}function Yr(t){return g.get(t.toLowerCase())}function Kr(t,e,r,s){const i=t.rasterFunction.name.toLowerCase(),a=i==="reproject"?Ar:Yr(i);if(a==null)return;const n=Jr(t,r,s,a);if(!n)return;a.bindTextureAndUniforms(t,n,s);const{interpolation:o}=s;i==="reproject"&&(s.interpolation="nearest"),e.draw();const[l,c]=s.getRasterTextureSize(i==="reproject"),d=de(l,c),u=new He(t.context,d);if(r.copyToTexture(0,0,l,c,0,0,u),i==="reproject")s.rasterTexture=u,s.projected=!0,s.interpolation=o;else{const m=t.hasBranches?t.rasterFunction.id:0;s.functionTextures[m]=u}}g.set("arithmetic",ae),g.set("aspect",Vt),g.set("bandarithmetic",Ot),g.set("colormaptorgb",At),g.set("computechange",Zt),g.set("compositeband",Nt),g.set("convolution",sr),g.set("contrastbrightness",Xt),g.set("curvature",or),g.set("extractband",hr),g.set("statistics",fr),g.set("grayscale",xr),g.set("hillshade",ie),g.set("shadedrelief",ie),g.set("local",ae),g.set("mask",Fr),g.set("ndvi",Vr),g.set("remap",Or),g.set("slope",Nr),g.set("stretch",Zr);class Xr extends Ze{constructor(){super(...arguments),this.name="raster",this._quad=null,this._rendererUniformInfos=new Map,this._fbo=null}dispose(){F(this._quad),F(this._fbo)}prepareState(e){const{context:r,renderPass:s}=e,i=s==="raster";r.setBlendingEnabled(!i),r.setBlendFunctionSeparate(G.ONE,G.ONE_MINUS_SRC_ALPHA,G.ONE,G.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0),r.setStencilWriteMask(0),r.setStencilTestEnabled(!i)}draw(e,r){if(!pt(r)||r.suspended)return;const{renderPass:s}=e;if(s!=="raster-bitmap")return s==="raster"?this._process(e,r):void this._drawBitmap(e,r,!0);this._drawBitmap(e,r)}_process(e,r){const{rasterFunction:s}=e,i=s.name==="Reproject";if(!(i?!(r.rasterTexture&&r.projected):!r.processed))return;const{timeline:a,context:n}=e;a.begin(this.name);const o=n.getBoundFramebufferObject(),l=n.getViewport();i||(r.processedTexture=F(r.processedTexture)),n.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),this._initQuad(n);const[c,d]=r.getRasterTextureSize(i),{isStandardRasterTileSize:u,fbo:m}=this._getRasterFBO(n,c,d);Kr(e,this._quad,m,r),u||m.dispose(),n.bindFramebuffer(o),n.setViewport(l.x,l.y,l.width,l.height),a.end(this.name)}_drawBitmap(e,r,s=!1){const{timeline:i,context:a}=e;if(i.begin(this.name),a.setStencilFunction(J.EQUAL,r.stencilRef,255),r.updateTexture(e),s&&!r.processedTexture){if(r.updateProcessedTexture(),!r.processedTexture)return void i.end(this.name);r.processed=!0}this._initBitmapCommonUniforms(r);const n=r.symbolizerParameters.type,o=Rt(n),{requestRender:l,allowDelayedRender:c}=e,{defines:d,program:u}=o.createProgram(e,r,r.projected&&s);if(c&&l!=null&&!u.compiled)return void l();a.useProgram(u);const m=this._getUniformInfos(n,a,u,d);this._quad||(this._quad=new K(a,[0,0,1,0,0,1,1,1])),o.bindTextureAndUniforms(e,u,r,m,s),this._quad.draw(),i.end(this.name)}_initBitmapCommonUniforms(e){if(!e.commonUniforms){const r=$e(1,[0,0]),{transformGrid:s,width:i,height:a}=e,n=je(s,[i,a],[e.source.width,e.source.height],1,!1);e.commonUniforms={...r,...n,u_coordScale:e.coordScale}}}_getRasterFBO(e,r,s){const i=r===C&&s===C;return i?(this._fbo||(this._fbo=this._createNewFBO(e,r,s)),{isStandardRasterTileSize:i,fbo:this._fbo}):{isStandardRasterTileSize:i,fbo:this._createNewFBO(e,r,s)}}_createNewFBO(e,r,s){const i=de(r,s);return new Je(e,i)}_initQuad(e){this._quad||(this._quad=new K(e,[0,0,1,0,0,1,1,1]))}_getUniformInfos(e,r,s,i){const a=i.length>0?e+"-"+i.join("-"):e;if(this._rendererUniformInfos.has(a))return this._rendererUniformInfos.get(a);const n=qe(r,s);return this._rendererUniformInfos.set(a,n),n}}class es extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.bitmap=null,this.bitmap=new mt(o,null,null),this.bitmap.coordScale=[a,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}let ts=class extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(t){const e=this._getTileBounds(t),[r,s]=this.tileInfoView.tileInfo.size,i=this.tileInfoView.getTileResolution(t.level);return new es(t,i,e[0],e[3],r,s)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"imagery (tile)",brushes:[Xr],target:()=>this.children.map(r=>r.bitmap),drawPhase:k.MAP});return[...super.prepareRenderPasses(t),e]}doRender(t){if(!this.visible||t.drawPhase!==k.MAP)return;const{rasterFunctionChain:e}=this;if(!e)return t.renderPass="raster-bitmap",void super.doRender(t);if(!e.hasFocalFunction){const[r,s]=this.tileInfoView.tileInfo.size;t.renderPass="raster",t.rasterFunction={name:"Reproject",parameters:{targetImageSize:[r,s],requireNNEdge:e.isSourceSingleBand},pixelType:"f32",id:0,isNoopProcess:!1},super.doRender(t)}if(e?.functions.length){const{functions:r,hasBranches:s}=e;for(let i=0;i{const e=this._rasterFunctionState;if(t.reprocess&&(await this._updatingHandles.addPromise(this.layer.updateRasterFunction()),this.updateRasterFunctionParameters()),!this.previousLOD||this.layerView.suspended)return;const r=this._rasterFunctionState,{type:s}=this;return t.refetch||s!=="raster"&&t.reprocess||r==="cpu"||e==="cpu"?this._updatingHandles.addPromise(this.doRefresh()):this._updatingHandles.addPromise(this._redrawImage(t.signal))})}destroy(){this._updatingHandles.destroy()}get useWebGLForProcessing(){return this._get("useWebGLForProcessing")??!0}set useWebGLForProcessing(t){this._set("useWebGLForProcessing",t)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")??!0}set useProgressiveUpdate(t){if(this._tileStrategy&&this.useProgressiveUpdate!==t){this._tileStrategy.destroy(),this.container.removeAllChildren();const e=this._getCacheSize(t);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:r=>this.acquireTile(r),releaseTile:r=>this.releaseTile(r),cacheSize:e,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",t),this.layerView.requestUpdate()}}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume();const{extent:e,resolution:r,scale:s}=t.state,i=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const a=this._srcResolutions[i.level],n=e.toJSON?e:be.fromJSON(e);ee(this._blockCacheRegistryUrl,this._blockCacheRegistryId,n,r,a,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,this.previousLOD?.level!==i.level&&(this.previousLOD=i,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 t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(t),this.layerView.requestUpdate()}get updating(){return this._globalUpdateRequested||this._updatingHandles?.updating}attach(){const t=lt();this._maxIndexedColormapSize=4*(t.maxTextureSize||4096),this._initializeTileInfo(),this._tileInfoView=new at(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new nt({tileInfoView:this._tileInfoView,concurrency:e,process:(s,i)=>this._fetchTile(s,i),priority:ot.MAPVIEW_FETCH_QUEUE,scheduler:this.scheduler});const r=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new se({cachePolicy:"purge",acquireTile:s=>this.acquireTile(s),releaseTile:s=>this.releaseTile(s),cacheSize:r,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(t){const e=this.container.createTile(t);return this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,e}releaseTile(t){this._fetchQueue.abort(t.key.id),this.container.removeChild(t),t.once("detach",()=>{t.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(t=null){const e=t==null||t.join(",")===this._tileInfoView.tileInfo.size.join(",");if(e&&this._emptyTilePixelBlock!=null)return this._emptyTilePixelBlock;t=t||this._tileInfoView.tileInfo.size;const[r,s]=t,i=new Ke({width:r,height:s,pixels:[new Uint8Array(r*s)],mask:new Uint8Array(r*s),pixelType:"u8"});return e&&(this._emptyTilePixelBlock=i),i}_getBandIds(){if(!("rasterFunctionChain"in this.container)||!this.container.rasterFunctionChain)return this.layer.bandIds;const{bandIds:t,raster:e}=this.layer,r="rasterFunction"in e?e.rasterFunction.rawInputBandIds:null;return t?.length&&r?.length&&e.rasterInfo.bandCount!==1?t.map(s=>r[Math.min(s,r.length-1)]):t||r}updateRasterFunctionParameters(){}_fetchTile(t,e){const r=this._getFetchOptions(t.level,e.signal);return this.fetchTile(t,r)}_getFetchOptions(t,e){const r=this.canUseWebGLForProcessing(),{layerView:s}=this,{tileInfo:i}=s,a=!i.isWrappable&&rt(s.view.spatialReference)!=null,n=r&&this.layer.raster.hasUniqueSourceStorageInfo;return{allowPartialFill:!0,datumTransformation:s.datumTransformation,interpolation:r?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:n,skipRasterFunction:this.type==="raster"&&this.container.rasterFunctionChain!=null,signal:e,srcResolution:this._srcResolutions[t],timeExtent:s.timeExtent,tileInfo:i,disableWrapAround:a}}_getCacheSize(t){return t?40:0}_initializeTileInfo(){const{layerView:t}=this,e=t.view.spatialReference;if(this._canUseLayerLODs()){const{origin:c,lods:d}=this.layer.tileInfo,u=d.map(({scale:f})=>f),m=X.create({spatialReference:e,size:C,scales:u,origin:c});return t.set("tileInfo",m),void(this._srcResolutions=d.map(({resolution:f})=>({x:f,y:f})))}const{scales:r,srcResolutions:s,isCustomTilingScheme:i}=st(this.layer.serviceRasterInfo,e,{tileSize:C,alignGlobalDatasetWithAGOL:!0,limitToSrcResolution:!1}),a=X.create({spatialReference:e,size:C,scales:r}),n=a.origin.x===0;we(t.fullExtent);const{xmin:o,ymax:l}=t.fullExtent;(n||i&&a.origin.x>o)&&(a.origin=new ve({x:o,y:l,spatialReference:e})),this._isCustomTilingScheme=i,t.set("tileInfo",a),this._srcResolutions=s??[]}_canUseLayerLODs(){const{layer:t,layerView:e}=this;if(t.raster.tileType!=="Map")return!1;const{lods:r}=t.tileInfo,s=e.view.constraints?.effectiveLODs;return s?.length===r.length&&s.every(({scale:i},a)=>Math.abs(i-r[a].scale)<.001)}_computeFetchConcurrency(){const{blockBoundary:t}=this.layer.serviceRasterInfo.storageInfo,e=t[t.length-1];return(e.maxCol-e.minCol+1)*(e.maxRow-e.minRow+1)>64?2:10}async _enqueueTileFetch(t,e){if(!this._fetchQueue.has(t.key.id)){try{const r=await this._fetchQueue.push(t.key),s=this._getBandIds();let i=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){i=!1;try{await this._redrawImage(this._abortController?.signal)}catch(o){R(o)&&I.getLogger(this).error(o)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const a=this._tileInfoView.getTileCoords(rs,t.key),n=this._tileInfoView.getTileResolution(t.key);await this.updateTileSource(t,{source:r,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:i,bandIds:s,coords:a,resolution:n}),t.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(t)}catch(r){R(r)||I.getLogger(this).error(r)}this.layerView.requestUpdate()}}async _redrawImage(t){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(t):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const e=this.container.children.map(async r=>this.updateTileSymbolizerParameters(r,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await Promise.allSettled(e),this.container.requestRender()}async _updateGlobalSymbolizerParams(t){const e=this._getFetchOptions(this.previousLOD.level,t),r=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,{...e,interpolation:"nearest",requestRawData:!1,skipRasterFunction:!1});if(!r?.pixelBlock)return;const{resolution:s}=this.previousLOD,i=this._getBandIds(),a=this.layer.symbolizer.generateWebGLParameters({pixelBlock:r.pixelBlock.extractBands(i),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:s,y:s},bandIds:i});!this.canUseWebGLForProcessing()&&a&&a.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(a.factor=a.factor.map(n=>255*n),a.outMin=Math.round(255*a.outMin),a.outMax=Math.round(255*a.outMax)),this._globalSymbolizerParams=a}_updateSymbolizerParams(){const{resolution:t}=this.previousLOD,e=this._getBandIds();this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:t,y:t},bandIds:e})}_updateBlockCacheRegistry(t=!1){const{layer:e,layerView:r}=this,{raster:s}=e,{multidimensionalDefinition:i}=e.normalizeRasterFetchOptions({multidimensionalDefinition:e.multidimensionalDefinition,timeExtent:r.timeExtent}),a=s.rasterInfo.multidimensionalInfo?s.getSliceIndex(i):null,n=et(s.rasterId,a);if(n!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&te(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=tt(n,s.rasterInfo),t){const{view:o}=r,l=this._tileInfoView.getClosestInfoForScale(o.scale),c=this._srcResolutions[l.level];ee(n,this._blockCacheRegistryId,o.extent,o.resolution,c,s.ioConfig.sampling)}this._blockCacheRegistryUrl=n}}async doRefresh(){if(!this.attached||!this.previousLOD||this.layerView.suspended)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const t=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.refresh(e=>t.push(this._enqueueTileFetch(e))),await this._updatingHandles.addPromise(Promise.allSettled(t))}};h([p()],b.prototype,"_globalUpdateRequested",void 0),h([p()],b.prototype,"attached",void 0),h([p()],b.prototype,"container",void 0),h([p()],b.prototype,"layer",void 0),h([p()],b.prototype,"layerView",void 0),h([p()],b.prototype,"scheduler",void 0),h([p()],b.prototype,"type",void 0),h([p()],b.prototype,"useWebGLForProcessing",null),h([p()],b.prototype,"useProgressiveUpdate",null),h([p()],b.prototype,"timeExtent",void 0),h([p()],b.prototype,"updating",null),b=h([M("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],b);let P=class extends b{constructor(){super(...arguments),this.type="raster"}attach(){super.attach(),this.container=new ts(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this.updateRasterFunctionParameters()}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){const{symbolizer:t}=this.layer,e=t.lookup?.colormapLut?.indexedColormap,r=e&&e.length>this._maxIndexedColormapSize;return this.useWebGLForProcessing&&t.canRenderInWebGL&&!r&&!(this.layer.interpolation==="majority"&&oe(this.layer))}fetchTile(t,e){return this.layer.fetchTile(t.level,t.row,t.col,e)}updateRasterFunctionParameters(){const{clips:t,view:e}=this.layerView;this._geometry!=null&&t.remove(this._geometry);const{raster:r,type:s}=this.layer;if(r.datasetFormat==="Function"){const f=r.getClippingGeometry(e.spatialReference);if(f){const _=new Fe({geometry:f});t.add(_),this._geometry=_}}const{container:i}=this;if(r.datasetFormat!=="Function"||s==="wcs")return i.rasterFunctionChain=null,i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=!0,_.processed=!1,_.projected&&(_.invalidateTexture(),_.rasterTexture=null))}),void(this._rasterFunctionState="na");const a=this._rasterFunctionState,{rasterFunction:n,primaryRasters:o}=r,l=n.supportsGPU&&(!o||o.rasters.length<=1),c=l?n.flatWebGLFunctionChain:null,{renderer:d}=this.layer,u=!l||!c?.functions.length||d?.type==="raster-stretch"&&d.dynamicRangeAdjustment||!this.canUseWebGLForProcessing();i.rasterFunctionChain=u?null:c;const m=n==null?"na":i.rasterFunctionChain?"gpu":"cpu";i.children.forEach(f=>{const{bitmap:_}=f;_&&(_.suspended=a!==m,_.processed=!1,_.processedTexture=null)}),this._rasterFunctionState=m}async updateTileSource(t,e){const r=this._getBandIds(),s=this._getLayerInterpolation(),i=this.canUseWebGLForProcessing(),{source:a,globalSymbolizerParams:n,suspended:o,coords:l,resolution:c}=e,d=this.layerView.hasTilingEffects?n:e.symbolizerParams,{bitmap:u}=t;if([u.x,u.y]=l,u.resolution=c,a?.pixelBlock!=null){const m={extent:a.extent,pixelBlock:a.pixelBlock,srcPixelSize:a.srcTilePixelSize};if(u.rawPixelData=m,i)u.source=a.pixelBlock,u.isRendereredSource=!1;else{const f=await this.layer.applyRenderer(m,n?.type==="stretch"?n:void 0);u.source=f,u.isRendereredSource=!0}u.symbolizerParameters=i?d:null,u.transformGrid=i?a.transformGrid:null}else{const m=this.createEmptyTilePixelBlock();u.source=m,u.symbolizerParameters=i?d:null,u.transformGrid=null}u.bandIds=i?r:null,u.width=this._tileInfoView.tileInfo.size[0],u.height=this._tileInfoView.tileInfo.size[1],u.interpolation=s,u.suspended=o,u.invalidateTexture()}async updateTileSymbolizerParameters(t,e){const{local:r,global:s}=e,i=this._getBandIds(),a=this._getLayerInterpolation(),n=this.canUseWebGLForProcessing(),{bitmap:o}=t,{rawPixelData:l}=o;n||l==null?(o.isRendereredSource&&l!=null&&(o.source=l.pixelBlock),o.isRendereredSource=!1):(o.source=await this.layer.applyRenderer(l,s?.type==="stretch"?s:void 0),o.isRendereredSource=!0),o.symbolizerParameters=n?this.layerView.hasTilingEffects?s:r:null,o.bandIds=n?i:null,o.interpolation=a,o.suspended=!1}_getLayerInterpolation(){const{interpolation:t,renderer:e}=this.layer;if(!e)return t;const r=e.type;return r==="raster-colormap"||r==="unique-value"?"nearest":e.type==="raster-stretch"&&e.colorRamp!=null?t==="bilinear"||t==="cubic"?"bilinear":"nearest":t}};h([p()],P.prototype,"container",void 0),h([p()],P.prototype,"layer",void 0),h([p()],P.prototype,"type",void 0),P=h([M("esri.views.2d.layers.imagery.ImageryTileView2D")],P);const ss=P;class is extends ue{constructor(e,r,s,i,a,n,o=null){super(e,r,s,i,a,n),this.tileData=new Re(o),this.tileData.coordScale=[a,n],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(e){this.tileData.stencilRef=e}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}setTransform(e){super.setTransform(e);const r=this.resolution/(e.resolution*e.pixelRatio),s=this.transforms.tileMat3,[i,a]=this.tileData.offset,n=[this.x+i*this.resolution,this.y-a*this.resolution],[o,l]=e.toScreenNoRotation([0,0],n),{symbolTileSize:c}=this.tileData.symbolizerParameters,d=Math.round((this.width-this.tileData.offset[0])/c)*c,u=Math.round((this.height-this.tileData.offset[1])/c)*c,m=d/this.rangeX*r,f=u/this.rangeY*r;Me(s,m,0,0,0,f,0,o,l,1),le(this.transforms.displayViewScreenMat3,e.displayViewMat3,s),this.tileData.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}class as extends ce{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(e){const r=this.tileInfoView.getTileBounds(ne(),e),[s,i]=this.tileInfoView.tileInfo.size,a=this.tileInfoView.getTileResolution(e.level);return new is(e,a,r[0],r[3],s,i)}prepareRenderPasses(e){const r=e.registerRenderPass({name:"imagery (vf tile)",brushes:[Ue],target:()=>this.children.map(s=>s.tileData),drawPhase:k.MAP});return[...super.prepareRenderPasses(e),r]}doRender(e){this.visible&&e.drawPhase===k.MAP&&this.symbolTypes.forEach(r=>{e.renderPass=r,super.doRender(e)})}}let S=class extends b{constructor(){super(...arguments),this._handle=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(t,e){e={...e,interpolation:"nearest",requestProjectedLocalDirections:!0};const r=await this.layer.fetchTile(t.level,t.row,t.col,e);return this.layer.serviceRasterInfo?.dataType==="vector-magdir"&&r?.pixelBlock&&(r.pixelBlock=await this.layer.convertVectorFieldData(r.pixelBlock,e)),r}updateTileSource(t,e){const r=e.symbolizerParams,{tileData:s}=t;s.key=t.key,s.width=this._tileInfoView.tileInfo.size[0],s.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:i}=r,{source:a}=e;if(s.offset=this._getTileSymbolOffset(s.key,i),a?.pixelBlock!=null){const n={extent:a.extent,pixelBlock:a.pixelBlock};s.rawPixelData=n,s.symbolizerParameters=r,s.source=this._sampleVectorFieldData(a.pixelBlock,r,s.offset)}else{const n=[Math.round((this._tileInfoView.tileInfo.size[0]-s.offset[0])/i),Math.round((this._tileInfoView.tileInfo.size[1]-s.offset[1])/i)],o=this.createEmptyTilePixelBlock(n);s.source=o,s.symbolizerParameters=r}return s.invalidateVAO(),Promise.resolve()}updateTileSymbolizerParameters(t,e){const r=e.local,{symbolTileSize:s}=r,{tileData:i}=t;i.offset=this._getTileSymbolOffset(i.key,s);const a=i.symbolizerParameters.symbolTileSize;i.symbolizerParameters=r;const n=i.rawPixelData?.pixelBlock;return n!=null&&a!==s&&(i.source=this._sampleVectorFieldData(n,i.symbolizerParameters,i.offset)),Promise.resolve()}attach(){super.attach(),this.container=new as(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=L(()=>this.layer.renderer,t=>this._updateSymbolType(t))}detach(){super.detach(),this.container.removeAllChildren(),this._handle?.remove(),this._handle=null,this.container=null}_getTileSymbolOffset(t,e){const r=t.col*this._tileInfoView.tileInfo.size[0]%e,s=t.row*this._tileInfoView.tileInfo.size[1]%e;return[r>e/2?e-r:-r,s>e/2?e-s:-s]}_sampleVectorFieldData(t,e,r){const{symbolTileSize:s}=e;return Xe(t,"vector-uv",s,r)}_updateSymbolType(t){t.type==="vector-field"&&(this.container.symbolTypes=t.style==="wind-barb"?["scalar","triangle"]:t.style==="simple-scalar"?["scalar"]:["triangle"])}};h([p()],S.prototype,"container",void 0),h([p()],S.prototype,"layer",void 0),h([p()],S.prototype,"type",void 0),S=h([M("esri.views.2d.layers.imagery.VectorFieldTileView2D")],S);const ns=S,os=t=>{let e=class extends t{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.tileInfo=null}get fullExtent(){try{return this.layer.loaded?this._getFullExtent():null}catch{return null}}get timeExtent(){return ut(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){try{return this.layer.loaded?it(this.layer.fullExtent,this.view.spatialReference,!0):null}catch{return null}}supportsSpatialReference(r){try{return!this.layer.loaded||!!re(this.layer.serviceRasterInfo,r)}catch{return!1}}async fetchPopupFeaturesAtLocation(r,s){const{layer:i}=this;if(!r)throw new Te("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:i});const{popupEnabled:a}=i,n=ct(i,s);if(!a||n==null)return[];const o=[],{value:l,magdirValue:c,processedValue:d}=await i.identify(r,{timeExtent:this.timeExtent,signal:s?.signal});let u="";if(l?.length){u=i.type==="imagery-tile"&&i.hasStandardTime()&&l[0]!=null?l.map(D=>i.getStandardTimeValue(D)).join(", "):l.join(", ");const m={ObjectId:0},f="Raster.ServicePixelValue";m[f]=i.type==="imagery-tile"&&i.raster.datasetFormat==="Function"?d?.join(", "):u,m[f+".Raw"]=u;const _=i.raster?.rasterInfo??i.serviceRasterInfo,$=_?.attributeTable;if($!=null){const{fields:D,features:pe}=$,H=D.find(({name:v})=>v.toLowerCase()==="value"),fe=m[f],V=H?pe.find(v=>String(v.attributes[H.name])===fe):null;if(V)for(const v in V.attributes)V.attributes.hasOwnProperty(v)&&(m[this._rasterFieldPrefix+v]=V.attributes[v])}const Q=_?.dataType;Q!=="vector-magdir"&&Q!=="vector-uv"||(m["Raster.Magnitude"]=c?.[0],m["Raster.Direction"]=c?.[1]);const me=new Pe({geometry:this.fullExtent?.clone(),attributes:m,layer:i,sourceLayer:i});o.push(me)}return o}_getFullExtent(){return re(this.layer.serviceRasterInfo,this.view.spatialReference)}};return h([p()],e.prototype,"fullExtent",null),h([p()],e.prototype,"layer",void 0),h([p({readOnly:!0})],e.prototype,"timeExtent",null),h([p()],e.prototype,"tileInfo",void 0),h([p({readOnly:!0})],e.prototype,"hasTilingEffects",null),h([p()],e.prototype,"datumTransformation",null),e=h([M("esri.views.layers.ImageryTileLayerView")],e),e};let T=class extends os(ht(Ie(Ce))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(t){this._useWebGLForProcessing=t,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=t)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(t){this._useProgressiveUpdate=t,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=t)}get displayParameters(){const{layer:t}=this,e=this._get("displayParameters");return t.renderer?{bandIds:t.bandIds,renderer:t.renderer,interpolation:t.interpolation,multidimensionalDefinition:t.multidimensionalDefinition,rasterFunction:t.type==="imagery-tile"?t.rasterFunction:null}:e}update(t){this.subview?.update(t),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.addAttachHandles([L(()=>this.displayParameters,(t,e)=>{const r=t.interpolation!==e?.interpolation&&(t.interpolation==="majority"||e?.interpolation==="majority")&&oe(this.layer),s=t.renderer!==e?.renderer&&this._getSubviewType(e?.renderer)!==this._getSubviewType(t.renderer);s&&this._updateSubview();const i=t.multidimensionalDefinition!==e?.multidimensionalDefinition,a=t.rasterFunction!==e?.rasterFunction,n=a&&!this._useWebGLForProcessing,o=i||r||s||n;this.subview.redrawOrRefetch({refetch:o,reprocess:a}).catch(l=>{R(l)||I.getLogger(this).error(l)}),this.notifyChange("updating")}),L(()=>this.layer.multidimensionalSubset??null,(t,e)=>{const{multidimensionalDefinition:r}=this.layer;r!=null&&Z(r,t)!==Z(r,e)&&(this.subview.redrawOrRefetch({refetch:!0}).catch(s=>{R(s)||I.getLogger(this).error(s)}),this.notifyChange("updating"))},ge),L(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch({refetch:!0}).catch(t=>{R(t)||I.getLogger(this).error(t)})},_e)])}detach(){this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}doRefresh(){return this.subview?this.subview.doRefresh():Promise.resolve()}_updateSubview(){const{renderer:t}=this.layer;if(!t)return;const e=this._getSubviewType(t);if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),this.subview?.destroy(),this.subview=null}const{layer:r}=this;let s;if(s=e==="rasterVF"?new ns({layer:r,layerView:this,scheduler:this.scheduler}):e==="flow"?new Se({layer:r,layerView:this,scheduler:this.scheduler}):new ss({layer:r,layerView:this,scheduler:this.scheduler}),"useWebGLForProcessing"in s&&(s.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in s&&(s.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in s){const{subview:i}=this;s.previousLOD=i&&"previousLOD"in i?i.previousLOD:null}this._attachSubview(s),this.subview=s,this.requestUpdate()}_attachSubview(t){t&&!t.attached&&(t.attach(),t.attached=!0,this.container.addChildAt(t.container,0))}_detachSubview(t){t?.attached&&(this.container.removeChild(t.container),t.detach(),t.attached=!1)}_getSubviewType(t){const e=t?.type;return e==="vector-field"?"rasterVF":e==="flow"?"flow":"raster"}};h([p()],T.prototype,"subview",void 0),h([p()],T.prototype,"useWebGLForProcessing",null),h([p()],T.prototype,"useProgressiveUpdate",null),h([p({readOnly:!0})],T.prototype,"displayParameters",null),T=h([M("esri.views.2d.layers.ImageryTileLayerView2D")],T);const Di=T;export{Di as default}; diff --git a/custom-toc-highlight/assets/Indices-DEr2HrWx-BuNk6xPZ.js b/custom-toc-highlight/assets/Indices-DEr2HrWx-cFTwC5-9.js similarity index 94% rename from custom-toc-highlight/assets/Indices-DEr2HrWx-BuNk6xPZ.js rename to custom-toc-highlight/assets/Indices-DEr2HrWx-cFTwC5-9.js index 3dc3efd8..d540b3da 100644 --- a/custom-toc-highlight/assets/Indices-DEr2HrWx-BuNk6xPZ.js +++ b/custom-toc-highlight/assets/Indices-DEr2HrWx-cFTwC5-9.js @@ -1 +1 @@ -import{hc as u,d2 as f}from"./story-BfX8CRfG.js";function c(n){if(u(n)){if(n.length(t=t&&l===0,e=e&&l===A,!t&&!e)),t?h(n.length):e?w(n.length):u(n)||n.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?y(n):n}function y(n){let t=!0;for(const e of n){if(e>=65536)return u(n)?new Uint32Array(n):n;e>=256&&(t=!1)}return t?new Uint8Array(n):new Uint16Array(n)}function g(n){return n<=f?new Array(n):n<=65536?new Uint16Array(n):new Uint32Array(n)}let r=(()=>{const n=new Uint32Array(131072);for(let t=0;t{const n=new Uint16Array(65536);for(let t=0;tr.length){const t=Math.max(2*r.length,n);r=new Uint32Array(t);for(let e=0;ei.length){const t=Math.max(2*i.length,n);i=new Uint8Array(t)}return new Uint8Array(i.buffer,0,n)}export{w as A,g as h,c as w}; +import{hc as u,d2 as f}from"./story-Doly9N9p.js";function c(n){if(u(n)){if(n.length(t=t&&l===0,e=e&&l===A,!t&&!e)),t?h(n.length):e?w(n.length):u(n)||n.BYTES_PER_ELEMENT!==Uint16Array.BYTES_PER_ELEMENT?y(n):n}function y(n){let t=!0;for(const e of n){if(e>=65536)return u(n)?new Uint32Array(n):n;e>=256&&(t=!1)}return t?new Uint8Array(n):new Uint16Array(n)}function g(n){return n<=f?new Array(n):n<=65536?new Uint16Array(n):new Uint32Array(n)}let r=(()=>{const n=new Uint32Array(131072);for(let t=0;t{const n=new Uint16Array(65536);for(let t=0;tr.length){const t=Math.max(2*r.length,n);r=new Uint32Array(t);for(let e=0;ei.length){const t=Math.max(2*i.length,n);i=new Uint8Array(t)}return new Uint8Array(i.buffer,0,n)}export{w as A,g as h,c as w}; diff --git a/custom-toc-highlight/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-v3TYApnj.js b/custom-toc-highlight/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-B81HIVpX.js similarity index 77% rename from custom-toc-highlight/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-v3TYApnj.js rename to custom-toc-highlight/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-B81HIVpX.js index f986e6cf..00798f88 100644 --- a/custom-toc-highlight/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-v3TYApnj.js +++ b/custom-toc-highlight/assets/IntegratedMesh3DTilesLayer-BEcgXCkk-B81HIVpX.js @@ -1 +1 @@ -import{J as g,n as A,B as _,hZ as u,dq as E,o as j,W as S,f as N,a1 as M,v as d,S as c,i as V,dg as v}from"./story-BfX8CRfG.js";import{m as k}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{r as z,j as p,Y as L,A as $,D,E as R,k as f}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{n as I}from"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import{D as U}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{n as X}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{a as W}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{E as q}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as F}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{S as G}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{$ as P,Z as K}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{k as T,R as Z,j as B}from"./elevationInfoUtils-mOZsPH2J-If61I1du.js";import"./main-ugzBrWNm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";let m=class extends W(q(F(G(k(C(X(U))))))){constructor(r){super(r),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.spatialReference=new g({wkid:4326,vcsWkid:115700}),this.fullExtent=new A(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0}set elevationInfo(r){this._set("elevationInfo",r),this._validateElevationInfo()}_verifyArray(r,i){if(!Array.isArray(r)||r.length7972671&&t[7]>7972671&&t[11]>7945940)return}const n=r.root?.transform,w=v();if(i.region&&this._verifyArray(i.region,6)){const t=i.region,l=_(t[0]),s=_(t[1]),o=t[4],a=_(t[2]),e=_(t[3]),y=t[5];this.fullExtent=new A({xmin:l,ymin:s,zmin:o,xmax:a,ymax:e,zmax:y,spatialReference:this.spatialReference})}else if(i.sphere&&this._verifyArray(i.sphere,4)){const t=i.sphere,l=u(t[0],t[1],t[2]),s=t[3]/Math.sqrt(3),o=v();z(o,l,u(s,s,s));const a=v();if(p(a,l,u(s,s,s)),n&&this._verifyArray(n,16)){const x=n;L(w,o,x),$(o,w),L(w,a,x),$(a,w)}I(o,E,0,o,g.WGS84,0),I(a,E,0,a,g.WGS84,0);const e=v(),y=v();D(e,o,a),R(y,o,a),this.fullExtent=new A({xmin:e[0],ymin:e[1],zmin:e[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}else if(i.box&&this._verifyArray(i.box,12)){const t=i.box,l=u(t[0],t[1],t[2]),s=u(t[3],t[4],t[5]),o=u(t[6],t[7],t[8]),a=u(t[9],t[10],t[11]),e=[];for(let h=0;h<8;++h)e.push(v());if(p(e[0],l,s),p(e[0],e[0],o),p(e[0],e[0],a),f(e[1],l,s),p(e[1],e[1],o),p(e[1],e[1],a),p(e[2],l,s),f(e[2],e[2],o),p(e[2],e[2],a),f(e[3],l,s),f(e[3],e[3],o),p(e[3],e[3],a),p(e[4],l,s),p(e[4],e[4],o),f(e[4],e[4],a),f(e[5],l,s),p(e[5],e[5],o),f(e[5],e[5],a),p(e[6],l,s),f(e[6],e[6],o),f(e[6],e[6],a),f(e[7],l,s),f(e[7],e[7],o),f(e[7],e[7],a),n&&this._verifyArray(n,16)){const h=n;for(let b=0;b<8;++b)L(e[b],e[b],h)}const y=u(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),x=u(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let h=0;h<8;++h)I(e[h],E,0,e[h],g.WGS84,0),D(x,x,e[h]),R(y,y,e[h]);this.fullExtent=new A({xmin:x[0],ymin:x[1],zmin:x[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}}async load(r){return this.addResolvingPromise(this._doLoad(r)),this}async _doLoad(r){const i=r!=null?r.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:n=>{if(n.typeKeywords?.includes("IntegratedMesh"))return!0;throw new j("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},r)}catch(n){S(n)}this.url&&await N(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(n=>{this._initFullExtent(n.data)},n=>{S(n)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(){const r=this.elevationInfo,i="Integrated mesh 3d tiles layers";T(M.getLogger(this),Z(i,"absolute-height",r)),T(M.getLogger(this),B(i,r))}};d([c({type:["IntegratedMesh3DTilesLayer"]})],m.prototype,"operationalLayerType",void 0),d([c({type:g})],m.prototype,"spatialReference",void 0),d([c({type:A})],m.prototype,"fullExtent",void 0),d([c(P)],m.prototype,"elevationInfo",null),d([c({type:["show","hide"]})],m.prototype,"listMode",void 0),d([c(K)],m.prototype,"url",void 0),d([c({readOnly:!0})],m.prototype,"type",void 0),d([c({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],m.prototype,"path",void 0),d([c({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"minScale",void 0),d([c({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"maxScale",void 0),m=d([V("esri.layers.IntegratedMesh3DTilesLayer")],m);const xe=m;export{xe as default}; +import{J as g,n as A,B as _,hZ as u,dq as E,o as j,W as S,f as N,a1 as M,v as d,S as c,i as V,dg as v}from"./story-Doly9N9p.js";import{m as k}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{r as z,j as p,Y as L,A as $,D,E as R,k as f}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{n as I}from"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import{D as U}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{n as X}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{a as W}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{E as q}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as F}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{S as G}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{$ as P,Z as K}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{k as T,R as Z,j as B}from"./elevationInfoUtils-mOZsPH2J-BlRQDLDN.js";import"./main-QGPoLsvl.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";let m=class extends W(q(F(G(k(C(X(U))))))){constructor(r){super(r),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.spatialReference=new g({wkid:4326,vcsWkid:115700}),this.fullExtent=new A(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0}set elevationInfo(r){this._set("elevationInfo",r),this._validateElevationInfo()}_verifyArray(r,i){if(!Array.isArray(r)||r.length7972671&&t[7]>7972671&&t[11]>7945940)return}const n=r.root?.transform,w=v();if(i.region&&this._verifyArray(i.region,6)){const t=i.region,l=_(t[0]),s=_(t[1]),o=t[4],a=_(t[2]),e=_(t[3]),y=t[5];this.fullExtent=new A({xmin:l,ymin:s,zmin:o,xmax:a,ymax:e,zmax:y,spatialReference:this.spatialReference})}else if(i.sphere&&this._verifyArray(i.sphere,4)){const t=i.sphere,l=u(t[0],t[1],t[2]),s=t[3]/Math.sqrt(3),o=v();z(o,l,u(s,s,s));const a=v();if(p(a,l,u(s,s,s)),n&&this._verifyArray(n,16)){const x=n;L(w,o,x),$(o,w),L(w,a,x),$(a,w)}I(o,E,0,o,g.WGS84,0),I(a,E,0,a,g.WGS84,0);const e=v(),y=v();D(e,o,a),R(y,o,a),this.fullExtent=new A({xmin:e[0],ymin:e[1],zmin:e[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}else if(i.box&&this._verifyArray(i.box,12)){const t=i.box,l=u(t[0],t[1],t[2]),s=u(t[3],t[4],t[5]),o=u(t[6],t[7],t[8]),a=u(t[9],t[10],t[11]),e=[];for(let h=0;h<8;++h)e.push(v());if(p(e[0],l,s),p(e[0],e[0],o),p(e[0],e[0],a),f(e[1],l,s),p(e[1],e[1],o),p(e[1],e[1],a),p(e[2],l,s),f(e[2],e[2],o),p(e[2],e[2],a),f(e[3],l,s),f(e[3],e[3],o),p(e[3],e[3],a),p(e[4],l,s),p(e[4],e[4],o),f(e[4],e[4],a),f(e[5],l,s),p(e[5],e[5],o),f(e[5],e[5],a),p(e[6],l,s),f(e[6],e[6],o),f(e[6],e[6],a),f(e[7],l,s),f(e[7],e[7],o),f(e[7],e[7],a),n&&this._verifyArray(n,16)){const h=n;for(let b=0;b<8;++b)L(e[b],e[b],h)}const y=u(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),x=u(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE);for(let h=0;h<8;++h)I(e[h],E,0,e[h],g.WGS84,0),D(x,x,e[h]),R(y,y,e[h]);this.fullExtent=new A({xmin:x[0],ymin:x[1],zmin:x[2],xmax:y[0],ymax:y[1],zmax:y[2],spatialReference:this.spatialReference})}}async load(r){return this.addResolvingPromise(this._doLoad(r)),this}async _doLoad(r){const i=r!=null?r.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:n=>{if(n.typeKeywords?.includes("IntegratedMesh"))return!0;throw new j("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},r)}catch(n){S(n)}this.url&&await N(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:i}).then(n=>{this._initFullExtent(n.data)},n=>{S(n)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(){const r=this.elevationInfo,i="Integrated mesh 3d tiles layers";T(M.getLogger(this),Z(i,"absolute-height",r)),T(M.getLogger(this),B(i,r))}};d([c({type:["IntegratedMesh3DTilesLayer"]})],m.prototype,"operationalLayerType",void 0),d([c({type:g})],m.prototype,"spatialReference",void 0),d([c({type:A})],m.prototype,"fullExtent",void 0),d([c(P)],m.prototype,"elevationInfo",null),d([c({type:["show","hide"]})],m.prototype,"listMode",void 0),d([c(K)],m.prototype,"url",void 0),d([c({readOnly:!0})],m.prototype,"type",void 0),d([c({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],m.prototype,"path",void 0),d([c({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"minScale",void 0),d([c({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],m.prototype,"maxScale",void 0),m=d([V("esri.layers.IntegratedMesh3DTilesLayer")],m);const xe=m;export{xe as default}; diff --git a/custom-toc-highlight/assets/IntegratedMeshLayer-C-XaBbXd-Bw4BDqVq.js b/custom-toc-highlight/assets/IntegratedMeshLayer-C-XaBbXd-BuHI7xrr.js similarity index 78% rename from custom-toc-highlight/assets/IntegratedMeshLayer-C-XaBbXd-Bw4BDqVq.js rename to custom-toc-highlight/assets/IntegratedMeshLayer-C-XaBbXd-BuHI7xrr.js index 8ed19013..28626428 100644 --- a/custom-toc-highlight/assets/IntegratedMeshLayer-C-XaBbXd-Bw4BDqVq.js +++ b/custom-toc-highlight/assets/IntegratedMeshLayer-C-XaBbXd-BuHI7xrr.js @@ -1 +1 @@ -import{v as i,S as s,l as _,ac as I,i as h,bA as L,ag as x,a as R,f as b,ai as N,a4 as M,W as $,o as m,a1 as v,a0 as A,e as D,b0 as J,P as j,av as E}from"./story-BfX8CRfG.js";import{m as P}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{C as c}from"./persistable-C6RBwzJi-CMdP5i4h.js";import{D as U}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{n as V}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{a as K}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{E as k}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as z}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{S as F}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{W as G,f as S}from"./SceneService-BZqGtWmG-BWCHkX1O.js";import{$ as W}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{y as q,o as H,d as Y,m as B}from"./I3SLayerDefinitions-CwLXCKtU-CvmIU1C5.js";import{J as Q,a as X}from"./projection-BA9M1R7d-BYoCXVXt.js";import{k as w,R as Z,j as ee}from"./elevationInfoUtils-mOZsPH2J-If61I1du.js";import"./main-ugzBrWNm.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceExtension-CdQvIDKV-BNH6JkTz.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./jsonContext-BA8GHqVk-CWQlLGSw.js";import"./resourceUtils-BmW6QqlX-B1DAUGNs.js";import"./resourceUtils-rTM6Iemx-BROWZCZ1.js";import"./saveUtils-CIYk-dsQ-VGcOewby.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";var f;let n=f=class extends D{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,r,a){if(a.layer?.spatialReference&&!a.layer.spatialReference.equals(this.geometry.spatialReference)){if(!Q(e.spatialReference,a.layer.spatialReference))return void(a?.messages&&a.messages.push(new J("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:a.layer.spatialReference,context:a})));const l=new _;X(e,l,a.layer.spatialReference),t[r]=l.toJSON(a)}else t[r]=e.toJSON(a);delete t[r].spatialReference}clone(){return new f({geometry:j(this.geometry),type:this.type})}};i([s({type:_}),c()],n.prototype,"geometry",void 0),i([I(["web-scene","portal-item"],"geometry")],n.prototype,"writeGeometry",null),i([s({type:["clip","mask","replace"],nonNullable:!0}),c()],n.prototype,"type",void 0),n=f=i([h("esri.layers.support.SceneModification")],n);const d=n;var p;let y=p=class extends L(x.ofType(d)){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(t=>t.toJSON(e)).filter(t=>!!t.geometry)}static fromJSON(e,t){const r=new p;for(const a of e)r.add(d.fromJSON(a,t));return r}static async fromUrl(e,t,r){const a={url:R(e),origin:"service"},l=await b(e,{responseType:"json",signal:r?.signal}),O=t.toJSON(),u=[];for(const g of l.data)u.push(d.fromJSON({...g,geometry:{...g.geometry,spatialReference:O}},a));return new p({url:e,items:u})}};i([s({type:String})],y.prototype,"url",void 0),y=p=i([h("esri.layers.support.SceneModifications")],y);const T=y;let o=class extends G(K(k(z(F(P(C(V(U)))))))){constructor(...e){super(...e),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.path=null,this.definitionExpression=null}initialize(){this.addHandles(N(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,E))}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readModifications(e,t,r){this._modificationsSource={url:M(e,r),context:r}}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){$(r)}if(await this._fetchService(t),this._modificationsSource!=null){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,t)}beforeSave(){if(this._modificationsSource!=null)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(S.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(S.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new m("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 m("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new m("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(){const e=this.elevationInfo,t="Integrated mesh layers";w(v.getLogger(this),Z(t,"absolute-height",e)),w(v.getLogger(this),ee(t,e))}};i([s({type:String,readOnly:!0})],o.prototype,"geometryType",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["IntegratedMeshLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({type:q,readOnly:!0})],o.prototype,"nodePages",void 0),i([s({type:[H],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[Y],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[B],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({type:T}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],o.prototype,"modifications",void 0),i([A(["web-scene","portal-item"],"modifications")],o.prototype,"readModifications",null),i([s(W)],o.prototype,"elevationInfo",null),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),o=i([h("esri.layers.IntegratedMeshLayer")],o);const Je=o;export{Je as default}; +import{v as i,S as s,l as _,ac as I,i as h,bA as L,ag as x,a as R,f as b,ai as N,a4 as M,W as $,o as m,a1 as v,a0 as A,e as D,b0 as J,P as j,av as E}from"./story-Doly9N9p.js";import{m as P}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{C as c}from"./persistable-C6RBwzJi-CrVVP3ny.js";import{D as U}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{n as V}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{a as K}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{i as C}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{E as k}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as z}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{S as F}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{W as G,f as S}from"./SceneService-BZqGtWmG-BBytd6YJ.js";import{$ as W}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{y as q,o as H,d as Y,m as B}from"./I3SLayerDefinitions-CwLXCKtU-BdHWzf5u.js";import{J as Q,a as X}from"./projection-BA9M1R7d-CAbqHZiw.js";import{k as w,R as Z,j as ee}from"./elevationInfoUtils-mOZsPH2J-BlRQDLDN.js";import"./main-QGPoLsvl.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceExtension-CdQvIDKV-DCvzsrJt.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./jsonContext-BA8GHqVk-BsXRY5es.js";import"./resourceUtils-BmW6QqlX-D_AxNrCI.js";import"./resourceUtils-rTM6Iemx-GPPQBysx.js";import"./saveUtils-CIYk-dsQ-Br9QCJTX.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";var f;let n=f=class extends D{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,r,a){if(a.layer?.spatialReference&&!a.layer.spatialReference.equals(this.geometry.spatialReference)){if(!Q(e.spatialReference,a.layer.spatialReference))return void(a?.messages&&a.messages.push(new J("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:a.layer.spatialReference,context:a})));const l=new _;X(e,l,a.layer.spatialReference),t[r]=l.toJSON(a)}else t[r]=e.toJSON(a);delete t[r].spatialReference}clone(){return new f({geometry:j(this.geometry),type:this.type})}};i([s({type:_}),c()],n.prototype,"geometry",void 0),i([I(["web-scene","portal-item"],"geometry")],n.prototype,"writeGeometry",null),i([s({type:["clip","mask","replace"],nonNullable:!0}),c()],n.prototype,"type",void 0),n=f=i([h("esri.layers.support.SceneModification")],n);const d=n;var p;let y=p=class extends L(x.ofType(d)){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(t=>t.toJSON(e)).filter(t=>!!t.geometry)}static fromJSON(e,t){const r=new p;for(const a of e)r.add(d.fromJSON(a,t));return r}static async fromUrl(e,t,r){const a={url:R(e),origin:"service"},l=await b(e,{responseType:"json",signal:r?.signal}),O=t.toJSON(),u=[];for(const g of l.data)u.push(d.fromJSON({...g,geometry:{...g.geometry,spatialReference:O}},a));return new p({url:e,items:u})}};i([s({type:String})],y.prototype,"url",void 0),y=p=i([h("esri.layers.support.SceneModifications")],y);const T=y;let o=class extends G(K(k(z(F(P(C(V(U)))))))){constructor(...e){super(...e),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.path=null,this.definitionExpression=null}initialize(){this.addHandles(N(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,E))}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readModifications(e,t,r){this._modificationsSource={url:M(e,r),context:r}}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){$(r)}if(await this._fetchService(t),this._modificationsSource!=null){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,t)}beforeSave(){if(this._modificationsSource!=null)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(S.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(S.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new m("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 m("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new m("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(){const e=this.elevationInfo,t="Integrated mesh layers";w(v.getLogger(this),Z(t,"absolute-height",e)),w(v.getLogger(this),ee(t,e))}};i([s({type:String,readOnly:!0})],o.prototype,"geometryType",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["IntegratedMeshLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({type:q,readOnly:!0})],o.prototype,"nodePages",void 0),i([s({type:[H],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[Y],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[B],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({type:T}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],o.prototype,"modifications",void 0),i([A(["web-scene","portal-item"],"modifications")],o.prototype,"readModifications",null),i([s(W)],o.prototype,"elevationInfo",null),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),o=i([h("esri.layers.IntegratedMeshLayer")],o);const Je=o;export{Je as default}; diff --git a/custom-toc-highlight/assets/InterleavedLayout-DXzw3B2n-iCEii9j9.js b/custom-toc-highlight/assets/InterleavedLayout-DXzw3B2n-BlOPeZMB.js similarity index 98% rename from custom-toc-highlight/assets/InterleavedLayout-DXzw3B2n-iCEii9j9.js rename to custom-toc-highlight/assets/InterleavedLayout-DXzw3B2n-BlOPeZMB.js index 0e7c5ef6..50c5492d 100644 --- a/custom-toc-highlight/assets/InterleavedLayout-DXzw3B2n-iCEii9j9.js +++ b/custom-toc-highlight/assets/InterleavedLayout-DXzw3B2n-BlOPeZMB.js @@ -1 +1 @@ -import{J as l,p as o,l as a,X as p,o as c,B as _,T as y,E as F,m,A as g,a as w,b,O as v,S as E,g as L,L as A,w as $,x as R,M as X,C as T,N as M,P as Y,R as k,Y as V,F as U,I as x,U as j,V as q,v as D,j as z,k as G,q as H,D as I,G as J,H as N,z as O}from"./BufferView-PQoE3GL7-Duht5lAO.js";import{c as f}from"./types-ChhhI6OU-Cxh6dPlX.js";import{h as P}from"./Util-BjGjeg6f-08Szkf4F.js";class h{constructor(t,e){this.layout=t,this.buffer=typeof e=="number"?new ArrayBuffer(e*t.stride):e;for(const s of t.fields.keys()){const i=t.fields.get(s);this[s]=new i.constructor(this.buffer,i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(t,e){const s=this[t];return s&&s.elementCount===e.ElementCount&&s.elementType===e.ElementType?s:null}slice(t,e){return new h(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e=0,s=0,i=t.count){const r=this.stride;if(r%4==0){const d=new Uint32Array(t.buffer,e*r,i*r/4);new Uint32Array(this.buffer,s*r,i*r/4).set(d)}else{const d=new Uint8Array(t.buffer,e*r,i*r);new Uint8Array(this.buffer,s*r,i*r).set(d)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(t){this._stride=0,this._lastAligned=0,this._fields=new Map,t&&(this._stride=t.stride,t.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:W(e[1].constructor)})))}freeze(){return this}vec2f(t,e){return this._appendField(t,o,e),this}vec2f64(t,e){return this._appendField(t,F,e),this}vec3f(t,e){return this._appendField(t,a,e),this}vec3f64(t,e){return this._appendField(t,m,e),this}vec4f(t,e){return this._appendField(t,p,e),this}vec4f64(t,e){return this._appendField(t,g,e),this}mat3f(t,e){return this._appendField(t,c,e),this}mat3f64(t,e){return this._appendField(t,w,e),this}mat4f(t,e){return this._appendField(t,_,e),this}mat4f64(t,e){return this._appendField(t,b,e),this}vec4u8(t,e){return this._appendField(t,A,e),this}f32(t,e){return this._appendField(t,l,e),this}f64(t,e){return this._appendField(t,y,e),this}u8(t,e){return this._appendField(t,v,e),this}u16(t,e){return this._appendField(t,$,e),this}i8(t,e){return this._appendField(t,U,e),this}vec2i8(t,e){return this._appendField(t,x,e),this}vec2i16(t,e){return this._appendField(t,z,e),this}vec2u8(t,e){return this._appendField(t,E,e),this}vec4u16(t,e){return this._appendField(t,T,e),this}u32(t,e){return this._appendField(t,M,e),this}_appendField(t,e,s){if(this._fields.has(t))return void P(!1,`${t} already added to vertex buffer layout`);const i=e.ElementCount*f(e.ElementType),r=this._stride;this._stride+=i,this._fields.set(t,{size:i,constructor:e,offset:r,optional:s})}createBuffer(t){return new h(this,t)}createView(t){return new h(this,t)}clone(){const t=new u;return t._stride=this._stride,t._fields=new Map,this._fields.forEach((e,s)=>t._fields.set(s,e)),t.BufferType=this.BufferType,t}get stride(){if(this._lastAligned!==this._fields.size){let t=1;this._fields.forEach(e=>t=Math.max(t,f(e.constructor.ElementType))),this._stride=Math.floor((this._stride+t-1)/t)*t,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function tt(){return new u}class et{constructor(t){this.fields=new Array,t.fields.forEach((e,s)=>{const i={...e,constructor:B(e.constructor)};this.fields.push([s,i])}),this.stride=t.stride}}const S=[l,o,a,p,c,_,y,F,m,g,w,b,v,E,L,A,$,R,X,T,M,Y,k,V,U,x,j,q,D,z,G,H,I,J,N,O];function B(n){return`${n.ElementType}_${n.ElementCount}`}function W(n){return C.get(n)}const C=new Map;S.forEach(n=>C.set(B(n),n));export{tt as R,et as W}; +import{J as l,p as o,l as a,X as p,o as c,B as _,T as y,E as F,m,A as g,a as w,b,O as v,S as E,g as L,L as A,w as $,x as R,M as X,C as T,N as M,P as Y,R as k,Y as V,F as U,I as x,U as j,V as q,v as D,j as z,k as G,q as H,D as I,G as J,H as N,z as O}from"./BufferView-PQoE3GL7-B9DLdqO9.js";import{c as f}from"./types-ChhhI6OU-Cxh6dPlX.js";import{h as P}from"./Util-BjGjeg6f-08Szkf4F.js";class h{constructor(t,e){this.layout=t,this.buffer=typeof e=="number"?new ArrayBuffer(e*t.stride):e;for(const s of t.fields.keys()){const i=t.fields.get(s);this[s]=new i.constructor(this.buffer,i.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(t,e){const s=this[t];return s&&s.elementCount===e.ElementCount&&s.elementType===e.ElementType?s:null}slice(t,e){return new h(this.layout,this.buffer.slice(t*this.stride,e*this.stride))}copyFrom(t,e=0,s=0,i=t.count){const r=this.stride;if(r%4==0){const d=new Uint32Array(t.buffer,e*r,i*r/4);new Uint32Array(this.buffer,s*r,i*r/4).set(d)}else{const d=new Uint8Array(t.buffer,e*r,i*r);new Uint8Array(this.buffer,s*r,i*r).set(d)}return this}get usedMemory(){return this.byteLength}dispose(){}}class u{constructor(t){this._stride=0,this._lastAligned=0,this._fields=new Map,t&&(this._stride=t.stride,t.fields.forEach(e=>this._fields.set(e[0],{...e[1],constructor:W(e[1].constructor)})))}freeze(){return this}vec2f(t,e){return this._appendField(t,o,e),this}vec2f64(t,e){return this._appendField(t,F,e),this}vec3f(t,e){return this._appendField(t,a,e),this}vec3f64(t,e){return this._appendField(t,m,e),this}vec4f(t,e){return this._appendField(t,p,e),this}vec4f64(t,e){return this._appendField(t,g,e),this}mat3f(t,e){return this._appendField(t,c,e),this}mat3f64(t,e){return this._appendField(t,w,e),this}mat4f(t,e){return this._appendField(t,_,e),this}mat4f64(t,e){return this._appendField(t,b,e),this}vec4u8(t,e){return this._appendField(t,A,e),this}f32(t,e){return this._appendField(t,l,e),this}f64(t,e){return this._appendField(t,y,e),this}u8(t,e){return this._appendField(t,v,e),this}u16(t,e){return this._appendField(t,$,e),this}i8(t,e){return this._appendField(t,U,e),this}vec2i8(t,e){return this._appendField(t,x,e),this}vec2i16(t,e){return this._appendField(t,z,e),this}vec2u8(t,e){return this._appendField(t,E,e),this}vec4u16(t,e){return this._appendField(t,T,e),this}u32(t,e){return this._appendField(t,M,e),this}_appendField(t,e,s){if(this._fields.has(t))return void P(!1,`${t} already added to vertex buffer layout`);const i=e.ElementCount*f(e.ElementType),r=this._stride;this._stride+=i,this._fields.set(t,{size:i,constructor:e,offset:r,optional:s})}createBuffer(t){return new h(this,t)}createView(t){return new h(this,t)}clone(){const t=new u;return t._stride=this._stride,t._fields=new Map,this._fields.forEach((e,s)=>t._fields.set(s,e)),t.BufferType=this.BufferType,t}get stride(){if(this._lastAligned!==this._fields.size){let t=1;this._fields.forEach(e=>t=Math.max(t,f(e.constructor.ElementType))),this._stride=Math.floor((this._stride+t-1)/t)*t,this._lastAligned=this._fields.size}return this._stride}get fields(){return this._fields}}function tt(){return new u}class et{constructor(t){this.fields=new Array,t.fields.forEach((e,s)=>{const i={...e,constructor:B(e.constructor)};this.fields.push([s,i])}),this.stride=t.stride}}const S=[l,o,a,p,c,_,y,F,m,g,w,b,v,E,L,A,$,R,X,T,M,Y,k,V,U,x,j,q,D,z,G,H,I,J,N,O];function B(n){return`${n.ElementType}_${n.ElementCount}`}function W(n){return C.get(n)}const C=new Map;S.forEach(n=>C.set(B(n),n));export{tt as R,et as W}; diff --git a/custom-toc-highlight/assets/KMLLayer-DwQXpcMB-3uH69meo.js b/custom-toc-highlight/assets/KMLLayer-DwQXpcMB-Bnm-cRpP.js similarity index 72% rename from custom-toc-highlight/assets/KMLLayer-DwQXpcMB-3uH69meo.js rename to custom-toc-highlight/assets/KMLLayer-DwQXpcMB-Bnm-cRpP.js index 588ed2aa..2dc390b8 100644 --- a/custom-toc-highlight/assets/KMLLayer-DwQXpcMB-3uH69meo.js +++ b/custom-toc-highlight/assets/KMLLayer-DwQXpcMB-Bnm-cRpP.js @@ -1 +1 @@ -import{I as k,bA as L,ai as f,ah as y,av as p,aw as v,n as d,bG as _,ag as m,v as r,S as o,jH as F,a0 as h,i as c,J as g,gK as O,W as j,ac as M,aB as I}from"./story-BfX8CRfG.js";import{f as R}from"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as C}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{u as N}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{E as K}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as P}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as A}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as J}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{Z as W}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{G as $,N as S,j as w,T as E}from"./kmlUtils-C5oIEoOy-BsvzFJRs.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";var u;let a=u=class extends k.EventedMixin(L(I)){constructor(...t){super(...t),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([f(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},p),f(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},p),y(()=>this.sublayers,(e,i)=>{if(i)for(const s of i)s.layer=s.parent=null;if(e)for(const s of e)s.parent=this,s.layer=this.layer},p),y(()=>this.layer,e=>{if(this.sublayers)for(const i of this.sublayers)i.layer=e},p)])}initialize(){v(()=>this.networkLink).then(()=>v(()=>this.visible===!0)).then(()=>this.load())}load(t){if(!this.networkLink||this.networkLink.viewFormat)return;const e=t!=null?t.signal:null,i=this._fetchService(this._get("networkLink")?.href??"",e).then(s=>{const n=$(s.sublayers);this.fullExtent=d.fromJSON(n),this.sourceJSON=s;const b=_(m.ofType(u),S(u,s));this.sublayers?this.sublayers.addMany(b):this.sublayers=b,this.layer?.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(i),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(t){this._get("visible")!==t&&(this._set("visible",t),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(t,e){return!!e.visibility}_fetchService(t,e){return w(t,this.layer.outSpatialReference,this.layer.refreshInterval,e).then(i=>E(i.data))}};r([o()],a.prototype,"description",void 0),r([o({type:d})],a.prototype,"fullExtent",void 0),r([o()],a.prototype,"id",void 0),r([o({readOnly:!0,value:null})],a.prototype,"networkLink",void 0),r([o({json:{write:{allowNull:!0}}})],a.prototype,"parent",void 0),r([o({type:m.ofType(a),json:{write:{allowNull:!0}}})],a.prototype,"sublayers",void 0),r([o({value:null,json:{read:{source:"name",reader:t=>F(t)}}})],a.prototype,"title",void 0),r([o({value:!0})],a.prototype,"visible",null),r([h("visible",["visibility"])],a.prototype,"readVisible",null),r([o()],a.prototype,"sourceJSON",void 0),r([o()],a.prototype,"layer",void 0),a=u=r([c("esri.layers.support.KMLSublayer")],a);const x=a,z=["kml","xml"];let l=class extends N(A(J(K(P(T(C)))))){constructor(...t){super(...t),this._visibleFolders=[],this.allSublayers=new R({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=g.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([y(()=>this.sublayers,(t,e)=>{e&&e.forEach(i=>{i.parent=null,i.layer=null}),t&&t.forEach(i=>{i.parent=this,i.layer=this})},p),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}readSublayersFromItemOrWebMap(t,e){this._visibleFolders=e.visibleFolders}readSublayers(t,e,i){return S(x,e,i,this._visibleFolders)}writeSublayers(t,e){const i=[],s=t.toArray();for(;s.length;){const n=s[0];n.networkLink||(n.visible&&i.push(n.id),n.sublayers&&s.push(...n.sublayers.toArray())),s.shift()}e.visibleFolders=i}get title(){const t=this._get("title");return t&&this.originOf("title")!=="defaults"?t:this.url?O(this.url,z)||"KML":t}set title(t){this._set("title",t)}get visibleSublayers(){const t=this.sublayers,e=[],i=s=>{s.visible&&(e.push(s),s.sublayers&&s.sublayers.forEach(i))};return t&&t.forEach(i),e}get fullExtent(){return this._recomputeFullExtent()}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},t).catch(j).then(()=>this._fetchService(e))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(t){const e=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:w(this.url??"",this.outSpatialReference,this.refreshInterval,t)),i=E(e.data);i&&this.read(i,{origin:"service"})}_recomputeFullExtent(){let t=null;this.extent!=null&&(t=this.extent.clone());const e=i=>{if(i.sublayers)for(const s of i.sublayers.items)e(s),s.visible&&s.fullExtent&&(t!=null?t.union(s.fullExtent):t=s.fullExtent.clone())};return e(this),t}};r([o({readOnly:!0})],l.prototype,"allSublayers",void 0),r([o({type:g})],l.prototype,"outSpatialReference",void 0),r([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],l.prototype,"path",void 0),r([o({readOnly:!0,json:{read:!1,write:!1}})],l.prototype,"legendEnabled",void 0),r([o({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),r([o({type:["KML"]})],l.prototype,"operationalLayerType",void 0),r([o({})],l.prototype,"resourceInfo",void 0),r([o({type:m.ofType(x),json:{write:{ignoreOrigin:!0}}})],l.prototype,"sublayers",void 0),r([h(["web-map","portal-item"],"sublayers",["visibleFolders"])],l.prototype,"readSublayersFromItemOrWebMap",null),r([h("service","sublayers",["sublayers"])],l.prototype,"readSublayers",null),r([M("sublayers")],l.prototype,"writeSublayers",null),r([o({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),r([o({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],l.prototype,"title",null),r([o(W)],l.prototype,"url",void 0),r([o({readOnly:!0})],l.prototype,"visibleSublayers",null),r([o({type:d})],l.prototype,"extent",void 0),r([o()],l.prototype,"fullExtent",null),l=r([c("esri.layers.KMLLayer")],l);const Pt=l;export{Pt as default}; +import{I as k,bA as L,ai as f,ah as y,av as p,aw as v,n as d,bG as _,ag as m,v as r,S as o,jH as F,a0 as h,i as c,J as g,gK as O,W as j,ac as M,aB as I}from"./story-Doly9N9p.js";import{f as R}from"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import{m as T}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as C}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{u as N}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{E as K}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as P}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as A}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as J}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{Z as W}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{G as $,N as S,j as w,T as E}from"./kmlUtils-C5oIEoOy-CPvy9nME.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";var u;let a=u=class extends k.EventedMixin(L(I)){constructor(...t){super(...t),this.description=null,this.fullExtent=null,this.id=null,this.networkLink=null,this.parent=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.layer=null,this.addHandles([f(()=>this.sublayers,"after-add",({item:e})=>{e.parent=this,e.layer=this.layer},p),f(()=>this.sublayers,"after-remove",({item:e})=>{e.layer=e.parent=null},p),y(()=>this.sublayers,(e,i)=>{if(i)for(const s of i)s.layer=s.parent=null;if(e)for(const s of e)s.parent=this,s.layer=this.layer},p),y(()=>this.layer,e=>{if(this.sublayers)for(const i of this.sublayers)i.layer=e},p)])}initialize(){v(()=>this.networkLink).then(()=>v(()=>this.visible===!0)).then(()=>this.load())}load(t){if(!this.networkLink||this.networkLink.viewFormat)return;const e=t!=null?t.signal:null,i=this._fetchService(this._get("networkLink")?.href??"",e).then(s=>{const n=$(s.sublayers);this.fullExtent=d.fromJSON(n),this.sourceJSON=s;const b=_(m.ofType(u),S(u,s));this.sublayers?this.sublayers.addMany(b):this.sublayers=b,this.layer?.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(i),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(t){this._get("visible")!==t&&(this._set("visible",t),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(t,e){return!!e.visibility}_fetchService(t,e){return w(t,this.layer.outSpatialReference,this.layer.refreshInterval,e).then(i=>E(i.data))}};r([o()],a.prototype,"description",void 0),r([o({type:d})],a.prototype,"fullExtent",void 0),r([o()],a.prototype,"id",void 0),r([o({readOnly:!0,value:null})],a.prototype,"networkLink",void 0),r([o({json:{write:{allowNull:!0}}})],a.prototype,"parent",void 0),r([o({type:m.ofType(a),json:{write:{allowNull:!0}}})],a.prototype,"sublayers",void 0),r([o({value:null,json:{read:{source:"name",reader:t=>F(t)}}})],a.prototype,"title",void 0),r([o({value:!0})],a.prototype,"visible",null),r([h("visible",["visibility"])],a.prototype,"readVisible",null),r([o()],a.prototype,"sourceJSON",void 0),r([o()],a.prototype,"layer",void 0),a=u=r([c("esri.layers.support.KMLSublayer")],a);const x=a,z=["kml","xml"];let l=class extends N(A(J(K(P(T(C)))))){constructor(...t){super(...t),this._visibleFolders=[],this.allSublayers=new R({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=g.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([y(()=>this.sublayers,(t,e)=>{e&&e.forEach(i=>{i.parent=null,i.layer=null}),t&&t.forEach(i=>{i.parent=this,i.layer=this})},p),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(t,e){return typeof t=="string"?{url:t,...e}:t}readSublayersFromItemOrWebMap(t,e){this._visibleFolders=e.visibleFolders}readSublayers(t,e,i){return S(x,e,i,this._visibleFolders)}writeSublayers(t,e){const i=[],s=t.toArray();for(;s.length;){const n=s[0];n.networkLink||(n.visible&&i.push(n.id),n.sublayers&&s.push(...n.sublayers.toArray())),s.shift()}e.visibleFolders=i}get title(){const t=this._get("title");return t&&this.originOf("title")!=="defaults"?t:this.url?O(this.url,z)||"KML":t}set title(t){this._set("title",t)}get visibleSublayers(){const t=this.sublayers,e=[],i=s=>{s.visible&&(e.push(s),s.sublayers&&s.sublayers.forEach(i))};return t&&t.forEach(i),e}get fullExtent(){return this._recomputeFullExtent()}load(t){const e=t!=null?t.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},t).catch(j).then(()=>this._fetchService(e))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(t){const e=await Promise.resolve().then(()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:w(this.url??"",this.outSpatialReference,this.refreshInterval,t)),i=E(e.data);i&&this.read(i,{origin:"service"})}_recomputeFullExtent(){let t=null;this.extent!=null&&(t=this.extent.clone());const e=i=>{if(i.sublayers)for(const s of i.sublayers.items)e(s),s.visible&&s.fullExtent&&(t!=null?t.union(s.fullExtent):t=s.fullExtent.clone())};return e(this),t}};r([o({readOnly:!0})],l.prototype,"allSublayers",void 0),r([o({type:g})],l.prototype,"outSpatialReference",void 0),r([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],l.prototype,"path",void 0),r([o({readOnly:!0,json:{read:!1,write:!1}})],l.prototype,"legendEnabled",void 0),r([o({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),r([o({type:["KML"]})],l.prototype,"operationalLayerType",void 0),r([o({})],l.prototype,"resourceInfo",void 0),r([o({type:m.ofType(x),json:{write:{ignoreOrigin:!0}}})],l.prototype,"sublayers",void 0),r([h(["web-map","portal-item"],"sublayers",["visibleFolders"])],l.prototype,"readSublayersFromItemOrWebMap",null),r([h("service","sublayers",["sublayers"])],l.prototype,"readSublayers",null),r([M("sublayers")],l.prototype,"writeSublayers",null),r([o({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),r([o({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],l.prototype,"title",null),r([o(W)],l.prototype,"url",void 0),r([o({readOnly:!0})],l.prototype,"visibleSublayers",null),r([o({type:d})],l.prototype,"extent",void 0),r([o()],l.prototype,"fullExtent",null),l=r([c("esri.layers.KMLLayer")],l);const Pt=l;export{Pt as default}; diff --git a/custom-toc-highlight/assets/KMLLayerView2D-hWgNYT5J-D43neN7r.js b/custom-toc-highlight/assets/KMLLayerView2D-hWgNYT5J-BiL2CcA0.js similarity index 68% rename from custom-toc-highlight/assets/KMLLayerView2D-hWgNYT5J-D43neN7r.js rename to custom-toc-highlight/assets/KMLLayerView2D-hWgNYT5J-BiL2CcA0.js index 247164b1..2e9a6e17 100644 --- a/custom-toc-highlight/assets/KMLLayerView2D-hWgNYT5J-D43neN7r.js +++ b/custom-toc-highlight/assets/KMLLayerView2D-hWgNYT5J-BiL2CcA0.js @@ -1 +1 @@ -import{ag as B,ah as W,aW as $,aA as S,n as k,J as U,c8 as z,u as A,X as O,v,S as C,i as N,w as E,f as X}from"./story-BfX8CRfG.js";import{W as H,K as T}from"./projection-BA9M1R7d-BYoCXVXt.js";import{L as D,j as K,T as J}from"./kmlUtils-C5oIEoOy-BsvzFJRs.js";import{y as Y}from"./utils-9sQxfkoa-KicvrT8N.js";import{o as P}from"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import{I as Q,p as Z,x as tt}from"./Bitmap-CcqmzvfR-Bqft9oF3.js";import{d as it}from"./BitmapContainer-BC8fvmFc-myTzpniv.js";import{X as et,Y as rt}from"./LayerView-Bish-E63-rB2WUWF4.js";import{d as M}from"./GraphicContainer-DuOHUciE-sEoQdKXZ.js";import{X as R}from"./GraphicsView2D-C4wYE2ut-DMrrhOCh.js";import{W as at,K as st}from"./rasterProjectionHelper-Calp0o_1-DktPwJyi.js";import{F as ot}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{U as nt,p as lt}from"./RenderingContext-DbCVbtGZ-rMiiZHPo.js";import{G as L,U as pt,F as mt,X as q}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as ht}from"./Program-DLVwTiPA-C1hIaFuM.js";import{M as ct}from"./rasterUtils-DqAu9qES-Du-esSHL.js";import{H as j,V as dt}from"./Texture-BCt2hphT-hC4XzHg_.js";import"./main-ugzBrWNm.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./AGraphicContainer-LUCT6Gle-Dvv0TF4N.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./webglDeps-Bgavuh0h-CPBMgmjx.js";import"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-DBs2wvPw.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";class m{constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(m._instance)return m._instanceRefCount++,m._instance;m._instanceRefCount=1,m._instance=this,this._ownsRctx=!0;const e=document.createElement("canvas").getContext("webgl2");e.getExtension("OES_texture_float"),this._rctx=new nt(e,{})}const r={applyProjection:!0,bilinear:!1,bicubic:!1},s=lt("raster/reproject","raster/reproject",new Map([["a_position",0]]),r);this._program=this._rctx.programCache.acquire(s.shaders.vertexShader,s.shaders.fragmentShader,s.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 ot(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,r,s=!1){const e=T(t.extent,r),a=new E({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:l,y:p}=at(a,r,t.extent);let o=(l+p)/2;const n=Math.round((e.xmax-e.xmin)/o),u=Math.round((e.ymax-e.ymin)/o);o=(e.width/n+e.height/u)/2;const I=new E({x:o,y:o,spatialReference:e.spatialReference}),g=st({projectedExtent:e,srcBufferExtent:t.extent,pixelSize:I,hasWrapAround:!0,spacing:[16,16]}),w=ct(this._rctx,g),y=new j(n,u);y.wrapMode=L.CLAMP_TO_EDGE;const h=new ht(this._rctx,y);this._rctx.bindFramebuffer(h),this._rctx.setViewport(0,0,n,u),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(w,1),this._quad.bind();const{width:x=0,height:f=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",x,f),this._program.setUniform2fv("u_transformSpacing",g.spacing),this._program.setUniform2fv("u_transformGridSize",g.size),this._program.setUniform2f("u_targetImageSize",n,u),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),w.dispose(),s){const{width:c,height:V}=h,_=new ImageData(c??0,V??0);h.readPixels(0,0,c??0,V??0,pt.RGBA,mt.UNSIGNED_BYTE,_.data);const F=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:F,extent:e,imageData:_}}const b=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:b,extent:e}}reprojectBitmapData(t,r){const s=Z(t.bitmapData)?tt(t.bitmapData):t.bitmapData,e=new j;e.wrapMode=L.CLAMP_TO_EDGE,e.width=t.bitmapData.width,e.height=t.bitmapData.height;const a=new dt(this._rctx,e,s),l=this.reprojectTexture({texture:a,extent:t.extent},r,!0);l.texture.dispose();const p=document.createElement("canvas"),o=l.imageData;return p.width=o.width,p.height=o.height,p.getContext("2d").putImageData(o,0,0),{bitmapData:p,extent:l.extent}}async loadAndReprojectBitmapData(t,r,s){const e=(await X(t,{responseType:"image"})).data,a=document.createElement("canvas");a.width=e.width,a.height=e.height;const l=a.getContext("2d");l.drawImage(e,0,0);const p=l.getImageData(0,0,a.width,a.height);if(r.spatialReference.equals(s))return{bitmapData:p,extent:r};const o=this.reprojectBitmapData({bitmapData:p,extent:r},s);return{bitmapData:o.bitmapData,extent:o.extent}}destroy(){this._ownsRctx?(m._instanceRefCount--,m._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),m._instance=null)):(this._quad.dispose(),this._program.dispose())}}m._instanceRefCount=0;class G{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let d=class extends et(rt){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new it,this._kmlVisualData=new G,this._fetchController=null,this.allVisiblePoints=new P,this.allVisiblePolylines=new P,this.allVisiblePolygons=new P,this.allVisibleMapImages=new B}async hitTest(i,t){const r=this.layer;return[this._pointsView?.hitTest(i),this._polylinesView?.hitTest(i),this._polygonsView?.hitTest(i)].flat().filter(Boolean).map(s=>(s.layer=r,s.sourceLayer=r,{type:"graphic",graphic:s,layer:r,mapPoint:i}))}update(i){this._polygonsView&&this._polygonsView.processUpdate(i),this._polylinesView&&this._polylinesView.processUpdate(i),this._pointsView&&this._pointsView.processUpdate(i)}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 M(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new R({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new R({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",i=>{i.added.forEach(t=>this._addMapImage(t)),i.removed.forEach(t=>this._removeMapImage(t))}),W(()=>this.layer.visibleSublayers,i=>{for(const t of this._kmlVisualData.allSublayers.values())t.visibility=0;for(const t of i){const r=this._kmlVisualData.allSublayers.get(t.id);r&&(r.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new m}detach(){this._fetchController=$(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=S(this._polygonsView),this._polylinesView=S(this._polylinesView),this._pointsView=S(this._pointsView),this._imageReprojector=S(this._imageReprojector)}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(i){(this.view.spatialReference?.isWGS84||this.view.spatialReference?.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(i.href,k.fromJSON(i.extent),this.view.spatialReference).then(t=>{const r=new Q(t.bitmapData);r.x=t.extent.xmin,r.y=t.extent.ymax,r.resolution=t.extent.width/t.bitmapData.width,r.rotation=i.rotation,this._mapImageContainer.addChild(r),this._bitmapIndex.set(i,r)})}async _getViewDependentUrl(i,t){const{viewFormat:r,viewBoundScale:s,httpQuery:e}=i;if(r!=null){if(t==null)throw new Error("Loading this network link requires a view state.");let a;if(await H(),s!=null&&s!==1){const c=new k(t.extent);c.expand(s),a=c}else a=t.extent;a=T(a,U.WGS84);const l=T(a,U.WebMercator),p=a.xmin,o=a.xmax,n=a.ymin,u=a.ymax,I=t.size[0]*t.pixelRatio,g=t.size[1]*t.pixelRatio,w=Math.max(l.width,l.height),y={"[bboxWest]":p.toString(),"[bboxEast]":o.toString(),"[bboxSouth]":n.toString(),"[bboxNorth]":u.toString(),"[lookatLon]":a.center.x.toString(),"[lookatLat]":a.center.y.toString(),"[lookatRange]":w.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":a.center.x.toString(),"[lookatTerrainLat]":a.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":a.center.x.toString(),"[cameraLat]":a.center.y.toString(),"[cameraAlt]":w.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":I.toString(),"[vertPixels]":g.toString(),"[terrainEnabled]":"0","[clientVersion]":z,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},h=c=>{for(const V in c){let _;for(_ in y)c[V]=c[V].replace(_,y[_])}},x=A(r);h(x);let f={};e!=null&&(f=A(e),h(f));const b=Y(i.href);return b.query={...b.query,...x,...f},`${b.path}?${O(x)}`}return i.href}async _fetchService(i){const t=new G;await this._loadVisualData(this.layer.url,t,i),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(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i))}_isSublayerVisible(i){const t=this._kmlVisualData.allSublayers.get(i);return!!t?.visibility&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(i,t,r){return this._fetchParsedKML(i,r).then(async s=>{for(const e of s.sublayers){t.allSublayers.set(e.id,e);const a=e.points?await D(e.points):[],l=e.polylines?await D(e.polylines):[],p=e.polygons?await D(e.polygons):[],o=e.mapImages||[];if(t.allPoints.push(...a.map(n=>({item:n,sublayerId:e.id}))),t.allPolylines.push(...l.map(n=>({item:n,sublayerId:e.id}))),t.allPolygons.push(...p.map(n=>({item:n,sublayerId:e.id}))),t.allMapImages.push(...o.map(n=>({item:n,sublayerId:e.id}))),e.networkLink){const n=await this._getViewDependentUrl(e.networkLink,this.view.state);await this._loadVisualData(n,t,r)}}})}_fetchParsedKML(i,t){return K(i,this.layer.spatialReference,this.layer.refreshInterval,t).then(r=>J(r.data))}_removeMapImage(i){const t=this._bitmapIndex.get(i);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(i))}};v([C()],d.prototype,"_pointsView",void 0),v([C()],d.prototype,"_polylinesView",void 0),v([C()],d.prototype,"_polygonsView",void 0),v([C()],d.prototype,"updating",void 0),d=v([N("esri.views.2d.layers.KMLLayerView2D")],d);const Ee=d;export{Ee as default}; +import{ag as B,ah as W,aW as $,aA as S,n as k,J as U,c8 as z,u as A,X as O,v,S as C,i as N,w as E,f as X}from"./story-Doly9N9p.js";import{W as H,K as T}from"./projection-BA9M1R7d-CAbqHZiw.js";import{L as D,j as K,T as J}from"./kmlUtils-C5oIEoOy-CPvy9nME.js";import{y as Y}from"./utils-9sQxfkoa-D8FX0sO8.js";import{o as P}from"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import{I as Q,p as Z,x as tt}from"./Bitmap-CcqmzvfR-C22fE2NY.js";import{d as it}from"./BitmapContainer-BC8fvmFc-C6Z_3UuF.js";import{X as et,Y as rt}from"./LayerView-Bish-E63-DK1SFHE3.js";import{d as M}from"./GraphicContainer-DuOHUciE-XlTfJEn3.js";import{X as R}from"./GraphicsView2D-C4wYE2ut-DdVMjjMv.js";import{W as at,K as st}from"./rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js";import{F as ot}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{U as nt,p as lt}from"./RenderingContext-DbCVbtGZ-Bdgqeuyk.js";import{G as L,U as pt,F as mt,X as q}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as ht}from"./Program-DLVwTiPA-DI0GKSfI.js";import{M as ct}from"./rasterUtils-DqAu9qES-Be2s-rDn.js";import{H as j,V as dt}from"./Texture-BCt2hphT-Dk2JyWCy.js";import"./main-QGPoLsvl.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./webglDeps-Bgavuh0h-31Q0Fngh.js";import"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-BwcxFsN9.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";class m{constructor(t){if(this._ownsRctx=!1,t)this._ownsRctx=!1,this._rctx=t;else{if(m._instance)return m._instanceRefCount++,m._instance;m._instanceRefCount=1,m._instance=this,this._ownsRctx=!0;const e=document.createElement("canvas").getContext("webgl2");e.getExtension("OES_texture_float"),this._rctx=new nt(e,{})}const r={applyProjection:!0,bilinear:!1,bicubic:!1},s=lt("raster/reproject","raster/reproject",new Map([["a_position",0]]),r);this._program=this._rctx.programCache.acquire(s.shaders.vertexShader,s.shaders.fragmentShader,s.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 ot(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,r,s=!1){const e=T(t.extent,r),a=new E({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:l,y:p}=at(a,r,t.extent);let o=(l+p)/2;const n=Math.round((e.xmax-e.xmin)/o),u=Math.round((e.ymax-e.ymin)/o);o=(e.width/n+e.height/u)/2;const I=new E({x:o,y:o,spatialReference:e.spatialReference}),g=st({projectedExtent:e,srcBufferExtent:t.extent,pixelSize:I,hasWrapAround:!0,spacing:[16,16]}),w=ct(this._rctx,g),y=new j(n,u);y.wrapMode=L.CLAMP_TO_EDGE;const h=new ht(this._rctx,y);this._rctx.bindFramebuffer(h),this._rctx.setViewport(0,0,n,u),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(w,1),this._quad.bind();const{width:x=0,height:f=0}=t.texture.descriptor;if(this._program.setUniform2f("u_srcImageSize",x,f),this._program.setUniform2fv("u_transformSpacing",g.spacing),this._program.setUniform2fv("u_transformGridSize",g.size),this._program.setUniform2f("u_targetImageSize",n,u),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),w.dispose(),s){const{width:c,height:V}=h,_=new ImageData(c??0,V??0);h.readPixels(0,0,c??0,V??0,pt.RGBA,mt.UNSIGNED_BYTE,_.data);const F=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:F,extent:e,imageData:_}}const b=h.detachColorTexture(q.COLOR_ATTACHMENT0);return h.dispose(),{texture:b,extent:e}}reprojectBitmapData(t,r){const s=Z(t.bitmapData)?tt(t.bitmapData):t.bitmapData,e=new j;e.wrapMode=L.CLAMP_TO_EDGE,e.width=t.bitmapData.width,e.height=t.bitmapData.height;const a=new dt(this._rctx,e,s),l=this.reprojectTexture({texture:a,extent:t.extent},r,!0);l.texture.dispose();const p=document.createElement("canvas"),o=l.imageData;return p.width=o.width,p.height=o.height,p.getContext("2d").putImageData(o,0,0),{bitmapData:p,extent:l.extent}}async loadAndReprojectBitmapData(t,r,s){const e=(await X(t,{responseType:"image"})).data,a=document.createElement("canvas");a.width=e.width,a.height=e.height;const l=a.getContext("2d");l.drawImage(e,0,0);const p=l.getImageData(0,0,a.width,a.height);if(r.spatialReference.equals(s))return{bitmapData:p,extent:r};const o=this.reprojectBitmapData({bitmapData:p,extent:r},s);return{bitmapData:o.bitmapData,extent:o.extent}}destroy(){this._ownsRctx?(m._instanceRefCount--,m._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),m._instance=null)):(this._quad.dispose(),this._program.dispose())}}m._instanceRefCount=0;class G{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let d=class extends et(rt){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new it,this._kmlVisualData=new G,this._fetchController=null,this.allVisiblePoints=new P,this.allVisiblePolylines=new P,this.allVisiblePolygons=new P,this.allVisibleMapImages=new B}async hitTest(i,t){const r=this.layer;return[this._pointsView?.hitTest(i),this._polylinesView?.hitTest(i),this._polygonsView?.hitTest(i)].flat().filter(Boolean).map(s=>(s.layer=r,s.sourceLayer=r,{type:"graphic",graphic:s,layer:r,mapPoint:i}))}update(i){this._polygonsView&&this._polygonsView.processUpdate(i),this._polylinesView&&this._polylinesView.processUpdate(i),this._pointsView&&this._pointsView.processUpdate(i)}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 M(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new R({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new R({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new M(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.addAttachHandles([this.allVisibleMapImages.on("change",i=>{i.added.forEach(t=>this._addMapImage(t)),i.removed.forEach(t=>this._removeMapImage(t))}),W(()=>this.layer.visibleSublayers,i=>{for(const t of this._kmlVisualData.allSublayers.values())t.visibility=0;for(const t of i){const r=this._kmlVisualData.allSublayers.get(t.id);r&&(r.visibility=1)}this._refreshCollections()})]),this._updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new m}detach(){this._fetchController=$(this._fetchController),this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView=S(this._polygonsView),this._polylinesView=S(this._polylinesView),this._pointsView=S(this._pointsView),this._imageReprojector=S(this._imageReprojector)}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(i){(this.view.spatialReference?.isWGS84||this.view.spatialReference?.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(i.href,k.fromJSON(i.extent),this.view.spatialReference).then(t=>{const r=new Q(t.bitmapData);r.x=t.extent.xmin,r.y=t.extent.ymax,r.resolution=t.extent.width/t.bitmapData.width,r.rotation=i.rotation,this._mapImageContainer.addChild(r),this._bitmapIndex.set(i,r)})}async _getViewDependentUrl(i,t){const{viewFormat:r,viewBoundScale:s,httpQuery:e}=i;if(r!=null){if(t==null)throw new Error("Loading this network link requires a view state.");let a;if(await H(),s!=null&&s!==1){const c=new k(t.extent);c.expand(s),a=c}else a=t.extent;a=T(a,U.WGS84);const l=T(a,U.WebMercator),p=a.xmin,o=a.xmax,n=a.ymin,u=a.ymax,I=t.size[0]*t.pixelRatio,g=t.size[1]*t.pixelRatio,w=Math.max(l.width,l.height),y={"[bboxWest]":p.toString(),"[bboxEast]":o.toString(),"[bboxSouth]":n.toString(),"[bboxNorth]":u.toString(),"[lookatLon]":a.center.x.toString(),"[lookatLat]":a.center.y.toString(),"[lookatRange]":w.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":a.center.x.toString(),"[lookatTerrainLat]":a.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":a.center.x.toString(),"[cameraLat]":a.center.y.toString(),"[cameraAlt]":w.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":I.toString(),"[vertPixels]":g.toString(),"[terrainEnabled]":"0","[clientVersion]":z,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},h=c=>{for(const V in c){let _;for(_ in y)c[V]=c[V].replace(_,y[_])}},x=A(r);h(x);let f={};e!=null&&(f=A(e),h(f));const b=Y(i.href);return b.query={...b.query,...x,...f},`${b.path}?${O(x)}`}return i.href}async _fetchService(i){const t=new G;await this._loadVisualData(this.layer.url,t,i),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(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(i=>this._isSublayerVisible(i.sublayerId)).map(({item:i})=>i))}_isSublayerVisible(i){const t=this._kmlVisualData.allSublayers.get(i);return!!t?.visibility&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(i,t,r){return this._fetchParsedKML(i,r).then(async s=>{for(const e of s.sublayers){t.allSublayers.set(e.id,e);const a=e.points?await D(e.points):[],l=e.polylines?await D(e.polylines):[],p=e.polygons?await D(e.polygons):[],o=e.mapImages||[];if(t.allPoints.push(...a.map(n=>({item:n,sublayerId:e.id}))),t.allPolylines.push(...l.map(n=>({item:n,sublayerId:e.id}))),t.allPolygons.push(...p.map(n=>({item:n,sublayerId:e.id}))),t.allMapImages.push(...o.map(n=>({item:n,sublayerId:e.id}))),e.networkLink){const n=await this._getViewDependentUrl(e.networkLink,this.view.state);await this._loadVisualData(n,t,r)}}})}_fetchParsedKML(i,t){return K(i,this.layer.spatialReference,this.layer.refreshInterval,t).then(r=>J(r.data))}_removeMapImage(i){const t=this._bitmapIndex.get(i);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(i))}};v([C()],d.prototype,"_pointsView",void 0),v([C()],d.prototype,"_polylinesView",void 0),v([C()],d.prototype,"_polygonsView",void 0),v([C()],d.prototype,"updating",void 0),d=v([N("esri.views.2d.layers.KMLLayerView2D")],d);const Ee=d;export{Ee as default}; diff --git a/custom-toc-highlight/assets/KnowledgeGraphLayer-BjNFJGLf-2GmTU8yN.js b/custom-toc-highlight/assets/KnowledgeGraphLayer-BjNFJGLf-CnmSgfq3.js similarity index 64% rename from custom-toc-highlight/assets/KnowledgeGraphLayer-BjNFJGLf-2GmTU8yN.js rename to custom-toc-highlight/assets/KnowledgeGraphLayer-BjNFJGLf-CnmSgfq3.js index a2304a9d..a1d0fa75 100644 --- a/custom-toc-highlight/assets/KnowledgeGraphLayer-BjNFJGLf-2GmTU8yN.js +++ b/custom-toc-highlight/assets/KnowledgeGraphLayer-BjNFJGLf-CnmSgfq3.js @@ -1 +1 @@ -import{ag as m,ah as M,av as T,W as _,o as g,bP as l,bY as S,a1 as c,a4 as D,bO as L,dY as b,cx as v,an as A,v as s,S as n,a0 as E,ac as C,i as N,bX as k}from"./story-BfX8CRfG.js";import{m as I}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{r as R}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{D as G}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{t as d,B as w,A as O,V as U,Y as $}from"./KnowledgeGraphSublayer-DPj4igi1-BV31Zmdo.js";import{a as F}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{u as P}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as j}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{E as z}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as x}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as K}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as Y}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{Z as B}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{F as H}from"./knowledgeGraphService-DOJz0fzA-DDr_20o0.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./GraphicsLayer-DfeGaYc1-BYhO2Zs8.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-Cq6n6OX7.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./FeatureStore-Co2V0sVE-BwnfsIjJ.js";import"./BoundsStore--N6o1xkF-BnCtocGj.js";import"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js";import"./QueryEngine-CH5uUhZK-BP95Dm56.js";import"./WhereClause-DxwoyBMS-DnXKVpm2.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-wUwu1nm1.js";import"./utils-DyydRFHu-BQ5pghrp.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./utils-tNxq3jkf-B78XlSIE.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./clientSideDefaults-BqqayPct-B-0mBem3.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";let r=class extends P(Y(K(F(z(x(I(j(G)))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(m.ofType(d)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(m.ofType(d)),this.type="knowledge-graph",this.url=null,this.addHandles(M(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),T))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(t){_(t)}await this._fetchMetadata(),await this._initializeLayerProperties(),this.loadLayerAssumingLocalCache(),await w(this)}async _fetchMetadata(){if(!this.url)throw new g("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await H(this.url);this.knowledgeGraph=e,this._forEachGraphType(t=>{t.name&&this._graphTypeLookup.set(t.name,t)})}async _initializeLayerProperties(){this.originIdOf("inclusionModeDefinition")===l.USER?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(),this._setMemberTypes(),this.dataManager=new O({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(){const e=this.definitionSetMap?await U(this.definitionSetMap,!0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(t=>{const i=this._graphTypeLookup.get(t.graphTypeName);i&&!e.namedTypeDefinitions.has(i.name)&&e.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",e,S(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach((i,o)=>{const a=this._graphTypeLookup.get(o);if(!a)return c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(o);a.type!=="relationship"&&a.type!=="entity"&&(c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(o))});else if(!e.generateAllSublayers)throw new g("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,o=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):o&&o.size>0&&o.forEach((a,h)=>{const p=this._graphTypeLookup.get(h);switch(p?.type){case"relationship":t.push(p);break;case"entity":e.push(p)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(t=>{e(t)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const o=this._graphTypeLookup.get(i);o&&(this._addSublayer(o),o.type==="entity"?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),this.dataManager.sublayerCaches.set(i,new Map))}await w(this,t),this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach(o=>{const a=this._createSublayer(o);i(a)&&t.push(a),this._updateSublayerCaches(o)})}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new d({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const o=e.find(a=>a.type===i.graphType&&a.name===i.graphTypeName);o&&(i.objectType=o,this._updateSublayerCaches(o))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}_saveUrlAsNewResource(e,t,i,o){e[t]="",i.pendingOperations.push(V(this.inclusionModeDefinition).then(a=>{const h=Z(o);e[t]=h.itemRelativeUrl,i.toAdd.push({resource:h,content:{type:"blob",blob:a},compress:!1,finish:p=>{this.definitionSetMap=p.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}readDefinitionSetMap(e,t,i){return D(e,i)}writeDefinitionSetMap(e,t,i,o){const a=o?.portalItem,h=o?.resources,p=L(o?.origin);if(!a||!h||p==null)return void(e&&(t[i]=b(e,o)));const{inclusionModeDefinition:u}=this;if(!u||this._displaysAllRecords(u))return void(this.definitionSetMap=null);const y=this.originIdOf("inclusionModeDefinition");if(y===l.USER||this._namedTypesModified||p!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===l.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const o=A(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(a=>{o.add(a.id)})})}async addRecords(e){await this._handleNewRecords(e)}async removeRecords(e){const t=[];for(const i of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const i of t)this.sublayerIdsCache.get(i.typeName)?.delete(i.id);return this._refreshNamedTypes(),t}};s([n()],r.prototype,"dataManager",void 0),s([n({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],r.prototype,"definitionSetMap",void 0),s([E("definitionSetMap")],r.prototype,"readDefinitionSetMap",null),s([C("definitionSetMap")],r.prototype,"writeDefinitionSetMap",null),s([n()],r.prototype,"inclusionModeDefinition",null),s([n()],r.prototype,"knowledgeGraph",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([n()],r.prototype,"memberEntityTypes",void 0),s([n()],r.prototype,"memberRelationshipTypes",void 0),s([n({type:["KnowledgeGraphLayer"]})],r.prototype,"operationalLayerType",void 0),s([n()],r.prototype,"sublayerIdsCache",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"tables",void 0),s([n({json:{read:!1}})],r.prototype,"type",void 0),s([n(B)],r.prototype,"url",void 0),r=s([N("esri.layers.KnowledgeGraphLayer")],r);const Yt=r;async function V(e){const t=await $(e);return new Blob([t],{type:"application/x-protobuf"})}function Z(e){const t=`definitionSetMap-${R()}.dat`,i=k("knowledgeGraphLayer",t);return e.resourceFromPath(i)}export{Yt as default}; +import{ag as m,ah as M,av as T,W as _,o as g,bP as l,bY as S,a1 as c,a4 as D,bO as L,dY as b,cx as v,an as A,v as s,S as n,a0 as E,ac as C,i as N,bX as k}from"./story-Doly9N9p.js";import{m as I}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{r as R}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{D as G}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{t as d,B as w,A as O,V as U,Y as $}from"./KnowledgeGraphSublayer-DPj4igi1-BoqyUmfs.js";import{a as F}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{u as P}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as j}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{E as z}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as x}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as K}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as Y}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{Z as B}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{F as H}from"./knowledgeGraphService-DOJz0fzA-BlihQLi8.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./GraphicsLayer-DfeGaYc1-DRpZ_f0G.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-B84JspfN.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./FeatureStore-Co2V0sVE-BK6XAR3o.js";import"./BoundsStore--N6o1xkF-CQrhMeDa.js";import"./PooledRBush-DbfAmeLn-CPHfm9op.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js";import"./QueryEngine-CH5uUhZK-DRGPyg2C.js";import"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-Dd_0rdy5.js";import"./utils-DyydRFHu-1ITtOELE.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./utils-tNxq3jkf-nfQcZo7O.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";let r=class extends P(Y(K(F(z(x(I(j(G)))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(m.ofType(d)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(m.ofType(d)),this.type="knowledge-graph",this.url=null,this.addHandles(M(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),T))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(t){_(t)}await this._fetchMetadata(),await this._initializeLayerProperties(),this.loadLayerAssumingLocalCache(),await w(this)}async _fetchMetadata(){if(!this.url)throw new g("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const e=await H(this.url);this.knowledgeGraph=e,this._forEachGraphType(t=>{t.name&&this._graphTypeLookup.set(t.name,t)})}async _initializeLayerProperties(){this.originIdOf("inclusionModeDefinition")===l.USER?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(),this._setMemberTypes(),this.dataManager=new O({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(){const e=this.definitionSetMap?await U(this.definitionSetMap,!0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(t=>{const i=this._graphTypeLookup.get(t.graphTypeName);i&&!e.namedTypeDefinitions.has(i.name)&&e.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",e,S(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:t}=e;if(t?.size>0)t.forEach((i,o)=>{const a=this._graphTypeLookup.get(o);if(!a)return c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't in the data model and will be removed`),void t.delete(o);a.type!=="relationship"&&a.type!=="entity"&&(c.getLogger(this).warn(`A named type, ${o}, was in the inclusion list that wasn't properly modeled and will be removed`),t.delete(o))});else if(!e.generateAllSublayers)throw new g("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],t=[];const{inclusionModeDefinition:i}=this,o=i?.namedTypeDefinitions;!i||i.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],t=this.knowledgeGraph.dataModel?.relationshipTypes??[]):o&&o.size>0&&o.forEach((a,h)=>{const p=this._graphTypeLookup.get(h);switch(p?.type){case"relationship":t.push(p);break;case"entity":e.push(p)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=t}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(t=>{e(t)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const i of e)this.sublayerIdsCache.has(i.typeName)||(this.sublayerIdsCache.set(i.typeName,new Set),t.push(i.typeName)),this.sublayerIdsCache.get(i.typeName).add(i.id);for(const i of t){const o=this._graphTypeLookup.get(i);o&&(this._addSublayer(o),o.type==="entity"?this.dataManager.entityTypeNames.add(i):this.dataManager.relationshipTypeNames.add(i),this.dataManager.sublayerCaches.set(i,new Map))}await w(this,t),this._refreshNamedTypes()}_createSublayers(e,t,i){e.forEach(o=>{const a=this._createSublayer(o);i(a)&&t.push(a),this._updateSublayerCaches(o)})}_addSublayer(e){const t=this._createSublayer(e);return t.geometryType?this.layers.push(t):this.tables.push(t),t}_createSublayer(e){return new d({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const o=e.find(a=>a.type===i.graphType&&a.name===i.graphTypeName);o&&(i.objectType=o,this._updateSublayerCaches(o))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}_saveUrlAsNewResource(e,t,i,o){e[t]="",i.pendingOperations.push(V(this.inclusionModeDefinition).then(a=>{const h=Z(o);e[t]=h.itemRelativeUrl,i.toAdd.push({resource:h,content:{type:"blob",blob:a},compress:!1,finish:p=>{this.definitionSetMap=p.url}})}))}_displaysAllRecords(e){for(const[,{useAllData:t}]of e.namedTypeDefinitions)if(!t)return!1;return!0}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}readDefinitionSetMap(e,t,i){return D(e,i)}writeDefinitionSetMap(e,t,i,o){const a=o?.portalItem,h=o?.resources,p=L(o?.origin);if(!a||!h||p==null)return void(e&&(t[i]=b(e,o)));const{inclusionModeDefinition:u}=this;if(!u||this._displaysAllRecords(u))return void(this.definitionSetMap=null);const y=this.originIdOf("inclusionModeDefinition");if(y===l.USER||this._namedTypesModified||p!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===l.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const o=A(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(a=>{o.add(a.id)})})}async addRecords(e){await this._handleNewRecords(e)}async removeRecords(e){const t=[];for(const i of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(i.typeName)?.members?.has(i.id)&&t.push(i);this.dataManager.removeFromLayer(t);for(const i of t)this.sublayerIdsCache.get(i.typeName)?.delete(i.id);return this._refreshNamedTypes(),t}};s([n()],r.prototype,"dataManager",void 0),s([n({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],r.prototype,"definitionSetMap",void 0),s([E("definitionSetMap")],r.prototype,"readDefinitionSetMap",null),s([C("definitionSetMap")],r.prototype,"writeDefinitionSetMap",null),s([n()],r.prototype,"inclusionModeDefinition",null),s([n()],r.prototype,"knowledgeGraph",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"layers",void 0),s([n()],r.prototype,"memberEntityTypes",void 0),s([n()],r.prototype,"memberRelationshipTypes",void 0),s([n({type:["KnowledgeGraphLayer"]})],r.prototype,"operationalLayerType",void 0),s([n()],r.prototype,"sublayerIdsCache",void 0),s([n({type:m.ofType(d),json:{write:{ignoreOrigin:!0}}})],r.prototype,"tables",void 0),s([n({json:{read:!1}})],r.prototype,"type",void 0),s([n(B)],r.prototype,"url",void 0),r=s([N("esri.layers.KnowledgeGraphLayer")],r);const Yt=r;async function V(e){const t=await $(e);return new Blob([t],{type:"application/x-protobuf"})}function Z(e){const t=`definitionSetMap-${R()}.dat`,i=k("knowledgeGraphLayer",t);return e.resourceFromPath(i)}export{Yt as default}; diff --git a/custom-toc-highlight/assets/KnowledgeGraphLayerView2D-BnEbgXue-BmCZP-QP.js b/custom-toc-highlight/assets/KnowledgeGraphLayerView2D-BnEbgXue-BmCZP-QP.js new file mode 100644 index 00000000..8c3f8eaf --- /dev/null +++ b/custom-toc-highlight/assets/KnowledgeGraphLayerView2D-BnEbgXue-BmCZP-QP.js @@ -0,0 +1 @@ +import{ag as p,am as m,v as o,S as e,dA as a,i as s}from"./story-Doly9N9p.js";import{X as l,Y as n}from"./LayerView-Bish-E63-DK1SFHE3.js";import"./main-QGPoLsvl.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";let r=class extends l(n){constructor(t){super(t),this.layerViews=new p}set layerViews(t){this._set("layerViews",m(t,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((t,i)=>t+i.updatingProgress,0)/this.layerViews.length}attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(t){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((t,i)=>this.container.addChildAt(t.container,i))}};o([e({cast:a})],r.prototype,"layerViews",null),o([e({readOnly:!0})],r.prototype,"updatingProgress",null),r=o([s("esri.views.2d.layers.KnowledgeGraphLayerView2D")],r);const ut=r;export{ut as default}; diff --git a/custom-toc-highlight/assets/KnowledgeGraphLayerView2D-BnEbgXue-PzhwY4G0.js b/custom-toc-highlight/assets/KnowledgeGraphLayerView2D-BnEbgXue-PzhwY4G0.js deleted file mode 100644 index e639d507..00000000 --- a/custom-toc-highlight/assets/KnowledgeGraphLayerView2D-BnEbgXue-PzhwY4G0.js +++ /dev/null @@ -1 +0,0 @@ -import{ag as p,am as m,v as o,S as e,dA as a,i as s}from"./story-BfX8CRfG.js";import{X as l,Y as n}from"./LayerView-Bish-E63-rB2WUWF4.js";import"./main-ugzBrWNm.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";let r=class extends l(n){constructor(t){super(t),this.layerViews=new p}set layerViews(t){this._set("layerViews",m(t,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((t,i)=>t+i.updatingProgress,0)/this.layerViews.length}attach(){this._updateStageChildren(),this.addAttachHandles(this.layerViews.on("after-changes",()=>this._updateStageChildren()))}detach(){this.container.removeAllChildren()}update(t){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((t,i)=>this.container.addChildAt(t.container,i))}};o([e({cast:a})],r.prototype,"layerViews",null),o([e({readOnly:!0})],r.prototype,"updatingProgress",null),r=o([s("esri.views.2d.layers.KnowledgeGraphLayerView2D")],r);const ut=r;export{ut as default}; diff --git a/custom-toc-highlight/assets/KnowledgeGraphSublayer-DPj4igi1-BV31Zmdo.js b/custom-toc-highlight/assets/KnowledgeGraphSublayer-DPj4igi1-BoqyUmfs.js similarity index 94% rename from custom-toc-highlight/assets/KnowledgeGraphSublayer-DPj4igi1-BV31Zmdo.js rename to custom-toc-highlight/assets/KnowledgeGraphSublayer-DPj4igi1-BoqyUmfs.js index 8a512acc..cb25ea2b 100644 --- a/custom-toc-highlight/assets/KnowledgeGraphSublayer-DPj4igi1-BV31Zmdo.js +++ b/custom-toc-highlight/assets/KnowledgeGraphSublayer-DPj4igi1-BoqyUmfs.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lclayout-CcimkDVq-BWqQJHW2.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{_ as Ve}from"./main-ugzBrWNm.js";import{v as d,S as c,i as he,bW as G,bT as We,J as ze,n as ne,dL as Ze,eS as F,l as Ge,m as Ke,w as Xe,P as C,bL as et,ac as tt,bw as it,o as q,f as nt,an as j,j as rt,a1 as X,e9 as ge,bP as ot,g as at}from"./story-BfX8CRfG.js";import{N as ue,K as ie}from"./projection-BA9M1R7d-BYoCXVXt.js";import{z as st}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{i as Te}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GraphicsLayer-DfeGaYc1-BYhO2Zs8.js";import{M as U,r as Ue,W as lt}from"./knowledgeGraphService-DOJz0fzA-DDr_20o0.js";import{j as P}from"./Relationship-Db9GUmYx-Cq6n6OX7.js";import{b as Q}from"./Query-BrwMGK8U-DoFNfkjX.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{t as le,m as pt}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{m as dt}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{d as yt}from"./workers-PiCjreoO-idkDTJa3.js";import{D as ut}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{I as ct}from"./FeatureStore-Co2V0sVE-BwnfsIjJ.js";import{Z as mt}from"./QueryEngine-CH5uUhZK-BP95Dm56.js";import{$ as ht,d as pe}from"./clientSideDefaults-BqqayPct-B-0mBem3.js";import{f as ft}from"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import{u as gt,o as Tt,a as bt}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{l as wt,s as Et}from"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import{v as It,X as Nt}from"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import{p as Lt,d as Dt}from"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import{T as _t}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as Mt}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{x as Rt,m as St}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{Y as vt,_ as Ct,n as kt,t as At,E as Ot,X as xt}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{y as ee}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{C as jt,q as Ft}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{w as qt}from"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import{O as $t}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{w as Pt}from"./popupUtils-B0uZcXX0-DtBp-byj.js";const x="ESRI__ID",ce="ESRI__OriginID",me="ESRI__DestID",Qe="ESRI__LayoutGeometry",be="ESRI__AggregationCount",z="LC.ESRI__IsSpatial",Bt={initializeLayersFromClientData:async(e,t)=>{if(t||(t=[...e.layers,...e.tables].map(o=>o.graphTypeName)),t?.length===0)return;const n=new Map;for(const o of t)n.set(o,we(e,o));const i=await lt(e.dataManager.knowledgeGraph,Array.from(n.values()));for(const o of[...e.layers,...e.tables]){const r=o.objectType.name;if(r===null)continue;const s=i.get(we(e,r));if(s){const p=JSON.parse(s);p===null||typeof p!="object"||p.hasOwnProperty("showLabels")||(p.showLabels=!1),o.read(p,{origin:"service"})}}}},we=(e,t)=>e.type==="knowledge-graph"?`${t}/Map`:`${t}/LinkChart/LinkChartSubLayer`;async function Ri(e,t){return Bt.initializeLayersFromClientData(e,t)}let de=class B{constructor(){this._featureLookup=new Map}static getInstance(){return B.instance||(B.instance=new B),B.instance}static resetInstance(){B.instance&&(B.instance=null)}deleteFromStore(t){t.forEach(n=>{this._featureLookup.delete(n)})}readFromStoreByList(t){const n=[];return t.forEach(i=>{const o=this.readFromStoreById(i);o&&n.push(o)}),n}readFromStoreById(t){return this._featureLookup.get(t)??null}writeToStore(t,n,i){const o=[];return t.forEach(r=>{if(!r?.id)return;r.properties||(r.properties=[]);let s,p=null;if(i&&r.properties[i]&&(p=st(r.properties[i])),"originId"in r&&"destinationId"in r&&(r.properties[ce]=r.originId,r.properties[me]=r.destinationId),r.properties[n]=r.id,r.id&&this._featureLookup.has(r.id)&&this._featureLookup.get(r.id).attributes){const a=this._featureLookup.get(r.id),l=JSON.parse(JSON.stringify(Object.assign(a.attributes,r.properties)));i&&r.properties[i]&&(l[i]=at(r.properties[i])),s=new Te(p?JSON.parse(JSON.stringify(p)):a?.geometry?JSON.parse(JSON.stringify(a.geometry)):null,l,null,r.properties[n])}else s=new Te(p?JSON.parse(JSON.stringify(p)):null,r.properties,null,r.properties[n]);this._featureLookup.set(`${r.typeName?`${r.typeName}__${r.id}`:r.id}`,s),o.push(s)}),o}},ye,E=null;function Si(){return ye||(ye=Ve(()=>import("./lclayout-CcimkDVq-BWqQJHW2.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>it(`esri/libs/linkchartlayout/${t}`)})).then(e=>{Gt(e)}),ye)}function Gt(e){E=e}var Ee,Ie,Z,K;function Ut(e){const t=Object.keys(Z).filter(i=>isNaN(parseInt(i,10))).indexOf(e.timeDirection),n=Object.keys(K).filter(i=>isNaN(parseInt(i,10))).indexOf(e.eventsTicksVisualization);return{timeDirection:{value:t>-1?t:Z.right},timeBannerUTCOffsetInMinutes:e.timeBannerUTCOffsetInMinutes,eventsTicksVisualization:{value:n>-1?n:K.startAndEnd},showDurationLineForNonZeroDurationEntityEvents:e.showDurationLineForNonZeroDurationEntityEvents,durationLineWidth:e.durationLineWidth,entityPositionAtDurationRatio:e.entityPositionAtDurationRatio,showNonZeroDurationIntervalBounds:e.showNonZeroDurationIntervalBounds,separateTimeOverlaps:e.separateTimeOverlaps,separateTimelineOverlaps:e.separateTimelineOverlaps,moveFirstBends:e.moveFirstBends,secondBendRatio:e.secondBendRatio,lineSeparationMultiplier:e.lineSeparationMultiplier,spaceSeparatedLinesEvenly:e.spaceSeparatedLinesEvenly,useBezierCurves:e.useBezierCurves,separatedLineShapeRatio:e.separatedLineShapeRatio}}function $(e,t,n,i,o,r){const s=n.length,p=o.length,a=Float64Array.BYTES_PER_ELEMENT,l=Uint32Array.BYTES_PER_ELEMENT,h=Uint8Array.BYTES_PER_ELEMENT,g=16,y=g+s*(h+2*a)+p*(2*l),b=E._malloc(y);try{const T=b+g-b%g,u=T+s*a,D=u+s*a,L=D+p*l,w=L+p*l,N=()=>[E.HEAPF64.subarray(T>>3,(T>>3)+s),E.HEAPF64.subarray(u>>3,(u>>3)+s),E.HEAPU32.subarray(D>>2,(D>>2)+p),E.HEAPU32.subarray(L>>2,(L>>2)+p),E.HEAPU8.subarray(w,w+s)],[_,I,m,M,R]=N();_.set(n),I.set(i),m.set(o),M.set(r),R.set(t);let S=e(s,w,T,u,p,D,L),A=null,v=null;if(S){const oe=E.getLayoutLinksTypes(),ae=E.getLayoutLinksVerticesEndIndices(),se=E.getLayoutLinksVertices(),fe=E.countLayoutLinksVertices();!p||oe&&ae?fe&&!se?S=!1:(A={types:new Uint8Array(E.HEAPU8.subarray(oe,oe+p)),vertexEndIndex:new Uint32Array(E.HEAPU32.subarray(ae>>2,(ae>>2)+p)),vertices:new Float64Array(E.HEAPF64.subarray(se>>3,(se>>3)+2*fe))},v=E.getAuxiliaryGraphicElements()):S=!1}const[J,Y,V,re,Ye]=N();return n.set(J),i.set(Y),o.set(V),r.set(re),t.set(Ye),{success:S,links:A,graphics:v}}finally{E._free(b),E.cleanupLayout()}}(function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot",e[e.IsOld=8]="IsOld"})(Ee||(Ee={})),function(e){e[e.Regular=0]="Regular",e[e.Curved=1]="Curved",e[e.Recursive=2]="Recursive"}(Ie||(Ie={})),function(e){e[e.right=0]="right",e[e.left=1]="left",e[e.top=2]="top",e[e.bottom=3]="bottom"}(Z||(Z={})),function(e){e[e.none=0]="none",e[e.startOnly=1]="startOnly",e[e.startAndEnd=2]="startAndEnd"}(K||(K={}));const Ne=2,Le=1,De=-1;var _e,Me,Re,Se,ve,Ce,ke,Ae,Oe;(function(e){function t(){return E.getMinIdealEdgeLength()}function n(i,o,r,s,p,a=Ne,l=Le,h=De){return $((g,y,b,T,u,D,L)=>E.applyForceDirectedLayout(g,y,b,T,u,D,L,a,l,h),i,o,r,s,p)}e.getMinIdealEdgeLength=t,e.apply=n})(_e||(_e={})),function(e){function t(n,i,o,r,s,p=Ne,a=Le,l=De){return $((h,g,y,b,T,u,D)=>E.applyCommunityLayout(h,g,y,b,T,u,D,p,a,l),n,i,o,r,s)}e.apply=t}(Me||(Me={})),function(e){function t(n,i,o,r,s){return $(E.applySimpleLayout,n,i,o,r,s)}e.apply=t}(Re||(Re={})),function(e){function t(n,i,o,r,s){return $(E.applyHierarchicalLayout,n,i,o,r,s)}e.apply=t}(Se||(Se={})),function(e){function t(n,i,o,r,s){return $(E.applyRadialTreeLayout,n,i,o,r,s)}e.apply=t}(ve||(ve={})),function(e){function t(n,i,o,r,s){return $(E.applySmartTreeLayout,n,i,o,r,s)}e.apply=t}(Ce||(Ce={})),function(e){function t(n,i,o,r,s,p,a,l,h,g,y){const b={timeDirection:Z.right,timeBannerUTCOffsetInMinutes:0,eventsTicksVisualization:K.startAndEnd,showDurationLineForNonZeroDurationEntityEvents:!0,durationLineWidth:5,entityPositionAtDurationRatio:1,showNonZeroDurationIntervalBounds:!1,separateTimeOverlaps:!0,separateTimelineOverlaps:!0,moveFirstBends:!0,secondBendRatio:.3,lineSeparationMultiplier:1,spaceSeparatedLinesEvenly:!1,useBezierCurves:!1,separatedLineShapeRatio:0};return $((T,u,D,L,w,N,_)=>{if(r.length!==T||s.length!==T||l.length!==w||h.length!==w)return!1;const I=Float64Array.BYTES_PER_ELEMENT,m=16,M=E._malloc(m+T*I),R=E._malloc(m+T*I),S=E._malloc(m+w*I),A=E._malloc(m+w*I),v=M+m-M%m,J=R+m-R%m,Y=S+m-S%m,V=A+m-A%m;try{E.HEAPF64.subarray(v>>3,(v>>3)+T).set(r),E.HEAPF64.subarray(J>>3,(J>>3)+T).set(s),E.HEAPF64.subarray(Y>>3,(Y>>3)+w).set(l),E.HEAPF64.subarray(V>>3,(V>>3)+w).set(h);const re=Ut(Object.assign(b,y));return E.applyChronologicalLayout(T,u,D,L,v,J,w,N,_,Y,V,g,re)}finally{E._free(M),E._free(R),E._free(S),E._free(A)}},n,i,o,p,a)}e.apply=t}(ke||(ke={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(Ae||(Ae={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(Oe||(Oe={}));var te;(function(e){e.ELEMENTUID="ELEMENTUID",e.TYPENAME="TYPENAME"})(te||(te={})),te.ELEMENTUID,te.TYPENAME;var xe,je;(function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME"})(xe||(xe={})),function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME",e[e.FROMUID=2]="FROMUID",e[e.TOUID=3]="TOUID"}(je||(je={}));var Fe,qe,$e,H;(function(e){e[e.featureResult=0]="featureResult",e[e.countResult=1]="countResult",e[e.idsResult=2]="idsResult"})(Fe||(Fe={})),function(e){e[e.upperLeft=0]="upperLeft",e[e.lowerLeft=1]="lowerLeft"}(qe||(qe={})),function(e){e[e.sqlTypeBigInt=0]="sqlTypeBigInt",e[e.sqlTypeBinary=1]="sqlTypeBinary",e[e.sqlTypeBit=2]="sqlTypeBit",e[e.sqlTypeChar=3]="sqlTypeChar",e[e.sqlTypeDate=4]="sqlTypeDate",e[e.sqlTypeDecimal=5]="sqlTypeDecimal",e[e.sqlTypeDouble=6]="sqlTypeDouble",e[e.sqlTypeFloat=7]="sqlTypeFloat",e[e.sqlTypeGeometry=8]="sqlTypeGeometry",e[e.sqlTypeGUID=9]="sqlTypeGUID",e[e.sqlTypeInteger=10]="sqlTypeInteger",e[e.sqlTypeLongNVarchar=11]="sqlTypeLongNVarchar",e[e.sqlTypeLongVarbinary=12]="sqlTypeLongVarbinary",e[e.sqlTypeLongVarchar=13]="sqlTypeLongVarchar",e[e.sqlTypeNChar=14]="sqlTypeNChar",e[e.sqlTypeNVarChar=15]="sqlTypeNVarChar",e[e.sqlTypeOther=16]="sqlTypeOther",e[e.sqlTypeReal=17]="sqlTypeReal",e[e.sqlTypeSmallInt=18]="sqlTypeSmallInt",e[e.sqlTypeSqlXml=19]="sqlTypeSqlXml",e[e.sqlTypeTime=20]="sqlTypeTime",e[e.sqlTypeTimestamp=21]="sqlTypeTimestamp",e[e.sqlTypeTimestamp2=22]="sqlTypeTimestamp2",e[e.sqlTypeTinyInt=23]="sqlTypeTinyInt",e[e.sqlTypeVarbinary=24]="sqlTypeVarbinary",e[e.sqlTypeVarchar=25]="sqlTypeVarchar"}($e||($e={})),function(e){e[e.OID_ARRAY=0]="OID_ARRAY",e[e.GLOBALID_ARRAY=1]="GLOBALID_ARRAY",e[e.STRING_ARRAY=2]="STRING_ARRAY",e[e.IDENTIFIER_ARRAY=3]="IDENTIFIER_ARRAY"}(H||(H={}));function Qt(e){if(!e.spatialReference.isWGS84)throw new q("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map(t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]])}async function vi(e,t){const n=[],i=new Map,o=[];if(t.dataModel?.relationshipTypes)for(const r of t.dataModel.relationshipTypes)r.name&&i.set(r.name,[]);for(const r of e)i.has(r.typeName)&&i.get(r.typeName)?.push(r.id);for(const[r,s]of i){if(s.length<1)continue;const p=new P({openCypherQuery:`MATCH (n)-[r:${r}]->(m) WHERE id(r) in $ids RETURN id(n), labels(n)[0], id(m), labels(m)[0]`,bindParameters:{ids:s}});o.push(U(t,p).then(async a=>{const l=a.resultRowsStream.getReader();for(;;){const{done:h,value:g}=await l.read();if(h)break;for(const y of g)n.push({id:y[0],typeName:y[1]}),n.push({id:y[2],typeName:y[3]})}}))}return await Promise.all(o),n}async function Ci(e,t){t??=!1;const n={generateAllSublayers:t,namedTypeDefinitions:new Map};return await Jt(e).then(i=>{Vt(i,n)}),n}async function ki(e){const t=await Ue(),n=new t.MapOfObjectIdentifierSets;Ht(n,t,e);const i=new t.MapOfObjectIdentifierSetsEncoder;try{i.set_map_of_identifier_sets(n),i.encode();const o=i.get_encoding_result();if(o.error.error_code!==0)throw new q("knowledge-graph:layer-support-utils",o.error.error_message);const r=structuredClone(o.get_byte_buffer());return i.delete(),r}finally{n.delete()}}function Ht(e,t,n){for(const[i,o]of n.namedTypeDefinitions){if(!o.members||o.useAllData)continue;const r=o.members.keys();let s=!1,p=!0;const a=new t.ObjectIdArray,l=new t.StringArray,h=new t.GlobalIdArray,g=new t.IdentifierArray,y=new t.ObjectIdentifierSet;for(const b of r)p&&(s=!isNaN(Number(b)),p=!1),s?a.add_objectid(Number(b)):(l.add_string(b),h.add_globalid(b)),g.add_identifier(b);y.set_oid_array(a),y.set_string_array(l),y.set_globalid_array(h),y.set_identifier_array(g),a.delete(),l.delete(),h.delete(),g.delete(),e.put_identifier_set(i,y),y.delete()}return e}async function Jt(e){const t=await nt(e,{responseType:"array-buffer"}),n=await t.data;return Yt(new Uint8Array(n))}async function Yt(e){const t=new(await Ue()).MapOfObjectIdentifierSetsDecoder,n=t.decode(new Uint8Array(e)),i=new Map;if(n.error_code!==0)throw new q("knowledge-graph:layer-support-utils",n.error_message);const o=t.get_map_of_identifier_sets(),r=o.keys,s=r.size();for(let p=0;p({useAllData:!1,members:new Map}));for(const r of i)o.members.has(r)||o.members.set(r,{id:r})}return t}let O=class extends rt{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(n=>{n.name&&(t.set(n.name,"entity"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(n=>{n.name&&(t.set(n.name,"relationship"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,i)=>{if(t.get(i)==="entity")this.entityTypeNames.add(i);else{if(t.get(i)!=="relationship")return X.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(i);this.relationshipTypeNames.add(i)}const o=new Map;n.members?.forEach(r=>{j(this.memberIdTypeLookup,r.id,()=>new Set).add(i);const s=this.getById(r.id);s&&o.set(r.id,s)}),this.sublayerCaches.set(i,o)})}addToLayer(e){e.forEach(({typeName:t,id:n})=>{if(!this.inclusionModeDefinition)throw new q("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(t);i.members||(i.members=new Map),i.members.set(n,{id:n}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}}else{const i=new Map;i.set(n,{id:n}),this.inclusionModeDefinition.namedTypeDefinitions.set(t,{useAllData:!1,members:i}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}})}getById(e){return de.getInstance().readFromStoreById(e)}async getData(e,t,n){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let i;if(i=e||new Q({where:"1=1",outFields:["*"]}),t.parentCompositeLayer.type==="link-chart"){const o=t.parentCompositeLayer,r=this._processingCacheUpdatesLookup.get(t.objectType.name??""),s=i.outFields;s&&s.length===1&&s[0]===x&&i.where==="1=1"||await Promise.all(r??[]);const p=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return p.forEach(l=>{if(this.relationshipTypeNames.has(t.objectType.name)){l.geometry=o.relationshipLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.memberIdTypeLookup.get(l.attributes[ce]),g=this.memberIdTypeLookup.get(l.attributes[me]),y=this._isEndEntitySpatial(h,l,ce),b=this._isEndEntitySpatial(g,l,me);l.attributes[z]=Number(y&&b)}else{l.geometry=o.entityLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.geographicLookup.get(t.objectType.name);h&&l.attributes[h.name]?l.attributes[z]=1:l.attributes[z]=0}l.attributes[Qe]=l.geometry,a.push(l)}),a}return this.retrieveDataFromService(i,t,n)}async getConnectedRecordIds(e,t){const n=[];let i="";const o=[],r=new Map;if(e.forEach(h=>{if(this.memberIdTypeLookup.has(h))for(const g of this.memberIdTypeLookup.get(h)){if(!this.entityTypeNames.has(g))return;r.has(g)?r.get(g)?.push(h):r.set(g,[h])}}),t&&t?.length!==0){for(const h of t)i=i+h+"|";i=i.slice(0,-1)}const s={};let p="",a=-1;for(const[h,g]of r){a++,a!==0&&(p+=" UNION ");const y=`${h}_ids`;s[y]=g,p+=t&&t?.length!==0?`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r:${i}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`:`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`}if(!p)return n;const l=new Promise(h=>{(async()=>{const g=(await U(this.knowledgeGraph,new P({openCypherQuery:p,bindParameters:s}))).resultRowsStream.getReader();try{for(;;){const{done:y,value:b}=await g.read();if(y)break;for(let T=0;T{h()})});return o.push(l),this.refreshCacheContent(),await Promise.all(o),n}async getRelationshipsBetweenNodes(e,t){const n=[],i="MATCH (n)-[r]->(m) WHERE id(n) IN $nodeIds AND id(m) in $nodeIds AND NOT id(r) IN $relationshipExclusionIds return id(r), type(r)",o=(await U(this.knowledgeGraph,new P({openCypherQuery:i,bindParameters:{nodeIds:e,relationshipExclusionIds:t}}))).resultRowsStream.getReader();try{for(;;){const{done:r,value:s}=await o.read();if(r)break;for(let p=0;p{a.name&&p.set(a.name,a)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(a=>{a.name&&p.set(a.name,a)}),e||this.inclusionModeDefinition?e?e.forEach(a=>{if(this.memberIdTypeLookup.has(a))for(const l of this.memberIdTypeLookup.get(a))s.has(l)?s.get(l)?.push(a):s.set(l,[a])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((a,l)=>{a.useAllData?s.set(l,null):a.members&&a.members.forEach(h=>{s.has(l)&&s.get(l)!==null?s.get(l)?.push(h.id):s.set(l,[h.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}));for(const[a,l]of s){const h=new Promise(g=>{(async()=>{const y=new Set,b=[];let T,u="",D=!1;if(t||p.get(a)?.properties?.forEach(w=>{w.name&&y.add(w.name)}),n&&this.geographicLookup.has(a)){const w=this.geographicLookup.get(a)?.name;w&&y.add(w)}if(this.entityTypeNames.has(a))u=`MATCH (n:${a}) ${l?"WHERE id(n) IN $ids ":""}return ID(n)`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)});else{if(!this.relationshipTypeNames.has(a))throw new q("knowledge-graph:layer-data-manager",`The graph type of ${a} could not be determined. Was this type set in the KG data model and inclusion definition?`);D=!0,u=`MATCH ()-[n:${a}]->() ${l?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)})}T=new P(l?{openCypherQuery:u,bindParameters:{ids:l}}:{openCypherQuery:u});const L=(await U(this.knowledgeGraph,T)).resultRowsStream.getReader();for(;;){const{done:w,value:N}=await L.read();if(w)break;const _=[];for(let M=0;Mnew Set).add(v.id),j(this.nodeConnectionsLookup,v.destinationId,()=>new Set).add(v.id),j(this.relationshipConnectionsLookup,v.id,()=>[v.originId,v.destinationId]));S{m?.set(M.attributes[x],M),i&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.has(M.attributes[x])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.set(M.attributes[x],{id:M.attributes[x]}),j(this.memberIdTypeLookup,M.attributes[x],()=>new Set).add(a))})}})().then(()=>{g(null)})});r.push(h),this._processingCacheUpdatesLookup.get(a)?.push(h)}await Promise.all(r)}removeFromLayer(e){const t=new Set,n=new Set(e.map(i=>i.id));for(const i of e)t.add(i.typeName),this.memberIdTypeLookup.get(i.id)?.size===1?this.memberIdTypeLookup.delete(i.id):this.memberIdTypeLookup.get(i.id)?.delete(i.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((o,r)=>{r===i.typeName&&o.members?.has(i.id)&&o.members.delete(i.id)});t.forEach(i=>{this.sublayerCaches.get(i)?.forEach((o,r)=>{n.has(r)&&this.sublayerCaches.get(i)?.delete(r)})})}async retrieveDataFromService(e,t,n){const i=de.getInstance(),o=new Set,r=[];let s,p="",a=[];const l=t.graphType==="relationship",h=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,g=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let y=!h&&g?Array.from(g).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&e.objectIds!=null&&(y=e.objectIds);else if(e.objectIds!=null&&y&&y.length>0){const T=e.objectIds;e.objectIds=y.filter(u=>T.includes(u))}else if(e.objectIds!=null)y=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=y}if(e.outFields!=null){const T=e.outFields;T.includes("*")?t.fields.forEach(u=>{o.add(u.name)}):T.forEach(u=>{u!==x&&u!==t.geometryFieldName&&o.add(u)})}if(e.geometry!=null){const T=e.geometry;let u;const D=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,L=D?.spatialReference,w=D?.serviceCapabilities?.geometryCapabilities;let N=w?.geometryMaxBoundingRectangleSizeX,_=w?.geometryMaxBoundingRectangleSizeY;if(T.type==="point"){let I=T;I.spatialReference?.isWGS84||(await ue(I.spatialReference,F),I=ie(I,F)),u=new ne({spatialReference:F,xmin:I.x-1e-4,ymin:I.y-1e-4,xmax:I.x+1e-4,ymax:I.y+1e-4})}else T?.extent?.spatialReference&&!T.spatialReference?.isWGS84?(await ue(T.extent.spatialReference,F),u=ie(T.extent,F)):u=T.extent;if(N&&_&&L){if(L.wkid!==4326){const I=new ne({spatialReference:L,xmax:N,ymax:_}),m=ie(I,F);N=m.xmax,_=m.ymax}if(u.xmax-u.xmin>N)throw new q("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${N}° latitude, limit exceeded`);if(u.ymax-u.ymin>_)throw new q("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${_}° longitude, limit exceeded`)}if(e.where!=null&&e.where!=="1=1"){const I=await ge(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(m=>{I.fieldNames.includes(m.name)&&o.add(m.name)})}p=l?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(I=>{p+=`, n.${I}`,r.push(I)}),s=new P({openCypherQuery:p,bindParameters:{param_filter_geom:new Ge({rings:Qt(u)})}})}else{let T="";if(e.where!=null&&e.where!=="1=1"){const L=await ge(e.where,t.fieldsIndex);t.fields.forEach(m=>{L.fieldNames.includes(m.name)&&o.add(m.name)});const w=new Set(["column-reference","string","number","binary-expression"]),N=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let _=!1;const I=m=>{if(m.type==="column-reference")return`n.${m.column}`;if(m.type==="string")return`'${m.value}'`;if(m.type==="number")return`${m.value}`;if(m.type==="binary-expression"&&w.has(m.left.type)&&w.has(m.right.type)&&N.has(m.operator))return`${I(m.left)} ${m.operator} ${I(m.right)}`;if(m.type==="binary-expression"&&m.operator==="LIKE"){let M="";if(m.left.type==="function"&&m.left.args.value[0].type==="column-reference")M+=`lower(n.${m.left.args.value[0].column})`;else{if(m.left.type!=="column-reference")return _=!0,"";M+=`lower(n.${m.left.column})`}if(M+=" CONTAINS (",m.right.type!=="string")return _=!0,"";{let R=m.right.value;R.charAt(0)==="%"&&(R=R.slice(1)),R.charAt(R.length-1)==="%"&&(R=R.slice(0,-1)),M+=`'${R.toLowerCase()}')`}return M}return _=!0,""};T=I(L.parseTree),_&&(T="")}let u="";u=l?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let D=!1;y&&(D=!0,u+=" WHERE ID(n) IN $ids"),T&&(u+=D?" AND":" WHERE",u+=` ${T}`),u+=" return ID(n)",l&&(u+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(L=>{u+=`, n.${L}`,r.push(L)}),s=new P(y?{openCypherQuery:u,bindParameters:{ids:y}}:{openCypherQuery:u})}const b=(await U(t.parentCompositeLayer.dataManager.knowledgeGraph,s,n)).resultRowsStream.getReader();for(;;){const{done:T,value:u}=await b.read();if(T)break;const D=[];for(let L=0;L{let t=class extends e{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return d([c(Pe.fields)],t.prototype,"fields",void 0),d([c(Pe.fieldsIndex)],t.prototype,"fieldsIndex",void 0),t=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayerBase")],t),t};function k(e){if(!e.json)return e;e.json.write=Be(e.json.write);const t=e.json.origins;if(!t)return e;let n;for(n in t){const i=t[n];i&&(i.write=Be(i.write))}return e}function Be(e){return typeof e=="object"&&e?(e.enabled!==!1&&(e.overridePolicy=zt(e)),e):e===!0?W():e}function zt(e){const{target:t,writer:n,overridePolicy:i,...o}=e;return function(r,s){const p=He.call(this,r,s);return p.enabled?{...o,...p}:p}}function W(){return{overridePolicy:He}}function He(e,t){const n=!!this.geometryType;let i={enabled:n};return n&&(i={...i,...Je.call(this,e,t)}),i}function Je(e,t){return{ignoreOrigin:this.originIdOf(t)>ot.DEFAULTS}}let f=class extends Wt(It(wt(gt(Lt(Rt(Mt(_t(dt(ut))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=ht(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.labelingInfo=null,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=x,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{const t=new MessageChannel;return new yt(t.port1,{channel:t,client:{queryFeatures:(n,i={})=>{const o=Q.fromJSON(n);return this.queryFeaturesJSON(o,i)}}}),[t.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach(t=>{const n=t.fieldType==="esriFieldTypeOID"?"esriFieldTypeInteger":t.fieldType;e.push(ee.fromJSON({name:t.name,type:n,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))}),e.push(ee.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),ee.fromJSON({name:be,type:"esriFieldTypeInteger",alias:be,editable:!1}),ee.fromJSON({name:z,type:"esriFieldTypeInteger",alias:z,editable:!1})),e}get geometryType(){if(this.parentCompositeLayer?.type==="link-chart")return this.graphType==="relationship"?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&t!=="esriGeometryNull"?G.fromJSON(t):null}get geometryFieldName(){return this.parentCompositeLayer?.type==="link-chart"?Qe:this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasZ??!1}set renderer(e){We(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):this.parentCompositeLayer?.type==="link-chart"?this.graphType==="relationship"?le(pe(G.toJSON("polyline")).renderer):le(pe(G.toJSON("point")).renderer):le(pe(G.toJSON(this.geometryType)).renderer)}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??ze.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return Pt(this,e)}createQuery(){return new Q({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t{r.sourceLayer=this}),o}async queryFeaturesJSON(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(n.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(n.toJSON(),t?.signal)}async queryExtent(e={},t){const n={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(n),r=await o.executeQueryForExtent(i.toJSON(),t?.signal);let s;return s=r.extent?.xmin!=null&&r.extent?.xmax!=null&&r.extent?.ymin!=null&&r.extent?.ymax!=null?new ne(r.extent):new ne,{count:r.count,extent:s}}async queryObjectIds(e,t){const n=Q.from(e);let i;if(this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const o=await this.parentCompositeLayer.dataManager.getData(n,this,t);i=this.loadQueryEngine(o)}return i.executeQueryForIds(n.toJSON(),t?.signal)}loadQueryEngine(e){const t=new ct({geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new mt({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new Q({where:"1=1",outFields:[x]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>{Ze(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}async _setupQueryObjects(e,t){const n=Q.from(e),i=n.geometry;let o;if(i&&!i.spatialReference?.isWGS84&&(await ue(i.spatialReference,F),n.geometry=ie(i instanceof Ge||i instanceof Ke||i instanceof Xe?i:i.extent,F)),this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const r=await this.parentCompositeLayer.dataManager.getData(n,this,t);o=this.loadQueryEngine(r)}return{resolvedQuery:n,queryEngine:o}}};d([c(k(C(Tt)))],f.prototype,"blendMode",void 0),d([c()],f.prototype,"capabilities",void 0),d([c({json:{origins:{"web-scene":{write:!1}},write:W()}})],f.prototype,"charts",void 0),d([c({readOnly:!0})],f.prototype,"defaultPopupTemplate",null),d([c({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],f.prototype,"definitionExpression",void 0),d([c()],f.prototype,"displayField",void 0),d([c(k(C(bt)))],f.prototype,"effect",void 0),d([c()],f.prototype,"elevationInfo",void 0),d([c(k(C(Et)))],f.prototype,"featureEffect",void 0),d([c(k(C(Nt)))],f.prototype,"featureReduction",null),d([c()],f.prototype,"fields",null),d([c()],f.prototype,"geometryType",null),d([c()],f.prototype,"geometryFieldName",null),d([c({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphType",void 0),d([c({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphTypeName",null),d([c()],f.prototype,"hasM",null),d([c()],f.prototype,"hasZ",null),d([c({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],f.prototype,"id",void 0),d([c(k(C(vt)))],f.prototype,"labelsVisible",void 0),d([c({type:[jt],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Ft,write:W()}})],f.prototype,"labelingInfo",void 0),d([c({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"layerType",void 0),d([c(k(C(Ct)))],f.prototype,"legendEnabled",void 0),d([c(k(C(kt)))],f.prototype,"maxScale",void 0),d([c(k(C(At)))],f.prototype,"minScale",void 0),d([c()],f.prototype,"objectIdField",void 0),d([c()],f.prototype,"objectType",void 0),d([c(k(C(Ot)))],f.prototype,"opacity",void 0),d([c(k(C(Dt)))],f.prototype,"orderBy",void 0),d([c({clonable:!1})],f.prototype,"parent",void 0),d([c()],f.prototype,"parentCompositeLayer",void 0),d([c(k(C(xt)))],f.prototype,"popupEnabled",void 0),d([c({type:et,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],f.prototype,"popupTemplate",void 0),d([c({type:Number,json:{write:{overridePolicy:Je}}})],f.prototype,"refreshInterval",void 0),d([c({types:pt,json:{name:"layerDefinition.drawingInfo.renderer",write:W()}})],f.prototype,"renderer",null),d([c()],f.prototype,"source",void 0),d([c()],f.prototype,"spatialReference",null),d([c({type:qt,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],f.prototype,"timeInfo",null),d([c({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"title",null),d([tt("title")],f.prototype,"writeTitle",null),d([c({json:{read:!1}})],f.prototype,"type",void 0),d([c(k(C(St)))],f.prototype,"useViewTime",void 0),d([c({type:Boolean,json:{name:"visibility",write:W()}})],f.prototype,"visible",void 0),f=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],f);const Ai=f;export{O as A,Ri as B,Ce as D,Me as E,Re as I,vi as J,ve as L,ke as M,Se as N,Si as P,Ee as T,Ci as V,ki as Y,Ie as b,be as f,x as k,Qe as m,ce as n,de as o,me as r,Ai as t,_e as w}; +import{_ as Ve}from"./main-QGPoLsvl.js";import{v as d,S as c,i as he,bW as G,bT as We,J as ze,n as ne,dL as Ze,eS as F,l as Ge,m as Ke,w as Xe,P as C,bL as et,ac as tt,bw as it,o as q,f as nt,an as j,j as rt,a1 as X,e9 as ge,bP as ot,g as at}from"./story-Doly9N9p.js";import{N as ue,K as ie}from"./projection-BA9M1R7d-CAbqHZiw.js";import{z as st}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{i as Te}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GraphicsLayer-DfeGaYc1-DRpZ_f0G.js";import{M as U,r as Ue,W as lt}from"./knowledgeGraphService-DOJz0fzA-BlihQLi8.js";import{j as P}from"./Relationship-Db9GUmYx-B84JspfN.js";import{b as Q}from"./Query-BrwMGK8U-BPr0_G9t.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{t as le,m as pt}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{m as dt}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{d as yt}from"./workers-PiCjreoO-Dc6Tqm-o.js";import{D as ut}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{I as ct}from"./FeatureStore-Co2V0sVE-BK6XAR3o.js";import{Z as mt}from"./QueryEngine-CH5uUhZK-DRGPyg2C.js";import{$ as ht,d as pe}from"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import{f as ft}from"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import{u as gt,o as Tt,a as bt}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{l as wt,s as Et}from"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import{v as It,X as Nt}from"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import{p as Lt,d as Dt}from"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import{T as _t}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as Mt}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{x as Rt,m as St}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{Y as vt,_ as Ct,n as kt,t as At,E as Ot,X as xt}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{y as ee}from"./Field-C6hA1tZj-CkWoRbmp.js";import{C as jt,q as Ft}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{w as qt}from"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import{O as $t}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{w as Pt}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";const x="ESRI__ID",ce="ESRI__OriginID",me="ESRI__DestID",Qe="ESRI__LayoutGeometry",be="ESRI__AggregationCount",z="LC.ESRI__IsSpatial",Bt={initializeLayersFromClientData:async(e,t)=>{if(t||(t=[...e.layers,...e.tables].map(o=>o.graphTypeName)),t?.length===0)return;const n=new Map;for(const o of t)n.set(o,we(e,o));const i=await lt(e.dataManager.knowledgeGraph,Array.from(n.values()));for(const o of[...e.layers,...e.tables]){const r=o.objectType.name;if(r===null)continue;const s=i.get(we(e,r));if(s){const p=JSON.parse(s);p===null||typeof p!="object"||p.hasOwnProperty("showLabels")||(p.showLabels=!1),o.read(p,{origin:"service"})}}}},we=(e,t)=>e.type==="knowledge-graph"?`${t}/Map`:`${t}/LinkChart/LinkChartSubLayer`;async function Ri(e,t){return Bt.initializeLayersFromClientData(e,t)}let de=class B{constructor(){this._featureLookup=new Map}static getInstance(){return B.instance||(B.instance=new B),B.instance}static resetInstance(){B.instance&&(B.instance=null)}deleteFromStore(t){t.forEach(n=>{this._featureLookup.delete(n)})}readFromStoreByList(t){const n=[];return t.forEach(i=>{const o=this.readFromStoreById(i);o&&n.push(o)}),n}readFromStoreById(t){return this._featureLookup.get(t)??null}writeToStore(t,n,i){const o=[];return t.forEach(r=>{if(!r?.id)return;r.properties||(r.properties=[]);let s,p=null;if(i&&r.properties[i]&&(p=st(r.properties[i])),"originId"in r&&"destinationId"in r&&(r.properties[ce]=r.originId,r.properties[me]=r.destinationId),r.properties[n]=r.id,r.id&&this._featureLookup.has(r.id)&&this._featureLookup.get(r.id).attributes){const a=this._featureLookup.get(r.id),l=JSON.parse(JSON.stringify(Object.assign(a.attributes,r.properties)));i&&r.properties[i]&&(l[i]=at(r.properties[i])),s=new Te(p?JSON.parse(JSON.stringify(p)):a?.geometry?JSON.parse(JSON.stringify(a.geometry)):null,l,null,r.properties[n])}else s=new Te(p?JSON.parse(JSON.stringify(p)):null,r.properties,null,r.properties[n]);this._featureLookup.set(`${r.typeName?`${r.typeName}__${r.id}`:r.id}`,s),o.push(s)}),o}},ye,E=null;function Si(){return ye||(ye=Ve(()=>import("./lclayout-CcimkDVq-BWqQJHW2.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>it(`esri/libs/linkchartlayout/${t}`)})).then(e=>{Gt(e)}),ye)}function Gt(e){E=e}var Ee,Ie,Z,K;function Ut(e){const t=Object.keys(Z).filter(i=>isNaN(parseInt(i,10))).indexOf(e.timeDirection),n=Object.keys(K).filter(i=>isNaN(parseInt(i,10))).indexOf(e.eventsTicksVisualization);return{timeDirection:{value:t>-1?t:Z.right},timeBannerUTCOffsetInMinutes:e.timeBannerUTCOffsetInMinutes,eventsTicksVisualization:{value:n>-1?n:K.startAndEnd},showDurationLineForNonZeroDurationEntityEvents:e.showDurationLineForNonZeroDurationEntityEvents,durationLineWidth:e.durationLineWidth,entityPositionAtDurationRatio:e.entityPositionAtDurationRatio,showNonZeroDurationIntervalBounds:e.showNonZeroDurationIntervalBounds,separateTimeOverlaps:e.separateTimeOverlaps,separateTimelineOverlaps:e.separateTimelineOverlaps,moveFirstBends:e.moveFirstBends,secondBendRatio:e.secondBendRatio,lineSeparationMultiplier:e.lineSeparationMultiplier,spaceSeparatedLinesEvenly:e.spaceSeparatedLinesEvenly,useBezierCurves:e.useBezierCurves,separatedLineShapeRatio:e.separatedLineShapeRatio}}function $(e,t,n,i,o,r){const s=n.length,p=o.length,a=Float64Array.BYTES_PER_ELEMENT,l=Uint32Array.BYTES_PER_ELEMENT,h=Uint8Array.BYTES_PER_ELEMENT,g=16,y=g+s*(h+2*a)+p*(2*l),b=E._malloc(y);try{const T=b+g-b%g,u=T+s*a,D=u+s*a,L=D+p*l,w=L+p*l,N=()=>[E.HEAPF64.subarray(T>>3,(T>>3)+s),E.HEAPF64.subarray(u>>3,(u>>3)+s),E.HEAPU32.subarray(D>>2,(D>>2)+p),E.HEAPU32.subarray(L>>2,(L>>2)+p),E.HEAPU8.subarray(w,w+s)],[_,I,m,M,R]=N();_.set(n),I.set(i),m.set(o),M.set(r),R.set(t);let S=e(s,w,T,u,p,D,L),A=null,v=null;if(S){const oe=E.getLayoutLinksTypes(),ae=E.getLayoutLinksVerticesEndIndices(),se=E.getLayoutLinksVertices(),fe=E.countLayoutLinksVertices();!p||oe&&ae?fe&&!se?S=!1:(A={types:new Uint8Array(E.HEAPU8.subarray(oe,oe+p)),vertexEndIndex:new Uint32Array(E.HEAPU32.subarray(ae>>2,(ae>>2)+p)),vertices:new Float64Array(E.HEAPF64.subarray(se>>3,(se>>3)+2*fe))},v=E.getAuxiliaryGraphicElements()):S=!1}const[J,Y,V,re,Ye]=N();return n.set(J),i.set(Y),o.set(V),r.set(re),t.set(Ye),{success:S,links:A,graphics:v}}finally{E._free(b),E.cleanupLayout()}}(function(e){e[e.None=0]="None",e[e.IsMovable=1]="IsMovable",e[e.IsGeographic=2]="IsGeographic",e[e.IsRoot=4]="IsRoot",e[e.IsOld=8]="IsOld"})(Ee||(Ee={})),function(e){e[e.Regular=0]="Regular",e[e.Curved=1]="Curved",e[e.Recursive=2]="Recursive"}(Ie||(Ie={})),function(e){e[e.right=0]="right",e[e.left=1]="left",e[e.top=2]="top",e[e.bottom=3]="bottom"}(Z||(Z={})),function(e){e[e.none=0]="none",e[e.startOnly=1]="startOnly",e[e.startAndEnd=2]="startAndEnd"}(K||(K={}));const Ne=2,Le=1,De=-1;var _e,Me,Re,Se,ve,Ce,ke,Ae,Oe;(function(e){function t(){return E.getMinIdealEdgeLength()}function n(i,o,r,s,p,a=Ne,l=Le,h=De){return $((g,y,b,T,u,D,L)=>E.applyForceDirectedLayout(g,y,b,T,u,D,L,a,l,h),i,o,r,s,p)}e.getMinIdealEdgeLength=t,e.apply=n})(_e||(_e={})),function(e){function t(n,i,o,r,s,p=Ne,a=Le,l=De){return $((h,g,y,b,T,u,D)=>E.applyCommunityLayout(h,g,y,b,T,u,D,p,a,l),n,i,o,r,s)}e.apply=t}(Me||(Me={})),function(e){function t(n,i,o,r,s){return $(E.applySimpleLayout,n,i,o,r,s)}e.apply=t}(Re||(Re={})),function(e){function t(n,i,o,r,s){return $(E.applyHierarchicalLayout,n,i,o,r,s)}e.apply=t}(Se||(Se={})),function(e){function t(n,i,o,r,s){return $(E.applyRadialTreeLayout,n,i,o,r,s)}e.apply=t}(ve||(ve={})),function(e){function t(n,i,o,r,s){return $(E.applySmartTreeLayout,n,i,o,r,s)}e.apply=t}(Ce||(Ce={})),function(e){function t(n,i,o,r,s,p,a,l,h,g,y){const b={timeDirection:Z.right,timeBannerUTCOffsetInMinutes:0,eventsTicksVisualization:K.startAndEnd,showDurationLineForNonZeroDurationEntityEvents:!0,durationLineWidth:5,entityPositionAtDurationRatio:1,showNonZeroDurationIntervalBounds:!1,separateTimeOverlaps:!0,separateTimelineOverlaps:!0,moveFirstBends:!0,secondBendRatio:.3,lineSeparationMultiplier:1,spaceSeparatedLinesEvenly:!1,useBezierCurves:!1,separatedLineShapeRatio:0};return $((T,u,D,L,w,N,_)=>{if(r.length!==T||s.length!==T||l.length!==w||h.length!==w)return!1;const I=Float64Array.BYTES_PER_ELEMENT,m=16,M=E._malloc(m+T*I),R=E._malloc(m+T*I),S=E._malloc(m+w*I),A=E._malloc(m+w*I),v=M+m-M%m,J=R+m-R%m,Y=S+m-S%m,V=A+m-A%m;try{E.HEAPF64.subarray(v>>3,(v>>3)+T).set(r),E.HEAPF64.subarray(J>>3,(J>>3)+T).set(s),E.HEAPF64.subarray(Y>>3,(Y>>3)+w).set(l),E.HEAPF64.subarray(V>>3,(V>>3)+w).set(h);const re=Ut(Object.assign(b,y));return E.applyChronologicalLayout(T,u,D,L,v,J,w,N,_,Y,V,g,re)}finally{E._free(M),E._free(R),E._free(S),E._free(A)}},n,i,o,p,a)}e.apply=t}(ke||(ke={})),function(e){e[e.Undirected=0]="Undirected",e[e.Directed=1]="Directed",e[e.Reversed=2]="Reversed"}(Ae||(Ae={})),function(e){e[e.ByCC_Raw=0]="ByCC_Raw",e[e.ByCC_NormalizeGlobally=1]="ByCC_NormalizeGlobally",e[e.ByCC_NormalizeByCC=2]="ByCC_NormalizeByCC"}(Oe||(Oe={}));var te;(function(e){e.ELEMENTUID="ELEMENTUID",e.TYPENAME="TYPENAME"})(te||(te={})),te.ELEMENTUID,te.TYPENAME;var xe,je;(function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME"})(xe||(xe={})),function(e){e[e.ELEMENTUID=0]="ELEMENTUID",e[e.TYPENAME=1]="TYPENAME",e[e.FROMUID=2]="FROMUID",e[e.TOUID=3]="TOUID"}(je||(je={}));var Fe,qe,$e,H;(function(e){e[e.featureResult=0]="featureResult",e[e.countResult=1]="countResult",e[e.idsResult=2]="idsResult"})(Fe||(Fe={})),function(e){e[e.upperLeft=0]="upperLeft",e[e.lowerLeft=1]="lowerLeft"}(qe||(qe={})),function(e){e[e.sqlTypeBigInt=0]="sqlTypeBigInt",e[e.sqlTypeBinary=1]="sqlTypeBinary",e[e.sqlTypeBit=2]="sqlTypeBit",e[e.sqlTypeChar=3]="sqlTypeChar",e[e.sqlTypeDate=4]="sqlTypeDate",e[e.sqlTypeDecimal=5]="sqlTypeDecimal",e[e.sqlTypeDouble=6]="sqlTypeDouble",e[e.sqlTypeFloat=7]="sqlTypeFloat",e[e.sqlTypeGeometry=8]="sqlTypeGeometry",e[e.sqlTypeGUID=9]="sqlTypeGUID",e[e.sqlTypeInteger=10]="sqlTypeInteger",e[e.sqlTypeLongNVarchar=11]="sqlTypeLongNVarchar",e[e.sqlTypeLongVarbinary=12]="sqlTypeLongVarbinary",e[e.sqlTypeLongVarchar=13]="sqlTypeLongVarchar",e[e.sqlTypeNChar=14]="sqlTypeNChar",e[e.sqlTypeNVarChar=15]="sqlTypeNVarChar",e[e.sqlTypeOther=16]="sqlTypeOther",e[e.sqlTypeReal=17]="sqlTypeReal",e[e.sqlTypeSmallInt=18]="sqlTypeSmallInt",e[e.sqlTypeSqlXml=19]="sqlTypeSqlXml",e[e.sqlTypeTime=20]="sqlTypeTime",e[e.sqlTypeTimestamp=21]="sqlTypeTimestamp",e[e.sqlTypeTimestamp2=22]="sqlTypeTimestamp2",e[e.sqlTypeTinyInt=23]="sqlTypeTinyInt",e[e.sqlTypeVarbinary=24]="sqlTypeVarbinary",e[e.sqlTypeVarchar=25]="sqlTypeVarchar"}($e||($e={})),function(e){e[e.OID_ARRAY=0]="OID_ARRAY",e[e.GLOBALID_ARRAY=1]="GLOBALID_ARRAY",e[e.STRING_ARRAY=2]="STRING_ARRAY",e[e.IDENTIFIER_ARRAY=3]="IDENTIFIER_ARRAY"}(H||(H={}));function Qt(e){if(!e.spatialReference.isWGS84)throw new q("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map(t=>[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]])}async function vi(e,t){const n=[],i=new Map,o=[];if(t.dataModel?.relationshipTypes)for(const r of t.dataModel.relationshipTypes)r.name&&i.set(r.name,[]);for(const r of e)i.has(r.typeName)&&i.get(r.typeName)?.push(r.id);for(const[r,s]of i){if(s.length<1)continue;const p=new P({openCypherQuery:`MATCH (n)-[r:${r}]->(m) WHERE id(r) in $ids RETURN id(n), labels(n)[0], id(m), labels(m)[0]`,bindParameters:{ids:s}});o.push(U(t,p).then(async a=>{const l=a.resultRowsStream.getReader();for(;;){const{done:h,value:g}=await l.read();if(h)break;for(const y of g)n.push({id:y[0],typeName:y[1]}),n.push({id:y[2],typeName:y[3]})}}))}return await Promise.all(o),n}async function Ci(e,t){t??=!1;const n={generateAllSublayers:t,namedTypeDefinitions:new Map};return await Jt(e).then(i=>{Vt(i,n)}),n}async function ki(e){const t=await Ue(),n=new t.MapOfObjectIdentifierSets;Ht(n,t,e);const i=new t.MapOfObjectIdentifierSetsEncoder;try{i.set_map_of_identifier_sets(n),i.encode();const o=i.get_encoding_result();if(o.error.error_code!==0)throw new q("knowledge-graph:layer-support-utils",o.error.error_message);const r=structuredClone(o.get_byte_buffer());return i.delete(),r}finally{n.delete()}}function Ht(e,t,n){for(const[i,o]of n.namedTypeDefinitions){if(!o.members||o.useAllData)continue;const r=o.members.keys();let s=!1,p=!0;const a=new t.ObjectIdArray,l=new t.StringArray,h=new t.GlobalIdArray,g=new t.IdentifierArray,y=new t.ObjectIdentifierSet;for(const b of r)p&&(s=!isNaN(Number(b)),p=!1),s?a.add_objectid(Number(b)):(l.add_string(b),h.add_globalid(b)),g.add_identifier(b);y.set_oid_array(a),y.set_string_array(l),y.set_globalid_array(h),y.set_identifier_array(g),a.delete(),l.delete(),h.delete(),g.delete(),e.put_identifier_set(i,y),y.delete()}return e}async function Jt(e){const t=await nt(e,{responseType:"array-buffer"}),n=await t.data;return Yt(new Uint8Array(n))}async function Yt(e){const t=new(await Ue()).MapOfObjectIdentifierSetsDecoder,n=t.decode(new Uint8Array(e)),i=new Map;if(n.error_code!==0)throw new q("knowledge-graph:layer-support-utils",n.error_message);const o=t.get_map_of_identifier_sets(),r=o.keys,s=r.size();for(let p=0;p({useAllData:!1,members:new Map}));for(const r of i)o.members.has(r)||o.members.set(r,{id:r})}return t}let O=class extends rt{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach(n=>{n.name&&(t.set(n.name,"entity"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(n=>{n.name&&(t.set(n.name,"relationship"),this._processingCacheUpdatesLookup.set(n.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(n.name),n.properties?.forEach(i=>{i.geometryType&&i.geometryType!=="esriGeometryNull"&&this.geographicLookup.set(n.name,{name:i.name??"",geometryType:i.geometryType})}))}),e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,i)=>{if(t.get(i)==="entity")this.entityTypeNames.add(i);else{if(t.get(i)!=="relationship")return X.getLogger(this).warn(`A named type, ${i}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(i);this.relationshipTypeNames.add(i)}const o=new Map;n.members?.forEach(r=>{j(this.memberIdTypeLookup,r.id,()=>new Set).add(i);const s=this.getById(r.id);s&&o.set(r.id,s)}),this.sublayerCaches.set(i,o)})}addToLayer(e){e.forEach(({typeName:t,id:n})=>{if(!this.inclusionModeDefinition)throw new q("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(t)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(t);i.members||(i.members=new Map),i.members.set(n,{id:n}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}}else{const i=new Map;i.set(n,{id:n}),this.inclusionModeDefinition.namedTypeDefinitions.set(t,{useAllData:!1,members:i}),j(this.memberIdTypeLookup,n,()=>new Set).add(t)}})}getById(e){return de.getInstance().readFromStoreById(e)}async getData(e,t,n){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let i;if(i=e||new Q({where:"1=1",outFields:["*"]}),t.parentCompositeLayer.type==="link-chart"){const o=t.parentCompositeLayer,r=this._processingCacheUpdatesLookup.get(t.objectType.name??""),s=i.outFields;s&&s.length===1&&s[0]===x&&i.where==="1=1"||await Promise.all(r??[]);const p=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return p.forEach(l=>{if(this.relationshipTypeNames.has(t.objectType.name)){l.geometry=o.relationshipLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.memberIdTypeLookup.get(l.attributes[ce]),g=this.memberIdTypeLookup.get(l.attributes[me]),y=this._isEndEntitySpatial(h,l,ce),b=this._isEndEntitySpatial(g,l,me);l.attributes[z]=Number(y&&b)}else{l.geometry=o.entityLinkChartDiagramLookup.get(l.attributes[t.objectIdField]);const h=this.geographicLookup.get(t.objectType.name);h&&l.attributes[h.name]?l.attributes[z]=1:l.attributes[z]=0}l.attributes[Qe]=l.geometry,a.push(l)}),a}return this.retrieveDataFromService(i,t,n)}async getConnectedRecordIds(e,t){const n=[];let i="";const o=[],r=new Map;if(e.forEach(h=>{if(this.memberIdTypeLookup.has(h))for(const g of this.memberIdTypeLookup.get(h)){if(!this.entityTypeNames.has(g))return;r.has(g)?r.get(g)?.push(h):r.set(g,[h])}}),t&&t?.length!==0){for(const h of t)i=i+h+"|";i=i.slice(0,-1)}const s={};let p="",a=-1;for(const[h,g]of r){a++,a!==0&&(p+=" UNION ");const y=`${h}_ids`;s[y]=g,p+=t&&t?.length!==0?`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r:${i}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`:`MATCH (n:${h}) WHERE id(n) IN $${y} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`}if(!p)return n;const l=new Promise(h=>{(async()=>{const g=(await U(this.knowledgeGraph,new P({openCypherQuery:p,bindParameters:s}))).resultRowsStream.getReader();try{for(;;){const{done:y,value:b}=await g.read();if(y)break;for(let T=0;T{h()})});return o.push(l),this.refreshCacheContent(),await Promise.all(o),n}async getRelationshipsBetweenNodes(e,t){const n=[],i="MATCH (n)-[r]->(m) WHERE id(n) IN $nodeIds AND id(m) in $nodeIds AND NOT id(r) IN $relationshipExclusionIds return id(r), type(r)",o=(await U(this.knowledgeGraph,new P({openCypherQuery:i,bindParameters:{nodeIds:e,relationshipExclusionIds:t}}))).resultRowsStream.getReader();try{for(;;){const{done:r,value:s}=await o.read();if(r)break;for(let p=0;p{a.name&&p.set(a.name,a)}),this.knowledgeGraph.dataModel.relationshipTypes?.forEach(a=>{a.name&&p.set(a.name,a)}),e||this.inclusionModeDefinition?e?e.forEach(a=>{if(this.memberIdTypeLookup.has(a))for(const l of this.memberIdTypeLookup.get(a))s.has(l)?s.get(l)?.push(a):s.set(l,[a])}):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach((a,l)=>{a.useAllData?s.set(l,null):a.members&&a.members.forEach(h=>{s.has(l)&&s.get(l)!==null?s.get(l)?.push(h.id):s.set(l,[h.id])})}):(this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}),this.knowledgeGraph.dataModel.entityTypes?.forEach(a=>{a.name&&s.set(a.name,null)}));for(const[a,l]of s){const h=new Promise(g=>{(async()=>{const y=new Set,b=[];let T,u="",D=!1;if(t||p.get(a)?.properties?.forEach(w=>{w.name&&y.add(w.name)}),n&&this.geographicLookup.has(a)){const w=this.geographicLookup.get(a)?.name;w&&y.add(w)}if(this.entityTypeNames.has(a))u=`MATCH (n:${a}) ${l?"WHERE id(n) IN $ids ":""}return ID(n)`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)});else{if(!this.relationshipTypeNames.has(a))throw new q("knowledge-graph:layer-data-manager",`The graph type of ${a} could not be determined. Was this type set in the KG data model and inclusion definition?`);D=!0,u=`MATCH ()-[n:${a}]->() ${l?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,y.forEach(w=>{u+=`, n.${w}`,b.push(w)})}T=new P(l?{openCypherQuery:u,bindParameters:{ids:l}}:{openCypherQuery:u});const L=(await U(this.knowledgeGraph,T)).resultRowsStream.getReader();for(;;){const{done:w,value:N}=await L.read();if(w)break;const _=[];for(let M=0;Mnew Set).add(v.id),j(this.nodeConnectionsLookup,v.destinationId,()=>new Set).add(v.id),j(this.relationshipConnectionsLookup,v.id,()=>[v.originId,v.destinationId]));S{m?.set(M.attributes[x],M),i&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.has(M.attributes[x])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(a).members.set(M.attributes[x],{id:M.attributes[x]}),j(this.memberIdTypeLookup,M.attributes[x],()=>new Set).add(a))})}})().then(()=>{g(null)})});r.push(h),this._processingCacheUpdatesLookup.get(a)?.push(h)}await Promise.all(r)}removeFromLayer(e){const t=new Set,n=new Set(e.map(i=>i.id));for(const i of e)t.add(i.typeName),this.memberIdTypeLookup.get(i.id)?.size===1?this.memberIdTypeLookup.delete(i.id):this.memberIdTypeLookup.get(i.id)?.delete(i.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach((o,r)=>{r===i.typeName&&o.members?.has(i.id)&&o.members.delete(i.id)});t.forEach(i=>{this.sublayerCaches.get(i)?.forEach((o,r)=>{n.has(r)&&this.sublayerCaches.get(i)?.delete(r)})})}async retrieveDataFromService(e,t,n){const i=de.getInstance(),o=new Set,r=[];let s,p="",a=[];const l=t.graphType==="relationship",h=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,g=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let y=!h&&g?Array.from(g).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&e.objectIds!=null&&(y=e.objectIds);else if(e.objectIds!=null&&y&&y.length>0){const T=e.objectIds;e.objectIds=y.filter(u=>T.includes(u))}else if(e.objectIds!=null)y=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=y}if(e.outFields!=null){const T=e.outFields;T.includes("*")?t.fields.forEach(u=>{o.add(u.name)}):T.forEach(u=>{u!==x&&u!==t.geometryFieldName&&o.add(u)})}if(e.geometry!=null){const T=e.geometry;let u;const D=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,L=D?.spatialReference,w=D?.serviceCapabilities?.geometryCapabilities;let N=w?.geometryMaxBoundingRectangleSizeX,_=w?.geometryMaxBoundingRectangleSizeY;if(T.type==="point"){let I=T;I.spatialReference?.isWGS84||(await ue(I.spatialReference,F),I=ie(I,F)),u=new ne({spatialReference:F,xmin:I.x-1e-4,ymin:I.y-1e-4,xmax:I.x+1e-4,ymax:I.y+1e-4})}else T?.extent?.spatialReference&&!T.spatialReference?.isWGS84?(await ue(T.extent.spatialReference,F),u=ie(T.extent,F)):u=T.extent;if(N&&_&&L){if(L.wkid!==4326){const I=new ne({spatialReference:L,xmax:N,ymax:_}),m=ie(I,F);N=m.xmax,_=m.ymax}if(u.xmax-u.xmin>N)throw new q("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${N}° latitude, limit exceeded`);if(u.ymax-u.ymin>_)throw new q("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${_}° longitude, limit exceeded`)}if(e.where!=null&&e.where!=="1=1"){const I=await ge(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach(m=>{I.fieldNames.includes(m.name)&&o.add(m.name)})}p=l?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(I=>{p+=`, n.${I}`,r.push(I)}),s=new P({openCypherQuery:p,bindParameters:{param_filter_geom:new Ge({rings:Qt(u)})}})}else{let T="";if(e.where!=null&&e.where!=="1=1"){const L=await ge(e.where,t.fieldsIndex);t.fields.forEach(m=>{L.fieldNames.includes(m.name)&&o.add(m.name)});const w=new Set(["column-reference","string","number","binary-expression"]),N=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let _=!1;const I=m=>{if(m.type==="column-reference")return`n.${m.column}`;if(m.type==="string")return`'${m.value}'`;if(m.type==="number")return`${m.value}`;if(m.type==="binary-expression"&&w.has(m.left.type)&&w.has(m.right.type)&&N.has(m.operator))return`${I(m.left)} ${m.operator} ${I(m.right)}`;if(m.type==="binary-expression"&&m.operator==="LIKE"){let M="";if(m.left.type==="function"&&m.left.args.value[0].type==="column-reference")M+=`lower(n.${m.left.args.value[0].column})`;else{if(m.left.type!=="column-reference")return _=!0,"";M+=`lower(n.${m.left.column})`}if(M+=" CONTAINS (",m.right.type!=="string")return _=!0,"";{let R=m.right.value;R.charAt(0)==="%"&&(R=R.slice(1)),R.charAt(R.length-1)==="%"&&(R=R.slice(0,-1)),M+=`'${R.toLowerCase()}')`}return M}return _=!0,""};T=I(L.parseTree),_&&(T="")}let u="";u=l?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let D=!1;y&&(D=!0,u+=" WHERE ID(n) IN $ids"),T&&(u+=D?" AND":" WHERE",u+=` ${T}`),u+=" return ID(n)",l&&(u+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&o.add(t.geometryFieldName),o.forEach(L=>{u+=`, n.${L}`,r.push(L)}),s=new P(y?{openCypherQuery:u,bindParameters:{ids:y}}:{openCypherQuery:u})}const b=(await U(t.parentCompositeLayer.dataManager.knowledgeGraph,s,n)).resultRowsStream.getReader();for(;;){const{done:T,value:u}=await b.read();if(T)break;const D=[];for(let L=0;L{let t=class extends e{constructor(){super(...arguments),this.fields=[],this.fieldsIndex=null}};return d([c(Pe.fields)],t.prototype,"fields",void 0),d([c(Pe.fieldsIndex)],t.prototype,"fieldsIndex",void 0),t=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayerBase")],t),t};function k(e){if(!e.json)return e;e.json.write=Be(e.json.write);const t=e.json.origins;if(!t)return e;let n;for(n in t){const i=t[n];i&&(i.write=Be(i.write))}return e}function Be(e){return typeof e=="object"&&e?(e.enabled!==!1&&(e.overridePolicy=zt(e)),e):e===!0?W():e}function zt(e){const{target:t,writer:n,overridePolicy:i,...o}=e;return function(r,s){const p=He.call(this,r,s);return p.enabled?{...o,...p}:p}}function W(){return{overridePolicy:He}}function He(e,t){const n=!!this.geometryType;let i={enabled:n};return n&&(i={...i,...Je.call(this,e,t)}),i}function Je(e,t){return{ignoreOrigin:this.originIdOf(t)>ot.DEFAULTS}}let f=class extends Wt(It(wt(gt(Lt(Rt(Mt(_t(dt(ut))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=ht(!1,!1),this.charts=null,this.definitionExpression=null,this.displayField="",this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.labelingInfo=null,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=x,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then(()=>{const t=new MessageChannel;return new yt(t.port1,{channel:t,client:{queryFeatures:(n,i={})=>{const o=Q.fromJSON(n);return this.queryFeaturesJSON(o,i)}}}),[t.port2]})},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach(t=>{const n=t.fieldType==="esriFieldTypeOID"?"esriFieldTypeInteger":t.fieldType;e.push(ee.fromJSON({name:t.name,type:n,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))}),e.push(ee.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),ee.fromJSON({name:be,type:"esriFieldTypeInteger",alias:be,editable:!1}),ee.fromJSON({name:z,type:"esriFieldTypeInteger",alias:z,editable:!1})),e}get geometryType(){if(this.parentCompositeLayer?.type==="link-chart")return this.graphType==="relationship"?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&t!=="esriGeometryNull"?G.fromJSON(t):null}get geometryFieldName(){return this.parentCompositeLayer?.type==="link-chart"?Qe:this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name)?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name;return(t?this.objectType?.properties?.[t]:null)?.hasZ??!1}set renderer(e){We(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){return this._isOverridden("renderer")?this._get("renderer"):this.parentCompositeLayer?.type==="link-chart"?this.graphType==="relationship"?le(pe(G.toJSON("polyline")).renderer):le(pe(G.toJSON("point")).renderer):le(pe(G.toJSON(this.geometryType)).renderer)}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??ze.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return Pt(this,e)}createQuery(){return new Q({where:"1=1",outFields:["*"]})}getField(e){for(let t=0;t{r.sourceLayer=this}),o}async queryFeaturesJSON(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(n.toJSON(),t?.signal)}async queryFeatureCount(e,t){const{resolvedQuery:n,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(n.toJSON(),t?.signal)}async queryExtent(e={},t){const n={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(n),r=await o.executeQueryForExtent(i.toJSON(),t?.signal);let s;return s=r.extent?.xmin!=null&&r.extent?.xmax!=null&&r.extent?.ymin!=null&&r.extent?.ymax!=null?new ne(r.extent):new ne,{count:r.count,extent:s}}async queryObjectIds(e,t){const n=Q.from(e);let i;if(this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const o=await this.parentCompositeLayer.dataManager.getData(n,this,t);i=this.loadQueryEngine(o)}return i.executeQueryForIds(n.toJSON(),t?.signal)}loadQueryEngine(e){const t=new ct({geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),n=new mt({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:G.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,objectIdField:this.objectIdField,spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return n.featureStore.addMany(e),n}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new Q({where:"1=1",outFields:[x]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then(()=>{Ze(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}async _setupQueryObjects(e,t){const n=Q.from(e),i=n.geometry;let o;if(i&&!i.spatialReference?.isWGS84&&(await ue(i.spatialReference,F),n.geometry=ie(i instanceof Ge||i instanceof Ke||i instanceof Xe?i:i.extent,F)),this.parentCompositeLayer.type==="link-chart"&&this._cachedQueryEngine)o=this._cachedQueryEngine;else{const r=await this.parentCompositeLayer.dataManager.getData(n,this,t);o=this.loadQueryEngine(r)}return{resolvedQuery:n,queryEngine:o}}};d([c(k(C(Tt)))],f.prototype,"blendMode",void 0),d([c()],f.prototype,"capabilities",void 0),d([c({json:{origins:{"web-scene":{write:!1}},write:W()}})],f.prototype,"charts",void 0),d([c({readOnly:!0})],f.prototype,"defaultPopupTemplate",null),d([c({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],f.prototype,"definitionExpression",void 0),d([c()],f.prototype,"displayField",void 0),d([c(k(C(bt)))],f.prototype,"effect",void 0),d([c()],f.prototype,"elevationInfo",void 0),d([c(k(C(Et)))],f.prototype,"featureEffect",void 0),d([c(k(C(Nt)))],f.prototype,"featureReduction",null),d([c()],f.prototype,"fields",null),d([c()],f.prototype,"geometryType",null),d([c()],f.prototype,"geometryFieldName",null),d([c({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphType",void 0),d([c({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],f.prototype,"graphTypeName",null),d([c()],f.prototype,"hasM",null),d([c()],f.prototype,"hasZ",null),d([c({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],f.prototype,"id",void 0),d([c(k(C(vt)))],f.prototype,"labelsVisible",void 0),d([c({type:[jt],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:Ft,write:W()}})],f.prototype,"labelingInfo",void 0),d([c({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"layerType",void 0),d([c(k(C(Ct)))],f.prototype,"legendEnabled",void 0),d([c(k(C(kt)))],f.prototype,"maxScale",void 0),d([c(k(C(At)))],f.prototype,"minScale",void 0),d([c()],f.prototype,"objectIdField",void 0),d([c()],f.prototype,"objectType",void 0),d([c(k(C(Ot)))],f.prototype,"opacity",void 0),d([c(k(C(Dt)))],f.prototype,"orderBy",void 0),d([c({clonable:!1})],f.prototype,"parent",void 0),d([c()],f.prototype,"parentCompositeLayer",void 0),d([c(k(C(xt)))],f.prototype,"popupEnabled",void 0),d([c({type:et,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],f.prototype,"popupTemplate",void 0),d([c({type:Number,json:{write:{overridePolicy:Je}}})],f.prototype,"refreshInterval",void 0),d([c({types:pt,json:{name:"layerDefinition.drawingInfo.renderer",write:W()}})],f.prototype,"renderer",null),d([c()],f.prototype,"source",void 0),d([c()],f.prototype,"spatialReference",null),d([c({type:qt,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],f.prototype,"timeInfo",null),d([c({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"title",null),d([tt("title")],f.prototype,"writeTitle",null),d([c({json:{read:!1}})],f.prototype,"type",void 0),d([c(k(C(St)))],f.prototype,"useViewTime",void 0),d([c({type:Boolean,json:{name:"visibility",write:W()}})],f.prototype,"visible",void 0),f=d([he("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],f);const Ai=f;export{O as A,Ri as B,Ce as D,Me as E,Re as I,vi as J,ve as L,ke as M,Se as N,Si as P,Ee as T,Ci as V,ki as Y,Ie as b,be as f,x as k,Qe as m,ce as n,de as o,me as r,Ai as t,_e as w}; diff --git a/custom-toc-highlight/assets/LRUCache-C3erQTWv-0wD6drRf.js b/custom-toc-highlight/assets/LRUCache-C3erQTWv-grHgYSP-.js similarity index 98% rename from custom-toc-highlight/assets/LRUCache-C3erQTWv-0wD6drRf.js rename to custom-toc-highlight/assets/LRUCache-C3erQTWv-grHgYSP-.js index 7f9d8d42..5236652c 100644 --- a/custom-toc-highlight/assets/LRUCache-C3erQTWv-0wD6drRf.js +++ b/custom-toc-highlight/assets/LRUCache-C3erQTWv-grHgYSP-.js @@ -1 +1 @@ -import{c$ as d}from"./story-BfX8CRfG.js";const c=-3,f=c-1;var n;(function(_){_[_.ALL=0]="ALL",_[_.SOME=1]="SOME"})(n||(n={}));class g{get size(){return this._size}constructor(i=10485760){this._maxSize=i,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new d,this._users=new d}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(i){this._users.push(i)}deregister(i){this._users.removeUnordered(i)}registerRemoveFunc(i,t){this._removeFuncs.push([i,t])}deregisterRemoveFunc(i){this._removeFuncs.filterInPlace(t=>t[0]!==i)}get maxSize(){return this._maxSize}set maxSize(i){this._maxSize=Math.max(i,-1),this._checkSize()}getSize(i,t){return this._db.get(i.id+t)?.size??0}put(i,t,e,r,h){t=i.id+t;const s=this._db.get(t);if(s&&(this._size-=s.size,i.size-=s.size,this._db.delete(t),s.entry!==e&&this._notifyRemove(t,s.entry,s.size,n.ALL)),r>this._maxSize)return void this._notifyRemove(t,e,r,n.ALL);if(e===void 0)return void console.warn("Refusing to cache undefined entry ");if(!r||r<0)return console.warn(`Refusing to cache entry with size ${r} for key ${t}`),void this._notifyRemove(t,e,0,n.ALL);const o=1+Math.max(h,f)-c;this._db.set(t,new S(e,r,o)),this._size+=r,i.size+=r,this._checkSize()}updateSize(i,t,e,r){t=i.id+t;const h=this._db.get(t);if(h&&h.entry===e){for(this._size-=h.size,i.size-=h.size;r>this._maxSize;){const s=this._notifyRemove(t,e,r,n.SOME);if(!(s!=null&&s>0))return void this._db.delete(t);r=s}h.size=r,this._size+=r,i.size+=r,this._checkSize()}}pop(i,t){t=i.id+t;const e=this._db.get(t);if(e)return this._size-=e.size,i.size-=e.size,this._db.delete(t),++this._hit,e.entry;++this._miss}get(i,t){t=i.id+t;const e=this._db.get(t);if(e!==void 0)return this._db.delete(t),e.lives=e.lifetime,this._db.set(t,e),++this._hit,e.entry;++this._miss}peek(i,t){const e=this._db.get(i.id+t);return e?++this._hit:++this._miss,e?.entry}get performanceInfo(){const i={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},e=new Array;this._db.forEach((s,o)=>{const a=s.lifetime;e[a]=(e[a]||0)+s.size,this._users.forAll(u=>{const{id:m,name:z}=u;if(o.startsWith(m)){const l=t[z]||0;t[z]=l+s.size}})});const r={};this._users.forAll(s=>{const o=s.name;if("hitRate"in s&&typeof s.hitRate=="number"&&!isNaN(s.hitRate)&&s.hitRate>0){const a=t[o]||0;t[o]=a,r[o]=Math.round(100*s.hitRate)+"%"}else r[o]="0%"});const h=Object.keys(t);h.sort((s,o)=>t[o]-t[s]),h.forEach(s=>i[s]=Math.round(t[s]/2**20)+"MB / "+r[s]);for(let s=e.length-1;s>=0;--s){const o=e[s];o&&(i["Priority "+(s+c-1)]=Math.round(o/this._size*100)+"%")}return i}resetStats(){this._hit=this._miss=0,this._users.forAll(i=>i.resetHitRate())}clear(i){const t=i.id;this._db.forEach((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,n.ALL))}),i.size=0}clearAll(){this._db.forEach((i,t)=>this._notifyRemove(t,i.entry,i.size,n.ALL)),this._users.forAll(i=>i.size=0),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(i,t,e,r){let h;return this._removeFuncs.some(s=>{if(i.startsWith(s[0])){const o=s[1](t,r,e);return typeof o=="number"&&(h=o),!0}return!1}),h}_checkSize(){this._users.forAll(i=>this._checkSizeLimits(i)),this._checkSizeLimits()}_checkSizeLimits(i){const t=i??this;if(t.maxSize<0||t.size<=t.maxSize)return;const e=i?.id;let r=!0;for(;r;){r=!1;for(const[h,s]of this._db)if(s.lifetime===0&&(!e||h.startsWith(e))){if(this._purgeItem(h,s,i),t.size<=.9*t.maxSize)return;r||=this._db.has(h)}}for(const[h,s]of this._db)if((!e||h.startsWith(e))&&(this._purgeItem(h,s,i),t.size<=.9*t.maxSize))return}_purgeItem(i,t,e=this._users.find(r=>i.startsWith(r.id))){if(this._db.delete(i),t.lives<=1){this._size-=t.size,e&&(e.size-=t.size);const r=this._notifyRemove(i,t.entry,t.size,n.SOME);r!=null&&r>0&&(this._size+=r,e&&(e.size+=r),t.lives=t.lifetime,t.size=r,this._db.set(i,t))}else--t.lives,this._db.set(i,t)}}class S{constructor(i,t,e){this.entry=i,this.size=t,this.lifetime=e,this.lives=e}}class v{constructor(i,t){this._storage=new g,this.id="",this.name="",this.size=0,this._storage.maxSize=i,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(i,t,e=1){this._storage.put(this,i,t,e,1)}pop(i){return this._storage.pop(this,i)}get(i){return this._storage.get(this,i)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(i){this._storage.maxSize=i}resetHitRate(){}}export{v as b}; +import{c$ as d}from"./story-Doly9N9p.js";const c=-3,f=c-1;var n;(function(_){_[_.ALL=0]="ALL",_[_.SOME=1]="SOME"})(n||(n={}));class g{get size(){return this._size}constructor(i=10485760){this._maxSize=i,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new d,this._users=new d}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(i){this._users.push(i)}deregister(i){this._users.removeUnordered(i)}registerRemoveFunc(i,t){this._removeFuncs.push([i,t])}deregisterRemoveFunc(i){this._removeFuncs.filterInPlace(t=>t[0]!==i)}get maxSize(){return this._maxSize}set maxSize(i){this._maxSize=Math.max(i,-1),this._checkSize()}getSize(i,t){return this._db.get(i.id+t)?.size??0}put(i,t,e,r,h){t=i.id+t;const s=this._db.get(t);if(s&&(this._size-=s.size,i.size-=s.size,this._db.delete(t),s.entry!==e&&this._notifyRemove(t,s.entry,s.size,n.ALL)),r>this._maxSize)return void this._notifyRemove(t,e,r,n.ALL);if(e===void 0)return void console.warn("Refusing to cache undefined entry ");if(!r||r<0)return console.warn(`Refusing to cache entry with size ${r} for key ${t}`),void this._notifyRemove(t,e,0,n.ALL);const o=1+Math.max(h,f)-c;this._db.set(t,new S(e,r,o)),this._size+=r,i.size+=r,this._checkSize()}updateSize(i,t,e,r){t=i.id+t;const h=this._db.get(t);if(h&&h.entry===e){for(this._size-=h.size,i.size-=h.size;r>this._maxSize;){const s=this._notifyRemove(t,e,r,n.SOME);if(!(s!=null&&s>0))return void this._db.delete(t);r=s}h.size=r,this._size+=r,i.size+=r,this._checkSize()}}pop(i,t){t=i.id+t;const e=this._db.get(t);if(e)return this._size-=e.size,i.size-=e.size,this._db.delete(t),++this._hit,e.entry;++this._miss}get(i,t){t=i.id+t;const e=this._db.get(t);if(e!==void 0)return this._db.delete(t),e.lives=e.lifetime,this._db.set(t,e),++this._hit,e.entry;++this._miss}peek(i,t){const e=this._db.get(i.id+t);return e?++this._hit:++this._miss,e?.entry}get performanceInfo(){const i={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},t={},e=new Array;this._db.forEach((s,o)=>{const a=s.lifetime;e[a]=(e[a]||0)+s.size,this._users.forAll(u=>{const{id:m,name:z}=u;if(o.startsWith(m)){const l=t[z]||0;t[z]=l+s.size}})});const r={};this._users.forAll(s=>{const o=s.name;if("hitRate"in s&&typeof s.hitRate=="number"&&!isNaN(s.hitRate)&&s.hitRate>0){const a=t[o]||0;t[o]=a,r[o]=Math.round(100*s.hitRate)+"%"}else r[o]="0%"});const h=Object.keys(t);h.sort((s,o)=>t[o]-t[s]),h.forEach(s=>i[s]=Math.round(t[s]/2**20)+"MB / "+r[s]);for(let s=e.length-1;s>=0;--s){const o=e[s];o&&(i["Priority "+(s+c-1)]=Math.round(o/this._size*100)+"%")}return i}resetStats(){this._hit=this._miss=0,this._users.forAll(i=>i.resetHitRate())}clear(i){const t=i.id;this._db.forEach((e,r)=>{r.startsWith(t)&&(this._size-=e.size,this._db.delete(r),this._notifyRemove(r,e.entry,e.size,n.ALL))}),i.size=0}clearAll(){this._db.forEach((i,t)=>this._notifyRemove(t,i.entry,i.size,n.ALL)),this._users.forAll(i=>i.size=0),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(i,t,e,r){let h;return this._removeFuncs.some(s=>{if(i.startsWith(s[0])){const o=s[1](t,r,e);return typeof o=="number"&&(h=o),!0}return!1}),h}_checkSize(){this._users.forAll(i=>this._checkSizeLimits(i)),this._checkSizeLimits()}_checkSizeLimits(i){const t=i??this;if(t.maxSize<0||t.size<=t.maxSize)return;const e=i?.id;let r=!0;for(;r;){r=!1;for(const[h,s]of this._db)if(s.lifetime===0&&(!e||h.startsWith(e))){if(this._purgeItem(h,s,i),t.size<=.9*t.maxSize)return;r||=this._db.has(h)}}for(const[h,s]of this._db)if((!e||h.startsWith(e))&&(this._purgeItem(h,s,i),t.size<=.9*t.maxSize))return}_purgeItem(i,t,e=this._users.find(r=>i.startsWith(r.id))){if(this._db.delete(i),t.lives<=1){this._size-=t.size,e&&(e.size-=t.size);const r=this._notifyRemove(i,t.entry,t.size,n.SOME);r!=null&&r>0&&(this._size+=r,e&&(e.size+=r),t.lives=t.lifetime,t.size=r,this._db.set(i,t))}else--t.lives,this._db.set(i,t)}}class S{constructor(i,t,e){this.entry=i,this.size=t,this.lifetime=e,this.lives=e}}class v{constructor(i,t){this._storage=new g,this.id="",this.name="",this.size=0,this._storage.maxSize=i,this._storage.register(this),t&&this._storage.registerRemoveFunc("",t)}destroy(){this._storage.deregister(this),this._storage.destroy()}put(i,t,e=1){this._storage.put(this,i,t,e,1)}pop(i){return this._storage.pop(this,i)}get(i){return this._storage.get(this,i)}clear(){this._storage.clearAll()}get maxSize(){return this._storage.maxSize}set maxSize(i){this._storage.maxSize=i}resetHitRate(){}}export{v as b}; diff --git a/custom-toc-highlight/assets/LabelMetric-BeluzH3o-C3fDXNzp.js b/custom-toc-highlight/assets/LabelMetric-BeluzH3o-Br-5CSAC.js similarity index 98% rename from custom-toc-highlight/assets/LabelMetric-BeluzH3o-C3fDXNzp.js rename to custom-toc-highlight/assets/LabelMetric-BeluzH3o-Br-5CSAC.js index 97aa670b..2ffc53fd 100644 --- a/custom-toc-highlight/assets/LabelMetric-BeluzH3o-C3fDXNzp.js +++ b/custom-toc-highlight/assets/LabelMetric-BeluzH3o-Br-5CSAC.js @@ -1 +1 @@ -import{o as g,a1 as U,hm as b}from"./story-BfX8CRfG.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import{v as Y,H as L,V as B}from"./Texture-BCt2hphT-hC4XzHg_.js";import{F as f,I as c}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import{n as P}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{e as R,o as k}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";let m=class p{constructor(t,e,n,i,r,o,a){this.instanceId=t,this.textureKey=e,this.indexStart=n,this.indexCount=i,this.vertexStart=r,this.vertexCount=o,this.overlaps=a}updateBaseOffsets(t){this.vertexStart+=t.vertexFrom,this.indexStart+=t.indexFrom}clone(){return new p(this.instanceId,this.textureKey,this.indexStart,this.indexCount,this.vertexStart,this.vertexCount,this.overlaps)}static write(t,e,n,i,r,o,a,h){t.push(e),t.push(n),t.push(i),t.push(r),t.push(o),t.push(a),t.push(h)}serialize(t){return t.push(this.instanceId),t.push(this.textureKey),t.push(this.indexStart),t.push(this.indexCount),t.push(this.vertexStart),t.push(this.vertexCount),t.push(this.overlaps),t}static deserialize(t){const e=t.readInt32(),n=t.readInt32(),i=t.readInt32(),r=t.readInt32(),o=t.readInt32(),a=t.readInt32(),h=t.readInt32();return new p(e,n,i,r,o,a,h)}};m.byteSizeHint=7*Uint32Array.BYTES_PER_ELEMENT;function I(s,t){if(t!==null){s.push(t.length);for(const e of t)e.serialize(s);return s}s.push(0)}function M(s,t,e){const n=s.readInt32(),i=new Array(n);for(let r=0;rU.getLogger("esri.views.2d.engine.webgl.Utils");function Q(s){switch(s){case f.UNSIGNED_BYTE:return 1;case f.UNSIGNED_SHORT_4_4_4_4:return 2;case f.FLOAT:return 4;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function Z(s){switch(s){case f.UNSIGNED_BYTE:return Uint8Array;case f.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case f.FLOAT:return Float32Array;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function v(s){const t=new Map;for(const e in s){const n=s[e];let i=0;t.set(e,n.map(r=>{const o=new P(r.name,r.count,r.type,i,0,r.normalized||!1);return i+=r.count*Y(r.type),o})),t.get(e).forEach(r=>r.stride=i)}return t}const C=s=>{const t=new Map;for(const e in s)for(const n of s[e])t.set(n.name,n.location);return t},z=s=>{const t={};return s.forEach((e,n)=>t[n]=e?.length?e[0].stride:0),t},d=new Map,tt=(s,t)=>{if(!d.has(s)){const e=v(t),n={strides:z(e),bufferLayouts:e,attributes:C(t)};d.set(s,n)}return d.get(s)},et=s=>s.includes("data:image/svg+xml");function nt(s){const t=[];for(let e=0;e>>31;let n=t>>>23&255,i=8388607&t;return n-=127,n>15?e<<15|31744:n<-25?0:(n<-14&&(i+=8388608,i/=2**(-14-n),n=-15),n+=15,i/=8192,i=G(i,1023),e<<15|n<<10|i)}function G(s,t){const e=Math.floor(s),n=s-e;return e.5||n===.5&&e%2==1)?e+1:e}function T(s){let t=s>>>15,e=s>>10&31,n=1023&s;return t=t?-1:1,e-=15,n/=1024,e>-15?n+=1:e=-14,t*2**e*n}function ot(s){const t=s.map(({name:e,count:n,type:i})=>`${e}.${n}.${i}`).join(",");return b(t)}function u(s,t,e,n,i,r,o){if(s.primitiveName===t){let a=n?.readWithDefault(i,r,s[e]&&o);return s.type==="text"&&(a=a.toString()),void(s[e]=a)}if("type"in s&&s.type!=null){if(s.effects)for(const a of s.effects)u(a,t,e,n,i,r,o);switch(s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(s.symbolLayers)for(const a of s.symbolLayers)u(a,t,e,n,i,r,o);break;case"CIMTextSymbol":s.symbol&&u(s.symbol,t,e,n,i,r,o);break;case"CIMHatchFill":s.lineSymbol&&u(s.lineSymbol,t,e,n,i,r,o);break;case"CIMPictureMarker":case"CIMCharacterMarker":case"CIMVectorMarker":if(s.markerPlacement&&u(s.markerPlacement,t,e,n,i,r,o),s.type==="CIMVectorMarker"&&s.markerGraphics)for(const a of s.markerGraphics)u(a,t,e,n,i,r,o),u(a.symbol,t,e,n,i,r,o)}}}const W=400;function at(s){const t=s.width;return s.effects!=null?W:Math.max(1.25*t,8)}function ct(s,t,e,n){const i=e.packPrecisionFactor??1;switch(e.type){case c.BYTE:if(e.count===1)s.setInt8(n+e.offset,t*i);else for(let r=0;rU.getLogger("esri.views.2d.engine.webgl.Utils");function Q(s){switch(s){case f.UNSIGNED_BYTE:return 1;case f.UNSIGNED_SHORT_4_4_4_4:return 2;case f.FLOAT:return 4;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function Z(s){switch(s){case f.UNSIGNED_BYTE:return Uint8Array;case f.UNSIGNED_SHORT_4_4_4_4:return Uint16Array;case f.FLOAT:return Float32Array;default:return void x().error(new g("webgl-utils",`Unable to handle type ${s}`))}}function v(s){const t=new Map;for(const e in s){const n=s[e];let i=0;t.set(e,n.map(r=>{const o=new P(r.name,r.count,r.type,i,0,r.normalized||!1);return i+=r.count*Y(r.type),o})),t.get(e).forEach(r=>r.stride=i)}return t}const C=s=>{const t=new Map;for(const e in s)for(const n of s[e])t.set(n.name,n.location);return t},z=s=>{const t={};return s.forEach((e,n)=>t[n]=e?.length?e[0].stride:0),t},d=new Map,tt=(s,t)=>{if(!d.has(s)){const e=v(t),n={strides:z(e),bufferLayouts:e,attributes:C(t)};d.set(s,n)}return d.get(s)},et=s=>s.includes("data:image/svg+xml");function nt(s){const t=[];for(let e=0;e>>31;let n=t>>>23&255,i=8388607&t;return n-=127,n>15?e<<15|31744:n<-25?0:(n<-14&&(i+=8388608,i/=2**(-14-n),n=-15),n+=15,i/=8192,i=G(i,1023),e<<15|n<<10|i)}function G(s,t){const e=Math.floor(s),n=s-e;return e.5||n===.5&&e%2==1)?e+1:e}function T(s){let t=s>>>15,e=s>>10&31,n=1023&s;return t=t?-1:1,e-=15,n/=1024,e>-15?n+=1:e=-14,t*2**e*n}function ot(s){const t=s.map(({name:e,count:n,type:i})=>`${e}.${n}.${i}`).join(",");return b(t)}function u(s,t,e,n,i,r,o){if(s.primitiveName===t){let a=n?.readWithDefault(i,r,s[e]&&o);return s.type==="text"&&(a=a.toString()),void(s[e]=a)}if("type"in s&&s.type!=null){if(s.effects)for(const a of s.effects)u(a,t,e,n,i,r,o);switch(s.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(s.symbolLayers)for(const a of s.symbolLayers)u(a,t,e,n,i,r,o);break;case"CIMTextSymbol":s.symbol&&u(s.symbol,t,e,n,i,r,o);break;case"CIMHatchFill":s.lineSymbol&&u(s.lineSymbol,t,e,n,i,r,o);break;case"CIMPictureMarker":case"CIMCharacterMarker":case"CIMVectorMarker":if(s.markerPlacement&&u(s.markerPlacement,t,e,n,i,r,o),s.type==="CIMVectorMarker"&&s.markerGraphics)for(const a of s.markerGraphics)u(a,t,e,n,i,r,o),u(a.symbol,t,e,n,i,r,o)}}}const W=400;function at(s){const t=s.width;return s.effects!=null?W:Math.max(1.25*t,8)}function ct(s,t,e,n){const i=e.packPrecisionFactor??1;switch(e.type){case c.BYTE:if(e.count===1)s.setInt8(n+e.offset,t*i);else for(let r=0;ri.map(i=>d[i]); -import{_ as p}from"./main-ugzBrWNm.js";import{I as h,bR as b,n as y,J as l,aU as m,a1 as d,a as f,f as v,o as g,v as r,C as E,S as i,i as w,aB as I}from"./story-BfX8CRfG.js";import{k as _}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";async function L(t){const o="portalItem"in t?t:{portalItem:t},{fromItem:n}=await p(async()=>{const{fromItem:a}=await import("./portalLayers-Bh9bAhk4-BP6A8Lj4.js");return{fromItem:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url).then(a=>a.p);try{return await n(o)}catch(a){const s=o?.portalItem,u=s?.id||"unset",c=s?.portal?.url||E.portalUrl;throw d.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+c+"', id: '"+u+"')",a),a}}let D=0,e=class extends h.EventedMixin(b(I)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y(-180,-90,180,90,l.WGS84),this.id=Date.now().toString(16)+"-layer-"+D++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=l.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(t){const o=typeof t=="string"?{url:t}:t;return(await p(async()=>{const{fromUrl:n}=await import("./arcgisLayers-CL8_MH7S-D1YV7ss3.js");return{fromUrl:n}},__vite__mapDeps([12,2,3,1,4,6,5,7,8]),import.meta.url)).fromUrl(o)}static fromPortalItem(t){return L(t)}initialize(){this.when().catch(t=>{m(t)||d.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})})}destroy(){const t=this.parent;if(t){const o=this;"layers"in t&&t.layers.includes(o)?t.layers.remove(o):"tables"in t&&t.tables.includes(o)?t.tables.remove(o):"baseLayers"in t&&t.baseLayers.includes(o)?t.baseLayers.remove(o):"referenceLayers"in t&&t.referenceLayers.includes(o)&&t.referenceLayers.remove(o),this._set("parent",null)}}get effectiveVisible(){let t=this.visible;const o=this.parent;return t&&o&&"effectiveVisible"in o&&(t&&=o.effectiveVisible),t}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return f(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await v(t,{query:{f:"json"},responseType:"json"})).data;throw new g("layer:no-attribution-data","Layer does not have attribution data")}};r([i({type:String})],e.prototype,"attributionDataUrl",void 0),r([i({readOnly:!0})],e.prototype,"effectiveVisible",null),r([i({type:y})],e.prototype,"fullExtent",void 0),r([i({readOnly:!0})],e.prototype,"hasAttributionData",null),r([i({type:String,clonable:!1})],e.prototype,"id",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"legendEnabled",void 0),r([i({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),r([i({type:Number,range:{min:0,max:1},nonNullable:!0})],e.prototype,"opacity",void 0),r([i({clonable:!1})],e.prototype,"parent",void 0),r([i({readOnly:!0})],e.prototype,"parsedUrl",null),r([i({type:Boolean,readOnly:!0})],e.prototype,"persistenceEnabled",void 0),r([i({type:Boolean})],e.prototype,"popupEnabled",void 0),r([i({type:Boolean})],e.prototype,"attributionVisible",void 0),r([i({type:l})],e.prototype,"spatialReference",void 0),r([i({type:String})],e.prototype,"title",void 0),r([i({readOnly:!0,json:{read:!1}})],e.prototype,"type",void 0),r([i()],e.prototype,"url",void 0),r([i({type:_})],e.prototype,"visibilityTimeExtent",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"visible",void 0),e=r([w("esri.layers.Layer")],e);const V=e;export{V as D}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./portalLayers-Bh9bAhk4-Y1T2RWf3.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./PortalItem-CctGdnxF-CfFOGshS.js","./fetchService-DbaKmJhP-Ccg-phWf.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./arcgisLayers-CL8_MH7S-u1jA7AmV.js"])))=>i.map(i=>d[i]); +import{_ as p}from"./main-QGPoLsvl.js";import{I as h,bR as b,n as y,J as l,aU as m,a1 as d,a as f,f as v,o as g,v as r,C as E,S as i,i as w,aB as I}from"./story-Doly9N9p.js";import{k as _}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";async function L(t){const o="portalItem"in t?t:{portalItem:t},{fromItem:n}=await p(async()=>{const{fromItem:a}=await import("./portalLayers-Bh9bAhk4-Y1T2RWf3.js");return{fromItem:a}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url).then(a=>a.p);try{return await n(o)}catch(a){const s=o?.portalItem,u=s?.id||"unset",c=s?.portal?.url||E.portalUrl;throw d.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+c+"', id: '"+u+"')",a),a}}let D=0,e=class extends h.EventedMixin(b(I)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new y(-180,-90,180,90,l.WGS84),this.id=Date.now().toString(16)+"-layer-"+D++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=l.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(t){const o=typeof t=="string"?{url:t}:t;return(await p(async()=>{const{fromUrl:n}=await import("./arcgisLayers-CL8_MH7S-u1jA7AmV.js");return{fromUrl:n}},__vite__mapDeps([12,2,3,1,4,6,5,7,8]),import.meta.url)).fromUrl(o)}static fromPortalItem(t){return L(t)}initialize(){this.when().catch(t=>{m(t)||d.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:t})})}destroy(){const t=this.parent;if(t){const o=this;"layers"in t&&t.layers.includes(o)?t.layers.remove(o):"tables"in t&&t.tables.includes(o)?t.tables.remove(o):"baseLayers"in t&&t.baseLayers.includes(o)?t.baseLayers.remove(o):"referenceLayers"in t&&t.referenceLayers.includes(o)&&t.referenceLayers.remove(o),this._set("parent",null)}}get effectiveVisible(){let t=this.visible;const o=this.parent;return t&&o&&"effectiveVisible"in o&&(t&&=o.effectiveVisible),t}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return f(this.url)}async fetchAttributionData(){const t=this.attributionDataUrl;if(this.hasAttributionData&&t)return(await v(t,{query:{f:"json"},responseType:"json"})).data;throw new g("layer:no-attribution-data","Layer does not have attribution data")}};r([i({type:String})],e.prototype,"attributionDataUrl",void 0),r([i({readOnly:!0})],e.prototype,"effectiveVisible",null),r([i({type:y})],e.prototype,"fullExtent",void 0),r([i({readOnly:!0})],e.prototype,"hasAttributionData",null),r([i({type:String,clonable:!1})],e.prototype,"id",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"legendEnabled",void 0),r([i({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),r([i({type:Number,range:{min:0,max:1},nonNullable:!0})],e.prototype,"opacity",void 0),r([i({clonable:!1})],e.prototype,"parent",void 0),r([i({readOnly:!0})],e.prototype,"parsedUrl",null),r([i({type:Boolean,readOnly:!0})],e.prototype,"persistenceEnabled",void 0),r([i({type:Boolean})],e.prototype,"popupEnabled",void 0),r([i({type:Boolean})],e.prototype,"attributionVisible",void 0),r([i({type:l})],e.prototype,"spatialReference",void 0),r([i({type:String})],e.prototype,"title",void 0),r([i({readOnly:!0,json:{read:!1}})],e.prototype,"type",void 0),r([i()],e.prototype,"url",void 0),r([i({type:_})],e.prototype,"visibilityTimeExtent",void 0),r([i({type:Boolean,nonNullable:!0})],e.prototype,"visible",void 0),e=r([w("esri.layers.Layer")],e);const V=e;export{V as D}; diff --git a/custom-toc-highlight/assets/LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js b/custom-toc-highlight/assets/LayerFloorInfo-DRJ8wfwx-DKergZyZ.js similarity index 89% rename from custom-toc-highlight/assets/LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js rename to custom-toc-highlight/assets/LayerFloorInfo-DRJ8wfwx-DKergZyZ.js index c8002740..82d0a887 100644 --- a/custom-toc-highlight/assets/LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js +++ b/custom-toc-highlight/assets/LayerFloorInfo-DRJ8wfwx-DKergZyZ.js @@ -1 +1 @@ -import{v as l,S as o,i as t,e as s,ag as v}from"./story-BfX8CRfG.js";var i;let e=i=class extends s{constructor(r){super(r),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new v}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};l([o({type:String,json:{write:!0}})],e.prototype,"floorField",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllMode",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllLevelIds",void 0),e=i=l([t("esri.layers.support.LayerFloorInfo")],e);const n=e;export{n as v}; +import{v as l,S as o,i as t,e as s,ag as v}from"./story-Doly9N9p.js";var i;let e=i=class extends s{constructor(r){super(r),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new v}clone(){return new i({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};l([o({type:String,json:{write:!0}})],e.prototype,"floorField",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllMode",void 0),l([o({json:{read:!1,write:!1}})],e.prototype,"viewAllLevelIds",void 0),e=i=l([t("esri.layers.support.LayerFloorInfo")],e);const n=e;export{n as v}; diff --git a/custom-toc-highlight/assets/LayerView-Bish-E63-rB2WUWF4.js b/custom-toc-highlight/assets/LayerView-Bish-E63-DK1SFHE3.js similarity index 96% rename from custom-toc-highlight/assets/LayerView-Bish-E63-rB2WUWF4.js rename to custom-toc-highlight/assets/LayerView-Bish-E63-DK1SFHE3.js index 2463891d..deb82c80 100644 --- a/custom-toc-highlight/assets/LayerView-Bish-E63-rB2WUWF4.js +++ b/custom-toc-highlight/assets/LayerView-Bish-E63-DK1SFHE3.js @@ -1 +1 @@ -import{v as e,S as i,i as u,g as C,ag as b,bR as O,at as x,I as H,j as P,a1 as _,aA as q,e as T,d as E,n as I,l as j,am as L,o as N,ah as o,ax as l,ai as U}from"./story-BfX8CRfG.js";import{x as V}from"./Container-BcuL1ZEG-DxXVQv25.js";import{i as A,l as k,a as M,r as $,b as B}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{l as R,e as D}from"./layerViewUtils-DURAPenP-CfS78eqb.js";import{i as F}from"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";function G(s){return s!=null&&typeof s=="object"&&s.type==="2d"&&s.view2dType==="linkchart"}let c=class extends T{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};e([i({readOnly:!0})],c.prototype,"version",null),c=e([u("esri.views.layers.support.ClipArea")],c);const S=c;var f;let p=f=class extends S{constructor(s){super(s),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new f({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")}};e([i({type:[Number,String],json:{write:!0}})],p.prototype,"left",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"right",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"top",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"bottom",void 0),p=f=e([u("esri.views.layers.support.ClipRect")],p);const z=p;var w;const X={base:E,key:"type",typeMap:{extent:I,polygon:j}};let y=w=class extends S{constructor(s){super(s),this.type="geometry",this.geometry=null}clone(){return new w({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};e([i({types:X,json:{read:C,write:!0}})],y.prototype,"geometry",void 0),y=w=e([u("esri.views.layers.support.Geometry")],y);const J=y;let g=class extends S{constructor(s){super(s),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};e([i({type:[[[Number]]],json:{write:!0}})],g.prototype,"path",void 0),g=e([u("esri.views.layers.support.Path")],g);const K=g,m=b.ofType({key:"type",base:null,typeMap:{rect:z,path:K,geometry:J}}),Q=new(b.ofType(A)),ie=s=>{let n=class extends s{constructor(){super(...arguments),this.attached=!1,this.clips=new m,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const r=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&r&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new N("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 V),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,t=>{this.container&&(this.container.visible=!t)},l),o(()=>this.updateSuspended,t=>{this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},l),o(()=>this.layer?.opacity??1,t=>{this.container&&(this.container.opacity=t)},l),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",t=>{this.container&&(this.container.blendMode=t)},l),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,t=>{this.container&&(this.container.effect=t)},l),o(()=>this._mergedHighlights.items.map(t=>({name:t.name,options:{fillColor:t.options.color,haloColor:t.options.haloColor,fillOpacity:t.options.fillOpacity,haloOpacity:t.options.haloOpacity,haloWidth:t.options.haloWidth,haloBlur:t.options.haloBlur}})),()=>{this.container.highlightGradient=M(this.container.highlightGradient,this._mergedHighlights.items)},l),o(()=>this._mergedHighlights.items.map(t=>t.name),()=>{this._updateHighlights()}),U(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},l),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:t,scaleRange:h})=>{const d=D(h,t);d!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=d)},l)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}_updateHighlights(){}destroy(){this.processDetach(),this.updateRequested=!1}get highlightOptions(){return $(this)}set highlightOptions(r){B(this,r)}get _mergedHighlights(){if(!this.view)return Q;if(!this.highlights)return this.view.highlights;const r=this.view.highlights.clone();for(const t of this.highlights){const h=r.find(d=>d.name===t.name);h&&(h.options=t.options)}return r}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const r=this.view?.spatialReference;return r==null||this.supportsSpatialReference(r)}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating||this.container.transitioning)}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(r){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",r),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(r))):this.updateRequested=!1}hitTest(r,t){return Promise.resolve(null)}supportsSpatialReference(r){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":break;default:if(G(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const r=super.getSuspendInfo(),t=!this.spatialReferenceSupported;return t&&(r.spatialReferenceNotSupported=t),r}addAttachHandles(r){this.addHandles(r,"attach")}_getHighlightBits(r){r=new Set(r);let t=1,h=0;if(!this.view)return 0;const d=this._mergedHighlights;for(const{name:v}of d)r.delete(v)&&(h=t),t<<=1;for(const v of r)_.getLogger(this).error("#highlights",`${v} was not found. Features in this group will not be highlighted.`);return h}};return e([i()],n.prototype,"attached",void 0),e([i({type:m,set(r){const t=L(r,this._get("clips"),m);this._set("clips",t)}})],n.prototype,"clips",void 0),e([i()],n.prototype,"container",void 0),e([i({type:k})],n.prototype,"highlightOptions",null),e([i({type:b.ofType(A)})],n.prototype,"highlights",void 0),e([i()],n.prototype,"_mergedHighlights",null),e([i()],n.prototype,"moving",void 0),e([i({readOnly:!0})],n.prototype,"spatialReferenceSupported",null),e([i({readOnly:!0})],n.prototype,"updateParameters",void 0),e([i()],n.prototype,"updateRequested",void 0),e([i()],n.prototype,"updating",null),e([i()],n.prototype,"view",void 0),e([i()],n.prototype,"_visibleAtCurrentScale",void 0),e([i({readOnly:!0})],n.prototype,"visibleAtCurrentScale",null),n=e([u("esri.views.2d.layers.LayerView2D")],n),n};let a=class extends O(x(H.EventedMixin(P))){constructor(s){super(s),this._updatingHandles=new F,this.layer=null,this.parent=null}initialize(){this.when().catch(s=>{if(s.name!=="layerview:create-error"){const n=this.layer&&this.layer.id||"no id",r=this.layer?.title||"no title";_.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${n}')`,s)}})}destroy(){this._updatingHandles=q(this._updatingHandles)}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get updateSuspended(){return this.suspended}get visible(){return this.layer?.visible===!0}set visible(s){this._overrideIfSome("visible",s)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){const s=this.view.timeExtent,n=this.layer?.visibilityTimeExtent;return!s||!n||!s.intersection(n).isEmpty}canResume(){const s=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&R(s)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){const s=this.parent?.suspended?this.parent.suspendInfo:{};this.view?.ready||(s.viewNotReady=!0),this.layer&&this.layer.loaded||(s.layerNotLoaded=!0);const n=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return R(n)&&this.visibleAtCurrentScale||(s.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(s.outsideVisibilityTimeExtent=!0),this.visible||(s.layerInvisible=!0),s}isUpdating(){return!1}};e([i()],a.prototype,"view",void 0),e([i()],a.prototype,"fullOpacity",null),e([i()],a.prototype,"layer",void 0),e([i()],a.prototype,"parent",void 0),e([i({readOnly:!0})],a.prototype,"suspended",null),e([i({readOnly:!0})],a.prototype,"suspendInfo",null),e([i({readOnly:!0})],a.prototype,"legendEnabled",null),e([i({type:Boolean,readOnly:!0})],a.prototype,"updating",null),e([i({readOnly:!0})],a.prototype,"updatingProgress",null),e([i()],a.prototype,"updateSuspended",null),e([i()],a.prototype,"visible",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentScale",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentTimeExtent",null),a=e([u("esri.views.layers.LayerView")],a);const se=a;export{J as A,ie as X,se as Y}; +import{v as e,S as i,i as u,g as C,ag as b,bR as O,at as x,I as H,j as P,a1 as _,aA as q,e as T,d as E,n as I,l as j,am as L,o as N,ah as o,ax as l,ai as U}from"./story-Doly9N9p.js";import{x as V}from"./Container-BcuL1ZEG-DVZvemLA.js";import{i as A,l as k,a as M,r as $,b as B}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{l as R,e as D}from"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import{i as F}from"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";function G(s){return s!=null&&typeof s=="object"&&s.type==="2d"&&s.view2dType==="linkchart"}let c=class extends T{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};e([i({readOnly:!0})],c.prototype,"version",null),c=e([u("esri.views.layers.support.ClipArea")],c);const S=c;var f;let p=f=class extends S{constructor(s){super(s),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new f({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")}};e([i({type:[Number,String],json:{write:!0}})],p.prototype,"left",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"right",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"top",void 0),e([i({type:[Number,String],json:{write:!0}})],p.prototype,"bottom",void 0),p=f=e([u("esri.views.layers.support.ClipRect")],p);const z=p;var w;const X={base:E,key:"type",typeMap:{extent:I,polygon:j}};let y=w=class extends S{constructor(s){super(s),this.type="geometry",this.geometry=null}clone(){return new w({geometry:this.geometry?.clone()??null})}commitVersionProperties(){this.commitProperty("geometry")}};e([i({types:X,json:{read:C,write:!0}})],y.prototype,"geometry",void 0),y=w=e([u("esri.views.layers.support.Geometry")],y);const J=y;let g=class extends S{constructor(s){super(s),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};e([i({type:[[[Number]]],json:{write:!0}})],g.prototype,"path",void 0),g=e([u("esri.views.layers.support.Path")],g);const K=g,m=b.ofType({key:"type",base:null,typeMap:{rect:z,path:K,geometry:J}}),Q=new(b.ofType(A)),ie=s=>{let n=class extends s{constructor(){super(...arguments),this.attached=!1,this.clips=new m,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const r=this.view?.spatialReferenceLocked??!0;this.view?.spatialReference&&r&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new N("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 V),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,t=>{this.container&&(this.container.visible=!t)},l),o(()=>this.updateSuspended,t=>{this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},l),o(()=>this.layer?.opacity??1,t=>{this.container&&(this.container.opacity=t)},l),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",t=>{this.container&&(this.container.blendMode=t)},l),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,t=>{this.container&&(this.container.effect=t)},l),o(()=>this._mergedHighlights.items.map(t=>({name:t.name,options:{fillColor:t.options.color,haloColor:t.options.haloColor,fillOpacity:t.options.fillOpacity,haloOpacity:t.options.haloOpacity,haloWidth:t.options.haloWidth,haloBlur:t.options.haloBlur}})),()=>{this.container.highlightGradient=M(this.container.highlightGradient,this._mergedHighlights.items)},l),o(()=>this._mergedHighlights.items.map(t=>t.name),()=>{this._updateHighlights()}),U(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},l),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:t,scaleRange:h})=>{const d=D(h,t);d!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=d)},l)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}_updateHighlights(){}destroy(){this.processDetach(),this.updateRequested=!1}get highlightOptions(){return $(this)}set highlightOptions(r){B(this,r)}get _mergedHighlights(){if(!this.view)return Q;if(!this.highlights)return this.view.highlights;const r=this.view.highlights.clone();for(const t of this.highlights){const h=r.find(d=>d.name===t.name);h&&(h.options=t.options)}return r}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const r=this.view?.spatialReference;return r==null||this.supportsSpatialReference(r)}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating||this.container.transitioning)}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(r){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",r),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(r))):this.updateRequested=!1}hitTest(r,t){return Promise.resolve(null)}supportsSpatialReference(r){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":break;default:if(G(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const r=super.getSuspendInfo(),t=!this.spatialReferenceSupported;return t&&(r.spatialReferenceNotSupported=t),r}addAttachHandles(r){this.addHandles(r,"attach")}_getHighlightBits(r){r=new Set(r);let t=1,h=0;if(!this.view)return 0;const d=this._mergedHighlights;for(const{name:v}of d)r.delete(v)&&(h=t),t<<=1;for(const v of r)_.getLogger(this).error("#highlights",`${v} was not found. Features in this group will not be highlighted.`);return h}};return e([i()],n.prototype,"attached",void 0),e([i({type:m,set(r){const t=L(r,this._get("clips"),m);this._set("clips",t)}})],n.prototype,"clips",void 0),e([i()],n.prototype,"container",void 0),e([i({type:k})],n.prototype,"highlightOptions",null),e([i({type:b.ofType(A)})],n.prototype,"highlights",void 0),e([i()],n.prototype,"_mergedHighlights",null),e([i()],n.prototype,"moving",void 0),e([i({readOnly:!0})],n.prototype,"spatialReferenceSupported",null),e([i({readOnly:!0})],n.prototype,"updateParameters",void 0),e([i()],n.prototype,"updateRequested",void 0),e([i()],n.prototype,"updating",null),e([i()],n.prototype,"view",void 0),e([i()],n.prototype,"_visibleAtCurrentScale",void 0),e([i({readOnly:!0})],n.prototype,"visibleAtCurrentScale",null),n=e([u("esri.views.2d.layers.LayerView2D")],n),n};let a=class extends O(x(H.EventedMixin(P))){constructor(s){super(s),this._updatingHandles=new F,this.layer=null,this.parent=null}initialize(){this.when().catch(s=>{if(s.name!=="layerview:create-error"){const n=this.layer&&this.layer.id||"no id",r=this.layer?.title||"no title";_.getLogger(this).error("#resolve()",`Failed to resolve layer view (layer title: '${r}', id: '${n}')`,s)}})}destroy(){this._updatingHandles=q(this._updatingHandles)}get fullOpacity(){return(this.layer?.opacity??1)*(this.parent?.fullOpacity??1)}get suspended(){return this.destroyed||!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){return!this.suspended&&this.layer?.legendEnabled===!0}get updating(){return!(!this._updatingHandles?.updating&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get updateSuspended(){return this.suspended}get visible(){return this.layer?.visible===!0}set visible(s){this._overrideIfSome("visible",s)}get visibleAtCurrentScale(){return!0}get visibleAtCurrentTimeExtent(){const s=this.view.timeExtent,n=this.layer?.visibilityTimeExtent;return!s||!n||!s.intersection(n).isEmpty}canResume(){const s=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return this.visible&&this.layer?.loaded&&!this.parent?.suspended&&this.view?.ready&&R(s)&&this.visibleAtCurrentScale&&this.visibleAtCurrentTimeExtent||!1}getSuspendInfo(){const s=this.parent?.suspended?this.parent.suspendInfo:{};this.view?.ready||(s.viewNotReady=!0),this.layer&&this.layer.loaded||(s.layerNotLoaded=!0);const n=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;return R(n)&&this.visibleAtCurrentScale||(s.outsideScaleRange=!0),this.visibleAtCurrentTimeExtent||(s.outsideVisibilityTimeExtent=!0),this.visible||(s.layerInvisible=!0),s}isUpdating(){return!1}};e([i()],a.prototype,"view",void 0),e([i()],a.prototype,"fullOpacity",null),e([i()],a.prototype,"layer",void 0),e([i()],a.prototype,"parent",void 0),e([i({readOnly:!0})],a.prototype,"suspended",null),e([i({readOnly:!0})],a.prototype,"suspendInfo",null),e([i({readOnly:!0})],a.prototype,"legendEnabled",null),e([i({type:Boolean,readOnly:!0})],a.prototype,"updating",null),e([i({readOnly:!0})],a.prototype,"updatingProgress",null),e([i()],a.prototype,"updateSuspended",null),e([i()],a.prototype,"visible",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentScale",null),e([i({readOnly:!0})],a.prototype,"visibleAtCurrentTimeExtent",null),a=e([u("esri.views.layers.LayerView")],a);const se=a;export{J as A,ie as X,se as Y}; diff --git a/custom-toc-highlight/assets/LercWorker-C1_0ReXV-BnFiBWbM.js b/custom-toc-highlight/assets/LercWorker-C1_0ReXV-C4s5fobc.js similarity index 98% rename from custom-toc-highlight/assets/LercWorker-C1_0ReXV-BnFiBWbM.js rename to custom-toc-highlight/assets/LercWorker-C1_0ReXV-C4s5fobc.js index 10ad02b6..4feb8145 100644 --- a/custom-toc-highlight/assets/LercWorker-C1_0ReXV-BnFiBWbM.js +++ b/custom-toc-highlight/assets/LercWorker-C1_0ReXV-C4s5fobc.js @@ -1 +1 @@ -import{hA as P}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";var b={};b.defaultNoDataValue=P(-1/0),b.decode=function(i,t){var s=(t=t||{}).encodedMaskData||t.encodedMaskData===null,e=E(i,t.inputOffset||0,s),c=t.noDataValue!=null?P(t.noDataValue):b.defaultNoDataValue,a=Y(e,t.pixelType||Float32Array,t.encodedMaskData,c,t.returnMask),r={width:e.width,height:e.height,pixelData:a.resultPixels,minValue:e.pixels.minValue,maxValue:e.pixels.maxValue,noDataValue:c};return a.resultMask&&(r.maskData=a.resultMask),t.returnEncodedMask&&e.mask&&(r.encodedMaskData=e.mask.bitset?e.mask.bitset:null),t.returnFileInfo&&(r.fileInfo=X(e,c),t.computeUsedBitDepths&&(r.fileInfo.bitDepths=F(e))),r};var Y=function(i,t,s,e,c){var a,r,d=0,m=i.pixels.numBlocksX,k=i.pixels.numBlocksY,y=Math.floor(i.width/m),v=Math.floor(i.height/k),p=2*i.maxZError;s=s||(i.mask?i.mask.bitset:null),a=new t(i.width*i.height),c&&s&&(r=new Uint8Array(i.width*i.height));for(var g,h,x=new Float32Array(y*v),U=0;U<=k;U++){var V=U!==k?v:i.height%k;if(V!==0)for(var M=0;M<=m;M++){var o=M!==m?y:i.width%m;if(o!==0){var D,l,f,w,n=U*i.width*v+M*y,B=i.width-o,u=i.pixels.blocks[d];if(u.encoding<2?(u.encoding===0?D=u.rawData:(S(u.stuffedData,u.bitsPerPixel,u.numValidPixels,u.offset,p,x,i.pixels.maxValue),D=x),l=0):f=u.encoding===2?0:u.offset,s)for(h=0;h>3],w<<=7&n),g=0;g>3]),128&w?(r&&(r[n]=1),a[n++]=u.encoding<2?D[l++]:f):(r&&(r[n]=0),a[n++]=e),w<<=1;n+=B}else if(u.encoding<2)for(h=0;h0){var r=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(a=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,k=0;do{if(d>0)for(;d--;)r[k++]=a.getUint8(m++);else{var y=a.getUint8(m++);for(d=-d;d--;)r[k++]=y}d=a.getInt16(m,!0),m+=2}while(m0?1:0),h=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*h);for(var x=1e9,U=0,V=0;V3)throw"Invalid block encoding ("+l.encoding+")";if(l.encoding!==2){if(f!==0&&f!==2){if(f>>=6,l.offsetType=f,f===2)l.offset=a.getInt8(1),o++;else if(f===1)l.offset=a.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";l.offset=a.getFloat32(1,!0),o+=4}if(x=Math.min(l.offset,x),l.encoding===1)if(f=a.getUint8(o),o++,l.bitsPerPixel=63&f,f>>=6,l.numValidPixelsType=f,f===2)l.numValidPixels=a.getUint8(o),o++;else if(f===1)l.numValidPixels=a.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";l.numValidPixels=a.getUint32(o,!0),o+=4}}var w;if(t+=o,l.encoding!=3){if(l.encoding===0){var n=(e.pixels.numBytes-1)/4;if(n!==Math.floor(n))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*n),new Uint8Array(w).set(new Uint8Array(i,t,4*n));for(var B=new Float32Array(w),u=0;u=t)m=k>>>p-t&y,p-=t;else{var x=t-p;m=(k&y)<>>(p=32-x)}a[d]=m>3],w<<=7&n),g=0;g>3]),128&w?(r&&(r[n]=1),a[n++]=u.encoding<2?D[l++]:f):(r&&(r[n]=0),a[n++]=e),w<<=1;n+=B}else if(u.encoding<2)for(h=0;h0){var r=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(a=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,k=0;do{if(d>0)for(;d--;)r[k++]=a.getUint8(m++);else{var y=a.getUint8(m++);for(d=-d;d--;)r[k++]=y}d=a.getInt16(m,!0),m+=2}while(m0?1:0),h=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*h);for(var x=1e9,U=0,V=0;V3)throw"Invalid block encoding ("+l.encoding+")";if(l.encoding!==2){if(f!==0&&f!==2){if(f>>=6,l.offsetType=f,f===2)l.offset=a.getInt8(1),o++;else if(f===1)l.offset=a.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";l.offset=a.getFloat32(1,!0),o+=4}if(x=Math.min(l.offset,x),l.encoding===1)if(f=a.getUint8(o),o++,l.bitsPerPixel=63&f,f>>=6,l.numValidPixelsType=f,f===2)l.numValidPixels=a.getUint8(o),o++;else if(f===1)l.numValidPixels=a.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";l.numValidPixels=a.getUint32(o,!0),o+=4}}var w;if(t+=o,l.encoding!=3){if(l.encoding===0){var n=(e.pixels.numBytes-1)/4;if(n!==Math.floor(n))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*n),new Uint8Array(w).set(new Uint8Array(i,t,4*n));for(var B=new Float32Array(w),u=0;u=t)m=k>>>p-t&y,p-=t;else{var x=t-p;m=(k&y)<>>(p=32-x)}a[d]=mthis._computeExtent(),t=>{t?.pending==null&&this._set("extent",t!=null?t.extent:null)},O))}get targets(){return this._get("targets")||new f}set targets(t){this._set("targets",j(t,this.targets,f))}get spatialReference(){return this.observer?.position!=null?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[this.observer?.position]}async waitComputeExtent(){const t=this._computeExtent();return t!=null?t.pending:Promise.resolve()}_computeExtent(){const t=this.spatialReference;if(this.observer?.position==null||t==null)return null;const r=p=>Y(p.position,p.elevationInfo)==="absolute-height",n=this.observer.position,v=C(n.x,n.y,n.z,n.x,n.y,n.z);for(const p of this.targets)if(p.position!=null){const u=X(p.position,t);if(u.pending!=null)return{pending:u.pending,extent:null};if(u.geometry!=null){const{x:z,y:A,z:S}=u.geometry;F(v,[z,A,S])}}const d=H(v,t);return r(this.observer)&&this.targets.every(r)||(d.zmin=void 0,d.zmax=void 0),{pending:null,extent:d}}clear(){this.observer=null,this.targets.removeAll()}};e([i({type:["line-of-sight"]})],o.prototype,"type",void 0),e([i({type:E,json:{read:!0,write:!0}})],o.prototype,"observer",void 0),e([i({cast:P,type:f,nonNullable:!0,json:{read:!0,write:!0}})],o.prototype,"targets",null),e([i({value:null,readOnly:!0})],o.prototype,"extent",void 0),e([i({readOnly:!0})],o.prototype,"spatialReference",null),e([i({readOnly:!0})],o.prototype,"requiredPropertiesForEditing",null),o=e([h("esri.analysis.LineOfSightAnalysis")],o);const c=o,V=g.ofType(I);let s=class extends U(D(M)){constructor(t){super(t),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new c,this.opacity=1}initialize(){this.addHandles(w(()=>this.analysis,(t,r)=>{r!=null&&r.parent===this&&(r.parent=null),t!=null&&(t.parent=this)},O))}async load(){return this.analysis!=null&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return this.analysis?.observer}set observer(t){const{analysis:r}=this;r&&(r.observer=t)}get targets(){return this.analysis!=null?this.analysis.targets:new g}set targets(t){j(t,this.analysis?.targets)}get fullExtent(){return this.analysis!=null?this.analysis.extent:null}get spatialReference(){return this.analysis!=null?this.analysis.spatialReference:null}releaseAnalysis(t){this.analysis===t&&(this.analysis=new c)}};e([i({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),e([i({type:["LineOfSightLayer"]})],s.prototype,"operationalLayerType",void 0),e([i({type:E,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],s.prototype,"observer",null),e([i({type:V,json:{read:!0,write:{ignoreOrigin:!0}}})],s.prototype,"targets",null),e([i({nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"analysis",void 0),e([i({readOnly:!0})],s.prototype,"fullExtent",null),e([i({readOnly:!0})],s.prototype,"spatialReference",null),e([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}}}})],s.prototype,"opacity",void 0),e([i({type:["show","hide"]})],s.prototype,"listMode",void 0),s=e([h("esri.layers.LineOfSightLayer")],s);const Rt=s;export{Rt as default}; +import{bA as x,aa as _,d8 as y,v as e,S as i,w as b,i as h,ag as g,dA as P,ah as w,ax as O,am as j,j as T,aP as $,ip as C,it as F,jn as H}from"./story-Doly9N9p.js";import{y as N}from"./Analysis-BPgJ-FCw-CJ_Utx59.js";import{n as q,u as L}from"./featureReferenceUtils-Ct4KY5u7-DuNl8LtH.js";import{C as m}from"./persistable-C6RBwzJi-CrVVP3ny.js";import{q as R}from"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import{V as X}from"./projection-BA9M1R7d-CAbqHZiw.js";import{l as Y}from"./elevationInfoUtils-mOZsPH2J-BlRQDLDN.js";import{m as D}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as M}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{E as U}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import"./main-QGPoLsvl.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./sphere-BenPORjV-B4uz1SYF.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-Bqc6oVGz.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./boundedPlane-DlvE0eNx-BQ9Xop25.js";import"./lineSegment-CcqvCARM-CDEWcAzV.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceExtension-CdQvIDKV-DCvzsrJt.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";let a=class extends x(_(T)){constructor(t){super(t),this.position=null,this.elevationInfo=null,this.feature=null}equals(t){return y(this.position,t.position)&&y(this.elevationInfo,t.elevationInfo)&&q(this.feature,t.feature)}};e([i({type:b,json:{write:{isRequired:!0}}})],a.prototype,"position",void 0),e([i({type:R}),m()],a.prototype,"elevationInfo",void 0),e([i(L)],a.prototype,"feature",void 0),a=e([h("esri.analysis.LineOfSightAnalysisObserver")],a);const E=a;let l=class extends x($){constructor(t){super(t),this.position=null,this.elevationInfo=null,this.feature=null}equals(t){return y(this.position,t.position)&&y(this.elevationInfo,t.elevationInfo)&&q(this.feature,t.feature)}};e([i({type:b}),m()],l.prototype,"position",void 0),e([i({type:R}),m()],l.prototype,"elevationInfo",void 0),e([i(L)],l.prototype,"feature",void 0),l=e([h("esri.analysis.LineOfSightAnalysisTarget")],l);const I=l,f=g.ofType(I);let o=class extends N{constructor(t){super(t),this.type="line-of-sight",this.observer=null,this.extent=null}initialize(){this.addHandles(w(()=>this._computeExtent(),t=>{t?.pending==null&&this._set("extent",t!=null?t.extent:null)},O))}get targets(){return this._get("targets")||new f}set targets(t){this._set("targets",j(t,this.targets,f))}get spatialReference(){return this.observer?.position!=null?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[this.observer?.position]}async waitComputeExtent(){const t=this._computeExtent();return t!=null?t.pending:Promise.resolve()}_computeExtent(){const t=this.spatialReference;if(this.observer?.position==null||t==null)return null;const r=p=>Y(p.position,p.elevationInfo)==="absolute-height",n=this.observer.position,v=C(n.x,n.y,n.z,n.x,n.y,n.z);for(const p of this.targets)if(p.position!=null){const u=X(p.position,t);if(u.pending!=null)return{pending:u.pending,extent:null};if(u.geometry!=null){const{x:z,y:A,z:S}=u.geometry;F(v,[z,A,S])}}const d=H(v,t);return r(this.observer)&&this.targets.every(r)||(d.zmin=void 0,d.zmax=void 0),{pending:null,extent:d}}clear(){this.observer=null,this.targets.removeAll()}};e([i({type:["line-of-sight"]})],o.prototype,"type",void 0),e([i({type:E,json:{read:!0,write:!0}})],o.prototype,"observer",void 0),e([i({cast:P,type:f,nonNullable:!0,json:{read:!0,write:!0}})],o.prototype,"targets",null),e([i({value:null,readOnly:!0})],o.prototype,"extent",void 0),e([i({readOnly:!0})],o.prototype,"spatialReference",null),e([i({readOnly:!0})],o.prototype,"requiredPropertiesForEditing",null),o=e([h("esri.analysis.LineOfSightAnalysis")],o);const c=o,V=g.ofType(I);let s=class extends U(D(M)){constructor(t){super(t),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new c,this.opacity=1}initialize(){this.addHandles(w(()=>this.analysis,(t,r)=>{r!=null&&r.parent===this&&(r.parent=null),t!=null&&(t.parent=this)},O))}async load(){return this.analysis!=null&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return this.analysis?.observer}set observer(t){const{analysis:r}=this;r&&(r.observer=t)}get targets(){return this.analysis!=null?this.analysis.targets:new g}set targets(t){j(t,this.analysis?.targets)}get fullExtent(){return this.analysis!=null?this.analysis.extent:null}get spatialReference(){return this.analysis!=null?this.analysis.spatialReference:null}releaseAnalysis(t){this.analysis===t&&(this.analysis=new c)}};e([i({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),e([i({type:["LineOfSightLayer"]})],s.prototype,"operationalLayerType",void 0),e([i({type:E,json:{read:!0,write:{isRequired:!0,ignoreOrigin:!0}}})],s.prototype,"observer",null),e([i({type:V,json:{read:!0,write:{ignoreOrigin:!0}}})],s.prototype,"targets",null),e([i({nonNullable:!0,json:{read:!1,write:!1}})],s.prototype,"analysis",void 0),e([i({readOnly:!0})],s.prototype,"fullExtent",null),e([i({readOnly:!0})],s.prototype,"spatialReference",null),e([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}}}})],s.prototype,"opacity",void 0),e([i({type:["show","hide"]})],s.prototype,"listMode",void 0),s=e([h("esri.layers.LineOfSightLayer")],s);const Rt=s;export{Rt as default}; diff --git a/custom-toc-highlight/assets/LinkChartLayer-KcYDvLxD-c7VHqPSL.js b/custom-toc-highlight/assets/LinkChartLayer-KcYDvLxD-DTFlqiUN.js similarity index 85% rename from custom-toc-highlight/assets/LinkChartLayer-KcYDvLxD-c7VHqPSL.js rename to custom-toc-highlight/assets/LinkChartLayer-KcYDvLxD-DTFlqiUN.js index b8cc1f04..ef25fbb0 100644 --- a/custom-toc-highlight/assets/LinkChartLayer-KcYDvLxD-c7VHqPSL.js +++ b/custom-toc-highlight/assets/LinkChartLayer-KcYDvLxD-DTFlqiUN.js @@ -1 +1 @@ -import{ag as Y,n as ue,o as Q,ah as Te,av as Ee,a1 as R,an as ce,$ as Ne,bP as ye,w as oe,m as me,v as M,S as w,i as Ie}from"./story-BfX8CRfG.js";import{m as De}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as xe}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{z as B}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{c as _e}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{t as $,A as Re,J as Oe,M as Ae,I as ve,D as Se,L as Ge,N as Pe,E as He,w as Fe,k as T,T as A,n as J,r as V,P as Ue,m as b,b as ge,f as Be,B as fe,o as $e}from"./KnowledgeGraphSublayer-DPj4igi1-BV31Zmdo.js";import{u as ze}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{E as We}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{F as Qe}from"./knowledgeGraphService-DOJz0fzA-DDr_20o0.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./GraphicsLayer-DfeGaYc1-BYhO2Zs8.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-Cq6n6OX7.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./FeatureStore-Co2V0sVE-BwnfsIjJ.js";import"./BoundsStore--N6o1xkF-BnCtocGj.js";import"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js";import"./QueryEngine-CH5uUhZK-BP95Dm56.js";import"./WhereClause-DxwoyBMS-DnXKVpm2.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-wUwu1nm1.js";import"./utils-DyydRFHu-BQ5pghrp.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./utils-tNxq3jkf-B78XlSIE.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./clientSideDefaults-BqqayPct-B-0mBem3.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./popupUtils-B0uZcXX0-DtBp-byj.js";var q;(function(e){e.MULTIPLIER="multiplier",e.ABSOLUTE="absoluteValue"})(q||(q={}));let f=class extends We(ze(je(De(xe)))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(Y.ofType($)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(Y.ofType($)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.inclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.inclusionModeDefinition)throw new Q("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(Te(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),Ee))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}=e;return{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}}_initializeLayerProperties(e){if(!this.title&&this.url){const r=this.url.split("/");this.title=r[r.length-2]}const t=new Set;let i=[],a=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new Q("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.inclusionModeDefinition?.generateAllSublayers?(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((r,d)=>{const u=this._graphTypeLookup.get(d);if(!u)return R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(d);u.type==="relationship"?t.has(d)||(t.add(d),a.push(u)):u.type==="entity"?t.has(d)||(t.add(d),i.push(u)):(R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(d))}):(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]);const o=new Re({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=i,this.memberRelationshipTypes=a,this.dataManager=o}load(e){const t=async()=>{const i=[],a=[];this.loadLayerAssumingLocalCache(),await fe(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(o=>{o.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(o=>{a.push(o.refreshCachedQueryEngine()),i.push(new Promise(r=>{o.on("layerview-create",()=>{r(null)})}))}),this.tables.forEach(o=>{a.push(o.refreshCachedQueryEngine())}),await Promise.all(a)};return this.addResolvingPromise(new Promise(i=>{Qe(this.url).then(async a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})})),this.dataPreloadedInLocalCache){const o=$e.getInstance();for(const[r,d]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const u of d.members?.values()??[]){const L=o.readFromStoreById(`${r}__${u.id}`);L&&ce(this.dataManager.sublayerCaches,r,()=>new Map).set(u.id,L)}await t()}else{const o=this.defaultLinkChartConfig?.layoutMode==="GEOGRAPHIC";this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,o,!0).then(async()=>{Ne(e),await t()}))}i(null)})})),Promise.resolve(this)}set inclusionModeDefinition(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("inclusionModeDefinition",e):R.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}async addRecords(e,t){let i=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(i=await Oe(e,this.dataManager.knowledgeGraph));const a=e.concat(i).filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));await this._handleNewRecords(a)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let a=[];for(const r of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id)&&a.push(r);if(t){const r=new Set,d=[];for(const u of a)if(this.dataManager.nodeConnectionsLookup.has(u.id))for(const L of this.dataManager.nodeConnectionsLookup.get(u.id))r.add(L);for(const u of r)if(this.dataManager.memberIdTypeLookup.has(u))for(const L of this.dataManager.memberIdTypeLookup.get(u))this.dataManager.relationshipTypeNames.has(L)&&d.push({id:u,typeName:L});a=a.concat(d)}this.dataManager.removeFromLayer(a);for(const r of a)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);i&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,this._currentLinkChartConfig.layoutOptions);const o=[];return this.layers.forEach(r=>{o.push(r.refreshCachedQueryEngine())}),await Promise.all(o),this._refreshNamedTypes(),a}async expand(e,t){const i=await this.dataManager.getConnectedRecordIds(e,t),a=i.filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));return await this._handleNewRecords(i),{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===ye.DEFAULTS?this._createSublayers(e,this.layers,t=>!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===ye.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const a=ce(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(({id:o,linkChartLocation:r})=>{if(a.add(o),r){const d=r instanceof _e?r:B(r);this.dataManager.relationshipTypeNames.has(i)?this.relationshipLinkChartDiagramLookup.set(o,d):this.entityLinkChartDiagramLookup.set(o,d)}})})}async calculateLinkChartLayout(e="RADIAL_TREE",t){const i=[],a=[],o=[];this.dataManager.sublayerCaches.forEach((n,l)=>{this.dataManager.entityTypeNames.has(l)?n.forEach(s=>{i.push({typeName:l,feature:s})}):this.dataManager.relationshipTypeNames.has(l)&&n.forEach(s=>{a.push({typeName:l,feature:s})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const r=new Map,d=new Map,u=new Map,L=new Map,k=new Uint8Array(i.length),y=new Float64Array(i.length),m=new Float64Array(i.length),g=new Float64Array(i.length),ne=new Float64Array(i.length),K=new Uint32Array(a.length),X=new Uint32Array(a.length),re=new Float64Array(a.length),se=new Float64Array(a.length),c=[],Le="FORCE_DIRECTED",x=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let P,le="FORCE_DIRECTED",p=0,E=0;const Ce=Ae.apply;switch(le=e==="GEOGRAPHIC"?Le:e,le){case"FORCE_DIRECTED":P=Fe.apply;break;case"COMMUNITY":P=He.apply;break;case"HIERARCHICAL":P=Pe.apply;break;case"RADIAL_TREE":P=Ge.apply;break;case"SMART_TREE":P=Se.apply;break;default:P=ve.apply}let Z=!1;i.forEach(({typeName:n,feature:l})=>{if(e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"&&t?.lockedNodeLocations?.has(l.attributes[T])){e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)?k[p]=A.IsGeographic:k[p]=A.None;const s=t.lockedNodeLocations.get(l.attributes[T]);y[p]=s.x,m[p]=s.y}else if(e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)){k[p]=A.IsGeographic;let s=null;const I=l.attributes[this.dataManager.geographicLookup.get(n).name];switch(this.dataManager.geographicLookup.get(n)?.geometryType){case"esriGeometryPoint":y[p]=I?.x,m[p]=I?.y;break;case"esriGeometryPolygon":s=I?.centroid,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":s=I?.extent?.center,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;default:k[p]=A.IsMovable}(y[p]==null||m[p]==null||Number.isNaN(y[p])||Number.isNaN(m[p]))&&(k[p]=A.IsMovable,y[p]=0,m[p]=0)}else if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){!Z&&t?.lockedNodeLocations?.has(l.attributes[T])&&(Z=!0);const s=t?.timeInfoByTypeName?.get(n),I=s?.startField,v=I&&s?.startField?l.attributes[I]:null;g[p]=v?new Date(v).getTime():NaN;const C=s?.endField,D=C&&s?.endField?l.attributes[C]:null;ne[p]=D?new Date(D).getTime():NaN,y[p]=0,m[p]=0,k[p]=A.IsMovable}else k[p]=A.IsMovable,y[p]=0,m[p]=0;L.set(l.attributes[T],p),c[p]={feature:l,typeName:n},p++}),Z&&R.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let he=!1;const ee=new Map;a.forEach(n=>{const l=n.feature.attributes[J],s=n.feature.attributes[V],I=L.get(l),v=L.get(s),C=t?.timeInfoByTypeName?.get(n.typeName),D=t?.timeInfoByTypeName?C?.startField:null,O=D?n.feature.attributes[D]:null,j=C?.endField,H=j?n.feature.attributes[j]:null;if(I!==void 0&&v!==void 0){let S=l+"-"+s;e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(S=S+"-"+O+"-"+H);const U=ee.get(S);U?.has(n.typeName)||(K[E]=I,X[E]=v,e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(re[E]=O?new Date(O).getTime():NaN,se[E]=H?new Date(H).getTime():NaN),U===void 0?ee.set(S,new Map([[n.typeName,E]])):U.set(n.typeName,E),E++),o.push(n)}else he=!0,this.relationshipLinkChartDiagramLookup.set(l,null)}),he&&R.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const pe=this._validateLayoutSettings(e,t),te=this._convertLayoutSettingsToCalculationSettings(pe);await Ue();let z=!1,N=null;if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){let n;({success:z,links:N,graphics:n}=Ce(k,y,m,g,ne,K.subarray(0,E),X.subarray(0,E),re.subarray(0,E),se.subarray(0,E),e==="CHRONOLOGICAL_MULTIPLE",t?.chronologicalLayoutSettings??{})),z&&(this.chronologicalAuxiliaryGraphics=n)}else({success:z,links:N}=P(k,y,m,K.subarray(0,E),X.subarray(0,E),te.computationBudgetTime,te.idealEdgeLengthMultiplier,te.repulsionRadiusMultiplier));if(!z)throw new Q("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let n=0;n84.9999?m[n]=84.9999:m[n]<-84.9999&&(m[n]=-84.9999),y[n]>179.9999?y[n]=179.9999:y[n]<-179.9999&&(y[n]=-179.9999),c[n].feature.attributes[b]=new oe(y[n],m[n]),r.has(c[n].typeName))r.get(c[n].typeName)?.set(c[n].feature.attributes[T],c[n].feature);else{const s=new Map;s.set(c[n].feature.attributes[T],c[n].feature),r.set(c[n].typeName,s)}u.set(c[n].feature.attributes[T],c[n].feature);const l=B(c[n].feature.attributes[b]);this.entityLinkChartDiagramLookup.set(c[n].feature.attributes[T],c[n].feature.attributes[b]?l:null),c[n].feature.attributes[b].xx.xmax&&(x.xmax=c[n].feature.attributes[b].x),c[n].feature.attributes[b].yx.ymax&&(x.ymax=c[n].feature.attributes[b].y)}if(this.linkChartExtent.xmin=x.xmin,this.linkChartExtent.xmax=x.xmax,this.linkChartExtent.ymin=x.ymin,this.linkChartExtent.ymax=x.ymax,!N)throw new Q("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const W=new Map,ae=new Map,ie=new Map,de=new Set;for(let n=0;n85.5?l[h][1]=85.5:l[h][1]<-85.5&&(l[h][1]=-85.5),l[h][0]>179.9999?l[h][0]=179.9999:l[h][0]<-179.9999&&(l[h][0]=-179.9999);W.has(C)?W.get(C).push(l):W.set(C,[l])}const j=W.get(C);ae.has(C)||(ae.set(C,new Map),ie.set(C,new Map));const H=ae.get(C),S=ie.get(C);H.has(s.typeName)||(H.set(s.typeName,j.shift()),S.set(s.typeName,0));const U=H.get(s.typeName);S.set(s.typeName,S.get(s.typeName)+1);const Me=new me({paths:[U]});if(s.feature.attributes[b]=Me,d.has(s.typeName))d.get(s.typeName)?.set(s.feature.attributes[T],s.feature);else{const h=new Map;h.set(s.feature.attributes[T],s.feature),d.set(s.typeName,h)}u.set(s.feature.attributes[T],s.feature);const we=B(s.feature.attributes[b]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[T],s.feature.attributes[b]?we:null)}for(const n of o)n.feature.attributes[Be]=ie.get(n.feature.attributes[J]+"-"+n.feature.attributes[V])?.get(n.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutOptions:pe},{nodes:r,links:d,idMap:u}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const i=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach(a=>{i.push(a.refreshCachedQueryEngine())}),await Promise.all(i),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(t=>{t?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;a&&(o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(r,new oe({x:o.x,y:o.y})))})}),e}async synchronizeInclusionListWithCache(){return new Promise(e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((t,i)=>{if(t.useAllData=!1,t.members&&t.members.size>0){if(!this.dataManager.sublayerCaches.get(i))return;const a=new Set(Array.from(this.dataManager.sublayerCaches.get(i).keys()));Array.from(t.members.keys()).filter(o=>!a.has(o)).forEach(o=>{t.members?.delete(o)})}}),e()})}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(i=>{t.push(i.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e){let t=[];for(const a of this.dataManager.relationshipTypeNames){const o=this.sublayerIdsCache.get(a);o&&(t=t.concat(Array.from(o.keys())))}const i=await this.dataManager.getRelationshipsBetweenNodes(e,t);return await this._handleNewRecords(i),{records:i}}async connectFromEntities(e){let t=[];for(const o of this.dataManager.relationshipTypeNames){const r=this.sublayerIdsCache.get(o);r&&(t=t.concat(Array.from(r.keys())))}let i=[];for(const o of this.dataManager.entityTypeNames){const r=this.sublayerIdsCache.get(o);r&&(i=i.concat(Array.from(r)))}const a=await this.dataManager.getRelationshipsFromNodes(e,i,t);return await this._handleNewRecords(a),{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="RADIAL_TREE",t){const i=new Map;this.layers.forEach(a=>{i.set(a.objectType.name,a.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:i,...t})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const a of e)this.sublayerIdsCache.has(a.typeName)||(this.sublayerIdsCache.set(a.typeName,new Set),t.push(a.typeName)),this.sublayerIdsCache.get(a.typeName).add(a.id);for(const a of t){const o=this._graphTypeLookup.get(a);if(o){const r=this._createSublayer(o);o.type==="entity"?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a),r.geometryType?this.layers.push(r):this.tables.push(r),this.dataManager.sublayerCaches.set(a,new Map)}}await fe(this,t),await this.dataManager.refreshCacheContent(e.map(a=>a.id));const i=Object.assign({},this._currentLinkChartConfig.layoutOptions);i.lockedNodeLocations=new Map;for(const[a,o]of this.entityLinkChartDiagramLookup.entries())o&&i.lockedNodeLocations.set(a,new oe(o.coords[0],o.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,i)}_createSublayers(e,t,i){e.forEach(a=>{const o=this._createSublayer(a);i(o)&&t.push(o),this._updateSublayerCaches(a)})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const a=e.find(o=>o.type===i.graphType&&o.name===i.graphTypeName);a&&(i.objectType=a,i.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;if(!a)return;o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const d=B(o);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(r,d):this.entityLinkChartDiagramLookup.set(r,d),this.linkChartExtent.xmin>o.x&&(this.linkChartExtent.xmin=o.x),this.linkChartExtent.xmaxo.y&&(this.linkChartExtent.ymin=o.y),this.linkChartExtent.ymax{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(t=>{const i=this.relationshipLinkChartDiagramLookup.get(t.attributes[J]),a=this.relationshipLinkChartDiagramLookup.get(t.attributes[V]);if(i&&a){const o=B(new me({paths:[[[i.coords[0],i.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(t.attributes[T],o)}else this.relationshipLinkChartDiagramLookup.set(t.attributes[T],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.defaultLinkChartConfig.layoutOptions||{}}):await this._calculateLayoutWithSublayerTimeInfo("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateLayoutSettings(e,t){const i=g=>typeof g=="number"&&!isNaN(g),a=g=>i(g)&&g>=1,o=g=>i(g)&&g>=1,r=g=>Object.values(q).includes(g),d=g=>i(g)&&g>=0,u={organicLayoutSettings:{},chronologicalLayoutSettings:{}};if(!new Set(["FORCE_DIRECTED","COMMUNITY","GEOGRAPHIC","CHRONOLOGICAL_MULTIPLE","CHRONOLOGICAL_SINGLE"]).has(e)||!t)return u;t.organicLayoutSettings??={};const{computationBudgetTime:L,repulsionRadiusMultiplier:k,idealEdgeLength:y,idealEdgeLengthType:m}=t.organicLayoutSettings;if(o(L)?u.organicLayoutSettings.computationBudgetTime=L:L!==void 0&&R.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),a(k)?u.organicLayoutSettings.repulsionRadiusMultiplier=k:k!==void 0&&R.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting"),e==="GEOGRAPHIC"&&(y!==void 0||m!==void 0)&&(r(m)?u.organicLayoutSettings.idealEdgeLengthType=m:m!==void 0&&R.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),d(y)?u.organicLayoutSettings.idealEdgeLength=y:y!==void 0&&R.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),(e==="CHRONOLOGICAL_MULTIPLE"||e==="CHRONOLOGICAL_SINGLE")&&t.chronologicalLayoutSettings){const g=t.chronologicalLayoutSettings;g.durationLineWidth&&g.durationLineWidth<0&&R.getLogger(this).warn("Invalid layout durationLineWidth setting, will revert to default setting")}return u}_convertLayoutSettingsToCalculationSettings(e){e.organicLayoutSettings??={};let t=e.organicLayoutSettings.idealEdgeLength;return e.organicLayoutSettings.idealEdgeLengthType===q.ABSOLUTE&&(t===void 0?t=-1:t*=-1),{computationBudgetTime:e.organicLayoutSettings.computationBudgetTime,repulsionRadiusMultiplier:e.organicLayoutSettings.repulsionRadiusMultiplier,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new $({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}};M([w()],f.prototype,"dataPreloadedInLocalCache",void 0),M([w()],f.prototype,"defaultLinkChartConfig",void 0),M([w()],f.prototype,"dataManager",void 0),M([w()],f.prototype,"inclusionModeDefinition",null),M([w()],f.prototype,"knowledgeGraph",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"layers",void 0),M([w()],f.prototype,"entityLinkChartDiagramLookup",void 0),M([w()],f.prototype,"relationshipLinkChartDiagramLookup",void 0),M([w()],f.prototype,"linkChartExtent",void 0),M([w()],f.prototype,"memberEntityTypes",void 0),M([w()],f.prototype,"memberRelationshipTypes",void 0),M([w({type:["LinkChartLayer"]})],f.prototype,"operationalLayerType",void 0),M([w()],f.prototype,"sublayerIdsCache",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"tables",void 0),M([w({json:{read:!1}})],f.prototype,"type",void 0),M([w({json:{read:!1}})],f.prototype,"chronologicalAuxiliaryGraphics",void 0),f=M([Ie("esri.layers.LinkChartLayer")],f);const Pa=f;export{Pa as default}; +import{ag as Y,n as ue,o as Q,ah as Te,av as Ee,a1 as R,an as ce,$ as Ne,bP as ye,w as oe,m as me,v as M,S as w,i as Ie}from"./story-Doly9N9p.js";import{m as De}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as xe}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{z as B}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{c as _e}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{t as $,A as Re,J as Oe,M as Ae,I as ve,D as Se,L as Ge,N as Pe,E as He,w as Fe,k as T,T as A,n as J,r as V,P as Ue,m as b,b as ge,f as Be,B as fe,o as $e}from"./KnowledgeGraphSublayer-DPj4igi1-BoqyUmfs.js";import{u as ze}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{E as We}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{F as Qe}from"./knowledgeGraphService-DOJz0fzA-BlihQLi8.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./GraphicsLayer-DfeGaYc1-DRpZ_f0G.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Relationship-Db9GUmYx-B84JspfN.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./FeatureStore-Co2V0sVE-BK6XAR3o.js";import"./BoundsStore--N6o1xkF-CQrhMeDa.js";import"./PooledRBush-DbfAmeLn-CPHfm9op.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js";import"./QueryEngine-CH5uUhZK-DRGPyg2C.js";import"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./utils-HtkT8Fn3-Dd_0rdy5.js";import"./utils-DyydRFHu-1ITtOELE.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./utils-tNxq3jkf-nfQcZo7O.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./popupUtils-B0uZcXX0-DHyOz1jC.js";var q;(function(e){e.MULTIPLIER="multiplier",e.ABSOLUTE="absoluteValue"})(q||(q={}));let f=class extends We(ze(je(De(xe)))){constructor(e){if(super(e),this.dataPreloadedInLocalCache=!1,this.defaultLinkChartConfig=null,this._currentLinkChartConfig={layoutMode:"RADIAL_TREE"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(Y.ofType($)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(Y.ofType($)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.inclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.inclusionModeDefinition)throw new Q("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(Te(()=>this.layers.concat(this.tables),(t,i)=>this._handleSublayersChange(t,i),Ee))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}=e;return{url:t,title:i,dataPreloadedInLocalCache:a,defaultLinkChartConfig:o}}_initializeLayerProperties(e){if(!this.title&&this.url){const r=this.url.split("/");this.title=r[r.length-2]}const t=new Set;let i=[],a=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new Q("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.knowledgeGraph.dataModel.entityTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.knowledgeGraph.dataModel.relationshipTypes?.forEach(r=>{r.name&&this._graphTypeLookup.set(r.name,r)}),e.inclusionModeDefinition?.generateAllSublayers?(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((r,d)=>{const u=this._graphTypeLookup.get(d);if(!u)return R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(d);u.type==="relationship"?t.has(d)||(t.add(d),a.push(u)):u.type==="entity"?t.has(d)||(t.add(d),i.push(u)):(R.getLogger(this).warn(`A named type, ${d}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(d))}):(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]);const o=new Re({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=i,this.memberRelationshipTypes=a,this.dataManager=o}load(e){const t=async()=>{const i=[],a=[];this.loadLayerAssumingLocalCache(),await fe(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(o=>{o.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(o=>{a.push(o.refreshCachedQueryEngine()),i.push(new Promise(r=>{o.on("layerview-create",()=>{r(null)})}))}),this.tables.forEach(o=>{a.push(o.refreshCachedQueryEngine())}),await Promise.all(a)};return this.addResolvingPromise(new Promise(i=>{Qe(this.url).then(async a=>{if(this._initializeLayerProperties({knowledgeGraph:a,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(o=>{o.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(o.name,{useAllData:!0})})),this.dataPreloadedInLocalCache){const o=$e.getInstance();for(const[r,d]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const u of d.members?.values()??[]){const L=o.readFromStoreById(`${r}__${u.id}`);L&&ce(this.dataManager.sublayerCaches,r,()=>new Map).set(u.id,L)}await t()}else{const o=this.defaultLinkChartConfig?.layoutMode==="GEOGRAPHIC";this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,o,!0).then(async()=>{Ne(e),await t()}))}i(null)})})),Promise.resolve(this)}set inclusionModeDefinition(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("inclusionModeDefinition",e):R.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}async addRecords(e,t){let i=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(i=await Oe(e,this.dataManager.knowledgeGraph));const a=e.concat(i).filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));await this._handleNewRecords(a)}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1}){let a=[];for(const r of e)this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData===!1&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id)&&a.push(r);if(t){const r=new Set,d=[];for(const u of a)if(this.dataManager.nodeConnectionsLookup.has(u.id))for(const L of this.dataManager.nodeConnectionsLookup.get(u.id))r.add(L);for(const u of r)if(this.dataManager.memberIdTypeLookup.has(u))for(const L of this.dataManager.memberIdTypeLookup.get(u))this.dataManager.relationshipTypeNames.has(L)&&d.push({id:u,typeName:L});a=a.concat(d)}this.dataManager.removeFromLayer(a);for(const r of a)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);i&&await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,this._currentLinkChartConfig.layoutOptions);const o=[];return this.layers.forEach(r=>{o.push(r.refreshCachedQueryEngine())}),await Promise.all(o),this._refreshNamedTypes(),a}async expand(e,t){const i=await this.dataManager.getConnectedRecordIds(e,t),a=i.filter(o=>!this.sublayerIdsCache.get(o.typeName)?.has(o.id));return await this._handleNewRecords(i),{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.originIdOf("layers")===ye.DEFAULTS?this._createSublayers(e,this.layers,t=>!!t.geometryType):this._updateSublayers(e,this.layers),this.originIdOf("tables")===ye.DEFAULTS?this._createSublayers(e,this.tables,t=>!t.geometryType):this._updateSublayers(e,this.tables),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((t,i)=>{const a=ce(this.sublayerIdsCache,i,()=>new Set);t.members?.forEach(({id:o,linkChartLocation:r})=>{if(a.add(o),r){const d=r instanceof _e?r:B(r);this.dataManager.relationshipTypeNames.has(i)?this.relationshipLinkChartDiagramLookup.set(o,d):this.entityLinkChartDiagramLookup.set(o,d)}})})}async calculateLinkChartLayout(e="RADIAL_TREE",t){const i=[],a=[],o=[];this.dataManager.sublayerCaches.forEach((n,l)=>{this.dataManager.entityTypeNames.has(l)?n.forEach(s=>{i.push({typeName:l,feature:s})}):this.dataManager.relationshipTypeNames.has(l)&&n.forEach(s=>{a.push({typeName:l,feature:s})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const r=new Map,d=new Map,u=new Map,L=new Map,k=new Uint8Array(i.length),y=new Float64Array(i.length),m=new Float64Array(i.length),g=new Float64Array(i.length),ne=new Float64Array(i.length),K=new Uint32Array(a.length),X=new Uint32Array(a.length),re=new Float64Array(a.length),se=new Float64Array(a.length),c=[],Le="FORCE_DIRECTED",x=new ue({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let P,le="FORCE_DIRECTED",p=0,E=0;const Ce=Ae.apply;switch(le=e==="GEOGRAPHIC"?Le:e,le){case"FORCE_DIRECTED":P=Fe.apply;break;case"COMMUNITY":P=He.apply;break;case"HIERARCHICAL":P=Pe.apply;break;case"RADIAL_TREE":P=Ge.apply;break;case"SMART_TREE":P=Se.apply;break;default:P=ve.apply}let Z=!1;i.forEach(({typeName:n,feature:l})=>{if(e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"&&t?.lockedNodeLocations?.has(l.attributes[T])){e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)?k[p]=A.IsGeographic:k[p]=A.None;const s=t.lockedNodeLocations.get(l.attributes[T]);y[p]=s.x,m[p]=s.y}else if(e==="GEOGRAPHIC"&&this.dataManager.geographicLookup.has(n)){k[p]=A.IsGeographic;let s=null;const I=l.attributes[this.dataManager.geographicLookup.get(n).name];switch(this.dataManager.geographicLookup.get(n)?.geometryType){case"esriGeometryPoint":y[p]=I?.x,m[p]=I?.y;break;case"esriGeometryPolygon":s=I?.centroid,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":s=I?.extent?.center,s?.x!=null&&s?.y!=null?(y[p]=s.x,m[p]=s.y):k[p]=A.IsMovable;break;default:k[p]=A.IsMovable}(y[p]==null||m[p]==null||Number.isNaN(y[p])||Number.isNaN(m[p]))&&(k[p]=A.IsMovable,y[p]=0,m[p]=0)}else if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){!Z&&t?.lockedNodeLocations?.has(l.attributes[T])&&(Z=!0);const s=t?.timeInfoByTypeName?.get(n),I=s?.startField,v=I&&s?.startField?l.attributes[I]:null;g[p]=v?new Date(v).getTime():NaN;const C=s?.endField,D=C&&s?.endField?l.attributes[C]:null;ne[p]=D?new Date(D).getTime():NaN,y[p]=0,m[p]=0,k[p]=A.IsMovable}else k[p]=A.IsMovable,y[p]=0,m[p]=0;L.set(l.attributes[T],p),c[p]={feature:l,typeName:n},p++}),Z&&R.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let he=!1;const ee=new Map;a.forEach(n=>{const l=n.feature.attributes[J],s=n.feature.attributes[V],I=L.get(l),v=L.get(s),C=t?.timeInfoByTypeName?.get(n.typeName),D=t?.timeInfoByTypeName?C?.startField:null,O=D?n.feature.attributes[D]:null,j=C?.endField,H=j?n.feature.attributes[j]:null;if(I!==void 0&&v!==void 0){let S=l+"-"+s;e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(S=S+"-"+O+"-"+H);const U=ee.get(S);U?.has(n.typeName)||(K[E]=I,X[E]=v,e!=="CHRONOLOGICAL_SINGLE"&&e!=="CHRONOLOGICAL_MULTIPLE"||(re[E]=O?new Date(O).getTime():NaN,se[E]=H?new Date(H).getTime():NaN),U===void 0?ee.set(S,new Map([[n.typeName,E]])):U.set(n.typeName,E),E++),o.push(n)}else he=!0,this.relationshipLinkChartDiagramLookup.set(l,null)}),he&&R.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const pe=this._validateLayoutSettings(e,t),te=this._convertLayoutSettingsToCalculationSettings(pe);await Ue();let z=!1,N=null;if(e==="CHRONOLOGICAL_SINGLE"||e==="CHRONOLOGICAL_MULTIPLE"){let n;({success:z,links:N,graphics:n}=Ce(k,y,m,g,ne,K.subarray(0,E),X.subarray(0,E),re.subarray(0,E),se.subarray(0,E),e==="CHRONOLOGICAL_MULTIPLE",t?.chronologicalLayoutSettings??{})),z&&(this.chronologicalAuxiliaryGraphics=n)}else({success:z,links:N}=P(k,y,m,K.subarray(0,E),X.subarray(0,E),te.computationBudgetTime,te.idealEdgeLengthMultiplier,te.repulsionRadiusMultiplier));if(!z)throw new Q("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");for(let n=0;n84.9999?m[n]=84.9999:m[n]<-84.9999&&(m[n]=-84.9999),y[n]>179.9999?y[n]=179.9999:y[n]<-179.9999&&(y[n]=-179.9999),c[n].feature.attributes[b]=new oe(y[n],m[n]),r.has(c[n].typeName))r.get(c[n].typeName)?.set(c[n].feature.attributes[T],c[n].feature);else{const s=new Map;s.set(c[n].feature.attributes[T],c[n].feature),r.set(c[n].typeName,s)}u.set(c[n].feature.attributes[T],c[n].feature);const l=B(c[n].feature.attributes[b]);this.entityLinkChartDiagramLookup.set(c[n].feature.attributes[T],c[n].feature.attributes[b]?l:null),c[n].feature.attributes[b].xx.xmax&&(x.xmax=c[n].feature.attributes[b].x),c[n].feature.attributes[b].yx.ymax&&(x.ymax=c[n].feature.attributes[b].y)}if(this.linkChartExtent.xmin=x.xmin,this.linkChartExtent.xmax=x.xmax,this.linkChartExtent.ymin=x.ymin,this.linkChartExtent.ymax=x.ymax,!N)throw new Q("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const W=new Map,ae=new Map,ie=new Map,de=new Set;for(let n=0;n85.5?l[h][1]=85.5:l[h][1]<-85.5&&(l[h][1]=-85.5),l[h][0]>179.9999?l[h][0]=179.9999:l[h][0]<-179.9999&&(l[h][0]=-179.9999);W.has(C)?W.get(C).push(l):W.set(C,[l])}const j=W.get(C);ae.has(C)||(ae.set(C,new Map),ie.set(C,new Map));const H=ae.get(C),S=ie.get(C);H.has(s.typeName)||(H.set(s.typeName,j.shift()),S.set(s.typeName,0));const U=H.get(s.typeName);S.set(s.typeName,S.get(s.typeName)+1);const Me=new me({paths:[U]});if(s.feature.attributes[b]=Me,d.has(s.typeName))d.get(s.typeName)?.set(s.feature.attributes[T],s.feature);else{const h=new Map;h.set(s.feature.attributes[T],s.feature),d.set(s.typeName,h)}u.set(s.feature.attributes[T],s.feature);const we=B(s.feature.attributes[b]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[T],s.feature.attributes[b]?we:null)}for(const n of o)n.feature.attributes[Be]=ie.get(n.feature.attributes[J]+"-"+n.feature.attributes[V])?.get(n.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutOptions:pe},{nodes:r,links:d,idMap:u}}async applyNewLinkChartLayout(e="RADIAL_TREE",t){const i=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach(a=>{i.push(a.refreshCachedQueryEngine())}),await Promise.all(i),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;return this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach(t=>{t?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;a&&(o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(r,new oe({x:o.x,y:o.y})))})}),e}async synchronizeInclusionListWithCache(){return new Promise(e=>{this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach((t,i)=>{if(t.useAllData=!1,t.members&&t.members.size>0){if(!this.dataManager.sublayerCaches.get(i))return;const a=new Set(Array.from(this.dataManager.sublayerCaches.get(i).keys()));Array.from(t.members.keys()).filter(o=>!a.has(o)).forEach(o=>{t.members?.delete(o)})}}),e()})}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(i=>{t.push(i.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e){let t=[];for(const a of this.dataManager.relationshipTypeNames){const o=this.sublayerIdsCache.get(a);o&&(t=t.concat(Array.from(o.keys())))}const i=await this.dataManager.getRelationshipsBetweenNodes(e,t);return await this._handleNewRecords(i),{records:i}}async connectFromEntities(e){let t=[];for(const o of this.dataManager.relationshipTypeNames){const r=this.sublayerIdsCache.get(o);r&&(t=t.concat(Array.from(r.keys())))}let i=[];for(const o of this.dataManager.entityTypeNames){const r=this.sublayerIdsCache.get(o);r&&(i=i.concat(Array.from(r)))}const a=await this.dataManager.getRelationshipsFromNodes(e,i,t);return await this._handleNewRecords(a),{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="RADIAL_TREE",t){const i=new Map;this.layers.forEach(a=>{i.set(a.objectType.name,a.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:i,...t})}async _handleNewRecords(e){const t=[];this.dataManager.addToLayer(e);for(const a of e)this.sublayerIdsCache.has(a.typeName)||(this.sublayerIdsCache.set(a.typeName,new Set),t.push(a.typeName)),this.sublayerIdsCache.get(a.typeName).add(a.id);for(const a of t){const o=this._graphTypeLookup.get(a);if(o){const r=this._createSublayer(o);o.type==="entity"?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a),r.geometryType?this.layers.push(r):this.tables.push(r),this.dataManager.sublayerCaches.set(a,new Map)}}await fe(this,t),await this.dataManager.refreshCacheContent(e.map(a=>a.id));const i=Object.assign({},this._currentLinkChartConfig.layoutOptions);i.lockedNodeLocations=new Map;for(const[a,o]of this.entityLinkChartDiagramLookup.entries())o&&i.lockedNodeLocations.set(a,new oe(o.coords[0],o.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,i)}_createSublayers(e,t,i){e.forEach(a=>{const o=this._createSublayer(a);i(o)&&t.push(o),this._updateSublayerCaches(a)})}_updateSublayers(e,t){t.forEach(i=>{i.parentCompositeLayer=this;const a=e.find(o=>o.type===i.graphType&&o.name===i.graphTypeName);a&&(i.objectType=a,i.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))})}_updateSublayerCaches(e){const t=this.dataManager.sublayerCaches;t.has(e.name)||t.set(e.name,new Map)}async _initializeDiagram(){this.defaultLinkChartConfig?this.defaultLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(i=>{const a=i.linkChartLocation;let o;const r=i.id;if(!a)return;o="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const d=B(o);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(r,d):this.entityLinkChartDiagramLookup.set(r,d),this.linkChartExtent.xmin>o.x&&(this.linkChartExtent.xmin=o.x),this.linkChartExtent.xmaxo.y&&(this.linkChartExtent.ymin=o.y),this.linkChartExtent.ymax{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(t=>{const i=this.relationshipLinkChartDiagramLookup.get(t.attributes[J]),a=this.relationshipLinkChartDiagramLookup.get(t.attributes[V]);if(i&&a){const o=B(new me({paths:[[[i.coords[0],i.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(t.attributes[T],o)}else this.relationshipLinkChartDiagramLookup.set(t.attributes[T],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.defaultLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.defaultLinkChartConfig.layoutOptions||{}}):await this._calculateLayoutWithSublayerTimeInfo("RADIAL_TREE",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateLayoutSettings(e,t){const i=g=>typeof g=="number"&&!isNaN(g),a=g=>i(g)&&g>=1,o=g=>i(g)&&g>=1,r=g=>Object.values(q).includes(g),d=g=>i(g)&&g>=0,u={organicLayoutSettings:{},chronologicalLayoutSettings:{}};if(!new Set(["FORCE_DIRECTED","COMMUNITY","GEOGRAPHIC","CHRONOLOGICAL_MULTIPLE","CHRONOLOGICAL_SINGLE"]).has(e)||!t)return u;t.organicLayoutSettings??={};const{computationBudgetTime:L,repulsionRadiusMultiplier:k,idealEdgeLength:y,idealEdgeLengthType:m}=t.organicLayoutSettings;if(o(L)?u.organicLayoutSettings.computationBudgetTime=L:L!==void 0&&R.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),a(k)?u.organicLayoutSettings.repulsionRadiusMultiplier=k:k!==void 0&&R.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting"),e==="GEOGRAPHIC"&&(y!==void 0||m!==void 0)&&(r(m)?u.organicLayoutSettings.idealEdgeLengthType=m:m!==void 0&&R.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),d(y)?u.organicLayoutSettings.idealEdgeLength=y:y!==void 0&&R.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),(e==="CHRONOLOGICAL_MULTIPLE"||e==="CHRONOLOGICAL_SINGLE")&&t.chronologicalLayoutSettings){const g=t.chronologicalLayoutSettings;g.durationLineWidth&&g.durationLineWidth<0&&R.getLogger(this).warn("Invalid layout durationLineWidth setting, will revert to default setting")}return u}_convertLayoutSettingsToCalculationSettings(e){e.organicLayoutSettings??={};let t=e.organicLayoutSettings.idealEdgeLength;return e.organicLayoutSettings.idealEdgeLengthType===q.ABSOLUTE&&(t===void 0?t=-1:t*=-1),{computationBudgetTime:e.organicLayoutSettings.computationBudgetTime,repulsionRadiusMultiplier:e.organicLayoutSettings.repulsionRadiusMultiplier,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new $({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(i=>{i.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(i=>{i.parent=this}),this.addHandles([e.on("after-add",({item:i})=>{i.parent=this}),e.on("after-remove",({item:i})=>{i.parent=null})],"sublayers-owner"))}};M([w()],f.prototype,"dataPreloadedInLocalCache",void 0),M([w()],f.prototype,"defaultLinkChartConfig",void 0),M([w()],f.prototype,"dataManager",void 0),M([w()],f.prototype,"inclusionModeDefinition",null),M([w()],f.prototype,"knowledgeGraph",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"layers",void 0),M([w()],f.prototype,"entityLinkChartDiagramLookup",void 0),M([w()],f.prototype,"relationshipLinkChartDiagramLookup",void 0),M([w()],f.prototype,"linkChartExtent",void 0),M([w()],f.prototype,"memberEntityTypes",void 0),M([w()],f.prototype,"memberRelationshipTypes",void 0),M([w({type:["LinkChartLayer"]})],f.prototype,"operationalLayerType",void 0),M([w()],f.prototype,"sublayerIdsCache",void 0),M([w({type:Y.ofType($),json:{write:{ignoreOrigin:!0}}})],f.prototype,"tables",void 0),M([w({json:{read:!1}})],f.prototype,"type",void 0),M([w({json:{read:!1}})],f.prototype,"chronologicalAuxiliaryGraphics",void 0),f=M([Ie("esri.layers.LinkChartLayer")],f);const Pa=f;export{Pa as default}; diff --git a/custom-toc-highlight/assets/Lyr3DWorker-K2Vldrif-OgNJMBMz.js b/custom-toc-highlight/assets/Lyr3DWorker-K2Vldrif-DyLstWvT.js similarity index 96% rename from custom-toc-highlight/assets/Lyr3DWorker-K2Vldrif-OgNJMBMz.js rename to custom-toc-highlight/assets/Lyr3DWorker-K2Vldrif-DyLstWvT.js index d4dd1231..13624c50 100644 --- a/custom-toc-highlight/assets/Lyr3DWorker-K2Vldrif-OgNJMBMz.js +++ b/custom-toc-highlight/assets/Lyr3DWorker-K2Vldrif-DyLstWvT.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lyr3DWorker-Cx6akEQX-Bxt_snw4.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{_ as M}from"./main-ugzBrWNm.js";import{bw as T}from"./story-BfX8CRfG.js";var p,N,f,g,m,d,S,b,I,U,L,D,h,R,a;(function(t){t.U8="U8",t.I8="I8",t.U16="U16",t.I16="I16",t.U32="U32",t.I32="I32",t.F32="F32",t.F64="F64",t.Utf8String="Utf8String",t.NotSet="NotSet"})(p||(p={})),function(t){t.Png="Png",t.Jpeg="Jpeg",t.Dds="Dds",t.Raw="Raw",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.Etc2="Etc2",t.Astc="Astc",t.Pvrtc="Pvrtc",t.NotSet="NotSet"}(N||(N={})),function(t){t.Rgb8="Rgb8",t.Rgba8="Rgba8",t.R8="R8",t.Bgr8="Bgr8",t.Bgra8="Bgra8",t.Rg8="Rg8",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.NotSet="NotSet"}(f||(f={})),function(t){t.Position="Position",t.Normal="Normal",t.TexCoord="TexCoord",t.Color="Color",t.Tangent="Tangent",t.FeatureIndex="FeatureIndex",t.UvRegion="UvRegion",t.NotSet="NotSet"}(g||(g={})),function(t){t.Opaque="Opaque",t.Mask="Mask",t.Blend="Blend"}(m||(m={})),function(t){t.None="None",t.Mask="Mask",t.Alpha="Alpha",t.PreMultAlpha="PreMultAlpha",t.NotSet="NotSet"}(d||(d={})),function(t){t.Points="Points",t.Lines="Lines",t.LineStrip="LineStrip",t.Triangles="Triangles",t.TriangleStrip="TriangleStrip",t.NotSet="NotSet"}(S||(S={})),function(t){t.None="None",t.WrapXBit="WrapXBit",t.WrapYBit="WrapYBit",t.WrapXy="WrapXy",t.NotSet="NotSet"}(b||(b={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NotSet="NotSet"}(I||(I={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NearestMipmapNearest="NearestMipmapNearest",t.LinearMipmapNearest="LinearMipmapNearest",t.NearestMipmapLinear="NearestMipmapLinear",t.LinearMipmapLinear="LinearMipmapLinear",t.NotSet="NotSet"}(U||(U={})),function(t){t.FeatureId="FeatureId",t.GlobalUid="GlobalUid",t.UnspecifiedDateTime="UnspecifiedDateTime",t.EcmaIso8601DateTime="EcmaIso8601DateTime",t.EcmaIso8601DateOnly="EcmaIso8601DateOnly",t.TimeOnly="TimeOnly",t.TimeStamp="TimeStamp",t.ColorRgb="ColorRgb",t.ColorRgba="ColorRgba",t.Unrecognized="Unrecognized",t.NotSet="NotSet"}(L||(L={})),function(t){t.Texture="Texture",t.VertexAtrb="VertexAtrb",t.Implicit="Implicit",t.NotSet="NotSet"}(D||(D={})),function(t){t.Front="Front",t.Back="Back",t.None="None",t.NotSet="NotSet"}(h||(h={})),function(t){t.Pbr="Pbr",t.Unlit="Unlit"}(R||(R={})),function(t){t[t.Succeeded=0]="Succeeded",t[t.Failed=1]="Failed",t[t.MissingInputs=2]="MissingInputs"}(a||(a={}));function x(){return new Promise(t=>M(()=>import("./lyr3DWorker-Cx6akEQX-Bxt_snw4.js"),__vite__mapDeps([0,1]),import.meta.url).then(o=>o.l).then(({default:o})=>{const n=o({locateFile:y,onRuntimeInitialized:()=>t(n)})})).catch(t=>{throw t})}function y(t){return T(`esri/libs/lyr3d/${t}`)}let e,r;async function w(t){if(await P(),t.inputs.length<1)return{result:{status:a.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]},transferList:[]};const o={ptrs:[],sizes:[]};for(const i of t.inputs){const u=r._malloc(i.byteLength);new Uint8Array(r.HEAPU8.buffer,u,i.byteLength).set(new Uint8Array(i)),o.ptrs.push(u),o.sizes.push(i.byteLength)}const n=r.process(t.jobDescJson,o,t.isMissingResourceCase),l=n.status===a.Succeeded&&n.data,c=n.status===a.MissingInputs&&n.missingInputUrls.length>0;if(l){const i=n.data.slice();n.data=i}else c&&(n.jobDescJson=n.jobDescJson.slice(),n.originalInputs=t.inputs);for(let i=0;i{r=t,r.initialize_lyr3d_worker_wasm(),e=null})),e)}export{A as destroyWasm,P as initialize,w as process}; +import{_ as M}from"./main-QGPoLsvl.js";import{bw as T}from"./story-Doly9N9p.js";var p,N,f,g,m,d,S,b,I,U,L,D,h,R,a;(function(t){t.U8="U8",t.I8="I8",t.U16="U16",t.I16="I16",t.U32="U32",t.I32="I32",t.F32="F32",t.F64="F64",t.Utf8String="Utf8String",t.NotSet="NotSet"})(p||(p={})),function(t){t.Png="Png",t.Jpeg="Jpeg",t.Dds="Dds",t.Raw="Raw",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.Etc2="Etc2",t.Astc="Astc",t.Pvrtc="Pvrtc",t.NotSet="NotSet"}(N||(N={})),function(t){t.Rgb8="Rgb8",t.Rgba8="Rgba8",t.R8="R8",t.Bgr8="Bgr8",t.Bgra8="Bgra8",t.Rg8="Rg8",t.Dxt1="Dxt1",t.Dxt5="Dxt5",t.NotSet="NotSet"}(f||(f={})),function(t){t.Position="Position",t.Normal="Normal",t.TexCoord="TexCoord",t.Color="Color",t.Tangent="Tangent",t.FeatureIndex="FeatureIndex",t.UvRegion="UvRegion",t.NotSet="NotSet"}(g||(g={})),function(t){t.Opaque="Opaque",t.Mask="Mask",t.Blend="Blend"}(m||(m={})),function(t){t.None="None",t.Mask="Mask",t.Alpha="Alpha",t.PreMultAlpha="PreMultAlpha",t.NotSet="NotSet"}(d||(d={})),function(t){t.Points="Points",t.Lines="Lines",t.LineStrip="LineStrip",t.Triangles="Triangles",t.TriangleStrip="TriangleStrip",t.NotSet="NotSet"}(S||(S={})),function(t){t.None="None",t.WrapXBit="WrapXBit",t.WrapYBit="WrapYBit",t.WrapXy="WrapXy",t.NotSet="NotSet"}(b||(b={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NotSet="NotSet"}(I||(I={})),function(t){t.Linear="Linear",t.Nearest="Nearest",t.NearestMipmapNearest="NearestMipmapNearest",t.LinearMipmapNearest="LinearMipmapNearest",t.NearestMipmapLinear="NearestMipmapLinear",t.LinearMipmapLinear="LinearMipmapLinear",t.NotSet="NotSet"}(U||(U={})),function(t){t.FeatureId="FeatureId",t.GlobalUid="GlobalUid",t.UnspecifiedDateTime="UnspecifiedDateTime",t.EcmaIso8601DateTime="EcmaIso8601DateTime",t.EcmaIso8601DateOnly="EcmaIso8601DateOnly",t.TimeOnly="TimeOnly",t.TimeStamp="TimeStamp",t.ColorRgb="ColorRgb",t.ColorRgba="ColorRgba",t.Unrecognized="Unrecognized",t.NotSet="NotSet"}(L||(L={})),function(t){t.Texture="Texture",t.VertexAtrb="VertexAtrb",t.Implicit="Implicit",t.NotSet="NotSet"}(D||(D={})),function(t){t.Front="Front",t.Back="Back",t.None="None",t.NotSet="NotSet"}(h||(h={})),function(t){t.Pbr="Pbr",t.Unlit="Unlit"}(R||(R={})),function(t){t[t.Succeeded=0]="Succeeded",t[t.Failed=1]="Failed",t[t.MissingInputs=2]="MissingInputs"}(a||(a={}));function x(){return new Promise(t=>M(()=>import("./lyr3DWorker-Cx6akEQX-Bxt_snw4.js"),__vite__mapDeps([0,1]),import.meta.url).then(o=>o.l).then(({default:o})=>{const n=o({locateFile:y,onRuntimeInitialized:()=>t(n)})})).catch(t=>{throw t})}function y(t){return T(`esri/libs/lyr3d/${t}`)}let e,r;async function w(t){if(await P(),t.inputs.length<1)return{result:{status:a.Failed,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[]},transferList:[]};const o={ptrs:[],sizes:[]};for(const i of t.inputs){const u=r._malloc(i.byteLength);new Uint8Array(r.HEAPU8.buffer,u,i.byteLength).set(new Uint8Array(i)),o.ptrs.push(u),o.sizes.push(i.byteLength)}const n=r.process(t.jobDescJson,o,t.isMissingResourceCase),l=n.status===a.Succeeded&&n.data,c=n.status===a.MissingInputs&&n.missingInputUrls.length>0;if(l){const i=n.data.slice();n.data=i}else c&&(n.jobDescJson=n.jobDescJson.slice(),n.originalInputs=t.inputs);for(let i=0;i{r=t,r.initialize_lyr3d_worker_wasm(),e=null})),e)}export{A as destroyWasm,P as initialize,w as process}; diff --git a/custom-toc-highlight/assets/Map-1zd11DKO-D2wK6924.js b/custom-toc-highlight/assets/Map-1zd11DKO-Bme1mjOQ.js similarity index 83% rename from custom-toc-highlight/assets/Map-1zd11DKO-D2wK6924.js rename to custom-toc-highlight/assets/Map-1zd11DKO-Bme1mjOQ.js index 287f117e..72db1bc4 100644 --- a/custom-toc-highlight/assets/Map-1zd11DKO-D2wK6924.js +++ b/custom-toc-highlight/assets/Map-1zd11DKO-Bme1mjOQ.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-BRPoXapf.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./layersCreator-CW56kDKc-BGMnYi1N.js","./portalLayers-Bh9bAhk4-BP6A8Lj4.js","./associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./fetchService-DbaKmJhP-W7rGyykJ.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./styleUtils-ChrJTYIw-BfDrXrWd.js"])))=>i.map(i=>d[i]); -import{_ as b}from"./main-ugzBrWNm.js";import{v as s,bz as B,i as C,bA as N,aB as P,ag as D,aU as G,a1 as m,aA as f,am as U,o as R,$ as w,P as E,S as i,ac as M,bB as T,bC as V,bD as z,ar as J,I as Q,j as W,ad as S,e as Z,bE as q,bF as H,C as K,bG as F,ah as k,ax as X,a2 as Y}from"./story-BfX8CRfG.js";import{F as c,s as A}from"./Basemap-BEqqSTw9-B5O9ub1-.js";import{o as ee}from"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import{y as te}from"./loadAll-e978YItg-CdtGGDtb.js";import{f as $}from"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import{x as re,L as ae,g as se}from"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";var _;let h=_=class extends Z{constructor(e){super(e),this.type="none"}clone(){return new _({type:this.type})}};s([B({none:"none",stayAbove:"stay-above"})],h.prototype,"type",void 0),h=_=s([C("esri.ground.NavigationConstraint")],h);var I;let d=I=class extends N(P){constructor(e){super(e),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new D;const t=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type!=="elevation"&&r.type!=="base-elevation"&&m.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},a=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>t(r.item)),this.layers.on("after-remove",r=>a(r.item))])}initialize(){this.when().catch(e=>{G(e)||m.getLogger(this).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)f(t);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",U(e,this._get("layers")))}writeLayers(e,t,a,r){const n=[];e&&(r={...r,layerContainerType:"ground"},e.forEach(l=>{if("write"in l){const p={};ee(l)().write(p,r)&&n.push(p)}else r?.messages&&r.messages.push(new R("layer:unsupported",`Layers (${l.title}, ${l.id}) of type '${l.declaredClass}' cannot be persisted in the ground`,{layer:l}))})),t.layers=n}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return te(this,e=>{e(this.layers)})}async queryElevation(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-BRPoXapf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);w(t);const r=new a,n=this.layers.filter(O).toArray();return r.queryAll(n,e,t)}async createElevationSampler(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-BRPoXapf.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);w(t);const r=new a,n=this.layers.filter(O).toArray();return r.createSamplerAll(n,e,t)}clone(){const e={opacity:this.opacity,surfaceColor:E(this.surfaceColor),navigationConstraint:E(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus="loaded"),new I({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()}async _loadLayersFromJSON(e,t,a){const r=t?.origin||"web-scene",n=t?.portal||null,l=t?.url||null,{populateOperationalLayers:p}=await b(async()=>{const{populateOperationalLayers:v}=await import("./layersCreator-CW56kDKc-BGMnYi1N.js");return{populateOperationalLayers:v}},__vite__mapDeps([8,1,2,3,4,9,10,11,12,13,14,5,6,15]),import.meta.url);w(a);const y=[];if(e.layers&&Array.isArray(e.layers)){const v={context:{origin:r,url:l,portal:n,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};y.push(p(this.layers,e.layers,v))}await Promise.allSettled(y)}};function oe(e){return e&&"createElevationSampler"in e}function O(e){return e.type==="elevation"||oe(e)}s([i({json:{read:!1}})],d.prototype,"layers",null),s([M("layers")],d.prototype,"writeLayers",null),s([i({readOnly:!0})],d.prototype,"resourceInfo",void 0),s([i({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:T,read:{reader:V,source:"transparency"},write:{writer:(e,t)=>{t.transparency=z(e)},target:"transparency"}}})],d.prototype,"opacity",void 0),s([i({type:J,json:{type:[T],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],d.prototype,"surfaceColor",void 0),s([i({type:h,json:{write:!0}})],d.prototype,"navigationConstraint",void 0),d=I=s([C("esri.Ground")],d);const g=d,u=new WeakMap;function j(e){return!e.destroyed&&(u.has(e)||e.addHandles([k(()=>{const t=e.parent;return!(!t||!("type"in t))&&(t.type==="catalog-dynamic-group"||j(t))},t=>u.set(e,t),X),Y(()=>u.delete(e))]),u.get(e))}function ie(e){return typeof e=="object"&&e!=null&&"loaded"in e&&e.loaded===!0&&"type"in e}function ne(e){return!(!ie(e)||!q(e)?.operations?.supportsEditing||"editingEnabled"in e&&!H(e)||j(e))}const L=()=>m.getLogger("esri.support.basemapUtils");function le(){return{}}function de(e){for(const t in e){const a=e[t];f(a),delete e[t]}}function pe(e,t){let a;if(typeof e=="string"){const r=e in A,n=!r&&e.includes("/");if(!r&&!n){if(K.apiKey)L().warn(`Unable to find basemap definition for: ${e}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const l=Object.entries(A).filter(([p,y])=>y.classic||y.is3d).map(([p])=>`"${p}"`).sort().join(", ");L().warn(`Unable to find basemap definition for: ${e}. Try one of these: ${l}`)}return null}t&&(a=t[e]),a||(a=r?c.fromId(e):new c({style:{id:e}}),t&&(t[e]=a))}else a=F(c,e);return a?.destroyed&&(L().warn("The provided basemap is already destroyed",{basemap:a}),a=null),a}const x={"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 ye(e){let t=null;if(typeof e=="string")if(e in x){const a=x[e];t=new g({resourceInfo:{data:{layers:[a]}}})}else m.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${e}. Try "world-elevation"`);else t=F(g,e);return t}let o=class extends re(ae(Q.EventedMixin(W))){constructor(e){super(e),this.allLayers=new $({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:t=>"layers"in t?t.layers:null}),this.allTables=se(this),this.basemap=null,this.editableLayers=new $({getCollections:()=>[this.allLayers],itemFilterFunction:ne}),this.ground=new g,this._basemapCache=le()}destroy(){de(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=f(this.basemap),f(this.ground),this._set("ground",null)}castBasemap(e){return pe(e,this._basemapCache)}castGround(e){return ye(e)??this._get("ground")}findLayerById(e){return this.allLayers.find(t=>t.id===e)}findTableById(e){return this.allTables.find(t=>t.id===e)}};s([i({readOnly:!0,dependsOn:[]})],o.prototype,"allLayers",void 0),s([i({readOnly:!0})],o.prototype,"allTables",void 0),s([i({type:c,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],o.prototype,"basemap",void 0),s([S("basemap")],o.prototype,"castBasemap",null),s([i({readOnly:!0})],o.prototype,"editableLayers",void 0),s([i({type:g,nonNullable:!0})],o.prototype,"ground",void 0),s([S("ground")],o.prototype,"castGround",null),s([i()],o.prototype,"undoRedo",void 0),o=s([C("esri.Map")],o);const Te=o;export{Te as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ElevationQuery-qAsmERYh-BsVTa_m3.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./layersCreator-CW56kDKc-CkfoFLoQ.js","./portalLayers-Bh9bAhk4-Y1T2RWf3.js","./associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./PortalItem-CctGdnxF-CfFOGshS.js","./fetchService-DbaKmJhP-Ccg-phWf.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./styleUtils-ChrJTYIw-C6xq7Jeu.js"])))=>i.map(i=>d[i]); +import{_ as b}from"./main-QGPoLsvl.js";import{v as s,bz as B,i as C,bA as N,aB as P,ag as D,aU as G,a1 as m,aA as f,am as U,o as R,$ as w,P as E,S as i,ac as M,bB as T,bC as V,bD as z,ar as J,I as Q,j as W,ad as S,e as Z,bE as q,bF as H,C as K,bG as F,ah as k,ax as X,a2 as Y}from"./story-Doly9N9p.js";import{F as c,s as A}from"./Basemap-BEqqSTw9-yGsB1EL7.js";import{o as ee}from"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import{y as te}from"./loadAll-e978YItg-4pMG3qU7.js";import{f as $}from"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import{x as re,L as ae,g as se}from"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";var _;let h=_=class extends Z{constructor(e){super(e),this.type="none"}clone(){return new _({type:this.type})}};s([B({none:"none",stayAbove:"stay-above"})],h.prototype,"type",void 0),h=_=s([C("esri.ground.NavigationConstraint")],h);var I;let d=I=class extends N(P){constructor(e){super(e),this.opacity=1,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new D;const t=r=>{r.parent&&r.parent!==this&&"remove"in r.parent&&r.parent.remove(r),r.parent=this,r.type!=="elevation"&&r.type!=="base-elevation"&&m.getLogger(this).error(`Layer '${r.title}, id:${r.id}' of type '${r.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},a=r=>{r.parent=null};this.addHandles([this.layers.on("after-add",r=>t(r.item)),this.layers.on("after-remove",r=>a(r.item))])}initialize(){this.when().catch(e=>{G(e)||m.getLogger(this).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)f(t);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",U(e,this._get("layers")))}writeLayers(e,t,a,r){const n=[];e&&(r={...r,layerContainerType:"ground"},e.forEach(l=>{if("write"in l){const p={};ee(l)().write(p,r)&&n.push(p)}else r?.messages&&r.messages.push(new R("layer:unsupported",`Layers (${l.title}, ${l.id}) of type '${l.declaredClass}' cannot be persisted in the ground`,{layer:l}))})),t.layers=n}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return te(this,e=>{e(this.layers)})}async queryElevation(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-BsVTa_m3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);w(t);const r=new a,n=this.layers.filter(O).toArray();return r.queryAll(n,e,t)}async createElevationSampler(e,t){await this.load({signal:t?.signal});const{ElevationQuery:a}=await b(()=>import("./ElevationQuery-qAsmERYh-BsVTa_m3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);w(t);const r=new a,n=this.layers.filter(O).toArray();return r.createSamplerAll(n,e,t)}clone(){const e={opacity:this.opacity,surfaceColor:E(this.surfaceColor),navigationConstraint:E(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus="loaded"),new I({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()}async _loadLayersFromJSON(e,t,a){const r=t?.origin||"web-scene",n=t?.portal||null,l=t?.url||null,{populateOperationalLayers:p}=await b(async()=>{const{populateOperationalLayers:v}=await import("./layersCreator-CW56kDKc-CkfoFLoQ.js");return{populateOperationalLayers:v}},__vite__mapDeps([8,1,2,3,4,9,10,11,12,13,14,5,6,15]),import.meta.url);w(a);const y=[];if(e.layers&&Array.isArray(e.layers)){const v={context:{origin:r,url:l,portal:n,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};y.push(p(this.layers,e.layers,v))}await Promise.allSettled(y)}};function oe(e){return e&&"createElevationSampler"in e}function O(e){return e.type==="elevation"||oe(e)}s([i({json:{read:!1}})],d.prototype,"layers",null),s([M("layers")],d.prototype,"writeLayers",null),s([i({readOnly:!0})],d.prototype,"resourceInfo",void 0),s([i({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:T,read:{reader:V,source:"transparency"},write:{writer:(e,t)=>{t.transparency=z(e)},target:"transparency"}}})],d.prototype,"opacity",void 0),s([i({type:J,json:{type:[T],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],d.prototype,"surfaceColor",void 0),s([i({type:h,json:{write:!0}})],d.prototype,"navigationConstraint",void 0),d=I=s([C("esri.Ground")],d);const g=d,u=new WeakMap;function j(e){return!e.destroyed&&(u.has(e)||e.addHandles([k(()=>{const t=e.parent;return!(!t||!("type"in t))&&(t.type==="catalog-dynamic-group"||j(t))},t=>u.set(e,t),X),Y(()=>u.delete(e))]),u.get(e))}function ie(e){return typeof e=="object"&&e!=null&&"loaded"in e&&e.loaded===!0&&"type"in e}function ne(e){return!(!ie(e)||!q(e)?.operations?.supportsEditing||"editingEnabled"in e&&!H(e)||j(e))}const L=()=>m.getLogger("esri.support.basemapUtils");function le(){return{}}function de(e){for(const t in e){const a=e[t];f(a),delete e[t]}}function pe(e,t){let a;if(typeof e=="string"){const r=e in A,n=!r&&e.includes("/");if(!r&&!n){if(K.apiKey)L().warn(`Unable to find basemap definition for: ${e}. See available styles at https://developers.arcgis.com/rest/basemap-styles/`);else{const l=Object.entries(A).filter(([p,y])=>y.classic||y.is3d).map(([p])=>`"${p}"`).sort().join(", ");L().warn(`Unable to find basemap definition for: ${e}. Try one of these: ${l}`)}return null}t&&(a=t[e]),a||(a=r?c.fromId(e):new c({style:{id:e}}),t&&(t[e]=a))}else a=F(c,e);return a?.destroyed&&(L().warn("The provided basemap is already destroyed",{basemap:a}),a=null),a}const x={"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 ye(e){let t=null;if(typeof e=="string")if(e in x){const a=x[e];t=new g({resourceInfo:{data:{layers:[a]}}})}else m.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${e}. Try "world-elevation"`);else t=F(g,e);return t}let o=class extends re(ae(Q.EventedMixin(W))){constructor(e){super(e),this.allLayers=new $({getCollections:()=>[this.basemap?.baseLayers,this.ground?.layers,this.layers,this.basemap?.referenceLayers],getChildrenFunction:t=>"layers"in t?t.layers:null}),this.allTables=se(this),this.basemap=null,this.editableLayers=new $({getCollections:()=>[this.allLayers],itemFilterFunction:ne}),this.ground=new g,this._basemapCache=le()}destroy(){de(this._basemapCache),this._basemapCache=null,this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),this.basemap=f(this.basemap),f(this.ground),this._set("ground",null)}castBasemap(e){return pe(e,this._basemapCache)}castGround(e){return ye(e)??this._get("ground")}findLayerById(e){return this.allLayers.find(t=>t.id===e)}findTableById(e){return this.allTables.find(t=>t.id===e)}};s([i({readOnly:!0,dependsOn:[]})],o.prototype,"allLayers",void 0),s([i({readOnly:!0})],o.prototype,"allTables",void 0),s([i({type:c,json:{read:{source:"baseMap"},write:{target:"baseMap"}}})],o.prototype,"basemap",void 0),s([S("basemap")],o.prototype,"castBasemap",null),s([i({readOnly:!0})],o.prototype,"editableLayers",void 0),s([i({type:g,nonNullable:!0})],o.prototype,"ground",void 0),s([S("ground")],o.prototype,"castGround",null),s([i()],o.prototype,"undoRedo",void 0),o=s([C("esri.Map")],o);const Te=o;export{Te as default}; diff --git a/custom-toc-highlight/assets/MapImageLayer-B_rP0PhA-D0-dI6ut.js b/custom-toc-highlight/assets/MapImageLayer-B_rP0PhA-BDp1ZtcT.js similarity index 61% rename from custom-toc-highlight/assets/MapImageLayer-B_rP0PhA-D0-dI6ut.js rename to custom-toc-highlight/assets/MapImageLayer-B_rP0PhA-BDp1ZtcT.js index 90ba1184..0fc56144 100644 --- a/custom-toc-highlight/assets/MapImageLayer-B_rP0PhA-D0-dI6ut.js +++ b/custom-toc-highlight/assets/MapImageLayer-B_rP0PhA-BDp1ZtcT.js @@ -1 +1 @@ -import{W as S,bO as f,bP as d,bM as I,f as g,n as w,o as b,aU as O,v as o,S as a,bQ as v,a0 as T,ac as P,bB as M,i as E}from"./story-BfX8CRfG.js";import{y as L}from"./loadAll-e978YItg-CdtGGDtb.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{c as R}from"./scaleUtils-DxsfQwK1-D7ZZd5W4.js";import{D as U}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{n as _}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{k as $,M as N,A as j}from"./SublayersOwner-DfTaMJ5V-DMBhnxeT.js";import{a as J}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{u as k}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as q}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{E as A}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as V}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as D}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{x as Z}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{Z as z}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{r as B}from"./ExportImageParameters-DxyNGQ57-0etxSPmv.js";import{i as C}from"./imageBitmapUtils-DA36kg39-CZPhYtU7.js";import{f as x}from"./sublayerUtils-CyM0QC5B-D9HVKWXR.js";import{a as G}from"./versionUtils-LZYZz-38-DxOZEoAg.js";import{k as H}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./main-ugzBrWNm.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./QueryTask-CwHwH2rS-B8khefoW.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./executeForIds-Z1gkLduF-D8DZG8qZ.js";import"./query-DFW9-NG_-gbjlxRZk.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./executeQueryPBF-o8010HS9-BgTBXvCY.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./executeQueryJSON-CcHnccia-BW7_NQxl.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./FeatureType-C9hJmS6_-BXWT6QCe.js";import"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import"./Relationship-PyhUibYK-BgFx3_5x.js";import"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";let e=class extends k(Z(W($(N(J(A(V(F(D(_(q(U)))))))))))){constructor(...r){super(...r),this._exportImageParameters=new B({layer:this}),this.dateFieldsTimeZone=null,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.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(r,t){return typeof r=="string"?{url:r,...t}:r}load(r){const t=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},r).catch(S).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(r,t){const n=t.supportedImageFormatTypes;return n&&n.includes("PNG32")?"png32":"png24"}writeSublayers(r,t,n,s){if(!this.loaded||!r)return;const m=r.slice().reverse().flatten(({sublayers:i})=>i&&i.toArray().reverse()).toArray();let p=!1;const l=f(s.origin);if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers){if(l===d.PORTAL_ITEM){const i=this.createSublayersForOrigin("service").sublayers;p=x(m,i,d.SERVICE)}else if(l>d.PORTAL_ITEM){const i=this.createSublayersForOrigin("portal-item");p=x(m,i.sublayers,f(i.origin))}}const h=[],c={writeSublayerStructure:p,...s};let u=p||this.hasVisibleLayersForOrigin(l);m.forEach(i=>{const y=i.write({},c);h.push(y),u=u||i.originOf("visible")==="user"}),h.some(i=>Object.keys(i).length>1)&&(t.layers=h),u&&(t.visibleLayers=m.filter(i=>i.visible).map(i=>i.id))}createExportImageParameters(r,t,n,s){const m=s?.pixelRatio||1;r&&this.version>=10&&(r=r.clone().shiftCentralMeridian()),this._exportImageParameters.floors=s?.floors??null,this._exportImageParameters.scale=R({extent:r,width:t})*m;const p=this._exportImageParameters.toJSON(),l=!s?.rotation||this.version<10.3?{}:{rotation:-s.rotation},h=r?.spatialReference,c=I(h);p.dpi*=m;const u={};if(s?.timeExtent){const{start:i,end:y}=s.timeExtent.toJSON();u.time=i&&y&&i===y?""+i:`${i??"null"},${y??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(u.time="null,null");return{bbox:r&&r.xmin+","+r.ymin+","+r.xmax+","+r.ymax,bboxSR:c,imageSR:c,size:t+","+n,...p,...l,...u}}async fetchImage(r,t,n,s){const{data:m}=await this._fetchImage("image",r,t,n,s);return m}async fetchImageBitmap(r,t,n,s){const{data:m,url:p}=await this._fetchImage("blob",r,t,n,s);return C(m,p,s?.signal)}async fetchRecomputedExtents(r={}){const t={...r,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:n}=await g(this.url,t),{extent:s,fullExtent:m,timeExtent:p}=n,l=s||m;return{fullExtent:l&&w.fromJSON(l),timeExtent:p&&H.fromJSON({start:p[0],end:p[1]})}}loadAll(){return L(this,r=>{r(this.allSublayers),r(this.subtables)})}serviceSupportsSpatialReference(r){return G(this,r)}async _fetchImage(r,t,n,s,m){const p={responseType:r,signal:m?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(t,n,s,m),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},l=this.parsedUrl.path+"/export";if(p.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:p.query});try{const{data:h}=await g(l,p);return{data:h,url:l}}catch(h){throw O(h)?h:new b("mapimagelayer:image-fetch-error",`Unable to load image: ${l}`,{error:h})}}async _fetchService(r){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:n}=await g(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:r});n&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(r){return!(r==null||!this.sublayersSourceJSON[r]?.visibleLayers)}};o([a(v("dateFieldsTimeReference"))],e.prototype,"dateFieldsTimeZone",void 0),o([a({type:Boolean})],e.prototype,"datesInUnknownTimezone",void 0),o([a()],e.prototype,"dpi",void 0),o([a()],e.prototype,"gdbVersion",void 0),o([a()],e.prototype,"imageFormat",void 0),o([T("imageFormat",["supportedImageFormatTypes"])],e.prototype,"readImageFormat",null),o([a({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],e.prototype,"imageMaxHeight",void 0),o([a({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],e.prototype,"imageMaxWidth",void 0),o([a()],e.prototype,"imageTransparency",void 0),o([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],e.prototype,"isReference",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"labelsVisible",void 0),o([a({type:["ArcGISMapServiceLayer"]})],e.prototype,"operationalLayerType",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"popupEnabled",void 0),o([a(v("preferredTimeReference"))],e.prototype,"preferredTimeZone",void 0),o([a()],e.prototype,"sourceJSON",void 0),o([a({json:{write:{ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),o([P("sublayers",{layers:{type:[j]},visibleLayers:{type:[M]}})],e.prototype,"writeSublayers",null),o([a({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),o([a({json:{read:!1},readOnly:!0,value:"map-image"})],e.prototype,"type",void 0),o([a(z)],e.prototype,"url",void 0),e=o([E("esri.layers.MapImageLayer")],e);const Re=e;export{Re as default}; +import{W as S,bO as f,bP as d,bM as I,f as g,n as w,o as b,aU as O,v as o,S as a,bQ as v,a0 as T,ac as P,bB as M,i as E}from"./story-Doly9N9p.js";import{y as L}from"./loadAll-e978YItg-4pMG3qU7.js";import{m as F}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{c as R}from"./scaleUtils-DxsfQwK1-CzyfErWH.js";import{D as U}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{n as _}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{k as $,M as N,A as j}from"./SublayersOwner-DfTaMJ5V-DrC0bgDm.js";import{a as J}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{u as k}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as q}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{E as A}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as V}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as D}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{x as Z}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{Z as z}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{r as B}from"./ExportImageParameters-DxyNGQ57-D1Dwm6AT.js";import{i as C}from"./imageBitmapUtils-DA36kg39-BfNbbEDs.js";import{f as x}from"./sublayerUtils-CyM0QC5B-B1ryunQi.js";import{a as G}from"./versionUtils-LZYZz-38-B8C5OAjF.js";import{k as H}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./main-QGPoLsvl.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./QueryTask-CwHwH2rS-D4f5dsGo.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./executeForIds-Z1gkLduF-CrWEksFG.js";import"./query-DFW9-NG_-C3TyGmiM.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./executeQueryPBF-o8010HS9-B7Z-YQyg.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./executeQueryJSON-CcHnccia-M-vnTvKl.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./FeatureType-C9hJmS6_-CNlvn5D1.js";import"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";let e=class extends k(Z(W($(N(J(A(V(F(D(_(q(U)))))))))))){constructor(...r){super(...r),this._exportImageParameters=new B({layer:this}),this.dateFieldsTimeZone=null,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.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(r,t){return typeof r=="string"?{url:r,...t}:r}load(r){const t=r!=null?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},r).catch(S).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(r,t){const n=t.supportedImageFormatTypes;return n&&n.includes("PNG32")?"png32":"png24"}writeSublayers(r,t,n,s){if(!this.loaded||!r)return;const m=r.slice().reverse().flatten(({sublayers:i})=>i&&i.toArray().reverse()).toArray();let p=!1;const l=f(s.origin);if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers){if(l===d.PORTAL_ITEM){const i=this.createSublayersForOrigin("service").sublayers;p=x(m,i,d.SERVICE)}else if(l>d.PORTAL_ITEM){const i=this.createSublayersForOrigin("portal-item");p=x(m,i.sublayers,f(i.origin))}}const h=[],c={writeSublayerStructure:p,...s};let u=p||this.hasVisibleLayersForOrigin(l);m.forEach(i=>{const y=i.write({},c);h.push(y),u=u||i.originOf("visible")==="user"}),h.some(i=>Object.keys(i).length>1)&&(t.layers=h),u&&(t.visibleLayers=m.filter(i=>i.visible).map(i=>i.id))}createExportImageParameters(r,t,n,s){const m=s?.pixelRatio||1;r&&this.version>=10&&(r=r.clone().shiftCentralMeridian()),this._exportImageParameters.floors=s?.floors??null,this._exportImageParameters.scale=R({extent:r,width:t})*m;const p=this._exportImageParameters.toJSON(),l=!s?.rotation||this.version<10.3?{}:{rotation:-s.rotation},h=r?.spatialReference,c=I(h);p.dpi*=m;const u={};if(s?.timeExtent){const{start:i,end:y}=s.timeExtent.toJSON();u.time=i&&y&&i===y?""+i:`${i??"null"},${y??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(u.time="null,null");return{bbox:r&&r.xmin+","+r.ymin+","+r.xmax+","+r.ymax,bboxSR:c,imageSR:c,size:t+","+n,...p,...l,...u}}async fetchImage(r,t,n,s){const{data:m}=await this._fetchImage("image",r,t,n,s);return m}async fetchImageBitmap(r,t,n,s){const{data:m,url:p}=await this._fetchImage("blob",r,t,n,s);return C(m,p,s?.signal)}async fetchRecomputedExtents(r={}){const t={...r,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:n}=await g(this.url,t),{extent:s,fullExtent:m,timeExtent:p}=n,l=s||m;return{fullExtent:l&&w.fromJSON(l),timeExtent:p&&H.fromJSON({start:p[0],end:p[1]})}}loadAll(){return L(this,r=>{r(this.allSublayers),r(this.subtables)})}serviceSupportsSpatialReference(r){return G(this,r)}async _fetchImage(r,t,n,s,m){const p={responseType:r,signal:m?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(t,n,s,m),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},l=this.parsedUrl.path+"/export";if(p.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:p.query});try{const{data:h}=await g(l,p);return{data:h,url:l}}catch(h){throw O(h)?h:new b("mapimagelayer:image-fetch-error",`Unable to load image: ${l}`,{error:h})}}async _fetchService(r){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:n}=await g(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:r});n&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(r){return!(r==null||!this.sublayersSourceJSON[r]?.visibleLayers)}};o([a(v("dateFieldsTimeReference"))],e.prototype,"dateFieldsTimeZone",void 0),o([a({type:Boolean})],e.prototype,"datesInUnknownTimezone",void 0),o([a()],e.prototype,"dpi",void 0),o([a()],e.prototype,"gdbVersion",void 0),o([a()],e.prototype,"imageFormat",void 0),o([T("imageFormat",["supportedImageFormatTypes"])],e.prototype,"readImageFormat",null),o([a({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],e.prototype,"imageMaxHeight",void 0),o([a({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],e.prototype,"imageMaxWidth",void 0),o([a()],e.prototype,"imageTransparency",void 0),o([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],e.prototype,"isReference",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"labelsVisible",void 0),o([a({type:["ArcGISMapServiceLayer"]})],e.prototype,"operationalLayerType",void 0),o([a({json:{read:!1,write:!1}})],e.prototype,"popupEnabled",void 0),o([a(v("preferredTimeReference"))],e.prototype,"preferredTimeZone",void 0),o([a()],e.prototype,"sourceJSON",void 0),o([a({json:{write:{ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),o([P("sublayers",{layers:{type:[j]},visibleLayers:{type:[M]}})],e.prototype,"writeSublayers",null),o([a({type:["show","hide","hide-children"]})],e.prototype,"listMode",void 0),o([a({json:{read:!1},readOnly:!0,value:"map-image"})],e.prototype,"type",void 0),o([a(z)],e.prototype,"url",void 0),e=o([E("esri.layers.MapImageLayer")],e);const Re=e;export{Re as default}; diff --git a/custom-toc-highlight/assets/MapImageLayerView2D-LI7T-1xm-CBbeiZP3.js b/custom-toc-highlight/assets/MapImageLayerView2D-LI7T-1xm-CBbeiZP3.js deleted file mode 100644 index 00a393f8..00000000 --- a/custom-toc-highlight/assets/MapImageLayerView2D-LI7T-1xm-CBbeiZP3.js +++ /dev/null @@ -1 +0,0 @@ -import{aU as g,a1 as l,ah as d,v as r,S as o,i as h}from"./story-BfX8CRfG.js";import{o as u}from"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import{d as c}from"./BitmapContainer-BC8fvmFc-myTzpniv.js";import{X as y,Y as f}from"./LayerView-Bish-E63-rB2WUWF4.js";import{X as x}from"./GraphicsView2D-C4wYE2ut-DMrrhOCh.js";import{l as w}from"./HighlightGraphicContainer-Dt5r6lMq-KuyTjNqc.js";import{K as _}from"./ExportStrategy-BNE7Gp0u-j76jQ8Ao.js";import{r as v}from"./ExportImageParameters-DxyNGQ57-0etxSPmv.js";import{T as H}from"./timeSupport-ohWmWReZ-ByDHlqgT.js";import{n as I}from"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";import{O as U}from"./MapServiceLayerViewHelper-bw3M4B8s-2ec3v39J.js";import{x as V}from"./drapedUtils-BZ1SGPtE-B2FavufJ.js";import"./main-ugzBrWNm.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";import"./AGraphicContainer-LUCT6Gle-Dvv0TF4N.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./Bitmap-CcqmzvfR-Bqft9oF3.js";import"./scaleUtils-DxsfQwK1-D7ZZd5W4.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-D9HVKWXR.js";import"./languageUtils-BYxF9hRA-BBstOXAc.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-B8KlJvO_.js";import"./number-eRKYXfX9-eI8aiR_7.js";import"./popupUtils-nV1O8RUO-DAL58cHP.js";const E=t=>{let i=class extends t{initialize(){this.exportImageParameters=new v({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){return this.view?.floors??null}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return H(this.layer,this.view?.timeExtent,this._get("timeExtent"))}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return r([o()],i.prototype,"exportImageParameters",void 0),r([o({readOnly:!0})],i.prototype,"floors",null),r([o({readOnly:!0})],i.prototype,"exportImageVersion",null),r([o()],i.prototype,"layer",void 0),r([o()],i.prototype,"suspended",void 0),r([o({readOnly:!0})],i.prototype,"timeExtent",null),i=r([h("esri.views.layers.MapImageLayerView")],i),i};let m=class extends E(I(y(f))){constructor(){super(...arguments),this._highlightGraphics=new u,this._updateHash=""}fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i)}update(t){const i=`${this.exportImageVersion}/${t.state.id}/${t.pixelRatio}/${t.stationary}`;this._updateHash!==i&&(this._updateHash=i,this.strategy.update(t).catch(e=>{g(e)||l.getLogger(this).error(e)}),t.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(t.state.resolution)),this._highlightView.processUpdate(t)}attach(){const{imageMaxWidth:t,imageMaxHeight:i,version:e}=this.layer,p=e>=10.3,n=e>=10;this._bitmapContainer=new c,this.container.addChild(this._bitmapContainer),this._highlightView=new x({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new U({createFetchPopupFeaturesQueryGeometry:(a,s)=>V(a,s,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(a,s)=>{this._highlightView.graphicUpdateHandler({graphic:a,property:s})},layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new _({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:t,imageMaxHeight:i,imageRotationSupported:p,imageNormalizationSupported:n,hidpi:!0}),this.addAttachHandles(d(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,i,e,p){return this.layer.fetchImage(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}fetchImageBitmap(t,i,e,p){return this.layer.fetchImageBitmap(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}highlight(t){return this._popupHighlightHelper.highlight(t)}};r([o()],m.prototype,"strategy",void 0),r([o()],m.prototype,"updating",void 0),m=r([h("esri.views.2d.layers.MapImageLayerView2D")],m);const Bi=m;export{Bi as default}; diff --git a/custom-toc-highlight/assets/MapImageLayerView2D-LI7T-1xm-ZTi6guUq.js b/custom-toc-highlight/assets/MapImageLayerView2D-LI7T-1xm-ZTi6guUq.js new file mode 100644 index 00000000..c9a642ae --- /dev/null +++ b/custom-toc-highlight/assets/MapImageLayerView2D-LI7T-1xm-ZTi6guUq.js @@ -0,0 +1 @@ +import{aU as g,a1 as l,ah as d,v as r,S as o,i as h}from"./story-Doly9N9p.js";import{o as u}from"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import{d as c}from"./BitmapContainer-BC8fvmFc-C6Z_3UuF.js";import{X as y,Y as f}from"./LayerView-Bish-E63-DK1SFHE3.js";import{X as x}from"./GraphicsView2D-C4wYE2ut-DdVMjjMv.js";import{l as w}from"./HighlightGraphicContainer-Dt5r6lMq-CwALk6za.js";import{K as _}from"./ExportStrategy-BNE7Gp0u-CHHOPUHq.js";import{r as v}from"./ExportImageParameters-DxyNGQ57-D1Dwm6AT.js";import{T as H}from"./timeSupport-ohWmWReZ-D2lpSlXU.js";import{n as I}from"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";import{O as U}from"./MapServiceLayerViewHelper-bw3M4B8s-UNSGy25k.js";import{x as V}from"./drapedUtils-BZ1SGPtE-bBUh2hex.js";import"./main-QGPoLsvl.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";import"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./Bitmap-CcqmzvfR-C22fE2NY.js";import"./scaleUtils-DxsfQwK1-CzyfErWH.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-B1ryunQi.js";import"./languageUtils-BYxF9hRA-DnySuvAL.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BBIRhcUQ.js";import"./number-eRKYXfX9-bCdnHRN-.js";import"./popupUtils-nV1O8RUO-BYG2KoFf.js";const E=t=>{let i=class extends t{initialize(){this.exportImageParameters=new v({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get floors(){return this.view?.floors??null}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),this.commitProperty("floors"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return H(this.layer,this.view?.timeExtent,this._get("timeExtent"))}canResume(){return!!super.canResume()&&!this.timeExtent?.isEmpty}};return r([o()],i.prototype,"exportImageParameters",void 0),r([o({readOnly:!0})],i.prototype,"floors",null),r([o({readOnly:!0})],i.prototype,"exportImageVersion",null),r([o()],i.prototype,"layer",void 0),r([o()],i.prototype,"suspended",void 0),r([o({readOnly:!0})],i.prototype,"timeExtent",null),i=r([h("esri.views.layers.MapImageLayerView")],i),i};let m=class extends E(I(y(f))){constructor(){super(...arguments),this._highlightGraphics=new u,this._updateHash=""}fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i)}update(t){const i=`${this.exportImageVersion}/${t.state.id}/${t.pixelRatio}/${t.stationary}`;this._updateHash!==i&&(this._updateHash=i,this.strategy.update(t).catch(e=>{g(e)||l.getLogger(this).error(e)}),t.stationary&&this._popupHighlightHelper.updateHighlightedFeatures(t.state.resolution)),this._highlightView.processUpdate(t)}attach(){const{imageMaxWidth:t,imageMaxHeight:i,version:e}=this.layer,p=e>=10.3,n=e>=10;this._bitmapContainer=new c,this.container.addChild(this._bitmapContainer),this._highlightView=new x({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new w(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1}),this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new U({createFetchPopupFeaturesQueryGeometry:(a,s)=>V(a,s,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(a,s)=>{this._highlightView.graphicUpdateHandler({graphic:a,property:s})},layerView:this,updatingHandles:this._updatingHandles}),this.strategy=new _({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:t,imageMaxHeight:i,imageRotationSupported:p,imageNormalizationSupported:n,hidpi:!0}),this.addAttachHandles(d(()=>this.exportImageVersion,()=>this.requestUpdate())),this.requestUpdate()}detach(){this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy(),this._popupHighlightHelper.destroy()}viewChange(){}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}async doRefresh(){this._updateHash="",this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,i,e,p){return this.layer.fetchImage(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}fetchImageBitmap(t,i,e,p){return this.layer.fetchImageBitmap(t,i,e,{timeExtent:this.timeExtent,floors:this.floors,...p})}highlight(t){return this._popupHighlightHelper.highlight(t)}};r([o()],m.prototype,"strategy",void 0),r([o()],m.prototype,"updating",void 0),m=r([h("esri.views.2d.layers.MapImageLayerView2D")],m);const Bi=m;export{Bi as default}; diff --git a/custom-toc-highlight/assets/MapNotesLayer-DauvjDLM-CHkiPy5B.js b/custom-toc-highlight/assets/MapNotesLayer-DauvjDLM-CxPThSsi.js similarity index 70% rename from custom-toc-highlight/assets/MapNotesLayer-DauvjDLM-CHkiPy5B.js rename to custom-toc-highlight/assets/MapNotesLayer-DauvjDLM-CxPThSsi.js index 5e3bdf5b..f6d68d4b 100644 --- a/custom-toc-highlight/assets/MapNotesLayer-DauvjDLM-CHkiPy5B.js +++ b/custom-toc-highlight/assets/MapNotesLayer-DauvjDLM-CxPThSsi.js @@ -1 +1 @@ -import{v as o,S as a,i as T,d$ as F,d_ as G,e0 as v,jI as B,J as h,ag as O,P as w,h6 as x,jJ as N,jK as I,gI as M,bi as z,o as k,dK as K,aC as W,b0 as C,a0 as d,ac as A,n as V,jL as D}from"./story-BfX8CRfG.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{V as b,J as H,_ as Q,W as U,K as Z}from"./projection-BA9M1R7d-BYoCXVXt.js";import{B as X}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import Y from"./FeatureLayer-BrRKw5Si-D6Z5CL70.js";import ee from"./GraphicsLayer-DfeGaYc1-BYhO2Zs8.js";import{D as te}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{i as re}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{u as oe}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as le}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{S as ae}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{y as E}from"./Field-C6hA1tZj-CpGOU6Y4.js";import"./main-ugzBrWNm.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import"./Relationship-PyhUibYK-BgFx3_5x.js";import"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./editsZScale-BDsX6vv--CttUpViY.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import"./ArcGISService-BYA-y6X6-C_YhndKK.js";import"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import"./EditBusLayer-Df29OyJh-DkVkxUAl.js";import"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import"./FeatureType-C9hJmS6_-BXWT6QCe.js";import"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import"./versionUtils-LZYZz-38-DxOZEoAg.js";import"./styleUtils-ChrJTYIw-BfDrXrWd.js";import"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";function g(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!R(e))}function R({layerDefinition:t,featureSet:e}){const r=t.geometryType??e.geometryType;return J.find(i=>r===i.geometryTypeJSON&&t.drawingInfo?.renderer?.symbol?.type===i.identifyingSymbol.type)}function j(){return new V({xmin:-180,ymin:-90,xmax:180,ymax:90})}const L=new E({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),ne=new E({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let m=class extends ee{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(){const t=this.layer?.spatialReference,e=this.fullBounds;return t?e==null?b(j(),t).geometry:M(e,t):null}get fullBounds(){const t=this.layer?.spatialReference;if(!t)return null;const e=x();return this.graphics.forEach(r=>{const i=r.geometry!=null?b(r.geometry,t).geometry:null;i!=null&&N(e,i.type==="point"?i:i.extent,e)}),I(e,D)?null:e}get sublayers(){return this.graphics}};o([a({readOnly:!0})],m.prototype,"fullExtent",null),o([a({readOnly:!0})],m.prototype,"fullBounds",null),o([a({readOnly:!0})],m.prototype,"sublayers",null),o([a()],m.prototype,"layer",void 0),o([a()],m.prototype,"layerId",void 0),o([a({readOnly:!0})],m.prototype,"visibilityMode",void 0),m=o([T("esri.layers.MapNotesLayer.MapNotesSublayer")],m);const J=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new F().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new G().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new v().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new v().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new B().toJSON()}];let l=class extends oe(ae(ie(le(q(te))))){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=h.WGS84,this.sublayers=new O(J.map(e=>new m({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:!g(e)&&r?.origin!=="portal-item"}}}readFeatureCollections(t,e,r){if(!g(e))return null;const i=e.layers.map(p=>{const n=new Y;return n.read(p,r),n});return new O({items:i})}readLegacyfeatureCollectionJSON(t,e){return g(e)?w(e.featureCollection):null}get fullExtent(){const t=this.spatialReference,e=x();return this.sublayers!=null?this.sublayers.forEach(({fullBounds:r})=>r!=null?N(e,r,e):e,e):this.featureCollectionJSON?.layers.some(r=>r.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(r=>{const i=b(r.layerDefinition.extent,t).geometry;i!=null&&N(e,i,e)}),I(e,D)?b(j(),t).geometry:M(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?h.fromJSON(e.layers[0].layerDefinition.spatialReference):h.WGS84}readSublayers(t,e,r){if(g(e))return null;const i=[];let p=e.layers.reduce((n,s)=>Math.max(n,s.layerDefinition.id??-1),-1)+1;for(const n of e.layers){const{layerDefinition:s,featureSet:y}=n,f=s.id??p++,u=R(n);if(u!=null){const c=new m({id:u.id,title:s.name,layerId:f,layer:this,graphics:y.features.map(({geometry:S,symbol:_,attributes:$,popupInfo:P})=>z.fromJSON({attributes:$,geometry:S,symbol:_,popupTemplate:P}))});i.push(c)}}return new O(i)}writeSublayers(t,e,r,i){const{minScale:p,maxScale:n}=this;if(t==null)return;const s=t.some(u=>u.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(s&&i?.messages?.push(new k("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer")));const y=[];let f=this.spatialReference.toJSON();e:for(const u of t)for(const c of u.graphics)if(c.geometry!=null){f=c.geometry.spatialReference.toJSON();break e}for(const u of J){const c=t.find(S=>u.id===S.id);this._writeMapNoteSublayer(y,c,u,p,n,f,i)}K("featureCollection.layers",y,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=w(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(this.sublayers==null)return;let t=null;const e=[];for(const i of this.sublayers)for(const p of i.graphics)if(p.geometry!=null){const n=p.geometry;t?W(n.spatialReference,t)||(H(n.spatialReference,t)||Q()||await U(),p.geometry=Z(n,t)):t=n.spatialReference,e.push(p)}const r=await X(e.map(i=>i.geometry));e.forEach((i,p)=>i.geometry=r[p])}_findSublayer(t){return this.sublayers==null?null:this.sublayers?.find(e=>e.id===t)??null}_writeMapNoteSublayer(t,e,r,i,p,n,s){const y=[];if(e!=null){for(const f of e.graphics)this._writeMapNote(y,f,r.geometryType,s);this._normalizeObjectIds(y,L),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:w(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:i,maxScale:p,objectIdField:"OBJECTID",fields:[L.toJSON(),ne.toJSON()],spatialReference:n},featureSet:{features:y,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,i){if(e==null)return;const{geometry:p,symbol:n,popupTemplate:s}=e;if(p==null)return;if(p.type!==r)return void i?.messages?.push(new C("map-notes-layer:invalid-geometry-type",`Geometry "${p.type}" cannot be saved in "${r}" layer`,{graphic:e}));if(n==null)return void i?.messages?.push(new C("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e}));const y={attributes:{...e.attributes},geometry:p.toJSON(),symbol:n.toJSON()};s!=null&&(y.popupInfo=s.toJSON()),t.push(y)}_normalizeObjectIds(t,e){const r=e.name;let i=re(r,t)+1;const p=new Set;for(const n of t){n.attributes||(n.attributes={});const{attributes:s}=n;(s[r]==null||p.has(s[r]))&&(s[r]=i++),p.add(s[r])}}};o([a({readOnly:!0})],l.prototype,"capabilities",void 0),o([d(["portal-item","web-map"],"capabilities",["layers"])],l.prototype,"readCapabilities",null),o([a({readOnly:!0})],l.prototype,"featureCollections",void 0),o([d(["web-map","portal-item"],"featureCollections",["layers"])],l.prototype,"readFeatureCollections",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],l.prototype,"featureCollectionJSON",void 0),o([d(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],l.prototype,"readLegacyfeatureCollectionJSON",null),o([a({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],l.prototype,"featureCollectionType",void 0),o([a({readOnly:!0})],l.prototype,"fullExtent",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],l.prototype,"legendEnabled",void 0),o([a({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"minScale",void 0),o([d(["web-map","portal-item"],"minScale",["layers"])],l.prototype,"readMinScale",null),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"maxScale",void 0),o([d(["web-map","portal-item"],"maxScale",["layers"])],l.prototype,"readMaxScale",null),o([a({readOnly:!0})],l.prototype,"multipointLayer",null),o([a({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],l.prototype,"operationalLayerType",void 0),o([a({readOnly:!0})],l.prototype,"pointLayer",null),o([a({readOnly:!0})],l.prototype,"polygonLayer",null),o([a({readOnly:!0})],l.prototype,"polylineLayer",null),o([a({type:h})],l.prototype,"spatialReference",void 0),o([d(["web-map","portal-item"],"spatialReference",["layers"])],l.prototype,"readSpatialReference",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],l.prototype,"sublayers",void 0),o([d("web-map","sublayers",["layers"])],l.prototype,"readSublayers",null),o([A("web-map","sublayers")],l.prototype,"writeSublayers",null),o([a({readOnly:!0})],l.prototype,"textLayer",null),o([a()],l.prototype,"title",void 0),o([a({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),l=o([T("esri.layers.MapNotesLayer")],l);const At=l;export{At as default}; +import{v as o,S as a,i as T,d$ as F,d_ as G,e0 as v,jI as B,J as h,ag as O,P as w,h6 as x,jJ as N,jK as I,gI as M,bi as z,o as k,dK as K,aC as W,b0 as C,a0 as d,ac as A,n as V,jL as D}from"./story-Doly9N9p.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{V as b,J as H,_ as Q,W as U,K as Z}from"./projection-BA9M1R7d-CAbqHZiw.js";import{B as X}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import Y from"./FeatureLayer-BrRKw5Si-DuA2fyE_.js";import ee from"./GraphicsLayer-DfeGaYc1-DRpZ_f0G.js";import{D as te}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{i as re}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{u as oe}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as le}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{S as ae}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{y as E}from"./Field-C6hA1tZj-CkWoRbmp.js";import"./main-QGPoLsvl.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./editsZScale-BDsX6vv--C-4n90TZ.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import"./EditBusLayer-Df29OyJh-OmdJOLws.js";import"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import"./FeatureType-C9hJmS6_-CNlvn5D1.js";import"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import"./versionUtils-LZYZz-38-B8C5OAjF.js";import"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";function g(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!R(e))}function R({layerDefinition:t,featureSet:e}){const r=t.geometryType??e.geometryType;return J.find(i=>r===i.geometryTypeJSON&&t.drawingInfo?.renderer?.symbol?.type===i.identifyingSymbol.type)}function j(){return new V({xmin:-180,ymin:-90,xmax:180,ymax:90})}const L=new E({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),ne=new E({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0,length:255});let m=class extends ee{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(){const t=this.layer?.spatialReference,e=this.fullBounds;return t?e==null?b(j(),t).geometry:M(e,t):null}get fullBounds(){const t=this.layer?.spatialReference;if(!t)return null;const e=x();return this.graphics.forEach(r=>{const i=r.geometry!=null?b(r.geometry,t).geometry:null;i!=null&&N(e,i.type==="point"?i:i.extent,e)}),I(e,D)?null:e}get sublayers(){return this.graphics}};o([a({readOnly:!0})],m.prototype,"fullExtent",null),o([a({readOnly:!0})],m.prototype,"fullBounds",null),o([a({readOnly:!0})],m.prototype,"sublayers",null),o([a()],m.prototype,"layer",void 0),o([a()],m.prototype,"layerId",void 0),o([a({readOnly:!0})],m.prototype,"visibilityMode",void 0),m=o([T("esri.layers.MapNotesLayer.MapNotesSublayer")],m);const J=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new F().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new G().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new v().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new v().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new B().toJSON()}];let l=class extends oe(ae(ie(le(q(te))))){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=h.WGS84,this.sublayers=new O(J.map(e=>new m({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:!g(e)&&r?.origin!=="portal-item"}}}readFeatureCollections(t,e,r){if(!g(e))return null;const i=e.layers.map(p=>{const n=new Y;return n.read(p,r),n});return new O({items:i})}readLegacyfeatureCollectionJSON(t,e){return g(e)?w(e.featureCollection):null}get fullExtent(){const t=this.spatialReference,e=x();return this.sublayers!=null?this.sublayers.forEach(({fullBounds:r})=>r!=null?N(e,r,e):e,e):this.featureCollectionJSON?.layers.some(r=>r.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(r=>{const i=b(r.layerDefinition.extent,t).geometry;i!=null&&N(e,i,e)}),I(e,D)?b(j(),t).geometry:M(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?h.fromJSON(e.layers[0].layerDefinition.spatialReference):h.WGS84}readSublayers(t,e,r){if(g(e))return null;const i=[];let p=e.layers.reduce((n,s)=>Math.max(n,s.layerDefinition.id??-1),-1)+1;for(const n of e.layers){const{layerDefinition:s,featureSet:y}=n,f=s.id??p++,u=R(n);if(u!=null){const c=new m({id:u.id,title:s.name,layerId:f,layer:this,graphics:y.features.map(({geometry:S,symbol:_,attributes:$,popupInfo:P})=>z.fromJSON({attributes:$,geometry:S,symbol:_,popupTemplate:P}))});i.push(c)}}return new O(i)}writeSublayers(t,e,r,i){const{minScale:p,maxScale:n}=this;if(t==null)return;const s=t.some(u=>u.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(s&&i?.messages?.push(new k("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer")));const y=[];let f=this.spatialReference.toJSON();e:for(const u of t)for(const c of u.graphics)if(c.geometry!=null){f=c.geometry.spatialReference.toJSON();break e}for(const u of J){const c=t.find(S=>u.id===S.id);this._writeMapNoteSublayer(y,c,u,p,n,f,i)}K("featureCollection.layers",y,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=w(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(this.sublayers==null)return;let t=null;const e=[];for(const i of this.sublayers)for(const p of i.graphics)if(p.geometry!=null){const n=p.geometry;t?W(n.spatialReference,t)||(H(n.spatialReference,t)||Q()||await U(),p.geometry=Z(n,t)):t=n.spatialReference,e.push(p)}const r=await X(e.map(i=>i.geometry));e.forEach((i,p)=>i.geometry=r[p])}_findSublayer(t){return this.sublayers==null?null:this.sublayers?.find(e=>e.id===t)??null}_writeMapNoteSublayer(t,e,r,i,p,n,s){const y=[];if(e!=null){for(const f of e.graphics)this._writeMapNote(y,f,r.geometryType,s);this._normalizeObjectIds(y,L),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:w(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:i,maxScale:p,objectIdField:"OBJECTID",fields:[L.toJSON(),ne.toJSON()],spatialReference:n},featureSet:{features:y,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,i){if(e==null)return;const{geometry:p,symbol:n,popupTemplate:s}=e;if(p==null)return;if(p.type!==r)return void i?.messages?.push(new C("map-notes-layer:invalid-geometry-type",`Geometry "${p.type}" cannot be saved in "${r}" layer`,{graphic:e}));if(n==null)return void i?.messages?.push(new C("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e}));const y={attributes:{...e.attributes},geometry:p.toJSON(),symbol:n.toJSON()};s!=null&&(y.popupInfo=s.toJSON()),t.push(y)}_normalizeObjectIds(t,e){const r=e.name;let i=re(r,t)+1;const p=new Set;for(const n of t){n.attributes||(n.attributes={});const{attributes:s}=n;(s[r]==null||p.has(s[r]))&&(s[r]=i++),p.add(s[r])}}};o([a({readOnly:!0})],l.prototype,"capabilities",void 0),o([d(["portal-item","web-map"],"capabilities",["layers"])],l.prototype,"readCapabilities",null),o([a({readOnly:!0})],l.prototype,"featureCollections",void 0),o([d(["web-map","portal-item"],"featureCollections",["layers"])],l.prototype,"readFeatureCollections",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],l.prototype,"featureCollectionJSON",void 0),o([d(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],l.prototype,"readLegacyfeatureCollectionJSON",null),o([a({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],l.prototype,"featureCollectionType",void 0),o([a({readOnly:!0})],l.prototype,"fullExtent",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],l.prototype,"legendEnabled",void 0),o([a({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"minScale",void 0),o([d(["web-map","portal-item"],"minScale",["layers"])],l.prototype,"readMinScale",null),o([a({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"maxScale",void 0),o([d(["web-map","portal-item"],"maxScale",["layers"])],l.prototype,"readMaxScale",null),o([a({readOnly:!0})],l.prototype,"multipointLayer",null),o([a({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],l.prototype,"operationalLayerType",void 0),o([a({readOnly:!0})],l.prototype,"pointLayer",null),o([a({readOnly:!0})],l.prototype,"polygonLayer",null),o([a({readOnly:!0})],l.prototype,"polylineLayer",null),o([a({type:h})],l.prototype,"spatialReference",void 0),o([d(["web-map","portal-item"],"spatialReference",["layers"])],l.prototype,"readSpatialReference",null),o([a({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],l.prototype,"sublayers",void 0),o([d("web-map","sublayers",["layers"])],l.prototype,"readSublayers",null),o([A("web-map","sublayers")],l.prototype,"writeSublayers",null),o([a({readOnly:!0})],l.prototype,"textLayer",null),o([a()],l.prototype,"title",void 0),o([a({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),l=o([T("esri.layers.MapNotesLayer")],l);const At=l;export{At as default}; diff --git a/custom-toc-highlight/assets/MapNotesLayerView2D-EusnP8A_-vtvY-W3D.js b/custom-toc-highlight/assets/MapNotesLayerView2D-EusnP8A_-53usLcYc.js similarity index 53% rename from custom-toc-highlight/assets/MapNotesLayerView2D-EusnP8A_-vtvY-W3D.js rename to custom-toc-highlight/assets/MapNotesLayerView2D-EusnP8A_-53usLcYc.js index 8edd31bc..d9d682ec 100644 --- a/custom-toc-highlight/assets/MapNotesLayerView2D-EusnP8A_-vtvY-W3D.js +++ b/custom-toc-highlight/assets/MapNotesLayerView2D-EusnP8A_-53usLcYc.js @@ -1 +1 @@ -import{bi as u,ag as f,aq as w,a2 as l,ah as p,aL as h,ai as y,v as _,i as V}from"./story-BfX8CRfG.js";import{X as v,Y as C}from"./LayerView-Bish-E63-rB2WUWF4.js";import{d as g}from"./GraphicContainer-DuOHUciE-sEoQdKXZ.js";import{X as c}from"./GraphicsView2D-C4wYE2ut-DMrrhOCh.js";import"./main-ugzBrWNm.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./AGraphicContainer-LUCT6Gle-Dvv0TF4N.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";const d="sublayers",m="layerView",H=new Set(["default"]);let n=class extends v(C){constructor(){super(...arguments),this._highlightIds=new Map}*graphicsViews(){this._graphicsViewsFeatureCollectionMap==null?this._graphicsViews==null?yield*[]:yield*this._graphicsViews:yield*this._graphicsViewsFeatureCollectionMap.keys()}async hitTest(i,t){return Array.from(this.graphicsViews(),r=>{const e=r.hitTest(i);if(this._graphicsViewsFeatureCollectionMap!=null){const o=this._graphicsViewsFeatureCollectionMap.get(r);for(const s of e)!s.popupTemplate&&o.popupTemplate&&(s.popupTemplate=o.popupTemplate),s.sourceLayer=s.layer=this.layer}return e}).flat().map(r=>({type:"graphic",graphic:r,layer:this.layer,mapPoint:i}))}highlight(i){let t;typeof i=="number"?t=[i]:i instanceof u?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(e=>e&&e.uid):f.isCollection(i)&&(t=i.map(e=>e&&e.uid).toArray());const r=t?.filter(w);return r?.length?(this._addHighlight(r),l(()=>this._removeHighlight(r))):l()}update(i){for(const t of this.graphicsViews())t.processUpdate(i)}attach(){const i=this.view,t=()=>this.requestUpdate(),r=this.layer.featureCollections;if(r!=null&&r.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const e of r){const o=new g(this.view.featuresTilingScheme),s=new c({view:i,graphics:e.source,renderer:e.renderer,requestUpdateCallback:t,container:o});this._graphicsViewsFeatureCollectionMap.set(s,e),this.container.addChild(s.container),this.addHandles([p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m)}this._updateHighlight()}else this.layer.sublayers!=null&&this.addHandles(y(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),d)}detach(){this._destroyGraphicsViews(),this.removeHandles(d)}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.removeHandles(m);for(const i of this.graphicsViews())i.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),this.layer.sublayers==null)return;const i=[],t=this.view,r=()=>this.requestUpdate();for(const e of this.layer.sublayers){const o=new g(this.view.featuresTilingScheme);o.fadeTransitionEnabled=!0;const s=new c({view:t,graphics:e.graphics,requestUpdateCallback:r,container:o});this.addHandles([e.on("graphic-update",s.graphicUpdateHandler),p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m),this.container.addChild(s.container),i.push(s)}this._graphicsViews=i,this._updateHighlight()}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t);this._highlightIds.set(t,r+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t)-1;r===0?this._highlightIds.delete(t):this._highlightIds.set(t,r)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys()),t=this._getHighlightBits(H);for(const r of this.graphicsViews())r.setHighlight(i.map(e=>({objectId:e,highlightFlags:t})))}};n=_([V("esri.views.2d.layers.MapNotesLayerView2D")],n);const vt=n;export{vt as default}; +import{bi as u,ag as f,aq as w,a2 as l,ah as p,aL as h,ai as y,v as _,i as V}from"./story-Doly9N9p.js";import{X as v,Y as C}from"./LayerView-Bish-E63-DK1SFHE3.js";import{d as g}from"./GraphicContainer-DuOHUciE-XlTfJEn3.js";import{X as c}from"./GraphicsView2D-C4wYE2ut-DdVMjjMv.js";import"./main-QGPoLsvl.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";const d="sublayers",m="layerView",H=new Set(["default"]);let n=class extends v(C){constructor(){super(...arguments),this._highlightIds=new Map}*graphicsViews(){this._graphicsViewsFeatureCollectionMap==null?this._graphicsViews==null?yield*[]:yield*this._graphicsViews:yield*this._graphicsViewsFeatureCollectionMap.keys()}async hitTest(i,t){return Array.from(this.graphicsViews(),r=>{const e=r.hitTest(i);if(this._graphicsViewsFeatureCollectionMap!=null){const o=this._graphicsViewsFeatureCollectionMap.get(r);for(const s of e)!s.popupTemplate&&o.popupTemplate&&(s.popupTemplate=o.popupTemplate),s.sourceLayer=s.layer=this.layer}return e}).flat().map(r=>({type:"graphic",graphic:r,layer:this.layer,mapPoint:i}))}highlight(i){let t;typeof i=="number"?t=[i]:i instanceof u?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(e=>e&&e.uid):f.isCollection(i)&&(t=i.map(e=>e&&e.uid).toArray());const r=t?.filter(w);return r?.length?(this._addHighlight(r),l(()=>this._removeHighlight(r))):l()}update(i){for(const t of this.graphicsViews())t.processUpdate(i)}attach(){const i=this.view,t=()=>this.requestUpdate(),r=this.layer.featureCollections;if(r!=null&&r.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const e of r){const o=new g(this.view.featuresTilingScheme),s=new c({view:i,graphics:e.source,renderer:e.renderer,requestUpdateCallback:t,container:o});this._graphicsViewsFeatureCollectionMap.set(s,e),this.container.addChild(s.container),this.addHandles([p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m)}this._updateHighlight()}else this.layer.sublayers!=null&&this.addHandles(y(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),d)}detach(){this._destroyGraphicsViews(),this.removeHandles(d)}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.removeHandles(m);for(const i of this.graphicsViews())i.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),this.layer.sublayers==null)return;const i=[],t=this.view,r=()=>this.requestUpdate();for(const e of this.layer.sublayers){const o=new g(this.view.featuresTilingScheme);o.fadeTransitionEnabled=!0;const s=new c({view:t,graphics:e.graphics,requestUpdateCallback:r,container:o});this.addHandles([e.on("graphic-update",s.graphicUpdateHandler),p(()=>e.visible,a=>s.container.visible=a,h),p(()=>s.updating,()=>this.notifyChange("updating"),h)],m),this.container.addChild(s.container),i.push(s)}this._graphicsViews=i,this._updateHighlight()}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t);this._highlightIds.set(t,r+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const r=this._highlightIds.get(t)-1;r===0?this._highlightIds.delete(t):this._highlightIds.set(t,r)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys()),t=this._getHighlightBits(H);for(const r of this.graphicsViews())r.setHighlight(i.map(e=>({objectId:e,highlightFlags:t})))}};n=_([V("esri.views.2d.layers.MapNotesLayerView2D")],n);const vt=n;export{vt as default}; diff --git a/custom-toc-highlight/assets/MapServiceLayerViewHelper-bw3M4B8s-2ec3v39J.js b/custom-toc-highlight/assets/MapServiceLayerViewHelper-bw3M4B8s-UNSGy25k.js similarity index 93% rename from custom-toc-highlight/assets/MapServiceLayerViewHelper-bw3M4B8s-2ec3v39J.js rename to custom-toc-highlight/assets/MapServiceLayerViewHelper-bw3M4B8s-UNSGy25k.js index f46220ef..bf9dadce 100644 --- a/custom-toc-highlight/assets/MapServiceLayerViewHelper-bw3M4B8s-2ec3v39J.js +++ b/custom-toc-highlight/assets/MapServiceLayerViewHelper-bw3M4B8s-UNSGy25k.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./visualVariableUtils-D3kZJRyn-23qzp7zg.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./lengthUtils-DKpMe5qR-C2NPRwwl.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js"])))=>i.map(i=>d[i]); -import{_ as X}from"./main-ugzBrWNm.js";import{v as a,S as p,af as Y,g as ee,ac as U,n as J,J as te,i as I,bi as Q,a0 as re,e as B,aO as ie,dJ as se,j as oe,bp as ne,ai as ae,o as A,ag as le,aq as T,a2 as z,e0 as M,an as pe,p as ue,K as ye,$ as L,e4 as ce,bV as k,dW as he,f as de,bK as fe,bM as me}from"./story-BfX8CRfG.js";import{a8 as ge}from"./languageUtils-BYxF9hRA-BBstOXAc.js";import{f as we,c as be}from"./scaleUtils-DxsfQwK1-D7ZZd5W4.js";import{e as N}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{y as $}from"./drapedUtils-BZ1SGPtE-B2FavufJ.js";import{B as ve}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{y as xe,n as Se,a as Fe}from"./utils-9sQxfkoa-KicvrT8N.js";import{s as Oe}from"./sublayerUtils-CyM0QC5B-D9HVKWXR.js";import{k as je}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import{h as Ee,m as Re}from"./popupUtils-nV1O8RUO-DAL58cHP.js";function _e(t,e){const{dpi:i,gdbVersion:o,geometry:r,geometryPrecision:n,height:s,historicMoment:d,layerOption:u,mapExtent:l,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,spatialReference:F,timeExtent:w,tolerance:g,width:b}=t.toJSON(),{dynamicLayers:j,layerDefs:E,layerIds:V}=Pe(t),D=e?.geometry!=null?e.geometry:null,v={historicMoment:d,geometryPrecision:n,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,tolerance:g},R=D?.toJSON()||r;v.imageDisplay=`${b},${s},${i}`,o&&(v.gdbVersion=o),R&&(delete R.spatialReference,v.geometry=JSON.stringify(R),v.geometryType=fe(R));const G=F??R?.spatialReference??l?.spatialReference;if(G&&(v.sr=me(G)),v.time=w?[w.start,w.end].join(","):null,l){const{xmin:Z,ymin:C,xmax:K,ymax:W}=l;v.mapExtent=`${Z},${C},${K},${W}`}return E&&(v.layerDefs=E),j&&!E&&(v.dynamicLayers=j),v.layers=u==="popup"?"visible":u,V&&!j&&(v.layers+=`:${V.join(",")}`),v}function Pe(t){const{mapExtent:e,floors:i,width:o,sublayers:r,layerIds:n,layerOption:s,gdbVersion:d}=t,u=r?.find(f=>f.layer!=null)?.layer?.serviceSublayers,l=s==="popup",y={},c=be({extent:e,width:o,spatialReference:e?.spatialReference}),m=[],x=f=>{const F=c===0,w=f.minScale===0||c<=f.minScale,g=f.maxScale===0||c>=f.maxScale;if(f.visible&&(F||w&&g))if(f.sublayers)f.sublayers.forEach(x);else{if(n?.includes(f.id)===!1||l&&(!f.popupTemplate||!f.popupEnabled))return;m.unshift(f)}};if(r?.forEach(x),r&&!m.length)y.layerIds=[];else{const f=Oe(m,u,d),F=m.map(w=>{const g=N(i,w);return w.toExportImageJSON(g)});if(f)y.dynamicLayers=JSON.stringify(F);else{if(r){let g=m.map(({id:b})=>b);n&&(g=g.filter(b=>n.includes(b))),y.layerIds=g}else n?.length&&(y.layerIds=n);const w=Ie(i,m);if(w!=null&&w.length){const g={};for(const b of w)b.definitionExpression&&(g[b.id]=b.definitionExpression);Object.keys(g).length&&(y.layerDefs=JSON.stringify(g))}}}return y}function Ie(t,e){const i=!!t?.length,o=e.filter(r=>r.definitionExpression!=null||i&&r.floorInfo!=null);return o.length?o.map(r=>{const n=N(t,r),s=k(n,r.definitionExpression);return{id:r.id,definitionExpression:s??void 0}}):null}var P;let h=P=class extends B{static from(t){return ie(P,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,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}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}};a([p({type:Number,json:{write:!0}})],h.prototype,"dpi",void 0),a([p()],h.prototype,"floors",void 0),a([p({type:String,json:{write:!0}})],h.prototype,"gdbVersion",void 0),a([p({types:Y,json:{read:ee,write:!0}})],h.prototype,"geometry",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"geometryPrecision",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"height",void 0),a([p({type:Date})],h.prototype,"historicMoment",void 0),a([U("historicMoment")],h.prototype,"writeHistoricMoment",null),a([p({type:[Number],json:{write:!0}})],h.prototype,"layerIds",void 0),a([p({type:["top","visible","all","popup"],json:{write:!0}})],h.prototype,"layerOption",void 0),a([p({type:J,json:{write:!0}})],h.prototype,"mapExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"maxAllowableOffset",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnFieldName",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnGeometry",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnM",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnUnformattedValues",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnZ",void 0),a([p({type:te,json:{write:!0}})],h.prototype,"spatialReference",void 0),a([p()],h.prototype,"sublayers",void 0),a([p({type:je,json:{write:!0}})],h.prototype,"timeExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"tolerance",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"width",void 0),h=P=a([I("esri.rest.support.IdentifyParameters")],h);const q=h;let S=class extends B{constructor(t){super(t),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(t,e){return Q.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(t,e){if(!t)return;const{attributes:i,geometry:o}=t;i&&(e.attributes={...i}),o!=null&&(e.geometry=o.toJSON(),e.geometryType=se.toJSON(o.type))}};a([p({type:String,json:{write:!0}})],S.prototype,"displayFieldName",void 0),a([p({type:Q})],S.prototype,"feature",void 0),a([re("feature",["attributes","geometry"])],S.prototype,"readFeature",null),a([U("feature")],S.prototype,"writeFeature",null),a([p({type:Number,json:{write:!0}})],S.prototype,"layerId",void 0),a([p({type:String,json:{write:!0}})],S.prototype,"layerName",void 0),S=a([I("esri.rest.support.IdentifyResult")],S);const Ne=S;async function Ve(t,e,i){const o=(e=Ae(e)).geometry?[e.geometry]:[],r=xe(t);return r.path+="/identify",ve(o).then(n=>{const s=_e(e,{geometry:n?.[0]}),d=Se({...r.query,f:"json",...s}),u=Fe(d,i);return de(r.path,u).then(Ge).then(l=>Te(l,e.sublayers))})}function Ge(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(i=>Ne.fromJSON(i)),e}function Ae(t){return t=q.from(t)}function Te(t,e){if(!e?.length)return t;const i=new Map;function o(r){i.set(r.id,r),r.sublayers&&r.sublayers.forEach(o)}e.forEach(o);for(const r of t.results)r.feature.sourceLayer=i.get(r.layerId);return t}const H=z();let _=null;function We(t,e){return e.type==="tile"||e.type==="map-image"}let O=class extends oe{constructor(t){super(t),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=ne(async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const t=e=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([ae(()=>this.highlightGraphics,"change",e=>t(e.added),{onListenerAdd:e=>t(e)})])}async fetchPopupFeaturesAtLocation(t,e){const{layerView:{layer:i,view:{scale:o}}}=this;if(!t)throw new A("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:i});const r=Me(i.sublayers,o,e);if(!r.length)return[];const n=await $e(i,r);if(!((i.capabilities?.operations?.supportsIdentify??!0)&&i.version>=10.5)&&!n)throw new A("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:i});return n?this._fetchPopupFeaturesUsingQueries(t,r,e):this._fetchPopupFeaturesUsingIdentify(t,r,e)}clearHighlights(){this.highlightGraphics?.removeAll()}highlight(t){const e=this.highlightGraphics;if(!t||!e)return H;let i=ge(t)?[t]:le.isCollection(t)?t.toArray():Array.isArray(t)?t:[];if(i=i?.filter(T),(i?.length??0)===0)return H;for(const o of i){const{sourceLayer:r}=o;r!=null&&"geometryType"in r&&r.geometryType==="point"&&(o.visible=!1)}return e.addMany(i),z(()=>e.removeMany(i??[]))}async _updateHighlightedFeaturesSymbols(t){const{layerView:{view:e},highlightGraphics:i,highlightGraphicUpdated:o}=this;if(i&&o)for(const r of t){const n=r.sourceLayer&&"renderer"in r.sourceLayer&&r.sourceLayer.renderer;r.sourceLayer&&"geometryType"in r.sourceLayer&&r.sourceLayer.geometryType==="point"&&n&&"getSymbolAsync"in n&&n.getSymbolAsync(r).then(async s=>{s||=new M;let d=null;const u="visualVariables"in n?n.visualVariables?.find(l=>l.type==="size"):void 0;u&&(_||(_=(await X(async()=>{const{getSize:l}=await import("./visualVariableUtils-D3kZJRyn-23qzp7zg.js");return{getSize:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)).getSize),d=_(u,r,{view:e.type,scale:e.scale,shape:s.type==="simple-marker"?s.style:null})),d||="width"in s&&"height"in s&&s.width!=null&&s.height!=null?Math.max(s.width,s.height):"size"in s?s.size:16,i.includes(r)&&(r.symbol=new M({style:"square",size:d,xoffset:"xoffset"in s?s.xoffset:0,yoffset:"yoffset"in s?s.yoffset:0}),o(r,"symbol"),r.visible=!0)})}}async _updateHighlightedFeaturesGeometries(t){const{layerView:{layer:e,view:i},highlightGraphics:o,highlightGraphicUpdated:r}=this;if(this._highlightGeometriesResolution=t,!r||!o?.length||!e.capabilities.operations.supportsQuery)return;const n=this._getTargetResolution(t),s=new Map;for(const l of o)if(!this._featuresResolutions.has(l)||this._featuresResolutions.get(l)>n){const y=l.sourceLayer;pe(s,y,()=>new Map).set(l.getObjectId(),l)}const d=Array.from(s,([l,y])=>{const c=l.createQuery();return c.objectIds=[...y.keys()],c.outFields=[l.objectIdField],c.returnGeometry=!0,c.maxAllowableOffset=n,c.outSpatialReference=i.spatialReference,l.queryFeatures(c)}),u=await Promise.all(d);if(!this.destroyed)for(const{features:l}of u)for(const y of l){const c=y.sourceLayer,m=s.get(c).get(y.getObjectId());m&&o.includes(m)&&(m.geometry=y.geometry,r(m,"geometry"),this._featuresResolutions.set(m,n))}}_getTargetResolution(t){const e=t*ue(this.layerView.view.spatialReference),i=e/16;return i<=10?0:t/e*i}async _fetchPopupFeaturesUsingIdentify(t,e,i){const o=await this._createIdentifyParameters(t,e,i);if(o==null)return[];const{results:r}=await Ve(this.layerView.layer.parsedUrl,o,i);return r.map(n=>n.feature)}async _createIdentifyParameters(t,e,i){const{floors:o,layer:r,timeExtent:n,view:{spatialReference:s,scale:d}}=this.layerView;if(!e.length)return null;await Promise.all(e.map(({sublayer:x})=>x.load(i).catch(()=>{})));const u=Math.min(ye("mapservice-popup-identify-max-tolerance"),r.allSublayers.reduce((x,f)=>f.renderer?$({renderer:f.renderer,pointerType:i?.pointerType}):x,2)),l=this.createFetchPopupFeaturesQueryGeometry(t,u),y=we(d,s),c=Math.round(l.width/y),m=new J({xmin:l.center.x-y*c,ymin:l.center.y-y*c,xmax:l.center.x+y*c,ymax:l.center.y+y*c,spatialReference:l.spatialReference});return new q({floors:o,gdbVersion:"gdbVersion"in r?r.gdbVersion:void 0,geometry:t,height:c,layerOption:"popup",mapExtent:m,returnGeometry:!0,spatialReference:s,sublayers:r.sublayers,timeExtent:n,tolerance:u,width:c})}async _fetchPopupFeaturesUsingQueries(t,e,i){const{layerView:{floors:o,timeExtent:r}}=this,n=e.map(async({sublayer:s,popupTemplate:d})=>{if(await s.load(i).catch(()=>{}),s.capabilities&&!s.capabilities.operations.supportsQuery)return[];const u=s.createQuery(),l=$({renderer:s.renderer,pointerType:i?.pointerType}),y=this.createFetchPopupFeaturesQueryGeometry(t,l),c=new Set,[m]=await Promise.all([Ee(s,d),s.renderer?.collectRequiredFields(c,s.fieldsIndex)]);L(i),ce(c,s.fieldsIndex,m);const x=Array.from(c).sort();u.geometry=y,u.outFields=x,u.timeExtent=r;const f=N(o,s);u.where=k(u.where,f);const F=this._getTargetResolution(y.width/l),w=await Le(d);L(i);const g=s.geometryType==="point"||w&&w.arcadeUtils.hasGeometryOperations(d);g||(u.maxAllowableOffset=F);let{features:b}=await s.queryFeatures(u,i);const j=g?0:F;b=await He(s,b,i);for(const E of b)this._featuresResolutions.set(E,j);return b});return(await Promise.allSettled(n)).reduce((s,d)=>d.status==="fulfilled"?[...s,...d.value]:s,[]).filter(T)}};function Me(t,e,i){const o=[];if(!t)return o;const r=n=>{const s=n.minScale===0||e<=n.minScale,d=n.maxScale===0||e>=n.maxScale;if(n.visible&&s&&d){if(n.sublayers)n.sublayers.forEach(r);else if(n.popupEnabled){const u=Re(n,{...i,defaultPopupTemplateEnabled:!1});u!=null&&o.unshift({sublayer:n,popupTemplate:u})}}};return t.map(r),o}function Le(t){return t.expressionInfos?.length||Array.isArray(t.content)&&t.content.some(e=>e.type==="expression")?he():Promise.resolve()}async function $e(t,e){if(t.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:i})=>i.load().then(()=>i.capabilities.operations.supportsQuery)))}catch{return!1}}async function He(t,e,i){const o=t.renderer;return o&&"defaultSymbol"in o&&!o.defaultSymbol&&(e=o.valueExpression?await Promise.all(e.map(r=>o.getSymbolAsync(r,i).then(n=>n?r:null))).then(r=>r.filter(n=>n!=null)):e.filter(r=>o.getSymbol(r)!=null)),e}a([p({constructOnly:!0})],O.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),a([p({constructOnly:!0})],O.prototype,"layerView",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphics",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphicUpdated",void 0),a([p({constructOnly:!0})],O.prototype,"updatingHandles",void 0),O=a([I("esri.views.layers.support.MapServiceLayerViewHelper")],O);export{O,We as _}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./visualVariableUtils-D3kZJRyn-tyrXoPjU.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js"])))=>i.map(i=>d[i]); +import{_ as X}from"./main-QGPoLsvl.js";import{v as a,S as p,af as Y,g as ee,ac as U,n as J,J as te,i as I,bi as Q,a0 as re,e as B,aO as ie,dJ as se,j as oe,bp as ne,ai as ae,o as A,ag as le,aq as T,a2 as z,e0 as M,an as pe,p as ue,K as ye,$ as L,e4 as ce,bV as k,dW as he,f as de,bK as fe,bM as me}from"./story-Doly9N9p.js";import{a8 as ge}from"./languageUtils-BYxF9hRA-DnySuvAL.js";import{f as we,c as be}from"./scaleUtils-DxsfQwK1-CzyfErWH.js";import{e as N}from"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import{y as $}from"./drapedUtils-BZ1SGPtE-bBUh2hex.js";import{B as ve}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{y as xe,n as Se,a as Fe}from"./utils-9sQxfkoa-D8FX0sO8.js";import{s as Oe}from"./sublayerUtils-CyM0QC5B-B1ryunQi.js";import{k as je}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import{h as Ee,m as Re}from"./popupUtils-nV1O8RUO-BYG2KoFf.js";function _e(t,e){const{dpi:i,gdbVersion:o,geometry:r,geometryPrecision:n,height:s,historicMoment:d,layerOption:u,mapExtent:l,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,spatialReference:F,timeExtent:w,tolerance:g,width:b}=t.toJSON(),{dynamicLayers:j,layerDefs:E,layerIds:V}=Pe(t),D=e?.geometry!=null?e.geometry:null,v={historicMoment:d,geometryPrecision:n,maxAllowableOffset:y,returnFieldName:c,returnGeometry:m,returnUnformattedValues:x,returnZ:f,tolerance:g},R=D?.toJSON()||r;v.imageDisplay=`${b},${s},${i}`,o&&(v.gdbVersion=o),R&&(delete R.spatialReference,v.geometry=JSON.stringify(R),v.geometryType=fe(R));const G=F??R?.spatialReference??l?.spatialReference;if(G&&(v.sr=me(G)),v.time=w?[w.start,w.end].join(","):null,l){const{xmin:Z,ymin:C,xmax:K,ymax:W}=l;v.mapExtent=`${Z},${C},${K},${W}`}return E&&(v.layerDefs=E),j&&!E&&(v.dynamicLayers=j),v.layers=u==="popup"?"visible":u,V&&!j&&(v.layers+=`:${V.join(",")}`),v}function Pe(t){const{mapExtent:e,floors:i,width:o,sublayers:r,layerIds:n,layerOption:s,gdbVersion:d}=t,u=r?.find(f=>f.layer!=null)?.layer?.serviceSublayers,l=s==="popup",y={},c=be({extent:e,width:o,spatialReference:e?.spatialReference}),m=[],x=f=>{const F=c===0,w=f.minScale===0||c<=f.minScale,g=f.maxScale===0||c>=f.maxScale;if(f.visible&&(F||w&&g))if(f.sublayers)f.sublayers.forEach(x);else{if(n?.includes(f.id)===!1||l&&(!f.popupTemplate||!f.popupEnabled))return;m.unshift(f)}};if(r?.forEach(x),r&&!m.length)y.layerIds=[];else{const f=Oe(m,u,d),F=m.map(w=>{const g=N(i,w);return w.toExportImageJSON(g)});if(f)y.dynamicLayers=JSON.stringify(F);else{if(r){let g=m.map(({id:b})=>b);n&&(g=g.filter(b=>n.includes(b))),y.layerIds=g}else n?.length&&(y.layerIds=n);const w=Ie(i,m);if(w!=null&&w.length){const g={};for(const b of w)b.definitionExpression&&(g[b.id]=b.definitionExpression);Object.keys(g).length&&(y.layerDefs=JSON.stringify(g))}}}return y}function Ie(t,e){const i=!!t?.length,o=e.filter(r=>r.definitionExpression!=null||i&&r.floorInfo!=null);return o.length?o.map(r=>{const n=N(t,r),s=k(n,r.definitionExpression);return{id:r.id,definitionExpression:s??void 0}}):null}var P;let h=P=class extends B{static from(t){return ie(P,t)}constructor(t){super(t),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.historicMoment=null,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}writeHistoricMoment(t,e){e.historicMoment=t&&t.getTime()}};a([p({type:Number,json:{write:!0}})],h.prototype,"dpi",void 0),a([p()],h.prototype,"floors",void 0),a([p({type:String,json:{write:!0}})],h.prototype,"gdbVersion",void 0),a([p({types:Y,json:{read:ee,write:!0}})],h.prototype,"geometry",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"geometryPrecision",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"height",void 0),a([p({type:Date})],h.prototype,"historicMoment",void 0),a([U("historicMoment")],h.prototype,"writeHistoricMoment",null),a([p({type:[Number],json:{write:!0}})],h.prototype,"layerIds",void 0),a([p({type:["top","visible","all","popup"],json:{write:!0}})],h.prototype,"layerOption",void 0),a([p({type:J,json:{write:!0}})],h.prototype,"mapExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"maxAllowableOffset",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnFieldName",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnGeometry",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnM",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnUnformattedValues",void 0),a([p({type:Boolean,json:{write:!0}})],h.prototype,"returnZ",void 0),a([p({type:te,json:{write:!0}})],h.prototype,"spatialReference",void 0),a([p()],h.prototype,"sublayers",void 0),a([p({type:je,json:{write:!0}})],h.prototype,"timeExtent",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"tolerance",void 0),a([p({type:Number,json:{write:!0}})],h.prototype,"width",void 0),h=P=a([I("esri.rest.support.IdentifyParameters")],h);const q=h;let S=class extends B{constructor(t){super(t),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(t,e){return Q.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(t,e){if(!t)return;const{attributes:i,geometry:o}=t;i&&(e.attributes={...i}),o!=null&&(e.geometry=o.toJSON(),e.geometryType=se.toJSON(o.type))}};a([p({type:String,json:{write:!0}})],S.prototype,"displayFieldName",void 0),a([p({type:Q})],S.prototype,"feature",void 0),a([re("feature",["attributes","geometry"])],S.prototype,"readFeature",null),a([U("feature")],S.prototype,"writeFeature",null),a([p({type:Number,json:{write:!0}})],S.prototype,"layerId",void 0),a([p({type:String,json:{write:!0}})],S.prototype,"layerName",void 0),S=a([I("esri.rest.support.IdentifyResult")],S);const Ne=S;async function Ve(t,e,i){const o=(e=Ae(e)).geometry?[e.geometry]:[],r=xe(t);return r.path+="/identify",ve(o).then(n=>{const s=_e(e,{geometry:n?.[0]}),d=Se({...r.query,f:"json",...s}),u=Fe(d,i);return de(r.path,u).then(Ge).then(l=>Te(l,e.sublayers))})}function Ge(t){const e=t.data;return e.results=e.results||[],e.exceededTransferLimit=!!e.exceededTransferLimit,e.results=e.results.map(i=>Ne.fromJSON(i)),e}function Ae(t){return t=q.from(t)}function Te(t,e){if(!e?.length)return t;const i=new Map;function o(r){i.set(r.id,r),r.sublayers&&r.sublayers.forEach(o)}e.forEach(o);for(const r of t.results)r.feature.sourceLayer=i.get(r.layerId);return t}const H=z();let _=null;function We(t,e){return e.type==="tile"||e.type==="map-image"}let O=class extends oe{constructor(t){super(t),this._featuresResolutions=new WeakMap,this.highlightGraphics=null,this.highlightGraphicUpdated=null,this.updateHighlightedFeatures=ne(async e=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(e).catch(()=>{}))})}initialize(){const t=e=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(e).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)};this.addHandles([ae(()=>this.highlightGraphics,"change",e=>t(e.added),{onListenerAdd:e=>t(e)})])}async fetchPopupFeaturesAtLocation(t,e){const{layerView:{layer:i,view:{scale:o}}}=this;if(!t)throw new A("fetchPopupFeatures:invalid-area","Nothing to fetch without area",{layer:i});const r=Me(i.sublayers,o,e);if(!r.length)return[];const n=await $e(i,r);if(!((i.capabilities?.operations?.supportsIdentify??!0)&&i.version>=10.5)&&!n)throw new A("fetchPopupFeatures:not-supported","query operation is disabled for this service",{layer:i});return n?this._fetchPopupFeaturesUsingQueries(t,r,e):this._fetchPopupFeaturesUsingIdentify(t,r,e)}clearHighlights(){this.highlightGraphics?.removeAll()}highlight(t){const e=this.highlightGraphics;if(!t||!e)return H;let i=ge(t)?[t]:le.isCollection(t)?t.toArray():Array.isArray(t)?t:[];if(i=i?.filter(T),(i?.length??0)===0)return H;for(const o of i){const{sourceLayer:r}=o;r!=null&&"geometryType"in r&&r.geometryType==="point"&&(o.visible=!1)}return e.addMany(i),z(()=>e.removeMany(i??[]))}async _updateHighlightedFeaturesSymbols(t){const{layerView:{view:e},highlightGraphics:i,highlightGraphicUpdated:o}=this;if(i&&o)for(const r of t){const n=r.sourceLayer&&"renderer"in r.sourceLayer&&r.sourceLayer.renderer;r.sourceLayer&&"geometryType"in r.sourceLayer&&r.sourceLayer.geometryType==="point"&&n&&"getSymbolAsync"in n&&n.getSymbolAsync(r).then(async s=>{s||=new M;let d=null;const u="visualVariables"in n?n.visualVariables?.find(l=>l.type==="size"):void 0;u&&(_||(_=(await X(async()=>{const{getSize:l}=await import("./visualVariableUtils-D3kZJRyn-tyrXoPjU.js");return{getSize:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)).getSize),d=_(u,r,{view:e.type,scale:e.scale,shape:s.type==="simple-marker"?s.style:null})),d||="width"in s&&"height"in s&&s.width!=null&&s.height!=null?Math.max(s.width,s.height):"size"in s?s.size:16,i.includes(r)&&(r.symbol=new M({style:"square",size:d,xoffset:"xoffset"in s?s.xoffset:0,yoffset:"yoffset"in s?s.yoffset:0}),o(r,"symbol"),r.visible=!0)})}}async _updateHighlightedFeaturesGeometries(t){const{layerView:{layer:e,view:i},highlightGraphics:o,highlightGraphicUpdated:r}=this;if(this._highlightGeometriesResolution=t,!r||!o?.length||!e.capabilities.operations.supportsQuery)return;const n=this._getTargetResolution(t),s=new Map;for(const l of o)if(!this._featuresResolutions.has(l)||this._featuresResolutions.get(l)>n){const y=l.sourceLayer;pe(s,y,()=>new Map).set(l.getObjectId(),l)}const d=Array.from(s,([l,y])=>{const c=l.createQuery();return c.objectIds=[...y.keys()],c.outFields=[l.objectIdField],c.returnGeometry=!0,c.maxAllowableOffset=n,c.outSpatialReference=i.spatialReference,l.queryFeatures(c)}),u=await Promise.all(d);if(!this.destroyed)for(const{features:l}of u)for(const y of l){const c=y.sourceLayer,m=s.get(c).get(y.getObjectId());m&&o.includes(m)&&(m.geometry=y.geometry,r(m,"geometry"),this._featuresResolutions.set(m,n))}}_getTargetResolution(t){const e=t*ue(this.layerView.view.spatialReference),i=e/16;return i<=10?0:t/e*i}async _fetchPopupFeaturesUsingIdentify(t,e,i){const o=await this._createIdentifyParameters(t,e,i);if(o==null)return[];const{results:r}=await Ve(this.layerView.layer.parsedUrl,o,i);return r.map(n=>n.feature)}async _createIdentifyParameters(t,e,i){const{floors:o,layer:r,timeExtent:n,view:{spatialReference:s,scale:d}}=this.layerView;if(!e.length)return null;await Promise.all(e.map(({sublayer:x})=>x.load(i).catch(()=>{})));const u=Math.min(ye("mapservice-popup-identify-max-tolerance"),r.allSublayers.reduce((x,f)=>f.renderer?$({renderer:f.renderer,pointerType:i?.pointerType}):x,2)),l=this.createFetchPopupFeaturesQueryGeometry(t,u),y=we(d,s),c=Math.round(l.width/y),m=new J({xmin:l.center.x-y*c,ymin:l.center.y-y*c,xmax:l.center.x+y*c,ymax:l.center.y+y*c,spatialReference:l.spatialReference});return new q({floors:o,gdbVersion:"gdbVersion"in r?r.gdbVersion:void 0,geometry:t,height:c,layerOption:"popup",mapExtent:m,returnGeometry:!0,spatialReference:s,sublayers:r.sublayers,timeExtent:n,tolerance:u,width:c})}async _fetchPopupFeaturesUsingQueries(t,e,i){const{layerView:{floors:o,timeExtent:r}}=this,n=e.map(async({sublayer:s,popupTemplate:d})=>{if(await s.load(i).catch(()=>{}),s.capabilities&&!s.capabilities.operations.supportsQuery)return[];const u=s.createQuery(),l=$({renderer:s.renderer,pointerType:i?.pointerType}),y=this.createFetchPopupFeaturesQueryGeometry(t,l),c=new Set,[m]=await Promise.all([Ee(s,d),s.renderer?.collectRequiredFields(c,s.fieldsIndex)]);L(i),ce(c,s.fieldsIndex,m);const x=Array.from(c).sort();u.geometry=y,u.outFields=x,u.timeExtent=r;const f=N(o,s);u.where=k(u.where,f);const F=this._getTargetResolution(y.width/l),w=await Le(d);L(i);const g=s.geometryType==="point"||w&&w.arcadeUtils.hasGeometryOperations(d);g||(u.maxAllowableOffset=F);let{features:b}=await s.queryFeatures(u,i);const j=g?0:F;b=await He(s,b,i);for(const E of b)this._featuresResolutions.set(E,j);return b});return(await Promise.allSettled(n)).reduce((s,d)=>d.status==="fulfilled"?[...s,...d.value]:s,[]).filter(T)}};function Me(t,e,i){const o=[];if(!t)return o;const r=n=>{const s=n.minScale===0||e<=n.minScale,d=n.maxScale===0||e>=n.maxScale;if(n.visible&&s&&d){if(n.sublayers)n.sublayers.forEach(r);else if(n.popupEnabled){const u=Re(n,{...i,defaultPopupTemplateEnabled:!1});u!=null&&o.unshift({sublayer:n,popupTemplate:u})}}};return t.map(r),o}function Le(t){return t.expressionInfos?.length||Array.isArray(t.content)&&t.content.some(e=>e.type==="expression")?he():Promise.resolve()}async function $e(t,e){if(t.capabilities?.operations?.supportsQuery)return!0;try{return await Promise.any(e.map(({sublayer:i})=>i.load().then(()=>i.capabilities.operations.supportsQuery)))}catch{return!1}}async function He(t,e,i){const o=t.renderer;return o&&"defaultSymbol"in o&&!o.defaultSymbol&&(e=o.valueExpression?await Promise.all(e.map(r=>o.getSymbolAsync(r,i).then(n=>n?r:null))).then(r=>r.filter(n=>n!=null)):e.filter(r=>o.getSymbol(r)!=null)),e}a([p({constructOnly:!0})],O.prototype,"createFetchPopupFeaturesQueryGeometry",void 0),a([p({constructOnly:!0})],O.prototype,"layerView",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphics",void 0),a([p({constructOnly:!0})],O.prototype,"highlightGraphicUpdated",void 0),a([p({constructOnly:!0})],O.prototype,"updatingHandles",void 0),O=a([I("esri.views.layers.support.MapServiceLayerViewHelper")],O);export{O,We as _}; diff --git a/custom-toc-highlight/assets/MapView-BGOJJ8ch-DcHA1w96.js b/custom-toc-highlight/assets/MapView-BGOJJ8ch-CJtpe3RS.js similarity index 94% rename from custom-toc-highlight/assets/MapView-BGOJJ8ch-DcHA1w96.js rename to custom-toc-highlight/assets/MapView-BGOJJ8ch-CJtpe3RS.js index 68b49d34..94346f87 100644 --- a/custom-toc-highlight/assets/MapView-BGOJJ8ch-DcHA1w96.js +++ b/custom-toc-highlight/assets/MapView-BGOJJ8ch-CJtpe3RS.js @@ -1,8 +1,8 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Popup-DFFZHG5j-DfLtnQ8W.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-BfX8CRfG.js","./story-D5JOvNzl.css","./substitute-j49H6mVR-CJn4Lavp.js","./themeUtils-YjM7iIiX-3_GiOEs2.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./ReactiveSet-QxEZenFW-DlICHtLT.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./Cyclical-C_9rKUUQ-Dl9v9oo8.js","./AttachmentInfo-D9RFO8W2-DYgfjXim.js","./RelationshipQuery-DJsz3K0U-yAwL-qLW.js","./Query-BrwMGK8U-DoFNfkjX.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./utils-DyydRFHu-BQ5pghrp.js","./Basemap-BEqqSTw9-B5O9ub1-.js","./loadAll-e978YItg-CdtGGDtb.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./writeUtils-D5qlLkwk-xd5TEmf9.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-DVqdGrVU.js","./common-CYWrYyJl-E8-sukrT.js","./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js","./utils-DPtQ14k3-CAwuJg76.js","./parser-DyDJ-rlI-C9jRH52J.js","./cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js","./utils-SPbpQbmm-B3hR8LxB.js","./enums-CpSG_SL3-BMD3Tb1v.js","./LRUCache-C3erQTWv-0wD6drRf.js","./jsonUtils-C64Zfu7c-CitE8NjK.js","./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js","./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js","./colorRamps-q0bZVhs2-DQZn2xZS.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-23qzp7zg.js","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./lengthUtils-DKpMe5qR-C2NPRwwl.js","./styleUtils-BtpNqZyT-D2Hj1Rgz.js","./Version-CoKzbupV-9-gg6ENz.js","./FieldsIndex-HmzMbJQG-DZuFWLvd.js","./UnknownTimeZone-C--TOcPG-D3CAoWPX.js","./OverrideHelper-DWRbVlj1-BZq72sbX.js","./colorUtils-Cthpxcks-ZRnr1H1b.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./quantizationUtils-bJy1cRwp-B-lEhyoX.js","./heatmapUtils-seiMkkkR-Cj1KmweL.js","./executeQueryJSON-CcHnccia-BW7_NQxl.js","./utils-9sQxfkoa-KicvrT8N.js","./query-DFW9-NG_-gbjlxRZk.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-Bq23Xwmj--_SaacS5.js","./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js","./pbf-D-y3_eZO-DQKnyfOm.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-B5UMbu5B.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./FeatureSet-BkVNthuN-CwS44--W.js","./shared-D1w-26bA-B8KlJvO_.js","./TimeOnly-DSMefxKy-BU7RNYWc.js","./FeatureLayer-BrRKw5Si-D6Z5CL70.js","./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js","./commonProperties-BtIqvFU_-DVH0kGN9.js","./ElevationInfo-yv2-9tj6-C2hC6Vpl.js","./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js","./HeightModelInfo-C5vFqzyF-CupKpfDx.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js","./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js","./Relationship-PyhUibYK-BgFx3_5x.js","./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js","./Layer-ChoECxvZ-CQTFmFQa.js","./workers-PiCjreoO-idkDTJa3.js","./editsZScale-BDsX6vv--CttUpViY.js","./APIKeyMixin-BUMSx9ny-D_H-H5sI.js","./ArcGISService-BYA-y6X6-C_YhndKK.js","./BlendLayer-D1WkSmwP-Bad8_eoW.js","./jsonUtils-wIllKWI4-DrGIvCCq.js","./CustomParametersMixin-vdKsTHer-BOFVTNLw.js","./EditBusLayer-Df29OyJh-DkVkxUAl.js","./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js","./FeatureEffect-CDEk9Es7-CEiHf7-6.js","./FeatureFilter-BCFHgLVU-CXZvxasm.js","./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js","./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js","./labelingInfo-DGVNul26-zkvIaBlq.js","./labelUtils-BW14kBqX-BkXd4VJn.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-9OHGXI1g.js","./OrderedLayer-6Qsmrd_l-BG3Yganz.js","./OrderByInfo-GD2XnU8e-NtCi3yT-.js","./PortalLayer-CElnYuSQ-DvpreqYV.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js","./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js","./TemporalLayer-CpOrN_w9-BDEJ3v2O.js","./TimeInfo-w_HB2CsF-CZutzBPZ.js","./FeatureTemplate-SPHPD45f-DFBQobBO.js","./FeatureType-C9hJmS6_-BXWT6QCe.js","./fieldProperties-Bq26w7gt-CFQbsGDX.js","./versionUtils-LZYZz-38-DxOZEoAg.js","./styleUtils-ChrJTYIw-BfDrXrWd.js","./popupUtils-B0uZcXX0-DtBp-byj.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./ReactiveMap-CFk6jPfN-Du1XE-2a.js","./Tile-D75RMC64-Dj1SOP3K.js","./TileKey-C5IL-JBr-CJMvJ-lJ.js","./vec2-tHZ6OaOy-xCj1obDt.js","./QueueProcessor-DbfV9fLy-CxiRQqTa.js","./signal-CETehA7D-DhpyJ8yp.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./layerViewUtils-DURAPenP-CfS78eqb.js","./CollectionFlattener-DkHuHn5E-BKutaakg.js","./TileInfo-CWIRDhZl-BkCC-9e9.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./UpdatingHandles-CUu3u1ms-CruZWJRY.js","./Map-1zd11DKO-D2wK6924.js","./TablesMixin-C8RojhYs-AdFcW_TR.js","./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DQCcMKpm.js","./vec32-D9GsKZ1t-BjayBdwt.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-hC4XzHg_.js","./imageUtils-BA2D6Uf1-DgLNtmEY.js","./capabilities-agoTWNzb-CtsNgRyk.js","./ColorBackground-gVZldRLm-C2pKGijH.js","./geometryServiceUtils-nsujb7BH-C2AslH-O.js","./project-DQKhruav-DBiiXhMD.js","./webglDeps-Bgavuh0h-CPBMgmjx.js","./BufferObject-BM_7mcDb-Dq7c9k7y.js","./Program-DLVwTiPA-C1hIaFuM.js","./NestedMap-Ddo7BfvO-BpVPk8mz.js","./ProgramTemplate-DQOm6Omy-Qewg1YCG.js","./VertexArrayObject-M4iRGGoi-THP-veuo.js","./mapViewDeps-CUVU8gUp-Ccomlwj9.js","./UpdateTracking2D-Du_WIf4G-CsaWDyks.js","./BidiEngine-Bdqv5H5j-Dyqh9XG-.js","./GeometryUtils-NHgB9gGQ-DrtZFKub.js","./Rect-DD6XS68q-D_hsV3ag.js","./LabelMetric-BeluzH3o-C3fDXNzp.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./BindType-9iOk18Ed-CRW1cdX4.js","./Util-BjGjeg6f-08Szkf4F.js","./FeatureCommandQueue-DzV-HBIG-BApspUo_.js","./constants-Bqe1QJ4u-F8oTIn7N.js","./WGLContainer-LxgEo4I_-C81rKEy3.js","./vec3f32-BS0cezmI-B_madU1n.js","./Container-BcuL1ZEG-DxXVQv25.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./config-nuMERBvb-MDUrh2eL.js","./earcut-XDcq3zAf-BcwyrT7l.js","./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js","./SDFHelper-B6k8Ig6R-BNeqNf2Z.js","./floatRGBA-4pIJN00G-BsIUaPaZ.js","./PieChartMeshWriter-C5yLDFwp-CqRHPq7x.js","./TurboLine-CIlsAy5m-Cxo-QeJ4.js","./enums-qHpGJ28Q-CmnLAccm.js","./GridShader-75bC4UUM-nIA27cle.js","./CircularArray-DaQg3PQl-BXS52LZy.js","./testSVGPremultipliedAlpha-DoZe_f0d-DBs2wvPw.js","./AttributeStore-DjyP9U7y-CD_qG3Wh.js","./timeSupport-jPViR5jn-GyoVmGVI.js","./queryUtils-Brxu6254-PPvpiP5X.js","./json-BI97KiBB-Ce5cWfI2.js","./RenderingContext-DbCVbtGZ-rMiiZHPo.js","./renderState-Dap0WV9P-D4IHxyei.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js","./rasterizingUtils-BmlDdKBf-CpGlbhM3.js","./utils-Dcs650Ic--a87iok1.js","./grouping-RwmXkHDc-Binxobs4.js","./MeshWriterRegistry-CIC9Yk_f-CqQZshM0.js","./GraphicsView2D-C4wYE2ut-DMrrhOCh.js","./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js","./GraphicContainer-DuOHUciE-sEoQdKXZ.js","./AGraphicContainer-LUCT6Gle-Dvv0TF4N.js","./TechniqueInstance-DGTKoOL6-ftnhwAAz.js","./TileContainer-D48pXXgL-CdMiwPkS.js","./requestImageUtils-Ut4YcoNU-BtID-_Ic.js","./scaleUtils-DxsfQwK1-D7ZZd5W4.js","./geodesicUtils-B8mFUfTk-DkviSp9u.js","./TileLayerView2D-CT-Yu10P-BdNTZA0Y.js","./imageUtils-Co-ELErj-Dh62T-vs.js","./Bitmap-CcqmzvfR-Bqft9oF3.js","./LayerView-Bish-E63-rB2WUWF4.js","./HighlightGraphicContainer-Dt5r6lMq-KuyTjNqc.js","./RefreshableLayerView-BdQpGYly-Bg8to7IY.js","./MapServiceLayerViewHelper-bw3M4B8s-2ec3v39J.js","./languageUtils-BYxF9hRA-BBstOXAc.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./number-eRKYXfX9-eI8aiR_7.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./drapedUtils-BZ1SGPtE-B2FavufJ.js","./sublayerUtils-CyM0QC5B-D9HVKWXR.js","./popupUtils-nV1O8RUO-DAL58cHP.js","./FeatureLayerView2D-NmRd_IhT-CufQiRFK.js","./timeSupport-ohWmWReZ-ByDHlqgT.js","./HighlightCounter-DFWq7PnG-L3ompOf4.js","./BaseDynamicLayerView2D-AQ-6l0DU-fdOF1reR.js","./BitmapContainer-BC8fvmFc-myTzpniv.js","./ExportStrategy-BNE7Gp0u-j76jQ8Ao.js","./CatalogLayerView2D-DaUVeBuS-ZiacRCRh.js","./CatalogDynamicGroupLayerView2D-Cf-H7gda-CFkeOMDr.js","./CatalogFootprintLayerView2D-C0bBWVdF-CeR3Mj-n.js","./GeoRSSLayerView2D-BLTYupUX-BfrBO27g.js","./GraphicsLayerView2D-CGXlTqHO-C-E0GBj7.js","./GroupLayerView2D-BR-kLeLa-BQ6LGY1P.js","./ImageryLayerView2D-CVDvTIGY-DlSiRq0n.js","./RasterVFDisplayObject-CnriTVT9-CjUrEqNq.js","./dataUtils-BkPy4R3C-Cb9EIxnj.js","./rasterProjectionHelper-Calp0o_1-DktPwJyi.js","./ImageryTileLayerView2D-nEz2YhMc-CG0NmUYm.js","./multidimensionalUtils-BwTugeu7-BTG9Of02.js","./rasterUtils-DqAu9qES-Du-esSHL.js","./RawBlockCache-Cj_tmHDm-CHpXSnmO.js","./KMLLayerView2D-hWgNYT5J-D43neN7r.js","./kmlUtils-C5oIEoOy-BsvzFJRs.js","./KnowledgeGraphLayerView2D-BnEbgXue-PzhwY4G0.js","./MapImageLayerView2D-LI7T-1xm-CBbeiZP3.js","./ExportImageParameters-DxyNGQ57-0etxSPmv.js","./MapNotesLayerView2D-EusnP8A_-vtvY-W3D.js","./MediaLayerView2D-COWFkA3m-_gATxPeF.js","./perspectiveUtils-Bu88xlbg-DGihQXe_.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./OverlayContainer-BEHcBpu0-DjERf_U-.js","./OGCFeatureLayerView2D-CpSy5D2s-nBaV6Pmc.js","./RouteLayerView2D-Bpui7Ggx-fxzuJ6ql.js","./Stop-he5xSAJJ-CGB43GGR.js","./StreamLayerView2D-Bh_aEalU-D-95GXg2.js","./SubtypeGroupLayerView2D-Byn0xzbb-Qz-0ZBbK.js","./VectorTileLayerView2D-B9OYHbL4-Ctr5GCiP.js","./PooledRBush-DbfAmeLn-B9Pkw5Ae.js","./SourceLayerData-BT_Ywuvg-DFNndgqY.js","./StyleRepository-D3WuVprR-SmpmvCua.js","./VideoLayerView2D-CLcxq4ZA-ZAPPyz9l.js","./GraphicsLayer-DfeGaYc1-BYhO2Zs8.js","./TelemetryDisplay-Bq2PXfI8-Z2CK355L.js","./WMSLayerView2D-Dz-z-fa9-B7OZ7TF_.js","./ExportWMSImageParameters-CMk80WSM-sFuOAfxa.js","./WMTSLayerView2D-Bl5FUDUu-DLQ4k-_a.js","./calcite-button-Cm9_TJei-By40tgvH.js","./form-CRSw616T-DZVFUlxN.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-BPt2o3jA.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-D4CSNQAA.js","./locale-Cn_GDVD_-Ar3RKmd3.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-BNRQivHR.js","./t9n-C_hcZMZJ-D4zmKT16.js","./icon-BXFbBbop-BUyrjp8g.js","./loader-Ch7Jr16w-DUAf9YhQ.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-Dn93dMQE.js"])))=>i.map(i=>d[i]); -import{_ as b}from"./main-ugzBrWNm.js";import{v as r,S as l,i as _,aa as js,e as cn,w as V,ab as bt,ac as ka,a0 as Ea,ad as Bt,ae as ke,af as Ca,g as Vn,K as z,I as hi,ag as L,ah as w,ai as ci,aj as Ia,ak as Ft,al as st,am as Da,an as Ra,ao as On,ap as La,aq as ni,j as M,ar as Pt,as as H,C as Va,at as Oa,au as qs,av as Ee,o as C,aw as pn,ax as ct,ay as dn,az as Aa,a1 as D,aA as tt,aB as An,aC as pi,aD as za,aE as Na,aF as Ce,n as Xt,J as si,aG as Bs,aH as un,aI as mn,aJ as Ks,p as Ys,aK as Fa,h as Ha,aL as U,aM as Za,a2 as di,aN as it,l as Xs,aO as Ga,aP as $a,b as ui,aQ as Wa,aR as bi,aS as Qs,aT as Ua,aU as Js,B as ja,aV as Re,aW as ji,x as qa,aX as Ba,t as to,aY as eo,aZ as de,$ as Ot,a_ as Ka,a$ as Ya,b0 as zn,b1 as Xa,b2 as Qa,b3 as Ja,b4 as tr,b5 as Nn,b6 as er,b7 as ir,b8 as nr,O as sr,b9 as Fn,ba as ze,L as or,bb as ar,bc as rr,bd as Hn,be as lr,bf as hr,E as Ti,bg as cr,d as io,bh as Ne,bi as pr,bj as gn,bk as dr,bl as Fe,bm as ur,bn as X}from"./story-BfX8CRfG.js";import{c as mr}from"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import{f as no}from"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import{F as gr,B as Zn}from"./workers-PiCjreoO-idkDTJa3.js";import{K as Le,B as yr,_ as yn,J as _n,W as fn}from"./projection-BA9M1R7d-BYoCXVXt.js";import{d as _r,V as fr}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import{z as vr,H as wr,_ as mi,o as Gn,K as so,q as br,R as gi,P as B,k as vn,X as Tr,V as $n}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{i as yi}from"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import{o as Mr}from"./signal-CETehA7D-DhpyJ8yp.js";import xr from"./Map-1zd11DKO-D2wK6924.js";import{o as oo,u as Wn,s as Pr}from"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import{M as wn}from"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import{k as Sr}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import{v as Mi}from"./TablesMixin-C8RojhYs-AdFcW_TR.js";import{h as kr}from"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import{b as Un}from"./Query-BrwMGK8U-DoFNfkjX.js";import{i as Er}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{l as jn}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{o as O,e as Cr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as N,v as _i,T as ao,i as qi,j as qn,A as Ir,S as Dr,h as Bn,b as Rr,L as Tt,d as Se,f as Lr,_ as Vr}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{r as ro,n as xi}from"./common-CYWrYyJl-E8-sukrT.js";import{s as Or,t as lo,Q as Ar,U as ho,l as zr,n as co,e as bn,i as oi,V as Nr,Z as Kn,k as Fr,o as Hr}from"./Tile-D75RMC64-Dj1SOP3K.js";import{c as Tn,a as Zr}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{Q as Gr,R as $r,C as Yn,D as Wr,E as Ur}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as Xn}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{r as jr,F as qr}from"./unitBezier-CGtWxaCq-BRwEDigF.js";import{W as Br,u as Pi}from"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import{s as Kr}from"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import{L as Yr}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{e as He,u as Xr,i as Qr,t as Qn}from"./definitions-DJSdSb77-DkoRHaVx.js";import{L as Jr,D as Si,G as tl}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as el,V as il}from"./Texture-BCt2hphT-hC4XzHg_.js";import{y as nl}from"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import{n as sl}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{m as ol}from"./Version-CoKzbupV-9-gg6ENz.js";import al from"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";let Ht=class extends $a{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return t!=null&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"row",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"column",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"rows",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"columns",void 0),Ht=r([_("esri.CameraLayout")],Ht);const po=Ht;let at=class extends js(cn){constructor(...t){super(...t),this.position=new V([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new po}normalizeCtorArgs(t,e,i,n){if(t&&typeof t=="object"&&("x"in t||Array.isArray(t))){const s={position:t};return e!=null&&(s.heading=e),i!=null&&(s.tilt=i),n!=null&&(s.fov=n),s}return t}writePosition(t,e,i,n){const s=t.clone();s.x=bt(t.x||0),s.y=bt(t.y||0),s.z=t.hasZ?bt(t.z||0):t.z,e[i]=s.write({},n)}readPosition(t,e){const i=new V;return i.read(t,e),i.x=bt(i.x||0),i.y=bt(i.y||0),i.z=i.hasZ?bt(i.z||0):i.z,i}equals(t){return t!=null&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};r([l({type:V,json:{write:{isRequired:!0}}})],at.prototype,"position",void 0),r([ka("position")],at.prototype,"writePosition",null),r([Ea("position")],at.prototype,"readPosition",null),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>mr.normalize(bt(t)))],at.prototype,"heading",void 0),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>ke(bt(t),-180,180))],at.prototype,"tilt",void 0),r([l({type:Number,nonNullable:!0,json:{default:55,write:!0}}),Bt(t=>ke(bt(t,55),1,170))],at.prototype,"fov",void 0),r([l({type:po,nonNullable:!0,json:{read:!1,write:!1}})],at.prototype,"layout",void 0),at=r([_("esri.Camera")],at);const rl=at;var Bi;let Et=Bi=class extends cn{constructor(t){super(t),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(t){return(t%=360)<0&&(t+=360),t}clone(){return new Bi({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"rotation",void 0),r([Bt("rotation")],Et.prototype,"castRotation",null),r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"scale",void 0),r([l({types:Ca,json:{read:Vn,write:!0,origins:{"web-scene":{read:Vn,write:{overridePolicy:ki}}}}})],Et.prototype,"targetGeometry",void 0),r([l({type:rl,json:{write:!0}})],Et.prototype,"camera",void 0),Et=Bi=r([_("esri.Viewpoint")],Et);const nt=Et;function ki(){return{enabled:!this.camera}}const Be={widthBreakpoint:{getValue(t){const e=t.viewSize[0],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.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(t){const e=t.viewSize[1],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.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(t){const e=t.viewSize,i=e[0],n=e[1],s=this.values;return n>=i?s.portrait:s.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},Ei={xsmall:544,small:768,medium:992,large:1200};function ll(t){const e=t;return e&&e.xsmall{let e=class extends t{constructor(...i){super(...i),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=Ei}initialize(){this.addHandles(w(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),U))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(i){if(i!==this._get("breakpoints")){if(!ll(i)){const n=JSON.stringify(Ei,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n),i=Ei}this._set("breakpoints",{...i})}}_updateClassNames(){if(!this.container)return;const i=ze.acquire(),n=ze.acquire();let s,o=!1;for(s in Be){const a=this[s],h=Be[s].getValue({viewSize:this.size,breakpoints:this.breakpoints});a!==h&&(o=!0,this[s]=h,Ci(s,a).forEach(c=>n.push(c)),Ci(s,h).forEach(c=>i.push(c)))}o&&(this._applyClassNameChanges(i,n),ze.release(i),ze.release(n))}_applyClassNameChanges(i,n){const s=this.container;s&&(n.forEach(o=>s.classList.remove(o)),i.forEach(o=>s.classList.add(o)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let n;for(n in Be)Ci(n,this[n]).forEach(s=>i.classList.remove(s))}};return r([l()],e.prototype,"breakpoints",null),r([l()],e.prototype,"orientation",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),r([l()],e.prototype,"heightBreakpoint",void 0),e=r([_("esri.views.BreakpointsOwner")],e),e};let Ct=class extends M{constructor(){super(...arguments),this.items=new L,this._watchUpdatingTracking=new yi,this._callbacks=new Map,this._projector=Gn(),this._hiddenProjector=Gn()}get needsRender(){return this.items.length>0}get updating(){return this._watchUpdatingTracking?.updating??!1}initialize(){const t=document.createElement("div");t.className="esri-overlay-surface",this._set("surface",t),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),t.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,e=>{for(const i of e.added){const n=()=>i.render();this._callbacks.set(i,n),this._projector.append(this.surface,n)}for(const i of e.removed){const n=this._projector.detach(this._callbacks.get(i));this.surface.removeChild(n.domNode),this._callbacks.delete(i)}})}addItem(t){this.items.add(t)}removeItem(t){this.items.remove(t)}destroy(){this.items.removeAll(),this._callbacks.forEach(t=>this._projector.detach(t)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(t){const e=this._hiddenSurface,i=this._hiddenProjector;let n;const s=()=>(n=t.render(),n);i.append(e,s),i.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n?.domNode){const a=n.domNode.getBoundingClientRect();o.left=a.left,o.top=a.top,o.right=a.right,o.bottom=a.bottom}for(i.detach(s);e.firstChild;)e.removeChild(e.firstChild);return o}overlaps(t,e){const i=this.computeBoundingRect(t),n=this.computeBoundingRect(e);return Math.max(i.left,n.left)<=Math.min(i.right,n.right)&&Math.max(i.top,n.top)<=Math.min(i.bottom,n.bottom)}get hasVisibleItems(){return this.items.some(t=>t.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(t,e){const i=!!e?.disableDecorations;if(!this.items.some(s=>s.visible&&!(i&&s.isDecoration)))return;const n=t.getContext("2d");n.save(),n.font=this._fontString(),this.items.forEach(s=>{i&&s.isDecoration||(n.save(),s.renderCanvas(n),n.restore())}),n.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};r([l({readOnly:!0})],Ct.prototype,"surface",void 0),r([l({readOnly:!0})],Ct.prototype,"items",void 0),r([l({readOnly:!0})],Ct.prototype,"needsRender",null),r([l({readOnly:!0})],Ct.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],Ct.prototype,"updating",null),Ct=r([_("esri.views.overlay.ViewOverlay")],Ct);const Jn=Ct,Ii=[0,0];function cl(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return Ii[0]=i.left+(e?.pageXOffset??0),Ii[1]=i.top+(e?.pageYOffset??0),Ii}function ts(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}function pl(t){const e=document.createElement("div");return t.appendChild(e),e}const me=16,Ze=750,dl=512,ul=2,ml=t=>{let e=class extends t{constructor(...i){super(...i),this._freqInfo={freq:me,time:Ze},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,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,this.addHandles([w(()=>this.cursor,n=>{const{surface:s}=this;s&&s.setAttribute("data-cursor",n)}),w(()=>this.navigating,n=>{const{surface:s}=this;s&&s.setAttribute("data-navigating",n.toString())})])}initialize(){this.addHandles([w(()=>this.ui,(i,n)=>this._handleUIChange(i,n),U),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=tt(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(i){const n=this._get("container"),s=so(i);if(s||typeof i!="string"||D.getLogger(this).error("#container",`element with id '${i}' not found`),n===s)return;if(this._stopMeasuring(),n&&(n.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(ts(this.root),this._set("root",null)),this.userContent&&($n(this.userContent,n),ts(this.userContent),this._set("userContent",null))),!s)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);s.classList.add("esri-view");const o=document.createElement("div");o.className="esri-view-user-storage",$n(s,o),s.appendChild(o),this._set("userContent",o);const a=document.createElement("div");a.className="esri-view-root",s.insertBefore(a,s.firstChild),this._set("root",a);const h=document.createElement("div");h.className="esri-view-surface",h.setAttribute("role","application"),h.tabIndex=0,a.appendChild(h),this._set("surface",h);const c=new Jn;a.appendChild(c.surface),this._set("overlay",c),this.addHandles(w(()=>c.needsRender,p=>{p&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=de({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=st(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",s),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}get size(){return[this.width,this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(i,n,s){const o=this.position;return i-=o?o[0]:0,n-=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}containerToPage(i,n,s){const o=this.position;return i+=o?o[0]:0,n+=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}_handleUIChange(i,n){this.removeHandles("ui"),n&&n!==i&&n.destroy(),i&&(i.view=this,this.addHandles(w(()=>this.root,s=>{i.container=s?pl(s):null},U),"ui")),this._set("ui",i)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=me,i.time=Ze,this.addHandles([or(window,"resize",()=>{i.freq=me,i.time=Ze}),de({prepare:n=>{const s=this._measure(),o=this._freqInfo;if(o.time+=n.deltaTime,s&&(o.freq=me,this._get("resizing")||this._set("resizing",!0)),o.time=dl&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,n=i?i.clientWidth:0,s=i?i.clientHeight:0;if(n===0||s===0)return this.suspended||this._set("suspended",!0),!1;const o=this.width,a=this.height;return n===o&&s===a?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",n),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:o,oldHeight:a,width:n,height:s}),!0)}_position(){const i=this.container,n=this.position,s=i&&cl(i);return!!s&&(!n||s[0]!==n[0]||s[1]!==n[1])&&(this._set("position",[s[0],s[1]]),!0)}forceDOMReadyCycle(){}};return r([l()],e.prototype,"container",null),r([l({readOnly:!0})],e.prototype,"focused",null),r([l({readOnly:!0})],e.prototype,"height",void 0),r([l()],e.prototype,"messagesCommon",void 0),r([l({type:Jn})],e.prototype,"overlay",void 0),r([l({readOnly:!0})],e.prototype,"position",void 0),r([l({readOnly:!0})],e.prototype,"resizing",void 0),r([l({readOnly:!0})],e.prototype,"root",void 0),r([l({value:null,readOnly:!0})],e.prototype,"size",null),r([l({readOnly:!0})],e.prototype,"surface",void 0),r([l({readOnly:!0})],e.prototype,"suspended",void 0),r([l()],e.prototype,"ui",void 0),r([l({readOnly:!0})],e.prototype,"userContent",void 0),r([l({readOnly:!0})],e.prototype,"width",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),e=r([_("esri.views.DOMContainer")],e),e},gl=z("mac")?"Meta":"Control",yl=new Set(["Alt","Control","Meta","Shift","Ctrl","Primary"]),_l=t=>yl.has(t);let fl=class{constructor(t,e=[]){this.eventType=t,this.keyModifiers=e}matches(t){if(t.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const e=t.modifiers;for(const i of this.keyModifiers)if(!e.has(i))return!1;return!0}},A=class{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 e=this._incoming[t];for(const i of e)this._incomingEventMatches.push(i.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||(t.setEventCallback(e=>this._handleEvent(e)),t.setUninstallCallback(()=>this._onUninstall()),this._manager=t)}onUninstall(){}registerIncoming(t,e,i){let n;typeof e=="function"?(i=e,n=[]):n=e||[];const s=typeof t=="string"?new fl(t,n):t,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=p=>{const d=this._incoming[p.match.eventType];if(d){const m=d.indexOf(p);d.splice(m,1),o(),this._manager&&this._manager.updateDependencies()}},h=new vl(s,i,{onPause:a,onRemove:a,onResume:p=>{const d=this._incoming[p.match.eventType];d&&!d.includes(p)&&(d.push(p),o(),this._manager&&this._manager.updateDependencies())}});let c=this._incoming[s.eventType];return c||(c=[],this._incoming[s.eventType]=c),c.push(h),o(),this._manager&&this._manager.updateDependencies(),h}registerOutgoing(t){if(this._outgoing[t])throw new Error("There is already a callback registered for this outgoing InputEvent: "+t);const e=new wl(t,{onEmit:(i,n,s,o)=>{this._manager?.emit(i.eventType,n,s,o)},onRemove:i=>{delete this._outgoing[i.eventType],this._manager?.updateDependencies()}});return this._outgoing[t]=e,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),e}startCapturingPointer(t){this._manager?.setPointerCapture(t,!0)}stopCapturingPointer(t){this._manager?.setPointerCapture(t,!1)}refreshHasPendingInputs(){this._manager?.refreshHasPendingInputs()}_onUninstall(){this._manager&&(this.onUninstall(),this._manager=null)}_handleEvent(t){const e=this._incoming[t.type];if(e){for(const i of e)if(i.match.matches(t)&&(i.callback?.(t),t.shouldStopPropagation()))break}}},vl=class{constructor(t,e,i){this.match=t,this._callback=e,this._handler=i}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},wl=class{constructor(t,e){this.eventType=t,this._removed=!1,this._handler=e}emit(t,e,i){this._removed||this._handler.onEmit(this,t,e,i)}remove(){this._removed=!0,this._handler.onRemove(this)}},bl=class extends A{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",e=>this._update(e.data))}_update(t){const e=t.native.pointerType==="touch"?"touch":"mouse",{x:i,y:n}=t;e===this._value&&this._x===i&&this._y===n||(this._value=e,this._x=i,this._y=n,this._onChange(e,i,n))}},Tl=class extends A{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=Mr(!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)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},Ml=class{constructor(t,e){this._owner=e,this._properties={},this._afterDispatchHandle=null;for(const i in t){const n=t[i],s=new ar(n,void 0,void 0,2,2);this._properties[i]={pool:s,acquired:[]}}this._afterDispatchHandle=rr(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const t in this._properties){const e=this._properties[t];for(const i of e.acquired)Hn(i)||e.pool.release(i);e.pool.destroy(),e.pool=null,e.acquired=null}this._properties=null,this._owner=null}get(t){const e=this._owner._get(t),i=this._properties[t];let n=i.pool.acquire();for(i.acquired.push(n);n===e;)i.acquired.push(n),n=i.pool.acquire();return n}_release(){for(const t in this._properties){const e=this._properties[t];let i=0;for(const n of e.acquired)Hn(n)?e.acquired[i++]=n:e.pool.release(n);e.acquired.length=i}}},Q=class extends M{constructor(t){super(t),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=gl,this._latestPointerType="mouse",this._propertiesPool=new Ml({latestPointerLocation:Sl},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const t=Object.keys(this._nameToGroup);for(const e of t)this.uninstallHandlers(e);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(t=>t.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(t,e,i=At.INTERNAL){if(this._nameToGroup[t]||e.length===0)return;const n={name:t,handlers:e.map(s=>({handler:s,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[t]=n;for(let s=n.handlers.length-1;s>=0;s--){const o=n.handlers[s];this._handlers.push(o),o.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(a,h,c,p,d)=>{this._emitInputEvent(o.priorityIndex+1,a,h,c,d,p)},setPointerCapture:(a,h)=>{this._setPointerCapture(n,o,a,h)},setEventCallback:a=>{o.eventCallback=a},setUninstallCallback:a=>{o.uninstallCallback=a},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(t){const e=this._nameToGroup[t];e?(e.handlers.forEach(i=>{i.removed=!0,i.uninstallCallback?.()}),delete this._nameToGroup[t],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):D.getLogger(this).error("There is no InputHandler group registered under the name `"+t+"`")}hasHandlers(t){return this._nameToGroup[t]!==void 0}isModifierKeyDown(t){return this._activeKeyModifiers.has(t)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const t=new Set,e=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const n=this._handlers[i];n.priorityIndex=i,this._handlersPriority.push(n)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const n=this._handlersPriority[i];n.priorityIndex=i;let s=n.handler.hasSideEffects;if(!s){for(const o of n.handler.outgoingEventTypes)if(t.has(o)){s=!0;break}}if(s)for(const o of n.handler.incomingEventMatches){t.add(o.eventType);for(const a of o.keyModifiers)_l(a)||e.add(a)}n.active=s}this._sourceEvents=t,this._keyModifiers=e,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(t,e,i){this._latestPointerType=t;const n=this._get("latestPointerLocation");if(n==null||n.x!==e||n.y!==i){const s=this._propertiesPool.get("latestPointerLocation");s.x=e,s.y=i,this._set("latestPointerLocation",s)}}_onEventReceived(t,e){if(t==="pointer-capture-lost"){const s=e;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(t,e);const i=this.test.timestamp!=null?this.test.timestamp:e.native?e.native.timestamp:void 0,n=e.native?e.native.cancelable:void 0;this._emitInputEventFromSource(t,e,i,n)}_updateKeyModifiers(t,e){if(!e)return;let i=!1;const n=()=>{i||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),i=!0)},s=(a,h)=>{h&&!this._activeKeyModifiers.has(a)?(n(),this._activeKeyModifiers.add(a)):!h&&this._activeKeyModifiers.has(a)&&(n(),this._activeKeyModifiers.delete(a))};if(t==="key-down"||t==="key-up"){const a=e.key;this._keyModifiers.has(a)&&s(a,t==="key-down")}const o=e.native;s("Alt",!!o?.altKey),s("Control",!!o?.ctrlKey),s("Ctrl",!!o?.ctrlKey),s("Shift",!!o?.shiftKey),s("Meta",!!o?.metaKey),s("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new bl((t,e,i)=>this._setLatestPointer(t,e,i)),this._multiTouchHandler=new Tl,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],At.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,At.INTERNAL)}_setPointerCapture(t,e,i,n){const s=t.name+"-"+e.priorityIndex,o=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,o),n?(o.add(s),o.size===1&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):o.has(s)&&(o.delete(s),o.size===0&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(t=>!t.removed),this.updateDependencies()}_emitInputEventFromSource(t,e,i,n){this._emitInputEvent(0,t,e,i,n)}_emitInputEvent(t,e,i,n,s,o){const a=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),h=s!==void 0&&s,c={event:new xl(e,i,a,o||this._activeKeyModifiers,h),priorityIndex:t};this._currentPropagation?this._currentPropagation.events.push(c):this._doNewPropagation(c)}_doNewPropagation(t){this._currentPropagation={events:new Zn,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:t.event.timestamp},this._currentPropagation.events.push(t),this._continuePropagation()}_continuePropagation(){this._paused=!1;const t=this._currentPropagation;if(t){for(;t.events.length>0;){const{event:e,priorityIndex:i}=t.events.pop(),n=e.data?.eventId;if(!(n!=null&&this._stoppedPropagationEventIds.has(n)))for(t.currentHandler=this._handlersPriority[i];t.currentHandler;){if(t.currentHandler.removed)t.needsHandlerGarbageCollect=!0;else{if(t.currentHandler.active&&!e.shouldStopPropagation()&&t.currentHandler.eventCallback?.(e),e.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(e.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:e,priorityIndex:t.currentHandler.priorityIndex+1})}t.currentHandler=this._handlersPriority[t.currentHandler.priorityIndex+1]}}t.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(t){const e=new Zn;e.push(t);const i=this._currentPropagation;if(i){for(;i.events.length;)e.push(i.events.pop());i.events=e,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(t,e){if(t.handler.hasSideEffects!==e.handler.hasSideEffects)return t.handler.hasSideEffects?1:-1;if(t.groupPriority!==e.groupPriority)return t.groupPriority>e.groupPriority?-1:1;for(const i of t.handler.incomingEventMatches)for(const n of e.handler.incomingEventMatches){if(i.eventType!==n.eventType)continue;const s=i.keyModifiers.filter(o=>n.keyModifiers.includes(o));if(s.length===i.keyModifiers.length!=(s.length===n.keyModifiers.length))return i.keyModifiers.length>n.keyModifiers.length?-1:1}return t.priorityIndex>e.priorityIndex?-1:1}_sortHandlersPriority(t){const e=[];for(const i of t){let n=0;for(;n=0;)n++;e.splice(n,0,i)}return e}get debug(){const t=e=>{const i=this._setPointerCapture;this._setPointerCapture=()=>{},e(),this._setPointerCapture=i};return{injectEvent:(e,i)=>{t(()=>this._onEventReceived(e,i))},disablePointerCapture:t}}};r([l({readOnly:!0})],Q.prototype,"hasPendingInputs",null),r([l({constructOnly:!0})],Q.prototype,"eventSource",void 0),r([l({constructOnly:!0})],Q.prototype,"recognizers",void 0),r([l()],Q.prototype,"_latestPointerType",void 0),r([l()],Q.prototype,"latestPointerType",null),r([l()],Q.prototype,"multiTouchActive",null),r([l({readOnly:!0})],Q.prototype,"latestPointerLocation",void 0),r([l()],Q.prototype,"_paused",void 0),r([l({readOnly:!0})],Q.prototype,"updating",null),Q=r([_("esri.views.input.InputManager")],Q);let xl=class{constructor(t,e,i,n,s){this.type=t,this.data=e,this.timestamp=i,this.modifiers=n,this.cancelable=s,this._propagationState=Vt.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=Vt.STOPPED}shouldStopPropagation(){return!!(this._propagationState&Vt.STOPPED)}async(t){this._propagationState|=Vt.PAUSED;const e=(i,n)=>{this._propagationState&=~Vt.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw i;return i};return(typeof t=="function"?t():t).then(i=>e(i,!1),i=>e(i,!0))}shouldPausePropagation(t){return!!(this._propagationState&Vt.PAUSED)&&(this._resumeCallback=t,!0)}preventDefault(){this.data.native.preventDefault()}};var Vt;(function(t){t[t.NONE=0]="NONE",t[t.STOPPED=1]="STOPPED",t[t.PAUSED=2]="PAUSED"})(Vt||(Vt={}));const At={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let Pl=class{};const Sl=Pl;function kt(t){return t!=null&&"open"in t&&"declaredClass"in t}function es(t){return t!=null&&"declaredClass"in t&&"dockOptions"in t}const kl=t=>{let e=class extends t{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([w(()=>[this.ui,this.popup],([i,n],s)=>{const o="popup",a="manual";if(s){const[h,c]=s;h&&kt(c)&&(c.view=null,es(c)&&h.remove(c,o))}i&&kt(n)&&(n.view=this,es(n)&&i.add(n,{key:o,position:a,internal:!0}))},U),this.on("click",i=>{this.popup&&this.popupEnabled&&(i.pointerType!=="mouse"||i.button===0)&&(kt(this.popup)?this.popup.viewModel.handleViewClick(i):i.async(async()=>{await this.setupPopup(),kt(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(i)}))},At.WIDGET)]),pn(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{b(()=>import("./Popup-DFFZHG5j-DfLtnQ8W.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138]),import.meta.url)})}destroy(){this.destroyed||this.closePopup()}async openPopup(i){if(kt(this.popup))return this.popup.open(i);try{if(await this.setupPopup(),!this.popup)return void D.getLogger(this).error(new C("view:null-popup","Popup is null and can't be opened"));this.popup.open(i)}catch{}}closePopup(){this._popupSetupTask?.abort(),kt(this.popup)&&this.popup.close()}async fetchPopupFeatures(i,n){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(i,n),n)}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!kt(this.popup))return this._popupSetupTask=dn(async i=>{const{default:n}=await b(()=>import("./Popup-DFFZHG5j-DfLtnQ8W.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138]),import.meta.url);if(Ot(i),!this.popup||kt(this.popup))return;const s=this.popup;delete s.open,delete s.close,this.popup=new n(s)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:i,hits:n},s){const o=[],a=[];let h=!1;const c=lr(s,z("popup-view-fetch-timeout")??Cl),p=u=>{const g=new El(u);return a.push(g),o.push(g.promise),g},d=u=>{const g=a.at(-1);return g&&g.layerView===u&&!h?g:p(u)};for(const u of n)"graphic"in u?(d(u.layerView).graphics.push(u.graphic),h=!1):(o.push(u.layerView.fetchPopupFeaturesAtLocation(u.mapPoint,c)),h=!0);a.map(u=>u.resolve(c));const m=hr(o).then(u=>u.filter(g=>!!g).flat());return{pendingFeatures:o,allGraphicsPromise:m,location:i}}async _getPopupHits(i,n){const{hits:s,location:o}=await this.popupHitTest(i);Ot(n);const a=[];for(const h of s)if("graphic"in h){if(this._isValidPopupGraphic(h.graphic,n)){const c=this._isValidPopupGraphicsLayerView(h.layerView)?h.layerView:void 0;a.push({graphic:h.graphic,layerView:c})}}else this._isValidPopupLocationLayerView(h.layerView)&&a.push({mapPoint:h.mapPoint,layerView:h.layerView});return{hits:a,location:o}}_isValidPopupGraphic(i,n){return i&&!!i.getEffectivePopupTemplate(n?.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(i){return!i||(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesFromGraphics"in i}_isValidPopupLocationLayerView(i){return(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesAtLocation"in i}};return r([l()],e.prototype,"popup",void 0),r([l()],e.prototype,"popupEnabled",void 0),e=r([_("esri.views.PopupView")],e),e};let El=class{constructor(t){this.layerView=t,this._resolver=ui(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(t){const{layerView:e,graphics:i,_resolver:n}=this;if(!e)return n.resolve(i),n.promise;let s;return e.fetchPopupFeaturesFromGraphics(i,t).catch(o=>(s=o,null)).then(o=>{o?n.resolve(o):n.reject(s)}),n.promise}};const Cl=5e3;let ai=class extends Pr{constructor(t){super(t),this.addHandles(this.on("before-add",e=>{e.item!=null&&e.item.parent===this.owner&&(D.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),e.preventDefault())}))}_own(t){t.parent=this.owner}_release(t){t.parent=null}};ai=r([_("esri.support.AnalysesCollection")],ai);let It=class extends M{constructor(t){super(t),this.view=null,this.baseLayerViews=new L,this.referenceLayerViews=new L,this._loadingHandle=w(()=>this.view?.map?.basemap,e=>{e&&e.load().catch(()=>{})},U)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const t of this.baseLayerViews)t.destroy();this.baseLayerViews.length=0;for(const t of this.referenceLayerViews)t.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){if(this.view?.suspended)return!1;const t=this.view?.map?.basemap;return!!t&&!!t.loaded&&(this.baseLayerViews.some(e=>e.updating)||this.referenceLayerViews.some(e=>e.updating))}};r([l({constructOnly:!0})],It.prototype,"view",void 0),r([l({readOnly:!0})],It.prototype,"baseLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"referenceLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"suspended",null),r([l({type:Boolean,readOnly:!0})],It.prototype,"updating",null),It=r([_("esri.views.BasemapView")],It);const Il=It;function Dl(t){return"tryRecycleWith"in t}function Rl(t){return t!=null&&typeof t=="object"&&"layerViews"in t}let Ll=class{constructor(t,e,i){this.layer=t,this.view=e,this.layerViewImporter=i,this._controller=new AbortController,this._deferred=ui(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,Ti(this._controller.signal,()=>{const n=new C("cancelled:layerview-create","layerview creation cancelled",{layer:t});this._deferred.reject(n)})}tryRecycle(t){if(!this.done||!this.layerView||!Dl(this.layerView))return null;const e=this.layer.type,i=this._controller.signal;for(let n=0;n(Ot(this._controller.signal),s.emit("layerview-destroy",{view:h,layerView:a}),h.emit("layerview-destroy",{view:h,layerView:a}),s.emit("layerview-create",{view:h,layerView:a}),h.emit("layerview-create",{view:h,layerView:a}),a)),new Promise((c,p)=>Ti(this._controller.signal,()=>p(Qs())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:t}=this;if(t){const{layer:e,view:i}=this;e.emit("layerview-destroy",{view:i,layerView:t}),i.emit("layerview-destroy",{layer:e,layerView:t})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:t},layer:e,view:i}=this;this._map=i.map;try{let n,s;if(await e.load({signal:t}),e.prefetchResources&&await e.prefetchResources({signal:t}),Ol(e))n=await e.createLayerView(i,{signal:t});else{if(!this.layerViewImporter.hasLayerViewModule(e))throw new C("layer:view-not-supported","No layerview implementation was found");const a=await this.layerViewImporter.importLayerView(e);Ot(t),n="default"in a?new a.default({layer:e,view:i}):new a({layer:e,view:i})}const o=()=>{s=st(s),n.destroyed||n.destroy(),n.layer=null,n.parent=null,n.view=null,this.done=!0};s=Ti(t,o),Ot(t);try{await n.when()}catch(a){throw o(),a}if(!this._map?.allLayers?.includes(e))return o(),void this._deferred.reject(new C("view:no-layerview-for-layer","The layer has been removed from the map",{layer:e}));this.layerView=n,e.emit("layerview-create",{view:i,layerView:n}),i.emit("layerview-create",{layer:e,layerView:n}),this.done=!0,this._deferred.resolve(n)}catch(n){e.emit("layerview-create-error",{view:i,error:n}),i.emit("layerview-create-error",{layer:e,error:n}),this.done=!0,this._deferred.reject(new C("layerview:create-error","layerview creation failed",{layer:e,error:n}))}}},J=class extends M{constructor(t){super(t),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new yi,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const i of e)this.layerViewImporter.hasLayerViewModule(i)&&this.layerViewImporter.importLayerView(i)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=ui(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(Wa(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const e=this.view.map;if(this._map!==e&&(this.clear(),this._map=e),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const i=new Set,n=[],s=this.view.ready,o=h=>{if(h!=null){for(const c of h)if(c){i.add(c);const p=this._layerLayerViewInfoMap.get(c);p&&s?p.start():p||this._recyclingInfoMap.has(c)||n.push(c),"layers"in c&&c.layers&&o(c.layers)}}};for(const h of this._rootCollectionNames)o(bi(this,h));for(const[h,c]of this._layerLayerViewInfoMap)if(!i.has(h)){this._layerLayerViewInfoMap.delete(c.layer);const p=c.tryRecycle(n);p?(this.notifyChange("updating"),this._recyclingInfoMap.set(c.layer,c),p.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),this._layerLayerViewInfoMap.set(c.layer,c),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy(),this._reschedule()})):c.destroy()}for(const[h,c]of this._recyclingInfoMap)i.has(h)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy());for(const h of n)this._createLayerView(h);this._refreshCollections();const a=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.referenceLayers,e?.layers].filter(h=>!!h);i.forEach(h=>"layers"in h&&a.push(h.layers)),this.addHandles(a.map(h=>this._watchUpdatingTracking.addOnCollectionChange(()=>h,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([ci(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),w(()=>{const t=this.view,e=t?.map;return[e?.basemap,e?.ground,e?.layers,t?.ready]},()=>this._reschedule(),ct)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),Mi(this._recyclingInfoMap),Mi(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(Qs()),this._workPromise=null)}get _layersToLayerViews(){const t=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&t.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(t)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||Ua(this._layerLayerViewInfoMap,t=>!t.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let t=0;for(const e of this._layerLayerViewInfoMap.values())e.done||++t;return t}clear(){this.destroyed||(Mi(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(t){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(t)){if(this._recyclingInfoMap.has(t))return this._recyclingInfoMap.get(t).promise;throw new C("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:t})}return this._layerLayerViewInfoMap.get(t).promise}isCreatingLayerViewsForLayer(t,e){this.commitProperty("updatingRemaining");const i=this._layerLayerViewInfoMap.get(t);if(!i?.done)return!0;const n=i.layerView;return!(!n||!e||n.parent===e)||!!(i.done&&n&&"layers"in t&&t.layers?.length)&&t.layers.some(s=>this.isCreatingLayerViewsForLayer(s,n))}_refreshCollections(){for(const[t,e]of this._layersToLayerViews)this._populateLayerViewsOwners(bi(this,t),bi(this,e),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(t,e,i){if(!t||!e)return void(e&&e.removeAll());let n=0;for(const s of t){const o=this._layerLayerViewInfoMap.get(s);if(!o?.layerView)continue;const a=o.layerView;a.layer=s,a.parent=i,e.at(n)!==a&&e.splice(n,0,a),"layers"in s&&Rl(a)&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),n+=1}n{}),this.layerViewImporter.hasLayerViewModule(t)&&this.layerViewImporter.importLayerView(t);const e=new Ll(t,this.view,this.layerViewImporter);e.promise.then(()=>this._refreshCollections(),i=>{i&&(Js(i)||i.name==="cancelled:layerview-create")||D.getLogger(this).error(`Failed to create layerview for layer title:'${t.title??"no title"}', id:'${t.id??"no id"}' of type '${t.type}'.`,{layer:t,error:i}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(t,e),this.view.ready&&e.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};r([l()],J.prototype,"_workPromise",void 0),r([l({readOnly:!0})],J.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],J.prototype,"_layersToLayerViews",null),r([l({readOnly:!0})],J.prototype,"_rootCollectionNames",null),r([l()],J.prototype,"layerViewImporter",void 0),r([l()],J.prototype,"supportsGround",void 0),r([l({readOnly:!0})],J.prototype,"updating",null),r([l({readOnly:!0})],J.prototype,"updatingRemaining",null),r([l({constructOnly:!0})],J.prototype,"view",void 0),J=r([_("esri.views.LayerViewManager")],J);const Vl=J;function Ol(t){return"createLayerView"in t&&t.createLayerView!=null}let Y=class extends M{constructor(t){super(t),this.factor=1.5,this.offset=H(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}};r([l({type:Number})],Y.prototype,"factor",void 0),r([l({nonNullable:!0})],Y.prototype,"offset",void 0),r([l()],Y.prototype,"position",void 0),r([l({type:Number,range:{min:0}})],Y.prototype,"size",void 0),r([l()],Y.prototype,"maskUrl",void 0),r([l()],Y.prototype,"maskEnabled",void 0),r([l()],Y.prototype,"overlayUrl",void 0),r([l()],Y.prototype,"overlayEnabled",void 0),r([l({readOnly:!0})],Y.prototype,"version",null),r([l({type:Boolean})],Y.prototype,"visible",void 0),Y=r([_("esri.views.Magnifier")],Y);const uo=Y;function Ge(t){return!!(t!=null&&typeof t=="object"&&"createQuery"in t&&t.createQuery&&"on"in t&&t.on)}let yt=class extends hi.EventedAccessor{constructor(t){super(t),this._selectionMap=new kr,this._sources=new L,this._trashCan=[],this._layerEditHandles=new L,this._vizTaskId=0,this.showHighlight=!0}initialize(){this.addHandles([w(()=>[this.view,this.showHighlight],()=>this._refreshVisualization()),ci(()=>this.sources,"change",e=>{const i=this._selectionMap;for(const n of e.removed)i.delete(n);this._refreshListeners(),this._refreshVisualization()},{onListenerAdd:()=>this._refreshListeners()})]);const t=new L;this.view.when().then(()=>{this.view.map&&(this.view.map.allLayers.flatten(e=>"sublayers"in e&&e.sublayers?e.sublayers:null).forEach(e=>{(Ge(e)&&!Ia(e)||Ft(e))&&t.add(e)}),this.sources=t)})}destroy(){this._layerEditHandles.drain(st)}get selections(){return Array.from(this._selectionMap.entries()).map(t=>{const[e,i]=t;return{layer:e,selection:[...i.selection]}})}get count(){let t=0;for(const e of this._selectionMap.values())t+=e.selection.length;return t}get hasSelection(){return this.count>0}get sources(){return this._sources}set sources(t){Da(t,this._sources)}async getSelectedFeatures(t,e={},i="layerView"){const{view:n,selections:s}=this,o=(t!==void 0?s.filter(a=>t.includes(a.layer)):s).filter(a=>a.selection.length>0).map(async a=>{const{layer:h,selection:c}=a,p=Ft(h)?h.parent:h;if(p==null||!ns(p))return null;if(i==="layer")return ss(p,c,e);if(is(p))return null;const d=await n.whenLayerView(p).catch(()=>null);return d?ss(d,c,e):null});return(await Promise.all(o)).filter(a=>a!=null)}updateSelection(t){const e=new Map;for(const[s,o]of this._selectionMap)e.set(s,[...o.selection]);let i=!1;const n=t.current.concat(t.added);for(const s of n){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=Ra(e,o,()=>[]);h.includes(a)||(h.push(a),i=!0)}}for(const s of t.removed){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=e.get(o),c=h?.indexOf(a);c!==void 0&&c>=0&&(h?.splice(c,1),i=!0)}}if(i){const{_selectionMap:s,_trashCan:o}=this,a=[];for(const[h,c]of e){const p=s.get(h);p!==void 0&&o.push(p),s.set(h,{selection:c}),a.push({layer:h,selection:c,...On(p!==void 0?p.selection:[],c)})}this._onSelectionChange(a)}}setSelection(t,e){this._setSelection(t,e)}getSelection(t){return this._selectionMap.get(t)?.selection}appendToSelection(t,e){const i=this._selectionMap.get(t),n=i!==void 0?[...i.selection]:[];for(const s of e)n.includes(s)||n.push(s);this._setSelection(t,n)}removeFromSelection(t,e){const i=this._selectionMap.get(t);if(!i)return;const n=[];for(const s of i.selection)e.includes(s)||n.push(s);this._setSelection(t,n)}toggleInSelection(t,e){const i=this._selectionMap.get(t);if(!i||i.selection.length===0)return void this._setSelection(t,e);const n=new Set(i.selection),s=new Set(e),o=La(n,s);this._setSelection(t,Array.from(o))}clear(){const t=this._selectionMap.values();this._trashCan.push(...t);const e=[];for(const[i,n]of this._selectionMap.entries())e.push({layer:i,added:[],removed:[...n.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(e)}_onSelectionChange(t){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:t})}_refreshVisualization(){if(this.view==null||this.sources==null)return;for(this._vizTaskId++;this._trashCan.length>0;)this._trashCan.pop()?.highlightHandle?.remove();const{sources:t,view:e,_selectionMap:i,showHighlight:n}=this,s=this._vizTaskId;for(const o of t){const a=i.get(o),h=Ft(o)?o.parent:o;if(h!=null&&ns(h)){if(is(h))continue;e.whenLayerView(h).then(c=>{a?.highlightHandle?.remove(),a!=null&&n&&s===this._vizTaskId&&"highlight"in c&&typeof c.highlight=="function"&&a.selection.length>0&&(a.highlightHandle=c.highlight(a.selection,"selection"))}).catch(()=>{a?.highlightHandle?.remove()})}}}_refreshListeners(){this._layerEditHandles.drain(st);for(const t of this.sources){const e=Ft(t)?t.parent:t;if(e!=null&&Ge(e)){const i=e.on("edits",n=>{this._handleEditChanges(n,t)});this._layerEditHandles.push(i)}}}_handleEditChanges(t,e){if(t.deletedFeatures!==void 0&&t.deletedFeatures.length>0&&this._selectionMap.has(e)){const i=t.deletedFeatures.filter(n=>n.error==null).map(n=>n.objectId).filter(ni);this.removeFromSelection(e,i)}}_setSelection(t,e){if(!this.sources.includes(t))throw new Error(`Cannot set selection on layer ${t.title} because it is not in 'sources'`);const i=this._selectionMap.get(t);if(i===void 0||!zl(i,{selection:e})){i!==void 0&&this._trashCan.push(i),this._selectionMap.set(t,{selection:[...e]});const n={layer:t,selection:[...e],...On(i!==void 0?i.selection:[],e)};this._onSelectionChange([n])}}};r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"selections",null),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"count",null),r([l({constructOnly:!0,nonNullable:!0})],yt.prototype,"view",void 0),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"hasSelection",null),r([l()],yt.prototype,"showHighlight",void 0),r([l()],yt.prototype,"sources",null),yt=r([_("esri.views.SelectionManager")],yt);const is=t=>Ft(t)?t.parent?.isTable===!0:t.isTable,Al=t=>t.layer!==void 0,ns=t=>t?.when!==void 0,zl=(t,e)=>{if(t==null&&e==null)return!0;if(t!=null&&e==null||t==null&&e!=null)return!1;if(t!=null&&e!=null&&t.selection!=null&&e.selection!=null){const i=[...t.selection],n=[...e.selection];if(i.length!==n.length)return!1;i.sort(),n.sort();for(let s=0;s{let n;if(Al(t)){const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:t.layer}))}else{const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:s}))}return n},Nl=yt;let ve=class extends js(M){constructor(t){super(t),this.accentColor=new Pt([255,127,0]),this.textColor=new Pt([255,255,255])}};r([l({type:Pt,nonNullable:!0})],ve.prototype,"accentColor",void 0),r([l({type:Pt,nonNullable:!0})],ve.prototype,"textColor",void 0),ve=r([_("esri.views.Theme")],ve);const Ki=ve;var os;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right"})(os||(os={}));const mo=["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"],go={};function yo(t){return!!go[t]}function Fl(t){for(const e of t)if(!yo(e))return!1;return!0}mo.forEach(t=>{go[t]=!0});let Hl=class{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:e,priority:i},n)=>this.inputManager?.installHandlers(n,[e],i))}disconnect(){this.inputManager&&this._handlers.forEach((t,e)=>this.inputManager?.uninstallHandlers(e)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(t,e,i,n){const s=Array.isArray(t)?t:t.split(",");if(!Fl(s))return s.some(yo)&&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(e)?a=e:(o=e,a=[]),typeof i=="function"?o=i:n=i,n=n??At.DEFAULT;const h=this._createUniqueGroupName(),c=new Zl(this.view,s,a,o);this._handlers.set(h,{handler:c,priority:n});for(const p of s){const d=this._handlerCounts.get(p)||0;this._handlerCounts.set(p,d+1)}return this.inputManager&&this.inputManager.installHandlers(h,[c],n),di(()=>this._removeHandler(h,s))}hasHandler(t){return!!this._handlerCounts.get(t)}_removeHandler(t,e){if(this._handlers.has(t)){this._handlers.delete(t);for(const i of e){const n=this._handlerCounts.get(i);n===void 0||(n===1?this._handlerCounts.delete(i):this._handlerCounts.set(i,n-1))}}this.inputManager&&this.inputManager.uninstallHandlers(t)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},Zl=class extends A{constructor(t,e,i,n){super(!0),this._latestDragStart=void 0,this.view=t;for(const s of e)switch(s){case"click":this.registerIncoming("click",i,o=>n(Wl(t,o)));break;case"double-click":this.registerIncoming("double-click",i,o=>n(Ul(t,o)));break;case"immediate-click":this.registerIncoming("immediate-click",i,o=>n(jl(t,o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",i,o=>n(ql(t,o)));break;case"hold":this.registerIncoming("hold",i,o=>n(Bl(t,o)));break;case"drag":this.registerIncoming("drag",i,o=>{const a=this._wrapDrag(o);a&&n(a)});break;case"key-down":this.registerIncoming("key-down",i,o=>n(Kl(o)));break;case"key-up":this.registerIncoming("key-up",i,o=>n(Yl(o)));break;case"pointer-down":this.registerIncoming("pointer-down",i,o=>n(ge(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",i,o=>n(ge(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",i,o=>n(ge(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",i,o=>n(Xl(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",i,o=>n(Ql(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",i,o=>n(ge(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",i,o=>n(ge(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",i,o=>{n(Jl(o))});break;case"focus":this.registerIncoming("focus",i,o=>{n(Gl(o))});break;case"blur":this.registerIncoming("blur",i,o=>{n($l(o))})}}_wrapDrag(t){const e=t.data,{x:i,y:n}=e.center,{action:s,pointerType:o,button:a}=e;if(s==="start"&&(this._latestDragStart=e),!this._latestDragStart)return;const h=e.pointer.native,c=e.buttons,{cancelable:p,timestamp:d}=t,m={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return s==="end"&&(this._latestDragStart=void 0),{type:"drag",action:s,x:i,y:n,origin:m,pointerType:o,button:a,buttons:c,radius:e.radius,angle:ja(e.angle),native:h,timestamp:d,cancelable:p,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}};function Gl(t){return{type:"focus",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function $l(t){return{type:"blur",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function Wl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,screenPoint:H(o,a),mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function Ul(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"double-click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function jl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function ql(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-double-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function Bl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h}=e.data,{cancelable:c,timestamp:p}=e;return{type:"hold",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:p,mapPoint:Ve(t,o,a),cancelable:c,stopPropagation:()=>e.stopPropagation(),async:d=>e.async(d),preventDefault:()=>e.preventDefault()}}function Ve(t,e,i){return t.toMap(H(e,i),{exclude:[]})}function Kl(t){const{key:e,repeat:i,native:n}=t.data,{cancelable:s,timestamp:o}=t;return{type:"key-down",key:e,repeat:i,native:n,timestamp:o,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:a=>t.async(a),preventDefault:()=>t.preventDefault()}}function Yl(t){const{key:e,native:i}=t.data,{cancelable:n,timestamp:s}=t;return{type:"key-up",key:e,native:i,timestamp:s,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:o=>t.async(o),preventDefault:()=>t.preventDefault()}}function ge(t,e){const{x:i,y:n,button:s,buttons:o,native:a,eventId:h}=t.data,c=a.pointerId,p=a.pointerType,{cancelable:d,timestamp:m}=t;return{type:e,x:i,y:n,pointerId:c,pointerType:p,button:s,buttons:o,native:a,timestamp:m,eventId:h,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}function Xl(t){const{x:e,y:i,buttons:n,native:s,eventId:o}=t.data.currentEvent,{button:a}=t.data.startEvent,h=t.data.startEvent.native.pointerId,c=t.data.startEvent.native.pointerType,p=t.data.action,d={x:t.data.startEvent.x,y:t.data.startEvent.y},{cancelable:m,timestamp:u}=t;return{type:"pointer-drag",x:e,y:i,pointerId:h,pointerType:c,button:a,buttons:n,action:p,origin:d,native:s,timestamp:u,eventId:o,cancelable:m,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}function Ql(t){const{cancelable:e,data:i,timestamp:n}=t,{x:s,y:o,deltaY:a,native:h}=i;return{type:"mouse-wheel",x:s,y:o,deltaY:a,native:h,timestamp:n,cancelable:e,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}function Jl(t){const{action:e,state:i,device:n}=t.data,{cancelable:s,timestamp:o}=t,{buttons:a,axes:h}=i;return{type:"gamepad",device:n,timestamp:o,action:e,buttons:a,axes:h,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}var Ie,as,rs;(function(t){t[t.USER=0]="USER",t[t.MANAGER=1]="MANAGER"})(Ie||(Ie={})),function(t){t[t.None=0]="None",t[t.Unfocused=1]="Unfocused",t[t.Focused=2]="Focused",t[t.Unselected=4]="Unselected",t[t.Selected=8]="Selected",t[t.All=15]="All"}(as||(as={})),function(t){t[t.None=0]="None",t[t.Custom1=16]="Custom1",t[t.Custom2=32]="Custom2",t[t.Custom3=64]="Custom3",t[t.Custom4=128]="Custom4",t[t.Custom5=256]="Custom5",t[t.Custom6=512]="Custom6",t[t.Custom7=1024]="Custom7",t[t.Custom8=2048]="Custom8",t[t.Custom9=4096]="Custom9",t[t.Custom10=8192]="Custom10",t[t.Custom11=16384]="Custom11",t[t.Custom12=32768]="Custom12",t[t.All=65520]="All"}(rs||(rs={}));function th(t){return[t.on("before-add",e=>{const i=e.item;if(i==null||t.includes(i))return D.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void e.preventDefault();i.onAdd()}),t.on("after-remove",e=>{const i=e.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function Yi(t){return t.visible&&t.getEditableFlag!=null&&t.getEditableFlag(Ie.USER)&&t.getEditableFlag(Ie.MANAGER)}function rt(t){return H(t.x,t.y)}function _o(t,e){const i=(t instanceof HTMLElement?t:t.surface)?.getBoundingClientRect();return i?H(e.clientX-i.left,e.clientY-i.top):H(0,0)}function fo(t,e){return e instanceof Event?_o(t,e):rt(e)}function vo(t){if(t instanceof Event)return!0;if(typeof t=="object"&&"type"in t)switch(t.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}let eh=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._externallyDragging=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(t,e){const i=()=>t.stopPropagation();switch(t.type){case"pointer-move":hs(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:t.action==="start"?this._externallyDragging=!0:t.action==="end"&&(this._externallyDragging=!1),this._stopDrag&&(i(),t.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!cs(t))break;const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(s==null)break;const o=s.manipulator,a=s.tool;o==null||a==null||!o.interactive||o.grabbable&&o.grabbableForEvent(t)||!o.grabbing||o.dragging||this._releaseManipulatorBeforeDragging(o,t,e),o!=null&&a!=null&&o.interactive&&o.grabbable&&o.grabbableForEvent(t)&&!o.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:o,tool:a,start:n,pointerType:t.pointerType}),this._grabbedManipulators.size===1&&e.activeTool==null&&(this._revertToNullActiveTool=!0,e.setActiveTool(s.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:n}),i());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,e);break;case"pointer-drag":{if(!cs(t))break;const n=this._grabbedManipulators.get(t.pointerId),s=n?.manipulator,o=n?.tool;if(s==null||o==null)break;const a=rt(t);a.x=ke(a.x,0,e.view.width),a.y=ke(a.y,0,e.view.height);const h=n.start,c=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":t.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,c?s.events.emit("drag",{action:"update",start:h,screenPoint:a}):s.events.emit("drag",{action:"start",start:h,screenPoint:a,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:o,manipulator:s,start:h}));break;case"end":s.dragging=!1,c&&s.events.emit("drag",{action:"end",start:h,screenPoint:a}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,e)}i();break}case"immediate-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(ih(t)||e.forEachTool(c=>{if((s==null||s.tool!==c||c.automaticManipulatorSelection)&&c.manipulators){let p=!1;c.manipulators.forEach(({manipulator:d})=>{d.selected&&(d.selected=!1,p=!0)}),p&&c.onManipulatorSelectionChanged&&c.onManipulatorSelectionChanged()}}),s==null)break;const{manipulator:o,tool:a}=s;if(!o.interactive)break;o.selectable&&a.automaticManipulatorSelection&&(o.selected=!o.selected,a.onManipulatorSelectionChanged&&a.onManipulatorSelectionChanged());const h=t.native.shiftKey;o.events.emit("immediate-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:h,stopPropagation:i}),Di(o,i);break}case"click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s?.manipulator;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit(t.type,{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a}),i();break}case"double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),Di(o,i);break}case"immediate-double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),t.pointerType==="mouse"&&Di(o,i);break}}this._onFocusChange(e.forEachTool)}_releaseManipulatorBeforeDragging(t,e,i){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:rt(e)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===t&&this._grabbedManipulators.delete(s)}),this._afterManipulatorRelease(i.setActiveTool)}_handlePointerEnd(t,e){const i=this._grabbedManipulators.get(t.pointerId)?.manipulator;i!=null&&i.grabbing&&(i.grabbing=!1,i.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:rt(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorRelease(e.setActiveTool))}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=ls(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=ls(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(t){const e=new Set,i=new Set;this._grabbedManipulators.forEach(({tool:n})=>{e.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{i.add(n)}),t(n=>{n.hasGrabbedManipulators=e.has(n),n.hasHoveredManipulators=i.has(n);const s=this._grabbedManipulators.values(),o=cr(s,({tool:a})=>a===n);n.firstGrabbedManipulator=o!=null?o.manipulator:null})}clearPointers(t,{forEachTool:e,setActiveTool:i},n=!0,s){const o=(a,h)=>a===t&&(s==null||s===h);this._grabbedManipulators.forEach(({tool:a,manipulator:h,pointerType:c},p)=>{o(a,h)&&(this._grabbedManipulators.delete(p),h.grabbing=!1,h.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:c}))}),this._draggedManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._draggedManipulators.delete(c),h.dragging=!1,h.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._hoveredManipulators.delete(c),h.hovering=!1)}),this._afterManipulatorRelease(i),this._onFocusChange(e)}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach((e,i)=>{this._updateHoveredStateForPointerAtScreenPosition(H(e.x,e.y),i,e.pointerType,t)})}handleHoverEvent(t,e){const i=t.type;i!=="pointer-up"&&i!=="immediate-click"&&i!=="pointer-move"||!hs(t.pointerType)||(i!=="pointer-up"&&this._externallyDragging?this._clearHoveredManipulatorStates(t.pointerId):this._updateHoveredStateForPointerAtScreenPosition(rt(t),t.pointerId,t.pointerType,e))}_updateHoveredStateForPointerAtScreenPosition(t,e,i,n){let s=te(t,i,n);const o=this._hoveredManipulators.get(e)?.manipulator;s==null||s.manipulator.interactive||(s=null),s!=null&&o===s.manipulator||(o!=null&&(o.hovering=!1),s!=null?(s.manipulator.hovering=!0,this._hoveredManipulators.set(e,s)):this._hoveredManipulators.delete(e),this._onFocusChange(n))}_afterManipulatorRelease(t){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}_clearHoveredManipulatorStates(t){this._hoveredManipulators.forEach(({manipulator:e},i)=>{t===i&&(this._hoveredManipulators.delete(t),e.hovering=!1)})}};function ls(t){for(const{manipulator:e}of t.values())if(e!=null&&e.interactive){if(e.grabbing&&e.grabCursor)return e.grabCursor;if(e.cursor)return e.cursor}return null}function te(t,e,i){let n=null;return i(s=>{if(s.manipulators==null||!Yi(s))return!1;const o=s.manipulators.intersect(t,e);return o!=null&&(n={tool:s,manipulator:o},!0)}),n}function hs(t){return t==="mouse"}function cs(t){return t.pointerType!=="mouse"||t.button===0}function ih(t){return!!t.native.shiftKey}function Di(t,e){t?.consumesClicks&&e()}const ps="attached",Ri="tools",nh=1e3;let lt=class extends M{constructor(t){super(t),this._updatingHandles=new yi,this._clock=Re,this._manipulatorState=new eh,this.tools=new L,this.cursor=null,this._interacting=!1,this._interactingTimeout=nh,this._interactingTimeoutHandle=null,this._forEachTool=e=>{for(const i of this.tools.items)if(e(i))return}}initialize(){this.addHandles([this.view.on(mo,t=>{this._handleInputEvent(t)},At.TOOL),...th(this.tools),this.tools.on("before-add",({item:t})=>{this._updateToolEditableFlag(t)}),this.tools.on("before-remove",({item:t})=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.activeTool=null,this.tools.drain(t=>t.destroy()),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:t=>{this.activeTool=t},view:this.view}}set activeTool(t){if(t!=null&&!this.view.ready)return void D.getLogger(this).error("Cannot set active tool while view is not ready.");if(t===this.activeTool)return;const e=this.activeTool;this._set("activeTool",t),e?.deactivate(),t?.activate(),this._removeIncompleteTools(t);for(const i of this.tools){this._updateToolEditableFlag(i);const n=Yi(i);this.activeTool!=null&&n||this._manipulatorState.clearPointers(i,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some(t=>t.updating)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=st(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout(()=>this._interacting=!1,this._interactingTimeout)}attach(){this.view.type==="3d"?this.addHandles([w(()=>{const{state:t}=this.view;return"camera"in t&&t.camera},()=>this._forEachManipulator(t=>t.onViewChange())),this.view.elevationProvider?.on("elevation-change",t=>this._forEachManipulator(e=>e.onElevationChange(t)))],ps):this.addHandles(w(()=>this.view.extent,()=>this._forEachManipulator(t=>t.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(ps),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(t){this._forEachTool(e=>{e.manipulators&&e.manipulators.forEach(({manipulator:i})=>t(i,e))})}_handleInputEvent(t){let e=!1;const i={...t,stopPropagation:()=>{e=!0,t.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(i):this._forEachTool(n=>{!e&&n.visible&&n.handleInputEvent(i)}),!e&&t.type==="key-down"&&t.key==="Escape"&&this.activeTool&&(t.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(i,this._manipulatorStateEventArgs),e||this.activeTool==null||this.activeTool.handleInputEventAfter(i),this._manipulatorState.handleHoverEvent(i,this._forEachTool),this._updateCursor(),t.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(Ri),this._forEachTool(t=>{if(t instanceof M){const e=w(()=>[t.cursor,t.visible,t.editable],()=>{Yi(t)||this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()});this.addHandles(e,Ri)}t.manipulators&&this.addHandles([t.manipulators.on("after-remove",e=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs,!0,e.item.manipulator)}),t.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],Ri)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(t){t.setEditableFlag?.(Ie.MANAGER,this.activeTool==null||t===this.activeTool)}_updateCursor(){let t=this._manipulatorState.cursor;t==null&&this._forEachTool(e=>!(e.cursor==null||!e.visible)&&(t=e.cursor,!0)),this._get("cursor")!==t&&this._set("cursor",t)}_removeIncompleteTools(t){this.tools.filter(e=>(t==null||e!==t)&&!e.created&&e.removeIncompleteOnCancel).forEach(e=>{this.tools.remove(e)})}get test(){}};r([l({constructOnly:!0,nonNullable:!0})],lt.prototype,"view",void 0),r([l({value:null})],lt.prototype,"activeTool",null),r([l({readOnly:!0,type:L})],lt.prototype,"tools",void 0),r([l({readOnly:!0})],lt.prototype,"cursor",void 0),r([l({readOnly:!0})],lt.prototype,"updating",null),r([l()],lt.prototype,"_interacting",void 0),r([l({readOnly:!0})],lt.prototype,"interacting",null),lt=r([_("esri.views.ToolViewManager")],lt);let se=class extends M{constructor(t){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",t.mapping==="standard"?this._detectedDeviceType="standard":sh.test(t.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=t.index}get native(){const t=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndexVa.respectPrefersReducedMotion&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;let Dt=class extends M{constructor(t){super(t),this.enabled=!0,this.device=null,this.mode="pan",this.tiltDirection="forward-down",this.velocityFactor=1}};r([l({type:Boolean,nonNullable:!0})],Dt.prototype,"enabled",void 0),r([l({type:Mn})],Dt.prototype,"device",void 0),r([l({type:["pan","zoom"],nonNullable:!0})],Dt.prototype,"mode",void 0),r([l({type:["forward-down","forward-up"],nonNullable:!0})],Dt.prototype,"tiltDirection",void 0),r([l({type:Number,nonNullable:!0})],Dt.prototype,"velocityFactor",void 0),Dt=r([_("esri.views.navigation.gamepad.GamepadSettings")],Dt);const bo=Dt;let Zt=class extends M{constructor(t){super(t),this.browserTouchPanEnabled=!0,this.gamepad=new bo,this.momentumEnabled=!0,this.mouseWheelZoomEnabled=!0}get effectiveMomentumEnabled(){return this.momentumEnabled&&!wo()}};r([l({type:Boolean})],Zt.prototype,"browserTouchPanEnabled",void 0),r([l({type:bo,nonNullable:!0})],Zt.prototype,"gamepad",void 0),r([l({type:Boolean})],Zt.prototype,"momentumEnabled",void 0),r([l({type:Boolean})],Zt.prototype,"mouseWheelZoomEnabled",void 0),Zt=r([_("esri.views.navigation.Navigation")],Zt);const To=Zt;var ds;function lh(t){if(t.type==="integrated-mesh-3dtiles")return null;const e=t.url?Er(t.url):void 0;return!(t.spatialReference?.vcsWkid==null&&e!=null&&e.serverType==="ImageServer")&&Mo(t)&&t.heightModelInfo?t.heightModelInfo:hh(t)?wn.deriveUnitFromSR(ph,t.spatialReference):null}function Mo(t){return"heightModelInfo"in t}function xo(t){if(t.type==="unknown"||!("capabilities"in t))return!1;switch(t.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"subtype-group":case"ogc-feature":case"oriented-imagery":case"wfs":case"knowledge-graph-sublayer":return!0;default:return!1}}function hh(t){return xo(t)?!!(t.capabilities&&t.capabilities.data&&t.capabilities.data.supportsZ):Po(t)}function ch(t){return t.layers!=null||Po(t)||xo(t)||Mo(t)}function Po(t){switch(t.type){case"building-scene":case"elevation":case"integrated-mesh":case"integrated-mesh-3dtiles":case"point-cloud":case"scene":case"voxel":return!0;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"catalog":case"catalog-footprint":case"catalog-dynamic-group":case"csv":case"dimension":case"geojson":case"feature":case"focusArea":case"subtype-group":case"geo-rss":case"graphics":case"group":case"imagery":case"imagery-tile":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-image":case"map-notes":case"media":case"ogc-feature":case"open-street-map":case"oriented-imagery":case"parquet":case"route":case"stream":case"tile":case"unknown":case"unsupported":case"vector-tile":case"video":case"viewshed":case"wcs":case"web-tile":case"wfs":case"wms":case"wmts":case null:return!1}return!1}(function(t){t[t.Ok=0]="Ok",t[t.Units=1]="Units",t[t.HeightModel=2]="HeightModel",t[t.CRS=3]="CRS",t[t.Unsupported=4]="Unsupported"})(ds||(ds={}));const ph=new wn({heightModel:"gravity-related-height"});let Xi,Li=null;async function dh(t){Li||(Li=b(()=>import("./geometryServiceUtils-nsujb7BH-C2AslH-O.js"),__vite__mapDeps([139,3,1,2,4,140,51,55]),import.meta.url).then(e=>Xi=e)),await Li,Ot(t)}async function So(t,e,i,n){if(!t)return null;const s=t.spatialReference;return yn()||_n(s,e)?Le(t,e):Xi?Xi.projectGeometry(t,e,i,n):(await Promise.race([dh(n),fn(n)]),So(t,e,i,n))}let P=class extends M{constructor(t){super(t),this.required={extent:!1,heightModelInfo:!1,tileInfo:!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=ji(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 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 this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const t=this.map?.(),e=[];return this.priorityCollection!=null&&e.push(this.priorityCollection),e.push({parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers},{parent:t?.ground,layers:t?.ground?.layers},{parent:t?.basemap,layers:t?.basemap?.referenceLayers}),e}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};let t;if(this._collectLayers(this.mapCollections,i=>{const n=this._getSupportedSpatialReferences(i);if(n.length>0){const s=this._narrowDownSpatialReferenceCandidates(t,n);s!=null&&(t=s)}return t?.length===1})&&t?.length!==1)return{updating:!0};const e=this._pickSpatialReferenceCandidate(t);return{spatialReference:e?.spatialReference??null,viewingMode:e?.viewingMode??null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};const t=this.map?.(),e=this.spatialReference;if(!e)return{updating:this._spatialReferenceTask.updating};let i;const n=this._collectLayers([{parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers}],s=>!(!("tileInfo"in s)||!s.tileInfo?.spatialReference.equals(e))&&(i=s,!0),s=>"tileInfo"in s);return i?{tileInfo:i.tileInfo,updating:!1}:{updating:n}}get _heightModelInfoTask(){if(!this.required.heightModelInfo||this.suspended&&this._get("_heightModelInfoTask")?.heightModelInfo)return this._get("_heightModelInfoTask")??{updating:!1};let t={};const e=this._collectLayers(this.mapCollections,i=>{const n=lh(i);return!!n&&(t={heightModelInfo:n,vcsWkid:i.spatialReference?.vcsWkid,latestVcsWkid:i.spatialReference?.latestVcsWkid},!0)},i=>ch(i));return{...t,updating:e}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const t=[],e=this._collectLayers(this.mapCollections,i=>{const n="fullExtents"in i&&i.fullExtents||(i.fullExtent!=null?[i.fullExtent]:[]),s=this.requiresExtentInSpatialReference?null:n[0],o=n.find(a=>a.spatialReference.equals(this.spatialReference))??s;if(o)return t.push({extent:o,layer:i}),!0;if(this._getSupportedSpatialReferences(i).length>0)for(const a of n)t.push({extent:a,layer:i});return!1});return{candidates:t,updating:e}}get _extentTask(){const{candidates:t,updating:e}=this._extentCandidatesTask;if(e)return{updating:e};if(t==null||t.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(t),n=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&n.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=ji(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:n.clone(),task:dn(async s=>{try{const o=await So(i.extent,n,"portalItem"in i.layer?i.layer.portalItem:void 0,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(qa(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(t,e){if(t==null)return e;const i=new Array;for(const n of t)for(const s of e){if(!n.spatialReference.equals(s.spatialReference))continue;const o=mh(n.viewingMode,s.viewingMode);if(o!==!1){i.push({spatialReference:n.spatialReference,viewingMode:o});break}}return i.length>0?i:null}_pickSpatialReferenceCandidate(t){const e=this.defaultSpatialReference;return t==null||t.length<1?e?{spatialReference:e,viewingMode:null}:null:(e!=null&&t.length>1&&t.some(({spatialReference:i})=>i.equals(e))&&(t=t.filter(({spatialReference:i})=>i.equals(e))),t.length>1&&t.some(({viewingMode:i})=>i!==jn.Local)&&(t=t.filter(({viewingMode:i})=>i!==jn.Local)),t[0])}_getSupportedSpatialReferences(t){const e="supportedSpatialReferences"in t&&t.supportedSpatialReferences||(t.spatialReference?[t.spatialReference]:[]);if(e.length===0)return[];const i=[];for(const n of e){const s=this.getSpatialReferenceSupport(n,t);if(s!=null){const o=s.constraints??[{spatialReference:n,viewingMode:null}];for(const{spatialReference:a,viewingMode:h}of o)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!a.equals(this.userSpatialReference)||i.push({spatialReference:a,viewingMode:h})}}return i}_pickExtentCandidate(t){const e=this.spatialReference;return t.find(({extent:i})=>e.equals(i.spatialReference))||t[0]}_collectLayers(t,e,i=()=>!0){if(this._loadMaybe(this.map?.())!=="loaded")return!0;const n=new uh(i,e);for(const s of t)if(this._collectCollection(s,n),n.done||n.preloading===this.sourcePreloadCount)break;return n.updating}_collectCollection(t,e){if(t.layers){switch(this._loadMaybe(t.parent)){case"loading":return e.updating=!0,void++e.preloading;case"failed":return}for(const i of t.layers)if(e.layerFilter(i)){switch(this._loadMaybe(i)){case"failed":continue;case"loading":e.updating=!0,++e.preloading;break;case"loaded":if(e.updating||(e.done=e.pushLayer(i)),e.done||e.preloading===this.sourcePreloadCount)break;"layers"in i&&this._collectCollection({layers:i.layers},e)}if(e.done||e.preloading===this.sourcePreloadCount)break}}}_loadMaybe(t){return t&&"loadStatus"in t&&t.loadStatus!=null?t.loadStatus==="not-loaded"?(t.load().catch(e=>{Js(e)}),"loading"):t.loadStatus:"loaded"}};r([l()],P.prototype,"required",void 0),r([l({constructOnly:!0})],P.prototype,"map",void 0),r([l({constructOnly:!0})],P.prototype,"getSpatialReferenceSupport",void 0),r([l()],P.prototype,"defaultSpatialReference",void 0),r([l()],P.prototype,"userSpatialReference",void 0),r([l()],P.prototype,"sourcePreloadCount",void 0),r([l()],P.prototype,"priorityCollection",void 0),r([l()],P.prototype,"requiresExtentInSpatialReference",void 0),r([l()],P.prototype,"suspended",void 0),r([l({readOnly:!0})],P.prototype,"ready",null),r([l({readOnly:!0})],P.prototype,"heightModelInfoReady",null),r([l({readOnly:!0})],P.prototype,"spatialReference",null),r([l({readOnly:!0})],P.prototype,"extent",null),r([l({readOnly:!0})],P.prototype,"heightModelInfo",null),r([l({readOnly:!0})],P.prototype,"vcsWkid",null),r([l({readOnly:!0})],P.prototype,"latestVcsWkid",null),r([l({readOnly:!0})],P.prototype,"viewingMode",null),r([l({readOnly:!0})],P.prototype,"tileInfo",null),r([l({readOnly:!0})],P.prototype,"mapCollections",null),r([l({readOnly:!0})],P.prototype,"_spatialReferenceTask",null),r([l({readOnly:!0})],P.prototype,"_tileInfoTask",null),r([l({readOnly:!0})],P.prototype,"_heightModelInfoTask",null),r([l({readOnly:!0})],P.prototype,"_extentCandidatesTask",null),r([l()],P.prototype,"_extentTask",null),r([l()],P.prototype,"_projectExtentTask",void 0),P=r([_("esri.views.support.DefaultsFromMap")],P);let uh=class{constructor(t,e){this.layerFilter=t,this.pushLayer=e,this.preloading=-1,this.updating=!1,this.done=!1}};function mh(t,e){return t!=null?e!=null?t===e&&t:t:e}var be;let y=be=class extends hi.EventedMixin(Oa(M)){constructor(t){super(t),this._userSpatialReference=null,this._cursor=null,this.handles=new qs,this.updatingHandles=new yi,this.allLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:yh}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new oo,this.analyses=new ai,this.typeSpecificPreconditionsReady=!0,this.layerViews=new L,this.magnifier=new uo,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new rh,this.navigation=new To,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Hl(this),this.persistableViewModels=new L,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(w(()=>this.preconditionsReady,e=>{const i=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,be.views.add(this)):(this._lockedSpatialReference=null,be.views.remove(this)),this.notifyChange("spatialReference"),!e&&i)this.toolViewManager?.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!i){try{this._startup()}catch(n){return void queueMicrotask(()=>{this.fatalError=new C("startup-error",null,n)})}this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},Ee))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,pn(()=>this.ready)))),this.basemapView=new Il({view:this}),this.layerViewManager=new Vl({view:this,layerViewImporter:{importLayerView:t=>this.importLayerView(t),hasLayerViewModule:t=>this.hasLayerViewModule(t)},supportsGround:this.supportsGround}),this.toolViewManager=new lt({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new Nl({view:this}),this.addHandles([w(()=>this.initialExtentRequired,t=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:t},ct),w(()=>this.ready,t=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=t,this.defaultsFromMap.userSpatialReference=t?this.spatialReference:this._userSpatialReference)},Ee),w(()=>this._userSpatialReference,t=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=t)},ct)])}_setupSpatialReferenceLogger(){let t=null;this.addHandles([w(()=>this.defaultsFromMap?.ready,e=>{const i=this.map?.allLayers.length>0;if(e&&!this.spatialReference&&i){if(t!=null)return;const n=di(()=>t=ji(t));t=dn(async s=>{try{await Aa(this.spatialReferenceWarningDelay,null,s)}catch{return}finally{t=null}D.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.addHandles(n,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")},{sync:!0})])}destroy(){this.destroyed||(be.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=tt(this.graphics),this.analyses=tt(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),tt(this.analysisViewManager),this.toolViewManager=tt(this.toolViewManager),this.layerViewManager=tt(this.layerViewManager),this.selectionManager=tt(this.selectionManager),this.basemapView=tt(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(t=>t.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=tt(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return D.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(t){this.toolViewManager&&(this.toolViewManager.activeTool=t)}get animation(){return this._get("animation")}set animation(t){this._set("animation",t)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new P({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(t,e)=>this.getSpatialReferenceSupport(t,e),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(t){this._set("extent",t)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||An.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(t){t!==this._get("map")&&(t?.destroyed&&(D.getLogger(this).warn("#map","The provided map is already destroyed",{map:t}),t=null),An.isLoadable(t)&&t.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",t))}get spatialReference(){const t=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(t&&this.defaultsFromMap?.required?.heightModelInfo){const e=t.clone();return e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,e}return t}set spatialReference(t){const e=!pi(t,this._get("spatialReference"));this._set("_userSpatialReference",t),e&&(this._set("spatialReference",t),this._spatialReferenceChanged(t))}_spatialReferenceChanged(t){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(t){this._userTimeExtent=t}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??za}set timeZone(t){this._userTimeZone=t,Na(t)||D.getLogger(this).warn("#timeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(t){this._cursor=t,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new Ki}whenLayerView(t){return this.layerViewManager?.whenLayerView(t)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(t){throw new C("importLayerView() not implemented")}hasLayerViewModule(t){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(t){return this.getSpatialReferenceSupport(t)!=null}when(t,e){return this.isResolved()&&!this.ready&&D.getLogger(this).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(t,e)}forceReadyCycle(){this.ready&&(Ce(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(t){this.toolViewManager.tools.add(t),this.activeTool=t}tryFatalErrorRecovery(){this.fatalError=null}};y.views=new L,r([l()],y.prototype,"_userSpatialReference",void 0),r([l()],y.prototype,"activeTool",null),r([l({readOnly:!0})],y.prototype,"allLayerViews",void 0),r([l()],y.prototype,"groundView",void 0),r([l()],y.prototype,"animation",null),r([l()],y.prototype,"basemapView",void 0),r([l()],y.prototype,"center",null),r([l()],y.prototype,"defaultsFromMapSettings",null),r([l()],y.prototype,"defaultsFromMap",null),r([l()],y.prototype,"fatalError",void 0),r([l({type:Xt})],y.prototype,"extent",null),r([l(Wn(oo,"graphics"))],y.prototype,"graphics",void 0),r([l(Wn(ai,"analyses"))],y.prototype,"analyses",void 0),r([l({readOnly:!0,type:wn})],y.prototype,"heightModelInfo",null),r([l({readOnly:!0})],y.prototype,"interacting",null),r([l({readOnly:!0})],y.prototype,"navigating",null),r([l({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],y.prototype,"preconditionsReady",null),r([l({readOnly:!0})],y.prototype,"typeSpecificPreconditionsReady",void 0),r([l({type:L,readOnly:!0})],y.prototype,"layerViews",void 0),r([l()],y.prototype,"resolution",null),r([l({type:uo})],y.prototype,"magnifier",void 0),r([l({value:null,type:xr})],y.prototype,"map",null),r([l()],y.prototype,"padding",void 0),r([l({readOnly:!0})],y.prototype,"ready",void 0),r([l({type:si})],y.prototype,"spatialReference",null),r([l()],y.prototype,"spatialReferenceWarningDelay",void 0),r([l()],y.prototype,"stationary",null),r([l({readOnly:!0})],y.prototype,"supportsGround",void 0),r([l({type:Sr})],y.prototype,"timeExtent",null),r([l({type:String,nonNullable:!0})],y.prototype,"timeZone",null),r([l()],y.prototype,"tools",null),r([l()],y.prototype,"toolViewManager",void 0),r([l({readOnly:!0})],y.prototype,"type",void 0),r([l({type:Number})],y.prototype,"scale",void 0),r([l({readOnly:!0})],y.prototype,"updating",void 0),r([l({readOnly:!0})],y.prototype,"initialExtentRequired",void 0),r([l({readOnly:!0})],y.prototype,"initialExtent",null),r([l()],y.prototype,"cursor",null),r([l({readOnly:!0})],y.prototype,"input",void 0),r([l({type:To,nonNullable:!0})],y.prototype,"navigation",void 0),r([l()],y.prototype,"layerViewManager",void 0),r([l()],y.prototype,"analysisViewManager",void 0),r([l()],y.prototype,"selectionManager",void 0),r([l()],y.prototype,"width",void 0),r([l()],y.prototype,"height",void 0),r([l({readOnly:!0})],y.prototype,"resizing",void 0),r([l({value:null,readOnly:!0})],y.prototype,"size",null),r([l({readOnly:!0})],y.prototype,"suspended",void 0),r([l({readOnly:!0})],y.prototype,"viewEvents",void 0),r([l({readOnly:!0})],y.prototype,"persistableViewModels",void 0),r([l()],y.prototype,"_isValid",void 0),r([l()],y.prototype,"_readyCycleForced",void 0),r([l()],y.prototype,"_lockedSpatialReference",void 0),r([l()],y.prototype,"_userTimeZone",void 0),r([l()],y.prototype,"_lockedTimeZone",void 0),r([l()],y.prototype,"_userTimeExtent",void 0),r([l()],y.prototype,"_lockedTimeExtent",void 0),r([l({type:Ki})],y.prototype,"theme",void 0),r([l({readOnly:!0,type:Ki})],y.prototype,"effectiveTheme",null),y=be=r([_("esri.views.View")],y);const Vi=globalThis.$arcgis;Vi&&!Vi.views&&Object.defineProperty(Vi,"views",{configurable:!1,enumerable:!0,writable:!1,value:y.views});const gh=y;function yh(t){return t.layerViews}let Rt=class extends Ba{constructor(t){super(t),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=ui(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),this._resolver?.reject(new C("ViewAnimation stopped")))}finish(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),this._resolver?.resolve())}update(t,e){e||(e=to(t)?"waiting-for-target":"running"),this._set("target",t),this._set("state",e)}};r([l({readOnly:!0})],Rt.prototype,"done",null),r([l({readOnly:!0,type:String})],Rt.prototype,"state",void 0),r([l()],Rt.prototype,"target",void 0),Rt=r([_("esri.views.ViewAnimation")],Rt),function(t){t.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(Rt||(Rt={}));const Qi=Rt;function xt(){return[1,0,0,1,0,0]}function _h(t){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function fh(t,e,i,n,s,o){return[t,e,i,n,s,o]}function vh(t,e){return new Float64Array(t,e,6)}const wh=xt();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:wh,clone:_h,create:xt,createView:vh,fromValues:fh},Symbol.toStringTag,{value:"Module"}));const ko=96,Eo=39.37,bh=180/Math.PI;function Co(t){return t.wkid?t:t.spatialReference||si.WGS84}function xn(t,e){return e.type?N(t,e.x,e.y):Se(t,e)}function Io(t){return Ys(t)}function fi(t,e,i=0){let n=t.width,s=t.height;if(i!==0){const h=gn(i),c=Math.abs(Math.cos(h)),p=Math.abs(Math.sin(h));n=t.width*c+t.height*p,s=t.width*p+t.height*c}const o=Math.max(1,e[0]),a=Math.max(1,e[1]);return Math.max(n/o,s/a)*Ch(t.spatialReference)}async function Te(t,e,i,n){let s,o;if(!t||Array.isArray(t)&&!t.length)return null;if(L.isCollection(t)&&(t=t.toArray()),Array.isArray(t)&&t.length&&typeof t[0]=="object"){const h=t.every(d=>"attributes"in d),c=t.some(d=>!d.geometry);let p=t;if(h&&c&&e&&e.allLayerViews){const d=new Map;for(const f of t){const T=f.layer,I=d.get(T)||[],E=f.attributes[T.objectIdField];E!=null&&I.push(E),d.set(T,I)}const m=[];d.forEach((f,T)=>{const I=e.allLayerViews.find(E=>E.layer.id===T.id);if(I&&"queryFeatures"in I){const E=T.createQuery();E.objectIds=f,E.returnGeometry=!0,m.push(I.queryFeatures(E))}});const u=await Promise.all(m),g=[];for(const f of u)if(f&&f.features&&f.features.length)for(const T of f.features)T.geometry!=null&&g.push(T.geometry);p=g}for(const d of p)n=await Te(d,e,i,n);return n}if(Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")s=new V(t);else if(t instanceof io)s=t;else if("geometry"in t){if(t.geometry)s=t.geometry;else if(t.layer){const h=t.layer,c=e.allLayerViews.find(p=>p.layer.id===h.id);if(c&&"queryFeatures"in c){const p=h.createQuery();p.objectIds=[t.attributes[h.objectIdField]],p.returnGeometry=!0,s=(await c.queryFeatures(p))?.features?.[0]?.geometry}}}if(s==null)return null;switch(s.type){case"point":o=new Xt({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference});break;case"extent":case"multipoint":case"polygon":case"polyline":o=Zr(s);break;default:o=s.extent}if(!o)return null;yn()||_n(o.spatialReference,i)||await fn();const a=Le(o,i);if(!a)return null;if(n){const h=a.center,c=h.clone();c.x=Tn(h.x,n.center.x,i),c.x!==h.x&&a.centerAt(c),n=n.union(a)}else n=a;return n}function Th(t){if(t&&(!Array.isArray(t)||typeof t[0]!="number")&&(typeof t=="object"||Array.isArray(t)&&typeof t[0]=="object")){if("layer"in t&&t.layer?.minScale!=null&&t.layer.maxScale!=null){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every(e=>"layer"in e)){let e=0,i=0;for(const n of t){const s=n.layer;s?.minScale&&s.maxScale&&(e=s.minScalei?s.maxScale:i)}return e&&i?{min:e,max:i}:null}}}function us(t,e){const i=Co(t);return pi(i,e)||i.imageCoordinateSystem||e.imageCoordinateSystem?t:Le(t,e)}async function Mh(t,e){if(!t||!e)return new nt({targetGeometry:new V,scale:0,rotation:0});let i=e.spatialReference;const{constraints:n,padding:s,viewpoint:o,size:a}=e,h=[s?a[0]-s.left-s.right:a[0],s?a[1]-s.top-s.bottom:a[1]];let c=null;t instanceof nt?c=t:t.viewpoint?c=t.viewpoint:t.target&&t.target.declaredClass==="esri.Viewpoint"&&(c=t.target);let p=null;c?.targetGeometry?p=c.targetGeometry:t instanceof Xt?p=t:t instanceof io?p=await Te(t,e,i):t&&(p=await Te(t.center,e,i)||await Te(t.target,e,i)||await Te(t,e,i)),!p&&o?.targetGeometry?p=o.targetGeometry:!p&&e.extent&&(p=e.extent),i||(i=Co(e.spatialReference||e.extent||p)),yn()||pi(p.spatialReference,i)||_n(p.spatialReference,i)||await fn();const d=us(p,i),m="center"in d?d.center:d;e.pickClosestTarget!==!1&&m.type==="point"&&o.targetGeometry?.type==="point"&&(m.x=Tn(m.x,o.targetGeometry.x,m.spatialReference));let u=0;c?u=c.rotation:t.hasOwnProperty("rotation")?u=t.rotation:o&&(u=o.rotation);let g=0;g=c?.targetGeometry!=null&&c.targetGeometry.type==="point"?c.scale:"scale"in t&&t.scale?t.scale:"zoom"in t&&t.zoom!==-1&&n&&n.effectiveLODs?n.zoomToScale(t.zoom):Array.isArray(p)||p.type==="point"||p.type==="extent"&&p.width===0&&p.height===0?o.scale:fi(us(p.extent,i),h,u);const f=Th(t.target??t);f&&(f.min&&f.ming&&(g=f.max));let T=new nt({targetGeometry:m,scale:g,rotation:u});return n&&(T=n.fit(T),n.constrainByGeometry(T),n.rotationEnabled||(T.rotation=o.rotation)),T}function G(t,e){const i=t.targetGeometry,n=e.targetGeometry;return i.x=n.x,i.y=n.y,i.spatialReference=n.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}function xh(t,e,i){return i?N(t,.5*(e[0]-i.right+i.left),.5*(e[1]-i.bottom+i.top)):_i(t,e,.5)}const Ph=function(){const t=O();return function(e,i,n){const s=i.targetGeometry;xn(t,s);const o=.5*ue(i);return e.xmin=t[0]-o*n[0],e.ymin=t[1]-o*n[1],e.xmax=t[0]+o*n[0],e.ymax=t[1]+o*n[1],e.spatialReference=s.spatialReference,e}}();function Sh(t,e,i,n,s){return Ji(t,e,i.center),t.scale=fi(i,n),s?.constraints?.constrain(t),t}function kh(t,e,i,n){return kn(t,e,i,n),ho(t,t)}const Do=function(){const t=O();return function(e,i,n){return ao(e,Ih(e,i),xh(t,i,n))}}(),Eh=function(){const t=xt(),e=O();return function(i,n,s,o){const a=ue(n),h=Pn(n);return N(e,a,a),Hr(t,e),bn(t,t,h),oi(t,t,Do(e,s,o)),oi(t,t,[0,o.top-o.bottom]),N(i,t[4],t[5])}}();function ue(t){return t.scale*Ro(t.targetGeometry?.spatialReference)}function Ro(t){return t!=null&&eo(t)?1/(Io(t)*Eo*ko):1}function Pn(t){return ro(t.rotation)||0}function Ch(t){return eo(t)?Io(t)*Eo*ko:1}function Ih(t,e){return _i(t,e,.5)}const Sn=function(){const t=O(),e=O(),i=O();return function(n,s,o,a,h,c){return Vr(t,s),_i(e,o,.5*c),N(i,1/a*c,-1/a*c),co(n,e),h&&bn(n,n,h),lo(n,n,i),oi(n,n,t),n}}(),kn=function(){const t=O();return function(e,i,n,s){const o=ue(i),a=Pn(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,a,s)}}(),Dh=function(){const t=O();return function(e,i,n,s){const o=ue(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,0,s)}}();function Lo(t){const e=Bs(t);return e?e.valid[1]-e.valid[0]:0}function Rh(t,e){return Math.round(Lo(t)/e)}const Lh=function(){const t=O(),e=O(),i=[0,0,0];return function(n,s,o){qi(t,n,s),qn(t,t),qi(e,n,o),qn(e,e),Ir(i,t,e);let a=Math.acos(Dr(t,e)/(Bn(t)*Bn(e)))*bh;return i[2]<0&&(a=-a),isNaN(a)&&(a=0),a}}(),Vh=function(){const t=O();return function(e,i,n,s){const o=e.targetGeometry;return G(e,i),Eh(t,i,n,s),o.x+=t[0],o.y+=t[1],e}}(),Ji=function(t,e,i){G(t,e);const n=t.targetGeometry;return n.x=i.x,n.y=i.y,n.spatialReference=i.spatialReference,t},Oh=function(){const t=O();return function(e,i,n,s,o){o||(o="center"),ao(t,n,s),_i(t,t,.5);const a=t[0],h=t[1];switch(o){case"center":N(t,0,0);break;case"left":N(t,-a,0);break;case"top":N(t,0,h);break;case"right":N(t,a,0);break;case"bottom":N(t,0,-h);break;case"top-left":N(t,-a,h);break;case"bottom-left":N(t,-a,-h);break;case"top-right":N(t,a,h);break;case"bottom-right":N(t,a,-h)}return vi(e,i,t),e}}();function xu(t,e,i){return G(t,e),t.rotation+=i,t}function Ah(t,e,i){return G(t,e),t.rotation=i,t}const zh=function(){const t=O();return function(e,i,n,s,o){return G(e,i),isNaN(n)||n===0||(Oo(t,s,i,o),e.scale=i.scale*n,Ao(t,t,e,o),vi(e,e,N(t,t[0]-s[0],s[1]-t[1]))),e}}();function ms(t,e,i){return G(t,e),t.scale=i,t}const Vo=function(){const t=O();return function(e,i,n,s,o,a){return G(e,i),isNaN(n)||n===0||(Oo(t,o,i,a),e.scale=i.scale*n,e.rotation+=s,Ao(t,t,e,a),vi(e,e,N(t,t[0]-o[0],o[1]-t[1]))),e}}(),Pu=function(){const t=O(),e=O();return function(i,n,s,o,a,h,c){return Do(e,h,c),Rr(t,a,e),o?Vo(i,n,s,o,t,h):zh(i,n,s,t,h)}}(),Oo=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kh(t,n,s,1))}}(),Ao=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kn(t,n,s,1))}}(),vi=function(){const t=O(),e=xt();return function(i,n,s){G(i,n);const o=ue(n),a=i.targetGeometry;return Or(e,Pn(n)),lo(e,e,Cr(o,o)),Tt(t,s,e),a.x+=t[0],a.y+=t[1],i}}();function Ye(){const t=new Float32Array(9);return t[0]=1,t[4]=1,t[8]=1,t}function Nh(t){const e=new Float32Array(9);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 Fh(t,e,i,n,s,o,a,h,c){const p=new Float32Array(9);return p[0]=t,p[1]=e,p[2]=i,p[3]=n,p[4]=s,p[5]=o,p[6]=a,p[7]=h,p[8]=c,p}function Hh(t,e){return new Float32Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:Nh,create:Ye,createView:Hh,fromValues:Fh},Symbol.toStringTag,{value:"Module"}));function Zh(t){return t instanceof Float32Array&&t.length>=2}function Gh(t){return Array.isArray(t)&&t.length>=2}function Oi(t){return Zh(t)||Gh(t)}var tn;const ut=[0,0];let _t=tn=class extends cn{constructor(t){super(t),this._viewpoint2D={center:O(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new Xt,this.id=0,this.inverseTransform=xt(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=xt(),this.transformNoRotation=xt(),this.displayMat3=Ye(),this.displayViewMat3=Ye(),this.viewMat3=Ye(),this.viewMat2d=zr(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set("pixelRatio",t),this._update()}set size(t){this._set("size",t),this._update()}set viewpoint(t){if(t){const e=this._viewpoint2D,i=t.targetGeometry;e.center[0]=i.x,e.center[1]=i.y,e.rotation=t.rotation,e.scale=t.scale,e.spatialReference=i.spatialReference}this._update()}get visibleArea(){const[t,e]=this.size;return[this.toMap([0,0],0,0),this.toMap([0,0],0,e),this.toMap([0,0],t,e),this.toMap([0,0],t,0)]}copy(t){const e=this.size,i=this.viewpoint;return i&&e?(this.viewpoint=G(i,t.viewpoint),this._set("size",Se(e,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set("size",[t.size[0],t.size[1]])),this._set("pixelRatio",t.pixelRatio),this}clone(){return new tn({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,e,i){return Oi(e)?Tt(t,e,this.inverseTransform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.inverseTransform))}toScreen(t,e,i){return Oi(e)?Tt(t,e,this.transform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transform))}toScreenNoRotation(t,e,i){return Oi(e)?Tt(t,e,this.transformNoRotation):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transformNoRotation))}wrapMapCoordinate(t,e){Se(t,e);const[i]=e,[n]=this.center,{extent:s,spatialReference:o}=this;let{xmin:a,xmax:h}=s;if(o.isWrappable){const c=Lo(o)/2;a=Math.max(a,n-c),h=Math.min(h,n+c)}return(ih)&&(t[0]=Tn(i,n,o)),t}getScreenTransform(t,e){const{center:i}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size");return Sn(t,i,s,e,0,n),t}_update(){const{center:t,spatialReference:e,scale:i,rotation:n}=this._viewpoint2D,s=this._get("pixelRatio")||1,o=this._get("size"),a=new nt({targetGeometry:new V(t[0],t[1],e),scale:i,rotation:n});if(this._set("viewpoint",a),!o||!e||!i)return;this.resolution=ue(a),this.rotation=n,this.scale=i,this.spatialReference=e,Se(this.center,t);const h=o[0]!==0?2/o[0]:0,c=o[1]!==0?-2/o[1]:0;Gr(this.displayMat3,h,0,0,0,c,0,-1,1,1);const p=$r(this.viewMat3),d=Xn(o[0]/2,o[1]/2),m=Xn(-o[0]/2,-o[1]/2),u=ro(n);Yn(p,p,d),Wr(p,p,u),Yn(p,p,m),Ur(this.displayViewMat3,this.displayMat3,p);const g=co(this.viewMat2d,d);return bn(g,g,u),oi(g,g,m),Ph(this.extent,a,o),kn(this.transform,a,o,s),ho(this.inverseTransform,this.transform),Dh(this.transformNoRotation,a,o,s),this.worldScreenWidth=Rh(this.spatialReference,this.resolution),this._set("id",this.id+1),this.notifyChange("visibleArea"),this}};r([l({readOnly:!0})],_t.prototype,"id",void 0),r([l({value:1,json:{write:!0}})],_t.prototype,"pixelRatio",null),r([l({json:{write:!0}})],_t.prototype,"size",null),r([l()],_t.prototype,"spatialReference",void 0),r([l({type:nt,json:{write:!0}})],_t.prototype,"viewpoint",null),r([l({readOnly:!0})],_t.prototype,"visibleArea",null),_t=tn=r([_("esri.views.2d.ViewState")],_t);const gs=_t;var en,nn;let Mt=en=class extends M{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new en({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};r([l()],Mt.prototype,"left",void 0),r([l()],Mt.prototype,"top",void 0),r([l()],Mt.prototype,"right",void 0),r([l()],Mt.prototype,"bottom",void 0),Mt=en=r([_("esri.views.2d.PaddedViewState.Padding")],Mt);let oe=nn=class extends gs{constructor(...t){super(...t),this.paddedViewState=new gs,this._updateContent=(()=>{const e=O();return()=>{const i=this._get("size"),n=this._get("padding");if(!i||!n)return;const s=this.paddedViewState;N(e,n.left+n.right,n.top+n.bottom),qi(e,i,e),Se(s.size,e);const o=s.viewpoint;o&&(this.viewpoint=o)}})(),this.addHandles(w(()=>[this.size,this.padding],()=>this._updateContent(),Ee)),this.padding=new Mt,this.size=[0,0]}set padding(t){this._set("padding",t||new Mt)}set viewpoint(t){if(t){this.paddedViewState.viewpoint=t;let e=t;const i=this._get("padding");i&&(e=Vh(t.clone(),t,this._get("size"),i));const{targetGeometry:n,rotation:s,scale:o}=e,{x:a,y:h,spatialReference:c}=n,p=this._viewpoint2D;p.center[0]=a,p.center[1]=h,p.rotation=s,p.scale=o,p.spatialReference=c,this._update()}}clone(){return new nn({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};r([l()],oe.prototype,"paddedViewState",void 0),r([l({type:Mt})],oe.prototype,"padding",null),r([l()],oe.prototype,"viewpoint",null),oe=nn=r([_("esri.views.2d.PaddedViewState")],oe);const En=oe;let ys=class{constructor(t){this._view=t,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0})}get view(){return this._view}get size(){const[t,e]=this._view.size;return Math.sqrt(t*t+e*e)}get scale(){return this.viewpoint.scale}get rotation(){return this.viewpoint.rotation}get center(){return this.viewpoint.targetGeometry}get scaleToResolutionFactor(){return Ro(this.center.spatialReference)}pixelsPerPanAtZoom(t){return 1/(t*this.scaleToResolutionFactor)}zoomAtPixelsPerPan(t){return 1/(t*this.scaleToResolutionFactor)}pixelsPerRotate(){return this.size/2}compareTo(t,e){e.pan=dr(this.center,t.center);let i=Math.abs(t.rotation-this.rotation);i=i>=180?360-i:i,e.rotate=gn(i),e.sourceZoom=this.scale,e.targetZoom=t.scale}interpolate(t,e,i){const{pan:n,rotate:s,zoom:o,zoomOffset:a}=i,{center:h}=this;h.spatialReference=t.center.spatialReference,h.x=Fe(t.center.x,e.center.x,n),h.y=Fe(t.center.y,e.center.y,n),this.viewpoint.scale=Fe(t.scale,e.scale+a,o);let c=t.rotation;const p=e.rotation;Math.abs(p-c)>=180&&(c+=360*(ct*t,$h=t=>1-zo(1-t),Wh=t=>2**(10*(t-1)),Uh=t=>1-Wh(1-t);function jh(t){const e=2*(t-Math.sqrt((t-1)*t)),i=e/2/t;return n=>ni1e-5}get hasPan(){return this.compared.pan>xi()}get hasFov(){return Math.abs(this.compared.fov)>xi()}get hasRotate(){return this.compared.rotate>xi()}},Yh=class{constructor(){this.pan=0,this.rotate=0,this.zoom=0,this.fov=0,this.zoomOffset=0}},Xh=class{constructor(){this.segments=new Array}get time(){return this.segments.reduce((t,e)=>X(t+e.time),X(0))}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),t*=this.time;let i=0,n=0;const s=this.definition,o=this.segments.reduce((a,h)=>a||h.definition.hasZoom,!1);for(let a=0;aMath.abs(p-u)?d:p;e.zoomOffset=f-g,e.zoom=(m-u)/(f-u)}else e.zoom=1;return e}t-=h.time,i+=c.compared.pan,n+=c.compared.rotate}}segmentInterpolateComponentsAt(t,e,i){t.interpolateComponentsAt(e,i)}},Ai=class{get time(){return this._time}constructor(t){t&&this.update(t)}update(t){t&&(this.definition?this.definition.copyFrom(t):this.definition=t.clone()),this._updatePrecomputedVariables(),this._updatePixelFlow()}_updatePrecomputedVariables(){const t=this.definition,e=t.compared,i=e.sourceZoom,n=e.targetZoom;this._zoomSign=i>n?1:-1,this._panPixelsAtSource=e.pan*t.source.pixelsPerPanAtZoom(i);const s=(t.source.pixelsPerRotate()+t.target.pixelsPerRotate())/2;this._rotatePixels=e.rotate*s}_updatePixelFlow(){const t=this.definition.compared.sourceZoom,e=this.definition.compared.targetZoom,{hasZoom:i,hasPan:n,hasRotate:s}=this.definition;let o=0,a=0;i&&(n&&(o=(e/t-1)/(-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource)),s&&(a=this._zoomSign*(Math.log(t/e)/Math.LN2)*this.definition.halfWindowSize/this._rotatePixels)),this._zoomPixelFlow=0,this._panPixelFlow=0,this._rotatePixelFlow=0;const h=this.definition.desiredPixelFlow;if(i&&n&&s){const c=o+a+o*a;this._zoomPixelFlow=o*a/c*h,this._panPixelFlow=a/c*h,this._rotatePixelFlow=o/c*h}else if(i&&n){const c=1+o;this._zoomPixelFlow=o/c*h,this._panPixelFlow=1/c*h}else if(i&&s){const c=1+a;this._zoomPixelFlow=a/c*h,this._rotatePixelFlow=1/c*h}else if(n&&s){const c=this._panPixelsAtSource/this._rotatePixels,p=1+c;this._panPixelFlow=c/p*h,this._rotatePixelFlow=1/p*h}else n?this._panPixelFlow=h:i?this._zoomPixelFlow=h:s&&(this._rotatePixelFlow=h);if(this._time=X(Math.max(this.rotateTime,this.zoomTime,this.panTime)),this.fovTime>this._time){const c=this.fovTime/this._time;this._time=this.fovTime,this._zoomPixelFlow/=c,this._panPixelFlow/=c,this._rotatePixelFlow/=c}}get rotateTime(){return this.definition.hasRotate?X(this._rotatePixels/this._rotatePixelFlow):X(0)}get zoomTime(){return this.definition.hasZoom?X(this._zoomSign*(Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2)*this.definition.halfWindowSize/this._zoomPixelFlow):X(0)}get fovTime(){return this.definition.hasFov?X(Math.abs(this.definition.compared.fov)/Qh):X(0)}get panTime(){if(!this.definition.hasPan)return X(0);if(this.definition.hasZoom){const t=-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2,e=t*this._panPixelsAtSource;return X(Math.log(e*(this._zoomPixelFlow/this._panPixelFlow)+1)/(t*this._zoomPixelFlow))}return X(this._panPixelsAtSource/this._panPixelFlow)}_interpolateComponentsZoom(t){if(t===0||t===1)return t;if(this.definition.hasZoom){const e=this.definition.compared.sourceZoom,i=this.definition.compared.targetZoom;return(e*(e/i)**-t-e)/(i-e)}return t}_interpolateComponentsFov(t){if(t===0)return this.definition.segmentStart;if(t===1)return this.definition.segmentEnd;if(this.definition.hasFov){const{segmentStart:e,segmentEnd:i}=this.definition;return e+t*(i-e)}return this.definition.segmentStart}_interpolateComponentsPan(t){if(t===0||t===1)return t;if(this.definition.hasPan&&this.definition.hasZoom){const e=-1/(this._zoomSign*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*(this._panPixelFlow*(2**(e*t*this._time)-1))/(e*Math.LN2)}return t}_interpolateComponentsRotate(t){return t}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),e.zoom=this._interpolateComponentsZoom(t),e.pan=this._interpolateComponentsPan(t),e.rotate=this._interpolateComponentsRotate(t),e.zoomOffset=0,e.fov=this._interpolateComponentsFov(t)}};const Qh=gn(45);function Jh(t,e,i){const n=e-t.compared.sourceZoom,s=t.halfWindowPanAtZoom(n);return-t.halfWindowSize*(i.ascensionFactor*Math.LN2*t.compared.pan+s)*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2*s)}function tc(t,e,i){const n=1/e,s=Math.log(t.compared.sourceZoom*n),o=1/t.desiredPixelFlow,a=1/Math.LN2,h=e-t.compared.sourceZoom,c=1/h,p=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(h))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*n*o*a*c*p-t.halfWindowSize*s*o*a*c+t.halfWindowSize*s*o*a*p/(h*h)}function ec(t,e,i){const n=e-t.compared.sourceZoom,s=1/n,o=1/e,a=Math.log(t.compared.sourceZoom*o),h=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(n))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h+2*s*a+2*o-2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function ic(t,e){return-t.halfWindowSize*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2)}function nc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function sc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function oc(t,e,i){return-t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e))}function ac(t,e,i){return t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e))}function rc(t,e,i){return-2*t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e*e))}function lc(t,e,i){return t.halfWindowSize*(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*t.halfWindowPanAtZoom(-e+t.compared.targetZoom))}function hc(t,e,i){const n=Math.log(e/t.compared.targetZoom),s=1/t.desiredPixelFlow,o=1/Math.LN2,a=-e+t.compared.targetZoom,h=1/a,c=(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return-t.halfWindowSize*n*s*o*h+t.halfWindowSize*n*s*o*c/(a*a)+t.halfWindowSize*s*o*h*c/e}function cc(t,e,i){const n=e-t.compared.targetZoom,s=1/n,o=1/e,a=Math.log(e/t.compared.targetZoom),h=(t.halfWindowPanAtZoom(e)+i.descensionFactor*Math.LN2*t.compared.pan-t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h-2*s*a+2*o+2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function pc(t,e){return t.halfWindowSize*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2)}function dc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function uc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function mc(t){const e=t.compared.sourceZoom-t.compared.targetZoom;if(e===0)return t.compared.pan*t.halfWindowSize/(t.desiredPixelFlow*t.halfWindowPanAtZoom(t.compared.sourceZoom));const i=Math.LN2*t.compared.pan,n=e,s=t.halfWindowPanAtZoom(n),o=t.halfWindowSize*Math.log(t.compared.sourceZoom/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*s);return t.compared.sourceZoom<=t.compared.targetZoom?o*(i-s):o*(i+s)}function gc(t,e){let i=yc(t,e);const n={ascensionFactor:e.ascensionFactor!=null?e.ascensionFactor:.5,descensionFactor:e.descensionFactor!=null?e.descensionFactor:.5},s=n.ascensionFactor===0,o=n.descensionFactor===0,a=s?ic:Jh,h=s?nc:tc,c=s?sc:ec,p=o?pc:lc,d=o?dc:hc,m=o?uc:cc,u=x=>a(t,x,n)+oc(t,x,n)+p(t,x,n),g=x=>h(t,x,n)+ac(t,x,n)+d(t,x,n),f=x=>c(t,x,n)+rc(t,x,n)+m(t,x,n);let T=u(i);const I=mc(t);let E;const ot=e.maximumIterations||20,S=e.maximumDistance!=null?e.maximumDistance:1/0;for(E=0;Ex&&($+=x);const K=$/f(i);if(isNaN(K)||i>=S&&K<0){if(!isFinite(S))return null;i=S,T=u(i);break}if(i-=K,iI*(1-.3)||i0&&(n.definition?n.definition.copyFrom(this.definition):n.definition=this.definition.clone(),n.definition.copyFrom(this.definition),n.definition.compared.sourceZoom=t,n.definition.compared.targetZoom=t,n.definition.compared.pan=this.definition.compared.pan*h,n.definition.compared.rotate=this.definition.compared.rotate*h,n.definition.segmentStart=i.definition.segmentEnd,n.definition.segmentEnd=i.definition.segmentEnd+h,n.update(),this.segments.push(n)),s.definition?s.definition.copyFrom(this.definition):s.definition=this.definition.clone(),s.definition.compared.sourceZoom=t,s.definition.compared.pan=this.definition.compared.pan*a,s.definition.compared.rotate=this.definition.compared.rotate*a,s.definition.segmentStart=o+h,s.update(),this._descensionSegment=s,this.segments.push(s)}_updateWithoutApex(){const[t]=this._preallocSegments;t.update(this.definition),this.segments.push(t)}};const fc=new Yh;let vc=class{get time(){return this._time}get isLinear(){return this.path.segments.length===1}constructor(t){this._time=it(0),this._easing=_s,this.definition=new Kh(t),this.path=new _c}update(t,e,i){this.definition.update(t,e,i),this.path.update(this.definition,i),this._time=this._applyTimeSettings(ur(isFinite(this.path.time)?this.path.time:X(0)),i),this._easing=i.easing??(this._time>=1e3?_s:Uh)}cameraAt(t,e){t=Math.min(Math.max(0,t),1),t=this._normalizedEasing(t);const i=this.path.interpolateComponentsAt(t,fc);e.interpolate(this.definition.source,this.definition.target,i)}_normalizedEasing(t){const e=this._easing(0,this._time),i=this._easing(1,this._time);return(this._easing(t,this._time)-e)/(i-e)}_applyTimeSettings(t,e){const i=e.speedFactor!=null?e.speedFactor:1,n=e.minDuration??De.minDuration/i,s=e.maxDuration??De.maxDuration/i;return t=e.duration!=null?e.duration:it(Math.min(Math.max(t/i,n),s))}};const fs=2e3,wc=64;let bc=class{constructor(t){this._view=t,this._animation=new vc(()=>new ys(this._view)),this._current=new ys(this._view)}get _source(){return this._animation.definition.source}get _target(){return this._animation.definition.target}get duration(){return this._animation.time}get animation(){return this._animation}update(t,e,i={}){G(this._current.viewpoint,t),G(this._source.viewpoint,t),G(this._target.viewpoint,e),this._animation.update(this._source,this._target,i)}applyRatio(t,e){this._animation.cameraAt(e,this._current),G(t,this._current.viewpoint)}},ae=class extends M{constructor(t){super(t),this._animation=null,this._destinationViewState=new En,this.updateFunction=null,this.easing=jr.ease,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0}),this._updateTask=de({postRender:this._postRender.bind(this)}),this._updateTask.pause(),this._transition=new bc(t.view)}destroy(){this._updateTask=st(this._updateTask)}get animation(){return this._animation}set animation(t){this._animation=t,this.view.animation=t}animate(t,e,i){this.stop();const n=this.viewpoint;G(n,e);const s=(typeof i?.easing=="string"?qr(i.easing):i?.easing)||this.easing,o=t.target;this._transition.update(this.viewpoint,o,{apex:{maximumDistance:Math.min(Math.min(e.scale,o.scale)*wc,this.view.constraints.effectiveMinScale),desiredSlope:5e-8},duration:i?.duration,maxDuration:i?.animationMode==="auto"?it(1/0):i?.maxDuration??No.maxDuration,speedFactor:i?.speedFactor,easing:typeof s=="function"?h=>s(h):void 0}),i?.animationMode==="auto"&&(this._destinationViewState.copy(this.view.state),this._destinationViewState.viewpoint=o,Tc(this._transition.animation,i,this.view.state,this._destinationViewState)||this._transition.update(this.viewpoint,o,{duration:it(0)}));const a=()=>{this.animation===t&&this._updateTask&&(t.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 t.when(a,a),this._startTime=performance.now(),this._updateTask.resume(),this.animation=t,t}animateContinuous(t,e){this.stop(),this.updateFunction=e,this.viewpoint=t;const i=new Qi({target:t.clone()}),n=()=>{this.animation===i&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return i.when(n,n),this._startTime=performance.now(),this._updateTask.resume(),this.animation=i,i}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(t){const e=this.animation;if(e&&e.state!==Qi.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,t.deltaTime),this.animation?.update(this.viewpoint);else{const i=performance.now()-this._startTime,n=this._transition.duration,s=n>0?i/n:1,o=s>=1;this._transition.applyRatio(this.viewpoint,s),o&&this.animation?.finish()}this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};function Tc(t,e,i,n){if(e?.duration!=null)return!0;const{time:s,isLinear:o}=t,a=e?.speedFactor||1,h=e?.maxDuration??No.maxDuration/a;if(z("esri-goto-debug")&&(console.log("speed factor:",a),console.log("adjusted duration: ",s),console.log("adjusted max duration: ",h),console.log("is linear:",o)),s>h)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: animations must be shorter than ${h/1e3}s`),!1;if(o){const c=O(),p=H(...n.toScreen(c,...i.center)),d=H(...i.toScreen(c,...n.center)),m=d!=null&&d.x>-(1.5-.5)*i.size[0]&&d.x<(1.5+.5)*i.size[0]&&d.y>-(1.5-.5)*i.size[1]&&d.y<(1.5+.5)*i.size[1],u=p!=null&&p.x>-(1.5-.5)*n.size[0]&&p.x<(1.5+.5)*n.size[0]&&p.y>-(1.5-.5)*n.size[1]&&p.y<(1.5+.5)*n.size[1];if(z("esri-goto-debug")&&(console.log(`dest is within ${1.5} screens at start view:`,m),console.log(`start is within ${1.5} screens at dest view:`,u)),s>fs/a&&!m&&!u)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: linear animations must be... +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Popup-DFFZHG5j-Bitz07Ss.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-Doly9N9p.js","./story-DbFhYdqg.css","./substitute-j49H6mVR-DTufu01J.js","./themeUtils-YjM7iIiX-DGrOr3vp.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./ReactiveSet-QxEZenFW-tC7C9rTp.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./Cyclical-C_9rKUUQ-DyGueJyk.js","./AttachmentInfo-D9RFO8W2-CMU9-WNo.js","./RelationshipQuery-DJsz3K0U-BKFa46R1.js","./Query-BrwMGK8U-BPr0_G9t.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./utils-DyydRFHu-1ITtOELE.js","./Basemap-BEqqSTw9-yGsB1EL7.js","./loadAll-e978YItg-4pMG3qU7.js","./PortalItem-CctGdnxF-CfFOGshS.js","./writeUtils-D5qlLkwk-enZap9KW.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-6clJxb1Q.js","./common-CYWrYyJl-E8-sukrT.js","./RendererLegendOptions-K3md58-X-JLOOdHLz.js","./utils-DPtQ14k3-CBDffBYM.js","./parser-DyDJ-rlI-CvOs11Ip.js","./cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js","./utils-SPbpQbmm-CiwW7WzR.js","./enums-CpSG_SL3-BMD3Tb1v.js","./LRUCache-C3erQTWv-grHgYSP-.js","./jsonUtils-C64Zfu7c-BtrwAD3_.js","./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js","./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js","./colorRamps-q0bZVhs2-BnivlaV9.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-tyrXoPjU.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js","./styleUtils-BtpNqZyT-Bnq2S5kK.js","./Version-CoKzbupV-BDyz4v43.js","./FieldsIndex-HmzMbJQG-Du7S47uJ.js","./UnknownTimeZone-C--TOcPG-9of9030I.js","./OverrideHelper-DWRbVlj1-BnPmqHJ3.js","./colorUtils-Cthpxcks-cHaMZbaf.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./quantizationUtils-bJy1cRwp-DFYZs_ns.js","./heatmapUtils-seiMkkkR-CrSLbaQx.js","./executeQueryJSON-CcHnccia-M-vnTvKl.js","./utils-9sQxfkoa-D8FX0sO8.js","./query-DFW9-NG_-C3TyGmiM.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-Bq23Xwmj-CKlS81kz.js","./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js","./pbf-D-y3_eZO-CpHdkhuD.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-B7zp5L1G.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./FeatureSet-BkVNthuN-DPQqwkNN.js","./shared-D1w-26bA-BBIRhcUQ.js","./TimeOnly-DSMefxKy-BHvJbNji.js","./FeatureLayer-BrRKw5Si-DuA2fyE_.js","./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js","./commonProperties-BtIqvFU_-DbZji2Rx.js","./ElevationInfo-yv2-9tj6-CkIHeL1t.js","./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js","./HeightModelInfo-C5vFqzyF-BH6aliHn.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js","./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js","./Relationship-PyhUibYK-DN6K3ukS.js","./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js","./Layer-ChoECxvZ-BmDHBjO8.js","./workers-PiCjreoO-Dc6Tqm-o.js","./editsZScale-BDsX6vv--C-4n90TZ.js","./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js","./ArcGISService-BYA-y6X6-DNHMEBm_.js","./BlendLayer-D1WkSmwP-BeUsb4u9.js","./jsonUtils-wIllKWI4-MQQ-E5fj.js","./CustomParametersMixin-vdKsTHer-5EfrrVMH.js","./EditBusLayer-Df29OyJh-OmdJOLws.js","./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js","./FeatureEffect-CDEk9Es7-Cd4-I1fy.js","./FeatureFilter-BCFHgLVU-DwigNbnH.js","./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js","./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js","./labelingInfo-DGVNul26-BDBqWm17.js","./labelUtils-BW14kBqX-Tk7uOiPw.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-DTTV2F9z.js","./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js","./OrderByInfo-GD2XnU8e-BaEpZLaO.js","./PortalLayer-CElnYuSQ-CCe4TMEA.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./RefreshableLayer-a8BQ58Xh-CxfquKbp.js","./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js","./TemporalLayer-CpOrN_w9-8nvJFP_-.js","./TimeInfo-w_HB2CsF-B2qHZyfS.js","./FeatureTemplate-SPHPD45f-CZ7E6_6b.js","./FeatureType-C9hJmS6_-CNlvn5D1.js","./fieldProperties-Bq26w7gt-BiKrD4ue.js","./versionUtils-LZYZz-38-B8C5OAjF.js","./styleUtils-ChrJTYIw-C6xq7Jeu.js","./popupUtils-B0uZcXX0-DHyOz1jC.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./ReactiveMap-CFk6jPfN-CSefy1PZ.js","./Tile-D75RMC64-g8Sx5TPr.js","./TileKey-C5IL-JBr-BGwa3-Dg.js","./vec2-tHZ6OaOy-xCj1obDt.js","./QueueProcessor-DbfV9fLy-2F5OgLgJ.js","./signal-CETehA7D-DQA5V72u.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./layerViewUtils-DURAPenP-BGA3o1Pf.js","./CollectionFlattener-DkHuHn5E-dp3hDI2N.js","./TileInfo-CWIRDhZl-RqA7tkOZ.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./UpdatingHandles-CUu3u1ms-DHvcjtvD.js","./Map-1zd11DKO-Bme1mjOQ.js","./TablesMixin-C8RojhYs-LCBvmsnP.js","./GraphicsCollection-CWTXNZOX-BdlDfR8M.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DriQgzLZ.js","./vec32-D9GsKZ1t-BPSFE14A.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-Dk2JyWCy.js","./imageUtils-BA2D6Uf1-CYx0DlwL.js","./capabilities-agoTWNzb-CtsNgRyk.js","./ColorBackground-gVZldRLm-Dca2T4QI.js","./geometryServiceUtils-nsujb7BH-BeXUhRCo.js","./project-DQKhruav-CyFgbMSU.js","./webglDeps-Bgavuh0h-31Q0Fngh.js","./BufferObject-BM_7mcDb-EYaqMhmk.js","./Program-DLVwTiPA-DI0GKSfI.js","./NestedMap-Ddo7BfvO-BpVPk8mz.js","./ProgramTemplate-DQOm6Omy-yxBgwK3o.js","./VertexArrayObject-M4iRGGoi-BvRnjYBj.js","./mapViewDeps-CUVU8gUp-CjUjdWc1.js","./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js","./BidiEngine-Bdqv5H5j-Dyqh9XG-.js","./GeometryUtils-NHgB9gGQ-DtpzGERq.js","./Rect-DD6XS68q-D_hsV3ag.js","./LabelMetric-BeluzH3o-Br-5CSAC.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./BindType-9iOk18Ed-CRW1cdX4.js","./Util-BjGjeg6f-08Szkf4F.js","./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js","./constants-Bqe1QJ4u-F8oTIn7N.js","./WGLContainer-LxgEo4I_-uPdq0FyK.js","./vec3f32-BS0cezmI-B_madU1n.js","./Container-BcuL1ZEG-DVZvemLA.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./config-nuMERBvb-MDUrh2eL.js","./earcut-XDcq3zAf-BcwyrT7l.js","./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js","./SDFHelper-B6k8Ig6R-CgiA_-9V.js","./floatRGBA-4pIJN00G-Cz2BV8ih.js","./PieChartMeshWriter-C5yLDFwp-5CAejpYY.js","./TurboLine-CIlsAy5m-C6Kc2De-.js","./enums-qHpGJ28Q-CmnLAccm.js","./GridShader-75bC4UUM-BeEFXp4m.js","./CircularArray-DaQg3PQl-BXS52LZy.js","./testSVGPremultipliedAlpha-DoZe_f0d-BwcxFsN9.js","./AttributeStore-DjyP9U7y-Cmhm9XHS.js","./timeSupport-jPViR5jn-7bshRI7L.js","./queryUtils-Brxu6254-CDiE0zms.js","./json-BI97KiBB-Ce5cWfI2.js","./RenderingContext-DbCVbtGZ-Bdgqeuyk.js","./renderState-Dap0WV9P-D4IHxyei.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js","./rasterizingUtils-BmlDdKBf-BP52xgN-.js","./utils-Dcs650Ic-LHpLlTO1.js","./grouping-RwmXkHDc-CCFLL7L_.js","./MeshWriterRegistry-CIC9Yk_f-7OXlu7fG.js","./GraphicsView2D-C4wYE2ut-DdVMjjMv.js","./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js","./GraphicContainer-DuOHUciE-XlTfJEn3.js","./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js","./TechniqueInstance-DGTKoOL6-CABoCcdk.js","./TileContainer-D48pXXgL-BzDz3Uqo.js","./requestImageUtils-Ut4YcoNU-CZnNufeN.js","./scaleUtils-DxsfQwK1-CzyfErWH.js","./geodesicUtils-B8mFUfTk-BNOCxMeb.js","./TileLayerView2D-CT-Yu10P-B6hAJ5mA.js","./imageUtils-Co-ELErj-D3GFlUnZ.js","./Bitmap-CcqmzvfR-C22fE2NY.js","./LayerView-Bish-E63-DK1SFHE3.js","./HighlightGraphicContainer-Dt5r6lMq-CwALk6za.js","./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js","./MapServiceLayerViewHelper-bw3M4B8s-UNSGy25k.js","./languageUtils-BYxF9hRA-DnySuvAL.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./number-eRKYXfX9-bCdnHRN-.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./drapedUtils-BZ1SGPtE-bBUh2hex.js","./sublayerUtils-CyM0QC5B-B1ryunQi.js","./popupUtils-nV1O8RUO-BYG2KoFf.js","./FeatureLayerView2D-NmRd_IhT-DLbw0NYz.js","./timeSupport-ohWmWReZ-D2lpSlXU.js","./HighlightCounter-DFWq7PnG-L3ompOf4.js","./BaseDynamicLayerView2D-AQ-6l0DU-CktIES_E.js","./BitmapContainer-BC8fvmFc-C6Z_3UuF.js","./ExportStrategy-BNE7Gp0u-CHHOPUHq.js","./CatalogLayerView2D-DaUVeBuS-B6e9UrTB.js","./CatalogDynamicGroupLayerView2D-Cf-H7gda-BH_FQvA5.js","./CatalogFootprintLayerView2D-C0bBWVdF-CXy1ArWp.js","./GeoRSSLayerView2D-BLTYupUX-D6HtIAUl.js","./GraphicsLayerView2D-CGXlTqHO-BL8cF9rd.js","./GroupLayerView2D-BR-kLeLa-CBq3r1hE.js","./ImageryLayerView2D-CVDvTIGY-BlDqRH6r.js","./RasterVFDisplayObject-CnriTVT9-CVvMEEVD.js","./dataUtils-BkPy4R3C-Dzc1QGGb.js","./rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js","./ImageryTileLayerView2D-nEz2YhMc-DxH8Z9x7.js","./multidimensionalUtils-BwTugeu7-C75LYPc9.js","./rasterUtils-DqAu9qES-Be2s-rDn.js","./RawBlockCache-Cj_tmHDm-gcQCDGFb.js","./KMLLayerView2D-hWgNYT5J-BiL2CcA0.js","./kmlUtils-C5oIEoOy-CPvy9nME.js","./KnowledgeGraphLayerView2D-BnEbgXue-BmCZP-QP.js","./MapImageLayerView2D-LI7T-1xm-ZTi6guUq.js","./ExportImageParameters-DxyNGQ57-D1Dwm6AT.js","./MapNotesLayerView2D-EusnP8A_-53usLcYc.js","./MediaLayerView2D-COWFkA3m-B8oTarjg.js","./perspectiveUtils-Bu88xlbg-Cn6YpKwC.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./OverlayContainer-BEHcBpu0-4o7Hmqgb.js","./OGCFeatureLayerView2D-CpSy5D2s-DSwmstmQ.js","./RouteLayerView2D-Bpui7Ggx-Dq8ar2NW.js","./Stop-he5xSAJJ-BA1tUkNc.js","./StreamLayerView2D-Bh_aEalU-wWSqPGq-.js","./SubtypeGroupLayerView2D-Byn0xzbb-DtCv0vxF.js","./VectorTileLayerView2D-B9OYHbL4-ANKZ9nt1.js","./PooledRBush-DbfAmeLn-CPHfm9op.js","./SourceLayerData-BT_Ywuvg-D7mjpcmo.js","./StyleRepository-D3WuVprR-B1BVbhGB.js","./VideoLayerView2D-CLcxq4ZA-C6WSWoOW.js","./GraphicsLayer-DfeGaYc1-DRpZ_f0G.js","./TelemetryDisplay-Bq2PXfI8-BY_FrklG.js","./WMSLayerView2D-Dz-z-fa9-D5YTL9WO.js","./ExportWMSImageParameters-CMk80WSM-wEv_P_PY.js","./WMTSLayerView2D-Bl5FUDUu-DwwTnV3d.js","./calcite-button-Cm9_TJei-DvwKP8jU.js","./form-CRSw616T-wY3ZjFlq.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-BbTDbq0n.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-CSXrQx_7.js","./locale-Cn_GDVD_-CCUxSwPB.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-CfIXp3Nz.js","./t9n-C_hcZMZJ-Du2NPCXI.js","./icon-BXFbBbop-Bq4Zv26A.js","./loader-Ch7Jr16w-CF4bv9QO.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-8qK5FfMb.js"])))=>i.map(i=>d[i]); +import{_ as b}from"./main-QGPoLsvl.js";import{v as r,S as l,i as _,aa as js,e as cn,w as V,ab as bt,ac as ka,a0 as Ea,ad as Bt,ae as ke,af as Ca,g as Vn,K as z,I as hi,ag as L,ah as w,ai as ci,aj as Ia,ak as Ft,al as st,am as Da,an as Ra,ao as On,ap as La,aq as ni,j as M,ar as Pt,as as H,C as Va,at as Oa,au as qs,av as Ee,o as C,aw as pn,ax as ct,ay as dn,az as Aa,a1 as D,aA as tt,aB as An,aC as pi,aD as za,aE as Na,aF as Ce,n as Xt,J as si,aG as Bs,aH as un,aI as mn,aJ as Ks,p as Ys,aK as Fa,h as Ha,aL as U,aM as Za,a2 as di,aN as it,l as Xs,aO as Ga,aP as $a,b as ui,aQ as Wa,aR as bi,aS as Qs,aT as Ua,aU as Js,B as ja,aV as Re,aW as ji,x as qa,aX as Ba,t as to,aY as eo,aZ as de,$ as Ot,a_ as Ka,a$ as Ya,b0 as zn,b1 as Xa,b2 as Qa,b3 as Ja,b4 as tr,b5 as Nn,b6 as er,b7 as ir,b8 as nr,O as sr,b9 as Fn,ba as ze,L as or,bb as ar,bc as rr,bd as Hn,be as lr,bf as hr,E as Ti,bg as cr,d as io,bh as Ne,bi as pr,bj as gn,bk as dr,bl as Fe,bm as ur,bn as X}from"./story-Doly9N9p.js";import{c as mr}from"./Cyclical-C_9rKUUQ-DyGueJyk.js";import{f as no}from"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import{F as gr,B as Zn}from"./workers-PiCjreoO-Dc6Tqm-o.js";import{K as Le,B as yr,_ as yn,J as _n,W as fn}from"./projection-BA9M1R7d-CAbqHZiw.js";import{d as _r,V as fr}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import{z as vr,H as wr,_ as mi,o as Gn,K as so,q as br,R as gi,P as B,k as vn,X as Tr,V as $n}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{i as yi}from"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import{o as Mr}from"./signal-CETehA7D-DQA5V72u.js";import xr from"./Map-1zd11DKO-Bme1mjOQ.js";import{o as oo,u as Wn,s as Pr}from"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import{M as wn}from"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import{k as Sr}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import{v as Mi}from"./TablesMixin-C8RojhYs-LCBvmsnP.js";import{h as kr}from"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import{b as Un}from"./Query-BrwMGK8U-BPr0_G9t.js";import{i as Er}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{l as jn}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{o as O,e as Cr}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{m as N,v as _i,T as ao,i as qi,j as qn,A as Ir,S as Dr,h as Bn,b as Rr,L as Tt,d as Se,f as Lr,_ as Vr}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{r as ro,n as xi}from"./common-CYWrYyJl-E8-sukrT.js";import{s as Or,t as lo,Q as Ar,U as ho,l as zr,n as co,e as bn,i as oi,V as Nr,Z as Kn,k as Fr,o as Hr}from"./Tile-D75RMC64-g8Sx5TPr.js";import{c as Tn,a as Zr}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{Q as Gr,R as $r,C as Yn,D as Wr,E as Ur}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as Xn}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{r as jr,F as qr}from"./unitBezier-CGtWxaCq-BRwEDigF.js";import{W as Br,u as Pi}from"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import{s as Kr}from"./TileKey-C5IL-JBr-BGwa3-Dg.js";import{L as Yr}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{e as He,u as Xr,i as Qr,t as Qn}from"./definitions-DJSdSb77-DkoRHaVx.js";import{L as Jr,D as Si,G as tl}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as el,V as il}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{y as nl}from"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import{n as sl}from"./capabilities-agoTWNzb-CtsNgRyk.js";import{m as ol}from"./Version-CoKzbupV-BDyz4v43.js";import al from"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";let Ht=class extends $a{constructor(t){super(t),this.row=0,this.column=0,this.rows=1,this.columns=1}equals(t){return t!=null&&this.row===t.row&&this.rows===t.rows&&this.column===t.column&&this.columns===t.columns}};r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"row",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"column",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"rows",void 0),r([l({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Ht.prototype,"columns",void 0),Ht=r([_("esri.CameraLayout")],Ht);const po=Ht;let at=class extends js(cn){constructor(...t){super(...t),this.position=new V([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new po}normalizeCtorArgs(t,e,i,n){if(t&&typeof t=="object"&&("x"in t||Array.isArray(t))){const s={position:t};return e!=null&&(s.heading=e),i!=null&&(s.tilt=i),n!=null&&(s.fov=n),s}return t}writePosition(t,e,i,n){const s=t.clone();s.x=bt(t.x||0),s.y=bt(t.y||0),s.z=t.hasZ?bt(t.z||0):t.z,e[i]=s.write({},n)}readPosition(t,e){const i=new V;return i.read(t,e),i.x=bt(i.x||0),i.y=bt(i.y||0),i.z=i.hasZ?bt(i.z||0):i.z,i}equals(t){return t!=null&&this.tilt===t.tilt&&this.heading===t.heading&&this.fov===t.fov&&this.position.equals(t.position)&&this.layout.equals(t.layout)}};r([l({type:V,json:{write:{isRequired:!0}}})],at.prototype,"position",void 0),r([ka("position")],at.prototype,"writePosition",null),r([Ea("position")],at.prototype,"readPosition",null),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>mr.normalize(bt(t)))],at.prototype,"heading",void 0),r([l({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Bt(t=>ke(bt(t),-180,180))],at.prototype,"tilt",void 0),r([l({type:Number,nonNullable:!0,json:{default:55,write:!0}}),Bt(t=>ke(bt(t,55),1,170))],at.prototype,"fov",void 0),r([l({type:po,nonNullable:!0,json:{read:!1,write:!1}})],at.prototype,"layout",void 0),at=r([_("esri.Camera")],at);const rl=at;var Bi;let Et=Bi=class extends cn{constructor(t){super(t),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(t){return(t%=360)<0&&(t+=360),t}clone(){return new Bi({rotation:this.rotation,scale:this.scale,targetGeometry:this.targetGeometry!=null?this.targetGeometry.clone():null,camera:this.camera!=null?this.camera.clone():null})}};r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"rotation",void 0),r([Bt("rotation")],Et.prototype,"castRotation",null),r([l({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:ki}}}}})],Et.prototype,"scale",void 0),r([l({types:Ca,json:{read:Vn,write:!0,origins:{"web-scene":{read:Vn,write:{overridePolicy:ki}}}}})],Et.prototype,"targetGeometry",void 0),r([l({type:rl,json:{write:!0}})],Et.prototype,"camera",void 0),Et=Bi=r([_("esri.Viewpoint")],Et);const nt=Et;function ki(){return{enabled:!this.camera}}const Be={widthBreakpoint:{getValue(t){const e=t.viewSize[0],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.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(t){const e=t.viewSize[1],i=t.breakpoints,n=this.values;return e<=i.xsmall?n.xsmall:e<=i.small?n.small:e<=i.medium?n.medium:e<=i.large?n.large:n.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(t){const e=t.viewSize,i=e[0],n=e[1],s=this.values;return n>=i?s.portrait:s.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},Ei={xsmall:544,small:768,medium:992,large:1200};function ll(t){const e=t;return e&&e.xsmall{let e=class extends t{constructor(...i){super(...i),this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=Ei}initialize(){this.addHandles(w(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),U))}destroy(){this.destroyed||this._removeActiveClassNames()}set breakpoints(i){if(i!==this._get("breakpoints")){if(!ll(i)){const n=JSON.stringify(Ei,null,2);console.warn("provided breakpoints are not valid, using defaults:"+n),i=Ei}this._set("breakpoints",{...i})}}_updateClassNames(){if(!this.container)return;const i=ze.acquire(),n=ze.acquire();let s,o=!1;for(s in Be){const a=this[s],h=Be[s].getValue({viewSize:this.size,breakpoints:this.breakpoints});a!==h&&(o=!0,this[s]=h,Ci(s,a).forEach(c=>n.push(c)),Ci(s,h).forEach(c=>i.push(c)))}o&&(this._applyClassNameChanges(i,n),ze.release(i),ze.release(n))}_applyClassNameChanges(i,n){const s=this.container;s&&(n.forEach(o=>s.classList.remove(o)),i.forEach(o=>s.classList.add(o)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let n;for(n in Be)Ci(n,this[n]).forEach(s=>i.classList.remove(s))}};return r([l()],e.prototype,"breakpoints",null),r([l()],e.prototype,"orientation",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),r([l()],e.prototype,"heightBreakpoint",void 0),e=r([_("esri.views.BreakpointsOwner")],e),e};let Ct=class extends M{constructor(){super(...arguments),this.items=new L,this._watchUpdatingTracking=new yi,this._callbacks=new Map,this._projector=Gn(),this._hiddenProjector=Gn()}get needsRender(){return this.items.length>0}get updating(){return this._watchUpdatingTracking?.updating??!1}initialize(){const t=document.createElement("div");t.className="esri-overlay-surface",this._set("surface",t),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),t.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,e=>{for(const i of e.added){const n=()=>i.render();this._callbacks.set(i,n),this._projector.append(this.surface,n)}for(const i of e.removed){const n=this._projector.detach(this._callbacks.get(i));this.surface.removeChild(n.domNode),this._callbacks.delete(i)}})}addItem(t){this.items.add(t)}removeItem(t){this.items.remove(t)}destroy(){this.items.removeAll(),this._callbacks.forEach(t=>this._projector.detach(t)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(t){const e=this._hiddenSurface,i=this._hiddenProjector;let n;const s=()=>(n=t.render(),n);i.append(e,s),i.renderNow();const o={left:0,top:0,right:0,bottom:0};if(n?.domNode){const a=n.domNode.getBoundingClientRect();o.left=a.left,o.top=a.top,o.right=a.right,o.bottom=a.bottom}for(i.detach(s);e.firstChild;)e.removeChild(e.firstChild);return o}overlaps(t,e){const i=this.computeBoundingRect(t),n=this.computeBoundingRect(e);return Math.max(i.left,n.left)<=Math.min(i.right,n.right)&&Math.max(i.top,n.top)<=Math.min(i.bottom,n.bottom)}get hasVisibleItems(){return this.items.some(t=>t.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(t,e){const i=!!e?.disableDecorations;if(!this.items.some(s=>s.visible&&!(i&&s.isDecoration)))return;const n=t.getContext("2d");n.save(),n.font=this._fontString(),this.items.forEach(s=>{i&&s.isDecoration||(n.save(),s.renderCanvas(n),n.restore())}),n.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};r([l({readOnly:!0})],Ct.prototype,"surface",void 0),r([l({readOnly:!0})],Ct.prototype,"items",void 0),r([l({readOnly:!0})],Ct.prototype,"needsRender",null),r([l({readOnly:!0})],Ct.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],Ct.prototype,"updating",null),Ct=r([_("esri.views.overlay.ViewOverlay")],Ct);const Jn=Ct,Ii=[0,0];function cl(t){const e=(t.ownerDocument||window.document).defaultView,i=t.getBoundingClientRect();return Ii[0]=i.left+(e?.pageXOffset??0),Ii[1]=i.top+(e?.pageYOffset??0),Ii}function ts(t){t&&(t.textContent="",t.parentNode&&t.parentNode.removeChild(t))}function pl(t){const e=document.createElement("div");return t.appendChild(e),e}const me=16,Ze=750,dl=512,ul=2,ml=t=>{let e=class extends t{constructor(...i){super(...i),this._freqInfo={freq:me,time:Ze},this._overlayRenderTaskHandle=null,this.height=0,this.messagesCommon=null,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,this.addHandles([w(()=>this.cursor,n=>{const{surface:s}=this;s&&s.setAttribute("data-cursor",n)}),w(()=>this.navigating,n=>{const{surface:s}=this;s&&s.setAttribute("data-navigating",n.toString())})])}initialize(){this.addHandles([w(()=>this.ui,(i,n)=>this._handleUIChange(i,n),U),this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=tt(this.ui),this.container=null)}get container(){return this._get("container")??null}set container(i){const n=this._get("container"),s=so(i);if(s||typeof i!="string"||D.getLogger(this).error("#container",`element with id '${i}' not found`),n===s)return;if(this._stopMeasuring(),n&&(n.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(ts(this.root),this._set("root",null)),this.userContent&&($n(this.userContent,n),ts(this.userContent),this._set("userContent",null))),!s)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);s.classList.add("esri-view");const o=document.createElement("div");o.className="esri-view-user-storage",$n(s,o),s.appendChild(o),this._set("userContent",o);const a=document.createElement("div");a.className="esri-view-root",s.insertBefore(a,s.firstChild),this._set("root",a);const h=document.createElement("div");h.className="esri-view-surface",h.setAttribute("role","application"),h.tabIndex=0,a.appendChild(h),this._set("surface",h);const c=new Jn;a.appendChild(c.surface),this._set("overlay",c),this.addHandles(w(()=>c.needsRender,p=>{p&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=de({render:()=>this.overlay?.render()}):this._overlayRenderTaskHandle=st(this._overlayRenderTaskHandle)})),this.forceDOMReadyCycle(),this._set("container",s),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}get size(){return[this.width,this.height]}blur(){this.surface?.blur()}focus(){this.surface?.focus()}pageToContainer(i,n,s){const o=this.position;return i-=o?o[0]:0,n-=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}containerToPage(i,n,s){const o=this.position;return i+=o?o[0]:0,n+=o?o[1]:0,s?(s[0]=i,s[1]=n):s=[i,n],s}_handleUIChange(i,n){this.removeHandles("ui"),n&&n!==i&&n.destroy(),i&&(i.view=this,this.addHandles(w(()=>this.root,s=>{i.container=s?pl(s):null},U),"ui")),this._set("ui",i)}_stopMeasuring(){this.removeHandles("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=me,i.time=Ze,this.addHandles([or(window,"resize",()=>{i.freq=me,i.time=Ze}),de({prepare:n=>{const s=this._measure(),o=this._freqInfo;if(o.time+=n.deltaTime,s&&(o.freq=me,this._get("resizing")||this._set("resizing",!0)),o.time=dl&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,n=i?i.clientWidth:0,s=i?i.clientHeight:0;if(n===0||s===0)return this.suspended||this._set("suspended",!0),!1;const o=this.width,a=this.height;return n===o&&s===a?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",n),this._set("height",s),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:o,oldHeight:a,width:n,height:s}),!0)}_position(){const i=this.container,n=this.position,s=i&&cl(i);return!!s&&(!n||s[0]!==n[0]||s[1]!==n[1])&&(this._set("position",[s[0],s[1]]),!0)}forceDOMReadyCycle(){}};return r([l()],e.prototype,"container",null),r([l({readOnly:!0})],e.prototype,"focused",null),r([l({readOnly:!0})],e.prototype,"height",void 0),r([l()],e.prototype,"messagesCommon",void 0),r([l({type:Jn})],e.prototype,"overlay",void 0),r([l({readOnly:!0})],e.prototype,"position",void 0),r([l({readOnly:!0})],e.prototype,"resizing",void 0),r([l({readOnly:!0})],e.prototype,"root",void 0),r([l({value:null,readOnly:!0})],e.prototype,"size",null),r([l({readOnly:!0})],e.prototype,"surface",void 0),r([l({readOnly:!0})],e.prototype,"suspended",void 0),r([l()],e.prototype,"ui",void 0),r([l({readOnly:!0})],e.prototype,"userContent",void 0),r([l({readOnly:!0})],e.prototype,"width",void 0),r([l()],e.prototype,"widthBreakpoint",void 0),e=r([_("esri.views.DOMContainer")],e),e},gl=z("mac")?"Meta":"Control",yl=new Set(["Alt","Control","Meta","Shift","Ctrl","Primary"]),_l=t=>yl.has(t);let fl=class{constructor(t,e=[]){this.eventType=t,this.keyModifiers=e}matches(t){if(t.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const e=t.modifiers;for(const i of this.keyModifiers)if(!e.has(i))return!1;return!0}},A=class{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 e=this._incoming[t];for(const i of e)this._incomingEventMatches.push(i.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||(t.setEventCallback(e=>this._handleEvent(e)),t.setUninstallCallback(()=>this._onUninstall()),this._manager=t)}onUninstall(){}registerIncoming(t,e,i){let n;typeof e=="function"?(i=e,n=[]):n=e||[];const s=typeof t=="string"?new fl(t,n):t,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=p=>{const d=this._incoming[p.match.eventType];if(d){const m=d.indexOf(p);d.splice(m,1),o(),this._manager&&this._manager.updateDependencies()}},h=new vl(s,i,{onPause:a,onRemove:a,onResume:p=>{const d=this._incoming[p.match.eventType];d&&!d.includes(p)&&(d.push(p),o(),this._manager&&this._manager.updateDependencies())}});let c=this._incoming[s.eventType];return c||(c=[],this._incoming[s.eventType]=c),c.push(h),o(),this._manager&&this._manager.updateDependencies(),h}registerOutgoing(t){if(this._outgoing[t])throw new Error("There is already a callback registered for this outgoing InputEvent: "+t);const e=new wl(t,{onEmit:(i,n,s,o)=>{this._manager?.emit(i.eventType,n,s,o)},onRemove:i=>{delete this._outgoing[i.eventType],this._manager?.updateDependencies()}});return this._outgoing[t]=e,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),e}startCapturingPointer(t){this._manager?.setPointerCapture(t,!0)}stopCapturingPointer(t){this._manager?.setPointerCapture(t,!1)}refreshHasPendingInputs(){this._manager?.refreshHasPendingInputs()}_onUninstall(){this._manager&&(this.onUninstall(),this._manager=null)}_handleEvent(t){const e=this._incoming[t.type];if(e){for(const i of e)if(i.match.matches(t)&&(i.callback?.(t),t.shouldStopPropagation()))break}}},vl=class{constructor(t,e,i){this.match=t,this._callback=e,this._handler=i}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}},wl=class{constructor(t,e){this.eventType=t,this._removed=!1,this._handler=e}emit(t,e,i){this._removed||this._handler.onEmit(this,t,e,i)}remove(){this._removed=!0,this._handler.onRemove(this)}},bl=class extends A{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",e=>this._update(e.data))}_update(t){const e=t.native.pointerType==="touch"?"touch":"mouse",{x:i,y:n}=t;e===this._value&&this._x===i&&this._y===n||(this._value=e,this._x=i,this._y=n,this._onChange(e,i,n))}},Tl=class extends A{get multiTouchActive(){return this._multiTouchActive.value}constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=Mr(!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)}_update(){this._multiTouchActive.value=this._activeTouchPointerIds.size>1}},Ml=class{constructor(t,e){this._owner=e,this._properties={},this._afterDispatchHandle=null;for(const i in t){const n=t[i],s=new ar(n,void 0,void 0,2,2);this._properties[i]={pool:s,acquired:[]}}this._afterDispatchHandle=rr(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const t in this._properties){const e=this._properties[t];for(const i of e.acquired)Hn(i)||e.pool.release(i);e.pool.destroy(),e.pool=null,e.acquired=null}this._properties=null,this._owner=null}get(t){const e=this._owner._get(t),i=this._properties[t];let n=i.pool.acquire();for(i.acquired.push(n);n===e;)i.acquired.push(n),n=i.pool.acquire();return n}_release(){for(const t in this._properties){const e=this._properties[t];let i=0;for(const n of e.acquired)Hn(n)?e.acquired[i++]=n:e.pool.release(n);e.acquired.length=i}}},Q=class extends M{constructor(t){super(t),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=gl,this._latestPointerType="mouse",this._propertiesPool=new Ml({latestPointerLocation:Sl},this),this.latestPointerLocation=null,this._paused=!1,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const t=Object.keys(this._nameToGroup);for(const e of t)this.uninstallHandlers(e);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(t=>t.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get updating(){return this.hasPendingInputs||this._paused}installHandlers(t,e,i=At.INTERNAL){if(this._nameToGroup[t]||e.length===0)return;const n={name:t,handlers:e.map(s=>({handler:s,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[t]=n;for(let s=n.handlers.length-1;s>=0;s--){const o=n.handlers[s];this._handlers.push(o),o.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(a,h,c,p,d)=>{this._emitInputEvent(o.priorityIndex+1,a,h,c,d,p)},setPointerCapture:(a,h)=>{this._setPointerCapture(n,o,a,h)},setEventCallback:a=>{o.eventCallback=a},setUninstallCallback:a=>{o.uninstallCallback=a},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(t){const e=this._nameToGroup[t];e?(e.handlers.forEach(i=>{i.removed=!0,i.uninstallCallback?.()}),delete this._nameToGroup[t],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):D.getLogger(this).error("There is no InputHandler group registered under the name `"+t+"`")}hasHandlers(t){return this._nameToGroup[t]!==void 0}isModifierKeyDown(t){return this._activeKeyModifiers.has(t)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const t=new Set,e=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const n=this._handlers[i];n.priorityIndex=i,this._handlersPriority.push(n)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const n=this._handlersPriority[i];n.priorityIndex=i;let s=n.handler.hasSideEffects;if(!s){for(const o of n.handler.outgoingEventTypes)if(t.has(o)){s=!0;break}}if(s)for(const o of n.handler.incomingEventMatches){t.add(o.eventType);for(const a of o.keyModifiers)_l(a)||e.add(a)}n.active=s}this._sourceEvents=t,this._keyModifiers=e,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(t,e,i){this._latestPointerType=t;const n=this._get("latestPointerLocation");if(n==null||n.x!==e||n.y!==i){const s=this._propertiesPool.get("latestPointerLocation");s.x=e,s.y=i,this._set("latestPointerLocation",s)}}_onEventReceived(t,e){if(t==="pointer-capture-lost"){const s=e;this._pointerCaptures.delete(s.native.pointerId)}this._updateKeyModifiers(t,e);const i=this.test.timestamp!=null?this.test.timestamp:e.native?e.native.timestamp:void 0,n=e.native?e.native.cancelable:void 0;this._emitInputEventFromSource(t,e,i,n)}_updateKeyModifiers(t,e){if(!e)return;let i=!1;const n=()=>{i||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),i=!0)},s=(a,h)=>{h&&!this._activeKeyModifiers.has(a)?(n(),this._activeKeyModifiers.add(a)):!h&&this._activeKeyModifiers.has(a)&&(n(),this._activeKeyModifiers.delete(a))};if(t==="key-down"||t==="key-up"){const a=e.key;this._keyModifiers.has(a)&&s(a,t==="key-down")}const o=e.native;s("Alt",!!o?.altKey),s("Control",!!o?.ctrlKey),s("Ctrl",!!o?.ctrlKey),s("Shift",!!o?.shiftKey),s("Meta",!!o?.metaKey),s("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new bl((t,e,i)=>this._setLatestPointer(t,e,i)),this._multiTouchHandler=new Tl,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],At.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,At.INTERNAL)}_setPointerCapture(t,e,i,n){const s=t.name+"-"+e.priorityIndex,o=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,o),n?(o.add(s),o.size===1&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):o.has(s)&&(o.delete(s),o.size===0&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(t=>!t.removed),this.updateDependencies()}_emitInputEventFromSource(t,e,i,n){this._emitInputEvent(0,t,e,i,n)}_emitInputEvent(t,e,i,n,s,o){const a=n!==void 0?n:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),h=s!==void 0&&s,c={event:new xl(e,i,a,o||this._activeKeyModifiers,h),priorityIndex:t};this._currentPropagation?this._currentPropagation.events.push(c):this._doNewPropagation(c)}_doNewPropagation(t){this._currentPropagation={events:new Zn,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:t.event.timestamp},this._currentPropagation.events.push(t),this._continuePropagation()}_continuePropagation(){this._paused=!1;const t=this._currentPropagation;if(t){for(;t.events.length>0;){const{event:e,priorityIndex:i}=t.events.pop(),n=e.data?.eventId;if(!(n!=null&&this._stoppedPropagationEventIds.has(n)))for(t.currentHandler=this._handlersPriority[i];t.currentHandler;){if(t.currentHandler.removed)t.needsHandlerGarbageCollect=!0;else{if(t.currentHandler.active&&!e.shouldStopPropagation()&&t.currentHandler.eventCallback?.(e),e.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(e.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:e,priorityIndex:t.currentHandler.priorityIndex+1})}t.currentHandler=this._handlersPriority[t.currentHandler.priorityIndex+1]}}t.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(t){const e=new Zn;e.push(t);const i=this._currentPropagation;if(i){for(;i.events.length;)e.push(i.events.pop());i.events=e,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(t,e){if(t.handler.hasSideEffects!==e.handler.hasSideEffects)return t.handler.hasSideEffects?1:-1;if(t.groupPriority!==e.groupPriority)return t.groupPriority>e.groupPriority?-1:1;for(const i of t.handler.incomingEventMatches)for(const n of e.handler.incomingEventMatches){if(i.eventType!==n.eventType)continue;const s=i.keyModifiers.filter(o=>n.keyModifiers.includes(o));if(s.length===i.keyModifiers.length!=(s.length===n.keyModifiers.length))return i.keyModifiers.length>n.keyModifiers.length?-1:1}return t.priorityIndex>e.priorityIndex?-1:1}_sortHandlersPriority(t){const e=[];for(const i of t){let n=0;for(;n=0;)n++;e.splice(n,0,i)}return e}get debug(){const t=e=>{const i=this._setPointerCapture;this._setPointerCapture=()=>{},e(),this._setPointerCapture=i};return{injectEvent:(e,i)=>{t(()=>this._onEventReceived(e,i))},disablePointerCapture:t}}};r([l({readOnly:!0})],Q.prototype,"hasPendingInputs",null),r([l({constructOnly:!0})],Q.prototype,"eventSource",void 0),r([l({constructOnly:!0})],Q.prototype,"recognizers",void 0),r([l()],Q.prototype,"_latestPointerType",void 0),r([l()],Q.prototype,"latestPointerType",null),r([l()],Q.prototype,"multiTouchActive",null),r([l({readOnly:!0})],Q.prototype,"latestPointerLocation",void 0),r([l()],Q.prototype,"_paused",void 0),r([l({readOnly:!0})],Q.prototype,"updating",null),Q=r([_("esri.views.input.InputManager")],Q);let xl=class{constructor(t,e,i,n,s){this.type=t,this.data=e,this.timestamp=i,this.modifiers=n,this.cancelable=s,this._propagationState=Vt.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=Vt.STOPPED}shouldStopPropagation(){return!!(this._propagationState&Vt.STOPPED)}async(t){this._propagationState|=Vt.PAUSED;const e=(i,n)=>{this._propagationState&=~Vt.PAUSED;const s=this._resumeCallback;if(this._resumeCallback=null,s&&s(),n)throw i;return i};return(typeof t=="function"?t():t).then(i=>e(i,!1),i=>e(i,!0))}shouldPausePropagation(t){return!!(this._propagationState&Vt.PAUSED)&&(this._resumeCallback=t,!0)}preventDefault(){this.data.native.preventDefault()}};var Vt;(function(t){t[t.NONE=0]="NONE",t[t.STOPPED=1]="STOPPED",t[t.PAUSED=2]="PAUSED"})(Vt||(Vt={}));const At={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};let Pl=class{};const Sl=Pl;function kt(t){return t!=null&&"open"in t&&"declaredClass"in t}function es(t){return t!=null&&"declaredClass"in t&&"dockOptions"in t}const kl=t=>{let e=class extends t{constructor(){super(...arguments),this._popupSetupTask=null,this.popup={},this.popupEnabled=!0}initialize(){this.addHandles([w(()=>[this.ui,this.popup],([i,n],s)=>{const o="popup",a="manual";if(s){const[h,c]=s;h&&kt(c)&&(c.view=null,es(c)&&h.remove(c,o))}i&&kt(n)&&(n.view=this,es(n)&&i.add(n,{key:o,position:a,internal:!0}))},U),this.on("click",i=>{this.popup&&this.popupEnabled&&(i.pointerType!=="mouse"||i.button===0)&&(kt(this.popup)?this.popup.viewModel.handleViewClick(i):i.async(async()=>{await this.setupPopup(),kt(this.popup)&&!this.destroyed&&this.ready&&this.popupEnabled&&this.popup.viewModel.handleViewClick(i)}))},At.WIDGET)]),pn(()=>this.ready&&this.popupEnabled&&!this.updating).then(()=>{b(()=>import("./Popup-DFFZHG5j-Bitz07Ss.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138]),import.meta.url)})}destroy(){this.destroyed||this.closePopup()}async openPopup(i){if(kt(this.popup))return this.popup.open(i);try{if(await this.setupPopup(),!this.popup)return void D.getLogger(this).error(new C("view:null-popup","Popup is null and can't be opened"));this.popup.open(i)}catch{}}closePopup(){this._popupSetupTask?.abort(),kt(this.popup)&&this.popup.close()}async fetchPopupFeatures(i,n){return await this.when(),this._popupHitsToFeatures(await this._getPopupHits(i,n),n)}async setupPopup(){if(this._popupSetupTask?.abort(),this.popup&&!kt(this.popup))return this._popupSetupTask=dn(async i=>{const{default:n}=await b(()=>import("./Popup-DFFZHG5j-Bitz07Ss.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138]),import.meta.url);if(Ot(i),!this.popup||kt(this.popup))return;const s=this.popup;delete s.open,delete s.close,this.popup=new n(s)}),this._popupSetupTask.promise}async _popupHitsToFeatures({location:i,hits:n},s){const o=[],a=[];let h=!1;const c=lr(s,z("popup-view-fetch-timeout")??Cl),p=u=>{const g=new El(u);return a.push(g),o.push(g.promise),g},d=u=>{const g=a.at(-1);return g&&g.layerView===u&&!h?g:p(u)};for(const u of n)"graphic"in u?(d(u.layerView).graphics.push(u.graphic),h=!1):(o.push(u.layerView.fetchPopupFeaturesAtLocation(u.mapPoint,c)),h=!0);a.map(u=>u.resolve(c));const m=hr(o).then(u=>u.filter(g=>!!g).flat());return{pendingFeatures:o,allGraphicsPromise:m,location:i}}async _getPopupHits(i,n){const{hits:s,location:o}=await this.popupHitTest(i);Ot(n);const a=[];for(const h of s)if("graphic"in h){if(this._isValidPopupGraphic(h.graphic,n)){const c=this._isValidPopupGraphicsLayerView(h.layerView)?h.layerView:void 0;a.push({graphic:h.graphic,layerView:c})}}else this._isValidPopupLocationLayerView(h.layerView)&&a.push({mapPoint:h.mapPoint,layerView:h.layerView});return{hits:a,location:o}}_isValidPopupGraphic(i,n){return i&&!!i.getEffectivePopupTemplate(n?.defaultPopupTemplateEnabled)}_isValidPopupGraphicsLayerView(i){return!i||(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesFromGraphics"in i}_isValidPopupLocationLayerView(i){return(!("layer"in i)||!i.suspended)&&"fetchPopupFeaturesAtLocation"in i}};return r([l()],e.prototype,"popup",void 0),r([l()],e.prototype,"popupEnabled",void 0),e=r([_("esri.views.PopupView")],e),e};let El=class{constructor(t){this.layerView=t,this._resolver=ui(),this.graphics=[]}get promise(){return this._resolver.promise}resolve(t){const{layerView:e,graphics:i,_resolver:n}=this;if(!e)return n.resolve(i),n.promise;let s;return e.fetchPopupFeaturesFromGraphics(i,t).catch(o=>(s=o,null)).then(o=>{o?n.resolve(o):n.reject(s)}),n.promise}};const Cl=5e3;let ai=class extends Pr{constructor(t){super(t),this.addHandles(this.on("before-add",e=>{e.item!=null&&e.item.parent===this.owner&&(D.getLogger(this).warn("Analysis inside the collection must be unique. Not adding this element again."),e.preventDefault())}))}_own(t){t.parent=this.owner}_release(t){t.parent=null}};ai=r([_("esri.support.AnalysesCollection")],ai);let It=class extends M{constructor(t){super(t),this.view=null,this.baseLayerViews=new L,this.referenceLayerViews=new L,this._loadingHandle=w(()=>this.view?.map?.basemap,e=>{e&&e.load().catch(()=>{})},U)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null);for(const t of this.baseLayerViews)t.destroy();this.baseLayerViews.length=0;for(const t of this.referenceLayerViews)t.destroy();this.referenceLayerViews.length=0}get suspended(){return!this.view||this.view.suspended}get updating(){if(this.view?.suspended)return!1;const t=this.view?.map?.basemap;return!!t&&!!t.loaded&&(this.baseLayerViews.some(e=>e.updating)||this.referenceLayerViews.some(e=>e.updating))}};r([l({constructOnly:!0})],It.prototype,"view",void 0),r([l({readOnly:!0})],It.prototype,"baseLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"referenceLayerViews",void 0),r([l({readOnly:!0})],It.prototype,"suspended",null),r([l({type:Boolean,readOnly:!0})],It.prototype,"updating",null),It=r([_("esri.views.BasemapView")],It);const Il=It;function Dl(t){return"tryRecycleWith"in t}function Rl(t){return t!=null&&typeof t=="object"&&"layerViews"in t}let Ll=class{constructor(t,e,i){this.layer=t,this.view=e,this.layerViewImporter=i,this._controller=new AbortController,this._deferred=ui(),this._started=!1,this.done=!1,this.promise=this._deferred.promise,Ti(this._controller.signal,()=>{const n=new C("cancelled:layerview-create","layerview creation cancelled",{layer:t});this._deferred.reject(n)})}tryRecycle(t){if(!this.done||!this.layerView||!Dl(this.layerView))return null;const e=this.layer.type,i=this._controller.signal;for(let n=0;n(Ot(this._controller.signal),s.emit("layerview-destroy",{view:h,layerView:a}),h.emit("layerview-destroy",{view:h,layerView:a}),s.emit("layerview-create",{view:h,layerView:a}),h.emit("layerview-create",{view:h,layerView:a}),a)),new Promise((c,p)=>Ti(this._controller.signal,()=>p(Qs())))]),this.promise}}return null}destroy(){this._controller.abort();const{layerView:t}=this;if(t){const{layer:e,view:i}=this;e.emit("layerview-destroy",{view:i,layerView:t}),i.emit("layerview-destroy",{layer:e,layerView:t})}this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null,this._map=null}async start(){if(this._started)return;this._started=!0;const{_controller:{signal:t},layer:e,view:i}=this;this._map=i.map;try{let n,s;if(await e.load({signal:t}),e.prefetchResources&&await e.prefetchResources({signal:t}),Ol(e))n=await e.createLayerView(i,{signal:t});else{if(!this.layerViewImporter.hasLayerViewModule(e))throw new C("layer:view-not-supported","No layerview implementation was found");const a=await this.layerViewImporter.importLayerView(e);Ot(t),n="default"in a?new a.default({layer:e,view:i}):new a({layer:e,view:i})}const o=()=>{s=st(s),n.destroyed||n.destroy(),n.layer=null,n.parent=null,n.view=null,this.done=!0};s=Ti(t,o),Ot(t);try{await n.when()}catch(a){throw o(),a}if(!this._map?.allLayers?.includes(e))return o(),void this._deferred.reject(new C("view:no-layerview-for-layer","The layer has been removed from the map",{layer:e}));this.layerView=n,e.emit("layerview-create",{view:i,layerView:n}),i.emit("layerview-create",{layer:e,layerView:n}),this.done=!0,this._deferred.resolve(n)}catch(n){e.emit("layerview-create-error",{view:i,error:n}),i.emit("layerview-create-error",{layer:e,error:n}),this.done=!0,this._deferred.reject(new C("layerview:create-error","layerview creation failed",{layer:e,error:n}))}}},J=class extends M{constructor(t){super(t),this._layerLayerViewInfoMap=new Map,this._recyclingInfoMap=new Map,this._watchUpdatingTracking=new yi,this.supportsGround=!0,this._preloadLayerViewModules=()=>{const e=this.view.map?.allLayers;if(e)for(const i of e)this.layerViewImporter.hasLayerViewModule(i)&&this.layerViewImporter.importLayerView(i)},this._reschedule=()=>this.destroyed?Promise.reject():(this._workPromise==null&&(this._workPromise=ui(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(Wa(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{if(this.destroyed)return;const e=this.view.map;if(this._map!==e&&(this.clear(),this._map=e),this._workPromise==null)return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const i=new Set,n=[],s=this.view.ready,o=h=>{if(h!=null){for(const c of h)if(c){i.add(c);const p=this._layerLayerViewInfoMap.get(c);p&&s?p.start():p||this._recyclingInfoMap.has(c)||n.push(c),"layers"in c&&c.layers&&o(c.layers)}}};for(const h of this._rootCollectionNames)o(bi(this,h));for(const[h,c]of this._layerLayerViewInfoMap)if(!i.has(h)){this._layerLayerViewInfoMap.delete(c.layer);const p=c.tryRecycle(n);p?(this.notifyChange("updating"),this._recyclingInfoMap.set(c.layer,c),p.then(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),this._layerLayerViewInfoMap.set(c.layer,c),this._reschedule()}).catch(()=>{this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy(),this._reschedule()})):c.destroy()}for(const[h,c]of this._recyclingInfoMap)i.has(h)||(this.notifyChange("updating"),this._recyclingInfoMap.delete(c.layer),c.destroy());for(const h of n)this._createLayerView(h);this._refreshCollections();const a=[e?.ground?.layers,e?.basemap?.baseLayers,e?.basemap?.referenceLayers,e?.layers].filter(h=>!!h);i.forEach(h=>"layers"in h&&a.push(h.layers)),this.addHandles(a.map(h=>this._watchUpdatingTracking.addOnCollectionChange(()=>h,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.addHandles([ci(()=>this.view?.map?.allLayers,"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),w(()=>{const t=this.view,e=t?.map;return[e?.basemap,e?.ground,e?.layers,t?.ready]},()=>this._reschedule(),ct)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),Mi(this._recyclingInfoMap),Mi(this._layerLayerViewInfoMap),this._watchUpdatingTracking.destroy(),this._map=null,this._workPromise!=null&&(this._workPromise.reject(Qs()),this._workPromise=null)}get _layersToLayerViews(){const t=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&t.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(t)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return this._workPromise!=null||this._watchUpdatingTracking.updating||Ua(this._layerLayerViewInfoMap,t=>!t.done)||this._recyclingInfoMap.size>0}get updatingRemaining(){let t=0;for(const e of this._layerLayerViewInfoMap.values())e.done||++t;return t}clear(){this.destroyed||(Mi(this._layerLayerViewInfoMap),this._refreshCollections())}async whenLayerView(t){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(t)){if(this._recyclingInfoMap.has(t))return this._recyclingInfoMap.get(t).promise;throw new C("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:t})}return this._layerLayerViewInfoMap.get(t).promise}isCreatingLayerViewsForLayer(t,e){this.commitProperty("updatingRemaining");const i=this._layerLayerViewInfoMap.get(t);if(!i?.done)return!0;const n=i.layerView;return!(!n||!e||n.parent===e)||!!(i.done&&n&&"layers"in t&&t.layers?.length)&&t.layers.some(s=>this.isCreatingLayerViewsForLayer(s,n))}_refreshCollections(){for(const[t,e]of this._layersToLayerViews)this._populateLayerViewsOwners(bi(this,t),bi(this,e),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(t,e,i){if(!t||!e)return void(e&&e.removeAll());let n=0;for(const s of t){const o=this._layerLayerViewInfoMap.get(s);if(!o?.layerView)continue;const a=o.layerView;a.layer=s,a.parent=i,e.at(n)!==a&&e.splice(n,0,a),"layers"in s&&Rl(a)&&this._populateLayerViewsOwners(s.layers,a.layerViews,a),n+=1}n{}),this.layerViewImporter.hasLayerViewModule(t)&&this.layerViewImporter.importLayerView(t);const e=new Ll(t,this.view,this.layerViewImporter);e.promise.then(()=>this._refreshCollections(),i=>{i&&(Js(i)||i.name==="cancelled:layerview-create")||D.getLogger(this).error(`Failed to create layerview for layer title:'${t.title??"no title"}', id:'${t.id??"no id"}' of type '${t.type}'.`,{layer:t,error:i}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(t,e),this.view.ready&&e.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};r([l()],J.prototype,"_workPromise",void 0),r([l({readOnly:!0})],J.prototype,"_watchUpdatingTracking",void 0),r([l({readOnly:!0})],J.prototype,"_layersToLayerViews",null),r([l({readOnly:!0})],J.prototype,"_rootCollectionNames",null),r([l()],J.prototype,"layerViewImporter",void 0),r([l()],J.prototype,"supportsGround",void 0),r([l({readOnly:!0})],J.prototype,"updating",null),r([l({readOnly:!0})],J.prototype,"updatingRemaining",null),r([l({constructOnly:!0})],J.prototype,"view",void 0),J=r([_("esri.views.LayerViewManager")],J);const Vl=J;function Ol(t){return"createLayerView"in t&&t.createLayerView!=null}let Y=class extends M{constructor(t){super(t),this.factor=1.5,this.offset=H(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}};r([l({type:Number})],Y.prototype,"factor",void 0),r([l({nonNullable:!0})],Y.prototype,"offset",void 0),r([l()],Y.prototype,"position",void 0),r([l({type:Number,range:{min:0}})],Y.prototype,"size",void 0),r([l()],Y.prototype,"maskUrl",void 0),r([l()],Y.prototype,"maskEnabled",void 0),r([l()],Y.prototype,"overlayUrl",void 0),r([l()],Y.prototype,"overlayEnabled",void 0),r([l({readOnly:!0})],Y.prototype,"version",null),r([l({type:Boolean})],Y.prototype,"visible",void 0),Y=r([_("esri.views.Magnifier")],Y);const uo=Y;function Ge(t){return!!(t!=null&&typeof t=="object"&&"createQuery"in t&&t.createQuery&&"on"in t&&t.on)}let yt=class extends hi.EventedAccessor{constructor(t){super(t),this._selectionMap=new kr,this._sources=new L,this._trashCan=[],this._layerEditHandles=new L,this._vizTaskId=0,this.showHighlight=!0}initialize(){this.addHandles([w(()=>[this.view,this.showHighlight],()=>this._refreshVisualization()),ci(()=>this.sources,"change",e=>{const i=this._selectionMap;for(const n of e.removed)i.delete(n);this._refreshListeners(),this._refreshVisualization()},{onListenerAdd:()=>this._refreshListeners()})]);const t=new L;this.view.when().then(()=>{this.view.map&&(this.view.map.allLayers.flatten(e=>"sublayers"in e&&e.sublayers?e.sublayers:null).forEach(e=>{(Ge(e)&&!Ia(e)||Ft(e))&&t.add(e)}),this.sources=t)})}destroy(){this._layerEditHandles.drain(st)}get selections(){return Array.from(this._selectionMap.entries()).map(t=>{const[e,i]=t;return{layer:e,selection:[...i.selection]}})}get count(){let t=0;for(const e of this._selectionMap.values())t+=e.selection.length;return t}get hasSelection(){return this.count>0}get sources(){return this._sources}set sources(t){Da(t,this._sources)}async getSelectedFeatures(t,e={},i="layerView"){const{view:n,selections:s}=this,o=(t!==void 0?s.filter(a=>t.includes(a.layer)):s).filter(a=>a.selection.length>0).map(async a=>{const{layer:h,selection:c}=a,p=Ft(h)?h.parent:h;if(p==null||!ns(p))return null;if(i==="layer")return ss(p,c,e);if(is(p))return null;const d=await n.whenLayerView(p).catch(()=>null);return d?ss(d,c,e):null});return(await Promise.all(o)).filter(a=>a!=null)}updateSelection(t){const e=new Map;for(const[s,o]of this._selectionMap)e.set(s,[...o.selection]);let i=!1;const n=t.current.concat(t.added);for(const s of n){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=Ra(e,o,()=>[]);h.includes(a)||(h.push(a),i=!0)}}for(const s of t.removed){const o=s.sourceLayer,a=s.getObjectId();if(this.sources.includes(o)&&(Ge(o)||Ft(o))&&a!==null){const h=e.get(o),c=h?.indexOf(a);c!==void 0&&c>=0&&(h?.splice(c,1),i=!0)}}if(i){const{_selectionMap:s,_trashCan:o}=this,a=[];for(const[h,c]of e){const p=s.get(h);p!==void 0&&o.push(p),s.set(h,{selection:c}),a.push({layer:h,selection:c,...On(p!==void 0?p.selection:[],c)})}this._onSelectionChange(a)}}setSelection(t,e){this._setSelection(t,e)}getSelection(t){return this._selectionMap.get(t)?.selection}appendToSelection(t,e){const i=this._selectionMap.get(t),n=i!==void 0?[...i.selection]:[];for(const s of e)n.includes(s)||n.push(s);this._setSelection(t,n)}removeFromSelection(t,e){const i=this._selectionMap.get(t);if(!i)return;const n=[];for(const s of i.selection)e.includes(s)||n.push(s);this._setSelection(t,n)}toggleInSelection(t,e){const i=this._selectionMap.get(t);if(!i||i.selection.length===0)return void this._setSelection(t,e);const n=new Set(i.selection),s=new Set(e),o=La(n,s);this._setSelection(t,Array.from(o))}clear(){const t=this._selectionMap.values();this._trashCan.push(...t);const e=[];for(const[i,n]of this._selectionMap.entries())e.push({layer:i,added:[],removed:[...n.selection],selection:[]});this._selectionMap.clear(),this._onSelectionChange(e)}_onSelectionChange(t){this._refreshVisualization(),this.emit("selection-change",{view:this.view,changes:t})}_refreshVisualization(){if(this.view==null||this.sources==null)return;for(this._vizTaskId++;this._trashCan.length>0;)this._trashCan.pop()?.highlightHandle?.remove();const{sources:t,view:e,_selectionMap:i,showHighlight:n}=this,s=this._vizTaskId;for(const o of t){const a=i.get(o),h=Ft(o)?o.parent:o;if(h!=null&&ns(h)){if(is(h))continue;e.whenLayerView(h).then(c=>{a?.highlightHandle?.remove(),a!=null&&n&&s===this._vizTaskId&&"highlight"in c&&typeof c.highlight=="function"&&a.selection.length>0&&(a.highlightHandle=c.highlight(a.selection,"selection"))}).catch(()=>{a?.highlightHandle?.remove()})}}}_refreshListeners(){this._layerEditHandles.drain(st);for(const t of this.sources){const e=Ft(t)?t.parent:t;if(e!=null&&Ge(e)){const i=e.on("edits",n=>{this._handleEditChanges(n,t)});this._layerEditHandles.push(i)}}}_handleEditChanges(t,e){if(t.deletedFeatures!==void 0&&t.deletedFeatures.length>0&&this._selectionMap.has(e)){const i=t.deletedFeatures.filter(n=>n.error==null).map(n=>n.objectId).filter(ni);this.removeFromSelection(e,i)}}_setSelection(t,e){if(!this.sources.includes(t))throw new Error(`Cannot set selection on layer ${t.title} because it is not in 'sources'`);const i=this._selectionMap.get(t);if(i===void 0||!zl(i,{selection:e})){i!==void 0&&this._trashCan.push(i),this._selectionMap.set(t,{selection:[...e]});const n={layer:t,selection:[...e],...On(i!==void 0?i.selection:[],e)};this._onSelectionChange([n])}}};r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"selections",null),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"count",null),r([l({constructOnly:!0,nonNullable:!0})],yt.prototype,"view",void 0),r([l({readOnly:!0,nonNullable:!0})],yt.prototype,"hasSelection",null),r([l()],yt.prototype,"showHighlight",void 0),r([l()],yt.prototype,"sources",null),yt=r([_("esri.views.SelectionManager")],yt);const is=t=>Ft(t)?t.parent?.isTable===!0:t.isTable,Al=t=>t.layer!==void 0,ns=t=>t?.when!==void 0,zl=(t,e)=>{if(t==null&&e==null)return!0;if(t!=null&&e==null||t==null&&e!=null)return!1;if(t!=null&&e!=null&&t.selection!=null&&e.selection!=null){const i=[...t.selection],n=[...e.selection];if(i.length!==n.length)return!1;i.sort(),n.sort();for(let s=0;s{let n;if(Al(t)){const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:t.layer}))}else{const s=t;n=s===void 0?null:await s.queryFeatures(new Un({...i,objectIds:e})).then(o=>({data:o,layer:s}))}return n},Nl=yt;let ve=class extends js(M){constructor(t){super(t),this.accentColor=new Pt([255,127,0]),this.textColor=new Pt([255,255,255])}};r([l({type:Pt,nonNullable:!0})],ve.prototype,"accentColor",void 0),r([l({type:Pt,nonNullable:!0})],ve.prototype,"textColor",void 0),ve=r([_("esri.views.Theme")],ve);const Ki=ve;var os;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right"})(os||(os={}));const mo=["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"],go={};function yo(t){return!!go[t]}function Fl(t){for(const e of t)if(!yo(e))return!1;return!0}mo.forEach(t=>{go[t]=!0});let Hl=class{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:e,priority:i},n)=>this.inputManager?.installHandlers(n,[e],i))}disconnect(){this.inputManager&&this._handlers.forEach((t,e)=>this.inputManager?.uninstallHandlers(e)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(t,e,i,n){const s=Array.isArray(t)?t:t.split(",");if(!Fl(s))return s.some(yo)&&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(e)?a=e:(o=e,a=[]),typeof i=="function"?o=i:n=i,n=n??At.DEFAULT;const h=this._createUniqueGroupName(),c=new Zl(this.view,s,a,o);this._handlers.set(h,{handler:c,priority:n});for(const p of s){const d=this._handlerCounts.get(p)||0;this._handlerCounts.set(p,d+1)}return this.inputManager&&this.inputManager.installHandlers(h,[c],n),di(()=>this._removeHandler(h,s))}hasHandler(t){return!!this._handlerCounts.get(t)}_removeHandler(t,e){if(this._handlers.has(t)){this._handlers.delete(t);for(const i of e){const n=this._handlerCounts.get(i);n===void 0||(n===1?this._handlerCounts.delete(i):this._handlerCounts.set(i,n-1))}}this.inputManager&&this.inputManager.uninstallHandlers(t)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}},Zl=class extends A{constructor(t,e,i,n){super(!0),this._latestDragStart=void 0,this.view=t;for(const s of e)switch(s){case"click":this.registerIncoming("click",i,o=>n(Wl(t,o)));break;case"double-click":this.registerIncoming("double-click",i,o=>n(Ul(t,o)));break;case"immediate-click":this.registerIncoming("immediate-click",i,o=>n(jl(t,o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",i,o=>n(ql(t,o)));break;case"hold":this.registerIncoming("hold",i,o=>n(Bl(t,o)));break;case"drag":this.registerIncoming("drag",i,o=>{const a=this._wrapDrag(o);a&&n(a)});break;case"key-down":this.registerIncoming("key-down",i,o=>n(Kl(o)));break;case"key-up":this.registerIncoming("key-up",i,o=>n(Yl(o)));break;case"pointer-down":this.registerIncoming("pointer-down",i,o=>n(ge(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",i,o=>n(ge(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",i,o=>n(ge(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",i,o=>n(Xl(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",i,o=>n(Ql(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",i,o=>n(ge(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",i,o=>n(ge(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",i,o=>{n(Jl(o))});break;case"focus":this.registerIncoming("focus",i,o=>{n(Gl(o))});break;case"blur":this.registerIncoming("blur",i,o=>{n($l(o))})}}_wrapDrag(t){const e=t.data,{x:i,y:n}=e.center,{action:s,pointerType:o,button:a}=e;if(s==="start"&&(this._latestDragStart=e),!this._latestDragStart)return;const h=e.pointer.native,c=e.buttons,{cancelable:p,timestamp:d}=t,m={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return s==="end"&&(this._latestDragStart=void 0),{type:"drag",action:s,x:i,y:n,origin:m,pointerType:o,button:a,buttons:c,radius:e.radius,angle:ja(e.angle),native:h,timestamp:d,cancelable:p,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}};function Gl(t){return{type:"focus",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function $l(t){return{type:"blur",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:e=>t.async(e),preventDefault:()=>t.preventDefault()}}function Wl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,screenPoint:H(o,a),mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function Ul(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,{cancelable:p,timestamp:d}=e;return{type:"double-click",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:d,mapPoint:Ve(t,o,a),eventId:c,cancelable:p,stopPropagation:()=>e.stopPropagation(),async:m=>e.async(m),preventDefault:()=>e.preventDefault()}}function jl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function ql(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h,eventId:c}=e.data,p=h.pointerId,{cancelable:d,timestamp:m}=e;return{type:"immediate-double-click",pointerId:p,pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:m,mapPoint:Ve(t,o,a),eventId:c,cancelable:d,stopPropagation:()=>e.stopPropagation(),async:u=>e.async(u),preventDefault:()=>e.preventDefault()}}function Bl(t,e){const{pointerType:i,button:n,buttons:s,x:o,y:a,native:h}=e.data,{cancelable:c,timestamp:p}=e;return{type:"hold",pointerType:i,button:n,buttons:s,x:o,y:a,native:h,timestamp:p,mapPoint:Ve(t,o,a),cancelable:c,stopPropagation:()=>e.stopPropagation(),async:d=>e.async(d),preventDefault:()=>e.preventDefault()}}function Ve(t,e,i){return t.toMap(H(e,i),{exclude:[]})}function Kl(t){const{key:e,repeat:i,native:n}=t.data,{cancelable:s,timestamp:o}=t;return{type:"key-down",key:e,repeat:i,native:n,timestamp:o,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:a=>t.async(a),preventDefault:()=>t.preventDefault()}}function Yl(t){const{key:e,native:i}=t.data,{cancelable:n,timestamp:s}=t;return{type:"key-up",key:e,native:i,timestamp:s,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:o=>t.async(o),preventDefault:()=>t.preventDefault()}}function ge(t,e){const{x:i,y:n,button:s,buttons:o,native:a,eventId:h}=t.data,c=a.pointerId,p=a.pointerType,{cancelable:d,timestamp:m}=t;return{type:e,x:i,y:n,pointerId:c,pointerType:p,button:s,buttons:o,native:a,timestamp:m,eventId:h,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}function Xl(t){const{x:e,y:i,buttons:n,native:s,eventId:o}=t.data.currentEvent,{button:a}=t.data.startEvent,h=t.data.startEvent.native.pointerId,c=t.data.startEvent.native.pointerType,p=t.data.action,d={x:t.data.startEvent.x,y:t.data.startEvent.y},{cancelable:m,timestamp:u}=t;return{type:"pointer-drag",x:e,y:i,pointerId:h,pointerType:c,button:a,buttons:n,action:p,origin:d,native:s,timestamp:u,eventId:o,cancelable:m,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}function Ql(t){const{cancelable:e,data:i,timestamp:n}=t,{x:s,y:o,deltaY:a,native:h}=i;return{type:"mouse-wheel",x:s,y:o,deltaY:a,native:h,timestamp:n,cancelable:e,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}function Jl(t){const{action:e,state:i,device:n}=t.data,{cancelable:s,timestamp:o}=t,{buttons:a,axes:h}=i;return{type:"gamepad",device:n,timestamp:o,action:e,buttons:a,axes:h,cancelable:s,stopPropagation:()=>t.stopPropagation(),async:c=>t.async(c),preventDefault:()=>t.preventDefault()}}var Ie,as,rs;(function(t){t[t.USER=0]="USER",t[t.MANAGER=1]="MANAGER"})(Ie||(Ie={})),function(t){t[t.None=0]="None",t[t.Unfocused=1]="Unfocused",t[t.Focused=2]="Focused",t[t.Unselected=4]="Unselected",t[t.Selected=8]="Selected",t[t.All=15]="All"}(as||(as={})),function(t){t[t.None=0]="None",t[t.Custom1=16]="Custom1",t[t.Custom2=32]="Custom2",t[t.Custom3=64]="Custom3",t[t.Custom4=128]="Custom4",t[t.Custom5=256]="Custom5",t[t.Custom6=512]="Custom6",t[t.Custom7=1024]="Custom7",t[t.Custom8=2048]="Custom8",t[t.Custom9=4096]="Custom9",t[t.Custom10=8192]="Custom10",t[t.Custom11=16384]="Custom11",t[t.Custom12=32768]="Custom12",t[t.All=65520]="All"}(rs||(rs={}));function th(t){return[t.on("before-add",e=>{const i=e.item;if(i==null||t.includes(i))return D.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void e.preventDefault();i.onAdd()}),t.on("after-remove",e=>{const i=e.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function Yi(t){return t.visible&&t.getEditableFlag!=null&&t.getEditableFlag(Ie.USER)&&t.getEditableFlag(Ie.MANAGER)}function rt(t){return H(t.x,t.y)}function _o(t,e){const i=(t instanceof HTMLElement?t:t.surface)?.getBoundingClientRect();return i?H(e.clientX-i.left,e.clientY-i.top):H(0,0)}function fo(t,e){return e instanceof Event?_o(t,e):rt(e)}function vo(t){if(t instanceof Event)return!0;if(typeof t=="object"&&"type"in t)switch(t.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}let eh=class{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._externallyDragging=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}hasFocusedManipulators(){return this._grabbedManipulators.size>0||this._draggedManipulators.size>0}handleInputEvent(t,e){const i=()=>t.stopPropagation();switch(t.type){case"pointer-move":hs(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:t.action==="start"?this._externallyDragging=!0:t.action==="end"&&(this._externallyDragging=!1),this._stopDrag&&(i(),t.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!cs(t))break;const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(s==null)break;const o=s.manipulator,a=s.tool;o==null||a==null||!o.interactive||o.grabbable&&o.grabbableForEvent(t)||!o.grabbing||o.dragging||this._releaseManipulatorBeforeDragging(o,t,e),o!=null&&a!=null&&o.interactive&&o.grabbable&&o.grabbableForEvent(t)&&!o.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:o,tool:a,start:n,pointerType:t.pointerType}),this._grabbedManipulators.size===1&&e.activeTool==null&&(this._revertToNullActiveTool=!0,e.setActiveTool(s.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:n}),i());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,e);break;case"pointer-drag":{if(!cs(t))break;const n=this._grabbedManipulators.get(t.pointerId),s=n?.manipulator,o=n?.tool;if(s==null||o==null)break;const a=rt(t);a.x=ke(a.x,0,e.view.width),a.y=ke(a.y,0,e.view.height);const h=n.start,c=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":t.action!=="update"&&this._grabbedManipulators.size!==1||(s.dragging=!0,c?s.events.emit("drag",{action:"update",start:h,screenPoint:a}):s.events.emit("drag",{action:"start",start:h,screenPoint:a,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:o,manipulator:s,start:h}));break;case"end":s.dragging=!1,c&&s.events.emit("drag",{action:"end",start:h,screenPoint:a}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,e)}i();break}case"immediate-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool);if(ih(t)||e.forEachTool(c=>{if((s==null||s.tool!==c||c.automaticManipulatorSelection)&&c.manipulators){let p=!1;c.manipulators.forEach(({manipulator:d})=>{d.selected&&(d.selected=!1,p=!0)}),p&&c.onManipulatorSelectionChanged&&c.onManipulatorSelectionChanged()}}),s==null)break;const{manipulator:o,tool:a}=s;if(!o.interactive)break;o.selectable&&a.automaticManipulatorSelection&&(o.selected=!o.selected,a.onManipulatorSelectionChanged&&a.onManipulatorSelectionChanged());const h=t.native.shiftKey;o.events.emit("immediate-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:h,stopPropagation:i}),Di(o,i);break}case"click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s?.manipulator;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit(t.type,{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a}),i();break}case"double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),Di(o,i);break}case"immediate-double-click":{const n=rt(t),s=te(n,t.pointerType,e.forEachTool),o=s!=null?s.manipulator:null;if(o==null||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:n,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:i}),t.pointerType==="mouse"&&Di(o,i);break}}this._onFocusChange(e.forEachTool)}_releaseManipulatorBeforeDragging(t,e,i){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:e.pointerType,screenPoint:rt(e)}),this._grabbedManipulators.forEach(({manipulator:n},s)=>{n===t&&this._grabbedManipulators.delete(s)}),this._afterManipulatorRelease(i.setActiveTool)}_handlePointerEnd(t,e){const i=this._grabbedManipulators.get(t.pointerId)?.manipulator;i!=null&&i.grabbing&&(i.grabbing=!1,i.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:rt(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorRelease(e.setActiveTool))}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=ls(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=ls(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(t){const e=new Set,i=new Set;this._grabbedManipulators.forEach(({tool:n})=>{e.add(n)}),this._hoveredManipulators.forEach(({tool:n})=>{i.add(n)}),t(n=>{n.hasGrabbedManipulators=e.has(n),n.hasHoveredManipulators=i.has(n);const s=this._grabbedManipulators.values(),o=cr(s,({tool:a})=>a===n);n.firstGrabbedManipulator=o!=null?o.manipulator:null})}clearPointers(t,{forEachTool:e,setActiveTool:i},n=!0,s){const o=(a,h)=>a===t&&(s==null||s===h);this._grabbedManipulators.forEach(({tool:a,manipulator:h,pointerType:c},p)=>{o(a,h)&&(this._grabbedManipulators.delete(p),h.grabbing=!1,h.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:c}))}),this._draggedManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._draggedManipulators.delete(c),h.dragging=!1,h.events.emit("drag",{action:"cancel"}))}),n&&this._hoveredManipulators.forEach(({tool:a,manipulator:h},c)=>{o(a,h)&&(this._hoveredManipulators.delete(c),h.hovering=!1)}),this._afterManipulatorRelease(i),this._onFocusChange(e)}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach((e,i)=>{this._updateHoveredStateForPointerAtScreenPosition(H(e.x,e.y),i,e.pointerType,t)})}handleHoverEvent(t,e){const i=t.type;i!=="pointer-up"&&i!=="immediate-click"&&i!=="pointer-move"||!hs(t.pointerType)||(i!=="pointer-up"&&this._externallyDragging?this._clearHoveredManipulatorStates(t.pointerId):this._updateHoveredStateForPointerAtScreenPosition(rt(t),t.pointerId,t.pointerType,e))}_updateHoveredStateForPointerAtScreenPosition(t,e,i,n){let s=te(t,i,n);const o=this._hoveredManipulators.get(e)?.manipulator;s==null||s.manipulator.interactive||(s=null),s!=null&&o===s.manipulator||(o!=null&&(o.hovering=!1),s!=null?(s.manipulator.hovering=!0,this._hoveredManipulators.set(e,s)):this._hoveredManipulators.delete(e),this._onFocusChange(n))}_afterManipulatorRelease(t){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}_clearHoveredManipulatorStates(t){this._hoveredManipulators.forEach(({manipulator:e},i)=>{t===i&&(this._hoveredManipulators.delete(t),e.hovering=!1)})}};function ls(t){for(const{manipulator:e}of t.values())if(e!=null&&e.interactive){if(e.grabbing&&e.grabCursor)return e.grabCursor;if(e.cursor)return e.cursor}return null}function te(t,e,i){let n=null;return i(s=>{if(s.manipulators==null||!Yi(s))return!1;const o=s.manipulators.intersect(t,e);return o!=null&&(n={tool:s,manipulator:o},!0)}),n}function hs(t){return t==="mouse"}function cs(t){return t.pointerType!=="mouse"||t.button===0}function ih(t){return!!t.native.shiftKey}function Di(t,e){t?.consumesClicks&&e()}const ps="attached",Ri="tools",nh=1e3;let lt=class extends M{constructor(t){super(t),this._updatingHandles=new yi,this._clock=Re,this._manipulatorState=new eh,this.tools=new L,this.cursor=null,this._interacting=!1,this._interactingTimeout=nh,this._interactingTimeoutHandle=null,this._forEachTool=e=>{for(const i of this.tools.items)if(e(i))return}}initialize(){this.addHandles([this.view.on(mo,t=>{this._handleInputEvent(t)},At.TOOL),...th(this.tools),this.tools.on("before-add",({item:t})=>{this._updateToolEditableFlag(t)}),this.tools.on("before-remove",({item:t})=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.activeTool=null,this.tools.drain(t=>t.destroy()),this._clearInteractingTimeout(),this._interacting=!1,this._updatingHandles.destroy()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:t=>{this.activeTool=t},view:this.view}}set activeTool(t){if(t!=null&&!this.view.ready)return void D.getLogger(this).error("Cannot set active tool while view is not ready.");if(t===this.activeTool)return;const e=this.activeTool;this._set("activeTool",t),e?.deactivate(),t?.activate(),this._removeIncompleteTools(t);for(const i of this.tools){this._updateToolEditableFlag(i);const n=Yi(i);this.activeTool!=null&&n||this._manipulatorState.clearPointers(i,this._manipulatorStateEventArgs,!n)}this._updateCursor()}get updating(){return this._updatingHandles.updating||this.tools.some(t=>t.updating)}get interacting(){return this._interacting}_clearInteractingTimeout(){this._interactingTimeoutHandle=st(this._interactingTimeoutHandle)}_startInteractingTimeout(){this._clearInteractingTimeout(),this._interactingTimeoutHandle=this._clock.setTimeout(()=>this._interacting=!1,this._interactingTimeout)}attach(){this.view.type==="3d"?this.addHandles([w(()=>{const{state:t}=this.view;return"camera"in t&&t.camera},()=>this._forEachManipulator(t=>t.onViewChange())),this.view.elevationProvider?.on("elevation-change",t=>this._forEachManipulator(e=>e.onElevationChange(t)))],ps):this.addHandles(w(()=>this.view.extent,()=>this._forEachManipulator(t=>t.onViewChange())))}detach(){this.activeTool=null,this.tools.removeAll(),this.removeHandles(ps),this._clearInteractingTimeout(),this._interacting=!1}_forEachManipulator(t){this._forEachTool(e=>{e.manipulators&&e.manipulators.forEach(({manipulator:i})=>t(i,e))})}_handleInputEvent(t){let e=!1;const i={...t,stopPropagation:()=>{e=!0,t.stopPropagation()}};this.activeTool!=null?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(i):this._forEachTool(n=>{!e&&n.visible&&n.handleInputEvent(i)}),!e&&t.type==="key-down"&&t.key==="Escape"&&this.activeTool&&(t.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(i,this._manipulatorStateEventArgs),e||this.activeTool==null||this.activeTool.handleInputEventAfter(i),this._manipulatorState.handleHoverEvent(i,this._forEachTool),this._updateCursor(),t.type==="pointer-move"&&(this._manipulatorState.hasFocusedManipulators()||this.activeTool)&&(this._interacting=!0,this._startInteractingTimeout())}_refreshToolWatchers(){this.removeHandles(Ri),this._forEachTool(t=>{if(t instanceof M){const e=w(()=>[t.cursor,t.visible,t.editable],()=>{Yi(t)||this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs),this._updateCursor()});this.addHandles(e,Ri)}t.manipulators&&this.addHandles([t.manipulators.on("after-remove",e=>{this._manipulatorState.clearPointers(t,this._manipulatorStateEventArgs,!0,e.item.manipulator)}),t.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],Ri)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(t){t.setEditableFlag?.(Ie.MANAGER,this.activeTool==null||t===this.activeTool)}_updateCursor(){let t=this._manipulatorState.cursor;t==null&&this._forEachTool(e=>!(e.cursor==null||!e.visible)&&(t=e.cursor,!0)),this._get("cursor")!==t&&this._set("cursor",t)}_removeIncompleteTools(t){this.tools.filter(e=>(t==null||e!==t)&&!e.created&&e.removeIncompleteOnCancel).forEach(e=>{this.tools.remove(e)})}get test(){}};r([l({constructOnly:!0,nonNullable:!0})],lt.prototype,"view",void 0),r([l({value:null})],lt.prototype,"activeTool",null),r([l({readOnly:!0,type:L})],lt.prototype,"tools",void 0),r([l({readOnly:!0})],lt.prototype,"cursor",void 0),r([l({readOnly:!0})],lt.prototype,"updating",null),r([l()],lt.prototype,"_interacting",void 0),r([l({readOnly:!0})],lt.prototype,"interacting",null),lt=r([_("esri.views.ToolViewManager")],lt);let se=class extends M{constructor(t){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",t.mapping==="standard"?this._detectedDeviceType="standard":sh.test(t.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=t.index}get native(){const t=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndexVa.respectPrefersReducedMotion&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;let Dt=class extends M{constructor(t){super(t),this.enabled=!0,this.device=null,this.mode="pan",this.tiltDirection="forward-down",this.velocityFactor=1}};r([l({type:Boolean,nonNullable:!0})],Dt.prototype,"enabled",void 0),r([l({type:Mn})],Dt.prototype,"device",void 0),r([l({type:["pan","zoom"],nonNullable:!0})],Dt.prototype,"mode",void 0),r([l({type:["forward-down","forward-up"],nonNullable:!0})],Dt.prototype,"tiltDirection",void 0),r([l({type:Number,nonNullable:!0})],Dt.prototype,"velocityFactor",void 0),Dt=r([_("esri.views.navigation.gamepad.GamepadSettings")],Dt);const bo=Dt;let Zt=class extends M{constructor(t){super(t),this.browserTouchPanEnabled=!0,this.gamepad=new bo,this.momentumEnabled=!0,this.mouseWheelZoomEnabled=!0}get effectiveMomentumEnabled(){return this.momentumEnabled&&!wo()}};r([l({type:Boolean})],Zt.prototype,"browserTouchPanEnabled",void 0),r([l({type:bo,nonNullable:!0})],Zt.prototype,"gamepad",void 0),r([l({type:Boolean})],Zt.prototype,"momentumEnabled",void 0),r([l({type:Boolean})],Zt.prototype,"mouseWheelZoomEnabled",void 0),Zt=r([_("esri.views.navigation.Navigation")],Zt);const To=Zt;var ds;function lh(t){if(t.type==="integrated-mesh-3dtiles")return null;const e=t.url?Er(t.url):void 0;return!(t.spatialReference?.vcsWkid==null&&e!=null&&e.serverType==="ImageServer")&&Mo(t)&&t.heightModelInfo?t.heightModelInfo:hh(t)?wn.deriveUnitFromSR(ph,t.spatialReference):null}function Mo(t){return"heightModelInfo"in t}function xo(t){if(t.type==="unknown"||!("capabilities"in t))return!1;switch(t.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"geojson":case"subtype-group":case"ogc-feature":case"oriented-imagery":case"wfs":case"knowledge-graph-sublayer":return!0;default:return!1}}function hh(t){return xo(t)?!!(t.capabilities&&t.capabilities.data&&t.capabilities.data.supportsZ):Po(t)}function ch(t){return t.layers!=null||Po(t)||xo(t)||Mo(t)}function Po(t){switch(t.type){case"building-scene":case"elevation":case"integrated-mesh":case"integrated-mesh-3dtiles":case"point-cloud":case"scene":case"voxel":return!0;case"base-dynamic":case"base-elevation":case"base-tile":case"bing-maps":case"catalog":case"catalog-footprint":case"catalog-dynamic-group":case"csv":case"dimension":case"geojson":case"feature":case"focusArea":case"subtype-group":case"geo-rss":case"graphics":case"group":case"imagery":case"imagery-tile":case"kml":case"knowledge-graph":case"link-chart":case"knowledge-graph-sublayer":case"line-of-sight":case"map-image":case"map-notes":case"media":case"ogc-feature":case"open-street-map":case"oriented-imagery":case"parquet":case"route":case"stream":case"tile":case"unknown":case"unsupported":case"vector-tile":case"video":case"viewshed":case"wcs":case"web-tile":case"wfs":case"wms":case"wmts":case null:return!1}return!1}(function(t){t[t.Ok=0]="Ok",t[t.Units=1]="Units",t[t.HeightModel=2]="HeightModel",t[t.CRS=3]="CRS",t[t.Unsupported=4]="Unsupported"})(ds||(ds={}));const ph=new wn({heightModel:"gravity-related-height"});let Xi,Li=null;async function dh(t){Li||(Li=b(()=>import("./geometryServiceUtils-nsujb7BH-BeXUhRCo.js"),__vite__mapDeps([139,3,1,2,4,140,51,55]),import.meta.url).then(e=>Xi=e)),await Li,Ot(t)}async function So(t,e,i,n){if(!t)return null;const s=t.spatialReference;return yn()||_n(s,e)?Le(t,e):Xi?Xi.projectGeometry(t,e,i,n):(await Promise.race([dh(n),fn(n)]),So(t,e,i,n))}let P=class extends M{constructor(t){super(t),this.required={extent:!1,heightModelInfo:!1,tileInfo:!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=ji(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 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 this.userSpatialReference==null||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){const t=this.map?.(),e=[];return this.priorityCollection!=null&&e.push(this.priorityCollection),e.push({parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers},{parent:t?.ground,layers:t?.ground?.layers},{parent:t?.basemap,layers:t?.basemap?.referenceLayers}),e}get _spatialReferenceTask(){if(this.suspended)return this._get("_spatialReferenceTask")??{updating:!1};let t;if(this._collectLayers(this.mapCollections,i=>{const n=this._getSupportedSpatialReferences(i);if(n.length>0){const s=this._narrowDownSpatialReferenceCandidates(t,n);s!=null&&(t=s)}return t?.length===1})&&t?.length!==1)return{updating:!0};const e=this._pickSpatialReferenceCandidate(t);return{spatialReference:e?.spatialReference??null,viewingMode:e?.viewingMode??null,updating:!1}}get _tileInfoTask(){if(!this.required.tileInfo)return this._get("_tileInfoTask")??{updating:!1};const t=this.map?.(),e=this.spatialReference;if(!e)return{updating:this._spatialReferenceTask.updating};let i;const n=this._collectLayers([{parent:t?.basemap,layers:t?.basemap?.baseLayers},{layers:t?.layers}],s=>!(!("tileInfo"in s)||!s.tileInfo?.spatialReference.equals(e))&&(i=s,!0),s=>"tileInfo"in s);return i?{tileInfo:i.tileInfo,updating:!1}:{updating:n}}get _heightModelInfoTask(){if(!this.required.heightModelInfo||this.suspended&&this._get("_heightModelInfoTask")?.heightModelInfo)return this._get("_heightModelInfoTask")??{updating:!1};let t={};const e=this._collectLayers(this.mapCollections,i=>{const n=lh(i);return!!n&&(t={heightModelInfo:n,vcsWkid:i.spatialReference?.vcsWkid,latestVcsWkid:i.spatialReference?.latestVcsWkid},!0)},i=>ch(i));return{...t,updating:e}}get _extentCandidatesTask(){if(this.suspended||!this.required.extent)return this._get("_extentCandidatesTask")??{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const t=[],e=this._collectLayers(this.mapCollections,i=>{const n="fullExtents"in i&&i.fullExtents||(i.fullExtent!=null?[i.fullExtent]:[]),s=this.requiresExtentInSpatialReference?null:n[0],o=n.find(a=>a.spatialReference.equals(this.spatialReference))??s;if(o)return t.push({extent:o,layer:i}),!0;if(this._getSupportedSpatialReferences(i).length>0)for(const a of n)t.push({extent:a,layer:i});return!1});return{candidates:t,updating:e}}get _extentTask(){const{candidates:t,updating:e}=this._extentCandidatesTask;if(e)return{updating:e};if(t==null||t.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(t),n=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&n.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:this._projectExtentTask.task!=null&&!this._projectExtentTask.task.finished}:(this._projectExtentTask.task!=null&&(this._projectExtentTask.task=ji(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:n.clone(),task:dn(async s=>{try{const o=await So(i.extent,n,"portalItem"in i.layer?i.layer.portalItem:void 0,s);this._projectExtentTask={...this._projectExtentTask,task:null,output:o}}catch{if(qa(s))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(t,e){if(t==null)return e;const i=new Array;for(const n of t)for(const s of e){if(!n.spatialReference.equals(s.spatialReference))continue;const o=mh(n.viewingMode,s.viewingMode);if(o!==!1){i.push({spatialReference:n.spatialReference,viewingMode:o});break}}return i.length>0?i:null}_pickSpatialReferenceCandidate(t){const e=this.defaultSpatialReference;return t==null||t.length<1?e?{spatialReference:e,viewingMode:null}:null:(e!=null&&t.length>1&&t.some(({spatialReference:i})=>i.equals(e))&&(t=t.filter(({spatialReference:i})=>i.equals(e))),t.length>1&&t.some(({viewingMode:i})=>i!==jn.Local)&&(t=t.filter(({viewingMode:i})=>i!==jn.Local)),t[0])}_getSupportedSpatialReferences(t){const e="supportedSpatialReferences"in t&&t.supportedSpatialReferences||(t.spatialReference?[t.spatialReference]:[]);if(e.length===0)return[];const i=[];for(const n of e){const s=this.getSpatialReferenceSupport(n,t);if(s!=null){const o=s.constraints??[{spatialReference:n,viewingMode:null}];for(const{spatialReference:a,viewingMode:h}of o)this.requiresExtentInSpatialReference&&this.userSpatialReference!=null&&!a.equals(this.userSpatialReference)||i.push({spatialReference:a,viewingMode:h})}}return i}_pickExtentCandidate(t){const e=this.spatialReference;return t.find(({extent:i})=>e.equals(i.spatialReference))||t[0]}_collectLayers(t,e,i=()=>!0){if(this._loadMaybe(this.map?.())!=="loaded")return!0;const n=new uh(i,e);for(const s of t)if(this._collectCollection(s,n),n.done||n.preloading===this.sourcePreloadCount)break;return n.updating}_collectCollection(t,e){if(t.layers){switch(this._loadMaybe(t.parent)){case"loading":return e.updating=!0,void++e.preloading;case"failed":return}for(const i of t.layers)if(e.layerFilter(i)){switch(this._loadMaybe(i)){case"failed":continue;case"loading":e.updating=!0,++e.preloading;break;case"loaded":if(e.updating||(e.done=e.pushLayer(i)),e.done||e.preloading===this.sourcePreloadCount)break;"layers"in i&&this._collectCollection({layers:i.layers},e)}if(e.done||e.preloading===this.sourcePreloadCount)break}}}_loadMaybe(t){return t&&"loadStatus"in t&&t.loadStatus!=null?t.loadStatus==="not-loaded"?(t.load().catch(e=>{Js(e)}),"loading"):t.loadStatus:"loaded"}};r([l()],P.prototype,"required",void 0),r([l({constructOnly:!0})],P.prototype,"map",void 0),r([l({constructOnly:!0})],P.prototype,"getSpatialReferenceSupport",void 0),r([l()],P.prototype,"defaultSpatialReference",void 0),r([l()],P.prototype,"userSpatialReference",void 0),r([l()],P.prototype,"sourcePreloadCount",void 0),r([l()],P.prototype,"priorityCollection",void 0),r([l()],P.prototype,"requiresExtentInSpatialReference",void 0),r([l()],P.prototype,"suspended",void 0),r([l({readOnly:!0})],P.prototype,"ready",null),r([l({readOnly:!0})],P.prototype,"heightModelInfoReady",null),r([l({readOnly:!0})],P.prototype,"spatialReference",null),r([l({readOnly:!0})],P.prototype,"extent",null),r([l({readOnly:!0})],P.prototype,"heightModelInfo",null),r([l({readOnly:!0})],P.prototype,"vcsWkid",null),r([l({readOnly:!0})],P.prototype,"latestVcsWkid",null),r([l({readOnly:!0})],P.prototype,"viewingMode",null),r([l({readOnly:!0})],P.prototype,"tileInfo",null),r([l({readOnly:!0})],P.prototype,"mapCollections",null),r([l({readOnly:!0})],P.prototype,"_spatialReferenceTask",null),r([l({readOnly:!0})],P.prototype,"_tileInfoTask",null),r([l({readOnly:!0})],P.prototype,"_heightModelInfoTask",null),r([l({readOnly:!0})],P.prototype,"_extentCandidatesTask",null),r([l()],P.prototype,"_extentTask",null),r([l()],P.prototype,"_projectExtentTask",void 0),P=r([_("esri.views.support.DefaultsFromMap")],P);let uh=class{constructor(t,e){this.layerFilter=t,this.pushLayer=e,this.preloading=-1,this.updating=!1,this.done=!1}};function mh(t,e){return t!=null?e!=null?t===e&&t:t:e}var be;let y=be=class extends hi.EventedMixin(Oa(M)){constructor(t){super(t),this._userSpatialReference=null,this._cursor=null,this.handles=new qs,this.updatingHandles=new yi,this.allLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:yh}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new oo,this.analyses=new ai,this.typeSpecificPreconditionsReady=!0,this.layerViews=new L,this.magnifier=new uo,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new rh,this.navigation=new To,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new Hl(this),this.persistableViewModels=new L,this._isValid=!1,this._readyCycleForced=!1,this._lockedSpatialReference=null,this._userTimeZone=null,this._lockedTimeZone=null,this._userTimeExtent=null,this._lockedTimeExtent=null,this.theme=null,this.handles.add(w(()=>this.preconditionsReady,e=>{const i=this.ready;if(e?(this._lockedSpatialReference=this.spatialReference,this._lockedTimeZone=this.timeZone,this._lockedTimeExtent=this.timeExtent,be.views.add(this)):(this._lockedSpatialReference=null,be.views.remove(this)),this.notifyChange("spatialReference"),!e&&i)this.toolViewManager?.detach(),this.analysisViewManager!=null&&this.analysisViewManager.detach(),this.layerViewManager?.clear(),this._teardown();else if(e&&!i){try{this._startup()}catch(n){return void queueMicrotask(()=>{this.fatalError=new C("startup-error",null,n)})}this.analysisViewManager!=null&&this.analysisViewManager.attach(),this.toolViewManager.attach()}},Ee))}initialize(){this.addResolvingPromise(Promise.all([this.loadAsyncDependencies(),this.validate()]).then(()=>(this._isValid=!0,pn(()=>this.ready)))),this.basemapView=new Il({view:this}),this.layerViewManager=new Vl({view:this,layerViewImporter:{importLayerView:t=>this.importLayerView(t),hasLayerViewModule:t=>this.hasLayerViewModule(t)},supportsGround:this.supportsGround}),this.toolViewManager=new lt({view:this}),this._setupSpatialReferenceLogger(),this.selectionManager=new Nl({view:this}),this.addHandles([w(()=>this.initialExtentRequired,t=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:t},ct),w(()=>this.ready,t=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=t,this.defaultsFromMap.userSpatialReference=t?this.spatialReference:this._userSpatialReference)},Ee),w(()=>this._userSpatialReference,t=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=t)},ct)])}_setupSpatialReferenceLogger(){let t=null;this.addHandles([w(()=>this.defaultsFromMap?.ready,e=>{const i=this.map?.allLayers.length>0;if(e&&!this.spatialReference&&i){if(t!=null)return;const n=di(()=>t=ji(t));t=dn(async s=>{try{await Aa(this.spatialReferenceWarningDelay,null,s)}catch{return}finally{t=null}D.getLogger(this).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.addHandles(n,"spatial-reference-logger-task")}else this.removeHandles("spatial-reference-logger-task")},{sync:!0})])}destroy(){this.destroyed||(be.views.remove(this),this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=tt(this.graphics),this.analyses=tt(this.analyses),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),tt(this.analysisViewManager),this.toolViewManager=tt(this.toolViewManager),this.layerViewManager=tt(this.layerViewManager),this.selectionManager=tt(this.selectionManager),this.basemapView=tt(this.basemapView),this.groundView?.destroy(),this.layerViews?.forEach(t=>t.destroy()),this.layerViews.length=0,this.invalidate(),this._emitter.clear(),this.handles.destroy(),this.map=tt(this.map),this.updatingHandles.destroy())}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return D.getLogger(this).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){return this.toolViewManager?.activeTool}set activeTool(t){this.toolViewManager&&(this.toolViewManager.activeTool=t)}get animation(){return this._get("animation")}set animation(t){this._set("animation",t)}get center(){return null}get defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new P({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:(t,e)=>this.getSpatialReferenceSupport(t,e),...this.defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(t){this._set("extent",t)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||An.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._lockedSpatialReference&&!this.defaultsFromMap?.ready||!this.typeSpecificPreconditionsReady)}get resolution(){return 0}set map(t){t!==this._get("map")&&(t?.destroyed&&(D.getLogger(this).warn("#map","The provided map is already destroyed",{map:t}),t=null),An.isLoadable(t)&&t.load().catch(()=>{}),this.constructed&&!this.destroyed&&(this.forceReadyCycle(),this._lockedSpatialReference=null),this._set("map",t))}get spatialReference(){const t=this._userSpatialReference||this._lockedSpatialReference||this.getDefaultSpatialReference()||null;if(t&&this.defaultsFromMap?.required?.heightModelInfo){const e=t.clone();return e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid,e}return t}set spatialReference(t){const e=!pi(t,this._get("spatialReference"));this._set("_userSpatialReference",t),e&&(this._set("spatialReference",t),this._spatialReferenceChanged(t))}_spatialReferenceChanged(t){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get timeExtent(){return this._userTimeExtent??this._lockedTimeExtent??this.getDefaultTimeExtent()??null}set timeExtent(t){this._userTimeExtent=t}get timeZone(){return this._userTimeZone??this._lockedTimeZone??this.getDefaultTimeZone()??za}set timeZone(t){this._userTimeZone=t,Na(t)||D.getLogger(this).warn("#timeZone",`the parsed value '${t}' may not be a valid IANA time zone`)}get tools(){return this.toolViewManager?.tools}get initialExtent(){return this.defaultsFromMap?.extent}get cursor(){return this.toolViewManager?.cursor??this._cursor??"default"}set cursor(t){this._cursor=t,this.notifyChange("cursor")}get size(){return[this.width,this.height]}get effectiveTheme(){return this.theme??new Ki}whenLayerView(t){return this.layerViewManager?.whenLayerView(t)??Promise.reject()}getDefaultSpatialReference(){return this.defaultsFromMap?.spatialReference}getDefaultHeightModelInfo(){return(this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)??this.defaultsFromMap?.heightModelInfo??null}getDefaultTimeZone(){return null}getDefaultTimeExtent(){return null}importLayerView(t){throw new C("importLayerView() not implemented")}hasLayerViewModule(t){return!1}async validate(){}async loadAsyncDependencies(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(t){return this.getSpatialReferenceSupport(t)!=null}when(t,e){return this.isResolved()&&!this.ready&&D.getLogger(this).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(t,e)}forceReadyCycle(){this.ready&&(Ce(()=>this.destroyed||this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(t){this.toolViewManager.tools.add(t),this.activeTool=t}tryFatalErrorRecovery(){this.fatalError=null}};y.views=new L,r([l()],y.prototype,"_userSpatialReference",void 0),r([l()],y.prototype,"activeTool",null),r([l({readOnly:!0})],y.prototype,"allLayerViews",void 0),r([l()],y.prototype,"groundView",void 0),r([l()],y.prototype,"animation",null),r([l()],y.prototype,"basemapView",void 0),r([l()],y.prototype,"center",null),r([l()],y.prototype,"defaultsFromMapSettings",null),r([l()],y.prototype,"defaultsFromMap",null),r([l()],y.prototype,"fatalError",void 0),r([l({type:Xt})],y.prototype,"extent",null),r([l(Wn(oo,"graphics"))],y.prototype,"graphics",void 0),r([l(Wn(ai,"analyses"))],y.prototype,"analyses",void 0),r([l({readOnly:!0,type:wn})],y.prototype,"heightModelInfo",null),r([l({readOnly:!0})],y.prototype,"interacting",null),r([l({readOnly:!0})],y.prototype,"navigating",null),r([l({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_lockedSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],y.prototype,"preconditionsReady",null),r([l({readOnly:!0})],y.prototype,"typeSpecificPreconditionsReady",void 0),r([l({type:L,readOnly:!0})],y.prototype,"layerViews",void 0),r([l()],y.prototype,"resolution",null),r([l({type:uo})],y.prototype,"magnifier",void 0),r([l({value:null,type:xr})],y.prototype,"map",null),r([l()],y.prototype,"padding",void 0),r([l({readOnly:!0})],y.prototype,"ready",void 0),r([l({type:si})],y.prototype,"spatialReference",null),r([l()],y.prototype,"spatialReferenceWarningDelay",void 0),r([l()],y.prototype,"stationary",null),r([l({readOnly:!0})],y.prototype,"supportsGround",void 0),r([l({type:Sr})],y.prototype,"timeExtent",null),r([l({type:String,nonNullable:!0})],y.prototype,"timeZone",null),r([l()],y.prototype,"tools",null),r([l()],y.prototype,"toolViewManager",void 0),r([l({readOnly:!0})],y.prototype,"type",void 0),r([l({type:Number})],y.prototype,"scale",void 0),r([l({readOnly:!0})],y.prototype,"updating",void 0),r([l({readOnly:!0})],y.prototype,"initialExtentRequired",void 0),r([l({readOnly:!0})],y.prototype,"initialExtent",null),r([l()],y.prototype,"cursor",null),r([l({readOnly:!0})],y.prototype,"input",void 0),r([l({type:To,nonNullable:!0})],y.prototype,"navigation",void 0),r([l()],y.prototype,"layerViewManager",void 0),r([l()],y.prototype,"analysisViewManager",void 0),r([l()],y.prototype,"selectionManager",void 0),r([l()],y.prototype,"width",void 0),r([l()],y.prototype,"height",void 0),r([l({readOnly:!0})],y.prototype,"resizing",void 0),r([l({value:null,readOnly:!0})],y.prototype,"size",null),r([l({readOnly:!0})],y.prototype,"suspended",void 0),r([l({readOnly:!0})],y.prototype,"viewEvents",void 0),r([l({readOnly:!0})],y.prototype,"persistableViewModels",void 0),r([l()],y.prototype,"_isValid",void 0),r([l()],y.prototype,"_readyCycleForced",void 0),r([l()],y.prototype,"_lockedSpatialReference",void 0),r([l()],y.prototype,"_userTimeZone",void 0),r([l()],y.prototype,"_lockedTimeZone",void 0),r([l()],y.prototype,"_userTimeExtent",void 0),r([l()],y.prototype,"_lockedTimeExtent",void 0),r([l({type:Ki})],y.prototype,"theme",void 0),r([l({readOnly:!0,type:Ki})],y.prototype,"effectiveTheme",null),y=be=r([_("esri.views.View")],y);const Vi=globalThis.$arcgis;Vi&&!Vi.views&&Object.defineProperty(Vi,"views",{configurable:!1,enumerable:!0,writable:!1,value:y.views});const gh=y;function yh(t){return t.layerViews}let Rt=class extends Ba{constructor(t){super(t),this.state="running",this.target=null,this._resolver=null}initialize(){this._resolver=ui(),this.addResolvingPromise(this._resolver.promise)}get done(){return this.state==="finished"||this.state==="stopped"}stop(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),this._resolver?.reject(new C("ViewAnimation stopped")))}finish(){this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),this._resolver?.resolve())}update(t,e){e||(e=to(t)?"waiting-for-target":"running"),this._set("target",t),this._set("state",e)}};r([l({readOnly:!0})],Rt.prototype,"done",null),r([l({readOnly:!0,type:String})],Rt.prototype,"state",void 0),r([l()],Rt.prototype,"target",void 0),Rt=r([_("esri.views.ViewAnimation")],Rt),function(t){t.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(Rt||(Rt={}));const Qi=Rt;function xt(){return[1,0,0,1,0,0]}function _h(t){return[t[0],t[1],t[2],t[3],t[4],t[5]]}function fh(t,e,i,n,s,o){return[t,e,i,n,s,o]}function vh(t,e){return new Float64Array(t,e,6)}const wh=xt();Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:wh,clone:_h,create:xt,createView:vh,fromValues:fh},Symbol.toStringTag,{value:"Module"}));const ko=96,Eo=39.37,bh=180/Math.PI;function Co(t){return t.wkid?t:t.spatialReference||si.WGS84}function xn(t,e){return e.type?N(t,e.x,e.y):Se(t,e)}function Io(t){return Ys(t)}function fi(t,e,i=0){let n=t.width,s=t.height;if(i!==0){const h=gn(i),c=Math.abs(Math.cos(h)),p=Math.abs(Math.sin(h));n=t.width*c+t.height*p,s=t.width*p+t.height*c}const o=Math.max(1,e[0]),a=Math.max(1,e[1]);return Math.max(n/o,s/a)*Ch(t.spatialReference)}async function Te(t,e,i,n){let s,o;if(!t||Array.isArray(t)&&!t.length)return null;if(L.isCollection(t)&&(t=t.toArray()),Array.isArray(t)&&t.length&&typeof t[0]=="object"){const h=t.every(d=>"attributes"in d),c=t.some(d=>!d.geometry);let p=t;if(h&&c&&e&&e.allLayerViews){const d=new Map;for(const f of t){const T=f.layer,I=d.get(T)||[],E=f.attributes[T.objectIdField];E!=null&&I.push(E),d.set(T,I)}const m=[];d.forEach((f,T)=>{const I=e.allLayerViews.find(E=>E.layer.id===T.id);if(I&&"queryFeatures"in I){const E=T.createQuery();E.objectIds=f,E.returnGeometry=!0,m.push(I.queryFeatures(E))}});const u=await Promise.all(m),g=[];for(const f of u)if(f&&f.features&&f.features.length)for(const T of f.features)T.geometry!=null&&g.push(T.geometry);p=g}for(const d of p)n=await Te(d,e,i,n);return n}if(Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number")s=new V(t);else if(t instanceof io)s=t;else if("geometry"in t){if(t.geometry)s=t.geometry;else if(t.layer){const h=t.layer,c=e.allLayerViews.find(p=>p.layer.id===h.id);if(c&&"queryFeatures"in c){const p=h.createQuery();p.objectIds=[t.attributes[h.objectIdField]],p.returnGeometry=!0,s=(await c.queryFeatures(p))?.features?.[0]?.geometry}}}if(s==null)return null;switch(s.type){case"point":o=new Xt({xmin:s.x,ymin:s.y,xmax:s.x,ymax:s.y,spatialReference:s.spatialReference});break;case"extent":case"multipoint":case"polygon":case"polyline":o=Zr(s);break;default:o=s.extent}if(!o)return null;yn()||_n(o.spatialReference,i)||await fn();const a=Le(o,i);if(!a)return null;if(n){const h=a.center,c=h.clone();c.x=Tn(h.x,n.center.x,i),c.x!==h.x&&a.centerAt(c),n=n.union(a)}else n=a;return n}function Th(t){if(t&&(!Array.isArray(t)||typeof t[0]!="number")&&(typeof t=="object"||Array.isArray(t)&&typeof t[0]=="object")){if("layer"in t&&t.layer?.minScale!=null&&t.layer.maxScale!=null){const e=t.layer;return{min:e.minScale,max:e.maxScale}}if(Array.isArray(t)&&t.length&&t.every(e=>"layer"in e)){let e=0,i=0;for(const n of t){const s=n.layer;s?.minScale&&s.maxScale&&(e=s.minScalei?s.maxScale:i)}return e&&i?{min:e,max:i}:null}}}function us(t,e){const i=Co(t);return pi(i,e)||i.imageCoordinateSystem||e.imageCoordinateSystem?t:Le(t,e)}async function Mh(t,e){if(!t||!e)return new nt({targetGeometry:new V,scale:0,rotation:0});let i=e.spatialReference;const{constraints:n,padding:s,viewpoint:o,size:a}=e,h=[s?a[0]-s.left-s.right:a[0],s?a[1]-s.top-s.bottom:a[1]];let c=null;t instanceof nt?c=t:t.viewpoint?c=t.viewpoint:t.target&&t.target.declaredClass==="esri.Viewpoint"&&(c=t.target);let p=null;c?.targetGeometry?p=c.targetGeometry:t instanceof Xt?p=t:t instanceof io?p=await Te(t,e,i):t&&(p=await Te(t.center,e,i)||await Te(t.target,e,i)||await Te(t,e,i)),!p&&o?.targetGeometry?p=o.targetGeometry:!p&&e.extent&&(p=e.extent),i||(i=Co(e.spatialReference||e.extent||p)),yn()||pi(p.spatialReference,i)||_n(p.spatialReference,i)||await fn();const d=us(p,i),m="center"in d?d.center:d;e.pickClosestTarget!==!1&&m.type==="point"&&o.targetGeometry?.type==="point"&&(m.x=Tn(m.x,o.targetGeometry.x,m.spatialReference));let u=0;c?u=c.rotation:t.hasOwnProperty("rotation")?u=t.rotation:o&&(u=o.rotation);let g=0;g=c?.targetGeometry!=null&&c.targetGeometry.type==="point"?c.scale:"scale"in t&&t.scale?t.scale:"zoom"in t&&t.zoom!==-1&&n&&n.effectiveLODs?n.zoomToScale(t.zoom):Array.isArray(p)||p.type==="point"||p.type==="extent"&&p.width===0&&p.height===0?o.scale:fi(us(p.extent,i),h,u);const f=Th(t.target??t);f&&(f.min&&f.ming&&(g=f.max));let T=new nt({targetGeometry:m,scale:g,rotation:u});return n&&(T=n.fit(T),n.constrainByGeometry(T),n.rotationEnabled||(T.rotation=o.rotation)),T}function G(t,e){const i=t.targetGeometry,n=e.targetGeometry;return i.x=n.x,i.y=n.y,i.spatialReference=n.spatialReference,t.scale=e.scale,t.rotation=e.rotation,t}function xh(t,e,i){return i?N(t,.5*(e[0]-i.right+i.left),.5*(e[1]-i.bottom+i.top)):_i(t,e,.5)}const Ph=function(){const t=O();return function(e,i,n){const s=i.targetGeometry;xn(t,s);const o=.5*ue(i);return e.xmin=t[0]-o*n[0],e.ymin=t[1]-o*n[1],e.xmax=t[0]+o*n[0],e.ymax=t[1]+o*n[1],e.spatialReference=s.spatialReference,e}}();function Sh(t,e,i,n,s){return Ji(t,e,i.center),t.scale=fi(i,n),s?.constraints?.constrain(t),t}function kh(t,e,i,n){return kn(t,e,i,n),ho(t,t)}const Do=function(){const t=O();return function(e,i,n){return ao(e,Ih(e,i),xh(t,i,n))}}(),Eh=function(){const t=xt(),e=O();return function(i,n,s,o){const a=ue(n),h=Pn(n);return N(e,a,a),Hr(t,e),bn(t,t,h),oi(t,t,Do(e,s,o)),oi(t,t,[0,o.top-o.bottom]),N(i,t[4],t[5])}}();function ue(t){return t.scale*Ro(t.targetGeometry?.spatialReference)}function Ro(t){return t!=null&&eo(t)?1/(Io(t)*Eo*ko):1}function Pn(t){return ro(t.rotation)||0}function Ch(t){return eo(t)?Io(t)*Eo*ko:1}function Ih(t,e){return _i(t,e,.5)}const Sn=function(){const t=O(),e=O(),i=O();return function(n,s,o,a,h,c){return Vr(t,s),_i(e,o,.5*c),N(i,1/a*c,-1/a*c),co(n,e),h&&bn(n,n,h),lo(n,n,i),oi(n,n,t),n}}(),kn=function(){const t=O();return function(e,i,n,s){const o=ue(i),a=Pn(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,a,s)}}(),Dh=function(){const t=O();return function(e,i,n,s){const o=ue(i);return xn(t,i.targetGeometry),Sn(e,t,n,o,0,s)}}();function Lo(t){const e=Bs(t);return e?e.valid[1]-e.valid[0]:0}function Rh(t,e){return Math.round(Lo(t)/e)}const Lh=function(){const t=O(),e=O(),i=[0,0,0];return function(n,s,o){qi(t,n,s),qn(t,t),qi(e,n,o),qn(e,e),Ir(i,t,e);let a=Math.acos(Dr(t,e)/(Bn(t)*Bn(e)))*bh;return i[2]<0&&(a=-a),isNaN(a)&&(a=0),a}}(),Vh=function(){const t=O();return function(e,i,n,s){const o=e.targetGeometry;return G(e,i),Eh(t,i,n,s),o.x+=t[0],o.y+=t[1],e}}(),Ji=function(t,e,i){G(t,e);const n=t.targetGeometry;return n.x=i.x,n.y=i.y,n.spatialReference=i.spatialReference,t},Oh=function(){const t=O();return function(e,i,n,s,o){o||(o="center"),ao(t,n,s),_i(t,t,.5);const a=t[0],h=t[1];switch(o){case"center":N(t,0,0);break;case"left":N(t,-a,0);break;case"top":N(t,0,h);break;case"right":N(t,a,0);break;case"bottom":N(t,0,-h);break;case"top-left":N(t,-a,h);break;case"bottom-left":N(t,-a,-h);break;case"top-right":N(t,a,h);break;case"bottom-right":N(t,a,-h)}return vi(e,i,t),e}}();function xu(t,e,i){return G(t,e),t.rotation+=i,t}function Ah(t,e,i){return G(t,e),t.rotation=i,t}const zh=function(){const t=O();return function(e,i,n,s,o){return G(e,i),isNaN(n)||n===0||(Oo(t,s,i,o),e.scale=i.scale*n,Ao(t,t,e,o),vi(e,e,N(t,t[0]-s[0],s[1]-t[1]))),e}}();function ms(t,e,i){return G(t,e),t.scale=i,t}const Vo=function(){const t=O();return function(e,i,n,s,o,a){return G(e,i),isNaN(n)||n===0||(Oo(t,o,i,a),e.scale=i.scale*n,e.rotation+=s,Ao(t,t,e,a),vi(e,e,N(t,t[0]-o[0],o[1]-t[1]))),e}}(),Pu=function(){const t=O(),e=O();return function(i,n,s,o,a,h,c){return Do(e,h,c),Rr(t,a,e),o?Vo(i,n,s,o,t,h):zh(i,n,s,t,h)}}(),Oo=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kh(t,n,s,1))}}(),Ao=function(){const t=xt();return function(e,i,n,s){return Tt(e,i,kn(t,n,s,1))}}(),vi=function(){const t=O(),e=xt();return function(i,n,s){G(i,n);const o=ue(n),a=i.targetGeometry;return Or(e,Pn(n)),lo(e,e,Cr(o,o)),Tt(t,s,e),a.x+=t[0],a.y+=t[1],i}}();function Ye(){const t=new Float32Array(9);return t[0]=1,t[4]=1,t[8]=1,t}function Nh(t){const e=new Float32Array(9);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 Fh(t,e,i,n,s,o,a,h,c){const p=new Float32Array(9);return p[0]=t,p[1]=e,p[2]=i,p[3]=n,p[4]=s,p[5]=o,p[6]=a,p[7]=h,p[8]=c,p}function Hh(t,e){return new Float32Array(t,e,9)}Object.freeze(Object.defineProperty({__proto__:null,clone:Nh,create:Ye,createView:Hh,fromValues:Fh},Symbol.toStringTag,{value:"Module"}));function Zh(t){return t instanceof Float32Array&&t.length>=2}function Gh(t){return Array.isArray(t)&&t.length>=2}function Oi(t){return Zh(t)||Gh(t)}var tn;const ut=[0,0];let _t=tn=class extends cn{constructor(t){super(t),this._viewpoint2D={center:O(),rotation:0,scale:0,spatialReference:void 0},this.center=[0,0],this.extent=new Xt,this.id=0,this.inverseTransform=xt(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=xt(),this.transformNoRotation=xt(),this.displayMat3=Ye(),this.displayViewMat3=Ye(),this.viewMat3=Ye(),this.viewMat2d=zr(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(t){this._set("pixelRatio",t),this._update()}set size(t){this._set("size",t),this._update()}set viewpoint(t){if(t){const e=this._viewpoint2D,i=t.targetGeometry;e.center[0]=i.x,e.center[1]=i.y,e.rotation=t.rotation,e.scale=t.scale,e.spatialReference=i.spatialReference}this._update()}get visibleArea(){const[t,e]=this.size;return[this.toMap([0,0],0,0),this.toMap([0,0],0,e),this.toMap([0,0],t,e),this.toMap([0,0],t,0)]}copy(t){const e=this.size,i=this.viewpoint;return i&&e?(this.viewpoint=G(i,t.viewpoint),this._set("size",Se(e,t.size))):(this.viewpoint=t.viewpoint.clone(),this._set("size",[t.size[0],t.size[1]])),this._set("pixelRatio",t.pixelRatio),this}clone(){return new tn({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(t,e,i){return Oi(e)?Tt(t,e,this.inverseTransform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.inverseTransform))}toScreen(t,e,i){return Oi(e)?Tt(t,e,this.transform):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transform))}toScreenNoRotation(t,e,i){return Oi(e)?Tt(t,e,this.transformNoRotation):(ut[0]=e,ut[1]=i,Tt(t,ut,this.transformNoRotation))}wrapMapCoordinate(t,e){Se(t,e);const[i]=e,[n]=this.center,{extent:s,spatialReference:o}=this;let{xmin:a,xmax:h}=s;if(o.isWrappable){const c=Lo(o)/2;a=Math.max(a,n-c),h=Math.min(h,n+c)}return(ih)&&(t[0]=Tn(i,n,o)),t}getScreenTransform(t,e){const{center:i}=this._viewpoint2D,n=this._get("pixelRatio")||1,s=this._get("size");return Sn(t,i,s,e,0,n),t}_update(){const{center:t,spatialReference:e,scale:i,rotation:n}=this._viewpoint2D,s=this._get("pixelRatio")||1,o=this._get("size"),a=new nt({targetGeometry:new V(t[0],t[1],e),scale:i,rotation:n});if(this._set("viewpoint",a),!o||!e||!i)return;this.resolution=ue(a),this.rotation=n,this.scale=i,this.spatialReference=e,Se(this.center,t);const h=o[0]!==0?2/o[0]:0,c=o[1]!==0?-2/o[1]:0;Gr(this.displayMat3,h,0,0,0,c,0,-1,1,1);const p=$r(this.viewMat3),d=Xn(o[0]/2,o[1]/2),m=Xn(-o[0]/2,-o[1]/2),u=ro(n);Yn(p,p,d),Wr(p,p,u),Yn(p,p,m),Ur(this.displayViewMat3,this.displayMat3,p);const g=co(this.viewMat2d,d);return bn(g,g,u),oi(g,g,m),Ph(this.extent,a,o),kn(this.transform,a,o,s),ho(this.inverseTransform,this.transform),Dh(this.transformNoRotation,a,o,s),this.worldScreenWidth=Rh(this.spatialReference,this.resolution),this._set("id",this.id+1),this.notifyChange("visibleArea"),this}};r([l({readOnly:!0})],_t.prototype,"id",void 0),r([l({value:1,json:{write:!0}})],_t.prototype,"pixelRatio",null),r([l({json:{write:!0}})],_t.prototype,"size",null),r([l()],_t.prototype,"spatialReference",void 0),r([l({type:nt,json:{write:!0}})],_t.prototype,"viewpoint",null),r([l({readOnly:!0})],_t.prototype,"visibleArea",null),_t=tn=r([_("esri.views.2d.ViewState")],_t);const gs=_t;var en,nn;let Mt=en=class extends M{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new en({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};r([l()],Mt.prototype,"left",void 0),r([l()],Mt.prototype,"top",void 0),r([l()],Mt.prototype,"right",void 0),r([l()],Mt.prototype,"bottom",void 0),Mt=en=r([_("esri.views.2d.PaddedViewState.Padding")],Mt);let oe=nn=class extends gs{constructor(...t){super(...t),this.paddedViewState=new gs,this._updateContent=(()=>{const e=O();return()=>{const i=this._get("size"),n=this._get("padding");if(!i||!n)return;const s=this.paddedViewState;N(e,n.left+n.right,n.top+n.bottom),qi(e,i,e),Se(s.size,e);const o=s.viewpoint;o&&(this.viewpoint=o)}})(),this.addHandles(w(()=>[this.size,this.padding],()=>this._updateContent(),Ee)),this.padding=new Mt,this.size=[0,0]}set padding(t){this._set("padding",t||new Mt)}set viewpoint(t){if(t){this.paddedViewState.viewpoint=t;let e=t;const i=this._get("padding");i&&(e=Vh(t.clone(),t,this._get("size"),i));const{targetGeometry:n,rotation:s,scale:o}=e,{x:a,y:h,spatialReference:c}=n,p=this._viewpoint2D;p.center[0]=a,p.center[1]=h,p.rotation=s,p.scale=o,p.spatialReference=c,this._update()}}clone(){return new nn({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};r([l()],oe.prototype,"paddedViewState",void 0),r([l({type:Mt})],oe.prototype,"padding",null),r([l()],oe.prototype,"viewpoint",null),oe=nn=r([_("esri.views.2d.PaddedViewState")],oe);const En=oe;let ys=class{constructor(t){this._view=t,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0})}get view(){return this._view}get size(){const[t,e]=this._view.size;return Math.sqrt(t*t+e*e)}get scale(){return this.viewpoint.scale}get rotation(){return this.viewpoint.rotation}get center(){return this.viewpoint.targetGeometry}get scaleToResolutionFactor(){return Ro(this.center.spatialReference)}pixelsPerPanAtZoom(t){return 1/(t*this.scaleToResolutionFactor)}zoomAtPixelsPerPan(t){return 1/(t*this.scaleToResolutionFactor)}pixelsPerRotate(){return this.size/2}compareTo(t,e){e.pan=dr(this.center,t.center);let i=Math.abs(t.rotation-this.rotation);i=i>=180?360-i:i,e.rotate=gn(i),e.sourceZoom=this.scale,e.targetZoom=t.scale}interpolate(t,e,i){const{pan:n,rotate:s,zoom:o,zoomOffset:a}=i,{center:h}=this;h.spatialReference=t.center.spatialReference,h.x=Fe(t.center.x,e.center.x,n),h.y=Fe(t.center.y,e.center.y,n),this.viewpoint.scale=Fe(t.scale,e.scale+a,o);let c=t.rotation;const p=e.rotation;Math.abs(p-c)>=180&&(c+=360*(ct*t,$h=t=>1-zo(1-t),Wh=t=>2**(10*(t-1)),Uh=t=>1-Wh(1-t);function jh(t){const e=2*(t-Math.sqrt((t-1)*t)),i=e/2/t;return n=>ni1e-5}get hasPan(){return this.compared.pan>xi()}get hasFov(){return Math.abs(this.compared.fov)>xi()}get hasRotate(){return this.compared.rotate>xi()}},Yh=class{constructor(){this.pan=0,this.rotate=0,this.zoom=0,this.fov=0,this.zoomOffset=0}},Xh=class{constructor(){this.segments=new Array}get time(){return this.segments.reduce((t,e)=>X(t+e.time),X(0))}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),t*=this.time;let i=0,n=0;const s=this.definition,o=this.segments.reduce((a,h)=>a||h.definition.hasZoom,!1);for(let a=0;aMath.abs(p-u)?d:p;e.zoomOffset=f-g,e.zoom=(m-u)/(f-u)}else e.zoom=1;return e}t-=h.time,i+=c.compared.pan,n+=c.compared.rotate}}segmentInterpolateComponentsAt(t,e,i){t.interpolateComponentsAt(e,i)}},Ai=class{get time(){return this._time}constructor(t){t&&this.update(t)}update(t){t&&(this.definition?this.definition.copyFrom(t):this.definition=t.clone()),this._updatePrecomputedVariables(),this._updatePixelFlow()}_updatePrecomputedVariables(){const t=this.definition,e=t.compared,i=e.sourceZoom,n=e.targetZoom;this._zoomSign=i>n?1:-1,this._panPixelsAtSource=e.pan*t.source.pixelsPerPanAtZoom(i);const s=(t.source.pixelsPerRotate()+t.target.pixelsPerRotate())/2;this._rotatePixels=e.rotate*s}_updatePixelFlow(){const t=this.definition.compared.sourceZoom,e=this.definition.compared.targetZoom,{hasZoom:i,hasPan:n,hasRotate:s}=this.definition;let o=0,a=0;i&&(n&&(o=(e/t-1)/(-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2*this._panPixelsAtSource)),s&&(a=this._zoomSign*(Math.log(t/e)/Math.LN2)*this.definition.halfWindowSize/this._rotatePixels)),this._zoomPixelFlow=0,this._panPixelFlow=0,this._rotatePixelFlow=0;const h=this.definition.desiredPixelFlow;if(i&&n&&s){const c=o+a+o*a;this._zoomPixelFlow=o*a/c*h,this._panPixelFlow=a/c*h,this._rotatePixelFlow=o/c*h}else if(i&&n){const c=1+o;this._zoomPixelFlow=o/c*h,this._panPixelFlow=1/c*h}else if(i&&s){const c=1+a;this._zoomPixelFlow=a/c*h,this._rotatePixelFlow=1/c*h}else if(n&&s){const c=this._panPixelsAtSource/this._rotatePixels,p=1+c;this._panPixelFlow=c/p*h,this._rotatePixelFlow=1/p*h}else n?this._panPixelFlow=h:i?this._zoomPixelFlow=h:s&&(this._rotatePixelFlow=h);if(this._time=X(Math.max(this.rotateTime,this.zoomTime,this.panTime)),this.fovTime>this._time){const c=this.fovTime/this._time;this._time=this.fovTime,this._zoomPixelFlow/=c,this._panPixelFlow/=c,this._rotatePixelFlow/=c}}get rotateTime(){return this.definition.hasRotate?X(this._rotatePixels/this._rotatePixelFlow):X(0)}get zoomTime(){return this.definition.hasZoom?X(this._zoomSign*(Math.log(this.definition.compared.sourceZoom/this.definition.compared.targetZoom)/Math.LN2)*this.definition.halfWindowSize/this._zoomPixelFlow):X(0)}get fovTime(){return this.definition.hasFov?X(Math.abs(this.definition.compared.fov)/Qh):X(0)}get panTime(){if(!this.definition.hasPan)return X(0);if(this.definition.hasZoom){const t=-1/(this._zoomSign*this.definition.halfWindowSize)*Math.LN2,e=t*this._panPixelsAtSource;return X(Math.log(e*(this._zoomPixelFlow/this._panPixelFlow)+1)/(t*this._zoomPixelFlow))}return X(this._panPixelsAtSource/this._panPixelFlow)}_interpolateComponentsZoom(t){if(t===0||t===1)return t;if(this.definition.hasZoom){const e=this.definition.compared.sourceZoom,i=this.definition.compared.targetZoom;return(e*(e/i)**-t-e)/(i-e)}return t}_interpolateComponentsFov(t){if(t===0)return this.definition.segmentStart;if(t===1)return this.definition.segmentEnd;if(this.definition.hasFov){const{segmentStart:e,segmentEnd:i}=this.definition;return e+t*(i-e)}return this.definition.segmentStart}_interpolateComponentsPan(t){if(t===0||t===1)return t;if(this.definition.hasPan&&this.definition.hasZoom){const e=-1/(this._zoomSign*this.definition.halfWindowSize)*this._zoomPixelFlow;return 1/this._panPixelsAtSource*(this._panPixelFlow*(2**(e*t*this._time)-1))/(e*Math.LN2)}return t}_interpolateComponentsRotate(t){return t}interpolateComponentsAt(t,e){t=Math.min(Math.max(t,0),1),e.zoom=this._interpolateComponentsZoom(t),e.pan=this._interpolateComponentsPan(t),e.rotate=this._interpolateComponentsRotate(t),e.zoomOffset=0,e.fov=this._interpolateComponentsFov(t)}};const Qh=gn(45);function Jh(t,e,i){const n=e-t.compared.sourceZoom,s=t.halfWindowPanAtZoom(n);return-t.halfWindowSize*(i.ascensionFactor*Math.LN2*t.compared.pan+s)*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2*s)}function tc(t,e,i){const n=1/e,s=Math.log(t.compared.sourceZoom*n),o=1/t.desiredPixelFlow,a=1/Math.LN2,h=e-t.compared.sourceZoom,c=1/h,p=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(h))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*n*o*a*c*p-t.halfWindowSize*s*o*a*c+t.halfWindowSize*s*o*a*p/(h*h)}function ec(t,e,i){const n=e-t.compared.sourceZoom,s=1/n,o=1/e,a=Math.log(t.compared.sourceZoom*o),h=(i.ascensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(n))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h+2*s*a+2*o-2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function ic(t,e){return-t.halfWindowSize*Math.log(t.compared.sourceZoom/e)/(t.desiredPixelFlow*Math.LN2)}function nc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function sc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function oc(t,e,i){return-t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e))}function ac(t,e,i){return t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e))}function rc(t,e,i){return-2*t.compared.pan*t.halfWindowSize*(i.ascensionFactor+i.descensionFactor-1)/(t.desiredPixelFlow*t.halfWindowPanAtZoom(e*e*e))}function lc(t,e,i){return t.halfWindowSize*(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*t.halfWindowPanAtZoom(-e+t.compared.targetZoom))}function hc(t,e,i){const n=Math.log(e/t.compared.targetZoom),s=1/t.desiredPixelFlow,o=1/Math.LN2,a=-e+t.compared.targetZoom,h=1/a,c=(-t.halfWindowPanAtZoom(e)-i.descensionFactor*Math.LN2*t.compared.pan+t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return-t.halfWindowSize*n*s*o*h+t.halfWindowSize*n*s*o*c/(a*a)+t.halfWindowSize*s*o*h*c/e}function cc(t,e,i){const n=e-t.compared.targetZoom,s=1/n,o=1/e,a=Math.log(e/t.compared.targetZoom),h=(t.halfWindowPanAtZoom(e)+i.descensionFactor*Math.LN2*t.compared.pan-t.halfWindowPanAtZoom(t.compared.targetZoom))/t.halfWindowPanAtZoom(1);return t.halfWindowSize*s*(-2*s*o*h-2*s*a+2*o+2*a*h/(n*n)-h/(e*e))/(t.desiredPixelFlow*Math.LN2)}function pc(t,e){return t.halfWindowSize*Math.log(e/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2)}function dc(t,e){return t.halfWindowSize/(e*t.desiredPixelFlow*Math.LN2)}function uc(t,e){return-t.halfWindowSize/(e*e*t.desiredPixelFlow*Math.LN2)}function mc(t){const e=t.compared.sourceZoom-t.compared.targetZoom;if(e===0)return t.compared.pan*t.halfWindowSize/(t.desiredPixelFlow*t.halfWindowPanAtZoom(t.compared.sourceZoom));const i=Math.LN2*t.compared.pan,n=e,s=t.halfWindowPanAtZoom(n),o=t.halfWindowSize*Math.log(t.compared.sourceZoom/t.compared.targetZoom)/(t.desiredPixelFlow*Math.LN2*s);return t.compared.sourceZoom<=t.compared.targetZoom?o*(i-s):o*(i+s)}function gc(t,e){let i=yc(t,e);const n={ascensionFactor:e.ascensionFactor!=null?e.ascensionFactor:.5,descensionFactor:e.descensionFactor!=null?e.descensionFactor:.5},s=n.ascensionFactor===0,o=n.descensionFactor===0,a=s?ic:Jh,h=s?nc:tc,c=s?sc:ec,p=o?pc:lc,d=o?dc:hc,m=o?uc:cc,u=x=>a(t,x,n)+oc(t,x,n)+p(t,x,n),g=x=>h(t,x,n)+ac(t,x,n)+d(t,x,n),f=x=>c(t,x,n)+rc(t,x,n)+m(t,x,n);let T=u(i);const I=mc(t);let E;const ot=e.maximumIterations||20,S=e.maximumDistance!=null?e.maximumDistance:1/0;for(E=0;Ex&&($+=x);const K=$/f(i);if(isNaN(K)||i>=S&&K<0){if(!isFinite(S))return null;i=S,T=u(i);break}if(i-=K,iI*(1-.3)||i0&&(n.definition?n.definition.copyFrom(this.definition):n.definition=this.definition.clone(),n.definition.copyFrom(this.definition),n.definition.compared.sourceZoom=t,n.definition.compared.targetZoom=t,n.definition.compared.pan=this.definition.compared.pan*h,n.definition.compared.rotate=this.definition.compared.rotate*h,n.definition.segmentStart=i.definition.segmentEnd,n.definition.segmentEnd=i.definition.segmentEnd+h,n.update(),this.segments.push(n)),s.definition?s.definition.copyFrom(this.definition):s.definition=this.definition.clone(),s.definition.compared.sourceZoom=t,s.definition.compared.pan=this.definition.compared.pan*a,s.definition.compared.rotate=this.definition.compared.rotate*a,s.definition.segmentStart=o+h,s.update(),this._descensionSegment=s,this.segments.push(s)}_updateWithoutApex(){const[t]=this._preallocSegments;t.update(this.definition),this.segments.push(t)}};const fc=new Yh;let vc=class{get time(){return this._time}get isLinear(){return this.path.segments.length===1}constructor(t){this._time=it(0),this._easing=_s,this.definition=new Kh(t),this.path=new _c}update(t,e,i){this.definition.update(t,e,i),this.path.update(this.definition,i),this._time=this._applyTimeSettings(ur(isFinite(this.path.time)?this.path.time:X(0)),i),this._easing=i.easing??(this._time>=1e3?_s:Uh)}cameraAt(t,e){t=Math.min(Math.max(0,t),1),t=this._normalizedEasing(t);const i=this.path.interpolateComponentsAt(t,fc);e.interpolate(this.definition.source,this.definition.target,i)}_normalizedEasing(t){const e=this._easing(0,this._time),i=this._easing(1,this._time);return(this._easing(t,this._time)-e)/(i-e)}_applyTimeSettings(t,e){const i=e.speedFactor!=null?e.speedFactor:1,n=e.minDuration??De.minDuration/i,s=e.maxDuration??De.maxDuration/i;return t=e.duration!=null?e.duration:it(Math.min(Math.max(t/i,n),s))}};const fs=2e3,wc=64;let bc=class{constructor(t){this._view=t,this._animation=new vc(()=>new ys(this._view)),this._current=new ys(this._view)}get _source(){return this._animation.definition.source}get _target(){return this._animation.definition.target}get duration(){return this._animation.time}get animation(){return this._animation}update(t,e,i={}){G(this._current.viewpoint,t),G(this._source.viewpoint,t),G(this._target.viewpoint,e),this._animation.update(this._source,this._target,i)}applyRatio(t,e){this._animation.cameraAt(e,this._current),G(t,this._current.viewpoint)}},ae=class extends M{constructor(t){super(t),this._animation=null,this._destinationViewState=new En,this.updateFunction=null,this.easing=jr.ease,this.viewpoint=new nt({targetGeometry:new V,scale:0,rotation:0}),this._updateTask=de({postRender:this._postRender.bind(this)}),this._updateTask.pause(),this._transition=new bc(t.view)}destroy(){this._updateTask=st(this._updateTask)}get animation(){return this._animation}set animation(t){this._animation=t,this.view.animation=t}animate(t,e,i){this.stop();const n=this.viewpoint;G(n,e);const s=(typeof i?.easing=="string"?qr(i.easing):i?.easing)||this.easing,o=t.target;this._transition.update(this.viewpoint,o,{apex:{maximumDistance:Math.min(Math.min(e.scale,o.scale)*wc,this.view.constraints.effectiveMinScale),desiredSlope:5e-8},duration:i?.duration,maxDuration:i?.animationMode==="auto"?it(1/0):i?.maxDuration??No.maxDuration,speedFactor:i?.speedFactor,easing:typeof s=="function"?h=>s(h):void 0}),i?.animationMode==="auto"&&(this._destinationViewState.copy(this.view.state),this._destinationViewState.viewpoint=o,Tc(this._transition.animation,i,this.view.state,this._destinationViewState)||this._transition.update(this.viewpoint,o,{duration:it(0)}));const a=()=>{this.animation===t&&this._updateTask&&(t.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 t.when(a,a),this._startTime=performance.now(),this._updateTask.resume(),this.animation=t,t}animateContinuous(t,e){this.stop(),this.updateFunction=e,this.viewpoint=t;const i=new Qi({target:t.clone()}),n=()=>{this.animation===i&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return i.when(n,n),this._startTime=performance.now(),this._updateTask.resume(),this.animation=i,i}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(t){const e=this.animation;if(e&&e.state!==Qi.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,t.deltaTime),this.animation?.update(this.viewpoint);else{const i=performance.now()-this._startTime,n=this._transition.duration,s=n>0?i/n:1,o=s>=1;this._transition.applyRatio(this.viewpoint,s),o&&this.animation?.finish()}this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};function Tc(t,e,i,n){if(e?.duration!=null)return!0;const{time:s,isLinear:o}=t,a=e?.speedFactor||1,h=e?.maxDuration??No.maxDuration/a;if(z("esri-goto-debug")&&(console.log("speed factor:",a),console.log("adjusted duration: ",s),console.log("adjusted max duration: ",h),console.log("is linear:",o)),s>h)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: animations must be shorter than ${h/1e3}s`),!1;if(o){const c=O(),p=H(...n.toScreen(c,...i.center)),d=H(...i.toScreen(c,...n.center)),m=d!=null&&d.x>-(1.5-.5)*i.size[0]&&d.x<(1.5+.5)*i.size[0]&&d.y>-(1.5-.5)*i.size[1]&&d.y<(1.5+.5)*i.size[1],u=p!=null&&p.x>-(1.5-.5)*n.size[0]&&p.x<(1.5+.5)*n.size[0]&&p.y>-(1.5-.5)*n.size[1]&&p.y<(1.5+.5)*n.size[1];if(z("esri-goto-debug")&&(console.log(`dest is within ${1.5} screens at start view:`,m),console.log(`start is within ${1.5} screens at dest view:`,u)),s>fs/a&&!m&&!u)return z("esri-goto-debug")&&console.warn(`failed "auto" heuristic: linear animations must be... - shorter than ${fs/1e3/a}s, or - shorter than ${h/1e3}s and the destination is close enough to the starting screen, or - - shorter than ${h/1e3}s and the start point is close enough to the destination screen`),!1}return!0}r([l()],ae.prototype,"easing",void 0),r([l()],ae.prototype,"view",void 0),r([l()],ae.prototype,"viewpoint",void 0),ae=r([_("esri.views.2d.AnimationManager")],ae);const Mc=ae;let xc=class{constructor(t){this.view=t,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this._scheduler=Br(),this.stationary=!0,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions,this._updateParameters.targetState.copy(this.view.state),this.view.animation?.target==null||to(this.view.animation.target)||(this._updateParameters.targetState.viewpoint=this.view.animation.target))},this.update=e=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:i,graphicsView:n,labelManager:s,state:{id:o}}=this.view;i.forEach(this._updateLayerView,this),s!=null&&(s.lastUpdateId!==o&&(s.viewChange(),s.lastUpdateId=o),s.updateRequested&&s.processUpdate(this._updateParameters)),n!=null&&(n.lastUpdateId!==o&&(n.viewChange(),n.lastUpdateId=o),n.updateRequested&&n.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.view.animation?this._scheduler.state=Pi.ANIMATING:this.view.interacting?this._scheduler.state=Pi.INTERACTING:this._scheduler.state=Pi.IDLE,this._scheduler.updateBudget(e)&&this._scheduler.frame()}}destroy(){this.stop(),this._scheduler.destroy()}get scheduler(){return this._scheduler}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,targetState:new En,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=w(()=>t.stationary,e=>{this.stationary=e,this.requestFrame()}),this._frameTaskHandle=de(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)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){if(!t.attached)return void this.requestUpdate();const e=this.view.state,i=t.lastUpdateId;i!=null&&(this.stationary||t.moving)||(t.moving=!0),i!==e.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=e.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews?.forEach(this._updateLayerView,this)}},Xe=class extends M{constructor(t){super(t),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(t,e){if(!t)return void D.getLogger(this).error("#goTo()","target cannot be null or undefined");const i=new Qi;this.view.animation=i,await pn(()=>this.view.ready,e);const n={...e,animate:e?.animate??!wo(),animationMode:e?.animationMode??"auto"},{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d}=this.view,m=Mh(t,{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d,pickClosestTarget:e?.pickClosestTarget??!0});return i?.update(m),this._gotoTask={},n.animate?this._gotoAnimated(m,n):this._gotoImmediate(m,n)}_gotoImmediate(t,e){const i=this._gotoTask,n=this.view.animation,s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");this.view.viewpoint=n.target=o,n.finish()});return this._cancellableGoTo(i,n,s,e)}_gotoAnimated(t,e){const i=this._gotoTask,n=this.view.animation;if(!n)return Promise.resolve();const s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");return n.update(o),this.view.animationManager.animate(n,this.view.viewpoint,e),n.when().then(()=>{},()=>{})});return this._cancellableGoTo(i,n,s,e)}_cancellableGoTo(t,e,i,n){const s=()=>t===this._gotoTask;return Ka(i,n).finally(()=>{s()&&(e.done||e.stop())})}};r([l({constructOnly:!0})],Xe.prototype,"view",void 0),Xe=r([_("esri.views.2d.GoToManager")],Xe);function k(){return Promise.all([b(()=>import("./webglDeps-Bgavuh0h-CPBMgmjx.js"),__vite__mapDeps([141,142,3,1,2,4,135,134,143,144,145,146]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-Ccomlwj9.js"),__vite__mapDeps([147,1,2,3,4,116,45,46,24,47,148,149,58,150,30,29,133,112,113,114,115,78,111,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,156,128,146,157,158,145,132,159,160,27,22,23,161,162,163,164,59,39,137,165,166,44,48,167,168,169,141,144,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,177,178,179,180,181,136,182,57,183,184,185,186,187,188,189,190,191,192,193,194,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,41,138]),import.meta.url)])}const ye=()=>k().then(()=>b(()=>import("./TileLayerView2D-CT-Yu10P-BdNTZA0Y.js"),__vite__mapDeps([195,3,1,2,4,125,45,46,24,47,29,30,166,133,148,149,58,150,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,44,48,160,27,22,23,158,146,145,128,132,159,161,162,163,164,59,169,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,57,156,157,39,137,167,168,178,179,180,186,187,196,197,191,198,118,199,189,190,200,201,202,203,64,204,193,205,206,207,208,131,10,119,120,121,6,7,123,18,19,20,21,38,124,77,71,72,126,130,136,41,138]),import.meta.url)),zt=()=>k().then(()=>b(()=>import("./FeatureLayerView2D-NmRd_IhT-CufQiRFK.js"),__vite__mapDeps([209,3,1,2,4,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url).then(t=>t.F)),vs={"base-dynamic":()=>k().then(()=>b(()=>import("./BaseDynamicLayerView2D-AQ-6l0DU-fdOF1reR.js"),__vite__mapDeps([212,3,1,2,4,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,214,120,121,197,200,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,131,136,137,41,138]),import.meta.url)),"base-tile":ye,"bing-maps":ye,catalog:()=>k().then(()=>b(()=>import("./CatalogLayerView2D-DaUVeBuS-ZiacRCRh.js"),__vite__mapDeps([215,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"catalog-dynamic-group":()=>k().then(()=>b(()=>import("./CatalogDynamicGroupLayerView2D-Cf-H7gda-CFkeOMDr.js"),__vite__mapDeps([216,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"catalog-footprint":()=>k().then(()=>b(()=>import("./CatalogFootprintLayerView2D-C0bBWVdF-CeR3Mj-n.js"),__vite__mapDeps([217,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),csv:zt,"geo-rss":()=>k().then(()=>b(()=>import("./GeoRSSLayerView2D-BLTYupUX-BfrBO27g.js"),__vite__mapDeps([218,3,1,2,4,32,33,25,34,35,36,37,38,39,40,31,41,42,43,44,45,46,24,47,29,30,48,49,63,14,15,198,160,27,22,23,118,122,188,189,190,133,148,149,58,150,112,113,114,115,78,111,116,117,13,16,129,151,152,135,134,143,142,153,154,155,127,191,158,146,145,128,132,159,161,162,163,164,59,156,157,137,53,54,51,55,186,173,65,174,175,61,62,176,92,187,10,119,120,121,6,7,123,18,19,20,21,124,77,125,71,72,126,130,131,136,138]),import.meta.url)),feature:zt,geojson:zt,parquet:zt,graphics:()=>k().then(()=>b(()=>import("./GraphicsLayerView2D-CGXlTqHO-C-E0GBj7.js"),__vite__mapDeps([219,3,1,2,4,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,211,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),group:()=>k().then(()=>b(()=>import("./GroupLayerView2D-BR-kLeLa-BQ6LGY1P.js"),__vite__mapDeps([220,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),imagery:()=>k().then(()=>b(()=>import("./ImageryLayerView2D-CVDvTIGY-DlSiRq0n.js"),__vite__mapDeps([221,3,1,2,4,125,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,186,42,43,148,149,150,29,151,154,155,46,47,44,45,48,173,65,174,175,61,62,53,54,51,55,176,92,34,156,157,39,137,187,199,189,190,191,213,197,214,120,121,224,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,71,72,126,130,131,136,41,138]),import.meta.url)),"imagery-tile":()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-CG0NmUYm.js"),__vite__mapDeps([225,3,1,2,4,226,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,227,191,120,121,228,224,61,62,131,137,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,41,138]),import.meta.url)),kml:()=>k().then(()=>b(()=>import("./KMLLayerView2D-hWgNYT5J-D43neN7r.js"),__vite__mapDeps([229,3,1,2,4,61,62,230,32,33,25,34,35,36,37,38,39,40,31,41,42,43,44,45,46,24,47,29,30,48,49,63,14,15,51,125,197,128,129,160,27,22,23,134,135,213,158,133,152,143,142,153,146,145,112,113,114,115,78,111,116,117,13,16,132,159,161,162,163,127,164,58,59,198,118,122,188,189,190,148,149,150,151,154,155,191,156,157,137,53,54,55,186,173,65,174,175,176,92,187,224,177,141,144,178,179,180,172,166,181,227,10,119,120,121,6,7,123,18,19,20,21,124,77,71,72,126,130,131,136,138]),import.meta.url)),"knowledge-graph":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-PzhwY4G0.js"),__vite__mapDeps([231,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"link-chart":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-PzhwY4G0.js"),__vite__mapDeps([231,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"knowledge-graph-sublayer":zt,"map-image":()=>k().then(()=>b(()=>import("./MapImageLayerView2D-LI7T-1xm-CBbeiZP3.js"),__vite__mapDeps([232,3,1,2,4,125,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,186,42,43,148,149,150,29,151,154,155,46,47,44,45,48,173,65,174,175,61,62,53,54,51,55,176,92,34,156,157,39,137,187,199,189,190,191,214,120,121,197,233,193,205,207,210,200,201,202,203,64,204,206,208,10,119,6,7,123,18,19,20,21,38,124,77,71,72,126,130,131,136,41,138]),import.meta.url)),"map-notes":()=>k().then(()=>b(()=>import("./MapNotesLayerView2D-EusnP8A_-vtvY-W3D.js"),__vite__mapDeps([234,3,1,2,4,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),media:()=>k().then(()=>b(()=>import("./MediaLayerView2D-COWFkA3m-_gATxPeF.js"),__vite__mapDeps([235,1,2,3,4,33,25,34,35,36,37,38,39,40,32,31,41,42,43,44,45,46,24,47,29,30,48,49,236,61,62,187,54,128,237,114,132,166,133,148,149,58,150,112,113,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,160,27,22,23,158,146,145,159,161,162,163,164,59,169,170,171,172,173,65,174,175,53,51,55,176,92,57,156,157,137,167,168,178,179,180,186,183,184,238,198,118,131,10,119,120,121,6,7,123,18,19,20,21,124,77,125,71,72,126,130,136,138]),import.meta.url)),"ogc-feature":()=>k().then(()=>b(()=>import("./OGCFeatureLayerView2D-CpSy5D2s-nBaV6Pmc.js"),__vite__mapDeps([239,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),"open-street-map":ye,"oriented-imagery":zt,route:()=>k().then(()=>b(()=>import("./RouteLayerView2D-Bpui7Ggx-fxzuJ6ql.js"),__vite__mapDeps([240,3,1,2,4,119,241,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,10,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),stream:()=>k().then(()=>b(()=>import("./StreamLayerView2D-Bh_aEalU-D-95GXg2.js"),__vite__mapDeps([242,3,1,2,4,63,14,15,209,38,160,27,22,23,24,164,58,59,88,13,16,210,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),"subtype-group":()=>k().then(()=>b(()=>import("./SubtypeGroupLayerView2D-Byn0xzbb-Qz-0ZBbK.js"),__vite__mapDeps([243,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),tile:ye,"vector-tile":()=>k().then(()=>b(()=>import("./VectorTileLayerView2D-B9OYHbL4-Ctr5GCiP.js"),__vite__mapDeps([244,3,1,2,4,34,169,78,151,134,135,57,182,166,157,113,31,112,24,114,115,111,116,117,13,14,15,16,128,150,142,146,162,158,133,152,30,143,153,129,145,132,159,160,27,22,23,161,163,127,164,58,59,120,121,191,245,246,247,45,46,47,130,198,118,122,200,131,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,136,137,41,138]),import.meta.url)),video:()=>k().then(()=>b(()=>import("./VideoLayerView2D-CLcxq4ZA-ZAPPyz9l.js"),__vite__mapDeps([248,3,1,2,4,249,125,77,16,82,83,27,22,23,24,100,69,39,250,238,128,129,159,53,54,51,55,158,133,152,30,135,134,143,142,153,146,145,112,113,114,115,78,111,116,117,13,14,15,132,160,161,162,163,127,164,58,59,156,148,149,150,29,151,154,155,46,47,122,157,137,61,62,198,118,188,189,190,191,186,42,43,44,45,48,173,65,174,175,176,92,34,187,10,119,120,121,6,7,123,18,19,20,21,38,124,71,72,126,130,131,136,41,138]),import.meta.url)),wcs:()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-CG0NmUYm.js"),__vite__mapDeps([225,3,1,2,4,226,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,227,191,120,121,228,224,61,62,131,137,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,41,138]),import.meta.url)),"web-tile":ye,wfs:zt,wms:()=>k().then(()=>b(()=>import("./WMSLayerView2D-Dz-z-fa9-B7OZ7TF_.js"),__vite__mapDeps([251,3,1,2,4,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,214,120,121,197,200,252,210,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,131,136,137,41,138]),import.meta.url)),wmts:()=>k().then(()=>b(()=>import("./WMTSLayerView2D-Bl5FUDUu-DLQ4k-_a.js"),__vite__mapDeps([253,3,1,2,4,196,197,128,24,129,160,27,22,23,134,135,158,133,152,30,143,142,153,146,145,112,113,114,115,78,111,116,117,13,14,15,16,132,159,161,162,163,127,164,58,59,191,198,118,122,200,131,10,119,61,62,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,137,41,138]),import.meta.url)),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,focusArea:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,viewshed:null,voxel:null,scene:null,unknown:null,unsupported:null};function Pc(t){const e=t.declaredClass?t.declaredClass.slice(t.declaredClass.lastIndexOf(".")+1):"Unknown",i=e.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new C(`${i}:view-not-supported`,`${e} is not supported in 2D`)}const ws={hasLayerViewModule:t=>vs[t.type]!=null,importLayerView:t=>{const e=vs[t.type];if(e==null)throw Pc(t);return e(t)}};function Sc(t,e){const{spatialReference:i}=e,n=[e.x,e.y];let s=Number.POSITIVE_INFINITY,o=0,a=0;const h=[0,0],c=t.type==="extent"?[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]:t.rings;for(const p of c)for(let d=0;dd.clone()),e.sort((d,m)=>m.scale-d.scale),e.forEach((d,m)=>d.level=m);for(const d of e)!c&&i>0&&i>=d.scale&&(a=d.level,c=!0),!p&&n>0&&n>=d.scale&&(h=t?t.level:-1,p=!0),t=d;s===-1&&(s=i===0?0:a),o===-1&&(o=n===0?e.length-1:h),s=Math.max(s,0),s=Math.min(s,e.length-1),o=Math.max(o,0),o=Math.min(o,e.length-1),s>o&&([s,o]=[o,s]),i=e[s].scale,n=e[o].scale,e.splice(0,s),e.splice(o-s+1,e.length),e.forEach((d,m)=>{this._lodByScale[d.scale]=d,this._scales[m]=d.scale}),this._set("effectiveLODs",e),this._set("effectiveMinZoom",s),this._set("effectiveMaxZoom",o),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",n)}constrain(t,e){if(e&&t.scale===e.scale)return t;const i=this.effectiveMinScale,n=this.effectiveMaxScale,s=t.targetGeometry,o=e&&e.targetGeometry,a=n!==0&&t.scalei;if(a||h){const c=h?i:n;if(e&&o){const p=(c-e.scale)/(t.scale-e.scale);s.x=o.x+(s.x-o.x)*p,s.y=o.y+(s.y-o.y)*p}t.scale=c}return this.snapToZoom&&this.effectiveLODs&&(t.scale=this._getClosestScale(t.scale)),t}fit(t){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(t,null);const e=this.scaleToZoom(t.scale),i=Math.abs(e-Math.floor(e));return t.scale=this.zoomToScale(i>.99?Math.round(e):Math.floor(e)),t}zoomToScale(t){if(!this.effectiveLODs)return 0;t-=this.effectiveMinZoom,t=Math.max(0,t);const e=this._scales;if(t<=0)return e[0];if(t>=e.length)return e[e.length-1];const i=Math.floor(t),n=Math.ceil(t);return e[i]+(t-i)*(e[n]-e[i])}scaleToZoom(t){if(!this.effectiveLODs)return-1;const e=this._scales;let i,n;if(t>=e[0])return this.effectiveMinZoom;if(t<=e[e.length-1])return this.effectiveMaxZoom;for(let s=0;st&&nMath.abs(i-t)<=Math.abs(e-t)?i:e,this._scales[0])),this._lodByScale[t].scale}};r([l({readOnly:!0})],q.prototype,"effectiveLODs",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinScale",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxScale",void 0),r([l()],q.prototype,"lods",void 0),r([l()],q.prototype,"minZoom",void 0),r([l()],q.prototype,"maxZoom",void 0),r([l()],q.prototype,"minScale",void 0),r([l()],q.prototype,"maxScale",void 0),r([l()],q.prototype,"snapToZoom",void 0),q=an=r([_("esri.views.2d.constraints.ZoomConstraint")],q);const Zo=q,kc={base:null,key:"type",typeMap:{extent:Xt,polygon:Xs}};let R=class extends M{constructor(t){super(t),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0,this.customConstraints=new L}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(t){t?this._set("geometry",t):this._set("geometry",null)}get version(){return`${this._zoom?.uid}/${this._rotation?.uid}/${this._geometry?.uid}`}get _geometry(){const t=this._get("_geometry");return t&&this.geometry===t.geometry&&this.view?.constraintsInfo.spatialReference===t.spatialReference?t:new qt({geometry:this.geometry,spatialReference:this.view?.constraintsInfo.spatialReference})}get _rotation(){return new Ho({rotationEnabled:this.rotationEnabled})}get _zoom(){const t=this._get("_zoom"),e=this.lods||this.view?.constraintsInfo.lods,i=this.minZoom,n=this.maxZoom,s=this.minScale,o=this.maxScale,a=this.snapToZoom;return t&&t.lods===e&&t.minZoom===i&&t.maxZoom===n&&t.minScale===s&&t.maxScale===o&&t.snapToZoom===a?t:new Zo({lods:e,minZoom:i,maxZoom:n,minScale:s,maxScale:o,snapToZoom:a})}canZoomInTo(t){const e=this.effectiveMaxScale;return e===0||t>=e}canZoomOutTo(t){const e=this.effectiveMinScale;return e===0||t<=e}constrain(t,e){return this._zoom.constrain(t,e),this._rotation.constrain(t,e),this._geometry.constrain(t,e),this.customConstraints.forEach(i=>i.constrain(t,e)),t}constrainByGeometry(t){return this._geometry.constrain(t),this.customConstraints.forEach(e=>e.applyPanConstraint?.(t)),t}fit(t){return this._zoom.fit(t)}zoomToScale(t){return this._zoom.zoomToScale(t)}scaleToZoom(t){return this._zoom.scaleToZoom(t)}snapScale(t){return this._zoom.snapToClosestScale(t)}snapToNextScale(t){return this._zoom.snapToNextScale(t)}snapToPreviousScale(t){return this._zoom.snapToPreviousScale(t)}};r([l({readOnly:!0})],R.prototype,"effectiveLODs",null),r([l({readOnly:!0})],R.prototype,"effectiveMinScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMinZoom",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxZoom",null),r([l({types:kc,value:null})],R.prototype,"geometry",null),r([l({type:[_r]})],R.prototype,"lods",void 0),r([l()],R.prototype,"minScale",void 0),r([l()],R.prototype,"maxScale",void 0),r([l()],R.prototype,"minZoom",void 0),r([l()],R.prototype,"maxZoom",void 0),r([l()],R.prototype,"rotationEnabled",void 0),r([l()],R.prototype,"snapToZoom",void 0),r([l({type:L})],R.prototype,"customConstraints",void 0),r([l()],R.prototype,"view",void 0),r([l({readOnly:!0})],R.prototype,"version",null),r([l({type:qt,readOnly:!0})],R.prototype,"_geometry",null),r([l({type:Ho})],R.prototype,"_rotation",null),r([l({readOnly:!0,type:Zo})],R.prototype,"_zoom",null),R=r([_("esri.views.2d.MapViewConstraints")],R);const Go=R;let Z=class extends M{constructor(t){super(t),this.constraints=null,this.ready=!1,this.resizeAlign="center",this.addHandles([w(()=>this.constraints?.version,e=>{this.constraints&&e&&this.ready&&(this.state.viewpoint=this.constraints.fit(this.state.paddedViewState.viewpoint))},Ee)])}get center(){if(!this.ready)return this._get("center");const{center:t,spatialReference:e}=this.state.paddedViewState;return this.state.commitProperty("id"),new V({x:t[0],y:t[1],spatialReference:e})}set center(t){if(t==null)return;if(!this.ready)return void this._set("center",t);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-center","could not project the value in the view's spatial reference",{input:t,error:n}))}const i=this.viewpoint;Ji(i,i,e),this.viewpoint=i}get extent(){return this.ready?(this.state.commitProperty("id"),this.state.paddedViewState.extent.clone()):this._get("extent")}set extent(t){if(t==null)return;if(!t.width||!t.height)return void D.getLogger(this).error(new C("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",t),this._set("center",void 0),this._set("viewpoint",void 0),this._set("scale",void 0),void this._set("zoom",void 0);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:n}))}const i=this.viewpoint;Sh(i,i,e,this.state.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(t){this.ready?(this.state.padding=t,this._set("padding",this.state.padding)):this._set("padding",t)}get resolution(){return this.ready?(this.state.commitProperty("id"),this.state.resolution):0}get rotation(){return this.ready?(this.state.commitProperty("id"),this.state.rotation):this._get("rotation")}set rotation(t){if(isNaN(t))return;if(!this.ready)return void this._set("rotation",t);const e=this.viewpoint;Ah(e,e,t),this.viewpoint=e}get scale(){return this.ready?(this.state.commitProperty("id"),this.state.scale):this._get("scale")}set scale(t){if(!t||isNaN(t))return;if(!this.ready){this._set("scale",t),this._set("zoom",void 0);const i=this._get("extent");return void(i&&(this._set("extent",void 0),this._set("center",i.center)))}const e=this.viewpoint;ms(e,e,t),this.viewpoint=e}get viewpoint(){return this.ready?this.state.paddedViewState.viewpoint.clone():this._get("viewpoint")}set viewpoint(t){if(t==null)return;if(!this.ready)return this._set("viewpoint",t),this._set("extent",void 0),this._set("center",void 0),this._set("zoom",void 0),void this._set("scale",void 0);let e,i;try{e=this._project(t,this.state.spatialReference),!t.scale||isNaN(t.scale)?i=new C("mapview:invalid-viewpoint",`invalid scale value of ${t.scale}`):t.targetGeometry==null&&(i=new C("mapview:invalid-viewpoint","geometry not defined"))}catch(s){i=new C("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:s})}if(i)return void D.getLogger(this).error(i);this._scaleBeforeChangingSpatialReference=null;const n=new nt({targetGeometry:new V,scale:0,rotation:0});G(n,e),this.constraints?.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this._set("viewpoint",n)}get visibleArea(){return this.ready?this.state.visibleArea:null}get zoom(){return this.ready?this.constraints?.scaleToZoom(this.scale)??-1:this._get("zoom")}set zoom(t){if(!(t>=0))return;if(!this.ready){this._set("zoom",t),this._set("scale",void 0);const n=this._get("extent");return void(n&&(this._set("extent",void 0),this._set("center",n.center)))}const e=this.constraints?.zoomToScale(t)??0;if(!e)return void this._set("zoom",-1);const i=this.viewpoint;ms(i,i,e),this.viewpoint=i,this._set("zoom",this.constraints?.scaleToZoom(this.scale)??-1)}getUserStartupOptions(t){if(!t[0]&&!t[1])return{center:void 0,rotation:void 0,scale:void 0};const{padding:e,constraints:i}=this,n=this._get("center"),s=this._get("extent"),o=this._get("scale"),a=this._get("rotation"),h=this._get("viewpoint"),c=this._get("zoom"),p=c!=null&&i!=null&&i.zoomToScale(c)||void 0;let d,m,u;const g=h?.rotation,f=h?.targetGeometry;f?.type==="extent"?d=f:f?.type==="point"&&(m=f,u=h?.scale);const T=s??d;return{center:n??m??T?.center,rotation:a??g,scale:(o??p??u??(T&&fi(T,[t[0]-e.left-e.right,t[1]-e.top-e.bottom])))||void 0}}startup(t,e,i,n){const s=t.targetGeometry;try{this._project(t,i)}catch(o){D.getLogger(this).warn(new zn("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:s.toJSON(),spatialReference:i,error:o})),t.targetGeometry=n||new V({x:0,y:0,spatialReference:i})}this.constraints?.fit(t),this._set("state",new En({padding:this.padding,size:e,viewpoint:t})),this._set("ready",!0)}teardown(){this._set("ready",!1);const{center:[t,e],spatialReference:i,rotation:n,scale:s}=this.state.paddedViewState,o=new V({x:t,y:e,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",o),this._set("zoom",-1),this._set("rotation",n),this._set("scale",s),this._set("state",null)}changeSpatialReference(t){const e=this.state.paddedViewState.clone();if(this._scaleBeforeChangingSpatialReference==null)this._scaleBeforeChangingSpatialReference=e.scale;else{const h=e.viewpoint.clone();h.scale=this._scaleBeforeChangingSpatialReference,e.viewpoint=h}const i=e.clone(),[n,s]=e.center;let o=null;try{o=this._project(new V({x:n,y:s,spatialReference:e.spatialReference}),t)}catch(h){Xa()||D.getLogger(this).warn(new zn("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:o?.toJSON(),spatialReference:t,error:h}))}o||(o=new V({x:0,y:0,spatialReference:t}));const a=Ji(new nt({targetGeometry:new V,scale:0,rotation:0}),e.viewpoint,o);i.viewpoint=a;try{const h=[e.size[0]/2,e.size[1]/2],c=[h[0]+20,h[1]],p=e.toMap([0,0],c),{x:d,y:m}=this._project(new V({x:p[0],y:p[1],spatialReference:e.spatialReference}),t);p[0]=d,p[1]=m,i.toScreen(p,p);const u=Lh(h,p,c),g=Math.hypot(p[0]-h[0],p[1]-h[1])/20;!Number.isFinite(g)||Math.abs(g)>4?(a.rotation=0,a.targetGeometry=new V({x:0,y:0,spatialReference:t})):(a.scale*=g,a.scale>z("mapview-srswitch-adjust-rotation-scale-threshold")?a.rotation=0:a.rotation+=Number.isFinite(u)?u:0)}catch{}this._get("constraints")?.constrain(a,void 0),this._get("state").viewpoint=a}resize(t,e){if(!this.ready)return;const i=this.state;let n=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.slice();i.size=[t,e],Oh(n,n,s,this.state.paddedViewState.size,this.resizeAlign),n=this.constraints?.constrain(n,void 0)??n,this.state.viewpoint=n}toMap(t){if(!this.ready)return null;const e=[0,0],[i,n]=this.state.toMap(e,[t.x,t.y]),s=this.state.spatialReference;return new V({x:i,y:n,spatialReference:s})}toScreen(t,e){if(!this.ready)return null;const i=this._project(t,this.state.spatialReference),n=[i.x,i.y];return e?.pickClosestTarget===!1||this.state.paddedViewState.wrapMapCoordinate(n,n),this.state.toScreen(n,n),H(n[0],n[1])}_project(t,e){const i=t?.targetGeometry||t;if(!e)return t;if(!i)return null;if(e.imageCoordinateSystem||i.spatialReference?.imageCoordinateSystem||pi(e,i.spatialReference))return t;const n=Le(i,e);if(!n)throw new C("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:i,spatialReference:e});return Ec(t)?(t.targetGeometry=n,t):n}};function Ec(t){return t?.declaredClass==="esri.Viewpoint"}r([l({type:V})],Z.prototype,"center",null),r([l()],Z.prototype,"constraints",void 0),r([l({type:Xt})],Z.prototype,"extent",null),r([l({value:{top:0,right:0,bottom:0,left:0},cast:t=>({top:0,right:0,bottom:0,left:0,...t})})],Z.prototype,"padding",null),r([l()],Z.prototype,"ready",void 0),r([l()],Z.prototype,"resizeAlign",void 0),r([l({readOnly:!0})],Z.prototype,"resolution",null),r([l({type:Number})],Z.prototype,"rotation",null),r([l({type:Number})],Z.prototype,"scale",null),r([l({readOnly:!0})],Z.prototype,"state",void 0),r([l({type:nt})],Z.prototype,"viewpoint",null),r([l({readOnly:!0})],Z.prototype,"visibleArea",null),r([l()],Z.prototype,"zoom",null),Z=r([_("esri.views.2d.ViewStateManager")],Z);function Cn(t,e){switch(e){case"primary":return t.pointerType==="touch"||t.button===0;case"secondary":return t.pointerType!=="touch"&&t.button===2;case"tertiary":return t.pointerType!=="touch"&&t.button===1}}let bs=class extends A{constructor(t,e){super(!0),this._view=t,this.registerIncoming("double-click",e,i=>this._handleDoubleClick(i,e))}_handleDoubleClick(t,e){Cn(t.data,"primary")&&(t.stopPropagation(),e?this._view.mapViewNavigation.zoomOut([t.data.x,t.data.y]):this._view.mapViewNavigation.zoomIn([t.data.x,t.data.y]))}},Cc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerType=e,this.registerIncoming("double-tap-drag",i,n=>this._handleDoubleTapDrag(n))}_handleDoubleTapDrag(t){const{data:e}=t,{pointerType:i}=e;if(i!==this.pointerType)return;t.stopPropagation();const{action:n,delta:s}=e,{view:o}=this,{mapViewNavigation:a}=o;switch(n){case"begin":{const{scale:h}=o;this._startScale=h,this._currentScale=h,this._previousDelta=s,a.begin();break}case"update":{if(this._previousDelta.y===s.y)return;this._previousDelta=s;const h=1.015**s.y,c=this._startScale*h,p=c/this._currentScale;a.setViewpointImmediate(p),this._currentScale=c;break}case"end":{const{constraints:h}=o,{effectiveLODs:c,snapToZoom:p}=h;if(!p||!c)return void a.end();const d=h.snapScale(this._currentScale),m=(s.y>0?Math.max(d,h.snapToPreviousScale(this._startScale)):Math.min(d,h.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(m).then(()=>{a.end()});break}}}},wi=class{constructor(t){this._callbacks=t,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(t){const e=t.data,i=e.pointers.size;switch(e.action){case"start":this._currentCount=i,this._emitStart(t);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"update":this._emitUpdate(t);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"end":this._emitEnd(t),this._currentCount=0}this._previousEvent=t}_emitStart(t){this._startEvent=t,this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.start(this._currentCount,t,this._startEvent)}_emitUpdate(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.update(this._currentCount,t,this._startEvent)}_emitEnd(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.end(this._currentCount,t,this._startEvent),this._startEvent=null}},Ic=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerAction=e,this.registerIncoming("drag",i,n=>this._handleDrag(n)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(t){super.onInstall(t),this._dragEventSeparator=new wi({start:(e,i)=>{this.view.mapViewNavigation.pan.begin(this.view,i.data),i.stopPropagation()},update:(e,i)=>{this.view.mapViewNavigation.pan.update(this.view,i.data),i.stopPropagation()},end:(e,i)=>{this.view.mapViewNavigation.pan.end(this.view,i.data),i.stopPropagation()},condition:(e,i)=>e===1&&Cn(i.data,this.pointerAction)})}_handleDrag(t){const e=this.view.mapViewNavigation;e.pinch.zoomMomentum||e.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},Dc=class extends A{constructor(t,e,i){super(!0),this._view=t,this.pointerAction=e;const n=this._view.mapViewNavigation;this._dragEventSeparator=new wi({start:(s,o)=>{n.rotate.begin(this._view,o.data),o.stopPropagation()},update:(s,o)=>{n.rotate.update(this._view,o.data),o.stopPropagation()},end:(s,o)=>{n.rotate.end(),o.stopPropagation()},condition:(s,o)=>s===1&&Cn(o.data,this.pointerAction)}),this.registerIncoming("drag",i,s=>this._dragEventSeparator.handle(s))}};function et(t){let e=t*t;return t<0&&(e*=-1),e}function Rc(t){return t.translation[0]=0,t.translation[1]=0,t.translation[2]=0,t.heading=0,t.tilt=0,t}function Lc(t,e,i){const n=i,s=t.state,o=t.device,a=e.tiltDirection==="forward-down"?1:-1,h=1;return o.deviceType==="standard"?(n.translation[0]=et(s.axes[0]),n.translation[1]=et(s.axes[1]),n.translation[2]=et(s.buttons[7])-et(s.buttons[6]),n.heading=et(s.axes[2]),n.tilt=et(s.axes[3])):o.deviceType==="spacemouse"&&(n.translation[0]=1.2*et(s.axes[0]),n.translation[1]=1.2*et(s.axes[1]),n.translation[2]=2*-et(s.axes[2]),n.heading=1.2*et(s.axes[5]),n.tilt=1.2*et(s.axes[3])),n.tilt*=a,Yr(n.translation,n.translation,h),n}function Vc(t){return t.translation[0]===0&&t.translation[1]===0&&t.translation[2]===0&&t.heading===0&&t.tilt===0&&t.zoom===0}let Oc=class extends A{constructor(t){super(!0),this._view=t,this._frameTask=null,this._watchHandles=new qs,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",e=>this._handleGamePadEvent(e)),this._handle.pause()}onInstall(t){super.onInstall(t),this._watchHandles.add([w(()=>this._view.navigation.gamepad?.enabled,e=>{e?(this._handle.resume(),this._frameTask||(this._frameTask=de({update:i=>this._frameUpdate(i.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},U)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(t){const e=this._view.navigation.gamepad.device;e&&t.data.device!==e||this._currentDevice&&this._currentDevice!==t.data.device||(t.data.action==="end"?(this._currentDevice=null,Rc(this._transformation)):(this._currentDevice=t.data.device,Lc(t.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(t){const e=this._transformation;if(Vc(e))return;const i=this._view.viewpoint.clone(),n=this._view.navigation.gamepad.velocityFactor,s=zc*n*t;vi(i,i,[e.translation[0]*s,-e.translation[1]*s]);const o=1+e.translation[2]*Nc*t,a=this._view.constraints.rotationEnabled?-e.heading*Ac*t:0,h=this._view.size,c=[h[0]/2,h[1]];Vo(i,i,o,a,c,h);const p=this._view.constraints.constrain(i,this._view.viewpoint);this._view.viewpoint=p}};const Ac=.06,zc=.7,Nc=6e-4;function $o(t){const e=()=>t(document.visibilityState==="visible");return document.addEventListener("visibilitychange",e),di(()=>document.removeEventListener("visibilitychange",e))}let Fc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=n=>{const s=this._keyMap[n.data.key];if(n.modifiers.has("Meta")||n.modifiers.has("Control"))return void this._stopMovement();if(s==null)return;n.stopPropagation(),n.preventDefault();const o=n.type==="key-down";if(this._pressedKeys[o?"add":"delete"](s),o){if(this._direction===s)return;this._direction=s,this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const a=this._timeout===void 0,h=this._pressedKeys.size>0;a||h?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),this._direction==null&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[e.left]:"left",[e.right]:"right",[e.up]:"up",[e.down]:"down"},this.registerIncoming("key-down",i,this._handleKey),this.registerIncoming("key-up",i,this._handleKey),this.registerIncoming("blur",i,this._stopMovement),this._visibilityHandle=$o(n=>n?null:this._stopMovement())}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(t){const e=this._currentDirection!=null;if(t!=null){if(e||this.view.mapViewNavigation.begin(),this._currentDirection!==t)switch(t){case"left":this.view.mapViewNavigation.continuousPanLeft();break;case"right":this.view.mapViewNavigation.continuousPanRight();break;case"up":this.view.mapViewNavigation.continuousPanUp();break;case"down":this.view.mapViewNavigation.continuousPanDown()}}else e&&this.view.mapViewNavigation.stop();this._currentDirection=t}_setTimeout(t){clearTimeout(this._timeout),this._timeout=t===void 0?void 0:setTimeout(()=>{this._timeout=void 0,t()},this._stickyKeyDuration)}},Hc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._pressed=!1,this._keyToDirection={[e.clockwiseOption1]:"clockwise",[e.clockwiseOption2]:"clockwise",[e.counterClockwiseOption1]:"counterClockwise",[e.counterClockwiseOption2]:"counterClockwise",[e.resetOption1]:"reset",[e.resetOption2]:"reset"},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),this.registerIncoming("key-up",i,n=>this._handleKeyUp(n)),this.registerIncoming("blur",i,()=>this._handleStop()),this._visibilityHandle=$o(n=>n?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,e){const i=t.modifiers;if(i.size>0&&!i.has("Shift")||!this.view.constraints.rotationEnabled)return;const n=this._keyToDirection[t.data.key];if(this._pressed=n!=null,this._pressed){if(t.preventDefault(),e)switch(this.view.mapViewNavigation.begin(),n){case"clockwise":this.view.mapViewNavigation.continuousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continuousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}};var ce;(function(t){t[t.IN=0]="IN",t[t.OUT=1]="OUT"})(ce||(ce={}));let Zc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._keysToZoomAction={},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),e.zoomIn.forEach(n=>this._keysToZoomAction[n]=ce.IN),e.zoomOut.forEach(n=>this._keysToZoomAction[n]=ce.OUT)}_handleKeyDown(t){this._handleKey(t)}_handleKey(t){const e=t.modifiers;if(e.size>0&&!e.has("Shift"))return;const{key:i}=t.data;if(!(i in this._keysToZoomAction))return;const n=this._keysToZoomAction[i],{mapViewNavigation:s}=this.view;let o=null;switch(n){case ce.IN:o=s.zoomIn();break;case ce.OUT:o=s.zoomOut();break;default:return}s.begin(),o.then(()=>s.end()),t.stopPropagation()}};const Gc=.6;let $c=class extends A{constructor(t,e){super(!0),this._view=t,this._canZoom=!0,this.registerIncoming("mouse-wheel",e,i=>this._handleMouseWheel(i))}_handleMouseWheel(t){if(!this._view.navigation.mouseWheelZoomEnabled||(t.preventDefault(),t.stopPropagation(),!this._canZoom))return;const e=this._view.mapViewNavigation,{x:i,y:n,deltaY:s}=t.data,o=1/Gc**(1/60*s),a=e.zoom(o,[i,n]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,e.end()}))}},Wc=class extends A{constructor(t){super(!0),this.view=t,this.registerIncoming("drag",i=>this._handleDrag(i)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const e=this.view.mapViewNavigation;this._dragEventSeparator=new wi({start:(i,n)=>{e.pinch.begin(this.view,n.data),n.stopPropagation()},update:(i,n)=>{e.pinch.update(this.view,n.data),n.stopPropagation()},end:(i,n)=>{e.pinch.end(this.view),n.stopPropagation()},condition:i=>i>=2})}_handleDrag(t){this._dragEventSeparator.handle(t)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function Ts(t){const e=t.native;return e?{buttons:e.buttons.map(i=>i.pressed?i.value||1:0),axes:e.axes.map(i=>qc(i,t.axisThreshold))}:{buttons:[],axes:[]}}function Uc(t,e){if(t.axes.length!==e.axes.length||t.buttons.length!==e.buttons.length)return!1;for(let i=0;i{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,a=o.index,h=this._inputDevices[a];h&&(this._emitGamepadEvent(o,Ts(h),!1),this._inputDevices.splice(a,1),this._latestUpdate.splice(a,1),this._input.gamepad.devices.remove(h),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const i="getGamepads"in window.navigator,n=window.isSecureContext;this.supported=i&&n,this.supported&&(Ms(s=>this._connectGamepad(s)),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 e=new Mn(t);e.deviceType!=="unknown"&&(this._inputDevices[t.index]=e,this._input.gamepad.devices.add(e)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=de({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const t=document.hasFocus(),e=this._element.contains(document.activeElement),i=this._input.gamepad.enabledFocusMode==="document"&&!t||this._input.gamepad.enabledFocusMode==="view"&&!e;Ms(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],a=Ts(s),h=i||jc(a);o&&(o.timestamp===n.timestamp||!o.active&&h||Uc(o.state,a))||this._emitGamepadEvent(n,a,!h)})}_emitGamepadEvent(t,e,i){const n=this._latestUpdate[t.index],s=n&&n.active;if(!s&&!i)return;const o=!s&&i?"start":s&&i?"update":"end";this._latestUpdate[t.index]={timestamp:t.timestamp,state:e,active:i},this._callback&&this._callback({device:this._inputDevices[t.index],state:e,action:o})}};function Kc(t){if(!t||!t.connected)return!1;for(let e=0;e{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new Bc(e,this._input),this._gamepadSource.onEvent=n=>this._callback("gamepad",n)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>{this._releasePointerCaptureSafe(e)}),this._gamepadSource=tt(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const i in this._active)if(!e||!e.has(i)){const n=this._active[i];this._element.removeEventListener(zi[i],n),delete this._active[i]}e&&e.forEach(i=>{if(!this._active[i]&&zi[i]){const n=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(zi[i],n),this._active[i]=n}}),this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1}setPointerCapture(e,i){i?this._setPointerCatpureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?ee.touchNone:ee.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?ee.touchPan:ee.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(ee.touchNone),this._element.classList.remove(ee.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,i){const n=_o(this._element,e);return Uo.test.disableSubpixelCoordinates&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),i.x=n.x,i.y=n.y,i}_handleKey(e,i){const{key:n}=i;n&&e==="key-up"&&this._keyDownState.delete(n);const s={native:i,key:n,repeat:!!n&&this._keyDownState.has(n)};n&&e==="key-down"&&this._keyDownState.add(s.key),this._callback(e,s)}_handlePointer(e,i){const n=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(e,n)}_handlePointerPreventDefault(e,i){const n=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(e,n)}_getDeltaFromTrackpadOrMouseWheel(e){return e.shiftKey&&z("mac")&&e.deltaY===0?e.deltaX:e.deltaY}_handleMouseWheel(e,i){let n=this._getDeltaFromTrackpadOrMouseWheel(i);switch(i.deltaMode){case 0:xs&&(n=n/document.documentElement.clientHeight*600);break;case 1:n*=30;break;case 2:n*=900}xs?n*=.7:Yc||Qc?n*=.6:Xc&&(n*=1.375);const s=100,o=Math.abs(n);o>s&&(n=n/o*200/(1+Math.exp(-.02*(o-s))));const a=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,deltaY:n});this._callback(e,a)}_handlePointerCaptureLost(e,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(e,i)}_handleDefault(e,i){const n={native:i};i.preventDefault(),this._callback(e,n)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};Wo.test={disableSubpixelCoordinates:!1};const zi={"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"};let Jc=class extends A{constructor(){super(!0),this.registerIncoming("context-menu",t=>t.data.native.preventDefault())}};const F={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function ri(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function tp(t,e){const i=e.x-t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)}function ep(t,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:H()},t.length===0)return e;if(t.length===1)return e.center.x=t[0].x,e.center.y=t[0].y,e;if(t.length===2){const[S,x]=t,[$,K]=[x.x-S.x,x.y-S.y];return e.radius=Math.sqrt($*$+K*K)/2,e.center.x=(S.x+x.x)/2,e.center.y=(S.y+x.y)/2,e}let i=0,n=0;for(let S=0;SS.x-i),o=t.map(S=>S.y-n);let a=0,h=0,c=0,p=0,d=0,m=0,u=0;for(let S=0;Sthis._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=st(t.doubleTapTimeout)})}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleTapTimeout!=null)return!0;return!1}_clearPointerDown(t){const e=this._pointerState.get(t);e&&(e.doubleTapTimeout=st(e.doubleTapTimeout),this._pointerState.delete(t),this.refreshHasPendingInputs())}_dragStart(t,e){if(!this._doubleTapDragReady||t!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:i,modifiers:n}=e,{center:s}=i;this._dragStartCenter=s;const o=Ni("begin",H(0,0),i);this._doubleTapDrag.emit(o,void 0,n),e.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("update",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("end",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:e}=t,i=Kt(e),n=this._pointerState.get(i),{pointerType:s}=e.native;if(n){const o=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(i),ri(n.event.data,e)>o?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:e}=t,{pointerType:i}=e.native,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._clearPointerDown(n),s);this._pointerState.set(n,{event:t,doubleTapTimeout:o}),this.refreshHasPendingInputs()}};function Ni(t,e,i){const{button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}=i;return{action:t,delta:e,button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}}let np=class extends A{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,e,i,n){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:e.buttons,timestamp:n,pointers:sp(this._activePointerMap),pointer:e,angle:i.angle,radius:i.radius,center:i.center}}_addPointer(t){const e=t.native.pointerId,i=$e(this._activePointerMap).angle,n={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(e,n);const s=Qe(n,jo(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(i)}_updatePointer(t){if(t&&t.x==null&&t.y==null)return;const e=t.native.pointerId,i=this._activePointerMap.get(e);i?i.event=t:this._addPointer(t)}_removePointer(t){const e=$e(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(e)}_updatePointerAngles(t){const e=$e(this._activePointerMap);this._activePointerMap.forEach(i=>{i.initialAngle=Qe(i,e)-t,i.lastAngle=Qe(i,e)-t})}_emitEvent(t,e,i){const n=$e(this._activePointerMap);this._drag.emit(this._createPayload(t,e,n,i),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const e=t.data.native.pointerId,i=it(t.timestamp);this._activePointerMap.get(e)&&(this._activePointerMap.size===1?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",t.data,i),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(e)):(this._removePointer(e),this._emitEvent("removed",t.data,it(t.timestamp))))}_handlePointerDrag(t){const e=t.data,i=e.currentEvent,n=it(t.timestamp);switch(e.action){case"start":case"update":this._isDragging?this._activePointerMap.has(i.native.pointerId)?(this._updatePointer(i),!this._isCurrentDragSuppressed&&this._emitEvent("update",i,n)):(this._addPointer(i),this._emitEvent("added",i,n),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(i),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",i,n))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function jo(t){const e=[];return t.forEach(i=>{e.push(H(i.event.x,i.event.y))}),ep(e)}function $e(t){const e=jo(t);let i=0;return t.forEach(n=>{let s=Qe(n,e),o=s-n.lastAngle;for(;o>Math.PI;)o-=2*Math.PI;for(;o<-Math.PI;)o+=2*Math.PI;s=n.lastAngle+o,n.lastAngle=s;const a=s-n.initialAngle;i+=a}),i/=t.size||1,{angle:i,radius:e.radius,center:e.center}}function sp(t){const e=new Map;return t.forEach((i,n)=>e.set(n,i.event)),e}function Qe(t,e){const i=t.event,n=i.x-e.center.x,s=i.y-e.center.y;return Math.atan2(s,n)}var Ss;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Back=3]="Back",t[t.Forward=4]="Forward",t[t.Undefined=-1]="Undefined"})(Ss||(Ss={}));let op=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,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 e=t.data,i=Kt(e);if(!this._pointerState.has(i)){const n={downButton:e.native.button,x:e.x,y:e.y,immediateDoubleClick:null};this._pointerState.set(i,n),this.startCapturingPointer(e.native)}}_handlePointerUp(t){const e=t.data,i=Kt(e),n=this._pointerState.get(i);if(n&&n.downButton===e.native.button){const s=n.immediateDoubleClick,o=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;s?(s.timeoutHandle.remove(),ri(s,t.data)>o?this._startImmediateDoubleClick(t,n):(this._immediateDoubleClick.emit(t.data,void 0,s.modifiers),this._removeState(e))):ri(n,t.data)>o?this._removeState(e):this._startImmediateDoubleClick(t,n)}}_startImmediateDoubleClick(t,e){const i=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;e.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(t.data),i)}}_removeState(t){const e=Kt(t);this._pointerState.delete(e),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}},ap=class extends A{constructor(t=F.maximumClickDelay,e=F.movementUntilMouseDrag,i=F.movementUntilPenDrag,n=F.movementUntilTouchDrag,s=F.holdDelay,o=Re){super(!1),this._maximumClickDelay=t,this._movementUntilMouseDrag=e,this._movementUntilPenDrag=i,this._movementUntilTouchDrag=n,this._holdDelay=s,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",a=>this._handlePointerDown(a)),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",a=>this._handlePointerMove(a)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(t=>{t.holdTimeout=st(t.holdTimeout)}),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=e.native.pointerId;let n=null;this._pointerState.size===0&&(n=this._clock.setTimeout(()=>{const o=this._pointerState.get(i);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 s={startEvent:e,previousEvent:e,startTimestamp:t.timestamp,isDragging:!1,downButton:e.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(i,s),this.startCapturingPointer(e.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_handlePointerMove(t){const e=t.data,i=e.native.pointerId,n=this._pointerState.get(i);n&&(n.isDragging?this._pointerDrag.emit(We("update",n,e),void 0,n.modifiers):tp(e,n.startEvent)>this._getDragThreshold(e.native.pointerType)&&this._startDragging(t),n.previousEvent=e)}_getDragThreshold(t){switch(t){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const e=t.data,i=e.native.pointerId;this._pointerState.forEach(n=>{n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=t.modifiers,n.isDragging=!0,i===n.startEvent.native.pointerId?this._pointerDrag.emit(We("start",n,e)):this._pointerDrag.emit(We("start",n,n.previousEvent),t.timestamp))})}_handlePointerLoss(t,e){const i=t.data,n=i.native.pointerId,s=this._pointerState.get(n);s&&(s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging?this._pointerDrag.emit(We("end",s,e==="pointer-up"?i:s.previousEvent),void 0,s.modifiers):e==="pointer-up"&&s.downButton===i.native.button&&t.timestamp-s.startTimestamp<=this._maximumClickDelay&&!s.holdEmitted&&this._immediateClick.emit(i),this._pointerState.delete(n),this.stopCapturingPointer(i.native),this._pointerState.size===0&&this._moveHandle.pause())}};function We(t,e,i){return{action:t,startEvent:e.startEvent,previousEvent:e.previousEvent,currentEvent:i}}let rp=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",o=>this._handleImmediateClick(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o))}onUninstall(){this._pointerState.forEach(t=>t.doubleClickTimer=st(t.doubleClickTimer))}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleClickTimer!=null)return!0;return!1}_clearDoubleClickTimer(t,e){const i=this._pointerState.get(t);i&&(i.doubleClickTimer=st(i.doubleClickTimer),e&&this._click.emit(i.event.data,void 0,i.event.modifiers),this._pointerState.delete(t),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(t){const e=this._pointerState.get(t);e.pointerDownCount===1&&this._click.emit(e.event.data,void 0,e.event.modifiers),e.doubleClickTimer=null,this._pointerState.delete(t),this.refreshHasPendingInputs()}_handleImmediateClick(t){const e=t.data,{pointerType:i}=e.native,n=lp(e);if(!this._pointerState.has(n))return void this._startClick(t);const s=this._pointerState.get(n),{data:o,modifiers:a}=s.event,h=i==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;ri(o,e)>h?(this._clearDoubleClickTimer(n,!0),this._startClick(t)):(this._clearDoubleClickTimer(n,!1),s.pointerDownCount===2&&this._doubleClick.emit(o,void 0,a))}_handlePointerDown(t){const e=Kt(t.data),i=this._pointerState.get(e);i&&(i.pointerDownCount+=1)}_startClick(t){const{data:e}=t,{native:{pointerType:i}}=e,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s);this._pointerState.set(n,{event:t,doubleClickTimer:o,pointerDownCount:1}),this.refreshHasPendingInputs()}};function lp(t){const{pointerId:e,pointerType:i,button:n}=t.native;return i==="mouse"?`${e}:${n}`:`${i}`}const Ue={counter:"Control",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 Gt=class extends M{initialize(){const t=()=>this.view?.ready;this.addHandles([Ce(()=>!t(),()=>this._disconnect()),Ce(t,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=tt(this._inputManager)}_connect(){const t=this.view.surface,e=new Wo(t,this.view.input),i=[new op,new ap,new rp,new np(this.view.navigation),new ip],n=new Q({eventSource:e,recognizers:i});n.installHandlers("prevent-context-menu",[new Jc],At.INTERNAL),n.installHandlers("navigation",[new Wc(this.view),new Oc(this.view),new $c(this.view),new bs(this.view),new bs(this.view,[Ue.counter]),new Ic(this.view,"primary"),new Fc(this.view,Ue.pan),new Zc(this.view,Ue.zoom),new Hc(this.view,Ue.rotate),new Dc(this.view,"secondary"),new Cc(this.view,"touch")],At.INTERNAL),this.view.viewEvents.connect(n),this._source=e,this._inputManager=n,w(()=>this.view?.navigation?.browserTouchPanEnabled,s=>{this._source&&(this._source.browserTouchPanningEnabled=!s)},U)}get test(){}};r([l()],Gt.prototype,"view",void 0),r([l()],Gt.prototype,"latestPointerType",null),r([l()],Gt.prototype,"latestPointerLocation",null),r([l()],Gt.prototype,"multiTouchActive",null),Gt=r([_("esri.views.2d.input.MapViewInputManager")],Gt);const hp=Gt,Nt={added:[],removed:[]},Fi=new Set,cp=new Kr(0,0,0,0);function pp(t,e){const i=Bs(e);if(!i)return null;const[n,s]=i.valid;return t[2]>s?[Ne([t[0],t[1],s,t[3]]),Ne([n,t[1],n+t[2]-s,t[3]])]:t[0]({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=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)}getIntersectingTiles(t){if(!t||Qa(t)===0||Ja(t)===0)return[];const e=pp(t,this.tileScheme.spatialReference);return e!=null?[...new Set([...this.boundsIntersections(e[0]),...this.boundsIntersections(e[1])])]:this.boundsIntersections(t)}boundsIntersections(t){return this._index.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]})}updateTiles(t){const e={added:[],removed:[]};for(const i of t.added)if(!this.has(i)){const n=new Kn(this.tileScheme,i);this._tiles.set(i,n),this._index.insert(n),e.added.push(n)}for(const i of t.removed)if(this.has(i)){const n=this.get(i);this._tiles.delete(i),this._index.remove(n),e.removed.push(n)}this.tiles.length=0,this._tiles.forEach(i=>this.tiles.push(i)),(e.added.length||e.removed.length)&&this.emit("update",e)}setViewState(t){const e=this.tileScheme.getTileCoverage(t,0);if(!e)return;const{spans:i,lodInfo:n}=e,{level:s}=n;if(i.length>0)for(const{row:o,colFrom:a,colTo:h}of i)for(let c=a;c<=h;c++){const p=cp.set(s,o,n.normalizeCol(c),n.getWorldForColumn(c)).id;if(Fi.add(p),!this.has(p)){const d=new Kn(this.tileScheme,p);this._tiles.set(p,d),this._index.insert(d),this.tiles.push(d),Nt.added.push(d)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];Fi.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),Nt.removed.push(a))}(Nt.added.length||Nt.removed.length)&&this.emit("update",Nt),Fr.pool.release(e),Fi.clear(),Nt.added.length=0,Nt.removed.length=0}};const up=1,Su=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],ku=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],_e=256,mp=new Pt("cyan"),gp=1,yp=.25;new Pt("black");const _p="default",fp="temporary",vp=new Pt("yellow");let $t=class extends M{constructor(t){super(t),this.color=mp.clone(),this.haloOpacity=gp,this.fillOpacity=yp}equals(t){return this.color.equals(t.color)&&(this.haloColor||this.color).equals(t.haloColor||t.color)&&this.haloOpacity===t.haloOpacity&&this.fillOpacity===t.fillOpacity}};r([l({type:Pt})],$t.prototype,"color",void 0),r([l({type:Pt})],$t.prototype,"haloColor",void 0),r([l()],$t.prototype,"haloOpacity",void 0),r([l()],$t.prototype,"fillOpacity",void 0),$t=r([_("esri.views.support.HighlightOptions")],$t);const wp=$t;var rn;let xe=rn=class extends wp{constructor(t){super(t),this.haloWidth=2.1,this.haloBlur=.8/this.haloWidth}equals(t){return super.equals(t)&&this.haloWidth===t.haloWidth&&this.haloBlur===t.haloBlur}get optionsKey(){return`${this.color};${this.haloColor};${this.haloOpacity};${this.fillOpacity};${this.haloWidth};${this.haloBlur}`}clone(){return new rn({color:this.color.clone(),haloColor:this.haloColor?.clone(),haloOpacity:this.haloOpacity,fillOpacity:this.fillOpacity,haloWidth:this.haloWidth,haloBlur:this.haloBlur})}};r([l()],xe.prototype,"haloWidth",void 0),r([l()],xe.prototype,"haloBlur",void 0),xe=rn=r([_("esri.views.2d.support.HighlightOptions")],xe);const Yt=xe,Hi=()=>D.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function bp(t,e){e.fillColor[0]=t.color.r/255,e.fillColor[1]=t.color.g/255,e.fillColor[2]=t.color.b/255,e.fillColor[3]=t.color.a,t.haloColor?(e.outlineColor[0]=t.haloColor.r/255,e.outlineColor[1]=t.haloColor.g/255,e.outlineColor[2]=t.haloColor.b/255,e.outlineColor[3]=t.haloColor.a):(e.outlineColor[0]=e.fillColor[0],e.outlineColor[1]=e.fillColor[1],e.outlineColor[2]=e.fillColor[2],e.outlineColor[3]=e.fillColor[3]),e.fillColor[3]*=t.fillOpacity,e.outlineColor[3]*=t.haloOpacity,e.fillColor[0]*=e.fillColor[3],e.fillColor[1]*=e.fillColor[3],e.fillColor[2]*=e.fillColor[3],e.outlineColor[0]*=e.outlineColor[3],e.outlineColor[1]*=e.outlineColor[3],e.outlineColor[2]*=e.outlineColor[3],e.outlineWidth=(1-t.haloBlur)*t.haloWidth,e.outerHaloWidth=t.haloBlur*t.haloWidth/2,e.innerHaloWidth=t.haloBlur*t.haloWidth/2,e.outlinePosition=0}const Tp=[0,0,0,0];let qo=class{constructor(){this.type="single",this._highlightOptions=new Yt,this._convertedHighlightOptions={fillColor:[0,0,0,0],outlineColor:[0,0,0,0],outlinePosition:0,outlineWidth:0,innerHaloWidth:0,outerHaloWidth:0},this._optionsShadeTexKey="",this._texelData=new Uint8Array(4*_e),this._minMaxDistance=[0,0]}setHighlightOptions(t){this._highlightOptions=t}applyHighlightOptions(t,e){this._updateGradientTexture(t),t.bindTexture(this._shadeTex,Xr),e.setUniform2fv("u_minMaxDistance",this._minMaxDistance)}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getReasonsWithGradients(){return[{activeReasons:(1<h?Math.round(10*(Math.abs(n)-h))/10:0,p=Math.abs(a)>h?Math.round(10*(Math.abs(a)-h))/10:0;let d;c&&!p?Hi().error("The outer rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!c&&p?Hi().error("The inner rim of the highlight is "+p+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):c&&p&&Hi().error("The highlight is "+Math.max(c,p)+"px away from the edge of the feature; consider reducing some width values.");const m=[void 0,void 0,void 0,void 0];function u(f,T,I){m[0]=(1-I)*f[0]+I*T[0],m[1]=(1-I)*f[1]+I*T[1],m[2]=(1-I)*f[2]+I*T[2],m[3]=(1-I)*f[3]+I*T[3]}const{_texelData:g}=this;for(let f=0;f<_e;++f)d=n+f/(_e-1)*(a-n),dt.stencilRef,compare:Jr.EQUAL,mask:255,op:{fail:Si.KEEP,zFail:Si.KEEP,zPass:Si.REPLACE}}}},xp={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},Pp={...Bo,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function Sp({pixelRatio:t,state:e,displayLevel:i,requiredLevel:n},s){const o=1/2**(i-s.key.level),a=1/2**(n-s.key.level);return{displayMat3:e.displayMat3,displayViewMat3:e.displayViewMat3,displayViewScreenMat3:s.transforms.displayViewScreenMat3,viewMat3:e.viewMat3,tileMat3:s.transforms.tileMat3,displayZoomFactor:o,requiredZoomFactor:a,tileOffset:[s.x,s.y],currentScale:e.scale,currentZoom:i,metersPerSRUnit:Ys(e.spatialReference),rotation:e.rotation,pixelRatio:t}}function Ko(t){return t.passOptions?.type==="highlight"}function Yo(t){return t.passOptions?.type==="hittest"}function kp(t){if(!Yo(t))return null;const{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}=t.passOptions;return{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}}function Ep(t){if(!Ko(t))return null;const{activeReasons:e,highlightAll:i}=t.passOptions;return{activeReasons:e,highlightAll:i?1:0}}function Eu(t,e,i){const n={};for(const s in i)i[s]instanceof Function?n[s]=i[s](t,e):n[s]=i[s];return n}function Cu(t,e){const{attributeView:i,context:n}=t;return{storage:i.getUniforms(n),view:Sp(t,e),hittestRequest:kp(t),highlight:Ep(t)}}function Iu(t){return{inside:t.selection===li.InsideEffect,outside:t.selection===li.OutsideEffect}}function Cp(t){return Yo(t)?xp:Ko(t)&&t.passOptions.stepType==="clear"?Pp:Bo}function Du(t){const{row:e,col:i}=t.key,n=i*Qn,s=e*Qn;return{tileOffsetFromLocalOrigin:[n%He,s%He],maxIntsToLocalOrigin:[Math.floor(n/He),Math.floor(s/He)]}}const Ip=new Fa({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function Ru(t){return Ip.toJSON(t)}function Lu(t){const{bandCount:e,attributeTable:i,colormap:n,pixelType:s}=t.raster.rasterInfo;return e===1&&(i!=null||n!=null||s==="u8"||s==="s8")}function Dp(t,e){return e==null?(t?.destroy(),null):(t?.type==="single"&&Array.isArray(e)&&(t.destroy(),t=null),t?.type!=="multi"||Array.isArray(e)||(t.destroy(),t=null),t||(t=Array.isArray(e)?new Mp:new qo),Array.isArray(e)?t.type==="multi"&&t.setHighlightOptions(e):t.type==="single"&&t.setHighlightOptions(e),t)}function Vu(t,e,i,n){const{painter:s,highlightGradient:o}=t,{highlight:a}=s.effects;if(!o)return;const h=t.passOptions,c=o.getReasonsWithGradients();for(let p=0;pparseFloat(t)/100;function Rp(t,e,i){const n=typeof t.left=="string"?je(t.left)*e:t.left,s=typeof t.right=="string"?je(t.right)*e:t.right,o=typeof t.top=="string"?je(t.top)*i:t.top,a=typeof t.bottom=="string"?je(t.bottom)*i:t.bottom,h=o;return{xmin:n,xmax:Math.max(e-s,n),ymin:h,ymax:Math.max(i-a,o)}}function Xo(t,e,i,n){switch(e.type){case"rect":{const{width:s,height:o}=t,{xmin:a,xmax:h,ymin:c,ymax:p}=Rp(e,s,o),{x:d,y:m}=i;return d>a&&dc&&mt.name);function Lp(t){if(!t.highlights)return null;const e=t.highlights.findIndex(i=>i.name==="default");return e===-1?null:t.highlights.items[e].options}function Vp(t,e){if(!t.highlights){if(!e)return;t.highlights=new Qo([{name:"default",options:new Yt}])}const i=t.highlights.findIndex(n=>n.name==="default");e?t.highlights.items[i].options=e:t.highlights.removeAt(i)}async function Op(t,e,i){const n=vo(e)?fo(t,e):e;if(!t.ready||isNaN(n.x)||isNaN(n.y))return{screenPoint:n,results:[]};let s=new Set;const o=new Set;let a=!1,h=null,c=null;i?.include?As(i.include,Os(t,u=>{s.add(u),Zi(u,g=>o.add(g))},(u,g)=>{o.add(u),s.add(g)},u=>{h||(h=new Set),h.add(u)},u=>s.add(u),()=>a=!0)):(a=!0,s=new Set(t.allLayerViews),s.forEach(u=>{Zi(u,g=>o.add(g))})),i?.exclude&&As(i.exclude,Os(t,u=>{s.delete(u),Zi(u,g=>o.delete(g))},u=>o.delete(u),u=>{c||(c=new Set),c.add(u)}));const p=t.toMap(n),d=t.allLayerViews.filter(u=>!u.suspended&&s.has(u)&&u.clips.every(g=>Xo(t,g,n,p))).reverse();let m=[...a?t.graphicsView.hitTest(p).map(u=>({type:"graphic",graphic:u,layer:null,mapPoint:p})):[],...await Promise.all(d.map(u=>u.hitTest(p,n)).toArray())].filter(ni).flat().filter(ni);return m=m.filter(u=>u.type!=="graphic"||u.layer?.type!=="subtype-group"||o.has(u.graphic.layer)),h&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||h?.has(hn(u.graphic)))),c&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||!c?.has(hn(u.graphic)))),{screenPoint:n,results:m}}function Os(t,e,i,n,s,o){return a=>{if(a instanceof pr){if(a.layer===t)o?.();else{const h=t.allLayerViews.find(c=>c.layer===a.layer);h&&s?.(h)}n(hn(a))}else if(!("layer"in a&&"element"in a))if(a.type==="subtype-sublayer"){const h=t.allLayerViews.find(c=>c.layer===a.parent);h&&i(a,h)}else{const h=t.allLayerViews.find(c=>c.layer===a);h&&e(h)}}}function As(t,e){if(t)if(Nn(t))for(const i of t)if(Nn(i))for(const n of i)e(n);else e(i);else e(t)}function hn(t){const e=t.getObjectId();return e?`${t.layer?.uid??t.sourceLayer?.uid??"MapView"}/${e}`:`"MapView/${t.uid}`}function Zi({layer:t},e){t?.type==="subtype-group"&&t.sublayers.forEach(i=>{e(i)})}function ta(t,e,i){const{ctx:n,canvas:s}=ia(t,i),o=n.getImageData(0,0,t.width,t.height),a=sa(s,e);return na(s),{dataUrl:a,data:o}}function ea(t,e){const{ctx:i,canvas:n}=ia(t,e),s=i.getImageData(0,0,t.width,t.height);return na(n),s}function ia(t,e){const i=Ap();e.premultipliedAlpha&&Hp(t),i.width=t.width,i.height=t.height;const n=i.getContext("2d",{willReadFrequently:!0});return n.putImageData(t,0,0),e.flipY&&Fp(n),{ctx:n,canvas:i}}function na(t){t.width=0,t.height=0}function Ap(){return Gi==null&&(Gi=document.createElement("canvas")),Gi}let Gi=null;function sa(t,e){const i=Zp[e.format],n=e.quality/100;return t.toDataURL(i,n)}function oa(t,e){const i=Np(t),n=$p[i];return{format:i,quality:ke(e??n,0,100)}}function aa(t,e){return e/Math.max(t[0],t[1])}function zp(t,e,i,n=0,s=0,o=t.width-n,a=t.height-s,h=!1){const{data:c}=t,{width:p,height:d,data:m}=e,u=o/p,g=a/d,f=Math.ceil(u/2),T=Math.ceil(g/2),I=t.width;for(let E=0;E=1)continue;let St=2*Qt*Qt*Qt-3*Qt*Qt+1;const Jt=4*(n+Ae+(s+Oe)*I);Dn+=St*c[Jt+3],$+=St,!i&&c[Jt+3]<255&&(St=St*c[Jt+3]/255),K+=St*c[Jt],dt+=St*c[Jt+1],In+=St*c[Jt+2],x+=St}}m[S]=K/x,m[S+1]=dt/x,m[S+2]=In/x,m[S+3]=Dn/$}return e}function Np(t){switch(t){case"png":case"jpg":case"jpeg":return t;default:return Gp}}function Fp(t){t.save(),t.globalCompositeOperation="copy",t.scale(1,-1),t.translate(0,-t.canvas.height),t.drawImage(t.canvas,0,0),t.restore()}function Hp(t){const e=t.data,i=e.length;for(let n=0;n0){const o=255/s;e[n]=e[n]*o,e[n+1]=e[n+1]*o,e[n+2]=e[n+2]*o}}}const Zp={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},zs=98,Gp="png",$p={png:100,jpg:zs,jpeg:zs},Ou=Object.freeze(Object.defineProperty({__proto__:null,createEmptyImageData:nl,encode:ta,encodeData:ea,getFormatAndQuality:oa,getMaximumResolutionScale:aa,resampleHermite:zp,toDataUrl:sa},Symbol.toStringTag,{value:"Module"})),ra={flipY:!0,premultipliedAlpha:!0};async function Wp(t,e){const i=await la(t,e),{format:n,quality:s}=oa(e?.format,e?.quality);return ta(i,{format:n,quality:s},ra)}async function Up(t,e){const i=await la(t,e);return ea(i,ra)}function la(t,e){const i=Bp(e||{},qp(t.stage,t.size),t.size,t.padding),n=jp(e,t.allLayerViews);return t.stage.takeScreenshot(i,n,t.backgroundColor,e?.rotation)}function jp(t={},e){if(!t.layers)return;const i=[];return t.layers.forEach(n=>{const s=e.find(o=>o.layer.id===n.id);s?.container&&i.push(s.container)}),i}function qp(t,e){return Math.min(4,aa(e,Math.min(4096,t.context.parameters.maxTextureSize)))}function Bp(t,e,i,n){t.ignorePadding&&(n={left:0,right:0,top:0,bottom:0});let s=null;t.width!=null&&t.height!=null?s=[t.width,t.height]:t.width==null&&t.height!=null?s=[t.height,t.height]:t.width!=null&&t.height==null?s=[t.width,t.width]:t.width==null&&t.height==null&&(s=null);const o=i[0]-(n.left+n.right),a=i[1]-(n.top+n.bottom);let h,c,p=t.area||{x:0,y:0,width:o,height:a};if(s){const d=o/a,m=s[0]/s[1];if(m>d){const u=p.width/m;p={x:p.x,y:Math.round(p.y+(p.height-u)/2),width:p.width,height:Math.round(u)}}else{const u=p.height*m;p={x:Math.round(p.x+(p.width-u)/2),y:p.y,width:Math.round(u),height:p.height}}}else s=[p.width,p.height];return s[0]>p.width?(h=Math.min(s[0]/p.width,e),c=s[0]/p.width/h):(h=1,c=s[0]/p.width),{cropArea:{x:Math.round((p.x+n.left)*h),y:Math.round((p.y+n.top)*h),width:Math.round(p.width*h),height:Math.round(p.height*h)},outputScale:c,resolutionScale:h}}const Ns=160;let Pe=class extends M{constructor(){super(...arguments),this._timer=void 0}get stationary(){return!this._timer}flip(){this._timestamp=performance.now(),this._timer==null&&(this._timer=setInterval(()=>{performance.now()-this._timestamp>=Ns&&this.clear()},Ns))}clear(){this._timer&&(clearInterval(this._timer),this._timer=void 0)}};r([l()],Pe.prototype,"_timer",void 0),r([l()],Pe.prototype,"stationary",null),Pe=r([_("esri.views.2d.support.StationaryManager")],Pe);const Kp=t=>t.includes("Brush");let ha=class{constructor(){this._names=new Map}begin(t){this._names.has(t)||(this._names.set(t,!1),Kp(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 Yp(t){const e=sl();return e.available?t==="3d"&&e.majorPerformanceCaveat?new C("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."):e.supportsHighPrecisionFragment?e.supportsVertexShaderSamplers?null:new C("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new C("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):new C("webgl:required","WebGL2 is required but not supported.",new Error().stack)}function Xp(t){return t&&"nodeType"in t}function Qp(t){return t&&typeof t.render=="function"}const Fs={component:"esri-component"};let Wt=class extends M{constructor(){super(...arguments),this.widget=null}destroy(){this.node=null,this.widget?.destroy()}get id(){return this._get("id")??this.widget?.id??this.node?.id}set id(t){this._set("id",t)}set node(t){const e=this._get("node");t!==e&&(t&&t.classList.add(Fs.component),e&&e.classList.remove(Fs.component),this._set("node",t))}castNode(t){return this.widget?.destroy(),t?typeof t=="string"||Xp(t)?(this._set("widget",null),so(t)):(Qp(t)&&!t.domNode&&(t.domNode=document.createElement("div")),this._set("widget",t),t.domNode):(this._set("widget",null),null)}};r([l()],Wt.prototype,"id",null),r([l()],Wt.prototype,"node",null),r([Bt("node")],Wt.prototype,"castNode",null),r([l({readOnly:!0})],Wt.prototype,"widget",void 0),Wt=r([_("esri.views.ui.Component")],Wt);const Je=Wt,Jp={left:0,top:0,bottom:0,right:0},ca={bottom:30,top:15,right:15,left:15},mt="esri-ui",j={ui:mt,corner:`${mt}-corner`,innerContainer:`${mt}-inner-container`,manualContainer:`${mt}-manual-container`,cornerContainer:`${mt}-corner-container`,topLeft:`${mt}-top-left`,topRight:`${mt}-top-right`,bottomLeft:`${mt}-bottom-left`,bottomRight:`${mt}-bottom-right`};function td(t){return t&&!t._started&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}function qe(t){return t===0?"0":`${t}px`}function $i(t){const e=typeof t=="object"&&t!==null&&Object.getPrototypeOf(t);return(e===null||e===Object.prototype)&&("component"in t||"index"in t||"position"in t)?t:null}function Wi(t,{top:e,bottom:i,left:n,right:s}){t.style.top=e,t.style.bottom=i,t.style.left=n,t.style.right=s}let ht=class extends hi.EventedAccessor{constructor(t){super(t),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._removeWidgetHandleKey=Symbol("componentOnRemoveSymbol"),this._locale=Ha(),this.view=null,this._applyViewPadding=()=>{const e=this.container;e&&Wi(e,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const e=this._innerContainer;e&&Wi(e,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([w(()=>[this.view?.padding,this.container],this._applyViewPadding,U),w(()=>this.padding,this._applyUIPadding,U),w(()=>[this.container,this._locale],([t,e])=>{t&&t.setAttribute("lang",e)},U),Za(t=>{this._locale=t})])}destroy(){this.container=null;for(const t of this._components)t.destroy();this._components.length=0,this._componentMap.clear()}set container(t){const e=this._get("container");t!==e&&(t&&(t.classList.add(j.ui),vr(t),this._attachContainers(t)),e&&(e.classList.remove(j.ui),Wi(e,{top:"",bottom:"",left:"",right:""}),e.textContent=""),this._set("container",t))}get height(){const t=this.view?.height??0;if(t===0)return t;const e=this._getViewPadding(),{top:i,bottom:n}=e;return Math.max(t-i-n,0)}get padding(){return this._get("padding")}set padding(t){this._overrideIfSome("padding",t)}castPadding(t){return typeof t=="number"?{bottom:t,top:t,right:t,left:t}:{...ca,...t}}get width(){const t=this.view?.width??0;if(t===0)return t;const e=this._getViewPadding(),{left:i,right:n}=e;return Math.max(t-i-n,0)}add(t,e){let i,n,s;if(Array.isArray(t))return void t.forEach(a=>this.add(a,e));const o=$i(t);o&&({index:i,position:e,component:t,key:n}=o),e&&typeof e=="object"&&({index:i,key:n,position:e,internal:s}=e),!t||e&&!this._isValidPosition(e)||this._add(t,e,i,n,s)}remove(t,e){if(!t)return;if(Array.isArray(t))return t.map(n=>this.remove(n,e));const i=this._find(t);if(i){if(this._componentMap.has(i)&&this._componentMap.get(i)?.key!==e)return;const n=this._components.indexOf(i);return i.node.parentNode?.removeChild(i.node),this._componentMap.delete(i),i.widget?.removeHandlesReference(this._removeWidgetHandleKey),this._components.splice(n,1)[0]}}empty(t,e={removeInternal:!1}){if(Array.isArray(t)){for(const s of t)this.empty(s,e);return}const i=this._positionNameToContainerLookup[t??"manual"],n=Array.prototype.slice.call(i.children).map(s=>this._findByNode(s)).filter(s=>s==null?!1:!(this._componentMap.get(s)?.internal??!1)||e.removeInternal);for(const s of n)this.remove(s)}move(t,e){if(Array.isArray(t)&&t.forEach(o=>this.move(o,e)),!t)return;let i;const n=$i(t)||$i(e);if(n&&(i=n.index,e=n.position,t=n.component||t),e&&!this._isValidPosition(e))return;const s=this.remove(t);s&&this.add(s,{position:e,index:i})}find(t){if(!t)return null;const e=this._findById(t);return e&&(e.widget||e.node)}getComponents(t,e={includeInternal:!1}){return t?Array.isArray(t)?t.flatMap(i=>this._getComponentsAtPosition(i,e)):this._getComponentsAtPosition(t,e):this._components.filter(i=>e.includeInternal||!this._componentMap.get(i)?.internal).map(({widget:i,node:n})=>i??n)}getPosition(t){for(const e in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[e].contains(t))return e;return null}_add(t,e,i,n,s){t instanceof Je||(t=new Je({node:t}));const{widget:o}=t;o!=null&&o instanceof M&&o.addHandles(di(()=>{queueMicrotask(()=>this.remove(t))}),this._removeWidgetHandleKey),this._place({component:t,position:e,index:i}),this._components.push(t),this._componentMap.set(t,{key:n,internal:s})}_find(t){return t?t instanceof Je?this._findByComponent(t):typeof t=="string"?this._findById(t):this._findByNode(t.domNode||t):null}_getViewPadding(){return this.view?.padding??Jp}_attachContainers(t){t.appendChild(this._innerContainer),t.appendChild(this._manualContainer)}_initContainers(){const t=document.createElement("div");t.classList.add(j.innerContainer,j.cornerContainer);const e=document.createElement("div");e.classList.add(j.innerContainer,j.manualContainer);const i=document.createElement("div");i.classList.add(j.topLeft,j.corner),t.appendChild(i);const n=document.createElement("div");n.classList.add(j.topRight,j.corner),t.appendChild(n);const s=document.createElement("div");s.classList.add(j.bottomLeft,j.corner),t.appendChild(s);const o=document.createElement("div");o.classList.add(j.bottomRight,j.corner),t.appendChild(o),this._innerContainer=t,this._manualContainer=e;const a=wr();this._cornerNameToContainerLookup={"top-left":i,"top-right":n,"bottom-left":s,"bottom-right":o,"top-leading":a?n:i,"top-trailing":a?i:n,"bottom-leading":a?o:s,"bottom-trailing":a?s:o},this._positionNameToContainerLookup={manual:e,...this._cornerNameToContainerLookup}}_isValidPosition(t){return!!this._positionNameToContainerLookup[t]}_place(t){const e=t.position??"manual",{component:i,index:n}=t,s=this._positionNameToContainerLookup[e],o=n!=null&&n>-1;if(td(i.widget)&&i.widget.startup(),!o)return void s.appendChild(i.node);const a=Array.from(s.children);if(n===0){const{firstChild:c}=s;return void(c?c.parentNode?.insertBefore(i.node,c):s.appendChild(i.node))}if(n>=a.length)return void s.appendChild(i.node);const h=a[n];h.parentNode?.insertBefore(i.node,h)}_toPixelPosition(t){return{top:qe(t.top),left:qe(t.left),right:qe(t.right),bottom:qe(t.bottom)}}_findByComponent(t){return this._components.find(e=>e===t)??null}_findById(t){return this._components.find(({id:e})=>e===t)??null}_findByNode(t){return this._components.find(({node:e})=>e===t)??null}_getComponentsAtPosition(t,e){const i=this._positionNameToContainerLookup[t];return Array.prototype.slice.call(i.children).map(n=>this._findByNode(n)).filter(ni).filter(n=>e.includeInternal||!this._componentMap.get(n)?.internal).map(({widget:n,node:s})=>n??s)}};r([l()],ht.prototype,"_locale",void 0),r([l()],ht.prototype,"container",null),r([l()],ht.prototype,"height",null),r([l({value:ca})],ht.prototype,"padding",null),r([Bt("padding")],ht.prototype,"castPadding",null),r([l()],ht.prototype,"view",void 0),r([l()],ht.prototype,"width",null),ht=r([_("esri.views.ui.UI")],ht);const ed=ht,id=new Map;function nd(t){return id.get(t)}function Hs(t,e){return t&&"copyright"in t&&(!e||typeof t.originOf=="function"&&t.originOf("copyright")==="user")}function sd(t,e){return t.length!==e.length||t.some((i,n)=>i.text!==e[n].text)}function fe(t,e,i){!i||!e||t.find(n=>n.layerView===e&&n.text===i)||t.push({text:i,layerView:e})}function od(t){return t.type==="bing-maps"}const gt=[];let re=class extends M{constructor(t){super(t),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new L,this.view=null,this._allLayerViewsChange=e=>{this.removeHandles("suspension"),this.removeHandles("visible-geometry-changed");const i=this.view?.allLayerViews;i&&(this.addHandles(i.map(n=>w(()=>[n.suspended,n.layer?.attributionVisible],()=>this._updateAttributionItems())).toArray(),"suspension"),i.forEach(n=>{n.declaredClass==="esri.views.3d.layers.Tiles3DLayerView3D"&&this.addHandles(n.on("visible-geometry-changed",()=>this._updateAttributionItems()),"visible-geometry-changed")})),e?.removed&&e.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.addHandles([ci(()=>this.view?.allLayerViews,"change",e=>this._allLayerViewsChange(e),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Ce(()=>this.view?.stationary===!0,()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.view?.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const t=this.view,e=t?.allLayerViews;if(gt.length=0,!t||!e)return void this._clear();e.forEach(n=>{if(n.suspended||!n.layer?.attributionVisible)return;const s=n.layer;if(Hs(s,"user"))return void fe(gt,n,s.copyright);if(s.hasAttributionData){if(this._fetchedAttributionData.has(n)){const a=this._fetchedAttributionData.get(n);return void(a?fe(gt,n,this._getDynamicAttribution(a,t,s)):Hs(s)&&fe(gt,n,s.copyright))}return void this._fetchAttributionData(n)}const o="portalItem"in s?s.portalItem?.accessInformation:void 0;fe(gt,n,o||s.copyright)});const i=e.find(n=>n.layer?.type==="integrated-mesh-3dtiles");if(this.view&&i){const n=nd(this.view);if(n){const s=n.getAttributionText();for(let o=0;o{const d=p.id,m=!c.has(d)&&h&&p.extent&&mn(p.extent,h);return m&&c.add(d),m}).sort((p,d)=>d.score-p.score||p.objectId-d.objectId).map(p=>p.attribution).join(", "):""}};r([l({readOnly:!0,type:L})],re.prototype,"items",void 0),r([l({readOnly:!0})],re.prototype,"state",null),r([l()],re.prototype,"view",void 0),re=r([_("esri.widgets.Attribution.AttributionViewModel")],re);const pa=re,pt={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};function ad(){return function(t,e){if(!t[e])throw new TypeError(`Cannot auto bind undefined function '${String(e)}'`);return{value:ld(t[e])}}}function rd(t){const e=t?.type;return t instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function ld(t){return function(e,...i){rd(e)?br(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):t.call(this,e,...i)}}const ie="esri-attribution",ne={base:ie,poweredBy:`${ie}__powered-by`,sources:`${ie}__sources`,open:`${ie}--open`,sourcesOpen:`${ie}__sources--open`,link:`${ie}__link`};let W=class extends gi{constructor(t,e){super(t,e),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(i=>i.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.itemDelimiter=" | ",this.messages=null,this.viewModel=new pa}initialize(){this.addHandles(ci(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((t,e)=>(t.includes(e.text)||t.push(e.text),t),[]).join(this.itemDelimiter)}get icon(){return"description"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t={[ne.open]:this._isOpen};return B("div",{bind:this,class:this.classes(ne.base,pt.widget,t),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return B("div",{class:ne.poweredBy},"Powered by"," ",B("a",{class:ne.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const t=this._isOpen,e=this._isInteractive,i=e?0:void 0,{attributionText:n}=this,s={[ne.sourcesOpen]:t,[pt.interactive]:e};return B("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(ne.sources,s),innerHTML:n,tabIndex:i})}_afterSourcesNodeCreate(t){this._prevSourceNodeHeight=t.clientWidth,this._resizeObserver.observe(t)}_checkSourceTextOverflow(t){let e=!1;const{clientHeight:i,clientWidth:n,scrollWidth:s}=t,o=s>n,a=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,a&&(e=!0),this._isOpen){const h=i{let e=class extends t{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:n}=this;return sr(n),this.goToOverride?this.goToOverride(n,i):n.goTo(i.target,i.options)}};return r([l()],e.prototype,"goToOverride",void 0),r([l()],e.prototype,"view",void 0),e=r([_("esri.widgets.support.GoTo")],e),e};let Ut=class extends dd(M){constructor(t){super(t),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(w(()=>this.view,this._updateRotationWatcher,U))}destroy(){this.view=null}get canShowNorth(){return pd(this.view)}get state(){return!this.view?.ready||this.view.type==="2d"&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){this.view?.ready&&(this.view?.type==="2d"?this.callGoTo({target:{rotation:0},options:{animationMode:"always",duration:cd()}}):this.callGoTo({target:{heading:0}}))}_updateForRotation(t){t!=null&&this._set("orientation",{z:t})}_updateForCamera(t){if(!t)return;const e=-t.heading;this._set("orientation",{x:0,y:0,z:e})}_updateRotationWatcher(t){this.removeAllHandles(),t&&this.addHandles(t.type==="2d"?w(()=>t?.rotation,this._updateForRotation,U):w(()=>t?.camera,this._updateForCamera,U))}};r([l({readOnly:!0})],Ut.prototype,"canShowNorth",null),r([l({readOnly:!0})],Ut.prototype,"orientation",void 0),r([l({readOnly:!0})],Ut.prototype,"state",null),r([l()],Ut.prototype,"view",void 0),Ut=r([_("esri.widgets.Compass.CompassViewModel")],Ut);const da=Ut,Zs="esri-compass",Gs={base:Zs,iconContainer:`${Zs}__icon-container`};let ft=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new da,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=i=>({transform:`rotateZ(${i.z}deg)`})}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-By40tgvH.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url),icon:()=>b(()=>import("./calcite-icon-laqhdRBY-Dn93dMQE.js"),__vite__mapDeps([268,265,6,3,1,2,4,7,256,263]),import.meta.url)})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get icon(){return this.viewModel.state==="rotation"?"arrow-up":"compass-needle"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}reset(){return this.viewModel.reset()}render(){const{orientation:t,state:e}=this.viewModel,{messages:i}=this;return B("div",{class:this.classes(Gs.base,pt.widget)},B("calcite-button",{class:pt.widgetButton,disabled:e==="disabled",kind:"neutral",label:i.reset,onclick:this._reset,round:!0,scale:"s",title:i.reset},B("div",{"aria-hidden":"true",class:Gs.iconContainer,title:i.reset},B("calcite-icon",{icon:this.icon,styles:this._toRotationTransform(t)}))))}};r([l()],ft.prototype,"goToOverride",null),r([l()],ft.prototype,"icon",null),r([l()],ft.prototype,"label",null),r([l(),mi("esri/widgets/Compass/t9n/Compass")],ft.prototype,"messages",void 0),r([l()],ft.prototype,"view",null),r([l({type:da})],ft.prototype,"viewModel",void 0),ft=r([_("esri.widgets.Compass")],ft);const ud=ft,$s="esri-navigation-toggle",Ws={base:$s,isLayoutHorizontal:`${$s}--horizontal`};let le=class extends M{constructor(t){super(t),this._navigationMode="pan",this.view=null}initialize(){this.addHandles(Ce(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.view?.ready&&this.view?.type==="3d"?"ready":"disabled"}get navigationMode(){return this._navigationMode}set navigationMode(t){this._navigationMode=t,this._setNavigationMode()}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate")}_setNavigationMode(){const t=this.view?.inputManager;t&&(t.primaryDragAction=this._navigationMode==="pan"?"pan":"rotate")}};r([l({readOnly:!0})],le.prototype,"state",null),r([l()],le.prototype,"_navigationMode",void 0),r([l()],le.prototype,"view",void 0),le=r([_("esri.widgets.NavigationToggle.NavigationToggleViewModel")],le);const ua=le;let vt=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new ua,this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const i=this.viewModel?.navigationMode==="pan"?this._rotateButton:this._panButton;Tr(i),this.toggle()}}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-By40tgvH.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url)})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t=this.viewModel?.state==="disabled",e=this.viewModel?.navigationMode==="pan",i=this.messages.toggle;return B("div",{class:this.classes(Ws.base,pt.widget,{[Ws.isLayoutHorizontal]:this.layout==="horizontal"})},B("calcite-button",{afterCreate:n=>{this._panButton=n},appearance:e?"outline-fill":"solid",class:pt.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?void 0:-1,title:i}),B("calcite-button",{afterCreate:n=>{this._rotateButton=n},appearance:e?"solid":"outline-fill",class:pt.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?-1:void 0,title:i}))}};r([l()],vt.prototype,"icon",null),r([l()],vt.prototype,"label",null),r([l({value:"vertical"})],vt.prototype,"layout",null),r([l(),mi("esri/widgets/NavigationToggle/t9n/NavigationToggle")],vt.prototype,"messages",void 0),r([l()],vt.prototype,"view",null),r([l({type:ua})],vt.prototype,"viewModel",void 0),vt=r([_("esri.widgets.NavigationToggle")],vt);const md=vt;let jt=class extends M{get canZoomIn(){if(!this.view?.ready)return!1;const t=this.view?.constraints?.effectiveMaxScale;return t===0||this._scale>t}get canZoomOut(){const{view:t}=this;if(!t?.ready)return!1;const e=t.constraints?.effectiveMinScale;return e===0||this._scalethis.viewModel.zoomIn(),this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-By40tgvH.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url)})}get icon(){return"magnifying-glass-plus"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}set view(t){this.viewModel.view=t}get view(){return this.viewModel.view}render(){const t={[Us.horizontalLayout]:this.layout==="horizontal"},{canZoomIn:e,canZoomOut:i}=this.viewModel,{zoomIn:n,zoomOut:s}=this.messages;return B("div",{class:this.classes(Us.base,pt.widget,t)},B("calcite-button",{class:pt.widgetButton,disabled:!e,iconStart:"plus",kind:"neutral",label:n,onclick:this.zoomIn,title:n}),B("calcite-button",{class:pt.widgetButton,disabled:!i,iconStart:"minus",kind:"neutral",label:s,onclick:this.zoomOut,title:s}))}};r([l()],wt.prototype,"icon",null),r([l()],wt.prototype,"label",null),r([l({value:"vertical"})],wt.prototype,"layout",null),r([l(),mi("esri/widgets/Zoom/t9n/Zoom")],wt.prototype,"messages",void 0),r([l()],wt.prototype,"view",null),r([l({type:ma})],wt.prototype,"viewModel",void 0),wt=r([_("esri.widgets.Zoom")],wt);const _d=wt;function fd(t){return t?.view!==void 0}let ti=class extends ed{constructor(t){super(t),this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=e=>{this.components.forEach(i=>{const n=this._find(i),s=n?.widget;fd(s)&&(s.view=e)})},this._componentsWatcher=(e,i)=>{this._removeComponents(i),this._addComponents(e),this._adjustPadding(e)}}initialize(){this.addHandles([w(()=>this.components,this._componentsWatcher,U),w(()=>this.view,this._updateViewAwareWidgets,U)])}_add(t,e,i,n,s){let o=t;if(typeof t=="string"&&this._defaultPositionLookup[t]){if(this._find(t))return;o=this._createComponent(t)}super._add(o,e,i,n,s)}_removeComponents(t){t.forEach(e=>{const i=this._find(e);i&&(this.remove(i),i.destroy())})}_adjustPadding(t){if(!t.includes("attribution")&&!this._isOverridden("padding")){const{top:e}=this.padding;this.padding=e}}_addComponents(t){this.constructed&&t.forEach(e=>this.add(this._createComponent(e),this._defaultPositionLookup[e]))}_createComponent(t){const e=this._createWidget(t);return new Je({id:t,node:e})}_createWidget(t){const e=this.view;switch(t){case"attribution":return new hd({view:e});case"compass":return new ud({view:e});case"navigation-toggle":return new md({view:e});case"zoom":return new _d({view:e})}}};r([l()],ti.prototype,"components",void 0),ti=r([_("esri.views.ui.DefaultUI")],ti);const ga=ti;let ei=class extends ga{constructor(t){super(t),this.components=["attribution","zoom"]}};r([l()],ei.prototype,"components",void 0),ei=r([_("esri.views.ui.2d.DefaultUI2D")],ei);const ya=ei;class vd extends ol{constructor(e,i){super(e,i,"webmap")}}function Ui(t){return t!=null&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.WebMap"}new vd(2,32);let _a,fa,va,wa,ba,Ta,Ma;async function wd(){const[,{GraphicsView2D:t,GraphicContainer:e,LabelManager:i,MapViewNavigation:n,MagnifierView2D:s,GridView2D:o,Stage:a}]=await Promise.all([b(()=>import("./webglDeps-Bgavuh0h-CPBMgmjx.js"),__vite__mapDeps([141,142,3,1,2,4,135,134,143,144,145,146]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-Ccomlwj9.js"),__vite__mapDeps([147,1,2,3,4,116,45,46,24,47,148,149,58,150,30,29,133,112,113,114,115,78,111,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,156,128,146,157,158,145,132,159,160,27,22,23,161,162,163,164,59,39,137,165,166,44,48,167,168,169,141,144,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,177,178,179,180,181,136,182,57,183,184,185,186,187,188,189,190,191,192,193,194,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,41,138]),import.meta.url)]);fa=t,va=e,wa=i,ba=n,Ta=s,Ma=o,_a=a}let v=class extends hl(kl(ml(gh))){constructor(t){super(t),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new Xe({view:this}),this.graphicsView=null,this.stateManager=new Z({constraints:new Go({view:this})}),this.stationaryManager=new Pe,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new xc(this),this.floors=new L,this.grid=null,this.highlights=Jo(),this.inputManager=new hp({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new ha,this.type="2d",this.view2dType=null,this.ui=new ya,this.test={takeScreenshot:async e=>Up(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([w(()=>this.viewpoint,()=>this.stationaryManager.flip(),Ee),this.on("resize",e=>this.stateManager.resize(e.width,e.height))]),gr()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=tt(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new dp(this.featuresTilingScheme)}get constraintsInfo(){const t=this.defaultsFromMap?.tileInfo,e=this.spatialReference;return{lods:t?.spatialReference?.equals(e)?t.lods:null,spatialReference:e}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:t,constraints:e,center:i,viewpoint:n,extent:s}=this;let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&!s&&(e?.effectiveLODs||(o=-1),(!i||t===0&&o===-1)&&(n?.targetGeometry==null||n.targetGeometry.type!=="extent"&&!n.scale))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const t=this._getDefaultViewpoint();if(!t)return!1;const e=t.targetGeometry,i=this.spatialReference;return yr(e.spatialReference,i)}set animation(t){const e=this._get("animation");if(t===e)return;if(e&&e.stop(),t!==this.animationManager.animation&&this.animationManager.stop(),!t||t.isFulfilled())return void this._set("animation",null);this._set("animation",t);const i=()=>{this.destroyed||t===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame())};t.when(i,i)}get background(){return Ui(this.map)?this.map.initialViewProperties.background:null}set background(t){this._override("background",t)}get center(){return this.stateManager?.center??null}set center(t){this.stateManager.center=t}get constraints(){return this.stateManager?.constraints}set constraints(t){t.view=this;const e=this.stateManager.constraints;this.stateManager.constraints=t,e?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(t){this.stateManager.extent=t}get highlightOptions(){return Lp(this)}set highlightOptions(t){Vp(this,t)}get padding(){return this.stateManager?.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(t){this.stateManager.resizeAlign=t}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(t){const{rotationEnabled:e}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=t,this.constraints.rotationEnabled=e}get scale(){return this.stateManager?.scale??0}set scale(t){this.stateManager&&(this.stateManager.scale=t)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const t=!(!this.magnifier.visible||this.magnifier.position===null||!this._magnifierView?.updatingHandles.updating),e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(i=>!i.destroyed&&!("layerViews"in i)&&i.updating===!0)||t);if(z("esri-2d-log-updating")){const i=this.allLayerViews.reduce((n,s)=>({...n,[`${s.layer.id}(${s.layer.type})`]:!s.destroyed&&!("layerViews"in s)&&s.updating}),{});console.log(`Updating MapView: ${e} + - shorter than ${h/1e3}s and the start point is close enough to the destination screen`),!1}return!0}r([l()],ae.prototype,"easing",void 0),r([l()],ae.prototype,"view",void 0),r([l()],ae.prototype,"viewpoint",void 0),ae=r([_("esri.views.2d.AnimationManager")],ae);const Mc=ae;let xc=class{constructor(t){this.view=t,this._stationaryHandle=null,this._frameTaskHandle=null,this._updateParameters=null,this._updateRequested=!1,this._scheduler=Br(),this.stationary=!0,this.prepare=()=>{this._updateParameters&&(this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions,this._updateParameters.targetState.copy(this.view.state),this.view.animation?.target==null||to(this.view.animation.target)||(this._updateParameters.targetState.viewpoint=this.view.animation.target))},this.update=e=>{if(this._updateRequested=!1,this.view?.destroyed)return;const{allLayerViews:i,graphicsView:n,labelManager:s,state:{id:o}}=this.view;i.forEach(this._updateLayerView,this),s!=null&&(s.lastUpdateId!==o&&(s.viewChange(),s.lastUpdateId=o),s.updateRequested&&s.processUpdate(this._updateParameters)),n!=null&&(n.lastUpdateId!==o&&(n.viewChange(),n.lastUpdateId=o),n.updateRequested&&n.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.view.animation?this._scheduler.state=Pi.ANIMATING:this.view.interacting?this._scheduler.state=Pi.INTERACTING:this._scheduler.state=Pi.IDLE,this._scheduler.updateBudget(e)&&this._scheduler.frame()}}destroy(){this.stop(),this._scheduler.destroy()}get scheduler(){return this._scheduler}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,targetState:new En,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=w(()=>t.stationary,e=>{this.stationary=e,this.requestFrame()}),this._frameTaskHandle=de(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)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){if(!t.attached)return void this.requestUpdate();const e=this.view.state,i=t.lastUpdateId;i!=null&&(this.stationary||t.moving)||(t.moving=!0),i!==e.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=e.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews?.forEach(this._updateLayerView,this)}},Xe=class extends M{constructor(t){super(t),this._gotoTask=null}destroy(){this._gotoTask=null}async goTo(t,e){if(!t)return void D.getLogger(this).error("#goTo()","target cannot be null or undefined");const i=new Qi;this.view.animation=i,await pn(()=>this.view.ready,e);const n={...e,animate:e?.animate??!wo(),animationMode:e?.animationMode??"auto"},{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d}=this.view,m=Mh(t,{extent:s,spatialReference:o,size:a,viewpoint:h,constraints:c,padding:p,allLayerViews:d,pickClosestTarget:e?.pickClosestTarget??!0});return i?.update(m),this._gotoTask={},n.animate?this._gotoAnimated(m,n):this._gotoImmediate(m,n)}_gotoImmediate(t,e){const i=this._gotoTask,n=this.view.animation,s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");this.view.viewpoint=n.target=o,n.finish()});return this._cancellableGoTo(i,n,s,e)}_gotoAnimated(t,e){const i=this._gotoTask,n=this.view.animation;if(!n)return Promise.resolve();const s=t.then(o=>{if(Ot(e),i!==this._gotoTask)throw new C("view:goto-interrupted","Goto was interrupted");return n.update(o),this.view.animationManager.animate(n,this.view.viewpoint,e),n.when().then(()=>{},()=>{})});return this._cancellableGoTo(i,n,s,e)}_cancellableGoTo(t,e,i,n){const s=()=>t===this._gotoTask;return Ka(i,n).finally(()=>{s()&&(e.done||e.stop())})}};r([l({constructOnly:!0})],Xe.prototype,"view",void 0),Xe=r([_("esri.views.2d.GoToManager")],Xe);function k(){return Promise.all([b(()=>import("./webglDeps-Bgavuh0h-31Q0Fngh.js"),__vite__mapDeps([141,142,3,1,2,4,135,134,143,144,145,146]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-CjUjdWc1.js"),__vite__mapDeps([147,1,2,3,4,116,45,46,24,47,148,149,58,150,30,29,133,112,113,114,115,78,111,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,156,128,146,157,158,145,132,159,160,27,22,23,161,162,163,164,59,39,137,165,166,44,48,167,168,169,141,144,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,177,178,179,180,181,136,182,57,183,184,185,186,187,188,189,190,191,192,193,194,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,41,138]),import.meta.url)])}const ye=()=>k().then(()=>b(()=>import("./TileLayerView2D-CT-Yu10P-B6hAJ5mA.js"),__vite__mapDeps([195,3,1,2,4,125,45,46,24,47,29,30,166,133,148,149,58,150,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,44,48,160,27,22,23,158,146,145,128,132,159,161,162,163,164,59,169,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,57,156,157,39,137,167,168,178,179,180,186,187,196,197,191,198,118,199,189,190,200,201,202,203,64,204,193,205,206,207,208,131,10,119,120,121,6,7,123,18,19,20,21,38,124,77,71,72,126,130,136,41,138]),import.meta.url)),zt=()=>k().then(()=>b(()=>import("./FeatureLayerView2D-NmRd_IhT-DLbw0NYz.js"),__vite__mapDeps([209,3,1,2,4,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url).then(t=>t.F)),vs={"base-dynamic":()=>k().then(()=>b(()=>import("./BaseDynamicLayerView2D-AQ-6l0DU-CktIES_E.js"),__vite__mapDeps([212,3,1,2,4,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,214,120,121,197,200,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,131,136,137,41,138]),import.meta.url)),"base-tile":ye,"bing-maps":ye,catalog:()=>k().then(()=>b(()=>import("./CatalogLayerView2D-DaUVeBuS-B6e9UrTB.js"),__vite__mapDeps([215,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"catalog-dynamic-group":()=>k().then(()=>b(()=>import("./CatalogDynamicGroupLayerView2D-Cf-H7gda-BH_FQvA5.js"),__vite__mapDeps([216,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"catalog-footprint":()=>k().then(()=>b(()=>import("./CatalogFootprintLayerView2D-C0bBWVdF-CXy1ArWp.js"),__vite__mapDeps([217,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),csv:zt,"geo-rss":()=>k().then(()=>b(()=>import("./GeoRSSLayerView2D-BLTYupUX-D6HtIAUl.js"),__vite__mapDeps([218,3,1,2,4,32,33,25,34,35,36,37,38,39,40,31,41,42,43,44,45,46,24,47,29,30,48,49,63,14,15,198,160,27,22,23,118,122,188,189,190,133,148,149,58,150,112,113,114,115,78,111,116,117,13,16,129,151,152,135,134,143,142,153,154,155,127,191,158,146,145,128,132,159,161,162,163,164,59,156,157,137,53,54,51,55,186,173,65,174,175,61,62,176,92,187,10,119,120,121,6,7,123,18,19,20,21,124,77,125,71,72,126,130,131,136,138]),import.meta.url)),feature:zt,geojson:zt,parquet:zt,graphics:()=>k().then(()=>b(()=>import("./GraphicsLayerView2D-CGXlTqHO-BL8cF9rd.js"),__vite__mapDeps([219,3,1,2,4,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,211,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),group:()=>k().then(()=>b(()=>import("./GroupLayerView2D-BR-kLeLa-CBq3r1hE.js"),__vite__mapDeps([220,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),imagery:()=>k().then(()=>b(()=>import("./ImageryLayerView2D-CVDvTIGY-BlDqRH6r.js"),__vite__mapDeps([221,3,1,2,4,125,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,186,42,43,148,149,150,29,151,154,155,46,47,44,45,48,173,65,174,175,61,62,53,54,51,55,176,92,34,156,157,39,137,187,199,189,190,191,213,197,214,120,121,224,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,71,72,126,130,131,136,41,138]),import.meta.url)),"imagery-tile":()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-DxH8Z9x7.js"),__vite__mapDeps([225,3,1,2,4,226,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,227,191,120,121,228,224,61,62,131,137,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,41,138]),import.meta.url)),kml:()=>k().then(()=>b(()=>import("./KMLLayerView2D-hWgNYT5J-BiL2CcA0.js"),__vite__mapDeps([229,3,1,2,4,61,62,230,32,33,25,34,35,36,37,38,39,40,31,41,42,43,44,45,46,24,47,29,30,48,49,63,14,15,51,125,197,128,129,160,27,22,23,134,135,213,158,133,152,143,142,153,146,145,112,113,114,115,78,111,116,117,13,16,132,159,161,162,163,127,164,58,59,198,118,122,188,189,190,148,149,150,151,154,155,191,156,157,137,53,54,55,186,173,65,174,175,176,92,187,224,177,141,144,178,179,180,172,166,181,227,10,119,120,121,6,7,123,18,19,20,21,124,77,71,72,126,130,131,136,138]),import.meta.url)),"knowledge-graph":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-BmCZP-QP.js"),__vite__mapDeps([231,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"link-chart":()=>k().then(()=>b(()=>import("./KnowledgeGraphLayerView2D-BnEbgXue-BmCZP-QP.js"),__vite__mapDeps([231,3,1,2,4,198,160,27,22,23,24,118,122,10,119,78,61,62,120,121,6,7,116,123,18,19,20,21,38,124,77,16,125,71,111,13,14,15,72,126,127,114,112,113,115,117,53,54,51,55,128,129,130,131,132,133,134,135,136,137,41,138]),import.meta.url)),"knowledge-graph-sublayer":zt,"map-image":()=>k().then(()=>b(()=>import("./MapImageLayerView2D-LI7T-1xm-ZTi6guUq.js"),__vite__mapDeps([232,3,1,2,4,125,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,186,42,43,148,149,150,29,151,154,155,46,47,44,45,48,173,65,174,175,61,62,53,54,51,55,176,92,34,156,157,39,137,187,199,189,190,191,214,120,121,197,233,193,205,207,210,200,201,202,203,64,204,206,208,10,119,6,7,123,18,19,20,21,38,124,77,71,72,126,130,131,136,41,138]),import.meta.url)),"map-notes":()=>k().then(()=>b(()=>import("./MapNotesLayerView2D-EusnP8A_-53usLcYc.js"),__vite__mapDeps([234,3,1,2,4,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),media:()=>k().then(()=>b(()=>import("./MediaLayerView2D-COWFkA3m-B8oTarjg.js"),__vite__mapDeps([235,1,2,3,4,33,25,34,35,36,37,38,39,40,32,31,41,42,43,44,45,46,24,47,29,30,48,49,236,61,62,187,54,128,237,114,132,166,133,148,149,58,150,112,113,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,160,27,22,23,158,146,145,159,161,162,163,164,59,169,170,171,172,173,65,174,175,53,51,55,176,92,57,156,157,137,167,168,178,179,180,186,183,184,238,198,118,131,10,119,120,121,6,7,123,18,19,20,21,124,77,125,71,72,126,130,136,138]),import.meta.url)),"ogc-feature":()=>k().then(()=>b(()=>import("./OGCFeatureLayerView2D-CpSy5D2s-DSwmstmQ.js"),__vite__mapDeps([239,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),"open-street-map":ye,"oriented-imagery":zt,route:()=>k().then(()=>b(()=>import("./RouteLayerView2D-Bpui7Ggx-Dq8ar2NW.js"),__vite__mapDeps([240,3,1,2,4,119,241,198,160,27,22,23,24,118,122,188,189,190,133,148,149,58,150,30,29,112,113,114,115,78,111,116,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,164,59,156,157,39,137,53,54,51,55,186,42,43,44,45,48,173,65,174,175,61,62,176,92,34,187,10,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,136,41,138]),import.meta.url)),stream:()=>k().then(()=>b(()=>import("./StreamLayerView2D-Bh_aEalU-wWSqPGq-.js"),__vite__mapDeps([242,3,1,2,4,63,14,15,209,38,160,27,22,23,24,164,58,59,88,13,16,210,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),"subtype-group":()=>k().then(()=>b(()=>import("./SubtypeGroupLayerView2D-Byn0xzbb-DtCv0vxF.js"),__vite__mapDeps([243,3,1,2,4,209,38,160,27,22,23,24,164,58,59,88,13,14,15,16,210,63,198,118,122,190,133,148,149,150,30,29,112,113,114,115,78,111,116,117,129,151,152,135,134,143,142,153,154,155,127,46,47,191,158,146,145,128,132,159,161,162,163,156,157,39,137,171,72,36,96,91,92,49,165,166,211,87,83,205,208,200,10,119,61,62,120,121,6,7,123,18,19,20,21,124,77,125,71,126,53,54,51,55,130,131,136,41,138]),import.meta.url)),tile:ye,"vector-tile":()=>k().then(()=>b(()=>import("./VectorTileLayerView2D-B9OYHbL4-ANKZ9nt1.js"),__vite__mapDeps([244,3,1,2,4,34,169,78,151,134,135,57,182,166,157,113,31,112,24,114,115,111,116,117,13,14,15,16,128,150,142,146,162,158,133,152,30,143,153,129,145,132,159,160,27,22,23,161,163,127,164,58,59,120,121,191,245,246,247,45,46,47,130,198,118,122,200,131,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,136,137,41,138]),import.meta.url)),video:()=>k().then(()=>b(()=>import("./VideoLayerView2D-CLcxq4ZA-C6WSWoOW.js"),__vite__mapDeps([248,3,1,2,4,249,125,77,16,82,83,27,22,23,24,100,69,39,250,238,128,129,159,53,54,51,55,158,133,152,30,135,134,143,142,153,146,145,112,113,114,115,78,111,116,117,13,14,15,132,160,161,162,163,127,164,58,59,156,148,149,150,29,151,154,155,46,47,122,157,137,61,62,198,118,188,189,190,191,186,42,43,44,45,48,173,65,174,175,176,92,34,187,10,119,120,121,6,7,123,18,19,20,21,38,124,71,72,126,130,131,136,41,138]),import.meta.url)),wcs:()=>k().then(()=>b(()=>import("./ImageryTileLayerView2D-nEz2YhMc-DxH8Z9x7.js"),__vite__mapDeps([225,3,1,2,4,226,222,142,135,134,146,153,223,158,133,152,30,143,129,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,227,191,120,121,228,224,61,62,131,137,210,208,200,10,119,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,41,138]),import.meta.url)),"web-tile":ye,wfs:zt,wms:()=>k().then(()=>b(()=>import("./WMSLayerView2D-Dz-z-fa9-D5YTL9WO.js"),__vite__mapDeps([251,3,1,2,4,213,158,133,152,30,135,134,143,142,153,129,146,145,112,24,113,114,115,78,111,116,117,13,14,15,16,128,132,159,160,27,22,23,161,162,163,127,164,58,59,198,118,122,214,120,121,197,200,252,210,10,119,61,62,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,131,136,137,41,138]),import.meta.url)),wmts:()=>k().then(()=>b(()=>import("./WMTSLayerView2D-Bl5FUDUu-DwwTnV3d.js"),__vite__mapDeps([253,3,1,2,4,196,197,128,24,129,160,27,22,23,134,135,158,133,152,30,143,142,153,146,145,112,113,114,115,78,111,116,117,13,14,15,16,132,159,161,162,163,127,164,58,59,191,198,118,122,200,131,10,119,61,62,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,53,54,51,55,130,136,137,41,138]),import.meta.url)),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,focusArea:null,"integrated-mesh":null,"integrated-mesh-3dtiles":null,"point-cloud":null,viewshed:null,voxel:null,scene:null,unknown:null,unsupported:null};function Pc(t){const e=t.declaredClass?t.declaredClass.slice(t.declaredClass.lastIndexOf(".")+1):"Unknown",i=e.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new C(`${i}:view-not-supported`,`${e} is not supported in 2D`)}const ws={hasLayerViewModule:t=>vs[t.type]!=null,importLayerView:t=>{const e=vs[t.type];if(e==null)throw Pc(t);return e(t)}};function Sc(t,e){const{spatialReference:i}=e,n=[e.x,e.y];let s=Number.POSITIVE_INFINITY,o=0,a=0;const h=[0,0],c=t.type==="extent"?[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]:t.rings;for(const p of c)for(let d=0;dd.clone()),e.sort((d,m)=>m.scale-d.scale),e.forEach((d,m)=>d.level=m);for(const d of e)!c&&i>0&&i>=d.scale&&(a=d.level,c=!0),!p&&n>0&&n>=d.scale&&(h=t?t.level:-1,p=!0),t=d;s===-1&&(s=i===0?0:a),o===-1&&(o=n===0?e.length-1:h),s=Math.max(s,0),s=Math.min(s,e.length-1),o=Math.max(o,0),o=Math.min(o,e.length-1),s>o&&([s,o]=[o,s]),i=e[s].scale,n=e[o].scale,e.splice(0,s),e.splice(o-s+1,e.length),e.forEach((d,m)=>{this._lodByScale[d.scale]=d,this._scales[m]=d.scale}),this._set("effectiveLODs",e),this._set("effectiveMinZoom",s),this._set("effectiveMaxZoom",o),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",n)}constrain(t,e){if(e&&t.scale===e.scale)return t;const i=this.effectiveMinScale,n=this.effectiveMaxScale,s=t.targetGeometry,o=e&&e.targetGeometry,a=n!==0&&t.scalei;if(a||h){const c=h?i:n;if(e&&o){const p=(c-e.scale)/(t.scale-e.scale);s.x=o.x+(s.x-o.x)*p,s.y=o.y+(s.y-o.y)*p}t.scale=c}return this.snapToZoom&&this.effectiveLODs&&(t.scale=this._getClosestScale(t.scale)),t}fit(t){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(t,null);const e=this.scaleToZoom(t.scale),i=Math.abs(e-Math.floor(e));return t.scale=this.zoomToScale(i>.99?Math.round(e):Math.floor(e)),t}zoomToScale(t){if(!this.effectiveLODs)return 0;t-=this.effectiveMinZoom,t=Math.max(0,t);const e=this._scales;if(t<=0)return e[0];if(t>=e.length)return e[e.length-1];const i=Math.floor(t),n=Math.ceil(t);return e[i]+(t-i)*(e[n]-e[i])}scaleToZoom(t){if(!this.effectiveLODs)return-1;const e=this._scales;let i,n;if(t>=e[0])return this.effectiveMinZoom;if(t<=e[e.length-1])return this.effectiveMaxZoom;for(let s=0;st&&nMath.abs(i-t)<=Math.abs(e-t)?i:e,this._scales[0])),this._lodByScale[t].scale}};r([l({readOnly:!0})],q.prototype,"effectiveLODs",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxZoom",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMinScale",void 0),r([l({readOnly:!0})],q.prototype,"effectiveMaxScale",void 0),r([l()],q.prototype,"lods",void 0),r([l()],q.prototype,"minZoom",void 0),r([l()],q.prototype,"maxZoom",void 0),r([l()],q.prototype,"minScale",void 0),r([l()],q.prototype,"maxScale",void 0),r([l()],q.prototype,"snapToZoom",void 0),q=an=r([_("esri.views.2d.constraints.ZoomConstraint")],q);const Zo=q,kc={base:null,key:"type",typeMap:{extent:Xt,polygon:Xs}};let R=class extends M{constructor(t){super(t),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0,this.customConstraints=new L}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(t){t?this._set("geometry",t):this._set("geometry",null)}get version(){return`${this._zoom?.uid}/${this._rotation?.uid}/${this._geometry?.uid}`}get _geometry(){const t=this._get("_geometry");return t&&this.geometry===t.geometry&&this.view?.constraintsInfo.spatialReference===t.spatialReference?t:new qt({geometry:this.geometry,spatialReference:this.view?.constraintsInfo.spatialReference})}get _rotation(){return new Ho({rotationEnabled:this.rotationEnabled})}get _zoom(){const t=this._get("_zoom"),e=this.lods||this.view?.constraintsInfo.lods,i=this.minZoom,n=this.maxZoom,s=this.minScale,o=this.maxScale,a=this.snapToZoom;return t&&t.lods===e&&t.minZoom===i&&t.maxZoom===n&&t.minScale===s&&t.maxScale===o&&t.snapToZoom===a?t:new Zo({lods:e,minZoom:i,maxZoom:n,minScale:s,maxScale:o,snapToZoom:a})}canZoomInTo(t){const e=this.effectiveMaxScale;return e===0||t>=e}canZoomOutTo(t){const e=this.effectiveMinScale;return e===0||t<=e}constrain(t,e){return this._zoom.constrain(t,e),this._rotation.constrain(t,e),this._geometry.constrain(t,e),this.customConstraints.forEach(i=>i.constrain(t,e)),t}constrainByGeometry(t){return this._geometry.constrain(t),this.customConstraints.forEach(e=>e.applyPanConstraint?.(t)),t}fit(t){return this._zoom.fit(t)}zoomToScale(t){return this._zoom.zoomToScale(t)}scaleToZoom(t){return this._zoom.scaleToZoom(t)}snapScale(t){return this._zoom.snapToClosestScale(t)}snapToNextScale(t){return this._zoom.snapToNextScale(t)}snapToPreviousScale(t){return this._zoom.snapToPreviousScale(t)}};r([l({readOnly:!0})],R.prototype,"effectiveLODs",null),r([l({readOnly:!0})],R.prototype,"effectiveMinScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxScale",null),r([l({readOnly:!0})],R.prototype,"effectiveMinZoom",null),r([l({readOnly:!0})],R.prototype,"effectiveMaxZoom",null),r([l({types:kc,value:null})],R.prototype,"geometry",null),r([l({type:[_r]})],R.prototype,"lods",void 0),r([l()],R.prototype,"minScale",void 0),r([l()],R.prototype,"maxScale",void 0),r([l()],R.prototype,"minZoom",void 0),r([l()],R.prototype,"maxZoom",void 0),r([l()],R.prototype,"rotationEnabled",void 0),r([l()],R.prototype,"snapToZoom",void 0),r([l({type:L})],R.prototype,"customConstraints",void 0),r([l()],R.prototype,"view",void 0),r([l({readOnly:!0})],R.prototype,"version",null),r([l({type:qt,readOnly:!0})],R.prototype,"_geometry",null),r([l({type:Ho})],R.prototype,"_rotation",null),r([l({readOnly:!0,type:Zo})],R.prototype,"_zoom",null),R=r([_("esri.views.2d.MapViewConstraints")],R);const Go=R;let Z=class extends M{constructor(t){super(t),this.constraints=null,this.ready=!1,this.resizeAlign="center",this.addHandles([w(()=>this.constraints?.version,e=>{this.constraints&&e&&this.ready&&(this.state.viewpoint=this.constraints.fit(this.state.paddedViewState.viewpoint))},Ee)])}get center(){if(!this.ready)return this._get("center");const{center:t,spatialReference:e}=this.state.paddedViewState;return this.state.commitProperty("id"),new V({x:t[0],y:t[1],spatialReference:e})}set center(t){if(t==null)return;if(!this.ready)return void this._set("center",t);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-center","could not project the value in the view's spatial reference",{input:t,error:n}))}const i=this.viewpoint;Ji(i,i,e),this.viewpoint=i}get extent(){return this.ready?(this.state.commitProperty("id"),this.state.paddedViewState.extent.clone()):this._get("extent")}set extent(t){if(t==null)return;if(!t.width||!t.height)return void D.getLogger(this).error(new C("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",t),this._set("center",void 0),this._set("viewpoint",void 0),this._set("scale",void 0),void this._set("zoom",void 0);let e;try{e=this._project(t,this.state.spatialReference)}catch(n){return void D.getLogger(this).error(new C("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:n}))}const i=this.viewpoint;Sh(i,i,e,this.state.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(t){this.ready?(this.state.padding=t,this._set("padding",this.state.padding)):this._set("padding",t)}get resolution(){return this.ready?(this.state.commitProperty("id"),this.state.resolution):0}get rotation(){return this.ready?(this.state.commitProperty("id"),this.state.rotation):this._get("rotation")}set rotation(t){if(isNaN(t))return;if(!this.ready)return void this._set("rotation",t);const e=this.viewpoint;Ah(e,e,t),this.viewpoint=e}get scale(){return this.ready?(this.state.commitProperty("id"),this.state.scale):this._get("scale")}set scale(t){if(!t||isNaN(t))return;if(!this.ready){this._set("scale",t),this._set("zoom",void 0);const i=this._get("extent");return void(i&&(this._set("extent",void 0),this._set("center",i.center)))}const e=this.viewpoint;ms(e,e,t),this.viewpoint=e}get viewpoint(){return this.ready?this.state.paddedViewState.viewpoint.clone():this._get("viewpoint")}set viewpoint(t){if(t==null)return;if(!this.ready)return this._set("viewpoint",t),this._set("extent",void 0),this._set("center",void 0),this._set("zoom",void 0),void this._set("scale",void 0);let e,i;try{e=this._project(t,this.state.spatialReference),!t.scale||isNaN(t.scale)?i=new C("mapview:invalid-viewpoint",`invalid scale value of ${t.scale}`):t.targetGeometry==null&&(i=new C("mapview:invalid-viewpoint","geometry not defined"))}catch(s){i=new C("mapview:invalid-viewpoint","could not project the value in the view's spatial reference",{error:s})}if(i)return void D.getLogger(this).error(i);this._scaleBeforeChangingSpatialReference=null;const n=new nt({targetGeometry:new V,scale:0,rotation:0});G(n,e),this.constraints?.constrain(n,this.state.paddedViewState.viewpoint),this.state.viewpoint=n,this._set("viewpoint",n)}get visibleArea(){return this.ready?this.state.visibleArea:null}get zoom(){return this.ready?this.constraints?.scaleToZoom(this.scale)??-1:this._get("zoom")}set zoom(t){if(!(t>=0))return;if(!this.ready){this._set("zoom",t),this._set("scale",void 0);const n=this._get("extent");return void(n&&(this._set("extent",void 0),this._set("center",n.center)))}const e=this.constraints?.zoomToScale(t)??0;if(!e)return void this._set("zoom",-1);const i=this.viewpoint;ms(i,i,e),this.viewpoint=i,this._set("zoom",this.constraints?.scaleToZoom(this.scale)??-1)}getUserStartupOptions(t){if(!t[0]&&!t[1])return{center:void 0,rotation:void 0,scale:void 0};const{padding:e,constraints:i}=this,n=this._get("center"),s=this._get("extent"),o=this._get("scale"),a=this._get("rotation"),h=this._get("viewpoint"),c=this._get("zoom"),p=c!=null&&i!=null&&i.zoomToScale(c)||void 0;let d,m,u;const g=h?.rotation,f=h?.targetGeometry;f?.type==="extent"?d=f:f?.type==="point"&&(m=f,u=h?.scale);const T=s??d;return{center:n??m??T?.center,rotation:a??g,scale:(o??p??u??(T&&fi(T,[t[0]-e.left-e.right,t[1]-e.top-e.bottom])))||void 0}}startup(t,e,i,n){const s=t.targetGeometry;try{this._project(t,i)}catch(o){D.getLogger(this).warn(new zn("mapview:startup-projection-error","projection of initial viewpoint to the view's spatial reference, defaulting to the initial viewpoint.",{center:s.toJSON(),spatialReference:i,error:o})),t.targetGeometry=n||new V({x:0,y:0,spatialReference:i})}this.constraints?.fit(t),this._set("state",new En({padding:this.padding,size:e,viewpoint:t})),this._set("ready",!0)}teardown(){this._set("ready",!1);const{center:[t,e],spatialReference:i,rotation:n,scale:s}=this.state.paddedViewState,o=new V({x:t,y:e,spatialReference:i});this._set("viewpoint",null),this._set("extent",null),this._set("center",o),this._set("zoom",-1),this._set("rotation",n),this._set("scale",s),this._set("state",null)}changeSpatialReference(t){const e=this.state.paddedViewState.clone();if(this._scaleBeforeChangingSpatialReference==null)this._scaleBeforeChangingSpatialReference=e.scale;else{const h=e.viewpoint.clone();h.scale=this._scaleBeforeChangingSpatialReference,e.viewpoint=h}const i=e.clone(),[n,s]=e.center;let o=null;try{o=this._project(new V({x:n,y:s,spatialReference:e.spatialReference}),t)}catch(h){Xa()||D.getLogger(this).warn(new zn("mapview:spatial-reference-change","could not project the view's center to the new spatial reference",{center:o?.toJSON(),spatialReference:t,error:h}))}o||(o=new V({x:0,y:0,spatialReference:t}));const a=Ji(new nt({targetGeometry:new V,scale:0,rotation:0}),e.viewpoint,o);i.viewpoint=a;try{const h=[e.size[0]/2,e.size[1]/2],c=[h[0]+20,h[1]],p=e.toMap([0,0],c),{x:d,y:m}=this._project(new V({x:p[0],y:p[1],spatialReference:e.spatialReference}),t);p[0]=d,p[1]=m,i.toScreen(p,p);const u=Lh(h,p,c),g=Math.hypot(p[0]-h[0],p[1]-h[1])/20;!Number.isFinite(g)||Math.abs(g)>4?(a.rotation=0,a.targetGeometry=new V({x:0,y:0,spatialReference:t})):(a.scale*=g,a.scale>z("mapview-srswitch-adjust-rotation-scale-threshold")?a.rotation=0:a.rotation+=Number.isFinite(u)?u:0)}catch{}this._get("constraints")?.constrain(a,void 0),this._get("state").viewpoint=a}resize(t,e){if(!this.ready)return;const i=this.state;let n=this.state.paddedViewState.viewpoint;const s=this.state.paddedViewState.size.slice();i.size=[t,e],Oh(n,n,s,this.state.paddedViewState.size,this.resizeAlign),n=this.constraints?.constrain(n,void 0)??n,this.state.viewpoint=n}toMap(t){if(!this.ready)return null;const e=[0,0],[i,n]=this.state.toMap(e,[t.x,t.y]),s=this.state.spatialReference;return new V({x:i,y:n,spatialReference:s})}toScreen(t,e){if(!this.ready)return null;const i=this._project(t,this.state.spatialReference),n=[i.x,i.y];return e?.pickClosestTarget===!1||this.state.paddedViewState.wrapMapCoordinate(n,n),this.state.toScreen(n,n),H(n[0],n[1])}_project(t,e){const i=t?.targetGeometry||t;if(!e)return t;if(!i)return null;if(e.imageCoordinateSystem||i.spatialReference?.imageCoordinateSystem||pi(e,i.spatialReference))return t;const n=Le(i,e);if(!n)throw new C("mapview:projection-not-possible","projecting input geometry to target spatial reference returned a null value",{geometry:i,spatialReference:e});return Ec(t)?(t.targetGeometry=n,t):n}};function Ec(t){return t?.declaredClass==="esri.Viewpoint"}r([l({type:V})],Z.prototype,"center",null),r([l()],Z.prototype,"constraints",void 0),r([l({type:Xt})],Z.prototype,"extent",null),r([l({value:{top:0,right:0,bottom:0,left:0},cast:t=>({top:0,right:0,bottom:0,left:0,...t})})],Z.prototype,"padding",null),r([l()],Z.prototype,"ready",void 0),r([l()],Z.prototype,"resizeAlign",void 0),r([l({readOnly:!0})],Z.prototype,"resolution",null),r([l({type:Number})],Z.prototype,"rotation",null),r([l({type:Number})],Z.prototype,"scale",null),r([l({readOnly:!0})],Z.prototype,"state",void 0),r([l({type:nt})],Z.prototype,"viewpoint",null),r([l({readOnly:!0})],Z.prototype,"visibleArea",null),r([l()],Z.prototype,"zoom",null),Z=r([_("esri.views.2d.ViewStateManager")],Z);function Cn(t,e){switch(e){case"primary":return t.pointerType==="touch"||t.button===0;case"secondary":return t.pointerType!=="touch"&&t.button===2;case"tertiary":return t.pointerType!=="touch"&&t.button===1}}let bs=class extends A{constructor(t,e){super(!0),this._view=t,this.registerIncoming("double-click",e,i=>this._handleDoubleClick(i,e))}_handleDoubleClick(t,e){Cn(t.data,"primary")&&(t.stopPropagation(),e?this._view.mapViewNavigation.zoomOut([t.data.x,t.data.y]):this._view.mapViewNavigation.zoomIn([t.data.x,t.data.y]))}},Cc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerType=e,this.registerIncoming("double-tap-drag",i,n=>this._handleDoubleTapDrag(n))}_handleDoubleTapDrag(t){const{data:e}=t,{pointerType:i}=e;if(i!==this.pointerType)return;t.stopPropagation();const{action:n,delta:s}=e,{view:o}=this,{mapViewNavigation:a}=o;switch(n){case"begin":{const{scale:h}=o;this._startScale=h,this._currentScale=h,this._previousDelta=s,a.begin();break}case"update":{if(this._previousDelta.y===s.y)return;this._previousDelta=s;const h=1.015**s.y,c=this._startScale*h,p=c/this._currentScale;a.setViewpointImmediate(p),this._currentScale=c;break}case"end":{const{constraints:h}=o,{effectiveLODs:c,snapToZoom:p}=h;if(!p||!c)return void a.end();const d=h.snapScale(this._currentScale),m=(s.y>0?Math.max(d,h.snapToPreviousScale(this._startScale)):Math.min(d,h.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(m).then(()=>{a.end()});break}}}},wi=class{constructor(t){this._callbacks=t,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(t){const e=t.data,i=e.pointers.size;switch(e.action){case"start":this._currentCount=i,this._emitStart(t);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"update":this._emitUpdate(t);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=i,this._emitStart(t);break;case"end":this._emitEnd(t),this._currentCount=0}this._previousEvent=t}_emitStart(t){this._startEvent=t,this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.start(this._currentCount,t,this._startEvent)}_emitUpdate(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.update(this._currentCount,t,this._startEvent)}_emitEnd(t){this._callbacks.condition?.(this._currentCount,t)&&this._callbacks.end(this._currentCount,t,this._startEvent),this._startEvent=null}},Ic=class extends A{constructor(t,e,i){super(!0),this.view=t,this.pointerAction=e,this.registerIncoming("drag",i,n=>this._handleDrag(n)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(t){super.onInstall(t),this._dragEventSeparator=new wi({start:(e,i)=>{this.view.mapViewNavigation.pan.begin(this.view,i.data),i.stopPropagation()},update:(e,i)=>{this.view.mapViewNavigation.pan.update(this.view,i.data),i.stopPropagation()},end:(e,i)=>{this.view.mapViewNavigation.pan.end(this.view,i.data),i.stopPropagation()},condition:(e,i)=>e===1&&Cn(i.data,this.pointerAction)})}_handleDrag(t){const e=this.view.mapViewNavigation;e.pinch.zoomMomentum||e.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}},Dc=class extends A{constructor(t,e,i){super(!0),this._view=t,this.pointerAction=e;const n=this._view.mapViewNavigation;this._dragEventSeparator=new wi({start:(s,o)=>{n.rotate.begin(this._view,o.data),o.stopPropagation()},update:(s,o)=>{n.rotate.update(this._view,o.data),o.stopPropagation()},end:(s,o)=>{n.rotate.end(),o.stopPropagation()},condition:(s,o)=>s===1&&Cn(o.data,this.pointerAction)}),this.registerIncoming("drag",i,s=>this._dragEventSeparator.handle(s))}};function et(t){let e=t*t;return t<0&&(e*=-1),e}function Rc(t){return t.translation[0]=0,t.translation[1]=0,t.translation[2]=0,t.heading=0,t.tilt=0,t}function Lc(t,e,i){const n=i,s=t.state,o=t.device,a=e.tiltDirection==="forward-down"?1:-1,h=1;return o.deviceType==="standard"?(n.translation[0]=et(s.axes[0]),n.translation[1]=et(s.axes[1]),n.translation[2]=et(s.buttons[7])-et(s.buttons[6]),n.heading=et(s.axes[2]),n.tilt=et(s.axes[3])):o.deviceType==="spacemouse"&&(n.translation[0]=1.2*et(s.axes[0]),n.translation[1]=1.2*et(s.axes[1]),n.translation[2]=2*-et(s.axes[2]),n.heading=1.2*et(s.axes[5]),n.tilt=1.2*et(s.axes[3])),n.tilt*=a,Yr(n.translation,n.translation,h),n}function Vc(t){return t.translation[0]===0&&t.translation[1]===0&&t.translation[2]===0&&t.heading===0&&t.tilt===0&&t.zoom===0}let Oc=class extends A{constructor(t){super(!0),this._view=t,this._frameTask=null,this._watchHandles=new qs,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",e=>this._handleGamePadEvent(e)),this._handle.pause()}onInstall(t){super.onInstall(t),this._watchHandles.add([w(()=>this._view.navigation.gamepad?.enabled,e=>{e?(this._handle.resume(),this._frameTask||(this._frameTask=de({update:i=>this._frameUpdate(i.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},U)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(t){const e=this._view.navigation.gamepad.device;e&&t.data.device!==e||this._currentDevice&&this._currentDevice!==t.data.device||(t.data.action==="end"?(this._currentDevice=null,Rc(this._transformation)):(this._currentDevice=t.data.device,Lc(t.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(t){const e=this._transformation;if(Vc(e))return;const i=this._view.viewpoint.clone(),n=this._view.navigation.gamepad.velocityFactor,s=zc*n*t;vi(i,i,[e.translation[0]*s,-e.translation[1]*s]);const o=1+e.translation[2]*Nc*t,a=this._view.constraints.rotationEnabled?-e.heading*Ac*t:0,h=this._view.size,c=[h[0]/2,h[1]];Vo(i,i,o,a,c,h);const p=this._view.constraints.constrain(i,this._view.viewpoint);this._view.viewpoint=p}};const Ac=.06,zc=.7,Nc=6e-4;function $o(t){const e=()=>t(document.visibilityState==="visible");return document.addEventListener("visibilitychange",e),di(()=>document.removeEventListener("visibilitychange",e))}let Fc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._isSticky=!1,this._pressedKeys=new Set,this._timeout=void 0,this._currentDirection=void 0,this._stickyKeyDuration=200,this._handleKey=n=>{const s=this._keyMap[n.data.key];if(n.modifiers.has("Meta")||n.modifiers.has("Control"))return void this._stopMovement();if(s==null)return;n.stopPropagation(),n.preventDefault();const o=n.type==="key-down";if(this._pressedKeys[o?"add":"delete"](s),o){if(this._direction===s)return;this._direction=s,this._isSticky=!1,this._setTimeout(()=>{this._isSticky&&this._handlePopKey()})}else{const a=this._timeout===void 0,h=this._pressedKeys.size>0;a||h?this._handlePopKey():this._isSticky=!0}},this._handlePopKey=()=>{this._direction=Array.from(this._pressedKeys).pop(),this._direction==null&&this._stopMovement()},this._stopMovement=()=>{this._isSticky=!1,this._direction=void 0,this._pressedKeys.clear(),this._setTimeout(void 0)},this._keyMap={[e.left]:"left",[e.right]:"right",[e.up]:"up",[e.down]:"down"},this.registerIncoming("key-down",i,this._handleKey),this.registerIncoming("key-up",i,this._handleKey),this.registerIncoming("blur",i,this._stopMovement),this._visibilityHandle=$o(n=>n?null:this._stopMovement())}onUninstall(){this._stopMovement(),this._visibilityHandle?.remove()}get _direction(){return this._currentDirection}set _direction(t){const e=this._currentDirection!=null;if(t!=null){if(e||this.view.mapViewNavigation.begin(),this._currentDirection!==t)switch(t){case"left":this.view.mapViewNavigation.continuousPanLeft();break;case"right":this.view.mapViewNavigation.continuousPanRight();break;case"up":this.view.mapViewNavigation.continuousPanUp();break;case"down":this.view.mapViewNavigation.continuousPanDown()}}else e&&this.view.mapViewNavigation.stop();this._currentDirection=t}_setTimeout(t){clearTimeout(this._timeout),this._timeout=t===void 0?void 0:setTimeout(()=>{this._timeout=void 0,t()},this._stickyKeyDuration)}},Hc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._pressed=!1,this._keyToDirection={[e.clockwiseOption1]:"clockwise",[e.clockwiseOption2]:"clockwise",[e.counterClockwiseOption1]:"counterClockwise",[e.counterClockwiseOption2]:"counterClockwise",[e.resetOption1]:"reset",[e.resetOption2]:"reset"},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),this.registerIncoming("key-up",i,n=>this._handleKeyUp(n)),this.registerIncoming("blur",i,()=>this._handleStop()),this._visibilityHandle=$o(n=>n?null:this._handleStop())}onUninstall(){this._visibilityHandle?.remove(),this._handleStop()}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleStop(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,e){const i=t.modifiers;if(i.size>0&&!i.has("Shift")||!this.view.constraints.rotationEnabled)return;const n=this._keyToDirection[t.data.key];if(this._pressed=n!=null,this._pressed){if(t.preventDefault(),e)switch(this.view.mapViewNavigation.begin(),n){case"clockwise":this.view.mapViewNavigation.continuousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continuousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}};var ce;(function(t){t[t.IN=0]="IN",t[t.OUT=1]="OUT"})(ce||(ce={}));let Zc=class extends A{constructor(t,e,i){super(!0),this.view=t,this.keys=e,this._keysToZoomAction={},this.registerIncoming("key-down",i,n=>this._handleKeyDown(n)),e.zoomIn.forEach(n=>this._keysToZoomAction[n]=ce.IN),e.zoomOut.forEach(n=>this._keysToZoomAction[n]=ce.OUT)}_handleKeyDown(t){this._handleKey(t)}_handleKey(t){const e=t.modifiers;if(e.size>0&&!e.has("Shift"))return;const{key:i}=t.data;if(!(i in this._keysToZoomAction))return;const n=this._keysToZoomAction[i],{mapViewNavigation:s}=this.view;let o=null;switch(n){case ce.IN:o=s.zoomIn();break;case ce.OUT:o=s.zoomOut();break;default:return}s.begin(),o.then(()=>s.end()),t.stopPropagation()}};const Gc=.6;let $c=class extends A{constructor(t,e){super(!0),this._view=t,this._canZoom=!0,this.registerIncoming("mouse-wheel",e,i=>this._handleMouseWheel(i))}_handleMouseWheel(t){if(!this._view.navigation.mouseWheelZoomEnabled||(t.preventDefault(),t.stopPropagation(),!this._canZoom))return;const e=this._view.mapViewNavigation,{x:i,y:n,deltaY:s}=t.data,o=1/Gc**(1/60*s),a=e.zoom(o,[i,n]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,e.end()}))}},Wc=class extends A{constructor(t){super(!0),this.view=t,this.registerIncoming("drag",i=>this._handleDrag(i)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const e=this.view.mapViewNavigation;this._dragEventSeparator=new wi({start:(i,n)=>{e.pinch.begin(this.view,n.data),n.stopPropagation()},update:(i,n)=>{e.pinch.update(this.view,n.data),n.stopPropagation()},end:(i,n)=>{e.pinch.end(this.view),n.stopPropagation()},condition:i=>i>=2})}_handleDrag(t){this._dragEventSeparator.handle(t)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}};function Ts(t){const e=t.native;return e?{buttons:e.buttons.map(i=>i.pressed?i.value||1:0),axes:e.axes.map(i=>qc(i,t.axisThreshold))}:{buttons:[],axes:[]}}function Uc(t,e){if(t.axes.length!==e.axes.length||t.buttons.length!==e.buttons.length)return!1;for(let i=0;i{this._connectGamepad(s.gamepad)},this._onDisconnectGamepad=s=>{const o=s.gamepad,a=o.index,h=this._inputDevices[a];h&&(this._emitGamepadEvent(o,Ts(h),!1),this._inputDevices.splice(a,1),this._latestUpdate.splice(a,1),this._input.gamepad.devices.remove(h),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const i="getGamepads"in window.navigator,n=window.isSecureContext;this.supported=i&&n,this.supported&&(Ms(s=>this._connectGamepad(s)),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 e=new Mn(t);e.deviceType!=="unknown"&&(this._inputDevices[t.index]=e,this._input.gamepad.devices.add(e)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=de({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const t=document.hasFocus(),e=this._element.contains(document.activeElement),i=this._input.gamepad.enabledFocusMode==="document"&&!t||this._input.gamepad.enabledFocusMode==="view"&&!e;Ms(n=>{const s=this._inputDevices[n.index];if(!s)return;const o=this._latestUpdate[n.index],a=Ts(s),h=i||jc(a);o&&(o.timestamp===n.timestamp||!o.active&&h||Uc(o.state,a))||this._emitGamepadEvent(n,a,!h)})}_emitGamepadEvent(t,e,i){const n=this._latestUpdate[t.index],s=n&&n.active;if(!s&&!i)return;const o=!s&&i?"start":s&&i?"update":"end";this._latestUpdate[t.index]={timestamp:t.timestamp,state:e,active:i},this._callback&&this._callback({device:this._inputDevices[t.index],state:e,action:o})}};function Kc(t){if(!t||!t.connected)return!1;for(let e=0;e{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),this._gamepadSource=new Bc(e,this._input),this._gamepadSource.onEvent=n=>this._callback("gamepad",n)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>{this._releasePointerCaptureSafe(e)}),this._gamepadSource=tt(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const i in this._active)if(!e||!e.has(i)){const n=this._active[i];this._element.removeEventListener(zi[i],n),delete this._active[i]}e&&e.forEach(i=>{if(!this._active[i]&&zi[i]){const n=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(zi[i],n),this._active[i]=n}}),this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1}setPointerCapture(e,i){i?this._setPointerCatpureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?ee.touchNone:ee.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?ee.touchPan:ee.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(ee.touchNone),this._element.classList.remove(ee.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCatpureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch{}}_updateNormalizedPointerLikeEvent(e,i){const n=_o(this._element,e);return Uo.test.disableSubpixelCoordinates&&(n.x=Math.round(n.x),n.y=Math.round(n.y)),i.x=n.x,i.y=n.y,i}_handleKey(e,i){const{key:n}=i;n&&e==="key-up"&&this._keyDownState.delete(n);const s={native:i,key:n,repeat:!!n&&this._keyDownState.has(n)};n&&e==="key-down"&&this._keyDownState.add(s.key),this._callback(e,s)}_handlePointer(e,i){const n=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(e,n)}_handlePointerPreventDefault(e,i){const n=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(e,n)}_getDeltaFromTrackpadOrMouseWheel(e){return e.shiftKey&&z("mac")&&e.deltaY===0?e.deltaX:e.deltaY}_handleMouseWheel(e,i){let n=this._getDeltaFromTrackpadOrMouseWheel(i);switch(i.deltaMode){case 0:xs&&(n=n/document.documentElement.clientHeight*600);break;case 1:n*=30;break;case 2:n*=900}xs?n*=.7:Yc||Qc?n*=.6:Xc&&(n*=1.375);const s=100,o=Math.abs(n);o>s&&(n=n/o*200/(1+Math.exp(-.02*(o-s))));const a=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,deltaY:n});this._callback(e,a)}_handlePointerCaptureLost(e,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(e,i)}_handleDefault(e,i){const n={native:i};i.preventDefault(),this._callback(e,n)}_preventAltKeyDefault(e){e.key==="Alt"&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}};Wo.test={disableSubpixelCoordinates:!1};const zi={"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"};let Jc=class extends A{constructor(){super(!0),this.registerIncoming("context-menu",t=>t.data.native.preventDefault())}};const F={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500,maximumDoubleClickDelay:250,maximumDoubleClickDistance:10,maximumDoubleTouchDelay:350,maximumDoubleTouchDistance:35};function ri(t,e){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)}function tp(t,e){const i=e.x-t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)}function ep(t,e){if(e?(e.radius=0,e.center.x=0,e.center.y=0):e={radius:0,center:H()},t.length===0)return e;if(t.length===1)return e.center.x=t[0].x,e.center.y=t[0].y,e;if(t.length===2){const[S,x]=t,[$,K]=[x.x-S.x,x.y-S.y];return e.radius=Math.sqrt($*$+K*K)/2,e.center.x=(S.x+x.x)/2,e.center.y=(S.y+x.y)/2,e}let i=0,n=0;for(let S=0;SS.x-i),o=t.map(S=>S.y-n);let a=0,h=0,c=0,p=0,d=0,m=0,u=0;for(let S=0;Sthis._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=st(t.doubleTapTimeout)})}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleTapTimeout!=null)return!0;return!1}_clearPointerDown(t){const e=this._pointerState.get(t);e&&(e.doubleTapTimeout=st(e.doubleTapTimeout),this._pointerState.delete(t),this.refreshHasPendingInputs())}_dragStart(t,e){if(!this._doubleTapDragReady||t!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:i,modifiers:n}=e,{center:s}=i;this._dragStartCenter=s;const o=Ni("begin",H(0,0),i);this._doubleTapDrag.emit(o,void 0,n),e.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("update",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:e,modifiers:i}=t,{center:n}=e,s=Ni("end",H(n.x-this._dragStartCenter.x,n.y-this._dragStartCenter.y),e);this._doubleTapDrag.emit(s,void 0,i),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:e}=t,i=Kt(e),n=this._pointerState.get(i),{pointerType:s}=e.native;if(n){const o=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(i),ri(n.event.data,e)>o?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:e}=t,{pointerType:i}=e.native,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._clearPointerDown(n),s);this._pointerState.set(n,{event:t,doubleTapTimeout:o}),this.refreshHasPendingInputs()}};function Ni(t,e,i){const{button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}=i;return{action:t,delta:e,button:n,buttons:s,pointer:o,pointers:a,pointerType:h,timestamp:c}}let np=class extends A{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,e,i,n){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:e.buttons,timestamp:n,pointers:sp(this._activePointerMap),pointer:e,angle:i.angle,radius:i.radius,center:i.center}}_addPointer(t){const e=t.native.pointerId,i=$e(this._activePointerMap).angle,n={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(e,n);const s=Qe(n,jo(this._activePointerMap));n.initialAngle=s,n.lastAngle=s,this._updatePointerAngles(i)}_updatePointer(t){if(t&&t.x==null&&t.y==null)return;const e=t.native.pointerId,i=this._activePointerMap.get(e);i?i.event=t:this._addPointer(t)}_removePointer(t){const e=$e(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(e)}_updatePointerAngles(t){const e=$e(this._activePointerMap);this._activePointerMap.forEach(i=>{i.initialAngle=Qe(i,e)-t,i.lastAngle=Qe(i,e)-t})}_emitEvent(t,e,i){const n=$e(this._activePointerMap);this._drag.emit(this._createPayload(t,e,n,i),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const e=t.data.native.pointerId,i=it(t.timestamp);this._activePointerMap.get(e)&&(this._activePointerMap.size===1?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",t.data,i),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(e)):(this._removePointer(e),this._emitEvent("removed",t.data,it(t.timestamp))))}_handlePointerDrag(t){const e=t.data,i=e.currentEvent,n=it(t.timestamp);switch(e.action){case"start":case"update":this._isDragging?this._activePointerMap.has(i.native.pointerId)?(this._updatePointer(i),!this._isCurrentDragSuppressed&&this._emitEvent("update",i,n)):(this._addPointer(i),this._emitEvent("added",i,n),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(i),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",i,n))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}};function jo(t){const e=[];return t.forEach(i=>{e.push(H(i.event.x,i.event.y))}),ep(e)}function $e(t){const e=jo(t);let i=0;return t.forEach(n=>{let s=Qe(n,e),o=s-n.lastAngle;for(;o>Math.PI;)o-=2*Math.PI;for(;o<-Math.PI;)o+=2*Math.PI;s=n.lastAngle+o,n.lastAngle=s;const a=s-n.initialAngle;i+=a}),i/=t.size||1,{angle:i,radius:e.radius,center:e.center}}function sp(t){const e=new Map;return t.forEach((i,n)=>e.set(n,i.event)),e}function Qe(t,e){const i=t.event,n=i.x-e.center.x,s=i.y-e.center.y;return Math.atan2(s,n)}var Ss;(function(t){t[t.Left=0]="Left",t[t.Middle=1]="Middle",t[t.Right=2]="Right",t[t.Back=3]="Back",t[t.Forward=4]="Forward",t[t.Undefined=-1]="Undefined"})(Ss||(Ss={}));let op=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,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 e=t.data,i=Kt(e);if(!this._pointerState.has(i)){const n={downButton:e.native.button,x:e.x,y:e.y,immediateDoubleClick:null};this._pointerState.set(i,n),this.startCapturingPointer(e.native)}}_handlePointerUp(t){const e=t.data,i=Kt(e),n=this._pointerState.get(i);if(n&&n.downButton===e.native.button){const s=n.immediateDoubleClick,o=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;s?(s.timeoutHandle.remove(),ri(s,t.data)>o?this._startImmediateDoubleClick(t,n):(this._immediateDoubleClick.emit(t.data,void 0,s.modifiers),this._removeState(e))):ri(n,t.data)>o?this._removeState(e):this._startImmediateDoubleClick(t,n)}}_startImmediateDoubleClick(t,e){const i=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;e.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(t.data),i)}}_removeState(t){const e=Kt(t);this._pointerState.delete(e),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}},ap=class extends A{constructor(t=F.maximumClickDelay,e=F.movementUntilMouseDrag,i=F.movementUntilPenDrag,n=F.movementUntilTouchDrag,s=F.holdDelay,o=Re){super(!1),this._maximumClickDelay=t,this._movementUntilMouseDrag=e,this._movementUntilPenDrag=i,this._movementUntilTouchDrag=n,this._holdDelay=s,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",a=>this._handlePointerDown(a)),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",a=>this._handlePointerMove(a)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(t=>{t.holdTimeout=st(t.holdTimeout)}),super.onUninstall()}_handlePointerDown(t){const e=t.data,i=e.native.pointerId;let n=null;this._pointerState.size===0&&(n=this._clock.setTimeout(()=>{const o=this._pointerState.get(i);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 s={startEvent:e,previousEvent:e,startTimestamp:t.timestamp,isDragging:!1,downButton:e.native.button,holdTimeout:n,modifiers:new Set};this._pointerState.set(i,s),this.startCapturingPointer(e.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_handlePointerMove(t){const e=t.data,i=e.native.pointerId,n=this._pointerState.get(i);n&&(n.isDragging?this._pointerDrag.emit(We("update",n,e),void 0,n.modifiers):tp(e,n.startEvent)>this._getDragThreshold(e.native.pointerType)&&this._startDragging(t),n.previousEvent=e)}_getDragThreshold(t){switch(t){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const e=t.data,i=e.native.pointerId;this._pointerState.forEach(n=>{n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging||(n.modifiers=t.modifiers,n.isDragging=!0,i===n.startEvent.native.pointerId?this._pointerDrag.emit(We("start",n,e)):this._pointerDrag.emit(We("start",n,n.previousEvent),t.timestamp))})}_handlePointerLoss(t,e){const i=t.data,n=i.native.pointerId,s=this._pointerState.get(n);s&&(s.holdTimeout!=null&&(s.holdTimeout.remove(),s.holdTimeout=null),s.isDragging?this._pointerDrag.emit(We("end",s,e==="pointer-up"?i:s.previousEvent),void 0,s.modifiers):e==="pointer-up"&&s.downButton===i.native.button&&t.timestamp-s.startTimestamp<=this._maximumClickDelay&&!s.holdEmitted&&this._immediateClick.emit(i),this._pointerState.delete(n),this.stopCapturingPointer(i.native),this._pointerState.size===0&&this._moveHandle.pause())}};function We(t,e,i){return{action:t,startEvent:e.startEvent,previousEvent:e.previousEvent,currentEvent:i}}let rp=class extends A{constructor(t=F.maximumDoubleClickDelay,e=F.maximumDoubleClickDistance,i=F.maximumDoubleTouchDelay,n=F.maximumDoubleTouchDistance,s=Re){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=e,this._maximumDoubleTouchDelay=i,this._maximumDoubleTouchDistance=n,this._clock=s,this._pointerState=new Map,this._click=this.registerOutgoing("click"),this._doubleClick=this.registerOutgoing("double-click"),this.registerIncoming("immediate-click",o=>this._handleImmediateClick(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o))}onUninstall(){this._pointerState.forEach(t=>t.doubleClickTimer=st(t.doubleClickTimer))}get hasPendingInputs(){for(const t of this._pointerState.values())if(t.doubleClickTimer!=null)return!0;return!1}_clearDoubleClickTimer(t,e){const i=this._pointerState.get(t);i&&(i.doubleClickTimer=st(i.doubleClickTimer),e&&this._click.emit(i.event.data,void 0,i.event.modifiers),this._pointerState.delete(t),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(t){const e=this._pointerState.get(t);e.pointerDownCount===1&&this._click.emit(e.event.data,void 0,e.event.modifiers),e.doubleClickTimer=null,this._pointerState.delete(t),this.refreshHasPendingInputs()}_handleImmediateClick(t){const e=t.data,{pointerType:i}=e.native,n=lp(e);if(!this._pointerState.has(n))return void this._startClick(t);const s=this._pointerState.get(n),{data:o,modifiers:a}=s.event,h=i==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;ri(o,e)>h?(this._clearDoubleClickTimer(n,!0),this._startClick(t)):(this._clearDoubleClickTimer(n,!1),s.pointerDownCount===2&&this._doubleClick.emit(o,void 0,a))}_handlePointerDown(t){const e=Kt(t.data),i=this._pointerState.get(e);i&&(i.pointerDownCount+=1)}_startClick(t){const{data:e}=t,{native:{pointerType:i}}=e,n=Kt(e),s=i==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(n),s);this._pointerState.set(n,{event:t,doubleClickTimer:o,pointerDownCount:1}),this.refreshHasPendingInputs()}};function lp(t){const{pointerId:e,pointerType:i,button:n}=t.native;return i==="mouse"?`${e}:${n}`:`${i}`}const Ue={counter:"Control",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 Gt=class extends M{initialize(){const t=()=>this.view?.ready;this.addHandles([Ce(()=>!t(),()=>this._disconnect()),Ce(t,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=tt(this._inputManager)}_connect(){const t=this.view.surface,e=new Wo(t,this.view.input),i=[new op,new ap,new rp,new np(this.view.navigation),new ip],n=new Q({eventSource:e,recognizers:i});n.installHandlers("prevent-context-menu",[new Jc],At.INTERNAL),n.installHandlers("navigation",[new Wc(this.view),new Oc(this.view),new $c(this.view),new bs(this.view),new bs(this.view,[Ue.counter]),new Ic(this.view,"primary"),new Fc(this.view,Ue.pan),new Zc(this.view,Ue.zoom),new Hc(this.view,Ue.rotate),new Dc(this.view,"secondary"),new Cc(this.view,"touch")],At.INTERNAL),this.view.viewEvents.connect(n),this._source=e,this._inputManager=n,w(()=>this.view?.navigation?.browserTouchPanEnabled,s=>{this._source&&(this._source.browserTouchPanningEnabled=!s)},U)}get test(){}};r([l()],Gt.prototype,"view",void 0),r([l()],Gt.prototype,"latestPointerType",null),r([l()],Gt.prototype,"latestPointerLocation",null),r([l()],Gt.prototype,"multiTouchActive",null),Gt=r([_("esri.views.2d.input.MapViewInputManager")],Gt);const hp=Gt,Nt={added:[],removed:[]},Fi=new Set,cp=new Kr(0,0,0,0);function pp(t,e){const i=Bs(e);if(!i)return null;const[n,s]=i.valid;return t[2]>s?[Ne([t[0],t[1],s,t[3]]),Ne([n,t[1],n+t[2]-s,t[3]])]:t[0]({minX:e.bounds[0],minY:e.bounds[1],maxX:e.bounds[2],maxY:e.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=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)}getIntersectingTiles(t){if(!t||Qa(t)===0||Ja(t)===0)return[];const e=pp(t,this.tileScheme.spatialReference);return e!=null?[...new Set([...this.boundsIntersections(e[0]),...this.boundsIntersections(e[1])])]:this.boundsIntersections(t)}boundsIntersections(t){return this._index.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]})}updateTiles(t){const e={added:[],removed:[]};for(const i of t.added)if(!this.has(i)){const n=new Kn(this.tileScheme,i);this._tiles.set(i,n),this._index.insert(n),e.added.push(n)}for(const i of t.removed)if(this.has(i)){const n=this.get(i);this._tiles.delete(i),this._index.remove(n),e.removed.push(n)}this.tiles.length=0,this._tiles.forEach(i=>this.tiles.push(i)),(e.added.length||e.removed.length)&&this.emit("update",e)}setViewState(t){const e=this.tileScheme.getTileCoverage(t,0);if(!e)return;const{spans:i,lodInfo:n}=e,{level:s}=n;if(i.length>0)for(const{row:o,colFrom:a,colTo:h}of i)for(let c=a;c<=h;c++){const p=cp.set(s,o,n.normalizeCol(c),n.getWorldForColumn(c)).id;if(Fi.add(p),!this.has(p)){const d=new Kn(this.tileScheme,p);this._tiles.set(p,d),this._index.insert(d),this.tiles.push(d),Nt.added.push(d)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];Fi.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),Nt.removed.push(a))}(Nt.added.length||Nt.removed.length)&&this.emit("update",Nt),Fr.pool.release(e),Fi.clear(),Nt.added.length=0,Nt.removed.length=0}};const up=1,Su=[0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1],ku=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],_e=256,mp=new Pt("cyan"),gp=1,yp=.25;new Pt("black");const _p="default",fp="temporary",vp=new Pt("yellow");let $t=class extends M{constructor(t){super(t),this.color=mp.clone(),this.haloOpacity=gp,this.fillOpacity=yp}equals(t){return this.color.equals(t.color)&&(this.haloColor||this.color).equals(t.haloColor||t.color)&&this.haloOpacity===t.haloOpacity&&this.fillOpacity===t.fillOpacity}};r([l({type:Pt})],$t.prototype,"color",void 0),r([l({type:Pt})],$t.prototype,"haloColor",void 0),r([l()],$t.prototype,"haloOpacity",void 0),r([l()],$t.prototype,"fillOpacity",void 0),$t=r([_("esri.views.support.HighlightOptions")],$t);const wp=$t;var rn;let xe=rn=class extends wp{constructor(t){super(t),this.haloWidth=2.1,this.haloBlur=.8/this.haloWidth}equals(t){return super.equals(t)&&this.haloWidth===t.haloWidth&&this.haloBlur===t.haloBlur}get optionsKey(){return`${this.color};${this.haloColor};${this.haloOpacity};${this.fillOpacity};${this.haloWidth};${this.haloBlur}`}clone(){return new rn({color:this.color.clone(),haloColor:this.haloColor?.clone(),haloOpacity:this.haloOpacity,fillOpacity:this.fillOpacity,haloWidth:this.haloWidth,haloBlur:this.haloBlur})}};r([l()],xe.prototype,"haloWidth",void 0),r([l()],xe.prototype,"haloBlur",void 0),xe=rn=r([_("esri.views.2d.support.HighlightOptions")],xe);const Yt=xe,Hi=()=>D.getLogger("esri.views.2d.engine.webgl.painter.highlight.HighlightGradient");function bp(t,e){e.fillColor[0]=t.color.r/255,e.fillColor[1]=t.color.g/255,e.fillColor[2]=t.color.b/255,e.fillColor[3]=t.color.a,t.haloColor?(e.outlineColor[0]=t.haloColor.r/255,e.outlineColor[1]=t.haloColor.g/255,e.outlineColor[2]=t.haloColor.b/255,e.outlineColor[3]=t.haloColor.a):(e.outlineColor[0]=e.fillColor[0],e.outlineColor[1]=e.fillColor[1],e.outlineColor[2]=e.fillColor[2],e.outlineColor[3]=e.fillColor[3]),e.fillColor[3]*=t.fillOpacity,e.outlineColor[3]*=t.haloOpacity,e.fillColor[0]*=e.fillColor[3],e.fillColor[1]*=e.fillColor[3],e.fillColor[2]*=e.fillColor[3],e.outlineColor[0]*=e.outlineColor[3],e.outlineColor[1]*=e.outlineColor[3],e.outlineColor[2]*=e.outlineColor[3],e.outlineWidth=(1-t.haloBlur)*t.haloWidth,e.outerHaloWidth=t.haloBlur*t.haloWidth/2,e.innerHaloWidth=t.haloBlur*t.haloWidth/2,e.outlinePosition=0}const Tp=[0,0,0,0];let qo=class{constructor(){this.type="single",this._highlightOptions=new Yt,this._convertedHighlightOptions={fillColor:[0,0,0,0],outlineColor:[0,0,0,0],outlinePosition:0,outlineWidth:0,innerHaloWidth:0,outerHaloWidth:0},this._optionsShadeTexKey="",this._texelData=new Uint8Array(4*_e),this._minMaxDistance=[0,0]}setHighlightOptions(t){this._highlightOptions=t}applyHighlightOptions(t,e){this._updateGradientTexture(t),t.bindTexture(this._shadeTex,Xr),e.setUniform2fv("u_minMaxDistance",this._minMaxDistance)}destroy(){this._shadeTex?.dispose(),this._shadeTex=null}getReasonsWithGradients(){return[{activeReasons:(1<h?Math.round(10*(Math.abs(n)-h))/10:0,p=Math.abs(a)>h?Math.round(10*(Math.abs(a)-h))/10:0;let d;c&&!p?Hi().error("The outer rim of the highlight is "+c+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards positive values (inwards)."):!c&&p?Hi().error("The inner rim of the highlight is "+p+"px away from the edge of the feature; consider reducing some width values or shifting the outline position towards negative values (outwards)."):c&&p&&Hi().error("The highlight is "+Math.max(c,p)+"px away from the edge of the feature; consider reducing some width values.");const m=[void 0,void 0,void 0,void 0];function u(f,T,I){m[0]=(1-I)*f[0]+I*T[0],m[1]=(1-I)*f[1]+I*T[1],m[2]=(1-I)*f[2]+I*T[2],m[3]=(1-I)*f[3]+I*T[3]}const{_texelData:g}=this;for(let f=0;f<_e;++f)d=n+f/(_e-1)*(a-n),dt.stencilRef,compare:Jr.EQUAL,mask:255,op:{fail:Si.KEEP,zFail:Si.KEEP,zPass:Si.REPLACE}}}},xp={color:{write:[!0,!0,!0,!0],blendMode:"additive"},depth:!1,stencil:!1},Pp={...Bo,color:{write:[!0,!0,!0,!0],blendMode:"delete"}};function Sp({pixelRatio:t,state:e,displayLevel:i,requiredLevel:n},s){const o=1/2**(i-s.key.level),a=1/2**(n-s.key.level);return{displayMat3:e.displayMat3,displayViewMat3:e.displayViewMat3,displayViewScreenMat3:s.transforms.displayViewScreenMat3,viewMat3:e.viewMat3,tileMat3:s.transforms.tileMat3,displayZoomFactor:o,requiredZoomFactor:a,tileOffset:[s.x,s.y],currentScale:e.scale,currentZoom:i,metersPerSRUnit:Ys(e.spatialReference),rotation:e.rotation,pixelRatio:t}}function Ko(t){return t.passOptions?.type==="highlight"}function Yo(t){return t.passOptions?.type==="hittest"}function kp(t){if(!Yo(t))return null;const{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}=t.passOptions;return{position:e,distance:i,smallSymbolDistance:n,smallSymbolSizeThreshold:s}}function Ep(t){if(!Ko(t))return null;const{activeReasons:e,highlightAll:i}=t.passOptions;return{activeReasons:e,highlightAll:i?1:0}}function Eu(t,e,i){const n={};for(const s in i)i[s]instanceof Function?n[s]=i[s](t,e):n[s]=i[s];return n}function Cu(t,e){const{attributeView:i,context:n}=t;return{storage:i.getUniforms(n),view:Sp(t,e),hittestRequest:kp(t),highlight:Ep(t)}}function Iu(t){return{inside:t.selection===li.InsideEffect,outside:t.selection===li.OutsideEffect}}function Cp(t){return Yo(t)?xp:Ko(t)&&t.passOptions.stepType==="clear"?Pp:Bo}function Du(t){const{row:e,col:i}=t.key,n=i*Qn,s=e*Qn;return{tileOffsetFromLocalOrigin:[n%He,s%He],maxIntsToLocalOrigin:[Math.floor(n/He),Math.floor(s/He)]}}const Ip=new Fa({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function Ru(t){return Ip.toJSON(t)}function Lu(t){const{bandCount:e,attributeTable:i,colormap:n,pixelType:s}=t.raster.rasterInfo;return e===1&&(i!=null||n!=null||s==="u8"||s==="s8")}function Dp(t,e){return e==null?(t?.destroy(),null):(t?.type==="single"&&Array.isArray(e)&&(t.destroy(),t=null),t?.type!=="multi"||Array.isArray(e)||(t.destroy(),t=null),t||(t=Array.isArray(e)?new Mp:new qo),Array.isArray(e)?t.type==="multi"&&t.setHighlightOptions(e):t.type==="single"&&t.setHighlightOptions(e),t)}function Vu(t,e,i,n){const{painter:s,highlightGradient:o}=t,{highlight:a}=s.effects;if(!o)return;const h=t.passOptions,c=o.getReasonsWithGradients();for(let p=0;pparseFloat(t)/100;function Rp(t,e,i){const n=typeof t.left=="string"?je(t.left)*e:t.left,s=typeof t.right=="string"?je(t.right)*e:t.right,o=typeof t.top=="string"?je(t.top)*i:t.top,a=typeof t.bottom=="string"?je(t.bottom)*i:t.bottom,h=o;return{xmin:n,xmax:Math.max(e-s,n),ymin:h,ymax:Math.max(i-a,o)}}function Xo(t,e,i,n){switch(e.type){case"rect":{const{width:s,height:o}=t,{xmin:a,xmax:h,ymin:c,ymax:p}=Rp(e,s,o),{x:d,y:m}=i;return d>a&&dc&&mt.name);function Lp(t){if(!t.highlights)return null;const e=t.highlights.findIndex(i=>i.name==="default");return e===-1?null:t.highlights.items[e].options}function Vp(t,e){if(!t.highlights){if(!e)return;t.highlights=new Qo([{name:"default",options:new Yt}])}const i=t.highlights.findIndex(n=>n.name==="default");e?t.highlights.items[i].options=e:t.highlights.removeAt(i)}async function Op(t,e,i){const n=vo(e)?fo(t,e):e;if(!t.ready||isNaN(n.x)||isNaN(n.y))return{screenPoint:n,results:[]};let s=new Set;const o=new Set;let a=!1,h=null,c=null;i?.include?As(i.include,Os(t,u=>{s.add(u),Zi(u,g=>o.add(g))},(u,g)=>{o.add(u),s.add(g)},u=>{h||(h=new Set),h.add(u)},u=>s.add(u),()=>a=!0)):(a=!0,s=new Set(t.allLayerViews),s.forEach(u=>{Zi(u,g=>o.add(g))})),i?.exclude&&As(i.exclude,Os(t,u=>{s.delete(u),Zi(u,g=>o.delete(g))},u=>o.delete(u),u=>{c||(c=new Set),c.add(u)}));const p=t.toMap(n),d=t.allLayerViews.filter(u=>!u.suspended&&s.has(u)&&u.clips.every(g=>Xo(t,g,n,p))).reverse();let m=[...a?t.graphicsView.hitTest(p).map(u=>({type:"graphic",graphic:u,layer:null,mapPoint:p})):[],...await Promise.all(d.map(u=>u.hitTest(p,n)).toArray())].filter(ni).flat().filter(ni);return m=m.filter(u=>u.type!=="graphic"||u.layer?.type!=="subtype-group"||o.has(u.graphic.layer)),h&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||h?.has(hn(u.graphic)))),c&&(m=m.filter(u=>!("graphic"in u)||!u.graphic||!c?.has(hn(u.graphic)))),{screenPoint:n,results:m}}function Os(t,e,i,n,s,o){return a=>{if(a instanceof pr){if(a.layer===t)o?.();else{const h=t.allLayerViews.find(c=>c.layer===a.layer);h&&s?.(h)}n(hn(a))}else if(!("layer"in a&&"element"in a))if(a.type==="subtype-sublayer"){const h=t.allLayerViews.find(c=>c.layer===a.parent);h&&i(a,h)}else{const h=t.allLayerViews.find(c=>c.layer===a);h&&e(h)}}}function As(t,e){if(t)if(Nn(t))for(const i of t)if(Nn(i))for(const n of i)e(n);else e(i);else e(t)}function hn(t){const e=t.getObjectId();return e?`${t.layer?.uid??t.sourceLayer?.uid??"MapView"}/${e}`:`"MapView/${t.uid}`}function Zi({layer:t},e){t?.type==="subtype-group"&&t.sublayers.forEach(i=>{e(i)})}function ta(t,e,i){const{ctx:n,canvas:s}=ia(t,i),o=n.getImageData(0,0,t.width,t.height),a=sa(s,e);return na(s),{dataUrl:a,data:o}}function ea(t,e){const{ctx:i,canvas:n}=ia(t,e),s=i.getImageData(0,0,t.width,t.height);return na(n),s}function ia(t,e){const i=Ap();e.premultipliedAlpha&&Hp(t),i.width=t.width,i.height=t.height;const n=i.getContext("2d",{willReadFrequently:!0});return n.putImageData(t,0,0),e.flipY&&Fp(n),{ctx:n,canvas:i}}function na(t){t.width=0,t.height=0}function Ap(){return Gi==null&&(Gi=document.createElement("canvas")),Gi}let Gi=null;function sa(t,e){const i=Zp[e.format],n=e.quality/100;return t.toDataURL(i,n)}function oa(t,e){const i=Np(t),n=$p[i];return{format:i,quality:ke(e??n,0,100)}}function aa(t,e){return e/Math.max(t[0],t[1])}function zp(t,e,i,n=0,s=0,o=t.width-n,a=t.height-s,h=!1){const{data:c}=t,{width:p,height:d,data:m}=e,u=o/p,g=a/d,f=Math.ceil(u/2),T=Math.ceil(g/2),I=t.width;for(let E=0;E=1)continue;let St=2*Qt*Qt*Qt-3*Qt*Qt+1;const Jt=4*(n+Ae+(s+Oe)*I);Dn+=St*c[Jt+3],$+=St,!i&&c[Jt+3]<255&&(St=St*c[Jt+3]/255),K+=St*c[Jt],dt+=St*c[Jt+1],In+=St*c[Jt+2],x+=St}}m[S]=K/x,m[S+1]=dt/x,m[S+2]=In/x,m[S+3]=Dn/$}return e}function Np(t){switch(t){case"png":case"jpg":case"jpeg":return t;default:return Gp}}function Fp(t){t.save(),t.globalCompositeOperation="copy",t.scale(1,-1),t.translate(0,-t.canvas.height),t.drawImage(t.canvas,0,0),t.restore()}function Hp(t){const e=t.data,i=e.length;for(let n=0;n0){const o=255/s;e[n]=e[n]*o,e[n+1]=e[n+1]*o,e[n+2]=e[n+2]*o}}}const Zp={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},zs=98,Gp="png",$p={png:100,jpg:zs,jpeg:zs},Ou=Object.freeze(Object.defineProperty({__proto__:null,createEmptyImageData:nl,encode:ta,encodeData:ea,getFormatAndQuality:oa,getMaximumResolutionScale:aa,resampleHermite:zp,toDataUrl:sa},Symbol.toStringTag,{value:"Module"})),ra={flipY:!0,premultipliedAlpha:!0};async function Wp(t,e){const i=await la(t,e),{format:n,quality:s}=oa(e?.format,e?.quality);return ta(i,{format:n,quality:s},ra)}async function Up(t,e){const i=await la(t,e);return ea(i,ra)}function la(t,e){const i=Bp(e||{},qp(t.stage,t.size),t.size,t.padding),n=jp(e,t.allLayerViews);return t.stage.takeScreenshot(i,n,t.backgroundColor,e?.rotation)}function jp(t={},e){if(!t.layers)return;const i=[];return t.layers.forEach(n=>{const s=e.find(o=>o.layer.id===n.id);s?.container&&i.push(s.container)}),i}function qp(t,e){return Math.min(4,aa(e,Math.min(4096,t.context.parameters.maxTextureSize)))}function Bp(t,e,i,n){t.ignorePadding&&(n={left:0,right:0,top:0,bottom:0});let s=null;t.width!=null&&t.height!=null?s=[t.width,t.height]:t.width==null&&t.height!=null?s=[t.height,t.height]:t.width!=null&&t.height==null?s=[t.width,t.width]:t.width==null&&t.height==null&&(s=null);const o=i[0]-(n.left+n.right),a=i[1]-(n.top+n.bottom);let h,c,p=t.area||{x:0,y:0,width:o,height:a};if(s){const d=o/a,m=s[0]/s[1];if(m>d){const u=p.width/m;p={x:p.x,y:Math.round(p.y+(p.height-u)/2),width:p.width,height:Math.round(u)}}else{const u=p.height*m;p={x:Math.round(p.x+(p.width-u)/2),y:p.y,width:Math.round(u),height:p.height}}}else s=[p.width,p.height];return s[0]>p.width?(h=Math.min(s[0]/p.width,e),c=s[0]/p.width/h):(h=1,c=s[0]/p.width),{cropArea:{x:Math.round((p.x+n.left)*h),y:Math.round((p.y+n.top)*h),width:Math.round(p.width*h),height:Math.round(p.height*h)},outputScale:c,resolutionScale:h}}const Ns=160;let Pe=class extends M{constructor(){super(...arguments),this._timer=void 0}get stationary(){return!this._timer}flip(){this._timestamp=performance.now(),this._timer==null&&(this._timer=setInterval(()=>{performance.now()-this._timestamp>=Ns&&this.clear()},Ns))}clear(){this._timer&&(clearInterval(this._timer),this._timer=void 0)}};r([l()],Pe.prototype,"_timer",void 0),r([l()],Pe.prototype,"stationary",null),Pe=r([_("esri.views.2d.support.StationaryManager")],Pe);const Kp=t=>t.includes("Brush");let ha=class{constructor(){this._names=new Map}begin(t){this._names.has(t)||(this._names.set(t,!1),Kp(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 Yp(t){const e=sl();return e.available?t==="3d"&&e.majorPerformanceCaveat?new C("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."):e.supportsHighPrecisionFragment?e.supportsVertexShaderSamplers?null:new C("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported."):new C("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported."):new C("webgl:required","WebGL2 is required but not supported.",new Error().stack)}function Xp(t){return t&&"nodeType"in t}function Qp(t){return t&&typeof t.render=="function"}const Fs={component:"esri-component"};let Wt=class extends M{constructor(){super(...arguments),this.widget=null}destroy(){this.node=null,this.widget?.destroy()}get id(){return this._get("id")??this.widget?.id??this.node?.id}set id(t){this._set("id",t)}set node(t){const e=this._get("node");t!==e&&(t&&t.classList.add(Fs.component),e&&e.classList.remove(Fs.component),this._set("node",t))}castNode(t){return this.widget?.destroy(),t?typeof t=="string"||Xp(t)?(this._set("widget",null),so(t)):(Qp(t)&&!t.domNode&&(t.domNode=document.createElement("div")),this._set("widget",t),t.domNode):(this._set("widget",null),null)}};r([l()],Wt.prototype,"id",null),r([l()],Wt.prototype,"node",null),r([Bt("node")],Wt.prototype,"castNode",null),r([l({readOnly:!0})],Wt.prototype,"widget",void 0),Wt=r([_("esri.views.ui.Component")],Wt);const Je=Wt,Jp={left:0,top:0,bottom:0,right:0},ca={bottom:30,top:15,right:15,left:15},mt="esri-ui",j={ui:mt,corner:`${mt}-corner`,innerContainer:`${mt}-inner-container`,manualContainer:`${mt}-manual-container`,cornerContainer:`${mt}-corner-container`,topLeft:`${mt}-top-left`,topRight:`${mt}-top-right`,bottomLeft:`${mt}-bottom-left`,bottomRight:`${mt}-bottom-right`};function td(t){return t&&!t._started&&typeof t.postMixInProperties=="function"&&typeof t.buildRendering=="function"&&typeof t.postCreate=="function"&&typeof t.startup=="function"}function qe(t){return t===0?"0":`${t}px`}function $i(t){const e=typeof t=="object"&&t!==null&&Object.getPrototypeOf(t);return(e===null||e===Object.prototype)&&("component"in t||"index"in t||"position"in t)?t:null}function Wi(t,{top:e,bottom:i,left:n,right:s}){t.style.top=e,t.style.bottom=i,t.style.left=n,t.style.right=s}let ht=class extends hi.EventedAccessor{constructor(t){super(t),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentMap=new Map,this._removeWidgetHandleKey=Symbol("componentOnRemoveSymbol"),this._locale=Ha(),this.view=null,this._applyViewPadding=()=>{const e=this.container;e&&Wi(e,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const e=this._innerContainer;e&&Wi(e,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([w(()=>[this.view?.padding,this.container],this._applyViewPadding,U),w(()=>this.padding,this._applyUIPadding,U),w(()=>[this.container,this._locale],([t,e])=>{t&&t.setAttribute("lang",e)},U),Za(t=>{this._locale=t})])}destroy(){this.container=null;for(const t of this._components)t.destroy();this._components.length=0,this._componentMap.clear()}set container(t){const e=this._get("container");t!==e&&(t&&(t.classList.add(j.ui),vr(t),this._attachContainers(t)),e&&(e.classList.remove(j.ui),Wi(e,{top:"",bottom:"",left:"",right:""}),e.textContent=""),this._set("container",t))}get height(){const t=this.view?.height??0;if(t===0)return t;const e=this._getViewPadding(),{top:i,bottom:n}=e;return Math.max(t-i-n,0)}get padding(){return this._get("padding")}set padding(t){this._overrideIfSome("padding",t)}castPadding(t){return typeof t=="number"?{bottom:t,top:t,right:t,left:t}:{...ca,...t}}get width(){const t=this.view?.width??0;if(t===0)return t;const e=this._getViewPadding(),{left:i,right:n}=e;return Math.max(t-i-n,0)}add(t,e){let i,n,s;if(Array.isArray(t))return void t.forEach(a=>this.add(a,e));const o=$i(t);o&&({index:i,position:e,component:t,key:n}=o),e&&typeof e=="object"&&({index:i,key:n,position:e,internal:s}=e),!t||e&&!this._isValidPosition(e)||this._add(t,e,i,n,s)}remove(t,e){if(!t)return;if(Array.isArray(t))return t.map(n=>this.remove(n,e));const i=this._find(t);if(i){if(this._componentMap.has(i)&&this._componentMap.get(i)?.key!==e)return;const n=this._components.indexOf(i);return i.node.parentNode?.removeChild(i.node),this._componentMap.delete(i),i.widget?.removeHandlesReference(this._removeWidgetHandleKey),this._components.splice(n,1)[0]}}empty(t,e={removeInternal:!1}){if(Array.isArray(t)){for(const s of t)this.empty(s,e);return}const i=this._positionNameToContainerLookup[t??"manual"],n=Array.prototype.slice.call(i.children).map(s=>this._findByNode(s)).filter(s=>s==null?!1:!(this._componentMap.get(s)?.internal??!1)||e.removeInternal);for(const s of n)this.remove(s)}move(t,e){if(Array.isArray(t)&&t.forEach(o=>this.move(o,e)),!t)return;let i;const n=$i(t)||$i(e);if(n&&(i=n.index,e=n.position,t=n.component||t),e&&!this._isValidPosition(e))return;const s=this.remove(t);s&&this.add(s,{position:e,index:i})}find(t){if(!t)return null;const e=this._findById(t);return e&&(e.widget||e.node)}getComponents(t,e={includeInternal:!1}){return t?Array.isArray(t)?t.flatMap(i=>this._getComponentsAtPosition(i,e)):this._getComponentsAtPosition(t,e):this._components.filter(i=>e.includeInternal||!this._componentMap.get(i)?.internal).map(({widget:i,node:n})=>i??n)}getPosition(t){for(const e in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[e].contains(t))return e;return null}_add(t,e,i,n,s){t instanceof Je||(t=new Je({node:t}));const{widget:o}=t;o!=null&&o instanceof M&&o.addHandles(di(()=>{queueMicrotask(()=>this.remove(t))}),this._removeWidgetHandleKey),this._place({component:t,position:e,index:i}),this._components.push(t),this._componentMap.set(t,{key:n,internal:s})}_find(t){return t?t instanceof Je?this._findByComponent(t):typeof t=="string"?this._findById(t):this._findByNode(t.domNode||t):null}_getViewPadding(){return this.view?.padding??Jp}_attachContainers(t){t.appendChild(this._innerContainer),t.appendChild(this._manualContainer)}_initContainers(){const t=document.createElement("div");t.classList.add(j.innerContainer,j.cornerContainer);const e=document.createElement("div");e.classList.add(j.innerContainer,j.manualContainer);const i=document.createElement("div");i.classList.add(j.topLeft,j.corner),t.appendChild(i);const n=document.createElement("div");n.classList.add(j.topRight,j.corner),t.appendChild(n);const s=document.createElement("div");s.classList.add(j.bottomLeft,j.corner),t.appendChild(s);const o=document.createElement("div");o.classList.add(j.bottomRight,j.corner),t.appendChild(o),this._innerContainer=t,this._manualContainer=e;const a=wr();this._cornerNameToContainerLookup={"top-left":i,"top-right":n,"bottom-left":s,"bottom-right":o,"top-leading":a?n:i,"top-trailing":a?i:n,"bottom-leading":a?o:s,"bottom-trailing":a?s:o},this._positionNameToContainerLookup={manual:e,...this._cornerNameToContainerLookup}}_isValidPosition(t){return!!this._positionNameToContainerLookup[t]}_place(t){const e=t.position??"manual",{component:i,index:n}=t,s=this._positionNameToContainerLookup[e],o=n!=null&&n>-1;if(td(i.widget)&&i.widget.startup(),!o)return void s.appendChild(i.node);const a=Array.from(s.children);if(n===0){const{firstChild:c}=s;return void(c?c.parentNode?.insertBefore(i.node,c):s.appendChild(i.node))}if(n>=a.length)return void s.appendChild(i.node);const h=a[n];h.parentNode?.insertBefore(i.node,h)}_toPixelPosition(t){return{top:qe(t.top),left:qe(t.left),right:qe(t.right),bottom:qe(t.bottom)}}_findByComponent(t){return this._components.find(e=>e===t)??null}_findById(t){return this._components.find(({id:e})=>e===t)??null}_findByNode(t){return this._components.find(({node:e})=>e===t)??null}_getComponentsAtPosition(t,e){const i=this._positionNameToContainerLookup[t];return Array.prototype.slice.call(i.children).map(n=>this._findByNode(n)).filter(ni).filter(n=>e.includeInternal||!this._componentMap.get(n)?.internal).map(({widget:n,node:s})=>n??s)}};r([l()],ht.prototype,"_locale",void 0),r([l()],ht.prototype,"container",null),r([l()],ht.prototype,"height",null),r([l({value:ca})],ht.prototype,"padding",null),r([Bt("padding")],ht.prototype,"castPadding",null),r([l()],ht.prototype,"view",void 0),r([l()],ht.prototype,"width",null),ht=r([_("esri.views.ui.UI")],ht);const ed=ht,id=new Map;function nd(t){return id.get(t)}function Hs(t,e){return t&&"copyright"in t&&(!e||typeof t.originOf=="function"&&t.originOf("copyright")==="user")}function sd(t,e){return t.length!==e.length||t.some((i,n)=>i.text!==e[n].text)}function fe(t,e,i){!i||!e||t.find(n=>n.layerView===e&&n.text===i)||t.push({text:i,layerView:e})}function od(t){return t.type==="bing-maps"}const gt=[];let re=class extends M{constructor(t){super(t),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.removeHandles("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new L,this.view=null,this._allLayerViewsChange=e=>{this.removeHandles("suspension"),this.removeHandles("visible-geometry-changed");const i=this.view?.allLayerViews;i&&(this.addHandles(i.map(n=>w(()=>[n.suspended,n.layer?.attributionVisible],()=>this._updateAttributionItems())).toArray(),"suspension"),i.forEach(n=>{n.declaredClass==="esri.views.3d.layers.Tiles3DLayerView3D"&&this.addHandles(n.on("visible-geometry-changed",()=>this._updateAttributionItems()),"visible-geometry-changed")})),e?.removed&&e.removed.forEach(n=>{this._pendingAttributions.delete(n),this._fetchedAttributionData.delete(n)}),this._updateAttributionItems()},this.addHandles([ci(()=>this.view?.allLayerViews,"change",e=>this._allLayerViewsChange(e),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Ce(()=>this.view?.stationary===!0,()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.view?.ready?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const t=this.view,e=t?.allLayerViews;if(gt.length=0,!t||!e)return void this._clear();e.forEach(n=>{if(n.suspended||!n.layer?.attributionVisible)return;const s=n.layer;if(Hs(s,"user"))return void fe(gt,n,s.copyright);if(s.hasAttributionData){if(this._fetchedAttributionData.has(n)){const a=this._fetchedAttributionData.get(n);return void(a?fe(gt,n,this._getDynamicAttribution(a,t,s)):Hs(s)&&fe(gt,n,s.copyright))}return void this._fetchAttributionData(n)}const o="portalItem"in s?s.portalItem?.accessInformation:void 0;fe(gt,n,o||s.copyright)});const i=e.find(n=>n.layer?.type==="integrated-mesh-3dtiles");if(this.view&&i){const n=nd(this.view);if(n){const s=n.getAttributionText();for(let o=0;o{const d=p.id,m=!c.has(d)&&h&&p.extent&&mn(p.extent,h);return m&&c.add(d),m}).sort((p,d)=>d.score-p.score||p.objectId-d.objectId).map(p=>p.attribution).join(", "):""}};r([l({readOnly:!0,type:L})],re.prototype,"items",void 0),r([l({readOnly:!0})],re.prototype,"state",null),r([l()],re.prototype,"view",void 0),re=r([_("esri.widgets.Attribution.AttributionViewModel")],re);const pa=re,pt={anchor:"esri-widget__anchor",anchorDisabled:"esri-widget__anchor--disabled",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonHalf:"esri-button--half",buttonSecondary:"esri-button--secondary",buttonSmall:"esri-button--small",buttonTertiary:"esri-button--tertiary",buttonThird:"esri-button--third",disabled:"esri-disabled",empty:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",heading:"esri-widget__heading",hidden:"esri-hidden",input:"esri-input",interactive:"esri-interactive",loader:"esri-widget__loader",loaderAnimation:"esri-widget__loader-animation",loaderText:"esri-widget__loader-text",menu:"esri-menu",menuHeader:"esri-menu__header",menuItem:"esri-menu__list-item",menuItemActive:"esri-menu__list-item--active",menuItemFocus:"esri-menu__list-item--focus",menuList:"esri-menu__list",panel:"esri-widget--panel",panelHeightOnly:"esri-widget--panel-height-only",primaryTick:"primary-tick",primaryTickAmPm:"primary-tick__ampm",primaryTickLabel:"primary-tick__label",rotating:"esri-rotating",secondaryTick:"secondary-tick",select:"esri-select",table:"esri-widget__table",widget:"esri-widget",widgetButton:"esri-widget--button",widgetButtonActive:"esri-widget--button-active",widgetDisabled:"esri-widget--disabled"};function ad(){return function(t,e){if(!t[e])throw new TypeError(`Cannot auto bind undefined function '${String(e)}'`);return{value:ld(t[e])}}}function rd(t){const e=t?.type;return t instanceof KeyboardEvent||e==="keyup"||e==="keydown"||e==="keypress"}function ld(t){return function(e,...i){rd(e)?br(e.key)&&(e.preventDefault(),e.stopPropagation(),e.target.click()):t.call(this,e,...i)}}const ie="esri-attribution",ne={base:ie,poweredBy:`${ie}__powered-by`,sources:`${ie}__sources`,open:`${ie}--open`,sourcesOpen:`${ie}__sources--open`,link:`${ie}__link`};let W=class extends gi{constructor(t,e){super(t,e),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(i=>i.forEach(({target:n})=>this._checkSourceTextOverflow(n))),this.itemDelimiter=" | ",this.messages=null,this.viewModel=new pa}initialize(){this.addHandles(ci(()=>this.viewModel?.items,"change",()=>this.scheduleRender()))}destroy(){this._resizeObserver?.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((t,e)=>(t.includes(e.text)||t.push(e.text),t),[]).join(this.itemDelimiter)}get icon(){return"description"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t={[ne.open]:this._isOpen};return B("div",{bind:this,class:this.classes(ne.base,pt.widget,t),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this._renderSourcesNode(),this._renderPoweredBy())}_renderPoweredBy(){return B("div",{class:ne.poweredBy},"Powered by"," ",B("a",{class:ne.link,href:"https://www.esri.com/",rel:"noreferrer",target:"_blank"},"Esri"))}_renderSourcesNode(){const t=this._isOpen,e=this._isInteractive,i=e?0:void 0,{attributionText:n}=this,s={[ne.sourcesOpen]:t,[pt.interactive]:e};return B("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(ne.sources,s),innerHTML:n,tabIndex:i})}_afterSourcesNodeCreate(t){this._prevSourceNodeHeight=t.clientWidth,this._resizeObserver.observe(t)}_checkSourceTextOverflow(t){let e=!1;const{clientHeight:i,clientWidth:n,scrollWidth:s}=t,o=s>n,a=this._attributionTextOverflowed!==o;if(this._attributionTextOverflowed=o,a&&(e=!0),this._isOpen){const h=i{let e=class extends t{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:n}=this;return sr(n),this.goToOverride?this.goToOverride(n,i):n.goTo(i.target,i.options)}};return r([l()],e.prototype,"goToOverride",void 0),r([l()],e.prototype,"view",void 0),e=r([_("esri.widgets.support.GoTo")],e),e};let Ut=class extends dd(M){constructor(t){super(t),this.orientation={x:0,y:0,z:0},this.view=null,this._updateForCamera=this._updateForCamera.bind(this),this._updateForRotation=this._updateForRotation.bind(this),this._updateRotationWatcher=this._updateRotationWatcher.bind(this)}initialize(){this.addHandles(w(()=>this.view,this._updateRotationWatcher,U))}destroy(){this.view=null}get canShowNorth(){return pd(this.view)}get state(){return!this.view?.ready||this.view.type==="2d"&&!this.view.constraints.rotationEnabled?"disabled":this.canShowNorth?"compass":"rotation"}reset(){this.view?.ready&&(this.view?.type==="2d"?this.callGoTo({target:{rotation:0},options:{animationMode:"always",duration:cd()}}):this.callGoTo({target:{heading:0}}))}_updateForRotation(t){t!=null&&this._set("orientation",{z:t})}_updateForCamera(t){if(!t)return;const e=-t.heading;this._set("orientation",{x:0,y:0,z:e})}_updateRotationWatcher(t){this.removeAllHandles(),t&&this.addHandles(t.type==="2d"?w(()=>t?.rotation,this._updateForRotation,U):w(()=>t?.camera,this._updateForCamera,U))}};r([l({readOnly:!0})],Ut.prototype,"canShowNorth",null),r([l({readOnly:!0})],Ut.prototype,"orientation",void 0),r([l({readOnly:!0})],Ut.prototype,"state",null),r([l()],Ut.prototype,"view",void 0),Ut=r([_("esri.widgets.Compass.CompassViewModel")],Ut);const da=Ut,Zs="esri-compass",Gs={base:Zs,iconContainer:`${Zs}__icon-container`};let ft=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new da,this._reset=()=>{this.viewModel.reset()},this._toRotationTransform=i=>({transform:`rotateZ(${i.z}deg)`})}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-DvwKP8jU.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url),icon:()=>b(()=>import("./calcite-icon-laqhdRBY-8qK5FfMb.js"),__vite__mapDeps([268,265,6,3,1,2,4,7,256,263]),import.meta.url)})}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(t){this.viewModel.goToOverride=t}get icon(){return this.viewModel.state==="rotation"?"arrow-up":"compass-needle"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}reset(){return this.viewModel.reset()}render(){const{orientation:t,state:e}=this.viewModel,{messages:i}=this;return B("div",{class:this.classes(Gs.base,pt.widget)},B("calcite-button",{class:pt.widgetButton,disabled:e==="disabled",kind:"neutral",label:i.reset,onclick:this._reset,round:!0,scale:"s",title:i.reset},B("div",{"aria-hidden":"true",class:Gs.iconContainer,title:i.reset},B("calcite-icon",{icon:this.icon,styles:this._toRotationTransform(t)}))))}};r([l()],ft.prototype,"goToOverride",null),r([l()],ft.prototype,"icon",null),r([l()],ft.prototype,"label",null),r([l(),mi("esri/widgets/Compass/t9n/Compass")],ft.prototype,"messages",void 0),r([l()],ft.prototype,"view",null),r([l({type:da})],ft.prototype,"viewModel",void 0),ft=r([_("esri.widgets.Compass")],ft);const ud=ft,$s="esri-navigation-toggle",Ws={base:$s,isLayoutHorizontal:`${$s}--horizontal`};let le=class extends M{constructor(t){super(t),this._navigationMode="pan",this.view=null}initialize(){this.addHandles(Ce(()=>this.view?.inputManager,()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.view?.ready&&this.view?.type==="3d"?"ready":"disabled"}get navigationMode(){return this._navigationMode}set navigationMode(t){this._navigationMode=t,this._setNavigationMode()}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate")}_setNavigationMode(){const t=this.view?.inputManager;t&&(t.primaryDragAction=this._navigationMode==="pan"?"pan":"rotate")}};r([l({readOnly:!0})],le.prototype,"state",null),r([l()],le.prototype,"_navigationMode",void 0),r([l()],le.prototype,"view",void 0),le=r([_("esri.widgets.NavigationToggle.NavigationToggleViewModel")],le);const ua=le;let vt=class extends gi{constructor(t,e){super(t,e),this.messages=null,this.viewModel=new ua,this.toggle=()=>this.viewModel.toggle(),this._panButton=null,this._rotateButton=null,this._toggle=()=>{const i=this.viewModel?.navigationMode==="pan"?this._rotateButton:this._panButton;Tr(i),this.toggle()}}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-DvwKP8jU.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url)})}get icon(){return"move"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}get view(){return this.viewModel.view}set view(t){this.viewModel.view=t}render(){const t=this.viewModel?.state==="disabled",e=this.viewModel?.navigationMode==="pan",i=this.messages.toggle;return B("div",{class:this.classes(Ws.base,pt.widget,{[Ws.isLayoutHorizontal]:this.layout==="horizontal"})},B("calcite-button",{afterCreate:n=>{this._panButton=n},appearance:e?"outline-fill":"solid",class:pt.widgetButton,disabled:t,iconStart:"move",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?void 0:-1,title:i}),B("calcite-button",{afterCreate:n=>{this._rotateButton=n},appearance:e?"solid":"outline-fill",class:pt.widgetButton,disabled:t,iconStart:"rotate",kind:"neutral",label:i,onclick:this._toggle,tabIndex:e?-1:void 0,title:i}))}};r([l()],vt.prototype,"icon",null),r([l()],vt.prototype,"label",null),r([l({value:"vertical"})],vt.prototype,"layout",null),r([l(),mi("esri/widgets/NavigationToggle/t9n/NavigationToggle")],vt.prototype,"messages",void 0),r([l()],vt.prototype,"view",null),r([l({type:ua})],vt.prototype,"viewModel",void 0),vt=r([_("esri.widgets.NavigationToggle")],vt);const md=vt;let jt=class extends M{get canZoomIn(){if(!this.view?.ready)return!1;const t=this.view?.constraints?.effectiveMaxScale;return t===0||this._scale>t}get canZoomOut(){const{view:t}=this;if(!t?.ready)return!1;const e=t.constraints?.effectiveMinScale;return e===0||this._scalethis.viewModel.zoomIn(),this.zoomOut=()=>this.viewModel.zoomOut()}loadDependencies(){return vn({button:()=>b(()=>import("./calcite-button-Cm9_TJei-DvwKP8jU.js"),__vite__mapDeps([254,6,3,1,2,4,7,255,256,257,258,259,260,261,262,263,264,265,266,267]),import.meta.url)})}get icon(){return"magnifying-glass-plus"}set icon(t){this._overrideIfSome("icon",t)}get label(){return this.messages?.widgetLabel??""}set label(t){this._overrideIfSome("label",t)}set layout(t){t!=="horizontal"&&(t="vertical"),this._set("layout",t)}set view(t){this.viewModel.view=t}get view(){return this.viewModel.view}render(){const t={[Us.horizontalLayout]:this.layout==="horizontal"},{canZoomIn:e,canZoomOut:i}=this.viewModel,{zoomIn:n,zoomOut:s}=this.messages;return B("div",{class:this.classes(Us.base,pt.widget,t)},B("calcite-button",{class:pt.widgetButton,disabled:!e,iconStart:"plus",kind:"neutral",label:n,onclick:this.zoomIn,title:n}),B("calcite-button",{class:pt.widgetButton,disabled:!i,iconStart:"minus",kind:"neutral",label:s,onclick:this.zoomOut,title:s}))}};r([l()],wt.prototype,"icon",null),r([l()],wt.prototype,"label",null),r([l({value:"vertical"})],wt.prototype,"layout",null),r([l(),mi("esri/widgets/Zoom/t9n/Zoom")],wt.prototype,"messages",void 0),r([l()],wt.prototype,"view",null),r([l({type:ma})],wt.prototype,"viewModel",void 0),wt=r([_("esri.widgets.Zoom")],wt);const _d=wt;function fd(t){return t?.view!==void 0}let ti=class extends ed{constructor(t){super(t),this._defaultPositionLookup={attribution:"manual",compass:"top-left","navigation-toggle":"top-left",zoom:"top-left"},this.components=[],this._updateViewAwareWidgets=e=>{this.components.forEach(i=>{const n=this._find(i),s=n?.widget;fd(s)&&(s.view=e)})},this._componentsWatcher=(e,i)=>{this._removeComponents(i),this._addComponents(e),this._adjustPadding(e)}}initialize(){this.addHandles([w(()=>this.components,this._componentsWatcher,U),w(()=>this.view,this._updateViewAwareWidgets,U)])}_add(t,e,i,n,s){let o=t;if(typeof t=="string"&&this._defaultPositionLookup[t]){if(this._find(t))return;o=this._createComponent(t)}super._add(o,e,i,n,s)}_removeComponents(t){t.forEach(e=>{const i=this._find(e);i&&(this.remove(i),i.destroy())})}_adjustPadding(t){if(!t.includes("attribution")&&!this._isOverridden("padding")){const{top:e}=this.padding;this.padding=e}}_addComponents(t){this.constructed&&t.forEach(e=>this.add(this._createComponent(e),this._defaultPositionLookup[e]))}_createComponent(t){const e=this._createWidget(t);return new Je({id:t,node:e})}_createWidget(t){const e=this.view;switch(t){case"attribution":return new hd({view:e});case"compass":return new ud({view:e});case"navigation-toggle":return new md({view:e});case"zoom":return new _d({view:e})}}};r([l()],ti.prototype,"components",void 0),ti=r([_("esri.views.ui.DefaultUI")],ti);const ga=ti;let ei=class extends ga{constructor(t){super(t),this.components=["attribution","zoom"]}};r([l()],ei.prototype,"components",void 0),ei=r([_("esri.views.ui.2d.DefaultUI2D")],ei);const ya=ei;class vd extends ol{constructor(e,i){super(e,i,"webmap")}}function Ui(t){return t!=null&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.WebMap"}new vd(2,32);let _a,fa,va,wa,ba,Ta,Ma;async function wd(){const[,{GraphicsView2D:t,GraphicContainer:e,LabelManager:i,MapViewNavigation:n,MagnifierView2D:s,GridView2D:o,Stage:a}]=await Promise.all([b(()=>import("./webglDeps-Bgavuh0h-31Q0Fngh.js"),__vite__mapDeps([141,142,3,1,2,4,135,134,143,144,145,146]),import.meta.url),b(()=>import("./mapViewDeps-CUVU8gUp-CjUjdWc1.js"),__vite__mapDeps([147,1,2,3,4,116,45,46,24,47,148,149,58,150,30,29,133,112,113,114,115,78,111,117,13,14,15,16,129,151,152,135,134,143,142,153,154,155,127,122,156,128,146,157,158,145,132,159,160,27,22,23,161,162,163,164,59,39,137,165,166,44,48,167,168,169,141,144,170,171,172,173,65,43,174,175,61,62,53,54,51,55,176,92,42,34,177,178,179,180,181,136,182,57,183,184,185,186,187,188,189,190,191,192,193,194,10,119,120,121,6,7,123,18,19,20,21,38,124,77,125,71,72,126,130,131,41,138]),import.meta.url)]);fa=t,va=e,wa=i,ba=n,Ta=s,Ma=o,_a=a}let v=class extends hl(kl(ml(gh))){constructor(t){super(t),this._magnifierView=null,this._gridView=null,this.stage=null,this._resolveWhenReady=[],this.rootLayerViews=new no({getCollections:()=>[this.basemapView?.baseLayerViews,this.layerViews,this.basemapView?.referenceLayerViews],getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.goToManager=new Xe({view:this}),this.graphicsView=null,this.stateManager=new Z({constraints:new Go({view:this})}),this.stationaryManager=new Pe,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.supersampleScreenshotsEnabled=!0,this.supportsGround=!1,this.frameTask=new xc(this),this.floors=new L,this.grid=null,this.highlights=Jo(),this.inputManager=new hp({view:this}),this.map=null,this.spatialReferenceLocked=!1,this.timeline=new ha,this.type="2d",this.view2dType=null,this.ui=new ya,this.test={takeScreenshot:async e=>Up(this._getScreenshotView(e),e)},this.padding={top:0,right:0,bottom:0,left:0},this.addHandles([w(()=>this.viewpoint,()=>this.stationaryManager.flip(),Ee),this.on("resize",e=>this.stateManager.resize(e.width,e.height))]),gr()}destroy(){this.layerViewManager.clear(),this._set("preconditionsReady",!1),this.frameTask=tt(this.frameTask),this.goToManager.destroy(),this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new dp(this.featuresTilingScheme)}get constraintsInfo(){const t=this.defaultsFromMap?.tileInfo,e=this.spatialReference;return{lods:t?.spatialReference?.equals(e)?t.lods:null,spatialReference:e}}get state(){return this.stateManager.state}get initialExtentRequired(){if(!this.stateManager)return!1;const{scale:t,constraints:e,center:i,viewpoint:n,extent:s}=this;let o=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&this.map.initialViewProperties?.viewpoint)&&!s&&(e?.effectiveLODs||(o=-1),(!i||t===0&&o===-1)&&(n?.targetGeometry==null||n.targetGeometry.type!=="extent"&&!n.scale))}get defaultsFromMapSettings(){return{required:{extent:!1,heightModelInfo:!1,tileInfo:!0},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get scheduler(){return this.frameTask.scheduler}get typeSpecificPreconditionsReady(){const t=this._getDefaultViewpoint();if(!t)return!1;const e=t.targetGeometry,i=this.spatialReference;return yr(e.spatialReference,i)}set animation(t){const e=this._get("animation");if(t===e)return;if(e&&e.stop(),t!==this.animationManager.animation&&this.animationManager.stop(),!t||t.isFulfilled())return void this._set("animation",null);this._set("animation",t);const i=()=>{this.destroyed||t===this._get("animation")&&(this._set("animation",null),this.frameTask?.requestFrame())};t.when(i,i)}get background(){return Ui(this.map)?this.map.initialViewProperties.background:null}set background(t){this._override("background",t)}get center(){return this.stateManager?.center??null}set center(t){this.stateManager.center=t}get constraints(){return this.stateManager?.constraints}set constraints(t){t.view=this;const e=this.stateManager.constraints;this.stateManager.constraints=t,e?.destroy()}get extent(){return this.stateManager?.extent??null}set extent(t){this.stateManager.extent=t}get highlightOptions(){return Lp(this)}set highlightOptions(t){Vp(this,t)}get padding(){return this.stateManager?.padding}set padding(t){this.stateManager&&(this.stateManager.padding=t)}get rendering(){return this.stage?.renderRequested??!1}get resizeAlign(){return this.stateManager.resizeAlign}set resizeAlign(t){this.stateManager.resizeAlign=t}get resolution(){return this.stateManager.resolution??0}get rotation(){return this.stateManager.rotation??0}set rotation(t){const{rotationEnabled:e}=this.constraints;this.constraints.rotationEnabled=!0,this.stateManager.rotation=t,this.constraints.rotationEnabled=e}get scale(){return this.stateManager?.scale??0}set scale(t){this.stateManager&&(this.stateManager.scale=t)}get stationary(){return!this.animation&&!this.navigating&&!this.resizing&&this.stationaryManager.stationary}get tileInfo(){return this.featuresTilingScheme?.tileInfo}get updating(){const t=!(!this.magnifier.visible||this.magnifier.position===null||!this._magnifierView?.updatingHandles.updating),e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(i=>!i.destroyed&&!("layerViews"in i)&&i.updating===!0)||t);if(z("esri-2d-log-updating")){const i=this.allLayerViews.reduce((n,s)=>({...n,[`${s.layer.id}(${s.layer.type})`]:!s.destroyed&&!("layerViews"in s)&&s.updating}),{});console.log(`Updating MapView: ${e} -> Null LayerViewManager: ${!this.layerViewManager} -> Null LabelManager: ${!this.labelManager} -> Null GraphicsView: ${!this.graphicsView} diff --git a/custom-toc-highlight/assets/MediaLayer-DiCs97gD-D8BtJysn.js b/custom-toc-highlight/assets/MediaLayer-DiCs97gD-S0-qCmPh.js similarity index 92% rename from custom-toc-highlight/assets/MediaLayer-DiCs97gD-D8BtJysn.js rename to custom-toc-highlight/assets/MediaLayer-DiCs97gD-S0-qCmPh.js index 942fe3a4..2f3dfd2f 100644 --- a/custom-toc-highlight/assets/MediaLayer-DiCs97gD-D8BtJysn.js +++ b/custom-toc-highlight/assets/MediaLayer-DiCs97gD-S0-qCmPh.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mediaLayerUtils-CasWezAG-eGCMpSgm.js","./utils-BVWK2jiA-Btpo3M9u.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./jsonContext-BA8GHqVk-CWQlLGSw.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./saveUtils-CIYk-dsQ-VGcOewby.js","./resourceUtils-BmW6QqlX-B1DAUGNs.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-BROWZCZ1.js"])))=>i.map(i=>d[i]); -import{_ as Ve}from"./main-ugzBrWNm.js";import{v as i,i as R,S as l,w as d,bA as Ae,J as ae,o as x,a1 as W,as as w,a0 as K,ac as Z,l as ce,n as ue,aH as We,ag as ne,aB as Re,at as Be,I as Ge,ah as ze,$ as Ue,am as De,aC as Je,gH as ke,jb as Fe,bp as Ke,bP as F,ad as qe,aP as _e,e as Ye,B as Xe,jM as fe,bO as Ze,a4 as Qe,dY as ye,jD as be,jC as et,cx as Ie,cw as pe,cO as de,jN as tt,f as Oe,bX as nt,Y as ot,A as rt,bZ as ge,jO as it}from"./story-BfX8CRfG.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as st}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{u as lt}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{E as at}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as ct}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{S as ut}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{K as O,M as Ee,o as pt}from"./perspectiveUtils-Bu88xlbg-DGihQXe_.js";import{k as dt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{o as ht,n as oe}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as N,P as z,I as ve}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as b,e as Q}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{V as q,N as mt,K as ft}from"./projection-BA9M1R7d-BYoCXVXt.js";import{T as yt}from"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import{r as gt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{r as vt}from"./common-CYWrYyJl-E8-sukrT.js";import{e as Pt}from"./resourceExtension-CdQvIDKV-BNH6JkTz.js";import{r as wt}from"./BoundsStore--N6o1xkF-BnCtocGj.js";import{E as ee}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";let se=class extends _e{projectOrWarn(e,t){if(e==null)return e;const{geometry:n,pending:o}=q(e,t);return o?null:o||n?n:(W.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};se=i([R("esri.layers.support.GeoreferenceBase")],se);const Y=se,re=oe(),p=b();let J=class extends Ye{};i([l({type:Number,json:{write:!0}})],J.prototype,"x",void 0),i([l({type:Number,json:{write:!0}})],J.prototype,"y",void 0),J=i([R("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],J);let k=class extends _e{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};i([l()],k.prototype,"sourcePoint",void 0),i([l({type:d})],k.prototype,"mapPoint",void 0),k=i([R("esri.layers.support.ControlPointsGeoreference.ControlPoint")],k);let v=class extends Ae(Y){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const n=ae.fromJSON(t.spatialReference),o=ht(...t.coefficients,1);return e.map(r=>(N(p,r.x,r.y),O(p,p,o),{sourcePoint:r,mapPoint:new d({x:p[0],y:p[1],spatialReference:n})}))}writeControlPoints(e,t,n,o){if(this.transform!=null)e!=null&&f(e[0])&&(t.controlPoints=e.map(r=>{const s=r.sourcePoint;return{x:s.x,y:s.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8));else{const r=new x("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.",{layer:o?.layer,georeference:this});o?.messages?o.messages.push(r):W.getLogger(this).error(r.name,r.message)}}get coords(){if(this.controlPoints==null)return null;const e=this._updateTransform(re);if(e==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return It(e,this.width,this.height,t)}set coords(e){if(this.controlPoints==null||!f(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if((e=this.projectOrWarn(e,t))==null)return;const{width:n,height:o}=this,{rings:[[r,s,a,c]]}=e,u={sourcePoint:w(0,o),mapPoint:new d({x:r[0],y:r[1],spatialReference:t})},h={sourcePoint:w(0,0),mapPoint:new d({x:s[0],y:s[1],spatialReference:t})},y={sourcePoint:w(n,0),mapPoint:new d({x:a[0],y:a[1],spatialReference:t})},g={sourcePoint:w(n,o),mapPoint:new d({x:c[0],y:c[1],spatialReference:t})};f(u)&&f(h)&&f(y)&&f(g)&&(Pe(re,u,h,y,g),this.controlPoints=this.controlPoints.map(({sourcePoint:I})=>(N(p,I.x,I.y),O(p,p,re),{sourcePoint:I,mapPoint:new d({x:p[0],y:p[1],spatialReference:t})})))}get inverseTransform(){return this.transform==null?null:dt(oe(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(e==null||this.transform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;N(p,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return O(p,p,this.transform),new d({x:p[0],y:p[1],spatialReference:t})}toSource(e){if(e==null||this.inverseTransform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),(e=q(e,t).geometry)==null?null:(N(p,e.x,e.y),O(p,p,this.inverseTransform),w(p[0],p[1]))}toSourceNormalized(e){const t=this.toSource(e);return t!=null&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){const{controlPoints:t,width:n,height:o}=this;if(!(t!=null&&n>0&&o>0))return null;const[r,s,a,c]=t;if(!f(r))return null;const u=r.mapPoint.spatialReference,h=this._projectControlPoint(s,u),y=this._projectControlPoint(a,u),g=this._projectControlPoint(c,u);if(!h.valid||!y.valid||!g.valid||!f(h.controlPoint))return null;e==null&&(e=oe());let I=null;return I=f(y.controlPoint)&&f(g.controlPoint)?Pe(e,r,h.controlPoint,y.controlPoint,g.controlPoint):f(y.controlPoint)?Rt(e,r,h.controlPoint,y.controlPoint):xt(e,r,h.controlPoint),I.every(Ne=>Ne===0)?null:I}_projectControlPoint(e,t){if(!f(e))return{valid:!0,controlPoint:e};const{sourcePoint:n,mapPoint:o}=e,{geometry:r,pending:s}=q(o,t);return s?{valid:!1,controlPoint:null}:s||r?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:r}}:(W.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:o.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function f(e){return e?.sourcePoint!=null&&e.mapPoint!=null}i([l({type:[k],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[J]},coefficients:{type:[Number]},spatialReference:{type:ae}}}}})],v.prototype,"controlPoints",void 0),i([K("controlPoints")],v.prototype,"readControlPoints",null),i([Z("controlPoints")],v.prototype,"writeControlPoints",null),i([l({clonable:!1})],v.prototype,"coords",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"height",void 0),i([l({readOnly:!0})],v.prototype,"inverseTransform",null),i([l({readOnly:!0})],v.prototype,"transform",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"width",void 0),v=i([R("esri.layers.support.ControlPointsGeoreference")],v);const S=b(),E=b(),V=b(),C=b(),M=b(),L=b(),A=b(),H=b(),te=Math.PI/2;function j(e,t,n){N(e,n.sourcePoint.x,n.sourcePoint.y),N(t,n.mapPoint.x,n.mapPoint.y)}function xt(e,t,n){return j(S,M,t),j(E,L,n),z(V,E,S,te),z(C,S,E,te),z(A,L,M,-te),z(H,M,L,-te),he(e,S,E,V,C,M,L,A,H)}function Rt(e,t,n,o){return j(S,M,t),j(E,L,n),j(V,A,o),ve(C,S,E,.5),z(C,V,C,Math.PI),ve(H,M,L,.5),z(H,A,H,Math.PI),he(e,S,E,V,C,M,L,A,H)}function Pe(e,t,n,o,r){return j(S,M,t),j(E,L,n),j(V,A,o),j(C,H,r),he(e,S,E,V,C,M,L,A,H)}const _t=new Array(8).fill(0),bt=new Array(8).fill(0);function we(e,t,n,o,r){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=o[0],e[5]=o[1],e[6]=r[0],e[7]=r[1],e}function he(e,t,n,o,r,s,a,c,u){return Ee(e,we(_t,t,n,o,r),we(bt,s,a,c,u))}function It(e,t,n,o){const r=Q(0,n),s=Q(0,0),a=Q(t,0),c=Q(t,n);return O(r,r,e),O(s,s,e),O(a,a,e),O(c,c,e),new ce({rings:[[r,s,a,c,r]],spatialReference:o})}const X=v,U=b();let T=class extends Y{constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:o}=this;if(e==null||t==null||n==null||o==null)return null;const r=e.spatialReference;return t=this.projectOrWarn(t,r),n=this.projectOrWarn(n,r),o=this.projectOrWarn(o,r),t==null||n==null||o==null?null:new ce({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[o.x,o.y],[n.x,n.y]]],spatialReference:r})}set coords(e){const{topLeft:t}=this;if(t==null)return;const n=t.spatialReference;if((e=this.projectOrWarn(e,n))==null)return;const{rings:[[o,r,s,a]]}=e;this.bottomLeft=new d({x:o[0],y:o[1],spatialReference:n}),this.topLeft=new d({x:r[0],y:r[1],spatialReference:n}),this.topRight=new d({x:s[0],y:s[1],spatialReference:n}),this.bottomRight=new d({x:a[0],y:a[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:o,bottomLeft:r}=this;if(e==null||t==null||n==null||o==null||r==null)return null;const s=t.spatialReference;e=e.normalize();const a=q(e,s).geometry;if(a==null)return null;N(U,a.x,a.y);const c=Ee(oe(),[t.x,t.y,r.x,r.y,n.x,n.y,o.x,o.y],[0,0,0,1,1,0,1,1]);return O(U,U,c),w(U[0],U[1])}};i([l({clonable:!1})],T.prototype,"coords",null),i([l({type:d})],T.prototype,"bottomLeft",void 0),i([l({type:d})],T.prototype,"bottomRight",void 0),i([l({type:d})],T.prototype,"topLeft",void 0),i([l({type:d})],T.prototype,"topRight",void 0),T=i([R("esri.layers.support.CornersGeoreference")],T);const Ot=T;let B=class extends Y{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(this.extent==null)return null;const{xmin:e,ymin:t,xmax:n,ymax:o,spatialReference:r}=this.extent;let s;if(this.rotation){const{x:a,y:c}=this.extent.center,u=ie(a,c,this.rotation);s=[u(e,t),u(e,o),u(n,o),u(n,t)],s.push(s[0])}else s=[[e,t],[e,o],[n,o],[n,t],[e,t]];return new ce({rings:[s],spatialReference:r})}set coords(e){if(e==null||this.extent==null)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),e?.extent==null)return;const{rings:[[n,o,r]],extent:{center:{x:s,y:a}}}=e,c=Xe(Math.PI/2-Math.atan2(o[1]-n[1],o[0]-n[0])),u=ie(s,a,-c),[h,y]=u(n[0],n[1]),[g,I]=u(r[0],r[1]);this.extent=new ue({xmin:h,ymin:y,xmax:g,ymax:I,spatialReference:t}),this.rotation=c}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(e==null||t==null)return null;const{xmin:o,ymin:r,xmax:s,ymax:a,center:c,spatialReference:u}=t;e=e.normalize();const h=q(e,u).geometry;if(h==null)return null;let y=h.x,g=h.y;return n&&([y,g]=ie(c.x,c.y,-n)(y,g)),w(fe(y,o,s,0,1),fe(g,a,r,0,1))}};function ie(e,t,n){const o=vt(n),r=Math.cos(o),s=Math.sin(o);return(a,c)=>[r*(a-e)+s*(c-t)+e,r*(c-t)-s*(a-e)+t]}i([l({clonable:!1})],B.prototype,"coords",null),i([l({type:ue})],B.prototype,"extent",void 0),i([l({type:Number})],B.prototype,"rotation",void 0),B=i([R("esri.layers.support.ExtentAndRotationGeoreference")],B);const St=B;function Et(e){return e?.type==="media"}function Me(e,t){const n=Ze(t);return Et(e)&&!!e.portalItem&&n!=null&&n>F.PORTAL_ITEM}function Mt(e,t,n){if(!e||e.type==="control-points")return e;const{coords:o}=e;if(o?.rings[0]?.length!==5)return null;const[r,s,a,c]=o.rings[0],{spatialReference:u}=o;return new X({controlPoints:[{mapPoint:new d({x:r[0],y:r[1],spatialReference:u}),sourcePoint:w(0,n)},{mapPoint:new d({x:s[0],y:s[1],spatialReference:u}),sourcePoint:w(0,0)},{mapPoint:new d({x:a[0],y:a[1],spatialReference:u}),sourcePoint:w(t,0)},{mapPoint:new d({x:c[0],y:c[1],spatialReference:u}),sourcePoint:w(t,n)}],width:t,height:n})}function Le(e,t,n){return{enabled:!Me(n?.layer,n?.origin),ignoreOrigin:!0}}const je={json:{name:"url",type:String,write:{overridePolicy:Le}}},Te={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:Le}}},Lt={types:{key:"type",base:Y,typeMap:{"control-points":X,corners:Ot,"extent-and-rotation":St}},json:{types:{key:"type",base:Y,typeMap:{"control-points":X}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};let $=class extends We(Se(Re)){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return X.fromJSON(e)}writeGeoreference(e,t,n,o){const r=o?.resources?.pendingOperations,s=()=>{const a=Mt(this.georeference,this.contentWidth,this.contentHeight);if(a){if(e.type!=="control-points"&&W.getLogger(this).warn(`only georeference of type 'control-points' may be persisted. The georeference of type '${e.type}' has been automatically converted.`),a.controlPoints?.length!==4&&o?.messages)return void o.messages.push(new x("property:unsupported","only 'control-points' georeference with 4 control points may be persisted."));t[n]=a.write({},o)}};if(e.type!=="control-points"&&!this.loaded&&r)return t[n]={},void r.push(this.load().then(s));s()}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:o}=this;if(e==null||t==null||n===0||o===0)return null;const r=t.toSourceNormalized(e);return r==null?null:(r.x*=n,r.y*=o,r)}};i([l(Lt)],$.prototype,"georeference",void 0),i([K("georeference")],$.prototype,"readGeoreference",null),i([Z("georeference")],$.prototype,"writeGeoreference",null),i([l({json:{read:!1,write:!1}})],$.prototype,"opacity",void 0),$=i([R("esri.layers.support.MediaElementBase")],$);const me=$;let P=class extends me{constructor(e){super(e),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const e=this.image;if(typeof e=="string"){const t=yt(e).then(n=>{this._set("content",n)});this.addResolvingPromise(t)}else if(e instanceof HTMLImageElement){const t=e.decode().then(()=>{this._set("content",e)});this.addResolvingPromise(t)}else e?this._set("content",e):this.addResolvingPromise(Promise.reject(new x("image-element:invalid-image-type","Invalid image type",{image:e})));return Promise.resolve(this)}get contentWidth(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(e,t,n){return Qe(t.url,n)}writeImage(e,t,n,o){if(e==null)return;const r=o?.portalItem,s=o?.resources;if(!r||!s)return void(typeof e=="string"&&(t[n]=ye(e,o)));const a=jt(e)?e:null;if(a){if(be(a)==null)return void(t[n]=a);const c=ye(a,{...o,verifyItemRelativeUrls:o?.verifyItemRelativeUrls?{writtenUrls:o.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},et.NO);if(r&&c&&!Ie(c))return s.toKeep.push({resource:r.resourceFromPath(c),compress:!1}),void(t[n]=c)}t[n]="",s.pendingOperations.push(Tt(e).then(c=>{const u=Ht(c,r);t[n]=u.itemRelativeUrl,s.toAdd.push({resource:u,content:{type:"blob",blob:c},compress:!1,finish:h=>{this.image=h.url}})}))}};i([l()],P.prototype,"animationOptions",void 0),i([l({readOnly:!0})],P.prototype,"content",void 0),i([l({readOnly:!0})],P.prototype,"contentWidth",null),i([l({readOnly:!0})],P.prototype,"contentHeight",null),i([l(je)],P.prototype,"image",void 0),i([K("image",["url"])],P.prototype,"readImage",null),i([Z("image")],P.prototype,"writeImage",null),i([l(Te)],P.prototype,"type",void 0),P=i([R("esri.layers.support.ImageElement")],P);const Ce=P;function jt(e){return typeof e=="string"&&!pe(e)&&!de(e)}async function Tt(e){return typeof e=="string"?pe(e)?tt(e):(await Oe(e,{responseType:"blob"})).data:new Promise(t=>Ct(e).toBlob(t))}function Ct(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=document.createElement("canvas"),r=o.getContext("2d");return o.width=t,o.height=n,e instanceof HTMLImageElement?r.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&r.putImageData(e,0,0),o}function Ht(e,t){const n=gt(),o=`${nt("media",n)}.${Pt({type:"blob",blob:e})}`;return t.resourceFromPath(o)}let _=class extends me{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video"}load(){const e=this.video;return typeof e=="string"?this.addResolvingPromise(this._preProcessVideoUrl(e).then(t=>{const n=document.createElement("video");return n.src=t,n.crossOrigin="anonymous",n.autoplay=!0,n.muted=!0,n.loop=!0,n.playsInline=!0,this._loadVideo(n).then(()=>{this._set("content",n)})})):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new x("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}set video(e){this.loadStatus==="not-loaded"?this._set("video",e):W.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,n,o){if(!e)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source is missing")));const r=$t(e)?e:null;if(!r)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source must be an absolute url")));!Ie(r)&&o?.blockedRelativeUrls&&o.blockedRelativeUrls.push(r);const s=ot(r);be(s)?o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source cannot be an item resource")):t[n]=s}async _preProcessVideoUrl(e){if(rt(e))return ge(e);try{return await Oe(e,{method:"head"}),e}catch{return ge(e,!0)}}_loadVideo(e){return new Promise((t,n)=>{const o=it(e,"canplay",()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,n):t()});this.addHandles(o,"canplay"),e.crossOrigin!=="anonymous"&&(e.crossOrigin="anonymous",de(e.src)||(e.src=e.src))})}};i([l()],_.prototype,"autoplay",void 0),i([l({readOnly:!0})],_.prototype,"content",void 0),i([l({readOnly:!0})],_.prototype,"contentWidth",null),i([l({readOnly:!0})],_.prototype,"contentHeight",null),i([l(je)],_.prototype,"video",null),i([Z("video")],_.prototype,"writeVideo",null),i([l(Te)],_.prototype,"type",void 0),_=i([R("esri.layers.support.VideoElement")],_);const He=_;function $t(e){return typeof e=="string"&&!pe(e)&&!de(e)}const Nt={key:"type",defaultKeyValue:"image",base:me,typeMap:{image:Ce,video:He}},xe=ne.ofType(Nt);let G=class extends Re.LoadableMixin(Be(Ge.EventedAccessor)){constructor(e){super(e),this._index=new wt,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const o of t.removed){const r=this._elementViewsMap.get(o);this._elementViewsMap.delete(o),this._index.delete(r),this.removeHandles(r),r.destroy(),this.notifyChange("fullExtent")}const{spatialReference:n}=this;for(const o of t.added){if(this._elementViewsMap.get(o))continue;const r=new pt({spatialReference:n,element:o});this._elementViewsMap.set(o,r);const s=ze(()=>r.coords,()=>this._updateIndexForElement(r,!1));this._updateIndexForElement(r,!0),this.addHandles(s,r)}this._elementsIndexes.clear(),this.elements.forEach((o,r)=>this._elementsIndexes.set(o,r)),this.emit("refresh")},this.elements=new xe}async load(e){if(Ue(e),!this.spatialReference){const t=this.elements.find(n=>n.georeference?.coords!=null);this._set("spatialReference",t?t.georeference.coords.spatialReference:ae.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",De(e,this._get("elements"),xe))}get fullExtent(){if(this.loadStatus==="not-loaded")return null;const e=this._index.fullBounds;return e==null?null:new ue({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){this.loadStatus==="not-loaded"?this._set("spatialReference",e):W.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await mt(e.spatialReference,this.spatialReference,null,t);const n=Je(e.spatialReference,this.spatialReference)?e:ft(e,this.spatialReference);if(!n)return[];const o=n.normalize(),r=[];for(const s of o)this._index.forEachInBounds(ke(s),({normalizedCoords:a,element:c})=>{a!=null&&Fe(s,a)&&r.push(c)});return r.sort((s,a)=>this._elementsIndexes.get(s)-this._elementsIndexes.get(a)),r}hasElement(e){return this.elements.includes(e)}_updateIndexForElement(e,t){const n=e.normalizedBounds,o=this._index.has(e),r=n!=null;this._index.delete(e),r&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(o!==r?this.emit("refresh"):this.emit("change",{element:e.element}))}};i([l()],G.prototype,"elements",null),i([l({readOnly:!0})],G.prototype,"fullExtent",null),i([l()],G.prototype,"spatialReference",null),G=i([R("esri.layers.support.LocalMediaElementSource")],G);const D=G;function le(e){return typeof e=="object"&&e!=null&&"type"in e}function $e(e){return le(e)&&(e.type==="image"||e.type==="video")}let m=class extends lt(ut(at(ct(Se(st))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=Ke(async(t,n,o)=>{const{save:r,saveAs:s}=await Ve(()=>import("./mediaLayerUtils-CasWezAG-eGCMpSgm.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);switch(t){case ee.SAVE:return r(this,n);case ee.SAVE_AS:return s(this,o,n)}}),this.source=new D}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new x("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),this.setAtOrigin("source",n,"web-scene"),t=n);const o=le(t)?new D({elements:new ne([t])}):t;this._set("effectiveSource",o),this.spatialReference&&(o.spatialReference=this.spatialReference),await o.load(e),this.spatialReference=o.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("source",e):W.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new D({elements:new ne(e)}):e instanceof ne?new D({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const o=this._createSource(t);return o?.read(t,n),o}writeSource(e,t,n,o){if(e&&e instanceof D){const r=e.elements.length;if(r!==1)return void(o?.messages&&o.messages.push(new x("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${r}.`)));e=e.elements.at(0)}$e(e)?e.write(t,o):o?.messages&&(e?o.messages.push(new x("media-layer:unsupported-source","only media elements of type 'ImageElement' or 'VideoElement' can be persisted")):o.messages.push(new x("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(ee.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ee.SAVE_AS,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new Ce;case"video":return new He}return null}_getSourceOverride(e,t){if(le(e)&&this.originIdOf("source")===F.PORTAL_ITEM&&t&&(this.originIdOf("georeference")===F.WEB_MAP||this.originIdOf("georeference")===F.WEB_SCENE)){const n=e.toJSON(),o=this._createSource(n);return o.read({...n},{origin:"portal-item"}),o.read({georeference:t},{origin:"web-map"}),o.read({georeference:t},{origin:"web-scene"}),o}return null}};i([l({readOnly:!0})],m.prototype,"effectiveSource",void 0),i([l({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],m.prototype,"georeference",void 0),i([K("web-document","georeference")],m.prototype,"readGeoreference",null),i([l({type:String})],m.prototype,"copyright",void 0),i([l({readOnly:!0})],m.prototype,"fullExtent",null),i([l({type:["MediaLayer"]})],m.prototype,"operationalLayerType",void 0),i([l({type:["show","hide"]})],m.prototype,"listMode",void 0),i([l({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image","video"]},georeference:{type:X}},overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:Me(this,n?.origin)&&$e(e)&&!!e.georeference&&e.originIdOf("georeference")>F.PORTAL_ITEM}}}}})],m.prototype,"source",null),i([qe("source")],m.prototype,"castSource",null),i([K("source",["url"])],m.prototype,"readSource",null),i([Z("source")],m.prototype,"writeSource",null),i([l()],m.prototype,"spatialReference",void 0),i([l({readOnly:!0})],m.prototype,"type",void 0),m=i([R("esri.layers.MediaLayer")],m);const wn=m;export{wn as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mediaLayerUtils-CasWezAG-xuUSkW-V.js","./utils-BVWK2jiA-i-Dn2Ad8.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CfFOGshS.js","./jsonContext-BA8GHqVk-BsXRY5es.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./saveUtils-CIYk-dsQ-Br9QCJTX.js","./resourceUtils-BmW6QqlX-D_AxNrCI.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./resourceUtils-rTM6Iemx-GPPQBysx.js"])))=>i.map(i=>d[i]); +import{_ as Ve}from"./main-QGPoLsvl.js";import{v as i,i as R,S as l,w as d,bA as Ae,J as ae,o as x,a1 as W,as as w,a0 as K,ac as Z,l as ce,n as ue,aH as We,ag as ne,aB as Re,at as Be,I as Ge,ah as ze,$ as Ue,am as De,aC as Je,gH as ke,jb as Fe,bp as Ke,bP as F,ad as qe,aP as _e,e as Ye,B as Xe,jM as fe,bO as Ze,a4 as Qe,dY as ye,jD as be,jC as et,cx as Ie,cw as pe,cO as de,jN as tt,f as Oe,bX as nt,Y as ot,A as rt,bZ as ge,jO as it}from"./story-Doly9N9p.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as st}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{u as lt}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{E as at}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as ct}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{S as ut}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{K as O,M as Ee,o as pt}from"./perspectiveUtils-Bu88xlbg-Cn6YpKwC.js";import{k as dt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{o as ht,n as oe}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as N,P as z,I as ve}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as b,e as Q}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{V as q,N as mt,K as ft}from"./projection-BA9M1R7d-CAbqHZiw.js";import{T as yt}from"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import{r as gt}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{r as vt}from"./common-CYWrYyJl-E8-sukrT.js";import{e as Pt}from"./resourceExtension-CdQvIDKV-DCvzsrJt.js";import{r as wt}from"./BoundsStore--N6o1xkF-CQrhMeDa.js";import{E as ee}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./PooledRBush-DbfAmeLn-CPHfm9op.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";let se=class extends _e{projectOrWarn(e,t){if(e==null)return e;const{geometry:n,pending:o}=q(e,t);return o?null:o||n?n:(W.getLogger(this).warn("geometry could not be projected to the spatial reference",{georeference:this,geometry:e,sourceSpatialReference:e.spatialReference,targetSpatialReference:t}),null)}};se=i([R("esri.layers.support.GeoreferenceBase")],se);const Y=se,re=oe(),p=b();let J=class extends Ye{};i([l({type:Number,json:{write:!0}})],J.prototype,"x",void 0),i([l({type:Number,json:{write:!0}})],J.prototype,"y",void 0),J=i([R("esri.layers.support.ControlPointsGeoreference.ControlPointJSONType")],J);let k=class extends _e{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};i([l()],k.prototype,"sourcePoint",void 0),i([l({type:d})],k.prototype,"mapPoint",void 0),k=i([R("esri.layers.support.ControlPointsGeoreference.ControlPoint")],k);let v=class extends Ae(Y){constructor(e){super(e),this.controlPoints=null,this.height=0,this.type="control-points",this.width=0}readControlPoints(e,t){const n=ae.fromJSON(t.spatialReference),o=ht(...t.coefficients,1);return e.map(r=>(N(p,r.x,r.y),O(p,p,o),{sourcePoint:r,mapPoint:new d({x:p[0],y:p[1],spatialReference:n})}))}writeControlPoints(e,t,n,o){if(this.transform!=null)e!=null&&f(e[0])&&(t.controlPoints=e.map(r=>{const s=r.sourcePoint;return{x:s.x,y:s.y}}),t.spatialReference=e[0].mapPoint.spatialReference.toJSON(),t.coefficients=this.transform.slice(0,8));else{const r=new x("web-document-write:invalid-georeference","Invalid 'controlPoints', 'width', 'height' configuration. Make sure the parent media element is loaded i.e. the ImageElement or VideoElement set as 'MediaLayer.source'.",{layer:o?.layer,georeference:this});o?.messages?o.messages.push(r):W.getLogger(this).error(r.name,r.message)}}get coords(){if(this.controlPoints==null)return null;const e=this._updateTransform(re);if(e==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return It(e,this.width,this.height,t)}set coords(e){if(this.controlPoints==null||!f(this.controlPoints[0]))return;const t=this.controlPoints[0].mapPoint.spatialReference;if((e=this.projectOrWarn(e,t))==null)return;const{width:n,height:o}=this,{rings:[[r,s,a,c]]}=e,u={sourcePoint:w(0,o),mapPoint:new d({x:r[0],y:r[1],spatialReference:t})},h={sourcePoint:w(0,0),mapPoint:new d({x:s[0],y:s[1],spatialReference:t})},y={sourcePoint:w(n,0),mapPoint:new d({x:a[0],y:a[1],spatialReference:t})},g={sourcePoint:w(n,o),mapPoint:new d({x:c[0],y:c[1],spatialReference:t})};f(u)&&f(h)&&f(y)&&f(g)&&(Pe(re,u,h,y,g),this.controlPoints=this.controlPoints.map(({sourcePoint:I})=>(N(p,I.x,I.y),O(p,p,re),{sourcePoint:I,mapPoint:new d({x:p[0],y:p[1],spatialReference:t})})))}get inverseTransform(){return this.transform==null?null:dt(oe(),this.transform)}get transform(){return this._updateTransform()}toMap(e){if(e==null||this.transform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;N(p,e.x,e.y);const t=this.controlPoints[0].mapPoint.spatialReference;return O(p,p,this.transform),new d({x:p[0],y:p[1],spatialReference:t})}toSource(e){if(e==null||this.inverseTransform==null||this.controlPoints==null||!f(this.controlPoints[0]))return null;const t=this.controlPoints[0].mapPoint.spatialReference;return e=e.normalize(),(e=q(e,t).geometry)==null?null:(N(p,e.x,e.y),O(p,p,this.inverseTransform),w(p[0],p[1]))}toSourceNormalized(e){const t=this.toSource(e);return t!=null&&(t.x/=this.width,t.y/=this.height),t}_updateTransform(e){const{controlPoints:t,width:n,height:o}=this;if(!(t!=null&&n>0&&o>0))return null;const[r,s,a,c]=t;if(!f(r))return null;const u=r.mapPoint.spatialReference,h=this._projectControlPoint(s,u),y=this._projectControlPoint(a,u),g=this._projectControlPoint(c,u);if(!h.valid||!y.valid||!g.valid||!f(h.controlPoint))return null;e==null&&(e=oe());let I=null;return I=f(y.controlPoint)&&f(g.controlPoint)?Pe(e,r,h.controlPoint,y.controlPoint,g.controlPoint):f(y.controlPoint)?Rt(e,r,h.controlPoint,y.controlPoint):xt(e,r,h.controlPoint),I.every(Ne=>Ne===0)?null:I}_projectControlPoint(e,t){if(!f(e))return{valid:!0,controlPoint:e};const{sourcePoint:n,mapPoint:o}=e,{geometry:r,pending:s}=q(o,t);return s?{valid:!1,controlPoint:null}:s||r?{valid:!0,controlPoint:{sourcePoint:n,mapPoint:r}}:(W.getLogger(this).warn("map point could not be projected to the spatial reference",{georeference:this,controlPoint:e,sourceSpatialReference:o.spatialReference,targetSpatialReference:t}),{valid:!1,controlPoint:null})}};function f(e){return e?.sourcePoint!=null&&e.mapPoint!=null}i([l({type:[k],json:{write:{allowNull:!1,isRequired:!0,target:{controlPoints:{type:[J]},coefficients:{type:[Number]},spatialReference:{type:ae}}}}})],v.prototype,"controlPoints",void 0),i([K("controlPoints")],v.prototype,"readControlPoints",null),i([Z("controlPoints")],v.prototype,"writeControlPoints",null),i([l({clonable:!1})],v.prototype,"coords",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"height",void 0),i([l({readOnly:!0})],v.prototype,"inverseTransform",null),i([l({readOnly:!0})],v.prototype,"transform",null),i([l({type:Number,nonNullable:!0,json:{write:!0}})],v.prototype,"width",void 0),v=i([R("esri.layers.support.ControlPointsGeoreference")],v);const S=b(),E=b(),V=b(),C=b(),M=b(),L=b(),A=b(),H=b(),te=Math.PI/2;function j(e,t,n){N(e,n.sourcePoint.x,n.sourcePoint.y),N(t,n.mapPoint.x,n.mapPoint.y)}function xt(e,t,n){return j(S,M,t),j(E,L,n),z(V,E,S,te),z(C,S,E,te),z(A,L,M,-te),z(H,M,L,-te),he(e,S,E,V,C,M,L,A,H)}function Rt(e,t,n,o){return j(S,M,t),j(E,L,n),j(V,A,o),ve(C,S,E,.5),z(C,V,C,Math.PI),ve(H,M,L,.5),z(H,A,H,Math.PI),he(e,S,E,V,C,M,L,A,H)}function Pe(e,t,n,o,r){return j(S,M,t),j(E,L,n),j(V,A,o),j(C,H,r),he(e,S,E,V,C,M,L,A,H)}const _t=new Array(8).fill(0),bt=new Array(8).fill(0);function we(e,t,n,o,r){return e[0]=t[0],e[1]=t[1],e[2]=n[0],e[3]=n[1],e[4]=o[0],e[5]=o[1],e[6]=r[0],e[7]=r[1],e}function he(e,t,n,o,r,s,a,c,u){return Ee(e,we(_t,t,n,o,r),we(bt,s,a,c,u))}function It(e,t,n,o){const r=Q(0,n),s=Q(0,0),a=Q(t,0),c=Q(t,n);return O(r,r,e),O(s,s,e),O(a,a,e),O(c,c,e),new ce({rings:[[r,s,a,c,r]],spatialReference:o})}const X=v,U=b();let T=class extends Y{constructor(e){super(e),this.bottomLeft=null,this.bottomRight=null,this.topLeft=null,this.topRight=null,this.type="corners"}get coords(){let{topLeft:e,topRight:t,bottomLeft:n,bottomRight:o}=this;if(e==null||t==null||n==null||o==null)return null;const r=e.spatialReference;return t=this.projectOrWarn(t,r),n=this.projectOrWarn(n,r),o=this.projectOrWarn(o,r),t==null||n==null||o==null?null:new ce({rings:[[[n.x,n.y],[e.x,e.y],[t.x,t.y],[o.x,o.y],[n.x,n.y]]],spatialReference:r})}set coords(e){const{topLeft:t}=this;if(t==null)return;const n=t.spatialReference;if((e=this.projectOrWarn(e,n))==null)return;const{rings:[[o,r,s,a]]}=e;this.bottomLeft=new d({x:o[0],y:o[1],spatialReference:n}),this.topLeft=new d({x:r[0],y:r[1],spatialReference:n}),this.topRight=new d({x:s[0],y:s[1],spatialReference:n}),this.bottomRight=new d({x:a[0],y:a[1],spatialReference:n})}toSourceNormalized(e){const{topLeft:t,topRight:n,bottomRight:o,bottomLeft:r}=this;if(e==null||t==null||n==null||o==null||r==null)return null;const s=t.spatialReference;e=e.normalize();const a=q(e,s).geometry;if(a==null)return null;N(U,a.x,a.y);const c=Ee(oe(),[t.x,t.y,r.x,r.y,n.x,n.y,o.x,o.y],[0,0,0,1,1,0,1,1]);return O(U,U,c),w(U[0],U[1])}};i([l({clonable:!1})],T.prototype,"coords",null),i([l({type:d})],T.prototype,"bottomLeft",void 0),i([l({type:d})],T.prototype,"bottomRight",void 0),i([l({type:d})],T.prototype,"topLeft",void 0),i([l({type:d})],T.prototype,"topRight",void 0),T=i([R("esri.layers.support.CornersGeoreference")],T);const Ot=T;let B=class extends Y{constructor(e){super(e),this.extent=null,this.rotation=0,this.type="extent-and-rotation"}get coords(){if(this.extent==null)return null;const{xmin:e,ymin:t,xmax:n,ymax:o,spatialReference:r}=this.extent;let s;if(this.rotation){const{x:a,y:c}=this.extent.center,u=ie(a,c,this.rotation);s=[u(e,t),u(e,o),u(n,o),u(n,t)],s.push(s[0])}else s=[[e,t],[e,o],[n,o],[n,t],[e,t]];return new ce({rings:[s],spatialReference:r})}set coords(e){if(e==null||this.extent==null)return;const t=this.extent.spatialReference;if(e=this.projectOrWarn(e,t),e?.extent==null)return;const{rings:[[n,o,r]],extent:{center:{x:s,y:a}}}=e,c=Xe(Math.PI/2-Math.atan2(o[1]-n[1],o[0]-n[0])),u=ie(s,a,-c),[h,y]=u(n[0],n[1]),[g,I]=u(r[0],r[1]);this.extent=new ue({xmin:h,ymin:y,xmax:g,ymax:I,spatialReference:t}),this.rotation=c}toSourceNormalized(e){const{extent:t,rotation:n}=this;if(e==null||t==null)return null;const{xmin:o,ymin:r,xmax:s,ymax:a,center:c,spatialReference:u}=t;e=e.normalize();const h=q(e,u).geometry;if(h==null)return null;let y=h.x,g=h.y;return n&&([y,g]=ie(c.x,c.y,-n)(y,g)),w(fe(y,o,s,0,1),fe(g,a,r,0,1))}};function ie(e,t,n){const o=vt(n),r=Math.cos(o),s=Math.sin(o);return(a,c)=>[r*(a-e)+s*(c-t)+e,r*(c-t)-s*(a-e)+t]}i([l({clonable:!1})],B.prototype,"coords",null),i([l({type:ue})],B.prototype,"extent",void 0),i([l({type:Number})],B.prototype,"rotation",void 0),B=i([R("esri.layers.support.ExtentAndRotationGeoreference")],B);const St=B;function Et(e){return e?.type==="media"}function Me(e,t){const n=Ze(t);return Et(e)&&!!e.portalItem&&n!=null&&n>F.PORTAL_ITEM}function Mt(e,t,n){if(!e||e.type==="control-points")return e;const{coords:o}=e;if(o?.rings[0]?.length!==5)return null;const[r,s,a,c]=o.rings[0],{spatialReference:u}=o;return new X({controlPoints:[{mapPoint:new d({x:r[0],y:r[1],spatialReference:u}),sourcePoint:w(0,n)},{mapPoint:new d({x:s[0],y:s[1],spatialReference:u}),sourcePoint:w(0,0)},{mapPoint:new d({x:a[0],y:a[1],spatialReference:u}),sourcePoint:w(t,0)},{mapPoint:new d({x:c[0],y:c[1],spatialReference:u}),sourcePoint:w(t,n)}],width:t,height:n})}function Le(e,t,n){return{enabled:!Me(n?.layer,n?.origin),ignoreOrigin:!0}}const je={json:{name:"url",type:String,write:{overridePolicy:Le}}},Te={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:Le}}},Lt={types:{key:"type",base:Y,typeMap:{"control-points":X,corners:Ot,"extent-and-rotation":St}},json:{types:{key:"type",base:Y,typeMap:{"control-points":X}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};let $=class extends We(Se(Re)){constructor(e){super(e),this.georeference=null,this.opacity=1}readGeoreference(e){return X.fromJSON(e)}writeGeoreference(e,t,n,o){const r=o?.resources?.pendingOperations,s=()=>{const a=Mt(this.georeference,this.contentWidth,this.contentHeight);if(a){if(e.type!=="control-points"&&W.getLogger(this).warn(`only georeference of type 'control-points' may be persisted. The georeference of type '${e.type}' has been automatically converted.`),a.controlPoints?.length!==4&&o?.messages)return void o.messages.push(new x("property:unsupported","only 'control-points' georeference with 4 control points may be persisted."));t[n]=a.write({},o)}};if(e.type!=="control-points"&&!this.loaded&&r)return t[n]={},void r.push(this.load().then(s));s()}get contentWidth(){return 0}get contentHeight(){return 0}toSource(e){const{georeference:t,contentWidth:n,contentHeight:o}=this;if(e==null||t==null||n===0||o===0)return null;const r=t.toSourceNormalized(e);return r==null?null:(r.x*=n,r.y*=o,r)}};i([l(Lt)],$.prototype,"georeference",void 0),i([K("georeference")],$.prototype,"readGeoreference",null),i([Z("georeference")],$.prototype,"writeGeoreference",null),i([l({json:{read:!1,write:!1}})],$.prototype,"opacity",void 0),$=i([R("esri.layers.support.MediaElementBase")],$);const me=$;let P=class extends me{constructor(e){super(e),this.animationOptions=null,this.content=null,this.image=null,this.type="image",this.image=null}load(){const e=this.image;if(typeof e=="string"){const t=yt(e).then(n=>{this._set("content",n)});this.addResolvingPromise(t)}else if(e instanceof HTMLImageElement){const t=e.decode().then(()=>{this._set("content",e)});this.addResolvingPromise(t)}else e?this._set("content",e):this.addResolvingPromise(Promise.reject(new x("image-element:invalid-image-type","Invalid image type",{image:e})));return Promise.resolve(this)}get contentWidth(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalWidth:this.content.width}get contentHeight(){return this.content==null?0:this.content instanceof HTMLImageElement?this.content.naturalHeight:this.content.height}readImage(e,t,n){return Qe(t.url,n)}writeImage(e,t,n,o){if(e==null)return;const r=o?.portalItem,s=o?.resources;if(!r||!s)return void(typeof e=="string"&&(t[n]=ye(e,o)));const a=jt(e)?e:null;if(a){if(be(a)==null)return void(t[n]=a);const c=ye(a,{...o,verifyItemRelativeUrls:o?.verifyItemRelativeUrls?{writtenUrls:o.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},et.NO);if(r&&c&&!Ie(c))return s.toKeep.push({resource:r.resourceFromPath(c),compress:!1}),void(t[n]=c)}t[n]="",s.pendingOperations.push(Tt(e).then(c=>{const u=Ht(c,r);t[n]=u.itemRelativeUrl,s.toAdd.push({resource:u,content:{type:"blob",blob:c},compress:!1,finish:h=>{this.image=h.url}})}))}};i([l()],P.prototype,"animationOptions",void 0),i([l({readOnly:!0})],P.prototype,"content",void 0),i([l({readOnly:!0})],P.prototype,"contentWidth",null),i([l({readOnly:!0})],P.prototype,"contentHeight",null),i([l(je)],P.prototype,"image",void 0),i([K("image",["url"])],P.prototype,"readImage",null),i([Z("image")],P.prototype,"writeImage",null),i([l(Te)],P.prototype,"type",void 0),P=i([R("esri.layers.support.ImageElement")],P);const Ce=P;function jt(e){return typeof e=="string"&&!pe(e)&&!de(e)}async function Tt(e){return typeof e=="string"?pe(e)?tt(e):(await Oe(e,{responseType:"blob"})).data:new Promise(t=>Ct(e).toBlob(t))}function Ct(e){if(e instanceof HTMLCanvasElement)return e;const t=e instanceof HTMLImageElement?e.naturalWidth:e.width,n=e instanceof HTMLImageElement?e.naturalHeight:e.height,o=document.createElement("canvas"),r=o.getContext("2d");return o.width=t,o.height=n,e instanceof HTMLImageElement?r.drawImage(e,0,0,e.width,e.height):e instanceof ImageData&&r.putImageData(e,0,0),o}function Ht(e,t){const n=gt(),o=`${nt("media",n)}.${Pt({type:"blob",blob:e})}`;return t.resourceFromPath(o)}let _=class extends me{constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video"}load(){const e=this.video;return typeof e=="string"?this.addResolvingPromise(this._preProcessVideoUrl(e).then(t=>{const n=document.createElement("video");return n.src=t,n.crossOrigin="anonymous",n.autoplay=!0,n.muted=!0,n.loop=!0,n.playsInline=!0,this._loadVideo(n).then(()=>{this._set("content",n)})})):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then(()=>{this._set("content",e)})):this.addResolvingPromise(Promise.reject(new x("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}set video(e){this.loadStatus==="not-loaded"?this._set("video",e):W.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,n,o){if(!e)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source is missing")));const r=$t(e)?e:null;if(!r)return void(o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source must be an absolute url")));!Ie(r)&&o?.blockedRelativeUrls&&o.blockedRelativeUrls.push(r);const s=ot(r);be(s)?o?.messages&&o.messages.push(new x("video-element:unsupported-video","video source cannot be an item resource")):t[n]=s}async _preProcessVideoUrl(e){if(rt(e))return ge(e);try{return await Oe(e,{method:"head"}),e}catch{return ge(e,!0)}}_loadVideo(e){return new Promise((t,n)=>{const o=it(e,"canplay",()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,n):t()});this.addHandles(o,"canplay"),e.crossOrigin!=="anonymous"&&(e.crossOrigin="anonymous",de(e.src)||(e.src=e.src))})}};i([l()],_.prototype,"autoplay",void 0),i([l({readOnly:!0})],_.prototype,"content",void 0),i([l({readOnly:!0})],_.prototype,"contentWidth",null),i([l({readOnly:!0})],_.prototype,"contentHeight",null),i([l(je)],_.prototype,"video",null),i([Z("video")],_.prototype,"writeVideo",null),i([l(Te)],_.prototype,"type",void 0),_=i([R("esri.layers.support.VideoElement")],_);const He=_;function $t(e){return typeof e=="string"&&!pe(e)&&!de(e)}const Nt={key:"type",defaultKeyValue:"image",base:me,typeMap:{image:Ce,video:He}},xe=ne.ofType(Nt);let G=class extends Re.LoadableMixin(Be(Ge.EventedAccessor)){constructor(e){super(e),this._index=new wt,this._elementViewsMap=new Map,this._elementsIndexes=new Map,this._elementsChangedHandler=t=>{for(const o of t.removed){const r=this._elementViewsMap.get(o);this._elementViewsMap.delete(o),this._index.delete(r),this.removeHandles(r),r.destroy(),this.notifyChange("fullExtent")}const{spatialReference:n}=this;for(const o of t.added){if(this._elementViewsMap.get(o))continue;const r=new pt({spatialReference:n,element:o});this._elementViewsMap.set(o,r);const s=ze(()=>r.coords,()=>this._updateIndexForElement(r,!1));this._updateIndexForElement(r,!0),this.addHandles(s,r)}this._elementsIndexes.clear(),this.elements.forEach((o,r)=>this._elementsIndexes.set(o,r)),this.emit("refresh")},this.elements=new xe}async load(e){if(Ue(e),!this.spatialReference){const t=this.elements.find(n=>n.georeference?.coords!=null);this._set("spatialReference",t?t.georeference.coords.spatialReference:ae.WGS84)}return this._elementsChangedHandler({added:this.elements.items,removed:[]}),this.addHandles(this.elements.on("change",this._elementsChangedHandler)),this}destroy(){this._index.clear(),this._elementViewsMap.clear(),this._elementsIndexes.clear()}set elements(e){this._set("elements",De(e,this._get("elements"),xe))}get fullExtent(){if(this.loadStatus==="not-loaded")return null;const e=this._index.fullBounds;return e==null?null:new ue({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:this.spatialReference})}set spatialReference(e){this.loadStatus==="not-loaded"?this._set("spatialReference",e):W.getLogger(this).error("#spatialReference","spatialReference cannot be changed after the source is loaded.")}async queryElements(e,t){await this.load(),await mt(e.spatialReference,this.spatialReference,null,t);const n=Je(e.spatialReference,this.spatialReference)?e:ft(e,this.spatialReference);if(!n)return[];const o=n.normalize(),r=[];for(const s of o)this._index.forEachInBounds(ke(s),({normalizedCoords:a,element:c})=>{a!=null&&Fe(s,a)&&r.push(c)});return r.sort((s,a)=>this._elementsIndexes.get(s)-this._elementsIndexes.get(a)),r}hasElement(e){return this.elements.includes(e)}_updateIndexForElement(e,t){const n=e.normalizedBounds,o=this._index.has(e),r=n!=null;this._index.delete(e),r&&this._index.set(e,n),this.notifyChange("fullExtent"),t||(o!==r?this.emit("refresh"):this.emit("change",{element:e.element}))}};i([l()],G.prototype,"elements",null),i([l({readOnly:!0})],G.prototype,"fullExtent",null),i([l()],G.prototype,"spatialReference",null),G=i([R("esri.layers.support.LocalMediaElementSource")],G);const D=G;function le(e){return typeof e=="object"&&e!=null&&"type"in e}function $e(e){return le(e)&&(e.type==="image"||e.type==="video")}let m=class extends lt(ut(at(ct(Se(st))))){constructor(e){super(e),this.effectiveSource=null,this.georeference=null,this.copyright=null,this.operationalLayerType="MediaLayer",this.spatialReference=null,this.type="media",this._debouncedSaveOperations=Ke(async(t,n,o)=>{const{save:r,saveAs:s}=await Ve(()=>import("./mediaLayerUtils-CasWezAG-xuUSkW-V.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]),import.meta.url);switch(t){case ee.SAVE:return r(this,n);case ee.SAVE_AS:return s(this,o,n)}}),this.source=new D}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){await this.loadFromPortal({supportedTypes:["Media Layer"]},e);let t=this.source;if(!t)throw new x("media-layer:source-missing","Set 'MediaLayer.source' before loading the layer.");const n=this._getSourceOverride(t,this.georeference);n&&(this.setAtOrigin("source",n,"web-map"),this.setAtOrigin("source",n,"web-scene"),t=n);const o=le(t)?new D({elements:new ne([t])}):t;this._set("effectiveSource",o),this.spatialReference&&(o.spatialReference=this.spatialReference),await o.load(e),this.spatialReference=o.spatialReference}destroy(){this.effectiveSource?.destroy(),this.effectiveSource!==this.source&&this.source?.destroy()}readGeoreference(e,t){return e&&"itemId"in t&&t.itemId?e:void 0}get fullExtent(){return this.loaded?this.effectiveSource.fullExtent:null}set source(e){this.loadStatus!=="loaded"&&this.loadStatus!=="failed"?this._set("source",e):W.getLogger(this).error("#source","source cannot be changed after the layer is loaded.")}castSource(e){return e?Array.isArray(e)?new D({elements:new ne(e)}):e instanceof ne?new D({elements:e}):e:null}readSource(e,t,n){if("itemId"in t&&t.itemId)return;const o=this._createSource(t);return o?.read(t,n),o}writeSource(e,t,n,o){if(e&&e instanceof D){const r=e.elements.length;if(r!==1)return void(o?.messages&&o.messages.push(new x("media-layer:unsupported-source",`local media element source can only be persisted if it contains exactly one ImageElement, but it has ${r}.`)));e=e.elements.at(0)}$e(e)?e.write(t,o):o?.messages&&(e?o.messages.push(new x("media-layer:unsupported-source","only media elements of type 'ImageElement' or 'VideoElement' can be persisted")):o.messages.push(new x("media-layer:unsupported-source","the media layer is missing a source")))}async save(e){return this._debouncedSaveOperations(ee.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(ee.SAVE_AS,t,e)}_createSource(e){if("mediaType"in e)switch(e.mediaType){case"image":return new Ce;case"video":return new He}return null}_getSourceOverride(e,t){if(le(e)&&this.originIdOf("source")===F.PORTAL_ITEM&&t&&(this.originIdOf("georeference")===F.WEB_MAP||this.originIdOf("georeference")===F.WEB_SCENE)){const n=e.toJSON(),o=this._createSource(n);return o.read({...n},{origin:"portal-item"}),o.read({georeference:t},{origin:"web-map"}),o.read({georeference:t},{origin:"web-scene"}),o}return null}};i([l({readOnly:!0})],m.prototype,"effectiveSource",void 0),i([l({readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!0}}}})],m.prototype,"georeference",void 0),i([K("web-document","georeference")],m.prototype,"readGeoreference",null),i([l({type:String})],m.prototype,"copyright",void 0),i([l({readOnly:!0})],m.prototype,"fullExtent",null),i([l({type:["MediaLayer"]})],m.prototype,"operationalLayerType",void 0),i([l({type:["show","hide"]})],m.prototype,"listMode",void 0),i([l({nonNullable:!0,json:{write:{enabled:!0,allowNull:!1,target:{url:{type:String},mediaType:{type:["image","video"]},georeference:{type:X}},overridePolicy(e,t,n){return{enabled:!0,allowNull:!1,ignoreOrigin:Me(this,n?.origin)&&$e(e)&&!!e.georeference&&e.originIdOf("georeference")>F.PORTAL_ITEM}}}}})],m.prototype,"source",null),i([qe("source")],m.prototype,"castSource",null),i([K("source",["url"])],m.prototype,"readSource",null),i([Z("source")],m.prototype,"writeSource",null),i([l()],m.prototype,"spatialReference",void 0),i([l({readOnly:!0})],m.prototype,"type",void 0),m=i([R("esri.layers.MediaLayer")],m);const wn=m;export{wn as default}; diff --git a/custom-toc-highlight/assets/MediaLayerInteraction-BecfG-sO-CDwMElaJ.js b/custom-toc-highlight/assets/MediaLayerInteraction-BecfG-sO-CDwMElaJ.js deleted file mode 100644 index 006f484b..00000000 --- a/custom-toc-highlight/assets/MediaLayerInteraction-BecfG-sO-CDwMElaJ.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingTools-BZ3yVmXf-C2YZAZMV.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-BfX8CRfG.js","./story-D5JOvNzl.css","./vec2-tHZ6OaOy-xCj1obDt.js","./common-CYWrYyJl-E8-sukrT.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./enums-CpSG_SL3-BMD3Tb1v.js","./projectVectorToVector-sIYLNlex-B_PqSyiH.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./projectPointToVector-B2UUY9SE-BChPjj6-.js","./projection-BA9M1R7d-BYoCXVXt.js","./elevationInfoUtils-mOZsPH2J-If61I1du.js","./ElevationInfo-yv2-9tj6-C2hC6Vpl.js","./lengthUtils-DKpMe5qR-C2NPRwwl.js","./vec32-D9GsKZ1t-BjayBdwt.js","./UpdatingHandles-CUu3u1ms-CruZWJRY.js","./GraphicsLayer-DfeGaYc1-BYhO2Zs8.js","./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js","./Layer-ChoECxvZ-CQTFmFQa.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./BlendLayer-D1WkSmwP-Bad8_eoW.js","./jsonUtils-wIllKWI4-DrGIvCCq.js","./parser-DyDJ-rlI-C9jRH52J.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-DVqdGrVU.js","./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js","./geodesicUtils-B8mFUfTk-DkviSp9u.js","./geometryEngine-CdPoFSE4-zj0NdzY3.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-BIb5_ysY.js","./Tile-D75RMC64-Dj1SOP3K.js","./TileKey-C5IL-JBr-CJMvJ-lJ.js","./QueueProcessor-DbfV9fLy-CxiRQqTa.js","./workers-PiCjreoO-idkDTJa3.js","./ReactiveMap-CFk6jPfN-Du1XE-2a.js","./signal-CETehA7D-DhpyJ8yp.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./Query-BrwMGK8U-DoFNfkjX.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./MapView-BGOJJ8ch-DcHA1w96.js","./Cyclical-C_9rKUUQ-Dl9v9oo8.js","./CollectionFlattener-DkHuHn5E-BKutaakg.js","./TileInfo-CWIRDhZl-BkCC-9e9.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-3_GiOEs2.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Map-1zd11DKO-D2wK6924.js","./Basemap-BEqqSTw9-B5O9ub1-.js","./loadAll-e978YItg-CdtGGDtb.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./writeUtils-D5qlLkwk-xd5TEmf9.js","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./TablesMixin-C8RojhYs-AdFcW_TR.js","./HeightModelInfo-C5vFqzyF-CupKpfDx.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-9sQxfkoa-KicvrT8N.js","./utils-Bq23Xwmj--_SaacS5.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DQCcMKpm.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-hC4XzHg_.js","./imageUtils-BA2D6Uf1-DgLNtmEY.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-9-gg6ENz.js","./ColorBackground-gVZldRLm-C2pKGijH.js","./quat-BODLR7mS-BrXZAXDf.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./ReactiveSet-QxEZenFW-DlICHtLT.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./plane-Dt8R0KeE-CVSP2GQG.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./sphere-BenPORjV-DaZ5Vv8x.js","./MeshTransform-C--IG09w-DoQndDth.js","./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js","./MeshLocalVertexSpace-BqgocsoS-Dycut332.js","./earcut-XDcq3zAf-BcwyrT7l.js","./triangle-hqU-Tc1X-DLjOhwz3.js","./lineSegment-CcqvCARM-CF4YE8GC.js","./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js","./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js","./cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js","./utils-SPbpQbmm-B3hR8LxB.js","./drapedUtils-BZ1SGPtE-B2FavufJ.js","./colorUtils-Cthpxcks-ZRnr1H1b.js","./boundedPlane-DlvE0eNx-dpkNyaGh.js"])))=>i.map(i=>d[i]); -import{_ as u}from"./main-ugzBrWNm.js";import{j as v,bp as y,a2 as a,k1 as g,aL as l,k2 as f,v as r,S as n,i as T}from"./story-BfX8CRfG.js";import{i as w}from"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import{_ as d}from"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";const p={redo:"r",undo:"z"},m=Symbol(),h=Symbol(),c=Symbol();let i=class extends v{constructor(t){super(t),this._tool=null,this._updatingHandles=new w,this.enabled=!1,this._onPointerMove=y(async e=>{const o=await this._updatingHandles.addPromise(this._findElementAtScreenPoint(e));this.destroyed||(this.removeHandles(h),o&&o!==this.selectedElement&&(this.view.cursor="pointer",this.addHandles(a(()=>this.view.cursor=null),h)))})}initialize(){this.addHandles(g(this._updatingHandles)),this._updatingHandles.add(()=>this.enabled,t=>this._setEnabled(t),l),this._updatingHandles.add(()=>this._preferredInteractionTool,()=>this._preferredInteractionToolChanged())}get _validatedSelectedElement(){const t=this.selectedElement;if(!t)return null;const{layer:{source:e}}=this;return e?"hasElement"in e?e.hasElement(t)?t:null:e===t?t:null:null}get _preferredInteractionTool(){return this.options?.tool??"transform"}get updating(){return this._updatingHandles.updating}_setEnabled(t){if(this.removeHandles(m),!t)return;const{view:e}=this;this.addHandles([e.on("immediate-click",o=>this._onClick(o),d.TOOL),e.on("pointer-move",o=>this._onPointerMove(o).catch(()=>{}),d.TOOL),e.on("key-down",o=>{o.key===p.undo&&this._tool?.canUndo()&&(this._tool.undo(),o.stopPropagation()),o.key===p.redo&&this._tool?.canRedo()&&(this._tool.redo(),o.stopPropagation())}),this._updatingHandles.add(()=>this._validatedSelectedElement,o=>this._selectedElementChanged(o),l),a(()=>{e.cursor=null,this._removeTool()})],m)}async _findElementAtScreenPoint(t){const e=(await this.view.hitTest(t,{include:[this.layer]})).results[0];return e?.type==="media"?e.element:null}async _onClick(t){await this._updatingHandles.addPromise(t.async(async()=>{const e=await this._findElementAtScreenPoint(t);this.destroyed||(e&&t.stopPropagation(),this.selectedElement=e,this.selectedElement&&(this.view.cursor=null))}))}_preferredInteractionToolChanged(){const{_tool:t}=this;t&&(this._preferredInteractionTool===t.type||this._updatingHandles.addPromise(this._recreateTool()))}async _recreateTool(){this.removeHandles(c),this._removeTool();const t=this._validatedSelectedElement;if(!t)return;const e=new AbortController;this.addHandles(f(e),c);const{TransformTool:o,ControlPointsTransformTool:_}=await u(()=>import("./editingTools-BZ3yVmXf-C2YZAZMV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]),import.meta.url);if(e.signal.aborted)return;const{view:s}=this;switch(this._preferredInteractionTool){case"transform":this._tool=new o({target:t,view:s});break;case"reshape":this._tool=new _({mediaElement:t,view:s})}this.addHandles([a(()=>{this._tool&&(s.tools.remove(this._tool),this._tool=null)})],this._tool),s.addAndActivateTool(this._tool)}_removeTool(){this._tool&&this.removeHandles(this._tool)}async _selectedElementChanged(t){t?.georeference?await this._updatingHandles.addPromise(this._recreateTool()):this._removeTool()}};r([n()],i.prototype,"_validatedSelectedElement",null),r([n()],i.prototype,"_preferredInteractionTool",null),r([n({constructOnly:!0})],i.prototype,"view",void 0),r([n({constructOnly:!0})],i.prototype,"layer",void 0),r([n()],i.prototype,"selectedElement",void 0),r([n()],i.prototype,"enabled",void 0),r([n()],i.prototype,"options",void 0),r([n()],i.prototype,"updating",null),i=r([T("esri.views.2d.layers.support.MediaLayerInteraction")],i);export{i as MediaLayerInteraction}; diff --git a/custom-toc-highlight/assets/MediaLayerInteraction-BecfG-sO-CtX1hIb1.js b/custom-toc-highlight/assets/MediaLayerInteraction-BecfG-sO-CtX1hIb1.js new file mode 100644 index 00000000..67f00896 --- /dev/null +++ b/custom-toc-highlight/assets/MediaLayerInteraction-BecfG-sO-CtX1hIb1.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingTools-BZ3yVmXf-C6oQif6A.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-Doly9N9p.js","./story-DbFhYdqg.css","./vec2-tHZ6OaOy-xCj1obDt.js","./common-CYWrYyJl-E8-sukrT.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./enums-CpSG_SL3-BMD3Tb1v.js","./projectVectorToVector-sIYLNlex-DexDhaq1.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./projectPointToVector-B2UUY9SE-BIKNGLey.js","./projection-BA9M1R7d-CAbqHZiw.js","./elevationInfoUtils-mOZsPH2J-BlRQDLDN.js","./ElevationInfo-yv2-9tj6-CkIHeL1t.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js","./vec32-D9GsKZ1t-BPSFE14A.js","./UpdatingHandles-CUu3u1ms-DHvcjtvD.js","./GraphicsLayer-DfeGaYc1-DRpZ_f0G.js","./GraphicsCollection-CWTXNZOX-BdlDfR8M.js","./Layer-ChoECxvZ-BmDHBjO8.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./BlendLayer-D1WkSmwP-BeUsb4u9.js","./jsonUtils-wIllKWI4-MQQ-E5fj.js","./parser-DyDJ-rlI-CvOs11Ip.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-6clJxb1Q.js","./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js","./geodesicUtils-B8mFUfTk-BNOCxMeb.js","./geometryEngine-CdPoFSE4-ChEr_3ja.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-McBHp1Y5.js","./Tile-D75RMC64-g8Sx5TPr.js","./TileKey-C5IL-JBr-BGwa3-Dg.js","./QueueProcessor-DbfV9fLy-2F5OgLgJ.js","./workers-PiCjreoO-Dc6Tqm-o.js","./ReactiveMap-CFk6jPfN-CSefy1PZ.js","./signal-CETehA7D-DQA5V72u.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./Query-BrwMGK8U-BPr0_G9t.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./MapView-BGOJJ8ch-CJtpe3RS.js","./Cyclical-C_9rKUUQ-DyGueJyk.js","./CollectionFlattener-DkHuHn5E-dp3hDI2N.js","./TileInfo-CWIRDhZl-RqA7tkOZ.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-DGrOr3vp.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Map-1zd11DKO-Bme1mjOQ.js","./Basemap-BEqqSTw9-yGsB1EL7.js","./loadAll-e978YItg-4pMG3qU7.js","./PortalItem-CctGdnxF-CfFOGshS.js","./writeUtils-D5qlLkwk-enZap9KW.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./TablesMixin-C8RojhYs-LCBvmsnP.js","./HeightModelInfo-C5vFqzyF-BH6aliHn.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DriQgzLZ.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-Dk2JyWCy.js","./imageUtils-BA2D6Uf1-CYx0DlwL.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-BDyz4v43.js","./ColorBackground-gVZldRLm-Dca2T4QI.js","./quat-BODLR7mS-BQk2dgMZ.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./ReactiveSet-QxEZenFW-tC7C9rTp.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./plane-Dt8R0KeE-Bqc6oVGz.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./sphere-BenPORjV-B4uz1SYF.js","./MeshTransform-C--IG09w-Bbqagf1g.js","./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js","./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js","./earcut-XDcq3zAf-BcwyrT7l.js","./triangle-hqU-Tc1X-CaBFJROi.js","./lineSegment-CcqvCARM-CDEWcAzV.js","./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js","./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js","./cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js","./utils-SPbpQbmm-CiwW7WzR.js","./drapedUtils-BZ1SGPtE-bBUh2hex.js","./colorUtils-Cthpxcks-cHaMZbaf.js","./boundedPlane-DlvE0eNx-BQ9Xop25.js"])))=>i.map(i=>d[i]); +import{_ as u}from"./main-QGPoLsvl.js";import{j as v,bp as y,a2 as a,k1 as g,aL as l,k2 as f,v as r,S as n,i as T}from"./story-Doly9N9p.js";import{i as w}from"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import{_ as d}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";const p={redo:"r",undo:"z"},m=Symbol(),h=Symbol(),c=Symbol();let i=class extends v{constructor(t){super(t),this._tool=null,this._updatingHandles=new w,this.enabled=!1,this._onPointerMove=y(async e=>{const o=await this._updatingHandles.addPromise(this._findElementAtScreenPoint(e));this.destroyed||(this.removeHandles(h),o&&o!==this.selectedElement&&(this.view.cursor="pointer",this.addHandles(a(()=>this.view.cursor=null),h)))})}initialize(){this.addHandles(g(this._updatingHandles)),this._updatingHandles.add(()=>this.enabled,t=>this._setEnabled(t),l),this._updatingHandles.add(()=>this._preferredInteractionTool,()=>this._preferredInteractionToolChanged())}get _validatedSelectedElement(){const t=this.selectedElement;if(!t)return null;const{layer:{source:e}}=this;return e?"hasElement"in e?e.hasElement(t)?t:null:e===t?t:null:null}get _preferredInteractionTool(){return this.options?.tool??"transform"}get updating(){return this._updatingHandles.updating}_setEnabled(t){if(this.removeHandles(m),!t)return;const{view:e}=this;this.addHandles([e.on("immediate-click",o=>this._onClick(o),d.TOOL),e.on("pointer-move",o=>this._onPointerMove(o).catch(()=>{}),d.TOOL),e.on("key-down",o=>{o.key===p.undo&&this._tool?.canUndo()&&(this._tool.undo(),o.stopPropagation()),o.key===p.redo&&this._tool?.canRedo()&&(this._tool.redo(),o.stopPropagation())}),this._updatingHandles.add(()=>this._validatedSelectedElement,o=>this._selectedElementChanged(o),l),a(()=>{e.cursor=null,this._removeTool()})],m)}async _findElementAtScreenPoint(t){const e=(await this.view.hitTest(t,{include:[this.layer]})).results[0];return e?.type==="media"?e.element:null}async _onClick(t){await this._updatingHandles.addPromise(t.async(async()=>{const e=await this._findElementAtScreenPoint(t);this.destroyed||(e&&t.stopPropagation(),this.selectedElement=e,this.selectedElement&&(this.view.cursor=null))}))}_preferredInteractionToolChanged(){const{_tool:t}=this;t&&(this._preferredInteractionTool===t.type||this._updatingHandles.addPromise(this._recreateTool()))}async _recreateTool(){this.removeHandles(c),this._removeTool();const t=this._validatedSelectedElement;if(!t)return;const e=new AbortController;this.addHandles(f(e),c);const{TransformTool:o,ControlPointsTransformTool:_}=await u(()=>import("./editingTools-BZ3yVmXf-C6oQif6A.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97]),import.meta.url);if(e.signal.aborted)return;const{view:s}=this;switch(this._preferredInteractionTool){case"transform":this._tool=new o({target:t,view:s});break;case"reshape":this._tool=new _({mediaElement:t,view:s})}this.addHandles([a(()=>{this._tool&&(s.tools.remove(this._tool),this._tool=null)})],this._tool),s.addAndActivateTool(this._tool)}_removeTool(){this._tool&&this.removeHandles(this._tool)}async _selectedElementChanged(t){t?.georeference?await this._updatingHandles.addPromise(this._recreateTool()):this._removeTool()}};r([n()],i.prototype,"_validatedSelectedElement",null),r([n()],i.prototype,"_preferredInteractionTool",null),r([n({constructOnly:!0})],i.prototype,"view",void 0),r([n({constructOnly:!0})],i.prototype,"layer",void 0),r([n()],i.prototype,"selectedElement",void 0),r([n()],i.prototype,"enabled",void 0),r([n()],i.prototype,"options",void 0),r([n()],i.prototype,"updating",null),i=r([T("esri.views.2d.layers.support.MediaLayerInteraction")],i);export{i as MediaLayerInteraction}; diff --git a/custom-toc-highlight/assets/MediaLayerView2D-COWFkA3m-_gATxPeF.js b/custom-toc-highlight/assets/MediaLayerView2D-COWFkA3m-B8oTarjg.js similarity index 63% rename from custom-toc-highlight/assets/MediaLayerView2D-COWFkA3m-_gATxPeF.js rename to custom-toc-highlight/assets/MediaLayerView2D-COWFkA3m-B8oTarjg.js index 24a91f1f..92f60656 100644 --- a/custom-toc-highlight/assets/MediaLayerView2D-COWFkA3m-_gATxPeF.js +++ b/custom-toc-highlight/assets/MediaLayerView2D-COWFkA3m-B8oTarjg.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MediaLayerInteraction-BecfG-sO-CDwMElaJ.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-BfX8CRfG.js","./story-D5JOvNzl.css","./UpdatingHandles-CUu3u1ms-CruZWJRY.js","./MapView-BGOJJ8ch-DcHA1w96.js","./Cyclical-C_9rKUUQ-Dl9v9oo8.js","./CollectionFlattener-DkHuHn5E-BKutaakg.js","./workers-PiCjreoO-idkDTJa3.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./TileInfo-CWIRDhZl-BkCC-9e9.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-3_GiOEs2.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./signal-CETehA7D-DhpyJ8yp.js","./Map-1zd11DKO-D2wK6924.js","./Basemap-BEqqSTw9-B5O9ub1-.js","./loadAll-e978YItg-CdtGGDtb.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./writeUtils-D5qlLkwk-xd5TEmf9.js","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-DVqdGrVU.js","./common-CYWrYyJl-E8-sukrT.js","./TablesMixin-C8RojhYs-AdFcW_TR.js","./Layer-ChoECxvZ-CQTFmFQa.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js","./HeightModelInfo-C5vFqzyF-CupKpfDx.js","./ReactiveMap-CFk6jPfN-Du1XE-2a.js","./Query-BrwMGK8U-DoFNfkjX.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec2-tHZ6OaOy-xCj1obDt.js","./Tile-D75RMC64-Dj1SOP3K.js","./TileKey-C5IL-JBr-CJMvJ-lJ.js","./QueueProcessor-DbfV9fLy-CxiRQqTa.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-9sQxfkoa-KicvrT8N.js","./utils-Bq23Xwmj--_SaacS5.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DQCcMKpm.js","./vec32-D9GsKZ1t-BjayBdwt.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-hC4XzHg_.js","./imageUtils-BA2D6Uf1-DgLNtmEY.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-9-gg6ENz.js","./ColorBackground-gVZldRLm-C2pKGijH.js"])))=>i.map(i=>d[i]); -import{_ as D}from"./main-ugzBrWNm.js";import{v as l,S as p,i as b,ag as I,ah as h,ax as E,ai as L,b4 as W,aU as Q,a1 as T,n as j,an as $,o as F,bh as B,jb as Z,au as Y,aL as g,hT as U,aF as N,L as R,j as X}from"./story-BfX8CRfG.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{o as G,M as J}from"./perspectiveUtils-Bu88xlbg-DGihQXe_.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import{c as V}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import{T as K}from"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{H as ee,V as H}from"./Texture-BCt2hphT-hC4XzHg_.js";import{G as te}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-nIA27cle.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./PieChartMeshWriter-C5yLDFwp-CqRHPq7x.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-DBs2wvPw.js";import"./GraphicsView2D-C4wYE2ut-DMrrhOCh.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import{$ as ie,a as re}from"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import{n as se}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as ne}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as oe}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{T as ae}from"./utils-Dcs650Ic--a87iok1.js";import{A as le}from"./OverlayContainer-BEHcBpu0-DjERf_U-.js";import{X as me,Y as pe}from"./LayerView-Bish-E63-rB2WUWF4.js";import{i as he}from"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./TurboLine-CIlsAy5m-Cxo-QeJ4.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./grouping-RwmXkHDc-Binxobs4.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";const O=[1,1],c=se(),de={none:V.None,loop:V.Loop,oscillate:V.Oscillate};function ce(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?de[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}let ue=class extends K{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=oe(),this._handles=new Y,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._handles.add([h(()=>this.elementView.element.opacity,t=>this.opacity=t,g),h(()=>[this.elementView.coords],()=>{this.requestRender()},g),h(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this._handles.remove("play"),this.texture=U(this.texture),this.requestRender()},g),N(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&t.content!=null&&(this._handles.add([R(t.content,"play",()=>this.requestRender()),R(t.content,"loadeddata",()=>this.requestRender()),R(t.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in t.content?t.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([R(t.content,"seeked",()=>this.requestRender())]),this.requestRender())},g)]),e.element.load().catch(t=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:e,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=U(this.texture)}get textureSize(){return O}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,i=this.elementView.element.content;if(i!=null){const r=i instanceof HTMLImageElement,s=i instanceof HTMLVideoElement,a=r?i.naturalWidth:s?i.videoWidth:i.width,n=r?i.naturalHeight:s?i.videoHeight:i.height;if(this._updatePerspectiveTransform(a,n),this.texture)s&&(this.texture.setData(i),this.texture.generateMipmap(),"requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender());else{const o=new ee;if(o.wrapMode=te.CLAMP_TO_EDGE,o.preMultiplyAlpha=!0,o.width=a,o.height=n,"getFrame"in i){const f=d=>{this.texture?this.texture.setData(d):this.texture=new H(t,o,d),this.requestRender()};"animationOptions"in this.elementView.element&&this._handles.add(ae(i,ce(this.elementView.element.animationOptions),null,f),"play")}else this.texture=new H(t,o,i);this.texture.generateMipmap(),s&&("requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender())}}super.beforeRender(e)}_createTransforms(){return null}draw(e,t){this.isReady&&this.texture!=null?t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:O,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._indices}):this.requestRender()}updateDrawCoords(e,t,i,r){const{coords:s,bounds:a}=this.elementView;if(s==null||a==null)return;const[n,o,f,d]=s.rings[0],k=this._vertices,{x:_,y:v}=e;k.set([o[0]-_,o[1]-v,n[0]-_,n[1]-v,f[0]-_,f[1]-v,d[0]-_,d[1]-v]);let w=t;if(r){const[q,,C]=a,{worldWidth:S,xBounds:z}=r,[A,M]=z;qA?w=S:C>M&&q{let t=class extends e{constructor(...i){super(...i),this.layer=null,this.interactive=!1,this.interactionOptions=new x,this.selectedElement=null}};return l([p()],t.prototype,"layer",void 0),l([p()],t.prototype,"interactive",void 0),l([p()],t.prototype,"interactionOptions",void 0),l([p()],t.prototype,"selectedElement",void 0),t=l([b("esri.views.layers.MediaLayerView")],t),t};let y=class extends me(ye(pe)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new I}initialize(){this.addHandles([h(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await D(()=>import("./MediaLayerInteraction-BecfG-sO-CDwMElaJ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58]),import.meta.url);this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},E),h(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},E),h(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},E)])}attach(){this.addAttachHandles([L(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),L(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new le,this.container.addChild(this._overlayContainer),this._fetchQueue=new ie({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:he.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new re({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y];for(const{elementView:{normalizedCoords:a,element:n}}of this._elementReferences.values())a!=null&&W(a.rings,s)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new fe(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},t=>{Q(t)||T.getLogger(this).error(t)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(i==null)return[];this.view.featuresTilingScheme.getTileBounds(m,e,!0);const r=new j({xmin:m[0],ymin:m[1],xmax:m[2],ymax:m[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(this.layer.source!=null)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){$(this._elementReferences,t.uid,()=>{const i=new G({element:t,spatialReference:this.view.spatialReference}),r=new ue(i);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(s=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:t,error:s}))})),{debugGraphic:null,elementView:i,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.elementView.normalizedCoords;if(r==null)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],a=[];for(const n of this._tileStrategy.tiles){const o=P(this.view.featuresTilingScheme,n,r);t.tiles.has(n)?o||a.push(n):o&&s.push(n)}for(const n of s)this._referenceElement(n,e);for(const n of a)this._dereferenceElement(n,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new G({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(i!=null)for(const r of this._tileStrategy.tiles)P(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}};l([p()],y.prototype,"layer",void 0),l([p({readOnly:!0})],y.prototype,"elements",void 0),y=l([b("esri.views.2d.layers.MediaLayerView2D")],y);const m=B(),u={xmin:0,ymin:0,xmax:0,ymax:0};function P(e,t,i){return e.getTileBounds(m,t.key,!0),u.xmin=m[0],u.ymin=m[1],u.xmax=m[2],u.ymax=m[3],Z(u,i)}class fe{constructor(t){this.key=t,this.elements=null,this.isReady=!1,this.visible=!0}setElements(t){const i=[],r=new Set(this.elements);this.elements=t;for(const s of t)r.has(s)?r.delete(s):i.push(s);return this.isReady=!0,[i,Array.from(r)]}destroy(){}}const Hi=y;export{Hi as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MediaLayerInteraction-BecfG-sO-CtX1hIb1.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-Doly9N9p.js","./story-DbFhYdqg.css","./UpdatingHandles-CUu3u1ms-DHvcjtvD.js","./MapView-BGOJJ8ch-CJtpe3RS.js","./Cyclical-C_9rKUUQ-DyGueJyk.js","./CollectionFlattener-DkHuHn5E-dp3hDI2N.js","./workers-PiCjreoO-Dc6Tqm-o.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./TileInfo-CWIRDhZl-RqA7tkOZ.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-DGrOr3vp.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./signal-CETehA7D-DQA5V72u.js","./Map-1zd11DKO-Bme1mjOQ.js","./Basemap-BEqqSTw9-yGsB1EL7.js","./loadAll-e978YItg-4pMG3qU7.js","./PortalItem-CctGdnxF-CfFOGshS.js","./writeUtils-D5qlLkwk-enZap9KW.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-6clJxb1Q.js","./common-CYWrYyJl-E8-sukrT.js","./TablesMixin-C8RojhYs-LCBvmsnP.js","./Layer-ChoECxvZ-BmDHBjO8.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./GraphicsCollection-CWTXNZOX-BdlDfR8M.js","./HeightModelInfo-C5vFqzyF-BH6aliHn.js","./ReactiveMap-CFk6jPfN-CSefy1PZ.js","./Query-BrwMGK8U-BPr0_G9t.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec2-tHZ6OaOy-xCj1obDt.js","./Tile-D75RMC64-g8Sx5TPr.js","./TileKey-C5IL-JBr-BGwa3-Dg.js","./QueueProcessor-DbfV9fLy-2F5OgLgJ.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DriQgzLZ.js","./vec32-D9GsKZ1t-BPSFE14A.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-Dk2JyWCy.js","./imageUtils-BA2D6Uf1-CYx0DlwL.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-BDyz4v43.js","./ColorBackground-gVZldRLm-Dca2T4QI.js"])))=>i.map(i=>d[i]); +import{_ as D}from"./main-QGPoLsvl.js";import{v as l,S as p,i as b,ag as I,ah as h,ax as E,ai as L,b4 as W,aU as Q,a1 as T,n as j,an as $,o as F,bh as B,jb as Z,au as Y,aL as g,hT as U,aF as N,L as R,j as X}from"./story-Doly9N9p.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{o as G,M as J}from"./perspectiveUtils-Bu88xlbg-Cn6YpKwC.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import{c as V}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import{T as K}from"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{H as ee,V as H}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{G as te}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-BeEFXp4m.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./PieChartMeshWriter-C5yLDFwp-5CAejpYY.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-BwcxFsN9.js";import"./GraphicsView2D-C4wYE2ut-DdVMjjMv.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import{$ as ie,a as re}from"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import{n as se}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as ne}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as oe}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{T as ae}from"./utils-Dcs650Ic-LHpLlTO1.js";import{A as le}from"./OverlayContainer-BEHcBpu0-4o7Hmqgb.js";import{X as me,Y as pe}from"./LayerView-Bish-E63-DK1SFHE3.js";import{i as he}from"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./TurboLine-CIlsAy5m-C6Kc2De-.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./grouping-RwmXkHDc-CCFLL7L_.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";const O=[1,1],c=se(),de={none:V.None,loop:V.Loop,oscillate:V.Oscillate};function ce(e){return e?{type:"CIMAnimatedSymbolProperties",...e,playAnimation:e.playing,repeatType:e.repeatType?de[e.repeatType]:void 0}:{type:"CIMAnimatedSymbolProperties"}}let ue=class extends K{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.wrapAroundShift=0,this.perspectiveTransform=oe(),this._handles=new Y,this._vertices=new Float32Array(8),this._indices=new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]),this._handles.add([h(()=>this.elementView.element.opacity,t=>this.opacity=t,g),h(()=>[this.elementView.coords],()=>{this.requestRender()},g),h(()=>["animationOptions"in this.elementView.element&&this.elementView.element.animationOptions],()=>{this._handles.remove("play"),this.texture=U(this.texture),this.requestRender()},g),N(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&t.content!=null&&(this._handles.add([R(t.content,"play",()=>this.requestRender()),R(t.content,"loadeddata",()=>this.requestRender()),R(t.content,"loaded",()=>this.requestRender())]),"requestVideoFrameCallback"in t.content?t.content.requestVideoFrameCallback(()=>this.requestRender()):this._handles.add([R(t.content,"seeked",()=>this.requestRender())]),this.requestRender())},g)]),e.element.load().catch(t=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:e,error:t}))})}getMesh(e){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=U(this.texture)}get textureSize(){return O}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,i=this.elementView.element.content;if(i!=null){const r=i instanceof HTMLImageElement,s=i instanceof HTMLVideoElement,a=r?i.naturalWidth:s?i.videoWidth:i.width,n=r?i.naturalHeight:s?i.videoHeight:i.height;if(this._updatePerspectiveTransform(a,n),this.texture)s&&(this.texture.setData(i),this.texture.generateMipmap(),"requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender());else{const o=new ee;if(o.wrapMode=te.CLAMP_TO_EDGE,o.preMultiplyAlpha=!0,o.width=a,o.height=n,"getFrame"in i){const f=d=>{this.texture?this.texture.setData(d):this.texture=new H(t,o,d),this.requestRender()};"animationOptions"in this.elementView.element&&this._handles.add(ae(i,ce(this.elementView.element.animationOptions),null,f),"play")}else this.texture=new H(t,o,i);this.texture.generateMipmap(),s&&("requestVideoFrameCallback"in i?i.requestVideoFrameCallback(()=>this.requestRender()):i.paused||this.requestRender())}}super.beforeRender(e)}_createTransforms(){return null}draw(e,t){this.isReady&&this.texture!=null?t.render(e,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:O,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._indices}):this.requestRender()}updateDrawCoords(e,t,i,r){const{coords:s,bounds:a}=this.elementView;if(s==null||a==null)return;const[n,o,f,d]=s.rings[0],k=this._vertices,{x:_,y:v}=e;k.set([o[0]-_,o[1]-v,n[0]-_,n[1]-v,f[0]-_,f[1]-v,d[0]-_,d[1]-v]);let w=t;if(r){const[q,,C]=a,{worldWidth:S,xBounds:z}=r,[A,M]=z;qA?w=S:C>M&&q{let t=class extends e{constructor(...i){super(...i),this.layer=null,this.interactive=!1,this.interactionOptions=new x,this.selectedElement=null}};return l([p()],t.prototype,"layer",void 0),l([p()],t.prototype,"interactive",void 0),l([p()],t.prototype,"interactionOptions",void 0),l([p()],t.prototype,"selectedElement",void 0),t=l([b("esri.views.layers.MediaLayerView")],t),t};let y=class extends me(ye(pe)){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new I}initialize(){this.addHandles([h(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await D(()=>import("./MediaLayerInteraction-BecfG-sO-CtX1hIb1.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58]),import.meta.url);this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},E),h(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},E),h(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},E)])}attach(){this.addAttachHandles([L(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),L(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new le,this.container.addChild(this._overlayContainer),this._fetchQueue=new ie({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:he.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new re({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],r=e.normalize(),s=[r.x,r.y];for(const{elementView:{normalizedCoords:a,element:n}}of this._elementReferences.values())a!=null&&W(a.rings,s)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new fe(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,r]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,r),this.requestUpdate()},t=>{Q(t)||T.getLogger(this).error(t)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(i==null)return[];this.view.featuresTilingScheme.getTileBounds(m,e,!0);const r=new j({xmin:m[0],ymin:m[1],xmax:m[2],ymax:m[3],spatialReference:this.view.spatialReference});return i.queryElements(r,t)}_referenceElements(e,t){if(this.layer.source!=null)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){$(this._elementReferences,t.uid,()=>{const i=new G({element:t,spatialReference:this.view.spatialReference}),r=new ue(i);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(s=>{T.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new F("element-load-error","Element cannot be displayed",{element:t,error:s}))})),{debugGraphic:null,elementView:i,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const r=t.elementView.normalizedCoords;if(r==null)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],a=[];for(const n of this._tileStrategy.tiles){const o=P(this.view.featuresTilingScheme,n,r);t.tiles.has(n)?o||a.push(n):o&&s.push(n)}for(const n of s)this._referenceElement(n,e);for(const n of a)this._dereferenceElement(n,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new G({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(i!=null)for(const r of this._tileStrategy.tiles)P(this.view.featuresTilingScheme,r,i)&&this._referenceElement(r,e)}};l([p()],y.prototype,"layer",void 0),l([p({readOnly:!0})],y.prototype,"elements",void 0),y=l([b("esri.views.2d.layers.MediaLayerView2D")],y);const m=B(),u={xmin:0,ymin:0,xmax:0,ymax:0};function P(e,t,i){return e.getTileBounds(m,t.key,!0),u.xmin=m[0],u.ymin=m[1],u.xmax=m[2],u.ymax=m[3],Z(u,i)}class fe{constructor(t){this.key=t,this.elements=null,this.isReady=!1,this.visible=!0}setElements(t){const i=[],r=new Set(this.elements);this.elements=t;for(const s of t)r.has(s)?r.delete(s):i.push(s);return this.isReady=!0,[i,Array.from(r)]}destroy(){}}const Hi=y;export{Hi as default}; diff --git a/custom-toc-highlight/assets/MemorySourceWorker-C9E3Klf8-BjvMRwdY.js b/custom-toc-highlight/assets/MemorySourceWorker-C9E3Klf8-DZ295OVS.js similarity index 80% rename from custom-toc-highlight/assets/MemorySourceWorker-C9E3Klf8-BjvMRwdY.js rename to custom-toc-highlight/assets/MemorySourceWorker-C9E3Klf8-DZ295OVS.js index 02f0e3f0..8809c1e5 100644 --- a/custom-toc-highlight/assets/MemorySourceWorker-C9E3Klf8-BjvMRwdY.js +++ b/custom-toc-highlight/assets/MemorySourceWorker-C9E3Klf8-DZ295OVS.js @@ -1 +1 @@ -import{o as I,gT as Z,ck as $,cl as Q,bK as b,eS as S,c9 as v}from"./story-BfX8CRfG.js";import{A as O,j as A,k}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{r as C,i as P}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{I as G}from"./FeatureStore-Co2V0sVE-BwnfsIjJ.js";import{f as E,h as _}from"./queryUtils-Brxu6254-PPvpiP5X.js";import{Z as W}from"./QueryEngine-CH5uUhZK-BP95Dm56.js";import{f as z,d as H,A as L}from"./clientSideDefaults-BqqayPct-B-0mBem3.js";import{G as U,c as g,F as T,j,x as w}from"./sourceUtils-BMeqkJ5g-DxP4qerC.js";import{o as D}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{i as Y}from"./fieldType-CD2CL2hr-CMChCO5s.js";import"./main-ugzBrWNm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-BnCtocGj.js";import"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./WhereClause-DxwoyBMS-DnXKVpm2.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./utils-HtkT8Fn3-wUwu1nm1.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-BQ5pghrp.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./utils-tNxq3jkf-B78XlSIE.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./date-Cqvy-TgA-DIf-QFLz.js";const B=S,J={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:S},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:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0}};function N(h){return v(h)?h.z!=null:!!h.hasZ}function V(h){return v(h)?h.m!=null:!!h.hasM}class Je{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const r=[],{features:a}=e,n=this._inferLayerProperties(a,e.fields),l=e.fields||[],d=e.hasM!=null?e.hasM:!!n.hasM,c=e.hasZ!=null?e.hasZ:!!n.hasZ,p=!e.spatialReference&&!n.spatialReference,u=p?B:e.spatialReference||n.spatialReference,y=p?J:null,f=e.geometryType||n.geometryType,o=!f;let t=e.objectIdField||n.objectIdField,s=e.timeInfo;const m=new D(l);if(!o&&(p&&r.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!f))throw new I("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!t)throw new I("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&t!==n.objectIdField&&(r.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${t}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),t=n.objectIdField),t&&!n.objectIdField){const i=m.get(t);i?(t=i.name,i.type="esriFieldTypeOID",i.editable=!1,i.nullable=!1):l.unshift({alias:t,name:t,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const i of l){if(i.name==null&&(i.name=i.alias),i.alias==null&&(i.alias=i.name),!i.name)throw new I("feature-layer:invalid-field-name","field name is missing",{field:i});if(i.name===t&&(i.type="esriFieldTypeOID"),!Y.jsonValues.includes(i.type))throw new I("feature-layer:invalid-field-type",`invalid type for field "${i.name}"`,{field:i});i.length==null&&(i.length=Z(i))}const F={};for(const i of l)if(i.type!=="esriFieldTypeOID"&&i.type!=="esriFieldTypeGlobalID"){const q=$(i);q!==void 0&&(F[i.name]=q)}if(s){if(s.startTimeField){const i=m.get(s.startTimeField);i?(s.startTimeField=i.name,i.type="esriFieldTypeDate"):s.startTimeField=null}if(s.endTimeField){const i=m.get(s.endTimeField);i?(s.endTimeField=i.name,i.type="esriFieldTypeDate"):s.endTimeField=null}if(s.trackIdField){const i=m.get(s.trackIdField);i?s.trackIdField=i.name:(s.trackIdField=null,r.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:s}}))}s.startTimeField||s.endTimeField||(r.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:s}}),s=null)}const x=m.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??Q}:null;this._createDefaultAttributes=z(F,t);const R={warnings:r,featureErrors:[],layerDefinition:{...K,drawingInfo:H(f),templates:L(F),extent:y,geometryType:f,objectIdField:t,fields:l,hasZ:c,hasM:d,timeInfo:s,dateFieldsTimeReference:x},assignedObjectIds:{}};if(this._queryEngine=new W({fieldsIndex:D.fromLayerJSON({fields:l,timeInfo:s,dateFieldsTimeReference:x}),geometryType:f,hasM:d,hasZ:c,objectIdField:t,spatialReference:u,featureStore:new G({geometryType:f,hasM:d,hasZ:c}),timeInfo:s}),!a?.length)return this._nextObjectId=C,R;const M=P(t,a);return this._nextObjectId=M+1,await E(a,u),this._loadInitialFeatures(R,a)}async applyEdits(e){const{spatialReference:r,geometryType:a}=this._queryEngine;return await Promise.all([U(r,a),E(e.adds,r),E(e.updates,r)]),this._applyEdits(e)}queryFeatures(e,r={}){return this._queryEngine.executeQuery(e,r.signal)}queryFeatureCount(e,r={}){return this._queryEngine.executeQueryForCount(e,r.signal)}queryObjectIds(e,r={}){return this._queryEngine.executeQueryForIds(e,r.signal)}queryExtent(e,r={}){return this._queryEngine.executeQueryForExtent(e,r.signal)}querySnapping(e,r={}){return this._queryEngine.executeQueryForSnapping(e,r.signal)}_inferLayerProperties(e,r){let a,n,l=null,d=null,c=null;for(const p of e){const u=p.geometry;if(u!=null&&(l||(l=b(u)),d||(d=u.spatialReference),a==null&&(a=N(u)),n==null&&(n=V(u)),l&&d&&a!=null&&n!=null))break}if(r&&r.length){let p=null;r.some(u=>{const y=u.type==="esriFieldTypeOID",f=!u.type&&u.name&&u.name.toLowerCase()==="objectid";return p=u,y||f})&&(c=p.name)}return{geometryType:l,spatialReference:d,objectIdField:c,hasM:n,hasZ:a}}async _loadInitialFeatures(e,r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:c,featureStore:p,fieldsIndex:u}=this._queryEngine,y=[];for(const t of r){if(t.uid!=null&&(e.assignedObjectIds[t.uid]=-1),t.geometry&&a!==b(t.geometry)){e.featureErrors.push(g("Incorrect geometry type."));continue}const s=this._createDefaultAttributes(),m=T(u,s,t.attributes,!0);m?e.featureErrors.push(m):(this._assignObjectId(s,t.attributes,!0),t.attributes=s,t.uid!=null&&(e.assignedObjectIds[t.uid]=t.attributes[d]),t.geometry!=null&&(t.geometry=_(t.geometry,t.geometry.spatialReference,c)),y.push(t))}p.addMany(O([],y,a,l,n,d));const{fullExtent:f,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=f,o){const{start:t,end:s}=o;e.layerDefinition.timeInfo.timeExtent=[t,s]}return e}async _applyEdits(e){const{adds:r,updates:a,deletes:n}=e,l={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(r?.length&&this._applyAddEdits(l,r),a?.length&&this._applyUpdateEdits(l,a),n?.length){for(const p of n)l.deleteResults.push(j(p));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:d,timeExtent:c}=await this._queryEngine.fetchRecomputedExtents();return{extent:d,timeExtent:c,featureEditResults:l}}_applyAddEdits(e,r){const{addResults:a}=e,{geometryType:n,hasM:l,hasZ:d,objectIdField:c,spatialReference:p,featureStore:u,fieldsIndex:y}=this._queryEngine,f=[];for(const o of r){if(o.geometry&&n!==b(o.geometry)){a.push(g("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),s=T(y,t,o.attributes);if(s)a.push(s);else{if(this._assignObjectId(t,o.attributes),o.attributes=t,o.uid!=null){const m=o.attributes[c];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??p;o.geometry=_(w(o.geometry,m),m,p)}f.push(o),a.push(j(o.attributes[c]))}}u.addMany(O([],f,n,d,l,c))}_applyUpdateEdits({updateResults:e},r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:c,featureStore:p,fieldsIndex:u}=this._queryEngine;for(const y of r){const{attributes:f,geometry:o}=y,t=f?.[d];if(t==null){e.push(g(`Identifier field ${d} missing`));continue}if(!p.has(t)){e.push(g(`Feature with object id ${t} missing`));continue}const s=A(p.getFeature(t),a,l,n);if(o!=null){if(a!==b(o)){e.push(g("Incorrect geometry type."));continue}const m=o.spatialReference??c;s.geometry=_(w(o,m),m,c)}if(f){const m=T(u,s.attributes,f);if(m){e.push(m);continue}}p.add(k(s,a,l,n,d)),e.push(j(t))}}_assignObjectId(e,r,a=!1){const n=this._queryEngine.objectIdField;a&&r&&isFinite(r[n])?e[n]=r[n]:e[n]=this._nextObjectId++}}export{Je as default}; +import{o as I,gT as Z,ck as $,cl as Q,bK as b,eS as S,c9 as v}from"./story-Doly9N9p.js";import{A as O,j as A,k}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{r as C,i as P}from"./objectIdUtils-EszJVKSV-Bi133oF_.js";import{I as G}from"./FeatureStore-Co2V0sVE-BK6XAR3o.js";import{f as E,h as _}from"./queryUtils-Brxu6254-CDiE0zms.js";import{Z as W}from"./QueryEngine-CH5uUhZK-DRGPyg2C.js";import{f as z,d as H,A as L}from"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import{G as U,c as g,F as T,j,x as w}from"./sourceUtils-BMeqkJ5g-DcR3VPl5.js";import{o as D}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{i as Y}from"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./main-QGPoLsvl.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-CQrhMeDa.js";import"./PooledRBush-DbfAmeLn-CPHfm9op.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./utils-HtkT8Fn3-Dd_0rdy5.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-1ITtOELE.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./utils-tNxq3jkf-nfQcZo7O.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./date-Cqvy-TgA-DIf-QFLz.js";const B=S,J={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:S},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:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0,supportsQueryWithCacheHint:!0}};function N(h){return v(h)?h.z!=null:!!h.hasZ}function V(h){return v(h)?h.m!=null:!!h.hasM}class Je{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e){const r=[],{features:a}=e,n=this._inferLayerProperties(a,e.fields),l=e.fields||[],d=e.hasM!=null?e.hasM:!!n.hasM,c=e.hasZ!=null?e.hasZ:!!n.hasZ,p=!e.spatialReference&&!n.spatialReference,u=p?B:e.spatialReference||n.spatialReference,y=p?J:null,f=e.geometryType||n.geometryType,o=!f;let t=e.objectIdField||n.objectIdField,s=e.timeInfo;const m=new D(l);if(!o&&(p&&r.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!f))throw new I("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!t)throw new I("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(n.objectIdField&&t!==n.objectIdField&&(r.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${t}" doesn't match the field name "${n.objectIdField}", found in the provided fields`}),t=n.objectIdField),t&&!n.objectIdField){const i=m.get(t);i?(t=i.name,i.type="esriFieldTypeOID",i.editable=!1,i.nullable=!1):l.unshift({alias:t,name:t,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const i of l){if(i.name==null&&(i.name=i.alias),i.alias==null&&(i.alias=i.name),!i.name)throw new I("feature-layer:invalid-field-name","field name is missing",{field:i});if(i.name===t&&(i.type="esriFieldTypeOID"),!Y.jsonValues.includes(i.type))throw new I("feature-layer:invalid-field-type",`invalid type for field "${i.name}"`,{field:i});i.length==null&&(i.length=Z(i))}const F={};for(const i of l)if(i.type!=="esriFieldTypeOID"&&i.type!=="esriFieldTypeGlobalID"){const q=$(i);q!==void 0&&(F[i.name]=q)}if(s){if(s.startTimeField){const i=m.get(s.startTimeField);i?(s.startTimeField=i.name,i.type="esriFieldTypeDate"):s.startTimeField=null}if(s.endTimeField){const i=m.get(s.endTimeField);i?(s.endTimeField=i.name,i.type="esriFieldTypeDate"):s.endTimeField=null}if(s.trackIdField){const i=m.get(s.trackIdField);i?s.trackIdField=i.name:(s.trackIdField=null,r.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:s}}))}s.startTimeField||s.endTimeField||(r.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:s}}),s=null)}const x=m.dateFields.length?{timeZoneIANA:e.dateFieldsTimeZone??Q}:null;this._createDefaultAttributes=z(F,t);const R={warnings:r,featureErrors:[],layerDefinition:{...K,drawingInfo:H(f),templates:L(F),extent:y,geometryType:f,objectIdField:t,fields:l,hasZ:c,hasM:d,timeInfo:s,dateFieldsTimeReference:x},assignedObjectIds:{}};if(this._queryEngine=new W({fieldsIndex:D.fromLayerJSON({fields:l,timeInfo:s,dateFieldsTimeReference:x}),geometryType:f,hasM:d,hasZ:c,objectIdField:t,spatialReference:u,featureStore:new G({geometryType:f,hasM:d,hasZ:c}),timeInfo:s}),!a?.length)return this._nextObjectId=C,R;const M=P(t,a);return this._nextObjectId=M+1,await E(a,u),this._loadInitialFeatures(R,a)}async applyEdits(e){const{spatialReference:r,geometryType:a}=this._queryEngine;return await Promise.all([U(r,a),E(e.adds,r),E(e.updates,r)]),this._applyEdits(e)}queryFeatures(e,r={}){return this._queryEngine.executeQuery(e,r.signal)}queryFeatureCount(e,r={}){return this._queryEngine.executeQueryForCount(e,r.signal)}queryObjectIds(e,r={}){return this._queryEngine.executeQueryForIds(e,r.signal)}queryExtent(e,r={}){return this._queryEngine.executeQueryForExtent(e,r.signal)}querySnapping(e,r={}){return this._queryEngine.executeQueryForSnapping(e,r.signal)}_inferLayerProperties(e,r){let a,n,l=null,d=null,c=null;for(const p of e){const u=p.geometry;if(u!=null&&(l||(l=b(u)),d||(d=u.spatialReference),a==null&&(a=N(u)),n==null&&(n=V(u)),l&&d&&a!=null&&n!=null))break}if(r&&r.length){let p=null;r.some(u=>{const y=u.type==="esriFieldTypeOID",f=!u.type&&u.name&&u.name.toLowerCase()==="objectid";return p=u,y||f})&&(c=p.name)}return{geometryType:l,spatialReference:d,objectIdField:c,hasM:n,hasZ:a}}async _loadInitialFeatures(e,r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:c,featureStore:p,fieldsIndex:u}=this._queryEngine,y=[];for(const t of r){if(t.uid!=null&&(e.assignedObjectIds[t.uid]=-1),t.geometry&&a!==b(t.geometry)){e.featureErrors.push(g("Incorrect geometry type."));continue}const s=this._createDefaultAttributes(),m=T(u,s,t.attributes,!0);m?e.featureErrors.push(m):(this._assignObjectId(s,t.attributes,!0),t.attributes=s,t.uid!=null&&(e.assignedObjectIds[t.uid]=t.attributes[d]),t.geometry!=null&&(t.geometry=_(t.geometry,t.geometry.spatialReference,c)),y.push(t))}p.addMany(O([],y,a,l,n,d));const{fullExtent:f,timeExtent:o}=await this._queryEngine.fetchRecomputedExtents();if(e.layerDefinition.extent=f,o){const{start:t,end:s}=o;e.layerDefinition.timeInfo.timeExtent=[t,s]}return e}async _applyEdits(e){const{adds:r,updates:a,deletes:n}=e,l={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(r?.length&&this._applyAddEdits(l,r),a?.length&&this._applyUpdateEdits(l,a),n?.length){for(const p of n)l.deleteResults.push(j(p));this._queryEngine.featureStore.removeManyById(n)}const{fullExtent:d,timeExtent:c}=await this._queryEngine.fetchRecomputedExtents();return{extent:d,timeExtent:c,featureEditResults:l}}_applyAddEdits(e,r){const{addResults:a}=e,{geometryType:n,hasM:l,hasZ:d,objectIdField:c,spatialReference:p,featureStore:u,fieldsIndex:y}=this._queryEngine,f=[];for(const o of r){if(o.geometry&&n!==b(o.geometry)){a.push(g("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),s=T(y,t,o.attributes);if(s)a.push(s);else{if(this._assignObjectId(t,o.attributes),o.attributes=t,o.uid!=null){const m=o.attributes[c];e.uidToObjectId[o.uid]=m}if(o.geometry!=null){const m=o.geometry.spatialReference??p;o.geometry=_(w(o.geometry,m),m,p)}f.push(o),a.push(j(o.attributes[c]))}}u.addMany(O([],f,n,d,l,c))}_applyUpdateEdits({updateResults:e},r){const{geometryType:a,hasM:n,hasZ:l,objectIdField:d,spatialReference:c,featureStore:p,fieldsIndex:u}=this._queryEngine;for(const y of r){const{attributes:f,geometry:o}=y,t=f?.[d];if(t==null){e.push(g(`Identifier field ${d} missing`));continue}if(!p.has(t)){e.push(g(`Feature with object id ${t} missing`));continue}const s=A(p.getFeature(t),a,l,n);if(o!=null){if(a!==b(o)){e.push(g("Incorrect geometry type."));continue}const m=o.spatialReference??c;s.geometry=_(w(o,m),m,c)}if(f){const m=T(u,s.attributes,f);if(m){e.push(m);continue}}p.add(k(s,a,l,n,d)),e.push(j(t))}}_assignObjectId(e,r,a=!1){const n=this._queryEngine.objectIdField;a&&r&&isFinite(r[n])?e[n]=r[n]:e[n]=this._nextObjectId++}}export{Je as default}; diff --git a/custom-toc-highlight/assets/Mesh-DLzjDUIO-COeC-iS-.js b/custom-toc-highlight/assets/Mesh-DLzjDUIO-BwXS6N6_.js similarity index 92% rename from custom-toc-highlight/assets/Mesh-DLzjDUIO-COeC-iS-.js rename to custom-toc-highlight/assets/Mesh-DLzjDUIO-BwXS6N6_.js index 745a5f94..44e5f294 100644 --- a/custom-toc-highlight/assets/Mesh-DLzjDUIO-COeC-iS-.js +++ b/custom-toc-highlight/assets/Mesh-DLzjDUIO-BwXS6N6_.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loadGLTFMesh-C3-0Tu0H-B2ltp3ha.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./mat3-CC4Foazl-BWjyqE2v.js","./common-CYWrYyJl-E8-sukrT.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js","./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js","./vec32-D9GsKZ1t-BjayBdwt.js","./MeshLocalVertexSpace-BqgocsoS-Dycut332.js","./BufferView-PQoE3GL7-Duht5lAO.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec3-BazNroeq-PdcGTXFi.js","./vec4-DWDdg1fj-BagfV9qf.js","./types-ChhhI6OU-Cxh6dPlX.js","./loader-CkLCe-E_-QWQrU9Z8.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Version-CoKzbupV-9-gg6ENz.js","./mat4-DX7gBViE-DVqdGrVU.js","./quat-BODLR7mS-BrXZAXDf.js","./quatf64-C16JxGFv-BKWK1F8U.js","./resourceUtils-Ds65naCv-jCWWLIQy.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./DefaultMaterial_COLOR_GAMMA-D0o2czi9-9voYmtHA.js","./Indices-DEr2HrWx-BuNk6xPZ.js","./vertexSpaceConversion-CiKaVq_u-D2kQTb17.js","./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js","./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./projectPointToVector-B2UUY9SE-BChPjj6-.js","./projection-BA9M1R7d-BYoCXVXt.js","./MeshTransform-C--IG09w-DoQndDth.js","./imageUtils-BA2D6Uf1-DgLNtmEY.js","./earcut-XDcq3zAf-BcwyrT7l.js","./plane-Dt8R0KeE-CVSP2GQG.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./deduplicate-D2d-E5Pw-CQcmF3ab.js","./External-D_wl4XAw-P7VLSnKi.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./gltfexport-Dj6nF2RN-B_wJbbRp.js"])))=>i.map(i=>d[i]); -import{_ as Se}from"./main-ugzBrWNm.js";import{v as u,S as f,cS as Ut,ac as Pt,a0 as Wt,i as B,aa as Nt,ar as nt,ad as Pe,jh as Oe,aB as Bt,at as Ht,ah as zt,gU as Vt,ji as kt,jj as Re,w as O,hZ as Me,$ as xe,l as Gt,a_ as ot,bu as Zt,o as re,e as ve,dY as We,aO as _e,a1 as se,P as Te,jk as Yt,jl as qt,D as ae,i9 as L,dg as R,jm as Kt,jn as Ne,n as Xt,a5 as Jt,cy as Qt,bf as er,x as tr,aS as rr,aP as nr,ag as or,ai as sr,eI as ir,h_ as we,d as ar,bj as lr,p as cr,dh as ur,hl as pr}from"./story-BfX8CRfG.js";import{s as st,R as hr,V as ne,c as it,S as ue,Q as at}from"./MeshTransform-C--IG09w-DoQndDth.js";import{g as fr}from"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import{u as mr,o as pe,g as dr}from"./MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js";import{y as he,d as De}from"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import{m as gr,t as ie,x as fe,d as lt}from"./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js";import{m as yr}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{w as ct}from"./Indices-DEr2HrWx-BuNk6xPZ.js";import{r as xr,j as vr,Z as Le,l as wr,_ as me,Q as ut,Y as br,L as Tr}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{y as Ar,N as Sr,K as Rr}from"./plane-Dt8R0KeE-CVSP2GQG.js";import{v as Be}from"./deduplicate-D2d-E5Pw-CQcmF3ab.js";import{p as I}from"./projectPointToVector-B2UUY9SE-BChPjj6-.js";import{g as A,b as $e,Y as Mr,L as pt,a as ht,e as ft,c as mt,l as dt,o as gt,f as yt,M as P}from"./vertexSpaceConversion-CiKaVq_u-D2kQTb17.js";import{t as be}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{J as _r}from"./projection-BA9M1R7d-BYoCXVXt.js";import{x as Ee}from"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import{G as xt}from"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import{n as Dr}from"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import{b as He,P as Lr}from"./vec3-BazNroeq-PdcGTXFi.js";import{B as ze,T as $r,M as Cr}from"./External-D_wl4XAw-P7VLSnKi.js";import{n as vt}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{P as jr}from"./mat3-CC4Foazl-BWjyqE2v.js";import{t as wt,B as bt,$ as Tt,N as At,W as St,K as Fr}from"./mat4-DX7gBViE-DVqdGrVU.js";import{A as Or}from"./quat-BODLR7mS-BrXZAXDf.js";import{e as Er,n as Ir}from"./quatf64-C16JxGFv-BKWK1F8U.js";var k;const Ae=new WeakMap;let Ur=0,j=k=class extends ve{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:We(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const o={type:"canvas-element",imageData:Ve(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[n]=o}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:We(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else if(e instanceof ImageData){const o={type:"image-data",imageData:Ve(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=ke(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 ke(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{data:e,url:t}=this;return e instanceof HTMLCanvasElement?Ge(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?Ge(e):!(!t?.toLowerCase().endsWith(".png")&&!t?.toLocaleLowerCase().startsWith("data:image/png;"))}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):(Ae.has(this.data)||Ae.set(this.data,++Ur),t(Ae.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=this.url!=null?this.url.length:0,this.data!=null){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new k(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}}static from(e){return typeof e=="string"?new k({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new k({data:e}):_e(k,e)}};function Ve(e){let t="";for(let n=0;nMath.cos(lr(80))?L.Z:Math.abs(r[1])>Math.abs(r[0])?L.Y:L.X}function zr(e,t,n,r){const o=(i=>!Array.isArray(i[0]))(t)?(i,a)=>t[3*i+a]:(i,a)=>t[i][a],s=r?cr(r)/ur(r):1;return Rr(e,(i,a)=>me(i,o(a,0)*s,o(a,1)*s,o(a,2)),n)}const Ye=Ar();function Vr(e){const t=Gr(e.rings,e.hasZ,de.CCW_IS_HOLE,e.spatialReference),n=new Array;let r=0,o=0;for(const a of t.polygons){const c=a.count,l=a.index,h=Yt(t.position,3*l,3*c),m=a.holeIndices.map(d=>d-l),p=ct(yr(h,m,3));n.push({position:h,faces:p}),r+=h.length,o+=p.length}const s=kr(n,r,o),i=Array.isArray(s.position)?Be(s.position,3,{originalIndices:s.faces}):Be(s.position.buffer,6,{originalIndices:s.faces});return s.position=qt(new Float64Array(i.buffer)),s.faces=i.indices,s}function kr(e,t,n){if(e.length===1)return e[0];const r=Oe(t),o=new Array(n);let s=0,i=0,a=0;for(const c of e){for(let l=0;l=0;g--){const y=e[g],b=n===de.CCW_IS_HOLE&&Zr(y,t,r);if(b&&o!==1)s[l++]=y;else{let M=y.length;for(let x=0;x0&&(a[m++]={index:d,count:y.length}),d=b?le(y,y.length-1,-1,p,d,y.length,t):le(y,0,1,p,d,y.length,t);for(let x=0;x0&&(a[m++]={index:d,count:w.length}),d=le(w,0,1,p,d,w.length,t)}l=0,T.count>0&&(i[h++]=T)}}for(let g=0;g0&&(a[m++]={index:d,count:y.length}),d=le(y,0,1,p,d,y.length,t)}return i.length=h,a.length=m,{position:p,polygons:i,outlines:a}}function le(e,t,n,r,o,s,i){o*=3;for(let a=0;ase.getLogger("esri.geometry.support.meshUtils.centerAt");function Yr(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,o=n?.origin??e.origin,s=Ue(oe,r,o.spatialReference,n?.geographic);ie(r)?qr(e,t,o):s?Kr(e,t,o):Xr(e,t,o)}function qr(e,t,n){const{vertexSpace:r}=e;if(!ie(r))return;const o=Mt,s=Rt;if(!I(t,s,e.spatialReference))return void A(oe(),t.spatialReference,e.spatialReference,P);if(!I(n,o,e.spatialReference)){const a=e.origin;return o[0]=a.x,o[1]=a.y,o[2]=a.z,void A(oe(),n.spatialReference,e.spatialReference,P)}const i=xr(Qr,s,o);r.origin=vr(R(),r.origin,i)}function Kr(e,t,n){const r=Me(n.x,n.y,n.z??0),o=$e(e,new De({origin:r}));if(!o)return;const s=Me(t.x,t.y,t.z??0),i=$e({vertexAttributes:o,spatialReference:e.spatialReference,vertexSpace:new De({origin:s})},he.absolute);if(!i)return;const{position:a,normal:c,tangent:l}=i;e.vertexAttributes.position=a,e.vertexAttributes.normal=c,e.vertexAttributes.tangent=l,e.vertexAttributesChanged()}function Xr(e,t,n){const r=Mt,o=Rt;if(I(t,o,e.spatialReference)){if(!I(n,r,e.spatialReference)){const s=e.origin;return r[0]=s.x,r[1]=s.y,r[2]=s.z,void A(oe(),n.spatialReference,e.spatialReference,P)}Jr(e.vertexAttributes.position,o,r),e.vertexAttributesChanged()}else A(oe(),t.spatialReference,e.spatialReference,P)}function Jr(e,t,n){if(e)for(let r=0;rimport("./loadGLTFMesh-C3-0Tu0H-B2ltp3ha.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]),import.meta.url),n),s=await on(r,n);xe(n);const i=o(new O({x:0,y:0,z:0,spatialReference:e.spatialReference}),s.url,{resolveFile:nn(s),signal:n?.signal,expectedType:s.type,unitConversionDisabled:t.unitConversionDisabled});i.then(()=>s.dispose(),()=>s.dispose());const{vertexAttributes:a,components:c}=await i;e.vertexAttributes=a,e.components=c}function nn(e){const t=Jt(e.url);return n=>{const r=Qt(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return(o?e.files.get(o):null)??n}}async function on(e,t){if(Array.isArray(e)){if(!e.length)throw new re("mesh-load-external:missing-assets","There must be at least one file to load");return e[0]instanceof File?an(e):ln(e,t)}return _t(e)}async function sn(e,t){const{parts:n,assetMimeType:r,assetName:o}=e;if(n.length===1)return new ge(n[0].partUrl);const s=await e.toBlob(t);return xe(t),ge.fromBlob(s,jt(o,r))}function _t(e){return ge.fromBlob(e,jt(e.name,e.type))}function an(e){return $t(e.map(t=>({name:t.name,mimeType:t.type,source:_t(t)})))}async function ln(e,t){const n=await er(e.map(async r=>{const o=await sn(r);return xe(t),{name:r.assetName,mimeType:r.assetMimeType,source:o}}));if(tr(t))throw n.forEach(r=>r.source.dispose()),rr();return $t(n)}const Dt=/^model\/gltf\+json$/,Lt=/^model\/gltf-binary$/,Fe=/\.gltf$/i,cn=/\.glb$/i;function Ke({mimeType:e,source:t,name:n}){return Dt.test(e)||Fe.test(n)?{url:t.url,type:"gltf"}:Lt.test(e)||cn.test(n)?{url:t.url,type:"glb"}:null}function $t(e){const t=new Map;let n=null,r=null;for(const s of e){const{source:i,name:a}=s;n??=Ke(s),a==="ESRI3DO_NORM.glb"&&(r=Ke(s)),t.set(a,i.url),i.files.forEach((c,l)=>t.set(l,c))}const o=r??n;if(o==null)throw new re("mesh-load-external:missing-files","Missing files to load external mesh source");return new ge(o.url,()=>e.forEach(({source:s})=>s.dispose()),t,o.type)}let ge=class Ct{constructor(t,n=()=>{},r=new Map,o){this.url=t,this.dispose=n,this.files=r,this.type=o}static fromBlob(t,n){const r=URL.createObjectURL(t);return new Ct(r,()=>URL.revokeObjectURL(r),void 0,n)}};function jt(e,t){return Dt.test(t)||Fe.test(e)?"gltf":Lt.test(t)||Fe.test(e)?"glb":void 0}let E=class extends nr{constructor(e){super(e),this.externalSources=new or,this._explicitDisplaySource=null,this.georeferenced=!1,this.addHandles(sr(()=>this.externalSources,"after-remove",({item:t})=>{t===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!ze(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!$r(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>Cr(t,e))}get _implicitDisplaySource(){return this.externalSources.find(ze)}};u([f()],E.prototype,"externalSources",void 0),u([f()],E.prototype,"displaySource",null),u([f()],E.prototype,"_implicitDisplaySource",null),u([f()],E.prototype,"_explicitDisplaySource",void 0),u([f()],E.prototype,"georeferenced",void 0),E=u([B("esri.geometry.support.meshUtils.Metadata")],E);function un(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:n}=vn,r=4*e.length,o=new Float64Array(3*r),s=new Float32Array(3*r),i=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let c=0,l=0,h=0,m=0;for(let p=0;p=s&&h=4,y=p===2||p===4,b=d?t-1:t;for(let M=0;M<=b;M++){const T=M/b*2*Math.PI,x=d?0:.5;v[0]=x*Math.sin(T),v[1]=x*-Math.cos(T),v[2]=p<=2?.5:-.5;for(let w=0;w<3;w++)r[a++]=v[w],o[c++]=g?w===2?p<=1?1:-1:0:w===2?0:v[w]/x;s[l++]=(M+(d?.5:0))/t,s[l++]=p<=1?1*p/3:p<=3?1*(p-2)/3+1/3:1*(p-4)/3+2/3,y||p===0||M===t||(p!==5&&(i[h++]=m,i[h++]=m+1,i[h++]=m-t),p!==1&&(i[h++]=m,i[h++]=m-t,i[h++]=m-t-1)),m++}}return{position:r,normal:o,uv:s,faces:i}}function mn(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 dn(e){const t=X.facingAxisOrderSwap[e],n=X.position,r=X.normal,o=new Float64Array(n.length),s=new Float32Array(r.length);let i=0;for(let a=0;a<4;a++){const c=i;for(let l=0;l<3;l++){const h=t[l],m=Math.abs(h)-1,p=h>=0?1:-1;o[i]=n[c+m]*p,s[i]=r[c+m]*p,i++}}return{position:o,normal:s,uv:new Float32Array(X.uv),faces:new Uint32Array(X.faces),isPlane:!0}}const H=1,z=2,V=3,X={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:[V,H,z],west:[-V,-H,z],north:[-H,V,z],south:[H,-V,z],up:[H,z,V],down:[H,-z,-V]}};function ce(e,t,n){e.isPlane||gn(e),xn(e,yn(n?.size,n?.unit,t.spatialReference));const r=fe(t,n),o=t.spatialReference.isGeographic?fe(t):r,s=$e({vertexAttributes:e,vertexSpace:o,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new pe({...s,uv:e.uv}),vertexSpace:r,components:[new K({faces:e.faces,material:n?.material||null})],spatialReference:t.spatialReference}}function gn(e){for(let t=0;tse.getLogger("esri.geometry.support.meshUtils.rotate");function bn(e,t,n){if(!e.vertexAttributes?.position||t[3]===0)return;const{spatialReference:r,vertexSpace:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(W,o,r,i);lt(e)?Tn(e,t,s):a?An(e,t,s):Sn(e,t,s)}function Tn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=Z;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(W(),n.spatialReference,s,P);Or(et,ue(t),it(t));const m=wt(Xe,et,we,ir,h),{localMatrix:p}=o,d=bt(Xe,m,p);o.scale=Tt(R(),d),At(d,d,ut(Z,o.scale));const g=o.rotationAxis;o.rotation=at(d),o.rotationAngle===0&&(o.rotationAxis=g),o.translation=St(R(),d)}function An(e,t,n){const r=e.spatialReference,o=Ee(r),s=Ft;if(!I(n,s,o)&&(A(W(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(W(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;xt(o,s,ye,o),jr(Qe,ye);const p=Je;Le(ue(Je),ue(t),Qe),p[3]=t[3],ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(q(l,p,3,s),dt(l,o,i,r)&&(a==null||h==null||(q(h,p,3),gt(h,i,r,l,o,a)))&&(c==null||m==null||(q(m,p,4),yt(m,i,r,l,o,c)))?e.vertexAttributesChanged():A(W(),o,r)):A(W(),r,o)}function Sn(e,t,n){const r=Ft;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(W(),n.spatialReference,e.spatialReference,P)}q(e.vertexAttributes.position,t,3,r),q(e.vertexAttributes.normal,t,3),q(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}function q(e,t,n,r=we){if(e!=null){Fr(ye,it(t),ue(t));for(let o=0;ose.getLogger("esri.geometry.support.meshUtils.scale");function Rn(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(N,r,o,i);lt(e)?Mn(e,t,s):a?_n(e,t,s):Dn(e,t,s)}function Mn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=Y;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(N(),n.spatialReference,s,P);const m=me(Ln,t,t,t),p=wt(tt,Ir,we,m,h),{localMatrix:d}=o,g=bt(tt,p,d);o.scale=Tt(R(),g),At(g,g,ut(Y,o.scale));const y=o.rotationAxis;o.rotation=at(g),o.rotationAngle===0&&(o.rotationAxis=y),o.translation=St(R(),g)}function _n(e,t,n){const r=e.spatialReference,o=Ee(r),s=Et;if(!I(n,s,o)&&(A(N(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(N(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(Ot(l,t,s),dt(l,o,i,r)&&(a==null||h==null||gt(h,i,r,l,o,a))&&(c==null||m==null||yt(m,i,r,l,o,c))?e.vertexAttributesChanged():A(N(),o,r)):A(N(),r,o)}function Dn(e,t,n){const r=Et;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(N(),n.spatialReference,e.spatialReference,P)}Ot(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}function Ot(e,t,n=we){if(e)for(let r=0;r{this.addHandles(zt(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):this.metadata.displaySource?.extent!=null}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,n=this;return en({get transform(){return n.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return e.length===0||t?.length===0?Vt(kt):Re(e)}get origin(){const e=gr(this.vertexSpace,this.spatialReference);if(e!=null)return e;const{center:t,zmin:n}=this._transformedExtent;return new O({x:t.x,y:t.y,z:n,spatialReference:this.spatialReference})}get extent(){return this.loaded||this.metadata?.displaySource?.extent==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(K.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(t!==-1)return this.components.splice(t,1),void this.notifyChange("components")}C().error("removeComponent()",Nr)}}rotate(e,t,n,r){return hr(e,t,n,rt),bn(this,rt,r),this}offset(e,t,n){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:o}=this,s=o?.position;if(!s)return this;if(ie(r)){const[i,a,c]=r.origin;r.origin=Me(i+e,a+t,c+n)}else{for(let i=0;ia.cloneWithDeduplication(s,i))}const o={components:r,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:n?.preserveMetadata?this.metadata.clone():new E};return new D(o)}cloneShallow(){return new D({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([Se(()=>import("./gltfexport-Dj6nF2RN-B_wJbbRp.js"),__vite__mapDeps([44,1,2,3,4,24,7,25,6,11,15,30,5,23,20,31,32,33,34,35,10,12,16,13,14,17,21,26,27,36,37,9,38,29,39,40,8,41,42,43]),import.meta.url),this.load(e)]);return xe(e),await t(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,this.components!=null)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(C().error(e,Wr),!1)}static createBox(e,t){if(!(e instanceof O))return C().error(".createBox()",Q),null;const n=new D(ce(un(),e,t));return t?.imageFace&&t.imageFace!=="all"?pn(n,t.imageFace):n}static createSphere(e,t){return e instanceof O?new D(ce(hn(t?.densificationFactor||0),e,t)):(C().error(".createSphere()",Q),null)}static createCylinder(e,t){return e instanceof O?new D(ce(fn(t?.densificationFactor||0),e,t)):(C().error(".createCylinder()",Q),null)}static createPlane(e,t){if(!(e instanceof O))return C().error(".createPlane()",Q),null;const n=t?.facing??"up",r=mn(n,t?.size);return new D(ce(dn(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof Gt))return C().error(".createFromPolygon()",Br),null;const n=Vr(e);return new D({vertexAttributes:new pe({position:n.position}),components:[new K({faces:n.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new he})}static async createFromGLTF(e,t,n){if(!(e instanceof O)){const o=new Ze;throw C().error(".createfromGLTF()",o.message),o}const{loadGLTFMesh:r}=await ot(Se(()=>import("./loadGLTFMesh-C3-0Tu0H-B2ltp3ha.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]),import.meta.url),n);return new D(await r(e,t,n))}static async createFromFiles(e,t,n){Zt(C(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const r=o=>C().error(".createFromFiles()",o.message);if(!(e instanceof O)){const o=new Ze;throw r(o),o}if(!n?.layer)throw new re("invalid:no-layer","SceneLayer required for file to mesh conversion.");return n.layer.convertMesh(t,{location:e,...n})}static createWithExternalSource(e,t,n){const r=n?.extent??null,{spatialReference:o}=e,s=n?.transform?.clone()??new ne,i=fe(e,n),a=n?.unitConversionDisabled,c={source:t,extent:r,unitConversionDisabled:a},l=new E;return l.externalSources.push(c),new D({metadata:l,transform:s,vertexSpace:i,spatialReference:o})}static createIncomplete(e,t){const{spatialReference:n}=e,r=t?.transform?.clone()??new ne,o=fe(e,t),s=new D({transform:r,vertexSpace:o,spatialReference:n});return s.addResolvingPromise(Promise.reject(new re("mesh-incomplete","Mesh resources are not complete"))),s}};u([f({type:[K],json:{write:!0}})],S.prototype,"components",void 0),u([f({nonNullable:!0,types:$n,constructOnly:!0,json:{write:!0}})],S.prototype,"vertexSpace",void 0),u([f({type:ne,json:{write:!0}})],S.prototype,"transform",void 0),u([f({constructOnly:!0})],S.prototype,"metadata",void 0),u([f()],S.prototype,"hasExtent",null),u([f()],S.prototype,"_transformedExtent",null),u([f()],S.prototype,"_untransformedBounds",null),u([f()],S.prototype,"origin",null),u([f({readOnly:!0,json:{read:!1}})],S.prototype,"extent",null),u([f({readOnly:!0,json:{read:!1,write:!0,default:!0}})],S.prototype,"hasZ",void 0),u([f({readOnly:!0,json:{read:!1,write:!0,default:!1}})],S.prototype,"hasM",void 0),u([f({type:pe,nonNullable:!0,json:{write:!0}})],S.prototype,"vertexAttributes",void 0),S=D=u([B(It)],S);const rt=st(),no=S;export{no as F,ee as G,te as V,Pr as m,K as z}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loadGLTFMesh-C3-0Tu0H-DZasI2OI.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./mat3-CC4Foazl-BWjyqE2v.js","./common-CYWrYyJl-E8-sukrT.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./MeshVertexAttributes-CbNpPur2-c8zcl8rF.js","./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js","./vec32-D9GsKZ1t-BPSFE14A.js","./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js","./BufferView-PQoE3GL7-B9DLdqO9.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec3-BazNroeq-CRjQH4Pj.js","./vec4-DWDdg1fj-BHg6FqkT.js","./types-ChhhI6OU-Cxh6dPlX.js","./loader-CkLCe-E_-BkhKaKBj.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Version-CoKzbupV-BDyz4v43.js","./mat4-DX7gBViE-6clJxb1Q.js","./quat-BODLR7mS-BQk2dgMZ.js","./quatf64-C16JxGFv-BKWK1F8U.js","./resourceUtils-Ds65naCv-PY5SfRMU.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js","./DefaultMaterial_COLOR_GAMMA-D0o2czi9-k4xDAsKM.js","./Indices-DEr2HrWx-cFTwC5-9.js","./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js","./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./projectPointToVector-B2UUY9SE-BIKNGLey.js","./projection-BA9M1R7d-CAbqHZiw.js","./MeshTransform-C--IG09w-Bbqagf1g.js","./imageUtils-BA2D6Uf1-CYx0DlwL.js","./earcut-XDcq3zAf-BcwyrT7l.js","./plane-Dt8R0KeE-Bqc6oVGz.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./deduplicate-D2d-E5Pw-CTlujluz.js","./External-D_wl4XAw-DrOy4LUr.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./gltfexport-Dj6nF2RN-CAFBwudx.js"])))=>i.map(i=>d[i]); +import{_ as Se}from"./main-QGPoLsvl.js";import{v as u,S as f,cS as Ut,ac as Pt,a0 as Wt,i as B,aa as Nt,ar as nt,ad as Pe,jh as Oe,aB as Bt,at as Ht,ah as zt,gU as Vt,ji as kt,jj as Re,w as O,hZ as Me,$ as xe,l as Gt,a_ as ot,bu as Zt,o as re,e as ve,dY as We,aO as _e,a1 as se,P as Te,jk as Yt,jl as qt,D as ae,i9 as L,dg as R,jm as Kt,jn as Ne,n as Xt,a5 as Jt,cy as Qt,bf as er,x as tr,aS as rr,aP as nr,ag as or,ai as sr,eI as ir,h_ as we,d as ar,bj as lr,p as cr,dh as ur,hl as pr}from"./story-Doly9N9p.js";import{s as st,R as hr,V as ne,c as it,S as ue,Q as at}from"./MeshTransform-C--IG09w-Bbqagf1g.js";import{g as fr}from"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import{u as mr,o as pe,g as dr}from"./MeshVertexAttributes-CbNpPur2-c8zcl8rF.js";import{y as he,d as De}from"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import{m as gr,t as ie,x as fe,d as lt}from"./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js";import{m as yr}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{w as ct}from"./Indices-DEr2HrWx-cFTwC5-9.js";import{r as xr,j as vr,Z as Le,l as wr,_ as me,Q as ut,Y as br,L as Tr}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{y as Ar,N as Sr,K as Rr}from"./plane-Dt8R0KeE-Bqc6oVGz.js";import{v as Be}from"./deduplicate-D2d-E5Pw-CTlujluz.js";import{p as I}from"./projectPointToVector-B2UUY9SE-BIKNGLey.js";import{g as A,b as $e,Y as Mr,L as pt,a as ht,e as ft,c as mt,l as dt,o as gt,f as yt,M as P}from"./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js";import{t as be}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{J as _r}from"./projection-BA9M1R7d-CAbqHZiw.js";import{x as Ee}from"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import{G as xt}from"./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js";import{n as Dr}from"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import{b as He,P as Lr}from"./vec3-BazNroeq-CRjQH4Pj.js";import{B as ze,T as $r,M as Cr}from"./External-D_wl4XAw-DrOy4LUr.js";import{n as vt}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{P as jr}from"./mat3-CC4Foazl-BWjyqE2v.js";import{t as wt,B as bt,$ as Tt,N as At,W as St,K as Fr}from"./mat4-DX7gBViE-6clJxb1Q.js";import{A as Or}from"./quat-BODLR7mS-BQk2dgMZ.js";import{e as Er,n as Ir}from"./quatf64-C16JxGFv-BKWK1F8U.js";var k;const Ae=new WeakMap;let Ur=0,j=k=class extends ve{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:We(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const o={type:"canvas-element",imageData:Ve(e.getContext("2d").getImageData(0,0,e.width,e.height))};t[n]=o}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:We(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else if(e instanceof ImageData){const o={type:"image-data",imageData:Ve(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=ke(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 ke(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{data:e,url:t}=this;return e instanceof HTMLCanvasElement?Ge(e.getContext("2d").getImageData(0,0,e.width,e.height)):e instanceof ImageData?Ge(e):!(!t?.toLowerCase().endsWith(".png")&&!t?.toLocaleLowerCase().startsWith("data:image/png;"))}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):(Ae.has(this.data)||Ae.set(this.data,++Ur),t(Ae.get(this.data))):t()}get memoryUsage(){let e=0;if(e+=this.url!=null?this.url.length:0,this.data!=null){const t=this.data;"data"in t?e+=t.data.byteLength:t instanceof HTMLImageElement?e+=t.naturalWidth*t.naturalHeight*3:t instanceof HTMLCanvasElement&&(e+=t.width*t.height*3)}return e}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new k(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}}static from(e){return typeof e=="string"?new k({url:e}):e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageData||e instanceof HTMLVideoElement?new k({data:e}):_e(k,e)}};function Ve(e){let t="";for(let n=0;nMath.cos(lr(80))?L.Z:Math.abs(r[1])>Math.abs(r[0])?L.Y:L.X}function zr(e,t,n,r){const o=(i=>!Array.isArray(i[0]))(t)?(i,a)=>t[3*i+a]:(i,a)=>t[i][a],s=r?cr(r)/ur(r):1;return Rr(e,(i,a)=>me(i,o(a,0)*s,o(a,1)*s,o(a,2)),n)}const Ye=Ar();function Vr(e){const t=Gr(e.rings,e.hasZ,de.CCW_IS_HOLE,e.spatialReference),n=new Array;let r=0,o=0;for(const a of t.polygons){const c=a.count,l=a.index,h=Yt(t.position,3*l,3*c),m=a.holeIndices.map(d=>d-l),p=ct(yr(h,m,3));n.push({position:h,faces:p}),r+=h.length,o+=p.length}const s=kr(n,r,o),i=Array.isArray(s.position)?Be(s.position,3,{originalIndices:s.faces}):Be(s.position.buffer,6,{originalIndices:s.faces});return s.position=qt(new Float64Array(i.buffer)),s.faces=i.indices,s}function kr(e,t,n){if(e.length===1)return e[0];const r=Oe(t),o=new Array(n);let s=0,i=0,a=0;for(const c of e){for(let l=0;l=0;g--){const y=e[g],b=n===de.CCW_IS_HOLE&&Zr(y,t,r);if(b&&o!==1)s[l++]=y;else{let M=y.length;for(let x=0;x0&&(a[m++]={index:d,count:y.length}),d=b?le(y,y.length-1,-1,p,d,y.length,t):le(y,0,1,p,d,y.length,t);for(let x=0;x0&&(a[m++]={index:d,count:w.length}),d=le(w,0,1,p,d,w.length,t)}l=0,T.count>0&&(i[h++]=T)}}for(let g=0;g0&&(a[m++]={index:d,count:y.length}),d=le(y,0,1,p,d,y.length,t)}return i.length=h,a.length=m,{position:p,polygons:i,outlines:a}}function le(e,t,n,r,o,s,i){o*=3;for(let a=0;ase.getLogger("esri.geometry.support.meshUtils.centerAt");function Yr(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r}=e,o=n?.origin??e.origin,s=Ue(oe,r,o.spatialReference,n?.geographic);ie(r)?qr(e,t,o):s?Kr(e,t,o):Xr(e,t,o)}function qr(e,t,n){const{vertexSpace:r}=e;if(!ie(r))return;const o=Mt,s=Rt;if(!I(t,s,e.spatialReference))return void A(oe(),t.spatialReference,e.spatialReference,P);if(!I(n,o,e.spatialReference)){const a=e.origin;return o[0]=a.x,o[1]=a.y,o[2]=a.z,void A(oe(),n.spatialReference,e.spatialReference,P)}const i=xr(Qr,s,o);r.origin=vr(R(),r.origin,i)}function Kr(e,t,n){const r=Me(n.x,n.y,n.z??0),o=$e(e,new De({origin:r}));if(!o)return;const s=Me(t.x,t.y,t.z??0),i=$e({vertexAttributes:o,spatialReference:e.spatialReference,vertexSpace:new De({origin:s})},he.absolute);if(!i)return;const{position:a,normal:c,tangent:l}=i;e.vertexAttributes.position=a,e.vertexAttributes.normal=c,e.vertexAttributes.tangent=l,e.vertexAttributesChanged()}function Xr(e,t,n){const r=Mt,o=Rt;if(I(t,o,e.spatialReference)){if(!I(n,r,e.spatialReference)){const s=e.origin;return r[0]=s.x,r[1]=s.y,r[2]=s.z,void A(oe(),n.spatialReference,e.spatialReference,P)}Jr(e.vertexAttributes.position,o,r),e.vertexAttributesChanged()}else A(oe(),t.spatialReference,e.spatialReference,P)}function Jr(e,t,n){if(e)for(let r=0;rimport("./loadGLTFMesh-C3-0Tu0H-DZasI2OI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]),import.meta.url),n),s=await on(r,n);xe(n);const i=o(new O({x:0,y:0,z:0,spatialReference:e.spatialReference}),s.url,{resolveFile:nn(s),signal:n?.signal,expectedType:s.type,unitConversionDisabled:t.unitConversionDisabled});i.then(()=>s.dispose(),()=>s.dispose());const{vertexAttributes:a,components:c}=await i;e.vertexAttributes=a,e.components=c}function nn(e){const t=Jt(e.url);return n=>{const r=Qt(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return(o?e.files.get(o):null)??n}}async function on(e,t){if(Array.isArray(e)){if(!e.length)throw new re("mesh-load-external:missing-assets","There must be at least one file to load");return e[0]instanceof File?an(e):ln(e,t)}return _t(e)}async function sn(e,t){const{parts:n,assetMimeType:r,assetName:o}=e;if(n.length===1)return new ge(n[0].partUrl);const s=await e.toBlob(t);return xe(t),ge.fromBlob(s,jt(o,r))}function _t(e){return ge.fromBlob(e,jt(e.name,e.type))}function an(e){return $t(e.map(t=>({name:t.name,mimeType:t.type,source:_t(t)})))}async function ln(e,t){const n=await er(e.map(async r=>{const o=await sn(r);return xe(t),{name:r.assetName,mimeType:r.assetMimeType,source:o}}));if(tr(t))throw n.forEach(r=>r.source.dispose()),rr();return $t(n)}const Dt=/^model\/gltf\+json$/,Lt=/^model\/gltf-binary$/,Fe=/\.gltf$/i,cn=/\.glb$/i;function Ke({mimeType:e,source:t,name:n}){return Dt.test(e)||Fe.test(n)?{url:t.url,type:"gltf"}:Lt.test(e)||cn.test(n)?{url:t.url,type:"glb"}:null}function $t(e){const t=new Map;let n=null,r=null;for(const s of e){const{source:i,name:a}=s;n??=Ke(s),a==="ESRI3DO_NORM.glb"&&(r=Ke(s)),t.set(a,i.url),i.files.forEach((c,l)=>t.set(l,c))}const o=r??n;if(o==null)throw new re("mesh-load-external:missing-files","Missing files to load external mesh source");return new ge(o.url,()=>e.forEach(({source:s})=>s.dispose()),t,o.type)}let ge=class Ct{constructor(t,n=()=>{},r=new Map,o){this.url=t,this.dispose=n,this.files=r,this.type=o}static fromBlob(t,n){const r=URL.createObjectURL(t);return new Ct(r,()=>URL.revokeObjectURL(r),void 0,n)}};function jt(e,t){return Dt.test(t)||Fe.test(e)?"gltf":Lt.test(t)||Fe.test(e)?"glb":void 0}let E=class extends nr{constructor(e){super(e),this.externalSources=new or,this._explicitDisplaySource=null,this.georeferenced=!1,this.addHandles(sr(()=>this.externalSources,"after-remove",({item:t})=>{t===this._explicitDisplaySource&&(this._explicitDisplaySource=null)},{sync:!0,onListenerRemove:()=>this._explicitDisplaySource=null}))}get displaySource(){return this._explicitDisplaySource??this._implicitDisplaySource}set displaySource(e){if(e!=null&&!ze(e))throw new Error("Cannot use this source for display: it is not in a supported format.");this._explicitDisplaySource=e,e&&this.externalSources.every(t=>!$r(t,e))&&this.externalSources.add(e)}clearSources(){this.externalSources.removeAll()}getExternalSourcesOnService(e){return this.externalSources.items.filter(t=>Cr(t,e))}get _implicitDisplaySource(){return this.externalSources.find(ze)}};u([f()],E.prototype,"externalSources",void 0),u([f()],E.prototype,"displaySource",null),u([f()],E.prototype,"_implicitDisplaySource",null),u([f()],E.prototype,"_explicitDisplaySource",void 0),u([f()],E.prototype,"georeferenced",void 0),E=u([B("esri.geometry.support.meshUtils.Metadata")],E);function un(){const{faceDescriptions:e,faceVertexOffsets:t,uvScales:n}=vn,r=4*e.length,o=new Float64Array(3*r),s=new Float32Array(3*r),i=new Float32Array(2*r),a=new Uint32Array(2*e.length*3);let c=0,l=0,h=0,m=0;for(let p=0;p=s&&h=4,y=p===2||p===4,b=d?t-1:t;for(let M=0;M<=b;M++){const T=M/b*2*Math.PI,x=d?0:.5;v[0]=x*Math.sin(T),v[1]=x*-Math.cos(T),v[2]=p<=2?.5:-.5;for(let w=0;w<3;w++)r[a++]=v[w],o[c++]=g?w===2?p<=1?1:-1:0:w===2?0:v[w]/x;s[l++]=(M+(d?.5:0))/t,s[l++]=p<=1?1*p/3:p<=3?1*(p-2)/3+1/3:1*(p-4)/3+2/3,y||p===0||M===t||(p!==5&&(i[h++]=m,i[h++]=m+1,i[h++]=m-t),p!==1&&(i[h++]=m,i[h++]=m-t,i[h++]=m-t-1)),m++}}return{position:r,normal:o,uv:s,faces:i}}function mn(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 dn(e){const t=X.facingAxisOrderSwap[e],n=X.position,r=X.normal,o=new Float64Array(n.length),s=new Float32Array(r.length);let i=0;for(let a=0;a<4;a++){const c=i;for(let l=0;l<3;l++){const h=t[l],m=Math.abs(h)-1,p=h>=0?1:-1;o[i]=n[c+m]*p,s[i]=r[c+m]*p,i++}}return{position:o,normal:s,uv:new Float32Array(X.uv),faces:new Uint32Array(X.faces),isPlane:!0}}const H=1,z=2,V=3,X={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:[V,H,z],west:[-V,-H,z],north:[-H,V,z],south:[H,-V,z],up:[H,z,V],down:[H,-z,-V]}};function ce(e,t,n){e.isPlane||gn(e),xn(e,yn(n?.size,n?.unit,t.spatialReference));const r=fe(t,n),o=t.spatialReference.isGeographic?fe(t):r,s=$e({vertexAttributes:e,vertexSpace:o,spatialReference:t.spatialReference},r,{allowBufferReuse:!0});return{vertexAttributes:new pe({...s,uv:e.uv}),vertexSpace:r,components:[new K({faces:e.faces,material:n?.material||null})],spatialReference:t.spatialReference}}function gn(e){for(let t=0;tse.getLogger("esri.geometry.support.meshUtils.rotate");function bn(e,t,n){if(!e.vertexAttributes?.position||t[3]===0)return;const{spatialReference:r,vertexSpace:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(W,o,r,i);lt(e)?Tn(e,t,s):a?An(e,t,s):Sn(e,t,s)}function Tn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=Z;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(W(),n.spatialReference,s,P);Or(et,ue(t),it(t));const m=wt(Xe,et,we,ir,h),{localMatrix:p}=o,d=bt(Xe,m,p);o.scale=Tt(R(),d),At(d,d,ut(Z,o.scale));const g=o.rotationAxis;o.rotation=at(d),o.rotationAngle===0&&(o.rotationAxis=g),o.translation=St(R(),d)}function An(e,t,n){const r=e.spatialReference,o=Ee(r),s=Ft;if(!I(n,s,o)&&(A(W(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(W(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;xt(o,s,ye,o),jr(Qe,ye);const p=Je;Le(ue(Je),ue(t),Qe),p[3]=t[3],ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(q(l,p,3,s),dt(l,o,i,r)&&(a==null||h==null||(q(h,p,3),gt(h,i,r,l,o,a)))&&(c==null||m==null||(q(m,p,4),yt(m,i,r,l,o,c)))?e.vertexAttributesChanged():A(W(),o,r)):A(W(),r,o)}function Sn(e,t,n){const r=Ft;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(W(),n.spatialReference,e.spatialReference,P)}q(e.vertexAttributes.position,t,3,r),q(e.vertexAttributes.normal,t,3),q(e.vertexAttributes.tangent,t,4),e.vertexAttributesChanged()}function q(e,t,n,r=we){if(e!=null){Fr(ye,it(t),ue(t));for(let o=0;ose.getLogger("esri.geometry.support.meshUtils.scale");function Rn(e,t,n){if(!e.vertexAttributes?.position)return;const{vertexSpace:r,spatialReference:o}=e,s=n?.origin??e.origin,i=n?.geographic,a=Ue(N,r,o,i);lt(e)?Mn(e,t,s):a?_n(e,t,s):Dn(e,t,s)}function Mn(e,t,n){e.transform??=new ne;const{vertexSpace:r,transform:o,spatialReference:s}=e,[i,a,c]=r.origin,l=new O({x:i,y:a,z:c,spatialReference:s}),h=Y;if(l.equals(n))me(h,0,0,0);else if(!pt(h,n,e))return void A(N(),n.spatialReference,s,P);const m=me(Ln,t,t,t),p=wt(tt,Ir,we,m,h),{localMatrix:d}=o,g=bt(tt,p,d);o.scale=Tt(R(),g),At(g,g,ut(Y,o.scale));const y=o.rotationAxis;o.rotation=at(g),o.rotationAngle===0&&(o.rotationAxis=y),o.translation=St(R(),g)}function _n(e,t,n){const r=e.spatialReference,o=Ee(r),s=Et;if(!I(n,s,o)&&(A(N(),n.spatialReference,o,"Falling back to mesh origin"),!I(e.origin,s,o)))return void A(N(),e.origin.spatialReference,o);const i=e.vertexAttributes.position,a=e.vertexAttributes.normal,c=e.vertexAttributes.tangent,l=new Float64Array(i.length),h=a!=null?new Float32Array(a.length):null,m=c!=null?new Float32Array(c.length):null;ht(i,r,l,o)&&(a==null||h==null||ft(a,i,r,l,o,h))&&(c==null||m==null||mt(c,i,r,l,o,m))?(Ot(l,t,s),dt(l,o,i,r)&&(a==null||h==null||gt(h,i,r,l,o,a))&&(c==null||m==null||yt(m,i,r,l,o,c))?e.vertexAttributesChanged():A(N(),o,r)):A(N(),r,o)}function Dn(e,t,n){const r=Et;if(!I(n,r,e.spatialReference)){const o=e.origin;return r[0]=o.x,r[1]=o.y,r[2]=o.z,void A(N(),n.spatialReference,e.spatialReference,P)}Ot(e.vertexAttributes.position,t,r),e.vertexAttributesChanged()}function Ot(e,t,n=we){if(e)for(let r=0;r{this.addHandles(zt(()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map(e=>e.clone())}),()=>this._clearSources(),{once:!0,sync:!0}))})}get hasExtent(){return this.loaded?this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0):this.metadata.displaySource?.extent!=null}get _transformedExtent(){const{spatialReference:e,vertexSpace:t}=this,n=this;return en({get transform(){return n.transform},vertexSpace:t,spatialReference:e,untransformedBounds:this._untransformedBounds})}get _untransformedBounds(){const{vertexAttributes:{position:e},components:t}=this;return e.length===0||t?.length===0?Vt(kt):Re(e)}get origin(){const e=gr(this.vertexSpace,this.spatialReference);if(e!=null)return e;const{center:t,zmin:n}=this._transformedExtent;return new O({x:t.x,y:t.y,z:n,spatialReference:this.spatialReference})}get extent(){return this.loaded||this.metadata?.displaySource?.extent==null?this._transformedExtent:this.metadata.displaySource.extent.clone()}addComponent(e){this._checkIfLoaded("addComponent()")&&(this.components||(this.components=[]),this.components.push(K.from(e)),this.notifyChange("components"))}removeComponent(e){if(this._checkIfLoaded("removeComponent()")){if(this.components){const t=this.components.indexOf(e);if(t!==-1)return this.components.splice(t,1),void this.notifyChange("components")}C().error("removeComponent()",Nr)}}rotate(e,t,n,r){return hr(e,t,n,rt),bn(this,rt,r),this}offset(e,t,n){if(!this._checkIfLoaded("offset()"))return this;const{vertexSpace:r,vertexAttributes:o}=this,s=o?.position;if(!s)return this;if(ie(r)){const[i,a,c]=r.origin;r.origin=Me(i+e,a+t,c+n)}else{for(let i=0;ia.cloneWithDeduplication(s,i))}const o={components:r,spatialReference:this.spatialReference,vertexAttributes:e,vertexSpace:t,transform:this.transform?.clone()??null,metadata:n?.preserveMetadata?this.metadata.clone():new E};return new D(o)}cloneShallow(){return new D({components:this.components,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes,vertexSpace:this.vertexSpace.clone(),transform:this.transform,metadata:this.metadata})}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const[{toBinaryGLTF:t}]=await Promise.all([Se(()=>import("./gltfexport-Dj6nF2RN-CAFBwudx.js"),__vite__mapDeps([44,1,2,3,4,24,7,25,6,11,15,30,5,23,20,31,32,33,34,35,10,12,16,13,14,17,21,26,27,36,37,9,38,29,39,40,8,41,42,43]),import.meta.url),this.load(e)]);return xe(e),await t(this,e)}get memoryUsage(){let e=0;if(e+=this.vertexAttributes.memoryUsage,this.components!=null)for(const t of this.components)e+=t.memoryUsage;return e}_clearSources(){this.metadata.clearSources()}_checkIfLoaded(e){return!!this.loaded||(C().error(e,Wr),!1)}static createBox(e,t){if(!(e instanceof O))return C().error(".createBox()",Q),null;const n=new D(ce(un(),e,t));return t?.imageFace&&t.imageFace!=="all"?pn(n,t.imageFace):n}static createSphere(e,t){return e instanceof O?new D(ce(hn(t?.densificationFactor||0),e,t)):(C().error(".createSphere()",Q),null)}static createCylinder(e,t){return e instanceof O?new D(ce(fn(t?.densificationFactor||0),e,t)):(C().error(".createCylinder()",Q),null)}static createPlane(e,t){if(!(e instanceof O))return C().error(".createPlane()",Q),null;const n=t?.facing??"up",r=mn(n,t?.size);return new D(ce(dn(n),e,{...t,size:r}))}static createFromPolygon(e,t){if(!(e instanceof Gt))return C().error(".createFromPolygon()",Br),null;const n=Vr(e);return new D({vertexAttributes:new pe({position:n.position}),components:[new K({faces:n.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference,vertexSpace:new he})}static async createFromGLTF(e,t,n){if(!(e instanceof O)){const o=new Ze;throw C().error(".createfromGLTF()",o.message),o}const{loadGLTFMesh:r}=await ot(Se(()=>import("./loadGLTFMesh-C3-0Tu0H-DZasI2OI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]),import.meta.url),n);return new D(await r(e,t,n))}static async createFromFiles(e,t,n){Zt(C(),"`Mesh.createFromFiles` is deprecated in favor of 'SceneLayer.convertMesh'",{replacement:"SceneLayer.convertMesh",version:"4.29"});const r=o=>C().error(".createFromFiles()",o.message);if(!(e instanceof O)){const o=new Ze;throw r(o),o}if(!n?.layer)throw new re("invalid:no-layer","SceneLayer required for file to mesh conversion.");return n.layer.convertMesh(t,{location:e,...n})}static createWithExternalSource(e,t,n){const r=n?.extent??null,{spatialReference:o}=e,s=n?.transform?.clone()??new ne,i=fe(e,n),a=n?.unitConversionDisabled,c={source:t,extent:r,unitConversionDisabled:a},l=new E;return l.externalSources.push(c),new D({metadata:l,transform:s,vertexSpace:i,spatialReference:o})}static createIncomplete(e,t){const{spatialReference:n}=e,r=t?.transform?.clone()??new ne,o=fe(e,t),s=new D({transform:r,vertexSpace:o,spatialReference:n});return s.addResolvingPromise(Promise.reject(new re("mesh-incomplete","Mesh resources are not complete"))),s}};u([f({type:[K],json:{write:!0}})],S.prototype,"components",void 0),u([f({nonNullable:!0,types:$n,constructOnly:!0,json:{write:!0}})],S.prototype,"vertexSpace",void 0),u([f({type:ne,json:{write:!0}})],S.prototype,"transform",void 0),u([f({constructOnly:!0})],S.prototype,"metadata",void 0),u([f()],S.prototype,"hasExtent",null),u([f()],S.prototype,"_transformedExtent",null),u([f()],S.prototype,"_untransformedBounds",null),u([f()],S.prototype,"origin",null),u([f({readOnly:!0,json:{read:!1}})],S.prototype,"extent",null),u([f({readOnly:!0,json:{read:!1,write:!0,default:!0}})],S.prototype,"hasZ",void 0),u([f({readOnly:!0,json:{read:!1,write:!0,default:!1}})],S.prototype,"hasM",void 0),u([f({type:pe,nonNullable:!0,json:{write:!0}})],S.prototype,"vertexAttributes",void 0),S=D=u([B(It)],S);const rt=st(),no=S;export{no as F,ee as G,te as V,Pr as m,K as z}; diff --git a/custom-toc-highlight/assets/MeshLocalVertexSpace-BqgocsoS-Dycut332.js b/custom-toc-highlight/assets/MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js similarity index 91% rename from custom-toc-highlight/assets/MeshLocalVertexSpace-BqgocsoS-Dycut332.js rename to custom-toc-highlight/assets/MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js index f9e4603f..7f927253 100644 --- a/custom-toc-highlight/assets/MeshLocalVertexSpace-BqgocsoS-Dycut332.js +++ b/custom-toc-highlight/assets/MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js @@ -1 +1 @@ -import{aa as n,v as o,bz as p,S as i,i as a,dg as c,e as l}from"./story-BfX8CRfG.js";var s;let e=s=class extends n(l){constructor(t){super(t),this.type="georeferenced",this.origin=null}};e.absolute=new s,o([p({georeferenced:"georeferenced"},{readOnly:!0})],e.prototype,"type",void 0),o([i({type:[Number],nonNullable:!1,json:{write:!0}})],e.prototype,"origin",void 0),e=s=o([a("esri.geometry.support.MeshGeoreferencedVertexSpace")],e);const d=e;let r=class extends n(l){constructor(t){super(t),this.type="local",this.origin=c()}};o([p({local:"local"},{readOnly:!0})],r.prototype,"type",void 0),o([i({type:[Number],nonNullable:!0,json:{write:!0}})],r.prototype,"origin",void 0),r=o([a("esri.geometry.support.MeshLocalVertexSpace")],r);const u=r;export{u as d,d as y}; +import{aa as n,v as o,bz as p,S as i,i as a,dg as c,e as l}from"./story-Doly9N9p.js";var s;let e=s=class extends n(l){constructor(t){super(t),this.type="georeferenced",this.origin=null}};e.absolute=new s,o([p({georeferenced:"georeferenced"},{readOnly:!0})],e.prototype,"type",void 0),o([i({type:[Number],nonNullable:!1,json:{write:!0}})],e.prototype,"origin",void 0),e=s=o([a("esri.geometry.support.MeshGeoreferencedVertexSpace")],e);const d=e;let r=class extends n(l){constructor(t){super(t),this.type="local",this.origin=c()}};o([p({local:"local"},{readOnly:!0})],r.prototype,"type",void 0),o([i({type:[Number],nonNullable:!0,json:{write:!0}})],r.prototype,"origin",void 0),r=o([a("esri.geometry.support.MeshLocalVertexSpace")],r);const u=r;export{u as d,d as y}; diff --git a/custom-toc-highlight/assets/MeshTransform-C--IG09w-DoQndDth.js b/custom-toc-highlight/assets/MeshTransform-C--IG09w-Bbqagf1g.js similarity index 84% rename from custom-toc-highlight/assets/MeshTransform-C--IG09w-DoQndDth.js rename to custom-toc-highlight/assets/MeshTransform-C--IG09w-Bbqagf1g.js index c771390a..62dfc027 100644 --- a/custom-toc-highlight/assets/MeshTransform-C--IG09w-DoQndDth.js +++ b/custom-toc-highlight/assets/MeshTransform-C--IG09w-Bbqagf1g.js @@ -1 +1 @@ -import{v as i,S as e,i as w,e as I,dg as S,il as q,hZ as z,i8 as l,B as M,je as B,jf as E,i1 as Q,bj as R}from"./story-BfX8CRfG.js";import{o as T,z as U,u as V,s as Z}from"./mat4-DX7gBViE-DVqdGrVU.js";import{t as x}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as p,j as N,_}from"./quat-BODLR7mS-BrXZAXDf.js";import{e as m}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{A as k}from"./vec32-D9GsKZ1t-BjayBdwt.js";function s(t=d){return[t[0],t[1],t[2],t[3]]}function c(t,o,r=s()){return k(r,t),r[3]=o,r}function L(t,o=s()){const r=Z(a,t);return $(o,M(N(o,r))),o}function g(t,o,r=s()){return p(a,t,h(t)),p(j,o,h(o)),_(a,j,a),$(r,M(N(r,a)))}function O(t,o,r,A=s()){return c(B,t,u),c(E,o,y),c(Q,r,b),g(u,y,u),g(u,b,A),A}function P(t){return t}function C(t){return t[3]}function h(t){return R(t[3])}function $(t,o){return t[3]=o,t}const d=[0,0,1,0],a=m(),j=m();s();const u=s(),y=s(),b=s();var f;let n=f=class extends I{constructor(t){super(t),this.translation=S(),this.rotationAxis=q(d),this.rotationAngle=0,this.scale=z(1,1,1)}get rotation(){return c(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=l(t),this.rotationAngle=C(t)}get localMatrix(){const t=x();return p(v,this.rotation,h(this.rotation)),T(t,v,this.translation,this.scale),t}get localMatrixInverse(){return U(x(),this.localMatrix)}equals(t){return this===t||t!=null&&V(this.localMatrix,t.localMatrix)}clone(){const t={translation:l(this.translation),rotationAxis:l(this.rotationAxis),rotationAngle:this.rotationAngle,scale:l(this.scale)};return new f(t)}};i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"translation",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAxis",void 0),i([e({type:Number,nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAngle",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"scale",void 0),i([e()],n.prototype,"rotation",null),i([e()],n.prototype,"localMatrix",null),i([e()],n.prototype,"localMatrixInverse",null),n=f=i([w("esri.geometry.support.MeshTransform")],n);const v=m(),W=n;export{L as Q,O as R,P as S,W as V,h as c,s}; +import{v as i,S as e,i as w,e as I,dg as S,il as q,hZ as z,i8 as l,B as M,je as B,jf as E,i1 as Q,bj as R}from"./story-Doly9N9p.js";import{o as T,z as U,u as V,s as Z}from"./mat4-DX7gBViE-6clJxb1Q.js";import{t as x}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as p,j as N,_}from"./quat-BODLR7mS-BQk2dgMZ.js";import{e as m}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{A as k}from"./vec32-D9GsKZ1t-BPSFE14A.js";function s(t=d){return[t[0],t[1],t[2],t[3]]}function c(t,o,r=s()){return k(r,t),r[3]=o,r}function L(t,o=s()){const r=Z(a,t);return $(o,M(N(o,r))),o}function g(t,o,r=s()){return p(a,t,h(t)),p(j,o,h(o)),_(a,j,a),$(r,M(N(r,a)))}function O(t,o,r,A=s()){return c(B,t,u),c(E,o,y),c(Q,r,b),g(u,y,u),g(u,b,A),A}function P(t){return t}function C(t){return t[3]}function h(t){return R(t[3])}function $(t,o){return t[3]=o,t}const d=[0,0,1,0],a=m(),j=m();s();const u=s(),y=s(),b=s();var f;let n=f=class extends I{constructor(t){super(t),this.translation=S(),this.rotationAxis=q(d),this.rotationAngle=0,this.scale=z(1,1,1)}get rotation(){return c(this.rotationAxis,this.rotationAngle)}set rotation(t){this.rotationAxis=l(t),this.rotationAngle=C(t)}get localMatrix(){const t=x();return p(v,this.rotation,h(this.rotation)),T(t,v,this.translation,this.scale),t}get localMatrixInverse(){return U(x(),this.localMatrix)}equals(t){return this===t||t!=null&&V(this.localMatrix,t.localMatrix)}clone(){const t={translation:l(this.translation),rotationAxis:l(this.rotationAxis),rotationAngle:this.rotationAngle,scale:l(this.scale)};return new f(t)}};i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"translation",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAxis",void 0),i([e({type:Number,nonNullable:!0,json:{write:!0}})],n.prototype,"rotationAngle",void 0),i([e({type:[Number],nonNullable:!0,json:{write:!0}})],n.prototype,"scale",void 0),i([e()],n.prototype,"rotation",null),i([e()],n.prototype,"localMatrix",null),i([e()],n.prototype,"localMatrixInverse",null),n=f=i([w("esri.geometry.support.MeshTransform")],n);const v=m(),W=n;export{L as Q,O as R,P as S,W as V,h as c,s}; diff --git a/custom-toc-highlight/assets/MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js b/custom-toc-highlight/assets/MeshVertexAttributes-CbNpPur2-c8zcl8rF.js similarity index 97% rename from custom-toc-highlight/assets/MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js rename to custom-toc-highlight/assets/MeshVertexAttributes-CbNpPur2-c8zcl8rF.js index e2b6a6ab..a7a16987 100644 --- a/custom-toc-highlight/assets/MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js +++ b/custom-toc-highlight/assets/MeshVertexAttributes-CbNpPur2-c8zcl8rF.js @@ -1 +1 @@ -import{v as n,S as u,ad as c,i as v,e as A,a1 as l,P as i}from"./story-BfX8CRfG.js";function m(t,o,e,g){const{loggerTag:a,stride:s}=o;return t.length%s!=0?(g.error(a,`Invalid array length, expected a multiple of ${s}`),new e([])):t}function p(t,o,e,g,a){if(!t)return t;if(t instanceof o)return m(t,g,o,a);for(const s of e)if(t instanceof s)return m(new o(t),g,o,a);if(Array.isArray(t))return m(new o(t),g,o,a);{const s=e.map(d=>`'${d.name}'`);return a.error(`Failed to set property, expected one of ${s}, but got ${t.constructor.name}`),new o([])}}function h(t,o,e){o[e]=f(t)}function f(t){const o=new Array(t.length);for(let e=0;e`'${d.name}'`);return a.error(`Failed to set property, expected one of ${s}, but got ${t.constructor.name}`),new o([])}}function h(t,o,e){o[e]=f(t)}function f(t){const o=new Array(t.length);for(let e=0;e{let{pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sizeRatio:a}=n;e||(e=n.sprite.sdf?[0,0]:[n.sprite.width,n.sprite.height]),t||(t=n.sprite.sdf?[0,0]:e),i=R(i),s=R(s),r=R(r);const o=(n.sprite.sdfDecodeCoeff??1)*a;return{...n,pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sdfDecodeCoeff:o}},optionalAttributes:{zoomRange:{type:S.SHORT,count:2,packPrecisionFactor:$,pack:({scaleInfo:n},{tileInfo:e})=>me(n,e)}},attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:S.UNSIGNED_BYTE,count:1,pack:Xe},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:1},offset:{type:S.FLOAT,count:2,packAlternating:{count:4,pack:n=>{const e=n.texelDimensions;return[[-.5*e[0],-.5*e[1]],[.5*e[0],-.5*e[1]],[-.5*e[0],.5*e[1]],[.5*e[0],.5*e[1]]]}}},uv:{type:S.SHORT,count:2,packPrecisionFactor:1,packAlternating:{count:4,packTessellation:({texXmax:n,texXmin:e,texYmax:t,texYmin:i})=>[[e,i],[n,i],[e,t],[n,t]]}},animationPointerAndBaseSizeAndReferenceSize:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:1,pack:({animations:n,baseSize:e,referenceSize:t})=>[n.dataColumn,n.dataRow,e,t]},sizing:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:8,pack:({strokeWidth:n,pixelDimensions:e,baseSize:t,sprite:i,sizeRatio:s})=>{const r=Math.max(t*i.width/i.height,t),a=i.sdfDecodeCoeff*r*s;return[e[0],e[1],n,a]}},angle:{type:S.BYTE,count:1,packTessellation:({angle:n})=>n}}}}_write(n,e){const t=this.evaluatedMeshParams.sprite,{textureBinding:i}=t;n.recordStart(this.instanceId,this.attributeLayout,i);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPolygon"){const r=e.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writeQuad(n,s,a,o)}else if(e.geometryType==="esriGeometryPoint"){const r=e.readXForDisplay(),a=e.readYForDisplay();this._writeQuad(n,s,r,a)}else{const r=e.readGeometryForDisplay();if(r){const{angleToLine:a}=this.evaluatedMeshParams;if(a){let o=!0,c=null,d=null;r.forEachVertex((l,u)=>{if(c!=null&&d!=null){const h=Math.atan2(u-d,l-c)/Pe;o&&(this._writeQuad(n,s,c,d,h),o=!1),this._writeQuad(n,s,l,u,h)}c=l,d=u})}else r.forEachVertex((o,c)=>{this._writeQuad(n,s,o,c)})}}n.recordEnd()}_writeQuad(n,e,t,i,s=0){const r=this.evaluatedMeshParams.sprite,{rect:a}=r,o=a.x+2,c=a.y+2,d=a.x+a.width-2,l=a.y+a.height-2,u=n.vertexCount();n.recordBounds(t,i,64,64);const h={texXmin:o,texYmin:c,texXmax:d,texYmax:l,angle:s};for(let _=0;_<4;_++)this._writeVertex(n,e,t,i,h);n.indexEnsureSize(6),n.indexWrite(u),n.indexWrite(u+1),n.indexWrite(u+2),n.indexWrite(u+1),n.indexWrite(u+3),n.indexWrite(u+2)}};function ce(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n}function pe(n,e){return Math.sqrt(n*n+e*e)}function le(n){const e=pe(n[0],n[1]);n[0]/=e,n[1]/=e}function He(n,e){return pe(n[0]-e[0],n[1]-e[1])}function Je(n,e){return n[e+1]}function _e(n){return n.length-1}function Ue(n){let e=0;for(let t=0;t<_e(n);t++)e+=Ke(n,t);return e}function Ke(n,e,t=1){let[i,s]=Je(n,e);return[i,s]=[Math.round(i),Math.round(s)],Math.sqrt(i*i+s*s)*t}let et=class H{constructor(e,t,i,s,r){this._segments=e,this._index=t,this._distance=i,this._xStart=s,this._yStart=r,this._done=!1}static create(e){return new H(e,0,0,e[0][0],e[0][1])}clone(){return new H(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(e){return this._index===e._index||e._index===this._index-1&&(this._distance===0||e._distance===1)||e._index===this._index+1&&(this._distance===1||e._distance===0)}leq(e){return this._indexe._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,t=(0*e+-1*-this.dx)/(1*this.length);let i=Math.acos(t);return e>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:e,dy:t}=this;return Math.sqrt(e*e+t*t)}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+1<_e(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(e,t){const i=this.backwardLength;if(e<=i)return this._distance=(i-e)/this.length,this;let s=this.backwardLength;for(;this.prev();){if(s+this.length>e)return this._seekBackwards(e-s);s+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>e)return this.seek(e-i,t);i+=this.length}return this._distance=1,t?this:null}};function Q(n,e,t,i=!0){const s=Ue(n),r=et.create(n),a=s/2;if(!i)return r.seek(a),void(Math.abs(r.x)=0&&!(i[f+1]i[l]+d);f++){const m=d-i[f-1]+i[l],p=i[f]-i[f-1],g=i[f]-i[l]{let e=0;if(n===0)return 1/0;for(;!(n%2);)e++,n/=2;return e});class nt extends de{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,s){if(this._zoomLevel=s||0,i!=null)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const r=t.readXForDisplay(),a=t.readYForDisplay();this._writePoint(e,r,a,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":case"esriGeometryMultipoint":{const r=t.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writePoint(e,a,o,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_createLineLabelMetric(e,t,i,s){const r=te(e),a=this.evaluatedMeshParams.horizontalAlignment==="right"?-1:1,o=this.evaluatedMeshParams.verticalAlignment==="bottom"?-1:1,c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0;return new oe(r,t,i,a,o,c,d,s??null)}_writePoint(e,t,i,s){const r=this._getShaping();if(!r)return;const a=s.getDisplayId(),o=xe(this.evaluatedMeshParams.horizontalAlignment),c=ve(this.evaluatedMeshParams.verticalAlignment),d=this.evaluatedMeshParams.scaleInfo?.maxScale??0,l=this.evaluatedMeshParams.scaleInfo?.minScale??0,u=te(s.getDisplayId()),h=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new oe(u,t,i,o,c,d,l,h)),this._writeGlyphs(e,a,t,i,r,0,h),e.metricBoxWrite(r.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:s}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,a=this._getShaping("middle");if(!a)return;const o=(d,l,u,h)=>this._placeSubdivGlyphs(d,l,u,h),c=(a.bounds.width+r)/(1<0&&!(!c&&!d);if(i.metricStart(this._createLineLabelMetric(s,e.x,e.y)),_){const f=Math.max(t,a[0],0),m=Math.min(N,a[1]),p=je(Z(),-e.angle),g={minZoom:f,maxZoom:m,clipAngle:u,mapAligned:!0,isLineLabel:!0},y=R(this.evaluatedMeshParams.offsetX),v=R(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const M=re(y,-1*v),[x,I]=r.shapeBackground(se(Z(),p,M));i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const M=re(y,v),[x,I]=r.shapeBackground(se(Z(),p,M));g.clipAngle=h,i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(l,t,1,u,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(l,t,0,h,!0),i.metricEnd()}_placeBack(e,t,i,s,r,a){const o=e.clone();let c=e.backwardLength+L;for(;o.prev()&&!(c>=s);)this._placeOnSegment(o,t,c,i,-1,r,a),c+=o.length+L}_placeForward(e,t,i,s,r,a){const o=e.clone();let c=e.remainingLength+L;for(;o.next()&&!(c>=s);)this._placeOnSegment(o,t,c,i,1,r,a),c+=o.length+L}_placeFirst(e,t,i,s,r=!1){const{out:a,id:o,shaping:c,zoomRange:d,referenceBounds:l}=this._current,u=c.glyphs;for(const h of u){const _=h.x>c.bounds.x?i:1-i,f=_*e.remainingLength+(1-_)*e.backwardLength,m=Math.abs(h.x+h.width/2-c.bounds.x),p=Math.max(0,this._zoomLevel+Math.log2(m/(f+L))),g=Math.max(t,r?0:p);h.maxZoom=Math.min(d[1],N),h.angle=e.angle+(1-i)*Math.PI,h.minZoom=Math.max(d[0],g),this._writeLineGlyph(a,o,e.x,e.y,c.bounds,h,s,l,!0),(i||this._current.offsetDirection)&&this._isVisible(h.minZoom,h.maxZoom)&&a.metricBoxWrite(h.bounds)}}_placeOnSegment(e,t,i,s,r,a,o){const{out:c,id:d,shaping:l,referenceBounds:u}=this._current,h=l.glyphs,_=e.dx/e.length,f=e.dy/e.length,m={x:e.x+i*-r*_,y:e.y+i*-r*f};for(const p of h){const g=p.x>l.bounds.x?a:1-a;if(!(g&&r===1||!g&&r===-1))continue;const y=Math.abs(p.x+p.width/2-l.bounds.x),v=Math.max(0,this._zoomLevel+Math.log2(y/i)-.1),M=Math.max(s,this._zoomLevel+Math.log2(y/(i+e.length+L)));v!==0&&(p.angle=e.angle+(1-a)*Math.PI,p.minZoom=M,p.maxZoom=v,this._writeLineGlyph(c,d,m.x,m.y,l.bounds,p,o,u,!0),(a||this._current.offsetDirection)&&this._isVisible(p.minZoom,p.maxZoom)&&c.metricBoxWrite(p.bounds))}}_writeLineGlyph(e,t,i,s,r,a,o,c,d){const l=i+r.x,u=s+r.y,h=2*(this.evaluatedMeshParams.minPixelBuffer?this.evaluatedMeshParams.minPixelBuffer/this._textMeshTransformProps.fontSize:1),_=Math.max(r.width,r.height)*h;e.recordStart(this.instanceId,this.attributeLayout,a.textureBinding),e.recordBounds(l,u,_,_);const{texcoords:f,offsets:m}=a,{fontSize:p,haloSize:g,outlineSize:y}=this._textMeshTransformProps;this._writeQuad(e,t,i,s,{texcoords:f,offsets:m,fontSize:p,haloSize:g,outlineSize:y,color:Ce(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:c,minZoom:Math.max(this._current.zoomRange[0],a.minZoom),maxZoom:Math.min(this._current.zoomRange[1],a.maxZoom),clipAngle:o,mapAligned:d,isLineLabel:!0}),e.recordEnd()}_isVisible(e,t){const i=Math.floor(this._zoomLevel*$)/$;return e<=i&&i<=t}}function he(n,e,t){const{coords:i,lengths:s}=e,r=A(),a=A(),o=A(),c=A(),d=A(),l=A(),u=2;let h=0;for(let _=0;_0?k(r,i[p],i[p+1]):k(r,0,0),k(a,i[g],i[g+1]),mw(e)).map(e=>j(e).simplify()))}function lt(n){const e=[];return e.push(n.transform),e.push(n.fromColor),e.push(n.toColor),e.push(n.colorMix),e.push(n.toOpacity),e.push(n.opacityMix),e}function ge(n){const e=[],t=[];let i=0;for(const s of n){const r=[...s.encode(),...z.ret.encode()];e.push([i+n.length,0,0,0]),t.push(...r),i+=r.length}return[...e,...t]}async function K(n,e){const t=n;let i;if(typeof t=="number"||typeof t=="string"||typeof t=="boolean")i=t;else if(Array.isArray(t))i=await Promise.all(t.map(s=>K(s,e)));else if(typeof t=="object")if("valueExpressionInfo"in t){const{valueExpressionInfo:s}=t,{expression:r}=s;i={...t,computed:await e.createComputedField({expression:r})}}else{i={};for(const s in t)i[s]=await K(t[s],e)}return i}function w(n,e,t){function i(a){if(!("computed"in a))return a;let o=a.computed.readWithDefault(e,t,[255*a.defaultValue[0],255*a.defaultValue[1],255*a.defaultValue[2],a.defaultValue[3]]);if(typeof o=="string"){const c=Se.fromString(o);c&&(o=[c.r,c.g,c.b,c.a])}return o}const s=n;let r;if(typeof s=="number"||typeof s=="string"||typeof s=="boolean")r=s;else if(Array.isArray(s))r=s.map(a=>w(a,e,t));else if(typeof s=="object")if("type"in s&&s.type!=null&&s.type==="Process")switch(s.op){case"ArcadeColor":{const a=w(s.value,e,t);O(Array.isArray(a)&&a.length===4),r=[a[0]/255,a[1]/255,a[2]/255,a[3]]}break;case"Transparency":{const a=w(s.value,e,t);O(typeof a=="number"),r=1-a/100}break;case"Divide":{const a=w(s.left,e,t);O(typeof a=="number");const o=w(s.right,e,t);O(typeof o=="number"),r=a/o}break;case"Random":{const a=w(s.seed,e,t),o=w(s.min,e,t),c=w(s.max,e,t),d=e.getObjectId(),l=fe(d||0);r=o+qe(l,a)*(c-o)}}else if("computed"in s)r=i(s);else{r={};for(const a in s)r[a]=w(s[a],e,t)}return r}function O(n){if(!n)throw new Error("Assertion failed.")}class ht extends Ye{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,i){return this._value}referencesScale(){return!1}referencesGeometry(){return!1}}const ut=()=>Ie.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function C(n,e,t=!1){const{defaultValue:i,valueExpressionInfo:s,value:r}=e;if(s){const{expression:a}=s,o=await n.createComputedField({expression:a},t);return o?{...e,computed:o,defaultValue:i}:null}return{...e,computed:new ht(r),defaultValue:i}}async function ue(n,e){const{valueExpressionInfo:t}=e,{expression:i}=t,s=await n.createComputedField({expression:i});return s?{...e,computed:s}:null}function ye(n){return typeof n=="object"&&n!=null&&(!(!("valueExpressionInfo"in n)||!n.valueExpressionInfo)||"type"in n&&n.type==="Process"&&"op"in n&&n.op==="Random")}function W(n){if(Array.isArray(n)){for(const e of n)if(W(e))return!0}if(typeof n=="object"){if(ye(n))return!0;for(const e in n)if(W(n[e]))return!0}return!1}class ee{static async create(e,t,i){const s={},r=new Map,a=new Map,o=new Map,c=new Map,d=new Map,l=new Map;for(const u in i){const h=i[u];if(h!=null&&typeof h=="object")if(Array.isArray(h)){if(typeof h[0]=="object")throw new Error(`InternalError: Cannot handle ${u}. Nested array params are not supported`);s[u]=h}else if("valueExpressionInfo"in h){if(h.value){s[u]=h.value;continue}const _=await ue(e,h);if(!_){s[u]=h.defaultValue;continue}r.set(u,_),s[u]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some(_=>_.overrides.length)){a.set(u,{effects:await Promise.all(h.effectInfos.map(async _=>{const f=_.overrides.map(m=>C(e,m));return{effect:_.effect,compiledOverrides:(await Promise.all(f)).filter(B)}}))});break}s[u]=h.effectInfos.map(_=>_.effect);break;case"cim-marker-placement-param":h.overrides.length&&o.set(u,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map(_=>C(e,_)))).filter(B)}),s[u]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m,h.useLegacyLabelEvaluationRules));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}if(h.resource.type==="animated"){c.set(u,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"cim-marker-transform-param":{const{params:_}=h;if(W(_)){const f={compiledMarkerInfos:[]};await Promise.all(_.map(async m=>{const p={props:{}};for(const g in m)if(ye(m[g])){const y=await ue(e,m[g]);p.compiledExpressionMap||(p.compiledExpressionMap=new Map);const v=p.compiledExpressionMap;y&&v.set(g,y)}else p.props[g]=m[g];f.compiledMarkerInfos.push(p)})),d.set(u,f)}else s[u]={type:"cim-marker-transform-info",infos:_};break}case"animation-params":{const{params:_}=h,f=lt(_);if(W(f)){const m=await Promise.all(f.map(p=>K(p,e)));l.set(u,{params:m,propertyIdToResourceId:new Map,key:u})}else{const m=ct(f),p=await t.fetchResourceImmediate({type:"animation-info",resource:m});p!=null&&p.type==="sprite"&&(s[u]={dataRow:p.rect.y,dataColumn:p.rect.x})}break}default:s[u]=h}else s[u]=h}return new ee(i,s,r,a,o,c,d,l)}constructor(e,t,i,s,r,a,o,c){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=i,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=r,this._dynamicAsyncProperties=a,this._dynamicTransformProperties=o,this._dynamicAsyncAnimations=c,this.evaluator=d=>d}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size||this._dynamicAsyncAnimations.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,t,i){for(const s of this._dynamicAsyncProperties.values()){const r=Me(s.rasterizationParam.resource);s.rasterizationParam.resource.type==="animated"&&s.rasterizationParam.resource.randomizeStartTime&&(r.primitiveName="__RESERVED__PRIMITIVE__NAME__",r.startGroup=fe(t.getObjectId()||0));for(const{primitiveName:o,propertyName:c,computed:d,defaultValue:l,valueExpressionInfo:u}of s.compiledOverrides)try{const h=s.rasterizationParam.resource.type==="animated"?r.primitiveName:o;Ze(r,h,c,d,t,i,l)}catch(h){ut().errorOnce(new be("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${u?.expression}' (primitive: '${o}', property: '${c}')`,h))}const a=e.enqueueRequest({type:"cim-rasterization-info",resource:r});s.objectIdToResourceId.set(t.getObjectId(),a)}for(const s of this._dynamicAsyncAnimations.values()){const r=s.params.map(c=>w(c,t,i)).map(j).map(c=>c.simplify()),a=ge(r),o=e.enqueueRequest({type:"animation-info",resource:a});s.propertyIdToResourceId.set(t.getObjectId()+"."+s.key,o)}}evaluateMeshParams(e,t,i){for(const[s,r]of this._dynamicProperties.entries())this._resolvedMeshParams[s]=r.computed.readWithDefault(t,i,r.defaultValue);for(const[s,r]of this._dynamicPlacementProperties.entries())for(const{computed:a,defaultValue:o,propertyName:c}of r.compiledOverrides){const d=a.readWithDefault(t,i,o);r.placementInfo.placement[c]=d,this._resolvedMeshParams[s]=r.placementInfo.placement}for(const[s,r]of this._dynamicEffectProperties.entries())for(const a of r.effects){for(const{computed:o,defaultValue:c,propertyName:d}of a.compiledOverrides){const l=o.readWithDefault(t,i,c);a.effect[d]=l}this._resolvedMeshParams[s]=r.effects.map(o=>o.effect)}for(const[s,r]of this._dynamicTransformProperties.entries()){const a={type:"cim-marker-transform-info",infos:[]};for(const o of r.compiledMarkerInfos){const c={...o.props};if(o.compiledExpressionMap)for(const[d,l]of o.compiledExpressionMap){const u=l.computed.readWithDefault(t,i,l.defaultValue);c[d]=typeof u=="number"||typeof u=="boolean"?u:l.defaultValue}a.infos.push(c)}this._resolvedMeshParams[s]=a}for(const[s,r]of this._dynamicAsyncProperties.entries()){const a=r.objectIdToResourceId.get(t.getObjectId());if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]=o}for(const[s,r]of this._dynamicAsyncAnimations.entries()){const a=r.propertyIdToResourceId.get(t.getObjectId()+"."+s);if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]={dataRow:o.rect.y,dataColumn:o.rect.x}}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}}class kt{async createMeshWriter(e,t,i,s){const r=this._getMeshWriter(s.techniqueType),a=await ee.create(e,t,s.inputParams),o=new r(s.id,a,s.optionalAttributes,i);return await o.loadDependencies(),o}_getMeshWriter(e){switch(e){case P.Fill:return Oe;case P.DotDensity:return Ge;case P.ComplexFill:return Fe;case P.PatternFill:return Be;case P.OutlineFill:return Te;case P.PatternOutlineFill:return Re;case P.ComplexOutlineFill:return Ee;case P.Marker:return De;case P.PieChart:return ze;case P.Text:return de;case P.Line:return Le;case P.TexturedLine:return Ae;case P.Heatmap:return ke;case P.Label:return nt;case P.AnimatedMarker:return $e;default:throw new Error("Internal Error: Mesh writer not in the registry")}}}export{kt as d,ht as g}; +import{D as P,K as xe,J as ve,Z as te,u as D,G as z,_ as Pe}from"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import{et as R,aq as B,P as Me,o as be,hE as we,a1 as Ie,ar as Se}from"./story-Doly9N9p.js";import{K as $}from"./definitions-DJSdSb77-DkoRHaVx.js";import{I as ke,O as Ae,y as Le,F as de,$ as ze,Q as De,b as Ee,M as Re,k as Te,X as Be,a as Fe,m as Ge,c as Oe,R as me,J as N,g as Ce,d as We,C as E}from"./PieChartMeshWriter-C5yLDFwp-5CAejpYY.js";import{I as S}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{s as je,l as Z,i as se}from"./Tile-D75RMC64-g8Sx5TPr.js";import{m as k,T as ie,j as q,b as Ve,v as ne}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as re}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{o as A}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{R as Ne,n as ae}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{c as Y}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{T as oe,h as Ze}from"./LabelMetric-BeluzH3o-Br-5CSAC.js";import{e as F}from"./constants-Bqe1QJ4u-F8oTIn7N.js";import{r as fe,i as qe}from"./grouping-RwmXkHDc-CCFLL7L_.js";import{T as Ye}from"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";let Qe=class extends We{};function Xe(n){const{sprite:e,isMapAligned:t,colorLocked:i,scaleSymbolsProportionally:s,isStroke:r}=n;let a=0;return t&&(a|=E(D.bitset.isMapAligned)),i&&(a|=E(D.bitset.colorLocked)),e.sdf&&(a|=E(D.bitset.isSDF)),s&&(a|=E(D.bitset.scaleSymbolsProportionally)),r&&(a|=E(D.bitset.isStroke)),a}let $e=class extends Qe{get vertexSpec(){return{createComputedParams:n=>{let{pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sizeRatio:a}=n;e||(e=n.sprite.sdf?[0,0]:[n.sprite.width,n.sprite.height]),t||(t=n.sprite.sdf?[0,0]:e),i=R(i),s=R(s),r=R(r);const o=(n.sprite.sdfDecodeCoeff??1)*a;return{...n,pixelDimensions:e,texelDimensions:t,baseSize:i,referenceSize:s,strokeWidth:r,sdfDecodeCoeff:o}},optionalAttributes:{zoomRange:{type:S.SHORT,count:2,packPrecisionFactor:$,pack:({scaleInfo:n},{tileInfo:e})=>me(n,e)}},attributes:{id:{type:S.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:S.UNSIGNED_BYTE,count:1,pack:Xe},pos:{type:S.SHORT,count:2,pack:"position",packPrecisionFactor:1},offset:{type:S.FLOAT,count:2,packAlternating:{count:4,pack:n=>{const e=n.texelDimensions;return[[-.5*e[0],-.5*e[1]],[.5*e[0],-.5*e[1]],[-.5*e[0],.5*e[1]],[.5*e[0],.5*e[1]]]}}},uv:{type:S.SHORT,count:2,packPrecisionFactor:1,packAlternating:{count:4,packTessellation:({texXmax:n,texXmin:e,texYmax:t,texYmin:i})=>[[e,i],[n,i],[e,t],[n,t]]}},animationPointerAndBaseSizeAndReferenceSize:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:1,pack:({animations:n,baseSize:e,referenceSize:t})=>[n.dataColumn,n.dataRow,e,t]},sizing:{type:S.UNSIGNED_SHORT,count:4,packPrecisionFactor:8,pack:({strokeWidth:n,pixelDimensions:e,baseSize:t,sprite:i,sizeRatio:s})=>{const r=Math.max(t*i.width/i.height,t),a=i.sdfDecodeCoeff*r*s;return[e[0],e[1],n,a]}},angle:{type:S.BYTE,count:1,packTessellation:({angle:n})=>n}}}}_write(n,e){const t=this.evaluatedMeshParams.sprite,{textureBinding:i}=t;n.recordStart(this.instanceId,this.attributeLayout,i);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPolygon"){const r=e.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writeQuad(n,s,a,o)}else if(e.geometryType==="esriGeometryPoint"){const r=e.readXForDisplay(),a=e.readYForDisplay();this._writeQuad(n,s,r,a)}else{const r=e.readGeometryForDisplay();if(r){const{angleToLine:a}=this.evaluatedMeshParams;if(a){let o=!0,c=null,d=null;r.forEachVertex((l,u)=>{if(c!=null&&d!=null){const h=Math.atan2(u-d,l-c)/Pe;o&&(this._writeQuad(n,s,c,d,h),o=!1),this._writeQuad(n,s,l,u,h)}c=l,d=u})}else r.forEachVertex((o,c)=>{this._writeQuad(n,s,o,c)})}}n.recordEnd()}_writeQuad(n,e,t,i,s=0){const r=this.evaluatedMeshParams.sprite,{rect:a}=r,o=a.x+2,c=a.y+2,d=a.x+a.width-2,l=a.y+a.height-2,u=n.vertexCount();n.recordBounds(t,i,64,64);const h={texXmin:o,texYmin:c,texXmax:d,texYmax:l,angle:s};for(let _=0;_<4;_++)this._writeVertex(n,e,t,i,h);n.indexEnsureSize(6),n.indexWrite(u),n.indexWrite(u+1),n.indexWrite(u+2),n.indexWrite(u+1),n.indexWrite(u+3),n.indexWrite(u+2)}};function ce(n,e,t){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n}function pe(n,e){return Math.sqrt(n*n+e*e)}function le(n){const e=pe(n[0],n[1]);n[0]/=e,n[1]/=e}function He(n,e){return pe(n[0]-e[0],n[1]-e[1])}function Je(n,e){return n[e+1]}function _e(n){return n.length-1}function Ue(n){let e=0;for(let t=0;t<_e(n);t++)e+=Ke(n,t);return e}function Ke(n,e,t=1){let[i,s]=Je(n,e);return[i,s]=[Math.round(i),Math.round(s)],Math.sqrt(i*i+s*s)*t}let et=class H{constructor(e,t,i,s,r){this._segments=e,this._index=t,this._distance=i,this._xStart=s,this._yStart=r,this._done=!1}static create(e){return new H(e,0,0,e[0][0],e[0][1])}clone(){return new H(this._segments,this._index,this._distance,this.xStart,this.yStart)}equals(e){return this._index===e._index||e._index===this._index-1&&(this._distance===0||e._distance===1)||e._index===this._index+1&&(this._distance===1||e._distance===0)}leq(e){return this._indexe._index||this._index===e._index&&this._distance>=e._distance}get _segment(){return this._segments[this._index+1]}get angle(){const e=this.dy,t=(0*e+-1*-this.dx)/(1*this.length);let i=Math.acos(t);return e>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:e,dy:t}=this;return Math.sqrt(e*e+t*t)}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+1<_e(this._segments)}next(){return this.hasNext()?(this._xStart+=this.dx,this._yStart+=this.dy,this._distance=0,this._index+=1,this):null}prev(){return this.hasPrev()?(this._index-=1,this._xStart-=this.dx,this._yStart-=this.dy,this._distance=1,this):(this._done=!0,null)}_seekBackwards(e,t){const i=this.backwardLength;if(e<=i)return this._distance=(i-e)/this.length,this;let s=this.backwardLength;for(;this.prev();){if(s+this.length>e)return this._seekBackwards(e-s);s+=this.length}return this._distance=0,t?this:null}seek(e,t=!1){if(e<0)return this._seekBackwards(Math.abs(e),t);if(e<=this.remainingLength)return this._distance=(this.backwardLength+e)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>e)return this.seek(e-i,t);i+=this.length}return this._distance=1,t?this:null}};function Q(n,e,t,i=!0){const s=Ue(n),r=et.create(n),a=s/2;if(!i)return r.seek(a),void(Math.abs(r.x)=0&&!(i[f+1]i[l]+d);f++){const m=d-i[f-1]+i[l],p=i[f]-i[f-1],g=i[f]-i[l]{let e=0;if(n===0)return 1/0;for(;!(n%2);)e++,n/=2;return e});class nt extends de{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,s){if(this._zoomLevel=s||0,i!=null)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const r=t.readXForDisplay(),a=t.readYForDisplay();this._writePoint(e,r,a,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":case"esriGeometryMultipoint":{const r=t.readCentroidForDisplay();if(!r)return;const[a,o]=r.coords;this._writePoint(e,a,o,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_createLineLabelMetric(e,t,i,s){const r=te(e),a=this.evaluatedMeshParams.horizontalAlignment==="right"?-1:1,o=this.evaluatedMeshParams.verticalAlignment==="bottom"?-1:1,c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0;return new oe(r,t,i,a,o,c,d,s??null)}_writePoint(e,t,i,s){const r=this._getShaping();if(!r)return;const a=s.getDisplayId(),o=xe(this.evaluatedMeshParams.horizontalAlignment),c=ve(this.evaluatedMeshParams.verticalAlignment),d=this.evaluatedMeshParams.scaleInfo?.maxScale??0,l=this.evaluatedMeshParams.scaleInfo?.minScale??0,u=te(s.getDisplayId()),h=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new oe(u,t,i,o,c,d,l,h)),this._writeGlyphs(e,a,t,i,r,0,h),e.metricBoxWrite(r.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:s}=this.evaluatedMeshParams,r=this.evaluatedMeshParams.repeatLabelDistance||128,a=this._getShaping("middle");if(!a)return;const o=(d,l,u,h)=>this._placeSubdivGlyphs(d,l,u,h),c=(a.bounds.width+r)/(1<0&&!(!c&&!d);if(i.metricStart(this._createLineLabelMetric(s,e.x,e.y)),_){const f=Math.max(t,a[0],0),m=Math.min(N,a[1]),p=je(Z(),-e.angle),g={minZoom:f,maxZoom:m,clipAngle:u,mapAligned:!0,isLineLabel:!0},y=R(this.evaluatedMeshParams.offsetX),v=R(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const M=re(y,-1*v),[x,I]=r.shapeBackground(se(Z(),p,M));i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const M=re(y,v),[x,I]=r.shapeBackground(se(Z(),p,M));g.clipAngle=h,i.recordStart(this.instanceId,this.attributeLayout,r.glyphs[0].textureBinding);const b=2*Math.max(x.width,x.height);i.recordBounds(e.x+x.x,e.y+x.y,b,b),this._writeTextBox(i,s,e.x,e.y,I,o,g),i.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(l,t,1,u,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(l,t,0,h,!0),i.metricEnd()}_placeBack(e,t,i,s,r,a){const o=e.clone();let c=e.backwardLength+L;for(;o.prev()&&!(c>=s);)this._placeOnSegment(o,t,c,i,-1,r,a),c+=o.length+L}_placeForward(e,t,i,s,r,a){const o=e.clone();let c=e.remainingLength+L;for(;o.next()&&!(c>=s);)this._placeOnSegment(o,t,c,i,1,r,a),c+=o.length+L}_placeFirst(e,t,i,s,r=!1){const{out:a,id:o,shaping:c,zoomRange:d,referenceBounds:l}=this._current,u=c.glyphs;for(const h of u){const _=h.x>c.bounds.x?i:1-i,f=_*e.remainingLength+(1-_)*e.backwardLength,m=Math.abs(h.x+h.width/2-c.bounds.x),p=Math.max(0,this._zoomLevel+Math.log2(m/(f+L))),g=Math.max(t,r?0:p);h.maxZoom=Math.min(d[1],N),h.angle=e.angle+(1-i)*Math.PI,h.minZoom=Math.max(d[0],g),this._writeLineGlyph(a,o,e.x,e.y,c.bounds,h,s,l,!0),(i||this._current.offsetDirection)&&this._isVisible(h.minZoom,h.maxZoom)&&a.metricBoxWrite(h.bounds)}}_placeOnSegment(e,t,i,s,r,a,o){const{out:c,id:d,shaping:l,referenceBounds:u}=this._current,h=l.glyphs,_=e.dx/e.length,f=e.dy/e.length,m={x:e.x+i*-r*_,y:e.y+i*-r*f};for(const p of h){const g=p.x>l.bounds.x?a:1-a;if(!(g&&r===1||!g&&r===-1))continue;const y=Math.abs(p.x+p.width/2-l.bounds.x),v=Math.max(0,this._zoomLevel+Math.log2(y/i)-.1),M=Math.max(s,this._zoomLevel+Math.log2(y/(i+e.length+L)));v!==0&&(p.angle=e.angle+(1-a)*Math.PI,p.minZoom=M,p.maxZoom=v,this._writeLineGlyph(c,d,m.x,m.y,l.bounds,p,o,u,!0),(a||this._current.offsetDirection)&&this._isVisible(p.minZoom,p.maxZoom)&&c.metricBoxWrite(p.bounds))}}_writeLineGlyph(e,t,i,s,r,a,o,c,d){const l=i+r.x,u=s+r.y,h=2*(this.evaluatedMeshParams.minPixelBuffer?this.evaluatedMeshParams.minPixelBuffer/this._textMeshTransformProps.fontSize:1),_=Math.max(r.width,r.height)*h;e.recordStart(this.instanceId,this.attributeLayout,a.textureBinding),e.recordBounds(l,u,_,_);const{texcoords:f,offsets:m}=a,{fontSize:p,haloSize:g,outlineSize:y}=this._textMeshTransformProps;this._writeQuad(e,t,i,s,{texcoords:f,offsets:m,fontSize:p,haloSize:g,outlineSize:y,color:Ce(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:c,minZoom:Math.max(this._current.zoomRange[0],a.minZoom),maxZoom:Math.min(this._current.zoomRange[1],a.maxZoom),clipAngle:o,mapAligned:d,isLineLabel:!0}),e.recordEnd()}_isVisible(e,t){const i=Math.floor(this._zoomLevel*$)/$;return e<=i&&i<=t}}function he(n,e,t){const{coords:i,lengths:s}=e,r=A(),a=A(),o=A(),c=A(),d=A(),l=A(),u=2;let h=0;for(let _=0;_0?k(r,i[p],i[p+1]):k(r,0,0),k(a,i[g],i[g+1]),mw(e)).map(e=>j(e).simplify()))}function lt(n){const e=[];return e.push(n.transform),e.push(n.fromColor),e.push(n.toColor),e.push(n.colorMix),e.push(n.toOpacity),e.push(n.opacityMix),e}function ge(n){const e=[],t=[];let i=0;for(const s of n){const r=[...s.encode(),...z.ret.encode()];e.push([i+n.length,0,0,0]),t.push(...r),i+=r.length}return[...e,...t]}async function K(n,e){const t=n;let i;if(typeof t=="number"||typeof t=="string"||typeof t=="boolean")i=t;else if(Array.isArray(t))i=await Promise.all(t.map(s=>K(s,e)));else if(typeof t=="object")if("valueExpressionInfo"in t){const{valueExpressionInfo:s}=t,{expression:r}=s;i={...t,computed:await e.createComputedField({expression:r})}}else{i={};for(const s in t)i[s]=await K(t[s],e)}return i}function w(n,e,t){function i(a){if(!("computed"in a))return a;let o=a.computed.readWithDefault(e,t,[255*a.defaultValue[0],255*a.defaultValue[1],255*a.defaultValue[2],a.defaultValue[3]]);if(typeof o=="string"){const c=Se.fromString(o);c&&(o=[c.r,c.g,c.b,c.a])}return o}const s=n;let r;if(typeof s=="number"||typeof s=="string"||typeof s=="boolean")r=s;else if(Array.isArray(s))r=s.map(a=>w(a,e,t));else if(typeof s=="object")if("type"in s&&s.type!=null&&s.type==="Process")switch(s.op){case"ArcadeColor":{const a=w(s.value,e,t);O(Array.isArray(a)&&a.length===4),r=[a[0]/255,a[1]/255,a[2]/255,a[3]]}break;case"Transparency":{const a=w(s.value,e,t);O(typeof a=="number"),r=1-a/100}break;case"Divide":{const a=w(s.left,e,t);O(typeof a=="number");const o=w(s.right,e,t);O(typeof o=="number"),r=a/o}break;case"Random":{const a=w(s.seed,e,t),o=w(s.min,e,t),c=w(s.max,e,t),d=e.getObjectId(),l=fe(d||0);r=o+qe(l,a)*(c-o)}}else if("computed"in s)r=i(s);else{r={};for(const a in s)r[a]=w(s[a],e,t)}return r}function O(n){if(!n)throw new Error("Assertion failed.")}class ht extends Ye{constructor(e){super(),this._value=e}resize(e){}read(e,t){return this._value}readWithDefault(e,t,i){return this._value}referencesScale(){return!1}referencesGeometry(){return!1}}const ut=()=>Ie.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.mesh.MeshWriterInputEvaluator");async function C(n,e,t=!1){const{defaultValue:i,valueExpressionInfo:s,value:r}=e;if(s){const{expression:a}=s,o=await n.createComputedField({expression:a},t);return o?{...e,computed:o,defaultValue:i}:null}return{...e,computed:new ht(r),defaultValue:i}}async function ue(n,e){const{valueExpressionInfo:t}=e,{expression:i}=t,s=await n.createComputedField({expression:i});return s?{...e,computed:s}:null}function ye(n){return typeof n=="object"&&n!=null&&(!(!("valueExpressionInfo"in n)||!n.valueExpressionInfo)||"type"in n&&n.type==="Process"&&"op"in n&&n.op==="Random")}function W(n){if(Array.isArray(n)){for(const e of n)if(W(e))return!0}if(typeof n=="object"){if(ye(n))return!0;for(const e in n)if(W(n[e]))return!0}return!1}class ee{static async create(e,t,i){const s={},r=new Map,a=new Map,o=new Map,c=new Map,d=new Map,l=new Map;for(const u in i){const h=i[u];if(h!=null&&typeof h=="object")if(Array.isArray(h)){if(typeof h[0]=="object")throw new Error(`InternalError: Cannot handle ${u}. Nested array params are not supported`);s[u]=h}else if("valueExpressionInfo"in h){if(h.value){s[u]=h.value;continue}const _=await ue(e,h);if(!_){s[u]=h.defaultValue;continue}r.set(u,_),s[u]=null}else switch(h.type){case"cim-effect-infos":if(h.effectInfos.some(_=>_.overrides.length)){a.set(u,{effects:await Promise.all(h.effectInfos.map(async _=>{const f=_.overrides.map(m=>C(e,m));return{effect:_.effect,compiledOverrides:(await Promise.all(f)).filter(B)}}))});break}s[u]=h.effectInfos.map(_=>_.effect);break;case"cim-marker-placement-param":h.overrides.length&&o.set(u,{placementInfo:h,compiledOverrides:(await Promise.all(h.overrides.map(_=>C(e,_)))).filter(B)}),s[u]=h.placement;break;case"text-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m,h.useLegacyLabelEvaluationRules));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"sprite-rasterization-param":{if(h.overrides.length){const f=h.overrides.map(m=>C(e,m));c.set(u,{compiledOverrides:(await Promise.all(f)).filter(B),rasterizationParam:h,objectIdToResourceId:new Map});continue}if(h.resource.type==="animated"){c.set(u,{compiledOverrides:[],rasterizationParam:h,objectIdToResourceId:new Map});continue}const _={type:"cim-rasterization-info",resource:h.resource};s[u]=await t.fetchResourceImmediate(_)??null;break}case"cim-marker-transform-param":{const{params:_}=h;if(W(_)){const f={compiledMarkerInfos:[]};await Promise.all(_.map(async m=>{const p={props:{}};for(const g in m)if(ye(m[g])){const y=await ue(e,m[g]);p.compiledExpressionMap||(p.compiledExpressionMap=new Map);const v=p.compiledExpressionMap;y&&v.set(g,y)}else p.props[g]=m[g];f.compiledMarkerInfos.push(p)})),d.set(u,f)}else s[u]={type:"cim-marker-transform-info",infos:_};break}case"animation-params":{const{params:_}=h,f=lt(_);if(W(f)){const m=await Promise.all(f.map(p=>K(p,e)));l.set(u,{params:m,propertyIdToResourceId:new Map,key:u})}else{const m=ct(f),p=await t.fetchResourceImmediate({type:"animation-info",resource:m});p!=null&&p.type==="sprite"&&(s[u]={dataRow:p.rect.y,dataColumn:p.rect.x})}break}default:s[u]=h}else s[u]=h}return new ee(i,s,r,a,o,c,d,l)}constructor(e,t,i,s,r,a,o,c){this.inputMeshParams=e,this._resolvedMeshParams=t,this._dynamicProperties=i,this._dynamicEffectProperties=s,this._dynamicPlacementProperties=r,this._dynamicAsyncProperties=a,this._dynamicTransformProperties=o,this._dynamicAsyncAnimations=c,this.evaluator=d=>d}get hasDynamicProperties(){return!!(this._dynamicProperties.size||this._dynamicAsyncProperties.size||this._dynamicEffectProperties.size||this._dynamicTransformProperties.size||this._dynamicPlacementProperties.size||this._dynamicAsyncAnimations.size)}get evaluatedMeshParams(){return this._evaluatedMeshParams||(this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams)),this._evaluatedMeshParams}enqueueRequest(e,t,i){for(const s of this._dynamicAsyncProperties.values()){const r=Me(s.rasterizationParam.resource);s.rasterizationParam.resource.type==="animated"&&s.rasterizationParam.resource.randomizeStartTime&&(r.primitiveName="__RESERVED__PRIMITIVE__NAME__",r.startGroup=fe(t.getObjectId()||0));for(const{primitiveName:o,propertyName:c,computed:d,defaultValue:l,valueExpressionInfo:u}of s.compiledOverrides)try{const h=s.rasterizationParam.resource.type==="animated"?r.primitiveName:o;Ze(r,h,c,d,t,i,l)}catch(h){ut().errorOnce(new be("invalid-arcade-expression",`Encountered an error when evaluating the arcade expression '${u?.expression}' (primitive: '${o}', property: '${c}')`,h))}const a=e.enqueueRequest({type:"cim-rasterization-info",resource:r});s.objectIdToResourceId.set(t.getObjectId(),a)}for(const s of this._dynamicAsyncAnimations.values()){const r=s.params.map(c=>w(c,t,i)).map(j).map(c=>c.simplify()),a=ge(r),o=e.enqueueRequest({type:"animation-info",resource:a});s.propertyIdToResourceId.set(t.getObjectId()+"."+s.key,o)}}evaluateMeshParams(e,t,i){for(const[s,r]of this._dynamicProperties.entries())this._resolvedMeshParams[s]=r.computed.readWithDefault(t,i,r.defaultValue);for(const[s,r]of this._dynamicPlacementProperties.entries())for(const{computed:a,defaultValue:o,propertyName:c}of r.compiledOverrides){const d=a.readWithDefault(t,i,o);r.placementInfo.placement[c]=d,this._resolvedMeshParams[s]=r.placementInfo.placement}for(const[s,r]of this._dynamicEffectProperties.entries())for(const a of r.effects){for(const{computed:o,defaultValue:c,propertyName:d}of a.compiledOverrides){const l=o.readWithDefault(t,i,c);a.effect[d]=l}this._resolvedMeshParams[s]=r.effects.map(o=>o.effect)}for(const[s,r]of this._dynamicTransformProperties.entries()){const a={type:"cim-marker-transform-info",infos:[]};for(const o of r.compiledMarkerInfos){const c={...o.props};if(o.compiledExpressionMap)for(const[d,l]of o.compiledExpressionMap){const u=l.computed.readWithDefault(t,i,l.defaultValue);c[d]=typeof u=="number"||typeof u=="boolean"?u:l.defaultValue}a.infos.push(c)}this._resolvedMeshParams[s]=a}for(const[s,r]of this._dynamicAsyncProperties.entries()){const a=r.objectIdToResourceId.get(t.getObjectId());if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]=o}for(const[s,r]of this._dynamicAsyncAnimations.entries()){const a=r.propertyIdToResourceId.get(t.getObjectId()+"."+s);if(a==null)continue;const o=e.getResource(a);this._resolvedMeshParams[s]={dataRow:o.rect.y,dataColumn:o.rect.x}}return this._evaluatedMeshParams=this.evaluator(this._resolvedMeshParams),this.evaluatedMeshParams}}class kt{async createMeshWriter(e,t,i,s){const r=this._getMeshWriter(s.techniqueType),a=await ee.create(e,t,s.inputParams),o=new r(s.id,a,s.optionalAttributes,i);return await o.loadDependencies(),o}_getMeshWriter(e){switch(e){case P.Fill:return Oe;case P.DotDensity:return Ge;case P.ComplexFill:return Fe;case P.PatternFill:return Be;case P.OutlineFill:return Te;case P.PatternOutlineFill:return Re;case P.ComplexOutlineFill:return Ee;case P.Marker:return De;case P.PieChart:return ze;case P.Text:return de;case P.Line:return Le;case P.TexturedLine:return Ae;case P.Heatmap:return ke;case P.Label:return nt;case P.AnimatedMarker:return $e;default:throw new Error("Internal Error: Mesh writer not in the registry")}}}export{kt as d,ht as g}; diff --git a/custom-toc-highlight/assets/MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js b/custom-toc-highlight/assets/MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js similarity index 97% rename from custom-toc-highlight/assets/MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js rename to custom-toc-highlight/assets/MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js index 82d2f1cb..f8e9df22 100644 --- a/custom-toc-highlight/assets/MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js +++ b/custom-toc-highlight/assets/MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js @@ -1 +1 @@ -import{v as g,i as l,bU as c,cF as N,cG as w,bO as h,bY as J,j as M,cH as _,bP as u,P as v,cI as m,aR as I}from"./story-BfX8CRfG.js";class f{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(_),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new f,s=this._originStores[u.DEFAULTS];s&&s.forEach((i,r)=>{t.set(r,v(i),u.DEFAULTS)});for(let i=u.SERVICE;i<_;i++){const r=this._originStores[i];r&&r.forEach((o,n)=>{e&&e.has(n)||t.set(n,v(o),i)})}return t}get(e,t){const s=t===void 0?this._values:this._originStores[t];return s?s.get(e):void 0}keys(e){const t=e==null?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,s=u.USER){let i=this._originStores[s];if(i||(i=new Map,this._originStores[s]=i),i.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=s){const r=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,s),r!==t}return!1}delete(e,t=u.USER){const s=this._originStores[t];if(!s)return;const i=s.get(e);if(s.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const o=this._originStores[r];if(o&&o.has(e)){this._values.set(e,o.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const s=t===void 0?this._values:this._originStores[t];return!!s&&s.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const s=this._originStores[t],i=s?.get(e),r=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),r!==i}originOf(e){return this._propertyOriginMap.get(e)||u.DEFAULTS}forEach(e){this._values.forEach(e)}}const E=a=>{let e=class extends a{constructor(...t){super(...t);const s=c(this),i=s.store,r=new f;s.store=r,N(s,i,r)}read(t,s){w(this,t,s)}getAtOrigin(t,s){const i=O(this),r=h(s);if(typeof t=="string")return i.get(t,r);const o={};return t.forEach(n=>{o[n]=i.get(n,r)}),o}originOf(t){return J(this.originIdOf(t))}originIdOf(t){return O(this).originOf(t)}revert(t,s){const i=O(this),r=h(s),o=c(this);let n;n=typeof t=="string"?t==="*"?i.keys(r):[t]:t,n.forEach(p=>{o.invalidate(p),i.revert(p,r),o.commit(p)})}};return e=g([l("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function O(a){return c(a).store}let d=class extends E(M){};d=g([l("esri.core.ReadOnlyMultiOriginJSONSupport")],d);const U=a=>{let e=class extends a{constructor(...t){super(...t)}clear(t,s="user"){return S(this).delete(t,h(s))}write(t,s){return m(this,t=t||{},s),t}setAtOrigin(t,s,i){c(this).setAtOrigin(t,s,h(i))}removeOrigin(t){const s=S(this),i=h(t),r=s.keys(i);for(const o of r)s.originOf(o)===i&&s.set(o,s.get(o,i),u.USER)}updateOrigin(t,s){const i=S(this),r=h(s),o=I(this,t);for(let n=r+1;n<_;++n)i.delete(t,n);i.set(t,o,r)}toJSON(t){return this.write({},t)}};return e=g([l("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function S(a){return c(a).store}const x=a=>{let e=class extends U(E(a)){constructor(...t){super(...t)}};return e=g([l("esri.core.MultiOriginJSONSupport")],e),e};let y=class extends x(M){};y=g([l("esri.core.MultiOriginJSONSupport")],y);export{y as _,x as m}; +import{v as g,i as l,bU as c,cF as N,cG as w,bO as h,bY as J,j as M,cH as _,bP as u,P as v,cI as m,aR as I}from"./story-Doly9N9p.js";class f{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(_),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){const t=new f,s=this._originStores[u.DEFAULTS];s&&s.forEach((i,r)=>{t.set(r,v(i),u.DEFAULTS)});for(let i=u.SERVICE;i<_;i++){const r=this._originStores[i];r&&r.forEach((o,n)=>{e&&e.has(n)||t.set(n,v(o),i)})}return t}get(e,t){const s=t===void 0?this._values:this._originStores[t];return s?s.get(e):void 0}keys(e){const t=e==null?this._values:this._originStores[e];return t?[...t.keys()]:[]}set(e,t,s=u.USER){let i=this._originStores[s];if(i||(i=new Map,this._originStores[s]=i),i.set(e,t),!this._values.has(e)||this._propertyOriginMap.get(e)<=s){const r=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,s),r!==t}return!1}delete(e,t=u.USER){const s=this._originStores[t];if(!s)return;const i=s.get(e);if(s.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===t){this._values.delete(e);for(let r=t-1;r>=0;r--){const o=this._originStores[r];if(o&&o.has(e)){this._values.set(e,o.get(e)),this._propertyOriginMap.set(e,r);break}}}return i}has(e,t){const s=t===void 0?this._values:this._originStores[t];return!!s&&s.has(e)}revert(e,t){for(;t>0&&!this.has(e,t);)--t;const s=this._originStores[t],i=s?.get(e),r=this._values.get(e);return this._values.set(e,i),this._propertyOriginMap.set(e,t),r!==i}originOf(e){return this._propertyOriginMap.get(e)||u.DEFAULTS}forEach(e){this._values.forEach(e)}}const E=a=>{let e=class extends a{constructor(...t){super(...t);const s=c(this),i=s.store,r=new f;s.store=r,N(s,i,r)}read(t,s){w(this,t,s)}getAtOrigin(t,s){const i=O(this),r=h(s);if(typeof t=="string")return i.get(t,r);const o={};return t.forEach(n=>{o[n]=i.get(n,r)}),o}originOf(t){return J(this.originIdOf(t))}originIdOf(t){return O(this).originOf(t)}revert(t,s){const i=O(this),r=h(s),o=c(this);let n;n=typeof t=="string"?t==="*"?i.keys(r):[t]:t,n.forEach(p=>{o.invalidate(p),i.revert(p,r),o.commit(p)})}};return e=g([l("esri.core.ReadOnlyMultiOriginJSONSupport")],e),e};function O(a){return c(a).store}let d=class extends E(M){};d=g([l("esri.core.ReadOnlyMultiOriginJSONSupport")],d);const U=a=>{let e=class extends a{constructor(...t){super(...t)}clear(t,s="user"){return S(this).delete(t,h(s))}write(t,s){return m(this,t=t||{},s),t}setAtOrigin(t,s,i){c(this).setAtOrigin(t,s,h(i))}removeOrigin(t){const s=S(this),i=h(t),r=s.keys(i);for(const o of r)s.originOf(o)===i&&s.set(o,s.get(o,i),u.USER)}updateOrigin(t,s){const i=S(this),r=h(s),o=I(this,t);for(let n=r+1;n<_;++n)i.delete(t,n);i.set(t,o,r)}toJSON(t){return this.write({},t)}};return e=g([l("esri.core.MultiOriginJSONSupport.WriteableMultiOriginJSONSupport")],e),e.prototype.toJSON.isDefaultToJSON=!0,e};function S(a){return c(a).store}const x=a=>{let e=class extends U(E(a)){constructor(...t){super(...t)}};return e=g([l("esri.core.MultiOriginJSONSupport")],e),e};let y=class extends x(M){};y=g([l("esri.core.MultiOriginJSONSupport")],y);export{y as _,x as m}; diff --git a/custom-toc-highlight/assets/NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js b/custom-toc-highlight/assets/NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js similarity index 93% rename from custom-toc-highlight/assets/NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js rename to custom-toc-highlight/assets/NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js index 65dd040b..0ba57992 100644 --- a/custom-toc-highlight/assets/NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js +++ b/custom-toc-highlight/assets/NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js @@ -1,4 +1,4 @@ -import"./story-BfX8CRfG.js";import{t as u}from"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import{e as n}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as a}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";var r;(function(e){e[e.Multiply=1]="Multiply",e[e.Ignore=2]="Ignore",e[e.Replace=3]="Replace",e[e.Tint=4]="Tint"})(r||(r={}));var o;function N(e){return e===o.Shadow||e===o.ShadowHighlight||e===o.ShadowExcludeHighlight||e===o.ViewshedShadow}function b(e){return p(e)||e===o.Normal}function O(e){return f(e)||e===o.Normal}function d(e){return e===o.Highlight||e===o.ObjectAndLayerIdColor}function l(e){return e===o.Color}function s(e){return l(e)||g(e)}function h(e){return l(e)||d(e)}function m(e){return s(e)||d(e)}function p(e){return h(e)||c(e)}function f(e){return m(e)||c(e)}function c(e){return e===o.Depth}function g(e){return e===o.ColorEmission}(function(e){e[e.Color=0]="Color",e[e.ColorEmission=1]="ColorEmission",e[e.Depth=2]="Depth",e[e.Normal=3]="Normal",e[e.Shadow=4]="Shadow",e[e.ShadowHighlight=5]="ShadowHighlight",e[e.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",e[e.ViewshedShadow=7]="ViewshedShadow",e[e.Highlight=8]="Highlight",e[e.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",e[e.COUNT=10]="COUNT"})(o||(o={}));function T(e,i){switch(i.normalType){case t.Compressed:e.attributes.add(a.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(n`vec3 decompressNormal(vec2 normal) { +import"./story-Doly9N9p.js";import{t as u}from"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import{e as n}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{T as a}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";var r;(function(e){e[e.Multiply=1]="Multiply",e[e.Ignore=2]="Ignore",e[e.Replace=3]="Replace",e[e.Tint=4]="Tint"})(r||(r={}));var o;function N(e){return e===o.Shadow||e===o.ShadowHighlight||e===o.ShadowExcludeHighlight||e===o.ViewshedShadow}function b(e){return p(e)||e===o.Normal}function O(e){return f(e)||e===o.Normal}function d(e){return e===o.Highlight||e===o.ObjectAndLayerIdColor}function l(e){return e===o.Color}function s(e){return l(e)||g(e)}function h(e){return l(e)||d(e)}function m(e){return s(e)||d(e)}function p(e){return h(e)||c(e)}function f(e){return m(e)||c(e)}function c(e){return e===o.Depth}function g(e){return e===o.ColorEmission}(function(e){e[e.Color=0]="Color",e[e.ColorEmission=1]="ColorEmission",e[e.Depth=2]="Depth",e[e.Normal=3]="Normal",e[e.Shadow=4]="Shadow",e[e.ShadowHighlight=5]="ShadowHighlight",e[e.ShadowExcludeHighlight=6]="ShadowExcludeHighlight",e[e.ViewshedShadow=7]="ViewshedShadow",e[e.Highlight=8]="Highlight",e[e.ObjectAndLayerIdColor=9]="ObjectAndLayerIdColor",e[e.COUNT=10]="COUNT"})(o||(o={}));function T(e,i){switch(i.normalType){case t.Compressed:e.attributes.add(a.NORMALCOMPRESSED,"vec2"),e.vertex.code.add(n`vec3 decompressNormal(vec2 normal) { float z = 1.0 - abs(normal.x) - abs(normal.y); return vec3(normal + sign(normal) * min(z, 0.0), z); } diff --git a/custom-toc-highlight/assets/OGCFeatureLayer-DPXQjO1S-DQtwLAZb.js b/custom-toc-highlight/assets/OGCFeatureLayer-DPXQjO1S-CQDhGgy_.js similarity index 74% rename from custom-toc-highlight/assets/OGCFeatureLayer-DPXQjO1S-DQtwLAZb.js rename to custom-toc-highlight/assets/OGCFeatureLayer-DPXQjO1S-CQDhGgy_.js index aabe4d1e..9122b1aa 100644 --- a/custom-toc-highlight/assets/OGCFeatureLayer-DPXQjO1S-DQtwLAZb.js +++ b/custom-toc-highlight/assets/OGCFeatureLayer-DPXQjO1S-CQDhGgy_.js @@ -1 +1 @@ -import{v as t,S as o,i as D,bT as w,dL as $,n as H,bW as b,bL as J,J as g,aB as N,c6 as x,dJ as Z,o as R}from"./story-BfX8CRfG.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{m as z,u as V}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{m as U}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as W}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{T as k,y as I,j as F,I as K,h as Y,b as X,F as ee,w as te,M as re}from"./ogcFeatureUtils-Bs12bZY3-BXRrRRmn.js";import{s as oe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{O as ie}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{n as se}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{u as pe}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{l as ae}from"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import{E as ue}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{p as de}from"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import{C as ce}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as me}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as ye}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{$ as he,Y as ge,_ as ve,X as Se,V as Ce,Z as we}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{y as be}from"./FeatureType-C9hJmS6_-BXWT6QCe.js";import{y as xe}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{f as Re}from"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import{C as Ie,q as Fe}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{b as T}from"./Query-BrwMGK8U-DoFNfkjX.js";import{w as Te}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./main-ugzBrWNm.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./geojson-CNt_qtQf-B9F87hyc.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-B-0mBem3.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./sourceUtils-BMeqkJ5g-DxP4qerC.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";let d=class extends N{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:i,spatialReference:s,supportedCrs:p},layer:{apiKey:l,customParameters:a,effectiveMaxRecordCount:n}}=this;return{type:"ogc-source",collection:e,layerDefinition:i,maxRecordCount:n,queryParameters:{apiKey:l,customParameters:a},spatialReference:s,supportedCrs:p}}queryExtent(e,i={}){return null}queryFeatureCount(e,i={}){return null}queryFeatures(e,i={}){return this.queryFeaturesJSON(e,i).then(s=>ie.fromJSON(s))}queryFeaturesJSON(e,i={}){const s=this.getSource();return this.load(i).then(()=>k(s,e,i))}queryObjectIds(e,i={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,i){const s=new RegExp(`^${x(i)}$`,"i");return e.conformsTo.some(p=>s.test(p))??!1}_getCapabilities(e,i){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:i,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,supportsQueryByAnonymous:!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},queryBins:oe,editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const i=e?.components?.parameters;return i?.limit?.schema?.maximum??i?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const i=e.storageCrs??I,s=F(i);return s==null?g.WGS84:new g({wkid:s})}_getSupportedSpatialReferences(e,i){const s="#/crs",p=e.crs??[I],l=p.includes(s)?p.filter(n=>n!==s).concat(i.crs??[]):p,a=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return l.filter(n=>!a.test(n))}async _loadOGCServices(e,i){const s=i!=null?i.signal:null,{apiKey:p,collectionId:l,customParameters:a,fields:n,geometryType:O,hasZ:j,objectIdField:P,timeInfo:_,url:E}=e,q={fields:n?.map(u=>u.toJSON()),geometryType:Z.toJSON(O),hasZ:j??!1,objectIdField:P,timeInfo:_?.toJSON()},c={apiKey:p,customParameters:a,signal:s},y=await K(E,c),[v,S]=await Promise.all([Y(y,c),X(y,c)]);if(!this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new R("ogc-feature-layer:no-geojson-support","Server does not support geojson");const m=S.collections.find(({id:u})=>u===l);if(!m)throw new R("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const Q=this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await ee(y,c):null,C=await te(m,q,c),B=this._getMaxRecordCount(Q),G=this._getCapabilities(C.hasZ,B),A=this._getStorageSpatialReference(m).toJSON(),M=this._getSupportedSpatialReferences(m,S),L=new RegExp(`^${x(re)}`,"i"),f={};for(const u of M){const h=F(u);h!=null&&(f[h]||(f[h]=u.replace(L,"")))}this.featureDefinition={capabilities:G,collection:m,layerDefinition:C,spatialReference:A,supportedCrs:f}}};t([o()],d.prototype,"featureDefinition",void 0),t([o({constructOnly:!0})],d.prototype,"layer",void 0),t([o()],d.prototype,"type",void 0),d=t([D("esri.layers.graphics.sources.OGCFeatureSource")],d);const De=Re();let r=class extends se(ne(le(ae(pe(de(fe(ye(ue(ce(me(U(W)))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=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 d({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){return this.maxRecordCount??this.capabilities?.query.maxRecordCount??5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){w(e,this.fieldsIndex),this._set("renderer",e)}on(e,i){return super.on(e,i)}createPopupTemplate(e){return Te(this,e)}createQuery(){return new T}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){let s,p=!1;const l=i?.feature?.attributes,a=this.typeIdField&&l?.[this.typeIdField];return a!=null&&this.types&&(p=this.types.some(n=>n.id==a&&(s=n.domains?.[e],s?.type==="inherited"&&(s=this._getLayerDomain(e)),!0))),p||s||(s=this._getLayerDomain(e)),s}queryFeatures(e,i){return this.load().then(()=>this.source.queryFeatures(T.from(e)||this.createQuery(),i)).then(s=>(s?.features?.forEach(p=>{p.layer=p.sourceLayer=this}),s))}serviceSupportsSpatialReference(e){return this.source?.serviceSupportsSpatialReference(e)??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),w(this.renderer,this.fieldsIndex),$(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const i of this.fields)if(i.name===e&&i.domain)return i.domain;return null}};t([o({readOnly:!0,json:{origins:{service:{read:!0}}}})],r.prototype,"capabilities",void 0),t([o({type:String,json:{write:!0}})],r.prototype,"collectionId",void 0),t([o({type:String})],r.prototype,"copyright",void 0),t([o({readOnly:!0})],r.prototype,"defaultPopupTemplate",null),t([o({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],r.prototype,"description",void 0),t([o({type:String})],r.prototype,"displayField",void 0),t([o({type:Number})],r.prototype,"effectiveMaxRecordCount",null),t([o(he)],r.prototype,"elevationInfo",void 0),t([o({type:[xe],json:{origins:{service:{name:"layerDefinition.fields"}}}})],r.prototype,"fields",void 0),t([o(De.fieldsIndex)],r.prototype,"fieldsIndex",void 0),t([o({readOnly:!0,type:H,json:{origins:{service:{name:"layerDefinition.extent"}}}})],r.prototype,"fullExtent",void 0),t([o({type:b.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:b.read}}}}})],r.prototype,"geometryType",void 0),t([o({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],r.prototype,"hasZ",void 0),t([o({type:Boolean,readOnly:!0})],r.prototype,"isTable",null),t([o({type:[Ie],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Fe},write:!0}}}})],r.prototype,"labelingInfo",void 0),t([o(ge)],r.prototype,"labelsVisible",void 0),t([o(ve)],r.prototype,"legendEnabled",void 0),t([o({type:Number})],r.prototype,"maxRecordCount",void 0),t([o({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],r.prototype,"objectIdField",void 0),t([o({type:["OGCFeatureLayer"]})],r.prototype,"operationalLayerType",void 0),t([o(Se)],r.prototype,"popupEnabled",void 0),t([o({type:J,json:{name:"popupInfo",write:!0}})],r.prototype,"popupTemplate",void 0),t([o({types:z,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:V,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],r.prototype,"renderer",null),t([o(Ce)],r.prototype,"screenSizePerspectiveEnabled",void 0),t([o({readOnly:!0})],r.prototype,"source",void 0),t([o({readOnly:!0,type:g,json:{origins:{service:{read:!0}}}})],r.prototype,"spatialReference",void 0),t([o({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],r.prototype,"title",void 0),t([o({readOnly:!0,json:{read:!1}})],r.prototype,"type",void 0),t([o({type:String,readOnly:!0})],r.prototype,"typeIdField",void 0),t([o({type:[be]})],r.prototype,"types",void 0),t([o(we)],r.prototype,"url",void 0),r=t([D("esri.layers.OGCFeatureLayer")],r);const Xt=r;export{Xt as default}; +import{v as t,S as o,i as D,bT as w,dL as $,n as H,bW as b,bL as J,J as g,aB as N,c6 as x,dJ as Z,o as R}from"./story-Doly9N9p.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{m as z,u as V}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{m as U}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as W}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{T as k,y as I,j as F,I as K,h as Y,b as X,F as ee,w as te,M as re}from"./ogcFeatureUtils-Bs12bZY3-bQ3aM3rZ.js";import{s as oe}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{O as ie}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{n as se}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{u as pe}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{l as ae}from"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import{E as ue}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{p as de}from"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import{C as ce}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as me}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as ye}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{$ as he,Y as ge,_ as ve,X as Se,V as Ce,Z as we}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{y as be}from"./FeatureType-C9hJmS6_-CNlvn5D1.js";import{y as xe}from"./Field-C6hA1tZj-CkWoRbmp.js";import{f as Re}from"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import{C as Ie,q as Fe}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{b as T}from"./Query-BrwMGK8U-BPr0_G9t.js";import{w as Te}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./main-QGPoLsvl.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./geojson-CNt_qtQf-X0105Nc8.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./sourceUtils-BMeqkJ5g-DcR3VPl5.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";let d=class extends N{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:i,spatialReference:s,supportedCrs:p},layer:{apiKey:l,customParameters:a,effectiveMaxRecordCount:n}}=this;return{type:"ogc-source",collection:e,layerDefinition:i,maxRecordCount:n,queryParameters:{apiKey:l,customParameters:a},spatialReference:s,supportedCrs:p}}queryExtent(e,i={}){return null}queryFeatureCount(e,i={}){return null}queryFeatures(e,i={}){return this.queryFeaturesJSON(e,i).then(s=>ie.fromJSON(s))}queryFeaturesJSON(e,i={}){const s=this.getSource();return this.load(i).then(()=>k(s,e,i))}queryObjectIds(e,i={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,i){const s=new RegExp(`^${x(i)}$`,"i");return e.conformsTo.some(p=>s.test(p))??!1}_getCapabilities(e,i){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryBins:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:i,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,supportsQueryByAnonymous:!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},queryBins:oe,editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}_getMaxRecordCount(e){const i=e?.components?.parameters;return i?.limit?.schema?.maximum??i?.limitFeatures?.schema?.maximum}_getStorageSpatialReference(e){const i=e.storageCrs??I,s=F(i);return s==null?g.WGS84:new g({wkid:s})}_getSupportedSpatialReferences(e,i){const s="#/crs",p=e.crs??[I],l=p.includes(s)?p.filter(n=>n!==s).concat(i.crs??[]):p,a=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return l.filter(n=>!a.test(n))}async _loadOGCServices(e,i){const s=i!=null?i.signal:null,{apiKey:p,collectionId:l,customParameters:a,fields:n,geometryType:O,hasZ:j,objectIdField:P,timeInfo:_,url:E}=e,q={fields:n?.map(u=>u.toJSON()),geometryType:Z.toJSON(O),hasZ:j??!1,objectIdField:P,timeInfo:_?.toJSON()},c={apiKey:p,customParameters:a,signal:s},y=await K(E,c),[v,S]=await Promise.all([Y(y,c),X(y,c)]);if(!this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new R("ogc-feature-layer:no-geojson-support","Server does not support geojson");const m=S.collections.find(({id:u})=>u===l);if(!m)throw new R("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const Q=this._conformsToType(v,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await ee(y,c):null,C=await te(m,q,c),B=this._getMaxRecordCount(Q),G=this._getCapabilities(C.hasZ,B),A=this._getStorageSpatialReference(m).toJSON(),M=this._getSupportedSpatialReferences(m,S),L=new RegExp(`^${x(re)}`,"i"),f={};for(const u of M){const h=F(u);h!=null&&(f[h]||(f[h]=u.replace(L,"")))}this.featureDefinition={capabilities:G,collection:m,layerDefinition:C,spatialReference:A,supportedCrs:f}}};t([o()],d.prototype,"featureDefinition",void 0),t([o({constructOnly:!0})],d.prototype,"layer",void 0),t([o()],d.prototype,"type",void 0),d=t([D("esri.layers.graphics.sources.OGCFeatureSource")],d);const De=Re();let r=class extends se(ne(le(ae(pe(de(fe(ye(ue(ce(me(U(W)))))))))))){constructor(e){super(e),this.capabilities=null,this.collectionId=null,this.copyright=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 d({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){this.source?.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){return this.maxRecordCount??this.capabilities?.query.maxRecordCount??5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){w(e,this.fieldsIndex),this._set("renderer",e)}on(e,i){return super.on(e,i)}createPopupTemplate(e){return Te(this,e)}createQuery(){return new T}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,i){let s,p=!1;const l=i?.feature?.attributes,a=this.typeIdField&&l?.[this.typeIdField];return a!=null&&this.types&&(p=this.types.some(n=>n.id==a&&(s=n.domains?.[e],s?.type==="inherited"&&(s=this._getLayerDomain(e)),!0))),p||s||(s=this._getLayerDomain(e)),s}queryFeatures(e,i){return this.load().then(()=>this.source.queryFeatures(T.from(e)||this.createQuery(),i)).then(s=>(s?.features?.forEach(p=>{p.layer=p.sourceLayer=this}),s))}serviceSupportsSpatialReference(e){return this.source?.serviceSupportsSpatialReference(e)??!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),w(this.renderer,this.fieldsIndex),$(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const i of this.fields)if(i.name===e&&i.domain)return i.domain;return null}};t([o({readOnly:!0,json:{origins:{service:{read:!0}}}})],r.prototype,"capabilities",void 0),t([o({type:String,json:{write:!0}})],r.prototype,"collectionId",void 0),t([o({type:String})],r.prototype,"copyright",void 0),t([o({readOnly:!0})],r.prototype,"defaultPopupTemplate",null),t([o({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],r.prototype,"description",void 0),t([o({type:String})],r.prototype,"displayField",void 0),t([o({type:Number})],r.prototype,"effectiveMaxRecordCount",null),t([o(he)],r.prototype,"elevationInfo",void 0),t([o({type:[xe],json:{origins:{service:{name:"layerDefinition.fields"}}}})],r.prototype,"fields",void 0),t([o(De.fieldsIndex)],r.prototype,"fieldsIndex",void 0),t([o({readOnly:!0,type:H,json:{origins:{service:{name:"layerDefinition.extent"}}}})],r.prototype,"fullExtent",void 0),t([o({type:b.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:b.read}}}}})],r.prototype,"geometryType",void 0),t([o({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],r.prototype,"hasZ",void 0),t([o({type:Boolean,readOnly:!0})],r.prototype,"isTable",null),t([o({type:[Ie],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Fe},write:!0}}}})],r.prototype,"labelingInfo",void 0),t([o(ge)],r.prototype,"labelsVisible",void 0),t([o(ve)],r.prototype,"legendEnabled",void 0),t([o({type:Number})],r.prototype,"maxRecordCount",void 0),t([o({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],r.prototype,"objectIdField",void 0),t([o({type:["OGCFeatureLayer"]})],r.prototype,"operationalLayerType",void 0),t([o(Se)],r.prototype,"popupEnabled",void 0),t([o({type:J,json:{name:"popupInfo",write:!0}})],r.prototype,"popupTemplate",void 0),t([o({types:z,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:V,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],r.prototype,"renderer",null),t([o(Ce)],r.prototype,"screenSizePerspectiveEnabled",void 0),t([o({readOnly:!0})],r.prototype,"source",void 0),t([o({readOnly:!0,type:g,json:{origins:{service:{read:!0}}}})],r.prototype,"spatialReference",void 0),t([o({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],r.prototype,"title",void 0),t([o({readOnly:!0,json:{read:!1}})],r.prototype,"type",void 0),t([o({type:String,readOnly:!0})],r.prototype,"typeIdField",void 0),t([o({type:[be]})],r.prototype,"types",void 0),t([o(we)],r.prototype,"url",void 0),r=t([D("esri.layers.OGCFeatureLayer")],r);const Xt=r;export{Xt as default}; diff --git a/custom-toc-highlight/assets/OGCFeatureLayerView2D-CpSy5D2s-DSwmstmQ.js b/custom-toc-highlight/assets/OGCFeatureLayerView2D-CpSy5D2s-DSwmstmQ.js new file mode 100644 index 00000000..7c3bdd27 --- /dev/null +++ b/custom-toc-highlight/assets/OGCFeatureLayerView2D-CpSy5D2s-DSwmstmQ.js @@ -0,0 +1 @@ +import{v as t,i as m,S as o}from"./story-Doly9N9p.js";import{r as a}from"./FeatureLayerView2D-NmRd_IhT-DLbw0NYz.js";import"./main-QGPoLsvl.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./timeSupport-ohWmWReZ-D2lpSlXU.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./LayerView-Bish-E63-DK1SFHE3.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./SDFHelper-B6k8Ig6R-CgiA_-9V.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-BYG2KoFf.js";import"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";const s=i=>{let r=class extends i{get availableFields(){return this.layer.fieldsIndex.fields.map(e=>e.name)}};return t([o()],r.prototype,"layer",void 0),t([o({readOnly:!0})],r.prototype,"availableFields",null),r=t([m("esri.views.layers.OGCFeatureLayerView")],r),r};let p=class extends s(a){supportsSpatialReference(i){return this.layer.serviceSupportsSpatialReference(i)}};p=t([m("esri.views.2d.layers.OGCFeatureLayerView2D")],p);const st=p;export{st as default}; diff --git a/custom-toc-highlight/assets/OGCFeatureLayerView2D-CpSy5D2s-nBaV6Pmc.js b/custom-toc-highlight/assets/OGCFeatureLayerView2D-CpSy5D2s-nBaV6Pmc.js deleted file mode 100644 index 9e388914..00000000 --- a/custom-toc-highlight/assets/OGCFeatureLayerView2D-CpSy5D2s-nBaV6Pmc.js +++ /dev/null @@ -1 +0,0 @@ -import{v as t,i as m,S as o}from"./story-BfX8CRfG.js";import{r as a}from"./FeatureLayerView2D-NmRd_IhT-CufQiRFK.js";import"./main-ugzBrWNm.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./timeSupport-ohWmWReZ-ByDHlqgT.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./LayerView-Bish-E63-rB2WUWF4.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./SDFHelper-B6k8Ig6R-BNeqNf2Z.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-DAL58cHP.js";import"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";const s=i=>{let r=class extends i{get availableFields(){return this.layer.fieldsIndex.fields.map(e=>e.name)}};return t([o()],r.prototype,"layer",void 0),t([o({readOnly:!0})],r.prototype,"availableFields",null),r=t([m("esri.views.layers.OGCFeatureLayerView")],r),r};let p=class extends s(a){supportsSpatialReference(i){return this.layer.serviceSupportsSpatialReference(i)}};p=t([m("esri.views.2d.layers.OGCFeatureLayerView2D")],p);const st=p;export{st as default}; diff --git a/custom-toc-highlight/assets/Octree-CJNwbhg4-kBqt3mh_.js b/custom-toc-highlight/assets/Octree-CJNwbhg4-DECX_J2V.js similarity index 97% rename from custom-toc-highlight/assets/Octree-CJNwbhg4-kBqt3mh_.js rename to custom-toc-highlight/assets/Octree-CJNwbhg4-DECX_J2V.js index 74e9cc3d..3afaa1e5 100644 --- a/custom-toc-highlight/assets/Octree-CJNwbhg4-kBqt3mh_.js +++ b/custom-toc-highlight/assets/Octree-CJNwbhg4-DECX_J2V.js @@ -1 +1 @@ -import{dB as mt,c$ as $,dg as F,hZ as m}from"./story-BfX8CRfG.js";import{A as Z,X as Ot,_ as Rt,L as q,j as k,p as Q}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{X as ht,d as tt,C as w,l as et,a as J,G as nt,F as T,b as z}from"./sphere-BenPORjV-DaZ5Vv8x.js";import{B as pt,z as At}from"./mat4-DX7gBViE-DVqdGrVU.js";import{D as bt}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{e as B}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{y as A,j as Ft,o as Et,J as Nt,G as L}from"./plane-Dt8R0KeE-CVSP2GQG.js";import{l as at}from"./Util-BjGjeg6f-08Szkf4F.js";function lt(o){return o?{ray:tt(o.ray),c0:o.c0,c1:o.c1}:{ray:tt(),c0:0,c1:Number.MAX_VALUE}}new ht(()=>lt());function Xt(o){return o?[A(o[0]),A(o[1]),A(o[2]),A(o[3]),A(o[4]),A(o[5])]:[A(),A(),A(),A(),A(),A()]}function gt(){return[F(),F(),F(),F(),F(),F(),F(),F()]}function Vt(o,t){for(let e=0;e=t[3])return!1}return!0}var M,i;(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"})(M||(M={})),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"}(i||(i={})),i.FAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_LEFT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_BOTTOM_RIGHT,i.NEAR_TOP_RIGHT,i.NEAR_TOP_LEFT,i.FAR_BOTTOM_RIGHT,i.FAR_BOTTOM_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_RIGHT,i.NEAR_BOTTOM_RIGHT,i.FAR_BOTTOM_RIGHT,i.FAR_TOP_RIGHT,i.NEAR_TOP_RIGHT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_TOP_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_LEFT,i.NEAR_TOP_LEFT,i.NEAR_TOP_RIGHT,i.FAR_TOP_RIGHT;const dt=6,Mt=8,St=[B(-1,-1,-1,1),B(1,-1,-1,1),B(1,1,-1,1),B(-1,1,-1,1),B(-1,-1,1,1),B(1,-1,1,1),B(1,1,1,1),B(-1,1,1,1)];new ht(lt);const xt=gt();class I{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}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new l,this._objectCount=0,e&&(e.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),e.maximumDepth!==void 0&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),l.clearPool(),U[0]=null,j.prune(),P.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=l.acquire();for(let s=0;s{if(!It(s,r))return!1;const a=r.node;return a.terminals.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),a.residents!==null&&a.residents.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,s){const r=et(t,e);x(this._root,a=>{if(!Lt(r,a,s))return!1;const u=a.node;return u.terminals.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),u.residents!==null&&u.residents.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),!0})}forEach(t){x(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,s=()=>!0,r=1/0){let a=1/0,u=1/0,h=null;const c=K(t,e),f=d=>{if(--r,!s(d))return;const O=this.objectToBoundingSphere(d);if(!v(n,O))return;const E=S(t,e,T(O)),G=E-O[3],_=E+O[3];G{if(r<=0||!v(n,d.bounds)||(q(b,c,d.halfSize),k(b,b,T(d.bounds)),S(t,e,b)>u))return!1;const O=d.node;return O.terminals.forAll(E=>f(E)),O.residents!==null&&O.residents.forAll(E=>f(E)),!0},t,e),h}forEachInDepthRange(t,e,n,s,r,a,u){let h=-1/0,c=1/0;const f={setRange:_=>{n===I.DepthOrder.FRONT_TO_BACK?(h=Math.max(h,_.near),c=Math.min(c,_.far)):(h=Math.max(h,-_.far),c=Math.min(c,-_.near))}};f.setRange(s);const d=S(e,n,t),O=K(e,n),E=K(e,-n),G=_=>{if(!u(_))return;const g=this.objectToBoundingSphere(_),H=T(g),Y=S(e,n,H)-d,Tt=Y-g[3],ft=Y+g[3];Tt>c||ft{if(!v(a,_.bounds)||(q(b,O,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-d>c)||(q(b,E,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-dG(H)),g.residents!==null&&g.residents.forAll(H=>G(H)),!0},e,n)}forEachNode(t){x(this._root,e=>t(e.node,e.bounds,e.halfSize,e.depth))}forEachNeighbor(t,e){const n=J(e),s=T(e),r=h=>{const c=this.objectToBoundingSphere(h),f=J(c),d=n+f;return!(Q(T(c),s)-d*d<=0)||t(h)};let a=!0;const u=h=>{a&&(a=r(h))};x(this._root,h=>{const c=J(h.bounds),f=n+c;if(Q(T(h.bounds),s)-f*f>0)return!1;const d=h.node;return d.terminals.forAll(u),a&&d.residents!==null&&d.residents.forAll(u),a}),a&&this.forEachDegenerateObject(u)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||nt(n,t)}_intersectsObjectWithOffset(t,e,n){const s=this.objectToBoundingSphere(e);return!(s[3]>0)||nt(n.applyToBoundingSphere(s),t)}_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),N),D(N[3])&&!this._fitsInsideTree(N)))if(ut(this._root.node))w(N,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const n=this._rootBoundsForRootAsSubNode(N);this._placingRootViolatesMaxDepth(n)?this._rebuildTree(N,n):this._growRootAsSubNode(n),l.release(n)}}_rebuildTree(t,e){Z(T(V),T(e.bounds)),V[3]=e.halfSize,st([t,V],2,s=>s,W);const n=l.acquire().init(this._root);this._root.initFrom(null,W,W[3]),this._root.increaseHalfSize(1.25),x(n,s=>(this.add(s.node.terminals.data,s.node.terminals.length),s.node.residents!==null&&this.add(s.node.residents.data,s.node.residents.length),!0)),l.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return x(this._root,s=>(n=Math.max(n,s.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let s=-1/0;const r=this._root.bounds,a=this._root.halfSize;for(let h=0;h<3;h++){const c=r[h]-a-(n[h]-e),f=n[h]+e-(r[h]+a),d=Math.max(0,Math.ceil(c/(2*a))),O=Math.max(0,Math.ceil(f/(2*a)))+1,E=2**Math.ceil(Math.log(d+O)*Math.LOG2E);s=Math.max(s,E),C[h].min=d,C[h].max=O}for(let h=0;h<3;h++){let c=C[h].min,f=C[h].max;const d=(s-(c+f))/2;c+=Math.ceil(d),f+=Math.floor(d);const O=r[h]-a-c*a*2;X[h]=O+(f+c)*a}const u=s*a;return X[3]=u*_t,l.acquire().initFrom(null,X,u,0)}_growRootAsSubNode(t){const e=this._root.node;Z(T(N),T(this._root.bounds)),N[3]=this._root.halfSize,this._root.init(t),t.advanceTo(N,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,s=0;for(;s=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}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,s=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:s}}}_nodeToJSON(t){const e=t.children.map(r=>r?this._nodeToJSON(r):null),n=t.residents?.map(r=>this.objectToBoundingSphere(r)),s=t.terminals?.map(r=>this.objectToBoundingSphere(r));return{children:e,residents:n,terminals:s}}static fromJSON(t){const e=new I(n=>n,{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class l{constructor(){this.bounds=z(),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,s=this.depth){return this.node=t??l.createEmptyNode(),e&&w(e,this.bounds),this.halfSize=n,this.depth=s,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*_t}advance(t){let e=this.node.children[t];e||(e=l.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=ct[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),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 s=this._childIndex(t);e&&e(this,s),this.advance(s)}}isLeaf(){return this.node.residents!=null}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]=0;--a){const u=it[a];s.node.children[u]&&r.push(l.acquire().init(s).advance(u))}l.release(s)}}function jt(o,t,e){j.clear();const n=e.advanceTo(t,(s,r)=>{j.push(s.node),j.push(r)})?e.node.terminals:e.node.residents;if(n.removeUnordered(o),n.length===0)for(let s=j.length-2;s>=0&&Pt(j.data[s],j.data[s+1]);s-=2);}function Pt(o,t){return t>=0&&(o.children[t]=null),!!ut(o)&&(o.residents===null&&(o.residents=new $({shrink:!0})),!0)}function It(o,t){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),at(o.origin,o.direction,R,p)}function Lt(o,t,e){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),e.applyToMinMax(R,p),at(o.origin,o.direction,R,p)}function ut(o){if(o.terminals.length!==0)return!1;if(o.residents!==null)return o.residents.length===0;for(let t=0;tn.distance-s.distance);for(let n=0;n<8;++n)e[n]=P.data[n].index}function K(o,t){let e,n=1/0;for(let s=0;s<8;++s){const r=S(o,t,rt[s]);r0}l._pool=new mt(l),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"}(I||(I={}));const ct=[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)],rt=[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)],_t=Math.sqrt(3),U=[null];function Dt(o){return U[0]=o,U}const X=z(),b=F(),R=F(),p=F(),j=new $,$t=z(),N=z(),V=z(),W=z(),C=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],P=new $,it=[0,0,0,0,0,0,0,0],Ut=I;export{Wt as B,Xt as N,Vt as S,Ut as y}; +import{dB as mt,c$ as $,dg as F,hZ as m}from"./story-Doly9N9p.js";import{A as Z,X as Ot,_ as Rt,L as q,j as k,p as Q}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{X as ht,d as tt,C as w,l as et,a as J,G as nt,F as T,b as z}from"./sphere-BenPORjV-B4uz1SYF.js";import{B as pt,z as At}from"./mat4-DX7gBViE-6clJxb1Q.js";import{D as bt}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{e as B}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{y as A,j as Ft,o as Et,J as Nt,G as L}from"./plane-Dt8R0KeE-Bqc6oVGz.js";import{l as at}from"./Util-BjGjeg6f-08Szkf4F.js";function lt(o){return o?{ray:tt(o.ray),c0:o.c0,c1:o.c1}:{ray:tt(),c0:0,c1:Number.MAX_VALUE}}new ht(()=>lt());function Xt(o){return o?[A(o[0]),A(o[1]),A(o[2]),A(o[3]),A(o[4]),A(o[5])]:[A(),A(),A(),A(),A(),A()]}function gt(){return[F(),F(),F(),F(),F(),F(),F(),F()]}function Vt(o,t){for(let e=0;e=t[3])return!1}return!0}var M,i;(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"})(M||(M={})),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"}(i||(i={})),i.FAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_RIGHT,i.NEAR_BOTTOM_LEFT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_BOTTOM_RIGHT,i.NEAR_TOP_RIGHT,i.NEAR_TOP_LEFT,i.FAR_BOTTOM_RIGHT,i.FAR_BOTTOM_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_RIGHT,i.NEAR_BOTTOM_RIGHT,i.FAR_BOTTOM_RIGHT,i.FAR_TOP_RIGHT,i.NEAR_TOP_RIGHT,i.FAR_BOTTOM_LEFT,i.NEAR_BOTTOM_LEFT,i.NEAR_TOP_LEFT,i.FAR_TOP_LEFT,i.FAR_TOP_LEFT,i.NEAR_TOP_LEFT,i.NEAR_TOP_RIGHT,i.FAR_TOP_RIGHT;const dt=6,Mt=8,St=[B(-1,-1,-1,1),B(1,-1,-1,1),B(1,1,-1,1),B(-1,1,-1,1),B(-1,-1,1,1),B(1,-1,1,1),B(1,1,1,1),B(-1,1,1,1)];new ht(lt);const xt=gt();class I{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}constructor(t,e){this.objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new l,this._objectCount=0,e&&(e.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),e.maximumDepth!==void 0&&(this._maximumDepth=e.maximumDepth))}destroy(){this._degenerateObjects.clear(),l.clearPool(),U[0]=null,j.prune(),P.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=l.acquire();for(let s=0;s{if(!It(s,r))return!1;const a=r.node;return a.terminals.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),a.residents!==null&&a.residents.forAll(u=>{this._intersectsObject(s,u)&&n(u)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,s){const r=et(t,e);x(this._root,a=>{if(!Lt(r,a,s))return!1;const u=a.node;return u.terminals.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),u.residents!==null&&u.residents.forAll(h=>{this._intersectsObjectWithOffset(r,h,s)&&n(h)}),!0})}forEach(t){x(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,s=()=>!0,r=1/0){let a=1/0,u=1/0,h=null;const c=K(t,e),f=d=>{if(--r,!s(d))return;const O=this.objectToBoundingSphere(d);if(!v(n,O))return;const E=S(t,e,T(O)),G=E-O[3],_=E+O[3];G{if(r<=0||!v(n,d.bounds)||(q(b,c,d.halfSize),k(b,b,T(d.bounds)),S(t,e,b)>u))return!1;const O=d.node;return O.terminals.forAll(E=>f(E)),O.residents!==null&&O.residents.forAll(E=>f(E)),!0},t,e),h}forEachInDepthRange(t,e,n,s,r,a,u){let h=-1/0,c=1/0;const f={setRange:_=>{n===I.DepthOrder.FRONT_TO_BACK?(h=Math.max(h,_.near),c=Math.min(c,_.far)):(h=Math.max(h,-_.far),c=Math.min(c,-_.near))}};f.setRange(s);const d=S(e,n,t),O=K(e,n),E=K(e,-n),G=_=>{if(!u(_))return;const g=this.objectToBoundingSphere(_),H=T(g),Y=S(e,n,H)-d,Tt=Y-g[3],ft=Y+g[3];Tt>c||ft{if(!v(a,_.bounds)||(q(b,O,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-d>c)||(q(b,E,_.halfSize),k(b,b,T(_.bounds)),S(e,n,b)-dG(H)),g.residents!==null&&g.residents.forAll(H=>G(H)),!0},e,n)}forEachNode(t){x(this._root,e=>t(e.node,e.bounds,e.halfSize,e.depth))}forEachNeighbor(t,e){const n=J(e),s=T(e),r=h=>{const c=this.objectToBoundingSphere(h),f=J(c),d=n+f;return!(Q(T(c),s)-d*d<=0)||t(h)};let a=!0;const u=h=>{a&&(a=r(h))};x(this._root,h=>{const c=J(h.bounds),f=n+c;if(Q(T(h.bounds),s)-f*f>0)return!1;const d=h.node;return d.terminals.forAll(u),a&&d.residents!==null&&d.residents.forAll(u),a}),a&&this.forEachDegenerateObject(u)}_intersectsObject(t,e){const n=this.objectToBoundingSphere(e);return!(n[3]>0)||nt(n,t)}_intersectsObjectWithOffset(t,e,n){const s=this.objectToBoundingSphere(e);return!(s[3]>0)||nt(n.applyToBoundingSphere(s),t)}_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),N),D(N[3])&&!this._fitsInsideTree(N)))if(ut(this._root.node))w(N,this._root.bounds),this._root.halfSize=1.25*this._root.bounds[3],this._root.updateBoundsRadiusFromHalfSize();else{const n=this._rootBoundsForRootAsSubNode(N);this._placingRootViolatesMaxDepth(n)?this._rebuildTree(N,n):this._growRootAsSubNode(n),l.release(n)}}_rebuildTree(t,e){Z(T(V),T(e.bounds)),V[3]=e.halfSize,st([t,V],2,s=>s,W);const n=l.acquire().init(this._root);this._root.initFrom(null,W,W[3]),this._root.increaseHalfSize(1.25),x(n,s=>(this.add(s.node.terminals.data,s.node.terminals.length),s.node.residents!==null&&this.add(s.node.residents.data,s.node.residents.length),!0)),l.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return x(this._root,s=>(n=Math.max(n,s.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let s=-1/0;const r=this._root.bounds,a=this._root.halfSize;for(let h=0;h<3;h++){const c=r[h]-a-(n[h]-e),f=n[h]+e-(r[h]+a),d=Math.max(0,Math.ceil(c/(2*a))),O=Math.max(0,Math.ceil(f/(2*a)))+1,E=2**Math.ceil(Math.log(d+O)*Math.LOG2E);s=Math.max(s,E),C[h].min=d,C[h].max=O}for(let h=0;h<3;h++){let c=C[h].min,f=C[h].max;const d=(s-(c+f))/2;c+=Math.ceil(d),f+=Math.floor(d);const O=r[h]-a-c*a*2;X[h]=O+(f+c)*a}const u=s*a;return X[3]=u*_t,l.acquire().initFrom(null,X,u,0)}_growRootAsSubNode(t){const e=this._root.node;Z(T(N),T(this._root.bounds)),N[3]=this._root.halfSize,this._root.init(t),t.advanceTo(N,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,s=0;for(;s=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}toJSON(){const{maximumDepth:t,maximumObjectsPerNode:e,_objectCount:n}=this,s=this._nodeToJSON(this._root.node);return{maximumDepth:t,maximumObjectsPerNode:e,objectCount:n,root:{bounds:this._root.bounds,halfSize:this._root.halfSize,depth:this._root.depth,node:s}}}_nodeToJSON(t){const e=t.children.map(r=>r?this._nodeToJSON(r):null),n=t.residents?.map(r=>this.objectToBoundingSphere(r)),s=t.terminals?.map(r=>this.objectToBoundingSphere(r));return{children:e,residents:n,terminals:s}}static fromJSON(t){const e=new I(n=>n,{maximumDepth:t.maximumDepth,maximumObjectsPerNode:t.maximumObjectsPerNode});return e._objectCount=t.objectCount,e._root.initFrom(t.root.node,t.root.bounds,t.root.halfSize,t.root.depth),e}}class l{constructor(){this.bounds=z(),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,s=this.depth){return this.node=t??l.createEmptyNode(),e&&w(e,this.bounds),this.halfSize=n,this.depth=s,this}increaseHalfSize(t){this.halfSize*=t,this.updateBoundsRadiusFromHalfSize()}updateBoundsRadiusFromHalfSize(){this.bounds[3]=this.halfSize*_t}advance(t){let e=this.node.children[t];e||(e=l.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=ct[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.updateBoundsRadiusFromHalfSize(),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 s=this._childIndex(t);e&&e(this,s),this.advance(s)}}isLeaf(){return this.node.residents!=null}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]=0;--a){const u=it[a];s.node.children[u]&&r.push(l.acquire().init(s).advance(u))}l.release(s)}}function jt(o,t,e){j.clear();const n=e.advanceTo(t,(s,r)=>{j.push(s.node),j.push(r)})?e.node.terminals:e.node.residents;if(n.removeUnordered(o),n.length===0)for(let s=j.length-2;s>=0&&Pt(j.data[s],j.data[s+1]);s-=2);}function Pt(o,t){return t>=0&&(o.children[t]=null),!!ut(o)&&(o.residents===null&&(o.residents=new $({shrink:!0})),!0)}function It(o,t){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),at(o.origin,o.direction,R,p)}function Lt(o,t,e){return y(T(t.bounds),2*-t.halfSize,R),y(T(t.bounds),2*t.halfSize,p),e.applyToMinMax(R,p),at(o.origin,o.direction,R,p)}function ut(o){if(o.terminals.length!==0)return!1;if(o.residents!==null)return o.residents.length===0;for(let t=0;tn.distance-s.distance);for(let n=0;n<8;++n)e[n]=P.data[n].index}function K(o,t){let e,n=1/0;for(let s=0;s<8;++s){const r=S(o,t,rt[s]);r0}l._pool=new mt(l),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"}(I||(I={}));const ct=[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)],rt=[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)],_t=Math.sqrt(3),U=[null];function Dt(o){return U[0]=o,U}const X=z(),b=F(),R=F(),p=F(),j=new $,$t=z(),N=z(),V=z(),W=z(),C=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],P=new $,it=[0,0,0,0,0,0,0,0],Ut=I;export{Wt as B,Xt as N,Vt as S,Ut as y}; diff --git a/custom-toc-highlight/assets/OpenStreetMapLayer-Bx4EhJij-Ob9DgNzQ.js b/custom-toc-highlight/assets/OpenStreetMapLayer-Bx4EhJij-WBr50b29.js similarity index 72% rename from custom-toc-highlight/assets/OpenStreetMapLayer-Bx4EhJij-Ob9DgNzQ.js rename to custom-toc-highlight/assets/OpenStreetMapLayer-Bx4EhJij-WBr50b29.js index 595cefdb..17d2a889 100644 --- a/custom-toc-highlight/assets/OpenStreetMapLayer-Bx4EhJij-Ob9DgNzQ.js +++ b/custom-toc-highlight/assets/OpenStreetMapLayer-Bx4EhJij-WBr50b29.js @@ -1 +1 @@ -import{v as t,S as r,i as s,w as p,J as l,n as a}from"./story-BfX8CRfG.js";import{I as m}from"./WebTileLayer-CUoicUjK-CNTqPpZi.js";import{V as i,d as e}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import w from"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./main-ugzBrWNm.js";import"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./PortalLayer-CElnYuSQ-DvpreqYV.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import"./imageBitmapUtils-DA36kg39-CZPhYtU7.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";let o=class extends m{constructor(...n){super(...n),this.portalItem=null,this.isReference=null,this.tileInfo=new i({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new p({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:l.WebMercator}),spatialReference:l.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 a(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,l.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([r({type:w,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"portalItem",void 0),t([r({type:Boolean,json:{read:!1,write:!1}})],o.prototype,"isReference",void 0),t([r({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"refreshInterval",null),t([r({type:i,json:{write:!1}})],o.prototype,"tileInfo",void 0),t([r({type:["show","hide"]})],o.prototype,"listMode",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"subDomains",void 0),t([r({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],o.prototype,"fullExtent",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"urlTemplate",void 0),t([r({type:["OpenStreetMap"]})],o.prototype,"operationalLayerType",void 0),t([r({json:{read:!1}})],o.prototype,"type",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"copyright",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"wmtsInfo",void 0),o=t([s("esri.layers.OpenStreetMapLayer")],o);const J=o;export{J as default}; +import{v as t,S as r,i as s,w as p,J as l,n as a}from"./story-Doly9N9p.js";import{I as m}from"./WebTileLayer-CUoicUjK-DGq3QB_9.js";import{V as i,d as e}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import w from"./PortalItem-CctGdnxF-CfFOGshS.js";import"./main-QGPoLsvl.js";import"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import"./imageBitmapUtils-DA36kg39-BfNbbEDs.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";let o=class extends m{constructor(...n){super(...n),this.portalItem=null,this.isReference=null,this.tileInfo=new i({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new p({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:l.WebMercator}),spatialReference:l.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 a(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,l.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([r({type:w,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"portalItem",void 0),t([r({type:Boolean,json:{read:!1,write:!1}})],o.prototype,"isReference",void 0),t([r({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"refreshInterval",null),t([r({type:i,json:{write:!1}})],o.prototype,"tileInfo",void 0),t([r({type:["show","hide"]})],o.prototype,"listMode",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"subDomains",void 0),t([r({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],o.prototype,"fullExtent",void 0),t([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"urlTemplate",void 0),t([r({type:["OpenStreetMap"]})],o.prototype,"operationalLayerType",void 0),t([r({json:{read:!1}})],o.prototype,"type",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"copyright",void 0),t([r({json:{read:!1,write:!1}})],o.prototype,"wmtsInfo",void 0),o=t([s("esri.layers.OpenStreetMapLayer")],o);const J=o;export{J as default}; diff --git a/custom-toc-highlight/assets/OperationalLayer-B5IXiMa2-9OHGXI1g.js b/custom-toc-highlight/assets/OperationalLayer-B5IXiMa2-DTTV2F9z.js similarity index 96% rename from custom-toc-highlight/assets/OperationalLayer-B5IXiMa2-9OHGXI1g.js rename to custom-toc-highlight/assets/OperationalLayer-B5IXiMa2-DTTV2F9z.js index 69f4744d..1777bf8f 100644 --- a/custom-toc-highlight/assets/OperationalLayer-B5IXiMa2-9OHGXI1g.js +++ b/custom-toc-highlight/assets/OperationalLayer-B5IXiMa2-DTTV2F9z.js @@ -1 +1 @@ -import{v as i,S as y,a0 as S,ac as l,bB as b,cM as I,i as v,b$ as T,o as s,cN as w,cO as G}from"./story-BfX8CRfG.js";import{r as A,s as c,E as h}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{k as L}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";const d={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},m={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},g={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},M={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,ViewshedLayer:!0,Voxel:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":d,"web-map/basemap":m,"web-map/tables":g,"link-chart/operational-layers":{...d,LinkChartLayer:!0},"link-chart/basemap":m,"link-chart/tables":g,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0}},x=u=>{let a=class extends u{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(r,e,t){return t?.portalItem?.type==="Group Layer"?void 0:r}writeListMode(r,e,t,n){(n&&n.layerContainerType==="ground"||r&&T(this,t,{},n))&&(e[t]=r)}writeOperationalLayerType(r,e,t,n){r&&n?.layerContainerType!=="tables"&&(e.layerType=r)}writeTitle(r,e){e.title=r??"Layer"}readTimeExtent(r){return r?L.fromArray(r):null}writeTimeExtent(r,e,t,n){r&&n.layerContainerType!=="tables"&&(r.isEmpty?n?.messages&&n.messages.push(new s("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):e[t]=r.toArray())}read(r,e){e&&(e.layer=this),w(this,r,t=>super.read(r,t),e)}write(r,e){if(!this.persistenceEnabled&&!e?.ignorePersistenceEnabled)return null;if(e?.origin){const o=`${e.origin}/${e.layerContainerType||"operational-layers"}`;let p=!!M[o]?.[this.operationalLayerType];if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&o==="web-scene/operational-layers"&&(p=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&o==="web-map/operational-layers"&&(p=!1),!p)return e.messages?.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this})),null}const t=super.write(r,{...e,layer:this}),n=!!e&&!!e.messages&&!!e.messages.filter(o=>o instanceof s&&o.name==="web-document-write:property-required").length;return G(t?.url)?(e?.messages?.push(new s("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:t}beforeSave(){}};return i([y({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],a.prototype,"id",void 0),i([S("id",["id"])],a.prototype,"readId",null),i([y(A)],a.prototype,"listMode",void 0),i([l("listMode")],a.prototype,"writeListMode",null),i([y({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:c}}}}})],a.prototype,"operationalLayerType",void 0),i([l("operationalLayerType")],a.prototype,"writeOperationalLayerType",null),i([y(h)],a.prototype,"opacity",void 0),i([y({type:Boolean,readOnly:!1})],a.prototype,"persistenceEnabled",void 0),i([y({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],a.prototype,"title",void 0),i([l("title"),l(["web-scene"],"title")],a.prototype,"writeTitle",null),i([y({type:L,json:{origins:{"web-scene":{write:{layerContainerTypes:c}}}}})],a.prototype,"visibilityTimeExtent",void 0),i([S("visibilityTimeExtent")],a.prototype,"readTimeExtent",null),i([l(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[b,I]]}})],a.prototype,"writeTimeExtent",null),i([y({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:c}}},name:"visibility",write:!0}})],a.prototype,"visible",void 0),a=i([v("esri.layers.mixins.OperationalLayer")],a),a};export{x as E}; +import{v as i,S as y,a0 as S,ac as l,bB as b,cM as I,i as v,b$ as T,o as s,cN as w,cO as G}from"./story-Doly9N9p.js";import{r as A,s as c,E as h}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{k as L}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";const d={ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GeoRSS:!0,GroupLayer:!0,KML:!0,KnowledgeGraphLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},m={ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},g={ArcGISFeatureLayer:!0,SubtypeGroupTable:!0},M={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,CatalogLayer:!0,CSV:!0,GeoJSON:!0,GroupLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,KML:!0,LineOfSightLayer:!0,MediaLayer:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,RasterDataLayer:!0,VectorTileLayer:!0,ViewshedLayer:!0,Voxel:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-scene/basemap":{ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-scene/tables":{ArcGISFeatureLayer:!0},"web-map/operational-layers":d,"web-map/basemap":m,"web-map/tables":g,"link-chart/operational-layers":{...d,LinkChartLayer:!0},"link-chart/basemap":m,"link-chart/tables":g,"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,BuildingSceneLayer:!0,IntegratedMesh3DTilesLayer:!0,IntegratedMeshLayer:!0,MediaLayer:!0,OrientedImageryLayer:!0,PointCloudLayer:!0,SubtypeGroupLayer:!0}},x=u=>{let a=class extends u{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(r,e,t){return t?.portalItem?.type==="Group Layer"?void 0:r}writeListMode(r,e,t,n){(n&&n.layerContainerType==="ground"||r&&T(this,t,{},n))&&(e[t]=r)}writeOperationalLayerType(r,e,t,n){r&&n?.layerContainerType!=="tables"&&(e.layerType=r)}writeTitle(r,e){e.title=r??"Layer"}readTimeExtent(r){return r?L.fromArray(r):null}writeTimeExtent(r,e,t,n){r&&n.layerContainerType!=="tables"&&(r.isEmpty?n?.messages&&n.messages.push(new s("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):e[t]=r.toArray())}read(r,e){e&&(e.layer=this),w(this,r,t=>super.read(r,t),e)}write(r,e){if(!this.persistenceEnabled&&!e?.ignorePersistenceEnabled)return null;if(e?.origin){const o=`${e.origin}/${e.layerContainerType||"operational-layers"}`;let p=!!M[o]?.[this.operationalLayerType];if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&o==="web-scene/operational-layers"&&(p=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&o==="web-map/operational-layers"&&(p=!1),!p)return e.messages?.push(new s("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${o}'`,{layer:this})),null}const t=super.write(r,{...e,layer:this}),n=!!e&&!!e.messages&&!!e.messages.filter(o=>o instanceof s&&o.name==="web-document-write:property-required").length;return G(t?.url)?(e?.messages?.push(new s("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:t}beforeSave(){}};return i([y({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],a.prototype,"id",void 0),i([S("id",["id"])],a.prototype,"readId",null),i([y(A)],a.prototype,"listMode",void 0),i([l("listMode")],a.prototype,"writeListMode",null),i([y({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:c}}}}})],a.prototype,"operationalLayerType",void 0),i([l("operationalLayerType")],a.prototype,"writeOperationalLayerType",null),i([y(h)],a.prototype,"opacity",void 0),i([y({type:Boolean,readOnly:!1})],a.prototype,"persistenceEnabled",void 0),i([y({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],a.prototype,"title",void 0),i([l("title"),l(["web-scene"],"title")],a.prototype,"writeTitle",null),i([y({type:L,json:{origins:{"web-scene":{write:{layerContainerTypes:c}}}}})],a.prototype,"visibilityTimeExtent",void 0),i([S("visibilityTimeExtent")],a.prototype,"readTimeExtent",null),i([l(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[b,I]]}})],a.prototype,"writeTimeExtent",null),i([y({type:Boolean,json:{origins:{"web-scene":{name:"visibility",write:{enabled:!0,layerContainerTypes:c}}},name:"visibility",write:!0}})],a.prototype,"visible",void 0),a=i([v("esri.layers.mixins.OperationalLayer")],a),a};export{x as E}; diff --git a/custom-toc-highlight/assets/OrderByInfo-GD2XnU8e-NtCi3yT-.js b/custom-toc-highlight/assets/OrderByInfo-GD2XnU8e-BaEpZLaO.js similarity index 90% rename from custom-toc-highlight/assets/OrderByInfo-GD2XnU8e-NtCi3yT-.js rename to custom-toc-highlight/assets/OrderByInfo-GD2XnU8e-BaEpZLaO.js index 82c425fb..9476bee0 100644 --- a/custom-toc-highlight/assets/OrderByInfo-GD2XnU8e-NtCi3yT-.js +++ b/custom-toc-highlight/assets/OrderByInfo-GD2XnU8e-BaEpZLaO.js @@ -1 +1 @@ -import{aK as n,v as r,S as i,i as d,e as p}from"./story-BfX8CRfG.js";var t;const s=new n({asc:"ascending",desc:"descending"});let e=t=class extends p{constructor(o){super(o),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new t({field:this.field,valueExpression:this.valueExpression,order:this.order})}};r([i({type:String,json:{write:!0}})],e.prototype,"field",void 0),r([i({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"valueExpression",void 0),r([i({type:s.apiValues,json:{type:s.jsonValues,read:s.read,write:s.write}})],e.prototype,"order",void 0),e=t=r([d("esri.layers.support.OrderByInfo")],e);const l=e;export{l as p}; +import{aK as n,v as r,S as i,i as d,e as p}from"./story-Doly9N9p.js";var t;const s=new n({asc:"ascending",desc:"descending"});let e=t=class extends p{constructor(o){super(o),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new t({field:this.field,valueExpression:this.valueExpression,order:this.order})}};r([i({type:String,json:{write:!0}})],e.prototype,"field",void 0),r([i({type:String,json:{write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],e.prototype,"valueExpression",void 0),r([i({type:s.apiValues,json:{type:s.jsonValues,read:s.read,write:s.write}})],e.prototype,"order",void 0),e=t=r([d("esri.layers.support.OrderByInfo")],e);const l=e;export{l as p}; diff --git a/custom-toc-highlight/assets/OrderedLayer-6Qsmrd_l-BG3Yganz.js b/custom-toc-highlight/assets/OrderedLayer-6Qsmrd_l-Ck8MCw7w.js similarity index 80% rename from custom-toc-highlight/assets/OrderedLayer-6Qsmrd_l-BG3Yganz.js rename to custom-toc-highlight/assets/OrderedLayer-6Qsmrd_l-Ck8MCw7w.js index 186be247..be2c7645 100644 --- a/custom-toc-highlight/assets/OrderedLayer-6Qsmrd_l-BG3Yganz.js +++ b/custom-toc-highlight/assets/OrderedLayer-6Qsmrd_l-Ck8MCw7w.js @@ -1 +1 @@ -import{v as s,S as a,i as l,dK as f}from"./story-BfX8CRfG.js";import{p as d}from"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";function u(e,r,t){if(!e)return null;const i=e.find(o=>!!o.field);if(!i)return null;const n=new d;return n.read(i,t),[n]}function c(e,r,t,i){const n=e.find(o=>!!o.field);n&&f(t,[n.toJSON()],r)}const p={type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:u},write:{writer:c}}},w=e=>{let r=class extends e{constructor(){super(...arguments),this.orderBy=null}};return s([a(p)],r.prototype,"orderBy",void 0),r=s([l("esri.layers.mixins.OrderedLayer")],r),r};export{p as d,w as p}; +import{v as s,S as a,i as l,dK as f}from"./story-Doly9N9p.js";import{p as d}from"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";function u(e,r,t){if(!e)return null;const i=e.find(o=>!!o.field);if(!i)return null;const n=new d;return n.read(i,t),[n]}function c(e,r,t,i){const n=e.find(o=>!!o.field);n&&f(t,[n.toJSON()],r)}const p={type:[d],json:{origins:{"web-scene":{write:!1,read:!1}},name:"layerDefinition.orderBy",read:{reader:u},write:{writer:c}}},w=e=>{let r=class extends e{constructor(){super(...arguments),this.orderBy=null}};return s([a(p)],r.prototype,"orderBy",void 0),r=s([l("esri.layers.mixins.OrderedLayer")],r),r};export{p as d,w as p}; diff --git a/custom-toc-highlight/assets/OrientedImageryLayer-CwG5o4Di-DoKQbTo3.js b/custom-toc-highlight/assets/OrientedImageryLayer-CwG5o4Di--YfSXT-B.js similarity index 81% rename from custom-toc-highlight/assets/OrientedImageryLayer-CwG5o4Di-DoKQbTo3.js rename to custom-toc-highlight/assets/OrientedImageryLayer-CwG5o4Di--YfSXT-B.js index 4978092d..bc56c8ee 100644 --- a/custom-toc-highlight/assets/OrientedImageryLayer-CwG5o4Di-DoKQbTo3.js +++ b/custom-toc-highlight/assets/OrientedImageryLayer-CwG5o4Di--YfSXT-B.js @@ -1 +1 @@ -import{v as t,S as i,i as S,aa as O,bA as M,aK as k,P as Q,j as X,aY as q,e as G,o as Z,dK as tt}from"./story-BfX8CRfG.js";import et from"./FeatureLayer-BrRKw5Si-D6Z5CL70.js";import{m as it}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{k as ot}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import{E as J}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./main-ugzBrWNm.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import"./Relationship-PyhUibYK-BgFx3_5x.js";import"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./editsZScale-BDsX6vv--CttUpViY.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import"./ArcGISService-BYA-y6X6-C_YhndKK.js";import"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import"./EditBusLayer-Df29OyJh-DkVkxUAl.js";import"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./PortalLayer-CElnYuSQ-DvpreqYV.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import"./FeatureType-C9hJmS6_-BXWT6QCe.js";import"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./versionUtils-LZYZz-38-DxOZEoAg.js";import"./styleUtils-ChrJTYIw-BfDrXrWd.js";import"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";let g=class extends X{set horizontalWKID(e){e?q({wkid:+e})?this._set("horizontalWKID",+e):this._set("horizontalWKID",e):this._set("horizontalWKID",null)}set verticalWKID(e){e?this._set("verticalWKID",isFinite(e)&&q({wkid:+e})?+e:null):this._set("verticalWKID",null)}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1&&!Number.isNaN(o)&&r?.length>1&&s?.length>1&&l?.length>1}};t([i({json:{write:!0}})],g.prototype,"affineTransformations",void 0),t([i({json:{write:!0}})],g.prototype,"focalLength",void 0),t([i({json:{write:!0}})],g.prototype,"principalOffsetPoint",void 0),t([i({json:{write:!0}})],g.prototype,"radialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"tangentialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"horizontalWKID",null),t([i({json:{write:!0}})],g.prototype,"verticalWKID",null),t([i({json:{write:!0}})],g.prototype,"x",void 0),t([i({json:{write:!0}})],g.prototype,"y",void 0),t([i({json:{write:!0}})],g.prototype,"z",void 0),t([i({json:{write:!0}})],g.prototype,"type",void 0),g=t([S("esri.layers.orientedImagery.core.CameraOrientation")],g);const F=g;let f=class extends O(M(F)){constructor(){super(...arguments),this.type=1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],f.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"heading",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"z",void 0),f=t([S("esri.layers.orientedImagery.core.CameraOrientationHPR")],f);const rt=f;let D=class extends O(M(F)){constructor(){super(...arguments),this.type=4}toString(){const{type:e,latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:m}=this,c=`${m}`.split("|");return c.splice(1,1),`${e}|${o}|${r}|${s}|${l}|${c.join("|")}`}};t([i({json:{write:!0}})],D.prototype,"type",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"latitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"longitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"ellipsoidRadius",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"squaredEccentricity",void 0),t([i({json:{write:!0}})],D.prototype,"properties",void 0),D=t([S("esri.layers.orientedImagery.core.CameraOrientationLTP")],D);const nt=D;let h=class extends O(M(F)){constructor(){super(...arguments),this.type=2}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],h.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"omega",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"phi",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"kappa",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"z",void 0),h=t([S("esri.layers.orientedImagery.core.CameraOrientationOPK")],h);const st=h;let v=class extends O(M(F)){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1||!Number.isNaN(o)||r?.length>1||s?.length>1||l?.length>1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],v.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"yaw",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"z",void 0),v=t([S("esri.layers.orientedImagery.core.CameraOrientationYPR")],v);const at=v;var x;(function(e){e[e.HPR=1]="HPR",e[e.OPK=2]="OPK",e[e.YPR=3]="YPR",e[e.LTP=4]="LTP"})(x||(x={}));const $=new Map;$.set(`${x.OPK}`,{desc:"Using Omega Phi Kappa",constructor:st}),$.set(`${x.HPR}`,{desc:"Using Heading, Pitch and Roll",constructor:rt}),$.set(`${x.YPR}`,{desc:"Using Yaw, Pitch and Roll",constructor:at}),$.set(`${x.LTP}`,{desc:"Using Local Tangent Plane",constructor:nt});let I=class extends O(G){constructor(){super(...arguments),this.url=null}};t([i({type:Number,json:{write:!0}})],I.prototype,"lod",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"rasterFunction",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"url",void 0),I=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource")],I);let U=class extends O(G){constructor(){super(...arguments),this.constantElevation=null}};t([i({type:Number,json:{write:!0}})],U.prototype,"constantElevation",void 0),U=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ConstantElevation")],U);const pt=e=>e!=null&&typeof e.constantElevation=="number";function lt(e,o,r){return o&&(e=`${o}${e}`),r&&(e+=`${r}`),e}function mt(e,o,r){let{url:s}=e;return s?(s=lt(s,o,r),new I({...e,url:s})):null}function yt(e,o,r){return e&&(pt(e)?new U(e):mt(e,o,r))}const V=new k({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),A=new k({Feet:"feet",Meter:"meter"}),_=new k({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique","":null}),R=new Map;function ct(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}R.set(`${x.HPR}`,ut),R.set(`${x.YPR}`,dt),R.set(`${x.OPK}`,ct),R.set(`${x.LTP}`,ft);const H=e=>{const o=e.map(r=>parseFloat(r)).filter(r=>!isNaN(r));if(o.length===e.length)return o};function Y(e,o,r,s,l){const m=H(e),c=H(o),u=H(r),d=H(s);return{affineTransformations:m?.length===6?m:void 0,focalLength:m?.length===6?parseFloat(l):void 0,principalOffsetPoint:c?.length!==2?[0,0]:c,radialDistortionCoefficients:u?.length!==3?[0,0,0]:u,tangentialDistortionCoefficients:d?.length!==2?[0,0]:d}}function ut(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function dt(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function ft(e){const[o,r,s,l,m,...c]=e.slice(1),u=R.get(m),d=$.get(m)?.constructor;return!u||!d?null:{latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:new d(u([m,"",...c]))}}function ht(e){return Array.isArray(e)&&e?.length===9&&!e.some(isNaN)}const vt=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),B=(e,o)=>!vt.has(o)&&e,gt=(e,o,r)=>{const s=`orientedImageryProperties.${e}`;return{name:s,write:o?{ignoreOrigin:!0,target:s,writer:o}:{ignoreOrigin:!0},read:r?{ignoreOrigin:!0,source:s,reader:r}:{ignoreOrigin:!0}}};function wt(e){return e.json&&(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1}),e}function y(e,o,r,s){const{name:l,write:m,read:c}=gt(e,o,r),u={name:l,write:m,read:c,origins:{service:{name:`orientedImageryInfo.${l}`,write:o,read:r},"web-scene":{name:l,write:B(m,e),read:B(c,e)},"web-map":{name:l,write:m,read:c}}};return s&&u.origins&&(u.type=s,u.origins["web-map"].type=s,u.origins["web-scene"].type=s),u}let a=class extends et{constructor(){super(...arguments),this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:o,demPathSuffix:r}=this;return yt(e,o,r)}async save(e){return this._debouncedSaveOperations(J.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(J.SAVE_AS,o,e)}findFirstValidLayerId(e){return e.layers?.find(o=>this.supportedSourceTypes.has(o.type))?.id}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new Z("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};t([i({type:Number,json:y("cameraHeading")})],a.prototype,"cameraHeading",void 0),t([i({type:Number,json:y("cameraHeight")})],a.prototype,"cameraHeight",void 0),t([i({type:Number,json:y("cameraPitch")})],a.prototype,"cameraPitch",void 0),t([i({type:Number,json:y("cameraRoll")})],a.prototype,"cameraRoll",void 0),t([i({type:Number,json:y("coveragePercent")})],a.prototype,"coveragePercent",void 0),t([i({type:String,json:y("demPathPrefix")})],a.prototype,"demPathPrefix",void 0),t([i({type:String,json:y("demPathSuffix")})],a.prototype,"demPathSuffix",void 0),t([i({type:String,json:y("depthImagePathPrefix")})],a.prototype,"depthImagePathPrefix",void 0),t([i({type:String,json:y("depthImagePathSuffix")})],a.prototype,"depthImagePathSuffix",void 0),t([i({type:Object,json:y("elevationSource")})],a.prototype,"elevationSource",void 0),t([i({readOnly:!0})],a.prototype,"effectiveElevationSource",null),t([i({type:Number,json:y("farDistance")})],a.prototype,"farDistance",void 0),t([i()],a.prototype,"geometryType",void 0),t([i({type:Number,json:y("horizontalFieldOfView")})],a.prototype,"horizontalFieldOfView",void 0),t([i({type:String,json:y("horizontalMeasurementUnit")})],a.prototype,"horizontalMeasurementUnit",void 0),t([i({type:String,json:y("imagePathPrefix")})],a.prototype,"imagePathPrefix",void 0),t([i({type:String,json:y("imagePathSuffix")})],a.prototype,"imagePathSuffix",void 0),t([i({type:Number,json:y("imageRotation")})],a.prototype,"imageRotation",void 0),t([i({type:Number,json:y("maximumDistance")})],a.prototype,"maximumDistance",void 0),t([i({type:Number,json:y("nearDistance")})],a.prototype,"nearDistance",void 0),t([i({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],a.prototype,"operationalLayerType",void 0),t([i({json:{...y("orientationAccuracy",(e,o,r)=>{tt(r,e.join(";"),o)},e=>{const o=e?.split(";")?.map(Number);return ht(o)?o:[0,0,0,0,0,0,0,0,0]},String)}})],a.prototype,"orientationAccuracy",void 0),t([i({json:{...y("orientedImageryType",_.write,_.read,_.jsonValues.slice(1))}})],a.prototype,"orientedImageryType",void 0),t([i({json:{read:!1},value:"oriented-imagery",readOnly:!0})],a.prototype,"type",void 0),t([i({type:V.apiValues,json:{...y("timeIntervalUnit",V.write,V.read,V.jsonValues)}})],a.prototype,"timeIntervalUnit",void 0),t([i(wt(Q(it)))],a.prototype,"useViewTime",void 0),t([i({type:Number,json:y("verticalFieldOfView")})],a.prototype,"verticalFieldOfView",void 0),t([i({type:A.apiValues,json:{...y("verticalMeasurementUnit",A.write,A.read,A.jsonValues)}})],a.prototype,"verticalMeasurementUnit",void 0),t([i({type:String,json:y("videoPathPrefix")})],a.prototype,"videoPathPrefix",void 0),t([i({type:String,json:y("videoPathSuffix")})],a.prototype,"videoPathSuffix",void 0),t([i({type:ot,json:{origins:{"web-scene":{write:!1,read:!1}}}})],a.prototype,"visibilityTimeExtent",void 0),a=t([S("esri.layers.OrientedImageryLayer")],a);const Ge=a;export{Ge as default}; +import{v as t,S as i,i as S,aa as O,bA as M,aK as k,P as Q,j as X,aY as q,e as G,o as Z,dK as tt}from"./story-Doly9N9p.js";import et from"./FeatureLayer-BrRKw5Si-DuA2fyE_.js";import{m as it}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{k as ot}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import{E as J}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./main-QGPoLsvl.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./editsZScale-BDsX6vv--C-4n90TZ.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import"./EditBusLayer-Df29OyJh-OmdJOLws.js";import"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import"./FeatureType-C9hJmS6_-CNlvn5D1.js";import"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./versionUtils-LZYZz-38-B8C5OAjF.js";import"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";let g=class extends X{set horizontalWKID(e){e?q({wkid:+e})?this._set("horizontalWKID",+e):this._set("horizontalWKID",e):this._set("horizontalWKID",null)}set verticalWKID(e){e?this._set("verticalWKID",isFinite(e)&&q({wkid:+e})?+e:null):this._set("verticalWKID",null)}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1&&!Number.isNaN(o)&&r?.length>1&&s?.length>1&&l?.length>1}};t([i({json:{write:!0}})],g.prototype,"affineTransformations",void 0),t([i({json:{write:!0}})],g.prototype,"focalLength",void 0),t([i({json:{write:!0}})],g.prototype,"principalOffsetPoint",void 0),t([i({json:{write:!0}})],g.prototype,"radialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"tangentialDistortionCoefficients",void 0),t([i({json:{write:!0}})],g.prototype,"horizontalWKID",null),t([i({json:{write:!0}})],g.prototype,"verticalWKID",null),t([i({json:{write:!0}})],g.prototype,"x",void 0),t([i({json:{write:!0}})],g.prototype,"y",void 0),t([i({json:{write:!0}})],g.prototype,"z",void 0),t([i({json:{write:!0}})],g.prototype,"type",void 0),g=t([S("esri.layers.orientedImagery.core.CameraOrientation")],g);const F=g;let f=class extends O(M(F)){constructor(){super(...arguments),this.type=1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],f.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],f.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"heading",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],f.prototype,"z",void 0),f=t([S("esri.layers.orientedImagery.core.CameraOrientationHPR")],f);const rt=f;let D=class extends O(M(F)){constructor(){super(...arguments),this.type=4}toString(){const{type:e,latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:m}=this,c=`${m}`.split("|");return c.splice(1,1),`${e}|${o}|${r}|${s}|${l}|${c.join("|")}`}};t([i({json:{write:!0}})],D.prototype,"type",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"latitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"longitude",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"ellipsoidRadius",void 0),t([i({json:{write:!0},type:Number})],D.prototype,"squaredEccentricity",void 0),t([i({json:{write:!0}})],D.prototype,"properties",void 0),D=t([S("esri.layers.orientedImagery.core.CameraOrientationLTP")],D);const nt=D;let h=class extends O(M(F)){constructor(){super(...arguments),this.type=2}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],h.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],h.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"omega",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"phi",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"kappa",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],h.prototype,"z",void 0),h=t([S("esri.layers.orientedImagery.core.CameraOrientationOPK")],h);const st=h;let v=class extends O(M(F)){constructor(){super(...arguments),this.type=3}get isAdvanced(){const{affineTransformations:e,focalLength:o,principalOffsetPoint:r,radialDistortionCoefficients:s,tangentialDistortionCoefficients:l}=this;return e?.length>1||!Number.isNaN(o)||r?.length>1||s?.length>1||l?.length>1}toString(){const{type:e,horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,affineTransformations:j,focalLength:P,principalOffsetPoint:w,radialDistortionCoefficients:b,tangentialDistortionCoefficients:N}=this,p=[e,o,r,s,l,m,c,u,d];return this.isAdvanced&&(j?.forEach(n=>p.push(n)),p.push(P),w?.forEach(n=>p.push(n)),w?.forEach(n=>p.push(n)),b?.forEach(n=>p.push(n)),N?.forEach(n=>p.push(n))),p.map(n=>Number.isNaN(n)?"":n).join("|")}};t([i({json:{write:!0}})],v.prototype,"type",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"affineTransformations",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"focalLength",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"principalOffsetPoint",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"radialDistortionCoefficients",void 0),t([i({type:[Number],json:{write:!0}})],v.prototype,"tangentialDistortionCoefficients",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"yaw",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"pitch",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"roll",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"x",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"y",void 0),t([i({type:Number,json:{write:!0}})],v.prototype,"z",void 0),v=t([S("esri.layers.orientedImagery.core.CameraOrientationYPR")],v);const at=v;var x;(function(e){e[e.HPR=1]="HPR",e[e.OPK=2]="OPK",e[e.YPR=3]="YPR",e[e.LTP=4]="LTP"})(x||(x={}));const $=new Map;$.set(`${x.OPK}`,{desc:"Using Omega Phi Kappa",constructor:st}),$.set(`${x.HPR}`,{desc:"Using Heading, Pitch and Roll",constructor:rt}),$.set(`${x.YPR}`,{desc:"Using Yaw, Pitch and Roll",constructor:at}),$.set(`${x.LTP}`,{desc:"Using Local Tangent Plane",constructor:nt});let I=class extends O(G){constructor(){super(...arguments),this.url=null}};t([i({type:Number,json:{write:!0}})],I.prototype,"lod",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"rasterFunction",void 0),t([i({type:String,json:{write:!0}})],I.prototype,"url",void 0),I=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ElevationSource")],I);let U=class extends O(G){constructor(){super(...arguments),this.constantElevation=null}};t([i({type:Number,json:{write:!0}})],U.prototype,"constantElevation",void 0),U=t([S("esri.layers.orientedImagery.core.ElevationSourceDefinitions.ConstantElevation")],U);const pt=e=>e!=null&&typeof e.constantElevation=="number";function lt(e,o,r){return o&&(e=`${o}${e}`),r&&(e+=`${r}`),e}function mt(e,o,r){let{url:s}=e;return s?(s=lt(s,o,r),new I({...e,url:s})):null}function yt(e,o,r){return e&&(pt(e)?new U(e):mt(e,o,r))}const V=new k({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),A=new k({Feet:"feet",Meter:"meter"}),_=new k({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique","":null}),R=new Map;function ct(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,omega:c,phi:u,kappa:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}R.set(`${x.HPR}`,ut),R.set(`${x.YPR}`,dt),R.set(`${x.OPK}`,ct),R.set(`${x.LTP}`,ft);const H=e=>{const o=e.map(r=>parseFloat(r)).filter(r=>!isNaN(r));if(o.length===e.length)return o};function Y(e,o,r,s,l){const m=H(e),c=H(o),u=H(r),d=H(s);return{affineTransformations:m?.length===6?m:void 0,focalLength:m?.length===6?parseFloat(l):void 0,principalOffsetPoint:c?.length!==2?[0,0]:c,radialDistortionCoefficients:u?.length!==3?[0,0,0]:u,tangentialDistortionCoefficients:d?.length!==2?[0,0]:d}}function ut(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,heading:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function dt(e){const[o,r,s,l,m,c,u,d,j,P,w,b,N,p,n,T,E,z,K,C,L,W]=e.slice(1);return{horizontalWKID:o,verticalWKID:r,x:s,y:l,z:m,yaw:c,pitch:u,roll:d,...Y([j,P,w,b,N,p],[T,E],[z,K,C],[L,W],n)}}function ft(e){const[o,r,s,l,m,...c]=e.slice(1),u=R.get(m),d=$.get(m)?.constructor;return!u||!d?null:{latitude:o,longitude:r,ellipsoidRadius:s,squaredEccentricity:l,properties:new d(u([m,"",...c]))}}function ht(e){return Array.isArray(e)&&e?.length===9&&!e.some(isNaN)}const vt=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),B=(e,o)=>!vt.has(o)&&e,gt=(e,o,r)=>{const s=`orientedImageryProperties.${e}`;return{name:s,write:o?{ignoreOrigin:!0,target:s,writer:o}:{ignoreOrigin:!0},read:r?{ignoreOrigin:!0,source:s,reader:r}:{ignoreOrigin:!0}}};function wt(e){return e.json&&(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1}),e}function y(e,o,r,s){const{name:l,write:m,read:c}=gt(e,o,r),u={name:l,write:m,read:c,origins:{service:{name:`orientedImageryInfo.${l}`,write:o,read:r},"web-scene":{name:l,write:B(m,e),read:B(c,e)},"web-map":{name:l,write:m,read:c}}};return s&&u.origins&&(u.type=s,u.origins["web-map"].type=s,u.origins["web-scene"].type=s),u}let a=class extends et{constructor(){super(...arguments),this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:o,demPathSuffix:r}=this;return yt(e,o,r)}async save(e){return this._debouncedSaveOperations(J.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(J.SAVE_AS,o,e)}findFirstValidLayerId(e){return e.layers?.find(o=>this.supportedSourceTypes.has(o.type))?.id}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new Z("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};t([i({type:Number,json:y("cameraHeading")})],a.prototype,"cameraHeading",void 0),t([i({type:Number,json:y("cameraHeight")})],a.prototype,"cameraHeight",void 0),t([i({type:Number,json:y("cameraPitch")})],a.prototype,"cameraPitch",void 0),t([i({type:Number,json:y("cameraRoll")})],a.prototype,"cameraRoll",void 0),t([i({type:Number,json:y("coveragePercent")})],a.prototype,"coveragePercent",void 0),t([i({type:String,json:y("demPathPrefix")})],a.prototype,"demPathPrefix",void 0),t([i({type:String,json:y("demPathSuffix")})],a.prototype,"demPathSuffix",void 0),t([i({type:String,json:y("depthImagePathPrefix")})],a.prototype,"depthImagePathPrefix",void 0),t([i({type:String,json:y("depthImagePathSuffix")})],a.prototype,"depthImagePathSuffix",void 0),t([i({type:Object,json:y("elevationSource")})],a.prototype,"elevationSource",void 0),t([i({readOnly:!0})],a.prototype,"effectiveElevationSource",null),t([i({type:Number,json:y("farDistance")})],a.prototype,"farDistance",void 0),t([i()],a.prototype,"geometryType",void 0),t([i({type:Number,json:y("horizontalFieldOfView")})],a.prototype,"horizontalFieldOfView",void 0),t([i({type:String,json:y("horizontalMeasurementUnit")})],a.prototype,"horizontalMeasurementUnit",void 0),t([i({type:String,json:y("imagePathPrefix")})],a.prototype,"imagePathPrefix",void 0),t([i({type:String,json:y("imagePathSuffix")})],a.prototype,"imagePathSuffix",void 0),t([i({type:Number,json:y("imageRotation")})],a.prototype,"imageRotation",void 0),t([i({type:Number,json:y("maximumDistance")})],a.prototype,"maximumDistance",void 0),t([i({type:Number,json:y("nearDistance")})],a.prototype,"nearDistance",void 0),t([i({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],a.prototype,"operationalLayerType",void 0),t([i({json:{...y("orientationAccuracy",(e,o,r)=>{tt(r,e.join(";"),o)},e=>{const o=e?.split(";")?.map(Number);return ht(o)?o:[0,0,0,0,0,0,0,0,0]},String)}})],a.prototype,"orientationAccuracy",void 0),t([i({json:{...y("orientedImageryType",_.write,_.read,_.jsonValues.slice(1))}})],a.prototype,"orientedImageryType",void 0),t([i({json:{read:!1},value:"oriented-imagery",readOnly:!0})],a.prototype,"type",void 0),t([i({type:V.apiValues,json:{...y("timeIntervalUnit",V.write,V.read,V.jsonValues)}})],a.prototype,"timeIntervalUnit",void 0),t([i(wt(Q(it)))],a.prototype,"useViewTime",void 0),t([i({type:Number,json:y("verticalFieldOfView")})],a.prototype,"verticalFieldOfView",void 0),t([i({type:A.apiValues,json:{...y("verticalMeasurementUnit",A.write,A.read,A.jsonValues)}})],a.prototype,"verticalMeasurementUnit",void 0),t([i({type:String,json:y("videoPathPrefix")})],a.prototype,"videoPathPrefix",void 0),t([i({type:String,json:y("videoPathSuffix")})],a.prototype,"videoPathSuffix",void 0),t([i({type:ot,json:{origins:{"web-scene":{write:!1,read:!1}}}})],a.prototype,"visibilityTimeExtent",void 0),a=t([S("esri.layers.OrientedImageryLayer")],a);const Ge=a;export{Ge as default}; diff --git a/custom-toc-highlight/assets/OverlayContainer-BEHcBpu0-DjERf_U-.js b/custom-toc-highlight/assets/OverlayContainer-BEHcBpu0-4o7Hmqgb.js similarity index 91% rename from custom-toc-highlight/assets/OverlayContainer-BEHcBpu0-DjERf_U-.js rename to custom-toc-highlight/assets/OverlayContainer-BEHcBpu0-4o7Hmqgb.js index 3b851249..4ce615e8 100644 --- a/custom-toc-highlight/assets/OverlayContainer-BEHcBpu0-DjERf_U-.js +++ b/custom-toc-highlight/assets/OverlayContainer-BEHcBpu0-4o7Hmqgb.js @@ -1 +1 @@ -import{r as I}from"./common-CYWrYyJl-E8-sukrT.js";import{R as Q,E as Z,C as V,G as J,D as X}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as Y,E as tt,m as et}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{e as st}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{t as ot}from"./vec3f32-BS0cezmI-B_madU1n.js";import{l as it}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{v as o,hF as L,aG as rt,aA as nt}from"./story-BfX8CRfG.js";import{N as at}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{T as pt,s as N,P as dt}from"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import{t as F,v as p,aw as B,ax as lt,ar as y,C as W,M as ht,S as R,a_ as ct,ay as ut,aC as ft,a4 as vt,L as mt,a7 as xt,bd as yt,b9 as gt,D as wt}from"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import{L as _t,D,I as U,T as Mt}from"./enums-DBi1-Mm2-CUS1pvQe.js";class O extends lt{}o([F(0,y)],O.prototype,"pos",void 0),o([F(1,y)],O.prototype,"uv",void 0);class St extends yt{}class k extends W{}o([p(ht)],k.prototype,"dvs",void 0);class v extends W{}o([p(y)],v.prototype,"perspective",void 0),o([p(y)],v.prototype,"texSize",void 0),o([p(R)],v.prototype,"wrapAroundShift",void 0),o([p(R)],v.prototype,"opacity",void 0),o([p(ct)],v.prototype,"texture",void 0);class x extends ut{vertex(t){const s=t.uv.divide(this.config.texSize),e=new R(1).add(ft(s,this.config.perspective)),a=new vt(t.pos.add(new y(this.config.wrapAroundShift,0)),1),i=this.transform.dvs.multiply(a);return{uv:s,glPosition:new mt(i.xy.multiply(e),0,e)}}fragment(t){const s=xt(this.config.texture,t.uv).multiply(this.config.opacity),e=new gt;return e.glFragColor=s,e}}o([p(k)],x.prototype,"transform",void 0),o([p(v)],x.prototype,"config",void 0),o([L(0,B(O))],x.prototype,"vertex",null),o([L(0,B(St))],x.prototype,"fragment",null);let bt=class extends pt{constructor(){super(...arguments),this.type=wt.Overlay,this._mesh=null,this.shaders={overlay:new x}}render(n,t){const{context:s,painter:e}=n,a=this._getMesh(n,t);e.setPipelineState(N);const{isWrapAround:i,wrapAroundShift:d}=t.config,l={...t.config,wrapAroundShift:0},u={shader:this.shaders.overlay,uniforms:{transform:t.transform,config:l},defines:null,optionalAttributes:null,useComputeBuffer:!1};e.setPipelineState({...N,stencil:{write:!1,test:{compare:_t.EQUAL,op:{fail:D.KEEP,zFail:D.KEEP,zPass:D.REPLACE},ref:0,mask:255}}}),e.submitDrawMeshUntyped(s,u,a),i&&(l.wrapAroundShift=d,e.submitDrawMeshUntyped(s,u,a))}shutdown(){nt(this._mesh)}_getMesh(n,t){const{context:s}=n;if(this._mesh){const e=this._mesh.vertexBuffers.get("positions");if(!e)throw new Error("Buffer not found");e.setData(t.position)}else{const e=t.index!=null?t.index.length:t.position.length/2;this._mesh=new dt(s,{vertex:{positions:t.position,uvs:t.tex},index:t.index!=null?{index:t.index}:void 0,groups:[{attributes:[{name:"pos",count:2,type:U.FLOAT,location:0,vertex:"positions",stride:8,offset:0},{name:"tex",count:2,type:U.UNSIGNED_SHORT,location:1,vertex:"uvs",stride:4,offset:0}],index:t.index!=null?"index":void 0,primitive:Mt.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:e}]})}return this._mesh}};class It extends at{constructor(){super(...arguments),this._viewStateId=-1,this._dvsMat3=Y(),this._overlayTechnique=new bt}get dvsMat3(){return this._dvsMat3}beforeRender(t){this._updateMatrices(t),this._updateOverlays(t,this.children);for(const s of this.children)s.beforeRender(t)}doRender(t){if(t.drawPhase!==tt.MAP||!this.visible)return;super.doRender(t);const s=this._overlayTechnique;for(const e of this.children)e.draw(t,s)}onDetach(){this._overlayTechnique.shutdown()}_updateMatrices(t){const{state:s}=t,{id:e,size:a,pixelRatio:i,resolution:d,rotation:l,viewpoint:u,displayMat3:M}=s;if(this._viewStateId===e)return;const g=I(l),h=i*a[0],f=i*a[1];this._localOrigin=u.targetGeometry.clone();const{x:m,y:S}=this._localOrigin,w=it(m,s.spatialReference);this._localOrigin.x=w,this._localOrigin.y=S;const b=d*h,A=d*f,r=Q(this._dvsMat3);Z(r,r,M),V(r,r,st(h/2,f/2)),J(r,r,ot(h/b,-f/A,1)),X(r,r,-g),this._viewStateId=e}_updateOverlays(t,s){const{state:e}=t,{rotation:a,spatialReference:i,worldScreenWidth:d,size:l,viewpoint:u}=e,M=this._localOrigin;let g,h=0;const f=rt(i);if(f&&i.isWrappable){const m=l[0],S=l[1],w=I(a),b=Math.abs(Math.cos(w)),A=Math.abs(Math.sin(w)),r=Math.round(m*b+S*A),[C,$]=f.valid,c=et(i),{x:z,y:q}=u.targetGeometry,K=[z,q],E=[0,0];e.toScreen(E,K);const _=[0,0];let P;P=r>d?.5*d:.5*r;const G=Math.floor((z+.5*c)/c),j=C+G*c,H=$+G*c,T=[E[0]+P,0];e.toMap(_,T),_[0]>H&&(h=c),T[0]=E[0]-P,e.toMap(_,T),_[0]d?.5*d:.5*r;const G=Math.floor((z+.5*c)/c),j=C+G*c,H=$+G*c,T=[E[0]+P,0];e.toMap(_,T),_[0]>H&&(h=c),T[0]=E[0]-P,e.toMap(_,T),_[0]G(t,e,r,s,i);case"esriGeometryPolygon":return(r,t,s,i)=>T(t,e,r,s,i);case"esriGeometryPolyline":return(r,t,s,i)=>w(t,e,r,s,i);case"esriGeometryMultipoint":return(r,t,s,i)=>P(t,e,r,s,i);default:return b.getLogger("esri.views.2d.support.arcadeOnDemand").error(new I("mapview-arcade",`Unable to handle geometryType: ${c}`)),r=>r}}const D=c=>{if(!c)return[0,0,0,0];const{r:e,g:r,b:t,a:s}=c;return[e,r,t,255*s]};class n{static findApplicableOverrides(e,r,t){if(e&&r){if(e.primitiveName){let s=!1;for(const i of t)if(i.primitiveName===e.primitiveName){s=!0;break}if(!s)for(const i of r)i.primitiveName===e.primitiveName&&t.push(i)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.symbolLayers)for(const s of e.symbolLayers)n.findApplicableOverrides(s,r,t);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(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.markerPlacement&&n.findApplicableOverrides(e.markerPlacement,r,t),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const s of e.markerGraphics)n.findApplicableOverrides(s,r,t),n.findApplicableOverrides(s.symbol,r,t)}else e.type==="CIMCharacterMarker"?n.findApplicableOverrides(e.symbol,r,t):e.type==="CIMHatchFill"?n.findApplicableOverrides(e.lineSymbol,r,t):e.type==="CIMPictureMarker"&&n.findApplicableOverrides(e.animatedSymbolProperties,r,t)}}}static findEffectOverrides(e,r){if(!e)return null;if(e.type==="CIMGeometricEffectDashes"&&k(e),!r||!e.primitiveName)return{type:"cim-effect-param",effect:e,overrides:[]};const t=v(e),s=e.primitiveName,i=[];for(const a of r)a.primitiveName===s&&i.push(v(a));return{type:"cim-effect-param",effect:t,overrides:O(i)}}static async resolveSymbolOverrides(e,r,t,s,i,a,o){if(!e?.symbol)return null;let{symbol:p,primitiveOverrides:l}=e;const y=!!l;if(!y&&!s)return p;p=d(p),l=d(l);let u=!0;if(r||(r={attributes:{}},u=!1),y){if(u||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$feature"))),o||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$view"))),l.length>0){const f={spatialReference:t,fields:h(r.attributes),geometryType:i};await n.createRenderExpressions(l,f),n.evaluateOverrides(l,r,i??"esriGeometryPoint",a,o)}n.applyOverrides(p,l)}return s&&n.applyDictionaryTextOverrides(p,r,s,null),p}static async createRenderExpressions(e,r){const t=[];for(const s of e){const i=s.valueExpressionInfo;if(!i||n._expressionToRenderExpression.has(i.expression))continue;const a=M(i.expression,r.spatialReference,r.fields);t.push(a),a.then(o=>n._expressionToRenderExpression.set(i.expression,o))}t.length>0&&await Promise.all(t)}static evaluateOverrides(e,r,t,s,i){const a={$view:{scale:i?.scale}};for(const o of e){o.value&&typeof o.value=="object"&&x(o.value)&&(o.propertyName==="Color"||o.propertyName==="StrokeColor")&&(o.value=D(o.value));const p=o.valueExpressionInfo;if(!p)continue;const l=n._expressionToRenderExpression.get(p.expression);l&&(o.value=E(l,r,a,t,s))}}static applyDictionaryTextOverrides(e,r,t,s,i="Normal"){if(e?.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const a=e.symbolLayers;if(!a)return;for(const o of a)o&&o.type==="CIMVectorMarker"&&n.applyDictionaryTextOverrides(o,r,t,s,e.type==="CIMTextSymbol"?e.textCase:i)}break;case"CIMVectorMarker":{const a=e.markerGraphics;if(!a)return;for(const o of a)o&&n.applyDictionaryTextOverrides(o,r,t,s)}break;case"CIMMarkerGraphic":{const a=e.textString;if(a&&a.includes("[")){const o=S(a,t);e.textString=g(r,o,s,i)}}}}static applyOverrides(e,r,t,s){if(e.primitiveName){for(const i of r)if(i.primitiveName===e.primitiveName){const a=N(i.propertyName);if(s&&s.push({cim:e,nocapPropertyName:a,value:e[a]}),t){let o=!1;for(const p of t)p.primitiveName===e.primitiveName&&(o=!0);o||t.push(i)}i.value!=null&&(e[a]=i.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.symbolLayers)for(const i of e.symbolLayers)n.applyOverrides(i,r,t,s);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const i of e.markerGraphics)n.applyOverrides(i,r,t,s),n.applyOverrides(i.symbol,r,t,s)}}static restoreOverrides(e){for(const r of e)r.cim[r.nocapPropertyName]=r.value}static buildOverrideKey(e){let r="";for(const t of e)t.value!==void 0&&(r+=`${t.primitiveName}${t.propertyName}${JSON.stringify(t.value)}`);return r}static toValue(e,r){if(e==="DashTemplate")return r.split(" ").map(t=>Number(t));if(e==="Color"){const t=new C(r).toRgba();return t[3]*=255,t}return r}}n._expressionToRenderExpression=new Map;export{n as c}; +import{P as d,er as M,ar as C,a1 as b,o as I}from"./story-Doly9N9p.js";import{x}from"./colorUtils-Cthpxcks-cHaMZbaf.js";import{b as k,S as v,k as O,d as h,K as S,Z as g,x as N}from"./utils-SPbpQbmm-CiwW7WzR.js";import{q as P,T as w,F as T,v as G}from"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";function E(c,e,r,t,s){if(c==null)return null;const i=c.referencesGeometry()&&s?L(e,t,s):e,a=c.repurposeFeature(i);try{return c.evaluate({...r,$feature:a},c.services)}catch(o){return b.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",o),null}}const m=new Map;function L(c,e,r){const{transform:t,hasZ:s,hasM:i}=r;m.has(e)||m.set(e,A(e));const a=m.get(e)(c.geometry,t,s,i);return{...c,geometry:a}}function A(c){const e={};switch(c){case"esriGeometryPoint":return(r,t,s,i)=>G(t,e,r,s,i);case"esriGeometryPolygon":return(r,t,s,i)=>T(t,e,r,s,i);case"esriGeometryPolyline":return(r,t,s,i)=>w(t,e,r,s,i);case"esriGeometryMultipoint":return(r,t,s,i)=>P(t,e,r,s,i);default:return b.getLogger("esri.views.2d.support.arcadeOnDemand").error(new I("mapview-arcade",`Unable to handle geometryType: ${c}`)),r=>r}}const D=c=>{if(!c)return[0,0,0,0];const{r:e,g:r,b:t,a:s}=c;return[e,r,t,255*s]};class n{static findApplicableOverrides(e,r,t){if(e&&r){if(e.primitiveName){let s=!1;for(const i of t)if(i.primitiveName===e.primitiveName){s=!0;break}if(!s)for(const i of r)i.primitiveName===e.primitiveName&&t.push(i)}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.symbolLayers)for(const s of e.symbolLayers)n.findApplicableOverrides(s,r,t);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(e.effects)for(const s of e.effects)n.findApplicableOverrides(s,r,t);if(e.markerPlacement&&n.findApplicableOverrides(e.markerPlacement,r,t),e.type==="CIMVectorMarker"){if(e.markerGraphics)for(const s of e.markerGraphics)n.findApplicableOverrides(s,r,t),n.findApplicableOverrides(s.symbol,r,t)}else e.type==="CIMCharacterMarker"?n.findApplicableOverrides(e.symbol,r,t):e.type==="CIMHatchFill"?n.findApplicableOverrides(e.lineSymbol,r,t):e.type==="CIMPictureMarker"&&n.findApplicableOverrides(e.animatedSymbolProperties,r,t)}}}static findEffectOverrides(e,r){if(!e)return null;if(e.type==="CIMGeometricEffectDashes"&&k(e),!r||!e.primitiveName)return{type:"cim-effect-param",effect:e,overrides:[]};const t=v(e),s=e.primitiveName,i=[];for(const a of r)a.primitiveName===s&&i.push(v(a));return{type:"cim-effect-param",effect:t,overrides:O(i)}}static async resolveSymbolOverrides(e,r,t,s,i,a,o){if(!e?.symbol)return null;let{symbol:p,primitiveOverrides:l}=e;const y=!!l;if(!y&&!s)return p;p=d(p),l=d(l);let u=!0;if(r||(r={attributes:{}},u=!1),y){if(u||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$feature"))),o||(l=l.filter(f=>!f.valueExpressionInfo?.expression.includes("$view"))),l.length>0){const f={spatialReference:t,fields:h(r.attributes),geometryType:i};await n.createRenderExpressions(l,f),n.evaluateOverrides(l,r,i??"esriGeometryPoint",a,o)}n.applyOverrides(p,l)}return s&&n.applyDictionaryTextOverrides(p,r,s,null),p}static async createRenderExpressions(e,r){const t=[];for(const s of e){const i=s.valueExpressionInfo;if(!i||n._expressionToRenderExpression.has(i.expression))continue;const a=M(i.expression,r.spatialReference,r.fields);t.push(a),a.then(o=>n._expressionToRenderExpression.set(i.expression,o))}t.length>0&&await Promise.all(t)}static evaluateOverrides(e,r,t,s,i){const a={$view:{scale:i?.scale}};for(const o of e){o.value&&typeof o.value=="object"&&x(o.value)&&(o.propertyName==="Color"||o.propertyName==="StrokeColor")&&(o.value=D(o.value));const p=o.valueExpressionInfo;if(!p)continue;const l=n._expressionToRenderExpression.get(p.expression);l&&(o.value=E(l,r,a,t,s))}}static applyDictionaryTextOverrides(e,r,t,s,i="Normal"){if(e?.type)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const a=e.symbolLayers;if(!a)return;for(const o of a)o&&o.type==="CIMVectorMarker"&&n.applyDictionaryTextOverrides(o,r,t,s,e.type==="CIMTextSymbol"?e.textCase:i)}break;case"CIMVectorMarker":{const a=e.markerGraphics;if(!a)return;for(const o of a)o&&n.applyDictionaryTextOverrides(o,r,t,s)}break;case"CIMMarkerGraphic":{const a=e.textString;if(a&&a.includes("[")){const o=S(a,t);e.textString=g(r,o,s,i)}}}}static applyOverrides(e,r,t,s){if(e.primitiveName){for(const i of r)if(i.primitiveName===e.primitiveName){const a=N(i.propertyName);if(s&&s.push({cim:e,nocapPropertyName:a,value:e[a]}),t){let o=!1;for(const p of t)p.primitiveName===e.primitiveName&&(o=!0);o||t.push(i)}i.value!=null&&(e[a]=i.value)}}switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.symbolLayers)for(const i of e.symbolLayers)n.applyOverrides(i,r,t,s);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(e.effects)for(const i of e.effects)n.applyOverrides(i,r,t,s);if(e.type==="CIMVectorMarker"&&e.markerGraphics)for(const i of e.markerGraphics)n.applyOverrides(i,r,t,s),n.applyOverrides(i.symbol,r,t,s)}}static restoreOverrides(e){for(const r of e)r.cim[r.nocapPropertyName]=r.value}static buildOverrideKey(e){let r="";for(const t of e)t.value!==void 0&&(r+=`${t.primitiveName}${t.propertyName}${JSON.stringify(t.value)}`);return r}static toValue(e,r){if(e==="DashTemplate")return r.split(" ").map(t=>Number(t));if(e==="Color"){const t=new C(r).toRgba();return t[3]*=255,t}return r}}n._expressionToRenderExpression=new Map;export{n as c}; diff --git a/custom-toc-highlight/assets/PBFDecoderWorker-J6PBo4mo-CqVvvaAg.js b/custom-toc-highlight/assets/PBFDecoderWorker-J6PBo4mo-DjON05MV.js similarity index 91% rename from custom-toc-highlight/assets/PBFDecoderWorker-J6PBo4mo-CqVvvaAg.js rename to custom-toc-highlight/assets/PBFDecoderWorker-J6PBo4mo-DjON05MV.js index b57c5b9b..6540abcc 100644 --- a/custom-toc-highlight/assets/PBFDecoderWorker-J6PBo4mo-CqVvvaAg.js +++ b/custom-toc-highlight/assets/PBFDecoderWorker-J6PBo4mo-DjON05MV.js @@ -1 +1 @@ -import{t as d}from"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import{J as c,hB as p}from"./story-BfX8CRfG.js";import{o as m}from"./projection-BA9M1R7d-BYoCXVXt.js";import{y as f}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{D as y,n as _}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{v as g}from"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./main-ugzBrWNm.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";let b=class{constructor(i,t,e){this.uid=i,this.geometry=t,this.attributes=e,this.visible=!0,this.objectId=null,this.centroid=null}};class P{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}}function C(i,t,e,s){if(t?.size&&e!=null&&i)for(const r in i){if(!t.has(r))continue;const o=i[r];typeof o=="string"&&o.length>e&&(s(r),i[r]="")}}function G(i,t){return t}function l(i,t,e,s){switch(e){case 0:return h(i,t+s,0);case 1:return i.originPosition==="lowerLeft"?h(i,t+s,1):M(i,t+s,1)}}function u(i,t,e,s){return e===2?h(i,t,2):l(i,t,e,s)}function v(i,t,e,s){return e===2?h(i,t,3):l(i,t,e,s)}function A(i,t,e,s){return e===3?h(i,t,3):u(i,t,e,s)}function h({translate:i,scale:t},e,s){return i[s]+e*t[s]}function M({translate:i,scale:t},e,s){return i[s]-e*t[s]}class T{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=G,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new P}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=m(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const s of t.features)e(s.geometry)}createSpatialReference(){return new c}addField(t,e){t.fields.push(f.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,r=this._options.maxStringAttributeFields;C(e.attributes,r,s,o=>{const n=e.attributes[t.objectIdFieldName];n!=null&&this._missingAttributes.push({objectId:n,attribute:o})}),t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:s,queryGeometryType:r}=e,o=y(s.clone(),s,!1,!1,this._transform),n=_(o,r,!1,!1);let a=null;switch(r){case"esriGeometryPoint":a="point";break;case"esriGeometryPolygon":a="polygon";break;case"esriGeometryPolyline":a="polyline";break;case"esriGeometryMultipoint":a="multipoint"}n.type=a,t.queryGeometryType=r,t.queryGeometry=n}prepareFeatures(t){switch(this._transform=t.transform??null,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:d(t.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new b(p(),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){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){const r=this._transform?this._applyTransform(this._transform,e,s,0):e;if(r!=null)switch(s){case 0:t.x=r;break;case 1:t.y=r;break;case 2:t.hasZ?t.z=r:t.m=r;break;case 3:t.m=r}}_transformPathLikeValue(t,e){let s=0;return e<=1&&(s=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._transform?this._applyTransform(this._transform,t,e,s):t}_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],n=this._coordinateBuffer;if(n){if(s===0){const a=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;o.push(new Float64Array(n.buffer,a,this._vertexDimension))}n[this._coordinateBufferPtr++]=r}}_deriveApplyTransform(t){const{hasZ:e,hasM:s}=t;return e&&s?A:e?u:s?v:l}}class R{_parseFeatureQuery(t){const e=new T(t.options),s=g(t.buffer,e),r={...s,spatialReference:s.spatialReference?.toJSON(),fields:s.fields?s.fields.map(o=>o.toJSON()):void 0,missingAttributes:e.missingAttributes};return Promise.resolve(r)}}function j(){return new R}export{j as default}; +import{t as d}from"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import{J as c,hB as p}from"./story-Doly9N9p.js";import{o as m}from"./projection-BA9M1R7d-CAbqHZiw.js";import{y as f}from"./Field-C6hA1tZj-CkWoRbmp.js";import{D as y,n as _}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{v as g}from"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./main-QGPoLsvl.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";let b=class{constructor(i,t,e){this.uid=i,this.geometry=t,this.attributes=e,this.visible=!0,this.objectId=null,this.centroid=null}};class P{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}}function C(i,t,e,s){if(t?.size&&e!=null&&i)for(const r in i){if(!t.has(r))continue;const o=i[r];typeof o=="string"&&o.length>e&&(s(r),i[r]="")}}function G(i,t){return t}function l(i,t,e,s){switch(e){case 0:return h(i,t+s,0);case 1:return i.originPosition==="lowerLeft"?h(i,t+s,1):M(i,t+s,1)}}function u(i,t,e,s){return e===2?h(i,t,2):l(i,t,e,s)}function v(i,t,e,s){return e===2?h(i,t,3):l(i,t,e,s)}function A(i,t,e,s){return e===3?h(i,t,3):u(i,t,e,s)}function h({translate:i,scale:t},e,s){return i[s]+e*t[s]}function M({translate:i,scale:t},e,s){return i[s]-e*t[s]}class T{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=G,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{},this._missingAttributes=[]}get missingAttributes(){return this._missingAttributes}createFeatureResult(){return new P}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=m(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const s of t.features)e(s.geometry)}createSpatialReference(){return new c}addField(t,e){t.fields.push(f.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,r=this._options.maxStringAttributeFields;C(e.attributes,r,s,o=>{const n=e.attributes[t.objectIdFieldName];n!=null&&this._missingAttributes.push({objectId:n,attribute:o})}),t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:s,queryGeometryType:r}=e,o=y(s.clone(),s,!1,!1,this._transform),n=_(o,r,!1,!1);let a=null;switch(r){case"esriGeometryPoint":a="point";break;case"esriGeometryPolygon":a="polygon";break;case"esriGeometryPolyline":a="polyline";break;case"esriGeometryMultipoint":a="multipoint"}n.type=a,t.queryGeometryType=r,t.queryGeometry=n}prepareFeatures(t){switch(this._transform=t.transform??null,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:d(t.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new b(p(),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){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){const r=this._transform?this._applyTransform(this._transform,e,s,0):e;if(r!=null)switch(s){case 0:t.x=r;break;case 1:t.y=r;break;case 2:t.hasZ?t.z=r:t.m=r;break;case 3:t.m=r}}_transformPathLikeValue(t,e){let s=0;return e<=1&&(s=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._transform?this._applyTransform(this._transform,t,e,s):t}_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],n=this._coordinateBuffer;if(n){if(s===0){const a=this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT;o.push(new Float64Array(n.buffer,a,this._vertexDimension))}n[this._coordinateBufferPtr++]=r}}_deriveApplyTransform(t){const{hasZ:e,hasM:s}=t;return e&&s?A:e?u:s?v:l}}class R{_parseFeatureQuery(t){const e=new T(t.options),s=g(t.buffer,e),r={...s,spatialReference:s.spatialReference?.toJSON(),fields:s.fields?s.fields.map(o=>o.toJSON()):void 0,missingAttributes:e.missingAttributes};return Promise.resolve(r)}}function j(){return new R}export{j as default}; diff --git a/custom-toc-highlight/assets/PieChartMeshWriter-C5yLDFwp-CqRHPq7x.js b/custom-toc-highlight/assets/PieChartMeshWriter-C5yLDFwp-5CAejpYY.js similarity index 98% rename from custom-toc-highlight/assets/PieChartMeshWriter-C5yLDFwp-CqRHPq7x.js rename to custom-toc-highlight/assets/PieChartMeshWriter-C5yLDFwp-5CAejpYY.js index dca93063..3cca19ed 100644 --- a/custom-toc-highlight/assets/PieChartMeshWriter-C5yLDFwp-CqRHPq7x.js +++ b/custom-toc-highlight/assets/PieChartMeshWriter-C5yLDFwp-5CAejpYY.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); -import{_ as te}from"./main-ugzBrWNm.js";import{I as h}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{K as ee,et as m,ar as se,o as ie,a1 as re,hJ as oe,ae as gt}from"./story-BfX8CRfG.js";import{b as $,e as kt,c as ne,i as ae,P as ce,x as zt,d as Dt,Y as ue,W as le,X as he,U as pe,u as C,f as St,R as Pt,g as vt,E as T,h as de,j as fe}from"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import{O as xe,D as At,d as Yt}from"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import{t as tt,K as rt,n as R,d as me,$ as ye,_ as _e,r as ge,c as ke}from"./definitions-DJSdSb77-DkoRHaVx.js";import{D as Se,M as Pe,k as ve}from"./TurboLine-CIlsAy5m-Cxo-QeJ4.js";import{t as Nt,e as be,Z as we,V as Te}from"./LabelMetric-BeluzH3o-C3fDXNzp.js";import{I as Bt}from"./utils-SPbpQbmm-B3hR8LxB.js";import{S as G,r as Lt,i as nt,R as at,t as ct}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import{c as Ee}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{l as Me,G as Ie,i as ze,e as De}from"./Tile-D75RMC64-Dj1SOP3K.js";import{L as Q}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as J}from"./constants-Bqe1QJ4u-F8oTIn7N.js";const Ae=()=>re.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils"),Ye=0,Ne=100;function Z(t,e){return[!!t?.minScale&&e.scaleToZoom(t.minScale)||Ye,!!t?.maxScale&&e.scaleToZoom(t.maxScale)||Ne]}function W(t){return 1<import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(t=>t.g)}function Rt(t){switch(t){case h.BYTE:case h.UNSIGNED_BYTE:return 1;case h.SHORT:case h.UNSIGNED_SHORT:case h.HALF_FLOAT:return 2;case h.FLOAT:case h.INT:case h.UNSIGNED_INT:return 4}}function Oe(t){const e=[],s=[],i=[];for(const r of t){const o=Rt(r.type)*r.count;switch(o%2||o%4||4){case 4:e.push(r);continue;case 2:s.push(r);continue;case 1:i.push(r);continue;default:throw new Error("Found unexpected dataType byte count")}}return e.push(...s),e.push(...i),e}let Ce=class Ft{static fromVertexSpec(e,s){const{attributes:i,optionalAttributes:r}=e;let o,n,a;const c=[];for(const y in i){const _=i[y];_.pack==="position"?o={..._,name:y,offset:0}:_.pack==="id"?n={..._,name:y,offset:4}:y==="bitset"?a={..._,name:y,offset:7}:c.push({..._,name:y})}for(const y in r)if(s[y]===!0){const _=r[y];c.push({..._,name:y})}const l=Oe(c),u=[];let f=8,x=1;for(const y of l)u.push({...y,offset:f}),f+=Rt(y.type)*y.count,y.packAlternating&&(x=Math.max(y.packAlternating.count,x));const p=Uint32Array.BYTES_PER_ELEMENT,d=f%p;return new Ft(o,n,a,u,f+(d?p-d:0),x)}constructor(e,s,i,r,o,n){this.position=e,this.id=s,this.bitset=i,this.standardAttributes=r,this.stride=o,this.packVertexCount=n,r.push(i),this._attributes=[e,s,i,...r]}get attributeLayout(){if(!this._attributeLayout){const e=we(this._attributes),s=this._attributes.map(i=>({name:i.name,count:i.count,offset:i.offset,type:i.type,packPrecisionFactor:i.packPrecisionFactor,normalized:i.normalized??!1}));this._attributeLayout={attributes:s,hash:e,stride:this.stride}}return this._attributeLayout}},We=class Ot{static fromVertexSpec(e,s){const i=Ce.fromVertexSpec(e,s);return new Ot(i)}constructor(e){this._spec=e,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(e,s,i,r,o,n){for(let a=0;athis.vertexSpec.createComputedParams(r)}get _vertexPack(){if(!this._cachedVertexPack){const t=We.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||t.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=t}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}setReferences(t){this._references=t}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){Ue(this._evaluator.inputMeshParams.effects?.effectInfos)&&await Fe()}enqueueRequest(t,e,s){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(t,e,s)}write(t,e,s,i,r){this.ensurePacked(e,s,i);const o=this.evaluatedMeshParams.effects;if(!o||o.length===0)return void this._write(t,s,void 0,r);const n=s.readGeometryForDisplay()?.clone();if(!n)return;const a=T.fromOptimizedCIM(n,s.geometryType),c=mt();a.invertY();const l=t.id||"",u=Re.executeEffects(o,a,l,c);let f;for(;f=u.next();)f.invertY(),this._write(t,s,f,r)}ensurePacked(t,e,s){if(!this._evaluator.hasDynamicProperties)return;const i=this._evaluator.evaluateMeshParams(t,e,s);this._vertexPack.pack(i,this._viewParams)}_writeVertex(t,e,s,i,r){const o=this.evaluatedMeshParams;this._vertexPack.writeVertex(t,e,s,i,o,r)}};function He(t,e,s,i,r,o,n){pt=0;const a=(i-s)*o,c=r&&r.length,l=c?(r[0]-s)*o:a;let u,f,x,p,d,y=Ct(e,s,i,0,l,o,!0);if(y&&y.next!==y.prev){if(c&&(y=qe(e,s,i,r,y,o)),a>80*o){u=x=e[0+s*o],f=p=e[1+s*o];for(let _=o;_0)for(let c=i;c=i;c-=o)a=bt(c+e*o,t[c+e*o],t[c+1+e*o],a);return a&&D(a,a.next)&&(X(a),a=a.next),a}function U(t,e=t){if(!t)return t;let s,i=t;do if(s=!1,i.steiner||!D(i,i.next)&&k(i.prev,i,i.next)!==0)i=i.next;else{if(X(i),i=e=i.prev,i===i.next)break;s=!0}while(s||i!==e);return e}function H(t,e,s,i,r,o,n,a){if(!t)return;!a&&o&&(t=Wt(t,i,r,o));let c=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(o?Ve(t,i,r,o):Xe(t))e.push(l.index/s+n),e.push(t.index/s+n),e.push(u.index/s+n),X(t),t=u.next,c=u.next;else if((t=u)===c){a?a===1?H(t=es(t,e,s,n),e,s,i,r,o,n,2):a===2&&ss(t,e,s,i,r,o,n):H(U(t),e,s,i,r,o,n,1);break}}}function Xe(t){const e=t.prev,s=t,i=t.next;if(k(e,s,i)>=0)return!1;let r=t.next.next;const o=r;let n=0;for(;r!==t.prev&&(n===0||r!==o);){if(n++,L(e.x,e.y,s.x,s.y,i.x,i.y,r.x,r.y)&&k(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ve(t,e,s,i){const r=t.prev,o=t,n=t.next;if(k(r,o,n)>=0)return!1;const a=r.xo.x?r.x>n.x?r.x:n.x:o.x>n.x?o.x:n.x,u=r.y>o.y?r.y>n.y?r.y:n.y:o.y>n.y?o.y:n.y,f=lt(a,c,e,s,i),x=lt(l,u,e,s,i);let p=t.prevZ,d=t.nextZ;for(;p&&p.z>=f&&d&&d.z<=x;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0||(p=p.prevZ,d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=x;){if(d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function bt(t,e,s,i){const r=F.create(t,e,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function X(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ze(t){let e=t,s=t;do(e.x=s.next.y&&s.next.y!==s.y){const x=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(x<=i&&x>n){if(n=x,x===i){if(r===s.y)return s;if(r===s.next.y)return s.next}o=s.x=s.x&&s.x>=c&&i!==s.x&&L(ro.x)&&V(s,t)&&(o=s,f=u)),s=s.next;return o}function Wt(t,e,s,i){let r;for(;r!==t;r=r.next){if(r=r||t,r.z===null&&(r.z=lt(r.x,r.y,e,s,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,Wt(t,e,s,i);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,je(t)}function je(t){let e,s=1;for(;;){let i,r=t;t=null,e=null;let o=0;for(;r;){o++,i=r;let n=0;for(;n0||a>0&&i;){let c;n===0?(c=i,i=i.nextZ,a--):a!==0&&i?r.z<=i.z?(c=r,r=r.nextZ,n--):(c=i,i=i.nextZ,a--):(c=r,r=r.nextZ,n--),e?e.nextZ=c:t=c,c.prevZ=e,e=c}r=i}if(e.nextZ=null,s*=2,o<2)return t}}function k(t,e,s){return(e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y)}function Ut(t,e,s,i){return!!(D(t,e)&&D(s,i)||D(t,i)&&D(s,e))||k(t,e,s)>0!=k(t,e,i)>0&&k(s,i,t)>0!=k(s,i,e)>0}function Ke(t,e){let s=t;do{if(s.index!==t.index&&s.next.index!==t.index&&s.index!==e.index&&s.next.index!==e.index&&Ut(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1}function $e(t,e,s,i,r,o){let n=0;for(let a=i,c=r-o;a=0&&(t-n)*(i-a)-(s-n)*(e-a)>=0&&(s-n)*(o-a)-(r-n)*(i-a)>=0}function V(t,e){return k(t.prev,t,t.next)<0?k(t,e,t.next)>=0&&k(t,t.prev,e)>=0:k(t,e,t.prev)<0||k(t,t.next,e)<0}function lt(t,e,s,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-s)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e){return t.x-e.x}function es(t,e,s,i){let r=t;do{const o=r.prev,n=r.next.next;!D(o,n)&&Ut(o,r,r.next,n)&&V(o,n)&&V(n,o)&&(e.push(o.index/s+i),e.push(r.index/s+i),e.push(n.index/s+i),X(r),X(r.next),r=t=n),r=r.next}while(r!==t);return r}function ss(t,e,s,i,r,o,n){let a=t;do{let c=a.next.next;for(;c!==a.prev;){if(a.index!==c.index&&is(a,c)){let l=Ht(a,c);return a=U(a,a.next),l=U(l,l.next),H(a,e,s,i,r,o,n,0),void H(l,e,s,i,r,o,n,0)}c=c.next}a=a.next}while(a!==t)}function is(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!Ke(t,e)&&V(t,e)&&V(e,t)&&rs(t,e)}function rs(t,e){let s=t,i=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do s.y>o!=s.next.y>o&&s.next.y!==s.y&&r<(s.next.x-s.x)*(o-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next;while(s!==t);return i}function Ht(t,e){const s=F.create(t.index,t.x,t.y),i=F.create(e.index,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,s.next=r,r.prev=s,i.next=s,s.prev=i,o.next=i,i.prev=o,i}class F{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(e,s,i){const r=pt0))break;u+=_,f.push(n+l),l+=y}const x=o.length;He(o,s,n,n+l,f,2,r);const p=as(o,s,x,o.length,r),d=Math.abs(u);if(Math.abs((p-d)/Math.max(1e-7,d))>ns)return o.length=0,!1;a=c,n+=l}return!0}function us(t){const{coords:e,lengths:s}=t,{buffer:i}=ve(e,s);return i}function ls(t,e,s){let i=0;for(let r=0;rs||cs)return!0}i+=o}return!1}function Xt(t,e){if(t==null)return null;if(!ls(t,-128,tt+128))return t;z.setPixelMargin(e),z.reset(Yt.Polygon);let s=0;for(let n=0;nr||ur){n=!0;continue}c.push({x:l,y:u})}let f=!1;for(;t.nextPoint();)if(l=t.x,u=t.y,n)s.lineTo(l,u);else{if(lr||ur){f=!0;break}c.push({x:l,y:u})}if(f)n=!0;else{if(n){const x=s.resultWithStarts();if(x)for(const p of x)o.push(p)}else o.push({line:c,start:0});a=t.nextPath(),n=!1}}return o=o.filter(c=>c.line.length>1),o.length===0?null:o}z.setExtent(tt),dt.setExtent(tt);const ps=100,ds=ee("featurelayer-fast-triangulation-enabled");class Vt extends O{async loadDependencies(){await Promise.all([super.loadDependencies(),Pe()])}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);o&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,s,o),e.recordEnd())}_clip(e){if(!e)return null;const s=this.hasEffects;return Xt(e,s?256:8)}_writeGeometry(e,s,i){const r=i.maxLength>ps,o=[],n=this.createTesselationParams(s);if(!r&&ds&&cs(o,i))return void(o.length&&this._writeVertices(e,s,i.coords,n,o));const a=us(i);this._writeVertices(e,s,a,n)}_writeVertices(e,s,i,r,o){const n=s.getDisplayId(),a=e.vertexCount(),c=this.hasEffects;let l=0;if(o)for(const u of o){const f=i[2*u],x=i[2*u+1];c&&e.recordBounds(f,x,0,0),this._writeVertex(e,n,f,x,r),l++}else for(let u=0;ut,optionalAttributes:{},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:h.FLOAT,count:1,packTessellation:({inverseArea:t})=>t}}};let oi=class extends Vt{constructor(){super(...arguments),this.vertexSpec=fs}createTesselationParams(t){return{inverseArea:1/t.readGeometryArea()}}};const ft={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}};let Zt=class extends Vt{constructor(){super(...arguments),this.vertexSpec=ft}createTesselationParams(t){return null}};const A={createComputedParams:t=>t,optionalAttributes:ft.optionalAttributes,attributes:{...ft.attributes,tlbr:{count:4,type:h.UNSIGNED_SHORT,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},inverseRasterizationScale:{count:1,type:h.BYTE,packPrecisionFactor:16,pack:({sprite:t})=>1/t.rasterizationScale}}};let xs=class extends Zt{constructor(){super(...arguments),this.vertexSpec=A}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),t.recordEnd()}};function et(t){const{sprite:e,aspectRatio:s,scaleProportionally:i}=t,r=m(t.height),o=r>0?r:e.height;let n=r*s;return n<=0?n=e.width:i&&(n*=e.width/e.height),{width:n,height:o}}function qt(t){const{applyRandomOffset:e,sampleAlphaOnly:s}=t;return q([[ce,e],[zt,s]])}const Qt={createComputedParams:t=>t,optionalAttributes:A.optionalAttributes,attributes:{...A.attributes,bitset:{count:1,type:h.UNSIGNED_BYTE,pack:qt},width:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},height:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},offset:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),-m(e)]},scale:{count:2,type:h.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:t,scaleY:e})=>[t,e]},angle:{count:1,type:h.UNSIGNED_BYTE,pack:({angle:t})=>xe(t)}}};let ni=class extends xs{constructor(){super(...arguments),this.vertexSpec=Qt}},ms=class{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}};const Y={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:h.UNSIGNED_BYTE,count:1},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},offset:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[j(t,16),j(e,16)]},normal:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[j(t,16),j(e,16)]},halfWidth:{type:h.HALF_FLOAT,count:1,pack:({width:t})=>m(.5*t)},referenceHalfWidth:{type:h.HALF_FLOAT,count:1,pack:({referenceWidth:t})=>m(.5*t)}}};let ys=class{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}};const Tt=65535;let Jt=class extends O{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=Y,this._currentWrite=new ys,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:Tt,textured:!1},this._tessParams=new ms,this._initializeTessellator()}writeLineVertices(t,e,s){const i=this._getLines(e);i!=null&&this._writeVertices(t,s,i)}_initializeTessellator(){this._lineTessellator=new Se(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,e,s){const i=s??T.fromFeatureSetReaderCIM(e);i&&this._writeGeometry(t,e,i)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return hs(t,Nt(this.evaluatedMeshParams))}_writeVertices(t,e,s){const{_currentWrite:i,_tessellationOptions:r,evaluatedMeshParams:o}=this,{width:n,capType:a,joinType:c,miterLimit:l,hasSizeVV:u}=o,f=m(.5*n);r.halfWidth=f,r.capType=Be(a),r.joinType=Le(c),r.miterLimit=l;const x=!u;i.out=t,i.id=e.getDisplayId(),i.vertexCount=0,i.indexCount=0,i.vertexFrom=t.vertexCount(),i.vertexBounds=x&&ft,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}},yt={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)}}};let _t=class extends Jt{constructor(){super(...arguments),this.vertexSpec=yt}},Kt=class extends Zt{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=jt,this._lineMeshWriter=this._createOutlineWriter(t,e,s,i)}_createOutlineWriter(t,e,s,i){return new _t(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);r&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd())}_clip(t){return t?Xt(t,Nt(this.evaluatedMeshParams)):null}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const st=Qt,_s=yt,gs={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>qt(t)},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},aux3:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),m(e)]},aux4:{count:2,type:h.UNSIGNED_BYTE,pack:({scaleX:t,scaleY:e})=>[t*$,e*$]}}},ks={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,color:_s.attributes.color,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.width)},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.referenceWidth)},aux3:{count:2,type:h.HALF_FLOAT,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[t,e]},aux4:{count:2,type:h.UNSIGNED_BYTE,packTessellation:({normalX:t,normalY:e})=>[t*$+kt,e*$+kt]}}};class Ss extends _t{constructor(){super(...arguments),this.vertexSpec=ks}}let ai=class extends Kt{constructor(){super(...arguments),this.vertexSpec=gs}_createOutlineWriter(t,e,s,i){return new Ss(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd()}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const Ps={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...jt.attributes}},vs={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...yt.attributes}};class bs extends _t{constructor(){super(...arguments),this.vertexSpec=vs}}class ci extends Kt{constructor(){super(...arguments),this.vertexSpec=Ps}_createOutlineWriter(e,s,i,r){return new bs(e,s,i,r)}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);if(!o)return;const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(e,s,o),this._lineMeshWriter.writeLineVertices(e,T.fromOptimizedCIM(o,"esriGeometryPolyline"),s),e.recordEnd()}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._lineMeshWriter.ensurePacked(e,s,i)}enqueueRequest(e,s,i){super.enqueueRequest(e,s,i),this._lineMeshWriter.enqueueRequest(e,s,i)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}const ws={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},offset:{type:h.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};let ui=class extends O{constructor(){super(...arguments),this.vertexSpec=ws}_write(t,e){t.recordStart(this.instanceId,this.attributeLayout);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPoint"){const i=e.readXForDisplay(),r=e.readYForDisplay();this._writeQuad(t,s,i,r)}else e.geometryType==="esriGeometryMultipoint"&&e.readGeometryForDisplay()?.forEachVertex((i,r)=>{i>=0&&i<=512&&r>=0&&r<=512&&this._writeQuad(t,s,i,r)});t.recordEnd()}_writeQuad(t,e,s,i){const r=t.vertexCount();this._writeVertex(t,e,s,i),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}};class $t{static getPlacement(e,s,i,r,o,n){const a=fe(i);return a?(s===-1&&e.invertY(),a.execute(e,i,r,o,n)):null}}const Et=96;class Ts{constructor(e){const{offsetX:s,offsetY:i,postAngle:r,fontSize:o,haloSize:n,outlineSize:a,scaleFactor:c,transforms:l}=e;if(this.offsetX=s,this.offsetY=i,this.postAngle=r,this.fontSize=Math.min(o,Et),this.haloSize=n??0,this.outlineSize=a??0,this.transforms=l,l&&l.infos.length>1){const u=Bt(o,r,!1,s,i,l,!1);this.fontSize=Math.min(u.size,Et);const f=u.size/o;this.haloSize*=f,this.outlineSize*=f,this.postAngle=u.rotation,this.offsetX=u.offsetX,this.offsetY=u.offsetY}c&&(this.fontSize*=c,this.offsetX*=c,this.offsetY*=c)}}const Es=28,M=[4,4],K=[16,4],Ms={topLeft:K,topRight:K,bottomLeft:K,bottomRight:K},it=[4,2],v=[4,6],Mt={topLeft:it,topRight:it,bottomLeft:v,bottomRight:v},It={topLeft:it,topRight:v,bottomLeft:it,bottomRight:v},Is={topLeft:v,topRight:v,bottomLeft:M,bottomRight:M},zs={topLeft:M,topRight:M,bottomLeft:v,bottomRight:v},Ds={topLeft:v,topRight:M,bottomLeft:v,bottomRight:M},As={topLeft:M,topRight:v,bottomLeft:M,bottomRight:v},Ys={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:rt,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||Es]},clipAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>Ns(t||0)},referenceSymbol:{type:h.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,e)=>{const s=t.isLineLabel||!t.referenceBounds,i=ne(s?"center":e.horizontalAlignment),r=ae(s?"middle":e.verticalAlignment),{offsetX:o,offsetY:n,size:a}=s?{offsetX:0,offsetY:0,size:0}:t.referenceBounds;return[m(o),-m(n),Math.round(m(a)),i+1<<2|r+1]}}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>q([[ue,t],[le,!!e]])},offset:{type:h.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontSize:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t})=>Math.round(m(t))},referenceSize:{type:h.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:e})=>Math.round(m(e??t))},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},haloColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>g(t)},outlineAndHaloSize:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:t,haloSize:e})=>[Math.round(m(t)),Math.round(m(e))]}}};class li extends O{constructor(){super(...arguments),this.vertexSpec=Ys,this._textMeshParamsPropsInitialized=!1}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new Ts(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(e,s,i){const r=this._getShaping();if(!r)return;const o=s.getDisplayId();if(this.evaluatedMeshParams.placement!=null)return this._writePlacedTextMarkers(e,s,r,i);if(i?.nextPath())return i.nextPoint(),this._writeGlyphs(e,o,i.x,i.y,r,0);if(s.geometryType==="esriGeometryPolygon"){const c=s.readCentroidForDisplay();if(!c)return;const[l,u]=c.coords;return this._writeGlyphs(e,o,l,u,r,0)}if(s.geometryType==="esriGeometryMultipoint")return void s.readGeometryForDisplay()?.forEachVertex((c,l)=>this._writeGlyphs(e,o,c,l,r,0));const n=s.readXForDisplay(),a=s.readYForDisplay();return this._writeGlyphs(e,o,n,a,r,0)}_writePlacedTextMarkers(e,s,i,r){const o=r??T.fromFeatureSetReaderCIM(s);if(!o)return;const n=-1,a=$t.getPlacement(o,n,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!a)return;const c=s.getDisplayId();let l=a.next();for(;l!=null;){const u=l.tx,f=-l.ty,x=-l.getAngle();this._writeGlyphs(e,c,u,f,i,x),l=a.next()}}_getShaping(e){const s=this._textMeshTransformProps,i=this.evaluatedMeshParams;if(!i.glyphs?.glyphs.length)return null;const r=m(s.fontSize),o=m(s.offsetX),n=m(s.offsetY),a=gt(m(i.lineWidth),_e,ye),c=ge*gt(i.lineHeightRatio,.25,4);return de(i.glyphs,{scale:r/ke,angle:s.postAngle,xOffset:o,yOffset:n,horizontalAlignment:i.horizontalAlignment,verticalAlignment:e||i.verticalAlignment,maxLineWidth:a,lineHeight:c,decoration:i.decoration,borderLineSizePx:m(i.boxBorderLineSize),hasBackground:!!i.boxBackgroundColor,useCIMAngleBehavior:i.useCIMAngleBehavior})}_writeGlyphs(e,s,i,r,o,n,a,c){const l=this.evaluatedMeshParams,u=this._textMeshTransformProps,f=m(u.fontSize),x=u.haloSize,p=u.outlineSize,d=m(u.offsetX),y=m(u.offsetY),[_,P]=Z(l.scaleInfo,this.getTileInfo());n!==0&&o.setRotation(n);const S=o.bounds,I=i+S.x+d,w=r+S.y-y,N=2*(l.minPixelBuffer?l.minPixelBuffer/f:1),b=Math.max(S.width,S.height)*N;o.textBox&&(e.recordStart(this.instanceId,this.attributeLayout,o.glyphs[0].textureBinding),e.recordBounds(I,w,b,b),this._writeTextBox(e,s,i,r,o.textBox,a,c),e.recordEnd());for(const E of o.glyphs){e.recordStart(this.instanceId,this.attributeLayout,E.textureBinding),e.recordBounds(I,w,b,b);const{texcoords:ot,offsets:B}=E;this._writeQuad(e,s,i,r,{texcoords:ot,offsets:B,fontSize:f,haloSize:x,outlineSize:p,color:g(l.color),isBackground:!1,referenceBounds:a,minZoom:_,maxZoom:P,...c}),e.recordEnd()}n!==0&&o.setRotation(-n)}_writeTextBox(e,s,i,r,o,n,a){const c=this.evaluatedMeshParams,{fontSize:l,haloSize:u,outlineSize:f}=this._textMeshTransformProps,{boxBackgroundColor:x,boxBorderLineColor:p}=c,d={isBackground:!0,fontSize:l,haloSize:u,outlineSize:f,referenceBounds:n,...a};x&&(this._writeQuad(e,s,i,r,{texcoords:Ms,offsets:o.main,color:g(x),...d}),p||(this._writeQuad(e,s,i,r,{texcoords:Is,offsets:o.top,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:zs,offsets:o.bot,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:Ds,offsets:o.left,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:As,offsets:o.right,color:g(x),...d}))),p&&(this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.top,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.bot,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.left,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.right,color:g(p),...d}))}_writeQuad(e,s,i,r,o){const n=e.vertexCount();this._writeVertex(e,s,i,r,o),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Ns=t=>Math.round(t*(254/360)),Bs={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:t,shouldScaleDash:e,isSDF:s})=>q([[zt,t],[he,e],[pe,s]])},tlbr:{type:h.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},accumulatedDistance:{type:h.UNSIGNED_SHORT,count:1,packTessellation:({distance:t})=>t},segmentDirection:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]},offsetAlongLine:{type:h.HALF_FLOAT,count:1,pack:({offsetAlongLine:t})=>m(t)},capType:{type:h.UNSIGNED_BYTE,count:1,pack:({capType:t})=>{switch(t){case G.Butt:case"butt":return 0;case G.Square:case"square":return 1;case G.Round:case"round":return 2;default:return 0}}}}};class hi extends Jt{constructor(e,s,i,r){super(e,s,i,r),this.vertexSpec=Bs,this._tessellationOptions.textured=!0}_write(e,s,i){const r=i??T.fromFeatureSetReaderCIM(s);if(!r)return;const{sprite:o}=this.evaluatedMeshParams;this._writeGeometry(e,s,r,o?.textureBinding)}}let Ls=class xt{static from(e){return"width"in e?this.fromSimpleMeshParams(e):this.fromComplexMeshParams(e)}static fromSimpleMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:i,width:r,height:o,angle:n,alignment:a,outlineSize:c,referenceSize:l,sprite:u,overrideOutlineColor:f}=e;return s.rawWidth=m(r),s.rawHeight=m(o),s.angle=n,s.alignment=a,s.outlineSize=m(c),s.referenceSize=m(l),s.overrideOutlineColor=f,s.offsetX=m(e.offsetX),s.offsetY=m(e.offsetY),i!=="simple"||u.sdf||(s.rawWidth=u.width,s.rawHeight=u.height),s._computeSize(e,!1),s}static fromComplexMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects);let{alignment:i,transforms:r,size:o,scaleX:n,anchorX:a,anchorY:c,angle:l,colorLocked:u,frameHeight:f,widthRatio:x,offsetX:p,offsetY:d,outlineSize:y,referenceSize:_,scaleFactor:P,sizeRatio:S,isAbsoluteAnchorPoint:I,rotateClockwise:w,scaleSymbolsProportionally:N,sprite:b}=e;if(r&&r.infos.length>0){const B=Bt(o,l,w,p,d,r);o=B.size,l=B.rotation,p=B.offsetX,d=B.offsetY,w=!1}P&&(o*=P,p*=P,d*=P);const E=n*(b.width/b.height);s.alignment=i,s.rawHeight=m(o),s.rawWidth=s.rawHeight*E,s.referenceSize=m(_),s.sizeRatio=S,s.sdfDecodeCoeff=(b.sdfDecodeCoeff??1)*S,s.angle=l,s.rotateClockwise=w,s.anchorX=a,s.anchorY=c,s.offsetX=m(p),s.offsetY=m(d),I&&o&&(b.sdf?s.anchorX=a/(o*x):s.anchorX=a/(o*E),s.anchorY=c/o);const ot=N&&f?o/f:1;return s.outlineSize=y===0||isNaN(y)?0:m(y)*ot,s.scaleSymbolsProportionally=N,s.colorLocked=u,s._computeSize(e,!0),s}constructor(e,s,i,r,o,n,a){this.sprite=e,this.color=s,this.outlineColor=i,this.minPixelBuffer=r,this.placement=o,this.scaleInfo=n,this.effects=a,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.sdfDecodeCoeff=1,this.alignment=Lt.SCREEN,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_computeSize(e,s){const{sprite:i,hasSizeVV:r}=e,o=!!i.sdf,n=i.sdfPaddingRatio??.5,{rawWidth:a,rawHeight:c,sizeRatio:l,outlineSize:u}=this,f=l*(o?1/(1-n):1),x=a*f,p=c*f;if(o&&!r){const N=s&&a>c?x:a,b=c,E=u+2*1;this.computedWidth=Math.min(N+E,x),this.computedHeight=Math.min(b+E,p)}else this.computedWidth=x,this.computedHeight=p;const d=o?Math.max(i.width,i.height)/Math.max(x,p):1,y=.5*(x-this.computedWidth)*d,_=.5*(p-this.computedHeight)*d,P=i.rect.x+R+y,S=i.rect.y+R+_,I=P+i.width-2*y,w=S+i.height-2*_;this.texXmin=Math.floor(P),this.texYmin=Math.floor(S),this.texXmax=Math.ceil(I),this.texYmax=Math.ceil(w),this.computedWidth*=(this.texXmax-this.texXmin)/(I-P),this.computedHeight*=(this.texYmax-this.texYmin)/(w-S),this.anchorX*=x/this.computedWidth,this.anchorY*=p/this.computedHeight}};const Gs=3.14159265359/180,Rs=128/Math.PI;function Fs(t,e){return t%=e,Math.abs(t>=0?t:t+e)}function Os(t){return Fs(t*Rs,256)}function Cs(t,e,s,i,r=!1){const o=Me(),n=r?1:-1;return Ie(o),(e||s)&&ze(o,o,[e,-s]),i&&De(o,o,n*Gs*-i),o}const Ws={createComputedParams:t=>Ls.from(t),optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({sprite:t,alignment:e,scaleSymbolsProportionally:s,overrideOutlineColor:i,colorLocked:r})=>{let o=0;return t.sdf&&(o|=W(C.bitset.isSDF)),e===Lt.MAP&&(o|=W(C.bitset.isMapAligned)),s&&(o|=W(C.bitset.scaleSymbolsProportionally)),i&&(o|=W(C.bitset.overrideOutlineColor)),r&&(o|=W(C.bitset.colorLocked)),o}},offset:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({angle:t,computedWidth:e,computedHeight:s,anchorX:i,anchorY:r,offsetX:o,offsetY:n,rotateClockwise:a})=>{const c=Cs(0,o,n,-t,a),l=-(.5+i)*e,u=-(.5-r)*s,f=[l,u],x=[l+e,u],p=[l,u+s],d=[l+e,u+s];return Q(f,f,c),Q(x,x,c),Q(p,p,c),Q(d,d,c),[f,x,p,d]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:t,texXmin:e,texYmax:s,texYmin:i})=>[[e,i],[t,i],[e,s],[t,s]]}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},sizing:{type:h.UNSIGNED_BYTE,count:4,pack:({rawWidth:t,rawHeight:e,outlineSize:s,referenceSize:i})=>{const r=Math.max(t,e);return[ut(r,128),ut(s,128),ut(i,128),0]}},placementAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:t})=>Os(t)},sdfDecodeCoeff:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:t})=>t}}};class pi extends O{constructor(){super(...arguments),this.vertexSpec=Ws}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,s,i){const r=this.evaluatedMeshParams.sprite?.textureBinding,o=s.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,r);const n=this.evaluatedMeshParams.minPixelBuffer,a=Math.max(this.evaluatedMeshParams.computedWidth,n),c=Math.max(this.evaluatedMeshParams.computedHeight,n),l=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,u=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,f=this.evaluatedMeshParams.offsetX+l,x=-this.evaluatedMeshParams.offsetY+u;if(this.evaluatedMeshParams.placement!=null)this._writePlacedMarkers(e,s,i,a,c);else if(i?.nextPath()){i.nextPoint();const p=i.x,d=i.y;e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else if(s.geometryType==="esriGeometryPolygon"){const p=s.readCentroidForDisplay();if(!p)return;const[d,y]=p.coords;e.recordBounds(d+f,y+x,a,c),this._writeQuad(e,o,d,y)}else if(s.geometryType==="esriGeometryPoint"){const p=s.readXForDisplay(),d=s.readYForDisplay();e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else s.readGeometryForDisplay()?.forEachVertex((p,d)=>{e.recordBounds(p+f,d+x,a,c),Math.abs(p)>J||Math.abs(d)>J||this._writeQuad(e,o,p,d)});e.recordEnd()}_writePlacedMarkers(e,s,i,r,o){const n=i??T.fromFeatureSetReaderCIM(s)?.clone();if(!n)return;const a=-1,c=$t.getPlacement(n,a,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!c)return;const l=s.getDisplayId();let u=c.next();const f=this.evaluatedMeshParams.offsetX,x=-this.evaluatedMeshParams.offsetY;for(;u!=null;){const p=u.tx,d=-u.ty;if(Math.abs(p)>J||Math.abs(d)>J){u=c.next();continue}const y=-u.getAngle();e.recordBounds(p+f,d+x,r,o),this._writeQuad(e,l,p,d,y),u=c.next()}}_writeQuad(e,s,i,r,o){const n=e.vertexCount(),a=o==null?null:{placementAngle:o};this._writeVertex(e,s,i,r,a),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Us={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},offset:{type:h.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:t})=>{const e=m(t),s=-e/2,i=-e/2;return[[s,i],[s+e,i],[s,i+e],[s+e,i+e]]}}},texCoords:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:h.UNSIGNED_BYTE,count:2,pack:({size:t})=>[t,t]},referenceSize:{type:h.UNSIGNED_BYTE,count:1,pack:({size:t})=>m(t)},zoomRange:{type:h.UNSIGNED_BYTE,count:2,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}}};class di extends O{constructor(){super(...arguments),this.vertexSpec=Us}_write(e,s){const i=s.getDisplayId(),r=this.evaluatedMeshParams.minPixelBuffer,o=Math.max(m(this.evaluatedMeshParams.size),r);let n,a;if(s.geometryType==="esriGeometryPoint")n=s.readXForDisplay(),a=s.readYForDisplay();else{const l=s.readCentroidForDisplay();if(!l)return;n=l?.coords[0],a=l?.coords[1]}e.recordStart(this.instanceId,this.attributeLayout),e.recordBounds(n,a,o,o);const c=e.vertexCount();this._writeVertex(e,i,n,a),e.indexWrite(c+0),e.indexWrite(c+1),e.indexWrite(c+2),e.indexWrite(c+1),e.indexWrite(c+3),e.indexWrite(c+2),e.recordEnd()}}export{di as $,W as C,li as F,ui as I,Es as J,ci as M,hi as O,pi as Q,Z as R,xs as X,Re as Y,ni as a,ai as b,Zt as c,O as d,g,Kt as k,oi as m,Jt as y}; +import{_ as te}from"./main-QGPoLsvl.js";import{I as h}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{K as ee,et as m,ar as se,o as ie,a1 as re,hJ as oe,ae as gt}from"./story-Doly9N9p.js";import{b as $,e as kt,c as ne,i as ae,P as ce,x as zt,d as Dt,Y as ue,W as le,X as he,U as pe,u as C,f as St,R as Pt,g as vt,E as T,h as de,j as fe}from"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import{O as xe,D as At,d as Yt}from"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import{t as tt,K as rt,n as R,d as me,$ as ye,_ as _e,r as ge,c as ke}from"./definitions-DJSdSb77-DkoRHaVx.js";import{D as Se,M as Pe,k as ve}from"./TurboLine-CIlsAy5m-C6Kc2De-.js";import{t as Nt,e as be,Z as we,V as Te}from"./LabelMetric-BeluzH3o-Br-5CSAC.js";import{I as Bt}from"./utils-SPbpQbmm-CiwW7WzR.js";import{S as G,r as Lt,i as nt,R as at,t as ct}from"./enums-CpSG_SL3-BMD3Tb1v.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import{c as Ee}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{l as Me,G as Ie,i as ze,e as De}from"./Tile-D75RMC64-g8Sx5TPr.js";import{L as Q}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{e as J}from"./constants-Bqe1QJ4u-F8oTIn7N.js";const Ae=()=>re.getLogger("esri.views.2d.engine.webgl.shaderGraph.techniques.meshWriterUtils"),Ye=0,Ne=100;function Z(t,e){return[!!t?.minScale&&e.scaleToZoom(t.minScale)||Ye,!!t?.maxScale&&e.scaleToZoom(t.maxScale)||Ne]}function W(t){return 1<import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(t=>t.g)}function Rt(t){switch(t){case h.BYTE:case h.UNSIGNED_BYTE:return 1;case h.SHORT:case h.UNSIGNED_SHORT:case h.HALF_FLOAT:return 2;case h.FLOAT:case h.INT:case h.UNSIGNED_INT:return 4}}function Oe(t){const e=[],s=[],i=[];for(const r of t){const o=Rt(r.type)*r.count;switch(o%2||o%4||4){case 4:e.push(r);continue;case 2:s.push(r);continue;case 1:i.push(r);continue;default:throw new Error("Found unexpected dataType byte count")}}return e.push(...s),e.push(...i),e}let Ce=class Ft{static fromVertexSpec(e,s){const{attributes:i,optionalAttributes:r}=e;let o,n,a;const c=[];for(const y in i){const _=i[y];_.pack==="position"?o={..._,name:y,offset:0}:_.pack==="id"?n={..._,name:y,offset:4}:y==="bitset"?a={..._,name:y,offset:7}:c.push({..._,name:y})}for(const y in r)if(s[y]===!0){const _=r[y];c.push({..._,name:y})}const l=Oe(c),u=[];let f=8,x=1;for(const y of l)u.push({...y,offset:f}),f+=Rt(y.type)*y.count,y.packAlternating&&(x=Math.max(y.packAlternating.count,x));const p=Uint32Array.BYTES_PER_ELEMENT,d=f%p;return new Ft(o,n,a,u,f+(d?p-d:0),x)}constructor(e,s,i,r,o,n){this.position=e,this.id=s,this.bitset=i,this.standardAttributes=r,this.stride=o,this.packVertexCount=n,r.push(i),this._attributes=[e,s,i,...r]}get attributeLayout(){if(!this._attributeLayout){const e=we(this._attributes),s=this._attributes.map(i=>({name:i.name,count:i.count,offset:i.offset,type:i.type,packPrecisionFactor:i.packPrecisionFactor,normalized:i.normalized??!1}));this._attributeLayout={attributes:s,hash:e,stride:this.stride}}return this._attributeLayout}},We=class Ot{static fromVertexSpec(e,s){const i=Ce.fromVertexSpec(e,s);return new Ot(i)}constructor(e){this._spec=e,this._packed=new Uint8Array(this._spec.stride*this._spec.packVertexCount),this._packedU32View=new Uint32Array(this._packed.buffer),this._dataView=new DataView(this._packed.buffer)}get attributeLayout(){return this._spec.attributeLayout}get stride(){return this._spec.stride}writeVertex(e,s,i,r,o,n){for(let a=0;athis.vertexSpec.createComputedParams(r)}get _vertexPack(){if(!this._cachedVertexPack){const t=We.fromVertexSpec(this.vertexSpec,this._enabledOptionalAttributes);this._evaluator.hasDynamicProperties||t.pack(this._evaluator.evaluatedMeshParams,this._viewParams),this._cachedVertexPack=t}return this._cachedVertexPack}get evaluatedMeshParams(){return this._evaluator.evaluatedMeshParams}get hasEffects(){return!!this.evaluatedMeshParams.effects}get instanceId(){return this._instanceId}get attributeLayout(){return this._vertexPack.attributeLayout}setReferences(t){this._references=t}getBoundsInfo(){return null}getTileInfo(){return this._viewParams.tileInfo}async loadDependencies(){Ue(this._evaluator.inputMeshParams.effects?.effectInfos)&&await Fe()}enqueueRequest(t,e,s){this._evaluator.hasDynamicProperties&&this._evaluator.enqueueRequest(t,e,s)}write(t,e,s,i,r){this.ensurePacked(e,s,i);const o=this.evaluatedMeshParams.effects;if(!o||o.length===0)return void this._write(t,s,void 0,r);const n=s.readGeometryForDisplay()?.clone();if(!n)return;const a=T.fromOptimizedCIM(n,s.geometryType),c=mt();a.invertY();const l=t.id||"",u=Re.executeEffects(o,a,l,c);let f;for(;f=u.next();)f.invertY(),this._write(t,s,f,r)}ensurePacked(t,e,s){if(!this._evaluator.hasDynamicProperties)return;const i=this._evaluator.evaluateMeshParams(t,e,s);this._vertexPack.pack(i,this._viewParams)}_writeVertex(t,e,s,i,r){const o=this.evaluatedMeshParams;this._vertexPack.writeVertex(t,e,s,i,o,r)}};function He(t,e,s,i,r,o,n){pt=0;const a=(i-s)*o,c=r&&r.length,l=c?(r[0]-s)*o:a;let u,f,x,p,d,y=Ct(e,s,i,0,l,o,!0);if(y&&y.next!==y.prev){if(c&&(y=qe(e,s,i,r,y,o)),a>80*o){u=x=e[0+s*o],f=p=e[1+s*o];for(let _=o;_0)for(let c=i;c=i;c-=o)a=bt(c+e*o,t[c+e*o],t[c+1+e*o],a);return a&&D(a,a.next)&&(X(a),a=a.next),a}function U(t,e=t){if(!t)return t;let s,i=t;do if(s=!1,i.steiner||!D(i,i.next)&&k(i.prev,i,i.next)!==0)i=i.next;else{if(X(i),i=e=i.prev,i===i.next)break;s=!0}while(s||i!==e);return e}function H(t,e,s,i,r,o,n,a){if(!t)return;!a&&o&&(t=Wt(t,i,r,o));let c=t;for(;t.prev!==t.next;){const l=t.prev,u=t.next;if(o?Ve(t,i,r,o):Xe(t))e.push(l.index/s+n),e.push(t.index/s+n),e.push(u.index/s+n),X(t),t=u.next,c=u.next;else if((t=u)===c){a?a===1?H(t=es(t,e,s,n),e,s,i,r,o,n,2):a===2&&ss(t,e,s,i,r,o,n):H(U(t),e,s,i,r,o,n,1);break}}}function Xe(t){const e=t.prev,s=t,i=t.next;if(k(e,s,i)>=0)return!1;let r=t.next.next;const o=r;let n=0;for(;r!==t.prev&&(n===0||r!==o);){if(n++,L(e.x,e.y,s.x,s.y,i.x,i.y,r.x,r.y)&&k(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ve(t,e,s,i){const r=t.prev,o=t,n=t.next;if(k(r,o,n)>=0)return!1;const a=r.xo.x?r.x>n.x?r.x:n.x:o.x>n.x?o.x:n.x,u=r.y>o.y?r.y>n.y?r.y:n.y:o.y>n.y?o.y:n.y,f=lt(a,c,e,s,i),x=lt(l,u,e,s,i);let p=t.prevZ,d=t.nextZ;for(;p&&p.z>=f&&d&&d.z<=x;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0||(p=p.prevZ,d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0))return!1;d=d.nextZ}for(;p&&p.z>=f;){if(p!==t.prev&&p!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,p.x,p.y)&&k(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;d&&d.z<=x;){if(d!==t.prev&&d!==t.next&&L(r.x,r.y,o.x,o.y,n.x,n.y,d.x,d.y)&&k(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function bt(t,e,s,i){const r=F.create(t,e,s);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function X(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ze(t){let e=t,s=t;do(e.x=s.next.y&&s.next.y!==s.y){const x=s.x+(r-s.y)*(s.next.x-s.x)/(s.next.y-s.y);if(x<=i&&x>n){if(n=x,x===i){if(r===s.y)return s;if(r===s.next.y)return s.next}o=s.x=s.x&&s.x>=c&&i!==s.x&&L(ro.x)&&V(s,t)&&(o=s,f=u)),s=s.next;return o}function Wt(t,e,s,i){let r;for(;r!==t;r=r.next){if(r=r||t,r.z===null&&(r.z=lt(r.x,r.y,e,s,i)),r.prev.next!==r||r.next.prev!==r)return r.prev.next=r,r.next.prev=r,Wt(t,e,s,i);r.prevZ=r.prev,r.nextZ=r.next}return t.prevZ.nextZ=null,t.prevZ=null,je(t)}function je(t){let e,s=1;for(;;){let i,r=t;t=null,e=null;let o=0;for(;r;){o++,i=r;let n=0;for(;n0||a>0&&i;){let c;n===0?(c=i,i=i.nextZ,a--):a!==0&&i?r.z<=i.z?(c=r,r=r.nextZ,n--):(c=i,i=i.nextZ,a--):(c=r,r=r.nextZ,n--),e?e.nextZ=c:t=c,c.prevZ=e,e=c}r=i}if(e.nextZ=null,s*=2,o<2)return t}}function k(t,e,s){return(e.y-t.y)*(s.x-e.x)-(e.x-t.x)*(s.y-e.y)}function Ut(t,e,s,i){return!!(D(t,e)&&D(s,i)||D(t,i)&&D(s,e))||k(t,e,s)>0!=k(t,e,i)>0&&k(s,i,t)>0!=k(s,i,e)>0}function Ke(t,e){let s=t;do{if(s.index!==t.index&&s.next.index!==t.index&&s.index!==e.index&&s.next.index!==e.index&&Ut(s,s.next,t,e))return!0;s=s.next}while(s!==t);return!1}function $e(t,e,s,i,r,o){let n=0;for(let a=i,c=r-o;a=0&&(t-n)*(i-a)-(s-n)*(e-a)>=0&&(s-n)*(o-a)-(r-n)*(i-a)>=0}function V(t,e){return k(t.prev,t,t.next)<0?k(t,e,t.next)>=0&&k(t,t.prev,e)>=0:k(t,e,t.prev)<0||k(t,t.next,e)<0}function lt(t,e,s,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-s)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function D(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e){return t.x-e.x}function es(t,e,s,i){let r=t;do{const o=r.prev,n=r.next.next;!D(o,n)&&Ut(o,r,r.next,n)&&V(o,n)&&V(n,o)&&(e.push(o.index/s+i),e.push(r.index/s+i),e.push(n.index/s+i),X(r),X(r.next),r=t=n),r=r.next}while(r!==t);return r}function ss(t,e,s,i,r,o,n){let a=t;do{let c=a.next.next;for(;c!==a.prev;){if(a.index!==c.index&&is(a,c)){let l=Ht(a,c);return a=U(a,a.next),l=U(l,l.next),H(a,e,s,i,r,o,n,0),void H(l,e,s,i,r,o,n,0)}c=c.next}a=a.next}while(a!==t)}function is(t,e){return t.next.index!==e.index&&t.prev.index!==e.index&&!Ke(t,e)&&V(t,e)&&V(e,t)&&rs(t,e)}function rs(t,e){let s=t,i=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do s.y>o!=s.next.y>o&&s.next.y!==s.y&&r<(s.next.x-s.x)*(o-s.y)/(s.next.y-s.y)+s.x&&(i=!i),s=s.next;while(s!==t);return i}function Ht(t,e){const s=F.create(t.index,t.x,t.y),i=F.create(e.index,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,s.next=r,r.prev=s,i.next=s,s.prev=i,o.next=i,i.prev=o,i}class F{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(e,s,i){const r=pt0))break;u+=_,f.push(n+l),l+=y}const x=o.length;He(o,s,n,n+l,f,2,r);const p=as(o,s,x,o.length,r),d=Math.abs(u);if(Math.abs((p-d)/Math.max(1e-7,d))>ns)return o.length=0,!1;a=c,n+=l}return!0}function us(t){const{coords:e,lengths:s}=t,{buffer:i}=ve(e,s);return i}function ls(t,e,s){let i=0;for(let r=0;rs||cs)return!0}i+=o}return!1}function Xt(t,e){if(t==null)return null;if(!ls(t,-128,tt+128))return t;z.setPixelMargin(e),z.reset(Yt.Polygon);let s=0;for(let n=0;nr||ur){n=!0;continue}c.push({x:l,y:u})}let f=!1;for(;t.nextPoint();)if(l=t.x,u=t.y,n)s.lineTo(l,u);else{if(lr||ur){f=!0;break}c.push({x:l,y:u})}if(f)n=!0;else{if(n){const x=s.resultWithStarts();if(x)for(const p of x)o.push(p)}else o.push({line:c,start:0});a=t.nextPath(),n=!1}}return o=o.filter(c=>c.line.length>1),o.length===0?null:o}z.setExtent(tt),dt.setExtent(tt);const ps=100,ds=ee("featurelayer-fast-triangulation-enabled");class Vt extends O{async loadDependencies(){await Promise.all([super.loadDependencies(),Pe()])}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);o&&(e.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(e,s,o),e.recordEnd())}_clip(e){if(!e)return null;const s=this.hasEffects;return Xt(e,s?256:8)}_writeGeometry(e,s,i){const r=i.maxLength>ps,o=[],n=this.createTesselationParams(s);if(!r&&ds&&cs(o,i))return void(o.length&&this._writeVertices(e,s,i.coords,n,o));const a=us(i);this._writeVertices(e,s,a,n)}_writeVertices(e,s,i,r,o){const n=s.getDisplayId(),a=e.vertexCount(),c=this.hasEffects;let l=0;if(o)for(const u of o){const f=i[2*u],x=i[2*u+1];c&&e.recordBounds(f,x,0,0),this._writeVertex(e,n,f,x,r),l++}else for(let u=0;ut,optionalAttributes:{},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},inverseArea:{type:h.FLOAT,count:1,packTessellation:({inverseArea:t})=>t}}};let oi=class extends Vt{constructor(){super(...arguments),this.vertexSpec=fs}createTesselationParams(t){return{inverseArea:1/t.readGeometryArea()}}};const ft={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}};let Zt=class extends Vt{constructor(){super(...arguments),this.vertexSpec=ft}createTesselationParams(t){return null}};const A={createComputedParams:t=>t,optionalAttributes:ft.optionalAttributes,attributes:{...ft.attributes,tlbr:{count:4,type:h.UNSIGNED_SHORT,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},inverseRasterizationScale:{count:1,type:h.BYTE,packPrecisionFactor:16,pack:({sprite:t})=>1/t.rasterizationScale}}};let xs=class extends Zt{constructor(){super(...arguments),this.vertexSpec=A}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),t.recordEnd()}};function et(t){const{sprite:e,aspectRatio:s,scaleProportionally:i}=t,r=m(t.height),o=r>0?r:e.height;let n=r*s;return n<=0?n=e.width:i&&(n*=e.width/e.height),{width:n,height:o}}function qt(t){const{applyRandomOffset:e,sampleAlphaOnly:s}=t;return q([[ce,e],[zt,s]])}const Qt={createComputedParams:t=>t,optionalAttributes:A.optionalAttributes,attributes:{...A.attributes,bitset:{count:1,type:h.UNSIGNED_BYTE,pack:qt},width:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},height:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},offset:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),-m(e)]},scale:{count:2,type:h.UNSIGNED_BYTE,packPrecisionFactor:16,pack:({scaleX:t,scaleY:e})=>[t,e]},angle:{count:1,type:h.UNSIGNED_BYTE,pack:({angle:t})=>xe(t)}}};let ni=class extends xs{constructor(){super(...arguments),this.vertexSpec=Qt}},ms=class{constructor(){this.extrusionOffsetX=0,this.extrusionOffsetY=0,this.normalX=0,this.normalY=0,this.directionX=0,this.directionY=0,this.distance=0}};const Y={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},bitset:{type:h.UNSIGNED_BYTE,count:1},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},offset:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[j(t,16),j(e,16)]},normal:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({normalX:t,normalY:e})=>[j(t,16),j(e,16)]},halfWidth:{type:h.HALF_FLOAT,count:1,pack:({width:t})=>m(.5*t)},referenceHalfWidth:{type:h.HALF_FLOAT,count:1,pack:({referenceWidth:t})=>m(.5*t)}}};let ys=class{constructor(){this.id=0,this.bitset=0,this.indexCount=0,this.vertexCount=0,this.vertexFrom=0,this.vertexBounds=0}};const Tt=65535;let Jt=class extends O{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=Y,this._currentWrite=new ys,this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0,wrapDistance:Tt,textured:!1},this._tessParams=new ms,this._initializeTessellator()}writeLineVertices(t,e,s){const i=this._getLines(e);i!=null&&this._writeVertices(t,s,i)}_initializeTessellator(){this._lineTessellator=new Se(this._writeTesselatedVertex.bind(this),this._writeTriangle.bind(this),!0)}_write(t,e,s){const i=s??T.fromFeatureSetReaderCIM(e);i&&this._writeGeometry(t,e,i)}_writeGeometry(t,e,s,i){t.recordStart(this.instanceId,this.attributeLayout,i),this.writeLineVertices(t,s,e),t.recordEnd()}_getLines(t){return hs(t,Nt(this.evaluatedMeshParams))}_writeVertices(t,e,s){const{_currentWrite:i,_tessellationOptions:r,evaluatedMeshParams:o}=this,{width:n,capType:a,joinType:c,miterLimit:l,hasSizeVV:u}=o,f=m(.5*n);r.halfWidth=f,r.capType=Be(a),r.joinType=Le(c),r.miterLimit=l;const x=!u;i.out=t,i.id=e.getDisplayId(),i.vertexCount=0,i.indexCount=0,i.vertexFrom=t.vertexCount(),i.vertexBounds=x&&ft,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)}}},yt={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)}}};let _t=class extends Jt{constructor(){super(...arguments),this.vertexSpec=yt}},Kt=class extends Zt{constructor(t,e,s,i){super(t,e,s,i),this.vertexSpec=jt,this._lineMeshWriter=this._createOutlineWriter(t,e,s,i)}_createOutlineWriter(t,e,s,i){return new _t(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);r&&(t.recordStart(this.instanceId,this.attributeLayout),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd())}_clip(t){return t?Xt(t,Nt(this.evaluatedMeshParams)):null}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const st=Qt,_s=yt,gs={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>qt(t)},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).width},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>et(t).height},aux3:{count:2,type:h.HALF_FLOAT,pack:({offsetX:t,offsetY:e})=>[m(t),m(e)]},aux4:{count:2,type:h.UNSIGNED_BYTE,pack:({scaleX:t,scaleY:e})=>[t*$,e*$]}}},ks={createComputedParams:t=>t,optionalAttributes:st.optionalAttributes,attributes:{...st.attributes,color:_s.attributes.color,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>q([[Dt,!0]])},aux1:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.width)},aux2:{count:1,type:h.HALF_FLOAT,pack:t=>m(.5*t.referenceWidth)},aux3:{count:2,type:h.HALF_FLOAT,packTessellation:({extrusionOffsetX:t,extrusionOffsetY:e})=>[t,e]},aux4:{count:2,type:h.UNSIGNED_BYTE,packTessellation:({normalX:t,normalY:e})=>[t*$+kt,e*$+kt]}}};class Ss extends _t{constructor(){super(...arguments),this.vertexSpec=ks}}let ai=class extends Kt{constructor(){super(...arguments),this.vertexSpec=gs}_createOutlineWriter(t,e,s,i){return new Ss(t,e,s,i)}_write(t,e,s){const i=s?.asOptimized()??e.readGeometryForDisplay(),r=this._clip(i);if(!r)return;const o=this.evaluatedMeshParams.sprite?.textureBinding;t.recordStart(this.instanceId,this.attributeLayout,o),this._writeGeometry(t,e,r),this._lineMeshWriter.writeLineVertices(t,T.fromOptimizedCIM(r,"esriGeometryPolyline"),e),t.recordEnd()}ensurePacked(t,e,s){super.ensurePacked(t,e,s),this._lineMeshWriter.ensurePacked(t,e,s)}enqueueRequest(t,e,s){super.enqueueRequest(t,e,s),this._lineMeshWriter.enqueueRequest(t,e,s)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}};const Ps={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...jt.attributes}},vs={optionalAttributes:A.optionalAttributes,createComputedParams:t=>t,attributes:{...A.attributes,...yt.attributes}};class bs extends _t{constructor(){super(...arguments),this.vertexSpec=vs}}class ci extends Kt{constructor(){super(...arguments),this.vertexSpec=Ps}_createOutlineWriter(e,s,i,r){return new bs(e,s,i,r)}_write(e,s,i){const r=i?.asOptimized()??s.readGeometryForDisplay(),o=this._clip(r);if(!o)return;const n=this.evaluatedMeshParams.sprite?.textureBinding;e.recordStart(this.instanceId,this.attributeLayout,n),this._writeGeometry(e,s,o),this._lineMeshWriter.writeLineVertices(e,T.fromOptimizedCIM(o,"esriGeometryPolyline"),s),e.recordEnd()}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._lineMeshWriter.ensurePacked(e,s,i)}enqueueRequest(e,s,i){super.enqueueRequest(e,s,i),this._lineMeshWriter.enqueueRequest(e,s,i)}async loadDependencies(){await Promise.all([super.loadDependencies(),this._lineMeshWriter.loadDependencies()])}}const ws={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1},offset:{type:h.BYTE,count:2,packAlternating:{count:4,pack:()=>[[-1,-1],[1,-1],[-1,1],[1,1]]}}}};let ui=class extends O{constructor(){super(...arguments),this.vertexSpec=ws}_write(t,e){t.recordStart(this.instanceId,this.attributeLayout);const s=e.getDisplayId();if(e.geometryType==="esriGeometryPoint"){const i=e.readXForDisplay(),r=e.readYForDisplay();this._writeQuad(t,s,i,r)}else e.geometryType==="esriGeometryMultipoint"&&e.readGeometryForDisplay()?.forEachVertex((i,r)=>{i>=0&&i<=512&&r>=0&&r<=512&&this._writeQuad(t,s,i,r)});t.recordEnd()}_writeQuad(t,e,s,i){const r=t.vertexCount();this._writeVertex(t,e,s,i),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}};class $t{static getPlacement(e,s,i,r,o,n){const a=fe(i);return a?(s===-1&&e.invertY(),a.execute(e,i,r,o,n)):null}}const Et=96;class Ts{constructor(e){const{offsetX:s,offsetY:i,postAngle:r,fontSize:o,haloSize:n,outlineSize:a,scaleFactor:c,transforms:l}=e;if(this.offsetX=s,this.offsetY=i,this.postAngle=r,this.fontSize=Math.min(o,Et),this.haloSize=n??0,this.outlineSize=a??0,this.transforms=l,l&&l.infos.length>1){const u=Bt(o,r,!1,s,i,l,!1);this.fontSize=Math.min(u.size,Et);const f=u.size/o;this.haloSize*=f,this.outlineSize*=f,this.postAngle=u.rotation,this.offsetX=u.offsetX,this.offsetY=u.offsetY}c&&(this.fontSize*=c,this.offsetX*=c,this.offsetY*=c)}}const Es=28,M=[4,4],K=[16,4],Ms={topLeft:K,topRight:K,bottomLeft:K,bottomRight:K},it=[4,2],v=[4,6],Mt={topLeft:it,topRight:it,bottomLeft:v,bottomRight:v},It={topLeft:it,topRight:v,bottomLeft:it,bottomRight:v},Is={topLeft:v,topRight:v,bottomLeft:M,bottomRight:M},zs={topLeft:M,topRight:M,bottomLeft:v,bottomRight:v},Ds={topLeft:v,topRight:M,bottomLeft:v,bottomRight:M},As={topLeft:M,topRight:v,bottomLeft:M,bottomRight:v},Ys={createComputedParams:t=>t,optionalAttributes:{zoomRange:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:rt,packTessellation:({minZoom:t,maxZoom:e})=>[t||0,e||Es]},clipAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({clipAngle:t})=>Ns(t||0)},referenceSymbol:{type:h.BYTE,count:4,packPrecisionFactor:1,packTessellation:(t,e)=>{const s=t.isLineLabel||!t.referenceBounds,i=ne(s?"center":e.horizontalAlignment),r=ae(s?"middle":e.verticalAlignment),{offsetX:o,offsetY:n,size:a}=s?{offsetX:0,offsetY:0,size:0}:t.referenceBounds;return[m(o),-m(n),Math.round(m(a)),i+1<<2|r+1]}}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({isBackground:t,mapAligned:e})=>q([[ue,t],[le,!!e]])},offset:{type:h.SHORT,count:2,packPrecisionFactor:8,packAlternating:{count:4,packTessellation:({offsets:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,packTessellation:({texcoords:t})=>{const{bottomLeft:e,bottomRight:s,topLeft:i,topRight:r}=t;return[i,r,e,s]}}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,packTessellation:({color:t})=>t},fontSize:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t})=>Math.round(m(t))},referenceSize:{type:h.UNSIGNED_BYTE,count:1,packPrecisionFactor:4,packTessellation:({fontSize:t},{referenceSize:e})=>Math.round(m(e??t))},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},haloColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({haloColor:t})=>g(t)},outlineAndHaloSize:{type:h.UNSIGNED_SHORT,count:2,packPrecisionFactor:4,packTessellation:({outlineSize:t,haloSize:e})=>[Math.round(m(t)),Math.round(m(e))]}}};class li extends O{constructor(){super(...arguments),this.vertexSpec=Ys,this._textMeshParamsPropsInitialized=!1}ensurePacked(e,s,i){super.ensurePacked(e,s,i),this._textMeshParamsPropsInitialized&&!this._evaluator.hasDynamicProperties||(this._textMeshTransformProps=new Ts(this.evaluatedMeshParams),this._textMeshParamsPropsInitialized=!0)}_write(e,s,i){const r=this._getShaping();if(!r)return;const o=s.getDisplayId();if(this.evaluatedMeshParams.placement!=null)return this._writePlacedTextMarkers(e,s,r,i);if(i?.nextPath())return i.nextPoint(),this._writeGlyphs(e,o,i.x,i.y,r,0);if(s.geometryType==="esriGeometryPolygon"){const c=s.readCentroidForDisplay();if(!c)return;const[l,u]=c.coords;return this._writeGlyphs(e,o,l,u,r,0)}if(s.geometryType==="esriGeometryMultipoint")return void s.readGeometryForDisplay()?.forEachVertex((c,l)=>this._writeGlyphs(e,o,c,l,r,0));const n=s.readXForDisplay(),a=s.readYForDisplay();return this._writeGlyphs(e,o,n,a,r,0)}_writePlacedTextMarkers(e,s,i,r){const o=r??T.fromFeatureSetReaderCIM(s);if(!o)return;const n=-1,a=$t.getPlacement(o,n,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!a)return;const c=s.getDisplayId();let l=a.next();for(;l!=null;){const u=l.tx,f=-l.ty,x=-l.getAngle();this._writeGlyphs(e,c,u,f,i,x),l=a.next()}}_getShaping(e){const s=this._textMeshTransformProps,i=this.evaluatedMeshParams;if(!i.glyphs?.glyphs.length)return null;const r=m(s.fontSize),o=m(s.offsetX),n=m(s.offsetY),a=gt(m(i.lineWidth),_e,ye),c=ge*gt(i.lineHeightRatio,.25,4);return de(i.glyphs,{scale:r/ke,angle:s.postAngle,xOffset:o,yOffset:n,horizontalAlignment:i.horizontalAlignment,verticalAlignment:e||i.verticalAlignment,maxLineWidth:a,lineHeight:c,decoration:i.decoration,borderLineSizePx:m(i.boxBorderLineSize),hasBackground:!!i.boxBackgroundColor,useCIMAngleBehavior:i.useCIMAngleBehavior})}_writeGlyphs(e,s,i,r,o,n,a,c){const l=this.evaluatedMeshParams,u=this._textMeshTransformProps,f=m(u.fontSize),x=u.haloSize,p=u.outlineSize,d=m(u.offsetX),y=m(u.offsetY),[_,P]=Z(l.scaleInfo,this.getTileInfo());n!==0&&o.setRotation(n);const S=o.bounds,I=i+S.x+d,w=r+S.y-y,N=2*(l.minPixelBuffer?l.minPixelBuffer/f:1),b=Math.max(S.width,S.height)*N;o.textBox&&(e.recordStart(this.instanceId,this.attributeLayout,o.glyphs[0].textureBinding),e.recordBounds(I,w,b,b),this._writeTextBox(e,s,i,r,o.textBox,a,c),e.recordEnd());for(const E of o.glyphs){e.recordStart(this.instanceId,this.attributeLayout,E.textureBinding),e.recordBounds(I,w,b,b);const{texcoords:ot,offsets:B}=E;this._writeQuad(e,s,i,r,{texcoords:ot,offsets:B,fontSize:f,haloSize:x,outlineSize:p,color:g(l.color),isBackground:!1,referenceBounds:a,minZoom:_,maxZoom:P,...c}),e.recordEnd()}n!==0&&o.setRotation(-n)}_writeTextBox(e,s,i,r,o,n,a){const c=this.evaluatedMeshParams,{fontSize:l,haloSize:u,outlineSize:f}=this._textMeshTransformProps,{boxBackgroundColor:x,boxBorderLineColor:p}=c,d={isBackground:!0,fontSize:l,haloSize:u,outlineSize:f,referenceBounds:n,...a};x&&(this._writeQuad(e,s,i,r,{texcoords:Ms,offsets:o.main,color:g(x),...d}),p||(this._writeQuad(e,s,i,r,{texcoords:Is,offsets:o.top,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:zs,offsets:o.bot,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:Ds,offsets:o.left,color:g(x),...d}),this._writeQuad(e,s,i,r,{texcoords:As,offsets:o.right,color:g(x),...d}))),p&&(this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.top,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:Mt,offsets:o.bot,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.left,color:g(p),...d}),this._writeQuad(e,s,i,r,{texcoords:It,offsets:o.right,color:g(p),...d}))}_writeQuad(e,s,i,r,o){const n=e.vertexCount();this._writeVertex(e,s,i,r,o),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Ns=t=>Math.round(t*(254/360)),Bs={createComputedParams:t=>t,optionalAttributes:Y.optionalAttributes,attributes:{...Y.attributes,bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({shouldSampleAlphaOnly:t,shouldScaleDash:e,isSDF:s})=>q([[zt,t],[he,e],[pe,s]])},tlbr:{type:h.UNSIGNED_SHORT,count:4,pack:({sprite:t})=>{const{rect:e,width:s,height:i}=t,r=e.x+R,o=e.y+R;return[r,o,r+s,o+i]}},accumulatedDistance:{type:h.UNSIGNED_SHORT,count:1,packTessellation:({distance:t})=>t},segmentDirection:{type:h.BYTE,count:2,packPrecisionFactor:16,packTessellation:({directionX:t,directionY:e})=>[t,e]},offsetAlongLine:{type:h.HALF_FLOAT,count:1,pack:({offsetAlongLine:t})=>m(t)},capType:{type:h.UNSIGNED_BYTE,count:1,pack:({capType:t})=>{switch(t){case G.Butt:case"butt":return 0;case G.Square:case"square":return 1;case G.Round:case"round":return 2;default:return 0}}}}};class hi extends Jt{constructor(e,s,i,r){super(e,s,i,r),this.vertexSpec=Bs,this._tessellationOptions.textured=!0}_write(e,s,i){const r=i??T.fromFeatureSetReaderCIM(s);if(!r)return;const{sprite:o}=this.evaluatedMeshParams;this._writeGeometry(e,s,r,o?.textureBinding)}}let Ls=class xt{static from(e){return"width"in e?this.fromSimpleMeshParams(e):this.fromComplexMeshParams(e)}static fromSimpleMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects),{type:i,width:r,height:o,angle:n,alignment:a,outlineSize:c,referenceSize:l,sprite:u,overrideOutlineColor:f}=e;return s.rawWidth=m(r),s.rawHeight=m(o),s.angle=n,s.alignment=a,s.outlineSize=m(c),s.referenceSize=m(l),s.overrideOutlineColor=f,s.offsetX=m(e.offsetX),s.offsetY=m(e.offsetY),i!=="simple"||u.sdf||(s.rawWidth=u.width,s.rawHeight=u.height),s._computeSize(e,!1),s}static fromComplexMeshParams(e){const s=new xt(e.sprite,e.color,e.outlineColor,e.minPixelBuffer,e.placement,e.scaleInfo,e.effects);let{alignment:i,transforms:r,size:o,scaleX:n,anchorX:a,anchorY:c,angle:l,colorLocked:u,frameHeight:f,widthRatio:x,offsetX:p,offsetY:d,outlineSize:y,referenceSize:_,scaleFactor:P,sizeRatio:S,isAbsoluteAnchorPoint:I,rotateClockwise:w,scaleSymbolsProportionally:N,sprite:b}=e;if(r&&r.infos.length>0){const B=Bt(o,l,w,p,d,r);o=B.size,l=B.rotation,p=B.offsetX,d=B.offsetY,w=!1}P&&(o*=P,p*=P,d*=P);const E=n*(b.width/b.height);s.alignment=i,s.rawHeight=m(o),s.rawWidth=s.rawHeight*E,s.referenceSize=m(_),s.sizeRatio=S,s.sdfDecodeCoeff=(b.sdfDecodeCoeff??1)*S,s.angle=l,s.rotateClockwise=w,s.anchorX=a,s.anchorY=c,s.offsetX=m(p),s.offsetY=m(d),I&&o&&(b.sdf?s.anchorX=a/(o*x):s.anchorX=a/(o*E),s.anchorY=c/o);const ot=N&&f?o/f:1;return s.outlineSize=y===0||isNaN(y)?0:m(y)*ot,s.scaleSymbolsProportionally=N,s.colorLocked=u,s._computeSize(e,!0),s}constructor(e,s,i,r,o,n,a){this.sprite=e,this.color=s,this.outlineColor=i,this.minPixelBuffer=r,this.placement=o,this.scaleInfo=n,this.effects=a,this.rawWidth=0,this.rawHeight=0,this.angle=0,this.outlineSize=0,this.referenceSize=0,this.sizeRatio=1,this.sdfDecodeCoeff=1,this.alignment=Lt.SCREEN,this.scaleSymbolsProportionally=!1,this.overrideOutlineColor=!1,this.colorLocked=!1,this.anchorX=0,this.anchorY=0,this.computedWidth=0,this.computedHeight=0,this.texXmin=0,this.texYmin=0,this.texXmax=0,this.texYmax=0,this.offsetX=0,this.offsetY=0,this.rotateClockwise=!0}get boundsInfo(){return{size:Math.max(this.computedHeight,this.computedWidth),offsetX:this.offsetX,offsetY:this.offsetY}}_computeSize(e,s){const{sprite:i,hasSizeVV:r}=e,o=!!i.sdf,n=i.sdfPaddingRatio??.5,{rawWidth:a,rawHeight:c,sizeRatio:l,outlineSize:u}=this,f=l*(o?1/(1-n):1),x=a*f,p=c*f;if(o&&!r){const N=s&&a>c?x:a,b=c,E=u+2*1;this.computedWidth=Math.min(N+E,x),this.computedHeight=Math.min(b+E,p)}else this.computedWidth=x,this.computedHeight=p;const d=o?Math.max(i.width,i.height)/Math.max(x,p):1,y=.5*(x-this.computedWidth)*d,_=.5*(p-this.computedHeight)*d,P=i.rect.x+R+y,S=i.rect.y+R+_,I=P+i.width-2*y,w=S+i.height-2*_;this.texXmin=Math.floor(P),this.texYmin=Math.floor(S),this.texXmax=Math.ceil(I),this.texYmax=Math.ceil(w),this.computedWidth*=(this.texXmax-this.texXmin)/(I-P),this.computedHeight*=(this.texYmax-this.texYmin)/(w-S),this.anchorX*=x/this.computedWidth,this.anchorY*=p/this.computedHeight}};const Gs=3.14159265359/180,Rs=128/Math.PI;function Fs(t,e){return t%=e,Math.abs(t>=0?t:t+e)}function Os(t){return Fs(t*Rs,256)}function Cs(t,e,s,i,r=!1){const o=Me(),n=r?1:-1;return Ie(o),(e||s)&&ze(o,o,[e,-s]),i&&De(o,o,n*Gs*-i),o}const Ws={createComputedParams:t=>Ls.from(t),optionalAttributes:{zoomRange:{type:h.SHORT,count:2,packPrecisionFactor:rt,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}},attributes:{pos:{type:h.SHORT,count:2,pack:"position",packPrecisionFactor:10},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:({sprite:t,alignment:e,scaleSymbolsProportionally:s,overrideOutlineColor:i,colorLocked:r})=>{let o=0;return t.sdf&&(o|=W(C.bitset.isSDF)),e===Lt.MAP&&(o|=W(C.bitset.isMapAligned)),s&&(o|=W(C.bitset.scaleSymbolsProportionally)),i&&(o|=W(C.bitset.overrideOutlineColor)),r&&(o|=W(C.bitset.colorLocked)),o}},offset:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({angle:t,computedWidth:e,computedHeight:s,anchorX:i,anchorY:r,offsetX:o,offsetY:n,rotateClockwise:a})=>{const c=Cs(0,o,n,-t,a),l=-(.5+i)*e,u=-(.5-r)*s,f=[l,u],x=[l+e,u],p=[l,u+s],d=[l+e,u+s];return Q(f,f,c),Q(x,x,c),Q(p,p,c),Q(d,d,c),[f,x,p,d]}}},textureUV:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:({texXmax:t,texXmin:e,texYmax:s,texYmin:i})=>[[e,i],[t,i],[e,s],[t,s]]}},color:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({color:t})=>g(t)},outlineColor:{type:h.UNSIGNED_BYTE,count:4,normalized:!0,pack:({outlineColor:t})=>g(t)},sizing:{type:h.UNSIGNED_BYTE,count:4,pack:({rawWidth:t,rawHeight:e,outlineSize:s,referenceSize:i})=>{const r=Math.max(t,e);return[ut(r,128),ut(s,128),ut(i,128),0]}},placementAngle:{type:h.UNSIGNED_BYTE,count:1,packTessellation:({placementAngle:t})=>Os(t)},sdfDecodeCoeff:{type:h.UNSIGNED_SHORT,count:1,packPrecisionFactor:64,pack:({sdfDecodeCoeff:t})=>t}}};class pi extends O{constructor(){super(...arguments),this.vertexSpec=Ws}getBoundsInfo(){return this.evaluatedMeshParams.boundsInfo}_write(e,s,i){const r=this.evaluatedMeshParams.sprite?.textureBinding,o=s.getDisplayId();e.recordStart(this.instanceId,this.attributeLayout,r);const n=this.evaluatedMeshParams.minPixelBuffer,a=Math.max(this.evaluatedMeshParams.computedWidth,n),c=Math.max(this.evaluatedMeshParams.computedHeight,n),l=-this.evaluatedMeshParams.anchorX*this.evaluatedMeshParams.computedWidth,u=this.evaluatedMeshParams.anchorY*this.evaluatedMeshParams.computedHeight,f=this.evaluatedMeshParams.offsetX+l,x=-this.evaluatedMeshParams.offsetY+u;if(this.evaluatedMeshParams.placement!=null)this._writePlacedMarkers(e,s,i,a,c);else if(i?.nextPath()){i.nextPoint();const p=i.x,d=i.y;e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else if(s.geometryType==="esriGeometryPolygon"){const p=s.readCentroidForDisplay();if(!p)return;const[d,y]=p.coords;e.recordBounds(d+f,y+x,a,c),this._writeQuad(e,o,d,y)}else if(s.geometryType==="esriGeometryPoint"){const p=s.readXForDisplay(),d=s.readYForDisplay();e.recordBounds(p+f,d+x,a,c),this._writeQuad(e,o,p,d)}else s.readGeometryForDisplay()?.forEachVertex((p,d)=>{e.recordBounds(p+f,d+x,a,c),Math.abs(p)>J||Math.abs(d)>J||this._writeQuad(e,o,p,d)});e.recordEnd()}_writePlacedMarkers(e,s,i,r,o){const n=i??T.fromFeatureSetReaderCIM(s)?.clone();if(!n)return;const a=-1,c=$t.getPlacement(n,a,this.evaluatedMeshParams.placement,m(1),e.id,mt());if(!c)return;const l=s.getDisplayId();let u=c.next();const f=this.evaluatedMeshParams.offsetX,x=-this.evaluatedMeshParams.offsetY;for(;u!=null;){const p=u.tx,d=-u.ty;if(Math.abs(p)>J||Math.abs(d)>J){u=c.next();continue}const y=-u.getAngle();e.recordBounds(p+f,d+x,r,o),this._writeQuad(e,l,p,d,y),u=c.next()}}_writeQuad(e,s,i,r,o){const n=e.vertexCount(),a=o==null?null:{placementAngle:o};this._writeVertex(e,s,i,r,a),e.indexWrite(n+0),e.indexWrite(n+1),e.indexWrite(n+2),e.indexWrite(n+1),e.indexWrite(n+3),e.indexWrite(n+2)}}const Us={createComputedParams:t=>t,optionalAttributes:{},attributes:{pos:{type:h.SHORT,count:2,packPrecisionFactor:10,pack:"position"},id:{type:h.UNSIGNED_BYTE,count:3,pack:"id"},bitset:{type:h.UNSIGNED_BYTE,count:1,pack:t=>0},offset:{type:h.SHORT,count:2,packPrecisionFactor:16,packAlternating:{count:4,pack:({size:t})=>{const e=m(t),s=-e/2,i=-e/2;return[[s,i],[s+e,i],[s,i+e],[s+e,i+e]]}}},texCoords:{type:h.SHORT,count:2,packPrecisionFactor:4,packAlternating:{count:4,pack:()=>[[0,1],[1,1],[0,0],[1,0]]}},size:{type:h.UNSIGNED_BYTE,count:2,pack:({size:t})=>[t,t]},referenceSize:{type:h.UNSIGNED_BYTE,count:1,pack:({size:t})=>m(t)},zoomRange:{type:h.UNSIGNED_BYTE,count:2,pack:({scaleInfo:t},{tileInfo:e})=>Z(t,e)}}};class di extends O{constructor(){super(...arguments),this.vertexSpec=Us}_write(e,s){const i=s.getDisplayId(),r=this.evaluatedMeshParams.minPixelBuffer,o=Math.max(m(this.evaluatedMeshParams.size),r);let n,a;if(s.geometryType==="esriGeometryPoint")n=s.readXForDisplay(),a=s.readYForDisplay();else{const l=s.readCentroidForDisplay();if(!l)return;n=l?.coords[0],a=l?.coords[1]}e.recordStart(this.instanceId,this.attributeLayout),e.recordBounds(n,a,o,o);const c=e.vertexCount();this._writeVertex(e,i,n,a),e.indexWrite(c+0),e.indexWrite(c+1),e.indexWrite(c+2),e.indexWrite(c+1),e.indexWrite(c+3),e.indexWrite(c+2),e.recordEnd()}}export{di as $,W as C,li as F,ui as I,Es as J,ci as M,hi as O,pi as Q,Z as R,xs as X,Re as Y,ni as a,ai as b,Zt as c,O as d,g,Kt as k,oi as m,Jt as y}; diff --git a/custom-toc-highlight/assets/PointCloudLayer-CkxImr5P-JsLK1ZeI.js b/custom-toc-highlight/assets/PointCloudLayer-CkxImr5P-DqGHCOp3.js similarity index 82% rename from custom-toc-highlight/assets/PointCloudLayer-CkxImr5P-JsLK1ZeI.js rename to custom-toc-highlight/assets/PointCloudLayer-CkxImr5P-DqGHCOp3.js index c6559b7d..3f7df777 100644 --- a/custom-toc-highlight/assets/PointCloudLayer-CkxImr5P-JsLK1ZeI.js +++ b/custom-toc-highlight/assets/PointCloudLayer-CkxImr5P-DqGHCOp3.js @@ -1,4 +1,4 @@ -import{v as r,S as i,i as y,bB as C,bz as h,P as u,dK as B,W as _,iC as x,o as l,bX as L,f as N,a1 as F,bL as E,a0 as V,ac as O,e as A}from"./story-BfX8CRfG.js";import{m as D}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as K}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{n as k}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{a as G}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{i as M}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{E as U}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as z}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{W as X,f as P}from"./SceneService-BZqGtWmG-BWCHkX1O.js";import{X as H,$ as J,_ as Q}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{y as g}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{f as Y}from"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import{r as q,F as Z,U as ee,G as te}from"./PointCloudUniqueValueRenderer-C-5hwEaR-CLxe58O_.js";import{k as T,R as re,j as ie}from"./elevationInfoUtils-mOZsPH2J-If61I1du.js";import{w as oe}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./jsonContext-BA8GHqVk-CWQlLGSw.js";import"./resourceUtils-BmW6QqlX-B1DAUGNs.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-BROWZCZ1.js";import"./saveUtils-CIYk-dsQ-VGcOewby.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";let c=class extends A{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}}})],c.prototype,"field",void 0),r([i({readOnly:!0,nonNullable:!0,json:{read:!1}})],c.prototype,"type",void 0),c=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],c);const v=c;var w;let p=w=class extends v{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new w({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],p.prototype,"requiredClearBits",void 0),r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],p.prototype,"requiredSetBits",void 0),r([h({pointCloudBitfieldFilter:"bitfield"})],p.prototype,"type",void 0),p=w=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],p);const se=p;var b;let f=b=class extends v{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new b({field:this.field,includedReturns:u(this.includedReturns)})}};r([i({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"includedReturns",void 0),r([h({pointCloudReturnFilter:"return"})],f.prototype,"type",void 0),f=b=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],f);const ne=f;var I;let d=I=class extends v{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new I({field:this.field,mode:this.mode,values:u(this.values)})}};r([i({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"mode",void 0),r([h({pointCloudValueFilter:"value"})],d.prototype,"type",void 0),r([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"values",void 0),d=I=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],d);const ae=d,le={key:"type",base:v,typeMap:{value:ae,bitfield:se,return:ne}};var S;let m=S=class extends q{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new S({...this.cloneProperties(),field:u(this.field)})}};r([h({pointCloudRGBRenderer:"point-cloud-rgb"})],m.prototype,"type",void 0),r([i({type:String,json:{write:!0}})],m.prototype,"field",void 0),m=S=r([y("esri.renderers.PointCloudRGBRenderer")],m);const pe=m,R={key:"type",base:q,typeMap:{"point-cloud-class-breaks":Z,"point-cloud-rgb":pe,"point-cloud-stretch":ee,"point-cloud-unique-value":te},errorContext:"renderer"},j=Y();let o=class extends X(G(U(z(W(D(M(k(K)))))))){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?.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new g;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new g({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){B("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=e!=null?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(_).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=oe(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=e.fieldInfos?.find(a=>a.fieldName===t.name);if(!n)return;const s=new x({name:"pcl-returns-decoded",title:t.alias||t.name,expression:` +import{v as r,S as i,i as y,bB as C,bz as h,P as u,dK as B,W as _,iC as x,o as l,bX as L,f as N,a1 as F,bL as E,a0 as V,ac as O,e as A}from"./story-Doly9N9p.js";import{m as D}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as K}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{n as k}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{a as G}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{i as M}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{E as U}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as z}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{S as W}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{W as X,f as P}from"./SceneService-BZqGtWmG-BBytd6YJ.js";import{X as H,$ as J,_ as Q}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{y as g}from"./Field-C6hA1tZj-CkWoRbmp.js";import{f as Y}from"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import{r as q,F as Z,U as ee,G as te}from"./PointCloudUniqueValueRenderer-C-5hwEaR-CgVBPOu4.js";import{k as T,R as re,j as ie}from"./elevationInfoUtils-mOZsPH2J-BlRQDLDN.js";import{w as oe}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./jsonContext-BA8GHqVk-BsXRY5es.js";import"./resourceUtils-BmW6QqlX-D_AxNrCI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-GPPQBysx.js";import"./saveUtils-CIYk-dsQ-Br9QCJTX.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";let c=class extends A{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}}})],c.prototype,"field",void 0),r([i({readOnly:!0,nonNullable:!0,json:{read:!1}})],c.prototype,"type",void 0),c=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],c);const v=c;var w;let p=w=class extends v{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new w({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],p.prototype,"requiredClearBits",void 0),r([i({type:[C],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],p.prototype,"requiredSetBits",void 0),r([h({pointCloudBitfieldFilter:"bitfield"})],p.prototype,"type",void 0),p=w=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],p);const se=p;var b;let f=b=class extends v{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new b({field:this.field,includedReturns:u(this.includedReturns)})}};r([i({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"includedReturns",void 0),r([h({pointCloudReturnFilter:"return"})],f.prototype,"type",void 0),f=b=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],f);const ne=f;var I;let d=I=class extends v{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new I({field:this.field,mode:this.mode,values:u(this.values)})}};r([i({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"mode",void 0),r([h({pointCloudValueFilter:"value"})],d.prototype,"type",void 0),r([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],d.prototype,"values",void 0),d=I=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],d);const ae=d,le={key:"type",base:v,typeMap:{value:ae,bitfield:se,return:ne}};var S;let m=S=class extends q{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new S({...this.cloneProperties(),field:u(this.field)})}};r([h({pointCloudRGBRenderer:"point-cloud-rgb"})],m.prototype,"type",void 0),r([i({type:String,json:{write:!0}})],m.prototype,"field",void 0),m=S=r([y("esri.renderers.PointCloudRGBRenderer")],m);const pe=m,R={key:"type",base:q,typeMap:{"point-cloud-class-breaks":Z,"point-cloud-rgb":pe,"point-cloud-stretch":ee,"point-cloud-unique-value":te},errorContext:"renderer"},j=Y();let o=class extends X(G(U(z(W(D(M(k(K)))))))){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?.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new g;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new g({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){B("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=e!=null?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(_).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=oe(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=e.fieldInfos?.find(a=>a.fieldName===t.name);if(!n)return;const s=new x({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){const t=this.fieldsIndex.get("RGB");if(!t)return;const n=e.fieldInfos?.find(a=>a.fieldName===t.name);if(!n)return;const s=new x({name:"pcl-rgb-decoded",title:t.alias||t.name,expression:` diff --git a/custom-toc-highlight/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CLxe58O_.js b/custom-toc-highlight/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CgVBPOu4.js similarity index 98% rename from custom-toc-highlight/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CLxe58O_.js rename to custom-toc-highlight/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CgVBPOu4.js index 34e404a1..597b5999 100644 --- a/custom-toc-highlight/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CLxe58O_.js +++ b/custom-toc-highlight/assets/PointCloudUniqueValueRenderer-C-5hwEaR-CgVBPOu4.js @@ -1 +1 @@ -import{v as e,S as t,i,aK as I,bz as f,cr as B,ar as N,bB as O,e as m,P as o}from"./story-BfX8CRfG.js";import{w as P,h as K}from"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";var T;let c=T=class extends m{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new T({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=T=e([i("esri.renderers.support.pointCloud.ColorModulation")],c);const D=c,v=new I({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends m{};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([i("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([f({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([i("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([f({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([i("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const q=h,A={key:"type",base:R,typeMap:{"fixed-size":k,splat:q}},w=B()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends m{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:w.apiValues,readOnly:!0,nonNullable:!0,json:{type:w.jsonValues,read:!1,write:w.write}})],l.prototype,"type",void 0),e([t({types:A,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:D,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([i("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new I({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const r=l;var j;let n=j=class extends m{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:N,json:{type:[O],write:!0}})],n.prototype,"color",void 0),n=j=e([i("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const M=n;var S;let p=S=class extends r{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 S({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([f({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:P,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=S=e([i("esri.renderers.PointCloudClassBreaksRenderer")],p);const $=p;var C;let a=C=class extends r{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new C({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([f({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:P,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[K],json:{write:!0}})],a.prototype,"stops",void 0),a=C=e([i("esri.renderers.PointCloudStretchRenderer")],a);const G=a;var x;let u=x=class extends m{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:N,json:{type:[O],write:!0}})],u.prototype,"color",void 0),u=x=e([i("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const F=u;var z;let d=z=class extends r{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 z({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([f({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:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[F],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=z=e([i("esri.renderers.PointCloudUniqueValueRenderer")],d);const E=d;export{$ as F,E as G,G as U,r}; +import{v as e,S as t,i,aK as I,bz as f,cr as B,ar as N,bB as O,e as m,P as o}from"./story-Doly9N9p.js";import{w as P,h as K}from"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";var T;let c=T=class extends m{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new T({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=T=e([i("esri.renderers.support.pointCloud.ColorModulation")],c);const D=c,v=new I({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends m{};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([i("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([f({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([i("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([f({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([i("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const q=h,A={key:"type",base:R,typeMap:{"fixed-size":k,splat:q}},w=B()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends m{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:w.apiValues,readOnly:!0,nonNullable:!0,json:{type:w.jsonValues,read:!1,write:w.write}})],l.prototype,"type",void 0),e([t({types:A,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:D,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([i("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new I({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const r=l;var j;let n=j=class extends m{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:N,json:{type:[O],write:!0}})],n.prototype,"color",void 0),n=j=e([i("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const M=n;var S;let p=S=class extends r{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 S({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([f({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:P,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=S=e([i("esri.renderers.PointCloudClassBreaksRenderer")],p);const $=p;var C;let a=C=class extends r{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new C({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([f({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:P,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[K],json:{write:!0}})],a.prototype,"stops",void 0),a=C=e([i("esri.renderers.PointCloudStretchRenderer")],a);const G=a;var x;let u=x=class extends m{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:N,json:{type:[O],write:!0}})],u.prototype,"color",void 0),u=x=e([i("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const F=u;var z;let d=z=class extends r{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 z({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([f({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:r.fieldTransformTypeKebabDict.apiValues,json:{type:r.fieldTransformTypeKebabDict.jsonValues,read:r.fieldTransformTypeKebabDict.read,write:r.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[F],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=z=e([i("esri.renderers.PointCloudUniqueValueRenderer")],d);const E=d;export{$ as F,E as G,G as U,r}; diff --git a/custom-toc-highlight/assets/PointCloudWorker-DB5ewy0Y-C0Gh_TE0.js b/custom-toc-highlight/assets/PointCloudWorker-DB5ewy0Y-CRq7Firo.js similarity index 87% rename from custom-toc-highlight/assets/PointCloudWorker-DB5ewy0Y-C0Gh_TE0.js rename to custom-toc-highlight/assets/PointCloudWorker-DB5ewy0Y-CRq7Firo.js index 385b765e..23ca34f3 100644 --- a/custom-toc-highlight/assets/PointCloudWorker-DB5ewy0Y-C0Gh_TE0.js +++ b/custom-toc-highlight/assets/PointCloudWorker-DB5ewy0Y-CRq7Firo.js @@ -1 +1 @@ -import{hY as F,aq as C,J as I}from"./story-BfX8CRfG.js";import{v as x}from"./quat-BODLR7mS-BrXZAXDf.js";import{e as O}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{w as k}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{u as A,o as w}from"./vec3f32-BS0cezmI-B_madU1n.js";import{n as R}from"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import{G as U,U as J,F as B}from"./PointCloudUniqueValueRenderer-C-5hwEaR-CLxe58O_.js";import{$ as N,F as V,Y as q,G as T}from"./I3SBinaryReader-DEbI3cKZ-Bdob26G6.js";import{i as Y}from"./orientedBoundingBox-oHezdpWm-BCiifXla.js";import"./main-ugzBrWNm.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./plane-Dt8R0KeE-CVSP2GQG.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";function E(u,t,a,n){const{rendererJSON:c,isRGBRenderer:b}=u;let o=null,s=null;if(t&&b)o=t;else if(t&&c?.type==="pointCloudUniqueValueRenderer"){s=U.fromJSON(c);const r=s.colorUniqueValueInfos;o=new Uint8Array(3*n);const i=g(s.fieldTransformType);for(let e=0;e=r[f].value)o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;else for(let m=1;m=r[f].minValue&&l<=r[f].maxValue){o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;break}}}else o=new Uint8Array(3*n).fill(255);if(a&&s?.colorModulation){const r=s.colorModulation.minValue,i=s.colorModulation.maxValue,e=.3;for(let l=0;l=i?1:f<=r?e:e+(1-e)*(f-r)/(i-r);o[3*l]=m*o[3*l],o[3*l+1]=m*o[3*l+1],o[3*l+2]=m*o[3*l+2]}}return o}function G(u,t){if(u.encoding==null||u.encoding===""){const a=N(t,u);if(a.vertexAttributes.position==null)return;const n=V(t,a.vertexAttributes.position),c=a.header.fields,b=[c.offsetX,c.offsetY,c.offsetZ],o=[c.scaleX,c.scaleY,c.scaleZ],s=n.length/3,r=new Float64Array(3*s);for(let i=0;i>>4&15,p=m>1,S=f===1,y=f===m;let v=!1;for(const d of e.includedReturns)if(d==="last"&&y||d==="firstOfMany"&&S&&p||d==="lastOfMany"&&y&&p||d==="single"&&!p){v=!0;break}v||(r=!1);break}}}r&&(a[o]=s,u[3*o]=u[3*s],u[3*o+1]=u[3*s+1],u[3*o+2]=u[3*s+2],t[3*o]=t[3*s],t[3*o+1]=t[3*s+1],t[3*o+2]=t[3*s+2],o++)}return o}function g(u){switch(u){default:case null:case"none":return t=>t;case"low-four-bit":return t=>15&t;case"high-four-bit":return t=>(240&t)>>4;case"absolute-value":return t=>Math.abs(t);case"modulo-ten":return t=>t%10}}function M(u){let t=0;for(const a of u||[])t|=1<0&&t.filterAttributesData!=null){const e=t.filterAttributesData.filter(C).map(l=>{const f=h(l,a,n),m={attributeInfo:l.attributeInfo,values:f};return b.push(m),m});c=new Uint32Array(n),n=j(a,r,c,t.filterInfo,e)}for(const e of t.userAttributesData){const l=h(e,a,n);b.push({attributeInfo:e.attributeInfo,values:l})}3*n=r[f].value)o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;else for(let m=1;m=r[f].minValue&&l<=r[f].maxValue){o[3*e]=r[f].color.r,o[3*e+1]=r[f].color.g,o[3*e+2]=r[f].color.b;break}}}else o=new Uint8Array(3*n).fill(255);if(a&&s?.colorModulation){const r=s.colorModulation.minValue,i=s.colorModulation.maxValue,e=.3;for(let l=0;l=i?1:f<=r?e:e+(1-e)*(f-r)/(i-r);o[3*l]=m*o[3*l],o[3*l+1]=m*o[3*l+1],o[3*l+2]=m*o[3*l+2]}}return o}function G(u,t){if(u.encoding==null||u.encoding===""){const a=N(t,u);if(a.vertexAttributes.position==null)return;const n=V(t,a.vertexAttributes.position),c=a.header.fields,b=[c.offsetX,c.offsetY,c.offsetZ],o=[c.scaleX,c.scaleY,c.scaleZ],s=n.length/3,r=new Float64Array(3*s);for(let i=0;i>>4&15,p=m>1,S=f===1,y=f===m;let v=!1;for(const d of e.includedReturns)if(d==="last"&&y||d==="firstOfMany"&&S&&p||d==="lastOfMany"&&y&&p||d==="single"&&!p){v=!0;break}v||(r=!1);break}}}r&&(a[o]=s,u[3*o]=u[3*s],u[3*o+1]=u[3*s+1],u[3*o+2]=u[3*s+2],t[3*o]=t[3*s],t[3*o+1]=t[3*s+1],t[3*o+2]=t[3*s+2],o++)}return o}function g(u){switch(u){default:case null:case"none":return t=>t;case"low-four-bit":return t=>15&t;case"high-four-bit":return t=>(240&t)>>4;case"absolute-value":return t=>Math.abs(t);case"modulo-ten":return t=>t%10}}function M(u){let t=0;for(const a of u||[])t|=1<0&&t.filterAttributesData!=null){const e=t.filterAttributesData.filter(C).map(l=>{const f=h(l,a,n),m={attributeInfo:l.attributeInfo,values:f};return b.push(m),m});c=new Uint32Array(n),n=j(a,r,c,t.filterInfo,e)}for(const e of t.userAttributesData){const l=h(e,a,n);b.push({attributeInfo:e.attributeInfo,values:l})}3*ni.map(i=>d[i]); -import{_ as $s}from"./main-ugzBrWNm.js";import{l as Ye}from"./colorUtils-Cthpxcks-ZRnr1H1b.js";import{v as c,S as m,i as F,ad as As,aK as Q,bz as K,af as Hs,g as qs,a0 as It,ac as Lt,e as Le,P as H,i2 as Vt,o as Wt,w as ue,n as le,p as Qe}from"./story-BfX8CRfG.js";import{D as A,g as W,e as Ts,c as oe,l as Ks,n as kt,d as We,u as Ps,K as ie,i as Fs,p as Xs,s as st,j as Js,m as Ys,q as Qs,t as Zs,Y as tn,Q as Ns,L as en}from"./dataUtils-BkPy4R3C-Cb9EIxnj.js";import{W as sn,G as Rt,X as nn,e as rn,i as ce,f as Cs,g as Rs,h as on,k as Yt,Q as an,$ as ee,x as Is,T as ks,l as un,I as ln,Z as cn,P as ae,m as pn,o as hn,p as mn,r as _s}from"./RasterSymbolizer-BVys6HkM-BrCOeMHl.js";import{o as fn,F as dn}from"./rasterProjectionHelper-Calp0o_1-DktPwJyi.js";import{g as gn,v as Ss}from"./colorRamps-q0bZVhs2-DQZn2xZS.js";import{y as nt}from"./Field-C6hA1tZj-CpGOU6Y4.js";let Qt=class extends Le{constructor(){super(...arguments),this.raster=void 0}};c([m({json:{write:!0}})],Qt.prototype,"raster",void 0),Qt=c([F("esri.layers.support.rasterFunctions.BaseFunctionArguments")],Qt);const D=Qt;var pe;let _t=pe=class extends D{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new pe({raster:this.raster,raster2:this.raster2,operation:this.operation})}};c([m({json:{write:!0}})],_t.prototype,"operation",void 0),c([m({json:{write:!0}})],_t.prototype,"raster2",void 0),c([m({readOnly:!0})],_t.prototype,"rasters",null),_t=pe=c([F("esri.layers.support.rasterFunctions.ArithmeticFunctionArguments")],_t);const yn=_t,xn=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let E=class extends Le{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let s=n.rasters||n.raster&&[n.raster];for(;s?.length;){e.unshift(...s);const o=[];for(let u=0;u=0;o--)e[o].isNoopProcess&&e.splice(o,1);let r=!1;for(let o=0;o1}const i=e.some(({name:o})=>xn.has(o.toLowerCase())),{rawSourceRasterInfos:a}=this;return{functions:e,hasBranches:r,hasFocalFunction:i,isSourceSingleBand:a?.[0]?.bandCount===1}}bind(t,e=!1,n=-1){this.id=n+1;const s=this._getRasterValues();let r=!0;for(let i=0;ithis._readRasterValue(s,t));return this._processPixels({...t,pixelBlocks:n})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const r=t.map(a=>a.processInputBandIds()[0]);this.rawInputBandIds=r,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((a,o)=>a!==o);const i=t.filter(a=>a.functionName==="ExtractBand");return i.length&&i.forEach((a,o)=>{a.isInputBandIdsSwizzled=!0,a.swizzledBandSelection=[o,o,o]}),this.rawInputBandIds}const n=t[0];if(n){if(e=n.processInputBandIds(),n.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:r}=this.sourceRasterInfos[0];for(let i=0;ir!==i),this.rawInputBandIds=s,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map(s=>this._isRasterFunctionValue(s)?s.getWebGLProcessorDefinition():typeof s=="number"?{name:"Constant",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(s=>s!=null)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];this.functionName==="Clip"&&t.push(this.functionArguments);const{raster:e,rasters:n}=this.functionArguments;if(n&&Array.isArray(n)&&n.length)n.forEach(s=>{if(this._isRasterFunctionValue(s)){const r=s.getClippingGeometries();t.push(...r)}});else if(this._isRasterFunctionValue(e)){const s=e.getClippingGeometries();t.push(...s)}return t}_getOutputPixelType(t){return this.outputPixelType==="unknown"?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach(e=>{e.statistics=void 0,e.histograms=void 0})}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"?this.functionArguments.rasters??[]:t.flatMap(e=>this.functionArguments[e])}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:s}=t;if(e.length===0)return n;const r=e.map(a=>a&&typeof a=="object"&&"bind"in a&&a.rasterInfo?a.rasterInfo:typeof a=="string"&&s.includes(a)?n[s.indexOf(a)]:typeof a!="number"?n[0]:void 0),i=r.find(a=>a)??n[0];return r.forEach((a,o)=>{a===void 0&&(r[o]=i)}),r}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,e=[],n=[]){for(let s=0;se?s.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),n.BAND_COUNT&&Number(n.BAND_COUNT)!==e&&(t.keyProperties={...n,BAND_COUNT:typeof n.BAND_COUNT=="string"?String(e):e})}};c([m({json:{write:!0}})],E.prototype,"functionName",void 0),c([m({json:{write:!0}})],E.prototype,"functionArguments",void 0),c([m()],E.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}}),As(t=>t?.toLowerCase())],E.prototype,"outputPixelType",void 0),c([m({json:{write:!0}})],E.prototype,"mainPrimaryRasterId",void 0),c([m()],E.prototype,"sourceRasters",void 0),c([m({type:[sn],json:{write:!0}})],E.prototype,"sourceRasterInfos",void 0),c([m({json:{write:!0}})],E.prototype,"rasterInfo",void 0),c([m({json:{write:!0}})],E.prototype,"readingBufferSize",void 0),c([m({json:{write:!0}})],E.prototype,"id",void 0),c([m()],E.prototype,"isNoopProcess",void 0),c([m()],E.prototype,"supportsGPU",null),c([m()],E.prototype,"rawInputBandIds",void 0),c([m()],E.prototype,"rawSourceRasterInfos",void 0),c([m()],E.prototype,"isInputBandIdsSwizzled",void 0),c([m()],E.prototype,"swizzledBandSelection",void 0),c([m()],E.prototype,"isBranch",void 0),c([m({readOnly:!0})],E.prototype,"flatWebGLFunctionChain",null),c([m()],E.prototype,"_bindingResult",void 0),E=c([F("esri.layers.support.rasterFunctions.BaseRasterFunction")],E);const z=E,S={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},wn={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},$={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},J={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},vn={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},Bs={setNull:50,conditional:78},Ze={...wn,...$,...J,...vn,...Bs},js=new Map([[J.acos,{domain:[0,Math.PI],isInteger:!1}],[J.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.cos,{domain:[-1,1],isInteger:!1}],[J.sin,{domain:[-1,1],isInteger:!1}],[$.booleanAnd,{domain:[0,1],isInteger:!0}],[$.booleanNot,{domain:[0,1],isInteger:!0}],[$.booleanOr,{domain:[0,1],isInteger:!0}],[$.booleanXOr,{domain:[0,1],isInteger:!0}],[$.equalTo,{domain:[0,1],isInteger:!0}],[$.notEqual,{domain:[0,1],isInteger:!0}],[$.greaterThan,{domain:[0,1],isInteger:!0}],[$.greaterThanEqual,{domain:[0,1],isInteger:!0}],[$.lessThan,{domain:[0,1],isInteger:!0}],[$.lessThanEqual,{domain:[0,1],isInteger:!0}],[$.isNull,{domain:[0,1],isInteger:!0}]]);function ts(t){return js.get(t)}const es=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function bn(t,e=!1){const n=t.map(o=>o.mask),s=n.filter(o=>o!=null),r=t[0].pixels[0].length;if(s.length===0||e&&s.length!==n.length)return new Uint8Array(r).fill(255);const i=s[0],a=new Uint8Array(i);if(s.length===1)return a;if(!e){for(let o=1;o=1?e[u]=0:a[u]=Math.atanh(l)}return a}const o=s===J.asin?Math.asin:Math.acos;for(let u=0;u1?e[u]=0:a[u]=o(l)}return a}function _n(t,e,n,s){const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;o>r[o]);return a}function On(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;or[o]?1:0);return a}function Yn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;o=r[o]?1:0);return a}function Qn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;oh&&(u=h)}a[o]=u}return a}function os(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;op&&(u=p)}a[o]=l-u}return a}function is(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;ol?(l=u,h.length=0,h.push(p)):u===l&&h.push(p);h.length>1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function ps(t,e,n){const s=t.length;if(s<=2)return Gs(t,e,n);const r=t[0].length,i=A.createEmptyBand(n,r),a=new Map;for(let o=0;o1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function hs(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i),o=new Set;for(let u=0;u=66&&e<=75);const{outputPixelType:r="f32"}=n,i=!G.has(e)||n.processAsMultiband,a=i?t[0].pixels.length:1,o=[];for(let l=0;lg.pixels):t.map(g=>g.pixels[l]);let p,f=!0;if(e===Bs.setNull){const g=rr(h,s,r);p=g.band,s=g.mask,f=!1}else R.has(e)?p=R.get(e)(h,s,"f64"):U.has(e)?p=e===J.asin||e===J.acos||e===J.atanh?kn(h,s,"f64",e):_n(h,s,"f64",U.get(e)):se.has(e)?p=Sn(h,s,"f64",se.get(e)):G.has(e)?p=G.get(e)(h,s,"f64"):(p=h[0],f=!1);if(f&&e!==$.isNull&&!js.has(e)){const g=A.createEmptyBand(r,p.length);s||(s=new Uint8Array(p.length).fill(255)),tn(p,s),Ns(p,s,r,g),p=g}o.push(p)}const u=t[0];return new A({width:u.width,height:u.height,pixelType:r,mask:e===$.isNull?null:s,pixels:o})}function ir(t,e,n){return zs(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}let St=class extends z{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?.[0]==null||e?.[1]==null?null:ir(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],n=this.outputPixelType??"f32";let[s,r]=kt(n);const i=W(n);return i&&(s-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[s,r],isOutputRounded:i}}};c([m({json:{write:!0,name:"rasterFunction"}})],St.prototype,"functionName",void 0),c([m({type:yn,json:{write:!0,name:"rasterFunctionArguments"}})],St.prototype,"functionArguments",void 0),c([m()],St.prototype,"rasterArgumentNames",void 0),St=c([F("esri.layers.support.rasterFunctions.ArithmeticFunction")],St);const ar=St;var he;let me=he=class extends D{clone(){return new he({raster:this.raster})}};me=he=c([F("esri.layers.support.rasterFunctions.AspectFunctionArguments")],me);const ur=me;let lt=class extends z{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??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1});return nn(e,{resolution:i})}};c([m({json:{write:!0,name:"rasterFunction"}})],lt.prototype,"functionName",void 0),c([m({type:ur,json:{write:!0,name:"rasterFunctionArguments"}})],lt.prototype,"functionArguments",void 0),c([m()],lt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],lt.prototype,"isGCS",void 0),lt=c([F("esri.layers.support.rasterFunctions.AspectFunction")],lt);const lr=lt,cr=new Set(["+","-","*","/","(",")"]);function pr(t,e){(t=t.replaceAll(" ","")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1));const n=t.split(""),s=[],r=[];let i="";for(let a=0;a-1)n>0&&(r+=e+1);else{for(let a=0;a0&&(r+=e+1)}let i=0;for(let a=0;a0;){const{numIndex:a,opIndex:o}=fr(r);if(s=hr(t,r[o],i[a],i[a+1]),r.length===1)break;r=mr(r,o),i.splice(a,2,s)}return[s]}const gr=new Q({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 yr(t,e){if(!en(t))return t;const{equation:n,method:s}=e,r=e.bandIndexes.map(f=>f-1),{pixels:i,mask:a}=t;let o;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":o=fs(a,i[r[0]],i[r[1]]);break;case"ndwi":o=fs(a,i[r[1]],i[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":o=wr(a,i[r[0]],i[r[1]]);break;case"ci-g":case"ci-re":o=vr(a,i[r[0]],i[r[1]]);break;case"savi":o=br(a,i[r[0]],i[r[1]],r[2]+1);break;case"tsavi":o=Ar(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":o=Tr(a,i[r[0]],i[r[1]]);break;case"gemi":o=Pr(a,i[r[0]],i[r[1]]);break;case"pvi":o=Fr(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1);break;case"gvitm":o=Nr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]],i[r[5]]]);break;case"sultan":o=Cr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]]]);break;case"vari":o=Rr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"mtvi2":o=Ir(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"rtvi-core":o=kr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"evi":o=_r(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"wndwi":o=Sr(a,[i[r[0]],i[r[1]],i[r[2]]],r[3]?r[3]+1:.5);break;case"bai":o=Br(a,i[r[0]],i[r[1]]);break;case"custom":o=dr(a,i,n);break;default:return t}const{outputPixelType:u="f32"}=e,l=u!=null&&W(u);let h;a?(h=new Uint8Array(t.width*t.height),h.set(a)):l&&(h=new Uint8Array(t.width*t.height).fill(255)),l&&(o=o.map(f=>{const g=A.createEmptyBand(u,f.length);return Ns(f,h,u,g),g}));const p=new A({width:t.width,height:t.height,pixelType:u,pixels:o,mask:h});return p.updateStatistics(),p}function xr(t,e,n,s){const{mask:r,pixels:i,width:a,height:o}=t,u=i[n],l=i[e],h=l.length,p=s?new Uint8Array(h):new Float32Array(h),f=s?100:1,g=s?100.5:0;for(let x=0;xparseFloat(i));return yr(e,{method:n,bandIndexes:r,equation:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1);t.length===2&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,s;const r=new Float32Array(3),{method:i}=this.functionArguments;switch(i){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=V([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=V([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=V([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=V([e[0],e[1],0]),s="ci";break;case"savi":n=V([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=V([e[0],e[1],0]),s="msavi";break;case"gemi":n=V([e[0],e[1],0]),s="gemi";break;case"pvi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=V([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=V([e[0],e[1],e[2]]),s="mtvi";break;case"rtvi-core":n=V([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=V([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=V([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=V([e[1],e[0],0]),s="bai";break;default:n=V([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r,isOutputRounded:W(this.outputPixelType)}}_getInputBandIds(t){if(this.functionArguments.method==="custom")return t;const e=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1),n=t.length,s=e.map(a=>a>=n?n-1:a),r=Mr.has(this.functionArguments.method)?3:2,i=s.slice(0,r).map(a=>t[a]);return i.length===2&&i.push(0),i}};c([m({json:{write:!0,name:"rasterFunction"}})],Bt.prototype,"functionName",void 0),c([m({type:jr,json:{write:!0,name:"rasterFunctionArguments"}})],Bt.prototype,"functionArguments",void 0),c([m()],Bt.prototype,"rasterArgumentNames",void 0),Bt=c([F("esri.layers.support.rasterFunctions.BandArithmeticFunction")],Bt);const Gr=Bt;var de;const ds=new Q({1:"outside",2:"inside"},{useNumericKeys:!0});let Ht=de=class extends D{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new de({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};c([m({types:Hs,json:{read:qs,write:!0}})],Ht.prototype,"clippingGeometry",void 0),c([m({json:{read:ds.read,write:ds.write}})],Ht.prototype,"clippingType",void 0),Ht=de=c([F("esri.layers.support.rasterFunctions.ClipFunctionArguments")],Ht);const zr=Ht;function Or(t,e){if(t.spatialReference.equals(e))return t;const n=Qe(t.spatialReference),s=Qe(e);if(n===s)return t;const r=n/s;return{x:t.x*r,y:t.y*r}}async function Ni(t,e,n){if(n.type==="extent")return Er(t,e,n);const{width:s,height:r}=t,i=new Uint8Array(s*r),{contains:a,intersects:o}=await $s(async()=>{const{contains:u,intersects:l}=await import("./geometryEngine-CdPoFSE4-zj0NdzY3.js");return{contains:u,intersects:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return o(e,n)?n.type==="polyline"?Ur(t,e,n):a(n,e)?t:Dr(t,e,n):new A({pixelType:t.pixelType,width:s,height:r,mask:i,maskIsAlpha:!1,pixels:[...t.pixels]})}function Dr(t,e,n){if(!t)return t;const{width:s,height:r}=t,i=e.width/s,a=e.height/r,{xmin:o,ymax:u}=e;let l;if(n.type==="extent"){const d=(n.xmin-o)/i,v=(n.xmax-o)/i,w=(u-n.ymax)/a,b=(u-n.ymin)/a;l=[[[d,w],[d,b],[v,b],[v,w],[d,w]]]}else l=n.rings.map(d=>d.map(([v,w])=>[(v-o)/i,(u-w)/a]));const h=document.createElement("canvas");h.width=s,h.height=r;const p=h.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach(d=>{p.moveTo(d[0][0],d[0][1]);for(let v=0;v127?255:0);return new A({pixelType:t.pixelType,width:s,height:r,mask:x,maskIsAlpha:!1,pixels:[...t.pixels]})}function Er(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r;if(n.width/a<.5||n.height/o<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});const{xmin:u,xmax:l,ymin:h,ymax:p}=e,{xmin:f,xmax:g,ymin:y,ymax:x}=n,d=Math.max(u,f),v=Math.min(l,g),w=Math.max(h,y),b=Math.min(p,x),T=.5*a,N=.5*o;if(v-dl-T||w>p-N||b.5&&C%1<.5||O===Z&&_%1>.5&&I%1<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});if(k===0&&O===0&&B===s&&Z===r)return t;const Xe=t.mask;for(let ne=O;ne<=Z;ne++)for(let re=k;re<=B;re++){const Je=ne*s+re;i[Je]=Xe?Xe[Je]:255}return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]})}function Ur(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r,{xmin:u,ymax:l}=e,{paths:h}=n,p=t.mask;for(let f=0;fx?i*Math.round((p-x)/i):0),g=d-(gx?i*Math.round((f-x)/i):0),y=d-(yx?i*Math.floor((p-x)/i+.1):0),g=d-(gs.toLowerCase()===t.toLowerCase());return n?Rt.fromJSON(n):null}clone(){return new ge({colormap:H(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};c([m({type:[[Number]],json:{write:!0}})],Y.prototype,"colormap",void 0),c([m({type:String,json:{write:!0}})],Y.prototype,"colormapName",void 0),c([As("colormapName")],Y.prototype,"castColormapName",null),c([m({types:gn,json:{write:!0}})],Y.prototype,"colorRamp",void 0),c([It("colorRamp")],Y.prototype,"readColorRamp",null),c([m({type:Rt.apiValues,json:{type:Rt.jsonValues,write:Rt.write}})],Y.prototype,"colorRampName",void 0),c([It("colorRampName")],Y.prototype,"readColorRampName",null),Y=ge=c([F("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],Y);const $r=Y,Hr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],qr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function qe(t,e){const n=[],s=[];for(let i=0;i[s,...n]),e):null}let tt=class extends z{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:s,colorRampName:r}=this.functionArguments;if(!e?.length)if(s)this.colorRamp=s,e=ce(s,{interpolateAlpha:!0});else if(r){const o=Cs(r);o&&(e=ce(o),this.colorRamp=Ss(o))}else n&&(e=Zr(n));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const i=this._getOutputPixelType(t.pixelType);this.outputPixelType=i.startsWith("f")?"s32":i;const a=t.clone();return a.pixelType=this.outputPixelType,a.colormap=e,a.bandCount=1,this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){let e=t.pixelBlocks?.[0];return!e||W(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};c([m({json:{write:!0,name:"rasterFunction"}})],tt.prototype,"functionName",void 0),c([m({type:$r,json:{write:!0,name:"rasterFunctionArguments"}})],tt.prototype,"functionArguments",void 0),c([m()],tt.prototype,"rasterArgumentNames",void 0),c([m()],tt.prototype,"isNoopProcess",void 0),c([m({json:{write:!0}})],tt.prototype,"indexedColormap",void 0),c([m()],tt.prototype,"colorRamp",void 0),tt=c([F("esri.layers.support.rasterFunctions.ColormapFunction")],tt);const to=tt;var ye;let xe=ye=class extends D{clone(){return new ye({raster:this.raster})}};xe=ye=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunctionArguments")],xe);const eo=xe;let pt=class extends z{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||!t.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};const e=t.clone();e.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(e),e.bandCount=3,e.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=e;const n=[...t.colormap].sort((i,a)=>i[0]-a[0]),{indexedColormap:s,offset:r}=Ts({colormap:n});return s?(this.lookup={indexedColormap:s,offset:r},{success:!0,supportsGPU:Rs(s)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let e=t.pixelBlocks?.[0];if(!e||!this.lookup)return e;e=e.clone();const n=e.pixels[0],s=e.mask??new Uint8Array(n.length).fill(255),r=new Uint8Array(n.length),i=new Uint8Array(n.length),a=new Uint8Array(n.length),{indexedColormap:o,offset:u}=this.lookup,l=o.length;for(let h=0;hl-4?s[h]=0:(r[h]=o[p++],i[h]=o[p++],a[h]=o[p++])}return e.pixels=[r,i,a],e.statistics=[new oe(0,255),new oe(0,255),new oe(0,255)],e.pixelType=this.outputPixelType,e}_getWebGLParameters(){return this.lookup}};c([m({json:{write:!0,name:"rasterFunction"}})],pt.prototype,"functionName",void 0),c([m({type:eo,json:{write:!0,name:"rasterFunctionArguments"}})],pt.prototype,"functionArguments",void 0),c([m()],pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],pt.prototype,"lookup",void 0),pt=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunction")],pt);const so=pt;var we;let qt=we=class extends D{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new we({rasters:H(this.rasters)})}};c([m({json:{write:!0}})],qt.prototype,"rasters",void 0),c([Lt("rasters")],qt.prototype,"writeRasters",null),qt=we=c([F("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],qt);const no=qt;let jt=class extends z{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map(({bandCount:r})=>r).reduce((r,i)=>r+i),t.every(({statistics:r})=>r!=null&&r.length)){const r=[];t.forEach(({statistics:i})=>i!=null&&r.push(...i)),n.statistics=r}if(t.every(({histograms:r})=>r!=null&&r.length)){const r=[];t.forEach(({histograms:i})=>i!=null&&r.push(...i)),n.histograms=r}n.multidimensionalInfo&&n.multidimensionalInfo.variables.forEach(r=>{const i=t.map(u=>u.multidimensionalInfo?.variables.find(({name:l})=>l===r.name)),a=i.map(u=>u?.statistics?.length?u.statistics:null),o=i.map(u=>u?.histograms?.length?u.histograms:null);r.statistics=a.every(u=>u!=null)?a.flat():null,r.histograms=o.every(u=>u!=null)?o.flat():null}),n.bandCount>1&&(n.colormap=null,n.attributeTable=null);const s=t.every(r=>r.keyProperties.BandProperties?.length)?t.flatMap(r=>r.keyProperties.BandProperties):void 0;return n.keyProperties={...n.keyProperties,BandProperties:s},this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?e?.[0]==null?null:Ks(e):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};c([m({json:{write:!0,name:"rasterFunction"}})],jt.prototype,"functionName",void 0),c([m({type:no,json:{write:!0,name:"rasterFunctionArguments"}})],jt.prototype,"functionArguments",void 0),c([m()],jt.prototype,"rasterArgumentNames",void 0),jt=c([F("esri.layers.support.rasterFunctions.CompositeBandFunction")],jt);const ro=jt,oo=new Q({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),io=new Q({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});function ao(t,e,n,s){const[r,i]=t,a=W(n)&&!W(r.pixelType)&&!W(i.pixelType),o=[r.mask,i.mask].filter(y=>y),u=A.combineBandMasks(o),l=t.map(y=>y.pixels[0]),{width:h,height:p}=r,f=A.createEmptyBand(n,h*p);switch(e){case"difference":case"relative-difference":uo({bands:l,mask:u,outBand:f,isRoundingNeeded:a,isRelative:e==="relative-difference"});break;case"categorical":lo({bands:l,mask:u,outBand:f,...s});break;case"euclidean-distance":co({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"angle-difference":po({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"band-with-most-change":ho({pixels:t.map(y=>y.pixels),mask:u,outBand:f})}const g=new A({width:h,height:p,pixels:[f],pixelType:n,mask:u});return g.updateStatistics(),g}function uo(t){const{bands:[e,n],mask:s,isRelative:r,isRoundingNeeded:i,outBand:a}=t,o=e.length;for(let u=0;u0?l/h:0}a[u]=i?Math.round(l):l}}function lo(t){const{bands:[e,n],categoryIndexLookups:[s,r],classNames:[i,a],mask:o,keepMethod:u,outBand:l}=t,h=e.length,p=i.length,f=a.length,g=p*f,y=g+1,x=g+2;for(let d=0;du&&(u=p,l=h)}r[o]=l}}var ve;let ht=ve=class extends D{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new ve({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};c([K(oo)],ht.prototype,"method",void 0),c([K(io)],ht.prototype,"keepMethod",void 0),c([m({json:{write:!0}})],ht.prototype,"raster2",void 0),c([m({readOnly:!0})],ht.prototype,"rasters",null),ht=ve=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunctionArguments")],ht);const mo=ht;let mt=class extends z{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{method:t}=this.functionArguments,e=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),t==="categorical"){const n=this.sourceRasterInfos.map(i=>i.attributeTable),s=this._getFieldNames(n,"value"),r=n.map(i=>this._getClassFieldName(i));if(s[0]==null||s[1]==null||r[0]==null||r[1]==null)return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(e,s,r)}return e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:t==="difference"||t==="relative-difference"}}_processPixels(t){const{pixelBlocks:e}=t;if(e?.[0]==null||e?.[1]==null)return null;const{method:n}=this.functionArguments;return ao(e,n,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){const t=this.outputPixelType??"f32";let[e,n]=kt(t);const s=W(t);return s&&(e-=1e-4,n+=1e-4),{method:this.functionArguments.method,domainRange:[e,n],isOutputRounded:s}}_updateAttributeTable(t,e,n){const s=this.sourceRasterInfos.map(b=>b.attributeTable),r=s.map((b,T)=>b.features.map(N=>N.attributes[e[T]])),i=s.map((b,T)=>b.features.map(N=>N.attributes[n[T]])),a=r.map(b=>{const T=[];return b.forEach((N,P)=>T[N]=P),T}),{keepMethod:o}=this.functionArguments;this._categoryConfig={categoryIndexLookups:a,classNames:i,keepMethod:o};const u=s[0].clone();u.fields=[new nt({name:"OID",type:"oid"}),new nt({name:"Value",type:"integer"}),new nt({name:"ClassName",type:"string"}),new nt({name:"Class_From",type:"string"}),new nt({name:"Class_To",type:"string"})];const l=this._getFieldNames(s,"red"),h=this._getFieldNames(s,"green"),p=this._getFieldNames(s,"blue"),f=[],g=l.length===2&&h.length===2&&p.length===2;g&&(f.push(...s.map((b,T)=>b.features.map(N=>[N.attributes[l[T]],N.attributes[h[T]],N.attributes[p[T]]]))),u.fields.push(new nt({name:"Red",type:"integer"}),new nt({name:"Green",type:"integer"}),new nt({name:"Blue",type:"integer"})));const y=u.features[0].clone();y.geometry=null;const x=[],[d,v]=r.map(b=>b.length);let w=1;for(let b=0;b ${P}`,Class_From:T,Class_To:P},g&&(C.attributes.Red=f[0][b][0]+f[1][N][0]>>1,C.attributes.Green=f[0][b][1]+f[1][N][1]>>1,C.attributes.Blue=f[0][b][2]+f[1][N][2]>>1),x.push(C)}}if(o==="changed"){const b=y.clone();b.attributes={OID:w++,Value:d*v+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},x.push(b)}else if(o==="unchanged"){const b=y.clone();b.attributes={OID:w++,Value:d*v+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},x.push(b)}u.features=x,t.attributeTable=u}_getFieldNames(t,e){return t.map(({fields:n})=>n.find(s=>s.name.toLowerCase()===e)?.name).filter(n=>n)}_getClassFieldName(t){return(t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().startsWith("class"))??t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().includes("class")||e.name.toLowerCase().includes("type")||e.name.toLowerCase().includes("name"))??t.fields.find(e=>e.type==="string"))?.name}};c([m({json:{write:!0,name:"rasterFunction"}})],mt.prototype,"functionName",void 0),c([m({type:mo,json:{write:!0,name:"rasterFunctionArguments"}})],mt.prototype,"functionArguments",void 0),c([m()],mt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],mt.prototype,"_categoryConfig",void 0),mt=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunction")],mt);const fo=mt;var be;let Kt=be=class extends D{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new be({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};c([m({json:{write:!0}})],Kt.prototype,"contrastOffset",void 0),c([m({json:{write:!0}})],Kt.prototype,"brightnessOffset",void 0),Kt=be=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Kt);const go=Kt;let ft=class extends z{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if(e.pixelType!=="u8")return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const n=e.clone();this._removeStatsHistColormapVAT(n),this.rasterInfo=n;const{contrastOffset:s,brightnessOffset:r}=this.functionArguments;return this.lookup=on(s,r),{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:We(e,{lut:e.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};c([m({json:{write:!0,name:"rasterFunction"}})],ft.prototype,"functionName",void 0),c([m({type:go,json:{write:!0,name:"rasterFunctionArguments"}})],ft.prototype,"functionArguments",void 0),c([m()],ft.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ft.prototype,"lookup",void 0),ft=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],ft);const yo=ft;function Ke(t,e,n,s,r){const i=Math.floor(s/2);for(let o=0;os+r);return e===-1||n===0||n===1?t:t.map(s=>s/n)}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:n,kernel:s}=this.functionArguments;if(!Object.values(S).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==S.none&&e*n!==s.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const i=r.clone();i.pixelType=this.outputPixelType;const a=[S.none,S.sharpen,S.sharpen2,S.sharpening3x3,S.sharpening5x5];return(t===-1||this.outputPixelType!=="u8"&&!a.includes(t))&&(i.statistics=null,i.histograms=null),i.colormap=null,i.attributeTable=null,this.rasterInfo=i,{success:!0,supportsGPU:s.length<=ys}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null||this.functionArguments.convolutionType===S.none)return e;const{rows:n,cols:s}=this.functionArguments,{_normalizedKernel:r}=this;return Ao(e,{kernel:r,rows:n,cols:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(ys);return t.set(this._normalizedKernel),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:t,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],gt.prototype,"functionName",void 0),c([m({type:To,json:{write:!0,name:"rasterFunctionArguments"}})],gt.prototype,"functionArguments",void 0),c([m()],gt.prototype,"rasterArgumentNames",void 0),c([m()],gt.prototype,"_normalizedKernel",null),gt=c([F("esri.layers.support.rasterFunctions.ConvolutionFunction")],gt);const Po=gt;var Te;const Os=new Q({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let Mt=Te=class extends D{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return Os.fromJSON(e.type??e.curvatureType??0)}clone(){return new Te({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};c([m({json:{write:{target:"type"}}}),K(Os)],Mt.prototype,"curvatureType",void 0),c([It("curvatureType",["type","curvatureType"])],Mt.prototype,"readCurvatureType",null),c([m({type:Number,json:{write:!0}})],Mt.prototype,"zFactor",void 0),Mt=Te=c([F("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],Mt);const Fo=Mt;let yt=class extends z{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,curvatureType:s}=this.functionArguments,{extent:r,primaryPixelSizes:i}=t,a=i?.[0],o=a??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),u=this.isGCS&&n>=1?n*Yt:n;return an(e,{zFactor:u,curvatureType:s,resolution:o})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Yt:t}}};c([m({json:{write:!0,name:"rasterFunction"}})],yt.prototype,"functionName",void 0),c([m({type:Fo,json:{write:!0,name:"rasterFunctionArguments"}})],yt.prototype,"functionArguments",void 0),c([m()],yt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],yt.prototype,"isGCS",void 0),yt=c([F("esri.layers.support.rasterFunctions.CurvatureFunction")],yt);const No=yt;var Pe;let et=Pe=class extends D{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=Ps.bestMatch}clone(){return new Pe({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};c([m({json:{write:!0}})],et.prototype,"bandIds",void 0),c([m({json:{write:!0}})],et.prototype,"bandNames",void 0),c([m({json:{write:!0}})],et.prototype,"bandWavelengths",void 0),c([K({0:"name",1:"wavelength",2:"id"})],et.prototype,"method",void 0),c([m({json:{write:!0}})],et.prototype,"missingBandAction",void 0),c([m({json:{write:!0}})],et.prototype,"wavelengthMatchTolerance",void 0),et=Pe=c([F("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],et);const Co=et;let Gt=class extends z{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:e}=this,n=e[0],{method:s,bandNames:r,bandWavelengths:i,bandIds:a,missingBandAction:o}=t,u=r?.length&&(s==="name"||s!=="id"&&!a?.length),l=i?.length&&(s==="wavelength"||s!=="id"&&!a?.length),h=o===Ps.fail,p=u?Io(n,r):l?_o(n,i,this.functionArguments,h):ko(n,a,h);if(p==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":l?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const f=n.clone();f.pixelType=this.outputPixelType,f.bandCount=p.length;const{statistics:g,histograms:y}=f;g!=null&&g.length&&(f.statistics=p.map(d=>g[d]||g[g.length-1])),y!=null&&y.length&&(f.histograms=p.map(d=>y[d]||y[y.length-1])),f.multidimensionalInfo&&f.multidimensionalInfo.variables.forEach(d=>{const{statistics:v,histograms:w}=d;v!=null&&v.length&&(d.statistics=p.map(b=>v[b]||v[v.length-1])),w!=null&&w.length&&(d.histograms=p.map(b=>w[b]||w[w.length-1]))});let x=f.keyProperties?.BandProperties;return x?.length&&(x=p.map(d=>d>=x.length?x[x.length-1]:x[d]),f.keyProperties={...f.keyProperties,BandProperties:x}),this.rasterInfo=f,{success:!0,supportsGPU:f.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const n=e.pixels.length,s=this.functionArguments.bandIds.map(r=>r>=n?n-1:r);return e.extractBands(s)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],t.length===0?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:V(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(n=>n>=e?e-1:n).map(n=>t[n])}};c([m({json:{write:!0,name:"rasterFunction"}})],Gt.prototype,"functionName",void 0),c([m({type:Co,json:{write:!0,name:"rasterFunctionArguments"}})],Gt.prototype,"functionArguments",void 0),c([m()],Gt.prototype,"rasterArgumentNames",void 0),Gt=c([F("esri.layers.support.rasterFunctions.ExtractBandFunction")],Gt);const Ro=Gt;function Io(t,e){const n=t.bandInfos.map(({name:r})=>r.toLowerCase()),s=[];for(let r=0;ro.startsWith("nearinfrared_1")),a===-1&&(a=n.findIndex(o=>o.startsWith("nearinfrared")))),a===-1)return null;s.push(a)}return s}function ko(t,e,n){const{bandCount:s}=t;return!e?.length||n&&e.some(r=>r<0||r>=s)?null:e}function _o(t,e,{wavelengthMatchTolerance:n},s){const{bandInfos:r}=t,i=[];for(let o=0;o=g.minWavelength&&u<=g.maxWavelength,x=Math.abs(u-(g.minWavelength+g.maxWavelength)/2);y?xy?y:Tn+s);return t.map(n=>n/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const n=t.length===3||e.bandCount===3&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:n}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:So(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};c([m({json:{write:!0,name:"rasterFunction"}})],xt.prototype,"functionName",void 0),c([m({type:Bo,json:{write:!0,name:"rasterFunctionArguments"}})],xt.prototype,"functionArguments",void 0),c([m()],xt.prototype,"rasterArgumentNames",void 0),c([m()],xt.prototype,"_normalizedWeights",null),xt=c([F("esri.layers.support.rasterFunctions.GrayscaleFunction")],xt);const jo=xt;var Ne;const Mo=new Q({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Go=new Q({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let X=Ne=class extends D{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}clone(){return new Ne({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([m({type:Number,json:{write:!0}})],X.prototype,"altitude",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"azimuth",void 0),c([m(),K(Mo)],X.prototype,"hillshadeType",void 0),c([m({type:Number,json:{write:!0,name:"psPower"}})],X.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{write:!0,name:"psZFactor"}})],X.prototype,"pixelSizeFactor",void 0),c([m(),K(Go)],X.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"zFactor",void 0),c([m({type:Boolean,json:{write:!0}})],X.prototype,"removeEdgeEffect",void 0),X=Ne=c([F("esri.layers.support.rasterFunctions.HillshadeFunctionArguments")],X);const Ds=X;let wt=class extends z{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone();return this._removeStatsHistColormapVAT(e),e.pixelType=this.outputPixelType,e.bandCount=1,e.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1}),a=ee(this.functionArguments,i,this.isGCS),o=Is(e,a);return o.pixelType=this.outputPixelType,o}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",o=W(this.outputPixelType);return{...e,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,isOutputRounded:o}}};c([m({json:{write:!0,name:"rasterFunction"}})],wt.prototype,"functionName",void 0),c([m({type:Ds,json:{write:!0,name:"rasterFunctionArguments"}})],wt.prototype,"functionArguments",void 0),c([m()],wt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],wt.prototype,"isGCS",void 0),wt=c([F("esri.layers.support.rasterFunctions.HillshadeFunction")],wt);const zo=wt;var Ce;let vt=Ce=class extends D{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new Ce({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:H(this.rasters)})}};c([m({json:{write:!0}})],vt.prototype,"operation",void 0),c([m({json:{write:!0}})],vt.prototype,"rasters",void 0),c([Lt("rasters")],vt.prototype,"writeRasters",null),c([m({json:{write:!0}})],vt.prototype,"processAsMultiband",void 0),vt=Ce=c([F("esri.layers.support.rasterFunctions.LocalFunctionArguments")],vt);const Oo=vt;let zt=class extends z{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:s}=this.functionArguments;if(t.some(u=>u.bandCount!==n))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:i}=this.functionArguments,a=es[r];if(!(a===999||i.length===a||i.length<=1&&a===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${a}`};const o=e.clone();return o.bandCount=a!==999||s?n:1,this._removeStatsHistColormapVAT(o),this._updateStatistics(o),this._updatePixelType(o),this.rasterInfo=o,{success:!0,supportsGPU:o.bandCount===1&&a<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e==null||e.some(n=>n==null)?null:zs(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=es[t],n=Object.keys(Ze).find(o=>Ze[o]===t)?.toLowerCase()??"undefined",s=this.outputPixelType??"f32";let[r,i]=kt(s);const a=W(s);return a&&(r-=1e-4,i+=1e-4),{imageCount:e,operationName:n,domainRange:[r,i],isOutputRounded:a}}_updateStatistics(t){const e=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,s=ts(n)?.domain;if(s){t.statistics=[];for(let r=0;r({min:-r.max,max:-r.min,avg:r.avg!=null?-r.avg:void 0,stddev:r.stddev!=null?-r.stddev:void 0})))}_updatePixelType(t){const{statistics:e,pixelType:n}=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,{domain:r,isInteger:i}=ts(s)??{domain:null,isInteger:!1};let a="f32";if(r&&i)a=ie(r[0],r[1]);else if(s===30){const o=e?.[0];a=o?ie(o.min,o.max):W(n)?n:"s32"}else if(s===45&&W(n)){const o=e?.map(({max:p})=>-p),u=e?.map(({min:p})=>-p),l=o?.length?Math.min(...o):null,h=u?.length?Math.min(...u):null;a=l!=null&&h!=null?ie(l,h):n.startsWith("s")?n.replace("s","u"):n==="u1"||n==="u2"||n==="u4"?"s8":n==="u8"?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(a)}};c([m({json:{write:!0,name:"rasterFunction"}})],zt.prototype,"functionName",void 0),c([m({type:Oo,json:{write:!0,name:"rasterFunctionArguments"}})],zt.prototype,"functionArguments",void 0),c([m()],zt.prototype,"rasterArgumentNames",void 0),zt=c([F("esri.layers.support.rasterFunctions.LocalFunction")],zt);const Do=zt;var Re;let bt=Re=class extends D{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=Fs.matchAny}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map(s=>{if(typeof s=="number")return e=!0,[s];if(typeof s=="string"){const r=s.trim().split(" ").filter(i=>i.trim()!=="").map(i=>Number(i));return e=e||r.length>0,r.length===0?null:r}return null});return e?n:null}clone(){return new Re({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};c([m({json:{write:!0}})],bt.prototype,"includedRanges",void 0),c([m({json:{write:!0}})],bt.prototype,"noDataValues",void 0),c([m()],bt.prototype,"normalizedNoDataValues",null),c([m({json:{write:!0}})],bt.prototype,"noDataInterpretation",void 0),bt=Re=c([F("esri.layers.support.rasterFunctions.MaskFunctionArguments")],bt);const Eo=bt;let At=class extends z{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,normalizedNoDataValues:s}=this.functionArguments;if(!n?.length&&!s?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let a=0;aa?.length===s[0]?.length);return{success:!0,supportsGPU:(!n||n.length<=2*st)&&(!s||i&&s[0].length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{outputPixelType:n,lookups:s}=this,{includedRanges:r,noDataInterpretation:i,normalizedNoDataValues:a}=this.functionArguments,o=i===Fs.matchAll;return Js(e,{includedRanges:r,noDataValues:a,outputPixelType:n,matchAll:o,lookups:s})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array(st);n.fill(Vt),e?.[0]?.length&&n.set(e[0]);const s=new Float32Array(st);for(let r=0;r=s.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const i=s.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),i.bandCount=1,i.keyProperties={...i.keyProperties,BandProperties:void 0};const[a,o,u,l]=t?[-1,1,0,.1]:[0,200,100,10];return i.statistics=[{min:a,max:o,avg:u,stddev:l}],this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{visibleBandID:n,infraredBandID:s,scientificOutput:r}=this.functionArguments;return xr(e,n,s,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments,s=this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0];return{bandIndexMat3:V(s),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map(s=>t[s])}};c([m({json:{write:!0,name:"rasterFunction"}})],Dt.prototype,"functionName",void 0),c([m({type:Vo,json:{write:!0,name:"rasterFunctionArguments"}})],Dt.prototype,"functionArguments",void 0),c([m()],Dt.prototype,"rasterArgumentNames",void 0),Dt=c([F("esri.layers.support.rasterFunctions.NDVIFunction")],Dt);const Lo=Dt;var ke;let rt=ke=class extends D{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new ke({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};c([m({json:{write:!0}})],rt.prototype,"inputRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"outputValues",void 0),c([m({json:{write:!0}})],rt.prototype,"noDataRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"allowUnmatched",void 0),c([m({json:{write:!0}})],rt.prototype,"isLastInputRangeInclusive",void 0),rt=ke=c([F("esri.layers.support.rasterFunctions.RemapFunctionArguments")],rt);const Wo=rt;let Tt=class extends z{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.bandCount=1;const{statistics:n}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:s,outputValues:r,inputRanges:i,noDataRanges:a,isLastInputRangeInclusive:o}=this.functionArguments;if(n!=null&&n.length&&r?.length)if(s){const u=Math.min.apply(null,[...r,n[0].min]),l=Math.max.apply(null,[...r,n[0].max]);t.statistics=[{...n[0],min:u,max:l}]}else{let u=r[0],l=u;for(let h=0;hr[h]?r[h]:u,l=l>r[h]?l:r[h];t.statistics=[{...n[0],min:u,max:l}]}return this.rasterInfo=t,this.lookup=s?null:Ys({srcPixelType:e,inputRanges:i,outputValues:r,noDataRanges:a,allowUnmatched:s,isLastInputRangeInclusive:o,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=st)&&(!a||a.length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{lookup:n,outputPixelType:s}=this;if(n){const l=We(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});return l!=null&&n.mask&&(l.mask=Qs(e.pixels[0],e.mask,n.mask,n.offset,"u8")),l}const{inputRanges:r,outputValues:i,noDataRanges:a,allowUnmatched:o,isLastInputRangeInclusive:u}=this.functionArguments;return Zs(e,{inputRanges:r,outputValues:i,noDataRanges:a,outputPixelType:s,allowUnmatched:o,isLastInputRangeInclusive:u})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,s=new Float32Array(3*st),r=1e-5,i=this.functionArguments.inputRanges??[],a=this.functionArguments.outputValues??[],o=a.length;for(let l=0;l0&&(s[3*l]-=r),(ln.toLowerCase()===t.toLowerCase());return e?Cs(Rt.fromJSON(e)):null}return"toJSON"in t?t.toJSON():t}clone(){return new _e({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};c([m({json:{write:!0}})],Et.prototype,"colorRamp",void 0),c([It("colorRamp")],Et.prototype,"readColorRamp",null),c([m({type:[[Number]],json:{write:!0}})],Et.prototype,"colormap",void 0),Et=_e=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunctionArguments")],Et);const Ho=Et;let ot=class extends z{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:e,colormap:n}=this.functionArguments;if(!e&&!n?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");const s=t.clone();this._removeStatsHistColormapVAT(s),s.pixelType=this.outputPixelType,s.bandCount=3,s.statistics=[{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=s,this.isGCS=s.spatialReference?.isGeographic??!1,n?.length||(n=ce(e,{interpolateAlpha:!0}));const{indexedColormap:r,offset:i}=Ts({colormap:n});if(!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};const a=un(r);return this.lookup={indexedColormap:r,offset:i,hsvMap:a},{success:!0,supportsGPU:Rs(r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e||!this.lookup)return null;let n=t.primaryPixelSizes?.[0];if(n==null){const{extent:a}=t;n=a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1}}const s=ee(this.functionArguments,n,this.isGCS),r=Is(e,s),i=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return ln(r,e,this.lookup.hsvMap,i),r.pixelType=this.outputPixelType,r}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",{indexedColormap:o,offset:u}=this.lookup,l=this.sourceRasterInfos[0].statistics?.[0],h=W(this.outputPixelType);return{...e,indexedColormap:o,offset:u,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,minValue:l?.min??0,maxValue:l?.max??8e3,isOutputRounded:h}}};c([m({json:{write:!0,name:"rasterFunction"}})],ot.prototype,"functionName",void 0),c([m({type:Ho,json:{write:!0,name:"rasterFunctionArguments"}})],ot.prototype,"functionArguments",void 0),c([m()],ot.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ot.prototype,"isGCS",void 0),c([m({json:{write:!0}})],ot.prototype,"lookup",void 0),ot=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunction")],ot);const qo=ot;var Se;const Ko=new Q({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let it=Se=class extends D{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new Se({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([K(Ko)],it.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],it.prototype,"zFactor",void 0),c([m({type:Number,json:{name:"psPower",write:!0}})],it.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{name:"psZFactor",write:!0}})],it.prototype,"pixelSizeFactor",void 0),c([m({type:Boolean,json:{write:!0}})],it.prototype,"removeEdgeEffect",void 0),it=Se=c([F("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],it);const Xo=it;let Pt=class extends z{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics=this.functionArguments.slopeType!=="percent-rise"?[{min:0,max:90,avg:1,stddev:1}]:null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i}=this.functionArguments,{isGCS:a}=this,{extent:o,primaryPixelSizes:u}=t,l=u?.[0],h=l??(o?{x:o.width/e.width,y:o.height/e.height}:{x:1,y:1});return cn(e,{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i,isGCS:a,resolution:h})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:n,pixelSizePower:s}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*Yt:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0,isOutputRounded:W(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Pt.prototype,"functionName",void 0),c([m({type:Xo,json:{write:!0,name:"rasterFunctionArguments"}})],Pt.prototype,"functionArguments",void 0),c([m()],Pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],Pt.prototype,"isGCS",void 0),Pt=c([F("esri.layers.support.rasterFunctions.SlopeFunction")],Pt);const Jo=Pt,xs=new Q({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function Yo(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:i,mask:a,outBand:o}=t;if(n&&!a)return void o.set(s);const{statisticsType:u,kernelRows:l,kernelCols:h}=e,p=u==="stddev",f=r*i,g=new Float64Array(f),y=new Float64Array(f),x=new Uint32Array(f);for(let P=0;Pw-b),a?(f[x+d]=v[Math.floor((v.length-1)/2)],g[x+d]=v.length):o[x+d]=v[Math.floor((v.length-1)/2)])}}if(a)for(let y=h;yP&&(P=N,T=C);a?(y[v+w]=T,x[v+w]=b.size):o[v+w]=T}}if(a)for(let d=h;d1&&o?.length&&(w=A.combineBandMasks(o));const b=new A({pixelType:d,width:i,height:a,pixels:p,bandMasks:o&&v.length?v:null,mask:w});return b.updateStatistics(),b}var Be;let Ft=Be=class extends D{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new Be({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:H(this.raster)})}};c([m({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,e)=>Number(t??e?.kernelRows??3)}}})],Ft.prototype,"rows",void 0),c([m({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,e)=>Number(t??e?.kernelCols??3)}}})],Ft.prototype,"cols",void 0),c([m({json:{write:!0}})],Ft.prototype,"fillNoDataOnly",void 0),c([m({json:{read:{source:["statisticsType","type"],reader:(t,e)=>xs.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),K(xs)],Ft.prototype,"statisticsType",void 0),Ft=Be=c([F("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],Ft);const si=Ft;let Ut=class extends z{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();n.pixelType=this.outputPixelType;const{statisticsType:s}=this.functionArguments;return s==="stddev"&&this._removeStatsHistColormapVAT(n),this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3&&t<5}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return e;const{statisticsType:n,rows:s,cols:r,fillNoDataOnly:i}=this.functionArguments;return ei(e,{kernelRows:s,kernelCols:r,fillNoDataOnly:i,outputPixelType:this.outputPixelType,statisticsType:n,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:n,fillNoDataOnly:s}=this.functionArguments;return{fillNoDataOnly:s,kernelRows:t,kernelCols:e,statisticsType:n,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Ut.prototype,"functionName",void 0),c([m({type:si,json:{write:!0,name:"rasterFunctionArguments"}})],Ut.prototype,"functionArguments",void 0),c([m()],Ut.prototype,"rasterArgumentNames",void 0),Ut=c([F("esri.layers.support.rasterFunctions.StatisticsFunction")],Ut);const ni=Ut;var je;let Nt=je=class extends D{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const n=[];return t.forEach(s=>{const r={min:s.min,max:s.max,avg:s.avg??s.mean,stddev:s.stddev??s.standardDeviation};n.push(r)}),n}writeStatistics(t,e,n){if(!t?.length)return;const s=[];t.forEach(r=>{const i={...r,mean:r.avg,standardDeviation:r.stddev};delete i.avg,delete i.stddev,s.push(i)}),e[n]=s}clone(){return new je({statistics:H(this.statistics),histograms:H(this.histograms)})}};c([m({json:{write:!0}})],Nt.prototype,"statistics",void 0),c([It("statistics")],Nt.prototype,"readStatistics",null),c([Lt("statistics")],Nt.prototype,"writeStatistics",null),c([m({json:{write:!0}})],Nt.prototype,"histograms",void 0),Nt=je=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],Nt);const ri=Nt;let at=class extends z{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:s}=this.functionArguments;return s&&(e.histograms=s),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],at.prototype,"functionName",void 0),c([m({type:ri,json:{write:!0,name:"rasterFunctionArguments"}})],at.prototype,"functionArguments",void 0),c([m()],at.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],at.prototype,"indexedColormap",void 0),c([m()],at.prototype,"isNoopProcess",void 0),at=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],at);const oi=at;var Me;const ii=new Q({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let L=Me=class extends D{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,e,n){t?.length&&(Array.isArray(t[0])||(t=t.map(s=>[s.min,s.max,s.avg,s.stddev])),e[n]=t)}clone(){return new Me({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:H(this.statistics),gamma:H(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:H(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};c([m({type:Boolean,json:{write:!0}})],L.prototype,"computeGamma",void 0),c([m({type:Boolean,json:{name:"dra",write:!0}})],L.prototype,"dynamicRangeAdjustment",void 0),c([m({type:[Number],json:{write:!0}})],L.prototype,"gamma",void 0),c([m()],L.prototype,"histograms",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"maxPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"minPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"numberOfStandardDeviations",void 0),c([m({type:Number,json:{name:"max",write:!0}})],L.prototype,"outputMax",void 0),c([m({type:Number,json:{name:"min",write:!0}})],L.prototype,"outputMin",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"sigmoidStrengthLevel",void 0),c([m({json:{type:[[Number]],write:!0}})],L.prototype,"statistics",void 0),c([Lt("statistics")],L.prototype,"writeStatistics",null),c([K(ii)],L.prototype,"stretchType",void 0),c([m({type:Boolean,json:{write:!0}})],L.prototype,"useGamma",void 0),L=Me=c([F("esri.layers.support.rasterFunctions.StretchFunctionArguments")],L);const ai=L;let ut=class extends z{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:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:s,gamma:r,useGamma:i}=n;if(!s&&["u8","u16","s8","s16"].includes(e)){const l=ae(n.toJSON(),{rasterInfo:t}),h=W(this.outputPixelType)?"round":"float";this.lookup=pn({pixelType:e,...l,gamma:i?r:null,rounding:h}),this.cutOffs=l}else s||(this.cutOffs=ae(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const a=t.clone();a.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(a),this.outputPixelType==="u8"&&(a.keyProperties.DataType="processed");const{outputMin:o=0,outputMax:u=255}=this.functionArguments;a.statistics=[];for(let l=0;l=2?3:1,i=s&&n?.length?mn(r,n):[1,1,1],{minCutOff:a,maxCutOff:o}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};a.length===1&&(a[1]=a[2]=a[0],o[1]=o[2]=o[0]);const u=new Float32Array(r);let l;for(l=0;l1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const n=t.clone();return n.pixelType=this.outputPixelType,n.bandCount=1,n.dataType!=="thematic"&&(n.keyProperties=n.keyProperties?{...n.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],Ct.prototype,"functionName",void 0),c([m({type:li,json:{write:!0,name:"rasterFunctionArguments"}})],Ct.prototype,"functionArguments",void 0),c([m()],Ct.prototype,"rasterArgumentNames",void 0),c([m()],Ct.prototype,"isNoopProcess",void 0),Ct=c([F("esri.layers.support.rasterFunctions.TableFunction")],Ct);const ci=Ct,j=new Map;function pi(t,e){const{rasterFunctionArguments:n}=t;n&&(n.rasters||[n.raster,n.raster2]).forEach(s=>{s&&typeof s!="number"&&(typeof s=="string"?s.startsWith("http")&&(e.includes(s)||e.push(s)):"rasterFunctionArguments"in s&&pi(s,e))})}function Ci(t,e){if(e=e??{},"function"in(t=H(t))&&"arguments"in t&&t.arguments){const n=Vs(t,new Map,e);if(De(n),!n.renderingRule)throw new Wt("raster-function-helper","Unsupported raster function json.");t=n.renderingRule}if("rasterFunction"in t)return Es(t=ze(t),e);throw new Wt("raster-function-helper","unsupported raster function json.")}function hi(t,e){return e[0]==="rasters"&&Array.isArray(t.rasters)?t.rasters:e.map(n=>t[n])}function ws(t){return!!(t&&typeof t=="object"&&t.rasterFunction&&t.rasterFunctionArguments)}function ze(t){const{rasterFunction:e,rasterFunctionArguments:n}=t,s={};for(const r in n){let i=n[r];const a=r.toLowerCase();if(a==="rasters"&&Array.isArray(i))s.rasters=i.map(o=>ws(o)?ze(o):o);else switch(ws(i)&&(i=ze(i)),a){case"dra":s.dra=i;break;case"pspower":s.psPower=i;break;case"pszfactor":s.psZFactor=i;break;case"bandids":s.bandIds=i;break;default:s[r[0].toLowerCase()+r.slice(1)]=i}}return e!=="Local"||s.rasters?.length||(s.rasters=["$$"]),{...t,rasterFunctionArguments:s}}function Es(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,r=t.outputPixelType?.toLowerCase();if(n==null||!j.has(n))throw new Wt("raster-function-helper",`unsupported raster function: ${n}`);const i=j.get(n),a=(typeof i.ctor=="function"?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:r}),{rasterArgumentNames:o}=a,u=[],l=hi(s,o),h=o[0]==="rasters"||o.length>1,p=[];for(let f=0;f{a.functionArguments[f]=p[g]})),e){a.sourceRasters=u;const f=e.raster?.url;f&&(a.mainPrimaryRasterId=f)}return a}function Us(t,e){if(t&&e)for(const n in t){const s=t[n];s&&typeof s=="object"&&"type"in s&&(s.type==="RasterFunctionTemplate"?Us(s.arguments,e):s.type==="RasterFunctionVariable"&&e[s.name]!=null&&(s.value=e[s.name]))}}function Oe(t,e){if(!t||typeof t!="object")return t;const{value:n}=t;if(!n||typeof n!="object")return t.isDataset?"$$":n;if(Array.isArray(n))return n.length===0?[]:n.map(r=>typeof r=="object"&&r.type==="RasterFunctionVariable"?Oe(r,e):r);if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&n.type!=="Scalar")return"$$";if(!("type"in n))return n;let s=n;switch(n.type){case"Scalar":s=n.value;break;case"AlgorithmicColorRamp":s=vs(n);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(vs)};break;case"ArgumentArray":if(n.elements?.length&&n.elements[0].type!=="RasterStatistics"){const r=[];for(let i=0;i{if(typeof o=="object")if(o._object_ref_id!=null){if(!n.has(o._object_ref_id))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${i} does not exist`);const l=n.get(a);l&&typeof l=="object"?Object.assign(o,l):i[u]=l}else De({renderingRule:o,templates:n})}));else{if(!n.has(a))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${a} does not exist`);const o=n.get(a);r!=="_object_ref_id"?s[r]=o:o&&typeof o=="object"&&Object.assign(s,o)}}}function mi(t){t.Statistics?.length&&typeof t.Statistics=="object"&&(t.Statistics=t.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),t.NumberOfStandardDeviation!=null&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function fi(t){t.ColorRamp?.type?.toLowerCase()==="randomcolorramp"&&(delete t.ColorRamp,t.ColormapName="Random"),t.ColorSchemeType===0&&delete t.ColorRamp}function di(t){t.ConvolutionType!=null&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function gi(t){t.NoDataValues?.length&&typeof t.NoDataValues[0]=="string"&&(t.NoDataValues=t.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}j.set("Arithmetic",{desc:"Arithmetic Function",ctor:ar,rasterArgumentNames:["rasters"]}),j.set("Aspect",{desc:"Aspect Function",ctor:lr,rasterArgumentNames:["raster"]}),j.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:Gr,rasterArgumentNames:["raster"]}),j.set("Colormap",{desc:"Colormap Function",ctor:to,rasterArgumentNames:["raster"]}),j.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:so,rasterArgumentNames:["raster"]}),j.set("CompositeBand",{desc:"CompositeBand Function",ctor:ro,rasterArgumentNames:["rasters"]}),j.set("ComputeChange",{desc:"ComputeChange Function",ctor:fo,rasterArgumentNames:["rasters"]}),j.set("Convolution",{desc:"Convolution Function",ctor:Po,rasterArgumentNames:["raster"]}),j.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:yo,rasterArgumentNames:["raster"]}),j.set("ExtractBand",{desc:"ExtractBand Function",ctor:Ro,rasterArgumentNames:["raster"]}),j.set("Curvature",{desc:"Curvature Function",ctor:No,rasterArgumentNames:["raster"]}),j.set("Hillshade",{desc:"Hillshade Function",ctor:zo,rasterArgumentNames:["raster"]}),j.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:qo,rasterArgumentNames:["raster"]}),j.set("Grayscale",{desc:"Grayscale Function",ctor:jo,rasterArgumentNames:["raster"]}),j.set("Clip",{desc:"Clip Function",ctor:Wr,rasterArgumentNames:["raster"]}),j.set("Local",{desc:"Local Function",ctor:Do,rasterArgumentNames:["rasters"]}),j.set("Mask",{desc:"Mask Function",ctor:Uo,rasterArgumentNames:["raster"]}),j.set("NDVI",{desc:"NDVI Function",ctor:Lo,rasterArgumentNames:["raster"]}),j.set("Remap",{desc:"Remap Function",ctor:$o,rasterArgumentNames:["raster"]}),j.set("Slope",{desc:"Slope Function",ctor:Jo,rasterArgumentNames:["raster"]}),j.set("Statistics",{desc:"Focal Statistics Function",ctor:ni,rasterArgumentNames:["raster"]}),j.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:oi,rasterArgumentNames:["raster"]}),j.set("Stretch",{desc:"Stretch Function",ctor:ui,rasterArgumentNames:["raster"]}),j.set("Table",{desc:"Attribute Table Function",ctor:ci,rasterArgumentNames:["raster"]});let Xt=class extends Le{get affectsPixelSize(){return!1}forwardTransform(t){return t}inverseTransform(t){return t}};c([m()],Xt.prototype,"affectsPixelSize",null),c([m({json:{write:!0}})],Xt.prototype,"spatialReference",void 0),Xt=c([F("esri.layers.support.rasterTransforms.BaseRasterTransform")],Xt);const Ws=Xt;var Ee;let Jt=Ee=class extends Ws{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(t){return(t=t.clone()).type==="point"?(t.x>180+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)}clone(){return new Ee({tolerance:this.tolerance})}};c([K({GCSShiftXform:"gcs-shift"})],Jt.prototype,"type",void 0),c([m()],Jt.prototype,"tolerance",void 0),Jt=Ee=c([F("esri.layers.support.rasterTransforms.GCSShiftTransform")],Jt);const Ri=Jt;var Ue;function Ve(t,e,n){const{x:s,y:r}=e;if(n<2)return{x:t[0]+s*t[2]+r*t[4],y:t[1]+s*t[3]+r*t[5]};if(n===2){const f=s*s,g=r*r,y=s*r;return{x:t[0]+s*t[2]+r*t[4]+f*t[6]+y*t[8]+g*t[10],y:t[1]+s*t[3]+r*t[5]+f*t[7]+y*t[9]+g*t[11]}}const i=s*s,a=r*r,o=s*r,u=i*s,l=i*r,h=s*a,p=r*a;return{x:t[0]+s*t[2]+r*t[4]+i*t[6]+o*t[8]+a*t[10]+u*t[12]+l*t[14]+h*t[16]+p*t[18],y:t[1]+s*t[3]+r*t[5]+i*t[7]+o*t[9]+a*t[11]+u*t[13]+l*t[15]+h*t[17]+p*t[19]}}function bs(t,e,n){const{xmin:s,ymin:r,xmax:i,ymax:a,spatialReference:o}=e;let u=[];if(n<2)u.push({x:s,y:a}),u.push({x:i,y:a}),u.push({x:s,y:r}),u.push({x:i,y:r});else{let p=10;for(let f=0;fVe(t,p,n));const l=u.map(p=>p.x),h=u.map(p=>p.y);return new le({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:o})}function yi(t){const[e,n,s,r,i,a]=t,o=s*a-i*r,u=i*r-s*a;return[(i*n-e*a)/o,(s*n-e*r)/u,a/o,r/u,-i/o,-s/u]}let q=Ue=class extends Ws{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,e){const{coeffX:n,coeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let i=0;i0}forwardTransform(t){if(t.type==="point"){const e=Ve(this.forwardCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if(t.type==="point"){const e=Ve(this.inverseCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.inverseCoefficients,t,this.polynomialOrder)}clone(){return new Ue({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};c([m({json:{write:!0}})],q.prototype,"polynomialOrder",void 0),c([m()],q.prototype,"forwardCoefficients",void 0),c([It("forwardCoefficients",["coeffX","coeffY"])],q.prototype,"readForwardCoefficients",null),c([Lt("forwardCoefficients")],q.prototype,"writeForwardCoefficients",null),c([m({json:{write:!0}})],q.prototype,"inverseCoefficients",null),c([It("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],q.prototype,"readInverseCoefficients",null),c([Lt("inverseCoefficients")],q.prototype,"writeInverseCoefficients",null),c([m()],q.prototype,"affectsPixelSize",null),c([K({PolynomialXform:"polynomial"})],q.prototype,"type",void 0),q=Ue=c([F("esri.layers.support.rasterTransforms.PolynomialTransform")],q);const Ii=q;export{Lr as B,pi as D,Ni as E,Ci as h,Ws as q,Ii as v,Ri as x}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-ChEr_3ja.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-McBHp1Y5.js"])))=>i.map(i=>d[i]); +import{_ as $s}from"./main-QGPoLsvl.js";import{l as Ye}from"./colorUtils-Cthpxcks-cHaMZbaf.js";import{v as c,S as m,i as F,ad as As,aK as Q,bz as K,af as Hs,g as qs,a0 as It,ac as Lt,e as Le,P as H,i2 as Vt,o as Wt,w as ue,n as le,p as Qe}from"./story-Doly9N9p.js";import{D as A,g as W,e as Ts,c as oe,l as Ks,n as kt,d as We,u as Ps,K as ie,i as Fs,p as Xs,s as st,j as Js,m as Ys,q as Qs,t as Zs,Y as tn,Q as Ns,L as en}from"./dataUtils-BkPy4R3C-Dzc1QGGb.js";import{W as sn,G as Rt,X as nn,e as rn,i as ce,f as Cs,g as Rs,h as on,k as Yt,Q as an,$ as ee,x as Is,T as ks,l as un,I as ln,Z as cn,P as ae,m as pn,o as hn,p as mn,r as _s}from"./RasterSymbolizer-BVys6HkM-DCN-TPRo.js";import{o as fn,F as dn}from"./rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js";import{g as gn,v as Ss}from"./colorRamps-q0bZVhs2-BnivlaV9.js";import{y as nt}from"./Field-C6hA1tZj-CkWoRbmp.js";let Qt=class extends Le{constructor(){super(...arguments),this.raster=void 0}};c([m({json:{write:!0}})],Qt.prototype,"raster",void 0),Qt=c([F("esri.layers.support.rasterFunctions.BaseFunctionArguments")],Qt);const D=Qt;var pe;let _t=pe=class extends D{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new pe({raster:this.raster,raster2:this.raster2,operation:this.operation})}};c([m({json:{write:!0}})],_t.prototype,"operation",void 0),c([m({json:{write:!0}})],_t.prototype,"raster2",void 0),c([m({readOnly:!0})],_t.prototype,"rasters",null),_t=pe=c([F("esri.layers.support.rasterFunctions.ArithmeticFunctionArguments")],_t);const yn=_t,xn=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let E=class extends Le{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const e=[t],{parameters:n}=t;let s=n.rasters||n.raster&&[n.raster];for(;s?.length;){e.unshift(...s);const o=[];for(let u=0;u=0;o--)e[o].isNoopProcess&&e.splice(o,1);let r=!1;for(let o=0;o1}const i=e.some(({name:o})=>xn.has(o.toLowerCase())),{rawSourceRasterInfos:a}=this;return{functions:e,hasBranches:r,hasFocalFunction:i,isSourceSingleBand:a?.[0]?.bandCount===1}}bind(t,e=!1,n=-1){this.id=n+1;const s=this._getRasterValues();let r=!0;for(let i=0;ithis._readRasterValue(s,t));return this._processPixels({...t,pixelBlocks:n})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);let e;if(t.length>1){const r=t.map(a=>a.processInputBandIds()[0]);this.rawInputBandIds=r,this.isInputBandIdsSwizzled=this.rawInputBandIds.some((a,o)=>a!==o);const i=t.filter(a=>a.functionName==="ExtractBand");return i.length&&i.forEach((a,o)=>{a.isInputBandIdsSwizzled=!0,a.swizzledBandSelection=[o,o,o]}),this.rawInputBandIds}const n=t[0];if(n){if(e=n.processInputBandIds(),n.isInputBandIdsSwizzled)return this.rawInputBandIds=e,e}else{e=[];const{bandCount:r}=this.sourceRasterInfos[0];for(let i=0;ir!==i),this.rawInputBandIds=s,this.rawInputBandIds}getPrimaryRasters(){const t=[],e=[];return this._getPrimaryRasters(this,t,e),{rasters:t,rasterIds:e}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:e,rasters:n}=this.functionArguments;return n&&Array.isArray(n)&&n.length?(t.rasters=n.map(s=>this._isRasterFunctionValue(s)?s.getWebGLProcessorDefinition():typeof s=="number"?{name:"Constant",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:s},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(s=>s!=null)||(t.rasters=null)):this._isRasterFunctionValue(e)&&(t.raster=e.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];this.functionName==="Clip"&&t.push(this.functionArguments);const{raster:e,rasters:n}=this.functionArguments;if(n&&Array.isArray(n)&&n.length)n.forEach(s=>{if(this._isRasterFunctionValue(s)){const r=s.getClippingGeometries();t.push(...r)}});else if(this._isRasterFunctionValue(e)){const s=e.getClippingGeometries();t.push(...s)}return t}_getOutputPixelType(t){return this.outputPixelType==="unknown"?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach(e=>{e.statistics=void 0,e.histograms=void 0})}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"?this.functionArguments.rasters??[]:t.flatMap(e=>this.functionArguments[e])}_getSourceRasterInfos(t){const e=this._getRasterValues(),{rasterInfos:n,rasterIds:s}=t;if(e.length===0)return n;const r=e.map(a=>a&&typeof a=="object"&&"bind"in a&&a.rasterInfo?a.rasterInfo:typeof a=="string"&&s.includes(a)?n[s.indexOf(a)]:typeof a!="number"?n[0]:void 0),i=r.find(a=>a)??n[0];return r.forEach((a,o)=>{a===void 0&&(r[o]=i)}),r}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,e=[],n=[]){for(let s=0;se?s.slice(0,e):null),r&&r.length!==e&&(t.histograms=r.length>e?r.slice(0,e):null),n.BAND_COUNT&&Number(n.BAND_COUNT)!==e&&(t.keyProperties={...n,BAND_COUNT:typeof n.BAND_COUNT=="string"?String(e):e})}};c([m({json:{write:!0}})],E.prototype,"functionName",void 0),c([m({json:{write:!0}})],E.prototype,"functionArguments",void 0),c([m()],E.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}}),As(t=>t?.toLowerCase())],E.prototype,"outputPixelType",void 0),c([m({json:{write:!0}})],E.prototype,"mainPrimaryRasterId",void 0),c([m()],E.prototype,"sourceRasters",void 0),c([m({type:[sn],json:{write:!0}})],E.prototype,"sourceRasterInfos",void 0),c([m({json:{write:!0}})],E.prototype,"rasterInfo",void 0),c([m({json:{write:!0}})],E.prototype,"readingBufferSize",void 0),c([m({json:{write:!0}})],E.prototype,"id",void 0),c([m()],E.prototype,"isNoopProcess",void 0),c([m()],E.prototype,"supportsGPU",null),c([m()],E.prototype,"rawInputBandIds",void 0),c([m()],E.prototype,"rawSourceRasterInfos",void 0),c([m()],E.prototype,"isInputBandIdsSwizzled",void 0),c([m()],E.prototype,"swizzledBandSelection",void 0),c([m()],E.prototype,"isBranch",void 0),c([m({readOnly:!0})],E.prototype,"flatWebGLFunctionChain",null),c([m()],E.prototype,"_bindingResult",void 0),E=c([F("esri.layers.support.rasterFunctions.BaseRasterFunction")],E);const z=E,S={userDefined:-1,lineDetectionHorizontal:0,lineDetectionVertical:1,lineDetectionLeftDiagonal:2,lineDetectionRightDiagonal:3,gradientNorth:4,gradientWest:5,gradientEast:6,gradientSouth:7,gradientNorthEast:8,gradientNorthWest:9,smoothArithmeticMean:10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,sobelHorizontal:17,sobelVertical:18,sharpen:19,sharpen2:20,pointSpread:21,none:255},wn={plus:1,minus:2,times:3,sqrt:4,power:5,abs:10,divide:23,exp:25,exp10:26,exp2:27,int:30,float:32,ln:35,log10:36,log2:37,mod:44,negate:45,roundDown:48,roundUp:49,square:53,floatDivide:64,floorDivide:65},$={bitwiseAnd:11,bitwiseLeftShift:12,bitwiseNot:13,bitwiseOr:14,bitwiseRightShift:15,bitwiseXOr:16,booleanAnd:17,booleanNot:18,booleanOr:19,booleanXOr:20,equalTo:24,greaterThan:28,greaterThanEqual:29,lessThan:33,lessThanEqual:34,isNull:31,notEqual:46},J={acos:6,asin:7,atan:8,atanh:9,cos:21,cosh:22,sin:51,sinh:52,tan:56,tanh:57,acosh:59,asinh:60,atan2:61},vn={majority:38,max:39,mean:40,med:41,min:42,minority:43,range:47,stddev:54,sum:55,variety:58,majorityIgnoreNoData:66,maxIgnoreNoData:67,meanIgnoreNoData:68,medIgnoreNoData:69,minIgnoreNoData:70,minorityIgnoreNoData:71,rangeIgnoreNoData:72,stddevIgnoreNoData:73,sumIgnoreNoData:74,varietyIgnoreNoData:75},Bs={setNull:50,conditional:78},Ze={...wn,...$,...J,...vn,...Bs},js=new Map([[J.acos,{domain:[0,Math.PI],isInteger:!1}],[J.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[J.cos,{domain:[-1,1],isInteger:!1}],[J.sin,{domain:[-1,1],isInteger:!1}],[$.booleanAnd,{domain:[0,1],isInteger:!0}],[$.booleanNot,{domain:[0,1],isInteger:!0}],[$.booleanOr,{domain:[0,1],isInteger:!0}],[$.booleanXOr,{domain:[0,1],isInteger:!0}],[$.equalTo,{domain:[0,1],isInteger:!0}],[$.notEqual,{domain:[0,1],isInteger:!0}],[$.greaterThan,{domain:[0,1],isInteger:!0}],[$.greaterThanEqual,{domain:[0,1],isInteger:!0}],[$.lessThan,{domain:[0,1],isInteger:!0}],[$.lessThanEqual,{domain:[0,1],isInteger:!0}],[$.isNull,{domain:[0,1],isInteger:!0}]]);function ts(t){return js.get(t)}const es=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function bn(t,e=!1){const n=t.map(o=>o.mask),s=n.filter(o=>o!=null),r=t[0].pixels[0].length;if(s.length===0||e&&s.length!==n.length)return new Uint8Array(r).fill(255);const i=s[0],a=new Uint8Array(i);if(s.length===1)return a;if(!e){for(let o=1;o=1?e[u]=0:a[u]=Math.atanh(l)}return a}const o=s===J.asin?Math.asin:Math.acos;for(let u=0;u1?e[u]=0:a[u]=o(l)}return a}function _n(t,e,n,s){const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;o>r[o]);return a}function On(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;or[o]?1:0);return a}function Yn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;o=r[o]?1:0);return a}function Qn(t,e,n){const[s,r]=t,i=s.length,a=A.createEmptyBand(n,i);for(let o=0;oh&&(u=h)}a[o]=u}return a}function os(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;op&&(u=p)}a[o]=l-u}return a}function is(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i);for(let o=0;ol?(l=u,h.length=0,h.push(p)):u===l&&h.push(p);h.length>1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function ps(t,e,n){const s=t.length;if(s<=2)return Gs(t,e,n);const r=t[0].length,i=A.createEmptyBand(n,r),a=new Map;for(let o=0;o1&&h.sort((p,f)=>p-f),i[o]=h[0]}return i}function hs(t,e,n){const s=t.length;if(s<2)return t[0];const[r]=t,i=r.length,a=A.createEmptyBand(n,i),o=new Set;for(let u=0;u=66&&e<=75);const{outputPixelType:r="f32"}=n,i=!G.has(e)||n.processAsMultiband,a=i?t[0].pixels.length:1,o=[];for(let l=0;lg.pixels):t.map(g=>g.pixels[l]);let p,f=!0;if(e===Bs.setNull){const g=rr(h,s,r);p=g.band,s=g.mask,f=!1}else R.has(e)?p=R.get(e)(h,s,"f64"):U.has(e)?p=e===J.asin||e===J.acos||e===J.atanh?kn(h,s,"f64",e):_n(h,s,"f64",U.get(e)):se.has(e)?p=Sn(h,s,"f64",se.get(e)):G.has(e)?p=G.get(e)(h,s,"f64"):(p=h[0],f=!1);if(f&&e!==$.isNull&&!js.has(e)){const g=A.createEmptyBand(r,p.length);s||(s=new Uint8Array(p.length).fill(255)),tn(p,s),Ns(p,s,r,g),p=g}o.push(p)}const u=t[0];return new A({width:u.width,height:u.height,pixelType:r,mask:e===$.isNull?null:s,pixels:o})}function ir(t,e,n){return zs(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}let St=class extends z{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?.[0]==null||e?.[1]==null?null:ir(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],n=this.outputPixelType??"f32";let[s,r]=kt(n);const i=W(n);return i&&(s-=1e-4,r+=1e-4),{imageCount:2,operationName:e,domainRange:[s,r],isOutputRounded:i}}};c([m({json:{write:!0,name:"rasterFunction"}})],St.prototype,"functionName",void 0),c([m({type:yn,json:{write:!0,name:"rasterFunctionArguments"}})],St.prototype,"functionArguments",void 0),c([m()],St.prototype,"rasterArgumentNames",void 0),St=c([F("esri.layers.support.rasterFunctions.ArithmeticFunction")],St);const ar=St;var he;let me=he=class extends D{clone(){return new he({raster:this.raster})}};me=he=c([F("esri.layers.support.rasterFunctions.AspectFunctionArguments")],me);const ur=me;let lt=class extends z{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??!1,this.outputPixelType=this._getOutputPixelType("f32");const e=t.clone();return e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),e.statistics=[{min:-1,max:360,avg:180,stddev:30}],e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1});return nn(e,{resolution:i})}};c([m({json:{write:!0,name:"rasterFunction"}})],lt.prototype,"functionName",void 0),c([m({type:ur,json:{write:!0,name:"rasterFunctionArguments"}})],lt.prototype,"functionArguments",void 0),c([m()],lt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],lt.prototype,"isGCS",void 0),lt=c([F("esri.layers.support.rasterFunctions.AspectFunction")],lt);const lr=lt,cr=new Set(["+","-","*","/","(",")"]);function pr(t,e){(t=t.replaceAll(" ","")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1));const n=t.split(""),s=[],r=[];let i="";for(let a=0;a-1)n>0&&(r+=e+1);else{for(let a=0;a0&&(r+=e+1)}let i=0;for(let a=0;a0;){const{numIndex:a,opIndex:o}=fr(r);if(s=hr(t,r[o],i[a],i[a+1]),r.length===1)break;r=mr(r,o),i.splice(a,2,s)}return[s]}const gr=new Q({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 yr(t,e){if(!en(t))return t;const{equation:n,method:s}=e,r=e.bandIndexes.map(f=>f-1),{pixels:i,mask:a}=t;let o;switch(s){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":o=fs(a,i[r[0]],i[r[1]]);break;case"ndwi":o=fs(a,i[r[1]],i[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":o=wr(a,i[r[0]],i[r[1]]);break;case"ci-g":case"ci-re":o=vr(a,i[r[0]],i[r[1]]);break;case"savi":o=br(a,i[r[0]],i[r[1]],r[2]+1);break;case"tsavi":o=Ar(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":o=Tr(a,i[r[0]],i[r[1]]);break;case"gemi":o=Pr(a,i[r[0]],i[r[1]]);break;case"pvi":o=Fr(a,i[r[0]],i[r[1]],r[2]+1,r[3]+1);break;case"gvitm":o=Nr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]],i[r[5]]]);break;case"sultan":o=Cr(a,[i[r[0]],i[r[1]],i[r[2]],i[r[3]],i[r[4]]]);break;case"vari":o=Rr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"mtvi2":o=Ir(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"rtvi-core":o=kr(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"evi":o=_r(a,[i[r[0]],i[r[1]],i[r[2]]]);break;case"wndwi":o=Sr(a,[i[r[0]],i[r[1]],i[r[2]]],r[3]?r[3]+1:.5);break;case"bai":o=Br(a,i[r[0]],i[r[1]]);break;case"custom":o=dr(a,i,n);break;default:return t}const{outputPixelType:u="f32"}=e,l=u!=null&&W(u);let h;a?(h=new Uint8Array(t.width*t.height),h.set(a)):l&&(h=new Uint8Array(t.width*t.height).fill(255)),l&&(o=o.map(f=>{const g=A.createEmptyBand(u,f.length);return Ns(f,h,u,g),g}));const p=new A({width:t.width,height:t.height,pixelType:u,pixels:o,mask:h});return p.updateStatistics(),p}function xr(t,e,n,s){const{mask:r,pixels:i,width:a,height:o}=t,u=i[n],l=i[e],h=l.length,p=s?new Uint8Array(h):new Float32Array(h),f=s?100:1,g=s?100.5:0;for(let x=0;xparseFloat(i));return yr(e,{method:n,bandIndexes:r,equation:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1);t.length===2&&t.push(0);const e=this.isInputBandIdsSwizzled?[0,1,2]:t;let n,s;const r=new Float32Array(3),{method:i}=this.functionArguments;switch(i){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":n=V([e[0],e[1],0]),s="ndxi";break;case"ndwi":n=V([e[1],e[0],0]),s="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":n=V([e[0],e[1],0]),s="sr";break;case"ci-g":case"ci-re":n=V([e[0],e[1],0]),s="ci";break;case"savi":n=V([e[0],e[1],0]),s="savi",r[0]=t[2]+1;break;case"tsavi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1,r[2]=t[4]+1;break;case"msavi":n=V([e[0],e[1],0]),s="msavi";break;case"gemi":n=V([e[0],e[1],0]),s="gemi";break;case"pvi":n=V([e[0],e[1],0]),s="tsavi",r[0]=t[2]+1,r[1]=t[3]+1;break;case"vari":n=V([e[0],e[1],e[2]]),s="vari";break;case"mtvi2":n=V([e[0],e[1],e[2]]),s="mtvi";break;case"rtvi-core":n=V([e[0],e[1],e[2]]),s="rtvicore";break;case"evi":n=V([e[0],e[1],e[2]]),s="evi";break;case"wndwi":n=V([e[0],e[1],0]),s="wndwi",r[0]=t[3]?t[3]+1:.5;break;case"bai":n=V([e[1],e[0],0]),s="bai";break;default:n=V([0,1,2]),s="custom"}return{bandIndexMat3:n,indexType:s,adjustments:r,isOutputRounded:W(this.outputPixelType)}}_getInputBandIds(t){if(this.functionArguments.method==="custom")return t;const e=this.functionArguments.bandIndexes.split(" ").map(a=>parseFloat(a)-1),n=t.length,s=e.map(a=>a>=n?n-1:a),r=Mr.has(this.functionArguments.method)?3:2,i=s.slice(0,r).map(a=>t[a]);return i.length===2&&i.push(0),i}};c([m({json:{write:!0,name:"rasterFunction"}})],Bt.prototype,"functionName",void 0),c([m({type:jr,json:{write:!0,name:"rasterFunctionArguments"}})],Bt.prototype,"functionArguments",void 0),c([m()],Bt.prototype,"rasterArgumentNames",void 0),Bt=c([F("esri.layers.support.rasterFunctions.BandArithmeticFunction")],Bt);const Gr=Bt;var de;const ds=new Q({1:"outside",2:"inside"},{useNumericKeys:!0});let Ht=de=class extends D{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new de({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};c([m({types:Hs,json:{read:qs,write:!0}})],Ht.prototype,"clippingGeometry",void 0),c([m({json:{read:ds.read,write:ds.write}})],Ht.prototype,"clippingType",void 0),Ht=de=c([F("esri.layers.support.rasterFunctions.ClipFunctionArguments")],Ht);const zr=Ht;function Or(t,e){if(t.spatialReference.equals(e))return t;const n=Qe(t.spatialReference),s=Qe(e);if(n===s)return t;const r=n/s;return{x:t.x*r,y:t.y*r}}async function Ni(t,e,n){if(n.type==="extent")return Er(t,e,n);const{width:s,height:r}=t,i=new Uint8Array(s*r),{contains:a,intersects:o}=await $s(async()=>{const{contains:u,intersects:l}=await import("./geometryEngine-CdPoFSE4-ChEr_3ja.js");return{contains:u,intersects:l}},__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url);return o(e,n)?n.type==="polyline"?Ur(t,e,n):a(n,e)?t:Dr(t,e,n):new A({pixelType:t.pixelType,width:s,height:r,mask:i,maskIsAlpha:!1,pixels:[...t.pixels]})}function Dr(t,e,n){if(!t)return t;const{width:s,height:r}=t,i=e.width/s,a=e.height/r,{xmin:o,ymax:u}=e;let l;if(n.type==="extent"){const d=(n.xmin-o)/i,v=(n.xmax-o)/i,w=(u-n.ymax)/a,b=(u-n.ymin)/a;l=[[[d,w],[d,b],[v,b],[v,w],[d,w]]]}else l=n.rings.map(d=>d.map(([v,w])=>[(v-o)/i,(u-w)/a]));const h=document.createElement("canvas");h.width=s,h.height=r;const p=h.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach(d=>{p.moveTo(d[0][0],d[0][1]);for(let v=0;v127?255:0);return new A({pixelType:t.pixelType,width:s,height:r,mask:x,maskIsAlpha:!1,pixels:[...t.pixels]})}function Er(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r;if(n.width/a<.5||n.height/o<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});const{xmin:u,xmax:l,ymin:h,ymax:p}=e,{xmin:f,xmax:g,ymin:y,ymax:x}=n,d=Math.max(u,f),v=Math.min(l,g),w=Math.max(h,y),b=Math.min(p,x),T=.5*a,N=.5*o;if(v-dl-T||w>p-N||b.5&&C%1<.5||O===Z&&_%1>.5&&I%1<.5)return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]});if(k===0&&O===0&&B===s&&Z===r)return t;const Xe=t.mask;for(let ne=O;ne<=Z;ne++)for(let re=k;re<=B;re++){const Je=ne*s+re;i[Je]=Xe?Xe[Je]:255}return new A({pixelType:t.pixelType,width:s,height:r,mask:i,pixels:[...t.pixels]})}function Ur(t,e,n){const{width:s,height:r}=t,i=new Uint8Array(s*r),a=e.width/s,o=e.height/r,{xmin:u,ymax:l}=e,{paths:h}=n,p=t.mask;for(let f=0;fx?i*Math.round((p-x)/i):0),g=d-(gx?i*Math.round((f-x)/i):0),y=d-(yx?i*Math.floor((p-x)/i+.1):0),g=d-(gs.toLowerCase()===t.toLowerCase());return n?Rt.fromJSON(n):null}clone(){return new ge({colormap:H(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};c([m({type:[[Number]],json:{write:!0}})],Y.prototype,"colormap",void 0),c([m({type:String,json:{write:!0}})],Y.prototype,"colormapName",void 0),c([As("colormapName")],Y.prototype,"castColormapName",null),c([m({types:gn,json:{write:!0}})],Y.prototype,"colorRamp",void 0),c([It("colorRamp")],Y.prototype,"readColorRamp",null),c([m({type:Rt.apiValues,json:{type:Rt.jsonValues,write:Rt.write}})],Y.prototype,"colorRampName",void 0),c([It("colorRampName")],Y.prototype,"readColorRampName",null),Y=ge=c([F("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],Y);const $r=Y,Hr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[112,75,3],[113,76,3],[114,77,3],[115,77,3],[116,78,3],[117,79,3],[118,79,3],[119,80,3],[121,81,4],[122,82,4],[123,82,4],[124,83,4],[125,84,4],[126,84,4],[127,85,4],[128,86,4],[129,86,4],[130,87,4],[131,88,4],[132,89,4],[133,89,4],[134,90,4],[135,91,4],[136,91,4],[137,92,4],[138,93,4],[139,94,4],[140,94,4],[142,95,5],[143,96,5],[144,96,5],[145,97,5],[146,98,5],[147,99,5],[148,99,5],[149,100,5],[150,101,5],[151,101,5],[152,102,5],[153,103,5],[154,104,5],[155,104,5],[156,105,5],[157,106,5],[158,106,5],[159,107,5],[160,108,5],[161,108,5],[162,109,5],[164,110,6],[165,111,6],[166,111,6],[167,112,6],[168,113,6],[169,113,6],[170,114,6],[171,115,6],[172,116,6],[173,116,6],[174,117,6],[245,0,0],[245,5,0],[245,10,0],[246,15,0],[246,20,0],[246,25,0],[246,30,0],[247,35,0],[247,40,0],[247,45,0],[247,50,0],[247,55,0],[248,60,0],[248,65,0],[248,70,0],[248,75,0],[249,81,0],[249,86,0],[249,91,0],[249,96,0],[250,101,0],[250,106,0],[250,111,0],[250,116,0],[250,121,0],[251,126,0],[251,131,0],[251,136,0],[251,141,0],[252,146,0],[252,151,0],[252,156,0],[252,156,0],[251,159,0],[250,162,0],[249,165,0],[248,168,0],[247,171,0],[246,174,0],[245,177,0],[245,179,0],[244,182,0],[243,185,0],[242,188,0],[241,191,0],[240,194,0],[239,197,0],[238,200,0],[237,203,0],[236,206,0],[235,209,0],[234,212,0],[233,215,0],[232,218,0],[231,221,0],[230,224,0],[230,226,0],[229,229,0],[228,232,0],[227,235,0],[226,238,0],[225,241,0],[224,244,0],[223,247,0],[165,247,0],[163,244,0],[161,240,0],[158,237,0],[156,233,1],[154,230,1],[152,227,1],[149,223,1],[147,220,1],[145,216,1],[143,213,1],[140,210,2],[138,206,2],[136,203,2],[134,200,2],[132,196,2],[129,193,2],[127,189,2],[125,186,3],[123,183,3],[120,179,3],[118,176,3],[116,172,3],[114,169,3],[111,166,3],[109,162,4],[107,159,4],[105,155,4],[103,152,4],[100,149,4],[98,145,4],[96,142,4],[94,138,5],[91,135,5],[89,132,5],[87,128,5],[85,125,5],[82,121,5],[80,118,5],[78,115,6],[76,111,6],[73,108,6],[71,105,6],[69,101,6],[67,98,6],[65,94,6],[62,91,7],[60,88,7],[58,84,7],[56,81,7],[53,77,7],[51,74,7],[49,71,7],[47,67,8],[44,64,8],[42,60,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8],[40,57,8]],qr=[[36,0,255],[36,0,255],[36,0,255],[36,0,255],[245,20,0],[245,24,0],[245,29,0],[245,31,0],[247,33,0],[247,33,0],[247,37,0],[247,41,0],[247,41,0],[247,41,0],[247,45,0],[247,45,0],[247,47,0],[247,49,0],[247,49,0],[247,54,0],[247,54,0],[247,56,0],[247,58,0],[247,58,0],[250,62,0],[250,62,0],[250,62,0],[250,67,0],[250,67,0],[250,67,0],[250,69,0],[250,71,0],[250,71,0],[250,75,0],[250,75,0],[250,78,0],[250,79,0],[250,79,0],[250,79,0],[250,81,0],[250,83,0],[250,83,0],[250,87,0],[250,87,0],[250,90,0],[250,92,0],[252,93,0],[252,93,0],[252,97,0],[252,97,0],[252,97,0],[252,97,0],[252,101,0],[252,101,0],[252,101,0],[252,101,0],[252,105,0],[252,105,0],[252,107,0],[252,109,0],[252,109,0],[252,113,13],[255,118,20],[255,119,23],[255,121,25],[255,126,33],[255,132,38],[255,133,40],[255,135,43],[255,141,48],[255,144,54],[255,150,59],[255,152,61],[255,153,64],[255,159,69],[255,163,77],[255,165,79],[255,168,82],[255,174,87],[255,176,92],[255,181,97],[255,183,99],[255,186,102],[255,191,107],[255,197,115],[255,201,120],[255,203,123],[255,205,125],[255,209,130],[255,214,138],[255,216,141],[255,218,143],[255,224,150],[255,228,156],[255,234,163],[255,236,165],[255,238,168],[255,243,173],[255,248,181],[255,252,186],[253,252,186],[250,252,187],[244,250,180],[238,247,176],[234,246,173],[231,245,169],[223,240,163],[217,237,157],[211,235,150],[205,233,146],[200,230,142],[195,227,136],[189,224,132],[184,222,126],[180,220,123],[174,217,119],[169,214,114],[163,212,108],[160,210,105],[154,207,101],[148,204,96],[143,201,93],[138,199,88],[134,197,84],[130,194,81],[126,191,77],[117,189,70],[115,186,68],[112,184,64],[106,181,60],[100,179,55],[94,176,49],[92,174,47],[90,173,45],[81,168,37],[75,166,33],[71,163,28],[66,160,24],[62,158,21],[56,156,14],[51,153,0],[51,153,0],[51,153,0],[50,150,0],[50,150,0],[50,150,0],[50,150,0],[49,148,0],[49,148,0],[49,148,0],[48,145,0],[48,145,0],[48,145,0],[48,145,0],[48,143,0],[48,143,0],[48,143,0],[48,143,0],[47,140,0],[47,140,0],[47,140,0],[47,140,0],[46,138,0],[46,138,0],[46,138,0],[46,138,0],[45,135,0],[45,135,0],[45,135,0],[45,135,0],[44,133,0],[44,133,0],[44,133,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[43,130,0],[42,128,0],[42,128,0],[42,128,0],[42,125,0],[42,125,0],[42,125,0],[42,125,0],[41,122,0],[41,122,0],[41,122,0],[41,122,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[40,120,0],[39,117,0],[39,117,0],[39,117,0],[39,117,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0],[38,115,0]];function qe(t,e){const n=[],s=[];for(let i=0;i[s,...n]),e):null}let tt=class extends z{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:e,colormapName:n,colorRamp:s,colorRampName:r}=this.functionArguments;if(!e?.length)if(s)this.colorRamp=s,e=ce(s,{interpolateAlpha:!0});else if(r){const o=Cs(r);o&&(e=ce(o),this.colorRamp=Ss(o))}else n&&(e=Zr(n));if(!e?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const i=this._getOutputPixelType(t.pixelType);this.outputPixelType=i.startsWith("f")?"s32":i;const a=t.clone();return a.pixelType=this.outputPixelType,a.colormap=e,a.bandCount=1,this.rasterInfo=a,{success:!0,supportsGPU:!0}}_processPixels(t){let e=t.pixelBlocks?.[0];return!e||W(e.pixelType)||(e=e.clone(),e.clamp(this.outputPixelType)),e}};c([m({json:{write:!0,name:"rasterFunction"}})],tt.prototype,"functionName",void 0),c([m({type:$r,json:{write:!0,name:"rasterFunctionArguments"}})],tt.prototype,"functionArguments",void 0),c([m()],tt.prototype,"rasterArgumentNames",void 0),c([m()],tt.prototype,"isNoopProcess",void 0),c([m({json:{write:!0}})],tt.prototype,"indexedColormap",void 0),c([m()],tt.prototype,"colorRamp",void 0),tt=c([F("esri.layers.support.rasterFunctions.ColormapFunction")],tt);const to=tt;var ye;let xe=ye=class extends D{clone(){return new ye({raster:this.raster})}};xe=ye=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunctionArguments")],xe);const eo=xe;let pt=class extends z{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||!t.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};const e=t.clone();e.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(e),e.bandCount=3,e.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=e;const n=[...t.colormap].sort((i,a)=>i[0]-a[0]),{indexedColormap:s,offset:r}=Ts({colormap:n});return s?(this.lookup={indexedColormap:s,offset:r},{success:!0,supportsGPU:Rs(s)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let e=t.pixelBlocks?.[0];if(!e||!this.lookup)return e;e=e.clone();const n=e.pixels[0],s=e.mask??new Uint8Array(n.length).fill(255),r=new Uint8Array(n.length),i=new Uint8Array(n.length),a=new Uint8Array(n.length),{indexedColormap:o,offset:u}=this.lookup,l=o.length;for(let h=0;hl-4?s[h]=0:(r[h]=o[p++],i[h]=o[p++],a[h]=o[p++])}return e.pixels=[r,i,a],e.statistics=[new oe(0,255),new oe(0,255),new oe(0,255)],e.pixelType=this.outputPixelType,e}_getWebGLParameters(){return this.lookup}};c([m({json:{write:!0,name:"rasterFunction"}})],pt.prototype,"functionName",void 0),c([m({type:eo,json:{write:!0,name:"rasterFunctionArguments"}})],pt.prototype,"functionArguments",void 0),c([m()],pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],pt.prototype,"lookup",void 0),pt=c([F("esri.layers.support.rasterFunctions.ColormapToRGBFunction")],pt);const so=pt;var we;let qt=we=class extends D{constructor(){super(...arguments),this.rasters=[]}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new we({rasters:H(this.rasters)})}};c([m({json:{write:!0}})],qt.prototype,"rasters",void 0),c([Lt("rasters")],qt.prototype,"writeRasters",null),qt=we=c([F("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],qt);const no=qt;let jt=class extends z{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();if(n.attributeTable=null,n.colormap=null,n.pixelType=this.outputPixelType,n.bandCount=t.map(({bandCount:r})=>r).reduce((r,i)=>r+i),t.every(({statistics:r})=>r!=null&&r.length)){const r=[];t.forEach(({statistics:i})=>i!=null&&r.push(...i)),n.statistics=r}if(t.every(({histograms:r})=>r!=null&&r.length)){const r=[];t.forEach(({histograms:i})=>i!=null&&r.push(...i)),n.histograms=r}n.multidimensionalInfo&&n.multidimensionalInfo.variables.forEach(r=>{const i=t.map(u=>u.multidimensionalInfo?.variables.find(({name:l})=>l===r.name)),a=i.map(u=>u?.statistics?.length?u.statistics:null),o=i.map(u=>u?.histograms?.length?u.histograms:null);r.statistics=a.every(u=>u!=null)?a.flat():null,r.histograms=o.every(u=>u!=null)?o.flat():null}),n.bandCount>1&&(n.colormap=null,n.attributeTable=null);const s=t.every(r=>r.keyProperties.BandProperties?.length)?t.flatMap(r=>r.keyProperties.BandProperties):void 0;return n.keyProperties={...n.keyProperties,BandProperties:s},this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e?e?.[0]==null?null:Ks(e):null}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};c([m({json:{write:!0,name:"rasterFunction"}})],jt.prototype,"functionName",void 0),c([m({type:no,json:{write:!0,name:"rasterFunctionArguments"}})],jt.prototype,"functionArguments",void 0),c([m()],jt.prototype,"rasterArgumentNames",void 0),jt=c([F("esri.layers.support.rasterFunctions.CompositeBandFunction")],jt);const ro=jt,oo=new Q({0:"difference",1:"relative-difference",2:"categorical",3:"euclidean-distance",4:"angle-difference",5:"band-with-most-change"},{useNumericKeys:!0}),io=new Q({0:"all",1:"changed",2:"unchanged"},{useNumericKeys:!0});function ao(t,e,n,s){const[r,i]=t,a=W(n)&&!W(r.pixelType)&&!W(i.pixelType),o=[r.mask,i.mask].filter(y=>y),u=A.combineBandMasks(o),l=t.map(y=>y.pixels[0]),{width:h,height:p}=r,f=A.createEmptyBand(n,h*p);switch(e){case"difference":case"relative-difference":uo({bands:l,mask:u,outBand:f,isRoundingNeeded:a,isRelative:e==="relative-difference"});break;case"categorical":lo({bands:l,mask:u,outBand:f,...s});break;case"euclidean-distance":co({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"angle-difference":po({pixels:t.map(y=>y.pixels),mask:u,outBand:f});break;case"band-with-most-change":ho({pixels:t.map(y=>y.pixels),mask:u,outBand:f})}const g=new A({width:h,height:p,pixels:[f],pixelType:n,mask:u});return g.updateStatistics(),g}function uo(t){const{bands:[e,n],mask:s,isRelative:r,isRoundingNeeded:i,outBand:a}=t,o=e.length;for(let u=0;u0?l/h:0}a[u]=i?Math.round(l):l}}function lo(t){const{bands:[e,n],categoryIndexLookups:[s,r],classNames:[i,a],mask:o,keepMethod:u,outBand:l}=t,h=e.length,p=i.length,f=a.length,g=p*f,y=g+1,x=g+2;for(let d=0;du&&(u=p,l=h)}r[o]=l}}var ve;let ht=ve=class extends D{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new ve({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};c([K(oo)],ht.prototype,"method",void 0),c([K(io)],ht.prototype,"keepMethod",void 0),c([m({json:{write:!0}})],ht.prototype,"raster2",void 0),c([m({readOnly:!0})],ht.prototype,"rasters",null),ht=ve=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunctionArguments")],ht);const mo=ht;let mt=class extends z{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{method:t}=this.functionArguments,e=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),t==="categorical"){const n=this.sourceRasterInfos.map(i=>i.attributeTable),s=this._getFieldNames(n,"value"),r=n.map(i=>this._getClassFieldName(i));if(s[0]==null||s[1]==null||r[0]==null||r[1]==null)return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(e,s,r)}return e.bandCount=1,this.rasterInfo=e,{success:!0,supportsGPU:t==="difference"||t==="relative-difference"}}_processPixels(t){const{pixelBlocks:e}=t;if(e?.[0]==null||e?.[1]==null)return null;const{method:n}=this.functionArguments;return ao(e,n,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){const t=this.outputPixelType??"f32";let[e,n]=kt(t);const s=W(t);return s&&(e-=1e-4,n+=1e-4),{method:this.functionArguments.method,domainRange:[e,n],isOutputRounded:s}}_updateAttributeTable(t,e,n){const s=this.sourceRasterInfos.map(b=>b.attributeTable),r=s.map((b,T)=>b.features.map(N=>N.attributes[e[T]])),i=s.map((b,T)=>b.features.map(N=>N.attributes[n[T]])),a=r.map(b=>{const T=[];return b.forEach((N,P)=>T[N]=P),T}),{keepMethod:o}=this.functionArguments;this._categoryConfig={categoryIndexLookups:a,classNames:i,keepMethod:o};const u=s[0].clone();u.fields=[new nt({name:"OID",type:"oid"}),new nt({name:"Value",type:"integer"}),new nt({name:"ClassName",type:"string"}),new nt({name:"Class_From",type:"string"}),new nt({name:"Class_To",type:"string"})];const l=this._getFieldNames(s,"red"),h=this._getFieldNames(s,"green"),p=this._getFieldNames(s,"blue"),f=[],g=l.length===2&&h.length===2&&p.length===2;g&&(f.push(...s.map((b,T)=>b.features.map(N=>[N.attributes[l[T]],N.attributes[h[T]],N.attributes[p[T]]]))),u.fields.push(new nt({name:"Red",type:"integer"}),new nt({name:"Green",type:"integer"}),new nt({name:"Blue",type:"integer"})));const y=u.features[0].clone();y.geometry=null;const x=[],[d,v]=r.map(b=>b.length);let w=1;for(let b=0;b ${P}`,Class_From:T,Class_To:P},g&&(C.attributes.Red=f[0][b][0]+f[1][N][0]>>1,C.attributes.Green=f[0][b][1]+f[1][N][1]>>1,C.attributes.Blue=f[0][b][2]+f[1][N][2]>>1),x.push(C)}}if(o==="changed"){const b=y.clone();b.attributes={OID:w++,Value:d*v+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},x.push(b)}else if(o==="unchanged"){const b=y.clone();b.attributes={OID:w++,Value:d*v+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},x.push(b)}u.features=x,t.attributeTable=u}_getFieldNames(t,e){return t.map(({fields:n})=>n.find(s=>s.name.toLowerCase()===e)?.name).filter(n=>n)}_getClassFieldName(t){return(t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().startsWith("class"))??t.fields.find(e=>e.type==="string"&&e.name.toLowerCase().includes("class")||e.name.toLowerCase().includes("type")||e.name.toLowerCase().includes("name"))??t.fields.find(e=>e.type==="string"))?.name}};c([m({json:{write:!0,name:"rasterFunction"}})],mt.prototype,"functionName",void 0),c([m({type:mo,json:{write:!0,name:"rasterFunctionArguments"}})],mt.prototype,"functionArguments",void 0),c([m()],mt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],mt.prototype,"_categoryConfig",void 0),mt=c([F("esri.layers.support.rasterFunctions.ComputeChangeFunction")],mt);const fo=mt;var be;let Kt=be=class extends D{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new be({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};c([m({json:{write:!0}})],Kt.prototype,"contrastOffset",void 0),c([m({json:{write:!0}})],Kt.prototype,"brightnessOffset",void 0),Kt=be=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunctionArguments")],Kt);const go=Kt;let ft=class extends z{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];if(e.pixelType!=="u8")return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const n=e.clone();this._removeStatsHistColormapVAT(n),this.rasterInfo=n;const{contrastOffset:s,brightnessOffset:r}=this.functionArguments;return this.lookup=on(s,r),{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:We(e,{lut:e.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:e}=this.functionArguments;return{contrastOffset:t,brightnessOffset:e}}};c([m({json:{write:!0,name:"rasterFunction"}})],ft.prototype,"functionName",void 0),c([m({type:go,json:{write:!0,name:"rasterFunctionArguments"}})],ft.prototype,"functionArguments",void 0),c([m()],ft.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ft.prototype,"lookup",void 0),ft=c([F("esri.layers.support.rasterFunctions.ContrastBrightnessFunction")],ft);const yo=ft;function Ke(t,e,n,s,r){const i=Math.floor(s/2);for(let o=0;os+r);return e===-1||n===0||n===1?t:t.map(s=>s/n)}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:n,kernel:s}=this.functionArguments;if(!Object.values(S).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==S.none&&e*n!==s.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const r=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(r.pixelType);const i=r.clone();i.pixelType=this.outputPixelType;const a=[S.none,S.sharpen,S.sharpen2,S.sharpening3x3,S.sharpening5x5];return(t===-1||this.outputPixelType!=="u8"&&!a.includes(t))&&(i.statistics=null,i.histograms=null),i.colormap=null,i.attributeTable=null,this.rasterInfo=i,{success:!0,supportsGPU:s.length<=ys}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null||this.functionArguments.convolutionType===S.none)return e;const{rows:n,cols:s}=this.functionArguments,{_normalizedKernel:r}=this;return Ao(e,{kernel:r,rows:n,cols:s,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(ys);return t.set(this._normalizedKernel),{kernelRows:this.functionArguments.rows,kernelCols:this.functionArguments.cols,kernel:t,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],gt.prototype,"functionName",void 0),c([m({type:To,json:{write:!0,name:"rasterFunctionArguments"}})],gt.prototype,"functionArguments",void 0),c([m()],gt.prototype,"rasterArgumentNames",void 0),c([m()],gt.prototype,"_normalizedKernel",null),gt=c([F("esri.layers.support.rasterFunctions.ConvolutionFunction")],gt);const Po=gt;var Te;const Os=new Q({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let Mt=Te=class extends D{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(t,e){return Os.fromJSON(e.type??e.curvatureType??0)}clone(){return new Te({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};c([m({json:{write:{target:"type"}}}),K(Os)],Mt.prototype,"curvatureType",void 0),c([It("curvatureType",["type","curvatureType"])],Mt.prototype,"readCurvatureType",null),c([m({type:Number,json:{write:!0}})],Mt.prototype,"zFactor",void 0),Mt=Te=c([F("esri.layers.support.rasterFunctions.CurvatureFunctionArguments")],Mt);const Fo=Mt;let yt=class extends z{constructor(){super(...arguments),this.functionName="Curvature",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,t.bandCount=1,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,curvatureType:s}=this.functionArguments,{extent:r,primaryPixelSizes:i}=t,a=i?.[0],o=a??(r?{x:r.width/e.width,y:r.height/e.height}:{x:1,y:1}),u=this.isGCS&&n>=1?n*Yt:n;return an(e,{zFactor:u,curvatureType:s,resolution:o})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*Yt:t}}};c([m({json:{write:!0,name:"rasterFunction"}})],yt.prototype,"functionName",void 0),c([m({type:Fo,json:{write:!0,name:"rasterFunctionArguments"}})],yt.prototype,"functionArguments",void 0),c([m()],yt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],yt.prototype,"isGCS",void 0),yt=c([F("esri.layers.support.rasterFunctions.CurvatureFunction")],yt);const No=yt;var Pe;let et=Pe=class extends D{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=Ps.bestMatch}clone(){return new Pe({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};c([m({json:{write:!0}})],et.prototype,"bandIds",void 0),c([m({json:{write:!0}})],et.prototype,"bandNames",void 0),c([m({json:{write:!0}})],et.prototype,"bandWavelengths",void 0),c([K({0:"name",1:"wavelength",2:"id"})],et.prototype,"method",void 0),c([m({json:{write:!0}})],et.prototype,"missingBandAction",void 0),c([m({json:{write:!0}})],et.prototype,"wavelengthMatchTolerance",void 0),et=Pe=c([F("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],et);const Co=et;let Gt=class extends z{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:e}=this,n=e[0],{method:s,bandNames:r,bandWavelengths:i,bandIds:a,missingBandAction:o}=t,u=r?.length&&(s==="name"||s!=="id"&&!a?.length),l=i?.length&&(s==="wavelength"||s!=="id"&&!a?.length),h=o===Ps.fail,p=u?Io(n,r):l?_o(n,i,this.functionArguments,h):ko(n,a,h);if(p==null)return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${u?"band names":l?"band wavelengths":"band ids"} for the imagery data source`};this.functionArguments.bandIds=p,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const f=n.clone();f.pixelType=this.outputPixelType,f.bandCount=p.length;const{statistics:g,histograms:y}=f;g!=null&&g.length&&(f.statistics=p.map(d=>g[d]||g[g.length-1])),y!=null&&y.length&&(f.histograms=p.map(d=>y[d]||y[y.length-1])),f.multidimensionalInfo&&f.multidimensionalInfo.variables.forEach(d=>{const{statistics:v,histograms:w}=d;v!=null&&v.length&&(d.statistics=p.map(b=>v[b]||v[v.length-1])),w!=null&&w.length&&(d.histograms=p.map(b=>w[b]||w[w.length-1]))});let x=f.keyProperties?.BandProperties;return x?.length&&(x=p.map(d=>d>=x.length?x[x.length-1]:x[d]),f.keyProperties={...f.keyProperties,BandProperties:x}),this.rasterInfo=f,{success:!0,supportsGPU:f.bandCount<=3}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const n=e.pixels.length,s=this.functionArguments.bandIds.map(r=>r>=n?n-1:r);return e.extractBands(s)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],t.length===0?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let e=0;e<3;e++)t[e]=Math.min(t[e],2)}return{bandIndexMat3:V(t)}}_getInputBandIds(t){const e=t.length;return this.functionArguments.bandIds.map(n=>n>=e?e-1:n).map(n=>t[n])}};c([m({json:{write:!0,name:"rasterFunction"}})],Gt.prototype,"functionName",void 0),c([m({type:Co,json:{write:!0,name:"rasterFunctionArguments"}})],Gt.prototype,"functionArguments",void 0),c([m()],Gt.prototype,"rasterArgumentNames",void 0),Gt=c([F("esri.layers.support.rasterFunctions.ExtractBandFunction")],Gt);const Ro=Gt;function Io(t,e){const n=t.bandInfos.map(({name:r})=>r.toLowerCase()),s=[];for(let r=0;ro.startsWith("nearinfrared_1")),a===-1&&(a=n.findIndex(o=>o.startsWith("nearinfrared")))),a===-1)return null;s.push(a)}return s}function ko(t,e,n){const{bandCount:s}=t;return!e?.length||n&&e.some(r=>r<0||r>=s)?null:e}function _o(t,e,{wavelengthMatchTolerance:n},s){const{bandInfos:r}=t,i=[];for(let o=0;o=g.minWavelength&&u<=g.maxWavelength,x=Math.abs(u-(g.minWavelength+g.maxWavelength)/2);y?xy?y:Tn+s);return t.map(n=>n/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const n=t.length===3||e.bandCount===3&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:n}}_processPixels(t){const e=t.pixelBlocks?.[0];return e==null?null:So(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};c([m({json:{write:!0,name:"rasterFunction"}})],xt.prototype,"functionName",void 0),c([m({type:Bo,json:{write:!0,name:"rasterFunctionArguments"}})],xt.prototype,"functionArguments",void 0),c([m()],xt.prototype,"rasterArgumentNames",void 0),c([m()],xt.prototype,"_normalizedWeights",null),xt=c([F("esri.layers.support.rasterFunctions.GrayscaleFunction")],xt);const jo=xt;var Ne;const Mo=new Q({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),Go=new Q({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let X=Ne=class extends D{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}clone(){return new Ne({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([m({type:Number,json:{write:!0}})],X.prototype,"altitude",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"azimuth",void 0),c([m(),K(Mo)],X.prototype,"hillshadeType",void 0),c([m({type:Number,json:{write:!0,name:"psPower"}})],X.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{write:!0,name:"psZFactor"}})],X.prototype,"pixelSizeFactor",void 0),c([m(),K(Go)],X.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],X.prototype,"zFactor",void 0),c([m({type:Boolean,json:{write:!0}})],X.prototype,"removeEdgeEffect",void 0),X=Ne=c([F("esri.layers.support.rasterFunctions.HillshadeFunctionArguments")],X);const Ds=X;let wt=class extends z{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone();return this._removeStatsHistColormapVAT(e),e.pixelType=this.outputPixelType,e.bandCount=1,e.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e)return null;const{extent:n,primaryPixelSizes:s}=t,r=s?.[0],i=r??(n?{x:n.width/e.width,y:n.height/e.height}:{x:1,y:1}),a=ee(this.functionArguments,i,this.isGCS),o=Is(e,a);return o.pixelType=this.outputPixelType,o}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",o=W(this.outputPixelType);return{...e,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,isOutputRounded:o}}};c([m({json:{write:!0,name:"rasterFunction"}})],wt.prototype,"functionName",void 0),c([m({type:Ds,json:{write:!0,name:"rasterFunctionArguments"}})],wt.prototype,"functionArguments",void 0),c([m()],wt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],wt.prototype,"isGCS",void 0),wt=c([F("esri.layers.support.rasterFunctions.HillshadeFunction")],wt);const zo=wt;var Ce;let vt=Ce=class extends D{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(t,e){e.rasters=t.map(n=>typeof n=="number"||typeof n=="string"?n:n.toJSON())}clone(){return new Ce({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:H(this.rasters)})}};c([m({json:{write:!0}})],vt.prototype,"operation",void 0),c([m({json:{write:!0}})],vt.prototype,"rasters",void 0),c([Lt("rasters")],vt.prototype,"writeRasters",null),c([m({json:{write:!0}})],vt.prototype,"processAsMultiband",void 0),vt=Ce=c([F("esri.layers.support.rasterFunctions.LocalFunctionArguments")],vt);const Oo=vt;let zt=class extends z{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0],{bandCount:n}=e,{processAsMultiband:s}=this.functionArguments;if(t.some(u=>u.bandCount!==n))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:r,rasters:i}=this.functionArguments,a=es[r];if(!(a===999||i.length===a||i.length<=1&&a===1))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${a}`};const o=e.clone();return o.bandCount=a!==999||s?n:1,this._removeStatsHistColormapVAT(o),this._updateStatistics(o),this._updatePixelType(o),this.rasterInfo=o,{success:!0,supportsGPU:o.bandCount===1&&a<=3}}_processPixels(t){const{pixelBlocks:e}=t;return e==null||e.some(n=>n==null)?null:zs(e,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=es[t],n=Object.keys(Ze).find(o=>Ze[o]===t)?.toLowerCase()??"undefined",s=this.outputPixelType??"f32";let[r,i]=kt(s);const a=W(s);return a&&(r-=1e-4,i+=1e-4),{imageCount:e,operationName:n,domainRange:[r,i],isOutputRounded:a}}_updateStatistics(t){const e=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,s=ts(n)?.domain;if(s){t.statistics=[];for(let r=0;r({min:-r.max,max:-r.min,avg:r.avg!=null?-r.avg:void 0,stddev:r.stddev!=null?-r.stddev:void 0})))}_updatePixelType(t){const{statistics:e,pixelType:n}=this.sourceRasterInfos[0],{operation:s}=this.functionArguments,{domain:r,isInteger:i}=ts(s)??{domain:null,isInteger:!1};let a="f32";if(r&&i)a=ie(r[0],r[1]);else if(s===30){const o=e?.[0];a=o?ie(o.min,o.max):W(n)?n:"s32"}else if(s===45&&W(n)){const o=e?.map(({max:p})=>-p),u=e?.map(({min:p})=>-p),l=o?.length?Math.min(...o):null,h=u?.length?Math.min(...u):null;a=l!=null&&h!=null?ie(l,h):n.startsWith("s")?n.replace("s","u"):n==="u1"||n==="u2"||n==="u4"?"s8":n==="u8"?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(a)}};c([m({json:{write:!0,name:"rasterFunction"}})],zt.prototype,"functionName",void 0),c([m({type:Oo,json:{write:!0,name:"rasterFunctionArguments"}})],zt.prototype,"functionArguments",void 0),c([m()],zt.prototype,"rasterArgumentNames",void 0),zt=c([F("esri.layers.support.rasterFunctions.LocalFunction")],zt);const Do=zt;var Re;let bt=Re=class extends D{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=Fs.matchAny}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map(s=>{if(typeof s=="number")return e=!0,[s];if(typeof s=="string"){const r=s.trim().split(" ").filter(i=>i.trim()!=="").map(i=>Number(i));return e=e||r.length>0,r.length===0?null:r}return null});return e?n:null}clone(){return new Re({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};c([m({json:{write:!0}})],bt.prototype,"includedRanges",void 0),c([m({json:{write:!0}})],bt.prototype,"noDataValues",void 0),c([m()],bt.prototype,"normalizedNoDataValues",null),c([m({json:{write:!0}})],bt.prototype,"noDataInterpretation",void 0),bt=Re=c([F("esri.layers.support.rasterFunctions.MaskFunctionArguments")],bt);const Eo=bt;let At=class extends z{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:n,normalizedNoDataValues:s}=this.functionArguments;if(!n?.length&&!s?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let r=[];for(let a=0;aa?.length===s[0]?.length);return{success:!0,supportsGPU:(!n||n.length<=2*st)&&(!s||i&&s[0].length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{outputPixelType:n,lookups:s}=this,{includedRanges:r,noDataInterpretation:i,normalizedNoDataValues:a}=this.functionArguments,o=i===Fs.matchAll;return Js(e,{includedRanges:r,noDataValues:a,outputPixelType:n,matchAll:o,lookups:s})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:e}=this.functionArguments,n=new Float32Array(st);n.fill(Vt),e?.[0]?.length&&n.set(e[0]);const s=new Float32Array(st);for(let r=0;r=s.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};const i=s.clone();i.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(i),i.bandCount=1,i.keyProperties={...i.keyProperties,BandProperties:void 0};const[a,o,u,l]=t?[-1,1,0,.1]:[0,200,100,10];return i.statistics=[{min:a,max:o,avg:u,stddev:l}],this.rasterInfo=i,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{visibleBandID:n,infraredBandID:s,scientificOutput:r}=this.functionArguments;return xr(e,n,s,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:e,scientificOutput:n}=this.functionArguments,s=this.isInputBandIdsSwizzled?[0,1,2]:[e,t,0];return{bandIndexMat3:V(s),scaled:!n}}_getInputBandIds(t){const{visibleBandID:e,infraredBandID:n}=this.functionArguments;return[n,e,0].map(s=>t[s])}};c([m({json:{write:!0,name:"rasterFunction"}})],Dt.prototype,"functionName",void 0),c([m({type:Vo,json:{write:!0,name:"rasterFunctionArguments"}})],Dt.prototype,"functionArguments",void 0),c([m()],Dt.prototype,"rasterArgumentNames",void 0),Dt=c([F("esri.layers.support.rasterFunctions.NDVIFunction")],Dt);const Lo=Dt;var ke;let rt=ke=class extends D{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1,this.isLastInputRangeInclusive=!1}clone(){return new ke({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched,isLastInputRangeInclusive:this.isLastInputRangeInclusive})}};c([m({json:{write:!0}})],rt.prototype,"inputRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"outputValues",void 0),c([m({json:{write:!0}})],rt.prototype,"noDataRanges",void 0),c([m({json:{write:!0}})],rt.prototype,"allowUnmatched",void 0),c([m({json:{write:!0}})],rt.prototype,"isLastInputRangeInclusive",void 0),rt=ke=c([F("esri.layers.support.rasterFunctions.RemapFunctionArguments")],rt);const Wo=rt;let Tt=class extends z{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.bandCount=1;const{statistics:n}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:s,outputValues:r,inputRanges:i,noDataRanges:a,isLastInputRangeInclusive:o}=this.functionArguments;if(n!=null&&n.length&&r?.length)if(s){const u=Math.min.apply(null,[...r,n[0].min]),l=Math.max.apply(null,[...r,n[0].max]);t.statistics=[{...n[0],min:u,max:l}]}else{let u=r[0],l=u;for(let h=0;hr[h]?r[h]:u,l=l>r[h]?l:r[h];t.statistics=[{...n[0],min:u,max:l}]}return this.rasterInfo=t,this.lookup=s?null:Ys({srcPixelType:e,inputRanges:i,outputValues:r,noDataRanges:a,allowUnmatched:s,isLastInputRangeInclusive:o,outputPixelType:this.outputPixelType}),{success:!0,supportsGPU:(!r||r.length<=st)&&(!a||a.length<=st)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{lookup:n,outputPixelType:s}=this;if(n){const l=We(e,{lut:[n.lut],offset:n.offset,outputPixelType:s});return l!=null&&n.mask&&(l.mask=Qs(e.pixels[0],e.mask,n.mask,n.offset,"u8")),l}const{inputRanges:r,outputValues:i,noDataRanges:a,allowUnmatched:o,isLastInputRangeInclusive:u}=this.functionArguments;return Zs(e,{inputRanges:r,outputValues:i,noDataRanges:a,outputPixelType:s,allowUnmatched:o,isLastInputRangeInclusive:u})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:e,isLastInputRangeInclusive:n}=this.functionArguments,s=new Float32Array(3*st),r=1e-5,i=this.functionArguments.inputRanges??[],a=this.functionArguments.outputValues??[],o=a.length;for(let l=0;l0&&(s[3*l]-=r),(ln.toLowerCase()===t.toLowerCase());return e?Cs(Rt.fromJSON(e)):null}return"toJSON"in t?t.toJSON():t}clone(){return new _e({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,slopeType:this.slopeType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,removeEdgeEffect:this.removeEdgeEffect,colorRamp:this.colorRamp,colormap:this.colormap,raster:this.raster})}};c([m({json:{write:!0}})],Et.prototype,"colorRamp",void 0),c([It("colorRamp")],Et.prototype,"readColorRamp",null),c([m({type:[[Number]],json:{write:!0}})],Et.prototype,"colormap",void 0),Et=_e=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunctionArguments")],Et);const Ho=Et;let ot=class extends z{constructor(){super(...arguments),this.functionName="ShadedRelief",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: source data must be single band"};let{colorRamp:e,colormap:n}=this.functionArguments;if(!e&&!n?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a color ramp argument must be specified"};this.outputPixelType=this._getOutputPixelType("u8");const s=t.clone();this._removeStatsHistColormapVAT(s),s.pixelType=this.outputPixelType,s.bandCount=3,s.statistics=[{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10},{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=s,this.isGCS=s.spatialReference?.isGeographic??!1,n?.length||(n=ce(e,{interpolateAlpha:!0}));const{indexedColormap:r,offset:i}=Ts({colormap:n});if(!r?.length)return{success:!1,supportsGPU:!1,error:"shadedrelief-function: a valid colorramp is required"};const a=un(r);return this.lookup={indexedColormap:r,offset:i,hsvMap:a},{success:!0,supportsGPU:Rs(r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e||!this.lookup)return null;let n=t.primaryPixelSizes?.[0];if(n==null){const{extent:a}=t;n=a?{x:a.width/e.width,y:a.height/e.height}:{x:1,y:1}}const s=ee(this.functionArguments,n,this.isGCS),r=Is(e,s),i=this.sourceRasterInfos[0].statistics?.[0]??{min:0,max:8e3};return ln(r,e,this.lookup.hsvMap,i),r.pixelType=this.outputPixelType,r}_getWebGLParameters(){const t=ee(this.functionArguments,{x:1,y:1},this.isGCS),e=ks(t),{slopeType:n,zFactor:s,pixelSizeFactor:r,pixelSizePower:i}=this.functionArguments,a=n==="scaled",{indexedColormap:o,offset:u}=this.lookup,l=this.sourceRasterInfos[0].statistics?.[0],h=W(this.outputPixelType);return{...e,indexedColormap:o,offset:u,zFactor:s,gcsFactor:this.isGCS?Yt:1,pixelSizeFactor:a?r:0,pixelSizePower:a?i:0,minValue:l?.min??0,maxValue:l?.max??8e3,isOutputRounded:h}}};c([m({json:{write:!0,name:"rasterFunction"}})],ot.prototype,"functionName",void 0),c([m({type:Ho,json:{write:!0,name:"rasterFunctionArguments"}})],ot.prototype,"functionArguments",void 0),c([m()],ot.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],ot.prototype,"isGCS",void 0),c([m({json:{write:!0}})],ot.prototype,"lookup",void 0),ot=c([F("esri.layers.support.rasterFunctions.ShadedReliefFunction")],ot);const qo=ot;var Se;const Ko=new Q({1:"degree",2:"percent-rise",3:"adjusted"},{useNumericKeys:!0});let it=Se=class extends D{constructor(){super(...arguments),this.slopeType="degree",this.zFactor=1,this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.removeEdgeEffect=!1}clone(){return new Se({slopeType:this.slopeType,zFactor:this.zFactor,pixelSizePower:this.pixelSizePower,pixelSizeFactor:this.pixelSizeFactor,removeEdgeEffect:this.removeEdgeEffect,raster:this.raster})}};c([K(Ko)],it.prototype,"slopeType",void 0),c([m({type:Number,json:{write:!0}})],it.prototype,"zFactor",void 0),c([m({type:Number,json:{name:"psPower",write:!0}})],it.prototype,"pixelSizePower",void 0),c([m({type:Number,json:{name:"psZFactor",write:!0}})],it.prototype,"pixelSizeFactor",void 0),c([m({type:Boolean,json:{write:!0}})],it.prototype,"removeEdgeEffect",void 0),it=Se=c([F("esri.layers.support.rasterFunctions.SlopeFunctionArguments")],it);const Xo=it;let Pt=class extends z{constructor(){super(...arguments),this.functionName="Slope",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const t=this.sourceRasterInfos[0].clone();return t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),t.statistics=this.functionArguments.slopeType!=="percent-rise"?[{min:0,max:90,avg:1,stddev:1}]:null,t.bandCount=1,this.rasterInfo=t,this.isGCS=t.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return null;const{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i}=this.functionArguments,{isGCS:a}=this,{extent:o,primaryPixelSizes:u}=t,l=u?.[0],h=l??(o?{x:o.width/e.width,y:o.height/e.height}:{x:1,y:1});return cn(e,{zFactor:n,slopeType:s,pixelSizePower:r,pixelSizeFactor:i,isGCS:a,resolution:h})}_getWebGLParameters(){const{zFactor:t,slopeType:e,pixelSizeFactor:n,pixelSizePower:s}=this.functionArguments;return{zFactor:this.isGCS&&t>=1?t*Yt:t,slopeType:e,pixelSizeFactor:n??0,pixelSizePower:s??0,isOutputRounded:W(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Pt.prototype,"functionName",void 0),c([m({type:Xo,json:{write:!0,name:"rasterFunctionArguments"}})],Pt.prototype,"functionArguments",void 0),c([m()],Pt.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],Pt.prototype,"isGCS",void 0),Pt=c([F("esri.layers.support.rasterFunctions.SlopeFunction")],Pt);const Jo=Pt,xs=new Q({1:"min",2:"max",3:"mean",4:"stddev",5:"median",6:"majority",7:"minority"},{useNumericKeys:!0});function Yo(t,e){const{fillNoDataOnly:n}=e,{band:s,width:r,height:i,mask:a,outBand:o}=t;if(n&&!a)return void o.set(s);const{statisticsType:u,kernelRows:l,kernelCols:h}=e,p=u==="stddev",f=r*i,g=new Float64Array(f),y=new Float64Array(f),x=new Uint32Array(f);for(let P=0;Pw-b),a?(f[x+d]=v[Math.floor((v.length-1)/2)],g[x+d]=v.length):o[x+d]=v[Math.floor((v.length-1)/2)])}}if(a)for(let y=h;yP&&(P=N,T=C);a?(y[v+w]=T,x[v+w]=b.size):o[v+w]=T}}if(a)for(let d=h;d1&&o?.length&&(w=A.combineBandMasks(o));const b=new A({pixelType:d,width:i,height:a,pixels:p,bandMasks:o&&v.length?v:null,mask:w});return b.updateStatistics(),b}var Be;let Ft=Be=class extends D{constructor(){super(...arguments),this.rows=3,this.cols=3,this.fillNoDataOnly=!1,this.statisticsType="min"}clone(){return new Be({rows:this.rows,cols:this.cols,fillNoDataOnly:this.fillNoDataOnly,statisticsType:this.statisticsType,raster:H(this.raster)})}};c([m({json:{write:!0,read:{source:["kernelRows","rows"],reader:(t,e)=>Number(t??e?.kernelRows??3)}}})],Ft.prototype,"rows",void 0),c([m({json:{write:!0,read:{source:["kernelCols","cols"],reader:(t,e)=>Number(t??e?.kernelCols??3)}}})],Ft.prototype,"cols",void 0),c([m({json:{write:!0}})],Ft.prototype,"fillNoDataOnly",void 0),c([m({json:{read:{source:["statisticsType","type"],reader:(t,e)=>xs.fromJSON(e?.statisticsType??e?.type)??"min"},write:{target:"type"}}}),K(xs)],Ft.prototype,"statisticsType",void 0),Ft=Be=c([F("esri.layers.support.rasterFunctions.StatisticsFunctionArguments")],Ft);const si=Ft;let Ut=class extends z{constructor(){super(...arguments),this.functionName="Statistics",this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{type:t}=this.functionArguments.toJSON();if(t<1||t>7)return{success:!1,supportsGPU:!1,error:`statistics-function: the given statistics type is not supported ${t}`};const e=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const n=e.clone();n.pixelType=this.outputPixelType;const{statisticsType:s}=this.functionArguments;return s==="stddev"&&this._removeStatsHistColormapVAT(n),this.rasterInfo=n,{success:!0,supportsGPU:n.bandCount<=3&&t<5}}_processPixels(t){const e=t.pixelBlocks?.[0];if(e==null)return e;const{statisticsType:n,rows:s,cols:r,fillNoDataOnly:i}=this.functionArguments;return ei(e,{kernelRows:s,kernelCols:r,fillNoDataOnly:i,outputPixelType:this.outputPixelType,statisticsType:n,mirrorEdges:!0})}_getWebGLParameters(){const{rows:t,cols:e,statisticsType:n,fillNoDataOnly:s}=this.functionArguments;return{fillNoDataOnly:s,kernelRows:t,kernelCols:e,statisticsType:n,clampRange:kt(this.outputPixelType)}}};c([m({json:{write:!0,name:"rasterFunction"}})],Ut.prototype,"functionName",void 0),c([m({type:si,json:{write:!0,name:"rasterFunctionArguments"}})],Ut.prototype,"functionArguments",void 0),c([m()],Ut.prototype,"rasterArgumentNames",void 0),Ut=c([F("esri.layers.support.rasterFunctions.StatisticsFunction")],Ut);const ni=Ut;var je;let Nt=je=class extends D{constructor(){super(...arguments),this.statistics=null,this.histograms=null}readStatistics(t,e){if(!t?.length)return null;const n=[];return t.forEach(s=>{const r={min:s.min,max:s.max,avg:s.avg??s.mean,stddev:s.stddev??s.standardDeviation};n.push(r)}),n}writeStatistics(t,e,n){if(!t?.length)return;const s=[];t.forEach(r=>{const i={...r,mean:r.avg,standardDeviation:r.stddev};delete i.avg,delete i.stddev,s.push(i)}),e[n]=s}clone(){return new je({statistics:H(this.statistics),histograms:H(this.histograms)})}};c([m({json:{write:!0}})],Nt.prototype,"statistics",void 0),c([It("statistics")],Nt.prototype,"readStatistics",null),c([Lt("statistics")],Nt.prototype,"writeStatistics",null),c([m({json:{write:!0}})],Nt.prototype,"histograms",void 0),Nt=je=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunctionArguments")],Nt);const ri=Nt;let at=class extends z{constructor(){super(...arguments),this.functionName="StatisticsHistogram",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone(),{statistics:n,histograms:s}=this.functionArguments;return s&&(e.histograms=s),n&&(e.statistics=n),this.rasterInfo=e,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],at.prototype,"functionName",void 0),c([m({type:ri,json:{write:!0,name:"rasterFunctionArguments"}})],at.prototype,"functionArguments",void 0),c([m()],at.prototype,"rasterArgumentNames",void 0),c([m({json:{write:!0}})],at.prototype,"indexedColormap",void 0),c([m()],at.prototype,"isNoopProcess",void 0),at=c([F("esri.layers.support.rasterFunctions.StatisticsHistogramFunction")],at);const oi=at;var Me;const ii=new Q({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",9:"sigmoid"},{useNumericKeys:!0});let L=Me=class extends D{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,e,n){t?.length&&(Array.isArray(t[0])||(t=t.map(s=>[s.min,s.max,s.avg,s.stddev])),e[n]=t)}clone(){return new Me({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:H(this.statistics),gamma:H(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:H(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};c([m({type:Boolean,json:{write:!0}})],L.prototype,"computeGamma",void 0),c([m({type:Boolean,json:{name:"dra",write:!0}})],L.prototype,"dynamicRangeAdjustment",void 0),c([m({type:[Number],json:{write:!0}})],L.prototype,"gamma",void 0),c([m()],L.prototype,"histograms",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"maxPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"minPercent",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"numberOfStandardDeviations",void 0),c([m({type:Number,json:{name:"max",write:!0}})],L.prototype,"outputMax",void 0),c([m({type:Number,json:{name:"min",write:!0}})],L.prototype,"outputMin",void 0),c([m({type:Number,json:{write:!0}})],L.prototype,"sigmoidStrengthLevel",void 0),c([m({json:{type:[[Number]],write:!0}})],L.prototype,"statistics",void 0),c([Lt("statistics")],L.prototype,"writeStatistics",null),c([K(ii)],L.prototype,"stretchType",void 0),c([m({type:Boolean,json:{write:!0}})],L.prototype,"useGamma",void 0),L=Me=c([F("esri.layers.support.rasterFunctions.StretchFunctionArguments")],L);const ai=L;let ut=class extends z{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:e}=t,{functionArguments:n}=this,{dynamicRangeAdjustment:s,gamma:r,useGamma:i}=n;if(!s&&["u8","u16","s8","s16"].includes(e)){const l=ae(n.toJSON(),{rasterInfo:t}),h=W(this.outputPixelType)?"round":"float";this.lookup=pn({pixelType:e,...l,gamma:i?r:null,rounding:h}),this.cutOffs=l}else s||(this.cutOffs=ae(n.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(e);const a=t.clone();a.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(a),this.outputPixelType==="u8"&&(a.keyProperties.DataType="processed");const{outputMin:o=0,outputMax:u=255}=this.functionArguments;a.statistics=[];for(let l=0;l=2?3:1,i=s&&n?.length?mn(r,n):[1,1,1],{minCutOff:a,maxCutOff:o}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};a.length===1&&(a[1]=a[2]=a[0],o[1]=o[2]=o[0]);const u=new Float32Array(r);let l;for(l=0;l1||t.pixelType.startsWith("f"))return{success:!1,supportsGPU:!1,error:"table-function: Source data must be single band and integer pixel type."};const{attributeTableAsRecordSet:e}=this.functionArguments;if(!e)return{success:!1,supportsGPU:!1,error:"table-function: Missing attributeTableAsRecordSet argument."};this.outputPixelType=this._getOutputPixelType(t.pixelType);const n=t.clone();return n.pixelType=this.outputPixelType,n.bandCount=1,n.dataType!=="thematic"&&(n.keyProperties=n.keyProperties?{...n.keyProperties,DataType:"thematic"}:{DataType:"thematic"}),this.rasterInfo=n,{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}};c([m({json:{write:!0,name:"rasterFunction"}})],Ct.prototype,"functionName",void 0),c([m({type:li,json:{write:!0,name:"rasterFunctionArguments"}})],Ct.prototype,"functionArguments",void 0),c([m()],Ct.prototype,"rasterArgumentNames",void 0),c([m()],Ct.prototype,"isNoopProcess",void 0),Ct=c([F("esri.layers.support.rasterFunctions.TableFunction")],Ct);const ci=Ct,j=new Map;function pi(t,e){const{rasterFunctionArguments:n}=t;n&&(n.rasters||[n.raster,n.raster2]).forEach(s=>{s&&typeof s!="number"&&(typeof s=="string"?s.startsWith("http")&&(e.includes(s)||e.push(s)):"rasterFunctionArguments"in s&&pi(s,e))})}function Ci(t,e){if(e=e??{},"function"in(t=H(t))&&"arguments"in t&&t.arguments){const n=Vs(t,new Map,e);if(De(n),!n.renderingRule)throw new Wt("raster-function-helper","Unsupported raster function json.");t=n.renderingRule}if("rasterFunction"in t)return Es(t=ze(t),e);throw new Wt("raster-function-helper","unsupported raster function json.")}function hi(t,e){return e[0]==="rasters"&&Array.isArray(t.rasters)?t.rasters:e.map(n=>t[n])}function ws(t){return!!(t&&typeof t=="object"&&t.rasterFunction&&t.rasterFunctionArguments)}function ze(t){const{rasterFunction:e,rasterFunctionArguments:n}=t,s={};for(const r in n){let i=n[r];const a=r.toLowerCase();if(a==="rasters"&&Array.isArray(i))s.rasters=i.map(o=>ws(o)?ze(o):o);else switch(ws(i)&&(i=ze(i)),a){case"dra":s.dra=i;break;case"pspower":s.psPower=i;break;case"pszfactor":s.psZFactor=i;break;case"bandids":s.bandIds=i;break;default:s[r[0].toLowerCase()+r.slice(1)]=i}}return e!=="Local"||s.rasters?.length||(s.rasters=["$$"]),{...t,rasterFunctionArguments:s}}function Es(t,e){const{rasterFunction:n,rasterFunctionArguments:s}=t,r=t.outputPixelType?.toLowerCase();if(n==null||!j.has(n))throw new Wt("raster-function-helper",`unsupported raster function: ${n}`);const i=j.get(n),a=(typeof i.ctor=="function"?i.ctor:i.ctor.default).fromJSON({...t,outputPixelType:r}),{rasterArgumentNames:o}=a,u=[],l=hi(s,o),h=o[0]==="rasters"||o.length>1,p=[];for(let f=0;f{a.functionArguments[f]=p[g]})),e){a.sourceRasters=u;const f=e.raster?.url;f&&(a.mainPrimaryRasterId=f)}return a}function Us(t,e){if(t&&e)for(const n in t){const s=t[n];s&&typeof s=="object"&&"type"in s&&(s.type==="RasterFunctionTemplate"?Us(s.arguments,e):s.type==="RasterFunctionVariable"&&e[s.name]!=null&&(s.value=e[s.name]))}}function Oe(t,e){if(!t||typeof t!="object")return t;const{value:n}=t;if(!n||typeof n!="object")return t.isDataset?"$$":n;if(Array.isArray(n))return n.length===0?[]:n.map(r=>typeof r=="object"&&r.type==="RasterFunctionVariable"?Oe(r,e):r);if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&n.type!=="Scalar")return"$$";if(!("type"in n))return n;let s=n;switch(n.type){case"Scalar":s=n.value;break;case"AlgorithmicColorRamp":s=vs(n);break;case"MultiPartColorRamp":s={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(vs)};break;case"ArgumentArray":if(n.elements?.length&&n.elements[0].type!=="RasterStatistics"){const r=[];for(let i=0;i{if(typeof o=="object")if(o._object_ref_id!=null){if(!n.has(o._object_ref_id))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${i} does not exist`);const l=n.get(a);l&&typeof l=="object"?Object.assign(o,l):i[u]=l}else De({renderingRule:o,templates:n})}));else{if(!n.has(a))throw new Wt("raster-function-helper",`unsupported raster function json. _object_ref_id: ${a} does not exist`);const o=n.get(a);r!=="_object_ref_id"?s[r]=o:o&&typeof o=="object"&&Object.assign(s,o)}}}function mi(t){t.Statistics?.length&&typeof t.Statistics=="object"&&(t.Statistics=t.Statistics.map(e=>[e.min,e.max,e.mean,e.standardDeviation])),t.NumberOfStandardDeviation!=null&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function fi(t){t.ColorRamp?.type?.toLowerCase()==="randomcolorramp"&&(delete t.ColorRamp,t.ColormapName="Random"),t.ColorSchemeType===0&&delete t.ColorRamp}function di(t){t.ConvolutionType!=null&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function gi(t){t.NoDataValues?.length&&typeof t.NoDataValues[0]=="string"&&(t.NoDataValues=t.NoDataValues.filter(e=>e!=="").map(e=>Number(e)))}j.set("Arithmetic",{desc:"Arithmetic Function",ctor:ar,rasterArgumentNames:["rasters"]}),j.set("Aspect",{desc:"Aspect Function",ctor:lr,rasterArgumentNames:["raster"]}),j.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:Gr,rasterArgumentNames:["raster"]}),j.set("Colormap",{desc:"Colormap Function",ctor:to,rasterArgumentNames:["raster"]}),j.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:so,rasterArgumentNames:["raster"]}),j.set("CompositeBand",{desc:"CompositeBand Function",ctor:ro,rasterArgumentNames:["rasters"]}),j.set("ComputeChange",{desc:"ComputeChange Function",ctor:fo,rasterArgumentNames:["rasters"]}),j.set("Convolution",{desc:"Convolution Function",ctor:Po,rasterArgumentNames:["raster"]}),j.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:yo,rasterArgumentNames:["raster"]}),j.set("ExtractBand",{desc:"ExtractBand Function",ctor:Ro,rasterArgumentNames:["raster"]}),j.set("Curvature",{desc:"Curvature Function",ctor:No,rasterArgumentNames:["raster"]}),j.set("Hillshade",{desc:"Hillshade Function",ctor:zo,rasterArgumentNames:["raster"]}),j.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:qo,rasterArgumentNames:["raster"]}),j.set("Grayscale",{desc:"Grayscale Function",ctor:jo,rasterArgumentNames:["raster"]}),j.set("Clip",{desc:"Clip Function",ctor:Wr,rasterArgumentNames:["raster"]}),j.set("Local",{desc:"Local Function",ctor:Do,rasterArgumentNames:["rasters"]}),j.set("Mask",{desc:"Mask Function",ctor:Uo,rasterArgumentNames:["raster"]}),j.set("NDVI",{desc:"NDVI Function",ctor:Lo,rasterArgumentNames:["raster"]}),j.set("Remap",{desc:"Remap Function",ctor:$o,rasterArgumentNames:["raster"]}),j.set("Slope",{desc:"Slope Function",ctor:Jo,rasterArgumentNames:["raster"]}),j.set("Statistics",{desc:"Focal Statistics Function",ctor:ni,rasterArgumentNames:["raster"]}),j.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:oi,rasterArgumentNames:["raster"]}),j.set("Stretch",{desc:"Stretch Function",ctor:ui,rasterArgumentNames:["raster"]}),j.set("Table",{desc:"Attribute Table Function",ctor:ci,rasterArgumentNames:["raster"]});let Xt=class extends Le{get affectsPixelSize(){return!1}forwardTransform(t){return t}inverseTransform(t){return t}};c([m()],Xt.prototype,"affectsPixelSize",null),c([m({json:{write:!0}})],Xt.prototype,"spatialReference",void 0),Xt=c([F("esri.layers.support.rasterTransforms.BaseRasterTransform")],Xt);const Ws=Xt;var Ee;let Jt=Ee=class extends Ws{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(t){return(t=t.clone()).type==="point"?(t.x>180+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)}clone(){return new Ee({tolerance:this.tolerance})}};c([K({GCSShiftXform:"gcs-shift"})],Jt.prototype,"type",void 0),c([m()],Jt.prototype,"tolerance",void 0),Jt=Ee=c([F("esri.layers.support.rasterTransforms.GCSShiftTransform")],Jt);const Ri=Jt;var Ue;function Ve(t,e,n){const{x:s,y:r}=e;if(n<2)return{x:t[0]+s*t[2]+r*t[4],y:t[1]+s*t[3]+r*t[5]};if(n===2){const f=s*s,g=r*r,y=s*r;return{x:t[0]+s*t[2]+r*t[4]+f*t[6]+y*t[8]+g*t[10],y:t[1]+s*t[3]+r*t[5]+f*t[7]+y*t[9]+g*t[11]}}const i=s*s,a=r*r,o=s*r,u=i*s,l=i*r,h=s*a,p=r*a;return{x:t[0]+s*t[2]+r*t[4]+i*t[6]+o*t[8]+a*t[10]+u*t[12]+l*t[14]+h*t[16]+p*t[18],y:t[1]+s*t[3]+r*t[5]+i*t[7]+o*t[9]+a*t[11]+u*t[13]+l*t[15]+h*t[17]+p*t[19]}}function bs(t,e,n){const{xmin:s,ymin:r,xmax:i,ymax:a,spatialReference:o}=e;let u=[];if(n<2)u.push({x:s,y:a}),u.push({x:i,y:a}),u.push({x:s,y:r}),u.push({x:i,y:r});else{let p=10;for(let f=0;fVe(t,p,n));const l=u.map(p=>p.x),h=u.map(p=>p.y);return new le({xmin:Math.min.apply(null,l),xmax:Math.max.apply(null,l),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:o})}function yi(t){const[e,n,s,r,i,a]=t,o=s*a-i*r,u=i*r-s*a;return[(i*n-e*a)/o,(s*n-e*r)/u,a/o,r/u,-i/o,-s/u]}let q=Ue=class extends Ws{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,e){const{coeffX:n,coeffY:s}=e;if(!n?.length||!s?.length||n.length!==s.length)return null;const r=[];for(let i=0;i0}forwardTransform(t){if(t.type==="point"){const e=Ve(this.forwardCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if(t.type==="point"){const e=Ve(this.inverseCoefficients,t,this.polynomialOrder);return new ue({x:e.x,y:e.y,spatialReference:t.spatialReference})}return bs(this.inverseCoefficients,t,this.polynomialOrder)}clone(){return new Ue({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};c([m({json:{write:!0}})],q.prototype,"polynomialOrder",void 0),c([m()],q.prototype,"forwardCoefficients",void 0),c([It("forwardCoefficients",["coeffX","coeffY"])],q.prototype,"readForwardCoefficients",null),c([Lt("forwardCoefficients")],q.prototype,"writeForwardCoefficients",null),c([m({json:{write:!0}})],q.prototype,"inverseCoefficients",null),c([It("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],q.prototype,"readInverseCoefficients",null),c([Lt("inverseCoefficients")],q.prototype,"writeInverseCoefficients",null),c([m()],q.prototype,"affectsPixelSize",null),c([K({PolynomialXform:"polynomial"})],q.prototype,"type",void 0),q=Ue=c([F("esri.layers.support.rasterTransforms.PolynomialTransform")],q);const Ii=q;export{Lr as B,pi as D,Ni as E,Ci as h,Ws as q,Ii as v,Ri as x}; diff --git a/custom-toc-highlight/assets/PooledRBush-DbfAmeLn-B9Pkw5Ae.js b/custom-toc-highlight/assets/PooledRBush-DbfAmeLn-CPHfm9op.js similarity index 98% rename from custom-toc-highlight/assets/PooledRBush-DbfAmeLn-B9Pkw5Ae.js rename to custom-toc-highlight/assets/PooledRBush-DbfAmeLn-CPHfm9op.js index 8739dbb4..10062964 100644 --- a/custom-toc-highlight/assets/PooledRBush-DbfAmeLn-B9Pkw5Ae.js +++ b/custom-toc-highlight/assets/PooledRBush-DbfAmeLn-CPHfm9op.js @@ -1 +1 @@ -import{c$ as w,gZ as F,h2 as v}from"./story-BfX8CRfG.js";import{b as J}from"./quickselect-DHTstthl-Ds_Aj0x5.js";class z{constructor(t=9,n){this._compareMinX=A,this._compareMinY=D,this._toBBox=i=>i,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(),d.prune(),Y.prune(),m.prune(),X.prune()}all(t){y(this._data,t)}search(t,n){let i=this._data;const a=this._toBBox;if(M(t,i))for(d.clear();i;){for(let s=0,r=i.children.length;s0;){if(i||(i=m.pop(),a=m.data[m.length-1],s=X.pop()??0,r=!0),i.leaf&&(n=F(i.children,t,i.children.length,i.indexHint),n!==-1))return i.children.splice(n,1),m.push(i),this._condense(m),this;r||i.leaf||!b(i,h)?a?(s++,i=a.children[s],r=!1):i=null:(m.push(i),X.push(s),s=0,a=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_build(t,n,i,a){const s=i-n+1;let r=this._maxEntries;if(s<=r){const l=new B(t.slice(n,i+1));return f(l,this._toBBox),l}a||(a=Math.ceil(Math.log(s)/Math.log(r)),r=Math.ceil(s/r**(a-1)));const h=new E([]);h.height=a;const o=Math.ceil(s/r),c=o*Math.ceil(Math.sqrt(r));H(t,n,i,c,this._compareMinX);for(let l=n;l<=i;l+=c){const u=Math.min(l+c-1,i);H(t,l,u,o,this._compareMinY);for(let p=l;p<=u;p+=o){const j=Math.min(p+o-1,u);h.children.push(this._build(t,p,j,a-1))}}return f(h,this._toBBox),h}_insert(t,n,i){const a=this._toBBox,s=i?t:a(t);m.clear();const r=N(s,this._data,n,m);for(r.children.push(t),_(r,s);n>=0&&m.data[n].children.length>this._maxEntries;)this._split(m,n),n--;O(s,m,n)}_split(t,n){const i=t.data[n],a=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,a);const r=this._chooseSplitIndex(i,s,a);if(!r)return;const h=i.children.splice(r,i.children.length-r),o=i.leaf?new B(h):new E(h);o.height=i.height,f(i,this._toBBox),f(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,n){this._data=new E([t,n]),this._data.height=t.height+1,f(this._data,this._toBBox)}_chooseSplitIndex(t,n,i){let a,s,r;a=s=1/0;for(let h=n;h<=i-n;h++){const o=x(t,0,h,this._toBBox),c=x(t,h,i,this._toBBox),l=I(o,c),u=S(o)+S(c);l=n;c--){const l=t.children[c];_(h,t.leaf?s(l):l),o+=g(h)}return o}_condense(t){for(let n=t.length-1;n>=0;n--){const i=t.data[n];if(i.children.length===0)if(n>0){const a=t.data[n-1],s=a.children;s.splice(F(s,i,s.length,a.indexHint),1)}else this.clear();else f(i,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 N(e,t,n,i){for(;i.push(t),t.leaf!==!0&&i.length-1!==n;){let a,s=1/0,r=1/0;for(let h=0,o=t.children.length;h=0;i--)_(t.data[i],e)}function f(e,t){x(e,0,e.children.length,t,e)}function x(e,t,n,i,a){a||(a=new B([])),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(let s,r=t;r=e.minX&&t.maxY>=e.minY}function H(e,t,n,i,a){const s=[t,n];for(;s.length;){const r=s.pop(),h=s.pop();if(r-h<=i)continue;const o=h+Math.ceil((r-h)/i/2)*i;J(e,o,h,r,a),s.push(h,o,o,r)}}const d=new w,Y=new w,m=new w,X=new w({deallocator:void 0});class Z{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class R extends Z{constructor(){super(...arguments),this.height=1,this.indexHint=new v}}class B extends R{constructor(t){super(),this.children=t,this.leaf=!0}}class E extends R{constructor(t){super(),this.children=t,this.leaf=!1}}export{z as N,Z as R}; +import{c$ as w,gZ as F,h2 as v}from"./story-Doly9N9p.js";import{b as J}from"./quickselect-DHTstthl-Ds_Aj0x5.js";class z{constructor(t=9,n){this._compareMinX=A,this._compareMinY=D,this._toBBox=i=>i,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(),d.prune(),Y.prune(),m.prune(),X.prune()}all(t){y(this._data,t)}search(t,n){let i=this._data;const a=this._toBBox;if(M(t,i))for(d.clear();i;){for(let s=0,r=i.children.length;s0;){if(i||(i=m.pop(),a=m.data[m.length-1],s=X.pop()??0,r=!0),i.leaf&&(n=F(i.children,t,i.children.length,i.indexHint),n!==-1))return i.children.splice(n,1),m.push(i),this._condense(m),this;r||i.leaf||!b(i,h)?a?(s++,i=a.children[s],r=!1):i=null:(m.push(i),X.push(s),s=0,a=i,i=i.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_build(t,n,i,a){const s=i-n+1;let r=this._maxEntries;if(s<=r){const l=new B(t.slice(n,i+1));return f(l,this._toBBox),l}a||(a=Math.ceil(Math.log(s)/Math.log(r)),r=Math.ceil(s/r**(a-1)));const h=new E([]);h.height=a;const o=Math.ceil(s/r),c=o*Math.ceil(Math.sqrt(r));H(t,n,i,c,this._compareMinX);for(let l=n;l<=i;l+=c){const u=Math.min(l+c-1,i);H(t,l,u,o,this._compareMinY);for(let p=l;p<=u;p+=o){const j=Math.min(p+o-1,u);h.children.push(this._build(t,p,j,a-1))}}return f(h,this._toBBox),h}_insert(t,n,i){const a=this._toBBox,s=i?t:a(t);m.clear();const r=N(s,this._data,n,m);for(r.children.push(t),_(r,s);n>=0&&m.data[n].children.length>this._maxEntries;)this._split(m,n),n--;O(s,m,n)}_split(t,n){const i=t.data[n],a=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,a);const r=this._chooseSplitIndex(i,s,a);if(!r)return;const h=i.children.splice(r,i.children.length-r),o=i.leaf?new B(h):new E(h);o.height=i.height,f(i,this._toBBox),f(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,n){this._data=new E([t,n]),this._data.height=t.height+1,f(this._data,this._toBBox)}_chooseSplitIndex(t,n,i){let a,s,r;a=s=1/0;for(let h=n;h<=i-n;h++){const o=x(t,0,h,this._toBBox),c=x(t,h,i,this._toBBox),l=I(o,c),u=S(o)+S(c);l=n;c--){const l=t.children[c];_(h,t.leaf?s(l):l),o+=g(h)}return o}_condense(t){for(let n=t.length-1;n>=0;n--){const i=t.data[n];if(i.children.length===0)if(n>0){const a=t.data[n-1],s=a.children;s.splice(F(s,i,s.length,a.indexHint),1)}else this.clear();else f(i,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 N(e,t,n,i){for(;i.push(t),t.leaf!==!0&&i.length-1!==n;){let a,s=1/0,r=1/0;for(let h=0,o=t.children.length;h=0;i--)_(t.data[i],e)}function f(e,t){x(e,0,e.children.length,t,e)}function x(e,t,n,i,a){a||(a=new B([])),a.minX=1/0,a.minY=1/0,a.maxX=-1/0,a.maxY=-1/0;for(let s,r=t;r=e.minX&&t.maxY>=e.minY}function H(e,t,n,i,a){const s=[t,n];for(;s.length;){const r=s.pop(),h=s.pop();if(r-h<=i)continue;const o=h+Math.ceil((r-h)/i/2)*i;J(e,o,h,r,a),s.push(h,o,o,r)}}const d=new w,Y=new w,m=new w,X=new w({deallocator:void 0});class Z{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class R extends Z{constructor(){super(...arguments),this.height=1,this.indexHint=new v}}class B extends R{constructor(t){super(),this.children=t,this.leaf=!0}}class E extends R{constructor(t){super(),this.children=t,this.leaf=!1}}export{z as N,Z as R}; diff --git a/custom-toc-highlight/assets/Popup-DFFZHG5j-DfLtnQ8W.js b/custom-toc-highlight/assets/Popup-DFFZHG5j-Bitz07Ss.js similarity index 93% rename from custom-toc-highlight/assets/Popup-DFFZHG5j-DfLtnQ8W.js rename to custom-toc-highlight/assets/Popup-DFFZHG5j-Bitz07Ss.js index daea7c9f..4151d828 100644 --- a/custom-toc-highlight/assets/Popup-DFFZHG5j-DfLtnQ8W.js +++ b/custom-toc-highlight/assets/Popup-DFFZHG5j-Bitz07Ss.js @@ -1,3 +1,3 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-icon-laqhdRBY-Dn93dMQE.js","./icon-BXFbBbop-BUyrjp8g.js","./themeUtils-YjM7iIiX-3_GiOEs2.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./dom-N58V0tYi-DBU3jlah.js","./observers-BigwqTsw-BNRQivHR.js","./visualVariableUtils-D3kZJRyn-23qzp7zg.js","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./lengthUtils-DKpMe5qR-C2NPRwwl.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./chartUtilsAm5-CtY-kHPy-B6BgNVnq.js","./Theme-rblUnB2V-D2UsCNGl.js","./Tooltip-B0HefZ7r-yfksLaF6.js","./DefaultTheme-Bt5OI-Ht-Dfb13wye.js","./chartCommon-rWfJsTPl-BkhcWsMI.js","./Button-MQvwxOnj-CVmrxfGx.js","./ColorSet-DkIwOmgs-C-GAktW1.js","./pieChart-qcxaoQkv-D93Sy6JQ.js","./Tick-DUHqbpyB-DY4eRS4C.js","./xyChart-Ch-p5aUf-DytGK0KM.js","./arcade-CaGqU4sP-CfTmGx37.js","./TimeOnly-DSMefxKy-BU7RNYWc.js","./UnknownTimeZone-C--TOcPG-D3CAoWPX.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./FeatureLayer-BrRKw5Si-D6Z5CL70.js","./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js","./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js","./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js","./colorRamps-q0bZVhs2-DQZn2xZS.js","./styleUtils-BtpNqZyT-D2Hj1Rgz.js","./jsonUtils-C64Zfu7c-CitE8NjK.js","./LRUCache-C3erQTWv-0wD6drRf.js","./Version-CoKzbupV-9-gg6ENz.js","./FieldsIndex-HmzMbJQG-DZuFWLvd.js","./OverrideHelper-DWRbVlj1-BZq72sbX.js","./colorUtils-Cthpxcks-ZRnr1H1b.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-B3hR8LxB.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-B-lEhyoX.js","./heatmapUtils-seiMkkkR-Cj1KmweL.js","./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js","./commonProperties-BtIqvFU_-DVH0kGN9.js","./ElevationInfo-yv2-9tj6-C2hC6Vpl.js","./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./HeightModelInfo-C5vFqzyF-CupKpfDx.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js","./Query-BrwMGK8U-DoFNfkjX.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./RelationshipQuery-DJsz3K0U-yAwL-qLW.js","./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js","./Relationship-PyhUibYK-BgFx3_5x.js","./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js","./Layer-ChoECxvZ-CQTFmFQa.js","./workers-PiCjreoO-idkDTJa3.js","./editsZScale-BDsX6vv--CttUpViY.js","./queryZScale-BiYV6Pr6-B5UMbu5B.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./FeatureSet-BkVNthuN-CwS44--W.js","./APIKeyMixin-BUMSx9ny-D_H-H5sI.js","./ArcGISService-BYA-y6X6-C_YhndKK.js","./BlendLayer-D1WkSmwP-Bad8_eoW.js","./jsonUtils-wIllKWI4-DrGIvCCq.js","./parser-DyDJ-rlI-C9jRH52J.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-DVqdGrVU.js","./CustomParametersMixin-vdKsTHer-BOFVTNLw.js","./EditBusLayer-Df29OyJh-DkVkxUAl.js","./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js","./FeatureEffect-CDEk9Es7-CEiHf7-6.js","./FeatureFilter-BCFHgLVU-CXZvxasm.js","./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js","./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js","./labelingInfo-DGVNul26-zkvIaBlq.js","./labelUtils-BW14kBqX-BkXd4VJn.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-9OHGXI1g.js","./OrderedLayer-6Qsmrd_l-BG3Yganz.js","./OrderByInfo-GD2XnU8e-NtCi3yT-.js","./PortalLayer-CElnYuSQ-DvpreqYV.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js","./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js","./TemporalLayer-CpOrN_w9-BDEJ3v2O.js","./TimeInfo-w_HB2CsF-CZutzBPZ.js","./FeatureTemplate-SPHPD45f-DFBQobBO.js","./FeatureType-C9hJmS6_-BXWT6QCe.js","./fieldProperties-Bq26w7gt-CFQbsGDX.js","./versionUtils-LZYZz-38-DxOZEoAg.js","./styleUtils-ChrJTYIw-BfDrXrWd.js","./popupUtils-B0uZcXX0-DtBp-byj.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./calcite-loader-CtpHSU2--Bzq4cVWG.js","./loader-Ch7Jr16w-DUAf9YhQ.js","./guid-Dls486Er-CBh637k4.js","./locale-Cn_GDVD_-Ar3RKmd3.js","./key-CZySMiwx-kmS7VeUz.js","./calcite-list-rnu1YzAl-CeNaNcvH.js","./interactive-DqhNilgd-BPt2o3jA.js","./resources4-Bi43yZeq-Ca3PT_gb.js","./utils3-BSH0zqNl-7T4-U7N_.js","./loadable-DbNDKH4r-D4CSNQAA.js","./t9n-C_hcZMZJ-D4zmKT16.js","./debounce-27Hmkkyg-Th7bw3mg.js","./input2-eOtqu-iO-DwuPmAAc.js","./form-CRSw616T-DZVFUlxN.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./scrim-BscQh4v9-DU79ospE.js","./calcite-list-item-VYBhSMxV-CrZ_qcBF.js","./action-GCQoufcz-CK-V5fzo.js","./calcite-notice-DeAGopAs-Cd7Uc4RY.js","./conditionalSlot-DsCzytJ4-8LGFSrPC.js","./openCloseComponent-BGQ6h7vg-COvbZ7sG.js","./calcite-chip-DE_c-1hr-BB941sYj.js","./calcite-input-BKRd7MCS-DN64wHsO.js","./calcite-tooltip-63c9fmIw-DyfFML0E.js","./floating-ui-DKFFlLv3--KXNPa_R.js","./FloatingArrow-BG9llDYg-iM1y-TMJ.js","./calcite-action-2fclGKoO-DO9-6_VR.js","./calcite-action-bar-ugh74qU5-trFy58rx.js","./action-group-DhwU7QZv-gljbsXvo.js","./action-menu-DTIJuZNc-C8BNxu3_.js","./calcite-action-group-qlkUfh_o-wUTthgYu.js","./calcite-flow-item-uRuGc3ks-DCl4Mpal.js","./panel-DRUEhsxp-Bbd7sTo9.js","./geometryEngineAsync-D7oEu5dd-B6AE24vD.js","./calcite-button-Cm9_TJei-By40tgvH.js","./calcite-flow-CAdorlph-NGgeuOPy.js","./calcite-list-item-group-CuQ2MPLW-DacaGEdY.js"])))=>i.map(i=>d[i]); -import{_ as w}from"./main-ugzBrWNm.js";import{ag as ce,v as r,S as a,ad as et,bi as je,i as P,iC as sn,ej as uo,ar as po,gP as ho,iD as rn,w as ai,aa as mo,bR as li,j as ge,b9 as ke,bp as Ke,ah as y,aL as $,aq as Nt,aK as di,a0 as Fi,ac as Mi,m as an,aD as fo,aU as Et,a1 as K,iE as go,ai as dt,aw as yo,iF as qe,I as ln,aF as at,iG as dn,iH as pt,iI as _o,K as ci,d$ as cn,av as un,b7 as pn,o as N,c3 as Be,bx as vo,c2 as ct,gO as hn,c4 as Ci,bE as mn,iJ as fn,a_ as gn,iK as yn,iL as _n,en as vn,iM as Ei,aA as wo,az as $t,e as bo,dW as Io,bt as wn,eC as gt,cn as bn,bw as In,ae as An,iw as ui,ch as Fn,f as Mn,el as Ti,iN as Tt,an as Cn}from"./story-BfX8CRfG.js";import{b as pe}from"./substitute-j49H6mVR-CJn4Lavp.js";import{_ as Y,k as Ae,P as u,o as En,X as Tn,R as oe,d as xi,e as ki,H as be,$ as xn,w as kn,F as Ao}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{s as Ln,t as Pn}from"./ReactiveSet-QxEZenFW-DlICHtLT.js";import{h as Nn}from"./AttachmentInfo-D9RFO8W2-DYgfjXim.js";import{d as Kt,c as Li}from"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import{b as $n,N as Fo}from"./utils-DyydRFHu-BQ5pghrp.js";import{I as M,K as Rn,J as On}from"./MapView-BGOJJ8ch-DcHA1w96.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import{K as Vn,C as St,I as Sn,J as Dn,x as We}from"./utils-DPtQ14k3-CAwuJg76.js";import{l as qn}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{u as Dt}from"./executeQueryJSON-CcHnccia-BW7_NQxl.js";import{b as lt,m as Bn}from"./Query-BrwMGK8U-DoFNfkjX.js";import{j as jn}from"./shared-D1w-26bA-B8KlJvO_.js";import Mo from"./FeatureLayer-BrRKw5Si-D6Z5CL70.js";import{h as Co}from"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import{L as xt}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import{V as Wn,K as zn,N as Hn}from"./projection-BA9M1R7d-BYoCXVXt.js";import{D as Pi}from"./Layer-ChoECxvZ-CQTFmFQa.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import{a as Ni}from"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./query-DFW9-NG_-gbjlxRZk.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import"./Relationship-PyhUibYK-BgFx3_5x.js";import"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import"./editsZScale-BDsX6vv--CttUpViY.js";import"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import"./ArcGISService-BYA-y6X6-C_YhndKK.js";import"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import"./EditBusLayer-Df29OyJh-DkVkxUAl.js";import"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./PortalLayer-CElnYuSQ-DvpreqYV.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import"./FeatureType-C9hJmS6_-BXWT6QCe.js";import"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import"./versionUtils-LZYZz-38-DxOZEoAg.js";import"./styleUtils-ChrJTYIw-BfDrXrWd.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";function pi(e,t,i,o){let n=null,s=1e3;typeof t=="number"?(s=t,o=i):(n=t??null,s=i);let l,d=0;const c=()=>{d=0,e.apply(o,l)},p=(...h)=>{n&&n.apply(o,h),l=h,s?d||(d=setTimeout(c,s)):c()};return p.remove=()=>{d&&(clearTimeout(d),d=0)},p.forceUpdate=()=>{d&&(clearTimeout(d),c())},p.hasPendingUpdates=()=>!!d,p}function Yt(e){switch(e?.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}function Un(e){return e?{backgroundImage:`url(${e})`}:{}}function Zn({action:e,feature:t}){const i=t?.attributes,o="image"in e?e.image:void 0;return o&&i?pe(o,i):o??""}const Gn="esri.widgets.Feature.support.featureUtils",ei=()=>K.getLogger(Gn),Qn=/href=(""|'')/gi,Xn=/(\{([^{\r\n]+)\})/g,Jn=/'/g,Eo=/^\s*expression\//i,Kn=/(\n)/gi,Yn=/[\u00A0-\u9999<>&]/gim,es=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ts=/^(?:mailto:|tel:)/,To="relationships/",$i=ho("short-date-short-time");function xo(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}async function kt({type:e,value:t,event:i}){try{return typeof t=="function"?t(i):await t}catch(o){return void ei().error("error",`An error occurred when calling the "${e}" function`,{error:o,graphic:i.graphic,value:t})}}function ko(e=""){if(e)return!ts.test(e.trim().toLowerCase())}function hi(e){return!!e&&Eo.test(e)}function is(e,t){if(!t||!hi(t)||!e)return;const i=t.replace(Eo,"").toLowerCase();return e.find(({name:o})=>o.toLowerCase()===i)}function Lo(e,t){const i=is(t,e?.fieldName);return i?i.title||null:e?e.label||e.fieldName:null}function os(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function ns(e){return e.replaceAll(Qn,"")}function ut(e,t){const i=mi(t,e);return i?i.name:e}function ss(e,t){return e&&e.map(i=>ut(i,t))}function mi(e,t){return e&&typeof e.getField=="function"&&t?e.getField(t)??null:null}function Po(e){return`${e}`.trim()}function Ve({attributes:e,globalAttributes:t,layer:i,text:o,expressionAttributes:n,fieldInfoMap:s}){return o?ti({formattedAttributes:t,template:ds(o,{...t,...n,...e},i),fieldInfoMap:s}):""}function ti({formattedAttributes:e,template:t,fieldInfoMap:i}){return Po(ns(ct(ct(t,o=>os(o,i)),e)))}function rs(e,t,i=!1){const o=t[e];if(typeof o=="string"){const n="%27",s=(i?encodeURIComponent(o):o).replaceAll(Jn,n);t[e]=s}}function as(e,t=!1){const i={...e};return Object.keys(i).forEach(o=>rs(o,i,t)),i}function ls(e,t,i){const o=(t=Po(t))&&t[0]!=="{";return ct(e,as(i,o||!1))}function ii(e,t){return e.replaceAll(Xn,(i,o,n)=>{const s=mi(t,n);return s?`{${s.name}}`:o})}function ds(e,t,i){const o=ii(e,i);return o&&o.replaceAll(es,(n,s,l)=>ls(n,s||l,t))}function cs(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 No(e){return e!=null&&typeof e=="object"&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&(e.type==="feature"||e.type==="scene"||e.type==="subtype-sublayer"||e.type==="sublayer")&&"when"in e}function us(e){return e!=null&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function ps(e){return!!(e&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"type"in e)&&(e.type==="subtype-sublayer"&&"parent"in e&&e.parent&&typeof e.parent=="object"?"globalIdField"in e.parent:"globalIdField"in e)}function $o(e){return No(e)&&us(e)}function hs(e){return No(e)&&ps(e)}function ms(e,t){const{fieldInfos:i,fieldName:o,preventPlacesFormatting:n,layer:s,timeZone:l}=t,d=Ro(i,o),c=mi(s,o);if(d&&!Ti(o)){const h=c?.type,m=d.format?.dateFormat;if(h==="date"||h==="date-only"||h==="time-only"||h==="timestamp-offset"||m)return Fo(e,{format:m,fieldType:h,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:l,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}})}const p=d?.format;return typeof e=="string"&&Ti(o)&&p?fs(e,p):typeof(e=cs(e,p))=="string"||e==null||p==null?ht(e):Be(e,n?{...Tt(p),minimumFractionDigits:0,maximumFractionDigits:20}:Tt(p))}function fs(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?qt(e,",",", ",t):e.includes(";")?qt(e,";","; ",t):e.includes(" ")?qt(e," "," ",t):Be(Number(e),Tt(t))}function qt(e,t,i,o){return e.trim().split(t).map(n=>Be(Number(n),Tt(o))).join(i)}function Ro(e,t){if(e?.length&&t)return e.find(i=>i.fieldName?.toLowerCase()===t.toLowerCase())}function gs({fieldName:e,graphic:t,layer:i}){if(Ie(e)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:o}=i;if(!o||e!==o)return null;const n=i.getFeatureType(t);return n?n.name:null}function ys({fieldName:e,value:t,graphic:i,layer:o}){if(Ie(e)||!o||typeof o.getFieldDomain!="function")return null;const n=i&&o.getFieldDomain(e,{feature:i,excludeImpliedDomains:ci("esri-widget-legacy-field-domain-calculation")});return n&&n.type==="coded-value"?n.getName(t):null}function _s(e,t,i,o){const{creatorField:n,creationDateField:s,editorField:l,editDateField:d}=e;if(!t)return;const c=hn(o&&"preferredTimeZone"in o?o.preferredTimeZone:null,!(!o||!("datesInUnknownTimezone"in o))&&!!o.datesInUnknownTimezone,i,$i,"date"),p={...$i,...c},h=t[d];if(typeof h=="number"){const f=t[l];return{type:"edit",date:Ci(h,p),user:f}}const m=t[s];if(typeof m=="number"){const f=t[n];return{type:"create",date:Ci(m,p),user:f}}return null}function vs(e,t){const i=new Map;if(!e)return i;for(const o of e){if(!o.fieldName)continue;const n=ut(o.fieldName,t);o.fieldName=n,i.set(n.toLowerCase(),o)}return i}function Ri(e){const t=[];if(!e)return t;const{fieldInfos:i,content:o}=e;return i&&t.push(...i),o&&Array.isArray(o)&&o.forEach(n=>{if(n.type==="fields"){const s=n?.fieldInfos;s&&t.push(...s)}}),t}function fi(e){return e.replaceAll(Yn,t=>`&#${t.charCodeAt(0)};`)}function ht(e){return typeof e=="string"?e.replaceAll(Kn,'
'):e}function Oo(e){const{value:t,fieldName:i,fieldInfos:o,fieldInfoMap:n,layer:s,graphic:l,timeZone:d}=e;if(t==null)return"";const c=ys({fieldName:i,value:t,graphic:l,layer:s});if(c)return c;const p=gs({fieldName:i,graphic:l,layer:s});if(p)return p;if(n.get(i.toLowerCase()))return ms(t,{fieldInfos:o||Array.from(n.values()),fieldName:i,layer:s,timeZone:d});const h=s?.fieldsIndex?.get(i);return h&&($n(h)||bn(h))?Fo(t,{fieldType:h.type,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:d,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}}):ht(t)}function Bt({fieldInfos:e,attributes:t,layer:i,graphic:o,fieldInfoMap:n,relatedInfos:s,timeZone:l}){const d={};return s?.forEach(c=>As({attributes:d,relatedInfo:c,fieldInfoMap:n,fieldInfos:e,layer:i,timeZone:l})),t&&Object.keys(t).forEach(c=>{const p=t[c];d[c]=Oo({fieldName:c,fieldInfos:e,fieldInfoMap:n,layer:i,value:p,graphic:o,timeZone:l})}),d}async function Vo(e,t){const{layer:i,graphic:o,outFields:n,objectIds:s,returnGeometry:l,spatialReference:d}=e,c=s[0];if(typeof c!="number"&&typeof c!="string"){const h="Could not query required fields for the specified feature. The feature's ID is invalid.",m={layer:i,graphic:o,objectId:c,requiredFields:n};return ei().warn(h,m),null}if(!mn(i)?.operations?.supportsQuery){const h="The specified layer cannot be queried. The following fields will not be available.",m={layer:i,graphic:o,requiredFields:n,returnGeometry:l};return ei().warn(h,m),null}const p=i.createQuery();return p.objectIds=s,p.outFields=n?.length?n:[i.objectIdField],p.returnGeometry=!!l,p.returnZ=!!l,p.returnM=!!l,p.outSpatialReference=d,(await i.queryFeatures(p,t)).features[0]}async function ws(e){if(!e.expressionInfos?.length)return!1;const t=await Io(),{arcadeUtils:{hasGeometryFunctions:i}}=t;return i(e)}async function bs({graphic:e,popupTemplate:t,layer:i,spatialReference:o},n){if(!i||!t||(typeof i.load=="function"&&await i.load(n),!e.attributes))return;const s=i.objectIdField,l=e.attributes[s];if(l==null)return;const d=[l],c=await t.getRequiredFields(i.fieldsIndex),p=fn(c,e),h=p?[]:c.includes(s)?c:[...c,s],m=t.returnGeometry||await ws(t);if(p&&!m)return;const f=await Vo({layer:i,graphic:e,outFields:h,objectIds:d,returnGeometry:m,spatialReference:o},n);f&&(f.geometry&&(e.geometry=f.geometry),f.attributes&&(e.attributes={...e.attributes,...f.attributes}))}function Ie(e=""){return!!e&&e.includes(To)}function Is(e){return e?`${To}${e.layerId}/${e.fieldName}`:""}function Oi({attributes:e,graphic:t,relatedInfo:i,fieldInfos:o,fieldInfoMap:n,layer:s,timeZone:l}){e&&t&&i&&Object.keys(t.attributes).forEach(d=>{const c=Is({layerId:i.relation.id.toString(),fieldName:d}),p=t.attributes[d];e[c]=Oo({fieldName:c,fieldInfos:o,fieldInfoMap:n,layer:s,value:p,graphic:t,timeZone:l})})}function As({attributes:e,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s}){e&&t&&(t.relatedFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})),t.relatedStatsFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})))}const Vi=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},So=({layer:e,method:t,query:i,definitionExpression:o})=>{if(!e.capabilities?.query?.supportsCacheHint||t==="attachments")return;const n=i.where!=null?i.where:null,s=i.geometry!=null?i.geometry:null;Vi(o)||Vi(n)||s?.type==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},Fs=({query:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},Ms=({queryPayload:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function Cs(e,t,i){return e&&t&&i?t.type==="sublayer"?Xe({layers:t.layer?.sublayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:i}):Xe({layers:e.allLayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:e.allTables,map:e,relatedLayer:t,relationship:i}):null}function Si(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find(i=>i.isUtilityLayer(t)):null}function Di(e,t){return e?.allTables.find(i=>i.type==="feature"&&i.layerId===t.id&&i.url===t.layer?.url)}function Xe({map:e,relationship:t,relationship:{relatedTableId:i},relatedLayer:o,layers:n}){if(!n)return null;for(const s of n){if(s.type==="map-image"){const d=Xe({layers:s.sublayers,map:e,relatedLayer:o,relationship:t})||Xe({layers:s.subtables,map:e,relatedLayer:o,relationship:t});if(d)return d;continue}if(!$o(s))continue;if(o.type==="sublayer"){if(s!==o&&s.id===i)return s.isTable?Di(e,s):s;continue}const l=o.type==="scene"&&o.associatedLayer?o.associatedLayer.url:o.url;if(!l)return null;if(s.type!=="sublayer"){if(s!==o&&s.url===l&&s.layerId===i)return s}else if(s!==o&&s.layer?.url===l&&s.id===i)return s.isTable?Di(e,s):s}return null}const qi={editing:!1,operations:{add:!0,update:!0,delete:!0}},Do=ce.ofType(Nn);let ne=class extends ge{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...qi},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new Do,this.fileInfos=new ce,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(y(()=>this.graphic,()=>this._graphicChanged(),$))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...qi,...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?.loaded&&"capabilities"in t&&t.capabilities&&"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 N("invalid-layer","getAttachments(): A valid layer is required.");const i=this._getObjectId();if(typeof i!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const o=new Li({objectIds:[i],returnMetadata:!0}),n=[],s=e.queryAttachments(o).then(d=>d[i]||n).catch(()=>n);this._getAttachmentsPromise=s,this.notifyChange("state");const l=await s;return t.destroyAll(),l.length&&t.addMany(l),this._getAttachmentsPromise=null,this.notifyChange("state"),l}async addAttachment(e,t=this.graphic){const{_attachmentLayer:i,attachmentInfos:o,capabilities:n}=this;if(!t)throw new N("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new N("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!n.operations?.add)throw new N("invalid-capabilities","addAttachment(): add capabilities are required.");if(!i||typeof i.addAttachment!="function")throw new N("invalid-layer","addAttachment(): A valid layer is required.");const s=i.addAttachment(t,e).then(d=>this._queryAttachment(d.objectId,t)),l=await s;return o.add(l),l}async deleteAttachment(e){const{_attachmentLayer:t,attachmentInfos:i,graphic:o,capabilities:n}=this;if(!e)throw new N("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!n.operations?.delete)throw new N("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new N("invalid-layer","deleteAttachment(): A valid layer is required.");if(!o)throw new N("invalid-graphic","deleteAttachment(): A graphic is required.");const s=t.deleteAttachments(o,[e.id]).then(()=>e),l=await s;return i.remove(l),l.destroy(),l}async updateAttachment(e,t=this.activeAttachmentInfo){const{_attachmentLayer:i,attachmentInfos:o,graphic:n,capabilities:s}=this;if(!e)throw new N("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new N("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!s.operations?.update)throw new N("invalid-capabilities","updateAttachment(): Update capabilities are required.");const l=o.indexOf(t);if(!i||typeof i.updateAttachment!="function")throw new N("invalid-layer","updateAttachment(): A valid layer is required.");if(!n)throw new N("invalid-graphic","updateAttachment(): A graphic is required.");const d=i.updateAttachment(n,t.id,e).then(p=>this._queryAttachment(p.objectId)),c=await d;return o.splice(l,1,c),c}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 o=this.fileInfos.indexOf(i);return o>-1&&this.fileInfos.splice(o,1,{file:e,form:t}),this.fileInfos.items[o]}deleteFile(e){const t=this.fileInfos.find(i=>i.file===e);return t?(this.fileInfos.remove(t),t):null}async _queryAttachment(e,t){const{_attachmentLayer:i}=this;if(!e||!i?.queryAttachments)throw new N("invalid-attachment-id","Could not query attachment.");const o=this._getObjectId(t);if(typeof o!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const n=new Li({objectIds:[o],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return i.queryAttachments(n).then(s=>s[o][0])}_getObjectId(e=this.graphic){return e?.getObjectId()??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>this.attachmentInfos.destroyAll()))}_setAttachmentLayer(){const{graphic:e}=this,t=xo(e);this._attachmentLayer=t?t.type==="scene"&&t.associatedLayer!=null?t.associatedLayer:t:null}};r([a()],ne.prototype,"capabilities",void 0),r([et("capabilities")],ne.prototype,"castCapabilities",null),r([a()],ne.prototype,"activeAttachmentInfo",void 0),r([a()],ne.prototype,"activeFileInfo",void 0),r([a({readOnly:!0,type:Do})],ne.prototype,"attachmentInfos",void 0),r([a()],ne.prototype,"fileInfos",void 0),r([a({type:je})],ne.prototype,"graphic",void 0),r([a()],ne.prototype,"mode",void 0),r([a({readOnly:!0})],ne.prototype,"state",null),r([a()],ne.prototype,"filesEnabled",void 0),r([a({readOnly:!0})],ne.prototype,"supportsResizeAttachments",null),ne=r([P("esri.widgets.Attachments.AttachmentsViewModel")],ne);const gi=ne;function Bi(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 Es(e){const t=In("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 we={close:"esri-icon-close",collapse:"esri-icon-collapse",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical",duplicate:"esri-icon-duplicate",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",handleVertical:"esri-icon-handle-vertical",icon:"esri-icon",left:"esri-icon-left",locateCircled:"esri-icon-locate-circled",noticeTriangle:"esri-icon-notice-triangle",pause:"esri-icon-pause",play:"esri-icon-play",plus:"esri-icon-plus",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked",refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",search:"esri-icon-search",swap:"esri-icon-swap",table:"esri-icon-table",trash:"esri-icon-trash",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomToObject:"esri-icon-zoom-to-object"},ji={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},L="esri-attachments",A={base:L,loaderContainer:`${L}__loader-container`,loader:`${L}__loader`,fadeIn:`${L}--fade-in`,container:`${L}__container`,containerList:`${L}__container--list`,containerPreview:`${L}__container--preview`,actions:`${L}__actions`,deleteButton:`${L}__delete-button`,addAttachmentButton:`${L}__add-attachment-button`,errorMessage:`${L}__error-message`,items:`${L}__items`,item:`${L}__item`,itemButton:`${L}__item-button`,itemMask:`${L}__item-mask`,itemMaskIcon:`${L}__item-mask--icon`,itemImage:`${L}__image`,itemImageResizable:`${L}__image--resizable`,itemLabel:`${L}__label`,itemFilename:`${L}__filename`,itemChevronIcon:`${L}__item-chevron-icon`,itemLink:`${L}__item-link`,itemLinkOverlay:`${L}__item-link-overlay`,itemLinkOverlayIcon:`${L}__item-link-overlay-icon`,itemEditIcon:`${L}__item-edit-icon`,itemAddIcon:`${L}__item-add-icon`,itemAddButton:`${L}__item-add-button`,formNode:`${L}__form-node`,fileFieldset:`${L}__file-fieldset`,fileLabel:`${L}__file-label`,fileName:`${L}__file-name`,fileInput:`${L}__file-input`,metadata:`${L}__metadata`,metadataFieldset:`${L}__metadata-fieldset`,progressBar:`${L}__progress-bar`},jt=window.CSS;let X=class extends oe{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...ji},this._supportsImageOrientation=jt&&jt.supports&&jt.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}normalizeCtorArgs(e){return e?.viewModel||(e={viewModel:new gi,...e}),e}initialize(){this.addHandles([dt(()=>this.viewModel?.attachmentInfos,"change",()=>this.scheduleRender()),dt(()=>this.viewModel?.fileInfos,"change",()=>this.scheduleRender()),y(()=>this.viewModel?.mode,()=>this._modeChanged(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Dn93dMQE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=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 icon(){return"attachment"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...ji,...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 N("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 N("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 N("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 u("div",{class:this.classes(A.base,M.widget)},e?this._renderProgressBar():null,i==="loading"?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?u("div",{class:A.errorMessage,key:"error-message"},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 u("div",{class:A.loaderContainer,key:"loader"},u("div",{class:A.loader}))}_renderProgressBar(){return this.visibleElements.progressBar?u("div",{class:A.progressBar,key:"progress-bar"}):null}_renderAddForm(){const{submitting:e,selectedFile:t}=this,i=e||!t,o=this.visibleElements.cancelAddButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,M.buttonSmall,M.buttonHalf,e&&M.buttonDisabled),disabled:e,onclick:this._cancelForm,type:"button"},this.messages.cancel):null,n=this.visibleElements.addSubmitButton?u("button",{class:this.classes(M.button,M.buttonSecondary,M.buttonSmall,M.buttonHalf,{[M.buttonDisabled]:i}),disabled:i,type:"submit"},this.messages.add):null,s=t?u("span",{class:A.fileName,key:"file-name"},t.name):null,l=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},u("fieldset",{class:A.fileFieldset},s,u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},t?this.messages.changeFile:this.messages.selectFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),n,o);return u("div",{class:A.formNode,key:"add-form-container"},l)}_renderDetailsForm(e){const{visibleElements:t,viewModel:i,selectedFile:o,submitting:n}=this,{capabilities:s}=i,l=n||!o;let d,c,p,h;o?(d=o.type,c=o.name,p=o.size):e&&"file"in e?(d=e.file.type,c=e.file.name,p=e.file.size):e&&"contentType"in e&&(d=e.contentType,c=e.name,p=e.size,h=e.url);const m=s.editing&&s.operations?.delete&&t.deleteButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,A.deleteButton,{[M.buttonDisabled]:n}),disabled:n,key:"delete-button",onclick:b=>this._submitDeleteAttachment(b,e),type:"button"},this.messages.delete):void 0,f=s.editing&&s.operations?.update&&t.updateButton?u("button",{class:this.classes(M.button,M.buttonSmall,M.buttonThird,{[M.buttonDisabled]:l}),disabled:l,key:"update-button",type:"submit"},this.messages.update):void 0,g=this.visibleElements.cancelUpdateButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,M.buttonThird,{[M.buttonDisabled]:n}),disabled:n,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0,v=s.editing&&s.operations?.update?u("fieldset",{class:A.fileFieldset,key:"file"},u("span",{class:A.fileName,key:"file-name"},c),u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},this.messages.changeFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0,I=u("fieldset",{class:A.metadataFieldset,key:"size"},u("label",null,Pn(this.messagesUnits,p??0))),C=u("fieldset",{class:A.metadataFieldset,key:"content-type"},u("label",null,d)),_=h!=null?u("a",{class:A.itemLink,href:h,rel:"noreferrer",target:"_blank"},this._renderImageMask(e,400),u("div",{class:A.itemLinkOverlay},u("span",{class:A.itemLinkOverlayIcon},u("calcite-icon",{icon:"launch"})))):this._renderImageMask(e,400),T=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:b=>this._submitUpdateAttachment(b,e)},u("div",{class:A.metadata},I,C),v,u("div",{class:A.actions},m,g,f));return u("div",{class:A.formNode,key:"edit-form-container"},_,T)}_renderImageMask(e,t){return e?"file"in e?this._renderGenericImageMask(e.file.name,e.file.type):this._renderImageMaskForAttachment(e,t):null}_renderGenericImageMask(e,t){const{supportsResizeAttachments:i}=this.viewModel,o=Es(t),n={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMaskIcon,A.itemMask),key:o},u("img",{alt:e,class:this.classes(n,A.itemImage),src:o,title:e}))}_renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:i}=this.viewModel;if(!e)return null;const{contentType:o,name:n,url:s}=e;if(!i||!Bi(o))return this._renderGenericImageMask(n,o);const l=this._getCSSTransform(e),d=l?{transform:l,"image-orientation":"none"}:{},c=`${s}${s?.includes("?")?"&":"?"}w=${t}`,p={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMask),key:c},u("img",{alt:n,class:this.classes(p,A.itemImage),src:c,styles:d,title:n}))}_renderFile(e){const{file:t}=e;return u("li",{class:A.item,key:t},u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,key:"details-button",onclick:()=>this._startEditFile(e),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(e),u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},t.name||this.messages.noTitle),u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}))))}_renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:i,effectiveDisplayType:o}=this,{capabilities:n,supportsResizeAttachments:s}=i,{contentType:l,name:d,url:c}=e,p=this._renderImageMask(e,t==="list"?48:400),h=n.editing?u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}):null,m=[p,o==="preview"&&s&&Bi(l)?null:u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},d||this.messages.noTitle),h)],f=n.editing?u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,"data-attachment-info-id":e.id,key:"details-button",onclick:()=>this._startEditAttachment(e),title:this.messages.attachmentDetails,type:"button"},m):u("a",{class:A.itemButton,href:c??void 0,key:"details-link",rel:"noreferrer",target:"_blank"},m);return u("li",{class:A.item,key:e},f)}_renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:t,visibleElements:i}=this,{attachmentInfos:o,capabilities:n,fileInfos:s}=t,l=!!o?.length,d=!!s?.length,c={[A.containerList]:e!=="preview",[A.containerPreview]:e==="preview"},p=n.editing&&n.operations?.add&&i.addButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,A.addAttachmentButton),onclick:()=>this._startAddAttachment(),type:"button"},u("span",{"aria-hidden":"true",class:this.classes(A.itemAddIcon,we.plus)}),this.messages.add):void 0,h=l?u("ul",{class:A.items,key:"attachments-list"},o.toArray().map(g=>this._renderAttachmentInfo({attachmentInfo:g,displayType:e}))):void 0,m=d?u("ul",{class:A.items,key:"file-list"},s.toArray().map(g=>this._renderFile(g))):void 0,f=d||l?void 0:u("div",{class:M.empty},this.messages.noAttachments);return u("div",{class:this.classes(A.container,c),key:"attachments-container"},h,m,f,p)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,i=t.files?.item(0);this._set("selectedFile",i)}_submitDeleteAttachment(e,t){e.preventDefault(),t&&("file"in t?this.deleteFile(t.file):t&&this.deleteAttachment(t))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),t&&"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(" "):""}};r([a()],X.prototype,"capabilities",null),r([a()],X.prototype,"displayType",void 0),r([a({readOnly:!0})],X.prototype,"effectiveDisplayType",null),r([a()],X.prototype,"graphic",null),r([a()],X.prototype,"icon",null),r([a()],X.prototype,"label",null),r([a(),Y("esri/widgets/Attachments/t9n/Attachments")],X.prototype,"messages",void 0),r([a(),Y("esri/core/t9n/Units")],X.prototype,"messagesUnits",void 0),r([a({readOnly:!0})],X.prototype,"selectedFile",void 0),r([a({readOnly:!0})],X.prototype,"submitting",void 0),r([a({readOnly:!0})],X.prototype,"error",void 0),r([a({type:gi})],X.prototype,"viewModel",void 0),r([a()],X.prototype,"visibleElements",void 0),r([et("visibleElements")],X.prototype,"castVisibleElements",null),X=r([P("esri.widgets.Attachments")],X);const Ts=X;let nt=class extends gi{constructor(e){super(e),this.description=null,this.title=null}};r([a()],nt.prototype,"description",void 0),r([a()],nt.prototype,"title",void 0),nt=r([P("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],nt);const yi=nt;function _i({level:e,class:t,...i},o){const n=xs(e);return u(`h${n}`,{...i,"aria-level":String(n),class:xn(M.heading,t),role:"heading"},o)}function xs(e){return An(Math.ceil(e),1,6)}const Wt="esri-feature-element-info",zt={base:Wt,title:`${Wt}__title`,description:`${Wt}__description`};let Ze=class extends oe{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return u("div",{class:zt.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?u(_i,{class:zt.title,innerHTML:e,level:this.headingLevel}):null}_renderDescription(){const{description:e}=this;return e?u("div",{class:zt.description,innerHTML:e,key:"description"}):null}};r([a()],Ze.prototype,"description",void 0),r([a()],Ze.prototype,"headingLevel",void 0),r([a()],Ze.prototype,"title",void 0),Ze=r([P("esri.widgets.Feature.support.FeatureElementInfo")],Ze);const mt=Ze,ks={base:"esri-feature-attachments"};let ye=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new Ts,this.headingLevel=2,this.viewModel=new yi}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,$)])}destroy(){this.attachmentsWidget.viewModel=null,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(){const{attachmentsWidget:e}=this;return u("div",{class:ks.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:i})}};r([a({readOnly:!0})],ye.prototype,"attachmentsWidget",void 0),r([a()],ye.prototype,"description",null),r([a()],ye.prototype,"displayType",null),r([a()],ye.prototype,"graphic",null),r([a()],ye.prototype,"headingLevel",void 0),r([a()],ye.prototype,"title",null),r([a({type:yi})],ye.prototype,"viewModel",void 0),ye=r([P("esri.widgets.Feature.FeatureAttachments")],ye);const Ls=ye;let Ee=class extends ge{constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.addHandles(y(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},$))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:i}=this;e&&t&&(kt({type:"content",value:i,event:{graphic:t}}),this._set("created",null))}async _createContent(e){const t=this.graphic;if(!t||!e)return;const i=kt({type:"content",value:e,event:{graphic:t}});this._loadingPromise=i,this.notifyChange("state");const o=await i;i===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",o))}};r([a({readOnly:!0})],Ee.prototype,"created",void 0),r([a()],Ee.prototype,"creator",void 0),r([a()],Ee.prototype,"destroyer",void 0),r([a({type:je})],Ee.prototype,"graphic",void 0),r([a({readOnly:!0})],Ee.prototype,"state",null),Ee=r([P("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],Ee);const Lt=Ee;function qo(e){return t=>{t.hasOwnProperty("_delegatedEventNames")||(t._delegatedEventNames=t._delegatedEventNames?t._delegatedEventNames.slice():[]);const i=t._delegatedEventNames,o=Array.isArray(e)?e:Ps(e);i.push(...o)}}function Ps(e){return e.split(",").map(t=>t.trim())}function Bo(e){return e&&typeof e.render=="function"}function Ns(e){return e&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}const Ht="esri-feature-content",Ut={base:Ht,loaderContainer:`${Ht}__loader-container`,loader:`${Ht}__loader`};let Ge=class extends oe{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=i=>{Array.from(i.querySelectorAll("a")).forEach(o=>{ko(o.href)&&!o.hasAttribute("target")&&o.setAttribute("target","_blank")})}}get creator(){return this.viewModel?.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){return this.viewModel?.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){const e=this.viewModel?.state;return u("div",{class:Ut.base},e==="loading"?this._renderLoading():this._renderCreated())}_renderLoading(){return u("div",{class:Ut.loaderContainer,key:"loader"},u("div",{class:Ut.loader}))}_renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:e,key:e}):Bo(e)?u("div",{key:e},!e.destroyed&&e.render()):u("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const t=this;e.appendChild(t)}};r([a()],Ge.prototype,"creator",null),r([a()],Ge.prototype,"graphic",null),r([a({type:Lt})],Ge.prototype,"viewModel",void 0),Ge=r([P("esri.widgets.Feature.FeatureContent")],Ge);const bt=Ge;let ve=class extends ge{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?.forEach(o=>{if(!(!o.hasOwnProperty("visible")||o.visible))return;const n=o.clone();n.label=Lo(n,e),i.push(n)}),i}};r([a()],ve.prototype,"attributes",void 0),r([a({type:[sn]})],ve.prototype,"expressionInfos",void 0),r([a()],ve.prototype,"description",void 0),r([a({type:[uo]})],ve.prototype,"fieldInfos",void 0),r([a({readOnly:!0})],ve.prototype,"formattedFieldInfos",null),r([a()],ve.prototype,"title",void 0),ve=r([P("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],ve);const Rt=ve,$s=[{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 Rs(e,t){if(typeof t!="string"||!t)return t;const i=$s.find(c=>c.pattern.test(t));if(!i)return t;const o=t.match(i.pattern),n=o?.[2],s=ct(ct(i.label,{messages:e,hierPart:n}),{appName:i.appName}),l=i.target?` target="${i.target}"`:"",d=i.target==="_blank"?' rel="noreferrer"':"";return t.replace(i.pattern,`${s}`)}const yt="esri-feature-fields",_t={base:yt,fieldHeader:`${yt}__field-header`,fieldData:`${yt}__field-data`,fieldDataDate:`${yt}__field-data--date`};let he=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new Rt,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new mt,this.addHandles(y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$))}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}render(){return u("div",{class:_t.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:i}=this.viewModel,o=e.fieldName||"",n=e.label||o,s=i?i[o]==null?"":i[o]:"",l=!!e.format?.dateFormat,d=typeof s=="number"&&!l?this._forceLTR(s):Rs(this.messagesURIUtils,s),c={[_t.fieldDataDate]:l};return u("tr",{key:`fields-element-info-row-${o}-${t}`},u("th",{class:_t.fieldHeader,innerHTML:n,key:`fields-element-info-row-header-${o}-${t}`}),u("td",{class:this.classes(_t.fieldData,c),innerHTML:d,key:`fields-element-info-row-data-${o}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?u("table",{class:M.table,summary:this.messages.fieldsSummary},u("tbody",null,e.map((t,i)=>this._renderFieldInfo(t,i)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};r([a()],he.prototype,"attributes",null),r([a()],he.prototype,"description",null),r([a()],he.prototype,"expressionInfos",null),r([a()],he.prototype,"fieldInfos",null),r([a()],he.prototype,"title",null),r([a({type:Rt,nonNullable:!0})],he.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],he.prototype,"messages",void 0),r([a(),Y("esri/widgets/support/t9n/uriUtils")],he.prototype,"messagesURIUtils",void 0),he=r([P("esri.widgets.Feature.FeatureFields")],he);const jo=he,Os={maximumFractionDigits:20};function Vs(e){return Be(e,Os)}const Ss="<",Ds=">";function qs(e,t,i,o){let n="";return t===0?n=`${Ss} `:t===i&&(n=`${Ds} `),n+Vs(e)}const Bs=new po([64,64,64]);function js(e,t){const i=[],o=e.length-1;return e.length===5?i.push(0,2,4):i.push(0,o),e.map((n,s)=>i.includes(s)?qs(n,s,o):null)}async function Ws(e,t,i){let o=!1,n=[],s=[];if(e.stops){const p=e.stops;n=p.map(h=>h.value),o=p.some(h=>!!h.label),o&&(s=p.map(h=>h.label))}const l=n[0],d=n[n.length-1];if(l==null&&d==null)return null;const c=o?null:js(n);return(await Promise.all(n.map(async(p,h)=>({value:p,color:e.type==="opacity"?await zs(p,e):(await w(async()=>{const{getColor:m}=await import("./visualVariableUtils-D3kZJRyn-23qzp7zg.js");return{getColor:m}},__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url)).getColor(e,p),label:o?s[h]:c?.[h]??""})))).reverse()}async function zs(e,t,i){const o=new po(Bs),n=(await w(async()=>{const{getOpacity:s}=await import("./visualVariableUtils-D3kZJRyn-23qzp7zg.js");return{getOpacity:s}},__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url)).getOpacity(t,e);return n!=null&&(o.a=n),o}function Hs(e){if(!e.colorStops)return[];const t=[...e.colorStops].filter(o=>o.color?.a>0);let i=t.length-1;if(t&&t[0]){const o=t[i];o&&o.ratio!==1&&(t.push(new qn({ratio:1,color:o.color})),i++)}return t.map((o,n)=>{let s="";return n===0?s=e.legendOptions?.minLabel||"low":n===i&&(s=e.legendOptions?.maxLabel||"high"),{color:o.color,label:s,ratio:o.ratio}}).reverse()}ho("short-date");async function le(e,t,i){Cn(e,t,()=>[]).push(...i)}async function Us(e){const t=new Map;if(!e)return t;if("visualVariables"in e&&e.visualVariables){const i=e.visualVariables.filter(o=>o.type==="color");for(const o of i){const n=(await Ws(o)??[]).map(s=>s.color);await le(t,o.field||o.valueExpression,n)}}if(e.type==="heatmap"){const i=Hs(e).map(o=>o.color);await le(t,e.field||e.valueExpression,i)}else if(e.type==="pie-chart"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e?.othersCategory?.color,We(e.backgroundFillSymbol,null)])}else if(e.type==="dot-density"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e.backgroundColor])}else if(e.type==="unique-value")if(e.authoringInfo?.type==="predominance")for(const i of e.uniqueValueInfos??[])await le(t,i.value.toString(),[We(i.symbol,null)]);else{const i=(e.uniqueValueInfos??[]).map(d=>We(d.symbol,null)),{field:o,field2:n,field3:s,valueExpression:l}=e;(o||l)&&await le(t,o||l,i),n&&await le(t,n,i),s&&await le(t,s,i)}else if(e.type==="class-breaks"){const i=e.classBreakInfos.map(s=>We(s.symbol,null)),{field:o,valueExpression:n}=e;await le(t,o??n,i)}else e.type==="simple"&&await le(t,"default",[We(e.symbol,null)]);return"defaultSymbol"in e&&e.defaultSymbol&&await le(t,"default",[We(e.defaultSymbol,null)]),t.forEach((i,o)=>{const n=ui(i.filter(Boolean),(s,l)=>JSON.stringify(s)===JSON.stringify(l));t.set(o,n)}),t}const Zs="esri.widgets.Feature.support.relatedFeatureUtils",Wi=()=>K.getLogger(Zs),zi=new Map;function It(e){if(!Ie(e))return null;const[t,i]=e.split("/").slice(1);return{layerId:t,fieldName:i}}function Gs(e,t){if(!t.relationships)return null;let i=null;const{relationships:o}=t;return o.some(n=>n.id===parseInt(e,10)&&(i=n,!0)),i}function Qs({originRelationship:e,relationships:t,layerId:i}){return t.find(({relatedTableId:o,id:n})=>`${o}`===i&&n===e?.id)??null}function Xs(e,t){const i=t.toLowerCase();for(const o in e)if(o.toLowerCase()===i)return e[o];return null}function Js(e,t){const i=Gs(e,t);if(i)return{url:`${t.url}/${i.relatedTableId}`,sourceSpatialReference:t.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function Ks(e,t){if(!t||!e)return;const{features:i,statsFeatures:o}=e,n=i?.value;t.relatedFeatures=n?n.features:[];const s=o?.value;t.relatedStatsFeatures=s?s.features:[]}function Ys(e,t,i,o){const n=new Kt;return n.outFields=["*"],n.relationshipId=typeof t.id=="number"?t.id:parseInt(t.id,10),n.objectIds=[e.attributes[i.objectIdField]],n.gdbVersion=i.gdbVersion??null,n.historicMoment=i.historicMoment??null,i.queryRelatedFeatures?.(n,o)??Promise.resolve({})}function er(e,t,i){let o=0;const n=[];for(;oJSON.stringify(t.toJSON())===JSON.stringify(i.toJSON())):void 0}async function or(e,t,i,o){const n=i.layerId.toString(),{layerInfo:s,relation:l,relatedFields:d,outStatistics:c,url:p,sourceSpatialReference:h}=t,m=tr(d),f=ir(c);if(!s||!l)return null;const g=Qs({originRelationship:l,relationships:s.relationships,layerId:n});if(g?.relationshipTableId&&g.keyFieldInRelationshipTable){const I=(await Ys(e,g,i,o))[e.attributes[i.objectIdField]];if(!I)return null;const C=I.features.map(_=>_.attributes[s.objectIdField]);if(f?.length&&s.supportsStatistics){const _=new lt;_.where=er(s.objectIdField,C,1e3),_.outFields=m,_.outStatistics=f,_.sourceSpatialReference=h;const T={features:Promise.resolve(I),statsFeatures:Dt(p,_)};return qe(T)}}const v=g?.keyField;if(v){const I=Fn(lr(s.fields,v)),C=Xs(e.attributes,l.keyField),_=I?`${v}=${C}`:`${v}='${C}'`,T=i.historicMoment,b=i.gdbVersion,G=Dt(p,new lt({where:_,outFields:m,sourceSpatialReference:h,historicMoment:T,gdbVersion:b}),o),W=f?.length&&s.supportsStatistics?Dt(p,new lt({where:_,outFields:m,outStatistics:f,sourceSpatialReference:h}),o):null,q={features:G};return W&&(q.statsFeatures=W),qe(q)}return null}function nr(e,t){return Mn(e,{query:{f:"json"},signal:t?.signal})}function sr({relatedInfos:e,layer:t},i){const o={};return e.forEach((n,s)=>{const{relation:l}=n;if(!l){const m=new N("relation-required","A relation is required on a layer to retrieve related records.");throw Wi().error(m),m}const{relatedTableId:d}=l;if(typeof d!="number"){const m=new N("A related table ID is required on a layer to retrieve related records.");throw Wi().error(m),m}const c=`${t.url}/${d}`,p=zi.get(c),h=p??nr(c);p||zi.set(c,h),o[s]=h}),gn(qe(o),i)}function rr({graphic:e,relatedInfos:t,layer:i},o){const n={};return t.forEach((s,l)=>{s.layerInfo&&(n[l]=or(e,s,i,o))}),qe(n)}function ar({relatedInfo:e,fieldName:t,fieldInfo:i}){if(e.relatedFields?.push(t),i.statisticType){const o=new Bn({statisticType:i.statisticType,onStatisticField:t,outStatisticFieldName:t});e.outStatistics?.push(o)}}function lr(e,t){if(e!=null){t=t.toLowerCase();for(const i of e)if(i&&i.name.toLowerCase()===t)return i}return null}const Hi={chartAnimation:!0};let H=class extends ge{constructor(e){super(e),this.abilities={...Hi},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...Hi,...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{mediaInfos:e,layer:t}=this,i=this.attributes??{},o=this.formattedAttributes??{},n=this.expressionAttributes??{},s=this.fieldInfoMap??new Map;return e?.map(l=>{const d=l?.clone();return d?(d.title=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.title}),d.caption=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.caption}),d.altText=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.altText}),d.type==="image"?d.value?(this._setImageValue({value:d.value,formattedAttributes:o,layer:t}),d.value.sourceURL?d:void 0):void 0:d.type==="pie-chart"||d.type==="line-chart"||d.type==="column-chart"||d.type==="bar-chart"?d.value?(this._setChartValue({value:d.value,chartType:d.type,attributes:i,formattedAttributes:o,layer:t,expressionAttributes:n}),d):void 0:null):null}).filter(Nt)??[]}_setImageValue(e){const t=this.fieldInfoMap??new Map,{value:i,formattedAttributes:o,layer:n}=e,{linkURL:s,sourceURL:l}=i;if(l){const d=ii(l,n);i.sourceURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}if(s){const d=ii(s,n);i.linkURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:i,formattedAttributes:o,chartType:n,layer:s,expressionAttributes:l}=e,{popupTemplate:d,relatedInfos:c}=this,{fields:p,normalizeField:h}=t,m=s;if(t.fields=ss(p,m),h&&(t.normalizeField=ut(h,m)),!p.some(g=>!!(o[g]!=null||Ie(g)&&c?.size)))return;const f=d?.fieldInfos??[];p.forEach((g,v)=>{const I=t.colors?.[v];if(Ie(g))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:f,fieldName:g,formattedAttributes:o,chartType:n,value:t,color:I})]);const C=this._getChartOption({value:t,attributes:i,chartType:n,formattedAttributes:o,expressionAttributes:l,fieldName:g,fieldInfos:f,color:I});t.series.push(C)})}_getRelatedChartInfos(e){const{fieldInfos:t,fieldName:i,formattedAttributes:o,chartType:n,value:s,color:l}=e,d=[],c=It(i),p=c&&this.relatedInfos?.get(c.layerId.toString());if(!p)return d;const{relatedFeatures:h,relation:m}=p;if(!m||!h)return d;const{cardinality:f}=m;return h.forEach(g=>{const{attributes:v}=g;v&&Object.keys(v).forEach(I=>{I===c.fieldName&&d.push(this._getChartOption({value:s,attributes:v,formattedAttributes:o,fieldName:i,chartType:n,relatedFieldName:I,hasMultipleRelatedFeatures:h?.length>1,fieldInfos:t,color:l}))})}),f==="one-to-many"||f==="many-to-many"?d:[d[0]]}_getTooltip({label:e,value:t,chartType:i}){return i==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){const{value:t,attributes:i,formattedAttributes:o,expressionAttributes:n,fieldName:s,relatedFieldName:l,fieldInfos:d,chartType:c,hasMultipleRelatedFeatures:p,color:h}=e,m=this.layer,f=this.fieldInfoMap??new Map,{normalizeField:g,tooltipField:v}=t,I=g?Ie(g)?i[It(g).fieldName]:i[g]:null,C=hi(s)&&n&&n[s]!==void 0?n[s]:l&&i[l]!==void 0?i[l]:i[s]!==void 0?i[s]:o[s],_=new yn({fieldName:s,color:h,value:C===void 0?null:C&&I?C/I:C});if(Ie(s)){const q=f.get(s.toLowerCase()),ue=v&&f.get(v.toLowerCase()),ae=q?.fieldName??s,Vt=p&&v?It(v).fieldName:ue?.fieldName??v,on=p&&Vt?i[Vt]:o[Vt]??q?.label??q?.fieldName??l,nn=p&&l?i[l]:o[ae];return _.tooltip=this._getTooltip({label:on,value:nn,chartType:c}),_}const T=Ro(d,s),b=ut(s,m),G=v&&o[v]!==void 0?o[v]:Lo(T||new uo({fieldName:b}),this.popupTemplate?.expressionInfos),W=o[b];return _.tooltip=this._getTooltip({label:G,value:W,chartType:c}),_}};r([a()],H.prototype,"abilities",void 0),r([et("abilities")],H.prototype,"castAbilities",null),r([a()],H.prototype,"activeMediaInfoIndex",void 0),r([a({readOnly:!0})],H.prototype,"activeMediaInfo",null),r([a()],H.prototype,"attributes",void 0),r([a()],H.prototype,"description",void 0),r([a()],H.prototype,"fieldInfoMap",void 0),r([a()],H.prototype,"formattedAttributes",void 0),r([a()],H.prototype,"expressionAttributes",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfos",null),r([a()],H.prototype,"isAggregate",void 0),r([a()],H.prototype,"layer",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfoCount",null),r([a()],H.prototype,"mediaInfos",void 0),r([a()],H.prototype,"popupTemplate",void 0),r([a()],H.prototype,"relatedInfos",void 0),r([a()],H.prototype,"title",void 0),H=r([P("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],H);const Se=H,z="esri-feature-media",te={base:z,mediaContainer:`${z}__container`,mediaItemContainer:`${z}__item-container`,mediaItem:`${z}__item`,mediaItemText:`${z}__item-text`,mediaItemTitle:`${z}__item-title`,mediaItemCaption:`${z}__item-caption`,mediaNavigation:`${z}__item-navigation`,mediaPagination:`${z}__pagination`,mediaPaginationText:`${z}__pagination-text`,mediaPrevious:`${z}__previous`,mediaPreviousIconLTR:`${z}__previous-icon`,mediaPreviousIconRTL:`${z}__previous-icon--rtl`,mediaNext:`${z}__next`,mediaNextIconLTR:`${z}__next-icon`,mediaNextIconRTL:`${z}__next-icon--rtl`,mediaChart:`${z}__chart`,mediaPaginationButton:`${z}__pagination-button`,mediaPaginationIcon:`${z}__pagination-icon`,mediaChartRendered:`${z}__chart--rendered`},Zt=15,Fe="category",tt="value",dr="rgba(50, 50, 50, 1)",cr=250,ur=500,pr=200;let ie=class extends oe{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new Se,this.messages=null,this._disposeChart=i=>{this._chartRootMap.get(i)?.dispose(),this._chartRootMap.delete(i)},this._createChart=async i=>{const{destroyed:o,viewModel:n}=this;if(o||!n||!i)return;const{createRoot:s}=await w(()=>import("./chartUtilsAm5-CtY-kHPy-B6BgNVnq.js"),__vite__mapDeps([14,4,5,3,6,15,16,17]),import.meta.url),l=await s(i);this._chartRootMap.set(i,l),this._renderChart({mediaInfo:n.activeMediaInfo,root:l})}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),$),y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Dn93dMQE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)})}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(){return u("div",{bind:this,class:te.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:te.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:te.mediaNavigation},i,e>1?u("div",{class:te.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:te.mediaPaginationText},pe(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:te.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:te.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:te.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:o}=this.viewModel,{value:n,refreshInterval:s,altText:l,title:d,type:c}=e,{sourceURL:p,linkURL:h}=n,m=ko(h??void 0)?"_blank":"_self",f=m==="_blank"?"noreferrer":"",g=s?t:null,v=g?g.timestamp:0,I=g?g.sourceURL:p,C=u("img",{alt:l||d,key:`media-${c}-${i}-${o}-${v}`,src:I??void 0});return(h?u("a",{href:h,rel:f,target:m,title:d},C):null)??C}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:te.mediaChart,key:`media-${e.type}-${t}-${i}`})}_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;return e?u("div",{class:te.mediaItemContainer,key:"media-container"},u("div",{class:te.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",i=t?this.messages.previous:this.messages.next,o=t?"chevron-left":"chevron-right",n=t?"media-previous":"media-next",s=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:te.mediaPaginationButton,key:n,onclick:s,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:te.mediaPaginationIcon,icon:o,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await w(()=>import("./chartCommon-rWfJsTPl-BkhcWsMI.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),i=new Map;return e.forEach(o=>{o.color&&i.set(o,t(o.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await w(()=>import("./chartCommon-rWfJsTPl-BkhcWsMI.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),t=new Map,i=this._getRenderer(),o="default";if(!i)return t;const n=await Us(i);return n.delete(o),Array.from(n.values()).every(s=>s?.length===1)&&Array.from(n.keys()).forEach(s=>{const l=n.get(s)?.[0]?.toCss(!0);l&&t.set(s,e(l))}),t}_handleMediaKeyup(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!On()}_getChartAnimationMS(){return this._canAnimateChart()?cr:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?ur:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:o,type:n}=i,{ResponsiveThemeAm5:s,DarkThemeAm5:l,AnimatedThemeAm5:d,ColorSetAm5:c,ThemeAm5:p,esriChartColorSet:h}=await w(async()=>{const{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}=await import("./chartCommon-rWfJsTPl-BkhcWsMI.js");return{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}},__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),m=p.new(t);m.rule("ColorSet").set("colors",h),m.rule("ColorSet").set("reuse",!0);const f=[s.new(t),m];kn()&&f.push(l.new(t)),this._canAnimateChart()&&f.push(d.new(t)),t.setThemes(f);const g=await this._getRendererColors(),v=await this._getSeriesColors(o.series),I=c.new(t,{}),C=v.get(o.series[0]),_=C?{lineSettings:{stroke:C}}:void 0,T=o.series.map((b,G)=>{const W=v.get(b)||g.get(b.fieldName)||I.getIndex(G);return{[Fe]:b.tooltip,[tt]:b.value,columnSettings:{fill:W,stroke:W},..._}}).filter(b=>n!=="pie-chart"||b.value!=null&&b.value>0);n==="pie-chart"?this._createPieChart(e,T):this._createXYChart(e,T)}_getDirection(){return be(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-BkhcWsMI.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url);e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(dr)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:pr})}async _createPieChart(e,t){const{TooltipAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-BkhcWsMI.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{PieChartAm5:o,PieSeriesAm5:n}=await w(async()=>{const{PieChartAm5:v,PieSeriesAm5:I}=await import("./pieChart-qcxaoQkv-D93Sy6JQ.js");return{PieChartAm5:v,PieSeriesAm5:I}},__vite__mapDeps([21,3,4,5,6,22,15,20,17]),import.meta.url),{mediaInfo:s,root:l}=e,{title:d}=s,c=5,p=s?.altText||s?.title||"",h=l.container.children.push(o.new(l,{ariaLabel:p,focusable:!0,paddingBottom:c,paddingTop:c,paddingLeft:c,paddingRight:c})),m=`{category}: {valuePercentTotal.formatNumber('0.00')}% - ({value})`,f=i.new(l,{labelText:m}),g=h.series.push(n.new(l,{name:d,valueField:tt,categoryField:Fe,tooltip:f}));g.ticks.template.set("forceHidden",!0),g.labels.template.set("forceHidden",!0),g.slices.template.states.create("active",{shiftRadius:c}),this._customizeChartTooltip(f),g.slices.template.setAll({ariaLabel:m,focusable:!0,templateField:"columnSettings"}),g.data.setAll(t),g.appear(this._getChartSeriesAnimationMS()),h.appear(this._getChartAnimationMS()),h.root.dom.classList.toggle(te.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(i=>t=Math.min(i.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-BkhcWsMI.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-DytGK0KM.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(m,{renderer:l.new(m,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(m,{renderer:c.new(m,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:_}));this._customizeChartTooltip(_),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarX",n.new(m,{orientation:"horizontal"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-BkhcWsMI.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-DytGK0KM.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panY",wheelY:"zoomY"});const v=e.yAxes.push(s.new(m,{renderer:c.new(m,{inversed:!0}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.xAxes.push(d.new(m,{renderer:l.new(m,{inside:!1,inversed:be(this.container)}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryY}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:I,yAxis:v,valueXField:tt,categoryYField:Fe,tooltip:_}));this._customizeChartTooltip(_,"vertical"),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarY",n.new(m,{orientation:"vertical"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-BkhcWsMI.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,LineSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}=await import("./xyChart-Ch-p5aUf-DytGK0KM.js");return{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{root:h,mediaInfo:m}=t,{value:f,title:g}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(h,{renderer:l.new(h,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(h,{renderer:c.new(h,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=i[0]?.lineSettings?.stroke,T=o.new(h,{getFillFromSprite:!_,labelText:C});_&&T.get("background")?.setAll({fill:_});const b=e.series.push(p.new(h,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:T}));b.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(T,"vertical"),f.series.length>Zt&&e.set("scrollbarX",n.new(h,{orientation:"horizontal"})),v.data.setAll(i),b.data.setAll(i),b.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:o}=await w(()=>import("./xyChart-Ch-p5aUf-DytGK0KM.js"),__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{root:n,mediaInfo:s}=e,{type:l}=s,d=s?.altText||s?.title||"",c=n.container.children.push(i.new(n,{ariaLabel:d,focusable:!0,panX:!0,panY:!0}));c.set("cursor",o.new(n,{})),l==="column-chart"&&await this._createColumnChart(c,e,t),l==="bar-chart"&&await this._createBarChart(c,e,t),l==="line-chart"&&await this._createLineChart(c,e,t),c.root.dom.classList.toggle(te.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e?.type==="image"&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,o=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const n=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},o);this._refreshTimer=n}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[o,n=""]=e.split("#");return`${o}${i}timestamp=${t}${n?"#":""}${n}`}};r([a()],ie.prototype,"_refreshIntervalInfo",void 0),r([a()],ie.prototype,"attributes",null),r([a()],ie.prototype,"activeMediaInfoIndex",null),r([a()],ie.prototype,"description",null),r([a()],ie.prototype,"fieldInfoMap",null),r([a()],ie.prototype,"layer",null),r([a()],ie.prototype,"mediaInfos",null),r([a()],ie.prototype,"popupTemplate",null),r([a()],ie.prototype,"relatedInfos",null),r([a()],ie.prototype,"title",null),r([a({type:Se})],ie.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],ie.prototype,"messages",void 0),ie=r([P("esri.widgets.Feature.FeatureMedia")],ie);const Wo=ie,hr="esri.widgets.Feature.support.arcadeFeatureUtils",Ui=()=>K.getLogger(hr);function mr(e){return typeof e=="string"?ht(fi(e)):Array.isArray(e)?fr(e):e?.declaredClass==="esri.arcade.Dictionary"?gr(e):e}function fr(e){return`
    ${e.map(t=>`
  • ${typeof t=="string"?ht(fi(t)):t}
  • `).join("")}
`}function gr(e){const t=e.keys().map(i=>{const o=e.field(i);return`${i}${typeof o=="string"?ht(fi(o)):o}`}).join("");return`${t}
`}function zo(){return w(()=>import("./arcade-CaGqU4sP-CfTmGx37.js"),__vite__mapDeps([24,3,4,5,6,25,26,27,28,29,30,31,32,13,10,11,12,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,7,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103]),import.meta.url)}function yr(e){return"createQuery"in e&&"queryFeatures"in e}async function _r({graphic:e,view:t,options:i}){const{isAggregate:o,layer:n}=e;if(!o||!n||t?.type!=="2d")return[];const s=await t.whenLayerView(n);if(!yr(s))return[];const l=s.createQuery(),d=e.getObjectId();l.aggregateIds=d!=null?[d]:[];const{features:c}=await s.queryFeatures(l,i);return c}function vr({layer:e,aggregatedFeatures:t,interceptor:i}){const{fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d}=e;return new Mo({fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d,interceptor:i,...e.type==="feature"?{templates:e.templates,typeIdField:e.typeIdField,types:e.types}:null,source:t})}async function Ho({expressionInfo:e,arcade:t,interceptor:i,spatialReference:o,map:n,graphic:s,location:l,view:d,options:c}){if(!e?.expression)return null;const{isAggregate:p}=s,h=(s.sourceLayer||s.layer)??void 0,m=p?"feature-reduction-popup":"popup",f=t.createArcadeProfile(m),g=t.createArcadeExecutor(e.expression,f).catch(b=>Ui().error("arcade-executor-error",{error:b,expressionInfo:e})),[v,I]=await Promise.all([_r({graphic:s,view:d,options:c}),g]);if(!I)return null;const C=m==="feature-reduction-popup"?vr({layer:h,aggregatedFeatures:v,interceptor:i}):void 0,_={...m==="feature-reduction-popup"?{$aggregatedFeatures:C}:{$datastore:h?.url,$layer:h!=null&&jn(h)?h:h?.type==="scene"&&h.associatedLayer!=null?h.associatedLayer:void 0,$map:n,$userInput:l,$graph:h?.type==="knowledge-graph-sublayer"?h?.parentCompositeLayer?.knowledgeGraph:void 0},$feature:s},T={abortSignal:c?.signal??void 0,interceptor:i??void 0,rawOutput:!0,spatialReference:o??void 0,timeZone:d?.timeZone};return await I.executeAsync(_,T).catch(b=>Ui().error("arcade-execution-error",{error:b,graphic:s,expressionInfo:e})).finally(()=>C?.destroy())}async function wr({expressionInfos:e,spatialReference:t,graphic:i,interceptor:o,map:n,view:s,location:l,options:d}){if(!e?.length)return{};const c=await zo(),p={};for(const f of e)p[`expression/${f.name}`]=Ho({expressionInfo:f,arcade:c,interceptor:o,spatialReference:t,map:n,graphic:i,location:l,view:s,options:d});const h=await qe(p),m={};for(const f in h)m[f]=mr(h[f].value);return m}const br=1;let se=class extends ge{constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{const t=this.contentElement?.type;this.contentElementViewModel?.destroy();const i=t==="fields"?new Rt:t==="media"?new Se:t==="text"?new Lt: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=pi(this._compile,br,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:i,interceptor:o,spatialReference:n,map:s,location:l,view:d,_abortController:c}=this;if(!t||!i)return void this._set("contentElement",null);const p=await zo();if(c!==this._abortController)return;const h=await Ho({arcade:p,expressionInfo:t,graphic:i,location:l,interceptor:o,map:s,spatialReference:n,view:d});if(!h||h.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const m=await h.castAsJsonAsync(c?.signal),f=m?.type,g=f==="media"?_n.fromJSON(m):f==="text"?go.fromJSON(m):f==="fields"?vn.fromJSON(m):null;g.type==="media"&&!g.mediaInfos||g.type==="fields"&&!g.fieldInfos||g.type==="text"&&!g.text?this._set("contentElement",null):this._set("contentElement",g)},this.addHandles([y(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),$),y(()=>[this.contentElement],()=>this._createVM(),$)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){this._cancelQuery(),this.contentElementViewModel?.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){return this.view?.spatialReference??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(){return this.view?.map??null}set map(e){this._override("map",e)}};r([a()],se.prototype,"_abortController",void 0),r([a({type:rn})],se.prototype,"expressionInfo",void 0),r([a({type:je})],se.prototype,"graphic",void 0),r([a({readOnly:!0})],se.prototype,"contentElement",void 0),r([a({readOnly:!0})],se.prototype,"contentElementViewModel",void 0),r([a()],se.prototype,"interceptor",void 0),r([a({type:ai})],se.prototype,"location",void 0),r([a()],se.prototype,"spatialReference",null),r([a({readOnly:!0})],se.prototype,"state",null),r([a()],se.prototype,"map",null),r([a()],se.prototype,"view",void 0),se=r([P("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],se);const vi=se,Zi="esri-feature",Gi={base:`${Zi}-expression`,loadingSpinnerContainer:`${Zi}__loading-container`};let At=class extends oe{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new vi}initialize(){this.addHandles(y(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),$))}loadDependencies(){return Ae({loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Bzq4cVWG.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return u("div",{class:Gi.base},e==="loading"?this._renderLoading():e==="disabled"?null:this._contentWidget?.render())}_renderLoading(){return u("div",{class:Gi.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,i=t?.type;this._destroyContentWidget();const o=e?i==="fields"?new jo({viewModel:e}):i==="media"?new Wo({viewModel:e}):i==="text"?new bt({viewModel:e}):null:null;this._contentWidget=o,this.scheduleRender()}};r([a({type:vi})],At.prototype,"viewModel",void 0),At=r([P("esri.widgets.Feature.FeatureExpression")],At);const Ir=At;var Qi;(function(e){e.TOO_SHORT="length-validation-error::too-short",e.TOO_LONG="length-validation-error::too-long"})(Qi||(Qi={}));const Ar=e=>{const t=[];if(e.formTemplate){const{description:i,title:o}=e.formTemplate;e.fields?.forEach(n=>{const s=o&&Ei(o,n.name),l=i&&Ei(i,n.name);(s||l)&&t.push(n.name)})}return t},Gt=100;let R=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,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 ke(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await ke(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryDebounced=Ke(this._queryController,Gt),this._queryFeatureCountDebounced=Ke(this._queryFeatureCountController,Gt),this._queryPageDebounced=Ke(this._queryPageController,Gt),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:i}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,i.destroyAll(),this.destroyed||i.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t?.signal}))))},this.addHandles([y(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount],()=>this._queryDebounced(),$),y(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),y(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:i}=this,o=1,n=Math.ceil(i/t)||1;this._set("featurePage",Math.min(Math.max(e,o),n))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(i=>{const o=i.clone();return o.field=ut(i.field,t),o}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&this.relationshipId!=null&&this.objectId!=null&&e?.supportsCount&&e?.supportsPagination)}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new ce}get relatedLayer(){const{layer:e,map:t,relationship:i}=this;return e?.loaded&&t&&i?Cs(t,e,i)??null:null}get relationship(){const{relationshipId:e,layer:t}=this;return e!=null?t?.relationships?.find(({id:i})=>i===e)??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new ce}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.destroyAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t,relationshipId:i,objectId:o,_queryFeatureCountAbortController:n,canQuery:s,supportsCacheHint:l}=this;if(await e?.load(),await t?.load(),!s||!e||!t||o==null)return void this._set("featureCount",0);const d=t.createQuery(),{historicMoment:c,gdbVersion:p}=e,h=new Kt({cacheHint:l,gdbVersion:p,historicMoment:c,relationshipId:i,returnGeometry:!1,objectIds:[o],where:d.where??void 0}),m=await e.queryRelatedFeaturesCount(h,{signal:n?.signal});this._set("featureCount",m[o]||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:o,featureCount:n}=this;!i||t<2||!n||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{orderByFieldsFixedCasing:t,showAllEnabled:i,featuresPerPage:o,displayCount:n,layer:s,relationshipId:l,featurePage:d,featureCount:c,relatedLayer:p,supportsCacheHint:h}=this,{canQuery:m,objectId:f}=this;if(!m||!s||!p||f==null)return[];const g=i?((d-1)*o+c)%c:0,v=i?o:n,I=p.objectIdField,C=[...t.map(ae=>ae.field),...Ar(p),I].filter(Nt),_=t.map(ae=>`${ae.field} ${ae.order}`),T=p.createQuery(),{historicMoment:b,gdbVersion:G}=s,W=new Kt({orderByFields:_,start:g,num:v,outFields:C,cacheHint:h,historicMoment:b,gdbVersion:G,relationshipId:l,returnGeometry:!1,objectIds:[f],where:T.where??void 0}),q=await s.queryRelatedFeatures(W,{signal:e?.signal}),ue=q[f]?.features||[];return ue.forEach(ae=>{ae.sourceLayer=p,ae.layer=p}),ue}};r([a()],R.prototype,"_loaded",void 0),r([a()],R.prototype,"_queryAbortController",void 0),r([a()],R.prototype,"_queryPageAbortController",void 0),r([a()],R.prototype,"_queryFeatureCountAbortController",void 0),r([a({value:1})],R.prototype,"featurePage",null),r([a()],R.prototype,"featuresPerPage",void 0),r([a({readOnly:!0})],R.prototype,"orderByFieldsFixedCasing",null),r([a({readOnly:!0})],R.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],R.prototype,"canLoad",null),r([a({readOnly:!0})],R.prototype,"canQuery",null),r([a()],R.prototype,"description",void 0),r([a({readOnly:!0})],R.prototype,"itemDescriptionFieldName",null),r([a({value:3})],R.prototype,"displayCount",null),r([a({type:je})],R.prototype,"graphic",void 0),r([a()],R.prototype,"layer",void 0),r([a()],R.prototype,"map",void 0),r([a({readOnly:!0})],R.prototype,"objectId",null),r([a({readOnly:!0})],R.prototype,"objectIdField",null),r([a()],R.prototype,"orderByFields",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatures",null),r([a({readOnly:!0})],R.prototype,"relatedLayer",null),r([a({readOnly:!0})],R.prototype,"relationship",null),r([a()],R.prototype,"featureCount",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatureViewModels",null),r([a()],R.prototype,"relationshipId",void 0),r([a()],R.prototype,"showAllEnabled",void 0),r([a()],R.prototype,"state",null),r([a()],R.prototype,"title",void 0),R=r([P("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],R);const wi=R;var oi;const Ft="esri-feature",it=`${Ft}-relationship`,Me={base:it,listContainer:`${it}__list`,listItem:`${it}__list-item`,listItemHidden:`${it}__list-item--hidden`,listContainerQuerying:`${it}__list--querying`,featureObserver:`${Ft}__feature-observer`,stickySpinnerContainer:`${Ft}__sticky-loading-container`,loadingSpinnerContainer:`${Ft}__loading-container`},Xi={title:!0,description:!0};let U=oi=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new wi,this.messages=null,this.messagesCommon=null,this.visibleElements={...Xi},this._increaseFeaturePage=()=>{const{state:i,showAllEnabled:o,relatedFeatures:n,featuresPerPage:s,featurePage:l}=this.viewModel;i==="ready"&&o&&n.length>=s*l&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),dt(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Dn93dMQE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-CeNaNcvH.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-CrZ_qcBF.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Bzq4cVWG.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-Cd7Uc4RY.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url)})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=wo(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:i,state:o}=this.viewModel;return!e&&!!t&&o==="ready"&&(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 pe(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...Xi,...e}}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(Me.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures())}async _selectRecord(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:i}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:i}=this;t.showAllEnabled=!0;const o=new oi({flowItems:e,featureVisibleElements:i,visibleElements:{title:!1,description:!1},viewModel:t});e.push(o)}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:Me.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:Me.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=be(this.container)?"chevron-left":"chevron-right";return u("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,i=e.title;e.description=t&&e.formattedAttributes?.global[t];const o=e.state==="loading";return u("calcite-list-item",{class:this.classes(Me.listItem,{[Me.listItemHidden]:o}),description:e.description??"",key:e.uid,label:i,onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?u("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return u("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return u("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:Me.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return u("calcite-list",null,e.toArray().map(t=>this._renderRelatedFeature(t)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return u("div",{class:this.classes(Me.listContainer,{[Me.listContainerQuerying]:t==="querying"}),key:"list-container"},e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(i=>{this.addHandles(y(()=>[i.title,i.state],()=>this.scheduleRender(),$),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};r([a()],U.prototype,"_relatedFeatureIntersectionObserverNode",void 0),r([a({readOnly:!0})],U.prototype,"displayShowAllButton",null),r([a({readOnly:!0})],U.prototype,"displayListItems",null),r([a()],U.prototype,"description",null),r([a({readOnly:!0})],U.prototype,"featureCountDescription",null),r([a()],U.prototype,"featureVisibleElements",void 0),r([a()],U.prototype,"flowItems",void 0),r([a()],U.prototype,"flowType",void 0),r([a()],U.prototype,"headingLevel",void 0),r([a()],U.prototype,"title",null),r([a({type:wi})],U.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],U.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],U.prototype,"messagesCommon",void 0),r([a()],U.prototype,"visibleElements",void 0),r([et("visibleElements")],U.prototype,"castVisibleElements",null),U=oi=r([P("esri.widgets.Feature.FeatureRelationship")],U);const Fr=U;var Ji;(function(e){e[e.RTJunctionJunctionConnectivity=1]="RTJunctionJunctionConnectivity",e[e.RTAttachment=2]="RTAttachment",e[e.RTContainment=3]="RTContainment",e[e.RTJunctionEdgeConnectivity=4]="RTJunctionEdgeConnectivity",e[e.RTEdgeJunctionEdgeConnectivity=5]="RTEdgeJunctionEdgeConnectivity"})(Ji||(Ji={})),new di({connected:"connected",upstream:"upstream",downstream:"downstream",shortestPath:"shortest-path",subnetwork:"subnetwork",subnetworkController:"subnetwork-controller",loops:"loops",isolation:"isolation"});const vt=new di({junctionJunctionConnectivity:"junction-junction-connectivity",connectivity:"connectivity",attachment:"attachment",containment:"containment",junctionEdgeFromConnectivity:"junction-edge-from-connectivity",junctionMidspanConnectivity:"junction-midspan-connectivity",junctionEdgeToConnectivity:"junction-edge-to-connectivity"}),Mr=Array.from({length:33},(e,t)=>2*t),Cr=new Map([[1,"connectivity"],[2,"containment"],[3,"attachment"],[4,"junction-edge-from-connectivity"],[5,"junction-midspan-connectivity"],[6,"junction-edge-to-connectivity"]]);new di({normal:"normal",rebuild:"rebuild",forceRebuild:"force-rebuild"});let me=class extends bo{constructor(e){super(e),this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null}};r([a({type:Number,json:{write:!0}})],me.prototype,"assetGroupCode",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"assetTypeCode",void 0),r([a({type:String,json:{write:!0}})],me.prototype,"globalId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"networkSourceId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"objectId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionFrom",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionTo",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"terminalId",void 0),me=r([P("esri.rest.networks.support.NetworkElement")],me);const Ye=me;let J=class extends bo{constructor(e){super(e),this.globalId=null,this.associationType=null,this.fromNetworkElement=null,this.toNetworkElement=null,this.geometry=null,this.errorMessage=null,this.percentAlong=null,this.errorCode=null,this.isContentVisible=null,this.status=null}readFromNetworkElement(e,t){return new Ye({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId})}writeFromNetworkElement(e,t){e&&(t.fromGlobalId=e.globalId,t.fromNetworkSourceId=e.networkSourceId,t.fromTerminalId=e.terminalId)}readToNetworkElement(e,t){return new Ye({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId})}writeToNetworkElement(e,t){e&&(t.toGlobalId=e.globalId,t.toNetworkSourceId=e.networkSourceId,t.toTerminalId=e.terminalId)}};r([a({type:String,json:{write:!0}})],J.prototype,"globalId",void 0),r([a({type:vt.apiValues,json:{type:vt.jsonValues,read:vt.read,write:vt.write}})],J.prototype,"associationType",void 0),r([a({type:Ye,json:{write:{target:{fromGlobalId:{type:String},fromNetworkSourceId:{type:Number},fromTerminalId:{type:Number}}},read:{source:["fromGlobalId","fromNetworkSourceId","fromTerminalId"]}}})],J.prototype,"fromNetworkElement",void 0),r([Fi("fromNetworkElement")],J.prototype,"readFromNetworkElement",null),r([Mi("fromNetworkElement")],J.prototype,"writeFromNetworkElement",null),r([a({type:Ye,json:{write:{target:{toGlobalId:{type:String},toNetworkSourceId:{type:Number},toTerminalId:{type:Number}}},read:{source:["toGlobalId","toNetworkSourceId","toTerminalId"]}}})],J.prototype,"toNetworkElement",void 0),r([Fi("toNetworkElement")],J.prototype,"readToNetworkElement",null),r([Mi("toNetworkElement")],J.prototype,"writeToNetworkElement",null),r([a({type:an,json:{write:!0}})],J.prototype,"geometry",void 0),r([a({type:String,json:{write:!0}})],J.prototype,"errorMessage",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"percentAlong",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"errorCode",void 0),r([a({type:Boolean,json:{write:!0}})],J.prototype,"isContentVisible",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"status",void 0),J=r([P("esri.rest.networks.support.Association")],J);const Er=J,V={fromGlobalId:"fromglobalid",fromNetworkSourceId:"fromnetworksourceid",fromTerminalId:"fromterminalid",toGlobalId:"toglobalid",toNetworkSourceId:"tonetworksourceid",toTerminalId:"toterminalid",associationType:"associationtype",globalId:"globalid",status:"status",isContentVisible:"iscontentvisible",percentAlong:"percentalong",assetGroup:"assetgroup",assetType:"assettype"},Ki=100;let E=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,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._queryController=async t=>{this._cancelQuery();const i=new AbortController;this._queryAbortController=i,await ke(this._query(t)),this._queryAbortController===i&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=Ke(this._queryController,Ki),this._queryFeatureCountDebounced=Ke(this._queryFeatureCountController,Ki)}initialize(){this.associationTypes?.forEach(e=>{e.open=!1}),this.addHandles([...this.associationTypes?.map(e=>y(()=>e.open,()=>{e.open&&this._queryDebounced(e)}))??[],y(()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery],()=>this._queryFeatureCountDebounced(),$)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&typeof this.globalId=="string"}get canQuery(){const e=this.layer?.capabilities?.query;return!!this.associationTypes&&typeof this.globalId=="string"&&!!e?.supportsPagination}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:e}=this;return e?.type==="subtype-sublayer"&&e?.parent?e.parent.globalIdField??null:e?.globalIdField??null}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o&&this.featureCount!==0?"ready":"disabled"}get utilityNetwork(){const{layer:e,map:t}=this;return e?.loaded&&t?e?.type==="subtype-sublayer"&&e?.parent?Si(t,e.parent)??null:Si(t,e)??null:null}get associationsLayer(){const{utilityNetwork:e}=this;return e?.loaded?new Mo({url:e.networkSystemLayers.associationsTableUrl,gdbVersion:e.gdbVersion}):null}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new ce}get structureAssociations(){return this._get("structureAssociations")||new ce}get contentAssociations(){return this._get("contentAssociations")||new ce}get containerAssociations(){return this._get("containerAssociations")||new ce}get connectivityAssociations(){return this._get("connectivityAssociations")||new ce}get associationFeatures(){return this._get("associationFeatures")||new Co}get associationViewModels(){return this._get("associationViewModels")||new Map}refresh(){this._queryFeatureCountDebounced()}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach(e=>e.destroyAll())}_generateGlobalIdWhereClause(e,t){const{globalId:i,networkSourceIdsInUse:o}=this,{associatedNetworkSourceId:n}=e,s=t.fieldsIndex.get(V.fromGlobalId),l=t.fieldsIndex.get(V.toGlobalId),d=t.fieldsIndex.get(V.fromNetworkSourceId),c=t.fieldsIndex.get(V.toNetworkSourceId),p=n!=null,h=`(${Array.from(o.values())})`,m=p?` AND ${c.name} = ${n} AND ${c.name} IN ${h}`:"",f=p?` AND ${d.name} = ${n} AND ${d.name} IN ${h}`:"";switch(e.type){case"connectivity":return`((${s.name} = '${i}'${m}) OR (${l.name} = '${i}'${f}))`;case"attachment":case"content":return`${s.name} = '${i}'${m}`;case"container":case"structure":return`${l.name} = '${i}'${f}`;default:return""}}_generateNetworkSourceIdWhereClause(e){const{networkSourceIdsInUse:t}=this,i=`(${Array.from(t.values())})`,o=e.fieldsIndex.get(V.fromNetworkSourceId),n=e.fieldsIndex.get(V.toNetworkSourceId);return`(${o.name} IN ${i} AND ${n.name} IN ${i})`}_generateAssociationTypeWhereClause(e,t){const i=t.fieldsIndex.get(V.associationType);switch(e.type){case"attachment":case"structure":return`${i.name} = 3`;case"connectivity":return`${i.name} IN (1, 4, 5, 6)`;case"container":case"content":return`${i.name} = 2`;default:return""}}_generateWhereClause(e,t){const i=t.fieldsIndex.get(V.status),o=`(${Mr.join(",")})`,n=`${i.name} IN ${o}`;return`(${this._generateGlobalIdWhereClause(e,t)} AND ${n} AND ${this._generateAssociationTypeWhereClause(e,t)})`}async _loadUtiltyNetworks(){const e=this.map;if(!e)return;await Promise.allSettled(e.utilityNetworks?.map(async o=>{await o.load()})??[]);const t=o=>{if("layerId"in o&&i.isUtilityLayer(o)){const n=i.getSourceIdByLayerId(o.layerId);n!==null&&this.networkSourceIdsInUse.add(n)}},i=this.utilityNetwork;this._set("networkSourceIdsInUse",new Set),e.allLayers.forEach(t),e.allTables.forEach(t)}async _findLayersBySourceId(e){const{utilityNetwork:t,map:i}=this,o=c=>{const p=c;return c.url&&p.layerId===n?c.url.replace(/\/\d+$/,"")===t?.featureServiceUrl:!1};await t?.load();const n=t.getLayerIdBySourceId(e),s=i.allLayers.filter(o),l=i.allTables.filter(o),d=s.concat(l).toArray();return await Promise.allSettled(d.map(c=>c.load())),d}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach(e=>e.removeAll()),this.associationFeatures.clear()}_getAssociationsByType(e){switch(e){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}_createAssociationFromFeature(e,t){if(!e)return null;const i=Cr.get(t.attributes[e.fieldsIndex.get(V.associationType).name]);return new Er({globalId:t.attributes[e.fieldsIndex.get(V.globalId).name],fromNetworkElement:new Ye({globalId:t.attributes[e.fieldsIndex.get(V.fromGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.fromNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.fromTerminalId).name]}),toNetworkElement:new Ye({globalId:t.attributes[e.fieldsIndex.get(V.toGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.toNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.toTerminalId).name]}),associationType:i,status:t.attributes[e.fieldsIndex.get(V.status).name],isContentVisible:t.attributes[e.fieldsIndex.get(V.isContentVisible).name],percentAlong:t.attributes[e.fieldsIndex.get(V.percentAlong).name]})}async _queryLayer(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=i!=null,c=o!=null,p="("+t.map(v=>`'${v}'`).join(", ")+")",h=d?` AND ${s?.name} = ${i}`:"",m=d&&c?` AND ${l?.name} = ${o}`:"",f=`${e.globalIdField} IN ${p}`+h+m,g=new lt({outFields:["*"],cacheHint:this.supportsCacheHint,where:f});return await this._queryAll(g,e,{signal:n?.signal})}async _createAssociationFeatureObjects(e,t,i,o,n,s){if(e.length===0)return[];const l=new Map;for(const[c,p]of t){const h=await this._findLayersBySourceId(c);for(const m of h)(await this._queryLayer(m,p,o,n,s)).forEach(f=>{if(f.getEffectivePopupTemplate()&&f.layer){const g=l.get(f.attributes[m.globalIdField])??[];g.push(f),l.set(f.attributes[m.globalIdField],g)}})}const d=[];return e.toArray().forEach(c=>{const p=c.fromNetworkElement.globalId===i?c.toNetworkElement:c.fromNetworkElement;(l.get(p.globalId)??[]).forEach(h=>{const m=this.utilityNetwork?.getTerminalById(p?.terminalId)?.name;d.push({association:c,feature:h,terminalName:m})})}),d}_parseFeatureObjects(e,t){e.forEach(i=>{const o=i?.feature,n=o.layer,s=t.get(n)??new ce;s.add(i),t.set(n,s)})}async _queryAll(e,t,i){const o=[];let n=0,s=!1;e.num=t.sourceJSON?.maxRecordCount??2e3;do{e.start=n;const l=await t.queryFeatures(e,i);o.push(...l.features),s=l.exceededTransferLimit,s&&(n+=l.features.length)}while(s);return o}async _queryAssociatedFeatureCount(e){const{layer:t,globalId:i,supportsCacheHint:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d}=this;if(await Promise.allSettled([t?.load(),l?.load(),s?.load()]),this._clearAssociations(),!(d&&t&&n&&s))return;const c=s.fieldsIndex.get(V.toGlobalId).name,p=s.fieldsIndex.get(V.fromGlobalId).name,h=n.map(_=>this._generateWhereClause(_,s)),m=this._generateNetworkSourceIdWhereClause(s),f=h.join(" OR "),g=new lt({outFields:["*"],cacheHint:o,returnGeometry:!1,where:`(${f}) AND (${m})`}),v=await this._queryAll(g,s,{signal:e?.signal}),I=new Map;n.forEach(_=>{I.set(_.type,[])}),v.forEach(_=>{const T=s.fieldsIndex.get(V.associationType);switch(_.attributes[T.name]){case 1:case 4:case 5:case 6:_.attributes[p]===i?I.get("connectivity").push(_.attributes[c]):I.get("connectivity").push(_.attributes[p]),this.connectivityAssociations.add(this._createAssociationFromFeature(s,_));break;case 2:_.attributes[p]===i?(I.get("content").push(_.attributes[c]),this.contentAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("container").push(_.attributes[p]),this.containerAssociations.add(this._createAssociationFromFeature(s,_)));break;case 3:_.attributes[p]===i?(I.get("attachment").push(_.attributes[c]),this.attachmentsAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("structure").push(_.attributes[p]),this.structureAssociations.add(this._createAssociationFromFeature(s,_)))}});const C=n.map(async _=>{const{associatedNetworkSourceId:T,associatedAssetGroup:b,associatedAssetType:G}=_,W=I.get(_.type),q=b!=null?await this._countAssociatedFeatures(T,W,b,G,e):W.length;switch(_.type){case"attachment":this._set("attachmentsFeatureCount",q);break;case"structure":this._set("structureFeatureCount",q);break;case"content":this._set("contentFeatureCount",q);break;case"container":this._set("containerFeatureCount",q);break;case"connectivity":this._set("connectivityFeatureCount",q)}});await Promise.allSettled(C)}async _countAssociatedFeatureCount(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=o!=null,c="("+t.map(f=>`'${f}'`).join(", ")+")",p=` AND ${s?.name} = ${i}`,h=d?` AND ${l?.name} = ${o}`:"",m=`${e.globalIdField} IN ${c}`+p+h;return e.queryFeatureCount({where:m,outFields:["*"],returnGeometry:!1},{signal:n?.signal})}async _countAssociatedFeatures(e,t,i,o,n){if(t.length===0)return 0;const s=(await this._findLayersBySourceId(e)).map(async l=>this._countAssociatedFeatureCount(l,t,i,o,n));return(await Promise.all(s)).reduce((l,d)=>l+d,0)}async _queryAssociatedFeatures(e,t){const{layer:i,globalId:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d,associationFeatures:c}=this;if(await Promise.allSettled([i?.load(),l?.load(),s?.load()]),!(d&&i&&n&&s))return;const p=this._getAssociationsByType(e.type),{associatedAssetGroup:h,associatedAssetType:m}=e,f=new Map;p.forEach(v=>{const{networkSourceId:I,elementGlobalId:C}=v.fromNetworkElement.globalId===o?{networkSourceId:v.toNetworkElement.networkSourceId,elementGlobalId:v.toNetworkElement.globalId}:{networkSourceId:v.fromNetworkElement.networkSourceId,elementGlobalId:v.fromNetworkElement.globalId},_=f.get(I)||[];_.push(C),f.set(I,_)});const g=await this._createAssociationFeatureObjects(p,f,o,h,m,t);this._parseFeatureObjects(g,c)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:e,canQuery:t}=this;t?(await this._queryAssociatedFeatureCount(e),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(e){await this._loadUtiltyNetworks();const{_queryAbortController:t}=this;this.featureCount&&(this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),this.destroyed||await this._queryAssociatedFeatures(e,{signal:t?.signal}))}};r([a()],E.prototype,"_loaded",void 0),r([a()],E.prototype,"_queryAbortController",void 0),r([a()],E.prototype,"_queryPageAbortController",void 0),r([a()],E.prototype,"_queryFeatureCountAbortController",void 0),r([a({readOnly:!0})],E.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],E.prototype,"canLoad",null),r([a({readOnly:!0})],E.prototype,"canQuery",null),r([a()],E.prototype,"networkSourceIdsInUse",void 0),r([a()],E.prototype,"description",void 0),r([a({type:je})],E.prototype,"graphic",void 0),r([a()],E.prototype,"layer",void 0),r([a()],E.prototype,"map",void 0),r([a({readOnly:!0})],E.prototype,"objectId",null),r([a({readOnly:!0})],E.prototype,"objectIdField",null),r([a({readOnly:!0})],E.prototype,"globalId",null),r([a({readOnly:!0})],E.prototype,"globalIdField",null),r([a()],E.prototype,"featureCount",void 0),r([a()],E.prototype,"associationTypes",void 0),r([a()],E.prototype,"showAllEnabled",void 0),r([a()],E.prototype,"state",null),r([a()],E.prototype,"title",void 0),r([a({readOnly:!0})],E.prototype,"utilityNetwork",null),r([a({readOnly:!0})],E.prototype,"associationsLayer",null),r([a({readOnly:!0})],E.prototype,"attachmentsFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"structureFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"attachmentsAssociations",null),r([a({readOnly:!0})],E.prototype,"structureAssociations",null),r([a({readOnly:!0})],E.prototype,"contentFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"containerFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"contentAssociations",null),r([a({readOnly:!0})],E.prototype,"containerAssociations",null),r([a({readOnly:!0})],E.prototype,"connectivityFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"connectivityAssociations",null),r([a({readOnly:!0})],E.prototype,"associationFeatures",null),r([a({readOnly:!0})],E.prototype,"associationViewModels",null),E=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],E);const ft=E;let st=class extends ge{constructor(e){super(e),this.title=!0,this.description=!0}};r([a({type:Boolean,nonNullable:!0})],st.prototype,"title",void 0),r([a({type:Boolean,nonNullable:!0})],st.prototype,"description",void 0),st=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.VisibleElements")],st);const Ot=st;var ni;const rt="esri-feature",ze=`${rt}-relationship`,He={base:ze,listContainer:`${ze}__list`,listItem:`${ze}__list-item`,listItemHidden:`${ze}__list-item--hidden`,listContainerQuerying:`${ze}__list--querying`,featureObserver:`${rt}__feature-observer`,stickySpinnerContainer:`${rt}__sticky-loading-container`,loadingSpinnerContainer:`${rt}__loading-container`,expander:`${ze}__expander`,filterContainer:`${rt}__filter-container`};let S=ni=class extends oe{constructor(e,t){super(e,t),this.flowType="feature-utility-network-association-type",this.description=null,this.headingLevel=2,this.title=null,this.viewModel=new ft,this.parentFeatureViewModel=null,this.listType=null,this.selectedLayer=null,this.flowItems=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot,this._featuresPerPage=50,this._maxNumFeatures=1e3,this._currentFeaturePage=1,this._previewDisplayCount=3,this._associatedFeatureIntersectionObserverNode=null,this._associatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._tooltipReferenceMap=new Co,this._filterText=""}initialize(){this.addHandles([y(()=>[this._associatedFeatureIntersectionObserverNode],()=>this._handleAssociatedFeatureObserverChange())])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-BB941sYj.js"),__vite__mapDeps([126,2,3,4,5,6,7,8,113,114,107,108,9,110,119,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Dn93dMQE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),input:()=>w(()=>import("./calcite-input-BKRd7MCS-DN64wHsO.js"),__vite__mapDeps([127,116,2,3,4,5,6,7,8,117,110,108,118,119,113,107,9,114,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Bzq4cVWG.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-CeNaNcvH.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-CrZ_qcBF.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),tooltip:()=>w(()=>import("./calcite-tooltip-63c9fmIw-DyfFML0E.js"),__vite__mapDeps([128,2,3,4,5,6,7,8,129,115,106,125,130]),import.meta.url)})}destroy(){this._tooltipReferenceMap.clear()}get _numAssociatedFeatures(){const e=this.viewModel.associationViewModels;return this.selectedLayer?e.get(this.selectedLayer).length:0}set currentFeaturePage(e){const{_featuresPerPage:t,_numAssociatedFeatures:i}=this,o=1,n=Math.ceil(i/t)||1;this._currentFeaturePage=Math.max(Math.min(e,n),o)}get currentFeaturePage(){return this._currentFeaturePage}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:o}=this.parentFeatureViewModel??{};return u("div",{class:this.classes(He.base,M.widget)},t==="loading"||t==="querying"||o==="loading"?this._renderLoading():u("calcite-list",null,i&&this.selectedLayer?u(Ao,null,this._renderFilter(),this._renderAssociatedFeatureListPage(),this._renderFeatureObserver()):Array.from(e.keys(),n=>this._renderTypeList(n,e.get(n)))))}_renderFilter(){return u("div",{class:He.filterContainer,key:"filter"},u("calcite-input",{icon:"search",placeholder:this.messages.associationFilterPlaceholder,type:"search",onCalciteInputInput:e=>{this._filterText=e.target.value.trim().toLowerCase(),this._currentFeaturePage=1}}))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:o}=this;if(!t||!e)return;i.showAllEnabled=!0;const n=new ni({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:o,visibleElements:{title:!1,description:!1},viewModel:i});t.push(n)}_renderAssociatedFeatureListPage(){const{currentFeaturePage:e,_featuresPerPage:t,_maxNumFeatures:i,_filterText:o}=this,n=Math.min(e*t,i),s=this.viewModel.associationViewModels.get(this.selectedLayer).filter(l=>xt(l.featureViewModel).toLowerCase().includes(o)).slice(0,n);return[...this._renderTooltips(s),...this._renderAssociatedFeatureList(s)]}async _handleAssociatedFeatureObserverChange(){this._associatedFeatureIntersectionObserverNode&&this._associatedFeatureIntersectionObserver.unobserve(this._associatedFeatureIntersectionObserverNode);const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._associatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._associatedFeatureIntersectionObserver.observe(this._associatedFeatureIntersectionObserverNode)}_associatedFeatureIntersectionObserverCreated(e){this._associatedFeatureIntersectionObserverNode=e}_renderFeatureObserver(){return u("div",{afterCreate:this._associatedFeatureIntersectionObserverCreated,bind:this,class:He.featureObserver,key:"feature-observer"})}_increaseFeaturePage(){this.currentFeaturePage++}_renderLoading(){return u("div",{class:He.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}isConnectivity(e){return["connectivity","junction-junction-connectivity","junction-edge-from-connectivity","junction-midspan-connectivity","junction-edge-to-connectivity"].includes(e.association.associationType)}_getConnectivityTooltip(e){switch(e){case"connectivity":case"junction-junction-connectivity":return this.messages.associationsJunctionJunction;case"junction-edge-from-connectivity":return this.messages.associationsJunctionEdgeFrom;case"junction-midspan-connectivity":return this.messages.associationsJunctionEdgeMidspan;case"junction-edge-to-connectivity":return this.messages.associationsJunctionEdgeTo;default:return""}}_renderItemTooltip(e){const{_tooltipReferenceMap:t}=this;return this.isConnectivity(e)?u("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,referenceElement:t.get(e.featureViewModel.uid)},this._getConnectivityTooltip(e.association.associationType)):null}_renderConnectivityIcon(e,t){let i;switch(e){case"junction-edge-from-connectivity":i="connection-end-left";break;case"junction-edge-to-connectivity":i="connection-end-right";break;case"junction-midspan-connectivity":i="connection-middle";break;default:i="connection-to-connection"}return u("calcite-icon",{afterCreate:o=>this._tooltipReferenceMap.set(t,o),afterRemoved:()=>this._tooltipReferenceMap.delete(t),icon:i,scale:"s",slot:"content-start"})}_formatPercentAlong(e){return`${Be(e.association.percentAlong,{style:"percent",maximumFractionDigits:2})}`}_renderAssociatedFeature(e){const{featureViewModel:t}=e,i=xt(t),o=t.state==="loading",n=this._findFlowItem(t),s=n<0&&this._isParentFeature(t),l=s||n>=0,d=this.isConnectivity(e),c=d&&e.association.associationType==="junction-midspan-connectivity";return u("calcite-list-item",{class:this.classes(He.listItem,{[He.listItemHidden]:o}),description:e.terminalName??"",key:`associated-feature-type-${t.uid}`,label:i,onCalciteListItemSelect:()=>this._handleFeatureClick(s,n,t)},d?this._renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,c?u("calcite-chip",{scale:"s",slot:"content-end",value:e.association.percentAlong},this._formatPercentAlong(e)):null,this._renderChevronIconNode(l))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain(o=>{"showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy()});else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const o=this.flowItems.pop();o&&("showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,o=i?.layer;let n=null;o?.type==="subtype-sublayer"&&o.parent?n=o.parent.globalIdField??null:o&&"globalIdField"in o&&(n=o.globalIdField);const s=n?i?.attributes[n]:null,l=t.graphic,d=l?.layer;let c=null;d?.type==="subtype-sublayer"&&d.parent?c=d.parent.globalIdField??null:d&&"globalIdField"in d&&(c=d.globalIdField);const p=c?l?.attributes[c]:null;return s&&p&&s===p}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if(t.flowType!=="feature")return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)})??-1}_renderTooltips(e){return e.toArray().map(t=>this._renderItemTooltip(t))}_renderAssociatedFeatureList(e){return e.toArray().map(t=>this._renderAssociatedFeature(t))}_renderChevronIconNode(e){return u("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messages:i}=this,o=t.slice(0,this._previewDisplayCount),n=o.lengththis._showAllAssociations(e)},u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};r([a()],S.prototype,"flowType",void 0),r([a()],S.prototype,"description",void 0),r([a()],S.prototype,"headingLevel",void 0),r([a()],S.prototype,"title",void 0),r([a({type:ft})],S.prototype,"viewModel",void 0),r([a()],S.prototype,"parentFeatureViewModel",void 0),r([a()],S.prototype,"listType",void 0),r([a()],S.prototype,"selectedLayer",void 0),r([a()],S.prototype,"featureVisibleElements",void 0),r([a()],S.prototype,"flowItems",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],S.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],S.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],S.prototype,"visibleElements",void 0),r([a()],S.prototype,"_featuresPerPage",void 0),r([a()],S.prototype,"_maxNumFeatures",void 0),r([a()],S.prototype,"_numAssociatedFeatures",null),r([a()],S.prototype,"_currentFeaturePage",void 0),r([a()],S.prototype,"currentFeaturePage",null),r([a()],S.prototype,"_previewDisplayCount",void 0),r([a()],S.prototype,"_associatedFeatureIntersectionObserverNode",void 0),r([a()],S.prototype,"_tooltipReferenceMap",void 0),r([a()],S.prototype,"_filterText",void 0),S=ni=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociationType")],S);const Tr=S,Mt="esri-feature",Ue=`${Mt}-relationship`,ot={base:Ue,listContainer:`${Ue}__list`,listItem:`${Ue}__list-item`,listItemHidden:`${Ue}__list-item--hidden`,listContainerQuerying:`${Ue}__list--querying`,featureObserver:`${Mt}__feature-observer`,stickySpinnerContainer:`${Mt}__sticky-loading-container`,loadingSpinnerContainer:`${Mt}__loading-container`,expander:`${Ue}__expander`};let re=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=2,this.viewModel=new ft,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-BB941sYj.js"),__vite__mapDeps([126,2,3,4,5,6,7,8,113,114,107,108,9,110,119,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-Dn93dMQE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Bzq4cVWG.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-Cd7Uc4RY.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-CeNaNcvH.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-CrZ_qcBF.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url)})}destroy(){this._featureElementInfo=wo(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(ot.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:ot.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:ot.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"association-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noAssociations))}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_selectAssociationType(e){const{viewModel:t,flowItems:i,parentFeatureViewModel:o}=this;if(!i)return;const{associationTypes:n}=t;n.forEach(l=>{l.type===e.type?l.open=!0:l.open=!1});const s=new Tr({viewModel:t,parentFeatureViewModel:o,listType:e,title:this._getAssociationTypeTitle(e),featureVisibleElements:this.featureVisibleElements,description:this.parentFeatureViewModel?.title,flowItems:i});i.push(s)}_renderAssociationType(e){const t=this._getAssociationTypeTitle(e);return u("calcite-list-item",{description:e.description,key:`association-type-${e.type}`,label:t,value:e.type,onCalciteListItemSelect:()=>this._selectAssociationType(e)},u("calcite-chip",{scale:"s",slot:"content-end",value:e.type},this._getFeatureCount(e.type)),u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_getFeatureCount(e){switch(e){case"attachment":return this.viewModel.attachmentsFeatureCount;case"structure":return this.viewModel.structureFeatureCount;case"content":return this.viewModel.contentFeatureCount;case"container":return this.viewModel.containerFeatureCount;case"connectivity":return this.viewModel.connectivityFeatureCount}}_renderAssociations(e){return u("div",null,this._getFeatureCount(e.type)>0?this._renderAssociationType(e):null)}_renderContent(){const{state:e,associationTypes:t}=this.viewModel;return u("div",{class:this.classes(ot.listContainer,{[ot.listContainerQuerying]:e==="querying"}),key:"list-container"},e==="ready"?u("calcite-list",null,t.map(i=>this._renderAssociations(i))):null,this._renderStickyLoading())}};r([a()],re.prototype,"flowType",void 0),r([a()],re.prototype,"flowItems",void 0),r([a()],re.prototype,"parentFeatureViewModel",void 0),r([a()],re.prototype,"featureVisibleElements",void 0),r([a()],re.prototype,"description",null),r([a()],re.prototype,"headingLevel",void 0),r([a()],re.prototype,"title",null),r([a({type:ft})],re.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],re.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],re.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],re.prototype,"visibleElements",void 0),re=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],re);const xr=re;let kr=class{constructor(e,t){this.preLayerQueryCallback=e,this.preRequestCallback=t,this.preLayerQueryCallback||(this.preLayerQueryCallback=i=>{}),this.preRequestCallback||(this.preLayerQueryCallback=i=>{})}};var Qe;const Lr=1,Yi="content-view-models",eo="relationship-view-models",Pr="association-view-models",to={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let O=Qe=class extends li(ge){constructor(e){super(e),this._error=null,this._featureAbortController=null,this._associationVMAbortController=null,this._graphicChangedThrottled=pi(this._graphicChanged,Lr,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...to},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=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||t.type==="utility-network-associations"&&!!i.utilityNetworkAssociationsContent},this.addHandles(y(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),$))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return vs(Ri(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return xo(this.graphic)}castAbilities(e){return{...to,...e}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._featureAbortController=new AbortController,this._set("graphic",e?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){return!(!this._featureAbortController&&!this._associationVMAbortController)}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof Se&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await i?.load();const o=i?.objectIdField;if(!o||!e||!i)return;const n=e?.attributes?.[o];if(n==null)return;const s=[n];if(!e.geometry){const l=await Vo({layer:i,graphic:e,outFields:[],objectIds:s,returnGeometry:!0,spatialReference:t}),d=l?.geometry;d&&(e.geometry=d)}}_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){Et(i)||(this._error=i,K.getLogger(this).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):e.type==="utility-network-associations"?this._compileUtilityNetworkAssociation(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)).filter(Nt):typeof e=="string"?this._compileText(new go({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(eo),this.removeHandles(Yi),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),o=t?.getObjectId();return i!=null&&o!=null&&i===o}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:o,spatialReference:n,timeZone:s}=this;t?.filter(Boolean).forEach(l=>{e.some(d=>this._matchesFeature(d,l))||e.add(new Qe({abilities:{relationshipContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:l}))}),e.forEach(l=>{t?.find(d=>this._matchesFeature(l,d))||e.remove(l)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:o,contentElementViewModel:n}=e,s=o?.type;n&&s&&(s==="fields"&&(this._createFieldsFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createFieldsVMParams(o,t))),s==="media"&&(this._createMediaFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createMediaVMParams(o,t))),s==="text"&&n.set(this._createTextVMParams(o)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:o,relationshipId:n,title:s,description:l}=e,{_sourceLayer:d,graphic:c,map:p}=this;if(!$o(d))return;const h=new wi({displayCount:i,graphic:c,orderByFields:o,relationshipId:n,layer:d,map:p,...this._compileTitleAndDesc({title:s,description:l})});return this.contentViewModels[t]=h,this.addHandles(dt(()=>h.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(h)),eo),e}_matchesGlobalFeature(e,t){const i=e?.association.globalId,o=t?.association.globalId;return i!=null&&o!=null&&i===o}async _setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:o,spatialReference:n,timeZone:s}=this;e.forEach((d,c)=>{const p=t.get(c);p?d.forEach(h=>{p.find(m=>this._matchesGlobalFeature(h,m))||(d.remove(h),d.length===0&&e.delete(c))}):(d.removeAll(),e.delete(c))}),t.forEach((d,c)=>{const p=e.get(c)||new ce;d?.filter(Boolean).forEach(h=>{p.some(m=>this._matchesGlobalFeature(m,h))||p.add({association:h.association,featureViewModel:new Qe({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:h.feature}),terminalName:h.terminalName})}),e.set(c,p)});const l=new AbortController;this._associationVMAbortController=l,await this._sortListObjectsByTitle(e,{signal:l.signal}),this._associationVMAbortController===l&&(this._associationVMAbortController=null)}async _sortListObjectsByTitle(e,t){for(const i of e.values()){const o=i.map(n=>yo(()=>n.featureViewModel.state==="ready",t?.signal));await Promise.all(o),i.sort(this._compareByFeatureTitle)}}_compareByFeatureTitle(e,t){const i=xt(e.featureViewModel),o=xt(t.featureViewModel);return i.localeCompare(o,void 0,{numeric:!0})}_compileUtilityNetworkAssociation(e,t){const{title:i,description:o,associationTypes:n}=e,{_sourceLayer:s,graphic:l,map:d}=this;if(!hs(s))return;const c=new ft({graphic:l,associationTypes:n,layer:s,map:d,...this._compileTitleAndDesc({title:i,description:o})});return this.contentViewModels[t]=c,this.addHandles([y(()=>c.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(c.associationViewModels,c.associationFeatures,c.map))],Pr),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:o,map:n,spatialReference:s,view:l,location:d}=this,c=new vi({expressionInfo:i,graphic:o,interceptor:Qe.interceptor,map:n,spatialReference:s,view:l,location:d});return this.contentViewModels[t]=c,this.addHandles(y(()=>c.contentElementViewModel,()=>this._setExpressionContentVM(c,t),$),Yi),e}_compileAttachments(e,t){const{graphic:i}=this,{description:o,title:n}=e;return this.contentViewModels[t]=new yi({graphic:i,...this._compileTitleAndDesc({title:n,description:o})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:o,destroyer:n}=e;return this.contentViewModels[t]=new Lt({graphic:i,creator:o,destroyer:n}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:o,graphic:n,formattedAttributes:s}=this,l=n?.attributes,d=this._expressionAttributes,c=s.global;return{title:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:e}),description:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,o=this.formattedAttributes,n={...o?.global,...o?.content[t]},s=e?.fieldInfos||i?.fieldInfos,l=s?.filter(({fieldName:h})=>!!h&&(hi(h)||Ie(h)||n.hasOwnProperty(h))),d=i?.expressionInfos,{description:c,title:p}=e;return{attributes:n,expressionInfos:d,fieldInfos:l,...this._compileTitleAndDesc({title:p,description:c})}}_compileFields(e,t){const i=e.clone(),o=new Rt(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=o,i.fieldInfos=o.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:o,_fieldInfoMap:n,_effectivePopupTemplate:s,relatedInfos:l,_sourceLayer:d,_expressionAttributes:c}=this,p=this.formattedAttributes,h=o?.attributes??{},{description:m,mediaInfos:f,title:g}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:h,isAggregate:o?.isAggregate,layer:d,fieldInfoMap:n,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:c,mediaInfos:f,popupTemplate:s,relatedInfos:l,...this._compileTitleAndDesc({title:g,description:m})}}_compileMedia(e,t){const i=e.clone(),o=new Se(this._createMediaVMParams(e,t));return i.mediaInfos=o.formattedMediaInfos.slice(),this.contentViewModels[t]=o,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:o,_expressionAttributes:n}=this;if(e&&e.text){const s=t?.attributes??{},l=this.formattedAttributes?.global??{};e.text=Ve({attributes:s,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:o,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new Lt(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:o}=this;if(!e)return;const{lastEditInfoEnabled:n}=e,s=t?.editFieldsInfo;return n&&s?_s(s,i?.attributes,o,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:o,_expressionAttributes:n}=this,s=o?.attributes??{},l=this.formattedAttributes?.global??{};return Ve({attributes:s,fieldInfoMap:t,globalAttributes:l,expressionAttributes:n,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"content",value:e?.content,event:{graphic:t}}):null}async _queryFeature(e){const{_featureAbortController:t,_sourceLayer:i,graphic:o,_effectivePopupTemplate:n}=this,s=this.map,l=this.view,d=this.spatialReference,c=this.location;if(t!==this._featureAbortController||!o)return;await bs({graphic:o,popupTemplate:n,layer:i,spatialReference:d},e);const{content:{value:p},title:{value:h}}=await qe({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:m}}=await qe({checkForRelatedFeatures:this._checkForRelatedFeatures(e),expressionAttributes:wr({expressionInfos:n?.expressionInfos,spatialReference:d,graphic:o,map:s,interceptor:Qe.interceptor,view:l,options:e,location:c})});t===this._featureAbortController&&o&&(this._expressionAttributes=m,this._graphicExpressionAttributes={...o.attributes,...m},this._set("formattedAttributes",this._createFormattedAttributes(p)),this._set("title",this._compileTitle(h)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(p)||null))}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:o,graphic:n,relatedInfos:s,_sourceLayer:l,_fieldInfoMap:d,_graphicExpressionAttributes:c,timeZone:p}=this;i.content[t]=Bt({fieldInfos:o?.fieldInfos,graphic:n,attributes:{...c,...e.attributes},layer:l,fieldInfoMap:d,relatedInfos:s,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:o,relatedInfos:n,_sourceLayer:s,_fieldInfoMap:l,_graphicExpressionAttributes:d,timeZone:c}=this;i.content[t]=Bt({fieldInfos:e.fieldInfos,graphic:o,attributes:{...d,...e.attributes},layer:s,fieldInfoMap:l,relatedInfos:n,timeZone:c})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:o,_sourceLayer:n,_fieldInfoMap:s,_graphicExpressionAttributes:l,timeZone:d}=this,c=t?.fieldInfos,p={global:Bt({fieldInfos:c,graphic:i,attributes:l,layer:n,fieldInfoMap:s,relatedInfos:o,timeZone:d}),content:[]};return Array.isArray(e)&&e.forEach((h,m)=>{h.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p}),h.type==="media"&&this._createMediaFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,Ri(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:o,_sourceLayer:n}=this;o.clear();const s=n?.associatedLayer!=null?await n?.associatedLayer.load(i):n;if(!s||!e||!t.filter(c=>!!c.fieldName&&Ie(c.fieldName))?.length)return;t.forEach(c=>this._configureRelatedInfo(c,s));const l=await sr({relatedInfos:o,layer:s},i);Object.keys(l).forEach(c=>{const p=o.get(c.toString()),h=l[c]?.value;p&&h&&(p.layerInfo=h.data)});const d=await rr({graphic:e,relatedInfos:o,layer:s},i);Object.keys(d).forEach(c=>{Ks(d[c]?.value,o.get(c.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,o=It(e.fieldName||"");if(!o)return;const{layerId:n,fieldName:s}=o;if(!n)return;const l=i.get(n.toString())||Js(n,t);l&&(ar({relatedInfo:l,fieldName:s,fieldInfo:e}),this.relatedInfos.set(n,l))}};O.interceptor=new kr(Fs,Ms),r([a()],O.prototype,"_error",void 0),r([a()],O.prototype,"_featureAbortController",void 0),r([a()],O.prototype,"_associationVMAbortController",void 0),r([a({readOnly:!0})],O.prototype,"_effectivePopupTemplate",null),r([a({readOnly:!0})],O.prototype,"_fieldInfoMap",null),r([a({readOnly:!0})],O.prototype,"_sourceLayer",null),r([a()],O.prototype,"abilities",void 0),r([et("abilities")],O.prototype,"castAbilities",null),r([a({readOnly:!0})],O.prototype,"content",void 0),r([a({readOnly:!0})],O.prototype,"contentViewModels",void 0),r([a()],O.prototype,"description",void 0),r([a({type:Boolean})],O.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],O.prototype,"isTable",null),r([a({readOnly:!0})],O.prototype,"state",null),r([a({readOnly:!0})],O.prototype,"formattedAttributes",void 0),r([a({type:je,value:null})],O.prototype,"graphic",null),r([a({readOnly:!0})],O.prototype,"lastEditInfo",void 0),r([a({type:ai})],O.prototype,"location",void 0),r([a({readOnly:!0})],O.prototype,"relatedInfos",void 0),r([a()],O.prototype,"spatialReference",null),r([a()],O.prototype,"timeZone",null),r([a({readOnly:!0})],O.prototype,"title",void 0),r([a()],O.prototype,"map",null),r([a({readOnly:!0})],O.prototype,"waitingForContent",null),r([a()],O.prototype,"view",void 0),O=Qe=r([P("esri.widgets.Feature.FeatureViewModel")],O);const bi=O,Q="esri-feature",D={base:Q,container:`${Q}__size-container`,title:`${Q}__title`,main:`${Q}__main-container`,btn:`${Q}__button`,icon:`${Q}__icon`,content:`${Q}__content`,contentNode:`${Q}__content-node`,contentNodeText:`${Q}__content-node--text`,contentElement:`${Q}__content-element`,text:`${Q}__text`,lastEditedInfo:`${Q}__last-edited-info`,fields:`${Q}__fields`,fieldHeader:`${Q}__field-header`,fieldData:`${Q}__field-data`,fieldDataDate:`${Q}__field-data--date`,loadingSpinnerContainer:`${Q}__loading-container`},Uo=e=>{let t=class extends e{constructor(){super(...arguments),this.renderNodeContent=i=>Bo(i)&&!i.destroyed?u("div",{class:D.contentNode,key:i},i.render()):i instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:i,class:D.contentNode,key:i}):Ns(i)?u("div",{afterCreate:this._attachToNode,bind:i.domNode,class:D.contentNode,key:i}):null}_attachToNode(i){const o=this;i.appendChild(o)}};return t=r([P("esri.widgets.Feature.support.FeatureContentMixin")],t),t},io={title:!0,content:!0,lastEditedInfo:!0};let B=class extends Uo(oe){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...io},this.viewModel=new bi}initialize(){this.addHandles(y(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),$))}loadDependencies(){return Ae({notice:()=>w(()=>import("./calcite-notice-DeAGopAs-Cd7Uc4RY.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Bzq4cVWG.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}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 isTable(){return this.viewModel.isTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...io,...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}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=u("div",{class:D.container,key:"container"},this._renderTitle(),e==="error"?this._renderError():e==="loading"?this._renderLoading():this._renderContentContainer());return u("div",{class:this.classes(D.base,M.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:i}=this;return u("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},i.title?u("div",{key:"error-title",slot:"title"},e.errorMessage):null,u("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return u("div",{class:D.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?u("div",{class:D.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?u(_i,{class:D.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?u("div",{class:D.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:u("div",{class:this.classes(D.contentNode,D.contentNodeText),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);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:i,attachmentInfos:o}=t.viewModel;return i==="loading"||o.length>0?u("div",{class:this.classes(D.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?u("div",{class:D.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:i}=e,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:D.contentElement,key:this._buildKey("custom-element",t)},o.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||!e.lastEditedInfo)return null;const{date:o,user:n}=i,s=i.type==="edit"?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,l=pe(s,{date:o,user:n});return u("div",{class:this.classes(D.lastEditedInfo,D.contentElement),key:"edit-info-element"},l)}_renderText(e,t){const i=e.text,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:this.classes(D.contentElement,D.text),key:this._buildKey("text-element",t)},o.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:i,viewModel:o}=this,n=o?.content,{contentViewModels:s}=o;if(Array.isArray(n))n.forEach((l,d)=>{if(l.type==="attachments"&&(this._contentWidgets[d]=new Ls({displayType:l.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:s[d]})),l.type==="fields"&&(this._contentWidgets[d]=new jo({viewModel:s[d]})),l.type==="media"&&(this._contentWidgets[d]=new Wo({viewModel:s[d]})),l.type==="text"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="custom"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="expression"&&(this._contentWidgets[d]=new Ir({viewModel:s[d]})),l.type==="relationship"){const c=new Fr({flowItems:i,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}if(l.type==="utility-network-associations"){const c=new xr({flowItems:i,parentFeatureViewModel:o,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}},this);else{const l=s[0];l&&!l.destroyed&&(this._contentWidgets[0]=new bt({viewModel:l}))}this.scheduleRender()}};r([a()],B.prototype,"flowType",void 0),r([a()],B.prototype,"graphic",null),r([a()],B.prototype,"defaultPopupTemplateEnabled",null),r([a()],B.prototype,"flowItems",void 0),r([a()],B.prototype,"headingLevel",void 0),r([a({readOnly:!0})],B.prototype,"isTable",null),r([a()],B.prototype,"icon",null),r([a()],B.prototype,"label",null),r([a()],B.prototype,"location",null),r([a(),Y("esri/widgets/Feature/t9n/Feature")],B.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],B.prototype,"messagesCommon",void 0),r([a()],B.prototype,"spatialReference",null),r([a()],B.prototype,"timeZone",null),r([a({readOnly:!0})],B.prototype,"title",null),r([a()],B.prototype,"visibleElements",void 0),r([et("visibleElements")],B.prototype,"castVisibleElements",null),r([a()],B.prototype,"map",null),r([a()],B.prototype,"view",null),r([a({type:bi})],B.prototype,"viewModel",void 0),B=r([P("esri.widgets.Feature")],B);const Zo=B,Go=Object.freeze(Object.defineProperty({__proto__:null,default:Zo},Symbol.toStringTag,{value:"Module"}));let Pe=class extends ln.EventedAccessor{constructor(e){super(e),this.location=null,this.screenLocationEnabled=!1,this.view=null,this.addHandles([at(()=>{const t=this.screenLocationEnabled?this.view:null;return t?[t.size,t.type==="3d"?t.camera:t.viewpoint]:null},()=>this.notifyChange("screenLocation")),y(()=>this.screenLocation,(t,i)=>{t!=null&&i!=null&&this.emit("view-change")})])}destroy(){this.view=null}get screenLocation(){const{location:e,view:t,screenLocationEnabled:i}=this,o=t?.spatialReference,n=o?Wn(e,o).geometry:null;return i&&n&&t?.ready?t.toScreen(n):null}};r([a()],Pe.prototype,"location",void 0),r([a()],Pe.prototype,"screenLocation",null),r([a()],Pe.prototype,"screenLocationEnabled",void 0),r([a()],Pe.prototype,"view",void 0),Pe=r([P("esri.widgets.support.AnchorElementViewModel")],Pe);const Qo=Pe;let Ct=class extends Qo{constructor(e){super(e),this.visible=!1}};r([a()],Ct.prototype,"visible",void 0),Ct=r([P("esri.widgets.Spinner.SpinnerViewModel")],Ct);const Xo=Ct,Qt="esri-spinner",Xt={base:Qt,spinnerStart:`${Qt}--start`,spinnerFinish:`${Qt}--finish`};let Ne=class extends oe{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new Xo}initialize(){this.addHandles(y(()=>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 o=()=>this.hide();i&&i.catch(()=>{}).then(o)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,i=!!t,o=e&&i,n=!e&&i,s={[Xt.spinnerStart]:o,[Xt.spinnerFinish]:n},l=this._getPositionStyles();return u("div",{class:this.classes(Xt.base,s),styles:l})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=$t(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(t==null||e==null)return{};const{padding:i}=t;return{left:e.x-i.left+"px",top:e.y-i.top+"px"}}};r([a()],Ne.prototype,"location",null),r([a()],Ne.prototype,"view",null),r([a({type:Xo})],Ne.prototype,"viewModel",void 0),r([a()],Ne.prototype,"visible",null),Ne=r([P("esri.widgets.Spinner")],Ne);const Nr=Ne,ee="esri-features",Z={icon:`${ee}__icon`,actionImage:`${ee}__action-image`,base:ee,container:`${ee}__container`,contentContainer:`${ee}__content-container`,contentFeature:`${ee}__content-feature`,flowItemCollapsed:`${ee}__flow-item--collapsed`,header:`${ee}__header`,footer:`${ee}__footer`,featureMenuObserver:`${ee}__feature-menu-observer`,actionExit:`${ee}__action--exit`,loader:`${ee}__loader`,featuresHeading:`${ee}__heading`,paginationActionBar:`${ee}__pagination-action-bar`,paginationPrevious:`${ee}__pagination-previous`,paginationNext:`${ee}__pagination-next`},De=ce.ofType({key:"type",defaultKeyValue:"button",base:dn,typeMap:{button:pt,toggle:_o}}),xe=new pt({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),oo=new pt({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:we.trash}),Je=new pt({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),Te=new _o({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:we.table,value:!1}),Ce=xe.clone();let $e=class extends oe{constructor(e,t){super(e,t),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenFeature=i=>{this.emit("open-feature",{feature:i})},this._handleZoomToFeature=i=>{this.emit("zoom-to-feature",{featureWidget:i})}}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-DO9-6_VR.js"),__vite__mapDeps([131,122,2,3,4,5,6,7,8,106,110,113,107,108,9,119,114,1,105]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-trFy58rx.js"),__vite__mapDeps([132,2,3,4,5,6,7,124,9,8,113,107,108,114,133,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-wUTthgYu.js"),__vite__mapDeps([135,133,2,3,4,5,6,7,124,9,113,107,8,108,114,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-DCl4Mpal.js"),__vite__mapDeps([136,2,3,4,5,6,7,8,110,113,107,108,9,114,137,134,106,122,119,1,105,129,115,125,130,120]),import.meta.url)})}render(){const{flowItems:e}=this,t=e?.toArray();return u(Ao,null,t?.map(i=>this._renderFlowItem(i)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleDrillInBackClick(){const e=this.flowItems?.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_renderFlowItem(e){const{messages:t,closable:i,closed:o}=this,n="graphic"in e&&!e.isTable,s=e.flowType==="feature-association",l=this._getExitMessage(e),d=t.selectFeature;return u("calcite-flow-item",{bind:this,closable:i,closed:o,description:this._getDrillInFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,onCalciteFlowItemBack:c=>{c.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},u("calcite-action",{appearance:"transparent",bind:this,class:Z.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:l,title:l}),n?u("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,s?u("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},this._renderDefaultActions(e))):null,u("div",{class:Z.container},e.render()))}_renderDefaultActions(e){const t=this._getActionTitle(Ce);return u("calcite-action",{active:Ce.active,appearance:"solid",bind:this,"data-action-uid":Ce.uid,disabled:Ce.disabled,icon:Ce.icon??"question",indicator:Ce.indicator,key:`action-${Ce.uid}`,loading:Ce.active,onclick:()=>this._handleZoomToFeature(e),scale:"s",text:t,textEnabled:!0,title:t})}_getActionTitle(e){const{messages:t}=this,{id:i}=e,o=e.title??"";return i==="zoom-to-feature"?pe(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.featureCountDescription;case"feature-utility-network-association-type":return e.description??""}}};r([a()],$e.prototype,"flowItems",void 0),r([a(),Y("esri/widgets/Features/t9n/Features")],$e.prototype,"messages",void 0),r([a()],$e.prototype,"closed",void 0),r([a()],$e.prototype,"closable",void 0),$e=r([P("esri.widgets.Features.FeaturesDrillIn")],$e);const $r=$e,Rr="OBJECTID";var Re;(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"})(Re||(Re={}));const no=ci("android");ci("chrome")||no&&no>=4,En(),Re.size,Re.maxSize,Re.maxOutlineSize,Re.lineWidth,Re.tallSymbolWidth;function Jo(e){return e&&"opacity"in e?e.opacity*Jo(e.parent):1}async function so(e,t){if(!e)return;const i=e.sourceLayer,o=(t!=null&&t.useSourceLayer?i:e.layer)??i,n=Jo(o);if(e.symbol!=null&&(t==null||t.ignoreGraphicSymbol!==!0)){const b=e.symbol.type==="web-style"?await Vn(e.symbol,{...t,cache:t!=null?t.webStyleCache:null}):e.symbol.clone();return St(b,null,n),b}const s=t?.renderer??Or(o);let l=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!l)return;if(l=l.type==="web-style"?await l.fetchSymbol({...t,cache:t!=null?t.webStyleCache:null}):l.clone(),!s||!("visualVariables"in s)||!s.visualVariables?.length)return St(l,null,n),l;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&t?.arcade==null){const b={...t};b.arcade=await Io(),t=b}const{getColor:d,getOpacity:c,getAllSizes:p,getRotationAngle:h}=await w(()=>import("./visualVariableUtils-D3kZJRyn-23qzp7zg.js"),__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url),m=[],f=[],g=[],v=[];for(const b of s.visualVariables)switch(b.type){case"color":m.push(b);break;case"opacity":f.push(b);break;case"rotation":v.push(b);break;case"size":b.target||g.push(b)}const I=!!m.length&&m[m.length-1],C=I?d(I,e,t):null,_=!!f.length&&f[f.length-1];let T=_?c(_,e,t):null;if(n!=null&&(T=T!=null?T*n:n),St(l,C,T),g.length){const b=p(g,e,t);await Sn(l,b)}for(const b of v)Dn(l,h(b,e,t),b.axis);return l}function Or(e){if(e)return"renderer"in e?e.renderer:void 0}const Vr="esri.widgets.Popup.PopupViewModel",Pt=()=>K.getLogger(Vr),Sr=e=>{const{event:t,view:i,viewModel:o}=e,{action:n}=t;if(!n)return Promise.reject(new N("trigger-action:missing-arguments","Event has no action"));const{disabled:s,id:l}=n;if(!l)return Promise.reject(new N("trigger-action:invalid-action","action.id is missing"));if(s)return Promise.reject(new N("trigger-action:invalid-action","Action is disabled"));if(l===xe.id)return Yo(o).catch(wn);if(l===Je.id)return qr(o);if(l===Te.id)return o.browseClusterEnabled=!o.browseClusterEnabled,o.featureMenuOpen=o.browseClusterEnabled,Promise.resolve();if(l===oo.id){o.visible=!1;const{selectedFeature:d}=o;if(!d)return Promise.reject(new N(`trigger-action:${oo.id}`,"selectedFeature is required",{selectedFeature:d}));const{sourceLayer:c}=d;return c?c.remove(d):i?.graphics.remove(d),Promise.resolve()}return Promise.resolve()};function Ko(e){const{selectedFeature:t,location:i,view:o}=e;return o?t??i??null:null}function Oe(e){return!!e&&e.isAggregate&&e.sourceLayer?.featureReduction?.type==="cluster"}async function Dr(e,t){if(t?.type!=="3d"||!e||e.declaredClass!=="esri.Graphic")return!0;const i=t.getViewForGraphic(e);if(i&&"whenGraphicBounds"in i){let o=null;try{o=await i.whenGraphicBounds(e,{useViewElevation:!0})}catch{}return!o||!o.boundingBox||o.boundingBox[0]===o.boundingBox[3]&&o.boundingBox[1]===o.boundingBox[4]&&o.boundingBox[2]===o.boundingBox[5]}return!0}async function Yo(e,t){const{location:i,selectedFeature:o,view:n,zoomFactor:s}=e;await t?.viewModel?.updateGeometry();const l=t?.graphic,d=l?.geometry?l:Ko(e);if(!n||!d){const m=new N("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:d,view:n});throw Pt().error(m),m}const c=n.scale/s,p=l?.geometry??e.selectedFeature?.geometry??i,h=p!=null&&p.type==="point"&&await Dr(l??o,n);xe.active=!0,xe.disabled=!0;try{await e.zoomTo({target:{target:d,scale:h?c:void 0}})}catch(m){if(Et(m))return;const f=new N("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:l??o});Pt().error(f)}finally{xe.active=!1,xe.disabled=!1,e.zoomToLocation=null,h&&(e.location=p)}}async function qr(e){const{selectedFeature:t,view:i}=e;if(i?.type!=="2d"){const l=new N("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw Pt().error(l),l}if(!t||!Oe(t)){const l=new N("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:t});throw Pt().error(l),l}const[o,n]=await Ii(i,t);Je.active=!0,Je.disabled=!0;const{extent:s}=await o.queryExtent(n);s&&await e.zoomTo({target:s}),Je.active=!1,Je.disabled=!1}async function Br(e){const{view:t,selectedFeature:i}=e;if(!t||!i)return;const[o,n]=await Ii(t,i),{extent:s}=await o.queryExtent(n);e.selectedClusterBoundaryFeature.geometry=s,t.graphics.add(e.selectedClusterBoundaryFeature)}async function jr(e){const{selectedFeature:t,view:i}=e;if(!i||!t)return;const[o,n]=await Ii(i,t);Te.active=!0,Te.disabled=!0;const{features:s}=await o.queryFeatures(n);Te.active=!1,Te.disabled=!1,Te.value=!0,e?.open({features:[t].concat(s),featureMenuOpen:!0})}async function Ii(e,t){const i=await e.whenLayerView(t.sourceLayer),o=i.createQuery(),n=t.getObjectId();return o.aggregateIds=n!=null?[n]:[],[i,o]}function Wr(e){Te.value=!1;const t=e.features.filter(i=>Oe(i));t.length&&(e.features=t)}const Jt="location-scale-handle",zr=()=>[xe.clone()],Hr=()=>[Je.clone(),Te.clone()];let wt=null;function Ur(e,t){return e==="building-scene"||t==="2d"&&(e==="map-image"||e==="tile"||e==="imagery"||e==="imagery-tile")}let F=class extends Rn(Qo){constructor(e){super(e),this._pendingPromises=new Ln,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.actions=new De,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new je({symbol:new cn({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,this._debouncedLocationUpdate=Ke(async t=>{const{spatialReference:i}=this,o=this.selectedFeature?.geometry?.type,n=this.location??t;if(o&&o!=="mesh"&&i&&n&&this.selectedFeature)if(o!=="point")try{const s=this.selectedFeature;let l=s.geometry;const d=this._getHighlightLayer(s),c=s.getObjectId();if(!d||!this.view)return;if(c){const p=this.view?.allLayerViews.find(f=>f.layer.uid===d.uid);if(!p||!("queryFeatures"in p))return;const h=p.createQuery();h.outSpatialReference=i,h.objectIds=[c],h.returnGeometry=!0;const{features:m}=await p.queryFeatures(h);l=m[0]?.geometry}if(!l||l.type==="mesh")return;if(l=zn(l,i),wt||(wt=await w(()=>import("./geometryEngineAsync-D7oEu5dd-B6AE24vD.js"),__vite__mapDeps([138,3,4,5,6,63]),import.meta.url)),!await wt.intersects(l,n)){const p=(await wt.nearestCoordinate(l,n)).coordinate??n;this.selectedFeature===s&&(this.location=p)}}catch(s){Et(s)||K.getLogger(this).error(s)}else this.location=Yt(this.selectedFeature.geometry)??n})}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),y(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),y(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),y(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),y(()=>this.location,e=>this._locationChange(e)),y(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),y(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),y(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),y(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>Sr({event:e,viewModel:this,view:this.view})),at(()=>!this.waitingForResult,()=>this._waitingForResultChange(),un),y(()=>[this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureVMs()),y(()=>this.view?.scale,()=>this._viewScaleChange()),at(()=>!this.visible,()=>this.browseClusterEnabled=!1),y(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new De;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:o,includeDefaultActions:n,selectedFeature:s}=this,l=n?i.concat(t):t,d=s&&(typeof s.getEffectivePopupTemplate=="function"&&s.getEffectivePopupTemplate(o)||s.popupTemplate),c=d?.actions;return(d?.overwriteActions?c:c?.concat(l)??l)?.filter(Boolean).forEach(p=>e.add(p)),e}get defaultActions(){const e=this._get("defaultActions")||new De;return e.removeAll(),e.addMany(Oe(this.selectedFeature)?Hr():zr()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:o,selectedFeatureIndex:n}=this,s=o&&t.length;s&&i&&n===-1?this.selectedFeatureIndex=0:s&&n!==-1||(this.selectedFeatureIndex=t.length?0:-1)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator;e?.spatialReference?.isWGS84&&i&&(t=pn(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach(t=>this._pendingPromises.add(t)),e.reduce((t,i)=>t.finally(()=>i.then(o=>{this._pendingPromises.has(i)&&this._updateFeatures(o)}).finally(()=>this._pendingPromises.delete(i)).catch(()=>{})),Promise.resolve())):this._set("promises",[])}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 spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some(e=>e.waitingForContent)}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}centerAtLocation(){const{view:e}=this,t=Ko(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new N("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 N("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal: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 o=["actionsMenuOpen","collapsed"];for(const n of o)delete t[n];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){Wr(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;e?.type==="2d"?Oe(t)?(await Br(this),await jr(this)):K.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):K.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(xe.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(Nt);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(Oe(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:o}=this;o&&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:o,featureViewModels:n}=this;if(i===null)return;const s=((i-1)*o+t)%t,l=s+o;n.slice(s,l).forEach((d,c)=>{d&&(d.graphic??=e[s+c])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:o}=this;if(!e||!o)return;if(this.browseClusterEnabled)return this._selectedClusterFeature&&(o.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),Oe(e)?void 0:(e.symbol=await so(e),this._selectedClusterFeature=e,void o.graphics.add(this._selectedClusterFeature));const n=e.sourceLayer?.type;if(n!=="map-image"&&n!=="imagery"&&n!=="imagery-tile"||(e.symbol=await so(e)),!i&&t||!e.geometry){if(i&&!e.geometry){await this.centerAtLocation();const s=o.center?.clone();s&&(this.location=s)}}else this.location=Yt(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:o,spatialReference:n,map:s,timeZone:l,location:d}=this;if(Oe(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const c=i.slice(),p=[];t.forEach((h,m)=>{if(!h)return;let f=null;if(c.some((g,v)=>(g&&g.graphic===h&&(f=g,c.splice(v,1)),!!f)),f)p[m]=f;else{const g=new bi({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:n,graphic:h===e?h:null,location:d,map:s,view:o,timeZone:l});p[m]=g}}),c.forEach(h=>h&&!h.destroyed&&h.destroy()),this._set("featureViewModels",p)}async _getScreenPoint(e,t){const{spatialReference:i,view:o}=this;if(!o)return null;await o?.when();const n=e?.spatialReference;return n&&i?(await Hn(n,i,null,t),o.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:o}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:o}),{signal:o,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const o=new AbortController,{signal:n}=o;this._fetchFeaturesController=o;const s=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:n,event:i});return s.catch(()=>{}).then(()=>{this._fetchFeaturesController=null}),s}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e,{view:o}=this;this.removeHandles(Jt),this.addHandles([y(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(s=>{Et(s)||K.getLogger(this).error(s)})),at(()=>!this.visible,()=>{this.removeHandles(Jt)},{once:!0})],Jt);const{pendingFeatures:n}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});o?.popup&&"open"in o.popup&&o.popup.open({location:t??void 0,promises:n})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}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?.type==="map-notes"||i?.type==="subtype-group"?i:t}_getHighlightTarget(e,t,i){if(Ur(t.type,i))return e;const o=e.getObjectId();if(o!=null)return o;const n=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||Rr:null,s=e.attributes;return s&&n&&s[n]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightActiveFeature(){const e="highlight-active-feature";this.removeHandles(e);const{highlightEnabled:t,view:i,activeFeature:o,visible:n}=this;if(!(o&&i&&t&&n))return;const s=this._getHighlightLayer(o);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(i,s);this._highlightActiveFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightActiveFeaturePromise===l&&this.activeFeature&&this.highlightEnabled))return;const c=d.highlight(this._getHighlightTarget(o,s,i.type));this.addHandles(c,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this.removeHandles(e);const{selectedFeature:t,highlightEnabled:i,view:o,visible:n}=this;if(!(t&&o&&i&&n))return;const s=this._getHighlightLayer(t);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(o,s);this._highlightSelectedFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightSelectedFeaturePromise===l&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const c=d.highlight(this._getHighlightTarget(t,s,o.type));this.addHandles(c,e)}_updateFeatures(e){const{features:t}=this,i=e.filter(o=>!t.includes(o));i?.length&&(this.features=t.concat(i))}};r([a()],F.prototype,"_fetchFeaturesController",void 0),r([a({type:De})],F.prototype,"actions",void 0),r([a({readOnly:!0})],F.prototype,"active",null),r([a()],F.prototype,"activeFeature",void 0),r([a({readOnly:!0})],F.prototype,"allActions",null),r([a()],F.prototype,"autoCloseEnabled",void 0),r([a()],F.prototype,"browseClusterEnabled",void 0),r([a()],F.prototype,"content",void 0),r([a({type:De,readOnly:!0})],F.prototype,"defaultActions",null),r([a({type:Boolean})],F.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],F.prototype,"featureCount",null),r([a()],F.prototype,"featurePage",void 0),r([a({value:[]})],F.prototype,"features",null),r([a()],F.prototype,"featuresPerPage",void 0),r([a()],F.prototype,"featureMenuOpen",void 0),r([a()],F.prototype,"featureViewModelAbilities",void 0),r([a({readOnly:!0})],F.prototype,"featureViewModels",void 0),r([a()],F.prototype,"highlightEnabled",void 0),r([a()],F.prototype,"includeDefaultActions",void 0),r([a({type:ai})],F.prototype,"location",null),r([a()],F.prototype,"map",null),r([a({readOnly:!0})],F.prototype,"pendingPromisesCount",null),r([a({readOnly:!0})],F.prototype,"promiseCount",null),r([a()],F.prototype,"promises",null),r([a({readOnly:!0})],F.prototype,"selectedClusterBoundaryFeature",void 0),r([a({value:null,readOnly:!0})],F.prototype,"selectedFeature",null),r([a({value:-1})],F.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],F.prototype,"selectedFeatureViewModel",null),r([a({readOnly:!0})],F.prototype,"state",null),r([a()],F.prototype,"timeZone",null),r([a()],F.prototype,"title",void 0),r([a()],F.prototype,"updateLocationEnabled",void 0),r([a()],F.prototype,"view",void 0),r([a()],F.prototype,"visible",void 0),r([a({readOnly:!0})],F.prototype,"waitingForContents",null),r([a({readOnly:!0})],F.prototype,"waitingForResult",null),r([a()],F.prototype,"zoomFactor",void 0),r([a()],F.prototype,"zoomToLocation",void 0),r([a()],F.prototype,"centerAtLocation",null),F=r([P("esri.widgets.Features.FeaturesViewModel")],F);const Ai=F;let fe=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!1,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.flow=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],fe.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"flow",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"spinner",void 0),fe=r([P("esri.widgets.Features.FeaturesVisibleElements")],fe);const en=fe,ro="selected-index",Zr=0,ao="features-spinner";function lo(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let x=class extends Uo(oe){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([i])=>{i?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new ce,this._drillInWidget=new $r({flowItems:this._drillInFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new De,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new Ai,this.visibleElements=new en,this._renderAction=(i,o)=>{const n=this._getActionTitle(i),{type:s,active:l,uid:d,disabled:c,indicator:p}=i;return i.visible?u("calcite-action",{active:s==="toggle"&&i.value,appearance:"solid",bind:this,"data-action-uid":d,disabled:c,icon:this._getActionIcon(i),indicator:p,key:`action-${o}`,loading:l,onclick:this._triggerAction,scale:"s",text:n,title:this._hideActionText?n:void 0},this._getFallbackIcon(i)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusFlowItemNode("menu-flow-item")},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusFlowItemNode("root-flow-item"),this.featureMenuOpen=!1)},this._displaySpinnerThrottled=pi(()=>this._displaySpinner(),Zr),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,y(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),y(()=>this.viewModel?.active,i=>this._drillInWidget.closed=!i),y(()=>this.visibleElements?.closeButton,i=>this._drillInWidget.closable=i),y(()=>this.visibleElements?.spinner,i=>this._spinnerEnabledChange(i)),y(()=>this.viewModel?.view,(i,o)=>this._viewChange(i,o)),y(()=>this.viewModel?.view?.ready,(i,o)=>this._viewReadyChange(i??!1,o??!1)),y(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),y(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),y(()=>this.selectedFeatureWidget,()=>this._destroyDrillInFlowItemWidgets()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.title,i?.state]},()=>this._setTitleFromFeatureWidget()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.content,i?.state]},()=>this._setContentFromFeatureWidget()),y(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:i})=>this._openRelatedFeature(i)),this._drillInWidget.on("zoom-to-feature",({featureWidget:i})=>Yo(this.viewModel,i))])}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-DO9-6_VR.js"),__vite__mapDeps([131,122,2,3,4,5,6,7,8,106,110,113,107,108,9,119,114,1,105]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-trFy58rx.js"),__vite__mapDeps([132,2,3,4,5,6,7,124,9,8,113,107,108,114,133,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-wUTthgYu.js"),__vite__mapDeps([135,133,2,3,4,5,6,7,124,9,113,107,8,108,114,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),button:()=>w(()=>import("./calcite-button-Cm9_TJei-By40tgvH.js"),__vite__mapDeps([139,2,3,4,5,6,7,117,8,110,118,119,113,107,108,9,114,1,105,106]),import.meta.url),flow:()=>w(()=>import("./calcite-flow-CAdorlph-NGgeuOPy.js"),__vite__mapDeps([140,2,3,4,5,6,7,9,113]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-DCl4Mpal.js"),__vite__mapDeps([136,2,3,4,5,6,7,8,110,113,107,108,9,114,137,134,106,122,119,1,105,129,115,125,130,120]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-CeNaNcvH.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-CrZ_qcBF.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),"list-item-group":()=>w(()=>import("./calcite-list-item-group-CuQ2MPLW-DacaGEdY.js"),__vite__mapDeps([141,2,3,4,5,6,7,110,111]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--Bzq4cVWG.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}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 location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return t==="feature-association"||t==="feature-relationship"?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:n,map:s}=this,{selectedFeatureViewModel:l}=this.viewModel,d={title:!1};return l?(e?(e.viewModel=l,e.visibleElements=d):this._feature=new Zo({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:n,map:s,viewModel:l,visibleElements:d}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=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}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():K.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode(this.featureMenuOpen?"menu-flow-item":"root-flow-item"):K.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(ro);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(at(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return u("div",{bind:this,class:this.classes(Z.base,M.widget,M.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?u("div",{class:Z.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:u("div",{class:Z.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:n}=t;return u("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:n>0,onclick:this._openFeatureMenu,scale:"s",text:pe(e.pageText,{index:Be(o+1),total:Be(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return u("calcite-action-bar",{class:Z.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},u("calcite-action-group",{scale:"s"},u("calcite-action",{appearance:"solid",class:Z.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),u("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:i}=this.viewModel,o=e===t,n=i.indexOf(e);return u("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:o,onCalciteListItemSelect:this._selectFeature},u("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(i=>{const o=i?.graphic;if(!o)return;const{layer:n,sourceLayer:s}=o,l=(lo(n)?n:null)||(lo(s)?s:null),d=t.get(l)??[];t.set(l,[...d,i])}),t}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel,t=this._groupResultsByLayer();return e.length?u("calcite-list",{selectionAppearance:"icon",selectionMode:"single"},Array.from(t.keys(),i=>{const o=t.get(i)?.map(s=>this._renderFeatureMenuItem(s)),n=i?i.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&n!==null?u("calcite-list-item-group",{heading:n,key:i?.uid||"map-graphics"},o):o})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?u("calcite-action",{active:e.type==="toggle"&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:n}=this,{title:s,active:l}=this.viewModel,d=t.heading&&s?s:"";return u("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[Z.contentFeature]:!0,[Z.flowItemCollapsed]:i}),closable:t.closeButton,closed:!l,collapsed:i,collapseDirection:n?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?u(_i,{class:this.classes(Z.featuresHeading,M.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:u("div",{class:this.classes(Z.container,Z.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:i,messagesCommon:o}=this,{active:n,featureViewModels:s,pendingPromisesCount:l}=e;return t?u("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:pe(i.total,{total:s.length}),heading:i.selectFeature,key:"feature-menu",loading:e.waitingForContents,onCalciteFlowItemBack:d=>{d.preventDefault(),this._handleFeatureMenuBack()}},l>0?u("calcite-loader",{class:Z.loader,inline:!0,key:"feature-menu-loader",label:o.loading,slot:"header-actions-end"}):null,u("div",{class:Z.container},this._renderFeatureMenu()),u("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:Z.featureMenuObserver}),u("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},o.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._drillInWidget.render()];return this.visibleElements.flow?u("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=Zn({action:e,feature:this.selectedFeature}),n={[Z.icon]:!!t,[Z.actionImage]:!!o};return t&&(n[t]=!0),o||t?u("span",{"aria-hidden":"true",class:this.classes(Z.icon,n),key:"icon",styles:Un(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?u("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?typeof e=="string"?u("div",{class:D.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(i==null||t==null)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=Yt(i);this.open({features:[t],location:o??void 0})}async _focusFlowItemNode(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;await ke(vo(t));const i=e==="menu-flow-item"?this._featureMenuViewportNode:this._rootFlowItemNode;Tn(i)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,l=e.title??"",d=n==="zoom-to-feature"?pe(l,{messages:t}):n==="remove-selected-feature"?pe(l,{messages:o}):n==="zoom-to-clustered-features"||n==="browse-clustered-features"?pe(l,{messages:t}):e.title;return d&&s?pe(d,s):d??""}_onMainKeydown(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title=i?.state==="error"?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=y(()=>this.viewModel?.selectedFeatureIndex,(t,i)=>this._selectedFeatureIndexUpdated(t,i));this.addHandles(e,ro)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&e!==-1&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:n})=>n===i);o&&!o.disabled&&(o?.type==="toggle"&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,n=o.findIndex(l=>l.uid===i),s=o.at(n);s&&s.type==="toggle"&&(s.value=!s.value),this.viewModel.triggerAction(n)}_createSpinner(e){e&&(this._spinner=new Nr({view:e}),e.ui.add(this._spinner,{key:ao,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,ao),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};r([a()],x.prototype,"_drillInFlowItems",void 0),r([a()],x.prototype,"_hideActionText",null),r([a()],x.prototype,"_featureNavigationVisible",null),r([a()],x.prototype,"_isCollapsed",null),r([a()],x.prototype,"_collapseEnabled",null),r([a({readOnly:!0})],x.prototype,"active",null),r([a()],x.prototype,"collapsed",void 0),r([a()],x.prototype,"content",null),r([a()],x.prototype,"icon",null),r([a()],x.prototype,"featureMenuOpen",null),r([a()],x.prototype,"featureNavigationTop",void 0),r([a()],x.prototype,"features",null),r([a()],x.prototype,"goToOverride",null),r([a({type:De})],x.prototype,"headerActions",void 0),r([a()],x.prototype,"headingLevel",void 0),r([a()],x.prototype,"location",null),r([a()],x.prototype,"label",null),r([a()],x.prototype,"map",null),r([a(),Y("esri/widgets/Features/t9n/Features")],x.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],x.prototype,"messagesCommon",void 0),r([a()],x.prototype,"promises",null),r([a()],x.prototype,"responsiveActionsEnabled",void 0),r([a({readOnly:!0})],x.prototype,"selectedFeature",null),r([a({readOnly:!0})],x.prototype,"selectedDrillInFeature",null),r([a()],x.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],x.prototype,"selectedFeatureWidget",null),r([a()],x.prototype,"spatialReference",null),r([a()],x.prototype,"title",null),r([a()],x.prototype,"timeZone",null),r([a()],x.prototype,"updateLocationEnabled",null),r([a()],x.prototype,"view",null),r([a({type:Ai}),qo(["triggerAction","trigger-action"])],x.prototype,"viewModel",void 0),r([a({type:en,nonNullable:!0})],x.prototype,"visibleElements",void 0),r([a()],x.prototype,"visible",null),x=r([P("esri.widgets.Features")],x);const Gr=x,de="esri-popup",Le=`${de}--is-docked`,j={base:de,baseHidden:`${de}--hidden`,main:`${de}__main-container`,shadow:`${de}--shadow`,isDocked:Le,isDockedTopLeft:`${Le}-top-left`,isDockedTopCenter:`${Le}-top-center`,isDockedTopRight:`${Le}-top-right`,isDockedBottomLeft:`${Le}-bottom-left`,isDockedBottomCenter:`${Le}-bottom-center`,isDockedBottomRight:`${Le}-bottom-right`,alignTopCenter:`${de}--aligned-top-center`,alignBottomCenter:`${de}--aligned-bottom-center`,alignTopLeft:`${de}--aligned-top-left`,alignBottomLeft:`${de}--aligned-bottom-left`,alignTopRight:`${de}--aligned-top-right`,alignBottomRight:`${de}--aligned-bottom-right`,pointer:`${de}__pointer`,pointerDirection:`${de}__pointer-direction`};let si=class extends Ai{constructor(e){super(e)}};si=r([P("esri.widgets.Popup.PopupViewModel")],si);const tn=si;let _e=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!0,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],_e.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"spinner",void 0),_e=r([P("esri.widgets.Popup.PopupVisibleElements")],_e);const ri=_e,Qr=200,co={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let k=class extends oe{constructor(e,t){super(e,t),this._dockAction=new pt({id:"popup-dock-action"}),this._featuresWidget=new Gr({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this._focusAbortController=null,this.alignment="auto",this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new tn,this.visibleElements=new ri}initialize(){this.addHandles([y(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled],()=>this._handleDockIcon(),$),y(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),$),y(()=>this.dockOptions,e=>{const{_dockAction:t}=this,i=this._featuresWidget.headerActions;i.remove(t),e.buttonEnabled&&i.add(t)},$),y(()=>this.viewModel?.screenLocation,()=>this._positionContainer()),y(()=>[this.viewModel?.active,this.dockEnabled],()=>this._toggleScreenLocationEnabled()),y(()=>[this.viewModel?.screenLocation,this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment],()=>this.reposition()),y(()=>this.viewModel?.view?.size,(e,t)=>this._updateDockEnabledForViewSize(e,t)),y(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),y(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),y(()=>this.viewModel,()=>this._featuresWidget.viewModel=this.viewModel,$),y(()=>this._featureNavigationTop,e=>this._featuresWidget.featureNavigationTop=e,$),y(()=>this.headingLevel,e=>this._featuresWidget.headingLevel=e,$),y(()=>this.visibleElements.actionBar,e=>this._featuresWidget.visibleElements.actionBar=!!e,$),y(()=>this.visibleElements.closeButton,e=>this._featuresWidget.visibleElements.closeButton=!!e,$),y(()=>this.visibleElements.collapseButton,e=>this._featuresWidget.visibleElements.collapseButton=!!e,$),y(()=>this.visibleElements.heading,e=>this._featuresWidget.visibleElements.heading=!!e,$),y(()=>this.visibleElements.spinner,e=>this._featuresWidget.visibleElements.spinner=!!e,$),y(()=>this.visibleElements.featureNavigation,e=>this._featuresWidget.visibleElements.featureNavigation=!!e,$),y(()=>this.visibleElements.featureListLayerTitle,e=>this._featuresWidget.visibleElements.featureListLayerTitle=!!e,$),dt(()=>this._featuresWidget,"trigger-header-action",e=>{e.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)})])}normalizeCtorArgs(e){const t={...e};return e?.visibleElements!=null&&(t.visibleElements=new ri(e.visibleElements),e.collapseEnabled!=null&&(t.visibleElements.collapseButton=e.collapseEnabled),e.spinnerEnabled!=null&&(t.visibleElements.spinner=e.spinnerEnabled)),t}destroy(){this._dockAction.destroy(),this._featuresWidget?.destroy(),this._focusAbortController?.abort()}get _featureNavigationTop(){const{currentAlignment:e,currentDockPosition:t}=this;return e==="bottom-left"||e==="bottom-center"||e==="bottom-right"||t==="top-left"||t==="top-center"||t==="top-right"}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}get active(){return this.viewModel.active}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=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 collapsed(){return this._featuresWidget.collapsed}set collapsed(e){this._featuresWidget.collapsed=e}get collapseEnabled(){return gt(K.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton}set collapseEnabled(e){gt(K.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||co}set dockOptions(e){const t={...co},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:l}=n;typeof l=="object"?n.breakpoint={...s,...l}:l&&(n.breakpoint=s),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}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 icon(){return"popup"}set icon(e){this._overrideIfSome("icon",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}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(){return this._featuresWidget.selectedFeatureWidget}get spinnerEnabled(){return gt(K.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner}set spinnerEnabled(e){gt(K.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner=e}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}blur(){const{active:e}=this.viewModel;e||K.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}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||K.getLogger(this).warn("Popup can only be focused when currently active."),this._handleFocus()}next(){return this.viewModel.next()}open(e){const t=!!e&&!!e.featureMenuOpen,i={collapsed:!!e&&!!e.collapsed,featureMenuOpen:t};this.set(i),this.viewModel.open(e),e?.shouldFocus&&this._handleFocus(!0)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i}=this,{active:o,screenLocation:n}=this.viewModel,s=o&&e,l=o&&!e,d=this.selectedFeature?.layer?.title,c=this.selectedFeature?.layer?.id,p={[j.alignTopCenter]:t==="top-center",[j.alignBottomCenter]:t==="bottom-center",[j.alignTopLeft]:t==="top-left",[j.alignBottomLeft]:t==="bottom-left",[j.alignTopRight]:t==="top-right",[j.alignBottomRight]:t==="bottom-right",[j.isDocked]:s,[j.shadow]:l,[j.isDockedTopLeft]:i==="top-left",[j.isDockedTopCenter]:i==="top-center",[j.isDockedTopRight]:i==="top-right",[j.isDockedBottomLeft]:i==="bottom-left",[j.isDockedBottomCenter]:i==="bottom-center",[j.isDockedBottomRight]:i==="bottom-right"};return u("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,bind:this,class:this.classes(j.base,p,{[j.baseHidden]:!n&&!e}),"data-layer-id":c,"data-layer-title":d,role:"presentation"},o?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:u("div",{class:j.pointer,key:"popup-pointer",role:"presentation"},u("div",{class:this.classes(j.pointerDirection,j.shadow)}))}_renderMainContainer(){const{dockEnabled:e}=this,t={[j.shadow]:e};return u("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(j.main,M.widget,t)},this._featuresWidget.render())}_getAnimationDurationMS(){const{_containerNode:e}=this;return e?1e3*parseFloat(window.getComputedStyle(e).animationDuration):Qr}async _handleFocus(e=!1){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;e&&await yo(()=>this.viewModel?.active===!0,{signal:t}),await ke(vo(t)),await ke($t(this._getAnimationDurationMS(),t)),this._featuresWidget.focus()}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const l=s.padding;return n==="right"&&o.x+i/2>s.width-l.right||n==="left"&&o.x-i/2s.height-l.bottom}_calculateAutoAlignment(e){if(e!=="auto")return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:s,view:l}=n;if(s==null||!l||!i)return"top-center";function d(b){return parseInt(b.replaceAll(/[^-\d.]/g,""),10)}const c=o?window.getComputedStyle(o,null):null,p=c?d(c.getPropertyValue("max-height")):0,h=c?d(c.getPropertyValue("height")):0,{height:m,width:f}=i.getBoundingClientRect(),g=f+t,v=Math.max(m,p,h)+t,I=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"right",view:l}),C=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"left",view:l}),_=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"top",view:l}),T=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"bottom",view:l});return C?_?"bottom-right":"top-right":I?_?"bottom-left":"top-left":_?T?"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 be(this.container)&&t.reverse(),e?.replace(/leading/gi,t[0]).replaceAll(/trailing/gi,t[1])}_callDockPosition(e){return typeof e=="function"?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(e){if(e!=="auto")return e;const t=this.viewModel?.view,i=be(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_getDockIcon(){const e=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(e){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_setMainContainerNode(e){this._mainContainerNode=e}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&Object.assign(this._containerNode.style,o)}_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,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this;if(!i)return;const{padding:l}=i,d=o/2,c=i.height-t,p=i.width-e;return n==="bottom-center"?{top:t+s-l.top,left:e-d-l.left}:n==="top-left"?{bottom:c+s-l.bottom,right:p+s-l.right}:n==="bottom-left"?{top:t+s-l.top,right:p+s-l.right}:n==="top-right"?{bottom:c+s-l.bottom,left:e+s-l.left}:n==="bottom-right"?{top:t+s-l.top,left:e+s-l.left}:n==="top-center"?{bottom:c+s-l.bottom,left:e-d-l.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(e==null||!t)return;const n=this._calculateFullWidth(t),s=this._calculateAlignmentPosition(e.x,e.y,o,n);return s?{top:s.top!==void 0?`${s.top}px`:"auto",left:s.left!==void 0?`${s.left}px`:"auto",bottom:s.bottom!==void 0?`${s.bottom}px`:"auto",right:s.right!==void 0?`${s.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){e?this._wireUpView():t&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,l]=t,{width:d=0,height:c=0}=i??{};return o<=d&&s>d||o>d&&s<=d||n<=c&&l>c||n>c&&l<=c}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.viewModel?.view?.padding||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],l=[];s[0]=e[0]-o,s[1]=e[1]-n,l[0]=t[0]-o,l[1]=t[1]-n;const{dockOptions:d}=this,c=d.breakpoint;this._dockingThresholdCrossed(s,l,c)&&this._setDockEnabledForViewSize(d),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n)||!t)return!1;const s=t.hasOwnProperty("width")&&o<=(t.width??0),l=t.hasOwnProperty("height")&&n<=(t.height??0);return s||l}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}};r([a({readOnly:!0})],k.prototype,"_featureNavigationTop",null),r([a()],k.prototype,"actions",null),r([a({readOnly:!0})],k.prototype,"active",null),r([a()],k.prototype,"alignment",void 0),r([a()],k.prototype,"autoCloseEnabled",null),r([a()],k.prototype,"defaultPopupTemplateEnabled",null),r([a()],k.prototype,"content",null),r([a()],k.prototype,"collapsed",null),r([a()],k.prototype,"collapseEnabled",null),r([a({readOnly:!0})],k.prototype,"currentAlignment",null),r([a({readOnly:!0})],k.prototype,"currentDockPosition",null),r([a()],k.prototype,"dockOptions",null),r([a()],k.prototype,"dockEnabled",void 0),r([a({readOnly:!0})],k.prototype,"featureCount",null),r([a()],k.prototype,"featureMenuOpen",null),r([a()],k.prototype,"features",null),r([a()],k.prototype,"goToOverride",null),r([a()],k.prototype,"headingLevel",void 0),r([a()],k.prototype,"highlightEnabled",null),r([a()],k.prototype,"icon",null),r([a()],k.prototype,"location",null),r([a()],k.prototype,"label",null),r([a(),Y("esri/widgets/Popup/t9n/Popup")],k.prototype,"messages",void 0),r([a()],k.prototype,"promises",null),r([a({readOnly:!0})],k.prototype,"selectedFeature",null),r([a()],k.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],k.prototype,"selectedFeatureWidget",null),r([a()],k.prototype,"spinnerEnabled",null),r([a()],k.prototype,"title",null),r([a()],k.prototype,"updateLocationEnabled",null),r([a()],k.prototype,"view",null),r([a({type:tn}),qo(["triggerAction","trigger-action"])],k.prototype,"viewModel",void 0),r([a()],k.prototype,"visible",null),r([a({type:ri,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=r([P("esri.widgets.Popup")],k);const Md=k;export{Md as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-icon-laqhdRBY-8qK5FfMb.js","./icon-BXFbBbop-Bq4Zv26A.js","./themeUtils-YjM7iIiX-DGrOr3vp.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./dom-N58V0tYi-DBU3jlah.js","./observers-BigwqTsw-CfIXp3Nz.js","./visualVariableUtils-D3kZJRyn-tyrXoPjU.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./chartUtilsAm5-CtY-kHPy-KDNsYH7z.js","./Theme-rblUnB2V-Dc7wtY6B.js","./Tooltip-B0HefZ7r-CZdyswYp.js","./DefaultTheme-Bt5OI-Ht-BKAw1o4a.js","./chartCommon-rWfJsTPl-C_UBBu0e.js","./Button-MQvwxOnj-Bxdd1k4u.js","./ColorSet-DkIwOmgs-Bdz0YXw-.js","./pieChart-qcxaoQkv-jYI0rZLi.js","./Tick-DUHqbpyB-Dd2p6esB.js","./xyChart-Ch-p5aUf-CLpax4aT.js","./arcade-CaGqU4sP-DcIDNIme.js","./TimeOnly-DSMefxKy-BHvJbNji.js","./UnknownTimeZone-C--TOcPG-9of9030I.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./FeatureLayer-BrRKw5Si-DuA2fyE_.js","./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js","./RendererLegendOptions-K3md58-X-JLOOdHLz.js","./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js","./colorRamps-q0bZVhs2-BnivlaV9.js","./styleUtils-BtpNqZyT-Bnq2S5kK.js","./jsonUtils-C64Zfu7c-BtrwAD3_.js","./LRUCache-C3erQTWv-grHgYSP-.js","./Version-CoKzbupV-BDyz4v43.js","./FieldsIndex-HmzMbJQG-Du7S47uJ.js","./OverrideHelper-DWRbVlj1-BnPmqHJ3.js","./colorUtils-Cthpxcks-cHaMZbaf.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-CiwW7WzR.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-DFYZs_ns.js","./heatmapUtils-seiMkkkR-CrSLbaQx.js","./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js","./commonProperties-BtIqvFU_-DbZji2Rx.js","./ElevationInfo-yv2-9tj6-CkIHeL1t.js","./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./HeightModelInfo-C5vFqzyF-BH6aliHn.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js","./Query-BrwMGK8U-BPr0_G9t.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./RelationshipQuery-DJsz3K0U-BKFa46R1.js","./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js","./Relationship-PyhUibYK-DN6K3ukS.js","./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js","./Layer-ChoECxvZ-BmDHBjO8.js","./workers-PiCjreoO-Dc6Tqm-o.js","./editsZScale-BDsX6vv--C-4n90TZ.js","./queryZScale-BiYV6Pr6-B7zp5L1G.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./FeatureSet-BkVNthuN-DPQqwkNN.js","./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js","./ArcGISService-BYA-y6X6-DNHMEBm_.js","./BlendLayer-D1WkSmwP-BeUsb4u9.js","./jsonUtils-wIllKWI4-MQQ-E5fj.js","./parser-DyDJ-rlI-CvOs11Ip.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-6clJxb1Q.js","./CustomParametersMixin-vdKsTHer-5EfrrVMH.js","./EditBusLayer-Df29OyJh-OmdJOLws.js","./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js","./FeatureEffect-CDEk9Es7-Cd4-I1fy.js","./FeatureFilter-BCFHgLVU-DwigNbnH.js","./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js","./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js","./labelingInfo-DGVNul26-BDBqWm17.js","./labelUtils-BW14kBqX-Tk7uOiPw.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-DTTV2F9z.js","./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js","./OrderByInfo-GD2XnU8e-BaEpZLaO.js","./PortalLayer-CElnYuSQ-CCe4TMEA.js","./PortalItem-CctGdnxF-CfFOGshS.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./RefreshableLayer-a8BQ58Xh-CxfquKbp.js","./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js","./TemporalLayer-CpOrN_w9-8nvJFP_-.js","./TimeInfo-w_HB2CsF-B2qHZyfS.js","./FeatureTemplate-SPHPD45f-CZ7E6_6b.js","./FeatureType-C9hJmS6_-CNlvn5D1.js","./fieldProperties-Bq26w7gt-BiKrD4ue.js","./versionUtils-LZYZz-38-B8C5OAjF.js","./styleUtils-ChrJTYIw-C6xq7Jeu.js","./popupUtils-B0uZcXX0-DHyOz1jC.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./calcite-loader-CtpHSU2--B8aaTEnB.js","./loader-Ch7Jr16w-CF4bv9QO.js","./guid-Dls486Er-CBh637k4.js","./locale-Cn_GDVD_-CCUxSwPB.js","./key-CZySMiwx-kmS7VeUz.js","./calcite-list-rnu1YzAl-DCH8F59s.js","./interactive-DqhNilgd-BbTDbq0n.js","./resources4-Bi43yZeq-Ca3PT_gb.js","./utils3-BSH0zqNl-90fd1I_b.js","./loadable-DbNDKH4r-CSXrQx_7.js","./t9n-C_hcZMZJ-Du2NPCXI.js","./debounce-27Hmkkyg-Th7bw3mg.js","./input2-eOtqu-iO-DiRyHCWP.js","./form-CRSw616T-wY3ZjFlq.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./scrim-BscQh4v9-CloQFru7.js","./calcite-list-item-VYBhSMxV-C8kSjE5V.js","./action-GCQoufcz-DQvoWHlv.js","./calcite-notice-DeAGopAs-BI9wdRMa.js","./conditionalSlot-DsCzytJ4-DM7mn4Oa.js","./openCloseComponent-BGQ6h7vg-BO0gc3O8.js","./calcite-chip-DE_c-1hr-DI1-84AU.js","./calcite-input-BKRd7MCS-BhvpT25V.js","./calcite-tooltip-63c9fmIw-BI9m24xG.js","./floating-ui-DKFFlLv3-8lk8tQD2.js","./FloatingArrow-BG9llDYg-Ct2kNlPu.js","./calcite-action-2fclGKoO-DEiRzt3o.js","./calcite-action-bar-ugh74qU5-C59I7NOF.js","./action-group-DhwU7QZv-CXvhCgpT.js","./action-menu-DTIJuZNc-DnQvHied.js","./calcite-action-group-qlkUfh_o-H6U8Q6wA.js","./calcite-flow-item-uRuGc3ks-Cp1dKuD0.js","./panel-DRUEhsxp-KxESJ732.js","./geometryEngineAsync-D7oEu5dd-CZIKaTd9.js","./calcite-button-Cm9_TJei-DvwKP8jU.js","./calcite-flow-CAdorlph-DQjwYgyL.js","./calcite-list-item-group-CuQ2MPLW-CwdP7Iq_.js"])))=>i.map(i=>d[i]); +import{_ as w}from"./main-QGPoLsvl.js";import{ag as ce,v as r,S as a,ad as et,bi as je,i as P,iC as sn,ej as uo,ar as po,gP as ho,iD as rn,w as ai,aa as mo,bR as li,j as ge,b9 as ke,bp as Ke,ah as y,aL as $,aq as Nt,aK as di,a0 as Fi,ac as Mi,m as an,aD as fo,aU as Et,a1 as K,iE as go,ai as dt,aw as yo,iF as qe,I as ln,aF as at,iG as dn,iH as pt,iI as _o,K as ci,d$ as cn,av as un,b7 as pn,o as N,c3 as Be,bx as vo,c2 as ct,gO as hn,c4 as Ci,bE as mn,iJ as fn,a_ as gn,iK as yn,iL as _n,en as vn,iM as Ei,aA as wo,az as $t,e as bo,dW as Io,bt as wn,eC as gt,cn as bn,bw as In,ae as An,iw as ui,ch as Fn,f as Mn,el as Ti,iN as Tt,an as Cn}from"./story-Doly9N9p.js";import{b as pe}from"./substitute-j49H6mVR-DTufu01J.js";import{_ as Y,k as Ae,P as u,o as En,X as Tn,R as oe,d as xi,e as ki,H as be,$ as xn,w as kn,F as Ao}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{s as Ln,t as Pn}from"./ReactiveSet-QxEZenFW-tC7C9rTp.js";import{h as Nn}from"./AttachmentInfo-D9RFO8W2-CMU9-WNo.js";import{d as Kt,c as Li}from"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import{b as $n,N as Fo}from"./utils-DyydRFHu-1ITtOELE.js";import{I as M,K as Rn,J as On}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import{K as Vn,C as St,I as Sn,J as Dn,x as We}from"./utils-DPtQ14k3-CBDffBYM.js";import{l as qn}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{u as Dt}from"./executeQueryJSON-CcHnccia-M-vnTvKl.js";import{b as lt,m as Bn}from"./Query-BrwMGK8U-BPr0_G9t.js";import{j as jn}from"./shared-D1w-26bA-BBIRhcUQ.js";import Mo from"./FeatureLayer-BrRKw5Si-DuA2fyE_.js";import{h as Co}from"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import{L as xt}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import{V as Wn,K as zn,N as Hn}from"./projection-BA9M1R7d-CAbqHZiw.js";import{D as Pi}from"./Layer-ChoECxvZ-BmDHBjO8.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import{a as Ni}from"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./query-DFW9-NG_-C3TyGmiM.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import"./editsZScale-BDsX6vv--C-4n90TZ.js";import"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import"./EditBusLayer-Df29OyJh-OmdJOLws.js";import"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import"./FeatureType-C9hJmS6_-CNlvn5D1.js";import"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import"./versionUtils-LZYZz-38-B8C5OAjF.js";import"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";function pi(e,t,i,o){let n=null,s=1e3;typeof t=="number"?(s=t,o=i):(n=t??null,s=i);let l,d=0;const c=()=>{d=0,e.apply(o,l)},p=(...h)=>{n&&n.apply(o,h),l=h,s?d||(d=setTimeout(c,s)):c()};return p.remove=()=>{d&&(clearTimeout(d),d=0)},p.forceUpdate=()=>{d&&(clearTimeout(d),c())},p.hasPendingUpdates=()=>!!d,p}function Yt(e){switch(e?.type){case"point":return e;case"extent":return e.center;case"polygon":return e.centroid;case"multipoint":case"polyline":return e.extent?.center;default:return null}}function Un(e){return e?{backgroundImage:`url(${e})`}:{}}function Zn({action:e,feature:t}){const i=t?.attributes,o="image"in e?e.image:void 0;return o&&i?pe(o,i):o??""}const Gn="esri.widgets.Feature.support.featureUtils",ei=()=>K.getLogger(Gn),Qn=/href=(""|'')/gi,Xn=/(\{([^{\r\n]+)\})/g,Jn=/'/g,Eo=/^\s*expression\//i,Kn=/(\n)/gi,Yn=/[\u00A0-\u9999<>&]/gim,es=/href\s*=\s*(?:"([^"]+)"|'([^']+)')/gi,ts=/^(?:mailto:|tel:)/,To="relationships/",$i=ho("short-date-short-time");function xo(e){if(e!=null)return(e.sourceLayer||e.layer)??void 0}async function kt({type:e,value:t,event:i}){try{return typeof t=="function"?t(i):await t}catch(o){return void ei().error("error",`An error occurred when calling the "${e}" function`,{error:o,graphic:i.graphic,value:t})}}function ko(e=""){if(e)return!ts.test(e.trim().toLowerCase())}function hi(e){return!!e&&Eo.test(e)}function is(e,t){if(!t||!hi(t)||!e)return;const i=t.replace(Eo,"").toLowerCase();return e.find(({name:o})=>o.toLowerCase()===i)}function Lo(e,t){const i=is(t,e?.fieldName);return i?i.title||null:e?e.label||e.fieldName:null}function os(e,t){return`{${t.get(e.toLowerCase())?.fieldName||e}}`}function ns(e){return e.replaceAll(Qn,"")}function ut(e,t){const i=mi(t,e);return i?i.name:e}function ss(e,t){return e&&e.map(i=>ut(i,t))}function mi(e,t){return e&&typeof e.getField=="function"&&t?e.getField(t)??null:null}function Po(e){return`${e}`.trim()}function Ve({attributes:e,globalAttributes:t,layer:i,text:o,expressionAttributes:n,fieldInfoMap:s}){return o?ti({formattedAttributes:t,template:ds(o,{...t,...n,...e},i),fieldInfoMap:s}):""}function ti({formattedAttributes:e,template:t,fieldInfoMap:i}){return Po(ns(ct(ct(t,o=>os(o,i)),e)))}function rs(e,t,i=!1){const o=t[e];if(typeof o=="string"){const n="%27",s=(i?encodeURIComponent(o):o).replaceAll(Jn,n);t[e]=s}}function as(e,t=!1){const i={...e};return Object.keys(i).forEach(o=>rs(o,i,t)),i}function ls(e,t,i){const o=(t=Po(t))&&t[0]!=="{";return ct(e,as(i,o||!1))}function ii(e,t){return e.replaceAll(Xn,(i,o,n)=>{const s=mi(t,n);return s?`{${s.name}}`:o})}function ds(e,t,i){const o=ii(e,i);return o&&o.replaceAll(es,(n,s,l)=>ls(n,s||l,t))}function cs(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 No(e){return e!=null&&typeof e=="object"&&"fieldsIndex"in e&&"geometryType"in e&&"getField"in e&&"load"in e&&"loaded"in e&&"objectIdField"in e&&"spatialReference"in e&&"type"in e&&(e.type==="feature"||e.type==="scene"||e.type==="subtype-sublayer"||e.type==="sublayer")&&"when"in e}function us(e){return e!=null&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"queryObjectIds"in e&&"queryRelatedFeatures"in e&&"queryRelatedFeaturesCount"in e&&"relationships"in e}function ps(e){return!!(e&&typeof e=="object"&&"createQuery"in e&&"queryFeatureCount"in e&&"type"in e)&&(e.type==="subtype-sublayer"&&"parent"in e&&e.parent&&typeof e.parent=="object"?"globalIdField"in e.parent:"globalIdField"in e)}function $o(e){return No(e)&&us(e)}function hs(e){return No(e)&&ps(e)}function ms(e,t){const{fieldInfos:i,fieldName:o,preventPlacesFormatting:n,layer:s,timeZone:l}=t,d=Ro(i,o),c=mi(s,o);if(d&&!Ti(o)){const h=c?.type,m=d.format?.dateFormat;if(h==="date"||h==="date-only"||h==="time-only"||h==="timestamp-offset"||m)return Fo(e,{format:m,fieldType:h,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:l,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}})}const p=d?.format;return typeof e=="string"&&Ti(o)&&p?fs(e,p):typeof(e=cs(e,p))=="string"||e==null||p==null?ht(e):Be(e,n?{...Tt(p),minimumFractionDigits:0,maximumFractionDigits:20}:Tt(p))}function fs(e,t){return e=e.trim(),/\d{2}-\d{2}/.test(e)?e:e.includes(",")?qt(e,",",", ",t):e.includes(";")?qt(e,";","; ",t):e.includes(" ")?qt(e," "," ",t):Be(Number(e),Tt(t))}function qt(e,t,i,o){return e.trim().split(t).map(n=>Be(Number(n),Tt(o))).join(i)}function Ro(e,t){if(e?.length&&t)return e.find(i=>i.fieldName?.toLowerCase()===t.toLowerCase())}function gs({fieldName:e,graphic:t,layer:i}){if(Ie(e)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:o}=i;if(!o||e!==o)return null;const n=i.getFeatureType(t);return n?n.name:null}function ys({fieldName:e,value:t,graphic:i,layer:o}){if(Ie(e)||!o||typeof o.getFieldDomain!="function")return null;const n=i&&o.getFieldDomain(e,{feature:i,excludeImpliedDomains:ci("esri-widget-legacy-field-domain-calculation")});return n&&n.type==="coded-value"?n.getName(t):null}function _s(e,t,i,o){const{creatorField:n,creationDateField:s,editorField:l,editDateField:d}=e;if(!t)return;const c=hn(o&&"preferredTimeZone"in o?o.preferredTimeZone:null,!(!o||!("datesInUnknownTimezone"in o))&&!!o.datesInUnknownTimezone,i,$i,"date"),p={...$i,...c},h=t[d];if(typeof h=="number"){const f=t[l];return{type:"edit",date:Ci(h,p),user:f}}const m=t[s];if(typeof m=="number"){const f=t[n];return{type:"create",date:Ci(m,p),user:f}}return null}function vs(e,t){const i=new Map;if(!e)return i;for(const o of e){if(!o.fieldName)continue;const n=ut(o.fieldName,t);o.fieldName=n,i.set(n.toLowerCase(),o)}return i}function Ri(e){const t=[];if(!e)return t;const{fieldInfos:i,content:o}=e;return i&&t.push(...i),o&&Array.isArray(o)&&o.forEach(n=>{if(n.type==="fields"){const s=n?.fieldInfos;s&&t.push(...s)}}),t}function fi(e){return e.replaceAll(Yn,t=>`&#${t.charCodeAt(0)};`)}function ht(e){return typeof e=="string"?e.replaceAll(Kn,'
'):e}function Oo(e){const{value:t,fieldName:i,fieldInfos:o,fieldInfoMap:n,layer:s,graphic:l,timeZone:d}=e;if(t==null)return"";const c=ys({fieldName:i,value:t,graphic:l,layer:s});if(c)return c;const p=gs({fieldName:i,graphic:l,layer:s});if(p)return p;if(n.get(i.toLowerCase()))return ms(t,{fieldInfos:o||Array.from(n.values()),fieldName:i,layer:s,timeZone:d});const h=s?.fieldsIndex?.get(i);return h&&($n(h)||bn(h))?Fo(t,{fieldType:h.type,timeZoneOptions:{layerTimeZone:s&&"preferredTimeZone"in s?s.preferredTimeZone:null,viewTimeZone:d,datesInUnknownTimezone:!(!s||!("datesInUnknownTimezone"in s))&&!!s.datesInUnknownTimezone}}):ht(t)}function Bt({fieldInfos:e,attributes:t,layer:i,graphic:o,fieldInfoMap:n,relatedInfos:s,timeZone:l}){const d={};return s?.forEach(c=>As({attributes:d,relatedInfo:c,fieldInfoMap:n,fieldInfos:e,layer:i,timeZone:l})),t&&Object.keys(t).forEach(c=>{const p=t[c];d[c]=Oo({fieldName:c,fieldInfos:e,fieldInfoMap:n,layer:i,value:p,graphic:o,timeZone:l})}),d}async function Vo(e,t){const{layer:i,graphic:o,outFields:n,objectIds:s,returnGeometry:l,spatialReference:d}=e,c=s[0];if(typeof c!="number"&&typeof c!="string"){const h="Could not query required fields for the specified feature. The feature's ID is invalid.",m={layer:i,graphic:o,objectId:c,requiredFields:n};return ei().warn(h,m),null}if(!mn(i)?.operations?.supportsQuery){const h="The specified layer cannot be queried. The following fields will not be available.",m={layer:i,graphic:o,requiredFields:n,returnGeometry:l};return ei().warn(h,m),null}const p=i.createQuery();return p.objectIds=s,p.outFields=n?.length?n:[i.objectIdField],p.returnGeometry=!!l,p.returnZ=!!l,p.returnM=!!l,p.outSpatialReference=d,(await i.queryFeatures(p,t)).features[0]}async function ws(e){if(!e.expressionInfos?.length)return!1;const t=await Io(),{arcadeUtils:{hasGeometryFunctions:i}}=t;return i(e)}async function bs({graphic:e,popupTemplate:t,layer:i,spatialReference:o},n){if(!i||!t||(typeof i.load=="function"&&await i.load(n),!e.attributes))return;const s=i.objectIdField,l=e.attributes[s];if(l==null)return;const d=[l],c=await t.getRequiredFields(i.fieldsIndex),p=fn(c,e),h=p?[]:c.includes(s)?c:[...c,s],m=t.returnGeometry||await ws(t);if(p&&!m)return;const f=await Vo({layer:i,graphic:e,outFields:h,objectIds:d,returnGeometry:m,spatialReference:o},n);f&&(f.geometry&&(e.geometry=f.geometry),f.attributes&&(e.attributes={...e.attributes,...f.attributes}))}function Ie(e=""){return!!e&&e.includes(To)}function Is(e){return e?`${To}${e.layerId}/${e.fieldName}`:""}function Oi({attributes:e,graphic:t,relatedInfo:i,fieldInfos:o,fieldInfoMap:n,layer:s,timeZone:l}){e&&t&&i&&Object.keys(t.attributes).forEach(d=>{const c=Is({layerId:i.relation.id.toString(),fieldName:d}),p=t.attributes[d];e[c]=Oo({fieldName:c,fieldInfos:o,fieldInfoMap:n,layer:s,value:p,graphic:t,timeZone:l})})}function As({attributes:e,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s}){e&&t&&(t.relatedFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})),t.relatedStatsFeatures?.forEach(l=>Oi({attributes:e,graphic:l,relatedInfo:t,fieldInfoMap:i,fieldInfos:o,layer:n,timeZone:s})))}const Vi=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},So=({layer:e,method:t,query:i,definitionExpression:o})=>{if(!e.capabilities?.query?.supportsCacheHint||t==="attachments")return;const n=i.where!=null?i.where:null,s=i.geometry!=null?i.geometry:null;Vi(o)||Vi(n)||s?.type==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},Fs=({query:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})},Ms=({queryPayload:e,layer:t,method:i})=>{So({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression??""}`})};function Cs(e,t,i){return e&&t&&i?t.type==="sublayer"?Xe({layers:t.layer?.sublayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:t.layer?.subtables,map:e,relatedLayer:t,relationship:i}):Xe({layers:e.allLayers,map:e,relatedLayer:t,relationship:i})||Xe({layers:e.allTables,map:e,relatedLayer:t,relationship:i}):null}function Si(e,t){return e&&"utilityNetworks"in e&&t?e.utilityNetworks?.find(i=>i.isUtilityLayer(t)):null}function Di(e,t){return e?.allTables.find(i=>i.type==="feature"&&i.layerId===t.id&&i.url===t.layer?.url)}function Xe({map:e,relationship:t,relationship:{relatedTableId:i},relatedLayer:o,layers:n}){if(!n)return null;for(const s of n){if(s.type==="map-image"){const d=Xe({layers:s.sublayers,map:e,relatedLayer:o,relationship:t})||Xe({layers:s.subtables,map:e,relatedLayer:o,relationship:t});if(d)return d;continue}if(!$o(s))continue;if(o.type==="sublayer"){if(s!==o&&s.id===i)return s.isTable?Di(e,s):s;continue}const l=o.type==="scene"&&o.associatedLayer?o.associatedLayer.url:o.url;if(!l)return null;if(s.type!=="sublayer"){if(s!==o&&s.url===l&&s.layerId===i)return s}else if(s!==o&&s.layer?.url===l&&s.id===i)return s.isTable?Di(e,s):s}return null}const qi={editing:!1,operations:{add:!0,update:!0,delete:!0}},Do=ce.ofType(Nn);let ne=class extends ge{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.capabilities={...qi},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new Do,this.fileInfos=new ce,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(y(()=>this.graphic,()=>this._graphicChanged(),$))}destroy(){this._attachmentLayer=null,this.graphic=null}castCapabilities(e){return{...qi,...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?.loaded&&"capabilities"in t&&t.capabilities&&"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 N("invalid-layer","getAttachments(): A valid layer is required.");const i=this._getObjectId();if(typeof i!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const o=new Li({objectIds:[i],returnMetadata:!0}),n=[],s=e.queryAttachments(o).then(d=>d[i]||n).catch(()=>n);this._getAttachmentsPromise=s,this.notifyChange("state");const l=await s;return t.destroyAll(),l.length&&t.addMany(l),this._getAttachmentsPromise=null,this.notifyChange("state"),l}async addAttachment(e,t=this.graphic){const{_attachmentLayer:i,attachmentInfos:o,capabilities:n}=this;if(!t)throw new N("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new N("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!n.operations?.add)throw new N("invalid-capabilities","addAttachment(): add capabilities are required.");if(!i||typeof i.addAttachment!="function")throw new N("invalid-layer","addAttachment(): A valid layer is required.");const s=i.addAttachment(t,e).then(d=>this._queryAttachment(d.objectId,t)),l=await s;return o.add(l),l}async deleteAttachment(e){const{_attachmentLayer:t,attachmentInfos:i,graphic:o,capabilities:n}=this;if(!e)throw new N("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!n.operations?.delete)throw new N("invalid-capabilities","deleteAttachment(): delete capabilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new N("invalid-layer","deleteAttachment(): A valid layer is required.");if(!o)throw new N("invalid-graphic","deleteAttachment(): A graphic is required.");const s=t.deleteAttachments(o,[e.id]).then(()=>e),l=await s;return i.remove(l),l.destroy(),l}async updateAttachment(e,t=this.activeAttachmentInfo){const{_attachmentLayer:i,attachmentInfos:o,graphic:n,capabilities:s}=this;if(!e)throw new N("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new N("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!s.operations?.update)throw new N("invalid-capabilities","updateAttachment(): Update capabilities are required.");const l=o.indexOf(t);if(!i||typeof i.updateAttachment!="function")throw new N("invalid-layer","updateAttachment(): A valid layer is required.");if(!n)throw new N("invalid-graphic","updateAttachment(): A graphic is required.");const d=i.updateAttachment(n,t.id,e).then(p=>this._queryAttachment(p.objectId)),c=await d;return o.splice(l,1,c),c}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 o=this.fileInfos.indexOf(i);return o>-1&&this.fileInfos.splice(o,1,{file:e,form:t}),this.fileInfos.items[o]}deleteFile(e){const t=this.fileInfos.find(i=>i.file===e);return t?(this.fileInfos.remove(t),t):null}async _queryAttachment(e,t){const{_attachmentLayer:i}=this;if(!e||!i?.queryAttachments)throw new N("invalid-attachment-id","Could not query attachment.");const o=this._getObjectId(t);if(typeof o!="number")throw new N("invalid-object-id","getAttachments(): Numeric object id is required");const n=new Li({objectIds:[o],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return i.queryAttachments(n).then(s=>s[o][0])}_getObjectId(e=this.graphic){return e?.getObjectId()??null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>this.attachmentInfos.destroyAll()))}_setAttachmentLayer(){const{graphic:e}=this,t=xo(e);this._attachmentLayer=t?t.type==="scene"&&t.associatedLayer!=null?t.associatedLayer:t:null}};r([a()],ne.prototype,"capabilities",void 0),r([et("capabilities")],ne.prototype,"castCapabilities",null),r([a()],ne.prototype,"activeAttachmentInfo",void 0),r([a()],ne.prototype,"activeFileInfo",void 0),r([a({readOnly:!0,type:Do})],ne.prototype,"attachmentInfos",void 0),r([a()],ne.prototype,"fileInfos",void 0),r([a({type:je})],ne.prototype,"graphic",void 0),r([a()],ne.prototype,"mode",void 0),r([a({readOnly:!0})],ne.prototype,"state",null),r([a()],ne.prototype,"filesEnabled",void 0),r([a({readOnly:!0})],ne.prototype,"supportsResizeAttachments",null),ne=r([P("esri.widgets.Attachments.AttachmentsViewModel")],ne);const gi=ne;function Bi(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 Es(e){const t=In("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 we={close:"esri-icon-close",collapse:"esri-icon-collapse",down:"esri-icon-down",downArrow:"esri-icon-down-arrow",dragHorizontal:"esri-icon-drag-horizontal",dragVertical:"esri-icon-drag-vertical",duplicate:"esri-icon-duplicate",expand:"esri-icon-expand",fontFallbackText:"esri-icon-font-fallback-text",forward:"esri-icon-forward",handleVertical:"esri-icon-handle-vertical",icon:"esri-icon",left:"esri-icon-left",locateCircled:"esri-icon-locate-circled",noticeTriangle:"esri-icon-notice-triangle",pause:"esri-icon-pause",play:"esri-icon-play",plus:"esri-icon-plus",radioChecked:"esri-icon-radio-checked",radioUnchecked:"esri-icon-radio-unchecked",refresh:"esri-icon-refresh",reverse:"esri-icon-reverse",right:"esri-icon-right",search:"esri-icon-search",swap:"esri-icon-swap",table:"esri-icon-table",trash:"esri-icon-trash",up:"esri-icon-up",upArrow:"esri-icon-up-arrow",upDownArrows:"esri-icon-up-down-arrows",urbanModel:"esri-icon-urban-model",zoomInMagnifyingGlass:"esri-icon-zoom-in-magnifying-glass",zoomToObject:"esri-icon-zoom-to-object"},ji={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},L="esri-attachments",A={base:L,loaderContainer:`${L}__loader-container`,loader:`${L}__loader`,fadeIn:`${L}--fade-in`,container:`${L}__container`,containerList:`${L}__container--list`,containerPreview:`${L}__container--preview`,actions:`${L}__actions`,deleteButton:`${L}__delete-button`,addAttachmentButton:`${L}__add-attachment-button`,errorMessage:`${L}__error-message`,items:`${L}__items`,item:`${L}__item`,itemButton:`${L}__item-button`,itemMask:`${L}__item-mask`,itemMaskIcon:`${L}__item-mask--icon`,itemImage:`${L}__image`,itemImageResizable:`${L}__image--resizable`,itemLabel:`${L}__label`,itemFilename:`${L}__filename`,itemChevronIcon:`${L}__item-chevron-icon`,itemLink:`${L}__item-link`,itemLinkOverlay:`${L}__item-link-overlay`,itemLinkOverlayIcon:`${L}__item-link-overlay-icon`,itemEditIcon:`${L}__item-edit-icon`,itemAddIcon:`${L}__item-add-icon`,itemAddButton:`${L}__item-add-button`,formNode:`${L}__form-node`,fileFieldset:`${L}__file-fieldset`,fileLabel:`${L}__file-label`,fileName:`${L}__file-name`,fileInput:`${L}__file-input`,metadata:`${L}__metadata`,metadataFieldset:`${L}__metadata-fieldset`,progressBar:`${L}__progress-bar`},jt=window.CSS;let X=class extends oe{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=null,this.visibleElements={...ji},this._supportsImageOrientation=jt&&jt.supports&&jt.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}normalizeCtorArgs(e){return e?.viewModel||(e={viewModel:new gi,...e}),e}initialize(){this.addHandles([dt(()=>this.viewModel?.attachmentInfos,"change",()=>this.scheduleRender()),dt(()=>this.viewModel?.fileInfos,"change",()=>this.scheduleRender()),y(()=>this.viewModel?.mode,()=>this._modeChanged(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-8qK5FfMb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)})}get capabilities(){return this.viewModel.capabilities}set capabilities(e){this.viewModel.capabilities=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 icon(){return"attachment"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...ji,...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 N("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 N("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 N("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 u("div",{class:this.classes(A.base,M.widget)},e?this._renderProgressBar():null,i==="loading"?this._renderLoading():this._renderAttachments(),this._renderErrorMessage())}_renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?u("div",{class:A.errorMessage,key:"error-message"},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 u("div",{class:A.loaderContainer,key:"loader"},u("div",{class:A.loader}))}_renderProgressBar(){return this.visibleElements.progressBar?u("div",{class:A.progressBar,key:"progress-bar"}):null}_renderAddForm(){const{submitting:e,selectedFile:t}=this,i=e||!t,o=this.visibleElements.cancelAddButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,M.buttonSmall,M.buttonHalf,e&&M.buttonDisabled),disabled:e,onclick:this._cancelForm,type:"button"},this.messages.cancel):null,n=this.visibleElements.addSubmitButton?u("button",{class:this.classes(M.button,M.buttonSecondary,M.buttonSmall,M.buttonHalf,{[M.buttonDisabled]:i}),disabled:i,type:"submit"},this.messages.add):null,s=t?u("span",{class:A.fileName,key:"file-name"},t.name):null,l=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},u("fieldset",{class:A.fileFieldset},s,u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},t?this.messages.changeFile:this.messages.selectFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))),n,o);return u("div",{class:A.formNode,key:"add-form-container"},l)}_renderDetailsForm(e){const{visibleElements:t,viewModel:i,selectedFile:o,submitting:n}=this,{capabilities:s}=i,l=n||!o;let d,c,p,h;o?(d=o.type,c=o.name,p=o.size):e&&"file"in e?(d=e.file.type,c=e.file.name,p=e.file.size):e&&"contentType"in e&&(d=e.contentType,c=e.name,p=e.size,h=e.url);const m=s.editing&&s.operations?.delete&&t.deleteButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,A.deleteButton,{[M.buttonDisabled]:n}),disabled:n,key:"delete-button",onclick:b=>this._submitDeleteAttachment(b,e),type:"button"},this.messages.delete):void 0,f=s.editing&&s.operations?.update&&t.updateButton?u("button",{class:this.classes(M.button,M.buttonSmall,M.buttonThird,{[M.buttonDisabled]:l}),disabled:l,key:"update-button",type:"submit"},this.messages.update):void 0,g=this.visibleElements.cancelUpdateButton?u("button",{bind:this,class:this.classes(M.button,M.buttonSmall,M.buttonTertiary,M.buttonThird,{[M.buttonDisabled]:n}),disabled:n,key:"cancel-button",onclick:this._cancelForm,type:"button"},this.messages.cancel):void 0,v=s.editing&&s.operations?.update?u("fieldset",{class:A.fileFieldset,key:"file"},u("span",{class:A.fileName,key:"file-name"},c),u("label",{class:this.classes(A.fileLabel,M.button,M.buttonSecondary)},this.messages.changeFile,u("input",{bind:this,class:A.fileInput,name:"attachment",onchange:this._handleFileInputChange,type:"file"}))):void 0,I=u("fieldset",{class:A.metadataFieldset,key:"size"},u("label",null,Pn(this.messagesUnits,p??0))),C=u("fieldset",{class:A.metadataFieldset,key:"content-type"},u("label",null,d)),_=h!=null?u("a",{class:A.itemLink,href:h,rel:"noreferrer",target:"_blank"},this._renderImageMask(e,400),u("div",{class:A.itemLinkOverlay},u("span",{class:A.itemLinkOverlayIcon},u("calcite-icon",{icon:"launch"})))):this._renderImageMask(e,400),T=u("form",{afterCreate:xi,afterRemoved:ki,bind:this,"data-node-ref":"_updateAttachmentForm",onsubmit:b=>this._submitUpdateAttachment(b,e)},u("div",{class:A.metadata},I,C),v,u("div",{class:A.actions},m,g,f));return u("div",{class:A.formNode,key:"edit-form-container"},_,T)}_renderImageMask(e,t){return e?"file"in e?this._renderGenericImageMask(e.file.name,e.file.type):this._renderImageMaskForAttachment(e,t):null}_renderGenericImageMask(e,t){const{supportsResizeAttachments:i}=this.viewModel,o=Es(t),n={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMaskIcon,A.itemMask),key:o},u("img",{alt:e,class:this.classes(n,A.itemImage),src:o,title:e}))}_renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:i}=this.viewModel;if(!e)return null;const{contentType:o,name:n,url:s}=e;if(!i||!Bi(o))return this._renderGenericImageMask(n,o);const l=this._getCSSTransform(e),d=l?{transform:l,"image-orientation":"none"}:{},c=`${s}${s?.includes("?")?"&":"?"}w=${t}`,p={[A.itemImageResizable]:i};return u("div",{class:this.classes(A.itemMask),key:c},u("img",{alt:n,class:this.classes(p,A.itemImage),src:c,styles:d,title:n}))}_renderFile(e){const{file:t}=e;return u("li",{class:A.item,key:t},u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,key:"details-button",onclick:()=>this._startEditFile(e),title:this.messages.attachmentDetails,type:"button"},this._renderImageMask(e),u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},t.name||this.messages.noTitle),u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}))))}_renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:i,effectiveDisplayType:o}=this,{capabilities:n,supportsResizeAttachments:s}=i,{contentType:l,name:d,url:c}=e,p=this._renderImageMask(e,t==="list"?48:400),h=n.editing?u("span",{"aria-hidden":"true",class:this.classes(A.itemChevronIcon,be(this.container)?we.left:we.right)}):null,m=[p,o==="preview"&&s&&Bi(l)?null:u("label",{class:A.itemLabel},u("span",{class:A.itemFilename},d||this.messages.noTitle),h)],f=n.editing?u("button",{"aria-label":this.messages.attachmentDetails,bind:this,class:A.itemButton,"data-attachment-info-id":e.id,key:"details-button",onclick:()=>this._startEditAttachment(e),title:this.messages.attachmentDetails,type:"button"},m):u("a",{class:A.itemButton,href:c??void 0,key:"details-link",rel:"noreferrer",target:"_blank"},m);return u("li",{class:A.item,key:e},f)}_renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:t,visibleElements:i}=this,{attachmentInfos:o,capabilities:n,fileInfos:s}=t,l=!!o?.length,d=!!s?.length,c={[A.containerList]:e!=="preview",[A.containerPreview]:e==="preview"},p=n.editing&&n.operations?.add&&i.addButton?u("button",{bind:this,class:this.classes(M.button,M.buttonTertiary,A.addAttachmentButton),onclick:()=>this._startAddAttachment(),type:"button"},u("span",{"aria-hidden":"true",class:this.classes(A.itemAddIcon,we.plus)}),this.messages.add):void 0,h=l?u("ul",{class:A.items,key:"attachments-list"},o.toArray().map(g=>this._renderAttachmentInfo({attachmentInfo:g,displayType:e}))):void 0,m=d?u("ul",{class:A.items,key:"file-list"},s.toArray().map(g=>this._renderFile(g))):void 0,f=d||l?void 0:u("div",{class:M.empty},this.messages.noAttachments);return u("div",{class:this.classes(A.container,c),key:"attachments-container"},h,m,f,p)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,i=t.files?.item(0);this._set("selectedFile",i)}_submitDeleteAttachment(e,t){e.preventDefault(),t&&("file"in t?this.deleteFile(t.file):t&&this.deleteAttachment(t))}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),t&&"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(" "):""}};r([a()],X.prototype,"capabilities",null),r([a()],X.prototype,"displayType",void 0),r([a({readOnly:!0})],X.prototype,"effectiveDisplayType",null),r([a()],X.prototype,"graphic",null),r([a()],X.prototype,"icon",null),r([a()],X.prototype,"label",null),r([a(),Y("esri/widgets/Attachments/t9n/Attachments")],X.prototype,"messages",void 0),r([a(),Y("esri/core/t9n/Units")],X.prototype,"messagesUnits",void 0),r([a({readOnly:!0})],X.prototype,"selectedFile",void 0),r([a({readOnly:!0})],X.prototype,"submitting",void 0),r([a({readOnly:!0})],X.prototype,"error",void 0),r([a({type:gi})],X.prototype,"viewModel",void 0),r([a()],X.prototype,"visibleElements",void 0),r([et("visibleElements")],X.prototype,"castVisibleElements",null),X=r([P("esri.widgets.Attachments")],X);const Ts=X;let nt=class extends gi{constructor(e){super(e),this.description=null,this.title=null}};r([a()],nt.prototype,"description",void 0),r([a()],nt.prototype,"title",void 0),nt=r([P("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],nt);const yi=nt;function _i({level:e,class:t,...i},o){const n=xs(e);return u(`h${n}`,{...i,"aria-level":String(n),class:xn(M.heading,t),role:"heading"},o)}function xs(e){return An(Math.ceil(e),1,6)}const Wt="esri-feature-element-info",zt={base:Wt,title:`${Wt}__title`,description:`${Wt}__description`};let Ze=class extends oe{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return u("div",{class:zt.base},this._renderTitle(),this._renderDescription())}_renderTitle(){const{title:e}=this;return e?u(_i,{class:zt.title,innerHTML:e,level:this.headingLevel}):null}_renderDescription(){const{description:e}=this;return e?u("div",{class:zt.description,innerHTML:e,key:"description"}):null}};r([a()],Ze.prototype,"description",void 0),r([a()],Ze.prototype,"headingLevel",void 0),r([a()],Ze.prototype,"title",void 0),Ze=r([P("esri.widgets.Feature.support.FeatureElementInfo")],Ze);const mt=Ze,ks={base:"esri-feature-attachments"};let ye=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new Ts,this.headingLevel=2,this.viewModel=new yi}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.description,this.viewModel?.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>this.viewModel,e=>this.attachmentsWidget.viewModel=e,$)])}destroy(){this.attachmentsWidget.viewModel=null,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(){const{attachmentsWidget:e}=this;return u("div",{class:ks.base},this._featureElementInfo?.render(),e?.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo?.set({description:e,title:t,headingLevel:i})}};r([a({readOnly:!0})],ye.prototype,"attachmentsWidget",void 0),r([a()],ye.prototype,"description",null),r([a()],ye.prototype,"displayType",null),r([a()],ye.prototype,"graphic",null),r([a()],ye.prototype,"headingLevel",void 0),r([a()],ye.prototype,"title",null),r([a({type:yi})],ye.prototype,"viewModel",void 0),ye=r([P("esri.widgets.Feature.FeatureAttachments")],ye);const Ls=ye;let Ee=class extends ge{constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.addHandles(y(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},$))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:i}=this;e&&t&&(kt({type:"content",value:i,event:{graphic:t}}),this._set("created",null))}async _createContent(e){const t=this.graphic;if(!t||!e)return;const i=kt({type:"content",value:e,event:{graphic:t}});this._loadingPromise=i,this.notifyChange("state");const o=await i;i===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",o))}};r([a({readOnly:!0})],Ee.prototype,"created",void 0),r([a()],Ee.prototype,"creator",void 0),r([a()],Ee.prototype,"destroyer",void 0),r([a({type:je})],Ee.prototype,"graphic",void 0),r([a({readOnly:!0})],Ee.prototype,"state",null),Ee=r([P("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],Ee);const Lt=Ee;function qo(e){return t=>{t.hasOwnProperty("_delegatedEventNames")||(t._delegatedEventNames=t._delegatedEventNames?t._delegatedEventNames.slice():[]);const i=t._delegatedEventNames,o=Array.isArray(e)?e:Ps(e);i.push(...o)}}function Ps(e){return e.split(",").map(t=>t.trim())}function Bo(e){return e&&typeof e.render=="function"}function Ns(e){return e&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}const Ht="esri-feature-content",Ut={base:Ht,loaderContainer:`${Ht}__loader-container`,loader:`${Ht}__loader`};let Ge=class extends oe{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=i=>{Array.from(i.querySelectorAll("a")).forEach(o=>{ko(o.href)&&!o.hasAttribute("target")&&o.setAttribute("target","_blank")})}}get creator(){return this.viewModel?.creator}set creator(e){this.viewModel&&(this.viewModel.creator=e)}get graphic(){return this.viewModel?.graphic}set graphic(e){this.viewModel&&(this.viewModel.graphic=e)}render(){const e=this.viewModel?.state;return u("div",{class:Ut.base},e==="loading"?this._renderLoading():this._renderCreated())}_renderLoading(){return u("div",{class:Ut.loaderContainer,key:"loader"},u("div",{class:Ut.loader}))}_renderCreated(){const e=this.viewModel?.created;return e?e instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:e,key:e}):Bo(e)?u("div",{key:e},!e.destroyed&&e.render()):u("div",{afterCreate:this._addTargetToAnchors,innerHTML:e,key:e}):null}_attachToNode(e){const t=this;e.appendChild(t)}};r([a()],Ge.prototype,"creator",null),r([a()],Ge.prototype,"graphic",null),r([a({type:Lt})],Ge.prototype,"viewModel",void 0),Ge=r([P("esri.widgets.Feature.FeatureContent")],Ge);const bt=Ge;let ve=class extends ge{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?.forEach(o=>{if(!(!o.hasOwnProperty("visible")||o.visible))return;const n=o.clone();n.label=Lo(n,e),i.push(n)}),i}};r([a()],ve.prototype,"attributes",void 0),r([a({type:[sn]})],ve.prototype,"expressionInfos",void 0),r([a()],ve.prototype,"description",void 0),r([a({type:[uo]})],ve.prototype,"fieldInfos",void 0),r([a({readOnly:!0})],ve.prototype,"formattedFieldInfos",null),r([a()],ve.prototype,"title",void 0),ve=r([P("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],ve);const Rt=ve,$s=[{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 Rs(e,t){if(typeof t!="string"||!t)return t;const i=$s.find(c=>c.pattern.test(t));if(!i)return t;const o=t.match(i.pattern),n=o?.[2],s=ct(ct(i.label,{messages:e,hierPart:n}),{appName:i.appName}),l=i.target?` target="${i.target}"`:"",d=i.target==="_blank"?' rel="noreferrer"':"";return t.replace(i.pattern,`${s}`)}const yt="esri-feature-fields",_t={base:yt,fieldHeader:`${yt}__field-header`,fieldData:`${yt}__field-data`,fieldDataDate:`${yt}__field-data--date`};let he=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new Rt,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new mt,this.addHandles(y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$))}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}render(){return u("div",{class:_t.base},this._featureElementInfo?.render(),this._renderFields())}_renderFieldInfo(e,t){const{attributes:i}=this.viewModel,o=e.fieldName||"",n=e.label||o,s=i?i[o]==null?"":i[o]:"",l=!!e.format?.dateFormat,d=typeof s=="number"&&!l?this._forceLTR(s):Rs(this.messagesURIUtils,s),c={[_t.fieldDataDate]:l};return u("tr",{key:`fields-element-info-row-${o}-${t}`},u("th",{class:_t.fieldHeader,innerHTML:n,key:`fields-element-info-row-header-${o}-${t}`}),u("td",{class:this.classes(_t.fieldData,c),innerHTML:d,key:`fields-element-info-row-data-${o}-${t}`}))}_renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e?.length?u("table",{class:M.table,summary:this.messages.fieldsSummary},u("tbody",null,e.map((t,i)=>this._renderFieldInfo(t,i)))):null}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};r([a()],he.prototype,"attributes",null),r([a()],he.prototype,"description",null),r([a()],he.prototype,"expressionInfos",null),r([a()],he.prototype,"fieldInfos",null),r([a()],he.prototype,"title",null),r([a({type:Rt,nonNullable:!0})],he.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],he.prototype,"messages",void 0),r([a(),Y("esri/widgets/support/t9n/uriUtils")],he.prototype,"messagesURIUtils",void 0),he=r([P("esri.widgets.Feature.FeatureFields")],he);const jo=he,Os={maximumFractionDigits:20};function Vs(e){return Be(e,Os)}const Ss="<",Ds=">";function qs(e,t,i,o){let n="";return t===0?n=`${Ss} `:t===i&&(n=`${Ds} `),n+Vs(e)}const Bs=new po([64,64,64]);function js(e,t){const i=[],o=e.length-1;return e.length===5?i.push(0,2,4):i.push(0,o),e.map((n,s)=>i.includes(s)?qs(n,s,o):null)}async function Ws(e,t,i){let o=!1,n=[],s=[];if(e.stops){const p=e.stops;n=p.map(h=>h.value),o=p.some(h=>!!h.label),o&&(s=p.map(h=>h.label))}const l=n[0],d=n[n.length-1];if(l==null&&d==null)return null;const c=o?null:js(n);return(await Promise.all(n.map(async(p,h)=>({value:p,color:e.type==="opacity"?await zs(p,e):(await w(async()=>{const{getColor:m}=await import("./visualVariableUtils-D3kZJRyn-tyrXoPjU.js");return{getColor:m}},__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url)).getColor(e,p),label:o?s[h]:c?.[h]??""})))).reverse()}async function zs(e,t,i){const o=new po(Bs),n=(await w(async()=>{const{getOpacity:s}=await import("./visualVariableUtils-D3kZJRyn-tyrXoPjU.js");return{getOpacity:s}},__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url)).getOpacity(t,e);return n!=null&&(o.a=n),o}function Hs(e){if(!e.colorStops)return[];const t=[...e.colorStops].filter(o=>o.color?.a>0);let i=t.length-1;if(t&&t[0]){const o=t[i];o&&o.ratio!==1&&(t.push(new qn({ratio:1,color:o.color})),i++)}return t.map((o,n)=>{let s="";return n===0?s=e.legendOptions?.minLabel||"low":n===i&&(s=e.legendOptions?.maxLabel||"high"),{color:o.color,label:s,ratio:o.ratio}}).reverse()}ho("short-date");async function le(e,t,i){Cn(e,t,()=>[]).push(...i)}async function Us(e){const t=new Map;if(!e)return t;if("visualVariables"in e&&e.visualVariables){const i=e.visualVariables.filter(o=>o.type==="color");for(const o of i){const n=(await Ws(o)??[]).map(s=>s.color);await le(t,o.field||o.valueExpression,n)}}if(e.type==="heatmap"){const i=Hs(e).map(o=>o.color);await le(t,e.field||e.valueExpression,i)}else if(e.type==="pie-chart"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e?.othersCategory?.color,We(e.backgroundFillSymbol,null)])}else if(e.type==="dot-density"){for(const i of e.attributes)await le(t,i.field||i.valueExpression,[i.color]);await le(t,"default",[e.backgroundColor])}else if(e.type==="unique-value")if(e.authoringInfo?.type==="predominance")for(const i of e.uniqueValueInfos??[])await le(t,i.value.toString(),[We(i.symbol,null)]);else{const i=(e.uniqueValueInfos??[]).map(d=>We(d.symbol,null)),{field:o,field2:n,field3:s,valueExpression:l}=e;(o||l)&&await le(t,o||l,i),n&&await le(t,n,i),s&&await le(t,s,i)}else if(e.type==="class-breaks"){const i=e.classBreakInfos.map(s=>We(s.symbol,null)),{field:o,valueExpression:n}=e;await le(t,o??n,i)}else e.type==="simple"&&await le(t,"default",[We(e.symbol,null)]);return"defaultSymbol"in e&&e.defaultSymbol&&await le(t,"default",[We(e.defaultSymbol,null)]),t.forEach((i,o)=>{const n=ui(i.filter(Boolean),(s,l)=>JSON.stringify(s)===JSON.stringify(l));t.set(o,n)}),t}const Zs="esri.widgets.Feature.support.relatedFeatureUtils",Wi=()=>K.getLogger(Zs),zi=new Map;function It(e){if(!Ie(e))return null;const[t,i]=e.split("/").slice(1);return{layerId:t,fieldName:i}}function Gs(e,t){if(!t.relationships)return null;let i=null;const{relationships:o}=t;return o.some(n=>n.id===parseInt(e,10)&&(i=n,!0)),i}function Qs({originRelationship:e,relationships:t,layerId:i}){return t.find(({relatedTableId:o,id:n})=>`${o}`===i&&n===e?.id)??null}function Xs(e,t){const i=t.toLowerCase();for(const o in e)if(o.toLowerCase()===i)return e[o];return null}function Js(e,t){const i=Gs(e,t);if(i)return{url:`${t.url}/${i.relatedTableId}`,sourceSpatialReference:t.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function Ks(e,t){if(!t||!e)return;const{features:i,statsFeatures:o}=e,n=i?.value;t.relatedFeatures=n?n.features:[];const s=o?.value;t.relatedStatsFeatures=s?s.features:[]}function Ys(e,t,i,o){const n=new Kt;return n.outFields=["*"],n.relationshipId=typeof t.id=="number"?t.id:parseInt(t.id,10),n.objectIds=[e.attributes[i.objectIdField]],n.gdbVersion=i.gdbVersion??null,n.historicMoment=i.historicMoment??null,i.queryRelatedFeatures?.(n,o)??Promise.resolve({})}function er(e,t,i){let o=0;const n=[];for(;oJSON.stringify(t.toJSON())===JSON.stringify(i.toJSON())):void 0}async function or(e,t,i,o){const n=i.layerId.toString(),{layerInfo:s,relation:l,relatedFields:d,outStatistics:c,url:p,sourceSpatialReference:h}=t,m=tr(d),f=ir(c);if(!s||!l)return null;const g=Qs({originRelationship:l,relationships:s.relationships,layerId:n});if(g?.relationshipTableId&&g.keyFieldInRelationshipTable){const I=(await Ys(e,g,i,o))[e.attributes[i.objectIdField]];if(!I)return null;const C=I.features.map(_=>_.attributes[s.objectIdField]);if(f?.length&&s.supportsStatistics){const _=new lt;_.where=er(s.objectIdField,C,1e3),_.outFields=m,_.outStatistics=f,_.sourceSpatialReference=h;const T={features:Promise.resolve(I),statsFeatures:Dt(p,_)};return qe(T)}}const v=g?.keyField;if(v){const I=Fn(lr(s.fields,v)),C=Xs(e.attributes,l.keyField),_=I?`${v}=${C}`:`${v}='${C}'`,T=i.historicMoment,b=i.gdbVersion,G=Dt(p,new lt({where:_,outFields:m,sourceSpatialReference:h,historicMoment:T,gdbVersion:b}),o),W=f?.length&&s.supportsStatistics?Dt(p,new lt({where:_,outFields:m,outStatistics:f,sourceSpatialReference:h}),o):null,q={features:G};return W&&(q.statsFeatures=W),qe(q)}return null}function nr(e,t){return Mn(e,{query:{f:"json"},signal:t?.signal})}function sr({relatedInfos:e,layer:t},i){const o={};return e.forEach((n,s)=>{const{relation:l}=n;if(!l){const m=new N("relation-required","A relation is required on a layer to retrieve related records.");throw Wi().error(m),m}const{relatedTableId:d}=l;if(typeof d!="number"){const m=new N("A related table ID is required on a layer to retrieve related records.");throw Wi().error(m),m}const c=`${t.url}/${d}`,p=zi.get(c),h=p??nr(c);p||zi.set(c,h),o[s]=h}),gn(qe(o),i)}function rr({graphic:e,relatedInfos:t,layer:i},o){const n={};return t.forEach((s,l)=>{s.layerInfo&&(n[l]=or(e,s,i,o))}),qe(n)}function ar({relatedInfo:e,fieldName:t,fieldInfo:i}){if(e.relatedFields?.push(t),i.statisticType){const o=new Bn({statisticType:i.statisticType,onStatisticField:t,outStatisticFieldName:t});e.outStatistics?.push(o)}}function lr(e,t){if(e!=null){t=t.toLowerCase();for(const i of e)if(i&&i.name.toLowerCase()===t)return i}return null}const Hi={chartAnimation:!0};let H=class extends ge{constructor(e){super(e),this.abilities={...Hi},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.isAggregate=!1,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...Hi,...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{mediaInfos:e,layer:t}=this,i=this.attributes??{},o=this.formattedAttributes??{},n=this.expressionAttributes??{},s=this.fieldInfoMap??new Map;return e?.map(l=>{const d=l?.clone();return d?(d.title=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.title}),d.caption=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.caption}),d.altText=Ve({attributes:i,fieldInfoMap:s,globalAttributes:o,expressionAttributes:n,layer:t,text:d.altText}),d.type==="image"?d.value?(this._setImageValue({value:d.value,formattedAttributes:o,layer:t}),d.value.sourceURL?d:void 0):void 0:d.type==="pie-chart"||d.type==="line-chart"||d.type==="column-chart"||d.type==="bar-chart"?d.value?(this._setChartValue({value:d.value,chartType:d.type,attributes:i,formattedAttributes:o,layer:t,expressionAttributes:n}),d):void 0:null):null}).filter(Nt)??[]}_setImageValue(e){const t=this.fieldInfoMap??new Map,{value:i,formattedAttributes:o,layer:n}=e,{linkURL:s,sourceURL:l}=i;if(l){const d=ii(l,n);i.sourceURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}if(s){const d=ii(s,n);i.linkURL=ti({formattedAttributes:o,template:d,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:i,formattedAttributes:o,chartType:n,layer:s,expressionAttributes:l}=e,{popupTemplate:d,relatedInfos:c}=this,{fields:p,normalizeField:h}=t,m=s;if(t.fields=ss(p,m),h&&(t.normalizeField=ut(h,m)),!p.some(g=>!!(o[g]!=null||Ie(g)&&c?.size)))return;const f=d?.fieldInfos??[];p.forEach((g,v)=>{const I=t.colors?.[v];if(Ie(g))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:f,fieldName:g,formattedAttributes:o,chartType:n,value:t,color:I})]);const C=this._getChartOption({value:t,attributes:i,chartType:n,formattedAttributes:o,expressionAttributes:l,fieldName:g,fieldInfos:f,color:I});t.series.push(C)})}_getRelatedChartInfos(e){const{fieldInfos:t,fieldName:i,formattedAttributes:o,chartType:n,value:s,color:l}=e,d=[],c=It(i),p=c&&this.relatedInfos?.get(c.layerId.toString());if(!p)return d;const{relatedFeatures:h,relation:m}=p;if(!m||!h)return d;const{cardinality:f}=m;return h.forEach(g=>{const{attributes:v}=g;v&&Object.keys(v).forEach(I=>{I===c.fieldName&&d.push(this._getChartOption({value:s,attributes:v,formattedAttributes:o,fieldName:i,chartType:n,relatedFieldName:I,hasMultipleRelatedFeatures:h?.length>1,fieldInfos:t,color:l}))})}),f==="one-to-many"||f==="many-to-many"?d:[d[0]]}_getTooltip({label:e,value:t,chartType:i}){return i==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){const{value:t,attributes:i,formattedAttributes:o,expressionAttributes:n,fieldName:s,relatedFieldName:l,fieldInfos:d,chartType:c,hasMultipleRelatedFeatures:p,color:h}=e,m=this.layer,f=this.fieldInfoMap??new Map,{normalizeField:g,tooltipField:v}=t,I=g?Ie(g)?i[It(g).fieldName]:i[g]:null,C=hi(s)&&n&&n[s]!==void 0?n[s]:l&&i[l]!==void 0?i[l]:i[s]!==void 0?i[s]:o[s],_=new yn({fieldName:s,color:h,value:C===void 0?null:C&&I?C/I:C});if(Ie(s)){const q=f.get(s.toLowerCase()),ue=v&&f.get(v.toLowerCase()),ae=q?.fieldName??s,Vt=p&&v?It(v).fieldName:ue?.fieldName??v,on=p&&Vt?i[Vt]:o[Vt]??q?.label??q?.fieldName??l,nn=p&&l?i[l]:o[ae];return _.tooltip=this._getTooltip({label:on,value:nn,chartType:c}),_}const T=Ro(d,s),b=ut(s,m),G=v&&o[v]!==void 0?o[v]:Lo(T||new uo({fieldName:b}),this.popupTemplate?.expressionInfos),W=o[b];return _.tooltip=this._getTooltip({label:G,value:W,chartType:c}),_}};r([a()],H.prototype,"abilities",void 0),r([et("abilities")],H.prototype,"castAbilities",null),r([a()],H.prototype,"activeMediaInfoIndex",void 0),r([a({readOnly:!0})],H.prototype,"activeMediaInfo",null),r([a()],H.prototype,"attributes",void 0),r([a()],H.prototype,"description",void 0),r([a()],H.prototype,"fieldInfoMap",void 0),r([a()],H.prototype,"formattedAttributes",void 0),r([a()],H.prototype,"expressionAttributes",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfos",null),r([a()],H.prototype,"isAggregate",void 0),r([a()],H.prototype,"layer",void 0),r([a({readOnly:!0})],H.prototype,"formattedMediaInfoCount",null),r([a()],H.prototype,"mediaInfos",void 0),r([a()],H.prototype,"popupTemplate",void 0),r([a()],H.prototype,"relatedInfos",void 0),r([a()],H.prototype,"title",void 0),H=r([P("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],H);const Se=H,z="esri-feature-media",te={base:z,mediaContainer:`${z}__container`,mediaItemContainer:`${z}__item-container`,mediaItem:`${z}__item`,mediaItemText:`${z}__item-text`,mediaItemTitle:`${z}__item-title`,mediaItemCaption:`${z}__item-caption`,mediaNavigation:`${z}__item-navigation`,mediaPagination:`${z}__pagination`,mediaPaginationText:`${z}__pagination-text`,mediaPrevious:`${z}__previous`,mediaPreviousIconLTR:`${z}__previous-icon`,mediaPreviousIconRTL:`${z}__previous-icon--rtl`,mediaNext:`${z}__next`,mediaNextIconLTR:`${z}__next-icon`,mediaNextIconRTL:`${z}__next-icon--rtl`,mediaChart:`${z}__chart`,mediaPaginationButton:`${z}__pagination-button`,mediaPaginationIcon:`${z}__pagination-icon`,mediaChartRendered:`${z}__chart--rendered`},Zt=15,Fe="category",tt="value",dr="rgba(50, 50, 50, 1)",cr=250,ur=500,pr=200;let ie=class extends oe{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this._chartRootMap=new WeakMap,this.viewModel=new Se,this.messages=null,this._disposeChart=i=>{this._chartRootMap.get(i)?.dispose(),this._chartRootMap.delete(i)},this._createChart=async i=>{const{destroyed:o,viewModel:n}=this;if(o||!n||!i)return;const{createRoot:s}=await w(()=>import("./chartUtilsAm5-CtY-kHPy-KDNsYH7z.js"),__vite__mapDeps([14,4,5,3,6,15,16,17]),import.meta.url),l=await s(i);this._chartRootMap.set(i,l),this._renderChart({mediaInfo:n.activeMediaInfo,root:l})}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel?.activeMediaInfo,this.viewModel?.activeMediaInfoIndex],()=>this._setupMediaRefreshTimer(),$),y(()=>[this.viewModel?.description,this.viewModel?.title],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-8qK5FfMb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)})}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(){return u("div",{bind:this,class:te.base,onkeyup:this._handleMediaKeyup},this._featureElementInfo?.render(),this._renderMedia())}_renderMedia(){const{formattedMediaInfoCount:e,activeMediaInfoIndex:t}=this.viewModel,i=this._renderMediaText();return e?u("div",{class:te.mediaContainer,key:"media-element-container"},this._renderMediaInfo(),u("div",{class:te.mediaNavigation},i,e>1?u("div",{class:te.mediaPagination},this._renderMediaPageButton("previous"),u("span",{class:te.mediaPaginationText},pe(this.messages.pageText,{index:t+1,total:e})),this._renderMediaPageButton("next")):null)):null}_renderMediaText(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e&&e.title?u("div",{class:te.mediaItemTitle,innerHTML:e.title,key:"media-title"}):null,i=e&&e.caption?u("div",{class:te.mediaItemCaption,innerHTML:e.caption,key:"media-caption"}):null;return t||i?u("div",{class:te.mediaItemText,key:"media-text"},t,i):null}_renderImageMediaInfo(e){if(!e.value)return null;const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:o}=this.viewModel,{value:n,refreshInterval:s,altText:l,title:d,type:c}=e,{sourceURL:p,linkURL:h}=n,m=ko(h??void 0)?"_blank":"_self",f=m==="_blank"?"noreferrer":"",g=s?t:null,v=g?g.timestamp:0,I=g?g.sourceURL:p,C=u("img",{alt:l||d,key:`media-${c}-${i}-${o}-${v}`,src:I??void 0});return(h?u("a",{href:h,rel:f,target:m,title:d},C):null)??C}_renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return u("div",{afterCreate:this._createChart,afterRemoved:this._disposeChart,bind:this,class:te.mediaChart,key:`media-${e.type}-${t}-${i}`})}_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;return e?u("div",{class:te.mediaItemContainer,key:"media-container"},u("div",{class:te.mediaItem,key:"media-item-container"},this._renderMediaInfoType())):null}_renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",i=t?this.messages.previous:this.messages.next,o=t?"chevron-left":"chevron-right",n=t?"media-previous":"media-next",s=t?this._previous:this._next;return u("button",{"aria-label":i,bind:this,class:te.mediaPaginationButton,key:n,onclick:s,tabIndex:0,title:i,type:"button"},u("calcite-icon",{class:te.mediaPaginationIcon,icon:o,scale:"s"}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo?.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}_getRenderer(){if(!this.viewModel)return;const{isAggregate:e,layer:t}=this.viewModel;return e&&t?.featureReduction&&"renderer"in t.featureReduction?t.featureReduction.renderer:t?.renderer}async _getSeriesColors(e){const{colorAm5:t}=await w(()=>import("./chartCommon-rWfJsTPl-C_UBBu0e.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),i=new Map;return e.forEach(o=>{o.color&&i.set(o,t(o.color.toCss(!0)))}),i}async _getRendererColors(){const{colorAm5:e}=await w(()=>import("./chartCommon-rWfJsTPl-C_UBBu0e.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),t=new Map,i=this._getRenderer(),o="default";if(!i)return t;const n=await Us(i);return n.delete(o),Array.from(n.values()).every(s=>s?.length===1)&&Array.from(n.keys()).forEach(s=>{const l=n.get(s)?.[0]?.toCss(!0);l&&t.set(s,e(l))}),t}_handleMediaKeyup(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_canAnimateChart(){return!!this.viewModel&&!!this.viewModel.abilities.chartAnimation&&!On()}_getChartAnimationMS(){return this._canAnimateChart()?cr:0}_getChartSeriesAnimationMS(){return this._canAnimateChart()?ur:0}async _renderChart(e){const{root:t,mediaInfo:i}=e,{value:o,type:n}=i,{ResponsiveThemeAm5:s,DarkThemeAm5:l,AnimatedThemeAm5:d,ColorSetAm5:c,ThemeAm5:p,esriChartColorSet:h}=await w(async()=>{const{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}=await import("./chartCommon-rWfJsTPl-C_UBBu0e.js");return{ResponsiveThemeAm5:b,DarkThemeAm5:G,AnimatedThemeAm5:W,ColorSetAm5:q,ThemeAm5:ue,esriChartColorSet:ae}},__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),m=p.new(t);m.rule("ColorSet").set("colors",h),m.rule("ColorSet").set("reuse",!0);const f=[s.new(t),m];kn()&&f.push(l.new(t)),this._canAnimateChart()&&f.push(d.new(t)),t.setThemes(f);const g=await this._getRendererColors(),v=await this._getSeriesColors(o.series),I=c.new(t,{}),C=v.get(o.series[0]),_=C?{lineSettings:{stroke:C}}:void 0,T=o.series.map((b,G)=>{const W=v.get(b)||g.get(b.fieldName)||I.getIndex(G);return{[Fe]:b.tooltip,[tt]:b.value,columnSettings:{fill:W,stroke:W},..._}}).filter(b=>n!=="pie-chart"||b.value!=null&&b.value>0);n==="pie-chart"?this._createPieChart(e,T):this._createXYChart(e,T)}_getDirection(){return be(this.container)?"rtl":"ltr"}async _customizeChartTooltip(e,t="horizontal"){const{colorAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-C_UBBu0e.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url);e.setAll({pointerOrientation:t}),e.get("background")?.setAll({stroke:i(dr)}),e.label.setAll({direction:this._getDirection(),oversizedBehavior:"wrap",maxWidth:pr})}async _createPieChart(e,t){const{TooltipAm5:i}=await w(()=>import("./chartCommon-rWfJsTPl-C_UBBu0e.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{PieChartAm5:o,PieSeriesAm5:n}=await w(async()=>{const{PieChartAm5:v,PieSeriesAm5:I}=await import("./pieChart-qcxaoQkv-jYI0rZLi.js");return{PieChartAm5:v,PieSeriesAm5:I}},__vite__mapDeps([21,3,4,5,6,22,15,20,17]),import.meta.url),{mediaInfo:s,root:l}=e,{title:d}=s,c=5,p=s?.altText||s?.title||"",h=l.container.children.push(o.new(l,{ariaLabel:p,focusable:!0,paddingBottom:c,paddingTop:c,paddingLeft:c,paddingRight:c})),m=`{category}: {valuePercentTotal.formatNumber('0.00')}% + ({value})`,f=i.new(l,{labelText:m}),g=h.series.push(n.new(l,{name:d,valueField:tt,categoryField:Fe,tooltip:f}));g.ticks.template.set("forceHidden",!0),g.labels.template.set("forceHidden",!0),g.slices.template.states.create("active",{shiftRadius:c}),this._customizeChartTooltip(f),g.slices.template.setAll({ariaLabel:m,focusable:!0,templateField:"columnSettings"}),g.data.setAll(t),g.appear(this._getChartSeriesAnimationMS()),h.appear(this._getChartAnimationMS()),h.root.dom.classList.toggle(te.mediaChartRendered,!0)}_getMinSeriesValue(e){let t=0;return e.forEach(i=>t=Math.min(i.value,t)),t}async _createColumnChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-C_UBBu0e.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-CLpax4aT.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(m,{renderer:l.new(m,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(m,{renderer:c.new(m,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:_}));this._customizeChartTooltip(_),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarX",n.new(m,{orientation:"horizontal"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createBarChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-C_UBBu0e.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,ColumnSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}=await import("./xyChart-Ch-p5aUf-CLpax4aT.js");return{CategoryAxisAm5:b,AxisRendererXAm5:G,ValueAxisAm5:W,AxisRendererYAm5:q,ColumnSeriesAm5:ue}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{mediaInfo:h,root:m}=t,{value:f,title:g}=h;e.setAll({wheelX:"panY",wheelY:"zoomY"});const v=e.yAxes.push(s.new(m,{renderer:c.new(m,{inversed:!0}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.xAxes.push(d.new(m,{renderer:l.new(m,{inside:!1,inversed:be(this.container)}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryY}",_=o.new(m,{labelText:C}),T=e.series.push(p.new(m,{name:g,xAxis:I,yAxis:v,valueXField:tt,categoryYField:Fe,tooltip:_}));this._customizeChartTooltip(_,"vertical"),T.columns.template.setAll({ariaLabel:C,focusable:!0,templateField:"columnSettings"}),f.series.length>Zt&&e.set("scrollbarY",n.new(m,{orientation:"vertical"})),v.data.setAll(i),T.data.setAll(i),T.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createLineChart(e,t,i){const{TooltipAm5:o,ScrollbarAm5:n}=await w(()=>import("./chartCommon-rWfJsTPl-C_UBBu0e.js"),__vite__mapDeps([18,15,3,4,5,6,19,16,20]),import.meta.url),{CategoryAxisAm5:s,AxisRendererXAm5:l,ValueAxisAm5:d,AxisRendererYAm5:c,LineSeriesAm5:p}=await w(async()=>{const{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}=await import("./xyChart-Ch-p5aUf-CLpax4aT.js");return{CategoryAxisAm5:G,AxisRendererXAm5:W,ValueAxisAm5:q,AxisRendererYAm5:ue,LineSeriesAm5:ae}},__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{root:h,mediaInfo:m}=t,{value:f,title:g}=m;e.setAll({wheelX:"panX",wheelY:"zoomX"});const v=e.xAxes.push(s.new(h,{renderer:l.new(h,{inversed:be(this.container)}),categoryField:Fe}));v.get("renderer").labels.template.setAll({forceHidden:!0});const I=e.yAxes.push(d.new(h,{renderer:c.new(h,{inside:!1}),min:this._getMinSeriesValue(f.series)}));I.get("renderer").labels.template.setAll({direction:this._getDirection()});const C="{categoryX}",_=i[0]?.lineSettings?.stroke,T=o.new(h,{getFillFromSprite:!_,labelText:C});_&&T.get("background")?.setAll({fill:_});const b=e.series.push(p.new(h,{name:g,xAxis:v,yAxis:I,valueYField:tt,categoryXField:Fe,tooltip:T}));b.strokes.template.setAll({templateField:"lineSettings"}),this._customizeChartTooltip(T,"vertical"),f.series.length>Zt&&e.set("scrollbarX",n.new(h,{orientation:"horizontal"})),v.data.setAll(i),b.data.setAll(i),b.appear(this._getChartSeriesAnimationMS()),e.appear(this._getChartAnimationMS())}async _createXYChart(e,t){const{XYChartAm5:i,XYCursorAm5:o}=await w(()=>import("./xyChart-Ch-p5aUf-CLpax4aT.js"),__vite__mapDeps([23,15,3,4,5,6,20,17,22,19]),import.meta.url),{root:n,mediaInfo:s}=e,{type:l}=s,d=s?.altText||s?.title||"",c=n.container.children.push(i.new(n,{ariaLabel:d,focusable:!0,panX:!0,panY:!0}));c.set("cursor",o.new(n,{})),l==="column-chart"&&await this._createColumnChart(c,e,t),l==="bar-chart"&&await this._createBarChart(c,e,t),l==="line-chart"&&await this._createLineChart(c,e,t),c.root.dom.classList.toggle(te.mediaChartRendered,!0)}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:e&&this._getImageSource(e,t)}}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e?.type==="image"&&e?.refreshInterval>0&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e,o=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const n=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},o);this._refreshTimer=n}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[o,n=""]=e.split("#");return`${o}${i}timestamp=${t}${n?"#":""}${n}`}};r([a()],ie.prototype,"_refreshIntervalInfo",void 0),r([a()],ie.prototype,"attributes",null),r([a()],ie.prototype,"activeMediaInfoIndex",null),r([a()],ie.prototype,"description",null),r([a()],ie.prototype,"fieldInfoMap",null),r([a()],ie.prototype,"layer",null),r([a()],ie.prototype,"mediaInfos",null),r([a()],ie.prototype,"popupTemplate",null),r([a()],ie.prototype,"relatedInfos",null),r([a()],ie.prototype,"title",null),r([a({type:Se})],ie.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],ie.prototype,"messages",void 0),ie=r([P("esri.widgets.Feature.FeatureMedia")],ie);const Wo=ie,hr="esri.widgets.Feature.support.arcadeFeatureUtils",Ui=()=>K.getLogger(hr);function mr(e){return typeof e=="string"?ht(fi(e)):Array.isArray(e)?fr(e):e?.declaredClass==="esri.arcade.Dictionary"?gr(e):e}function fr(e){return`
    ${e.map(t=>`
  • ${typeof t=="string"?ht(fi(t)):t}
  • `).join("")}
`}function gr(e){const t=e.keys().map(i=>{const o=e.field(i);return`${i}${typeof o=="string"?ht(fi(o)):o}`}).join("");return`${t}
`}function zo(){return w(()=>import("./arcade-CaGqU4sP-DcIDNIme.js"),__vite__mapDeps([24,3,4,5,6,25,26,27,28,29,30,31,32,13,10,11,12,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,7,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103]),import.meta.url)}function yr(e){return"createQuery"in e&&"queryFeatures"in e}async function _r({graphic:e,view:t,options:i}){const{isAggregate:o,layer:n}=e;if(!o||!n||t?.type!=="2d")return[];const s=await t.whenLayerView(n);if(!yr(s))return[];const l=s.createQuery(),d=e.getObjectId();l.aggregateIds=d!=null?[d]:[];const{features:c}=await s.queryFeatures(l,i);return c}function vr({layer:e,aggregatedFeatures:t,interceptor:i}){const{fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d}=e;return new Mo({fields:o,objectIdField:n,geometryType:s,spatialReference:l,displayField:d,interceptor:i,...e.type==="feature"?{templates:e.templates,typeIdField:e.typeIdField,types:e.types}:null,source:t})}async function Ho({expressionInfo:e,arcade:t,interceptor:i,spatialReference:o,map:n,graphic:s,location:l,view:d,options:c}){if(!e?.expression)return null;const{isAggregate:p}=s,h=(s.sourceLayer||s.layer)??void 0,m=p?"feature-reduction-popup":"popup",f=t.createArcadeProfile(m),g=t.createArcadeExecutor(e.expression,f).catch(b=>Ui().error("arcade-executor-error",{error:b,expressionInfo:e})),[v,I]=await Promise.all([_r({graphic:s,view:d,options:c}),g]);if(!I)return null;const C=m==="feature-reduction-popup"?vr({layer:h,aggregatedFeatures:v,interceptor:i}):void 0,_={...m==="feature-reduction-popup"?{$aggregatedFeatures:C}:{$datastore:h?.url,$layer:h!=null&&jn(h)?h:h?.type==="scene"&&h.associatedLayer!=null?h.associatedLayer:void 0,$map:n,$userInput:l,$graph:h?.type==="knowledge-graph-sublayer"?h?.parentCompositeLayer?.knowledgeGraph:void 0},$feature:s},T={abortSignal:c?.signal??void 0,interceptor:i??void 0,rawOutput:!0,spatialReference:o??void 0,timeZone:d?.timeZone};return await I.executeAsync(_,T).catch(b=>Ui().error("arcade-execution-error",{error:b,graphic:s,expressionInfo:e})).finally(()=>C?.destroy())}async function wr({expressionInfos:e,spatialReference:t,graphic:i,interceptor:o,map:n,view:s,location:l,options:d}){if(!e?.length)return{};const c=await zo(),p={};for(const f of e)p[`expression/${f.name}`]=Ho({expressionInfo:f,arcade:c,interceptor:o,spatialReference:t,map:n,graphic:i,location:l,view:s,options:d});const h=await qe(p),m={};for(const f in h)m[f]=mr(h[f].value);return m}const br=1;let se=class extends ge{constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.location=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{const t=this.contentElement?.type;this.contentElementViewModel?.destroy();const i=t==="fields"?new Rt:t==="media"?new Se:t==="text"?new Lt: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=pi(this._compile,br,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:i,interceptor:o,spatialReference:n,map:s,location:l,view:d,_abortController:c}=this;if(!t||!i)return void this._set("contentElement",null);const p=await zo();if(c!==this._abortController)return;const h=await Ho({arcade:p,expressionInfo:t,graphic:i,location:l,interceptor:o,map:s,spatialReference:n,view:d});if(!h||h.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const m=await h.castAsJsonAsync(c?.signal),f=m?.type,g=f==="media"?_n.fromJSON(m):f==="text"?go.fromJSON(m):f==="fields"?vn.fromJSON(m):null;g.type==="media"&&!g.mediaInfos||g.type==="fields"&&!g.fieldInfos||g.type==="text"&&!g.text?this._set("contentElement",null):this._set("contentElement",g)},this.addHandles([y(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),$),y(()=>[this.contentElement],()=>this._createVM(),$)])}initialize(){this.addHandles(this._compileThrottled)}destroy(){this._cancelQuery(),this.contentElementViewModel?.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){return this.view?.spatialReference??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(){return this.view?.map??null}set map(e){this._override("map",e)}};r([a()],se.prototype,"_abortController",void 0),r([a({type:rn})],se.prototype,"expressionInfo",void 0),r([a({type:je})],se.prototype,"graphic",void 0),r([a({readOnly:!0})],se.prototype,"contentElement",void 0),r([a({readOnly:!0})],se.prototype,"contentElementViewModel",void 0),r([a()],se.prototype,"interceptor",void 0),r([a({type:ai})],se.prototype,"location",void 0),r([a()],se.prototype,"spatialReference",null),r([a({readOnly:!0})],se.prototype,"state",null),r([a()],se.prototype,"map",null),r([a()],se.prototype,"view",void 0),se=r([P("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],se);const vi=se,Zi="esri-feature",Gi={base:`${Zi}-expression`,loadingSpinnerContainer:`${Zi}__loading-container`};let At=class extends oe{constructor(e,t){super(e,t),this._contentWidget=null,this.viewModel=new vi}initialize(){this.addHandles(y(()=>this.viewModel?.contentElementViewModel,()=>this._setupExpressionWidget(),$))}loadDependencies(){return Ae({loader:()=>w(()=>import("./calcite-loader-CtpHSU2--B8aaTEnB.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}destroy(){this._destroyContentWidget()}render(){const{state:e}=this.viewModel;return u("div",{class:Gi.base},e==="loading"?this._renderLoading():e==="disabled"?null:this._contentWidget?.render())}_renderLoading(){return u("div",{class:Gi.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,i=t?.type;this._destroyContentWidget();const o=e?i==="fields"?new jo({viewModel:e}):i==="media"?new Wo({viewModel:e}):i==="text"?new bt({viewModel:e}):null:null;this._contentWidget=o,this.scheduleRender()}};r([a({type:vi})],At.prototype,"viewModel",void 0),At=r([P("esri.widgets.Feature.FeatureExpression")],At);const Ir=At;var Qi;(function(e){e.TOO_SHORT="length-validation-error::too-short",e.TOO_LONG="length-validation-error::too-long"})(Qi||(Qi={}));const Ar=e=>{const t=[];if(e.formTemplate){const{description:i,title:o}=e.formTemplate;e.fields?.forEach(n=>{const s=o&&Ei(o,n.name),l=i&&Ei(i,n.name);(s||l)&&t.push(n.name)})}return t},Gt=100;let R=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,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 ke(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await ke(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryDebounced=Ke(this._queryController,Gt),this._queryFeatureCountDebounced=Ke(this._queryFeatureCountController,Gt),this._queryPageDebounced=Ke(this._queryPageController,Gt),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:i}=this;this.featureCount&&(this._destroyRelatedFeatureViewModels(),this.featurePage=1,i.destroyAll(),this.destroyed||i.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t?.signal}))))},this.addHandles([y(()=>[this.displayCount,this.graphic,this.layer,this.layer?.loaded,this.map,this.orderByFields,this.relationshipId,this.featuresPerPage,this.showAllEnabled,this.canQuery,this.featureCount],()=>this._queryDebounced(),$),y(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageDebounced()),y(()=>[this.layer,this.relationshipId,this.objectId,this.canQuery],()=>this._queryFeatureCountDebounced())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.destroyAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:i}=this,o=1,n=Math.ceil(i/t)||1;this._set("featurePage",Math.min(Math.max(e,o),n))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&t?.loaded?e.map(i=>{const o=i.clone();return o.field=ut(i.field,t),o}):e??[]}get supportsCacheHint(){return!!this.layer?.capabilities?.queryRelated?.supportsCacheHint}get canLoad(){return!!this.map&&this.relationshipId!=null&&typeof this.objectId=="number"}get canQuery(){const e=this.layer?.capabilities?.queryRelated;return!!(this.relatedLayer&&this.relationship&&this.relationshipId!=null&&this.objectId!=null&&e?.supportsCount&&e?.supportsPagination)}get itemDescriptionFieldName(){return this.orderByFieldsFixedCasing[0]?.field||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get relatedFeatures(){return this._get("relatedFeatures")||new ce}get relatedLayer(){const{layer:e,map:t,relationship:i}=this;return e?.loaded&&t&&i?Cs(t,e,i)??null:null}get relationship(){const{relationshipId:e,layer:t}=this;return e!=null?t?.relationships?.find(({id:i})=>i===e)??null:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new ce}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o?"ready":"disabled"}getRelatedFeatureByObjectId(e){return this.relatedFeatures.find(t=>t.getObjectId()===e)}refresh(){this._queryFeatureCountDebounced()}_destroyRelatedFeatureViewModels(){this.relatedFeatureViewModels?.destroyAll()}async _queryFeatureCount(){const{layer:e,relatedLayer:t,relationshipId:i,objectId:o,_queryFeatureCountAbortController:n,canQuery:s,supportsCacheHint:l}=this;if(await e?.load(),await t?.load(),!s||!e||!t||o==null)return void this._set("featureCount",0);const d=t.createQuery(),{historicMoment:c,gdbVersion:p}=e,h=new Kt({cacheHint:l,gdbVersion:p,historicMoment:c,relationshipId:i,returnGeometry:!1,objectIds:[o],where:d.where??void 0}),m=await e.queryRelatedFeaturesCount(h,{signal:n?.signal});this._set("featureCount",m[o]||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:o,featureCount:n}=this;!i||t<2||!n||e.addMany(await this._queryRelatedFeatures({signal:o?.signal}))}async _queryRelatedFeatures(e){const{orderByFieldsFixedCasing:t,showAllEnabled:i,featuresPerPage:o,displayCount:n,layer:s,relationshipId:l,featurePage:d,featureCount:c,relatedLayer:p,supportsCacheHint:h}=this,{canQuery:m,objectId:f}=this;if(!m||!s||!p||f==null)return[];const g=i?((d-1)*o+c)%c:0,v=i?o:n,I=p.objectIdField,C=[...t.map(ae=>ae.field),...Ar(p),I].filter(Nt),_=t.map(ae=>`${ae.field} ${ae.order}`),T=p.createQuery(),{historicMoment:b,gdbVersion:G}=s,W=new Kt({orderByFields:_,start:g,num:v,outFields:C,cacheHint:h,historicMoment:b,gdbVersion:G,relationshipId:l,returnGeometry:!1,objectIds:[f],where:T.where??void 0}),q=await s.queryRelatedFeatures(W,{signal:e?.signal}),ue=q[f]?.features||[];return ue.forEach(ae=>{ae.sourceLayer=p,ae.layer=p}),ue}};r([a()],R.prototype,"_loaded",void 0),r([a()],R.prototype,"_queryAbortController",void 0),r([a()],R.prototype,"_queryPageAbortController",void 0),r([a()],R.prototype,"_queryFeatureCountAbortController",void 0),r([a({value:1})],R.prototype,"featurePage",null),r([a()],R.prototype,"featuresPerPage",void 0),r([a({readOnly:!0})],R.prototype,"orderByFieldsFixedCasing",null),r([a({readOnly:!0})],R.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],R.prototype,"canLoad",null),r([a({readOnly:!0})],R.prototype,"canQuery",null),r([a()],R.prototype,"description",void 0),r([a({readOnly:!0})],R.prototype,"itemDescriptionFieldName",null),r([a({value:3})],R.prototype,"displayCount",null),r([a({type:je})],R.prototype,"graphic",void 0),r([a()],R.prototype,"layer",void 0),r([a()],R.prototype,"map",void 0),r([a({readOnly:!0})],R.prototype,"objectId",null),r([a({readOnly:!0})],R.prototype,"objectIdField",null),r([a()],R.prototype,"orderByFields",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatures",null),r([a({readOnly:!0})],R.prototype,"relatedLayer",null),r([a({readOnly:!0})],R.prototype,"relationship",null),r([a()],R.prototype,"featureCount",void 0),r([a({readOnly:!0})],R.prototype,"relatedFeatureViewModels",null),r([a()],R.prototype,"relationshipId",void 0),r([a()],R.prototype,"showAllEnabled",void 0),r([a()],R.prototype,"state",null),r([a()],R.prototype,"title",void 0),R=r([P("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],R);const wi=R;var oi;const Ft="esri-feature",it=`${Ft}-relationship`,Me={base:it,listContainer:`${it}__list`,listItem:`${it}__list-item`,listItemHidden:`${it}__list-item--hidden`,listContainerQuerying:`${it}__list--querying`,featureObserver:`${Ft}__feature-observer`,stickySpinnerContainer:`${Ft}__sticky-loading-container`,loadingSpinnerContainer:`${Ft}__loading-container`},Xi={title:!0,description:!0};let U=oi=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserverNode=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.flowItems=null,this.flowType="feature-relationship",this.headingLevel=2,this.viewModel=new wi,this.messages=null,this.messagesCommon=null,this.visibleElements={...Xi},this._increaseFeaturePage=()=>{const{state:i,showAllEnabled:o,relatedFeatures:n,featuresPerPage:s,featurePage:l}=this.viewModel;i==="ready"&&o&&n.length>=s*l&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$),y(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),dt(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Ae({icon:()=>w(()=>import("./calcite-icon-laqhdRBY-8qK5FfMb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-DCH8F59s.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-C8kSjE5V.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--B8aaTEnB.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-BI9wdRMa.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url)})}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=wo(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:i,state:o}=this.viewModel;return!e&&!!t&&o==="ready"&&(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 pe(e?.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...Xi,...e}}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(Me.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderRelationshipNotFound():this._renderRelatedFeatures())}async _selectRecord(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={relationshipContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:this.flowType,viewModel:e,visibleElements:i}))}_showAllRecords(){const{flowItems:e}=this;if(!e)return;const{viewModel:t,featureVisibleElements:i}=this;t.showAllEnabled=!0;const o=new oi({flowItems:e,featureVisibleElements:i,visibleElements:{title:!1,description:!1},viewModel:t});e.push(o)}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:Me.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:Me.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderShowAllIconNode(){return u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})}_renderChevronIconNode(){const e=be(this.container)?"chevron-left":"chevron-right";return u("calcite-icon",{icon:e,scale:"s",slot:"content-end"})}_renderRelatedFeature(e){const{itemDescriptionFieldName:t}=this.viewModel,i=e.title;e.description=t&&e.formattedAttributes?.global[t];const o=e.state==="loading";return u("calcite-list-item",{class:this.classes(Me.listItem,{[Me.listItemHidden]:o}),description:e.description??"",key:e.uid,label:i,onCalciteListItemSelect:()=>this._selectRecord(e)},this._renderChevronIconNode())}_renderShowAllListItem(){return this.displayShowAllButton?u("calcite-list-item",{description:this.featureCountDescription,key:"show-all-item",label:this.messages?.showAll,onCalciteListItemSelect:()=>this._showAllRecords()},this._renderShowAllIconNode()):null}_renderNoRelatedFeaturesMessage(){return u("calcite-notice",{icon:"information",key:"no-related-features-message",kind:"brand",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noRelatedFeatures))}_renderFeatureObserver(){return u("div",{afterCreate:this._relatedFeatureIntersectionObserverCreated,bind:this,class:Me.featureObserver,key:"feature-observer"})}_renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return u("calcite-list",null,e.toArray().map(t=>this._renderRelatedFeature(t)),this._renderShowAllListItem())}_renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return u("div",{class:this.classes(Me.listContainer,{[Me.listContainerQuerying]:t==="querying"}),key:"list-container"},e?this._renderList():t==="ready"?this._renderNoRelatedFeaturesMessage():null,this._renderStickyLoading(),this._renderFeatureObserver())}_renderRelationshipNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"relationship-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.relationshipNotFound))}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e?.forEach(i=>{this.addHandles(y(()=>[i.title,i.state],()=>this.scheduleRender(),$),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};r([a()],U.prototype,"_relatedFeatureIntersectionObserverNode",void 0),r([a({readOnly:!0})],U.prototype,"displayShowAllButton",null),r([a({readOnly:!0})],U.prototype,"displayListItems",null),r([a()],U.prototype,"description",null),r([a({readOnly:!0})],U.prototype,"featureCountDescription",null),r([a()],U.prototype,"featureVisibleElements",void 0),r([a()],U.prototype,"flowItems",void 0),r([a()],U.prototype,"flowType",void 0),r([a()],U.prototype,"headingLevel",void 0),r([a()],U.prototype,"title",null),r([a({type:wi})],U.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],U.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],U.prototype,"messagesCommon",void 0),r([a()],U.prototype,"visibleElements",void 0),r([et("visibleElements")],U.prototype,"castVisibleElements",null),U=oi=r([P("esri.widgets.Feature.FeatureRelationship")],U);const Fr=U;var Ji;(function(e){e[e.RTJunctionJunctionConnectivity=1]="RTJunctionJunctionConnectivity",e[e.RTAttachment=2]="RTAttachment",e[e.RTContainment=3]="RTContainment",e[e.RTJunctionEdgeConnectivity=4]="RTJunctionEdgeConnectivity",e[e.RTEdgeJunctionEdgeConnectivity=5]="RTEdgeJunctionEdgeConnectivity"})(Ji||(Ji={})),new di({connected:"connected",upstream:"upstream",downstream:"downstream",shortestPath:"shortest-path",subnetwork:"subnetwork",subnetworkController:"subnetwork-controller",loops:"loops",isolation:"isolation"});const vt=new di({junctionJunctionConnectivity:"junction-junction-connectivity",connectivity:"connectivity",attachment:"attachment",containment:"containment",junctionEdgeFromConnectivity:"junction-edge-from-connectivity",junctionMidspanConnectivity:"junction-midspan-connectivity",junctionEdgeToConnectivity:"junction-edge-to-connectivity"}),Mr=Array.from({length:33},(e,t)=>2*t),Cr=new Map([[1,"connectivity"],[2,"containment"],[3,"attachment"],[4,"junction-edge-from-connectivity"],[5,"junction-midspan-connectivity"],[6,"junction-edge-to-connectivity"]]);new di({normal:"normal",rebuild:"rebuild",forceRebuild:"force-rebuild"});let me=class extends bo{constructor(e){super(e),this.assetGroupCode=null,this.assetTypeCode=null,this.globalId=null,this.networkSourceId=null,this.objectId=null,this.positionFrom=null,this.positionTo=null,this.terminalId=null}};r([a({type:Number,json:{write:!0}})],me.prototype,"assetGroupCode",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"assetTypeCode",void 0),r([a({type:String,json:{write:!0}})],me.prototype,"globalId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"networkSourceId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"objectId",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionFrom",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"positionTo",void 0),r([a({type:Number,json:{write:!0}})],me.prototype,"terminalId",void 0),me=r([P("esri.rest.networks.support.NetworkElement")],me);const Ye=me;let J=class extends bo{constructor(e){super(e),this.globalId=null,this.associationType=null,this.fromNetworkElement=null,this.toNetworkElement=null,this.geometry=null,this.errorMessage=null,this.percentAlong=null,this.errorCode=null,this.isContentVisible=null,this.status=null}readFromNetworkElement(e,t){return new Ye({globalId:t.fromGlobalId,networkSourceId:t.fromNetworkSourceId,terminalId:t.fromTerminalId})}writeFromNetworkElement(e,t){e&&(t.fromGlobalId=e.globalId,t.fromNetworkSourceId=e.networkSourceId,t.fromTerminalId=e.terminalId)}readToNetworkElement(e,t){return new Ye({globalId:t.toGlobalId,networkSourceId:t.toNetworkSourceId,terminalId:t.toTerminalId})}writeToNetworkElement(e,t){e&&(t.toGlobalId=e.globalId,t.toNetworkSourceId=e.networkSourceId,t.toTerminalId=e.terminalId)}};r([a({type:String,json:{write:!0}})],J.prototype,"globalId",void 0),r([a({type:vt.apiValues,json:{type:vt.jsonValues,read:vt.read,write:vt.write}})],J.prototype,"associationType",void 0),r([a({type:Ye,json:{write:{target:{fromGlobalId:{type:String},fromNetworkSourceId:{type:Number},fromTerminalId:{type:Number}}},read:{source:["fromGlobalId","fromNetworkSourceId","fromTerminalId"]}}})],J.prototype,"fromNetworkElement",void 0),r([Fi("fromNetworkElement")],J.prototype,"readFromNetworkElement",null),r([Mi("fromNetworkElement")],J.prototype,"writeFromNetworkElement",null),r([a({type:Ye,json:{write:{target:{toGlobalId:{type:String},toNetworkSourceId:{type:Number},toTerminalId:{type:Number}}},read:{source:["toGlobalId","toNetworkSourceId","toTerminalId"]}}})],J.prototype,"toNetworkElement",void 0),r([Fi("toNetworkElement")],J.prototype,"readToNetworkElement",null),r([Mi("toNetworkElement")],J.prototype,"writeToNetworkElement",null),r([a({type:an,json:{write:!0}})],J.prototype,"geometry",void 0),r([a({type:String,json:{write:!0}})],J.prototype,"errorMessage",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"percentAlong",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"errorCode",void 0),r([a({type:Boolean,json:{write:!0}})],J.prototype,"isContentVisible",void 0),r([a({type:Number,json:{write:!0}})],J.prototype,"status",void 0),J=r([P("esri.rest.networks.support.Association")],J);const Er=J,V={fromGlobalId:"fromglobalid",fromNetworkSourceId:"fromnetworksourceid",fromTerminalId:"fromterminalid",toGlobalId:"toglobalid",toNetworkSourceId:"tonetworksourceid",toTerminalId:"toterminalid",associationType:"associationtype",globalId:"globalid",status:"status",isContentVisible:"iscontentvisible",percentAlong:"percentalong",assetGroup:"assetgroup",assetType:"assettype"},Ki=100;let E=class extends mo(li(ge)){constructor(e){super(e),this._loaded=!1,this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.networkSourceIdsInUse=new Set,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.featureCount=0,this.associationTypes=null,this.showAllEnabled=!1,this.title=null,this.attachmentsFeatureCount=0,this.structureFeatureCount=0,this.contentFeatureCount=0,this.containerFeatureCount=0,this.connectivityFeatureCount=0,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._queryController=async t=>{this._cancelQuery();const i=new AbortController;this._queryAbortController=i,await ke(this._query(t)),this._queryAbortController===i&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._loaded=!1,this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await ke(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null),this._loaded=!0},this._queryDebounced=Ke(this._queryController,Ki),this._queryFeatureCountDebounced=Ke(this._queryFeatureCountController,Ki)}initialize(){this.associationTypes?.forEach(e=>{e.open=!1}),this.addHandles([...this.associationTypes?.map(e=>y(()=>e.open,()=>{e.open&&this._queryDebounced(e)}))??[],y(()=>[this.graphic,this.layer,this.map,this.associationTypes,this.objectId,this.globalId,this.canQuery],()=>this._queryFeatureCountDebounced(),$)])}destroy(){this._cancelQuery(),this._cancelQueryFeatureCount(),this._destroyAssociatedFeatureViewModels()}get supportsCacheHint(){return!!this.layer?.capabilities?.query?.supportsCacheHint}get canLoad(){return!!this.map&&!!this.associationTypes&&typeof this.globalId=="string"}get canQuery(){const e=this.layer?.capabilities?.query;return!!this.associationTypes&&typeof this.globalId=="string"&&!!e?.supportsPagination}get objectId(){return(this.objectIdField&&this.graphic?.attributes?.[this.objectIdField])??null}get objectIdField(){return this.layer?.objectIdField||null}get globalId(){return(this.globalIdField&&this.graphic?.attributes?.[this.globalIdField])??null}get globalIdField(){const{layer:e}=this;return e?.type==="subtype-sublayer"&&e?.parent?e.parent.globalIdField??null:e?.globalIdField??null}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,canQuery:o,_loaded:n,canLoad:s}=this;return t||s&&!n?"loading":e||i?"querying":o&&this.featureCount!==0?"ready":"disabled"}get utilityNetwork(){const{layer:e,map:t}=this;return e?.loaded&&t?e?.type==="subtype-sublayer"&&e?.parent?Si(t,e.parent)??null:Si(t,e)??null:null}get associationsLayer(){const{utilityNetwork:e}=this;return e?.loaded?new Mo({url:e.networkSystemLayers.associationsTableUrl,gdbVersion:e.gdbVersion}):null}get attachmentsAssociations(){return this._get("attachmentsAssociations")||new ce}get structureAssociations(){return this._get("structureAssociations")||new ce}get contentAssociations(){return this._get("contentAssociations")||new ce}get containerAssociations(){return this._get("containerAssociations")||new ce}get connectivityAssociations(){return this._get("connectivityAssociations")||new ce}get associationFeatures(){return this._get("associationFeatures")||new Co}get associationViewModels(){return this._get("associationViewModels")||new Map}refresh(){this._queryFeatureCountDebounced()}_destroyAssociatedFeatureViewModels(){this.associationViewModels.forEach(e=>e.destroyAll())}_generateGlobalIdWhereClause(e,t){const{globalId:i,networkSourceIdsInUse:o}=this,{associatedNetworkSourceId:n}=e,s=t.fieldsIndex.get(V.fromGlobalId),l=t.fieldsIndex.get(V.toGlobalId),d=t.fieldsIndex.get(V.fromNetworkSourceId),c=t.fieldsIndex.get(V.toNetworkSourceId),p=n!=null,h=`(${Array.from(o.values())})`,m=p?` AND ${c.name} = ${n} AND ${c.name} IN ${h}`:"",f=p?` AND ${d.name} = ${n} AND ${d.name} IN ${h}`:"";switch(e.type){case"connectivity":return`((${s.name} = '${i}'${m}) OR (${l.name} = '${i}'${f}))`;case"attachment":case"content":return`${s.name} = '${i}'${m}`;case"container":case"structure":return`${l.name} = '${i}'${f}`;default:return""}}_generateNetworkSourceIdWhereClause(e){const{networkSourceIdsInUse:t}=this,i=`(${Array.from(t.values())})`,o=e.fieldsIndex.get(V.fromNetworkSourceId),n=e.fieldsIndex.get(V.toNetworkSourceId);return`(${o.name} IN ${i} AND ${n.name} IN ${i})`}_generateAssociationTypeWhereClause(e,t){const i=t.fieldsIndex.get(V.associationType);switch(e.type){case"attachment":case"structure":return`${i.name} = 3`;case"connectivity":return`${i.name} IN (1, 4, 5, 6)`;case"container":case"content":return`${i.name} = 2`;default:return""}}_generateWhereClause(e,t){const i=t.fieldsIndex.get(V.status),o=`(${Mr.join(",")})`,n=`${i.name} IN ${o}`;return`(${this._generateGlobalIdWhereClause(e,t)} AND ${n} AND ${this._generateAssociationTypeWhereClause(e,t)})`}async _loadUtiltyNetworks(){const e=this.map;if(!e)return;await Promise.allSettled(e.utilityNetworks?.map(async o=>{await o.load()})??[]);const t=o=>{if("layerId"in o&&i.isUtilityLayer(o)){const n=i.getSourceIdByLayerId(o.layerId);n!==null&&this.networkSourceIdsInUse.add(n)}},i=this.utilityNetwork;this._set("networkSourceIdsInUse",new Set),e.allLayers.forEach(t),e.allTables.forEach(t)}async _findLayersBySourceId(e){const{utilityNetwork:t,map:i}=this,o=c=>{const p=c;return c.url&&p.layerId===n?c.url.replace(/\/\d+$/,"")===t?.featureServiceUrl:!1};await t?.load();const n=t.getLayerIdBySourceId(e),s=i.allLayers.filter(o),l=i.allTables.filter(o),d=s.concat(l).toArray();return await Promise.allSettled(d.map(c=>c.load())),d}_clearAssociations(){this.attachmentsAssociations.removeAll(),this.structureAssociations.removeAll(),this.contentAssociations.removeAll(),this.containerAssociations.removeAll(),this.connectivityAssociations.removeAll()}_clearFeatures(){this.associationFeatures.forEach(e=>e.removeAll()),this.associationFeatures.clear()}_getAssociationsByType(e){switch(e){case"attachment":return this.attachmentsAssociations;case"structure":return this.structureAssociations;case"connectivity":return this.connectivityAssociations;case"container":return this.containerAssociations;case"content":return this.contentAssociations}}_createAssociationFromFeature(e,t){if(!e)return null;const i=Cr.get(t.attributes[e.fieldsIndex.get(V.associationType).name]);return new Er({globalId:t.attributes[e.fieldsIndex.get(V.globalId).name],fromNetworkElement:new Ye({globalId:t.attributes[e.fieldsIndex.get(V.fromGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.fromNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.fromTerminalId).name]}),toNetworkElement:new Ye({globalId:t.attributes[e.fieldsIndex.get(V.toGlobalId).name],networkSourceId:t.attributes[e.fieldsIndex.get(V.toNetworkSourceId).name],terminalId:t.attributes[e.fieldsIndex.get(V.toTerminalId).name]}),associationType:i,status:t.attributes[e.fieldsIndex.get(V.status).name],isContentVisible:t.attributes[e.fieldsIndex.get(V.isContentVisible).name],percentAlong:t.attributes[e.fieldsIndex.get(V.percentAlong).name]})}async _queryLayer(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=i!=null,c=o!=null,p="("+t.map(v=>`'${v}'`).join(", ")+")",h=d?` AND ${s?.name} = ${i}`:"",m=d&&c?` AND ${l?.name} = ${o}`:"",f=`${e.globalIdField} IN ${p}`+h+m,g=new lt({outFields:["*"],cacheHint:this.supportsCacheHint,where:f});return await this._queryAll(g,e,{signal:n?.signal})}async _createAssociationFeatureObjects(e,t,i,o,n,s){if(e.length===0)return[];const l=new Map;for(const[c,p]of t){const h=await this._findLayersBySourceId(c);for(const m of h)(await this._queryLayer(m,p,o,n,s)).forEach(f=>{if(f.getEffectivePopupTemplate()&&f.layer){const g=l.get(f.attributes[m.globalIdField])??[];g.push(f),l.set(f.attributes[m.globalIdField],g)}})}const d=[];return e.toArray().forEach(c=>{const p=c.fromNetworkElement.globalId===i?c.toNetworkElement:c.fromNetworkElement;(l.get(p.globalId)??[]).forEach(h=>{const m=this.utilityNetwork?.getTerminalById(p?.terminalId)?.name;d.push({association:c,feature:h,terminalName:m})})}),d}_parseFeatureObjects(e,t){e.forEach(i=>{const o=i?.feature,n=o.layer,s=t.get(n)??new ce;s.add(i),t.set(n,s)})}async _queryAll(e,t,i){const o=[];let n=0,s=!1;e.num=t.sourceJSON?.maxRecordCount??2e3;do{e.start=n;const l=await t.queryFeatures(e,i);o.push(...l.features),s=l.exceededTransferLimit,s&&(n+=l.features.length)}while(s);return o}async _queryAssociatedFeatureCount(e){const{layer:t,globalId:i,supportsCacheHint:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d}=this;if(await Promise.allSettled([t?.load(),l?.load(),s?.load()]),this._clearAssociations(),!(d&&t&&n&&s))return;const c=s.fieldsIndex.get(V.toGlobalId).name,p=s.fieldsIndex.get(V.fromGlobalId).name,h=n.map(_=>this._generateWhereClause(_,s)),m=this._generateNetworkSourceIdWhereClause(s),f=h.join(" OR "),g=new lt({outFields:["*"],cacheHint:o,returnGeometry:!1,where:`(${f}) AND (${m})`}),v=await this._queryAll(g,s,{signal:e?.signal}),I=new Map;n.forEach(_=>{I.set(_.type,[])}),v.forEach(_=>{const T=s.fieldsIndex.get(V.associationType);switch(_.attributes[T.name]){case 1:case 4:case 5:case 6:_.attributes[p]===i?I.get("connectivity").push(_.attributes[c]):I.get("connectivity").push(_.attributes[p]),this.connectivityAssociations.add(this._createAssociationFromFeature(s,_));break;case 2:_.attributes[p]===i?(I.get("content").push(_.attributes[c]),this.contentAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("container").push(_.attributes[p]),this.containerAssociations.add(this._createAssociationFromFeature(s,_)));break;case 3:_.attributes[p]===i?(I.get("attachment").push(_.attributes[c]),this.attachmentsAssociations.add(this._createAssociationFromFeature(s,_))):(I.get("structure").push(_.attributes[p]),this.structureAssociations.add(this._createAssociationFromFeature(s,_)))}});const C=n.map(async _=>{const{associatedNetworkSourceId:T,associatedAssetGroup:b,associatedAssetType:G}=_,W=I.get(_.type),q=b!=null?await this._countAssociatedFeatures(T,W,b,G,e):W.length;switch(_.type){case"attachment":this._set("attachmentsFeatureCount",q);break;case"structure":this._set("structureFeatureCount",q);break;case"content":this._set("contentFeatureCount",q);break;case"container":this._set("containerFeatureCount",q);break;case"connectivity":this._set("connectivityFeatureCount",q)}});await Promise.allSettled(C)}async _countAssociatedFeatureCount(e,t,i,o,n){const s=e.fieldsIndex.get(V.assetGroup),l=e.fieldsIndex.get(V.assetType),d=o!=null,c="("+t.map(f=>`'${f}'`).join(", ")+")",p=` AND ${s?.name} = ${i}`,h=d?` AND ${l?.name} = ${o}`:"",m=`${e.globalIdField} IN ${c}`+p+h;return e.queryFeatureCount({where:m,outFields:["*"],returnGeometry:!1},{signal:n?.signal})}async _countAssociatedFeatures(e,t,i,o,n){if(t.length===0)return 0;const s=(await this._findLayersBySourceId(e)).map(async l=>this._countAssociatedFeatureCount(l,t,i,o,n));return(await Promise.all(s)).reduce((l,d)=>l+d,0)}async _queryAssociatedFeatures(e,t){const{layer:i,globalId:o,associationTypes:n,associationsLayer:s,utilityNetwork:l,canQuery:d,associationFeatures:c}=this;if(await Promise.allSettled([i?.load(),l?.load(),s?.load()]),!(d&&i&&n&&s))return;const p=this._getAssociationsByType(e.type),{associatedAssetGroup:h,associatedAssetType:m}=e,f=new Map;p.forEach(v=>{const{networkSourceId:I,elementGlobalId:C}=v.fromNetworkElement.globalId===o?{networkSourceId:v.toNetworkElement.networkSourceId,elementGlobalId:v.toNetworkElement.globalId}:{networkSourceId:v.fromNetworkElement.networkSourceId,elementGlobalId:v.fromNetworkElement.globalId},_=f.get(I)||[];_.push(C),f.set(I,_)});const g=await this._createAssociationFeatureObjects(p,f,o,h,m,t);this._parseFeatureObjects(g,c)}async _queryFeatureCount(){await this._loadUtiltyNetworks();const{_queryFeatureCountAbortController:e,canQuery:t}=this;t?(await this._queryAssociatedFeatureCount(e),this._set("featureCount",this.attachmentsFeatureCount+this.structureFeatureCount+this.contentFeatureCount+this.containerFeatureCount+this.connectivityFeatureCount)):this._set("featureCount",0)}async _query(e){await this._loadUtiltyNetworks();const{_queryAbortController:t}=this;this.featureCount&&(this._destroyAssociatedFeatureViewModels(),this._clearFeatures(),this.destroyed||await this._queryAssociatedFeatures(e,{signal:t?.signal}))}};r([a()],E.prototype,"_loaded",void 0),r([a()],E.prototype,"_queryAbortController",void 0),r([a()],E.prototype,"_queryPageAbortController",void 0),r([a()],E.prototype,"_queryFeatureCountAbortController",void 0),r([a({readOnly:!0})],E.prototype,"supportsCacheHint",null),r([a({readOnly:!0})],E.prototype,"canLoad",null),r([a({readOnly:!0})],E.prototype,"canQuery",null),r([a()],E.prototype,"networkSourceIdsInUse",void 0),r([a()],E.prototype,"description",void 0),r([a({type:je})],E.prototype,"graphic",void 0),r([a()],E.prototype,"layer",void 0),r([a()],E.prototype,"map",void 0),r([a({readOnly:!0})],E.prototype,"objectId",null),r([a({readOnly:!0})],E.prototype,"objectIdField",null),r([a({readOnly:!0})],E.prototype,"globalId",null),r([a({readOnly:!0})],E.prototype,"globalIdField",null),r([a()],E.prototype,"featureCount",void 0),r([a()],E.prototype,"associationTypes",void 0),r([a()],E.prototype,"showAllEnabled",void 0),r([a()],E.prototype,"state",null),r([a()],E.prototype,"title",void 0),r([a({readOnly:!0})],E.prototype,"utilityNetwork",null),r([a({readOnly:!0})],E.prototype,"associationsLayer",null),r([a({readOnly:!0})],E.prototype,"attachmentsFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"structureFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"attachmentsAssociations",null),r([a({readOnly:!0})],E.prototype,"structureAssociations",null),r([a({readOnly:!0})],E.prototype,"contentFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"containerFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"contentAssociations",null),r([a({readOnly:!0})],E.prototype,"containerAssociations",null),r([a({readOnly:!0})],E.prototype,"connectivityFeatureCount",void 0),r([a({readOnly:!0})],E.prototype,"connectivityAssociations",null),r([a({readOnly:!0})],E.prototype,"associationFeatures",null),r([a({readOnly:!0})],E.prototype,"associationViewModels",null),E=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.FeatureUtilityNetworkAssociationsViewModel")],E);const ft=E;let st=class extends ge{constructor(e){super(e),this.title=!0,this.description=!0}};r([a({type:Boolean,nonNullable:!0})],st.prototype,"title",void 0),r([a({type:Boolean,nonNullable:!0})],st.prototype,"description",void 0),st=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations.VisibleElements")],st);const Ot=st;var ni;const rt="esri-feature",ze=`${rt}-relationship`,He={base:ze,listContainer:`${ze}__list`,listItem:`${ze}__list-item`,listItemHidden:`${ze}__list-item--hidden`,listContainerQuerying:`${ze}__list--querying`,featureObserver:`${rt}__feature-observer`,stickySpinnerContainer:`${rt}__sticky-loading-container`,loadingSpinnerContainer:`${rt}__loading-container`,expander:`${ze}__expander`,filterContainer:`${rt}__filter-container`};let S=ni=class extends oe{constructor(e,t){super(e,t),this.flowType="feature-utility-network-association-type",this.description=null,this.headingLevel=2,this.title=null,this.viewModel=new ft,this.parentFeatureViewModel=null,this.listType=null,this.selectedLayer=null,this.flowItems=null,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot,this._featuresPerPage=50,this._maxNumFeatures=1e3,this._currentFeaturePage=1,this._previewDisplayCount=3,this._associatedFeatureIntersectionObserverNode=null,this._associatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i?.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this._tooltipReferenceMap=new Co,this._filterText=""}initialize(){this.addHandles([y(()=>[this._associatedFeatureIntersectionObserverNode],()=>this._handleAssociatedFeatureObserverChange())])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-DI1-84AU.js"),__vite__mapDeps([126,2,3,4,5,6,7,8,113,114,107,108,9,110,119,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-8qK5FfMb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),input:()=>w(()=>import("./calcite-input-BKRd7MCS-BhvpT25V.js"),__vite__mapDeps([127,116,2,3,4,5,6,7,8,117,110,108,118,119,113,107,9,114,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--B8aaTEnB.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-DCH8F59s.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-C8kSjE5V.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),tooltip:()=>w(()=>import("./calcite-tooltip-63c9fmIw-BI9m24xG.js"),__vite__mapDeps([128,2,3,4,5,6,7,8,129,115,106,125,130]),import.meta.url)})}destroy(){this._tooltipReferenceMap.clear()}get _numAssociatedFeatures(){const e=this.viewModel.associationViewModels;return this.selectedLayer?e.get(this.selectedLayer).length:0}set currentFeaturePage(e){const{_featuresPerPage:t,_numAssociatedFeatures:i}=this,o=1,n=Math.ceil(i/t)||1;this._currentFeaturePage=Math.max(Math.min(e,n),o)}get currentFeaturePage(){return this._currentFeaturePage}render(){const e=this.viewModel.associationViewModels,{state:t,showAllEnabled:i}=this.viewModel,{state:o}=this.parentFeatureViewModel??{};return u("div",{class:this.classes(He.base,M.widget)},t==="loading"||t==="querying"||o==="loading"?this._renderLoading():u("calcite-list",null,i&&this.selectedLayer?u(Ao,null,this._renderFilter(),this._renderAssociatedFeatureListPage(),this._renderFeatureObserver()):Array.from(e.keys(),n=>this._renderTypeList(n,e.get(n)))))}_renderFilter(){return u("div",{class:He.filterContainer,key:"filter"},u("calcite-input",{icon:"search",placeholder:this.messages.associationFilterPlaceholder,type:"search",onCalciteInputInput:e=>{this._filterText=e.target.value.trim().toLowerCase(),this._currentFeaturePage=1}}))}_showAllAssociations(e){const{flowItems:t,viewModel:i,description:o}=this;if(!t||!e)return;i.showAllEnabled=!0;const n=new ni({selectedLayer:e,title:e?.title,flowItems:t,parentFeatureViewModel:this.parentFeatureViewModel,featureVisibleElements:this.featureVisibleElements,description:o,visibleElements:{title:!1,description:!1},viewModel:i});t.push(n)}_renderAssociatedFeatureListPage(){const{currentFeaturePage:e,_featuresPerPage:t,_maxNumFeatures:i,_filterText:o}=this,n=Math.min(e*t,i),s=this.viewModel.associationViewModels.get(this.selectedLayer).filter(l=>xt(l.featureViewModel).toLowerCase().includes(o)).slice(0,n);return[...this._renderTooltips(s),...this._renderAssociatedFeatureList(s)]}async _handleAssociatedFeatureObserverChange(){this._associatedFeatureIntersectionObserverNode&&this._associatedFeatureIntersectionObserver.unobserve(this._associatedFeatureIntersectionObserverNode);const{state:e,showAllEnabled:t}=this.viewModel;await $t(0),this._associatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._associatedFeatureIntersectionObserver.observe(this._associatedFeatureIntersectionObserverNode)}_associatedFeatureIntersectionObserverCreated(e){this._associatedFeatureIntersectionObserverNode=e}_renderFeatureObserver(){return u("div",{afterCreate:this._associatedFeatureIntersectionObserverCreated,bind:this,class:He.featureObserver,key:"feature-observer"})}_increaseFeaturePage(){this.currentFeaturePage++}_renderLoading(){return u("div",{class:He.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}isConnectivity(e){return["connectivity","junction-junction-connectivity","junction-edge-from-connectivity","junction-midspan-connectivity","junction-edge-to-connectivity"].includes(e.association.associationType)}_getConnectivityTooltip(e){switch(e){case"connectivity":case"junction-junction-connectivity":return this.messages.associationsJunctionJunction;case"junction-edge-from-connectivity":return this.messages.associationsJunctionEdgeFrom;case"junction-midspan-connectivity":return this.messages.associationsJunctionEdgeMidspan;case"junction-edge-to-connectivity":return this.messages.associationsJunctionEdgeTo;default:return""}}_renderItemTooltip(e){const{_tooltipReferenceMap:t}=this;return this.isConnectivity(e)?u("calcite-tooltip",{key:`tooltip-${e.featureViewModel.uid}`,referenceElement:t.get(e.featureViewModel.uid)},this._getConnectivityTooltip(e.association.associationType)):null}_renderConnectivityIcon(e,t){let i;switch(e){case"junction-edge-from-connectivity":i="connection-end-left";break;case"junction-edge-to-connectivity":i="connection-end-right";break;case"junction-midspan-connectivity":i="connection-middle";break;default:i="connection-to-connection"}return u("calcite-icon",{afterCreate:o=>this._tooltipReferenceMap.set(t,o),afterRemoved:()=>this._tooltipReferenceMap.delete(t),icon:i,scale:"s",slot:"content-start"})}_formatPercentAlong(e){return`${Be(e.association.percentAlong,{style:"percent",maximumFractionDigits:2})}`}_renderAssociatedFeature(e){const{featureViewModel:t}=e,i=xt(t),o=t.state==="loading",n=this._findFlowItem(t),s=n<0&&this._isParentFeature(t),l=s||n>=0,d=this.isConnectivity(e),c=d&&e.association.associationType==="junction-midspan-connectivity";return u("calcite-list-item",{class:this.classes(He.listItem,{[He.listItemHidden]:o}),description:e.terminalName??"",key:`associated-feature-type-${t.uid}`,label:i,onCalciteListItemSelect:()=>this._handleFeatureClick(s,n,t)},d?this._renderConnectivityIcon(e.association.associationType,e.featureViewModel.uid):null,c?u("calcite-chip",{scale:"s",slot:"content-end",value:e.association.percentAlong},this._formatPercentAlong(e)):null,this._renderChevronIconNode(l))}async _selectAssociation(e){const{flowItems:t,featureVisibleElements:i}=this;if(!t)return;e.abilities={utilityNetworkAssociationsContent:!0};const{default:o}=await Promise.resolve().then(()=>Go);t.push(new o({flowItems:t,flowType:"feature-association",viewModel:e,visibleElements:i}))}_handleFeatureClick(e,t,i){if(e)this.flowItems.drain(o=>{"showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy()});else if(t<0||!this.flowItems)this._selectAssociation(i);else for(;this.flowItems.length>t+1;){const o=this.flowItems.pop();o&&("showAllEnabled"in o.viewModel&&(o.viewModel.showAllEnabled=!1),o.viewModel=null,o.destroy())}}_featureViewModelMatch(e,t){const i=e.graphic,o=i?.layer;let n=null;o?.type==="subtype-sublayer"&&o.parent?n=o.parent.globalIdField??null:o&&"globalIdField"in o&&(n=o.globalIdField);const s=n?i?.attributes[n]:null,l=t.graphic,d=l?.layer;let c=null;d?.type==="subtype-sublayer"&&d.parent?c=d.parent.globalIdField??null:d&&"globalIdField"in d&&(c=d.globalIdField);const p=c?l?.attributes[c]:null;return s&&p&&s===p}_isParentFeature(e){const t=this.flowItems?.getItemAt(0);if(!t)return!1;const i=t.parentFeatureViewModel;return this._featureViewModelMatch(i,e)}_findFlowItem(e){return this.flowItems?.findIndex(t=>{if(t.flowType!=="feature")return!1;const i=t.viewModel;return this._featureViewModelMatch(i,e)})??-1}_renderTooltips(e){return e.toArray().map(t=>this._renderItemTooltip(t))}_renderAssociatedFeatureList(e){return e.toArray().map(t=>this._renderAssociatedFeature(t))}_renderChevronIconNode(e){return u("calcite-icon",{flipRtl:!0,icon:e?"move-up":"chevron-right",scale:"s",slot:"content-end"})}_renderTypeList(e,t){const{messages:i}=this,o=t.slice(0,this._previewDisplayCount),n=o.lengththis._showAllAssociations(e)},u("calcite-icon",{icon:"list",scale:"s",slot:"content-end"})):null))}};r([a()],S.prototype,"flowType",void 0),r([a()],S.prototype,"description",void 0),r([a()],S.prototype,"headingLevel",void 0),r([a()],S.prototype,"title",void 0),r([a({type:ft})],S.prototype,"viewModel",void 0),r([a()],S.prototype,"parentFeatureViewModel",void 0),r([a()],S.prototype,"listType",void 0),r([a()],S.prototype,"selectedLayer",void 0),r([a()],S.prototype,"featureVisibleElements",void 0),r([a()],S.prototype,"flowItems",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],S.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],S.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],S.prototype,"visibleElements",void 0),r([a()],S.prototype,"_featuresPerPage",void 0),r([a()],S.prototype,"_maxNumFeatures",void 0),r([a()],S.prototype,"_numAssociatedFeatures",null),r([a()],S.prototype,"_currentFeaturePage",void 0),r([a()],S.prototype,"currentFeaturePage",null),r([a()],S.prototype,"_previewDisplayCount",void 0),r([a()],S.prototype,"_associatedFeatureIntersectionObserverNode",void 0),r([a()],S.prototype,"_tooltipReferenceMap",void 0),r([a()],S.prototype,"_filterText",void 0),S=ni=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociationType")],S);const Tr=S,Mt="esri-feature",Ue=`${Mt}-relationship`,ot={base:Ue,listContainer:`${Ue}__list`,listItem:`${Ue}__list-item`,listItemHidden:`${Ue}__list-item--hidden`,listContainerQuerying:`${Ue}__list--querying`,featureObserver:`${Mt}__feature-observer`,stickySpinnerContainer:`${Mt}__sticky-loading-container`,loadingSpinnerContainer:`${Mt}__loading-container`,expander:`${Ue}__expander`};let re=class extends oe{constructor(e,t){super(e,t),this._featureElementInfo=null,this.flowType="feature-utility-network-associations",this.flowItems=null,this.parentFeatureViewModel=null,this.headingLevel=2,this.viewModel=new ft,this.messages=null,this.messagesCommon=null,this.visibleElements=new Ot}initialize(){this._featureElementInfo=new mt,this.addHandles([y(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),$)])}loadDependencies(){return Ae({chip:()=>w(()=>import("./calcite-chip-DE_c-1hr-DI1-84AU.js"),__vite__mapDeps([126,2,3,4,5,6,7,8,113,114,107,108,9,110,119,1]),import.meta.url),icon:()=>w(()=>import("./calcite-icon-laqhdRBY-8qK5FfMb.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--B8aaTEnB.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url),notice:()=>w(()=>import("./calcite-notice-DeAGopAs-BI9wdRMa.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-DCH8F59s.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-C8kSjE5V.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url)})}destroy(){this._featureElementInfo=wo(this._featureElementInfo)}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){const{state:e}=this.viewModel;return u("div",{class:this.classes(ot.base,M.widget)},this._featureElementInfo?.render(),e==="loading"?this._renderLoading():e==="disabled"?this._renderAssociationNotFound():this._renderContent())}_renderStickyLoading(){return this.viewModel.state==="querying"?u("div",{class:ot.stickySpinnerContainer,key:"sticky-loader"},this._renderLoadingIcon()):null}_renderLoadingIcon(){return u("calcite-loader",{inline:!0,label:""})}_renderLoading(){return u("div",{class:ot.loadingSpinnerContainer,key:"loading-container"},this._renderLoadingIcon())}_renderAssociationNotFound(){return u("calcite-notice",{icon:"exclamation-mark-triangle",key:"association-not-found",kind:"danger",open:!0,scale:"s",width:"full"},u("div",{slot:"message"},this.messages?.noAssociations))}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,o=t.title&&this.title;this._featureElementInfo?.set({description:i,title:o,headingLevel:e})}_getAssociationTypeTitle(e){const{messages:t}=this;if(e.title)return e.title;switch(e.type){case"attachment":return t.associationsAttachments;case"connectivity":return t.associationsConnectivity;case"structure":return t.associationsStructure;case"content":return t.associationsContents;case"container":return t.associationsContainer}}_selectAssociationType(e){const{viewModel:t,flowItems:i,parentFeatureViewModel:o}=this;if(!i)return;const{associationTypes:n}=t;n.forEach(l=>{l.type===e.type?l.open=!0:l.open=!1});const s=new Tr({viewModel:t,parentFeatureViewModel:o,listType:e,title:this._getAssociationTypeTitle(e),featureVisibleElements:this.featureVisibleElements,description:this.parentFeatureViewModel?.title,flowItems:i});i.push(s)}_renderAssociationType(e){const t=this._getAssociationTypeTitle(e);return u("calcite-list-item",{description:e.description,key:`association-type-${e.type}`,label:t,value:e.type,onCalciteListItemSelect:()=>this._selectAssociationType(e)},u("calcite-chip",{scale:"s",slot:"content-end",value:e.type},this._getFeatureCount(e.type)),u("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}_getFeatureCount(e){switch(e){case"attachment":return this.viewModel.attachmentsFeatureCount;case"structure":return this.viewModel.structureFeatureCount;case"content":return this.viewModel.contentFeatureCount;case"container":return this.viewModel.containerFeatureCount;case"connectivity":return this.viewModel.connectivityFeatureCount}}_renderAssociations(e){return u("div",null,this._getFeatureCount(e.type)>0?this._renderAssociationType(e):null)}_renderContent(){const{state:e,associationTypes:t}=this.viewModel;return u("div",{class:this.classes(ot.listContainer,{[ot.listContainerQuerying]:e==="querying"}),key:"list-container"},e==="ready"?u("calcite-list",null,t.map(i=>this._renderAssociations(i))):null,this._renderStickyLoading())}};r([a()],re.prototype,"flowType",void 0),r([a()],re.prototype,"flowItems",void 0),r([a()],re.prototype,"parentFeatureViewModel",void 0),r([a()],re.prototype,"featureVisibleElements",void 0),r([a()],re.prototype,"description",null),r([a()],re.prototype,"headingLevel",void 0),r([a()],re.prototype,"title",null),r([a({type:ft})],re.prototype,"viewModel",void 0),r([a(),Y("esri/widgets/Feature/t9n/Feature")],re.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],re.prototype,"messagesCommon",void 0),r([a({type:Ot,nonNullable:!0})],re.prototype,"visibleElements",void 0),re=r([P("esri.widgets.Feature.FeatureUtilityNetworkAssociations")],re);const xr=re;let kr=class{constructor(e,t){this.preLayerQueryCallback=e,this.preRequestCallback=t,this.preLayerQueryCallback||(this.preLayerQueryCallback=i=>{}),this.preRequestCallback||(this.preLayerQueryCallback=i=>{})}};var Qe;const Lr=1,Yi="content-view-models",eo="relationship-view-models",Pr="association-view-models",to={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0,utilityNetworkAssociationsContent:!0};let O=Qe=class extends li(ge){constructor(e){super(e),this._error=null,this._featureAbortController=null,this._associationVMAbortController=null,this._graphicChangedThrottled=pi(this._graphicChanged,Lr,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...to},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.location=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||t.type==="utility-network-associations"&&!!i.utilityNetworkAssociationsContent},this.addHandles(y(()=>[this.graphic,this._effectivePopupTemplate,this.abilities,this.timeZone],()=>this._graphicChangedThrottled(),$))}initialize(){this.addHandles(this._graphicChangedThrottled)}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return this.graphic!=null?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return vs(Ri(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return xo(this.graphic)}castAbilities(e){return{...to,...e}}get isTable(){return this._sourceLayer?.isTable||!1}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._featureAbortController=new AbortController,this._set("graphic",e?.clone()??null)}get spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get map(){return this.view?.map||null}set map(e){this._override("map",e)}get waitingForContent(){return!(!this._featureAbortController&&!this._associationVMAbortController)}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof Se&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof Se&&t.previous()}async updateGeometry(){const{graphic:e,spatialReference:t,_sourceLayer:i}=this;await i?.load();const o=i?.objectIdField;if(!o||!e||!i)return;const n=e?.attributes?.[o];if(n==null)return;const s=[n];if(!e.geometry){const l=await Vo({layer:i,graphic:e,outFields:[],objectIds:s,returnGeometry:!0,spatialReference:t}),d=l?.geometry;d&&(e.geometry=d)}}_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){Et(i)||(this._error=i,K.getLogger(this).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):e.type==="utility-network-associations"?this._compileUtilityNetworkAssociation(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)).filter(Nt):typeof e=="string"?this._compileText(new go({text:e}),0).text:e}_destroyContentViewModels(){this.removeHandles(eo),this.removeHandles(Yi),this.contentViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){const i=e?.graphic?.getObjectId(),o=t?.getObjectId();return i!=null&&o!=null&&i===o}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){const{view:o,spatialReference:n,timeZone:s}=this;t?.filter(Boolean).forEach(l=>{e.some(d=>this._matchesFeature(d,l))||e.add(new Qe({abilities:{relationshipContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:l}))}),e.forEach(l=>{t?.find(d=>this._matchesFeature(l,d))||e.remove(l)})}_setExpressionContentVM(e,t){const i=this.formattedAttributes,{contentElement:o,contentElementViewModel:n}=e,s=o?.type;n&&s&&(s==="fields"&&(this._createFieldsFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createFieldsVMParams(o,t))),s==="media"&&(this._createMediaFormattedAttributes({contentElement:o,contentElementIndex:t,formattedAttributes:i}),n.set(this._createMediaVMParams(o,t))),s==="text"&&n.set(this._createTextVMParams(o)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:o,relationshipId:n,title:s,description:l}=e,{_sourceLayer:d,graphic:c,map:p}=this;if(!$o(d))return;const h=new wi({displayCount:i,graphic:c,orderByFields:o,relationshipId:n,layer:d,map:p,...this._compileTitleAndDesc({title:s,description:l})});return this.contentViewModels[t]=h,this.addHandles(dt(()=>h.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(h)),eo),e}_matchesGlobalFeature(e,t){const i=e?.association.globalId,o=t?.association.globalId;return i!=null&&o!=null&&i===o}async _setUpUtilityNetworkAssociationsViewModels(e,t,i){const{view:o,spatialReference:n,timeZone:s}=this;e.forEach((d,c)=>{const p=t.get(c);p?d.forEach(h=>{p.find(m=>this._matchesGlobalFeature(h,m))||(d.remove(h),d.length===0&&e.delete(c))}):(d.removeAll(),e.delete(c))}),t.forEach((d,c)=>{const p=e.get(c)||new ce;d?.filter(Boolean).forEach(h=>{p.some(m=>this._matchesGlobalFeature(m,h))||p.add({association:h.association,featureViewModel:new Qe({abilities:{utilityNetworkAssociationsContent:!1},map:i,view:o,spatialReference:n,timeZone:s,graphic:h.feature}),terminalName:h.terminalName})}),e.set(c,p)});const l=new AbortController;this._associationVMAbortController=l,await this._sortListObjectsByTitle(e,{signal:l.signal}),this._associationVMAbortController===l&&(this._associationVMAbortController=null)}async _sortListObjectsByTitle(e,t){for(const i of e.values()){const o=i.map(n=>yo(()=>n.featureViewModel.state==="ready",t?.signal));await Promise.all(o),i.sort(this._compareByFeatureTitle)}}_compareByFeatureTitle(e,t){const i=xt(e.featureViewModel),o=xt(t.featureViewModel);return i.localeCompare(o,void 0,{numeric:!0})}_compileUtilityNetworkAssociation(e,t){const{title:i,description:o,associationTypes:n}=e,{_sourceLayer:s,graphic:l,map:d}=this;if(!hs(s))return;const c=new ft({graphic:l,associationTypes:n,layer:s,map:d,...this._compileTitleAndDesc({title:i,description:o})});return this.contentViewModels[t]=c,this.addHandles([y(()=>c.associationFeatures.values(),()=>this._setUpUtilityNetworkAssociationsViewModels(c.associationViewModels,c.associationFeatures,c.map))],Pr),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:o,map:n,spatialReference:s,view:l,location:d}=this,c=new vi({expressionInfo:i,graphic:o,interceptor:Qe.interceptor,map:n,spatialReference:s,view:l,location:d});return this.contentViewModels[t]=c,this.addHandles(y(()=>c.contentElementViewModel,()=>this._setExpressionContentVM(c,t),$),Yi),e}_compileAttachments(e,t){const{graphic:i}=this,{description:o,title:n}=e;return this.contentViewModels[t]=new yi({graphic:i,...this._compileTitleAndDesc({title:n,description:o})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:o,destroyer:n}=e;return this.contentViewModels[t]=new Lt({graphic:i,creator:o,destroyer:n}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:o,graphic:n,formattedAttributes:s}=this,l=n?.attributes,d=this._expressionAttributes,c=s.global;return{title:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:e}),description:Ve({attributes:l,fieldInfoMap:i,globalAttributes:c,expressionAttributes:d,layer:o,text:t})}}_createFieldsVMParams(e,t){const i=this._effectivePopupTemplate,o=this.formattedAttributes,n={...o?.global,...o?.content[t]},s=e?.fieldInfos||i?.fieldInfos,l=s?.filter(({fieldName:h})=>!!h&&(hi(h)||Ie(h)||n.hasOwnProperty(h))),d=i?.expressionInfos,{description:c,title:p}=e;return{attributes:n,expressionInfos:d,fieldInfos:l,...this._compileTitleAndDesc({title:p,description:c})}}_compileFields(e,t){const i=e.clone(),o=new Rt(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=o,i.fieldInfos=o.formattedFieldInfos.slice(),i}_createMediaVMParams(e,t){const{abilities:i,graphic:o,_fieldInfoMap:n,_effectivePopupTemplate:s,relatedInfos:l,_sourceLayer:d,_expressionAttributes:c}=this,p=this.formattedAttributes,h=o?.attributes??{},{description:m,mediaInfos:f,title:g}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:h,isAggregate:o?.isAggregate,layer:d,fieldInfoMap:n,formattedAttributes:{...p?.global,...p?.content[t]},expressionAttributes:c,mediaInfos:f,popupTemplate:s,relatedInfos:l,...this._compileTitleAndDesc({title:g,description:m})}}_compileMedia(e,t){const i=e.clone(),o=new Se(this._createMediaVMParams(e,t));return i.mediaInfos=o.formattedMediaInfos.slice(),this.contentViewModels[t]=o,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:o,_expressionAttributes:n}=this;if(e&&e.text){const s=t?.attributes??{},l=this.formattedAttributes?.global??{};e.text=Ve({attributes:s,fieldInfoMap:i,globalAttributes:l,expressionAttributes:n,layer:o,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new Lt(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i,timeZone:o}=this;if(!e)return;const{lastEditInfoEnabled:n}=e,s=t?.editFieldsInfo;return n&&s?_s(s,i?.attributes,o,t):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:o,_expressionAttributes:n}=this,s=o?.attributes??{},l=this.formattedAttributes?.global??{};return Ve({attributes:s,fieldInfoMap:t,globalAttributes:l,expressionAttributes:n,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"title",value:e?.title,event:{graphic:t}}):null}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this;return t?kt({type:"content",value:e?.content,event:{graphic:t}}):null}async _queryFeature(e){const{_featureAbortController:t,_sourceLayer:i,graphic:o,_effectivePopupTemplate:n}=this,s=this.map,l=this.view,d=this.spatialReference,c=this.location;if(t!==this._featureAbortController||!o)return;await bs({graphic:o,popupTemplate:n,layer:i,spatialReference:d},e);const{content:{value:p},title:{value:h}}=await qe({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:m}}=await qe({checkForRelatedFeatures:this._checkForRelatedFeatures(e),expressionAttributes:wr({expressionInfos:n?.expressionInfos,spatialReference:d,graphic:o,map:s,interceptor:Qe.interceptor,view:l,options:e,location:c})});t===this._featureAbortController&&o&&(this._expressionAttributes=m,this._graphicExpressionAttributes={...o.attributes,...m},this._set("formattedAttributes",this._createFormattedAttributes(p)),this._set("title",this._compileTitle(h)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(p)||null))}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:o,graphic:n,relatedInfos:s,_sourceLayer:l,_fieldInfoMap:d,_graphicExpressionAttributes:c,timeZone:p}=this;i.content[t]=Bt({fieldInfos:o?.fieldInfos,graphic:n,attributes:{...c,...e.attributes},layer:l,fieldInfoMap:d,relatedInfos:s,timeZone:p})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:o,relatedInfos:n,_sourceLayer:s,_fieldInfoMap:l,_graphicExpressionAttributes:d,timeZone:c}=this;i.content[t]=Bt({fieldInfos:e.fieldInfos,graphic:o,attributes:{...d,...e.attributes},layer:s,fieldInfoMap:l,relatedInfos:n,timeZone:c})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:o,_sourceLayer:n,_fieldInfoMap:s,_graphicExpressionAttributes:l,timeZone:d}=this,c=t?.fieldInfos,p={global:Bt({fieldInfos:c,graphic:i,attributes:l,layer:n,fieldInfoMap:s,relatedInfos:o,timeZone:d}),content:[]};return Array.isArray(e)&&e.forEach((h,m)=>{h.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p}),h.type==="media"&&this._createMediaFormattedAttributes({contentElement:h,contentElementIndex:m,formattedAttributes:p})}),p}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,Ri(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:o,_sourceLayer:n}=this;o.clear();const s=n?.associatedLayer!=null?await n?.associatedLayer.load(i):n;if(!s||!e||!t.filter(c=>!!c.fieldName&&Ie(c.fieldName))?.length)return;t.forEach(c=>this._configureRelatedInfo(c,s));const l=await sr({relatedInfos:o,layer:s},i);Object.keys(l).forEach(c=>{const p=o.get(c.toString()),h=l[c]?.value;p&&h&&(p.layerInfo=h.data)});const d=await rr({graphic:e,relatedInfos:o,layer:s},i);Object.keys(d).forEach(c=>{Ks(d[c]?.value,o.get(c.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,o=It(e.fieldName||"");if(!o)return;const{layerId:n,fieldName:s}=o;if(!n)return;const l=i.get(n.toString())||Js(n,t);l&&(ar({relatedInfo:l,fieldName:s,fieldInfo:e}),this.relatedInfos.set(n,l))}};O.interceptor=new kr(Fs,Ms),r([a()],O.prototype,"_error",void 0),r([a()],O.prototype,"_featureAbortController",void 0),r([a()],O.prototype,"_associationVMAbortController",void 0),r([a({readOnly:!0})],O.prototype,"_effectivePopupTemplate",null),r([a({readOnly:!0})],O.prototype,"_fieldInfoMap",null),r([a({readOnly:!0})],O.prototype,"_sourceLayer",null),r([a()],O.prototype,"abilities",void 0),r([et("abilities")],O.prototype,"castAbilities",null),r([a({readOnly:!0})],O.prototype,"content",void 0),r([a({readOnly:!0})],O.prototype,"contentViewModels",void 0),r([a()],O.prototype,"description",void 0),r([a({type:Boolean})],O.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],O.prototype,"isTable",null),r([a({readOnly:!0})],O.prototype,"state",null),r([a({readOnly:!0})],O.prototype,"formattedAttributes",void 0),r([a({type:je,value:null})],O.prototype,"graphic",null),r([a({readOnly:!0})],O.prototype,"lastEditInfo",void 0),r([a({type:ai})],O.prototype,"location",void 0),r([a({readOnly:!0})],O.prototype,"relatedInfos",void 0),r([a()],O.prototype,"spatialReference",null),r([a()],O.prototype,"timeZone",null),r([a({readOnly:!0})],O.prototype,"title",void 0),r([a()],O.prototype,"map",null),r([a({readOnly:!0})],O.prototype,"waitingForContent",null),r([a()],O.prototype,"view",void 0),O=Qe=r([P("esri.widgets.Feature.FeatureViewModel")],O);const bi=O,Q="esri-feature",D={base:Q,container:`${Q}__size-container`,title:`${Q}__title`,main:`${Q}__main-container`,btn:`${Q}__button`,icon:`${Q}__icon`,content:`${Q}__content`,contentNode:`${Q}__content-node`,contentNodeText:`${Q}__content-node--text`,contentElement:`${Q}__content-element`,text:`${Q}__text`,lastEditedInfo:`${Q}__last-edited-info`,fields:`${Q}__fields`,fieldHeader:`${Q}__field-header`,fieldData:`${Q}__field-data`,fieldDataDate:`${Q}__field-data--date`,loadingSpinnerContainer:`${Q}__loading-container`},Uo=e=>{let t=class extends e{constructor(){super(...arguments),this.renderNodeContent=i=>Bo(i)&&!i.destroyed?u("div",{class:D.contentNode,key:i},i.render()):i instanceof HTMLElement?u("div",{afterCreate:this._attachToNode,bind:i,class:D.contentNode,key:i}):Ns(i)?u("div",{afterCreate:this._attachToNode,bind:i.domNode,class:D.contentNode,key:i}):null}_attachToNode(i){const o=this;i.appendChild(o)}};return t=r([P("esri.widgets.Feature.support.FeatureContentMixin")],t),t},io={title:!0,content:!0,lastEditedInfo:!0};let B=class extends Uo(oe){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowType="feature",this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.visibleElements={...io},this.viewModel=new bi}initialize(){this.addHandles(y(()=>this.viewModel?.contentViewModels,()=>this._setupContentWidgets(),$))}loadDependencies(){return Ae({notice:()=>w(()=>import("./calcite-notice-DeAGopAs-BI9wdRMa.js"),__vite__mapDeps([123,2,3,4,5,6,7,124,9,8,113,107,108,114,125,119,1]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--B8aaTEnB.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}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 isTable(){return this.viewModel.isTable}get icon(){return"polygon"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...io,...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}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}render(){const{state:e}=this.viewModel,t=u("div",{class:D.container,key:"container"},this._renderTitle(),e==="error"?this._renderError():e==="loading"?this._renderLoading():this._renderContentContainer());return u("div",{class:this.classes(D.base,M.widget)},t)}_renderError(){const{messagesCommon:e,messages:t,visibleElements:i}=this;return u("calcite-notice",{icon:"exclamation-mark-circle",kind:"danger",open:!0,scale:"s"},i.title?u("div",{key:"error-title",slot:"title"},e.errorMessage):null,u("div",{key:"error-message",slot:"message"},t.loadingError))}_renderLoading(){return u("div",{class:D.loadingSpinnerContainer,key:"loading-container"},u("calcite-loader",{inline:!0,label:""}))}_renderContentContainer(){const{visibleElements:e}=this;return e.content?u("div",{class:D.main},[this._renderContent(),this._renderLastEditInfo()]):null}_renderTitle(){const{visibleElements:e,title:t}=this;return e.title?u(_i,{class:D.title,innerHTML:t,level:this.headingLevel}):null}_renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?u("div",{class:D.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:u("div",{class:this.classes(D.contentNode,D.contentNodeText),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);case"utility-network-associations":return this._renderAssociation(t);default:return null}}_renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:i,attachmentInfos:o}=t.viewModel;return i==="loading"||o.length>0?u("div",{class:this.classes(D.contentElement),key:this._buildKey("attachments-element",e)},t.render()):null}_renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("relationship-element",e)},t.render()):null}_renderAssociation(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?u("div",{class:D.contentElement,key:this._buildKey("utility-network-association-element",e)},t.render()):null}_renderExpression(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&t.viewModel.contentElement?u("div",{class:D.contentElement,key:this._buildKey("expression-element",e)},t.render()):null}_renderCustom(e,t){const{creator:i}=e,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:D.contentElement,key:this._buildKey("custom-element",t)},o.render()):null}_renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("fields-element",e)},t.render())}_renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:u("div",{class:D.contentElement,key:this._buildKey("media-element",e)},t.render())}_renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||!e.lastEditedInfo)return null;const{date:o,user:n}=i,s=i.type==="edit"?n?t.lastEditedByUser:t.lastEdited:n?t.lastCreatedByUser:t.lastCreated,l=pe(s,{date:o,user:n});return u("div",{class:this.classes(D.lastEditedInfo,D.contentElement),key:"edit-info-element"},l)}_renderText(e,t){const i=e.text,o=this._contentWidgets[t];return!o||o.destroyed?null:i?u("div",{class:this.classes(D.contentElement,D.text),key:this._buildKey("text-element",t)},o.render()):null}_buildKey(e,...t){return`${e}__${this.viewModel?.graphic?.uid||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t,flowItems:i,viewModel:o}=this,n=o?.content,{contentViewModels:s}=o;if(Array.isArray(n))n.forEach((l,d)=>{if(l.type==="attachments"&&(this._contentWidgets[d]=new Ls({displayType:l.displayType,headingLevel:t.title&&e<6?e+1:e,viewModel:s[d]})),l.type==="fields"&&(this._contentWidgets[d]=new jo({viewModel:s[d]})),l.type==="media"&&(this._contentWidgets[d]=new Wo({viewModel:s[d]})),l.type==="text"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="custom"&&(this._contentWidgets[d]=new bt({viewModel:s[d]})),l.type==="expression"&&(this._contentWidgets[d]=new Ir({viewModel:s[d]})),l.type==="relationship"){const c=new Fr({flowItems:i,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}if(l.type==="utility-network-associations"){const c=new xr({flowItems:i,parentFeatureViewModel:o,featureVisibleElements:t,viewModel:s[d]});this._contentWidgets[d]=c}},this);else{const l=s[0];l&&!l.destroyed&&(this._contentWidgets[0]=new bt({viewModel:l}))}this.scheduleRender()}};r([a()],B.prototype,"flowType",void 0),r([a()],B.prototype,"graphic",null),r([a()],B.prototype,"defaultPopupTemplateEnabled",null),r([a()],B.prototype,"flowItems",void 0),r([a()],B.prototype,"headingLevel",void 0),r([a({readOnly:!0})],B.prototype,"isTable",null),r([a()],B.prototype,"icon",null),r([a()],B.prototype,"label",null),r([a()],B.prototype,"location",null),r([a(),Y("esri/widgets/Feature/t9n/Feature")],B.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],B.prototype,"messagesCommon",void 0),r([a()],B.prototype,"spatialReference",null),r([a()],B.prototype,"timeZone",null),r([a({readOnly:!0})],B.prototype,"title",null),r([a()],B.prototype,"visibleElements",void 0),r([et("visibleElements")],B.prototype,"castVisibleElements",null),r([a()],B.prototype,"map",null),r([a()],B.prototype,"view",null),r([a({type:bi})],B.prototype,"viewModel",void 0),B=r([P("esri.widgets.Feature")],B);const Zo=B,Go=Object.freeze(Object.defineProperty({__proto__:null,default:Zo},Symbol.toStringTag,{value:"Module"}));let Pe=class extends ln.EventedAccessor{constructor(e){super(e),this.location=null,this.screenLocationEnabled=!1,this.view=null,this.addHandles([at(()=>{const t=this.screenLocationEnabled?this.view:null;return t?[t.size,t.type==="3d"?t.camera:t.viewpoint]:null},()=>this.notifyChange("screenLocation")),y(()=>this.screenLocation,(t,i)=>{t!=null&&i!=null&&this.emit("view-change")})])}destroy(){this.view=null}get screenLocation(){const{location:e,view:t,screenLocationEnabled:i}=this,o=t?.spatialReference,n=o?Wn(e,o).geometry:null;return i&&n&&t?.ready?t.toScreen(n):null}};r([a()],Pe.prototype,"location",void 0),r([a()],Pe.prototype,"screenLocation",null),r([a()],Pe.prototype,"screenLocationEnabled",void 0),r([a()],Pe.prototype,"view",void 0),Pe=r([P("esri.widgets.support.AnchorElementViewModel")],Pe);const Qo=Pe;let Ct=class extends Qo{constructor(e){super(e),this.visible=!1}};r([a()],Ct.prototype,"visible",void 0),Ct=r([P("esri.widgets.Spinner.SpinnerViewModel")],Ct);const Xo=Ct,Qt="esri-spinner",Xt={base:Qt,spinnerStart:`${Qt}--start`,spinnerFinish:`${Qt}--finish`};let Ne=class extends oe{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new Xo}initialize(){this.addHandles(y(()=>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 o=()=>this.hide();i&&i.catch(()=>{}).then(o)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,i=!!t,o=e&&i,n=!e&&i,s={[Xt.spinnerStart]:o,[Xt.spinnerFinish]:n},l=this._getPositionStyles();return u("div",{class:this.classes(Xt.base,s),styles:l})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=$t(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(t==null||e==null)return{};const{padding:i}=t;return{left:e.x-i.left+"px",top:e.y-i.top+"px"}}};r([a()],Ne.prototype,"location",null),r([a()],Ne.prototype,"view",null),r([a({type:Xo})],Ne.prototype,"viewModel",void 0),r([a()],Ne.prototype,"visible",null),Ne=r([P("esri.widgets.Spinner")],Ne);const Nr=Ne,ee="esri-features",Z={icon:`${ee}__icon`,actionImage:`${ee}__action-image`,base:ee,container:`${ee}__container`,contentContainer:`${ee}__content-container`,contentFeature:`${ee}__content-feature`,flowItemCollapsed:`${ee}__flow-item--collapsed`,header:`${ee}__header`,footer:`${ee}__footer`,featureMenuObserver:`${ee}__feature-menu-observer`,actionExit:`${ee}__action--exit`,loader:`${ee}__loader`,featuresHeading:`${ee}__heading`,paginationActionBar:`${ee}__pagination-action-bar`,paginationPrevious:`${ee}__pagination-previous`,paginationNext:`${ee}__pagination-next`},De=ce.ofType({key:"type",defaultKeyValue:"button",base:dn,typeMap:{button:pt,toggle:_o}}),xe=new pt({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),oo=new pt({icon:"trash",id:"remove-selected-feature",title:"{messages.remove}",className:we.trash}),Je=new pt({icon:"magnifying-glass-plus",id:"zoom-to-clustered-features",title:"{messages.zoom}",className:we.zoomInMagnifyingGlass}),Te=new _o({icon:"table",id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:we.table,value:!1}),Ce=xe.clone();let $e=class extends oe{constructor(e,t){super(e,t),this.messages=null,this.closed=!1,this.closable=!0,this._handleOpenFeature=i=>{this.emit("open-feature",{feature:i})},this._handleZoomToFeature=i=>{this.emit("zoom-to-feature",{featureWidget:i})}}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-DEiRzt3o.js"),__vite__mapDeps([131,122,2,3,4,5,6,7,8,106,110,113,107,108,9,119,114,1,105]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-C59I7NOF.js"),__vite__mapDeps([132,2,3,4,5,6,7,124,9,8,113,107,108,114,133,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-H6U8Q6wA.js"),__vite__mapDeps([135,133,2,3,4,5,6,7,124,9,113,107,8,108,114,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-Cp1dKuD0.js"),__vite__mapDeps([136,2,3,4,5,6,7,8,110,113,107,108,9,114,137,134,106,122,119,1,105,129,115,125,130,120]),import.meta.url)})}render(){const{flowItems:e}=this,t=e?.toArray();return u(Ao,null,t?.map(i=>this._renderFlowItem(i)))}_handleCloseClick(){this.emit("close")}_handleExitClick(){this.emit("exit")}_handleDrillInBackClick(){const e=this.flowItems?.pop();e&&("showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy()))}_getExitMessage(e){switch(e.flowType){case"feature":case"feature-association":return"";case"feature-relationship":return this.messages.exitRelatedRecords;case"feature-utility-network-associations":case"feature-utility-network-association-type":return this.messages.exitAssociations}}_renderFlowItem(e){const{messages:t,closable:i,closed:o}=this,n="graphic"in e&&!e.isTable,s=e.flowType==="feature-association",l=this._getExitMessage(e),d=t.selectFeature;return u("calcite-flow-item",{bind:this,closable:i,closed:o,description:this._getDrillInFlowItemDescription(e),heading:e.title??"",key:`flow-item-${e.viewModel.uid}`,onCalciteFlowItemBack:c=>{c.preventDefault(),this._handleDrillInBackClick()},onCalciteFlowItemClose:this._handleCloseClick},u("calcite-action",{appearance:"transparent",bind:this,class:Z.actionExit,icon:"move-up",key:"exit-action",onclick:this._handleExitClick,slot:"header-actions-start",text:l,title:l}),n?u("calcite-action",{appearance:"transparent",bind:this,icon:"zoom-to-object",key:"open-feature-action",onclick:()=>this._handleOpenFeature(e),slot:"header-actions-end",text:d,title:d}):null,s?u("calcite-action-bar",{expandDisabled:!0,expanded:!0,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{overlayPositioning:"fixed",scale:"s"},this._renderDefaultActions(e))):null,u("div",{class:Z.container},e.render()))}_renderDefaultActions(e){const t=this._getActionTitle(Ce);return u("calcite-action",{active:Ce.active,appearance:"solid",bind:this,"data-action-uid":Ce.uid,disabled:Ce.disabled,icon:Ce.icon??"question",indicator:Ce.indicator,key:`action-${Ce.uid}`,loading:Ce.active,onclick:()=>this._handleZoomToFeature(e),scale:"s",text:t,textEnabled:!0,title:t})}_getActionTitle(e){const{messages:t}=this,{id:i}=e,o=e.title??"";return i==="zoom-to-feature"?pe(o,{messages:t}):o}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":return e.viewModel.description??"";case"feature-relationship":return e.featureCountDescription;case"feature-utility-network-association-type":return e.description??""}}};r([a()],$e.prototype,"flowItems",void 0),r([a(),Y("esri/widgets/Features/t9n/Features")],$e.prototype,"messages",void 0),r([a()],$e.prototype,"closed",void 0),r([a()],$e.prototype,"closable",void 0),$e=r([P("esri.widgets.Features.FeaturesDrillIn")],$e);const $r=$e,Rr="OBJECTID";var Re;(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"})(Re||(Re={}));const no=ci("android");ci("chrome")||no&&no>=4,En(),Re.size,Re.maxSize,Re.maxOutlineSize,Re.lineWidth,Re.tallSymbolWidth;function Jo(e){return e&&"opacity"in e?e.opacity*Jo(e.parent):1}async function so(e,t){if(!e)return;const i=e.sourceLayer,o=(t!=null&&t.useSourceLayer?i:e.layer)??i,n=Jo(o);if(e.symbol!=null&&(t==null||t.ignoreGraphicSymbol!==!0)){const b=e.symbol.type==="web-style"?await Vn(e.symbol,{...t,cache:t!=null?t.webStyleCache:null}):e.symbol.clone();return St(b,null,n),b}const s=t?.renderer??Or(o);let l=s&&"getSymbolAsync"in s?await s.getSymbolAsync(e,t):null;if(!l)return;if(l=l.type==="web-style"?await l.fetchSymbol({...t,cache:t!=null?t.webStyleCache:null}):l.clone(),!s||!("visualVariables"in s)||!s.visualVariables?.length)return St(l,null,n),l;if("arcadeRequiredForVisualVariables"in s&&s.arcadeRequiredForVisualVariables&&t?.arcade==null){const b={...t};b.arcade=await Io(),t=b}const{getColor:d,getOpacity:c,getAllSizes:p,getRotationAngle:h}=await w(()=>import("./visualVariableUtils-D3kZJRyn-tyrXoPjU.js"),__vite__mapDeps([10,3,4,5,6,11,12,13]),import.meta.url),m=[],f=[],g=[],v=[];for(const b of s.visualVariables)switch(b.type){case"color":m.push(b);break;case"opacity":f.push(b);break;case"rotation":v.push(b);break;case"size":b.target||g.push(b)}const I=!!m.length&&m[m.length-1],C=I?d(I,e,t):null,_=!!f.length&&f[f.length-1];let T=_?c(_,e,t):null;if(n!=null&&(T=T!=null?T*n:n),St(l,C,T),g.length){const b=p(g,e,t);await Sn(l,b)}for(const b of v)Dn(l,h(b,e,t),b.axis);return l}function Or(e){if(e)return"renderer"in e?e.renderer:void 0}const Vr="esri.widgets.Popup.PopupViewModel",Pt=()=>K.getLogger(Vr),Sr=e=>{const{event:t,view:i,viewModel:o}=e,{action:n}=t;if(!n)return Promise.reject(new N("trigger-action:missing-arguments","Event has no action"));const{disabled:s,id:l}=n;if(!l)return Promise.reject(new N("trigger-action:invalid-action","action.id is missing"));if(s)return Promise.reject(new N("trigger-action:invalid-action","Action is disabled"));if(l===xe.id)return Yo(o).catch(wn);if(l===Je.id)return qr(o);if(l===Te.id)return o.browseClusterEnabled=!o.browseClusterEnabled,o.featureMenuOpen=o.browseClusterEnabled,Promise.resolve();if(l===oo.id){o.visible=!1;const{selectedFeature:d}=o;if(!d)return Promise.reject(new N(`trigger-action:${oo.id}`,"selectedFeature is required",{selectedFeature:d}));const{sourceLayer:c}=d;return c?c.remove(d):i?.graphics.remove(d),Promise.resolve()}return Promise.resolve()};function Ko(e){const{selectedFeature:t,location:i,view:o}=e;return o?t??i??null:null}function Oe(e){return!!e&&e.isAggregate&&e.sourceLayer?.featureReduction?.type==="cluster"}async function Dr(e,t){if(t?.type!=="3d"||!e||e.declaredClass!=="esri.Graphic")return!0;const i=t.getViewForGraphic(e);if(i&&"whenGraphicBounds"in i){let o=null;try{o=await i.whenGraphicBounds(e,{useViewElevation:!0})}catch{}return!o||!o.boundingBox||o.boundingBox[0]===o.boundingBox[3]&&o.boundingBox[1]===o.boundingBox[4]&&o.boundingBox[2]===o.boundingBox[5]}return!0}async function Yo(e,t){const{location:i,selectedFeature:o,view:n,zoomFactor:s}=e;await t?.viewModel?.updateGeometry();const l=t?.graphic,d=l?.geometry?l:Ko(e);if(!n||!d){const m=new N("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:d,view:n});throw Pt().error(m),m}const c=n.scale/s,p=l?.geometry??e.selectedFeature?.geometry??i,h=p!=null&&p.type==="point"&&await Dr(l??o,n);xe.active=!0,xe.disabled=!0;try{await e.zoomTo({target:{target:d,scale:h?c:void 0}})}catch(m){if(Et(m))return;const f=new N("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:l??o});Pt().error(f)}finally{xe.active=!1,xe.disabled=!1,e.zoomToLocation=null,h&&(e.location=p)}}async function qr(e){const{selectedFeature:t,view:i}=e;if(i?.type!=="2d"){const l=new N("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw Pt().error(l),l}if(!t||!Oe(t)){const l=new N("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:t});throw Pt().error(l),l}const[o,n]=await Ii(i,t);Je.active=!0,Je.disabled=!0;const{extent:s}=await o.queryExtent(n);s&&await e.zoomTo({target:s}),Je.active=!1,Je.disabled=!1}async function Br(e){const{view:t,selectedFeature:i}=e;if(!t||!i)return;const[o,n]=await Ii(t,i),{extent:s}=await o.queryExtent(n);e.selectedClusterBoundaryFeature.geometry=s,t.graphics.add(e.selectedClusterBoundaryFeature)}async function jr(e){const{selectedFeature:t,view:i}=e;if(!i||!t)return;const[o,n]=await Ii(i,t);Te.active=!0,Te.disabled=!0;const{features:s}=await o.queryFeatures(n);Te.active=!1,Te.disabled=!1,Te.value=!0,e?.open({features:[t].concat(s),featureMenuOpen:!0})}async function Ii(e,t){const i=await e.whenLayerView(t.sourceLayer),o=i.createQuery(),n=t.getObjectId();return o.aggregateIds=n!=null?[n]:[],[i,o]}function Wr(e){Te.value=!1;const t=e.features.filter(i=>Oe(i));t.length&&(e.features=t)}const Jt="location-scale-handle",zr=()=>[xe.clone()],Hr=()=>[Je.clone(),Te.clone()];let wt=null;function Ur(e,t){return e==="building-scene"||t==="2d"&&(e==="map-image"||e==="tile"||e==="imagery"||e==="imagery-tile")}let F=class extends Rn(Qo){constructor(e){super(e),this._pendingPromises=new Ln,this._fetchFeaturesController=null,this._highlightSelectedFeaturePromise=null,this._highlightActiveFeaturePromise=null,this._selectedClusterFeature=null,this.actions=new De,this.activeFeature=null,this.autoCloseEnabled=!1,this.browseClusterEnabled=!1,this.content=null,this.defaultPopupTemplateEnabled=!1,this.featurePage=null,this.featuresPerPage=20,this.featureMenuOpen=!1,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new je({symbol:new cn({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,this._debouncedLocationUpdate=Ke(async t=>{const{spatialReference:i}=this,o=this.selectedFeature?.geometry?.type,n=this.location??t;if(o&&o!=="mesh"&&i&&n&&this.selectedFeature)if(o!=="point")try{const s=this.selectedFeature;let l=s.geometry;const d=this._getHighlightLayer(s),c=s.getObjectId();if(!d||!this.view)return;if(c){const p=this.view?.allLayerViews.find(f=>f.layer.uid===d.uid);if(!p||!("queryFeatures"in p))return;const h=p.createQuery();h.outSpatialReference=i,h.objectIds=[c],h.returnGeometry=!0;const{features:m}=await p.queryFeatures(h);l=m[0]?.geometry}if(!l||l.type==="mesh")return;if(l=zn(l,i),wt||(wt=await w(()=>import("./geometryEngineAsync-D7oEu5dd-CZIKaTd9.js"),__vite__mapDeps([138,3,4,5,6,63]),import.meta.url)),!await wt.intersects(l,n)){const p=(await wt.nearestCoordinate(l,n)).coordinate??n;this.selectedFeature===s&&(this.location=p)}}catch(s){Et(s)||K.getLogger(this).error(s)}else this.location=Yt(this.selectedFeature.geometry)??n})}initialize(){this.addHandles([this.on("view-change",()=>this._autoClose()),y(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),y(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),y(()=>this.view?.animation?.state,e=>this._animationStateChange(e)),y(()=>this.location,e=>this._locationChange(e)),y(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),y(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),y(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),y(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>Sr({event:e,viewModel:this,view:this.view})),at(()=>!this.waitingForResult,()=>this._waitingForResultChange(),un),y(()=>[this.features,this.map,this.spatialReference,this.timeZone],()=>this._updateFeatureVMs()),y(()=>this.view?.scale,()=>this._viewScaleChange()),at(()=>!this.visible,()=>this.browseClusterEnabled=!1),y(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null,this.map=null,this.spatialReference=null,this.timeZone=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new De;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:o,includeDefaultActions:n,selectedFeature:s}=this,l=n?i.concat(t):t,d=s&&(typeof s.getEffectivePopupTemplate=="function"&&s.getEffectivePopupTemplate(o)||s.popupTemplate),c=d?.actions;return(d?.overwriteActions?c:c?.concat(l)??l)?.filter(Boolean).forEach(p=>e.add(p)),e}get defaultActions(){const e=this._get("defaultActions")||new De;return e.removeAll(),e.addMany(Oe(this.selectedFeature)?Hr():zr()),e}get featureCount(){return this.features.length}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:o,selectedFeatureIndex:n}=this,s=o&&t.length;s&&i&&n===-1?this.selectedFeatureIndex=0:s&&n!==-1||(this.selectedFeatureIndex=t.length?0:-1)}set location(e){let t=e;const i=this.spatialReference?.isWebMercator;e?.spatialReference?.isWGS84&&i&&(t=pn(e)),this._set("location",t)}get map(){return this.view?.map??null}set map(e){this._override("map",e)}get pendingPromisesCount(){return this._pendingPromises.size}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){this._pendingPromises.clear(),this.features=[],Array.isArray(e)&&e.length?(this._set("promises",e),(e=e.slice()).forEach(t=>this._pendingPromises.add(t)),e.reduce((t,i)=>t.finally(()=>i.then(o=>{this._pendingPromises.has(i)&&this._updateFeatures(o)}).finally(()=>this._pendingPromises.delete(i)).catch(()=>{})),Promise.resolve())):this._set("promises",[])}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 spatialReference(){return this.view?.spatialReference??null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{view:e,map:t}=this;return e?e.ready?"ready":"disabled":t?"ready":"disabled"}get timeZone(){return this.view?.timeZone??fo}set timeZone(e){this._overrideIfSome("timeZone",e)}get waitingForContents(){return this.featureViewModels.some(e=>e.waitingForContent)}get waitingForResult(){return!(!(this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}centerAtLocation(){const{view:e}=this,t=Ko(this);return t&&e?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new N("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 N("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{pointerType:t?.event?.pointerType,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal: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 o=["actionsMenuOpen","collapsed"];for(const n of o)delete t[n];this.set(t)}triggerAction(e){const t=this.allActions.at(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex++,this}previous(){return this.selectedFeatureIndex--,this}disableClusterBrowsing(){Wr(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;e?.type==="2d"?Oe(t)?(await Br(this),await jr(this)):K.getLogger(this).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):K.getLogger(this).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}handleViewClick(e){this._fetchFeaturesAndOpen(e)}_animationStateChange(e){this.zoomToLocation||(xe.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){const e=[this.selectedClusterBoundaryFeature,this._selectedClusterFeature].filter(Nt);this.view?.graphics?.removeMany(e),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(Oe(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=this.selectedFeature?[this.selectedFeature]:[])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i,view:o}=this;o&&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:o,featureViewModels:n}=this;if(i===null)return;const s=((i-1)*o+t)%t,l=s+o;n.slice(s,l).forEach((d,c)=>{d&&(d.graphic??=e[s+c])})}async _selectedFeatureChange(e){const{location:t,updateLocationEnabled:i,view:o}=this;if(!e||!o)return;if(this.browseClusterEnabled)return this._selectedClusterFeature&&(o.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),Oe(e)?void 0:(e.symbol=await so(e),this._selectedClusterFeature=e,void o.graphics.add(this._selectedClusterFeature));const n=e.sourceLayer?.type;if(n!=="map-image"&&n!=="imagery"&&n!=="imagery-tile"||(e.symbol=await so(e)),!i&&t||!e.geometry){if(i&&!e.geometry){await this.centerAtLocation();const s=o.center?.clone();s&&(this.location=s)}}else this.location=Yt(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}async _setFetchFeaturesPromises(e){const{pendingFeatures:t}=await this._fetchFeaturesWithController({mapPoint:e});this.promises=t}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i,view:o,spatialReference:n,map:s,timeZone:l,location:d}=this;if(Oe(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t?.length)return;const c=i.slice(),p=[];t.forEach((h,m)=>{if(!h)return;let f=null;if(c.some((g,v)=>(g&&g.graphic===h&&(f=g,c.splice(v,1)),!!f)),f)p[m]=f;else{const g=new bi({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:n,graphic:h===e?h:null,location:d,map:s,view:o,timeZone:l});p[m]=g}}),c.forEach(h=>h&&!h.destroyed&&h.destroy()),this._set("featureViewModels",p)}async _getScreenPoint(e,t){const{spatialReference:i,view:o}=this;if(!o)return null;await o?.when();const n=e?.spatialReference;return n&&i?(await Hn(n,i,null,t),o.toScreen(e)):null}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null}async _projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,event:i,signal:o}){return this.fetchFeatures(t??await this._getScreenPoint(e??this.location,{signal:o}),{signal:o,event:i})}_fetchFeaturesWithController({mapPoint:e,screenPoint:t,event:i}){this._cancelFetchingFeatures();const o=new AbortController,{signal:n}=o;this._fetchFeaturesController=o;const s=this._projectScreenPointAndFetchFeatures({mapPoint:e,screenPoint:t,signal:n,event:i});return s.catch(()=>{}).then(()=>{this._fetchFeaturesController=null}),s}async _fetchFeaturesAndOpen(e){const{mapPoint:t,screenPoint:i}=e,{view:o}=this;this.removeHandles(Jt),this.addHandles([y(()=>this.view?.scale,()=>this._debouncedLocationUpdate(t).catch(s=>{Et(s)||K.getLogger(this).error(s)})),at(()=>!this.visible,()=>{this.removeHandles(Jt)},{once:!0})],Jt);const{pendingFeatures:n}=await this._fetchFeaturesWithController({mapPoint:t,screenPoint:i,event:e});o?.popup&&"open"in o.popup&&o.popup.open({location:t??void 0,promises:n})}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}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?.type==="map-notes"||i?.type==="subtype-group"?i:t}_getHighlightTarget(e,t,i){if(Ur(t.type,i))return e;const o=e.getObjectId();if(o!=null)return o;const n=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||Rr:null,s=e.attributes;return s&&n&&s[n]||e}_mapIncludesLayer(e){return!!this.map?.allLayers?.includes(e)}async _highlightActiveFeature(){const e="highlight-active-feature";this.removeHandles(e);const{highlightEnabled:t,view:i,activeFeature:o,visible:n}=this;if(!(o&&i&&t&&n))return;const s=this._getHighlightLayer(o);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(i,s);this._highlightActiveFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightActiveFeaturePromise===l&&this.activeFeature&&this.highlightEnabled))return;const c=d.highlight(this._getHighlightTarget(o,s,i.type));this.addHandles(c,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this.removeHandles(e);const{selectedFeature:t,highlightEnabled:i,view:o,visible:n}=this;if(!(t&&o&&i&&n))return;const s=this._getHighlightLayer(t);if(!(s&&s instanceof Pi&&this._mapIncludesLayer(s)))return;const l=this._getLayerView(o,s);this._highlightSelectedFeaturePromise=l;const d=await l;if(!(d&&Ni(d)&&this._highlightSelectedFeaturePromise===l&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const c=d.highlight(this._getHighlightTarget(t,s,o.type));this.addHandles(c,e)}_updateFeatures(e){const{features:t}=this,i=e.filter(o=>!t.includes(o));i?.length&&(this.features=t.concat(i))}};r([a()],F.prototype,"_fetchFeaturesController",void 0),r([a({type:De})],F.prototype,"actions",void 0),r([a({readOnly:!0})],F.prototype,"active",null),r([a()],F.prototype,"activeFeature",void 0),r([a({readOnly:!0})],F.prototype,"allActions",null),r([a()],F.prototype,"autoCloseEnabled",void 0),r([a()],F.prototype,"browseClusterEnabled",void 0),r([a()],F.prototype,"content",void 0),r([a({type:De,readOnly:!0})],F.prototype,"defaultActions",null),r([a({type:Boolean})],F.prototype,"defaultPopupTemplateEnabled",void 0),r([a({readOnly:!0})],F.prototype,"featureCount",null),r([a()],F.prototype,"featurePage",void 0),r([a({value:[]})],F.prototype,"features",null),r([a()],F.prototype,"featuresPerPage",void 0),r([a()],F.prototype,"featureMenuOpen",void 0),r([a()],F.prototype,"featureViewModelAbilities",void 0),r([a({readOnly:!0})],F.prototype,"featureViewModels",void 0),r([a()],F.prototype,"highlightEnabled",void 0),r([a()],F.prototype,"includeDefaultActions",void 0),r([a({type:ai})],F.prototype,"location",null),r([a()],F.prototype,"map",null),r([a({readOnly:!0})],F.prototype,"pendingPromisesCount",null),r([a({readOnly:!0})],F.prototype,"promiseCount",null),r([a()],F.prototype,"promises",null),r([a({readOnly:!0})],F.prototype,"selectedClusterBoundaryFeature",void 0),r([a({value:null,readOnly:!0})],F.prototype,"selectedFeature",null),r([a({value:-1})],F.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],F.prototype,"selectedFeatureViewModel",null),r([a({readOnly:!0})],F.prototype,"state",null),r([a()],F.prototype,"timeZone",null),r([a()],F.prototype,"title",void 0),r([a()],F.prototype,"updateLocationEnabled",void 0),r([a()],F.prototype,"view",void 0),r([a()],F.prototype,"visible",void 0),r([a({readOnly:!0})],F.prototype,"waitingForContents",null),r([a({readOnly:!0})],F.prototype,"waitingForResult",null),r([a()],F.prototype,"zoomFactor",void 0),r([a()],F.prototype,"zoomToLocation",void 0),r([a()],F.prototype,"centerAtLocation",null),F=r([P("esri.widgets.Features.FeaturesViewModel")],F);const Ai=F;let fe=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!1,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.flow=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],fe.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"flow",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],fe.prototype,"spinner",void 0),fe=r([P("esri.widgets.Features.FeaturesVisibleElements")],fe);const en=fe,ro="selected-index",Zr=0,ao="features-spinner";function lo(e){return e?.declaredClass.startsWith("esri.layers.")??!1}let x=class extends Uo(oe){constructor(e,t){super(e,t),this._featureMenuIntersectionObserverCallback=([i])=>{i?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._spinner=null,this._feature=null,this._focusAbortController=null,this._drillInFlowItems=new ce,this._drillInWidget=new $r({flowItems:this._drillInFlowItems}),this._rootFlowItemNode=null,this._featureMenuViewportNode=null,this._actionBarMenuNode=null,this.collapsed=!1,this.featureNavigationTop=!1,this.headerActions=new De,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.responsiveActionsEnabled=!1,this.viewModel=new Ai,this.visibleElements=new en,this._renderAction=(i,o)=>{const n=this._getActionTitle(i),{type:s,active:l,uid:d,disabled:c,indicator:p}=i;return i.visible?u("calcite-action",{active:s==="toggle"&&i.value,appearance:"solid",bind:this,"data-action-uid":d,disabled:c,icon:this._getActionIcon(i),indicator:p,key:`action-${o}`,loading:l,onclick:this._triggerAction,scale:"s",text:n,title:this._hideActionText?n:void 0},this._getFallbackIcon(i)):null},this._openFeatureMenu=()=>{this.featureMenuOpen=!0,this._focusFlowItemNode("menu-flow-item")},this._previousFeature=()=>{this.viewModel.selectedFeatureIndex--},this._nextFeature=()=>{this.viewModel.selectedFeatureIndex++},this._handleFeatureMenuBack=()=>{this.featureMenuOpen&&(this._focusFlowItemNode("root-flow-item"),this.featureMenuOpen=!1)},this._displaySpinnerThrottled=pi(()=>this._displaySpinner(),Zr),this._addSelectedFeatureIndexHandle(),this.addHandles([this._displaySpinnerThrottled,y(()=>this.viewModel?.active,()=>this._toggleScreenLocationEnabled()),y(()=>this.viewModel?.active,i=>this._drillInWidget.closed=!i),y(()=>this.visibleElements?.closeButton,i=>this._drillInWidget.closable=i),y(()=>this.visibleElements?.spinner,i=>this._spinnerEnabledChange(i)),y(()=>this.viewModel?.view,(i,o)=>this._viewChange(i,o)),y(()=>this.viewModel?.view?.ready,(i,o)=>this._viewReadyChange(i??!1,o??!1)),y(()=>[this.viewModel?.waitingForResult,this.viewModel?.location],()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),y(()=>this.viewModel?.screenLocation,()=>this._closeOpenActionMenu()),y(()=>this.selectedFeatureWidget,()=>this._destroyDrillInFlowItemWidgets()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.title,i?.state]},()=>this._setTitleFromFeatureWidget()),y(()=>{const i=this.selectedFeatureWidget?.viewModel;return[i?.content,i?.state]},()=>this._setContentFromFeatureWidget()),y(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),this._drillInWidget.on("close",()=>this.close()),this._drillInWidget.on("exit",()=>this._destroyDrillInFlowItemWidgets()),this._drillInWidget.on("open-feature",({feature:i})=>this._openRelatedFeature(i)),this._drillInWidget.on("zoom-to-feature",({featureWidget:i})=>Yo(this.viewModel,i))])}loadDependencies(){return Ae({action:()=>w(()=>import("./calcite-action-2fclGKoO-DEiRzt3o.js"),__vite__mapDeps([131,122,2,3,4,5,6,7,8,106,110,113,107,108,9,119,114,1,105]),import.meta.url),"action-bar":()=>w(()=>import("./calcite-action-bar-ugh74qU5-C59I7NOF.js"),__vite__mapDeps([132,2,3,4,5,6,7,124,9,8,113,107,108,114,133,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),"action-group":()=>w(()=>import("./calcite-action-group-qlkUfh_o-H6U8Q6wA.js"),__vite__mapDeps([135,133,2,3,4,5,6,7,124,9,113,107,8,108,114,134,106,122,110,119,1,105,129,115,125,130]),import.meta.url),button:()=>w(()=>import("./calcite-button-Cm9_TJei-DvwKP8jU.js"),__vite__mapDeps([139,2,3,4,5,6,7,117,8,110,118,119,113,107,108,9,114,1,105,106]),import.meta.url),flow:()=>w(()=>import("./calcite-flow-CAdorlph-DQjwYgyL.js"),__vite__mapDeps([140,2,3,4,5,6,7,9,113]),import.meta.url),"flow-item":()=>w(()=>import("./calcite-flow-item-uRuGc3ks-Cp1dKuD0.js"),__vite__mapDeps([136,2,3,4,5,6,7,8,110,113,107,108,9,114,137,134,106,122,119,1,105,129,115,125,130,120]),import.meta.url),list:()=>w(()=>import("./calcite-list-rnu1YzAl-DCH8F59s.js"),__vite__mapDeps([109,2,3,4,5,6,7,8,110,9,111,112,113,114,107,108,115,1,116,117,118,119,105,106,120]),import.meta.url),"list-item":()=>w(()=>import("./calcite-list-item-VYBhSMxV-C8kSjE5V.js"),__vite__mapDeps([121,2,3,4,5,6,7,8,110,107,108,9,114,113,112,111,122,106,119,1,105]),import.meta.url),"list-item-group":()=>w(()=>import("./calcite-list-item-group-CuQ2MPLW-CwdP7Iq_.js"),__vite__mapDeps([141,2,3,4,5,6,7,110,111]),import.meta.url),loader:()=>w(()=>import("./calcite-loader-CtpHSU2--B8aaTEnB.js"),__vite__mapDeps([104,105,2,3,4,5,6,7,106,107,8,108,9]),import.meta.url)})}destroy(){this._destroyDrillInFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver?.disconnect(),this._drillInWidget?.destroy(),this._focusAbortController?.abort()}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;const e=this.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.visibleElements.collapseButton&&!!this.title&&!!this.content}get active(){return this.viewModel.active}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get icon(){return null}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}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 location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedDrillInFeature(){const e=Array.from(this._drillInFlowItems).at(-1);if(!e)return null;const{flowType:t}=e;return t==="feature-association"||t==="feature-relationship"?e.graphic??null:null}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,headingLevel:t,_drillInFlowItems:i,timeZone:o,spatialReference:n,map:s}=this,{selectedFeatureViewModel:l}=this.viewModel,d={title:!1};return l?(e?(e.viewModel=l,e.visibleElements=d):this._feature=new Zo({flowItems:i,headingLevel:t+1,timeZone:o,spatialReference:n,map:s,viewModel:l,visibleElements:d}),this._feature):null}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=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}blur(){const{active:e}=this.viewModel;e?this._rootFlowItemNode?.blur():K.getLogger(this).warn("Features can only be blurred when currently active.")}clear(){return this.viewModel.clear()}close(){this.viewModel.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e?this._focusFlowItemNode(this.featureMenuOpen?"menu-flow-item":"root-flow-item"):K.getLogger(this).warn("Features can only be focused when currently active.")}next(){return this.viewModel.next()}open(e){this.removeHandles(ro);const t={collapsed:e?.collapsed??!1};this.set(t),this.viewModel.open(e),this.addHandles(at(()=>!this.viewModel.waitingForResult,()=>this._addSelectedFeatureIndexHandle(),{once:!0}))}previous(){return this.viewModel.previous()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){return u("div",{bind:this,class:this.classes(Z.base,M.widget,M.panel),onkeydown:this._onMainKeydown},this._renderHeader(),this._renderContentContainer())}_renderFeatureNavigation(){return[this._renderPagination(),this._renderFeatureMenuButton()]}_renderHeader(){return!this.featureMenuOpen&&this.featureNavigationTop&&this._featureNavigationVisible?u("div",{class:Z.header,key:"header-actions"},this._renderFeatureNavigation()):null}_renderFooter(){return this.featureMenuOpen||this.featureNavigationTop||!this._featureNavigationVisible?null:u("div",{class:Z.footer,key:"footer-actions",slot:"footer"},this._renderFeatureNavigation())}_renderFeatureMenuButton(){const{messages:e,viewModel:t}=this,{featureCount:i,selectedFeatureIndex:o,pendingPromisesCount:n}=t;return u("calcite-action",{appearance:"solid",bind:this,icon:"list",key:"feature-menu-button",label:e.selectFeature,loading:n>0,onclick:this._openFeatureMenu,scale:"s",text:pe(e.pageText,{index:Be(o+1),total:Be(i)}),textEnabled:!0,title:e.selectFeature})}_renderPagination(){const{previous:e,next:t}=this.messagesCommon.pagination;return u("calcite-action-bar",{class:Z.paginationActionBar,expandDisabled:!0,key:"pagination-action-bar",layout:"horizontal",overflowActionsDisabled:!0,scale:"s"},u("calcite-action-group",{scale:"s"},u("calcite-action",{appearance:"solid",class:Z.paginationPrevious,icon:"chevron-left",iconFlipRtl:!0,label:e,onclick:this._previousFeature,scale:"s",text:e,title:e}),u("calcite-action",{appearance:"solid",icon:"chevron-right",iconFlipRtl:!0,label:t,onclick:this._nextFeature,scale:"s",text:t,title:t})))}_renderFeatureMenuItem(e){const{selectedFeatureViewModel:t,featureViewModels:i}=this.viewModel,o=e===t,n=i.indexOf(e);return u("calcite-list-item",{bind:this,"data-feature-index":n,key:`feature-menu-item-${e.uid}`,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onmouseleave:this._removeActiveFeature,onmouseover:this._setActiveFeature,selected:o,onCalciteListItemSelect:this._selectFeature},u("span",{innerHTML:e.title||this.messagesCommon.untitled,slot:"content"}))}_groupResultsByLayer(){const{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(i=>{const o=i?.graphic;if(!o)return;const{layer:n,sourceLayer:s}=o,l=(lo(n)?n:null)||(lo(s)?s:null),d=t.get(l)??[];t.set(l,[...d,i])}),t}_renderFeatureMenu(){const{featureViewModels:e}=this.viewModel,t=this._groupResultsByLayer();return e.length?u("calcite-list",{selectionAppearance:"icon",selectionMode:"single"},Array.from(t.keys(),i=>{const o=t.get(i)?.map(s=>this._renderFeatureMenuItem(s)),n=i?i.title??this.messagesCommon.untitled:null;return this.visibleElements.featureListLayerTitle&&n!==null?u("calcite-list-item-group",{heading:n,key:i?.uid||"map-graphics"},o):o})):null}_renderHeaderAction(e,t){const i=e.title||"";return e.visible?u("calcite-action",{active:e.type==="toggle"&&e.value,appearance:"solid",bind:this,"data-action-uid":e.uid,disabled:e.disabled,icon:e.icon??void 0,indicator:e.indicator,key:`header-action-${t}`,loading:e.active,onclick:this._triggerHeaderAction,slot:"header-actions-end",text:i,title:i}):null}_renderHeaderActions(){return this.headerActions.map((e,t)=>this._renderHeaderAction(e,t)).toArray()}_renderContentFeature(){const{headingLevel:e,visibleElements:t,_isCollapsed:i,_collapseEnabled:o,featureNavigationTop:n}=this,{title:s,active:l}=this.viewModel,d=t.heading&&s?s:"";return u("calcite-flow-item",{afterCreate:this._storeRootFlowItemNode,bind:this,class:this.classes({[Z.contentFeature]:!0,[Z.flowItemCollapsed]:i}),closable:t.closeButton,closed:!l,collapsed:i,collapseDirection:n?"down":"up",collapsible:o,headingLevel:e,key:"root-flow-item",onCalciteFlowItemClose:this.close,onCalciteFlowItemToggle:this._handleCollapseToggle},d?u(_i,{class:this.classes(Z.featuresHeading,M.heading),innerHTML:d,key:"header-content",level:this.headingLevel,slot:"header-content"}):null,this._renderHeaderActions(),this._renderActionBar(),i?null:u("div",{class:this.classes(Z.container,Z.contentContainer)},this._renderContent()),this._renderFooter())}_renderFeatureMenuContainer(){const{viewModel:e,featureMenuOpen:t,messages:i,messagesCommon:o}=this,{active:n,featureViewModels:s,pendingPromisesCount:l}=e;return t?u("calcite-flow-item",{afterCreate:this._storeFeatureMenuFlowItemNode,bind:this,closable:!1,closed:!n,description:pe(i.total,{total:s.length}),heading:i.selectFeature,key:"feature-menu",loading:e.waitingForContents,onCalciteFlowItemBack:d=>{d.preventDefault(),this._handleFeatureMenuBack()}},l>0?u("calcite-loader",{class:Z.loader,inline:!0,key:"feature-menu-loader",label:o.loading,slot:"header-actions-end"}):null,u("div",{class:Z.container},this._renderFeatureMenu()),u("div",{afterCreate:this._featureMenuIntersectionObserverCreated,bind:this,class:Z.featureMenuObserver}),u("calcite-button",{appearance:"transparent",onclick:this._handleFeatureMenuBack,slot:"footer-actions",width:"full"},o.back)):null}_renderContentContainer(){const e=[this._renderContentFeature(),this._renderFeatureMenuContainer(),this._drillInWidget.render()];return this.visibleElements.flow?u("calcite-flow",{key:"content-container"},e):e}_getFallbackIcon(e){const{className:t,icon:i}=e;if(i)return null;const o=Zn({action:e,feature:this.selectedFeature}),n={[Z.icon]:!!t,[Z.actionImage]:!!o};return t&&(n[t]=!0),o||t?u("span",{"aria-hidden":"true",class:this.classes(Z.icon,n),key:"icon",styles:Un(o)}):null}_renderActionBar(){return!this._isCollapsed&&this.visibleElements.actionBar&&this.viewModel.allActions?.length?u("calcite-action-bar",{expandDisabled:!0,expanded:!this._hideActionText,key:"header-action-bar",scale:"s",slot:"action-bar"},u("calcite-action-group",{afterCreate:e=>this._actionBarMenuNode=e,overlayPositioning:"fixed",scale:"s"},this._renderActions())):null}_renderActions(){return this.viewModel.allActions.toArray().map(this._renderAction)}_renderContent(){const e=this.viewModel?.content;return e?typeof e=="string"?u("div",{class:D.contentNode,innerHTML:e,key:e}):this.renderNodeContent(e):null}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){await e.viewModel.updateGeometry();const t=e.graphic,i=t?.geometry;if(i==null||t==null)return;this._destroyDrillInFlowItemWidgets(),await this.viewModel.zoomTo({target:i});const o=Yt(i);this.open({features:[t],location:o??void 0})}async _focusFlowItemNode(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;await ke(vo(t));const i=e==="menu-flow-item"?this._featureMenuViewportNode:this._rootFlowItemNode;Tn(i)}_storeRootFlowItemNode(e){this._rootFlowItemNode=e}_storeFeatureMenuFlowItemNode(e){this._featureMenuViewportNode=e}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features?.[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this._handleFeatureMenuBack()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionIcon(e){return e.icon?e.icon:e.image||e.className?void 0:"question"}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:o}=this,{id:n}=e,s=i?.attributes,l=e.title??"",d=n==="zoom-to-feature"?pe(l,{messages:t}):n==="remove-selected-feature"?pe(l,{messages:o}):n==="zoom-to-clustered-features"||n==="browse-clustered-features"?pe(l,{messages:t}):e.title;return d&&s?pe(d,s):d??""}_onMainKeydown(e){const{key:t}=e;t==="ArrowLeft"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&this._featureMenuViewportNode.scrollContentTo({top:0})}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_setTitleFromFeatureWidget(){const{selectedFeatureWidget:e,messagesCommon:t}=this,i=e?.viewModel;e&&(this.viewModel.title=i?.state==="error"?t?.errorMessage:i?.title||"")}_addSelectedFeatureIndexHandle(){const e=y(()=>this.viewModel?.selectedFeatureIndex,(t,i)=>this._selectedFeatureIndexUpdated(t,i));this.addHandles(e,ro)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this.viewModel;i&&e!==t&&e!==-1&&(this._destroyDrillInFlowItemWidgets(),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_triggerHeaderAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,o=this.headerActions.find(({uid:n})=>n===i);o&&!o.disabled&&(o?.type==="toggle"&&(o.value=!o.value),this.emit("trigger-header-action",{action:o}))}_triggerAction(e){const t=e.currentTarget;if(t.disabled)return;const i=t.dataset.actionUid,{allActions:o}=this.viewModel,n=o.findIndex(l=>l.uid===i),s=o.at(n);s&&s.type==="toggle"&&(s.value=!s.value),this.viewModel.triggerAction(n)}_createSpinner(e){e&&(this._spinner=new Nr({view:e}),e.ui.add(this._spinner,{key:ao,position:"manual",internal:!0}))}_wireUpView(e){this._destroySpinner(),e&&this.visibleElements?.spinner&&this._createSpinner(e)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_viewReadyChange(e,t){e?this._wireUpView(this.viewModel?.view):t&&this.viewModel.clear()}_viewChange(e,t){e&&t&&this.viewModel.clear()}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,!e.destroyed&&e.destroy()),this._feature=null}_closeOpenActionMenu(){const{_actionBarMenuNode:e}=this;e&&(e.menuOpen=!1)}_destroyDrillInFlowItemWidgets(){this._drillInFlowItems.drain(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_toggleScreenLocationEnabled(){const{viewModel:e}=this;e&&(e.screenLocationEnabled=e.active)}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i&&t?e.show({location:t}):e.hide()}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t?.ui?.remove(e,ao),e.destroy(),this._spinner=null)}_spinnerEnabledChange(e){this._destroySpinner(),e&&this._createSpinner(this.viewModel?.view)}};r([a()],x.prototype,"_drillInFlowItems",void 0),r([a()],x.prototype,"_hideActionText",null),r([a()],x.prototype,"_featureNavigationVisible",null),r([a()],x.prototype,"_isCollapsed",null),r([a()],x.prototype,"_collapseEnabled",null),r([a({readOnly:!0})],x.prototype,"active",null),r([a()],x.prototype,"collapsed",void 0),r([a()],x.prototype,"content",null),r([a()],x.prototype,"icon",null),r([a()],x.prototype,"featureMenuOpen",null),r([a()],x.prototype,"featureNavigationTop",void 0),r([a()],x.prototype,"features",null),r([a()],x.prototype,"goToOverride",null),r([a({type:De})],x.prototype,"headerActions",void 0),r([a()],x.prototype,"headingLevel",void 0),r([a()],x.prototype,"location",null),r([a()],x.prototype,"label",null),r([a()],x.prototype,"map",null),r([a(),Y("esri/widgets/Features/t9n/Features")],x.prototype,"messages",void 0),r([a(),Y("esri/t9n/common")],x.prototype,"messagesCommon",void 0),r([a()],x.prototype,"promises",null),r([a()],x.prototype,"responsiveActionsEnabled",void 0),r([a({readOnly:!0})],x.prototype,"selectedFeature",null),r([a({readOnly:!0})],x.prototype,"selectedDrillInFeature",null),r([a()],x.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],x.prototype,"selectedFeatureWidget",null),r([a()],x.prototype,"spatialReference",null),r([a()],x.prototype,"title",null),r([a()],x.prototype,"timeZone",null),r([a()],x.prototype,"updateLocationEnabled",null),r([a()],x.prototype,"view",null),r([a({type:Ai}),qo(["triggerAction","trigger-action"])],x.prototype,"viewModel",void 0),r([a({type:en,nonNullable:!0})],x.prototype,"visibleElements",void 0),r([a()],x.prototype,"visible",null),x=r([P("esri.widgets.Features")],x);const Gr=x,de="esri-popup",Le=`${de}--is-docked`,j={base:de,baseHidden:`${de}--hidden`,main:`${de}__main-container`,shadow:`${de}--shadow`,isDocked:Le,isDockedTopLeft:`${Le}-top-left`,isDockedTopCenter:`${Le}-top-center`,isDockedTopRight:`${Le}-top-right`,isDockedBottomLeft:`${Le}-bottom-left`,isDockedBottomCenter:`${Le}-bottom-center`,isDockedBottomRight:`${Le}-bottom-right`,alignTopCenter:`${de}--aligned-top-center`,alignBottomCenter:`${de}--aligned-bottom-center`,alignTopLeft:`${de}--aligned-top-left`,alignBottomLeft:`${de}--aligned-bottom-left`,alignTopRight:`${de}--aligned-top-right`,alignBottomRight:`${de}--aligned-bottom-right`,pointer:`${de}__pointer`,pointerDirection:`${de}__pointer-direction`};let si=class extends Ai{constructor(e){super(e)}};si=r([P("esri.widgets.Popup.PopupViewModel")],si);const tn=si;let _e=class extends ge{constructor(){super(...arguments),this.actionBar=!0,this.closeButton=!0,this.collapseButton=!0,this.featureNavigation=!0,this.featureListLayerTitle=!0,this.heading=!0,this.spinner=!0}};r([a({type:Boolean,nonNullable:!0})],_e.prototype,"actionBar",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"closeButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"collapseButton",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureNavigation",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"featureListLayerTitle",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"heading",void 0),r([a({type:Boolean,nonNullable:!0})],_e.prototype,"spinner",void 0),_e=r([P("esri.widgets.Popup.PopupVisibleElements")],_e);const ri=_e,Qr=200,co={buttonEnabled:!0,position:"auto",breakpoint:{width:544}};let k=class extends oe{constructor(e,t){super(e,t),this._dockAction=new pt({id:"popup-dock-action"}),this._featuresWidget=new Gr({responsiveActionsEnabled:!0}),this._containerNode=null,this._mainContainerNode=null,this._pointerOffsetInPx=16,this._focusAbortController=null,this.alignment="auto",this.dockEnabled=!1,this.headingLevel=2,this.messages=null,this.viewModel=new tn,this.visibleElements=new ri}initialize(){this.addHandles([y(()=>[this.viewModel?.view?.widthBreakpoint,this.dockEnabled],()=>this._handleDockIcon(),$),y(()=>[this.dockEnabled,this.messages?.undock,this.messages?.dock],()=>this._handleDockEnabled(),$),y(()=>this.dockOptions,e=>{const{_dockAction:t}=this,i=this._featuresWidget.headerActions;i.remove(t),e.buttonEnabled&&i.add(t)},$),y(()=>this.viewModel?.screenLocation,()=>this._positionContainer()),y(()=>[this.viewModel?.active,this.dockEnabled],()=>this._toggleScreenLocationEnabled()),y(()=>[this.viewModel?.screenLocation,this.viewModel?.view?.padding,this.viewModel?.view?.size,this.viewModel?.active,this.viewModel?.location,this.alignment],()=>this.reposition()),y(()=>this.viewModel?.view?.size,(e,t)=>this._updateDockEnabledForViewSize(e,t)),y(()=>this.viewModel?.view,(e,t)=>this._viewChange(e,t)),y(()=>this.viewModel?.view?.ready,(e,t)=>this._viewReadyChange(e??!1,t??!1)),y(()=>this.viewModel,()=>this._featuresWidget.viewModel=this.viewModel,$),y(()=>this._featureNavigationTop,e=>this._featuresWidget.featureNavigationTop=e,$),y(()=>this.headingLevel,e=>this._featuresWidget.headingLevel=e,$),y(()=>this.visibleElements.actionBar,e=>this._featuresWidget.visibleElements.actionBar=!!e,$),y(()=>this.visibleElements.closeButton,e=>this._featuresWidget.visibleElements.closeButton=!!e,$),y(()=>this.visibleElements.collapseButton,e=>this._featuresWidget.visibleElements.collapseButton=!!e,$),y(()=>this.visibleElements.heading,e=>this._featuresWidget.visibleElements.heading=!!e,$),y(()=>this.visibleElements.spinner,e=>this._featuresWidget.visibleElements.spinner=!!e,$),y(()=>this.visibleElements.featureNavigation,e=>this._featuresWidget.visibleElements.featureNavigation=!!e,$),y(()=>this.visibleElements.featureListLayerTitle,e=>this._featuresWidget.visibleElements.featureListLayerTitle=!!e,$),dt(()=>this._featuresWidget,"trigger-header-action",e=>{e.action===this._dockAction&&(this.dockEnabled=!this.dockEnabled)})])}normalizeCtorArgs(e){const t={...e};return e?.visibleElements!=null&&(t.visibleElements=new ri(e.visibleElements),e.collapseEnabled!=null&&(t.visibleElements.collapseButton=e.collapseEnabled),e.spinnerEnabled!=null&&(t.visibleElements.spinner=e.spinnerEnabled)),t}destroy(){this._dockAction.destroy(),this._featuresWidget?.destroy(),this._focusAbortController?.abort()}get _featureNavigationTop(){const{currentAlignment:e,currentDockPosition:t}=this;return e==="bottom-left"||e==="bottom-center"||e==="bottom-right"||t==="top-left"||t==="top-center"||t==="top-right"}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}get active(){return this.viewModel.active}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=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 collapsed(){return this._featuresWidget.collapsed}set collapsed(e){this._featuresWidget.collapsed=e}get collapseEnabled(){return gt(K.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton}set collapseEnabled(e){gt(K.getLogger(this),"collapseEnabled",{replacement:"PopupVisibleElements.collapseButton",version:"4.29"}),this.visibleElements.collapseButton=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||co}set dockOptions(e){const t={...co},i=this.viewModel?.view?.breakpoints,o={};i&&(o.width=i.xsmall,o.height=i.xsmall);const n={...t,...e},s={...t.breakpoint,...o},{breakpoint:l}=n;typeof l=="object"?n.breakpoint={...s,...l}:l&&(n.breakpoint=s),this._set("dockOptions",n),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get featureMenuOpen(){return this.viewModel.featureMenuOpen}set featureMenuOpen(e){this.viewModel.featureMenuOpen=e}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 icon(){return"popup"}set icon(e){this._overrideIfSome("icon",e)}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){return this.messages?.widgetLabel??""}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(){return this._featuresWidget.selectedFeatureWidget}get spinnerEnabled(){return gt(K.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner}set spinnerEnabled(e){gt(K.getLogger(this),"spinnerEnabled",{replacement:"PopupVisibleElements.spinner",version:"4.29"}),this.visibleElements.spinner=e}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}blur(){const{active:e}=this.viewModel;e||K.getLogger(this).warn("Popup can only be blurred when currently active."),this._featuresWidget.blur()}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||K.getLogger(this).warn("Popup can only be focused when currently active."),this._handleFocus()}next(){return this.viewModel.next()}open(e){const t=!!e&&!!e.featureMenuOpen,i={collapsed:!!e&&!!e.collapsed,featureMenuOpen:t};this.set(i),this.viewModel.open(e),e?.shouldFocus&&this._handleFocus(!0)}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i}=this,{active:o,screenLocation:n}=this.viewModel,s=o&&e,l=o&&!e,d=this.selectedFeature?.layer?.title,c=this.selectedFeature?.layer?.id,p={[j.alignTopCenter]:t==="top-center",[j.alignBottomCenter]:t==="bottom-center",[j.alignTopLeft]:t==="top-left",[j.alignBottomLeft]:t==="bottom-left",[j.alignTopRight]:t==="top-right",[j.alignBottomRight]:t==="bottom-right",[j.isDocked]:s,[j.shadow]:l,[j.isDockedTopLeft]:i==="top-left",[j.isDockedTopCenter]:i==="top-center",[j.isDockedTopRight]:i==="top-right",[j.isDockedBottomLeft]:i==="bottom-left",[j.isDockedBottomCenter]:i==="bottom-center",[j.isDockedBottomRight]:i==="bottom-right"};return u("div",{afterCreate:this._positionContainer,afterUpdate:this._positionContainer,bind:this,class:this.classes(j.base,p,{[j.baseHidden]:!n&&!e}),"data-layer-id":c,"data-layer-title":d,role:"presentation"},o?[this._renderMainContainer(),this._renderPointer()]:null)}_renderPointer(){return this.dockEnabled?null:u("div",{class:j.pointer,key:"popup-pointer",role:"presentation"},u("div",{class:this.classes(j.pointerDirection,j.shadow)}))}_renderMainContainer(){const{dockEnabled:e}=this,t={[j.shadow]:e};return u("div",{afterCreate:this._setMainContainerNode,afterUpdate:this._setMainContainerNode,bind:this,class:this.classes(j.main,M.widget,t)},this._featuresWidget.render())}_getAnimationDurationMS(){const{_containerNode:e}=this;return e?1e3*parseFloat(window.getComputedStyle(e).animationDuration):Qr}async _handleFocus(e=!1){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const t=this._focusAbortController.signal;e&&await yo(()=>this.viewModel?.active===!0,{signal:t}),await ke(vo(t)),await ke($t(this._getAnimationDurationMS(),t)),this._featuresWidget.focus()}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:o,side:n,view:s}=e;if(isNaN(i)||isNaN(t)||!s||!o)return!1;const l=s.padding;return n==="right"&&o.x+i/2>s.width-l.right||n==="left"&&o.x-i/2s.height-l.bottom}_calculateAutoAlignment(e){if(e!=="auto")return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:o,viewModel:n}=this,{screenLocation:s,view:l}=n;if(s==null||!l||!i)return"top-center";function d(b){return parseInt(b.replaceAll(/[^-\d.]/g,""),10)}const c=o?window.getComputedStyle(o,null):null,p=c?d(c.getPropertyValue("max-height")):0,h=c?d(c.getPropertyValue("height")):0,{height:m,width:f}=i.getBoundingClientRect(),g=f+t,v=Math.max(m,p,h)+t,I=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"right",view:l}),C=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"left",view:l}),_=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"top",view:l}),T=this._isOutsideView({popupHeight:v,popupWidth:g,screenLocation:s,side:"bottom",view:l});return C?_?"bottom-right":"top-right":I?_?"bottom-left":"top-left":_?T?"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 be(this.container)&&t.reverse(),e?.replace(/leading/gi,t[0]).replaceAll(/trailing/gi,t[1])}_callDockPosition(e){return typeof e=="function"?e.call(this):e}_getDockPosition(){return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition(this.dockOptions?.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_calculateAutoDockPosition(e){if(e!=="auto")return e;const t=this.viewModel?.view,i=be(this.container)?"top-left":"top-right";if(!t)return i;const o=t.padding||{left:0,right:0,top:0,bottom:0},n=t.width-o.left-o.right,{breakpoints:s}=t;return s&&n<=s.xsmall?"bottom-center":i}_getDockIcon(){const e=this._getDockPosition();if(this.dockEnabled)return"minimize";switch(e){case"top-left":case"bottom-left":return"dock-left";case"top-center":return"maximize";case"bottom-center":return"dock-bottom";default:return"dock-right"}}_handleDockIcon(){this._dockAction.icon=this._getDockIcon()}_handleDockEnabled(){this._dockAction.title=this.dockEnabled?this.messages?.undock:this.messages?.dock}_setMainContainerNode(e){this._mainContainerNode=e}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!this._containerNode)return;const{screenLocation:t}=this.viewModel,{width:i}=this._containerNode.getBoundingClientRect(),o=this._calculatePositionStyle(t,i);o&&Object.assign(this._containerNode.style,o)}_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,o){const{currentAlignment:n,_pointerOffsetInPx:s}=this;if(!i)return;const{padding:l}=i,d=o/2,c=i.height-t,p=i.width-e;return n==="bottom-center"?{top:t+s-l.top,left:e-d-l.left}:n==="top-left"?{bottom:c+s-l.bottom,right:p+s-l.right}:n==="bottom-left"?{top:t+s-l.top,right:p+s-l.right}:n==="top-right"?{bottom:c+s-l.bottom,left:e+s-l.left}:n==="bottom-right"?{top:t+s-l.top,left:e+s-l.left}:n==="top-center"?{bottom:c+s-l.bottom,left:e-d-l.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:o}=this;if(!o)return;if(i)return{left:"",top:"",right:"",bottom:""};if(e==null||!t)return;const n=this._calculateFullWidth(t),s=this._calculateAlignmentPosition(e.x,e.y,o,n);return s?{top:s.top!==void 0?`${s.top}px`:"auto",left:s.left!==void 0?`${s.left}px`:"auto",bottom:s.bottom!==void 0?`${s.bottom}px`:"auto",right:s.right!==void 0?`${s.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){e?this._wireUpView():t&&(this.close(),this.clear())}_wireUpView(){this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[o,n]=e,[s,l]=t,{width:d=0,height:c=0}=i??{};return o<=d&&s>d||o>d&&s<=d||n<=c&&l>c||n>c&&l<=c}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.viewModel?.view?.padding||{left:0,right:0,top:0,bottom:0},o=i.left+i.right,n=i.top+i.bottom,s=[],l=[];s[0]=e[0]-o,s[1]=e[1]-n,l[0]=t[0]-o,l[1]=t[1]-n;const{dockOptions:d}=this,c=d.breakpoint;this._dockingThresholdCrossed(s,l,c)&&this._setDockEnabledForViewSize(d),this._setCurrentDockPosition()}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){const t=e.breakpoint,i=this.viewModel?.view?.ui;if(!i)return!1;const{width:o,height:n}=i;if(isNaN(o)||isNaN(n)||!t)return!1;const s=t.hasOwnProperty("width")&&o<=(t.width??0),l=t.hasOwnProperty("height")&&n<=(t.height??0);return s||l}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}};r([a({readOnly:!0})],k.prototype,"_featureNavigationTop",null),r([a()],k.prototype,"actions",null),r([a({readOnly:!0})],k.prototype,"active",null),r([a()],k.prototype,"alignment",void 0),r([a()],k.prototype,"autoCloseEnabled",null),r([a()],k.prototype,"defaultPopupTemplateEnabled",null),r([a()],k.prototype,"content",null),r([a()],k.prototype,"collapsed",null),r([a()],k.prototype,"collapseEnabled",null),r([a({readOnly:!0})],k.prototype,"currentAlignment",null),r([a({readOnly:!0})],k.prototype,"currentDockPosition",null),r([a()],k.prototype,"dockOptions",null),r([a()],k.prototype,"dockEnabled",void 0),r([a({readOnly:!0})],k.prototype,"featureCount",null),r([a()],k.prototype,"featureMenuOpen",null),r([a()],k.prototype,"features",null),r([a()],k.prototype,"goToOverride",null),r([a()],k.prototype,"headingLevel",void 0),r([a()],k.prototype,"highlightEnabled",null),r([a()],k.prototype,"icon",null),r([a()],k.prototype,"location",null),r([a()],k.prototype,"label",null),r([a(),Y("esri/widgets/Popup/t9n/Popup")],k.prototype,"messages",void 0),r([a()],k.prototype,"promises",null),r([a({readOnly:!0})],k.prototype,"selectedFeature",null),r([a()],k.prototype,"selectedFeatureIndex",null),r([a({readOnly:!0})],k.prototype,"selectedFeatureWidget",null),r([a()],k.prototype,"spinnerEnabled",null),r([a()],k.prototype,"title",null),r([a()],k.prototype,"updateLocationEnabled",null),r([a()],k.prototype,"view",null),r([a({type:tn}),qo(["triggerAction","trigger-action"])],k.prototype,"viewModel",void 0),r([a()],k.prototype,"visible",null),r([a({type:ri,nonNullable:!0})],k.prototype,"visibleElements",void 0),k=r([P("esri.widgets.Popup")],k);const Md=k;export{Md as default}; diff --git a/custom-toc-highlight/assets/PortalItem-CctGdnxF-C7IJrZYq.js b/custom-toc-highlight/assets/PortalItem-CctGdnxF-CfFOGshS.js similarity index 97% rename from custom-toc-highlight/assets/PortalItem-CctGdnxF-C7IJrZYq.js rename to custom-toc-highlight/assets/PortalItem-CctGdnxF-CfFOGshS.js index 006747f5..427fa332 100644 --- a/custom-toc-highlight/assets/PortalItem-CctGdnxF-C7IJrZYq.js +++ b/custom-toc-highlight/assets/PortalItem-CctGdnxF-CfFOGshS.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./resourceUtils-rTM6Iemx-BROWZCZ1.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css"])))=>i.map(i=>d[i]); -import{_ as m}from"./main-ugzBrWNm.js";import{v as a,ad as j,bA as T,aO as L,n as O,bw as _,cv as q,r as R,P as l,o as g,cw as C,Y as D,M as F,S as o,a0 as N,i as b,j as U,cx as P,a1 as E,cy as $,aB as J}from"./story-BfX8CRfG.js";let p=class extends U{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e?.portalItem&&e.path?{...e,path:x(e.path,e.portalItem)}:e}set path(e){e!=null&&P(e)?E.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return x(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const r=this.cdnUrl;if(r==null)throw new g("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(r,{responseType:e,query:{token:this.portalItem.apiKey,_ts:t?.cacheBust?Date.now():null},signal:t?.signal})}async update(e,t){const{addOrUpdateResources:r}=await m(()=>import("./resourceUtils-rTM6Iemx-BROWZCZ1.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return await r(this.portalItem,[{resource:this,content:e,compress:t?.compress,access:t?.access}],"update",t),this}hasPath(){return this.path!=null}};function x(e,t){return e==null?e:(e=e.replace(/^\/+/,""),t!=null&&P(e)&&(e=$(e,t.itemUrl)),e?.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}a([o()],p.prototype,"portalItem",void 0),a([o({type:String,value:null})],p.prototype,"path",null),a([j("path")],p.prototype,"_castPath",null),a([o({type:String,readOnly:!0})],p.prototype,"url",null),a([o({type:String,readOnly:!0})],p.prototype,"cdnUrl",null),a([o({type:String,readOnly:!0})],p.prototype,"itemRelativeUrl",null),p=a([b("esri.portal.PortalItemResource")],p);const K=p;let y=class extends U{constructor(e){super(e),this.created=null,this.rating=null}};a([o()],y.prototype,"created",void 0),a([o()],y.prototype,"rating",void 0),y=a([b("esri.portal.PortalRating")],y);const f=y;var c;const M=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),A=new Set(["KML","GeoJson","CSV"]);let s=c=class extends T(J){static from(e){return L(c,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,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.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let r=e;return e==="Feature Service"||e==="Feature Collection"?r=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":e==="Image Service"?r=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":e==="Scene Service"?r="Scene Layer":e==="Video Service"?r="Video Layer":e==="Scene Package"?r="Scene Layer Package":e==="Stream Service"?r="Feature Layer":e==="Geoprocessing Service"?r=t.includes("Web Tool")?"Tool":"Geoprocessing Service":e==="Geoenrichment Service"?r="GeoEnrichment Service":e==="Geocoding Service"?r="Locator":e==="Microsoft Powerpoint"?r="Microsoft PowerPoint":e==="GeoJson"?r="GeoJSON":e==="Globe Service"?r="Globe Layer":e==="Vector Tile Service"?r="Tile Layer":e==="netCDF"?r="NetCDF":e==="Map Service"?r=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e?.toLowerCase().includes("add in")?r=e.replaceAll(/(add in)/gi,"Add-In"):e==="datastore catalog service"?r="Big Data File Share":e==="Compact Tile Package"?r="Tile Package (tpkx)":e==="Raster function template"?r="Raster Function Template":e==="OGCFeatureServer"?r="OGC Feature Layer":e==="web mapping application"&&t.includes("configurableApp")?r="Instant App":e==="Insights Page"?r="Insights Report":e==="Excalibur Imagery Project"?r="Excalibur Project":e==="3DTiles Service"?r="3D tiles layer":e==="3DTiles Package"&&(r="3D tiles package"),r}readExtent(e){return e&&e.length?new O(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type?.toLowerCase()||"",t=this.typeKeywords||[],r="esri/images/portal/",n="16";let i,u=!1,d=!1,v=!1,w=!1,h=!1,k=!1,S=!1,I=!1;return e.indexOf("service")>0||e==="feature collection"||e==="kml"||e==="wms"||e==="wmts"||e==="wfs"?(u=t.includes("Hosted Service"),e==="feature service"||e==="feature collection"||e==="kml"||e==="wfs"?(d=t.includes("Table"),v=t.includes("Route Layer"),w=t.includes("Markup"),h=t.includes("Spatiotemporal"),k=t.includes("UtilityNetwork"),i=h&&d?"spatiotemporaltable":d?"table":v?"routelayer":w?"markup":h?"spatiotemporal":k?"utilitynetwork":u?"featureshosted":"features"):e==="map service"||e==="wms"||e==="wmts"?(h=t.includes("Spatiotemporal"),S=t.includes("Relational"),i=h||S?"mapimages":u||t.includes("Tiled")||e==="wmts"?"maptiles":"mapimages"):i=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==="vector tile service"?"vectortile":e==="datastore catalog service"?"datastorecollection":e==="geocoding service"?"geocodeservice":e==="video service"?t.includes("Live Stream")?"livestreamvideolayer":"videolayer":e==="geoprocessing service"?t.includes("Web Tool")?"tool":"layers":e==="geodata service"?"geodataservice":e==="3dtiles service"?t.includes("3DObject")?"3dobjecttileslayer":t.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):e==="web map"||e==="cityengine web scene"?i="maps":e==="web scene"?i=t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":e==="web mapping application"&&t.includes("configurableApp")?i="instantapps":e==="web mapping application"||e==="mobile application"||e==="application"||e==="operation view"||e==="desktop application"?i="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")?i="mapsgray":e==="service definition"||e==="shapefile"||e==="cad drawing"||e==="geojson"||e==="netcdf"||e==="administrative report"?i="datafiles":e==="360 vr experience"?i="360vr":e==="explorer add in"||e==="desktop add in"||e==="windows viewer add in"||e==="windows viewer configuration"?i="appsgray":e==="arcgis pro add in"||e==="arcgis pro configuration"?i="addindesktop":e==="pdf"?i="pdf":e==="microsoft word"?i="word":e==="microsoft excel"?i="excel":e==="microsoft powerpoint"?i="ppt":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==="document link"||e==="earth configuration"||e==="operations dashboard add in"||e==="rules package"||e==="workflow manager package"||e==="explorer map"&&t.includes("Explorer Mapping Application")||t.includes("Document")?i="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"?i="toolsgray":e==="layer"||e==="layer package"||e==="explorer layer"?i="layersgray":e==="analysis model"?i="analysismodel":e==="scene package"?i="scenepackage":e==="3dtiles package"?i="3dtileslayerpackage":e==="3dtiles service"?i="3dtileslayer":e==="mobile scene package"?i="mobilescenepackage":e==="tile package"||e==="compact tile package"?i="tilepackage":e==="task file"?i="taskfile":e==="report template"?i="report-template":e==="statistical data collection"?i="statisticaldatacollection":e==="insights workbook"?i="workbook":e==="insights model"?i="insightsmodel":e==="insights page"?i="insightspage":e==="insights theme"?i="insightstheme":e==="hub initiative"?i="hubinitiative":e==="hub page"?i="hubpage":e==="hub site application"?i="hubsite":e==="hub event"?i="hubevent":e==="hub project"?i="hubproject":e==="relational database connection"?i="relationaldatabaseconnection":e==="big data file share"?i="datastorecollection":e==="image collection"?i="imagecollection":e==="desktop style"?i="desktopstyle":e==="style"?i=t.includes("Dictionary")?"dictionarystyle":"style":e==="dashboard"?i="dashboard":e==="raster function template"?i="rasterprocessingtemplate":e==="vector tile package"?i="vectortilepackage":e==="ortho mapping project"?i="orthomappingproject":e==="ortho mapping template"?i="orthomappingtemplate":e==="solution"?i="solutions":e==="geopackage"?i="geopackage":e==="deep learning package"?i="deeplearningpackage":e==="real time analytic"?i="realtimeanalytics":e==="reality mapping project"?i="realitymappingproject":e==="big data analytic"?i="bigdataanalytics":e==="feed"?i="feed":e==="excalibur imagery project"?i="excaliburimageryproject":e==="notebook"?i="notebook":e==="storymap"?i="storymap":e==="survey123 add in"?i="survey123addin":e==="mission"?i="mission":e==="mission report"?i="missionreport":e==="mission template"?i="missiontemplate":e==="quickcapture project"?i="quickcaptureproject":e==="pro report"?i="proreport":e==="pro report template"?i="proreporttemplate":e==="urban model"?i="urbanmodel":e==="urban project"?i="urbanproject":e==="web experience"?i="experiencebuilder":e==="web experience template"?i="webexperiencetemplate":e==="experience builder widget"?i="experiencebuilderwidget":e==="experience builder widget package"?i="experiencebuilderwidgetpackage":e==="workflow"?i="workflow":e==="kernel gateway connection"?i="kernelgatewayconnection":e==="insights script"?i="insightsscript":e==="hub initiative template"?i="hubinitiativetemplate":e==="storymap theme"?i="storymaptheme":e==="knowledge graph"?i="knowledgegraph":e==="knowledge graph layer"?i="knowledgegraphlayer":e==="knowledge studio project"?i="knowledgestudio":e==="native application"?i="nativeapp":e==="native application installer"?i="nativeappinstaller":e==="web link chart"?i="linkchart":e==="knowledge graph web investigation"?i="investigation":e==="ogcfeatureserver"?i="features":e==="pro presentation"?i="propresentation":e==="pro project"?i="proproject":e==="insights workbook package"?i="insightsworkbookpackage":e==="apache parquet"?i="apacheparquet":e==="notebook code snippet library"?i="notebookcodesnippets":e==="suitability model"?i="suitabilitymodel":e==="esri classifier definition"?i="classifierdefinition":e==="esri classification schema"?i="classificationschema":e==="insights data engineering workbook"?i="dataengineeringworkbook":e==="insights data engineering model"?i="dataengineeringmodel":e==="deep learning studio project"?i="deeplearningproject":e==="discussion"?i="discussion":e==="allsource project"?i="allsourceproject":e==="api key"?i="apikey":e==="data pipeline"?i="datapipelines":e==="group layer"?(I=t.includes("Map"),i=I?"layergroup2d":"layergroup"):i=e==="media layer"?"onlinemedialayer":e==="form"?t.includes("Survey123")?"survey":"datafilesgray":e==="csv"?"csv":e==="image"?"image":"maps",i?_(r+i+n+".png"):null}get isLayer(){return this.type!=null&&M.has(this.type)}get itemCdnUrl(){return q(this.itemUrl)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.portal?.restUrl;if(!e)return null;const t=this.owner||this.portal?.user?.username;return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){const t=this.portal??(this.portal=R.getDefault()),r=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:e!=null?e.signal:null,query:{token:this.apiKey}}):{}).then(n=>{this.sourceJSON=n,this.read(n)});return this.addResolvingPromise(r),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof f&&(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 f({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:l(this.applicationProxies),avgRating:this.avgRating,categories:l(this.categories),classification:l(this.classification),created:l(this.created),culture:this.culture,description:this.description,extent:l(this.extent),groupCategories:l(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:l(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:l(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new c({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]=e[t]?.join(", ");for(const t of["extent","classification"]){const r=e[t];r&&(e[t]=JSON.stringify(r))}return e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return t.rating!=null?(t.created=new Date(t.created),new f(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},c)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.applicationProxies&&!Object.hasOwn(e,"appProxies")&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e?.data,r={method:"post"};r.query=this.createPostQuery();for(const n in r.query)r.query[n]===null&&(r.query[n]="");return r.query.clearEmptyFields=!0,t!=null&&(typeof t=="string"?r.query.text=t:typeof t=="object"&&(r.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,r).then(()=>this.reload())}):Promise.reject(new g("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new g("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await t.signIn();const{copyResources:n,folder:i,tags:u,title:d}=e||{},v={method:"post",query:{copyPrivateResources:n==="all",folder:typeof i=="string"?i:i?.id,includeResources:!!n,tags:u?.join(","),title:d}},{itemId:w}=await t.request(`${r}/copy`,v);return new c({id:w,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e.thumbnail,r=e.filename,n={method:"post"};if(typeof t=="string")C(t)?n.query={data:t}:n.query={url:D(t)},r!=null&&(n.query.filename=r);else{const i=new FormData;r!=null?i.append("file",t,r):i.append("file",t),n.body=i}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,n).then(()=>this.reload())}):Promise.reject(new g("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:r}=await m(()=>import("./resourceUtils-rTM6Iemx-BROWZCZ1.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return r(this,e,t)}async addResource(e,t,r){const{addOrUpdateResources:n}=await m(()=>import("./resourceUtils-rTM6Iemx-BROWZCZ1.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return e.portalItem=this,await n(this,[{resource:e,content:t,compress:r?.compress,access:r?.access}],"add",r),e}async removeResource(e,t){const{removeResource:r}=await m(()=>import("./resourceUtils-rTM6Iemx-BROWZCZ1.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new g("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await m(()=>import("./resourceUtils-rTM6Iemx-BROWZCZ1.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return t(this,e)}resourceFromPath(e){return new K({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:l(this.categories),classification:l(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};return F(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new c({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}};a([o({type:["private","shared","org","public"]})],s.prototype,"access",void 0),a([o()],s.prototype,"accessInformation",void 0),a([o({type:String})],s.prototype,"apiKey",void 0),a([o({json:{read:{source:"appProxies"}}})],s.prototype,"applicationProxies",void 0),a([o()],s.prototype,"avgRating",void 0),a([o()],s.prototype,"categories",void 0),a([o()],s.prototype,"classification",void 0),a([o({type:Date})],s.prototype,"created",void 0),a([o()],s.prototype,"culture",void 0),a([o()],s.prototype,"description",void 0),a([o({readOnly:!0})],s.prototype,"displayName",null),a([o({type:O})],s.prototype,"extent",void 0),a([N("extent")],s.prototype,"readExtent",null),a([o()],s.prototype,"groupCategories",void 0),a([o({readOnly:!0})],s.prototype,"iconUrl",null),a([o()],s.prototype,"id",void 0),a([o({readOnly:!0})],s.prototype,"isLayer",null),a([o({type:Boolean,readOnly:!0})],s.prototype,"isOrgItem",void 0),a([o()],s.prototype,"itemControl",void 0),a([o({readOnly:!0})],s.prototype,"itemPageUrl",null),a([o({readOnly:!0})],s.prototype,"itemUrl",null),a([o()],s.prototype,"licenseInfo",void 0),a([o({type:Date})],s.prototype,"modified",void 0),a([o()],s.prototype,"name",void 0),a([o()],s.prototype,"numComments",void 0),a([o()],s.prototype,"numRatings",void 0),a([o()],s.prototype,"numViews",void 0),a([o()],s.prototype,"owner",void 0),a([o()],s.prototype,"ownerFolder",void 0),a([o({type:R})],s.prototype,"portal",void 0),a([o()],s.prototype,"screenshots",void 0),a([o()],s.prototype,"size",void 0),a([o()],s.prototype,"snippet",void 0),a([o()],s.prototype,"sourceJSON",void 0),a([o({type:String})],s.prototype,"sourceUrl",void 0),a([o({type:String})],s.prototype,"spatialReference",void 0),a([o()],s.prototype,"tags",void 0),a([o()],s.prototype,"thumbnail",void 0),a([o({readOnly:!0})],s.prototype,"thumbnailUrl",null),a([o()],s.prototype,"title",void 0),a([o()],s.prototype,"type",void 0),a([o()],s.prototype,"typeKeywords",void 0),a([o({type:String,json:{read(e,t){if(A.has(t.type)){const r=this.portal?.restUrl;e||=r&&this.id?`${r}/content/items/${this.id}/data`:null}return e}}})],s.prototype,"url",void 0),a([o({readOnly:!0})],s.prototype,"userItemUrl",null),s=c=a([b("esri.portal.PortalItem")],s);const z=s;export{z as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./resourceUtils-rTM6Iemx-GPPQBysx.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css"])))=>i.map(i=>d[i]); +import{_ as m}from"./main-QGPoLsvl.js";import{v as a,ad as j,bA as T,aO as L,n as O,bw as _,cv as q,r as R,P as l,o as g,cw as C,Y as D,M as F,S as o,a0 as N,i as b,j as U,cx as P,a1 as E,cy as $,aB as J}from"./story-Doly9N9p.js";let p=class extends U{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e?.portalItem&&e.path?{...e,path:x(e.path,e.portalItem)}:e}set path(e){e!=null&&P(e)?E.getLogger(this).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return x(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get cdnUrl(){return this.portalItem&&this.path?`${this.portalItem.itemCdnUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const r=this.cdnUrl;if(r==null)throw new g("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal.request(r,{responseType:e,query:{token:this.portalItem.apiKey,_ts:t?.cacheBust?Date.now():null},signal:t?.signal})}async update(e,t){const{addOrUpdateResources:r}=await m(()=>import("./resourceUtils-rTM6Iemx-GPPQBysx.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return await r(this.portalItem,[{resource:this,content:e,compress:t?.compress,access:t?.access}],"update",t),this}hasPath(){return this.path!=null}};function x(e,t){return e==null?e:(e=e.replace(/^\/+/,""),t!=null&&P(e)&&(e=$(e,t.itemUrl)),e?.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}a([o()],p.prototype,"portalItem",void 0),a([o({type:String,value:null})],p.prototype,"path",null),a([j("path")],p.prototype,"_castPath",null),a([o({type:String,readOnly:!0})],p.prototype,"url",null),a([o({type:String,readOnly:!0})],p.prototype,"cdnUrl",null),a([o({type:String,readOnly:!0})],p.prototype,"itemRelativeUrl",null),p=a([b("esri.portal.PortalItemResource")],p);const K=p;let y=class extends U{constructor(e){super(e),this.created=null,this.rating=null}};a([o()],y.prototype,"created",void 0),a([o()],y.prototype,"rating",void 0),y=a([b("esri.portal.PortalRating")],y);const f=y;var c;const M=new Set(["3DTiles Service","CSV","Feature Collection","Feature Service","Feed","GeoJson","Group Layer","Image Service","KML","Map Service","Media Layer","Scene Service","Stream Service","Vector Tile Service","WFS","WMS","WMTS"]),A=new Set(["KML","GeoJson","CSV"]);let s=c=class extends T(J){static from(e){return L(c,e)}constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.classification=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.isOrgItem=!1,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.sourceUrl=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let r=e;return e==="Feature Service"||e==="Feature Collection"?r=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":e==="Image Service"?r=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":e==="Scene Service"?r="Scene Layer":e==="Video Service"?r="Video Layer":e==="Scene Package"?r="Scene Layer Package":e==="Stream Service"?r="Feature Layer":e==="Geoprocessing Service"?r=t.includes("Web Tool")?"Tool":"Geoprocessing Service":e==="Geoenrichment Service"?r="GeoEnrichment Service":e==="Geocoding Service"?r="Locator":e==="Microsoft Powerpoint"?r="Microsoft PowerPoint":e==="GeoJson"?r="GeoJSON":e==="Globe Service"?r="Globe Layer":e==="Vector Tile Service"?r="Tile Layer":e==="netCDF"?r="NetCDF":e==="Map Service"?r=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e?.toLowerCase().includes("add in")?r=e.replaceAll(/(add in)/gi,"Add-In"):e==="datastore catalog service"?r="Big Data File Share":e==="Compact Tile Package"?r="Tile Package (tpkx)":e==="Raster function template"?r="Raster Function Template":e==="OGCFeatureServer"?r="OGC Feature Layer":e==="web mapping application"&&t.includes("configurableApp")?r="Instant App":e==="Insights Page"?r="Insights Report":e==="Excalibur Imagery Project"?r="Excalibur Project":e==="3DTiles Service"?r="3D tiles layer":e==="3DTiles Package"&&(r="3D tiles package"),r}readExtent(e){return e&&e.length?new O(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type?.toLowerCase()||"",t=this.typeKeywords||[],r="esri/images/portal/",n="16";let i,u=!1,d=!1,v=!1,w=!1,h=!1,k=!1,S=!1,I=!1;return e.indexOf("service")>0||e==="feature collection"||e==="kml"||e==="wms"||e==="wmts"||e==="wfs"?(u=t.includes("Hosted Service"),e==="feature service"||e==="feature collection"||e==="kml"||e==="wfs"?(d=t.includes("Table"),v=t.includes("Route Layer"),w=t.includes("Markup"),h=t.includes("Spatiotemporal"),k=t.includes("UtilityNetwork"),i=h&&d?"spatiotemporaltable":d?"table":v?"routelayer":w?"markup":h?"spatiotemporal":k?"utilitynetwork":u?"featureshosted":"features"):e==="map service"||e==="wms"||e==="wmts"?(h=t.includes("Spatiotemporal"),S=t.includes("Relational"),i=h||S?"mapimages":u||t.includes("Tiled")||e==="wmts"?"maptiles":"mapimages"):i=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==="vector tile service"?"vectortile":e==="datastore catalog service"?"datastorecollection":e==="geocoding service"?"geocodeservice":e==="video service"?t.includes("Live Stream")?"livestreamvideolayer":"videolayer":e==="geoprocessing service"?t.includes("Web Tool")?"tool":"layers":e==="geodata service"?"geodataservice":e==="3dtiles service"?t.includes("3DObject")?"3dobjecttileslayer":t.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dtileslayer":"layers"):e==="web map"||e==="cityengine web scene"?i="maps":e==="web scene"?i=t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":e==="web mapping application"&&t.includes("configurableApp")?i="instantapps":e==="web mapping application"||e==="mobile application"||e==="application"||e==="operation view"||e==="desktop application"?i="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")?i="mapsgray":e==="service definition"||e==="shapefile"||e==="cad drawing"||e==="geojson"||e==="netcdf"||e==="administrative report"?i="datafiles":e==="360 vr experience"?i="360vr":e==="explorer add in"||e==="desktop add in"||e==="windows viewer add in"||e==="windows viewer configuration"?i="appsgray":e==="arcgis pro add in"||e==="arcgis pro configuration"?i="addindesktop":e==="pdf"?i="pdf":e==="microsoft word"?i="word":e==="microsoft excel"?i="excel":e==="microsoft powerpoint"?i="ppt":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==="document link"||e==="earth configuration"||e==="operations dashboard add in"||e==="rules package"||e==="workflow manager package"||e==="explorer map"&&t.includes("Explorer Mapping Application")||t.includes("Document")?i="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"?i="toolsgray":e==="layer"||e==="layer package"||e==="explorer layer"?i="layersgray":e==="analysis model"?i="analysismodel":e==="scene package"?i="scenepackage":e==="3dtiles package"?i="3dtileslayerpackage":e==="3dtiles service"?i="3dtileslayer":e==="mobile scene package"?i="mobilescenepackage":e==="tile package"||e==="compact tile package"?i="tilepackage":e==="task file"?i="taskfile":e==="report template"?i="report-template":e==="statistical data collection"?i="statisticaldatacollection":e==="insights workbook"?i="workbook":e==="insights model"?i="insightsmodel":e==="insights page"?i="insightspage":e==="insights theme"?i="insightstheme":e==="hub initiative"?i="hubinitiative":e==="hub page"?i="hubpage":e==="hub site application"?i="hubsite":e==="hub event"?i="hubevent":e==="hub project"?i="hubproject":e==="relational database connection"?i="relationaldatabaseconnection":e==="big data file share"?i="datastorecollection":e==="image collection"?i="imagecollection":e==="desktop style"?i="desktopstyle":e==="style"?i=t.includes("Dictionary")?"dictionarystyle":"style":e==="dashboard"?i="dashboard":e==="raster function template"?i="rasterprocessingtemplate":e==="vector tile package"?i="vectortilepackage":e==="ortho mapping project"?i="orthomappingproject":e==="ortho mapping template"?i="orthomappingtemplate":e==="solution"?i="solutions":e==="geopackage"?i="geopackage":e==="deep learning package"?i="deeplearningpackage":e==="real time analytic"?i="realtimeanalytics":e==="reality mapping project"?i="realitymappingproject":e==="big data analytic"?i="bigdataanalytics":e==="feed"?i="feed":e==="excalibur imagery project"?i="excaliburimageryproject":e==="notebook"?i="notebook":e==="storymap"?i="storymap":e==="survey123 add in"?i="survey123addin":e==="mission"?i="mission":e==="mission report"?i="missionreport":e==="mission template"?i="missiontemplate":e==="quickcapture project"?i="quickcaptureproject":e==="pro report"?i="proreport":e==="pro report template"?i="proreporttemplate":e==="urban model"?i="urbanmodel":e==="urban project"?i="urbanproject":e==="web experience"?i="experiencebuilder":e==="web experience template"?i="webexperiencetemplate":e==="experience builder widget"?i="experiencebuilderwidget":e==="experience builder widget package"?i="experiencebuilderwidgetpackage":e==="workflow"?i="workflow":e==="kernel gateway connection"?i="kernelgatewayconnection":e==="insights script"?i="insightsscript":e==="hub initiative template"?i="hubinitiativetemplate":e==="storymap theme"?i="storymaptheme":e==="knowledge graph"?i="knowledgegraph":e==="knowledge graph layer"?i="knowledgegraphlayer":e==="knowledge studio project"?i="knowledgestudio":e==="native application"?i="nativeapp":e==="native application installer"?i="nativeappinstaller":e==="web link chart"?i="linkchart":e==="knowledge graph web investigation"?i="investigation":e==="ogcfeatureserver"?i="features":e==="pro presentation"?i="propresentation":e==="pro project"?i="proproject":e==="insights workbook package"?i="insightsworkbookpackage":e==="apache parquet"?i="apacheparquet":e==="notebook code snippet library"?i="notebookcodesnippets":e==="suitability model"?i="suitabilitymodel":e==="esri classifier definition"?i="classifierdefinition":e==="esri classification schema"?i="classificationschema":e==="insights data engineering workbook"?i="dataengineeringworkbook":e==="insights data engineering model"?i="dataengineeringmodel":e==="deep learning studio project"?i="deeplearningproject":e==="discussion"?i="discussion":e==="allsource project"?i="allsourceproject":e==="api key"?i="apikey":e==="data pipeline"?i="datapipelines":e==="group layer"?(I=t.includes("Map"),i=I?"layergroup2d":"layergroup"):i=e==="media layer"?"onlinemedialayer":e==="form"?t.includes("Survey123")?"survey":"datafilesgray":e==="csv"?"csv":e==="image"?"image":"maps",i?_(r+i+n+".png"):null}get isLayer(){return this.type!=null&&M.has(this.type)}get itemCdnUrl(){return q(this.itemUrl)}get itemPageUrl(){const e=this.portal?.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){const e=this.portal?.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){const e=this.itemUrl,t=this.thumbnail;return e&&t?this.portal?.normalizeUrl(`${e}/info/${t}?f=json`)??null:null}get userItemUrl(){const e=this.portal?.restUrl;if(!e)return null;const t=this.owner||this.portal?.user?.username;return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){const t=this.portal??(this.portal=R.getDefault()),r=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t.request(this.itemUrl,{signal:e!=null?e.signal:null,query:{token:this.apiKey}}):{}).then(n=>{this.sourceJSON=n,this.read(n)});return this.addResolvingPromise(r),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof f&&(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 f({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:l(this.applicationProxies),avgRating:this.avgRating,categories:l(this.categories),classification:l(this.classification),created:l(this.created),culture:this.culture,description:this.description,extent:l(this.extent),groupCategories:l(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:l(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:l(this.screenshots),size:this.size,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};this.loaded&&(e.loadStatus="loaded");const t=new c({sourceJSON:this.sourceJSON}).set(e);return t._set("isOrgItem",this.isOrgItem),t}createPostQuery(){const e=this.toJSON();for(const t of["tags","typeKeywords","categories"])e[t]=e[t]?.join(", ");for(const t of["extent","classification"]){const r=e[t];r&&(e[t]=JSON.stringify(r))}return e}async deleteRating(){await this.portal.request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return this.portal.request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await this.portal.request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return t.rating!=null?(t.created=new Date(t.created),new f(t)):null}fetchRelatedItems(e,t){return this.portal.requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},c)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){return this.portal.request(this.itemUrl??"",{cacheBust:!0,query:{token:this.apiKey}}).then(e=>(this.applicationProxies&&!Object.hasOwn(e,"appProxies")&&(this.applicationProxies=null),this.sourceJSON=e,this.read(e),this))}update(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e?.data,r={method:"post"};r.query=this.createPostQuery();for(const n in r.query)r.query[n]===null&&(r.query[n]="");return r.query.clearEmptyFields=!0,t!=null&&(typeof t=="string"?r.query.text=t:typeof t=="object"&&(r.query.text=JSON.stringify(t))),this.portal.request(`${this.userItemUrl}/update`,r).then(()=>this.reload())}):Promise.reject(new g("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async copy(e){if(!this.id)throw new g("portal:item-does-not-exist","The item does not exist yet");await this.load();const{portal:t,itemUrl:r}=this;await t.signIn();const{copyResources:n,folder:i,tags:u,title:d}=e||{},v={method:"post",query:{copyPrivateResources:n==="all",folder:typeof i=="string"?i:i?.id,includeResources:!!n,tags:u?.join(","),title:d}},{itemId:w}=await t.request(`${r}/copy`,v);return new c({id:w,portal:t})}updateThumbnail(e){return this.id?this.load().then(()=>this.portal.signIn()).then(()=>{const t=e.thumbnail,r=e.filename,n={method:"post"};if(typeof t=="string")C(t)?n.query={data:t}:n.query={url:D(t)},r!=null&&(n.query.filename=r);else{const i=new FormData;r!=null?i.append("file",t,r):i.append("file",t),n.body=i}return this.portal.request(`${this.userItemUrl}/updateThumbnail`,n).then(()=>this.reload())}):Promise.reject(new g("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){const{fetchResources:r}=await m(()=>import("./resourceUtils-rTM6Iemx-GPPQBysx.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return r(this,e,t)}async addResource(e,t,r){const{addOrUpdateResources:n}=await m(()=>import("./resourceUtils-rTM6Iemx-GPPQBysx.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return e.portalItem=this,await n(this,[{resource:e,content:t,compress:r?.compress,access:r?.access}],"add",r),e}async removeResource(e,t){const{removeResource:r}=await m(()=>import("./resourceUtils-rTM6Iemx-GPPQBysx.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new g("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return r(this,e,t)}async removeAllResources(e){const{removeAllResources:t}=await m(()=>import("./resourceUtils-rTM6Iemx-GPPQBysx.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);return t(this,e)}resourceFromPath(e){return new K({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:l(this.categories),classification:l(this.classification),created:this.created?.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,isOrgItem:this.isOrgItem,licenseInfo:this.licenseInfo,modified:this.modified?.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,sourceUrl:this.sourceUrl,spatialReference:this.spatialReference,tags:l(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:l(this.typeKeywords),url:this.url};return F(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new c({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}};a([o({type:["private","shared","org","public"]})],s.prototype,"access",void 0),a([o()],s.prototype,"accessInformation",void 0),a([o({type:String})],s.prototype,"apiKey",void 0),a([o({json:{read:{source:"appProxies"}}})],s.prototype,"applicationProxies",void 0),a([o()],s.prototype,"avgRating",void 0),a([o()],s.prototype,"categories",void 0),a([o()],s.prototype,"classification",void 0),a([o({type:Date})],s.prototype,"created",void 0),a([o()],s.prototype,"culture",void 0),a([o()],s.prototype,"description",void 0),a([o({readOnly:!0})],s.prototype,"displayName",null),a([o({type:O})],s.prototype,"extent",void 0),a([N("extent")],s.prototype,"readExtent",null),a([o()],s.prototype,"groupCategories",void 0),a([o({readOnly:!0})],s.prototype,"iconUrl",null),a([o()],s.prototype,"id",void 0),a([o({readOnly:!0})],s.prototype,"isLayer",null),a([o({type:Boolean,readOnly:!0})],s.prototype,"isOrgItem",void 0),a([o()],s.prototype,"itemControl",void 0),a([o({readOnly:!0})],s.prototype,"itemPageUrl",null),a([o({readOnly:!0})],s.prototype,"itemUrl",null),a([o()],s.prototype,"licenseInfo",void 0),a([o({type:Date})],s.prototype,"modified",void 0),a([o()],s.prototype,"name",void 0),a([o()],s.prototype,"numComments",void 0),a([o()],s.prototype,"numRatings",void 0),a([o()],s.prototype,"numViews",void 0),a([o()],s.prototype,"owner",void 0),a([o()],s.prototype,"ownerFolder",void 0),a([o({type:R})],s.prototype,"portal",void 0),a([o()],s.prototype,"screenshots",void 0),a([o()],s.prototype,"size",void 0),a([o()],s.prototype,"snippet",void 0),a([o()],s.prototype,"sourceJSON",void 0),a([o({type:String})],s.prototype,"sourceUrl",void 0),a([o({type:String})],s.prototype,"spatialReference",void 0),a([o()],s.prototype,"tags",void 0),a([o()],s.prototype,"thumbnail",void 0),a([o({readOnly:!0})],s.prototype,"thumbnailUrl",null),a([o()],s.prototype,"title",void 0),a([o()],s.prototype,"type",void 0),a([o()],s.prototype,"typeKeywords",void 0),a([o({type:String,json:{read(e,t){if(A.has(t.type)){const r=this.portal?.restUrl;e||=r&&this.id?`${r}/content/items/${this.id}/data`:null}return e}}})],s.prototype,"url",void 0),a([o({readOnly:!0})],s.prototype,"userItemUrl",null),s=c=a([b("esri.portal.PortalItem")],s);const z=s;export{z as default}; diff --git a/custom-toc-highlight/assets/PortalLayer-CElnYuSQ-DvpreqYV.js b/custom-toc-highlight/assets/PortalLayer-CElnYuSQ-CCe4TMEA.js similarity index 83% rename from custom-toc-highlight/assets/PortalLayer-CElnYuSQ-DvpreqYV.js rename to custom-toc-highlight/assets/PortalLayer-CElnYuSQ-CCe4TMEA.js index 7ef23f10..736fa2ba 100644 --- a/custom-toc-highlight/assets/PortalLayer-CElnYuSQ-DvpreqYV.js +++ b/custom-toc-highlight/assets/PortalLayer-CElnYuSQ-CCe4TMEA.js @@ -1,3 +1,3 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersLoader-CYI-LpLl-CLVN0BVs.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./fetchService-DbaKmJhP-W7rGyykJ.js","./portalLayers-Bh9bAhk4-BP6A8Lj4.js","./associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./layersCreator-CW56kDKc-BGMnYi1N.js","./styleUtils-ChrJTYIw-BfDrXrWd.js","./jsonContext-BA8GHqVk-CWQlLGSw.js"])))=>i.map(i=>d[i]); -import{_ as w}from"./main-ugzBrWNm.js";import{v as l,S as d,a0 as _,ac as U,i as E,aA as H,$ as b,aU as $,a1 as F,W as n,C as L,cP as T,cQ as k,V as m,r as y,k as I,b6 as x,f as D,cR as O,Q as R,o as S}from"./story-BfX8CRfG.js";import f from"./PortalItem-CctGdnxF-C7IJrZYq.js";import{m as v}from"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";const A=P=>{let a=class extends P{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=H(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(r){r!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",r))}readPortalItem(r,e,t){if(e.itemId)return new f({id:e.itemId,portal:t?.portal})}writePortalItem(r,e){r?.id&&(e.itemId=r.id)}async loadFromPortal(r,e){if(this.portalItem?.id)try{const{load:t}=await w(()=>import("./layersLoader-CYI-LpLl-CLVN0BVs.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);return b(e),await t({instance:this,supportedTypes:r.supportedTypes,validateItem:r.validateItem,supportsData:r.supportsData,layerModuleTypeMap:r.layerModuleTypeMap},e)}catch(t){throw $(t)||F.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./layersLoader-CYI-LpLl-CUvaEb6F.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./fetchService-DbaKmJhP-Ccg-phWf.js","./portalLayers-Bh9bAhk4-Y1T2RWf3.js","./associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js","./PortalItem-CctGdnxF-CfFOGshS.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./layersCreator-CW56kDKc-CkfoFLoQ.js","./styleUtils-ChrJTYIw-C6xq7Jeu.js","./jsonContext-BA8GHqVk-BsXRY5es.js"])))=>i.map(i=>d[i]); +import{_ as w}from"./main-QGPoLsvl.js";import{v as l,S as d,a0 as _,ac as U,i as E,aA as H,$ as b,aU as $,a1 as F,W as n,C as L,cP as T,cQ as k,V as m,r as y,k as I,b6 as x,f as D,cR as O,Q as R,o as S}from"./story-Doly9N9p.js";import f from"./PortalItem-CctGdnxF-CfFOGshS.js";import{m as v}from"./portalItemUtils-B8bw6SAG-DF460C0Y.js";const A=P=>{let a=class extends P{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1}destroy(){this.portalItem=H(this.portalItem),this.resourceReferences.portalItem=null,this.resourceReferences.paths.length=0}set portalItem(r){r!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",r))}readPortalItem(r,e,t){if(e.itemId)return new f({id:e.itemId,portal:t?.portal})}writePortalItem(r,e){r?.id&&(e.itemId=r.id)}async loadFromPortal(r,e){if(this.portalItem?.id)try{const{load:t}=await w(()=>import("./layersLoader-CYI-LpLl-CUvaEb6F.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);return b(e),await t({instance:this,supportedTypes:r.supportedTypes,validateItem:r.validateItem,supportsData:r.supportsData,layerModuleTypeMap:r.layerModuleTypeMap},e)}catch(t){throw $(t)||F.getLogger(this).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) ${t}`),t}}async finishLoadEditablePortalLayer(r){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(r).catch(e=>(n(e),!0)))}async setUserPrivileges(r,e){if(!L.userPrivilegesApplied)return this.finishLoadEditablePortalLayer(e);if(this.url)try{const{features:{edit:t,fullEdit:i},content:{updateItem:s}}=await this._fetchUserPrivileges(r,e);this._set("userHasEditingPrivileges",t),this._set("userHasFullEditingPrivileges",i),this._set("userHasUpdateItemPrivileges",s)}catch(t){n(t)}}async _fetchUserPrivileges(r,e){let t=this.portalItem;if(!r||!t||!t.loaded||t.sourceUrl)return this._fetchFallbackUserPrivileges(e);const i=r===t.id;if(i&&t.portal.user)return v(t);let s,p;if(i)s=t.portal.url;else try{s=await T(this.url,e)}catch(o){n(o)}if(!s||!k(s,t.portal.url))return this._fetchFallbackUserPrivileges(e);try{const o=e!=null?e.signal:null;p=await m?.getCredential(`${s}/sharing`,{prompt:!1,signal:o})}catch(o){n(o)}const c=!0,u=!1,g=!1;if(!p)return{features:{edit:c,fullEdit:u},content:{updateItem:g}};try{if(i?await t.reload():(t=new f({id:r,portal:{url:s}}),await t.load(e)),t.portal.user)return v(t)}catch(o){n(o)}return{features:{edit:c,fullEdit:u},content:{updateItem:g}}}async _fetchFallbackUserPrivileges(r){let e=!0;try{e=await this._fetchUserHasEditingPrivileges(r)}catch(t){n(t)}return{features:{edit:e,fullEdit:!1},content:{updateItem:!1}}}async _fetchUserHasEditingPrivileges(r){const e=this.url?m?.findCredential(this.url):null;if(!e)return!0;const t=h.credential===e?h.user:await this._fetchEditingUser(r);return h.credential=e,h.user=t,t?.privileges==null||t.privileges.includes("features:user:edit")}async _fetchEditingUser(r){const e=this.portalItem?.portal?.user;if(e)return e;const t=m?.findServerInfo(this.url??"");if(!t?.owningSystemUrl)return null;const i=`${t.owningSystemUrl}/sharing/rest`,s=y.getDefault();if(s&&s.loaded&&I(s.restUrl)===I(i))return s.user;const p=`${i}/community/self`,c=r!=null?r.signal:null,u=await x(D(p,{authMode:"no-prompt",query:{f:"json"},signal:c}));return u.ok?O.fromJSON(u.value.data):null}read(r,e){e&&(e.layer=this),super.read(r,e)}write(r,e){const t=e?.portal,i=this.portalItem?.id&&(this.portalItem.portal||y.getDefault());return t&&i&&!R(i.restUrl,t.restUrl)?(e.messages&&e.messages.push(new S("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(r,{...e,layer:this})}};return l([d({type:f})],a.prototype,"portalItem",null),l([_("web-document","portalItem",["itemId"])],a.prototype,"readPortalItem",null),l([U("web-document","portalItem",{itemId:{type:String}})],a.prototype,"writePortalItem",null),l([d({clonable:!1})],a.prototype,"resourceReferences",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasEditingPrivileges",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasFullEditingPrivileges",void 0),l([d({type:Boolean,readOnly:!0})],a.prototype,"userHasUpdateItemPrivileges",void 0),a=l([E("esri.layers.mixins.PortalLayer")],a),a},h={credential:null,user:null};export{A as C}; diff --git a/custom-toc-highlight/assets/Program-DLVwTiPA-C1hIaFuM.js b/custom-toc-highlight/assets/Program-DLVwTiPA-DI0GKSfI.js similarity index 99% rename from custom-toc-highlight/assets/Program-DLVwTiPA-C1hIaFuM.js rename to custom-toc-highlight/assets/Program-DLVwTiPA-DI0GKSfI.js index 8045fa6d..b6fed689 100644 --- a/custom-toc-highlight/assets/Program-DLVwTiPA-C1hIaFuM.js +++ b/custom-toc-highlight/assets/Program-DLVwTiPA-DI0GKSfI.js @@ -1,4 +1,4 @@ -import{hT as j,a1 as J}from"./story-BfX8CRfG.js";import{r as ut}from"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import{P as y,V as M,F as dt,t as O,X as mt}from"./Texture-BCt2hphT-hC4XzHg_.js";import{V as p,X as x,U as I,F as _t,s as X,Y as C,P as b,n as gt,S as pt,H as A,E as T}from"./enums-DBi1-Mm2-CUS1pvQe.js";let Qt=class{constructor(i,t,e=t){this.internalFormat=i,this.width=t,this.height=e,this.multisampled=!1,this.samples=1}};function Tt(i){return i.width<=0||i.height<=0||i.internalFormat==null?0:i.width*i.height*mt(i.internalFormat)}let xt=class{constructor(i,t){this._context=i,this._descriptor=t,this.type=y.RenderBuffer,this._context.instanceCounter.increment(p.Renderbuffer,this);const e=this._context.gl;this.glName=e.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:o,multisampled:a}=t;a?e.renderbufferStorageMultisample(e.RENDERBUFFER,this.samples,o,r,n):e.renderbufferStorage(e.RENDERBUFFER,o,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const i=this._descriptor.samples,t=this._context.parameters.maxSamples;return i?Math.min(i,t):t}get usedMemory(){return Tt(this._descriptor)}resize(i,t){const e=this._descriptor;if(e.width===i&&e.height===t)return;e.width=i,e.height=t;const r=this._context.gl;this._context.bindRenderbuffer(this),e.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,e.internalFormat,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,e.internalFormat,e.width,e.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.Renderbuffer,this),this._context=null)}};const Et=()=>J.getLogger("esri.views.webgl.FramebufferObject");let bt=class F{constructor(t,e,r=null){this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(p.FramebufferObject,this);const n=w(e)?e:new M(this._context,e);if(this._colorAttachments.set(x.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(x.COLOR_ATTACHMENT0),r!=null)if(At(r))this._depthStencilTexture=w(r)?r:new M(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const o=St(r)?r:new xt(this._context,r);this._depthStencilBuffer=o,this._validateRenderBufferDescriptor(o.descriptor)}}dispose(){if(this._colorAttachments.size===0&&!this._glName)return;const t=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((e,r)=>this.detachColorTexture(r)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(t),this._context.instanceCounter.decrement(p.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,r])=>t+r.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&w(e)?e:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(t,e=x.COLOR_ATTACHMENT0){if(!t)return;this._validateColorAttachmentPoint(e);const r=t.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(e)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=x.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(e){if(this._initialized){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t),this._context.bindFramebuffer(r)}return this._colorAttachments.delete(t),e}}setColorTextureTarget(t,e=x.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(e);r&&this._framebufferTexture2D(r.glName,e,t)}attachDepthStencil(t){if(t)switch(t.type){case y.Texture:return this._attachDepthStencilTexture(t);case y.RenderBuffer:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(t==null)return;const e=t.descriptor;e.pixelFormat!==I.DEPTH_STENCIL&&e.pixelFormat!==I.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==_t.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,X)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,X),this._context.bindFramebuffer(e)}return this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(t==null)return;const e=t.descriptor;if(this._validateRenderBufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(e);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,null),this._context.bindFramebuffer(e)}return this._depthStencilBuffer=null,t}copyToTexture(t,e,r,n,o,a,h){(t<0||e<0||o<0||a<0)&&console.error("Offsets cannot be negative!"),(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const s=h.descriptor;h.descriptor.target!==b.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(s?.width==null||s?.height==null||t+r>this.width||e+n>this.height||o+r>s.width||a+n>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,l=c.bindTexture(h,M.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(b.TEXTURE_2D,0,o,a,t,e,r,n),c.bindTexture(l,M.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,r,n,o,a,h){(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,r,n,o,a,h)}async readPixelsAsync(t,e,r,n,o,a,h){const{gl:s}=this._context,c=ut.createPixelPack(this._context,gt.STREAM_READ,h.byteLength);this._context.bindBuffer(c);const l=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),s.readPixels(t,e,r,n,o,a,0),this._context.unbindBuffer(pt.PIXEL_PACK_BUFFER),this._context.bindFramebuffer(l),await c.getSubDataAsync(h),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const r={width:t,height:e};R(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(n=>n.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(R(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(t=C.FRAMEBUFFER){const e=this._context.gl;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const r=e.createFramebuffer();if(e.bindFramebuffer(t,r),this._colorAttachments.forEach((n,o)=>this._framebufferTexture2D(n.glName,o,z(n),t)),this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,n,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,e.DEPTH_STENCIL_ATTACHMENT,z(this._depthStencilTexture),t);dt()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(t,e=x.COLOR_ATTACHMENT0,r=b.TEXTURE_2D,n=C.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(n,e,r,t,o)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(C.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=j(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=j(this._depthStencilTexture))}_validateTextureDescriptor(t){t.target!==b.TEXTURE_2D&&t.target!==b.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),R(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderBufferDescriptor(t){R(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case A.DEPTH_COMPONENT16:case A.DEPTH_COMPONENT24:case A.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case A.DEPTH24_STENCIL8:case A.DEPTH32F_STENCIL8:case A.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case A.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(t){if(F._MAX_COLOR_ATTACHMENTS===-1){const{gl:r}=this._context;F._MAX_COLOR_ATTACHMENTS=r.getParameter(r.MAX_COLOR_ATTACHMENTS)}const e=t-x.COLOR_ATTACHMENT0;e+1>F._MAX_COLOR_ATTACHMENTS&&J.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${F._MAX_COLOR_ATTACHMENTS} color attachments`)}};function w(i){return i!=null&&"type"in i&&i.type===y.Texture}function St(i){return i!=null&&"type"in i&&i.type===y.RenderBuffer}function At(i){return w(i)||i!=null&&"pixelFormat"in i}function R(i,t){const e=Math.max(i.width,i.height);if(e>t){Et().warn(`Resizing FBO attachment size ${i.width}x${i.height} to device limit ${t}`);const r=t/e;return i.width=Math.round(i.width*r),i.height=Math.round(i.height*r),!1}return!0}function z(i){return i.descriptor.target===b.TEXTURE_CUBE_MAP?b.TEXTURE_CUBE_MAP_POSITIVE_X:b.TEXTURE_2D}bt._MAX_COLOR_ATTACHMENTS=-1;const Dt=["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"],Mt=["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"],V=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"],Ct=["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"];var g=999,G=9999,L=0,N=1,$=2,q=3,K=4,v=5,Ft=6,Ut=7,yt=8,Q=9,Rt=10,W=11,vt=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function wt(){var i,t,e,r=0,n=0,o=g,a=[],h=[],s=1,c=0,l=0,u=!1,_=!1,m="";return function(f){return h=[],f!==null?et(f.replace?f.replace(/\r\n/g,` +import{hT as j,a1 as J}from"./story-Doly9N9p.js";import{r as ut}from"./BufferObject-BM_7mcDb-EYaqMhmk.js";import{P as y,V as M,F as dt,t as O,X as mt}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{V as p,X as x,U as I,F as _t,s as X,Y as C,P as b,n as gt,S as pt,H as A,E as T}from"./enums-DBi1-Mm2-CUS1pvQe.js";let Qt=class{constructor(i,t,e=t){this.internalFormat=i,this.width=t,this.height=e,this.multisampled=!1,this.samples=1}};function Tt(i){return i.width<=0||i.height<=0||i.internalFormat==null?0:i.width*i.height*mt(i.internalFormat)}let xt=class{constructor(i,t){this._context=i,this._descriptor=t,this.type=y.RenderBuffer,this._context.instanceCounter.increment(p.Renderbuffer,this);const e=this._context.gl;this.glName=e.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:r,height:n,internalFormat:o,multisampled:a}=t;a?e.renderbufferStorageMultisample(e.RENDERBUFFER,this.samples,o,r,n):e.renderbufferStorage(e.RENDERBUFFER,o,r,n),this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const i=this._descriptor.samples,t=this._context.parameters.maxSamples;return i?Math.min(i,t):t}get usedMemory(){return Tt(this._descriptor)}resize(i,t){const e=this._descriptor;if(e.width===i&&e.height===t)return;e.width=i,e.height=t;const r=this._context.gl;this._context.bindRenderbuffer(this),e.multisampled?r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,e.internalFormat,e.width,e.height):r.renderbufferStorage(r.RENDERBUFFER,e.internalFormat,e.width,e.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(p.Renderbuffer,this),this._context=null)}};const Et=()=>J.getLogger("esri.views.webgl.FramebufferObject");let bt=class F{constructor(t,e,r=null){this._context=t,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,t.instanceCounter.increment(p.FramebufferObject,this);const n=w(e)?e:new M(this._context,e);if(this._colorAttachments.set(x.COLOR_ATTACHMENT0,n),this._validateTextureDescriptor(n.descriptor),this._validateColorAttachmentPoint(x.COLOR_ATTACHMENT0),r!=null)if(At(r))this._depthStencilTexture=w(r)?r:new M(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const o=St(r)?r:new xt(this._context,r);this._depthStencilBuffer=o,this._validateRenderBufferDescriptor(o.descriptor)}}dispose(){if(this._colorAttachments.size===0&&!this._glName)return;const t=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((e,r)=>this.detachColorTexture(r)?.dispose()),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(t),this._context.instanceCounter.decrement(p.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(x.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((t,[e,r])=>t+r.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&w(e)?e:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(t,e=x.COLOR_ATTACHMENT0){if(!t)return;this._validateColorAttachmentPoint(e);const r=t.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(e)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t)}detachColorTexture(t=x.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(e){if(this._initialized){const r=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t),this._context.bindFramebuffer(r)}return this._colorAttachments.delete(t),e}}setColorTextureTarget(t,e=x.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(e);r&&this._framebufferTexture2D(r.glName,e,t)}attachDepthStencil(t){if(t)switch(t.type){case y.Texture:return this._attachDepthStencilTexture(t);case y.RenderBuffer:return this._attachDepthStencilBuffer(t)}}_attachDepthStencilTexture(t){if(t==null)return;const e=t.descriptor;e.pixelFormat!==I.DEPTH_STENCIL&&e.pixelFormat!==I.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==_t.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._validateTextureDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,X)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,X),this._context.bindFramebuffer(e)}return this._depthStencilTexture=null,t}_attachDepthStencilBuffer(t){if(t==null)return;const e=t.descriptor;if(this._validateRenderBufferDescriptor(e),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(e);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,t.glName)}this._depthStencilBuffer=t}detachDepthStencilBuffer(){const t=this._depthStencilBuffer;if(t&&this._initialized){const e=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);const r=this._context.gl,n=this._getGLAttachmentPoint(t.descriptor);r.framebufferRenderbuffer(C.FRAMEBUFFER,n,r.RENDERBUFFER,null),this._context.bindFramebuffer(e)}return this._depthStencilBuffer=null,t}copyToTexture(t,e,r,n,o,a,h){(t<0||e<0||o<0||a<0)&&console.error("Offsets cannot be negative!"),(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!");const s=h.descriptor;h.descriptor.target!==b.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(s?.width==null||s?.height==null||t+r>this.width||e+n>this.height||o+r>s.width||a+n>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const c=this._context,l=c.bindTexture(h,M.TEXTURE_UNIT_FOR_UPDATES);c.setActiveTexture(M.TEXTURE_UNIT_FOR_UPDATES),c.bindFramebuffer(this),c.gl.copyTexSubImage2D(b.TEXTURE_2D,0,o,a,t,e,r,n),c.bindTexture(l,M.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,r,n,o,a,h){(r<=0||n<=0)&&console.error("Copy width and height must be greater than zero!"),h||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,r,n,o,a,h)}async readPixelsAsync(t,e,r,n,o,a,h){const{gl:s}=this._context,c=ut.createPixelPack(this._context,gt.STREAM_READ,h.byteLength);this._context.bindBuffer(c);const l=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),s.readPixels(t,e,r,n,o,a,0),this._context.unbindBuffer(pt.PIXEL_PACK_BUFFER),this._context.bindFramebuffer(l),await c.getSubDataAsync(h),c.dispose()}resize(t,e){if(this.width===t&&this.height===e)return;const r={width:t,height:e};R(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach(n=>n.resize(r.width,r.height)),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(R(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(t=C.FRAMEBUFFER){const e=this._context.gl;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const r=e.createFramebuffer();if(e.bindFramebuffer(t,r),this._colorAttachments.forEach((n,o)=>this._framebufferTexture2D(n.glName,o,z(n),t)),this._depthStencilBuffer){const n=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(t,n,e.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,e.DEPTH_STENCIL_ATTACHMENT,z(this._depthStencilTexture),t);dt()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(t,e=x.COLOR_ATTACHMENT0,r=b.TEXTURE_2D,n=C.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(n,e,r,t,o)}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const e=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(C.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthStencilBuffer=j(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=j(this._depthStencilTexture))}_validateTextureDescriptor(t){t.target!==b.TEXTURE_2D&&t.target!==b.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),R(t,this._context.parameters.maxTextureSize),this._validateBufferDimensions(t)}_validateRenderBufferDescriptor(t){R(t,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(t)}_validateBufferDimensions(t){t.width<=0&&(t.width=this.width),t.height<=0&&(t.height=this.height),this.width>0&&this.height>0&&(this.width===t.width&&this.height===t.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(t){switch(t.internalFormat){case A.DEPTH_COMPONENT16:case A.DEPTH_COMPONENT24:case A.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case A.DEPTH24_STENCIL8:case A.DEPTH32F_STENCIL8:case A.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case A.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(t){if(F._MAX_COLOR_ATTACHMENTS===-1){const{gl:r}=this._context;F._MAX_COLOR_ATTACHMENTS=r.getParameter(r.MAX_COLOR_ATTACHMENTS)}const e=t-x.COLOR_ATTACHMENT0;e+1>F._MAX_COLOR_ATTACHMENTS&&J.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${F._MAX_COLOR_ATTACHMENTS} color attachments`)}};function w(i){return i!=null&&"type"in i&&i.type===y.Texture}function St(i){return i!=null&&"type"in i&&i.type===y.RenderBuffer}function At(i){return w(i)||i!=null&&"pixelFormat"in i}function R(i,t){const e=Math.max(i.width,i.height);if(e>t){Et().warn(`Resizing FBO attachment size ${i.width}x${i.height} to device limit ${t}`);const r=t/e;return i.width=Math.round(i.width*r),i.height=Math.round(i.height*r),!1}return!0}function z(i){return i.descriptor.target===b.TEXTURE_CUBE_MAP?b.TEXTURE_CUBE_MAP_POSITIVE_X:b.TEXTURE_2D}bt._MAX_COLOR_ATTACHMENTS=-1;const Dt=["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"],Mt=["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"],V=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"],Ct=["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"];var g=999,G=9999,L=0,N=1,$=2,q=3,K=4,v=5,Ft=6,Ut=7,yt=8,Q=9,Rt=10,W=11,vt=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function wt(){var i,t,e,r=0,n=0,o=g,a=[],h=[],s=1,c=0,l=0,u=!1,_=!1,m="";return function(f){return h=[],f!==null?et(f.replace?f.replace(/\r\n/g,` `):f):rt()};function d(f){f.length&&h.push({type:vt[o],data:f,position:l,line:s,column:c})}function et(f){var S;for(r=0,e=(m+=f).length;i=m[r],r0)continue;D=f.slice(0,1).join("")}return d(D),l+=D.length,(a=a.slice(D.length)).length}}function ht(){return/[^a-fA-F0-9]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function lt(){return i==="."||/[eE]/.test(i)?(a.push(i),o=v,t=i,r+1):i==="x"&&a.length===1&&a[0]==="0"?(o=W,a.push(i),t=i,r+1):/[^\d]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function ct(){return i==="f"&&(a.push(i),t=i,r+=1),/[eE]/.test(i)||i==="-"&&/[eE]/.test(t)?(a.push(i),t=i,r+1):/[^\d]/.test(i)?(d(a.join("")),o=g,r):(a.push(i),t=i,r+1)}function ft(){if(/[^\d\w_]/.test(i)){var f=a.join("");return o=Mt.indexOf(f)>-1?yt:Ct.indexOf(f)>-1?Ut:Ft,d(a.join("")),o=g,r}return a.push(i),t=i,r+1}}function Pt(i){var t=wt(),e=[];return e=(e=e.concat(t(i))).concat(t(null))}function Lt(i){return Pt(i)}function Nt(i){return i.map(t=>t.type!=="eof"?t.data:"").join("")}const B=new Set(["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"]);function Bt(i,t="100",e="300 es"){const r=/^\s*#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const n of i)if(n.type==="preprocessor"){const o=r.exec(n.data);if(o){const a=o[1].replaceAll(/\s{2,}/g," ");if(a===e)return a;if(a===t)return n.data="#version "+e,t;throw new Error("unknown glsl version: "+a)}}return i.splice(0,0,{type:"preprocessor",data:"#version "+e},{type:"whitespace",data:` diff --git a/custom-toc-highlight/assets/ProgramTemplate-DQOm6Omy-Qewg1YCG.js b/custom-toc-highlight/assets/ProgramTemplate-DQOm6Omy-yxBgwK3o.js similarity index 91% rename from custom-toc-highlight/assets/ProgramTemplate-DQOm6Omy-Qewg1YCG.js rename to custom-toc-highlight/assets/ProgramTemplate-DQOm6Omy-yxBgwK3o.js index 1a1cf8e7..7924055d 100644 --- a/custom-toc-highlight/assets/ProgramTemplate-DQOm6Omy-Qewg1YCG.js +++ b/custom-toc-highlight/assets/ProgramTemplate-DQOm6Omy-yxBgwK3o.js @@ -1 +1 @@ -import{V as o}from"./Program-DLVwTiPA-C1hIaFuM.js";let d=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,r=new Map){if(r.has(e))return r.get(e);const t=this._read(e);if(!t)throw new Error(`cannot find shader file ${e}`);const a=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let s=a.exec(t);const i=[];for(;s!=null;)i.push({path:s[1],start:s.index,length:s[0].length}),s=a.exec(t);let l=0,n="";return i.forEach(h=>{n+=t.slice(l,h.start),n+=r.has(h.path)?"":this._resolve(h.path,r),l=h.start+h.length}),n+=t.slice(l),r.set(e,n),n}_read(e){return this._readFile(e)}};function u(e,r,t=""){return new o(e,t+r.shaders.vertexShader,t+r.shaders.fragmentShader,r.attributes)}export{d as c,u as d}; +import{V as o}from"./Program-DLVwTiPA-DI0GKSfI.js";let d=class{constructor(e){this._readFile=e}resolveIncludes(e){return this._resolve(e)}_resolve(e,r=new Map){if(r.has(e))return r.get(e);const t=this._read(e);if(!t)throw new Error(`cannot find shader file ${e}`);const a=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let s=a.exec(t);const i=[];for(;s!=null;)i.push({path:s[1],start:s.index,length:s[0].length}),s=a.exec(t);let l=0,n="";return i.forEach(h=>{n+=t.slice(l,h.start),n+=r.has(h.path)?"":this._resolve(h.path,r),l=h.start+h.length}),n+=t.slice(l),r.set(e,n),n}_read(e){return this._readFile(e)}};function u(e,r,t=""){return new o(e,t+r.shaders.vertexShader,t+r.shaders.fragmentShader,r.attributes)}export{d as c,u as d}; diff --git a/custom-toc-highlight/assets/Query-BrwMGK8U-DoFNfkjX.js b/custom-toc-highlight/assets/Query-BrwMGK8U-BPr0_G9t.js similarity index 98% rename from custom-toc-highlight/assets/Query-BrwMGK8U-DoFNfkjX.js rename to custom-toc-highlight/assets/Query-BrwMGK8U-BPr0_G9t.js index aad35ae0..d4926d07 100644 --- a/custom-toc-highlight/assets/Query-BrwMGK8U-DoFNfkjX.js +++ b/custom-toc-highlight/assets/Query-BrwMGK8U-BPr0_G9t.js @@ -1 +1 @@ -import{v as e,bz as l,S as t,bB as G,i as p,J as P,bW as z,cr as K,a0 as L,ad as C,bG as H,aa as Q,e as u,aK as x,n as X,ac as g,af as J,g as $,w as W,cs as A,ct as Z,P as T,aO as Y}from"./story-BfX8CRfG.js";import{y as ee}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{k as te}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./main-ugzBrWNm.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";var O;let b=O=class extends u{constructor(r){super(r),this.type="map-layer"}clone(){const{mapLayerId:r,gdbVersion:i}=this;return new O({mapLayerId:r,gdbVersion:i})}};e([l({mapLayer:"map-layer"})],b.prototype,"type",void 0),e([t({type:G,json:{write:!0}})],b.prototype,"mapLayerId",void 0),e([t({type:String,json:{write:!0}})],b.prototype,"gdbVersion",void 0),b=O=e([p("esri.layers.support.source.MapLayerSource")],b);var V;let d=V=class extends u{constructor(r){super(r),this.type="query-table"}clone(){const{workspaceId:r,query:i,oidFields:s,spatialReference:h,geometryType:c}=this,m={workspaceId:r,query:i,oidFields:s,spatialReference:h?.clone()??void 0,geometryType:c};return new V(m)}};e([l({queryTable:"query-table"})],d.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"query",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"oidFields",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"spatialReference",void 0),e([l(z)],d.prototype,"geometryType",void 0),d=V=e([p("esri.layers.support.source.QueryTableDataSource")],d);var D;let f=D=class extends u{constructor(r){super(r),this.type="raster"}clone(){const{workspaceId:r,dataSourceName:i}=this;return new D({workspaceId:r,dataSourceName:i})}};e([l({raster:"raster"})],f.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"dataSourceName",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"workspaceId",void 0),f=D=e([p("esri.layers.support.source.RasterDataSource")],f);var M;let v=M=class extends u{constructor(r){super(r),this.type="table"}clone(){const{workspaceId:r,gdbVersion:i,dataSourceName:s}=this;return new M({workspaceId:r,gdbVersion:i,dataSourceName:s})}};e([l({table:"table"})],v.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"gdbVersion",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"dataSourceName",void 0),v=M=e([p("esri.layers.support.source.TableDataSource")],v);var I,_;const re=K()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let a=I=class extends u{constructor(r){super(r),this.type="join-table"}readLeftTableSource(r,i,s){return k()(r,i,s)}castLeftTableSource(r){return A(N(),r)}readRightTableSource(r,i,s){return k()(r,i,s)}castRightTableSource(r){return A(N(),r)}clone(){const{leftTableKey:r,rightTableKey:i,leftTableSource:s,rightTableSource:h,joinType:c}=this,m={leftTableKey:r,rightTableKey:i,leftTableSource:s?.clone()??void 0,rightTableSource:h?.clone()??void 0,joinType:c};return new I(m)}};e([l({joinTable:"join-table"})],a.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"leftTableKey",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"rightTableKey",void 0),e([t({json:{write:!0}})],a.prototype,"leftTableSource",void 0),e([L("leftTableSource")],a.prototype,"readLeftTableSource",null),e([C("leftTableSource")],a.prototype,"castLeftTableSource",null),e([t({json:{write:!0}})],a.prototype,"rightTableSource",void 0),e([L("rightTableSource")],a.prototype,"readRightTableSource",null),e([C("rightTableSource")],a.prototype,"castRightTableSource",null),e([l(re)],a.prototype,"joinType",void 0),a=I=e([p("esri.layers.support.source.JoinTableDataSource")],a);let R=null;function k(){return R||(R=Z({types:N()})),R}let F=null;function N(){return F||(F={key:"type",base:null,typeMap:{"data-layer":y,"map-layer":b}}),F}const oe={key:"type",base:null,typeMap:{"join-table":a,"query-table":d,raster:f,table:v}};let y=_=class extends u{constructor(r){super(r),this.type="data-layer"}clone(){const{fields:r,dataSource:i}=this;return new _({fields:r,dataSource:i})}};e([l({dataLayer:"data-layer"})],y.prototype,"type",void 0),e([t({type:[ee],json:{write:!0}})],y.prototype,"fields",void 0),e([t({types:oe,json:{write:!0}})],y.prototype,"dataSource",void 0),y=_=e([p("esri.layers.support.source.DataLayerSource")],y),y.from=H(y);let w=class extends Q(u){constructor(r){super(r),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};e([t({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],w.prototype,"onFields",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"operator",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchTerm",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchType",void 0),w=e([p("esri.rest.support.FullTextSearch")],w);const ie=w;var E;const U=new x({upperLeft:"upper-left",lowerLeft:"lower-left"});let S=E=class extends u{constructor(r){super(r),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new E(T({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};e([t({type:X,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"extent",void 0),e([t({type:["view","edit"],json:{write:!0}})],S.prototype,"mode",void 0),e([t({type:String,json:{read:U.read,write:U.write}})],S.prototype,"originPosition",void 0),e([t({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"tolerance",void 0),S=E=e([p("esri.rest.support.QuantizationParameters")],S);const se=S,ae=new x({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"});var B;const q=new x({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 n=B=class extends u{constructor(r){super(r),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(r,i){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(i.statisticParameters=T(r))}clone(){return new B({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:T(this.statisticParameters)})}};e([t({type:Number,json:{write:!0}})],n.prototype,"maxPointCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxRecordCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxVertexCount",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"onStatisticField",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"outStatisticFieldName",void 0),e([t({type:String,json:{read:{source:"statisticType",reader:q.read},write:{target:"statisticType",writer:q.write}}})],n.prototype,"statisticType",void 0),e([t({type:Object})],n.prototype,"statisticParameters",void 0),e([g("statisticParameters")],n.prototype,"writeStatisticParameters",null),n=B=e([p("esri.rest.support.StatisticDefinition")],n);const ne=n;var j;const le=new x({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let o=j=class extends u{static from(r){return Y(j,r)}constructor(r){super(r),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}castDatumTransformation(r){return typeof r=="number"||typeof r=="object"?r:null}writeHistoricMoment(r,i){i.historicMoment=r&&r.getTime()}writeParameterValues(r,i){if(r){const s={};for(const h in r){const c=r[h];Array.isArray(c)?s[h]=c.map(m=>m instanceof Date?m.getTime():m):c instanceof Date?s[h]=c.getTime():s[h]=c}i.parameterValues=s}}writeStart(r,i){i.resultOffset=this.start,i.resultRecordCount=this.num||10,i.where="1=1"}writeWhere(r,i){i.where=r||"1=1"}clone(){return new j(T({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?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}))}};o.MAX_MAX_RECORD_COUNT_FACTOR=5,e([t({json:{write:!0}})],o.prototype,"aggregateIds",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"compactGeometryEnabled",void 0),e([t({json:{write:!0}})],o.prototype,"datumTransformation",void 0),e([C("datumTransformation")],o.prototype,"castDatumTransformation",null),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"defaultSpatialReferenceEnabled",void 0),e([t({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],o.prototype,"distance",void 0),e([t({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"formatOf3DObjects",void 0),e([t({type:[ie],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],o.prototype,"fullText",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),e([t({types:J,json:{read:$,write:!0}})],o.prototype,"geometry",void 0),e([t({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"groupByFieldsForStatistics",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"having",void 0),e([t({type:Date})],o.prototype,"historicMoment",void 0),e([g("historicMoment")],o.prototype,"writeHistoricMoment",null),e([t({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),e([t({type:Number,cast:r=>r<1?1:r>o.MAX_MAX_RECORD_COUNT_FACTOR?o.MAX_MAX_RECORD_COUNT_FACTOR:r,json:{write:{overridePolicy:r=>({enabled:r>1})}}})],o.prototype,"maxRecordCountFactor",void 0),e([t({type:["xyFootprint"],json:{write:!0}})],o.prototype,"multipatchOption",void 0),e([t({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),e([t({json:{write:!0}})],o.prototype,"objectIds",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),e([t({type:P,json:{name:"outSR",write:!0}})],o.prototype,"outSpatialReference",void 0),e([t({type:[ne],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],o.prototype,"outStatistics",void 0),e([t({json:{write:!0}})],o.prototype,"parameterValues",void 0),e([g("parameterValues")],o.prototype,"writeParameterValues",null),e([t({type:W,json:{write:!0}})],o.prototype,"pixelSize",void 0),e([t({type:se,json:{write:!0}})],o.prototype,"quantizationParameters",void 0),e([t({type:[Object],json:{write:!0}})],o.prototype,"rangeValues",void 0),e([t({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],o.prototype,"relationParameter",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"resultType",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnCentroid",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnDistinctValues",void 0),e([t({type:Boolean,json:{default:!0,write:!0}})],o.prototype,"returnExceededLimitFeatures",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"returnGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnQueryGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnM",void 0),e([t({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],o.prototype,"returnZ",void 0),e([t({type:P,json:{write:!0}})],o.prototype,"sourceSpatialReference",void 0),e([l(ae,{ignoreUnknown:!1,name:"spatialRel"})],o.prototype,"spatialRelationship",void 0),e([t({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),e([g("start"),g("num")],o.prototype,"writeStart",null),e([t({type:String,json:{write:!0}})],o.prototype,"sqlFormat",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"text",void 0),e([t({type:te,json:{write:!0}})],o.prototype,"timeExtent",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"timeReferenceUnknownClient",void 0),e([l(le,{ignoreUnknown:!1}),t({json:{write:{overridePolicy(r){return{enabled:!!r&&this.distance!=null&&this.distance>0}}}}})],o.prototype,"units",void 0),e([t({type:String,json:{write:{overridePolicy(r){return{enabled:r!=null||this.start!=null&&this.start>0}}}}})],o.prototype,"where",void 0),e([g("where")],o.prototype,"writeWhere",null),o=j=e([p("esri.rest.support.Query")],o);const pe=o,me=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"}));export{y as K,me as Q,se as a,pe as b,b as c,ne as m,ae as s}; +import{v as e,bz as l,S as t,bB as G,i as p,J as P,bW as z,cr as K,a0 as L,ad as C,bG as H,aa as Q,e as u,aK as x,n as X,ac as g,af as J,g as $,w as W,cs as A,ct as Z,P as T,aO as Y}from"./story-Doly9N9p.js";import{y as ee}from"./Field-C6hA1tZj-CkWoRbmp.js";import{k as te}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./main-QGPoLsvl.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";var O;let b=O=class extends u{constructor(r){super(r),this.type="map-layer"}clone(){const{mapLayerId:r,gdbVersion:i}=this;return new O({mapLayerId:r,gdbVersion:i})}};e([l({mapLayer:"map-layer"})],b.prototype,"type",void 0),e([t({type:G,json:{write:!0}})],b.prototype,"mapLayerId",void 0),e([t({type:String,json:{write:!0}})],b.prototype,"gdbVersion",void 0),b=O=e([p("esri.layers.support.source.MapLayerSource")],b);var V;let d=V=class extends u{constructor(r){super(r),this.type="query-table"}clone(){const{workspaceId:r,query:i,oidFields:s,spatialReference:h,geometryType:c}=this,m={workspaceId:r,query:i,oidFields:s,spatialReference:h?.clone()??void 0,geometryType:c};return new V(m)}};e([l({queryTable:"query-table"})],d.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"query",void 0),e([t({type:String,json:{write:!0}})],d.prototype,"oidFields",void 0),e([t({type:P,json:{write:!0}})],d.prototype,"spatialReference",void 0),e([l(z)],d.prototype,"geometryType",void 0),d=V=e([p("esri.layers.support.source.QueryTableDataSource")],d);var D;let f=D=class extends u{constructor(r){super(r),this.type="raster"}clone(){const{workspaceId:r,dataSourceName:i}=this;return new D({workspaceId:r,dataSourceName:i})}};e([l({raster:"raster"})],f.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"dataSourceName",void 0),e([t({type:String,json:{write:!0}})],f.prototype,"workspaceId",void 0),f=D=e([p("esri.layers.support.source.RasterDataSource")],f);var M;let v=M=class extends u{constructor(r){super(r),this.type="table"}clone(){const{workspaceId:r,gdbVersion:i,dataSourceName:s}=this;return new M({workspaceId:r,gdbVersion:i,dataSourceName:s})}};e([l({table:"table"})],v.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"workspaceId",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"gdbVersion",void 0),e([t({type:String,json:{write:!0}})],v.prototype,"dataSourceName",void 0),v=M=e([p("esri.layers.support.source.TableDataSource")],v);var I,_;const re=K()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let a=I=class extends u{constructor(r){super(r),this.type="join-table"}readLeftTableSource(r,i,s){return k()(r,i,s)}castLeftTableSource(r){return A(N(),r)}readRightTableSource(r,i,s){return k()(r,i,s)}castRightTableSource(r){return A(N(),r)}clone(){const{leftTableKey:r,rightTableKey:i,leftTableSource:s,rightTableSource:h,joinType:c}=this,m={leftTableKey:r,rightTableKey:i,leftTableSource:s?.clone()??void 0,rightTableSource:h?.clone()??void 0,joinType:c};return new I(m)}};e([l({joinTable:"join-table"})],a.prototype,"type",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"leftTableKey",void 0),e([t({type:String,json:{write:!0}})],a.prototype,"rightTableKey",void 0),e([t({json:{write:!0}})],a.prototype,"leftTableSource",void 0),e([L("leftTableSource")],a.prototype,"readLeftTableSource",null),e([C("leftTableSource")],a.prototype,"castLeftTableSource",null),e([t({json:{write:!0}})],a.prototype,"rightTableSource",void 0),e([L("rightTableSource")],a.prototype,"readRightTableSource",null),e([C("rightTableSource")],a.prototype,"castRightTableSource",null),e([l(re)],a.prototype,"joinType",void 0),a=I=e([p("esri.layers.support.source.JoinTableDataSource")],a);let R=null;function k(){return R||(R=Z({types:N()})),R}let F=null;function N(){return F||(F={key:"type",base:null,typeMap:{"data-layer":y,"map-layer":b}}),F}const oe={key:"type",base:null,typeMap:{"join-table":a,"query-table":d,raster:f,table:v}};let y=_=class extends u{constructor(r){super(r),this.type="data-layer"}clone(){const{fields:r,dataSource:i}=this;return new _({fields:r,dataSource:i})}};e([l({dataLayer:"data-layer"})],y.prototype,"type",void 0),e([t({type:[ee],json:{write:!0}})],y.prototype,"fields",void 0),e([t({types:oe,json:{write:!0}})],y.prototype,"dataSource",void 0),y=_=e([p("esri.layers.support.source.DataLayerSource")],y),y.from=H(y);let w=class extends Q(u){constructor(r){super(r),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};e([t({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.onFields!=null&&this.onFields.length>0}}}}})],w.prototype,"onFields",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"operator",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchTerm",void 0),e([t({type:String,json:{write:!0}})],w.prototype,"searchType",void 0),w=e([p("esri.rest.support.FullTextSearch")],w);const ie=w;var E;const U=new x({upperLeft:"upper-left",lowerLeft:"lower-left"});let S=E=class extends u{constructor(r){super(r),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new E(T({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};e([t({type:X,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"extent",void 0),e([t({type:["view","edit"],json:{write:!0}})],S.prototype,"mode",void 0),e([t({type:String,json:{read:U.read,write:U.write}})],S.prototype,"originPosition",void 0),e([t({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],S.prototype,"tolerance",void 0),S=E=e([p("esri.rest.support.QuantizationParameters")],S);const se=S,ae=new x({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"});var B;const q=new x({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 n=B=class extends u{constructor(r){super(r),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(r,i){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(i.statisticParameters=T(r))}clone(){return new B({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:T(this.statisticParameters)})}};e([t({type:Number,json:{write:!0}})],n.prototype,"maxPointCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxRecordCount",void 0),e([t({type:Number,json:{write:!0}})],n.prototype,"maxVertexCount",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"onStatisticField",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"outStatisticFieldName",void 0),e([t({type:String,json:{read:{source:"statisticType",reader:q.read},write:{target:"statisticType",writer:q.write}}})],n.prototype,"statisticType",void 0),e([t({type:Object})],n.prototype,"statisticParameters",void 0),e([g("statisticParameters")],n.prototype,"writeStatisticParameters",null),n=B=e([p("esri.rest.support.StatisticDefinition")],n);const ne=n;var j;const le=new x({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let o=j=class extends u{static from(r){return Y(j,r)}constructor(r){super(r),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}castDatumTransformation(r){return typeof r=="number"||typeof r=="object"?r:null}writeHistoricMoment(r,i){i.historicMoment=r&&r.getTime()}writeParameterValues(r,i){if(r){const s={};for(const h in r){const c=r[h];Array.isArray(c)?s[h]=c.map(m=>m instanceof Date?m.getTime():m):c instanceof Date?s[h]=c.getTime():s[h]=c}i.parameterValues=s}}writeStart(r,i){i.resultOffset=this.start,i.resultRecordCount=this.num||10,i.where="1=1"}writeWhere(r,i){i.where=r||"1=1"}clone(){return new j(T({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,formatOf3DObjects:this.formatOf3DObjects,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:this.historicMoment!=null?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}))}};o.MAX_MAX_RECORD_COUNT_FACTOR=5,e([t({json:{write:!0}})],o.prototype,"aggregateIds",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"compactGeometryEnabled",void 0),e([t({json:{write:!0}})],o.prototype,"datumTransformation",void 0),e([C("datumTransformation")],o.prototype,"castDatumTransformation",null),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"defaultSpatialReferenceEnabled",void 0),e([t({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],o.prototype,"distance",void 0),e([t({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"formatOf3DObjects",void 0),e([t({type:[ie],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.fullText!=null&&this.fullText.length>0}}}}})],o.prototype,"fullText",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),e([t({types:J,json:{read:$,write:!0}})],o.prototype,"geometry",void 0),e([t({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"groupByFieldsForStatistics",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"having",void 0),e([t({type:Date})],o.prototype,"historicMoment",void 0),e([g("historicMoment")],o.prototype,"writeHistoricMoment",null),e([t({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),e([t({type:Number,cast:r=>r<1?1:r>o.MAX_MAX_RECORD_COUNT_FACTOR?o.MAX_MAX_RECORD_COUNT_FACTOR:r,json:{write:{overridePolicy:r=>({enabled:r>1})}}})],o.prototype,"maxRecordCountFactor",void 0),e([t({type:["xyFootprint"],json:{write:!0}})],o.prototype,"multipatchOption",void 0),e([t({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),e([t({json:{write:!0}})],o.prototype,"objectIds",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),e([t({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),e([t({type:P,json:{name:"outSR",write:!0}})],o.prototype,"outSpatialReference",void 0),e([t({type:[ne],json:{write:{enabled:!0,overridePolicy(){return{enabled:this.outStatistics!=null&&this.outStatistics.length>0}}}}})],o.prototype,"outStatistics",void 0),e([t({json:{write:!0}})],o.prototype,"parameterValues",void 0),e([g("parameterValues")],o.prototype,"writeParameterValues",null),e([t({type:W,json:{write:!0}})],o.prototype,"pixelSize",void 0),e([t({type:se,json:{write:!0}})],o.prototype,"quantizationParameters",void 0),e([t({type:[Object],json:{write:!0}})],o.prototype,"rangeValues",void 0),e([t({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],o.prototype,"relationParameter",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"resultType",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnCentroid",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnDistinctValues",void 0),e([t({type:Boolean,json:{default:!0,write:!0}})],o.prototype,"returnExceededLimitFeatures",void 0),e([t({type:Boolean,json:{write:!0}})],o.prototype,"returnGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnQueryGeometry",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"returnM",void 0),e([t({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],o.prototype,"returnZ",void 0),e([t({type:P,json:{write:!0}})],o.prototype,"sourceSpatialReference",void 0),e([l(ae,{ignoreUnknown:!1,name:"spatialRel"})],o.prototype,"spatialRelationship",void 0),e([t({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),e([g("start"),g("num")],o.prototype,"writeStart",null),e([t({type:String,json:{write:!0}})],o.prototype,"sqlFormat",void 0),e([t({type:String,json:{write:!0}})],o.prototype,"text",void 0),e([t({type:te,json:{write:!0}})],o.prototype,"timeExtent",void 0),e([t({type:Boolean,json:{default:!1,write:!0}})],o.prototype,"timeReferenceUnknownClient",void 0),e([l(le,{ignoreUnknown:!1}),t({json:{write:{overridePolicy(r){return{enabled:!!r&&this.distance!=null&&this.distance>0}}}}})],o.prototype,"units",void 0),e([t({type:String,json:{write:{overridePolicy(r){return{enabled:r!=null||this.start!=null&&this.start>0}}}}})],o.prototype,"where",void 0),e([g("where")],o.prototype,"writeWhere",null),o=j=e([p("esri.rest.support.Query")],o);const pe=o,me=Object.freeze(Object.defineProperty({__proto__:null,default:pe},Symbol.toStringTag,{value:"Module"}));export{y as K,me as Q,se as a,pe as b,b as c,ne as m,ae as s}; diff --git a/custom-toc-highlight/assets/QueryEngine-CH5uUhZK-BP95Dm56.js b/custom-toc-highlight/assets/QueryEngine-CH5uUhZK-DRGPyg2C.js similarity index 97% rename from custom-toc-highlight/assets/QueryEngine-CH5uUhZK-BP95Dm56.js rename to custom-toc-highlight/assets/QueryEngine-CH5uUhZK-DRGPyg2C.js index 59c2f957..4d7c8eed 100644 --- a/custom-toc-highlight/assets/QueryEngine-CH5uUhZK-BP95Dm56.js +++ b/custom-toc-highlight/assets/QueryEngine-CH5uUhZK-DRGPyg2C.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); -import{_ as Ze}from"./main-ugzBrWNm.js";import{co as je,al as ce,aA as $e,by as E,P as J,aC as V,g as he,o as A,$ as Be,gW as ke,gX as He,gU as Le,gY as Je,p as W,aY as U,gZ as Ue,eQ as Ye,cf as de,ca as Ke,g_ as We,bh as Xe,cg as fe,gM as ie,gN as ae,ea as X,cn as be,g$ as et,eP as me,h0 as tt,h1 as st,dW as Ee,h2 as it}from"./story-BfX8CRfG.js";import{Y as at}from"./projection-BA9M1R7d-BYoCXVXt.js";import{B as pe}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{z as rt}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{b as ye}from"./LRUCache-C3erQTWv-0wD6drRf.js";import{Z as nt}from"./WhereClause-DxwoyBMS-DnXKVpm2.js";import{i as ge}from"./fieldType-CD2CL2hr-CMChCO5s.js";import{T as ot,r as Z,g as O,G as lt,d as Ve,a as j,e as ee,S as ze}from"./timeSupport-jPViR5jn-GyoVmGVI.js";import{p as N,v as ut,f as re,h as D,D as xe,C as ct}from"./queryUtils-Brxu6254-PPvpiP5X.js";import{t as ht}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{z as _e}from"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import{C as dt}from"./utils-HtkT8Fn3-wUwu1nm1.js";import{l as Fe,N as we,s as ft,c as mt,m as pt,E as yt,h as gt,V as xt,k as _t,M as Ft,x as te,f as wt,D as St}from"./utils-tNxq3jkf-B78XlSIE.js";import{o as It}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{p as Se}from"./Scheduler-B7UX7Wr5-DQCcMKpm.js";let Tt=class{constructor(n,e){this._cache=new ye(n),this._invalidCache=new ye(e)}get(n,e){const t=`${e.uid}:${n}`,s=this._cache.get(t);if(s)return s;if(this._invalidCache.get(t)!=null)return null;try{const i=nt.create(n,{fieldsIndex:e});return this._cache.put(t,i),i}catch(i){return this._invalidCache.put(t,i),null}}getError(n,e){const t=`${e.uid}:${n}`;return this._invalidCache.get(t)??null}};const Ce=new Tt(50,500),$="unsupported-query",Me=" as ",De=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),qe=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),Rt=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...De,...qe]);function ne(n,e,t={}){const s=q(e,n);if(!s){const a=Ce.getError(e,n);throw new A($,"invalid SQL expression",{expression:e,error:a})}const i=t.expressionName||"expression";if(t.validateStandardized&&!s.isStandardized)throw new A($,`${i} is not standard`,{expression:e});if(t.validateAggregate&&!s.isAggregate)throw new A($,`${i} does not contain a valid aggregate function`,{expression:e});return s.fieldNames}function vt(n,e,t,s){if(!t)return!0;const i="where clause";return C(n,e,ne(n,t,{validateStandardized:!0,expressionName:i}),{expressionName:i,query:s}),!0}function At(n,e,t,s,i){if(!t)return!0;const a="having clause",r=ne(n,t,{validateAggregate:!0,expressionName:a});if(C(n,e,r,{expressionName:a,query:i}),!q(t,n)?.getExpressions().every(o=>{const{aggregateType:l,field:u}=o,c=n.get(u)?.name;return s.some(h=>{const{onStatisticField:d,statisticType:m}=h;return n.get(d)?.name===c&&m.toLowerCase().trim()===l})}))throw new A($,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function q(n,e){return n?Ce.get(n,e):null}function Qe(n){return/\((.*?)\)/.test(n)?n:n.split(Me)[0]}function bt(n){return n.split(Me)[1]}function C(n,e,t,s={}){const i=new Map;if(Et(i,n,e,s.allowedFieldTypes??Rt,t),i.size){const a=s.expressionName??"expression";throw new A($,`${a} contains invalid or missing fields`,{errors:Array.from(i.values()),query:s.query})}}function Et(n,e,t,s,i){const a=i.includes("*")?[...t,...i.filter(r=>r!=="*")]:i;for(const r of a)if(e.get(r))Ie(n,e,t,s,r);else try{const o=ne(e,Qe(r),{validateStandardized:!0});for(const l of o)Ie(n,e,t,s,l)}catch(o){n.set(r,{type:"expression-error",expression:r,error:o})}}function Ie(n,e,t,s,i){const a=e.get(i);a?t.has(a.name)?s!=="all"&&s?.has(a.type)===!1&&n.set(i,{type:"invalid-type",fieldName:a.name,fieldType:ge.fromJSON(a.type),allowedFieldTypes:Array.from(s,r=>ge.fromJSON(r))}):n.set(i,{type:"missing-field",fieldName:a.name}):n.set(i,{type:"invalid-field",fieldName:i})}const Vt=5;let zt=class{constructor(){this._storage=new Map,this._purgeInterval=Vt,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const n=1e3*this._purgeInterval,e=performance.now()-n;for(const[t,s]of this._storage){if(!(s.time0&&(this._timer=setTimeout(this._sweep,n)));this._storage.delete(t)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}get size(){return this._storage?.size??0}put(n,e){this._storage?.set(n,new Mt(e)),this._scheduleSweep()}get(n){if(!this._storage)return;const e=this._storage?.get(n);return e?(this._storage?.delete(n),e.time=performance.now(),this._storage?.set(n,e),e.items):void 0}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}},Ct=0;class Mt{constructor(e){this.items=e,this.time=performance.now(),this.id=Ct++}}let L=class{constructor(n,e,t){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=n.returnDistinctValues??!1,this.fieldsIndex=t,this.featureAdapter=e;const s=n.outFields;if(s&&!s.includes("*")){this.outFields=s;let i=0;for(const a of s){const r=Qe(a),o=this.fieldsIndex.get(r),l=o?null:q(r,t),u=o?o.name:bt(a)||"FIELD_EXP_"+i++;this._fieldDataCache.set(a,{alias:u,clause:l})}}}countDistinctValues(n){return this.returnDistinctValues?(n.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):n.length}getAttributes(n){const e=this._processAttributesForOutFields(n);return this._processAttributesForDistinctValues(e)}getFieldValue(n,e,t){const s=t?t.name:e;let i=null;return this._fieldDataCache.has(s)?i=this._fieldDataCache.get(s)?.clause:t||(i=q(e,this.fieldsIndex),this._fieldDataCache.set(s,{alias:s,clause:i})),t?this.featureAdapter.getAttribute(n,s):i?.calculateValue(n,this.featureAdapter)}getDataValues(n,e,t=!0){const s=e.normalizationType,i=e.normalizationTotal,a=this.fieldsIndex.get(e.field),r=ie(a)||ae(a),o=be(a);return n.map(l=>{let u=e.field&&this.getFieldValue(l,e.field,this.fieldsIndex.get(e.field));if(e.field2?(u=`${te(u)}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field2,this.fieldsIndex.get(e.field2)))}`,e.field3&&(u=`${u}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field3,this.fieldsIndex.get(e.field3)))}`)):typeof u=="string"&&t&&(r?u=u?new Date(u).getTime():null:o&&(u=u?dt(u):null)),s&&Number.isFinite(u)){const c=s==="field"&&e.normalizationField?this.getFieldValue(l,e.normalizationField,this.fieldsIndex.get(e.normalizationField)):null;u=wt(u,s,c,i)}return u})}async getExpressionValues(n,e,t,s,i){const{arcadeUtils:a}=await Ee(),r=a.hasGeometryOperations(e);r&&await a.enableGeometryOperations();const o=a.createFunction(e),l=a.getViewInfo(t),u={fields:this.fieldsIndex.fields};return n.map(c=>{const h={attributes:this.featureAdapter.getAttributes(c),layer:u,geometry:r?{...j(s.geometryType,s.hasZ,s.hasM,this.featureAdapter.getGeometry(c)),spatialReference:t?.spatialReference}:null},d=a.createExecContext(h,l,i);return a.executeFunction(o,d)})}validateItem(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testFeature(n,this.featureAdapter)??!1}validateItems(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testSet(n,this.featureAdapter)??!1}_processAttributesForOutFields(n){const e=this.outFields;if(!e?.length)return this.featureAdapter.getAttributes(n);const t={};for(const s of e){const{alias:i,clause:a}=this._fieldDataCache.get(s);t[i]=a?a.calculateValue(n,this.featureAdapter):this.featureAdapter.getAttribute(n,i)}return t}_processAttributesForDistinctValues(n){if(n==null||!this.returnDistinctValues)return n;const e=this.outFields,t=[];if(e)for(const a of e){const{alias:r}=this._fieldDataCache.get(a);t.push(n[r])}else for(const a in n)t.push(n[a]);const s=`${(e||["*"]).join(",")}=${t.join(",")}`;let i=this._returnDistinctMap.get(s)||0;return this._returnDistinctMap.set(s,++i),i>1?null:n}};function Te(n,e,t){return{objectId:n,target:e,distance:t,type:"vertex"}}function Dt(n,e,t,s,i,a=!1){return{objectId:n,target:e,distance:t,type:"edge",start:s,end:i,draped:a}}class v{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new L(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query;if(!t?.length)return 1;const a=new Map,r=new Map,o=new Set;for(const l of i){const{statisticType:u}=l,c=u!=="exceedslimit"?l.onStatisticField:void 0;if(!r.has(c)){const d=[];for(const m of t){const y=this._getAttributeValues(e,m,a);d.push(y)}r.set(c,this._calculateUniqueValues(d,e.returnDistinctValues))}const h=r.get(c);for(const d in h){const{data:m,items:y}=h[d],f=m.join(",");s&&!e.validateItems(y,s)||o.add(f)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;U(this.query.outSR)&&!V(t.spatialReference,this.query.outSR)?e.queryGeometry=Z({spatialReference:this.query.outSR,...D(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=Z({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=Re(this.hasZ,this.hasM),{point:a,mode:r}=e,o=typeof e.distance=="number"?e.distance:e.distance.x,l=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},c=this.geometryType==="esriGeometryPolygon",h=this._getPointCreator(r,this.spatialReference,t),d=new ve(null,0),m=new ve(null,0),y={x:0,y:0,z:0};for(const f of this.items){const w=s.getGeometry(f);if(w==null)continue;const{coords:_,lengths:I}=w;if(d.coords=_,m.coords=_,e.returnEdge){let S=0;for(let g=0;gf.distance-w.distance),u}_getPointCreator(e,t,s){const i=s==null||V(t,s)?o=>o:o=>D(o,t,s),{hasZ:a}=this,r=0;return e==="3d"?a?({x:o,y:l,z:u})=>i({x:o,y:l,z:u}):({x:o,y:l})=>i({x:o,y:l,z:r}):({x:o,y:l})=>i({x:o,y:l})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,minValue:o,maxValue:l,scale:u,timeZone:c,outStatisticTypes:h}=e,d=this.fieldsIndex.get(t),m=fe(d)||ie(d)||ae(d),y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:u,timeZone:c}),f=St({normalizationType:a,normalizationField:i,minValue:o,maxValue:l}),w={value:.5,fieldType:d?.type},_=X(d)?Fe({values:y,supportsNullCount:f,percentileParams:w,outStatisticTypes:h}):we({values:y,minValue:o,maxValue:l,useSampleStdDev:!a,supportsNullCount:f,percentileParams:w,outStatisticTypes:h});return ft(_,h,m)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:r,timeZone:o}=e,l=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:r,timeZone:o},!1),u=mt(l);return pt(u,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m}),f=yt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h});return gt(f,o)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m});return xt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.reverse()){const a=i.split(" "),r=a[0],o=this.fieldsIndex.get(r),l=!!a[1]&&a[1].toLowerCase()==="desc",u=_t(o?.type,l);e.sort((c,h)=>{const d=s(c,r,o),m=s(h,r,o);return u(d,m)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:h,resultOffset:d,returnZ:m,returnM:y}=e,f=h!=null&&t.length>(d||0)+h,w=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(_=>this.fieldsIndex.get(_)));return{exceededTransferLimit:f,features:this._createFeatures(e,t),fields:w,geometryType:s,hasM:i&&y,hasZ:a&&m,objectIdFieldName:r,spatialReference:Z(u||o),transform:c&&_e(c)||null}}_createFeatures(e,t){const s=new L(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:c,resultOffset:h,resultRecordCount:d,returnZ:m=!1,returnM:y=!1}=e,f=a&&m,w=i&&y;let _=[],I=0;const S=[...t];if(this._sortFeatures(S,r,(p,F,x)=>s.getFieldValue(p,F,x)),this.geometryType&&(l||u)){const p=_e(o)??void 0,F=this.geometryType==="esriGeometryPolygon"||this.geometryType==="esriGeometryPolyline";if(l&&!u)for(const x of S){const T=this.featureAdapter.getGeometry(x),R={attributes:s.getAttributes(x),geometry:j(this.geometryType,this.hasZ,this.hasM,T,c,p,f,w)};F&&T&&!R.geometry&&(R.centroid=ee(this,this.featureAdapter.getCentroid(x,this),p)),_[I++]=R}else if(!l&&u)for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p)};else for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p),geometry:j(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(x),c,p,f,w)}}else for(const p of S){const F=s.getAttributes(p);F&&(_[I++]={attributes:F})}const g=h||0;if(d!=null){const p=g+d;_=_.slice(g,Math.min(_.length,p))}return _}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(const r of e.outStatistics??[])if(r.statisticType==="exceedslimit"){s=r.maxPointCount!=null?r.maxPointCount:Number.POSITIVE_INFINITY,i=r.maxRecordCount!=null?r.maxRecordCount:Number.POSITIVE_INFINITY,a=r.maxVertexCount!=null?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>s;else if(this.items.length>i)t=!0;else{const r=Re(this.hasZ,this.hasM),o=this.featureAdapter;t=this.items.reduce((l,u)=>{const c=o.getGeometry(u);return l+(c!=null&&c.coords.length||0)},0)/r>a}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,a=new Map,r=new Map,o=new Map,l=new L(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:h,orderByFields:d,resultRecordCount:m}=e,y=c?.length,f=!!y,w=f?c[0]:null,_=f&&!this.fieldsIndex.get(w);for(const S of u??[]){const{outStatisticFieldName:g,statisticType:p}=S,F=S,x=p!=="exceedslimit"?S.onStatisticField:void 0,T=p==="percentile_disc"||p==="percentile_cont",R=p==="EnvelopeAggregate"||p==="CentroidAggregate"||p==="ConvexHullAggregate",M=f&&y===1&&(x===w||_)&&p==="count";if(f){if(!r.has(x)){const k=[];for(const K of c){const H=this._getAttributeValues(l,K,i);k.push(H)}r.set(x,this._calculateUniqueValues(k,!R&&l.returnDistinctValues))}const b=r.get(x);if(!b)continue;const Y=Object.keys(b);for(const k of Y){const{count:K,data:H,items:oe,itemPositions:Pe}=b[k],le=H.join(",");if(!h||l.validateItems(oe,h)){const Q=o.get(le)||{attributes:{}};if(R){Q.aggregateGeometries||(Q.aggregateGeometries={});const{aggregateGeometries:z,outStatisticFieldName:G}=await this._getAggregateGeometry(F,oe);Q.aggregateGeometries[G]=z}else{let z=null;if(M)z=K;else{const G=this._getAttributeValues(l,x,i),ue=Pe.map(Oe=>G[Oe]);z=T&&"statisticParameters"in F?this._getPercentileValue(F,ue):this._getStatisticValue(F,ue,null,l.returnDistinctValues)}Q.attributes[g]=z}let Ge=0;c.forEach((z,G)=>Q.attributes[this.fieldsIndex.get(z)?z:"EXPR_"+ ++Ge]=H[G]),o.set(le,Q)}}}else if(R){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:b,outStatisticFieldName:Y}=await this._getAggregateGeometry(F,this.items);t.aggregateGeometries[Y]=b}else{const b=this._getAttributeValues(l,x,i);t.attributes[g]=T&&"statisticParameters"in F?this._getPercentileValue(F,b):this._getStatisticValue(F,b,a,l.returnDistinctValues)}const B=p!=="min"&&p!=="max"||!X(this.fieldsIndex.get(x))&&!this._isAnyDateField(x)?null:this.fieldsIndex.get(x)?.type;s.push({name:g,alias:g,type:B||"esriFieldTypeDouble"})}const I=f?Array.from(o.values()):[t];return this._sortFeatures(I,d,(S,g)=>S.attributes[g]),m&&(I.length=Math.min(m,I.length)),{fields:s,features:I}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return fe(t)||ie(t)||ae(t)||be(t)}async _getAggregateGeometry(e,t){const{convexHull:s,union:i}=await Ze(()=>import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(f=>f.g),{statisticType:a,outStatisticFieldName:r}=e,{featureAdapter:o,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,d=t.map(f=>j(u,c,h,o.getGeometry(f))),m=s(l,d,!0)[0],y={aggregateGeometries:null,outStatisticFieldName:null};if(a==="EnvelopeAggregate"){const f=m?et(m):me(i(l,d));y.aggregateGeometries={...f,spatialReference:l},y.outStatisticFieldName=r||"extent"}else if(a==="CentroidAggregate"){const f=m?tt(m):st(me(i(l,d)));y.aggregateGeometries={x:f[0],y:f[1],spatialReference:l},y.outStatisticFieldName=r||"centroid"}else a==="ConvexHullAggregate"&&(y.aggregateGeometries=m,y.outStatisticFieldName=r||"convexHull");return y}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:r}=e;let o=null;return o=s?.has(a)?s.get(a):X(this.fieldsIndex.get(a))||this._isAnyDateField(a)?Fe({values:t,returnDistinct:i}):we({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,o),o[r==="var"?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:r,orderBy:o}=i,l=this.fieldsIndex.get(s);return Ft(t,{value:r,orderBy:o,fieldType:l?.type,isDiscrete:a==="percentile_disc"})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),a=this.items.map(r=>e.getFieldValue(r,t,i));return s.set(t,a),a}_calculateUniqueValues(e,t){const s={},i=this.items,a=i.length;for(let r=0;rn)}function Ne(n,e,t){const{outFields:s,orderByFields:i,returnDistinctValues:a,outStatistics:r}=t,o=r?r.map(l=>l.outStatisticFieldName&&l.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(i&&i.length>0){const l=" asc",u=" desc",c=i.map(h=>{const d=h.toLowerCase();return d.includes(l)?d.split(l)[0]:d.includes(u)?d.split(u)[0]:h}).filter(h=>!o.includes(h));C(n,e,c,{expressionName:"orderByFields",query:t})}if(s&&s.length>0)C(n,e,s,{expressionName:"outFields",query:t,allowedFieldTypes:"all"});else if(a)throw new A(P,"outFields should be specified for returnDistinctValues",{query:t});vt(n,e,t.where,t)}const Qt=new Set([...De,...qe]);function Nt(n,e,t){const{outStatistics:s,groupByFieldsForStatistics:i,having:a}=t,r=i?.length,o=s?.length;if(a){if(!r||!o)throw new A(P,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:t});At(n,e,a,s,t)}if(o){if(!Ot(s))return;const l=s.map(u=>u.onStatisticField).filter(Boolean);C(n,e,l,{expressionName:"onStatisticFields",query:t}),r&&C(n,e,i,{expressionName:"groupByFieldsForStatistics",query:t});for(const u of s){const{onStatisticField:c,statisticType:h}=u;if((h==="percentile_disc"||h==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:d}=u;if(!d)throw new A(P,"statisticParameters should be set for percentile type",{definition:u,query:t})}else n.get(c)&&h!=="count"&&h!=="min"&&h!=="max"&&C(n,e,[c],{expressionName:`outStatistics with '${h}' statistic type`,allowedFieldTypes:Qt,query:t})}}}async function Pt(n,e,{fieldsIndex:t,geometryType:s,spatialReference:i,availableFields:a}){if((n.distance??0)<0||n.geometryPrecision!=null||n.multipatchOption||n.pixelSize||n.relationParam||n.text||n.outStatistics||n.groupByFieldsForStatistics||n.having||n.orderByFields)throw new A(P,"Unsupported query options",{query:n});return Ne(t,a,n),Promise.all([Gt(t,a,e,n),ze(n,s,i),re(i,n.outSR)]).then(()=>n)}async function Gt(n,e,t,s){let i=[];if(t.valueExpression){const{arcadeUtils:a}=await Ee();i=a.extractFieldNames(t.valueExpression)}if(t.field&&i.push(t.field),t.field2&&i.push(t.field2),t.field3&&i.push(t.field3),t.normalizationField&&i.push(t.normalizationField),!i.length&&!t.valueExpression)throw new A(P,"field or valueExpression is required",{params:t});C(n,e,i,{expressionName:"statistics",query:s})}function Ot(n){return n!=null&&n.every(e=>e.statisticType!=="exceedslimit")}const Zt="unsupported-query";class as{constructor(e){this._cache=new zt,this._changeHandle=null,this.capabilities={query:ht},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,this.fieldsIndex=je(e.fieldsIndex)?e.fieldsIndex:It.fromJSON(e.fieldsIndex),!e.availableFields||e.availableFields.length===1&&e.availableFields[0]==="*"?this.availableFields=new Set(this.fieldsIndex.fields.map(t=>t.name)):this.availableFields=new Set(e.availableFields.map(t=>this.fieldsIndex.get(t)?.name).filter(t=>t!=null)),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=ce(this._frameTask),this.clearCache(),$e(this._cache),this._changeHandle=ce(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const s=E(t);try{return await(await this._executeQuery(e,{},s)).createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const s=E(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},s)).createQueryResponseForCount()}catch(i){if(i!==N)throw i;return 0}}async executeQueryForExtent(e,t){const s=E(t),i=e.outSR;try{const a=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),r=a.size;return r?{count:r,extent:await this._getBounds(a.items,a.spatialReference,i||this.spatialReference)}:{count:0,extent:null}}catch(a){if(a===N)return{count:0,extent:null};throw a}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(s=>Array.from(s))}async executeQueryForIdSet(e,t){const s=E(t);try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),a=i.items,r=new Set;return await this._reschedule(()=>{for(const o of a)r.add(i.featureAdapter.getObjectId(o))},s),r}catch(i){if(i===N)return new Set;throw i}}async executeQueryForSnapping(e,t){const s=E(t),{point:i,distance:a,returnEdge:r,vertexMode:o}=e;if(!r&&o==="none")return{candidates:[]};let l=J(e.query);l=await this._schedule(()=>ut(l,this.definitionExpression,this.spatialReference),s),l=await this._reschedule(()=>Ae(l,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const u=!V(i.spatialReference,this.spatialReference);u&&await re(i.spatialReference,this.spatialReference);const c=typeof a=="number"?a:a.x,h=typeof a=="number"?a:a.y,d={xmin:i.x-c,xmax:i.x+c,ymin:i.y-h,ymax:i.y+h,spatialReference:i.spatialReference},m=u?D(d,this.spatialReference):d;if(!m)return{candidates:[]};const y=(await pe(he(i),null,{signal:s}))[0],f=(await pe(he(m),null,{signal:s}))[0];if(y==null||f==null)return{candidates:[]};const w=new v(await this._reschedule(()=>this._searchFeatures(se(f.toJSON())),s),l,this);await this._reschedule(()=>this._executeObjectIdsQuery(w),s),await this._reschedule(()=>this._executeTimeQuery(w),s),await this._reschedule(()=>this._executeAttributesQuery(w),s),await this._reschedule(()=>this._executeGeometryQueryForSnapping(w,s),s);const _=y.toJSON(),I=u?D(_,this.spatialReference):_,S=u?Math.max(m.xmax-m.xmin,m.ymax-m.ymin)/2:a;return w.createSnappingResponse({...e,point:I,distance:S},i.spatialReference)}async executeQueryForLatestObservations(e,t){const s=E(t);if(!this.timeInfo?.trackIdField)throw new A(Zt,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const i=await this._executeQuery(e,{},s);return await this._reschedule(()=>this._filterLatest(i),s),await i.createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const i=E(s),{field:a,field2:r,field3:o,valueExpression:l}=t;return(await this._executeQueryForStatistics(e,{field:a,field2:r,field3:o,valueExpression:l},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=E(e);this._timeExtentPromise||=ot(this.timeInfo,this.featureStore);const[s,i]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return Be(t),{fullExtent:s,timeExtent:i}}async _getBounds(e,t,s){const i=ke(Le(),He);await this.featureStore.forEachBounds(e,o=>Je(i,o));const a={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:Z(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(a.zmin=i[2],a.zmax=i[5],a.hasZ=!0);const r=D(a,t,s);if(r.spatialReference=Z(s),r.xmax-r.xmin==0){const o=W(r.spatialReference);r.xmin-=o,r.xmax+=o}if(r.ymax-r.ymin==0){const o=W(r.spatialReference);r.ymin-=o,r.ymax+=o}if(this.hasZ&&r.zmin!=null&&r.zmax!=null&&r.zmax-r.zmin==0){const o=W(r.spatialReference);r.zmin-=o,r.zmax+=o}return r}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(Se)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(Se)}async _getAllFeaturesQueryEngineResult(e){return new v(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const s=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(i=>s.push(i))})().then(()=>s)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=J(e),e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Ae(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s),e={...e,...t};const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:s,returnGeometry:i,returnCentroid:a}=e,r=this.featureStore.featureSpatialReference,o=e.sceneFilter.geometry,l=r==null||V(r,o.spatialReference)?o:D(o,r);if(!l)return null;const u=i||a,c=U(s)&&!V(this.spatialReference,s)&&u?async f=>this._project(f,s):f=>f,h=this.featureAdapter,d=await this._reschedule(()=>this._searchFeatures(se(l)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!d.length)return null;const f=new Set;for(const I of d)f.add(h.getObjectId(I));const w=await this._reschedule(()=>this._getAllFeatures(),t),_=await this._reschedule(async()=>{const I=await O("esriSpatialRelDisjoint",l,this.geometryType,this.hasZ,this.hasM),S=p=>!f.has(h.getObjectId(p))||I(h.getGeometry(p)),g=await this._runSpatialFilter(w,S,t);return new v(g,e,this)},t);return c(_)}if(!d.length)return new v([],e,this);if(this._canExecuteSinglePass(l,e))return c(new v(d,e,this));const m=await O("esriSpatialRelContains",l,this.geometryType,this.hasZ,this.hasM),y=await this._runSpatialFilter(d,f=>m(h.getGeometry(f)),t);return c(new v(y,e,this))}async _executeGeometryQuery(e,t,s){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:i,outSR:a,spatialRel:r,returnGeometry:o,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!i||u==null||V(u,i.spatialReference)?i:D(i,u),h=o||l,d=U(a)&&!V(this.spatialReference,a),m=t==null?this._getCacheKey(e):null,y=m?this._cache.get(m):null;if(y!=null)return new v(y,e,this);const f=async g=>(d&&h&&await this._project(g,a),m&&this._cache.put(m,g.items),g);if(!c)return f(t??await this._getAllFeaturesQueryEngineResult(e));const w=this.featureAdapter;let _=await this._reschedule(()=>this._searchFeatures(se(i)),s);if(r==="esriSpatialRelDisjoint"){if(!_.length)return f(t??await this._getAllFeaturesQueryEngineResult(e));const g=new Set;for(const x of _)g.add(w.getObjectId(x));const p=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),s),F=await this._reschedule(async()=>{const x=await O(r,c,this.geometryType,this.hasZ,this.hasM),T=M=>!g.has(w.getObjectId(M))||x(w.getGeometry(M)),R=await this._runSpatialFilter(p,T,s);return new v(R,e,this)},s);return f(F)}if(t!=null){const g=new it;_=_.filter(p=>Ue(t.items,p,t.items.length,g)>=0)}if(!_.length){const g=new v([],e,this);return m&&this._cache.put(m,g.items),g}if(this._canExecuteSinglePass(c,e))return f(new v(_,e,this));const I=await O(r,c,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(_,g=>I(w.getGeometry(g)),s);return f(new v(S,e,this))}async _executeGeometryQueryForSnapping(e,t){const{query:s}=e,{spatialRel:i}=s;if(!e?.items?.length||!s.geometry||!i)return;const a=await O(i,s.geometry,this.geometryType,this.hasZ,this.hasM),r=await this._runSpatialFilter(e.items,o=>a(o.geometry),t);e.items=r}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds?.length||this.aggregateAdapter==null)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(a=>t.add(a));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?.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=lt(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=q(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(this._frameTask==null)return e.filter(o=>t(o));let i=0;const a=new Array,r=async o=>{for(;ir(u),s)}};return this._reschedule(o=>r(o),s).then(()=>a)}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,a=i||s,r=new Map,o=this.featureAdapter.getAttribute;for(const l of e.items){const u=o(l,t),c=o(l,a),h=r.get(u);(!h||c>o(h,a))&&r.set(u,l)}e.items=Array.from(r.values())}_getCacheKey(e){const{geometry:t,spatialRel:s,returnGeometry:i,returnCentroid:a,outSR:r,resultType:o,cacheHint:l}=e;if(o!=="tile"&&!l)return null;const u=i||a;return U(r)&&!V(this.spatialReference,r)&&u?JSON.stringify([t,s,r]):JSON.stringify([t,s])}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return Ve(e)&&(s==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(s==="esriSpatialRelIntersects"||s==="esriSpatialRelContains"))}async _project(e,t){if(!t||V(this.spatialReference,t))return e;const s=this.featureAdapter;let i;try{const r=await this._getFullExtent();i=at(this.spatialReference,t,r)}catch{}const a=await ct(e.items.map(r=>j(this.geometryType,this.hasZ,this.hasM,s.getGeometry(r))),this.spatialReference,t,i);return e.items=a.map((r,o)=>s.cloneWithGeometry(e.items[o],rt(r,this.hasZ,this.hasM))),e}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(i=>this.featureStore.forEachInBounds(i,a=>t.add(a))));const s=Array.from(t.values());return t.clear(),s}async _executeQueryForStatistics(e,t,s){e=J(e);try{e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Pt(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}catch(i){if(i!==N)throw i;return new v([],e,this)}}}function se(n){if(Ve(n)){if(Ye(n))return[de(Math.min(n.xmin,n.xmax),Math.min(n.ymin,n.ymax),Math.max(n.xmin,n.xmax),Math.max(n.ymin,n.ymax))];if(Ke(n))return n.rings.map(e=>de(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1])))}return[We(Xe(),n)]}export{as as Z}; +import{_ as Ze}from"./main-QGPoLsvl.js";import{co as je,al as ce,aA as $e,by as E,P as J,aC as V,g as he,o as A,$ as Be,gW as ke,gX as He,gU as Le,gY as Je,p as W,aY as U,gZ as Ue,eQ as Ye,cf as de,ca as Ke,g_ as We,bh as Xe,cg as fe,gM as ie,gN as ae,ea as X,cn as be,g$ as et,eP as me,h0 as tt,h1 as st,dW as Ee,h2 as it}from"./story-Doly9N9p.js";import{Y as at}from"./projection-BA9M1R7d-CAbqHZiw.js";import{B as pe}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{z as rt}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{b as ye}from"./LRUCache-C3erQTWv-grHgYSP-.js";import{Z as nt}from"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import{i as ge}from"./fieldType-CD2CL2hr-Do9kp-dx.js";import{T as ot,r as Z,g as O,G as lt,d as Ve,a as j,e as ee,S as ze}from"./timeSupport-jPViR5jn-7bshRI7L.js";import{p as N,v as ut,f as re,h as D,D as xe,C as ct}from"./queryUtils-Brxu6254-CDiE0zms.js";import{t as ht}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{z as _e}from"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import{C as dt}from"./utils-HtkT8Fn3-Dd_0rdy5.js";import{l as Fe,N as we,s as ft,c as mt,m as pt,E as yt,h as gt,V as xt,k as _t,M as Ft,x as te,f as wt,D as St}from"./utils-tNxq3jkf-nfQcZo7O.js";import{o as It}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{p as Se}from"./Scheduler-B7UX7Wr5-DriQgzLZ.js";let Tt=class{constructor(n,e){this._cache=new ye(n),this._invalidCache=new ye(e)}get(n,e){const t=`${e.uid}:${n}`,s=this._cache.get(t);if(s)return s;if(this._invalidCache.get(t)!=null)return null;try{const i=nt.create(n,{fieldsIndex:e});return this._cache.put(t,i),i}catch(i){return this._invalidCache.put(t,i),null}}getError(n,e){const t=`${e.uid}:${n}`;return this._invalidCache.get(t)??null}};const Ce=new Tt(50,500),$="unsupported-query",Me=" as ",De=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),qe=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),Rt=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...De,...qe]);function ne(n,e,t={}){const s=q(e,n);if(!s){const a=Ce.getError(e,n);throw new A($,"invalid SQL expression",{expression:e,error:a})}const i=t.expressionName||"expression";if(t.validateStandardized&&!s.isStandardized)throw new A($,`${i} is not standard`,{expression:e});if(t.validateAggregate&&!s.isAggregate)throw new A($,`${i} does not contain a valid aggregate function`,{expression:e});return s.fieldNames}function vt(n,e,t,s){if(!t)return!0;const i="where clause";return C(n,e,ne(n,t,{validateStandardized:!0,expressionName:i}),{expressionName:i,query:s}),!0}function At(n,e,t,s,i){if(!t)return!0;const a="having clause",r=ne(n,t,{validateAggregate:!0,expressionName:a});if(C(n,e,r,{expressionName:a,query:i}),!q(t,n)?.getExpressions().every(o=>{const{aggregateType:l,field:u}=o,c=n.get(u)?.name;return s.some(h=>{const{onStatisticField:d,statisticType:m}=h;return n.get(d)?.name===c&&m.toLowerCase().trim()===l})}))throw new A($,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function q(n,e){return n?Ce.get(n,e):null}function Qe(n){return/\((.*?)\)/.test(n)?n:n.split(Me)[0]}function bt(n){return n.split(Me)[1]}function C(n,e,t,s={}){const i=new Map;if(Et(i,n,e,s.allowedFieldTypes??Rt,t),i.size){const a=s.expressionName??"expression";throw new A($,`${a} contains invalid or missing fields`,{errors:Array.from(i.values()),query:s.query})}}function Et(n,e,t,s,i){const a=i.includes("*")?[...t,...i.filter(r=>r!=="*")]:i;for(const r of a)if(e.get(r))Ie(n,e,t,s,r);else try{const o=ne(e,Qe(r),{validateStandardized:!0});for(const l of o)Ie(n,e,t,s,l)}catch(o){n.set(r,{type:"expression-error",expression:r,error:o})}}function Ie(n,e,t,s,i){const a=e.get(i);a?t.has(a.name)?s!=="all"&&s?.has(a.type)===!1&&n.set(i,{type:"invalid-type",fieldName:a.name,fieldType:ge.fromJSON(a.type),allowedFieldTypes:Array.from(s,r=>ge.fromJSON(r))}):n.set(i,{type:"missing-field",fieldName:a.name}):n.set(i,{type:"invalid-field",fieldName:i})}const Vt=5;let zt=class{constructor(){this._storage=new Map,this._purgeInterval=Vt,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const n=1e3*this._purgeInterval,e=performance.now()-n;for(const[t,s]of this._storage){if(!(s.time0&&(this._timer=setTimeout(this._sweep,n)));this._storage.delete(t)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}get size(){return this._storage?.size??0}put(n,e){this._storage?.set(n,new Mt(e)),this._scheduleSweep()}get(n){if(!this._storage)return;const e=this._storage?.get(n);return e?(this._storage?.delete(n),e.time=performance.now(),this._storage?.set(n,e),e.items):void 0}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}},Ct=0;class Mt{constructor(e){this.items=e,this.time=performance.now(),this.id=Ct++}}let L=class{constructor(n,e,t){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=n.returnDistinctValues??!1,this.fieldsIndex=t,this.featureAdapter=e;const s=n.outFields;if(s&&!s.includes("*")){this.outFields=s;let i=0;for(const a of s){const r=Qe(a),o=this.fieldsIndex.get(r),l=o?null:q(r,t),u=o?o.name:bt(a)||"FIELD_EXP_"+i++;this._fieldDataCache.set(a,{alias:u,clause:l})}}}countDistinctValues(n){return this.returnDistinctValues?(n.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):n.length}getAttributes(n){const e=this._processAttributesForOutFields(n);return this._processAttributesForDistinctValues(e)}getFieldValue(n,e,t){const s=t?t.name:e;let i=null;return this._fieldDataCache.has(s)?i=this._fieldDataCache.get(s)?.clause:t||(i=q(e,this.fieldsIndex),this._fieldDataCache.set(s,{alias:s,clause:i})),t?this.featureAdapter.getAttribute(n,s):i?.calculateValue(n,this.featureAdapter)}getDataValues(n,e,t=!0){const s=e.normalizationType,i=e.normalizationTotal,a=this.fieldsIndex.get(e.field),r=ie(a)||ae(a),o=be(a);return n.map(l=>{let u=e.field&&this.getFieldValue(l,e.field,this.fieldsIndex.get(e.field));if(e.field2?(u=`${te(u)}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field2,this.fieldsIndex.get(e.field2)))}`,e.field3&&(u=`${u}${e.fieldDelimiter}${te(this.getFieldValue(l,e.field3,this.fieldsIndex.get(e.field3)))}`)):typeof u=="string"&&t&&(r?u=u?new Date(u).getTime():null:o&&(u=u?dt(u):null)),s&&Number.isFinite(u)){const c=s==="field"&&e.normalizationField?this.getFieldValue(l,e.normalizationField,this.fieldsIndex.get(e.normalizationField)):null;u=wt(u,s,c,i)}return u})}async getExpressionValues(n,e,t,s,i){const{arcadeUtils:a}=await Ee(),r=a.hasGeometryOperations(e);r&&await a.enableGeometryOperations();const o=a.createFunction(e),l=a.getViewInfo(t),u={fields:this.fieldsIndex.fields};return n.map(c=>{const h={attributes:this.featureAdapter.getAttributes(c),layer:u,geometry:r?{...j(s.geometryType,s.hasZ,s.hasM,this.featureAdapter.getGeometry(c)),spatialReference:t?.spatialReference}:null},d=a.createExecContext(h,l,i);return a.executeFunction(o,d)})}validateItem(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testFeature(n,this.featureAdapter)??!1}validateItems(n,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e)?.clause?.testSet(n,this.featureAdapter)??!1}_processAttributesForOutFields(n){const e=this.outFields;if(!e?.length)return this.featureAdapter.getAttributes(n);const t={};for(const s of e){const{alias:i,clause:a}=this._fieldDataCache.get(s);t[i]=a?a.calculateValue(n,this.featureAdapter):this.featureAdapter.getAttribute(n,i)}return t}_processAttributesForDistinctValues(n){if(n==null||!this.returnDistinctValues)return n;const e=this.outFields,t=[];if(e)for(const a of e){const{alias:r}=this._fieldDataCache.get(a);t.push(n[r])}else for(const a in n)t.push(n[a]);const s=`${(e||["*"]).join(",")}=${t.join(",")}`;let i=this._returnDistinctMap.get(s)||0;return this._returnDistinctMap.set(s,++i),i>1?null:n}};function Te(n,e,t){return{objectId:n,target:e,distance:t,type:"vertex"}}function Dt(n,e,t,s,i,a=!1){return{objectId:n,target:e,distance:t,type:"edge",start:s,end:i,draped:a}}class v{constructor(e,t,s){this.items=e,this.query=t,this.geometryType=s.geometryType,this.hasM=s.hasM,this.hasZ=s.hasZ,this.fieldsIndex=s.fieldsIndex,this.objectIdField=s.objectIdField,this.spatialReference=s.spatialReference,this.featureAdapter=s.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new L(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:s,outStatistics:i}=this.query;if(!t?.length)return 1;const a=new Map,r=new Map,o=new Set;for(const l of i){const{statisticType:u}=l,c=u!=="exceedslimit"?l.onStatisticField:void 0;if(!r.has(c)){const d=[];for(const m of t){const y=this._getAttributeValues(e,m,a);d.push(y)}r.set(c,this._calculateUniqueValues(d,e.returnDistinctValues))}const h=r.get(c);for(const d in h){const{data:m,items:y}=h[d],f=m.join(",");s&&!e.validateItems(y,s)||o.add(f)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics?e=this.query.outStatistics.some(t=>t.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):e=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;U(this.query.outSR)&&!V(t.spatialReference,this.query.outSR)?e.queryGeometry=Z({spatialReference:this.query.outSR,...D(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=Z({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const s=this.featureAdapter,i=Re(this.hasZ,this.hasM),{point:a,mode:r}=e,o=typeof e.distance=="number"?e.distance:e.distance.x,l=typeof e.distance=="number"?e.distance:e.distance.y,u={candidates:[]},c=this.geometryType==="esriGeometryPolygon",h=this._getPointCreator(r,this.spatialReference,t),d=new ve(null,0),m=new ve(null,0),y={x:0,y:0,z:0};for(const f of this.items){const w=s.getGeometry(f);if(w==null)continue;const{coords:_,lengths:I}=w;if(d.coords=_,m.coords=_,e.returnEdge){let S=0;for(let g=0;gf.distance-w.distance),u}_getPointCreator(e,t,s){const i=s==null||V(t,s)?o=>o:o=>D(o,t,s),{hasZ:a}=this,r=0;return e==="3d"?a?({x:o,y:l,z:u})=>i({x:o,y:l,z:u}):({x:o,y:l})=>i({x:o,y:l,z:r}):({x:o,y:l})=>i({x:o,y:l})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,minValue:o,maxValue:l,scale:u,timeZone:c,outStatisticTypes:h}=e,d=this.fieldsIndex.get(t),m=fe(d)||ie(d)||ae(d),y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:u,timeZone:c}),f=St({normalizationType:a,normalizationField:i,minValue:o,maxValue:l}),w={value:.5,fieldType:d?.type},_=X(d)?Fe({values:y,supportsNullCount:f,percentileParams:w,outStatisticTypes:h}):we({values:y,minValue:o,maxValue:l,useSampleStdDev:!a,supportsNullCount:f,percentileParams:w,outStatisticTypes:h});return ft(_,h,m)}async createUniqueValuesResponse(e){const{field:t,valueExpression:s,domains:i,returnAllCodedValues:a,scale:r,timeZone:o}=e,l=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:s,scale:r,timeZone:o},!1),u=mt(l);return pt(u,i,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m}),f=yt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numClasses:h});return gt(f,o)}async createHistogramResponse(e){const{field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h,scale:d,timeZone:m}=e,y=await this._getDataValues({field:t,valueExpression:s,normalizationField:i,normalizationType:a,normalizationTotal:r,scale:d,timeZone:m});return xt(y,{field:t,normalizationField:i,normalizationType:a,normalizationTotal:r,classificationMethod:o,standardDeviationInterval:l,minValue:u,maxValue:c,numBins:h})}_sortFeatures(e,t,s){if(e.length>1&&t?.length)for(const i of t.reverse()){const a=i.split(" "),r=a[0],o=this.fieldsIndex.get(r),l=!!a[1]&&a[1].toLowerCase()==="desc",u=_t(o?.type,l);e.sort((c,h)=>{const d=s(c,r,o),m=s(h,r,o);return u(d,m)})}}_createFeatureQueryResponse(e){const t=this.items,{geometryType:s,hasM:i,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:c,resultRecordCount:h,resultOffset:d,returnZ:m,returnM:y}=e,f=h!=null&&t.length>(d||0)+h,w=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(_=>this.fieldsIndex.get(_)));return{exceededTransferLimit:f,features:this._createFeatures(e,t),fields:w,geometryType:s,hasM:i&&y,hasZ:a&&m,objectIdFieldName:r,spatialReference:Z(u||o),transform:c&&_e(c)||null}}_createFeatures(e,t){const s=new L(e,this.featureAdapter,this.fieldsIndex),{hasM:i,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:u,maxAllowableOffset:c,resultOffset:h,resultRecordCount:d,returnZ:m=!1,returnM:y=!1}=e,f=a&&m,w=i&&y;let _=[],I=0;const S=[...t];if(this._sortFeatures(S,r,(p,F,x)=>s.getFieldValue(p,F,x)),this.geometryType&&(l||u)){const p=_e(o)??void 0,F=this.geometryType==="esriGeometryPolygon"||this.geometryType==="esriGeometryPolyline";if(l&&!u)for(const x of S){const T=this.featureAdapter.getGeometry(x),R={attributes:s.getAttributes(x),geometry:j(this.geometryType,this.hasZ,this.hasM,T,c,p,f,w)};F&&T&&!R.geometry&&(R.centroid=ee(this,this.featureAdapter.getCentroid(x,this),p)),_[I++]=R}else if(!l&&u)for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p)};else for(const x of S)_[I++]={attributes:s.getAttributes(x),centroid:ee(this,this.featureAdapter.getCentroid(x,this),p),geometry:j(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(x),c,p,f,w)}}else for(const p of S){const F=s.getAttributes(p);F&&(_[I++]={attributes:F})}const g=h||0;if(d!=null){const p=g+d;_=_.slice(g,Math.min(_.length,p))}return _}_createExceedsLimitQueryResponse(e){let t=!1,s=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(const r of e.outStatistics??[])if(r.statisticType==="exceedslimit"){s=r.maxPointCount!=null?r.maxPointCount:Number.POSITIVE_INFINITY,i=r.maxRecordCount!=null?r.maxRecordCount:Number.POSITIVE_INFINITY,a=r.maxVertexCount!=null?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")t=this.items.length>s;else if(this.items.length>i)t=!0;else{const r=Re(this.hasZ,this.hasM),o=this.featureAdapter;t=this.items.reduce((l,u)=>{const c=o.getGeometry(u);return l+(c!=null&&c.coords.length||0)},0)/r>a}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(t)}}]}}async _createStatisticsQueryResponse(e){const t={attributes:{}},s=[],i=new Map,a=new Map,r=new Map,o=new Map,l=new L(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:c,having:h,orderByFields:d,resultRecordCount:m}=e,y=c?.length,f=!!y,w=f?c[0]:null,_=f&&!this.fieldsIndex.get(w);for(const S of u??[]){const{outStatisticFieldName:g,statisticType:p}=S,F=S,x=p!=="exceedslimit"?S.onStatisticField:void 0,T=p==="percentile_disc"||p==="percentile_cont",R=p==="EnvelopeAggregate"||p==="CentroidAggregate"||p==="ConvexHullAggregate",M=f&&y===1&&(x===w||_)&&p==="count";if(f){if(!r.has(x)){const k=[];for(const K of c){const H=this._getAttributeValues(l,K,i);k.push(H)}r.set(x,this._calculateUniqueValues(k,!R&&l.returnDistinctValues))}const b=r.get(x);if(!b)continue;const Y=Object.keys(b);for(const k of Y){const{count:K,data:H,items:oe,itemPositions:Pe}=b[k],le=H.join(",");if(!h||l.validateItems(oe,h)){const Q=o.get(le)||{attributes:{}};if(R){Q.aggregateGeometries||(Q.aggregateGeometries={});const{aggregateGeometries:z,outStatisticFieldName:G}=await this._getAggregateGeometry(F,oe);Q.aggregateGeometries[G]=z}else{let z=null;if(M)z=K;else{const G=this._getAttributeValues(l,x,i),ue=Pe.map(Oe=>G[Oe]);z=T&&"statisticParameters"in F?this._getPercentileValue(F,ue):this._getStatisticValue(F,ue,null,l.returnDistinctValues)}Q.attributes[g]=z}let Ge=0;c.forEach((z,G)=>Q.attributes[this.fieldsIndex.get(z)?z:"EXPR_"+ ++Ge]=H[G]),o.set(le,Q)}}}else if(R){t.aggregateGeometries||(t.aggregateGeometries={});const{aggregateGeometries:b,outStatisticFieldName:Y}=await this._getAggregateGeometry(F,this.items);t.aggregateGeometries[Y]=b}else{const b=this._getAttributeValues(l,x,i);t.attributes[g]=T&&"statisticParameters"in F?this._getPercentileValue(F,b):this._getStatisticValue(F,b,a,l.returnDistinctValues)}const B=p!=="min"&&p!=="max"||!X(this.fieldsIndex.get(x))&&!this._isAnyDateField(x)?null:this.fieldsIndex.get(x)?.type;s.push({name:g,alias:g,type:B||"esriFieldTypeDouble"})}const I=f?Array.from(o.values()):[t];return this._sortFeatures(I,d,(S,g)=>S.attributes[g]),m&&(I.length=Math.min(m,I.length)),{fields:s,features:I}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return fe(t)||ie(t)||ae(t)||be(t)}async _getAggregateGeometry(e,t){const{convexHull:s,union:i}=await Ze(()=>import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(f=>f.g),{statisticType:a,outStatisticFieldName:r}=e,{featureAdapter:o,spatialReference:l,geometryType:u,hasZ:c,hasM:h}=this,d=t.map(f=>j(u,c,h,o.getGeometry(f))),m=s(l,d,!0)[0],y={aggregateGeometries:null,outStatisticFieldName:null};if(a==="EnvelopeAggregate"){const f=m?et(m):me(i(l,d));y.aggregateGeometries={...f,spatialReference:l},y.outStatisticFieldName=r||"extent"}else if(a==="CentroidAggregate"){const f=m?tt(m):st(me(i(l,d)));y.aggregateGeometries={x:f[0],y:f[1],spatialReference:l},y.outStatisticFieldName=r||"centroid"}else a==="ConvexHullAggregate"&&(y.aggregateGeometries=m,y.outStatisticFieldName=r||"convexHull");return y}_getStatisticValue(e,t,s,i){const{onStatisticField:a,statisticType:r}=e;let o=null;return o=s?.has(a)?s.get(a):X(this.fieldsIndex.get(a))||this._isAnyDateField(a)?Fe({values:t,returnDistinct:i}):we({values:i?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),s&&s.set(a,o),o[r==="var"?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:s,statisticParameters:i,statisticType:a}=e,{value:r,orderBy:o}=i,l=this.fieldsIndex.get(s);return Ft(t,{value:r,orderBy:o,fieldType:l?.type,isDiscrete:a==="percentile_disc"})}_getAttributeValues(e,t,s){if(s.has(t))return s.get(t);const i=this.fieldsIndex.get(t),a=this.items.map(r=>e.getFieldValue(r,t,i));return s.set(t,a),a}_calculateUniqueValues(e,t){const s={},i=this.items,a=i.length;for(let r=0;rn)}function Ne(n,e,t){const{outFields:s,orderByFields:i,returnDistinctValues:a,outStatistics:r}=t,o=r?r.map(l=>l.outStatisticFieldName&&l.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(i&&i.length>0){const l=" asc",u=" desc",c=i.map(h=>{const d=h.toLowerCase();return d.includes(l)?d.split(l)[0]:d.includes(u)?d.split(u)[0]:h}).filter(h=>!o.includes(h));C(n,e,c,{expressionName:"orderByFields",query:t})}if(s&&s.length>0)C(n,e,s,{expressionName:"outFields",query:t,allowedFieldTypes:"all"});else if(a)throw new A(P,"outFields should be specified for returnDistinctValues",{query:t});vt(n,e,t.where,t)}const Qt=new Set([...De,...qe]);function Nt(n,e,t){const{outStatistics:s,groupByFieldsForStatistics:i,having:a}=t,r=i?.length,o=s?.length;if(a){if(!r||!o)throw new A(P,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:t});At(n,e,a,s,t)}if(o){if(!Ot(s))return;const l=s.map(u=>u.onStatisticField).filter(Boolean);C(n,e,l,{expressionName:"onStatisticFields",query:t}),r&&C(n,e,i,{expressionName:"groupByFieldsForStatistics",query:t});for(const u of s){const{onStatisticField:c,statisticType:h}=u;if((h==="percentile_disc"||h==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:d}=u;if(!d)throw new A(P,"statisticParameters should be set for percentile type",{definition:u,query:t})}else n.get(c)&&h!=="count"&&h!=="min"&&h!=="max"&&C(n,e,[c],{expressionName:`outStatistics with '${h}' statistic type`,allowedFieldTypes:Qt,query:t})}}}async function Pt(n,e,{fieldsIndex:t,geometryType:s,spatialReference:i,availableFields:a}){if((n.distance??0)<0||n.geometryPrecision!=null||n.multipatchOption||n.pixelSize||n.relationParam||n.text||n.outStatistics||n.groupByFieldsForStatistics||n.having||n.orderByFields)throw new A(P,"Unsupported query options",{query:n});return Ne(t,a,n),Promise.all([Gt(t,a,e,n),ze(n,s,i),re(i,n.outSR)]).then(()=>n)}async function Gt(n,e,t,s){let i=[];if(t.valueExpression){const{arcadeUtils:a}=await Ee();i=a.extractFieldNames(t.valueExpression)}if(t.field&&i.push(t.field),t.field2&&i.push(t.field2),t.field3&&i.push(t.field3),t.normalizationField&&i.push(t.normalizationField),!i.length&&!t.valueExpression)throw new A(P,"field or valueExpression is required",{params:t});C(n,e,i,{expressionName:"statistics",query:s})}function Ot(n){return n!=null&&n.every(e=>e.statisticType!=="exceedslimit")}const Zt="unsupported-query";class as{constructor(e){this._cache=new zt,this._changeHandle=null,this.capabilities={query:ht},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,this.fieldsIndex=je(e.fieldsIndex)?e.fieldsIndex:It.fromJSON(e.fieldsIndex),!e.availableFields||e.availableFields.length===1&&e.availableFields[0]==="*"?this.availableFields=new Set(this.fieldsIndex.fields.map(t=>t.name)):this.availableFields=new Set(e.availableFields.map(t=>this.fieldsIndex.get(t)?.name).filter(t=>t!=null)),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=ce(this._frameTask),this.clearCache(),$e(this._cache),this._changeHandle=ce(this._changeHandle)}get featureAdapter(){return this.featureStore.featureAdapter}clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async executeQuery(e,t){const s=E(t);try{return await(await this._executeQuery(e,{},s)).createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){const s=E(t);try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},s)).createQueryResponseForCount()}catch(i){if(i!==N)throw i;return 0}}async executeQueryForExtent(e,t){const s=E(t),i=e.outSR;try{const a=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),r=a.size;return r?{count:r,extent:await this._getBounds(a.items,a.spatialReference,i||this.spatialReference)}:{count:0,extent:null}}catch(a){if(a===N)return{count:0,extent:null};throw a}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(s=>Array.from(s))}async executeQueryForIdSet(e,t){const s=E(t);try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},s),a=i.items,r=new Set;return await this._reschedule(()=>{for(const o of a)r.add(i.featureAdapter.getObjectId(o))},s),r}catch(i){if(i===N)return new Set;throw i}}async executeQueryForSnapping(e,t){const s=E(t),{point:i,distance:a,returnEdge:r,vertexMode:o}=e;if(!r&&o==="none")return{candidates:[]};let l=J(e.query);l=await this._schedule(()=>ut(l,this.definitionExpression,this.spatialReference),s),l=await this._reschedule(()=>Ae(l,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const u=!V(i.spatialReference,this.spatialReference);u&&await re(i.spatialReference,this.spatialReference);const c=typeof a=="number"?a:a.x,h=typeof a=="number"?a:a.y,d={xmin:i.x-c,xmax:i.x+c,ymin:i.y-h,ymax:i.y+h,spatialReference:i.spatialReference},m=u?D(d,this.spatialReference):d;if(!m)return{candidates:[]};const y=(await pe(he(i),null,{signal:s}))[0],f=(await pe(he(m),null,{signal:s}))[0];if(y==null||f==null)return{candidates:[]};const w=new v(await this._reschedule(()=>this._searchFeatures(se(f.toJSON())),s),l,this);await this._reschedule(()=>this._executeObjectIdsQuery(w),s),await this._reschedule(()=>this._executeTimeQuery(w),s),await this._reschedule(()=>this._executeAttributesQuery(w),s),await this._reschedule(()=>this._executeGeometryQueryForSnapping(w,s),s);const _=y.toJSON(),I=u?D(_,this.spatialReference):_,S=u?Math.max(m.xmax-m.xmin,m.ymax-m.ymin)/2:a;return w.createSnappingResponse({...e,point:I,distance:S},i.spatialReference)}async executeQueryForLatestObservations(e,t){const s=E(t);if(!this.timeInfo?.trackIdField)throw new A(Zt,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const i=await this._executeQuery(e,{},s);return await this._reschedule(()=>this._filterLatest(i),s),await i.createQueryResponse()}catch(i){if(i!==N)throw i;return new v([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const i=E(s),{field:a,field2:r,field3:o,valueExpression:l}=t;return(await this._executeQueryForStatistics(e,{field:a,field2:r,field3:o,valueExpression:l},i)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const i=E(s),{field:a,normalizationField:r,valueExpression:o}=t;return(await this._executeQueryForStatistics(e,{field:a,normalizationField:r,valueExpression:o},i)).createHistogramResponse(t)}async fetchRecomputedExtents(e){const t=E(e);this._timeExtentPromise||=ot(this.timeInfo,this.featureStore);const[s,i]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return Be(t),{fullExtent:s,timeExtent:i}}async _getBounds(e,t,s){const i=ke(Le(),He);await this.featureStore.forEachBounds(e,o=>Je(i,o));const a={xmin:i[0],ymin:i[1],xmax:i[3],ymax:i[4],spatialReference:Z(this.spatialReference)};this.hasZ&&isFinite(i[2])&&isFinite(i[5])&&(a.zmin=i[2],a.zmax=i[5],a.hasZ=!0);const r=D(a,t,s);if(r.spatialReference=Z(s),r.xmax-r.xmin==0){const o=W(r.spatialReference);r.xmin-=o,r.xmax+=o}if(r.ymax-r.ymin==0){const o=W(r.spatialReference);r.ymin-=o,r.ymax+=o}if(this.hasZ&&r.zmin!=null&&r.zmax!=null&&r.zmax-r.zmin==0){const o=W(r.spatialReference);r.zmin-=o,r.zmax+=o}return r}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _schedule(e,t){return this._frameTask!=null?this._frameTask.schedule(e,t):e(Se)}async _reschedule(e,t){return this._frameTask!=null?this._frameTask.reschedule(e,t):e(Se)}async _getAllFeaturesQueryEngineResult(e){return new v(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(this._allFeaturesPromise==null){const s=[];this._allFeaturesPromise=(async()=>{await this.featureStore.forEach(i=>s.push(i))})().then(()=>s)}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async _executeQuery(e,t,s){e=J(e),e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Ae(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s),e={...e,...t};const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}async _executeSceneFilterQuery(e,t){if(e.sceneFilter==null)return null;const{outSR:s,returnGeometry:i,returnCentroid:a}=e,r=this.featureStore.featureSpatialReference,o=e.sceneFilter.geometry,l=r==null||V(r,o.spatialReference)?o:D(o,r);if(!l)return null;const u=i||a,c=U(s)&&!V(this.spatialReference,s)&&u?async f=>this._project(f,s):f=>f,h=this.featureAdapter,d=await this._reschedule(()=>this._searchFeatures(se(l)),t);if(e.sceneFilter.spatialRelationship==="disjoint"){if(!d.length)return null;const f=new Set;for(const I of d)f.add(h.getObjectId(I));const w=await this._reschedule(()=>this._getAllFeatures(),t),_=await this._reschedule(async()=>{const I=await O("esriSpatialRelDisjoint",l,this.geometryType,this.hasZ,this.hasM),S=p=>!f.has(h.getObjectId(p))||I(h.getGeometry(p)),g=await this._runSpatialFilter(w,S,t);return new v(g,e,this)},t);return c(_)}if(!d.length)return new v([],e,this);if(this._canExecuteSinglePass(l,e))return c(new v(d,e,this));const m=await O("esriSpatialRelContains",l,this.geometryType,this.hasZ,this.hasM),y=await this._runSpatialFilter(d,f=>m(h.getGeometry(f)),t);return c(new v(y,e,this))}async _executeGeometryQuery(e,t,s){if(t!=null&&t.items.length===0)return t;e=t!=null?t.query:e;const{geometry:i,outSR:a,spatialRel:r,returnGeometry:o,returnCentroid:l}=e,u=this.featureStore.featureSpatialReference,c=!i||u==null||V(u,i.spatialReference)?i:D(i,u),h=o||l,d=U(a)&&!V(this.spatialReference,a),m=t==null?this._getCacheKey(e):null,y=m?this._cache.get(m):null;if(y!=null)return new v(y,e,this);const f=async g=>(d&&h&&await this._project(g,a),m&&this._cache.put(m,g.items),g);if(!c)return f(t??await this._getAllFeaturesQueryEngineResult(e));const w=this.featureAdapter;let _=await this._reschedule(()=>this._searchFeatures(se(i)),s);if(r==="esriSpatialRelDisjoint"){if(!_.length)return f(t??await this._getAllFeaturesQueryEngineResult(e));const g=new Set;for(const x of _)g.add(w.getObjectId(x));const p=t!=null?t.items:await this._reschedule(()=>this._getAllFeatures(),s),F=await this._reschedule(async()=>{const x=await O(r,c,this.geometryType,this.hasZ,this.hasM),T=M=>!g.has(w.getObjectId(M))||x(w.getGeometry(M)),R=await this._runSpatialFilter(p,T,s);return new v(R,e,this)},s);return f(F)}if(t!=null){const g=new it;_=_.filter(p=>Ue(t.items,p,t.items.length,g)>=0)}if(!_.length){const g=new v([],e,this);return m&&this._cache.put(m,g.items),g}if(this._canExecuteSinglePass(c,e))return f(new v(_,e,this));const I=await O(r,c,this.geometryType,this.hasZ,this.hasM),S=await this._runSpatialFilter(_,g=>I(w.getGeometry(g)),s);return f(new v(S,e,this))}async _executeGeometryQueryForSnapping(e,t){const{query:s}=e,{spatialRel:i}=s;if(!e?.items?.length||!s.geometry||!i)return;const a=await O(i,s.geometry,this.geometryType,this.hasZ,this.hasM),r=await this._runSpatialFilter(e.items,o=>a(o.geometry),t);e.items=r}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds?.length||this.aggregateAdapter==null)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(a=>t.add(a));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?.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=lt(this.timeInfo,e.query.timeExtent,this.featureAdapter);t!=null&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=q(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(this._frameTask==null)return e.filter(o=>t(o));let i=0;const a=new Array,r=async o=>{for(;ir(u),s)}};return this._reschedule(o=>r(o),s).then(()=>a)}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,a=i||s,r=new Map,o=this.featureAdapter.getAttribute;for(const l of e.items){const u=o(l,t),c=o(l,a),h=r.get(u);(!h||c>o(h,a))&&r.set(u,l)}e.items=Array.from(r.values())}_getCacheKey(e){const{geometry:t,spatialRel:s,returnGeometry:i,returnCentroid:a,outSR:r,resultType:o,cacheHint:l}=e;if(o!=="tile"&&!l)return null;const u=i||a;return U(r)&&!V(this.spatialReference,r)&&u?JSON.stringify([t,s,r]):JSON.stringify([t,s])}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return Ve(e)&&(s==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(s==="esriSpatialRelIntersects"||s==="esriSpatialRelContains"))}async _project(e,t){if(!t||V(this.spatialReference,t))return e;const s=this.featureAdapter;let i;try{const r=await this._getFullExtent();i=at(this.spatialReference,t,r)}catch{}const a=await ct(e.items.map(r=>j(this.geometryType,this.hasZ,this.hasM,s.getGeometry(r))),this.spatialReference,t,i);return e.items=a.map((r,o)=>s.cloneWithGeometry(e.items[o],rt(r,this.hasZ,this.hasM))),e}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(i=>this.featureStore.forEachInBounds(i,a=>t.add(a))));const s=Array.from(t.values());return t.clear(),s}async _executeQueryForStatistics(e,t,s){e=J(e);try{e=await this._schedule(()=>xe(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>Pt(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),s);const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),a=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(a),s),await this._reschedule(()=>this._executeObjectIdsQuery(a),s),await this._reschedule(()=>this._executeTimeQuery(a),s),await this._reschedule(()=>this._executeAttributesQuery(a),s),a}catch(i){if(i!==N)throw i;return new v([],e,this)}}}function se(n){if(Ve(n)){if(Ye(n))return[de(Math.min(n.xmin,n.xmax),Math.min(n.ymin,n.ymax),Math.max(n.xmin,n.xmax),Math.max(n.ymin,n.ymax))];if(Ke(n))return n.rings.map(e=>de(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1])))}return[We(Xe(),n)]}export{as as Z}; diff --git a/custom-toc-highlight/assets/QueryTask-CwHwH2rS-B8khefoW.js b/custom-toc-highlight/assets/QueryTask-CwHwH2rS-D4f5dsGo.js similarity index 60% rename from custom-toc-highlight/assets/QueryTask-CwHwH2rS-B8khefoW.js rename to custom-toc-highlight/assets/QueryTask-CwHwH2rS-D4f5dsGo.js index ba5e627a..1c9ca506 100644 --- a/custom-toc-highlight/assets/QueryTask-CwHwH2rS-B8khefoW.js +++ b/custom-toc-highlight/assets/QueryTask-CwHwH2rS-D4f5dsGo.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./meshFeatureSet-zeR2pNmE-C8YqWSZl.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./Mesh-DLzjDUIO-COeC-iS-.js","./MeshTransform-C--IG09w-DoQndDth.js","./mat4-DX7gBViE-DVqdGrVU.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BrXZAXDf.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-BjayBdwt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./imageUtils-BA2D6Uf1-DgLNtmEY.js","./MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js","./MeshLocalVertexSpace-BqgocsoS-Dycut332.js","./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-BuNk6xPZ.js","./plane-Dt8R0KeE-CVSP2GQG.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./deduplicate-D2d-E5Pw-CQcmF3ab.js","./projectPointToVector-B2UUY9SE-BChPjj6-.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./vertexSpaceConversion-CiKaVq_u-D2kQTb17.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js","./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js","./vec3-BazNroeq-PdcGTXFi.js","./BufferView-PQoE3GL7-Duht5lAO.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-BagfV9qf.js","./External-D_wl4XAw-P7VLSnKi.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./FeatureSet-BkVNthuN-CwS44--W.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./meshFeatureAttributes-BwKR5odo-BBs3r8iT.js","./RelationshipQuery-DJsz3K0U-yAwL-qLW.js","./Query-BrwMGK8U-DoFNfkjX.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./executeRelationshipQuery-BlX9_g4g-CUgaAeUL.js","./utils-9sQxfkoa-KicvrT8N.js","./query-DFW9-NG_-gbjlxRZk.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-Bq23Xwmj--_SaacS5.js","./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js","./pbf-D-y3_eZO-DQKnyfOm.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-B5UMbu5B.js","./queryAttachments-Bgvu3RnK-DnTvMlg4.js","./AttachmentInfo-D9RFO8W2-DYgfjXim.js","./executeBinsQuery-26-59HNS-BdRaQbV5.js","./BinsQuery-DjwQZqB8-DL4eLh1p.js","./queryUtils-Brxu6254-PPvpiP5X.js","./json-BI97KiBB-Ce5cWfI2.js","./executeTopFeaturesQuery-CjTd36wS-B31_Gdx0.js","./queryTopFeatures-IbhAPJlP-DYmbt-VV.js","./TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js","./executeForTopIds-BWxBZygF-myXyOtDE.js","./executeForTopExtents-3NOTiZTn-K-9KTgQh.js","./executeForTopCount-Dx1gCDe1-JhF_sU0m.js"])))=>i.map(i=>d[i]); -import{_ as a}from"./main-ugzBrWNm.js";import{v as u,S as c,i as R,j as E,a as V,K as v,a_ as l,o as d,aC as I}from"./story-BfX8CRfG.js";import{f as T,C as w}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{K as f,b as A}from"./Query-BrwMGK8U-DoFNfkjX.js";import{y as Q}from"./utils-9sQxfkoa-KicvrT8N.js";import{i as j,e as P}from"./executeForIds-Z1gkLduF-D8DZG8qZ.js";import{T as q,g as L}from"./executeQueryPBF-o8010HS9-BgTBXvCY.js";import{s as C}from"./executeQueryJSON-CcHnccia-BW7_NQxl.js";import{O as z}from"./FeatureSet-BkVNthuN-CwS44--W.js";let i=class extends E{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return V(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),s=e.outStatistics?.[0]!=null,n=v("featurelayer-pbf-statistics"),o=!s||n;let p;if(this.pbfSupported&&o)try{p=await q(this.url,r,t)}catch(m){if(m.name!=="query:parsing-pbf")throw m;this.pbfSupported=!1}return this.pbfSupported&&o||(p=await C(this.url,r,t)),this._normalizeFields(p.fields),p}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return z.fromJSON(t);const{meshFeatureSetFromJSON:s}=await l(a(()=>import("./meshFeatureSet-zeR2pNmE-C8YqWSZl.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]),import.meta.url),r);return s(e,this.infoFor3D,t)}executeForCount(e,t){return j(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return L(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return P(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-yAwL-qLW.js"),__vite__mapDeps([42,1,2,3,4,43,39,40,44]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-CUgaAeUL.js"),__vite__mapDeps([45,46,1,2,3,4,47,48,49,50,51,52,53,54,55,26,27,38,39,40,42,43,44]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-yAwL-qLW.js"),__vite__mapDeps([42,1,2,3,4,43,39,40,44]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-CUgaAeUL.js"),__vite__mapDeps([45,46,1,2,3,4,47,48,49,50,51,52,53,54,55,26,27,38,39,40,42,43,44]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:s,processAttachmentQueryResult:n}=await l(a(()=>import("./queryAttachments-Bgvu3RnK-DnTvMlg4.js"),__vite__mapDeps([56,1,2,3,4,47,48,49,46,50,51,52,53,54,55,26,27,57]),import.meta.url),t),o=Q(this.url);return n(o,await(this.queryAttachmentsSupported?r(o,e,t):s(o,e,t)))}async executeBinsQuery(e,t){const{executeBinsQuery:r}=await l(a(()=>import("./executeBinsQuery-26-59HNS-BdRaQbV5.js"),__vite__mapDeps([58,46,1,2,3,4,48,49,50,47,51,52,53,54,55,26,27,59,60,61,43,39,40,44,38]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await l(a(()=>import("./executeTopFeaturesQuery-CjTd36wS-B31_Gdx0.js"),__vite__mapDeps([62,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,38,39,40,64,44]),import.meta.url),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await l(a(()=>import("./executeForTopIds-BWxBZygF-myXyOtDE.js"),__vite__mapDeps([65,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await l(a(()=>import("./executeForTopExtents-3NOTiZTn-K-9KTgQh.js"),__vite__mapDeps([66,1,2,3,4,46,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await l(a(()=>import("./executeForTopCount-Dx1gCDe1-JhF_sU0m.js"),__vite__mapDeps([67,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=A.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?f.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const s=T(r),n=w(r);for(const o of r.queryFormats){if(o===s){t.formatOf3DObjects=o;break}o!==n||t.formatOf3DObjects||(t.formatOf3DObjects=o)}if(!t.formatOf3DObjects)throw new d("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outSpatialReference&&!I(t.outSpatialReference,this.sourceSpatialReference))throw new d("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:o,originY:p,originZ:m,translationX:h,translationY:y,translationZ:_,scaleX:S,scaleY:D,scaleZ:F,rotationX:O,rotationY:b,rotationZ:x,rotationDeg:g}=r.transformFieldRoles;t.outFields.push(o,p,m,h,y,_,S,D,F,O,b,x,g)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};u([c({type:f})],i.prototype,"dynamicDataSource",void 0),u([c()],i.prototype,"fieldsIndex",void 0),u([c()],i.prototype,"gdbVersion",void 0),u([c()],i.prototype,"infoFor3D",void 0),u([c({readOnly:!0})],i.prototype,"parsedUrl",null),u([c()],i.prototype,"pbfSupported",void 0),u([c()],i.prototype,"queryAttachmentsSupported",void 0),u([c()],i.prototype,"sourceSpatialReference",void 0),u([c({type:String})],i.prototype,"url",void 0),i=u([R("esri.layers.graphics.sources.support.QueryTask")],i);const K=i;export{K as C}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./meshFeatureSet-zeR2pNmE-Cmclz5Cy.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./Mesh-DLzjDUIO-BwXS6N6_.js","./MeshTransform-C--IG09w-Bbqagf1g.js","./mat4-DX7gBViE-6clJxb1Q.js","./common-CYWrYyJl-E8-sukrT.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BQk2dgMZ.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-BPSFE14A.js","./vec42-D8CJyqHG-DnfLTeQH.js","./imageUtils-BA2D6Uf1-CYx0DlwL.js","./MeshVertexAttributes-CbNpPur2-c8zcl8rF.js","./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js","./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-cFTwC5-9.js","./plane-Dt8R0KeE-Bqc6oVGz.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./deduplicate-D2d-E5Pw-CTlujluz.js","./projectPointToVector-B2UUY9SE-BIKNGLey.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js","./mat3-CC4Foazl-BWjyqE2v.js","./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js","./vec3-BazNroeq-CRjQH4Pj.js","./BufferView-PQoE3GL7-B9DLdqO9.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec4-DWDdg1fj-BHg6FqkT.js","./External-D_wl4XAw-DrOy4LUr.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./FeatureSet-BkVNthuN-DPQqwkNN.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./meshFeatureAttributes-BwKR5odo-DaS-LG48.js","./RelationshipQuery-DJsz3K0U-BKFa46R1.js","./Query-BrwMGK8U-BPr0_G9t.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./executeRelationshipQuery-BlX9_g4g-QPs1Jx7X.js","./utils-9sQxfkoa-D8FX0sO8.js","./query-DFW9-NG_-C3TyGmiM.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-Bq23Xwmj-CKlS81kz.js","./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js","./pbf-D-y3_eZO-CpHdkhuD.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-B7zp5L1G.js","./queryAttachments-Bgvu3RnK-BeW9ZnXf.js","./AttachmentInfo-D9RFO8W2-CMU9-WNo.js","./executeBinsQuery-26-59HNS-DKYB7wBm.js","./BinsQuery-DjwQZqB8-Ch0CPJ5I.js","./queryUtils-Brxu6254-CDiE0zms.js","./json-BI97KiBB-Ce5cWfI2.js","./executeTopFeaturesQuery-CjTd36wS-CcVA1k2F.js","./queryTopFeatures-IbhAPJlP-DZGdrKJR.js","./TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js","./executeForTopIds-BWxBZygF-D-DeY4Tc.js","./executeForTopExtents-3NOTiZTn-7q7qEr0x.js","./executeForTopCount-Dx1gCDe1-BVXGJFEi.js"])))=>i.map(i=>d[i]); +import{_ as a}from"./main-QGPoLsvl.js";import{v as u,S as c,i as R,j as E,a as V,K as v,a_ as l,o as d,aC as I}from"./story-Doly9N9p.js";import{f as T,C as w}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{K as f,b as A}from"./Query-BrwMGK8U-BPr0_G9t.js";import{y as Q}from"./utils-9sQxfkoa-D8FX0sO8.js";import{i as j,e as P}from"./executeForIds-Z1gkLduF-CrWEksFG.js";import{T as q,g as L}from"./executeQueryPBF-o8010HS9-B7Z-YQyg.js";import{s as C}from"./executeQueryJSON-CcHnccia-M-vnTvKl.js";import{O as z}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";let i=class extends E{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.queryAttachmentsSupported=!1,this.sourceSpatialReference=null,this.url=null}get parsedUrl(){return V(this.url)}async execute(e,t){const r=await this.executeJSON(e,t);return this.featureSetFromJSON(e,r,t)}async executeJSON(e,t){const r=this._normalizeQuery(e),s=e.outStatistics?.[0]!=null,n=v("featurelayer-pbf-statistics"),o=!s||n;let p;if(this.pbfSupported&&o)try{p=await q(this.url,r,t)}catch(m){if(m.name!=="query:parsing-pbf")throw m;this.pbfSupported=!1}return this.pbfSupported&&o||(p=await C(this.url,r,t)),this._normalizeFields(p.fields),p}async featureSetFromJSON(e,t,r){if(!this._queryIs3DObjectFormat(e)||this.infoFor3D==null||!t.features)return z.fromJSON(t);const{meshFeatureSetFromJSON:s}=await l(a(()=>import("./meshFeatureSet-zeR2pNmE-Cmclz5Cy.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41]),import.meta.url),r);return s(e,this.infoFor3D,t)}executeForCount(e,t){return j(this.url,this._normalizeQuery(e),t)}executeForExtent(e,t){return L(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return P(this.url,this._normalizeQuery(e),t)}async executeRelationshipQuery(e,t){const[{default:r},{executeRelationshipQuery:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-BKFa46R1.js"),__vite__mapDeps([42,1,2,3,4,43,39,40,44]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-QPs1Jx7X.js"),__vite__mapDeps([45,46,1,2,3,4,47,48,49,50,51,52,53,54,55,26,27,38,39,40,42,43,44]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeRelationshipQueryForCount(e,t){const[{default:r},{executeRelationshipQueryForCount:s}]=await l(Promise.all([a(()=>import("./RelationshipQuery-DJsz3K0U-BKFa46R1.js"),__vite__mapDeps([42,1,2,3,4,43,39,40,44]),import.meta.url).then(n=>n.R),a(()=>import("./executeRelationshipQuery-BlX9_g4g-QPs1Jx7X.js"),__vite__mapDeps([45,46,1,2,3,4,47,48,49,50,51,52,53,54,55,26,27,38,39,40,42,43,44]),import.meta.url)]),t);return e=r.from(e),(this.gdbVersion||this.dynamicDataSource)&&((e=e.clone()).gdbVersion=e.gdbVersion||this.gdbVersion,e.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource),s(this.url,e,t)}async executeAttachmentQuery(e,t){const{executeAttachmentQuery:r,fetchAttachments:s,processAttachmentQueryResult:n}=await l(a(()=>import("./queryAttachments-Bgvu3RnK-BeW9ZnXf.js"),__vite__mapDeps([56,1,2,3,4,47,48,49,46,50,51,52,53,54,55,26,27,57]),import.meta.url),t),o=Q(this.url);return n(o,await(this.queryAttachmentsSupported?r(o,e,t):s(o,e,t)))}async executeBinsQuery(e,t){const{executeBinsQuery:r}=await l(a(()=>import("./executeBinsQuery-26-59HNS-DKYB7wBm.js"),__vite__mapDeps([58,46,1,2,3,4,48,49,50,47,51,52,53,54,55,26,27,59,60,61,43,39,40,44,38]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){const{executeTopFeaturesQuery:r}=await l(a(()=>import("./executeTopFeaturesQuery-CjTd36wS-CcVA1k2F.js"),__vite__mapDeps([62,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,38,39,40,64,44]),import.meta.url),t);return r(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){const{executeForTopIds:r}=await l(a(()=>import("./executeForTopIds-BWxBZygF-D-DeY4Tc.js"),__vite__mapDeps([65,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopExtents(e,t){const{executeForTopExtents:r}=await l(a(()=>import("./executeForTopExtents-3NOTiZTn-7q7qEr0x.js"),__vite__mapDeps([66,1,2,3,4,46,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}async executeForTopCount(e,t){const{executeForTopCount:r}=await l(a(()=>import("./executeForTopCount-Dx1gCDe1-BVXGJFEi.js"),__vite__mapDeps([67,46,1,2,3,4,63,48,49,50,47,51,52,53,54,55,26,27,64,44]),import.meta.url),t);return r(this.parsedUrl,e,t)}_normalizeQuery(e){let t=A.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource?f.from(e.dynamicDataSource):this.dynamicDataSource);const{infoFor3D:r}=this;if(r!=null&&this._queryIs3DObjectFormat(e)){t=t===e?t.clone():t,t.formatOf3DObjects=null;const s=T(r),n=w(r);for(const o of r.queryFormats){if(o===s){t.formatOf3DObjects=o;break}o!==n||t.formatOf3DObjects||(t.formatOf3DObjects=o)}if(!t.formatOf3DObjects)throw new d("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(t.outSpatialReference&&!I(t.outSpatialReference,this.sourceSpatialReference))throw new d("query:unsupported-out-spatial-reference","3D object feature services do not support projection of geometries");if(t.outFields==null||!t.outFields.includes("*")){t=t===e?t.clone():t,t.outFields==null&&(t.outFields=[]);const{originX:o,originY:p,originZ:m,translationX:h,translationY:y,translationZ:_,scaleX:S,scaleY:D,scaleZ:F,rotationX:O,rotationY:b,rotationZ:x,rotationDeg:g}=r.transformFieldRoles;t.outFields.push(o,p,m,h,y,_,S,D,F,O,b,x,g)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(const t of e){const r=this.fieldsIndex.get(t.name);r&&Object.assign(t,r.toJSON())}}_queryIs3DObjectFormat(e){return this.infoFor3D!=null&&e.returnGeometry===!0&&e.multipatchOption!=="xyFootprint"&&!e.outStatistics}};u([c({type:f})],i.prototype,"dynamicDataSource",void 0),u([c()],i.prototype,"fieldsIndex",void 0),u([c()],i.prototype,"gdbVersion",void 0),u([c()],i.prototype,"infoFor3D",void 0),u([c({readOnly:!0})],i.prototype,"parsedUrl",null),u([c()],i.prototype,"pbfSupported",void 0),u([c()],i.prototype,"queryAttachmentsSupported",void 0),u([c()],i.prototype,"sourceSpatialReference",void 0),u([c({type:String})],i.prototype,"url",void 0),i=u([R("esri.layers.graphics.sources.support.QueryTask")],i);const K=i;export{K as C}; diff --git a/custom-toc-highlight/assets/QueueProcessor-DbfV9fLy-CxiRQqTa.js b/custom-toc-highlight/assets/QueueProcessor-DbfV9fLy-2F5OgLgJ.js similarity index 94% rename from custom-toc-highlight/assets/QueueProcessor-DbfV9fLy-CxiRQqTa.js rename to custom-toc-highlight/assets/QueueProcessor-DbfV9fLy-2F5OgLgJ.js index 0c42a6c4..30e20d88 100644 --- a/custom-toc-highlight/assets/QueueProcessor-DbfV9fLy-CxiRQqTa.js +++ b/custom-toc-highlight/assets/QueueProcessor-DbfV9fLy-2F5OgLgJ.js @@ -1 +1 @@ -import{al as l,E as d,cW as g,b as m,aS as u,aQ as f,t as I}from"./story-BfX8CRfG.js";import{B as q}from"./workers-PiCjreoO-idkDTJa3.js";import{h as c}from"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import{o as v}from"./signal-CETehA7D-DhpyJ8yp.js";class x{constructor(e,s){this.item=e,this.controller=s,this.promise=null}}class b{constructor(e){this._schedule=null,this._task=null,this._deferreds=new c,this._controllers=new c,this._processingItems=new c,this._pausedSignal=v(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new q(e.peeker),this.process=e.process;const s=e.scheduler;e.priority&&s&&(this._task=s.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=l(this._schedule),this._task=l(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(e){const s=this._controllers.get(e);s&&s.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(s=>e.push(s)),this._controllers.clear(),e.forEach(s=>s.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((s,i)=>e(i))}get(e){const s=this._deferreds.get(e);return s?s.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,s){const i=this.get(e);if(i)return i;const t=new AbortController;let r=null;s&&(r=d(s,()=>t.abort()));const a=()=>{const n=this._processingItems.get(e);n&&n.controller.abort(),o(),h.reject(u())},o=()=>{p.remove(),r?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},p=g(t.signal,a),h=m();return this._deferreds.set(e,h),this._controllers.set(e,t),h.promise.then(o,o),this._queue.push(e),this._scheduleNext(),h.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject(u()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const s of e)this._queue.push(s.item),s.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&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(t,r),r=>this._processError(t,r))):this._processResult(t,s)}get test(){}}export{b as k}; +import{al as l,E as d,cW as g,b as m,aS as u,aQ as f,t as I}from"./story-Doly9N9p.js";import{B as q}from"./workers-PiCjreoO-Dc6Tqm-o.js";import{h as c}from"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import{o as v}from"./signal-CETehA7D-DQA5V72u.js";class x{constructor(e,s){this.item=e,this.controller=s,this.promise=null}}class b{constructor(e){this._schedule=null,this._task=null,this._deferreds=new c,this._controllers=new c,this._processingItems=new c,this._pausedSignal=v(!1),this.concurrency=1,e.concurrency&&(this.concurrency=e.concurrency),this._queue=new q(e.peeker),this.process=e.process;const s=e.scheduler;e.priority&&s&&(this._task=s.registerTask(e.priority,this))}destroy(){this.clear(),this._schedule=l(this._schedule),this._task=l(this._task)}get updating(){return!!this._task?.updating||this.running}get length(){return this._processingItems.size+this._queue.length}abort(e){const s=this._controllers.get(e);s&&s.abort()}clear(){this._queue.clear();const e=[];this._controllers.forEach(s=>e.push(s)),this._controllers.clear(),e.forEach(s=>s.abort()),this._processingItems.clear(),this._cancelNext()}forEach(e){this._deferreds.forEach((s,i)=>e(i))}get(e){const s=this._deferreds.get(e);return s?s.promise:void 0}isOngoing(e){return this._processingItems.has(e)}has(e){return this._deferreds.has(e)}pause(){this._pausedSignal.value||(this._pausedSignal.value=!0,this._cancelNext())}push(e,s){const i=this.get(e);if(i)return i;const t=new AbortController;let r=null;s&&(r=d(s,()=>t.abort()));const a=()=>{const n=this._processingItems.get(e);n&&n.controller.abort(),o(),h.reject(u())},o=()=>{p.remove(),r?.remove(),this._removeItem(e),this._queue.remove(e),this._scheduleNext()},p=g(t.signal,a),h=m();return this._deferreds.set(e,h),this._controllers.set(e,t),h.promise.then(o,o),this._queue.push(e),this._scheduleNext(),h.promise}last(){return this._queue.last()}lastPromise(){const e=this.last();return e?this.get(e):null}peek(){return this._queue.peek()}popLast(){const e=this._queue.popLast();return e&&(this._deferreds.get(e)?.reject(u()),this._removeItem(e)),e}reset(){const e=Array.from(this._processingItems.values());this._processingItems.clear();for(const s of e)this._queue.push(s.item),s.controller.abort();this._scheduleNext()}resume(){this._pausedSignal.value&&(this._pausedSignal.value=!1,this._scheduleNext())}takeAll(){const e=[];for(;this._queue.length;)e.push(this._queue.pop());return this.clear(),e}get running(){return!this._pausedSignal.value&&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(t,r),r=>this._processError(t,r))):this._processResult(t,s)}get test(){}}export{b as k}; diff --git a/custom-toc-highlight/assets/RasterPresetRendererMixin-D6W9pUY6-DKpsAOdT.js b/custom-toc-highlight/assets/RasterPresetRendererMixin-D6W9pUY6-Bm_m_CYY.js similarity index 98% rename from custom-toc-highlight/assets/RasterPresetRendererMixin-D6W9pUY6-DKpsAOdT.js rename to custom-toc-highlight/assets/RasterPresetRendererMixin-D6W9pUY6-Bm_m_CYY.js index a67eb7fd..5cd26b94 100644 --- a/custom-toc-highlight/assets/RasterPresetRendererMixin-D6W9pUY6-DKpsAOdT.js +++ b/custom-toc-highlight/assets/RasterPresetRendererMixin-D6W9pUY6-Bm_m_CYY.js @@ -1 +1 @@ -import{aK as le,ar as b,v as a,S as n,dN as ye,bz as J,i as v,bB as R,a0 as x,ac as ce,P as w,w as _,bi as bt,e0 as vt,d_ as St,eB as Ie,cr as $,ad as jt,g as et,af as Ct,aa as Tt,e as S,eC as Nt,a1 as Lt,d as xt,n as fe,l as Bt,bK as zt,b0 as Ut,d$ as Oe,f as O,J as Ht,o as j}from"./story-BfX8CRfG.js";import{g as tt}from"./multidimensionalUtils-BwTugeu7-BTG9Of02.js";import{q as kt}from"./workers-PiCjreoO-idkDTJa3.js";import{o as k,a as Rt,w as Zt,U as Et,D as Z}from"./dataUtils-BkPy4R3C-Cb9EIxnj.js";import{y as Pt}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{$ as it,h as rt,G as Ue,M as at,o as ue,t as Fe,d as He,P as _e}from"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{Y as oe,n as Vt,i as ot,q as Gt,_ as ke,y as nt,w as st,c as Jt,W as Wt,z as Ot,C as Ft,j as _t}from"./RasterSymbolizer-BVys6HkM-BrCOeMHl.js";import{w as Kt}from"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import{g as lt,c as ct,v as ut}from"./colorRamps-q0bZVhs2-DQZn2xZS.js";import{k as Qt}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import{y as Xt,n as qt,a as Yt}from"./utils-9sQxfkoa-KicvrT8N.js";import{O as $t}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{B as ei}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{getAllSizes as ti,getRotationAngle as ii}from"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import{I as ri,J as ai}from"./utils-DPtQ14k3-CAwuJg76.js";var De;const te=new le({flow_from:"flow-from",flow_to:"flow-to"});let A=De=class extends it(S){constructor(e){super(e),this.density=.8,this.color=new b([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(){const{density:e,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,smoothing:s,flowRepresentation:l,trailCap:u,background:y}=this,c=this.color.clone(),h=(this.visualVariables||[]).map(N=>N.clone()),M=this.authoringInfo?.clone(),B=this.legendOptions?.clone();return new De({density:e,color:c,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,trailCap:u,background:y,smoothing:s,flowRepresentation:l,visualVariables:h,authoringInfo:M,legendOptions:B})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};a([n({type:Number,json:{write:!0}})],A.prototype,"density",void 0),a([n({type:b,json:{write:{allowNull:!0}}})],A.prototype,"color",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"maxPathLength",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"trailWidth",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"flowSpeed",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"trailLength",void 0),a([n({type:Number,cast:ye,json:{write:!1}})],A.prototype,"smoothing",void 0),a([n({type:te.apiValues,json:{type:te.jsonValues,read:{reader:te.read},write:{writer:te.write}}})],A.prototype,"flowRepresentation",void 0),a([J({flowRenderer:"flow"})],A.prototype,"type",void 0),a([n({type:rt,json:{write:!0}})],A.prototype,"authoringInfo",void 0),a([n({type:Kt,json:{write:!0}})],A.prototype,"legendOptions",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"trailCap",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"background",void 0),A=De=a([v("esri.renderers.FlowRenderer")],A);const dt=A;let F=class extends S{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};a([n({type:Number,json:{write:!0}})],F.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],F.prototype,"label",void 0),a([n({type:b,json:{type:[R],write:!0}})],F.prototype,"color",void 0),F=a([v("esri.renderers.support.ColormapInfo")],F);const pt=F;var Q;let X=Q=class extends S{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,r=[...e].sort((o,s)=>o[0]-s[0]).map(o=>pt.fromJSON({value:o[0],color:i?o.slice(1,5):o.slice(1,4).concat([255]),label:t?t[o[0]]??"":o[0]}));return new Q({colormapInfos:r})}static createFromColorramp(e){const t=ot(e);return Q.createFromColormap(t)}clone(){return new Q({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])}};a([n({type:[pt],json:{write:!0}})],X.prototype,"colormapInfos",void 0),a([J({rasterColormap:"raster-colormap"})],X.prototype,"type",void 0),X=Q=a([v("esri.renderers.RasterColormapRenderer")],X);const Re=X;var be;let T=be=class extends S{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 ut(e)}clone(){return new be({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:w(this.colorRamp)})}};a([n({type:Number,json:{write:!0}})],T.prototype,"altitude",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"azimuth",void 0),a([n({types:lt,json:{write:!0}})],T.prototype,"colorRamp",void 0),a([x("colorRamp")],T.prototype,"readColorRamp",null),a([n({type:["traditional","multi-directional"],json:{write:!0}})],T.prototype,"hillshadeType",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizePower",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizeFactor",void 0),a([n({type:["none","adjusted"],json:{write:!0}})],T.prototype,"scalingType",void 0),a([J({rasterShadedRelief:"raster-shaded-relief"})],T.prototype,"type",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"zFactor",void 0),T=be=a([v("esri.renderers.RasterShadedReliefRenderer")],T);const Mt=T;var ve;let p=ve=class extends S{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.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return ut(e)}get statistics(){return this._get("statistics")}set statistics(e){Nt(Lt.getLogger(this),"statistics",{replacement:"customStatistics",version:"4.31",warnOnce:!0}),this._set("statistics",e)}get customStatistics(){const e=this.statistics;return e&&Array.isArray(e[0])?e.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]})):e}set customStatistics(e){this._set("statistics",e?.map(t=>[t.min,t.max,t.avg??0,t.stddev??1]))}readCustomStatistics(e){return e?.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]}))}writeCustomStatistics(e,t,i){e?.length&&(t[i]=e.map(r=>[r.min,r.max,r.avg??0,r.stddev??1]))}readStretchType(e,t){let i=t.stretchType;return typeof i=="number"&&(i=Gt[i]),oe.read(i)}clone(){return new ve({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:w(this.statistics),customStatistics:w(this.customStatistics),gamma:w(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:w(this.colorRamp),histograms:w(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};a([n({types:lt,json:{write:!0}})],p.prototype,"colorRamp",void 0),a([x("colorRamp")],p.prototype,"readColorRamp",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"computeGamma",void 0),a([n({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],p.prototype,"dynamicRangeAdjustment",void 0),a([n({type:[Number],json:{write:!0}})],p.prototype,"gamma",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"maxPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"minPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"numberOfStandardDeviations",void 0),a([n({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],p.prototype,"outputMax",void 0),a([n({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],p.prototype,"outputMin",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"sigmoidStrengthLevel",void 0),a([n({})],p.prototype,"statistics",null),a([n()],p.prototype,"histograms",void 0),a([n({json:{type:[[Number]],name:"statistics",write:!0}})],p.prototype,"customStatistics",null),a([x("customStatistics")],p.prototype,"readCustomStatistics",null),a([ce("customStatistics")],p.prototype,"writeCustomStatistics",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"useGamma",void 0),a([n({type:oe.apiValues,json:{type:oe.jsonValues,write:oe.write}})],p.prototype,"stretchType",void 0),a([x("stretchType",["stretchType"])],p.prototype,"readStretchType",null),a([J({rasterStretch:"raster-stretch"})],p.prototype,"type",void 0),p=ve=a([v("esri.renderers.RasterStretchRenderer")],p);const Ze=p;var Se;const Ke=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),ie=new le({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"}),re=new le({flow_from:"flow-from",flow_to:"flow-to"});let f=Se=class extends it(S){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 Ke.has(e)?k.fromJSON(e):null}readOutputUnit(e,t){return Ke.has(e)?k.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 Ue({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 at({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new Se({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:w(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,i=[]){const r=new Array,o=Rt(this.inputUnit,this.outputUnit),s=this.rotationVariables[0]?.rotationType||this.rotationType,l=t?Zt(e.pixelBlock,"vector-uv",s,o):Et(e.pixelBlock,"vector-magdir",o);if(l==null)return r;const u=e.extent,y=l.mask!=null&&l.mask.length>0;let c=0;const h=(u.xmax-u.xmin)/l.width,M=(u.ymax-u.ymin)/l.height;for(let B=0;BL.intersects(d));if((!y||l.mask[c])&&!m){const L={Magnitude:l.pixels[0][c],Direction:l.pixels[1][c]},z=new bt({geometry:new _({x:d.x,y:d.y,spatialReference:u.spatialReference}),attributes:L});z.symbol=this._getVisualVariablesAppliedSymbol(z),r.push(z)}}return r}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(e){return new vt({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new St({width:0}),size:20,color:e||new b([0,92,230])})}_getVisualVariablesAppliedSymbol(e){if(!e)return;const t=this.styleRenderer?.getSymbol(e)?.clone(),i=this.sizeVariables,r=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(o=>ri(t,ti([o],e))),r&&r.length){const o=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+o,this.rotationVariables.forEach(s=>ai(t,ii(s,e),s.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 ue(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 b([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 b([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new b([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]],r=3.28084;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new b([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]],r=2.23694;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new b([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]],r=3.6;return t=t.map(o=>o*r),{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 b([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 b([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){const e=this._getDefaultSymbol(new b([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const r=this.sizeVariables[0].minDataValue,o=this.sizeVariables[0].maxDataValue;if(r&&o){const s=(o-r)/5;t=Array.from(Array(6).keys()).map(l=>r+s*l)}}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:Ie.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(o=>5*o),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=Ie.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}),r=e.map((o,s)=>{let l;if(s!==e.length-1)if(s===0)l={minValue:o,maxValue:e[s+1],symbol:i};else{const u=Ie.fromJSON({type:"esriPMS",imageData:t[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});l={minValue:o,maxValue:e[s+1],symbol:u}}return new Fe(l)});return{defaultSymbol:i,classBreakInfos:r}}_getClassBreaks(e,t){return t.map((i,r)=>new Fe({minValue:e[r],maxValue:e[r+1],symbol:this._getDefaultSymbol(new b(i))}))}};a([n({type:["Magnitude"],json:{write:!0}})],f.prototype,"attributeField",void 0),a([n({type:re.apiValues,json:{type:re.jsonValues,read:{reader:re.read},write:{writer:re.write}}})],f.prototype,"flowRepresentation",void 0),a([n({type:["geographic","arithmetic"],json:{write:!0}})],f.prototype,"rotationType",void 0),a([n({type:ie.apiValues,json:{type:ie.jsonValues,read:{reader:ie.read},write:{writer:ie.write}}})],f.prototype,"style",void 0),a([n({json:{write:!0}})],f.prototype,"symbolTileSize",void 0),a([n({type:k.apiValues,json:{type:k.jsonValues,write:{writer:k.write}}})],f.prototype,"inputUnit",void 0),a([x("inputUnit")],f.prototype,"readInputUnit",null),a([n({type:k.apiValues,json:{type:k.jsonValues,read:{reader:k.read},write:{writer:k.write}}})],f.prototype,"outputUnit",void 0),a([x("outputUnit")],f.prototype,"readOutputUnit",null),a([J({vectorField:"vector-field"})],f.prototype,"type",void 0),a([n({type:ue})],f.prototype,"styleRenderer",null),a([n({type:Ue})],f.prototype,"sizeVariables",null),a([n({type:at})],f.prototype,"rotationVariables",null),f=Se=a([v("esri.renderers.VectorFieldRenderer")],f);const Ee=f,je={key:"type",base:null,typeMap:{"unique-value":He,"class-breaks":ue,"raster-colormap":Re,"raster-stretch":Ze,"vector-field":Ee,"raster-shaded-relief":Mt,flow:dt}},Ce={...je,typeMap:{...je.typeMap}};delete Ce.typeMap["vector-field"],delete Ce.typeMap.flow;const oi={uniqueValue:He,classBreaks:ue,rasterStretch:Ze,rasterColormap:Re,vectorField:Ee,rasterShadedRelief:Mt,flowRenderer:dt};function ni(e){return e&&oi[e.type]||null}function Wi(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const r=e.authoringInfo||{classificationMethod:""};r.classificationMethod=e.classificationMethod,e.authoringInfo=r}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const i=ni(e);if(i){const r=new i;return r.read(e,t),r}return t?.messages&&e&&t.messages.push(new Ut("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}const Oi=$()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),Fi=$()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),we=$()({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"});let E=class extends S{constructor(){super(...arguments),this.pixelType="unknown"}};a([n({type:String,json:{write:!0}})],E.prototype,"name",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"description",void 0),a([n({type:R,json:{type:R,write:!0,name:"_object_id"}})],E.prototype,"id",void 0),a([n({type:String,json:{type:we.jsonValues,read:we.read,write:we.write}})],E.prototype,"pixelType",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"type",void 0),E=a([v("esri.layers.support.RasterFunctionInfo")],E);const si=E;let H=class extends S{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};a([n({type:String,json:{write:!0}})],H.prototype,"name",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],H.prototype,"id",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isDataset",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isPublic",void 0),a([n({json:{write:!0}})],H.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],H.prototype,"type",void 0),H=a([v("esri.layers.support.RasterFunctionVariable")],H);const li=H,ae={key:"type",base:null,typeMap:{RasterFunctionVariable:li}};let V=class extends S{};a([n({types:ae,json:{types:ae,name:"MatchVariable"}})],V.prototype,"matchVariable",void 0),a([n({types:ae,json:{types:ae,name:"UnionDimension"}})],V.prototype,"unionDimension",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],V.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],V.prototype,"type",void 0),V=a([v("esri.layers.support.RasterFunctionProperties")],V);const ci=V,he=new le({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let I=class extends S{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};a([n({type:[String],json:{write:!0}})],I.prototype,"aliases",void 0),a([n({type:Object,json:{write:!0}})],I.prototype,"arguments",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"description",void 0),a([n({type:si,json:{write:!0,name:"function"}})],I.prototype,"functionInfo",void 0),a([n({type:he.apiValues,json:{type:[0,1,2],read:he.read,write:he.write}})],I.prototype,"functionType",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"group",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"help",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],I.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"name",void 0),a([n({type:String,json:{write:!0,name:"definition"}})],I.prototype,"queryDefinition",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"tag",void 0),a([n({type:ci,json:{write:!0}})],I.prototype,"properties",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnail",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnailEx",void 0),a([n({json:{type:["RasterFunctionTemplate"],write:!0}})],I.prototype,"type",void 0),I=a([v("esri.layers.support.RasterFunctionTemplate")],I);const mt=I;var Te;const ne=new Set(["raster","raster2","dem","fillraster"]),se=new Set(["rasters"]),Qe=e=>e?.rasterFunction?D.fromJSON(e):e,Ae=e=>e&&e instanceof D?e.toJSON():e,Ne=e=>e?.functionName&&!e.declaredClass,Xe=e=>Ne(e)?new D(e):e,ui=e=>{if(e==null)return null;e=w(e);const t={};for(const i of Object.keys(e))ne.has(i.toLowerCase())?t[i]=Qe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(Qe):t[i]=e[i];return t},di={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:mt}},json:{write:!0,name:"rasterFunctionDefinition"}};let D=Te=class extends S{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(i=>ne.has(i.toLowerCase())&&Ne(e[i]))||t.some(i=>se.has(i.toLowerCase())&&Array.isArray(e[i])&&e[i].some(r=>Ne(r)))){e=w(e);for(const i of t)ne.has(i.toLowerCase())?e[i]=Xe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map(r=>Xe(r)))}}this._set("functionArguments",e)}readFunctionArguments(e){return ui(e)}writeFunctionArguments(e,t,i){const r={};for(const o of Object.keys(e))ne.has(o.toLowerCase())?r[o]=Ae(e[o]):se.has(o.toLowerCase())&&Array.isArray(e[o])?r[o]=e[o].map(Ae):r[o]=Ae(e[o]);t[i]=r}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i?.length&&i[0].name!=="None"?i[0].name:t.rasterFunction||t.rasterFunctionDefinition?.name)}get rasterFunctionDefinition(){return this.functionDefinition?.toJSON()}set rasterFunctionDefinition(e){this.functionDefinition=e?mt.fromJSON(e):null}get hasClipFunction(){return this.rasterFunctionDefinition?JSON.stringify(this.rasterFunctionDefinition).includes('"type":"ClipFunction"'):JSON.stringify(this).includes('"rasterFunction":"Clip"')}clone(){return new Te({functionName:this.functionName,functionArguments:w(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:w(this.rasterFunctionDefinition)})}};a([n({json:{type:Object,name:"rasterFunctionArguments"}})],D.prototype,"functionArguments",null),a([x("functionArguments")],D.prototype,"readFunctionArguments",null),a([ce("functionArguments")],D.prototype,"writeFunctionArguments",null),a([n({json:{type:String,write:{target:"rasterFunction"}}})],D.prototype,"functionName",void 0),a([x("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],D.prototype,"readFunctionName",null),a([J({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,default:"unknown"})],D.prototype,"outputPixelType",void 0),a([n({type:String,json:{read:!0,write:!0}})],D.prototype,"variableName",void 0),a([n()],D.prototype,"rasterFunctionDefinition",null),a([n(di)],D.prototype,"functionDefinition",void 0),a([n()],D.prototype,"hasClipFunction",null),D=Te=a([v("esri.layers.support.RasterFunction")],D);const gt=D;var Le;const q=$()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),xe=$()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function pi(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return xe.fromJSON(t)}let g=Le=class extends S{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=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(e,t){return t.ascending!=null?t.ascending:t.sortAscending==null||t.sortAscending}readMethod(e,t){return pi(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,i){e!=null&&(e=e.filter(({variableName:r,dimensionName:o})=>r&&r!=="*"||o)).length&&(t[i]=e.map(r=>r.toJSON()))}readOperation(e,t){const i=t.mosaicOperation,r=t.mosaicOperator?.toLowerCase(),o=i||(r?q.toJSON(r):null);return q.fromJSON(o)||"first"}castSortValue(e){return e==null||typeof e=="string"||typeof e=="number"?e:`${e}`}clone(){return new Le({ascending:this.ascending,itemRasterFunction:w(this.itemRasterFunction),lockRasterIds:w(this.lockRasterIds),method:this.method,multidimensionalDefinition:w(this.multidimensionalDefinition),objectIds:w(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:w(this.viewpoint),where:this.where})}};a([n({type:Boolean,json:{write:!0}})],g.prototype,"ascending",void 0),a([x("ascending",["ascending","sortAscending"])],g.prototype,"readAscending",null),a([n({type:gt,json:{name:"itemRenderingRule",write:!0}})],g.prototype,"itemRasterFunction",void 0),a([n({type:[R],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],g.prototype,"lockRasterIds",void 0),a([n({type:String,json:{type:xe.jsonValues,write:{target:"mosaicMethod",writer:xe.write}}})],g.prototype,"method",void 0),a([x("method",["mosaicMethod","defaultMosaicMethod"])],g.prototype,"readMethod",null),a([n({type:[tt],json:{write:!0}})],g.prototype,"multidimensionalDefinition",void 0),a([ce("multidimensionalDefinition")],g.prototype,"writeMultidimensionalDefinition",null),a([n({type:[R],json:{name:"fids",write:!0}})],g.prototype,"objectIds",void 0),a([n({json:{type:q.jsonValues,read:{reader:q.read},write:{target:"mosaicOperation",writer:q.write}}})],g.prototype,"operation",void 0),a([x("operation",["mosaicOperation","mosaicOperator"])],g.prototype,"readOperation",null),a([n({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],g.prototype,"sortField",void 0),a([n({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],g.prototype,"sortValue",void 0),a([jt("sortValue")],g.prototype,"castSortValue",null),a([n({type:_,json:{write:!0}})],g.prototype,"viewpoint",void 0),a([n({type:String,json:{write:!0}})],g.prototype,"where",void 0),g=Le=a([v("esri.layers.support.MosaicRule")],g);const Mi=g;var Be;const mi={base:xt,key:"type",typeMap:{extent:fe,polygon:Bt}};let G=Be=class extends S{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(r=>{if(!r.dimensionName)return;let o,s;if(Array.isArray(r.values[0])){const l=r.values;o=l[0][0],s=l[r.values.length-1][1]}else{const l=r.values;o=l[0],s=l[r.values.length-1]}if(t.has(r.dimensionName)){const l=t.get(r.dimensionName);l[0]=Math.min(o,l[0]),l[1]=Math.max(s,l[1])}else t.set(r.dimensionName,[o,s])});const i=[];for(const r of t)i.push({name:r[0],extent:r[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(){const e=this.subsetDefinitions?.map(i=>i.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new Be({areaOfInterest:t,subsetDefinitions:e})}};a([n({types:mi,json:{read:et,write:!0}})],G.prototype,"areaOfInterest",void 0),a([n({readOnly:!0})],G.prototype,"dimensions",null),a([n({readOnly:!0})],G.prototype,"variables",null),a([n({type:[tt],json:{write:!0}})],G.prototype,"subsetDefinitions",void 0),G=Be=a([v("esri.layers.support.MultidimensionalSubset")],G);const _i=G;class Ki{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await kt("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 j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},i);return r?new Z(r):null}computeStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");return this._workerThread.invoke("computeStatisticsHistograms",{pixelBlock:t.pixelBlock.toJSON()},i)}async decode(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("decode",t,i);return r?new Z(r):null}async symbolize(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={extent:t.extent?.toJSON(),pixelBlock:t.pixelBlock?.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},o=await this._workerThread.invoke("symbolize",r,i);return o?new Z(o):null}async updateSymbolizer(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:r},i))}async updateRasterFunction(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},i))}async process(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("process",{extent:t.extent?.toJSON(),primaryPixelSizes:t.primaryPixelSizes?.map(o=>o!=null?o.toJSON():null),primaryPixelBlocks:t.primaryPixelBlocks.map(o=>o!=null?o.toJSON():null),primaryRasterIds:t.primaryRasterIds},i);return r?new Z(r):null}async stretch(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},o=await this._workerThread.invoke("stretch",r,i);return o?new Z(o):null}async split(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel,useBilinear:t.useBilinear},o=await this._workerThread.invoke("split",r,i);return o&&o.forEach((s,l)=>{o.set(l,s?Z.fromJSON(s):null)}),o}async clipTile(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={...t,pixelBlock:t.pixelBlock.toJSON()},o=await this._workerThread.invoke("clipTile",r,i);return o?Z.fromJSON(o):null}async estimateStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",r,i)}async mosaicAndTransform(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.srcPixelBlocks?.length)return{pixelBlock:null};const r={...t,srcPixelBlocks:t.srcPixelBlocks.map(s=>s!=null?s.toJSON():null)},o=await this._workerThread.invoke("mosaicAndTransform",r,i);return{pixelBlock:o.pixelBlock?new Z(o.pixelBlock):null,localNorthDirections:o.localNorthDirections}}async createFlowMesh(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:o,simulationSettings:s}=t,l=await this._workerThread.invoke("createFlowMesh",{meshType:o,flowData:r,simulationSettings:s},{...i,transferList:[r.buffer,r.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer)}}getProjectionOffsetGrid(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t.datumTransformation!=null?t.datumTransformation.steps.map(l=>({wkid:l.wkid,wkt:l.wkt,isInverse:l.isInverse})):null,o=t.rasterTransform!=null?t.rasterTransform.toJSON():null,s={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:r,rasterTransform:o,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,i)}}const gi=.25,yi=ct.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]}]}),qe=ct.fromJSON(Vt[0]),yt=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function Qi(e){return e.presetRenderers?.find(({method:t,value:i})=>t==="raster-function-template"?i===e.rasterFunctionName:t==="variable"&&i===e.variableName)}function Xi(e,t){const{attributeTable:i,colormap:r}=e;if(ke(e)){const o=Si(e);if(o!=null)return o}if(t?.rasterFunctionColorRamp){const o=Ye(e,t);return o.colorRamp=t.rasterFunctionColorRamp,o}if(r!=null){const o=bi(e);if(o!=null)return o}if(i!=null){const o=fi(e);if(o!=null)return o}return Ye(e,t)}function qi(e,t=!1){const i=["raster-stretch"];return st(e,t)&&i.push("raster-colormap"),nt(e)&&i.push("unique-value"),Ot(e,t)&&i.push("class-breaks"),Ft(e)&&i.push("raster-shaded-relief"),ke(e)&&i.push("vector-field"),_t(e)&&i.push("flow"),i}function Yi(e){return e.datasetFormat==="Function"&&e.rasterFunction.functionName==="Colormap"?e.rasterFunction.colorRamp:void 0}function $i(e,t,i){const r=["nearest","bilinear","cubic","majority"],o=i?.toLowerCase().replace("bicubic","cubic"),s=r.find(l=>l===o);return t==="Map"?s??"bilinear":e.dataType==="standard-time"?s??"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?s==="nearest"||s==="majority"?s:"nearest":s??"bilinear"}function Ye(e,t){e=Ii(e,t?.variableName);const{bandCount:i}=e;let{bandIds:r,stretchType:o}=t||{};r?.some(M=>M>=i)&&(r=null);let s=e.statistics,l=e.histograms;i>1?(r=r?.length?r:wi(e),s=s==null?null:r?.map(M=>s[M]),l=l==null?null:r?.map(M=>l[M])):r=[0],o==null&&(o=Ai(e)),t?.includeStatisticsInStretch&&(o==="percent-clip"||o==="histogram-equalization")&&e.statistics?.length&&(o="min-max");let u=!1;switch(o){case"none":u=!1;break;case"percent-clip":u=!l?.length;break;default:u=!s?.length}const{dataType:y}=e,c=r?.length===1&&yt.has(y)?yi:null,h=new Ze({stretchType:o,dynamicRangeAdjustment:u,colorRamp:c,outputMin:0,outputMax:255,gamma:r?.length===1?[1]:[1,1,1],useGamma:!1});return o==="percent-clip"?h.maxPercent=h.minPercent=gi:o==="standard-deviation"&&(h.numberOfStandardDeviations=2),u||e.multidimensionalInfo==null&&!t?.includeStatisticsInStretch||(o==="percent-clip"?h.histograms=l:o!=="min-max"&&o!=="standard-deviation"||(h.statistics=s)),h}function Ii(e,t){const{multidimensionalInfo:i}=e;if(!t||!i)return e;const r=i.variables.find(o=>o.name===t);if(!r)return e;if(e=e.clone(),r){const{statistics:o,histograms:s}=r;o?.length&&(e.statistics=o.map(l=>({min:l.min,max:l.max,avg:l.avg,stddev:l.stddev}))),s?.length&&(e.histograms=s)}return e}function wi(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const{bandInfos:i}=e;let r;if(i.length===t){const{red:o,green:s,blue:l,nir:u}=hi(i);o!=null&&s!=null&&l!=null?r=[o,s,l]:u!=null&&o!=null&&s!=null&&(r=[u,o,s])}return!r&&t>=3&&(r=[0,1,2]),r}function hi(e){const t={};for(let i=0;i=410&&s<=480&&l>=480&&l<=540?t.blue=i:t.green==null&&s>=490&&s<=560&&l>=560&&l<=610?t.green=i:t.red==null&&s>=595&&s<=670&&l>=660&&l<=730?t.red=i:t.nir==null&&s>=700&&s<=860&&l>=800&&l<=950&&(t.nir=i)}}return t}function Ai(e){let t="percent-clip";const{pixelType:i,dataType:r,histograms:o,statistics:s,multidimensionalInfo:l}=e,u=yt.has(r)||r==="generic"&&l!=null;return i!=="u8"||r!=="processed"&&o!=null&&s!=null?i==="u8"||r==="elevation"||u?t="min-max":o!=null?t="percent-clip":s!=null&&(t="min-max"):t="none",t}function fi(e,t,i,r){if(!nt(e,t))return null;const{attributeTable:o,statistics:s}=e,l=It(o,t),u=Y(o,"red"),y=Y(o,"green"),c=Y(o,"blue"),h=new rt,M=[],B=new Set,N=!!(u&&y&&c);if(o!=null)o.features.forEach(d=>{const m=d.attributes[l.name];if(!B.has(d.attributes[l.name])&&m!=null){B.add(m);const L=N&&(u.type==="single"||u.type==="double")&&(y.type==="single"||y.type==="double")&&(c.type==="single"||c.type==="double")&&!o.features.some(W=>W.attributes[u.name]>1||W.attributes[y.name]>1||W.attributes[c.name]>1),z=L?255:1;M.push(new _e({value:d.attributes[l.name],label:d.attributes[l.name]+"",symbol:new Oe({style:"solid",outline:null,color:new b(N?[d.attributes[u.name]*z,d.attributes[y.name]*z,d.attributes[c.name]*z,1]:[0,0,0,0])})}))}});else if(s?.[0])for(let d=s[0].min;d<=s[0].max;d++)M.push(new _e({value:d,label:d.toString(),symbol:new Oe({style:"solid",outline:null,color:new b([0,0,0,0])})}));if(M.sort((d,m)=>d.value&&typeof d.value.valueOf()=="string"?0:d.value>m.value?1:-1),!N){const d=ot(qe,{numColors:M.length});M.forEach((m,L)=>m.symbol.color=new b(d[L].slice(1,4))),h.colorRamp=qe}return new He({field:l.name,uniqueValueInfos:M,authoringInfo:h})}function It(e,t,i){let r;return e!=null?(r=t?e.fields.find(o=>t.toLowerCase()===o.name.toLowerCase()):Di(e.fields),r||(i||(r=e.fields.find(o=>o.type==="string")),r||(r=Y(e,"value")))):r=new Pt({name:"value"}),r}function Di(e){let t;for(let i=0;ii.name.toLowerCase()===t)}function bi(e){if(!st(e))return null;let t;const{attributeTable:i,colormap:r}=e;if(i!=null){const o=Y(i,"value"),s=It(i,null,!0);s.type==="string"&&(t={},i.features.forEach(l=>{const u=l.attributes;t[u[o.name]]=s?u[s.name]:u[o.name]}))}return Re.createFromColormap(r,t)}const vi=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function Si(e){if(!ke(e))return null;let t;if(e.statistics!=null&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:o,maxMagnitude:s}=ji(e.dataType,e.statistics);t=[new Ue({field:"Magnitude",minSize:10,maxSize:40,minDataValue:o,maxDataValue:s})]}const i=e.multidimensionalInfo!=null?vi.get(e.multidimensionalInfo.variables[0].unit):void 0,r=new Ee({visualVariables:t,inputUnit:i,rotationType:"geographic"});return r.visualVariables=[...r.sizeVariables,...r.rotationVariables],r}function $e(e){return{color:e.symbolLayers[0].material?.color,type:"esriSFS",style:"esriSFSSolid"}}function er(e){if(e.type==="uniqueValue"){const t=e.uniqueValueInfos;return t?.[0].symbol?.symbolLayers?.length&&(e.uniqueValueInfos=t?.map(i=>({value:i.value,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}if(e.type==="classBreaks"){const t=e.classBreakInfos;return t[0].symbol?.symbolLayers?.length&&(e.classBreakInfos=t.map(i=>({classMinValue:i.classMinValue,classMaxValue:i.classMaxValue,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}return e}function ji(e,t){let i,r;if(e==="vector-magdir")i=t[0].min,r=t[0].max;else{const o=t[0].min,s=t[0].max,l=t[1].min,u=t[1].max;i=0,r=Math.max(Math.abs(o),Math.abs(l),Math.abs(s),Math.abs(u))}return{minMagnitude:i,maxMagnitude:r}}var ze;let U=ze=class extends S{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){e!=null&&(t.geometryType=zt(e),t[i]=e.toJSON())}clone(){return new ze(w({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};a([n({types:Ct,json:{read:et}})],U.prototype,"geometry",void 0),a([ce("geometry")],U.prototype,"writeGeometry",null),a([n({type:Mi,json:{write:!0}})],U.prototype,"mosaicRule",void 0),a([n({type:gt,json:{write:!0,name:"renderingRule"}})],U.prototype,"rasterFunction",void 0),a([n({type:_,json:{write:!0}})],U.prototype,"pixelSize",void 0),a([n({json:{write:!0}})],U.prototype,"raster",void 0),a([n({type:Qt,json:{read:{source:"time"},write:{target:"time"}}})],U.prototype,"timeExtent",void 0),U=ze=a([v("esri.rest.support.ImageHistogramParameters")],U);const tr=U;async function wt(e,t,i){const r=Xt(e),{rasterFunction:o,sourceJSON:s}=t||{},l=o?JSON.stringify(o.rasterFunctionDefinition||o):null,u=qt({...r.query,renderingRule:l,f:"json"}),y=Yt(u,i);e=r.path;const c=s||await O(e,y).then(C=>C.data),h=c.hasRasterAttributeTable?O(`${e}/rasterAttributeTable`,y):null,M=c.hasColormap?O(`${e}/colormap`,y):null,B=c.hasHistograms?O(`${e}/histograms`,y):null,N=c.currentVersion>=10.3?O(`${e}/keyProperties`,y):null,d=c.hasMultidimensions?O(`${e}/multidimensionalInfo`,y):null,m=await Promise.allSettled([h,M,B,N,d]);let L=null;if(c.minValues&&c.minValues.length===c.bandCount){L=[];for(let C=0;C{C.statistics?.length&&C.statistics.forEach(ee=>{ee.avg=ee.mean,ee.stddev=ee.standardDeviation})});const{defaultVariable:Me,serviceDataType:me}=c;Me&&Me!==K.DefaultVariable&&(K.DefaultVariable=Me),me?.includes("esriImageServiceDataTypeVector")&&!me.includes(K.DataType)&&(K.DataType=me.replace("esriImageServiceDataType",""));let ge=c.noDataValue;c.noDataValues?.length&&c.noDataValues.some(C=>C!==ge)&&(ge=c.noDataValues);const Dt=c.transposeInfo?new Jt({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new _({x:c.extent.xmin,y:c.extent.ymax,spatialReference:de}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(W,Pe))/Math.LN2-8)),transposeInfo:c.transposeInfo}):void 0;return new Wt({width:W,height:Pe,bandCount:c.bandCount,extent:fe.fromJSON(c.extent),spatialReference:de,pixelSize:new _({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:de}),pixelType:c.pixelType.toLowerCase(),statistics:L,attributeTable:ht,colormap:At,histograms:ft,keyProperties:K,noDataValue:ge,multidimensionalInfo:pe,storageInfo:Dt})}function ir(e,t,i){return wt(e,{sourceJSON:t},i)}function rr(e,t,i){return wt(e,{rasterFunction:t},i)}function ar(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}let P=class extends Tt(S){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};a([n({type:String,json:{write:!0}})],P.prototype,"name",void 0),a([n({type:["raster-function-template","variable","none"],json:{write:!0}}),J({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],P.prototype,"method",void 0),a([n({type:String,json:{write:!0}})],P.prototype,"value",void 0),a([n({type:[R],json:{write:!0}})],P.prototype,"bandIds",void 0),a([n({types:je,json:{write:!0,origins:{"web-scene":{types:Ce,write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],P.prototype,"renderer",void 0),P=a([v("esri.renderers.support.RasterPresetRenderer")],P);const Ci=P,or=e=>{let t=class extends e{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return a([n({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],t.prototype,"activePresetRendererName",void 0),a([n({type:[Ci],json:{name:"layerDefinition.presetRenderers",write:!0}})],t.prototype,"presetRenderers",void 0),t=a([v("esri.layers.mixins.RasterPresetRendererMixin")],t),t};export{_i as A,Yi as C,ir as E,Ii as I,or as J,Mi as M,rr as P,Xi as S,$i as T,ar as V,tr as Z,Wi as a,er as b,Ce as c,Fi as d,Ki as f,qi as j,gt as k,je as l,Oi as p,we as u,Qi as v,wi as w}; +import{aK as le,ar as b,v as a,S as n,dN as ye,bz as J,i as v,bB as R,a0 as x,ac as ce,P as w,w as _,bi as bt,e0 as vt,d_ as St,eB as Ie,cr as $,ad as jt,g as et,af as Ct,aa as Tt,e as S,eC as Nt,a1 as Lt,d as xt,n as fe,l as Bt,bK as zt,b0 as Ut,d$ as Oe,f as O,J as Ht,o as j}from"./story-Doly9N9p.js";import{g as tt}from"./multidimensionalUtils-BwTugeu7-C75LYPc9.js";import{q as kt}from"./workers-PiCjreoO-Dc6Tqm-o.js";import{o as k,a as Rt,w as Zt,U as Et,D as Z}from"./dataUtils-BkPy4R3C-Dzc1QGGb.js";import{y as Pt}from"./Field-C6hA1tZj-CkWoRbmp.js";import{$ as it,h as rt,G as Ue,M as at,o as ue,t as Fe,d as He,P as _e}from"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{Y as oe,n as Vt,i as ot,q as Gt,_ as ke,y as nt,w as st,c as Jt,W as Wt,z as Ot,C as Ft,j as _t}from"./RasterSymbolizer-BVys6HkM-DCN-TPRo.js";import{w as Kt}from"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import{g as lt,c as ct,v as ut}from"./colorRamps-q0bZVhs2-BnivlaV9.js";import{k as Qt}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import{y as Xt,n as qt,a as Yt}from"./utils-9sQxfkoa-D8FX0sO8.js";import{O as $t}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{B as ei}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{getAllSizes as ti,getRotationAngle as ii}from"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import{I as ri,J as ai}from"./utils-DPtQ14k3-CBDffBYM.js";var De;const te=new le({flow_from:"flow-from",flow_to:"flow-to"});let A=De=class extends it(S){constructor(e){super(e),this.density=.8,this.color=new b([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(){const{density:e,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,smoothing:s,flowRepresentation:l,trailCap:u,background:y}=this,c=this.color.clone(),h=(this.visualVariables||[]).map(N=>N.clone()),M=this.authoringInfo?.clone(),B=this.legendOptions?.clone();return new De({density:e,color:c,maxPathLength:t,trailWidth:i,flowSpeed:r,trailLength:o,trailCap:u,background:y,smoothing:s,flowRepresentation:l,visualVariables:h,authoringInfo:M,legendOptions:B})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};a([n({type:Number,json:{write:!0}})],A.prototype,"density",void 0),a([n({type:b,json:{write:{allowNull:!0}}})],A.prototype,"color",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"maxPathLength",void 0),a([n({type:Number,cast:ye,json:{write:!0}})],A.prototype,"trailWidth",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"flowSpeed",void 0),a([n({type:Number,json:{write:!0}})],A.prototype,"trailLength",void 0),a([n({type:Number,cast:ye,json:{write:!1}})],A.prototype,"smoothing",void 0),a([n({type:te.apiValues,json:{type:te.jsonValues,read:{reader:te.read},write:{writer:te.write}}})],A.prototype,"flowRepresentation",void 0),a([J({flowRenderer:"flow"})],A.prototype,"type",void 0),a([n({type:rt,json:{write:!0}})],A.prototype,"authoringInfo",void 0),a([n({type:Kt,json:{write:!0}})],A.prototype,"legendOptions",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"trailCap",void 0),a([n({type:String,json:{write:!0}})],A.prototype,"background",void 0),A=De=a([v("esri.renderers.FlowRenderer")],A);const dt=A;let F=class extends S{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};a([n({type:Number,json:{write:!0}})],F.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],F.prototype,"label",void 0),a([n({type:b,json:{type:[R],write:!0}})],F.prototype,"color",void 0),F=a([v("esri.renderers.support.ColormapInfo")],F);const pt=F;var Q;let X=Q=class extends S{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,r=[...e].sort((o,s)=>o[0]-s[0]).map(o=>pt.fromJSON({value:o[0],color:i?o.slice(1,5):o.slice(1,4).concat([255]),label:t?t[o[0]]??"":o[0]}));return new Q({colormapInfos:r})}static createFromColorramp(e){const t=ot(e);return Q.createFromColormap(t)}clone(){return new Q({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])}};a([n({type:[pt],json:{write:!0}})],X.prototype,"colormapInfos",void 0),a([J({rasterColormap:"raster-colormap"})],X.prototype,"type",void 0),X=Q=a([v("esri.renderers.RasterColormapRenderer")],X);const Re=X;var be;let T=be=class extends S{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 ut(e)}clone(){return new be({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:w(this.colorRamp)})}};a([n({type:Number,json:{write:!0}})],T.prototype,"altitude",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"azimuth",void 0),a([n({types:lt,json:{write:!0}})],T.prototype,"colorRamp",void 0),a([x("colorRamp")],T.prototype,"readColorRamp",null),a([n({type:["traditional","multi-directional"],json:{write:!0}})],T.prototype,"hillshadeType",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizePower",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"pixelSizeFactor",void 0),a([n({type:["none","adjusted"],json:{write:!0}})],T.prototype,"scalingType",void 0),a([J({rasterShadedRelief:"raster-shaded-relief"})],T.prototype,"type",void 0),a([n({type:Number,json:{write:!0}})],T.prototype,"zFactor",void 0),T=be=a([v("esri.renderers.RasterShadedReliefRenderer")],T);const Mt=T;var ve;let p=ve=class extends S{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.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return ut(e)}get statistics(){return this._get("statistics")}set statistics(e){Nt(Lt.getLogger(this),"statistics",{replacement:"customStatistics",version:"4.31",warnOnce:!0}),this._set("statistics",e)}get customStatistics(){const e=this.statistics;return e&&Array.isArray(e[0])?e.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]})):e}set customStatistics(e){this._set("statistics",e?.map(t=>[t.min,t.max,t.avg??0,t.stddev??1]))}readCustomStatistics(e){return e?.map(t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]}))}writeCustomStatistics(e,t,i){e?.length&&(t[i]=e.map(r=>[r.min,r.max,r.avg??0,r.stddev??1]))}readStretchType(e,t){let i=t.stretchType;return typeof i=="number"&&(i=Gt[i]),oe.read(i)}clone(){return new ve({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:w(this.statistics),customStatistics:w(this.customStatistics),gamma:w(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:w(this.colorRamp),histograms:w(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};a([n({types:lt,json:{write:!0}})],p.prototype,"colorRamp",void 0),a([x("colorRamp")],p.prototype,"readColorRamp",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"computeGamma",void 0),a([n({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],p.prototype,"dynamicRangeAdjustment",void 0),a([n({type:[Number],json:{write:!0}})],p.prototype,"gamma",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"maxPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"minPercent",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"numberOfStandardDeviations",void 0),a([n({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],p.prototype,"outputMax",void 0),a([n({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],p.prototype,"outputMin",void 0),a([n({type:Number,json:{write:!0}})],p.prototype,"sigmoidStrengthLevel",void 0),a([n({})],p.prototype,"statistics",null),a([n()],p.prototype,"histograms",void 0),a([n({json:{type:[[Number]],name:"statistics",write:!0}})],p.prototype,"customStatistics",null),a([x("customStatistics")],p.prototype,"readCustomStatistics",null),a([ce("customStatistics")],p.prototype,"writeCustomStatistics",null),a([n({type:Boolean,json:{write:!0}})],p.prototype,"useGamma",void 0),a([n({type:oe.apiValues,json:{type:oe.jsonValues,write:oe.write}})],p.prototype,"stretchType",void 0),a([x("stretchType",["stretchType"])],p.prototype,"readStretchType",null),a([J({rasterStretch:"raster-stretch"})],p.prototype,"type",void 0),p=ve=a([v("esri.renderers.RasterStretchRenderer")],p);const Ze=p;var Se;const Ke=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),ie=new le({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"}),re=new le({flow_from:"flow-from",flow_to:"flow-to"});let f=Se=class extends it(S){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 Ke.has(e)?k.fromJSON(e):null}readOutputUnit(e,t){return Ke.has(e)?k.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 Ue({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 at({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new Se({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:w(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,i=[]){const r=new Array,o=Rt(this.inputUnit,this.outputUnit),s=this.rotationVariables[0]?.rotationType||this.rotationType,l=t?Zt(e.pixelBlock,"vector-uv",s,o):Et(e.pixelBlock,"vector-magdir",o);if(l==null)return r;const u=e.extent,y=l.mask!=null&&l.mask.length>0;let c=0;const h=(u.xmax-u.xmin)/l.width,M=(u.ymax-u.ymin)/l.height;for(let B=0;BL.intersects(d));if((!y||l.mask[c])&&!m){const L={Magnitude:l.pixels[0][c],Direction:l.pixels[1][c]},z=new bt({geometry:new _({x:d.x,y:d.y,spatialReference:u.spatialReference}),attributes:L});z.symbol=this._getVisualVariablesAppliedSymbol(z),r.push(z)}}return r}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){return this.styleRenderer?.classBreakInfos}getDefaultSymbol(){return this.styleRenderer?.defaultSymbol}_getDefaultSymbol(e){return new vt({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new St({width:0}),size:20,color:e||new b([0,92,230])})}_getVisualVariablesAppliedSymbol(e){if(!e)return;const t=this.styleRenderer?.getSymbol(e)?.clone(),i=this.sizeVariables,r=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(o=>ri(t,ti([o],e))),r&&r.length){const o=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+o,this.rotationVariables.forEach(s=>ai(t,ii(s,e),s.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 ue(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 b([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 b([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new b([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]],r=3.28084;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new b([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]],r=2.23694;return t=t.map(o=>o*r),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new b([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]],r=3.6;return t=t.map(o=>o*r),{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 b([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 b([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){const e=this._getDefaultSymbol(new b([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if(this.sizeVariables?.length){const r=this.sizeVariables[0].minDataValue,o=this.sizeVariables[0].maxDataValue;if(r&&o){const s=(o-r)/5;t=Array.from(Array(6).keys()).map(l=>r+s*l)}}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:Ie.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(o=>5*o),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=Ie.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}),r=e.map((o,s)=>{let l;if(s!==e.length-1)if(s===0)l={minValue:o,maxValue:e[s+1],symbol:i};else{const u=Ie.fromJSON({type:"esriPMS",imageData:t[s].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});l={minValue:o,maxValue:e[s+1],symbol:u}}return new Fe(l)});return{defaultSymbol:i,classBreakInfos:r}}_getClassBreaks(e,t){return t.map((i,r)=>new Fe({minValue:e[r],maxValue:e[r+1],symbol:this._getDefaultSymbol(new b(i))}))}};a([n({type:["Magnitude"],json:{write:!0}})],f.prototype,"attributeField",void 0),a([n({type:re.apiValues,json:{type:re.jsonValues,read:{reader:re.read},write:{writer:re.write}}})],f.prototype,"flowRepresentation",void 0),a([n({type:["geographic","arithmetic"],json:{write:!0}})],f.prototype,"rotationType",void 0),a([n({type:ie.apiValues,json:{type:ie.jsonValues,read:{reader:ie.read},write:{writer:ie.write}}})],f.prototype,"style",void 0),a([n({json:{write:!0}})],f.prototype,"symbolTileSize",void 0),a([n({type:k.apiValues,json:{type:k.jsonValues,write:{writer:k.write}}})],f.prototype,"inputUnit",void 0),a([x("inputUnit")],f.prototype,"readInputUnit",null),a([n({type:k.apiValues,json:{type:k.jsonValues,read:{reader:k.read},write:{writer:k.write}}})],f.prototype,"outputUnit",void 0),a([x("outputUnit")],f.prototype,"readOutputUnit",null),a([J({vectorField:"vector-field"})],f.prototype,"type",void 0),a([n({type:ue})],f.prototype,"styleRenderer",null),a([n({type:Ue})],f.prototype,"sizeVariables",null),a([n({type:at})],f.prototype,"rotationVariables",null),f=Se=a([v("esri.renderers.VectorFieldRenderer")],f);const Ee=f,je={key:"type",base:null,typeMap:{"unique-value":He,"class-breaks":ue,"raster-colormap":Re,"raster-stretch":Ze,"vector-field":Ee,"raster-shaded-relief":Mt,flow:dt}},Ce={...je,typeMap:{...je.typeMap}};delete Ce.typeMap["vector-field"],delete Ce.typeMap.flow;const oi={uniqueValue:He,classBreaks:ue,rasterStretch:Ze,rasterColormap:Re,vectorField:Ee,rasterShadedRelief:Mt,flowRenderer:dt};function ni(e){return e&&oi[e.type]||null}function Wi(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const r=e.authoringInfo||{classificationMethod:""};r.classificationMethod=e.classificationMethod,e.authoringInfo=r}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const i=ni(e);if(i){const r=new i;return r.read(e,t),r}return t?.messages&&e&&t.messages.push(new Ut("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}const Oi=$()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),Fi=$()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"}),we=$()({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"});let E=class extends S{constructor(){super(...arguments),this.pixelType="unknown"}};a([n({type:String,json:{write:!0}})],E.prototype,"name",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"description",void 0),a([n({type:R,json:{type:R,write:!0,name:"_object_id"}})],E.prototype,"id",void 0),a([n({type:String,json:{type:we.jsonValues,read:we.read,write:we.write}})],E.prototype,"pixelType",void 0),a([n({type:String,json:{write:!0}})],E.prototype,"type",void 0),E=a([v("esri.layers.support.RasterFunctionInfo")],E);const si=E;let H=class extends S{constructor(){super(...arguments),this.isDataset=!1,this.isPublic=!1,this.type="RasterFunctionVariable"}};a([n({type:String,json:{write:!0}})],H.prototype,"name",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],H.prototype,"id",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isDataset",void 0),a([n({type:Boolean,json:{write:!0}})],H.prototype,"isPublic",void 0),a([n({json:{write:!0}})],H.prototype,"value",void 0),a([n({type:String,json:{write:!0}})],H.prototype,"type",void 0),H=a([v("esri.layers.support.RasterFunctionVariable")],H);const li=H,ae={key:"type",base:null,typeMap:{RasterFunctionVariable:li}};let V=class extends S{};a([n({types:ae,json:{types:ae,name:"MatchVariable"}})],V.prototype,"matchVariable",void 0),a([n({types:ae,json:{types:ae,name:"UnionDimension"}})],V.prototype,"unionDimension",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],V.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],V.prototype,"type",void 0),V=a([v("esri.layers.support.RasterFunctionProperties")],V);const ci=V,he=new le({0:"mosaic",1:"item",2:"item-group"},{useNumericKeys:!0});let I=class extends S{constructor(){super(...arguments),this.functionType="mosaic",this.type="RasterFunctionTemplate"}};a([n({type:[String],json:{write:!0}})],I.prototype,"aliases",void 0),a([n({type:Object,json:{write:!0}})],I.prototype,"arguments",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"description",void 0),a([n({type:si,json:{write:!0,name:"function"}})],I.prototype,"functionInfo",void 0),a([n({type:he.apiValues,json:{type:[0,1,2],read:he.read,write:he.write}})],I.prototype,"functionType",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"group",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"help",void 0),a([n({type:Number,json:{type:R,write:!0,name:"_object_id"}})],I.prototype,"id",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"name",void 0),a([n({type:String,json:{write:!0,name:"definition"}})],I.prototype,"queryDefinition",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"tag",void 0),a([n({type:ci,json:{write:!0}})],I.prototype,"properties",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnail",void 0),a([n({type:String,json:{write:!0}})],I.prototype,"thumbnailEx",void 0),a([n({json:{type:["RasterFunctionTemplate"],write:!0}})],I.prototype,"type",void 0),I=a([v("esri.layers.support.RasterFunctionTemplate")],I);const mt=I;var Te;const ne=new Set(["raster","raster2","dem","fillraster"]),se=new Set(["rasters"]),Qe=e=>e?.rasterFunction?D.fromJSON(e):e,Ae=e=>e&&e instanceof D?e.toJSON():e,Ne=e=>e?.functionName&&!e.declaredClass,Xe=e=>Ne(e)?new D(e):e,ui=e=>{if(e==null)return null;e=w(e);const t={};for(const i of Object.keys(e))ne.has(i.toLowerCase())?t[i]=Qe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(Qe):t[i]=e[i];return t},di={types:{key:"type",base:null,typeMap:{RasterFunctionTemplate:mt}},json:{write:!0,name:"rasterFunctionDefinition"}};let D=Te=class extends S{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.functionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(i=>ne.has(i.toLowerCase())&&Ne(e[i]))||t.some(i=>se.has(i.toLowerCase())&&Array.isArray(e[i])&&e[i].some(r=>Ne(r)))){e=w(e);for(const i of t)ne.has(i.toLowerCase())?e[i]=Xe(e[i]):se.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map(r=>Xe(r)))}}this._set("functionArguments",e)}readFunctionArguments(e){return ui(e)}writeFunctionArguments(e,t,i){const r={};for(const o of Object.keys(e))ne.has(o.toLowerCase())?r[o]=Ae(e[o]):se.has(o.toLowerCase())&&Array.isArray(e[o])?r[o]=e[o].map(Ae):r[o]=Ae(e[o]);t[i]=r}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i?.length&&i[0].name!=="None"?i[0].name:t.rasterFunction||t.rasterFunctionDefinition?.name)}get rasterFunctionDefinition(){return this.functionDefinition?.toJSON()}set rasterFunctionDefinition(e){this.functionDefinition=e?mt.fromJSON(e):null}get hasClipFunction(){return this.rasterFunctionDefinition?JSON.stringify(this.rasterFunctionDefinition).includes('"type":"ClipFunction"'):JSON.stringify(this).includes('"rasterFunction":"Clip"')}clone(){return new Te({functionName:this.functionName,functionArguments:w(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:w(this.rasterFunctionDefinition)})}};a([n({json:{type:Object,name:"rasterFunctionArguments"}})],D.prototype,"functionArguments",null),a([x("functionArguments")],D.prototype,"readFunctionArguments",null),a([ce("functionArguments")],D.prototype,"writeFunctionArguments",null),a([n({json:{type:String,write:{target:"rasterFunction"}}})],D.prototype,"functionName",void 0),a([x("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],D.prototype,"readFunctionName",null),a([J({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,default:"unknown"})],D.prototype,"outputPixelType",void 0),a([n({type:String,json:{read:!0,write:!0}})],D.prototype,"variableName",void 0),a([n()],D.prototype,"rasterFunctionDefinition",null),a([n(di)],D.prototype,"functionDefinition",void 0),a([n()],D.prototype,"hasClipFunction",null),D=Te=a([v("esri.layers.support.RasterFunction")],D);const gt=D;var Le;const q=$()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),xe=$()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function pi(e){let t;switch(e?e.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":t="esriMosaicAttribute";break;case"lockraster":t="esriMosaicLockRaster";break;case"center":t="esriMosaicCenter";break;case"northwest":t="esriMosaicNorthwest";break;case"nadir":t="esriMosaicNadir";break;case"viewpoint":t="esriMosaicViewpoint";break;case"seamline":t="esriMosaicSeamline";break;default:t="esriMosaicNone"}return xe.fromJSON(t)}let g=Le=class extends S{constructor(e){super(e),this.ascending=!0,this.itemRasterFunction=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(e,t){return t.ascending!=null?t.ascending:t.sortAscending==null||t.sortAscending}readMethod(e,t){return pi(t.mosaicMethod||t.defaultMosaicMethod)}writeMultidimensionalDefinition(e,t,i){e!=null&&(e=e.filter(({variableName:r,dimensionName:o})=>r&&r!=="*"||o)).length&&(t[i]=e.map(r=>r.toJSON()))}readOperation(e,t){const i=t.mosaicOperation,r=t.mosaicOperator?.toLowerCase(),o=i||(r?q.toJSON(r):null);return q.fromJSON(o)||"first"}castSortValue(e){return e==null||typeof e=="string"||typeof e=="number"?e:`${e}`}clone(){return new Le({ascending:this.ascending,itemRasterFunction:w(this.itemRasterFunction),lockRasterIds:w(this.lockRasterIds),method:this.method,multidimensionalDefinition:w(this.multidimensionalDefinition),objectIds:w(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:w(this.viewpoint),where:this.where})}};a([n({type:Boolean,json:{write:!0}})],g.prototype,"ascending",void 0),a([x("ascending",["ascending","sortAscending"])],g.prototype,"readAscending",null),a([n({type:gt,json:{name:"itemRenderingRule",write:!0}})],g.prototype,"itemRasterFunction",void 0),a([n({type:[R],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],g.prototype,"lockRasterIds",void 0),a([n({type:String,json:{type:xe.jsonValues,write:{target:"mosaicMethod",writer:xe.write}}})],g.prototype,"method",void 0),a([x("method",["mosaicMethod","defaultMosaicMethod"])],g.prototype,"readMethod",null),a([n({type:[tt],json:{write:!0}})],g.prototype,"multidimensionalDefinition",void 0),a([ce("multidimensionalDefinition")],g.prototype,"writeMultidimensionalDefinition",null),a([n({type:[R],json:{name:"fids",write:!0}})],g.prototype,"objectIds",void 0),a([n({json:{type:q.jsonValues,read:{reader:q.read},write:{target:"mosaicOperation",writer:q.write}}})],g.prototype,"operation",void 0),a([x("operation",["mosaicOperation","mosaicOperator"])],g.prototype,"readOperation",null),a([n({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],g.prototype,"sortField",void 0),a([n({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],g.prototype,"sortValue",void 0),a([jt("sortValue")],g.prototype,"castSortValue",null),a([n({type:_,json:{write:!0}})],g.prototype,"viewpoint",void 0),a([n({type:String,json:{write:!0}})],g.prototype,"where",void 0),g=Le=a([v("esri.layers.support.MosaicRule")],g);const Mi=g;var Be;const mi={base:xt,key:"type",typeMap:{extent:fe,polygon:Bt}};let G=Be=class extends S{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(r=>{if(!r.dimensionName)return;let o,s;if(Array.isArray(r.values[0])){const l=r.values;o=l[0][0],s=l[r.values.length-1][1]}else{const l=r.values;o=l[0],s=l[r.values.length-1]}if(t.has(r.dimensionName)){const l=t.get(r.dimensionName);l[0]=Math.min(o,l[0]),l[1]=Math.max(s,l[1])}else t.set(r.dimensionName,[o,s])});const i=[];for(const r of t)i.push({name:r[0],extent:r[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(){const e=this.subsetDefinitions?.map(i=>i.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new Be({areaOfInterest:t,subsetDefinitions:e})}};a([n({types:mi,json:{read:et,write:!0}})],G.prototype,"areaOfInterest",void 0),a([n({readOnly:!0})],G.prototype,"dimensions",null),a([n({readOnly:!0})],G.prototype,"variables",null),a([n({type:[tt],json:{write:!0}})],G.prototype,"subsetDefinitions",void 0),G=Be=a([v("esri.layers.support.MultidimensionalSubset")],G);const _i=G;class Ki{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await kt("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 j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},i);return r?new Z(r):null}computeStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");return this._workerThread.invoke("computeStatisticsHistograms",{pixelBlock:t.pixelBlock.toJSON()},i)}async decode(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("decode",t,i);return r?new Z(r):null}async symbolize(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={extent:t.extent?.toJSON(),pixelBlock:t.pixelBlock?.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},o=await this._workerThread.invoke("symbolize",r,i);return o?new Z(o):null}async updateSymbolizer(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:r},i))}async updateRasterFunction(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},i))}async process(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=await this._workerThread.invoke("process",{extent:t.extent?.toJSON(),primaryPixelSizes:t.primaryPixelSizes?.map(o=>o!=null?o.toJSON():null),primaryPixelBlocks:t.primaryPixelBlocks.map(o=>o!=null?o.toJSON():null),primaryRasterIds:t.primaryRasterIds},i);return r?new Z(r):null}async stretch(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},o=await this._workerThread.invoke("stretch",r,i);return o?new Z(o):null}async split(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel,useBilinear:t.useBilinear},o=await this._workerThread.invoke("split",r,i);return o&&o.forEach((s,l)=>{o.set(l,s?Z.fromJSON(s):null)}),o}async clipTile(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={...t,pixelBlock:t.pixelBlock.toJSON()},o=await this._workerThread.invoke("clipTile",r,i);return o?Z.fromJSON(o):null}async estimateStatisticsHistograms(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.pixelBlock)return null;const r={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",r,i)}async mosaicAndTransform(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");if(!t?.srcPixelBlocks?.length)return{pixelBlock:null};const r={...t,srcPixelBlocks:t.srcPixelBlocks.map(s=>s!=null?s.toJSON():null)},o=await this._workerThread.invoke("mosaicAndTransform",r,i);return{pixelBlock:o.pixelBlock?new Z(o.pixelBlock):null,localNorthDirections:o.localNorthDirections}}async createFlowMesh(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:o,simulationSettings:s}=t,l=await this._workerThread.invoke("createFlowMesh",{meshType:o,flowData:r,simulationSettings:s},{...i,transferList:[r.buffer,r.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer)}}getProjectionOffsetGrid(t,i){if(!this._workerThread)throw new j("raster-jobhandler:no-connection","no available worker connection");const r=t.datumTransformation!=null?t.datumTransformation.steps.map(l=>({wkid:l.wkid,wkt:l.wkt,isInverse:l.isInverse})):null,o=t.rasterTransform!=null?t.rasterTransform.toJSON():null,s={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:r,rasterTransform:o,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,i)}}const gi=.25,yi=ct.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]}]}),qe=ct.fromJSON(Vt[0]),yt=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function Qi(e){return e.presetRenderers?.find(({method:t,value:i})=>t==="raster-function-template"?i===e.rasterFunctionName:t==="variable"&&i===e.variableName)}function Xi(e,t){const{attributeTable:i,colormap:r}=e;if(ke(e)){const o=Si(e);if(o!=null)return o}if(t?.rasterFunctionColorRamp){const o=Ye(e,t);return o.colorRamp=t.rasterFunctionColorRamp,o}if(r!=null){const o=bi(e);if(o!=null)return o}if(i!=null){const o=fi(e);if(o!=null)return o}return Ye(e,t)}function qi(e,t=!1){const i=["raster-stretch"];return st(e,t)&&i.push("raster-colormap"),nt(e)&&i.push("unique-value"),Ot(e,t)&&i.push("class-breaks"),Ft(e)&&i.push("raster-shaded-relief"),ke(e)&&i.push("vector-field"),_t(e)&&i.push("flow"),i}function Yi(e){return e.datasetFormat==="Function"&&e.rasterFunction.functionName==="Colormap"?e.rasterFunction.colorRamp:void 0}function $i(e,t,i){const r=["nearest","bilinear","cubic","majority"],o=i?.toLowerCase().replace("bicubic","cubic"),s=r.find(l=>l===o);return t==="Map"?s??"bilinear":e.dataType==="standard-time"?s??"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?s==="nearest"||s==="majority"?s:"nearest":s??"bilinear"}function Ye(e,t){e=Ii(e,t?.variableName);const{bandCount:i}=e;let{bandIds:r,stretchType:o}=t||{};r?.some(M=>M>=i)&&(r=null);let s=e.statistics,l=e.histograms;i>1?(r=r?.length?r:wi(e),s=s==null?null:r?.map(M=>s[M]),l=l==null?null:r?.map(M=>l[M])):r=[0],o==null&&(o=Ai(e)),t?.includeStatisticsInStretch&&(o==="percent-clip"||o==="histogram-equalization")&&e.statistics?.length&&(o="min-max");let u=!1;switch(o){case"none":u=!1;break;case"percent-clip":u=!l?.length;break;default:u=!s?.length}const{dataType:y}=e,c=r?.length===1&&yt.has(y)?yi:null,h=new Ze({stretchType:o,dynamicRangeAdjustment:u,colorRamp:c,outputMin:0,outputMax:255,gamma:r?.length===1?[1]:[1,1,1],useGamma:!1});return o==="percent-clip"?h.maxPercent=h.minPercent=gi:o==="standard-deviation"&&(h.numberOfStandardDeviations=2),u||e.multidimensionalInfo==null&&!t?.includeStatisticsInStretch||(o==="percent-clip"?h.histograms=l:o!=="min-max"&&o!=="standard-deviation"||(h.statistics=s)),h}function Ii(e,t){const{multidimensionalInfo:i}=e;if(!t||!i)return e;const r=i.variables.find(o=>o.name===t);if(!r)return e;if(e=e.clone(),r){const{statistics:o,histograms:s}=r;o?.length&&(e.statistics=o.map(l=>({min:l.min,max:l.max,avg:l.avg,stddev:l.stddev}))),s?.length&&(e.histograms=s)}return e}function wi(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const{bandInfos:i}=e;let r;if(i.length===t){const{red:o,green:s,blue:l,nir:u}=hi(i);o!=null&&s!=null&&l!=null?r=[o,s,l]:u!=null&&o!=null&&s!=null&&(r=[u,o,s])}return!r&&t>=3&&(r=[0,1,2]),r}function hi(e){const t={};for(let i=0;i=410&&s<=480&&l>=480&&l<=540?t.blue=i:t.green==null&&s>=490&&s<=560&&l>=560&&l<=610?t.green=i:t.red==null&&s>=595&&s<=670&&l>=660&&l<=730?t.red=i:t.nir==null&&s>=700&&s<=860&&l>=800&&l<=950&&(t.nir=i)}}return t}function Ai(e){let t="percent-clip";const{pixelType:i,dataType:r,histograms:o,statistics:s,multidimensionalInfo:l}=e,u=yt.has(r)||r==="generic"&&l!=null;return i!=="u8"||r!=="processed"&&o!=null&&s!=null?i==="u8"||r==="elevation"||u?t="min-max":o!=null?t="percent-clip":s!=null&&(t="min-max"):t="none",t}function fi(e,t,i,r){if(!nt(e,t))return null;const{attributeTable:o,statistics:s}=e,l=It(o,t),u=Y(o,"red"),y=Y(o,"green"),c=Y(o,"blue"),h=new rt,M=[],B=new Set,N=!!(u&&y&&c);if(o!=null)o.features.forEach(d=>{const m=d.attributes[l.name];if(!B.has(d.attributes[l.name])&&m!=null){B.add(m);const L=N&&(u.type==="single"||u.type==="double")&&(y.type==="single"||y.type==="double")&&(c.type==="single"||c.type==="double")&&!o.features.some(W=>W.attributes[u.name]>1||W.attributes[y.name]>1||W.attributes[c.name]>1),z=L?255:1;M.push(new _e({value:d.attributes[l.name],label:d.attributes[l.name]+"",symbol:new Oe({style:"solid",outline:null,color:new b(N?[d.attributes[u.name]*z,d.attributes[y.name]*z,d.attributes[c.name]*z,1]:[0,0,0,0])})}))}});else if(s?.[0])for(let d=s[0].min;d<=s[0].max;d++)M.push(new _e({value:d,label:d.toString(),symbol:new Oe({style:"solid",outline:null,color:new b([0,0,0,0])})}));if(M.sort((d,m)=>d.value&&typeof d.value.valueOf()=="string"?0:d.value>m.value?1:-1),!N){const d=ot(qe,{numColors:M.length});M.forEach((m,L)=>m.symbol.color=new b(d[L].slice(1,4))),h.colorRamp=qe}return new He({field:l.name,uniqueValueInfos:M,authoringInfo:h})}function It(e,t,i){let r;return e!=null?(r=t?e.fields.find(o=>t.toLowerCase()===o.name.toLowerCase()):Di(e.fields),r||(i||(r=e.fields.find(o=>o.type==="string")),r||(r=Y(e,"value")))):r=new Pt({name:"value"}),r}function Di(e){let t;for(let i=0;ii.name.toLowerCase()===t)}function bi(e){if(!st(e))return null;let t;const{attributeTable:i,colormap:r}=e;if(i!=null){const o=Y(i,"value"),s=It(i,null,!0);s.type==="string"&&(t={},i.features.forEach(l=>{const u=l.attributes;t[u[o.name]]=s?u[s.name]:u[o.name]}))}return Re.createFromColormap(r,t)}const vi=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function Si(e){if(!ke(e))return null;let t;if(e.statistics!=null&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:o,maxMagnitude:s}=ji(e.dataType,e.statistics);t=[new Ue({field:"Magnitude",minSize:10,maxSize:40,minDataValue:o,maxDataValue:s})]}const i=e.multidimensionalInfo!=null?vi.get(e.multidimensionalInfo.variables[0].unit):void 0,r=new Ee({visualVariables:t,inputUnit:i,rotationType:"geographic"});return r.visualVariables=[...r.sizeVariables,...r.rotationVariables],r}function $e(e){return{color:e.symbolLayers[0].material?.color,type:"esriSFS",style:"esriSFSSolid"}}function er(e){if(e.type==="uniqueValue"){const t=e.uniqueValueInfos;return t?.[0].symbol?.symbolLayers?.length&&(e.uniqueValueInfos=t?.map(i=>({value:i.value,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}if(e.type==="classBreaks"){const t=e.classBreakInfos;return t[0].symbol?.symbolLayers?.length&&(e.classBreakInfos=t.map(i=>({classMinValue:i.classMinValue,classMaxValue:i.classMaxValue,label:i.label,symbol:i.symbol?$e(i.symbol):null}))),e}return e}function ji(e,t){let i,r;if(e==="vector-magdir")i=t[0].min,r=t[0].max;else{const o=t[0].min,s=t[0].max,l=t[1].min,u=t[1].max;i=0,r=Math.max(Math.abs(o),Math.abs(l),Math.abs(s),Math.abs(u))}return{minMagnitude:i,maxMagnitude:r}}var ze;let U=ze=class extends S{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.rasterFunction=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(e,t,i){e!=null&&(t.geometryType=zt(e),t[i]=e.toJSON())}clone(){return new ze(w({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};a([n({types:Ct,json:{read:et}})],U.prototype,"geometry",void 0),a([ce("geometry")],U.prototype,"writeGeometry",null),a([n({type:Mi,json:{write:!0}})],U.prototype,"mosaicRule",void 0),a([n({type:gt,json:{write:!0,name:"renderingRule"}})],U.prototype,"rasterFunction",void 0),a([n({type:_,json:{write:!0}})],U.prototype,"pixelSize",void 0),a([n({json:{write:!0}})],U.prototype,"raster",void 0),a([n({type:Qt,json:{read:{source:"time"},write:{target:"time"}}})],U.prototype,"timeExtent",void 0),U=ze=a([v("esri.rest.support.ImageHistogramParameters")],U);const tr=U;async function wt(e,t,i){const r=Xt(e),{rasterFunction:o,sourceJSON:s}=t||{},l=o?JSON.stringify(o.rasterFunctionDefinition||o):null,u=qt({...r.query,renderingRule:l,f:"json"}),y=Yt(u,i);e=r.path;const c=s||await O(e,y).then(C=>C.data),h=c.hasRasterAttributeTable?O(`${e}/rasterAttributeTable`,y):null,M=c.hasColormap?O(`${e}/colormap`,y):null,B=c.hasHistograms?O(`${e}/histograms`,y):null,N=c.currentVersion>=10.3?O(`${e}/keyProperties`,y):null,d=c.hasMultidimensions?O(`${e}/multidimensionalInfo`,y):null,m=await Promise.allSettled([h,M,B,N,d]);let L=null;if(c.minValues&&c.minValues.length===c.bandCount){L=[];for(let C=0;C{C.statistics?.length&&C.statistics.forEach(ee=>{ee.avg=ee.mean,ee.stddev=ee.standardDeviation})});const{defaultVariable:Me,serviceDataType:me}=c;Me&&Me!==K.DefaultVariable&&(K.DefaultVariable=Me),me?.includes("esriImageServiceDataTypeVector")&&!me.includes(K.DataType)&&(K.DataType=me.replace("esriImageServiceDataType",""));let ge=c.noDataValue;c.noDataValues?.length&&c.noDataValues.some(C=>C!==ge)&&(ge=c.noDataValues);const Dt=c.transposeInfo?new Jt({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new _({x:c.extent.xmin,y:c.extent.ymax,spatialReference:de}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(W,Pe))/Math.LN2-8)),transposeInfo:c.transposeInfo}):void 0;return new Wt({width:W,height:Pe,bandCount:c.bandCount,extent:fe.fromJSON(c.extent),spatialReference:de,pixelSize:new _({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:de}),pixelType:c.pixelType.toLowerCase(),statistics:L,attributeTable:ht,colormap:At,histograms:ft,keyProperties:K,noDataValue:ge,multidimensionalInfo:pe,storageInfo:Dt})}function ir(e,t,i){return wt(e,{sourceJSON:t},i)}function rr(e,t,i){return wt(e,{rasterFunction:t},i)}function ar(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}let P=class extends Tt(S){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};a([n({type:String,json:{write:!0}})],P.prototype,"name",void 0),a([n({type:["raster-function-template","variable","none"],json:{write:!0}}),J({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],P.prototype,"method",void 0),a([n({type:String,json:{write:!0}})],P.prototype,"value",void 0),a([n({type:[R],json:{write:!0}})],P.prototype,"bandIds",void 0),a([n({types:je,json:{write:!0,origins:{"web-scene":{types:Ce,write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],P.prototype,"renderer",void 0),P=a([v("esri.renderers.support.RasterPresetRenderer")],P);const Ci=P,or=e=>{let t=class extends e{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return a([n({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],t.prototype,"activePresetRendererName",void 0),a([n({type:[Ci],json:{name:"layerDefinition.presetRenderers",write:!0}})],t.prototype,"presetRenderers",void 0),t=a([v("esri.layers.mixins.RasterPresetRendererMixin")],t),t};export{_i as A,Yi as C,ir as E,Ii as I,or as J,Mi as M,rr as P,Xi as S,$i as T,ar as V,tr as Z,Wi as a,er as b,Ce as c,Fi as d,Ki as f,qi as j,gt as k,je as l,Oi as p,we as u,Qi as v,wi as w}; diff --git a/custom-toc-highlight/assets/RasterSymbolizer-BVys6HkM-BrCOeMHl.js b/custom-toc-highlight/assets/RasterSymbolizer-BVys6HkM-DCN-TPRo.js similarity index 99% rename from custom-toc-highlight/assets/RasterSymbolizer-BVys6HkM-BrCOeMHl.js rename to custom-toc-highlight/assets/RasterSymbolizer-BVys6HkM-DCN-TPRo.js index a7e2ace6..6ba18d02 100644 --- a/custom-toc-highlight/assets/RasterSymbolizer-BVys6HkM-BrCOeMHl.js +++ b/custom-toc-highlight/assets/RasterSymbolizer-BVys6HkM-DCN-TPRo.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lerc-wasm-p5Heunzu-CsUnIe3C.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{_ as cr}from"./main-ugzBrWNm.js";import{aK as _t,v as D,S as N,i as Me,a0 as hr,ac as fr,w as dr,n as vt,J as pr,e as Ge,P as oe,o as ge,O as ze,a1 as wt,co as mr,x as gr,aS as yr,ar as Tt,bw as Cr}from"./story-BfX8CRfG.js";import{D as re,b as ft,n as br,L as Se,c as dt,r as Ze,h as vr,d as It,e as Oe}from"./dataUtils-BkPy4R3C-Cb9EIxnj.js";import{t as Wt}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import{S as _e,T as St,U as xt,l as wr}from"./colorUtils-Cthpxcks-ZRnr1H1b.js";const Ko=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],Ht=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],Tr=new _t({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function Ve(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;rt[r]+2||e[r]kt(r))),t}return kt(e)}function At(e,t){if(!e)return;const r=Ht;let o=null;return e.type==="algorithmic"?r.some(i=>{if(Ve(e.fromColor.toRgb(),i.fromColor)&&Ve(e.toColor.toRgb(),i.toColor))return o=i.id,!0}):e.type==="multipart"&&r.some(i=>{const l=e.colorRamps,f=i.colorRamps;if(l&&f&&l.length===f.length&&!f.some((a,s)=>{if(!Ve(l[s].fromColor.toRgb(),new Tt(a.fromColor).toRgb())||!Ve(l[s].toColor.toRgb(),new Tt(a.toColor).toRgb()))return!0})){if(o)return!0;o=i.id}}),o}function Sr(e,t,r=!1){if(!e)return;let o=!1,i=At(e);return i!=null||r||(o=!0,i=At(e=Ir(e))),i?{id:i,inverted:o}:void 0}function xr(e,t=!1){const r=typeof e=="string"?e:Sr(e,void 0,t)?.id;return r?Tr.toJSON(r):null}function Yo(e,t="esriCIELabAlgorithm"){const r=Ht.find(({id:o})=>o===e);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(o=>({type:"algorithmic",algorithm:t,fromColor:[...o.fromColor],toColor:[...o.toColor]}))}:{type:"algorithmic",algorithm:t,fromColor:[...r.fromColor],toColor:[...r.toColor]}:null}function Jt(e){const t=(e=e||{}).numColors||256,r=e.distanceOffset||0,o=e.isCustomInterval!=null?e.isCustomInterval:e.distanceInterval!==null&&e.distanceInterval!==1/(t-1),i=e.distanceInterval||1/(t-1);return{...e,numColors:t,distanceOffset:r,interpolateAlpha:!!e.interpolateAlpha,distanceInterval:i,isCustomInterval:o,weights:e.weights}}function kr(e,t,r){const{numColors:o,distanceOffset:i,distanceInterval:l,isCustomInterval:f}=r,a=e.s===0,s=t.s===0;let u=e.h,n=t.h;a&&!s?u=n:s&&!a&&(t={...t,h:u},n=u);let c,h=Math.abs(n-u);const m=360;hn?h*l:-h*l);const p=(t.s-e.s)*l,y=(t.v-e.v)*l;let{s:S,v}=e,k=u;if(i){const d=i/l;k=(k+d*c+m)%m,S+=d*p,v+=d*y}const w=[];for(let d=0;dh+m);i=i.map(h=>h/c)}else{i=[];for(let c=0;c{i.unshift(l),o||i.pop()}),r}function Or(e){const t=[];for(let r=0;r{const o=r.toString(16);return o.length<2?"0"+o:o});return 4294967295&Number.parseInt(t.join(""),16)}const Zo=new _t({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),Dr={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};var ot;function we(e){return e=Number(e),isNaN(e)?void 0:e}let he=ot=class extends Ge{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new ot({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};D([N({json:{name:"BandName",write:!0}})],he.prototype,"name",void 0),D([N({json:{name:"WavelengthMin",read:{reader:we},write:!0}})],he.prototype,"minWavelength",void 0),D([N({json:{name:"WavelengthMax",read:{reader:we},write:!0}})],he.prototype,"maxWavelength",void 0),D([N({json:{name:"RadianceBias",read:{reader:we},write:!0}})],he.prototype,"radianceBias",void 0),D([N({json:{name:"RadianceGain",read:{reader:we},write:!0}})],he.prototype,"radianceGain",void 0),D([N({json:{name:"ReflectanceBias",read:{reader:we},write:!0}})],he.prototype,"reflectanceBias",void 0),D([N({json:{name:"ReflectanceGain",read:{reader:we},write:!0}})],he.prototype,"reflectanceGain",void 0),D([N({json:{name:"SolarIrradiance",read:{reader:we},write:!0}})],he.prototype,"solarIrradiance",void 0),he=ot=D([Me("esri.layers.support.RasterBandInfo")],he);const Ot=he;var nt;function De(e){return e=Number(e),isNaN(e)?void 0:e}let se=nt=class extends Ge{constructor(){super(...arguments),this.acquisitionDate=void 0,this.cloudCover=void 0,this.productName=void 0,this.sensorName=null,this.sensorAzimuth=void 0,this.sensorElevation=void 0,this.sunAzimuth=void 0,this.sunElevation=void 0}readAcquisitionDate(e){return new Date(e)}writeAcquisitionDate(e,t){t.AcquisitionDate=e.getTime()}clone(){return new nt({acquisitionDate:this.acquisitionDate,cloudCover:this.cloudCover,productName:this.productName,sensorName:this.sensorName,sensorAzimuth:this.sensorAzimuth,sensorElevation:this.sensorElevation,sunAzimuth:this.sunAzimuth,sunElevation:this.sunElevation})}};D([N({json:{name:"AcquisitionDate",write:!0}})],se.prototype,"acquisitionDate",void 0),D([hr("acquisitionDate")],se.prototype,"readAcquisitionDate",null),D([fr("acquisitionDate")],se.prototype,"writeAcquisitionDate",null),D([N({json:{name:"CloudCover",read:{reader:De},write:!0}})],se.prototype,"cloudCover",void 0),D([N({json:{name:"ProductName",write:!0}})],se.prototype,"productName",void 0),D([N({json:{name:"SensorName",write:!0}})],se.prototype,"sensorName",void 0),D([N({json:{name:"SensorAzimuth",read:{reader:De},write:!0}})],se.prototype,"sensorAzimuth",void 0),D([N({json:{name:"SensorElevation",read:{reader:De},write:!0}})],se.prototype,"sensorElevation",void 0),D([N({json:{name:"SunAzimuth",read:{reader:De},write:!0}})],se.prototype,"sunAzimuth",void 0),D([N({json:{name:"SunElevation",read:{reader:De},write:!0}})],se.prototype,"sunElevation",void 0),se=nt=D([Me("esri.layers.support.RasterSensorInfo")],se);const Lr=se;var it;let te=it=class extends Ge{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 it({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:oe(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:oe(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:oe(this.tileInfo),transposeInfo:oe(this.transposeInfo),blockBoundary:oe(this.blockBoundary)})}};D([N({type:Number,json:{write:!0}})],te.prototype,"blockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"blockHeight",void 0),D([N({type:String,json:{write:!0}})],te.prototype,"compression",void 0),D([N({type:dr,json:{write:!0}})],te.prototype,"origin",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"firstPyramidLevel",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"maximumPyramidLevel",void 0),D([N({json:{write:!0}})],te.prototype,"pyramidResolutions",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidScalingFactor",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockHeight",void 0),D([N({type:Boolean,json:{write:!0}})],te.prototype,"isVirtualTileInfo",void 0),D([N({json:{write:!0}})],te.prototype,"tileInfo",void 0),D([N()],te.prototype,"transposeInfo",void 0),D([N()],te.prototype,"blockBoundary",void 0),te=it=D([Me("esri.layers.support.RasterStorageInfo")],te);const Mr=te;var at;let $=at=class extends Ge{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 bandInfos(){const e=this.keyProperties.BandProperties,{bandCount:t}=this;if(!e?.length||e.lengthOt.fromJSON(o));for(let o=0;oa&&(f=a)}else{for(;!this.eof;)this.readBlock();f=this.bufferLength}return this.pos=f,this.buffer.subarray(l,f)},lookChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(i,l,f){for(var a=i+l;this.bufferLength<=a&&!this.eof;)this.readBlock();return new Stream(this.buffer,i,l,f)},skip:function(i){i||(i=1),this.pos+=i},reset:function(){this.pos=0}},o}(),(r=function(){if(!self||!self.Uint32Array)return null;var o=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=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]),l=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]),f=[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 s(n){throw new Error(n)}function u(n){var c=0,h=n[c++],m=n[c++];h!=-1&&m!=-1||s("Invalid header in flate stream"),(15&h)!=8&&s("Unknown compression method in flate stream"),((h<<8)+m)%31!=0&&s("Bad FCHECK in flate stream"),32&m&&s("FDICT bit set in flate stream"),this.bytes=n,this.bytesPos=c,this.codeSize=0,this.codeBuf=0,e.call(this)}return u.prototype=Object.create(e.prototype),u.prototype.getBits=function(n){for(var c,h=this.codeSize,m=this.codeBuf,p=this.bytes,y=this.bytesPos;h>n,this.codeSize=h-=n,this.bytesPos=y,c},u.prototype.getCode=function(n){for(var c=n[0],h=n[1],m=this.codeSize,p=this.codeBuf,y=this.bytes,S=this.bytesPos;m>16,d=65535&k;return(m==0||m>w,this.codeSize=m-w,this.bytesPos=S,d},u.prototype.generateHuffmanTable=function(n){for(var c=n.length,h=0,m=0;mh&&(h=n[m]);for(var p=1<>=1;for(m=d;m0;)Y[k++]=H}var c=this.getBits(3);if(1&c&&(this.eof=!0),(c>>=1)!=0){var h,m;if(c==1)h=f,m=a;else if(c==2){for(var p=this.getBits(5)+257,y=this.getBits(5)+1,S=this.getBits(4)+4,v=Array(o.length),k=0;k=b&&(b=(O=this.ensureBuffer(x+1)).length),O[x++]=I;else{if(I==256)return void(this.bufferLength=x);var A=(I=i[I-=257])>>16;A>0&&(A=this.getBits(A)),d=(65535&I)+A,I=this.getCode(m),(A=(I=l[I])>>16)>0&&(A=this.getBits(A));var E=(65535&I)+A;x+d>=b&&(b=(O=this.ensureBuffer(x+d)).length);for(var P=0;P{let n=null;f==="jpg"&&a&&(n=Yt._getMask(t,{width:i,height:l}));const c=new Blob([new Uint8Array(t)],{type:"image/"+f=="jpg"?"jpeg":f}),h=URL.createObjectURL(c),m=new Image;let p;m.src=h,m.onload=()=>{if(URL.revokeObjectURL(h),gr(o))return void u(yr());i=m.width,l=m.height,this._canvas&&this._ctx?(this._canvas.width===i&&this._canvas.height===l||(this._canvas.width=i,this._canvas.height=l),this._ctx.clearRect(0,0,i,l)):(this._canvas=document.createElement("canvas"),this._canvas.width=i,this._canvas.height=l,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(m,0,0);const y=this._ctx.getImageData(0,0,i,l);let S;if(p=y.data,r.renderOnCanvas){if(n)for(S=0;S{URL.revokeObjectURL(h),u("cannot load image")}})}static _getMask(t,r){let o=null;try{const i=new Uint8Array(t),l=Math.ceil(i.length/2);let f=0;const a=i.length-2;for(f=l;f=0;c--)o[u++]=s[n]>>c&1}}catch{}return o}};var Mt,Gt={exports:{}};function Br(){return Mt||(Mt=1,e=Gt,t=function(){var o=function(){function i(l){this.message="JPEG error: "+l}return i.prototype=new Error,i.prototype.name="JpegError",i.constructor=i,i}();return function(){if(!self||!self.Uint8ClampedArray)return null;var i=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]),l=4017,f=799,a=3406,s=2276,u=1567,n=3784,c=5793,h=2896;function m(){this.decodeTransform=null,this.colorTransform=-1}function p(d,g){for(var T,C,b=0,x=[],I=16;I>0&&!d[I-1];)I--;x.push({children:[],index:0});var A,E=x[0];for(T=0;T0;)E=x.pop();for(E.index++,x.push(E);x.length<=T;)x.push(A={children:[],index:0}),E.children[E.index]=A.children,E=A;b++}T+10)return B--,U>>B&1;if((U=d[g++])===255){var M=d[g++];if(M)throw new o("unexpected marker "+(U<<8|M).toString(16))}return B=7,U>>>7}function J(M){for(var K=M;;){if(typeof(K=K[L()])=="number")return K;if(typeof K!="object")throw new o("invalid huffman sequence")}}function O(M){for(var K=0;M>0;)K=K<<1|L(),M--;return K}function z(M){if(M===1)return L()===1?1:-1;var K=O(M);return K>=1<>4;if(ee!==0){var ur=i[ie+=ae];M.blockData[K+ur]=z(ee),ie++}else{if(ae<15)break;ie+=16}}}function V(M,K){var q=J(M.huffmanTableDC),Q=q===0?0:z(q)<0)_--;else for(var q=x,Q=I;q<=Q;){var ie=J(M.huffmanTableAC),ce=15&ie,ee=ie>>4;if(ce!==0){var ae=i[q+=ee];M.blockData[K+ae]=z(ce)*(1<>4,(q=15&Q)==0)ee<15?(_=O(ee)+(1<=65488&&ve<=65495))break;g+=2}return(le=w(d,g))&&le.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+le.invalid),g=le.offset),g-G}function v(d,g,T){var C,b,x,I,A,E,P,R,G,U,B,L,J,O,z,F,V,Y=d.quantizationTable,_=d.blockData;if(!Y)throw new o("missing required Quantization Table.");for(var j=0;j<64;j+=8)G=_[g+j],U=_[g+j+1],B=_[g+j+2],L=_[g+j+3],J=_[g+j+4],O=_[g+j+5],z=_[g+j+6],F=_[g+j+7],G*=Y[j],U|B|L|J|O|z|F?(U*=Y[j+1],B*=Y[j+2],L*=Y[j+3],J*=Y[j+4],O*=Y[j+5],z*=Y[j+6],F*=Y[j+7],b=(C=(C=c*G+128>>8)+(b=c*J+128>>8)+1>>1)-b,V=(x=B)*n+(I=z)*u+128>>8,x=x*u-I*n+128>>8,P=(A=(A=h*(U-F)+128>>8)+(P=O<<4)+1>>1)-P,E=(R=(R=h*(U+F)+128>>8)+(E=L<<4)+1>>1)-E,I=(C=C+(I=V)+1>>1)-I,x=(b=b+x+1>>1)-x,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,P=V,T[j]=C+R,T[j+7]=C-R,T[j+1]=b+P,T[j+6]=b-P,T[j+2]=x+E,T[j+5]=x-E,T[j+3]=I+A,T[j+4]=I-A):(V=c*G+512>>10,T[j]=V,T[j+1]=V,T[j+2]=V,T[j+3]=V,T[j+4]=V,T[j+5]=V,T[j+6]=V,T[j+7]=V);for(var H=0;H<8;++H)G=T[H],(U=T[H+8])|(B=T[H+16])|(L=T[H+24])|(J=T[H+32])|(O=T[H+40])|(z=T[H+48])|(F=T[H+56])?(b=(C=4112+((C=c*G+2048>>12)+(b=c*J+2048>>12)+1>>1))-b,V=(x=B)*n+(I=z)*u+2048>>12,x=x*u-I*n+2048>>12,I=V,P=(A=(A=h*(U-F)+2048>>12)+(P=O)+1>>1)-P,E=(R=(R=h*(U+F)+2048>>12)+(E=L)+1>>1)-E,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,G=(G=(C=C+I+1>>1)+R)<16?0:G>=4080?255:G>>4,U=(U=(b=b+x+1>>1)+(P=V))<16?0:U>=4080?255:U>>4,B=(B=(x=b-x)+E)<16?0:B>=4080?255:B>>4,L=(L=(I=C-I)+A)<16?0:L>=4080?255:L>>4,J=(J=I-A)<16?0:J>=4080?255:J>>4,O=(O=x-E)<16?0:O>=4080?255:O>>4,z=(z=b-P)<16?0:z>=4080?255:z>>4,F=(F=C-R)<16?0:F>=4080?255:F>>4,_[g+H]=G,_[g+H+8]=U,_[g+H+16]=B,_[g+H+24]=L,_[g+H+32]=J,_[g+H+40]=O,_[g+H+48]=z,_[g+H+56]=F):(V=(V=c*G+8192>>14)<-2040?0:V>=2024?255:V+2056>>4,_[g+H]=V,_[g+H+8]=V,_[g+H+16]=V,_[g+H+24]=V,_[g+H+32]=V,_[g+H+40]=V,_[g+H+48]=V,_[g+H+56]=V)}function k(d,g){for(var T=g.blocksPerLine,C=g.blocksPerColumn,b=new Int16Array(64),x=0;x=b)return null;var I=C(g);if(I>=65472&&I<=65534)return{invalid:null,marker:I,offset:g};for(var A=C(x);!(A>=65472&&A<=65534);){if(++x>=b)return null;A=C(x)}return{invalid:I.toString(16),marker:A,offset:x}}return m.prototype={parse:function(d){function g(){var M=d[I]<<8|d[I+1];return I+=2,M}function T(){var M=g(),K=I+M-2,q=w(d,K,I);q&&q.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+q.invalid),K=q.offset);var Q=d.subarray(I,K);return I+=Q.length,Q}function C(M){for(var K=Math.ceil(M.samplesPerLine/8/M.maxH),q=Math.ceil(M.scanLines/8/M.maxV),Q=0;Q>4){if(F>>4!=1)throw new o("DQT - invalid table spec");for(L=0;L<64;L++)V[i[L]]=g()}else for(L=0;L<64;L++)V[i[L]]=d[I++];P[15&F]=V}break;case 65472:case 65473:case 65474:if(b)throw new o("Only single frame JPEGs supported");g(),(b={}).extended=U===65473,b.progressive=U===65474,b.precision=d[I++],b.scanLines=g(),b.samplesPerLine=g(),b.components=[],b.componentIds={};var Y,_=d[I++],j=0,H=0;for(B=0;B<_;B++){Y=d[I];var X=d[I+1]>>4,Pe=15&d[I+1];j>4?R:G)[15&pe]=p(ue,ye)}break;case 65501:g(),x=g();break;case 65498:g();var Z,Re=d[I++],Ce=[];for(B=0;B>4],Z.huffmanTableAC=R[15&be],Ce.push(Z)}var Ne=d[I++],Be=d[I++],de=d[I++],Fe=S(d,I,b,Ce,x,Ne,Be,de>>4,15&de);I+=Fe;break;case 65535:d[I]!==255&&I--;break;default:if(d[I-3]===255&&d[I-2]>=192&&d[I-2]<=254){I-=3;break}throw new o("unknown marker "+U.toString(16))}U=g()}for(this.width=b.samplesPerLine,this.height=b.scanLines,this.jfif=A,this.eof=I,this.adobe=E,this.components=[],B=0;B>8)+_[R+1];return F},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(d){for(var g,T,C,b=0,x=d.length;b4)throw new o("Unsupported color mode");var C=this._getLinearizedBlockData(d,g);if(this.numComponents===1&&T){for(var b=C.length,x=new Uint8ClampedArray(3*b),I=0,A=0;A=0;p--)c[S++]=y[h]>>p&1}catch{}if(f===1&&s.length===i*l){const y=new Uint8Array(s.buffer);n=[y,y,y]}else{for(n=[],h=0;h<3;h++)n.push(new Uint8Array(u));for(p=0,m=0;mimport("./lerc-wasm-p5Heunzu-CsUnIe3C.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>Cr(`esri/layers/support/rasterFormats/${t}`)})).then(e=>{zr(e)}),Xe)}const We={getBlobInfo:null,decode:null};function Vr(e){return 16+(e>>3<<3)}function me(e,t,r){r.set(e.slice(t,t+r.length))}function zr(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:o,_lerc_getDataRanges:i,_lerc_decode_4D:l,asm:f}=e;let a;const s=Object.values(f).find(n=>n&&"buffer"in n&&n.buffer===e.HEAPU8.buffer),u=n=>{const c=n.map(y=>Vr(y)),h=c.reduce((y,S)=>y+S),m=t(h);a=new Uint8Array(s.buffer);let p=c[0];c[0]=m;for(let y=1;y{const c=new Uint8Array(48),h=new Uint8Array(8*3),[m,p,y]=u([n.length,c.length,h.length]);a.set(n,m),a.set(c,p),a.set(h,y);let S=o(m,n.length,p,y,12,3);if(S)throw r(m),new Error(`lerc-getBlobInfo: error code is ${S}`);a=new Uint8Array(s.buffer),me(a,p,c),me(a,y,h);const v=new Uint32Array(c.buffer),k=new Float64Array(h.buffer),[w,d,,g,T,C,b,x,I,A,E]=v,P={version:w,depthCount:A,width:g,height:T,validPixelCount:b,bandCount:C,blobSize:x,maskCount:I,dataType:d,minValue:k[0],maxValue:k[1],maxZerror:k[2],statistics:[],bandCountWithNoData:E};if(E&&A>1)return r(m),P;if(A===1&&C===1)return r(m),P.statistics.push({minValue:k[0],maxValue:k[1]}),P;const R=A*C*8,G=new Uint8Array(R),U=new Uint8Array(R);let B=m,L=0,J=0,O=!1;if(a.byteLength1){const _=z.slice(Y*A,(Y+1)*A),j=F.slice(Y*A,(Y+1)*A),H=Math.min.apply(null,_),X=Math.max.apply(null,j);V.push({minValue:H,maxValue:X,depthStats:{minValues:_,maxValues:j}})}else V.push({minValue:z[Y],maxValue:F[Y]});return r(B),O||r(L),P},We.decode=(n,c)=>{const{maskCount:h,depthCount:m,bandCount:p,width:y,height:S,dataType:v,bandCountWithNoData:k}=c,w=$t[v],d=y*S,g=new Uint8Array(d*p),T=d*m*p*w.size,C=new Uint8Array(T),b=new Uint8Array(p),x=new Uint8Array(8*p),[I,A,E,P,R]=u([n.length,g.length,C.length,b.length,x.length]);a.set(n,I),a.set(g,A),a.set(C,E),a.set(b,P),a.set(x,R);const G=l(I,n.length,h,A,m,y,S,p,v,E,P,R);if(G)throw r(I),new Error(`lerc-decode: error code is ${G}`);a=new Uint8Array(s.buffer),me(a,E,C),me(a,A,g);let U=null;if(k){me(a,P,b),me(a,R,x),U=[];const B=new Float64Array(x.buffer);for(let L=0;L1){g.set(k[0]);for(let I=1;I=T;if(m>0&&C)for(let I=0;I1?k:null,{pixelType:x}=y;return{width:s,height:u,bandCount:n,pixelType:x,depthCount:c,statistics:p,pixels:v,mask:g,bandMasks:b,noDataValues:a}}function _r(e,t,r,o=!0){if(t%4!=0||r%4!=0){const i=new ArrayBuffer(4*Math.ceil(r/4)),l=new Uint8Array(i),f=new Uint8Array(e,t,r);if(o)for(let a=0;a=l)a-=l,h=c>>>32-l,c<<=l;else{h=c>>>32-a,c=i[n++];const v=l-a;a=32-v,h=(h<>>a),c<<=v}if(h===257)break;if(h===256){l=9,f=Ut(),s=f.length,u=[];continue}const S=f[h];if(S==null){if(h>f.length)throw new Error("data integrity issue: code does not exist on code page");u.push(u[0]),f[s++]=u.slice(),Nt(y,u)}else Nt(y,S),u.push(S[0]),u.length>1&&(f[s++]=u.slice()),u=S.slice();if(xe.has(s)&&l++,a===0&&(c=i[n++],a=32),n>m||n===m&&a<=p)break}return new Uint8Array(y)}xe.add(511),xe.add(1023),xe.add(2047),xe.add(4095),xe.add(8191);const Bt=(e,t)=>{const r=t.width*t.height,o=t.pixelType;return Math.floor(e.byteLength/(r*Qt(o)))},Qt=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},Wr=(e,t)=>{if(8*e.byteLength=0;a--)o[i++]=l>>a&1;for(a=7;i>a&1,a--;return o};let Hr=class{static decode(e,t){const r=t.pixelType,o=[],i=t.width*t.height,l=Bt(e,t),{bandIds:f,format:a}=t,s=f?.length||Bt(e,t),u=e.byteLength-e.byteLength%(i*Qt(r)),n=new r(e,0,i*l);let c,h,m,p,y=null;if(a==="bip")for(c=0;c>4,i<8?i=1:i===15?(i=4,l=(7&l)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):i===14?(i=3,l=(15&l)<<12|(63&e[r++])<<6|63&e[r++]):(i=2,l=(31&l)<<6|63&e[r++]),(l!==0||t)&&(o+=String.fromCharCode(l));return o}const mt=(()=>{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})(),Kr=(()=>{const e=mt.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})(),Yr=["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"],qr=(()=>{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})(),$r=(e,t)=>{let r=(t||mt)[e];return r===void 0&&(r="unknown"+String(e)),r},st=new Map;st.set("EXIFIFD",Kr),st.set("GPSIFD",Yr);const Ae={tiffTags:mt,ifdTags:st,geoKeys:qr,getTagName:$r},gt=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,t[0]===1})(),Ft=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],Ee=4294967296,Zr=new Set([1,5,6,7,8,34712,34887]);function yt(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 He(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 Xr(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 er(e,t){return e.get(t)?.values}function Ie(e,t){return e.get(t)?.values}function Vt(e,t){return e.get(t)?.values?.[0]}function W(e,t){return e.get(t)?.values?.[0]}function Qe(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=l===8,a=f?bt(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),s=4+2*l,u=f?8:2,n=u+a*s;if(r+n>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:n};const c=r+n+4<=e.byteLength?je(new DataView(e,r+n,l===8?8:4),0,t,l===8):null,h=r+u,m=new Map;let p,y,S,v,k,w=0,d=0;for(let g=0;gXt(e,{inputOffset:t}).pixels[0];function lt(e,t){if(t!==1&&t!==2&&t!==4)return e;const r=new Uint8Array(e),o=8/t,i=new Uint8Array(e.byteLength*o);let l=0;const f=2**t-1;for(let a=0;a>>8-t&f}return i.buffer}function ut(e,t,r){const o=new qt;o.parse(e),o.colorTransform=r===6?-1:0;const i=o.getData(o.width,o.height,t!==1&&t!==4);return new Uint8Array(i.buffer)}function ct(e){const t=new Ue(e).getBytes(),r=new ArrayBuffer(t.length),o=new Uint8Array(r);return o.set(t),o}async function ht(e,t,r,o,i){const l=gt===t,f=W(r,"BITSPERSAMPLE"),a=W(r,"SAMPLESPERPIXEL")??1,s=W(r,"PHOTOMETRICINTERPRETATION"),u=W(r,"SAMPLEFORMAT")??1,n=yt(u,f),c=W(r,"COMPRESSION")??1,h=He(n);let m,p,y;if(c===34887)return await Zt(),Qr(e,o);if(c===1)m=e.slice(o,o+i),p=new Uint8Array(m);else if(c===8||c===32946)p=new Uint8Array(e,o,i),p=ct(p),m=p.buffer;else if(c===6)p=new Uint8Array(e,o,i),p=ut(p,a,s),m=p.buffer;else if(c===7){const w=r.get("JPEGTABLES").values,d=w.length-2;p=new Uint8Array(d+i-2);for(let T=0;T1&&(c===5||c===8||c===32946)&&v&&k){const w=Je(r),d=new h(y.length);d.set(y),y=uo(d,k,v,u===3&&S===3,w?1:a)}return y}async function eo(e,t,r){const o=Ie(r,"TILEOFFSETS");if(o===void 0)return null;const i=Ie(r,"TILEBYTECOUNTS"),{width:l,height:f,pixelType:a,tileWidth:s,tileHeight:u}=Ct([r]),n=Je(r,t),c=W(r,"SAMPLESPERPIXEL")||t.planes,h=l*f,m=W(r,"BITSPERSAMPLE"),p=(W(r,"COMPRESSION")??1)===34887,y=He(a),S=[];for(let B=0;B1){const B=Math.round(o.length/c);for(v=0;v{const o=gt===t.littleEndian,i=Ie(r,"STRIPOFFSETS");if(i===void 0)return null;const{width:l,height:f,pixelType:a}=Ct([r]),s=W(r,"SAMPLESPERPIXEL")||t.planes,u=W(r,"PHOTOMETRICINTERPRETATION"),n=l*f,c=W(r,"BITSPERSAMPLE"),h=He(a),m=new h(n*s),p=Ie(r,"STRIPBYTECOUNTS"),y=W(r,"ROWSPERSTRIP"),S=W(r,"COMPRESSION")??1;let v,k,w,d,g,T,C,b,x;if(c%8==0)for(v=0;v{if(!(e&&e.length>0&&t&&r))return null;let o,i,l;const f=e[0].length,a=e.length,s=new Uint8Array(f);for(let u=0;ul?0:1;else for(let n=0;nl?0:1);return s},oo=e=>{if(!e)return null;const t=e.match(//gi);if(!t||t.length===0)return null;const r=new Map;let o,i,l,f,a;for(let v=0;v")),f=o.indexOf("sample="),f>-1&&(a=o.slice(f+8,o.indexOf('"',f+8))),f=o.indexOf("name="),f>-1&&(i=o.slice(f+6,o.indexOf('"',f+6))),i&&(l=o.slice(o.indexOf(">")+1,o.indexOf("")).trim(),a!=null?r.has(i)?r.get(i)[a]=l:r.set(i,[l]):r.set(i,l)),a=null;const s=r.get("STATISTICS_MINIMUM"),u=r.get("STATISTICS_MAXIMUM"),n=r.get("STATISTICS_MEAN"),c=r.get("STATISTICS_STDDEV");let h=null;if(s&&u){h=[];for(let v=0;vS&&h>(i?e.byteLength:e?e.byteLength-s+o:0))return r.offlineOffsetSize=[s,h],r.values=null,!1;if(m<=S){if(!t)if(S<=32)s>>>=32-m;else{const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);m<=32?(s=k>>>32-m,v[0]=s):(s=k*2**(32-m)+(w>>>32-m),v[0]=k,v[1]=w>>>32-m)}if(a===1&&c===S)u=[s];else if(S===64){const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);let d=k,g=32;for(y=1;y<=a;y++){const T=32-c*y%32;if(g>>32-g,b=w<<32-g>>>32-g;d=w,u.push(C+b*2**(c-g)),g-=32-(c-g)}else u.push(d<>>32-c),g-=c;g===0&&(g=32,d=w)}}else for(y=1;y<=a;y++){const k=32-c*y;u.push(s<>>32-c)}}else{s-=o,i&&(s=0);for(let k=s;kparseFloat(z)),h.some(z=>isNaN(z))&&(h=null));const m=W(t,"COMPRESSION")??1;let p;switch(m){case 1:p="NONE";break;case 2:case 3:case 4:case 32771:p="CCITT";break;case 5:p="LZW";break;case 6:case 7:p="JPEG";break;case 32773:p="PACKBITS";break;case 8:case 32946:p="DEFLATE";break;case 34712:p="JPEG2000";break;case 34887:p="LERC";break;default:p=String(m)}let y=!0,S="";Zr.has(m)||(y=!1,S+="unsupported tag compression "+m),s>3&&(y=!1,S+="unsupported tag sampleFormat "+s),f!==1&&f!==2&&f!==4&&f%8!=0&&(y=!1,S+="unsupported tag bitsPerSample "+f);const v=Vt(t,"GEOASCIIPARAMS");let k;if(v){const z=v.split("|").find(V=>V.includes("ESRI PE String = ")),F=z?z.replace("ESRI PE String = ",""):"";k=F.startsWith("COMPD_CS")||F.startsWith("PROJCS")||F.startsWith("GEOGCS")?{wkid:null,wkt:F}:null}const w=Ie(t,"GEOTIEPOINTS"),d=Ie(t,"GEOPIXELSCALE"),g=Ie(t,"GEOTRANSMATRIX"),T=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let C,b,x=!1,I=!1;if(T){x=W(T,"GTRasterTypeGeoKey")===2;const z=W(T,"GTModelTypeGeoKey");if(z===2){const F=W(T,"GeographicTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F}),k||F!==32767||(I=!0,k={wkid:4326})}else if(z===1){const F=W(T,"ProjectedCSTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F})}}if(d&&w&&w.length>=6?(C=[d[0],0,w[3]-w[0]*d[0],0,-Math.abs(d[1]),w[4]-w[1]*d[1]],x&&(C[2]-=.5*C[0]+.5*C[1],C[5]-=.5*C[3]+.5*C[4])):g&&g.length===16&&(C=x?[g[0],g[1],g[3]-.5*g[0],g[4],g[5],g[7]-.5*g[5]]:[g[0],g[1],g[3],g[4],g[5],g[7]]),C){const z=[{x:0,y:l},{x:0,y:0},{x:i,y:l},{x:i,y:0}];let F,V=Number.POSITIVE_INFINITY,Y=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let H=0;HV?V:F.x,_=F.x<_?_:F.x,Y=F.y>Y?Y:F.y,j=F.y400||Math.max(Math.abs(b.xmin),Math.abs(b.xmax))>361)&&(k=null,b.spatialReference=null);const A=tr(e);let E,P,R,G,U;if(A.length>0){R=Math.round(Math.log(i/W(A[0],"IMAGEWIDTH"))/Math.LN2);const z=A[A.length-1];G=A.length,E=W(z,"TILEWIDTH"),P=W(z,"TILELENGTH")}E=G!=null&&G>0?E||r:null,P=G!=null&&G>0?P||o:null,r&&(U=[{maxCol:Math.ceil(i/r)-1,maxRow:Math.ceil(l/o)-1,minRow:0,minCol:0}],A.forEach(z=>{U.push({maxCol:Math.ceil(W(z,"IMAGEWIDTH")/W(z,"TILEWIDTH"))-1,maxRow:Math.ceil(W(z,"IMAGELENGTH")/W(z,"TILELENGTH"))-1,minRow:0,minCol:0})}));const B=Vt(e[0],"GDAL_METADATA"),L=oo(B);S+=" "+or({width:i,height:l,tileWidth:r,tileHeight:o,planes:a,ifds:e});const J=rr(e).length===A.length+1,O=A?.length?A.map(z=>({x:i/W(z,"IMAGEWIDTH"),y:l/W(z,"IMAGELENGTH")})):void 0;return{width:i,height:l,tileWidth:r,tileHeight:o,planes:a,isBSQ:n,pixelType:u,compression:p,noData:h,hasMaskBand:J,isSupported:y,pyramidResolutions:O,message:S,extent:b,isPseudoGeographic:I,affine:d?null:C,firstPyramidLevel:R,maximumPyramidLevel:G,pyramidBlockWidth:E,pyramidBlockHeight:P,tileBoundary:U,metadata:L}}function Je(e,t){const r=er(e,"PLANARCONFIGURATION");return r?r[0]===2:!!t&&t.isBSQ}function tr(e){return e.filter(t=>W(t,"NEWSUBFILETYPE")===1)}function rr(e){return e.filter(t=>{const r=!(4&~(W(t,"NEWSUBFILETYPE")??0)),o=W(t,"PHOTOMETRICINTERPRETATION")===4;return r&&o})}function io(e){const{littleEndian:t,isBigTiff:r,firstIFDPos:o}=so(e);let i=o;const l=[];do{const f=lo(e,t,i,0,Ae.tiffTags,r?8:4);if(!f.success)break;l.push(f.ifd),i=f.nextIFD}while(i>0);return{...Ct(l),littleEndian:t,isBigTiff:r,ifds:l,pyramidIFDs:tr(l),maskIFDs:rr(l)}}function bt(e,t,r){const o=e.getUint32(t,r),i=e.getUint32(t+4,r);return r?i*Ee+o:o*Ee+i}function ao(e,t,r){let o=r?e.getInt32(t,r):e.getUint32(t,r),i=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const l=(r?o:i)>=0?1:-1;return r?o*=l:i*=l,l*(r?i*Ee+o:o*Ee+i)}function je(e,t,r,o){return o?bt(e,t,r):e.getUint32(t,r)}function so(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let o=null;if(r===18761)o=!0;else{if(r!==19789)throw new Error("unexpected endianess byte");o=!1}const i=t.getUint16(2,o);if(i!==42&&i!==43)throw new Error("unexpected tiff identifier");let l=4;const f=i===43;if(f){const a=t.getUint16(l,o);if(l+=2,a!==8)throw new Error("unsupported bigtiff version");if(t.getUint16(l,o)!==0)throw new Error("unsupported bigtiff version");l+=2}return{littleEndian:o,isBigTiff:f,firstIFDPos:je(t,l,o,f)}}function lo(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=Qe(e,t,r,o,i,l);let a;const s=f.ifd;if(s){if(Ae.ifdTags.forEach((u,n)=>{s.has(n)&&(a=s.get(n),a.data=Qe(e,t,a.valueOffset-o,o,u).ifd)}),s.has("GEOKEYDIRECTORY")){a=s.get("GEOKEYDIRECTORY");const u=a.values;if(u&&u.length>4){const n=u[0]+"."+u[1]+"."+u[2];a.data=Qe(e,t,a.valueOffset+6-o,o,Ae.geoKeys,2).ifd,a.data&&a.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}if(s.has("XMP")){a=s.get("XMP");const u=a.values;typeof u[0]=="number"&&a.type===7&&(a.values=[Jr(new Uint8Array(u))])}}return f}function or(e){const{width:t,height:r,tileHeight:o,tileWidth:i}=e,l=e.planes,f=i?i*o:t*r,a=W(e.ifds[0],"BITSPERSAMPLE");let s="";return f*l>2**30/(a>8?a/8:1)&&(s=i?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),s}function uo(e,t,r,o,i){const l=o?4:1,f=r*l*i;o&&(e=new Uint8Array(e.buffer));for(let u=0;ux.min):null,C=g?g.map(x=>x.max):null,b={pixelType:u,width:h,height:m,pixels:v,noDataValue:d};return d!=null?ft(b,d):T&&C&&t.applyMinMaxConstraint&&(b.mask=ro(v,T,C)),b}async function ho(e,t={}){const r=t.pyramidLevel||0,o=t.headerInfo||io(e),{ifds:i,noData:l}=o;if(i.length===0)throw new Error("no valid image file directory");const f=or(o);if(f)throw f;let a=null;const s=r===-1?i[i.length-1]:i[r],u=l??t.noDataValue;return a=o.tileWidth?await eo(e,o,s):to(e,o,s),a&&(u!=null&&ft(a,u),a)}var fo=function(e){var t,r,o,i,l,f;function a(s){var u,n,c,h,m,p,y,S,v,k,w,d,g;for(this.data=s,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},m=null;;){switch(u=this.readUInt32(),S=function(){var T,C;for(C=[],T=0;T<4;++T)C.push(String.fromCharCode(this.data[this.pos++]));return C}.call(this).join(""),S){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(u);break;case"fcTL":m&&this.animation.frames.push(m),this.pos+=4,m={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},h=this.readUInt16(),c=this.readUInt16()||100,m.delay=1e3*h/c,m.disposeOp=this.data[this.pos++],m.blendOp=this.data[this.pos++],m.data=[];break;case"IDAT":case"fdAT":for(S==="fdAT"&&(this.pos+=4,u-=4),s=m?.data||this.imgData,w=0;0<=u?wu;0<=u?++w:--w)s.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(u),(v=255-this.transparency.indexed.length)>0)for(d=0;0<=v?dv;0<=v?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(u)[0];break;case 2:this.transparency.rgb=this.read(u)}break;case"tEXt":p=(k=this.read(u)).indexOf(0),y=String.fromCharCode.apply(String,k.slice(0,p)),this.text[y]=String.fromCharCode.apply(String,k.slice(p+1));break;case"IEND":return m&&this.animation.frames.push(m),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(g=this.colorType)===4||g===6,n=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*n,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+=u}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return a.load=function(s,u,n){var c;return typeof u=="function"&&(n=u),(c=new XMLHttpRequest).open("GET",s,!0),c.responseType="arraybuffer",c.onload=function(){var h;return h=new a(new Uint8Array(c.response||c.mozResponseArrayBuffer)),typeof u?.getContext=="function"&&h.render(u),typeof n=="function"?n(h):void 0},c.send(null)},r=1,o=2,t=0,a.prototype.read=function(s){var u,n;for(n=[],u=0;0<=s?us;0<=s?++u:--u)n.push(this.data[this.pos++]);return n},a.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.decodePixels=function(s){var u,n,c,h,m,p,y,S,v,k,w,d,g,T,C,b,x,I,A,E,P,R,G;if(s==null&&(s=this.imgData),s.length===0)return new Uint8Array(0);for(s=(s=new Ue(s)).getBytes(),b=(d=this.pixelBitlength/8)*this.width,g=new Uint8Array(b*this.height),p=s.length,C=0,T=0,n=0;T1&&n/hnew dt(m,p)),bandMasks:u,depthCount:a,noDataValues:s});return f?.length||h.updateStatistics(),h}async function go(e,t){const r=await ho(e,{...t,noDataValue:null});ze(r);const o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,bandMasks:r.bandMasks,statistics:null});return o.updateStatistics(),o}async function yo(e,t){const r=await co(e,t.customOptions),o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,statistics:null});return o.updateStatistics(),o}function nr(e,t){const r=t.pixelType||"u8",o=re.getPixelArrayConstructor(r),i=r==="u8"?e:new o(e.buffer),l=[],f=t.planes||1;if(f===1)l.push(i);else for(let s=0;svo(r,o,e);break;case"tiff":t=go;break;case"deflate":t=Co;break;case"lzw":t=bo;break;case"error":t=()=>{throw new ge("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new ge("rasterCodec:decode","unsupported raster format")}}return t}function xo(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 ko(e,t=1){if(!e)return;const{pixels:r,width:o,height:i,mask:l}=e;if(!r||r.length===0)return;const f=r.length,a=o-1,s=i-1,u=[];let n,c,h,m,p,y,S=null;const v=re.getPixelArrayConstructor(e.pixelType);if(t===0){for(n=0;n1){const a=f.map((n,c)=>i(e.slice(n,f[c+1]),t)),s=await Promise.all(a);l=s[0],l.pixels=s.map(n=>n.pixels[0]);const u=s.map(n=>n.mask);s.some(n=>n!=null)&&(u.forEach((n,c)=>{n==null&&(u[c]=new Uint8Array(l.width*l.height).fill(255))}),l.bandMasks=u,l.mask=re.combineBandMasks(u)),l.updateStatistics()}else l=await i(e,{...t,offset:f?.[0]??t.offset});return o!=="jpg"&&t.noDataValue!=null&&l.depthCount===1&&ft(l,t.noDataValue,{customFloatTolerance:t.tolerance}),t.isPoint&&ko(l),l}function Ao(e){return["u8","s8"].includes(e.pixelType)&&e.statistics?.[0]?.min!=null&&e.statistics[0]?.max!=null&&e.bandCount===1}function Eo(e,t){const{attributeTable:r,bandCount:o}=e;return r==null&&Ao(e)?!0:!(r==null||o>1||t&&r.fields.find(i=>i.name.toLowerCase()===t.toLowerCase())==null)}function Po(e){const{bandCount:t,dataType:r,pixelType:o}=e;return r==="elevation"||r==="generic"&&t===1&&(o==="s16"||o==="s32"||o==="f32"||o==="f64")}function Ro(e,t=!1){const{bandCount:r,colormap:o,pixelType:i}=e;return r===1&&(!!o?.length||!t&&i==="u8")}function en(e,t=!1){const{attributeTable:r,bandCount:o}=e;return o===1&&(!t||r!=null||e.histograms!=null)}function tn(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function rn(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function et(e){return!!e?.length&&e.length<=16384}const tt=1;function ar(e,t=256){t=Math.min(t,256);const{size:r,counts:o}=e,i=new Uint8Array(r),l=o.reduce((n,c)=>n+c/t,0);let f=0,a=0,s=0,u=l;for(let n=0;n=s){const g=sr(s,o);for(u=0;u1&&(w-=(1/y)**(S*g[u])),kt[u]){const T=w*y*S**(1/o[u])+f;d[n]=l==="floor"?Math.floor(T):l==="round"?Math.round(T):T}else k>=r[u]?d[n]=a:d[n]=f;else d[n]=f;v[u]=d}}else for(u=0;u=r[u])d[n]=a;else{const g=(k-t[u])*m[u]+f;d[n]=l==="floor"?Math.floor(g):l==="round"?Math.round(g):g}v[u]=d}if(e.contrastOffset!=null){const g=Oo(e.contrastOffset,e.brightnessOffset);for(u=0;u0&&r<100?a=(200*f-100*i+2*i*o)/(2*(100-r))+l:r<=0&&r>-100?a=(200*f-100*i+2*i*o)*(100+r)/2e4+l:r===100?(a=200*f-100*i+(i+1)*(100-r)+2*i*o,a=a>0?i:0):r===-100&&(a=l),s[f]=a>i?i:a<0?0:a;return s}function Do(e,t,r){const o=[];for(let i=0;i=255)return tt;let t=0;e!==150&&(t=e<=150?45*Math.cos(.01047*e):17*Math.sin(.021*e));const r=255,o=e+t,i=Math.log(e/r),l=Math.log(o/r);if(l===0)return tt;const f=i/l;return isNaN(f)?tt:Math.min(9.9,Math.max(.01,f))}function Mo(e,t,r,o){let i=1/0,l=-1/0,f=0,a=0,s=0,u=0;const n=e.length,c=new Map,h=[];for(let C=0;Cu&&(u=x,s=b),i=bl?b:l,f+=b,a++}}if(a===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const m=f/a;let p=0;for(let C=0;CC).length:n,S=y<=1?0:Math.sqrt(p/(y-1));h.sort((C,b)=>C-b);const v=a>>>1,k={min:i,max:l,avg:m,stddev:S,mode:s,median:a%2?h[Math.floor(v)]:(h[v-1]+h[v])/2};if(["u8","s8","u4","u2","u1"].includes(r)){const C=l-i+1,b=new Uint32Array(C);for(let x=0;xMo(f,i?.[a]??r,o));return{statistics:l.map(({statistics:f})=>f),histograms:l.map(({histogram:f})=>f)}}function Go(e){if(!e?.pixels?.length)return null;const{pixels:t,mask:r,bandMasks:o,pixelType:i}=e,l=e.width*e.height,f=t.length,a=[],s=[],u=256;let n,c,h,m;for(let p=0;pc?E:c,h[E]++}}else for(let A=0;Ac?E:c,h[E]++}h=h.slice(n,c+1)}else{let A=!1;e.statistics||(e.updateStatistics(),A=!0);const E=e.statistics;n=E[p].minValue,c=E[p].maxValue;const P=(c-n)/u;if(P===0){!E||e.validPixelCount||A||e.updateStatistics();const R=(e.validPixelCount||e.width*e.height)/u;for(let G=0;G[I.minValue,I.maxValue,0,0]);else{const I=Go(r);f=I!=null?I.statistics:null,a=I!=null?I.histograms:null}else f=e.statistics?.length?e.statistics:l.statistics,a="histograms"in e?e.histograms:void 0,a||(a=l.histograms);s!=="percentClip"&&s!=="histogramEqualization"||a?.length||(s="minMax");const u=f?.length||a?.length||l.bandCount,n=[],c=[];let h,m,p,y,S,v,k,w,d;f&&!Array.isArray(f[0])&&(f=f.map(I=>[I.min,I.max,I.avg,I.stddev]));const[g,T]=br(l.pixelType);if(!f?.length){for(f=[],w=0;wA[1]&&(c[w]=A[1])}}break;case"histogramEqualization":for(ze(a),w=0;w=20&&(y[0]=y[1]=y[2]=y[y.length-1]=y[y.length-2]=0),p=0,m=(h.max-h.min)/h.size,k=h.min===-.5&&m===1?.5:0,d=0;dv){n[w]=h.min+m*(d+k);break}for(v=(1-(e.maxPercent||0)/100)*p,c[w]=h.max+k,d=h.size-2;d>=0;d--)if(S[d]ar(I)))):(b=e.max||255,C=e.min||0),Uo({minCutOff:n,maxCutOff:c,outMax:b,outMin:C,histogramLut:x},o)}function Uo(e,t){if(t==null||t.length===0)return e;const r=Math.max.apply(null,t),{minCutOff:o,maxCutOff:i,outMin:l,outMax:f,histogramLut:a}=e;return o.length===t.length||o.length<=r?e:{minCutOff:t.map(s=>o[s]),maxCutOff:t.map(s=>i[s]),histogramLut:a?t.map(s=>a[s]):null,outMin:l,outMax:f}}function sr(e,t){const r=new Float32Array(e);for(let o=0;o1?t[o]>2?r[o]=6.5+(t[o]-2)**2.5:r[o]=6.5+100*(2-t[o])**4:r[o]=1;return r}function rt(e,t){if(!e?.pixels?.length)return e;const{mask:r,bandMasks:o,width:i,height:l,pixels:f}=e,{minCutOff:a,maxCutOff:s,gamma:u}=t,n=t.outMin||0,c=t.outMax||255,h=i*l,m=t.outputPixelType||"u8",p=e.pixels.map(()=>re.createEmptyBand(m,h)),y=p.length,S=c-n,v=[],k=[];for(let C=0;C=y,g=!!t.isRenderer;if(d){const C=sr(y,u);for(let b=0;b1&&(P-=(1/S)**(E*C[b])),Aa[b]){const R=P*S*E**(1/u[b])+n;p[b][I]=g?Math.floor(R):w?Math.round(R):R}else A>=s[b]?p[b][I]=c:p[b][I]=n}}}else for(let C=0;Ca[C]){const A=(I-a[C])*v[C]+n;p[C][x]=g?Math.floor(A):w?Math.round(A):A}else I>=s[C]?p[C][x]=c:p[C][x]=n}}const T=new re({width:i,height:l,mask:r,bandMasks:o,pixels:p,pixelType:m});return T.updateStatistics(),T}const ne=1,ke=1/111e3;function lr(e){let{altitude:t,azimuth:r}=e;const{hillshadeType:o,pixelSizePower:i=1,pixelSizeFactor:l=1,scalingType:f,isGCS:a,resolution:s}=e,u=o==="multi-directional"?2*e.zFactor:e.zFactor,{x:n,y:c}=s;let h=u/(8*n),m=u/(8*c);if(a&&u>.001&&(h/=ke,m/=ke),f==="adjusted")if(a){const E=n*ke,P=c*ke;h=(u+E**i*l)/(8*E),m=(u+P**i*l)/(8*P)}else h=(u+n**i*l)/(8*n),m=(u+c**i*l)/(8*c);let p=(90-t)*Math.PI/180,y=Math.cos(p),S=(360-r+90)*Math.PI/180,v=Math.sin(p)*Math.cos(S),k=Math.sin(p)*Math.sin(S);const w=[315,270,225,360,180,0],d=[60,60,60,60,60,90],g=new Float32Array([3,5,3,2,1,4]),T=g.reduce((E,P)=>E+P),C=g.map(E=>E/T),b=o==="multi-directional"?w.length:1,x=new Float32Array(6),I=new Float32Array(6),A=new Float32Array(6);if(o==="multi-directional")for(let E=0;Ep?p:S],w=f[y],d=w*k,g=d*(1-Math.abs(v%2-1)),T=w-d;switch(Math.floor(v)){case 0:c[y]=d+T,h[y]=g+T,m[y]=T;break;case 1:c[y]=g+T,h[y]=d+T,m[y]=T;break;case 2:c[y]=T,h[y]=d+T,m[y]=g+T;break;case 3:c[y]=T,h[y]=g+T,m[y]=d+T;break;case 4:c[y]=g+T,h[y]=T,m[y]=d+T;break;case 5:case 6:c[y]=d+T,h[y]=T,m[y]=g+T}}e.pixels=[c,h,m],e.updateStatistics()}function an(e,t){if(!Se(e))return e;const r=t.zFactor,o=t.pixelSizePower??1,i=t.pixelSizeFactor??1,l=t.slopeType,f=t.isGCS,{x:a,y:s}=t.resolution;let u=r/(8*a),n=r/(8*s);f&&Math.abs(r-1)<1e-4&&(u/=ke,n/=ke),l==="adjusted"&&(u=(r+a**o*i)/(8*a),n=(r+s**o*i)/(8*s));const{dzxs:c,dzys:h,outMask:m}=Ke(e),{width:p,height:y}=e,S=new Float32Array(p*y);for(let k=ne;k360&&(v%=360)),n[h+m]=v}}}return Ye(n,s,u),new re({width:s,height:u,pixels:[n],mask:a,pixelType:"f32",validPixelCount:e.validPixelCount,statistics:[new dt(-1,360)]})}function ln(e,t){if(!Se(e))return e;const{curvatures:r,outMask:o}=Ke(e,t),{width:i,height:l}=e;Ye(r,i,l);const f=new re({width:i,height:l,pixels:[r],mask:o,pixelType:"f32",validPixelCount:e.validPixelCount});return f.updateStatistics(),f}function un(e,t,r){const{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizeFactor:a,pixelSizePower:s,slopeType:u}=e;return{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizePower:s,pixelSizeFactor:a,scalingType:u==="scaled"?"adjusted":"none",resolution:t,isGCS:r}}let Te=class extends Ge{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?.pixelBlock;if(!jt(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=t.extractBands(e.bandIds??[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 o=e.extent,i=o.spatialReference.isGeographic,l={x:(o.xmax-o.xmin)/t.width,y:(o.ymax-o.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:i,resolution:l});break}}return r}catch(r){return wt.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!jt(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),rt(e,{...t,isRenderer:!0})}catch(r){return wt.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:f,offset:a}=this.lookup.colormapLut||{};return{colormap:f,colormapOffset:a,isClassBreaks:this.rendererJSON.type==="classBreaks",type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:o,bandIds:i}=e,{rendererJSON:l}=this;return l.type==="rasterStretch"?this._generateStretchWebGLParams(t,l,i):l.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(l,r,o??void 0):l.type==="vectorField"?this._generateVectorFieldWebGLParams(l):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:Ze(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?Ze(e,this.lookup.colormapLut):vr(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:o,bandCount:i}=r,l=this.rendererJSON,f=["u8","u16","s8","s16"].includes(o);let a,s;const{dra:u}=l,{gamma:n}=this.lookup;if(l.stretchType==="histogramEqualization"){const c=u?null:this.lookup?.histogramLut,h=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!c}),m=rt(e,{...h,gamma:n,isRenderer:!0});s=It(m,{lut:u?h.histogramLut:c,offset:0})}else if(f){if(u){const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});a=zt({pixelType:o,...c,gamma:n,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;a=this.lookup?this.lookup.stretchLut:null}else a=this.lookup?this.lookup.stretchLut:null;if(!a)return e;i>1&&t!=null&&t.length===e?.pixels.length&&a?.lut.length===i&&(a={lut:t.map(c=>a.lut[c]),offset:a.offset}),s=It(e,a)}else{const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});s=rt(e,{...c,gamma:n,isRenderer:!0})}if(l.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;s=Ze(s,this.lookup?.colormapLut)}return s}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,o={...r,...t},i=No(e,o);if(!r.colorRamp)return i;let l;if(this._isLUTChanged(!0)){if(!this.bind().success)return i;l=this.lookup?this.lookup.hsvMap:null}else l=this.lookup?this.lookup.hsvMap:null;if(!l)return i;const f=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return Bo(i,e,l,f),i}_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){const{bandCount:t,attributeTable:r,pixelType:o}=this.rasterInfo,i=e.field1;if(!i)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const l=e.defaultSymbol,f=t===1&&["u8","s8"].includes(o);if(!Eo(this.rasterInfo,i)&&!f)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const a=[];if(r!=null){const u=r.fields.find(n=>n.name.toLowerCase()==="value");if(!u)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(n=>{const c=e.uniqueValueInfos?.find(m=>String(m.value)===String(n.attributes[i])),h=c?.symbol?.color;h?a.push([n.attributes[u.name]].concat(h)):l&&a.push([n.attributes[u.name]].concat(l.color))})}else{if(i.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not available.'};e.uniqueValueInfos?.forEach(u=>{const n=u?.symbol?.color;n?a.push([parseInt(""+u.value,10)].concat(n)):l&&a.push([parseInt(""+u.value,10)].concat(l?.color))})}if(a.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const s=Oe({colormap:a});return this.lookup={rendererJSON:e,colormapLut:s},this.canRenderInWebGL=et(s?.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!Ro(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(o=>[o.value].concat(o.color)).sort((o,i)=>o[0]-i[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Oe({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=et(r?.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!Po(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=Et(e.colorRamp,{interpolateAlpha:!0}),r=Oe({colormap:t}),o=Or(r.indexedColormap);this.lookup={rendererJSON:e,colormapLut:r,hsvMap:o}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,o=t!=null?t.fields.find(f=>f.name.toLowerCase()==="value"):null,i=t!=null?t.fields.find(f=>f.name.toLowerCase()===e.field.toLowerCase()):null,l=o!=null&&i!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||l,tableValueField:o,tableBreakField:i}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:o,tableBreakField:i}=this._analyzeClassBreaks(e),l=e.classBreakInfos;if(!l?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const f=l.sort((c,h)=>c.classMaxValue-h.classMaxValue),a=f[f.length-1];let s=e.minValue;if(!r){const c=[];for(let h=0;hw>v);k&&u.push([S].concat(k.symbol.color))}}else{s=Math.floor(e.minValue);for(let c=0;car(c));this.lookup={rendererJSON:e,histogramLut:n}}else if(u){const n=Le(e,{rasterInfo:this.rasterInfo}),c=zt({pixelType:s,...n,gamma:l?a:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:c}}if(f&&!zo(f)){const n=Et(f,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Oe({colormap:n}),this.lookup.rendererJSON=e}return this.lookup.gamma=l&&a?.length?a:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let o=null,i=null;const l=this.lookup?.colormapLut;t.colorRamp&&l&&(o=l.indexedColormap,i=l.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:f}=this.lookup,a=!(!t.useGamma||!f?.some(w=>w!==1)),{minCutOff:s,maxCutOff:u,outMin:n,outMax:c}=Le(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let h=0;e!=null&&(h=e.getPlaneCount(),h===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:m}=this.rasterInfo,p=Math.min(3,r?.length||h||m,m),y=new Float32Array(p),S=o||a?1:255;let v;for(v=0;v1?f[v]>2?k[v]=6.5+(f[v]-2)**2.5:k[v]=6.5+100*(2-f[v])**4:k[v]=1;return{bandCount:p,outMin:n/S,outMax:c/S,minCutOff:s,maxCutOff:u,factor:y,useGamma:a,gamma:a?f:[1,1,1],gammaCorrection:a?k:[1,1,1],colormap:o,colormapOffset:i,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let o=null,i=null;const l=this.lookup?.colormapLut;e.colorRamp&&l&&(o=l.indexedColormap,i=l.offset);const f={...e,isGCS:t,resolution:r},a=lr(f),s=this.rasterInfo.statistics?.[0];return{...a,minValue:s?.min??0,maxValue:s?.max??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:o,colormapOffset:i}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:o,visualVariables:i,symbolTileSize:l,flowRepresentation:f}=e;let a;const s=this.rasterInfo.statistics?.[0].min??0,u=this.rasterInfo.statistics?.[0].max??50,n=i?.find(v=>v.type==="sizeInfo")??{type:"sizeInfo",field:"Magnitude",maxDataValue:u,maxSize:.8*l,minDataValue:s,minSize:.2*l},c=n.minDataValue??s,h=n.maxDataValue??u,m=n.maxSize!=null&&n.minSize!=null?[n.minSize/l,n.maxSize/l]:[.2,.8];if(t==="wind_speed"){const v=(m[0]+m[1])/2;m[0]=m[1]=v}const p=c!=null&&h!=null?[c,h]:null;if(t==="classified_arrow")if(c!=null&&h!=null&&n!=null){a=[];const v=(n.maxDataValue-n.minDataValue)/5;for(let k=0;k<6;k++)a.push(n.minDataValue+v*k)}else a=[0,1e-6,3.5,7,10.5,14];const y=f==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,S=i?.find(v=>v.type==="rotationInfo");return{breakValues:a,dataRange:p,inputUnit:r,outputUnit:o,symbolTileSize:l,symbolPercentRange:m,style:t||"single_arrow",rotation:y,rotationType:this.rasterInfo.storageInfo?.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":S?.rotationType||e.rotationType,type:"vectorField"}}};D([N({json:{write:!0}})],Te.prototype,"rendererJSON",void 0),D([N({type:Gr,json:{write:!0}})],Te.prototype,"rasterInfo",void 0),D([N({json:{write:!0}})],Te.prototype,"lookup",void 0),D([N()],Te.prototype,"canRenderInWebGL",void 0),Te=D([Me("esri.renderers.support.RasterSymbolizer")],Te);const cn=Te;function Fo(e){return e==="percentClip"||e==="histogramEqualization"}function Vo(e){return e!=null&&e.length>0&&e[0].min!=null&&e[0].max!=null}function jt(e){return Se(e)&&e.validPixelCount!==0}function zo(e){return e.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}export{un as $,tr as A,xr as B,Po as C,rr as D,Ae as E,lo as F,Tr as G,no as H,Bo as I,Ct as J,qo as K,Jr as L,Je as N,Le as P,ln as Q,Go as S,lr as T,Qo as V,Gr as W,sn as X,Zo as Y,an as Z,tn as _,$o as a,Xo as b,Mr as c,on as d,Ko as e,Yo as f,et as g,Oo as h,Et as i,rn as j,ke as k,Or as l,zt as m,Ht as n,rt as o,sr as p,Dr as q,Rr as r,nn as s,cn as t,gt as u,so as v,Ro as w,No as x,Eo as y,en as z}; +import{_ as cr}from"./main-QGPoLsvl.js";import{aK as _t,v as D,S as N,i as Me,a0 as hr,ac as fr,w as dr,n as vt,J as pr,e as Ge,P as oe,o as ge,O as ze,a1 as wt,co as mr,x as gr,aS as yr,ar as Tt,bw as Cr}from"./story-Doly9N9p.js";import{D as re,b as ft,n as br,L as Se,c as dt,r as Ze,h as vr,d as It,e as Oe}from"./dataUtils-BkPy4R3C-Dzc1QGGb.js";import{t as Wt}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import{S as _e,T as St,U as xt,l as wr}from"./colorUtils-Cthpxcks-cHaMZbaf.js";const Ko=["random","ndvi","ndvi2","ndvi3","elevation","gray","hillshade"],Ht=[{id:"aspect",type:"multipart",colorRamps:[{fromColor:[190,190,190],toColor:[255,45,8]},{fromColor:[255,45,8],toColor:[255,181,61]},{fromColor:[255,181,61],toColor:[255,254,52]},{fromColor:[255,254,52],toColor:[0,251,50]},{fromColor:[0,251,50],toColor:[255,254,52]},{fromColor:[0,253,255],toColor:[0,181,255]},{fromColor:[0,181,255],toColor:[26,35,253]},{fromColor:[26,35,253],toColor:[255,57,251]},{fromColor:[255,57,251],toColor:[255,45,8]}]},{id:"black-to-white",fromColor:[0,0,0],toColor:[255,255,255]},{id:"blue-bright",fromColor:[204,204,255],toColor:[0,0,224]},{id:"blue-light-to-dark",fromColor:[211,229,232],toColor:[46,100,140]},{id:"blue-green-bright",fromColor:[203,245,234],toColor:[48,207,146]},{id:"blue-green-light-to-dark",fromColor:[216,242,237],toColor:[21,79,74]},{id:"brown-light-to-dark",fromColor:[240,236,170],toColor:[102,72,48]},{id:"brown-to-blue-green-diverging-right",type:"multipart",colorRamps:[{fromColor:[156,85,31],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[33,130,145]}]},{id:"brown-to-blue-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[110,70,45],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[48,100,102]}]},{id:"coefficient-bias",fromColor:[214,214,255],toColor:[0,57,148]},{id:"cold-to-hot-diverging",type:"multipart",colorRamps:[{fromColor:[69,117,181],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[214,47,39]}]},{id:"condition-number",type:"multipart",colorRamps:[{fromColor:[0,97,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,34,0]}]},{id:"cyan-to-purple",type:"multipart",colorRamps:[{fromColor:[0,245,245],toColor:[0,0,245]},{fromColor:[0,0,245],toColor:[245,0,245]}]},{id:"cyan-light-to-blue-dark",type:"multipart",colorRamps:[{fromColor:[182,237,240],toColor:[31,131,224]},{fromColor:[31,131,224],toColor:[9,9,145]}]},{id:"distance",fromColor:[255,200,0],toColor:[0,0,255]},{id:"elevation1",type:"multipart",colorRamps:[{fromColor:[175,240,233],toColor:[255,255,179]},{fromColor:[255,255,179],toColor:[0,128,64]},{fromColor:[0,128,64],toColor:[252,186,3]},{fromColor:[252,186,3],toColor:[128,0,0]},{fromColor:[120,0,0],toColor:[105,48,13]},{fromColor:[105,48,13],toColor:[171,171,171]},{fromColor:[171,171,171],toColor:[255,252,255]}]},{id:"elevation2",type:"multipart",colorRamps:[{fromColor:[118,219,211],toColor:[255,255,199]},{fromColor:[255,255,199],toColor:[255,255,128]},{fromColor:[255,255,128],toColor:[217,194,121]},{fromColor:[217,194,121],toColor:[135,96,38]},{fromColor:[135,96,38],toColor:[150,150,181]},{fromColor:[150,150,181],toColor:[181,150,181]},{fromColor:[181,150,181],toColor:[255,252,255]}]},{id:"errors",fromColor:[255,235,214],toColor:[196,10,10]},{id:"gray-light-to-dark",fromColor:[219,219,219],toColor:[69,69,69]},{id:"green-bright",fromColor:[204,255,204],toColor:[14,204,14]},{id:"green-light-to-dark",fromColor:[220,245,233],toColor:[34,102,51]},{id:"green-to-blue",type:"multipart",colorRamps:[{fromColor:[32,204,16],toColor:[0,242,242]},{fromColor:[0,242,242],toColor:[2,33,227]}]},{id:"orange-bright",fromColor:[255,235,204],toColor:[240,118,5]},{id:"orange-light-to-dark",fromColor:[250,233,212],toColor:[171,65,36]},{id:"partial-spectrum",type:"multipart",colorRamps:[{fromColor:[242,241,162],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]},{fromColor:[252,3,69],toColor:[176,7,237]},{fromColor:[176,7,237],toColor:[2,29,173]}]},{id:"partial-spectrum-1-diverging",type:"multipart",colorRamps:[{fromColor:[135,38,38],toColor:[240,149,12]},{fromColor:[240,149,12],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[74,80,181]},{fromColor:[74,80,181],toColor:[39,32,122]}]},{id:"partial-spectrum-2-diverging",type:"multipart",colorRamps:[{fromColor:[115,77,42],toColor:[201,137,52]},{fromColor:[201,137,52],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[91,63,176]},{fromColor:[91,63,176],toColor:[81,13,97]}]},{id:"pink-to-yellow-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[158,30,113],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[99,110,45]}]},{id:"pink-to-yellow-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,47,73],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[22,59,15]}]},{id:"precipitation",type:"multipart",colorRamps:[{fromColor:[194,82,60],toColor:[237,161,19]},{fromColor:[237,161,19],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,219,0]},{fromColor:[0,219,0],toColor:[32,153,143]},{fromColor:[32,153,143],toColor:[11,44,122]}]},{id:"prediction",type:"multipart",colorRamps:[{fromColor:[40,146,199],toColor:[250,250,100]},{fromColor:[250,250,100],toColor:[232,16,20]}]},{id:"purple-bright",fromColor:[255,204,255],toColor:[199,0,199]},{id:"purple-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[77,32,150],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[20,122,11]}]},{id:"purple-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[67,14,89],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[24,79,15]}]},{id:"purple-blue-bright",fromColor:[223,184,230],toColor:[112,12,242]},{id:"purple-blue-light-to-dark",fromColor:[229,213,242],toColor:[93,44,112]},{id:"purple-red-bright",fromColor:[255,204,225],toColor:[199,0,99]},{id:"purple-red-light-to-dark",fromColor:[250,215,246],toColor:[143,17,57]},{id:"red-bright",fromColor:[255,204,204],toColor:[219,0,0]},{id:"red-light-to-dark",fromColor:[255,224,224],toColor:[143,10,10]},{id:"red-to-blue-diverging-bright",type:"multipart",colorRamps:[{fromColor:[196,69,57],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[48,95,207]}]},{id:"red-to-blue-diverging-dark",type:"multipart",colorRamps:[{fromColor:[107,13,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[13,53,97]}]},{id:"red-to-green",type:"multipart",colorRamps:[{fromColor:[245,0,0],toColor:[245,245,0]},{fromColor:[245,245,0],toColor:[0,245,0]}]},{id:"red-to-green-diverging-bright",type:"multipart",colorRamps:[{fromColor:[186,20,20],toColor:[255,255,191]},{fromColor:[255,255,191],toColor:[54,145,33]}]},{id:"red-to-green-diverging-dark",type:"multipart",colorRamps:[{fromColor:[97,21,13],toColor:[204,204,102]},{fromColor:[204,204,102],toColor:[16,69,16]}]},{id:"slope",type:"multipart",colorRamps:[{fromColor:[56,168,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]},{id:"spectrum-full-bright",type:"multipart",colorRamps:[{fromColor:[255,0,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,0,255]}]},{id:"spectrum-full-dark",type:"multipart",colorRamps:[{fromColor:[153,0,0],toColor:[153,153,0]},{fromColor:[153,153,0],toColor:[0,153,153]},{fromColor:[0,153,153],toColor:[0,0,153]}]},{id:"spectrum-full-light",type:"multipart",colorRamps:[{fromColor:[255,153,153],toColor:[255,255,153]},{fromColor:[255,255,153],toColor:[153,255,255]},{fromColor:[153,255,255],toColor:[153,153,255]}]},{id:"surface",type:"multipart",colorRamps:[{fromColor:[112,153,89],toColor:[242,238,162]},{fromColor:[242,238,162],toColor:[242,206,133]},{fromColor:[242,206,133],toColor:[194,140,124]},{fromColor:[194,140,124],toColor:[255,242,255]}]},{id:"temperature",type:"multipart",colorRamps:[{fromColor:[255,252,255],toColor:[255,0,255]},{fromColor:[255,0,255],toColor:[0,0,255]},{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[0,255,0]},{fromColor:[0,255,0],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,128,0]},{fromColor:[255,128,0],toColor:[128,0,0]}]},{id:"white-to-black",fromColor:[255,255,255],toColor:[0,0,0]},{id:"yellow-to-dark-red",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[242,167,46]},{fromColor:[242,167,46],toColor:[107,0,0]}]},{id:"yellow-to-green-to-dark-blue",type:"multipart",colorRamps:[{fromColor:[255,255,128],toColor:[56,224,9]},{fromColor:[56,224,9],toColor:[26,147,171]},{fromColor:[26,147,171],toColor:[12,16,120]}]},{id:"yellow-to-red",fromColor:[245,245,0],toColor:[255,0,0]},{id:"yellow-green-bright",fromColor:[236,252,204],toColor:[157,204,16]},{id:"yellow-green-light-to-dark",fromColor:[215,240,175],toColor:[96,107,45]}],Tr=new _t({Aspect:"aspect","Black to White":"black-to-white","Blue Bright":"blue-bright","Blue Light to Dark":"blue-light-to-dark","Blue-Green Bright":"blue-green-bright","Blue-Green Light to Dark":"blue-green-light-to-dark","Brown Light to Dark":"brown-light-to-dark","Brown to Blue Green Diverging, Bright":"brown-to-blue-green-diverging-right","Brown to Blue Green Diverging, Dark":"brown-to-blue-green-diverging-dark","Coefficient Bias":"coefficient-bias","Cold to Hot Diverging":"cold-to-hot-diverging","Condition Number":"condition-number","Cyan to Purple":"cyan-to-purple","Cyan-Light to Blue-Dark":"cyan-light-to-blue-dark",Distance:"distance","Elevation #1":"elevation1","Elevation #2":"elevation2",Errors:"errors","Gray Light to Dark":"gray-light-to-dark","Green Bright":"green-bright","Green Light to Dark":"green-light-to-dark","Green to Blue":"green-to-blue","Orange Bright":"orange-bright","Orange Light to Dark":"orange-light-to-dark","Partial Spectrum":"partial-spectrum","Partial Spectrum 1 Diverging":"partial-spectrum-1-diverging","Partial Spectrum 2 Diverging":"partial-spectrum-2-diverging","Pink to YellowGreen Diverging, Bright":"pink-to-yellow-green-diverging-bright","Pink to YellowGreen Diverging, Dark":"pink-to-yellow-green-diverging-dark",Precipitation:"precipitation",Prediction:"prediction","Purple Bright":"purple-bright","Purple to Green Diverging, Bright":"purple-to-green-diverging-bright","Purple to Green Diverging, Dark":"purple-to-green-diverging-dark","Purple-Blue Bright":"purple-blue-bright","Purple-Blue Light to Dark":"purple-blue-light-to-dark","Purple-Red Bright":"purple-red-bright","Purple-Red Light to Dark":"purple-red-light-to-dark","Red Bright":"red-bright","Red Light to Dark":"red-light-to-dark","Red to Blue Diverging, Bright":"red-to-blue-diverging-bright","Red to Blue Diverging, Dark":"red-to-blue-diverging-dark","Red to Green":"red-to-green","Red to Green Diverging, Bright":"red-to-green-diverging-bright","Red to Green Diverging, Dark":"red-to-green-diverging-dark",Slope:"slope","Spectrum-Full Bright":"spectrum-full-bright","Spectrum-Full Dark":"spectrum-full-dark","Spectrum-Full Light":"spectrum-full-light",Surface:"surface",Temperature:"temperature","White to Black":"white-to-black","Yellow to Dark Red":"yellow-to-dark-red","Yellow to Green to Dark Blue":"yellow-to-green-to-dark-blue","Yellow to Red":"yellow-to-red","Yellow-Green Bright":"yellow-green-bright","Yellow-Green Light to Dark":"yellow-green-light-to-dark"});function Ve(e,t){if(!e||!t||e.length!==t.length)return!1;for(let r=0;rt[r]+2||e[r]kt(r))),t}return kt(e)}function At(e,t){if(!e)return;const r=Ht;let o=null;return e.type==="algorithmic"?r.some(i=>{if(Ve(e.fromColor.toRgb(),i.fromColor)&&Ve(e.toColor.toRgb(),i.toColor))return o=i.id,!0}):e.type==="multipart"&&r.some(i=>{const l=e.colorRamps,f=i.colorRamps;if(l&&f&&l.length===f.length&&!f.some((a,s)=>{if(!Ve(l[s].fromColor.toRgb(),new Tt(a.fromColor).toRgb())||!Ve(l[s].toColor.toRgb(),new Tt(a.toColor).toRgb()))return!0})){if(o)return!0;o=i.id}}),o}function Sr(e,t,r=!1){if(!e)return;let o=!1,i=At(e);return i!=null||r||(o=!0,i=At(e=Ir(e))),i?{id:i,inverted:o}:void 0}function xr(e,t=!1){const r=typeof e=="string"?e:Sr(e,void 0,t)?.id;return r?Tr.toJSON(r):null}function Yo(e,t="esriCIELabAlgorithm"){const r=Ht.find(({id:o})=>o===e);return r?r.colorRamps?{type:"multipart",colorRamps:r.colorRamps.map(o=>({type:"algorithmic",algorithm:t,fromColor:[...o.fromColor],toColor:[...o.toColor]}))}:{type:"algorithmic",algorithm:t,fromColor:[...r.fromColor],toColor:[...r.toColor]}:null}function Jt(e){const t=(e=e||{}).numColors||256,r=e.distanceOffset||0,o=e.isCustomInterval!=null?e.isCustomInterval:e.distanceInterval!==null&&e.distanceInterval!==1/(t-1),i=e.distanceInterval||1/(t-1);return{...e,numColors:t,distanceOffset:r,interpolateAlpha:!!e.interpolateAlpha,distanceInterval:i,isCustomInterval:o,weights:e.weights}}function kr(e,t,r){const{numColors:o,distanceOffset:i,distanceInterval:l,isCustomInterval:f}=r,a=e.s===0,s=t.s===0;let u=e.h,n=t.h;a&&!s?u=n:s&&!a&&(t={...t,h:u},n=u);let c,h=Math.abs(n-u);const m=360;hn?h*l:-h*l);const p=(t.s-e.s)*l,y=(t.v-e.v)*l;let{s:S,v}=e,k=u;if(i){const d=i/l;k=(k+d*c+m)%m,S+=d*p,v+=d*y}const w=[];for(let d=0;dh+m);i=i.map(h=>h/c)}else{i=[];for(let c=0;c{i.unshift(l),o||i.pop()}),r}function Or(e){const t=[];for(let r=0;r{const o=r.toString(16);return o.length<2?"0"+o:o});return 4294967295&Number.parseInt(t.join(""),16)}const Zo=new _t({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),Dr={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"};var ot;function we(e){return e=Number(e),isNaN(e)?void 0:e}let he=ot=class extends Ge{constructor(){super(...arguments),this.name=null,this.minWavelength=void 0,this.maxWavelength=void 0,this.radianceBias=void 0,this.radianceGain=void 0,this.reflectanceBias=void 0,this.reflectanceGain=void 0,this.solarIrradiance=void 0}clone(){return new ot({name:this.name,minWavelength:this.minWavelength,maxWavelength:this.maxWavelength,radianceBias:this.radianceBias,radianceGain:this.radianceGain,reflectanceBias:this.reflectanceBias,reflectanceGain:this.reflectanceGain,solarIrradiance:this.solarIrradiance})}};D([N({json:{name:"BandName",write:!0}})],he.prototype,"name",void 0),D([N({json:{name:"WavelengthMin",read:{reader:we},write:!0}})],he.prototype,"minWavelength",void 0),D([N({json:{name:"WavelengthMax",read:{reader:we},write:!0}})],he.prototype,"maxWavelength",void 0),D([N({json:{name:"RadianceBias",read:{reader:we},write:!0}})],he.prototype,"radianceBias",void 0),D([N({json:{name:"RadianceGain",read:{reader:we},write:!0}})],he.prototype,"radianceGain",void 0),D([N({json:{name:"ReflectanceBias",read:{reader:we},write:!0}})],he.prototype,"reflectanceBias",void 0),D([N({json:{name:"ReflectanceGain",read:{reader:we},write:!0}})],he.prototype,"reflectanceGain",void 0),D([N({json:{name:"SolarIrradiance",read:{reader:we},write:!0}})],he.prototype,"solarIrradiance",void 0),he=ot=D([Me("esri.layers.support.RasterBandInfo")],he);const Ot=he;var nt;function De(e){return e=Number(e),isNaN(e)?void 0:e}let se=nt=class extends Ge{constructor(){super(...arguments),this.acquisitionDate=void 0,this.cloudCover=void 0,this.productName=void 0,this.sensorName=null,this.sensorAzimuth=void 0,this.sensorElevation=void 0,this.sunAzimuth=void 0,this.sunElevation=void 0}readAcquisitionDate(e){return new Date(e)}writeAcquisitionDate(e,t){t.AcquisitionDate=e.getTime()}clone(){return new nt({acquisitionDate:this.acquisitionDate,cloudCover:this.cloudCover,productName:this.productName,sensorName:this.sensorName,sensorAzimuth:this.sensorAzimuth,sensorElevation:this.sensorElevation,sunAzimuth:this.sunAzimuth,sunElevation:this.sunElevation})}};D([N({json:{name:"AcquisitionDate",write:!0}})],se.prototype,"acquisitionDate",void 0),D([hr("acquisitionDate")],se.prototype,"readAcquisitionDate",null),D([fr("acquisitionDate")],se.prototype,"writeAcquisitionDate",null),D([N({json:{name:"CloudCover",read:{reader:De},write:!0}})],se.prototype,"cloudCover",void 0),D([N({json:{name:"ProductName",write:!0}})],se.prototype,"productName",void 0),D([N({json:{name:"SensorName",write:!0}})],se.prototype,"sensorName",void 0),D([N({json:{name:"SensorAzimuth",read:{reader:De},write:!0}})],se.prototype,"sensorAzimuth",void 0),D([N({json:{name:"SensorElevation",read:{reader:De},write:!0}})],se.prototype,"sensorElevation",void 0),D([N({json:{name:"SunAzimuth",read:{reader:De},write:!0}})],se.prototype,"sunAzimuth",void 0),D([N({json:{name:"SunElevation",read:{reader:De},write:!0}})],se.prototype,"sunElevation",void 0),se=nt=D([Me("esri.layers.support.RasterSensorInfo")],se);const Lr=se;var it;let te=it=class extends Ge{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 it({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:oe(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:oe(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:oe(this.tileInfo),transposeInfo:oe(this.transposeInfo),blockBoundary:oe(this.blockBoundary)})}};D([N({type:Number,json:{write:!0}})],te.prototype,"blockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"blockHeight",void 0),D([N({type:String,json:{write:!0}})],te.prototype,"compression",void 0),D([N({type:dr,json:{write:!0}})],te.prototype,"origin",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"firstPyramidLevel",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"maximumPyramidLevel",void 0),D([N({json:{write:!0}})],te.prototype,"pyramidResolutions",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidScalingFactor",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockWidth",void 0),D([N({type:Number,json:{write:!0}})],te.prototype,"pyramidBlockHeight",void 0),D([N({type:Boolean,json:{write:!0}})],te.prototype,"isVirtualTileInfo",void 0),D([N({json:{write:!0}})],te.prototype,"tileInfo",void 0),D([N()],te.prototype,"transposeInfo",void 0),D([N()],te.prototype,"blockBoundary",void 0),te=it=D([Me("esri.layers.support.RasterStorageInfo")],te);const Mr=te;var at;let $=at=class extends Ge{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 bandInfos(){const e=this.keyProperties.BandProperties,{bandCount:t}=this;if(!e?.length||e.lengthOt.fromJSON(o));for(let o=0;oa&&(f=a)}else{for(;!this.eof;)this.readBlock();f=this.bufferLength}return this.pos=f,this.buffer.subarray(l,f)},lookChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var i=this.pos;this.bufferLength<=i;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(i,l,f){for(var a=i+l;this.bufferLength<=a&&!this.eof;)this.readBlock();return new Stream(this.buffer,i,l,f)},skip:function(i){i||(i=1),this.pos+=i},reset:function(){this.pos=0}},o}(),(r=function(){if(!self||!self.Uint32Array)return null;var o=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),i=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]),l=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]),f=[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 s(n){throw new Error(n)}function u(n){var c=0,h=n[c++],m=n[c++];h!=-1&&m!=-1||s("Invalid header in flate stream"),(15&h)!=8&&s("Unknown compression method in flate stream"),((h<<8)+m)%31!=0&&s("Bad FCHECK in flate stream"),32&m&&s("FDICT bit set in flate stream"),this.bytes=n,this.bytesPos=c,this.codeSize=0,this.codeBuf=0,e.call(this)}return u.prototype=Object.create(e.prototype),u.prototype.getBits=function(n){for(var c,h=this.codeSize,m=this.codeBuf,p=this.bytes,y=this.bytesPos;h>n,this.codeSize=h-=n,this.bytesPos=y,c},u.prototype.getCode=function(n){for(var c=n[0],h=n[1],m=this.codeSize,p=this.codeBuf,y=this.bytes,S=this.bytesPos;m>16,d=65535&k;return(m==0||m>w,this.codeSize=m-w,this.bytesPos=S,d},u.prototype.generateHuffmanTable=function(n){for(var c=n.length,h=0,m=0;mh&&(h=n[m]);for(var p=1<>=1;for(m=d;m0;)Y[k++]=H}var c=this.getBits(3);if(1&c&&(this.eof=!0),(c>>=1)!=0){var h,m;if(c==1)h=f,m=a;else if(c==2){for(var p=this.getBits(5)+257,y=this.getBits(5)+1,S=this.getBits(4)+4,v=Array(o.length),k=0;k=b&&(b=(O=this.ensureBuffer(x+1)).length),O[x++]=I;else{if(I==256)return void(this.bufferLength=x);var A=(I=i[I-=257])>>16;A>0&&(A=this.getBits(A)),d=(65535&I)+A,I=this.getCode(m),(A=(I=l[I])>>16)>0&&(A=this.getBits(A));var E=(65535&I)+A;x+d>=b&&(b=(O=this.ensureBuffer(x+d)).length);for(var P=0;P{let n=null;f==="jpg"&&a&&(n=Yt._getMask(t,{width:i,height:l}));const c=new Blob([new Uint8Array(t)],{type:"image/"+f=="jpg"?"jpeg":f}),h=URL.createObjectURL(c),m=new Image;let p;m.src=h,m.onload=()=>{if(URL.revokeObjectURL(h),gr(o))return void u(yr());i=m.width,l=m.height,this._canvas&&this._ctx?(this._canvas.width===i&&this._canvas.height===l||(this._canvas.width=i,this._canvas.height=l),this._ctx.clearRect(0,0,i,l)):(this._canvas=document.createElement("canvas"),this._canvas.width=i,this._canvas.height=l,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(m,0,0);const y=this._ctx.getImageData(0,0,i,l);let S;if(p=y.data,r.renderOnCanvas){if(n)for(S=0;S{URL.revokeObjectURL(h),u("cannot load image")}})}static _getMask(t,r){let o=null;try{const i=new Uint8Array(t),l=Math.ceil(i.length/2);let f=0;const a=i.length-2;for(f=l;f=0;c--)o[u++]=s[n]>>c&1}}catch{}return o}};var Mt,Gt={exports:{}};function Br(){return Mt||(Mt=1,e=Gt,t=function(){var o=function(){function i(l){this.message="JPEG error: "+l}return i.prototype=new Error,i.prototype.name="JpegError",i.constructor=i,i}();return function(){if(!self||!self.Uint8ClampedArray)return null;var i=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]),l=4017,f=799,a=3406,s=2276,u=1567,n=3784,c=5793,h=2896;function m(){this.decodeTransform=null,this.colorTransform=-1}function p(d,g){for(var T,C,b=0,x=[],I=16;I>0&&!d[I-1];)I--;x.push({children:[],index:0});var A,E=x[0];for(T=0;T0;)E=x.pop();for(E.index++,x.push(E);x.length<=T;)x.push(A={children:[],index:0}),E.children[E.index]=A.children,E=A;b++}T+10)return B--,U>>B&1;if((U=d[g++])===255){var M=d[g++];if(M)throw new o("unexpected marker "+(U<<8|M).toString(16))}return B=7,U>>>7}function J(M){for(var K=M;;){if(typeof(K=K[L()])=="number")return K;if(typeof K!="object")throw new o("invalid huffman sequence")}}function O(M){for(var K=0;M>0;)K=K<<1|L(),M--;return K}function z(M){if(M===1)return L()===1?1:-1;var K=O(M);return K>=1<>4;if(ee!==0){var ur=i[ie+=ae];M.blockData[K+ur]=z(ee),ie++}else{if(ae<15)break;ie+=16}}}function V(M,K){var q=J(M.huffmanTableDC),Q=q===0?0:z(q)<0)_--;else for(var q=x,Q=I;q<=Q;){var ie=J(M.huffmanTableAC),ce=15&ie,ee=ie>>4;if(ce!==0){var ae=i[q+=ee];M.blockData[K+ae]=z(ce)*(1<>4,(q=15&Q)==0)ee<15?(_=O(ee)+(1<=65488&&ve<=65495))break;g+=2}return(le=w(d,g))&&le.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+le.invalid),g=le.offset),g-G}function v(d,g,T){var C,b,x,I,A,E,P,R,G,U,B,L,J,O,z,F,V,Y=d.quantizationTable,_=d.blockData;if(!Y)throw new o("missing required Quantization Table.");for(var j=0;j<64;j+=8)G=_[g+j],U=_[g+j+1],B=_[g+j+2],L=_[g+j+3],J=_[g+j+4],O=_[g+j+5],z=_[g+j+6],F=_[g+j+7],G*=Y[j],U|B|L|J|O|z|F?(U*=Y[j+1],B*=Y[j+2],L*=Y[j+3],J*=Y[j+4],O*=Y[j+5],z*=Y[j+6],F*=Y[j+7],b=(C=(C=c*G+128>>8)+(b=c*J+128>>8)+1>>1)-b,V=(x=B)*n+(I=z)*u+128>>8,x=x*u-I*n+128>>8,P=(A=(A=h*(U-F)+128>>8)+(P=O<<4)+1>>1)-P,E=(R=(R=h*(U+F)+128>>8)+(E=L<<4)+1>>1)-E,I=(C=C+(I=V)+1>>1)-I,x=(b=b+x+1>>1)-x,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,P=V,T[j]=C+R,T[j+7]=C-R,T[j+1]=b+P,T[j+6]=b-P,T[j+2]=x+E,T[j+5]=x-E,T[j+3]=I+A,T[j+4]=I-A):(V=c*G+512>>10,T[j]=V,T[j+1]=V,T[j+2]=V,T[j+3]=V,T[j+4]=V,T[j+5]=V,T[j+6]=V,T[j+7]=V);for(var H=0;H<8;++H)G=T[H],(U=T[H+8])|(B=T[H+16])|(L=T[H+24])|(J=T[H+32])|(O=T[H+40])|(z=T[H+48])|(F=T[H+56])?(b=(C=4112+((C=c*G+2048>>12)+(b=c*J+2048>>12)+1>>1))-b,V=(x=B)*n+(I=z)*u+2048>>12,x=x*u-I*n+2048>>12,I=V,P=(A=(A=h*(U-F)+2048>>12)+(P=O)+1>>1)-P,E=(R=(R=h*(U+F)+2048>>12)+(E=L)+1>>1)-E,V=A*s+R*a+2048>>12,A=A*a-R*s+2048>>12,R=V,V=E*f+P*l+2048>>12,E=E*l-P*f+2048>>12,G=(G=(C=C+I+1>>1)+R)<16?0:G>=4080?255:G>>4,U=(U=(b=b+x+1>>1)+(P=V))<16?0:U>=4080?255:U>>4,B=(B=(x=b-x)+E)<16?0:B>=4080?255:B>>4,L=(L=(I=C-I)+A)<16?0:L>=4080?255:L>>4,J=(J=I-A)<16?0:J>=4080?255:J>>4,O=(O=x-E)<16?0:O>=4080?255:O>>4,z=(z=b-P)<16?0:z>=4080?255:z>>4,F=(F=C-R)<16?0:F>=4080?255:F>>4,_[g+H]=G,_[g+H+8]=U,_[g+H+16]=B,_[g+H+24]=L,_[g+H+32]=J,_[g+H+40]=O,_[g+H+48]=z,_[g+H+56]=F):(V=(V=c*G+8192>>14)<-2040?0:V>=2024?255:V+2056>>4,_[g+H]=V,_[g+H+8]=V,_[g+H+16]=V,_[g+H+24]=V,_[g+H+32]=V,_[g+H+40]=V,_[g+H+48]=V,_[g+H+56]=V)}function k(d,g){for(var T=g.blocksPerLine,C=g.blocksPerColumn,b=new Int16Array(64),x=0;x=b)return null;var I=C(g);if(I>=65472&&I<=65534)return{invalid:null,marker:I,offset:g};for(var A=C(x);!(A>=65472&&A<=65534);){if(++x>=b)return null;A=C(x)}return{invalid:I.toString(16),marker:A,offset:x}}return m.prototype={parse:function(d){function g(){var M=d[I]<<8|d[I+1];return I+=2,M}function T(){var M=g(),K=I+M-2,q=w(d,K,I);q&&q.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+q.invalid),K=q.offset);var Q=d.subarray(I,K);return I+=Q.length,Q}function C(M){for(var K=Math.ceil(M.samplesPerLine/8/M.maxH),q=Math.ceil(M.scanLines/8/M.maxV),Q=0;Q>4){if(F>>4!=1)throw new o("DQT - invalid table spec");for(L=0;L<64;L++)V[i[L]]=g()}else for(L=0;L<64;L++)V[i[L]]=d[I++];P[15&F]=V}break;case 65472:case 65473:case 65474:if(b)throw new o("Only single frame JPEGs supported");g(),(b={}).extended=U===65473,b.progressive=U===65474,b.precision=d[I++],b.scanLines=g(),b.samplesPerLine=g(),b.components=[],b.componentIds={};var Y,_=d[I++],j=0,H=0;for(B=0;B<_;B++){Y=d[I];var X=d[I+1]>>4,Pe=15&d[I+1];j>4?R:G)[15&pe]=p(ue,ye)}break;case 65501:g(),x=g();break;case 65498:g();var Z,Re=d[I++],Ce=[];for(B=0;B>4],Z.huffmanTableAC=R[15&be],Ce.push(Z)}var Ne=d[I++],Be=d[I++],de=d[I++],Fe=S(d,I,b,Ce,x,Ne,Be,de>>4,15&de);I+=Fe;break;case 65535:d[I]!==255&&I--;break;default:if(d[I-3]===255&&d[I-2]>=192&&d[I-2]<=254){I-=3;break}throw new o("unknown marker "+U.toString(16))}U=g()}for(this.width=b.samplesPerLine,this.height=b.scanLines,this.jfif=A,this.eof=I,this.adobe=E,this.components=[],B=0;B>8)+_[R+1];return F},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(d){for(var g,T,C,b=0,x=d.length;b4)throw new o("Unsupported color mode");var C=this._getLinearizedBlockData(d,g);if(this.numComponents===1&&T){for(var b=C.length,x=new Uint8ClampedArray(3*b),I=0,A=0;A=0;p--)c[S++]=y[h]>>p&1}catch{}if(f===1&&s.length===i*l){const y=new Uint8Array(s.buffer);n=[y,y,y]}else{for(n=[],h=0;h<3;h++)n.push(new Uint8Array(u));for(p=0,m=0;mimport("./lerc-wasm-p5Heunzu-CsUnIe3C.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.l).then(({default:e})=>e({locateFile:t=>Cr(`esri/layers/support/rasterFormats/${t}`)})).then(e=>{zr(e)}),Xe)}const We={getBlobInfo:null,decode:null};function Vr(e){return 16+(e>>3<<3)}function me(e,t,r){r.set(e.slice(t,t+r.length))}function zr(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:o,_lerc_getDataRanges:i,_lerc_decode_4D:l,asm:f}=e;let a;const s=Object.values(f).find(n=>n&&"buffer"in n&&n.buffer===e.HEAPU8.buffer),u=n=>{const c=n.map(y=>Vr(y)),h=c.reduce((y,S)=>y+S),m=t(h);a=new Uint8Array(s.buffer);let p=c[0];c[0]=m;for(let y=1;y{const c=new Uint8Array(48),h=new Uint8Array(8*3),[m,p,y]=u([n.length,c.length,h.length]);a.set(n,m),a.set(c,p),a.set(h,y);let S=o(m,n.length,p,y,12,3);if(S)throw r(m),new Error(`lerc-getBlobInfo: error code is ${S}`);a=new Uint8Array(s.buffer),me(a,p,c),me(a,y,h);const v=new Uint32Array(c.buffer),k=new Float64Array(h.buffer),[w,d,,g,T,C,b,x,I,A,E]=v,P={version:w,depthCount:A,width:g,height:T,validPixelCount:b,bandCount:C,blobSize:x,maskCount:I,dataType:d,minValue:k[0],maxValue:k[1],maxZerror:k[2],statistics:[],bandCountWithNoData:E};if(E&&A>1)return r(m),P;if(A===1&&C===1)return r(m),P.statistics.push({minValue:k[0],maxValue:k[1]}),P;const R=A*C*8,G=new Uint8Array(R),U=new Uint8Array(R);let B=m,L=0,J=0,O=!1;if(a.byteLength1){const _=z.slice(Y*A,(Y+1)*A),j=F.slice(Y*A,(Y+1)*A),H=Math.min.apply(null,_),X=Math.max.apply(null,j);V.push({minValue:H,maxValue:X,depthStats:{minValues:_,maxValues:j}})}else V.push({minValue:z[Y],maxValue:F[Y]});return r(B),O||r(L),P},We.decode=(n,c)=>{const{maskCount:h,depthCount:m,bandCount:p,width:y,height:S,dataType:v,bandCountWithNoData:k}=c,w=$t[v],d=y*S,g=new Uint8Array(d*p),T=d*m*p*w.size,C=new Uint8Array(T),b=new Uint8Array(p),x=new Uint8Array(8*p),[I,A,E,P,R]=u([n.length,g.length,C.length,b.length,x.length]);a.set(n,I),a.set(g,A),a.set(C,E),a.set(b,P),a.set(x,R);const G=l(I,n.length,h,A,m,y,S,p,v,E,P,R);if(G)throw r(I),new Error(`lerc-decode: error code is ${G}`);a=new Uint8Array(s.buffer),me(a,E,C),me(a,A,g);let U=null;if(k){me(a,P,b),me(a,R,x),U=[];const B=new Float64Array(x.buffer);for(let L=0;L1){g.set(k[0]);for(let I=1;I=T;if(m>0&&C)for(let I=0;I1?k:null,{pixelType:x}=y;return{width:s,height:u,bandCount:n,pixelType:x,depthCount:c,statistics:p,pixels:v,mask:g,bandMasks:b,noDataValues:a}}function _r(e,t,r,o=!0){if(t%4!=0||r%4!=0){const i=new ArrayBuffer(4*Math.ceil(r/4)),l=new Uint8Array(i),f=new Uint8Array(e,t,r);if(o)for(let a=0;a=l)a-=l,h=c>>>32-l,c<<=l;else{h=c>>>32-a,c=i[n++];const v=l-a;a=32-v,h=(h<>>a),c<<=v}if(h===257)break;if(h===256){l=9,f=Ut(),s=f.length,u=[];continue}const S=f[h];if(S==null){if(h>f.length)throw new Error("data integrity issue: code does not exist on code page");u.push(u[0]),f[s++]=u.slice(),Nt(y,u)}else Nt(y,S),u.push(S[0]),u.length>1&&(f[s++]=u.slice()),u=S.slice();if(xe.has(s)&&l++,a===0&&(c=i[n++],a=32),n>m||n===m&&a<=p)break}return new Uint8Array(y)}xe.add(511),xe.add(1023),xe.add(2047),xe.add(4095),xe.add(8191);const Bt=(e,t)=>{const r=t.width*t.height,o=t.pixelType;return Math.floor(e.byteLength/(r*Qt(o)))},Qt=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},Wr=(e,t)=>{if(8*e.byteLength=0;a--)o[i++]=l>>a&1;for(a=7;i>a&1,a--;return o};let Hr=class{static decode(e,t){const r=t.pixelType,o=[],i=t.width*t.height,l=Bt(e,t),{bandIds:f,format:a}=t,s=f?.length||Bt(e,t),u=e.byteLength-e.byteLength%(i*Qt(r)),n=new r(e,0,i*l);let c,h,m,p,y=null;if(a==="bip")for(c=0;c>4,i<8?i=1:i===15?(i=4,l=(7&l)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):i===14?(i=3,l=(15&l)<<12|(63&e[r++])<<6|63&e[r++]):(i=2,l=(31&l)<<6|63&e[r++]),(l!==0||t)&&(o+=String.fromCharCode(l));return o}const mt=(()=>{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})(),Kr=(()=>{const e=mt.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})(),Yr=["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"],qr=(()=>{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})(),$r=(e,t)=>{let r=(t||mt)[e];return r===void 0&&(r="unknown"+String(e)),r},st=new Map;st.set("EXIFIFD",Kr),st.set("GPSIFD",Yr);const Ae={tiffTags:mt,ifdTags:st,geoKeys:qr,getTagName:$r},gt=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,t[0]===1})(),Ft=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],Ee=4294967296,Zr=new Set([1,5,6,7,8,34712,34887]);function yt(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 He(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 Xr(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 er(e,t){return e.get(t)?.values}function Ie(e,t){return e.get(t)?.values}function Vt(e,t){return e.get(t)?.values?.[0]}function W(e,t){return e.get(t)?.values?.[0]}function Qe(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=l===8,a=f?bt(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),s=4+2*l,u=f?8:2,n=u+a*s;if(r+n>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:n};const c=r+n+4<=e.byteLength?je(new DataView(e,r+n,l===8?8:4),0,t,l===8):null,h=r+u,m=new Map;let p,y,S,v,k,w=0,d=0;for(let g=0;gXt(e,{inputOffset:t}).pixels[0];function lt(e,t){if(t!==1&&t!==2&&t!==4)return e;const r=new Uint8Array(e),o=8/t,i=new Uint8Array(e.byteLength*o);let l=0;const f=2**t-1;for(let a=0;a>>8-t&f}return i.buffer}function ut(e,t,r){const o=new qt;o.parse(e),o.colorTransform=r===6?-1:0;const i=o.getData(o.width,o.height,t!==1&&t!==4);return new Uint8Array(i.buffer)}function ct(e){const t=new Ue(e).getBytes(),r=new ArrayBuffer(t.length),o=new Uint8Array(r);return o.set(t),o}async function ht(e,t,r,o,i){const l=gt===t,f=W(r,"BITSPERSAMPLE"),a=W(r,"SAMPLESPERPIXEL")??1,s=W(r,"PHOTOMETRICINTERPRETATION"),u=W(r,"SAMPLEFORMAT")??1,n=yt(u,f),c=W(r,"COMPRESSION")??1,h=He(n);let m,p,y;if(c===34887)return await Zt(),Qr(e,o);if(c===1)m=e.slice(o,o+i),p=new Uint8Array(m);else if(c===8||c===32946)p=new Uint8Array(e,o,i),p=ct(p),m=p.buffer;else if(c===6)p=new Uint8Array(e,o,i),p=ut(p,a,s),m=p.buffer;else if(c===7){const w=r.get("JPEGTABLES").values,d=w.length-2;p=new Uint8Array(d+i-2);for(let T=0;T1&&(c===5||c===8||c===32946)&&v&&k){const w=Je(r),d=new h(y.length);d.set(y),y=uo(d,k,v,u===3&&S===3,w?1:a)}return y}async function eo(e,t,r){const o=Ie(r,"TILEOFFSETS");if(o===void 0)return null;const i=Ie(r,"TILEBYTECOUNTS"),{width:l,height:f,pixelType:a,tileWidth:s,tileHeight:u}=Ct([r]),n=Je(r,t),c=W(r,"SAMPLESPERPIXEL")||t.planes,h=l*f,m=W(r,"BITSPERSAMPLE"),p=(W(r,"COMPRESSION")??1)===34887,y=He(a),S=[];for(let B=0;B1){const B=Math.round(o.length/c);for(v=0;v{const o=gt===t.littleEndian,i=Ie(r,"STRIPOFFSETS");if(i===void 0)return null;const{width:l,height:f,pixelType:a}=Ct([r]),s=W(r,"SAMPLESPERPIXEL")||t.planes,u=W(r,"PHOTOMETRICINTERPRETATION"),n=l*f,c=W(r,"BITSPERSAMPLE"),h=He(a),m=new h(n*s),p=Ie(r,"STRIPBYTECOUNTS"),y=W(r,"ROWSPERSTRIP"),S=W(r,"COMPRESSION")??1;let v,k,w,d,g,T,C,b,x;if(c%8==0)for(v=0;v{if(!(e&&e.length>0&&t&&r))return null;let o,i,l;const f=e[0].length,a=e.length,s=new Uint8Array(f);for(let u=0;ul?0:1;else for(let n=0;nl?0:1);return s},oo=e=>{if(!e)return null;const t=e.match(//gi);if(!t||t.length===0)return null;const r=new Map;let o,i,l,f,a;for(let v=0;v")),f=o.indexOf("sample="),f>-1&&(a=o.slice(f+8,o.indexOf('"',f+8))),f=o.indexOf("name="),f>-1&&(i=o.slice(f+6,o.indexOf('"',f+6))),i&&(l=o.slice(o.indexOf(">")+1,o.indexOf("")).trim(),a!=null?r.has(i)?r.get(i)[a]=l:r.set(i,[l]):r.set(i,l)),a=null;const s=r.get("STATISTICS_MINIMUM"),u=r.get("STATISTICS_MAXIMUM"),n=r.get("STATISTICS_MEAN"),c=r.get("STATISTICS_STDDEV");let h=null;if(s&&u){h=[];for(let v=0;vS&&h>(i?e.byteLength:e?e.byteLength-s+o:0))return r.offlineOffsetSize=[s,h],r.values=null,!1;if(m<=S){if(!t)if(S<=32)s>>>=32-m;else{const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);m<=32?(s=k>>>32-m,v[0]=s):(s=k*2**(32-m)+(w>>>32-m),v[0]=k,v[1]=w>>>32-m)}if(a===1&&c===S)u=[s];else if(S===64){const k=v?.length?v[0]:s>>>0,w=v?.length?v[1]:Math.round((s-k)/Ee);let d=k,g=32;for(y=1;y<=a;y++){const T=32-c*y%32;if(g>>32-g,b=w<<32-g>>>32-g;d=w,u.push(C+b*2**(c-g)),g-=32-(c-g)}else u.push(d<>>32-c),g-=c;g===0&&(g=32,d=w)}}else for(y=1;y<=a;y++){const k=32-c*y;u.push(s<>>32-c)}}else{s-=o,i&&(s=0);for(let k=s;kparseFloat(z)),h.some(z=>isNaN(z))&&(h=null));const m=W(t,"COMPRESSION")??1;let p;switch(m){case 1:p="NONE";break;case 2:case 3:case 4:case 32771:p="CCITT";break;case 5:p="LZW";break;case 6:case 7:p="JPEG";break;case 32773:p="PACKBITS";break;case 8:case 32946:p="DEFLATE";break;case 34712:p="JPEG2000";break;case 34887:p="LERC";break;default:p=String(m)}let y=!0,S="";Zr.has(m)||(y=!1,S+="unsupported tag compression "+m),s>3&&(y=!1,S+="unsupported tag sampleFormat "+s),f!==1&&f!==2&&f!==4&&f%8!=0&&(y=!1,S+="unsupported tag bitsPerSample "+f);const v=Vt(t,"GEOASCIIPARAMS");let k;if(v){const z=v.split("|").find(V=>V.includes("ESRI PE String = ")),F=z?z.replace("ESRI PE String = ",""):"";k=F.startsWith("COMPD_CS")||F.startsWith("PROJCS")||F.startsWith("GEOGCS")?{wkid:null,wkt:F}:null}const w=Ie(t,"GEOTIEPOINTS"),d=Ie(t,"GEOPIXELSCALE"),g=Ie(t,"GEOTRANSMATRIX"),T=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let C,b,x=!1,I=!1;if(T){x=W(T,"GTRasterTypeGeoKey")===2;const z=W(T,"GTModelTypeGeoKey");if(z===2){const F=W(T,"GeographicTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F}),k||F!==32767||(I=!0,k={wkid:4326})}else if(z===1){const F=W(T,"ProjectedCSTypeGeoKey");F>=1024&&F<=32766&&(k={wkid:F})}}if(d&&w&&w.length>=6?(C=[d[0],0,w[3]-w[0]*d[0],0,-Math.abs(d[1]),w[4]-w[1]*d[1]],x&&(C[2]-=.5*C[0]+.5*C[1],C[5]-=.5*C[3]+.5*C[4])):g&&g.length===16&&(C=x?[g[0],g[1],g[3]-.5*g[0],g[4],g[5],g[7]-.5*g[5]]:[g[0],g[1],g[3],g[4],g[5],g[7]]),C){const z=[{x:0,y:l},{x:0,y:0},{x:i,y:l},{x:i,y:0}];let F,V=Number.POSITIVE_INFINITY,Y=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let H=0;HV?V:F.x,_=F.x<_?_:F.x,Y=F.y>Y?Y:F.y,j=F.y400||Math.max(Math.abs(b.xmin),Math.abs(b.xmax))>361)&&(k=null,b.spatialReference=null);const A=tr(e);let E,P,R,G,U;if(A.length>0){R=Math.round(Math.log(i/W(A[0],"IMAGEWIDTH"))/Math.LN2);const z=A[A.length-1];G=A.length,E=W(z,"TILEWIDTH"),P=W(z,"TILELENGTH")}E=G!=null&&G>0?E||r:null,P=G!=null&&G>0?P||o:null,r&&(U=[{maxCol:Math.ceil(i/r)-1,maxRow:Math.ceil(l/o)-1,minRow:0,minCol:0}],A.forEach(z=>{U.push({maxCol:Math.ceil(W(z,"IMAGEWIDTH")/W(z,"TILEWIDTH"))-1,maxRow:Math.ceil(W(z,"IMAGELENGTH")/W(z,"TILELENGTH"))-1,minRow:0,minCol:0})}));const B=Vt(e[0],"GDAL_METADATA"),L=oo(B);S+=" "+or({width:i,height:l,tileWidth:r,tileHeight:o,planes:a,ifds:e});const J=rr(e).length===A.length+1,O=A?.length?A.map(z=>({x:i/W(z,"IMAGEWIDTH"),y:l/W(z,"IMAGELENGTH")})):void 0;return{width:i,height:l,tileWidth:r,tileHeight:o,planes:a,isBSQ:n,pixelType:u,compression:p,noData:h,hasMaskBand:J,isSupported:y,pyramidResolutions:O,message:S,extent:b,isPseudoGeographic:I,affine:d?null:C,firstPyramidLevel:R,maximumPyramidLevel:G,pyramidBlockWidth:E,pyramidBlockHeight:P,tileBoundary:U,metadata:L}}function Je(e,t){const r=er(e,"PLANARCONFIGURATION");return r?r[0]===2:!!t&&t.isBSQ}function tr(e){return e.filter(t=>W(t,"NEWSUBFILETYPE")===1)}function rr(e){return e.filter(t=>{const r=!(4&~(W(t,"NEWSUBFILETYPE")??0)),o=W(t,"PHOTOMETRICINTERPRETATION")===4;return r&&o})}function io(e){const{littleEndian:t,isBigTiff:r,firstIFDPos:o}=so(e);let i=o;const l=[];do{const f=lo(e,t,i,0,Ae.tiffTags,r?8:4);if(!f.success)break;l.push(f.ifd),i=f.nextIFD}while(i>0);return{...Ct(l),littleEndian:t,isBigTiff:r,ifds:l,pyramidIFDs:tr(l),maskIFDs:rr(l)}}function bt(e,t,r){const o=e.getUint32(t,r),i=e.getUint32(t+4,r);return r?i*Ee+o:o*Ee+i}function ao(e,t,r){let o=r?e.getInt32(t,r):e.getUint32(t,r),i=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const l=(r?o:i)>=0?1:-1;return r?o*=l:i*=l,l*(r?i*Ee+o:o*Ee+i)}function je(e,t,r,o){return o?bt(e,t,r):e.getUint32(t,r)}function so(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let o=null;if(r===18761)o=!0;else{if(r!==19789)throw new Error("unexpected endianess byte");o=!1}const i=t.getUint16(2,o);if(i!==42&&i!==43)throw new Error("unexpected tiff identifier");let l=4;const f=i===43;if(f){const a=t.getUint16(l,o);if(l+=2,a!==8)throw new Error("unsupported bigtiff version");if(t.getUint16(l,o)!==0)throw new Error("unsupported bigtiff version");l+=2}return{littleEndian:o,isBigTiff:f,firstIFDPos:je(t,l,o,f)}}function lo(e,t,r,o=0,i=Ae.tiffTags,l=4){const f=Qe(e,t,r,o,i,l);let a;const s=f.ifd;if(s){if(Ae.ifdTags.forEach((u,n)=>{s.has(n)&&(a=s.get(n),a.data=Qe(e,t,a.valueOffset-o,o,u).ifd)}),s.has("GEOKEYDIRECTORY")){a=s.get("GEOKEYDIRECTORY");const u=a.values;if(u&&u.length>4){const n=u[0]+"."+u[1]+"."+u[2];a.data=Qe(e,t,a.valueOffset+6-o,o,Ae.geoKeys,2).ifd,a.data&&a.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[n]})}}if(s.has("XMP")){a=s.get("XMP");const u=a.values;typeof u[0]=="number"&&a.type===7&&(a.values=[Jr(new Uint8Array(u))])}}return f}function or(e){const{width:t,height:r,tileHeight:o,tileWidth:i}=e,l=e.planes,f=i?i*o:t*r,a=W(e.ifds[0],"BITSPERSAMPLE");let s="";return f*l>2**30/(a>8?a/8:1)&&(s=i?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),s}function uo(e,t,r,o,i){const l=o?4:1,f=r*l*i;o&&(e=new Uint8Array(e.buffer));for(let u=0;ux.min):null,C=g?g.map(x=>x.max):null,b={pixelType:u,width:h,height:m,pixels:v,noDataValue:d};return d!=null?ft(b,d):T&&C&&t.applyMinMaxConstraint&&(b.mask=ro(v,T,C)),b}async function ho(e,t={}){const r=t.pyramidLevel||0,o=t.headerInfo||io(e),{ifds:i,noData:l}=o;if(i.length===0)throw new Error("no valid image file directory");const f=or(o);if(f)throw f;let a=null;const s=r===-1?i[i.length-1]:i[r],u=l??t.noDataValue;return a=o.tileWidth?await eo(e,o,s):to(e,o,s),a&&(u!=null&&ft(a,u),a)}var fo=function(e){var t,r,o,i,l,f;function a(s){var u,n,c,h,m,p,y,S,v,k,w,d,g;for(this.data=s,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},m=null;;){switch(u=this.readUInt32(),S=function(){var T,C;for(C=[],T=0;T<4;++T)C.push(String.fromCharCode(this.data[this.pos++]));return C}.call(this).join(""),S){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(u);break;case"fcTL":m&&this.animation.frames.push(m),this.pos+=4,m={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},h=this.readUInt16(),c=this.readUInt16()||100,m.delay=1e3*h/c,m.disposeOp=this.data[this.pos++],m.blendOp=this.data[this.pos++],m.data=[];break;case"IDAT":case"fdAT":for(S==="fdAT"&&(this.pos+=4,u-=4),s=m?.data||this.imgData,w=0;0<=u?wu;0<=u?++w:--w)s.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(u),(v=255-this.transparency.indexed.length)>0)for(d=0;0<=v?dv;0<=v?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(u)[0];break;case 2:this.transparency.rgb=this.read(u)}break;case"tEXt":p=(k=this.read(u)).indexOf(0),y=String.fromCharCode.apply(String,k.slice(0,p)),this.text[y]=String.fromCharCode.apply(String,k.slice(p+1));break;case"IEND":return m&&this.animation.frames.push(m),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(g=this.colorType)===4||g===6,n=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*n,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+=u}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return a.load=function(s,u,n){var c;return typeof u=="function"&&(n=u),(c=new XMLHttpRequest).open("GET",s,!0),c.responseType="arraybuffer",c.onload=function(){var h;return h=new a(new Uint8Array(c.response||c.mozResponseArrayBuffer)),typeof u?.getContext=="function"&&h.render(u),typeof n=="function"?n(h):void 0},c.send(null)},r=1,o=2,t=0,a.prototype.read=function(s){var u,n;for(n=[],u=0;0<=s?us;0<=s?++u:--u)n.push(this.data[this.pos++]);return n},a.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},a.prototype.decodePixels=function(s){var u,n,c,h,m,p,y,S,v,k,w,d,g,T,C,b,x,I,A,E,P,R,G;if(s==null&&(s=this.imgData),s.length===0)return new Uint8Array(0);for(s=(s=new Ue(s)).getBytes(),b=(d=this.pixelBitlength/8)*this.width,g=new Uint8Array(b*this.height),p=s.length,C=0,T=0,n=0;T1&&n/hnew dt(m,p)),bandMasks:u,depthCount:a,noDataValues:s});return f?.length||h.updateStatistics(),h}async function go(e,t){const r=await ho(e,{...t,noDataValue:null});ze(r);const o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,bandMasks:r.bandMasks,statistics:null});return o.updateStatistics(),o}async function yo(e,t){const r=await co(e,t.customOptions),o=new re({width:r.width,height:r.height,pixels:r.pixels,pixelType:r.pixelType.toLowerCase(),mask:r.mask,statistics:null});return o.updateStatistics(),o}function nr(e,t){const r=t.pixelType||"u8",o=re.getPixelArrayConstructor(r),i=r==="u8"?e:new o(e.buffer),l=[],f=t.planes||1;if(f===1)l.push(i);else for(let s=0;svo(r,o,e);break;case"tiff":t=go;break;case"deflate":t=Co;break;case"lzw":t=bo;break;case"error":t=()=>{throw new ge("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new ge("rasterCodec:decode","unsupported raster format")}}return t}function xo(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 ko(e,t=1){if(!e)return;const{pixels:r,width:o,height:i,mask:l}=e;if(!r||r.length===0)return;const f=r.length,a=o-1,s=i-1,u=[];let n,c,h,m,p,y,S=null;const v=re.getPixelArrayConstructor(e.pixelType);if(t===0){for(n=0;n1){const a=f.map((n,c)=>i(e.slice(n,f[c+1]),t)),s=await Promise.all(a);l=s[0],l.pixels=s.map(n=>n.pixels[0]);const u=s.map(n=>n.mask);s.some(n=>n!=null)&&(u.forEach((n,c)=>{n==null&&(u[c]=new Uint8Array(l.width*l.height).fill(255))}),l.bandMasks=u,l.mask=re.combineBandMasks(u)),l.updateStatistics()}else l=await i(e,{...t,offset:f?.[0]??t.offset});return o!=="jpg"&&t.noDataValue!=null&&l.depthCount===1&&ft(l,t.noDataValue,{customFloatTolerance:t.tolerance}),t.isPoint&&ko(l),l}function Ao(e){return["u8","s8"].includes(e.pixelType)&&e.statistics?.[0]?.min!=null&&e.statistics[0]?.max!=null&&e.bandCount===1}function Eo(e,t){const{attributeTable:r,bandCount:o}=e;return r==null&&Ao(e)?!0:!(r==null||o>1||t&&r.fields.find(i=>i.name.toLowerCase()===t.toLowerCase())==null)}function Po(e){const{bandCount:t,dataType:r,pixelType:o}=e;return r==="elevation"||r==="generic"&&t===1&&(o==="s16"||o==="s32"||o==="f32"||o==="f64")}function Ro(e,t=!1){const{bandCount:r,colormap:o,pixelType:i}=e;return r===1&&(!!o?.length||!t&&i==="u8")}function en(e,t=!1){const{attributeTable:r,bandCount:o}=e;return o===1&&(!t||r!=null||e.histograms!=null)}function tn(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function rn(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function et(e){return!!e?.length&&e.length<=16384}const tt=1;function ar(e,t=256){t=Math.min(t,256);const{size:r,counts:o}=e,i=new Uint8Array(r),l=o.reduce((n,c)=>n+c/t,0);let f=0,a=0,s=0,u=l;for(let n=0;n=s){const g=sr(s,o);for(u=0;u1&&(w-=(1/y)**(S*g[u])),kt[u]){const T=w*y*S**(1/o[u])+f;d[n]=l==="floor"?Math.floor(T):l==="round"?Math.round(T):T}else k>=r[u]?d[n]=a:d[n]=f;else d[n]=f;v[u]=d}}else for(u=0;u=r[u])d[n]=a;else{const g=(k-t[u])*m[u]+f;d[n]=l==="floor"?Math.floor(g):l==="round"?Math.round(g):g}v[u]=d}if(e.contrastOffset!=null){const g=Oo(e.contrastOffset,e.brightnessOffset);for(u=0;u0&&r<100?a=(200*f-100*i+2*i*o)/(2*(100-r))+l:r<=0&&r>-100?a=(200*f-100*i+2*i*o)*(100+r)/2e4+l:r===100?(a=200*f-100*i+(i+1)*(100-r)+2*i*o,a=a>0?i:0):r===-100&&(a=l),s[f]=a>i?i:a<0?0:a;return s}function Do(e,t,r){const o=[];for(let i=0;i=255)return tt;let t=0;e!==150&&(t=e<=150?45*Math.cos(.01047*e):17*Math.sin(.021*e));const r=255,o=e+t,i=Math.log(e/r),l=Math.log(o/r);if(l===0)return tt;const f=i/l;return isNaN(f)?tt:Math.min(9.9,Math.max(.01,f))}function Mo(e,t,r,o){let i=1/0,l=-1/0,f=0,a=0,s=0,u=0;const n=e.length,c=new Map,h=[];for(let C=0;Cu&&(u=x,s=b),i=bl?b:l,f+=b,a++}}if(a===0)return{statistics:{min:0,max:0,avg:0,stddev:0,mode:0,median:0},histogram:null};const m=f/a;let p=0;for(let C=0;CC).length:n,S=y<=1?0:Math.sqrt(p/(y-1));h.sort((C,b)=>C-b);const v=a>>>1,k={min:i,max:l,avg:m,stddev:S,mode:s,median:a%2?h[Math.floor(v)]:(h[v-1]+h[v])/2};if(["u8","s8","u4","u2","u1"].includes(r)){const C=l-i+1,b=new Uint32Array(C);for(let x=0;xMo(f,i?.[a]??r,o));return{statistics:l.map(({statistics:f})=>f),histograms:l.map(({histogram:f})=>f)}}function Go(e){if(!e?.pixels?.length)return null;const{pixels:t,mask:r,bandMasks:o,pixelType:i}=e,l=e.width*e.height,f=t.length,a=[],s=[],u=256;let n,c,h,m;for(let p=0;pc?E:c,h[E]++}}else for(let A=0;Ac?E:c,h[E]++}h=h.slice(n,c+1)}else{let A=!1;e.statistics||(e.updateStatistics(),A=!0);const E=e.statistics;n=E[p].minValue,c=E[p].maxValue;const P=(c-n)/u;if(P===0){!E||e.validPixelCount||A||e.updateStatistics();const R=(e.validPixelCount||e.width*e.height)/u;for(let G=0;G[I.minValue,I.maxValue,0,0]);else{const I=Go(r);f=I!=null?I.statistics:null,a=I!=null?I.histograms:null}else f=e.statistics?.length?e.statistics:l.statistics,a="histograms"in e?e.histograms:void 0,a||(a=l.histograms);s!=="percentClip"&&s!=="histogramEqualization"||a?.length||(s="minMax");const u=f?.length||a?.length||l.bandCount,n=[],c=[];let h,m,p,y,S,v,k,w,d;f&&!Array.isArray(f[0])&&(f=f.map(I=>[I.min,I.max,I.avg,I.stddev]));const[g,T]=br(l.pixelType);if(!f?.length){for(f=[],w=0;wA[1]&&(c[w]=A[1])}}break;case"histogramEqualization":for(ze(a),w=0;w=20&&(y[0]=y[1]=y[2]=y[y.length-1]=y[y.length-2]=0),p=0,m=(h.max-h.min)/h.size,k=h.min===-.5&&m===1?.5:0,d=0;dv){n[w]=h.min+m*(d+k);break}for(v=(1-(e.maxPercent||0)/100)*p,c[w]=h.max+k,d=h.size-2;d>=0;d--)if(S[d]ar(I)))):(b=e.max||255,C=e.min||0),Uo({minCutOff:n,maxCutOff:c,outMax:b,outMin:C,histogramLut:x},o)}function Uo(e,t){if(t==null||t.length===0)return e;const r=Math.max.apply(null,t),{minCutOff:o,maxCutOff:i,outMin:l,outMax:f,histogramLut:a}=e;return o.length===t.length||o.length<=r?e:{minCutOff:t.map(s=>o[s]),maxCutOff:t.map(s=>i[s]),histogramLut:a?t.map(s=>a[s]):null,outMin:l,outMax:f}}function sr(e,t){const r=new Float32Array(e);for(let o=0;o1?t[o]>2?r[o]=6.5+(t[o]-2)**2.5:r[o]=6.5+100*(2-t[o])**4:r[o]=1;return r}function rt(e,t){if(!e?.pixels?.length)return e;const{mask:r,bandMasks:o,width:i,height:l,pixels:f}=e,{minCutOff:a,maxCutOff:s,gamma:u}=t,n=t.outMin||0,c=t.outMax||255,h=i*l,m=t.outputPixelType||"u8",p=e.pixels.map(()=>re.createEmptyBand(m,h)),y=p.length,S=c-n,v=[],k=[];for(let C=0;C=y,g=!!t.isRenderer;if(d){const C=sr(y,u);for(let b=0;b1&&(P-=(1/S)**(E*C[b])),Aa[b]){const R=P*S*E**(1/u[b])+n;p[b][I]=g?Math.floor(R):w?Math.round(R):R}else A>=s[b]?p[b][I]=c:p[b][I]=n}}}else for(let C=0;Ca[C]){const A=(I-a[C])*v[C]+n;p[C][x]=g?Math.floor(A):w?Math.round(A):A}else I>=s[C]?p[C][x]=c:p[C][x]=n}}const T=new re({width:i,height:l,mask:r,bandMasks:o,pixels:p,pixelType:m});return T.updateStatistics(),T}const ne=1,ke=1/111e3;function lr(e){let{altitude:t,azimuth:r}=e;const{hillshadeType:o,pixelSizePower:i=1,pixelSizeFactor:l=1,scalingType:f,isGCS:a,resolution:s}=e,u=o==="multi-directional"?2*e.zFactor:e.zFactor,{x:n,y:c}=s;let h=u/(8*n),m=u/(8*c);if(a&&u>.001&&(h/=ke,m/=ke),f==="adjusted")if(a){const E=n*ke,P=c*ke;h=(u+E**i*l)/(8*E),m=(u+P**i*l)/(8*P)}else h=(u+n**i*l)/(8*n),m=(u+c**i*l)/(8*c);let p=(90-t)*Math.PI/180,y=Math.cos(p),S=(360-r+90)*Math.PI/180,v=Math.sin(p)*Math.cos(S),k=Math.sin(p)*Math.sin(S);const w=[315,270,225,360,180,0],d=[60,60,60,60,60,90],g=new Float32Array([3,5,3,2,1,4]),T=g.reduce((E,P)=>E+P),C=g.map(E=>E/T),b=o==="multi-directional"?w.length:1,x=new Float32Array(6),I=new Float32Array(6),A=new Float32Array(6);if(o==="multi-directional")for(let E=0;Ep?p:S],w=f[y],d=w*k,g=d*(1-Math.abs(v%2-1)),T=w-d;switch(Math.floor(v)){case 0:c[y]=d+T,h[y]=g+T,m[y]=T;break;case 1:c[y]=g+T,h[y]=d+T,m[y]=T;break;case 2:c[y]=T,h[y]=d+T,m[y]=g+T;break;case 3:c[y]=T,h[y]=g+T,m[y]=d+T;break;case 4:c[y]=g+T,h[y]=T,m[y]=d+T;break;case 5:case 6:c[y]=d+T,h[y]=T,m[y]=g+T}}e.pixels=[c,h,m],e.updateStatistics()}function an(e,t){if(!Se(e))return e;const r=t.zFactor,o=t.pixelSizePower??1,i=t.pixelSizeFactor??1,l=t.slopeType,f=t.isGCS,{x:a,y:s}=t.resolution;let u=r/(8*a),n=r/(8*s);f&&Math.abs(r-1)<1e-4&&(u/=ke,n/=ke),l==="adjusted"&&(u=(r+a**o*i)/(8*a),n=(r+s**o*i)/(8*s));const{dzxs:c,dzys:h,outMask:m}=Ke(e),{width:p,height:y}=e,S=new Float32Array(p*y);for(let k=ne;k360&&(v%=360)),n[h+m]=v}}}return Ye(n,s,u),new re({width:s,height:u,pixels:[n],mask:a,pixelType:"f32",validPixelCount:e.validPixelCount,statistics:[new dt(-1,360)]})}function ln(e,t){if(!Se(e))return e;const{curvatures:r,outMask:o}=Ke(e,t),{width:i,height:l}=e;Ye(r,i,l);const f=new re({width:i,height:l,pixels:[r],mask:o,pixelType:"f32",validPixelCount:e.validPixelCount});return f.updateStatistics(),f}function un(e,t,r){const{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizeFactor:a,pixelSizePower:s,slopeType:u}=e;return{hillshadeType:o,altitude:i,azimuth:l,zFactor:f,pixelSizePower:s,pixelSizeFactor:a,scalingType:u==="scaled"?"adjusted":"none",resolution:t,isGCS:r}}let Te=class extends Ge{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?.pixelBlock;if(!jt(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=t.extractBands(e.bandIds??[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 o=e.extent,i=o.spatialReference.isGeographic,l={x:(o.xmax-o.xmin)/t.width,y:(o.ymax-o.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:i,resolution:l});break}}return r}catch(r){return wt.getLogger(this).error("symbolize",r.message),t}}simpleStretch(e,t){if(!jt(e))return e;try{return e.pixels.length>3&&(e=e.extractBands([0,1,2])),rt(e,{...t,isRenderer:!0})}catch(r){return wt.getLogger(this).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:f,offset:a}=this.lookup.colormapLut||{};return{colormap:f,colormapOffset:a,isClassBreaks:this.rendererJSON.type==="classBreaks",type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:o,bandIds:i}=e,{rendererJSON:l}=this;return l.type==="rasterStretch"?this._generateStretchWebGLParams(t,l,i):l.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(l,r,o??void 0):l.type==="vectorField"?this._generateVectorFieldWebGLParams(l):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:Ze(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?Ze(e,this.lookup.colormapLut):vr(e,this.lookup.remapLut??[])}_symbolizeStretch(e,t){const{rasterInfo:r}=this,{pixelType:o,bandCount:i}=r,l=this.rendererJSON,f=["u8","u16","s8","s16"].includes(o);let a,s;const{dra:u}=l,{gamma:n}=this.lookup;if(l.stretchType==="histogramEqualization"){const c=u?null:this.lookup?.histogramLut,h=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!c}),m=rt(e,{...h,gamma:n,isRenderer:!0});s=It(m,{lut:u?h.histogramLut:c,offset:0})}else if(f){if(u){const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});a=zt({pixelType:o,...c,gamma:n,rounding:"floor"})}else if(this._isLUTChanged()){if(!this.bind().success)return e;a=this.lookup?this.lookup.stretchLut:null}else a=this.lookup?this.lookup.stretchLut:null;if(!a)return e;i>1&&t!=null&&t.length===e?.pixels.length&&a?.lut.length===i&&(a={lut:t.map(c=>a.lut[c]),offset:a.offset}),s=It(e,a)}else{const c=Le(l,{rasterInfo:r,pixelBlock:e,bandIds:t});s=rt(e,{...c,gamma:n,isRenderer:!0})}if(l.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;s=Ze(s,this.lookup?.colormapLut)}return s}_symbolizeShadedRelief(e,t){const r=this.rendererJSON,o={...r,...t},i=No(e,o);if(!r.colorRamp)return i;let l;if(this._isLUTChanged(!0)){if(!this.bind().success)return i;l=this.lookup?this.lookup.hsvMap:null}else l=this.lookup?this.lookup.hsvMap:null;if(!l)return i;const f=this.rasterInfo.statistics?.[0]??{min:0,max:8e3};return Bo(i,e,l,f),i}_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){const{bandCount:t,attributeTable:r,pixelType:o}=this.rasterInfo,i=e.field1;if(!i)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const l=e.defaultSymbol,f=t===1&&["u8","s8"].includes(o);if(!Eo(this.rasterInfo,i)&&!f)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const a=[];if(r!=null){const u=r.fields.find(n=>n.name.toLowerCase()==="value");if(!u)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(n=>{const c=e.uniqueValueInfos?.find(m=>String(m.value)===String(n.attributes[i])),h=c?.symbol?.color;h?a.push([n.attributes[u.name]].concat(h)):l&&a.push([n.attributes[u.name]].concat(l.color))})}else{if(i.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not available.'};e.uniqueValueInfos?.forEach(u=>{const n=u?.symbol?.color;n?a.push([parseInt(""+u.value,10)].concat(n)):l&&a.push([parseInt(""+u.value,10)].concat(l?.color))})}if(a.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const s=Oe({colormap:a});return this.lookup={rendererJSON:e,colormapLut:s},this.canRenderInWebGL=et(s?.indexedColormap),{success:!0}}_updateColormapRenderer(e){if(!Ro(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(o=>[o.value].concat(o.color)).sort((o,i)=>o[0]-i[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Oe({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=et(r?.indexedColormap),{success:!0}}_updateShadedReliefRenderer(e){if(!Po(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=Et(e.colorRamp,{interpolateAlpha:!0}),r=Oe({colormap:t}),o=Or(r.indexedColormap);this.lookup={rendererJSON:e,colormapLut:r,hsvMap:o}}else this.lookup=null;return this.canRenderInWebGL=!0,{success:!0}}_analyzeClassBreaks(e){const{attributeTable:t,pixelType:r}=this.rasterInfo,o=t!=null?t.fields.find(f=>f.name.toLowerCase()==="value"):null,i=t!=null?t.fields.find(f=>f.name.toLowerCase()===e.field.toLowerCase()):null,l=o!=null&&i!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||l,tableValueField:o,tableBreakField:i}}_updateClassBreaksRenderer(e){const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:o,tableBreakField:i}=this._analyzeClassBreaks(e),l=e.classBreakInfos;if(!l?.length)return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const f=l.sort((c,h)=>c.classMaxValue-h.classMaxValue),a=f[f.length-1];let s=e.minValue;if(!r){const c=[];for(let h=0;hw>v);k&&u.push([S].concat(k.symbol.color))}}else{s=Math.floor(e.minValue);for(let c=0;car(c));this.lookup={rendererJSON:e,histogramLut:n}}else if(u){const n=Le(e,{rasterInfo:this.rasterInfo}),c=zt({pixelType:s,...n,gamma:l?a:null,rounding:"floor"});this.lookup={rendererJSON:e,stretchLut:c}}if(f&&!zo(f)){const n=Et(f,{interpolateAlpha:!0});this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Oe({colormap:n}),this.lookup.rendererJSON=e}return this.lookup.gamma=l&&a?.length?a:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let o=null,i=null;const l=this.lookup?.colormapLut;t.colorRamp&&l&&(o=l.indexedColormap,i=l.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:f}=this.lookup,a=!(!t.useGamma||!f?.some(w=>w!==1)),{minCutOff:s,maxCutOff:u,outMin:n,outMax:c}=Le(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let h=0;e!=null&&(h=e.getPlaneCount(),h===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const{bandCount:m}=this.rasterInfo,p=Math.min(3,r?.length||h||m,m),y=new Float32Array(p),S=o||a?1:255;let v;for(v=0;v1?f[v]>2?k[v]=6.5+(f[v]-2)**2.5:k[v]=6.5+100*(2-f[v])**4:k[v]=1;return{bandCount:p,outMin:n/S,outMax:c/S,minCutOff:s,maxCutOff:u,factor:y,useGamma:a,gamma:a?f:[1,1,1],gammaCorrection:a?k:[1,1,1],colormap:o,colormapOffset:i,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){let o=null,i=null;const l=this.lookup?.colormapLut;e.colorRamp&&l&&(o=l.indexedColormap,i=l.offset);const f={...e,isGCS:t,resolution:r},a=lr(f),s=this.rasterInfo.statistics?.[0];return{...a,minValue:s?.min??0,maxValue:s?.max??8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:o,colormapOffset:i}}_generateVectorFieldWebGLParams(e){const{style:t,inputUnit:r,outputUnit:o,visualVariables:i,symbolTileSize:l,flowRepresentation:f}=e;let a;const s=this.rasterInfo.statistics?.[0].min??0,u=this.rasterInfo.statistics?.[0].max??50,n=i?.find(v=>v.type==="sizeInfo")??{type:"sizeInfo",field:"Magnitude",maxDataValue:u,maxSize:.8*l,minDataValue:s,minSize:.2*l},c=n.minDataValue??s,h=n.maxDataValue??u,m=n.maxSize!=null&&n.minSize!=null?[n.minSize/l,n.maxSize/l]:[.2,.8];if(t==="wind_speed"){const v=(m[0]+m[1])/2;m[0]=m[1]=v}const p=c!=null&&h!=null?[c,h]:null;if(t==="classified_arrow")if(c!=null&&h!=null&&n!=null){a=[];const v=(n.maxDataValue-n.minDataValue)/5;for(let k=0;k<6;k++)a.push(n.minDataValue+v*k)}else a=[0,1e-6,3.5,7,10.5,14];const y=f==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,S=i?.find(v=>v.type==="rotationInfo");return{breakValues:a,dataRange:p,inputUnit:r,outputUnit:o,symbolTileSize:l,symbolPercentRange:m,style:t||"single_arrow",rotation:y,rotationType:this.rasterInfo.storageInfo?.tileInfo&&this.rasterInfo.dataType==="vector-uv"?"geographic":S?.rotationType||e.rotationType,type:"vectorField"}}};D([N({json:{write:!0}})],Te.prototype,"rendererJSON",void 0),D([N({type:Gr,json:{write:!0}})],Te.prototype,"rasterInfo",void 0),D([N({json:{write:!0}})],Te.prototype,"lookup",void 0),D([N()],Te.prototype,"canRenderInWebGL",void 0),Te=D([Me("esri.renderers.support.RasterSymbolizer")],Te);const cn=Te;function Fo(e){return e==="percentClip"||e==="histogramEqualization"}function Vo(e){return e!=null&&e.length>0&&e[0].min!=null&&e[0].max!=null}function jt(e){return Se(e)&&e.validPixelCount!==0}function zo(e){return e.type==="algorithmic"&&["0,0,0,255","0,0,0"].includes(e.fromColor.join(","))&&["255,255,255,255","255,255,255"].includes(e.toColor.join(","))}export{un as $,tr as A,xr as B,Po as C,rr as D,Ae as E,lo as F,Tr as G,no as H,Bo as I,Ct as J,qo as K,Jr as L,Je as N,Le as P,ln as Q,Go as S,lr as T,Qo as V,Gr as W,sn as X,Zo as Y,an as Z,tn as _,$o as a,Xo as b,Mr as c,on as d,Ko as e,Yo as f,et as g,Oo as h,Et as i,rn as j,ke as k,Or as l,zt as m,Ht as n,rt as o,sr as p,Dr as q,Rr as r,nn as s,cn as t,gt as u,so as v,Ro as w,No as x,Eo as y,en as z}; diff --git a/custom-toc-highlight/assets/RasterVFDisplayObject-CnriTVT9-CjUrEqNq.js b/custom-toc-highlight/assets/RasterVFDisplayObject-CnriTVT9-CVvMEEVD.js similarity index 97% rename from custom-toc-highlight/assets/RasterVFDisplayObject-CnriTVT9-CjUrEqNq.js rename to custom-toc-highlight/assets/RasterVFDisplayObject-CnriTVT9-CVvMEEVD.js index 76e737c6..1cd3076f 100644 --- a/custom-toc-highlight/assets/RasterVFDisplayObject-CnriTVT9-CjUrEqNq.js +++ b/custom-toc-highlight/assets/RasterVFDisplayObject-CnriTVT9-CVvMEEVD.js @@ -1 +1 @@ -import{v as _,S as g,i as tt,j as et,aU as mt,a1 as at,w as pt,n as ft,ah as I,bi as _t,bj as H,et as V,$ as W}from"./story-BfX8CRfG.js";import{r as D}from"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import{I as m,n as M,A as w,T as U,L as st,D as $,U as yt,G as gt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as vt,V as wt}from"./Texture-BCt2hphT-hC4XzHg_.js";import{c as N}from"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import{n as x}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{$ as B,_ as Z,C as J}from"./dataUtils-BkPy4R3C-Cb9EIxnj.js";import{E as xt,e as k}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{N as St,k as it}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{I as At,G as K,C,D as rt,R as bt,H as Dt,E as Mt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{T as ot}from"./Container-BcuL1ZEG-DxXVQv25.js";import{e as O}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{G as Rt}from"./LabelMetric-BeluzH3o-C3fDXNzp.js";function Tt(a){const t=nt(q(a)),e=t,s=!0,i=Math.max(t/2,5),r=Math.round(V(a.maxPathLength)/i)+1,o=10,{density:n}=a;return{smoothing:V(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 nt(a){return a.kind==="constant"?a.value[0]:a.values[a.values.length-1]}function Q(a){const t=a.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function Vt(a){return{kind:"constant",value:[.1,.1,.1,1]}}function q(a){if(!a.hasVisualVariables("size"))return{kind:"constant",value:[V(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(V(r.size));i=t.stops.length}else e.push(t.minDataValue,t.maxDataValue),s.push(V(t.minSize),V(t.maxSize)),i=2;return{kind:"ramp",stops:e,values:s,count:i}}function zt(a){if(!a.hasVisualVariables("color"))return{kind:"constant",value:Q(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,Q(i.color));return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function Pt(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 G(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 A(a,t,e,s){s.kind==="constant"?G(a,e,`u_${t}`,s.value):(G(a,"float",`u_${t}_stops`,s.stops),G(a,e,`u_${t}_values`,s.values),a.setUniform1i(`u_${t}_count`,s.count))}function Et(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 lt(a,t){return a===t||a!=null&&t!=null&&a.equals(t)}function ct(a,t){if(!Et(a.simulationSettings,t.simulationSettings)||!lt(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}let Ut=class ht{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof ht)||!lt(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;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e);return new Ft(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(w.ONE,w.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),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),i.bindVAO(s.vertexArray),i.drawArrays(U.TRIANGLE_STRIP,0,4)}};const L=new Map;L.set("a_position",0),L.set("a_texcoord",1);const It=new Map([["geometry",[new x("a_position",2,m.UNSIGNED_SHORT,0,8),new x("a_texcoord",2,m.UNSIGNED_SHORT,4,8)]]]),Ot={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:L};class Ft{constructor(t,e){this._flowData=t,this._values=e}attach(t){const{context:e}=t,{width:s,height:i}=this._flowData,r=D.createVertex(e,M.STATIC_DRAW,new Uint16Array([0,0,0,1,s,0,1,1,0,i,0,0,s,i,1,0])),o=new Map([["geometry",r]]),n=new N(e,L,It,o),l=[];this._values.color.kind==="ramp"&&l.push("vvColor"),this._values.opacity.kind==="ramp"&&l.push("vvOpacity");const u=t.painter.materialManager.getProgram(Ot,l);let p=1e6,c=-1e6;for(let h=0;h0}isCompatible(t){return t instanceof dt&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(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 Nt(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(w.ONE,w.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),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}};const z=new Map;z.set("a_xyts0",0),z.set("a_xyts1",1),z.set("a_typeIdDurationSeed",2),z.set("a_extrudeInfo",3);const kt=new Map([["geometry",[new x("a_xyts0",4,m.FLOAT,0,64),new x("a_xyts1",4,m.FLOAT,16,64),new x("a_typeIdDurationSeed",4,m.FLOAT,32,64),new x("a_extrudeInfo",4,m.FLOAT,48,64)]]]),Lt={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:z};let Nt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,z,kt,i,s),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=a.painter.materialManager.getProgram(Lt,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.compiled}},$t=class ut{constructor(t){this._styles=t}get animated(){return this._styles.reduce((t,e)=>t||e.animated,!1)}isCompatible(t){if(!(t instanceof ut)||this._styles.length!==t._styles.length)return!1;const e=this._styles.length;for(let s=0;si.load(t,e)));return new Gt(s)}render(t,e,s){for(let i=0;ia&&t.ready,!0)}};class j{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof j&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(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 Wt(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(w.ONE,w.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),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}}const P=new Map;P.set("a_positionAndSide",0),P.set("a_timeInfo",1),P.set("a_extrude",2),P.set("a_speed",3);const Ht=new Map([["geometry",[new x("a_positionAndSide",3,m.FLOAT,0,36),new x("a_timeInfo",3,m.FLOAT,12,36),new x("a_extrude",2,m.FLOAT,24,36),new x("a_speed",1,m.FLOAT,32,36)]]]),qt={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:P};let Wt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,P,Ht,i,s),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=a.painter.materialManager.getProgram(qt,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.compiled}};const jt=4,Bt=1,Zt=.5,Jt=!0,Kt=!0,Qt=2.3;function Xt(a,t){const{flowSpeed:e,trailLength:s}=a,i=Tt(a);let r=null;const o={opacity:Pt(a),size:q(a)};let n=zt(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 p={loadImagery:t.loadImagery,timeExtent:t.timeExtent,color:n,opacity:{kind:"constant",value:[1]}};r=new Ut(p),o.color=Vt()}const l={loadImagery:t.loadImagery,createFlowMesh:t.createFlowMesh,simulationSettings:i,timeExtent:t.timeExtent,trailLength:s,flowSpeed:e,featheringSize:Bt,featheringOffset:Zt,introFade:Jt,fadeToZero:Kt,decayRate:Qt,color:o.color,opacity:o.opacity,size:o.size},u=a.trailCap==="butt"||nt(q(a))<=jt?new j(l):new Ct(l);return r!=null?new $t([r,u]):u}class Yt extends it{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:k(),displayViewMat3:k()}}dispose(){}prepareState(t){const{context:e}=t;e.setColorMask(!0,!0,!0,!0),e.setStencilFunction(st.EQUAL,0,255)}draw(t,e){const{requestRender:s,allowDelayedRender:i}=t,{displayData:r}=e;if(r==null||(r.state.name==="loaded"&&r.attach(t),r.state.name!=="attached"))return;const o=r.state.resources;!i||o.ready||s==null?(this._visualState.time=t.time/1e3,this._visualState.dvsMat3=e.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=t.state.displayViewMat3,r.flowStyle.render(t,this._visualState,o),r.flowStyle.animated&&s!=null&&s()):s()}}class te extends St{constructor(){super(...arguments),this.flowStyle=null}doRender(t){super.doRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"flow",brushes:[Yt],target:()=>this.children,drawPhase:xt.MAP});return[...super.prepareRenderPasses(t),e]}}class ee{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 at.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 ae extends ot{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){this._displayData!=null&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(t){const{displayData:e}=this;if(e==null)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=H(t.rotation),{displayViewScreenMat3:l}=this.transforms;At(l,[-1,1,0]),K(l,l,[2/(t.size[0]*t.pixelRatio),-2/(t.size[1]*t.pixelRatio),1]),C(l,l,[r[0],r[1],0]),rt(l,l,n),K(l,l,[o*t.pixelRatio,o*t.pixelRatio,1])}_createTransforms(){return{displayViewScreenMat3:k()}}}const se=1.15;let T=class extends et{constructor(a){super(a),this._flowDisplayObject=new ae,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(t==null)return void this._clear();const{extent:e,rotation:s,resolution:i,pixelRatio:r}=a.state,o=re(e,s);o.expand(se);const n=[Math.round((o.xmax-o.xmin)/i),Math.round((o.ymax-o.ymin)/i)],l=new ee(t,o,n,r);if(this._loading!=null){if(this._loading.update(l))return;this._loading.detach(),this._loading=null}this._flowDisplayObject.displayData!=null&&this._flowDisplayObject.displayData.update(l)||(l.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},u=>{mt(u)||(at.getLogger(this).error("A resource failed to load.",u),this._loading=null)}),this._loading=l)}_clear(){this._flowDisplayObject.clear(),this._loading!=null&&(this._loading.detach(),this._loading=null)}};_([g()],T.prototype,"_loading",void 0),_([g()],T.prototype,"flowContainer",void 0),_([g()],T.prototype,"updating",null),T=_([tt("esri.views.2d.engine.flow.FlowStrategy")],T);const ie=T;function re(a,t){const e=new pt({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(H(t))),o=Math.abs(Math.sin(H(t))),n=r*s+o*i,l=o*s+r*i,u=new ft({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 y=class extends et{constructor(){super(...arguments),this._loadImagery=(a,t,e,s,i)=>B(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.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const{layer:a}=this,t=()=>{this._loadImagery=(e,s,i,r,o)=>B(a,e,s,i,r,o),this._updateVisualization()};"multidimensionalDefinition"in a?this.addHandles(I(()=>a.multidimensionalDefinition,t)):this.addHandles([I(()=>a.mosaicRule,t),I(()=>a.rasterFunction,t),I(()=>a.definitionExpression,t)]),this.container=new te,this._strategy=new ie({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container?.removeAllChildren(),this.container=null,this.removeHandles()}update(a){a.stationary?this._strategy.update(a):this.layerView.requestUpdate()}hitTest(a){return new _t({attributes:{},geometry:a.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const a=this.layer.renderer;if(a==null||a.type!=="flow")return;const t=Xt(a,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};_([g()],y.prototype,"_strategy",void 0),_([g()],y.prototype,"attached",void 0),_([g()],y.prototype,"container",void 0),_([g()],y.prototype,"layer",void 0),_([g()],y.prototype,"layerView",void 0),_([g()],y.prototype,"type",void 0),_([g()],y.prototype,"updating",null),_([g()],y.prototype,"timeExtent",void 0),y=_([tt("esri.views.2d.engine.flow.FlowView2D")],y);const we=y,F=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]),X=new Float32Array([0,92/255,230/255,1]),oe={beaufort_ft:F,beaufort_m:F,beaufort_km:F,beaufort_mi:F,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]),simple_scalar:X,single_arrow:X,wind_speed:new Float32Array([0,0,0,1])},Y=[0,20];class xe extends it{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:t}){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!0),t.setStencilOp($.KEEP,$.KEEP,$.REPLACE)}draw(t,e){if(e.source==null||e.source.validPixelCount===0)return;const{context:s,timeline:i}=t;if(i.begin(this.name),s.setStencilFunction(st.EQUAL,e.stencilRef,255),e.updateVectorFieldVAO(t),t.renderPass==="scalar"){const r=e.vaoData.scalar;r&&this._drawScalars(t,e,r.vao,r.elementCount)}else{const r=e.vaoData.magdir;r&&this._drawTriangles(t,e,r.vao,r.elementCount)}i.end(this.name)}_drawTriangles(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=u.dataRange?["dataRange"]:[];u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.magdir,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{style:h,dataRange:d,rotation:S,symbolPercentRange:b}=u;c.setUniform4fv("u_colors",oe[h]),c.setUniform2fv("u_dataRange",d||Y),c.setUniform1f("u_rotation",S),c.setUniform2fv("u_symbolPercentRange",b);const R=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",R),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_drawScalars(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=[];u.style==="wind_speed"?p.push("innerCircle"):u.dataRange&&p.push("dataRange"),u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.scalar,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{dataRange:h,symbolPercentRange:d}=u;c.setUniform2fv("u_dataRange",h||Y),c.setUniform2fv("u_symbolPercentRange",d);const S=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",S),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_getSymbolSize(t,e){const s=e.key?2**(t.displayLevel-e.key.level):e.resolution/t.state.resolution,{symbolTileSize:i}=e.symbolizerParameters;return[i/(Math.round((e.width-e.offset[0])/i)*i)/s,i/(Math.round((e.height-e.offset[1])/i)*i)/s]}}class Se extends ot{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){this.vaoData!=null&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.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(){this._vaoInvalidated||this.vaoData==null||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,this.source!=null&&this.vaoData==null){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=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:i}}break;case"simple_scalar":{const s=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={scalar:i}}break;case"wind_speed":{const s=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s),r=J(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(t.context,r);this.vaoData={magdir:i,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:k()}}setTransform(t){const e=bt(this.transforms.displayViewScreenMat3),[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;C(e,e,O(s,i)),C(e,e,O(o/2,n/2)),rt(e,e,-l),C(e,e,O(-o/2,-n/2)),Dt(e,e,O(o,n)),Mt(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:s,indexData:i}=e,r=D.createVertex(t,M.STATIC_DRAW,new Float32Array(s)),o=D.createIndex(t,M.STATIC_DRAW,new Uint32Array(i)),n=Rt("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:m.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:m.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:m.FLOAT,normalized:!1}]});return{vao:new N(t,n.attributes,n.bufferLayouts,new Map([["geometry",r]]),o),elementCount:i.length}}}export{Se as c,xe as l,we as o}; +import{v as _,S as g,i as tt,j as et,aU as mt,a1 as at,w as pt,n as ft,ah as I,bi as _t,bj as H,et as V,$ as W}from"./story-Doly9N9p.js";import{r as D}from"./BufferObject-BM_7mcDb-EYaqMhmk.js";import{I as m,n as M,A as w,T as U,L as st,D as $,U as yt,G as gt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as vt,V as wt}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{c as N}from"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import{n as x}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{$ as B,_ as Z,C as J}from"./dataUtils-BkPy4R3C-Dzc1QGGb.js";import{E as xt,e as k}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{N as St,k as it}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{I as At,G as K,C,D as rt,R as bt,H as Dt,E as Mt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{T as ot}from"./Container-BcuL1ZEG-DVZvemLA.js";import{e as O}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{G as Rt}from"./LabelMetric-BeluzH3o-Br-5CSAC.js";function Tt(a){const t=nt(q(a)),e=t,s=!0,i=Math.max(t/2,5),r=Math.round(V(a.maxPathLength)/i)+1,o=10,{density:n}=a;return{smoothing:V(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 nt(a){return a.kind==="constant"?a.value[0]:a.values[a.values.length-1]}function Q(a){const t=a.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function Vt(a){return{kind:"constant",value:[.1,.1,.1,1]}}function q(a){if(!a.hasVisualVariables("size"))return{kind:"constant",value:[V(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(V(r.size));i=t.stops.length}else e.push(t.minDataValue,t.maxDataValue),s.push(V(t.minSize),V(t.maxSize)),i=2;return{kind:"ramp",stops:e,values:s,count:i}}function zt(a){if(!a.hasVisualVariables("color"))return{kind:"constant",value:Q(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,Q(i.color));return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function Pt(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 G(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 A(a,t,e,s){s.kind==="constant"?G(a,e,`u_${t}`,s.value):(G(a,"float",`u_${t}_stops`,s.stops),G(a,e,`u_${t}_values`,s.values),a.setUniform1i(`u_${t}_count`,s.count))}function Et(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 lt(a,t){return a===t||a!=null&&t!=null&&a.equals(t)}function ct(a,t){if(!Et(a.simulationSettings,t.simulationSettings)||!lt(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}let Ut=class ht{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof ht)||!lt(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;W(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e);return new Ft(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(w.ONE,w.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),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),i.bindVAO(s.vertexArray),i.drawArrays(U.TRIANGLE_STRIP,0,4)}};const L=new Map;L.set("a_position",0),L.set("a_texcoord",1);const It=new Map([["geometry",[new x("a_position",2,m.UNSIGNED_SHORT,0,8),new x("a_texcoord",2,m.UNSIGNED_SHORT,4,8)]]]),Ot={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:L};class Ft{constructor(t,e){this._flowData=t,this._values=e}attach(t){const{context:e}=t,{width:s,height:i}=this._flowData,r=D.createVertex(e,M.STATIC_DRAW,new Uint16Array([0,0,0,1,s,0,1,1,0,i,0,0,s,i,1,0])),o=new Map([["geometry",r]]),n=new N(e,L,It,o),l=[];this._values.color.kind==="ramp"&&l.push("vvColor"),this._values.opacity.kind==="ramp"&&l.push("vvOpacity");const u=t.painter.materialManager.getProgram(Ot,l);let p=1e6,c=-1e6;for(let h=0;h0}isCompatible(t){return t instanceof dt&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(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 Nt(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(w.ONE,w.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),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}};const z=new Map;z.set("a_xyts0",0),z.set("a_xyts1",1),z.set("a_typeIdDurationSeed",2),z.set("a_extrudeInfo",3);const kt=new Map([["geometry",[new x("a_xyts0",4,m.FLOAT,0,64),new x("a_xyts1",4,m.FLOAT,16,64),new x("a_typeIdDurationSeed",4,m.FLOAT,32,64),new x("a_extrudeInfo",4,m.FLOAT,48,64)]]]),Lt={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:z};let Nt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,z,kt,i,s),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=a.painter.materialManager.getProgram(Lt,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.compiled}},$t=class ut{constructor(t){this._styles=t}get animated(){return this._styles.reduce((t,e)=>t||e.animated,!1)}isCompatible(t){if(!(t instanceof ut)||this._styles.length!==t._styles.length)return!1;const e=this._styles.length;for(let s=0;si.load(t,e)));return new Gt(s)}render(t,e,s){for(let i=0;ia&&t.ready,!0)}};class j{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof j&&ct(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;W(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 Wt(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(w.ONE,w.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),A(r,"color","vec4",this._params.color),A(r,"opacity","float",this._params.opacity),A(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(U.TRIANGLES,s.indexCount,m.UNSIGNED_INT,0)}}const P=new Map;P.set("a_positionAndSide",0),P.set("a_timeInfo",1),P.set("a_extrude",2),P.set("a_speed",3);const Ht=new Map([["geometry",[new x("a_positionAndSide",3,m.FLOAT,0,36),new x("a_timeInfo",3,m.FLOAT,12,36),new x("a_extrude",2,m.FLOAT,24,36),new x("a_speed",1,m.FLOAT,32,36)]]]),qt={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:P};let Wt=class{constructor(a,t,e){this._vertexData=a,this._indexData=t,this._values=e}attach(a){const{context:t}=a,e=D.createVertex(t,M.STATIC_DRAW,this._vertexData),s=D.createIndex(t,M.STATIC_DRAW,this._indexData),i=new Map([["geometry",e]]),r=new N(t,P,Ht,i,s),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=a.painter.materialManager.getProgram(qt,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.compiled}};const jt=4,Bt=1,Zt=.5,Jt=!0,Kt=!0,Qt=2.3;function Xt(a,t){const{flowSpeed:e,trailLength:s}=a,i=Tt(a);let r=null;const o={opacity:Pt(a),size:q(a)};let n=zt(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 p={loadImagery:t.loadImagery,timeExtent:t.timeExtent,color:n,opacity:{kind:"constant",value:[1]}};r=new Ut(p),o.color=Vt()}const l={loadImagery:t.loadImagery,createFlowMesh:t.createFlowMesh,simulationSettings:i,timeExtent:t.timeExtent,trailLength:s,flowSpeed:e,featheringSize:Bt,featheringOffset:Zt,introFade:Jt,fadeToZero:Kt,decayRate:Qt,color:o.color,opacity:o.opacity,size:o.size},u=a.trailCap==="butt"||nt(q(a))<=jt?new j(l):new Ct(l);return r!=null?new $t([r,u]):u}class Yt extends it{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:k(),displayViewMat3:k()}}dispose(){}prepareState(t){const{context:e}=t;e.setColorMask(!0,!0,!0,!0),e.setStencilFunction(st.EQUAL,0,255)}draw(t,e){const{requestRender:s,allowDelayedRender:i}=t,{displayData:r}=e;if(r==null||(r.state.name==="loaded"&&r.attach(t),r.state.name!=="attached"))return;const o=r.state.resources;!i||o.ready||s==null?(this._visualState.time=t.time/1e3,this._visualState.dvsMat3=e.transforms.displayViewScreenMat3,this._visualState.displayViewMat3=t.state.displayViewMat3,r.flowStyle.render(t,this._visualState,o),r.flowStyle.animated&&s!=null&&s()):s()}}class te extends St{constructor(){super(...arguments),this.flowStyle=null}doRender(t){super.doRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"flow",brushes:[Yt],target:()=>this.children,drawPhase:xt.MAP});return[...super.prepareRenderPasses(t),e]}}class ee{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 at.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 ae extends ot{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){this._displayData!=null&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(t){const{displayData:e}=this;if(e==null)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=H(t.rotation),{displayViewScreenMat3:l}=this.transforms;At(l,[-1,1,0]),K(l,l,[2/(t.size[0]*t.pixelRatio),-2/(t.size[1]*t.pixelRatio),1]),C(l,l,[r[0],r[1],0]),rt(l,l,n),K(l,l,[o*t.pixelRatio,o*t.pixelRatio,1])}_createTransforms(){return{displayViewScreenMat3:k()}}}const se=1.15;let T=class extends et{constructor(a){super(a),this._flowDisplayObject=new ae,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(t==null)return void this._clear();const{extent:e,rotation:s,resolution:i,pixelRatio:r}=a.state,o=re(e,s);o.expand(se);const n=[Math.round((o.xmax-o.xmin)/i),Math.round((o.ymax-o.ymin)/i)],l=new ee(t,o,n,r);if(this._loading!=null){if(this._loading.update(l))return;this._loading.detach(),this._loading=null}this._flowDisplayObject.displayData!=null&&this._flowDisplayObject.displayData.update(l)||(l.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},u=>{mt(u)||(at.getLogger(this).error("A resource failed to load.",u),this._loading=null)}),this._loading=l)}_clear(){this._flowDisplayObject.clear(),this._loading!=null&&(this._loading.detach(),this._loading=null)}};_([g()],T.prototype,"_loading",void 0),_([g()],T.prototype,"flowContainer",void 0),_([g()],T.prototype,"updating",null),T=_([tt("esri.views.2d.engine.flow.FlowStrategy")],T);const ie=T;function re(a,t){const e=new pt({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(H(t))),o=Math.abs(Math.sin(H(t))),n=r*s+o*i,l=o*s+r*i,u=new ft({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 y=class extends et{constructor(){super(...arguments),this._loadImagery=(a,t,e,s,i)=>B(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.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this.attached||this._strategy.updating}attach(){const{layer:a}=this,t=()=>{this._loadImagery=(e,s,i,r,o)=>B(a,e,s,i,r,o),this._updateVisualization()};"multidimensionalDefinition"in a?this.addHandles(I(()=>a.multidimensionalDefinition,t)):this.addHandles([I(()=>a.mosaicRule,t),I(()=>a.rasterFunction,t),I(()=>a.definitionExpression,t)]),this.container=new te,this._strategy=new ie({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container?.removeAllChildren(),this.container=null,this.removeHandles()}update(a){a.stationary?this._strategy.update(a):this.layerView.requestUpdate()}hitTest(a){return new _t({attributes:{},geometry:a.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const a=this.layer.renderer;if(a==null||a.type!=="flow")return;const t=Xt(a,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};_([g()],y.prototype,"_strategy",void 0),_([g()],y.prototype,"attached",void 0),_([g()],y.prototype,"container",void 0),_([g()],y.prototype,"layer",void 0),_([g()],y.prototype,"layerView",void 0),_([g()],y.prototype,"type",void 0),_([g()],y.prototype,"updating",null),_([g()],y.prototype,"timeExtent",void 0),y=_([tt("esri.views.2d.engine.flow.FlowView2D")],y);const we=y,F=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]),X=new Float32Array([0,92/255,230/255,1]),oe={beaufort_ft:F,beaufort_m:F,beaufort_km:F,beaufort_mi:F,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]),simple_scalar:X,single_arrow:X,wind_speed:new Float32Array([0,0,0,1])},Y=[0,20];class xe extends it{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:t}){t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0),t.setStencilWriteMask(0),t.setStencilTestEnabled(!0),t.setStencilOp($.KEEP,$.KEEP,$.REPLACE)}draw(t,e){if(e.source==null||e.source.validPixelCount===0)return;const{context:s,timeline:i}=t;if(i.begin(this.name),s.setStencilFunction(st.EQUAL,e.stencilRef,255),e.updateVectorFieldVAO(t),t.renderPass==="scalar"){const r=e.vaoData.scalar;r&&this._drawScalars(t,e,r.vao,r.elementCount)}else{const r=e.vaoData.magdir;r&&this._drawTriangles(t,e,r.vao,r.elementCount)}i.end(this.name)}_drawTriangles(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=u.dataRange?["dataRange"]:[];u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.magdir,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{style:h,dataRange:d,rotation:S,symbolPercentRange:b}=u;c.setUniform4fv("u_colors",oe[h]),c.setUniform2fv("u_dataRange",d||Y),c.setUniform1f("u_rotation",S),c.setUniform2fv("u_symbolPercentRange",b);const R=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",R),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_drawScalars(t,e,s,i){const{context:r,painter:o,requestRender:n,allowDelayedRender:l}=t,{symbolizerParameters:u}=e,p=[];u.style==="wind_speed"?p.push("innerCircle"):u.dataRange&&p.push("dataRange"),u.rotationType==="geographic"&&p.push("rotationGeographic");const c=o.materialManager.getProgram(this._desc.scalar,p);if(l&&n!=null&&!c.compiled)return void n();r.useProgram(c);const{coordScale:f,opacity:v,transforms:E}=e;c.setUniform2fv("u_coordScale",f),c.setUniform1f("u_opacity",v),c.setUniformMatrix3fv("u_dvsMat3",E.displayViewScreenMat3);const{dataRange:h,symbolPercentRange:d}=u;c.setUniform2fv("u_dataRange",h||Y),c.setUniform2fv("u_symbolPercentRange",d);const S=this._getSymbolSize(t,e);c.setUniform2fv("u_symbolSize",S),r.bindVAO(s),r.drawElements(U.TRIANGLES,i,m.UNSIGNED_INT,0)}_getSymbolSize(t,e){const s=e.key?2**(t.displayLevel-e.key.level):e.resolution/t.state.resolution,{symbolTileSize:i}=e.symbolizerParameters;return[i/(Math.round((e.width-e.offset[0])/i)*i)/s,i/(Math.round((e.height-e.offset[1])/i)*i)/s]}}class Se extends ot{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.key=null,this.offset=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.vaoData=null,this.width=null,this.source=t}destroy(){this.vaoData!=null&&(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.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(){this._vaoInvalidated||this.vaoData==null||(this.vaoData.magdir?.vao.dispose(),this.vaoData.scalar?.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,this.source!=null&&this.vaoData==null){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=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:i}}break;case"simple_scalar":{const s=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={scalar:i}}break;case"wind_speed":{const s=Z(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s),r=J(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(t.context,r);this.vaoData={magdir:i,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{displayViewScreenMat3:k()}}setTransform(t){const e=bt(this.transforms.displayViewScreenMat3),[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;C(e,e,O(s,i)),C(e,e,O(o/2,n/2)),rt(e,e,-l),C(e,e,O(-o/2,-n/2)),Dt(e,e,O(o,n)),Mt(this.transforms.displayViewScreenMat3,t.displayViewMat3,e)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:s,indexData:i}=e,r=D.createVertex(t,M.STATIC_DRAW,new Float32Array(s)),o=D.createIndex(t,M.STATIC_DRAW,new Uint32Array(i)),n=Rt("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:m.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:m.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:m.FLOAT,normalized:!1}]});return{vao:new N(t,n.attributes,n.bufferLayouts,new Map([["geometry",r]]),o),elementCount:i.length}}}export{Se as c,xe as l,we as o}; diff --git a/custom-toc-highlight/assets/RasterWorker-CzIELPA8-rYzNCfmE.js b/custom-toc-highlight/assets/RasterWorker-CzIELPA8-Co7HHa3v.js similarity index 82% rename from custom-toc-highlight/assets/RasterWorker-CzIELPA8-rYzNCfmE.js rename to custom-toc-highlight/assets/RasterWorker-CzIELPA8-Co7HHa3v.js index 1a553f2f..be6b6eaa 100644 --- a/custom-toc-highlight/assets/RasterWorker-CzIELPA8-rYzNCfmE.js +++ b/custom-toc-highlight/assets/RasterWorker-CzIELPA8-Co7HHa3v.js @@ -1 +1 @@ -import{v as f,bz as p,i as u,n as a,w as S}from"./story-BfX8CRfG.js";import{s as d}from"./projection-BA9M1R7d-BYoCXVXt.js";import{D as i,w as y,y as x,k as h,f as O,A as N,M as J,v,R as w}from"./dataUtils-BkPy4R3C-Cb9EIxnj.js";import{d as k,V as B,t as P,S as b}from"./RasterSymbolizer-BVys6HkM-BrCOeMHl.js";import{h as g,q as z,x as D,v as T}from"./PolynomialTransform-C3nWCu0l-CtkqeHeV.js";import{$ as R,L as F,K as G}from"./rasterProjectionHelper-Calp0o_1-DktPwJyi.js";import"./main-ugzBrWNm.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";var m;let l=m=class extends z{constructor(){super(...arguments),this.type="identity"}clone(){return new m}};f([p({IdentityXform:"identity"})],l.prototype,"type",void 0),l=m=f([u("esri.layers.support.rasterTransforms.IdentityTransform")],l);const I=l,A={GCSShiftXform:D,IdentityXform:I,PolynomialXform:T};function j(n){if(!n?.type)return null;const r=A[n?.type];if(r){const t=new r;return t.read(n),t}return null}class rr{convertVectorFieldData(r){const t=i.fromJSON(r.pixelBlock),s=y(t,r.type);return Promise.resolve(s!=null?s.toJSON():null)}computeStatisticsHistograms(r){const t=i.fromJSON(r.pixelBlock),s=k(t);return Promise.resolve(s)}async decode(r){const t=await B(r.data,r.options);return t&&t.toJSON()}symbolize(r){r.pixelBlock=i.fromJSON(r.pixelBlock),r.extent=r.extent?a.fromJSON(r.extent):null;const t=this.symbolizer.symbolize(r);return Promise.resolve(t!=null?t.toJSON():null)}async updateSymbolizer(r){this.symbolizer=P.fromJSON(r.symbolizerJSON),r.histograms&&this.symbolizer?.rendererJSON.type==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=r.histograms)}async updateRasterFunction(r){this.rasterFunction=g(r.rasterFunctionJSON)}async process(r){const t=this.rasterFunction.process({extent:a.fromJSON(r.extent),primaryPixelBlocks:r.primaryPixelBlocks.map(s=>s!=null?i.fromJSON(s):null),primaryPixelSizes:r.primaryPixelSizes?.map(s=>s!=null?S.fromJSON(s):null),primaryRasterIds:r.primaryRasterIds});return t!=null?t.toJSON():null}stretch(r){const t=this.symbolizer.simpleStretch(i.fromJSON(r.srcPixelBlock),r.stretchParams);return Promise.resolve(t?.toJSON())}estimateStatisticsHistograms(r){const t=b(i.fromJSON(r.srcPixelBlock));return Promise.resolve(t)}split(r){const t=x(i.fromJSON(r.srcPixelBlock),r.tileSize,r.maximumPyramidLevel??0,r.useBilinear===!1);return t&&t.forEach((s,e)=>{t.set(e,s?.toJSON())}),Promise.resolve(t)}clipTile(r){const t=i.fromJSON(r.pixelBlock),s=h({...r,pixelBlock:t});return Promise.resolve(s?.toJSON())}async mosaicAndTransform(r){const t=r.srcPixelBlocks.map(c=>c?new i(c):null),s=O(t,r.srcMosaicSize,{blockWidths:r.blockWidths,alignmentInfo:r.alignmentInfo,clipOffset:r.clipOffset,clipSize:r.clipSize});let e,o=s;return r.coefs&&(o=N(s,r.destDimension,r.coefs,r.sampleSpacing,r.interpolation)),r.projectDirections&&r.gcsGrid&&(e=J(r.destDimension,r.gcsGrid),o=v(o,r.isUV?"vector-uv":"vector-magdir",e)),{pixelBlock:o?.toJSON(),localNorthDirections:e}}async createFlowMesh(r,t){const s={data:new Float32Array(r.flowData.buffer),mask:new Uint8Array(r.flowData.maskBuffer),width:r.flowData.width,height:r.flowData.height},{vertexData:e,indexData:o}=await w(r.meshType,r.simulationSettings,s,t.signal);return{result:{vertexBuffer:e.buffer,indexBuffer:o.buffer},transferList:[e.buffer,o.buffer]}}async getProjectionOffsetGrid(r){const t=a.fromJSON(r.projectedExtent),s=a.fromJSON(r.srcBufferExtent);let e=null;r.datumTransformationSteps&&(e=new d({steps:r.datumTransformationSteps})),(r.includeGCSGrid||R(t.spatialReference,s.spatialReference,e))&&await F();const o=r.rasterTransform?j(r.rasterTransform):null;return G({...r,projectedExtent:t,srcBufferExtent:s,datumTransformation:e,rasterTransform:o})}}export{rr as default}; +import{v as f,bz as p,i as u,n as a,w as S}from"./story-Doly9N9p.js";import{s as d}from"./projection-BA9M1R7d-CAbqHZiw.js";import{D as i,w as y,y as x,k as h,f as O,A as N,M as J,v,R as w}from"./dataUtils-BkPy4R3C-Dzc1QGGb.js";import{d as k,V as B,t as P,S as b}from"./RasterSymbolizer-BVys6HkM-DCN-TPRo.js";import{h as g,q as z,x as D,v as T}from"./PolynomialTransform-C3nWCu0l-BJIAAiDA.js";import{$ as R,L as F,K as G}from"./rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js";import"./main-QGPoLsvl.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";var m;let l=m=class extends z{constructor(){super(...arguments),this.type="identity"}clone(){return new m}};f([p({IdentityXform:"identity"})],l.prototype,"type",void 0),l=m=f([u("esri.layers.support.rasterTransforms.IdentityTransform")],l);const I=l,A={GCSShiftXform:D,IdentityXform:I,PolynomialXform:T};function j(n){if(!n?.type)return null;const r=A[n?.type];if(r){const t=new r;return t.read(n),t}return null}class rr{convertVectorFieldData(r){const t=i.fromJSON(r.pixelBlock),s=y(t,r.type);return Promise.resolve(s!=null?s.toJSON():null)}computeStatisticsHistograms(r){const t=i.fromJSON(r.pixelBlock),s=k(t);return Promise.resolve(s)}async decode(r){const t=await B(r.data,r.options);return t&&t.toJSON()}symbolize(r){r.pixelBlock=i.fromJSON(r.pixelBlock),r.extent=r.extent?a.fromJSON(r.extent):null;const t=this.symbolizer.symbolize(r);return Promise.resolve(t!=null?t.toJSON():null)}async updateSymbolizer(r){this.symbolizer=P.fromJSON(r.symbolizerJSON),r.histograms&&this.symbolizer?.rendererJSON.type==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=r.histograms)}async updateRasterFunction(r){this.rasterFunction=g(r.rasterFunctionJSON)}async process(r){const t=this.rasterFunction.process({extent:a.fromJSON(r.extent),primaryPixelBlocks:r.primaryPixelBlocks.map(s=>s!=null?i.fromJSON(s):null),primaryPixelSizes:r.primaryPixelSizes?.map(s=>s!=null?S.fromJSON(s):null),primaryRasterIds:r.primaryRasterIds});return t!=null?t.toJSON():null}stretch(r){const t=this.symbolizer.simpleStretch(i.fromJSON(r.srcPixelBlock),r.stretchParams);return Promise.resolve(t?.toJSON())}estimateStatisticsHistograms(r){const t=b(i.fromJSON(r.srcPixelBlock));return Promise.resolve(t)}split(r){const t=x(i.fromJSON(r.srcPixelBlock),r.tileSize,r.maximumPyramidLevel??0,r.useBilinear===!1);return t&&t.forEach((s,e)=>{t.set(e,s?.toJSON())}),Promise.resolve(t)}clipTile(r){const t=i.fromJSON(r.pixelBlock),s=h({...r,pixelBlock:t});return Promise.resolve(s?.toJSON())}async mosaicAndTransform(r){const t=r.srcPixelBlocks.map(c=>c?new i(c):null),s=O(t,r.srcMosaicSize,{blockWidths:r.blockWidths,alignmentInfo:r.alignmentInfo,clipOffset:r.clipOffset,clipSize:r.clipSize});let e,o=s;return r.coefs&&(o=N(s,r.destDimension,r.coefs,r.sampleSpacing,r.interpolation)),r.projectDirections&&r.gcsGrid&&(e=J(r.destDimension,r.gcsGrid),o=v(o,r.isUV?"vector-uv":"vector-magdir",e)),{pixelBlock:o?.toJSON(),localNorthDirections:e}}async createFlowMesh(r,t){const s={data:new Float32Array(r.flowData.buffer),mask:new Uint8Array(r.flowData.maskBuffer),width:r.flowData.width,height:r.flowData.height},{vertexData:e,indexData:o}=await w(r.meshType,r.simulationSettings,s,t.signal);return{result:{vertexBuffer:e.buffer,indexBuffer:o.buffer},transferList:[e.buffer,o.buffer]}}async getProjectionOffsetGrid(r){const t=a.fromJSON(r.projectedExtent),s=a.fromJSON(r.srcBufferExtent);let e=null;r.datumTransformationSteps&&(e=new d({steps:r.datumTransformationSteps})),(r.includeGCSGrid||R(t.spatialReference,s.spatialReference,e))&&await F();const o=r.rasterTransform?j(r.rasterTransform):null;return G({...r,projectedExtent:t,srcBufferExtent:s,datumTransformation:e,rasterTransform:o})}}export{rr as default}; diff --git a/custom-toc-highlight/assets/RawBlockCache-Cj_tmHDm-CHpXSnmO.js b/custom-toc-highlight/assets/RawBlockCache-Cj_tmHDm-gcQCDGFb.js similarity index 97% rename from custom-toc-highlight/assets/RawBlockCache-Cj_tmHDm-CHpXSnmO.js rename to custom-toc-highlight/assets/RawBlockCache-Cj_tmHDm-gcQCDGFb.js index 9dfd66cb..6040b041 100644 --- a/custom-toc-highlight/assets/RawBlockCache-Cj_tmHDm-CHpXSnmO.js +++ b/custom-toc-highlight/assets/RawBlockCache-Cj_tmHDm-gcQCDGFb.js @@ -1 +1 @@ -import{w as Q}from"./story-BfX8CRfG.js";import{o as E,W as G,Q as K}from"./rasterProjectionHelper-Calp0o_1-DktPwJyi.js";class L{constructor(n=15e3,e=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=n,this._interval=Math.min(n,e)}decreaseRefCount(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.refCount--,l.refCount<=0&&(r.delete(t),l.controller&&l.controller.abort()),l.refCount}return 0}getBlock(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.ts=Date.now(),l.refCount++,r.delete(t),r.set(t,l),l.block}return null}putBlock(n,e,t,r){const l=this._cachedBlocks,c=n+"/"+e;if(l.has(c)){const i=l.get(c);i.ts=Date.now(),i.refCount++}else l.set(c,{block:t,ts:Date.now(),refCount:1,controller:r});this._trim(),this._updateTimer()}deleteBlock(n,e){const t=this._cachedBlocks,r=n+"/"+e;t.has(r)&&t.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 e=Array.from(n),t=Date.now();for(let r=0;r=n.size)return;const e=Array.from(n);for(let t=0;tt!=null)||u.delete(o))}function Z(o,n,e){const t=u.get(o);if(!t)return n==null?h.decreaseRefCount(o,e):0;if(n==null||t[n]==null)return h.decreaseRefCount(o,e);const r=t[n]?.cache,l=r?.get(e);if(r&&l){if(l.refCount--,l.refCount===0){r.delete(e);for(let c=0;cc.isResolved=!0).catch(()=>c.isRejected=!0),l[n]?.cache.set(e,c)}function J(o,n,e){const t=u.get(o);t?n!=null&&t[n]!=null?t[n]?.cache.delete(e):h.deleteBlock(o,e):n==null&&h.deleteBlock(o,e)}function O(o,n){const e=u.get(o);return e?e[n]??null:null}function N(o,n,e,t,r,l,c=null){const i=O(o,n);if(!i)return;const f=i.extent,{cache:k,rasterInfo:y}=i;if(f&&f.xmin===e.xmin&&f.xmax===e.xmax&&f.ymin===e.ymin&&f.ymax===e.ymax)return;t=t??0;const M=e.clone().normalize(),{spatialReference:R,transform:v}=y,w=new Set;for(let d=0;d0?m.pyramidBlockWidth:m.blockWidth,I=p>0?m.pyramidBlockHeight:m.blockHeight,g=1,j=Math.max(0,Math.floor(_.x/b)-g),S=Math.max(0,Math.floor(_.y/I)-g),A=Math.floor((_.x+D-1)/b)+g,H=Math.floor((_.y+W-1)/I)+g;for(let B=S;B<=H;B++)for(let C=j;C<=A;C++)w.add(`${p}/${B}/${C}`)}k.forEach((d,a)=>{if(!w.has(a)){const s=k.get(a);(s==null||s.isResolved||s.isRejected)&&k.delete(a)}}),i.extent={xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax}}export{V as K,X as O,Y as P,Z as Q,q as U,F as V,J as X,N as Z}; +import{w as Q}from"./story-Doly9N9p.js";import{o as E,W as G,Q as K}from"./rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js";class L{constructor(n=15e3,e=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=n,this._interval=Math.min(n,e)}decreaseRefCount(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.refCount--,l.refCount<=0&&(r.delete(t),l.controller&&l.controller.abort()),l.refCount}return 0}getBlock(n,e){const t=n+"/"+e,r=this._cachedBlocks;if(r.has(t)){const l=r.get(t);return l.ts=Date.now(),l.refCount++,r.delete(t),r.set(t,l),l.block}return null}putBlock(n,e,t,r){const l=this._cachedBlocks,c=n+"/"+e;if(l.has(c)){const i=l.get(c);i.ts=Date.now(),i.refCount++}else l.set(c,{block:t,ts:Date.now(),refCount:1,controller:r});this._trim(),this._updateTimer()}deleteBlock(n,e){const t=this._cachedBlocks,r=n+"/"+e;t.has(r)&&t.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 e=Array.from(n),t=Date.now();for(let r=0;r=n.size)return;const e=Array.from(n);for(let t=0;tt!=null)||u.delete(o))}function Z(o,n,e){const t=u.get(o);if(!t)return n==null?h.decreaseRefCount(o,e):0;if(n==null||t[n]==null)return h.decreaseRefCount(o,e);const r=t[n]?.cache,l=r?.get(e);if(r&&l){if(l.refCount--,l.refCount===0){r.delete(e);for(let c=0;cc.isResolved=!0).catch(()=>c.isRejected=!0),l[n]?.cache.set(e,c)}function J(o,n,e){const t=u.get(o);t?n!=null&&t[n]!=null?t[n]?.cache.delete(e):h.deleteBlock(o,e):n==null&&h.deleteBlock(o,e)}function O(o,n){const e=u.get(o);return e?e[n]??null:null}function N(o,n,e,t,r,l,c=null){const i=O(o,n);if(!i)return;const f=i.extent,{cache:k,rasterInfo:y}=i;if(f&&f.xmin===e.xmin&&f.xmax===e.xmax&&f.ymin===e.ymin&&f.ymax===e.ymax)return;t=t??0;const M=e.clone().normalize(),{spatialReference:R,transform:v}=y,w=new Set;for(let d=0;d0?m.pyramidBlockWidth:m.blockWidth,I=p>0?m.pyramidBlockHeight:m.blockHeight,g=1,j=Math.max(0,Math.floor(_.x/b)-g),S=Math.max(0,Math.floor(_.y/I)-g),A=Math.floor((_.x+D-1)/b)+g,H=Math.floor((_.y+W-1)/I)+g;for(let B=S;B<=H;B++)for(let C=j;C<=A;C++)w.add(`${p}/${B}/${C}`)}k.forEach((d,a)=>{if(!w.has(a)){const s=k.get(a);(s==null||s.isResolved||s.isRejected)&&k.delete(a)}}),i.extent={xmin:e.xmin,ymin:e.ymin,xmax:e.xmax,ymax:e.ymax}}export{V as K,X as O,Y as P,Z as Q,q as U,F as V,J as X,N as Z}; diff --git a/custom-toc-highlight/assets/ReactiveMap-CFk6jPfN-Du1XE-2a.js b/custom-toc-highlight/assets/ReactiveMap-CFk6jPfN-CSefy1PZ.js similarity index 92% rename from custom-toc-highlight/assets/ReactiveMap-CFk6jPfN-Du1XE-2a.js rename to custom-toc-highlight/assets/ReactiveMap-CFk6jPfN-CSefy1PZ.js index ddb52b4c..138e8431 100644 --- a/custom-toc-highlight/assets/ReactiveMap-CFk6jPfN-Du1XE-2a.js +++ b/custom-toc-highlight/assets/ReactiveMap-CFk6jPfN-CSefy1PZ.js @@ -1 +1 @@ -import{cU as i,cV as e}from"./story-BfX8CRfG.js";class b{constructor(t){this._observable=new i,this._map=new Map(t)}get size(){return e(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(t){const s=this._map.delete(t);return s&&this._observable.notify(),s}entries(){return e(this._observable),this._map.entries()}forEach(t,s){e(this._observable),this._map.forEach((r,a)=>t.call(s,r,a,this),s)}get(t){return e(this._observable),this._map.get(t)}has(t){return e(this._observable),this._map.has(t)}keys(){return e(this._observable),this._map.keys()}set(t,s){return this._map.set(t,s),this._observable.notify(),this}values(){return e(this._observable),this._map.values()}[Symbol.iterator](){return e(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}export{b as h}; +import{cU as i,cV as e}from"./story-Doly9N9p.js";class b{constructor(t){this._observable=new i,this._map=new Map(t)}get size(){return e(this._observable),this._map.size}clear(){this._map.size>0&&(this._map.clear(),this._observable.notify())}delete(t){const s=this._map.delete(t);return s&&this._observable.notify(),s}entries(){return e(this._observable),this._map.entries()}forEach(t,s){e(this._observable),this._map.forEach((r,a)=>t.call(s,r,a,this),s)}get(t){return e(this._observable),this._map.get(t)}has(t){return e(this._observable),this._map.has(t)}keys(){return e(this._observable),this._map.keys()}set(t,s){return this._map.set(t,s),this._observable.notify(),this}values(){return e(this._observable),this._map.values()}[Symbol.iterator](){return e(this._observable),this._map[Symbol.iterator]()}get[Symbol.toStringTag](){return this._map[Symbol.toStringTag]}}export{b as h}; diff --git a/custom-toc-highlight/assets/ReactiveSet-QxEZenFW-DlICHtLT.js b/custom-toc-highlight/assets/ReactiveSet-QxEZenFW-tC7C9rTp.js similarity index 96% rename from custom-toc-highlight/assets/ReactiveSet-QxEZenFW-DlICHtLT.js rename to custom-toc-highlight/assets/ReactiveSet-QxEZenFW-tC7C9rTp.js index 9b820ded..ba19a8e6 100644 --- a/custom-toc-highlight/assets/ReactiveSet-QxEZenFW-DlICHtLT.js +++ b/custom-toc-highlight/assets/ReactiveSet-QxEZenFW-tC7C9rTp.js @@ -1 +1 @@ -import{G as g}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{c as x}from"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import{iO as b,cU as T,cV as a,di as o,c3 as l,c2 as z,ae as B,iP as p,iQ as v,iR as d,iS as S,iT as V,iU as M}from"./story-BfX8CRfG.js";function $(r,t){return{type:b(t),value:r,unit:t}}function Z(r){return{value:r}}function w(r,t){return{type:b(t),value:r,unit:t}}function G(r,t){return{type:b(t),value:r,unit:t}}function h(r,t,e="arithmetic"){return{type:b(t),value:r,unit:t,rotationType:e}}function q(r,t){const e=N(r,t);return r.type==="angle"?h(e,t,r.rotationType):$(e,t)}function N(r,t){return o(r.value,r.unit,t)}function O(r,t,e){if(t===e)return r;switch(e){case"arithmetic":case"geographic":return 90-r}}const K=w(0,"meters"),P=G(0,"square-meters");h(0,"radians");const Y=h(0,"degrees"),J=h(0,"degrees","geographic");function D(r,t,e){return r.units[t][e]}function u(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:t>0?"never":"exceptZero"})} ${D(r,e,s)}`}function m(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:"exceptZero"})} ${D(r,e,s)}`}function Q(r,t,e,n=2,s="abbr"){const i=p(t,e);return u(r,o(t,e,i),i,n,s)}function R(r,t,e,n=2,s="abbr"){const i=p(t,e);return m(r,o(t,e,i),i,n,s)}function X(r,t,e,n=2,s="abbr"){const i=v(t,e);return u(r,o(t,e,i),i,n,s)}function j(r,t,e,n=2,s="abbr"){const i=v(t,e);return m(r,o(t,e,i),i,n,s)}function A(r,t,e,n=2,s="abbr"){const i=d(t,e);return u(r,o(t,e,i),i,n,s)}function C(r,t,e,n=2,s="abbr"){const i=d(t,e);return m(r,o(t,e,i),i,n,s)}function H(r,t,e,n=2,s="abbr"){const i=S(t,e);return u(r,o(t,e,i),i,n,s)}function W(r,t,e,n=2,s="abbr"){const i=S(t,e);return m(r,o(t,e,i),i,n,s)}function tt(r,t,e,n=2,s="abbr"){const i=V(t,e);return u(r,o(t,e,i),i,n,s)}function et(r,t,e,n=2,s="abbr"){const i=M(t,e);return u(r,o(t,e,i),i,n,s)}const k=(r,t)=>({style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:t,minimumFractionDigits:t,signDisplay:r>0?"never":"exceptZero"});function rt(r,t,e,n,s,i=x,F=!0){let c=i.normalize(O(o(r,t,"degrees"),e,n),0,F);const f=k(c,s??2);return c=E(c,f),l(c,f)}const _=new Map;function E(r,t){const e=JSON.stringify(t);let n=_.get(e);return n||(n=new Intl.NumberFormat("en-US",t),_.set(e,n)),/^[-+]?360\.?0*°?$/.test(n.format(r))?0:r}const y=["B","kB","MB","GB","TB"];function nt(r,t){let e=(t=Math.round(t))===0?0:Math.floor(Math.log(t)/Math.log(g.KILOBYTES));e=B(e,0,y.length-1);const n=l(t/g.KILOBYTES**e,{maximumFractionDigits:2});return z(r.units.bytes[y[e]],{fileSize:n})}class it{constructor(t){this._observable=new T,this._set=new Set(t)}get size(){return a(this._observable),this._set.size}add(t){const e=this._set.size;return this._set.add(t),this._set.size!==e&&this._observable.notify(),this}clear(){this._set.size>0&&(this._set.clear(),this._observable.notify())}delete(t){const e=this._set.delete(t);return e&&this._observable.notify(),e}entries(){return a(this._observable),this._set.entries()}forEach(t,e){a(this._observable),this._set.forEach((n,s)=>t.call(e,n,s,this),e)}has(t){return a(this._observable),this._set.has(t)}keys(){return a(this._observable),this._set.keys()}values(){return a(this._observable),this._set.values()}[Symbol.iterator](){return a(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}}export{H as A,W as C,w as D,O as F,tt as G,et as H,A as J,q as K,K as L,P as N,Y as P,J as Q,Q as R,G as S,Z as U,rt as W,R as Y,X as Z,m as b,h as c,C as j,D as m,j as q,it as s,nt as t,u,N as x}; +import{G as g}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{c as x}from"./Cyclical-C_9rKUUQ-DyGueJyk.js";import{iO as b,cU as T,cV as a,di as o,c3 as l,c2 as z,ae as B,iP as p,iQ as v,iR as d,iS as S,iT as V,iU as M}from"./story-Doly9N9p.js";function $(r,t){return{type:b(t),value:r,unit:t}}function Z(r){return{value:r}}function w(r,t){return{type:b(t),value:r,unit:t}}function G(r,t){return{type:b(t),value:r,unit:t}}function h(r,t,e="arithmetic"){return{type:b(t),value:r,unit:t,rotationType:e}}function q(r,t){const e=N(r,t);return r.type==="angle"?h(e,t,r.rotationType):$(e,t)}function N(r,t){return o(r.value,r.unit,t)}function O(r,t,e){if(t===e)return r;switch(e){case"arithmetic":case"geographic":return 90-r}}const K=w(0,"meters"),P=G(0,"square-meters");h(0,"radians");const Y=h(0,"degrees"),J=h(0,"degrees","geographic");function D(r,t,e){return r.units[t][e]}function u(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:t>0?"never":"exceptZero"})} ${D(r,e,s)}`}function m(r,t,e,n=2,s="abbr"){return`${l(t,{minimumFractionDigits:n,maximumFractionDigits:n,signDisplay:"exceptZero"})} ${D(r,e,s)}`}function Q(r,t,e,n=2,s="abbr"){const i=p(t,e);return u(r,o(t,e,i),i,n,s)}function R(r,t,e,n=2,s="abbr"){const i=p(t,e);return m(r,o(t,e,i),i,n,s)}function X(r,t,e,n=2,s="abbr"){const i=v(t,e);return u(r,o(t,e,i),i,n,s)}function j(r,t,e,n=2,s="abbr"){const i=v(t,e);return m(r,o(t,e,i),i,n,s)}function A(r,t,e,n=2,s="abbr"){const i=d(t,e);return u(r,o(t,e,i),i,n,s)}function C(r,t,e,n=2,s="abbr"){const i=d(t,e);return m(r,o(t,e,i),i,n,s)}function H(r,t,e,n=2,s="abbr"){const i=S(t,e);return u(r,o(t,e,i),i,n,s)}function W(r,t,e,n=2,s="abbr"){const i=S(t,e);return m(r,o(t,e,i),i,n,s)}function tt(r,t,e,n=2,s="abbr"){const i=V(t,e);return u(r,o(t,e,i),i,n,s)}function et(r,t,e,n=2,s="abbr"){const i=M(t,e);return u(r,o(t,e,i),i,n,s)}const k=(r,t)=>({style:"unit",unitDisplay:"narrow",unit:"degree",maximumFractionDigits:t,minimumFractionDigits:t,signDisplay:r>0?"never":"exceptZero"});function rt(r,t,e,n,s,i=x,F=!0){let c=i.normalize(O(o(r,t,"degrees"),e,n),0,F);const f=k(c,s??2);return c=E(c,f),l(c,f)}const _=new Map;function E(r,t){const e=JSON.stringify(t);let n=_.get(e);return n||(n=new Intl.NumberFormat("en-US",t),_.set(e,n)),/^[-+]?360\.?0*°?$/.test(n.format(r))?0:r}const y=["B","kB","MB","GB","TB"];function nt(r,t){let e=(t=Math.round(t))===0?0:Math.floor(Math.log(t)/Math.log(g.KILOBYTES));e=B(e,0,y.length-1);const n=l(t/g.KILOBYTES**e,{maximumFractionDigits:2});return z(r.units.bytes[y[e]],{fileSize:n})}class it{constructor(t){this._observable=new T,this._set=new Set(t)}get size(){return a(this._observable),this._set.size}add(t){const e=this._set.size;return this._set.add(t),this._set.size!==e&&this._observable.notify(),this}clear(){this._set.size>0&&(this._set.clear(),this._observable.notify())}delete(t){const e=this._set.delete(t);return e&&this._observable.notify(),e}entries(){return a(this._observable),this._set.entries()}forEach(t,e){a(this._observable),this._set.forEach((n,s)=>t.call(e,n,s,this),e)}has(t){return a(this._observable),this._set.has(t)}keys(){return a(this._observable),this._set.keys()}values(){return a(this._observable),this._set.values()}[Symbol.iterator](){return a(this._observable),this._set[Symbol.iterator]()}get[Symbol.toStringTag](){return this._set[Symbol.toStringTag]}}export{H as A,W as C,w as D,O as F,tt as G,et as H,A as J,q as K,K as L,P as N,Y as P,J as Q,Q as R,G as S,Z as U,rt as W,R as Y,X as Z,m as b,h as c,C as j,D as m,j as q,it as s,nt as t,u,N as x}; diff --git a/custom-toc-highlight/assets/RefreshableLayer-a8BQ58Xh-D1Kebw4J.js b/custom-toc-highlight/assets/RefreshableLayer-a8BQ58Xh-CxfquKbp.js similarity index 93% rename from custom-toc-highlight/assets/RefreshableLayer-a8BQ58Xh-D1Kebw4J.js rename to custom-toc-highlight/assets/RefreshableLayer-a8BQ58Xh-CxfquKbp.js index 28c6d52c..1a3513b7 100644 --- a/custom-toc-highlight/assets/RefreshableLayer-a8BQ58Xh-D1Kebw4J.js +++ b/custom-toc-highlight/assets/RefreshableLayer-a8BQ58Xh-CxfquKbp.js @@ -1 +1 @@ -import{ag as u,dx as c,v as a,S as h,ad as p,i as m,av as v,bp as g,b9 as y,a1 as b}from"./story-BfX8CRfG.js";import{s as I}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";const n=new u,o=new WeakMap;function w(t){D(t)&&n.push(new WeakRef(t))}function C(t){const e=n.find(s=>s.deref()===t);e&&n.remove(e)}function D(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function d(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:d(e,t%e):0}let f=0,i=0;function R(){const t=Date.now();let e=!1;for(const s of n){const r=s.deref();r?r.refreshInterval&&t-(o.get(r)??0)+5>=6e4*r.refreshInterval&&(o.set(r,t),r.refresh(t)):e=!0}if(e)for(let s=n.length-1;s>=0;s--)n.at(s).deref()||n.removeAt(s)}c(()=>{const t=Date.now();let e=0;for(const s of n){const r=s.deref();r&&(e=d(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?o.get(r)||o.set(r,t):o.delete(r))}if(e!==i){if(i=e,clearInterval(f),i===0)return void(f=0);f=setInterval(R,i)}},v);const l=.1,L=t=>{let e=class extends t{constructor(...s){super(...s),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=g(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||w(this)},()=>{})}destroy(){C(this)}castRefreshInterval(s){return s>=l?s:s<=0?0:l}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(s=Date.now()){y(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",s),this.emit("refresh",{dataChanged:r})},r=>{b.getLogger(this).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}get test(){}};return a([h({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:I}}}}})],e.prototype,"refreshInterval",void 0),a([p("refreshInterval")],e.prototype,"castRefreshInterval",null),a([h({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),a([h({readOnly:!0})],e.prototype,"refreshParameters",null),e=a([m("esri.layers.mixins.RefreshableLayer")],e),e};export{L as T}; +import{ag as u,dx as c,v as a,S as h,ad as p,i as m,av as v,bp as g,b9 as y,a1 as b}from"./story-Doly9N9p.js";import{s as I}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";const n=new u,o=new WeakMap;function w(t){D(t)&&n.push(new WeakRef(t))}function C(t){const e=n.find(s=>s.deref()===t);e&&n.remove(e)}function D(t){return t!=null&&typeof t=="object"&&"refreshInterval"in t&&"refresh"in t}function d(t,e){return Number.isFinite(t)&&Number.isFinite(e)?e<=0?t:d(e,t%e):0}let f=0,i=0;function R(){const t=Date.now();let e=!1;for(const s of n){const r=s.deref();r?r.refreshInterval&&t-(o.get(r)??0)+5>=6e4*r.refreshInterval&&(o.set(r,t),r.refresh(t)):e=!0}if(e)for(let s=n.length-1;s>=0;s--)n.at(s).deref()||n.removeAt(s)}c(()=>{const t=Date.now();let e=0;for(const s of n){const r=s.deref();r&&(e=d(Math.round(6e4*r.refreshInterval),e),r.refreshInterval?o.get(r)||o.set(r,t):o.delete(r))}if(e!==i){if(i=e,clearInterval(f),i===0)return void(f=0);f=setInterval(R,i)}},v);const l=.1,L=t=>{let e=class extends t{constructor(...s){super(...s),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=g(()=>this.hasDataChanged()),this.when().then(()=>{this.destroyed||w(this)},()=>{})}destroy(){C(this)}castRefreshInterval(s){return s>=l?s:s<=0?0:l}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(s=Date.now()){y(this._debounceHasDataChanged()).then(r=>{r&&this._set("refreshTimestamp",s),this.emit("refresh",{dataChanged:r})},r=>{b.getLogger(this).error(r),this.emit("refresh",{dataChanged:!1,error:r})})}async hasDataChanged(){return!0}get test(){}};return a([h({type:Number,json:{write:!0,origins:{"web-scene":{write:{enabled:!0,layerContainerTypes:I}}}}})],e.prototype,"refreshInterval",void 0),a([p("refreshInterval")],e.prototype,"castRefreshInterval",null),a([h({readOnly:!0})],e.prototype,"refreshTimestamp",void 0),a([h({readOnly:!0})],e.prototype,"refreshParameters",null),e=a([m("esri.layers.mixins.RefreshableLayer")],e),e};export{L as T}; diff --git a/custom-toc-highlight/assets/RefreshableLayerView-BdQpGYly-Bg8to7IY.js b/custom-toc-highlight/assets/RefreshableLayerView-BdQpGYly-DxrmlBaQ.js similarity index 63% rename from custom-toc-highlight/assets/RefreshableLayerView-BdQpGYly-Bg8to7IY.js rename to custom-toc-highlight/assets/RefreshableLayerView-BdQpGYly-DxrmlBaQ.js index 73ad4cee..22a75875 100644 --- a/custom-toc-highlight/assets/RefreshableLayerView-BdQpGYly-Bg8to7IY.js +++ b/custom-toc-highlight/assets/RefreshableLayerView-BdQpGYly-DxrmlBaQ.js @@ -1 +1 @@ -import{v as i,i as t,ai as h,aU as l,a1 as d}from"./story-BfX8CRfG.js";const o=r=>{let e=class extends r{initialize(){this.addHandles(h(()=>this.layer,"refresh",s=>{this.doRefresh(s.dataChanged).catch(a=>{l(a)||d.getLogger(this).error(a)})}),"RefreshableLayerView")}};return e=i([t("esri.views.layers.RefreshableLayerView")],e),e};export{o as n}; +import{v as i,i as t,ai as h,aU as l,a1 as d}from"./story-Doly9N9p.js";const o=r=>{let e=class extends r{initialize(){this.addHandles(h(()=>this.layer,"refresh",s=>{this.doRefresh(s.dataChanged).catch(a=>{l(a)||d.getLogger(this).error(a)})}),"RefreshableLayerView")}};return e=i([t("esri.views.layers.RefreshableLayerView")],e),e};export{o as n}; diff --git a/custom-toc-highlight/assets/Relationship-Db9GUmYx-Cq6n6OX7.js b/custom-toc-highlight/assets/Relationship-Db9GUmYx-B84JspfN.js similarity index 97% rename from custom-toc-highlight/assets/Relationship-Db9GUmYx-Cq6n6OX7.js rename to custom-toc-highlight/assets/Relationship-Db9GUmYx-B84JspfN.js index 8157fd42..6fa49828 100644 --- a/custom-toc-highlight/assets/Relationship-Db9GUmYx-Cq6n6OX7.js +++ b/custom-toc-highlight/assets/Relationship-Db9GUmYx-B84JspfN.js @@ -1 +1 @@ -import{v as t,S as r,i as s,w as m,m as v,e as y,j as w}from"./story-BfX8CRfG.js";let p=class extends y{constructor(e){super(e),this.properties=null}};t([r({json:{write:!0}})],p.prototype,"properties",void 0),p=t([s("esri.rest.knowledgeGraph.GraphObject")],p);const c=p;let i=class extends c{constructor(e){super(e),this.typeName=null,this.id=null}};t([r({type:String,json:{write:!0}})],i.prototype,"typeName",void 0),t([r({type:String,json:{write:!0}})],i.prototype,"id",void 0),i=t([s("esri.rest.knowledgeGraph.GraphNamedObject")],i);const h=i;let a=class extends h{constructor(e){super(e),this.layoutGeometry=null}};t([r({type:m,json:{write:!0}})],a.prototype,"layoutGeometry",void 0),a=t([s("esri.rest.knowledgeGraph.Entity")],a);const j=a;let l=class extends w{constructor(e){super(e),this.openCypherQuery=""}};t([r()],l.prototype,"openCypherQuery",void 0),l=t([s("esri.rest.knowledgeGraph.GraphQuery")],l);const G=l;let o=class extends G{constructor(e){super(e),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null,this.outputSpatialReference=null,this.provenanceBehavior=null}};t([r()],o.prototype,"bindParameters",void 0),t([r()],o.prototype,"bindGeometryQuantizationParameters",void 0),t([r()],o.prototype,"outputQuantizationParameters",void 0),t([r()],o.prototype,"outputSpatialReference",void 0),t([r()],o.prototype,"provenanceBehavior",void 0),o=t([s("esri.rest.knowledgeGraph.GraphQueryStreaming")],o);const x=o;let d=class extends c{constructor(e){super(e)}};d=t([s("esri.rest.knowledgeGraph.ObjectValue")],d);const k=d;let u=class extends y{constructor(e){super(e),this.path=null}};t([r({type:[c],json:{write:!0}})],u.prototype,"path",void 0),u=t([s("esri.rest.knowledgeGraph.Path")],u);const b=u;let n=class extends h{constructor(e){super(e),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};t([r({type:String,json:{write:!0}})],n.prototype,"originId",void 0),t([r({type:String,json:{write:!0}})],n.prototype,"destinationId",void 0),t([r({type:v,json:{write:!0}})],n.prototype,"layoutGeometry",void 0),n=t([s("esri.rest.knowledgeGraph.Relationship")],n);const Q=n;export{Q as b,x as j,b as k,j as w,k as x}; +import{v as t,S as r,i as s,w as m,m as v,e as y,j as w}from"./story-Doly9N9p.js";let p=class extends y{constructor(e){super(e),this.properties=null}};t([r({json:{write:!0}})],p.prototype,"properties",void 0),p=t([s("esri.rest.knowledgeGraph.GraphObject")],p);const c=p;let i=class extends c{constructor(e){super(e),this.typeName=null,this.id=null}};t([r({type:String,json:{write:!0}})],i.prototype,"typeName",void 0),t([r({type:String,json:{write:!0}})],i.prototype,"id",void 0),i=t([s("esri.rest.knowledgeGraph.GraphNamedObject")],i);const h=i;let a=class extends h{constructor(e){super(e),this.layoutGeometry=null}};t([r({type:m,json:{write:!0}})],a.prototype,"layoutGeometry",void 0),a=t([s("esri.rest.knowledgeGraph.Entity")],a);const j=a;let l=class extends w{constructor(e){super(e),this.openCypherQuery=""}};t([r()],l.prototype,"openCypherQuery",void 0),l=t([s("esri.rest.knowledgeGraph.GraphQuery")],l);const G=l;let o=class extends G{constructor(e){super(e),this.bindParameters=null,this.bindGeometryQuantizationParameters=null,this.outputQuantizationParameters=null,this.outputSpatialReference=null,this.provenanceBehavior=null}};t([r()],o.prototype,"bindParameters",void 0),t([r()],o.prototype,"bindGeometryQuantizationParameters",void 0),t([r()],o.prototype,"outputQuantizationParameters",void 0),t([r()],o.prototype,"outputSpatialReference",void 0),t([r()],o.prototype,"provenanceBehavior",void 0),o=t([s("esri.rest.knowledgeGraph.GraphQueryStreaming")],o);const x=o;let d=class extends c{constructor(e){super(e)}};d=t([s("esri.rest.knowledgeGraph.ObjectValue")],d);const k=d;let u=class extends y{constructor(e){super(e),this.path=null}};t([r({type:[c],json:{write:!0}})],u.prototype,"path",void 0),u=t([s("esri.rest.knowledgeGraph.Path")],u);const b=u;let n=class extends h{constructor(e){super(e),this.originId=null,this.destinationId=null,this.layoutGeometry=null}};t([r({type:String,json:{write:!0}})],n.prototype,"originId",void 0),t([r({type:String,json:{write:!0}})],n.prototype,"destinationId",void 0),t([r({type:v,json:{write:!0}})],n.prototype,"layoutGeometry",void 0),n=t([s("esri.rest.knowledgeGraph.Relationship")],n);const Q=n;export{Q as b,x as j,b as k,j as w,k as x}; diff --git a/custom-toc-highlight/assets/Relationship-PyhUibYK-BgFx3_5x.js b/custom-toc-highlight/assets/Relationship-PyhUibYK-DN6K3ukS.js similarity index 94% rename from custom-toc-highlight/assets/Relationship-PyhUibYK-BgFx3_5x.js rename to custom-toc-highlight/assets/Relationship-PyhUibYK-DN6K3ukS.js index 80b6771f..0e47bfe5 100644 --- a/custom-toc-highlight/assets/Relationship-PyhUibYK-BgFx3_5x.js +++ b/custom-toc-highlight/assets/Relationship-PyhUibYK-DN6K3ukS.js @@ -1 +1 @@ -import{aK as n,aa as l,e as s,v as i,S as o,i as d}from"./story-BfX8CRfG.js";const t=new n({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),r=new n({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let e=class extends l(s){constructor(a){super(a),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}};i([o({json:{read:t.read,write:t.write}})],e.prototype,"cardinality",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"composite",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"id",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyField",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyFieldInRelationshipTable",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"name",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relatedTableId",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relationshipTableId",void 0),i([o({json:{read:r.read,write:r.write}})],e.prototype,"role",void 0),e=i([d("esri.layers.support.Relationship")],e);const y=e;export{y as p}; +import{aK as n,aa as l,e as s,v as i,S as o,i as d}from"./story-Doly9N9p.js";const t=new n({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),r=new n({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let e=class extends l(s){constructor(a){super(a),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}};i([o({json:{read:t.read,write:t.write}})],e.prototype,"cardinality",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"composite",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"id",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyField",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"keyFieldInRelationshipTable",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"name",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relatedTableId",void 0),i([o({json:{read:!0,write:!0}})],e.prototype,"relationshipTableId",void 0),i([o({json:{read:r.read,write:r.write}})],e.prototype,"role",void 0),e=i([d("esri.layers.support.Relationship")],e);const y=e;export{y as p}; diff --git a/custom-toc-highlight/assets/RelationshipQuery-DJsz3K0U-yAwL-qLW.js b/custom-toc-highlight/assets/RelationshipQuery-DJsz3K0U-BKFa46R1.js similarity index 94% rename from custom-toc-highlight/assets/RelationshipQuery-DJsz3K0U-yAwL-qLW.js rename to custom-toc-highlight/assets/RelationshipQuery-DJsz3K0U-BKFa46R1.js index 3a3fa022..e167b891 100644 --- a/custom-toc-highlight/assets/RelationshipQuery-DJsz3K0U-yAwL-qLW.js +++ b/custom-toc-highlight/assets/RelationshipQuery-DJsz3K0U-BKFa46R1.js @@ -1 +1 @@ -import{v as t,S as e,ac as n,i as d,bG as h,J as c,e as l,P as u}from"./story-BfX8CRfG.js";import{K as y}from"./Query-BrwMGK8U-DoFNfkjX.js";import"./main-ugzBrWNm.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";var a;let r=a=class extends l{constructor(i){super(i),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(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10}clone(){return new a(u({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}))}};t([e({type:[String],json:{write:!0}})],r.prototype,"attachmentTypes",void 0),t([e({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],r.prototype,"attachmentsWhere",void 0),t([e({type:Boolean,json:{write:!0}})],r.prototype,"cacheHint",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"keywords",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"globalIds",void 0),t([e({json:{write:!0}})],r.prototype,"name",void 0),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],r.prototype,"num",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"objectIds",void 0),t([e({type:Boolean,json:{default:!1,write:!0}})],r.prototype,"returnMetadata",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"size",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],r.prototype,"start",void 0),t([n("start"),n("num")],r.prototype,"writeStart",null),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],r.prototype,"where",void 0),r=a=t([d("esri.rest.support.AttachmentQuery")],r),r.from=h(r);const S=r;var p;let o=p=class extends l{constructor(i){super(i),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(i,s){s.historicMoment=i&&i.getTime()}writeStart(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(s.definitionExpression="1=1")}clone(){return new p(u({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}))}};t([e({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),t([e({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),t([e({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),t([e({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),t([e({type:Date})],o.prototype,"historicMoment",void 0),t([n("historicMoment")],o.prototype,"_writeHistoricMoment",null),t([e({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),t([e({json:{write:!0}})],o.prototype,"objectIds",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),t([e({type:c,json:{read:{source:"outSR"},write:{target:"outSR"}}})],o.prototype,"outSpatialReference",void 0),t([e({json:{write:!0}})],o.prototype,"relationshipId",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),t([n("start"),n("num")],o.prototype,"writeStart",null),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),t([e({json:{write:!0}})],o.prototype,"returnGeometry",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnM",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnZ",void 0),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],o.prototype,"where",void 0),o=p=t([d("esri.rest.support.RelationshipQuery")],o),o.from=h(o);const m=o,M=Object.freeze(Object.defineProperty({__proto__:null,default:m},Symbol.toStringTag,{value:"Module"}));export{M as R,S as c,m as d}; +import{v as t,S as e,ac as n,i as d,bG as h,J as c,e as l,P as u}from"./story-Doly9N9p.js";import{K as y}from"./Query-BrwMGK8U-BPr0_G9t.js";import"./main-QGPoLsvl.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";var a;let r=a=class extends l{constructor(i){super(i),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(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10}clone(){return new a(u({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}))}};t([e({type:[String],json:{write:!0}})],r.prototype,"attachmentTypes",void 0),t([e({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],r.prototype,"attachmentsWhere",void 0),t([e({type:Boolean,json:{write:!0}})],r.prototype,"cacheHint",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"keywords",void 0),t([e({type:[String],json:{write:!0}})],r.prototype,"globalIds",void 0),t([e({json:{write:!0}})],r.prototype,"name",void 0),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],r.prototype,"num",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"objectIds",void 0),t([e({type:Boolean,json:{default:!1,write:!0}})],r.prototype,"returnMetadata",void 0),t([e({type:[Number],json:{write:!0}})],r.prototype,"size",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],r.prototype,"start",void 0),t([n("start"),n("num")],r.prototype,"writeStart",null),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],r.prototype,"where",void 0),r=a=t([d("esri.rest.support.AttachmentQuery")],r),r.from=h(r);const S=r;var p;let o=p=class extends l{constructor(i){super(i),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(i,s){s.historicMoment=i&&i.getTime()}writeStart(i,s){s.resultOffset=this.start,s.resultRecordCount=this.num||10,this.start>0&&this.where==null&&(s.definitionExpression="1=1")}clone(){return new p(u({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}))}};t([e({type:Boolean,json:{write:!0}})],o.prototype,"cacheHint",void 0),t([e({type:y,json:{write:!0}})],o.prototype,"dynamicDataSource",void 0),t([e({type:String,json:{write:!0}})],o.prototype,"gdbVersion",void 0),t([e({type:Number,json:{write:!0}})],o.prototype,"geometryPrecision",void 0),t([e({type:Date})],o.prototype,"historicMoment",void 0),t([n("historicMoment")],o.prototype,"_writeHistoricMoment",null),t([e({type:Number,json:{write:!0}})],o.prototype,"maxAllowableOffset",void 0),t([e({json:{write:!0}})],o.prototype,"objectIds",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),t([e({type:[String],json:{write:!0}})],o.prototype,"outFields",void 0),t([e({type:c,json:{read:{source:"outSR"},write:{target:"outSR"}}})],o.prototype,"outSpatialReference",void 0),t([e({json:{write:!0}})],o.prototype,"relationshipId",void 0),t([e({type:Number,json:{read:{source:"resultOffset"}}})],o.prototype,"start",void 0),t([n("start"),n("num")],o.prototype,"writeStart",null),t([e({type:Number,json:{read:{source:"resultRecordCount"}}})],o.prototype,"num",void 0),t([e({json:{write:!0}})],o.prototype,"returnGeometry",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnM",void 0),t([e({type:Boolean,json:{write:{overridePolicy:i=>({enabled:i})}}})],o.prototype,"returnZ",void 0),t([e({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],o.prototype,"where",void 0),o=p=t([d("esri.rest.support.RelationshipQuery")],o),o.from=h(o);const m=o,M=Object.freeze(Object.defineProperty({__proto__:null,default:m},Symbol.toStringTag,{value:"Module"}));export{M as R,S as c,m as d}; diff --git a/custom-toc-highlight/assets/RendererLegendOptions-K3md58-X-Dj9JPZ6J.js b/custom-toc-highlight/assets/RendererLegendOptions-K3md58-X-JLOOdHLz.js similarity index 93% rename from custom-toc-highlight/assets/RendererLegendOptions-K3md58-X-Dj9JPZ6J.js rename to custom-toc-highlight/assets/RendererLegendOptions-K3md58-X-JLOOdHLz.js index 9933e186..74e1d34f 100644 --- a/custom-toc-highlight/assets/RendererLegendOptions-K3md58-X-Dj9JPZ6J.js +++ b/custom-toc-highlight/assets/RendererLegendOptions-K3md58-X-JLOOdHLz.js @@ -1 +1 @@ -import{v as e,S as o,ar as p,bB as c,ac as d,i as n,cr as v,aa as y,e as i,bz as h}from"./story-BfX8CRfG.js";var l;let t=l=class extends i{constructor(r){super(r),this.color=null,this.label=null,this.value=null}writeValue(r,a,u){a[u]=r??0}clone(){return new l({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};e([o({type:p,json:{type:[c],write:!0}})],t.prototype,"color",void 0),e([o({type:String,json:{write:!0}})],t.prototype,"label",void 0),e([o({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],t.prototype,"value",void 0),e([d("value")],t.prototype,"writeValue",null),t=l=e([n("esri.renderers.visualVariables.support.ColorStop")],t);const g=t,w=v()({ascendingValues:"ascending-values",descendingValues:"descending-values"});let s=class extends y(i){constructor(r){super(r),this.title=null,this.order=null}};e([o({type:String,json:{write:!0}})],s.prototype,"title",void 0),e([h(w)],s.prototype,"order",void 0),s=e([n("esri.renderers.support.RendererLegendOptions")],s);const V=s;export{g as h,V as w}; +import{v as e,S as o,ar as p,bB as c,ac as d,i as n,cr as v,aa as y,e as i,bz as h}from"./story-Doly9N9p.js";var l;let t=l=class extends i{constructor(r){super(r),this.color=null,this.label=null,this.value=null}writeValue(r,a,u){a[u]=r??0}clone(){return new l({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};e([o({type:p,json:{type:[c],write:!0}})],t.prototype,"color",void 0),e([o({type:String,json:{write:!0}})],t.prototype,"label",void 0),e([o({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],t.prototype,"value",void 0),e([d("value")],t.prototype,"writeValue",null),t=l=e([n("esri.renderers.visualVariables.support.ColorStop")],t);const g=t,w=v()({ascendingValues:"ascending-values",descendingValues:"descending-values"});let s=class extends y(i){constructor(r){super(r),this.title=null,this.order=null}};e([o({type:String,json:{write:!0}})],s.prototype,"title",void 0),e([h(w)],s.prototype,"order",void 0),s=e([n("esri.renderers.support.RendererLegendOptions")],s);const V=s;export{g as h,V as w}; diff --git a/custom-toc-highlight/assets/RenderingContext-DbCVbtGZ-rMiiZHPo.js b/custom-toc-highlight/assets/RenderingContext-DbCVbtGZ-Bdgqeuyk.js similarity index 98% rename from custom-toc-highlight/assets/RenderingContext-DbCVbtGZ-rMiiZHPo.js rename to custom-toc-highlight/assets/RenderingContext-DbCVbtGZ-Bdgqeuyk.js index ddeae239..69a7e220 100644 --- a/custom-toc-highlight/assets/RenderingContext-DbCVbtGZ-rMiiZHPo.js +++ b/custom-toc-highlight/assets/RenderingContext-DbCVbtGZ-Bdgqeuyk.js @@ -1,4 +1,4 @@ -import{o as W}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{ProgramCache as te,glslifyDefineMap as se}from"./webglDeps-Bgavuh0h-CPBMgmjx.js";import{hT as w,az as ie,aN as re,K as N,hZ as V}from"./story-BfX8CRfG.js";import{V as ae,F as p,N as U,y as ne,H as I}from"./Texture-BCt2hphT-hC4XzHg_.js";import{f as g,X as M,S as a,C as F,r as v,R as b,Y as d,M as C,a as le,V as R,o as z,A as m,N as D,O as j,L as x,D as B,P as A,T as E,G as y,n as S,I as O,U as Z,F as k,B as oe}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{t as he,K as fe,A as ue}from"./renderState-Dap0WV9P-D4IHxyei.js";import{e as K}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{r as P}from"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import{G}from"./Program-DLVwTiPA-C1hIaFuM.js";import{L as _e,b as ce,c as L}from"./testSVGPremultipliedAlpha-DoZe_f0d-DBs2wvPw.js";import{f as de}from"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import{f as Y}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{c as Q}from"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import{n as J}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";const Ee=e=>{let s="";s+=e[0].toUpperCase();for(let t=1;t{const s={};for(const t in e)s[Ee(t)]=e[t];return se(s)},Ke=(e,s,t,i)=>{const r=e+e.slice(Math.max(0,e.lastIndexOf("/"))),n=s+s.slice(Math.max(0,s.lastIndexOf("/"))),l=ge(i);return{attributes:t,shaders:{vertexShader:l+W(`${r}.vert`),fragmentShader:l+W(`${n}.frag`)}}};class q{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:m.ONE,dstRGB:m.ZERO,srcAlpha:m.ONE,dstAlpha:m.ZERO},this.blendEquation={mode:D.ADD,modeAlpha:D.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=F.BACK,this.frontFace=j.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=x.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:F.FRONT_AND_BACK,func:x.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:F.FRONT_AND_BACK,fail:B.KEEP,zFail:B.KEEP,zPass:B.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.transformFeedbackBuffer=null,this.uniformBufferBindingPoints=new Array,this.transformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.drawBuffers={defaultFramebuffer:[g.BACK],fbos:new WeakMap},this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}}let pe=class{constructor(){for(this._current=new Array,this._allocations=null;this._current.lengthe+(t0){e+=`Live objects: +import{o as W}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{ProgramCache as te,glslifyDefineMap as se}from"./webglDeps-Bgavuh0h-31Q0Fngh.js";import{hT as w,az as ie,aN as re,K as N,hZ as V}from"./story-Doly9N9p.js";import{V as ae,F as p,N as U,y as ne,H as I}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{f as g,X as M,S as a,C as F,r as v,R as b,Y as d,M as C,a as le,V as R,o as z,A as m,N as D,O as j,L as x,D as B,P as A,T as E,G as y,n as S,I as O,U as Z,F as k,B as oe}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{t as he,K as fe,A as ue}from"./renderState-Dap0WV9P-D4IHxyei.js";import{e as K}from"./interfaces-DN2-jsJC-DzMTiT5R.js";import{r as P}from"./BufferObject-BM_7mcDb-EYaqMhmk.js";import{G}from"./Program-DLVwTiPA-DI0GKSfI.js";import{L as _e,b as ce,c as L}from"./testSVGPremultipliedAlpha-DoZe_f0d-BwcxFsN9.js";import{f as de}from"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import{f as Y}from"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import{c as Q}from"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import{n as J}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";const Ee=e=>{let s="";s+=e[0].toUpperCase();for(let t=1;t{const s={};for(const t in e)s[Ee(t)]=e[t];return se(s)},Ke=(e,s,t,i)=>{const r=e+e.slice(Math.max(0,e.lastIndexOf("/"))),n=s+s.slice(Math.max(0,s.lastIndexOf("/"))),l=ge(i);return{attributes:t,shaders:{vertexShader:l+W(`${r}.vert`),fragmentShader:l+W(`${n}.frag`)}}};class q{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:m.ONE,dstRGB:m.ZERO,srcAlpha:m.ONE,dstAlpha:m.ZERO},this.blendEquation={mode:D.ADD,modeAlpha:D.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=F.BACK,this.frontFace=j.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=x.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:F.FRONT_AND_BACK,func:x.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:F.FRONT_AND_BACK,fail:B.KEEP,zFail:B.KEEP,zPass:B.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.transformFeedbackBuffer=null,this.uniformBufferBindingPoints=new Array,this.transformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.drawBuffers={defaultFramebuffer:[g.BACK],fbos:new WeakMap},this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}}let pe=class{constructor(){for(this._current=new Array,this._allocations=null;this._current.lengthe+(t0){e+=`Live objects: `;for(let s=0;s0&&(e+=`${R[s]}: ${t} `)}}return e+=this._allocations?.resetLog(),e}},be=class{constructor(e,s,t){const i=s.textureFilterAnisotropic,r=t.maxAnisotropy??1/0;this.versionString=e.getParameter(e.VERSION),this.maxVertexTextureImageUnits=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),this.maxVertexAttributes=e.getParameter(e.MAX_VERTEX_ATTRIBS),this.maxMaxAnisotropy=i?Math.min(e.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY),r):1,this.maxTextureImageUnits=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),this.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),this.maxUniformBufferBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS),this.maxVertexUniformBlocks=e.getParameter(e.MAX_VERTEX_UNIFORM_BLOCKS),this.maxFragmentUniformBlocks=e.getParameter(e.MAX_FRAGMENT_UNIFORM_BLOCKS),this.maxUniformBlockSize=e.getParameter(e.MAX_UNIFORM_BLOCK_SIZE),this.uniformBufferOffsetAlignment=e.getParameter(e.UNIFORM_BUFFER_OFFSET_ALIGNMENT),this.maxArrayTextureLayers=e.getParameter(e.MAX_ARRAY_TEXTURE_LAYERS),this.maxSamples=e.getParameter(e.MAX_SAMPLES),this.maxDrawBuffers=e.getParameter(e.MAX_DRAW_BUFFERS)}};class X{constructor(s){this._rctx=s,this._indexBuffer=this._createIndexbuffer(),this._program=this._createHelperProgram()}static getShaderSources(){return{vertex:`#version 300 es precision highp float; diff --git a/custom-toc-highlight/assets/RouteLayer-BQQ6WxtH-gcXmCkYw.js b/custom-toc-highlight/assets/RouteLayer-BQQ6WxtH-DV30CZ3n.js similarity index 94% rename from custom-toc-highlight/assets/RouteLayer-BQQ6WxtH-gcXmCkYw.js rename to custom-toc-highlight/assets/RouteLayer-BQQ6WxtH-DV30CZ3n.js index 537ba629..ea7d0e10 100644 --- a/custom-toc-highlight/assets/RouteLayer-BQQ6WxtH-gcXmCkYw.js +++ b/custom-toc-highlight/assets/RouteLayer-BQQ6WxtH-DV30CZ3n.js @@ -1,2 +1,2 @@ -import{v as t,S as i,jP as Z,i as O,jQ as he,jR as et,bz as A,a0 as N,ac as $,aK as Fe,w as Ge,m as me,n as Ue,bi as Q,aa as Re,af as tt,g as rt,aO as ot,J as W,ag as L,ai as it,dK as st,G as nt,eS as je,C as Ie,o as M,a as at,r as lt,aU as ut,bL as pt,e as D,e0 as V,d_ as ve,d$ as yt,f as Y,d4 as Be,N as ct,aq as $e,aR as dt,di as mt,a1 as We}from"./story-BfX8CRfG.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{o as ft}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{m as ht}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{n as vt}from"./originUtils-BLsWtgV9-B4sclfuf.js";import{N as wt,K as gt}from"./projection-BA9M1R7d-BYoCXVXt.js";import{D as St}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{u as bt}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{E as Bt}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as Tt}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{S as Nt}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{j as Pt}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import Rt from"./PortalItem-CctGdnxF-C7IJrZYq.js";import{E as At}from"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import{a as fe,y as qe}from"./utils-9sQxfkoa-KicvrT8N.js";import{A as H,Q as Ae,a as Ot,c as Lt,s as Ze,e as Oe,y as jt,m as It,d as Dt,V as De,o as Ct,u as Mt,Z as _t,n as Jt,$ as kt,T as pe,b as ye,v as re,f as oe,S as ie,N as se,g as we,W as xt,h as Et,t as Ft}from"./Stop-he5xSAJJ-CGB43GGR.js";import{B as Gt}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{O as E}from"./FeatureSet-BkVNthuN-CwS44--W.js";import"./main-ugzBrWNm.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";let G=class extends D{constructor(e){super(e),this.break=new V({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new V({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new V({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new V({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new V({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new V({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};t([i({types:Z})],G.prototype,"break",void 0),t([i({types:Z})],G.prototype,"first",void 0),t([i({types:Z})],G.prototype,"unlocated",void 0),t([i({types:Z})],G.prototype,"last",void 0),t([i({types:Z})],G.prototype,"middle",void 0),t([i({types:Z})],G.prototype,"waypoint",void 0),G=t([O("esri.layers.support.RouteStopSymbols")],G);const Ve=G;let k=class extends D{constructor(e){super(e),this.directionLines=new ve({color:[0,122,194],width:6}),this.directionPoints=new V({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new V({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new yt({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new ve({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new ve({width:8,color:[20,89,127]}),this.stops=new Ve}};t([i({types:he})],k.prototype,"directionLines",void 0),t([i({types:Z})],k.prototype,"directionPoints",void 0),t([i({types:Z})],k.prototype,"pointBarriers",void 0),t([i({types:et})],k.prototype,"polygonBarriers",void 0),t([i({types:he})],k.prototype,"polylineBarriers",void 0),t([i({types:he})],k.prototype,"routeInfo",void 0),t([i({type:Ve})],k.prototype,"stops",void 0),k=t([O("esri.layers.support.RouteSymbols")],k);const ze=k;let _=class extends D{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([i({type:String})],_.prototype,"dataType",void 0),t([A(H,{ignoreUnknown:!1})],_.prototype,"name",void 0),t([i({type:[String]})],_.prototype,"parameterNames",void 0),t([i({type:String})],_.prototype,"restrictionUsageParameterName",void 0),t([A(Ae,{ignoreUnknown:!1})],_.prototype,"timeNeutralAttributeName",void 0),t([i({type:String})],_.prototype,"trafficSupport",void 0),t([A(Ot)],_.prototype,"units",void 0),t([A(Lt)],_.prototype,"usageType",void 0),_=t([O("esri.rest.support.NetworkAttribute")],_);const Ut=_;let q=class extends D{constructor(e){super(e),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};t([i({type:Number})],q.prototype,"buildTime",void 0),t([i({type:String})],q.prototype,"name",void 0),t([i({type:[Ut]})],q.prototype,"networkAttributes",void 0),t([i()],q.prototype,"networkSources",void 0),t([i({type:String})],q.prototype,"state",void 0),q=t([O("esri.rest.support.NetworkDataset")],q);const $t=q;let R=class extends D{constructor(e){super(e),this.accumulateAttributeNames=null,this.attributeParameterValues=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 e==null?null:e.map(r=>H.fromJSON(r))}writeAccumulateAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>H.toJSON(s)))}get capabilities(){return{supportsNow:(this.currentVersion??10)>=10.81}}readDefaultTravelMode(e,r){const o=r.supportedTravelModes?.find(({id:s})=>s===r.defaultTravelMode)??r.supportedTravelModes?.find(({itemId:s})=>s===r.defaultTravelMode);return o?Oe.fromJSON(o):null}};t([i()],R.prototype,"accumulateAttributeNames",void 0),t([N("accumulateAttributeNames")],R.prototype,"readAccumulateAttributes",null),t([$("accumulateAttributeNames")],R.prototype,"writeAccumulateAttributes",null),t([i()],R.prototype,"attributeParameterValues",void 0),t([i()],R.prototype,"capabilities",null),t([i()],R.prototype,"currentVersion",void 0),t([i()],R.prototype,"defaultTravelMode",void 0),t([N("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],R.prototype,"readDefaultTravelMode",null),t([i()],R.prototype,"directionsLanguage",void 0),t([A(Ze)],R.prototype,"directionsLengthUnits",void 0),t([i()],R.prototype,"directionsSupportedLanguages",void 0),t([A(Ae,{ignoreUnknown:!1})],R.prototype,"directionsTimeAttribute",void 0),t([i()],R.prototype,"hasZ",void 0),t([A(H,{ignoreUnknown:!1})],R.prototype,"impedance",void 0),t([i({type:$t})],R.prototype,"networkDataset",void 0),t([i({type:[Oe]})],R.prototype,"supportedTravelModes",void 0),R=t([O("esri.rest.support.NetworkServiceDescription")],R);const Wt=R,qt=()=>We.getLogger("esri.rest.networkService");function ne(e,r,o,s){s[o]=[r.length,r.length+e.length],e.forEach(a=>{r.push(a.geometry)})}function Zt(e,r){for(let o=0;oH.fromJSON(r))}writeAccumulateAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>H.toJSON(s)))}get capabilities(){return{supportsNow:(this.currentVersion??10)>=10.81}}readDefaultTravelMode(e,r){const o=r.supportedTravelModes?.find(({id:s})=>s===r.defaultTravelMode)??r.supportedTravelModes?.find(({itemId:s})=>s===r.defaultTravelMode);return o?Oe.fromJSON(o):null}};t([i()],R.prototype,"accumulateAttributeNames",void 0),t([N("accumulateAttributeNames")],R.prototype,"readAccumulateAttributes",null),t([$("accumulateAttributeNames")],R.prototype,"writeAccumulateAttributes",null),t([i()],R.prototype,"attributeParameterValues",void 0),t([i()],R.prototype,"capabilities",null),t([i()],R.prototype,"currentVersion",void 0),t([i()],R.prototype,"defaultTravelMode",void 0),t([N("defaultTravelMode",["defaultTravelMode","supportedTravelModes"])],R.prototype,"readDefaultTravelMode",null),t([i()],R.prototype,"directionsLanguage",void 0),t([A(Ze)],R.prototype,"directionsLengthUnits",void 0),t([i()],R.prototype,"directionsSupportedLanguages",void 0),t([A(Ae,{ignoreUnknown:!1})],R.prototype,"directionsTimeAttribute",void 0),t([i()],R.prototype,"hasZ",void 0),t([A(H,{ignoreUnknown:!1})],R.prototype,"impedance",void 0),t([i({type:$t})],R.prototype,"networkDataset",void 0),t([i({type:[Oe]})],R.prototype,"supportedTravelModes",void 0),R=t([O("esri.rest.support.NetworkServiceDescription")],R);const Wt=R,qt=()=>We.getLogger("esri.rest.networkService");function ne(e,r,o,s){s[o]=[r.length,r.length+e.length],e.forEach(a=>{r.push(a.geometry)})}function Zt(e,r){for(let o=0;o=10.4?Kt(e,r,o):zt(e,o),{defaultTravelMode:u,supportedTravelModes:d}=await y;return a.defaultTravelMode=u,a.supportedTravelModes=d,Wt.fromJSON(a)}async function zt(e,r){const o=fe({f:"json"},r),{data:s}=await Y(e.replace(/\/rest\/.*$/i,"/info"),o);if(!s?.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:a}=s,y=Be(a)+"/sharing/rest/portals/self",{data:u}=await Y(y,o),d=ct("helperServices.routingUtilities.url",u);if(!d)return{supportedTravelModes:[],defaultTravelMode:null};const g=qe(a),h=/\/solve$/i.test(g.path)?"Route":/\/solveclosestfacility$/i.test(g.path)?"ClosestFacility":"ServiceAreas",n=fe({f:"json",serviceName:h},r),b=Be(d)+"/GetTravelModes/execute",P=await Y(b,n),B=[];let m=null;if(P?.data?.results?.length){const f=P.data.results;for(const w of f)if(w.paramName==="supportedTravelModes"){if(w.value?.features){for(const{attributes:l}of w.value.features)if(l){const T=JSON.parse(l.TravelMode);B.push(T)}}}else w.paramName==="defaultTravelMode"&&(m=w.value)}return{supportedTravelModes:B,defaultTravelMode:m}}async function Kt(e,r,o){try{const s=fe({f:"json",token:r},o),a=Be(e)+"/retrieveTravelModes",{data:{supportedTravelModes:y,defaultTravelMode:u}}=await Y(a,s);return{supportedTravelModes:y,defaultTravelMode:u}}catch(s){throw new M("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:s})}}const Ce=new Fe({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"});let X=class extends D{constructor(e){super(e),this.description=null,this.type=null}};t([i({type:String,json:{write:!0}})],X.prototype,"description",void 0),t([i({type:String,json:{read:Ce.read,write:Ce.write}})],X.prototype,"type",void 0),X=t([O("esri.rest.support.GPMessage")],X);const Qt=X,Me=new Fe({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let ce=class extends Qt{constructor(e){super(e),this.type=null}};t([i({type:String,json:{read:Me.read,write:Me.write}})],ce.prototype,"type",void 0),ce=t([O("esri.rest.support.NAMessage")],ce);const Ht=ce;let ee=class extends D{constructor(e){super(e)}};t([i({json:{read:{source:"string"}}})],ee.prototype,"text",void 0),t([A(jt,{name:"stringType"})],ee.prototype,"type",void 0),ee=t([O("esri.rest.support.DirectionsString")],ee);const Qe=ee;let U=class extends D{constructor(e){super(e),this.arriveTime=null,this.arriveTimeOffset=null,this.geometry=null,this.strings=null}readArriveTimeOffset(e,r){return xt(r.ETA,r.arriveTimeUTC)}readGeometry(e,r){return Ge.fromJSON(r.point)}};t([i({type:Date,json:{read:{source:"arriveTimeUTC"}}})],U.prototype,"arriveTime",void 0),t([i()],U.prototype,"arriveTimeOffset",void 0),t([N("arriveTimeOffset",["arriveTimeUTC","ETA"])],U.prototype,"readArriveTimeOffset",null),t([i({type:Ge})],U.prototype,"geometry",void 0),t([N("geometry",["point"])],U.prototype,"readGeometry",null),t([i({type:[Qe]})],U.prototype,"strings",void 0),U=t([O("esri.rest.support.DirectionsEvent")],U);const Yt=U;function Xt(e){if(e==null||e==="")return null;let r=0,o=0,s=0,a=0;const y=[];let u,d,g,h,n,b,P,B,m=0,f=0,w=0;if(n=e.match(/((\+|-)[^+\-|]+|\|)/g),n||(n=[]),parseInt(n[m],32)===0){m=2;const l=parseInt(n[m],32);m++,b=parseInt(n[m],32),m++,1&l&&(f=n.indexOf("|")+1,P=parseInt(n[f],32),f++),2&l&&(w=n.indexOf("|",f)+1,B=parseInt(n[w],32),w++)}else b=parseInt(n[m],32),m++;for(;m0,hasM:w>0}}let K=class extends Q{constructor(e){super(e),this.events=null,this.geometry=null,this.strings=null}readGeometry(e,r){const o=Xt(r.compressedGeometry);return o!=null?me.fromJSON(o):null}};t([i({type:[Yt]})],K.prototype,"events",void 0),t([i({type:me})],K.prototype,"geometry",void 0),t([N("geometry",["compressedGeometry"])],K.prototype,"readGeometry",null),t([i({type:[Qe]})],K.prototype,"strings",void 0),K=t([O("esri.rest.support.DirectionsFeature")],K);const er=K;function tr(e,r){if(e.length===0)return new me({spatialReference:r});const o=[];for(const u of e)for(const d of u.paths)o.push(...d);const s=[];o.forEach((u,d)=>{d!==0&&u[0]===o[d-1][0]&&u[1]===o[d-1][1]||s.push(u)});const{hasM:a,hasZ:y}=e[0];return new me({hasM:a,hasZ:y,paths:[s],spatialReference:r})}let I=class extends E{constructor(e){super(e),this.extent=null,this.features=[],this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,r){if(!e)return[];const o=r.summary.envelope.spatialReference??r.spatialReference,s=o&&W.fromJSON(o);return e.map(a=>{const y=er.fromJSON(a);if(y.geometry!=null&&(y.geometry.spatialReference=s),y.events!=null)for(const u of y.events)u.geometry!=null&&(u.geometry.spatialReference=s);return y})}get mergedGeometry(){return this.features?tr(this.features.map(({geometry:e})=>e),this.extent.spatialReference):null}get strings(){return this.features.flatMap(({strings:e})=>e).filter($e)}};t([i({type:Ue,json:{read:{source:"summary.envelope"}}})],I.prototype,"extent",void 0),t([i({nonNullable:!0})],I.prototype,"features",void 0),t([N("features")],I.prototype,"readFeatures",null),t([i()],I.prototype,"geometryType",void 0),t([i({readOnly:!0})],I.prototype,"mergedGeometry",null),t([i()],I.prototype,"routeId",void 0),t([i()],I.prototype,"routeName",void 0),t([i({value:null,readOnly:!0})],I.prototype,"strings",null),t([i({json:{read:{source:"summary.totalDriveTime"}}})],I.prototype,"totalDriveTime",void 0),t([i({json:{read:{source:"summary.totalLength"}}})],I.prototype,"totalLength",void 0),t([i({json:{read:{source:"summary.totalTime"}}})],I.prototype,"totalTime",void 0),I=t([O("esri.rest.support.DirectionsFeatureSet")],I);const rr=I;let C=class extends D{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([i({type:E,json:{write:!0}})],C.prototype,"directionLines",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"directionPoints",void 0),t([i({type:rr,json:{write:!0}})],C.prototype,"directions",void 0),t([i({type:Q,json:{write:!0}})],C.prototype,"route",void 0),t([i({type:String,json:{write:!0}})],C.prototype,"routeName",void 0),t([i({type:[Q],json:{write:!0}})],C.prototype,"stops",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedEdges",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedJunctions",void 0),t([i({type:E,json:{write:!0}})],C.prototype,"traversedTurns",void 0),C=t([O("esri.rest.support.RouteResult")],C);const or=C;function ge(e){return e?E.fromJSON(e).features.filter($e):[]}let J=class extends D{constructor(e){super(e),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(e,r){return ge(r.barriers)}readPolylineBarriers(e){return ge(e)}readPolygonBarriers(e){return ge(e)}};t([i({type:[Ht]})],J.prototype,"messages",void 0),t([i({type:[Q]})],J.prototype,"pointBarriers",void 0),t([N("pointBarriers",["barriers"])],J.prototype,"readPointBarriers",null),t([i({type:[Q]})],J.prototype,"polylineBarriers",void 0),t([N("polylineBarriers")],J.prototype,"readPolylineBarriers",null),t([i({type:[Q]})],J.prototype,"polygonBarriers",void 0),t([N("polygonBarriers")],J.prototype,"readPolygonBarriers",null),t([i({type:[or]})],J.prototype,"routeResults",void 0),J=t([O("esri.rest.support.RouteSolveResult")],J);const ir=J;function ae(e){return e instanceof E}async function sr(e,r,o){const s=[],a=[],y={},u={},d=qe(e),{path:g}=d;ae(r.stops)&&ne(r.stops.features,a,"stops.features",y),ae(r.pointBarriers)&&ne(r.pointBarriers.features,a,"pointBarriers.features",y),ae(r.polylineBarriers)&&ne(r.polylineBarriers.features,a,"polylineBarriers.features",y),ae(r.polygonBarriers)&&ne(r.polygonBarriers.features,a,"polygonBarriers.features",y);const h=await Gt(a);for(const B in y){const m=y[B];s.push(B),u[B]=h.slice(m[0],m[1])}if(Vt(u,s)){let B=null;try{B=await Ke(g,r.apiKey,o)}catch{}B&&!B.hasZ&&Zt(u,s)}for(const B in u)u[B].forEach((m,f)=>{dt(r,B)[f].geometry=m});const n={...o,query:{...d.query,...Et(r),f:"json"}},b=g.endsWith("/solve")?g:`${g}/solve`,{data:P}=await Y(b,n);return nr(P)}function nr(e){const{barriers:r,directionLines:o,directionPoints:s,directions:a,messages:y,polygonBarriers:u,polylineBarriers:d,routes:g,stops:h,traversedEdges:n,traversedJunctions:b,traversedTurns:P}=e,B=l=>{const T=f.find(j=>j.routeName===l);if(T!=null)return T;const S={routeId:f.length+1,routeName:l};return f.push(S),S},m=l=>{const T=f.find(j=>j.routeId===l);if(T!=null)return T;const S={routeId:l,routeName:null};return f.push(S),S},f=[];g?.features.forEach((l,T)=>{l.geometry.spatialReference=g.spatialReference??void 0;const S=l.attributes.Name,j=T+1;f.push({routeId:j,routeName:S,route:l})}),a?.forEach(l=>{const{routeName:T}=l;B(T).directions=l});const w=(h?.features.every(l=>l.attributes.RouteName==null)??!1)&&f.length>0?f[0].routeName:null;return h?.features.forEach(l=>{l.geometry&&(l.geometry.spatialReference??=h.spatialReference??void 0);const T=w??l.attributes.RouteName,S=B(T);S.stops??=[],S.stops.push(l)}),o?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=o;S.directionLines??={features:[],geometryType:j,spatialReference:F},S.directionLines.features.push(l)}),s?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=s;S.directionPoints??={features:[],geometryType:j,spatialReference:F},S.directionPoints.features.push(l)}),n?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=n;S.traversedEdges??={features:[],geometryType:j,spatialReference:F},S.traversedEdges.features.push(l)}),b?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T),{geometryType:j,spatialReference:F}=b;S.traversedJunctions??={features:[],geometryType:j,spatialReference:F},S.traversedJunctions.features.push(l)}),P?.features.forEach(l=>{const T=l.attributes.RouteID,S=m(T);S.traversedTurns??={features:[]},S.traversedTurns.features.push(l)}),ir.fromJSON({routeResults:f,barriers:r,polygonBarriers:u,polylineBarriers:d,messages:y})}const ar={type:String,json:{read:{source:"token"},write:{target:"token"}}};let x=class extends Re(D){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([i({type:Boolean,json:{write:!0}})],x.prototype,"doNotLocateOnRestrictedElements",void 0),t([i({types:tt,json:{read:rt,write:!0}})],x.prototype,"geometry",void 0),t([A(It)],x.prototype,"geometryType",void 0),t([i({type:String,json:{name:"layerName",write:!0}})],x.prototype,"name",void 0),t([A(Dt,{name:"spatialRel"})],x.prototype,"spatialRelationship",void 0),t([i({type:String,json:{write:!0}})],x.prototype,"type",void 0),t([i({type:String,json:{write:!0}})],x.prototype,"where",void 0),x=t([O("esri.rest.support.DataLayer")],x);const lr=x;var Te;let de=Te=class extends E{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new Te({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};t([i({type:Boolean,json:{write:!0}})],de.prototype,"doNotLocateOnRestrictedElements",void 0),de=Te=t([O("esri.rest.support.NetworkFeatureSet")],de);const ur=de;let te=class extends Re(D){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};t([i({type:Boolean,json:{write:!0}})],te.prototype,"doNotLocateOnRestrictedElements",void 0),t([i({type:String,json:{write:!0}})],te.prototype,"url",void 0),te=t([O("esri.rest.support.NetworkUrl")],te);const pr=te;var Ne;let p=Ne=class extends Re(D){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 ot(Ne,e)}readAccumulateAttributes(e){return e==null?null:e.map(r=>H.fromJSON(r))}writeAccumulateAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>H.toJSON(s)))}writePointBarriers(e,r,o){le(e,r,o)}writePolygonBarrier(e,r,o){le(e,r,o)}writePolylineBarrier(e,r,o){le(e,r,o)}readRestrictionAttributes(e){return e==null?null:e.map(r=>De.fromJSON(r))}writeRestrictionAttributes(e,r,o){e?.length&&(r[o]=e.map(s=>De.toJSON(s)))}readStartTime(e,r){const{startTime:o}=r;return o==null?null:o==="now"?"now":new Date(o)}writeStartTime(e,r){e!=null&&(r.startTime=e==="now"?"now":e.getTime())}readStops(e,r){return hr(r.stops)}writeStops(e,r,o){le(e,r,o)}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],p.prototype,"accumulateAttributes",void 0),t([N("accumulateAttributes")],p.prototype,"readAccumulateAttributes",null),t([$("accumulateAttributes")],p.prototype,"writeAccumulateAttributes",null),t([i(ar)],p.prototype,"apiKey",void 0),t([i({json:{write:!0}})],p.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],p.prototype,"directionsLanguage",void 0),t([A(Ze)],p.prototype,"directionsLengthUnits",void 0),t([A(Ct)],p.prototype,"directionsOutputType",void 0),t([A(Mt)],p.prototype,"directionsStyleName",void 0),t([A(Ae,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],p.prototype,"directionsTimeAttribute",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"findBestSequence",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecision",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecisionM",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"geometryPrecisionZ",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"ignoreInvalidLocations",void 0),t([A(H,{name:"impedanceAttributeName",ignoreUnknown:!1})],p.prototype,"impedanceAttribute",void 0),t([i({type:Number,json:{write:!0}})],p.prototype,"outputGeometryPrecision",void 0),t([A(_t)],p.prototype,"outputGeometryPrecisionUnits",void 0),t([A(Jt)],p.prototype,"outputLines",void 0),t([i({type:W,json:{name:"outSR",write:!0}})],p.prototype,"outSpatialReference",void 0),t([i({json:{write:!0}})],p.prototype,"overrides",void 0),t([i({json:{name:"barriers",write:!0}})],p.prototype,"pointBarriers",void 0),t([$("pointBarriers")],p.prototype,"writePointBarriers",null),t([i({json:{write:!0}})],p.prototype,"polygonBarriers",void 0),t([$("polygonBarriers")],p.prototype,"writePolygonBarrier",null),t([i({json:{write:!0}})],p.prototype,"polylineBarriers",void 0),t([$("polylineBarriers")],p.prototype,"writePolylineBarrier",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"preserveObjectID",void 0),t([i({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],p.prototype,"restrictionAttributes",void 0),t([N("restrictionAttributes")],p.prototype,"readRestrictionAttributes",null),t([$("restrictionAttributes")],p.prototype,"writeRestrictionAttributes",null),t([A(kt)],p.prototype,"restrictUTurns",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnDirections",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnPolygonBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnPolylineBarriers",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnRoutes",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnStops",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedEdges",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedJunctions",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnTraversedTurns",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"returnZ",void 0),t([i({json:{write:!0}})],p.prototype,"startTime",void 0),t([N("startTime")],p.prototype,"readStartTime",null),t([$("startTime")],p.prototype,"writeStartTime",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"startTimeIsUTC",void 0),t([i({json:{write:!0}})],p.prototype,"stops",void 0),t([N("stops")],p.prototype,"readStops",null),t([$("stops")],p.prototype,"writeStops",null),t([i({type:Boolean,json:{write:!0}})],p.prototype,"timeWindowsAreUTC",void 0),t([i({type:Oe,json:{write:!0}})],p.prototype,"travelMode",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"useHierarchy",void 0),t([i({type:Boolean,json:{write:!0}})],p.prototype,"useTimeWindows",void 0),p=Ne=t([O("esri.rest.support.RouteParameters")],p);const yr=p;function cr(e){return e&&"type"in e}function dr(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}function mr(e){return e&&"url"in e}function fr(e){return e&&"features"in e}function hr(e){return cr(e)?lr.fromJSON(e):mr(e)?pr.fromJSON(e):dr(e)?ur.fromJSON(e):fr(e)?E.fromJSON(e):null}function le(e,r,o){e!=null&&(r[o]=L.isCollection(e)?{features:e.toArray().map(s=>s.toJSON())}:e.toJSON())}function Se(e){return e.length?e:null}function Pe(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:Pe("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:Pe("esriGeometryPolyline")}}}function ue(e){return"layers"in e}function vr(e){return e.declaredClass==="esri.rest.support.FeatureSet"}function wr(e){return e.declaredClass==="esri.rest.support.NetworkFeatureSet"}function gr(e,r,o){const s=r.networkDataset?.networkAttributes,a=s?.filter(({usageType:c})=>c==="cost")??[],y=o.travelMode??r.defaultTravelMode;if(y==null)return void Ye().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:u,distanceAttributeName:d}=y,g=a.find(({name:c})=>c===u),h=a.find(({name:c})=>c===d),n=o.travelMode?.impedanceAttributeName??o.impedanceAttribute??r.impedance,b=g?.units,P=h?.units;if(!b||!P)throw new M("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const B=o.directionsLanguage??r.directionsLanguage,m=o.accumulateAttributes??r.accumulateAttributeNames??[],f=new Set(a.filter(({name:c})=>c===u||c===d||c===n||c!=null&&m.includes(c)).map(({name:c})=>c)),w=c=>{for(const Le in c)f.has(Le)||delete c[Le]};for(const c of e.pointBarriers)c.costs!=null&&(c.addedCost=c.costs[n]??0,w(c.costs));for(const c of e.polygonBarriers)c.costs!=null&&(c.scaleFactor=c.costs[n]??1,w(c.costs));for(const c of e.polylineBarriers)c.costs!=null&&(c.scaleFactor=c.costs[n]??1,w(c.costs));const{routeInfo:l}=e,{findBestSequence:T,preserveFirstStop:S,preserveLastStop:j,startTimeIsUTC:F,timeWindowsAreUTC:Xe}=o;l.analysisSettings=new Ft({accumulateAttributes:m,directionsLanguage:B,findBestSequence:T,preserveFirstStop:S,preserveLastStop:j,startTimeIsUTC:F,timeWindowsAreUTC:Xe,travelMode:y}),l.totalDuration=z(l.totalCosts?.[u]??0,b),l.totalDistance=be(l.totalCosts?.[d]??0,P),l.totalLateDuration=z(l.totalViolations?.[u]??0,b),l.totalWaitDuration=z(l.totalWait?.[u]??0,b),l.totalCosts!=null&&w(l.totalCosts),l.totalViolations!=null&&w(l.totalViolations),l.totalWait!=null&&w(l.totalWait);for(const c of e.stops)c.serviceCosts!=null&&(c.serviceDuration=z(c.serviceCosts[u]??0,b),c.serviceDistance=be(c.serviceCosts[d]??0,P),w(c.serviceCosts)),c.cumulativeCosts!=null&&(c.cumulativeDuration=z(c.cumulativeCosts[u]??0,b),c.cumulativeDistance=be(c.cumulativeCosts[d]??0,P),w(c.cumulativeCosts)),c.violations!=null&&(c.lateDuration=z(c.violations[u]??0,b),w(c.violations)),c.wait!=null&&(c.waitDuration=z(c.wait[u]??0,b),w(c.wait))}async function _e(e){const r=W.WGS84;return await wt(e.spatialReference,r),gt(e,r)}function z(e,r){switch(r){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function be(e,r){return r==="decimal-degrees"||r==="points"||r==="unknown"?e:mt(e,r,"meters")}function Sr(e){const{attributes:r,geometry:o,popupTemplate:s,symbol:a}=e.toGraphic().toJSON();return{attributes:r,geometry:o,popupInfo:s,symbol:a}}const br=L.ofType(pe),Br=L.ofType(ye),Je=L.ofType(re),ke=L.ofType(oe),xe=L.ofType(ie),Ee=L.ofType(se),He="esri.layers.RouteLayer",Ye=()=>We.getLogger(He);let v=class extends bt(Nt(Bt(Tt(ht(St))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new ze,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new Je,this.polygonBarriers=new ke,this.polylineBarriers=new xe,this.routeInfo=null,this.spatialReference=W.WGS84,this.stops=new Ee,this.type="route";const r=()=>{this._setStopSymbol(this.stops)};this.addHandles(it(()=>this.stops,"change",r,{sync:!0,onListenerAdd:r}))}writeFeatureCollectionWebmap(e,r,o,s){const a=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(d=>!!d),y=a.map((d,g)=>g),u=s.origin==="web-map"?"featureCollection.layers":"layers";st(u,a,r),r.opacity=this.opacity,r.visibility=this.visible,r.visibleLayers=y}readDirectionLines(e,r){return this._getNetworkFeatures(r,"DirectionLines",o=>pe.fromGraphic(o))}readDirectionPoints(e,r){return this._getNetworkFeatures(r,"DirectionPoints",o=>ye.fromGraphic(o))}get fullExtent(){const e=new Ue({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:W.WGS84});if(this.routeInfo?.geometry!=null)return this.routeInfo.geometry.extent??e;if(this.stops==null)return e;const r=this.stops.filter(a=>a.geometry!=null);if(r.length<2)return e;const{spatialReference:o}=r.at(0).geometry;if(o==null)return e;const s=r.toArray().map(a=>{const y=a.geometry;return[y.x,y.y]});return new nt({points:s,spatialReference:o}).extent}readMaxScale(e,r){return(ue(r)?r.layers:r.featureCollection?.layers)?.find(o=>o.layerDefinition.maxScale!=null)?.layerDefinition.maxScale??0}readMinScale(e,r){return(ue(r)?r.layers:r.featureCollection?.layers)?.find(o=>o.layerDefinition.minScale!=null)?.layerDefinition.minScale??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=>ie.fromGraphic(o))}readRouteInfo(e,r){return this._getNetworkFeatures(r,"RouteInfo",o=>we.fromGraphic(o)).at(0)??null}readSpatialReference(e,r){const o=ue(r)?r.layers:r.featureCollection?.layers;if(!o?.length)return W.WGS84;const{layerDefinition:s,featureSet:a}=o[0],y=a.features[0],u=y?.geometry?.spatialReference??a.spatialReference??s.spatialReference??s.extent.spatialReference??je;return W.fromJSON(u)}readStops(e,r){return this._getNetworkFeatures(r,"Stops",o=>se.fromGraphic(o),o=>this._setStopSymbol(o))}get title(){return this.routeInfo?.name??"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return Ie.routeServiceUrl}set url(e){e!=null?this._set("url",Pt(e,Ye())):this._set("url",Ie.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(){this.directionLines!=null&&(this.directionLines.removeAll(),this._set("directionLines",null)),this.directionPoints!=null&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),this.routeInfo!=null&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:r}=this;if(!r)throw new M("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!r.id)throw new M("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if(r.type!=="Feature Collection")throw new M("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(this.routeInfo==null)throw new M("routelayer:route-unsolved","save() requires a solved route");const{portal:o}=r;await o.signIn(),o.user||await r.reload();const{itemUrl:s,itemControl:a}=r;if(a!=="admin"&&a!=="update")throw new M("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const y={messages:[],origin:"portal-item",portal:o,url:s?at(s):void 0,writtenProperties:[]},u=this.write(void 0,y);return r.extent=await _e(e),r.title=this.title,await r.update({data:u}),r}async saveAs(e,r={}){if(await this.load(),this.routeInfo==null)throw new M("routelayer:route-unsolved","saveAs() requires a solved route");const o=Rt.from(e).clone();o.extent??=await _e(this.fullExtent),o.id=null,o.portal??=lt.getDefault(),o.title??=this.title,o.type="Feature Collection",o.typeKeywords=["Data","Feature Collection",At.MULTI_LAYER,"Route Layer"];const{portal:s}=o,a={messages:[],origin:"portal-item",portal:s,url:null,writtenProperties:[]};await s.signIn();const y=r?.folder,u=this.write(void 0,a);return await s.user.addItem({item:o,folder:y,data:u}),this.portalItem=o,vt(a),a.portalItem=o,o}async solve(e,r){const o=e?.stops??this.stops,s=e?.pointBarriers??Se(this.pointBarriers),a=e?.polylineBarriers??Se(this.polylineBarriers),y=e?.polygonBarriers??Se(this.polygonBarriers);if(o==null)throw new M("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((vr(o)||wr(o))&&o.features.length<2||L.isCollection(o)&&o.length<2)throw new M("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(L.isCollection(o))for(const f of o)f.routeName=null;const u=e?.apiKey,d=this.url,g=await this._getServiceDescription(d,u,r),h=e?.travelMode??g.defaultTravelMode,n=e?.accumulateAttributes??[];h!=null&&(n.push(h.distanceAttributeName),h.timeAttributeName&&n.push(h.timeAttributeName));const b={accumulateAttributes:n,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:s,polylineBarriers:a,polygonBarriers:y,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!s,returnDirections:!0,returnPolygonBarriers:!!y,returnPolylineBarriers:!!a,returnRoutes:!0,returnStops:!0,stops:o},P=yr.from(e??{});let B;P.set(b);try{B=await sr(d,P,r)}catch(f){throw ut(f)?f:new M("routelayer:failed-route-request","the routing request failed",{error:f})}const m=this._toRouteLayerSolution(B);return this._isOverridden("title")||(this.title=m.routeInfo.name??"Route"),gr(m,g,P),m}update(e){const{stops:r,directionLines:o,directionPoints:s,pointBarriers:a,polylineBarriers:y,polygonBarriers:u,routeInfo:d}=e;this.set({stops:r,pointBarriers:a,polylineBarriers:y,polygonBarriers:u}),this._set("directionLines",o),this._set("directionPoints",s),this._set("routeInfo",d),d.geometry!=null&&(this.spatialReference=d.geometry.spatialReference)}_getNetworkFeatures(e,r,o,s){const a=ue(e)?e.layers:e.featureCollection?.layers,y=a?.find(f=>f.layerDefinition.name===r);if(y==null)return new L;const{layerDefinition:u,popupInfo:d,featureSet:g}=y,h=u.drawingInfo.renderer,{features:n}=g,b=g.spatialReference??u.spatialReference??u.extent.spatialReference??je,P=h&&ft(h),B=W.fromJSON(b),m=n.map(f=>{const w=Q.fromJSON(f);w.geometry!=null&&f.geometry!=null&&f.geometry.spatialReference==null&&(w.geometry.spatialReference=B);const l=o(w);return l.symbol??=P?.getSymbol(w)??this._getNetworkSymbol(r),l.popupTemplate??=d&&pt.fromJSON(d),l});return s&&m.some(({symbol:f})=>!f)&&s(m),new L(m)}_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(this._cachedServiceDescription!=null&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const s=await Ke(e,r,o);return this._cachedServiceDescription={serviceDescription:s,url:e},s}_setStopSymbol(e){if(!e||e.length===0||this.defaultSymbols.stops==null||e.every(({symbol:n})=>n!=null))return;const{first:r,last:o,middle:s,unlocated:a,waypoint:y,break:u}=this.defaultSymbols.stops;if(this.routeInfo==null||e.length===1)return void e.forEach((n,b)=>{switch(b){case 0:n.symbol=r;break;case e.length-1:n.symbol=o;break;default:n.symbol=s}});const d=e.map(({sequence:n})=>n).filter(n=>n!=null),g=Math.min(...d),h=Math.max(...d);for(const n of e)n.sequence!==g?n.sequence!==h?n.status==="ok"||n.status==="not-located-on-closest"?n.locationType!=="waypoint"?n.locationType!=="break"?n.symbol=s:n.symbol=u:n.symbol=y:n.symbol=a:n.symbol=o:n.symbol=r}_toRouteLayerSolution(e){const r=e.routeResults[0].stops?.map(h=>se.fromJSON(h.toJSON()));this._setStopSymbol(r);const o=new Ee(r),s=new ke(e.polygonBarriers?.map(h=>{const n=oe.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.polygonBarriers,n})),a=new xe(e.polylineBarriers?.map(h=>{const n=ie.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.polylineBarriers,n})),y=new Je(e.pointBarriers?.map(h=>{const n=re.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.pointBarriers,n})),u=e.routeResults[0].route?.toJSON(),d=we.fromJSON(u);d.symbol=this.defaultSymbols.routeInfo;const g=new Br(e.routeResults[0].directionPoints?.features.map(h=>{const n=ye.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.directionPoints,n}));return{directionLines:new br(e.routeResults[0].directionLines?.features.map(h=>{const n=pe.fromJSON(h.toJSON());return n.symbol=this.defaultSymbols.directionLines,n})),directionPoints:g,pointBarriers:y,polygonBarriers:s,polylineBarriers:a,routeInfo:d,stops:o}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",pe.fields,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",ye.fields,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,r,o,s,a,y){if(!e?.length)return null;const u=this.spatialReference.toJSON(),{fullExtent:d,maxScale:g,minScale:h}=this;return{featureSet:{features:e.toArray().map(n=>Sr(n)),geometryType:o,spatialReference:u},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:r!=null?r.toJSON():Pe(o)}},extent:d.toJSON(),fields:s,geometryType:o,hasM:!1,hasZ:!1,maxScale:g,minScale:h,name:a,objectIdField:"ObjectID",spatialReference:u,title:y,type:"Feature Layer",typeIdField:""}}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",re.fields,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",oe.fields,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",ie.fields,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(this.routeInfo!=null?new L([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",we.fields,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",se.fields,"Stops","Stops");if(e==null)return null;const{stops:r}=this.defaultSymbols,o=r?.first?.toJSON(),s=r?.middle?.toJSON(),a=r?.last?.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:s,uniqueValueInfos:[{value:"1",symbol:o,label:"First Stop"},{value:`${this.stops.length}`,symbol:a,label:"Last Stop"}]},e}};t([i({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:this.portalItem==null}}}}}}})],v.prototype,"_featureCollection",void 0),t([$(["web-map","portal-item"],"_featureCollection")],v.prototype,"writeFeatureCollectionWebmap",null),t([i({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:this.portalItem!=null}}}}}}})],v.prototype,"_type",void 0),t([i({nonNullable:!0,type:ze})],v.prototype,"defaultSymbols",void 0),t([i({readOnly:!0})],v.prototype,"directionLines",void 0),t([N(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],v.prototype,"readDirectionLines",null),t([i({readOnly:!0})],v.prototype,"directionPoints",void 0),t([N(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],v.prototype,"readDirectionPoints",null),t([i({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],v.prototype,"featureCollectionType",void 0),t([i({readOnly:!0})],v.prototype,"fullExtent",null),t([i({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],v.prototype,"legendEnabled",void 0),t([i({type:["show","hide"]})],v.prototype,"listMode",void 0),t([i({type:Number,nonNullable:!0,json:{write:!1}})],v.prototype,"maxScale",void 0),t([N(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],v.prototype,"readMaxScale",null),t([i({type:Number,nonNullable:!0,json:{write:!1}})],v.prototype,"minScale",void 0),t([N(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],v.prototype,"readMinScale",null),t([i({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],v.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0,type:L.ofType(re)})],v.prototype,"pointBarriers",void 0),t([N(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],v.prototype,"readPointBarriers",null),t([i({nonNullable:!0,type:L.ofType(oe)})],v.prototype,"polygonBarriers",void 0),t([N(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],v.prototype,"readPolygonBarriers",null),t([i({nonNullable:!0,type:L.ofType(ie)})],v.prototype,"polylineBarriers",void 0),t([N(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],v.prototype,"readPolylineBarriers",null),t([i({readOnly:!0})],v.prototype,"routeInfo",void 0),t([N(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],v.prototype,"readRouteInfo",null),t([i({type:W})],v.prototype,"spatialReference",void 0),t([N(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],v.prototype,"readSpatialReference",null),t([i({nonNullable:!0,type:L.ofType(se)})],v.prototype,"stops",void 0),t([N(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],v.prototype,"readStops",null),t([i()],v.prototype,"title",null),t([i({readOnly:!0,json:{read:!1}})],v.prototype,"type",void 0),t([i()],v.prototype,"url",null),v=t([O(He)],v);const To=v;export{To as default}; diff --git a/custom-toc-highlight/assets/RouteLayerView2D-Bpui7Ggx-fxzuJ6ql.js b/custom-toc-highlight/assets/RouteLayerView2D-Bpui7Ggx-Dq8ar2NW.js similarity index 58% rename from custom-toc-highlight/assets/RouteLayerView2D-Bpui7Ggx-fxzuJ6ql.js rename to custom-toc-highlight/assets/RouteLayerView2D-Bpui7Ggx-Dq8ar2NW.js index 046d51ba..4bac3809 100644 --- a/custom-toc-highlight/assets/RouteLayerView2D-Bpui7Ggx-fxzuJ6ql.js +++ b/custom-toc-highlight/assets/RouteLayerView2D-Bpui7Ggx-Dq8ar2NW.js @@ -1 +1 @@ -import{ag as m,aL as u,aq as h,a2 as g,ah as c,v as n,S as d,i as _}from"./story-BfX8CRfG.js";import{f as w}from"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import{T as f,b as y,v as k,f as M,S as v,g as I,N as V}from"./Stop-he5xSAJJ-CGB43GGR.js";import{X as F,Y as G}from"./LayerView-Bish-E63-rB2WUWF4.js";import{d as H}from"./GraphicContainer-DuOHUciE-sEoQdKXZ.js";import{X as b}from"./GraphicsView2D-C4wYE2ut-DMrrhOCh.js";import"./main-ugzBrWNm.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./AGraphicContainer-LUCT6Gle-Dvv0TF4N.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";const C=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],s={graphic:null,property:null,oldValue:null,newValue:null};function l(t){return t instanceof f||t instanceof y||t instanceof k||t instanceof M||t instanceof v||t instanceof I||t instanceof V}function U(t){return m.isCollection(t)&&t.length&&l(t.at(0))}function A(t){return Array.isArray(t)&&t.length>0&&l(t[0])}const T=new Set(["default"]);let p=class extends F(G){constructor(){super(...arguments),this._graphics=new m,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new w({getCollections:()=>this.layer==null||this.destroyed?[]:[this.layer.routeInfo!=null?new m([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(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(t,i){return this._graphicsView.hitTest(t).filter(({popupTemplate:r})=>!!r)}highlight(t){let i;i=l(t)?[this._getNetworkFeatureUid(t)]:A(t)?t.map(e=>this._getNetworkFeatureUid(e)):U(t)?t.map(e=>this._getNetworkFeatureUid(e)).toArray():[t.uid];const r=i.filter(h);return r.length?(this._addHighlight(r),g(()=>this._removeHighlight(r))):g()}async hitTest(t,i){if(this.suspended)return null;const r=this._graphicsView.hitTest(t).filter(h).map(o=>this._networkGraphicMap.get(o));if(!r.length)return null;const{layer:e}=this;return r.reverse().map(o=>({type:"route",layer:e,mapPoint:t,networkFeature:o}))}isUpdating(){return this._graphicsView.updating}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_createGraphic(t){const i=t.toGraphic();return i.layer=this.layer,i.sourceLayer=this.layer,i}_createGraphicsView(){const t=this.view,i=()=>this.requestUpdate(),r=new H(t.featuresTilingScheme);this._graphicsView=new b({container:r,graphics:this._graphics,requestUpdateCallback:i,view:t}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const i=this._networkGraphicMap.get(t);return C.indexOf(i.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(i=>{const r=this._networkFeatureMap.get(i);return this._networkFeatureMap.delete(i),this._networkGraphicMap.delete(r),r}));for(const i of t.removed)this.removeHandles(i)}if(t.added.length){this._graphics.addMany(t.added.map(i=>{const r=this._createGraphic(i);return r.symbol==null?null:(this._networkFeatureMap.set(i,r),this._networkGraphicMap.set(r,i),r)}).filter(h));for(const i of t.added)this.addHandles([c(()=>i.geometry,(r,e)=>{this._updateGraphic(i,"geometry",r,e)}),c(()=>i.symbol,(r,e)=>{this._updateGraphic(i,"symbol",r,e)})],i);this._graphics.sort((i,r)=>this._getDrawOrder(i)-this._getDrawOrder(r))}}_updateGraphic(t,i,r,e){if(!this._networkFeatureMap.has(t)){const a=this._createGraphic(t);return this._networkFeatureMap.set(t,a),this._networkGraphicMap.set(a,t),void this._graphics.add(a)}const o=this._networkFeatureMap.get(t);o[i]=r,s.graphic=o,s.property=i,s.oldValue=e,s.newValue=r,this._graphicsView.graphicUpdateHandler(s)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),i=this._getHighlightBits(T);this._graphicsView.setHighlight(t.map(r=>({objectId:r,highlightFlags:i})))}};n([d()],p.prototype,"_graphics",void 0),n([d()],p.prototype,"_routeItems",null),p=n([_("esri.views.2d.layers.RouteLayerView2D")],p);const Ai=p;export{Ai as default}; +import{ag as m,aL as u,aq as h,a2 as g,ah as c,v as n,S as d,i as _}from"./story-Doly9N9p.js";import{f as w}from"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import{T as f,b as y,v as k,f as M,S as v,g as I,N as V}from"./Stop-he5xSAJJ-BA1tUkNc.js";import{X as F,Y as G}from"./LayerView-Bish-E63-DK1SFHE3.js";import{d as H}from"./GraphicContainer-DuOHUciE-XlTfJEn3.js";import{X as b}from"./GraphicsView2D-C4wYE2ut-DdVMjjMv.js";import"./main-QGPoLsvl.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";const C=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],s={graphic:null,property:null,oldValue:null,newValue:null};function l(t){return t instanceof f||t instanceof y||t instanceof k||t instanceof M||t instanceof v||t instanceof I||t instanceof V}function U(t){return m.isCollection(t)&&t.length&&l(t.at(0))}function A(t){return Array.isArray(t)&&t.length>0&&l(t[0])}const T=new Set(["default"]);let p=class extends F(G){constructor(){super(...arguments),this._graphics=new m,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new w({getCollections:()=>this.layer==null||this.destroyed?[]:[this.layer.routeInfo!=null?new m([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(){this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),this._get("_routeItems")?.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeaturesAtLocation(t,i){return this._graphicsView.hitTest(t).filter(({popupTemplate:r})=>!!r)}highlight(t){let i;i=l(t)?[this._getNetworkFeatureUid(t)]:A(t)?t.map(e=>this._getNetworkFeatureUid(e)):U(t)?t.map(e=>this._getNetworkFeatureUid(e)).toArray():[t.uid];const r=i.filter(h);return r.length?(this._addHighlight(r),g(()=>this._removeHighlight(r))):g()}async hitTest(t,i){if(this.suspended)return null;const r=this._graphicsView.hitTest(t).filter(h).map(o=>this._networkGraphicMap.get(o));if(!r.length)return null;const{layer:e}=this;return r.reverse().map(o=>({type:"route",layer:e,mapPoint:t,networkFeature:o}))}isUpdating(){return this._graphicsView.updating}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i);this._highlightIds.set(i,r+1)}else this._highlightIds.set(i,1);this._updateHighlight()}_createGraphic(t){const i=t.toGraphic();return i.layer=this.layer,i.sourceLayer=this.layer,i}_createGraphicsView(){const t=this.view,i=()=>this.requestUpdate(),r=new H(t.featuresTilingScheme);this._graphicsView=new b({container:r,graphics:this._graphics,requestUpdateCallback:i,view:t}),this.container.addChild(r),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const i=this._networkGraphicMap.get(t);return C.indexOf(i.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const i of t)if(this._highlightIds.has(i)){const r=this._highlightIds.get(i)-1;r===0?this._highlightIds.delete(i):this._highlightIds.set(i,r)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(i=>{const r=this._networkFeatureMap.get(i);return this._networkFeatureMap.delete(i),this._networkGraphicMap.delete(r),r}));for(const i of t.removed)this.removeHandles(i)}if(t.added.length){this._graphics.addMany(t.added.map(i=>{const r=this._createGraphic(i);return r.symbol==null?null:(this._networkFeatureMap.set(i,r),this._networkGraphicMap.set(r,i),r)}).filter(h));for(const i of t.added)this.addHandles([c(()=>i.geometry,(r,e)=>{this._updateGraphic(i,"geometry",r,e)}),c(()=>i.symbol,(r,e)=>{this._updateGraphic(i,"symbol",r,e)})],i);this._graphics.sort((i,r)=>this._getDrawOrder(i)-this._getDrawOrder(r))}}_updateGraphic(t,i,r,e){if(!this._networkFeatureMap.has(t)){const a=this._createGraphic(t);return this._networkFeatureMap.set(t,a),this._networkGraphicMap.set(a,t),void this._graphics.add(a)}const o=this._networkFeatureMap.get(t);o[i]=r,s.graphic=o,s.property=i,s.oldValue=e,s.newValue=r,this._graphicsView.graphicUpdateHandler(s)}_updateHighlight(){const t=Array.from(this._highlightIds.keys()),i=this._getHighlightBits(T);this._graphicsView.setHighlight(t.map(r=>({objectId:r,highlightFlags:i})))}};n([d()],p.prototype,"_graphics",void 0),n([d()],p.prototype,"_routeItems",null),p=n([_("esri.views.2d.layers.RouteLayerView2D")],p);const Ai=p;export{Ai as default}; diff --git a/custom-toc-highlight/assets/SDFHelper-B6k8Ig6R-BNeqNf2Z.js b/custom-toc-highlight/assets/SDFHelper-B6k8Ig6R-CgiA_-9V.js similarity index 95% rename from custom-toc-highlight/assets/SDFHelper-B6k8Ig6R-BNeqNf2Z.js rename to custom-toc-highlight/assets/SDFHelper-B6k8Ig6R-CgiA_-9V.js index 9a7b6532..ac01faab 100644 --- a/custom-toc-highlight/assets/SDFHelper-B6k8Ig6R-BNeqNf2Z.js +++ b/custom-toc-highlight/assets/SDFHelper-B6k8Ig6R-CgiA_-9V.js @@ -1 +1 @@ -import{l as V}from"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import{eQ as X}from"./story-BfX8CRfG.js";import{o as U}from"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import{C as D,n as Y}from"./definitions-DJSdSb77-DkoRHaVx.js";const _=.45;function j(n,t=.5){switch(n.type){case"CIMPointSymbol":{const r=n.symbolLayers;if(!r||r.length!==1)return null;const o=r[0];return o.type!=="CIMVectorMarker"?null:j(o)}case"CIMVectorMarker":{const r=n.markerGraphics;if(!r||r.length!==1)return null;const o=r[0];if(!o)return null;const e=o.geometry;if(!e)return null;const i=o.symbol;return!i||i.type!=="CIMPolygonSymbol"&&i.type!=="CIMLineSymbol"||i.symbolLayers?.some(l=>!!l.effects)?null:{type:"sdf",geom:e,sdfPaddingRatio:t,asFill:i.type==="CIMPolygonSymbol"}}}}function q(n){return n?n.rings?n.rings:n.paths?n.paths:n.xmin!==void 0&&n.ymin!==void 0&&n.xmax!==void 0&&n.ymax!==void 0?[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]:null:null}function B(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return new U(t,o,r-t,e-o)}function L(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return[t,o,r,e]}function E(n){return n?n.rings?L(n.rings):n.paths?L(n.paths):X(n)?[n.xmin,n.ymin,n.xmax,n.ymax]:null:null}function N(n,t){const[r,o,e,i]=E(n),l=e-r,a=i-o,m=D,c=Y,s=Math.floor(.5*(m*t-c)),f=(m-2*(s+c))/Math.max(l,a),d=Math.round(l*f),h=Math.round(a*f);return{pixelDimensions:[l,a],texelDimensions:[Math.round((d+2*s)/f),Math.round((h+2*s)/f)]}}function O(n,t,r,o,e,i,l){const[a,m,c,s]=n;if(c_&&b<1&&(u=Math.min(b+.1,.99))}const x=D,M=Y,p=Math.floor(.5*(x*u-M)),g=(x-2*(p+M))/h,I=Math.round(f*g)+2*p,w=Math.round(d*g)+2*p;let y=1;t&&(y=w*(1-u)/((t.ymax-t.ymin)*g));let P=0,R=0,C=1;o&&(e?t&&r&&t.ymax-t.ymin>0&&(C=(t.xmax-t.xmin)/(t.ymax-t.ymin),P=o.x/(r*C),R=o.y/r):(P=o.x,R=o.y)),t&&(P=.5*(t.xmax+t.xmin)+P*(t.xmax-t.xmin),R=.5*(t.ymax+t.ymin)+R*(t.ymax-t.ymin)),P-=a,R-=m,P*=g,R*=g,P+=p,R+=p;let S=P/I-.5,v=R/w-.5;return e&&r&&(S*=r*C,v*=r),{frameSizeRatio:y,anchorX:S,anchorY:v,widthRatio:C,sdfPaddingRatio:u}}function T(n){const t=q(n.geom),r=B(t),o=D,e=Y,i=Math.floor(.5*(o*n.sdfPaddingRatio-e)),l=o-2*(i+e),a=l/Math.max(r.width,r.height),m=Math.round(r.width*a)+2*i,c=Math.round(r.height*a)+2*i,s=[];for(const d of t)if(d&&d.length>1){const h=[];for(const u of d){let[x,M]=u;x-=r.x,M-=r.y,x*=a,M*=a,x+=i-.5,M+=i-.5,n.asFill?h.push([x,M]):h.push([Math.round(x),Math.round(M)])}if(n.asFill){const u=h.length-1;h[0][0]===h[u][0]&&h[0][1]===h[u][1]||h.push(h[0])}s.push(h)}const f=G(s,m,c,i);return n.asFill&&H(s,m,c,i,f),{data:K(f,i),width:m,height:c,sdfPaddingRatio:n.sdfPaddingRatio,sdfDecodeCoeff:2*i/l}}function G(n,t,r,o){const e=t*r,i=new Array(e),l=o*o+1;for(let a=0;at&&(p=t),g<0&&(g=0),I>r&&(I=r);const w=f[0]-s[0],y=f[1]-s[1],P=w*w+y*y;for(let R=M;RP?(b=f[0],F=f[1]):(z/=P,b=s[0]+z*w,F=s[1]+z*y);const k=(S-b)*(S-b)+(v-F)*(v-F),A=(r-C-1)*t+R;kt-o&&(x=t-o),Mr-o&&(p=r-o);for(let g=M;gg==c[1]>g)continue;const I=g+.5,w=(r-g-1)*t;for(let y=u;y!!l.effects)?null:{type:"sdf",geom:e,sdfPaddingRatio:t,asFill:i.type==="CIMPolygonSymbol"}}}}function q(n){return n?n.rings?n.rings:n.paths?n.paths:n.xmin!==void 0&&n.ymin!==void 0&&n.xmax!==void 0&&n.ymax!==void 0?[[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]]]:null:null}function B(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return new U(t,o,r-t,e-o)}function L(n){let t=1/0,r=-1/0,o=1/0,e=-1/0;for(const i of n)for(const l of i)l[0]r&&(r=l[0]),l[1]e&&(e=l[1]);return[t,o,r,e]}function E(n){return n?n.rings?L(n.rings):n.paths?L(n.paths):X(n)?[n.xmin,n.ymin,n.xmax,n.ymax]:null:null}function N(n,t){const[r,o,e,i]=E(n),l=e-r,a=i-o,m=D,c=Y,s=Math.floor(.5*(m*t-c)),f=(m-2*(s+c))/Math.max(l,a),d=Math.round(l*f),h=Math.round(a*f);return{pixelDimensions:[l,a],texelDimensions:[Math.round((d+2*s)/f),Math.round((h+2*s)/f)]}}function O(n,t,r,o,e,i,l){const[a,m,c,s]=n;if(c_&&b<1&&(u=Math.min(b+.1,.99))}const x=D,M=Y,p=Math.floor(.5*(x*u-M)),g=(x-2*(p+M))/h,I=Math.round(f*g)+2*p,w=Math.round(d*g)+2*p;let y=1;t&&(y=w*(1-u)/((t.ymax-t.ymin)*g));let P=0,R=0,C=1;o&&(e?t&&r&&t.ymax-t.ymin>0&&(C=(t.xmax-t.xmin)/(t.ymax-t.ymin),P=o.x/(r*C),R=o.y/r):(P=o.x,R=o.y)),t&&(P=.5*(t.xmax+t.xmin)+P*(t.xmax-t.xmin),R=.5*(t.ymax+t.ymin)+R*(t.ymax-t.ymin)),P-=a,R-=m,P*=g,R*=g,P+=p,R+=p;let S=P/I-.5,v=R/w-.5;return e&&r&&(S*=r*C,v*=r),{frameSizeRatio:y,anchorX:S,anchorY:v,widthRatio:C,sdfPaddingRatio:u}}function T(n){const t=q(n.geom),r=B(t),o=D,e=Y,i=Math.floor(.5*(o*n.sdfPaddingRatio-e)),l=o-2*(i+e),a=l/Math.max(r.width,r.height),m=Math.round(r.width*a)+2*i,c=Math.round(r.height*a)+2*i,s=[];for(const d of t)if(d&&d.length>1){const h=[];for(const u of d){let[x,M]=u;x-=r.x,M-=r.y,x*=a,M*=a,x+=i-.5,M+=i-.5,n.asFill?h.push([x,M]):h.push([Math.round(x),Math.round(M)])}if(n.asFill){const u=h.length-1;h[0][0]===h[u][0]&&h[0][1]===h[u][1]||h.push(h[0])}s.push(h)}const f=G(s,m,c,i);return n.asFill&&H(s,m,c,i,f),{data:K(f,i),width:m,height:c,sdfPaddingRatio:n.sdfPaddingRatio,sdfDecodeCoeff:2*i/l}}function G(n,t,r,o){const e=t*r,i=new Array(e),l=o*o+1;for(let a=0;at&&(p=t),g<0&&(g=0),I>r&&(I=r);const w=f[0]-s[0],y=f[1]-s[1],P=w*w+y*y;for(let R=M;RP?(b=f[0],F=f[1]):(z/=P,b=s[0]+z*w,F=s[1]+z*y);const k=(S-b)*(S-b)+(v-F)*(v-F),A=(r-C-1)*t+R;kt-o&&(x=t-o),Mr-o&&(p=r-o);for(let g=M;gg==c[1]>g)continue;const I=g+.5,w=(r-g-1)*t;for(let y=u;y{let e=class extends a{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const c={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&m(c,t.effectiveScaleRange);const l=this._get("effectiveScaleRange");return l&&l.minScale===c.minScale&&l.maxScale===c.maxScale?l:c}};return n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),n([i({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=n([S("esri.layers.mixins.ScaleRangeLayer")],e),e};function m(a,e){return a.minScale=a.minScale>0?e.minScale>0?Math.min(a.minScale,e.minScale):a.minScale:e.minScale,a.maxScale=a.maxScale>0?e.maxScale>0?Math.max(a.maxScale,e.maxScale):a.maxScale:e.maxScale,a}export{s as S}; +import{v as n,S as i,i as S}from"./story-Doly9N9p.js";const s=a=>{let e=class extends a{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const c={minScale:this.minScale,maxScale:this.maxScale},t=this.parent;t&&"effectiveScaleRange"in t&&m(c,t.effectiveScaleRange);const l=this._get("effectiveScaleRange");return l&&l.minScale===c.minScale&&l.maxScale===c.maxScale?l:c}};return n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"minScale",void 0),n([i({type:Number,nonNullable:!0,json:{write:!0}})],e.prototype,"maxScale",void 0),n([i({readOnly:!0})],e.prototype,"effectiveScaleRange",null),e=n([S("esri.layers.mixins.ScaleRangeLayer")],e),e};function m(a,e){return a.minScale=a.minScale>0?e.minScale>0?Math.min(a.minScale,e.minScale):a.minScale:e.minScale,a.maxScale=a.maxScale>0?e.maxScale>0?Math.max(a.maxScale,e.maxScale):a.maxScale:e.maxScale,a}export{s as S}; diff --git a/custom-toc-highlight/assets/SceneLayer-DOh9PmQy-CNOlY0yu.js b/custom-toc-highlight/assets/SceneLayer-DOh9PmQy-BMYFGe4d.js similarity index 83% rename from custom-toc-highlight/assets/SceneLayer-DOh9PmQy-CNOlY0yu.js rename to custom-toc-highlight/assets/SceneLayer-DOh9PmQy-BMYFGe4d.js index 75dc0105..e299d935 100644 --- a/custom-toc-highlight/assets/SceneLayer-DOh9PmQy-CNOlY0yu.js +++ b/custom-toc-highlight/assets/SceneLayer-DOh9PmQy-BMYFGe4d.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-BcQn3A1C.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-9sQxfkoa-KicvrT8N.js","./utils-Bq23Xwmj--_SaacS5.js","./EditBusLayer-Df29OyJh-DkVkxUAl.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); -import{_ as M}from"./main-ugzBrWNm.js";import{v as i,S as s,i as b,bA as te,ag as $,l as A,b0 as q,a0 as v,aa as re,aA as ie,bT as C,a1 as f,W as se,o as d,j3 as oe,bi as ae,w as ne,bU as N,bP as P,aU as le,aw as pe,bC as de,bL as ue,e as U,ai as ye,av as ce,a4 as me,f as Y,P as he,bX as fe,dL as G}from"./story-BfX8CRfG.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{u as ge}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{m as ve}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{F as we}from"./Mesh-DLzjDUIO-COeC-iS-.js";import{D as be}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{b as Ie,v as Le,g as Fe}from"./meshSpatialReferenceScaleUtils-B1zR72Os-D-3pcUSm.js";import{n as Se}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{a as _e}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{i as Te}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{C as Ee}from"./EditBusLayer-Df29OyJh-DkVkxUAl.js";import{E as Oe}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as xe}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{W as Ae,f as V}from"./SceneService-BZqGtWmG-BWCHkX1O.js";import{m as Pe}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{w as k,r as Re}from"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import{k as Q}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import{L as z}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{b as De}from"./associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js";import{t as $e}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{$ as Ue,Y as qe,_ as Ce,X as Ne,V as Ge}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{l as Ve,A as ke}from"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import{e as Qe,c as ze}from"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import{f as We}from"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import{o as Je}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{y as Z,o as Ke,d as He,m as Me}from"./I3SLayerDefinitions-CwLXCKtU-CvmIU1C5.js";import{w as Ye,F as Ze}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{C as Be,q as W}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{v as Xe}from"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import{p as et}from"./fetchService-DbaKmJhP-W7rGyykJ.js";import{C as tt}from"./persistable-C6RBwzJi-CMdP5i4h.js";import{J as rt,a as it}from"./projection-BA9M1R7d-BYoCXVXt.js";import{g as st}from"./styleUtils-ChrJTYIw-BfDrXrWd.js";import{b as ot}from"./Query-BrwMGK8U-DoFNfkjX.js";import{k as J,z as at,j as nt}from"./elevationInfoUtils-mOZsPH2J-If61I1du.js";import{w as lt}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import{_ as pt}from"./I3SUtil-Bq8KpP2j-BW-Cczln.js";import{h as dt,m as ut}from"./popupUtils-nV1O8RUO-DAL58cHP.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./MeshTransform-C--IG09w-DoQndDth.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BrXZAXDf.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js";import"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import"./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-BuNk6xPZ.js";import"./plane-Dt8R0KeE-CVSP2GQG.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./deduplicate-D2d-E5Pw-CQcmF3ab.js";import"./projectPointToVector-B2UUY9SE-BChPjj6-.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./vertexSpaceConversion-CiKaVq_u-D2kQTb17.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import"./vec3-BazNroeq-PdcGTXFi.js";import"./BufferView-PQoE3GL7-Duht5lAO.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-BagfV9qf.js";import"./External-D_wl4XAw-P7VLSnKi.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./jsonContext-BA8GHqVk-CWQlLGSw.js";import"./resourceUtils-BmW6QqlX-B1DAUGNs.js";import"./resourceUtils-rTM6Iemx-BROWZCZ1.js";import"./saveUtils-CIYk-dsQ-VGcOewby.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-BNH6JkTz.js";import"./projectVectorToVector-sIYLNlex-B_PqSyiH.js";import"./sphere-BenPORjV-DaZ5Vv8x.js";import"./I3SBinaryReader-DEbI3cKZ-Bdob26G6.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-BCiifXla.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";function B({associatedLayer:e,serviceUpdateTimeStamp:t}){const r=e?.editingInfo?.lastEditDate,a=e?.serverGens,n=r!=null,l=t!=null,p=n&&l&&t.lastUpdate!==r.getTime();return n&&(p||!l&&a?.minServerGen!==a?.serverGen)}const yt=e=>{let t=class extends e{constructor(){super(...arguments),this.serviceTimeInfo=null}get timeInfo(){const r=this.associatedLayer?.timeInfo;if(r==null)return null;const a=r.clone();return G(a,this.fieldsIndex),a}set timeInfo(r){G(r,this.fieldsIndex),this._override("timeInfo",r)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(r){this._override("timeExtent",r)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(r){this._override("timeOffset",r)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(r){this._override("datesInUnknownTimezone",r)}async loadTimeInfoFromService(r){const{serviceTimeInfo:a}=this;if(a==null)return;const{startTimeField:n,endTimeField:l}=a;if(n==null&&l==null||B({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const p=async y=>{let m=null;try{m=(await this.fetchStatistics?.(y,r))?.stats}catch{}if(m==null)return null;const{minTimeStr:I,min:E,maxTimeStr:O,max:x}=m,F=y===n?I??E:O??x;return F!=null?new Date(F):null},[u,c]=await Promise.all([p(n),p(l)]);if(n!=null&&u==null||l!=null&&c==null)return;const h=new Q({start:u,end:c});this.setAtOrigin("timeInfo",new k({endField:l,startField:n,fullTimeExtent:h}),"service")}};return i([s({type:k,json:{read:!1,write:!1}})],t.prototype,"timeInfo",null),i([s({type:Q,json:{read:!1,write:!1}})],t.prototype,"timeExtent",null),i([s({type:Re,json:{read:!1,write:!1}})],t.prototype,"timeOffset",null),i([s({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],t.prototype,"datesInUnknownTimezone",null),i([s({type:L,readOnly:!0,json:{read:{source:"timeInfo"}}})],t.prototype,"serviceTimeInfo",void 0),t=i([b("esri.layers.mixins.TemporalSceneLayer")],t),t};let L=class extends U{constructor(){super(...arguments),this.endTimeField=null,this.startTimeField=null}};i([s({type:String})],L.prototype,"endTimeField",void 0),i([s({type:String})],L.prototype,"startTimeField",void 0),L=i([b("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],L);let g=class extends U{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"name",void 0),i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"field",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"currentRangeExtent",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"fullRangeExtent",void 0),i([s({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],g.prototype,"type",void 0),g=i([b("esri.layers.support.RangeInfo")],g);var _;let R=_=class extends te($.ofType(A)){constructor(e){super(e)}clone(){return new _(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map(r=>{if(!t.equals(r.spatialReference)){if(!rt(r.spatialReference,t))return e?.messages?.push(new q("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const n=new A;it(r,n,t),r=n}const a=r.toJSON(e);return delete a.spatialReference,a}).filter(r=>r!=null):(e?.messages?.push(new q("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map(r=>r.toJSON(e)))}static fromJSON(e,t){const r=new _;return e.forEach(a=>r.add(A.fromJSON(a,t))),r}};R=_=i([b("esri.layers.support.PolygonCollection")],R);const T=R;var D;let w=D=class extends U{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new T,this._geometriesSource=null}initialize(){this.addHandles(ye(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,ce))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=T.fromJSON(e,r):this._geometriesSource={url:me(e,r),context:r}}async loadGeometries(e,t){if(this._geometriesSource==null)return;const{url:r,context:a}=this._geometriesSource,n=await Y(r,{responseType:"json",signal:t?.signal}),l=e.toJSON(),p=n.data.map(u=>({...u,spatialReference:l}));this.geometries=T.fromJSON(p,a),this._geometriesSource=null}clone(){const e=new D({geometries:he(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};i([s({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],w.prototype,"spatialRelationship",void 0),i([s({type:T,nonNullable:!0,json:{write:!0}}),tt({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],w.prototype,"geometries",void 0),i([v(["web-scene","portal-item"],"geometries")],w.prototype,"readGeometries",null),w=D=i([b("esri.layers.support.SceneFilter")],w);const ct=w;async function mt({fieldName:e,statisticsInfo:t,errorContext:r,fieldsIndex:a,path:n,customParameters:l,apiKey:p,signal:u}){if(t==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics are not available for this layer");const c=a.get(e);if(c==null)throw new d(`${r}:field-unexisting`,`Field '${e}' does not exist on the layer`);const h=t.find(I=>I.name===c.name);if(h==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics for this attribute are not available");const y=fe(n,h.href),{data:m}=await Y(y,{query:{f:"json",...l,token:p},responseType:"json",signal:u});return m}async function ht(e){const t=[];for(const r of e)r.name.toLowerCase().endsWith(".zip")?t.push(ft(r)):t.push(Promise.resolve(r));return(await Promise.all(t)).flat()}async function ft(e){const{BlobReader:t,ZipReader:r,BlobWriter:a}=await M(()=>import("./zipjs-wrapper-DlcHxyCX-BFxi6l53.js"),[],import.meta.url),n=[];return(await new r(new t(e)).getEntries()).forEach(l=>{if(l.directory||/^__MACOS/i.test(l.filename))return;const p=new a,u=l.getData?.(p).then(c=>new File([c],l.filename));u&&n.push(u)}),Promise.all(n)}const gt=new Set(["3DObject","Point"]),K=We();let o=class extends yt(Ee(Ae(_e(Oe(xe(je(ve(Te(Se(re(be))))))))))){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 $,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,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=ie(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&r.type!=="inherited"?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get attributeTableTemplate(){return this.associatedLayer?.attributeTableTemplate??null}get fieldsIndex(){return new Je(this.fields)}readNodePages(e,t,r){return t.layerType==="Point"&&(e=t.pointNodePages),e==null||typeof e!="object"?null:Z.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&Ve(this.associatedLayer)}get geometryType(){return vt[this.profile]||"mesh"}set renderer(e){C(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(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=e??$e;const{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsRollbackOnFailure:n,supportsUploadWithItemId:l,supportsGeometryUpdate:p,supportsReturnServiceEditsInSourceSpatialReference:u},data:{supportsZ:c,supportsM:h,isVersioned:y,supportsAttachment:m},operations:{supportsEditing:I,supportsAdd:E,supportsUpdate:O,supportsDelete:x,supportsQuery:F,supportsQueryAttachments:X,supportsAsyncConvert3D:ee}}=e,S=e.operations.supportsChangeTracking,j=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsReturnServiceEditsInSourceSpatialReference:u,supportsRollbackOnFailure:n,supportsGeometryUpdate:j&&p,supportsUploadWithItemId:l},data:{supportsAttachment:m,supportsZ:c,supportsM:h,isVersioned:y},operations:{supportsQuery:F,supportsQueryAttachments:X,supportsEditing:I&&S,supportsAdd:j&&E&&S,supportsDelete:j&&x&&S,supportsUpdate:O&&S,supportsAsyncConvert3D:ee}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeOID"&&(e=r.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeGlobalID"&&(e=r.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return r!=null&&H[r]?H[r]:(f.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e!=null?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(se),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await st(this,{origin:"service"},t),C(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){f.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ot;return this.geometryType==="mesh"?this.associatedLayer?.infoFor3D&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(r=>{if(r?.features)for(const a of r.features)a.layer=this,a.sourceLayer=this;return r})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=oe(this.fieldsIndex,await dt(this,ut(this)));return pt(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||r.length===0)throw new d("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const a=new ae;return a.attributes=r[0],a.layer=this,a.sourceLayer=this,a}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(f.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return lt(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!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){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(V.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(V.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await M(()=>import("./editingSupport-gUqP9iyf-BcQn3A1C.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);let a=t;await this.load();const n=this.associatedLayer;if(!n)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:l}=n,p=!!n.infoFor3D,u=a?.globalIdUsed??!0;if(p&&l==null)throw new d(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(p&&!u)throw new d(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return z(n.url)&&p&&e.deleteFeatures!=null&&l!=null&&(a={...a,globalIdToObjectId:await ke(n,e.deleteFeatures,l)}),r(this,n.source,e,a)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){t??={};const r=y=>{throw f.getLogger(this).error(".convertMesh()",y.message),y};await this.load(),this.infoFor3D||r(new d("invalid:layer","SceneLayer has no capability for mesh conversion"));const a=await this.extractAndFilterFiles(e),n=a.reduce((y,m)=>Ye(this.infoFor3D,m)?y+1:y,0);n===0&&r(new Ie),n>1&&r(new Le);const l=this.spatialReference,p=t.location??new ne({x:0,y:0,z:0,spatialReference:l}),u=p.spatialReference.isGeographic?"local":"georeferenced",c=we.createWithExternalSource(p,a,{vertexSpace:u,transform:Fe(p.spatialReference),unitConversionDisabled:!0}),[h]=await this.uploadAssets([c],{...t,useAssetOrigin:!t.location});return h}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await ht(e)).filter(r=>Ze(t,r)):e}validateLayer(e){if(e.layerType&&!gt.has(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(r,a){let n=!1,l=!1;if(r==null)n=!0,l=!0;else{const p=a&&a.isGeographic;switch(r){case"east-north-up":case"earth-centered":n=!0,l=p;break;case"vertex-reference-frame":n=!0,l=!p;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?.some(n=>n.name===e.name),r=!!this.associatedLayer?.fields?.some(n=>n&&e.name===n.name),a={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=a}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=N(this);for(let r=0;rthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?f.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):f.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;this.profile==="mesh-pyramids"&&J(f.getLogger(this),at("Mesh scene layers","relative-to-scene",e)),J(f.getLogger(this),nt("Scene layers",e))}async fetchStatistics(e,t){return await mt({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};i([s({types:{key:"type",base:Qe,typeMap:{selection:ze}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],o.prototype,"featureReduction",void 0),i([s({type:[g],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],o.prototype,"rangeInfos",void 0),i([s({json:{read:!1}})],o.prototype,"associatedLayer",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["ArcGISSceneServiceLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({...K.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"fields",void 0),i([s()],o.prototype,"types",null),i([s()],o.prototype,"typeIdField",null),i([s()],o.prototype,"templates",null),i([s()],o.prototype,"formTemplate",null),i([s()],o.prototype,"attributeTableTemplate",null),i([s({readOnly:!0,clonable:!1})],o.prototype,"fieldsIndex",null),i([s({type:Xe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],o.prototype,"floorInfo",void 0),i([s(K.outFields)],o.prototype,"outFields",void 0),i([s({type:Z,readOnly:!0,json:{read:!1}})],o.prototype,"nodePages",void 0),i([v("service","nodePages",["nodePages","pointNodePages"])],o.prototype,"readNodePages",null),i([s({type:[Ke],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[He],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[Me],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),i([s({readOnly:!0})],o.prototype,"statisticsInfo",void 0),i([s({type:$.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],o.prototype,"excludeObjectIds",void 0),i([s({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),i([s({type:ct,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],o.prototype,"filter",void 0),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),i([s(Ue)],o.prototype,"elevationInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"effectiveCapabilities",null),i([s({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),i([s({type:String})],o.prototype,"geometryType",null),i([s(qe)],o.prototype,"labelsVisible",void 0),i([s({type:[Be],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:W},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:W},write:!0}})],o.prototype,"labelingInfo",void 0),i([s(Ce)],o.prototype,"legendEnabled",void 0),i([s({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){if(typeof e=="number"&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return r!==void 0?de(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],o.prototype,"opacity",void 0),i([s({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"priority",void 0),i([s({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"semantic",void 0),i([s({types:ge,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],o.prototype,"renderer",null),i([s({json:{read:!1}})],o.prototype,"cachedDrawingInfo",void 0),i([v("service","cachedDrawingInfo")],o.prototype,"readCachedDrawingInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"capabilities",null),i([s({type:Boolean,json:{read:!1}})],o.prototype,"editingEnabled",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"infoFor3D",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"relationships",null),i([s(Ne)],o.prototype,"popupEnabled",void 0),i([s({type:ue,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),i([s({type:String,json:{read:!1}})],o.prototype,"objectIdField",void 0),i([v("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdField",null),i([s({type:String,json:{read:!1}})],o.prototype,"globalIdField",void 0),i([v("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdField",null),i([s({readOnly:!0,type:String,json:{read:!1}})],o.prototype,"displayField",null),i([s({type:String,json:{read:!1}})],o.prototype,"profile",void 0),i([v("service","profile",["store.profile"])],o.prototype,"readProfile",null),i([s({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],o.prototype,"normalReferenceFrame",void 0),i([s(Ge)],o.prototype,"screenSizePerspectiveEnabled",void 0),i([s({json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),i([s(Pe)],o.prototype,"useViewTime",null),o=i([b("esri.layers.SceneLayer")],o);const H={"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"},vt={"mesh-pyramids":"mesh",points:"point"},_i=o;export{_i as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-C_ld1skV.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./EditBusLayer-Df29OyJh-OmdJOLws.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); +import{_ as M}from"./main-QGPoLsvl.js";import{v as i,S as s,i as b,bA as te,ag as $,l as A,b0 as q,a0 as v,aa as re,aA as ie,bT as C,a1 as f,W as se,o as d,j3 as oe,bi as ae,w as ne,bU as N,bP as P,aU as le,aw as pe,bC as de,bL as ue,e as U,ai as ye,av as ce,a4 as me,f as Y,P as he,bX as fe,dL as G}from"./story-Doly9N9p.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{u as ge}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{m as ve}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{F as we}from"./Mesh-DLzjDUIO-BwXS6N6_.js";import{D as be}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{b as Ie,v as Le,g as Fe}from"./meshSpatialReferenceScaleUtils-B1zR72Os-ndChBRyc.js";import{n as Se}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{a as _e}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{i as Te}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{C as Ee}from"./EditBusLayer-Df29OyJh-OmdJOLws.js";import{E as Oe}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as xe}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{W as Ae,f as V}from"./SceneService-BZqGtWmG-BBytd6YJ.js";import{m as Pe}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{w as k,r as Re}from"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import{k as Q}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import{L as z}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{b as De}from"./associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js";import{t as $e}from"./capabilities-Cjn77swe-Y9lFlGVh.js";import{$ as Ue,Y as qe,_ as Ce,X as Ne,V as Ge}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{l as Ve,A as ke}from"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import{e as Qe,c as ze}from"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import{f as We}from"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import{o as Je}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{y as Z,o as Ke,d as He,m as Me}from"./I3SLayerDefinitions-CwLXCKtU-BdHWzf5u.js";import{w as Ye,F as Ze}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{C as Be,q as W}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{v as Xe}from"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import{p as et}from"./fetchService-DbaKmJhP-Ccg-phWf.js";import{C as tt}from"./persistable-C6RBwzJi-CrVVP3ny.js";import{J as rt,a as it}from"./projection-BA9M1R7d-CAbqHZiw.js";import{g as st}from"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import{b as ot}from"./Query-BrwMGK8U-BPr0_G9t.js";import{k as J,z as at,j as nt}from"./elevationInfoUtils-mOZsPH2J-BlRQDLDN.js";import{w as lt}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import{_ as pt}from"./I3SUtil-Bq8KpP2j--Kmryq4i.js";import{h as dt,m as ut}from"./popupUtils-nV1O8RUO-BYG2KoFf.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./MeshTransform-C--IG09w-Bbqagf1g.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BQk2dgMZ.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./MeshVertexAttributes-CbNpPur2-c8zcl8rF.js";import"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import"./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-cFTwC5-9.js";import"./plane-Dt8R0KeE-Bqc6oVGz.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./deduplicate-D2d-E5Pw-CTlujluz.js";import"./projectPointToVector-B2UUY9SE-BIKNGLey.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js";import"./vec3-BazNroeq-CRjQH4Pj.js";import"./BufferView-PQoE3GL7-B9DLdqO9.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-BHg6FqkT.js";import"./External-D_wl4XAw-DrOy4LUr.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./jsonContext-BA8GHqVk-BsXRY5es.js";import"./resourceUtils-BmW6QqlX-D_AxNrCI.js";import"./resourceUtils-rTM6Iemx-GPPQBysx.js";import"./saveUtils-CIYk-dsQ-Br9QCJTX.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-DCvzsrJt.js";import"./projectVectorToVector-sIYLNlex-DexDhaq1.js";import"./sphere-BenPORjV-B4uz1SYF.js";import"./I3SBinaryReader-DEbI3cKZ-0ASBQHPj.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-ilptOsP0.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";function B({associatedLayer:e,serviceUpdateTimeStamp:t}){const r=e?.editingInfo?.lastEditDate,a=e?.serverGens,n=r!=null,l=t!=null,p=n&&l&&t.lastUpdate!==r.getTime();return n&&(p||!l&&a?.minServerGen!==a?.serverGen)}const yt=e=>{let t=class extends e{constructor(){super(...arguments),this.serviceTimeInfo=null}get timeInfo(){const r=this.associatedLayer?.timeInfo;if(r==null)return null;const a=r.clone();return G(a,this.fieldsIndex),a}set timeInfo(r){G(r,this.fieldsIndex),this._override("timeInfo",r)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(r){this._override("timeExtent",r)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(r){this._override("timeOffset",r)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(r){this._override("datesInUnknownTimezone",r)}async loadTimeInfoFromService(r){const{serviceTimeInfo:a}=this;if(a==null)return;const{startTimeField:n,endTimeField:l}=a;if(n==null&&l==null||B({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;const p=async y=>{let m=null;try{m=(await this.fetchStatistics?.(y,r))?.stats}catch{}if(m==null)return null;const{minTimeStr:I,min:E,maxTimeStr:O,max:x}=m,F=y===n?I??E:O??x;return F!=null?new Date(F):null},[u,c]=await Promise.all([p(n),p(l)]);if(n!=null&&u==null||l!=null&&c==null)return;const h=new Q({start:u,end:c});this.setAtOrigin("timeInfo",new k({endField:l,startField:n,fullTimeExtent:h}),"service")}};return i([s({type:k,json:{read:!1,write:!1}})],t.prototype,"timeInfo",null),i([s({type:Q,json:{read:!1,write:!1}})],t.prototype,"timeExtent",null),i([s({type:Re,json:{read:!1,write:!1}})],t.prototype,"timeOffset",null),i([s({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],t.prototype,"datesInUnknownTimezone",null),i([s({type:L,readOnly:!0,json:{read:{source:"timeInfo"}}})],t.prototype,"serviceTimeInfo",void 0),t=i([b("esri.layers.mixins.TemporalSceneLayer")],t),t};let L=class extends U{constructor(){super(...arguments),this.endTimeField=null,this.startTimeField=null}};i([s({type:String})],L.prototype,"endTimeField",void 0),i([s({type:String})],L.prototype,"startTimeField",void 0),L=i([b("esri.layers.mixins.TemporalSceneLayer.SceneServiceTimeInfo")],L);let g=class extends U{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"name",void 0),i([s({type:String,json:{read:!0,write:!0}})],g.prototype,"field",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"currentRangeExtent",void 0),i([s({type:[Number],json:{read:!0,write:!0}})],g.prototype,"fullRangeExtent",void 0),i([s({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],g.prototype,"type",void 0),g=i([b("esri.layers.support.RangeInfo")],g);var _;let R=_=class extends te($.ofType(A)){constructor(e){super(e)}clone(){return new _(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){const t=e?.layer?.spatialReference;return t?this.toArray().map(r=>{if(!t.equals(r.spatialReference)){if(!rt(r.spatialReference,t))return e?.messages?.push(new q("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const n=new A;it(r,n,t),r=n}const a=r.toJSON(e);return delete a.spatialReference,a}).filter(r=>r!=null):(e?.messages?.push(new q("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map(r=>r.toJSON(e)))}static fromJSON(e,t){const r=new _;return e.forEach(a=>r.add(A.fromJSON(a,t))),r}};R=_=i([b("esri.layers.support.PolygonCollection")],R);const T=R;var D;let w=D=class extends U{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new T,this._geometriesSource=null}initialize(){this.addHandles(ye(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,ce))}readGeometries(e,t,r){Array.isArray(e)?this.geometries=T.fromJSON(e,r):this._geometriesSource={url:me(e,r),context:r}}async loadGeometries(e,t){if(this._geometriesSource==null)return;const{url:r,context:a}=this._geometriesSource,n=await Y(r,{responseType:"json",signal:t?.signal}),l=e.toJSON(),p=n.data.map(u=>({...u,spatialReference:l}));this.geometries=T.fromJSON(p,a),this._geometriesSource=null}clone(){const e=new D({geometries:he(this.geometries),spatialRelationship:this.spatialRelationship});return e._geometriesSource=this._geometriesSource,e}};i([s({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],w.prototype,"spatialRelationship",void 0),i([s({type:T,nonNullable:!0,json:{write:!0}}),tt({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries",contentAddressed:!0})],w.prototype,"geometries",void 0),i([v(["web-scene","portal-item"],"geometries")],w.prototype,"readGeometries",null),w=D=i([b("esri.layers.support.SceneFilter")],w);const ct=w;async function mt({fieldName:e,statisticsInfo:t,errorContext:r,fieldsIndex:a,path:n,customParameters:l,apiKey:p,signal:u}){if(t==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics are not available for this layer");const c=a.get(e);if(c==null)throw new d(`${r}:field-unexisting`,`Field '${e}' does not exist on the layer`);const h=t.find(I=>I.name===c.name);if(h==null)throw new d(`${r}:no-cached-statistics`,"Cached statistics for this attribute are not available");const y=fe(n,h.href),{data:m}=await Y(y,{query:{f:"json",...l,token:p},responseType:"json",signal:u});return m}async function ht(e){const t=[];for(const r of e)r.name.toLowerCase().endsWith(".zip")?t.push(ft(r)):t.push(Promise.resolve(r));return(await Promise.all(t)).flat()}async function ft(e){const{BlobReader:t,ZipReader:r,BlobWriter:a}=await M(()=>import("./zipjs-wrapper-DlcHxyCX-BFxi6l53.js"),[],import.meta.url),n=[];return(await new r(new t(e)).getEntries()).forEach(l=>{if(l.directory||/^__MACOS/i.test(l.filename))return;const p=new a,u=l.getData?.(p).then(c=>new File([c],l.filename));u&&n.push(u)}),Promise.all(n)}const gt=new Set(["3DObject","Point"]),K=We();let o=class extends yt(Ee(Ae(_e(Oe(xe(je(ve(Te(Se(re(be))))))))))){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 $,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,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=ie(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&r.type!=="inherited"?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get attributeTableTemplate(){return this.associatedLayer?.attributeTableTemplate??null}get fieldsIndex(){return new Je(this.fields)}readNodePages(e,t,r){return t.layerType==="Point"&&(e=t.pointNodePages),e==null||typeof e!="object"?null:Z.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&Ve(this.associatedLayer)}get geometryType(){return vt[this.profile]||"mesh"}set renderer(e){C(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(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=e??$e;const{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsRollbackOnFailure:n,supportsUploadWithItemId:l,supportsGeometryUpdate:p,supportsReturnServiceEditsInSourceSpatialReference:u},data:{supportsZ:c,supportsM:h,isVersioned:y,supportsAttachment:m},operations:{supportsEditing:I,supportsAdd:E,supportsUpdate:O,supportsDelete:x,supportsQuery:F,supportsQueryAttachments:X,supportsAsyncConvert3D:ee}}=e,S=e.operations.supportsChangeTracking,j=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:a,supportsReturnServiceEditsInSourceSpatialReference:u,supportsRollbackOnFailure:n,supportsGeometryUpdate:j&&p,supportsUploadWithItemId:l},data:{supportsAttachment:m,supportsZ:c,supportsM:h,isVersioned:y},operations:{supportsQuery:F,supportsQueryAttachments:X,supportsEditing:I&&S,supportsAdd:j&&E&&S,supportsDelete:j&&x&&S,supportsUpdate:O&&S,supportsAsyncConvert3D:ee}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeOID"&&(e=r.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(r=>(r.type==="esriFieldTypeGlobalID"&&(e=r.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return r!=null&&H[r]?H[r]:(f.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=e!=null?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(se),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await st(this,{origin:"service"},t),C(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){f.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ot;return this.geometryType==="mesh"?this.associatedLayer?.infoFor3D&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryFeatures(e||this.createQuery(),t)).then(r=>{if(r?.features)for(const a of r.features)a.layer=this,a.sourceLayer=this;return r})}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=oe(this.fieldsIndex,await dt(this,ut(this)));return pt(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,t){const r=await this.queryCachedAttributes(e,[t]);if(!r||r.length===0)throw new d("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const a=new ae;return a.attributes=r[0],a.layer=this,a.sourceLayer=this,a}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(r=>r.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(f.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return lt(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!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){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(V.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(V.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await M(()=>import("./editingSupport-gUqP9iyf-C_ld1skV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url);let a=t;await this.load();const n=this.associatedLayer;if(!n)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");await n.load();const{globalIdField:l}=n,p=!!n.infoFor3D,u=a?.globalIdUsed??!0;if(p&&l==null)throw new d(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(p&&!u)throw new d(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return z(n.url)&&p&&e.deleteFeatures!=null&&l!=null&&(a={...a,globalIdToObjectId:await ke(n,e.deleteFeatures,l)}),r(this,n.source,e,a)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){t??={};const r=y=>{throw f.getLogger(this).error(".convertMesh()",y.message),y};await this.load(),this.infoFor3D||r(new d("invalid:layer","SceneLayer has no capability for mesh conversion"));const a=await this.extractAndFilterFiles(e),n=a.reduce((y,m)=>Ye(this.infoFor3D,m)?y+1:y,0);n===0&&r(new Ie),n>1&&r(new Le);const l=this.spatialReference,p=t.location??new ne({x:0,y:0,z:0,spatialReference:l}),u=p.spatialReference.isGeographic?"local":"georeferenced",c=we.createWithExternalSource(p,a,{vertexSpace:u,transform:Fe(p.spatialReference),unitConversionDisabled:!0}),[h]=await this.uploadAssets([c],{...t,useAssetOrigin:!t.location});return h}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;return t?(await ht(e)).filter(r=>Ze(t,r)):e}validateLayer(e){if(e.layerType&&!gt.has(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(r,a){let n=!1,l=!1;if(r==null)n=!0,l=!0;else{const p=a&&a.isGeographic;switch(r){case"east-north-up":case"earth-centered":n=!0,l=p;break;case"vertex-reference-frame":n=!0,l=!p;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?.some(n=>n.name===e.name),r=!!this.associatedLayer?.fields?.some(n=>n&&e.name===n.name),a={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=a}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=N(this);for(let r=0;rthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?f.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):f.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;this.profile==="mesh-pyramids"&&J(f.getLogger(this),at("Mesh scene layers","relative-to-scene",e)),J(f.getLogger(this),nt("Scene layers",e))}async fetchStatistics(e,t){return await mt({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};i([s({types:{key:"type",base:Qe,typeMap:{selection:ze}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],o.prototype,"featureReduction",void 0),i([s({type:[g],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],o.prototype,"rangeInfos",void 0),i([s({json:{read:!1}})],o.prototype,"associatedLayer",void 0),i([s({type:["show","hide"]})],o.prototype,"listMode",void 0),i([s({type:["ArcGISSceneServiceLayer"]})],o.prototype,"operationalLayerType",void 0),i([s({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([s({...K.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"fields",void 0),i([s()],o.prototype,"types",null),i([s()],o.prototype,"typeIdField",null),i([s()],o.prototype,"templates",null),i([s()],o.prototype,"formTemplate",null),i([s()],o.prototype,"attributeTableTemplate",null),i([s({readOnly:!0,clonable:!1})],o.prototype,"fieldsIndex",null),i([s({type:Xe,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],o.prototype,"floorInfo",void 0),i([s(K.outFields)],o.prototype,"outFields",void 0),i([s({type:Z,readOnly:!0,json:{read:!1}})],o.prototype,"nodePages",void 0),i([v("service","nodePages",["nodePages","pointNodePages"])],o.prototype,"readNodePages",null),i([s({type:[Ke],readOnly:!0})],o.prototype,"materialDefinitions",void 0),i([s({type:[He],readOnly:!0})],o.prototype,"textureSetDefinitions",void 0),i([s({type:[Me],readOnly:!0})],o.prototype,"geometryDefinitions",void 0),i([s({readOnly:!0})],o.prototype,"serviceUpdateTimeStamp",void 0),i([s({readOnly:!0})],o.prototype,"attributeStorageInfo",void 0),i([s({readOnly:!0})],o.prototype,"statisticsInfo",void 0),i([s({type:$.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],o.prototype,"excludeObjectIds",void 0),i([s({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),i([s({type:ct,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],o.prototype,"filter",void 0),i([s({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],o.prototype,"path",void 0),i([s(Ue)],o.prototype,"elevationInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"effectiveCapabilities",null),i([s({readOnly:!0})],o.prototype,"effectiveEditingEnabled",null),i([s({type:String})],o.prototype,"geometryType",null),i([s(qe)],o.prototype,"labelsVisible",void 0),i([s({type:[Be],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:W},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:W},write:!0}})],o.prototype,"labelingInfo",void 0),i([s(Ce)],o.prototype,"legendEnabled",void 0),i([s({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){if(typeof e=="number"&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return r!==void 0?de(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],o.prototype,"opacity",void 0),i([s({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"priority",void 0),i([s({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"semantic",void 0),i([s({types:ge,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],o.prototype,"renderer",null),i([s({json:{read:!1}})],o.prototype,"cachedDrawingInfo",void 0),i([v("service","cachedDrawingInfo")],o.prototype,"readCachedDrawingInfo",null),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"capabilities",null),i([s({type:Boolean,json:{read:!1}})],o.prototype,"editingEnabled",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"infoFor3D",null),i([s({readOnly:!0,json:{write:!1,read:!1}})],o.prototype,"relationships",null),i([s(Ne)],o.prototype,"popupEnabled",void 0),i([s({type:ue,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),i([s({readOnly:!0,json:{read:!1}})],o.prototype,"defaultPopupTemplate",null),i([s({type:String,json:{read:!1}})],o.prototype,"objectIdField",void 0),i([v("service","objectIdField",["objectIdField","fields"])],o.prototype,"readObjectIdField",null),i([s({type:String,json:{read:!1}})],o.prototype,"globalIdField",void 0),i([v("service","globalIdField",["globalIdField","fields"])],o.prototype,"readGlobalIdField",null),i([s({readOnly:!0,type:String,json:{read:!1}})],o.prototype,"displayField",null),i([s({type:String,json:{read:!1}})],o.prototype,"profile",void 0),i([v("service","profile",["store.profile"])],o.prototype,"readProfile",null),i([s({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],o.prototype,"normalReferenceFrame",void 0),i([s(Ge)],o.prototype,"screenSizePerspectiveEnabled",void 0),i([s({json:{read:!1,origins:{service:{read:!0}}}})],o.prototype,"serviceItemId",void 0),i([s(Pe)],o.prototype,"useViewTime",null),o=i([b("esri.layers.SceneLayer")],o);const H={"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"},vt={"mesh-pyramids":"mesh",points:"point"},_i=o;export{_i as default}; diff --git a/custom-toc-highlight/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo-CsMJBbDT.js b/custom-toc-highlight/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo-BD404DAo.js similarity index 79% rename from custom-toc-highlight/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo-CsMJBbDT.js rename to custom-toc-highlight/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo-BD404DAo.js index b128e974..0c69e847 100644 --- a/custom-toc-highlight/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo-CsMJBbDT.js +++ b/custom-toc-highlight/assets/SceneLayerSnappingSourceWorker-Bt0_pTWo-BD404DAo.js @@ -1 +1 @@ -import{v as C,i as v,dg as p,$ as x,i8 as m}from"./story-BfX8CRfG.js";import{j as h,g as f,N as l}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{u as L,q as P,y as S}from"./lineSegment-CcqvCARM-CF4YE8GC.js";import{F as _,t as w,b as V}from"./sphere-BenPORjV-DaZ5Vv8x.js";import{y as b}from"./Octree-CJNwbhg4-kBqt3mh_.js";import{k as j}from"./edgeProcessing-CALv8P-b-BbEOWK4a.js";import"./main-ugzBrWNm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./plane-Dt8R0KeE-CVSP2GQG.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./deduplicate-D2d-E5Pw-CQcmF3ab.js";import"./Indices-DEr2HrWx-BuNk6xPZ.js";import"./InterleavedLayout-DXzw3B2n-iCEii9j9.js";import"./BufferView-PQoE3GL7-Duht5lAO.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./glUtil-n1JOrdV3-CRAZdee5.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";const I=1e3;function T(t,o,e){const i=V(),n=_(i);return l(n,n,t,.5),l(n,n,o,.5),i[3]=f(n,t),h(n,n,e),i}let g=class{constructor(){this._idToComponent=new Map,this._components=new b(t=>t.bounds),this._edges=new b(t=>t.bounds),this._tmpLineSegment=L(),this._tmpP1=p(),this._tmpP2=p(),this._tmpP3=p(),this.remoteClient=null}async fetchCandidates(t,o){await Promise.resolve(),x(o),await this._ensureEdgeLocations(t,o);const e=[];return this._edges.forEachNeighbor(i=>(this._addCandidates(t,i,e),e.length{if(s.info==null){const{id:c,uid:r}=s;e.push({id:c,uid:r})}return!0},t.bounds),!e.length)return;const i={components:e},n=await this.remoteClient.invoke("fetchAllEdgeLocations",i,o??{});for(const s of n.components)this._setFetchEdgeLocations(s)}async add(t){const o=new u(t.id,t.bounds);return this._idToComponent.set(o.id,o),this._components.add([o]),{result:{}}}async remove(t){const o=this._idToComponent.get(t.id);if(o){const e=[];this._edges.forEachNeighbor(i=>(i.component===o&&e.push(i),!0),o.bounds),this._edges.remove(e),this._components.remove([o]),this._idToComponent.delete(o.id)}return{result:{}}}_setFetchEdgeLocations(t){const o=this._idToComponent.get(t.id);if(o==null||t.uid!==o.uid)return;const e=j.createView(t.locations),i=new Array(e.count),n=p(),s=p();for(let d=0;dt.bounds),this._edges=new b(t=>t.bounds),this._tmpLineSegment=L(),this._tmpP1=p(),this._tmpP2=p(),this._tmpP3=p(),this.remoteClient=null}async fetchCandidates(t,o){await Promise.resolve(),x(o),await this._ensureEdgeLocations(t,o);const e=[];return this._edges.forEachNeighbor(i=>(this._addCandidates(t,i,e),e.length{if(s.info==null){const{id:c,uid:r}=s;e.push({id:c,uid:r})}return!0},t.bounds),!e.length)return;const i={components:e},n=await this.remoteClient.invoke("fetchAllEdgeLocations",i,o??{});for(const s of n.components)this._setFetchEdgeLocations(s)}async add(t){const o=new u(t.id,t.bounds);return this._idToComponent.set(o.id,o),this._components.add([o]),{result:{}}}async remove(t){const o=this._idToComponent.get(t.id);if(o){const e=[];this._edges.forEachNeighbor(i=>(i.component===o&&e.push(i),!0),o.bounds),this._edges.remove(e),this._components.remove([o]),this._idToComponent.delete(o.id)}return{result:{}}}_setFetchEdgeLocations(t){const o=this._idToComponent.get(t.id);if(o==null||t.uid!==o.uid)return;const e=j.createView(t.locations),i=new Array(e.count),n=p(),s=p();for(let d=0;di.map(i=>d[i]); -import{_ as P}from"./main-ugzBrWNm.js";import{J as C,hf as K,bw as Q}from"./story-BfX8CRfG.js";import{y as W,d as X}from"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import{z as Z,O as ee}from"./vec3-BazNroeq-PdcGTXFi.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./sphere-BenPORjV-DaZ5Vv8x.js";import"./I3SUtil-Bq8KpP2j-BW-Cczln.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-CVSP2GQG.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./projectVectorToVector-sIYLNlex-B_PqSyiH.js";import"./projectPointToVector-B2UUY9SE-BChPjj6-.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./I3SBinaryReader-DEbI3cKZ-Bdob26G6.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-BCiifXla.js";import"./quat-BODLR7mS-BrXZAXDf.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";var N,j;(function(e){e[e.None=0]="None",e[e.Int16=1]="Int16",e[e.Int32=2]="Int32"})(N||(N={})),function(e){e[e.Replace=0]="Replace",e[e.Outside=1]="Outside",e[e.Inside=2]="Inside",e[e.Finished=3]="Finished"}(j||(j={}));function te(){return v||(v=new Promise(e=>P(()=>import("./i3s-BX0wo_Kt-c1D9OuB8.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.i).then(({default:t})=>{const r=t({locateFile:re,onRuntimeInitialized:()=>e(r)});delete r.then})).catch(e=>{throw e})),v}function re(e){return Q(`esri/libs/i3s/${e}`)}let v;var B,b,V,k,H;(function(e){e[e.Unmodified=0]="Unmodified",e[e.Culled=1]="Culled",e[e.NotChecked=2]="NotChecked"})(B||(B={})),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"}(b||(b={})),function(e){e[e.Unknown=0]="Unknown",e[e.Uncached=1]="Uncached",e[e.Cached=2]="Cached"}(V||(V={})),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"}(k||(k={})),function(e){e[e.Hole=0]="Hole",e[e.Leaf=1]="Leaf"}(H||(H={}));async function He(e){n=await g();const t=[e.geometryBuffer];return{result:z(n,e,t),transferList:t}}async function ze(e){n=await g();const t=[e.geometryBuffer],{geometryBuffer:r}=e,a=r.byteLength,i=n._malloc(a),l=new Uint8Array(n.HEAPU8.buffer,i,a);l.set(new Uint8Array(r));const s=n.dracoDecompressPointCloudData(i,l.byteLength);if(n._free(i),s.error.length>0)throw new Error(`i3s.wasm: ${s.error}`);const f=s.featureIds?.length>0?s.featureIds.slice():null,m=s.positions.slice();return f&&t.push(f.buffer),t.push(m.buffer),{result:{positions:m,featureIds:f},transferList:t}}async function Je(e){await g(),ne(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function Ye(e){await g(),oe(e)}async function $e(e){n=await g(),n.setLegacySchema(e.context,e.jsonSchema)}async function Ge(e){const{localMatrix:t,origin:r,positions:a,vertexSpace:i}=e,l=C.fromJSON(e.inSpatialReference),s=C.fromJSON(e.outSpatialReference);let f;const[{projectBuffer:m},{initializeProjection:R}]=await Promise.all([P(()=>import("./projectBuffer-CvCBvJ6W-dLD7ajBt.js"),__vite__mapDeps([2,3,4,5,6]),import.meta.url).then(c=>c.p),P(()=>import("./projection-BA9M1R7d-BYoCXVXt.js"),__vite__mapDeps([7,4,5,3,6,2]),import.meta.url).then(c=>c.p)]);await R(l,s);const w=[0,0,0];if(!m(r,l,0,w,s,0))throw new Error("Failed to project");if(i.type==="georeferenced"&&i.origin==null){if(f=new Float64Array(a.length),!m(a,l,0,f,s,0,f.length/3))throw new Error("Failed to project")}else{const c=i.type==="georeferenced"?W.fromJSON(i):X.fromJSON(i),{projectMeshVertexPositions:u}=await P(async()=>{const{projectMeshVertexPositions:p}=await import("./projectMeshVertexPositions-CFs_XMKX-CCginunE.js");return{projectMeshVertexPositions:p}},__vite__mapDeps([8,2,3,4,5,6,9,10,11,12,13,14,15,16,17,18,19,7,20,21,22,23,24,25]),import.meta.url),d=u({vertexAttributes:{position:a},transform:t?{localMatrix:t}:void 0,vertexSpace:c,spatialReference:l},s);if(!d)throw new Error("Failed to project");f=d}const O=f.length,[E,I,_]=w;for(let c=0;ch.some(y=>y.name==="color")),normal:t.needNormals&&t.layouts.some(h=>h.some(y=>y.name==="normalCompressed")),uv0:t.layouts.some(h=>h.some(y=>y.name==="uv0")),uvRegion:t.layouts.some(h=>h.some(y=>y.name==="uvRegion")),featureIndex:F.featureIndex},o=e.process(a,!!t.obbData,E,c.byteLength,F,Y,_,f,w,O,t.normalReferenceFrame);if(e._free(_),e._free(E),o.error.length>0)throw new Error(`i3s.wasm: ${o.error}`);if(o.discarded)return null;const S=o.componentOffsets.length>0?o.componentOffsets.slice():null,U=o.featureIds.length>0?o.featureIds.slice():null,$=o.anchorIds.length>0?Array.from(o.anchorIds):null,G=o.anchors.length>0?Array.from(o.anchors):null,M=o.interleavedVertedData.slice().buffer,x=o.indicesType===N.Int16?new Uint16Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/2).slice():new Uint32Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/4).slice(),D=o.positions.slice(),T=o.positionIndicesType===N.Int16?new Uint16Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/2).slice():new Uint32Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/4).slice(),q={layout:t.layouts[0],interleavedVertexData:M,indices:x,hasColors:o.hasColors,hasModifications:o.hasModifications,positionData:{data:D,indices:T}};return U&&r.push(U.buffer),S&&r.push(S.buffer),r.push(M),r.push(x.buffer),r.push(D.buffer),r.push(T.buffer),{componentOffsets:S,featureIds:U,anchorIds:$,anchors:G,transformedGeometry:q,obb:o.obb,globalTrafo:i}}function Qe(e){return e===0?b.Unmodified:e===1?b.PotentiallyModified:e===2?b.Culled:b.Unknown}function ne(e){if(!n)return;const{context:t,buffer:r}=e,a=n._malloc(r.byteLength),i=r.byteLength/Float64Array.BYTES_PER_ELEMENT,l=new Float64Array(n.HEAPU8.buffer,a,i),s=new Float64Array(r);l.set(s),n.filterOBBs(t,a,i),s.set(l),n._free(a)}function J(e){n&&n.destroy(e)===0&&(n=null)}function L(e,t){for(let r=0;r(n=e,A=null,n))),A)}const Xe={transform:(e,t)=>n&&z(n,e,t),destroy:J};export{Ke as destroyContext,ze as dracoDecompressPointCloudData,Je as filterObbsForModifications,ne as filterObbsForModificationsSync,We as initialize,Qe as interpretObbModificationResults,He as process,Ge as project,$e as setLegacySchema,Ye as setModifications,oe as setModificationsSync,Xe as test,qe as transformNormals}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./i3s-BX0wo_Kt-c1D9OuB8.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./projection-BA9M1R7d-CAbqHZiw.js","./projectMeshVertexPositions-CFs_XMKX-Dz5wYyNf.js","./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js","./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js","./mat3-CC4Foazl-BWjyqE2v.js","./common-CYWrYyJl-E8-sukrT.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./mat4-DX7gBViE-6clJxb1Q.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./vec32-D9GsKZ1t-BPSFE14A.js","./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js","./projectPointToVector-B2UUY9SE-BIKNGLey.js","./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js","./vec3-BazNroeq-CRjQH4Pj.js","./BufferView-PQoE3GL7-B9DLdqO9.js","./vec2-tHZ6OaOy-xCj1obDt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4-DWDdg1fj-BHg6FqkT.js"])))=>i.map(i=>d[i]); +import{_ as P}from"./main-QGPoLsvl.js";import{J as C,hf as K,bw as Q}from"./story-Doly9N9p.js";import{y as W,d as X}from"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import{z as Z,O as ee}from"./vec3-BazNroeq-CRjQH4Pj.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./sphere-BenPORjV-B4uz1SYF.js";import"./I3SUtil-Bq8KpP2j--Kmryq4i.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-Bqc6oVGz.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./projectVectorToVector-sIYLNlex-DexDhaq1.js";import"./projectPointToVector-B2UUY9SE-BIKNGLey.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./I3SBinaryReader-DEbI3cKZ-0ASBQHPj.js";import"./VertexAttribute-DqD5S0a2-3q90nikV.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./orientedBoundingBox-oHezdpWm-ilptOsP0.js";import"./quat-BODLR7mS-BQk2dgMZ.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";var N,j;(function(e){e[e.None=0]="None",e[e.Int16=1]="Int16",e[e.Int32=2]="Int32"})(N||(N={})),function(e){e[e.Replace=0]="Replace",e[e.Outside=1]="Outside",e[e.Inside=2]="Inside",e[e.Finished=3]="Finished"}(j||(j={}));function te(){return v||(v=new Promise(e=>P(()=>import("./i3s-BX0wo_Kt-c1D9OuB8.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.i).then(({default:t})=>{const r=t({locateFile:re,onRuntimeInitialized:()=>e(r)});delete r.then})).catch(e=>{throw e})),v}function re(e){return Q(`esri/libs/i3s/${e}`)}let v;var B,b,V,k,H;(function(e){e[e.Unmodified=0]="Unmodified",e[e.Culled=1]="Culled",e[e.NotChecked=2]="NotChecked"})(B||(B={})),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"}(b||(b={})),function(e){e[e.Unknown=0]="Unknown",e[e.Uncached=1]="Uncached",e[e.Cached=2]="Cached"}(V||(V={})),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"}(k||(k={})),function(e){e[e.Hole=0]="Hole",e[e.Leaf=1]="Leaf"}(H||(H={}));async function He(e){n=await g();const t=[e.geometryBuffer];return{result:z(n,e,t),transferList:t}}async function ze(e){n=await g();const t=[e.geometryBuffer],{geometryBuffer:r}=e,a=r.byteLength,i=n._malloc(a),l=new Uint8Array(n.HEAPU8.buffer,i,a);l.set(new Uint8Array(r));const s=n.dracoDecompressPointCloudData(i,l.byteLength);if(n._free(i),s.error.length>0)throw new Error(`i3s.wasm: ${s.error}`);const f=s.featureIds?.length>0?s.featureIds.slice():null,m=s.positions.slice();return f&&t.push(f.buffer),t.push(m.buffer),{result:{positions:m,featureIds:f},transferList:t}}async function Je(e){await g(),ne(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function Ye(e){await g(),oe(e)}async function $e(e){n=await g(),n.setLegacySchema(e.context,e.jsonSchema)}async function Ge(e){const{localMatrix:t,origin:r,positions:a,vertexSpace:i}=e,l=C.fromJSON(e.inSpatialReference),s=C.fromJSON(e.outSpatialReference);let f;const[{projectBuffer:m},{initializeProjection:R}]=await Promise.all([P(()=>import("./projectBuffer-CvCBvJ6W-KqAd8Vef.js"),__vite__mapDeps([2,3,4,5,6]),import.meta.url).then(c=>c.p),P(()=>import("./projection-BA9M1R7d-CAbqHZiw.js"),__vite__mapDeps([7,4,5,3,6,2]),import.meta.url).then(c=>c.p)]);await R(l,s);const w=[0,0,0];if(!m(r,l,0,w,s,0))throw new Error("Failed to project");if(i.type==="georeferenced"&&i.origin==null){if(f=new Float64Array(a.length),!m(a,l,0,f,s,0,f.length/3))throw new Error("Failed to project")}else{const c=i.type==="georeferenced"?W.fromJSON(i):X.fromJSON(i),{projectMeshVertexPositions:u}=await P(async()=>{const{projectMeshVertexPositions:p}=await import("./projectMeshVertexPositions-CFs_XMKX-Dz5wYyNf.js");return{projectMeshVertexPositions:p}},__vite__mapDeps([8,2,3,4,5,6,9,10,11,12,13,14,15,16,17,18,19,7,20,21,22,23,24,25]),import.meta.url),d=u({vertexAttributes:{position:a},transform:t?{localMatrix:t}:void 0,vertexSpace:c,spatialReference:l},s);if(!d)throw new Error("Failed to project");f=d}const O=f.length,[E,I,_]=w;for(let c=0;ch.some(y=>y.name==="color")),normal:t.needNormals&&t.layouts.some(h=>h.some(y=>y.name==="normalCompressed")),uv0:t.layouts.some(h=>h.some(y=>y.name==="uv0")),uvRegion:t.layouts.some(h=>h.some(y=>y.name==="uvRegion")),featureIndex:F.featureIndex},o=e.process(a,!!t.obbData,E,c.byteLength,F,Y,_,f,w,O,t.normalReferenceFrame);if(e._free(_),e._free(E),o.error.length>0)throw new Error(`i3s.wasm: ${o.error}`);if(o.discarded)return null;const S=o.componentOffsets.length>0?o.componentOffsets.slice():null,U=o.featureIds.length>0?o.featureIds.slice():null,$=o.anchorIds.length>0?Array.from(o.anchorIds):null,G=o.anchors.length>0?Array.from(o.anchors):null,M=o.interleavedVertedData.slice().buffer,x=o.indicesType===N.Int16?new Uint16Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/2).slice():new Uint32Array(o.indices.buffer,o.indices.byteOffset,o.indices.byteLength/4).slice(),D=o.positions.slice(),T=o.positionIndicesType===N.Int16?new Uint16Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/2).slice():new Uint32Array(o.positionIndices.buffer,o.positionIndices.byteOffset,o.positionIndices.byteLength/4).slice(),q={layout:t.layouts[0],interleavedVertexData:M,indices:x,hasColors:o.hasColors,hasModifications:o.hasModifications,positionData:{data:D,indices:T}};return U&&r.push(U.buffer),S&&r.push(S.buffer),r.push(M),r.push(x.buffer),r.push(D.buffer),r.push(T.buffer),{componentOffsets:S,featureIds:U,anchorIds:$,anchors:G,transformedGeometry:q,obb:o.obb,globalTrafo:i}}function Qe(e){return e===0?b.Unmodified:e===1?b.PotentiallyModified:e===2?b.Culled:b.Unknown}function ne(e){if(!n)return;const{context:t,buffer:r}=e,a=n._malloc(r.byteLength),i=r.byteLength/Float64Array.BYTES_PER_ELEMENT,l=new Float64Array(n.HEAPU8.buffer,a,i),s=new Float64Array(r);l.set(s),n.filterOBBs(t,a,i),s.set(l),n._free(a)}function J(e){n&&n.destroy(e)===0&&(n=null)}function L(e,t){for(let r=0;r(n=e,A=null,n))),A)}const Xe={transform:(e,t)=>n&&z(n,e,t),destroy:J};export{Ke as destroyContext,ze as dracoDecompressPointCloudData,Je as filterObbsForModifications,ne as filterObbsForModificationsSync,We as initialize,Qe as interpretObbModificationResults,He as process,Ge as project,$e as setLegacySchema,Ye as setModifications,oe as setModificationsSync,Xe as test,qe as transformNormals}; diff --git a/custom-toc-highlight/assets/SceneService-BZqGtWmG-BWCHkX1O.js b/custom-toc-highlight/assets/SceneService-BZqGtWmG-BBytd6YJ.js similarity index 94% rename from custom-toc-highlight/assets/SceneService-BZqGtWmG-BWCHkX1O.js rename to custom-toc-highlight/assets/SceneService-BZqGtWmG-BBytd6YJ.js index 7d86652f..32d0bf72 100644 --- a/custom-toc-highlight/assets/SceneService-BZqGtWmG-BWCHkX1O.js +++ b/custom-toc-highlight/assets/SceneService-BZqGtWmG-BBytd6YJ.js @@ -1,3 +1,3 @@ -import{f as y,o as c,v as o,S as p,J as _,a0 as h,n as S,ac as P,i as L,bp as O,a1 as w,a as U,r as K}from"./story-BfX8CRfG.js";import{n as T}from"./originUtils-BLsWtgV9-B4sclfuf.js";import{M as $}from"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import{I as V,i as M,o as C,x as q,T as z}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{e as F,Z as k}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import J from"./PortalItem-CctGdnxF-C7IJrZYq.js";import{i as A}from"./jsonContext-BA8GHqVk-CWQlLGSw.js";import{T as B,F as D}from"./resourceUtils-BmW6QqlX-B1DAUGNs.js";import{d as Z}from"./saveUtils-CIYk-dsQ-VGcOewby.js";async function G(s,a,t,e,i,r,n){let l=null;if(t!=null){const u=`${s}/nodepages/`,N=u+Math.floor(t.rootIndex/t.nodesPerPage);try{return{type:"page",rootPage:(await y(N,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,rootIndex:t.rootIndex,pageSize:t.nodesPerPage,lodMetric:t.lodSelectionMetricType,urlPrefix:u}}catch(E){r?.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",N,E),l=E}}if(!a)return null;const d=a?.split("/").pop(),f=`${s}/nodes/`,v=f+d;try{return{type:"node",rootNode:(await y(v,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,urlPrefix:f}}catch(u){throw new c("sceneservice:root-node-missing","Root node missing.",{pageError:l,nodeError:u,url:v})}}let H=null;function Q(){return H}const ne=s=>{let a=class extends s{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=O(async(t,e,i)=>{switch(t){case g.SAVE:return this._save(e);case g.SAVE_AS:return this._saveAs(i,e)}})}readSpatialReference(t,e){return I(e)}readFullExtent(t,e,i){if(t!=null&&typeof t=="object"){const l=t.spatialReference==null?{...t,spatialReference:I(e)}:t;return S.fromJSON(l,i)}const r=e.store,n=I(e);return n==null||r?.extent==null||!Array.isArray(r.extent)||r.extent.some(l=>l=2&&(e.major=parseInt(i[0],10),e.minor=parseInt(i[1],10)),e}readVersion(t,e){const i=e.store,r=i.version!=null?i.version.toString():"";return this.parseVersionString(r)}readTitlePortalItem(t){return this.sublayerTitleMode!=="item-title"?void 0:t}readTitleService(t,e){const i=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?V(this.url,e.name):e.name;let r=e.name;if(!r&&this.url){const n=M(this.url);n!=null&&(r=n.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&i&&(r=i+" - "+r),C(r)}set url(t){if(t==null)return void this._set("url",t);const e=q({layer:this,url:t,nonStandardUrlAllowed:!1,logger:w.getLogger(this)});this._set("url",e.url),e.layerId!=null&&this._set("layerId",e.layerId)}writeUrl(t,e,i,r){z(this,t,"layers",e,r)}get parsedUrl(){const t=this._get("url"),e=U(t);return e&&this.layerId!=null&&(e.path=`${e.path}/layers/${this.layerId}`),e}async _fetchIndexAndUpdateExtent(t,e){this.indexInfo=G(this.parsedUrl?.path??"",this.rootNode,t,this.customParameters,this.apiKey,w.getLogger(this),e),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(t){if(t?.type==="page"){const e=t.rootIndex%t.pageSize,i=t.rootPage?.nodes?.[e];if(i?.obb?.center==null||i.obb.halfSize==null)throw new c("sceneservice:invalid-node-page","Invalid node page.");if(i.obb.center[0]0)return e.data.layers[0].id}async _fetchServiceLayer(t){const e=await y(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t});e.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(e.data.layerType&&e.data.layerType==="Voxel"&&(i=!0),i)return this._fetchVoxelServiceLayer();const r=e.data;this.read(r,this._getServiceContext()),this.validateLayer(r)}async _fetchVoxelServiceLayer(t){const e=(await y(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t})).data;this.read(e,this._getServiceContext()),this.validateLayer(e)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(t){}async _saveAs(t,e){const i={...R,...e};let r=J.from(t);if(!r)throw new c("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");r.id&&(r=r.clone(),r.id=null);const n=r.portal||K.getDefault();await this._ensureLoadBeforeSave(),r.type=b,r.portal=n;const l=A(r,"portal-item",!0),d={layers:[this.write({},l)]};return await Promise.all(l.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(d,l,i),this.url&&(r.url=this.url),r.title||(r.title=this.title),j(r,i,m.newItem),await n.signIn(),await n.user.addItem({item:r,folder:i?.folder,data:d}),await B(this.resourceReferences,l),this.portalItem=r,T(l),l.portalItem=r,r}async _save(t){const e={...R,...t};if(!this.portalItem)throw new c("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==b)throw new c("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${b}"`);await this._ensureLoadBeforeSave();const i=A(this.portalItem,"portal-item",!0),r={layers:[this.write({},i)]};return await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(r,i,e),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),j(this.portalItem,e,m.existingItem),await D(this.portalItem,r,this.resourceReferences,i),T(i),this.portalItem}async _validateAgainstJSONSchema(t,e,i){const r=i?.validationOptions;Z(e,{errorName:"sceneservice:save"},{ignoreUnsupported:r?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const n=r?.enabled,l=Q();if(n&&l){const d=(await l()).validate(t,i.portalItemLayerType);if(!d.length)return;const f=`Layer item did not validate: +import{f as y,o as c,v as o,S as p,J as _,a0 as h,n as S,ac as P,i as L,bp as O,a1 as w,a as U,r as K}from"./story-Doly9N9p.js";import{n as T}from"./originUtils-BLsWtgV9-B4sclfuf.js";import{M as $}from"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import{I as V,i as M,o as C,x as q,T as z}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{e as F,Z as k}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import J from"./PortalItem-CctGdnxF-CfFOGshS.js";import{i as A}from"./jsonContext-BA8GHqVk-BsXRY5es.js";import{T as B,F as D}from"./resourceUtils-BmW6QqlX-D_AxNrCI.js";import{d as Z}from"./saveUtils-CIYk-dsQ-Br9QCJTX.js";async function G(s,a,t,e,i,r,n){let l=null;if(t!=null){const u=`${s}/nodepages/`,N=u+Math.floor(t.rootIndex/t.nodesPerPage);try{return{type:"page",rootPage:(await y(N,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,rootIndex:t.rootIndex,pageSize:t.nodesPerPage,lodMetric:t.lodSelectionMetricType,urlPrefix:u}}catch(E){r?.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",N,E),l=E}}if(!a)return null;const d=a?.split("/").pop(),f=`${s}/nodes/`,v=f+d;try{return{type:"node",rootNode:(await y(v,{query:{f:"json",...e,token:i},responseType:"json",signal:n})).data,urlPrefix:f}}catch(u){throw new c("sceneservice:root-node-missing","Root node missing.",{pageError:l,nodeError:u,url:v})}}let H=null;function Q(){return H}const ne=s=>{let a=class extends s{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=O(async(t,e,i)=>{switch(t){case g.SAVE:return this._save(e);case g.SAVE_AS:return this._saveAs(i,e)}})}readSpatialReference(t,e){return I(e)}readFullExtent(t,e,i){if(t!=null&&typeof t=="object"){const l=t.spatialReference==null?{...t,spatialReference:I(e)}:t;return S.fromJSON(l,i)}const r=e.store,n=I(e);return n==null||r?.extent==null||!Array.isArray(r.extent)||r.extent.some(l=>l=2&&(e.major=parseInt(i[0],10),e.minor=parseInt(i[1],10)),e}readVersion(t,e){const i=e.store,r=i.version!=null?i.version.toString():"";return this.parseVersionString(r)}readTitlePortalItem(t){return this.sublayerTitleMode!=="item-title"?void 0:t}readTitleService(t,e){const i=this.portalItem?.title;if(this.sublayerTitleMode==="item-title")return this.url?V(this.url,e.name):e.name;let r=e.name;if(!r&&this.url){const n=M(this.url);n!=null&&(r=n.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&i&&(r=i+" - "+r),C(r)}set url(t){if(t==null)return void this._set("url",t);const e=q({layer:this,url:t,nonStandardUrlAllowed:!1,logger:w.getLogger(this)});this._set("url",e.url),e.layerId!=null&&this._set("layerId",e.layerId)}writeUrl(t,e,i,r){z(this,t,"layers",e,r)}get parsedUrl(){const t=this._get("url"),e=U(t);return e&&this.layerId!=null&&(e.path=`${e.path}/layers/${this.layerId}`),e}async _fetchIndexAndUpdateExtent(t,e){this.indexInfo=G(this.parsedUrl?.path??"",this.rootNode,t,this.customParameters,this.apiKey,w.getLogger(this),e),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(t){if(t?.type==="page"){const e=t.rootIndex%t.pageSize,i=t.rootPage?.nodes?.[e];if(i?.obb?.center==null||i.obb.halfSize==null)throw new c("sceneservice:invalid-node-page","Invalid node page.");if(i.obb.center[0]0)return e.data.layers[0].id}async _fetchServiceLayer(t){const e=await y(this.parsedUrl?.path??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t});e.ssl&&this.url&&(this.url=this.url.replace(/^http:/i,"https:"));let i=!1;if(e.data.layerType&&e.data.layerType==="Voxel"&&(i=!0),i)return this._fetchVoxelServiceLayer();const r=e.data;this.read(r,this._getServiceContext()),this.validateLayer(r)}async _fetchVoxelServiceLayer(t){const e=(await y(this.parsedUrl?.path+"/layer",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:t})).data;this.read(e,this._getServiceContext()),this.validateLayer(e)}_getServiceContext(){return{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(t){}async _saveAs(t,e){const i={...R,...e};let r=J.from(t);if(!r)throw new c("sceneservice:portal-item-required","_saveAs() requires a portal item to save to");r.id&&(r=r.clone(),r.id=null);const n=r.portal||K.getDefault();await this._ensureLoadBeforeSave(),r.type=b,r.portal=n;const l=A(r,"portal-item",!0),d={layers:[this.write({},l)]};return await Promise.all(l.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(d,l,i),this.url&&(r.url=this.url),r.title||(r.title=this.title),j(r,i,m.newItem),await n.signIn(),await n.user.addItem({item:r,folder:i?.folder,data:d}),await B(this.resourceReferences,l),this.portalItem=r,T(l),l.portalItem=r,r}async _save(t){const e={...R,...t};if(!this.portalItem)throw new c("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==b)throw new c("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${b}"`);await this._ensureLoadBeforeSave();const i=A(this.portalItem,"portal-item",!0),r={layers:[this.write({},i)]};return await Promise.all(i.resources.pendingOperations??[]),await this._validateAgainstJSONSchema(r,i,e),this.url&&(this.portalItem.url=this.url),this.portalItem.title||(this.portalItem.title=this.title),j(this.portalItem,e,m.existingItem),await D(this.portalItem,r,this.resourceReferences,i),T(i),this.portalItem}async _validateAgainstJSONSchema(t,e,i){const r=i?.validationOptions;Z(e,{errorName:"sceneservice:save"},{ignoreUnsupported:r?.ignoreUnsupported,supplementalUnsupportedErrors:["scenemodification:unsupported"]});const n=r?.enabled,l=Q();if(n&&l){const d=(await l()).validate(t,i.portalItemLayerType);if(!d.length)return;const f=`Layer item did not validate: ${d.join(` `)}`;if(w.getLogger(this).error(`_validateAgainstJSONSchema(): ${f}`),r.failPolicy==="throw"){const v=d.map(u=>new c("sceneservice:schema-validation",u));throw new c("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{validationErrors:v})}}}};return o([p(F)],a.prototype,"id",void 0),o([p({type:_})],a.prototype,"spatialReference",void 0),o([h("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readSpatialReference",null),o([p({type:S})],a.prototype,"fullExtent",void 0),o([h("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],a.prototype,"readFullExtent",null),o([p({readOnly:!0,type:$})],a.prototype,"heightModelInfo",void 0),o([p({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],a.prototype,"minScale",void 0),o([p({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],a.prototype,"maxScale",void 0),o([p({readOnly:!0})],a.prototype,"version",void 0),o([h("version",["store.version"])],a.prototype,"readVersion",null),o([p({type:String,json:{read:{source:"copyrightText"}}})],a.prototype,"copyright",void 0),o([p({type:String,json:{read:!1}})],a.prototype,"sublayerTitleMode",void 0),o([p({type:String})],a.prototype,"title",void 0),o([h("portal-item","title")],a.prototype,"readTitlePortalItem",null),o([h("service","title",["name"])],a.prototype,"readTitleService",null),o([p({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],a.prototype,"layerId",void 0),o([p(k)],a.prototype,"url",null),o([P("url")],a.prototype,"writeUrl",null),o([p()],a.prototype,"parsedUrl",null),o([p({readOnly:!0})],a.prototype,"store",void 0),o([p({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],a.prototype,"rootNode",void 0),a=o([L("esri.layers.mixins.SceneService")],a),a},x=-1e38;function I(s){if(s.spatialReference!=null)return _.fromJSON(s.spatialReference);const a=s.store,t=a.indexCRS||a.geographicCRS,e=t&&parseInt(t.slice(t.lastIndexOf("/")+1),10);return e!=null?new _(e):null}function j(s,a,t){s.typeKeywords||(s.typeKeywords=[]);const e=a.getTypeKeywords();for(const i of e)s.typeKeywords.push(i);s.typeKeywords&&(s.typeKeywords=s.typeKeywords.filter((i,r,n)=>n.indexOf(i)===r),t===m.newItem&&(s.typeKeywords=s.typeKeywords.filter(i=>i!=="Hosted Service")))}var m;(function(s){s[s.existingItem=0]="existingItem",s[s.newItem=1]="newItem"})(m||(m={}));const b="Scene Service",R={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var g;(function(s){s[s.SAVE=0]="SAVE",s[s.SAVE_AS=1]="SAVE_AS"})(g||(g={}));export{G as T,ne as W,g as f}; diff --git a/custom-toc-highlight/assets/Scheduler-B7UX7Wr5-DQCcMKpm.js b/custom-toc-highlight/assets/Scheduler-B7UX7Wr5-DriQgzLZ.js similarity index 98% rename from custom-toc-highlight/assets/Scheduler-B7UX7Wr5-DQCcMKpm.js rename to custom-toc-highlight/assets/Scheduler-B7UX7Wr5-DriQgzLZ.js index fb668b20..4dad2889 100644 --- a/custom-toc-highlight/assets/Scheduler-B7UX7Wr5-DQCcMKpm.js +++ b/custom-toc-highlight/assets/Scheduler-B7UX7Wr5-DriQgzLZ.js @@ -1 +1 @@ -import{v as m,S as p,i as F,j as D,dE as R,c$ as A,ah as y,aL as v,al as w,aN as d,a1 as G,au as M,aF as Q,x as C,aS as I,t as V,dF as Y}from"./story-BfX8CRfG.js";import{o as L}from"./signal-CETehA7D-DhpyJ8yp.js";var o;(function(s){s[s.ANIMATING=0]="ANIMATING",s[s.INTERACTING=1]="INTERACTING",s[s.IDLE=2]="IDLE"})(o||(o={}));const U=Symbol("Yield");class H{constructor(){this._tasks=new Array,this._runningTasks=L(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(n){if(this.length===0)return U;for(;!n.done&&this._process(n);)n.madeProgress()}push(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.push(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}unshift(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.unshift(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}_process(n){if(this._tasks.length===0)return!1;const a=this._tasks.shift();try{const _=C(a.signal);if(_&&!a.abortCallback)a.reject(I());else{const h=_?a.abortCallback?.(I()):a.callback(n);V(h)?h.then(a.resolve,a.reject):a.resolve(h)}}catch(_){a.reject(_)}return!0}cancelAll(){const n=I();for(const a of this._tasks)if(a.abortCallback){const _=a.abortCallback(n);a.resolve(_)}else a.reject(n);this._tasks.length=0}}class f{constructor(n,a,_,h=void 0,e=void 0){this.resolve=n,this.reject=a,this.callback=_,this.signal=h,this.abortCallback=e}}let c=class extends D{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};m([p()],c.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),m([p()],c.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),c=m([F("esri.views.support.debugFlags")],c);const B=new c;function z(){return new g.Scheduler}var i;(function(s){s.RESOURCE_CONTROLLER_IMMEDIATE="immediate",s.RESOURCE_CONTROLLER="schedule",s.SLIDE="slide",s.STREAM_DATA_LOADER="stream loader",s.ELEVATION_QUERY="elevation query",s.TERRAIN_SURFACE="terrain",s.SURFACE_GEOMETRY_UPDATES="surface geometry updates",s.LOD_RENDERER="LoD renderer",s.GRAPHICS_CORE="Graphics3D",s.I3S_CONTROLLER="I3S",s.POINT_CLOUD_LAYER="point cloud",s.FEATURE_TILE_FETCHER="feature fetcher",s.OVERLAY="overlay",s.STAGE="stage",s.GRAPHICS_DECONFLICTOR="graphics deconflictor",s.FILTER_VISIBILITY="Graphics3D filter visibility",s.SCALE_VISIBILITY="Graphics3D scale visibility",s.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",s.POINT_OF_INTEREST_FREQUENT="POI frequent",s.POINT_OF_INTEREST_INFREQUENT="POI infrequent",s.LABELER="labeler",s.FEATURE_QUERY_ENGINE="feature query",s.FEATURE_TILE_TREE="feature tile tree",s.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",s.ELEVATION_ALIGNMENT="elevation alignment",s.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",s.TEXT_TEXTURE_ATLAS="text texture atlas",s.TEXTURE_UNLOAD="texture unload",s.LINE_OF_SIGHT_TOOL="line of sight tool",s.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",s.ELEVATION_PROFILE="elevation profile",s.SNAPPING="snapping",s.SHADOW_ACCUMULATOR="shadow accumulator",s.CLOUDS_GENERATOR="clouds generator",s.MAPVIEW_FETCH_QUEUE="mapview fetch queue",s.MAPVIEW_LAYERVIEW_UPDATE="mapview layerview update",s.MAPVIEW_VECTOR_TILE_PARSING_QUEUE="mapview vector tile parsing queue",s[s.NONE=0]="NONE",s[s.TEST_PRIO=1]="TEST_PRIO"})(i||(i={}));const E=0,S=new Map([[i.RESOURCE_CONTROLLER_IMMEDIATE,E],[i.RESOURCE_CONTROLLER,4],[i.SLIDE,E],[i.STREAM_DATA_LOADER,E],[i.ELEVATION_QUERY,E],[i.TERRAIN_SURFACE,1],[i.SURFACE_GEOMETRY_UPDATES,1],[i.LOD_RENDERER,2],[i.GRAPHICS_CORE,2],[i.I3S_CONTROLLER,2],[i.POINT_CLOUD_LAYER,2],[i.FEATURE_TILE_FETCHER,2],[i.CLOUDS_GENERATOR,2],[i.OVERLAY,4],[i.STAGE,4],[i.GRAPHICS_DECONFLICTOR,4],[i.FILTER_VISIBILITY,4],[i.SCALE_VISIBILITY,4],[i.FRUSTUM_VISIBILITY,4],[i.POINT_OF_INTEREST_FREQUENT,6],[i.POINT_OF_INTEREST_INFREQUENT,30],[i.LABELER,8],[i.FEATURE_QUERY_ENGINE,8],[i.FEATURE_TILE_TREE,16],[i.FEATURE_TILE_TREE_ACTIVE,E],[i.ELEVATION_ALIGNMENT,12],[i.ELEVATION_ALIGNMENT_SCENE,14],[i.TEXT_TEXTURE_ATLAS,12],[i.TEXTURE_UNLOAD,12],[i.LINE_OF_SIGHT_TOOL,16],[i.LINE_OF_SIGHT_TOOL_INTERACTIVE,E],[i.SNAPPING,E],[i.SHADOW_ACCUMULATOR,30],[i.MAPVIEW_FETCH_QUEUE,E],[i.MAPVIEW_LAYERVIEW_UPDATE,2],[i.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,E]]);function N(s){return S.has(s)?S.get(s):typeof s=="number"?s:1}const W=d(6.5),k=d(1),x=d(30),q=d(1e3/30),j=d(100),b=.9;var g,l;(function(s){class n{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=L(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new R("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new _,this._state=o.INTERACTING,this._tasks=new A,this._runQueue=new A,this._load=0,this._idleStateCallbacks=new A,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=y(()=>B.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,v);for(const e of Object.keys(i))this.performanceInfo.tasks.set(i[e],new R(i[e]))}destroy(){this._tasks.toArray().forEach(e=>e.remove()),this._tasks.clear(),w(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(e,r){const t=new a(this,e,r);return this._tasks.push(t),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new R(e)),t}registerIdleStateCallbacks(e,r){const t={idleBegin:e,idleEnd:r};this._idleStateCallbacks.push(t),this.state===o.IDLE&&this._idleUpdatesStartFired&&t.idleBegin();const u=this;return{remove:()=>this._removeIdleStateCallbacks(t),set idleBegin(T){u._idleUpdatesStartFired&&(t.idleEnd(),u._state===o.IDLE&&T()),t.idleBegin=T},set idleEnd(T){t.idleEnd=T}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==o.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(r=>r.idleEnd())))}get state(){return this._state}updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let r=W,t=e.frameDuration,u=k;switch(this.state){case o.IDLE:r=d(0),t=d(Math.max(j,e.frameDuration)),u=x;break;case o.INTERACTING:t=d(Math.max(q,e.frameDuration));case o.ANIMATING:}return t=d(t-e.elapsedFrameTime-r),this.state!==o.IDLE&&te.idleBegin())),this._runIdle();break;case o.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(d(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll(r=>{r.name===e&&r.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return l.SCHEDULED;let r=l.IDLE;return this._tasks.forAll(t=>{t.name===e&&t.needsUpdate&&(t.schedulePriority<=1?r=l.READY:r!==l.READY&&(r=l.WAITING))}),r}_getRuntime(e){let r=0;return this._tasks.forAll(t=>{t.name===e&&(r+=t.runtime)}),r}_resetRuntimes(){this._tasks.forAll(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forAll(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),e.size===0)return null;let r="";return e.forEach((t,u)=>{r+=t>1?` ${t}x ${u}`:` ${u}`}),r}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce((r,t)=>t.needsUpdate?++r:r,0);this._load=this._load*b+e*(1-b)}_schedule(){for(this._runQueue.filterInPlace(e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forAll(e=>{e.basePriority===E&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});this._runQueue.length===0;){let e=!1,r=0;if(this._tasks.forAll(t=>{t.needsUpdate&&t.schedulePriority!==0&&t.basePriority!==E&&t.blockFrame!==this._frameNumber&&(e=!0,r=Math.max(r,t.basePriority),t.schedulePriority===1?(t.schedulePriority=0,this._runQueue.push(t)):--t.schedulePriority)}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const r=this._budget.now(),t=this._runQueue.pop();this._budget.resetProgress();try{t.task.runTask(this._budget)===U&&(t.blockFrame=this._frameNumber)}catch(T){G.getLogger("esri.views.support.Scheduler").error(`Exception in task "${t.name}"`,T),t.blockFrame=this._frameNumber}!this._budget.hasProgressed&&t.blockFrame!==this._frameNumber&&t.needsUpdate&&(t.name,i.I3S_CONTROLLER,t.blockFrame=this._frameNumber),t.schedulePriority=t.basePriority;const u=this._budget.now()-r;if(t.runtime+=u,this._frameTaskTimes.set(t.priority,this._frameTaskTimes.get(t.priority)+u),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-e)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(i))this._frameTaskTimes.set(i[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((r,t)=>this.performanceInfo.tasks.get(t).push(r)),this.performanceInfo.total.push(e)}get test(){return this._test}}s.Scheduler=n;class a{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,r,t){this._scheduler=e,this.name=r,this.blockFrame=0,this.runtime=0,this._queue=new H,this._handles=new M,this._basePriority=N(r),this.schedulePriority=this._basePriority,this._task=L(t??this._queue),this._handles.add(Q(()=>this.task.running,u=>e.taskRunningChanged(u)))}remove(){this.processQueue(P),this._scheduler.removeTask(this),this.schedule=O.schedule,this.reschedule=O.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const r=N(e);this._basePriority!==E&&this.schedulePriority===0||(this.schedulePriority=r),this._basePriority=r}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,r,t){return this._queue.push(e,r,t)}reschedule(e,r,t){return this._queue.unshift(e,r,t)}processQueue(e){return this._queue.runTask(e)}}class _{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=o.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(e()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,r){this._begin=this.now(),this._budget=e,this._state=r,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}s.Budget=_})(g||(g={})),function(s){s.SCHEDULED="s",s.READY="r",s.WAITING="w",s.IDLE="i"}(l||(l={}));const P=(()=>{const s=new g.Budget;return s.enabled=!1,s})();class X{remove(){}processQueue(){}schedule(n,a,_){try{if(C(a)){const h=I();return _?Promise.resolve(_(h)):Promise.reject(h)}return Y(n(P))}catch(h){return Promise.reject(h)}}reschedule(n,a,_){return this.schedule(n,a,_)}}const O=new X;export{z as W,O as f,i,P as p,o as u}; +import{v as m,S as p,i as F,j as D,dE as R,c$ as A,ah as y,aL as v,al as w,aN as d,a1 as G,au as M,aF as Q,x as C,aS as I,t as V,dF as Y}from"./story-Doly9N9p.js";import{o as L}from"./signal-CETehA7D-DQA5V72u.js";var o;(function(s){s[s.ANIMATING=0]="ANIMATING",s[s.INTERACTING=1]="INTERACTING",s[s.IDLE=2]="IDLE"})(o||(o={}));const U=Symbol("Yield");class H{constructor(){this._tasks=new Array,this._runningTasks=L(0)}get length(){return this._tasks.length}get running(){return this._runningTasks.value>0}destroy(){this.cancelAll()}runTask(n){if(this.length===0)return U;for(;!n.done&&this._process(n);)n.madeProgress()}push(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.push(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}unshift(n,a,_){return++this._runningTasks.value,new Promise((h,e)=>this._tasks.unshift(new f(h,e,n,a,_))).finally(()=>--this._runningTasks.value)}_process(n){if(this._tasks.length===0)return!1;const a=this._tasks.shift();try{const _=C(a.signal);if(_&&!a.abortCallback)a.reject(I());else{const h=_?a.abortCallback?.(I()):a.callback(n);V(h)?h.then(a.resolve,a.reject):a.resolve(h)}}catch(_){a.reject(_)}return!0}cancelAll(){const n=I();for(const a of this._tasks)if(a.abortCallback){const _=a.abortCallback(n);a.resolve(_)}else a.reject(n);this._tasks.length=0}}class f{constructor(n,a,_,h=void 0,e=void 0){this.resolve=n,this.reject=a,this.callback=_,this.signal=h,this.abortCallback=e}}let c=class extends D{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};m([p()],c.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),m([p()],c.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),c=m([F("esri.views.support.debugFlags")],c);const B=new c;function z(){return new g.Scheduler}var i;(function(s){s.RESOURCE_CONTROLLER_IMMEDIATE="immediate",s.RESOURCE_CONTROLLER="schedule",s.SLIDE="slide",s.STREAM_DATA_LOADER="stream loader",s.ELEVATION_QUERY="elevation query",s.TERRAIN_SURFACE="terrain",s.SURFACE_GEOMETRY_UPDATES="surface geometry updates",s.LOD_RENDERER="LoD renderer",s.GRAPHICS_CORE="Graphics3D",s.I3S_CONTROLLER="I3S",s.POINT_CLOUD_LAYER="point cloud",s.FEATURE_TILE_FETCHER="feature fetcher",s.OVERLAY="overlay",s.STAGE="stage",s.GRAPHICS_DECONFLICTOR="graphics deconflictor",s.FILTER_VISIBILITY="Graphics3D filter visibility",s.SCALE_VISIBILITY="Graphics3D scale visibility",s.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",s.POINT_OF_INTEREST_FREQUENT="POI frequent",s.POINT_OF_INTEREST_INFREQUENT="POI infrequent",s.LABELER="labeler",s.FEATURE_QUERY_ENGINE="feature query",s.FEATURE_TILE_TREE="feature tile tree",s.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",s.ELEVATION_ALIGNMENT="elevation alignment",s.ELEVATION_ALIGNMENT_SCENE="elevation alignment scene",s.TEXT_TEXTURE_ATLAS="text texture atlas",s.TEXTURE_UNLOAD="texture unload",s.LINE_OF_SIGHT_TOOL="line of sight tool",s.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",s.ELEVATION_PROFILE="elevation profile",s.SNAPPING="snapping",s.SHADOW_ACCUMULATOR="shadow accumulator",s.CLOUDS_GENERATOR="clouds generator",s.MAPVIEW_FETCH_QUEUE="mapview fetch queue",s.MAPVIEW_LAYERVIEW_UPDATE="mapview layerview update",s.MAPVIEW_VECTOR_TILE_PARSING_QUEUE="mapview vector tile parsing queue",s[s.NONE=0]="NONE",s[s.TEST_PRIO=1]="TEST_PRIO"})(i||(i={}));const E=0,S=new Map([[i.RESOURCE_CONTROLLER_IMMEDIATE,E],[i.RESOURCE_CONTROLLER,4],[i.SLIDE,E],[i.STREAM_DATA_LOADER,E],[i.ELEVATION_QUERY,E],[i.TERRAIN_SURFACE,1],[i.SURFACE_GEOMETRY_UPDATES,1],[i.LOD_RENDERER,2],[i.GRAPHICS_CORE,2],[i.I3S_CONTROLLER,2],[i.POINT_CLOUD_LAYER,2],[i.FEATURE_TILE_FETCHER,2],[i.CLOUDS_GENERATOR,2],[i.OVERLAY,4],[i.STAGE,4],[i.GRAPHICS_DECONFLICTOR,4],[i.FILTER_VISIBILITY,4],[i.SCALE_VISIBILITY,4],[i.FRUSTUM_VISIBILITY,4],[i.POINT_OF_INTEREST_FREQUENT,6],[i.POINT_OF_INTEREST_INFREQUENT,30],[i.LABELER,8],[i.FEATURE_QUERY_ENGINE,8],[i.FEATURE_TILE_TREE,16],[i.FEATURE_TILE_TREE_ACTIVE,E],[i.ELEVATION_ALIGNMENT,12],[i.ELEVATION_ALIGNMENT_SCENE,14],[i.TEXT_TEXTURE_ATLAS,12],[i.TEXTURE_UNLOAD,12],[i.LINE_OF_SIGHT_TOOL,16],[i.LINE_OF_SIGHT_TOOL_INTERACTIVE,E],[i.SNAPPING,E],[i.SHADOW_ACCUMULATOR,30],[i.MAPVIEW_FETCH_QUEUE,E],[i.MAPVIEW_LAYERVIEW_UPDATE,2],[i.MAPVIEW_VECTOR_TILE_PARSING_QUEUE,E]]);function N(s){return S.has(s)?S.get(s):typeof s=="number"?s:1}const W=d(6.5),k=d(1),x=d(30),q=d(1e3/30),j=d(100),b=.9;var g,l;(function(s){class n{get updating(){return this._updating.value}_updatingChanged(){this._updating.value=this._tasks.some(e=>e.needsUpdate)}constructor(){this._updating=L(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new R("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new _,this._state=o.INTERACTING,this._tasks=new A,this._runQueue=new A,this._load=0,this._idleStateCallbacks=new A,this._idleUpdatesStartFired=!1,this._forceTask=!1,this._debug=!1,this._debugHandle=y(()=>B.SCHEDULER_LOG_SLOW_TASKS,e=>this._debug=e,v);for(const e of Object.keys(i))this.performanceInfo.tasks.set(i[e],new R(i[e]))}destroy(){this._tasks.toArray().forEach(e=>e.remove()),this._tasks.clear(),w(this._debugHandle),this._microTaskQueued=!1,this._updatingChanged()}taskRunningChanged(e){this._updatingChanged(),e&&this._budget.remaining>0&&!this._microTaskQueued&&(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.remaining>0&&this._schedule()&&this.frame())}))}registerTask(e,r){const t=new a(this,e,r);return this._tasks.push(t),this._updatingChanged(),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new R(e)),t}registerIdleStateCallbacks(e,r){const t={idleBegin:e,idleEnd:r};this._idleStateCallbacks.push(t),this.state===o.IDLE&&this._idleUpdatesStartFired&&t.idleBegin();const u=this;return{remove:()=>this._removeIdleStateCallbacks(t),set idleBegin(T){u._idleUpdatesStartFired&&(t.idleEnd(),u._state===o.IDLE&&T()),t.idleBegin=T},set idleEnd(T){t.idleEnd=T}}}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==o.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(r=>r.idleEnd())))}get state(){return this._state}updateBudget(e){this._test&&(this._test.usedBudget=0),++this._frameNumber;let r=W,t=e.frameDuration,u=k;switch(this.state){case o.IDLE:r=d(0),t=d(Math.max(j,e.frameDuration)),u=x;break;case o.INTERACTING:t=d(Math.max(q,e.frameDuration));case o.ANIMATING:}return t=d(t-e.elapsedFrameTime-r),this.state!==o.IDLE&&te.idleBegin())),this._runIdle();break;case o.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test&&(this._test.usedBudget=this._budget.elapsed)}stopFrame(){this._budget.reset(d(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e),this._updatingChanged()}_updateTask(e){this._tasks.forAll(r=>{r.name===e&&r.setPriority(e)})}_getState(e){if(this._runQueue.some(t=>t.name===e))return l.SCHEDULED;let r=l.IDLE;return this._tasks.forAll(t=>{t.name===e&&t.needsUpdate&&(t.schedulePriority<=1?r=l.READY:r!==l.READY&&(r=l.WAITING))}),r}_getRuntime(e){let r=0;return this._tasks.forAll(t=>{t.name===e&&(r+=t.runtime)}),r}_resetRuntimes(){this._tasks.forAll(e=>e.runtime=0)}_getRunning(){const e=new Map;if(this._tasks.forAll(t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)}),e.size===0)return null;let r="";return e.forEach((t,u)=>{r+=t>1?` ${t}x ${u}`:` ${u}`}),r}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce((r,t)=>t.needsUpdate?++r:r,0);this._load=this._load*b+e*(1-b)}_schedule(){for(this._runQueue.filterInPlace(e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1)),this._tasks.forAll(e=>{e.basePriority===E&&e.needsUpdate&&!this._runQueue.includes(e)&&e.blockFrame!==this._frameNumber&&this._runQueue.unshift(e)});this._runQueue.length===0;){let e=!1,r=0;if(this._tasks.forAll(t=>{t.needsUpdate&&t.schedulePriority!==0&&t.basePriority!==E&&t.blockFrame!==this._frameNumber&&(e=!0,r=Math.max(r,t.basePriority),t.schedulePriority===1?(t.schedulePriority=0,this._runQueue.push(t)):--t.schedulePriority)}),!e)return this._updatingChanged(),!1}return this._updatingChanged(),!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const r=this._budget.now(),t=this._runQueue.pop();this._budget.resetProgress();try{t.task.runTask(this._budget)===U&&(t.blockFrame=this._frameNumber)}catch(T){G.getLogger("esri.views.support.Scheduler").error(`Exception in task "${t.name}"`,T),t.blockFrame=this._frameNumber}!this._budget.hasProgressed&&t.blockFrame!==this._frameNumber&&t.needsUpdate&&(t.name,i.I3S_CONTROLLER,t.blockFrame=this._frameNumber),t.schedulePriority=t.basePriority;const u=this._budget.now()-r;if(t.runtime+=u,this._frameTaskTimes.set(t.priority,this._frameTaskTimes.get(t.priority)+u),this._budget.remaining<=0)return this._updatingChanged(),void this._recordFrameTaskTimes(this._budget.now()-e)}while(this._schedule());this._updatingChanged(),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(i))this._frameTaskTimes.set(i[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach((r,t)=>this.performanceInfo.tasks.get(t).push(r)),this.performanceInfo.total.push(e)}get test(){return this._test}}s.Scheduler=n;class a{get task(){return this._task.value}get updating(){return this._queue.running}constructor(e,r,t){this._scheduler=e,this.name=r,this.blockFrame=0,this.runtime=0,this._queue=new H,this._handles=new M,this._basePriority=N(r),this.schedulePriority=this._basePriority,this._task=L(t??this._queue),this._handles.add(Q(()=>this.task.running,u=>e.taskRunningChanged(u)))}remove(){this.processQueue(P),this._scheduler.removeTask(this),this.schedule=O.schedule,this.reschedule=O.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){if(this.name===e)return;this.name=e;const r=N(e);this._basePriority!==E&&this.schedulePriority===0||(this.schedulePriority=r),this._basePriority=r}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,r,t){return this._queue.push(e,r,t)}reschedule(e,r,t){return this._queue.unshift(e,r,t)}processQueue(e){return this._queue.runTask(e)}}class _{constructor(){this._begin=typeof performance<"u"?performance.now():0,this._budget=0,this._state=o.IDLE,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(e()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,r){this._begin=this.now(),this._budget=e,this._state=r,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}}s.Budget=_})(g||(g={})),function(s){s.SCHEDULED="s",s.READY="r",s.WAITING="w",s.IDLE="i"}(l||(l={}));const P=(()=>{const s=new g.Budget;return s.enabled=!1,s})();class X{remove(){}processQueue(){}schedule(n,a,_){try{if(C(a)){const h=I();return _?Promise.resolve(_(h)):Promise.reject(h)}return Y(n(P))}catch(h){return Promise.reject(h)}}reschedule(n,a,_){return this.schedule(n,a,_)}}const O=new X;export{z as W,O as f,i,P as p,o as u}; diff --git a/custom-toc-highlight/assets/SourceLayerData-BT_Ywuvg-DFNndgqY.js b/custom-toc-highlight/assets/SourceLayerData-BT_Ywuvg-D7mjpcmo.js similarity index 96% rename from custom-toc-highlight/assets/SourceLayerData-BT_Ywuvg-DFNndgqY.js rename to custom-toc-highlight/assets/SourceLayerData-BT_Ywuvg-D7mjpcmo.js index 841a1e2b..d479230c 100644 --- a/custom-toc-highlight/assets/SourceLayerData-BT_Ywuvg-DFNndgqY.js +++ b/custom-toc-highlight/assets/SourceLayerData-BT_Ywuvg-D7mjpcmo.js @@ -1 +1 @@ -import{g as l}from"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";var g;(function(c){c[c.moveTo=1]="moveTo",c[c.lineTo=2]="lineTo",c[c.close=7]="close"})(g||(g={}));class m{constructor(e,t,o=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=o;const s=t.keys,u=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const i=r.getMessage().asUnsafe(),a=this.values;for(;!i.empty();){const n=i.getUInt32(),h=i.getUInt32();a[s[n]]=u[h]}i.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 o,s;this._pbfGeometry=null,e?e.reset(this.type):o=[];let u,r=g.moveTo,i=0,a=0,n=0;for(;!t.empty();){if(i===0){const h=t.getUInt32();r=7&h,i=h>>3}switch(i--,r){case g.moveTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.moveTo(a,n):o&&(s&&o.push(s),s=[],s.push(new l(a,n)));break;case g.lineTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.lineTo(a,n):s&&s.push(new l(a,n));break;case g.close:e?e.close():s&&!s[0].equals(a,n)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?u=e.result():o&&(s&&o.push(s),u=o),t.release(),this._geometry=u,u}}class p{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(p._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}}export{m as f,p as g}; +import{g as l}from"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";var g;(function(c){c[c.moveTo=1]="moveTo",c[c.lineTo=2]="lineTo",c[c.close=7]="close"})(g||(g={}));class m{constructor(e,t,o=0){this.values={},this._geometry=void 0,this._pbfGeometry=null,this.featureIndex=o;const s=t.keys,u=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const i=r.getMessage().asUnsafe(),a=this.values;for(;!i.empty();){const n=i.getUInt32(),h=i.getUInt32();a[s[n]]=u[h]}i.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 o,s;this._pbfGeometry=null,e?e.reset(this.type):o=[];let u,r=g.moveTo,i=0,a=0,n=0;for(;!t.empty();){if(i===0){const h=t.getUInt32();r=7&h,i=h>>3}switch(i--,r){case g.moveTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.moveTo(a,n):o&&(s&&o.push(s),s=[],s.push(new l(a,n)));break;case g.lineTo:a+=t.getSInt32(),n+=t.getSInt32(),e?e.lineTo(a,n):s&&s.push(new l(a,n));break;case g.close:e?e.close():s&&!s[0].equals(a,n)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?u=e.result():o&&(s&&o.push(s),u=o),t.release(),this._geometry=u,u}}class p{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(p._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}}export{m as f,p as g}; diff --git a/custom-toc-highlight/assets/SpatialFilter-BlQBFhwz-BhB6yT4Z.js b/custom-toc-highlight/assets/SpatialFilter-BlQBFhwz-B_LMwz1c.js similarity index 99% rename from custom-toc-highlight/assets/SpatialFilter-BlQBFhwz-BhB6yT4Z.js rename to custom-toc-highlight/assets/SpatialFilter-BlQBFhwz-B_LMwz1c.js index 2b42f551..505a5678 100644 --- a/custom-toc-highlight/assets/SpatialFilter-BlQBFhwz-BhB6yT4Z.js +++ b/custom-toc-highlight/assets/SpatialFilter-BlQBFhwz-B_LMwz1c.js @@ -1 +1 @@ -import{c2 as X,F as $,J as ee,t as M}from"./story-BfX8CRfG.js";import{D as te}from"./arcadeUtils-DpP0k7IY-BXaTThTL.js";import{a as c,D as C,N as x,w as P,P as k,x as L,L as ne,y as F,k as re,E as se,b as G,h as B,J as Z}from"./shared-D1w-26bA-B8KlJvO_.js";import{m as O,r as ae,O as j}from"./TimeOnly-DSMefxKy-BU7RNYWc.js";import{Z as T,n as g,a as m,r as W}from"./WhereClause-DxwoyBMS-DnXKVpm2.js";import{union as ie,geodesicArea as le,planarArea as oe,geodesicLength as ue,planarLength as ce,relate as he,crosses as de,touches as pe,within as fe,overlaps as _e,contains as ge,intersects as H}from"./geometryEngineAsync-D7oEu5dd-B6AE24vD.js";import{o as me}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";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 ye={[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 y extends Error{constructor(e,t){super(X(ye[e],t)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,y)}}class A{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]}}A.applicationCache=null;class Se{constructor(e,t){this._lastId=-1,this._progress=t,this._parent=e}reset(){this._lastId=-1}async nextBatchAsArcadeFeatures(e,t){const n=await this.nextBatch(e);return n===null?n:n.map(r=>te.createFromGraphicLikeObject(r.geometry,r.attributes,this._parent,t))}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=i._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(d=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)});const o=i._candidates;if(u>=this._lastId+e||o.length===0){for(let d=0;d=l.length)break;n[d]=l[_]}return this._lastId+=n.length,n.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then(d=>{t.hasset=!0,this._parent._mainSetInUse=null,r(d)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})},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=r._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)})):r._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 E{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 q(s,e){return h(s?.parseTree,e,s?.parameters)}function qe(s,e,t){return h(s,e,t)}function Ye(s,e,t,n){const r=h(s.parseTree,c.Standardised,s.parameters,e,t);return T.create(r,{fieldsIndex:n,timeZone:s.timeZone,currentUser:s.currentUser})}function Qe(s,e,t="AND"){return T.create("(("+q(s,c.Standardised)+")"+t+"("+q(e,c.Standardised)+"))",{fieldsIndex:s.fieldsIndex,timeZone:s.timeZone,currentUser:s.currentUser})}function we(s){return s.delimited===!0?`"${s.column.split('"').join('""')}"`:s.column}function h(s,e,t,n=null,r=null){let a,i,l,u;switch(s.type){case"interval":return Ee(h(s.value,e,t,n,r),s.qualifier,s.op);case"case-expression":{let o=" CASE ";s.format==="simple"&&(o+=h(s.operand,e,t,n,r));for(let d=0;d":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+h(s.left,e,t,n,r)+" "+s.operator+" "+h(s.right,e,t,n,r)+") ";case"||":return" ("+h(s.left,e,t,n,r)+" "+(e===c.SqlServer?"+":s.operator)+" "+h(s.right,e,t,n,r)+") "}throw new g(m.UnsupportedOperator,{operator:s.operator});case"null":return"null";case"boolean":return s.value===!0?"1":"0";case"string":return"'"+s.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${s.value}'`;case"date":return`date '${s.value}'`;case"time":return`time '${s.value}'`;case"number":return s.value.toString();case"current-time":return Ie(s.mode,e);case"current-user":return"CURRENT_USER";case"column-reference":return n&&n.toLowerCase()===s.column.toLowerCase()?"("+r+")":we(s);case"data-type":return s.value;case"function":{const o=h(s.args,e,t,n,r);return Te(s.name,o,e)}}throw new g(m.UnsupportedSyntax,{node:s.type})}function Te(s,e,t){switch(s.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${e[0]})`;case"ceiling":case"ceil":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:"ceiling"});switch(t){case c.Standardised:case c.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"mod":case"power":case"nullif":if(e.length!==2)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${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(m.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new g(m.InvalidFunctionParameters,{function:"truncate"});return t===c.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(m.InvalidFunctionParameters,{function:"char_length"});switch(t){case c.SqlServer:return"LEN("+e[0]+")";case c.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"coalesce":case"concat":{if(e.length<1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase()});let n=s.toUpperCase().trim()+"(";for(let r=0;r":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new g(m.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return R([S(s,e.left,t,n),S(s,e.right,t,n)]);case"||":return"string";default:throw new g(m.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":return"date";case"timestamp":return e.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"current-time":return e.mode==="time"?"time-only":"date";case"current-user":return"string";case"column-reference":{const a=s[e.column.toLowerCase()];return a===void 0?"":a}case"function":switch(e.name.toLowerCase()){case"cast":switch(e.args?.value[1]?.value.type??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return e.args?.value[1]?.value?.withtimezone===!0?"timestamp-offset":"date";case"time":return"time-only";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(r=S(s,e.args,t,n),Array.isArray(r)){if(r.length<=0)return"double";r=r[0]}return r;case"sign":return"integer";case"ceiling":case"floor":case"abs":return r=S(s,e.args,t,n),Array.isArray(r)&&(r=R(r)),r==="integer"||r==="double"?r:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return r=S(s,e.args,t,n),Array.isArray(r)?r.length>0?r[0]:"":r}return""}throw new g(m.UnsupportedSyntax,{node:e.type})}const K={boolean:1,string:2,integer:3,double:4,date:5};function R(s){if(s){let e="";for(const t of s)t!==""&&(e=e===""||K[e]{setTimeout(o,0)}));const u=e?.calculateValue(l);u===null?n===!1&&(a[a.length]=u):a[a.length]=u instanceof j||u instanceof O?u.toNumber():u instanceof W?u.toMilliseconds():u,l=await r.next()}return a}async function Le(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?.aborted)throw new y(f.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(_=>{setTimeout(_,0)}));const o=e?.calculateValue(u);let d=o;if(o instanceof j?d="!!DATEONLY!!-"+o.toString():o instanceof W?d="!!TSOFFSETONLY!!-"+o.toString():o instanceof O?d="!!TIMEONLY!!-"+o.toString():o instanceof Date&&(d="!!DATE!!-"+o.toString()),o!=null&&i[d]===void 0&&(a.push(o),i[d]=1),a.length>=t&&t!==-1)return a;u=await r.next()}return a}class p{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=c.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=Object.create(null),this.typeIdField=null,this.types=null,this.subtypeField=null,this.subtypes=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this.fsetInfo=null,e?.lrucache&&(this.recentlyUsedQueries=e.lrucache),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(){return this._parent?.loaded===!0?(this._initialiseFeatureSet(),this):(await this._parent?.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new ee({wkid:4326}),this.geometryType=ne.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=me.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields: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 y(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 y(f.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l)}async _getAgregagtePhysicalPage(e,t,n){if(this._parent===null)throw new y(f.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===c.NotEvaluated){if(A.applicationCache!==null){const e=A.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),A.applicationCache!==null&&A.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw A.applicationCache!==null&&A.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:c.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:c.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:c.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 c.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new y(f.NotImplemented)}isTable(){return this._parent?.isTable()??!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return F.Unknown}_getSet(e){throw new y(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 y(f.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new E([],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 y(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 E([],[],e._ordered,null);return r._candidates=e._candidates.slice(),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 y(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 ke(this,r),{calculated:!0,result:a};case"distinct":return a=await Le(this,t,n,r),{calculated:!0,result:a};case"avg":case"mean":return a=await Ne(this,t,r),{calculated:!0,result:a};case"stdev":return a=await xe(this,t,r),{calculated:!0,result:a};case"variance":return a=await Ce(this,t,r),{calculated:!0,result:a};case"sum":return a=await Pe(this,t,r),{calculated:!0,result:a};case"min":return a=await ve(this,t,r),{calculated:!0,result:a};case"max":return a=await Re(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?ie(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 Se(this,e)}intersection(e,t=!1){return p._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return p._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return p._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return p._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return p._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return p._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return p._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return p._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return p._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return p._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return p._featuresetFunctions.relate.bind(this)(e,t)}within(e){return p._featuresetFunctions.within.bind(this)(e)}touches(e){return p._featuresetFunctions.touches.bind(this)(e)}top(e){return p._featuresetFunctions.top.bind(this)(e)}crosses(e){return p._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return p._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return p._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return p._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return p._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return p._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);M(o)?o.then(d=>{this._reduceImpl(e,t,d,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 p._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return p._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const r=re(e);return this.reduce((a,i)=>i.geometry===null?0:t?le(i.geometry,r).then(l=>a+l):oe(i.geometry,r).then(l=>a+l),0,n)}sumLength(e,t=!1,n){const r=se(e);return this.reduce((a,i)=>i.geometry===null?0:t?ue(i.geometry,r).then(l=>a+l):ce(i.geometry,r).then(l=>a+l),0,n)}async distinct(e,t=1e3,n=null,r){await this.load();const a=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(a,n),this.calculateStatistic("distinct",a,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",T.create("1",{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),-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):M(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?.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()}subtypeMetaData(){return this.subtypeField&&this.subtypes?{subtypeField:this.subtypeField,subtypes:this.subtypes?this.subtypes.map(e=>({name:e.name,code:e.code})):[]}:this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(G(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:B[this.geometryType]===void 0?"esriGeometryNull":B[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?.featureset==="keeptype"?this:e?.featureset==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if(t?.featureset==="keeptype")return this;if(t?.featureset==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if(t?.featureset==="none")return null;await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?t?.keepGeometryType===!0?i.geometry:i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&t?.keepGeometryType!==!0&&delete l.geometry.spatialReference,n.push(l),1},0,e);const r=this.schema();return r.features=n,r.spatialReference=t?.keepGeometryType===!0?this.spatialReference:this.spatialReference?.toJSON(),r}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){return this._parent?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._parent?.dateFieldsTimeZone??null}get dateFieldsTimeZoneDefaultUTC(){if(this.datesInUnknownTimezone)return"unknown";const e=this.dateFieldsTimeZone??"UTC";return e===""?"UTC":e}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){return this._parent?.editFieldsInfo??null}get timeInfo(){return this._parent?.timeInfo??null}set featureSetInfo(e){this.fsetInfo=e}async getFeatureSetInfo(){return this.fsetInfo??await this._parent?.getFeatureSetInfo()??null}}function D(s,e){if(e!==null){const t={};for(const n in e)t[n.toLowerCase()]=e[n];s.parameters=t}}p._featuresetFunctions={};class b extends p{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new E([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=c.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return F.NotInFeatureSet}async _getFeature(){throw new y(f.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new y(f.NeverReach)}async _getFilteredSet(){return new E([],[],!1,null)}_stat(e,t,n,r,a,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class I extends p{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 E(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===F.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?F.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){if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":return H(Z(this._relationGeom),Z(e.geometry));case"esriSpatialRelIntersects":return H(this._relationGeom,e.geometry);case"esriSpatialRelContains":return ge(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return _e(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return fe(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return pe(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return de(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return he(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,n){const r=new E([],e,!1,null),a=Math.min(t,e.length);await this._parent?._getFeatures(r,-1,a,n),this._checkCancelled(n);const i=[];for(let l=0;lte.createFromGraphicLikeObject(r.geometry,r.attributes,this._parent,t))}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=i._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(d=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)});const o=i._candidates;if(u>=this._lastId+e||o.length===0){for(let d=0;d=l.length)break;n[d]=l[_]}return this._lastId+=n.length,n.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then(d=>{t.hasset=!0,this._parent._mainSetInUse=null,r(d)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},d=>{t.hasset=!0,this._parent._mainSetInUse=null,a(d)})},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=r._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)})):r._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 E{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 q(s,e){return h(s?.parseTree,e,s?.parameters)}function qe(s,e,t){return h(s,e,t)}function Ye(s,e,t,n){const r=h(s.parseTree,c.Standardised,s.parameters,e,t);return T.create(r,{fieldsIndex:n,timeZone:s.timeZone,currentUser:s.currentUser})}function Qe(s,e,t="AND"){return T.create("(("+q(s,c.Standardised)+")"+t+"("+q(e,c.Standardised)+"))",{fieldsIndex:s.fieldsIndex,timeZone:s.timeZone,currentUser:s.currentUser})}function we(s){return s.delimited===!0?`"${s.column.split('"').join('""')}"`:s.column}function h(s,e,t,n=null,r=null){let a,i,l,u;switch(s.type){case"interval":return Ee(h(s.value,e,t,n,r),s.qualifier,s.op);case"case-expression":{let o=" CASE ";s.format==="simple"&&(o+=h(s.operand,e,t,n,r));for(let d=0;d":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+h(s.left,e,t,n,r)+" "+s.operator+" "+h(s.right,e,t,n,r)+") ";case"||":return" ("+h(s.left,e,t,n,r)+" "+(e===c.SqlServer?"+":s.operator)+" "+h(s.right,e,t,n,r)+") "}throw new g(m.UnsupportedOperator,{operator:s.operator});case"null":return"null";case"boolean":return s.value===!0?"1":"0";case"string":return"'"+s.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${s.value}'`;case"date":return`date '${s.value}'`;case"time":return`time '${s.value}'`;case"number":return s.value.toString();case"current-time":return Ie(s.mode,e);case"current-user":return"CURRENT_USER";case"column-reference":return n&&n.toLowerCase()===s.column.toLowerCase()?"("+r+")":we(s);case"data-type":return s.value;case"function":{const o=h(s.args,e,t,n,r);return Te(s.name,o,e)}}throw new g(m.UnsupportedSyntax,{node:s.type})}function Te(s,e,t){switch(s.toLowerCase().trim()){case"cos":case"sin":case"tan":case"cosh":case"tanh":case"sinh":case"acos":case"asin":case"atan":case"floor":case"log10":case"log":case"abs":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${e[0]})`;case"ceiling":case"ceil":if(e.length!==1)throw new g(m.InvalidFunctionParameters,{function:"ceiling"});switch(t){case c.Standardised:case c.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"mod":case"power":case"nullif":if(e.length!==2)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase().trim()});return`${s.toUpperCase().trim()}(${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(m.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new g(m.InvalidFunctionParameters,{function:"truncate"});return t===c.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(m.InvalidFunctionParameters,{function:"char_length"});switch(t){case c.SqlServer:return"LEN("+e[0]+")";case c.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"coalesce":case"concat":{if(e.length<1)throw new g(m.InvalidFunctionParameters,{function:s.toLowerCase()});let n=s.toUpperCase().trim()+"(";for(let r=0;r":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new g(m.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return R([S(s,e.left,t,n),S(s,e.right,t,n)]);case"||":return"string";default:throw new g(m.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":return"date";case"timestamp":return e.withtimezone?"timestamp-offset":"date";case"time":return"time-only";case"current-time":return e.mode==="time"?"time-only":"date";case"current-user":return"string";case"column-reference":{const a=s[e.column.toLowerCase()];return a===void 0?"":a}case"function":switch(e.name.toLowerCase()){case"cast":switch(e.args?.value[1]?.value.type??""){case"integer":case"smallint":return"integer";case"real":case"float":return"double";case"date":case"timestamp":return e.args?.value[1]?.value?.withtimezone===!0?"timestamp-offset":"date";case"time":return"time-only";case"varchar":return"string";default:return""}case"position":case"extract":case"char_length":case"mod":return"integer";case"round":if(r=S(s,e.args,t,n),Array.isArray(r)){if(r.length<=0)return"double";r=r[0]}return r;case"sign":return"integer";case"ceiling":case"floor":case"abs":return r=S(s,e.args,t,n),Array.isArray(r)&&(r=R(r)),r==="integer"||r==="double"?r:"double";case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"cosh":case"sinh":case"tanh":case"power":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string";case"truncate":return"double";case"nullif":case"coalesce":return r=S(s,e.args,t,n),Array.isArray(r)?r.length>0?r[0]:"":r}return""}throw new g(m.UnsupportedSyntax,{node:e.type})}const K={boolean:1,string:2,integer:3,double:4,date:5};function R(s){if(s){let e="";for(const t of s)t!==""&&(e=e===""||K[e]{setTimeout(o,0)}));const u=e?.calculateValue(l);u===null?n===!1&&(a[a.length]=u):a[a.length]=u instanceof j||u instanceof O?u.toNumber():u instanceof W?u.toMilliseconds():u,l=await r.next()}return a}async function Le(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?.aborted)throw new y(f.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(_=>{setTimeout(_,0)}));const o=e?.calculateValue(u);let d=o;if(o instanceof j?d="!!DATEONLY!!-"+o.toString():o instanceof W?d="!!TSOFFSETONLY!!-"+o.toString():o instanceof O?d="!!TIMEONLY!!-"+o.toString():o instanceof Date&&(d="!!DATE!!-"+o.toString()),o!=null&&i[d]===void 0&&(a.push(o),i[d]=1),a.length>=t&&t!==-1)return a;u=await r.next()}return a}class p{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=c.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=Object.create(null),this.typeIdField=null,this.types=null,this.subtypeField=null,this.subtypes=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,this.fsetInfo=null,e?.lrucache&&(this.recentlyUsedQueries=e.lrucache),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(){return this._parent?.loaded===!0?(this._initialiseFeatureSet(),this):(await this._parent?.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new ee({wkid:4326}),this.geometryType=ne.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=me.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields: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 y(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 y(f.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l)}async _getAgregagtePhysicalPage(e,t,n){if(this._parent===null)throw new y(f.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===c.NotEvaluated){if(A.applicationCache!==null){const e=A.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),A.applicationCache!==null&&A.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw A.applicationCache!==null&&A.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:c.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:c.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:c.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 c.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new y(f.NotImplemented)}isTable(){return this._parent?.isTable()??!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return F.Unknown}_getSet(e){throw new y(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 y(f.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new E([],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 y(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 E([],[],e._ordered,null);return r._candidates=e._candidates.slice(),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 y(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 ke(this,r),{calculated:!0,result:a};case"distinct":return a=await Le(this,t,n,r),{calculated:!0,result:a};case"avg":case"mean":return a=await Ne(this,t,r),{calculated:!0,result:a};case"stdev":return a=await xe(this,t,r),{calculated:!0,result:a};case"variance":return a=await Ce(this,t,r),{calculated:!0,result:a};case"sum":return a=await Pe(this,t,r),{calculated:!0,result:a};case"min":return a=await ve(this,t,r),{calculated:!0,result:a};case"max":return a=await Re(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?ie(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 Se(this,e)}intersection(e,t=!1){return p._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return p._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return p._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return p._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return p._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return p._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return p._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return p._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return p._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return p._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return p._featuresetFunctions.relate.bind(this)(e,t)}within(e){return p._featuresetFunctions.within.bind(this)(e)}touches(e){return p._featuresetFunctions.touches.bind(this)(e)}top(e){return p._featuresetFunctions.top.bind(this)(e)}crosses(e){return p._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return p._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return p._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return p._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return p._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return p._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);M(o)?o.then(d=>{this._reduceImpl(e,t,d,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 p._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return p._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const r=re(e);return this.reduce((a,i)=>i.geometry===null?0:t?le(i.geometry,r).then(l=>a+l):oe(i.geometry,r).then(l=>a+l),0,n)}sumLength(e,t=!1,n){const r=se(e);return this.reduce((a,i)=>i.geometry===null?0:t?ue(i.geometry,r).then(l=>a+l):ce(i.geometry,r).then(l=>a+l),0,n)}async distinct(e,t=1e3,n=null,r){await this.load();const a=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(a,n),this.calculateStatistic("distinct",a,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const r=T.create(e,{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC});return D(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",T.create("1",{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),-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):M(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?.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()}subtypeMetaData(){return this.subtypeField&&this.subtypes?{subtypeField:this.subtypeField,subtypes:this.subtypes?this.subtypes.map(e=>({name:e.name,code:e.code})):[]}:this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(G(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:B[this.geometryType]===void 0?"esriGeometryNull":B[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?.featureset==="keeptype"?this:e?.featureset==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if(t?.featureset==="keeptype")return this;if(t?.featureset==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if(t?.featureset==="none")return null;await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?t?.keepGeometryType===!0?i.geometry:i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&t?.keepGeometryType!==!0&&delete l.geometry.spatialReference,n.push(l),1},0,e);const r=this.schema();return r.features=n,r.spatialReference=t?.keepGeometryType===!0?this.spatialReference:this.spatialReference?.toJSON(),r}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){return this._parent?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._parent?.dateFieldsTimeZone??null}get dateFieldsTimeZoneDefaultUTC(){if(this.datesInUnknownTimezone)return"unknown";const e=this.dateFieldsTimeZone??"UTC";return e===""?"UTC":e}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){return this._parent?.editFieldsInfo??null}get timeInfo(){return this._parent?.timeInfo??null}set featureSetInfo(e){this.fsetInfo=e}async getFeatureSetInfo(){return this.fsetInfo??await this._parent?.getFeatureSetInfo()??null}}function D(s,e){if(e!==null){const t={};for(const n in e)t[n.toLowerCase()]=e[n];s.parameters=t}}p._featuresetFunctions={};class b extends p{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new E([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=c.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return F.NotInFeatureSet}async _getFeature(){throw new y(f.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new y(f.NeverReach)}async _getFilteredSet(){return new E([],[],!1,null)}_stat(e,t,n,r,a,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class I extends p{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 E(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===F.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?F.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){if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":return H(Z(this._relationGeom),Z(e.geometry));case"esriSpatialRelIntersects":return H(this._relationGeom,e.geometry);case"esriSpatialRelContains":return ge(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return _e(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return fe(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return pe(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return de(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return he(this._relationGeom,e.geometry,this._relationString??"")}}async _fetchAndRefineFeatures(e,t,n){const r=new E([],e,!1,null),a=Math.min(t,e.length);await this._parent?._getFeatures(r,-1,a,n),this._checkCancelled(n);const i=[];for(let l=0;lY.fromJSON(T))}writeRestrictionAttributes(e,r,n){e!=null&&(r[n]=e.map(T=>Y.toJSON(T)))}};t([i({type:[Object],json:{write:!0}})],d.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"description",void 0),t([j(ie,{ignoreUnknown:!1})],d.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"id",void 0),t([p("id",["id","itemId"])],d.prototype,"readId",null),t([j(O,{ignoreUnknown:!1})],d.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],d.prototype,"restrictionAttributeNames",void 0),t([p("restrictionAttributeNames")],d.prototype,"readRestrictionAttributes",null),t([A("restrictionAttributeNames")],d.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],d.prototype,"simplificationTolerance",void 0),t([j(Q)],d.prototype,"simplificationToleranceUnits",void 0),t([j(re,{ignoreUnknown:!1})],d.prototype,"timeAttributeName",void 0),t([j(te)],d.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],d.prototype,"useHierarchy",void 0),t([j(ee)],d.prototype,"uturnAtJunctions",void 0),d=t([S("esri.rest.support.TravelMode")],d);const se=d;let v=class extends g{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 e==null?null:e.map(r=>O.fromJSON(r))}writeAccumulateAttributes(e,r,n){e?.length&&(r[n]=e.map(T=>O.toJSON(T)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],v.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],v.prototype,"readAccumulateAttributes",null),t([A("accumulateAttributes")],v.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],v.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"timeWindowsAreUTC",void 0),t([i({type:se,json:{write:!0}})],v.prototype,"travelMode",void 0),v=t([S("esri.rest.support.RouteSettings")],v);const ae=v;var _;let a=_=class extends D(g){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,r){return r.attributes.EndTimeUTC!=null?new Date(r.attributes.EndTimeUTC):null}readEndTimeOffset(e,r){return B(r.attributes.EndTime,r.attributes.EndTimeUTC)}readStartTime(e,r){return r.attributes.StartTimeUTC!=null?new Date(r.attributes.StartTimeUTC):null}readStartTimeOffset(e,r){return B(r.attributes.StartTime,r.attributes.StartTimeUTC)}readTotalCosts(e,r){return f(r.attributes,"Total_")}readTotalViolations(e,r){return f(r.attributes,"TotalViolation_")}readTotalWait(e,r){return f(r.attributes,"TotalWait_")}static fromGraphic(e){return new _({analysisSettings:e.attributes.AnalysisSettings!=null?ae.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:e.attributes.EndTime!=null?new Date(e.attributes.EndTime):null,endTimeOffset:e.attributes.EndUTCOffset??null,geometry:e.geometry,messages:e.attributes.Messages!=null?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:e.attributes.StartTime!=null?new Date(e.attributes.StartTime):null,startTimeOffset:e.attributes.StartUTCOffset??null,symbol:e.symbol,totalCosts:e.attributes.TotalCosts!=null?F(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:e.attributes.TotalMeters??null,totalDuration:e.attributes.TotalMinutes??null,totalLateDuration:e.attributes.TotalLateMinutes??null,totalWaitDuration:e.attributes.TotalWaitMinutes??null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(U(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};a.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString"},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate"},{name:"EndUTCOffset",alias:"End Time Offset",type:"esriFieldTypeInteger"},{name:"Messages",alias:"Messages",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate"},{name:"StartUTCOffset",alias:"Start Time Offset",type:"esriFieldTypeInteger"},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString"},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble"},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble"},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble"},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble"},{name:"Version",alias:"Version",type:"esriFieldTypeString"}],t([i()],a.prototype,"analysisSettings",void 0),t([i()],a.prototype,"endTime",void 0),t([p("endTime",["attributes.EndTimeUTC"])],a.prototype,"readEndTime",null),t([i()],a.prototype,"endTimeOffset",void 0),t([p("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],a.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],a.prototype,"firstStopId",void 0),t([i({type:K})],a.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],a.prototype,"lastStopId",void 0),t([i()],a.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],a.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],a.prototype,"objectId",void 0),t([i({type:C})],a.prototype,"popupTemplate",void 0),t([i()],a.prototype,"startTime",void 0),t([p("startTime",["attributes.StartTimeUTC"])],a.prototype,"readStartTime",null),t([i()],a.prototype,"startTimeOffset",void 0),t([p("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],a.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],a.prototype,"stopCount",void 0),t([i({types:I})],a.prototype,"symbol",void 0),t([i()],a.prototype,"totalCosts",void 0),t([p("totalCosts",["attributes"])],a.prototype,"readTotalCosts",null),t([i()],a.prototype,"totalDistance",void 0),t([i()],a.prototype,"totalDuration",void 0),t([i()],a.prototype,"totalLateDuration",void 0),t([i()],a.prototype,"totalViolations",void 0),t([p("totalViolations",["attributes"])],a.prototype,"readTotalViolations",null),t([i()],a.prototype,"totalWait",void 0),t([p("totalWait",["attributes"])],a.prototype,"readTotalWait",null),t([i()],a.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),t([i()],a.prototype,"version",void 0),a=_=t([S("esri.rest.support.RouteInfo")],a);const Ne=a;var G;let s=G=class extends D(g){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,r){return B(r.attributes.ArriveTime,r.attributes.ArriveTimeUTC)}readCumulativeCosts(e,r){return f(r.attributes,"Cumul_")}readDepartTimeOffset(e,r){return B(r.attributes.DepartTime,r.attributes.DepartTimeUTC)}readServiceCosts(e,r){return f(r.attributes,"Attr_")}writeServiceCosts(e,r){H(e,r,"Attr_")}writeTimeWindowEnd(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowStart=e.getTime())}readViolations(e,r){return f(r.attributes,"Violation_")}readWait(e,r){return f(r.attributes,"Wait_")}static fromGraphic(e){return new G({arriveCurbApproach:e.attributes.ArrivalCurbApproach!=null?m.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:e.attributes.CumulativeCosts!=null?F(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:e.attributes.CurbApproach!=null?m.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:e.attributes.DepartureCurbApproach!=null?m.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:e.attributes.DepartureTime!=null?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:e.attributes.LocationType!=null?E.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:e.attributes.ServiceCosts!=null?F(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:e.attributes.Status!=null?N.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:e.attributes.TimeWindowEnd!=null?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:e.attributes.TimeWindowStart!=null?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?m.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(U(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?m.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?m.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?E.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(U(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?N.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};s.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time",type:"esriFieldTypeInteger"},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString"},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble"},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate"},{name:"DepartureUTCOffset",alias:"Departure Time",type:"esriFieldTypeInteger"},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble"},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString"},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble"},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate"},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger"},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate"},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger"},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble"}],t([i({type:m.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:m.read}}})],s.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],s.prototype,"arriveTime",void 0),t([i()],s.prototype,"arriveTimeOffset",void 0),t([p("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],s.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],s.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],s.prototype,"bearingTol",void 0),t([i()],s.prototype,"cumulativeCosts",void 0),t([p("cumulativeCosts",["attributes"])],s.prototype,"readCumulativeCosts",null),t([i()],s.prototype,"cumulativeDistance",void 0),t([i()],s.prototype,"cumulativeDuration",void 0),t([i({type:m.apiValues,json:{name:"attributes.CurbApproach",read:{reader:m.read},write:{writer:m.write}}})],s.prototype,"curbApproach",void 0),t([i({type:m.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:m.read}}})],s.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],s.prototype,"departTime",void 0),t([i()],s.prototype,"departTimeOffset",void 0),t([p("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],s.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],s.prototype,"distanceToNetworkInMeters",void 0),t([i({type:z,json:{write:!0}})],s.prototype,"geometry",void 0),t([i()],s.prototype,"lateDuration",void 0),t([i({type:E.apiValues,json:{name:"attributes.LocationType",read:{reader:E.read},write:{writer:E.write}}})],s.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],s.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],s.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],s.prototype,"objectId",void 0),t([i({type:C})],s.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],s.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],s.prototype,"routeName",void 0),t([i()],s.prototype,"serviceCosts",void 0),t([p("serviceCosts",["attributes"])],s.prototype,"readServiceCosts",null),t([A("serviceCosts")],s.prototype,"writeServiceCosts",null),t([i()],s.prototype,"serviceDistance",void 0),t([i()],s.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],s.prototype,"sequence",void 0),t([i({type:k.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:k.read}}})],s.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],s.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],s.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],s.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],s.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],s.prototype,"sourceOid",void 0),t([i({type:N.apiValues,json:{read:{source:"attributes.Status",reader:N.read}}})],s.prototype,"status",void 0),t([i({types:I})],s.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],s.prototype,"timeWindowEnd",void 0),t([A("timeWindowEnd")],s.prototype,"writeTimeWindowEnd",null),t([i()],s.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],s.prototype,"timeWindowStart",void 0),t([A("timeWindowStart")],s.prototype,"writeTimeWindowStart",null),t([i()],s.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"type",void 0),t([i()],s.prototype,"violations",void 0),t([p("violations",["attributes"])],s.prototype,"readViolations",null),t([i()],s.prototype,"waitDuration",void 0),t([i()],s.prototype,"wait",void 0),t([p("wait",["attributes"])],s.prototype,"readWait",null),s=G=t([S("esri.rest.support.Stop")],s);const De=s;export{ee as $,O as A,De as N,re as Q,ge as S,be as T,Y as V,B as W,Q as Z,le as a,he as b,ye as c,me as d,se as e,Se as f,Ne as g,ve as h,ce as m,pe as n,ue as o,ne as s,ae as t,de as u,fe as v,Te as y}; +import{cr as o,aa as D,bi as w,v as t,S as i,m as K,bL as C,dM as I,i as S,a0 as p,w as z,ac as A,l as Z,bz as j,e as g}from"./story-Doly9N9p.js";const $={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"},Q=o()($);o()({...$,esriIntFeet:"international-feet",esriIntInches:"international-inches",esriIntMiles:"international-miles",esriIntNauticalMiles:"international-nautical-miles",esriIntYards:"international-yards"}),o()({esriAcres:"international-acres",esriAcresUS:"us-acres",esriAres:"ares",esriHectares:"hectares",esriSquareCentimeters:"square-centimeters",esriSquareDecimeters:"square-decimeters",esriSquareFeet:"square-international-feet",esriSquareFeetUS:"square-us-feet",esriSquareInches:"square-international-inches",esriSquareInchesUS:"square-us-inches",esriSquareKilometers:"square-kilometers",esriSquareMeters:"square-meters",esriSquareMiles:"square-international-miles",esriSquareMilesUS:"square-us-miles",esriSquareMillimeters:"square-millimeters",esriSquareYards:"square-international-yards",esriSquareYardsUS:"square-us-yards",esriUnknownAreaUnits:"unknown"});const ne=o()({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"});o()({esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds"});const le=o()({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",esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds",esriNAUKilometersPerHour:"kilometers-per-hour",esriNAUMilesPerHour:"miles-per-hour",esriNAUUnknown:"unknown"}),ue=o()({esriDOTComplete:"complete",esriDOTCompleteNoEvents:"complete-no-events",esriDOTFeatureSets:"featuresets",esriDOTInstructionsOnly:"instructions-only",esriDOTStandard:"standard",esriDOTSummaryOnly:"summary-only"}),pe=o()({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"});o()({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"});const ee=o()({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"});o()({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"}),o()({esriNATimeOfDayNotUsed:"not-used",esriNATimeOfDayUseAsStartTime:"start",esriNATimeOfDayUseAsEndTime:"end"});const te=o()({AUTOMOBILE:"automobile",TRUCK:"truck",WALK:"walk",OTHER:"other"}),m=o()({0:"either-side-of-vehicle",1:"right-side-of-vehicle",2:"left-side-of-vehicle",3:"no-u-turn"},{useNumericKeys:!0}),E=o()({0:"stop",1:"waypoint",2:"break"},{useNumericKeys:!0}),N=o()({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}),k=o()({1:"right",2:"left"},{useNumericKeys:!0}),h=o()({0:"restriction",1:"scaled-cost",2:"added-cost"},{useNumericKeys:!0}),W=o()({0:"permit",1:"restrict"},{useNumericKeys:!0}),L=o()({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",1007:"lane"},{useNumericKeys:!0}),J=o()({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}),de=o()({"NA Campus":"campus","NA Desktop":"desktop","NA Navigation":"navigation"}),ie=o()({Kilometers:"kilometers",Miles:"miles",Meters:"meters"},{ignoreUnknown:!1}),re=o()({Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),O=o()({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}),Y=o()({"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}),me=o()({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),ce=o()({esriGeometryPoint:"point",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"envelope",esriGeometryMultipoint:"multipoint"}),ye=o()({esriNAUTCost:"cost",esriNAUTDescriptor:"descriptor",esriNAUTRestriction:"restriction",esriNAUTHierarchy:"hierarchy"}),Te=o()({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 P;let c=P=class extends D(g){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){return new P({directionLineType:J.fromJSON(e.attributes.DirectionLineType),directionPointId:e.attributes.DirectionPointID,distance:e.attributes.Meters,duration:e.attributes.Minutes,fromLevel:e.attributes.FromLevel??null,geometry:e.geometry,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,symbol:e.symbol,toLevel:e.attributes.ToLevel??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionLineType:this.directionLineType!=null?J.toJSON(this.directionLineType):null,DirectionPointID:this.directionPointId,Meters:this.distance,Minutes:this.duration};return this.fromLevel!=null&&(e.FromLevel=this.fromLevel),this.toLevel!=null&&(e.ToLevel=this.toLevel),new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};c.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger"},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger"},{name:"FromLevel",alias:"From Level",type:"esriFieldTypeInteger"},{name:"Meters",alias:"Meters",type:"esriFieldTypeDouble"},{name:"Minutes",alias:"Minutes",type:"esriFieldTypeDouble"},{name:"ToLevel",alias:"To Level",type:"esriFieldTypeInteger"}],t([i({type:J.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:J.read}}})],c.prototype,"directionLineType",void 0),t([i({json:{read:{source:"attributes.DirectionPointID"}}})],c.prototype,"directionPointId",void 0),t([i({json:{read:{source:"attributes.Meters"}}})],c.prototype,"distance",void 0),t([i({json:{read:{source:"attributes.Minutes"}}})],c.prototype,"duration",void 0),t([i({json:{read:{source:"attributes.FromLevel"}}})],c.prototype,"fromLevel",void 0),t([i({type:K})],c.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],c.prototype,"objectId",void 0),t([i({type:C})],c.prototype,"popupTemplate",void 0),t([i({types:I})],c.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.ToLevel"}}})],c.prototype,"toLevel",void 0),t([i({readOnly:!0,json:{read:!1}})],c.prototype,"type",void 0),c=P=t([S("esri.rest.support.DirectionLine")],c);const be=c;var R;let l=R=class extends D(g){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,r){return r.attributes.ArrivalTime!=null?new Date(r.attributes.ArrivalTime):null}static fromGraphic(e){return new R({alternateName:e.attributes.AlternateName??null,arrivalTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arrivalTimeOffset:e.attributes.ArrivalUTCOffset??null,azimuth:e.attributes.Azimuth??null,branchName:e.attributes.BranchName??null,directionPointType:L.fromJSON(e.attributes.DirectionPointType),displayText:e.attributes.DisplayText??null,exitName:e.attributes.ExitName??null,geometry:e.geometry,intersectingName:e.attributes.IntersectingName??null,level:e.attributes.Level??null,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,sequence:e.attributes.Sequence,shortVoiceInstruction:e.attributes.ShortVoiceInstruction??null,stopId:e.attributes.StopID??null,symbol:e.symbol,towardName:e.attributes.TowardName??null,voiceInstruction:e.attributes.VoiceInstruction??null})}toGraphic(){const e={ObjectID:this.objectId,DirectionPointType:this.directionPointType!=null?L.toJSON(this.directionPointType):null,Sequence:this.sequence,StopID:this.stopId};return this.alternateName!=null&&(e.AlternateName=this.alternateName),this.arrivalTime!=null&&(e.ArrivalTime=this.arrivalTime.getTime()),this.arrivalTimeOffset!=null&&(e.ArrivalUTCOffset=this.arrivalTimeOffset),this.azimuth!=null&&(e.Azimuth=this.azimuth),this.branchName!=null&&(e.BranchName=this.branchName),this.displayText!=null&&(e.DisplayText=this.displayText),this.exitName!=null&&(e.ExitName=this.exitName),this.intersectingName!=null&&(e.IntersectingName=this.intersectingName),this.level!=null&&(e.Level=this.level),this.name!=null&&(e.Name=this.name),this.shortVoiceInstruction!=null&&(e.ShortVoiceInstruction=this.shortVoiceInstruction),this.towardName!=null&&(e.TowardName=this.towardName),this.voiceInstruction!=null&&(e.VoiceInstruction=this.voiceInstruction),new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};l.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AlternateName",alias:"Alternative Name",type:"esriFieldTypeString"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time Offset",type:"esriFieldTypeInteger"},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble"},{name:"BranchName",alias:"Branch Name",type:"esriFieldTypeString"},{name:"DirectionPointType",alias:"Directions Point Type",type:"esriFieldTypeInteger"},{name:"DisplayText",alias:"Display Text",type:"esriFieldTypeString"},{name:"ExitName",alias:"Exit Name",type:"esriFieldTypeString"},{name:"IntersectingName",alias:"Intersecting Name",type:"esriFieldTypeString"},{name:"Level",alias:"Level",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ShortVoiceInstruction",alias:"Short Voice Instruction",type:"esriFieldTypeString"},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger"},{name:"TowardName",alias:"Toward Name",type:"esriFieldTypeString"},{name:"VoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString"}],t([i({json:{read:{source:"attributes.AlternateName"}}})],l.prototype,"alternateName",void 0),t([i()],l.prototype,"arrivalTime",void 0),t([p("arrivalTime",["attributes.ArrivalTime"])],l.prototype,"readArrivalTime",null),t([i({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],l.prototype,"arrivalTimeOffset",void 0),t([i({json:{read:{source:"attributes.Azimuth"}}})],l.prototype,"azimuth",void 0),t([i({json:{read:{source:"attributes.BranchName"}}})],l.prototype,"branchName",void 0),t([i({type:L.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:L.read}}})],l.prototype,"directionPointType",void 0),t([i({json:{read:{source:"attributes.DisplayText"}}})],l.prototype,"displayText",void 0),t([i({json:{read:{source:"attributes.ExitName"}}})],l.prototype,"exitName",void 0),t([i({type:z})],l.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.IntersectingName"}}})],l.prototype,"intersectingName",void 0),t([i({json:{read:{source:"attributes.Level"}}})],l.prototype,"level",void 0),t([i({json:{read:{source:"attributes.Name"}}})],l.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],l.prototype,"objectId",void 0),t([i({type:C})],l.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.Sequence"}}})],l.prototype,"sequence",void 0),t([i({json:{read:{source:"attributes.ShortVoiceInstruction"}}})],l.prototype,"shortVoiceInstruction",void 0),t([i({json:{read:{source:"attributes.StopID"}}})],l.prototype,"stopId",void 0),t([i({types:I})],l.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.TowardName"}}})],l.prototype,"towardName",void 0),t([i({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),t([i({json:{read:{source:"attributes.VoiceInstruction"}}})],l.prototype,"voiceInstruction",void 0),l=R=t([S("esri.rest.support.DirectionPoint")],l);const he=l;function f(e,r){if(e==null)return null;const n={},T=new RegExp(`^${r}`,"i");for(const M of Object.keys(e))if(T.test(M)){const X=M.slice(r.length);n[O.fromJSON(X)]=e[M]}return n}function H(e,r,n){if(e!=null){r.attributes||(r.attributes={});for(const T in e){const M=O.toJSON(T);r.attributes[`${n}${M}`]=e[T]}}}function F(e){const r={};for(const n of Object.keys(e)){const T=n;r[O.fromJSON(T)]=e[n]}return r}function U(e){const r={};for(const n of Object.keys(e)){const T=n;r[O.toJSON(T)]=e[n]}return r}function B(e,r){return e==null||r==null?null:Math.round((e-r)/6e4)}function ve(e){const r=e.toJSON(),n=r;return n.accumulateAttributeNames&&=r.accumulateAttributeNames?.join(),n.attributeParameterValues&&=JSON.stringify(r.attributeParameterValues),n.barriers&&=JSON.stringify(r.barriers),n.outSR&&=r.outSR?.wkid,n.overrides&&=JSON.stringify(r.overrides),n.polygonBarriers&&=JSON.stringify(r.polygonBarriers),n.polylineBarriers&&=JSON.stringify(r.polylineBarriers),n.restrictionAttributeNames&&=r.restrictionAttributeNames?.join(),n.stops&&=JSON.stringify(r.stops),n.travelMode&&=JSON.stringify(r.travelMode),n}var V;let u=V=class extends D(g){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,r){return f(r.attributes,"Attr_")}writeCosts(e,r){H(e,r,"Attr_")}static fromGraphic(e){return new V({addedCost:e.attributes.AddedCost??null,barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?F(JSON.parse(e.attributes.Costs)):null,curbApproach:e.attributes.CurbApproach!=null?m.fromJSON(e.attributes.CurbApproach):null,fullEdge:e.attributes.FullEdge!=null?W.fromJSON(e.attributes.FullEdge):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,status:e.attributes.Status!=null?N.fromJSON(e.attributes.Status):null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,AddedCost:this.addedCost,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(U(this.costs)):null,CurbApproach:this.curbApproach!=null?m.toJSON(this.curbApproach):null,FullEdge:this.fullEdge!=null?W.toJSON(this.fullEdge):null,Name:this.name,Status:this.status!=null?N.toJSON(this.status):null};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};u.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"}],t([i()],u.prototype,"addedCost",void 0),t([i({type:h.apiValues,json:{name:"attributes.BarrierType",read:{reader:h.read},write:{writer:h.write}}})],u.prototype,"barrierType",void 0),t([i()],u.prototype,"costs",void 0),t([p("costs",["attributes"])],u.prototype,"readCosts",null),t([A("costs")],u.prototype,"writeCosts",null),t([i({constructOnly:!0,type:m.apiValues,json:{read:{source:"attributes.CurbApproach",reader:m.read}}})],u.prototype,"curbApproach",void 0),t([i({type:W.apiValues,json:{name:"attributes.FullEdge",read:{reader:W.read},write:{writer:W.write}}})],u.prototype,"fullEdge",void 0),t([i({type:z,json:{write:!0}})],u.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],u.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],u.prototype,"objectId",void 0),t([i({type:C})],u.prototype,"popupTemplate",void 0),t([i({type:k.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:k.read}}})],u.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],u.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],u.prototype,"sourceOid",void 0),t([i({type:N.apiValues,json:{read:{source:"attributes.Status",reader:N.read}}})],u.prototype,"status",void 0),t([i({types:I})],u.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],u.prototype,"type",void 0),u=V=t([S("esri.rest.support.PointBarrier")],u);const fe=u;var x;let y=x=class extends D(g){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,r){return f(r.attributes,"Attr_")}writeCosts(e,r){H(e,r,"Attr_")}static fromGraphic(e){return new x({barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?F(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(U(this.costs)):null,Name:this.name??null,ScaleFactor:this.scaleFactor??null};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};y.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}],t([i({type:h.apiValues,json:{name:"attributes.BarrierType",read:{reader:h.read},write:{writer:h.write}}})],y.prototype,"barrierType",void 0),t([i()],y.prototype,"costs",void 0),t([p("costs",["attributes"])],y.prototype,"readCosts",null),t([A("costs")],y.prototype,"writeCosts",null),t([i({type:Z,json:{write:!0}})],y.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],y.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],y.prototype,"objectId",void 0),t([i({type:C})],y.prototype,"popupTemplate",void 0),t([i()],y.prototype,"scaleFactor",void 0),t([i({types:I})],y.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],y.prototype,"type",void 0),y=x=t([S("esri.rest.support.PolygonBarrier")],y);const Se=y;var q;let b=q=class extends D(g){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,r){return f(r.attributes,"Attr_")}static fromGraphic(e){return new q({barrierType:e.attributes.BarrierType!=null?h.fromJSON(e.attributes.BarrierType):null,costs:e.attributes.Costs!=null?F(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:e.attributes.Name??null,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:e.attributes.ScaleFactor??null,symbol:e.symbol})}toGraphic(){const e={ObjectID:this.objectId,BarrierType:this.barrierType!=null?h.toJSON(this.barrierType):null,Costs:this.costs!=null?JSON.stringify(U(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};b.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger"},{name:"Costs",alias:"Costs",type:"esriFieldTypeString"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble"}],t([i({type:h.apiValues,json:{read:{source:"attributes.BarrierType",reader:h.read}}})],b.prototype,"barrierType",void 0),t([i()],b.prototype,"costs",void 0),t([p("costs",["attributes"])],b.prototype,"readCosts",null),t([i({type:K,json:{write:!0}})],b.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],b.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],b.prototype,"objectId",void 0),t([i({type:C})],b.prototype,"popupTemplate",void 0),t([i()],b.prototype,"scaleFactor",void 0),t([i({types:I})],b.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],b.prototype,"type",void 0),b=q=t([S("esri.rest.support.PolylineBarrier")],b);const ge=b;let d=class extends D(g){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}readId(e,r){return r.id??r.itemId??null}readRestrictionAttributes(e,r){const{restrictionAttributeNames:n}=r;return n==null?null:n.map(T=>Y.fromJSON(T))}writeRestrictionAttributes(e,r,n){e!=null&&(r[n]=e.map(T=>Y.toJSON(T)))}};t([i({type:[Object],json:{write:!0}})],d.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"description",void 0),t([j(ie,{ignoreUnknown:!1})],d.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"id",void 0),t([p("id",["id","itemId"])],d.prototype,"readId",null),t([j(O,{ignoreUnknown:!1})],d.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],d.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],d.prototype,"restrictionAttributeNames",void 0),t([p("restrictionAttributeNames")],d.prototype,"readRestrictionAttributes",null),t([A("restrictionAttributeNames")],d.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],d.prototype,"simplificationTolerance",void 0),t([j(Q)],d.prototype,"simplificationToleranceUnits",void 0),t([j(re,{ignoreUnknown:!1})],d.prototype,"timeAttributeName",void 0),t([j(te)],d.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],d.prototype,"useHierarchy",void 0),t([j(ee)],d.prototype,"uturnAtJunctions",void 0),d=t([S("esri.rest.support.TravelMode")],d);const se=d;let v=class extends g{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 e==null?null:e.map(r=>O.fromJSON(r))}writeAccumulateAttributes(e,r,n){e?.length&&(r[n]=e.map(T=>O.toJSON(T)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],v.prototype,"accumulateAttributes",void 0),t([p("accumulateAttributes")],v.prototype,"readAccumulateAttributes",null),t([A("accumulateAttributes")],v.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],v.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],v.prototype,"timeWindowsAreUTC",void 0),t([i({type:se,json:{write:!0}})],v.prototype,"travelMode",void 0),v=t([S("esri.rest.support.RouteSettings")],v);const ae=v;var _;let a=_=class extends D(g){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,r){return r.attributes.EndTimeUTC!=null?new Date(r.attributes.EndTimeUTC):null}readEndTimeOffset(e,r){return B(r.attributes.EndTime,r.attributes.EndTimeUTC)}readStartTime(e,r){return r.attributes.StartTimeUTC!=null?new Date(r.attributes.StartTimeUTC):null}readStartTimeOffset(e,r){return B(r.attributes.StartTime,r.attributes.StartTimeUTC)}readTotalCosts(e,r){return f(r.attributes,"Total_")}readTotalViolations(e,r){return f(r.attributes,"TotalViolation_")}readTotalWait(e,r){return f(r.attributes,"TotalWait_")}static fromGraphic(e){return new _({analysisSettings:e.attributes.AnalysisSettings!=null?ae.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:e.attributes.EndTime!=null?new Date(e.attributes.EndTime):null,endTimeOffset:e.attributes.EndUTCOffset??null,geometry:e.geometry,messages:e.attributes.Messages!=null?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:e.attributes.StartTime!=null?new Date(e.attributes.StartTime):null,startTimeOffset:e.attributes.StartUTCOffset??null,symbol:e.symbol,totalCosts:e.attributes.TotalCosts!=null?F(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:e.attributes.TotalMeters??null,totalDuration:e.attributes.TotalMinutes??null,totalLateDuration:e.attributes.TotalLateMinutes??null,totalWaitDuration:e.attributes.TotalWaitMinutes??null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:this.objectId,AnalysisSettings:this.analysisSettings!=null?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:this.endTime!=null?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:this.messages!=null?JSON.stringify(this.messages):null,RouteName:this.name,StartTime:this.startTime!=null?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:this.totalCosts!=null?JSON.stringify(U(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:this.version};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};a.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString"},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate"},{name:"EndUTCOffset",alias:"End Time Offset",type:"esriFieldTypeInteger"},{name:"Messages",alias:"Messages",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate"},{name:"StartUTCOffset",alias:"Start Time Offset",type:"esriFieldTypeInteger"},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString"},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble"},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble"},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble"},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble"},{name:"Version",alias:"Version",type:"esriFieldTypeString"}],t([i()],a.prototype,"analysisSettings",void 0),t([i()],a.prototype,"endTime",void 0),t([p("endTime",["attributes.EndTimeUTC"])],a.prototype,"readEndTime",null),t([i()],a.prototype,"endTimeOffset",void 0),t([p("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],a.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],a.prototype,"firstStopId",void 0),t([i({type:K})],a.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],a.prototype,"lastStopId",void 0),t([i()],a.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],a.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],a.prototype,"objectId",void 0),t([i({type:C})],a.prototype,"popupTemplate",void 0),t([i()],a.prototype,"startTime",void 0),t([p("startTime",["attributes.StartTimeUTC"])],a.prototype,"readStartTime",null),t([i()],a.prototype,"startTimeOffset",void 0),t([p("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],a.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],a.prototype,"stopCount",void 0),t([i({types:I})],a.prototype,"symbol",void 0),t([i()],a.prototype,"totalCosts",void 0),t([p("totalCosts",["attributes"])],a.prototype,"readTotalCosts",null),t([i()],a.prototype,"totalDistance",void 0),t([i()],a.prototype,"totalDuration",void 0),t([i()],a.prototype,"totalLateDuration",void 0),t([i()],a.prototype,"totalViolations",void 0),t([p("totalViolations",["attributes"])],a.prototype,"readTotalViolations",null),t([i()],a.prototype,"totalWait",void 0),t([p("totalWait",["attributes"])],a.prototype,"readTotalWait",null),t([i()],a.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),t([i()],a.prototype,"version",void 0),a=_=t([S("esri.rest.support.RouteInfo")],a);const Ne=a;var G;let s=G=class extends D(g){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,r){return B(r.attributes.ArriveTime,r.attributes.ArriveTimeUTC)}readCumulativeCosts(e,r){return f(r.attributes,"Cumul_")}readDepartTimeOffset(e,r){return B(r.attributes.DepartTime,r.attributes.DepartTimeUTC)}readServiceCosts(e,r){return f(r.attributes,"Attr_")}writeServiceCosts(e,r){H(e,r,"Attr_")}writeTimeWindowEnd(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,r){e!=null&&(r.attributes||(r.attributes={}),r.attributes.TimeWindowStart=e.getTime())}readViolations(e,r){return f(r.attributes,"Violation_")}readWait(e,r){return f(r.attributes,"Wait_")}static fromGraphic(e){return new G({arriveCurbApproach:e.attributes.ArrivalCurbApproach!=null?m.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:e.attributes.ArrivalTime!=null?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:e.attributes.CumulativeCosts!=null?F(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:e.attributes.CumulativeMeters??null,cumulativeDuration:e.attributes.CumulativeMinutes??null,curbApproach:e.attributes.CurbApproach!=null?m.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:e.attributes.DepartureCurbApproach!=null?m.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:e.attributes.DepartureTime!=null?new Date(e.attributes.DepartureTime):null,departTimeOffset:e.attributes.DepartureUTCOffset??null,geometry:e.geometry,lateDuration:e.attributes.LateMinutes??null,locationType:e.attributes.LocationType!=null?E.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:e.attributes.ObjectID??e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:e.attributes.Sequence??null,serviceCosts:e.attributes.ServiceCosts!=null?F(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:e.attributes.ServiceMeters??null,serviceDuration:e.attributes.ServiceMinutes??null,status:e.attributes.Status!=null?N.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:e.attributes.TimeWindowEnd!=null?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:e.attributes.TimeWindowEndUTCOffset??null,timeWindowStart:e.attributes.TimeWindowStart!=null?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:e.attributes.TimeWindowStartUTCOffset??null,waitDuration:e.attributes.WaitMinutes??null})}toGraphic(){const e={ObjectID:this.objectId,ArrivalCurbApproach:this.arriveCurbApproach!=null?m.toJSON(this.arriveCurbApproach):null,ArrivalTime:this.arriveTime!=null?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:this.cumulativeCosts!=null?JSON.stringify(U(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:this.curbApproach!=null?m.toJSON(this.curbApproach):null,DepartureCurbApproach:this.departCurbApproach!=null?m.toJSON(this.departCurbApproach):null,DepartureTime:this.departTime!=null?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:this.locationType!=null?E.toJSON(this.locationType):null,Name:this.name,RouteName:this.routeName,Sequence:this.sequence,ServiceCosts:this.serviceCosts!=null?JSON.stringify(U(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:this.status!=null?N.toJSON(this.status):null,TimeWindowEnd:this.timeWindowEnd!=null?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:this.timeWindowEndOffset??this.arriveTimeOffset,TimeWindowStart:this.timeWindowStart!=null?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:this.timeWindowStartOffset??this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new w({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};s.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID"},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger"},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate"},{name:"ArrivalUTCOffset",alias:"Arrival Time",type:"esriFieldTypeInteger"},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString"},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble"},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble"},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger"},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate"},{name:"DepartureUTCOffset",alias:"Departure Time",type:"esriFieldTypeInteger"},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble"},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger"},{name:"Name",alias:"Name",type:"esriFieldTypeString"},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString"},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger"},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString"},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble"},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble"},{name:"Status",alias:"Status",type:"esriFieldTypeInteger"},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate"},{name:"TimeWindowEndUTCOffset",alias:"Time Window End Offset",type:"esriFieldTypeInteger"},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate"},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start Offset",type:"esriFieldTypeInteger"},{name:"WaitMinutes",alias:"Minutes Wait",type:"esriFieldTypeDouble"}],t([i({type:m.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:m.read}}})],s.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],s.prototype,"arriveTime",void 0),t([i()],s.prototype,"arriveTimeOffset",void 0),t([p("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],s.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],s.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],s.prototype,"bearingTol",void 0),t([i()],s.prototype,"cumulativeCosts",void 0),t([p("cumulativeCosts",["attributes"])],s.prototype,"readCumulativeCosts",null),t([i()],s.prototype,"cumulativeDistance",void 0),t([i()],s.prototype,"cumulativeDuration",void 0),t([i({type:m.apiValues,json:{name:"attributes.CurbApproach",read:{reader:m.read},write:{writer:m.write}}})],s.prototype,"curbApproach",void 0),t([i({type:m.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:m.read}}})],s.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],s.prototype,"departTime",void 0),t([i()],s.prototype,"departTimeOffset",void 0),t([p("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],s.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],s.prototype,"distanceToNetworkInMeters",void 0),t([i({type:z,json:{write:!0}})],s.prototype,"geometry",void 0),t([i()],s.prototype,"lateDuration",void 0),t([i({type:E.apiValues,json:{name:"attributes.LocationType",read:{reader:E.read},write:{writer:E.write}}})],s.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],s.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],s.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],s.prototype,"objectId",void 0),t([i({type:C})],s.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],s.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],s.prototype,"routeName",void 0),t([i()],s.prototype,"serviceCosts",void 0),t([p("serviceCosts",["attributes"])],s.prototype,"readServiceCosts",null),t([A("serviceCosts")],s.prototype,"writeServiceCosts",null),t([i()],s.prototype,"serviceDistance",void 0),t([i()],s.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],s.prototype,"sequence",void 0),t([i({type:k.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:k.read}}})],s.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],s.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],s.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],s.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],s.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],s.prototype,"sourceOid",void 0),t([i({type:N.apiValues,json:{read:{source:"attributes.Status",reader:N.read}}})],s.prototype,"status",void 0),t([i({types:I})],s.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],s.prototype,"timeWindowEnd",void 0),t([A("timeWindowEnd")],s.prototype,"writeTimeWindowEnd",null),t([i()],s.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],s.prototype,"timeWindowStart",void 0),t([A("timeWindowStart")],s.prototype,"writeTimeWindowStart",null),t([i()],s.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],s.prototype,"type",void 0),t([i()],s.prototype,"violations",void 0),t([p("violations",["attributes"])],s.prototype,"readViolations",null),t([i()],s.prototype,"waitDuration",void 0),t([i()],s.prototype,"wait",void 0),t([p("wait",["attributes"])],s.prototype,"readWait",null),s=G=t([S("esri.rest.support.Stop")],s);const De=s;export{ee as $,O as A,De as N,re as Q,ge as S,be as T,Y as V,B as W,Q as Z,le as a,he as b,ye as c,me as d,se as e,Se as f,Ne as g,ve as h,ce as m,pe as n,ue as o,ne as s,ae as t,de as u,fe as v,Te as y}; diff --git a/custom-toc-highlight/assets/StreamLayer-Bqnt-d3H-Dsh94g7_.js b/custom-toc-highlight/assets/StreamLayer-Bqnt-d3H-Cf1JxEuo.js similarity index 68% rename from custom-toc-highlight/assets/StreamLayer-Bqnt-d3H-Dsh94g7_.js rename to custom-toc-highlight/assets/StreamLayer-Bqnt-d3H-Cf1JxEuo.js index 919ca657..d0c23844 100644 --- a/custom-toc-highlight/assets/StreamLayer-Bqnt-d3H-Dsh94g7_.js +++ b/custom-toc-highlight/assets/StreamLayer-Bqnt-d3H-Cf1JxEuo.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./streamLayerUtils-CLc_16nt-D4AKQJ_S.js","./utils-BVWK2jiA-Btpo3M9u.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./jsonContext-BA8GHqVk-CWQlLGSw.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./saveUtils-CIYk-dsQ-VGcOewby.js","./createConnection-CrkuTLXs-DgS-Wx7n.js","./query-DFW9-NG_-gbjlxRZk.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-9sQxfkoa-KicvrT8N.js","./utils-Bq23Xwmj--_SaacS5.js","./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js","./pbf-D-y3_eZO-DQKnyfOm.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-B5UMbu5B.js","./Query-BrwMGK8U-DoFNfkjX.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js"])))=>i.map(i=>d[i]); -import{_ as f}from"./main-ugzBrWNm.js";import{v as t,S as r,i as I,aa as F,J as x,bp as P,o as l,W as D,bT as v,a1 as O,bW as h,bo as A,f as k,dL as $,n as C,bB as g,bL as L,a0 as w,P as U,e as N}from"./story-BfX8CRfG.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{o as V,m as G,u as J}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as M}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{a as W}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{u as z}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as Y}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{l as H}from"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import{v as Q}from"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import{E as B}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as K}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as X}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as Z}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{x as ee}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{Y as te,_ as ie,n as re,t as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{p as pe}from"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import{y as le}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{f as de}from"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import{C as me,q as ce}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{g as ue}from"./styleUtils-ChrJTYIw-BfDrXrWd.js";import{b as he}from"./Query-BrwMGK8U-DoFNfkjX.js";import{w as ye}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import{q as fe}from"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import{E as m}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";var y;let a=y=class extends N{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new y({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};t([r({type:Number,json:{write:!0}})],a.prototype,"age",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"ageReceived",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"displayCount",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"maxObservations",void 0),a=y=t([I("esri.layers.support.PurgeOptions")],a);const R=a,b=de();function S(e,o){return new l("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${o}`,{layer:e})}let i=class extends Q(H(z(ee(Z(X(W(B(K(q(Y(F(M)))))))))))){constructor(...e){super(...e),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.outFields=["*"],this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new R,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=x.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null,this._debouncedSaveOperations=P(async(o,s,n)=>{const{save:p,saveAs:c}=await f(()=>import("./streamLayerUtils-CLc_16nt-D4AKQJ_S.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(o){case m.SAVE:return p(this,s);case m.SAVE_AS:return c(this,n,s)}})}normalizeCtorArgs(e,o){return typeof e=="string"?{url:e,...o}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new l("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 o=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(D).then(()=>this._fetchService(o))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const o=this._normalizeFeatureReduction(e);this._set("featureReduction",o)}set renderer(e){v(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,o,s){o=o.layerDefinition||o;const n=o.drawingInfo?.renderer;if(n){const p=V(n,o,s)||void 0;return p||O.getLogger(this).error("Failed to create renderer",{rendererDefinition:o.drawingInfo.renderer,layer:this,context:s}),p}return pe(o,s)}async connect(e){const[{createConnection:o}]=await Promise.all([f(()=>import("./createConnection-CrkuTLXs-DgS-Wx7n.js"),__vite__mapDeps([14,3,4,2,5,11,12,15,16,17,18,19,20,21,22,23,24,25,26,27,28]),import.meta.url),this.load()]),s=this.geometryType?h.toJSON(this.geometryType):null,{customParameters:n=null,definitionExpression:p=null,geometryDefinition:c=null,maxReconnectionAttempts:j=0,maxReconnectionInterval:T=20,spatialReference:_=this.spatialReference}=e||this.createConnectionParameters(),d=o(this.parsedUrl,this.spatialReference,_,s,p,c,j,T,n??void 0),E=A([this.on("send-message-to-socket",u=>d.sendMessageToSocket(u)),this.on("send-message-to-client",u=>d.sendMessageToClient(u))]);return d.once("destroy",E.remove),d}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return ye(this,e)}createQuery(){const e=new he;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,o){if(!this.fields)return null;let s=null;return this.fields.some(n=>(n.name===e&&(s=n.domain),!!s)),s}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}async save(e){return this._debouncedSaveOperations(m.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(m.SAVE_AS,o,e)}write(e,o){const s=o?.messages;return this.webSocketUrl?(s?.push(S(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,o):(s?.push(S(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){if(!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:o}=await k(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=o}}else{if(!this.timeInfo?.trackIdField)throw new l("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const o=this.fields.find(s=>s.type==="oid")?.name;if(!o)throw new l("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=o}if(!this.fields)throw new l("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some(o=>o.name===this.objectIdField)||this.fields.push(new le({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new l("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}),v(this.renderer,this.fieldsIndex),$(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),ue(this,{origin:"service"})}};t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r({type:fe})],i.prototype,"elevationInfo",void 0),t([r({json:{origins:{"web-map":{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],i.prototype,"featureReduction",null),t([r(b.fields)],i.prototype,"fields",void 0),t([r(b.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:C,json:{name:"layerDefinition.definitionGeometry",write:!0}})],i.prototype,"geometryDefinition",void 0),t([r({type:h.apiValues,json:{read:{reader:h.read}}})],i.prototype,"geometryType",void 0),t([r(te)],i.prototype,"labelsVisible",void 0),t([r({type:[me],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ce},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(ie)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],i.prototype,"listMode",void 0),t([r({type:g})],i.prototype,"maxReconnectionAttempts",void 0),t([r({type:g})],i.prototype,"maxReconnectionInterval",void 0),t([r(re)],i.prototype,"maxScale",void 0),t([r(oe)],i.prototype,"minScale",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],i.prototype,"operationalLayerType",void 0),t([r({readOnly:!0})],i.prototype,"outFields",void 0),t([r(se)],i.prototype,"popupEnabled",void 0),t([r({type:L,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({type:R})],i.prototype,"purgeOptions",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"refreshInterval",void 0),t([r({types:G,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:J,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],i.prototype,"renderer",null),t([w("service","renderer",["drawingInfo.renderer","defaultSymbol"]),w("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],i.prototype,"readRenderer",null),t([r((()=>{const e=U(ne);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r()],i.prototype,"sourceJSON",void 0),t([r({type:x,json:{origins:{service:{read:{source:"spatialReference"}}}}})],i.prototype,"spatialReference",void 0),t([r({json:{read:!1}})],i.prototype,"type",void 0),t([r(ae)],i.prototype,"url",void 0),t([r({type:Number})],i.prototype,"updateInterval",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"useViewTime",void 0),t([r({type:String})],i.prototype,"webSocketUrl",void 0),i=t([I("esri.layers.StreamLayer")],i);const Ft=i;export{Ft as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./streamLayerUtils-CLc_16nt-qAXYcZQO.js","./utils-BVWK2jiA-i-Dn2Ad8.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CfFOGshS.js","./jsonContext-BA8GHqVk-BsXRY5es.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./saveUtils-CIYk-dsQ-Br9QCJTX.js","./createConnection-CrkuTLXs-CK5s-xN-.js","./query-DFW9-NG_-C3TyGmiM.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js","./pbf-D-y3_eZO-CpHdkhuD.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-B7zp5L1G.js","./Query-BrwMGK8U-BPr0_G9t.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js"])))=>i.map(i=>d[i]); +import{_ as f}from"./main-QGPoLsvl.js";import{v as t,S as r,i as I,aa as F,J as x,bp as P,o as l,W as D,bT as v,a1 as O,bW as h,bo as A,f as k,dL as $,n as C,bB as g,bL as L,a0 as w,P as U,e as N}from"./story-Doly9N9p.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{o as V,m as G,u as J}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{m as q}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as M}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{a as W}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{u as z}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as Y}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{l as H}from"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import{v as Q}from"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import{E as B}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as K}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as X}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as Z}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{x as ee}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{Y as te,_ as ie,n as re,t as oe,X as se,V as ne,Z as ae}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{p as pe}from"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import{y as le}from"./Field-C6hA1tZj-CkWoRbmp.js";import{f as de}from"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import{C as me,q as ce}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{g as ue}from"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import{b as he}from"./Query-BrwMGK8U-BPr0_G9t.js";import{w as ye}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import{q as fe}from"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import{E as m}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";var y;let a=y=class extends N{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new y({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};t([r({type:Number,json:{write:!0}})],a.prototype,"age",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"ageReceived",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"displayCount",void 0),t([r({type:Number,json:{write:!0}})],a.prototype,"maxObservations",void 0),a=y=t([I("esri.layers.support.PurgeOptions")],a);const R=a,b=de();function S(e,o){return new l("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${o}`,{layer:e})}let i=class extends Q(H(z(ee(Z(X(W(B(K(q(Y(F(M)))))))))))){constructor(...e){super(...e),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.outFields=["*"],this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new R,this.refreshInterval=0,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=x.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.useViewTime=!0,this.webSocketUrl=null,this._debouncedSaveOperations=P(async(o,s,n)=>{const{save:p,saveAs:c}=await f(()=>import("./streamLayerUtils-CLc_16nt-qAXYcZQO.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]),import.meta.url);switch(o){case m.SAVE:return p(this,s);case m.SAVE_AS:return c(this,n,s)}})}normalizeCtorArgs(e,o){return typeof e=="string"?{url:e,...o}:e}load(e){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new l("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 o=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},e).catch(D).then(()=>this._fetchService(o))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const o=this._normalizeFeatureReduction(e);this._set("featureReduction",o)}set renderer(e){v(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,o,s){o=o.layerDefinition||o;const n=o.drawingInfo?.renderer;if(n){const p=V(n,o,s)||void 0;return p||O.getLogger(this).error("Failed to create renderer",{rendererDefinition:o.drawingInfo.renderer,layer:this,context:s}),p}return pe(o,s)}async connect(e){const[{createConnection:o}]=await Promise.all([f(()=>import("./createConnection-CrkuTLXs-CK5s-xN-.js"),__vite__mapDeps([14,3,4,2,5,11,12,15,16,17,18,19,20,21,22,23,24,25,26,27,28]),import.meta.url),this.load()]),s=this.geometryType?h.toJSON(this.geometryType):null,{customParameters:n=null,definitionExpression:p=null,geometryDefinition:c=null,maxReconnectionAttempts:j=0,maxReconnectionInterval:T=20,spatialReference:_=this.spatialReference}=e||this.createConnectionParameters(),d=o(this.parsedUrl,this.spatialReference,_,s,p,c,j,T,n??void 0),E=A([this.on("send-message-to-socket",u=>d.sendMessageToSocket(u)),this.on("send-message-to-client",u=>d.sendMessageToClient(u))]);return d.once("destroy",E.remove),d}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(e){return ye(this,e)}createQuery(){const e=new he;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}getFieldDomain(e,o){if(!this.fields)return null;let s=null;return this.fields.some(n=>(n.name===e&&(s=n.domain),!!s)),s}getField(e){return this.fieldsIndex.get(e)}serviceSupportsSpatialReference(e){return!0}sendMessageToSocket(e){this.emit("send-message-to-socket",e)}sendMessageToClient(e){this.emit("send-message-to-client",e)}async save(e){return this._debouncedSaveOperations(m.SAVE,e)}async saveAs(e,o){return this._debouncedSaveOperations(m.SAVE_AS,o,e)}write(e,o){const s=o?.messages;return this.webSocketUrl?(s?.push(S(this,"using a custom websocket connection cannot be written to web scenes and web maps")),null):this.parsedUrl?super.write(e,o):(s?.push(S(this,"using a client-side only connection without a url cannot be written to web scenes and web maps")),null)}async _fetchService(e){if(!this.webSocketUrl&&this.parsedUrl){if(!this.sourceJSON){const{data:o}=await k(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:e});this.sourceJSON=o}}else{if(!this.timeInfo?.trackIdField)throw new l("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField){const o=this.fields.find(s=>s.type==="oid")?.name;if(!o)throw new l("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");this.objectIdField=o}if(!this.fields)throw new l("stream-layer:missing-metadata","The stream layer fields must be specified.");if(this.fields.some(o=>o.name===this.objectIdField)||this.fields.push(new le({name:this.objectIdField,alias:this.objectIdField,type:"oid"})),!this.geometryType)throw new l("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.webSocketUrl&&(this.url=this.webSocketUrl)}return this.read(this.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl}),v(this.renderer,this.fieldsIndex),$(this.timeInfo,this.fieldsIndex),this.objectIdField||(this.objectIdField="__esri_stream_id__"),ue(this,{origin:"service"})}};t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r({type:fe})],i.prototype,"elevationInfo",void 0),t([r({json:{origins:{"web-map":{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],i.prototype,"featureReduction",null),t([r(b.fields)],i.prototype,"fields",void 0),t([r(b.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:C,json:{name:"layerDefinition.definitionGeometry",write:!0}})],i.prototype,"geometryDefinition",void 0),t([r({type:h.apiValues,json:{read:{reader:h.read}}})],i.prototype,"geometryType",void 0),t([r(te)],i.prototype,"labelsVisible",void 0),t([r({type:[me],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ce},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(ie)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],i.prototype,"listMode",void 0),t([r({type:g})],i.prototype,"maxReconnectionAttempts",void 0),t([r({type:g})],i.prototype,"maxReconnectionInterval",void 0),t([r(re)],i.prototype,"maxScale",void 0),t([r(oe)],i.prototype,"minScale",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],i.prototype,"operationalLayerType",void 0),t([r({readOnly:!0})],i.prototype,"outFields",void 0),t([r(se)],i.prototype,"popupEnabled",void 0),t([r({type:L,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({type:R})],i.prototype,"purgeOptions",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"refreshInterval",void 0),t([r({types:G,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:J,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],i.prototype,"renderer",null),t([w("service","renderer",["drawingInfo.renderer","defaultSymbol"]),w("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],i.prototype,"readRenderer",null),t([r((()=>{const e=U(ne);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r()],i.prototype,"sourceJSON",void 0),t([r({type:x,json:{origins:{service:{read:{source:"spatialReference"}}}}})],i.prototype,"spatialReference",void 0),t([r({json:{read:!1}})],i.prototype,"type",void 0),t([r(ae)],i.prototype,"url",void 0),t([r({type:Number})],i.prototype,"updateInterval",void 0),t([r({json:{read:!1,write:!1}})],i.prototype,"useViewTime",void 0),t([r({type:String})],i.prototype,"webSocketUrl",void 0),i=t([I("esri.layers.StreamLayer")],i);const Ft=i;export{Ft as default}; diff --git a/custom-toc-highlight/assets/StreamLayerView2D-Bh_aEalU-D-95GXg2.js b/custom-toc-highlight/assets/StreamLayerView2D-Bh_aEalU-wWSqPGq-.js similarity index 54% rename from custom-toc-highlight/assets/StreamLayerView2D-Bh_aEalU-D-95GXg2.js rename to custom-toc-highlight/assets/StreamLayerView2D-Bh_aEalU-wWSqPGq-.js index d40d2b2c..2332da5e 100644 --- a/custom-toc-highlight/assets/StreamLayerView2D-Bh_aEalU-D-95GXg2.js +++ b/custom-toc-highlight/assets/StreamLayerView2D-Bh_aEalU-wWSqPGq-.js @@ -1 +1 @@ -import{ah as m,o as h,bo as l,a2 as d,v as i,S as n,i as u}from"./story-BfX8CRfG.js";import{O as c}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{n as y,r as _}from"./FeatureLayerView2D-NmRd_IhT-CufQiRFK.js";import g from"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./main-ugzBrWNm.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./timeSupport-ohWmWReZ-ByDHlqgT.js";import"./LayerView-Bish-E63-rB2WUWF4.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./SDFHelper-B6k8Ig6R-BNeqNf2Z.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-DAL58cHP.js";import"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";const f=t=>{let e=class extends t{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...r){super(...r),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&this._streamConnectionStatus==="connected"?"paused":this._streamConnectionStatus}_onSuspendedChange(r){r?this._doPause():this._isUserPaused||this._doResume()}};return i([n()],e.prototype,"_isUserPaused",void 0),i([n({readOnly:!0})],e.prototype,"connectionStatus",null),i([n({type:g})],e.prototype,"filter",void 0),e=i([u("esri.views.layers.StreamLayerView")],e),e};let s=class extends f(_){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([m(()=>this.layer.customParameters,async t=>{(await this.getWorker()).streamMessenger.updateCustomParameters(t)}),this.layer.on("send-message-to-socket",async t=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(t)}),this.layer.on("send-message-to-client",async t=>{(await this.getWorker()).streamMessenger.sendMessageToClient(t),this._isUserPaused&&"type"in t&&t.type==="clear"&&this.incrementSourceRefreshVersion()}),m(()=>this.layer.purgeOptions,()=>this._update()),m(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new h("stream-controller",this.pipelineErrorString):null}on(t,e){if(Array.isArray(t))return l(t.map(o=>this.on(o,e)));const r=["data-received","message-received"].includes(t);r&&this.getWorker().then(o=>o.streamMessenger.enableEvent(t,!0));const a=super.on(t,e),p=this;return d(()=>{a.remove(),r&&(p._workerProxy.closed||p.hasEventListener(t)||p.getWorker().then(o=>o.streamMessenger.enableEvent(t,!1)))})}async queryLatestObservations(t,e){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new h("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");const r=await this.getWorker();return y(r.features.executeQueryForLatestObservations(this._cleanUpQuery(t),e).then(a=>{const p=c.fromJSON(a);return p.features.forEach(o=>{o.layer=this.layer,o.sourceLayer=this.layer}),p}),new c({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){this._refreshInterval!=null&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval)}_doDisconnect(){this.getWorker().then(t=>t.streamMessenger.disconnect()),this._doPause()}_doConnect(){this.getWorker().then(t=>t.streamMessenger.connect()),this.resume()}_doClear(){this.getWorker().then(t=>t.streamMessenger.clear()),this._refreshInterval==null&&this.incrementSourceRefreshVersion()}_createClientOptions(){const t=super._createClientOptions(),e=this;return{...t,get container(){return e.featureContainer},setProperty:r=>{this.set(r.propertyName,r.value)}}}};i([n()],s.prototype,"pipelineConnectionStatus",void 0),i([n()],s.prototype,"pipelineErrorString",void 0),i([n({readOnly:!0})],s.prototype,"connectionError",null),i([n({readOnly:!0})],s.prototype,"_streamConnectionStatus",null),s=i([u("esri.views.2d.layers.StreamLayerView2D")],s);const fe=s;export{fe as default}; +import{ah as m,o as h,bo as l,a2 as d,v as i,S as n,i as u}from"./story-Doly9N9p.js";import{O as c}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{n as y,r as _}from"./FeatureLayerView2D-NmRd_IhT-DLbw0NYz.js";import g from"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./main-QGPoLsvl.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./timeSupport-ohWmWReZ-D2lpSlXU.js";import"./LayerView-Bish-E63-DK1SFHE3.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./SDFHelper-B6k8Ig6R-CgiA_-9V.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-BYG2KoFf.js";import"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";const f=t=>{let e=class extends t{resume(){this._isUserPaused=!1,this.suspended||this._doResume()}pause(){this._isUserPaused=!0,this.suspended||this._doPause()}disconnect(){this._doDisconnect()}connect(){this._doConnect()}clear(){this._doClear()}constructor(...r){super(...r),this._isUserPaused=!1,this.filter=null}get connectionStatus(){return(this._isUserPaused||this.suspended)&&this._streamConnectionStatus==="connected"?"paused":this._streamConnectionStatus}_onSuspendedChange(r){r?this._doPause():this._isUserPaused||this._doResume()}};return i([n()],e.prototype,"_isUserPaused",void 0),i([n({readOnly:!0})],e.prototype,"connectionStatus",null),i([n({type:g})],e.prototype,"filter",void 0),e=i([u("esri.views.layers.StreamLayerView")],e),e};let s=class extends f(_){constructor(){super(...arguments),this.pipelineConnectionStatus="disconnected",this.pipelineErrorString=null}initialize(){this.addHandles([m(()=>this.layer.customParameters,async t=>{(await this.getWorker()).streamMessenger.updateCustomParameters(t)}),this.layer.on("send-message-to-socket",async t=>{(await this.getWorker()).streamMessenger.sendMessageToSocket(t)}),this.layer.on("send-message-to-client",async t=>{(await this.getWorker()).streamMessenger.sendMessageToClient(t),this._isUserPaused&&"type"in t&&t.type==="clear"&&this.incrementSourceRefreshVersion()}),m(()=>this.layer.purgeOptions,()=>this._update()),m(()=>this.suspended,this._onSuspendedChange.bind(this))],"constructor"),this._doResume()}destroy(){this._doPause()}get connectionError(){return this.pipelineErrorString?new h("stream-controller",this.pipelineErrorString):null}on(t,e){if(Array.isArray(t))return l(t.map(o=>this.on(o,e)));const r=["data-received","message-received"].includes(t);r&&this.getWorker().then(o=>o.streamMessenger.enableEvent(t,!0));const a=super.on(t,e),p=this;return d(()=>{a.remove(),r&&(p._workerProxy.closed||p.hasEventListener(t)||p.getWorker().then(o=>o.streamMessenger.enableEvent(t,!1)))})}async queryLatestObservations(t,e){if(!(this.layer.timeInfo?.endField||this.layer.timeInfo?.startField||this.layer.timeInfo?.trackIdField))throw new h("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");const r=await this.getWorker();return y(r.features.executeQueryForLatestObservations(this._cleanUpQuery(t),e).then(a=>{const p=c.fromJSON(a);return p.features.forEach(o=>{o.layer=this.layer,o.sourceLayer=this.layer}),p}),new c({features:[]}))}detach(){super.detach(),this.pipelineConnectionStatus="disconnected"}get _streamConnectionStatus(){return this.pipelineConnectionStatus}_doPause(){this._refreshInterval!=null&&(clearInterval(this._refreshInterval),this._refreshInterval=null)}_doResume(){this._refreshInterval=setInterval(()=>this.incrementSourceRefreshVersion(),this.layer.updateInterval)}_doDisconnect(){this.getWorker().then(t=>t.streamMessenger.disconnect()),this._doPause()}_doConnect(){this.getWorker().then(t=>t.streamMessenger.connect()),this.resume()}_doClear(){this.getWorker().then(t=>t.streamMessenger.clear()),this._refreshInterval==null&&this.incrementSourceRefreshVersion()}_createClientOptions(){const t=super._createClientOptions(),e=this;return{...t,get container(){return e.featureContainer},setProperty:r=>{this.set(r.propertyName,r.value)}}}};i([n()],s.prototype,"pipelineConnectionStatus",void 0),i([n()],s.prototype,"pipelineErrorString",void 0),i([n({readOnly:!0})],s.prototype,"connectionError",null),i([n({readOnly:!0})],s.prototype,"_streamConnectionStatus",null),s=i([u("esri.views.2d.layers.StreamLayerView2D")],s);const fe=s;export{fe as default}; diff --git a/custom-toc-highlight/assets/StyleRepository-D3WuVprR-SmpmvCua.js b/custom-toc-highlight/assets/StyleRepository-D3WuVprR-B1BVbhGB.js similarity index 99% rename from custom-toc-highlight/assets/StyleRepository-D3WuVprR-SmpmvCua.js rename to custom-toc-highlight/assets/StyleRepository-D3WuVprR-B1BVbhGB.js index 68a0b9d9..7fc36f28 100644 --- a/custom-toc-highlight/assets/StyleRepository-D3WuVprR-SmpmvCua.js +++ b/custom-toc-highlight/assets/StyleRepository-D3WuVprR-B1BVbhGB.js @@ -1,4 +1,4 @@ -import{p as T,t as F,n as Z}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{cf as me,ar as b}from"./story-BfX8CRfG.js";import{N as W}from"./enums-qHpGJ28Q-CmnLAccm.js";import{Z as xt,G as we,K as re,X as Ee,F as N,d as vt}from"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import{I as g}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{n as v}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{U as Kt,l as qt,T as Wt}from"./colorUtils-Cthpxcks-ZRnr1H1b.js";import{u as Te}from"./unitBezier-CGtWxaCq-BRwEDigF.js";import{d as be}from"./definitions-DJSdSb77-DkoRHaVx.js";let Ie=class{constructor(n){this._array=[],this._stride=n}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(n,t){return 65535&n|t<<16}static i8888to32(n,t,e,r){return 255&n|(255&t)<<8|(255&e)<<16|r<<24}static i8816to32(n,t,e){return 255&n|(255&t)<<8|e<<16}};var c,K;(function(n){n[n.R8_SIGNED=0]="R8_SIGNED",n[n.R8_UNSIGNED=1]="R8_UNSIGNED",n[n.R16_SIGNED=2]="R16_SIGNED",n[n.R16_UNSIGNED=3]="R16_UNSIGNED",n[n.R8G8_SIGNED=4]="R8G8_SIGNED",n[n.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",n[n.R16G16_SIGNED=6]="R16G16_SIGNED",n[n.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",n[n.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",n[n.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",n[n.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",n[n.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",n[n.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(c||(c={})),function(n){n[n.UNIFORM=0]="UNIFORM",n[n.DATA_DRIVEN=1]="DATA_DRIVEN",n[n.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",n[n.UNUSED=3]="UNUSED"}(K||(K={}));let j=class Dt{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._layout||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return this._locations.size===0&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layout||this._buildAttributesInfo(),this._layout}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,i,a){const o=this.getUniforms();for(const s of o){const{name:l,type:u,getValue:h}=s,p=h(r,e,i,a);if(p!==null)switch(u){case"float":t.setUniform1f(l,p);break;case"vec2":t.setUniform2fv(l,p);break;case"vec4":t.setUniform4fv(l,p)}}}encodeAttributes(t,e,r,i){const a=this.attributesInfo(),o=this.getEncodingInfos(),s=[];let l=0,u=0;for(const h of Object.keys(o)){const p=o[h],{type:f,precisionFactor:d,isLayout:L}=a[h],M=L?r.getLayoutProperty(h):r.getPaintProperty(h),z=M.interpolator?.getInterpolationRange(e);let $=0;for(const I of p){const{offset:_,bufferElementsToAdd:U}=I;if(U>0){for(let H=0;H4)i++,R={dataIndex:i,count:0,offset:0},_!==4&&(r[H]=R),t.push({location:-1,name:"a_data_"+i,count:_,type:$,normalized:U}),O=Math.ceil(Math.max(E/4,1));else{const B=t[R.dataIndex];B.count+=_,O=Math.ceil(Math.max(B.count*I/4,1))-Math.ceil(Math.max(R.offset/4,1))}L.push({dataIndex:R.dataIndex,offset:R.offset,bufferElementsToAdd:O}),R.offset+=E,R.count+=_}}for(const p of t)switch(p.type){case g.BYTE:case g.UNSIGNED_BYTE:p.count=4;break;case g.SHORT:case g.UNSIGNED_SHORT:p.count+=p.count%2}this._buildVertexBufferLayout(t);let l=0;const u=this._layout.get("geometry");for(const p of u)this._locations.set(p.name,l++);const h=this._layout.get("opacity");if(h)for(const p of h)this._locations.set(p.name,l++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e=new Map,r=this.geometryInfo();let i=r[0].stride;if(t.length===0)e.set("geometry",r);else{const o=[];let s=i;for(const l of t)i+=Xt(l.type)*l.count;for(const l of r)o.push(new v(l.name,l.count,l.type,l.offset,i,l.normalized));for(const l of t)o.push(new v(l.name,l.count,l.type,s,i,l.normalized)),s+=Xt(l.type)*l.count;e.set("geometry",o)}const a=this.opacityInfo();a&&e.set("opacity",a),this._layout=e,this._stride=i}_buildShaderInfo(t,e){let r=` +import{p as T,t as F,n as Z}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{cf as me,ar as b}from"./story-Doly9N9p.js";import{N as W}from"./enums-qHpGJ28Q-CmnLAccm.js";import{Z as xt,G as we,K as re,X as Ee,F as N,d as vt}from"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import{I as g}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{n as v}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{U as Kt,l as qt,T as Wt}from"./colorUtils-Cthpxcks-cHaMZbaf.js";import{u as Te}from"./unitBezier-CGtWxaCq-BRwEDigF.js";import{d as be}from"./definitions-DJSdSb77-DkoRHaVx.js";let Ie=class{constructor(n){this._array=[],this._stride=n}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(n,t){return 65535&n|t<<16}static i8888to32(n,t,e,r){return 255&n|(255&t)<<8|(255&e)<<16|r<<24}static i8816to32(n,t,e){return 255&n|(255&t)<<8|e<<16}};var c,K;(function(n){n[n.R8_SIGNED=0]="R8_SIGNED",n[n.R8_UNSIGNED=1]="R8_UNSIGNED",n[n.R16_SIGNED=2]="R16_SIGNED",n[n.R16_UNSIGNED=3]="R16_UNSIGNED",n[n.R8G8_SIGNED=4]="R8G8_SIGNED",n[n.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",n[n.R16G16_SIGNED=6]="R16G16_SIGNED",n[n.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",n[n.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",n[n.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",n[n.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",n[n.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",n[n.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(c||(c={})),function(n){n[n.UNIFORM=0]="UNIFORM",n[n.DATA_DRIVEN=1]="DATA_DRIVEN",n[n.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",n[n.UNUSED=3]="UNUSED"}(K||(K={}));let j=class Dt{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._layout||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return this._locations.size===0&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layout||this._buildAttributesInfo(),this._layout}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,i,a){const o=this.getUniforms();for(const s of o){const{name:l,type:u,getValue:h}=s,p=h(r,e,i,a);if(p!==null)switch(u){case"float":t.setUniform1f(l,p);break;case"vec2":t.setUniform2fv(l,p);break;case"vec4":t.setUniform4fv(l,p)}}}encodeAttributes(t,e,r,i){const a=this.attributesInfo(),o=this.getEncodingInfos(),s=[];let l=0,u=0;for(const h of Object.keys(o)){const p=o[h],{type:f,precisionFactor:d,isLayout:L}=a[h],M=L?r.getLayoutProperty(h):r.getPaintProperty(h),z=M.interpolator?.getInterpolationRange(e);let $=0;for(const I of p){const{offset:_,bufferElementsToAdd:U}=I;if(U>0){for(let H=0;H4)i++,R={dataIndex:i,count:0,offset:0},_!==4&&(r[H]=R),t.push({location:-1,name:"a_data_"+i,count:_,type:$,normalized:U}),O=Math.ceil(Math.max(E/4,1));else{const B=t[R.dataIndex];B.count+=_,O=Math.ceil(Math.max(B.count*I/4,1))-Math.ceil(Math.max(R.offset/4,1))}L.push({dataIndex:R.dataIndex,offset:R.offset,bufferElementsToAdd:O}),R.offset+=E,R.count+=_}}for(const p of t)switch(p.type){case g.BYTE:case g.UNSIGNED_BYTE:p.count=4;break;case g.SHORT:case g.UNSIGNED_SHORT:p.count+=p.count%2}this._buildVertexBufferLayout(t);let l=0;const u=this._layout.get("geometry");for(const p of u)this._locations.set(p.name,l++);const h=this._layout.get("opacity");if(h)for(const p of h)this._locations.set(p.name,l++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e=new Map,r=this.geometryInfo();let i=r[0].stride;if(t.length===0)e.set("geometry",r);else{const o=[];let s=i;for(const l of t)i+=Xt(l.type)*l.count;for(const l of r)o.push(new v(l.name,l.count,l.type,l.offset,i,l.normalized));for(const l of t)o.push(new v(l.name,l.count,l.type,s,i,l.normalized)),s+=Xt(l.type)*l.count;e.set("geometry",o)}const a=this.opacityInfo();a&&e.set("opacity",a),this._layout=e,this._stride=i}_buildShaderInfo(t,e){let r=` `,i=` `;const a=[];for(const u of t)r+=`attribute ${this._getType(u.count)} ${u.name}; `;const o=this.attributes(),s=this.attributesInfo();let l=-1;for(const u of o){l++;const{name:h,type:p,precisionFactor:f,isLayout:d}=s[u],L=f&&f!==1?" * "+1/f:"",{bytesPerElement:M,count:z}=Dt._encodingInfo[p],$=I=>`a_data_${I.dataIndex}${ve(z,I.offset,M)}`;switch(this.getAtributeState(l)){case K.UNIFORM:{const I=this._getType(z),_=`u_${h}`;a.push({name:_,type:I,getValue:(U,E,H,R)=>{const O=d?U.getLayoutValue(u,E):U.getPaintValue(u,E);if(p===c.R16G16B16A16_DASHARRAY){const B=U.getDashKey(O,U.getLayoutValue("line-cap",E)),nt=R.getMosaicItemPosition(B,!1);if(nt==null)return null;const{tl:st,br:jt}=nt;return[st[0],jt[1],jt[0],st[1]]}if(p===c.R16G16B16A16_PATTERN){const B=R.getMosaicItemPosition(O,!u.includes("line-"));if(B==null)return null;const{tl:nt,br:st}=B;return[nt[0],st[1],st[0],nt[1]]}if(p===c.R8G8B8A8_COLOR){const B=O[3];return[B*O[0],B*O[1],B*O[2],B]}return O}}),r+=`uniform ${I} ${_}; diff --git a/custom-toc-highlight/assets/SublayersOwner-DfTaMJ5V-DMBhnxeT.js b/custom-toc-highlight/assets/SublayersOwner-DfTaMJ5V-DrC0bgDm.js similarity index 86% rename from custom-toc-highlight/assets/SublayersOwner-DfTaMJ5V-DMBhnxeT.js rename to custom-toc-highlight/assets/SublayersOwner-DfTaMJ5V-DrC0bgDm.js index b04758e5..9d1ac93e 100644 --- a/custom-toc-highlight/assets/SublayersOwner-DfTaMJ5V-DMBhnxeT.js +++ b/custom-toc-highlight/assets/SublayersOwner-DfTaMJ5V-DrC0bgDm.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FeatureLayer-BrRKw5Si-D6Z5CL70.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-BfX8CRfG.js","./story-D5JOvNzl.css","./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js","./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js","./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js","./colorRamps-q0bZVhs2-DQZn2xZS.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-23qzp7zg.js","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./lengthUtils-DKpMe5qR-C2NPRwwl.js","./styleUtils-BtpNqZyT-D2Hj1Rgz.js","./jsonUtils-C64Zfu7c-CitE8NjK.js","./LRUCache-C3erQTWv-0wD6drRf.js","./Version-CoKzbupV-9-gg6ENz.js","./FieldsIndex-HmzMbJQG-DZuFWLvd.js","./UnknownTimeZone-C--TOcPG-D3CAoWPX.js","./OverrideHelper-DWRbVlj1-BZq72sbX.js","./colorUtils-Cthpxcks-ZRnr1H1b.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-B3hR8LxB.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-B-lEhyoX.js","./heatmapUtils-seiMkkkR-Cj1KmweL.js","./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js","./commonProperties-BtIqvFU_-DVH0kGN9.js","./ElevationInfo-yv2-9tj6-C2hC6Vpl.js","./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./HeightModelInfo-C5vFqzyF-CupKpfDx.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-DoFNfkjX.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./RelationshipQuery-DJsz3K0U-yAwL-qLW.js","./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js","./Relationship-PyhUibYK-BgFx3_5x.js","./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js","./Layer-ChoECxvZ-CQTFmFQa.js","./workers-PiCjreoO-idkDTJa3.js","./editsZScale-BDsX6vv--CttUpViY.js","./queryZScale-BiYV6Pr6-B5UMbu5B.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./FeatureSet-BkVNthuN-CwS44--W.js","./APIKeyMixin-BUMSx9ny-D_H-H5sI.js","./ArcGISService-BYA-y6X6-C_YhndKK.js","./BlendLayer-D1WkSmwP-Bad8_eoW.js","./jsonUtils-wIllKWI4-DrGIvCCq.js","./parser-DyDJ-rlI-C9jRH52J.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-DVqdGrVU.js","./CustomParametersMixin-vdKsTHer-BOFVTNLw.js","./EditBusLayer-Df29OyJh-DkVkxUAl.js","./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js","./FeatureEffect-CDEk9Es7-CEiHf7-6.js","./FeatureFilter-BCFHgLVU-CXZvxasm.js","./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js","./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js","./labelingInfo-DGVNul26-zkvIaBlq.js","./labelUtils-BW14kBqX-BkXd4VJn.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-9OHGXI1g.js","./OrderedLayer-6Qsmrd_l-BG3Yganz.js","./OrderByInfo-GD2XnU8e-NtCi3yT-.js","./PortalLayer-CElnYuSQ-DvpreqYV.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js","./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js","./TemporalLayer-CpOrN_w9-BDEJ3v2O.js","./TimeInfo-w_HB2CsF-CZutzBPZ.js","./FeatureTemplate-SPHPD45f-DFBQobBO.js","./FeatureType-C9hJmS6_-BXWT6QCe.js","./fieldProperties-Bq26w7gt-CFQbsGDX.js","./versionUtils-LZYZz-38-DxOZEoAg.js","./styleUtils-ChrJTYIw-BfDrXrWd.js","./popupUtils-B0uZcXX0-DtBp-byj.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js"])))=>i.map(i=>d[i]); -import{_ as te}from"./main-ugzBrWNm.js";import{bR as re,aB as ie,o as c,f as M,bS as se,K as ae,bT as oe,a7 as le,a1 as E,bG as ne,ag as k,X as pe,bU as D,bP as y,P as T,bV as ye,bW as V,v as a,S as l,a0 as m,n as Y,bB as q,ac as v,bL as ue,aO as U,J as z,ad as de,i as Q,bO as L,$,bX as J,an as ce,ah as K,av as H,bY as he}from"./story-BfX8CRfG.js";import{m as fe}from"./Version-CoKzbupV-9-gg6ENz.js";import{i as W}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{e as be,X as me}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{I as G}from"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import{f as ge}from"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{m as Se,u as Ie}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{m as we}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{C as ve}from"./QueryTask-CwHwH2rS-B8khefoW.js";import{f as Ee}from"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import{y as Le}from"./FeatureType-C9hJmS6_-BXWT6QCe.js";import{y as xe}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{o as Oe}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{Q as Fe,C as Te}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{v as Pe}from"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import{p as _e}from"./Relationship-PyhUibYK-BgFx3_5x.js";import{x as De}from"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import{c as N,b as Ae,K as X}from"./Query-BrwMGK8U-DoFNfkjX.js";import{y as qe}from"./utils-9sQxfkoa-KicvrT8N.js";import{c as Ce}from"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import{w as Re}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import{c as je}from"./sublayerUtils-CyM0QC5B-D9HVKWXR.js";const yt=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(r,i){const s=i.capabilities&&i.capabilities.split(",").map(ee=>ee.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=n!=="tile"&&!!i.supportsDynamicLayers,u=s.includes("query"),h=s.includes("map"),g=!!i.exportTilesAllowed,S=s.includes("tilemap"),w=s.includes("data"),I=n!=="tile"&&(!i.tileInfo||p),x=n!=="tile"&&(!i.tileInfo||p),d=n!=="tile",f=i.cimVersion?fe.parse(i.cimVersion):null,O=f?.greaterEqual(1,4)??!1,F=f?.greaterEqual(2,0)??!1;return{operations:{supportsExportMap:h,supportsExportTiles:g,supportsIdentify:u,supportsQuery:w,supportsTileMap:S},exportMap:h?{supportsArcadeExpressionForLabeling:O,supportsSublayersChanges:d,supportsDynamicLayers:p,supportsSublayerVisibility:I,supportsSublayerDefinitionExpression:x,supportsCIMSymbols:F}:null,exportTiles:g?{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 fetchRelatedService(r){const i=this.portalItem;if(!i||!G(i))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=i.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},r).then(n=>n.find(p=>p.type==="Feature Service")??null,()=>null));const s=await this._relatedFeatureServicePromise;return $(r),s?{itemId:s.id,url:s.url}:null}async fetchSublayerInfo(r,i){const{source:s}=r;if(this?.portalItem&&this.type==="tile"&&s?.type==="map-layer"&&G(this.portalItem)&&r.originIdOf("url")y.SERVICE)try{const u=await this._fetchAllLayersAndTablesFromService(n),h=W(n)?.sublayer??s.mapLayerId;p=u.get(h)}catch{}else{let u=r.id;s?.type==="map-layer"&&(u=s.mapLayerId);try{p=(await this.fetchAllLayersAndTables(i)).get(u)}catch{}}return p}async fetchAllLayersAndTables(r){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,r)}async _fetchAllLayersAndTablesFromService(r,i){await this.load(i),this._allLayersAndTablesMap||=new Map;const s=W(r),n=ce(this._allLayersAndTablesMap,s?.url.path,()=>M(J(s?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(u=>{const h=new Map,{layers:g,tables:S}=u.data,w=[...g??[],...S??[]];for(const I of w)h.set(I.id,I);return{result:h}},u=>({error:u}))),p=await n;if($(i),"result"in p)return p.result;throw p.error}};return a([l({readOnly:!0})],t.prototype,"capabilities",void 0),a([m("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],t.prototype,"readCapabilities",null),a([l({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),a([l({type:Y})],t.prototype,"fullExtent",void 0),a([l(be)],t.prototype,"id",void 0),a([l({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],t.prototype,"legendEnabled",void 0),a([l(me)],t.prototype,"popupEnabled",void 0),a([l({type:z})],t.prototype,"spatialReference",void 0),a([l({readOnly:!0})],t.prototype,"version",void 0),a([m("service","version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],t.prototype,"readVersion",null),t=a([Q("esri.layers.mixins.ArcGISMapService")],t),t};var A;function C(e){return e?.type==="esriSMS"}function R(e,t,r){const i=this.originIdOf(t)>=L(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&r.layer?.type==="map-image"&&(r.writeSublayerStructure||i)}}function j(e,t,r){return{enabled:!!r&&r.layer?.type==="tile"&&(r.origin&&this.originIdOf(t)>=L(r.origin)||this._isOverridden(t))}}function b(e,t,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function P(e,t,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(t)>=L(r.origin))}}let Me=0;const Ve=new Set(["layer","parent","loaded","loadStatus","loadError","loadWarnings"]);let o=A=class extends we(re(ie)){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:t,url:r}=this;if(!t&&!r)throw new c("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=t?await t.fetchSublayerInfo(this,e):(await M(r,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service",layer:t,url:qe(r)}))})()),this}readCapabilities(e,t){t=t.layerDefinition||t;const{operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},data:{supportsAttachment:u},queryRelated:h}=De(t,this.url);return{exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:u},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},queryRelated:h}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}readMaxScaleRange(e,t){return{minScale:(t=t.layerDefinition||t).minScale??0,maxScale:t.maxScale??0}}get fieldsIndex(){return new Oe(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields){for(const r of t.fields)if(r.type==="esriFieldTypeGlobalID")return r.name}}get id(){return this._get("id")??Me++}set id(e){this._get("id")!==e&&(this.layer?.capabilities?.exportMap?.supportsDynamicLayers!==!1?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}readIsTable(e,t){return t.type==="Table"}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,t,r,i){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map(s=>s.write({},i))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers?.forEach(t=>t.layer=e)}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,t){return t.minScale||t.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,t){return(t=t.layerDefinition||t).objectIdField?t.objectIdField:t.fields?.find(r=>r.type==="esriFieldTypeOID")?.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,t){const{layerDefinition:r}=t;return 1-.01*(r?.transparency??r?.drawingInfo?.transparency??0)}writeOpacity(e,t,r,i){t.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,t){this.parent&&this.parent!==this.layer?t.parentLayerId=se(this.parent.id):t.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{capabilities:e,fieldsIndex:t,layer:r,url:i}=this,{spatialReference:s}=r,n="gdbVersion"in r?r.gdbVersion:void 0,p=ae("featurelayer-pbf")&&e?.query.supportsFormatPBF;return new ve({fieldsIndex:t,gdbVersion:n,pbfSupported:p,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,url:i})}set renderer(e){if(oe(e,this.fieldsIndex),e){for(const t of e.getSymbols())if(le(t)){E.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new N({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return ne(k.ofType(A),e)}writeSublayers(e,t,r){this.sublayers?.length&&(t[r]=this.sublayers.map(i=>i.id).toArray().reverse())}readTitle(e,t){return t.layerDefinition?.name??t.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(s=>s.name.toLowerCase()===r);i&&(r=i.name)}return r}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,t?.type==="map-layer")return`${e.path}/${t.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${pe(r)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,t,r,i){t[r]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=D(this),t=new A;return D(t).store=e.clone(Ve),this.commitProperty("url"),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return Re(this,e)}createQuery(){return new Ae({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await te(async()=>{const{default:s}=await import("./FeatureLayer-BrRKw5Si-D6Z5CL70.js");return{default:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]),import.meta.url)).default,{layer:t,url:r}=this;let i;if(r&&this.originIdOf("url")>y.SERVICE)i=new e({url:r});else{if(!t?.parsedUrl)throw new c("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const s=t.parsedUrl;i=new e({url:s.path}),s&&this.source&&(this.source.type==="map-layer"?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return t?.refreshInterval!=null&&(i.refreshInterval=t.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=T(this.floorInfo)),this.originIdOf("labelingInfo")>y.SERVICE&&(i.labelingInfo=T(this.labelingInfo)),this.originIdOf("labelsVisible")>y.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>y.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>y.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>y.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>y.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>y.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>y.DEFAULTS&&(i.popupTemplate=T(this.popupTemplate)),this.originIdOf("renderer")>y.SERVICE&&(i.renderer=T(this.renderer)),this.source?.type==="data-layer"&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>y.DEFAULTS&&(i.title=this.title),t?.type==="map-image"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),t?.type==="tile"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return Ee(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const s=i.domains&&i.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load(),e=Ce.from(e);const r=this.capabilities;if(!r?.data?.supportsAttachment)throw new c("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:n,num:p,size:u,start:h,where:g}=e;if(!r?.operations?.supportsQueryAttachments&&(i?.length>0||n?.length>0||u?.length>0||p||h||g))throw new c("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s?.length||n?.length||g))throw new c("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,t)}async queryFeatureCount(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatureCount:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatureCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatures:not-supported","this layer has no url.");const r=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(r?.features)for(const i of r.features)i.sourceLayer=this;return r}async queryObjectIds(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryObjectIds:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryObjectIds:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeatures(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryRelatedFeatures:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support queries.");if(!this.capabilities.queryRelated.supportsCount)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support query related counts.");if(!this.url)throw new c("queryRelatedFeaturesCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}toExportImageJSON(e){const t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},r=ye(e,this.definitionExpression);r!=null&&(t.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((s,n)=>(s[n]=this.originIdOf(n),s),{});if(Object.keys(i).some(s=>i[s]>y.SERVICE)){const s=t.drawingInfo={};if(i.renderer>y.SERVICE&&(s.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>y.SERVICE&&(s.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>y.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some(p=>!p.labelPlacement)&&E.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let n=this.labelingInfo;this.geometryType!=null&&(n=Fe(this.labelingInfo,V.toJSON(this.geometryType))),s.showLabels=!0,s.labelingInfo=n.filter(p=>p.labelPlacement).map(p=>p.toJSON({origin:"service",layer:this.layer}))}else s.showLabels=!1;i.opacity>y.SERVICE&&(s.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(s.renderer)}return t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,t=>{t.color||t.style!=="esriSMSX"&&t.style!=="esriSMSCross"||(t.outline?.color?t.color=t.outline.color:t.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(e,t){if(e){const r=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const i of r)C(i.symbol)&&t(i.symbol);"symbol"in e&&C(e.symbol)&&t(e.symbol),"defaultSymbol"in e&&C(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){const r=this.layer,i=this._get(e);let s,n;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;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=D(this).getDefaultOrigin();if(p!=="service"){if(s&&this.layer?.capabilities?.exportMap?.[s]===!1)return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(n&&this.capabilities?.exportMap[n]===!1)return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${n}'`)}e!=="source"||this.loadStatus==="not-loaded"?(this._set(e,t),p!=="service"&&i!==t&&r&&r.emit&&r.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null,r.layer=null}),this.removeAllHandles()),e&&(e.forEach(r=>{r.parent=this,r.layer=this.layer}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,r.layer=this.layer}),e.on("after-remove",({item:r})=>{r.parent=null,r.layer=null}),e.on("before-changes",r=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??1)||(E.getLogger(this).error(new c("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(e,t){const{layer:r,declaredClass:i}=this;E.getLogger(i).error(new c("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${r?.id}'`,{reason:t,sublayer:this,layer:r}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}};o.test={isMapImageLayerOverridePolicy:e=>e===b||e===R,isTileImageLayerOverridePolicy:e=>e===j},a([l({readOnly:!0})],o.prototype,"capabilities",void 0),a([m("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],o.prototype,"readCapabilities",null),a([l()],o.prototype,"defaultPopupTemplate",null),a([l({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:R}}})],o.prototype,"definitionExpression",null),a([l({readOnly:!0})],o.prototype,"effectiveScaleRange",null),a([m("service","maxScaleRange",["minScale","maxScale"])],o.prototype,"readMaxScaleRange",null),a([l({type:[xe],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],o.prototype,"fields",void 0),a([l({readOnly:!0})],o.prototype,"fieldsIndex",null),a([l({type:Pe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:R},origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"floorInfo",null),a([l({type:Y,json:{read:{source:"layerDefinition.extent"}}})],o.prototype,"fullExtent",void 0),a([l({type:V.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:V.read}}}}})],o.prototype,"geometryType",void 0),a([l({type:String})],o.prototype,"globalIdField",void 0),a([m("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],o.prototype,"readGlobalIdFieldFromService",null),a([l({type:q,json:{write:{ignoreOrigin:!0}}})],o.prototype,"id",null),a([l({readOnly:!0})],o.prototype,"isTable",void 0),a([m("service","isTable",["type"])],o.prototype,"readIsTable",null),a([l({value:null,type:[Te],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:b}}})],o.prototype,"labelingInfo",null),a([v("labelingInfo")],o.prototype,"writeLabelingInfo",null),a([l({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:b}}})],o.prototype,"labelsVisible",null),a([l({value:null})],o.prototype,"layer",null),a([l({type:String,json:{write:{overridePolicy:j}}})],o.prototype,"layerItemId",void 0),a([l({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:P}}})],o.prototype,"legendEnabled",void 0),a([l({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],o.prototype,"listMode",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"minScale",null),a([m("minScale",["minScale","layerDefinition.minScale"])],o.prototype,"readMinScale",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"maxScale",null),a([m("maxScale",["maxScale","layerDefinition.maxScale"])],o.prototype,"readMaxScale",null),a([l()],o.prototype,"objectIdField",void 0),a([m("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],o.prototype,"readObjectIdFieldFromService",null),a([l({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:b}}})],o.prototype,"opacity",null),a([m("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],o.prototype,"readOpacity",null),a([v("opacity")],o.prototype,"writeOpacity",null),a([l({json:{type:q,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:b}}})],o.prototype,"parent",void 0),a([v("parent")],o.prototype,"writeParent",null),a([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy:P,writer(e,t,r){t[r]=!e}}}})],o.prototype,"popupEnabled",void 0),a([l({type:ue,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:P}}})],o.prototype,"popupTemplate",void 0),a([l({readOnly:!0})],o.prototype,"queryTask",null),a([l({type:[_e],readOnly:!0,json:{origins:{service:{read:{source:"layerDefinition.relationships"}}}}})],o.prototype,"relationships",void 0),a([l({types:Se,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b},origins:{"web-scene":{types:Ie,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b}}}}})],o.prototype,"renderer",null),a([l({types:{key:"type",base:null,typeMap:{"data-layer":X,"map-layer":N}},cast(e){if(e){if("mapLayerId"in e)return U(N,e);if("dataSource"in e)return U(X,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:b}}})],o.prototype,"source",null),a([l()],o.prototype,"sourceJSON",void 0),a([l({type:z,json:{origins:{service:{read:{source:"layerDefinition.extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),a([l({value:null,json:{type:[q],write:{target:"subLayerIds",allowNull:!0,overridePolicy:b}}})],o.prototype,"sublayers",null),a([de("sublayers")],o.prototype,"castSublayers",null),a([v("sublayers")],o.prototype,"writeSublayers",null),a([l({type:String,json:{name:"name",write:{overridePolicy:P}}})],o.prototype,"title",void 0),a([m("service","title",["name","layerDefinition.name"])],o.prototype,"readTitle",null),a([l({type:String})],o.prototype,"typeIdField",void 0),a([l({json:{read:!1},readOnly:!0,value:"sublayer"})],o.prototype,"type",void 0),a([m("typeIdField",["layerDefinition.typeIdField"])],o.prototype,"readTypeIdField",null),a([l({type:[Le],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],o.prototype,"types",void 0),a([l({type:String,json:{name:"layerUrl",write:{overridePolicy:j}}})],o.prototype,"url",null),a([l({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:b}}})],o.prototype,"visible",null),a([v("visible")],o.prototype,"writeVisible",null),o=A=a([Q("esri.layers.support.Sublayer")],o);const B=o;function Ne(e,t){const r=[],i={};return e&&e.forEach(s=>{const n=new B;if(n.read(s,t),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 _=k.ofType(B);function Z(e,t){e&&e.forEach(r=>{t(r),r.sublayers&&r.sublayers.length&&Z(r.sublayers,t)})}const ut=e=>{let t=class extends e{constructor(...r){super(...r),this.allSublayers=new ge({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{}},this.subtables=null,this.addHandles([K(()=>this.sublayers,(i,s)=>this._handleSublayersChange(i,s),H),K(()=>this.subtables,(i,s)=>this._handleSublayersChange(i,s),H)])}destroy(){this.allSublayers.destroy()}readSublayers(r,i){if(!i||!r)return;const{sublayersSourceJSON:s}=this,n=L(i.origin);if(ny.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:p,origin:u}=this.createSublayersForOrigin("web-document"),h=D(this);h.setDefaultOrigin(u),this._set("sublayers",new _(p)),h.setDefaultOrigin("user")}findSublayerById(r){return this.allSublayers.find(i=>i.id===r)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(r){const i=L(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 h=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d<=i);for(const d of h){const f=this.sublayersSourceJSON[d];je(f.layers)&&(s=d,n=f.layers,p=f.context,f.visibleLayers&&(u={visibleLayers:f.visibleLayers,context:f.context}))}const g=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d>s&&d<=i);let S=null;for(const d of g){const{layers:f,visibleLayers:O,context:F}=this.sublayersSourceJSON[d];f&&(S={layers:f,context:F}),O&&(u={visibleLayers:O,context:F})}const w=Ne(n,p),I=new Map,x=new Set;if(S)for(const d of S.layers)I.set(d.id,d);if(u?.visibleLayers)for(const d of u.visibleLayers)x.add(d);return Z(w,d=>{S&&d.read(I.get(d.id),S.context),u&&d.read({defaultVisibility:x.has(d.id)},u.context)}),{origin:he(s),sublayers:new _({items:w})}}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.removeHandles("sublayers-owner")),r&&(r.forEach(s=>{s.parent=this,s.layer=this}),this.addHandles([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.addHandles(r.on("before-changes",s=>{E.getLogger("esri.layers.TileLayer").error(new c("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([l({readOnly:!0})],t.prototype,"allSublayers",void 0),a([l({readOnly:!0,type:k.ofType(B)})],t.prototype,"serviceSublayers",void 0),a([l({value:null,type:_,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],t.prototype,"sublayers",void 0),a([l({readOnly:!0})],t.prototype,"sublayersSourceJSON",void 0),a([l({type:_,json:{read:{source:"tables"}}})],t.prototype,"subtables",void 0),t=a([Q("esri.layers.mixins.SublayersOwner")],t),t};export{B as A,yt as M,ut as k}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FeatureLayer-BrRKw5Si-DuA2fyE_.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-Doly9N9p.js","./story-DbFhYdqg.css","./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js","./RendererLegendOptions-K3md58-X-JLOOdHLz.js","./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js","./colorRamps-q0bZVhs2-BnivlaV9.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-tyrXoPjU.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js","./styleUtils-BtpNqZyT-Bnq2S5kK.js","./jsonUtils-C64Zfu7c-BtrwAD3_.js","./LRUCache-C3erQTWv-grHgYSP-.js","./Version-CoKzbupV-BDyz4v43.js","./FieldsIndex-HmzMbJQG-Du7S47uJ.js","./UnknownTimeZone-C--TOcPG-9of9030I.js","./OverrideHelper-DWRbVlj1-BnPmqHJ3.js","./colorUtils-Cthpxcks-cHaMZbaf.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-CiwW7WzR.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-DFYZs_ns.js","./heatmapUtils-seiMkkkR-CrSLbaQx.js","./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js","./commonProperties-BtIqvFU_-DbZji2Rx.js","./ElevationInfo-yv2-9tj6-CkIHeL1t.js","./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./HeightModelInfo-C5vFqzyF-BH6aliHn.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-BPr0_G9t.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./RelationshipQuery-DJsz3K0U-BKFa46R1.js","./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js","./Relationship-PyhUibYK-DN6K3ukS.js","./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js","./Layer-ChoECxvZ-BmDHBjO8.js","./workers-PiCjreoO-Dc6Tqm-o.js","./editsZScale-BDsX6vv--C-4n90TZ.js","./queryZScale-BiYV6Pr6-B7zp5L1G.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./FeatureSet-BkVNthuN-DPQqwkNN.js","./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js","./ArcGISService-BYA-y6X6-DNHMEBm_.js","./BlendLayer-D1WkSmwP-BeUsb4u9.js","./jsonUtils-wIllKWI4-MQQ-E5fj.js","./parser-DyDJ-rlI-CvOs11Ip.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-6clJxb1Q.js","./CustomParametersMixin-vdKsTHer-5EfrrVMH.js","./EditBusLayer-Df29OyJh-OmdJOLws.js","./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js","./FeatureEffect-CDEk9Es7-Cd4-I1fy.js","./FeatureFilter-BCFHgLVU-DwigNbnH.js","./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js","./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js","./labelingInfo-DGVNul26-BDBqWm17.js","./labelUtils-BW14kBqX-Tk7uOiPw.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-DTTV2F9z.js","./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js","./OrderByInfo-GD2XnU8e-BaEpZLaO.js","./PortalLayer-CElnYuSQ-CCe4TMEA.js","./PortalItem-CctGdnxF-CfFOGshS.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./RefreshableLayer-a8BQ58Xh-CxfquKbp.js","./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js","./TemporalLayer-CpOrN_w9-8nvJFP_-.js","./TimeInfo-w_HB2CsF-B2qHZyfS.js","./FeatureTemplate-SPHPD45f-CZ7E6_6b.js","./FeatureType-C9hJmS6_-CNlvn5D1.js","./fieldProperties-Bq26w7gt-BiKrD4ue.js","./versionUtils-LZYZz-38-B8C5OAjF.js","./styleUtils-ChrJTYIw-C6xq7Jeu.js","./popupUtils-B0uZcXX0-DHyOz1jC.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js"])))=>i.map(i=>d[i]); +import{_ as te}from"./main-QGPoLsvl.js";import{bR as re,aB as ie,o as c,f as M,bS as se,K as ae,bT as oe,a7 as le,a1 as E,bG as ne,ag as k,X as pe,bU as D,bP as y,P as T,bV as ye,bW as V,v as a,S as l,a0 as m,n as Y,bB as q,ac as v,bL as ue,aO as U,J as z,ad as de,i as Q,bO as L,$,bX as J,an as ce,ah as K,av as H,bY as he}from"./story-Doly9N9p.js";import{m as fe}from"./Version-CoKzbupV-BDyz4v43.js";import{i as W}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{e as be,X as me}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{I as G}from"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import{f as ge}from"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{m as Se,u as Ie}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{m as we}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{C as ve}from"./QueryTask-CwHwH2rS-D4f5dsGo.js";import{f as Ee}from"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import{y as Le}from"./FeatureType-C9hJmS6_-CNlvn5D1.js";import{y as xe}from"./Field-C6hA1tZj-CkWoRbmp.js";import{o as Oe}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{Q as Fe,C as Te}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{v as Pe}from"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import{p as _e}from"./Relationship-PyhUibYK-DN6K3ukS.js";import{x as De}from"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import{c as N,b as Ae,K as X}from"./Query-BrwMGK8U-BPr0_G9t.js";import{y as qe}from"./utils-9sQxfkoa-D8FX0sO8.js";import{c as Ce}from"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import{w as Re}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import{c as je}from"./sublayerUtils-CyM0QC5B-B1ryunQi.js";const yt=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesMap=null}readCapabilities(r,i){const s=i.capabilities&&i.capabilities.split(",").map(ee=>ee.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=n!=="tile"&&!!i.supportsDynamicLayers,u=s.includes("query"),h=s.includes("map"),g=!!i.exportTilesAllowed,S=s.includes("tilemap"),w=s.includes("data"),I=n!=="tile"&&(!i.tileInfo||p),x=n!=="tile"&&(!i.tileInfo||p),d=n!=="tile",f=i.cimVersion?fe.parse(i.cimVersion):null,O=f?.greaterEqual(1,4)??!1,F=f?.greaterEqual(2,0)??!1;return{operations:{supportsExportMap:h,supportsExportTiles:g,supportsIdentify:u,supportsQuery:w,supportsTileMap:S},exportMap:h?{supportsArcadeExpressionForLabeling:O,supportsSublayersChanges:d,supportsDynamicLayers:p,supportsSublayerVisibility:I,supportsSublayerDefinitionExpression:x,supportsCIMSymbols:F}:null,exportTiles:g?{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 fetchRelatedService(r){const i=this.portalItem;if(!i||!G(i))return null;this._relatedFeatureServicePromise||(this._relatedFeatureServicePromise=i.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},r).then(n=>n.find(p=>p.type==="Feature Service")??null,()=>null));const s=await this._relatedFeatureServicePromise;return $(r),s?{itemId:s.id,url:s.url}:null}async fetchSublayerInfo(r,i){const{source:s}=r;if(this?.portalItem&&this.type==="tile"&&s?.type==="map-layer"&&G(this.portalItem)&&r.originIdOf("url")y.SERVICE)try{const u=await this._fetchAllLayersAndTablesFromService(n),h=W(n)?.sublayer??s.mapLayerId;p=u.get(h)}catch{}else{let u=r.id;s?.type==="map-layer"&&(u=s.mapLayerId);try{p=(await this.fetchAllLayersAndTables(i)).get(u)}catch{}}return p}async fetchAllLayersAndTables(r){return this._fetchAllLayersAndTablesFromService(this.parsedUrl?.path,r)}async _fetchAllLayersAndTablesFromService(r,i){await this.load(i),this._allLayersAndTablesMap||=new Map;const s=W(r),n=ce(this._allLayersAndTablesMap,s?.url.path,()=>M(J(s?.url.path,"/layers"),{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(u=>{const h=new Map,{layers:g,tables:S}=u.data,w=[...g??[],...S??[]];for(const I of w)h.set(I.id,I);return{result:h}},u=>({error:u}))),p=await n;if($(i),"result"in p)return p.result;throw p.error}};return a([l({readOnly:!0})],t.prototype,"capabilities",void 0),a([m("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],t.prototype,"readCapabilities",null),a([l({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),a([l({type:Y})],t.prototype,"fullExtent",void 0),a([l(be)],t.prototype,"id",void 0),a([l({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],t.prototype,"legendEnabled",void 0),a([l(me)],t.prototype,"popupEnabled",void 0),a([l({type:z})],t.prototype,"spatialReference",void 0),a([l({readOnly:!0})],t.prototype,"version",void 0),a([m("service","version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],t.prototype,"readVersion",null),t=a([Q("esri.layers.mixins.ArcGISMapService")],t),t};var A;function C(e){return e?.type==="esriSMS"}function R(e,t,r){const i=this.originIdOf(t)>=L(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&r.layer?.type==="map-image"&&(r.writeSublayerStructure||i)}}function j(e,t,r){return{enabled:!!r&&r.layer?.type==="tile"&&(r.origin&&this.originIdOf(t)>=L(r.origin)||this._isOverridden(t))}}function b(e,t,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function P(e,t,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(t)>=L(r.origin))}}let Me=0;const Ve=new Set(["layer","parent","loaded","loadStatus","loadError","loadWarnings"]);let o=A=class extends we(re(ie)){constructor(e){super(e),this.capabilities=void 0,this.maxScaleRange={minScale:0,maxScale:0},this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.isTable=!1,this.legendEnabled=!0,this.objectIdField=null,this.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.relationships=null,this.sourceJSON=null,this.spatialReference=null,this.title=null,this.typeIdField=null,this.type="sublayer",this.types=null,this._lastParsedUrl=null}async load(e){return this.addResolvingPromise((async()=>{const{layer:t,url:r}=this;if(!t&&!r)throw new c("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});const i=t?await t.fetchSublayerInfo(this,e):(await M(r,{responseType:"json",query:{f:"json"},...e})).data;i&&(this.sourceJSON=i,this.read({layerDefinition:i},{origin:"service",layer:t,url:qe(r)}))})()),this}readCapabilities(e,t){t=t.layerDefinition||t;const{operations:{supportsQuery:r,supportsQueryAttachments:i},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},data:{supportsAttachment:u},queryRelated:h}=De(t,this.url);return{exportMap:{supportsModification:!!t.canModifyLayer},operations:{supportsQuery:r,supportsQueryAttachments:i},data:{supportsAttachment:u},query:{supportsFormatPBF:s,supportsOrderBy:n,supportsPagination:p},queryRelated:h}}get defaultPopupTemplate(){return this.createPopupTemplate()}set definitionExpression(e){this._setAndNotifyLayer("definitionExpression",e)}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}readMaxScaleRange(e,t){return{minScale:(t=t.layerDefinition||t).minScale??0,maxScale:t.maxScale??0}}get fieldsIndex(){return new Oe(this.fields||[])}set floorInfo(e){this._setAndNotifyLayer("floorInfo",e)}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields){for(const r of t.fields)if(r.type==="esriFieldTypeGlobalID")return r.name}}get id(){return this._get("id")??Me++}set id(e){this._get("id")!==e&&(this.layer?.capabilities?.exportMap?.supportsDynamicLayers!==!1?this._set("id",e):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}readIsTable(e,t){return t.type==="Table"}set labelingInfo(e){this._setAndNotifyLayer("labelingInfo",e)}writeLabelingInfo(e,t,r,i){e&&e.length&&(t.layerDefinition={drawingInfo:{labelingInfo:e.map(s=>s.write({},i))}})}set labelsVisible(e){this._setAndNotifyLayer("labelsVisible",e)}set layer(e){this._set("layer",e),this.sublayers?.forEach(t=>t.layer=e)}set listMode(e){this._set("listMode",e)}set minScale(e){this._setAndNotifyLayer("minScale",e)}readMinScale(e,t){return t.minScale||t.layerDefinition?.minScale||0}set maxScale(e){this._setAndNotifyLayer("maxScale",e)}readMaxScale(e,t){return t.maxScale||t.layerDefinition?.maxScale||0}readObjectIdFieldFromService(e,t){return(t=t.layerDefinition||t).objectIdField?t.objectIdField:t.fields?.find(r=>r.type==="esriFieldTypeOID")?.name}set opacity(e){this._setAndNotifyLayer("opacity",e)}readOpacity(e,t){const{layerDefinition:r}=t;return 1-.01*(r?.transparency??r?.drawingInfo?.transparency??0)}writeOpacity(e,t,r,i){t.layerDefinition={drawingInfo:{transparency:100-100*e}}}writeParent(e,t){this.parent&&this.parent!==this.layer?t.parentLayerId=se(this.parent.id):t.parentLayerId=-1}get queryTask(){if(!this.layer)return null;const{capabilities:e,fieldsIndex:t,layer:r,url:i}=this,{spatialReference:s}=r,n="gdbVersion"in r?r.gdbVersion:void 0,p=ae("featurelayer-pbf")&&e?.query.supportsFormatPBF;return new ve({fieldsIndex:t,gdbVersion:n,pbfSupported:p,queryAttachmentsSupported:e?.operations?.supportsQueryAttachments??!1,sourceSpatialReference:s,url:i})}set renderer(e){if(oe(e,this.fieldsIndex),e){for(const t of e.getSymbols())if(le(t)){E.getLogger(this).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",e)}get source(){return this._get("source")||new N({mapLayerId:this.id})}set source(e){this._setAndNotifyLayer("source",e)}set sublayers(e){this._handleSublayersChange(e,this._get("sublayers")),this._set("sublayers",e)}castSublayers(e){return ne(k.ofType(A),e)}writeSublayers(e,t,r){this.sublayers?.length&&(t[r]=this.sublayers.map(i=>i.id).toArray().reverse())}readTitle(e,t){return t.layerDefinition?.name??t.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const i=t.fields.find(s=>s.name.toLowerCase()===r);i&&(r=i.name)}return r}get url(){const e=this.layer?.parsedUrl??this._lastParsedUrl,t=this.source;if(!e)return null;if(this._lastParsedUrl=e,t?.type==="map-layer")return`${e.path}/${t.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${e.path}/dynamicLayer?${pe(r)}`}set url(e){this._overrideIfSome("url",e)}set visible(e){this._setAndNotifyLayer("visible",e)}writeVisible(e,t,r,i){t[r]=this.getAtOrigin("defaultVisibility","service")||e}clone(){const{store:e}=D(this),t=new A;return D(t).store=e.clone(Ve),this.commitProperty("url"),t._lastParsedUrl=this._lastParsedUrl,t}createPopupTemplate(e){return Re(this,e)}createQuery(){return new Ae({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){if(this.hasOwnProperty("sublayers"))return null;const e=(await te(async()=>{const{default:s}=await import("./FeatureLayer-BrRKw5Si-DuA2fyE_.js");return{default:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]),import.meta.url)).default,{layer:t,url:r}=this;let i;if(r&&this.originIdOf("url")>y.SERVICE)i=new e({url:r});else{if(!t?.parsedUrl)throw new c("createFeatureLayer:missing-information","Cannot create a FeatureLayer without a url or a parent layer");{const s=t.parsedUrl;i=new e({url:s.path}),s&&this.source&&(this.source.type==="map-layer"?i.layerId=this.source.mapLayerId:i.dynamicDataSource=this.source)}}return t?.refreshInterval!=null&&(i.refreshInterval=t.refreshInterval),this.definitionExpression&&(i.definitionExpression=this.definitionExpression),this.floorInfo&&(i.floorInfo=T(this.floorInfo)),this.originIdOf("labelingInfo")>y.SERVICE&&(i.labelingInfo=T(this.labelingInfo)),this.originIdOf("labelsVisible")>y.DEFAULTS&&(i.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>y.DEFAULTS&&(i.legendEnabled=this.legendEnabled),this.originIdOf("visible")>y.DEFAULTS&&(i.visible=this.visible),this.originIdOf("minScale")>y.DEFAULTS&&(i.minScale=this.minScale),this.originIdOf("maxScale")>y.DEFAULTS&&(i.maxScale=this.maxScale),this.originIdOf("opacity")>y.DEFAULTS&&(i.opacity=this.opacity),this.originIdOf("popupTemplate")>y.DEFAULTS&&(i.popupTemplate=T(this.popupTemplate)),this.originIdOf("renderer")>y.SERVICE&&(i.renderer=T(this.renderer)),this.source?.type==="data-layer"&&(i.dynamicDataSource=this.source.clone()),this.originIdOf("title")>y.DEFAULTS&&(i.title=this.title),t?.type==="map-image"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),t?.type==="tile"&&t.originIdOf("customParameters")>y.DEFAULTS&&(i.customParameters=t.customParameters),i}getField(e){return this.fieldsIndex.get(e)}getFeatureType(e){return Ee(this.types,this.typeIdField,e)}getFieldDomain(e,t){const r=t?.feature,i=this.getFeatureType(r);if(i){const s=i.domains&&i.domains[e];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(e)}async queryAttachments(e,t){await this.load(),e=Ce.from(e);const r=this.capabilities;if(!r?.data?.supportsAttachment)throw new c("queryAttachments:not-supported","this layer doesn't support attachments");const{attachmentTypes:i,objectIds:s,globalIds:n,num:p,size:u,start:h,where:g}=e;if(!r?.operations?.supportsQueryAttachments&&(i?.length>0||n?.length>0||u?.length>0||p||h||g))throw new c("queryAttachments:option-not-supported","when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(s?.length||n?.length||g))throw new c("queryAttachments:invalid-query","'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);return this.queryTask.executeAttachmentQuery(e,t)}async queryFeatureCount(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatureCount:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatureCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryFeatures(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryFeatures:not-supported","this layer has no url.");const r=await this.queryTask.execute(e,{...t,query:{...this.layer?.customParameters,token:this.layer?.apiKey}});if(r?.features)for(const i of r.features)i.sourceLayer=this;return r}async queryObjectIds(e=this.createQuery(),t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryObjectIds:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryObjectIds:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeForIds(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeatures(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeatures:not-supported","this layer doesn't support queries.");if(!this.url)throw new c("queryRelatedFeatures:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQuery(e,{...t,query:{...this.layer?.customParameters,token:r}})}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.capabilities.operations.supportsQuery)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support queries.");if(!this.capabilities.queryRelated.supportsCount)throw new c("queryRelatedFeaturesCount:not-supported","this layer doesn't support query related counts.");if(!this.url)throw new c("queryRelatedFeaturesCount:not-supported","this layer has no url.");const r=this.layer?.apiKey;return await this.queryTask.executeRelationshipQueryForCount(e,{...t,query:{...this.layer?.customParameters,token:r}})}toExportImageJSON(e){const t={id:this.id,source:this.source?.toJSON()||{mapLayerId:this.id,type:"mapLayer"}},r=ye(e,this.definitionExpression);r!=null&&(t.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((s,n)=>(s[n]=this.originIdOf(n),s),{});if(Object.keys(i).some(s=>i[s]>y.SERVICE)){const s=t.drawingInfo={};if(i.renderer>y.SERVICE&&(s.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>y.SERVICE&&(s.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>y.SERVICE)if(this.labelingInfo){!this.loaded&&this.labelingInfo?.some(p=>!p.labelPlacement)&&E.getLogger(this).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let n=this.labelingInfo;this.geometryType!=null&&(n=Fe(this.labelingInfo,V.toJSON(this.geometryType))),s.showLabels=!0,s.labelingInfo=n.filter(p=>p.labelPlacement).map(p=>p.toJSON({origin:"service",layer:this.layer}))}else s.showLabels=!1;i.opacity>y.SERVICE&&(s.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(s.renderer)}return t}_assignDefaultSymbolColors(e){this._forEachSimpleMarkerSymbols(e,t=>{t.color||t.style!=="esriSMSX"&&t.style!=="esriSMSCross"||(t.outline?.color?t.color=t.outline.color:t.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(e,t){if(e){const r=("uniqueValueInfos"in e?e.uniqueValueInfos:"classBreakInfos"in e?e.classBreakInfos:null)??[];for(const i of r)C(i.symbol)&&t(i.symbol);"symbol"in e&&C(e.symbol)&&t(e.symbol),"defaultSymbol"in e&&C(e.defaultSymbol)&&t(e.defaultSymbol)}}_setAndNotifyLayer(e,t){const r=this.layer,i=this._get(e);let s,n;switch(e){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";break;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=D(this).getDefaultOrigin();if(p!=="service"){if(s&&this.layer?.capabilities?.exportMap?.[s]===!1)return void this._logLockedError(e,`capability not available 'layer.capabilities.exportMap.${s}'`);if(n&&this.capabilities?.exportMap[n]===!1)return void this._logLockedError(e,`capability not available 'capabilities.exportMap.${n}'`)}e!=="source"||this.loadStatus==="not-loaded"?(this._set(e,t),p!=="service"&&i!==t&&r&&r.emit&&r.emit("sublayer-update",{propertyName:e,target:this})):this._logLockedError(e,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null,r.layer=null}),this.removeAllHandles()),e&&(e.forEach(r=>{r.parent=this,r.layer=this.layer}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,r.layer=this.layer}),e.on("after-remove",({item:r})=>{r.parent=null,r.layer=null}),e.on("before-changes",r=>{(this.layer?.capabilities?.exportMap?.supportsSublayersChanges??1)||(E.getLogger(this).error(new c("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(e,t){const{layer:r,declaredClass:i}=this;E.getLogger(i).error(new c("sublayer:locked",`Property '${String(e)}' can't be changed on Sublayer from the layer '${r?.id}'`,{reason:t,sublayer:this,layer:r}))}_getLayerDomain(e){return this.fieldsIndex.get(e)?.domain??null}};o.test={isMapImageLayerOverridePolicy:e=>e===b||e===R,isTileImageLayerOverridePolicy:e=>e===j},a([l({readOnly:!0})],o.prototype,"capabilities",void 0),a([m("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],o.prototype,"readCapabilities",null),a([l()],o.prototype,"defaultPopupTemplate",null),a([l({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:R}}})],o.prototype,"definitionExpression",null),a([l({readOnly:!0})],o.prototype,"effectiveScaleRange",null),a([m("service","maxScaleRange",["minScale","maxScale"])],o.prototype,"readMaxScaleRange",null),a([l({type:[xe],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],o.prototype,"fields",void 0),a([l({readOnly:!0})],o.prototype,"fieldsIndex",null),a([l({type:Pe,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:R},origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"floorInfo",null),a([l({type:Y,json:{read:{source:"layerDefinition.extent"}}})],o.prototype,"fullExtent",void 0),a([l({type:V.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:V.read}}}}})],o.prototype,"geometryType",void 0),a([l({type:String})],o.prototype,"globalIdField",void 0),a([m("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],o.prototype,"readGlobalIdFieldFromService",null),a([l({type:q,json:{write:{ignoreOrigin:!0}}})],o.prototype,"id",null),a([l({readOnly:!0})],o.prototype,"isTable",void 0),a([m("service","isTable",["type"])],o.prototype,"readIsTable",null),a([l({value:null,type:[Te],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:b}}})],o.prototype,"labelingInfo",null),a([v("labelingInfo")],o.prototype,"writeLabelingInfo",null),a([l({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:b}}})],o.prototype,"labelsVisible",null),a([l({value:null})],o.prototype,"layer",null),a([l({type:String,json:{write:{overridePolicy:j}}})],o.prototype,"layerItemId",void 0),a([l({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:P}}})],o.prototype,"legendEnabled",void 0),a([l({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],o.prototype,"listMode",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"minScale",null),a([m("minScale",["minScale","layerDefinition.minScale"])],o.prototype,"readMinScale",null),a([l({type:Number,value:0,json:{write:{overridePolicy:b}}})],o.prototype,"maxScale",null),a([m("maxScale",["maxScale","layerDefinition.maxScale"])],o.prototype,"readMaxScale",null),a([l()],o.prototype,"objectIdField",void 0),a([m("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],o.prototype,"readObjectIdFieldFromService",null),a([l({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:b}}})],o.prototype,"opacity",null),a([m("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],o.prototype,"readOpacity",null),a([v("opacity")],o.prototype,"writeOpacity",null),a([l({json:{type:q,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:b}}})],o.prototype,"parent",void 0),a([v("parent")],o.prototype,"writeParent",null),a([l({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy:P,writer(e,t,r){t[r]=!e}}}})],o.prototype,"popupEnabled",void 0),a([l({type:ue,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:P}}})],o.prototype,"popupTemplate",void 0),a([l({readOnly:!0})],o.prototype,"queryTask",null),a([l({type:[_e],readOnly:!0,json:{origins:{service:{read:{source:"layerDefinition.relationships"}}}}})],o.prototype,"relationships",void 0),a([l({types:Se,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b},origins:{"web-scene":{types:Ie,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:b}}}}})],o.prototype,"renderer",null),a([l({types:{key:"type",base:null,typeMap:{"data-layer":X,"map-layer":N}},cast(e){if(e){if("mapLayerId"in e)return U(N,e);if("dataSource"in e)return U(X,e)}return e},json:{name:"layerDefinition.source",write:{overridePolicy:b}}})],o.prototype,"source",null),a([l()],o.prototype,"sourceJSON",void 0),a([l({type:z,json:{origins:{service:{read:{source:"layerDefinition.extent.spatialReference"}}}}})],o.prototype,"spatialReference",void 0),a([l({value:null,json:{type:[q],write:{target:"subLayerIds",allowNull:!0,overridePolicy:b}}})],o.prototype,"sublayers",null),a([de("sublayers")],o.prototype,"castSublayers",null),a([v("sublayers")],o.prototype,"writeSublayers",null),a([l({type:String,json:{name:"name",write:{overridePolicy:P}}})],o.prototype,"title",void 0),a([m("service","title",["name","layerDefinition.name"])],o.prototype,"readTitle",null),a([l({type:String})],o.prototype,"typeIdField",void 0),a([l({json:{read:!1},readOnly:!0,value:"sublayer"})],o.prototype,"type",void 0),a([m("typeIdField",["layerDefinition.typeIdField"])],o.prototype,"readTypeIdField",null),a([l({type:[Le],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],o.prototype,"types",void 0),a([l({type:String,json:{name:"layerUrl",write:{overridePolicy:j}}})],o.prototype,"url",null),a([l({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:b}}})],o.prototype,"visible",null),a([v("visible")],o.prototype,"writeVisible",null),o=A=a([Q("esri.layers.support.Sublayer")],o);const B=o;function Ne(e,t){const r=[],i={};return e&&e.forEach(s=>{const n=new B;if(n.read(s,t),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 _=k.ofType(B);function Z(e,t){e&&e.forEach(r=>{t(r),r.sublayers&&r.sublayers.length&&Z(r.sublayers,t)})}const ut=e=>{let t=class extends e{constructor(...r){super(...r),this.allSublayers=new ge({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{}},this.subtables=null,this.addHandles([K(()=>this.sublayers,(i,s)=>this._handleSublayersChange(i,s),H),K(()=>this.subtables,(i,s)=>this._handleSublayersChange(i,s),H)])}destroy(){this.allSublayers.destroy()}readSublayers(r,i){if(!i||!r)return;const{sublayersSourceJSON:s}=this,n=L(i.origin);if(ny.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:p,origin:u}=this.createSublayersForOrigin("web-document"),h=D(this);h.setDefaultOrigin(u),this._set("sublayers",new _(p)),h.setDefaultOrigin("user")}findSublayerById(r){return this.allSublayers.find(i=>i.id===r)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(r){const i=L(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 h=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d<=i);for(const d of h){const f=this.sublayersSourceJSON[d];je(f.layers)&&(s=d,n=f.layers,p=f.context,f.visibleLayers&&(u={visibleLayers:f.visibleLayers,context:f.context}))}const g=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d>s&&d<=i);let S=null;for(const d of g){const{layers:f,visibleLayers:O,context:F}=this.sublayersSourceJSON[d];f&&(S={layers:f,context:F}),O&&(u={visibleLayers:O,context:F})}const w=Ne(n,p),I=new Map,x=new Set;if(S)for(const d of S.layers)I.set(d.id,d);if(u?.visibleLayers)for(const d of u.visibleLayers)x.add(d);return Z(w,d=>{S&&d.read(I.get(d.id),S.context),u&&d.read({defaultVisibility:x.has(d.id)},u.context)}),{origin:he(s),sublayers:new _({items:w})}}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.removeHandles("sublayers-owner")),r&&(r.forEach(s=>{s.parent=this,s.layer=this}),this.addHandles([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.addHandles(r.on("before-changes",s=>{E.getLogger("esri.layers.TileLayer").error(new c("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([l({readOnly:!0})],t.prototype,"allSublayers",void 0),a([l({readOnly:!0,type:k.ofType(B)})],t.prototype,"serviceSublayers",void 0),a([l({value:null,type:_,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],t.prototype,"sublayers",void 0),a([l({readOnly:!0})],t.prototype,"sublayersSourceJSON",void 0),a([l({type:_,json:{read:{source:"tables"}}})],t.prototype,"subtables",void 0),t=a([Q("esri.layers.mixins.SublayersOwner")],t),t};export{B as A,yt as M,ut as k}; diff --git a/custom-toc-highlight/assets/SubtypeGroupLayer-D1vAbwEU-CDpC08_d.js b/custom-toc-highlight/assets/SubtypeGroupLayer-D1vAbwEU-D1p0P2KY.js similarity index 76% rename from custom-toc-highlight/assets/SubtypeGroupLayer-D1vAbwEU-CDpC08_d.js rename to custom-toc-highlight/assets/SubtypeGroupLayer-D1vAbwEU-D1p0P2KY.js index ac1eb440..3c2f5d10 100644 --- a/custom-toc-highlight/assets/SubtypeGroupLayer-D1vAbwEU-CDpC08_d.js +++ b/custom-toc-highlight/assets/SubtypeGroupLayer-D1vAbwEU-D1p0P2KY.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-2gXi28Q5.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./utils-BVWK2jiA-Btpo3M9u.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./jsonContext-BA8GHqVk-CWQlLGSw.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./saveUtils-CIYk-dsQ-VGcOewby.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./fetchService-DbaKmJhP-W7rGyykJ.js","./FeatureLayerSource-k4WMYop1-BFUwA-tw.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-Dycut332.js","./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js","./vec32-D9GsKZ1t-BjayBdwt.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-P7VLSnKi.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-DoQndDth.js","./mat4-DX7gBViE-DVqdGrVU.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BrXZAXDf.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-BcQn3A1C.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-9sQxfkoa-KicvrT8N.js","./utils-Bq23Xwmj--_SaacS5.js","./EditBusLayer-Df29OyJh-DkVkxUAl.js","./clientSideDefaults-BqqayPct-B-0mBem3.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-B8khefoW.js","./Query-BrwMGK8U-DoFNfkjX.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./executeForIds-Z1gkLduF-D8DZG8qZ.js","./query-DFW9-NG_-gbjlxRZk.js","./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js","./pbf-D-y3_eZO-DQKnyfOm.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-B5UMbu5B.js","./executeQueryPBF-o8010HS9-BgTBXvCY.js","./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js","./FeatureSet-BkVNthuN-CwS44--W.js","./executeQueryJSON-CcHnccia-BW7_NQxl.js","./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js","./jsonUtils-C64Zfu7c-CitE8NjK.js","./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js","./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js","./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js","./colorRamps-q0bZVhs2-DQZn2xZS.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-23qzp7zg.js","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./lengthUtils-DKpMe5qR-C2NPRwwl.js","./styleUtils-BtpNqZyT-D2Hj1Rgz.js","./LRUCache-C3erQTWv-0wD6drRf.js","./Version-CoKzbupV-9-gg6ENz.js","./FieldsIndex-HmzMbJQG-DZuFWLvd.js","./UnknownTimeZone-C--TOcPG-D3CAoWPX.js","./OverrideHelper-DWRbVlj1-BZq72sbX.js","./colorUtils-Cthpxcks-ZRnr1H1b.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-B3hR8LxB.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-B-lEhyoX.js","./heatmapUtils-seiMkkkR-Cj1KmweL.js","./RelationshipQuery-DJsz3K0U-yAwL-qLW.js","./editsZScale-BDsX6vv--CttUpViY.js"])))=>i.map(i=>d[i]); -import{_ as P}from"./main-ugzBrWNm.js";import{ct as K,aa as V,bR as W,bT as D,P as v,dK as Z,a1 as ee,J as te,o as b,bV as q,v as i,S as o,ac as re,bL as ie,a0 as I,i as H,ag as L,bp as se,ah as oe,av as ne,W as ae,a as le,bX as pe,a_ as ue,dL as de,jS as ye,hG as ce,jT as he,aB as me}from"./story-BfX8CRfG.js";import{y as fe}from"./loadAll-e978YItg-CdtGGDtb.js";import{m as Q}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as be}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{a as ve}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{u as we}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as Fe}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{C as Se}from"./EditBusLayer-Df29OyJh-DkVkxUAl.js";import{H as Ie,$ as Oe}from"./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as Te}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as $e}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{x as Ce}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{I as _e}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{J as xe,Y as Le,_ as Ae,t as qe,n as Pe,X as De,e as Re}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{t as N,s as U,c as Ge,l as Ve,Q as He,$ as Qe,U as Ne,_ as Ue,z as ke,o as Me,B as Be,H as Je,K as Xe,X as Ye,W as ze,Y as Ke,e as We}from"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import{f as k}from"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import{E as Ze,d as et,o as tt}from"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{p as $}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{X as rt}from"./colorUtils-Cthpxcks-ZRnr1H1b.js";import{u as it}from"./cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js";import{x as st,C as ot}from"./utils-DPtQ14k3-CAwuJg76.js";import{p as M}from"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import{C as nt,q as at}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{b as B}from"./Query-BrwMGK8U-DoFNfkjX.js";import{w as lt}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import{w as pt}from"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import{a as ut}from"./versionUtils-LZYZz-38-DxOZEoAg.js";import{E}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import"./Relationship-PyhUibYK-BgFx3_5x.js";import"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";const J={key:"type",base:Ze,errorContext:"renderer",typeMap:{simple:$,"unique-value":et,"class-breaks":tt}},A=K({types:J});function dt(e,t){const r=e.drawingInfo?.renderer,s=r?A(r,e,t):null;if(s?.type==="simple")return st(s.symbol,null)?s.symbol.clone():null}const yt=["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"];function ct(e,t){return rt(yt,e,{offset:!0,shuffle:!0}).reverse().map(r=>{const s=t.clone();return s.type==="cim"?it(s,r):ot(s,r),new $({symbol:s})})}const R=k();let ht=0;function S(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function mt(e){return new $({symbol:ft(e)})}function ft(e){switch(e){case"point":case"multipoint":return he.clone();case"polyline":return ce.clone();case"polygon":case"multipatch":return ye.clone();default:return null}}function bt(e,t){return!!t&&e?.type==="unique-value"&&e.field!=null&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function X(e,t){return e==null?null:t.subtypes?.find(r=>r.code===e)}function gt(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 s={},l=X(e,t);if(l!=null){const{defaultValues:a}=l;for(const u in a)s[u]=a[u]}return s[t.subtypeField]=e,new M({name:"New Feature",drawingTool:r,prototype:{attributes:s}})}let n=class extends Q(V(W(me))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${ht++}`,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.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return D(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:s,parent:l}=this;let a;if(s){a=[];let u=0;s.forEach(({name:d,alias:y,editable:w,visible:F})=>{if(!F)return;const c=l?.fields?.find(j=>j.name===d);if(!c)return;const f={name:d};let g=!1;y!==c.alias&&(f.alias=y,g=!0),w!==c.editable&&(f.editable=w,g=!0),a.push(f),g&&u++}),u===0&&a.length===s.length&&(a=null)}else a=v(e);a?.length&&Z(r,a,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,s=e?.fields;if(!e||!s?.length)return null;const{subtypes:l,subtypeField:a}=e,u=l?.find(F=>F.code===r),d=u?.defaultValues,y=u?.domains,w=[];for(const F of s){const c=F.clone(),{name:f}=c,g=t?.find(O=>O.name===f);if(c.visible=!t||!!g,g){const{alias:O,editable:z}=g;O&&(c.alias=O),z===!1&&(c.editable=!1)}const j=d?.[f]??null;c.defaultValue=f===a?r:j;const C=y?.[f]??null;c.domain=f===a?null:C?C.type==="inherited"?c.domain:C.clone():null,w.push(c)}return w}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||ee.getLogger(this).error(h("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){D(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"?mt(e.geometryType):null}readRendererFromService(e,t,r){if(t.type==="Table")return null;const s=t.drawingInfo?.renderer,l=A(s,t,r);let a;const{subtypeCode:u}=this;if(u!=null&&bt(l,t.subtypeField)){const d=l.uniqueValueInfos?.find(({value:y})=>(y=typeof y=="number"?String(y):y)===String(u));d&&(a=new $({symbol:d.symbol}))}else l?.type!=="simple"||l.visualVariables?.length||(a=l);return a}readRenderer(e,t,r){const s=t?.layerDefinition?.drawingInfo?.renderer;return s?s.visualVariables?.some(l=>l.type!=="rotationInfo")?void 0:A(s,t,r)||void 0:void 0}get spatialReference(){return this.parent?.spatialReference??te.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[gt(this.subtypeCode,t)]}readTitleFromService(e,t){const r=X(this.subtypeCode,t);return r!=null?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw h("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:s}=this;if(!s)throw h("updateAttachment");if(e.getAttribute(s.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return s.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw h("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw h("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:s,title:l}=this;if(r){const{displayField:a,editFieldsInfo:u,objectIdField:d}=r;t={displayField:a,editFieldsInfo:u,fields:s,objectIdField:d,title:l}}return lt(t,e)}createQuery(){if(!this.parent)throw h("createQuery");const e=N(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=q(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){const r=U(this.parent,e);if(r)return r}return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw h("queryAttachments");const s=e.clone();return s.where=Y(s.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatureCount");return r.parent.queryFeatureCount(_(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatures");return r.parent.queryFeatures(_(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw h("queryObjectIds");return r.parent.queryObjectIds(_(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([o({type:xe,json:{name:"attributeTableInfo",write:{ignoreOrigin:!0}}})],n.prototype,"attributeTableTemplate",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"capabilities",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"effectiveCapabilities",null),i([o({json:{write:{ignoreOrigin:!0}}})],n.prototype,"charts",void 0),i([o({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],n.prototype,"editingEnabled",void 0),i([o({type:Boolean,readOnly:!0})],n.prototype,"effectiveEditingEnabled",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"elevationInfo",null),i([o({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],n.prototype,"fieldOverrides",void 0),i([re("fieldOverrides")],n.prototype,"writeFieldOverrides",null),i([o({...R.fields,readOnly:!0,json:{read:!1}})],n.prototype,"fields",null),i([o(R.fieldsIndex)],n.prototype,"fieldsIndex",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"floorInfo",null),i([o({type:Ie,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],n.prototype,"formTemplate",void 0),i([o({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"id",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"geometryType",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"type",void 0),i([o(S(v(Le)))],n.prototype,"labelsVisible",void 0),i([o({type:[nt],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:at},write:{ignoreOrigin:!0}}})],n.prototype,"labelingInfo",void 0),i([o({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],n.prototype,"layerType",void 0),i([o(S(v(Ae)))],n.prototype,"legendEnabled",void 0),i([o({type:["show","hide"]})],n.prototype,"listMode",void 0),i([o((()=>{const e=v(qe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"minScale",void 0),i([o((()=>{const e=v(Pe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"maxScale",void 0),i([o({readOnly:!0})],n.prototype,"effectiveScaleRange",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"objectIdField",null),i([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],n.prototype,"opacity",void 0),i([o({clonable:!1})],n.prototype,"parent",void 0),i([o(S(v(De)))],n.prototype,"popupEnabled",void 0),i([o({type:ie,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],n.prototype,"popupTemplate",void 0),i([o({readOnly:!0})],n.prototype,"defaultPopupTemplate",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"relationships",null),i([o({types:J,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],n.prototype,"renderer",null),i([I("service","renderer",["drawingInfo.renderer","subtypeField","type"])],n.prototype,"readRendererFromService",null),i([I("renderer",["layerDefinition.drawingInfo.renderer"])],n.prototype,"readRenderer",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"spatialReference",null),i([o({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"subtypeCode",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"subtypeField",null),i([o({type:[M],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],n.prototype,"templates",void 0),i([I("service","templates",["geometryType","subtypeField","subtypes","type"])],n.prototype,"readTemplatesFromService",null),i([o({type:String,json:{write:{ignoreOrigin:!0}}})],n.prototype,"title",void 0),i([I("service","title",["subtypes"])],n.prototype,"readTitleFromService",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"url",null),i([o({readOnly:!0})],n.prototype,"userHasUpdateItemPrivileges",null),i([o({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],n.prototype,"visible",void 0),n=i([H("esri.layers.support.SubtypeSublayer")],n);const _=(e,t,r)=>{if(!r)return t.createQuery();const s=B.from(r);return s.where=Y(s.where,e.subtypeField,t.subtypeCode),s},Y=(e,t,r)=>{const s=new RegExp(`${t}\\s*=\\s*\\d+`),l=`${t}=${r}`,a=e??"";return s.test(a)?a.replace(s,l):q(l,a)},h=e=>new b(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),T=n,m="SubtypeGroupLayer",vt="esri.layers.SubtypeGroupLayer";function G(e,t){return new b("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const x=k();let p=class extends Oe(Se(we(Ce(je($e(ve(Ee(Te(Q(Fe(ge(V(be))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(L.ofType(T)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=se(async(t,r,s)=>{const{save:l,saveAs:a}=await P(()=>import("./featureLayerUtils-BlPdhYbm-2gXi28Q5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);switch(t){case E.SAVE:return l(this,r);case E.SAVE_AS:return a(this,s,r)}}),this.addHandles(oe(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),ne))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(ae).then(async()=>{if(!this.url)throw new b("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new b("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>Ge(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){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"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return Ve(this)}get parsedUrl(){const e=le(this.url);return e!=null&&this.layerId!=null&&(e.path=pe(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?_e(this.url,t):t}async addAttachment(e,t){const r=await He(this,e,t,m);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const s=await Qe(this,e,t,r,m);return this.lastEditsEventDate=new Date,s}async applyEdits(e,t){return Ne(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await ue(P(()=>import("./FeatureLayerSource-k4WMYop1-BFUwA-tw.js"),__vite__mapDeps([16,2,3,1,4,17,18,19,20,21,22,23,11,12,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,14,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=N(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=q(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await Ue(this,e,t,m);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return ke(this,e,m)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const s=U(this,e);if(s)return s}const r=Me(this,t?.feature);if(r){const s=r.domains?.[e];return s?.type==="inherited"?this._getLayerDomain(e):s}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return fe(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return Be(this,e,t,m)}async queryFeatures(e,t){const r=await this.load(),s=B.from(e)??r.createQuery(),l=s.outFields??[];l.includes(this.subtypeField)||(l.push(this.subtypeField),s.outFields=l);const a=await r.source.queryFeatures(s,t);if(a?.features)for(const u of a.features)u.layer=u.sourceLayer=this.findSublayerForFeature(u);return a}async queryObjectIds(e,t){return Je(this,e,t,m)}async queryFeatureCount(e,t){return Xe(this,e,t,m)}async queryExtent(e,t){return Ye(this,e,t,m)}async queryRelatedFeatures(e,t){return ze(this,e,t,m)}async queryRelatedFeaturesCount(e,t){return Ke(this,e,t,m)}async save(e){return this._debouncedSaveOperations(E.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(E.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:s,messages:l}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&s!=="tables")return l?.push(G(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&s==="tables")return l?.push(G(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(l?.push(new b("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&&ut(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new b("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),de(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return We(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.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.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(r=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),e.on("after-remove",({item:r})=>{r.parent=null,this._sublayerLookup.delete(r.subtypeCode)})],"sublayers-owner"))}};i([o({readOnly:!0})],p.prototype,"createQueryVersion",null),i([o({readOnly:!0})],p.prototype,"editingEnabled",null),i([o({readOnly:!0})],p.prototype,"effectiveEditingEnabled",null),i([o({...x.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],p.prototype,"fields",void 0),i([o(x.fieldsIndex)],p.prototype,"fieldsIndex",void 0),i([o(Re)],p.prototype,"id",void 0),i([o({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],p.prototype,"listMode",void 0),i([o({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],p.prototype,"operationalLayerType",void 0),i([o(x.outFields)],p.prototype,"outFields",void 0),i([o({readOnly:!0})],p.prototype,"parsedUrl",null),i([o({clonable:!1})],p.prototype,"source",null),i([o({type:L.ofType(T),json:{origins:{service:{read:{source:"subtypes",reader(e,t,r){let s=null;if(this.useUniqueColorsForSublayers){const a=dt(t,r);s=a?ct(e.length,a):null}const l=e.map(({code:a},u)=>{const d=new T({subtypeCode:a});d.read(t,r);const y=s?.[u];return y&&d.read({drawingInfo:{renderer:y.toJSON()}},r),d});return new(L.ofType(T))(l)}}}},name:"layers",write:{ignoreOrigin:!0}}})],p.prototype,"sublayers",void 0),i([o()],p.prototype,"useUniqueColorsForSublayers",void 0),i([o({type:pt})],p.prototype,"timeInfo",void 0),i([o({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],p.prototype,"title",void 0),i([I("service","title",["name"])],p.prototype,"readTitleFromService",null),i([o({json:{read:!1}})],p.prototype,"type",void 0),p=i([H(vt)],p);const Rr=p;export{Rr as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./featureLayerUtils-BlPdhYbm-B3ZkIjKd.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./utils-BVWK2jiA-i-Dn2Ad8.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./PortalItem-CctGdnxF-CfFOGshS.js","./jsonContext-BA8GHqVk-BsXRY5es.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./saveUtils-CIYk-dsQ-Br9QCJTX.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./fetchService-DbaKmJhP-Ccg-phWf.js","./FeatureLayerSource-k4WMYop1-B19OqXBO.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js","./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js","./vec32-D9GsKZ1t-BPSFE14A.js","./common-CYWrYyJl-E8-sukrT.js","./External-D_wl4XAw-DrOy4LUr.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-Bbqagf1g.js","./mat4-DX7gBViE-6clJxb1Q.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./quat-BODLR7mS-BQk2dgMZ.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec42-D8CJyqHG-DnfLTeQH.js","./editingSupport-gUqP9iyf-C_ld1skV.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./EditBusLayer-Df29OyJh-OmdJOLws.js","./clientSideDefaults-BqqayPct-Vv2Kv9CL.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./QueryTask-CwHwH2rS-D4f5dsGo.js","./Query-BrwMGK8U-BPr0_G9t.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./executeForIds-Z1gkLduF-CrWEksFG.js","./query-DFW9-NG_-C3TyGmiM.js","./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js","./pbf-D-y3_eZO-CpHdkhuD.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./queryZScale-BiYV6Pr6-B7zp5L1G.js","./executeQueryPBF-o8010HS9-B7Z-YQyg.js","./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js","./FeatureSet-BkVNthuN-DPQqwkNN.js","./executeQueryJSON-CcHnccia-M-vnTvKl.js","./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js","./jsonUtils-C64Zfu7c-BtrwAD3_.js","./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js","./RendererLegendOptions-K3md58-X-JLOOdHLz.js","./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js","./colorRamps-q0bZVhs2-BnivlaV9.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-tyrXoPjU.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js","./styleUtils-BtpNqZyT-Bnq2S5kK.js","./LRUCache-C3erQTWv-grHgYSP-.js","./Version-CoKzbupV-BDyz4v43.js","./FieldsIndex-HmzMbJQG-Du7S47uJ.js","./UnknownTimeZone-C--TOcPG-9of9030I.js","./OverrideHelper-DWRbVlj1-BnPmqHJ3.js","./colorUtils-Cthpxcks-cHaMZbaf.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-CiwW7WzR.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-DFYZs_ns.js","./heatmapUtils-seiMkkkR-CrSLbaQx.js","./RelationshipQuery-DJsz3K0U-BKFa46R1.js","./editsZScale-BDsX6vv--C-4n90TZ.js"])))=>i.map(i=>d[i]); +import{_ as P}from"./main-QGPoLsvl.js";import{ct as K,aa as V,bR as W,bT as D,P as v,dK as Z,a1 as ee,J as te,o as b,bV as q,v as i,S as o,ac as re,bL as ie,a0 as I,i as H,ag as L,bp as se,ah as oe,av as ne,W as ae,a as le,bX as pe,a_ as ue,dL as de,jS as ye,hG as ce,jT as he,aB as me}from"./story-Doly9N9p.js";import{y as fe}from"./loadAll-e978YItg-4pMG3qU7.js";import{m as Q}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as be}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{a as ve}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{u as we}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as Fe}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{C as Se}from"./EditBusLayer-Df29OyJh-OmdJOLws.js";import{H as Ie,$ as Oe}from"./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as Te}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as $e}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as je}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{x as Ce}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{I as _e}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{J as xe,Y as Le,_ as Ae,t as qe,n as Pe,X as De,e as Re}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{t as N,s as U,c as Ge,l as Ve,Q as He,$ as Qe,U as Ne,_ as Ue,z as ke,o as Me,B as Be,H as Je,K as Xe,X as Ye,W as ze,Y as Ke,e as We}from"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import{f as k}from"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import{E as Ze,d as et,o as tt}from"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{p as $}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{X as rt}from"./colorUtils-Cthpxcks-cHaMZbaf.js";import{u as it}from"./cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js";import{x as st,C as ot}from"./utils-DPtQ14k3-CBDffBYM.js";import{p as M}from"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import{C as nt,q as at}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{b as B}from"./Query-BrwMGK8U-BPr0_G9t.js";import{w as lt}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import{w as pt}from"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import{a as ut}from"./versionUtils-LZYZz-38-B8C5OAjF.js";import{E}from"./interfaces-Cwm0pihk-Ptzy6gTd.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";const J={key:"type",base:Ze,errorContext:"renderer",typeMap:{simple:$,"unique-value":et,"class-breaks":tt}},A=K({types:J});function dt(e,t){const r=e.drawingInfo?.renderer,s=r?A(r,e,t):null;if(s?.type==="simple")return st(s.symbol,null)?s.symbol.clone():null}const yt=["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"];function ct(e,t){return rt(yt,e,{offset:!0,shuffle:!0}).reverse().map(r=>{const s=t.clone();return s.type==="cim"?it(s,r):ot(s,r),new $({symbol:s})})}const R=k();let ht=0;function S(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function mt(e){return new $({symbol:ft(e)})}function ft(e){switch(e){case"point":case"multipoint":return he.clone();case"polyline":return ce.clone();case"polygon":case"multipatch":return ye.clone();default:return null}}function bt(e,t){return!!t&&e?.type==="unique-value"&&e.field!=null&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function X(e,t){return e==null?null:t.subtypes?.find(r=>r.code===e)}function gt(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 s={},l=X(e,t);if(l!=null){const{defaultValues:a}=l;for(const u in a)s[u]=a[u]}return s[t.subtypeField]=e,new M({name:"New Feature",drawingTool:r,prototype:{attributes:s}})}let n=class extends Q(V(W(me))){constructor(e){super(e),this.attributeTableTemplate=null,this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${ht++}`,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.parent=null,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}load(e){return D(this.renderer,this.fieldsIndex),Promise.resolve(this)}get capabilities(){return this.parent?.capabilities}get effectiveCapabilities(){return this.parent?.effectiveCapabilities}get effectiveEditingEnabled(){const{parent:e}=this;return e?e.effectiveEditingEnabled&&this.editingEnabled:this.editingEnabled}get elevationInfo(){return this.parent?.elevationInfo}writeFieldOverrides(e,t,r){const{fields:s,parent:l}=this;let a;if(s){a=[];let u=0;s.forEach(({name:d,alias:y,editable:w,visible:F})=>{if(!F)return;const c=l?.fields?.find(j=>j.name===d);if(!c)return;const f={name:d};let g=!1;y!==c.alias&&(f.alias=y,g=!0),w!==c.editable&&(f.editable=w,g=!0),a.push(f),g&&u++}),u===0&&a.length===s.length&&(a=null)}else a=v(e);a?.length&&Z(r,a,t)}get fields(){const{parent:e,fieldOverrides:t,subtypeCode:r}=this,s=e?.fields;if(!e||!s?.length)return null;const{subtypes:l,subtypeField:a}=e,u=l?.find(F=>F.code===r),d=u?.defaultValues,y=u?.domains,w=[];for(const F of s){const c=F.clone(),{name:f}=c,g=t?.find(O=>O.name===f);if(c.visible=!t||!!g,g){const{alias:O,editable:z}=g;O&&(c.alias=O),z===!1&&(c.editable=!1)}const j=d?.[f]??null;c.defaultValue=f===a?r:j;const C=y?.[f]??null;c.domain=f===a?null:C?C.type==="inherited"?c.domain:C.clone():null,w.push(c)}return w}get floorInfo(){return this.parent?.floorInfo}get geometryType(){return this.parent?.geometryType}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get objectIdField(){return this.parent||ee.getLogger(this).error(h("objectIdField")),this.parent?.objectIdField}get defaultPopupTemplate(){return this.createPopupTemplate()}get relationships(){return this.parent?.relationships}set renderer(e){D(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"?mt(e.geometryType):null}readRendererFromService(e,t,r){if(t.type==="Table")return null;const s=t.drawingInfo?.renderer,l=A(s,t,r);let a;const{subtypeCode:u}=this;if(u!=null&&bt(l,t.subtypeField)){const d=l.uniqueValueInfos?.find(({value:y})=>(y=typeof y=="number"?String(y):y)===String(u));d&&(a=new $({symbol:d.symbol}))}else l?.type!=="simple"||l.visualVariables?.length||(a=l);return a}readRenderer(e,t,r){const s=t?.layerDefinition?.drawingInfo?.renderer;return s?s.visualVariables?.some(l=>l.type!=="rotationInfo")?void 0:A(s,t,r)||void 0:void 0}get spatialReference(){return this.parent?.spatialReference??te.WGS84}get subtypeField(){return this.parent?.subtypeField}readTemplatesFromService(e,t){return[gt(this.subtypeCode,t)]}readTitleFromService(e,t){const r=X(this.subtypeCode,t);return r!=null?r.name:null}get url(){return this.parent?.url}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}async addAttachment(e,t){const{parent:r}=this;if(!r)throw h("addAttachment");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:addAttachment","The feature provided does not belong to this SubtypeSublayer");return r.addAttachment(e,t)}async updateAttachment(e,t,r){const{parent:s}=this;if(!s)throw h("updateAttachment");if(e.getAttribute(s.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:updateAttachment","The feature provided does not belong to this SubtypeSublayer");return s.updateAttachment(e,t,r)}async deleteAttachments(e,t){const{parent:r}=this;if(!r)throw h("deleteAttachments");if(e.getAttribute(r.subtypeField)!==this.subtypeCode)throw new b("subtype-sublayer:deleteAttachments","The feature provided does not belong to this SubtypeSublayer");return r.deleteAttachments(e,t)}async applyEdits(e,t){if(!this.parent)throw h("applyEdits");return this.parent.applyEdits(e,t)}createPopupTemplate(e){let t=this;const{parent:r,fields:s,title:l}=this;if(r){const{displayField:a,editFieldsInfo:u,objectIdField:d}=r;t={displayField:a,editFieldsInfo:u,fields:s,objectIdField:d,title:l}}return lt(t,e)}createQuery(){if(!this.parent)throw h("createQuery");const e=N(this.parent),t=`${this.parent.subtypeField}=${this.subtypeCode}`;return e.where=q(t,this.parent.definitionExpression),e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains&&this.parent){const r=U(this.parent,e);if(r)return r}return this._getLayerDomain(e)}async queryAttachments(e,t){const r=await this.load();if(!r.parent)throw h("queryAttachments");const s=e.clone();return s.where=Y(s.where,r.parent.subtypeField,r.subtypeCode),r.parent.queryAttachments(e,t)}async queryFeatureCount(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatureCount");return r.parent.queryFeatureCount(_(r.parent,r,e),t)}async queryFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryFeatures");return r.parent.queryFeatures(_(r.parent,r,e),t)}async queryObjectIds(e,t){const r=await this.load();if(!r.parent)throw h("queryObjectIds");return r.parent.queryObjectIds(_(r.parent,r,e),t)}async queryRelatedFeatures(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeatures");return r.parent.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){const r=await this.load();if(!r.parent)throw h("queryRelatedFeaturesCount");return r.parent.queryRelatedFeaturesCount(e,t)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([o({type:xe,json:{name:"attributeTableInfo",write:{ignoreOrigin:!0}}})],n.prototype,"attributeTableTemplate",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"capabilities",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"effectiveCapabilities",null),i([o({json:{write:{ignoreOrigin:!0}}})],n.prototype,"charts",void 0),i([o({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],n.prototype,"editingEnabled",void 0),i([o({type:Boolean,readOnly:!0})],n.prototype,"effectiveEditingEnabled",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"elevationInfo",null),i([o({json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],n.prototype,"fieldOverrides",void 0),i([re("fieldOverrides")],n.prototype,"writeFieldOverrides",null),i([o({...R.fields,readOnly:!0,json:{read:!1}})],n.prototype,"fields",null),i([o(R.fieldsIndex)],n.prototype,"fieldsIndex",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"floorInfo",null),i([o({type:Ie,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],n.prototype,"formTemplate",void 0),i([o({type:String,clonable:!1,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"id",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"geometryType",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"type",void 0),i([o(S(v(Le)))],n.prototype,"labelsVisible",void 0),i([o({type:[nt],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:at},write:{ignoreOrigin:!0}}})],n.prototype,"labelingInfo",void 0),i([o({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],n.prototype,"layerType",void 0),i([o(S(v(Ae)))],n.prototype,"legendEnabled",void 0),i([o({type:["show","hide"]})],n.prototype,"listMode",void 0),i([o((()=>{const e=v(qe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"minScale",void 0),i([o((()=>{const e=v(Pe);return e.json.origins.service.read=!1,S(e)})())],n.prototype,"maxScale",void 0),i([o({readOnly:!0})],n.prototype,"effectiveScaleRange",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"objectIdField",null),i([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],n.prototype,"opacity",void 0),i([o({clonable:!1})],n.prototype,"parent",void 0),i([o(S(v(De)))],n.prototype,"popupEnabled",void 0),i([o({type:ie,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],n.prototype,"popupTemplate",void 0),i([o({readOnly:!0})],n.prototype,"defaultPopupTemplate",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"relationships",null),i([o({types:J,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],n.prototype,"renderer",null),i([I("service","renderer",["drawingInfo.renderer","subtypeField","type"])],n.prototype,"readRendererFromService",null),i([I("renderer",["layerDefinition.drawingInfo.renderer"])],n.prototype,"readRenderer",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"spatialReference",null),i([o({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],n.prototype,"subtypeCode",void 0),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"subtypeField",null),i([o({type:[M],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],n.prototype,"templates",void 0),i([I("service","templates",["geometryType","subtypeField","subtypes","type"])],n.prototype,"readTemplatesFromService",null),i([o({type:String,json:{write:{ignoreOrigin:!0}}})],n.prototype,"title",void 0),i([I("service","title",["subtypes"])],n.prototype,"readTitleFromService",null),i([o({readOnly:!0,json:{read:!1}})],n.prototype,"url",null),i([o({readOnly:!0})],n.prototype,"userHasUpdateItemPrivileges",null),i([o({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],n.prototype,"visible",void 0),n=i([H("esri.layers.support.SubtypeSublayer")],n);const _=(e,t,r)=>{if(!r)return t.createQuery();const s=B.from(r);return s.where=Y(s.where,e.subtypeField,t.subtypeCode),s},Y=(e,t,r)=>{const s=new RegExp(`${t}\\s*=\\s*\\d+`),l=`${t}=${r}`,a=e??"";return s.test(a)?a.replace(s,l):q(l,a)},h=e=>new b(`This sublayer must have a parent SubtypeGroupLayer in order to use ${e}`),T=n,m="SubtypeGroupLayer",vt="esri.layers.SubtypeGroupLayer";function G(e,t){return new b("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const x=k();let p=class extends Oe(Se(we(Ce(je($e(ve(Ee(Te(Q(Fe(ge(V(be))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(L.ofType(T)),this.useUniqueColorsForSublayers=!0,this.supportedSourceTypes=new Set(["Feature Layer"]),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this._debouncedSaveOperations=se(async(t,r,s)=>{const{save:l,saveAs:a}=await P(()=>import("./featureLayerUtils-BlPdhYbm-B3ZkIjKd.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]),import.meta.url);switch(t){case E.SAVE:return l(this,r);case E.SAVE_AS:return a(this,s,r)}}),this.addHandles(oe(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),ne))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(ae).then(async()=>{if(!this.url)throw new b("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new b("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>Ge(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){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"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return Ve(this)}get parsedUrl(){const e=le(this.url);return e!=null&&this.layerId!=null&&(e.path=pe(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?_e(this.url,t):t}async addAttachment(e,t){const r=await He(this,e,t,m);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const s=await Qe(this,e,t,r,m);return this.lastEditsEventDate=new Date,s}async applyEdits(e,t){return Ne(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await ue(P(()=>import("./FeatureLayerSource-k4WMYop1-B19OqXBO.js"),__vite__mapDeps([16,2,3,1,4,17,18,19,20,21,22,23,11,12,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,14,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]),import.meta.url),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){const e=N(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=q(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){const r=await Ue(this,e,t,m);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return ke(this,e,m)}findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.findSublayerForSubtypeCode(r)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){const s=U(this,e);if(s)return s}const r=Me(this,t?.feature);if(r){const s=r.domains?.[e];return s?.type==="inherited"?this._getLayerDomain(e):s}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}loadAll(){return fe(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return Be(this,e,t,m)}async queryFeatures(e,t){const r=await this.load(),s=B.from(e)??r.createQuery(),l=s.outFields??[];l.includes(this.subtypeField)||(l.push(this.subtypeField),s.outFields=l);const a=await r.source.queryFeatures(s,t);if(a?.features)for(const u of a.features)u.layer=u.sourceLayer=this.findSublayerForFeature(u);return a}async queryObjectIds(e,t){return Je(this,e,t,m)}async queryFeatureCount(e,t){return Xe(this,e,t,m)}async queryExtent(e,t){return Ye(this,e,t,m)}async queryRelatedFeatures(e,t){return ze(this,e,t,m)}async queryRelatedFeaturesCount(e,t){return Ke(this,e,t,m)}async save(e){return this._debouncedSaveOperations(E.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(E.SAVE_AS,t,e)}write(e,t){const{origin:r,layerContainerType:s,messages:l}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&s!=="tables")return l?.push(G(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&s==="tables")return l?.push(G(this,"using a non-table source cannot be written to tables in web maps")),null;return this.sublayers?.length?super.write(e,t):(l?.push(new b("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&&ut(this,e)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),!this.subtypes?.length)throw new b("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),de(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return We(this)}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||this.fields?.some(t=>t.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.removeHandles("sublayers-owner"),this._sublayerLookup.clear()),e&&(e.forEach(r=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),this.addHandles([e.on("after-add",({item:r})=>{r.parent=this,this._sublayerLookup.set(r.subtypeCode,r)}),e.on("after-remove",({item:r})=>{r.parent=null,this._sublayerLookup.delete(r.subtypeCode)})],"sublayers-owner"))}};i([o({readOnly:!0})],p.prototype,"createQueryVersion",null),i([o({readOnly:!0})],p.prototype,"editingEnabled",null),i([o({readOnly:!0})],p.prototype,"effectiveEditingEnabled",null),i([o({...x.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],p.prototype,"fields",void 0),i([o(x.fieldsIndex)],p.prototype,"fieldsIndex",void 0),i([o(Re)],p.prototype,"id",void 0),i([o({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],p.prototype,"listMode",void 0),i([o({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],p.prototype,"operationalLayerType",void 0),i([o(x.outFields)],p.prototype,"outFields",void 0),i([o({readOnly:!0})],p.prototype,"parsedUrl",null),i([o({clonable:!1})],p.prototype,"source",null),i([o({type:L.ofType(T),json:{origins:{service:{read:{source:"subtypes",reader(e,t,r){let s=null;if(this.useUniqueColorsForSublayers){const a=dt(t,r);s=a?ct(e.length,a):null}const l=e.map(({code:a},u)=>{const d=new T({subtypeCode:a});d.read(t,r);const y=s?.[u];return y&&d.read({drawingInfo:{renderer:y.toJSON()}},r),d});return new(L.ofType(T))(l)}}}},name:"layers",write:{ignoreOrigin:!0}}})],p.prototype,"sublayers",void 0),i([o()],p.prototype,"useUniqueColorsForSublayers",void 0),i([o({type:pt})],p.prototype,"timeInfo",void 0),i([o({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],p.prototype,"title",void 0),i([I("service","title",["name"])],p.prototype,"readTitleFromService",null),i([o({json:{read:!1}})],p.prototype,"type",void 0),p=i([H(vt)],p);const Rr=p;export{Rr as default}; diff --git a/custom-toc-highlight/assets/SubtypeGroupLayerView2D-Byn0xzbb-DtCv0vxF.js b/custom-toc-highlight/assets/SubtypeGroupLayerView2D-Byn0xzbb-DtCv0vxF.js new file mode 100644 index 00000000..8ebb8ea6 --- /dev/null +++ b/custom-toc-highlight/assets/SubtypeGroupLayerView2D-Byn0xzbb-DtCv0vxF.js @@ -0,0 +1,7 @@ +import{v as s,i as d,ah as n,aL as u,K as l}from"./story-Doly9N9p.js";import{r as g}from"./FeatureLayerView2D-NmRd_IhT-DLbw0NYz.js";import"./main-QGPoLsvl.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./timeSupport-ohWmWReZ-D2lpSlXU.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./LayerView-Bish-E63-DK1SFHE3.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./SDFHelper-B6k8Ig6R-CgiA_-9V.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-BYG2KoFf.js";import"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";let i=class extends g{initialize(){this.addHandles([n(()=>this.view.scale,()=>this._update(),u)],"constructor")}isUpdating(){const t=this.layer.sublayers.some(a=>a.renderer!=null),r=this._commandsQueue.updateTracking.updating,o=this._updatingRequiredFieldsPromise!=null,p=!this._workerProxy,m=this.dataUpdating,e=t&&(r||o||p||m);return l("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${e} + -> hasRenderer ${t} + -> hasPendingCommand ${r} + -> updatingRequiredFields ${o} + -> updatingProxy ${p} + -> updatingPipeline ${m} +`),e}};i=s([d("esri.views.2d.layers.SubtypeGroupLayerView2D")],i);const gt=i;export{gt as default}; diff --git a/custom-toc-highlight/assets/SubtypeGroupLayerView2D-Byn0xzbb-Qz-0ZBbK.js b/custom-toc-highlight/assets/SubtypeGroupLayerView2D-Byn0xzbb-Qz-0ZBbK.js deleted file mode 100644 index a3ec42d7..00000000 --- a/custom-toc-highlight/assets/SubtypeGroupLayerView2D-Byn0xzbb-Qz-0ZBbK.js +++ /dev/null @@ -1,7 +0,0 @@ -import{v as s,i as d,ah as n,aL as u,K as l}from"./story-BfX8CRfG.js";import{r as g}from"./FeatureLayerView2D-NmRd_IhT-CufQiRFK.js";import"./main-ugzBrWNm.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./timeSupport-ohWmWReZ-ByDHlqgT.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./LayerView-Bish-E63-rB2WUWF4.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./SDFHelper-B6k8Ig6R-BNeqNf2Z.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./HighlightCounter-DFWq7PnG-L3ompOf4.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./popupUtils-nV1O8RUO-DAL58cHP.js";import"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";let i=class extends g{initialize(){this.addHandles([n(()=>this.view.scale,()=>this._update(),u)],"constructor")}isUpdating(){const t=this.layer.sublayers.some(a=>a.renderer!=null),r=this._commandsQueue.updateTracking.updating,o=this._updatingRequiredFieldsPromise!=null,p=!this._workerProxy,m=this.dataUpdating,e=t&&(r||o||p||m);return l("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${e} - -> hasRenderer ${t} - -> hasPendingCommand ${r} - -> updatingRequiredFields ${o} - -> updatingProxy ${p} - -> updatingPipeline ${m} -`),e}};i=s([d("esri.views.2d.layers.SubtypeGroupLayerView2D")],i);const gt=i;export{gt as default}; diff --git a/custom-toc-highlight/assets/TablesMixin-C8RojhYs-AdFcW_TR.js b/custom-toc-highlight/assets/TablesMixin-C8RojhYs-LCBvmsnP.js similarity index 96% rename from custom-toc-highlight/assets/TablesMixin-C8RojhYs-AdFcW_TR.js rename to custom-toc-highlight/assets/TablesMixin-C8RojhYs-LCBvmsnP.js index caff1784..7645bca1 100644 --- a/custom-toc-highlight/assets/TablesMixin-C8RojhYs-AdFcW_TR.js +++ b/custom-toc-highlight/assets/TablesMixin-C8RojhYs-LCBvmsnP.js @@ -1 +1 @@ -import{f as c}from"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import{v as l,S as h,i as p,ag as u,a1 as i,am as f,t as m}from"./story-BfX8CRfG.js";import{D as b}from"./Layer-ChoECxvZ-CQTFmFQa.js";function x(o){return new c({getCollections:()=>[o.tables,o.layers],getChildrenFunction:s=>{const e=[];return"tables"in s&&e.push(s.tables),"layers"in s&&e.push(s.layers),e},itemFilterFunction:s=>{const e=s.parent;return!!e&&"tables"in e&&e.tables.includes(s)}})}function $(o){for(const s of o.values())s?.destroy();o.clear()}function d(o,s,e){let r,a;if(o)for(let n=0,t=o.length;n{let s=class extends o{constructor(...e){super(...e),this.layers=new u;const r=t=>{t.parent&&"remove"in t.parent&&t.parent.remove(t)},a=t=>{t.parent=this,this.layerAdded(t),t.type!=="elevation"&&t.type!=="base-elevation"||i.getLogger(this).error(`Layer 'title:${t.title}, id:${t.id}' of type '${t.type}' is not supported as an operational layer and will therefore be ignored.`)},n=t=>{t.parent=null,this.layerRemoved(t)};this.addHandles([this.layers.on("before-add",t=>{if(t.item===this)return t.preventDefault(),void i.getLogger(this).error("#add()","Cannot add layer to itself.");r(t.item)}),this.layers.on("after-add",t=>a(t.item)),this.layers.on("after-remove",t=>n(t.item))])}destroy(){const e=this.layers.toArray();for(const r of e)r.destroy();this.layers.destroy()}set layers(e){this._set("layers",f(e,this._get("layers")))}add(e,r){const a=this.layers;if(r=a.getNextIndex(r),e instanceof b){const n=e;n.parent===this?this.reorder(n,r):a.add(n,r)}else m(e)?e.then(n=>{this.destroyed||this.add(n,r)}):i.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(e,r){const a=this.layers;let n=a.getNextIndex(r);e.slice().forEach(t=>{t.parent!==this?(a.add(t,n),n+=1):this.reorder(t,n)})}findLayerById(e){return d(this.layers,"id",e)}findLayerByUid(e){return d(this.layers,"uid",e)}remove(e){return this.layers.remove(e)}removeMany(e){return this.layers.removeMany(e)}removeAll(){return this.layers.removeAll()}reorder(e,r){return this.layers.reorder(e,r)}layerAdded(e){}layerRemoved(e){}};return l([h()],s.prototype,"layers",null),s=l([p("esri.support.LayersMixin")],s),s};function y(o,s,e){if(o)for(let r=0,a=o.length;r{let s=class extends o{constructor(...e){super(...e),this.tables=new u,this.addHandles([this.tables.on("after-add",r=>{const a=r.item;a.parent&&a.parent!==this&&"tables"in a.parent&&a.parent.tables.remove(a),a.parent=this,a.type!=="feature"&&i.getLogger(this).error(`Layer 'title:${a.title}, id:${a.id}' of type '${a.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",r=>{r.item.parent=null})])}destroy(){const e=this.tables.toArray();for(const r of e)r.destroy();this.tables.destroy()}set tables(e){this._set("tables",f(e,this._get("tables")))}findTableById(e){return y(this.tables,"id",e)}findTableByUid(e){return y(this.tables,"uid",e)}};return l([h()],s.prototype,"tables",null),s=l([p("esri.support.TablesMixin")],s),s};export{A as L,x as g,$ as v,w as x}; +import{f as c}from"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import{v as l,S as h,i as p,ag as u,a1 as i,am as f,t as m}from"./story-Doly9N9p.js";import{D as b}from"./Layer-ChoECxvZ-BmDHBjO8.js";function x(o){return new c({getCollections:()=>[o.tables,o.layers],getChildrenFunction:s=>{const e=[];return"tables"in s&&e.push(s.tables),"layers"in s&&e.push(s.layers),e},itemFilterFunction:s=>{const e=s.parent;return!!e&&"tables"in e&&e.tables.includes(s)}})}function $(o){for(const s of o.values())s?.destroy();o.clear()}function d(o,s,e){let r,a;if(o)for(let n=0,t=o.length;n{let s=class extends o{constructor(...e){super(...e),this.layers=new u;const r=t=>{t.parent&&"remove"in t.parent&&t.parent.remove(t)},a=t=>{t.parent=this,this.layerAdded(t),t.type!=="elevation"&&t.type!=="base-elevation"||i.getLogger(this).error(`Layer 'title:${t.title}, id:${t.id}' of type '${t.type}' is not supported as an operational layer and will therefore be ignored.`)},n=t=>{t.parent=null,this.layerRemoved(t)};this.addHandles([this.layers.on("before-add",t=>{if(t.item===this)return t.preventDefault(),void i.getLogger(this).error("#add()","Cannot add layer to itself.");r(t.item)}),this.layers.on("after-add",t=>a(t.item)),this.layers.on("after-remove",t=>n(t.item))])}destroy(){const e=this.layers.toArray();for(const r of e)r.destroy();this.layers.destroy()}set layers(e){this._set("layers",f(e,this._get("layers")))}add(e,r){const a=this.layers;if(r=a.getNextIndex(r),e instanceof b){const n=e;n.parent===this?this.reorder(n,r):a.add(n,r)}else m(e)?e.then(n=>{this.destroyed||this.add(n,r)}):i.getLogger(this).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(e,r){const a=this.layers;let n=a.getNextIndex(r);e.slice().forEach(t=>{t.parent!==this?(a.add(t,n),n+=1):this.reorder(t,n)})}findLayerById(e){return d(this.layers,"id",e)}findLayerByUid(e){return d(this.layers,"uid",e)}remove(e){return this.layers.remove(e)}removeMany(e){return this.layers.removeMany(e)}removeAll(){return this.layers.removeAll()}reorder(e,r){return this.layers.reorder(e,r)}layerAdded(e){}layerRemoved(e){}};return l([h()],s.prototype,"layers",null),s=l([p("esri.support.LayersMixin")],s),s};function y(o,s,e){if(o)for(let r=0,a=o.length;r{let s=class extends o{constructor(...e){super(...e),this.tables=new u,this.addHandles([this.tables.on("after-add",r=>{const a=r.item;a.parent&&a.parent!==this&&"tables"in a.parent&&a.parent.tables.remove(a),a.parent=this,a.type!=="feature"&&i.getLogger(this).error(`Layer 'title:${a.title}, id:${a.id}' of type '${a.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",r=>{r.item.parent=null})])}destroy(){const e=this.tables.toArray();for(const r of e)r.destroy();this.tables.destroy()}set tables(e){this._set("tables",f(e,this._get("tables")))}findTableById(e){return y(this.tables,"id",e)}findTableByUid(e){return y(this.tables,"uid",e)}};return l([h()],s.prototype,"tables",null),s=l([p("esri.support.TablesMixin")],s),s};export{A as L,x as g,$ as v,w as x}; diff --git a/custom-toc-highlight/assets/TechniqueInstance-DGTKoOL6-ftnhwAAz.js b/custom-toc-highlight/assets/TechniqueInstance-DGTKoOL6-CABoCcdk.js similarity index 95% rename from custom-toc-highlight/assets/TechniqueInstance-DGTKoOL6-ftnhwAAz.js rename to custom-toc-highlight/assets/TechniqueInstance-DGTKoOL6-CABoCcdk.js index 081bfdec..f41c23d1 100644 --- a/custom-toc-highlight/assets/TechniqueInstance-DGTKoOL6-ftnhwAAz.js +++ b/custom-toc-highlight/assets/TechniqueInstance-DGTKoOL6-CABoCcdk.js @@ -1 +1 @@ -import{K as c,o as E,a1 as S}from"./story-BfX8CRfG.js";import{a as h,P as v,V as F,U,f as M,A as L,L as O,O as k,T as R}from"./definitions-DJSdSb77-DkoRHaVx.js";import{Z as T}from"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import{v as x,C as B}from"./LabelMetric-BeluzH3o-C3fDXNzp.js";import{G as w,M as A}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as $}from"./Program-DLVwTiPA-C1hIaFuM.js";import{H as D,V as z}from"./Texture-BCt2hphT-hC4XzHg_.js";import{h as P}from"./TileContainer-D48pXXgL-CdMiwPkS.js";const G=()=>S.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:n,textureOnly:o}=t,a=x(n);this.blockIndex=i,this.pixelType=n,this.size=e,this.textureOnly=o,o||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&(t==="0"&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new D;return t.wrapMode=w.CLAMP_TO_EDGE,t.samplingMode=A.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=T(t),n=this.data,o=s*this.texelSize+e;!n||o>=n.length||(n[o]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(this.data==null)return null;const i=T(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=e===0?this.getTexture(t):this._textureDesc;this._fbos[e]=new $(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){try{const i=this.dirtyStart,s=this.dirtyEnd;if(!this.hasDirty)return;c("esri-2d-update-debug")&&console.debug(`Version[${e}] AttributeStoreView.updateTexture`,{start:i,end:s,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,o=this.getTexture(t),a=4,u=(i-i%this.size)/this.size,d=(s-s%this.size)/this.size,l=u,f=this.size,p=d,_=u*this.size*a,g=(f+p*this.size)*a-_,b=x(this.pixelType),I=new b(n,_*b.BYTES_PER_ELEMENT,g),V=this.size,y=p-l+1;if(y>this.size)return void G().error(new E("mapview-webgl","Out-of-bounds index when updating AttributeData"));o.updateData(0,0,l,V,y,I)}catch{}}update(t){const{data:e,start:i,end:s}=t;if(e!=null&&this.data!=null){const n=this.data,o=i*this.texelSize;for(let a=0;ai!=null?new m(i,this.size,s):null);else for(let i=0;ir.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(r){r.context.capabilities.enable("textureFloatLinear"),super.doRender(r)}get hasAnimations(){for(const r of this.children)if(r.hasAnimations)return!0;return!1}_reindexAndUpdateFeaturesIfNeeded(){if(this.hasAnimations&&(this._reindexFeatures(),this.attributeView.size!==0))for(const r of this._entityIndex.values())r.dirty&&(this.attributeView.setData(r.displayId,h.LocalTimeOrigin,0,r.firstIndexed),r.dirty=!1)}restartAnimation(r){const t=this._entityIndex.get(r);if(!t)return;const e=performance.now()/1e3;t.firstIndexed=e,t.dirty=!0}restartAllAnimations(){const r=performance.now()/1e3;for(const[t,e]of this._entityIndex)e.firstIndexed=r,e.dirty=!0}_reindexFeatures(){const r=performance.now()/1e3;for(const t of this.children)for(const e of t.entityIds){const{objectId:i}=e;let s=this._entityIndex.get(i);s||(s={objectId:i,displayId:0,firstIndexed:r,lastIndexed:0,dirty:!0},this._entityIndex.set(i,s)),s.lastIndexed=r,s.displayId=e.displayId}for(const[t,e]of this._entityIndex)r-e.lastIndexed>q&&this._entityIndex.delete(t)}_updateAttributeView(){this.attributeView.update(),this._reindexAndUpdateFeaturesIfNeeded()}createRenderParams(r){const t=super.createRenderParams(r);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}};function X(r){return r}class tt{constructor(t,e,i){this._instanceId=t,this.techniqueRef=e,this._input=i}get instanceId(){return this._instanceId}createMeshInfo(t){return{id:this._instanceId,techniqueType:this.techniqueRef.type,inputParams:t,optionalAttributes:this._input.optionalAttributes}}getInput(){return this._input}setInput(t){this._input=t}}export{X as G,tt as Z,W as j}; +import{K as c,o as E,a1 as S}from"./story-Doly9N9p.js";import{a as h,P as v,V as F,U,f as M,A as L,L as O,O as k,T as R}from"./definitions-DJSdSb77-DkoRHaVx.js";import{Z as T}from"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import{v as x,C as B}from"./LabelMetric-BeluzH3o-Br-5CSAC.js";import{G as w,M as A}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{G as $}from"./Program-DLVwTiPA-DI0GKSfI.js";import{H as D,V as z}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{h as P}from"./TileContainer-D48pXXgL-BzDz3Uqo.js";const G=()=>S.getLogger("esri.views.2d.engine.webgl.AttributeStoreView");class m{constructor(t,e,i){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:s,pixelType:n,textureOnly:o}=t,a=x(n);this.blockIndex=i,this.pixelType=n,this.size=e,this.textureOnly=o,o||(this.data=new a(s)),this._resetRange()}destroy(){this._texture?.dispose();for(const t in this._fbos){const e=this._fbos[t];e&&(t==="0"&&e.detachColorTexture(),e.dispose()),this._fbos[t]=null}this._texture=null}get _textureDesc(){const t=new D;return t.wrapMode=w.CLAMP_TO_EDGE,t.samplingMode=A.NEAREST,t.dataType=this.pixelType,t.width=this.size,t.height=this.size,t}setData(t,e,i){const s=T(t),n=this.data,o=s*this.texelSize+e;!n||o>=n.length||(n[o]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s))}getData(t,e){if(this.data==null)return null;const i=T(t)*this.texelSize+e;return!this.data||i>=this.data.length?null:this.data[i]}getTexture(t){return this._texture??this._initTexture(t)}getFBO(t,e=0){if(!this._fbos[e]){const i=e===0?this.getTexture(t):this._textureDesc;this._fbos[e]=new $(t,i)}return this._fbos[e]}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){try{const i=this.dirtyStart,s=this.dirtyEnd;if(!this.hasDirty)return;c("esri-2d-update-debug")&&console.debug(`Version[${e}] AttributeStoreView.updateTexture`,{start:i,end:s,firstBytes:new Uint8Array(this.data.buffer.slice(0,16)),block:this}),this._resetRange();const n=this.data.buffer,o=this.getTexture(t),a=4,u=(i-i%this.size)/this.size,d=(s-s%this.size)/this.size,l=u,f=this.size,p=d,_=u*this.size*a,g=(f+p*this.size)*a-_,b=x(this.pixelType),I=new b(n,_*b.BYTES_PER_ELEMENT,g),V=this.size,y=p-l+1;if(y>this.size)return void G().error(new E("mapview-webgl","Out-of-bounds index when updating AttributeData"));o.updateData(0,0,l,V,y,I)}catch{}}update(t){const{data:e,start:i,end:s}=t;if(e!=null&&this.data!=null){const n=this.data,o=i*this.texelSize;for(let a=0;ai!=null?new m(i,this.size,s):null);else for(let i=0;ir.destroy()),this.removeAllChildren(),this.attributeView.destroy()}doRender(r){r.context.capabilities.enable("textureFloatLinear"),super.doRender(r)}get hasAnimations(){for(const r of this.children)if(r.hasAnimations)return!0;return!1}_reindexAndUpdateFeaturesIfNeeded(){if(this.hasAnimations&&(this._reindexFeatures(),this.attributeView.size!==0))for(const r of this._entityIndex.values())r.dirty&&(this.attributeView.setData(r.displayId,h.LocalTimeOrigin,0,r.firstIndexed),r.dirty=!1)}restartAnimation(r){const t=this._entityIndex.get(r);if(!t)return;const e=performance.now()/1e3;t.firstIndexed=e,t.dirty=!0}restartAllAnimations(){const r=performance.now()/1e3;for(const[t,e]of this._entityIndex)e.firstIndexed=r,e.dirty=!0}_reindexFeatures(){const r=performance.now()/1e3;for(const t of this.children)for(const e of t.entityIds){const{objectId:i}=e;let s=this._entityIndex.get(i);s||(s={objectId:i,displayId:0,firstIndexed:r,lastIndexed:0,dirty:!0},this._entityIndex.set(i,s)),s.lastIndexed=r,s.displayId=e.displayId}for(const[t,e]of this._entityIndex)r-e.lastIndexed>q&&this._entityIndex.delete(t)}_updateAttributeView(){this.attributeView.update(),this._reindexAndUpdateFeaturesIfNeeded()}createRenderParams(r){const t=super.createRenderParams(r);return t.attributeView=this.attributeView,t.instanceStore=this._instanceStore,t.statisticsByLevel=this._statisticsByLevel,t}};function X(r){return r}class tt{constructor(t,e,i){this._instanceId=t,this.techniqueRef=e,this._input=i}get instanceId(){return this._instanceId}createMeshInfo(t){return{id:this._instanceId,techniqueType:this.techniqueRef.type,inputParams:t,optionalAttributes:this._input.optionalAttributes}}getInput(){return this._input}setInput(t){this._input=t}}export{X as G,tt as Z,W as j}; diff --git a/custom-toc-highlight/assets/TelemetryDisplay-Bq2PXfI8-Z2CK355L.js b/custom-toc-highlight/assets/TelemetryDisplay-Bq2PXfI8-BY_FrklG.js similarity index 90% rename from custom-toc-highlight/assets/TelemetryDisplay-Bq2PXfI8-Z2CK355L.js rename to custom-toc-highlight/assets/TelemetryDisplay-Bq2PXfI8-BY_FrklG.js index 17927b37..c48c8116 100644 --- a/custom-toc-highlight/assets/TelemetryDisplay-Bq2PXfI8-Z2CK355L.js +++ b/custom-toc-highlight/assets/TelemetryDisplay-Bq2PXfI8-BY_FrklG.js @@ -1 +1 @@ -import{aa as l,v as o,S as t,i as s,e as i}from"./story-BfX8CRfG.js";let e=class extends l(i){constructor(r){super(r),this.frame=null,this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};o([t({type:Boolean})],e.prototype,"frame",void 0),o([t({type:Boolean})],e.prototype,"frameCenter",void 0),o([t({type:Boolean})],e.prototype,"frameOutline",void 0),o([t({type:Boolean})],e.prototype,"lineOfSight",void 0),o([t({type:Boolean})],e.prototype,"sensorLocation",void 0),o([t({type:Boolean})],e.prototype,"sensorTrail",void 0),e=o([s("esri.layers.support.TelemetryDisplay")],e);const a=e;export{a}; +import{aa as l,v as o,S as t,i as s,e as i}from"./story-Doly9N9p.js";let e=class extends l(i){constructor(r){super(r),this.frame=null,this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};o([t({type:Boolean})],e.prototype,"frame",void 0),o([t({type:Boolean})],e.prototype,"frameCenter",void 0),o([t({type:Boolean})],e.prototype,"frameOutline",void 0),o([t({type:Boolean})],e.prototype,"lineOfSight",void 0),o([t({type:Boolean})],e.prototype,"sensorLocation",void 0),o([t({type:Boolean})],e.prototype,"sensorTrail",void 0),e=o([s("esri.layers.support.TelemetryDisplay")],e);const a=e;export{a}; diff --git a/custom-toc-highlight/assets/TemporalLayer-CpOrN_w9-BDEJ3v2O.js b/custom-toc-highlight/assets/TemporalLayer-CpOrN_w9-8nvJFP_-.js similarity index 78% rename from custom-toc-highlight/assets/TemporalLayer-CpOrN_w9-BDEJ3v2O.js rename to custom-toc-highlight/assets/TemporalLayer-CpOrN_w9-8nvJFP_-.js index 519c8c70..84ab4ea2 100644 --- a/custom-toc-highlight/assets/TemporalLayer-CpOrN_w9-BDEJ3v2O.js +++ b/custom-toc-highlight/assets/TemporalLayer-CpOrN_w9-8nvJFP_-.js @@ -1 +1 @@ -import{v as t,S as i,a0 as a,i as l,dL as u}from"./story-BfX8CRfG.js";import{s as d}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{r as m,w as y,v as w}from"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import{k as x}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";const O={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:d}}},T=p=>{let e=class extends p{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(o,f){const r=f.timeInfo.exportOptions;if(!r)return null;const n=r.timeOffset,s=w.fromJSON(r.timeOffsetUnits);return n&&s?new m({value:n,unit:s}):null}set timeInfo(o){u(o,this.fieldsIndex),this._set("timeInfo",o)}};return t([i({type:x,json:{write:!1}})],e.prototype,"timeExtent",void 0),t([i({type:m})],e.prototype,"timeOffset",void 0),t([a("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),t([i({value:null,type:y,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),t([i(O)],e.prototype,"useViewTime",void 0),e=t([l("esri.layers.mixins.TemporalLayer")],e),e};export{O as m,T as x}; +import{v as t,S as i,a0 as a,i as l,dL as u}from"./story-Doly9N9p.js";import{s as d}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{r as m,w as y,v as w}from"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import{k as x}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";const O={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:d}}},T=p=>{let e=class extends p{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(o,f){const r=f.timeInfo.exportOptions;if(!r)return null;const n=r.timeOffset,s=w.fromJSON(r.timeOffsetUnits);return n&&s?new m({value:n,unit:s}):null}set timeInfo(o){u(o,this.fieldsIndex),this._set("timeInfo",o)}};return t([i({type:x,json:{write:!1}})],e.prototype,"timeExtent",void 0),t([i({type:m})],e.prototype,"timeOffset",void 0),t([a("service","timeOffset",["timeInfo.exportOptions"])],e.prototype,"readOffset",null),t([i({value:null,type:y,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],e.prototype,"timeInfo",null),t([i(O)],e.prototype,"useViewTime",void 0),e=t([l("esri.layers.mixins.TemporalLayer")],e),e};export{O as m,T as x}; diff --git a/custom-toc-highlight/assets/Texture-BCt2hphT-hC4XzHg_.js b/custom-toc-highlight/assets/Texture-BCt2hphT-Dk2JyWCy.js similarity index 99% rename from custom-toc-highlight/assets/Texture-BCt2hphT-hC4XzHg_.js rename to custom-toc-highlight/assets/Texture-BCt2hphT-Dk2JyWCy.js index dcfaea65..00d5fd97 100644 --- a/custom-toc-highlight/assets/Texture-BCt2hphT-hC4XzHg_.js +++ b/custom-toc-highlight/assets/Texture-BCt2hphT-Dk2JyWCy.js @@ -1 +1 @@ -import{K as $,o as p,a1 as Y}from"./story-BfX8CRfG.js";import{P as I,U as d,F as G,M as E,G as z,V as B,B as a,t as T,I as M,H as x,S as k}from"./enums-DBi1-Mm2-CUS1pvQe.js";const K=()=>Y.getLogger("esri.views.webgl.checkWebGLError");function q(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.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 t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const X=!!$("enable-feature:webgl-debug");function H(){return X}function ce(){return X}function N(t){if(H()){const e=t.getError();if(e){const r=q(t,e),o=new Error().stack;K().error(new p("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}var O;(function(t){t[t.Texture=0]="Texture",t[t.RenderBuffer=1]="RenderBuffer"})(O||(O={}));function j(t){switch(t){case M.BYTE:case M.UNSIGNED_BYTE:return 1;case M.SHORT:case M.UNSIGNED_SHORT:case M.HALF_FLOAT:return 2;case M.FLOAT:case M.INT:case M.UNSIGNED_INT:return 4}}function Q(t){const e=t.gl;switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case e.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case e.INVALID_OPERATION:return"The specified command is not allowed for the current state";case e.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case e.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case e.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function le(t,e,r,o,s=0){const n=t.gl;t.bindBuffer(r);for(const i of o){const c=e.get(i.name);if(c==null){console.warn(`There is no location for vertex attribute '${i.name}' defined.`);continue}const _=s*i.stride;if(i.count<=4)n.vertexAttribPointer(c,i.count,i.type,i.normalized,i.stride,i.offset+_),n.enableVertexAttribArray(c),i.divisor>0&&t.gl.vertexAttribDivisor(c,i.divisor);else if(i.count===9)for(let l=0;l<3;l++)n.vertexAttribPointer(c+l,3,i.type,i.normalized,i.stride,i.offset+12*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl.vertexAttribDivisor(c+l,i.divisor);else if(i.count===16)for(let l=0;l<4;l++)n.vertexAttribPointer(c+l,4,i.type,i.normalized,i.stride,i.offset+16*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl?.vertexAttribDivisor(c+l,i.divisor);else console.error("Unsupported vertex attribute element count: "+i.count);if(H()){const l=Q(t),h=j(i.type),u=i.offset,m=Math.round(h/u)!==h/u?`. Offset not a multiple of stride. DataType requires ${h} bytes, but descriptor has an offset of ${u}`:"";l&&console.error(`Unable to bind vertex attribute "${i.name}" with baseInstanceOffset ${_}${m}:`,l,i)}}}function _e(t,e,r,o){const s=t.gl;t.bindBuffer(r);for(const n of o){const i=e.get(n.name);if(n.count<=4)s.disableVertexAttribArray(i),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i,0);else if(n.count===9)for(let c=0;c<3;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else if(n.count===16)for(let c=0;c<4;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else console.error("Unsupported vertex attribute element count: "+n.count)}t.unbindBuffer(k.ARRAY_BUFFER)}function Z(t){switch(t){case d.ALPHA:case d.LUMINANCE:case d.RED:case d.RED_INTEGER:case a.R8:case a.R8I:case a.R8UI:case a.R8_SNORM:case x.STENCIL_INDEX8:return 1;case d.LUMINANCE_ALPHA:case d.RG:case d.RG_INTEGER:case a.RGBA4:case a.R16F:case a.R16I:case a.R16UI:case a.RG8:case a.RG8I:case a.RG8UI:case a.RG8_SNORM:case a.RGB565:case a.RGB5_A1:case x.DEPTH_COMPONENT16:return 2;case d.DEPTH_COMPONENT:case d.RGB:case d.RGB_INTEGER:case a.RGB8:case a.RGB8I:case a.RGB8UI:case a.RGB8_SNORM:case a.SRGB8:case x.DEPTH_COMPONENT24:return 3;case d.DEPTH_STENCIL:case d.DEPTH24_STENCIL8:case d.RGBA:case d.RGBA_INTEGER:case a.RGBA8:case a.R32F:case a.R11F_G11F_B10F:case a.RG16F:case a.R32I:case a.R32UI:case a.RG16I:case a.RG16UI:case a.RGBA8I:case a.RGBA8UI:case a.RGBA8_SNORM:case a.SRGB8_ALPHA8:case a.RGB9_E5:case a.RGB10_A2UI:case a.RGB10_A2:case x.DEPTH_STENCIL:case x.DEPTH_COMPONENT32F:case x.DEPTH24_STENCIL8:return 4;case x.DEPTH32F_STENCIL8:return 5;case a.RGB16F:case a.RGB16I:case a.RGB16UI:return 6;case a.RG32F:case a.RG32I:case a.RG32UI:case a.RGBA16F:case a.RGBA16I:case a.RGBA16UI:return 8;case a.RGB32F:case a.RGB32I:case a.RGB32UI:return 12;case a.RGBA32F:case a.RGBA32I:case a.RGBA32UI:return 16;case T.COMPRESSED_RGB_S3TC_DXT1_EXT:case T.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case T.COMPRESSED_RGBA_S3TC_DXT3_EXT:case T.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case T.COMPRESSED_R11_EAC:case T.COMPRESSED_SIGNED_R11_EAC:case T.COMPRESSED_RGB8_ETC2:case T.COMPRESSED_SRGB8_ETC2:case T.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case T.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case T.COMPRESSED_RG11_EAC:case T.COMPRESSED_SIGNED_RG11_EAC:case T.COMPRESSED_RGBA8_ETC2_EAC:case T.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}let J=class{constructor(t=0,e=t){this.width=t,this.height=e,this.target=I.TEXTURE_2D,this.pixelFormat=d.RGBA,this.dataType=G.UNSIGNED_BYTE,this.samplingMode=E.LINEAR,this.wrapMode=z.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}};function ee(t){return t.width<=0||t.height<=0?0:Math.round(t.width*t.height*(t.hasMipmap?4/3:1)*(t.internalFormat==null?4:Z(t.internalFormat))*(t.target===I.TEXTURE_CUBE_MAP?6:1))}class F extends J{constructor(e,r){switch(super(),this.context=e,Object.assign(this,r),this.internalFormat){case a.R16F:case a.R16I:case a.R16UI:case a.R32F:case a.R32I:case a.R32UI:case a.R8_SNORM:case a.R8:case a.R8I:case a.R8UI:this.pixelFormat=d.RED}}static validate(e,r){return new F(e,r)}}let te=class g{constructor(e,r=null,o=null){if(this.type=O.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,o=r;else{const s=F.validate(e,r);if(!s)throw new p("Texture descriptor invalid");this._descriptor=s}this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(o):this.setData(o)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return ee(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(B.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,r){const o=this._descriptor;if(o.width!==e||o.height!==r){if(this._wasImmutablyAllocated)throw new p("Immutable textures can't be resized!");o.width=e,o.height=r,this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let r=I.TEXTURE_CUBE_MAP_POSITIVE_X;r<=I.TEXTURE_CUBE_MAP_NEGATIVE_Z;r++)this._setData(e,r)}setData(e){this._setData(e)}_setData(e,r){const o=this._descriptor.context?.gl;if(!o)return;N(o),this._glName||(this._glName=o.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(B.Texture,this));const s=this._descriptor,n=r??s.target,i=S(n),c=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),P(s),this._configurePixelStorage(),N(o);const _=this._deriveInternalFormat();if(v(e)){let l="width"in e?e.width:e.codedWidth,h="height"in e?e.height:e.codedHeight;const u=1;e instanceof HTMLVideoElement&&(l=e.videoWidth,h=e.videoHeight),s.width&&s.height,i&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&(this.generateMipmap(),N(o)),s.width||(s.width=l),s.height||(s.height=h),i&&!s.depth&&(s.depth=u)}else{const{width:l,height:h,depth:u}=s;if(l==null||h==null)throw new p("Width and height must be specified!");if(i&&u==null)throw new p("Depth must be specified!");if(s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),U(e)){const m=e.levels,R=y(n,l,h,u),D=Math.min(R-1,m.length-1);o.texParameteri(s.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,D);const f=_;if(!se(f))throw new p("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((A,b,w,V)=>{const W=m[Math.min(A,m.length-1)];this._compressedTexImage(n,A,f,b,w,V,W)},D)}else this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&this.generateMipmap()}C(o,this._descriptor),L(o,this._descriptor),re(this._descriptor.context,this._descriptor),N(o),this._descriptor.context.bindTexture(c,g.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,r,o,s,n,i,c=0){i||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const _=this._descriptor,l=this._deriveInternalFormat(),{context:h,pixelFormat:u,dataType:m,target:R,isImmutable:D}=_;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");const f=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||r+s>_.width||o+n>_.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:A}=h;c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,c),v(i)?A.texSubImage2D(R,e,r,o,s,n,u,m,i):U(i)?A.compressedTexSubImage2D(R,e,r,o,s,n,l,i.levels[e]):A.texSubImage2D(R,e,r,o,s,n,u,m,i),c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,0),h.bindTexture(f,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,r,o,s,n,i,c,_){_||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor,h=this._deriveInternalFormat(),{context:u,pixelFormat:m,dataType:R,isImmutable:D,target:f}=l;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");S(f)||console.warn("Attempting to set 3D texture data on a non-3D texture");const A=u.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||s<0||r+n>l.width||o+i>l.height||s+c>l.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:b}=u;if(U(_))_=_.levels[e],b.compressedTexSubImage3D(f,e,r,o,s,n,i,c,h,_);else{const w=_;b.texSubImage3D(f,e,r,o,s,n,i,c,m,R,w)}u.bindTexture(A,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR_MIPMAP_NEAREST):e.samplingMode===E.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(r,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR):e.samplingMode===E.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,P(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,r=e.context.gl;this._samplingModeDirty&&(C(r,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(L(r,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===d.DEPTH_STENCIL&&(this._descriptor.internalFormat=d.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case G.FLOAT:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA32F;case d.RGB:return this._descriptor.internalFormat=a.RGB32F;default:throw new p("Unable to derive format")}case G.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA8;case d.RGB:return this._descriptor.internalFormat=a.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===d.DEPTH_STENCIL?d.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:r,flipped:o,preMultiplyAlpha:s}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s?1:0)}_texStorage(e,r,o,s,n,i){const{gl:c}=this._descriptor.context;if(!ie(r))throw new p("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const _=o?y(e,s,n,i):1;if(S(e)){if(i==null)throw new p("Missing depth dimension for 3D texture upload");c.texStorage3D(e,_,r,s,n,i)}else c.texStorage2D(e,_,r,s,n);this._wasImmutablyAllocated=!0}_texImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e),{isImmutable:h,pixelFormat:u,dataType:m}=this._descriptor;if(h){if(c!=null){const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texSubImage3D(e,r,0,0,0,s,n,i,u,m,R)}else _.texSubImage2D(e,r,0,0,s,n,u,m,R)}}else{const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texImage3D(e,r,o,s,n,i,0,u,m,R)}else _.texImage2D(e,r,o,s,n,0,u,m,R)}}_compressedTexImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e);if(this._descriptor.isImmutable){if(c!=null)if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexSubImage3D(e,r,0,0,0,s,n,i,o,c)}else _.compressedTexSubImage2D(e,r,0,0,s,n,o,c)}else if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexImage3D(e,r,o,s,n,i,0,c)}else _.compressedTexImage2D(e,r,o,s,n,0,c)}_forEachMipmapLevel(e,r=1/0){let{width:o,height:s,depth:n,hasMipmap:i,target:c}=this._descriptor;const _=c===I.TEXTURE_3D;if(o==null||s==null||_&&n==null)throw new p("Missing texture dimensions for mipmap calculation");for(let l=0;e(l,o,s,n),i&&(o!==1||s!==1||_&&n!==1)&&!(l>=r);++l)o=Math.max(1,o>>1),s=Math.max(1,s>>1),_&&(n=Math.max(1,n>>1))}};function P(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!")}function C(t,e){let r=e.samplingMode,o=e.samplingMode;r===E.LINEAR_MIPMAP_NEAREST||r===E.LINEAR_MIPMAP_LINEAR?(r=E.LINEAR,e.hasMipmap||(o=E.LINEAR)):r!==E.NEAREST_MIPMAP_NEAREST&&r!==E.NEAREST_MIPMAP_LINEAR||(r=E.NEAREST,e.hasMipmap||(o=E.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,o)}function L(t,e){typeof e.wrapMode=="number"?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}function re(t,e){const r=t.capabilities.textureFilterAnisotropic;r&&t.gl.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function ie(t){return t in a}function se(t){return t in T}function U(t){return t!=null&&"type"in t&&t.type==="compressed"}function ae(t){return t!=null&&"byteLength"in t}function v(t){return t!=null&&!U(t)&&!ae(t)}function S(t){return t===I.TEXTURE_3D||t===I.TEXTURE_2D_ARRAY}function y(t,e,r,o=1){let s=Math.max(e,r);return t===I.TEXTURE_3D&&(s=Math.max(s,o)),Math.round(Math.log(s)/Math.LN2)+1}te.TEXTURE_UNIT_FOR_UPDATES=0;export{H as F,F as G,J as H,N,O as P,te as V,Z as X,_e as i,le as r,ce as t,j as v,Q as y}; +import{K as $,o as p,a1 as Y}from"./story-Doly9N9p.js";import{P as I,U as d,F as G,M as E,G as z,V as B,B as a,t as T,I as M,H as x,S as k}from"./enums-DBi1-Mm2-CUS1pvQe.js";const K=()=>Y.getLogger("esri.views.webgl.checkWebGLError");function q(t,e){switch(e){case t.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case t.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case t.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case t.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 t.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case t.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const X=!!$("enable-feature:webgl-debug");function H(){return X}function ce(){return X}function N(t){if(H()){const e=t.getError();if(e){const r=q(t,e),o=new Error().stack;K().error(new p("webgl-error","WebGL error occurred",{message:r,stack:o}))}}}var O;(function(t){t[t.Texture=0]="Texture",t[t.RenderBuffer=1]="RenderBuffer"})(O||(O={}));function j(t){switch(t){case M.BYTE:case M.UNSIGNED_BYTE:return 1;case M.SHORT:case M.UNSIGNED_SHORT:case M.HALF_FLOAT:return 2;case M.FLOAT:case M.INT:case M.UNSIGNED_INT:return 4}}function Q(t){const e=t.gl;switch(e.getError()){case e.NO_ERROR:return null;case e.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case e.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case e.INVALID_OPERATION:return"The specified command is not allowed for the current state";case e.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case e.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case e.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function le(t,e,r,o,s=0){const n=t.gl;t.bindBuffer(r);for(const i of o){const c=e.get(i.name);if(c==null){console.warn(`There is no location for vertex attribute '${i.name}' defined.`);continue}const _=s*i.stride;if(i.count<=4)n.vertexAttribPointer(c,i.count,i.type,i.normalized,i.stride,i.offset+_),n.enableVertexAttribArray(c),i.divisor>0&&t.gl.vertexAttribDivisor(c,i.divisor);else if(i.count===9)for(let l=0;l<3;l++)n.vertexAttribPointer(c+l,3,i.type,i.normalized,i.stride,i.offset+12*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl.vertexAttribDivisor(c+l,i.divisor);else if(i.count===16)for(let l=0;l<4;l++)n.vertexAttribPointer(c+l,4,i.type,i.normalized,i.stride,i.offset+16*l+_),n.enableVertexAttribArray(c+l),i.divisor>0&&t.gl?.vertexAttribDivisor(c+l,i.divisor);else console.error("Unsupported vertex attribute element count: "+i.count);if(H()){const l=Q(t),h=j(i.type),u=i.offset,m=Math.round(h/u)!==h/u?`. Offset not a multiple of stride. DataType requires ${h} bytes, but descriptor has an offset of ${u}`:"";l&&console.error(`Unable to bind vertex attribute "${i.name}" with baseInstanceOffset ${_}${m}:`,l,i)}}}function _e(t,e,r,o){const s=t.gl;t.bindBuffer(r);for(const n of o){const i=e.get(n.name);if(n.count<=4)s.disableVertexAttribArray(i),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i,0);else if(n.count===9)for(let c=0;c<3;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else if(n.count===16)for(let c=0;c<4;c++)s.disableVertexAttribArray(i+c),n.divisor&&n.divisor>0&&t.gl?.vertexAttribDivisor(i+c,0);else console.error("Unsupported vertex attribute element count: "+n.count)}t.unbindBuffer(k.ARRAY_BUFFER)}function Z(t){switch(t){case d.ALPHA:case d.LUMINANCE:case d.RED:case d.RED_INTEGER:case a.R8:case a.R8I:case a.R8UI:case a.R8_SNORM:case x.STENCIL_INDEX8:return 1;case d.LUMINANCE_ALPHA:case d.RG:case d.RG_INTEGER:case a.RGBA4:case a.R16F:case a.R16I:case a.R16UI:case a.RG8:case a.RG8I:case a.RG8UI:case a.RG8_SNORM:case a.RGB565:case a.RGB5_A1:case x.DEPTH_COMPONENT16:return 2;case d.DEPTH_COMPONENT:case d.RGB:case d.RGB_INTEGER:case a.RGB8:case a.RGB8I:case a.RGB8UI:case a.RGB8_SNORM:case a.SRGB8:case x.DEPTH_COMPONENT24:return 3;case d.DEPTH_STENCIL:case d.DEPTH24_STENCIL8:case d.RGBA:case d.RGBA_INTEGER:case a.RGBA8:case a.R32F:case a.R11F_G11F_B10F:case a.RG16F:case a.R32I:case a.R32UI:case a.RG16I:case a.RG16UI:case a.RGBA8I:case a.RGBA8UI:case a.RGBA8_SNORM:case a.SRGB8_ALPHA8:case a.RGB9_E5:case a.RGB10_A2UI:case a.RGB10_A2:case x.DEPTH_STENCIL:case x.DEPTH_COMPONENT32F:case x.DEPTH24_STENCIL8:return 4;case x.DEPTH32F_STENCIL8:return 5;case a.RGB16F:case a.RGB16I:case a.RGB16UI:return 6;case a.RG32F:case a.RG32I:case a.RG32UI:case a.RGBA16F:case a.RGBA16I:case a.RGBA16UI:return 8;case a.RGB32F:case a.RGB32I:case a.RGB32UI:return 12;case a.RGBA32F:case a.RGBA32I:case a.RGBA32UI:return 16;case T.COMPRESSED_RGB_S3TC_DXT1_EXT:case T.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case T.COMPRESSED_RGBA_S3TC_DXT3_EXT:case T.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case T.COMPRESSED_R11_EAC:case T.COMPRESSED_SIGNED_R11_EAC:case T.COMPRESSED_RGB8_ETC2:case T.COMPRESSED_SRGB8_ETC2:case T.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case T.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case T.COMPRESSED_RG11_EAC:case T.COMPRESSED_SIGNED_RG11_EAC:case T.COMPRESSED_RGBA8_ETC2_EAC:case T.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}let J=class{constructor(t=0,e=t){this.width=t,this.height=e,this.target=I.TEXTURE_2D,this.pixelFormat=d.RGBA,this.dataType=G.UNSIGNED_BYTE,this.samplingMode=E.LINEAR,this.wrapMode=z.REPEAT,this.maxAnisotropy=1,this.flipped=!1,this.hasMipmap=!1,this.isOpaque=!1,this.unpackAlignment=4,this.preMultiplyAlpha=!1,this.depth=1,this.isImmutable=!1}};function ee(t){return t.width<=0||t.height<=0?0:Math.round(t.width*t.height*(t.hasMipmap?4/3:1)*(t.internalFormat==null?4:Z(t.internalFormat))*(t.target===I.TEXTURE_CUBE_MAP?6:1))}class F extends J{constructor(e,r){switch(super(),this.context=e,Object.assign(this,r),this.internalFormat){case a.R16F:case a.R16I:case a.R16UI:case a.R32F:case a.R32I:case a.R32UI:case a.R8_SNORM:case a.R8:case a.R8I:case a.R8UI:this.pixelFormat=d.RED}}static validate(e,r){return new F(e,r)}}let te=class g{constructor(e,r=null,o=null){if(this.type=O.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,"context"in e)this._descriptor=e,o=r;else{const s=F.validate(e,r);if(!s)throw new p("Texture descriptor invalid");this._descriptor=s}this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(o):this.setData(o)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return ee(this._descriptor)}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(B.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,r){const o=this._descriptor;if(o.width!==e||o.height!==r){if(this._wasImmutablyAllocated)throw new p("Immutable textures can't be resized!");o.width=e,o.height=r,this._descriptor.target===I.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let r=I.TEXTURE_CUBE_MAP_POSITIVE_X;r<=I.TEXTURE_CUBE_MAP_NEGATIVE_Z;r++)this._setData(e,r)}setData(e){this._setData(e)}_setData(e,r){const o=this._descriptor.context?.gl;if(!o)return;N(o),this._glName||(this._glName=o.createTexture(),this._glName&&this._descriptor.context.instanceCounter.increment(B.Texture,this));const s=this._descriptor,n=r??s.target,i=S(n),c=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),P(s),this._configurePixelStorage(),N(o);const _=this._deriveInternalFormat();if(v(e)){let l="width"in e?e.width:e.codedWidth,h="height"in e?e.height:e.codedHeight;const u=1;e instanceof HTMLVideoElement&&(l=e.videoWidth,h=e.videoHeight),s.width&&s.height,i&&s.depth,s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&(this.generateMipmap(),N(o)),s.width||(s.width=l),s.height||(s.height=h),i&&!s.depth&&(s.depth=u)}else{const{width:l,height:h,depth:u}=s;if(l==null||h==null)throw new p("Width and height must be specified!");if(i&&u==null)throw new p("Depth must be specified!");if(s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(n,_,s.hasMipmap,l,h,u),U(e)){const m=e.levels,R=y(n,l,h,u),D=Math.min(R-1,m.length-1);o.texParameteri(s.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,D);const f=_;if(!se(f))throw new p("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((A,b,w,V)=>{const W=m[Math.min(A,m.length-1)];this._compressedTexImage(n,A,f,b,w,V,W)},D)}else this._texImage(n,0,_,l,h,u,e),N(o),s.hasMipmap&&this.generateMipmap()}C(o,this._descriptor),L(o,this._descriptor),re(this._descriptor.context,this._descriptor),N(o),this._descriptor.context.bindTexture(c,g.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,r,o,s,n,i,c=0){i||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const _=this._descriptor,l=this._deriveInternalFormat(),{context:h,pixelFormat:u,dataType:m,target:R,isImmutable:D}=_;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");const f=h.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||o<0||r+s>_.width||o+n>_.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:A}=h;c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,c),v(i)?A.texSubImage2D(R,e,r,o,s,n,u,m,i):U(i)?A.compressedTexSubImage2D(R,e,r,o,s,n,l,i.levels[e]):A.texSubImage2D(R,e,r,o,s,n,u,m,i),c&&A.pixelStorei(A.UNPACK_SKIP_ROWS,0),h.bindTexture(f,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,r,o,s,n,i,c,_){_||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._descriptor,h=this._deriveInternalFormat(),{context:u,pixelFormat:m,dataType:R,isImmutable:D,target:f}=l;if(D&&!this._wasImmutablyAllocated)throw new p("Cannot update immutable texture before allocation!");S(f)||console.warn("Attempting to set 3D texture data on a non-3D texture");const A=u.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),(r<0||o<0||s<0||r+n>l.width||o+i>l.height||s+c>l.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:b}=u;if(U(_))_=_.levels[e],b.compressedTexSubImage3D(f,e,r,o,s,n,i,c,h,_);else{const w=_;b.texSubImage3D(f,e,r,o,s,n,i,c,m,R,w)}u.bindTexture(A,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR_MIPMAP_NEAREST):e.samplingMode===E.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(e.target),this._descriptor.context.bindTexture(r,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new p("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,P(e)}e.samplingMode===E.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=E.LINEAR):e.samplingMode===E.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=E.NEAREST)}setSamplingMode(e){e!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=e,this._samplingModeDirty=!0)}setWrapMode(e){e!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=e,P(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._descriptor,r=e.context.gl;this._samplingModeDirty&&(C(r,e),this._samplingModeDirty=!1),this._wrapModeDirty&&(L(r,e),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(this._descriptor.internalFormat!=null)return this._descriptor.internalFormat===d.DEPTH_STENCIL&&(this._descriptor.internalFormat=d.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case G.FLOAT:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA32F;case d.RGB:return this._descriptor.internalFormat=a.RGB32F;default:throw new p("Unable to derive format")}case G.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case d.RGBA:return this._descriptor.internalFormat=a.RGBA8;case d.RGB:return this._descriptor.internalFormat=a.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===d.DEPTH_STENCIL?d.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const e=this._descriptor.context.gl,{unpackAlignment:r,flipped:o,preMultiplyAlpha:s}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,r),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,o?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,s?1:0)}_texStorage(e,r,o,s,n,i){const{gl:c}=this._descriptor.context;if(!ie(r))throw new p("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const _=o?y(e,s,n,i):1;if(S(e)){if(i==null)throw new p("Missing depth dimension for 3D texture upload");c.texStorage3D(e,_,r,s,n,i)}else c.texStorage2D(e,_,r,s,n);this._wasImmutablyAllocated=!0}_texImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e),{isImmutable:h,pixelFormat:u,dataType:m}=this._descriptor;if(h){if(c!=null){const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texSubImage3D(e,r,0,0,0,s,n,i,u,m,R)}else _.texSubImage2D(e,r,0,0,s,n,u,m,R)}}else{const R=c;if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.texImage3D(e,r,o,s,n,i,0,u,m,R)}else _.texImage2D(e,r,o,s,n,0,u,m,R)}}_compressedTexImage(e,r,o,s,n,i,c){const _=this._descriptor.context.gl,l=S(e);if(this._descriptor.isImmutable){if(c!=null)if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexSubImage3D(e,r,0,0,0,s,n,i,o,c)}else _.compressedTexSubImage2D(e,r,0,0,s,n,o,c)}else if(l){if(i==null)throw new p("Missing depth dimension for 3D texture upload");_.compressedTexImage3D(e,r,o,s,n,i,0,c)}else _.compressedTexImage2D(e,r,o,s,n,0,c)}_forEachMipmapLevel(e,r=1/0){let{width:o,height:s,depth:n,hasMipmap:i,target:c}=this._descriptor;const _=c===I.TEXTURE_3D;if(o==null||s==null||_&&n==null)throw new p("Missing texture dimensions for mipmap calculation");for(let l=0;e(l,o,s,n),i&&(o!==1||s!==1||_&&n!==1)&&!(l>=r);++l)o=Math.max(1,o>>1),s=Math.max(1,s>>1),_&&(n=Math.max(1,n>>1))}};function P(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!")}function C(t,e){let r=e.samplingMode,o=e.samplingMode;r===E.LINEAR_MIPMAP_NEAREST||r===E.LINEAR_MIPMAP_LINEAR?(r=E.LINEAR,e.hasMipmap||(o=E.LINEAR)):r!==E.NEAREST_MIPMAP_NEAREST&&r!==E.NEAREST_MIPMAP_LINEAR||(r=E.NEAREST,e.hasMipmap||(o=E.NEAREST)),t.texParameteri(e.target,t.TEXTURE_MAG_FILTER,r),t.texParameteri(e.target,t.TEXTURE_MIN_FILTER,o)}function L(t,e){typeof e.wrapMode=="number"?(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode)):(t.texParameteri(e.target,t.TEXTURE_WRAP_S,e.wrapMode.s),t.texParameteri(e.target,t.TEXTURE_WRAP_T,e.wrapMode.t))}function re(t,e){const r=t.capabilities.textureFilterAnisotropic;r&&t.gl.texParameterf(e.target,r.TEXTURE_MAX_ANISOTROPY,e.maxAnisotropy??1)}function ie(t){return t in a}function se(t){return t in T}function U(t){return t!=null&&"type"in t&&t.type==="compressed"}function ae(t){return t!=null&&"byteLength"in t}function v(t){return t!=null&&!U(t)&&!ae(t)}function S(t){return t===I.TEXTURE_3D||t===I.TEXTURE_2D_ARRAY}function y(t,e,r,o=1){let s=Math.max(e,r);return t===I.TEXTURE_3D&&(s=Math.max(s,o)),Math.round(Math.log(s)/Math.LN2)+1}te.TEXTURE_UNIT_FOR_UPDATES=0;export{H as F,F as G,J as H,N,O as P,te as V,Z as X,_e as i,le as r,ce as t,j as v,Q as y}; diff --git a/custom-toc-highlight/assets/Theme-rblUnB2V-D2UsCNGl.js b/custom-toc-highlight/assets/Theme-rblUnB2V-Dc7wtY6B.js similarity index 99% rename from custom-toc-highlight/assets/Theme-rblUnB2V-D2UsCNGl.js rename to custom-toc-highlight/assets/Theme-rblUnB2V-Dc7wtY6B.js index 6fe2c114..4bf6336a 100644 --- a/custom-toc-highlight/assets/Theme-rblUnB2V-D2UsCNGl.js +++ b/custom-toc-highlight/assets/Theme-rblUnB2V-Dc7wtY6B.js @@ -1 +1 @@ -import{k0 as tt}from"./story-BfX8CRfG.js";class f{constructor(t){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=t}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(t,e){return t+this.value*(e-t)}static normalize(t,e,s){return t instanceof f?t:new f(e===s?0:100*Math.min(Math.max(1/(s-e)*(t-e),0),1))}}function Ot(i){return new f(i)}Ot(0);const qt=Ot(100),te=Ot(50);function Ue(i){return i instanceof f}function Tt(i){return Number(i)!==i}function ee(i){return{}.toString.call(i)}function mt(i){if(i!=null&&!g(i)){let t=Number(i);return Tt(t)&&Ft(i)&&i!=""?mt(i.replace(/[^0-9.\-]+/g,"")):t}return i}function ie(i){if(ft(i))return new Date(i);if(g(i))return new Date(i);{let t=Number(i);return g(t)?new Date(t):new Date(i)}}function Ve(i){if(Tt(i))return"NaN";if(i===1/0)return"Infinity";if(i===-1/0)return"-Infinity";if(i===0&&1/i==-1/0)return"-0";let t=i<0;i=Math.abs(i);let e,s=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+i),r=s[1],n=s[2]||"";if(s[3]===void 0)e=n===""?r:r+"."+n;else{let a=+s[3];if(i<1)e="0."+Ct("0",a-1)+r+n;else{let o=a-n.length;e=o===0?r+n:o<0?r+n.slice(0,o)+"."+n.slice(o):r+n+Ct("0",o)}}return t?"-"+e:e}function Ct(i,t){return new Array(t+1).join(i)}function ft(i){return ee(i)==="[object Date]"}function Ft(i){return typeof i=="string"}function g(i){return typeof i=="number"&&Number(i)==i}function St(i){return typeof i=="object"&&i!==null}const Mt="__§§§__",Ke="__§§§§__";function st(i,t){const e=i.length;for(let s=0;s0;)--e,t(i[e],e)}function ze(i,t){const e=i.length;for(let s=0;s0;)if(--e,t(i[e],e))return e;return-1}function ne(i,t){const e=Ut(i,t);if(e!==-1)return i[e]}function ae(i,t){const e=re(i,t);if(e!==-1)return i[e]}function oe(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:a===0?(r=!0,e=n+1):s=n}return{found:r,index:r?e-1:e}}function he(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:(a===0&&(r=!0),s=n)}return{found:r,index:e}}function $e(i,t){let e=i.length;for(;e>0;)--e,t(i[e])||i.splice(e,1)}function T(i){return Object.keys(i)}function le(i,t){return T(i).sort(t)}function Ze(i){return Object.assign({},i)}function v(i,t){T(i).forEach(e=>{t(e,i[e])})}function Je(i,t){for(let e in i)if(de(i,e)&&!t(e,i[e]))break}function de(i,t){return{}.hasOwnProperty.call(i,t)}class Vt{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class D{constructor(t){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=t}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Qe extends Vt{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){c(this._disposers,t=>{t.dispose()})}}class O extends Vt{constructor(t){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=t}_dispose(){c(this._disposers,t=>{t.dispose()})}get disposers(){return this._disposers}}class ue extends D{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new D(()=>{--this._counter,this._counter===0&&this.dispose()})}}function qe(i){i.parentNode&&i.parentNode.removeChild(i)}function Kt(i,t,e,s){return i.addEventListener(t,e,s||!1),new D(()=>{i.removeEventListener(t,e,s||!1)})}function ti(i){return Kt(window,"resize",t=>{i()})}function ut(i){switch(i){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function pt(i){return i.pointerId||0}function ei(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let i=document.createElement("button");i.style.position="fixed",i.style.top="0px",i.style.left="-10000px",document.body.appendChild(i),i.focus(),i.blur(),document.body.removeChild(i)}}function ii(i){i&&i.focus()}function si(i){if(ut("pointerevents"))return i;if(ut("touchevents"))switch(i){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerleave":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(ut("mouseevents"))switch(i){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerleave":return"mouseleave";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return i}function Bt(i){if(typeof Touch<"u"&&i instanceof Touch)return!0;if(typeof PointerEvent<"u"&&i instanceof PointerEvent&&i.pointerType!=null)switch(i.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(i instanceof MouseEvent)}else if(i.type!=null&&i.type.match(/^mouse/))return!1;return!0}function ri(i,t,e){i.style[t]=e}function ni(i,t){return i.style[t]}function ai(i){if(i.composedPath){const t=i.composedPath();return t.length===0?null:t[0]}return i.target}function pe(i,t){let e=t;for(;;){if(i===e)return!0;if(e.parentNode===null){if(e.host==null)return!1;e=e.host}else e=e.parentNode}}function ce(i,t){return i.target&&pe(t.root.dom,i.target)}function oi(i,t){i.style.pointerEvents=t?"auto":"none"}function hi(i){if(i.key!==void 0)return i.key;switch(i.keyCode){case 9:return"Tab";case 13:return"Enter";case 16:return"Shift";case 17:return"Control";case 27:return"Escape";case 32:return" ";case 37:return"ArrowLeft";case 38:return"ArrowUp";case 39:return"ArrowRight";case 40:return"ArrowDown";case 46:return"Delete"}return""+i.keyCode}function ge(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function li(){return ge()?1:void 0}function M(i,t){return g(i)?i:i!=null&&g(i.value)&&g(t)?t*i.value:0}function di(i){let t=(""+i).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}function ct(i,t=0,e="0"){return typeof i!="string"&&(i=i.toString()),t>i.length?Array(t-i.length+1).join(e)+i:i}function _e(i){return i.replace(/^[\s]*/,"")}function me(i){return i.replace(/[\s]*$/,"")}function vt(i){return _e(me(i))}function fe(i,t,e=!1,s="..."){if(i.length>t){let r=t-1;for(;r>=0&&i.charAt(r).match(/\w/);)r--;return r>=0&&e==0?i.substring(0,r+1)+"...":i.substring(0,t)+s}return i}function ui(i){return i.replace(/\/(date|number|duration)$/i,"")}function pi(i){return i&&i.replace(/<[^>]*>/g,"")}function ci(i){return i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function gi(i){const t=/[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,e=/([^اأدذرزو]*[اأدذرزو])/gi;let s=i.split(/(\s+)/),r=[];return s.forEach(n=>{if(n.match(/^\s+$/))(n=" ")&&(n=" "),r.push(n);else if(t.test(n)){let a=n.split(e).filter(o=>o!=="");r=r.concat(a)}else r=r.concat([...n])}),r}function _i(i,t=!1){const e=new Date(i.getFullYear(),0,0),s=i.getTime()-e.getTime()+60*(e.getTimezoneOffset()-i.getTimezoneOffset())*1e3;return Math.floor(s/864e5)}function Ht(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;e.setUTCDate(e.getUTCDate()+4-s);const r=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-r.getTime())/864e5+1)/7)}function mi(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;return e.setUTCDate(e.getUTCDate()+4-s),new Date(Date.UTC(e.getUTCFullYear(),0,1)).getFullYear()}function fi(i,t=!1){const e=Ht(new Date(i.getFullYear(),i.getMonth(),1),t);let s=Ht(i,t);return s==1&&(s=53),s-e+1}function bi(i,t,e=1,s=!1){let r=new Date(t,0,4,0,0,0,0);return s&&r.setUTCFullYear(t),7*i+e-((r.getDay()||7)+3)}function vi(i,t){return i>12?i-=12:i===0&&(i=12),t!=null?i+(t-1):i}function yi(i,t=!1,e=!1,s=!1,r){if(s)return t?"Coordinated Universal Time":"UTC";if(r){const o=i.toLocaleString("en-US",{timeZone:r});return vt(i.toLocaleString("en-US",{timeZone:r,timeZoneName:t?"long":"short"}).substr(o.length))}let n=i.toLocaleString("UTC"),a=i.toLocaleString("UTC",{timeZoneName:t?"long":"short"}).substr(n.length);return e===!1&&(a=a.replace(/ (standard|daylight|summer|winter) /i," ")),vt(a)}function wi(i){const t=new Date(Date.UTC(2012,0,1,0,0,0,0)),e=new Date(t.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(t.toLocaleString("en-US",{timeZone:i})).getTime()-e.getTime())/6e4*-1}function Pi(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Gt(i){let t,e,s,r=i.h,n=i.s,a=i.l;if(n==0)t=e=s=a;else{let o=function(d,p,u){return u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?d+6*(p-d)*u:u<.5?p:u<.6666666666666666?d+(p-d)*(.6666666666666666-u)*6:d},h=a<.5?a*(1+n):a+n-a*n,l=2*a-h;t=o(l,h,r+1/3),e=o(l,h,r),s=o(l,h,r-1/3)}return{r:Math.round(255*t),g:Math.round(255*e),b:Math.round(255*s)}}function zt(i){let t=i.r/255,e=i.g/255,s=i.b/255,r=Math.max(t,e,s),n=Math.min(t,e,s),a=0,o=0,h=(r+n)/2;if(r===n)a=o=0;else{let l=r-n;switch(o=h>.5?l/(2-r-n):l/(r+n),r){case t:a=(e-s)/l+(e0?255-i:i;return Math.round(e*t)}function ve(i,t){if(i){let e=et(Math.min(Math.max(i.r,i.g,i.b),230),t);return{r:Math.max(0,Math.min(255,Math.round(i.r+e))),g:Math.max(0,Math.min(255,Math.round(i.g+e))),b:Math.max(0,Math.min(255,Math.round(i.b+e))),a:i.a}}return i}function It(i){return(299*i.r+587*i.g+114*i.b)/1e3>=128}function ye(i,t){if(i===void 0||t==1)return i;let e=zt(i);return e.s=t,Gt(e)}function we(i,t={r:255,g:255,b:255},e={r:255,g:255,b:255}){let s=t,r=e;return It(e)&&(s=e,r=t),It(i)?r:s}function Di(i,t){return i||(i=[]),[...i,...t].filter((e,s,r)=>r.indexOf(e)===s)}function xi(i,t){return!!t&&i.left==t.left&&i.right==t.right&&i.top==t.top&&i.bottom==t.bottom}function Yt(i){return i[0]==="#"&&(i=i.substr(1)),i.length==3&&(i=i[0].repeat(2)+i[1].repeat(2)+i[2].repeat(2)),parseInt(i,16)}function Pe(i){let t=(i=i.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(t)t.push("1");else if(t=i.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!t)return 0;let e="";for(let s=1;s<=3;s++){let r=parseInt(t[s]).toString(16);r.length==1&&(r="0"+r),e+=r}return Yt(e)}function ki(i){return y.fromAny(i)}class y{constructor(t){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|t}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(t=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+t+")"}toCSSHex(){return"#"+ct(this.r.toString(16),2)+ct(this.g.toString(16),2)+ct(this.b.toString(16),2)}toHSL(t=1){return zt({r:this.r,g:this.g,b:this.b,a:t})}static fromHSL(t,e,s){const r=Gt({h:t,s:e,l:s});return this.fromRGB(r.r,r.g,r.b)}toString(){return this.toCSSHex()}static fromHex(t){return new y(t)}static fromRGB(t,e,s){return new y((0|s)+(e<<8)+(t<<16))}static fromString(t){return new y(Yt(t))}static fromCSS(t){return new y(Pe(t))}static fromAny(t){if(Ft(t)){if(t[0]=="#")return y.fromString(t);if(t.substr(0,3)=="rgb")return y.fromCSS(t)}else{if(g(t))return y.fromHex(t);if(t instanceof y)return y.fromHex(t.hex)}throw new Error("Unknown color syntax: "+t)}static alternative(t,e,s){const r=we({r:t.r,g:t.g,b:t.b},e?{r:e.r,g:e.g,b:e.b}:void 0,s?{r:s.r,g:s.g,b:s.b}:void 0);return this.fromRGB(r.r,r.g,r.b)}static interpolate(t,e,s,r="rgb"){if(r=="hsl"){const n=e.toHSL(),a=s.toHSL();return y.fromHSL(A(t,n.h,a.h),A(t,n.s,a.s),A(t,n.l,a.l))}return y.fromRGB(A(t,e.r,s.r),A(t,e.g,s.g),A(t,e.b,s.b))}static lighten(t,e){const s=be({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static brighten(t,e){const s=ve({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static saturate(t,e){const s=ye({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}}class Q{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const t=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{c(t,e=>{e.disposer.dispose()})}finally{this._killed=null,this._iterating=null}}}hasListeners(){return this._listeners.length!==0}hasListenersByType(t){return se(this._listeners,e=>(e.type===null||e.type===t)&&!e.killed)}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(t){delete this._disabled[t]}disableType(t,e=1/0){this._disabled[t]=e}_removeListener(t){if(this._iterating===0){const e=this._listeners.indexOf(t);if(e===-1)throw new Error("Invalid state: could not remove listener");this._listeners.splice(e,1)}else this._killed.push(t)}_removeExistingListener(t,e,s,r){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(n=>{n.once!==t||n.type!==e||s!==void 0&&n.callback!==s||n.context!==r||n.disposer.dispose()})}isEnabled(t){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(t)&&this._disabled[t]===void 0}removeType(t){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(e=>{e.type===t&&e.disposer.dispose()})}has(t,e,s){return Ut(this._listeners,r=>r.once!==!0&&r.type===t&&(e===void 0||r.callback===e)&&r.context===s)!==-1}_shouldDispatch(t){if(this._disposed)throw new Error("EventDispatcher is disposed");const e=this._disabled[t];return g(e)?(e<=1?delete this._disabled[t]:--this._disabled[t],!1):this._enabled}_eachListener(t){++this._iterating;try{c(this._listeners,t)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(c(this._killed,e=>{this._removeListener(e)}),this._killed.length=0)}}dispatch(t,e){this._shouldDispatch(t)&&this._eachListener(s=>{s.killed||s.type!==null&&s.type!==t||s.dispatch(t,e)})}_on(t,e,s,r,n,a){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(t,e,s,r);const o={type:e,callback:s,context:r,shouldClone:n,dispatch:a,killed:!1,once:t,disposer:new D(()=>{o.killed=!0,this._removeListener(o)})};return this._listeners.push(o),o}onAll(t,e,s=!0){return this._on(!1,null,t,e,s,(r,n)=>t.call(e,n)).disposer}on(t,e,s,r=!0){return this._on(!1,t,e,s,r,(n,a)=>e.call(s,a)).disposer}once(t,e,s,r=!0){const n=this._on(!0,t,e,s,r,(a,o)=>{n.disposer.dispose(),e.call(s,o)});return n.disposer}off(t,e,s){this._removeExistingListener(!1,t,e,s)}copyFrom(t){if(this._disposed)throw new Error("EventDispatcher is disposed");if(t===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const e=[];return c(t._listeners,s=>{!s.killed&&s.shouldClone&&(s.type===null?e.push(this.onAll(s.callback,s.context)):s.once?e.push(this.once(s.type,s.callback,s.context)):e.push(this.on(s.type,s.callback,s.context)))}),new O(e)}}function Lt(i){return tt(this,void 0,void 0,function*(){if(i!==void 0){const t=[];v(i,(e,s)=>{t.push(s.waitForStop())}),yield Promise.all(t)}})}function A(i,t,e){return t+i*(e-t)}function De(i,t,e){return i>=1?e:t}function xe(i,t,e){return new f(A(i,t.percent,e.percent))}function ke(i,t,e){return y.interpolate(i,t,e)}function Oe(i,t){return typeof i=="number"&&typeof t=="number"?A:i instanceof f&&t instanceof f?xe:i instanceof y&&t instanceof y?ke:De}var U;function F(i,t){if(!(i>=0&&i=0&&t{this.push(e)})}copyFrom(t){this.pushAll(t._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(t){const e=this._values;this._values=[],this._onClear(e),c(t,s=>{this._values.push(s),this._onPush(s)})}clear(){this.setAll([])}*[Symbol.iterator](){const t=this._values.length;for(let e=0;e{e.dispose()}),super._onClear(t)}_dispose(){this.autoDispose&&c(this._values,t=>{t.dispose()})}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Oi extends Te{constructor(t,e){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=t,this.make=e}_dispose(){super._dispose(),this.autoDispose&&this.template.dispose()}}class Se extends Xt{constructor(t){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=t,this._events=this.events.onAll(e=>{if(e.type==="clear")c(e.oldValues,s=>{this._onRemoved(s)});else if(e.type==="push")this._onInserted(e.newValue);else if(e.type==="setIndex")this._onRemoved(e.oldValue),this._onInserted(e.newValue,e.index);else if(e.type==="insertIndex")this._onInserted(e.newValue,e.index);else if(e.type==="removeIndex")this._onRemoved(e.oldValue);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._onRemoved(e.value),this._onInserted(e.value,e.newIndex)}})}_onInserted(t,e){t._setParent(this._container,!0);const s=this._container._childrenDisplay;e===void 0?s.addChild(t._display):s.addChildAt(t._display,e)}_onRemoved(t){this._container._childrenDisplay.removeChild(t._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),c(this.values,t=>{t.dispose()}))}}const $t=Math.PI,Zt=$t/180,Ti=180/$t;function Si(i,t,e){if(!g(t)||t<=0)return Math.round(i);{let s=Math.pow(10,t);return Math.round(i*s)/s}}function ji(i,t){if(!g(t)||t<=0)return Math.ceil(i);{let e=Math.pow(10,t);return Math.ceil(i*e)/e}}function Nt(i,t,e){return Math.min(Math.max(i,t),e)}function yt(i){return Math.sin(Zt*i)}function wt(i){return Math.cos(Zt*i)}function Ei(i){return(i%=360)<0&&(i+=360),i}function Ci(i,t,e,s,r){let n=Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(gt(r,e)),l.push(gt(r,s));let d=Math.min(90*Math.floor(e/90),90*Math.floor(s/90)),p=Math.max(90*Math.ceil(e/90),90*Math.ceil(s/90));for(let u=d;u<=p;u+=90)u>=e&&u<=s&&l.push(gt(r,u));for(let u=0;uo&&(o=_.x),_.y>h&&(h=_.y)}return{left:i+n,top:t+a,right:i+o,bottom:t+h}}function gt(i,t){return{x:i*wt(t),y:i*yt(t)}}function Mi(i){const t=i.length;if(t>0){let e=i[0],s=e.left,r=e.top,n=e.right,a=e.bottom;if(t>1)for(let o=1;o=t.left&&i.y>=t.top&&i.x<=t.right&&i.y<=t.bottom}function Rt(i){return i}function Ee(i){return i*i*i}function Ai(i){return function(t){return 1-i(1-t)}}class Ce{constructor(t,e){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=t,this._settings=e,v(e,s=>{this._userSettings[s]=!0})}get(t,e){const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._userSettings[t]=!0,this.setRaw(t,e)}remove(t){delete this._userSettings[t],delete this._settings[t]}setAll(t){T(t).forEach(e=>{this.set(e,t[e])})}_eachSetting(t){v(this._settings,t)}apply(){const t={stateAnimationEasing:!0,stateAnimationDuration:!0},e=this._entity.states.lookup("default");this._eachSetting((s,r)=>{t[s]||(t[s]=!0,this!==e&&(s in e._settings||(e._settings[s]=this._entity.get(s))),this._entity.set(s,r))})}applyAnimate(t){t==null&&(t=this._settings.stateAnimationDuration),t==null&&(t=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let e=this._settings.stateAnimationEasing;e==null&&(e=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",Ee)));const s=this._entity.states.lookup("default"),r={stateAnimationEasing:!0,stateAnimationDuration:!0},n={};return this._eachSetting((a,o)=>{if(!r[a]){r[a]=!0,this!=s&&(a in s._settings||(s._settings[a]=this._entity.get(a)));const h=this._entity.animate({key:a,to:o,duration:t,easing:e});h&&(n[a]=h)}}),n}}class Me{constructor(t){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=t}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Ce(this._entity,e);return this._states[t]=r,r}}remove(t){delete this._states[t]}apply(t){const e=this._states[t];e&&e.apply(),this._entity._applyState(t)}applyAnimate(t,e){let s;const r=this._states[t];return r&&(s=r.applyAnimate(e)),this._entity._applyStateAnimated(t,e),s}}class Ae{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.10.7"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const N=new Ae;function Bi(i){N.licenses.push(i)}function R(i,t){return i===t?0:i{P(s,e)&&this._entity._markDirtyKey(t)})}remove(t){const e=this._callbacks[t];e!==void 0&&(delete this._callbacks[t],e.length!==0&&this._entity._markDirtyKey(t))}enable(t){this._disabled[t]&&(delete this._disabled[t],this._entity._markDirtyKey(t))}disable(t){this._disabled[t]||(this._disabled[t]=!0,this._entity._markDirtyKey(t))}fold(t,e){if(!this._disabled[t]){const s=this._callbacks[t];if(s!==void 0)for(let r=0,n=s.length;r{if(this._stopped)t();else{const s=()=>{r.dispose(),t()},r=this.events.on("stopped",s)}})}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(t){this._oldTime!==null&&(this._time+=t-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=t}_reset(t){this._oldTime=t,this._time=0}_value(t){return this._interpolate(this._easing(t),this._from,this._to)}}let He=0;class Ie{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++He}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"enableDispose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._settings=t}_checkDirty(){T(this._settings).forEach(t=>{this._userProperties[t]=!0,this._markDirtyKey(t)})}resetUserSettings(){this._userProperties={}}_runAnimation(t){let e=U.Stopped;if(!this.isDisposed()){let s=!1,r=!1;v(this._animatingSettings,(n,a)=>{if(a.stopped)this._stopAnimation(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.set(n,a._value(1)):(s=!0,a._reset(t),this._set(n,a._value(1))):(s=!0,this._set(n,a._value(o)))}else r=!0}),v(this._animatingPrivateSettings,(n,a)=>{if(a.stopped)this._stopAnimationPrivate(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.setPrivate(n,a._value(1)):(s=!0,a._reset(t),this._setPrivate(n,a._value(1))):(s=!0,this._setPrivate(n,a._value(o)))}else r=!0}),s?e=U.Playing:r&&(e=U.Paused)}return e}_markDirtyKey(t){this.markDirty()}_markDirtyPrivateKey(t){this.markDirty()}on(t,e){let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}off(t,e){let s=this._settingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._settingEvents[t]}onPrivate(t,e){let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}offPrivate(t,e){let s=this._privateSettingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._privateSettingEvents[t]}getRaw(t,e){const s=this._settings[t];return s!==void 0?s:e}has(t){return t in this._settings}get(t,e){return this.getRaw(t,e)}_sendKeyEvent(t,e){const s=this._settingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_sendPrivateKeyEvent(t,e){const s=this._privateSettingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_setRaw(t,e,s){this._prevSettings[t]=e,this._sendKeyEvent(t,s)}setRaw(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&this._setRaw(t,s,e)}_set(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&(this._setRaw(t,s,e),this._markDirtyKey(t))}_stopAnimation(t){const e=this._animatingSettings[t];e&&(delete this._animatingSettings[t],e.stop())}set(t,e){return this._set(t,e),this._stopAnimation(t),e}remove(t){t in this._settings&&(this._prevSettings[t]=this._settings[t],delete this._settings[t],this._sendKeyEvent(t,void 0),this._markDirtyKey(t)),this._stopAnimation(t)}removeAll(){c(T(this._settings),t=>{this.remove(t)})}getPrivate(t,e){const s=this._privateSettings[t];return s!==void 0?s:e}_setPrivateRaw(t,e,s){this._prevPrivateSettings[t]=e,this._sendPrivateKeyEvent(t,s)}setPrivateRaw(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&this._setPrivateRaw(t,s,e)}_setPrivate(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&(this._setPrivateRaw(t,s,e),this._markDirtyPrivateKey(t))}_stopAnimationPrivate(t){const e=this._animatingPrivateSettings[t];e&&(e.stop(),delete this._animatingPrivateSettings[t])}setPrivate(t,e){return this._setPrivate(t,e),this._stopAnimationPrivate(t),e}removePrivate(t){t in this._privateSettings&&(this._prevPrivateSettings[t]=this._privateSettings[t],delete this._privateSettings[t],this._markDirtyPrivateKey(t)),this._stopAnimationPrivate(t)}setAll(t){v(t,(e,s)=>{this.set(e,s)})}animate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.get(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.set(e,s);else{if(a!==void 0&&a!==s){this.set(e,a);const l=this._animatingSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.set(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}animatePrivate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.getPrivate(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.setPrivate(e,s);else{if(a!==void 0&&a!==s){this.setPrivate(e,a);const l=this._animatingPrivateSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.setPrivate(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}_dispose(){}isDisposed(){return this._disposed}dispose(){this.enableDispose&&!this._disposed&&(this._disposed=!0,this._dispose())}}let B=class extends Ie{constructor(i,t,e,s=[]){if(super(t),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Me(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Be(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=i,this._internalTemplates=s,t.id&&this._registerId(t.id)}static new(i,t,e){const s=new this(i,t,!0);return s._template=e,s._afterNew(),s}static _new(i,t,e=[]){const s=new this(i,t,!0,e);return s._afterNew(),s}_afterNew(){this._checkDirty();let i=!1;const t=this._template;t&&(i=!0,t._setObjectTemplate(this)),c(this._internalTemplates,e=>{i=!0,e._setObjectTemplate(this)}),i&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const i=this._template;i&&i._setObjectTemplate(this),c(this._internalTemplates,t=>{t._setObjectTemplate(this)}),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new Q}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefaultFn(i,t){const e=this.get(i);if(e)return e;{const s=t();return this.set(i,s),s}}_setDefault(i,t){this.has(i)||super.set(i,t)}_setRawDefault(i,t){this.has(i)||super.setRaw(i,t)}_clearDirty(){T(this._dirty).forEach(i=>{this._dirty[i]=!1}),T(this._dirtyPrivate).forEach(i=>{this._dirtyPrivate[i]=!1})}isDirty(i){return!!this._dirty[i]}isPrivateDirty(i){return!!this._dirtyPrivate[i]}_markDirtyKey(i){this._dirty[i]=!0,super._markDirtyKey(i)}_markDirtyPrivateKey(i){this._dirtyPrivate[i]=!0,super._markDirtyKey(i)}isType(i){return this.classNames.indexOf(i)!==-1}_pushPropertyDisposer(i,t){let e=this._disposerProperties[i];return e===void 0&&(e=this._disposerProperties[i]=[]),e.push(t),t}_disposeProperty(i){const t=this._disposerProperties[i];t!==void 0&&(c(t,e=>{e.dispose()}),delete this._disposerProperties[i])}set template(i){const t=this._template;t!==i&&(this._template=i,t&&t._removeObjectTemplate(this),i&&i._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(i){}_applyStateAnimated(i,t){}get(i,t){const e=this.adapters.fold(i,this._settings[i]);return e!==void 0?e:t}isUserSetting(i){return this._userProperties[i]||!1}set(i,t){return this._userProperties[i]=!0,super.set(i,t)}setRaw(i,t){this._userProperties[i]=!0,super.setRaw(i,t)}_setSoft(i,t){return this._userProperties[i]?t:super.set(i,t)}remove(i){delete this._userProperties[i],this._removeTemplateProperty(i)}setPrivate(i,t){return this._userPrivateProperties[i]=!0,super.setPrivate(i,t)}setPrivateRaw(i,t){this._userPrivateProperties[i]=!0,super.setPrivateRaw(i,t)}removePrivate(i){delete this._userPrivateProperties[i],this._removeTemplatePrivateProperty(i)}_setTemplateProperty(i,t,e){this._userProperties[t]||i===this._findTemplateByKey(t)&&super.set(t,e)}_setTemplatePrivateProperty(i,t,e){this._userPrivateProperties[t]||i===this._findTemplateByPrivateKey(t)&&super.setPrivate(t,e)}_removeTemplateProperty(i){if(!this._userProperties[i]){const t=this._findTemplateByKey(i);t?super.set(i,t._settings[i]):super.remove(i)}}_removeTemplatePrivateProperty(i){if(!this._userPrivateProperties[i]){const t=this._findTemplateByPrivateKey(i);t?super.setPrivate(i,t._privateSettings[i]):super.removePrivate(i)}}_walkParents(i){i(this._root._rootContainer),i(this)}_applyStateByKey(i){const t=this.states.create(i,{}),e={};this._eachTemplate(s=>{const r=s.states.lookup(i);r&&r._apply(t,e)}),v(t._settings,s=>{e[s]||t._userSettings[s]||t.remove(s)})}_applyTemplate(i,t){this._templateDisposers.push(i._apply(this,t)),v(i._settings,(e,s)=>{t.settings[e]||this._userProperties[e]||(t.settings[e]=!0,super.set(e,s))}),v(i._privateSettings,(e,s)=>{t.privateSettings[e]||this._userPrivateProperties[e]||(t.privateSettings[e]=!0,super.setPrivate(e,s))}),this._runSetup&&i.setup&&(this._runSetup=!1,i.setup(this))}_findStaticTemplate(i){if(this._template&&i(this._template))return this._template}_eachTemplate(i){this._findStaticTemplate(t=>(i(t),!1)),W(this._internalTemplates,i),c(this._templates,i)}_applyTemplates(i=!0){i&&this._disposeTemplates();const t={settings:{},privateSettings:{},states:{}};this._eachTemplate(e=>{this._applyTemplate(e,t)}),i&&(v(this._settings,e=>{this._userProperties[e]||t.settings[e]||super.remove(e)}),v(this._privateSettings,e=>{this._userPrivateProperties[e]||t.privateSettings[e]||super.removePrivate(e)}))}_findTemplate(i){const t=this._findStaticTemplate(i);if(t===void 0){const e=ae(this._internalTemplates,i);return e===void 0?ne(this._templates,i):e}return t}_findTemplateByKey(i){return this._findTemplate(t=>i in t._settings)}_findTemplateByPrivateKey(i){return this._findTemplate(t=>i in t._privateSettings)}_disposeTemplates(){c(this._templateDisposers,i=>{i.dispose()}),this._templateDisposers.length=0}_removeTemplates(){c(this._templates,i=>{i._removeObjectTemplate(this)}),this._templates.length=0}_applyThemes(i=!1){let t=!1;const e=[];let s=[];const r=new Set,n=this.get("themeTagsSelf");return n&&c(n,a=>{r.add(a)}),this._walkParents(a=>{a===this._root._rootContainer&&(t=!0),a._defaultThemes.length>0&&e.push(a._defaultThemes);const o=a.get("themes");o&&s.push(o);const h=a.get("themeTags");h&&c(h,l=>{r.add(l)})}),s=e.concat(s),this._removeTemplates(),(t||i)&&W(this.classNames,a=>{const o=[];c(s,h=>{c(h,l=>{const d=l._lookupRules(a);d&&W(d,p=>{if(p.tags.every(u=>r.has(u))){const u=he(o,_=>{const m=R(p.tags.length,_.tags.length);return m===0?Jt(p.tags,_.tags,R):m});o.splice(u.index,0,p)}})})}),c(o,h=>{this._templates.push(h.template),h.template._setObjectTemplate(this)})}),this._applyTemplates(),(t||i)&&(this._runSetup=!1),t||i}_changed(){}_beforeChanged(){if(this.isDirty("id")){const i=this.get("id");i&&this._registerId(i);const t=this._prevSettings.id;t&&delete N.entitiesById[t]}}_registerId(i){if(N.entitiesById[i]&&N.entitiesById[i]!==this)throw new Error('An entity with id "'+i+'" already exists.');N.entitiesById[i]=this}_afterChanged(){}addDisposer(i){return this._disposers.push(i),i}_dispose(){super._dispose();const i=this._template;i&&i._removeObjectTemplate(this),c(this._internalTemplates,e=>{e._removeObjectTemplate(this)}),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach(e=>{e.dispose()}),v(this._disposerProperties,(e,s)=>{c(s,r=>{r.dispose()})});const t=this.get("id");t&&delete N.entitiesById[t]}setTimeout(i,t){const e=setTimeout(()=>{this.removeDispose(s),i()},t),s=new D(()=>{clearTimeout(e)});return this._disposers.push(s),s}removeDispose(i){if(!this.isDisposed()){let t=st(this._disposers,i);t>-1&&this._disposers.splice(t,1)}i.dispose()}hasTag(i){return st(this.get("themeTags",[]),i)!==-1}addTag(i){if(!this.hasTag(i)){const t=this.get("themeTags",[]);t.push(i),this.set("themeTags",t)}}removeTag(i){if(this.hasTag(i)){const t=this.get("themeTags",[]);Wt(t,i),this.set("themeTags",t)}}_t(i,t,...e){return this._root.language.translate(i,t,...e)}get root(){return this._root}};function Pt(i){v(i,(t,e)=>{St(e)&&typeof e.dispose=="function"&&(e.enableDispose=!0,e.dispose())})}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class Le{constructor(t,e,s){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=t,this._template=e,this._settings=s}_dispose(){Pt(this._settings)}get(t,e){const s=this._settings[t];return s!==void 0?s:e}set(t,e){this._settings[t]=e,this._template._stateChanged(this._name)}remove(t){delete this._settings[t],this._template._stateChanged(this._name)}setAll(t){T(t).forEach(e=>{this._settings[e]=t[e]}),this._template._stateChanged(this._name)}_apply(t,e){v(this._settings,(s,r)=>{e[s]||t._userSettings[s]||(e[s]=!0,t.setRaw(s,r))})}}class Ne{constructor(t){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=t}_dispose(){v(this._states,(t,e)=>{e._dispose()})}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Le(t,this._template,e);return this._states[t]=r,this._template._stateChanged(t),r}}remove(t){delete this._states[t],this._template._stateChanged(t)}_apply(t,e){v(this._states,(s,r)=>{let n=e.states[s];n==null&&(n=e.states[s]={});const a=t.states.create(s,{});r._apply(a,n)})}}class Re{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(t,e){let s=this._callbacks[t];return s===void 0&&(s=this._callbacks[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._callbacks[t]})}remove(t){this._callbacks[t]!==void 0&&delete this._callbacks[t]}_apply(t){const e=[];return v(this._callbacks,(s,r)=>{c(r,n=>{e.push(t.adapters.add(s,n))})}),new O(e)}}class J{constructor(t,e){if(Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Ne(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Re}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Q}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=t}static new(t){return new J(t,!0)}_dispose(){Pt(this._settings),Pt(this._privateSettings)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}_checkDisposed(){if(this._disposed)throw new Error("Template is disposed")}get entities(){return this._entities}get(t,e){this._checkDisposed();const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._checkDisposed(),this._settings[t]=e}set(t,e){this._checkDisposed(),this._settings[t]!==e&&(this.setRaw(t,e),this._entities.forEach(s=>{s._setTemplateProperty(this,t,e)}))}remove(t){this._checkDisposed(),t in this._settings&&(delete this._settings[t],this._entities.forEach(e=>{e._removeTemplateProperty(t)}))}removeAll(){this._checkDisposed(),v(this._settings,(t,e)=>{this.remove(t)})}getPrivate(t,e){this._checkDisposed();const s=this._privateSettings[t];return s!==void 0?s:e}setPrivateRaw(t,e){return this._checkDisposed(),this._privateSettings[t]=e,e}setPrivate(t,e){return this._checkDisposed(),this._privateSettings[t]!==e&&(this.setPrivateRaw(t,e),this._entities.forEach(s=>{s._setTemplatePrivateProperty(this,t,e)})),e}removePrivate(t){this._checkDisposed(),t in this._privateSettings&&(delete this._privateSettings[t],this._entities.forEach(e=>{e._removeTemplatePrivateProperty(t)}))}setAll(t){this._checkDisposed(),v(t,(e,s)=>{this.set(e,s)})}on(t,e){this._checkDisposed();let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}onPrivate(t,e){this._checkDisposed();let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}_apply(t,e){this._checkDisposed();const s=[];return v(this._settingEvents,(r,n)=>{c(n,a=>{s.push(t.on(r,a))})}),v(this._privateSettingEvents,(r,n)=>{c(n,a=>{s.push(t.onPrivate(r,a))})}),this.states._apply(t,e),s.push(this.adapters._apply(t)),s.push(t.events.copyFrom(this.events)),new O(s)}_setObjectTemplate(t){this._checkDisposed(),this._entities.push(t)}_removeObjectTemplate(t){Wt(this._entities,t)}_stateChanged(t){this._checkDisposed(),this._entities.forEach(e=>{e._applyStateByKey(t)})}}class nt extends Q{constructor(t){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=t}_makePointerEvent(t,e){return{type:t,originalEvent:e.event,point:e.point,simulated:e.simulated,native:e.native,target:this._sprite}}_onRenderer(t,e){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let s=this._rendererDisposers[t];if(s===void 0){const r=this._sprite._display.on(t,n=>{e.call(this,n)});s=this._rendererDisposers[t]=new ue(()=>{delete this._rendererDisposers[t],r.dispose()})}return s.increment()}_on(t,e,s,r,n,a){const o=super._on(t,e,s,r,n,a),h=nt.RENDERER_EVENTS[e];return h!==void 0&&(o.disposer=new O([o.disposer,this._onRenderer(e,h)])),o}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(t,e){const s=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(t,e),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(t,e)}finally{this._dispatchParents=s}}}Object.defineProperty(nt,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(i){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",i))&&this.dispatch("click",this._makePointerEvent("click",i))},rightclick:function(i){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",i))},middleclick:function(i){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",i))},dblclick:function(i){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",i))},pointerover:function(i){const t=this._sprite;let e=!0;if(t.getPrivate("trustBounds")){t._getBounds();const s=t.globalBounds();if(t.isType("Graphics")){const r=t.get("strokeWidth",1)/2;r>=1&&(s.left-=r,s.right+=r,s.top-=r,s.bottom+=r)}je(i.point,s)||(e=!1,t._root._renderer.removeHovering(t._display))}e&&this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",i))},pointerout:function(i){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",i))},pointerdown:function(i){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",i))},pointerup:function(i){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",i))},globalpointerup:function(i){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",i))},globalpointermove:function(i){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",i))},wheel:function(i){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:i.event,point:i.point})}}});class k extends B{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}markDirtyKey(t){this._markDirtyKey(t)}_markDirtyKey(t){super._markDirtyKey(t),t!="x"&&t!="y"&&t!="dx"&&t!="dy"||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(t){super._markDirtyPrivateKey(t),t!="x"&&t!="y"||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new nt(this)}_processTemplateField(){let t;const e=this.get("templateField");if(e){const s=this.dataItem;if(s){const r=s.dataContext;r&&(t=r[e],t instanceof J||!t||(t=J.new(t)))}}this._templateField!==t&&(this._removeTemplateField(),this._templateField=t,t&&t._setObjectTemplate(this),this._applyTemplates())}_setDataItem(t){const e=this._dataItem;this._dataItem=t,this._processTemplateField();const s="dataitemchanged";t!=e&&this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,oldDataItem:e,newDataItem:t})}set dataItem(t){this._setDataItem(t)}get dataItem(){if(this._dataItem)return this._dataItem;{let t=this._parent;for(;t;){if(t._dataItem)return t._dataItem;t=t._parent}}}_addPercentageSizeChildren(){let t=this.parent;t&&(this.get("width")instanceof f||this.get("height")instanceof f?At(t._percentageSizeChildren,this):P(t._percentageSizeChildren,this))}_addPercentagePositionChildren(){let t=this.parent;t&&(this.get("x")instanceof f||this.get("y")instanceof f?At(t._percentagePositionChildren,this):P(t._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const t=this._localBounds;if(t){const e=this.get("centerX");e!=null&&(this._display.pivot.x=t.left+M(e,t.right-t.left));const s=this.get("centerY");s!=null&&(this._display.pivot.y=t.top+M(s,t.bottom-t.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const t=this._prevSettings.tooltip;t&&t.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0);const e=this._tooltipPointerDp;e&&(e.dispose(),this._tooltipPointerDp=void 0),this.get("tooltipPosition")=="pointer"&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})),this._tooltipPointerDp=new O([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})}),this.events.on("pointerout",()=>{const s=this._tooltipMoveDp;s&&(s.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const t=this._display,e=this.events;if(this.isDirty("draggable")){const r=this.get("draggable");r?(this.set("interactive",!0),this._dragDp=new O([e.on("pointerdown",n=>{this.dragStart(n)}),e.on("globalpointermove",n=>{this.dragMove(n)}),e.on("globalpointerup",n=>{this.dragStop(n)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),t.cancelTouch=!!r}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const r=this.get("tooltipText"),n=this.get("tooltipHTML"),a=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(r||n)&&(a=="click"?(this._tooltipDp=new O([e.on("click",()=>{this.setTimeout(()=>{const o=this.getTooltip();o&&!o.isHidden()&&o.get("tooltipTarget")===this?this.hideTooltip():this.showTooltip()},10)}),Kt(document,"click",o=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)):a=="always"||(this._tooltipDp=new O([e.on("pointerover",()=>{this.showTooltip()}),e.on("pointerout",()=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)))}if(this.isDirty("toggleKey")){let r=this.get("toggleKey");r&&r!="none"?this._toggleDp=e.on("click",()=>{this._isDragging||this.set(r,!this.get(r))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(t.alpha=Math.max(0,this.get("opacity",1)),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("rotation")&&(this.markDirtyBounds(),t.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),t.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?t.visible=!0:(t.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const r=this.parent;r&&(this.isDirty("width")&&this.get("width")instanceof f||this.isDirty("height")&&this.get("height")instanceof f)&&(r.markDirty(),r._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight")||this.isDirty("marginLeft")||this.isDirty("marginTop")||this.isDirty("marginRight")||this.isDirty("marginBottom"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const r=this.get("wheelable");r&&this.set("interactive",!0),t.wheelable=!!r}(this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(t.filter=this.get("filter"));let s=this.get("filter","");if(this.isDirty("blur")){const r=this.get("blur",0);r!=0&&(s+=" blur("+r+"px)")}if(this.isDirty("saturate")){const r=this.get("saturate",1);r!=1&&(s+=" saturate("+r+")")}if(this.isDirty("brightness")){const r=this.get("brightness",1);r!=1&&(s+=" brightness("+r+")")}if(this.isDirty("contrast")){const r=this.get("contrast",1);r!=1&&(s+=" contrast("+r+")")}if(this.isDirty("sepia")){const r=this.get("sepia",0);r!=0&&(s+=" sepia("+r+")")}if(this.isDirty("hue")){const r=this.get("hue",0);r!=0&&(s+=" hue-rotate("+r+"deg)")}if(this.isDirty("invert")){const r=this.get("invert",0);r!=0&&(s+=" invert("+r+")")}if(s&&(t.filter=s),this.isDirty("cursorOverStyle")&&(t.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new O([e.on("focus",()=>{this.showTooltip()}),e.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility(),this._disposers.push(e.on("blur",()=>{this.setPrivateRaw("touchHovering",!1)}))),this.isPrivateDirty("focusable")&&this.markDirtyAccessibility(),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(t.exportable=this.get("exportable")),this.isDirty("interactive")){const r=this.events;this.get("interactive")&&!r.isDisposed()?this._hoverDp=new O([r.on("click",n=>{Bt(n.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})},10))}),r.on("globalpointerup",n=>{Bt(n.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})),this._isDown&&this._handleUp(n)}),r.on("pointerover",()=>{this._handleOver()}),r.on("pointerout",()=>{this._handleOut()}),r.on("pointerdown",n=>{this._handleDown(n)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",null)),this.get("showTooltipOn")=="always"&&this._display.visible&&this.showTooltip()}dragStart(t){this._dragEvent=t,this.events.stopParentDispatch()}dragStop(t){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const e="dragstop";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(t){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const e=pt(t.originalEvent);delete this._downPoints[e],T(this._downPoints).length==0&&(this._isDown=!1)}}_hasMoved(t){const e=pt(t.originalEvent),s=this._downPoints[e];if(s){const r=Math.abs(s.x-t.point.x),n=Math.abs(s.y-t.point.y);return r>5||n>5}return!1}_hasDown(){return T(this._downPoints).length>0}_handleDown(t){const e=this.parent;if(e&&!this.get("draggable")&&e._handleDown(t),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:t.point.x,y:t.point.y},this._isDown=!0;const s=pt(t.originalEvent);this._downPoints[s]={x:t.point.x,y:t.point.y}}}dragMove(t){let e=this._dragEvent;if(e){if(e.simulated&&!t.simulated)return!0;let s=0,r=this.parent,n=1;for(;r!=null;)s+=r.get("rotation",0),r=r.parent,r&&(n*=r.get("scale",1));let a=(t.point.x-e.point.x)/n,o=(t.point.y-e.point.y)/n;const h=this.events;if(e.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}if(this._isDragging){let l=this._dragPoint;this.set("x",l.x+a*wt(s)+o*yt(s)),this.set("y",l.y+o*wt(s)-a*yt(s));const d="dragged";h.isEnabled(d)&&h.dispatch(d,{type:d,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}else if(Math.hypot(a,o)>5){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let t=this.parent,e=0;for(;;){if(!t)return e;++e,t=t.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const t=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),t.isMeasured=!0,t.invalidateBounds();const e=this.parent;e&&this.get("position")!="absolute"&&(e.get("width")==null||e.get("height")==null||e.get("layout"))&&e.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const t=this._adjustedLocalBounds;let e;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),e=this._adjustedLocalBounds):(e={left:0,right:0,top:0,bottom:0},this._localBounds=e,this._adjustedLocalBounds=e),!t||t.left!==e.left||t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom){const s="boundschanged";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds()),this.getPrivate("showingTooltip")&&this.showTooltip()}}_fixMinBounds(t){let e=this.get("minWidth",this.getPrivate("minWidth")),s=this.get("minHeight",this.getPrivate("minHeight"));g(e)&&t.right-t.left0?t.right=t.left+r:t.left=t.right+r),g(n)&&(n>0?t.bottom=t.top+n:t.top=t.bottom+n)}_removeParent(t){t&&(t.children.removeValue(this),P(t._percentageSizeChildren,this),P(t._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.isDisposed()||(this.showTooltip(),this._handleOver())}unhover(){this.isDisposed()||(this.hideTooltip(),this._handleOut())}showTooltip(t){if(!this.isDisposed()){const e=this.getTooltip(),s=this.get("tooltipText"),r=this.get("tooltipHTML");if((s||r)&&e){const n=this.get("tooltipPosition"),a=this.getPrivate("tooltipTarget",this);n!="fixed"&&t||(this._display._setMatrix(),t=this.toGlobal(a._getTooltipPoint())),e.set("pointTo",t),e.set("tooltipTarget",a),e.get("x")||e.set("x",t.x),e.get("y")||e.set("y",t.y),s&&e.label.set("text",s),r&&e.label.set("html",r);const o=this.dataItem;if(o&&e.label._setDataItem(o),this.get("showTooltipOn")=="always"&&(t.x<0||t.x>this._root.width()||t.y<0||t.y>this._root.height()))return void this.hideTooltip();e.label.text.markDirtyText();const h=e.show();return this.setPrivateRaw("showingTooltip",!0),h}}}hideTooltip(){const t=this.getTooltip();if(t&&(t.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==t)){let e=t.get("keepTargetHover")&&t.get("stateAnimationDuration",0)==0?400:void 0;const s=t.hide(e);return this.setPrivateRaw("showingTooltip",!1),s}}_getTooltipPoint(){const t=this._localBounds;if(t){let e=0,s=0;return this.get("isMeasured")?(e=t.left+M(this.get("tooltipX",0),t.right-t.left),s=t.top+M(this.get("tooltipY",0),t.bottom-t.top)):(e=M(this.get("tooltipX",0),this.width()),s=M(this.get("tooltipY",0),this.height())),{x:e,y:s}}return{x:0,y:0}}getTooltip(){let t=this.get("tooltip");if(t)return t;{let e=this.parent;if(e)return e.getTooltip()}}_updatePosition(){const t=this.parent;let e=this.get("dx",0),s=this.get("dy",0),r=this.get("x"),n=this.getPrivate("x"),a=0,o=0;const h=this.get("position");r instanceof f&&(r=t?t.innerWidth()*r.value+t.get("paddingLeft",0):0),g(r)?a=r+e:n!=null?a=n:t&&h=="relative"&&(a=t.get("paddingLeft",0)+e);let l=this.get("y"),d=this.getPrivate("y");l instanceof f&&(l=t?t.innerHeight()*l.value+t.get("paddingTop",0):0),g(l)?o=l+s:d!=null?o=d:t&&h=="relative"&&(o=t.get("paddingTop",0)+s);const p=this._display;if(p.x!=a||p.y!=o){p.invalidateBounds(),p.x=a,p.y=o;const u="positionchanged";this.events.isEnabled(u)&&this.events.dispatch(u,{type:u,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let t=this.get("x"),e=this.getPrivate("x");const s=this.parent;return s?t instanceof f?M(t,s.innerWidth())+s.get("paddingLeft",0):g(t)?t:e??s.get("paddingLeft",this._display.x):this._display.x}y(){let t=this.getPrivate("y");if(t!=null)return t;let e=this.get("y");const s=this.parent;return s?e instanceof f?M(e,s.innerHeight())+s.get("paddingTop",0):g(e)?e:t??s.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const t=this.get("tooltip");t&&t.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const t=this._adjustedLocalBounds,e=this.x(),s=this.y();return{left:t.left+e,right:t.right+e,top:t.top+s,bottom:t.bottom+s}}globalBounds(){const t=this.localBounds(),e=this.toGlobal({x:t.left,y:t.top}),s=this.toGlobal({x:t.right,y:t.top}),r=this.toGlobal({x:t.right,y:t.bottom}),n=this.toGlobal({x:t.left,y:t.bottom});return{left:Math.min(e.x,s.x,r.x,n.x),top:Math.min(e.y,s.y,r.y,n.y),right:Math.max(e.x,s.x,r.x,n.x),bottom:Math.max(e.y,s.y,r.y,n.y)}}_onShow(t){}_onHide(t){}appear(t,e){return tt(this,void 0,void 0,function*(){return yield this.hide(0),e?new Promise((s,r)=>{this.setTimeout(()=>{s(this.show(t))},e)}):this.show(t)})}show(t){return tt(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(t);const e=this.states.applyAnimate("default",t);yield Lt(e),this._isShowing=!1}})}hide(t){return tt(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let e=this.states.lookup("hidden");e||(e=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(t);const s=this.states.applyAnimate("hidden",t);yield Lt(s),this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const t=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*t:t}compositeScale(){const t=this.get("scale",1);return this._parent?this._parent.compositeScale()*t:t}compositeRotation(){const t=this.get("rotation",0);return this._parent?this._parent.compositeRotation()+t:t}width(){let t=this.get("width"),e=this.get("maxWidth",this.getPrivate("maxWidth")),s=this.get("minWidth",this.getPrivate("minWidth")),r=this.getPrivate("width"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(t instanceof f){const a=this.parent;n=a?a.innerWidth()*t.value:this._root.width()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}maxWidth(){let t=this.get("maxWidth",this.getPrivate("maxWidth"));if(g(t))return t;{let s=this.get("width");if(g(s))return s}const e=this.parent;return e?e.innerWidth():this._root.width()}maxHeight(){let t=this.get("maxHeight",this.getPrivate("maxHeight"));if(g(t))return t;{let s=this.get("height");if(g(s))return s}const e=this.parent;return e?e.innerHeight():this._root.height()}height(){let t=this.get("height"),e=this.get("maxHeight",this.getPrivate("maxHeight")),s=this.get("minHeight",this.getPrivate("minHeight")),r=this.getPrivate("height"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(t instanceof f){const a=this.parent;n=a?a.innerHeight()*t.value:this._root.height()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}_findStaticTemplate(t){return this._templateField&&t(this._templateField)?this._templateField:super._findStaticTemplate(t)}_walkParents(t){this._parent&&this._walkParent(t)}_walkParent(t){this._parent&&this._parent._walkParent(t),t(this)}get parent(){return this._parent}_setParent(t,e=!1){const s=this._parent;t!==s&&(this.markDirtyBounds(),t.markDirty(),this._parent=t,e&&(this._removeParent(s),t&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(t){return this._display.toGlobal(t)}toLocal(t){return this._display.toLocal(t)}_getDownPoint(){const t=this._getDownPointId();if(t)return this._downPoints[t]}_getDownPointId(){if(this._downPoints)return le(this._downPoints,(t,e)=>t>e?1:t0&&(a.beginFill(r,n),a.drawRect(0,0,e,s),a.endFill()),o.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(o,a,t,e,s)}this._clear=!1}}Object.defineProperty(V,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(V,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([V.className])});class K extends V{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load();const t=this.get("canvas");t&&(this.set("width",t.width),this.set("height",t.height))}_draw(){super._draw();const t=this._image;if(t){const s=this.get("width",100),r=this.get("height",100),n=this.get("fit","image");let a=0,o=0;n=="pattern"?(a=s,o=r):(a=t.width,o=t.height,n=="image"&&(this.set("width",a),this.set("height",o)));let h=0,l=0;this.get("centered",!0)&&(h=s/2-a/2,l=r/2-o/2),this._display.image(t,a,o,h,l)}const e=this.get("canvas");e&&this._display.image(e,e.width,e.height,0,0)}_load(){const t=this.get("src");if(t){const e=new Image;e.src=t,e.decode().then(()=>{this._image=e,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(s=>{})}}}var Dt;Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:V.classNames.concat([K.className])}),function(i){i.ADD="lighter",i.COLOR="color",i.COLOR_BURN="color-burn",i.COLOR_DODGE="color-dodge",i.DARKEN="darken",i.DIFFERENCE="difference",i.DST_OVER="destination-over",i.EXCLUSION="exclusion",i.HARD_LIGHT="hard-light",i.HUE="hue",i.LIGHTEN="lighten",i.LUMINOSITY="luminosity",i.MULTIPLY="multiply",i.NORMAL="source-over",i.OVERLAY="overlay",i.SATURATION="saturation",i.SCREEN="screen",i.SOFT_LIGHT="soft-light",i.SRC_ATOP="source-atop",i.XOR="xor"}(Dt||(Dt={}));const Ii=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset","shadowBlur","shadowColor","shadowOpacity","shadowOffsetX","shadowOffsetY","blur","sepia","invert","brightness","hue","contrast","saturate"];class G extends k{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const t=this.get("fillGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}}if(this.isDirty("strokeGradient")){const t=this.get("strokeGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let t=this.get("strokeDasharray");g(t)&&(t=t<.5?[0]:[t]),this._display.setLineDash(t);const e=this.get("strokeDashoffset");e&&this._display.setLineDashOffset(e);const s=this.get("blendMode",Dt.NORMAL);this._display.blendMode=s;const r=this.get("draw");r&&typeof r=="function"&&r(this._display,this);const n=this.get("svgPath");n!=null&&this._display.svgPath(n)}}_afterChanged(){if(super._afterChanged(),this._clear){const t=this.get("fill"),e=this.get("fillGradient"),s=this.get("fillPattern"),r=this.get("fillOpacity"),n=this.get("stroke"),a=this.get("strokeGradient"),o=this.get("strokePattern"),h=this.get("shadowColor"),l=this.get("shadowBlur"),d=this.get("shadowOffsetX"),p=this.get("shadowOffsetY"),u=this.get("shadowOpacity");if(h&&(l||d||p)&&this._display.shadow(h,l,d,p,u),t&&!e&&(this._display.beginFill(t,r),this._display.endFill()),e){if(t){const m=e.get("stops",[]);m.length&&c(m,b=>{b.color&&!b.colorInherited||!t||(b.color=t,b.colorInherited=!0),(b.opacity==null||b.opacityInherited)&&(b.opacity=r,b.opacityInherited=!0)})}const _=e.getFill(this);_&&(this._display.beginFill(_,r),this._display.endFill())}if(s){const _=s.pattern;_&&(this._display.beginFill(_,r),this._display.endFill(),s instanceof K&&s.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}if(n||a||o){const _=this.get("strokeOpacity");let m=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(m/=this.get("scale",1)),this.get("crisp")&&(m/=this._root._renderer.resolution);const b=this.get("lineJoin");if(n&&!a&&(this._display.lineStyle(m,n,_,b),this._display.endStroke()),a){const S=a.get("stops",[]);S.length&&c(S,w=>{w.color&&!w.colorInherited||!n||(w.color=n,w.colorInherited=!0),(w.opacity==null||w.opacityInherited)&&(w.opacity=_,w.opacityInherited=!0)});const H=a.getFill(this);H&&(this._display.lineStyle(m,H,_,b),this._display.endStroke())}if(o){let S=o.pattern;S&&(this._display.lineStyle(m,S,_,b),this._display.endStroke(),o instanceof K&&o.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(G,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(G,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([G.className])});class z extends G{_afterNew(){super._afterNew(),this._display.isMeasured=!0,this.setPrivateRaw("trustBounds",!0)}_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function j(i,t){i.get("reverseChildren",!1)?i.children.eachReverse(t):i.children.each(t)}Object.defineProperty(z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:G.classNames.concat([z.className])});class E extends B{}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([E.className])});class Y extends E{updateContainer(t){let e=t.get("paddingLeft",0),s=t.innerWidth(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minWidth",a.getPrivate("minWidth",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.width()),s-=o+a.get("marginLeft",0)+a.get("marginRight",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){let h=s*o.value/r-a.get("marginLeft",0)-a.get("marginRight",0),l=a.get("minWidth",a.getPrivate("minWidth",-1/0)),d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("width",h)}else a._prevSettings.width instanceof f&&a.setPrivate("width",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginLeft",0),l=a.get("marginRight",0),d=a.get("maxWidth"),p=o.left,u=o.right;d&&u-p>d&&(u=p+d);let _=n+h-p;a.setPrivate("x",_),n=_+u+l}else a.setPrivate("x",void 0)})}}Object.defineProperty(Y,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(Y,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([Y.className])});class X extends E{updateContainer(t){let e=t.get("paddingTop",0),s=t.innerHeight(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minHeight",a.getPrivate("minHeight",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.height()),s-=o+a.get("marginTop",0)+a.get("marginBottom",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){let h=s*o.value/r-a.get("marginTop",0)-a.get("marginBottom",0),l=a.get("minHeight",a.getPrivate("minHeight",-1/0)),d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("height",h)}else a._prevSettings.height instanceof f&&a.setPrivate("height",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginTop",0),l=o.top,d=o.bottom,p=a.get("maxHeight");p&&d-l>p&&(d=l+p);let u=a.get("marginBottom",0),_=n+h-l;a.setPrivate("y",_),n=_+d+u}else a.setPrivate("y",void 0)})}}Object.defineProperty(X,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty(X,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([X.className])});class $ extends E{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(t){let e=t.get("paddingLeft",0),s=t.get("paddingRight",0),r=t.get("paddingTop",0),n=t.maxWidth()-e-s,a=n,o=1;j(t,m=>{if(m.get("visible")&&m.getPrivate("visible")&&!m.get("forceHidden")&&m.get("position")!="absolute"){let b=m.width();bo&&(o=b)}}),a=Nt(a,1,n),o=Nt(o,1,n);let h=1;h=this.get("fixedWidthGrid")?n/o:n/a,h=Math.max(1,Math.floor(h)),h=Math.min(this.get("maxColumns",Number.MAX_VALUE),h);let l=this.getColumnWidths(t,h,o,n),d=r,p=0,u=0;h=l.length;let _=e;j(t,m=>{if(m.get("position")=="relative"&&m.isVisible()){const b=m.get("marginTop",0),S=m.get("marginBottom",0);let H=m.adjustedLocalBounds(),w=m.get("marginLeft",0),C=m.get("marginRight",0),x=_+w-H.left,L=d+b-H.top;m.setPrivate("x",x),m.setPrivate("y",L),_+=l[p]+C,u=Math.max(u,m.height()+b+S),p++,p>=h&&(p=0,_=e,d+=u)}})}getColumnWidths(t,e,s,r){let n=0,a=[],o=0;return j(t,h=>{let l=h.adjustedLocalBounds();h.get("position")!="absolute"&&h.isVisible()&&(this.get("fixedWidthGrid")?a[o]=s:a[o]=Math.max(0|a[o],l.right-l.left+h.get("marginLeft",0)+h.get("marginRight",0)),o{n+=h}),n>r?e>2?(e-=1,this.getColumnWidths(t,e,s,r)):[r]:a}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([$.className])});class xt{static escape(t){return t.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(t){return t.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(t){return t.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(t,e=!1,s=!1){let r=[];t=this.escape(t);let n=e?t.split("'"):[t];for(let a=0;a{t.dispose()}),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(t=>{t.removePrivate("x"),t.removePrivate("y")})),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each(t=>{t.markDirtyPosition()}),this.isDirty("maskContent")){const t=this._childrenDisplay;let e=this._contentMask;this.get("maskContent")?e||(e=z.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=e,t.addChildAt(e._display,0),t.mask=e._display):e&&(t.removeChild(e._display),t.mask=null,e.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),c(this._percentageSizeChildren,t=>{t._updateSize()}),c(this._percentagePositionChildren,t=>{t.markDirtyPosition(),t._updateSize()}),this.updateBackground()}updateBackground(){const t=this.get("background");let e=this._localBounds;if(e&&!this.isHidden()){let s=e.left,r=e.top,n=e.right-s,a=e.bottom-r,o=this.get("maxWidth"),h=this.get("maxHeight");h&&a>h&&(a=h),o&&n>o&&(n=o);let l=this.width(),d=this.height();t&&(t.setAll({width:n,height:a,x:s,y:r}),this._display.interactive&&(t._display.interactive=!0));const p=this._contentMask;p&&p.setAll({width:l+1,height:d+1});const u=this.get("verticalScrollbar");if(u){u.set("height",d),u.set("x",l-u.width()-u.get("marginRight",0)),u.set("end",u.get("start",0)+d/this._contentHeight);const _=u.get("background");_&&_.setAll({width:u.width(),height:d});let m=!0;this._contentHeight<=d&&(m=!1),u.setPrivate("visible",m)}}}_applyThemes(t=!1){return!!super._applyThemes(t)&&(this.eachChildren(e=>{e._applyThemes(t)}),!0)}_applyState(t){super._applyState(t),this.get("setStateOnChildren")&&this.eachChildren(e=>{e.states.apply(t)})}_applyStateAnimated(t,e){super._applyStateAnimated(t,e),this.get("setStateOnChildren")&&this.eachChildren(s=>{s.states.applyAnimate(t,e)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){if(this.get("html")){let t=this._localBounds;t&&(this._contentWidth=t.right-t.left,this._contentHeight=t.bottom-t.top)}else{let t=this.get("width"),e=this.get("height"),s=this.getPrivate("width"),r=this.getPrivate("height"),n={left:0,top:0,right:this.width(),bottom:this.height()},a=this.get("layout"),o=!1,h=!1;if((a instanceof Y||a instanceof $)&&(o=!0),a instanceof X&&(h=!0),t==null&&s==null||e==null&&r==null||this.get("verticalScrollbar")){let l=Number.MAX_VALUE,d=l,p=-l,u=l,_=-l;const m=this.get("paddingLeft",0),b=this.get("paddingTop",0),S=this.get("paddingRight",0),H=this.get("paddingBottom",0);this.children.each(x=>{if(x.get("position")!="absolute"&&x.get("isMeasured")){let L=x.adjustedLocalBounds(),jt=x.x(),Et=x.y(),at=jt+L.left,ot=jt+L.right,ht=Et+L.top,lt=Et+L.bottom;o&&(at-=x.get("marginLeft",0),ot+=x.get("marginRight",0)),h&&(ht-=x.get("marginTop",0),lt+=x.get("marginBottom",0)),atp&&(p=ot),ht_&&(_=lt)}}),d==l&&(d=0),p==-l&&(p=0),u==l&&(u=0),_==-l&&(_=0),n.left=d-m,n.top=u-b,n.right=p+S,n.bottom=_+H;const w=this.get("minWidth");g(w)&&w>0&&n.right-n.left=w?n.left=n.right-w:n.right=n.left+w);const C=this.get("minHeight");g(C)&&C>0&&n.bottom-n.top=C?n.top=n.bottom-C:n.bottom=n.top+C)}this._contentWidth=n.right-n.left,this._contentHeight=n.bottom-n.top,g(t)&&(n.left=0,n.right=t),g(s)&&(n.left=0,n.right=s),g(e)&&(n.top=0,n.bottom=e),g(r)&&(n.top=0,n.bottom=r),this._localBounds=n}}_updateBounds(){const t=this.get("layout");t&&t.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const t=this.innerWidth(),e=this.innerHeight();if(t!=this._prevWidth||e!=this._prevHeight){let s=this.get("layout"),r=!1,n=!1;s&&((s instanceof Y||s instanceof $)&&(r=!0),s instanceof X&&(n=!0)),c(this._percentageSizeChildren,a=>{if(!r){let o=a.get("width");o instanceof f&&a.setPrivate("width",o.value*t)}if(!n){let o=a.get("height");o instanceof f&&a.setPrivate("height",o.value*e)}}),c(this._percentagePositionChildren,a=>{a.markDirtyPosition(),a.markDirtyBounds()}),this._prevWidth=t,this._prevHeight=e,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateHTMLContent(){const t=this.get("html");t&&t!==""?this._root._setHTMLContent(this,rt(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}scrollToChild(t){const e=this.get("verticalScrollbar");if(e){let s=t.y(),r=this.innerHeight(),n=t.height(),a=this._contentHeight,o=1-(r-n/2)/a;if(s+.7*n+this._childrenDisplay.y>r||s-.3*n+this._childrenDisplay.y<0){let h=Math.max(0,Math.min(o,(s-n/2)/a));e.animate({key:"start",to:h,duration:e.get("animationDuration",0),easing:e.get("animationEasing")})}}}_updateChildren(){if(this.isDirty("html")&&this._updateHTMLContent(),this.isDirty("verticalScrollbar")){const t=this.get("verticalScrollbar");if(t){t._setParent(this),t.startGrip.setPrivate("visible",!1),t.endGrip.setPrivate("visible",!1),this.set("maskContent",!0),this.set("paddingRight",t.width()+t.get("marginRight",0)+t.get("marginLeft",0));let e=this.get("background");e||(e=this.set("background",z.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",s=>{const r=s.originalEvent;if(!ce(r,this))return;r.preventDefault();let n=r.deltaY/5e3;const a=t.get("start",0),o=t.get("end",1);a+n<=0&&(n=-a),o+n>=1&&(n=1-o),a+n>=0&&o+n<=1&&(t.set("start",a+n),t.set("end",o+n))}),this._disposers.push(this._vsbd0),this._vsbd1=t.events.on("rangechanged",()=>{let s=this._contentHeight;const r=this._childrenDisplay,n=this._contentMask;r.y=-t.get("start",0)*s,r.markDirtyLayer(),n&&(n._display.y=-r.y,r.mask=n._display)}),this._disposers.push(this._vsbd1),this._display.addChild(t._display)}else{const e=this._prevSettings.verticalScrollbar;e&&(this._display.removeChild(e._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose(),this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0))}}if(this.isDirty("background")){const t=this._prevSettings.background;t&&this._display.removeChild(t._display);const e=this.get("background");e instanceof k&&(e.set("isMeasured",!1),e._setParent(this),this._display.addChildAt(e._display,0))}if(this.isDirty("mask")){const t=this.get("mask"),e=this._prevSettings.mask;if(e&&(this._display.removeChild(e._display),e!=t&&e.dispose()),t){const s=t.parent;s&&s.children.removeValue(t),t._setParent(this),this._display.addChildAt(t._display,0),this._childrenDisplay.mask=t._display}}}_processTemplateField(){super._processTemplateField(),this.children.each(t=>{t._processTemplateField()})}walkChildren(t){this.children.each(e=>{e instanceof Qt&&e.walkChildren(t),t(e)})}eachChildren(t){const e=this.get("background");e&&t(e);const s=this.get("verticalScrollbar");s&&t(s);const r=this.get("mask");r&&t(r),this.children.values.forEach(n=>{t(n)})}allChildren(){const t=[];return this.eachChildren(e=>{t.push(e)}),t}_setDataItem(t){const e=t!==this._dataItem;super._setDataItem(t);const s=this.get("html","");s&&s!==""&&e&&this._root._setHTMLContent(this,rt(this,s))}};Object.defineProperty(Z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(Z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([Z.className])});class it extends k{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","maxChars"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text")){super._updateBounds();let t=this.get("fillGradient");t&&(this._display.style.fill=t.getFill(this))}else{let t={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=t}}_changed(){super._changed(),this._display.clear();let t=this.textStyle;if(this.isDirty("opacity")){let e=this.get("opacity",1);this._display.alpha=e}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),this.get("role")=="tooltip"&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new D(()=>{this._root._removeTooltipElement(this)})),this.isDirty("width")&&(t.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(t.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(t.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(t.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(t.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(t.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")||this.isDirty("fillGradient")){const e=this.get("fill"),s=this.get("fillGradient"),r=this.get("fillOpacity");if(s){if(e){const n=s.get("stops",[]);n.length&&c(n,a=>{a.color&&!a.colorInherited||!e||(a.color=e,a.colorInherited=!0),(a.opacity==null||a.opacityInherited)&&(a.opacity=r,a.opacityInherited=!0)})}t.fill=s.getFill(this)}else e&&(t.fill=e)}if(this.isDirty("fillOpacity")){let e=this.get("fillOpacity",1);e&&(t.fillOpacity=e)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(t.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(t.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),c(this._textStyles,e=>{this._dirty[e]&&(t[e]=this.get(e),this.markDirtyBounds())}),t.fontSize=this.get("fontSize"),t.fontFamily=this.get("fontFamily"),this._display.style=t,this.isDirty("role")&&this.get("role")=="tooltip"&&this._root.updateTooltip(this)}_getText(){let t=this.get("text","");return this.get("maxChars")&&(t=fe(t,this.get("maxChars",1e8),this.get("breakWords"),this.get("ellipsis"))),this.get("populateText")?rt(this,t):t}_getAccessibleText(){const t=this.get("ariaLabel");return t!==void 0?this.get("populateText")?rt(this,t):t:this._getText()}markDirtyText(){this._display.text=this._getText(),this.get("role")=="tooltip"&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(t){super._setDataItem(t),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(it,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(it,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([it.className])});class _t extends Z{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillGradient","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting","maxChars","ariaLabel"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),c(this._textKeys,t=>{const e=this.get(t);e!=null&&this._text.set(t,e)}),this.get("html","")!==""&&this._text.set("text",""),this.onPrivate("maxWidth",()=>{this._setMaxDimentions()}),this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(it.new(this._root,{}))}_updateChildren(){super._updateChildren();const t=this._text;if(c(this._textKeys,s=>{this._text.set(s,this.get(s))}),(this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isDirty("rotation"))&&this._setMaxDimentions(),this.get("html","")!==""?t.set("text",""):(t.set("text",this.get("text")),this._maybeUpdateHTMLColor()),(this.isDirty("fill")||this.isDirty("fillGradient"))&&this._maybeUpdateHTMLColor(),this.isDirty("textAlign")||this.isDirty("width")){const s=this.get("textAlign");let r;this.get("width")!=null?r=s=="right"?qt:s=="center"?te:0:s=="left"||s=="start"?r=this.get("paddingLeft",0):s!="right"&&s!="end"||(r=-this.get("paddingRight",0)),t.set("x",r)}const e=this.get("background");e&&e.setPrivate("visible",t._display.textVisible)}_maybeUpdateHTMLColor(){const t=this.getPrivate("htmlElement");t&&this.get("fill")&&(t.style.color=this.get("fill").toCSSHex())}_setMaxDimentions(){const t=this.get("rotation"),e=t==90||t==270||t==-90,s=this._text,r=this.get("maxWidth",this.getPrivate("maxWidth",1/0));g(r)?s.set(e?"maxHeight":"maxWidth",r-this.get("paddingLeft",0)-this.get("paddingRight",0)):s.set(e?"maxHeight":"maxWidth",void 0);const n=this.get("maxHeight",this.getPrivate("maxHeight",1/0));g(n)?s.set(e?"maxWidth":"maxHeight",n-this.get("paddingTop",0)-this.get("paddingBottom",0)):s.set(e?"maxWidth":"maxHeight",void 0),this.root.events.once("frameended",()=>{s.markDirtyBounds()})}_setDataItem(t){super._setDataItem(t),this._markDirtyKey("text");const e=this._text;e.get("populateText")&&e.markDirtyText();const s=this.get("html");s&&s!==""&&this._updateHTMLContent()}getText(){return this._text._getText()}getAccessibleText(){return this._text._getAccessibleText()}}Object.defineProperty(_t,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(_t,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Z.classNames.concat([_t.className])});class Li{constructor(t,e){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=t,!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(t){const e=new this(t,!0);return e.setupDefaultRules(),e}setupDefaultRules(){}_lookupRules(t){return this._rules[t]}ruleRaw(t,e=[]){let s=this._rules[t];s||(s=this._rules[t]=[]),e.sort(R);const{index:r,found:n}=oe(s,a=>{const o=R(a.tags.length,e.length);return o===0?Jt(a.tags,e,R):o});if(n)return s[r].template;{const a=J.new({});return s.splice(r,0,{tags:e,template:a}),a}}rule(t,e=[]){return this.ruleRaw(t,e)}}export{Ht as $,Ve as A,g as B,wi as C,D,B as E,di as F,Y as G,Z as H,oi as I,ct as J,z as K,N as L,vi as M,R as N,Bi as O,P,yi as Q,li as R,ti as S,qe as T,qt as U,G as V,Q as W,_i as X,$ as Y,fi as Z,xt as _,Kt as a,mi as a0,bi as a1,mt as a2,ci as a3,Je as a4,Ge as a5,Qe as a6,st as a7,y as a8,ri as a9,wt as aA,yt as aB,Zt as aC,Ii as aD,Ie as aE,Xt as aF,ne as aG,xe as aH,Te as aI,Ye as aJ,Si as aK,Hi as aL,Bt as aM,xi as aN,Tt as aO,Pi as aP,ji as aQ,ue as aa,O as ab,si as ac,ai as ad,U as ae,Xe as af,Dt as ag,vt as ah,Ei as ai,gi as aj,ni as ak,Vt as al,Ci as am,Ti as an,Di as ao,_t as ap,Nt as aq,Li as ar,Ai as as,te as at,Ee as au,ce as av,M as aw,Mi as ax,Oi as ay,J as az,hi as b,c,ii as d,Wt as e,pi as f,At as g,ze as h,Ft as i,ei as j,T as k,ki as l,it as m,f as n,ut as o,Ue as p,St as q,ui as r,Ot as s,rt as t,Ze as u,v,$e as w,Mt as x,Ke as y,X as z}; +import{k0 as tt}from"./story-Doly9N9p.js";class f{constructor(t){Object.defineProperty(this,"_value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._value=t}get value(){return this._value/100}get percent(){return this._value}toString(){return this._value+"%"}interpolate(t,e){return t+this.value*(e-t)}static normalize(t,e,s){return t instanceof f?t:new f(e===s?0:100*Math.min(Math.max(1/(s-e)*(t-e),0),1))}}function Ot(i){return new f(i)}Ot(0);const qt=Ot(100),te=Ot(50);function Ue(i){return i instanceof f}function Tt(i){return Number(i)!==i}function ee(i){return{}.toString.call(i)}function mt(i){if(i!=null&&!g(i)){let t=Number(i);return Tt(t)&&Ft(i)&&i!=""?mt(i.replace(/[^0-9.\-]+/g,"")):t}return i}function ie(i){if(ft(i))return new Date(i);if(g(i))return new Date(i);{let t=Number(i);return g(t)?new Date(t):new Date(i)}}function Ve(i){if(Tt(i))return"NaN";if(i===1/0)return"Infinity";if(i===-1/0)return"-Infinity";if(i===0&&1/i==-1/0)return"-0";let t=i<0;i=Math.abs(i);let e,s=/^([0-9]+)(?:\.([0-9]+))?(?:e[\+\-]([0-9]+))?$/.exec(""+i),r=s[1],n=s[2]||"";if(s[3]===void 0)e=n===""?r:r+"."+n;else{let a=+s[3];if(i<1)e="0."+Ct("0",a-1)+r+n;else{let o=a-n.length;e=o===0?r+n:o<0?r+n.slice(0,o)+"."+n.slice(o):r+n+Ct("0",o)}}return t?"-"+e:e}function Ct(i,t){return new Array(t+1).join(i)}function ft(i){return ee(i)==="[object Date]"}function Ft(i){return typeof i=="string"}function g(i){return typeof i=="number"&&Number(i)==i}function St(i){return typeof i=="object"&&i!==null}const Mt="__§§§__",Ke="__§§§§__";function st(i,t){const e=i.length;for(let s=0;s0;)--e,t(i[e],e)}function ze(i,t){const e=i.length;for(let s=0;s0;)if(--e,t(i[e],e))return e;return-1}function ne(i,t){const e=Ut(i,t);if(e!==-1)return i[e]}function ae(i,t){const e=re(i,t);if(e!==-1)return i[e]}function oe(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:a===0?(r=!0,e=n+1):s=n}return{found:r,index:r?e-1:e}}function he(i,t){let e=0,s=i.length,r=!1;for(;e>1,a=t(i[n]);a<0?e=n+1:(a===0&&(r=!0),s=n)}return{found:r,index:e}}function $e(i,t){let e=i.length;for(;e>0;)--e,t(i[e])||i.splice(e,1)}function T(i){return Object.keys(i)}function le(i,t){return T(i).sort(t)}function Ze(i){return Object.assign({},i)}function v(i,t){T(i).forEach(e=>{t(e,i[e])})}function Je(i,t){for(let e in i)if(de(i,e)&&!t(e,i[e]))break}function de(i,t){return{}.hasOwnProperty.call(i,t)}class Vt{constructor(){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class D{constructor(t){Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dispose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposed=!1,this._dispose=t}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Qe extends Vt{constructor(){super(...arguments),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_dispose(){c(this._disposers,t=>{t.dispose()})}}class O extends Vt{constructor(t){super(),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._disposers=t}_dispose(){c(this._disposers,t=>{t.dispose()})}get disposers(){return this._disposers}}class ue extends D{constructor(){super(...arguments),Object.defineProperty(this,"_counter",{enumerable:!0,configurable:!0,writable:!0,value:0})}increment(){return++this._counter,new D(()=>{--this._counter,this._counter===0&&this.dispose()})}}function qe(i){i.parentNode&&i.parentNode.removeChild(i)}function Kt(i,t,e,s){return i.addEventListener(t,e,s||!1),new D(()=>{i.removeEventListener(t,e,s||!1)})}function ti(i){return Kt(window,"resize",t=>{i()})}function ut(i){switch(i){case"touchevents":return window.hasOwnProperty("TouchEvent");case"pointerevents":return window.hasOwnProperty("PointerEvent");case"mouseevents":return window.hasOwnProperty("MouseEvent");case"wheelevents":return window.hasOwnProperty("WheelEvent");case"keyboardevents":return window.hasOwnProperty("KeyboardEvent")}return!1}function pt(i){return i.pointerId||0}function ei(){if(document.activeElement&&document.activeElement!=document.body)if(document.activeElement.blur)document.activeElement.blur();else{let i=document.createElement("button");i.style.position="fixed",i.style.top="0px",i.style.left="-10000px",document.body.appendChild(i),i.focus(),i.blur(),document.body.removeChild(i)}}function ii(i){i&&i.focus()}function si(i){if(ut("pointerevents"))return i;if(ut("touchevents"))switch(i){case"pointerover":case"pointerdown":return"touchstart";case"pointerout":case"pointerleave":case"pointerup":return"touchend";case"pointermove":return"touchmove";case"click":return"click";case"dblclick":return"dblclick"}else if(ut("mouseevents"))switch(i){case"pointerover":return"mouseover";case"pointerout":return"mouseout";case"pointerleave":return"mouseleave";case"pointerdown":return"mousedown";case"pointermove":return"mousemove";case"pointerup":return"mouseup";case"click":return"click";case"dblclick":return"dblclick"}return i}function Bt(i){if(typeof Touch<"u"&&i instanceof Touch)return!0;if(typeof PointerEvent<"u"&&i instanceof PointerEvent&&i.pointerType!=null)switch(i.pointerType){case"touch":case"pen":case 2:return!0;case"mouse":case 4:return!1;default:return!(i instanceof MouseEvent)}else if(i.type!=null&&i.type.match(/^mouse/))return!1;return!0}function ri(i,t,e){i.style[t]=e}function ni(i,t){return i.style[t]}function ai(i){if(i.composedPath){const t=i.composedPath();return t.length===0?null:t[0]}return i.target}function pe(i,t){let e=t;for(;;){if(i===e)return!0;if(e.parentNode===null){if(e.host==null)return!1;e=e.host}else e=e.parentNode}}function ce(i,t){return i.target&&pe(t.root.dom,i.target)}function oi(i,t){i.style.pointerEvents=t?"auto":"none"}function hi(i){if(i.key!==void 0)return i.key;switch(i.keyCode){case 9:return"Tab";case 13:return"Enter";case 16:return"Shift";case 17:return"Control";case 27:return"Escape";case 32:return" ";case 37:return"ArrowLeft";case 38:return"ArrowUp";case 39:return"ArrowRight";case 40:return"ArrowDown";case 46:return"Delete"}return""+i.keyCode}function ge(){return/apple/i.test(navigator.vendor)&&"ontouchend"in document}function li(){return ge()?1:void 0}function M(i,t){return g(i)?i:i!=null&&g(i.value)&&g(t)?t*i.value:0}function di(i){let t=(""+i).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return t?Math.max(0,(t[1]?t[1].length:0)-(t[2]?+t[2]:0)):0}function ct(i,t=0,e="0"){return typeof i!="string"&&(i=i.toString()),t>i.length?Array(t-i.length+1).join(e)+i:i}function _e(i){return i.replace(/^[\s]*/,"")}function me(i){return i.replace(/[\s]*$/,"")}function vt(i){return _e(me(i))}function fe(i,t,e=!1,s="..."){if(i.length>t){let r=t-1;for(;r>=0&&i.charAt(r).match(/\w/);)r--;return r>=0&&e==0?i.substring(0,r+1)+"...":i.substring(0,t)+s}return i}function ui(i){return i.replace(/\/(date|number|duration)$/i,"")}function pi(i){return i&&i.replace(/<[^>]*>/g,"")}function ci(i){return i.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}function gi(i){const t=/[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/,e=/([^اأدذرزو]*[اأدذرزو])/gi;let s=i.split(/(\s+)/),r=[];return s.forEach(n=>{if(n.match(/^\s+$/))(n=" ")&&(n=" "),r.push(n);else if(t.test(n)){let a=n.split(e).filter(o=>o!=="");r=r.concat(a)}else r=r.concat([...n])}),r}function _i(i,t=!1){const e=new Date(i.getFullYear(),0,0),s=i.getTime()-e.getTime()+60*(e.getTimezoneOffset()-i.getTimezoneOffset())*1e3;return Math.floor(s/864e5)}function Ht(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;e.setUTCDate(e.getUTCDate()+4-s);const r=new Date(Date.UTC(e.getUTCFullYear(),0,1));return Math.ceil(((e.getTime()-r.getTime())/864e5+1)/7)}function mi(i,t=!1){const e=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),s=e.getUTCDay()||7;return e.setUTCDate(e.getUTCDate()+4-s),new Date(Date.UTC(e.getUTCFullYear(),0,1)).getFullYear()}function fi(i,t=!1){const e=Ht(new Date(i.getFullYear(),i.getMonth(),1),t);let s=Ht(i,t);return s==1&&(s=53),s-e+1}function bi(i,t,e=1,s=!1){let r=new Date(t,0,4,0,0,0,0);return s&&r.setUTCFullYear(t),7*i+e-((r.getDay()||7)+3)}function vi(i,t){return i>12?i-=12:i===0&&(i=12),t!=null?i+(t-1):i}function yi(i,t=!1,e=!1,s=!1,r){if(s)return t?"Coordinated Universal Time":"UTC";if(r){const o=i.toLocaleString("en-US",{timeZone:r});return vt(i.toLocaleString("en-US",{timeZone:r,timeZoneName:t?"long":"short"}).substr(o.length))}let n=i.toLocaleString("UTC"),a=i.toLocaleString("UTC",{timeZoneName:t?"long":"short"}).substr(n.length);return e===!1&&(a=a.replace(/ (standard|daylight|summer|winter) /i," ")),vt(a)}function wi(i){const t=new Date(Date.UTC(2012,0,1,0,0,0,0)),e=new Date(t.toLocaleString("en-US",{timeZone:"UTC"}));return(new Date(t.toLocaleString("en-US",{timeZone:i})).getTime()-e.getTime())/6e4*-1}function Pi(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Gt(i){let t,e,s,r=i.h,n=i.s,a=i.l;if(n==0)t=e=s=a;else{let o=function(d,p,u){return u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?d+6*(p-d)*u:u<.5?p:u<.6666666666666666?d+(p-d)*(.6666666666666666-u)*6:d},h=a<.5?a*(1+n):a+n-a*n,l=2*a-h;t=o(l,h,r+1/3),e=o(l,h,r),s=o(l,h,r-1/3)}return{r:Math.round(255*t),g:Math.round(255*e),b:Math.round(255*s)}}function zt(i){let t=i.r/255,e=i.g/255,s=i.b/255,r=Math.max(t,e,s),n=Math.min(t,e,s),a=0,o=0,h=(r+n)/2;if(r===n)a=o=0;else{let l=r-n;switch(o=h>.5?l/(2-r-n):l/(r+n),r){case t:a=(e-s)/l+(e0?255-i:i;return Math.round(e*t)}function ve(i,t){if(i){let e=et(Math.min(Math.max(i.r,i.g,i.b),230),t);return{r:Math.max(0,Math.min(255,Math.round(i.r+e))),g:Math.max(0,Math.min(255,Math.round(i.g+e))),b:Math.max(0,Math.min(255,Math.round(i.b+e))),a:i.a}}return i}function It(i){return(299*i.r+587*i.g+114*i.b)/1e3>=128}function ye(i,t){if(i===void 0||t==1)return i;let e=zt(i);return e.s=t,Gt(e)}function we(i,t={r:255,g:255,b:255},e={r:255,g:255,b:255}){let s=t,r=e;return It(e)&&(s=e,r=t),It(i)?r:s}function Di(i,t){return i||(i=[]),[...i,...t].filter((e,s,r)=>r.indexOf(e)===s)}function xi(i,t){return!!t&&i.left==t.left&&i.right==t.right&&i.top==t.top&&i.bottom==t.bottom}function Yt(i){return i[0]==="#"&&(i=i.substr(1)),i.length==3&&(i=i[0].repeat(2)+i[1].repeat(2)+i[2].repeat(2)),parseInt(i,16)}function Pe(i){let t=(i=i.replace(/[ ]/g,"")).match(/^rgb\(([0-9]*),([0-9]*),([0-9]*)\)/i);if(t)t.push("1");else if(t=i.match(/^rgba\(([0-9]*),([0-9]*),([0-9]*),([.0-9]*)\)/i),!t)return 0;let e="";for(let s=1;s<=3;s++){let r=parseInt(t[s]).toString(16);r.length==1&&(r="0"+r),e+=r}return Yt(e)}function ki(i){return y.fromAny(i)}class y{constructor(t){Object.defineProperty(this,"_hex",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hex=0|t}get hex(){return this._hex}get r(){return this._hex>>>16}get g(){return this._hex>>8&255}get b(){return 255&this._hex}toCSS(t=1){return"rgba("+this.r+", "+this.g+", "+this.b+", "+t+")"}toCSSHex(){return"#"+ct(this.r.toString(16),2)+ct(this.g.toString(16),2)+ct(this.b.toString(16),2)}toHSL(t=1){return zt({r:this.r,g:this.g,b:this.b,a:t})}static fromHSL(t,e,s){const r=Gt({h:t,s:e,l:s});return this.fromRGB(r.r,r.g,r.b)}toString(){return this.toCSSHex()}static fromHex(t){return new y(t)}static fromRGB(t,e,s){return new y((0|s)+(e<<8)+(t<<16))}static fromString(t){return new y(Yt(t))}static fromCSS(t){return new y(Pe(t))}static fromAny(t){if(Ft(t)){if(t[0]=="#")return y.fromString(t);if(t.substr(0,3)=="rgb")return y.fromCSS(t)}else{if(g(t))return y.fromHex(t);if(t instanceof y)return y.fromHex(t.hex)}throw new Error("Unknown color syntax: "+t)}static alternative(t,e,s){const r=we({r:t.r,g:t.g,b:t.b},e?{r:e.r,g:e.g,b:e.b}:void 0,s?{r:s.r,g:s.g,b:s.b}:void 0);return this.fromRGB(r.r,r.g,r.b)}static interpolate(t,e,s,r="rgb"){if(r=="hsl"){const n=e.toHSL(),a=s.toHSL();return y.fromHSL(A(t,n.h,a.h),A(t,n.s,a.s),A(t,n.l,a.l))}return y.fromRGB(A(t,e.r,s.r),A(t,e.g,s.g),A(t,e.b,s.b))}static lighten(t,e){const s=be({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static brighten(t,e){const s=ve({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}static saturate(t,e){const s=ye({r:t.r,g:t.g,b:t.b},e);return y.fromRGB(s.r,s.g,s.b)}}class Q{constructor(){Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_killed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_iterating",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._listeners=[],this._killed=[],this._disabled={},this._iterating=0,this._enabled=!0,this._disposed=!1}isDisposed(){return this._disposed}dispose(){if(!this._disposed){this._disposed=!0;const t=this._listeners;this._iterating=1,this._listeners=null,this._disabled=null;try{c(t,e=>{e.disposer.dispose()})}finally{this._killed=null,this._iterating=null}}}hasListeners(){return this._listeners.length!==0}hasListenersByType(t){return se(this._listeners,e=>(e.type===null||e.type===t)&&!e.killed)}enable(){this._enabled=!0}disable(){this._enabled=!1}enableType(t){delete this._disabled[t]}disableType(t,e=1/0){this._disabled[t]=e}_removeListener(t){if(this._iterating===0){const e=this._listeners.indexOf(t);if(e===-1)throw new Error("Invalid state: could not remove listener");this._listeners.splice(e,1)}else this._killed.push(t)}_removeExistingListener(t,e,s,r){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(n=>{n.once!==t||n.type!==e||s!==void 0&&n.callback!==s||n.context!==r||n.disposer.dispose()})}isEnabled(t){if(this._disposed)throw new Error("EventDispatcher is disposed");return this._enabled&&this._listeners.length>0&&this.hasListenersByType(t)&&this._disabled[t]===void 0}removeType(t){if(this._disposed)throw new Error("EventDispatcher is disposed");this._eachListener(e=>{e.type===t&&e.disposer.dispose()})}has(t,e,s){return Ut(this._listeners,r=>r.once!==!0&&r.type===t&&(e===void 0||r.callback===e)&&r.context===s)!==-1}_shouldDispatch(t){if(this._disposed)throw new Error("EventDispatcher is disposed");const e=this._disabled[t];return g(e)?(e<=1?delete this._disabled[t]:--this._disabled[t],!1):this._enabled}_eachListener(t){++this._iterating;try{c(this._listeners,t)}finally{--this._iterating,this._iterating===0&&this._killed.length!==0&&(c(this._killed,e=>{this._removeListener(e)}),this._killed.length=0)}}dispatch(t,e){this._shouldDispatch(t)&&this._eachListener(s=>{s.killed||s.type!==null&&s.type!==t||s.dispatch(t,e)})}_on(t,e,s,r,n,a){if(this._disposed)throw new Error("EventDispatcher is disposed");this._removeExistingListener(t,e,s,r);const o={type:e,callback:s,context:r,shouldClone:n,dispatch:a,killed:!1,once:t,disposer:new D(()=>{o.killed=!0,this._removeListener(o)})};return this._listeners.push(o),o}onAll(t,e,s=!0){return this._on(!1,null,t,e,s,(r,n)=>t.call(e,n)).disposer}on(t,e,s,r=!0){return this._on(!1,t,e,s,r,(n,a)=>e.call(s,a)).disposer}once(t,e,s,r=!0){const n=this._on(!0,t,e,s,r,(a,o)=>{n.disposer.dispose(),e.call(s,o)});return n.disposer}off(t,e,s){this._removeExistingListener(!1,t,e,s)}copyFrom(t){if(this._disposed)throw new Error("EventDispatcher is disposed");if(t===this)throw new Error("Cannot copyFrom the same TargetedEventDispatcher");const e=[];return c(t._listeners,s=>{!s.killed&&s.shouldClone&&(s.type===null?e.push(this.onAll(s.callback,s.context)):s.once?e.push(this.once(s.type,s.callback,s.context)):e.push(this.on(s.type,s.callback,s.context)))}),new O(e)}}function Lt(i){return tt(this,void 0,void 0,function*(){if(i!==void 0){const t=[];v(i,(e,s)=>{t.push(s.waitForStop())}),yield Promise.all(t)}})}function A(i,t,e){return t+i*(e-t)}function De(i,t,e){return i>=1?e:t}function xe(i,t,e){return new f(A(i,t.percent,e.percent))}function ke(i,t,e){return y.interpolate(i,t,e)}function Oe(i,t){return typeof i=="number"&&typeof t=="number"?A:i instanceof f&&t instanceof f?xe:i instanceof y&&t instanceof y?ke:De}var U;function F(i,t){if(!(i>=0&&i=0&&t{this.push(e)})}copyFrom(t){this.pushAll(t._values)}pop(){return this._values.length-1<0?void 0:this.removeIndex(this._values.length-1)}shift(){return this._values.length?this.removeIndex(0):void 0}setAll(t){const e=this._values;this._values=[],this._onClear(e),c(t,s=>{this._values.push(s),this._onPush(s)})}clear(){this.setAll([])}*[Symbol.iterator](){const t=this._values.length;for(let e=0;e{e.dispose()}),super._onClear(t)}_dispose(){this.autoDispose&&c(this._values,t=>{t.dispose()})}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}}class Oi extends Te{constructor(t,e){super(),Object.defineProperty(this,"template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"make",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.template=t,this.make=e}_dispose(){super._dispose(),this.autoDispose&&this.template.dispose()}}class Se extends Xt{constructor(t){super(),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._container=t,this._events=this.events.onAll(e=>{if(e.type==="clear")c(e.oldValues,s=>{this._onRemoved(s)});else if(e.type==="push")this._onInserted(e.newValue);else if(e.type==="setIndex")this._onRemoved(e.oldValue),this._onInserted(e.newValue,e.index);else if(e.type==="insertIndex")this._onInserted(e.newValue,e.index);else if(e.type==="removeIndex")this._onRemoved(e.oldValue);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._onRemoved(e.value),this._onInserted(e.value,e.newIndex)}})}_onInserted(t,e){t._setParent(this._container,!0);const s=this._container._childrenDisplay;e===void 0?s.addChild(t._display):s.addChildAt(t._display,e)}_onRemoved(t){this._container._childrenDisplay.removeChild(t._display),this._container.markDirtyBounds(),this._container.markDirty()}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._events.dispose(),c(this.values,t=>{t.dispose()}))}}const $t=Math.PI,Zt=$t/180,Ti=180/$t;function Si(i,t,e){if(!g(t)||t<=0)return Math.round(i);{let s=Math.pow(10,t);return Math.round(i*s)/s}}function ji(i,t){if(!g(t)||t<=0)return Math.ceil(i);{let e=Math.pow(10,t);return Math.ceil(i*e)/e}}function Nt(i,t,e){return Math.min(Math.max(i,t),e)}function yt(i){return Math.sin(Zt*i)}function wt(i){return Math.cos(Zt*i)}function Ei(i){return(i%=360)<0&&(i+=360),i}function Ci(i,t,e,s,r){let n=Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,h=-Number.MAX_VALUE,l=[];l.push(gt(r,e)),l.push(gt(r,s));let d=Math.min(90*Math.floor(e/90),90*Math.floor(s/90)),p=Math.max(90*Math.ceil(e/90),90*Math.ceil(s/90));for(let u=d;u<=p;u+=90)u>=e&&u<=s&&l.push(gt(r,u));for(let u=0;uo&&(o=_.x),_.y>h&&(h=_.y)}return{left:i+n,top:t+a,right:i+o,bottom:t+h}}function gt(i,t){return{x:i*wt(t),y:i*yt(t)}}function Mi(i){const t=i.length;if(t>0){let e=i[0],s=e.left,r=e.top,n=e.right,a=e.bottom;if(t>1)for(let o=1;o=t.left&&i.y>=t.top&&i.x<=t.right&&i.y<=t.bottom}function Rt(i){return i}function Ee(i){return i*i*i}function Ai(i){return function(t){return 1-i(1-t)}}class Ce{constructor(t,e){Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_userSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._entity=t,this._settings=e,v(e,s=>{this._userSettings[s]=!0})}get(t,e){const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._settings[t]=e}set(t,e){this._userSettings[t]=!0,this.setRaw(t,e)}remove(t){delete this._userSettings[t],delete this._settings[t]}setAll(t){T(t).forEach(e=>{this.set(e,t[e])})}_eachSetting(t){v(this._settings,t)}apply(){const t={stateAnimationEasing:!0,stateAnimationDuration:!0},e=this._entity.states.lookup("default");this._eachSetting((s,r)=>{t[s]||(t[s]=!0,this!==e&&(s in e._settings||(e._settings[s]=this._entity.get(s))),this._entity.set(s,r))})}applyAnimate(t){t==null&&(t=this._settings.stateAnimationDuration),t==null&&(t=this.get("stateAnimationDuration",this._entity.get("stateAnimationDuration",0)));let e=this._settings.stateAnimationEasing;e==null&&(e=this.get("stateAnimationEasing",this._entity.get("stateAnimationEasing",Ee)));const s=this._entity.states.lookup("default"),r={stateAnimationEasing:!0,stateAnimationDuration:!0},n={};return this._eachSetting((a,o)=>{if(!r[a]){r[a]=!0,this!=s&&(a in s._settings||(s._settings[a]=this._entity.get(a)));const h=this._entity.animate({key:a,to:o,duration:t,easing:e});h&&(n[a]=h)}}),n}}class Me{constructor(t){Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._entity=t}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Ce(this._entity,e);return this._states[t]=r,r}}remove(t){delete this._states[t]}apply(t){const e=this._states[t];e&&e.apply(),this._entity._applyState(t)}applyAnimate(t,e){let s;const r=this._states[t];return r&&(s=r.applyAnimate(e)),this._entity._applyStateAnimated(t,e),s}}class Ae{constructor(){Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.10.7"}),Object.defineProperty(this,"licenses",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"entitiesById",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"rootElements",{enumerable:!0,configurable:!0,writable:!0,value:[]})}}const N=new Ae;function Bi(i){N.licenses.push(i)}function R(i,t){return i===t?0:i{P(s,e)&&this._entity._markDirtyKey(t)})}remove(t){const e=this._callbacks[t];e!==void 0&&(delete this._callbacks[t],e.length!==0&&this._entity._markDirtyKey(t))}enable(t){this._disabled[t]&&(delete this._disabled[t],this._entity._markDirtyKey(t))}disable(t){this._disabled[t]||(this._disabled[t]=!0,this._entity._markDirtyKey(t))}fold(t,e){if(!this._disabled[t]){const s=this._callbacks[t];if(s!==void 0)for(let r=0,n=s.length;r{if(this._stopped)t();else{const s=()=>{r.dispose(),t()},r=this.events.on("stopped",s)}})}_checkEnded(){return!(this._loops>1)||(--this._loops,!1)}_run(t){this._oldTime!==null&&(this._time+=t-this._oldTime,this._time>this._duration&&(this._time=this._duration)),this._oldTime=t}_reset(t){this._oldTime=t,this._time=0}_value(t){return this._interpolate(this._easing(t),this._from,this._to)}}let He=0;class Ie{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:++He}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_prevPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_animatingPrivateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_userProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"enableDispose",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._settings=t}_checkDirty(){T(this._settings).forEach(t=>{this._userProperties[t]=!0,this._markDirtyKey(t)})}resetUserSettings(){this._userProperties={}}_runAnimation(t){let e=U.Stopped;if(!this.isDisposed()){let s=!1,r=!1;v(this._animatingSettings,(n,a)=>{if(a.stopped)this._stopAnimation(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.set(n,a._value(1)):(s=!0,a._reset(t),this._set(n,a._value(1))):(s=!0,this._set(n,a._value(o)))}else r=!0}),v(this._animatingPrivateSettings,(n,a)=>{if(a.stopped)this._stopAnimationPrivate(n);else if(a.playing){a._run(t);const o=a.percentage;o>=1?a._checkEnded()?this.setPrivate(n,a._value(1)):(s=!0,a._reset(t),this._setPrivate(n,a._value(1))):(s=!0,this._setPrivate(n,a._value(o)))}else r=!0}),s?e=U.Playing:r&&(e=U.Paused)}return e}_markDirtyKey(t){this.markDirty()}_markDirtyPrivateKey(t){this.markDirty()}on(t,e){let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}off(t,e){let s=this._settingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._settingEvents[t]}onPrivate(t,e){let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}offPrivate(t,e){let s=this._privateSettingEvents[t];s!==void 0&&e!==void 0?P(s,e):delete this._privateSettingEvents[t]}getRaw(t,e){const s=this._settings[t];return s!==void 0?s:e}has(t){return t in this._settings}get(t,e){return this.getRaw(t,e)}_sendKeyEvent(t,e){const s=this._settingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_sendPrivateKeyEvent(t,e){const s=this._privateSettingEvents[t];s!==void 0&&c(s,r=>{r(e,this,t)})}_setRaw(t,e,s){this._prevSettings[t]=e,this._sendKeyEvent(t,s)}setRaw(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&this._setRaw(t,s,e)}_set(t,e){const s=this._settings[t];this._settings[t]=e,s!==e&&(this._setRaw(t,s,e),this._markDirtyKey(t))}_stopAnimation(t){const e=this._animatingSettings[t];e&&(delete this._animatingSettings[t],e.stop())}set(t,e){return this._set(t,e),this._stopAnimation(t),e}remove(t){t in this._settings&&(this._prevSettings[t]=this._settings[t],delete this._settings[t],this._sendKeyEvent(t,void 0),this._markDirtyKey(t)),this._stopAnimation(t)}removeAll(){c(T(this._settings),t=>{this.remove(t)})}getPrivate(t,e){const s=this._privateSettings[t];return s!==void 0?s:e}_setPrivateRaw(t,e,s){this._prevPrivateSettings[t]=e,this._sendPrivateKeyEvent(t,s)}setPrivateRaw(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&this._setPrivateRaw(t,s,e)}_setPrivate(t,e){const s=this._privateSettings[t];this._privateSettings[t]=e,s!==e&&(this._setPrivateRaw(t,s,e),this._markDirtyPrivateKey(t))}_stopAnimationPrivate(t){const e=this._animatingPrivateSettings[t];e&&(e.stop(),delete this._animatingPrivateSettings[t])}setPrivate(t,e){return this._setPrivate(t,e),this._stopAnimationPrivate(t),e}removePrivate(t){t in this._privateSettings&&(this._prevPrivateSettings[t]=this._privateSettings[t],delete this._privateSettings[t],this._markDirtyPrivateKey(t)),this._stopAnimationPrivate(t)}setAll(t){v(t,(e,s)=>{this.set(e,s)})}animate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.get(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.set(e,s);else{if(a!==void 0&&a!==s){this.set(e,a);const l=this._animatingSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.set(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}animatePrivate(t){const e=t.key,s=t.to,r=t.duration||0,n=t.loops||1,a=t.from===void 0?this.getPrivate(e):t.from,o=t.easing===void 0?Rt:t.easing;if(r===0)this.setPrivate(e,s);else{if(a!==void 0&&a!==s){this.setPrivate(e,a);const l=this._animatingPrivateSettings[e]=new q(this,a,s,r,o,n,this._animationTime());return this._startAnimation(),l}this.setPrivate(e,s)}const h=new q(this,a,s,r,o,n,null);return h.stop(),h}_dispose(){}isDisposed(){return this._disposed}dispose(){this.enableDispose&&!this._disposed&&(this._disposed=!0,this._dispose())}}let B=class extends Ie{constructor(i,t,e,s=[]){if(super(t),Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_user_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Me(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Be(this)}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:this._createEvents()}),Object.defineProperty(this,"_userPrivateProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPrivate",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templates",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_internalTemplates",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_defaultThemes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_templateDisposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_runSetup",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_disposerProperties",{enumerable:!0,configurable:!0,writable:!0,value:{}}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._root=i,this._internalTemplates=s,t.id&&this._registerId(t.id)}static new(i,t,e){const s=new this(i,t,!0);return s._template=e,s._afterNew(),s}static _new(i,t,e=[]){const s=new this(i,t,!0,e);return s._afterNew(),s}_afterNew(){this._checkDirty();let i=!1;const t=this._template;t&&(i=!0,t._setObjectTemplate(this)),c(this._internalTemplates,e=>{i=!0,e._setObjectTemplate(this)}),i&&this._applyTemplates(!1),this.states.create("default",{}),this._setDefaults()}_afterNewApplyThemes(){this._checkDirty();const i=this._template;i&&i._setObjectTemplate(this),c(this._internalTemplates,t=>{t._setObjectTemplate(this)}),this.states.create("default",{}),this._setDefaults(),this._applyThemes()}_createEvents(){return new Q}get classNames(){return this.constructor.classNames}get className(){return this.constructor.className}_setDefaults(){}_setDefaultFn(i,t){const e=this.get(i);if(e)return e;{const s=t();return this.set(i,s),s}}_setDefault(i,t){this.has(i)||super.set(i,t)}_setRawDefault(i,t){this.has(i)||super.setRaw(i,t)}_clearDirty(){T(this._dirty).forEach(i=>{this._dirty[i]=!1}),T(this._dirtyPrivate).forEach(i=>{this._dirtyPrivate[i]=!1})}isDirty(i){return!!this._dirty[i]}isPrivateDirty(i){return!!this._dirtyPrivate[i]}_markDirtyKey(i){this._dirty[i]=!0,super._markDirtyKey(i)}_markDirtyPrivateKey(i){this._dirtyPrivate[i]=!0,super._markDirtyKey(i)}isType(i){return this.classNames.indexOf(i)!==-1}_pushPropertyDisposer(i,t){let e=this._disposerProperties[i];return e===void 0&&(e=this._disposerProperties[i]=[]),e.push(t),t}_disposeProperty(i){const t=this._disposerProperties[i];t!==void 0&&(c(t,e=>{e.dispose()}),delete this._disposerProperties[i])}set template(i){const t=this._template;t!==i&&(this._template=i,t&&t._removeObjectTemplate(this),i&&i._setObjectTemplate(this),this._applyTemplates())}get template(){return this._template}markDirty(){this._root._addDirtyEntity(this)}_startAnimation(){this._root._addAnimation(this)}_animationTime(){return this._root.animationTime}_applyState(i){}_applyStateAnimated(i,t){}get(i,t){const e=this.adapters.fold(i,this._settings[i]);return e!==void 0?e:t}isUserSetting(i){return this._userProperties[i]||!1}set(i,t){return this._userProperties[i]=!0,super.set(i,t)}setRaw(i,t){this._userProperties[i]=!0,super.setRaw(i,t)}_setSoft(i,t){return this._userProperties[i]?t:super.set(i,t)}remove(i){delete this._userProperties[i],this._removeTemplateProperty(i)}setPrivate(i,t){return this._userPrivateProperties[i]=!0,super.setPrivate(i,t)}setPrivateRaw(i,t){this._userPrivateProperties[i]=!0,super.setPrivateRaw(i,t)}removePrivate(i){delete this._userPrivateProperties[i],this._removeTemplatePrivateProperty(i)}_setTemplateProperty(i,t,e){this._userProperties[t]||i===this._findTemplateByKey(t)&&super.set(t,e)}_setTemplatePrivateProperty(i,t,e){this._userPrivateProperties[t]||i===this._findTemplateByPrivateKey(t)&&super.setPrivate(t,e)}_removeTemplateProperty(i){if(!this._userProperties[i]){const t=this._findTemplateByKey(i);t?super.set(i,t._settings[i]):super.remove(i)}}_removeTemplatePrivateProperty(i){if(!this._userPrivateProperties[i]){const t=this._findTemplateByPrivateKey(i);t?super.setPrivate(i,t._privateSettings[i]):super.removePrivate(i)}}_walkParents(i){i(this._root._rootContainer),i(this)}_applyStateByKey(i){const t=this.states.create(i,{}),e={};this._eachTemplate(s=>{const r=s.states.lookup(i);r&&r._apply(t,e)}),v(t._settings,s=>{e[s]||t._userSettings[s]||t.remove(s)})}_applyTemplate(i,t){this._templateDisposers.push(i._apply(this,t)),v(i._settings,(e,s)=>{t.settings[e]||this._userProperties[e]||(t.settings[e]=!0,super.set(e,s))}),v(i._privateSettings,(e,s)=>{t.privateSettings[e]||this._userPrivateProperties[e]||(t.privateSettings[e]=!0,super.setPrivate(e,s))}),this._runSetup&&i.setup&&(this._runSetup=!1,i.setup(this))}_findStaticTemplate(i){if(this._template&&i(this._template))return this._template}_eachTemplate(i){this._findStaticTemplate(t=>(i(t),!1)),W(this._internalTemplates,i),c(this._templates,i)}_applyTemplates(i=!0){i&&this._disposeTemplates();const t={settings:{},privateSettings:{},states:{}};this._eachTemplate(e=>{this._applyTemplate(e,t)}),i&&(v(this._settings,e=>{this._userProperties[e]||t.settings[e]||super.remove(e)}),v(this._privateSettings,e=>{this._userPrivateProperties[e]||t.privateSettings[e]||super.removePrivate(e)}))}_findTemplate(i){const t=this._findStaticTemplate(i);if(t===void 0){const e=ae(this._internalTemplates,i);return e===void 0?ne(this._templates,i):e}return t}_findTemplateByKey(i){return this._findTemplate(t=>i in t._settings)}_findTemplateByPrivateKey(i){return this._findTemplate(t=>i in t._privateSettings)}_disposeTemplates(){c(this._templateDisposers,i=>{i.dispose()}),this._templateDisposers.length=0}_removeTemplates(){c(this._templates,i=>{i._removeObjectTemplate(this)}),this._templates.length=0}_applyThemes(i=!1){let t=!1;const e=[];let s=[];const r=new Set,n=this.get("themeTagsSelf");return n&&c(n,a=>{r.add(a)}),this._walkParents(a=>{a===this._root._rootContainer&&(t=!0),a._defaultThemes.length>0&&e.push(a._defaultThemes);const o=a.get("themes");o&&s.push(o);const h=a.get("themeTags");h&&c(h,l=>{r.add(l)})}),s=e.concat(s),this._removeTemplates(),(t||i)&&W(this.classNames,a=>{const o=[];c(s,h=>{c(h,l=>{const d=l._lookupRules(a);d&&W(d,p=>{if(p.tags.every(u=>r.has(u))){const u=he(o,_=>{const m=R(p.tags.length,_.tags.length);return m===0?Jt(p.tags,_.tags,R):m});o.splice(u.index,0,p)}})})}),c(o,h=>{this._templates.push(h.template),h.template._setObjectTemplate(this)})}),this._applyTemplates(),(t||i)&&(this._runSetup=!1),t||i}_changed(){}_beforeChanged(){if(this.isDirty("id")){const i=this.get("id");i&&this._registerId(i);const t=this._prevSettings.id;t&&delete N.entitiesById[t]}}_registerId(i){if(N.entitiesById[i]&&N.entitiesById[i]!==this)throw new Error('An entity with id "'+i+'" already exists.');N.entitiesById[i]=this}_afterChanged(){}addDisposer(i){return this._disposers.push(i),i}_dispose(){super._dispose();const i=this._template;i&&i._removeObjectTemplate(this),c(this._internalTemplates,e=>{e._removeObjectTemplate(this)}),this._removeTemplates(),this._disposeTemplates(),this.events.dispose(),this._disposers.forEach(e=>{e.dispose()}),v(this._disposerProperties,(e,s)=>{c(s,r=>{r.dispose()})});const t=this.get("id");t&&delete N.entitiesById[t]}setTimeout(i,t){const e=setTimeout(()=>{this.removeDispose(s),i()},t),s=new D(()=>{clearTimeout(e)});return this._disposers.push(s),s}removeDispose(i){if(!this.isDisposed()){let t=st(this._disposers,i);t>-1&&this._disposers.splice(t,1)}i.dispose()}hasTag(i){return st(this.get("themeTags",[]),i)!==-1}addTag(i){if(!this.hasTag(i)){const t=this.get("themeTags",[]);t.push(i),this.set("themeTags",t)}}removeTag(i){if(this.hasTag(i)){const t=this.get("themeTags",[]);Wt(t,i),this.set("themeTags",t)}}_t(i,t,...e){return this._root.language.translate(i,t,...e)}get root(){return this._root}};function Pt(i){v(i,(t,e)=>{St(e)&&typeof e.dispose=="function"&&(e.enableDispose=!0,e.dispose())})}Object.defineProperty(B,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Entity"}),Object.defineProperty(B,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:["Entity"]});class Le{constructor(t,e,s){Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._name=t,this._template=e,this._settings=s}_dispose(){Pt(this._settings)}get(t,e){const s=this._settings[t];return s!==void 0?s:e}set(t,e){this._settings[t]=e,this._template._stateChanged(this._name)}remove(t){delete this._settings[t],this._template._stateChanged(this._name)}setAll(t){T(t).forEach(e=>{this._settings[e]=t[e]}),this._template._stateChanged(this._name)}_apply(t,e){v(this._settings,(s,r)=>{e[s]||t._userSettings[s]||(e[s]=!0,t.setRaw(s,r))})}}class Ne{constructor(t){Object.defineProperty(this,"_template",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_states",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._template=t}_dispose(){v(this._states,(t,e)=>{e._dispose()})}lookup(t){return this._states[t]}create(t,e){const s=this._states[t];if(s)return s.setAll(e),s;{const r=new Le(t,this._template,e);return this._states[t]=r,this._template._stateChanged(t),r}}remove(t){delete this._states[t],this._template._stateChanged(t)}_apply(t,e){v(this._states,(s,r)=>{let n=e.states[s];n==null&&(n=e.states[s]={});const a=t.states.create(s,{});r._apply(a,n)})}}class Re{constructor(){Object.defineProperty(this,"_callbacks",{enumerable:!0,configurable:!0,writable:!0,value:{}})}add(t,e){let s=this._callbacks[t];return s===void 0&&(s=this._callbacks[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._callbacks[t]})}remove(t){this._callbacks[t]!==void 0&&delete this._callbacks[t]}_apply(t){const e=[];return v(this._callbacks,(s,r)=>{c(r,n=>{e.push(t.adapters.add(s,n))})}),new O(e)}}class J{constructor(t,e){if(Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_privateSettings",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_settingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_privateSettingEvents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_entities",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"states",{enumerable:!0,configurable:!0,writable:!0,value:new Ne(this)}),Object.defineProperty(this,"adapters",{enumerable:!0,configurable:!0,writable:!0,value:new Re}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Q}),Object.defineProperty(this,"setup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this._settings=t}static new(t){return new J(t,!0)}_dispose(){Pt(this._settings),Pt(this._privateSettings)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._dispose())}_checkDisposed(){if(this._disposed)throw new Error("Template is disposed")}get entities(){return this._entities}get(t,e){this._checkDisposed();const s=this._settings[t];return s!==void 0?s:e}setRaw(t,e){this._checkDisposed(),this._settings[t]=e}set(t,e){this._checkDisposed(),this._settings[t]!==e&&(this.setRaw(t,e),this._entities.forEach(s=>{s._setTemplateProperty(this,t,e)}))}remove(t){this._checkDisposed(),t in this._settings&&(delete this._settings[t],this._entities.forEach(e=>{e._removeTemplateProperty(t)}))}removeAll(){this._checkDisposed(),v(this._settings,(t,e)=>{this.remove(t)})}getPrivate(t,e){this._checkDisposed();const s=this._privateSettings[t];return s!==void 0?s:e}setPrivateRaw(t,e){return this._checkDisposed(),this._privateSettings[t]=e,e}setPrivate(t,e){return this._checkDisposed(),this._privateSettings[t]!==e&&(this.setPrivateRaw(t,e),this._entities.forEach(s=>{s._setTemplatePrivateProperty(this,t,e)})),e}removePrivate(t){this._checkDisposed(),t in this._privateSettings&&(delete this._privateSettings[t],this._entities.forEach(e=>{e._removeTemplatePrivateProperty(t)}))}setAll(t){this._checkDisposed(),v(t,(e,s)=>{this.set(e,s)})}on(t,e){this._checkDisposed();let s=this._settingEvents[t];return s===void 0&&(s=this._settingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._settingEvents[t]})}onPrivate(t,e){this._checkDisposed();let s=this._privateSettingEvents[t];return s===void 0&&(s=this._privateSettingEvents[t]=[]),s.push(e),new D(()=>{P(s,e),s.length===0&&delete this._privateSettingEvents[t]})}_apply(t,e){this._checkDisposed();const s=[];return v(this._settingEvents,(r,n)=>{c(n,a=>{s.push(t.on(r,a))})}),v(this._privateSettingEvents,(r,n)=>{c(n,a=>{s.push(t.onPrivate(r,a))})}),this.states._apply(t,e),s.push(this.adapters._apply(t)),s.push(t.events.copyFrom(this.events)),new O(s)}_setObjectTemplate(t){this._checkDisposed(),this._entities.push(t)}_removeObjectTemplate(t){Wt(this._entities,t)}_stateChanged(t){this._checkDisposed(),this._entities.forEach(e=>{e._applyStateByKey(t)})}}class nt extends Q{constructor(t){super(),Object.defineProperty(this,"_sprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rendererDisposers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dispatchParents",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._sprite=t}_makePointerEvent(t,e){return{type:t,originalEvent:e.event,point:e.point,simulated:e.simulated,native:e.native,target:this._sprite}}_onRenderer(t,e){this._sprite.set("interactive",!0),this._sprite._display.interactive=!0;let s=this._rendererDisposers[t];if(s===void 0){const r=this._sprite._display.on(t,n=>{e.call(this,n)});s=this._rendererDisposers[t]=new ue(()=>{delete this._rendererDisposers[t],r.dispose()})}return s.increment()}_on(t,e,s,r,n,a){const o=super._on(t,e,s,r,n,a),h=nt.RENDERER_EVENTS[e];return h!==void 0&&(o.disposer=new O([o.disposer,this._onRenderer(e,h)])),o}stopParentDispatch(){this._dispatchParents=!1}dispatchParents(t,e){const s=this._dispatchParents;this._dispatchParents=!0;try{this.dispatch(t,e),this._dispatchParents&&this._sprite.parent&&this._sprite.parent.events.dispatchParents(t,e)}finally{this._dispatchParents=s}}}Object.defineProperty(nt,"RENDERER_EVENTS",{enumerable:!0,configurable:!0,writable:!0,value:{click:function(i){this.isEnabled("click")&&!this._sprite.isDragging()&&this._sprite._hasDown()&&!this._sprite._hasMoved(this._makePointerEvent("click",i))&&this.dispatch("click",this._makePointerEvent("click",i))},rightclick:function(i){this.isEnabled("rightclick")&&this.dispatch("rightclick",this._makePointerEvent("rightclick",i))},middleclick:function(i){this.isEnabled("middleclick")&&this.dispatch("middleclick",this._makePointerEvent("middleclick",i))},dblclick:function(i){this.dispatchParents("dblclick",this._makePointerEvent("dblclick",i))},pointerover:function(i){const t=this._sprite;let e=!0;if(t.getPrivate("trustBounds")){t._getBounds();const s=t.globalBounds();if(t.isType("Graphics")){const r=t.get("strokeWidth",1)/2;r>=1&&(s.left-=r,s.right+=r,s.top-=r,s.bottom+=r)}je(i.point,s)||(e=!1,t._root._renderer.removeHovering(t._display))}e&&this.isEnabled("pointerover")&&this.dispatch("pointerover",this._makePointerEvent("pointerover",i))},pointerout:function(i){this.isEnabled("pointerout")&&this.dispatch("pointerout",this._makePointerEvent("pointerout",i))},pointerdown:function(i){this.dispatchParents("pointerdown",this._makePointerEvent("pointerdown",i))},pointerup:function(i){this.isEnabled("pointerup")&&this.dispatch("pointerup",this._makePointerEvent("pointerup",i))},globalpointerup:function(i){this.isEnabled("globalpointerup")&&this.dispatch("globalpointerup",this._makePointerEvent("globalpointerup",i))},globalpointermove:function(i){this.isEnabled("globalpointermove")&&this.dispatch("globalpointermove",this._makePointerEvent("globalpointermove",i))},wheel:function(i){this.dispatchParents("wheel",{type:"wheel",target:this._sprite,originalEvent:i.event,point:i.point})}}});class k extends B{constructor(){super(...arguments),Object.defineProperty(this,"_adjustedLocalBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dataItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_templateField",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sizeDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dragEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isHidden",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isShowing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isHiding",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_downPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_downPoints",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_toggleDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dragDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_hoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipMoveDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipPointerDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_statesHandled",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this.setPrivateRaw("visible",!0),super._afterNew()}markDirtyKey(t){this._markDirtyKey(t)}_markDirtyKey(t){super._markDirtyKey(t),t!="x"&&t!="y"&&t!="dx"&&t!="dy"||(this.markDirtyBounds(),this._addPercentagePositionChildren(),this.markDirtyPosition())}_markDirtyPrivateKey(t){super._markDirtyPrivateKey(t),t!="x"&&t!="y"||this.markDirtyPosition()}_removeTemplateField(){this._templateField&&this._templateField._removeObjectTemplate(this)}_createEvents(){return new nt(this)}_processTemplateField(){let t;const e=this.get("templateField");if(e){const s=this.dataItem;if(s){const r=s.dataContext;r&&(t=r[e],t instanceof J||!t||(t=J.new(t)))}}this._templateField!==t&&(this._removeTemplateField(),this._templateField=t,t&&t._setObjectTemplate(this),this._applyTemplates())}_setDataItem(t){const e=this._dataItem;this._dataItem=t,this._processTemplateField();const s="dataitemchanged";t!=e&&this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this,oldDataItem:e,newDataItem:t})}set dataItem(t){this._setDataItem(t)}get dataItem(){if(this._dataItem)return this._dataItem;{let t=this._parent;for(;t;){if(t._dataItem)return t._dataItem;t=t._parent}}}_addPercentageSizeChildren(){let t=this.parent;t&&(this.get("width")instanceof f||this.get("height")instanceof f?At(t._percentageSizeChildren,this):P(t._percentageSizeChildren,this))}_addPercentagePositionChildren(){let t=this.parent;t&&(this.get("x")instanceof f||this.get("y")instanceof f?At(t._percentagePositionChildren,this):P(t._percentagePositionChildren,this))}markDirtyPosition(){this._root._addDirtyPosition(this)}updatePivotPoint(){const t=this._localBounds;if(t){const e=this.get("centerX");e!=null&&(this._display.pivot.x=t.left+M(e,t.right-t.left));const s=this.get("centerY");s!=null&&(this._display.pivot.y=t.top+M(s,t.bottom-t.top))}}_beforeChanged(){if(super._beforeChanged(),this._handleStates(),this.isDirty("tooltip")){const t=this._prevSettings.tooltip;t&&t.dispose()}if((this.isDirty("layer")||this.isDirty("layerMargin"))&&(this._display.setLayer(this.get("layer"),this.get("layerMargin")),this.markDirtyLayer()),this.isDirty("tooltipPosition")){const t=this._tooltipMoveDp;t&&(t.dispose(),this._tooltipMoveDp=void 0);const e=this._tooltipPointerDp;e&&(e.dispose(),this._tooltipPointerDp=void 0),this.get("tooltipPosition")=="pointer"&&(this.isHover()&&(this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})),this._tooltipPointerDp=new O([this.events.on("pointerover",()=>{this._tooltipMoveDp=this.events.on("globalpointermove",s=>{this.showTooltip(s.point)})}),this.events.on("pointerout",()=>{const s=this._tooltipMoveDp;s&&(s.dispose(),this._tooltipMoveDp=void 0)})]))}}_handleStates(){this._statesHandled||(this.isDirty("active")&&(this.get("active")?(this.states.applyAnimate("active"),this.set("ariaChecked",!0)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!1)),this.markDirtyAccessibility()),this.isDirty("disabled")&&(this.get("disabled")?(this.states.applyAnimate("disabled"),this.set("ariaChecked",!1)):(this.isHidden()||this.states.applyAnimate("default"),this.set("ariaChecked",!0)),this.markDirtyAccessibility()),this._statesHandled=!0)}_changed(){super._changed();const t=this._display,e=this.events;if(this.isDirty("draggable")){const r=this.get("draggable");r?(this.set("interactive",!0),this._dragDp=new O([e.on("pointerdown",n=>{this.dragStart(n)}),e.on("globalpointermove",n=>{this.dragMove(n)}),e.on("globalpointerup",n=>{this.dragStop(n)})])):this._dragDp&&(this._dragDp.dispose(),this._dragDp=void 0),t.cancelTouch=!!r}if(this.isDirty("tooltipText")||this.isDirty("tooltipHTML")||this.isDirty("showTooltipOn")){const r=this.get("tooltipText"),n=this.get("tooltipHTML"),a=this.get("showTooltipOn","hover");this._tooltipDp&&(this._tooltipDp.dispose(),this._tooltipDp=void 0),(r||n)&&(a=="click"?(this._tooltipDp=new O([e.on("click",()=>{this.setTimeout(()=>{const o=this.getTooltip();o&&!o.isHidden()&&o.get("tooltipTarget")===this?this.hideTooltip():this.showTooltip()},10)}),Kt(document,"click",o=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)):a=="always"||(this._tooltipDp=new O([e.on("pointerover",()=>{this.showTooltip()}),e.on("pointerout",()=>{this.hideTooltip()})]),this._disposers.push(this._tooltipDp)))}if(this.isDirty("toggleKey")){let r=this.get("toggleKey");r&&r!="none"?this._toggleDp=e.on("click",()=>{this._isDragging||this.set(r,!this.get(r))}):this._toggleDp&&(this._toggleDp.dispose(),this._toggleDp=void 0)}if(this.isDirty("opacity")&&(t.alpha=Math.max(0,this.get("opacity",1)),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("rotation")&&(this.markDirtyBounds(),t.angle=this.get("rotation",0)),this.isDirty("scale")&&(this.markDirtyBounds(),t.scale=this.get("scale",0)),(this.isDirty("centerX")||this.isDirty("centerY"))&&(this.markDirtyBounds(),this.updatePivotPoint()),(this.isDirty("visible")||this.isPrivateDirty("visible")||this.isDirty("forceHidden"))&&(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?t.visible=!0:(t.visible=!1,this.hideTooltip()),this.markDirtyBounds(),this.get("focusable")&&this.markDirtyAccessibility()),this.isDirty("width")||this.isDirty("height")){this.markDirtyBounds(),this._addPercentageSizeChildren();const r=this.parent;r&&(this.isDirty("width")&&this.get("width")instanceof f||this.isDirty("height")&&this.get("height")instanceof f)&&(r.markDirty(),r._prevWidth=0),this._sizeDirty=!0}if((this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isPrivateDirty("width")||this.isPrivateDirty("height")||this.isDirty("minWidth")||this.isDirty("minHeight")||this.isPrivateDirty("maxWidth")||this.isPrivateDirty("maxHeight")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight")||this.isDirty("marginLeft")||this.isDirty("marginTop")||this.isDirty("marginRight")||this.isDirty("marginBottom"))&&(this.markDirtyBounds(),this._sizeDirty=!0),this._sizeDirty&&this._updateSize(),this.isDirty("wheelable")){const r=this.get("wheelable");r&&this.set("interactive",!0),t.wheelable=!!r}(this.isDirty("tabindexOrder")||this.isDirty("focusableGroup"))&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this)),this.isDirty("filter")&&(t.filter=this.get("filter"));let s=this.get("filter","");if(this.isDirty("blur")){const r=this.get("blur",0);r!=0&&(s+=" blur("+r+"px)")}if(this.isDirty("saturate")){const r=this.get("saturate",1);r!=1&&(s+=" saturate("+r+")")}if(this.isDirty("brightness")){const r=this.get("brightness",1);r!=1&&(s+=" brightness("+r+")")}if(this.isDirty("contrast")){const r=this.get("contrast",1);r!=1&&(s+=" contrast("+r+")")}if(this.isDirty("sepia")){const r=this.get("sepia",0);r!=0&&(s+=" sepia("+r+")")}if(this.isDirty("hue")){const r=this.get("hue",0);r!=0&&(s+=" hue-rotate("+r+"deg)")}if(this.isDirty("invert")){const r=this.get("invert",0);r!=0&&(s+=" invert("+r+")")}if(s&&(t.filter=s),this.isDirty("cursorOverStyle")&&(t.cursorOverStyle=this.get("cursorOverStyle")),this.isDirty("hoverOnFocus")&&(this.get("hoverOnFocus")?this._focusDp=new O([e.on("focus",()=>{this.showTooltip()}),e.on("blur",()=>{this.hideTooltip()})]):this._focusDp&&(this._focusDp.dispose(),this._focusDp=void 0)),this.isDirty("focusable")&&(this.get("focusable")?this._root._registerTabindexOrder(this):this._root._unregisterTabindexOrder(this),this.markDirtyAccessibility(),this._disposers.push(e.on("blur",()=>{this.setPrivateRaw("touchHovering",!1)}))),this.isPrivateDirty("focusable")&&this.markDirtyAccessibility(),(this.isDirty("role")||this.isDirty("ariaLive")||this.isDirty("ariaChecked")||this.isDirty("ariaHidden")||this.isDirty("ariaOrientation")||this.isDirty("ariaValueNow")||this.isDirty("ariaValueMin")||this.isDirty("ariaValueMax")||this.isDirty("ariaValueText")||this.isDirty("ariaLabel")||this.isDirty("ariaControls"))&&this.markDirtyAccessibility(),this.isDirty("exportable")&&(t.exportable=this.get("exportable")),this.isDirty("interactive")){const r=this.events;this.get("interactive")&&!r.isDisposed()?this._hoverDp=new O([r.on("click",n=>{Bt(n.originalEvent)&&(this.getPrivate("touchHovering")||this.setTimeout(()=>{this._handleOver(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.showTooltip(),this.setPrivateRaw("touchHovering",!0),this.events.dispatch("pointerover",{type:"pointerover",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})},10))}),r.on("globalpointerup",n=>{Bt(n.originalEvent)&&this.getPrivate("touchHovering")&&(this._handleOut(),(this.get("tooltipText")||this.get("tooltipHTML"))&&this.hideTooltip(),this.setPrivateRaw("touchHovering",!1),this.events.dispatch("pointerout",{type:"pointerout",target:n.target,originalEvent:n.originalEvent,point:n.point,simulated:n.simulated})),this._isDown&&this._handleUp(n)}),r.on("pointerover",()=>{this._handleOver()}),r.on("pointerout",()=>{this._handleOut()}),r.on("pointerdown",n=>{this._handleDown(n)})]):(this._display.interactive=!1,this._hoverDp&&(this._hoverDp.dispose(),this._hoverDp=void 0))}this.isDirty("forceInactive")&&(this._display.inactive=this.get("forceInactive",null)),this.get("showTooltipOn")=="always"&&this._display.visible&&this.showTooltip()}dragStart(t){this._dragEvent=t,this.events.stopParentDispatch()}dragStop(t){if(this._dragEvent=void 0,this._dragPoint=void 0,this.events.stopParentDispatch(),this._isDragging){this._isDragging=!1;const e="dragstop";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}_handleOver(){this.isHidden()||(this.get("active")&&this.states.lookup("hoverActive")?this.states.applyAnimate("hoverActive"):this.get("disabled")&&this.states.lookup("hoverDisabled")?this.states.applyAnimate("hoverDisabled"):this.states.applyAnimate("hover"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleOut(){this.isHidden()||(this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):(this.states.lookup("hover")||this.states.lookup("hoverActive"))&&this.states.applyAnimate("default"),this.get("draggable")&&this._isDown&&this.states.lookup("down")&&this.states.applyAnimate("down"))}_handleUp(t){if(!this.isHidden()){this.get("active")&&this.states.lookup("active")?this.states.applyAnimate("active"):this.get("disabled")&&this.states.lookup("disabled")?this.states.applyAnimate("disabled"):this.states.lookup("down")&&(this.isHover()?this.states.applyAnimate("hover"):this.states.applyAnimate("default")),this._downPoint=void 0;const e=pt(t.originalEvent);delete this._downPoints[e],T(this._downPoints).length==0&&(this._isDown=!1)}}_hasMoved(t){const e=pt(t.originalEvent),s=this._downPoints[e];if(s){const r=Math.abs(s.x-t.point.x),n=Math.abs(s.y-t.point.y);return r>5||n>5}return!1}_hasDown(){return T(this._downPoints).length>0}_handleDown(t){const e=this.parent;if(e&&!this.get("draggable")&&e._handleDown(t),this.get("interactive")&&!this.isHidden()){this.states.lookup("down")&&this.states.applyAnimate("down"),this._downPoint={x:t.point.x,y:t.point.y},this._isDown=!0;const s=pt(t.originalEvent);this._downPoints[s]={x:t.point.x,y:t.point.y}}}dragMove(t){let e=this._dragEvent;if(e){if(e.simulated&&!t.simulated)return!0;let s=0,r=this.parent,n=1;for(;r!=null;)s+=r.get("rotation",0),r=r.parent,r&&(n*=r.get("scale",1));let a=(t.point.x-e.point.x)/n,o=(t.point.y-e.point.y)/n;const h=this.events;if(e.simulated&&!this._isDragging){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}if(this._isDragging){let l=this._dragPoint;this.set("x",l.x+a*wt(s)+o*yt(s)),this.set("y",l.y+o*wt(s)-a*yt(s));const d="dragged";h.isEnabled(d)&&h.dispatch(d,{type:d,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}else if(Math.hypot(a,o)>5){this._isDragging=!0,this._dragEvent=t,this._dragPoint={x:this.x(),y:this.y()};const l="dragstart";h.isEnabled(l)&&h.dispatch(l,{type:l,target:this,originalEvent:t.originalEvent,point:t.point,simulated:t.simulated})}}}_updateSize(){}_getBounds(){this._localBounds=this._display.getLocalBounds()}depth(){let t=this.parent,e=0;for(;;){if(!t)return e;++e,t=t.parent}}markDirtySize(){this._sizeDirty=!0,this.markDirty()}markDirtyBounds(){const t=this._display;if(this.get("isMeasured")){this._root._addDirtyBounds(this),t.isMeasured=!0,t.invalidateBounds();const e=this.parent;e&&this.get("position")!="absolute"&&(e.get("width")==null||e.get("height")==null||e.get("layout"))&&e.markDirtyBounds(),this.get("focusable")&&this.isFocus()&&this.markDirtyAccessibility()}}markDirtyAccessibility(){this._root._invalidateAccessibility(this)}markDirtyLayer(){this._display.markDirtyLayer(!0)}markDirty(){super.markDirty(),this.markDirtyLayer()}_updateBounds(){const t=this._adjustedLocalBounds;let e;if(this.get("visible")&&this.getPrivate("visible")&&!this.get("forceHidden")?(this._getBounds(),this._fixMinBounds(this._localBounds),this.updatePivotPoint(),this._adjustedLocalBounds=this._display.getAdjustedBounds(this._localBounds),e=this._adjustedLocalBounds):(e={left:0,right:0,top:0,bottom:0},this._localBounds=e,this._adjustedLocalBounds=e),!t||t.left!==e.left||t.top!==e.top||t.right!==e.right||t.bottom!==e.bottom){const s="boundschanged";this.events.isEnabled(s)&&this.events.dispatch(s,{type:s,target:this}),this.parent&&(this.parent.markDirty(),this.parent.markDirtyBounds()),this.getPrivate("showingTooltip")&&this.showTooltip()}}_fixMinBounds(t){let e=this.get("minWidth",this.getPrivate("minWidth")),s=this.get("minHeight",this.getPrivate("minHeight"));g(e)&&t.right-t.left0?t.right=t.left+r:t.left=t.right+r),g(n)&&(n>0?t.bottom=t.top+n:t.top=t.bottom+n)}_removeParent(t){t&&(t.children.removeValue(this),P(t._percentageSizeChildren,this),P(t._percentagePositionChildren,this))}_clearDirty(){super._clearDirty(),this._sizeDirty=!1,this._statesHandled=!1}hover(){this.isDisposed()||(this.showTooltip(),this._handleOver())}unhover(){this.isDisposed()||(this.hideTooltip(),this._handleOut())}showTooltip(t){if(!this.isDisposed()){const e=this.getTooltip(),s=this.get("tooltipText"),r=this.get("tooltipHTML");if((s||r)&&e){const n=this.get("tooltipPosition"),a=this.getPrivate("tooltipTarget",this);n!="fixed"&&t||(this._display._setMatrix(),t=this.toGlobal(a._getTooltipPoint())),e.set("pointTo",t),e.set("tooltipTarget",a),e.get("x")||e.set("x",t.x),e.get("y")||e.set("y",t.y),s&&e.label.set("text",s),r&&e.label.set("html",r);const o=this.dataItem;if(o&&e.label._setDataItem(o),this.get("showTooltipOn")=="always"&&(t.x<0||t.x>this._root.width()||t.y<0||t.y>this._root.height()))return void this.hideTooltip();e.label.text.markDirtyText();const h=e.show();return this.setPrivateRaw("showingTooltip",!0),h}}}hideTooltip(){const t=this.getTooltip();if(t&&(t.get("tooltipTarget")==this.getPrivate("tooltipTarget",this)||this.get("tooltip")==t)){let e=t.get("keepTargetHover")&&t.get("stateAnimationDuration",0)==0?400:void 0;const s=t.hide(e);return this.setPrivateRaw("showingTooltip",!1),s}}_getTooltipPoint(){const t=this._localBounds;if(t){let e=0,s=0;return this.get("isMeasured")?(e=t.left+M(this.get("tooltipX",0),t.right-t.left),s=t.top+M(this.get("tooltipY",0),t.bottom-t.top)):(e=M(this.get("tooltipX",0),this.width()),s=M(this.get("tooltipY",0),this.height())),{x:e,y:s}}return{x:0,y:0}}getTooltip(){let t=this.get("tooltip");if(t)return t;{let e=this.parent;if(e)return e.getTooltip()}}_updatePosition(){const t=this.parent;let e=this.get("dx",0),s=this.get("dy",0),r=this.get("x"),n=this.getPrivate("x"),a=0,o=0;const h=this.get("position");r instanceof f&&(r=t?t.innerWidth()*r.value+t.get("paddingLeft",0):0),g(r)?a=r+e:n!=null?a=n:t&&h=="relative"&&(a=t.get("paddingLeft",0)+e);let l=this.get("y"),d=this.getPrivate("y");l instanceof f&&(l=t?t.innerHeight()*l.value+t.get("paddingTop",0):0),g(l)?o=l+s:d!=null?o=d:t&&h=="relative"&&(o=t.get("paddingTop",0)+s);const p=this._display;if(p.x!=a||p.y!=o){p.invalidateBounds(),p.x=a,p.y=o;const u="positionchanged";this.events.isEnabled(u)&&this.events.dispatch(u,{type:u,target:this})}this.getPrivate("showingTooltip")&&this.showTooltip()}x(){let t=this.get("x"),e=this.getPrivate("x");const s=this.parent;return s?t instanceof f?M(t,s.innerWidth())+s.get("paddingLeft",0):g(t)?t:e??s.get("paddingLeft",this._display.x):this._display.x}y(){let t=this.getPrivate("y");if(t!=null)return t;let e=this.get("y");const s=this.parent;return s?e instanceof f?M(e,s.innerHeight())+s.get("paddingTop",0):g(e)?e:t??s.get("paddingTop",this._display.y):this._display.y}_dispose(){super._dispose(),this._display.dispose(),this._removeTemplateField(),this._removeParent(this.parent),this._root._removeFocusElement(this);const t=this.get("tooltip");t&&t.dispose(),this.markDirty()}adjustedLocalBounds(){return this._fixMinBounds(this._adjustedLocalBounds),this._adjustedLocalBounds}localBounds(){return this._localBounds}bounds(){const t=this._adjustedLocalBounds,e=this.x(),s=this.y();return{left:t.left+e,right:t.right+e,top:t.top+s,bottom:t.bottom+s}}globalBounds(){const t=this.localBounds(),e=this.toGlobal({x:t.left,y:t.top}),s=this.toGlobal({x:t.right,y:t.top}),r=this.toGlobal({x:t.right,y:t.bottom}),n=this.toGlobal({x:t.left,y:t.bottom});return{left:Math.min(e.x,s.x,r.x,n.x),top:Math.min(e.y,s.y,r.y,n.y),right:Math.max(e.x,s.x,r.x,n.x),bottom:Math.max(e.y,s.y,r.y,n.y)}}_onShow(t){}_onHide(t){}appear(t,e){return tt(this,void 0,void 0,function*(){return yield this.hide(0),e?new Promise((s,r)=>{this.setTimeout(()=>{s(this.show(t))},e)}):this.show(t)})}show(t){return tt(this,void 0,void 0,function*(){if(!this._isShowing){this._isHidden=!1,this._isShowing=!0,this._isHiding=!1,this.states.lookup("default").get("visible")&&this.set("visible",!0),this._onShow(t);const e=this.states.applyAnimate("default",t);yield Lt(e),this._isShowing=!1}})}hide(t){return tt(this,void 0,void 0,function*(){if(!this._isHiding&&!this._isHidden){this._isHiding=!0,this._isShowing=!1;let e=this.states.lookup("hidden");e||(e=this.states.create("hidden",{opacity:0,visible:!1})),this._isHidden=!0,this._onHide(t);const s=this.states.applyAnimate("hidden",t);yield Lt(s),this._isHiding=!1}})}isHidden(){return this._isHidden}isShowing(){return this._isShowing}isHiding(){return this._isHiding}isHover(){return this._display.hovering()}isFocus(){return this._root.focused(this)}isDragging(){return this._isDragging}isVisible(){return!(!this.get("visible")||!this.getPrivate("visible")||this.get("forceHidden"))}isVisibleDeep(){return this._parent?this._parent.isVisibleDeep()&&this.isVisible():this.isVisible()}compositeOpacity(){const t=this.get("opacity",1);return this._parent?this._parent.compositeOpacity()*t:t}compositeScale(){const t=this.get("scale",1);return this._parent?this._parent.compositeScale()*t:t}compositeRotation(){const t=this.get("rotation",0);return this._parent?this._parent.compositeRotation()+t:t}width(){let t=this.get("width"),e=this.get("maxWidth",this.getPrivate("maxWidth")),s=this.get("minWidth",this.getPrivate("minWidth")),r=this.getPrivate("width"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.right-this._adjustedLocalBounds.left);else if(t instanceof f){const a=this.parent;n=a?a.innerWidth()*t.value:this._root.width()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}maxWidth(){let t=this.get("maxWidth",this.getPrivate("maxWidth"));if(g(t))return t;{let s=this.get("width");if(g(s))return s}const e=this.parent;return e?e.innerWidth():this._root.width()}maxHeight(){let t=this.get("maxHeight",this.getPrivate("maxHeight"));if(g(t))return t;{let s=this.get("height");if(g(s))return s}const e=this.parent;return e?e.innerHeight():this._root.height()}height(){let t=this.get("height"),e=this.get("maxHeight",this.getPrivate("maxHeight")),s=this.get("minHeight",this.getPrivate("minHeight")),r=this.getPrivate("height"),n=0;if(g(r))n=r;else if(t==null)this._adjustedLocalBounds&&(n=this._adjustedLocalBounds.bottom-this._adjustedLocalBounds.top);else if(t instanceof f){const a=this.parent;n=a?a.innerHeight()*t.value:this._root.height()*t.value}else g(t)&&(n=t);return g(s)&&(n=Math.max(s,n)),g(e)&&(n=Math.min(e,n)),n}_findStaticTemplate(t){return this._templateField&&t(this._templateField)?this._templateField:super._findStaticTemplate(t)}_walkParents(t){this._parent&&this._walkParent(t)}_walkParent(t){this._parent&&this._parent._walkParent(t),t(this)}get parent(){return this._parent}_setParent(t,e=!1){const s=this._parent;t!==s&&(this.markDirtyBounds(),t.markDirty(),this._parent=t,e&&(this._removeParent(s),t&&(this._addPercentageSizeChildren(),this._addPercentagePositionChildren())),this.markDirtyPosition(),this._applyThemes())}getNumberFormatter(){return this.get("numberFormatter",this._root.numberFormatter)}getDateFormatter(){return this.get("dateFormatter",this._root.dateFormatter)}getDurationFormatter(){return this.get("durationFormatter",this._root.durationFormatter)}toGlobal(t){return this._display.toGlobal(t)}toLocal(t){return this._display.toLocal(t)}_getDownPoint(){const t=this._getDownPointId();if(t)return this._downPoints[t]}_getDownPointId(){if(this._downPoints)return le(this._downPoints,(t,e)=>t>e?1:t0&&(a.beginFill(r,n),a.drawRect(0,0,e,s),a.endFill()),o.angle=this.get("rotation",0),this._draw(),this._pattern=this._root._renderer.createPattern(o,a,t,e,s)}this._clear=!1}}Object.defineProperty(V,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Pattern"}),Object.defineProperty(V,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([V.className])});class K extends V{constructor(){super(...arguments),Object.defineProperty(this,"_image",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_beforeChanged(){super._beforeChanged(),this._clear=!0,this.isDirty("src")&&this._load();const t=this.get("canvas");t&&(this.set("width",t.width),this.set("height",t.height))}_draw(){super._draw();const t=this._image;if(t){const s=this.get("width",100),r=this.get("height",100),n=this.get("fit","image");let a=0,o=0;n=="pattern"?(a=s,o=r):(a=t.width,o=t.height,n=="image"&&(this.set("width",a),this.set("height",o)));let h=0,l=0;this.get("centered",!0)&&(h=s/2-a/2,l=r/2-o/2),this._display.image(t,a,o,h,l)}const e=this.get("canvas");e&&this._display.image(e,e.width,e.height,0,0)}_load(){const t=this.get("src");if(t){const e=new Image;e.src=t,e.decode().then(()=>{this._image=e,this._draw(),this.events.isEnabled("loaded")&&this.events.dispatch("loaded",{type:"loaded",target:this})}).catch(s=>{})}}}var Dt;Object.defineProperty(K,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PicturePattern"}),Object.defineProperty(K,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:V.classNames.concat([K.className])}),function(i){i.ADD="lighter",i.COLOR="color",i.COLOR_BURN="color-burn",i.COLOR_DODGE="color-dodge",i.DARKEN="darken",i.DIFFERENCE="difference",i.DST_OVER="destination-over",i.EXCLUSION="exclusion",i.HARD_LIGHT="hard-light",i.HUE="hue",i.LIGHTEN="lighten",i.LUMINOSITY="luminosity",i.MULTIPLY="multiply",i.NORMAL="source-over",i.OVERLAY="overlay",i.SATURATION="saturation",i.SCREEN="screen",i.SOFT_LIGHT="soft-light",i.SRC_ATOP="source-atop",i.XOR="xor"}(Dt||(Dt={}));const Ii=["fill","fillOpacity","stroke","strokeWidth","strokeOpacity","fillPattern","strokePattern","fillGradient","strokeGradient","strokeDasharray","strokeDashoffset","shadowBlur","shadowColor","shadowOpacity","shadowOffsetX","shadowOffsetY","blur","sepia","invert","brightness","hue","contrast","saturate"];class G extends k{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeGraphics()}),Object.defineProperty(this,"_clear",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_beforeChanged(){if(super._beforeChanged(),(this.isDirty("draw")||this.isDirty("svgPath"))&&this.markDirtyBounds(),(this.isDirty("fill")||this.isDirty("stroke")||this.isDirty("visible")||this.isDirty("forceHidden")||this.isDirty("scale")||this.isDirty("fillGradient")||this.isDirty("strokeGradient")||this.isDirty("fillPattern")||this.isDirty("strokePattern")||this.isDirty("fillOpacity")||this.isDirty("strokeOpacity")||this.isDirty("strokeWidth")||this.isDirty("draw")||this.isDirty("blendMode")||this.isDirty("strokeDasharray")||this.isDirty("strokeDashoffset")||this.isDirty("svgPath")||this.isDirty("lineJoin")||this.isDirty("shadowColor")||this.isDirty("shadowBlur")||this.isDirty("shadowOffsetX")||this.isDirty("shadowOffsetY"))&&(this._clear=!0),this._display.crisp=this.get("crisp",!1),this.isDirty("fillGradient")){const t=this.get("fillGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("fill")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("fill")})))}}if(this.isDirty("strokeGradient")){const t=this.get("strokeGradient");if(t){this._display.isMeasured=!0;const e=t.get("target");e&&(this._disposers.push(e.events.on("boundschanged",()=>{this._markDirtyKey("stroke")})),this._disposers.push(e.events.on("positionchanged",()=>{this._markDirtyKey("stroke")})))}}}_changed(){if(super._changed(),this._clear){this.markDirtyBounds(),this.markDirtyLayer(),this._display.clear();let t=this.get("strokeDasharray");g(t)&&(t=t<.5?[0]:[t]),this._display.setLineDash(t);const e=this.get("strokeDashoffset");e&&this._display.setLineDashOffset(e);const s=this.get("blendMode",Dt.NORMAL);this._display.blendMode=s;const r=this.get("draw");r&&typeof r=="function"&&r(this._display,this);const n=this.get("svgPath");n!=null&&this._display.svgPath(n)}}_afterChanged(){if(super._afterChanged(),this._clear){const t=this.get("fill"),e=this.get("fillGradient"),s=this.get("fillPattern"),r=this.get("fillOpacity"),n=this.get("stroke"),a=this.get("strokeGradient"),o=this.get("strokePattern"),h=this.get("shadowColor"),l=this.get("shadowBlur"),d=this.get("shadowOffsetX"),p=this.get("shadowOffsetY"),u=this.get("shadowOpacity");if(h&&(l||d||p)&&this._display.shadow(h,l,d,p,u),t&&!e&&(this._display.beginFill(t,r),this._display.endFill()),e){if(t){const m=e.get("stops",[]);m.length&&c(m,b=>{b.color&&!b.colorInherited||!t||(b.color=t,b.colorInherited=!0),(b.opacity==null||b.opacityInherited)&&(b.opacity=r,b.opacityInherited=!0)})}const _=e.getFill(this);_&&(this._display.beginFill(_,r),this._display.endFill())}if(s){const _=s.pattern;_&&(this._display.beginFill(_,r),this._display.endFill(),s instanceof K&&s.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}if(n||a||o){const _=this.get("strokeOpacity");let m=this.get("strokeWidth",1);this.get("nonScalingStroke")&&(m/=this.get("scale",1)),this.get("crisp")&&(m/=this._root._renderer.resolution);const b=this.get("lineJoin");if(n&&!a&&(this._display.lineStyle(m,n,_,b),this._display.endStroke()),a){const S=a.get("stops",[]);S.length&&c(S,w=>{w.color&&!w.colorInherited||!n||(w.color=n,w.colorInherited=!0),(w.opacity==null||w.opacityInherited)&&(w.opacity=_,w.opacityInherited=!0)});const H=a.getFill(this);H&&(this._display.lineStyle(m,H,_,b),this._display.endStroke())}if(o){let S=o.pattern;S&&(this._display.lineStyle(m,S,_,b),this._display.endStroke(),o instanceof K&&o.events.once("loaded",()=>{this._clear=!0,this.markDirty()}))}}this.getPrivate("showingTooltip")&&this.showTooltip()}this._clear=!1}}Object.defineProperty(G,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Graphics"}),Object.defineProperty(G,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([G.className])});class z extends G{_afterNew(){super._afterNew(),this._display.isMeasured=!0,this.setPrivateRaw("trustBounds",!0)}_beforeChanged(){super._beforeChanged(),(this.isDirty("width")||this.isDirty("height")||this.isPrivateDirty("width")||this.isPrivateDirty("height"))&&(this._clear=!0)}_changed(){super._changed(),this._clear&&!this.get("draw")&&this._draw()}_draw(){this._display.drawRect(0,0,this.width(),this.height())}_updateSize(){this.markDirty(),this._clear=!0}}function j(i,t){i.get("reverseChildren",!1)?i.children.eachReverse(t):i.children.each(t)}Object.defineProperty(z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Rectangle"}),Object.defineProperty(z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:G.classNames.concat([z.className])});class E extends B{}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Layout"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:B.classNames.concat([E.className])});class Y extends E{updateContainer(t){let e=t.get("paddingLeft",0),s=t.innerWidth(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minWidth",a.getPrivate("minWidth",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.width()),s-=o+a.get("marginLeft",0)+a.get("marginRight",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("width");if(o instanceof f){let h=s*o.value/r-a.get("marginLeft",0)-a.get("marginRight",0),l=a.get("minWidth",a.getPrivate("minWidth",-1/0)),d=a.get("maxWidth",a.getPrivate("maxWidth",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("width",h)}else a._prevSettings.width instanceof f&&a.setPrivate("width",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginLeft",0),l=a.get("marginRight",0),d=a.get("maxWidth"),p=o.left,u=o.right;d&&u-p>d&&(u=p+d);let _=n+h-p;a.setPrivate("x",_),n=_+u+l}else a.setPrivate("x",void 0)})}}Object.defineProperty(Y,"className",{enumerable:!0,configurable:!0,writable:!0,value:"HorizontalLayout"}),Object.defineProperty(Y,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([Y.className])});class X extends E{updateContainer(t){let e=t.get("paddingTop",0),s=t.innerHeight(),r=0;j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){r+=o.value;let h=s*o.value,l=a.get("minHeight",a.getPrivate("minHeight",-1/0));l>h&&(s-=l,r-=o.value);let d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h>d&&(s-=d,r-=o.value)}else g(o)||(o=a.height()),s-=o+a.get("marginTop",0)+a.get("marginBottom",0)}}),(s<=0||s==1/0)&&(s=.1),j(t,a=>{if(a.isVisible()&&a.get("position")=="relative"){let o=a.get("height");if(o instanceof f){let h=s*o.value/r-a.get("marginTop",0)-a.get("marginBottom",0),l=a.get("minHeight",a.getPrivate("minHeight",-1/0)),d=a.get("maxHeight",a.getPrivate("maxHeight",1/0));h=Math.min(Math.max(l,h),d),a.setPrivate("height",h)}else a._prevSettings.height instanceof f&&a.setPrivate("height",void 0)}});let n=e;j(t,a=>{if(a.get("position")=="relative")if(a.isVisible()){let o=a.adjustedLocalBounds(),h=a.get("marginTop",0),l=o.top,d=o.bottom,p=a.get("maxHeight");p&&d-l>p&&(d=l+p);let u=a.get("marginBottom",0),_=n+h-l;a.setPrivate("y",_),n=_+d+u}else a.setPrivate("y",void 0)})}}Object.defineProperty(X,"className",{enumerable:!0,configurable:!0,writable:!0,value:"VerticalLayout"}),Object.defineProperty(X,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([X.className])});class $ extends E{_afterNew(){this._setRawDefault("maxColumns",Number.MAX_VALUE),super._afterNew()}updateContainer(t){let e=t.get("paddingLeft",0),s=t.get("paddingRight",0),r=t.get("paddingTop",0),n=t.maxWidth()-e-s,a=n,o=1;j(t,m=>{if(m.get("visible")&&m.getPrivate("visible")&&!m.get("forceHidden")&&m.get("position")!="absolute"){let b=m.width();bo&&(o=b)}}),a=Nt(a,1,n),o=Nt(o,1,n);let h=1;h=this.get("fixedWidthGrid")?n/o:n/a,h=Math.max(1,Math.floor(h)),h=Math.min(this.get("maxColumns",Number.MAX_VALUE),h);let l=this.getColumnWidths(t,h,o,n),d=r,p=0,u=0;h=l.length;let _=e;j(t,m=>{if(m.get("position")=="relative"&&m.isVisible()){const b=m.get("marginTop",0),S=m.get("marginBottom",0);let H=m.adjustedLocalBounds(),w=m.get("marginLeft",0),C=m.get("marginRight",0),x=_+w-H.left,L=d+b-H.top;m.setPrivate("x",x),m.setPrivate("y",L),_+=l[p]+C,u=Math.max(u,m.height()+b+S),p++,p>=h&&(p=0,_=e,d+=u)}})}getColumnWidths(t,e,s,r){let n=0,a=[],o=0;return j(t,h=>{let l=h.adjustedLocalBounds();h.get("position")!="absolute"&&h.isVisible()&&(this.get("fixedWidthGrid")?a[o]=s:a[o]=Math.max(0|a[o],l.right-l.left+h.get("marginLeft",0)+h.get("marginRight",0)),o{n+=h}),n>r?e>2?(e-=1,this.getColumnWidths(t,e,s,r)):[r]:a}}Object.defineProperty($,"className",{enumerable:!0,configurable:!0,writable:!0,value:"GridLayout"}),Object.defineProperty($,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([$.className])});class xt{static escape(t){return t.replace(/\[\[/g,this.prefix+"1").replace(/([^\/\]]{1})\]\]/g,"$1"+this.prefix+"2").replace(/\]\]/g,this.prefix+"2").replace(/\{\{/g,this.prefix+"3").replace(/\}\}/g,this.prefix+"4").replace(/\'\'/g,this.prefix+"5")}static unescape(t){return t.replace(new RegExp(this.prefix+"1","g"),"[[").replace(new RegExp(this.prefix+"2","g"),"]]").replace(new RegExp(this.prefix+"3","g"),"{{").replace(new RegExp(this.prefix+"4","g"),"}}").replace(new RegExp(this.prefix+"5","g"),"''")}static cleanUp(t){return t.replace(/\[\[/g,"[").replace(/\]\]/g,"]").replace(/\{\{/g,"{").replace(/\}\}/g,"}").replace(/\'\'/g,"'")}static chunk(t,e=!1,s=!1){let r=[];t=this.escape(t);let n=e?t.split("'"):[t];for(let a=0;a{t.dispose()}),this.getPrivate("htmlElement")&&this._root._removeHTMLContent(this),super._dispose()}_changed(){if(super._changed(),this.isDirty("interactiveChildren")&&(this._display.interactiveChildren=this.get("interactiveChildren",!1)),this.isDirty("layout")&&(this._prevWidth=0,this._prevHeight=0,this.markDirtyBounds(),this._prevSettings.layout&&this.children.each(t=>{t.removePrivate("x"),t.removePrivate("y")})),(this.isDirty("paddingTop")||this.isDirty("paddingBottom")||this.isDirty("paddingLeft")||this.isDirty("paddingRight"))&&this.children.each(t=>{t.markDirtyPosition()}),this.isDirty("maskContent")){const t=this._childrenDisplay;let e=this._contentMask;this.get("maskContent")?e||(e=z.new(this._root,{x:-.5,y:-.5,width:this.width()+1,height:this.height()+1}),this._contentMask=e,t.addChildAt(e._display,0),t.mask=e._display):e&&(t.removeChild(e._display),t.mask=null,e.dispose(),this._contentMask=void 0)}}_updateSize(){super._updateSize(),c(this._percentageSizeChildren,t=>{t._updateSize()}),c(this._percentagePositionChildren,t=>{t.markDirtyPosition(),t._updateSize()}),this.updateBackground()}updateBackground(){const t=this.get("background");let e=this._localBounds;if(e&&!this.isHidden()){let s=e.left,r=e.top,n=e.right-s,a=e.bottom-r,o=this.get("maxWidth"),h=this.get("maxHeight");h&&a>h&&(a=h),o&&n>o&&(n=o);let l=this.width(),d=this.height();t&&(t.setAll({width:n,height:a,x:s,y:r}),this._display.interactive&&(t._display.interactive=!0));const p=this._contentMask;p&&p.setAll({width:l+1,height:d+1});const u=this.get("verticalScrollbar");if(u){u.set("height",d),u.set("x",l-u.width()-u.get("marginRight",0)),u.set("end",u.get("start",0)+d/this._contentHeight);const _=u.get("background");_&&_.setAll({width:u.width(),height:d});let m=!0;this._contentHeight<=d&&(m=!1),u.setPrivate("visible",m)}}}_applyThemes(t=!1){return!!super._applyThemes(t)&&(this.eachChildren(e=>{e._applyThemes(t)}),!0)}_applyState(t){super._applyState(t),this.get("setStateOnChildren")&&this.eachChildren(e=>{e.states.apply(t)})}_applyStateAnimated(t,e){super._applyStateAnimated(t,e),this.get("setStateOnChildren")&&this.eachChildren(s=>{s.states.applyAnimate(t,e)})}innerWidth(){return this.width()-this.get("paddingRight",0)-this.get("paddingLeft",0)}innerHeight(){return this.height()-this.get("paddingTop",0)-this.get("paddingBottom",0)}_getBounds(){if(this.get("html")){let t=this._localBounds;t&&(this._contentWidth=t.right-t.left,this._contentHeight=t.bottom-t.top)}else{let t=this.get("width"),e=this.get("height"),s=this.getPrivate("width"),r=this.getPrivate("height"),n={left:0,top:0,right:this.width(),bottom:this.height()},a=this.get("layout"),o=!1,h=!1;if((a instanceof Y||a instanceof $)&&(o=!0),a instanceof X&&(h=!0),t==null&&s==null||e==null&&r==null||this.get("verticalScrollbar")){let l=Number.MAX_VALUE,d=l,p=-l,u=l,_=-l;const m=this.get("paddingLeft",0),b=this.get("paddingTop",0),S=this.get("paddingRight",0),H=this.get("paddingBottom",0);this.children.each(x=>{if(x.get("position")!="absolute"&&x.get("isMeasured")){let L=x.adjustedLocalBounds(),jt=x.x(),Et=x.y(),at=jt+L.left,ot=jt+L.right,ht=Et+L.top,lt=Et+L.bottom;o&&(at-=x.get("marginLeft",0),ot+=x.get("marginRight",0)),h&&(ht-=x.get("marginTop",0),lt+=x.get("marginBottom",0)),atp&&(p=ot),ht_&&(_=lt)}}),d==l&&(d=0),p==-l&&(p=0),u==l&&(u=0),_==-l&&(_=0),n.left=d-m,n.top=u-b,n.right=p+S,n.bottom=_+H;const w=this.get("minWidth");g(w)&&w>0&&n.right-n.left=w?n.left=n.right-w:n.right=n.left+w);const C=this.get("minHeight");g(C)&&C>0&&n.bottom-n.top=C?n.top=n.bottom-C:n.bottom=n.top+C)}this._contentWidth=n.right-n.left,this._contentHeight=n.bottom-n.top,g(t)&&(n.left=0,n.right=t),g(s)&&(n.left=0,n.right=s),g(e)&&(n.top=0,n.bottom=e),g(r)&&(n.top=0,n.bottom=r),this._localBounds=n}}_updateBounds(){const t=this.get("layout");t&&t.updateContainer(this),super._updateBounds(),this.updateBackground()}markDirty(){super.markDirty(),this._root._addDirtyParent(this)}_prepareChildren(){const t=this.innerWidth(),e=this.innerHeight();if(t!=this._prevWidth||e!=this._prevHeight){let s=this.get("layout"),r=!1,n=!1;s&&((s instanceof Y||s instanceof $)&&(r=!0),s instanceof X&&(n=!0)),c(this._percentageSizeChildren,a=>{if(!r){let o=a.get("width");o instanceof f&&a.setPrivate("width",o.value*t)}if(!n){let o=a.get("height");o instanceof f&&a.setPrivate("height",o.value*e)}}),c(this._percentagePositionChildren,a=>{a.markDirtyPosition(),a.markDirtyBounds()}),this._prevWidth=t,this._prevHeight=e,this._sizeDirty=!0,this.updateBackground()}this._handleStates()}_updateHTMLContent(){const t=this.get("html");t&&t!==""?this._root._setHTMLContent(this,rt(this,this.get("html",""))):this._root._removeHTMLContent(this),this._root._positionHTMLElement(this)}scrollToChild(t){const e=this.get("verticalScrollbar");if(e){let s=t.y(),r=this.innerHeight(),n=t.height(),a=this._contentHeight,o=1-(r-n/2)/a;if(s+.7*n+this._childrenDisplay.y>r||s-.3*n+this._childrenDisplay.y<0){let h=Math.max(0,Math.min(o,(s-n/2)/a));e.animate({key:"start",to:h,duration:e.get("animationDuration",0),easing:e.get("animationEasing")})}}}_updateChildren(){if(this.isDirty("html")&&this._updateHTMLContent(),this.isDirty("verticalScrollbar")){const t=this.get("verticalScrollbar");if(t){t._setParent(this),t.startGrip.setPrivate("visible",!1),t.endGrip.setPrivate("visible",!1),this.set("maskContent",!0),this.set("paddingRight",t.width()+t.get("marginRight",0)+t.get("marginLeft",0));let e=this.get("background");e||(e=this.set("background",z.new(this._root,{themeTags:["background"],fillOpacity:0,fill:this._root.interfaceColors.get("alternativeBackground")}))),this._vsbd0=this.events.on("wheel",s=>{const r=s.originalEvent;if(!ce(r,this))return;r.preventDefault();let n=r.deltaY/5e3;const a=t.get("start",0),o=t.get("end",1);a+n<=0&&(n=-a),o+n>=1&&(n=1-o),a+n>=0&&o+n<=1&&(t.set("start",a+n),t.set("end",o+n))}),this._disposers.push(this._vsbd0),this._vsbd1=t.events.on("rangechanged",()=>{let s=this._contentHeight;const r=this._childrenDisplay,n=this._contentMask;r.y=-t.get("start",0)*s,r.markDirtyLayer(),n&&(n._display.y=-r.y,r.mask=n._display)}),this._disposers.push(this._vsbd1),this._display.addChild(t._display)}else{const e=this._prevSettings.verticalScrollbar;e&&(this._display.removeChild(e._display),this._vsbd0&&this._vsbd0.dispose(),this._vsbd1&&this._vsbd1.dispose(),this._childrenDisplay.y=0,this.setPrivate("height",void 0),this.set("maskContent",!1),this.set("paddingRight",void 0))}}if(this.isDirty("background")){const t=this._prevSettings.background;t&&this._display.removeChild(t._display);const e=this.get("background");e instanceof k&&(e.set("isMeasured",!1),e._setParent(this),this._display.addChildAt(e._display,0))}if(this.isDirty("mask")){const t=this.get("mask"),e=this._prevSettings.mask;if(e&&(this._display.removeChild(e._display),e!=t&&e.dispose()),t){const s=t.parent;s&&s.children.removeValue(t),t._setParent(this),this._display.addChildAt(t._display,0),this._childrenDisplay.mask=t._display}}}_processTemplateField(){super._processTemplateField(),this.children.each(t=>{t._processTemplateField()})}walkChildren(t){this.children.each(e=>{e instanceof Qt&&e.walkChildren(t),t(e)})}eachChildren(t){const e=this.get("background");e&&t(e);const s=this.get("verticalScrollbar");s&&t(s);const r=this.get("mask");r&&t(r),this.children.values.forEach(n=>{t(n)})}allChildren(){const t=[];return this.eachChildren(e=>{t.push(e)}),t}_setDataItem(t){const e=t!==this._dataItem;super._setDataItem(t);const s=this.get("html","");s&&s!==""&&e&&this._root._setHTMLContent(this,rt(this,s))}};Object.defineProperty(Z,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Container"}),Object.defineProperty(Z,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([Z.className])});class it extends k{constructor(){super(...arguments),Object.defineProperty(this,"textStyle",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeTextStyle()}),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeText("",this.textStyle)}),Object.defineProperty(this,"_textStyles",{enumerable:!0,configurable:!0,writable:!0,value:["textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","maxChars"]}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_updateBounds(){if(this.get("text")){super._updateBounds();let t=this.get("fillGradient");t&&(this._display.style.fill=t.getFill(this))}else{let t={left:0,right:0,top:0,bottom:0};this._adjustedLocalBounds=t}}_changed(){super._changed(),this._display.clear();let t=this.textStyle;if(this.isDirty("opacity")){let e=this.get("opacity",1);this._display.alpha=e}if((this.isDirty("text")||this.isDirty("populateText"))&&(this._display.text=this._getText(),this.markDirtyBounds(),this.get("role")=="tooltip"&&this._root.updateTooltip(this)),this.isPrivateDirty("tooltipElement")&&this.getPrivate("tooltipElement")&&this._disposers.push(new D(()=>{this._root._removeTooltipElement(this)})),this.isDirty("width")&&(t.wordWrapWidth=this.width(),this.markDirtyBounds()),this.isDirty("oversizedBehavior")&&(t.oversizedBehavior=this.get("oversizedBehavior","none"),this.markDirtyBounds()),this.isDirty("breakWords")&&(t.breakWords=this.get("breakWords",!1),this.markDirtyBounds()),this.isDirty("ellipsis")&&(t.ellipsis=this.get("ellipsis"),this.markDirtyBounds()),this.isDirty("ignoreFormatting")&&(t.ignoreFormatting=this.get("ignoreFormatting",!1),this.markDirtyBounds()),this.isDirty("minScale")&&(t.minScale=this.get("minScale",0),this.markDirtyBounds()),this.isDirty("fill")||this.isDirty("fillGradient")){const e=this.get("fill"),s=this.get("fillGradient"),r=this.get("fillOpacity");if(s){if(e){const n=s.get("stops",[]);n.length&&c(n,a=>{a.color&&!a.colorInherited||!e||(a.color=e,a.colorInherited=!0),(a.opacity==null||a.opacityInherited)&&(a.opacity=r,a.opacityInherited=!0)})}t.fill=s.getFill(this)}else e&&(t.fill=e)}if(this.isDirty("fillOpacity")){let e=this.get("fillOpacity",1);e&&(t.fillOpacity=e)}(this.isDirty("maxWidth")||this.isPrivateDirty("maxWidth"))&&(t.maxWidth=this.get("maxWidth",this.getPrivate("maxWidth")),this.markDirtyBounds()),(this.isDirty("maxHeight")||this.isPrivateDirty("maxHeight"))&&(t.maxHeight=this.get("maxHeight",this.getPrivate("maxHeight")),this.markDirtyBounds()),c(this._textStyles,e=>{this._dirty[e]&&(t[e]=this.get(e),this.markDirtyBounds())}),t.fontSize=this.get("fontSize"),t.fontFamily=this.get("fontFamily"),this._display.style=t,this.isDirty("role")&&this.get("role")=="tooltip"&&this._root.updateTooltip(this)}_getText(){let t=this.get("text","");return this.get("maxChars")&&(t=fe(t,this.get("maxChars",1e8),this.get("breakWords"),this.get("ellipsis"))),this.get("populateText")?rt(this,t):t}_getAccessibleText(){const t=this.get("ariaLabel");return t!==void 0?this.get("populateText")?rt(this,t):t:this._getText()}markDirtyText(){this._display.text=this._getText(),this.get("role")=="tooltip"&&this._root.updateTooltip(this),this.markDirtyBounds(),this.markDirty()}_setDataItem(t){super._setDataItem(t),this.get("populateText")&&this.markDirtyText()}getNumberFormatter(){return this.parent?this.parent.getNumberFormatter():super.getNumberFormatter()}getDateFormatter(){return this.parent?this.parent.getDateFormatter():super.getDateFormatter()}getDurationFormatter(){return this.parent?this.parent.getDurationFormatter():super.getDurationFormatter()}}Object.defineProperty(it,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Text"}),Object.defineProperty(it,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:k.classNames.concat([it.className])});class _t extends Z{constructor(){super(...arguments),Object.defineProperty(this,"_text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_textKeys",{enumerable:!0,configurable:!0,writable:!0,value:["text","fill","fillGradient","fillOpacity","textAlign","fontFamily","fontSize","fontStyle","fontWeight","fontStyle","fontVariant","textDecoration","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","shadowOpacity","lineHeight","baselineRatio","direction","textBaseline","oversizedBehavior","breakWords","ellipsis","minScale","populateText","role","ignoreFormatting","maxChars","ariaLabel"]})}get text(){return this._text}_afterNew(){super._afterNew(),this._makeText(),c(this._textKeys,t=>{const e=this.get(t);e!=null&&this._text.set(t,e)}),this.get("html","")!==""&&this._text.set("text",""),this.onPrivate("maxWidth",()=>{this._setMaxDimentions()}),this.onPrivate("maxHeight",()=>{this._setMaxDimentions()})}_makeText(){this._text=this.children.push(it.new(this._root,{}))}_updateChildren(){super._updateChildren();const t=this._text;if(c(this._textKeys,s=>{this._text.set(s,this.get(s))}),(this.isDirty("maxWidth")||this.isDirty("maxHeight")||this.isDirty("rotation"))&&this._setMaxDimentions(),this.get("html","")!==""?t.set("text",""):(t.set("text",this.get("text")),this._maybeUpdateHTMLColor()),(this.isDirty("fill")||this.isDirty("fillGradient"))&&this._maybeUpdateHTMLColor(),this.isDirty("textAlign")||this.isDirty("width")){const s=this.get("textAlign");let r;this.get("width")!=null?r=s=="right"?qt:s=="center"?te:0:s=="left"||s=="start"?r=this.get("paddingLeft",0):s!="right"&&s!="end"||(r=-this.get("paddingRight",0)),t.set("x",r)}const e=this.get("background");e&&e.setPrivate("visible",t._display.textVisible)}_maybeUpdateHTMLColor(){const t=this.getPrivate("htmlElement");t&&this.get("fill")&&(t.style.color=this.get("fill").toCSSHex())}_setMaxDimentions(){const t=this.get("rotation"),e=t==90||t==270||t==-90,s=this._text,r=this.get("maxWidth",this.getPrivate("maxWidth",1/0));g(r)?s.set(e?"maxHeight":"maxWidth",r-this.get("paddingLeft",0)-this.get("paddingRight",0)):s.set(e?"maxHeight":"maxWidth",void 0);const n=this.get("maxHeight",this.getPrivate("maxHeight",1/0));g(n)?s.set(e?"maxWidth":"maxHeight",n-this.get("paddingTop",0)-this.get("paddingBottom",0)):s.set(e?"maxWidth":"maxHeight",void 0),this.root.events.once("frameended",()=>{s.markDirtyBounds()})}_setDataItem(t){super._setDataItem(t),this._markDirtyKey("text");const e=this._text;e.get("populateText")&&e.markDirtyText();const s=this.get("html");s&&s!==""&&this._updateHTMLContent()}getText(){return this._text._getText()}getAccessibleText(){return this._text._getAccessibleText()}}Object.defineProperty(_t,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Label"}),Object.defineProperty(_t,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Z.classNames.concat([_t.className])});class Li{constructor(t,e){if(Object.defineProperty(this,"_root",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rules",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._root=t,!e)throw new Error("You cannot use `new Class()`, instead use `Class.new()`")}static new(t){const e=new this(t,!0);return e.setupDefaultRules(),e}setupDefaultRules(){}_lookupRules(t){return this._rules[t]}ruleRaw(t,e=[]){let s=this._rules[t];s||(s=this._rules[t]=[]),e.sort(R);const{index:r,found:n}=oe(s,a=>{const o=R(a.tags.length,e.length);return o===0?Jt(a.tags,e,R):o});if(n)return s[r].template;{const a=J.new({});return s.splice(r,0,{tags:e,template:a}),a}}rule(t,e=[]){return this.ruleRaw(t,e)}}export{Ht as $,Ve as A,g as B,wi as C,D,B as E,di as F,Y as G,Z as H,oi as I,ct as J,z as K,N as L,vi as M,R as N,Bi as O,P,yi as Q,li as R,ti as S,qe as T,qt as U,G as V,Q as W,_i as X,$ as Y,fi as Z,xt as _,Kt as a,mi as a0,bi as a1,mt as a2,ci as a3,Je as a4,Ge as a5,Qe as a6,st as a7,y as a8,ri as a9,wt as aA,yt as aB,Zt as aC,Ii as aD,Ie as aE,Xt as aF,ne as aG,xe as aH,Te as aI,Ye as aJ,Si as aK,Hi as aL,Bt as aM,xi as aN,Tt as aO,Pi as aP,ji as aQ,ue as aa,O as ab,si as ac,ai as ad,U as ae,Xe as af,Dt as ag,vt as ah,Ei as ai,gi as aj,ni as ak,Vt as al,Ci as am,Ti as an,Di as ao,_t as ap,Nt as aq,Li as ar,Ai as as,te as at,Ee as au,ce as av,M as aw,Mi as ax,Oi as ay,J as az,hi as b,c,ii as d,Wt as e,pi as f,At as g,ze as h,Ft as i,ei as j,T as k,ki as l,it as m,f as n,ut as o,Ue as p,St as q,ui as r,Ot as s,rt as t,Ze as u,v,$e as w,Mt as x,Ke as y,X as z}; diff --git a/custom-toc-highlight/assets/Tick-DUHqbpyB-DY4eRS4C.js b/custom-toc-highlight/assets/Tick-DUHqbpyB-Dd2p6esB.js similarity index 99% rename from custom-toc-highlight/assets/Tick-DUHqbpyB-DY4eRS4C.js rename to custom-toc-highlight/assets/Tick-DUHqbpyB-Dd2p6esB.js index 254083cf..404b2bcb 100644 --- a/custom-toc-highlight/assets/Tick-DUHqbpyB-DY4eRS4C.js +++ b/custom-toc-highlight/assets/Tick-DUHqbpyB-Dd2p6esB.js @@ -1 +1 @@ -import{k0 as O}from"./story-BfX8CRfG.js";import{H as C,V as K,aE as Q,c as w,k as Z,aF as X,U as k,aG as W,B as $,a8 as H,n as J,aH as ee,ap as z,aI as te,a5 as G}from"./Theme-rblUnB2V-D2UsCNGl.js";class se extends X{constructor(){super(...arguments),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,s){this.processor&&this.processor.processRow(s),super._onSetIndex(e,t,s)}}class R extends Q{constructor(e,t,s){super(s),Object.defineProperty(this,"component",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"close",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw("visible",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw("visible",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get("visible")}}class j extends C{constructor(){super(...arguments),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new se}),Object.defineProperty(this,"_dataItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mainDataItems",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,"valueFields",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"fields",{enumerable:!0,configurable:!0,writable:!0,value:["id"]}),Object.defineProperty(this,"_valueFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueFieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataChanged",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll(e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,e.type==="clear")w(t,s=>{s.dispose()}),t.length=0,this._onDataClear();else if(e.type==="push"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.push(s),this.processDataItem(s)}else if(e.type==="setIndex"){const s=t[e.index],i=this._makeDataItem(e.newValue);s.bullets&&s.bullets.length==0&&(s.bullets=void 0),Z(i).forEach(r=>{s.animate({key:r,to:i[r],duration:this.get("interpolationDuration",0),easing:this.get("interpolationEasing")})}),s.dataContext=e.newValue}else if(e.type==="insertIndex"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,s),this.processDataItem(s)}else if(e.type==="removeIndex")t[e.index].dispose(),t.splice(e.index,1);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");{const s=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,s)}}this._afterDataChange()}))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},w(this.valueFields,e=>{this.get(e+"Field")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+"Field",workingKey:e+"Working"})})),this.fields&&(this._fields=[],this._fieldsF={},w(this.fields,e=>{this.get(e+"Field")&&(this._fields.push(e),this._fieldsF[e]=e+"Field")}))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&w(this._valueFields,s=>{const i=this.get(this._valueFieldsF[s].fieldKey);t[s]=e[i],t[this._valueFieldsF[s].workingKey]=t[s]}),this._fields&&w(this._fields,s=>{const i=this.get(this._fieldsF[s]);t[s]=e[i]}),t}makeDataItem(e,t){let s=new R(this,t,e);return this.processDataItem(s),s}pushDataItem(e,t){const s=this.makeDataItem(e,t);return this._mainDataItems.push(s),s}disposeDataItem(e){}showDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!0)})}hideDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!1)})}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e="datavalidated";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}function ie(l){return new Promise((e,t)=>{setTimeout(e,l)})}Object.defineProperty(j,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Component"}),Object.defineProperty(j,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([j.className])});let ae={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2629742400,year:31536e6};function P(l,e){return e==null&&(e=1),ae[l]*e}function U(l,e,t,s,i,r,o){if(!o||i){let h=0;switch(i||e=="millisecond"||(h=l.getTimezoneOffset(),l.setUTCMinutes(l.getUTCMinutes()-h)),e){case"day":let d=l.getUTCDate();if(t>1){if(r){r=U(r,"day",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("day")/t),x=P("day",b*t);l.setTime(r.getTime()+x-h*P("minute"))}}else l.setUTCDate(d);l.setUTCHours(0,0,0,0);break;case"second":let n=l.getUTCSeconds();t>1&&(n=Math.floor(n/t)*t),l.setUTCSeconds(n,0);break;case"millisecond":if(t==1)return l;let m=l.getUTCMilliseconds();m=Math.floor(m/t)*t,l.setUTCMilliseconds(m);break;case"hour":let f=l.getUTCHours();t>1&&(f=Math.floor(f/t)*t),l.setUTCHours(f,0,0,0);break;case"minute":let u=l.getUTCMinutes();t>1&&(u=Math.floor(u/t)*t),l.setUTCMinutes(u,0,0);break;case"month":let a=l.getUTCMonth();t>1&&(a=Math.floor(a/t)*t),l.setUTCMonth(a,1),l.setUTCHours(0,0,0,0);break;case"year":let g=l.getUTCFullYear();t>1&&(g=Math.floor(g/t)*t),l.setUTCFullYear(g,0,1),l.setUTCHours(0,0,0,0);break;case"week":if(t>1&&r){r=U(r,"week",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("week")/t),x=P("week",b*t);l.setTime(r.getTime()+x-h*P("minute"))}let y=l.getUTCDate(),_=l.getUTCDay();$(s)||(s=1),y=_>=s?y-_+s:y-(7+_)+s,l.setUTCDate(y),l.setUTCHours(0,0,0,0)}if(!i&&e!="millisecond"&&(l.setUTCMinutes(l.getUTCMinutes()+h),e=="day"||e=="week"||e=="month"||e=="year")){let d=l.getTimezoneOffset();if(d!=h){let n=d-h;l.setUTCMinutes(l.getUTCMinutes()+n)}}return l}{if(isNaN(l.getTime()))return l;let h=o.offsetUTC(l),d=l.getTimezoneOffset(),n=o.parseDate(l),m=n.year,f=n.month,u=n.day,a=n.hour,g=n.minute,y=n.second,_=n.millisecond,D=n.weekday,b=h-d;switch(e){case"day":if(t>1&&r){r=U(r,"day",1,s,i,void 0,o);let T=l.getTime()-r.getTime(),V=Math.floor(T/P("day")/t),I=P("day",V*t);l.setTime(r.getTime()+I),n=o.parseDate(l),m=n.year,f=n.month,u=n.day}a=0,g=b,y=0,_=0;break;case"second":g+=b,t>1&&(y=Math.floor(y/t)*t),_=0;break;case"millisecond":g+=b,t>1&&(_=Math.floor(_/t)*t);break;case"hour":t>1&&(a=Math.floor(a/t)*t),g=b,y=0,_=0;break;case"minute":t>1&&(g=Math.floor(g/t)*t),g+=b,y=0,_=0;break;case"month":t>1&&(f=Math.floor(f/t)*t),u=1,a=0,g=b,y=0,_=0;break;case"year":t>1&&(m=Math.floor(m/t)*t),f=0,u=1,a=0,g=b,y=0,_=0;break;case"week":$(s)||(s=1),u=D>=s?u-D+s:u-(7+D)+s,a=0,g=b,y=0,_=0}let x=(l=new Date(m,f,u,a,g,y,_)).getTimezoneOffset(),c=o.offsetUTC(l)-x;return c!=b&&l.setTime(l.getTime()+6e4*(c-b)),l}}class B extends j{constructor(){super(...arguments),Object.defineProperty(this,"_aggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionAggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_psi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pei",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:new X}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,position:"absolute"})})}_afterNew(){this.valueFields.push("value","customValue"),super._afterNew(),this.setPrivate("customData",{}),this._disposers.push(this.bullets.events.onAll(e=>{if(e.type==="clear")this._handleBullets(this.dataItems);else if(e.type==="push")this._handleBullets(this.dataItems);else if(e.type==="setIndex")this._handleBullets(this.dataItems);else if(e.type==="insertIndex")this._handleBullets(this.dataItems);else if(e.type==="removeIndex")this._handleBullets(this.dataItems);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._handleBullets(this.dataItems)}}))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("startIndex",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("endIndex",e),e)}_handleBullets(e){w(e,t=>{const s=t.bullets;s&&(w(s,i=>{i.dispose()}),t.bullets=void 0)}),this.markDirtyValues()}getDataItemById(e){return W(this.dataItems,t=>t.get("id")==e)}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each(t=>{this._makeBullet(e,t)}))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,s){const i=t(this._root,this,e);return i&&(i._index=s,this._makeBulletReal(e,i)),i}_makeBulletReal(e,t){let s=t.get("sprite");s&&(s._setDataItem(e),s.setRaw("position","absolute"),this.bulletsContainer.children.push(s)),t.series=this,e.bullets.push(t)}addBullet(e,t){e.bullets||(e.bullets=[]),t&&this._makeBulletReal(e,t)}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty("name")&&this.updateLegendValue(),this.isDirty("heatRules")&&(this._valuesDirty=!0),this.isPrivateDirty("baseValueSeries")){const s=this.getPrivate("baseValueSeries");s&&this._disposers.push(s.onPrivate("startIndex",()=>{this.markDirtyValues()}))}if(this.get("calculateAggregates")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0,e!=0&&(this._psi=void 0))),this._psi==e&&this._pei==t&&!this.isPrivateDirty("adjustedStartIndex")||this._selectionAggregatesCalculated||(e===0&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty("tooltip")){let s=this.get("tooltip");s&&(s.hide(0),s.set("tooltipTarget",this))}if(this.isDirty("fill")||this.isDirty("stroke")){let s;const i=this.get("legendDataItem");if(i&&(s=i.get("markerRectangle"),s&&this.isVisible())){if(this.isDirty("stroke")){let r=this.get("stroke");s.set("stroke",r)}if(this.isDirty("fill")){let r=this.get("fill");s.set("fill",r)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let s=this.startIndex(),i=this.endIndex();i{i[a]=0,r[a]=0,o[a]=0}),w(s,a=>{let g=a+"Change",y=a+"ChangePercent",_=a+"ChangePrevious",D=a+"ChangePreviousPercent",b=a+"ChangeSelection",x=a+"ChangeSelectionPercent",c="valueY";a!="valueX"&&a!="openValueX"&&a!="lowValueX"&&a!="highValueX"||(c="valueX");const T=this.getPrivate("baseValueSeries"),V=this.getPrivate("adjustedStartIndex",e);for(let I=V;Ip||h[a]==null)&&(h[a]=p),(d[a]0&&e--,delete u[a];for(let I=e;I{this.setPrivate(a+"AverageSelection",f[a]),this.setPrivate(a+"CountSelection",o[a]),this.setPrivate(a+"SumSelection",i[a]),this.setPrivate(a+"AbsoluteSumSelection",r[a]),this.setPrivate(a+"LowSelection",h[a]),this.setPrivate(a+"HighSelection",d[a]),this.setPrivate(a+"OpenSelection",n[a]),this.setPrivate(a+"CloseSelection",m[a])}),e===0&&t===this.dataItems.length&&w(s,a=>{this.setPrivate(a+"Average",f[a]),this.setPrivate(a+"Count",o[a]),this.setPrivate(a+"Sum",i[a]),this.setPrivate(a+"AbsoluteSum",r[a]),this.setPrivate(a+"Low",h[a]),this.setPrivate(a+"High",d[a]),this.setPrivate(a+"Open",n[a]),this.setPrivate(a+"Close",m[a])})}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty("visible")&&this.bulletsContainer.set("visible",this.get("visible"));const e=this.get("heatRules");if(this._valuesDirty&&e&&e.length>0&&w(e,t=>{const s=t.minValue||this.getPrivate(t.dataField+"Low")||0,i=t.maxValue||this.getPrivate(t.dataField+"High")||0;w(t.target._entities,r=>{const o=r.dataItem.get(t.dataField);if(!$(o)){t.neutral&&r.set(t.key,t.neutral);const h=r.states;if(h){const d=h.lookup("default");d&&t.neutral&&d.set(t.key,t.neutral)}if(!t.customFunction)return}if(t.customFunction)t.customFunction.call(this,r,s,i,o);else{let h,d;h=t.logarithmic?(Math.log(o)*Math.LOG10E-Math.log(s)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(s)*Math.LOG10E):(o-s)/(i-s),!$(o)||$(h)&&Math.abs(h)!=1/0||(h=.5),$(t.min)?d=t.min+(t.max-t.min)*h:t.min instanceof H?d=H.interpolate(h,t.min,t.max):t.min instanceof J&&(d=ee(h,t.min,t.max)),r.set(t.key,d);const n=r.states;if(n){const m=n.lookup("default");m&&m.set(t.key,d)}}})}),this.get("visible")){let t=this.dataItems.length,s=this.startIndex(),i=this.endIndex();i0&&s--;for(let r=0;r{this._positionBullet(t);const s=t.get("sprite");t.get("dynamic")&&(s&&(s._markDirtyKey("fill"),s.markDirtySize()),s instanceof C&&s.walkChildren(i=>{i._markDirtyKey("fill"),i.markDirtySize(),i instanceof z&&i.text.markDirtyText()})),s instanceof z&&s.get("populateText")&&s.text.markDirtyText()})}_hideBullets(e){e.bullets&&w(e.bullets,t=>{let s=t.get("sprite");s&&s.setPrivate("visible",!1)})}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&w(t,s=>{s.dispose()})}_getItemReaderLabel(){return""}showDataItem(e,t){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return O(this,void 0,void 0,function*(){const i=[s.showDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.show(t))}),yield Promise.all(i)})}hideDataItem(e,t){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return O(this,void 0,void 0,function*(){const i=[s.hideDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.hide(t))}),yield Promise.all(i)})}_sequencedShowHide(e,t){return O(this,void 0,void 0,function*(){if(this.get("sequencedInterpolation"))if($(t)||(t=this.get("interpolationDuration",0)),t>0){const s=this.startIndex(),i=this.endIndex();yield Promise.all(G(this.dataItems,(r,o)=>O(this,void 0,void 0,function*(){let h=t||0;(oi+10)&&(h=0);let d=this.get("sequencedDelay",0)+h/(i-s);yield ie(d*(o-s)),e?yield this.showDataItem(r,h):yield this.hideDataItem(r,h)})))}else yield Promise.all(G(this.dataItems,s=>e?this.showDataItem(s,0):this.hideDataItem(s,0)))})}updateLegendValue(e){if(e){const t=e.get("legendDataItem");if(t){const s=t.get("valueLabel");if(s){const r=s.text;let o="";s._setDataItem(e),o=this.get("legendValueText",r.get("text","")),s.set("text",o),r.markDirtyText()}const i=t.get("label");if(i){const r=i.text;let o="";i._setDataItem(e),o=this.get("legendLabelText",r.get("text","")),i.set("text",o),r.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}function q(l,e){for(let t=0,s=e.length;t0){let r=i[0];if(r.length>0){let o=r[0];l.moveTo(o.x,o.y);for(let h=0,d=i.length;h0){let s=e[0];this._display.moveTo(s.x,s.y),q(this._display,[[e]])}else if(t)q(this._display,t);else if(!this.get("draw")){let s=this.width(),i=this.height();this._display.moveTo(0,0),this._display.lineTo(s,i)}}}}function de(l){return function(){return l}}Object.defineProperty(S,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Line"}),Object.defineProperty(S,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([S.className])});const L=Math.PI,E=2*L,M=1e-6,le=E-M;function Y(l){this._+=l[0];for(let e=1,t=l.length;e=0))throw new Error(`invalid digits: ${l}`);if(e>15)return Y;const t=10**e;return function(s){this._+=s[0];for(let i=1,r=s.length;iM)if(Math.abs(f*d-n*m)>M&&r){let a=s-o,g=i-h,y=d*d+n*n,_=a*a+g*g,D=Math.sqrt(y),b=Math.sqrt(u),x=r*Math.tan((L-Math.acos((y+u-_)/(2*D*b)))/2),c=x/b,T=x/D;Math.abs(c-1)>M&&this._append`L${e+c*m},${t+c*f}`,this._append`A${r},${r},0,0,${+(f*a>m*g)},${this._x1=e+T*d},${this._y1=t+T*n}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,s,i,r,o){if(e=+e,t=+t,o=!!o,(s=+s)<0)throw new Error(`negative radius: ${s}`);let h=s*Math.cos(i),d=s*Math.sin(i),n=e+h,m=t+d,f=1^o,u=o?i-r:r-i;this._x1===null?this._append`M${n},${m}`:(Math.abs(this._x1-n)>M||Math.abs(this._y1-m)>M)&&this._append`L${n},${m}`,s&&(u<0&&(u=u%E+E),u>le?this._append`A${s},${s},0,1,${f},${e-h},${t-d}A${s},${s},0,1,${f},${this._x1=n},${this._y1=m}`:u>M&&this._append`A${s},${s},0,${+(u>=L)},${f},${this._x1=e+s*Math.cos(r)},${this._y1=t+s*Math.sin(r)}`)}rect(e,t,s,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${s=+s}v${+i}h${-s}Z`}toString(){return this._}}function ce(l){let e=3;return l.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const s=Math.floor(t);if(!(s>=0))throw new RangeError(`invalid digits: ${t}`);e=s}return l},()=>new oe(e)}class F extends C{constructor(){super(...arguments),Object.defineProperty(this,"chartContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(C.new(this._root,{width:k,height:k,interactiveChildren:!1}))}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:"absolute",width:k,height:k})})}}Object.defineProperty(F,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Chart"}),Object.defineProperty(F,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([F.className])});class N extends F{constructor(){super(...arguments),Object.defineProperty(this,"seriesContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,isMeasured:!1})}),Object.defineProperty(this,"series",{enumerable:!0,configurable:!0,writable:!0,value:new te})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll(t=>{if(t.type==="clear"){w(t.oldValues,r=>{this._removeSeries(r)});const s=this.get("colors");s&&s.reset();const i=this.get("patterns");i&&i.reset()}else if(t.type==="push")e.moveValue(t.newValue),this._processSeries(t.newValue);else if(t.type==="setIndex")e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="insertIndex")e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="removeIndex")this._removeSeries(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.moveValue(t.value,t.newIndex),this._processSeries(t.value)}}))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(N,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SerialChart"}),Object.defineProperty(N,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:F.classNames.concat([N.className])});class A extends S{}Object.defineProperty(A,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tick"}),Object.defineProperty(A,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:S.classNames.concat([A.className])});export{A,N as B,U as N,R,B as U,j,de as n,ce as u}; +import{k0 as O}from"./story-Doly9N9p.js";import{H as C,V as K,aE as Q,c as w,k as Z,aF as X,U as k,aG as W,B as $,a8 as H,n as J,aH as ee,ap as z,aI as te,a5 as G}from"./Theme-rblUnB2V-Dc7wtY6B.js";class se extends X{constructor(){super(...arguments),Object.defineProperty(this,"processor",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}incrementRef(){}decrementRef(){}_onPush(e){this.processor&&this.processor.processRow(e),super._onPush(e)}_onInsertIndex(e,t){this.processor&&this.processor.processRow(t),super._onInsertIndex(e,t)}_onSetIndex(e,t,s){this.processor&&this.processor.processRow(s),super._onSetIndex(e,t,s)}}class R extends Q{constructor(e,t,s){super(s),Object.defineProperty(this,"component",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dataContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"close",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dataContext=t,this.component=e,this._settings.visible=!0,this._checkDirty()}markDirty(){this.component.markDirtyValues(this)}_startAnimation(){this.component._root._addAnimation(this)}_animationTime(){return this.component._root.animationTime}_dispose(){this.component&&this.component.disposeDataItem(this),super._dispose()}show(e){this.setRaw("visible",!0),this.component&&this.component.showDataItem(this,e)}hide(e){this.setRaw("visible",!1),this.component&&this.component.hideDataItem(this,e)}isHidden(){return!this.get("visible")}}class j extends C{constructor(){super(...arguments),Object.defineProperty(this,"_data",{enumerable:!0,configurable:!0,writable:!0,value:new se}),Object.defineProperty(this,"_dataItems",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mainDataItems",{enumerable:!0,configurable:!0,writable:!0,value:this._dataItems}),Object.defineProperty(this,"valueFields",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"fields",{enumerable:!0,configurable:!0,writable:!0,value:["id"]}),Object.defineProperty(this,"_valueFields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valueFieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fieldsF",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_valuesDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataChanged",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataGrouped",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inited",{enumerable:!0,configurable:!0,writable:!0,value:!1})}set data(e){e.incrementRef(),this._data.decrementRef(),this._data=e}get data(){return this._data}_dispose(){super._dispose(),this._data.decrementRef()}_onDataClear(){}_afterNew(){super._afterNew(),this._data.incrementRef(),this._updateFields(),this._disposers.push(this.data.events.onAll(e=>{const t=this._mainDataItems;if(this.markDirtyValues(),this._markDirtyGroup(),this._dataChanged=!0,e.type==="clear")w(t,s=>{s.dispose()}),t.length=0,this._onDataClear();else if(e.type==="push"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.push(s),this.processDataItem(s)}else if(e.type==="setIndex"){const s=t[e.index],i=this._makeDataItem(e.newValue);s.bullets&&s.bullets.length==0&&(s.bullets=void 0),Z(i).forEach(r=>{s.animate({key:r,to:i[r],duration:this.get("interpolationDuration",0),easing:this.get("interpolationEasing")})}),s.dataContext=e.newValue}else if(e.type==="insertIndex"){const s=new R(this,e.newValue,this._makeDataItem(e.newValue));t.splice(e.index,0,s),this.processDataItem(s)}else if(e.type==="removeIndex")t[e.index].dispose(),t.splice(e.index,1);else{if(e.type!=="moveIndex")throw new Error("Unknown IStreamEvent type");{const s=t[e.oldIndex];t.splice(e.oldIndex,1),t.splice(e.newIndex,0,s)}}this._afterDataChange()}))}_updateFields(){this.valueFields&&(this._valueFields=[],this._valueFieldsF={},w(this.valueFields,e=>{this.get(e+"Field")&&(this._valueFields.push(e),this._valueFieldsF[e]={fieldKey:e+"Field",workingKey:e+"Working"})})),this.fields&&(this._fields=[],this._fieldsF={},w(this.fields,e=>{this.get(e+"Field")&&(this._fields.push(e),this._fieldsF[e]=e+"Field")}))}get dataItems(){return this._dataItems}processDataItem(e){}_makeDataItem(e){const t={};return this._valueFields&&w(this._valueFields,s=>{const i=this.get(this._valueFieldsF[s].fieldKey);t[s]=e[i],t[this._valueFieldsF[s].workingKey]=t[s]}),this._fields&&w(this._fields,s=>{const i=this.get(this._fieldsF[s]);t[s]=e[i]}),t}makeDataItem(e,t){let s=new R(this,t,e);return this.processDataItem(s),s}pushDataItem(e,t){const s=this.makeDataItem(e,t);return this._mainDataItems.push(s),s}disposeDataItem(e){}showDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!0)})}hideDataItem(e,t){return O(this,void 0,void 0,function*(){e.set("visible",!1)})}_clearDirty(){super._clearDirty(),this._valuesDirty=!1}_afterDataChange(){}_afterChanged(){if(super._afterChanged(),this._dataChanged){const e="datavalidated";this.events.isEnabled(e)&&this.events.dispatch(e,{type:e,target:this}),this._dataChanged=!1}this.inited=!0}markDirtyValues(e){this.markDirty(),this._valuesDirty=!0}_markDirtyGroup(){this._dataGrouped=!1}markDirtySize(){this._sizeDirty=!0,this.markDirty()}}function ie(l){return new Promise((e,t)=>{setTimeout(e,l)})}Object.defineProperty(j,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Component"}),Object.defineProperty(j,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([j.className])});let ae={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2629742400,year:31536e6};function P(l,e){return e==null&&(e=1),ae[l]*e}function U(l,e,t,s,i,r,o){if(!o||i){let h=0;switch(i||e=="millisecond"||(h=l.getTimezoneOffset(),l.setUTCMinutes(l.getUTCMinutes()-h)),e){case"day":let d=l.getUTCDate();if(t>1){if(r){r=U(r,"day",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("day")/t),x=P("day",b*t);l.setTime(r.getTime()+x-h*P("minute"))}}else l.setUTCDate(d);l.setUTCHours(0,0,0,0);break;case"second":let n=l.getUTCSeconds();t>1&&(n=Math.floor(n/t)*t),l.setUTCSeconds(n,0);break;case"millisecond":if(t==1)return l;let m=l.getUTCMilliseconds();m=Math.floor(m/t)*t,l.setUTCMilliseconds(m);break;case"hour":let f=l.getUTCHours();t>1&&(f=Math.floor(f/t)*t),l.setUTCHours(f,0,0,0);break;case"minute":let u=l.getUTCMinutes();t>1&&(u=Math.floor(u/t)*t),l.setUTCMinutes(u,0,0);break;case"month":let a=l.getUTCMonth();t>1&&(a=Math.floor(a/t)*t),l.setUTCMonth(a,1),l.setUTCHours(0,0,0,0);break;case"year":let g=l.getUTCFullYear();t>1&&(g=Math.floor(g/t)*t),l.setUTCFullYear(g,0,1),l.setUTCHours(0,0,0,0);break;case"week":if(t>1&&r){r=U(r,"week",1);let D=l.getTime()-r.getTime(),b=Math.floor(D/P("week")/t),x=P("week",b*t);l.setTime(r.getTime()+x-h*P("minute"))}let y=l.getUTCDate(),_=l.getUTCDay();$(s)||(s=1),y=_>=s?y-_+s:y-(7+_)+s,l.setUTCDate(y),l.setUTCHours(0,0,0,0)}if(!i&&e!="millisecond"&&(l.setUTCMinutes(l.getUTCMinutes()+h),e=="day"||e=="week"||e=="month"||e=="year")){let d=l.getTimezoneOffset();if(d!=h){let n=d-h;l.setUTCMinutes(l.getUTCMinutes()+n)}}return l}{if(isNaN(l.getTime()))return l;let h=o.offsetUTC(l),d=l.getTimezoneOffset(),n=o.parseDate(l),m=n.year,f=n.month,u=n.day,a=n.hour,g=n.minute,y=n.second,_=n.millisecond,D=n.weekday,b=h-d;switch(e){case"day":if(t>1&&r){r=U(r,"day",1,s,i,void 0,o);let T=l.getTime()-r.getTime(),V=Math.floor(T/P("day")/t),I=P("day",V*t);l.setTime(r.getTime()+I),n=o.parseDate(l),m=n.year,f=n.month,u=n.day}a=0,g=b,y=0,_=0;break;case"second":g+=b,t>1&&(y=Math.floor(y/t)*t),_=0;break;case"millisecond":g+=b,t>1&&(_=Math.floor(_/t)*t);break;case"hour":t>1&&(a=Math.floor(a/t)*t),g=b,y=0,_=0;break;case"minute":t>1&&(g=Math.floor(g/t)*t),g+=b,y=0,_=0;break;case"month":t>1&&(f=Math.floor(f/t)*t),u=1,a=0,g=b,y=0,_=0;break;case"year":t>1&&(m=Math.floor(m/t)*t),f=0,u=1,a=0,g=b,y=0,_=0;break;case"week":$(s)||(s=1),u=D>=s?u-D+s:u-(7+D)+s,a=0,g=b,y=0,_=0}let x=(l=new Date(m,f,u,a,g,y,_)).getTimezoneOffset(),c=o.offsetUTC(l)-x;return c!=b&&l.setTime(l.getTime()+6e4*(c-b)),l}}class B extends j{constructor(){super(...arguments),Object.defineProperty(this,"_aggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_selectionAggregatesCalculated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataProcessed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_psi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pei",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"chart",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"bullets",{enumerable:!0,configurable:!0,writable:!0,value:new X}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,position:"absolute"})})}_afterNew(){this.valueFields.push("value","customValue"),super._afterNew(),this.setPrivate("customData",{}),this._disposers.push(this.bullets.events.onAll(e=>{if(e.type==="clear")this._handleBullets(this.dataItems);else if(e.type==="push")this._handleBullets(this.dataItems);else if(e.type==="setIndex")this._handleBullets(this.dataItems);else if(e.type==="insertIndex")this._handleBullets(this.dataItems);else if(e.type==="removeIndex")this._handleBullets(this.dataItems);else{if(e.type!=="moveIndex")throw new Error("Unknown IListEvent type");this._handleBullets(this.dataItems)}}))}_dispose(){this.bulletsContainer.dispose(),super._dispose()}startIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("startIndex",0),e)}endIndex(){let e=this.dataItems.length;return Math.min(this.getPrivate("endIndex",e),e)}_handleBullets(e){w(e,t=>{const s=t.bullets;s&&(w(s,i=>{i.dispose()}),t.bullets=void 0)}),this.markDirtyValues()}getDataItemById(e){return W(this.dataItems,t=>t.get("id")==e)}_makeBullets(e){this._shouldMakeBullet(e)&&(e.bullets=[],this.bullets.each(t=>{this._makeBullet(e,t)}))}_shouldMakeBullet(e){return!0}_makeBullet(e,t,s){const i=t(this._root,this,e);return i&&(i._index=s,this._makeBulletReal(e,i)),i}_makeBulletReal(e,t){let s=t.get("sprite");s&&(s._setDataItem(e),s.setRaw("position","absolute"),this.bulletsContainer.children.push(s)),t.series=this,e.bullets.push(t)}addBullet(e,t){e.bullets||(e.bullets=[]),t&&this._makeBulletReal(e,t)}_clearDirty(){super._clearDirty(),this._aggregatesCalculated=!1,this._selectionAggregatesCalculated=!1}_prepareChildren(){super._prepareChildren();let e=this.startIndex(),t=this.endIndex();if(this.isDirty("name")&&this.updateLegendValue(),this.isDirty("heatRules")&&(this._valuesDirty=!0),this.isPrivateDirty("baseValueSeries")){const s=this.getPrivate("baseValueSeries");s&&this._disposers.push(s.onPrivate("startIndex",()=>{this.markDirtyValues()}))}if(this.get("calculateAggregates")&&(this._valuesDirty&&!this._dataProcessed&&(this._aggregatesCalculated||(this._calculateAggregates(0,this.dataItems.length),this._aggregatesCalculated=!0,e!=0&&(this._psi=void 0))),this._psi==e&&this._pei==t&&!this.isPrivateDirty("adjustedStartIndex")||this._selectionAggregatesCalculated||(e===0&&t===this.dataItems.length&&this._aggregatesCalculated||this._calculateAggregates(e,t),this._selectionAggregatesCalculated=!0)),this.isDirty("tooltip")){let s=this.get("tooltip");s&&(s.hide(0),s.set("tooltipTarget",this))}if(this.isDirty("fill")||this.isDirty("stroke")){let s;const i=this.get("legendDataItem");if(i&&(s=i.get("markerRectangle"),s&&this.isVisible())){if(this.isDirty("stroke")){let r=this.get("stroke");s.set("stroke",r)}if(this.isDirty("fill")){let r=this.get("fill");s.set("fill",r)}}this.updateLegendMarker(void 0)}if(this.bullets.length>0){let s=this.startIndex(),i=this.endIndex();i{i[a]=0,r[a]=0,o[a]=0}),w(s,a=>{let g=a+"Change",y=a+"ChangePercent",_=a+"ChangePrevious",D=a+"ChangePreviousPercent",b=a+"ChangeSelection",x=a+"ChangeSelectionPercent",c="valueY";a!="valueX"&&a!="openValueX"&&a!="lowValueX"&&a!="highValueX"||(c="valueX");const T=this.getPrivate("baseValueSeries"),V=this.getPrivate("adjustedStartIndex",e);for(let I=V;Ip||h[a]==null)&&(h[a]=p),(d[a]0&&e--,delete u[a];for(let I=e;I{this.setPrivate(a+"AverageSelection",f[a]),this.setPrivate(a+"CountSelection",o[a]),this.setPrivate(a+"SumSelection",i[a]),this.setPrivate(a+"AbsoluteSumSelection",r[a]),this.setPrivate(a+"LowSelection",h[a]),this.setPrivate(a+"HighSelection",d[a]),this.setPrivate(a+"OpenSelection",n[a]),this.setPrivate(a+"CloseSelection",m[a])}),e===0&&t===this.dataItems.length&&w(s,a=>{this.setPrivate(a+"Average",f[a]),this.setPrivate(a+"Count",o[a]),this.setPrivate(a+"Sum",i[a]),this.setPrivate(a+"AbsoluteSum",r[a]),this.setPrivate(a+"Low",h[a]),this.setPrivate(a+"High",d[a]),this.setPrivate(a+"Open",n[a]),this.setPrivate(a+"Close",m[a])})}_updateChildren(){super._updateChildren(),this._psi=this.startIndex(),this._pei=this.endIndex(),this.isDirty("visible")&&this.bulletsContainer.set("visible",this.get("visible"));const e=this.get("heatRules");if(this._valuesDirty&&e&&e.length>0&&w(e,t=>{const s=t.minValue||this.getPrivate(t.dataField+"Low")||0,i=t.maxValue||this.getPrivate(t.dataField+"High")||0;w(t.target._entities,r=>{const o=r.dataItem.get(t.dataField);if(!$(o)){t.neutral&&r.set(t.key,t.neutral);const h=r.states;if(h){const d=h.lookup("default");d&&t.neutral&&d.set(t.key,t.neutral)}if(!t.customFunction)return}if(t.customFunction)t.customFunction.call(this,r,s,i,o);else{let h,d;h=t.logarithmic?(Math.log(o)*Math.LOG10E-Math.log(s)*Math.LOG10E)/(Math.log(i)*Math.LOG10E-Math.log(s)*Math.LOG10E):(o-s)/(i-s),!$(o)||$(h)&&Math.abs(h)!=1/0||(h=.5),$(t.min)?d=t.min+(t.max-t.min)*h:t.min instanceof H?d=H.interpolate(h,t.min,t.max):t.min instanceof J&&(d=ee(h,t.min,t.max)),r.set(t.key,d);const n=r.states;if(n){const m=n.lookup("default");m&&m.set(t.key,d)}}})}),this.get("visible")){let t=this.dataItems.length,s=this.startIndex(),i=this.endIndex();i0&&s--;for(let r=0;r{this._positionBullet(t);const s=t.get("sprite");t.get("dynamic")&&(s&&(s._markDirtyKey("fill"),s.markDirtySize()),s instanceof C&&s.walkChildren(i=>{i._markDirtyKey("fill"),i.markDirtySize(),i instanceof z&&i.text.markDirtyText()})),s instanceof z&&s.get("populateText")&&s.text.markDirtyText()})}_hideBullets(e){e.bullets&&w(e.bullets,t=>{let s=t.get("sprite");s&&s.setPrivate("visible",!1)})}_positionBullet(e){}_placeBulletsContainer(e){e.bulletsContainer.children.moveValue(this.bulletsContainer)}_removeBulletsContainer(){const e=this.bulletsContainer;e.parent&&e.parent.children.removeValue(e)}disposeDataItem(e){const t=e.bullets;t&&w(t,s=>{s.dispose()})}_getItemReaderLabel(){return""}showDataItem(e,t){const s=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return O(this,void 0,void 0,function*(){const i=[s.showDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.show(t))}),yield Promise.all(i)})}hideDataItem(e,t){const s=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return O(this,void 0,void 0,function*(){const i=[s.hideDataItem.call(this,e,t)],r=e.bullets;r&&w(r,o=>{const h=o.get("sprite");h&&i.push(h.hide(t))}),yield Promise.all(i)})}_sequencedShowHide(e,t){return O(this,void 0,void 0,function*(){if(this.get("sequencedInterpolation"))if($(t)||(t=this.get("interpolationDuration",0)),t>0){const s=this.startIndex(),i=this.endIndex();yield Promise.all(G(this.dataItems,(r,o)=>O(this,void 0,void 0,function*(){let h=t||0;(oi+10)&&(h=0);let d=this.get("sequencedDelay",0)+h/(i-s);yield ie(d*(o-s)),e?yield this.showDataItem(r,h):yield this.hideDataItem(r,h)})))}else yield Promise.all(G(this.dataItems,s=>e?this.showDataItem(s,0):this.hideDataItem(s,0)))})}updateLegendValue(e){if(e){const t=e.get("legendDataItem");if(t){const s=t.get("valueLabel");if(s){const r=s.text;let o="";s._setDataItem(e),o=this.get("legendValueText",r.get("text","")),s.set("text",o),r.markDirtyText()}const i=t.get("label");if(i){const r=i.text;let o="";i._setDataItem(e),o=this.get("legendLabelText",r.get("text","")),i.set("text",o),r.markDirtyText()}}}}updateLegendMarker(e){}_onHide(){super._onHide();const e=this.getTooltip();e&&e.hide()}hoverDataItem(e){}unhoverDataItem(e){}_getBase(e){const t=this.dataItems[this.startIndex()];return t?t.get(e):0}}function q(l,e){for(let t=0,s=e.length;t0){let r=i[0];if(r.length>0){let o=r[0];l.moveTo(o.x,o.y);for(let h=0,d=i.length;h0){let s=e[0];this._display.moveTo(s.x,s.y),q(this._display,[[e]])}else if(t)q(this._display,t);else if(!this.get("draw")){let s=this.width(),i=this.height();this._display.moveTo(0,0),this._display.lineTo(s,i)}}}}function de(l){return function(){return l}}Object.defineProperty(S,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Line"}),Object.defineProperty(S,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:K.classNames.concat([S.className])});const L=Math.PI,E=2*L,M=1e-6,le=E-M;function Y(l){this._+=l[0];for(let e=1,t=l.length;e=0))throw new Error(`invalid digits: ${l}`);if(e>15)return Y;const t=10**e;return function(s){this._+=s[0];for(let i=1,r=s.length;iM)if(Math.abs(f*d-n*m)>M&&r){let a=s-o,g=i-h,y=d*d+n*n,_=a*a+g*g,D=Math.sqrt(y),b=Math.sqrt(u),x=r*Math.tan((L-Math.acos((y+u-_)/(2*D*b)))/2),c=x/b,T=x/D;Math.abs(c-1)>M&&this._append`L${e+c*m},${t+c*f}`,this._append`A${r},${r},0,0,${+(f*a>m*g)},${this._x1=e+T*d},${this._y1=t+T*n}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,s,i,r,o){if(e=+e,t=+t,o=!!o,(s=+s)<0)throw new Error(`negative radius: ${s}`);let h=s*Math.cos(i),d=s*Math.sin(i),n=e+h,m=t+d,f=1^o,u=o?i-r:r-i;this._x1===null?this._append`M${n},${m}`:(Math.abs(this._x1-n)>M||Math.abs(this._y1-m)>M)&&this._append`L${n},${m}`,s&&(u<0&&(u=u%E+E),u>le?this._append`A${s},${s},0,1,${f},${e-h},${t-d}A${s},${s},0,1,${f},${this._x1=n},${this._y1=m}`:u>M&&this._append`A${s},${s},0,${+(u>=L)},${f},${this._x1=e+s*Math.cos(r)},${this._y1=t+s*Math.sin(r)}`)}rect(e,t,s,i){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${s=+s}v${+i}h${-s}Z`}toString(){return this._}}function ce(l){let e=3;return l.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const s=Math.floor(t);if(!(s>=0))throw new RangeError(`invalid digits: ${t}`);e=s}return l},()=>new oe(e)}class F extends C{constructor(){super(...arguments),Object.defineProperty(this,"chartContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(C.new(this._root,{width:k,height:k,interactiveChildren:!1}))}),Object.defineProperty(this,"bulletsContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{interactiveChildren:!1,isMeasured:!1,position:"absolute",width:k,height:k})})}}Object.defineProperty(F,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Chart"}),Object.defineProperty(F,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:C.classNames.concat([F.className])});class N extends F{constructor(){super(...arguments),Object.defineProperty(this,"seriesContainer",{enumerable:!0,configurable:!0,writable:!0,value:C.new(this._root,{width:k,height:k,isMeasured:!1})}),Object.defineProperty(this,"series",{enumerable:!0,configurable:!0,writable:!0,value:new te})}_afterNew(){super._afterNew(),this._disposers.push(this.series);const e=this.seriesContainer.children;this._disposers.push(this.series.events.onAll(t=>{if(t.type==="clear"){w(t.oldValues,r=>{this._removeSeries(r)});const s=this.get("colors");s&&s.reset();const i=this.get("patterns");i&&i.reset()}else if(t.type==="push")e.moveValue(t.newValue),this._processSeries(t.newValue);else if(t.type==="setIndex")e.setIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="insertIndex")e.insertIndex(t.index,t.newValue),this._processSeries(t.newValue);else if(t.type==="removeIndex")this._removeSeries(t.oldValue);else{if(t.type!=="moveIndex")throw new Error("Unknown IListEvent type");e.moveValue(t.value,t.newIndex),this._processSeries(t.value)}}))}_processSeries(e){e.chart=this,e._placeBulletsContainer(this)}_removeSeries(e){e.isDisposed()||(this.seriesContainer.children.removeValue(e),e._removeBulletsContainer())}}Object.defineProperty(N,"className",{enumerable:!0,configurable:!0,writable:!0,value:"SerialChart"}),Object.defineProperty(N,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:F.classNames.concat([N.className])});class A extends S{}Object.defineProperty(A,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tick"}),Object.defineProperty(A,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:S.classNames.concat([A.className])});export{A,N as B,U as N,R,B as U,j,de as n,ce as u}; diff --git a/custom-toc-highlight/assets/Tile-D75RMC64-Dj1SOP3K.js b/custom-toc-highlight/assets/Tile-D75RMC64-g8Sx5TPr.js similarity index 98% rename from custom-toc-highlight/assets/Tile-D75RMC64-Dj1SOP3K.js rename to custom-toc-highlight/assets/Tile-D75RMC64-g8Sx5TPr.js index ca3537f6..281d9e70 100644 --- a/custom-toc-highlight/assets/Tile-D75RMC64-Dj1SOP3K.js +++ b/custom-toc-highlight/assets/Tile-D75RMC64-g8Sx5TPr.js @@ -1 +1 @@ -import{n as rt}from"./common-CYWrYyJl-E8-sukrT.js";import{dB as lt,v as b,S as F,i as at,aG as H,j as ht,aA as ct,an as ut,dC as ft,bh as D,n as mt,ba as dt,dD as pt}from"./story-BfX8CRfG.js";import{s as L}from"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import{f as gt,M as $}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{k as _t}from"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import{b as yt}from"./quickselect-DHTstthl-Ds_Aj0x5.js";import{a as xt}from"./Query-BrwMGK8U-DoFNfkjX.js";function vt(t,e){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 Mt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function wt(t,e,i,s,o,n,r){return t[0]=e,t[1]=i,t[2]=s,t[3]=o,t[4]=n,t[5]=r,t}function It(t,e){const i=e[0],s=e[1],o=e[2],n=e[3],r=e[4],l=e[5];let a=i*n-s*o;return a?(a=1/a,t[0]=n*a,t[1]=-s*a,t[2]=-o*a,t[3]=i*a,t[4]=(o*l-n*r)*a,t[5]=(s*r-i*l)*a,t):null}function St(t){return t[0]*t[3]-t[1]*t[2]}function tt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=i[0],c=i[1],f=i[2],m=i[3],_=i[4],d=i[5];return t[0]=s*h+n*c,t[1]=o*h+r*c,t[2]=s*f+n*m,t[3]=o*f+r*m,t[4]=s*_+n*d+l,t[5]=o*_+r*d+a,t}function Bt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=Math.sin(i),c=Math.cos(i);return t[0]=s*c+n*h,t[1]=o*c+r*h,t[2]=s*-h+n*c,t[3]=o*-h+r*c,t[4]=l,t[5]=a,t}function bt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=i[0],c=i[1];return t[0]=s*h,t[1]=o*h,t[2]=n*c,t[3]=r*c,t[4]=l,t[5]=a,t}function Tt(t,e,i){const s=e[0],o=e[1],n=e[2],r=e[3],l=e[4],a=e[5],h=i[0],c=i[1];return t[0]=s,t[1]=o,t[2]=n,t[3]=r,t[4]=s*h+n*c+l,t[5]=o*h+r*c+a,t}function Ct(t,e){const i=Math.sin(e),s=Math.cos(e);return t[0]=s,t[1]=i,t[2]=-i,t[3]=s,t[4]=0,t[5]=0,t}function Ft(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t[4]=0,t[5]=0,t}function zt(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=e[0],t[5]=e[1],t}function Yt(t){return"mat2d("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+")"}function Xt(t){return Math.sqrt(t[0]**2+t[1]**2+t[2]**2+t[3]**2+t[4]**2+t[5]**2+1)}function Pt(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t[4]=e[4]+i[4],t[5]=e[5]+i[5],t}function et(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t[4]=e[4]-i[4],t[5]=e[5]-i[5],t}function kt(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*i,t[5]=e[5]*i,t}function Rt(t,e,i,s){return t[0]=e[0]+i[0]*s,t[1]=e[1]+i[1]*s,t[2]=e[2]+i[2]*s,t[3]=e[3]+i[3]*s,t[4]=e[4]+i[4]*s,t[5]=e[5]+i[5]*s,t}function Lt(t,e){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]}function At(t,e){const i=t[0],s=t[1],o=t[2],n=t[3],r=t[4],l=t[5],a=e[0],h=e[1],c=e[2],f=e[3],m=e[4],_=e[5],d=rt();return Math.abs(i-a)<=d*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(s-h)<=d*Math.max(1,Math.abs(s),Math.abs(h))&&Math.abs(o-c)<=d*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(n-f)<=d*Math.max(1,Math.abs(n),Math.abs(f))&&Math.abs(r-m)<=d*Math.max(1,Math.abs(r),Math.abs(m))&&Math.abs(l-_)<=d*Math.max(1,Math.abs(l),Math.abs(_))}const Ot=tt,Vt=et;Object.freeze(Object.defineProperty({__proto__:null,add:Pt,copy:vt,determinant:St,equals:At,exactEquals:Lt,frob:Xt,fromRotation:Ct,fromScaling:Ft,fromTranslation:zt,identity:Mt,invert:It,mul:Ot,multiply:tt,multiplyScalar:kt,multiplyScalarAndAdd:Rt,rotate:Bt,scale:bt,set:wt,str:Yt,sub:Vt,subtract:et,translate:Tt},Symbol.toStringTag,{value:"Module"}));function qt(){const t=new Float32Array(6);return t[0]=1,t[3]=1,t}function Et(t){const e=new Float32Array(6);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 jt(t,e,i,s,o,n){const r=new Float32Array(6);return r[0]=t,r[1]=e,r[2]=i,r[3]=s,r[4]=o,r[5]=n,r}function Nt(t,e){return new Float32Array(t,e,6)}function it(t,e,i,s){const o=e[s],n=e[s+1];t[s]=i[0]*o+i[2]*n+i[4],t[s+1]=i[1]*o+i[3]*n+i[5]}function Kt(t,e,i,s=0,o=0,n=2){const r=o||e.length/n;for(let l=s;l=i&&(e.col=s-i,e.world+=1)}denormalizeCol(e,i){return this.wrap?this.worldSize[0]*i+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){const i=this.origin[0]+e*this.norm[0],s=this._spatialReferenceOrigin,o=this._spatialReferenceValid;return this.wrap&&s&&o?i===s[0]?o[0]:this.origin[0]===s[0]&&e===this.worldSize[0]?o[1]:i:i}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world),n=v.row;return Dt(e,this.getXForColumn(o),this.getYForRow(n+1),this.getXForColumn(o+1),this.getYForRow(n)),e}getTileCoords(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world);return Array.isArray(e)?T(e,this.getXForColumn(o),this.getYForRow(v.row)):(e.x=this.getXForColumn(o),e.y=this.getYForRow(v.row)),e}},q=class{constructor(){this.spans=[]}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}*keys(){const t=this.lodInfo;for(const{row:e,colFrom:i,colTo:s}of this.spans)for(let o=i;o<=s;o++){const n=t.getWorldForColumn(o);yield new L(t.level,e,t.normalizeCol(o),n)}}forEach(t,e){const{spans:i,lodInfo:s}=this,{level:o}=s;if(i.length!==0)for(const{row:n,colFrom:r,colTo:l}of i)for(let a=r;a<=l;a++)t.call(e,o,n,s.normalizeCol(a),s.getWorldForColumn(a))}};q.pool=new lt(q);let E=class{constructor(t,e,i){this.row=t,this.colFrom=e,this.colTo=i}};const g=new L("0/0/0/0");let $t=class ot{static create(e,i){e[1]>i[1]&&([e,i]=[i,e]);const[s,o]=e,[n,r]=i,l=n-s,a=r-o,h=a!==0?l/a:0,c=(Math.ceil(o)-o)*h,f=(Math.floor(o)-o)*h;return new ot(s,Math.floor(o),Math.ceil(r),h,l<0?c:f,l<0?f:c,l<0?n:s,l<0?s:n)}constructor(e,i,s,o,n,r,l,a){this.x=e,this.ymin=i,this.ymax=s,this.invM=o,this.leftAdjust=n,this.rightAdjust=r,this.leftBound=l,this.rightBound=a}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 x=[[0,0],[0,0],[0,0],[0,0]],Jt=1e-6;let re=class{constructor(t,e=null,i=t.lods[0].level,s=t.lods[t.lods.length-1].level){this.tileInfo=t,this.fullExtent=e,this.scales=[],this._infoByScale={},this._infoByLevel={};const o=t.lods.filter(r=>r.level>=i&&r.level<=s);this.minScale=o[0].scale,this.maxScale=o[o.length-1].scale;const n=this._lodInfos=o.map(r=>Wt.create(t,r,e));o.forEach((r,l)=>{this._infoByLevel[r.level]=n[l],this._infoByScale[r.scale]=n[l],this.scales[l]=r.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,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileBounds(t,g,i):t}getTileCoords(t,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileCoords(t,g,i):t}getTileCoverage(t,e=192,i=!0,s="closest"){if(!i&&(t.scale>this.minScale||t.scale100)return null;let y=[];for(l=c;l=0;u--){const p=y[u];a=Math.min(a,p.getLeftCol()),h=Math.max(h,p.getRightCol())}if(a=Math.floor(a),h=Math.floor(h),l>=o.first[1]&&l<=o.last[1])if(r)if(o.size[0]o.last[0]||h=0;u--){const p=y[u];p.ymax>=l?p.incrRow():y.splice(u,1)}}return n}getTileParentId(t){g.set(t);const e=this._infoByLevel[g.level],i=this._lodInfos.indexOf(e)-1;return i<0?null:(this._getTileIdAtLOD(g,this._lodInfos[i],g),g.id)}getTileResolution(t){const e=this._infoByLevel[typeof t=="object"?t.level:t];return e?e.resolution:-1}getTileScale(t){const e=this._infoByLevel[t.level];return e?e.scale:-1}intersects(t,e){g.set(e);const i=this._infoByLevel[g.level],s=t.lodInfo;if(s.resolution>i.resolution){this._getTileIdAtLOD(g,s,g);const n=s.denormalizeCol(g.col,g.world);for(const r of t.spans)if(r.row===g.row&&r.colFrom<=n&&r.colTo>=n)return!0}if(s.resolution(d[0]=Math.min(d[0],y.row),d[1]=Math.max(d[1],y.row),d[2]=Math.min(d[2],y.colFrom),d[3]=Math.max(d[3],y.colTo),d),[1/0,-1/0,1/0,-1/0]),h=i.denormalizeCol(g.col,g.world),c=s.getColumnForX(i.getXForColumn(h)),f=s.getRowForY(i.getYForRow(g.row)),m=s.getColumnForX(i.getXForColumn(h+1))-1,_=s.getRowForY(i.getYForRow(g.row+1))-1;return!(c>a||mr||_n.row===g.row&&n.colFrom<=o&&n.colTo>=o)}normalizeBounds(t,e,i){if(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._wrap){const s=H(this.tileInfo.spatialReference),o=-i*(s.valid[1]-s.valid[0]);t[0]+=o,t[2]+=o}return t}getSmallestInfoForScale(t){const e=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>e[0])return this._infoByScale[e[0]];for(let i=1;ie[i]+Jt)return this._infoByScale[e[i-1]];return this._infoByScale[e[e.length-1]]}getClosestInfoForScale(t){const e=this.scales;return this._infoByScale[t]||(t=e.reduce((i,s)=>Math.abs(s-t)=0;i--)if(t{const r=this._keyToItem.get(o);return e(r,{signal:n})},peeker:o=>this._peek(o)})}destroy(){this.clear(),this._queue=ct(this._queue)}get length(){return this._queue?this._queue.length:0}abort(t){const e=typeof t=="string"?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this._tilesByScale.clear()}has(t){return typeof t=="string"?this._keyToItem.has(t):this._keyToItem.has(t.id)}pause(){this._queue.pause()}push(t){const e=t.key.id;if(this._queue.has(e))return this._queue.get(e);const i=this._queue.push(e),s=this.tileInfoView.getTileScale(t.key),o=ut(this._tilesByScale,s,()=>new Set),n=()=>{o.delete(t.key),o.size===0&&this._tilesByScale.delete(s),this._keyToItem.delete(e)};return o.add(t.key),this._keyToItem.set(e,t),i.then(n,n),i}reset(){this._queue.reset()}resume(){this._queue.resume()}_peek(t){if(!this.state)return t.values().next().value;const e=new Set;for(const n of t)e.add(this._keyToItem.get(n).key);const i=this.state.scale;let s,o=Number.POSITIVE_INFINITY;for(const[n,r]of this._tilesByScale)if(ft(r,l=>e.has(l))){const l=Math.abs(n-i);lthis.maxSize&&n>=0;)n!==e&&(o=this._pruneAroundCenterTile(o,i,s,n)),n--;o>this.maxSize&&(o=this._pruneAroundCenterTile(o,i,s,e))}_pruneAroundCenterTile(e,i,s,o){const n=this._tileKeysPerLevel[o];if(!n||n.length===0)return e;const{size:r,origin:l}=this._tileInfoView.tileInfo,a=s*r[0],h=s*r[1],c=[0,0],f=[0,0];for(n.sort((m,_)=>(c[0]=l.x+a*(m.col+.5),c[1]=l.y-h*(m.row+.5),f[0]=l.x+a*(_.col+.5),f[1]=l.y-h*(_.row+.5),$(c,i)-$(f,i)));n.length>0;){const m=n.pop();if(this._removeTile(m.id),--e===this.maxSize)break}return e}_removeTile(e){const i=this._tilePerId.get(e);this._removedFunc&&i&&this._removedFunc(i),Z(this._tilePerId,e)}}function Z(t,e){t.delete(e)}const C=new L(0,0,0,0),I=new Map,P=[],j=[];let ae=class{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,t.resampling!=null&&(this.resampling=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 Zt(t.cacheSize,this.tileInfoView,e=>{this.releaseTile(e)}))}destroy(){this.tileIndex.clear()}update(t){const{resampling:e,tileIndex:i}=this,{scale:s,center:o,resolution:n}=t.state,{minScale:r,maxScale:l}=this.tileInfoView,a=!t.stationary&&s>this._previousScale;if(this._previousScale=s,!e&&(s>r||su.visible=!0);let _=0,d=0;if(c.length>0)for(const{row:u,colFrom:p,colTo:A}of c)for(let B=p;B<=A;B++){_++;const M=C.set(m,u,f.normalizeCol(B),f.getWorldForColumn(B)).id;let w=i.get(M);if(w)w.isReady?(I.set(M,w),d++):a||this._addParentTile(M,I);else{if(this._tileCache?.has(M)){if(w=this._tileCache.pop(M),this.tileIndex.set(M,w),w.isReady){I.set(M,w),d++;continue}}else w=this.acquireTile(C),this.tileIndex.set(M,w);a||this._addParentTile(M,I)}}const y=d===_;for(const[u,p]of i){if(I.has(u))continue;C.set(u);const A=this.tileInfoView.intersects(h,C),B=this.cachePolicy==="purge"?C.level!==m:C.level>m;!A||!a&&y?!B&&A||P.push(p):p.isReady?B&&this.cachePolicy==="purge"&&this._hasReadyAncestor(C,m)?P.push(p):j.push(p):B&&P.push(p)}for(const u of j)u.isReady&&I.set(u.key.id,u);for(const u of P)this._tileCache?this._tileCache.add(u):this.releaseTile(u),i.delete(u.key.id);for(const u of I.values())this.tiles.push(u);for(const u of i.values())I.has(u.key.id)||(u.visible=!1);this._tileCache?.prune(m,o,n),q.pool.release(h),j.length=0,P.length=0,I.clear()}clear(){const{tileIndex:t}=this;for(const e of t.values())this.releaseTile(e);t.clear()}refresh(t){for(const e of this.tileIndex.values())t(e);this._tileCache?.clear()}updateCacheSize(t){this._tileCache&&(this._tileCache.maxSize=t)}_addParentTile(t,e){let i=t,s=null;for(;i=this.tileInfoView.getTileParentId(i),i;)if(this.tileIndex.has(i)){if(s=this.tileIndex.get(i),s?.isReady){e.has(s.key.id)||e.set(s.key.id,s);break}}else if(this._tileCache?.has(i)&&(s=this._tileCache.pop(i),this.tileIndex.set(i,s),s?.isReady)){e.has(s.key.id)||e.set(s.key.id,s);break}}_hasReadyAncestor(t,e){const i=D();this.tileInfoView.getTileBounds(i,t,!0);for(const s of this.tileIndex.values())if(s.isReady&&s.key.level>=e&&s.key.level=t.minX&&e.maxY>=t.minY}function X(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function U(t,e,i,s,o){for(var n,r=[e,i];r.length;)(i=r.pop())-(e=r.pop())<=s||(n=e+Math.ceil((i-e)/s/2)*s,yt(t,n,e,i,o),r.push(e,n,n,i))}W.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!V(t,e))return i;for(var o,n,r,l,a=[];e;){for(o=0,n=e.children.length;o=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)},_split:function(t,e){var i=t[e],s=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,s);var n=this._chooseSplitIndex(i,o,s),r=X(i.children.splice(n,i.children.length-n));r.height=i.height,r.leaf=i.leaf,Y(i,this.toBBox),Y(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(i,r)},_splitRoot:function(t,e){this.data=X([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Y(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,o,n,r,l,a,h,c;for(a=h=1/0,s=e;s<=i-e;s++)r=Ut(o=k(t,0,s,this.toBBox),n=k(t,s,i,this.toBBox)),l=N(o)+N(n),r=e;o--)n=t.children[o],R(a,t.leaf?r(n):n),h+=O(a);return h},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)R(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)t[i].children.length===0?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():Y(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.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]+"};")}};class nt{constructor(e,i){this.key=new L(0,0,0,0),this.bounds=D(),this.objectIds=new Set,this.key.set(i);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.level=s.level,this.scale=s.scale,this.minScale=e.zoomToScale(s.level-1),this.maxScale=e.zoomToScale(s.level+1)}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return mt.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(e){return{$view:{scale:this.scale,timeZone:e}}}createChildTiles(){const e=this.key.getChildKeys(),i=dt.acquire();for(let s=0;s=i&&(e.col=s-i,e.world+=1)}denormalizeCol(e,i){return this.wrap?this.worldSize[0]*i+e:e}getWorldForColumn(e){return this.wrap?Math.floor(e/this.worldSize[0]):0}getFirstColumnForWorld(e){return e*this.worldSize[0]+this.first[0]}getLastColumnForWorld(e){return e*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(e){return(e-this.origin[0])/this.norm[0]}getXForColumn(e){const i=this.origin[0]+e*this.norm[0],s=this._spatialReferenceOrigin,o=this._spatialReferenceValid;return this.wrap&&s&&o?i===s[0]?o[0]:this.origin[0]===s[0]&&e===this.worldSize[0]?o[1]:i:i}getRowForY(e){return(this.origin[1]-e)/this.norm[1]}getYForRow(e){return this.origin[1]-e*this.norm[1]}getTileBounds(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world),n=v.row;return Dt(e,this.getXForColumn(o),this.getYForRow(n+1),this.getXForColumn(o+1),this.getYForRow(n)),e}getTileCoords(e,i,s=!1){v.set(i);const o=s?v.col:this.denormalizeCol(v.col,v.world);return Array.isArray(e)?T(e,this.getXForColumn(o),this.getYForRow(v.row)):(e.x=this.getXForColumn(o),e.y=this.getYForRow(v.row)),e}},q=class{constructor(){this.spans=[]}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}*keys(){const t=this.lodInfo;for(const{row:e,colFrom:i,colTo:s}of this.spans)for(let o=i;o<=s;o++){const n=t.getWorldForColumn(o);yield new L(t.level,e,t.normalizeCol(o),n)}}forEach(t,e){const{spans:i,lodInfo:s}=this,{level:o}=s;if(i.length!==0)for(const{row:n,colFrom:r,colTo:l}of i)for(let a=r;a<=l;a++)t.call(e,o,n,s.normalizeCol(a),s.getWorldForColumn(a))}};q.pool=new lt(q);let E=class{constructor(t,e,i){this.row=t,this.colFrom=e,this.colTo=i}};const g=new L("0/0/0/0");let $t=class ot{static create(e,i){e[1]>i[1]&&([e,i]=[i,e]);const[s,o]=e,[n,r]=i,l=n-s,a=r-o,h=a!==0?l/a:0,c=(Math.ceil(o)-o)*h,f=(Math.floor(o)-o)*h;return new ot(s,Math.floor(o),Math.ceil(r),h,l<0?c:f,l<0?f:c,l<0?n:s,l<0?s:n)}constructor(e,i,s,o,n,r,l,a){this.x=e,this.ymin=i,this.ymax=s,this.invM=o,this.leftAdjust=n,this.rightAdjust=r,this.leftBound=l,this.rightBound=a}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 x=[[0,0],[0,0],[0,0],[0,0]],Jt=1e-6;let re=class{constructor(t,e=null,i=t.lods[0].level,s=t.lods[t.lods.length-1].level){this.tileInfo=t,this.fullExtent=e,this.scales=[],this._infoByScale={},this._infoByLevel={};const o=t.lods.filter(r=>r.level>=i&&r.level<=s);this.minScale=o[0].scale,this.maxScale=o[o.length-1].scale;const n=this._lodInfos=o.map(r=>Wt.create(t,r,e));o.forEach((r,l)=>{this._infoByLevel[r.level]=n[l],this._infoByScale[r.scale]=n[l],this.scales[l]=r.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,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileBounds(t,g,i):t}getTileCoords(t,e,i=!1){g.set(e);const s=this._infoByLevel[g.level];return s?s.getTileCoords(t,g,i):t}getTileCoverage(t,e=192,i=!0,s="closest"){if(!i&&(t.scale>this.minScale||t.scale100)return null;let y=[];for(l=c;l=0;u--){const p=y[u];a=Math.min(a,p.getLeftCol()),h=Math.max(h,p.getRightCol())}if(a=Math.floor(a),h=Math.floor(h),l>=o.first[1]&&l<=o.last[1])if(r)if(o.size[0]o.last[0]||h=0;u--){const p=y[u];p.ymax>=l?p.incrRow():y.splice(u,1)}}return n}getTileParentId(t){g.set(t);const e=this._infoByLevel[g.level],i=this._lodInfos.indexOf(e)-1;return i<0?null:(this._getTileIdAtLOD(g,this._lodInfos[i],g),g.id)}getTileResolution(t){const e=this._infoByLevel[typeof t=="object"?t.level:t];return e?e.resolution:-1}getTileScale(t){const e=this._infoByLevel[t.level];return e?e.scale:-1}intersects(t,e){g.set(e);const i=this._infoByLevel[g.level],s=t.lodInfo;if(s.resolution>i.resolution){this._getTileIdAtLOD(g,s,g);const n=s.denormalizeCol(g.col,g.world);for(const r of t.spans)if(r.row===g.row&&r.colFrom<=n&&r.colTo>=n)return!0}if(s.resolution(d[0]=Math.min(d[0],y.row),d[1]=Math.max(d[1],y.row),d[2]=Math.min(d[2],y.colFrom),d[3]=Math.max(d[3],y.colTo),d),[1/0,-1/0,1/0,-1/0]),h=i.denormalizeCol(g.col,g.world),c=s.getColumnForX(i.getXForColumn(h)),f=s.getRowForY(i.getYForRow(g.row)),m=s.getColumnForX(i.getXForColumn(h+1))-1,_=s.getRowForY(i.getYForRow(g.row+1))-1;return!(c>a||mr||_n.row===g.row&&n.colFrom<=o&&n.colTo>=o)}normalizeBounds(t,e,i){if(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._wrap){const s=H(this.tileInfo.spatialReference),o=-i*(s.valid[1]-s.valid[0]);t[0]+=o,t[2]+=o}return t}getSmallestInfoForScale(t){const e=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>e[0])return this._infoByScale[e[0]];for(let i=1;ie[i]+Jt)return this._infoByScale[e[i-1]];return this._infoByScale[e[e.length-1]]}getClosestInfoForScale(t){const e=this.scales;return this._infoByScale[t]||(t=e.reduce((i,s)=>Math.abs(s-t)=0;i--)if(t{const r=this._keyToItem.get(o);return e(r,{signal:n})},peeker:o=>this._peek(o)})}destroy(){this.clear(),this._queue=ct(this._queue)}get length(){return this._queue?this._queue.length:0}abort(t){const e=typeof t=="string"?t:t.id;this._queue.abort(e)}clear(){this._queue.clear(),this._keyToItem.clear(),this._tilesByScale.clear()}has(t){return typeof t=="string"?this._keyToItem.has(t):this._keyToItem.has(t.id)}pause(){this._queue.pause()}push(t){const e=t.key.id;if(this._queue.has(e))return this._queue.get(e);const i=this._queue.push(e),s=this.tileInfoView.getTileScale(t.key),o=ut(this._tilesByScale,s,()=>new Set),n=()=>{o.delete(t.key),o.size===0&&this._tilesByScale.delete(s),this._keyToItem.delete(e)};return o.add(t.key),this._keyToItem.set(e,t),i.then(n,n),i}reset(){this._queue.reset()}resume(){this._queue.resume()}_peek(t){if(!this.state)return t.values().next().value;const e=new Set;for(const n of t)e.add(this._keyToItem.get(n).key);const i=this.state.scale;let s,o=Number.POSITIVE_INFINITY;for(const[n,r]of this._tilesByScale)if(ft(r,l=>e.has(l))){const l=Math.abs(n-i);lthis.maxSize&&n>=0;)n!==e&&(o=this._pruneAroundCenterTile(o,i,s,n)),n--;o>this.maxSize&&(o=this._pruneAroundCenterTile(o,i,s,e))}_pruneAroundCenterTile(e,i,s,o){const n=this._tileKeysPerLevel[o];if(!n||n.length===0)return e;const{size:r,origin:l}=this._tileInfoView.tileInfo,a=s*r[0],h=s*r[1],c=[0,0],f=[0,0];for(n.sort((m,_)=>(c[0]=l.x+a*(m.col+.5),c[1]=l.y-h*(m.row+.5),f[0]=l.x+a*(_.col+.5),f[1]=l.y-h*(_.row+.5),$(c,i)-$(f,i)));n.length>0;){const m=n.pop();if(this._removeTile(m.id),--e===this.maxSize)break}return e}_removeTile(e){const i=this._tilePerId.get(e);this._removedFunc&&i&&this._removedFunc(i),Z(this._tilePerId,e)}}function Z(t,e){t.delete(e)}const C=new L(0,0,0,0),I=new Map,P=[],j=[];let ae=class{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,t.resampling!=null&&(this.resampling=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 Zt(t.cacheSize,this.tileInfoView,e=>{this.releaseTile(e)}))}destroy(){this.tileIndex.clear()}update(t){const{resampling:e,tileIndex:i}=this,{scale:s,center:o,resolution:n}=t.state,{minScale:r,maxScale:l}=this.tileInfoView,a=!t.stationary&&s>this._previousScale;if(this._previousScale=s,!e&&(s>r||su.visible=!0);let _=0,d=0;if(c.length>0)for(const{row:u,colFrom:p,colTo:A}of c)for(let B=p;B<=A;B++){_++;const M=C.set(m,u,f.normalizeCol(B),f.getWorldForColumn(B)).id;let w=i.get(M);if(w)w.isReady?(I.set(M,w),d++):a||this._addParentTile(M,I);else{if(this._tileCache?.has(M)){if(w=this._tileCache.pop(M),this.tileIndex.set(M,w),w.isReady){I.set(M,w),d++;continue}}else w=this.acquireTile(C),this.tileIndex.set(M,w);a||this._addParentTile(M,I)}}const y=d===_;for(const[u,p]of i){if(I.has(u))continue;C.set(u);const A=this.tileInfoView.intersects(h,C),B=this.cachePolicy==="purge"?C.level!==m:C.level>m;!A||!a&&y?!B&&A||P.push(p):p.isReady?B&&this.cachePolicy==="purge"&&this._hasReadyAncestor(C,m)?P.push(p):j.push(p):B&&P.push(p)}for(const u of j)u.isReady&&I.set(u.key.id,u);for(const u of P)this._tileCache?this._tileCache.add(u):this.releaseTile(u),i.delete(u.key.id);for(const u of I.values())this.tiles.push(u);for(const u of i.values())I.has(u.key.id)||(u.visible=!1);this._tileCache?.prune(m,o,n),q.pool.release(h),j.length=0,P.length=0,I.clear()}clear(){const{tileIndex:t}=this;for(const e of t.values())this.releaseTile(e);t.clear()}refresh(t){for(const e of this.tileIndex.values())t(e);this._tileCache?.clear()}updateCacheSize(t){this._tileCache&&(this._tileCache.maxSize=t)}_addParentTile(t,e){let i=t,s=null;for(;i=this.tileInfoView.getTileParentId(i),i;)if(this.tileIndex.has(i)){if(s=this.tileIndex.get(i),s?.isReady){e.has(s.key.id)||e.set(s.key.id,s);break}}else if(this._tileCache?.has(i)&&(s=this._tileCache.pop(i),this.tileIndex.set(i,s),s?.isReady)){e.has(s.key.id)||e.set(s.key.id,s);break}}_hasReadyAncestor(t,e){const i=D();this.tileInfoView.getTileBounds(i,t,!0);for(const s of this.tileIndex.values())if(s.isReady&&s.key.level>=e&&s.key.level=t.minX&&e.maxY>=t.minY}function X(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function U(t,e,i,s,o){for(var n,r=[e,i];r.length;)(i=r.pop())-(e=r.pop())<=s||(n=e+Math.ceil((i-e)/s/2)*s,yt(t,n,e,i,o),r.push(e,n,n,i))}W.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],s=this.toBBox;if(!V(t,e))return i;for(var o,n,r,l,a=[];e;){for(o=0,n=e.children.length;o=0&&n[e].children.length>this._maxEntries;)this._split(n,e),e--;this._adjustParentBBoxes(o,n,e)},_split:function(t,e){var i=t[e],s=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,s);var n=this._chooseSplitIndex(i,o,s),r=X(i.children.splice(n,i.children.length-n));r.height=i.height,r.leaf=i.leaf,Y(i,this.toBBox),Y(r,this.toBBox),e?t[e-1].children.push(r):this._splitRoot(i,r)},_splitRoot:function(t,e){this.data=X([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Y(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var s,o,n,r,l,a,h,c;for(a=h=1/0,s=e;s<=i-e;s++)r=Ut(o=k(t,0,s,this.toBBox),n=k(t,s,i,this.toBBox)),l=N(o)+N(n),r=e;o--)n=t.children[o],R(a,t.leaf?r(n):n),h+=O(a);return h},_adjustParentBBoxes:function(t,e,i){for(var s=i;s>=0;s--)R(e[s],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)t[i].children.length===0?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():Y(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.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]+"};")}};class nt{constructor(e,i){this.key=new L(0,0,0,0),this.bounds=D(),this.objectIds=new Set,this.key.set(i);const s=e.getLODInfoAt(this.key);this.tileInfoView=e,this.tileInfoView.getTileBounds(this.bounds,this.key,!0),this.resolution=s.resolution,this.level=s.level,this.scale=s.scale,this.minScale=e.zoomToScale(s.level-1),this.maxScale=e.zoomToScale(s.level+1)}get lod(){return this.tileInfoView.getLODInfoAt(this.key)}get id(){return this.key.id}get extent(){return mt.fromBounds(this.bounds,this.tileInfoView.tileInfo.spatialReference)}get transform(){return{originPosition:"upperLeft",scale:[this.resolution,this.resolution],translate:[this.bounds[0],this.bounds[3]]}}createArcadeEvaluationOptions(e){return{$view:{scale:this.scale,timeZone:e}}}createChildTiles(){const e=this.key.getChildKeys(),i=dt.acquire();for(let s=0;st.key.level-e.key.level!=0?t.key.level-e.key.level:t.key.row-e.key.row!=0?t.key.row-e.key.row:t.key.col-e.key.col;class p extends l{constructor(e){super(),this.tileInfoView=e,this.sortFunction=c}renderChildren(e){this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:r}=e,s=super.createRenderParams(e);return s.requiredLevel=this.tileInfoView.getClosestInfoForScale(r.scale).level,s.displayLevel=this.tileInfoView.tileInfo.scaleToZoom(r.scale),s}prepareRenderPasses(e){const r=super.prepareRenderPasses(e);return r.push(e.registerRenderPass({name:"stencil",brushes:[a],drawPhase:n.DEBUG|n.MAP|n.HIGHLIGHT|n.LABEL,target:()=>this.getStencilTarget()})),i("esri-tiles-debug")&&r.push(e.registerRenderPass({name:"tileInfo",brushes:[o],drawPhase:n.DEBUG,target:()=>this.children})),r}getStencilTarget(){return this.children}setStencilReference(e){let r=1;for(const s of this.children)s.stencilRef=r++}}export{p as h}; +import{K as i}from"./story-Doly9N9p.js";import{E as n}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{N as l,Z as a,r as o}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";const c=(t,e)=>t.key.level-e.key.level!=0?t.key.level-e.key.level:t.key.row-e.key.row!=0?t.key.row-e.key.row:t.key.col-e.key.col;class p extends l{constructor(e){super(),this.tileInfoView=e,this.sortFunction=c}renderChildren(e){this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:r}=e,s=super.createRenderParams(e);return s.requiredLevel=this.tileInfoView.getClosestInfoForScale(r.scale).level,s.displayLevel=this.tileInfoView.tileInfo.scaleToZoom(r.scale),s}prepareRenderPasses(e){const r=super.prepareRenderPasses(e);return r.push(e.registerRenderPass({name:"stencil",brushes:[a],drawPhase:n.DEBUG|n.MAP|n.HIGHLIGHT|n.LABEL,target:()=>this.getStencilTarget()})),i("esri-tiles-debug")&&r.push(e.registerRenderPass({name:"tileInfo",brushes:[o],drawPhase:n.DEBUG,target:()=>this.children})),r}getStencilTarget(){return this.children}setStencilReference(e){let r=1;for(const s of this.children)s.stencilRef=r++}}export{p as h}; diff --git a/custom-toc-highlight/assets/TileInfo-CWIRDhZl-BkCC-9e9.js b/custom-toc-highlight/assets/TileInfo-CWIRDhZl-RqA7tkOZ.js similarity index 99% rename from custom-toc-highlight/assets/TileInfo-CWIRDhZl-BkCC-9e9.js rename to custom-toc-highlight/assets/TileInfo-CWIRDhZl-RqA7tkOZ.js index 622247a8..f47a1c5e 100644 --- a/custom-toc-highlight/assets/TileInfo-CWIRDhZl-BkCC-9e9.js +++ b/custom-toc-highlight/assets/TileInfo-CWIRDhZl-RqA7tkOZ.js @@ -1 +1 @@ -import{v as r,S as a,aK as S,a0 as R,ac as G,e as N,bB as O,i as L,J as T,aY as I,w as y,aG as _,p as P,cZ as W,aC as F,b8 as A,bh as j}from"./story-BfX8CRfG.js";import{e as D}from"./TileKey-B_6qmYK--BtZdR-Xy.js";var b;let f=b=class extends N{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 b({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"cols",void 0),r([a({type:O,json:{write:!0}})],f.prototype,"level",void 0),r([a({type:String,json:{write:!0}})],f.prototype,"levelValue",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"origin",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"resolution",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"rows",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"scale",void 0),f=b=r([L("esri.layers.support.LOD")],f);const v=f;var d;const E=new S({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 n=d=class extends N{static create(e={}){const{resolutionFactor:t=1,scales:s,size:i=256,spatialReference:o=T.WebMercator,numLODs:l=24}=e;if(!I(o)){const c=[];if(s)for(let u=0;u=0;h--)c.unshift(new v({level:h,scale:u,resolution:u})),u*=2}return new d({dpi:96,lods:c,origin:new y(0,0,o),size:[i,i],spatialReference:o})}const p=_(o),g=e.origin?new y({x:e.origin.x,y:e.origin.y,spatialReference:o}):new y(p?{x:p.origin[0],y:p.origin[1],spatialReference:o}:{x:0,y:0,spatialReference:o}),m=96,w=1/(P(o)*39.37*m),x=[];if(s)for(let c=0;c{i.push(l.scale),t=l.scale>t?l.scale:t,s=l.scale=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;ie&&l=0?this.lods[l]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};s.push(new v({level:o,scale:p,resolution:g}))}return new d({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;sArray.isArray(e)?e:typeof e=="number"?[e,e]:[256,256]})],n.prototype,"size",void 0),r([R("size",["rows","cols"])],n.prototype,"readSize",null),r([G("size",{cols:{type:O},rows:{type:O}})],n.prototype,"writeSize",null),r([a({type:T,json:{write:!0}})],n.prototype,"spatialReference",void 0),n=d=r([L("esri.layers.support.TileInfo")],n),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(n||(n={}));const J=n;export{J as V,v as d}; +import{v as r,S as a,aK as S,a0 as R,ac as G,e as N,bB as O,i as L,J as T,aY as I,w as y,aG as _,p as P,cZ as W,aC as F,b8 as A,bh as j}from"./story-Doly9N9p.js";import{e as D}from"./TileKey-B_6qmYK--BtZdR-Xy.js";var b;let f=b=class extends N{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 b({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"cols",void 0),r([a({type:O,json:{write:!0}})],f.prototype,"level",void 0),r([a({type:String,json:{write:!0}})],f.prototype,"levelValue",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"origin",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"resolution",void 0),r([a({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],f.prototype,"rows",void 0),r([a({type:Number,json:{write:!0}})],f.prototype,"scale",void 0),f=b=r([L("esri.layers.support.LOD")],f);const v=f;var d;const E=new S({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 n=d=class extends N{static create(e={}){const{resolutionFactor:t=1,scales:s,size:i=256,spatialReference:o=T.WebMercator,numLODs:l=24}=e;if(!I(o)){const c=[];if(s)for(let u=0;u=0;h--)c.unshift(new v({level:h,scale:u,resolution:u})),u*=2}return new d({dpi:96,lods:c,origin:new y(0,0,o),size:[i,i],spatialReference:o})}const p=_(o),g=e.origin?new y({x:e.origin.x,y:e.origin.y,spatialReference:o}):new y(p?{x:p.origin[0],y:p.origin[1],spatialReference:o}:{x:0,y:0,spatialReference:o}),m=96,w=1/(P(o)*39.37*m),x=[];if(s)for(let c=0;c{i.push(l.scale),t=l.scale>t?l.scale:t,s=l.scale=t.length-1)return t[t.length-1];const s=Math.floor(e),i=s+1;return t[s]/(t[s]/t[i])**(e-s)}scaleToZoom(e){const t=this.scales,s=t.length-1;let i=0;for(;ie&&l=0?this.lods[l]:{scale:2*this.lods[0].scale,resolution:2*this.lods[0].resolution};s.push(new v({level:o,scale:p,resolution:g}))}return new d({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:s})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let s=0;sArray.isArray(e)?e:typeof e=="number"?[e,e]:[256,256]})],n.prototype,"size",void 0),r([R("size",["rows","cols"])],n.prototype,"readSize",null),r([G("size",{cols:{type:O},rows:{type:O}})],n.prototype,"writeSize",null),r([a({type:T,json:{write:!0}})],n.prototype,"spatialReference",void 0),n=d=r([L("esri.layers.support.TileInfo")],n),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(n||(n={}));const J=n;export{J as V,v as d}; diff --git a/custom-toc-highlight/assets/TileInfoTilemapCache-D1SExPij-BhR83GZf.js b/custom-toc-highlight/assets/TileInfoTilemapCache-D1SExPij-BDoYZo_V.js similarity index 94% rename from custom-toc-highlight/assets/TileInfoTilemapCache-D1SExPij-BhR83GZf.js rename to custom-toc-highlight/assets/TileInfoTilemapCache-D1SExPij-BDoYZo_V.js index 6208cf66..7a0315a3 100644 --- a/custom-toc-highlight/assets/TileInfoTilemapCache-D1SExPij-BhR83GZf.js +++ b/custom-toc-highlight/assets/TileInfoTilemapCache-D1SExPij-BDoYZo_V.js @@ -1 +1 @@ -import{c_ as n,o as h,aU as r}from"./story-BfX8CRfG.js";class f{constructor(i,e=0,t=i.lods[i.lods.length-1].level){this.tileInfo=i,this.minLOD=e,this.maxLOD=t,i.lodAt(e)||(this.minLOD=i.lods[0].level),i.lodAt(t)||(this.maxLOD=i.lods[i.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(i,e,t){const l=this.tileInfo?.lodAt(i);return!l||ithis.maxLOD?"unavailable":l.cols&&l.rows?t>=l.cols[0]&&t<=l.cols[1]&&e>=l.rows[0]&&e<=l.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(i,e,t,l){await n(l);const a=this.getAvailability(i,e,t);if(a==="unavailable")throw new h("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:t});return a}async fetchAvailabilityUpsample(i,e,t,l,a){await n(a),l.level=i,l.row=e,l.col=t;const s=this.tileInfo;return s.updateTileInfo(l),this.fetchAvailability(i,e,t,a).catch(o=>{if(r(o))throw o;if(s.upsampleTile(l))return this.fetchAvailabilityUpsample(l.level,l.row,l.col,l,a);throw o})}}export{f as c}; +import{c_ as n,o as h,aU as r}from"./story-Doly9N9p.js";class f{constructor(i,e=0,t=i.lods[i.lods.length-1].level){this.tileInfo=i,this.minLOD=e,this.maxLOD=t,i.lodAt(e)||(this.minLOD=i.lods[0].level),i.lodAt(t)||(this.maxLOD=i.lods[i.lods.length-1].level)}get effectiveMinLOD(){return this.minLOD??this.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}getAvailability(i,e,t){const l=this.tileInfo?.lodAt(i);return!l||ithis.maxLOD?"unavailable":l.cols&&l.rows?t>=l.cols[0]&&t<=l.cols[1]&&e>=l.rows[0]&&e<=l.rows[1]?"unknown":"unavailable":"unknown"}async fetchAvailability(i,e,t,l){await n(l);const a=this.getAvailability(i,e,t);if(a==="unavailable")throw new h("tile-map:tile-unavailable","Tile is not available",{level:i,row:e,col:t});return a}async fetchAvailabilityUpsample(i,e,t,l,a){await n(a),l.level=i,l.row=e,l.col=t;const s=this.tileInfo;return s.updateTileInfo(l),this.fetchAvailability(i,e,t,a).catch(o=>{if(r(o))throw o;if(s.upsampleTile(l))return this.fetchAvailabilityUpsample(l.level,l.row,l.col,l,a);throw o})}}export{f as c}; diff --git a/custom-toc-highlight/assets/TileKey-C5IL-JBr-CJMvJ-lJ.js b/custom-toc-highlight/assets/TileKey-C5IL-JBr-BGwa3-Dg.js similarity index 96% rename from custom-toc-highlight/assets/TileKey-C5IL-JBr-CJMvJ-lJ.js rename to custom-toc-highlight/assets/TileKey-C5IL-JBr-BGwa3-Dg.js index 71e7ae3d..f37434d6 100644 --- a/custom-toc-highlight/assets/TileKey-C5IL-JBr-CJMvJ-lJ.js +++ b/custom-toc-highlight/assets/TileKey-C5IL-JBr-BGwa3-Dg.js @@ -1 +1 @@ -import{dB as c}from"./story-BfX8CRfG.js";let r=class s{static getId(e,l,t,o){return typeof e=="object"?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${l}/${t}/${o}`}constructor(e,l,t,o){this.set(e,l,t,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,l=4095&this.col,t=63&this.level;return(3&this.world)<<30|l<<22|e<<8|t}acquire(e,l,t,o){this.set(e,l,t,o)}contains(e){const l=e.level-this.level;return l>=0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}containsChild(e){const l=e.level-this.level;return l>0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new s(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,l,t,o){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e=="object")this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e=="string"){const[i,h,w,n]=e.split("/");this.level=parseFloat(i),this.row=parseFloat(h),this.col=parseFloat(w),this.world=parseFloat(n)}else this.level=+e,this.row=+l,this.col=+t,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new s(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(e,l,t){const o=this.clone();return o.col+=e,o.row+=l,t.normalizeKey(o),o}getChildKeys(){const e=this.level+1,l=this.row<<1,t=this.col<<1,o=this.world;return[new s(e,l,t,o),new s(e,l,t+1,o),new s(e,l+1,t,o),new s(e,l+1,t+1,o)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};r.pool=new c(r,null,null,25,50);export{r as s}; +import{dB as c}from"./story-Doly9N9p.js";let r=class s{static getId(e,l,t,o){return typeof e=="object"?`${e.level}/${e.row}/${e.col}/${e.world}`:`${e}/${l}/${t}/${o}`}constructor(e,l,t,o){this.set(e,l,t,o)}get key(){return this}get id(){return this.toString()}get normalizedId(){return`${this.level}/${this.row}/${this.col}`}set id(e){this.set(e)}get hash(){const e=4095&this.row,l=4095&this.col,t=63&this.level;return(3&this.world)<<30|l<<22|e<<8|t}acquire(e,l,t,o){this.set(e,l,t,o)}contains(e){const l=e.level-this.level;return l>=0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}containsChild(e){const l=e.level-this.level;return l>0&&this.row===e.row>>l&&this.col===e.col>>l&&this.world===e.world}equals(e){return this.level===e.level&&this.row===e.row&&this.col===e.col&&this.world===e.world}clone(){return new s(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(e,l,t,o){if(e==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof e=="object")this.level=e.level||0,this.row=e.row||0,this.col=e.col||0,this.world=e.world||0;else if(typeof e=="string"){const[i,h,w,n]=e.split("/");this.level=parseFloat(i),this.row=parseFloat(h),this.col=parseFloat(w),this.world=parseFloat(n)}else this.level=+e,this.row=+l,this.col=+t,this.world=+o||0;return this}toString(){return`${this.level}/${this.row}/${this.col}/${this.world}`}getParentKey(){return this.level<=0?null:new s(this.level-1,this.row>>1,this.col>>1,this.world)}getNormalizedNeighbor(e,l,t){const o=this.clone();return o.col+=e,o.row+=l,t.normalizeKey(o),o}getChildKeys(){const e=this.level+1,l=this.row<<1,t=this.col<<1,o=this.world;return[new s(e,l,t,o),new s(e,l,t+1,o),new s(e,l+1,t,o),new s(e,l+1,t+1,o)]}compareRowMajor(e){return this.rowe.row?1:this.cole.col?1:0}};r.pool=new c(r,null,null,25,50);export{r as s}; diff --git a/custom-toc-highlight/assets/TileLayer-Be5tWeN5-CZVaOU3u.js b/custom-toc-highlight/assets/TileLayer-Be5tWeN5-CUL4Ato2.js similarity index 60% rename from custom-toc-highlight/assets/TileLayer-Be5tWeN5-CZVaOU3u.js rename to custom-toc-highlight/assets/TileLayer-Be5tWeN5-CUL4Ato2.js index 9be8c23f..bb60a0d4 100644 --- a/custom-toc-highlight/assets/TileLayer-Be5tWeN5-CZVaOU3u.js +++ b/custom-toc-highlight/assets/TileLayer-Be5tWeN5-CUL4Ato2.js @@ -1 +1 @@ -import{W as _,J as v,a as S,f as c,X as T,o as u,Y as b,v as s,S as a,a0 as w,ac as O,ad as R,i as U}from"./story-BfX8CRfG.js";import{y as W}from"./loadAll-e978YItg-CdtGGDtb.js";import{m as $}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as L}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{n as M}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{O as P}from"./ArcGISCachedService-C64Ko1TY-9EmQxNmS.js";import{k as A,M as j,A as k}from"./SublayersOwner-DfTaMJ5V-DMBhnxeT.js";import{a as C}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{u as D}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as B}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{E as N}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as I}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as J}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{i as G,L as E,b as K}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{Z as V}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{u as y}from"./imageBitmapUtils-DA36kg39-CZPhYtU7.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-BhR83GZf.js";import"./TilemapCache-CRRxws77-BBkZHUXn.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./QueryTask-CwHwH2rS-B8khefoW.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./executeForIds-Z1gkLduF-D8DZG8qZ.js";import"./query-DFW9-NG_-gbjlxRZk.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./executeQueryPBF-o8010HS9-BgTBXvCY.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./executeQueryJSON-CcHnccia-BW7_NQxl.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./FeatureType-C9hJmS6_-BXWT6QCe.js";import"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import"./Relationship-PyhUibYK-BgFx3_5x.js";import"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./sublayerUtils-CyM0QC5B-D9HVKWXR.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";var d;const f=["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 i=d=class extends D(q(A(P(j(N(I(C($(J(M(B(L)))))))))))){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=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(_).then(()=>this._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&v.fromJSON(e)}writeSublayers(e,r,t,o){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:n})=>n&&n.toArray().reverse()).toArray(),l=[],m={writeSublayerStructure:!1,...o};p.forEach(n=>{const h=n.write({},m);l.push(h)}),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=>S(r).path):null}fetchTile(e,r,t,o={}){const{signal:p}=o,l=this.getTileUrl(e,r,t),m={responseType:"image",signal:p,query:{...this.refreshParameters}};return c(l,m).then(n=>n.data)}async fetchImageBitmapTile(e,r,t,o={}){const{signal:p}=o;if(this.fetchTile!==d.prototype.fetchTile){const h=await this.fetchTile(e,r,t,o);return y(h,e,r,t,p)}const l=this.getTileUrl(e,r,t),m={responseType:"blob",signal:p,query:{...this.refreshParameters}},{data:n}=await c(l,m);return y(n,e,r,t,p)}getTileUrl(e,r,t){const o=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,p=T({...this.parsedUrl?.query,blankTile:!o&&null,...this.customParameters,token:this.apiKey}),l=this.tileServers;return`${l&&l.length?l[r%l.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${p?"?"+p:""}`}loadAll(){return W(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((r,t)=>{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 o=G(this.parsedUrl.path);if(o!=null&&o.serverType==="ImageServer")throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");c(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)}).then(r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!E(t))return this._fetchServerVersion(t,e).then(o=>{this.read({currentVersion:o})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!K(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return c(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(o=>{if(o.data&&o.data.currentVersion)return o.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]:void 0}_getDefaultAttribution(e){if(e==null)return null;let r;e=e.toLowerCase();for(let t=0,o=f.length;t({enabled:!1})}}})],i.prototype,"isReference",void 0),s([a({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),s([a({type:Boolean})],i.prototype,"resampling",void 0),s([a()],i.prototype,"sourceJSON",void 0),s([a({type:v})],i.prototype,"spatialReference",void 0),s([w("spatialReference",["spatialReference","tileInfo"])],i.prototype,"readSpatialReference",null),s([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),s([a({readOnly:!0})],i.prototype,"sublayers",void 0),s([O("sublayers",{layers:{type:[k]}})],i.prototype,"writeSublayers",null),s([a({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),s([a()],i.prototype,"tileServers",null),s([R("tileServers")],i.prototype,"castTileServers",null),s([a({readOnly:!0,json:{read:!1}})],i.prototype,"type",void 0),s([a(V)],i.prototype,"url",void 0),i=d=s([U("esri.layers.TileLayer")],i);const g=Symbol("default-fetch-tile");i.prototype.fetchTile[g]=!0;const Wr=i;export{Wr as default}; +import{W as _,J as v,a as S,f as c,X as T,o as u,Y as b,v as s,S as a,a0 as w,ac as O,ad as R,i as U}from"./story-Doly9N9p.js";import{y as W}from"./loadAll-e978YItg-4pMG3qU7.js";import{m as $}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as L}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{n as M}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{O as P}from"./ArcGISCachedService-C64Ko1TY-COmlLbBz.js";import{k as A,M as j,A as k}from"./SublayersOwner-DfTaMJ5V-DrC0bgDm.js";import{a as C}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{u as D}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as B}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{E as N}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as I}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as J}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{i as G,L as E,b as K}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{Z as V}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{u as y}from"./imageBitmapUtils-DA36kg39-BfNbbEDs.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./TileInfoTilemapCache-D1SExPij-BDoYZo_V.js";import"./TilemapCache-CRRxws77-CCC00Yar.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./QueryTask-CwHwH2rS-D4f5dsGo.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./executeForIds-Z1gkLduF-CrWEksFG.js";import"./query-DFW9-NG_-C3TyGmiM.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./executeQueryPBF-o8010HS9-B7Z-YQyg.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./executeQueryJSON-CcHnccia-M-vnTvKl.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./FeatureType-C9hJmS6_-CNlvn5D1.js";import"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./sublayerUtils-CyM0QC5B-B1ryunQi.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";var d;const f=["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 i=d=class extends D(q(A(P(j(N(I(C($(J(M(B(L)))))))))))){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=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(_).then(()=>this._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){const e=this.parsedUrl?.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo?.spatialReference)&&v.fromJSON(e)}writeSublayers(e,r,t,o){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:n})=>n&&n.toArray().reverse()).toArray(),l=[],m={writeSublayerStructure:!1,...o};p.forEach(n=>{const h=n.write({},m);l.push(h)}),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=>S(r).path):null}fetchTile(e,r,t,o={}){const{signal:p}=o,l=this.getTileUrl(e,r,t),m={responseType:"image",signal:p,query:{...this.refreshParameters}};return c(l,m).then(n=>n.data)}async fetchImageBitmapTile(e,r,t,o={}){const{signal:p}=o;if(this.fetchTile!==d.prototype.fetchTile){const h=await this.fetchTile(e,r,t,o);return y(h,e,r,t,p)}const l=this.getTileUrl(e,r,t),m={responseType:"blob",signal:p,query:{...this.refreshParameters}},{data:n}=await c(l,m);return y(n,e,r,t,p)}getTileUrl(e,r,t){const o=!this.capabilities.operations.supportsTileMap&&this.supportsBlankTile,p=T({...this.parsedUrl?.query,blankTile:!o&&null,...this.customParameters,token:this.apiKey}),l=this.tileServers;return`${l&&l.length?l[r%l.length]:this.parsedUrl?.path}/tile/${e}/${r}/${t}${p?"?"+p:""}`}loadAll(){return W(this,e=>{e(this.allSublayers)})}_fetchService(e){return new Promise((r,t)=>{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 o=G(this.parsedUrl.path);if(o!=null&&o.serverType==="ImageServer")throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");c(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,t)}).then(r=>{let t=this.url;if(r.ssl&&(t=this.url=t.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!E(t))return this._fetchServerVersion(t,e).then(o=>{this.read({currentVersion:o})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!K(e))return Promise.reject();const t=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return c(t,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(o=>{if(o.data&&o.data.currentVersion)return o.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]:void 0}_getDefaultAttribution(e){if(e==null)return null;let r;e=e.toLowerCase();for(let t=0,o=f.length;t({enabled:!1})}}})],i.prototype,"isReference",void 0),s([a({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),s([a({type:Boolean})],i.prototype,"resampling",void 0),s([a()],i.prototype,"sourceJSON",void 0),s([a({type:v})],i.prototype,"spatialReference",void 0),s([w("spatialReference",["spatialReference","tileInfo"])],i.prototype,"readSpatialReference",null),s([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),s([a({readOnly:!0})],i.prototype,"sublayers",void 0),s([O("sublayers",{layers:{type:[k]}})],i.prototype,"writeSublayers",null),s([a({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),s([a()],i.prototype,"tileServers",null),s([R("tileServers")],i.prototype,"castTileServers",null),s([a({readOnly:!0,json:{read:!1}})],i.prototype,"type",void 0),s([a(V)],i.prototype,"url",void 0),i=d=s([U("esri.layers.TileLayer")],i);const g=Symbol("default-fetch-tile");i.prototype.fetchTile[g]=!0;const Wr=i;export{Wr as default}; diff --git a/custom-toc-highlight/assets/TileLayerView2D-CT-Yu10P-BdNTZA0Y.js b/custom-toc-highlight/assets/TileLayerView2D-CT-Yu10P-B6hAJ5mA.js similarity index 54% rename from custom-toc-highlight/assets/TileLayerView2D-CT-Yu10P-BdNTZA0Y.js rename to custom-toc-highlight/assets/TileLayerView2D-CT-Yu10P-B6hAJ5mA.js index e09db663..698bf233 100644 --- a/custom-toc-highlight/assets/TileLayerView2D-CT-Yu10P-BdNTZA0Y.js +++ b/custom-toc-highlight/assets/TileLayerView2D-CT-Yu10P-B6hAJ5mA.js @@ -1 +1 @@ -import{a2 as w,aC as y,aU as l,a1 as I,v as m,S as g,i as V}from"./story-BfX8CRfG.js";import{o as H}from"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-nIA27cle.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import"./PieChartMeshWriter-C5yLDFwp-CqRHPq7x.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-DBs2wvPw.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-DMrrhOCh.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import{L as T,p as n,D as f}from"./imageUtils-Co-ELErj-Dh62T-vs.js";import{X as U,Y as q}from"./LayerView-Bish-E63-rB2WUWF4.js";import{l as C}from"./HighlightGraphicContainer-Dt5r6lMq-KuyTjNqc.js";import{Q,$ as S,a as b}from"./Tile-D75RMC64-Dj1SOP3K.js";import{s as d}from"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import{n as L}from"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";import{_ as P,O as F}from"./MapServiceLayerViewHelper-bw3M4B8s-2ec3v39J.js";import{x as k}from"./drapedUtils-BZ1SGPtE-B2FavufJ.js";import{i as z}from"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./main-ugzBrWNm.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./TurboLine-CIlsAy5m-Cxo-QeJ4.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";import"./Bitmap-CcqmzvfR-Bqft9oF3.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./AGraphicContainer-LUCT6Gle-Dvv0TF4N.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./languageUtils-BYxF9hRA-BBstOXAc.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-B8KlJvO_.js";import"./number-eRKYXfX9-eI8aiR_7.js";import"./scaleUtils-DxsfQwK1-D7ZZd5W4.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-D9HVKWXR.js";import"./popupUtils-nV1O8RUO-DAL58cHP.js";const A=[0,0];let h=class extends L(T(U(q))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new H,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume(),this._highlightView?.processUpdate(t)}attach(){const t="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new Q(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new S({tileInfoView:this._tileInfoView,concurrency:t&&10*t.length||10,process:(e,r)=>this.fetchTile(e,r),scheduler:this.scheduler,priority:z.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new b({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),P(this,this.layer)){const e=this._highlightView=new v({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new C(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new F({createFetchPopupFeaturesQueryGeometry:(r,p)=>k(r,p,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(r,p)=>{e.graphicUpdateHandler({graphic:r,property:p})},layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i):[]}highlight(t){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(t):w()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return y(this.layer.tileInfo?.spatialReference,t)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const i=this._bitmapView.createTile(t),e=i.bitmap;return[e.x,e.y]=this._tileInfoView.getTileCoords(A,i.key),e.resolution=this._tileInfoView.getTileResolution(i.key),[e.width,e.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,i={}){const e=this.tilemapCache,{signal:r,resamplingLevel:p=0}=i;if(!e)try{return await this._fetchImage(t,r)}catch(o){if(!l(o)&&!this.resampling)return n(this._tileInfoView.tileInfo.size);if(p<3){const u=this._tileInfoView.getTileParentId(t.id);if(u){const c=new d(u),_=await this.fetchTile(c,{...i,resamplingLevel:p+1});return f(this._tileInfoView,_,c,t)}}throw o}const s=new d(0,0,0,0);let a;try{if(await e.fetchAvailabilityUpsample(t.level,t.row,t.col,s,{signal:r}),!this.resampling&&s.level!==t.level)return n(this._tileInfoView.tileInfo.size);a=await this._fetchImage(s,r)}catch(o){if(l(o))throw o;return n(this._tileInfoView.tileInfo.size)}return this.resampling?f(this._tileInfoView,a,s,t):a}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const i=await this._fetchQueue.push(t.key);t.bitmap.source=i,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(i){l(i)||I.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(t,i){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:i})}};m([g()],h.prototype,"resampling",null),m([g()],h.prototype,"tilemapCache",null),h=m([V("esri.views.2d.layers.TileLayerView2D")],h);const pe=h;export{pe as default}; +import{a2 as w,aC as y,aU as l,a1 as I,v as m,S as g,i as V}from"./story-Doly9N9p.js";import{o as H}from"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GridShader-75bC4UUM-BeEFXp4m.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./PieChartMeshWriter-C5yLDFwp-5CAejpYY.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-BwcxFsN9.js";import{X as v}from"./GraphicsView2D-C4wYE2ut-DdVMjjMv.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import{L as T,p as n,D as f}from"./imageUtils-Co-ELErj-D3GFlUnZ.js";import{X as U,Y as q}from"./LayerView-Bish-E63-DK1SFHE3.js";import{l as C}from"./HighlightGraphicContainer-Dt5r6lMq-CwALk6za.js";import{Q,$ as S,a as b}from"./Tile-D75RMC64-g8Sx5TPr.js";import{s as d}from"./TileKey-C5IL-JBr-BGwa3-Dg.js";import{n as L}from"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";import{_ as P,O as F}from"./MapServiceLayerViewHelper-bw3M4B8s-UNSGy25k.js";import{x as k}from"./drapedUtils-BZ1SGPtE-bBUh2hex.js";import{i as z}from"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./main-QGPoLsvl.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./TurboLine-CIlsAy5m-C6Kc2De-.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";import"./Bitmap-CcqmzvfR-C22fE2NY.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./languageUtils-BYxF9hRA-DnySuvAL.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BBIRhcUQ.js";import"./number-eRKYXfX9-bCdnHRN-.js";import"./scaleUtils-DxsfQwK1-CzyfErWH.js";import"./floorFilterUtils-4r-vVdzs-C43jLoAE.js";import"./sublayerUtils-CyM0QC5B-B1ryunQi.js";import"./popupUtils-nV1O8RUO-BYG2KoFf.js";const A=[0,0];let h=class extends L(T(U(q))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new H,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume(),this._highlightView?.processUpdate(t)}attach(){const t="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new Q(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new S({tileInfoView:this._tileInfoView,concurrency:t&&10*t.length||10,process:(e,r)=>this.fetchTile(e,r),scheduler:this.scheduler,priority:z.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new b({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),P(this,this.layer)){const e=this._highlightView=new v({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new C(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new F({createFetchPopupFeaturesQueryGeometry:(r,p)=>k(r,p,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:(r,p)=>{e.graphicUpdateHandler({graphic:r,property:p})},layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(t,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(t,i):[]}highlight(t){return this._popupHighlightHelper?this._popupHighlightHelper.highlight(t):w()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return y(this.layer.tileInfo?.spatialReference,t)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const i=this._bitmapView.createTile(t),e=i.bitmap;return[e.x,e.y]=this._tileInfoView.getTileCoords(A,i.key),e.resolution=this._tileInfoView.getTileResolution(i.key),[e.width,e.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,i={}){const e=this.tilemapCache,{signal:r,resamplingLevel:p=0}=i;if(!e)try{return await this._fetchImage(t,r)}catch(o){if(!l(o)&&!this.resampling)return n(this._tileInfoView.tileInfo.size);if(p<3){const u=this._tileInfoView.getTileParentId(t.id);if(u){const c=new d(u),_=await this.fetchTile(c,{...i,resamplingLevel:p+1});return f(this._tileInfoView,_,c,t)}}throw o}const s=new d(0,0,0,0);let a;try{if(await e.fetchAvailabilityUpsample(t.level,t.row,t.col,s,{signal:r}),!this.resampling&&s.level!==t.level)return n(this._tileInfoView.tileInfo.size);a=await this._fetchImage(s,r)}catch(o){if(l(o))throw o;return n(this._tileInfoView.tileInfo.size)}return this.resampling?f(this._tileInfoView,a,s,t):a}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const i=await this._fetchQueue.push(t.key);t.bitmap.source=i,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(i){l(i)||I.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(t,i){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:i})}};m([g()],h.prototype,"resampling",null),m([g()],h.prototype,"tilemapCache",null),h=m([V("esri.views.2d.layers.TileLayerView2D")],h);const pe=h;export{pe as default}; diff --git a/custom-toc-highlight/assets/TilemapCache-CRRxws77-BBkZHUXn.js b/custom-toc-highlight/assets/TilemapCache-CRRxws77-CCC00Yar.js similarity index 98% rename from custom-toc-highlight/assets/TilemapCache-CRRxws77-BBkZHUXn.js rename to custom-toc-highlight/assets/TilemapCache-CRRxws77-CCC00Yar.js index 2a2d5c2d..c49c91e5 100644 --- a/custom-toc-highlight/assets/TilemapCache-CRRxws77-BBkZHUXn.js +++ b/custom-toc-highlight/assets/TilemapCache-CRRxws77-CCC00Yar.js @@ -1 +1 @@ -import{c$ as T,v as d,S as y,j as z,f as D,ah as S,aL as q,aU as _,d0 as L,x,o as u,E as P,X as I,i as M,P as U,d1 as C,a2 as j,aS as k,d2 as E}from"./story-BfX8CRfG.js";import{G as R}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{b as F}from"./LRUCache-C3erQTWv-0wD6drRf.js";import{e as H}from"./TileKey-B_6qmYK--BtZdR-Xy.js";function J(e,t=!1){return e<=E?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}class w{constructor(t){N(t);const{location:a,data:i}=t;this.location=Object.freeze(U(a));const l=this.location.width,n=this.location.height;let o=!0,r=!0;const c=Math.ceil(l*n/32),s=J(c);let h=0;for(let f=0;f>5,o=this._availability;return n<0||n>o.length?"unknown":o[n]&1<s.data).catch(s=>{if(s?.details?.httpStatus===422)return{location:{top:l,left:n,width:o,height:r},valid:!0,data:new Array(o*r).fill(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 u("tilemap:location-mismatch","Tilemap response for different location than requested",{response:s,definition:{top:l,left:n,width:o,height:r}});return w.fromJSON(s)})}static fromJSON(t){return Object.freeze(new w(t))}}function $(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function K(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const a=e.service.query;return a&&(t=`${t}?${a}`),t}function N(e){if(!e?.location)throw new u("tilemap:missing-location","Location missing from tilemap response");if(e.valid===!1)throw new u("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new u("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new u("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new u("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}var v;function A(e,t,a){return new u("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:a})}let p=v=class extends z{constructor(e){super(e),this._pendingTilemapRequests={},this.request=D,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new F(2*R.MEGABYTES),this.addHandles(S(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),q))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,a){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return"unavailable";const i=this._tilemapFromCache(e,t,a,this._tmpTilemapDefinition);return i?i.getAvailability(t,a):"unknown"}fetchAvailability(e,t,a,i){return!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD?Promise.reject(A(e,t,a)):this._fetchTilemap(e,t,a,i).catch(l=>l).then(l=>{if(l instanceof w){const n=l.getAvailability(t,a);if(n==="unavailable")throw A(e,t,a);return n}if(_(l))throw l;return"unknown"})}fetchAvailabilityUpsample(e,t,a,i,l){i.level=e,i.row=t,i.col=a;const n=this.layer.tileInfo;n.updateTileInfo(i);const o=this.fetchAvailability(e,t,a,l).catch(r=>{if(_(r))throw r;if(n.upsampleTile(i))return this.fetchAvailabilityUpsample(i.level,i.row,i.col,i,l);throw r});return this._fetchAvailabilityUpsamplePrefetch(i.id,e,t,a,l,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,a,i,l,n){if(!this._prefetchingEnabled||e==null)return;const o=`prefetch-${e}`;if(this.hasHandles(o))return;const r=new AbortController;n.then(()=>r.abort(),()=>r.abort());let c=!1;const s=j(()=>{c||(c=!0,r.abort())});if(this.addHandles(s,o),await L(10,r.signal).catch(()=>{}),c||(c=!0,this.removeHandles(o)),x(r))return;const h=new H(e,t,a,i),f={...l,signal:r.signal},m=this.layer.tileInfo;for(let O=0;v._prefetches.length{v._prefetches.removeUnordered(b)};b.then(g,g)}}_fetchTilemap(e,t,a,i){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return Promise.reject(new u("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,n=this._tilemapFromCache(e,t,a,l);if(n)return Promise.resolve(n);const o=i?.signal;return i={...i,signal:null},new Promise((r,c)=>{P(o,()=>c(k()));const s=$(l);let h=this._pendingTilemapRequests[s];if(!h){h=w.fromDefinition(l,i).then(m=>(this._tilemapCache.put(s,m,m.byteSize),m));const f=()=>{delete this._pendingTilemapRequests[s]};this._pendingTilemapRequests[s]=h,h.then(f,f)}h.then(r,c)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:a}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:I({...e.query,...a,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,a,i){i.level=e,i.row=t-t%this.size,i.col=a-a%this.size;const l=$(i);return this._tilemapCache.get(l)}get test(){}};p._maxPrefetch=4,p._prefetches=new T({initialSize:v._maxPrefetch}),d([y({constructOnly:!0})],p.prototype,"layer",void 0),d([y({constructOnly:!0})],p.prototype,"minLOD",void 0),d([y({constructOnly:!0})],p.prototype,"maxLOD",void 0),d([y({constructOnly:!0})],p.prototype,"request",void 0),d([y({constructOnly:!0})],p.prototype,"size",void 0),p=v=d([M("esri.layers.support.TilemapCache")],p);export{p as f}; +import{c$ as T,v as d,S as y,j as z,f as D,ah as S,aL as q,aU as _,d0 as L,x,o as u,E as P,X as I,i as M,P as U,d1 as C,a2 as j,aS as k,d2 as E}from"./story-Doly9N9p.js";import{G as R}from"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import{b as F}from"./LRUCache-C3erQTWv-grHgYSP-.js";import{e as H}from"./TileKey-B_6qmYK--BtZdR-Xy.js";function J(e,t=!1){return e<=E?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}class w{constructor(t){N(t);const{location:a,data:i}=t;this.location=Object.freeze(U(a));const l=this.location.width,n=this.location.height;let o=!0,r=!0;const c=Math.ceil(l*n/32),s=J(c);let h=0;for(let f=0;f>5,o=this._availability;return n<0||n>o.length?"unknown":o[n]&1<s.data).catch(s=>{if(s?.details?.httpStatus===422)return{location:{top:l,left:n,width:o,height:r},valid:!0,data:new Array(o*r).fill(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 u("tilemap:location-mismatch","Tilemap response for different location than requested",{response:s,definition:{top:l,left:n,width:o,height:r}});return w.fromJSON(s)})}static fromJSON(t){return Object.freeze(new w(t))}}function $(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function K(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const a=e.service.query;return a&&(t=`${t}?${a}`),t}function N(e){if(!e?.location)throw new u("tilemap:missing-location","Location missing from tilemap response");if(e.valid===!1)throw new u("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new u("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new u("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new u("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}var v;function A(e,t,a){return new u("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:a})}let p=v=class extends z{constructor(e){super(e),this._pendingTilemapRequests={},this.request=D,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new F(2*R.MEGABYTES),this.addHandles(S(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),q))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,a){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return"unavailable";const i=this._tilemapFromCache(e,t,a,this._tmpTilemapDefinition);return i?i.getAvailability(t,a):"unknown"}fetchAvailability(e,t,a,i){return!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD?Promise.reject(A(e,t,a)):this._fetchTilemap(e,t,a,i).catch(l=>l).then(l=>{if(l instanceof w){const n=l.getAvailability(t,a);if(n==="unavailable")throw A(e,t,a);return n}if(_(l))throw l;return"unknown"})}fetchAvailabilityUpsample(e,t,a,i,l){i.level=e,i.row=t,i.col=a;const n=this.layer.tileInfo;n.updateTileInfo(i);const o=this.fetchAvailability(e,t,a,l).catch(r=>{if(_(r))throw r;if(n.upsampleTile(i))return this.fetchAvailabilityUpsample(i.level,i.row,i.col,i,l);throw r});return this._fetchAvailabilityUpsamplePrefetch(i.id,e,t,a,l,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,a,i,l,n){if(!this._prefetchingEnabled||e==null)return;const o=`prefetch-${e}`;if(this.hasHandles(o))return;const r=new AbortController;n.then(()=>r.abort(),()=>r.abort());let c=!1;const s=j(()=>{c||(c=!0,r.abort())});if(this.addHandles(s,o),await L(10,r.signal).catch(()=>{}),c||(c=!0,this.removeHandles(o)),x(r))return;const h=new H(e,t,a,i),f={...l,signal:r.signal},m=this.layer.tileInfo;for(let O=0;v._prefetches.length{v._prefetches.removeUnordered(b)};b.then(g,g)}}_fetchTilemap(e,t,a,i){if(!this.layer.tileInfo.lodAt(e)||ethis.effectiveMaxLOD)return Promise.reject(new u("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const l=this._tmpTilemapDefinition,n=this._tilemapFromCache(e,t,a,l);if(n)return Promise.resolve(n);const o=i?.signal;return i={...i,signal:null},new Promise((r,c)=>{P(o,()=>c(k()));const s=$(l);let h=this._pendingTilemapRequests[s];if(!h){h=w.fromDefinition(l,i).then(m=>(this._tilemapCache.put(s,m,m.byteSize),m));const f=()=>{delete this._pendingTilemapRequests[s]};this._pendingTilemapRequests[s]=h,h.then(f,f)}h.then(r,c)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:a}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:I({...e.query,...a,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,a,i){i.level=e,i.row=t-t%this.size,i.col=a-a%this.size;const l=$(i);return this._tilemapCache.get(l)}get test(){}};p._maxPrefetch=4,p._prefetches=new T({initialSize:v._maxPrefetch}),d([y({constructOnly:!0})],p.prototype,"layer",void 0),d([y({constructOnly:!0})],p.prototype,"minLOD",void 0),d([y({constructOnly:!0})],p.prototype,"maxLOD",void 0),d([y({constructOnly:!0})],p.prototype,"request",void 0),d([y({constructOnly:!0})],p.prototype,"size",void 0),p=v=d([M("esri.layers.support.TilemapCache")],p);export{p as f}; diff --git a/custom-toc-highlight/assets/TimeExtent-Cn0Jofqr-D2z4zFxu.js b/custom-toc-highlight/assets/TimeExtent-Cn0Jofqr-BcCXKjqL.js similarity index 98% rename from custom-toc-highlight/assets/TimeExtent-Cn0Jofqr-D2z4zFxu.js rename to custom-toc-highlight/assets/TimeExtent-Cn0Jofqr-BcCXKjqL.js index 7a137c1c..7c8c6bbd 100644 --- a/custom-toc-highlight/assets/TimeExtent-Cn0Jofqr-D2z4zFxu.js +++ b/custom-toc-highlight/assets/TimeExtent-Cn0Jofqr-BcCXKjqL.js @@ -1 +1 @@ -import{v as o,S as d,a0 as p,ac as y,e as v,aD as c,i as J,c7 as g,cu as D,F as E}from"./story-BfX8CRfG.js";const T={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function m(e,t,n,s=c){const r=new g(D(s)),i=E.fromJSDate(e,{zone:r}),u=n==="decades"||n==="centuries"?"year":S(n);return n==="decades"&&(t*=10),n==="centuries"&&(t*=100),i.plus({[u]:t}).toJSDate()}function k(e,t,n="milliseconds"){const s=e.getTime(),r=N(t,n,"milliseconds");return new Date(s+r)}function w(e,t,n=c){const s=new g(D(n)),r=E.fromJSDate(e,{zone:s});if(t==="decades"||t==="centuries"){const u=r.startOf("year"),{year:h}=u,A=h-h%(t==="decades"?10:100);return u.set({year:A}).toJSDate()}const i=S(t);return r.startOf(i).toJSDate()}function N(e,t,n){return e===0?0:e*T[t]/T[n]}function S(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}var a;let l=a=class extends v{static get allTime(){return f}static get empty(){return j}static fromArray(e){return new a({start:e[0]!=null?new Date(e[0]):e[0],end:e[1]!=null?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return t.end!=null?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(a.allTime)}get isEmpty(){return this.equals(a.empty)}readStart(e,t){return t.start!=null?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new a({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,s=e.start?.getTime()??e.start,r=e.end?.getTime()??e.end;return t===s&&n===r}expandTo(e,t=c){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=w(n,e,t));let s=this.end;if(s){const r=w(s,e,t);s=s.getTime()===r.getTime()?r:m(r,1,e,t)}return new a({start:n,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return a.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let i,u;return s>=t&&s<=n?i=s:t>=s&&t<=r&&(i=t),n>=s&&n<=r?u=n:r>=t&&r<=n&&(u=r),i==null||u==null||isNaN(i)||isNaN(u)?a.empty:new a({start:i===-1/0?null:new Date(i),end:u===1/0?null:new Date(u)})}offset(e,t,n=c){if(this.isEmpty||this.isAllTime)return this.clone();const s=new a,{start:r,end:i}=this;return r!=null&&(s.start=m(r,e,t,n)),i!=null&&(s.end=m(i,e,t,n)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=this.start!=null&&e.start!=null?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=this.end!=null&&e.end!=null?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new a({start:t,end:n})}};o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"end",void 0),o([p("end")],l.prototype,"readEnd",null),o([y("end")],l.prototype,"writeEnd",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isAllTime",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isEmpty",null),o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"start",void 0),o([p("start")],l.prototype,"readStart",null),o([y("start")],l.prototype,"writeStart",null),l=a=o([J("esri.time.TimeExtent")],l);const O=l,f=new l,j=new l({start:void 0,end:void 0});export{N as E,m as c,T as h,k as j,O as k}; +import{v as o,S as d,a0 as p,ac as y,e as v,aD as c,i as J,c7 as g,cu as D,F as E}from"./story-Doly9N9p.js";const T={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8};function m(e,t,n,s=c){const r=new g(D(s)),i=E.fromJSDate(e,{zone:r}),u=n==="decades"||n==="centuries"?"year":S(n);return n==="decades"&&(t*=10),n==="centuries"&&(t*=100),i.plus({[u]:t}).toJSDate()}function k(e,t,n="milliseconds"){const s=e.getTime(),r=N(t,n,"milliseconds");return new Date(s+r)}function w(e,t,n=c){const s=new g(D(n)),r=E.fromJSDate(e,{zone:s});if(t==="decades"||t==="centuries"){const u=r.startOf("year"),{year:h}=u,A=h-h%(t==="decades"?10:100);return u.set({year:A}).toJSDate()}const i=S(t);return r.startOf(i).toJSDate()}function N(e,t,n){return e===0?0:e*T[t]/T[n]}function S(e){switch(e){case"milliseconds":return"millisecond";case"seconds":return"second";case"minutes":return"minute";case"hours":return"hour";case"days":return"day";case"weeks":return"week";case"months":return"month";case"years":return"year"}}var a;let l=a=class extends v{static get allTime(){return f}static get empty(){return j}static fromArray(e){return new a({start:e[0]!=null?new Date(e[0]):e[0],end:e[1]!=null?new Date(e[1]):e[1]})}constructor(e){super(e),this.end=null,this.start=null}readEnd(e,t){return t.end!=null?new Date(t.end):null}writeEnd(e,t){t.end=e?.getTime()??null}get isAllTime(){return this.equals(a.allTime)}get isEmpty(){return this.equals(a.empty)}readStart(e,t){return t.start!=null?new Date(t.start):null}writeStart(e,t){t.start=e?.getTime()??null}clone(){return new a({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=this.start?.getTime()??this.start,n=this.end?.getTime()??this.end,s=e.start?.getTime()??e.start,r=e.end?.getTime()??e.end;return t===s&&n===r}expandTo(e,t=c){if(this.isEmpty||this.isAllTime)return this.clone();let n=this.start;n&&(n=w(n,e,t));let s=this.end;if(s){const r=w(s,e,t);s=s.getTime()===r.getTime()?r:m(r,1,e,t)}return new a({start:n,end:s})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return a.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=this.start?.getTime()??-1/0,n=this.end?.getTime()??1/0,s=e.start?.getTime()??-1/0,r=e.end?.getTime()??1/0;let i,u;return s>=t&&s<=n?i=s:t>=s&&t<=r&&(i=t),n>=s&&n<=r?u=n:r>=t&&r<=n&&(u=r),i==null||u==null||isNaN(i)||isNaN(u)?a.empty:new a({start:i===-1/0?null:new Date(i),end:u===1/0?null:new Date(u)})}offset(e,t,n=c){if(this.isEmpty||this.isAllTime)return this.clone();const s=new a,{start:r,end:i}=this;return r!=null&&(s.start=m(r,e,t,n)),i!=null&&(s.end=m(i,e,t,n)),s}toArray(){return this.isEmpty?[void 0,void 0]:[this.start?.getTime()??null,this.end?.getTime()??null]}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return f.clone();const t=this.start!=null&&e.start!=null?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,n=this.end!=null&&e.end!=null?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new a({start:t,end:n})}};o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"end",void 0),o([p("end")],l.prototype,"readEnd",null),o([y("end")],l.prototype,"writeEnd",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isAllTime",null),o([d({readOnly:!0,json:{read:!1}})],l.prototype,"isEmpty",null),o([d({type:Date,json:{write:{allowNull:!0}}})],l.prototype,"start",void 0),o([p("start")],l.prototype,"readStart",null),o([y("start")],l.prototype,"writeStart",null),l=a=o([J("esri.time.TimeExtent")],l);const O=l,f=new l,j=new l({start:void 0,end:void 0});export{N as E,m as c,T as h,k as j,O as k}; diff --git a/custom-toc-highlight/assets/TimeInfo-w_HB2CsF-CZutzBPZ.js b/custom-toc-highlight/assets/TimeInfo-w_HB2CsF-B2qHZyfS.js similarity index 95% rename from custom-toc-highlight/assets/TimeInfo-w_HB2CsF-CZutzBPZ.js rename to custom-toc-highlight/assets/TimeInfo-w_HB2CsF-B2qHZyfS.js index edae9b78..0d4fe67f 100644 --- a/custom-toc-highlight/assets/TimeInfo-w_HB2CsF-CZutzBPZ.js +++ b/custom-toc-highlight/assets/TimeInfo-w_HB2CsF-B2qHZyfS.js @@ -1 +1 @@ -import{cr as y,aa as u,e as m,v as t,bz as T,S as l,i as d,a0 as r,ac as o,bQ as c}from"./story-BfX8CRfG.js";import{E as I,k as p}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";const w=y()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let s=class extends u(m){constructor(n){super(n),this.unit="milliseconds",this.value=0}toMilliseconds(){return I(this.value,this.unit,"milliseconds")}};t([T(w,{nonNullable:!0})],s.prototype,"unit",void 0),t([l({type:Number,json:{write:!0},nonNullable:!0})],s.prototype,"value",void 0),s=t([d("esri.time.TimeInterval")],s);const v=s;function a(n,e){return v.fromJSON({value:n,unit:e})}let i=class extends u(m){constructor(n){super(n),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(n,e){return e.timeExtent&&Array.isArray(e.timeExtent)&&e.timeExtent.length===2?p.fromArray(e.timeExtent):null}writeFullTimeExtent(n,e){n?.start!=null&&n.end!=null?e.timeExtent=n.toArray():e.timeExtent=null}readInterval(n,e){return e.timeInterval&&e.timeIntervalUnits?a(e.timeInterval,e.timeIntervalUnits):e.defaultTimeInterval&&e.defaultTimeIntervalUnits?a(e.defaultTimeInterval,e.defaultTimeIntervalUnits):null}writeInterval(n,e){e.timeInterval=n?.toJSON().value??null,e.timeIntervalUnits=n?.toJSON().unit??null}};t([l({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],i.prototype,"cumulative",void 0),t([l({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"endField",void 0),t([l({type:p,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"fullTimeExtent",void 0),t([r("fullTimeExtent",["timeExtent"])],i.prototype,"readFullTimeExtent",null),t([o("fullTimeExtent")],i.prototype,"writeFullTimeExtent",null),t([l({type:Boolean,json:{write:!0}})],i.prototype,"hasLiveData",void 0),t([l({type:v,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"interval",void 0),t([r("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],i.prototype,"readInterval",null),t([o("interval")],i.prototype,"writeInterval",null),t([l({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"startField",void 0),t([l(c("timeReference",!0))],i.prototype,"timeZone",void 0),t([l({type:String,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"trackIdField",void 0),t([l({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],i.prototype,"useTime",void 0),t([l({type:[Date],json:{read:!1}})],i.prototype,"stops",void 0),i=t([d("esri.layers.support.TimeInfo")],i);const U=i;export{v as r,w as v,U as w}; +import{cr as y,aa as u,e as m,v as t,bz as T,S as l,i as d,a0 as r,ac as o,bQ as c}from"./story-Doly9N9p.js";import{E as I,k as p}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";const w=y()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});let s=class extends u(m){constructor(n){super(n),this.unit="milliseconds",this.value=0}toMilliseconds(){return I(this.value,this.unit,"milliseconds")}};t([T(w,{nonNullable:!0})],s.prototype,"unit",void 0),t([l({type:Number,json:{write:!0},nonNullable:!0})],s.prototype,"value",void 0),s=t([d("esri.time.TimeInterval")],s);const v=s;function a(n,e){return v.fromJSON({value:n,unit:e})}let i=class extends u(m){constructor(n){super(n),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(n,e){return e.timeExtent&&Array.isArray(e.timeExtent)&&e.timeExtent.length===2?p.fromArray(e.timeExtent):null}writeFullTimeExtent(n,e){n?.start!=null&&n.end!=null?e.timeExtent=n.toArray():e.timeExtent=null}readInterval(n,e){return e.timeInterval&&e.timeIntervalUnits?a(e.timeInterval,e.timeIntervalUnits):e.defaultTimeInterval&&e.defaultTimeIntervalUnits?a(e.defaultTimeInterval,e.defaultTimeIntervalUnits):null}writeInterval(n,e){e.timeInterval=n?.toJSON().value??null,e.timeIntervalUnits=n?.toJSON().unit??null}};t([l({type:Boolean,json:{name:"exportOptions.timeDataCumulative",write:!0}})],i.prototype,"cumulative",void 0),t([l({type:String,json:{name:"endTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"endField",void 0),t([l({type:p,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"fullTimeExtent",void 0),t([r("fullTimeExtent",["timeExtent"])],i.prototype,"readFullTimeExtent",null),t([o("fullTimeExtent")],i.prototype,"writeFullTimeExtent",null),t([l({type:Boolean,json:{write:!0}})],i.prototype,"hasLiveData",void 0),t([l({type:v,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"interval",void 0),t([r("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],i.prototype,"readInterval",null),t([o("interval")],i.prototype,"writeInterval",null),t([l({type:String,json:{name:"startTimeField",write:{enabled:!0,allowNull:!0}}})],i.prototype,"startField",void 0),t([l(c("timeReference",!0))],i.prototype,"timeZone",void 0),t([l({type:String,json:{write:{enabled:!0,allowNull:!0}}})],i.prototype,"trackIdField",void 0),t([l({type:Boolean,json:{name:"exportOptions.useTime",write:!0}})],i.prototype,"useTime",void 0),t([l({type:[Date],json:{read:!1}})],i.prototype,"stops",void 0),i=t([d("esri.layers.support.TimeInfo")],i);const U=i;export{v as r,w as v,U as w}; diff --git a/custom-toc-highlight/assets/TimeOnly-DSMefxKy-BU7RNYWc.js b/custom-toc-highlight/assets/TimeOnly-DSMefxKy-BHvJbNji.js similarity index 99% rename from custom-toc-highlight/assets/TimeOnly-DSMefxKy-BU7RNYWc.js rename to custom-toc-highlight/assets/TimeOnly-DSMefxKy-BHvJbNji.js index cf0ca880..2b3d22ee 100644 --- a/custom-toc-highlight/assets/TimeOnly-DSMefxKy-BU7RNYWc.js +++ b/custom-toc-highlight/assets/TimeOnly-DSMefxKy-BHvJbNji.js @@ -1 +1 @@ -import{F as a,c5 as M,b_ as g,c7 as Z,h as U,c2 as q,n as b}from"./story-BfX8CRfG.js";import{t as l}from"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";var y;(function(r){r.TimeZoneNotRecognized="TimeZoneNotRecognized"})(y||(y={}));const N={[y.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class w extends Error{constructor(e,t){super(q(N[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,w)}}function h(r,e,t){return rt?r-t:0}function d(r,e,t){return rt?t:r}class n{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,s=1,i=0,o=0,T=0,S=0,L){if(isNaN(e)||isNaN(t)||isNaN(s)||isNaN(i)||isNaN(o)||isNaN(T)||isNaN(S))return null;const p=a.local(e,t).daysInMonth;let D=a.fromObject({day:d(s,1,p),year:e,month:d(t,1,12),hour:d(i,0,23),minute:d(o,0,59),second:d(T,0,59),millisecond:d(S,0,999)},{zone:m(L)});return D=D.plus({months:h(t,1,12),days:h(s,1,p),hours:h(i,0,23),minutes:h(o,0,59),seconds:h(T,0,59),milliseconds:h(S,0,999)}),new n(D)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const s=m(t);return e.isUnknownTimeZone||s===l.instance?n.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e._date.setZone(s))}static dateJSToArcadeDate(e){return new n(a.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromJSDate(e,{zone:s}))}static unknownEpochToArcadeDate(e){return new n(a.fromMillis(e,{zone:l.instance}))}static unknownDateJSToArcadeDate(e){return new n(a.fromMillis(e.getTime(),{zone:l.instance}))}static epochToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromMillis(e,{zone:s}))}static dateTimeToArcadeDate(e){return new n(e)}clone(){return new n(this._date)}changeTimeZone(e){const t=m(e);return n.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const s=m(t);return e.zone===l.instance||s===l.instance?n.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e.setZone(s))}static nowToArcadeDate(e){const t=m(e);return new n(a.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new n(a.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===n.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===l.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new n(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new n(this._date.toUTC())}toLocal(){return new n(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=a.fromISO(e,{setZone:!0});return new n(t)}}function m(r,e=!0){if(r instanceof M)return r;if(r.toLowerCase()==="system")return"system";if(r.toLowerCase()==="utc")return"UTC";if(r.toLowerCase()==="unknown")return l.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(r)){const s=g.parseSpecifier("UTC"+(r.startsWith("+")||r.startsWith("-")?"":"+")+r);if(s)return s}const t=Z.create(r);if(!t.isValid){if(e)throw new w(y.TimeZoneNotRecognized);return null}return t}function k(r){r=r.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let e="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|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 s of r.match(t)||[])switch(s){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"X":case"x":e+=s;break;default:s.length>=2&&s.slice(0,1)==="["&&s.slice(-1)==="]"?e+=`'${s.slice(1,-1)}'`:e+=`'${s}'`}return e}let Y=class c{constructor(e,t,s){this._year=e,this._month=t,this._day=s,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof c&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new c(this._year,this._month,this._day)}toDateTime(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toDateTimeLuxon(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(e===null||e==="")return this.toString();if(t&&(e=k(e)),!e)return"";const s=this.toDateTime("unknown");return n.dateTimeToArcadeDate(s).toFormat(e,{locale:U(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return n.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return c.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return a.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=a.fromMillis(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=a.fromSeconds(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return t.length!==3?null:new c(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,s){const i=new c(e,t,s);return i.isValid===!1?null:i}static fromDateJS(e){return c.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return c.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];if(t)(t=k(t))&&s.push(t);else if(t===null||t===""){const i=a.fromISO(e,{setZone:!0});return i.isValid?c.fromParts(i.year,i.month,i.day):null}for(const i of s){const o=a.fromFormat(e,t??i);if(o.isValid)return new c(o.year,o.month,o.day)}return null}static fromNow(e="system"){const t=a.fromJSDate(new Date).setZone(m(e));return new c(t.year,t.month,t.day)}};function z(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function I(r){if(r==null)return null;switch(r.type){case"polygon":case"multipoint":case"polyline":return r.extent;case"point":return new b({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y,spatialReference:r.spatialReference});case"extent":return r}return null}function _(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function H(r){if(r==null)return null;const e=r.clone();return r.cache._geVersion!==void 0&&(e.cache._geVersion=r.cache._geVersion),e}function f(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}function C(r){if(!r)return"";const e=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let t="";for(const s of r.match(e)||[])switch(s){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=s;break;case"A":case"a":t+="a";break;default:t+=`'${s}'`}return t}class u{constructor(e,t,s,i){this._hour=e,this._minute=t,this._second=s,this._millisecond=i,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof u&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return f(this.hour)&&f(this.minute)&&f(this.second)&&f(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return e===null||e===""?this.toString():(e=C(e))?a.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:U(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,s,i){const o=new u(e,t,s,i);return o.isValid()?o:null}static fromReader(e){if(!e)return null;const t=e.split(":");return t.length!==3?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),s=Math.floor(e/6e4%60),i=Math.floor(e/36e5%24),o=Math.floor(e%1e3);return new u(i,s,t,o)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];t?(t=C(t))&&s.push(t):t!==null&&t!==""||(s.push("HH:mm:ss"),s.push("HH:mm:ss.SSS"),s.push("hh:mm:ss a"),s.push("hh:mm:ss.SSS a"),s.push("HH:mm"),s.push("hh:mm a"),s.push("H:mm"),s.push("h:mm a"),s.push("H:mm:ss"),s.push("h:mm:ss a"),s.push("H:mm:ss.SSS"),s.push("h:mm:ss.SSS a"));for(const i of s){const o=a.fromFormat(e,i);if(o.isValid)return new u(o.hour,o.minute,o.second,o.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return a.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}export{z as A,H as I,Y as O,I as Y,u as m,n as r,m as u,_ as z}; +import{F as a,c5 as M,b_ as g,c7 as Z,h as U,c2 as q,n as b}from"./story-Doly9N9p.js";import{t as l}from"./UnknownTimeZone-C--TOcPG-9of9030I.js";var y;(function(r){r.TimeZoneNotRecognized="TimeZoneNotRecognized"})(y||(y={}));const N={[y.TimeZoneNotRecognized]:"Timezone identifier has not been recognized."};class w extends Error{constructor(e,t){super(q(N[e],t)),this.declaredRootClass="esri.arcade.arcadedate.dateerror",Error.captureStackTrace&&Error.captureStackTrace(this,w)}}function h(r,e,t){return rt?r-t:0}function d(r,e,t){return rt?t:r}class n{constructor(e){this._date=e,this.declaredRootClass="esri.arcade.arcadedate"}static fromParts(e=0,t=1,s=1,i=0,o=0,T=0,S=0,L){if(isNaN(e)||isNaN(t)||isNaN(s)||isNaN(i)||isNaN(o)||isNaN(T)||isNaN(S))return null;const p=a.local(e,t).daysInMonth;let D=a.fromObject({day:d(s,1,p),year:e,month:d(t,1,12),hour:d(i,0,23),minute:d(o,0,59),second:d(T,0,59),millisecond:d(S,0,999)},{zone:m(L)});return D=D.plus({months:h(t,1,12),days:h(s,1,p),hours:h(i,0,23),minutes:h(o,0,59),seconds:h(T,0,59),milliseconds:h(S,0,999)}),new n(D)}static get systemTimeZoneCanonicalName(){return Intl.DateTimeFormat().resolvedOptions().timeZone??"system"}static arcadeDateAndZoneToArcadeDate(e,t){const s=m(t);return e.isUnknownTimeZone||s===l.instance?n.fromParts(e.year,e.monthJS+1,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e._date.setZone(s))}static dateJSToArcadeDate(e){return new n(a.fromJSDate(e,{zone:"system"}))}static dateJSAndZoneToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromJSDate(e,{zone:s}))}static unknownEpochToArcadeDate(e){return new n(a.fromMillis(e,{zone:l.instance}))}static unknownDateJSToArcadeDate(e){return new n(a.fromMillis(e.getTime(),{zone:l.instance}))}static epochToArcadeDate(e,t="system"){const s=m(t);return new n(a.fromMillis(e,{zone:s}))}static dateTimeToArcadeDate(e){return new n(e)}clone(){return new n(this._date)}changeTimeZone(e){const t=m(e);return n.dateTimeToArcadeDate(this._date.setZone(t))}static dateTimeAndZoneToArcadeDate(e,t){const s=m(t);return e.zone===l.instance||s===l.instance?n.fromParts(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond,s):new n(e.setZone(s))}static nowToArcadeDate(e){const t=m(e);return new n(a.fromJSDate(new Date,{zone:t}))}static nowUTCToArcadeDate(){return new n(a.utc())}get isSystem(){return this.timeZone==="system"||this.timeZone===n.systemTimeZoneCanonicalName}equals(e){return this.isSystem&&e.isSystem?this.toNumber()===e.toNumber():this.isUnknownTimeZone===e.isUnknownTimeZone&&this._date.equals(e._date)}get isUnknownTimeZone(){return this._date.zone===l.instance}get isValid(){return this._date.isValid}get hour(){return this._date.hour}get second(){return this._date.second}get day(){return this._date.day}get dayOfWeekISO(){return this._date.weekday}get dayOfWeekJS(){let e=this._date.weekday;return e>6&&(e=0),e}get millisecond(){return this._date.millisecond}get monthISO(){return this._date.month}get weekISO(){return this._date.weekNumber}get yearISO(){return this._date.weekYear}get monthJS(){return this._date.month-1}get year(){return this._date.year}get minute(){return this._date.minute}get zone(){return this._date.zone}get timeZoneOffset(){return this.isUnknownTimeZone?0:this._date.offset}get timeZone(){if(this.isUnknownTimeZone)return"unknown";if(this._date.zone.type==="system")return"system";const e=this.zone;return e.type==="fixed"?e.fixed===0?"UTC":e.formatOffset(0,"short"):e.name}stringify(){return JSON.stringify(this.toJSDate())}plus(e){return new n(this._date.plus(e))}diff(e,t="milliseconds"){return this._date.diff(e._date,t)[t]}toISODate(){return this._date.toISODate()}toISOString(e){return e?this._date.toISO({suppressMilliseconds:!0,includeOffset:!this.isUnknownTimeZone}):this._date.toISO({includeOffset:!this.isUnknownTimeZone})}toISOTime(e,t){return this._date.toISOTime({suppressMilliseconds:e,includeOffset:t&&!this.isUnknownTimeZone})}toFormat(e,t){return this.isUnknownTimeZone&&(e=e.replaceAll("Z","")),this._date.toFormat(e,t)}toJSDate(){return this._date.toJSDate()}toSQLValue(){return this._date.toFormat("yyyy-LL-dd HH:mm:ss")}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}toDateTime(){return this._date}toNumber(){return this._date.toMillis()}getTime(){return this._date.toMillis()}toUTC(){return new n(this._date.toUTC())}toLocal(){return new n(this._date.toLocal())}toString(){return this.toISOString(!0)}static fromReaderAsTimeStampOffset(e){if(!e)return null;const t=a.fromISO(e,{setZone:!0});return new n(t)}}function m(r,e=!0){if(r instanceof M)return r;if(r.toLowerCase()==="system")return"system";if(r.toLowerCase()==="utc")return"UTC";if(r.toLowerCase()==="unknown")return l.instance;if(/^[+-]?[0-9]{1,2}([:][0-9]{2})?$/.test(r)){const s=g.parseSpecifier("UTC"+(r.startsWith("+")||r.startsWith("-")?"":"+")+r);if(s)return s}const t=Z.create(r);if(!t.isValid){if(e)throw new w(y.TimeZoneNotRecognized);return null}return t}function k(r){r=r.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let e="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|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 s of r.match(t)||[])switch(s){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"X":case"x":e+=s;break;default:s.length>=2&&s.slice(0,1)==="["&&s.slice(-1)==="]"?e+=`'${s.slice(1,-1)}'`:e+=`'${s}'`}return e}let Y=class c{constructor(e,t,s){this._year=e,this._month=t,this._day=s,this.declaredRootClass="esri.core.sql.dateonly"}get month(){return this._month}get monthJS(){return this._month-1}get year(){return this._year}get day(){return this._day}get isValid(){return this.toDateTime("unknown").isValid}equals(e){return e instanceof c&&e.day===this.day&&e.month===this.month&&e.year===this.year}clone(){return new c(this._year,this._month,this._day)}toDateTime(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toDateTimeLuxon(e){return a.fromObject({day:this.day,month:this.month,year:this.year},{zone:m(e)})}toString(){return`${this.year.toString().padStart(4,"0")}-${this.month.toString().padStart(2,"0")}-${this.day.toString().padStart(2,"0")}`}toFormat(e=null,t=!0){if(e===null||e==="")return this.toString();if(t&&(e=k(e)),!e)return"";const s=this.toDateTime("unknown");return n.dateTimeToArcadeDate(s).toFormat(e,{locale:U(),numberingSystem:"latn"})}toArcadeDate(){const e=this.toDateTime("unknown");return n.dateTimeToArcadeDate(e)}toNumber(){return this.toDateTime("unknown").toMillis()}toJSDate(){return this.toDateTime("unknown").toJSDate()}toStorageFormat(){return this.toFormat("yyyy-LL-dd",!1)}toSQLValue(){return this.toFormat("yyyy-LL-dd",!1)}toSQLWithKeyword(){return"date '"+this.toFormat("yyyy-LL-dd",!1)+"'"}plus(e,t){return c.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}toUTCDateTime(){return a.utc(this.year,this.month,this.day,0,0,0,0)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}static fromMilliseconds(e){const t=a.fromMillis(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromSeconds(e){const t=a.fromSeconds(e,{zone:g.utcInstance});return t.isValid?c.fromParts(t.year,t.month,t.day):null}static fromReader(e){if(!e)return null;const t=e.split("-");return t.length!==3?null:new c(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10))}static fromParts(e,t,s){const i=new c(e,t,s);return i.isValid===!1?null:i}static fromDateJS(e){return c.fromParts(e.getFullYear(),e.getMonth()+1,e.getDay())}static fromDateTime(e){return c.fromParts(e.year,e.month,e.day)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];if(t)(t=k(t))&&s.push(t);else if(t===null||t===""){const i=a.fromISO(e,{setZone:!0});return i.isValid?c.fromParts(i.year,i.month,i.day):null}for(const i of s){const o=a.fromFormat(e,t??i);if(o.isValid)return new c(o.year,o.month,o.day)}return null}static fromNow(e="system"){const t=a.fromJSDate(new Date).setZone(m(e));return new c(t.year,t.month,t.day)}};function z(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 109404;case"miles":case"mile":case"squaremile":case"squaremiles":return 109439;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 109414;case"acres":case"acre":case"ac":return 109402;case"hectares":case"hectare":case"ha":return 109401;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 109442;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 109405;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 109409}return null}function I(r){if(r==null)return null;switch(r.type){case"polygon":case"multipoint":case"polyline":return r.extent;case"point":return new b({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y,spatialReference:r.spatialReference});case"extent":return r}return null}function _(r){if(r==null)return null;if(typeof r=="number")return r;let e=r.toLowerCase();switch(e=e.replaceAll(/\s/g,""),e=e.replaceAll("-",""),e){case"meters":case"meter":case"m":case"squaremeters":case"squaremeter":return 9001;case"miles":case"mile":case"squaremile":case"squaremiles":return 9093;case"kilometers":case"kilometer":case"squarekilometers":case"squarekilometer":case"km":return 9036;case"yard":case"yd":case"yards":case"squareyards":case"squareyard":return 9096;case"feet":case"ft":case"foot":case"squarefeet":case"squarefoot":return 9002;case"nmi":case"nauticalmile":case"nauticalmiles":case"squarenauticalmile":case"squarenauticalmiles":return 9030}return null}function H(r){if(r==null)return null;const e=r.clone();return r.cache._geVersion!==void 0&&(e.cache._geVersion=r.cache._geVersion),e}function f(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}function C(r){if(!r)return"";const e=/(a|A|hh?|HH?|mm?|ss?|SSS|S|.)/g;let t="";for(const s of r.match(e)||[])switch(s){case"SSS":case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":t+=s;break;case"A":case"a":t+="a";break;default:t+=`'${s}'`}return t}class u{constructor(e,t,s,i){this._hour=e,this._minute=t,this._second=s,this._millisecond=i,this.declaredRootClass="esri.core.sql.timeonly"}get hour(){return this._hour}get minute(){return this._minute}get second(){return this._second}get millisecond(){return this._millisecond}equals(e){return e instanceof u&&e.hour===this.hour&&e.minute===this.minute&&e.second===this.second&&e.millisecond===this.millisecond}clone(){return new u(this.hour,this.minute,this.second,this.millisecond)}isValid(){return f(this.hour)&&f(this.minute)&&f(this.second)&&f(this.millisecond)&&this.hour>=0&&this.hour<24&&this.minute>=0&&this.minute<60&&this.second>=0&&this.second<60&&this.millisecond>=0&&this.millisecond<1e3}toString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`+(this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):"")}toSQLValue(){return this.toString()}toSQLWithKeyword(){return`time '${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}${this.millisecond>0?"."+this.millisecond.toString().padStart(3,"0"):""}'`}toStorageString(){return`${this.hour.toString().padStart(2,"0")}:${this.minute.toString().padStart(2,"0")}:${this.second.toString().padStart(2,"0")}`}toFormat(e=null){return e===null||e===""?this.toString():(e=C(e))?a.local(1970,1,1,this._hour,this._minute,this._second,this._millisecond).toFormat(e,{locale:U(),numberingSystem:"latn"}):""}toNumber(){return this.millisecond+1e3*this.second+1e3*this.minute*60+60*this.hour*60*1e3}static fromParts(e,t,s,i){const o=new u(e,t,s,i);return o.isValid()?o:null}static fromReader(e){if(!e)return null;const t=e.split(":");return t.length!==3?null:new u(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),0)}static fromMilliseconds(e){if(e>864e5||e<0)return null;const t=Math.floor(e/1e3%60),s=Math.floor(e/6e4%60),i=Math.floor(e/36e5%24),o=Math.floor(e%1e3);return new u(i,s,t,o)}static fromDateJS(e){return new u(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}static fromDateTime(e){return new u(e.hour,e.minute,e.second,e.millisecond)}static fromSqlTimeStampOffset(e){return this.fromDateTime(e.toDateTime())}static fromString(e,t=null){if(e===""||e===null)return null;const s=[];t?(t=C(t))&&s.push(t):t!==null&&t!==""||(s.push("HH:mm:ss"),s.push("HH:mm:ss.SSS"),s.push("hh:mm:ss a"),s.push("hh:mm:ss.SSS a"),s.push("HH:mm"),s.push("hh:mm a"),s.push("H:mm"),s.push("h:mm a"),s.push("H:mm:ss"),s.push("h:mm:ss a"),s.push("H:mm:ss.SSS"),s.push("h:mm:ss.SSS a"));for(const i of s){const o=a.fromFormat(e,i);if(o.isValid)return new u(o.hour,o.minute,o.second,o.millisecond)}return null}plus(e,t){switch(e){case"days":case"years":case"months":return this.clone();case"hours":case"minutes":case"seconds":case"milliseconds":return u.fromDateTime(this.toUTCDateTime().plus({[e]:t}))}return null}toUTCDateTime(){return a.utc(1970,1,1,this.hour,this.minute,this.second,this.millisecond)}difference(e,t){switch(t.toLowerCase()){case"days":case"day":case"d":return this.toUTCDateTime().diff(e.toUTCDateTime(),"days").days;case"months":case"month":return this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months;case"minutes":case"minute":case"m":return t==="M"?this.toUTCDateTime().diff(e.toUTCDateTime(),"months").months:this.toUTCDateTime().diff(e.toUTCDateTime(),"minutes").minutes;case"seconds":case"second":case"s":return this.toUTCDateTime().diff(e.toUTCDateTime(),"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return this.toUTCDateTime().diff(e.toUTCDateTime(),"milliseconds").milliseconds;case"hours":case"hour":case"h":return this.toUTCDateTime().diff(e.toUTCDateTime(),"hours").hours;case"years":case"year":case"y":return this.toUTCDateTime().diff(e.toUTCDateTime(),"years").years}}}export{z as A,H as I,Y as O,I as Y,u as m,n as r,m as u,_ as z}; diff --git a/custom-toc-highlight/assets/Tooltip-B0HefZ7r-yfksLaF6.js b/custom-toc-highlight/assets/Tooltip-B0HefZ7r-CZdyswYp.js similarity index 99% rename from custom-toc-highlight/assets/Tooltip-B0HefZ7r-yfksLaF6.js rename to custom-toc-highlight/assets/Tooltip-B0HefZ7r-CZdyswYp.js index ab734a4d..3a079a7d 100644 --- a/custom-toc-highlight/assets/Tooltip-B0HefZ7r-yfksLaF6.js +++ b/custom-toc-highlight/assets/Tooltip-B0HefZ7r-CZdyswYp.js @@ -1 +1 @@ -import{V as M,H as N,ao as E,ap as F,a as x,e as R,ab as S,a8 as j,n as B,aq as u}from"./Theme-rblUnB2V-D2UsCNGl.js";class D extends M{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let t=this.width(),i=this.height();if(t>0&&i>0){let e=this.get("cornerRadius",8);e=u(e,0,Math.min(t/2,i/2));let r=this.get("pointerX",0),o=this.get("pointerY",0),a=this.get("pointerBaseWidth",15)/2,T=0,_=0,f=0,b=(r-T)*(i-_)-(o-_)*(t-T),n=(r-f)*(0-i)-(o-i)*(t-f);const s=this._display;if(s.moveTo(e,0),b>0&&n>0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,-1/0,0),s.lineTo(l-a,0),s.lineTo(r,o),s.lineTo(l+a,0)}if(s.lineTo(t-e,0),s.arcTo(t,0,t,e,e),b>0&&n<0){let l=Math.round(u(o,e+a,i-a-e));r=u(r,t,1/0),s.lineTo(t,e),s.lineTo(t,Math.max(l-a,e)),s.lineTo(r,o),s.lineTo(t,l+a)}if(s.lineTo(t,i-e),s.arcTo(t,i,t-e,i,e),b<0&&n<0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,i,1/0),s.lineTo(t-e,i),s.lineTo(l+a,i),s.lineTo(r,o),s.lineTo(l-a,i)}if(s.lineTo(e,i),s.arcTo(0,i,0,i-e,e),b<0&&n>0){let l=Math.round(u(o,e+a,i-e-a));r=u(r,-1/0,0),s.lineTo(0,i-e),s.lineTo(0,l+a),s.lineTo(r,o),s.lineTo(0,Math.max(l-a,e))}s.lineTo(0,e),s.arcTo(0,0,e,0,e),s.closePath()}}}}Object.defineProperty(D,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PointedRectangle"}),Object.defineProperty(D,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:M.classNames.concat([D.className])});class P extends N{constructor(t,i,e,r=[]){super(t,i,e,r),Object.defineProperty(this,"_fx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_fy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fillDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_labelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_w",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_h",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_keepHoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlContentHovered",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._settings.themeTags=E(this._settings.themeTags,["tooltip"]),super._afterNew(),this._setDefaultFn("background",()=>D.new(this._root,{})).set("themeTags",["tooltip","background"]),this._label=this.children.push(F.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate("htmlElement",t=>{t&&(this._disposers.push(x(t,"pointerover",i=>{this._htmlContentHovered=!0})),this._disposers.push(x(t,"pointerout",i=>{this._htmlContentHovered=!1})))})),this.on("visible",t=>{this._handleReaderAnnouncement()}),this.label.events.on("dataitemchanged",t=>{this._handleReaderAnnouncement()}),this._root._tooltips.push(this)}_handleReaderAnnouncement(){this.get("readerAnnounce")&&this.isVisibleDeep()&&this._root.readerAlert(this.label.getAccessibleText())}get label(){return this._label}_dispose(){super._dispose(),R(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty("pointerOrientation")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&this.get("background")._markDirtyKey("width"),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML")),this.get("labelAriaLabel")!=null&&this.label.set("ariaLabel",this.get("labelAriaLabel"))}_changed(){if(super._changed(),(this.isDirty("pointTo")||this.isDirty("pointerOrientation"))&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){const t=this.get("background");this._keepHoverDp=new S([t.events.on("pointerover",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),e.hover())}),t.events.on("pointerout",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),this._htmlContentHovered||e.unhover())})]),this.label.onPrivate("htmlElement",i=>{this._keepHoverDp&&i&&this._keepHoverDp.disposers.push(x(i,"pointerleave",e=>{const r=this.root._renderer.getEvent(e);t.events.dispatch("pointerout",{type:"pointerout",originalEvent:r.event,point:r.point,simulated:!1,target:t})}))})}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let t=this.get("tooltipTarget");const i=this.get("background");let e,r;t&&i&&(e=t.get("fill"),r=t.get("stroke"),e==null&&(e=r),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),e!=null&&i.set("fill",e),this._fillDp=t.on("fill",o=>{o!=null&&(i.set("fill",o),this._updateTextColor(o))}),this._disposers.push(this._fillDp)),this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),e!=null&&i.set("stroke",e),this._strokeDp=t.on("fill",o=>{o!=null&&i.set("stroke",o)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),e!=null&&this.label.set("fill",e),this._labelDp=t.on("fill",o=>{o!=null&&this.label.set("fill",o)}),this._disposers.push(this._labelDp))),this._updateTextColor(e)}_updateTextColor(t){this.get("autoTextColor")&&(t==null&&(t=this.get("background").get("fill")),t==null&&(t=this._root.interfaceColors.get("background")),t instanceof j&&this.label.set("fill",j.alternative(t,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(t){super._setDataItem(t),this.label._setDataItem(t)}_updateBackground(){super.updateBackground();const t=this._root.container;if(t){let i=.5,e=.5,r=this.get("centerX");r instanceof B&&(i=r.value);let o=this.get("centerY");o instanceof B&&(e=o.value);let a=t.width(),T=t.height(),_=this.parent,f=0,b=0;if(_){f=_.x(),b=_.y();const g=_.get("layerMargin");g&&(f+=g.left||0,b+=g.top||0,a+=(g.left||0)+(g.right||0),T+=(g.top||0)+(g.bottom||0))}const n=this.get("bounds",{left:-f,top:-b,right:a-f,bottom:T-b});this._updateBounds();let s=this.width(),l=this.height();s===0&&(s=this._w),l===0&&(l=this._h);let k=this.get("pointTo",{x:a/2,y:T/2}),h=k.x,p=k.y,m=this.get("pointerOrientation"),c=this.get("background"),d=0,v=0,y=0;c instanceof D&&(d=c.get("pointerLength",0),v=c.get("strokeWidth",0)/2,y=v,c.set("width",s),c.set("height",l));let C=0,H=0,O=n.right-n.left,L=n.bottom-n.top;m=="horizontal"||m=="left"||m=="right"?(v=0,m=="horizontal"?h>n.left+O/2?(h-=s*(1-i)+d,y*=-1):h+=s*i+d:m=="left"?h+=s*(1-i)+d:(h-=s*i+d,y*=-1)):(y=0,m=="vertical"?p>n.top+l/2+d?p-=l*(1-e)+d:(p+=l*e+d,v*=-1):m=="down"?p-=l*(1-e)+d:(p+=l*e+d,v*=-1)),h=u(h,n.left+s*i,n.left+O-s*(1-i))+y,p=u(p,n.top+l*e,n.top+L-l*(1-e))-v,C=k.x-h+s*i+y,H=k.y-p+l*e-v,this._fx=h,this._fy=p;const w=this.get("animationDuration",0);if(w>0&&this.get("visible")&&this.get("opacity")>.1){const g=this.get("animationEasing");this.animate({key:"x",to:h,duration:w,easing:g}),this.animate({key:"y",to:p,duration:w,easing:g})}else this.set("x",h),this.set("y",p);c instanceof D&&(c.set("pointerX",C),c.set("pointerY",H)),s>0&&(this._w=s),l>0&&(this._h=l)}}}Object.defineProperty(P,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tooltip"}),Object.defineProperty(P,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:N.classNames.concat([P.className])});export{P as w}; +import{V as M,H as N,ao as E,ap as F,a as x,e as R,ab as S,a8 as j,n as B,aq as u}from"./Theme-rblUnB2V-Dc7wtY6B.js";class D extends M{_beforeChanged(){super._beforeChanged(),(this.isDirty("pointerBaseWidth")||this.isDirty("cornerRadius")||this.isDirty("pointerLength")||this.isDirty("pointerX")||this.isDirty("pointerY")||this.isDirty("width")||this.isDirty("height"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){this.markDirtyBounds();let t=this.width(),i=this.height();if(t>0&&i>0){let e=this.get("cornerRadius",8);e=u(e,0,Math.min(t/2,i/2));let r=this.get("pointerX",0),o=this.get("pointerY",0),a=this.get("pointerBaseWidth",15)/2,T=0,_=0,f=0,b=(r-T)*(i-_)-(o-_)*(t-T),n=(r-f)*(0-i)-(o-i)*(t-f);const s=this._display;if(s.moveTo(e,0),b>0&&n>0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,-1/0,0),s.lineTo(l-a,0),s.lineTo(r,o),s.lineTo(l+a,0)}if(s.lineTo(t-e,0),s.arcTo(t,0,t,e,e),b>0&&n<0){let l=Math.round(u(o,e+a,i-a-e));r=u(r,t,1/0),s.lineTo(t,e),s.lineTo(t,Math.max(l-a,e)),s.lineTo(r,o),s.lineTo(t,l+a)}if(s.lineTo(t,i-e),s.arcTo(t,i,t-e,i,e),b<0&&n<0){let l=Math.round(u(r,e+a,t-a-e));o=u(o,i,1/0),s.lineTo(t-e,i),s.lineTo(l+a,i),s.lineTo(r,o),s.lineTo(l-a,i)}if(s.lineTo(e,i),s.arcTo(0,i,0,i-e,e),b<0&&n>0){let l=Math.round(u(o,e+a,i-e-a));r=u(r,-1/0,0),s.lineTo(0,i-e),s.lineTo(0,l+a),s.lineTo(r,o),s.lineTo(0,Math.max(l-a,e))}s.lineTo(0,e),s.arcTo(0,0,e,0,e),s.closePath()}}}}Object.defineProperty(D,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PointedRectangle"}),Object.defineProperty(D,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:M.classNames.concat([D.className])});class P extends N{constructor(t,i,e,r=[]){super(t,i,e,r),Object.defineProperty(this,"_fx",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_fy",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fillDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_labelDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_w",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_h",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_keepHoverDp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlContentHovered",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._settings.themeTags=E(this._settings.themeTags,["tooltip"]),super._afterNew(),this._setDefaultFn("background",()=>D.new(this._root,{})).set("themeTags",["tooltip","background"]),this._label=this.children.push(F.new(this._root,{})),this._disposers.push(this._label.events.on("boundschanged",()=>{this._updateBackground()})),this._disposers.push(this.on("bounds",()=>{this._updateBackground()})),this._updateTextColor(),this._root.tooltipContainer.children.push(this),this.hide(0),this._disposers.push(this.label.onPrivate("htmlElement",t=>{t&&(this._disposers.push(x(t,"pointerover",i=>{this._htmlContentHovered=!0})),this._disposers.push(x(t,"pointerout",i=>{this._htmlContentHovered=!1})))})),this.on("visible",t=>{this._handleReaderAnnouncement()}),this.label.events.on("dataitemchanged",t=>{this._handleReaderAnnouncement()}),this._root._tooltips.push(this)}_handleReaderAnnouncement(){this.get("readerAnnounce")&&this.isVisibleDeep()&&this._root.readerAlert(this.label.getAccessibleText())}get label(){return this._label}_dispose(){super._dispose(),R(this._root._tooltips,this)}_updateChildren(){super._updateChildren(),(this.isDirty("pointerOrientation")||this.isPrivateDirty("minWidth")||this.isPrivateDirty("minHeight"))&&this.get("background")._markDirtyKey("width"),this.get("labelText")!=null&&this.label.set("text",this.get("labelText")),this.get("labelHTML")!=null&&this.label.set("html",this.get("labelHTML")),this.get("labelAriaLabel")!=null&&this.label.set("ariaLabel",this.get("labelAriaLabel"))}_changed(){if(super._changed(),(this.isDirty("pointTo")||this.isDirty("pointerOrientation"))&&this._updateBackground(),this.isDirty("tooltipTarget")&&this.updateBackgroundColor(),this.isDirty("keepTargetHover"))if(this.get("keepTargetHover")){const t=this.get("background");this._keepHoverDp=new S([t.events.on("pointerover",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),e.hover())}),t.events.on("pointerout",i=>{let e=this.get("tooltipTarget");e&&(e.parent&&e.parent.getPrivate("tooltipTarget")==e&&(e=e.parent),this._htmlContentHovered||e.unhover())})]),this.label.onPrivate("htmlElement",i=>{this._keepHoverDp&&i&&this._keepHoverDp.disposers.push(x(i,"pointerleave",e=>{const r=this.root._renderer.getEvent(e);t.events.dispatch("pointerout",{type:"pointerout",originalEvent:r.event,point:r.point,simulated:!1,target:t})}))})}else this._keepHoverDp&&(this._keepHoverDp.dispose(),this._keepHoverDp=void 0)}_onShow(){super._onShow(),this.updateBackgroundColor()}updateBackgroundColor(){let t=this.get("tooltipTarget");const i=this.get("background");let e,r;t&&i&&(e=t.get("fill"),r=t.get("stroke"),e==null&&(e=r),this.get("getFillFromSprite")&&(this._fillDp&&this._fillDp.dispose(),e!=null&&i.set("fill",e),this._fillDp=t.on("fill",o=>{o!=null&&(i.set("fill",o),this._updateTextColor(o))}),this._disposers.push(this._fillDp)),this.get("getStrokeFromSprite")&&(this._strokeDp&&this._strokeDp.dispose(),e!=null&&i.set("stroke",e),this._strokeDp=t.on("fill",o=>{o!=null&&i.set("stroke",o)}),this._disposers.push(this._strokeDp)),this.get("getLabelFillFromSprite")&&(this._labelDp&&this._labelDp.dispose(),e!=null&&this.label.set("fill",e),this._labelDp=t.on("fill",o=>{o!=null&&this.label.set("fill",o)}),this._disposers.push(this._labelDp))),this._updateTextColor(e)}_updateTextColor(t){this.get("autoTextColor")&&(t==null&&(t=this.get("background").get("fill")),t==null&&(t=this._root.interfaceColors.get("background")),t instanceof j&&this.label.set("fill",j.alternative(t,this._root.interfaceColors.get("alternativeText"),this._root.interfaceColors.get("text"))))}_setDataItem(t){super._setDataItem(t),this.label._setDataItem(t)}_updateBackground(){super.updateBackground();const t=this._root.container;if(t){let i=.5,e=.5,r=this.get("centerX");r instanceof B&&(i=r.value);let o=this.get("centerY");o instanceof B&&(e=o.value);let a=t.width(),T=t.height(),_=this.parent,f=0,b=0;if(_){f=_.x(),b=_.y();const g=_.get("layerMargin");g&&(f+=g.left||0,b+=g.top||0,a+=(g.left||0)+(g.right||0),T+=(g.top||0)+(g.bottom||0))}const n=this.get("bounds",{left:-f,top:-b,right:a-f,bottom:T-b});this._updateBounds();let s=this.width(),l=this.height();s===0&&(s=this._w),l===0&&(l=this._h);let k=this.get("pointTo",{x:a/2,y:T/2}),h=k.x,p=k.y,m=this.get("pointerOrientation"),c=this.get("background"),d=0,v=0,y=0;c instanceof D&&(d=c.get("pointerLength",0),v=c.get("strokeWidth",0)/2,y=v,c.set("width",s),c.set("height",l));let C=0,H=0,O=n.right-n.left,L=n.bottom-n.top;m=="horizontal"||m=="left"||m=="right"?(v=0,m=="horizontal"?h>n.left+O/2?(h-=s*(1-i)+d,y*=-1):h+=s*i+d:m=="left"?h+=s*(1-i)+d:(h-=s*i+d,y*=-1)):(y=0,m=="vertical"?p>n.top+l/2+d?p-=l*(1-e)+d:(p+=l*e+d,v*=-1):m=="down"?p-=l*(1-e)+d:(p+=l*e+d,v*=-1)),h=u(h,n.left+s*i,n.left+O-s*(1-i))+y,p=u(p,n.top+l*e,n.top+L-l*(1-e))-v,C=k.x-h+s*i+y,H=k.y-p+l*e-v,this._fx=h,this._fy=p;const w=this.get("animationDuration",0);if(w>0&&this.get("visible")&&this.get("opacity")>.1){const g=this.get("animationEasing");this.animate({key:"x",to:h,duration:w,easing:g}),this.animate({key:"y",to:p,duration:w,easing:g})}else this.set("x",h),this.set("y",p);c instanceof D&&(c.set("pointerX",C),c.set("pointerY",H)),s>0&&(this._w=s),l>0&&(this._h=l)}}}Object.defineProperty(P,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Tooltip"}),Object.defineProperty(P,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:N.classNames.concat([P.className])});export{P as w}; diff --git a/custom-toc-highlight/assets/TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js b/custom-toc-highlight/assets/TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js similarity index 97% rename from custom-toc-highlight/assets/TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js rename to custom-toc-highlight/assets/TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js index 7750b866..370b2103 100644 --- a/custom-toc-highlight/assets/TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js +++ b/custom-toc-highlight/assets/TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js @@ -1 +1 @@ -import{v as e,S as i,i as u,aK as y,af as c,g as v,J as m,ac as p,bG as w,e as h,P as S}from"./story-BfX8CRfG.js";import{k as j}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./main-ugzBrWNm.js";var s;let o=s=class extends h{constructor(r){super(r),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new s({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};e([i({type:[String],json:{write:!0}})],o.prototype,"groupByFields",void 0),e([i({type:Number,json:{write:!0}})],o.prototype,"topCount",void 0),e([i({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),o=s=e([u("esri.rest.support.TopFilter")],o);const R=o;var n;const a=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let t=n=class extends h{constructor(r){super(r),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(r,l){l.resultOffset=this.start,l.resultRecordCount=this.num||10}clone(){return new n(S({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}))}};e([i({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([i({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],t.prototype,"distance",void 0),e([i({types:c,json:{read:v,write:!0}})],t.prototype,"geometry",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"geometryPrecision",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"maxAllowableOffset",void 0),e([i({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([i({json:{write:!0}})],t.prototype,"objectIds",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"orderByFields",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"outFields",void 0),e([i({type:m,json:{read:{source:"outSR"},write:{target:"outSR"}}})],t.prototype,"outSpatialReference",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"resultType",void 0),e([i({json:{write:!0}})],t.prototype,"returnGeometry",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnM",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnZ",void 0),e([i({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([p("start"),p("num")],t.prototype,"writeStart",null),e([i({type:String,json:{read:{source:"spatialRel",reader:a.read},write:{target:"spatialRel",writer:a.write}}})],t.prototype,"spatialRelationship",void 0),e([i({type:j,json:{write:!0}})],t.prototype,"timeExtent",void 0),e([i({type:R,json:{write:!0}})],t.prototype,"topFilter",void 0),e([i({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(r){return{enabled:r!=null&&this.distance!=null&&this.distance>0}}}}})],t.prototype,"units",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"where",void 0),t=n=e([u("esri.rest.support.TopFeaturesQuery")],t),t.from=w(t);const b=t;export{b as default}; +import{v as e,S as i,i as u,aK as y,af as c,g as v,J as m,ac as p,bG as w,e as h,P as S}from"./story-Doly9N9p.js";import{k as j}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./main-QGPoLsvl.js";var s;let o=s=class extends h{constructor(r){super(r),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new s({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};e([i({type:[String],json:{write:!0}})],o.prototype,"groupByFields",void 0),e([i({type:Number,json:{write:!0}})],o.prototype,"topCount",void 0),e([i({type:[String],json:{write:!0}})],o.prototype,"orderByFields",void 0),o=s=e([u("esri.rest.support.TopFilter")],o);const R=o;var n;const a=new y({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),d=new y({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let t=n=class extends h{constructor(r){super(r),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(r,l){l.resultOffset=this.start,l.resultRecordCount=this.num||10}clone(){return new n(S({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}))}};e([i({type:Boolean,json:{write:!0}})],t.prototype,"cacheHint",void 0),e([i({type:Number,json:{write:{overridePolicy:r=>({enabled:r>0})}}})],t.prototype,"distance",void 0),e([i({types:c,json:{read:v,write:!0}})],t.prototype,"geometry",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"geometryPrecision",void 0),e([i({type:Number,json:{write:!0}})],t.prototype,"maxAllowableOffset",void 0),e([i({type:Number,json:{read:{source:"resultRecordCount"}}})],t.prototype,"num",void 0),e([i({json:{write:!0}})],t.prototype,"objectIds",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"orderByFields",void 0),e([i({type:[String],json:{write:!0}})],t.prototype,"outFields",void 0),e([i({type:m,json:{read:{source:"outSR"},write:{target:"outSR"}}})],t.prototype,"outSpatialReference",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"resultType",void 0),e([i({json:{write:!0}})],t.prototype,"returnGeometry",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnM",void 0),e([i({type:Boolean,json:{write:{overridePolicy:r=>({enabled:r})}}})],t.prototype,"returnZ",void 0),e([i({type:Number,json:{read:{source:"resultOffset"}}})],t.prototype,"start",void 0),e([p("start"),p("num")],t.prototype,"writeStart",null),e([i({type:String,json:{read:{source:"spatialRel",reader:a.read},write:{target:"spatialRel",writer:a.write}}})],t.prototype,"spatialRelationship",void 0),e([i({type:j,json:{write:!0}})],t.prototype,"timeExtent",void 0),e([i({type:R,json:{write:!0}})],t.prototype,"topFilter",void 0),e([i({type:String,json:{read:d.read,write:{writer:d.write,overridePolicy(r){return{enabled:r!=null&&this.distance!=null&&this.distance>0}}}}})],t.prototype,"units",void 0),e([i({type:String,json:{write:!0}})],t.prototype,"where",void 0),t=n=e([u("esri.rest.support.TopFeaturesQuery")],t),t.from=w(t);const b=t;export{b as default}; diff --git a/custom-toc-highlight/assets/TurboLine-CIlsAy5m-Cxo-QeJ4.js b/custom-toc-highlight/assets/TurboLine-CIlsAy5m-C6Kc2De-.js similarity index 98% rename from custom-toc-highlight/assets/TurboLine-CIlsAy5m-Cxo-QeJ4.js rename to custom-toc-highlight/assets/TurboLine-CIlsAy5m-C6Kc2De-.js index 790d5642..e6a3f82f 100644 --- a/custom-toc-highlight/assets/TurboLine-CIlsAy5m-Cxo-QeJ4.js +++ b/custom-toc-highlight/assets/TurboLine-CIlsAy5m-C6Kc2De-.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./libtess-asm-CEhQARv_-C8K5Bmv1.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./libtess-DHRgJTgB-4cw3_oA4.js"])))=>i.map(i=>d[i]); -import{_ as wt}from"./main-ugzBrWNm.js";import{K as bt,bw as pt}from"./story-BfX8CRfG.js";import{i as S,t as D}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{d as Rt}from"./definitions-DJSdSb77-DkoRHaVx.js";const Mt=128e3;let dt=null,gt=null;async function It(){return dt||(dt=Ut()),dt}async function Ut(){gt=await(bt("esri-csp-restrictions")?await wt(()=>import("./libtess-asm-CEhQARv_-C8K5Bmv1.js"),__vite__mapDeps([0,1]),import.meta.url).then(r=>r.l):await wt(()=>import("./libtess-DHRgJTgB-4cw3_oA4.js"),__vite__mapDeps([2,1]),import.meta.url).then(r=>r.l)).default({locateFile:r=>pt(`esri/core/libs/libtess/${r}`)})}function Pt(r,i){const x=Math.max(r.length,Mt);return gt.triangulate(r,i,x)}function Vt(r,i){return r.x===i.x&&r.y===i.y}function kt(r){if(!r)return;const i=r.length;if(i<=1)return;let x=0;for(let f=1;ff){W=!0;const t=(f-E)/T;T=f-E,q=(1-t)*z+t*q,Q=(1-t)*F+t*Q,--j}const o=this._writeVertex(z,F,0,0,b,v,v,-b,0,-1,E),n=this._writeVertex(z,F,0,0,b,v,-v,b,0,1,E);E+=T;const G=this._writeVertex(q,Q,0,0,b,v,v,-b,0,-1,E),e=this._writeVertex(q,Q,0,0,b,v,-v,b,0,1,E);this._writeTriangle(o,n,G),this._writeTriangle(n,G,e),z=q,F=Q}}_tessellate(i,x){const f=i[0],E=i[i.length-1],W=Vt(f,E),z=W?3:2;if(i.length{const O=Nt(o,n,_,c,H,g,R,yt,L,A,h);return u>=0&&l>=0&&O>=0&&Et(u,l,O),u=l,l=O,O};W&&(T=i[i.length-2],t.x=E.x-T.x,t.y=E.y-T.y,C=vt(t),t.x/=C,t.y/=C);let Z=!1;for(let R=0;R_t&&(Z=!0)),Z){const s=(_t-h)/Y;Y=_t-h,T={x:(1-s)*T.x+s*i[R].x,y:(1-s)*T.y+s*i[R].y},--R}else T=i[R];o=T.x,n=T.y;const yt=R<=0&&!Z,H=R===i.length-1;if(yt||(h+=Y),G=H?W?i[1]:null:i[R+1],G?(t.x=G.x-o,t.y=G.y-n,C=vt(t),t.x/=C,t.y/=C):(t.x=void 0,t.y=void 0),!W){if(yt){p(y,t),_=y.x,c=y.y,B===S.SQUARE&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,0,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,0,1)),B===S.ROUND&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,-1,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,-1,1)),B!==S.ROUND&&B!==S.BUTT||(d(-t.y,t.x,t.x,t.y,0,-1),d(t.y,-t.x,t.x,t.y,0,1));continue}if(H){k(y,e),_=y.x,c=y.y,B!==S.ROUND&&B!==S.BUTT||(d(e.y,-e.x,-e.x,-e.y,0,-1),d(-e.y,e.x,-e.x,-e.y,0,1)),B===S.SQUARE&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,0,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,0,1)),B===S.ROUND&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,1,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,1,1));continue}}let g,L,A=-Bt(e,t);if(Math.abs(A)<.01)mt(e,t)>0?(y.x=e.x,y.y=e.y,A=1,g=Number.MAX_VALUE,L=!0):(p(y,t),A=1,g=1,L=!1);else{y.x=(e.x+t.x)/A,y.y=(e.y+t.y)/A,g=vt(y);const s=(g-1)*b*F;L=g>4||s>Y&&s>C}_=y.x,c=y.y;let O=j;switch(j){case D.BEVEL:g<1.05&&(O=D.MITER);break;case D.ROUND:gq&&(O=D.BEVEL)}switch(O){case D.MITER:if(d(y.x,y.y,-e.x,-e.y,0,-1),d(-y.x,-y.y,-e.x,-e.y,0,1),H)break;if(v){const s=Z?0:h;u=this._writeVertex(o,n,_,c,t.x,t.y,y.x,y.y,0,-1,s),l=this._writeVertex(o,n,_,c,t.x,t.y,-y.x,-y.y,0,1,s)}break;case D.BEVEL:{const s=A<0;let m,V,K,M;if(s){const a=u;u=l,l=a,m=xt,V=st}else m=st,V=xt;if(L)K=s?p(this._innerPrev,e):k(this._innerPrev,e),M=s?k(this._innerNext,t):p(this._innerNext,t);else{const a=s?ft(this._inner,y):Tt(this._inner,y);K=a,M=a}const U=s?k(this._bevelStart,e):p(this._bevelStart,e);d(K.x,K.y,-e.x,-e.y,m.x,m.y);const nt=d(U.x,U.y,-e.x,-e.y,V.x,V.y);if(H)break;const I=s?p(this._bevelEnd,t):k(this._bevelEnd,t);if(L){const a=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);u=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h),this._writeTriangle(nt,a,l)}else{if(v){const a=this._bevelMiddle;a.x=(U.x+I.x)/2,a.y=(U.y+I.y)/2,et(w,a,-e.x,-e.y),d(a.x,a.y,-e.x,-e.y,w.x,w.y),et(w,a,t.x,t.y),u=this._writeVertex(o,n,_,c,t.x,t.y,a.x,a.y,w.x,w.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h)}else{const a=u;u=l,l=a}d(I.x,I.y,t.x,t.y,V.x,V.y)}if(s){const a=u;u=l,l=a}break}case D.ROUND:{const s=A<0;let m,V;if(s){const N=u;u=l,l=N,m=xt,V=st}else m=st,V=xt;const K=s?ft(this._inner,y):Tt(this._inner,y);let M,U;L?(M=s?p(this._innerPrev,e):k(this._innerPrev,e),U=s?k(this._innerNext,t):p(this._innerNext,t)):(M=K,U=K);const nt=s?k(this._roundStart,e):p(this._roundStart,e),I=s?p(this._roundEnd,t):k(this._roundEnd,t),a=d(M.x,M.y,-e.x,-e.y,m.x,m.y),ot=d(nt.x,nt.y,-e.x,-e.y,V.x,V.y);if(H)break;const X=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);L||this._writeTriangle(u,l,X);const P=ft(this._outer,K),J=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h);let $,tt;const lt=g>2;if(lt){let N;g!==Number.MAX_VALUE?(P.x/=g,P.y/=g,N=mt(e,P),N=(g*(N*N-1)+1)/N):N=-1,$=s?k(this._startBreak,e):p(this._startBreak,e),$.x+=e.x*N,$.y+=e.y*N,tt=s?p(this._endBreak,t):k(this._endBreak,t),tt.x+=t.x*N,tt.y+=t.y*N}et(w,P,-e.x,-e.y);const ht=this._writeVertex(o,n,_,c,-e.x,-e.y,P.x,P.y,w.x,w.y,h);et(w,P,t.x,t.y);const ct=v?this._writeVertex(o,n,_,c,t.x,t.y,P.x,P.y,w.x,w.y,h):ht,ut=X,at=v?this._writeVertex(o,n,_,c,t.x,t.y,0,0,0,0,h):X;let it=-1,rt=-1;if(lt&&(et(w,$,-e.x,-e.y),it=this._writeVertex(o,n,_,c,-e.x,-e.y,$.x,$.y,w.x,w.y,h),et(w,tt,t.x,t.y),rt=this._writeVertex(o,n,_,c,t.x,t.y,tt.x,tt.y,w.x,w.y,h)),v?lt?(this._writeTriangle(ut,ot,it),this._writeTriangle(ut,it,ht),this._writeTriangle(at,ct,rt),this._writeTriangle(at,rt,J)):(this._writeTriangle(ut,ot,ht),this._writeTriangle(at,ct,J)):lt?(this._writeTriangle(X,ot,it),this._writeTriangle(X,it,rt),this._writeTriangle(X,rt,J)):(this._writeTriangle(X,ot,ht),this._writeTriangle(X,ct,J)),L?(u=this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h),l=J):(u=v?this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h):a,this._writeTriangle(u,at,J),l=J),s){const N=u;u=l,l=N}break}}}}}export{St as D,It as M,Pt as k}; +import{_ as wt}from"./main-QGPoLsvl.js";import{K as bt,bw as pt}from"./story-Doly9N9p.js";import{i as S,t as D}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{d as Rt}from"./definitions-DJSdSb77-DkoRHaVx.js";const Mt=128e3;let dt=null,gt=null;async function It(){return dt||(dt=Ut()),dt}async function Ut(){gt=await(bt("esri-csp-restrictions")?await wt(()=>import("./libtess-asm-CEhQARv_-C8K5Bmv1.js"),__vite__mapDeps([0,1]),import.meta.url).then(r=>r.l):await wt(()=>import("./libtess-DHRgJTgB-4cw3_oA4.js"),__vite__mapDeps([2,1]),import.meta.url).then(r=>r.l)).default({locateFile:r=>pt(`esri/core/libs/libtess/${r}`)})}function Pt(r,i){const x=Math.max(r.length,Mt);return gt.triangulate(r,i,x)}function Vt(r,i){return r.x===i.x&&r.y===i.y}function kt(r){if(!r)return;const i=r.length;if(i<=1)return;let x=0;for(let f=1;ff){W=!0;const t=(f-E)/T;T=f-E,q=(1-t)*z+t*q,Q=(1-t)*F+t*Q,--j}const o=this._writeVertex(z,F,0,0,b,v,v,-b,0,-1,E),n=this._writeVertex(z,F,0,0,b,v,-v,b,0,1,E);E+=T;const G=this._writeVertex(q,Q,0,0,b,v,v,-b,0,-1,E),e=this._writeVertex(q,Q,0,0,b,v,-v,b,0,1,E);this._writeTriangle(o,n,G),this._writeTriangle(n,G,e),z=q,F=Q}}_tessellate(i,x){const f=i[0],E=i[i.length-1],W=Vt(f,E),z=W?3:2;if(i.length{const O=Nt(o,n,_,c,H,g,R,yt,L,A,h);return u>=0&&l>=0&&O>=0&&Et(u,l,O),u=l,l=O,O};W&&(T=i[i.length-2],t.x=E.x-T.x,t.y=E.y-T.y,C=vt(t),t.x/=C,t.y/=C);let Z=!1;for(let R=0;R_t&&(Z=!0)),Z){const s=(_t-h)/Y;Y=_t-h,T={x:(1-s)*T.x+s*i[R].x,y:(1-s)*T.y+s*i[R].y},--R}else T=i[R];o=T.x,n=T.y;const yt=R<=0&&!Z,H=R===i.length-1;if(yt||(h+=Y),G=H?W?i[1]:null:i[R+1],G?(t.x=G.x-o,t.y=G.y-n,C=vt(t),t.x/=C,t.y/=C):(t.x=void 0,t.y=void 0),!W){if(yt){p(y,t),_=y.x,c=y.y,B===S.SQUARE&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,0,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,0,1)),B===S.ROUND&&(d(-t.y-t.x,t.x-t.y,t.x,t.y,-1,-1),d(t.y-t.x,-t.x-t.y,t.x,t.y,-1,1)),B!==S.ROUND&&B!==S.BUTT||(d(-t.y,t.x,t.x,t.y,0,-1),d(t.y,-t.x,t.x,t.y,0,1));continue}if(H){k(y,e),_=y.x,c=y.y,B!==S.ROUND&&B!==S.BUTT||(d(e.y,-e.x,-e.x,-e.y,0,-1),d(-e.y,e.x,-e.x,-e.y,0,1)),B===S.SQUARE&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,0,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,0,1)),B===S.ROUND&&(d(e.y-e.x,-e.x-e.y,-e.x,-e.y,1,-1),d(-e.y-e.x,e.x-e.y,-e.x,-e.y,1,1));continue}}let g,L,A=-Bt(e,t);if(Math.abs(A)<.01)mt(e,t)>0?(y.x=e.x,y.y=e.y,A=1,g=Number.MAX_VALUE,L=!0):(p(y,t),A=1,g=1,L=!1);else{y.x=(e.x+t.x)/A,y.y=(e.y+t.y)/A,g=vt(y);const s=(g-1)*b*F;L=g>4||s>Y&&s>C}_=y.x,c=y.y;let O=j;switch(j){case D.BEVEL:g<1.05&&(O=D.MITER);break;case D.ROUND:gq&&(O=D.BEVEL)}switch(O){case D.MITER:if(d(y.x,y.y,-e.x,-e.y,0,-1),d(-y.x,-y.y,-e.x,-e.y,0,1),H)break;if(v){const s=Z?0:h;u=this._writeVertex(o,n,_,c,t.x,t.y,y.x,y.y,0,-1,s),l=this._writeVertex(o,n,_,c,t.x,t.y,-y.x,-y.y,0,1,s)}break;case D.BEVEL:{const s=A<0;let m,V,K,M;if(s){const a=u;u=l,l=a,m=xt,V=st}else m=st,V=xt;if(L)K=s?p(this._innerPrev,e):k(this._innerPrev,e),M=s?k(this._innerNext,t):p(this._innerNext,t);else{const a=s?ft(this._inner,y):Tt(this._inner,y);K=a,M=a}const U=s?k(this._bevelStart,e):p(this._bevelStart,e);d(K.x,K.y,-e.x,-e.y,m.x,m.y);const nt=d(U.x,U.y,-e.x,-e.y,V.x,V.y);if(H)break;const I=s?p(this._bevelEnd,t):k(this._bevelEnd,t);if(L){const a=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);u=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h),this._writeTriangle(nt,a,l)}else{if(v){const a=this._bevelMiddle;a.x=(U.x+I.x)/2,a.y=(U.y+I.y)/2,et(w,a,-e.x,-e.y),d(a.x,a.y,-e.x,-e.y,w.x,w.y),et(w,a,t.x,t.y),u=this._writeVertex(o,n,_,c,t.x,t.y,a.x,a.y,w.x,w.y,h),l=this._writeVertex(o,n,_,c,t.x,t.y,M.x,M.y,m.x,m.y,h)}else{const a=u;u=l,l=a}d(I.x,I.y,t.x,t.y,V.x,V.y)}if(s){const a=u;u=l,l=a}break}case D.ROUND:{const s=A<0;let m,V;if(s){const N=u;u=l,l=N,m=xt,V=st}else m=st,V=xt;const K=s?ft(this._inner,y):Tt(this._inner,y);let M,U;L?(M=s?p(this._innerPrev,e):k(this._innerPrev,e),U=s?k(this._innerNext,t):p(this._innerNext,t)):(M=K,U=K);const nt=s?k(this._roundStart,e):p(this._roundStart,e),I=s?p(this._roundEnd,t):k(this._roundEnd,t),a=d(M.x,M.y,-e.x,-e.y,m.x,m.y),ot=d(nt.x,nt.y,-e.x,-e.y,V.x,V.y);if(H)break;const X=this._writeVertex(o,n,_,c,-e.x,-e.y,0,0,0,0,h);L||this._writeTriangle(u,l,X);const P=ft(this._outer,K),J=this._writeVertex(o,n,_,c,t.x,t.y,I.x,I.y,V.x,V.y,h);let $,tt;const lt=g>2;if(lt){let N;g!==Number.MAX_VALUE?(P.x/=g,P.y/=g,N=mt(e,P),N=(g*(N*N-1)+1)/N):N=-1,$=s?k(this._startBreak,e):p(this._startBreak,e),$.x+=e.x*N,$.y+=e.y*N,tt=s?p(this._endBreak,t):k(this._endBreak,t),tt.x+=t.x*N,tt.y+=t.y*N}et(w,P,-e.x,-e.y);const ht=this._writeVertex(o,n,_,c,-e.x,-e.y,P.x,P.y,w.x,w.y,h);et(w,P,t.x,t.y);const ct=v?this._writeVertex(o,n,_,c,t.x,t.y,P.x,P.y,w.x,w.y,h):ht,ut=X,at=v?this._writeVertex(o,n,_,c,t.x,t.y,0,0,0,0,h):X;let it=-1,rt=-1;if(lt&&(et(w,$,-e.x,-e.y),it=this._writeVertex(o,n,_,c,-e.x,-e.y,$.x,$.y,w.x,w.y,h),et(w,tt,t.x,t.y),rt=this._writeVertex(o,n,_,c,t.x,t.y,tt.x,tt.y,w.x,w.y,h)),v?lt?(this._writeTriangle(ut,ot,it),this._writeTriangle(ut,it,ht),this._writeTriangle(at,ct,rt),this._writeTriangle(at,rt,J)):(this._writeTriangle(ut,ot,ht),this._writeTriangle(at,ct,J)):lt?(this._writeTriangle(X,ot,it),this._writeTriangle(X,it,rt),this._writeTriangle(X,rt,J)):(this._writeTriangle(X,ot,ht),this._writeTriangle(X,ct,J)),L?(u=this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h),l=J):(u=v?this._writeVertex(o,n,_,c,t.x,t.y,U.x,U.y,m.x,m.y,h):a,this._writeTriangle(u,at,J),l=J),s){const N=u;u=l,l=N}break}}}}}export{St as D,It as M,Pt as k}; diff --git a/custom-toc-highlight/assets/UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js b/custom-toc-highlight/assets/UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js similarity index 99% rename from custom-toc-highlight/assets/UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js rename to custom-toc-highlight/assets/UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js index e444ff1b..45f8103c 100644 --- a/custom-toc-highlight/assets/UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js +++ b/custom-toc-highlight/assets/UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js @@ -1 +1 @@ -import{v as s,S as l,i as h,aK as x,ad as U,a0 as I,bB as et,aa as be,e as g,ac as H,dN as tt,dO as St,dP as me,dQ as Ae,ct as xt,dR as st,dS as It,dM as le,dT as _t,bG as it,a1 as V,dU as Ce,dV as lt,P as f,dW as fe,d7 as Re,dX as T,bz as rt,aq as zt,o as at,r as xe,a4 as jt,dY as Ft,dZ as qt,ah as we,bC as Et,bD as kt,j as Ot,b0 as Tt}from"./story-BfX8CRfG.js";import{h as Ut,w as nt}from"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import{P as Bt}from"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import{g as Mt,v as Dt}from"./colorRamps-q0bZVhs2-DQZn2xZS.js";import{r as W,a as Nt,u as $t,i as Ge}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{viewScaleRE as Ct}from"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import{g as Rt}from"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";var Ie;let Q=Ie=class extends g{constructor(e){super(e),this.minValue=0,this.maxValue=0}clone(){return new Ie({minValue:this.minValue,maxValue:this.maxValue})}};s([l({type:Number,json:{write:!0}})],Q.prototype,"minValue",void 0),s([l({type:Number,json:{write:!0}})],Q.prototype,"maxValue",void 0),Q=Ie=s([h("esri.renderers.support.AuthoringInfoClassBreakInfo")],Q);var _e;let O=_e=class extends g{constructor(e){super(e),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=new Array}clone(){return new _e({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:f(this.classBreakInfos)})}};s([l({type:String,json:{write:!0}})],O.prototype,"field",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"normalizationField",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"label",void 0),s([l({type:[Q],json:{write:!0}})],O.prototype,"classBreakInfos",void 0),O=_e=s([h("esri.renderers.support.AuthoringInfoFieldInfo")],O);var ze;let A=ze=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null}clone(){return new ze({label:this.label,value:this.value,size:this.size})}};s([l({type:String,json:{write:!0}})],A.prototype,"label",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"value",void 0),A=ze=s([h("esri.renderers.support.AuthoringInfoSizeStop")],A);const At=A;var je;const re=new x({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),ae=new x({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),Le={key:e=>typeof e=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},He=["high-to-low","above-and-below","centered-on","extremes"],Pe=[...new Set(["high-to-low","above-and-below","centered-on","extremes","above","below","high-to-low","above-and-below","above","below","reference-size"])],Je=["seconds","minutes","hours","days","months","years"],Gt=["circle","diamond","hexagon-flat","hexagon-pointy","square"];let v=je=class extends g{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}get normalizationField(){return this.theme==="reference-size"?this._get("normalizationField"):null}set normalizationField(e){this._set("normalizationField",e)}get referenceSizeScale(){return this.theme==="reference-size"?this._get("referenceSizeScale"):null}set referenceSizeScale(e){this._set("referenceSizeScale",e)}get referenceSizeSymbolStyle(){return this.theme==="reference-size"?this._get("referenceSizeSymbolStyle"):null}set referenceSizeSymbolStyle(e){this._set("referenceSizeSymbolStyle",e)}castStartTime(e){return typeof e=="string"||typeof e=="number"?e:null}get sizeStops(){return this.theme==="reference-size"?this._get("sizeStops"):null}set sizeStops(e){this._set("sizeStops",e)}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 je({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,normalizationField:this.normalizationField,referenceSizeScale:this.referenceSizeScale,referenceSizeSymbolStyle:this.referenceSizeSymbolStyle,sizeStops:f(this.sizeStops),startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};s([l({types:Le,json:{write:!0}})],v.prototype,"endTime",void 0),s([U("endTime")],v.prototype,"castEndTime",null),s([l({type:String,json:{write:!0}})],v.prototype,"field",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"minSliderValue",void 0),s([l({type:String,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"normalizationField",null),s([l({type:Number,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeScale",null),s([l({type:Gt,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeSymbolStyle",null),s([l({types:Le,json:{write:!0}})],v.prototype,"startTime",void 0),s([U("startTime")],v.prototype,"castStartTime",null),s([l({type:[At],json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"sizeStops",null),s([l({type:re.apiValues,value:null,json:{type:re.jsonValues,read:re.read,write:re.write}})],v.prototype,"style",null),s([l({type:Pe,value:null,json:{type:Pe,origins:{"web-scene":{type:He,write:{writer:(e,t)=>{He.includes(e)&&(t.theme=e)}}}},write:!0}})],v.prototype,"theme",null),s([l({type:ae.apiValues,json:{type:ae.jsonValues,read:ae.read,write:ae.write}})],v.prototype,"type",void 0),s([l({type:Je,json:{type:Je,write:!0}})],v.prototype,"units",void 0),v=je=s([h("esri.renderers.support.AuthoringInfoVisualVariable")],v);const Lt=v;var Fe;const B=new x({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),ne=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),Ze=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),We=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers"],Ht=["high-to-low","above-and-below","above","below"],Pt=["flow-line","wave-front"],Jt=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let d=Fe=class extends g{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?Dt(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 Fe({classificationMethod:this.classificationMethod,colorRamp:f(this.colorRamp),fadeRatio:f(this.fadeRatio),fields:this.fields?.slice(),field1:f(this.field1),field2:f(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})}};s([l({type:B.apiValues,value:null,json:{type:B.jsonValues,read:B.read,write:B.write,origins:{"web-document":{default:"manual",type:B.jsonValues,read:B.read,write:B.write}}}})],d.prototype,"classificationMethod",null),s([l({types:Mt,json:{write:!0}})],d.prototype,"colorRamp",void 0),s([I("colorRamp")],d.prototype,"readColorRamp",null),s([l({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"fadeRatio",void 0),s([l({type:[String],value:null,json:{write:!0}})],d.prototype,"fields",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field1",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field2",null),s([l({type:Pt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"flowTheme",null),s([l({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],d.prototype,"focus",null),s([l({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],d.prototype,"isAutoGenerated",void 0),s([l({type:Number,value:null,json:{type:et,write:!0}})],d.prototype,"numClasses",null),s([l({type:We,json:{type:We,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],d.prototype,"lengthUnit",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"minSliderValue",void 0),s([l({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"statistics",null),s([l({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],d.prototype,"standardDeviationInterval",null),s([l({type:ne.apiValues,value:null,json:{type:ne.jsonValues,read:ne.read,write:ne.write,origins:{"web-scene":{type:Ze.jsonValues,write:{writer:Ze.write,overridePolicy:e=>({enabled:e!=="flow"})}}}}})],d.prototype,"type",null),s([l({type:[Lt],json:{write:!0}})],d.prototype,"visualVariables",void 0),s([l({type:Jt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateSymbolStyle",null),s([l({type:Ht,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateTheme",null),d=Fe=s([h("esri.renderers.support.AuthoringInfo")],d);const Zt=d,Ve=new x({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let K=class extends g{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)}};s([l({type:Zt,json:{write:!0}})],K.prototype,"authoringInfo",void 0),s([l({type:Ve.apiValues,readOnly:!0,json:{type:Ve.jsonValues,read:!1,write:{writer:Ve.write,ignoreOrigin:!0}}})],K.prototype,"type",void 0),K=s([h("esri.renderers.Renderer")],K);const ot=K;function Wt(e){return e.match(Qt)?.[1]?.replace(/\\'/g,"'")??null}const Qt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;let X=class extends be(g){constructor(){super(...arguments),this.showLegend=null,this.title=null}};s([l({type:Boolean,json:{write:!0}})],X.prototype,"showLegend",void 0),s([l({type:String,json:{write:!0}})],X.prototype,"title",void 0),X=s([h("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],X);const ut=X,Se=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let S=class extends g{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"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};s([l()],S.prototype,"index",void 0),s([l({type:Se.apiValues,readOnly:!0,json:{read:Se.read,write:Se.write}})],S.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"field",void 0),s([U("field")],S.prototype,"castField",null),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpression",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpressionTitle",void 0),s([l({readOnly:!0})],S.prototype,"arcadeRequired",null),s([l({type:ut,json:{write:!0}})],S.prototype,"legendOptions",void 0),S=s([h("esri.renderers.visualVariables.VisualVariable")],S);const se=S;var qe;let M=qe=class extends se{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 qe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],M.prototype,"cache",null),s([l({type:["color"],json:{type:["colorInfo"]}})],M.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],M.prototype,"normalizationField",void 0),s([l({type:[Ut],json:{write:!0}})],M.prototype,"stops",null),M=qe=s([h("esri.renderers.visualVariables.ColorVariable")],M);const pt=M;var Ee;let F=Ee=class extends g{constructor(e){super(e),this.label=null,this.opacity=null,this.value=null}readOpacity(e,t){return Et(t.transparency)}writeOpacity(e,t,i){t[i]=kt(e)}clone(){return new Ee({label:this.label,opacity:this.opacity,value:this.value})}};s([l({type:String,json:{write:!0}})],F.prototype,"label",void 0),s([l({type:Number,json:{type:et,write:{target:"transparency"}}})],F.prototype,"opacity",void 0),s([I("opacity",["transparency"])],F.prototype,"readOpacity",null),s([H("opacity")],F.prototype,"writeOpacity",null),s([l({type:Number,json:{write:!0}})],F.prototype,"value",void 0),F=Ee=s([h("esri.renderers.visualVariables.support.OpacityStop")],F);const Kt=F;var ke;let D=ke=class extends se{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 ke({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],D.prototype,"cache",null),s([l({type:["opacity"],json:{type:["transparencyInfo"]}})],D.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],D.prototype,"normalizationField",void 0),s([l({type:[Kt],json:{write:!0}})],D.prototype,"stops",null),D=ke=s([h("esri.renderers.visualVariables.OpacityVariable")],D);const ht=D;var Oe;let N=Oe=class extends se{constructor(e){super(e),this.axis=null,this.type="rotation",this.rotationType="geographic"}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}clone(){return new Oe({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions?.clone()})}};s([l({readOnly:!0})],N.prototype,"cache",null),s([l({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],N.prototype,"axis",void 0),s([l({type:["rotation"],json:{type:["rotationInfo"]}})],N.prototype,"type",void 0),s([l({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],N.prototype,"rotationType",void 0),N=Oe=s([h("esri.renderers.visualVariables.RotationVariable")],N);const dt=N;function Xt(e){return tt(e)}var Te;let q=Te=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null,this.useMinValue=null,this.useMaxValue=null}clone(){return new Te({label:this.label,size:this.size,value:this.value,useMaxValue:this.useMaxValue,useMinValue:this.useMinValue})}};s([l({type:String,json:{write:!0}})],q.prototype,"label",void 0),s([l({type:Number,cast:tt,json:{write:!0}})],q.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],q.prototype,"value",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMinValue",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMaxValue",void 0),q=Te=s([h("esri.renderers.visualVariables.support.SizeStop")],q);const Yt=q;let pe=class extends ut{constructor(){super(...arguments),this.customValues=null}};s([l({type:[Number],json:{write:!0}})],pe.prototype,"customValues",void 0),pe=s([h("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],pe);const es=pe;var Ue;const oe=new x({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),Be=new x({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"});function Qe(e){if(e!=null)return typeof e=="string"||typeof e=="number"?Xt(e):e.type==="size"?W(e)?e:(delete(e={...e}).type,new o(e)):void 0}function Ke(e,t,i){if(typeof e!="object")return e;const r=new o;return r.read(e,i),r}let o=Ue=class extends se{constructor(e){super(e),this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:this.valueExpression!=null&&Ct.test(this.valueExpression)}}set index(e){W(this.maxSize)&&(this.maxSize.index=`visualVariables[${e}].maxSize`),W(this.minSize)&&(this.minSize.index=`visualVariables[${e}].minSize`),this._set("index",e)}get inputValueType(){return Nt(this)}set maxDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxDataValue when stops is not null."),e=null),this._set("maxDataValue",e)}set maxSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxSize when stops is not null."),e=null),this._set("maxSize",e)}castMaxSize(e){return Qe(e)}readMaxSize(e,t,i){return Ke(e,t,i)}set minDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minDataValue when stops is not null."),e=null),this._set("minDataValue",e)}set minSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minSize when stops is not null."),e=null),this._set("minSize",e)}castMinSize(e){return Qe(e)}readMinSize(e,t,i){return Ke(e,t,i)}get arcadeRequired(){return!!this.valueExpression||this.minSize!=null&&typeof this.minSize=="object"&&this.minSize.arcadeRequired||this.maxSize!=null&&typeof this.maxSize=="object"&&this.maxSize.arcadeRequired}set stops(e){this.minDataValue==null&&this.maxDataValue==null&&this.minSize==null&&this.maxSize==null?e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value):e&&(V.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return $t(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,i,r){if(e==="$view.scale"){if(r?.messages){const a=this.index,n=typeof a=="string"?a:`visualVariables[${a}]`;r.messages.push(new at("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:r}))}}else t[i]=e}readValueUnit(e){return e?Be.read(e):null}clone(){return new Ue({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:W(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:W(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops?.map(e=>e.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions?.clone()})}flipSizes(){if(this.transformationType===Ge.ClampedLinear){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if(this.transformationType===Ge.Stops){const e=this.stops;if(!e)return this;const t=e.map(r=>r.size).reverse(),i=e.length;for(let r=0;re.value||0)}};s([l({readOnly:!0})],o.prototype,"cache",null),s([l({type:oe.apiValues,json:{type:oe.jsonValues,origins:{"web-map":{read:!1}},read:oe.read,write:oe.write}})],o.prototype,"axis",void 0),s([l()],o.prototype,"index",null),s([l({type:String,readOnly:!0})],o.prototype,"inputValueType",null),s([l({type:es,json:{write:!0}})],o.prototype,"legendOptions",void 0),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxSize",null),s([U("maxSize")],o.prototype,"castMaxSize",null),s([I("maxSize")],o.prototype,"readMaxSize",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minSize",null),s([U("minSize")],o.prototype,"castMinSize",null),s([I("minSize")],o.prototype,"readMinSize",null),s([l({type:String,json:{write:!0}})],o.prototype,"normalizationField",void 0),s([l({readOnly:!0})],o.prototype,"arcadeRequired",null),s([l({type:String})],o.prototype,"scaleBy",void 0),s([l({type:[Yt],value:null,json:{write:!0}})],o.prototype,"stops",null),s([l({type:["outline"],json:{write:!0}})],o.prototype,"target",void 0),s([l({type:String,readOnly:!0})],o.prototype,"transformationType",null),s([l({type:["size"],json:{type:["sizeInfo"]}})],o.prototype,"type",void 0),s([l({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],o.prototype,"useSymbolValue",void 0),s([l({type:String,json:{write:!0}})],o.prototype,"valueExpression",void 0),s([I("valueExpression",["valueExpression","expression"])],o.prototype,"readValueExpression",null),s([H("web-scene","valueExpression")],o.prototype,"writeValueExpressionWebScene",null),s([l({type:["radius","diameter","area","width","distance"],json:{write:!0}})],o.prototype,"valueRepresentation",void 0),s([l({type:Be.apiValues,json:{write:Be.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],o.prototype,"valueUnit",void 0),s([I("valueUnit")],o.prototype,"readValueUnit",null),o=Ue=s([h("esri.renderers.visualVariables.SizeVariable")],o);const ct=o,ts={color:pt,size:ct,opacity:ht,rotation:dt},ss=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),is=/^\[([^\]]+)\]$/i;let he=class extends Ot{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),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 r=null;return r=t.target===i.target?0:t.target?1:-1,r});for(let t=0;t{const c=ss.read(y.type),b=ts[c];b||(V.getLogger(this).warn(`Unknown variable type: ${c}`),i?.messages&&i.messages.push(new Tt("visual-variable:unsupported",`visualVariable of type '${c}' is not supported`,{definition:y,context:i})));const w=new b;return w.read(y,i),w})}writeVariables(e,t){const i=[];for(const r of e){const a=r.toJSON(t);a&&i.push(a)}return i}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};s([l()],he.prototype,"visualVariables",null),he=s([h("esri.renderers.visualVariables.VisualVariableFactory")],he);const ls=he,rs={base:se,key:"type",typeMap:{opacity:ht,color:pt,rotation:dt,size:ct}},yt=e=>{let t=class extends e{constructor(){super(...arguments),this._vvFactory=new ls}set visualVariables(i){this._vvFactory.visualVariables=i,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(i,r,a){return this._vvFactory.readVariables(i,r,a)}writeVisualVariables(i,r,a,n){r[a]=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,r){return i?this.getVisualVariablesForType(i,r).length>0:this.getVisualVariablesForType("size",r).length>0||this.getVisualVariablesForType("color",r).length>0||this.getVisualVariablesForType("opacity",r).length>0||this.getVisualVariablesForType("rotation",r).length>0}getVisualVariablesForType(i,r){const a=this.visualVariables;return a?a.filter(n=>n.type===i&&(typeof r=="string"?n.target===r:r!==!1||!n.target)):[]}async collectVVRequiredFields(i,r){let a=[];this.visualVariables&&(a=a.concat(this.visualVariables));for(const n of a)n&&(n.field&&T(i,r,n.field),n.normalizationField&&T(i,r,n.normalizationField),n.valueExpression&&(as(n.valueExpression,i,r)||await Re(i,r,n.valueExpression)))}};return s([l({types:[rs],value:null,json:{write:!0}})],t.prototype,"visualVariables",null),s([I("visualVariables",["visualVariables","rotationType","rotationExpression"])],t.prototype,"readVisualVariables",null),s([H("visualVariables")],t.prototype,"writeVisualVariables",null),t=s([h("esri.renderers.mixins.VisualVariablesMixin")],t),t};function as(e,t,i){const r=Wt(e);return r!=null&&(T(t,i,r),!0)}const ge={types:St,json:{write:{writer:me},origins:{"web-scene":{types:Ae,write:{writer:me},read:{reader:xt({types:Ae})}}}}},mt=st({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},ge),ft={types:{base:It,key:"type",typeMap:{"simple-fill":le.typeMap["simple-fill"],"picture-fill":le.typeMap["picture-fill"],"polygon-3d":le.typeMap["polygon-3d"],cim:le.typeMap.cim}},json:{write:{writer:me},origins:{"web-scene":{type:_t,write:{writer:me}}}}},de={cast:e=>e==null||typeof e=="string"||typeof e=="number"?e:`${e}`,json:{type:String,write:{writer:(e,t)=>{t.value=e?.toString()}}}};var Me;let E=Me=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new Me({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?.clone()??null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};s([l({type:String,json:{write:!0}})],E.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],E.prototype,"label",void 0),s([l({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],E.prototype,"minValue",void 0),s([l({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],E.prototype,"maxValue",void 0),s([l(mt)],E.prototype,"symbol",void 0),E=Me=s([h("esri.renderers.support.ClassBreakInfo")],E);const ve=E;var De;const vt="log",ce="percent-of-total",ye="field",ue=new x({esriNormalizeByLog:vt,esriNormalizeByPercentOfTotal:ce,esriNormalizeByField:ye}),ns=it(ve);let m=De=class extends yt(ot){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 r=t.minValue;return e.map(a=>{const n=new ve;return n.read(a,i),n.minValue==null&&(n.minValue=r),n.maxValue==null&&(n.maxValue=n.minValue),r=n.maxValue,n})}writeClassBreakInfos(e,t,i,r){const a=e.map(n=>n.write({},r));this._areClassBreaksConsecutive()&&a.forEach(n=>delete n.classMinValue),t[i]=a}castField(e){return e==null?e:typeof e=="function"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(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&&ye||i&&ce||null,t&&i&&V.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==ye&&e!==ce||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,t,i){let r=null;r=typeof e=="number"?new ve({minValue:e,maxValue:t,symbol:lt(i)}):ns(f(e)),this.classBreakInfos.push(r),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(e,t){const i=this.classBreakInfos.length;for(let r=0;r-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(e,t){let i=t;if(this.valueExpression&&t?.arcade==null){const a=await fe(),{arcadeUtils:n}=a;n.hasGeometryOperations(this.valueExpression)&&await n.enableGeometryOperations(),i={...i,arcade:a}}const r=this.getBreakIndex(e,i);return r>-1?this.classBreakInfos[r].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?.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((r,a)=>r+a.getMeshHash(),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new De({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:f(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo)})}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(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{},{valueExpression:y}=this;let c=this._compiledValueExpression.valueExpression===y?this._compiledValueExpression.compiledFunction:null;const b=n.arcadeUtils;if(!c){const _=b.createSyntaxTree(y);c=b.createFunction(_),this._compiledValueExpression.compiledFunction=c}this._compiledValueExpression.valueExpression=y;const w=b.executeFunction(c,b.createExecContext(e,b.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._getBreakIndexfromInfos(w)}_getBreakIndexForField(e){const t=this.field,i=e.attributes,r=this.normalizationType;let a=parseFloat(i[t]);if(r){const n=this.normalizationTotal,u=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if(r===vt)a=Math.log(a)*Math.LOG10E;else if(r!==ce||n==null||isNaN(n)){if(r===ye&&!isNaN(u)){if(isNaN(a)||isNaN(u))return-1;a/=u}}else a=a/n*100}return this._getBreakIndexfromInfos(a)}_getBreakIndexfromInfos(e){const t=this.isMaxInclusive;if(e!=null&&typeof e=="number"&&!isNaN(e))for(let i=0;inew L({value:i})):t==="object"?e[0]instanceof L?e:e.map(i=>new L(i)):null}};s([l({type:String,json:{write:!0}})],k.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],k.prototype,"label",void 0),s([l(ge)],k.prototype,"symbol",void 0),s([l({type:[L],json:{type:[[String]],read:{reader:e=>e?e.map(t=>new L({value:t[0],value2:t[1],value3:t[2]})):null},write:{writer:(e,t)=>{const i=[];for(const r of e){const a=[r.value,r.value2,r.value3].filter(zt).map(n=>n.toString());i.push(a)}t.values=i}}}})],k.prototype,"values",void 0),s([U("values")],k.prototype,"castValues",null),k=s([h("esri.renderers.support.UniqueValueClass")],k);const bt=k;let Y=class extends be(g){constructor(e){super(e),this.heading=null,this.classes=null}};s([l({type:String,json:{write:!0}})],Y.prototype,"heading",void 0),s([l({type:[bt],json:{write:!0}})],Y.prototype,"classes",void 0),Y=s([h("esri.renderers.support.UniqueValueGroup")],Y);const Ne=Y;var $e;let $=$e=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new $e({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol?.toJSON());return`${this.value}.${e}`}};s([l({type:String,json:{write:!0}})],$.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],$.prototype,"label",void 0),s([l(mt)],$.prototype,"symbol",void 0),s([l(de)],$.prototype,"value",void 0),$=$e=s([h("esri.renderers.support.UniqueValueInfo")],$);const te=$;var ee;const gt="esri.renderers.UniqueValueRenderer",j=()=>V.getLogger(gt),Xe="uvInfos-watcher",Ye="uvGroups-watcher",os=",",us=it(te);function ps(e){const{field1:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueInfos:n,valueExpression:u}=e,y=!(!t||!i);return[{classes:(n??[]).map(c=>{const{symbol:b,label:w,value:_,description:C}=c,[P,J,Z]=y?_?.toString()?.split(a||"")||[]:[_],z=[];return(t||u)&&z.push(P),i&&z.push(J),r&&z.push(Z),{symbol:b,label:w,values:[z],description:C}})}]}function R(e){return e!=null&&e!==""&&(typeof e!="string"||e.trim()!==""&&e.toLowerCase()!=="")||(e=null),e+""}let p=ee=class extends yt(ot){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,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 r=!1;const a={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let n=0;ny.value===i[n].value);u?Bt(u,i[n])?(a.changed.push({type:"complete",oldValue:u,newValue:i[n]}),r=!0):a.unchanged.push({oldValue:u,newValue:i[n]}):(a.added.push(i[n]),r=!0)}for(let n=0;nu.value===t[n].value)||(a.removed.push(t[n]),r=!0);return r?a: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:Ce(e)}writeField(e,t,i,r){typeof e=="string"?t[i]=e:r?.messages?r.messages.push(new at("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):j().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||xe.getDefault()}readStyleOrigin(e,t,i){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const r=jt(t.styleUrl,i);return Object.freeze({styleUrl:r})}}writeStyleOrigin(e,t,i,r){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=Ft(e.styleUrl,r))}set uniqueValueGroups(e){this.styleOrigin?j().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?j().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){if(this.styleOrigin)return void j().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i=typeof e=="object"?us(e):new te({value:e,symbol:lt(t)}),this.uniqueValueInfos?.push(i),this._valueInfoMap[R(i.value)]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void j().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(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=this.uniqueValueInfos?.reduce((r,a)=>r+a.getMeshHash(),"");return`${e}.${t}.${i}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new ee({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:f(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo),backgroundFillSymbol:f(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=f(this.uniqueValueInfos),i=f(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(f(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(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.field2),T(e,t,this.field3),await Promise.all(i)}populateFromStyle(){return Rt(this.styleOrigin,{portal:this.portal}).then(e=>{const t=[];return this._valueInfoMap={},e?.data&&Array.isArray(e.data.items)&&e.data.items.forEach(i=>{const r=new qt({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:i.name});this.defaultSymbol||i.name!==e.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const a=new te({value:i.name,symbol:r});t.push(a),this._valueInfoMap[R(i.name)]=a}),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&this.uniqueValueInfos?.length&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",os)}_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[R(t.value)]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(Xe);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const i of e)t.push(we(()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description}),(r,a)=>{r!==a&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,Xe)}}_watchUniqueValueGroups(){this.removeHandles(Ye);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const i of e){t.push(we(()=>({classes:i.classes}),(r,a)=>{r!==a&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const r of i.classes??[])t.push(we(()=>({symbol:r.symbol,values:r.values,label:r.label,description:r.description}),(a,n)=>{a!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,Ye)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueGroups:n,valueExpression:u}=this;if(!t&&!u)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const y=!(!t||!i);for(const c of n)for(const b of c.classes??[]){const{symbol:w,label:_,values:C,description:P}=b;for(const J of C??[]){const{value:Z,value2:z,value3:wt}=J,ie=[Z];i&&ie.push(z),r&&ie.push(wt);const Vt=y?ie.join(a||""):ie[0]??void 0;e.push(new te({symbol:w,label:_,value:Vt,description:P}))}}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:r,fieldDelimiter:a,uniqueValueInfos:n}=this;if(!t&&!r||!n.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const u=!(!t||!i),y=n.map(b=>{const{symbol:w,label:_,value:C,description:P}=b,[J,Z,z]=u?C?.toString()?.split(a||"")||[]:[C];return new bt({symbol:w,label:_,description:P,values:[new L({value:J,value2:Z,value3:z})]})}),c=[new Ne({classes:y})];e&&Object.freeze(c),this._set("uniqueValueGroups",c),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{};let y=this._cache.compiledFunc;const c=n.arcadeUtils;if(!y){const w=c.createSyntaxTree(this.valueExpression);y=c.createFunction(w),this._cache.compiledFunc=y}const b=c.executeFunction(y,c.createExecContext(e,c.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._valueInfoMap[R(b)]}_getUnqiueValueInfoForFields(e){const t=this.field,i=e.attributes;let r;if(this.field2){const a=this.field2,n=this.field3,u=[];t&&u.push(i[t]),a&&u.push(i[a]),n&&u.push(i[n]),r=u.join(this.fieldDelimiter||"")}else t&&(r=i[t]);return this._valueInfoMap[R(r)]}static fromPortalStyle(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleName:e})),i._set("portal",t?.portal||xe.getDefault());const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",a)}),r}static fromStyleUrl(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleUrl:e}));const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",a)}),r}};s([l({readOnly:!0})],p.prototype,"_cache",null),s([rt({uniqueValue:"unique-value"})],p.prototype,"type",void 0),s([l(ft)],p.prototype,"backgroundFillSymbol",void 0),s([l({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],p.prototype,"field",null),s([U("field")],p.prototype,"castField",null),s([H("field")],p.prototype,"writeField",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field2",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field3",null),s([l({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],p.prototype,"orderByClassesEnabled",void 0),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"valueExpression",null),s([l({type:String,json:{write:!0}})],p.prototype,"valueExpressionTitle",void 0),s([l({type:nt,json:{write:!0}})],p.prototype,"legendOptions",void 0),s([l({type:String,json:{write:!0}})],p.prototype,"defaultLabel",void 0),s([l(st({...ge},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],p.prototype,"defaultSymbol",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"fieldDelimiter",null),s([l({type:xe,readOnly:!0})],p.prototype,"portal",void 0),s([I("portal",["styleName"])],p.prototype,"readPortal",null),s([l({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],p.prototype,"styleOrigin",void 0),s([I("styleOrigin",["styleName","styleUrl"])],p.prototype,"readStyleOrigin",null),s([H("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],p.prototype,"writeStyleOrigin",null),s([l({type:[Ne],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,i)=>(t.uniqueValueGroups||ps(t)).map(r=>Ne.fromJSON(r,i))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueGroups",null),s([l({type:[te],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueInfos",null),p=ee=s([h(gt)],p);const gs=p;export{yt as $,mt as A,ht as B,ot as E,ct as G,ft as L,dt as M,te as P,se as a,gs as d,Zt as h,bs as o,ve as t,Yt as y}; +import{v as s,S as l,i as h,aK as x,ad as U,a0 as I,bB as et,aa as be,e as g,ac as H,dN as tt,dO as St,dP as me,dQ as Ae,ct as xt,dR as st,dS as It,dM as le,dT as _t,bG as it,a1 as V,dU as Ce,dV as lt,P as f,dW as fe,d7 as Re,dX as T,bz as rt,aq as zt,o as at,r as xe,a4 as jt,dY as Ft,dZ as qt,ah as we,bC as Et,bD as kt,j as Ot,b0 as Tt}from"./story-Doly9N9p.js";import{h as Ut,w as nt}from"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import{P as Bt}from"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import{g as Mt,v as Dt}from"./colorRamps-q0bZVhs2-BnivlaV9.js";import{r as W,a as Nt,u as $t,i as Ge}from"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import{viewScaleRE as Ct}from"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import{g as Rt}from"./styleUtils-BtpNqZyT-Bnq2S5kK.js";var Ie;let Q=Ie=class extends g{constructor(e){super(e),this.minValue=0,this.maxValue=0}clone(){return new Ie({minValue:this.minValue,maxValue:this.maxValue})}};s([l({type:Number,json:{write:!0}})],Q.prototype,"minValue",void 0),s([l({type:Number,json:{write:!0}})],Q.prototype,"maxValue",void 0),Q=Ie=s([h("esri.renderers.support.AuthoringInfoClassBreakInfo")],Q);var _e;let O=_e=class extends g{constructor(e){super(e),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=new Array}clone(){return new _e({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:f(this.classBreakInfos)})}};s([l({type:String,json:{write:!0}})],O.prototype,"field",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"normalizationField",void 0),s([l({type:String,json:{write:!0}})],O.prototype,"label",void 0),s([l({type:[Q],json:{write:!0}})],O.prototype,"classBreakInfos",void 0),O=_e=s([h("esri.renderers.support.AuthoringInfoFieldInfo")],O);var ze;let A=ze=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null}clone(){return new ze({label:this.label,value:this.value,size:this.size})}};s([l({type:String,json:{write:!0}})],A.prototype,"label",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],A.prototype,"value",void 0),A=ze=s([h("esri.renderers.support.AuthoringInfoSizeStop")],A);const At=A;var je;const re=new x({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),ae=new x({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),Le={key:e=>typeof e=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},He=["high-to-low","above-and-below","centered-on","extremes"],Pe=[...new Set(["high-to-low","above-and-below","centered-on","extremes","above","below","high-to-low","above-and-below","above","below","reference-size"])],Je=["seconds","minutes","hours","days","months","years"],Gt=["circle","diamond","hexagon-flat","hexagon-pointy","square"];let v=je=class extends g{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}get normalizationField(){return this.theme==="reference-size"?this._get("normalizationField"):null}set normalizationField(e){this._set("normalizationField",e)}get referenceSizeScale(){return this.theme==="reference-size"?this._get("referenceSizeScale"):null}set referenceSizeScale(e){this._set("referenceSizeScale",e)}get referenceSizeSymbolStyle(){return this.theme==="reference-size"?this._get("referenceSizeSymbolStyle"):null}set referenceSizeSymbolStyle(e){this._set("referenceSizeSymbolStyle",e)}castStartTime(e){return typeof e=="string"||typeof e=="number"?e:null}get sizeStops(){return this.theme==="reference-size"?this._get("sizeStops"):null}set sizeStops(e){this._set("sizeStops",e)}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 je({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,normalizationField:this.normalizationField,referenceSizeScale:this.referenceSizeScale,referenceSizeSymbolStyle:this.referenceSizeSymbolStyle,sizeStops:f(this.sizeStops),startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};s([l({types:Le,json:{write:!0}})],v.prototype,"endTime",void 0),s([U("endTime")],v.prototype,"castEndTime",null),s([l({type:String,json:{write:!0}})],v.prototype,"field",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0}})],v.prototype,"minSliderValue",void 0),s([l({type:String,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"normalizationField",null),s([l({type:Number,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeScale",null),s([l({type:Gt,value:null,json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"referenceSizeSymbolStyle",null),s([l({types:Le,json:{write:!0}})],v.prototype,"startTime",void 0),s([U("startTime")],v.prototype,"castStartTime",null),s([l({type:[At],json:{origins:{"web-scene":{write:!1}},write:!0}})],v.prototype,"sizeStops",null),s([l({type:re.apiValues,value:null,json:{type:re.jsonValues,read:re.read,write:re.write}})],v.prototype,"style",null),s([l({type:Pe,value:null,json:{type:Pe,origins:{"web-scene":{type:He,write:{writer:(e,t)=>{He.includes(e)&&(t.theme=e)}}}},write:!0}})],v.prototype,"theme",null),s([l({type:ae.apiValues,json:{type:ae.jsonValues,read:ae.read,write:ae.write}})],v.prototype,"type",void 0),s([l({type:Je,json:{type:Je,write:!0}})],v.prototype,"units",void 0),v=je=s([h("esri.renderers.support.AuthoringInfoVisualVariable")],v);const Lt=v;var Fe;const B=new x({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),ne=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),Ze=new x({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),We=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers"],Ht=["high-to-low","above-and-below","above","below"],Pt=["flow-line","wave-front"],Jt=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let d=Fe=class extends g{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?Dt(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 Fe({classificationMethod:this.classificationMethod,colorRamp:f(this.colorRamp),fadeRatio:f(this.fadeRatio),fields:this.fields?.slice(),field1:f(this.field1),field2:f(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})}};s([l({type:B.apiValues,value:null,json:{type:B.jsonValues,read:B.read,write:B.write,origins:{"web-document":{default:"manual",type:B.jsonValues,read:B.read,write:B.write}}}})],d.prototype,"classificationMethod",null),s([l({types:Mt,json:{write:!0}})],d.prototype,"colorRamp",void 0),s([I("colorRamp")],d.prototype,"readColorRamp",null),s([l({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"fadeRatio",void 0),s([l({type:[String],value:null,json:{write:!0}})],d.prototype,"fields",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field1",null),s([l({type:O,value:null,json:{write:!0}})],d.prototype,"field2",null),s([l({type:Pt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"flowTheme",null),s([l({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],d.prototype,"focus",null),s([l({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],d.prototype,"isAutoGenerated",void 0),s([l({type:Number,value:null,json:{type:et,write:!0}})],d.prototype,"numClasses",null),s([l({type:We,json:{type:We,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],d.prototype,"lengthUnit",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"maxSliderValue",void 0),s([l({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"minSliderValue",void 0),s([l({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],d.prototype,"statistics",null),s([l({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],d.prototype,"standardDeviationInterval",null),s([l({type:ne.apiValues,value:null,json:{type:ne.jsonValues,read:ne.read,write:ne.write,origins:{"web-scene":{type:Ze.jsonValues,write:{writer:Ze.write,overridePolicy:e=>({enabled:e!=="flow"})}}}}})],d.prototype,"type",null),s([l({type:[Lt],json:{write:!0}})],d.prototype,"visualVariables",void 0),s([l({type:Jt,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateSymbolStyle",null),s([l({type:Ht,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],d.prototype,"univariateTheme",null),d=Fe=s([h("esri.renderers.support.AuthoringInfo")],d);const Zt=d,Ve=new x({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let K=class extends g{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)}};s([l({type:Zt,json:{write:!0}})],K.prototype,"authoringInfo",void 0),s([l({type:Ve.apiValues,readOnly:!0,json:{type:Ve.jsonValues,read:!1,write:{writer:Ve.write,ignoreOrigin:!0}}})],K.prototype,"type",void 0),K=s([h("esri.renderers.Renderer")],K);const ot=K;function Wt(e){return e.match(Qt)?.[1]?.replace(/\\'/g,"'")??null}const Qt=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;let X=class extends be(g){constructor(){super(...arguments),this.showLegend=null,this.title=null}};s([l({type:Boolean,json:{write:!0}})],X.prototype,"showLegend",void 0),s([l({type:String,json:{write:!0}})],X.prototype,"title",void 0),X=s([h("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],X);const ut=X,Se=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let S=class extends g{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"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};s([l()],S.prototype,"index",void 0),s([l({type:Se.apiValues,readOnly:!0,json:{read:Se.read,write:Se.write}})],S.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"field",void 0),s([U("field")],S.prototype,"castField",null),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpression",void 0),s([l({type:String,json:{write:!0}})],S.prototype,"valueExpressionTitle",void 0),s([l({readOnly:!0})],S.prototype,"arcadeRequired",null),s([l({type:ut,json:{write:!0}})],S.prototype,"legendOptions",void 0),S=s([h("esri.renderers.visualVariables.VisualVariable")],S);const se=S;var qe;let M=qe=class extends se{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 qe({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],M.prototype,"cache",null),s([l({type:["color"],json:{type:["colorInfo"]}})],M.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],M.prototype,"normalizationField",void 0),s([l({type:[Ut],json:{write:!0}})],M.prototype,"stops",null),M=qe=s([h("esri.renderers.visualVariables.ColorVariable")],M);const pt=M;var Ee;let F=Ee=class extends g{constructor(e){super(e),this.label=null,this.opacity=null,this.value=null}readOpacity(e,t){return Et(t.transparency)}writeOpacity(e,t,i){t[i]=kt(e)}clone(){return new Ee({label:this.label,opacity:this.opacity,value:this.value})}};s([l({type:String,json:{write:!0}})],F.prototype,"label",void 0),s([l({type:Number,json:{type:et,write:{target:"transparency"}}})],F.prototype,"opacity",void 0),s([I("opacity",["transparency"])],F.prototype,"readOpacity",null),s([H("opacity")],F.prototype,"writeOpacity",null),s([l({type:Number,json:{write:!0}})],F.prototype,"value",void 0),F=Ee=s([h("esri.renderers.visualVariables.support.OpacityStop")],F);const Kt=F;var ke;let D=ke=class extends se{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 ke({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};s([l({readOnly:!0})],D.prototype,"cache",null),s([l({type:["opacity"],json:{type:["transparencyInfo"]}})],D.prototype,"type",void 0),s([l({type:String,json:{write:!0}})],D.prototype,"normalizationField",void 0),s([l({type:[Kt],json:{write:!0}})],D.prototype,"stops",null),D=ke=s([h("esri.renderers.visualVariables.OpacityVariable")],D);const ht=D;var Oe;let N=Oe=class extends se{constructor(e){super(e),this.axis=null,this.type="rotation",this.rotationType="geographic"}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}clone(){return new Oe({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions?.clone()})}};s([l({readOnly:!0})],N.prototype,"cache",null),s([l({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],N.prototype,"axis",void 0),s([l({type:["rotation"],json:{type:["rotationInfo"]}})],N.prototype,"type",void 0),s([l({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],N.prototype,"rotationType",void 0),N=Oe=s([h("esri.renderers.visualVariables.RotationVariable")],N);const dt=N;function Xt(e){return tt(e)}var Te;let q=Te=class extends g{constructor(e){super(e),this.label=null,this.size=null,this.value=null,this.useMinValue=null,this.useMaxValue=null}clone(){return new Te({label:this.label,size:this.size,value:this.value,useMaxValue:this.useMaxValue,useMinValue:this.useMinValue})}};s([l({type:String,json:{write:!0}})],q.prototype,"label",void 0),s([l({type:Number,cast:tt,json:{write:!0}})],q.prototype,"size",void 0),s([l({type:Number,json:{write:!0}})],q.prototype,"value",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMinValue",void 0),s([l({type:Boolean,json:{write:!1}})],q.prototype,"useMaxValue",void 0),q=Te=s([h("esri.renderers.visualVariables.support.SizeStop")],q);const Yt=q;let pe=class extends ut{constructor(){super(...arguments),this.customValues=null}};s([l({type:[Number],json:{write:!0}})],pe.prototype,"customValues",void 0),pe=s([h("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],pe);const es=pe;var Ue;const oe=new x({width:"width",depth:"depth",height:"height",widthAndDepth:"width-and-depth",all:"all"}),Be=new x({unknown:"unknown",inch:"inches",foot:"feet",yard:"yards",mile:"miles","nautical-mile":"nautical-miles",millimeter:"millimeters",centimeter:"centimeters",decimeter:"decimeters",meter:"meters",kilometer:"kilometers"});function Qe(e){if(e!=null)return typeof e=="string"||typeof e=="number"?Xt(e):e.type==="size"?W(e)?e:(delete(e={...e}).type,new o(e)):void 0}function Ke(e,t,i){if(typeof e!="object")return e;const r=new o;return r.read(e,i),r}let o=Ue=class extends se{constructor(e){super(e),this.axis=null,this.legendOptions=null,this.normalizationField=null,this.scaleBy=null,this.target=null,this.type="size",this.useSymbolValue=null,this.valueExpression=null,this.valueRepresentation=null,this.valueUnit=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null,isScaleDriven:this.valueExpression!=null&&Ct.test(this.valueExpression)}}set index(e){W(this.maxSize)&&(this.maxSize.index=`visualVariables[${e}].maxSize`),W(this.minSize)&&(this.minSize.index=`visualVariables[${e}].minSize`),this._set("index",e)}get inputValueType(){return Nt(this)}set maxDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxDataValue when stops is not null."),e=null),this._set("maxDataValue",e)}set maxSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set maxSize when stops is not null."),e=null),this._set("maxSize",e)}castMaxSize(e){return Qe(e)}readMaxSize(e,t,i){return Ke(e,t,i)}set minDataValue(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minDataValue when stops is not null."),e=null),this._set("minDataValue",e)}set minSize(e){e&&this.stops&&(V.getLogger(this).warn("cannot set minSize when stops is not null."),e=null),this._set("minSize",e)}castMinSize(e){return Qe(e)}readMinSize(e,t,i){return Ke(e,t,i)}get arcadeRequired(){return!!this.valueExpression||this.minSize!=null&&typeof this.minSize=="object"&&this.minSize.arcadeRequired||this.maxSize!=null&&typeof this.maxSize=="object"&&this.maxSize.arcadeRequired}set stops(e){this.minDataValue==null&&this.maxDataValue==null&&this.minSize==null&&this.maxSize==null?e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value):e&&(V.getLogger(this).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return $t(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,i,r){if(e==="$view.scale"){if(r?.messages){const a=this.index,n=typeof a=="string"?a:`visualVariables[${a}]`;r.messages.push(new at("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:r}))}}else t[i]=e}readValueUnit(e){return e?Be.read(e):null}clone(){return new Ue({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:W(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:W(this.minSize)?this.minSize.clone():this.minSize,normalizationField:this.normalizationField,stops:this.stops?.map(e=>e.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions?.clone()})}flipSizes(){if(this.transformationType===Ge.ClampedLinear){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if(this.transformationType===Ge.Stops){const e=this.stops;if(!e)return this;const t=e.map(r=>r.size).reverse(),i=e.length;for(let r=0;re.value||0)}};s([l({readOnly:!0})],o.prototype,"cache",null),s([l({type:oe.apiValues,json:{type:oe.jsonValues,origins:{"web-map":{read:!1}},read:oe.read,write:oe.write}})],o.prototype,"axis",void 0),s([l()],o.prototype,"index",null),s([l({type:String,readOnly:!0})],o.prototype,"inputValueType",null),s([l({type:es,json:{write:!0}})],o.prototype,"legendOptions",void 0),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"maxSize",null),s([U("maxSize")],o.prototype,"castMaxSize",null),s([I("maxSize")],o.prototype,"readMaxSize",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minDataValue",null),s([l({type:Number,value:null,json:{write:!0}})],o.prototype,"minSize",null),s([U("minSize")],o.prototype,"castMinSize",null),s([I("minSize")],o.prototype,"readMinSize",null),s([l({type:String,json:{write:!0}})],o.prototype,"normalizationField",void 0),s([l({readOnly:!0})],o.prototype,"arcadeRequired",null),s([l({type:String})],o.prototype,"scaleBy",void 0),s([l({type:[Yt],value:null,json:{write:!0}})],o.prototype,"stops",null),s([l({type:["outline"],json:{write:!0}})],o.prototype,"target",void 0),s([l({type:String,readOnly:!0})],o.prototype,"transformationType",null),s([l({type:["size"],json:{type:["sizeInfo"]}})],o.prototype,"type",void 0),s([l({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],o.prototype,"useSymbolValue",void 0),s([l({type:String,json:{write:!0}})],o.prototype,"valueExpression",void 0),s([I("valueExpression",["valueExpression","expression"])],o.prototype,"readValueExpression",null),s([H("web-scene","valueExpression")],o.prototype,"writeValueExpressionWebScene",null),s([l({type:["radius","diameter","area","width","distance"],json:{write:!0}})],o.prototype,"valueRepresentation",void 0),s([l({type:Be.apiValues,json:{write:Be.write,origins:{"web-map":{read:!1},"web-scene":{write:!0},"portal-item":{write:!0}}}})],o.prototype,"valueUnit",void 0),s([I("valueUnit")],o.prototype,"readValueUnit",null),o=Ue=s([h("esri.renderers.visualVariables.SizeVariable")],o);const ct=o,ts={color:pt,size:ct,opacity:ht,rotation:dt},ss=new x({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),is=/^\[([^\]]+)\]$/i;let he=class extends Ot{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),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 r=null;return r=t.target===i.target?0:t.target?1:-1,r});for(let t=0;t{const c=ss.read(y.type),b=ts[c];b||(V.getLogger(this).warn(`Unknown variable type: ${c}`),i?.messages&&i.messages.push(new Tt("visual-variable:unsupported",`visualVariable of type '${c}' is not supported`,{definition:y,context:i})));const w=new b;return w.read(y,i),w})}writeVariables(e,t){const i=[];for(const r of e){const a=r.toJSON(t);a&&i.push(a)}return i}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};s([l()],he.prototype,"visualVariables",null),he=s([h("esri.renderers.visualVariables.VisualVariableFactory")],he);const ls=he,rs={base:se,key:"type",typeMap:{opacity:ht,color:pt,rotation:dt,size:ct}},yt=e=>{let t=class extends e{constructor(){super(...arguments),this._vvFactory=new ls}set visualVariables(i){this._vvFactory.visualVariables=i,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(i,r,a){return this._vvFactory.readVariables(i,r,a)}writeVisualVariables(i,r,a,n){r[a]=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,r){return i?this.getVisualVariablesForType(i,r).length>0:this.getVisualVariablesForType("size",r).length>0||this.getVisualVariablesForType("color",r).length>0||this.getVisualVariablesForType("opacity",r).length>0||this.getVisualVariablesForType("rotation",r).length>0}getVisualVariablesForType(i,r){const a=this.visualVariables;return a?a.filter(n=>n.type===i&&(typeof r=="string"?n.target===r:r!==!1||!n.target)):[]}async collectVVRequiredFields(i,r){let a=[];this.visualVariables&&(a=a.concat(this.visualVariables));for(const n of a)n&&(n.field&&T(i,r,n.field),n.normalizationField&&T(i,r,n.normalizationField),n.valueExpression&&(as(n.valueExpression,i,r)||await Re(i,r,n.valueExpression)))}};return s([l({types:[rs],value:null,json:{write:!0}})],t.prototype,"visualVariables",null),s([I("visualVariables",["visualVariables","rotationType","rotationExpression"])],t.prototype,"readVisualVariables",null),s([H("visualVariables")],t.prototype,"writeVisualVariables",null),t=s([h("esri.renderers.mixins.VisualVariablesMixin")],t),t};function as(e,t,i){const r=Wt(e);return r!=null&&(T(t,i,r),!0)}const ge={types:St,json:{write:{writer:me},origins:{"web-scene":{types:Ae,write:{writer:me},read:{reader:xt({types:Ae})}}}}},mt=st({json:{origins:{"web-scene":{write:{isRequired:!0}}}}},ge),ft={types:{base:It,key:"type",typeMap:{"simple-fill":le.typeMap["simple-fill"],"picture-fill":le.typeMap["picture-fill"],"polygon-3d":le.typeMap["polygon-3d"],cim:le.typeMap.cim}},json:{write:{writer:me},origins:{"web-scene":{type:_t,write:{writer:me}}}}},de={cast:e=>e==null||typeof e=="string"||typeof e=="number"?e:`${e}`,json:{type:String,write:{writer:(e,t)=>{t.value=e?.toString()}}}};var Me;let E=Me=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new Me({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?.clone()??null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};s([l({type:String,json:{write:!0}})],E.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],E.prototype,"label",void 0),s([l({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],E.prototype,"minValue",void 0),s([l({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],E.prototype,"maxValue",void 0),s([l(mt)],E.prototype,"symbol",void 0),E=Me=s([h("esri.renderers.support.ClassBreakInfo")],E);const ve=E;var De;const vt="log",ce="percent-of-total",ye="field",ue=new x({esriNormalizeByLog:vt,esriNormalizeByPercentOfTotal:ce,esriNormalizeByField:ye}),ns=it(ve);let m=De=class extends yt(ot){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 r=t.minValue;return e.map(a=>{const n=new ve;return n.read(a,i),n.minValue==null&&(n.minValue=r),n.maxValue==null&&(n.maxValue=n.minValue),r=n.maxValue,n})}writeClassBreakInfos(e,t,i,r){const a=e.map(n=>n.write({},r));this._areClassBreaksConsecutive()&&a.forEach(n=>delete n.classMinValue),t[i]=a}castField(e){return e==null?e:typeof e=="function"?(V.getLogger(this).error(".field: field must be a string value"),null):Ce(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&&ye||i&&ce||null,t&&i&&V.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==ye&&e!==ce||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,t,i){let r=null;r=typeof e=="number"?new ve({minValue:e,maxValue:t,symbol:lt(i)}):ns(f(e)),this.classBreakInfos.push(r),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(e,t){const i=this.classBreakInfos.length;for(let r=0;r-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(e,t){let i=t;if(this.valueExpression&&t?.arcade==null){const a=await fe(),{arcadeUtils:n}=a;n.hasGeometryOperations(this.valueExpression)&&await n.enableGeometryOperations(),i={...i,arcade:a}}const r=this.getBreakIndex(e,i);return r>-1?this.classBreakInfos[r].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?.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((r,a)=>r+a.getMeshHash(),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new De({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol?.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol?.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:f(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo)})}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(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{},{valueExpression:y}=this;let c=this._compiledValueExpression.valueExpression===y?this._compiledValueExpression.compiledFunction:null;const b=n.arcadeUtils;if(!c){const _=b.createSyntaxTree(y);c=b.createFunction(_),this._compiledValueExpression.compiledFunction=c}this._compiledValueExpression.valueExpression=y;const w=b.executeFunction(c,b.createExecContext(e,b.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._getBreakIndexfromInfos(w)}_getBreakIndexForField(e){const t=this.field,i=e.attributes,r=this.normalizationType;let a=parseFloat(i[t]);if(r){const n=this.normalizationTotal,u=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if(r===vt)a=Math.log(a)*Math.LOG10E;else if(r!==ce||n==null||isNaN(n)){if(r===ye&&!isNaN(u)){if(isNaN(a)||isNaN(u))return-1;a/=u}}else a=a/n*100}return this._getBreakIndexfromInfos(a)}_getBreakIndexfromInfos(e){const t=this.isMaxInclusive;if(e!=null&&typeof e=="number"&&!isNaN(e))for(let i=0;inew L({value:i})):t==="object"?e[0]instanceof L?e:e.map(i=>new L(i)):null}};s([l({type:String,json:{write:!0}})],k.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],k.prototype,"label",void 0),s([l(ge)],k.prototype,"symbol",void 0),s([l({type:[L],json:{type:[[String]],read:{reader:e=>e?e.map(t=>new L({value:t[0],value2:t[1],value3:t[2]})):null},write:{writer:(e,t)=>{const i=[];for(const r of e){const a=[r.value,r.value2,r.value3].filter(zt).map(n=>n.toString());i.push(a)}t.values=i}}}})],k.prototype,"values",void 0),s([U("values")],k.prototype,"castValues",null),k=s([h("esri.renderers.support.UniqueValueClass")],k);const bt=k;let Y=class extends be(g){constructor(e){super(e),this.heading=null,this.classes=null}};s([l({type:String,json:{write:!0}})],Y.prototype,"heading",void 0),s([l({type:[bt],json:{write:!0}})],Y.prototype,"classes",void 0),Y=s([h("esri.renderers.support.UniqueValueGroup")],Y);const Ne=Y;var $e;let $=$e=class extends g{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new $e({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol?.toJSON());return`${this.value}.${e}`}};s([l({type:String,json:{write:!0}})],$.prototype,"description",void 0),s([l({type:String,json:{write:!0}})],$.prototype,"label",void 0),s([l(mt)],$.prototype,"symbol",void 0),s([l(de)],$.prototype,"value",void 0),$=$e=s([h("esri.renderers.support.UniqueValueInfo")],$);const te=$;var ee;const gt="esri.renderers.UniqueValueRenderer",j=()=>V.getLogger(gt),Xe="uvInfos-watcher",Ye="uvGroups-watcher",os=",",us=it(te);function ps(e){const{field1:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueInfos:n,valueExpression:u}=e,y=!(!t||!i);return[{classes:(n??[]).map(c=>{const{symbol:b,label:w,value:_,description:C}=c,[P,J,Z]=y?_?.toString()?.split(a||"")||[]:[_],z=[];return(t||u)&&z.push(P),i&&z.push(J),r&&z.push(Z),{symbol:b,label:w,values:[z],description:C}})}]}function R(e){return e!=null&&e!==""&&(typeof e!="string"||e.trim()!==""&&e.toLowerCase()!=="")||(e=null),e+""}let p=ee=class extends yt(ot){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.orderByClassesEnabled=!1,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 r=!1;const a={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let n=0;ny.value===i[n].value);u?Bt(u,i[n])?(a.changed.push({type:"complete",oldValue:u,newValue:i[n]}),r=!0):a.unchanged.push({oldValue:u,newValue:i[n]}):(a.added.push(i[n]),r=!0)}for(let n=0;nu.value===t[n].value)||(a.removed.push(t[n]),r=!0);return r?a: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:Ce(e)}writeField(e,t,i,r){typeof e=="string"?t[i]=e:r?.messages?r.messages.push(new at("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):j().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||xe.getDefault()}readStyleOrigin(e,t,i){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const r=jt(t.styleUrl,i);return Object.freeze({styleUrl:r})}}writeStyleOrigin(e,t,i,r){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=Ft(e.styleUrl,r))}set uniqueValueGroups(e){this.styleOrigin?j().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?j().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){if(this.styleOrigin)return void j().error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i=typeof e=="object"?us(e):new te({value:e,symbol:lt(t)}),this.uniqueValueInfos?.push(i),this._valueInfoMap[R(i.value)]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void j().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(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=this.uniqueValueInfos?.reduce((r,a)=>r+a.getMeshHash(),"");return`${e}.${t}.${i}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new ee({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:f(this.defaultSymbol),orderByClassesEnabled:this.orderByClassesEnabled,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:f(this.visualVariables),legendOptions:f(this.legendOptions),authoringInfo:f(this.authoringInfo),backgroundFillSymbol:f(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=f(this.uniqueValueInfos),i=f(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(f(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(r=>r.collectRequiredFields(e,t)),Re(e,t,this.valueExpression)];T(e,t,this.field),T(e,t,this.field2),T(e,t,this.field3),await Promise.all(i)}populateFromStyle(){return Rt(this.styleOrigin,{portal:this.portal}).then(e=>{const t=[];return this._valueInfoMap={},e?.data&&Array.isArray(e.data.items)&&e.data.items.forEach(i=>{const r=new qt({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:i.name});this.defaultSymbol||i.name!==e.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const a=new te({value:i.name,symbol:r});t.push(a),this._valueInfoMap[R(i.name)]=a}),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&this.uniqueValueInfos?.length&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",os)}_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[R(t.value)]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(Xe);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const i of e)t.push(we(()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description}),(r,a)=>{r!==a&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,Xe)}}_watchUniqueValueGroups(){this.removeHandles(Ye);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const i of e){t.push(we(()=>({classes:i.classes}),(r,a)=>{r!==a&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const r of i.classes??[])t.push(we(()=>({symbol:r.symbol,values:r.values,label:r.label,description:r.description}),(a,n)=>{a!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,Ye)}}_updateInfosFromGroups(){if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:i,field3:r,fieldDelimiter:a,uniqueValueGroups:n,valueExpression:u}=this;if(!t&&!u)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const y=!(!t||!i);for(const c of n)for(const b of c.classes??[]){const{symbol:w,label:_,values:C,description:P}=b;for(const J of C??[]){const{value:Z,value2:z,value3:wt}=J,ie=[Z];i&&ie.push(z),r&&ie.push(wt);const Vt=y?ie.join(a||""):ie[0]??void 0;e.push(new te({symbol:w,label:_,value:Vt,description:P}))}}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:r,fieldDelimiter:a,uniqueValueInfos:n}=this;if(!t&&!r||!n.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const u=!(!t||!i),y=n.map(b=>{const{symbol:w,label:_,value:C,description:P}=b,[J,Z,z]=u?C?.toString()?.split(a||"")||[]:[C];return new bt({symbol:w,label:_,description:P,values:[new L({value:J,value2:Z,value3:z})]})}),c=[new Ne({classes:y})];e&&Object.freeze(c),this._set("uniqueValueGroups",c),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:i,scale:r,spatialReference:a,arcade:n,timeZone:u}=t??{};let y=this._cache.compiledFunc;const c=n.arcadeUtils;if(!y){const w=c.createSyntaxTree(this.valueExpression);y=c.createFunction(w),this._cache.compiledFunc=y}const b=c.executeFunction(y,c.createExecContext(e,c.getViewInfo({viewingMode:i,scale:r,spatialReference:a}),u));return this._valueInfoMap[R(b)]}_getUnqiueValueInfoForFields(e){const t=this.field,i=e.attributes;let r;if(this.field2){const a=this.field2,n=this.field3,u=[];t&&u.push(i[t]),a&&u.push(i[a]),n&&u.push(i[n]),r=u.join(this.fieldDelimiter||"")}else t&&(r=i[t]);return this._valueInfoMap[R(r)]}static fromPortalStyle(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleName:e})),i._set("portal",t?.portal||xe.getDefault());const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",a)}),r}static fromStyleUrl(e,t){const i=new ee(t?.properties);i._set("styleOrigin",Object.freeze({styleUrl:e}));const r=i.populateFromStyle();return r.catch(a=>{j().error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",a)}),r}};s([l({readOnly:!0})],p.prototype,"_cache",null),s([rt({uniqueValue:"unique-value"})],p.prototype,"type",void 0),s([l(ft)],p.prototype,"backgroundFillSymbol",void 0),s([l({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],p.prototype,"field",null),s([U("field")],p.prototype,"castField",null),s([H("field")],p.prototype,"writeField",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field2",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"field3",null),s([l({type:Boolean,json:{name:"drawInClassOrder",default:!1,write:!0,origins:{"web-scene":{write:!1}}}})],p.prototype,"orderByClassesEnabled",void 0),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"valueExpression",null),s([l({type:String,json:{write:!0}})],p.prototype,"valueExpressionTitle",void 0),s([l({type:nt,json:{write:!0}})],p.prototype,"legendOptions",void 0),s([l({type:String,json:{write:!0}})],p.prototype,"defaultLabel",void 0),s([l(st({...ge},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],p.prototype,"defaultSymbol",null),s([l({type:String,value:null,json:{write:!0}})],p.prototype,"fieldDelimiter",null),s([l({type:xe,readOnly:!0})],p.prototype,"portal",void 0),s([I("portal",["styleName"])],p.prototype,"readPortal",null),s([l({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],p.prototype,"styleOrigin",void 0),s([I("styleOrigin",["styleName","styleUrl"])],p.prototype,"readStyleOrigin",null),s([H("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],p.prototype,"writeStyleOrigin",null),s([l({type:[Ne],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,i)=>(t.uniqueValueGroups||ps(t)).map(r=>Ne.fromJSON(r,i))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueGroups",null),s([l({type:[te],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],p.prototype,"uniqueValueInfos",null),p=ee=s([h(gt)],p);const gs=p;export{yt as $,mt as A,ht as B,ot as E,ct as G,ft as L,dt as M,te as P,se as a,gs as d,Zt as h,bs as o,ve as t,Yt as y}; diff --git a/custom-toc-highlight/assets/UnknownLayer-DwWK383_-yIdidO-4.js b/custom-toc-highlight/assets/UnknownLayer-DwWK383_-ChM426K1.js similarity index 55% rename from custom-toc-highlight/assets/UnknownLayer-DwWK383_-yIdidO-4.js rename to custom-toc-highlight/assets/UnknownLayer-DwWK383_-ChM426K1.js index b0bd0793..94d072b5 100644 --- a/custom-toc-highlight/assets/UnknownLayer-DwWK383_-yIdidO-4.js +++ b/custom-toc-highlight/assets/UnknownLayer-DwWK383_-ChM426K1.js @@ -1 +1 @@ -import{aQ as p,v as t,S as s,i as a,o as l}from"./story-BfX8CRfG.js";import{m as y}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as m}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{C as u}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";let e=class extends u(y(m)){constructor(o){super(o),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((o,r)=>{p(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let i="Unknown layer type";n&&(i+=" "+n),r(new l("layer:unknown-layer-type",i,{layerType:n}))})}))}read(o,r){super.read({resourceInfo:o},r)}write(o,r){return null}};t([s({readOnly:!0})],e.prototype,"resourceInfo",void 0),t([s({type:["show","hide"]})],e.prototype,"listMode",void 0),t([s({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=t([a("esri.layers.UnknownLayer")],e);const P=e;export{P as default}; +import{aQ as p,v as t,S as s,i as a,o as l}from"./story-Doly9N9p.js";import{m as y}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as m}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{C as u}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";let e=class extends u(y(m)){constructor(o){super(o),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((o,r)=>{p(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let i="Unknown layer type";n&&(i+=" "+n),r(new l("layer:unknown-layer-type",i,{layerType:n}))})}))}read(o,r){super.read({resourceInfo:o},r)}write(o,r){return null}};t([s({readOnly:!0})],e.prototype,"resourceInfo",void 0),t([s({type:["show","hide"]})],e.prototype,"listMode",void 0),t([s({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=t([a("esri.layers.UnknownLayer")],e);const P=e;export{P as default}; diff --git a/custom-toc-highlight/assets/UnknownTimeZone-C--TOcPG-D3CAoWPX.js b/custom-toc-highlight/assets/UnknownTimeZone-C--TOcPG-9of9030I.js similarity index 73% rename from custom-toc-highlight/assets/UnknownTimeZone-C--TOcPG-D3CAoWPX.js rename to custom-toc-highlight/assets/UnknownTimeZone-C--TOcPG-9of9030I.js index 13de9fc9..b9475ccb 100644 --- a/custom-toc-highlight/assets/UnknownTimeZone-C--TOcPG-D3CAoWPX.js +++ b/custom-toc-highlight/assets/UnknownTimeZone-C--TOcPG-9of9030I.js @@ -1 +1 @@ -import{c7 as o,c5 as c}from"./story-BfX8CRfG.js";class t{}function e(n){return n instanceof c?n===t.instance:n?.toString().toLowerCase()==="unknown"}function a(n){return e(n)?t.instance:n}t.instance=new o("Etc/UTC");export{e as a,a as r,t}; +import{c7 as o,c5 as c}from"./story-Doly9N9p.js";class t{}function e(n){return n instanceof c?n===t.instance:n?.toString().toLowerCase()==="unknown"}function a(n){return e(n)?t.instance:n}t.instance=new o("Etc/UTC");export{e as a,a as r,t}; diff --git a/custom-toc-highlight/assets/UnsupportedLayer-CCUtmZ2i-DjI3xgYe.js b/custom-toc-highlight/assets/UnsupportedLayer-CCUtmZ2i-Cmkro0SF.js similarity index 63% rename from custom-toc-highlight/assets/UnsupportedLayer-CCUtmZ2i-DjI3xgYe.js rename to custom-toc-highlight/assets/UnsupportedLayer-CCUtmZ2i-Cmkro0SF.js index 14ce21d1..9814c9c2 100644 --- a/custom-toc-highlight/assets/UnsupportedLayer-CCUtmZ2i-DjI3xgYe.js +++ b/custom-toc-highlight/assets/UnsupportedLayer-CCUtmZ2i-Cmkro0SF.js @@ -1 +1 @@ -import{aQ as n,v as o,S as i,i as l,o as a}from"./story-BfX8CRfG.js";import{m as d}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as u}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{C as y}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";let t=class extends y(d(u)){constructor(e){super(e),this.resourceInfo=null,this.persistenceEnabled=!0,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,s)=>{n(()=>{const r=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let p="Unsupported layer type";r&&(p+=" "+r),s(new a("layer:unsupported-layer-type",p,{layerType:r}))})}))}read(e,s){const r={resourceInfo:e};e.id!=null&&(r.id=e.id),e.title!=null&&(r.title=e.title),super.read(r,s)}write(e,s){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};o([i({readOnly:!0})],t.prototype,"resourceInfo",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),o([i({json:{read:!1},readOnly:!0,value:"unsupported"})],t.prototype,"type",void 0),t=o([l("esri.layers.UnsupportedLayer")],t);const j=t;export{j as default}; +import{aQ as n,v as o,S as i,i as l,o as a}from"./story-Doly9N9p.js";import{m as d}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as u}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{C as y}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";let t=class extends y(d(u)){constructor(e){super(e),this.resourceInfo=null,this.persistenceEnabled=!0,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,s)=>{n(()=>{const r=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let p="Unsupported layer type";r&&(p+=" "+r),s(new a("layer:unsupported-layer-type",p,{layerType:r}))})}))}read(e,s){const r={resourceInfo:e};e.id!=null&&(r.id=e.id),e.title!=null&&(r.title=e.title),super.read(r,s)}write(e,s){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};o([i({readOnly:!0})],t.prototype,"resourceInfo",void 0),o([i({type:["show","hide"]})],t.prototype,"listMode",void 0),o([i({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),o([i({json:{read:!1},readOnly:!0,value:"unsupported"})],t.prototype,"type",void 0),t=o([l("esri.layers.UnsupportedLayer")],t);const j=t;export{j as default}; diff --git a/custom-toc-highlight/assets/UpdateTracking2D-Du_WIf4G-CsaWDyks.js b/custom-toc-highlight/assets/UpdateTracking2D-Du_WIf4G-a2xUHmYe.js similarity index 99% rename from custom-toc-highlight/assets/UpdateTracking2D-Du_WIf4G-CsaWDyks.js rename to custom-toc-highlight/assets/UpdateTracking2D-Du_WIf4G-a2xUHmYe.js index 05c040a7..9dfd07a3 100644 --- a/custom-toc-highlight/assets/UpdateTracking2D-Du_WIf4G-CsaWDyks.js +++ b/custom-toc-highlight/assets/UpdateTracking2D-Du_WIf4G-a2xUHmYe.js @@ -1,4 +1,4 @@ -import{d as No}from"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import{v as g,hF as $,S as kr,i as $o,P as pe,hG as Ro,hH as Do,eE as un,K as li,j as Go,ah as Vo,cf as Ho,ca as rt,cb as gt,eQ as ht,bh as Qt,g_ as lr,cc as Ds,es as bt,et as fe,a1 as ge,hI as xs,hm as Bo,hJ as ci,c9 as ki,l as Xo,dB as Uo,h0 as Yo,N as Wo,hK as Jt,J as cr,hL as qo,hM as ui,hN as Ko,hO as jo,hP as Jo,R as Zo,C as Qo,hQ as ta,o as pn,hR as ea}from"./story-BfX8CRfG.js";import{c as si}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{E as bs,d as Tr,D as sa}from"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import{f as Gs,M as Ps,S as lt,R as kt,o as Rt,d as ia,a as ra,l as na,u as oa,m as aa,N as zr,E as ha,n as la,P as W,C as Kt,g as I,p as Se,T as ws,h as Pt,B as xi,L as Me,O as vs}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as C,w as Tt,M as dn,m as fn,o as ca,g as ua,p as se,y as pa,C as da,A as bi,G as Lr,E as Ar,f as fa,u as ma,s as _a,c as ga,b as ya}from"./utils-SPbpQbmm-B3hR8LxB.js";import{i as mn,c as _n,r as gn,k as xa,q as ba,M as Pa,_ as wa,$ as va}from"./definitions-DJSdSb77-DkoRHaVx.js";import{l as rs,s as yn,K as Ti,h as Sa,i as Pi,e as Or}from"./Tile-D75RMC64-Dj1SOP3K.js";import{L as ce,m as Ss}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Er}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{a as Ma}from"./Rect-DD6XS68q-D_hsV3ag.js";import{K as Ca,l as Ee}from"./LabelMetric-BeluzH3o-C3fDXNzp.js";import{a as Ms}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{h as Ia}from"./Util-BjGjeg6f-08Szkf4F.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import{V as ka}from"./Program-DLVwTiPA-C1hIaFuM.js";import{h as Ta}from"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import{i as za}from"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";var Fr;(function(e){e[e.AnimatedMarker=0]="AnimatedMarker",e[e.Blend=1]="Blend",e[e.ComplexFill=2]="ComplexFill",e[e.ComplexOutlineFill=3]="ComplexOutlineFill",e[e.DotDensity=4]="DotDensity",e[e.Fill=5]="Fill",e[e.Grid=6]="Grid",e[e.Heatmap=7]="Heatmap",e[e.Label=8]="Label",e[e.Line=9]="Line",e[e.Magnifier=10]="Magnifier",e[e.Marker=11]="Marker",e[e.OutlineFill=12]="OutlineFill",e[e.Overlay=13]="Overlay",e[e.PatternFill=14]="PatternFill",e[e.PatternOutlineFill=15]="PatternOutlineFill",e[e.PieChart=16]="PieChart",e[e.Test=17]="Test",e[e.Text=18]="Text",e[e.TexturedLine=19]="TexturedLine"})(Fr||(Fr={}));const Yc={bitset:{isSDF:0,isMapAligned:1,scaleSymbolsProportionally:2,overrideOutlineColor:3,colorLocked:4,isStroke:5}};let N=class{static fromOptimized(e,t,s=!1,i=!1,n=1){return new zi().initialize(e,t,s,i,n)}static fromJSON(e,t=!1,s=!1){const[i,n]=Nr(e);return new Ai().initialize(i,n,t,s,1)}static fromOptimizedCIM(e,t,s=!1,i=!1,n=1){return new $r().initialize(e,t,s,i,n)}static fromJSONCIM(e,t=!1,s=!1,i=1){const[n,r]=Nr(e);return new Rr().initialize(n,r,t,s,i)}static fromFeatureSetReader(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimized(t,s):null}static fromFeatureSetReaderCIM(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimizedCIM(t,s):null}static createEmptyOptimized(e,t=!1,s=!1,i=1){return new zi().initialize(new si,e,t,s,i)}static createEmptyJSON(e,t=!1,s=!1){return new Ai().initialize([],e,t,s,1)}static createEmptyOptimizedCIM(e,t=!1,s=!1,i=1){return new $r().initialize(new si,e,t,s,i)}static createEmptyJSONCIM(e,t=!1,s=!1,i=1){return new Rr().initialize([],e,t,s,i)}asJSON(){const e=ci(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:e[0][0][0],ymin:e[0][0][1],xmax:e[0][2][0],ymax:e[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:e.flat()}:this.geometryType==="esriGeometryPoint"?{x:e[0][0][0],y:e[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:e}:{paths:e}}getCurrentRingArea(){if(this.pathSize<3)return 0;let e,t,s=0;if(this.seekPathStart(),!this.nextPoint())return 0;e=this.x,t=this.y;const i=e,n=t;for(;this.nextPoint();)s+=(e-this.x)*(t+this.y),e=this.x,t=this.y;return s+=(e-i)*(t+n),-.5*s}invertY(){this.yFactor*=-1}},zi=class Li extends N{constructor(){super(...arguments),this._end=-1}initialize(t,s,i,n,r){return this.hasZ=i,this.hasM=n,this.geometryType=s,this._stride=2+Number(i)+Number(n),this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=r,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(t){if(t>=0&&tt)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const s=this._pathOffset+t*this._stride;return s>=0&&s=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1)&&(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,!0)}prevPath(){return!(this.pathIndex<=0)&&(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,!0)}getCurrentPath(){const t=this._end,s=this._geometry.coords,i=this._pathOffset;return new Li().initialize(new si([this.pathSize],s.slice(i,t)),this.geometryType,this.hasZ,this.hasM,this.yFactor)}pathLength(){const t=this._end,s=this._stride,i=this._geometry.coords;let n=0;for(let r=this._pathOffset+s;rt+s)}get pathSize(){const{lengths:t}=this._geometry;return this._geometry.isPoint?1:this._pathIndex<0||this._pathIndex>t.length-1?0:t[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}};function La(e){const t=[e.x,e.y];return e.z&&t.push(e.z),e.m&&t.push(e.m),t}function Nr(e){return rt(e)?[e.rings,"esriGeometryPolygon"]:gt(e)?[e.paths,"esriGeometryPolyline"]:Ds(e)?[[e.points],"esriGeometryMultipoint"]:ht(e)?[[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]],"esriGeometryEnvelope"]:ki(e)?[[[La(e)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let Ai=class Oi extends N{initialize(t,s,i,n,r){return this._paths=t,this.geometryType=s,this.hasZ=i,this.hasM=n,this._pathIndex=this._pointIndex=-1,this.yFactor=r,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t=0&&t=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const t=this._currentPath.length,s=this._currentPath;let i=0;for(let n=1;nt.length).reduce((t,s)=>t+s)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}};const Cs=4,Is=1;let $r=class xn extends zi{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(o=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=new xn().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}},Rr=class bn extends Ai{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r)}clone(){return new bn().initialize(pe(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][Cs]=Is}getControlPoint(){return this._paths[this.pathIndex][this._pointIndex][Cs]===Is}setControlPointAt(t){this._paths[this.pathIndex][t][Cs]=Is}getControlPointAt(t){return this._paths[this.pathIndex][t][Cs]===Is}};const Aa=512;let wt,Oa=class{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}};function ur(e,t){wt||(wt=new sa(0,0,0,1));const s=e.geometryType==="esriGeometryPolygon",i=s?Tr.Polygon:Tr.LineString,n=s?3:2;let r,o;for(wt.reset(i),wt.setPixelMargin(t+1),wt.setExtent(Aa);e.nextPath();)if(!(e.pathSize1&&y>0&&h>0&&(o*m+a*_)/y/h<=this._maxCosAngle&&e.setControlPointAt(p-1),p===1&&(l=m,c=_,u=y),y>0&&(i=d,n=f,o=m,a=_,h=y)}this._isClosed&&h>0&&u>0&&(o*l+a*c)/u/h<=this._maxCosAngle&&e.setControlPointAt(0)}}},ye=class{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(e,t){this.tx=e,this.ty=t}setTranslateZ(e){this.tz=e}setRotateCS(e,t){this.rz=void 0,this.rzCos=e,this.rzSin=t}setRotate(e){this.rz=e,this.rzCos=void 0,this.rzSin=void 0}setRotateY(e){this.ry=e}setScale(e){this.s=e}setMeasure(e){this.m=e}};function Ce(e,t){e[4]=t}let fs=class{constructor(e,t=!0,s=!0,i=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!t&&e.geometryType==="esriGeometryPolygon"||!s&&e.geometryType==="esriGeometryPolyline"?null:e,this.geomUnitsPerPoint=i,this.iterateMultiPath=!1,this.iteratePath=!1,this.internalPlacement=new ye}next(){if(!this.geometryCursor)return null;const e=this.processMultiPath(this.geometryCursor);return this.iterateMultiPath&&e||(this.geometryCursor=null),e}processMultiPath(e){for(;this.iteratePath||e.pathIndex0?[r/a,o/a]:[1,0]}getSegAngleCS(e,t){const[[s,i],[n,r]]=e;return this.getAngleCS(s,i,n,r,t)}cut(e,t,s,i,n,r){return[n<=0?[e,t]:this.getCoord2D(e,t,s,i,n),r>=1?[s,i]:this.getCoord2D(e,t,s,i,r)]}getSubCurve(e,t,s){const i=N.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(i,e,t,s)?i:null}appendSubCurve(e,t,s,i){e.startPath(),t.seekPathStart();let n=0,r=!0;if(!t.nextPoint())return!1;let o=t.x,a=t.y;for(;t.nextPoint();){const h=this.getLength(o,a,t.x,t.y);if(h!==0){if(r){if(n+h>s){const l=(s-n)/h;let c=1,u=!1;n+h>=i&&(c=(i-n)/h,u=!0);const p=this.cut(o,a,t.x,t.y,l,c);if(p&&e.pushPoints(p),u)break;r=!1}}else{if(n+h>i){const l=this.cut(o,a,t.x,t.y,0,(i-n)/h);l&&e.pushPoint(l[1]);break}e.pushXY(t.x,t.y)}n+=h,o=t.x,a=t.y}else o=t.x,a=t.y}return!0}getCIMPointAlong(e,t){if(!e.nextPoint())return null;let s,i,n,r,o=0;for(s=e.x,i=e.y;e.nextPoint();s=n,i=r){n=e.x,r=e.y;const a=this.getLength(s,i,n,r);if(a!==0){if(o+a>t){const h=(t-o)/a;return this.getCoord2D(s,i,n,r,h)}o+=a}}return null}offset(e,t,s,i,n){if(!e||e.length<2)return null;let r=0,o=e[r++],a=r;for(;r=0==t<=0){if(_<1){const y=[d[0]-f[0],d[1]-f[1]];this.normalize(y);const b=Math.sqrt((1+_)/2);if(b>1/i){const P=-Math.abs(t)/b;l.push([c[0]-y[0]*P,c[1]-y[1]*P])}}}else switch(s){case Kt.Mitered:{const y=Math.sqrt((1+_)/2);if(y>0&&1/y0){const b=1/y;let P=b;for(let w=1;w0){const n=N.createEmptyOptimizedCIM(e.geometryType),r=ci(e)[0],o=this._curveHelper.offset(r,this._size,Kt.Rounded,4,this._offsetFlattenError);if(o)return n.pushPath(o),n}else if(this._size<0){const n=e.asJSON();if(Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._size>0)return N.fromJSONCIM({xmin:n.xmin-this._size,xmax:n.xmax+this._size,ymin:n.ymin-this._size,ymax:n.ymax+this._size})}}const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e;if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),this._size,1);return i?N.fromJSONCIM(i):null}return null}},Sn=class Re{static local(){return Re.instance===null&&(Re.instance=new Re),Re.instance}execute(t,s,i,n,r){return new Da(t,s,i)}};Sn.instance=null;let Da=class{constructor(e,t,s){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=s,this._rule=t.rule??I.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let e;for(;e=this._inputGeometries.next();){const t=this._processGeom(ci(e));if(t?.length)return N.fromJSONCIM({paths:t})}return null}_clone(e){return[e[0],e[1]]}_mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}_mix(e,t,s,i){return[e[0]*t+s[0]*i,e[1]*t+s[1]*i]}_add(e,t){return[e[0]+t[0],e[1]+t[1]]}_add2(e,t,s){return[e[0]+t,e[1]+s]}_sub(e,t){return[e[0]-t[0],e[1]-t[1]]}_dist(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,t=1){const s=t/this._norm(e);e[0]*=s,e[1]*=s}_leftPerpendicular(e){const t=-e[1],s=e[0];e[0]=t,e[1]=s}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){const t=e[1],s=-e[0];e[0]=t,e[1]=s}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,t){return e[0]*t[0]+e[1]*t[1]}_crossProduct(e,t){return e[0]*t[1]-e[1]*t[0]}_rotateDirect(e,t,s){const i=e[0]*t-e[1]*s,n=e[0]*s+e[1]*t;e[0]=i,e[1]=n}_makeCtrlPt(e){const t=[e[0],e[1]];return Ce(t,1),t}_addAngledTicks(e,t,s,i){const n=this._sub(s,t);this._normalize(n);const r=this._crossProduct(n,this._sub(i,t));let o;o=r>0?this._rightPerp(n):this._leftPerp(n);const a=Math.abs(r)/2,h=[];h.push([t[0]+(o[0]-n[0])*a,t[1]+(o[1]-n[1])*a]),h.push(t),h.push(s),h.push([s[0]+(o[0]+n[0])*a,s[1]+(o[1]+n[1])*a]),e.push(h)}_addBezier2(e,t,s,i,n){if(n--==0)return void e.push(i);const r=this._mid(t,s),o=this._mid(s,i),a=this._mid(r,o);this._addBezier2(e,t,r,a,n),this._addBezier2(e,a,o,i,n)}_addBezier3(e,t,s,i,n,r){if(r--==0)return void e.push(n);const o=this._mid(t,s),a=this._mid(s,i),h=this._mid(i,n),l=this._mid(o,a),c=this._mid(a,h),u=this._mid(l,c);this._addBezier3(e,t,o,l,u,r),this._addBezier3(e,u,c,h,n,r)}_add90DegArc(e,t,s,i,n){const r=n??this._crossProduct(this._sub(s,t),this._sub(i,t))>0,o=this._mid(t,s),a=this._sub(o,t);r?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(e,t,this._mix(t,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(e,t,s){const i=t[0],n=t[1],r=t[t.length-1],o=this._sub(i,n),a=this._norm(o);this._normalize(o);const h=Math.abs(this._crossProduct(o,this._sub(r,n)));let l=this._dotProduct(o,this._sub(r,n));l<.05*a?l=.05*a:l>.95*a&&(l=.95*a);const c=.5*h,u=this._leftPerp(o),p=[n[0]+o[0]*l,n[1]+o[1]*l],d=t.length-1,f=[];f.push(s?[-u[0],-u[1]]:u);let m=[-o[0],-o[1]];for(let _=1;_0;_--)e.push([t[_][0]+f[_][0]*c,t[_][1]+f[_][1]*c]);e.push([p[0]+f[0][0]*c,p[1]+f[0][1]*c]),e.push([p[0]+f[0][0]*h,p[1]+f[0][1]*h]),e.push(i),e.push([p[0]-f[0][0]*h,p[1]-f[0][1]*h]),e.push([p[0]-f[0][0]*c,p[1]-f[0][1]*c]);for(let _=1;_=2?e[1]:this._add2(e[0],t*this._defaultSize,s*this._defaultSize)}_cp3(e,t,s,i){if(e.length>=3)return e[2];const n=this._mix(e[0],1-s,t,s),r=this._sub(t,e[0]);return this._normalize(r),this._rightPerpendicular(r),[n[0]+r[0]*i*this._defaultSize,n[1]+r[1]*i*this._defaultSize]}_arrowPath(e){if(e.length>2)return e;const t=e[0],s=this._cp2(e,-4,0),i=this._sub(t,s);this._normalize(i);const n=this._rightPerp(i);return[t,s,[t[0]+(n[0]-i[0])*this._defaultSize,t[1]+(n[1]-i[1])*this._defaultSize]]}_arrowLastSeg(e){const t=e[0],s=this._cp2(e,-4,0);let i;if(e.length>=3)i=e[e.length-1];else{const n=this._sub(t,s);this._normalize(n);const r=this._rightPerp(n);i=[t[0]+(r[0]-n[0])*this._defaultSize,t[1]+(r[1]-n[1])*this._defaultSize]}return[s,i]}_processGeom(e){if(!e)return null;const t=[];for(const s of e){const i=s.length>1&&qo(s)0?this._rightPerp(h):this._leftPerp(h);const c=[];c.push([o[0]+(l[0]-h[0])/3,o[1]+(l[1]-h[1])/3]),c.push(o),c.push(a),c.push([a[0]+(l[0]+h[0])/3,a[1]+(l[1]+h[1])/3]),t.push(c);break}case I.DoublePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push(r),u.push([a[0]+l[0]*c,a[1]+l[1]*c]),t.push(u);const p=[];p.push([a[0]-l[0]*c,a[1]-l[1]*c]),p.push(o),t.push(p);break}case I.OppositeToFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c,a[1]+l[1]*c]),u.push([a[0]-l[0]*c,a[1]-l[1]*c]),t.push(u);break}case I.TriplePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c*.8,a[1]+l[1]*c*.8]),u.push([h[0]+.8*(r[0]-h[0]),h[1]+.8*(r[1]-h[1])]),t.push(u),t.push([a,h]);const p=[];p.push([a[0]-l[0]*c*.8,a[1]-l[1]*c*.8]),p.push([h[0]+.8*(o[0]-h[0]),h[1]+.8*(o[1]-h[1])]),t.push(p);break}case I.HalfCircleFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o);let l=this._sub(o,r);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),p=Math.sqrt((1+c)/2),d=Math.sqrt((1-c)/2),f=[];let m;this._crossProduct(l,this._sub(a,r))>0?(f.push(r),l=this._sub(r,h),m=o):(f.push(o),l=this._sub(o,h),m=r),this._rotateDirect(l,p,d),l[0]/=p,l[1]/=p;for(let _=1;_<=18;_++)f.push(this._add(h,l)),this._rotateDirect(l,c,u);f.push(m),t.push(f);break}case I.HalfCircleSecondSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,1,-1);let h=this._sub(r,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o))/2;this._leftPerpendicular(h);const c=[o[0]+h[0]*l,o[1]+h[1]*l];h=this._sub(o,c);const u=Math.cos(Math.PI/18);let p=Math.sin(Math.PI/18);l>0&&(p=-p);const d=[o];for(let f=1;f<=18;f++)this._rotateDirect(h,u,p),d.push(this._add(c,h));t.push(d);break}case I.HalfCircleExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-1);let h;if(n>=4)h=s[3];else{const f=this._sub(r,o);h=this._add(a,f)}const l=this._dist(o,a)/2/.75,c=this._sub(o,r);this._normalize(c,l);const u=this._sub(a,h);this._normalize(u,l);const p=[h,a];t.push(p);const d=[this._clone(a)];this._addBezier3(d,a,this._add(a,u),this._add(o,c),o,4),d.push(r),t.push(d);break}case I.OpenCircle:{const o=this._cp2(s,-2,0),a=this._sub(o,r),h=Math.cos(Math.PI/18),l=-Math.sin(Math.PI/18),c=[o];for(let u=1;u<=33;u++)this._rotateDirect(a,h,l),c.push(this._add(r,a));t.push(c);break}case I.CoverageEdgesWithTicks:{const o=this._cp2(s,0,-1);let a,h;if(n>=3)a=s[2];else{const p=this._sub(o,r),d=this._leftPerp(p);a=[r[0]+d[0]-.25*p[0],r[1]+d[1]-.25*p[1]]}if(n>=4)h=s[3];else{const p=this._mid(r,o),d=this._sub(r,o);this._normalize(d),this._leftPerpendicular(d);const f=this._crossProduct(d,this._sub(a,p));this._rightPerpendicular(d),h=[a[0]+d[0]*f*2,a[1]+d[1]*f*2]}const l=this._sub(o,r);let c,u;c=this._crossProduct(l,this._sub(a,r))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push(a),u.push(r),u.push([r[0]+(c[0]-l[0])/3,r[1]+(c[1]-l[1])/3]),t.push(u),c=this._crossProduct(l,this._sub(h,o))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push([o[0]+(c[0]+l[0])/3,o[1]+(c[1]+l[1])/3]),u.push(o),u.push(h),t.push(u);break}case I.GapExtentWithDoubleTicks:{const o=this._cp2(s,0,2),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const l=this._sub(o,r);h=this._add(a,l)}this._addAngledTicks(t,r,o,this._mid(a,h)),this._addAngledTicks(t,a,h,this._mid(r,o));break}case I.GapExtentMidline:{const o=this._cp2(s,2,0),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const c=this._sub(o,r);h=this._add(a,c)}const l=[];l.push(this._mid(r,a)),l.push(this._mid(o,h)),t.push(l);break}case I.Chevron:{const o=this._cp2(s,-1,-1);let a;if(n>=3)a=s[2];else{const h=this._sub(o,r);this._leftPerpendicular(h),a=this._add(r,h)}t.push([o,this._makeCtrlPt(r),a]);break}case I.PerpendicularWithArc:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,.5,-1),h=this._sub(o,r),l=this._norm(h);h[0]/=l,h[1]/=l;const c=this._crossProduct(h,this._sub(a,r));let u=this._dotProduct(h,this._sub(a,r));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[r[0]+h[0]*u,r[1]+h[1]*u];let d=this._leftPerp(h),f=[];if(f.push([p[0]-d[0]*c,p[1]-d[1]*c]),f.push([p[0]+d[0]*c,p[1]+d[1]*c]),t.push(f),n>=4){const b=s[3];let P=this._dotProduct(h,this._sub(b,r));P<.1*l?P=.1*l:P>.9*l&&(P=.9*l);const w=[r[0]+h[0]*P,r[1]+h[1]*P],S=this._crossProduct(h,this._sub(b,r)),L=[];L.push([w[0]-d[0]*S,w[1]-d[1]*S]),L.push([w[0]+d[0]*S,w[1]+d[1]*S]),t.push(L)}const m=[o[0]+d[0]*c,o[1]+d[1]*c];d=this._sub(o,m);const _=Math.cos(Math.PI/18);let y=Math.sin(Math.PI/18);c<0&&(y=-y),f=[r,o];for(let b=1;b<=9;b++)this._rotateDirect(d,_,y),f.push(this._add(m,d));t.push(f);break}case I.ClosedHalfCircle:{const o=this._cp2(s,2,0),a=this._mid(r,o),h=this._sub(o,a),l=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[r,o];for(let p=1;p<=18;p++)this._rotateDirect(h,l,c),u.push(this._add(a,h));t.push(u);break}case I.TripleParallelExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-2),h=this._mid(r,o),l=this._sub(a,o);this._normalize(l);const c=Math.abs(this._crossProduct(l,this._sub(h,o)))/2,u=this._dist(o,a),p=[o,r];p.push([r[0]+l[0]*u*.5,r[1]+l[1]*u*.5]),t.push(p);const d=[];d.push([h[0]-l[0]*c,h[1]-l[1]*c]),d.push([h[0]+l[0]*u*.375,h[1]+l[1]*u*.375]),Ce(d[d.length-1],1),d.push([h[0]+l[0]*u*.75,h[1]+l[1]*u*.75]),t.push(d);const f=[o,a];t.push(f);break}case I.ParallelWithTicks:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(a,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),this._addAngledTicks(t,r,o,a),this._addAngledTicks(t,this._mix(r,1,h,l),this._mix(o,1,h,l),this._mid(r,o));break}case I.Parallel:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._leftPerp(h),c=this._crossProduct(h,this._sub(a,r));let u=[r,o];t.push(u),u=[],u.push([r[0]+l[0]*c,r[1]+l[1]*c]),u.push([o[0]+l[0]*c,o[1]+l[1]*c]),t.push(u);break}case I.PerpendicularToFirstSegment:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._mid(r,o),l=this._sub(o,r);this._normalize(l);const c=this._crossProduct(l,this._sub(a,r));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]),t.push(u);break}case I.ParallelOffset:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);const u=[];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(u);break}case I.OffsetOpposite:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);break}case I.OffsetSame:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]+h[0]*l,r[1]+h[1]*l]),c.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(c);break}case I.CircleWithArc:{let o=this._cp2(s,3,0);const a=this._cp3(s,o,.5,-1);let h,l;if(n>=4)h=s[3],l=this._crossProduct(this._sub(h,o),this._sub(a,o))>0;else{h=o,l=this._crossProduct(this._sub(h,r),this._sub(a,r))>0;const f=24*this._geomUnitsPerPoint,m=this._sub(h,r);this._normalize(m,f);const _=Math.sqrt(2)/2;this._rotateDirect(m,_,l?_:-_),o=this._add(r,m)}const c=this._sub(o,r),u=Math.cos(Math.PI/18),p=Math.sin(Math.PI/18),d=[o];for(let f=1;f<=36;f++)this._rotateDirect(c,u,p),d.push(this._add(r,c));this._add90DegArc(d,o,h,a,l),Ce(d[d.length-8],1),t.push(d);break}case I.DoubleJog:{let o,a=this._cp2(s,-3,1),h=this._cp3(s,a,-1,-.5);if(n>=4)o=s[3];else{const y=r;r=a,o=h;const b=this._dist(r,y),P=this._dist(o,y);let w=30*this._geomUnitsPerPoint;.5*b0?this._rotateDirect(m,f,-f):this._rotateDirect(m,f,f);let _=[];_.push(a),_.push(this._add(l,m)),_.push(this._sub(l,m)),_.push(r),t.push(_),m=this._sub(o,h),this._normalize(m,d),this._crossProduct(m,this._sub(r,h))<0?this._rotateDirect(m,f,f):this._rotateDirect(m,f,-f),_=[],_.push(h),_.push(this._add(c,m)),_.push(this._sub(c,m)),_.push(o),t.push(_);break}case I.PerpendicularOffset:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l);t.push([c,r]);break}case I.LineExcludingLastSegment:{const o=this._arrowPath(s),a=[];let h=o.length-2;for(;h--;)a.push(o[h]);t.push(a);break}case I.MultivertexArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!1),t.push(a);break}case I.CrossedArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!0),t.push(a);break}case I.ChevronArrow:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o));let p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=[o[0]+l[0]*p,o[1]+l[1]*p],f=this._leftPerp(l),m=[];m.push([d[0]+f[0]*u+l[0]*h,d[1]+f[1]*u+l[1]*h]),m.push(r),m.push([d[0]-f[0]*u+l[0]*h,d[1]-f[1]*u+l[1]*h]),t.push(m);break}case I.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=this._crossProduct(h,this._sub(a,o));let u=this._dotProduct(h,this._sub(a,o));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[o[0]+h[0]*u,o[1]+h[1]*u];this._leftPerpendicular(h);const d=[];d.push([p[0]+h[0]*c*.5,p[1]+h[1]*c*.5]),d.push(this._mid(p,r)),d.push([p[0]-h[0]*c*.5,p[1]-h[1]*c*.5]),t.push(d);break}case I.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);let c=this._dotProduct(h,this._sub(a,o));c<.05*l?c=.05*l:c>.95*l&&(c=.95*l);const u=[o[0]+h[0]*c,o[1]+h[1]*c];t.push([o,u]);break}case I.Arch:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=this._sub(r,o),l=this._mix(a,1,h,.55),c=this._mix(a,1,h,-.55),u=[r];this._addBezier2(u,r,l,a,4),this._addBezier2(u,a,c,o,4),t.push(u);break}case I.CurvedParallelTicks:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l),u=this._sub(this._mix(o,.75,a,.25),l),p=this._sub(this._mix(o,.25,a,.75),l),d=[o];this._addBezier2(d,o,u,c,3),this._addBezier2(d,c,p,a,3),t.push(d);for(let f=0;f<8;f++){const m=d[2*f+1],_=[this._clone(m)];_.push(this._add(m,[h[0]/4,h[1]/4])),t.push(_)}break}case I.Arc90Degrees:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=[o];this._add90DegArc(h,o,r,a),t.push(h);break}case I.TipWithPerpendicularAndTicks:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);let u=this._crossProduct(l,this._sub(a,o)),p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=this._leftPerp(l),f=[r[0]-l[0]*h,r[1]-l[1]*h],m=.5*Math.max(c-p-h,h);u=Math.abs(u);const _=[];_.push([f[0]+d[0]*(u+m)-l[0]*m,f[1]+d[1]*(u+m)-l[1]*m]),_.push([f[0]+d[0]*u,f[1]+d[1]*u]),_.push([f[0]-d[0]*u,f[1]-d[1]*u]),_.push([f[0]-d[0]*(u+m)-l[0]*m,f[1]-d[1]*(u+m)-l[1]*m]),t.push(_),t.push([f,r]);break}case I.ConcentricCircles:{const o=this._cp2(s,1,0),a=this._cp3(s,o,2,0),h=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18);let c=this._dist(o,r),u=[c,0],p=[];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);if(t.push(p),n>=4){p=[];const d=s[3];c=this._dist(d,r),u=[c,0];for(let f=0;f<=36;f++)p.push(this._add(r,u)),f===0&&(p.push(this._add(r,u)),Ce(p[1],1)),this._rotateDirect(u,h,l);t.push(p)}p=[],c=this._dist(a,r),u=[c,0];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);t.push(p);break}case I.DoubleJogArrow:{r=this._arrowPath(s)[0];const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=Math.abs(this._crossProduct(h,this._sub(a,r)));let u=Math.abs(this._dotProduct(h,this._sub(a,r)));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=Math.max(c,u),d=this._leftPerp(h);let f=[];const m=[r[0]-h[0]*u*.5+d[0]*c*.5,r[1]-h[1]*u*.5+d[1]*c*.5];f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),m[0]-=d[0]*p*.25,m[1]-=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),t.push(f),f=[],m[0]=r[0]-h[0]*u*.5-d[0]*c*.5,m[1]=r[1]-h[1]*u*.5-d[1]*c*.5,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),m[0]+=d[0]*p*.25,m[1]+=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),t.push(f);break}case I.LinkedChevrons:{const o=this._cp2(s,-5,0),a=this._cp3(s,o,-.2,1),h=this._sub(r,o);this._normalize(h);const l=this._leftPerp(h),c=Math.abs(this._crossProduct(h,this._sub(a,o)));t.push([o,r]);const u=[];u.push([r[0]-h[0]*c+l[0]*c,r[1]-h[1]*c+l[1]*c]),u.push(r),u.push([r[0]-h[0]*c-l[0]*c,r[1]-h[1]*c-l[1]*c]),t.push(u),this._addDash(t,o,[-h[0]*c+l[0]*c,-h[1]*c+l[1]*c]),this._addDash(t,o,[-h[0]*c-l[0]*c,-h[1]*c-l[1]*c]);break}case I.SegmentThenHalfCircle:{const o=this._cp2(s,2,0),a=this._cp3(s,o,1.5,0);let h;h=n>=4?s[3]:this._cp3(s,o,1.25,-.5);const l=this._sub(o,r);this._normalize(l);const c=.5*this._dist(o,a),u=this._crossProduct(l,this._sub(h,r))>0,p=Math.cos(Math.PI/18);let d=Math.sin(Math.PI/18);u&&(d=-d);const f=[r,o];l[0]*=c,l[1]*=c;const m=this._add(o,l);l[0]=-l[0],l[1]=-l[1];for(let _=1;_<=18;_++)this._rotateDirect(l,p,d),f.push(this._add(m,l));t.push(f);break}case I.LineWithStraightTicks:{const o=this._cp2(s,-2,1),a=this._cp3(s,o,-1,-.5),h=this._sub(a,o);this._normalize(h);const l=this._dotProduct(h,this._sub(o,r)),c=this._dotProduct(h,this._sub(a,r));let u=[r];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push(o),t.push(u),u=[r],u.push([r[0]+h[0]*c,r[1]+h[1]*c]),u.push(a),t.push(u);break}case I.DoubleCurve:{const o=this._cp2(s,-5,-1),a=this._cp3(s,o,2,0),h=Math.atan2(1,5),l=Math.cos(h),c=Math.sin(h),u=this._sub(o,r),p=this._dist(r,o);this._normalize(u),this._rotateDirect(u,l,-c);const d=[r];d.push([r[0]+u[0]*p*.5,r[1]+u[1]*p*.5]),Ce(d[1],1),d.push([r[0]+u[0]*p*.8,r[1]+u[1]*p*.8]),this._addBezier2(d,d[2],[r[0]+u[0]*p,r[1]+u[1]*p],o,3);const f=this._sub(a,o),m=this._dist(o,a);this._normalize(f),this._rotateDirect(f,l,-c),this._addBezier2(d,o,[a[0]-f[0]*m,a[1]-f[1]*m],[a[0]-f[0]*m*.8,a[1]-f[1]*m*.8],3),d.push(a),t.push(d);break}case I.ParallelWithTicksByWidth:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),l>0?(this._addAngledTicks(t,r,[r[0]+h[0]*l,r[1]+h[1]*l],o),this._addAngledTicks(t,o,[o[0]+h[0]*l,o[1]+h[1]*l],r)):(this._addAngledTicks(t,[r[0]+h[0]*l,r[1]+h[1]*l],r,o),this._addAngledTicks(t,[o[0]+h[0]*l,o[1]+h[1]*l],r,o));break}case I.EnclosingRoundedRectangle:{const o=this._cp2(s,3,-2),a=[Math.min(r[0],o[0]),Math.max(r[1],o[1])],h=[Math.max(r[0],o[0]),Math.min(r[1],o[1])],l=h[0]-a[0],c=a[1]-h[1],u=Math.min(l,c)/10,p=[];p.push([a[0]+u+.75*(l-2*u),a[1]]),p.push([h[0]-u,a[1]]),this._add90DegArc(p,[h[0]-u,a[1]],[h[0],a[1]-u],[h[0],a[1]]),p.push([h[0],h[1]+u]),this._add90DegArc(p,[h[0],h[1]+u],[h[0]-u,h[1]],h),p.push([a[0]+u,h[1]]),this._add90DegArc(p,[a[0]+u,h[1]],[a[0],h[1]+u],[a[0],h[1]]),p.push([a[0],a[1]-u]),this._add90DegArc(p,[a[0],a[1]-u],[a[0]+u,a[1]],a),p.push([a[0]+u+.75*(l-2*u),a[1]]);break}case I.FullGeometry:default:t.push(s)}}return t}},Mn=class De{static local(){return De.instance===null&&(De.instance=new De),De.instance}execute(t,s,i,n,r){return new Ga(t,s,i)}};Mn.instance=null;let Ga=class extends pi{constructor(e,t,s){super(e,!0,!0),this._curveHelper=new Lt,this._beginCut=(t.beginCut!==void 0?t.beginCut:1)*s,this._endCut=(t.endCut!==void 0?t.endCut:1)*s,this._middleCut=(t.middleCut!==void 0?t.middleCut:0)*s,this._invert=t.invert!==void 0&&t.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(e){const{_beginCut:t,_endCut:s,_middleCut:i}=this,n=e.pathLength(),r=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(t!==0||s!==0||i!==0)if(t+s+i>=n)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else this._curveHelper.appendSubCurve(r,e,0,t),this._curveHelper.appendSubCurve(r,e,.5*(n-i),.5*(n+i)),this._curveHelper.appendSubCurve(r,e,n-s,s)}else if(t===0&&s===0&&i===0)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else t+s+i0&&(n/=this._currentPosition.segmentLength),this._currentPosition.copyTo(t);t.abscissa+e*this._partLengthRatio>t.segmentLength+this._tolerance;){if(s){if(s.pathSize===0)if(n===0){const o=t.segment[0];s.pushXY(o[0],o[1])}else s.pushPoint(this.getSegCoord2D(t.segment,n));const r=t.segment[1];s.pushXY(r[0],r[1])}if(n=0,e-=(t.segmentLength-t.abscissa)/this._partLengthRatio,this._partSegCount)t.segment=this._nextSegment(),t.segmentLength=this.getSegLength(t.segment),t.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==$t.FAIL&&(t.segmentLength=this.getSegLength(t.segment),t.isPartEnd=!0,i===$t.END?(t.abscissa=t.segmentLength,t.isPathEnd=!0):t.abscissa=t.segmentLength+e,!0);this._currentPosition.copyTo(t)}}if(t.abscissa+=e*this._partLengthRatio,s){s.pathSize===0&&(n===0?s.pushPoint(t.segment[0]):s.pushPoint(this.getSegCoord2D(t.segment,n)));const r=t.abscissa/t.segmentLength;r===1?s.pushPoint(t.segment[1]):s.pushPoint(this.getSegCoord2D(t.segment,r))}return this._partSegCount||Math.abs(t.abscissa-t.segmentLength)=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const i=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,n=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let r=Math.round((this._partLength-(i+n))/this._patternLength);r<=0&&(r=i+n>0?0:1),this._partLengthRatio=this._partLength/(i+n+r*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=t;)i-=t,t=this._pattern.nextValue(),r=!r;t-=i,r?(this._walker.nextPosition(t),t=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(t),t=this._pattern.nextValue(),this._walker.nextPosition(t),t=this._pattern.nextValue())}let s=this._walker.nextCurve(t);if(s)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)s.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else t=this._pattern.nextValue(),!this._walker.nextPosition(t)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null;return s?.reset(),s}},In=class Ve{static local(){return Ve.instance===null&&(Ve.instance=new Ve),Ve.instance}execute(t,s,i,n,r,o){return new Ha(t,s,i,n,r,o)}};In.instance=null;let Ha=class{constructor(e,t,s,i,n,r){switch(this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._maxInflateSize=r*s,this._width=(t.width!==void 0?t.width:2)*s,t.method){case Se.Mitered:case Se.Bevelled:case Se.Rounded:case Se.TrueBuffer:case Se.Square:}this._option=t.option}next(){let e;for(;e=this._inputGeometries.next();){if(e.geometryType==="esriGeometryEnvelope"&&this._width>0){const t=e.asJSON();return Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0?e:N.fromJSONCIM({paths:[[[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]],[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}if(e.geometryType==="esriGeometryPolygon"){if(this._width===0)return e.clone();const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),-this._width,1);if(i){for(const n of i.rings)if(n){s.startPath();for(const r of n.reverse())s.pushXY(r[0],s.yFactor*r[1])}}return s}}return null}},kn=class He{static local(){return He.instance===null&&(He.instance=new He),He.instance}execute(t,s,i,n,r){return new Ba(t,s,i)}};kn.instance=null;let Ba=class extends pi{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._length=(t.length!==void 0?t.length:20)*s,this._angle=t.angle!==void 0?t.angle:225,this._position=t.position!==void 0?t.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(e){const t=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(e))return null;e.seekInPath(0);const s=e.x,i=e.y;e.seekInPath(e.pathSize-1);const n=e.x,r=e.y,o=[n-s,r-i];this._curveHelper.normalize(o);const a=s+(n-s)*this._position/100,h=i+(r-i)*this._position/100,l=Math.cos((90-this._angle)/180*Math.PI);let c=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(c=-c),this._mirror=!this._mirror;const u=[a-this._length/2*l,h-this._length/2*c],p=[a+this._length/2*l,h+this._length/2*c];return t.pushPath([[s,i],u,p,[n,r]]),t}},Tn=class Be{static local(){return Be.instance===null&&(Be.instance=new Be),Be.instance}execute(t,s,i,n,r){return new Xa(t,s,i)}};Tn.instance=null;let Xa=class{constructor(e,t,s){this._inputGeometries=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0}next(){let e=this._inputGeometries.next();for(;e;){if(e.totalSize>0)return this._move(e.clone(),this._offsetX,this._offsetY);e=this._inputGeometries.next()}return null}_move(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=e.x+t,e.y=e.y+s;return e.reset(),e}};const Ua=10;let zn=class Xe{static local(){return Xe.instance===null&&(Xe.instance=new Xe),Xe.instance}execute(t,s,i,n,r,o){return new Ya(t,s,i,n,r,o)}};zn.instance=null;let Ya=class{constructor(e,t,s,i,n,r){this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._curveHelper=new Lt,this._offset=(t.offset??1)*s,this._method=t.method,this._maxInflateSize=Math.max(Math.abs(r*s),Ua),this._option=t.option,this._offsetFlattenError=cs*s}next(){let e;for(;e=this._inputGeometries.next();){if(this._offset===0)return e.clone();if(e.geometryType==="esriGeometryEnvelope"){if(this._method===Kt.Rounded&&this._offset>0){const r=Jt(e),o=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(o){const a=N.createEmptyOptimizedCIM(e.geometryType);return a.pushPath(o),a}return null}const n=e.asJSON();if(ht(n)&&Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._offset>0)return N.fromJSONCIM({xmin:n.xmin-this._offset,xmax:n.xmax+this._offset,ymin:n.ymin-this._offset,ymax:n.ymax+this._offset})}const t=this._geometryEngine;if(t==null)continue;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.offset(cr.WebMercator,s.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return i?N.fromJSONCIM(i):null}return null}},Ln=class Ue{static local(){return Ue.instance===null&&(Ue.instance=new Ue),Ue.instance}execute(t,s,i,n,r){return new Wa(t,s,i)}};Ln.instance=null;let Wa=class{constructor(e,t,s){this._inputGeometries=e,this._reverse=t.reverse===void 0||t.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if(e.geometryType==="esriGeometryPolyline")return qa(e.clone());e=this._inputGeometries.next()}return null}};function qa(e){for(;e.nextPath();)for(let t=0;t0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._rotate(e.clone(),s,i)}e=this._inputGeometries.next()}return null}_rotate(e,t,s){const i=Math.cos(this._rotateAngle),n=Math.sin(this._rotateAngle);for(;e.nextPath();)for(;e.nextPoint();){const r=e.x-t,o=e.y-s;e.x=t+r*i-o*n,e.y=s+r*n+o*i}return e.reset(),e}},On=class We{static local(){return We.instance===null&&(We.instance=new We),We.instance}execute(t,s,i,n,r){return new ja(t,s,i)}};On.instance=null;let ja=class{constructor(e,t,s){this._inputGeometries=e,this._xFactor=t.xScaleFactor!==void 0?t.xScaleFactor:1.15,this._yFactor=t.yScaleFactor!==void 0?t.yScaleFactor:1.15}next(){const e=this._inputGeometries.next();if(e){if(this._xFactor===1&&this._yFactor===1||e.geometryType==="esriGeometryPoint")return e;if(e.totalSize>0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._scaleCursor(e.clone(),s,i)}}return null}_scaleCursor(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=t+(e.x-t)*this._xFactor,e.y=s+(e.y-s)*this._yFactor;return e.reset(),e}},En=class qe{static local(){return qe.instance===null&&(qe.instance=new qe),qe.instance}execute(t,s,i,n,r){return new Ja(t,s,i)}};En.instance=null;let Ja=class{constructor(e,t,s){this._inputGeometries=e,this._height=(t.amplitude!==void 0?t.amplitude:2)*s,this._period=(t.period!==void 0?t.period:3)*s,this._style=t.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new di,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new fi,this._walker.updateTolerance(s)}next(){let e=this._inputGeometries.next();for(;e;){if(this._height===0||this._period===0)return e;const t=this._processGeom(e);if(t)return t;e=this._inputGeometries.next()}return null}_processGeom(e){const t=N.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){t.startPath();const s=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case ws.Sinus:default:this._constructCurve(t,s,!1);break;case ws.Square:this._constructSquare(t,s);break;case ws.Triangle:this._constructTriangle(t,s);break;case ws.Random:this._constructCurve(t,s,!0)}else for(;e.nextPoint();)t.pushXY(e.x,e.y)}return t}_constructCurve(e,t,s){let i=Math.round(t/this._period);i===0&&(i=1);const n=i*16+1,r=t/i,o=this._period/16,a=1/n,h=2*Math.PI*t/r,l=2*Math.PI*Math.random(),c=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),p=.75-Math.random()/2,d=.75-Math.random()/2,f=new Mt;this._walker.curPointAndAngle(f),e.pushPoint(f.pt);let m=0;for(;;){if(!this._walker.nextPointAndAngle(o,f)){e.pushPoint(this._walker.getPathEnd());break}{const _=m;let y;if(m+=a,s){const b=this._height/2*(1+.3*Math.sin(p*h*_+l));y=b*Math.sin(h*_+c),y+=b*Math.sin(d*h*_+u),y/=2}else y=.5*this._height*Math.sin(.5*h*_);e.pushXY(f.pt[0]-y*f.sa,f.pt[1]+y*f.ca)}}}_constructSquare(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period/2,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(this._walker.nextPosition(this._period/2)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca)),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}},Fn=class Ke{static local(){return Ke.instance===null&&(Ke.instance=new Ke),Ke.instance}execute(t,s,i,n,r){return new Za(t,s,i)}};Fn.instance=null;let Za=class extends fs{constructor(e,t,s){super(e),this._geometryWalker=new fi,this._geometryWalker.updateTolerance(s),this._angleToLine=t.angleToLine??!0,this._offset=(t.offset?t.offset:0)*s,this._originalEndings=t.endings,this._offsetAtEnd=(t.customEndingOffset?t.customEndingOffset:0)*s,this._position=-(t.offsetAlongLine?t.offsetAlongLine:0)*s,this._pattern=new di,this._pattern.init(t.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath)t=this._pattern.nextValue();else{this._originalEndings===Pt.WithFullGap&&this.isClosed?this._endings=Pt.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let i,n=!0;switch(this._endings){case Pt.NoConstraint:i=-this._position,i=this._adjustPosition(i),n=!1;break;case Pt.WithHalfGap:default:i=-this._pattern.lastValue()/2;break;case Pt.WithFullGap:i=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case Pt.WithMarkers:i=0;break;case Pt.Custom:i=-this._position,i=this._adjustPosition(i),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(e,this._pattern,n))return null;this._pattern.reset();let r=0;for(;i>r;)i-=r,r=this._pattern.nextValue();r-=i,t=r,this.iteratePath=!0}const s=new Mt;return this._geometryWalker.nextPointAndAngle(t,s)?this._endings===Pt.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===Pt.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(e){let t=e/this._pattern.length();return t-=Math.floor(t),t*this._pattern.length()}},Nn=class je{static local(){return je.instance===null&&(je.instance=new je),je.instance}execute(t,s,i,n,r){return new Qa(t,s,i)}};Nn.instance=null;let Qa=class extends fs{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._placePerPart=t.placePerPart??!1,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._type=t.extremityPlacement,this._position=t.offsetAlongLine!==void 0?t.offsetAlongLine*s:0,this._beginProcessed=!1}processMultiPath(e){return this._placePerPart?super.processMultiPath(e):this.processPath(e)}processPath(e){let t;switch(this._type){case Rt.Both:default:this._beginProcessed?(t=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(t=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case Rt.JustBegin:t=this._atExtremities(e,this._position,!0);break;case Rt.JustEnd:t=this._atExtremities(e,this._position,!1);case Rt.None:}return t}_atExtremities(e,t,s){if(this._placePerPart||(s?e.seekPath(0):e.seekPath(e.totalSize-1)),s||e.seekPathEnd(),s?e.nextPoint():e.prevPoint()){let i=0,[n,r]=[0,0],[o,a]=[e.x,e.y];for(;s?e.nextPoint():e.prevPoint();){n=o,r=a,o=e.x,a=e.y;const h=this._curveHelper.getLength(n,r,o,a);if(i+h>t){const l=(t-i)/h,[c,u]=this._curveHelper.getAngleCS(n,r,o,a,l),p=this._curveHelper.getCoord2D(n,r,o,a,l);return this.internalPlacement.setTranslate(p[0]-this._offset*u,p[1]+this._offset*c),this._angleToLine&&this.internalPlacement.setRotateCS(-c,-u),this.internalPlacement}i+=h}}return null}},$n=class Je{static local(){return Je.instance===null&&(Je.instance=new Je),Je.instance}execute(t,s,i,n,r){return new th(t,s,i)}};$n.instance=null;let th=class extends fs{constructor(e,t,s){super(e),this._walker=new fi,this._walker.updateTolerance(s),this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._beginGap=t.beginPosition!==void 0?t.beginPosition*s:0,this._endGap=t.endPosition!==void 0?t.endPosition*s:0,this._flipFirst=t.flipFirst===void 0||t.flipFirst,this._pattern=new di,this._pattern.init(t.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath){const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=e.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(e,this._pattern,!1))return null;this._pattern.reset();const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a,this.iteratePath=!0}const s=new Mt;if(!this._walker.nextPointAndAngle(t,s,$t.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,r;return this._angleToLine?(n=s.ca,r=s.sa):(n=1,r=0),i&&(n=-n,r=-r),this.internalPlacement.setRotateCS(n,r),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const Et=512,eh=10,ut=24,ii=1e-6;let Rn=class Ze{static local(){return Ze.instance===null&&(Ze.instance=new Ze),Ze.instance}execute(t,s,i,n,r){return new sh(t,s,i,n,r)}};Rn.instance=null;let sh=class Ht{constructor(t,s,i,n,r){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(s.stepX??16)*i,this._stepY=Math.abs(s.stepY??16)*i,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=s.gridType??xi.Fixed,this._gridType===xi.Random){const o=s.seed??13,a=1;this._randomLCG=new un(o*a),this._randomness=(s.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=s.gridAngle??0,this._shiftOddRows=s.shiftOddRows??!1,this._offsetX=(s.offsetX??0)*i,this._offsetY=(s.offsetY??0)*i,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}if(this._graphicOriginX=0,this._graphicOriginY=0,n!=null){const[o,a,h,l]=n.split("/"),c=parseFloat(o),u=parseFloat(a),p=parseFloat(h),d=parseFloat(l);this._graphicOriginX=-(d*2**c+p)*Et,this._graphicOriginY=u*Et,this._testInsidePolygon=!0}this._internalPlacement=new ye,this._calculateMinMax(t),this._geometryCursor=t}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!Ht._randValues){Ht._randValues=[];for(let t=0;t=b,this._polygonMin=this._verticalSubdivision?p:f,this._testInsidePolygon){let P=0-this._graphicOriginX-this._offsetX-this._stepX,w=Et-this._graphicOriginX-this._offsetX+this._stepX,S=-Et-this._graphicOriginY-this._offsetY-this._stepY,L=0-this._graphicOriginY-this._offsetY+this._stepY;if(_){const V=[[P,S],[P,L],[w,S],[w,L]];P=S=Number.MAX_VALUE,w=L=-Number.MAX_VALUE;for(const U of V){const z=this._cosAngle*U[0]-this._sinAngle*U[1],O=this._sinAngle*U[0]+this._cosAngle*U[1];P=Math.min(P,z),w=Math.max(w,z),S=Math.min(S,O),L=Math.max(L,O)}}h=h!==Number.MAX_VALUE?Math.max(h,P):P,l=l!==Number.MAX_VALUE?Math.max(l,S):S,c=c!==-Number.MAX_VALUE?Math.min(c,w):w,u=u!==-Number.MAX_VALUE?Math.min(u,L):L}this._xMin=Math.round(h/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(l/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,f,m,p,d)}_buildAccelerationMap(t,s,i,n,r){t.reset();const o=new Map,a=this._verticalSubdivision,h=a?r-n:i-s;let l=Math.ceil(h/eh);if(l<=1)return;const c=Math.floor(h/l);let u,p,d,f,m,_,y,b,P,w,S;for(l++,this._delta=c,a?(P=-Et-2*this._stepY,w=2*this._stepY,S=n):(P=-2*this._stepX,w=Et+2*this._stepX,S=s);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(u=t.x,p=t.y;t.nextPoint();u=d,p=f){if(d=t.x,f=t.y,a){if(p===f||pw&&f>w)continue;m=Math.min(p,f),_=Math.max(p,f)}else{if(u===d||uw&&d>w)continue;m=Math.min(u,d),_=Math.max(u,d)}for(;m<_;)y=Math.floor((m-S)/c),Gr(y,u,p,d,f,o),m+=c;b=Math.floor((_-S)/c),b>y&&Gr(b,u,p,d,f,o)}this._accelerationMap=o}_nextInside(){for(;;){if(this._currentX>this._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 s=this._currentY*this._stepY+this._offsetY;let i,n;if(this._currentX++,this._gridType===xi.Random){const r=(this._currentX%ut+ut)%ut,o=(this._currentY%ut+ut)%ut;i=this._graphicOriginX+t+this._stepX*this._randomness*(.5-Ht._randValues[o*ut+r])*2/3,n=this._graphicOriginY+s+this._stepY*this._randomness*(.5-Ht._randValues[o*ut+r+1])*2/3}else i=this._graphicOriginX+this._cosAngle*t+this._sinAngle*s,n=this._graphicOriginY-this._sinAngle*t+this._cosAngle*s;if(!this._testInsidePolygon||this._isInsidePolygon(i,n,this._geometryCursor))return this._internalPlacement.setTranslate(i,n),this._internalPlacement}}_isInsidePolygon(t,s,i){if(this._accelerationMap==null)return ih(t,s,i);t+=ii,s+=ii;const n=this._verticalSubdivision,r=n?s:t,o=Math.floor((r-this._polygonMin)/this._delta),a=this._accelerationMap.get(o);if(!a)return!1;let h,l,c,u=0;for(const p of a){if(h=p[0],l=p[1],n){if(h[1]>s==l[1]>s)continue;c=(l[0]-h[0])*(s-h[1])-(l[1]-h[1])*(t-h[0])}else{if(h[0]>t==l[0]>t)continue;c=(l[1]-h[1])*(t-h[0])-(l[0]-h[0])*(s-h[1])}c>0?u++:u--}return u!==0}};function ih(e,t,s){let i,n,r,o,a=0;for(e+=ii,t+=ii,s.reset();s.nextPath();)if(s.nextPoint())for(i=s.x,n=s.y;s.nextPoint();i=r,n=o)r=s.x,o=s.y,n>t!=o>t&&((r-i)*(t-n)-(o-n)*(e-i)>0?a++:a--);return a!==0}function Gr(e,t,s,i,n,r){let o=r.get(e);o||(o=[],r.set(e,o)),o.push([[t,s],[i,n]])}const rh=.001;let Dn=class Qe{static local(){return Qe.instance===null&&(Qe.instance=new Qe),Qe.instance}execute(t,s,i,n,r){return new nh(t,s,i)}};Dn.instance=null;let nh=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._relativeTo=t.relativeTo,this._position=t.startPointOffset!==void 0?t.startPointOffset*s:0,this._epsilon=rh*s}processPath(e){const t=this._position;if(this._relativeTo===Me.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),e.nextPoint()){let[i,n]=[e.x,e.y],[r,o]=[0,0];for(;e.nextPoint();){r=e.x,o=e.y;const a=this._curveHelper.getLength(i,n,r,o);if(ai){const u=(i-r)/c,[p,d]=this._curveHelper.getAngleCS(o,a,h,l,u),f=this._curveHelper.getCoord2D(o,a,h,l,u),m=n?-this._offset:this._offset;return this.internalPlacement.setTranslate(f[0]-m*d,f[1]+m*p),this._angleToLine&&(n?this.internalPlacement.setRotateCS(-p,-d):this.internalPlacement.setRotateCS(p,d)),this.internalPlacement}o=h,a=l,r+=c}}return null}};const oh=1e-15;let Gn=class ts{static local(){return ts.instance===null&&(ts.instance=new ts),ts.instance}execute(t,s,i,n,r){return new ah(t,s,i)}};Gn.instance=null;let ah=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._endPoints=t.placeOnEndPoints===void 0||t.placeOnEndPoints,this._controlPoints=t.placeOnControlPoints===void 0||t.placeOnControlPoints,this._regularVertices=t.placeOnRegularVertices===void 0||t.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(e){if(this.iteratePath||(this._preparePath(e),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const t=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(t[2]);let s=t[0],i=t[1];if(this._offset!==0){const n=Math.cos(t[2]),r=Math.sin(t[2]);s-=this._offset*r,i+=this._offset*n}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(e){this._tags.length=0,this._tagIterator=0,e.seekPathStart();const t=e.isClosed();let s=0,i=!1,n=0,r=0;if(e.seekPathStart(),e.nextPoint()){let o=e.x,a=e.y,h=e.getControlPoint(),l=!0,c=e.nextPoint();for(;c;){const u=e.x,p=e.y,d=e.getControlPoint();(this._angleToLine||this._offset!==0)&&(n=this._curveHelper.getAngle(o,a,u,p,0)),l?(l=!1,t?(s=n,i=h):(this._endPoints||this._controlPoints&&h)&&this._tags.push([o,a,n])):h?this._controlPoints&&this._tags.push([o,a,Ts(r,n)]):this._regularVertices&&this._tags.push([o,a,Ts(r,n)]),(this._angleToLine||this._offset!==0)&&(r=this._curveHelper.getAngle(o,a,u,p,1)),c=e.nextPoint(),c||(t?d||i?this._controlPoints&&this._tags.push([u,p,Ts(r,s)]):this._regularVertices&&this._tags.push([u,p,Ts(r,s)]):(this._endPoints||this._controlPoints&&d)&&this._tags.push([u,p,r])),o=u,a=p,h=d}}this._tagIterator=0}};function Ts(e,t){const s=Math.PI;for(;Math.abs(t-e)>s+2*oh;)t-e>s?t-=2*s:t+=2*s;return(e+t)/2}const hh=100*222045e-21;function lh(e){if(e.totalSize===0)return null;const t=ui(e);if(!t)return null;const s=4*(Math.abs(t[0])+Math.abs(t[2])+Math.abs(t[1])+Math.abs(t[3])+1)*hh;let i=0,n=0;e.reset();for(let z=0;e.nextPath();z++){const O=e.getCurrentRingArea();O>n&&(n=O,i=z)}if(e.seekPath(i),e.pathSize===0)return null;e.seekPathStart();const r=Ko(e);if(Math.abs(n)<=2*s*s)return[(r[0]+r[2])/2,(r[1]+r[3])/2];e.seekPathStart();const o=jo(e,Qt());if(o===null)return null;if(e.totalPoints<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],h=[NaN,NaN,NaN,NaN],l=[NaN,NaN,NaN,NaN];let c=!1,u=Ie(o,e,!0);u.distance===0&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],u=Ie(o,e,!1)),h[0]=u.distance,l[0]=0;const p=[NaN,NaN];let d=!1,f=.25,m=-1,_=NaN;do if(_=NaN,a[1]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[1][0])||isNaN(a[1][1])||(u=Ie(a[1],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[1],e))d=!0,h[1]=_,l[1]=Bt(a[1],o);else if(!isNaN(_)&&_>m&&(m=_,p[0]=a[1][0],p[1]=a[1][1]),f-=.01,f<.1){if(!(m>=0))break;d=!0,h[1]=m,a[1][0]=p[0],a[1][1]=p[1],l[1]=Bt(a[1],o)}while(!d);d=!1,f=.5,m=-1;let y=.01,b=1;do if(_=NaN,a[2]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[2][0])||isNaN(a[2][1])||(u=Ie(a[2],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[2],e))d=!0,h[2]=_,l[2]=Bt(a[2],o);else if(!isNaN(_)&&_>m)m=_,p[0]=a[2][0],p[1]=a[2][1];else if(_>m&&(m=_,p[0]=a[2][0],p[1]=a[2][1]),f=.5+y*b,y+=.01,b*=-1,f<.3||f>.7){if(!(m>=0))break;d=!0,h[2]=m,a[2][0]=p[0],a[2][1]=p[1],l[2]=Bt(a[2],o)}while(!d);d=!1,f=.75,m=-1;do if(_=NaN,a[3]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[3][0])||isNaN(a[3][1])||(u=Ie(a[3],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[3],e))d=!0,h[3]=_,l[3]=Bt(a[3],o);else if(_>m&&(m=_,p[0]=a[3][0],p[1]=a[3][1]),f+=.01,f>.9){if(!(m>=0))break;d=!0,h[3]=m,a[3][0]=p[0],a[3][1]=p[1],l[3]=Bt(a[3],o)}while(!d);const P=[0,1,2,3],w=c?0:1;let S;for(let z=w;z<4;z++)for(let O=w;O<3;O++){const ot=l[O],Z=l[O+1];ph(ot,Z)>0&&(S=P[O],P[O]=P[O+1],P[O+1]=S,l[O]=Z,l[O+1]=ot)}let L=w,V=0,U=0;for(let z=w;z<4;z++){switch(z){case 0:U=2*h[P[z]];break;case 1:U=1.66666666*h[P[z]];break;case 2:U=1.33333333*h[P[z]];break;case 3:U=h[P[z]]}U>V&&(V=U,L=P[z])}return a[L]}function Vs(e,t){let s,i,n,r,o=0;for(t.reset();t.nextPath()&&t.nextPoint();)for(s=t.x,i=t.y;t.nextPoint();s=n,i=r)n=t.x,r=t.y,i>e[1]!=r>e[1]&&((n-s)*(e[1]-i)-(r-i)*(e[0]-s)>0?o++:o--);return o!==0}function Ie(e,t,s){if(s&&Vs(e,t))return{coord:e,distance:0};let i=1/0,n=0,r=0,o=[0,0],a=[0,0];const h=[0,0];for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(o[0]=t.x,o[1]=t.y;t.nextPoint();o=a){a=[t.x,t.y],Jo(h,e,o,a);const l=Bt(e,h);lo?mu)i&Vr?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):n&Vr?(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)):i?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e));else if(i&Hr?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):n&Hr?(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e)):i?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)),i&n)return 0}while(i|n);return l}function pt(e,t){return(e[0]t[2]?1:0)<<1|(e[1]t[3]?1:0)<<3}function Si(e,t,s){return e+(t-e)*s}function Bt(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}function ph(e,t){if(et)return 1;if(e===t)return 0;const s=isNaN(e),i=isNaN(t);return si?1:0}let Vn=class es{static local(){return es.instance===null&&(es.instance=new es),es.instance}execute(t,s,i,n,r){return new dh(t,s,i)}};Vn.instance=null;let dh=class{constructor(e,t,s){this._geometryCursor=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0,this._method=t.method!==void 0?t.method:vs.OnPolygon,this._placementPerPart=t.placePerPart!==void 0&&t.placePerPart,this._internalPlacement=new ye}next(){const e=this._geometryCursor;if(!e)return null;if(!this._placementPerPart)return this._geometryCursor=null,this._polygonCenter(e);for(;e.nextPath();)if(!(e.getCurrentRingArea()<0))return this._polygonCenter(e.getCurrentPath());return this._geometryCursor=null,null}_polygonCenter(e){let t=!1;switch(this._method){case vs.CenterOfMass:{const s=ea(e);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}break;case vs.BoundingBoxCenter:{const s=ui(e);s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),t=!0)}break;case vs.OnPolygon:default:{const s=lh(e);s!==null&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}}return t?this._internalPlacement:null}};function fh(e){if(!e)return null;switch(e.type){case"CIMGeometricEffectAddControlPoints":return Pn.local();case"CIMGeometricEffectArrow":return wn.local();case"CIMGeometricEffectBuffer":return vn.local();case"CIMGeometricEffectControlMeasureLine":return Sn.local();case"CIMGeometricEffectCut":return Mn.local();case"CIMGeometricEffectDashes":return Cn.local();case"CIMGeometricEffectDonut":return In.local();case"CIMGeometricEffectJog":return kn.local();case"CIMGeometricEffectMove":return Tn.local();case"CIMGeometricEffectOffset":return zn.local();case"CIMGeometricEffectReverse":return Ln.local();case"CIMGeometricEffectRotate":return An.local();case"CIMGeometricEffectScale":return On.local();case"CIMGeometricEffectWave":return En.local()}return null}function mh(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return Fn.local();case"CIMMarkerPlacementAtExtremities":return Nn.local();case"CIMMarkerPlacementAtRatioPositions":return $n.local();case"CIMMarkerPlacementInsidePolygon":return Rn.local();case"CIMMarkerPlacementOnLine":return Dn.local();case"CIMMarkerPlacementOnVertices":return Gn.local();case"CIMMarkerPlacementPolygonCenter":return Vn.local()}return null}const Mi=new No;function _h(e){if(e==null)return["",!1];if(!Mi.hasBidiChar(e))return[e,!1];let t;return t=Mi.checkContextual(e)==="rtl"?"IDNNN":"ICNNN",[Mi.bidiTransform(e,t,"VLYSN"),!0]}const pr="arial-unicode-ms",Br="woff2",Xr=new Map,gh=new Set;let yh=class{constructor(e,t){this.fontFace=e,this.promise=t}};async function Wc(e){const t=Ph(e),s=bh(e),i=Xr.get(t);if(i)return i.promise;const n=new FontFace(e.family,`url('${Qo.fontsUrl}/woff2/${s}.${Br}') format('${Br}')`,{style:e.style,weight:e.weight}),r=document.fonts;if(r.has(n)&&n.status==="loading")return n.loaded;const o=n.load().then(()=>(r.add(n),n));return Xr.set(t,new yh(n,o)),gh.add(n),o}function xh(e){if(!e)return pr;const t=e.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 bh(e){const t=Hn(e)+Bn(e);return xh(e.family)+(t.length>0?t:"-regular")}function Ph(e){const t=Hn(e)+Bn(e);return(e.family||pr)+(t.length>0?t:"-regular")}function Hn(e){if(!e.weight)return"";switch(e.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function Bn(e){if(!e.style)return"";switch(e.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let wh=class{applyColorSubstitution(e,t){if(!t)return e;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=e,n=this._rasterizationCanvas,r=n.getContext("2d",{willReadFrequently:!0});e!==n&&(n.width=s,n.height=i,r.drawImage(e,0,0,s,i));const o=r.getImageData(0,0,s,i).data;if(t){for(const h of t)if(h&&h.oldColor&&h.oldColor.length===4&&h.newColor&&h.newColor.length===4){const[l,c,u,p]=h.oldColor,[d,f,m,_]=h.newColor;if(l===d&&c===f&&u===m&&p===_)continue;for(let y=0;y0;let w=this._lineThroughWidthOffset,S=0;if(o){i.save();const Z=t.backgroundColor??[0,0,0,0],at=t.borderLine?.color??[0,0,0,0],Fo=2*(t.borderLine?.size??0);i.fillStyle=As(Z),i.strokeStyle=As(at),i.lineWidth=Fo,i.fillRect(0,0,s.width,s.height),i.strokeRect(0,0,s.width,s.height),i.restore()}P&&this._renderHalo(i,y,b,w,S,t),f>0&&this._renderOutline(i,y,b,w,S,t),S+=b,w+=y;for(const Z of this._textLines)P?(i.globalCompositeOperation="destination-out",i.fillStyle="rgb(0, 0, 0)",i.fillText(Z,w,S),i.globalCompositeOperation="source-over",i.fillStyle=this._fillStyle,i.fillText(Z,w,S)):(i.fillStyle=this._fillStyle,i.fillText(Z,w,S)),n&&n!=="none"&&this._renderDecoration(i,w,S,n,r),S+=d;i.restore();const L=this._renderedWidth+2*this._lineThroughWidthOffset,V=this._renderedHeight,U=i.getImageData(0,0,L,V),z=new Uint8Array(U.data);if(t.premultiplyColors){let Z;for(let at=0;at600)&&(s+=.3*e.measureText("w").width),s+=2*fe(this._parameters.halo.size),Math.round(s)}_computeLineHeightBase(){return 1.275*this._parameters.size}_computeLineHeight(){let e=this._computeLineHeightBase();const t=this._parameters.font.decoration;return t&&t==="underline"&&(e*=1.3),Math.round(e+2*fe(this._parameters.halo.size))}_renderDecoration(e,t,s,i,n,r){let o=.9*this._lineHeight;const a=n==="bold"?.06:n==="bolder"?.09:.04;switch(e.textAlign){case"center":t-=this._renderedWidth/2;break;case"right":t-=this._renderedWidth}const h=e.textBaseline;if(i==="underline")switch(o=.9*this._computeLineHeightBase(),h){case"top":s+=o;break;case"middle":s+=o/2}else if(i==="line-through")switch(h){case"top":s+=o/1.5;break;case"middle":s+=o/3}const l=r?1.5*r:Math.ceil(o*a);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=l,e.moveTo(t-this._lineThroughWidthOffset,s),e.lineTo(t+this._renderedWidth+2*this._lineThroughWidthOffset,s),e.stroke(),e.restore()}};function ke(e,t){const s=Math.max(t.size,.5),i=t.font,n=`${i.style} ${i.weight} ${fe(s).toFixed(1)}px ${i.family}, sans-serif`;let r;switch(e.font=n,e.textBaseline="top",t.horizontalAlignment){case"left":default:r="left";break;case"right":r="right";break;case"center":r="center"}e.textAlign=r}function Mh(e,t,s){return e==="center"?.5*t:e==="right"?t-s:s}function Yn(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Ch(){const e=Yn("svg");return e.setAttribute("style","position: absolute;"),e.setAttribute("width","0"),e.setAttribute("height","0"),e.setAttribute("aria-hidden","true"),e.setAttribute("role","presentation"),document.body.appendChild(e),e}function Ih(e){return e!=null&&document.body.removeChild(e),null}const kh=()=>ge.getLogger("esri.views.2d.engine.webgl.alignmentUtils");var yt,nt;function Th(e){if(!e)return yt.Center;switch(e){case"Left":case"left":return yt.Left;case"Right":case"right":return yt.Right;case"Justify":return kh().warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),yt.Center;case"Center":case"center":return yt.Center}}function zh(e){if(!e)return nt.Center;switch(e){case"Top":case"top":return nt.Top;case"Center":case"middle":return nt.Center;case"Baseline":case"baseline":return nt.Baseline;case"Bottom":case"bottom":return nt.Bottom}}function qc(e){switch(e){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return["right","bottom"];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return["center","bottom"];case"above-right":case"esriServerPointLabelPlacementAboveRight":return["left","bottom"];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return["right","middle"];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return["center","middle"];case"center-right":case"esriServerPointLabelPlacementCenterRight":return["left","middle"];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return["right","top"];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return["center","top"];case"below-right":case"esriServerPointLabelPlacementBelowRight":return["left","top"];default:return console.debug(`Found invalid placement type ${e}`),["center","middle"]}}function Kc(e){switch(e){case yt.Right:case"right":return-1;case yt.Center:case"center":return 0;case yt.Left:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${e}`),0}}function jc(e){switch(e){case nt.Top:case"top":return 1;case nt.Center:case"middle":return 0;case nt.Bottom:case nt.Baseline:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${e}`),0}}(function(e){e[e.Left=-1]="Left",e[e.Center=0]="Center",e[e.Right=1]="Right"})(yt||(yt={})),function(e){e[e.Top=1]="Top",e[e.Center=0]="Center",e[e.Bottom=-1]="Bottom",e[e.Baseline=2]="Baseline"}(nt||(nt={}));const dr=22,Wn=4,Lh=dr+Wn,Ah=dr-6,Ur=3,Oh=Math.PI/180,Ft=8,Eh=1.5;let qn=class{constructor(e,t,s,i){this._rotationT=rs(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=s.rect,r=new Float32Array(8);e*=i,t*=i;const o=s.code?n.width*i:s.metrics.width,a=s.code?n.height*i:s.metrics.height;this.width=o,this.height=a,r[0]=e,r[1]=t,r[2]=e+o,r[3]=t,r[4]=e,r[5]=t+a,r[6]=e+o,r[7]=t+a,this._data=r,this._setTextureCoords(n),this._scale=i,this._mosaic=s,this.x=e,this.y=t,this.maxOffset=Math.max(e+o,t+a)}get mosaic(){return this._mosaic}set angle(e){this._angle=e,yn(this._rotationT,-e),this._setOffsets()}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._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:e,width:t}=this._mosaic.metrics,s=t*this._scale,i=Math.abs(e)*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 r=Ti(rs(),this._rotationT,this._transform);Sa(n,n,r);let o=1/0,a=1/0,h=-1/0,l=-1/0;for(let f=0;f<4;f++){const m=n[2*f],_=n[2*f+1];o=Math.min(o,m),a=Math.min(a,_),h=Math.max(h,m),l=Math.max(l,_)}const c=h-o,u=l-a,p=o+c/2,d=a+u/2;this._bounds=new Ee(p,d,c,u)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const e=Ti(rs(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0],this._offsets.topLeft[1]=this._data[1],this._offsets.topRight[0]=this._data[2],this._offsets.topRight[1]=this._data[3],this._offsets.bottomLeft[0]=this._data[4],this._offsets.bottomLeft[1]=this._data[5],this._offsets.bottomRight[0]=this._data[6],this._offsets.bottomRight[1]=this._data[7],ce(this._offsets.topLeft,this._offsets.topLeft,e),ce(this._offsets.topRight,this._offsets.topRight,e),ce(this._offsets.bottomLeft,this._offsets.bottomLeft,e),ce(this._offsets.bottomRight,this._offsets.bottomRight,e)}_setTextureCoords({x:e,y:t,width:s,height:i}){this._texcoords={topLeft:[e,t],topRight:[e+s,t],bottomLeft:[e,t+i],bottomRight:[e+s,t+i]}}};const Fh=(e,t)=>({code:0,page:0,sdf:!0,rect:new Ma(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:e,left:0,top:0}});function Te(e,t){return e.forEach(s=>ce(s,s,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}let Nh=class{constructor(e,t,s){this._rotation=0,this._decorate(e,t,s),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=s.angle!==0,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const i of e)i.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;const t=this._transform,s=yn(rs(),e);Ti(t,s,t);for(const i of this.glyphs)i.setTransform(this._transform)}_decorate(e,t,s){if(!s.decoration||s.decoration==="none"||!e.length)return;const i=s.scale,n=s.decoration==="underline"?Lh:Ah,r=e[0].textureBinding;for(const o of t){const a=o.startX*i,h=o.startY*i,l=(o.width+o.glyphWidthEnd)*i;e.push(new qn(a,h+n*i,Fh(l,r),1))}}shapeBackground(e){const t=this._borderLineSizePx||0,s=(Eh+t)/2,i=this._borderLineSizePx?s:0,{xmin:n,ymin:r,xmax:o,ymax:a,x:h,y:l,width:c,height:u}=this.bounds,p=[n-Ft,r-Ft],d=[o+Ft,r-Ft],f=[n-Ft,a+Ft],m=[o+Ft,a+Ft],_=Te([[p[0]-s,p[1]-s],[d[0]+s,d[1]-s],[p[0]+i,p[1]+i],[d[0]-i,d[1]+i]],e),y=Te([[f[0]+i,f[1]-i],[m[0]-i,m[1]-i],[f[0]-s,f[1]+s],[m[0]+s,m[1]+s]],e),b=Te([[p[0]-s,p[1]-s],[p[0]+i,p[1]+i],[f[0]-s,f[1]+s],[f[0]+i,f[1]-i]],e),P=Te([[d[0]-i,d[1]+i],[d[0]+s,d[1]-s],[m[0]-i,m[1]-i],[m[0]+s,m[1]+s]],e),w={main:Te([p,d,f,m],e),top:_,bot:y,left:b,right:P};return[new Ee(h,l,c+2*s,u+2*s),w]}get boundsT(){const e=this.bounds,t=Ss(Er(),e.x,e.y);if(ce(t,t,this._transform),this._hasRotation){const s=Math.max(e.width,e.height);return new Ee(t[0],t[1],s,s)}return new Ee(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,s=1/0,i=0,n=0;for(const a of e)t=Math.min(t,a.xTopLeft),s=Math.min(s,a.yTopLeft),i=Math.max(i,a.xBottomRight),n=Math.max(n,a.yBottomRight);const r=i-t,o=n-s;return new Ee(t+r/2,s+o/2,r,o)}_createGlyphTransform(e,t){const s=Oh*t.angle,i=rs(),n=Er();return Pi(i,i,Ss(n,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?Or(i,i,s):(Pi(i,i,Ss(n,e.x,e.y)),Or(i,i,s),Pi(i,i,Ss(n,-e.x,-e.y))),i}},Os=class{constructor(e,t,s,i,n,r){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,s)),this.end=Math.max(0,Math.max(t,s)),this.ende===10,Yr=e=>e===32;function $h(e,t,s){const i=new Array,n=1/s.scale,r=s.maxLineWidth*n,o=t?e.length-1:0,a=t?-1:e.length,h=t?-1:1;let l=o,c=0,u=0,p=l,d=p,f=0,m=1/0,_=0;for(;l!==a;){const{code:b,metrics:P}=e[l],w=Math.abs(P.top);if(Ei(b)||Yr(b)||(m=Math.min(m,w),_=Math.max(_,w+P.height)),Ei(b))l!==o&&(i.push(new Os(e,p,l-h,c,m===1/0?0:m,_)),m=1/0,_=0),c=0,p=l+h,d=l+h,u=0;else if(Yr(b))d=l+h,u=0,f=P.advance,c+=P.advance;else if(c>r){if(d!==p){const S=d-2*h;c-=f,i.push(new Os(e,p,S,c-u,m,_)),m=1/0,_=0,p=d,c=u}else i.push(new Os(e,p,l-h,c,m,_)),m=1/0,_=0,p=l,d=l,c=0;c+=P.advance,u+=P.advance}else c+=P.advance,u+=P.advance;l+=h}const y=new Os(e,p,l-h,c,m,_);return y.start>=0&&y.endge.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");let Xt=class dt{constructor(t){this._t=t}static createIdentity(){return new dt([1,0,0,0,1,0])}clone(){const t=this._t;return new dt(t.slice())}transform(t){const s=this._t;return[s[0]*t[0]+s[1]*t[1]+s[2],s[3]*t[0]+s[4]*t[1]+s[5]]}static createScale(t,s){return new dt([t,0,0,0,s,0])}scale(t,s){const i=this._t;return i[0]*=t,i[1]*=t,i[2]*=t,i[3]*=s,i[4]*=s,i[5]*=s,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,s){return new dt([0,0,t,0,0,s])}translate(t,s){const i=this._t;return i[2]+=t,i[5]+=s,this}static createRotate(t){const s=Math.cos(t),i=Math.sin(t);return new dt([s,-i,0,i,s,0])}rotate(t){return dt.multiply(this,dt.createRotate(t),this)}angle(){const t=this._t[0],s=this._t[3],i=Math.sqrt(t*t+s*s);return[t/i,s/i]}static multiply(t,s,i){const n=t._t,r=s._t,o=n[0]*r[0]+n[3]*r[1],a=n[1]*r[0]+n[4]*r[1],h=n[2]*r[0]+n[5]*r[1]+r[2],l=n[0]*r[3]+n[3]*r[4],c=n[1]*r[3]+n[4]*r[4],u=n[2]*r[3]+n[5]*r[4]+r[5],p=i._t;return p[0]=o,p[1]=a,p[2]=h,p[3]=l,p[4]=c,p[5]=u,i}invert(){const t=this._t;let s=t[0]*t[4]-t[1]*t[3];if(s===0)return new dt([0,0,0,0,0,0]);s=1/s;const i=(t[1]*t[5]-t[2]*t[4])*s,n=(t[2]*t[3]-t[0]*t[5])*s,r=t[4]*s,o=-t[1]*s,a=-t[3]*s,h=t[0]*s;return new dt([r,o,i,a,h,n])}};class fr{constructor(t,s){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new Uo(ye,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(s||Xt.createIdentity()),this._sizeTransfos.push(s?s.scaleRatio():1)}setTransform(t,s){this._transfos=[t||Xt.createIdentity()],this._sizeTransfos=[s||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,s){const i=s?t.scaleRatio():1;Xt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*i)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,s,i){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,s);break;case"CIMTextSymbol":this.drawTextSymbol(t,s,i)}}drawMultiLayerSymbol(t,s){if(!t||!s)return;const i=t.symbolLayers;if(!i)return;const n=t.effects;if(n&&n.length>0){const r=this.executeEffects(n,s);if(r){let o=r.next();for(;o;)this.drawSymbolLayers(i,o.asJSON()),o=r.next()}}else this.drawSymbolLayers(i,s)}executeEffects(t,s){const i=this._resourceManager.geometryEngine;let n=new Oa(N.fromJSONCIM(s));for(const r of t){const o=fh(r);o&&(n=o.execute(n,r,this.geomUnitsPerPoint(),null,i))}return n}drawSymbolLayers(t,s){let i=t.length;for(;i--;){const n=t[i];if(!n||n.enable===!1)continue;const r=n.effects;if(r&&r.length>0){const o=this.executeEffects(r,s);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(n,a.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(n,s);if(this._earlyReturn)return}}drawSymbolLayer(t,s){switch(t.type){case"CIMSolidFill":this.drawSolidFill(s,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(s,t);break;case"CIMPictureFill":this.drawPictureFill(s,t);break;case"CIMGradientFill":this.drawGradientFill(s,t);break;case"CIMSolidStroke":this.drawSolidStroke(s,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(s,t);break;case"CIMGradientStroke":this.drawGradientStroke(s,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,s)}}drawHatchFill(t,s){const i=Hh(s,t,this.geomUnitsPerPoint());i&&(this.pushClipPath(t),this.drawMultiLayerSymbol(s.lineSymbol,i),this.popClipPath())}drawPictureFill(t,s){}drawGradientFill(t,s){}drawPictureStroke(t,s){}drawGradientStroke(t,s){}drawMarkerLayer(t,s){const i=t.markerPlacement;if(i){const n=mh(i);if(n){const r=i.type==="CIMMarkerPlacementInsidePolygon"||i.type==="CIMMarkerPlacementPolygonCenter"&&i.clipAtBoundary;r&&this.pushClipPath(s);const o=n.execute(N.fromJSONCIM(s),i,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let a=null;for(;(a=o.next())&&(this.drawMarker(t,a),!this._earlyReturn););}r&&this.popClipPath()}}else{const n=this._placementPool.acquire();if(ki(s))n.tx=s.x,n.ty=s.y,this.drawMarker(t,n);else if(rt(s)){const r=Yo(s);r&&([n.tx,n.ty]=r,this.drawMarker(t,n))}else for(const r of s.points)if(n.tx=r[0],n.ty=r[1],this.drawMarker(t,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(t,s){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,s);break;case"CIMVectorMarker":this.drawVectorMarker(t,s)}}drawPictureMarker(t,s){if(!t)return;const i=this._resourceManager.getResource(t.url),n=C(t.size,Tt.CIMPictureMarker.size);if(i==null||n<=0)return;const r=i.width,o=i.height;if(!r||!o)return;const a=r/o,h=C(t.scaleX,1),l=Xt.createIdentity(),c=t.anchorPoint;if(c){let _=c.x,y=c.y;t.anchorPointUnits!=="Absolute"&&(_*=n*a*h,y*=n),l.translate(-_,-y)}let u=C(t.rotation);t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*Wt);let p=C(t.offsetX),d=C(t.offsetY);if(p||d){if(this._mapRotation){const _=Wt*this._mapRotation,y=Math.cos(_),b=Math.sin(_),P=p*b+d*y;p=p*y-d*b,d=P}l.translate(p,d)}const f=this.geomUnitsPerPoint();f!==1&&l.scale(f,f);const m=s.getAngle();m&&l.rotate(m),l.translate(s.tx,s.ty),this.push(l,!1),this.drawImage(t,n),this.pop()}drawVectorMarker(t,s){if(!t)return;const i=t.markerGraphics;if(!i)return;const n=C(t.size,Tt.CIMVectorMarker.size),r=t.frame,o=r?r.ymax-r.ymin:0,a=n&&o?n/o:1,h=Xt.createIdentity();r&&h.translate(.5*-(r.xmax+r.xmin),.5*-(r.ymax+r.ymin));const l=t.anchorPoint;if(l){let m=l.x,_=l.y;t.anchorPointUnits!=="Absolute"?r&&(m*=r.xmax-r.xmin,_*=r.ymax-r.ymin):(m/=a,_/=a),h.translate(-m,-_)}a!==1&&h.scale(a,a);let c=C(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&h.rotate(c*Wt);let u=C(t.offsetX),p=C(t.offsetY);if(u||p){if(this._mapRotation){const m=Wt*this._mapRotation,_=Math.cos(m),y=Math.sin(m),b=u*y+p*_;u=u*_-p*y,p=b}h.translate(u,p)}const d=this.geomUnitsPerPoint();d!==1&&h.scale(d,d);const f=s.getAngle();f&&h.rotate(f),h.translate(s.tx,s.ty),this.push(h,t.scaleSymbolsProportionally);for(const m of i){m?.symbol&&m.geometry||Dh().error("Invalid marker graphic",m);let _=m.textString;if(typeof _=="number"&&(_=_.toString()),this.drawSymbol(m.symbol,m.geometry,_),this._earlyReturn)break}this.pop()}drawTextSymbol(t,s,i){if(!t||!ki(s)||C(t.height,Tt.CIMTextSymbol.height)<=0)return;const n=Xt.createIdentity();let r=C(t.angle);r=-r,r&&n.rotate(r*Wt);const o=C(t.offsetX),a=C(t.offsetY);(o||a)&&n.translate(o,a);const h=this.geomUnitsPerPoint();h!==1&&n.scale(h,h),n.translate(s.x,s.y),this.push(n,!1),this.drawText(t,i),this.pop()}}let Gh=class extends fr{constructor(e,t){super(e,t),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new vh(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return Ho(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(e){if(e&&!(this._clipCount>0))if(rt(e))this._processPath(e.rings,0);else if(gt(e))this._processPath(e.paths,0);else if(ht(e)){const t=qt(e);t&&this._processPath(t.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(e,t,s){if(!e||this._clipCount>0||s==null||s<=0)return;const i=Math.max(.5*this.transformSize(C(s,Tt.CIMSolidStroke.width)),.5*Zn);if(rt(e))this._processPath(e.rings,i);else if(gt(e))this._processPath(e.paths,i);else if(ht(e)){const n=qt(e);n&&this._processPath(n.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(e,t){rt(t)&&e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._processPath(t.rings,0):super.drawMarkerLayer(e,t)}drawHatchFill(e,t){this.drawSolidFill(e)}drawPictureFill(e,t){this.drawSolidFill(e)}drawGradientFill(e,t){this.drawSolidFill(e)}drawPictureStroke(e,t){this.drawSolidStroke(e,null,t.width)}drawGradientStroke(e,t){this.drawSolidStroke(e,null,t.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,t){const{url:s}=e,i=C(e.scaleX,1);let n=i*t,r=t;const o=this._resourceManager.getResource(s);if(o!=null){const a=o.height/o.width;n=i*(t?a>1?t:t/a:o.width),r=t?a>1?t*a:t:o.height}this._merge(this.transformPt([-n/2,-r/2]),0),this._merge(this.transformPt([-n/2,r/2]),0),this._merge(this.transformPt([n/2,-r/2]),0),this._merge(this.transformPt([n/2,r/2]),0)}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const s=to(e);let[i,n]=this._textRasterizer.computeTextSize(t,s);i=bt(i),n=bt(n);const r=this.transformSize(1)*this.reverseTransformScalar(1);i*=r,n*=r;let o=0;switch(e.horizontalAlignment){case"Left":o=i/2;break;case"Right":o=-i/2}let a=0;switch(e.verticalAlignment){case"Bottom":a=n/2;break;case"Top":a=-n/2;break;case"Baseline":a=n/6}this._merge(this.transformPt([-i/2+o,-n/2+a]),0),this._merge(this.transformPt([-i/2+o,n/2+a]),0),this._merge(this.transformPt([i/2+o,-n/2+a]),0),this._merge(this.transformPt([i/2+o,n/2+a]),0)}_processPath(e,t){if(e)for(const s of e){const i=s?s.length:0;if(i>1){this._merge(this.transformPt(s[0]),t);for(let n=1;nthis._xmax&&(this._xmax=e[0]+t),e[1]-tthis._ymax&&(this._ymax=e[1]+t)}},Qc=class extends fr{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=Ih(this._svg),this._path=null,this._canvas=null}hitTest(e,t,s,i,n,r){const o=r*fe(1);this.setTransform(),this.setGeomUnitsPerPoint(o),this._searchPoint=[(e[0]+e[2])/2,(e[1]+e[3])/2],this._searchDistPoint=(e[2]-e[0])/2/o,this._textInfo=i;const a=t&&(t.type==="CIMPointSymbol"&&t.angleAlignment!=="Map"||t.type==="CIMTextSymbol");if(this._mapRotation=a?n:0,!li("esri-mobile")){const h=bt(xa*window.devicePixelRatio),l=bt(ba);!((t?.type==="CIMLineSymbol"||t?.type==="CIMPolygonSymbol")&&t.symbolLayers?.some(ca))&&t?.type!=="CIMMeshSymbol"&&(ua(t)??0)d.xTopLeft&&u-d.yBottomRight&&p<-d.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(e){let t=null;if(ht(e)){const i=e;t=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))t=e.rings;else{if(!gt(e))return;t=e.paths}const s=this.reverseTransformPt(this._searchPoint);Bh(s,t)&&(this._earlyReturn=!0),!this._earlyReturn&&Wr(s,t,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}_getSvgPath(){return this._svg!=null&&this._path!=null||(this._svg??=Ch(),this._path??=Yn("path"),this._svg.appendChild(this._path)),this._path}_getCanvas(){return this._canvas??=document.createElement("canvas"),this._canvas}_hittestSvgPath(e,t,s,i){const n=Qt();lr(n,e);const r={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},o=this._getSvgPath();o.setAttribute("d",t);const a=o.getBBox(),h=a.width/r.width,l=a.height/r.height,c=this._getCanvas();c.width=a.width,c.height=a.height;const u=c.getContext("2d",{willReadFrequently:!0});u.setTransform(1,0,0,1,a.x,-a.y);const p=new Path2D(t);s?u.fill(p):(u.lineWidth=i*h,u.stroke(p));const d=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),f=this.reverseTransformPt(this._searchPoint),m=(f[0]-r.x-d)*h,_=(r.height-(f[1]-r.y)-d)*l,y=2*d*h,b=2*d*l,P=u.getImageData(m,_,y,b).data;for(let w=3;w127.5)return void(this._earlyReturn=!0)}_hitTestStroke(e,t){let s=null;if(ht(e)){const i=e;s=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))s=e.rings;else{if(!gt(e))return;s=e.paths}Wr(this.reverseTransformPt(this._searchPoint),s,C(t,Tt.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}};class Vh extends fr{constructor(t,s,i,n){super(s,i),this._applyAdditionalRenderProps=n,this._colorSubstitutionHelper=new wh,this._ctx=t}drawSolidFill(t,s){if(!t)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const i=this._ctx;i.fillStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",i.fill("evenodd")}drawSolidStroke(t,s,i,n,r,o){if(!t||!s||i===0)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!1);else{if(!ht(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(qt(t).rings,!0)}const a=this._ctx;a.strokeStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",a.lineWidth=Math.max(this.transformSize(i),Zn),this._setCapStyle(n),this._setJoinStyle(r),a.miterLimit=o,a.stroke()}pushClipPath(t){if(this._ctx.save(),rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else{if(!ht(t))return;this._buildPath(qt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,s){const{colorSubstitutions:i,url:n,tintColor:r}=t,o=C(t.scaleX,1),a=this._resourceManager.getResource(n);if(a==null)return;let h=s*(a.width/a.height),l=s;s||(h=a.width,l=a.height);const c=se(n)||"src"in a&&se(a.src);let u="getFrame"in a?Ci(a):a;i&&(u=this._colorSubstitutionHelper.applyColorSubstitution(u,i)),this._applyAdditionalRenderProps&&!c&&r&&(u=this._colorSubstitutionHelper.tintImageData(u,r));const p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=this.transformSize(1),_=this._ctx;_.save(),_.setTransform({m11:o*m*d,m12:o*m*f,m21:-m*f,m22:m*d,m41:p[0],m42:p[1]}),_.drawImage(u,-h/2,-l/2,h,l),_.restore()}drawText(t,s){if(!s||s.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const i=to(t,this.transformSize(bt(1))),n=this._textRasterizer.rasterizeText(s,i);if(!n)return;const{size:r,anchorX:o,anchorY:a,canvas:h}=n,l=r[0]*(o+.5),c=r[1]*(a-.5),u=this._ctx,p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=1;u.save(),u.setTransform({m11:m*d,m12:m*f,m21:-m*f,m22:m*d,m41:p[0]-m*l,m42:p[1]+m*c}),u.drawImage(h,0,0),u.restore()}drawPictureFill(t,s){if(!t)return;let{colorSubstitutions:i,height:n,offsetX:r,offsetY:o,rotation:a,scaleX:h,tintColor:l,url:c}=s;const u=this._resourceManager.getResource(c);if(u==null)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const p=this._ctx,d=se(c)||"src"in u&&se(u.src);let f,m="getFrame"in u?Ci(u):u;if(i&&(m=this._colorSubstitutionHelper.applyColorSubstitution(m,i)),this._applyAdditionalRenderProps){d||l&&(m=this._colorSubstitutionHelper.tintImageData(m,l)),f=p.createPattern(m,"repeat");const _=this.transformSize(1);a||(a=0),r?r*=_:r=0,o?o*=_:o=0,n&&(n*=_);const y=n?n/u.height:1,b=h&&n?h*n/u.width:1;if(a!==0||y!==1||b!==1||r!==0||o!==0){const P=new DOMMatrix;P.rotateSelf(0,0,-a).translateSelf(r,o).scaleSelf(b,y,1),f.setTransform(P)}}else f=p.createPattern(m,"repeat");p.save(),p.fillStyle=f,p.fill("evenodd"),p.restore()}drawPictureStroke(t,s){if(!t)return;let{colorSubstitutions:i,capStyle:n,joinStyle:r,miterLimit:o,tintColor:a,url:h,width:l}=s;const c=this._resourceManager.getResource(h);if(c==null)return;let u;if(rt(t))u=t.rings;else if(gt(t))u=t.paths;else{if(!ht(t))return Ds(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;u=qt(t).rings}l||(l=c.width);const p=se(h)||"src"in c&&se(c.src);let d="getFrame"in c?Ci(c):c;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(p||a&&(d=this._colorSubstitutionHelper.tintImageData(d,a)));const f=Math.max(this.transformSize(fe(l)),.5),m=f/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let b,P;_.save(),this._setCapStyle(n),this._setJoinStyle(r),o!==void 0&&(_.miterLimit=o),_.lineWidth=f;for(let w of u)if(w=pe(w),Yh(w),w&&!(w.length<=1)){b=this.transformPt(w[0]);for(let S=1;S1){let o=this.transformPt(n[0]);i.moveTo(o[0],o[1]);for(let a=1;ao;)r-=i;for(;r<-o;)r+=i;const a=Qt();lr(a,t),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;n>180;)n-=180;for(;n<0;)n+=180;const l=Math.cos(n*Wt),c=Math.sin(n*Wt),u=-i*c,p=i*l;let d,f,m,_;r=C(e.offsetX)*s*c-C(e.offsetY)*s*l,d=m=Number.MAX_VALUE,f=_=-Number.MAX_VALUE;for(const V of h){const U=V[0],z=V[1],O=l*U+c*z,ot=-c*U+l*z;d=Math.min(d,O),m=Math.min(m,ot),f=Math.max(f,O),_=Math.max(_,ot)}m=Math.floor(m/i)*i;let y=l*d-c*m-u*r/i,b=c*d+l*m-p*r/i,P=l*f-c*m-u*r/i,w=c*f+l*m-p*r/i;const S=1+Math.round((_-m)/i),L=[];for(let V=0;Ve[1]!=a[1]>e[1]&&((a[0]-o[0])*(e[1]-o[1])-(a[1]-o[1])*(e[0]-o[0])>0?s++:s--)}}return s!==0}function Wr(e,t,s){for(const i of t){const n=i.length;for(let r=1;r-s&&ce?{spatialReference:e.spatialReference,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:null,Qn=(e,t,s)=>{switch(e){case"ExtraLeading":return 1+t/s;case"Multiple":return t;case"Exact":return t/s}};function to(e,t=1){const s=fn(e),i=dn(e.fontStyleName),n=e.fontFamilyName??pr,{weight:r,style:o}=i,a=t*(e.height||5),h=pa(e.horizontalAlignment),l=da(e.verticalAlignment),c=bi(e),u=bi(e.haloSymbol),p=u!=null?t*(e.haloSize??0):0,d=Lr(e.symbol),f=t*(Ar(e.symbol)||0),m=e.callout?.type==="CIMBackgroundCallout"?e.callout.backgroundSymbol:null,_=bi(m),y=Ar(m),b=Lr(m);return{color:c,size:a,horizontalAlignment:h,verticalAlignment:l,font:{family:n,style:fa(o),weight:ma(r),decoration:s},outline:{size:f||0,color:d},halo:{size:p||0,color:u,style:o},backgroundColor:_,borderLine:y!=null&&b!=null?{size:y,color:b}:null,pixelRatio:1,premultiplyColors:!0}}const Uh=1e-4;function Yh(e){let t,s,i,n,r,o=e[0],a=1;for(;age.getLogger("esri.symbols.cim.CIMSymbolHelper");function tu(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const s=re.fromSimpleMarker(e);if(!s)throw new Error("InternalError: Cannot convert symbol to CIM");t=s;break}case"picture-marker":t=re.fromPictureMarker(e);break;case"simple-line":t=re.fromSimpleLineSymbol(e);break;case"simple-fill":t=re.fromSimpleFillSymbol(e);break;case"picture-fill":t=re.fromPictureFillSymbol(e);break;case"text":t=re.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function Hs(e,t,s){switch(t.type){case"CIMSymbolReference":return Hs(e,t.symbol,s);case"CIMPointSymbol":s==null&&(s={x:0,y:0}),e.drawSymbol(t,s);break;case"CIMLineSymbol":s==null&&(s={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,s);break;case"CIMPolygonSymbol":s==null&&(s={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,s);break;case"CIMTextSymbol":{const i={x:0,y:0};e.drawSymbol(t,i);break}case"CIMVectorMarker":{const i=new ye;e.drawMarker(t,i);break}}return e.envelope()}function Kh(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset);default:return 0}}function jh(e){if(!e)return 0;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(C(e.offsetX)),Math.abs(C(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function jr(e){if(!e)return 0;let t=0;for(const s of e)t+=jh(s);return t}let eu=class{static getSymbolInflateSize(e,t,s,i,n){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,s,i,n):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),s=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+s*s)}static _vectorMarkerBounds(e,t,s,i){let n=!0;const r=Qt();if(t?.markerGraphics)for(const o of t.markerGraphics){const a=[0,0,0,0];o.geometry&&(lr(r,o.geometry),a[0]=0,a[1]=0,a[2]=0,a[3]=0,this.getSymbolInflateSize(a,o.symbol,s,0,i),r[0]+=a[0],r[1]+=a[1],r[2]+=a[2],r[3]+=a[3],n?(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],n=!1):(e[0]=Math.min(e[0],r[0]),e[1]=Math.min(e[1],r[1]),e[2]=Math.max(e[2],r[2]),e[3]=Math.max(e[3],r[3])))}return e}static _getInflateSize(e,t,s,i,n){if(sl(t)){const r=this._getLayersInflateSize(e,t.symbolLayers,s,i,n),o=jr(t.effects);return o>0&&(r[0]-=o,r[1]-=o,r[2]+=o,r[3]+=o),r}return this._getTextInflatedSize(e,t,n)}static _getLayersInflateSize(e,t,s,i,n){let r=!0;if(!t)return e;for(const o of t){if(!o)continue;let a=[0,0,0,0];switch(o.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const l=o;let c=l.width;c!=null&&(l.capStyle===lt.Square||l.joinStyle===kt.Miter?c/=qh:c/=2,a[0]=-c,a[1]=-c,a[2]=c,a[3]=c);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const l=o;if(o.type==="CIMVectorMarker"){const f=o;if(a=this._vectorMarkerBounds(a,f,s,n),f.frame){const m=(f.frame.xmin+f.frame.xmax)/2,_=(f.frame.ymin+f.frame.ymax)/2;if(a[0]-=m,a[1]-=_,a[2]-=m,a[3]-=_,f.size!=null){const y=f.size/(f.frame.ymax-f.frame.ymin);a[0]*=y,a[1]*=y,a[2]*=y,a[3]*=y}}}else if(o.type==="CIMPictureMarker"){const f=o,m=s.getResource(f.url);let _=1;if(m!=null&&m.height&&(_=m.width/m.height),l.size!=null){const y=l.size/2,b=l.size*_*f.scaleX/2;a=[-b,-y,b,y]}}else if(l.size!=null){const f=l.size/2;a=[-f,-f,f,f]}if(l.anchorPoint){let f,m;l.anchorPointUnits==="Absolute"?(f=l.anchorPoint.x,m=l.anchorPoint.y):(f=l.anchorPoint.x*(a[2]-a[0]),m=l.anchorPoint.y*(a[3]-a[1]));const _=1.25*Math.sqrt(f*f+m*m);a[0]-=_,a[1]-=_,a[2]+=_,a[3]+=_}let c=C(l.rotation);if(l.rotateClockwise&&(c=-c),i&&(c-=i),c){const f=qr*c,m=Math.cos(f),_=Math.sin(f),y=Qt([bs,bs,-bs,-bs]);xs(y,[a[0]*m-a[1]*_,a[0]*_+a[1]*m]),xs(y,[a[0]*m-a[3]*_,a[0]*_+a[3]*m]),xs(y,[a[2]*m-a[1]*_,a[2]*_+a[1]*m]),xs(y,[a[2]*m-a[3]*_,a[2]*_+a[3]*m]),a=y}let u=C(l.offsetX),p=C(l.offsetY);if(i){const f=qr*i,m=Math.cos(f),_=Math.sin(f),y=u*_+p*m;u=u*m-p*_,p=y}a[0]+=u,a[1]+=p,a[2]+=u,a[3]+=p;const d=Kh(l.markerPlacement);d>0&&(a[0]-=d,a[1]-=d,a[2]+=d,a[3]+=d);break}}const h=jr(o.effects);h>0&&(a[0]-=h,a[1]-=h,a[2]+=h,a[3]+=h),r?(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],r=!1):(e[0]=Math.min(e[0],a[0]),e[1]=Math.min(e[1],a[1]),e[2]=Math.max(e[2],a[2]),e[3]=Math.max(e[3],a[3]))}return e}static _getTextInflatedSize(e,t,s){const i=jn(t.height??Tt.CIMTextSymbol.height);if(e[0]=-i/2,e[1]=-i/2,e[2]=i/2,e[3]=i/2,!s)return e;const n=s.get(t);if(!n||!n.glyphMosaicItems.glyphs.length)return e;const{lineGapType:r,lineGap:o}=t,a=r?Qn(r,o??0,i):0,h=t.callout?.type==="CIMBackgroundCallout",l=Kn(n.glyphMosaicItems,{scale:i/_n,angle:C(t.angle),xOffset:C(t.offsetX),yOffset:C(t.offsetY),horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:Jn(t.lineWidth),lineHeight:gn*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:h}).boundsT,c=Math.sqrt(l.width*l.width+l.height*l.height);return e[0]-=l.x+c,e[1]-=l.y-c,e[2]+=l.x+c,e[3]+=-l.y+c,e}},re=class Bs{static getEnvelope(t,s,i){if(!t)return null;const n=new Gh(i);if(Array.isArray(t)){let r;for(const o of t)r?r.union(Hs(n,o,s)):r=Hs(n,o,s);return r}return Hs(n,t,s)}static getTextureAnchor(t,s){const i=this.getEnvelope(t,null,s);if(!i)return[0,0,0];const n=(i.x+.5*i.width)*ie,r=(i.y+.5*i.height)*ie,o=i.width*ie+2,a=i.height*ie+2;return[-n/o,-r/a,a]}static rasterize(t,s,i,n,r=!0,o){const a=i||this.getEnvelope(s,null,n);if(!a)return[null,0,0,0,0];const h=Math.max(a.width,a.height)*ie;let l=o!=null?Math.max(o/h,1):1;l*=ie;const c=(a.x+.5*a.width)*l,u=(a.y+.5*a.height)*l;t.width=a.width*l,t.height=a.height*l,i||(t.width+=2,t.height+=2);const p=t.getContext("2d",{willReadFrequently:!0}),d=Xt.createScale(l,-l);d.translate(.5*t.width-c,.5*t.height+u);const f=new Vh(p,n,d);switch(s.type){case"CIMPointSymbol":{const y={type:"point",x:0,y:0};f.drawSymbol(s,y);break}case"CIMVectorMarker":{const y=new ye;f.drawMarker(s,y);break}}const m=p.getImageData(0,0,t.width,t.height),_=new Uint8Array(m.data);if(r){let y;for(let b=0;b<_.length;b+=4)y=_[b+3]/255,_[b]=_[b]*y,_[b+1]=_[b+1]*y,_[b+2]=_[b+2]*y}return[_,t.width,t.height,-c/t.width,-u/t.height]}static fromTextSymbol(t){const{text:s}=t;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:Bs.createCIMTextSymbolfromTextSymbol(t),textString:s}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(t){const{height:s,outline:i,width:n,xoffset:r,xscale:o,yoffset:a,yscale:h}=t,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(i){const m=Jr(i);m&&l.push(m)}let u=t.url;t.type==="esriPFS"&&t.imageData&&(u=t.imageData);const p="angle"in t?t.angle??0:0,d=(n??0)*(o||1),f=(s??0)*(h||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:u,height:f,width:d,offsetX:C(r),offsetY:C(a),rotation:C(-p),colorSubstitutions:null}),c}static fromSimpleFillSymbol(t){const{color:s,style:i,outline:n}=t,r=[],o={type:"CIMPolygonSymbol",symbolLayers:r};if(n){const a=Jr(n);a&&r.push(a)}if(i&&i!=="solid"&&i!=="none"&&i!=="esriSFSSolid"&&i!=="esriSFSNull"){const a={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:Q(s),capStyle:lt.Butt,joinStyle:kt.Miter,width:.75}]};let h=0;const l=bt(il(i)?8:10);switch(i){case"vertical":case"esriSFSVertical":h=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":h=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":h=45;break;case"cross":case"esriSFSCross":h=0}r.push({type:"CIMHatchFill",lineSymbol:a,offsetX:0,offsetY:0,rotation:h,separation:l}),i==="cross"||i==="esriSFSCross"?r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:90,separation:l}):i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"||r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:45,separation:l})}else!i||i!=="solid"&&i!=="esriSFSSolid"||r.push({type:"CIMSolidFill",enable:!0,color:Q(s)});return o}static fromSimpleLineSymbol(t){const{cap:s,color:i,join:n,marker:r,miterLimit:o,style:a,width:h}=t;let l=null;a!=="solid"&&a!=="none"&&a!=="esriSLSSolid"&&a!=="esriSLSNull"&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(a,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(r){let u;switch(r.placement){case"begin-end":u=Rt.Both;break;case"begin":u=Rt.JustBegin;break;case"end":u=Rt.JustEnd;break;default:u=Rt.None}const p=Bs.fromSimpleMarker(r,h,i).symbolLayers[0];p.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,offset:0,extremityPlacement:u,offsetAlongLine:0},c.push(p)}return c.push({type:"CIMSolidStroke",color:a!=="none"&&a!=="esriSLSNull"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:o,width:h,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t;let a=t.url;return t.type==="esriPMS"&&t.imageData&&(a=t.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:s,color:i,font:n,haloColor:r,haloSize:o,horizontalAlignment:a,kerning:h,lineWidth:l,text:c,verticalAlignment:u,xoffset:p,yoffset:d,backgroundColor:f,borderLineColor:m,borderLineSize:_}=t;let y,b,P,w,S,L;n&&(y=n.family,b=n.style,P=n.weight,w=n.size,S=n.decoration);let V=!1;return c&&(V=_h(c)[1]),(f||_)&&(L={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",color:Q(f)},{type:"CIMSolidStroke",color:Q(m),width:_}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:s,blockProgression:ia.BTT,depth3D:1,extrapolateBaselines:!0,fontEffects:ra.Normal,fontEncoding:na.Unicode,fontFamilyName:y||"Arial",fontStyleName:Qh(b,P),fontType:oa.Unspecified,haloSize:o,height:w,hinting:aa.Default,horizontalAlignment:Jh(a??"center"),kerning:h,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:l,offsetX:C(p),offsetY:C(d),strikethrough:S==="line-through",underline:S==="underline",symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(i)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(r)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:V?zr.RTL:zr.LTR,verticalAlignment:Zh(u??"baseline"),verticalGlyphOrientation:ha.Right,wordSpacing:100,billboardMode3D:la.FaceNearPlane,callout:L}}static createPictureMarkerRasterizationParam(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t,a=t.url??t.source?.url??t.source?.imageData;return a?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}}:null}static createPictureFillRasterizationParam(t){const{width:s,height:i,xoffset:n,yoffset:r,url:o}=t;return o?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:o,width:s,height:i,offsetX:C(n),offsetY:C(r),rotation:0}}:null}static fromSimpleMarker(t,s,i){const{style:n}=t,r=t.color??i;if(n==="path"||n==="esriSMSPath"){const u=[];if("outline"in t&&t.outline){const f=t.outline;u.push({type:"CIMSolidStroke",enable:!0,width:f.width,color:Q(f.color),path:t.path})}u.push({type:"CIMSolidFill",enable:!0,color:Q(r),path:t.path});const[p,d]=ze("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-C(t.angle),size:C(t.size||6),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:p,markerGraphics:[{type:"CIMMarkerGraphic",geometry:d,symbol:{type:"CIMPolygonSymbol",symbolLayers:u}}]}]}}const o=[];let a,h,l=t.size;if("outline"in t&&t.outline&&t.outline.style!=="none"&&t.outline.style!=="esriSLSNull"){const u=t.outline,p=u.style!=="solid"&&u.style!=="esriSLSSolid";[a,h]=p?ze(n,t.size):ze(n);const d=u.width??Ro.width;if(p){const _=d/t.size,y=(a.xmax-a.xmin)*_/2,b=(a.ymax-a.ymin)*_/2;a.xmin-=y,a.xmax+=y,a.ymin-=b,a.ymax+=b,l&&(l+=d)}const f=t.style!=="cross"&&t.style!=="x"||t?.outline.style==="dot"||t?.outline.style==="short-dot"?W.HalfGap:W.FullPattern,m=p?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Fi(u.style,null).map(_=>u.width&&u.width>0?_*u.width:_),lineDashEnding:f,controlPointEnding:W.FullPattern}]:void 0;o.push({type:"CIMSolidStroke",capStyle:p?lt.Round:lt.Butt,enable:!0,width:d,color:Q(u.color),effects:m})}else!s||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"?[a,h]=ze(n):([a,h]=ze(n),o.push({type:"CIMSolidStroke",enable:!0,width:s,color:Q(r)}));o.push({type:"CIMSolidFill",enable:!0,color:Q(r)});const c={type:"CIMPolygonSymbol",symbolLayers:o};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:C(-t.angle),size:C(l||6*s),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:h,symbol:c}]}]}}static fromCIMHatchFill(t,s){const i=s*(t.separation??Tt.CIMHatchFill.separation),n=i/2,r=pe(t.lineSymbol);r.symbolLayers?.forEach(h=>{switch(h.type){case"CIMSolidStroke":h.width!=null&&(h.width*=s),h.effects?.forEach(l=>{if(l.type==="CIMGeometricEffectDashes"){const c=l.dashTemplate;l.dashTemplate=c?.map(u=>u*s)}});break;case"CIMVectorMarker":{h.size!=null&&(h.size*=s);const l=h.markerPlacement;l!=null&&"placementTemplate"in l&&(l.placementTemplate=l.placementTemplate.map(c=>c*s));break}}});let o=this._getLineSymbolPeriod(r)||Kr;for(;o{rl(r,s,i),"url"in r&&r.url&&i.push(s.fetchResource(r.url,{signal:n}))}),i}static fetchFonts(t,s,i){if(t&&s){if("symbolLayers"in t&&t.symbolLayers){for(const n of t.symbolLayers)if(n.type==="CIMVectorMarker"&&n.markerGraphics)for(const r of n.markerGraphics)r?.symbol&&Bs.fetchFonts(r.symbol,s,i)}else if(t.type==="CIMTextSymbol"){const{fontFamilyName:n,fontStyleName:r}=t;if(!n||n.toLowerCase()==="calcitewebcoreicons")return;const{style:o,weight:a}=dn(r),h=fn(t),l=new Do({family:n,style:o,weight:a,decoration:h});i.push(s.loadFont(l).catch(()=>{ri().error(`Unsupported font ${n} in CIM symbol`)}))}}}static _getLineSymbolPeriod(t){if(t){const s=this._getEffectsRepeat(t.effects);if(s)return s;if(t.symbolLayers){for(const i of t.symbolLayers)if(i){const n=this._getEffectsRepeat(i.effects);if(n)return n;switch(i.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const r=this._getPlacementRepeat(i.markerPlacement);if(r)return r}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const s of t)if(s)switch(s.type){case"CIMGeometricEffectDashes":{const i=s.dashTemplate;if(i&&i.length){let n=0;for(const r of i)n+=r;return 1&i.length&&(n*=2),n}break}case"CIMGeometricEffectWave":return s.period;default:ri().error(`unsupported geometric effect type ${s.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const s=t.placementTemplate;if(s&&s.length){let i=0;for(const n of s)i+=+n;return 1&s.length&&(i*=2),i}break}}return 0}static fromCIMInsidePolygon(t){const s=t.markerPlacement,i={...t};i.markerPlacement=null,i.anchorPoint=null;const n=Math.abs(s.stepX),r=Math.abs(s.stepY),o=(s.randomness??100)/100;let a,h,l,c;if(s.gridType==="Random"){const u=bt(Pa),p=Math.max(Math.floor(u/n),1),d=Math.max(Math.floor(u/r),1);a=p*n/2,h=d*r/2,l=2*h;const f=new un(s.seed),m=o*n/1.5,_=o*r/1.5;c=[];for(let y=0;y({type:"CIMMarkerGraphic",geometry:u,symbol:{type:"CIMPointSymbol",symbolLayers:[i]}})),size:l}}};function so(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const s=e.symbolLayers;if(!s)return;for(const i of s)if(t(i),i.type==="CIMVectorMarker"){const n=i.markerGraphics;if(!n)continue;for(const r of n)if(r){const o=r.symbol;o&&so(o,t)}}break}}}const io=e=>{if(!e)return lt.Butt;switch(e){case"butt":return lt.Butt;case"square":return lt.Square;case"round":return lt.Round}},ro=e=>{if(!e)return kt.Miter;switch(e){case"miter":return kt.Miter;case"round":return kt.Round;case"bevel":return kt.Bevel}},Jh=e=>{if(e==null)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},Zh=e=>{if(e==null)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},Q=e=>{if(!e)return[0,0,0,0];const{r:t,g:s,b:i,a:n}=e;return[t,s,i,255*n]},Qh=(e,t)=>{const s=tl(t),i=el(e);return s&&i?`${s}-${i}`:`${s}${i}`},tl=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},el=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Fi=(e,t)=>{const s=li("safari")?.001:0,i=t==="butt";switch(e){case"dash":case"esriSLSDash":return i?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return i?[4,3,1,3]:[3,4,s,4];case"dot":case"esriSLSDot":return i?[1,3]:[s,4];case"long-dash":case"esriSLSLongDash":return i?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return i?[8,3,1,3]:[7,4,s,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return i?[8,3,1,3,1,3]:[7,4,s,4,s,4];case"short-dash":case"esriSLSShortDash":return i?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return i?[4,1,1,1]:[3,2,s,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return i?[4,1,1,1,1,1]:[3,2,s,2,s,2];case"short-dot":case"esriSLSShortDot":return i?[1,1]:[s,2];case"solid":case"esriSLSSolid":case"none":return ri().error("Unexpected: style does not require rasterization"),[0,0];default:return ri().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function sl(e){return e.symbolLayers!==void 0}const ze=(e,t=100)=>{const s=t/2;let i,n;const r=e;if(r==="circle"||r==="esriSMSCircle"){let o=Math.acos(1-.25/s),a=Math.ceil(eo/o/4);a===0&&(a=1),o=Wh/a,a*=4;const h=[];h.push([s,0]);for(let l=1;le==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function rl(e,t,s){if(!(!e.effects||t.geometryEngine!=null)){if(t.geometryEnginePromise)return void s.push(t.geometryEnginePromise);_a(e.effects)&&(t.geometryEnginePromise=ga(),s.push(t.geometryEnginePromise),t.geometryEnginePromise.then(i=>t.geometryEngine=i))}}function Jr(e){if(!e)return null;let t=null;const{cap:s,color:i,join:n,miterLimit:r,style:o,width:a}=e;return o!=="solid"&&o!=="none"&&o!=="esriSLSSolid"&&o!=="esriSLSNull"&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(o,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:o!=="esriSLSNull"&&o!=="none"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:r,width:a,effects:t}}var Zr;(function(e){e[e.Geographic=0]="Geographic",e[e.Arithmatic=1]="Arithmatic"})(Zr||(Zr={}));const su=3.14159265359/180,nl=3.14159265359/128,iu=1,ol=1.1,al=1,ru=24,nu=8,hl=1e-5,Qr=.05,ll=1e-30,cl=4,ul=0,pl=2,ou=2,au=3,hu=0,lu=3,dl=16777216,cu=1.1,fl=()=>ge.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let no=class{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}},ml=class extends no{constructor(){super(...arguments),this.vertex=new tn,this.fragment=new tn,this.attributes=new yl,this.varyings=new xl,this.extensions=new Ni,this.constants=new oo}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!0){const s=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),r=e==="vertex"?this.vertex:this.fragment,o=r.uniforms.generateSource(),a=r.code.generateSource(),h=e==="vertex"?Pl:bl(),l=this.constants.generateSource().concat(r.constants.generateSource());return`${t?"#version 300 es":""} +import{d as No}from"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import{v as g,hF as $,S as kr,i as $o,P as pe,hG as Ro,hH as Do,eE as un,K as li,j as Go,ah as Vo,cf as Ho,ca as rt,cb as gt,eQ as ht,bh as Qt,g_ as lr,cc as Ds,es as bt,et as fe,a1 as ge,hI as xs,hm as Bo,hJ as ci,c9 as ki,l as Xo,dB as Uo,h0 as Yo,N as Wo,hK as Jt,J as cr,hL as qo,hM as ui,hN as Ko,hO as jo,hP as Jo,R as Zo,C as Qo,hQ as ta,o as pn,hR as ea}from"./story-Doly9N9p.js";import{c as si}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{E as bs,d as Tr,D as sa}from"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import{f as Gs,M as Ps,S as lt,R as kt,o as Rt,d as ia,a as ra,l as na,u as oa,m as aa,N as zr,E as ha,n as la,P as W,C as Kt,g as I,p as Se,T as ws,h as Pt,B as xi,L as Me,O as vs}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as C,w as Tt,M as dn,m as fn,o as ca,g as ua,p as se,y as pa,C as da,A as bi,G as Lr,E as Ar,f as fa,u as ma,s as _a,c as ga,b as ya}from"./utils-SPbpQbmm-CiwW7WzR.js";import{i as mn,c as _n,r as gn,k as xa,q as ba,M as Pa,_ as wa,$ as va}from"./definitions-DJSdSb77-DkoRHaVx.js";import{l as rs,s as yn,K as Ti,h as Sa,i as Pi,e as Or}from"./Tile-D75RMC64-g8Sx5TPr.js";import{L as ce,m as Ss}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Er}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{a as Ma}from"./Rect-DD6XS68q-D_hsV3ag.js";import{K as Ca,l as Ee}from"./LabelMetric-BeluzH3o-Br-5CSAC.js";import{a as Ms}from"./BindType-9iOk18Ed-CRW1cdX4.js";import{h as Ia}from"./Util-BjGjeg6f-08Szkf4F.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import{V as ka}from"./Program-DLVwTiPA-DI0GKSfI.js";import{h as Ta}from"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import{i as za}from"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";var Fr;(function(e){e[e.AnimatedMarker=0]="AnimatedMarker",e[e.Blend=1]="Blend",e[e.ComplexFill=2]="ComplexFill",e[e.ComplexOutlineFill=3]="ComplexOutlineFill",e[e.DotDensity=4]="DotDensity",e[e.Fill=5]="Fill",e[e.Grid=6]="Grid",e[e.Heatmap=7]="Heatmap",e[e.Label=8]="Label",e[e.Line=9]="Line",e[e.Magnifier=10]="Magnifier",e[e.Marker=11]="Marker",e[e.OutlineFill=12]="OutlineFill",e[e.Overlay=13]="Overlay",e[e.PatternFill=14]="PatternFill",e[e.PatternOutlineFill=15]="PatternOutlineFill",e[e.PieChart=16]="PieChart",e[e.Test=17]="Test",e[e.Text=18]="Text",e[e.TexturedLine=19]="TexturedLine"})(Fr||(Fr={}));const Yc={bitset:{isSDF:0,isMapAligned:1,scaleSymbolsProportionally:2,overrideOutlineColor:3,colorLocked:4,isStroke:5}};let N=class{static fromOptimized(e,t,s=!1,i=!1,n=1){return new zi().initialize(e,t,s,i,n)}static fromJSON(e,t=!1,s=!1){const[i,n]=Nr(e);return new Ai().initialize(i,n,t,s,1)}static fromOptimizedCIM(e,t,s=!1,i=!1,n=1){return new $r().initialize(e,t,s,i,n)}static fromJSONCIM(e,t=!1,s=!1,i=1){const[n,r]=Nr(e);return new Rr().initialize(n,r,t,s,i)}static fromFeatureSetReader(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimized(t,s):null}static fromFeatureSetReaderCIM(e){const t=e.readGeometryForDisplay(),s=e.geometryType;return t&&s?this.fromOptimizedCIM(t,s):null}static createEmptyOptimized(e,t=!1,s=!1,i=1){return new zi().initialize(new si,e,t,s,i)}static createEmptyJSON(e,t=!1,s=!1){return new Ai().initialize([],e,t,s,1)}static createEmptyOptimizedCIM(e,t=!1,s=!1,i=1){return new $r().initialize(new si,e,t,s,i)}static createEmptyJSONCIM(e,t=!1,s=!1,i=1){return new Rr().initialize([],e,t,s,i)}asJSON(){const e=ci(this);return this.geometryType==="esriGeometryEnvelope"?{xmin:e[0][0][0],ymin:e[0][0][1],xmax:e[0][2][0],ymax:e[0][2][1]}:this.geometryType==="esriGeometryMultipoint"?{points:e.flat()}:this.geometryType==="esriGeometryPoint"?{x:e[0][0][0],y:e[0][0][1]}:this.geometryType==="esriGeometryPolygon"?{rings:e}:{paths:e}}getCurrentRingArea(){if(this.pathSize<3)return 0;let e,t,s=0;if(this.seekPathStart(),!this.nextPoint())return 0;e=this.x,t=this.y;const i=e,n=t;for(;this.nextPoint();)s+=(e-this.x)*(t+this.y),e=this.x,t=this.y;return s+=(e-i)*(t+n),-.5*s}invertY(){this.yFactor*=-1}},zi=class Li extends N{constructor(){super(...arguments),this._end=-1}initialize(t,s,i,n,r){return this.hasZ=i,this.hasM=n,this.geometryType=s,this._stride=2+Number(i)+Number(n),this._geometry=t,this._pathIndex=-1,this._pathOffset=0,this._pointOffset=-this._stride,this._end=-1,this.yFactor=r,this}reset(){this.initialize(this._geometry,this.geometryType,this.hasZ,this.hasM,this.yFactor)}seekPath(t){if(t>=0&&tt)for(;this._pathIndex>t&&this.prevPath(););return!0}return!1}seekPathStart(){this._pointOffset=this._pathOffset-this._stride}seekPathEnd(){this._pointOffset=this._end}seekInPath(t){const s=this._pathOffset+t*this._stride;return s>=0&&s=this._pathOffset}nextPath(){return!(this.pathIndex>=this.totalSize-1)&&(this._pathIndex>=0&&(this._pathOffset+=this._stride*this.pathSize),this._pathIndex++,this._pointOffset=this._pathOffset-this._stride,this._end=this._pointOffset+this._stride+this._stride*this.pathSize,!0)}prevPath(){return!(this.pathIndex<=0)&&(this._pathIndex--,this._end=this._pathOffset,this._pathOffset-=this._stride*this.pathSize,this._pointOffset=this._pathOffset-this._stride,!0)}getCurrentPath(){const t=this._end,s=this._geometry.coords,i=this._pathOffset;return new Li().initialize(new si([this.pathSize],s.slice(i,t)),this.geometryType,this.hasZ,this.hasM,this.yFactor)}pathLength(){const t=this._end,s=this._stride,i=this._geometry.coords;let n=0;for(let r=this._pathOffset+s;rt+s)}get pathSize(){const{lengths:t}=this._geometry;return this._geometry.isPoint?1:this._pathIndex<0||this._pathIndex>t.length-1?0:t[this._pathIndex]}get totalSize(){return this._geometry.isPoint?1:this._geometry.lengths.length}get x(){return this._geometry.coords[this._pointOffset]}set x(t){this._geometry.coords[this._pointOffset]=t}get y(){return this.yFactor*this._geometry.coords[this._pointOffset+1]}set y(t){this._geometry.coords[this._pointOffset+1]=this.yFactor*t}get z(){return this._geometry.coords[this._pointOffset+2]}set z(t){this._geometry.coords[this._pointOffset+2]=t}get m(){const t=this.hasZ?3:2;return this._geometry.coords[this._pointOffset+t]}set m(t){this._geometry.coords[this._pointOffset+3]=t}get pathIndex(){return this._pathIndex}get _coordIndex(){return this._pointOffset/this._stride}};function La(e){const t=[e.x,e.y];return e.z&&t.push(e.z),e.m&&t.push(e.m),t}function Nr(e){return rt(e)?[e.rings,"esriGeometryPolygon"]:gt(e)?[e.paths,"esriGeometryPolyline"]:Ds(e)?[[e.points],"esriGeometryMultipoint"]:ht(e)?[[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]],"esriGeometryEnvelope"]:ki(e)?[[[La(e)]],"esriGeometryPoint"]:[[],"esriGeometryPolyline"]}let Ai=class Oi extends N{initialize(t,s,i,n,r){return this._paths=t,this.geometryType=s,this.hasZ=i,this.hasM=n,this._pathIndex=this._pointIndex=-1,this.yFactor=r,this._mIndex=this.hasZ?3:2,this}reset(){this._pathIndex=this._pointIndex=-1}seekPath(t){return this._pathIndex=t,this._pointIndex=-1,t>=0&&t=0&&t=0}nextPath(){return this._pointIndex=-1,this._currentPath=this._paths[++this._pathIndex],this._pathIndex0&&(this._pointIndex=-1,this._pathIndex--,this._currentPath=this._paths[this._pathIndex],!0)}pathLength(){const t=this._currentPath.length,s=this._currentPath;let i=0;for(let n=1;nt.length).reduce((t,s)=>t+s)}get pathSize(){return this._pathIndex<0||this._pathIndex>this.totalSize-1?-1:this._paths[this._pathIndex].length}get totalSize(){return this._paths.length}get x(){return this._currentPoint[0]}set x(t){this._currentPoint[0]=t}get y(){return this.yFactor*this._currentPoint[1]}set y(t){this._currentPoint[1]=this.yFactor*t}get z(){return this._currentPoint[2]}set z(t){this._currentPoint[2]=t}get m(){return this._currentPoint[this._mIndex]}set m(t){this._currentPoint[this._mIndex]=t}get pathIndex(){return this._pathIndex}};const Cs=4,Is=1;let $r=class xn extends zi{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r),this._controlPoints||(this._controlPoints=this._controlPoints=new Array(this.totalSize).fill(void 0).map(o=>new Set)),this}startPath(){super.startPath(),this._controlPoints.push(new Set)}clone(){const t=new xn().initialize(this._geometry.clone(),this.geometryType,this.hasZ,this.hasM,this.yFactor);return t._controlPoints=this._controlPoints,t}setControlPoint(){this._controlPoints[this.pathIndex].add(this._coordIndex)}getControlPoint(){return this._controlPoints[this.pathIndex].has(this._coordIndex)}setControlPointAt(t){this._controlPoints[this.pathIndex].add(t)}getControlPointAt(t){return this._controlPoints[this.pathIndex].has(t)}},Rr=class bn extends Ai{initialize(t,s,i,n,r){return super.initialize(t,s,i,n,r)}clone(){return new bn().initialize(pe(this._paths),this.geometryType,this.hasZ,this.hasM,this.yFactor)}setControlPoint(){this._paths[this.pathIndex][this._pointIndex][Cs]=Is}getControlPoint(){return this._paths[this.pathIndex][this._pointIndex][Cs]===Is}setControlPointAt(t){this._paths[this.pathIndex][t][Cs]=Is}getControlPointAt(t){return this._paths[this.pathIndex][t][Cs]===Is}};const Aa=512;let wt,Oa=class{constructor(e){this._geometry=e}next(){const e=this._geometry;return this._geometry=null,e}};function ur(e,t){wt||(wt=new sa(0,0,0,1));const s=e.geometryType==="esriGeometryPolygon",i=s?Tr.Polygon:Tr.LineString,n=s?3:2;let r,o;for(wt.reset(i),wt.setPixelMargin(t+1),wt.setExtent(Aa);e.nextPath();)if(!(e.pathSize1&&y>0&&h>0&&(o*m+a*_)/y/h<=this._maxCosAngle&&e.setControlPointAt(p-1),p===1&&(l=m,c=_,u=y),y>0&&(i=d,n=f,o=m,a=_,h=y)}this._isClosed&&h>0&&u>0&&(o*l+a*c)/u/h<=this._maxCosAngle&&e.setControlPointAt(0)}}},ye=class{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(e,t){this.tx=e,this.ty=t}setTranslateZ(e){this.tz=e}setRotateCS(e,t){this.rz=void 0,this.rzCos=e,this.rzSin=t}setRotate(e){this.rz=e,this.rzCos=void 0,this.rzSin=void 0}setRotateY(e){this.ry=e}setScale(e){this.s=e}setMeasure(e){this.m=e}};function Ce(e,t){e[4]=t}let fs=class{constructor(e,t=!0,s=!0,i=0){this.isClosed=!1,this.geometryCursor=null,this.geometryCursor=!t&&e.geometryType==="esriGeometryPolygon"||!s&&e.geometryType==="esriGeometryPolyline"?null:e,this.geomUnitsPerPoint=i,this.iterateMultiPath=!1,this.iteratePath=!1,this.internalPlacement=new ye}next(){if(!this.geometryCursor)return null;const e=this.processMultiPath(this.geometryCursor);return this.iterateMultiPath&&e||(this.geometryCursor=null),e}processMultiPath(e){for(;this.iteratePath||e.pathIndex0?[r/a,o/a]:[1,0]}getSegAngleCS(e,t){const[[s,i],[n,r]]=e;return this.getAngleCS(s,i,n,r,t)}cut(e,t,s,i,n,r){return[n<=0?[e,t]:this.getCoord2D(e,t,s,i,n),r>=1?[s,i]:this.getCoord2D(e,t,s,i,r)]}getSubCurve(e,t,s){const i=N.createEmptyOptimizedCIM("esriGeometryPolyline");return this.appendSubCurve(i,e,t,s)?i:null}appendSubCurve(e,t,s,i){e.startPath(),t.seekPathStart();let n=0,r=!0;if(!t.nextPoint())return!1;let o=t.x,a=t.y;for(;t.nextPoint();){const h=this.getLength(o,a,t.x,t.y);if(h!==0){if(r){if(n+h>s){const l=(s-n)/h;let c=1,u=!1;n+h>=i&&(c=(i-n)/h,u=!0);const p=this.cut(o,a,t.x,t.y,l,c);if(p&&e.pushPoints(p),u)break;r=!1}}else{if(n+h>i){const l=this.cut(o,a,t.x,t.y,0,(i-n)/h);l&&e.pushPoint(l[1]);break}e.pushXY(t.x,t.y)}n+=h,o=t.x,a=t.y}else o=t.x,a=t.y}return!0}getCIMPointAlong(e,t){if(!e.nextPoint())return null;let s,i,n,r,o=0;for(s=e.x,i=e.y;e.nextPoint();s=n,i=r){n=e.x,r=e.y;const a=this.getLength(s,i,n,r);if(a!==0){if(o+a>t){const h=(t-o)/a;return this.getCoord2D(s,i,n,r,h)}o+=a}}return null}offset(e,t,s,i,n){if(!e||e.length<2)return null;let r=0,o=e[r++],a=r;for(;r=0==t<=0){if(_<1){const y=[d[0]-f[0],d[1]-f[1]];this.normalize(y);const b=Math.sqrt((1+_)/2);if(b>1/i){const P=-Math.abs(t)/b;l.push([c[0]-y[0]*P,c[1]-y[1]*P])}}}else switch(s){case Kt.Mitered:{const y=Math.sqrt((1+_)/2);if(y>0&&1/y0){const b=1/y;let P=b;for(let w=1;w0){const n=N.createEmptyOptimizedCIM(e.geometryType),r=ci(e)[0],o=this._curveHelper.offset(r,this._size,Kt.Rounded,4,this._offsetFlattenError);if(o)return n.pushPath(o),n}else if(this._size<0){const n=e.asJSON();if(Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._size>0)return N.fromJSONCIM({xmin:n.xmin-this._size,xmax:n.xmax+this._size,ymin:n.ymin-this._size,ymax:n.ymax+this._size})}}const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e;if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),this._size,1);return i?N.fromJSONCIM(i):null}return null}},Sn=class Re{static local(){return Re.instance===null&&(Re.instance=new Re),Re.instance}execute(t,s,i,n,r){return new Da(t,s,i)}};Sn.instance=null;let Da=class{constructor(e,t,s){this._defaultPointSize=20,this._inputGeometries=e,this._geomUnitsPerPoint=s,this._rule=t.rule??I.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let e;for(;e=this._inputGeometries.next();){const t=this._processGeom(ci(e));if(t?.length)return N.fromJSONCIM({paths:t})}return null}_clone(e){return[e[0],e[1]]}_mid(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}_mix(e,t,s,i){return[e[0]*t+s[0]*i,e[1]*t+s[1]*i]}_add(e,t){return[e[0]+t[0],e[1]+t[1]]}_add2(e,t,s){return[e[0]+t,e[1]+s]}_sub(e,t){return[e[0]-t[0],e[1]-t[1]]}_dist(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}_norm(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}_normalize(e,t=1){const s=t/this._norm(e);e[0]*=s,e[1]*=s}_leftPerpendicular(e){const t=-e[1],s=e[0];e[0]=t,e[1]=s}_leftPerp(e){return[-e[1],e[0]]}_rightPerpendicular(e){const t=e[1],s=-e[0];e[0]=t,e[1]=s}_rightPerp(e){return[e[1],-e[0]]}_dotProduct(e,t){return e[0]*t[0]+e[1]*t[1]}_crossProduct(e,t){return e[0]*t[1]-e[1]*t[0]}_rotateDirect(e,t,s){const i=e[0]*t-e[1]*s,n=e[0]*s+e[1]*t;e[0]=i,e[1]=n}_makeCtrlPt(e){const t=[e[0],e[1]];return Ce(t,1),t}_addAngledTicks(e,t,s,i){const n=this._sub(s,t);this._normalize(n);const r=this._crossProduct(n,this._sub(i,t));let o;o=r>0?this._rightPerp(n):this._leftPerp(n);const a=Math.abs(r)/2,h=[];h.push([t[0]+(o[0]-n[0])*a,t[1]+(o[1]-n[1])*a]),h.push(t),h.push(s),h.push([s[0]+(o[0]+n[0])*a,s[1]+(o[1]+n[1])*a]),e.push(h)}_addBezier2(e,t,s,i,n){if(n--==0)return void e.push(i);const r=this._mid(t,s),o=this._mid(s,i),a=this._mid(r,o);this._addBezier2(e,t,r,a,n),this._addBezier2(e,a,o,i,n)}_addBezier3(e,t,s,i,n,r){if(r--==0)return void e.push(n);const o=this._mid(t,s),a=this._mid(s,i),h=this._mid(i,n),l=this._mid(o,a),c=this._mid(a,h),u=this._mid(l,c);this._addBezier3(e,t,o,l,u,r),this._addBezier3(e,u,c,h,n,r)}_add90DegArc(e,t,s,i,n){const r=n??this._crossProduct(this._sub(s,t),this._sub(i,t))>0,o=this._mid(t,s),a=this._sub(o,t);r?this._leftPerpendicular(a):this._rightPerpendicular(a),o[0]+=a[0],o[1]+=a[1],this._addBezier3(e,t,this._mix(t,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(e,t,s){const i=t[0],n=t[1],r=t[t.length-1],o=this._sub(i,n),a=this._norm(o);this._normalize(o);const h=Math.abs(this._crossProduct(o,this._sub(r,n)));let l=this._dotProduct(o,this._sub(r,n));l<.05*a?l=.05*a:l>.95*a&&(l=.95*a);const c=.5*h,u=this._leftPerp(o),p=[n[0]+o[0]*l,n[1]+o[1]*l],d=t.length-1,f=[];f.push(s?[-u[0],-u[1]]:u);let m=[-o[0],-o[1]];for(let _=1;_0;_--)e.push([t[_][0]+f[_][0]*c,t[_][1]+f[_][1]*c]);e.push([p[0]+f[0][0]*c,p[1]+f[0][1]*c]),e.push([p[0]+f[0][0]*h,p[1]+f[0][1]*h]),e.push(i),e.push([p[0]-f[0][0]*h,p[1]-f[0][1]*h]),e.push([p[0]-f[0][0]*c,p[1]-f[0][1]*c]);for(let _=1;_=2?e[1]:this._add2(e[0],t*this._defaultSize,s*this._defaultSize)}_cp3(e,t,s,i){if(e.length>=3)return e[2];const n=this._mix(e[0],1-s,t,s),r=this._sub(t,e[0]);return this._normalize(r),this._rightPerpendicular(r),[n[0]+r[0]*i*this._defaultSize,n[1]+r[1]*i*this._defaultSize]}_arrowPath(e){if(e.length>2)return e;const t=e[0],s=this._cp2(e,-4,0),i=this._sub(t,s);this._normalize(i);const n=this._rightPerp(i);return[t,s,[t[0]+(n[0]-i[0])*this._defaultSize,t[1]+(n[1]-i[1])*this._defaultSize]]}_arrowLastSeg(e){const t=e[0],s=this._cp2(e,-4,0);let i;if(e.length>=3)i=e[e.length-1];else{const n=this._sub(t,s);this._normalize(n);const r=this._rightPerp(n);i=[t[0]+(r[0]-n[0])*this._defaultSize,t[1]+(r[1]-n[1])*this._defaultSize]}return[s,i]}_processGeom(e){if(!e)return null;const t=[];for(const s of e){const i=s.length>1&&qo(s)0?this._rightPerp(h):this._leftPerp(h);const c=[];c.push([o[0]+(l[0]-h[0])/3,o[1]+(l[1]-h[1])/3]),c.push(o),c.push(a),c.push([a[0]+(l[0]+h[0])/3,a[1]+(l[1]+h[1])/3]),t.push(c);break}case I.DoublePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push(r),u.push([a[0]+l[0]*c,a[1]+l[1]*c]),t.push(u);const p=[];p.push([a[0]-l[0]*c,a[1]-l[1]*c]),p.push(o),t.push(p);break}case I.OppositeToFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c,a[1]+l[1]*c]),u.push([a[0]-l[0]*c,a[1]-l[1]*c]),t.push(u);break}case I.TriplePerpendicular:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o),l=this._sub(h,a);this._normalize(l);const c=this._crossProduct(l,this._sub(r,a));this._leftPerpendicular(l);const u=[];u.push([a[0]+l[0]*c*.8,a[1]+l[1]*c*.8]),u.push([h[0]+.8*(r[0]-h[0]),h[1]+.8*(r[1]-h[1])]),t.push(u),t.push([a,h]);const p=[];p.push([a[0]-l[0]*c*.8,a[1]-l[1]*c*.8]),p.push([h[0]+.8*(o[0]-h[0]),h[1]+.8*(o[1]-h[1])]),t.push(p);break}case I.HalfCircleFirstSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,4),h=this._mid(r,o);let l=this._sub(o,r);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),p=Math.sqrt((1+c)/2),d=Math.sqrt((1-c)/2),f=[];let m;this._crossProduct(l,this._sub(a,r))>0?(f.push(r),l=this._sub(r,h),m=o):(f.push(o),l=this._sub(o,h),m=r),this._rotateDirect(l,p,d),l[0]/=p,l[1]/=p;for(let _=1;_<=18;_++)f.push(this._add(h,l)),this._rotateDirect(l,c,u);f.push(m),t.push(f);break}case I.HalfCircleSecondSegment:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,1,-1);let h=this._sub(r,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,o))/2;this._leftPerpendicular(h);const c=[o[0]+h[0]*l,o[1]+h[1]*l];h=this._sub(o,c);const u=Math.cos(Math.PI/18);let p=Math.sin(Math.PI/18);l>0&&(p=-p);const d=[o];for(let f=1;f<=18;f++)this._rotateDirect(h,u,p),d.push(this._add(c,h));t.push(d);break}case I.HalfCircleExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-1);let h;if(n>=4)h=s[3];else{const f=this._sub(r,o);h=this._add(a,f)}const l=this._dist(o,a)/2/.75,c=this._sub(o,r);this._normalize(c,l);const u=this._sub(a,h);this._normalize(u,l);const p=[h,a];t.push(p);const d=[this._clone(a)];this._addBezier3(d,a,this._add(a,u),this._add(o,c),o,4),d.push(r),t.push(d);break}case I.OpenCircle:{const o=this._cp2(s,-2,0),a=this._sub(o,r),h=Math.cos(Math.PI/18),l=-Math.sin(Math.PI/18),c=[o];for(let u=1;u<=33;u++)this._rotateDirect(a,h,l),c.push(this._add(r,a));t.push(c);break}case I.CoverageEdgesWithTicks:{const o=this._cp2(s,0,-1);let a,h;if(n>=3)a=s[2];else{const p=this._sub(o,r),d=this._leftPerp(p);a=[r[0]+d[0]-.25*p[0],r[1]+d[1]-.25*p[1]]}if(n>=4)h=s[3];else{const p=this._mid(r,o),d=this._sub(r,o);this._normalize(d),this._leftPerpendicular(d);const f=this._crossProduct(d,this._sub(a,p));this._rightPerpendicular(d),h=[a[0]+d[0]*f*2,a[1]+d[1]*f*2]}const l=this._sub(o,r);let c,u;c=this._crossProduct(l,this._sub(a,r))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push(a),u.push(r),u.push([r[0]+(c[0]-l[0])/3,r[1]+(c[1]-l[1])/3]),t.push(u),c=this._crossProduct(l,this._sub(h,o))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push([o[0]+(c[0]+l[0])/3,o[1]+(c[1]+l[1])/3]),u.push(o),u.push(h),t.push(u);break}case I.GapExtentWithDoubleTicks:{const o=this._cp2(s,0,2),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const l=this._sub(o,r);h=this._add(a,l)}this._addAngledTicks(t,r,o,this._mid(a,h)),this._addAngledTicks(t,a,h,this._mid(r,o));break}case I.GapExtentMidline:{const o=this._cp2(s,2,0),a=this._cp3(s,o,0,1);let h;if(n>=4)h=s[3];else{const c=this._sub(o,r);h=this._add(a,c)}const l=[];l.push(this._mid(r,a)),l.push(this._mid(o,h)),t.push(l);break}case I.Chevron:{const o=this._cp2(s,-1,-1);let a;if(n>=3)a=s[2];else{const h=this._sub(o,r);this._leftPerpendicular(h),a=this._add(r,h)}t.push([o,this._makeCtrlPt(r),a]);break}case I.PerpendicularWithArc:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,.5,-1),h=this._sub(o,r),l=this._norm(h);h[0]/=l,h[1]/=l;const c=this._crossProduct(h,this._sub(a,r));let u=this._dotProduct(h,this._sub(a,r));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[r[0]+h[0]*u,r[1]+h[1]*u];let d=this._leftPerp(h),f=[];if(f.push([p[0]-d[0]*c,p[1]-d[1]*c]),f.push([p[0]+d[0]*c,p[1]+d[1]*c]),t.push(f),n>=4){const b=s[3];let P=this._dotProduct(h,this._sub(b,r));P<.1*l?P=.1*l:P>.9*l&&(P=.9*l);const w=[r[0]+h[0]*P,r[1]+h[1]*P],S=this._crossProduct(h,this._sub(b,r)),L=[];L.push([w[0]-d[0]*S,w[1]-d[1]*S]),L.push([w[0]+d[0]*S,w[1]+d[1]*S]),t.push(L)}const m=[o[0]+d[0]*c,o[1]+d[1]*c];d=this._sub(o,m);const _=Math.cos(Math.PI/18);let y=Math.sin(Math.PI/18);c<0&&(y=-y),f=[r,o];for(let b=1;b<=9;b++)this._rotateDirect(d,_,y),f.push(this._add(m,d));t.push(f);break}case I.ClosedHalfCircle:{const o=this._cp2(s,2,0),a=this._mid(r,o),h=this._sub(o,a),l=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[r,o];for(let p=1;p<=18;p++)this._rotateDirect(h,l,c),u.push(this._add(a,h));t.push(u);break}case I.TripleParallelExtended:{const o=this._cp2(s,0,-2),a=this._cp3(s,o,1,-2),h=this._mid(r,o),l=this._sub(a,o);this._normalize(l);const c=Math.abs(this._crossProduct(l,this._sub(h,o)))/2,u=this._dist(o,a),p=[o,r];p.push([r[0]+l[0]*u*.5,r[1]+l[1]*u*.5]),t.push(p);const d=[];d.push([h[0]-l[0]*c,h[1]-l[1]*c]),d.push([h[0]+l[0]*u*.375,h[1]+l[1]*u*.375]),Ce(d[d.length-1],1),d.push([h[0]+l[0]*u*.75,h[1]+l[1]*u*.75]),t.push(d);const f=[o,a];t.push(f);break}case I.ParallelWithTicks:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(a,o);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),this._addAngledTicks(t,r,o,a),this._addAngledTicks(t,this._mix(r,1,h,l),this._mix(o,1,h,l),this._mid(r,o));break}case I.Parallel:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._leftPerp(h),c=this._crossProduct(h,this._sub(a,r));let u=[r,o];t.push(u),u=[],u.push([r[0]+l[0]*c,r[1]+l[1]*c]),u.push([o[0]+l[0]*c,o[1]+l[1]*c]),t.push(u);break}case I.PerpendicularToFirstSegment:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._mid(r,o),l=this._sub(o,r);this._normalize(l);const c=this._crossProduct(l,this._sub(a,r));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]),t.push(u);break}case I.ParallelOffset:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);const u=[];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(u);break}case I.OffsetOpposite:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]-h[0]*l,r[1]-h[1]*l]),c.push([o[0]-h[0]*l,o[1]-h[1]*l]),t.push(c);break}case I.OffsetSame:{const o=this._cp2(s,3,0),a=this._cp3(s,o,.5,-1),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h);const c=[];c.push([r[0]+h[0]*l,r[1]+h[1]*l]),c.push([o[0]+h[0]*l,o[1]+h[1]*l]),t.push(c);break}case I.CircleWithArc:{let o=this._cp2(s,3,0);const a=this._cp3(s,o,.5,-1);let h,l;if(n>=4)h=s[3],l=this._crossProduct(this._sub(h,o),this._sub(a,o))>0;else{h=o,l=this._crossProduct(this._sub(h,r),this._sub(a,r))>0;const f=24*this._geomUnitsPerPoint,m=this._sub(h,r);this._normalize(m,f);const _=Math.sqrt(2)/2;this._rotateDirect(m,_,l?_:-_),o=this._add(r,m)}const c=this._sub(o,r),u=Math.cos(Math.PI/18),p=Math.sin(Math.PI/18),d=[o];for(let f=1;f<=36;f++)this._rotateDirect(c,u,p),d.push(this._add(r,c));this._add90DegArc(d,o,h,a,l),Ce(d[d.length-8],1),t.push(d);break}case I.DoubleJog:{let o,a=this._cp2(s,-3,1),h=this._cp3(s,a,-1,-.5);if(n>=4)o=s[3];else{const y=r;r=a,o=h;const b=this._dist(r,y),P=this._dist(o,y);let w=30*this._geomUnitsPerPoint;.5*b0?this._rotateDirect(m,f,-f):this._rotateDirect(m,f,f);let _=[];_.push(a),_.push(this._add(l,m)),_.push(this._sub(l,m)),_.push(r),t.push(_),m=this._sub(o,h),this._normalize(m,d),this._crossProduct(m,this._sub(r,h))<0?this._rotateDirect(m,f,f):this._rotateDirect(m,f,-f),_=[],_.push(h),_.push(this._add(c,m)),_.push(this._sub(c,m)),_.push(o),t.push(_);break}case I.PerpendicularOffset:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l);t.push([c,r]);break}case I.LineExcludingLastSegment:{const o=this._arrowPath(s),a=[];let h=o.length-2;for(;h--;)a.push(o[h]);t.push(a);break}case I.MultivertexArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!1),t.push(a);break}case I.CrossedArrow:{const o=this._arrowPath(s),a=[];this._addArrow(a,o,!0),t.push(a);break}case I.ChevronArrow:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);const u=this._crossProduct(l,this._sub(a,o));let p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=[o[0]+l[0]*p,o[1]+l[1]*p],f=this._leftPerp(l),m=[];m.push([d[0]+f[0]*u+l[0]*h,d[1]+f[1]*u+l[1]*h]),m.push(r),m.push([d[0]-f[0]*u+l[0]*h,d[1]-f[1]*u+l[1]*h]),t.push(m);break}case I.ChevronArrowOffset:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=this._crossProduct(h,this._sub(a,o));let u=this._dotProduct(h,this._sub(a,o));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=[o[0]+h[0]*u,o[1]+h[1]*u];this._leftPerpendicular(h);const d=[];d.push([p[0]+h[0]*c*.5,p[1]+h[1]*c*.5]),d.push(this._mid(p,r)),d.push([p[0]-h[0]*c*.5,p[1]-h[1]*c*.5]),t.push(d);break}case I.PartialFirstSegment:{const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);let c=this._dotProduct(h,this._sub(a,o));c<.05*l?c=.05*l:c>.95*l&&(c=.95*l);const u=[o[0]+h[0]*c,o[1]+h[1]*c];t.push([o,u]);break}case I.Arch:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=this._sub(r,o),l=this._mix(a,1,h,.55),c=this._mix(a,1,h,-.55),u=[r];this._addBezier2(u,r,l,a,4),this._addBezier2(u,a,c,o,4),t.push(u);break}case I.CurvedParallelTicks:{const o=this._cp2(s,-4,1),a=this._cp3(s,o,.882353,-1.94),h=this._sub(a,o);this._crossProduct(h,this._sub(r,o))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(o,a),l),u=this._sub(this._mix(o,.75,a,.25),l),p=this._sub(this._mix(o,.25,a,.75),l),d=[o];this._addBezier2(d,o,u,c,3),this._addBezier2(d,c,p,a,3),t.push(d);for(let f=0;f<8;f++){const m=d[2*f+1],_=[this._clone(m)];_.push(this._add(m,[h[0]/4,h[1]/4])),t.push(_)}break}case I.Arc90Degrees:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,1),h=[o];this._add90DegArc(h,o,r,a),t.push(h);break}case I.TipWithPerpendicularAndTicks:{const[o,a]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(r,o),c=this._norm(l);this._normalize(l);let u=this._crossProduct(l,this._sub(a,o)),p=this._dotProduct(l,this._sub(a,o));p<.05*c?p=.05*c:p>.95*c-h&&(p=.95*c-h);const d=this._leftPerp(l),f=[r[0]-l[0]*h,r[1]-l[1]*h],m=.5*Math.max(c-p-h,h);u=Math.abs(u);const _=[];_.push([f[0]+d[0]*(u+m)-l[0]*m,f[1]+d[1]*(u+m)-l[1]*m]),_.push([f[0]+d[0]*u,f[1]+d[1]*u]),_.push([f[0]-d[0]*u,f[1]-d[1]*u]),_.push([f[0]-d[0]*(u+m)-l[0]*m,f[1]-d[1]*(u+m)-l[1]*m]),t.push(_),t.push([f,r]);break}case I.ConcentricCircles:{const o=this._cp2(s,1,0),a=this._cp3(s,o,2,0),h=Math.cos(Math.PI/18),l=Math.sin(Math.PI/18);let c=this._dist(o,r),u=[c,0],p=[];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);if(t.push(p),n>=4){p=[];const d=s[3];c=this._dist(d,r),u=[c,0];for(let f=0;f<=36;f++)p.push(this._add(r,u)),f===0&&(p.push(this._add(r,u)),Ce(p[1],1)),this._rotateDirect(u,h,l);t.push(p)}p=[],c=this._dist(a,r),u=[c,0];for(let d=0;d<=36;d++)p.push(this._add(r,u)),this._rotateDirect(u,h,l);t.push(p);break}case I.DoubleJogArrow:{r=this._arrowPath(s)[0];const[o,a]=this._arrowLastSeg(s),h=this._sub(r,o),l=this._norm(h);this._normalize(h);const c=Math.abs(this._crossProduct(h,this._sub(a,r)));let u=Math.abs(this._dotProduct(h,this._sub(a,r)));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const p=Math.max(c,u),d=this._leftPerp(h);let f=[];const m=[r[0]-h[0]*u*.5+d[0]*c*.5,r[1]-h[1]*u*.5+d[1]*c*.5];f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),m[0]-=d[0]*p*.25,m[1]-=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5+d[0]*p*.4,m[1]+=h[1]*p*.5+d[1]*p*.4,f.push([m[0],m[1]]),t.push(f),f=[],m[0]=r[0]-h[0]*u*.5-d[0]*c*.5,m[1]=r[1]-h[1]*u*.5-d[1]*c*.5,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),m[0]+=d[0]*p*.25,m[1]+=d[1]*p*.25,f.push([m[0],m[1]]),m[0]+=h[0]*p*.5-d[0]*p*.4,m[1]+=h[1]*p*.5-d[1]*p*.4,f.push([m[0],m[1]]),t.push(f);break}case I.LinkedChevrons:{const o=this._cp2(s,-5,0),a=this._cp3(s,o,-.2,1),h=this._sub(r,o);this._normalize(h);const l=this._leftPerp(h),c=Math.abs(this._crossProduct(h,this._sub(a,o)));t.push([o,r]);const u=[];u.push([r[0]-h[0]*c+l[0]*c,r[1]-h[1]*c+l[1]*c]),u.push(r),u.push([r[0]-h[0]*c-l[0]*c,r[1]-h[1]*c-l[1]*c]),t.push(u),this._addDash(t,o,[-h[0]*c+l[0]*c,-h[1]*c+l[1]*c]),this._addDash(t,o,[-h[0]*c-l[0]*c,-h[1]*c-l[1]*c]);break}case I.SegmentThenHalfCircle:{const o=this._cp2(s,2,0),a=this._cp3(s,o,1.5,0);let h;h=n>=4?s[3]:this._cp3(s,o,1.25,-.5);const l=this._sub(o,r);this._normalize(l);const c=.5*this._dist(o,a),u=this._crossProduct(l,this._sub(h,r))>0,p=Math.cos(Math.PI/18);let d=Math.sin(Math.PI/18);u&&(d=-d);const f=[r,o];l[0]*=c,l[1]*=c;const m=this._add(o,l);l[0]=-l[0],l[1]=-l[1];for(let _=1;_<=18;_++)this._rotateDirect(l,p,d),f.push(this._add(m,l));t.push(f);break}case I.LineWithStraightTicks:{const o=this._cp2(s,-2,1),a=this._cp3(s,o,-1,-.5),h=this._sub(a,o);this._normalize(h);const l=this._dotProduct(h,this._sub(o,r)),c=this._dotProduct(h,this._sub(a,r));let u=[r];u.push([r[0]+h[0]*l,r[1]+h[1]*l]),u.push(o),t.push(u),u=[r],u.push([r[0]+h[0]*c,r[1]+h[1]*c]),u.push(a),t.push(u);break}case I.DoubleCurve:{const o=this._cp2(s,-5,-1),a=this._cp3(s,o,2,0),h=Math.atan2(1,5),l=Math.cos(h),c=Math.sin(h),u=this._sub(o,r),p=this._dist(r,o);this._normalize(u),this._rotateDirect(u,l,-c);const d=[r];d.push([r[0]+u[0]*p*.5,r[1]+u[1]*p*.5]),Ce(d[1],1),d.push([r[0]+u[0]*p*.8,r[1]+u[1]*p*.8]),this._addBezier2(d,d[2],[r[0]+u[0]*p,r[1]+u[1]*p],o,3);const f=this._sub(a,o),m=this._dist(o,a);this._normalize(f),this._rotateDirect(f,l,-c),this._addBezier2(d,o,[a[0]-f[0]*m,a[1]-f[1]*m],[a[0]-f[0]*m*.8,a[1]-f[1]*m*.8],3),d.push(a),t.push(d);break}case I.ParallelWithTicksByWidth:{const o=this._cp2(s,0,-1),a=this._cp3(s,o,.5,3),h=this._sub(o,r);this._normalize(h);const l=this._crossProduct(h,this._sub(a,r));this._leftPerpendicular(h),l>0?(this._addAngledTicks(t,r,[r[0]+h[0]*l,r[1]+h[1]*l],o),this._addAngledTicks(t,o,[o[0]+h[0]*l,o[1]+h[1]*l],r)):(this._addAngledTicks(t,[r[0]+h[0]*l,r[1]+h[1]*l],r,o),this._addAngledTicks(t,[o[0]+h[0]*l,o[1]+h[1]*l],r,o));break}case I.EnclosingRoundedRectangle:{const o=this._cp2(s,3,-2),a=[Math.min(r[0],o[0]),Math.max(r[1],o[1])],h=[Math.max(r[0],o[0]),Math.min(r[1],o[1])],l=h[0]-a[0],c=a[1]-h[1],u=Math.min(l,c)/10,p=[];p.push([a[0]+u+.75*(l-2*u),a[1]]),p.push([h[0]-u,a[1]]),this._add90DegArc(p,[h[0]-u,a[1]],[h[0],a[1]-u],[h[0],a[1]]),p.push([h[0],h[1]+u]),this._add90DegArc(p,[h[0],h[1]+u],[h[0]-u,h[1]],h),p.push([a[0]+u,h[1]]),this._add90DegArc(p,[a[0]+u,h[1]],[a[0],h[1]+u],[a[0],h[1]]),p.push([a[0],a[1]-u]),this._add90DegArc(p,[a[0],a[1]-u],[a[0]+u,a[1]],a),p.push([a[0]+u+.75*(l-2*u),a[1]]);break}case I.FullGeometry:default:t.push(s)}}return t}},Mn=class De{static local(){return De.instance===null&&(De.instance=new De),De.instance}execute(t,s,i,n,r){return new Ga(t,s,i)}};Mn.instance=null;let Ga=class extends pi{constructor(e,t,s){super(e,!0,!0),this._curveHelper=new Lt,this._beginCut=(t.beginCut!==void 0?t.beginCut:1)*s,this._endCut=(t.endCut!==void 0?t.endCut:1)*s,this._middleCut=(t.middleCut!==void 0?t.middleCut:0)*s,this._invert=t.invert!==void 0&&t.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(e){const{_beginCut:t,_endCut:s,_middleCut:i}=this,n=e.pathLength(),r=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._invert){if(t!==0||s!==0||i!==0)if(t+s+i>=n)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else this._curveHelper.appendSubCurve(r,e,0,t),this._curveHelper.appendSubCurve(r,e,.5*(n-i),.5*(n+i)),this._curveHelper.appendSubCurve(r,e,n-s,s)}else if(t===0&&s===0&&i===0)for(r.startPath();e.nextPoint();)r.pushXY(e.x,e.y);else t+s+i0&&(n/=this._currentPosition.segmentLength),this._currentPosition.copyTo(t);t.abscissa+e*this._partLengthRatio>t.segmentLength+this._tolerance;){if(s){if(s.pathSize===0)if(n===0){const o=t.segment[0];s.pushXY(o[0],o[1])}else s.pushPoint(this.getSegCoord2D(t.segment,n));const r=t.segment[1];s.pushXY(r[0],r[1])}if(n=0,e-=(t.segmentLength-t.abscissa)/this._partLengthRatio,this._partSegCount)t.segment=this._nextSegment(),t.segmentLength=this.getSegLength(t.segment),t.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==$t.FAIL&&(t.segmentLength=this.getSegLength(t.segment),t.isPartEnd=!0,i===$t.END?(t.abscissa=t.segmentLength,t.isPathEnd=!0):t.abscissa=t.segmentLength+e,!0);this._currentPosition.copyTo(t)}}if(t.abscissa+=e*this._partLengthRatio,s){s.pathSize===0&&(n===0?s.pushPoint(t.segment[0]):s.pushPoint(this.getSegCoord2D(t.segment,n)));const r=t.abscissa/t.segmentLength;r===1?s.pushPoint(t.segment[1]):s.pushPoint(this.getSegCoord2D(t.segment,r))}return this._partSegCount||Math.abs(t.abscissa-t.segmentLength)=this._pathCursor.pathSize&&(s=0),this._ctrlPtEnd=this._pathCursor.getControlPointAt(s),this._patternLength>0){const i=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,n=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let r=Math.round((this._partLength-(i+n))/this._patternLength);r<=0&&(r=i+n>0?0:1),this._partLengthRatio=this._partLength/(i+n+r*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=t;)i-=t,t=this._pattern.nextValue(),r=!r;t-=i,r?(this._walker.nextPosition(t),t=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(t),t=this._pattern.nextValue(),this._walker.nextPosition(t),t=this._pattern.nextValue())}let s=this._walker.nextCurve(t);if(s)if(this._walker.isPathEnd()){if(this.iteratePath=!1,this._firstCurve){for(this._firstCurve.nextPath();this._firstCurve.nextPoint();)s.pushXY(this._firstCurve.x,this._firstCurve.y);this._firstCurve=null}}else t=this._pattern.nextValue(),!this._walker.nextPosition(t)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s.pushCursor(this._firstCurve),this._firstCurve=null)):this.iteratePath=!0;else this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null;return s?.reset(),s}},In=class Ve{static local(){return Ve.instance===null&&(Ve.instance=new Ve),Ve.instance}execute(t,s,i,n,r,o){return new Ha(t,s,i,n,r,o)}};In.instance=null;let Ha=class{constructor(e,t,s,i,n,r){switch(this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._maxInflateSize=r*s,this._width=(t.width!==void 0?t.width:2)*s,t.method){case Se.Mitered:case Se.Bevelled:case Se.Rounded:case Se.TrueBuffer:case Se.Square:}this._option=t.option}next(){let e;for(;e=this._inputGeometries.next();){if(e.geometryType==="esriGeometryEnvelope"&&this._width>0){const t=e.asJSON();return Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0?e:N.fromJSONCIM({paths:[[[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]],[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]})}if(e.geometryType==="esriGeometryPolygon"){if(this._width===0)return e.clone();const t=this._geometryEngine;if(t==null)return null;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.buffer(cr.WebMercator,s.asJSON(),-this._width,1);if(i){for(const n of i.rings)if(n){s.startPath();for(const r of n.reverse())s.pushXY(r[0],s.yFactor*r[1])}}return s}}return null}},kn=class He{static local(){return He.instance===null&&(He.instance=new He),He.instance}execute(t,s,i,n,r){return new Ba(t,s,i)}};kn.instance=null;let Ba=class extends pi{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._length=(t.length!==void 0?t.length:20)*s,this._angle=t.angle!==void 0?t.angle:225,this._position=t.position!==void 0?t.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(e){const t=N.createEmptyOptimizedCIM("esriGeometryPolyline");if(this._curveHelper.isEmpty(e))return null;e.seekInPath(0);const s=e.x,i=e.y;e.seekInPath(e.pathSize-1);const n=e.x,r=e.y,o=[n-s,r-i];this._curveHelper.normalize(o);const a=s+(n-s)*this._position/100,h=i+(r-i)*this._position/100,l=Math.cos((90-this._angle)/180*Math.PI);let c=Math.sin((90-this._angle)/180*Math.PI);this._mirror&&(c=-c),this._mirror=!this._mirror;const u=[a-this._length/2*l,h-this._length/2*c],p=[a+this._length/2*l,h+this._length/2*c];return t.pushPath([[s,i],u,p,[n,r]]),t}},Tn=class Be{static local(){return Be.instance===null&&(Be.instance=new Be),Be.instance}execute(t,s,i,n,r){return new Xa(t,s,i)}};Tn.instance=null;let Xa=class{constructor(e,t,s){this._inputGeometries=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0}next(){let e=this._inputGeometries.next();for(;e;){if(e.totalSize>0)return this._move(e.clone(),this._offsetX,this._offsetY);e=this._inputGeometries.next()}return null}_move(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=e.x+t,e.y=e.y+s;return e.reset(),e}};const Ua=10;let zn=class Xe{static local(){return Xe.instance===null&&(Xe.instance=new Xe),Xe.instance}execute(t,s,i,n,r,o){return new Ya(t,s,i,n,r,o)}};zn.instance=null;let Ya=class{constructor(e,t,s,i,n,r){this._inputGeometries=e,this._tileKey=i,this._geometryEngine=n,this._curveHelper=new Lt,this._offset=(t.offset??1)*s,this._method=t.method,this._maxInflateSize=Math.max(Math.abs(r*s),Ua),this._option=t.option,this._offsetFlattenError=cs*s}next(){let e;for(;e=this._inputGeometries.next();){if(this._offset===0)return e.clone();if(e.geometryType==="esriGeometryEnvelope"){if(this._method===Kt.Rounded&&this._offset>0){const r=Jt(e),o=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(o){const a=N.createEmptyOptimizedCIM(e.geometryType);return a.pushPath(o),a}return null}const n=e.asJSON();if(ht(n)&&Math.min(n.xmax-n.xmin,n.ymax-n.ymin)+2*this._offset>0)return N.fromJSONCIM({xmin:n.xmin-this._offset,xmax:n.xmax+this._offset,ymin:n.ymin-this._offset,ymax:n.ymax+this._offset})}const t=this._geometryEngine;if(t==null)continue;const s=this._tileKey?ur(e,this._maxInflateSize):e.clone();if(!s)continue;const i=t.offset(cr.WebMercator,s.asJSON(),-this._offset,1,this._method,4,this._offsetFlattenError);return i?N.fromJSONCIM(i):null}return null}},Ln=class Ue{static local(){return Ue.instance===null&&(Ue.instance=new Ue),Ue.instance}execute(t,s,i,n,r){return new Wa(t,s,i)}};Ln.instance=null;let Wa=class{constructor(e,t,s){this._inputGeometries=e,this._reverse=t.reverse===void 0||t.reverse}next(){let e=this._inputGeometries.next();for(;e;){if(!this._reverse)return e;if(e.geometryType==="esriGeometryPolyline")return qa(e.clone());e=this._inputGeometries.next()}return null}};function qa(e){for(;e.nextPath();)for(let t=0;t0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._rotate(e.clone(),s,i)}e=this._inputGeometries.next()}return null}_rotate(e,t,s){const i=Math.cos(this._rotateAngle),n=Math.sin(this._rotateAngle);for(;e.nextPath();)for(;e.nextPoint();){const r=e.x-t,o=e.y-s;e.x=t+r*i-o*n,e.y=s+r*n+o*i}return e.reset(),e}},On=class We{static local(){return We.instance===null&&(We.instance=new We),We.instance}execute(t,s,i,n,r){return new ja(t,s,i)}};On.instance=null;let ja=class{constructor(e,t,s){this._inputGeometries=e,this._xFactor=t.xScaleFactor!==void 0?t.xScaleFactor:1.15,this._yFactor=t.yScaleFactor!==void 0?t.yScaleFactor:1.15}next(){const e=this._inputGeometries.next();if(e){if(this._xFactor===1&&this._yFactor===1||e.geometryType==="esriGeometryPoint")return e;if(e.totalSize>0){const t=ui(e),s=(t[2]+t[0])/2,i=(t[3]+t[1])/2;return e.reset(),this._scaleCursor(e.clone(),s,i)}}return null}_scaleCursor(e,t,s){for(;e.nextPath();)for(;e.nextPoint();)e.x=t+(e.x-t)*this._xFactor,e.y=s+(e.y-s)*this._yFactor;return e.reset(),e}},En=class qe{static local(){return qe.instance===null&&(qe.instance=new qe),qe.instance}execute(t,s,i,n,r){return new Ja(t,s,i)}};En.instance=null;let Ja=class{constructor(e,t,s){this._inputGeometries=e,this._height=(t.amplitude!==void 0?t.amplitude:2)*s,this._period=(t.period!==void 0?t.period:3)*s,this._style=t.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new di,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new fi,this._walker.updateTolerance(s)}next(){let e=this._inputGeometries.next();for(;e;){if(this._height===0||this._period===0)return e;const t=this._processGeom(e);if(t)return t;e=this._inputGeometries.next()}return null}_processGeom(e){const t=N.createEmptyOptimizedCIM(e.geometryType);for(;e.nextPath();){t.startPath();const s=e.pathLength();if(this._walker.init(e,this._pattern))switch(this._style){case ws.Sinus:default:this._constructCurve(t,s,!1);break;case ws.Square:this._constructSquare(t,s);break;case ws.Triangle:this._constructTriangle(t,s);break;case ws.Random:this._constructCurve(t,s,!0)}else for(;e.nextPoint();)t.pushXY(e.x,e.y)}return t}_constructCurve(e,t,s){let i=Math.round(t/this._period);i===0&&(i=1);const n=i*16+1,r=t/i,o=this._period/16,a=1/n,h=2*Math.PI*t/r,l=2*Math.PI*Math.random(),c=2*Math.PI*Math.random(),u=2*Math.PI*Math.random(),p=.75-Math.random()/2,d=.75-Math.random()/2,f=new Mt;this._walker.curPointAndAngle(f),e.pushPoint(f.pt);let m=0;for(;;){if(!this._walker.nextPointAndAngle(o,f)){e.pushPoint(this._walker.getPathEnd());break}{const _=m;let y;if(m+=a,s){const b=this._height/2*(1+.3*Math.sin(p*h*_+l));y=b*Math.sin(h*_+c),y+=b*Math.sin(d*h*_+u),y/=2}else y=.5*this._height*Math.sin(.5*h*_);e.pushXY(f.pt[0]-y*f.sa,f.pt[1]+y*f.ca)}}}_constructSquare(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(n.pt[0]-this._height/2*n.sa,n.pt[1]+this._height/2*n.ca),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(r.pt[0]+this._height/2*r.sa,r.pt[1]-this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}_constructTriangle(e,t){Math.round(t/this._period);let s=!0;for(;;){let i=!1;if(this._walker.curPositionIsValid()){const n=new Mt;this._walker.curPointAndAngle(n);const r=new Mt;if(this._walker.nextPointAndAngle(this._period/2,r)){const o=new Mt;this._walker.nextPointAndAngle(this._period,o)&&(this._walker.nextPosition(this._period/2)&&(s?(e.pushPoint(n.pt),s=!1):e.pushPoint(n.pt),e.pushXY(r.pt[0]-this._height/2*r.sa,r.pt[1]+this._height/2*r.ca),e.pushXY(o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca)),i=!0)}}if(!i){e.pushPoint(this._walker.getPathEnd());break}}}},Fn=class Ke{static local(){return Ke.instance===null&&(Ke.instance=new Ke),Ke.instance}execute(t,s,i,n,r){return new Za(t,s,i)}};Fn.instance=null;let Za=class extends fs{constructor(e,t,s){super(e),this._geometryWalker=new fi,this._geometryWalker.updateTolerance(s),this._angleToLine=t.angleToLine??!0,this._offset=(t.offset?t.offset:0)*s,this._originalEndings=t.endings,this._offsetAtEnd=(t.customEndingOffset?t.customEndingOffset:0)*s,this._position=-(t.offsetAlongLine?t.offsetAlongLine:0)*s,this._pattern=new di,this._pattern.init(t.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath)t=this._pattern.nextValue();else{this._originalEndings===Pt.WithFullGap&&this.isClosed?this._endings=Pt.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let i,n=!0;switch(this._endings){case Pt.NoConstraint:i=-this._position,i=this._adjustPosition(i),n=!1;break;case Pt.WithHalfGap:default:i=-this._pattern.lastValue()/2;break;case Pt.WithFullGap:i=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case Pt.WithMarkers:i=0;break;case Pt.Custom:i=-this._position,i=this._adjustPosition(i),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(e,this._pattern,n))return null;this._pattern.reset();let r=0;for(;i>r;)i-=r,r=this._pattern.nextValue();r-=i,t=r,this.iteratePath=!0}const s=new Mt;return this._geometryWalker.nextPointAndAngle(t,s)?this._endings===Pt.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===Pt.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(e){let t=e/this._pattern.length();return t-=Math.floor(t),t*this._pattern.length()}},Nn=class je{static local(){return je.instance===null&&(je.instance=new je),je.instance}execute(t,s,i,n,r){return new Qa(t,s,i)}};Nn.instance=null;let Qa=class extends fs{constructor(e,t,s){super(e,!1,!0),this._curveHelper=new Lt,this._placePerPart=t.placePerPart??!1,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._type=t.extremityPlacement,this._position=t.offsetAlongLine!==void 0?t.offsetAlongLine*s:0,this._beginProcessed=!1}processMultiPath(e){return this._placePerPart?super.processMultiPath(e):this.processPath(e)}processPath(e){let t;switch(this._type){case Rt.Both:default:this._beginProcessed?(t=this._atExtremities(e,this._position,!1),this._beginProcessed=!1,this.iterateMultiPath=!1,this.iteratePath=!1):(t=this._atExtremities(e,this._position,!0),this._beginProcessed=!0,this.iterateMultiPath=!0,this.iteratePath=!0);break;case Rt.JustBegin:t=this._atExtremities(e,this._position,!0);break;case Rt.JustEnd:t=this._atExtremities(e,this._position,!1);case Rt.None:}return t}_atExtremities(e,t,s){if(this._placePerPart||(s?e.seekPath(0):e.seekPath(e.totalSize-1)),s||e.seekPathEnd(),s?e.nextPoint():e.prevPoint()){let i=0,[n,r]=[0,0],[o,a]=[e.x,e.y];for(;s?e.nextPoint():e.prevPoint();){n=o,r=a,o=e.x,a=e.y;const h=this._curveHelper.getLength(n,r,o,a);if(i+h>t){const l=(t-i)/h,[c,u]=this._curveHelper.getAngleCS(n,r,o,a,l),p=this._curveHelper.getCoord2D(n,r,o,a,l);return this.internalPlacement.setTranslate(p[0]-this._offset*u,p[1]+this._offset*c),this._angleToLine&&this.internalPlacement.setRotateCS(-c,-u),this.internalPlacement}i+=h}}return null}},$n=class Je{static local(){return Je.instance===null&&(Je.instance=new Je),Je.instance}execute(t,s,i,n,r){return new th(t,s,i)}};$n.instance=null;let th=class extends fs{constructor(e,t,s){super(e),this._walker=new fi,this._walker.updateTolerance(s),this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._beginGap=t.beginPosition!==void 0?t.beginPosition*s:0,this._endGap=t.endPosition!==void 0?t.endPosition*s:0,this._flipFirst=t.flipFirst===void 0||t.flipFirst,this._pattern=new di,this._pattern.init(t.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(e){if(this._pattern.isEmpty())return null;let t;if(this.iteratePath){const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=e.pathLength()-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(e,this._pattern,!1))return null;this._pattern.reset();const o=this._pattern.nextValue()*this._subPathLen,a=this._beginGap+o;t=a-this._prevPos,this._prevPos=a,this.iteratePath=!0}const s=new Mt;if(!this._walker.nextPointAndAngle(t,s,$t.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,r;return this._angleToLine?(n=s.ca,r=s.sa):(n=1,r=0),i&&(n=-n,r=-r),this.internalPlacement.setRotateCS(n,r),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}};const Et=512,eh=10,ut=24,ii=1e-6;let Rn=class Ze{static local(){return Ze.instance===null&&(Ze.instance=new Ze),Ze.instance}execute(t,s,i,n,r){return new sh(t,s,i,n,r)}};Rn.instance=null;let sh=class Ht{constructor(t,s,i,n,r){if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._accelerationMap=null,this._testInsidePolygon=!1,this._verticalSubdivision=!0,this._stepX=Math.abs(s.stepX??16)*i,this._stepY=Math.abs(s.stepY??16)*i,this._stepX=Math.round(128*this._stepX)/128,this._stepY=Math.round(128*this._stepY)/128,this._stepX!==0&&this._stepY!==0){if(this._gridType=s.gridType??xi.Fixed,this._gridType===xi.Random){const o=s.seed??13,a=1;this._randomLCG=new un(o*a),this._randomness=(s.randomness??100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0,this._buildRandomValues()}else{if(this._randomness=0,this._gridAngle=s.gridAngle??0,this._shiftOddRows=s.shiftOddRows??!1,this._offsetX=(s.offsetX??0)*i,this._offsetY=(s.offsetY??0)*i,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}if(this._graphicOriginX=0,this._graphicOriginY=0,n!=null){const[o,a,h,l]=n.split("/"),c=parseFloat(o),u=parseFloat(a),p=parseFloat(h),d=parseFloat(l);this._graphicOriginX=-(d*2**c+p)*Et,this._graphicOriginY=u*Et,this._testInsidePolygon=!0}this._internalPlacement=new ye,this._calculateMinMax(t),this._geometryCursor=t}}next(){return this._geometryCursor?this._nextInside():null}_buildRandomValues(){if(!Ht._randValues){Ht._randValues=[];for(let t=0;t=b,this._polygonMin=this._verticalSubdivision?p:f,this._testInsidePolygon){let P=0-this._graphicOriginX-this._offsetX-this._stepX,w=Et-this._graphicOriginX-this._offsetX+this._stepX,S=-Et-this._graphicOriginY-this._offsetY-this._stepY,L=0-this._graphicOriginY-this._offsetY+this._stepY;if(_){const V=[[P,S],[P,L],[w,S],[w,L]];P=S=Number.MAX_VALUE,w=L=-Number.MAX_VALUE;for(const U of V){const z=this._cosAngle*U[0]-this._sinAngle*U[1],O=this._sinAngle*U[0]+this._cosAngle*U[1];P=Math.min(P,z),w=Math.max(w,z),S=Math.min(S,O),L=Math.max(L,O)}}h=h!==Number.MAX_VALUE?Math.max(h,P):P,l=l!==Number.MAX_VALUE?Math.max(l,S):S,c=c!==-Number.MAX_VALUE?Math.min(c,w):w,u=u!==-Number.MAX_VALUE?Math.min(u,L):L}this._xMin=Math.round(h/this._stepX),this._xMax=Math.round(c/this._stepX),this._yMin=Math.round(l/this._stepY),this._yMax=Math.round(u/this._stepY),this._currentX=this._xMax+1,this._currentY=this._yMin-1,this._buildAccelerationMap(t,f,m,p,d)}_buildAccelerationMap(t,s,i,n,r){t.reset();const o=new Map,a=this._verticalSubdivision,h=a?r-n:i-s;let l=Math.ceil(h/eh);if(l<=1)return;const c=Math.floor(h/l);let u,p,d,f,m,_,y,b,P,w,S;for(l++,this._delta=c,a?(P=-Et-2*this._stepY,w=2*this._stepY,S=n):(P=-2*this._stepX,w=Et+2*this._stepX,S=s);t.nextPath();)if(!(t.pathSize<2)&&t.nextPoint())for(u=t.x,p=t.y;t.nextPoint();u=d,p=f){if(d=t.x,f=t.y,a){if(p===f||pw&&f>w)continue;m=Math.min(p,f),_=Math.max(p,f)}else{if(u===d||uw&&d>w)continue;m=Math.min(u,d),_=Math.max(u,d)}for(;m<_;)y=Math.floor((m-S)/c),Gr(y,u,p,d,f,o),m+=c;b=Math.floor((_-S)/c),b>y&&Gr(b,u,p,d,f,o)}this._accelerationMap=o}_nextInside(){for(;;){if(this._currentX>this._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 s=this._currentY*this._stepY+this._offsetY;let i,n;if(this._currentX++,this._gridType===xi.Random){const r=(this._currentX%ut+ut)%ut,o=(this._currentY%ut+ut)%ut;i=this._graphicOriginX+t+this._stepX*this._randomness*(.5-Ht._randValues[o*ut+r])*2/3,n=this._graphicOriginY+s+this._stepY*this._randomness*(.5-Ht._randValues[o*ut+r+1])*2/3}else i=this._graphicOriginX+this._cosAngle*t+this._sinAngle*s,n=this._graphicOriginY-this._sinAngle*t+this._cosAngle*s;if(!this._testInsidePolygon||this._isInsidePolygon(i,n,this._geometryCursor))return this._internalPlacement.setTranslate(i,n),this._internalPlacement}}_isInsidePolygon(t,s,i){if(this._accelerationMap==null)return ih(t,s,i);t+=ii,s+=ii;const n=this._verticalSubdivision,r=n?s:t,o=Math.floor((r-this._polygonMin)/this._delta),a=this._accelerationMap.get(o);if(!a)return!1;let h,l,c,u=0;for(const p of a){if(h=p[0],l=p[1],n){if(h[1]>s==l[1]>s)continue;c=(l[0]-h[0])*(s-h[1])-(l[1]-h[1])*(t-h[0])}else{if(h[0]>t==l[0]>t)continue;c=(l[1]-h[1])*(t-h[0])-(l[0]-h[0])*(s-h[1])}c>0?u++:u--}return u!==0}};function ih(e,t,s){let i,n,r,o,a=0;for(e+=ii,t+=ii,s.reset();s.nextPath();)if(s.nextPoint())for(i=s.x,n=s.y;s.nextPoint();i=r,n=o)r=s.x,o=s.y,n>t!=o>t&&((r-i)*(t-n)-(o-n)*(e-i)>0?a++:a--);return a!==0}function Gr(e,t,s,i,n,r){let o=r.get(e);o||(o=[],r.set(e,o)),o.push([[t,s],[i,n]])}const rh=.001;let Dn=class Qe{static local(){return Qe.instance===null&&(Qe.instance=new Qe),Qe.instance}execute(t,s,i,n,r){return new nh(t,s,i)}};Dn.instance=null;let nh=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._relativeTo=t.relativeTo,this._position=t.startPointOffset!==void 0?t.startPointOffset*s:0,this._epsilon=rh*s}processPath(e){const t=this._position;if(this._relativeTo===Me.SegmentMidpoint){if(this.iteratePath||(this.iteratePath=!0),e.nextPoint()){let[i,n]=[e.x,e.y],[r,o]=[0,0];for(;e.nextPoint();){r=e.x,o=e.y;const a=this._curveHelper.getLength(i,n,r,o);if(ai){const u=(i-r)/c,[p,d]=this._curveHelper.getAngleCS(o,a,h,l,u),f=this._curveHelper.getCoord2D(o,a,h,l,u),m=n?-this._offset:this._offset;return this.internalPlacement.setTranslate(f[0]-m*d,f[1]+m*p),this._angleToLine&&(n?this.internalPlacement.setRotateCS(-p,-d):this.internalPlacement.setRotateCS(p,d)),this.internalPlacement}o=h,a=l,r+=c}}return null}};const oh=1e-15;let Gn=class ts{static local(){return ts.instance===null&&(ts.instance=new ts),ts.instance}execute(t,s,i,n,r){return new ah(t,s,i)}};Gn.instance=null;let ah=class extends fs{constructor(e,t,s){super(e),this._curveHelper=new Lt,this._angleToLine=t.angleToLine===void 0||t.angleToLine,this._offset=t.offset!==void 0?t.offset*s:0,this._endPoints=t.placeOnEndPoints===void 0||t.placeOnEndPoints,this._controlPoints=t.placeOnControlPoints===void 0||t.placeOnControlPoints,this._regularVertices=t.placeOnRegularVertices===void 0||t.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(e){if(this.iteratePath||(this._preparePath(e),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const t=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(t[2]);let s=t[0],i=t[1];if(this._offset!==0){const n=Math.cos(t[2]),r=Math.sin(t[2]);s-=this._offset*r,i+=this._offset*n}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(e){this._tags.length=0,this._tagIterator=0,e.seekPathStart();const t=e.isClosed();let s=0,i=!1,n=0,r=0;if(e.seekPathStart(),e.nextPoint()){let o=e.x,a=e.y,h=e.getControlPoint(),l=!0,c=e.nextPoint();for(;c;){const u=e.x,p=e.y,d=e.getControlPoint();(this._angleToLine||this._offset!==0)&&(n=this._curveHelper.getAngle(o,a,u,p,0)),l?(l=!1,t?(s=n,i=h):(this._endPoints||this._controlPoints&&h)&&this._tags.push([o,a,n])):h?this._controlPoints&&this._tags.push([o,a,Ts(r,n)]):this._regularVertices&&this._tags.push([o,a,Ts(r,n)]),(this._angleToLine||this._offset!==0)&&(r=this._curveHelper.getAngle(o,a,u,p,1)),c=e.nextPoint(),c||(t?d||i?this._controlPoints&&this._tags.push([u,p,Ts(r,s)]):this._regularVertices&&this._tags.push([u,p,Ts(r,s)]):(this._endPoints||this._controlPoints&&d)&&this._tags.push([u,p,r])),o=u,a=p,h=d}}this._tagIterator=0}};function Ts(e,t){const s=Math.PI;for(;Math.abs(t-e)>s+2*oh;)t-e>s?t-=2*s:t+=2*s;return(e+t)/2}const hh=100*222045e-21;function lh(e){if(e.totalSize===0)return null;const t=ui(e);if(!t)return null;const s=4*(Math.abs(t[0])+Math.abs(t[2])+Math.abs(t[1])+Math.abs(t[3])+1)*hh;let i=0,n=0;e.reset();for(let z=0;e.nextPath();z++){const O=e.getCurrentRingArea();O>n&&(n=O,i=z)}if(e.seekPath(i),e.pathSize===0)return null;e.seekPathStart();const r=Ko(e);if(Math.abs(n)<=2*s*s)return[(r[0]+r[2])/2,(r[1]+r[3])/2];e.seekPathStart();const o=jo(e,Qt());if(o===null)return null;if(e.totalPoints<4)return o;const a=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],h=[NaN,NaN,NaN,NaN],l=[NaN,NaN,NaN,NaN];let c=!1,u=Ie(o,e,!0);u.distance===0&&(c=!0,a[0][0]=o[0],a[0][1]=o[1],u=Ie(o,e,!1)),h[0]=u.distance,l[0]=0;const p=[NaN,NaN];let d=!1,f=.25,m=-1,_=NaN;do if(_=NaN,a[1]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[1][0])||isNaN(a[1][1])||(u=Ie(a[1],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[1],e))d=!0,h[1]=_,l[1]=Bt(a[1],o);else if(!isNaN(_)&&_>m&&(m=_,p[0]=a[1][0],p[1]=a[1][1]),f-=.01,f<.1){if(!(m>=0))break;d=!0,h[1]=m,a[1][0]=p[0],a[1][1]=p[1],l[1]=Bt(a[1],o)}while(!d);d=!1,f=.5,m=-1;let y=.01,b=1;do if(_=NaN,a[2]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[2][0])||isNaN(a[2][1])||(u=Ie(a[2],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[2],e))d=!0,h[2]=_,l[2]=Bt(a[2],o);else if(!isNaN(_)&&_>m)m=_,p[0]=a[2][0],p[1]=a[2][1];else if(_>m&&(m=_,p[0]=a[2][0],p[1]=a[2][1]),f=.5+y*b,y+=.01,b*=-1,f<.3||f>.7){if(!(m>=0))break;d=!0,h[2]=m,a[2][0]=p[0],a[2][1]=p[1],l[2]=Bt(a[2],o)}while(!d);d=!1,f=.75,m=-1;do if(_=NaN,a[3]=vi(e,Si(r[0],r[2],f),s,t),isNaN(a[3][0])||isNaN(a[3][1])||(u=Ie(a[3],e,!1),_=u.distance),!isNaN(_)&&_>s&&Vs(a[3],e))d=!0,h[3]=_,l[3]=Bt(a[3],o);else if(_>m&&(m=_,p[0]=a[3][0],p[1]=a[3][1]),f+=.01,f>.9){if(!(m>=0))break;d=!0,h[3]=m,a[3][0]=p[0],a[3][1]=p[1],l[3]=Bt(a[3],o)}while(!d);const P=[0,1,2,3],w=c?0:1;let S;for(let z=w;z<4;z++)for(let O=w;O<3;O++){const ot=l[O],Z=l[O+1];ph(ot,Z)>0&&(S=P[O],P[O]=P[O+1],P[O+1]=S,l[O]=Z,l[O+1]=ot)}let L=w,V=0,U=0;for(let z=w;z<4;z++){switch(z){case 0:U=2*h[P[z]];break;case 1:U=1.66666666*h[P[z]];break;case 2:U=1.33333333*h[P[z]];break;case 3:U=h[P[z]]}U>V&&(V=U,L=P[z])}return a[L]}function Vs(e,t){let s,i,n,r,o=0;for(t.reset();t.nextPath()&&t.nextPoint();)for(s=t.x,i=t.y;t.nextPoint();s=n,i=r)n=t.x,r=t.y,i>e[1]!=r>e[1]&&((n-s)*(e[1]-i)-(r-i)*(e[0]-s)>0?o++:o--);return o!==0}function Ie(e,t,s){if(s&&Vs(e,t))return{coord:e,distance:0};let i=1/0,n=0,r=0,o=[0,0],a=[0,0];const h=[0,0];for(t.reset();t.nextPath()&&t.nextPoint();)if(!(t.pathSize<2))for(o[0]=t.x,o[1]=t.y;t.nextPoint();o=a){a=[t.x,t.y],Jo(h,e,o,a);const l=Bt(e,h);lo?mu)i&Vr?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):n&Vr?(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)):i?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e));else if(i&Hr?(i&Ls?(t[0]+=c*(o-t[1])/u,t[1]=o):(t[0]+=c*(h-t[1])/u,t[1]=h),i=pt(t,e)):n&Hr?(n&Ls?(s[0]+=c*(o-s[1])/u,s[1]=o):(s[0]+=c*(h-s[1])/u,s[1]=h),n=pt(s,e)):i?(i&zs?(t[1]+=u*(r-t[0])/c,t[0]=r):(t[1]+=u*(a-t[0])/c,t[0]=a),i=pt(t,e)):(n&zs?(s[1]+=u*(r-s[0])/c,s[0]=r):(s[1]+=u*(a-s[0])/c,s[0]=a),n=pt(s,e)),i&n)return 0}while(i|n);return l}function pt(e,t){return(e[0]t[2]?1:0)<<1|(e[1]t[3]?1:0)<<3}function Si(e,t,s){return e+(t-e)*s}function Bt(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])}function ph(e,t){if(et)return 1;if(e===t)return 0;const s=isNaN(e),i=isNaN(t);return si?1:0}let Vn=class es{static local(){return es.instance===null&&(es.instance=new es),es.instance}execute(t,s,i,n,r){return new dh(t,s,i)}};Vn.instance=null;let dh=class{constructor(e,t,s){this._geometryCursor=e,this._offsetX=t.offsetX!==void 0?t.offsetX*s:0,this._offsetY=t.offsetY!==void 0?t.offsetY*s:0,this._method=t.method!==void 0?t.method:vs.OnPolygon,this._placementPerPart=t.placePerPart!==void 0&&t.placePerPart,this._internalPlacement=new ye}next(){const e=this._geometryCursor;if(!e)return null;if(!this._placementPerPart)return this._geometryCursor=null,this._polygonCenter(e);for(;e.nextPath();)if(!(e.getCurrentRingArea()<0))return this._polygonCenter(e.getCurrentPath());return this._geometryCursor=null,null}_polygonCenter(e){let t=!1;switch(this._method){case vs.CenterOfMass:{const s=ea(e);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}break;case vs.BoundingBoxCenter:{const s=ui(e);s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),t=!0)}break;case vs.OnPolygon:default:{const s=lh(e);s!==null&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),t=!0)}}return t?this._internalPlacement:null}};function fh(e){if(!e)return null;switch(e.type){case"CIMGeometricEffectAddControlPoints":return Pn.local();case"CIMGeometricEffectArrow":return wn.local();case"CIMGeometricEffectBuffer":return vn.local();case"CIMGeometricEffectControlMeasureLine":return Sn.local();case"CIMGeometricEffectCut":return Mn.local();case"CIMGeometricEffectDashes":return Cn.local();case"CIMGeometricEffectDonut":return In.local();case"CIMGeometricEffectJog":return kn.local();case"CIMGeometricEffectMove":return Tn.local();case"CIMGeometricEffectOffset":return zn.local();case"CIMGeometricEffectReverse":return Ln.local();case"CIMGeometricEffectRotate":return An.local();case"CIMGeometricEffectScale":return On.local();case"CIMGeometricEffectWave":return En.local()}return null}function mh(e){if(!e)return null;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":return Fn.local();case"CIMMarkerPlacementAtExtremities":return Nn.local();case"CIMMarkerPlacementAtRatioPositions":return $n.local();case"CIMMarkerPlacementInsidePolygon":return Rn.local();case"CIMMarkerPlacementOnLine":return Dn.local();case"CIMMarkerPlacementOnVertices":return Gn.local();case"CIMMarkerPlacementPolygonCenter":return Vn.local()}return null}const Mi=new No;function _h(e){if(e==null)return["",!1];if(!Mi.hasBidiChar(e))return[e,!1];let t;return t=Mi.checkContextual(e)==="rtl"?"IDNNN":"ICNNN",[Mi.bidiTransform(e,t,"VLYSN"),!0]}const pr="arial-unicode-ms",Br="woff2",Xr=new Map,gh=new Set;let yh=class{constructor(e,t){this.fontFace=e,this.promise=t}};async function Wc(e){const t=Ph(e),s=bh(e),i=Xr.get(t);if(i)return i.promise;const n=new FontFace(e.family,`url('${Qo.fontsUrl}/woff2/${s}.${Br}') format('${Br}')`,{style:e.style,weight:e.weight}),r=document.fonts;if(r.has(n)&&n.status==="loading")return n.loaded;const o=n.load().then(()=>(r.add(n),n));return Xr.set(t,new yh(n,o)),gh.add(n),o}function xh(e){if(!e)return pr;const t=e.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 bh(e){const t=Hn(e)+Bn(e);return xh(e.family)+(t.length>0?t:"-regular")}function Ph(e){const t=Hn(e)+Bn(e);return(e.family||pr)+(t.length>0?t:"-regular")}function Hn(e){if(!e.weight)return"";switch(e.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function Bn(e){if(!e.style)return"";switch(e.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}let wh=class{applyColorSubstitution(e,t){if(!t)return e;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=e,n=this._rasterizationCanvas,r=n.getContext("2d",{willReadFrequently:!0});e!==n&&(n.width=s,n.height=i,r.drawImage(e,0,0,s,i));const o=r.getImageData(0,0,s,i).data;if(t){for(const h of t)if(h&&h.oldColor&&h.oldColor.length===4&&h.newColor&&h.newColor.length===4){const[l,c,u,p]=h.oldColor,[d,f,m,_]=h.newColor;if(l===d&&c===f&&u===m&&p===_)continue;for(let y=0;y0;let w=this._lineThroughWidthOffset,S=0;if(o){i.save();const Z=t.backgroundColor??[0,0,0,0],at=t.borderLine?.color??[0,0,0,0],Fo=2*(t.borderLine?.size??0);i.fillStyle=As(Z),i.strokeStyle=As(at),i.lineWidth=Fo,i.fillRect(0,0,s.width,s.height),i.strokeRect(0,0,s.width,s.height),i.restore()}P&&this._renderHalo(i,y,b,w,S,t),f>0&&this._renderOutline(i,y,b,w,S,t),S+=b,w+=y;for(const Z of this._textLines)P?(i.globalCompositeOperation="destination-out",i.fillStyle="rgb(0, 0, 0)",i.fillText(Z,w,S),i.globalCompositeOperation="source-over",i.fillStyle=this._fillStyle,i.fillText(Z,w,S)):(i.fillStyle=this._fillStyle,i.fillText(Z,w,S)),n&&n!=="none"&&this._renderDecoration(i,w,S,n,r),S+=d;i.restore();const L=this._renderedWidth+2*this._lineThroughWidthOffset,V=this._renderedHeight,U=i.getImageData(0,0,L,V),z=new Uint8Array(U.data);if(t.premultiplyColors){let Z;for(let at=0;at600)&&(s+=.3*e.measureText("w").width),s+=2*fe(this._parameters.halo.size),Math.round(s)}_computeLineHeightBase(){return 1.275*this._parameters.size}_computeLineHeight(){let e=this._computeLineHeightBase();const t=this._parameters.font.decoration;return t&&t==="underline"&&(e*=1.3),Math.round(e+2*fe(this._parameters.halo.size))}_renderDecoration(e,t,s,i,n,r){let o=.9*this._lineHeight;const a=n==="bold"?.06:n==="bolder"?.09:.04;switch(e.textAlign){case"center":t-=this._renderedWidth/2;break;case"right":t-=this._renderedWidth}const h=e.textBaseline;if(i==="underline")switch(o=.9*this._computeLineHeightBase(),h){case"top":s+=o;break;case"middle":s+=o/2}else if(i==="line-through")switch(h){case"top":s+=o/1.5;break;case"middle":s+=o/3}const l=r?1.5*r:Math.ceil(o*a);e.save(),e.beginPath(),e.strokeStyle=e.fillStyle,e.lineWidth=l,e.moveTo(t-this._lineThroughWidthOffset,s),e.lineTo(t+this._renderedWidth+2*this._lineThroughWidthOffset,s),e.stroke(),e.restore()}};function ke(e,t){const s=Math.max(t.size,.5),i=t.font,n=`${i.style} ${i.weight} ${fe(s).toFixed(1)}px ${i.family}, sans-serif`;let r;switch(e.font=n,e.textBaseline="top",t.horizontalAlignment){case"left":default:r="left";break;case"right":r="right";break;case"center":r="center"}e.textAlign=r}function Mh(e,t,s){return e==="center"?.5*t:e==="right"?t-s:s}function Yn(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Ch(){const e=Yn("svg");return e.setAttribute("style","position: absolute;"),e.setAttribute("width","0"),e.setAttribute("height","0"),e.setAttribute("aria-hidden","true"),e.setAttribute("role","presentation"),document.body.appendChild(e),e}function Ih(e){return e!=null&&document.body.removeChild(e),null}const kh=()=>ge.getLogger("esri.views.2d.engine.webgl.alignmentUtils");var yt,nt;function Th(e){if(!e)return yt.Center;switch(e){case"Left":case"left":return yt.Left;case"Right":case"right":return yt.Right;case"Justify":return kh().warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),yt.Center;case"Center":case"center":return yt.Center}}function zh(e){if(!e)return nt.Center;switch(e){case"Top":case"top":return nt.Top;case"Center":case"middle":return nt.Center;case"Baseline":case"baseline":return nt.Baseline;case"Bottom":case"bottom":return nt.Bottom}}function qc(e){switch(e){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return["right","bottom"];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return["center","bottom"];case"above-right":case"esriServerPointLabelPlacementAboveRight":return["left","bottom"];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return["right","middle"];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return["center","middle"];case"center-right":case"esriServerPointLabelPlacementCenterRight":return["left","middle"];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return["right","top"];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return["center","top"];case"below-right":case"esriServerPointLabelPlacementBelowRight":return["left","top"];default:return console.debug(`Found invalid placement type ${e}`),["center","middle"]}}function Kc(e){switch(e){case yt.Right:case"right":return-1;case yt.Center:case"center":return 0;case yt.Left:case"left":return 1;default:return console.debug(`Found invalid horizontal alignment ${e}`),0}}function jc(e){switch(e){case nt.Top:case"top":return 1;case nt.Center:case"middle":return 0;case nt.Bottom:case nt.Baseline:case"baseline":case"bottom":return-1;default:return console.debug(`Found invalid vertical alignment ${e}`),0}}(function(e){e[e.Left=-1]="Left",e[e.Center=0]="Center",e[e.Right=1]="Right"})(yt||(yt={})),function(e){e[e.Top=1]="Top",e[e.Center=0]="Center",e[e.Bottom=-1]="Bottom",e[e.Baseline=2]="Baseline"}(nt||(nt={}));const dr=22,Wn=4,Lh=dr+Wn,Ah=dr-6,Ur=3,Oh=Math.PI/180,Ft=8,Eh=1.5;let qn=class{constructor(e,t,s,i){this._rotationT=rs(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=s.rect,r=new Float32Array(8);e*=i,t*=i;const o=s.code?n.width*i:s.metrics.width,a=s.code?n.height*i:s.metrics.height;this.width=o,this.height=a,r[0]=e,r[1]=t,r[2]=e+o,r[3]=t,r[4]=e,r[5]=t+a,r[6]=e+o,r[7]=t+a,this._data=r,this._setTextureCoords(n),this._scale=i,this._mosaic=s,this.x=e,this.y=t,this.maxOffset=Math.max(e+o,t+a)}get mosaic(){return this._mosaic}set angle(e){this._angle=e,yn(this._rotationT,-e),this._setOffsets()}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._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:e,width:t}=this._mosaic.metrics,s=t*this._scale,i=Math.abs(e)*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 r=Ti(rs(),this._rotationT,this._transform);Sa(n,n,r);let o=1/0,a=1/0,h=-1/0,l=-1/0;for(let f=0;f<4;f++){const m=n[2*f],_=n[2*f+1];o=Math.min(o,m),a=Math.min(a,_),h=Math.max(h,m),l=Math.max(l,_)}const c=h-o,u=l-a,p=o+c/2,d=a+u/2;this._bounds=new Ee(p,d,c,u)}return this._bounds}setTransform(e){this._transform=e,this._offsets=null}_setOffsets(){this._offsets||(this._offsets={topLeft:[0,0],topRight:[0,0],bottomLeft:[0,0],bottomRight:[0,0]});const e=Ti(rs(),this._rotationT,this._transform);this._offsets.topLeft[0]=this._data[0],this._offsets.topLeft[1]=this._data[1],this._offsets.topRight[0]=this._data[2],this._offsets.topRight[1]=this._data[3],this._offsets.bottomLeft[0]=this._data[4],this._offsets.bottomLeft[1]=this._data[5],this._offsets.bottomRight[0]=this._data[6],this._offsets.bottomRight[1]=this._data[7],ce(this._offsets.topLeft,this._offsets.topLeft,e),ce(this._offsets.topRight,this._offsets.topRight,e),ce(this._offsets.bottomLeft,this._offsets.bottomLeft,e),ce(this._offsets.bottomRight,this._offsets.bottomRight,e)}_setTextureCoords({x:e,y:t,width:s,height:i}){this._texcoords={topLeft:[e,t],topRight:[e+s,t],bottomLeft:[e,t+i],bottomRight:[e+s,t+i]}}};const Fh=(e,t)=>({code:0,page:0,sdf:!0,rect:new Ma(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:e,left:0,top:0}});function Te(e,t){return e.forEach(s=>ce(s,s,t)),{topLeft:e[0],topRight:e[1],bottomLeft:e[2],bottomRight:e[3]}}let Nh=class{constructor(e,t,s){this._rotation=0,this._decorate(e,t,s),this.glyphs=e,this.bounds=this._createBounds(e),this.isMultiline=t.length>1,this._hasRotation=s.angle!==0,this._transform=this._createGlyphTransform(this.bounds,s),this._borderLineSizePx=s.borderLineSizePx,(s.borderLineSizePx||s.hasBackground)&&([this.bounds,this.textBox]=this.shapeBackground(this._transform));for(const i of e)i.setTransform(this._transform)}setRotation(e){if(e===0&&this._rotation===0)return;this._rotation=e;const t=this._transform,s=yn(rs(),e);Ti(t,s,t);for(const i of this.glyphs)i.setTransform(this._transform)}_decorate(e,t,s){if(!s.decoration||s.decoration==="none"||!e.length)return;const i=s.scale,n=s.decoration==="underline"?Lh:Ah,r=e[0].textureBinding;for(const o of t){const a=o.startX*i,h=o.startY*i,l=(o.width+o.glyphWidthEnd)*i;e.push(new qn(a,h+n*i,Fh(l,r),1))}}shapeBackground(e){const t=this._borderLineSizePx||0,s=(Eh+t)/2,i=this._borderLineSizePx?s:0,{xmin:n,ymin:r,xmax:o,ymax:a,x:h,y:l,width:c,height:u}=this.bounds,p=[n-Ft,r-Ft],d=[o+Ft,r-Ft],f=[n-Ft,a+Ft],m=[o+Ft,a+Ft],_=Te([[p[0]-s,p[1]-s],[d[0]+s,d[1]-s],[p[0]+i,p[1]+i],[d[0]-i,d[1]+i]],e),y=Te([[f[0]+i,f[1]-i],[m[0]-i,m[1]-i],[f[0]-s,f[1]+s],[m[0]+s,m[1]+s]],e),b=Te([[p[0]-s,p[1]-s],[p[0]+i,p[1]+i],[f[0]-s,f[1]+s],[f[0]+i,f[1]-i]],e),P=Te([[d[0]-i,d[1]+i],[d[0]+s,d[1]-s],[m[0]-i,m[1]-i],[m[0]+s,m[1]+s]],e),w={main:Te([p,d,f,m],e),top:_,bot:y,left:b,right:P};return[new Ee(h,l,c+2*s,u+2*s),w]}get boundsT(){const e=this.bounds,t=Ss(Er(),e.x,e.y);if(ce(t,t,this._transform),this._hasRotation){const s=Math.max(e.width,e.height);return new Ee(t[0],t[1],s,s)}return new Ee(t[0],t[1],e.width,e.height)}_createBounds(e){let t=1/0,s=1/0,i=0,n=0;for(const a of e)t=Math.min(t,a.xTopLeft),s=Math.min(s,a.yTopLeft),i=Math.max(i,a.xBottomRight),n=Math.max(n,a.yBottomRight);const r=i-t,o=n-s;return new Ee(t+r/2,s+o/2,r,o)}_createGlyphTransform(e,t){const s=Oh*t.angle,i=rs(),n=Er();return Pi(i,i,Ss(n,t.xOffset,-t.yOffset)),t.useCIMAngleBehavior?Or(i,i,s):(Pi(i,i,Ss(n,e.x,e.y)),Or(i,i,s),Pi(i,i,Ss(n,-e.x,-e.y))),i}},Os=class{constructor(e,t,s,i,n,r){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(t,s)),this.end=Math.max(0,Math.max(t,s)),this.ende===10,Yr=e=>e===32;function $h(e,t,s){const i=new Array,n=1/s.scale,r=s.maxLineWidth*n,o=t?e.length-1:0,a=t?-1:e.length,h=t?-1:1;let l=o,c=0,u=0,p=l,d=p,f=0,m=1/0,_=0;for(;l!==a;){const{code:b,metrics:P}=e[l],w=Math.abs(P.top);if(Ei(b)||Yr(b)||(m=Math.min(m,w),_=Math.max(_,w+P.height)),Ei(b))l!==o&&(i.push(new Os(e,p,l-h,c,m===1/0?0:m,_)),m=1/0,_=0),c=0,p=l+h,d=l+h,u=0;else if(Yr(b))d=l+h,u=0,f=P.advance,c+=P.advance;else if(c>r){if(d!==p){const S=d-2*h;c-=f,i.push(new Os(e,p,S,c-u,m,_)),m=1/0,_=0,p=d,c=u}else i.push(new Os(e,p,l-h,c,m,_)),m=1/0,_=0,p=l,d=l,c=0;c+=P.advance,u+=P.advance}else c+=P.advance,u+=P.advance;l+=h}const y=new Os(e,p,l-h,c,m,_);return y.start>=0&&y.endge.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");let Xt=class dt{constructor(t){this._t=t}static createIdentity(){return new dt([1,0,0,0,1,0])}clone(){const t=this._t;return new dt(t.slice())}transform(t){const s=this._t;return[s[0]*t[0]+s[1]*t[1]+s[2],s[3]*t[0]+s[4]*t[1]+s[5]]}static createScale(t,s){return new dt([t,0,0,0,s,0])}scale(t,s){const i=this._t;return i[0]*=t,i[1]*=t,i[2]*=t,i[3]*=s,i[4]*=s,i[5]*=s,this}scaleRatio(){return Math.sqrt(this._t[0]*this._t[0]+this._t[1]*this._t[1])}static createTranslate(t,s){return new dt([0,0,t,0,0,s])}translate(t,s){const i=this._t;return i[2]+=t,i[5]+=s,this}static createRotate(t){const s=Math.cos(t),i=Math.sin(t);return new dt([s,-i,0,i,s,0])}rotate(t){return dt.multiply(this,dt.createRotate(t),this)}angle(){const t=this._t[0],s=this._t[3],i=Math.sqrt(t*t+s*s);return[t/i,s/i]}static multiply(t,s,i){const n=t._t,r=s._t,o=n[0]*r[0]+n[3]*r[1],a=n[1]*r[0]+n[4]*r[1],h=n[2]*r[0]+n[5]*r[1]+r[2],l=n[0]*r[3]+n[3]*r[4],c=n[1]*r[3]+n[4]*r[4],u=n[2]*r[3]+n[5]*r[4]+r[5],p=i._t;return p[0]=o,p[1]=a,p[2]=h,p[3]=l,p[4]=c,p[5]=u,i}invert(){const t=this._t;let s=t[0]*t[4]-t[1]*t[3];if(s===0)return new dt([0,0,0,0,0,0]);s=1/s;const i=(t[1]*t[5]-t[2]*t[4])*s,n=(t[2]*t[3]-t[0]*t[5])*s,r=t[4]*s,o=-t[1]*s,a=-t[3]*s,h=t[0]*s;return new dt([r,o,i,a,h,n])}};class fr{constructor(t,s){this._resourceManager=t,this._transfos=[],this._sizeTransfos=[],this._geomUnitsPerPoint=1,this._placementPool=new Uo(ye,void 0,void 0,100),this._earlyReturn=!1,this._mapRotation=0,this._transfos.push(s||Xt.createIdentity()),this._sizeTransfos.push(s?s.scaleRatio():1)}setTransform(t,s){this._transfos=[t||Xt.createIdentity()],this._sizeTransfos=[s||(t?t.scaleRatio():1)]}setGeomUnitsPerPoint(t){this._geomUnitsPerPoint=t}transformPt(t){return this._transfos[this._transfos.length-1].transform(t)}transformSize(t){return t*this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformPt(t){return this._transfos[this._transfos.length-1].invert().transform(t)}reverseTransformSize(t){return t/this._sizeTransfos[this._sizeTransfos.length-1]}reverseTransformScalar(t){return t/this._transfos[this._transfos.length-1].scaleRatio()}getTransformAngle(){return this._transfos[this._transfos.length-1].angle()}geomUnitsPerPoint(){return this.isEmbedded()?1:this._geomUnitsPerPoint}prevGeomUnitsPerPoint(){return this._transfos.length>2?1:this._geomUnitsPerPoint}isEmbedded(){return this._transfos.length>1}back(){return this._transfos[this._transfos.length-1]}push(t,s){const i=s?t.scaleRatio():1;Xt.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*i)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,s,i){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,s);break;case"CIMTextSymbol":this.drawTextSymbol(t,s,i)}}drawMultiLayerSymbol(t,s){if(!t||!s)return;const i=t.symbolLayers;if(!i)return;const n=t.effects;if(n&&n.length>0){const r=this.executeEffects(n,s);if(r){let o=r.next();for(;o;)this.drawSymbolLayers(i,o.asJSON()),o=r.next()}}else this.drawSymbolLayers(i,s)}executeEffects(t,s){const i=this._resourceManager.geometryEngine;let n=new Oa(N.fromJSONCIM(s));for(const r of t){const o=fh(r);o&&(n=o.execute(n,r,this.geomUnitsPerPoint(),null,i))}return n}drawSymbolLayers(t,s){let i=t.length;for(;i--;){const n=t[i];if(!n||n.enable===!1)continue;const r=n.effects;if(r&&r.length>0){const o=this.executeEffects(r,s);if(o){let a=null;for(;(a=o.next())&&(this.drawSymbolLayer(n,a.asJSON()),!this._earlyReturn););}}else this.drawSymbolLayer(n,s);if(this._earlyReturn)return}}drawSymbolLayer(t,s){switch(t.type){case"CIMSolidFill":this.drawSolidFill(s,t.color,t.path);break;case"CIMHatchFill":this.drawHatchFill(s,t);break;case"CIMPictureFill":this.drawPictureFill(s,t);break;case"CIMGradientFill":this.drawGradientFill(s,t);break;case"CIMSolidStroke":this.drawSolidStroke(s,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit,t.path);break;case"CIMPictureStroke":this.drawPictureStroke(s,t);break;case"CIMGradientStroke":this.drawGradientStroke(s,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,s)}}drawHatchFill(t,s){const i=Hh(s,t,this.geomUnitsPerPoint());i&&(this.pushClipPath(t),this.drawMultiLayerSymbol(s.lineSymbol,i),this.popClipPath())}drawPictureFill(t,s){}drawGradientFill(t,s){}drawPictureStroke(t,s){}drawGradientStroke(t,s){}drawMarkerLayer(t,s){const i=t.markerPlacement;if(i){const n=mh(i);if(n){const r=i.type==="CIMMarkerPlacementInsidePolygon"||i.type==="CIMMarkerPlacementPolygonCenter"&&i.clipAtBoundary;r&&this.pushClipPath(s);const o=n.execute(N.fromJSONCIM(s),i,this.geomUnitsPerPoint(),null,this._resourceManager.geometryEngine);if(o){let a=null;for(;(a=o.next())&&(this.drawMarker(t,a),!this._earlyReturn););}r&&this.popClipPath()}}else{const n=this._placementPool.acquire();if(ki(s))n.tx=s.x,n.ty=s.y,this.drawMarker(t,n);else if(rt(s)){const r=Yo(s);r&&([n.tx,n.ty]=r,this.drawMarker(t,n))}else for(const r of s.points)if(n.tx=r[0],n.ty=r[1],this.drawMarker(t,n),this._earlyReturn)break;this._placementPool.release(n)}}drawMarker(t,s){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,s);break;case"CIMVectorMarker":this.drawVectorMarker(t,s)}}drawPictureMarker(t,s){if(!t)return;const i=this._resourceManager.getResource(t.url),n=C(t.size,Tt.CIMPictureMarker.size);if(i==null||n<=0)return;const r=i.width,o=i.height;if(!r||!o)return;const a=r/o,h=C(t.scaleX,1),l=Xt.createIdentity(),c=t.anchorPoint;if(c){let _=c.x,y=c.y;t.anchorPointUnits!=="Absolute"&&(_*=n*a*h,y*=n),l.translate(-_,-y)}let u=C(t.rotation);t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*Wt);let p=C(t.offsetX),d=C(t.offsetY);if(p||d){if(this._mapRotation){const _=Wt*this._mapRotation,y=Math.cos(_),b=Math.sin(_),P=p*b+d*y;p=p*y-d*b,d=P}l.translate(p,d)}const f=this.geomUnitsPerPoint();f!==1&&l.scale(f,f);const m=s.getAngle();m&&l.rotate(m),l.translate(s.tx,s.ty),this.push(l,!1),this.drawImage(t,n),this.pop()}drawVectorMarker(t,s){if(!t)return;const i=t.markerGraphics;if(!i)return;const n=C(t.size,Tt.CIMVectorMarker.size),r=t.frame,o=r?r.ymax-r.ymin:0,a=n&&o?n/o:1,h=Xt.createIdentity();r&&h.translate(.5*-(r.xmax+r.xmin),.5*-(r.ymax+r.ymin));const l=t.anchorPoint;if(l){let m=l.x,_=l.y;t.anchorPointUnits!=="Absolute"?r&&(m*=r.xmax-r.xmin,_*=r.ymax-r.ymin):(m/=a,_/=a),h.translate(-m,-_)}a!==1&&h.scale(a,a);let c=C(t.rotation);t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&h.rotate(c*Wt);let u=C(t.offsetX),p=C(t.offsetY);if(u||p){if(this._mapRotation){const m=Wt*this._mapRotation,_=Math.cos(m),y=Math.sin(m),b=u*y+p*_;u=u*_-p*y,p=b}h.translate(u,p)}const d=this.geomUnitsPerPoint();d!==1&&h.scale(d,d);const f=s.getAngle();f&&h.rotate(f),h.translate(s.tx,s.ty),this.push(h,t.scaleSymbolsProportionally);for(const m of i){m?.symbol&&m.geometry||Dh().error("Invalid marker graphic",m);let _=m.textString;if(typeof _=="number"&&(_=_.toString()),this.drawSymbol(m.symbol,m.geometry,_),this._earlyReturn)break}this.pop()}drawTextSymbol(t,s,i){if(!t||!ki(s)||C(t.height,Tt.CIMTextSymbol.height)<=0)return;const n=Xt.createIdentity();let r=C(t.angle);r=-r,r&&n.rotate(r*Wt);const o=C(t.offsetX),a=C(t.offsetY);(o||a)&&n.translate(o,a);const h=this.geomUnitsPerPoint();h!==1&&n.scale(h,h),n.translate(s.x,s.y),this.push(n,!1),this.drawText(t,i),this.pop()}}let Gh=class extends fr{constructor(e,t){super(e,t),this.reset()}reset(){this._xmin=this._ymin=1/0,this._xmax=this._ymax=-1/0,this._clipCount=0}envelope(){return new vh(this._xmin,this._ymin,this._xmax-this._xmin,this._ymax-this._ymin)}bounds(){return Ho(this._xmin,this._ymin,this._xmax,this._ymax)}drawSolidFill(e){if(e&&!(this._clipCount>0))if(rt(e))this._processPath(e.rings,0);else if(gt(e))this._processPath(e.paths,0);else if(ht(e)){const t=qt(e);t&&this._processPath(t.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(e,t,s){if(!e||this._clipCount>0||s==null||s<=0)return;const i=Math.max(.5*this.transformSize(C(s,Tt.CIMSolidStroke.width)),.5*Zn);if(rt(e))this._processPath(e.rings,i);else if(gt(e))this._processPath(e.paths,i);else if(ht(e)){const n=qt(e);n&&this._processPath(n.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(e,t){rt(t)&&e.markerPlacement&&(e.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||e.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&e.markerPlacement.clipAtBoundary)?this._processPath(t.rings,0):super.drawMarkerLayer(e,t)}drawHatchFill(e,t){this.drawSolidFill(e)}drawPictureFill(e,t){this.drawSolidFill(e)}drawGradientFill(e,t){this.drawSolidFill(e)}drawPictureStroke(e,t){this.drawSolidStroke(e,null,t.width)}drawGradientStroke(e,t){this.drawSolidStroke(e,null,t.width)}pushClipPath(e){this.drawSolidFill(e),this._clipCount++}popClipPath(){this._clipCount--}drawImage(e,t){const{url:s}=e,i=C(e.scaleX,1);let n=i*t,r=t;const o=this._resourceManager.getResource(s);if(o!=null){const a=o.height/o.width;n=i*(t?a>1?t:t/a:o.width),r=t?a>1?t*a:t:o.height}this._merge(this.transformPt([-n/2,-r/2]),0),this._merge(this.transformPt([-n/2,r/2]),0),this._merge(this.transformPt([n/2,-r/2]),0),this._merge(this.transformPt([n/2,r/2]),0)}drawText(e,t){if(!t||t.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const s=to(e);let[i,n]=this._textRasterizer.computeTextSize(t,s);i=bt(i),n=bt(n);const r=this.transformSize(1)*this.reverseTransformScalar(1);i*=r,n*=r;let o=0;switch(e.horizontalAlignment){case"Left":o=i/2;break;case"Right":o=-i/2}let a=0;switch(e.verticalAlignment){case"Bottom":a=n/2;break;case"Top":a=-n/2;break;case"Baseline":a=n/6}this._merge(this.transformPt([-i/2+o,-n/2+a]),0),this._merge(this.transformPt([-i/2+o,n/2+a]),0),this._merge(this.transformPt([i/2+o,-n/2+a]),0),this._merge(this.transformPt([i/2+o,n/2+a]),0)}_processPath(e,t){if(e)for(const s of e){const i=s?s.length:0;if(i>1){this._merge(this.transformPt(s[0]),t);for(let n=1;nthis._xmax&&(this._xmax=e[0]+t),e[1]-tthis._ymax&&(this._ymax=e[1]+t)}},Qc=class extends fr{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0,this._textInfo=null,this._svg=null,this._path=null,this._canvas=null}destroy(){this._svg=Ih(this._svg),this._path=null,this._canvas=null}hitTest(e,t,s,i,n,r){const o=r*fe(1);this.setTransform(),this.setGeomUnitsPerPoint(o),this._searchPoint=[(e[0]+e[2])/2,(e[1]+e[3])/2],this._searchDistPoint=(e[2]-e[0])/2/o,this._textInfo=i;const a=t&&(t.type==="CIMPointSymbol"&&t.angleAlignment!=="Map"||t.type==="CIMTextSymbol");if(this._mapRotation=a?n:0,!li("esri-mobile")){const h=bt(xa*window.devicePixelRatio),l=bt(ba);!((t?.type==="CIMLineSymbol"||t?.type==="CIMPolygonSymbol")&&t.symbolLayers?.some(ca))&&t?.type!=="CIMMeshSymbol"&&(ua(t)??0)d.xTopLeft&&u-d.yBottomRight&&p<-d.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(e){let t=null;if(ht(e)){const i=e;t=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))t=e.rings;else{if(!gt(e))return;t=e.paths}const s=this.reverseTransformPt(this._searchPoint);Bh(s,t)&&(this._earlyReturn=!0),!this._earlyReturn&&Wr(s,t,this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}_getSvgPath(){return this._svg!=null&&this._path!=null||(this._svg??=Ch(),this._path??=Yn("path"),this._svg.appendChild(this._path)),this._path}_getCanvas(){return this._canvas??=document.createElement("canvas"),this._canvas}_hittestSvgPath(e,t,s,i){const n=Qt();lr(n,e);const r={x:n[0],y:n[1],width:n[2]-n[0],height:n[3]-n[1]},o=this._getSvgPath();o.setAttribute("d",t);const a=o.getBBox(),h=a.width/r.width,l=a.height/r.height,c=this._getCanvas();c.width=a.width,c.height=a.height;const u=c.getContext("2d",{willReadFrequently:!0});u.setTransform(1,0,0,1,a.x,-a.y);const p=new Path2D(t);s?u.fill(p):(u.lineWidth=i*h,u.stroke(p));const d=this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint(),f=this.reverseTransformPt(this._searchPoint),m=(f[0]-r.x-d)*h,_=(r.height-(f[1]-r.y)-d)*l,y=2*d*h,b=2*d*l,P=u.getImageData(m,_,y,b).data;for(let w=3;w127.5)return void(this._earlyReturn=!0)}_hitTestStroke(e,t){let s=null;if(ht(e)){const i=e;s=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(rt(e))s=e.rings;else{if(!gt(e))return;s=e.paths}Wr(this.reverseTransformPt(this._searchPoint),s,C(t,Tt.CIMSolidStroke.width)*this.geomUnitsPerPoint()/2+this.reverseTransformScalar(this._searchDistPoint)*this.prevGeomUnitsPerPoint())&&(this._earlyReturn=!0)}};class Vh extends fr{constructor(t,s,i,n){super(s,i),this._applyAdditionalRenderProps=n,this._colorSubstitutionHelper=new wh,this._ctx=t}drawSolidFill(t,s){if(!t)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawSolidFill - No implementation!")}const i=this._ctx;i.fillStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",i.fill("evenodd")}drawSolidStroke(t,s,i,n,r,o){if(!t||!s||i===0)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!1);else{if(!ht(t))return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");this._buildPath(qt(t).rings,!0)}const a=this._ctx;a.strokeStyle=typeof s=="string"?s:"rgba("+Math.round(s[0])+","+Math.round(s[1])+","+Math.round(s[2])+","+(s[3]??255)/255+")",a.lineWidth=Math.max(this.transformSize(i),Zn),this._setCapStyle(n),this._setJoinStyle(r),a.miterLimit=o,a.stroke()}pushClipPath(t){if(this._ctx.save(),rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else{if(!ht(t))return;this._buildPath(qt(t).rings,!0)}this._ctx.clip("evenodd")}popClipPath(){this._ctx.restore()}drawImage(t,s){const{colorSubstitutions:i,url:n,tintColor:r}=t,o=C(t.scaleX,1),a=this._resourceManager.getResource(n);if(a==null)return;let h=s*(a.width/a.height),l=s;s||(h=a.width,l=a.height);const c=se(n)||"src"in a&&se(a.src);let u="getFrame"in a?Ci(a):a;i&&(u=this._colorSubstitutionHelper.applyColorSubstitution(u,i)),this._applyAdditionalRenderProps&&!c&&r&&(u=this._colorSubstitutionHelper.tintImageData(u,r));const p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=this.transformSize(1),_=this._ctx;_.save(),_.setTransform({m11:o*m*d,m12:o*m*f,m21:-m*f,m22:m*d,m41:p[0],m42:p[1]}),_.drawImage(u,-h/2,-l/2,h,l),_.restore()}drawText(t,s){if(!s||s.length===0)return;this._textRasterizer||(this._textRasterizer=new Un);const i=to(t,this.transformSize(bt(1))),n=this._textRasterizer.rasterizeText(s,i);if(!n)return;const{size:r,anchorX:o,anchorY:a,canvas:h}=n,l=r[0]*(o+.5),c=r[1]*(a-.5),u=this._ctx,p=this.transformPt([0,0]),[d,f]=this.getTransformAngle(),m=1;u.save(),u.setTransform({m11:m*d,m12:m*f,m21:-m*f,m22:m*d,m41:p[0]-m*l,m42:p[1]+m*c}),u.drawImage(h,0,0),u.restore()}drawPictureFill(t,s){if(!t)return;let{colorSubstitutions:i,height:n,offsetX:r,offsetY:o,rotation:a,scaleX:h,tintColor:l,url:c}=s;const u=this._resourceManager.getResource(c);if(u==null)return;if(rt(t))this._buildPath(t.rings,!0);else if(gt(t))this._buildPath(t.paths,!0);else if(ht(t))this._buildPath(qt(t).rings,!0);else{if(!Ds(t))return;console.log("CanvasDrawHelper.drawPictureFill - No implementation!")}const p=this._ctx,d=se(c)||"src"in u&&se(u.src);let f,m="getFrame"in u?Ci(u):u;if(i&&(m=this._colorSubstitutionHelper.applyColorSubstitution(m,i)),this._applyAdditionalRenderProps){d||l&&(m=this._colorSubstitutionHelper.tintImageData(m,l)),f=p.createPattern(m,"repeat");const _=this.transformSize(1);a||(a=0),r?r*=_:r=0,o?o*=_:o=0,n&&(n*=_);const y=n?n/u.height:1,b=h&&n?h*n/u.width:1;if(a!==0||y!==1||b!==1||r!==0||o!==0){const P=new DOMMatrix;P.rotateSelf(0,0,-a).translateSelf(r,o).scaleSelf(b,y,1),f.setTransform(P)}}else f=p.createPattern(m,"repeat");p.save(),p.fillStyle=f,p.fill("evenodd"),p.restore()}drawPictureStroke(t,s){if(!t)return;let{colorSubstitutions:i,capStyle:n,joinStyle:r,miterLimit:o,tintColor:a,url:h,width:l}=s;const c=this._resourceManager.getResource(h);if(c==null)return;let u;if(rt(t))u=t.rings;else if(gt(t))u=t.paths;else{if(!ht(t))return Ds(t)?void console.log("CanvasDrawHelper.drawPictureStroke - No implementation!"):void 0;u=qt(t).rings}l||(l=c.width);const p=se(h)||"src"in c&&se(c.src);let d="getFrame"in c?Ci(c):c;i&&(d=this._colorSubstitutionHelper.applyColorSubstitution(d,i)),this._applyAdditionalRenderProps&&(p||a&&(d=this._colorSubstitutionHelper.tintImageData(d,a)));const f=Math.max(this.transformSize(fe(l)),.5),m=f/d.width,_=this._ctx,y=_.createPattern(d,"repeat-y");let b,P;_.save(),this._setCapStyle(n),this._setJoinStyle(r),o!==void 0&&(_.miterLimit=o),_.lineWidth=f;for(let w of u)if(w=pe(w),Yh(w),w&&!(w.length<=1)){b=this.transformPt(w[0]);for(let S=1;S1){let o=this.transformPt(n[0]);i.moveTo(o[0],o[1]);for(let a=1;ao;)r-=i;for(;r<-o;)r+=i;const a=Qt();lr(a,t),a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o;const h=[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]]];for(;n>180;)n-=180;for(;n<0;)n+=180;const l=Math.cos(n*Wt),c=Math.sin(n*Wt),u=-i*c,p=i*l;let d,f,m,_;r=C(e.offsetX)*s*c-C(e.offsetY)*s*l,d=m=Number.MAX_VALUE,f=_=-Number.MAX_VALUE;for(const V of h){const U=V[0],z=V[1],O=l*U+c*z,ot=-c*U+l*z;d=Math.min(d,O),m=Math.min(m,ot),f=Math.max(f,O),_=Math.max(_,ot)}m=Math.floor(m/i)*i;let y=l*d-c*m-u*r/i,b=c*d+l*m-p*r/i,P=l*f-c*m-u*r/i,w=c*f+l*m-p*r/i;const S=1+Math.round((_-m)/i),L=[];for(let V=0;Ve[1]!=a[1]>e[1]&&((a[0]-o[0])*(e[1]-o[1])-(a[1]-o[1])*(e[0]-o[0])>0?s++:s--)}}return s!==0}function Wr(e,t,s){for(const i of t){const n=i.length;for(let r=1;r-s&&ce?{spatialReference:e.spatialReference,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:null,Qn=(e,t,s)=>{switch(e){case"ExtraLeading":return 1+t/s;case"Multiple":return t;case"Exact":return t/s}};function to(e,t=1){const s=fn(e),i=dn(e.fontStyleName),n=e.fontFamilyName??pr,{weight:r,style:o}=i,a=t*(e.height||5),h=pa(e.horizontalAlignment),l=da(e.verticalAlignment),c=bi(e),u=bi(e.haloSymbol),p=u!=null?t*(e.haloSize??0):0,d=Lr(e.symbol),f=t*(Ar(e.symbol)||0),m=e.callout?.type==="CIMBackgroundCallout"?e.callout.backgroundSymbol:null,_=bi(m),y=Ar(m),b=Lr(m);return{color:c,size:a,horizontalAlignment:h,verticalAlignment:l,font:{family:n,style:fa(o),weight:ma(r),decoration:s},outline:{size:f||0,color:d},halo:{size:p||0,color:u,style:o},backgroundColor:_,borderLine:y!=null&&b!=null?{size:y,color:b}:null,pixelRatio:1,premultiplyColors:!0}}const Uh=1e-4;function Yh(e){let t,s,i,n,r,o=e[0],a=1;for(;age.getLogger("esri.symbols.cim.CIMSymbolHelper");function tu(e){let t;switch(e.type){case"cim":return e.data;case"web-style":return e;case"simple-marker":{const s=re.fromSimpleMarker(e);if(!s)throw new Error("InternalError: Cannot convert symbol to CIM");t=s;break}case"picture-marker":t=re.fromPictureMarker(e);break;case"simple-line":t=re.fromSimpleLineSymbol(e);break;case"simple-fill":t=re.fromSimpleFillSymbol(e);break;case"picture-fill":t=re.fromPictureFillSymbol(e);break;case"text":t=re.fromTextSymbol(e)}return{type:"CIMSymbolReference",symbol:t}}function Hs(e,t,s){switch(t.type){case"CIMSymbolReference":return Hs(e,t.symbol,s);case"CIMPointSymbol":s==null&&(s={x:0,y:0}),e.drawSymbol(t,s);break;case"CIMLineSymbol":s==null&&(s={paths:[[[0,0],[10,0]]]}),e.drawSymbol(t,s);break;case"CIMPolygonSymbol":s==null&&(s={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),e.drawSymbol(t,s);break;case"CIMTextSymbol":{const i={x:0,y:0};e.drawSymbol(t,i);break}case"CIMVectorMarker":{const i=new ye;e.drawMarker(t,i);break}}return e.envelope()}function Kh(e){if(!e)return 0;switch(e.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(e.offset);default:return 0}}function jh(e){if(!e)return 0;switch(e.type){case"CIMGeometricEffectArrow":return Math.abs(.5*e.width);case"CIMGeometricEffectBuffer":return Math.abs(e.size);case"CIMGeometricEffectControlMeasureLine":return 500;case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(e.length);case"CIMGeometricEffectJog":return Math.abs(.5*e.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(C(e.offsetX)),Math.abs(C(e.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(e.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(e.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(e.fromWidth),Math.abs(e.toWidth));case"CIMGeometricEffectWave":return Math.abs(e.amplitude);case"CIMGeometricEffectDonut":return Math.abs(e.width)}}function jr(e){if(!e)return 0;let t=0;for(const s of e)t+=jh(s);return t}let eu=class{static getSymbolInflateSize(e,t,s,i,n){return e||(e=[0,0,0,0]),t?this._getInflateSize(e,t,s,i,n):e}static safeSize(e){const t=Math.max(Math.abs(e[0]),Math.abs(e[2])),s=Math.max(Math.abs(e[1]),Math.abs(e[3]));return Math.sqrt(t*t+s*s)}static _vectorMarkerBounds(e,t,s,i){let n=!0;const r=Qt();if(t?.markerGraphics)for(const o of t.markerGraphics){const a=[0,0,0,0];o.geometry&&(lr(r,o.geometry),a[0]=0,a[1]=0,a[2]=0,a[3]=0,this.getSymbolInflateSize(a,o.symbol,s,0,i),r[0]+=a[0],r[1]+=a[1],r[2]+=a[2],r[3]+=a[3],n?(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],n=!1):(e[0]=Math.min(e[0],r[0]),e[1]=Math.min(e[1],r[1]),e[2]=Math.max(e[2],r[2]),e[3]=Math.max(e[3],r[3])))}return e}static _getInflateSize(e,t,s,i,n){if(sl(t)){const r=this._getLayersInflateSize(e,t.symbolLayers,s,i,n),o=jr(t.effects);return o>0&&(r[0]-=o,r[1]-=o,r[2]+=o,r[3]+=o),r}return this._getTextInflatedSize(e,t,n)}static _getLayersInflateSize(e,t,s,i,n){let r=!0;if(!t)return e;for(const o of t){if(!o)continue;let a=[0,0,0,0];switch(o.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const l=o;let c=l.width;c!=null&&(l.capStyle===lt.Square||l.joinStyle===kt.Miter?c/=qh:c/=2,a[0]=-c,a[1]=-c,a[2]=c,a[3]=c);break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const l=o;if(o.type==="CIMVectorMarker"){const f=o;if(a=this._vectorMarkerBounds(a,f,s,n),f.frame){const m=(f.frame.xmin+f.frame.xmax)/2,_=(f.frame.ymin+f.frame.ymax)/2;if(a[0]-=m,a[1]-=_,a[2]-=m,a[3]-=_,f.size!=null){const y=f.size/(f.frame.ymax-f.frame.ymin);a[0]*=y,a[1]*=y,a[2]*=y,a[3]*=y}}}else if(o.type==="CIMPictureMarker"){const f=o,m=s.getResource(f.url);let _=1;if(m!=null&&m.height&&(_=m.width/m.height),l.size!=null){const y=l.size/2,b=l.size*_*f.scaleX/2;a=[-b,-y,b,y]}}else if(l.size!=null){const f=l.size/2;a=[-f,-f,f,f]}if(l.anchorPoint){let f,m;l.anchorPointUnits==="Absolute"?(f=l.anchorPoint.x,m=l.anchorPoint.y):(f=l.anchorPoint.x*(a[2]-a[0]),m=l.anchorPoint.y*(a[3]-a[1]));const _=1.25*Math.sqrt(f*f+m*m);a[0]-=_,a[1]-=_,a[2]+=_,a[3]+=_}let c=C(l.rotation);if(l.rotateClockwise&&(c=-c),i&&(c-=i),c){const f=qr*c,m=Math.cos(f),_=Math.sin(f),y=Qt([bs,bs,-bs,-bs]);xs(y,[a[0]*m-a[1]*_,a[0]*_+a[1]*m]),xs(y,[a[0]*m-a[3]*_,a[0]*_+a[3]*m]),xs(y,[a[2]*m-a[1]*_,a[2]*_+a[1]*m]),xs(y,[a[2]*m-a[3]*_,a[2]*_+a[3]*m]),a=y}let u=C(l.offsetX),p=C(l.offsetY);if(i){const f=qr*i,m=Math.cos(f),_=Math.sin(f),y=u*_+p*m;u=u*m-p*_,p=y}a[0]+=u,a[1]+=p,a[2]+=u,a[3]+=p;const d=Kh(l.markerPlacement);d>0&&(a[0]-=d,a[1]-=d,a[2]+=d,a[3]+=d);break}}const h=jr(o.effects);h>0&&(a[0]-=h,a[1]-=h,a[2]+=h,a[3]+=h),r?(e[0]=a[0],e[1]=a[1],e[2]=a[2],e[3]=a[3],r=!1):(e[0]=Math.min(e[0],a[0]),e[1]=Math.min(e[1],a[1]),e[2]=Math.max(e[2],a[2]),e[3]=Math.max(e[3],a[3]))}return e}static _getTextInflatedSize(e,t,s){const i=jn(t.height??Tt.CIMTextSymbol.height);if(e[0]=-i/2,e[1]=-i/2,e[2]=i/2,e[3]=i/2,!s)return e;const n=s.get(t);if(!n||!n.glyphMosaicItems.glyphs.length)return e;const{lineGapType:r,lineGap:o}=t,a=r?Qn(r,o??0,i):0,h=t.callout?.type==="CIMBackgroundCallout",l=Kn(n.glyphMosaicItems,{scale:i/_n,angle:C(t.angle),xOffset:C(t.offsetX),yOffset:C(t.offsetY),horizontalAlignment:t.horizontalAlignment,verticalAlignment:t.verticalAlignment,maxLineWidth:Jn(t.lineWidth),lineHeight:gn*Math.max(.25,Math.min(a||1,4)),decoration:t.font.decoration||"none",useCIMAngleBehavior:!0,hasBackground:h}).boundsT,c=Math.sqrt(l.width*l.width+l.height*l.height);return e[0]-=l.x+c,e[1]-=l.y-c,e[2]+=l.x+c,e[3]+=-l.y+c,e}},re=class Bs{static getEnvelope(t,s,i){if(!t)return null;const n=new Gh(i);if(Array.isArray(t)){let r;for(const o of t)r?r.union(Hs(n,o,s)):r=Hs(n,o,s);return r}return Hs(n,t,s)}static getTextureAnchor(t,s){const i=this.getEnvelope(t,null,s);if(!i)return[0,0,0];const n=(i.x+.5*i.width)*ie,r=(i.y+.5*i.height)*ie,o=i.width*ie+2,a=i.height*ie+2;return[-n/o,-r/a,a]}static rasterize(t,s,i,n,r=!0,o){const a=i||this.getEnvelope(s,null,n);if(!a)return[null,0,0,0,0];const h=Math.max(a.width,a.height)*ie;let l=o!=null?Math.max(o/h,1):1;l*=ie;const c=(a.x+.5*a.width)*l,u=(a.y+.5*a.height)*l;t.width=a.width*l,t.height=a.height*l,i||(t.width+=2,t.height+=2);const p=t.getContext("2d",{willReadFrequently:!0}),d=Xt.createScale(l,-l);d.translate(.5*t.width-c,.5*t.height+u);const f=new Vh(p,n,d);switch(s.type){case"CIMPointSymbol":{const y={type:"point",x:0,y:0};f.drawSymbol(s,y);break}case"CIMVectorMarker":{const y=new ye;f.drawMarker(s,y);break}}const m=p.getImageData(0,0,t.width,t.height),_=new Uint8Array(m.data);if(r){let y;for(let b=0;b<_.length;b+=4)y=_[b+3]/255,_[b]=_[b]*y,_[b+1]=_[b+1]*y,_[b+2]=_[b+2]*y}return[_,t.width,t.height,-c/t.width,-u/t.height]}static fromTextSymbol(t){const{text:s}=t;return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPointUnits:"Relative",dominantSizeAxis3D:"Y",size:10,billboardMode3D:"FaceNearPlane",frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{x:0,y:0},symbol:Bs.createCIMTextSymbolfromTextSymbol(t),textString:s}],scaleSymbolsProportionally:!0,respectFrame:!0}],scaleX:1,angleAlignment:"Display"}}static fromPictureFillSymbol(t){const{height:s,outline:i,width:n,xoffset:r,xscale:o,yoffset:a,yscale:h}=t,l=[],c={type:"CIMPolygonSymbol",symbolLayers:l};if(i){const m=Jr(i);m&&l.push(m)}let u=t.url;t.type==="esriPFS"&&t.imageData&&(u=t.imageData);const p="angle"in t?t.angle??0:0,d=(n??0)*(o||1),f=(s??0)*(h||1);return l.push({type:"CIMPictureFill",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:u,height:f,width:d,offsetX:C(r),offsetY:C(a),rotation:C(-p),colorSubstitutions:null}),c}static fromSimpleFillSymbol(t){const{color:s,style:i,outline:n}=t,r=[],o={type:"CIMPolygonSymbol",symbolLayers:r};if(n){const a=Jr(n);a&&r.push(a)}if(i&&i!=="solid"&&i!=="none"&&i!=="esriSFSSolid"&&i!=="esriSFSNull"){const a={type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",color:Q(s),capStyle:lt.Butt,joinStyle:kt.Miter,width:.75}]};let h=0;const l=bt(il(i)?8:10);switch(i){case"vertical":case"esriSFSVertical":h=90;break;case"forward-diagonal":case"esriSFSForwardDiagonal":case"diagonal-cross":case"esriSFSDiagonalCross":h=-45;break;case"backward-diagonal":case"esriSFSBackwardDiagonal":h=45;break;case"cross":case"esriSFSCross":h=0}r.push({type:"CIMHatchFill",lineSymbol:a,offsetX:0,offsetY:0,rotation:h,separation:l}),i==="cross"||i==="esriSFSCross"?r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:90,separation:l}):i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"||r.push({type:"CIMHatchFill",lineSymbol:pe(a),offsetX:0,offsetY:0,rotation:45,separation:l})}else!i||i!=="solid"&&i!=="esriSFSSolid"||r.push({type:"CIMSolidFill",enable:!0,color:Q(s)});return o}static fromSimpleLineSymbol(t){const{cap:s,color:i,join:n,marker:r,miterLimit:o,style:a,width:h}=t;let l=null;a!=="solid"&&a!=="none"&&a!=="esriSLSSolid"&&a!=="esriSLSNull"&&(l=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(a,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]);const c=[];if(r){let u;switch(r.placement){case"begin-end":u=Rt.Both;break;case"begin":u=Rt.JustBegin;break;case"end":u=Rt.JustEnd;break;default:u=Rt.None}const p=Bs.fromSimpleMarker(r,h,i).symbolLayers[0];p.markerPlacement={type:"CIMMarkerPlacementAtExtremities",placePerPart:!1,angleToLine:!0,offset:0,extremityPlacement:u,offsetAlongLine:0},c.push(p)}return c.push({type:"CIMSolidStroke",color:a!=="none"&&a!=="esriSLSNull"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:o,width:h,effects:l}),{type:"CIMLineSymbol",symbolLayers:c}}static fromPictureMarker(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t;let a=t.url;return t.type==="esriPMS"&&t.imageData&&(a=t.imageData),{type:"CIMPointSymbol",symbolLayers:[{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}]}}static createCIMTextSymbolfromTextSymbol(t){const{angle:s,color:i,font:n,haloColor:r,haloSize:o,horizontalAlignment:a,kerning:h,lineWidth:l,text:c,verticalAlignment:u,xoffset:p,yoffset:d,backgroundColor:f,borderLineColor:m,borderLineSize:_}=t;let y,b,P,w,S,L;n&&(y=n.family,b=n.style,P=n.weight,w=n.size,S=n.decoration);let V=!1;return c&&(V=_h(c)[1]),(f||_)&&(L={type:"CIMBackgroundCallout",margin:null,backgroundSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",color:Q(f)},{type:"CIMSolidStroke",color:Q(m),width:_}]},accentBarSymbol:null,gap:null,leaderLineSymbol:null,lineStyle:null}),{type:"CIMTextSymbol",angle:s,blockProgression:ia.BTT,depth3D:1,extrapolateBaselines:!0,fontEffects:ra.Normal,fontEncoding:na.Unicode,fontFamilyName:y||"Arial",fontStyleName:Qh(b,P),fontType:oa.Unspecified,haloSize:o,height:w,hinting:aa.Default,horizontalAlignment:Jh(a??"center"),kerning:h,letterWidth:100,ligatures:!0,lineGapType:"Multiple",lineWidth:l,offsetX:C(p),offsetY:C(d),strikethrough:S==="line-through",underline:S==="underline",symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(i)}]},haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:Q(r)}]},shadowColor:[0,0,0,255],shadowOffsetX:1,shadowOffsetY:1,textCase:"Normal",textDirection:V?zr.RTL:zr.LTR,verticalAlignment:Zh(u??"baseline"),verticalGlyphOrientation:ha.Right,wordSpacing:100,billboardMode3D:la.FaceNearPlane,callout:L}}static createPictureMarkerRasterizationParam(t){const{angle:s,height:i,width:n,xoffset:r,yoffset:o}=t,a=t.url??t.source?.url??t.source?.imageData;return a?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureMarker",invertBackfaceTexture:!1,scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:a,size:i,width:n,offsetX:C(r),offsetY:C(o),rotation:C(-s)}}:null}static createPictureFillRasterizationParam(t){const{width:s,height:i,xoffset:n,yoffset:r,url:o}=t;return o?{type:"sprite-rasterization-param",overrides:[],resource:{type:"CIMPictureFill",scaleX:1,textureFilter:Ps.Picture,tintColor:null,url:o,width:s,height:i,offsetX:C(n),offsetY:C(r),rotation:0}}:null}static fromSimpleMarker(t,s,i){const{style:n}=t,r=t.color??i;if(n==="path"||n==="esriSMSPath"){const u=[];if("outline"in t&&t.outline){const f=t.outline;u.push({type:"CIMSolidStroke",enable:!0,width:f.width,color:Q(f.color),path:t.path})}u.push({type:"CIMSolidFill",enable:!0,color:Q(r),path:t.path});const[p,d]=ze("square");return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:-C(t.angle),size:C(t.size||6),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:p,markerGraphics:[{type:"CIMMarkerGraphic",geometry:d,symbol:{type:"CIMPolygonSymbol",symbolLayers:u}}]}]}}const o=[];let a,h,l=t.size;if("outline"in t&&t.outline&&t.outline.style!=="none"&&t.outline.style!=="esriSLSNull"){const u=t.outline,p=u.style!=="solid"&&u.style!=="esriSLSSolid";[a,h]=p?ze(n,t.size):ze(n);const d=u.width??Ro.width;if(p){const _=d/t.size,y=(a.xmax-a.xmin)*_/2,b=(a.ymax-a.ymin)*_/2;a.xmin-=y,a.xmax+=y,a.ymin-=b,a.ymax+=b,l&&(l+=d)}const f=t.style!=="cross"&&t.style!=="x"||t?.outline.style==="dot"||t?.outline.style==="short-dot"?W.HalfGap:W.FullPattern,m=p?[{type:"CIMGeometricEffectAddControlPoints"},{type:"CIMGeometricEffectDashes",dashTemplate:Fi(u.style,null).map(_=>u.width&&u.width>0?_*u.width:_),lineDashEnding:f,controlPointEnding:W.FullPattern}]:void 0;o.push({type:"CIMSolidStroke",capStyle:p?lt.Round:lt.Butt,enable:!0,width:d,color:Q(u.color),effects:m})}else!s||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"?[a,h]=ze(n):([a,h]=ze(n),o.push({type:"CIMSolidStroke",enable:!0,width:s,color:Q(r)}));o.push({type:"CIMSolidFill",enable:!0,color:Q(r)});const c={type:"CIMPolygonSymbol",symbolLayers:o};return{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:C(-t.angle),size:C(l||6*s),offsetX:C(t.xoffset),offsetY:C(t.yoffset),scaleSymbolsProportionally:!1,frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:h,symbol:c}]}]}}static fromCIMHatchFill(t,s){const i=s*(t.separation??Tt.CIMHatchFill.separation),n=i/2,r=pe(t.lineSymbol);r.symbolLayers?.forEach(h=>{switch(h.type){case"CIMSolidStroke":h.width!=null&&(h.width*=s),h.effects?.forEach(l=>{if(l.type==="CIMGeometricEffectDashes"){const c=l.dashTemplate;l.dashTemplate=c?.map(u=>u*s)}});break;case"CIMVectorMarker":{h.size!=null&&(h.size*=s);const l=h.markerPlacement;l!=null&&"placementTemplate"in l&&(l.placementTemplate=l.placementTemplate.map(c=>c*s));break}}});let o=this._getLineSymbolPeriod(r)||Kr;for(;o{rl(r,s,i),"url"in r&&r.url&&i.push(s.fetchResource(r.url,{signal:n}))}),i}static fetchFonts(t,s,i){if(t&&s){if("symbolLayers"in t&&t.symbolLayers){for(const n of t.symbolLayers)if(n.type==="CIMVectorMarker"&&n.markerGraphics)for(const r of n.markerGraphics)r?.symbol&&Bs.fetchFonts(r.symbol,s,i)}else if(t.type==="CIMTextSymbol"){const{fontFamilyName:n,fontStyleName:r}=t;if(!n||n.toLowerCase()==="calcitewebcoreicons")return;const{style:o,weight:a}=dn(r),h=fn(t),l=new Do({family:n,style:o,weight:a,decoration:h});i.push(s.loadFont(l).catch(()=>{ri().error(`Unsupported font ${n} in CIM symbol`)}))}}}static _getLineSymbolPeriod(t){if(t){const s=this._getEffectsRepeat(t.effects);if(s)return s;if(t.symbolLayers){for(const i of t.symbolLayers)if(i){const n=this._getEffectsRepeat(i.effects);if(n)return n;switch(i.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const r=this._getPlacementRepeat(i.markerPlacement);if(r)return r}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const s of t)if(s)switch(s.type){case"CIMGeometricEffectDashes":{const i=s.dashTemplate;if(i&&i.length){let n=0;for(const r of i)n+=r;return 1&i.length&&(n*=2),n}break}case"CIMGeometricEffectWave":return s.period;default:ri().error(`unsupported geometric effect type ${s.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const s=t.placementTemplate;if(s&&s.length){let i=0;for(const n of s)i+=+n;return 1&s.length&&(i*=2),i}break}}return 0}static fromCIMInsidePolygon(t){const s=t.markerPlacement,i={...t};i.markerPlacement=null,i.anchorPoint=null;const n=Math.abs(s.stepX),r=Math.abs(s.stepY),o=(s.randomness??100)/100;let a,h,l,c;if(s.gridType==="Random"){const u=bt(Pa),p=Math.max(Math.floor(u/n),1),d=Math.max(Math.floor(u/r),1);a=p*n/2,h=d*r/2,l=2*h;const f=new un(s.seed),m=o*n/1.5,_=o*r/1.5;c=[];for(let y=0;y({type:"CIMMarkerGraphic",geometry:u,symbol:{type:"CIMPointSymbol",symbolLayers:[i]}})),size:l}}};function so(e,t){if(e)switch(e.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const s=e.symbolLayers;if(!s)return;for(const i of s)if(t(i),i.type==="CIMVectorMarker"){const n=i.markerGraphics;if(!n)continue;for(const r of n)if(r){const o=r.symbol;o&&so(o,t)}}break}}}const io=e=>{if(!e)return lt.Butt;switch(e){case"butt":return lt.Butt;case"square":return lt.Square;case"round":return lt.Round}},ro=e=>{if(!e)return kt.Miter;switch(e){case"miter":return kt.Miter;case"round":return kt.Round;case"bevel":return kt.Bevel}},Jh=e=>{if(e==null)return"Center";switch(e){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},Zh=e=>{if(e==null)return"Center";switch(e){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},Q=e=>{if(!e)return[0,0,0,0];const{r:t,g:s,b:i,a:n}=e;return[t,s,i,255*n]},Qh=(e,t)=>{const s=tl(t),i=el(e);return s&&i?`${s}-${i}`:`${s}${i}`},tl=e=>{if(!e)return"";switch(e.toLowerCase()){case"bold":case"bolder":return"bold"}return""},el=e=>{if(!e)return"";switch(e.toLowerCase()){case"italic":case"oblique":return"italic"}return""},Fi=(e,t)=>{const s=li("safari")?.001:0,i=t==="butt";switch(e){case"dash":case"esriSLSDash":return i?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return i?[4,3,1,3]:[3,4,s,4];case"dot":case"esriSLSDot":return i?[1,3]:[s,4];case"long-dash":case"esriSLSLongDash":return i?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return i?[8,3,1,3]:[7,4,s,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return i?[8,3,1,3,1,3]:[7,4,s,4,s,4];case"short-dash":case"esriSLSShortDash":return i?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return i?[4,1,1,1]:[3,2,s,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return i?[4,1,1,1,1,1]:[3,2,s,2,s,2];case"short-dot":case"esriSLSShortDot":return i?[1,1]:[s,2];case"solid":case"esriSLSSolid":case"none":return ri().error("Unexpected: style does not require rasterization"),[0,0];default:return ri().error(`Tried to rasterize SLS, but found an unexpected style: ${e}!`),[0,0]}};function sl(e){return e.symbolLayers!==void 0}const ze=(e,t=100)=>{const s=t/2;let i,n;const r=e;if(r==="circle"||r==="esriSMSCircle"){let o=Math.acos(1-.25/s),a=Math.ceil(eo/o/4);a===0&&(a=1),o=Wh/a,a*=4;const h=[];h.push([s,0]);for(let l=1;le==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function rl(e,t,s){if(!(!e.effects||t.geometryEngine!=null)){if(t.geometryEnginePromise)return void s.push(t.geometryEnginePromise);_a(e.effects)&&(t.geometryEnginePromise=ga(),s.push(t.geometryEnginePromise),t.geometryEnginePromise.then(i=>t.geometryEngine=i))}}function Jr(e){if(!e)return null;let t=null;const{cap:s,color:i,join:n,miterLimit:r,style:o,width:a}=e;return o!=="solid"&&o!=="none"&&o!=="esriSLSSolid"&&o!=="esriSLSNull"&&(t=[{type:"CIMGeometricEffectDashes",dashTemplate:Fi(o,s),lineDashEnding:"NoConstraint",scaleDash:!0,offsetAlongLine:null}]),{type:"CIMSolidStroke",color:o!=="esriSLSNull"&&o!=="none"?Q(i):[0,0,0,0],capStyle:io(s),joinStyle:ro(n),miterLimit:r,width:a,effects:t}}var Zr;(function(e){e[e.Geographic=0]="Geographic",e[e.Arithmatic=1]="Arithmatic"})(Zr||(Zr={}));const su=3.14159265359/180,nl=3.14159265359/128,iu=1,ol=1.1,al=1,ru=24,nu=8,hl=1e-5,Qr=.05,ll=1e-30,cl=4,ul=0,pl=2,ou=2,au=3,hu=0,lu=3,dl=16777216,cu=1.1,fl=()=>ge.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");let no=class{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}},ml=class extends no{constructor(){super(...arguments),this.vertex=new tn,this.fragment=new tn,this.attributes=new yl,this.varyings=new xl,this.extensions=new Ni,this.constants=new oo}get fragmentUniforms(){return this.fragment.uniforms.entries}get builder(){return this}generate(e,t=!0){const s=this.extensions.generateSource(e),i=this.attributes.generateSource(e),n=this.varyings.generateSource(e),r=e==="vertex"?this.vertex:this.fragment,o=r.uniforms.generateSource(),a=r.code.generateSource(),h=e==="vertex"?Pl:bl(),l=this.constants.generateSource().concat(r.constants.generateSource());return`${t?"#version 300 es":""} ${s.join(` `)} ${h} diff --git a/custom-toc-highlight/assets/UpdatingHandles-CUu3u1ms-CruZWJRY.js b/custom-toc-highlight/assets/UpdatingHandles-CUu3u1ms-DHvcjtvD.js similarity index 96% rename from custom-toc-highlight/assets/UpdatingHandles-CUu3u1ms-CruZWJRY.js rename to custom-toc-highlight/assets/UpdatingHandles-CUu3u1ms-DHvcjtvD.js index 7f374f32..ee46a69f 100644 --- a/custom-toc-highlight/assets/UpdatingHandles-CUu3u1ms-CruZWJRY.js +++ b/custom-toc-highlight/assets/UpdatingHandles-CUu3u1ms-DHvcjtvD.js @@ -1 +1 @@ -import{v as r,S as _,i as p,j as u,ah as o,aF as g,ai as c,av as m,a2 as h,aQ as H}from"./story-BfX8CRfG.js";let l=class extends u{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o)}addWhen(e,t,s={}){return this._installWatch(e,t,s,g)}addOnCollectionChange(e,t,{initial:s=!1,final:n=!1}={}){const a=++this._handleId;return this.addHandles([c(e,"after-changes",this._createSyncUpdatingCallback(),m),c(e,"change",t,{onListenerAdd:s?d=>t({added:d.toArray(),removed:[]}):void 0,onListenerRemove:n?d=>t({added:[],removed:d.toArray()}):void 0})],a),h(()=>this.removeHandles(a))}addPromise(e){if(e==null)return e;const t=++this._handleId;this.addHandles(h(()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this.hasHandles(i)||this._set("updating",!1))}),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},n){const a=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,a);const d=n(e,t,s);return this.addHandles(d,a),h(()=>this.removeHandles(a))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),n=o(e,s,{sync:!0,equals:()=>!1});return this.addHandles(n,t),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(i),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(H(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(i))}),i)}}};r([_({readOnly:!0})],l.prototype,"updating",void 0),l=r([p("esri.core.support.UpdatingHandles")],l);const i=-42;export{l as i}; +import{v as r,S as _,i as p,j as u,ah as o,aF as g,ai as c,av as m,a2 as h,aQ as H}from"./story-Doly9N9p.js";let l=class extends u{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll()}add(e,t,s={}){return this._installWatch(e,t,s,o)}addWhen(e,t,s={}){return this._installWatch(e,t,s,g)}addOnCollectionChange(e,t,{initial:s=!1,final:n=!1}={}){const a=++this._handleId;return this.addHandles([c(e,"after-changes",this._createSyncUpdatingCallback(),m),c(e,"change",t,{onListenerAdd:s?d=>t({added:d.toArray(),removed:[]}):void 0,onListenerRemove:n?d=>t({added:[],removed:d.toArray()}):void 0})],a),h(()=>this.removeHandles(a))}addPromise(e){if(e==null)return e;const t=++this._handleId;this.addHandles(h(()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this.hasHandles(i)||this._set("updating",!1))}),t),this._pendingPromises.add(e),this._set("updating",!0);const s=()=>this.removeHandles(t);return e.then(s,s),e}removeAll(){this._pendingPromises.clear(),this.removeAllHandles(),this._set("updating",!1)}_installWatch(e,t,s={},n){const a=++this._handleId;s.sync||this._installSyncUpdatingWatch(e,a);const d=n(e,t,s);return this.addHandles(d,a),h(()=>this.removeHandles(a))}_installSyncUpdatingWatch(e,t){const s=this._createSyncUpdatingCallback(),n=o(e,s,{sync:!0,equals:()=>!1});return this.addHandles(n,t),n}_createSyncUpdatingCallback(){return()=>{this.removeHandles(i),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this.addHandles(H(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this.removeHandles(i))}),i)}}};r([_({readOnly:!0})],l.prototype,"updating",void 0),l=r([p("esri.core.support.UpdatingHandles")],l);const i=-42;export{l as i}; diff --git a/custom-toc-highlight/assets/VectorTileLayer-DruyQukp-O9fRyiwY.js b/custom-toc-highlight/assets/VectorTileLayer-DruyQukp-BQMpjmuu.js similarity index 91% rename from custom-toc-highlight/assets/VectorTileLayer-DruyQukp-O9fRyiwY.js rename to custom-toc-highlight/assets/VectorTileLayer-DruyQukp-BQMpjmuu.js index 278cacbe..f6207e64 100644 --- a/custom-toc-highlight/assets/VectorTileLayer-DruyQukp-O9fRyiwY.js +++ b/custom-toc-highlight/assets/VectorTileLayer-DruyQukp-BQMpjmuu.js @@ -1 +1 @@ -import{W as T,f as w,a as x,y as S,cA as Q,jU as Z,jV as ee,ay as te,P as g,o as I,k as F,v as c,S as h,n as U,J as re,ac as ie,a0 as E,i as se,a1 as oe,hY as le,jW as ae,X as ne,cx as W,bX as O,d4 as J,$ as K,a5 as ue,jX as z,b7 as D,eS as j,jY as B,w as pe,aA as ce,aU as he,an as ye,x as M,E as de}from"./story-BfX8CRfG.js";import{m as me}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as fe}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{O as Ae}from"./ArcGISCachedService-C64Ko1TY-9EmQxNmS.js";import{a as Se}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{u as we}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as xe}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{E as ve}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as _e}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as be}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as Ie}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{V as R,d as Ue}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import{f as G}from"./TilemapCache-CRRxws77-BBkZHUXn.js";import{s as X}from"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import{a as Re}from"./jsonContext-BA8GHqVk-CWQlLGSw.js";import{a as Te}from"./StyleRepository-D3WuVprR-SmpmvCua.js";import{n as C}from"./capabilities-agoTWNzb-CtsNgRyk.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./TileInfoTilemapCache-D1SExPij-BhR83GZf.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";let _=null;function Oe(e){if(_)return _;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return _=new Promise(r=>{const i=new Image;i.onload=()=>{i.onload=i.onerror=null,r(i.width>0&&i.height>0)},i.onerror=()=>{i.onload=i.onerror=null,r(!1)},i.src="data:image/webp;base64,"+t[e]}),_}const k=1.15;class N{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>k;const{width:r,height:i,data:s,json:l}=await this._getSpriteData(this._spriteSource,t),o=Object.keys(l);if(!o||o.length===0||!s)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=l,this.width=r,this.height=i;const u=Math.max(this._maxTextureSize,4096);if(r>u||i>u){const a=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${u} pixels}`;throw oe.getLogger("esri.layers.support.SpriteSource").error(a),new I("SpriteSource",a)}let n;for(let a=0;ae.data.index)),this._tileIndexPromise}async dataKey(e,t){const r=await this.fetchTileIndex();return K(t),this._getIndexedDataKey(r,e)}_getIndexedDataKey(e,t){const r=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let i=t;for(;i.level!==0;)i=new X(i.level-1,i.row>>1,i.col>>1,i.world),r.push(i);let s,l,o=e,u=r.pop();if(o===1)return u;for(;r.length;)if(s=r.pop(),l=(1&s.col)+((1&s.row)<<1),o){if(o[l]===0){u=null;break}if(o[l]===1){u=s;break}u=s,o=o[l]}return u}},Le=class{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=ce(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||(this._tileIndexPromise=w(this._tileIndexUrl,{query:{...e?.query}}).then(t=>t.data.index)),this._tileIndexPromise}dataKey(e,t){const{level:r,row:i,col:s}=e,l=new X(e);return this._tilemap.fetchAvailabilityUpsample(r,i,s,l,t).then(()=>(l.world=e.world,l)).catch(o=>{if(he(o))throw o;return null})}};class Ee{constructor(t){this._tileUrl=t,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(t){(this._promise==null||M(this._abortController?.signal))&&(this._promise=this._makeRequest(this._tileUrl));const r=this._abortOptions;return r.push(t),de(t,()=>{r.every(i=>M(i))&&this._abortController.abort()}),this._promise.then(i=>g(i))}async _makeRequest(t){this._abortController=new AbortController;const{data:r}=await w(t,{responseType:"array-buffer",signal:this._abortController.signal});return r}}const q=new Map;function De(e,t,r,i,s){const l=x(e),o=l.query;if(o)for(const[n,a]of Object.entries(o))switch(a){case"{x}":o[n]=i.toString();break;case"{y}":o[n]=r.toString();break;case"{z}":o[n]=t.toString()}const u=l.path;return je(S(u.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,i.toString()),{...l.query}),s)}function je(e,t){return ye(q,e,()=>new Ee(e)).getData(t).finally(()=>q.delete(e))}class Be{constructor(t,r,i){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=t,this.sourceUrl=r;const s=x(this.sourceUrl),l=g(i),o=l.tiles;if(s)for(let f=0;ff.toLowerCase().trim()),n=i?.exportTilesAllowed===!0,a=u?.includes("tilemap")===!0,y=n&&i.hasOwnProperty("maxExportTilesCount")?i.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:n,supportsTileMap:a},exportTiles:n?{maxExportTilesCount:+y}:null},this.tileInfo=R.fromJSON(l.tileInfo);const d=i.tileMap?S(O(s.path,i.tileMap),s.query??{}):null;a?(this.type="vector-tile",this.tilemap=new Le(new G({layer:{parsedUrl:s,tileInfo:this.tileInfo},minLOD:l.minLOD??this.tileInfo.lods[0].level,maxLOD:l.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),d)):d&&(this.tilemap=new Pe(d)),this.fullExtent=U.fromJSON(i.fullExtent),this.initialExtent=U.fromJSON(i.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(t,r){return this.tilemap?this.tilemap.dataKey(t,r):t}requestTile(t,r,i,s){const l=this.tileServers[r%this.tileServers.length];return De(l,t,r,i,s)}isCompatibleWith(t){const r=this.tileInfo,i=t.tileInfo;if(!r.spatialReference.equals(i.spatialReference)||!r.origin.equals(i.origin)||Math.round(r.dpi)!==Math.round(i.dpi))return!1;const s=r.lods,l=i.lods,o=Math.min(s.length,l.length);for(let u=0;u=b||Math.abs(r.y-i.y)>=b)return!1;let s,l;e.lods[0].scale>t.lods[0].scale?(s=e,l=t):(l=e,s=t);for(let o=s.lods[0].scale;o>=l.lods[l.lods.length-1].scale-b;o/=2)if(Math.abs(o-l.lods[0].scale)t.lods[0].scale?e.lods[0]:t.lods[0],n=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=u.scale,y=u.resolution,d=n.scale,f=[];let m=a,P=y,L=0;for(;m>d;)f.push(new Ue({level:L,resolution:P,scale:m})),L++,m/=2,P/=2;return new R({size:[r,r],dpi:s,format:i||"pbf",origin:l,lods:f,spatialReference:o})}let p=class extends we(Ie(be(Ae(Se(ve(_e(xe(ge(me(fe)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=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?.destroy();this.primarySource?.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?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await w(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},Re(this.portalItem,"portal-item"))}).catch(T).then(()=>this._loadStyle(e));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&x(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?S(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(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?x(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&Q(e)&&(e=`https:${e}`);const r=Z(e);t.styleUrl=ee(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new R;if(e.length>1)for(let r=0;r(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 g(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return g(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 g(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?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new I("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 Me(e,{...t,query:{...this.customParameters,token:this.apiKey}});r.spriteFormat==="webp"&&(await Oe("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 Te(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=["OpenBasemap_v2","OpenBasemap_GCS_v2","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","World_Hillshade_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const s=t[1]||"";for(const l of r)if(l.toLowerCase().includes(i))return F(`//static.arcgis.com/attribution/Vector${s}/${l}`)}async _loadStyle(e){return this._loadingTask?.promise??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:U})],p.prototype,"fullExtent",null),c([h({json:{read:!1},readOnly:!0,type:U})],p.prototype,"initialExtent",null),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({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),c([h({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"refreshInterval",void 0),c([h()],p.prototype,"style",void 0),c([h({readOnly:!0})],p.prototype,"serviceUrl",null),c([h({type:re,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([ie(["portal-item","web-document"],"styleUrl")],p.prototype,"writeStyleUrl",null),c([h({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:R})],p.prototype,"tileInfo",null),c([h()],p.prototype,"tilemapCache",void 0),c([E("service","tilemapCache",["capabilities","tileInfo"])],p.prototype,"readTilemapCache",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([E("version",["version","currentVersion"])],p.prototype,"readVersion",null),p=c([se("esri.layers.VectorTileLayer")],p);const Ct=p;export{Ct as default}; +import{W as T,f as w,a as x,y as S,cA as Q,jU as Z,jV as ee,ay as te,P as g,o as I,k as F,v as c,S as h,n as U,J as re,ac as ie,a0 as E,i as se,a1 as oe,hY as le,jW as ae,X as ne,cx as W,bX as O,d4 as J,$ as K,a5 as ue,jX as z,b7 as D,eS as j,jY as B,w as pe,aA as ce,aU as he,an as ye,x as M,E as de}from"./story-Doly9N9p.js";import{m as me}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as fe}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{n as ge}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{O as Ae}from"./ArcGISCachedService-C64Ko1TY-COmlLbBz.js";import{a as Se}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{u as we}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as xe}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{E as ve}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as _e}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as be}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as Ie}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{V as R,d as Ue}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import{f as G}from"./TilemapCache-CRRxws77-CCC00Yar.js";import{s as X}from"./TileKey-C5IL-JBr-BGwa3-Dg.js";import{a as Re}from"./jsonContext-BA8GHqVk-BsXRY5es.js";import{a as Te}from"./StyleRepository-D3WuVprR-B1BVbhGB.js";import{n as C}from"./capabilities-agoTWNzb-CtsNgRyk.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./TileInfoTilemapCache-D1SExPij-BDoYZo_V.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./enums-qHpGJ28Q-CmnLAccm.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";let _=null;function Oe(e){if(_)return _;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return _=new Promise(r=>{const i=new Image;i.onload=()=>{i.onload=i.onerror=null,r(i.width>0&&i.height>0)},i.onerror=()=>{i.onload=i.onerror=null,r(!1)},i.src="data:image/webp;base64,"+t[e]}),_}const k=1.15;class N{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>k;const{width:r,height:i,data:s,json:l}=await this._getSpriteData(this._spriteSource,t),o=Object.keys(l);if(!o||o.length===0||!s)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=l,this.width=r,this.height=i;const u=Math.max(this._maxTextureSize,4096);if(r>u||i>u){const a=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${u} pixels}`;throw oe.getLogger("esri.layers.support.SpriteSource").error(a),new I("SpriteSource",a)}let n;for(let a=0;ae.data.index)),this._tileIndexPromise}async dataKey(e,t){const r=await this.fetchTileIndex();return K(t),this._getIndexedDataKey(r,e)}_getIndexedDataKey(e,t){const r=[t];if(t.level<0||t.row<0||t.col<0||t.row>>t.level>0||t.col>>t.level>0)return null;let i=t;for(;i.level!==0;)i=new X(i.level-1,i.row>>1,i.col>>1,i.world),r.push(i);let s,l,o=e,u=r.pop();if(o===1)return u;for(;r.length;)if(s=r.pop(),l=(1&s.col)+((1&s.row)<<1),o){if(o[l]===0){u=null;break}if(o[l]===1){u=s;break}u=s,o=o[l]}return u}},Le=class{constructor(e,t){this._tilemap=e,this._tileIndexUrl=t}destroy(){this._tilemap=ce(this._tilemap),this._tileIndexPromise=null}async fetchTileIndex(e){return this._tileIndexPromise||(this._tileIndexPromise=w(this._tileIndexUrl,{query:{...e?.query}}).then(t=>t.data.index)),this._tileIndexPromise}dataKey(e,t){const{level:r,row:i,col:s}=e,l=new X(e);return this._tilemap.fetchAvailabilityUpsample(r,i,s,l,t).then(()=>(l.world=e.world,l)).catch(o=>{if(he(o))throw o;return null})}};class Ee{constructor(t){this._tileUrl=t,this._promise=null,this._abortController=null,this._abortOptions=[]}getData(t){(this._promise==null||M(this._abortController?.signal))&&(this._promise=this._makeRequest(this._tileUrl));const r=this._abortOptions;return r.push(t),de(t,()=>{r.every(i=>M(i))&&this._abortController.abort()}),this._promise.then(i=>g(i))}async _makeRequest(t){this._abortController=new AbortController;const{data:r}=await w(t,{responseType:"array-buffer",signal:this._abortController.signal});return r}}const q=new Map;function De(e,t,r,i,s){const l=x(e),o=l.query;if(o)for(const[n,a]of Object.entries(o))switch(a){case"{x}":o[n]=i.toString();break;case"{y}":o[n]=r.toString();break;case"{z}":o[n]=t.toString()}const u=l.path;return je(S(u.replaceAll(/\{z\}/gi,t.toString()).replaceAll(/\{y\}/gi,r.toString()).replaceAll(/\{x\}/gi,i.toString()),{...l.query}),s)}function je(e,t){return ye(q,e,()=>new Ee(e)).getData(t).finally(()=>q.delete(e))}class Be{constructor(t,r,i){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.initialExtent=null,this.name=t,this.sourceUrl=r;const s=x(this.sourceUrl),l=g(i),o=l.tiles;if(s)for(let f=0;ff.toLowerCase().trim()),n=i?.exportTilesAllowed===!0,a=u?.includes("tilemap")===!0,y=n&&i.hasOwnProperty("maxExportTilesCount")?i.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:n,supportsTileMap:a},exportTiles:n?{maxExportTilesCount:+y}:null},this.tileInfo=R.fromJSON(l.tileInfo);const d=i.tileMap?S(O(s.path,i.tileMap),s.query??{}):null;a?(this.type="vector-tile",this.tilemap=new Le(new G({layer:{parsedUrl:s,tileInfo:this.tileInfo},minLOD:l.minLOD??this.tileInfo.lods[0].level,maxLOD:l.maxLOD??this.tileInfo.lods[this.tileInfo.lods.length-1].level}),d)):d&&(this.tilemap=new Pe(d)),this.fullExtent=U.fromJSON(i.fullExtent),this.initialExtent=U.fromJSON(i.initialExtent)}destroy(){this.tilemap?.destroy()}async getRefKey(t,r){return this.tilemap?this.tilemap.dataKey(t,r):t}requestTile(t,r,i,s){const l=this.tileServers[r%this.tileServers.length];return De(l,t,r,i,s)}isCompatibleWith(t){const r=this.tileInfo,i=t.tileInfo;if(!r.spatialReference.equals(i.spatialReference)||!r.origin.equals(i.origin)||Math.round(r.dpi)!==Math.round(i.dpi))return!1;const s=r.lods,l=i.lods,o=Math.min(s.length,l.length);for(let u=0;u=b||Math.abs(r.y-i.y)>=b)return!1;let s,l;e.lods[0].scale>t.lods[0].scale?(s=e,l=t):(l=e,s=t);for(let o=s.lods[0].scale;o>=l.lods[l.lods.length-1].scale-b;o/=2)if(Math.abs(o-l.lods[0].scale)t.lods[0].scale?e.lods[0]:t.lods[0],n=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=u.scale,y=u.resolution,d=n.scale,f=[];let m=a,P=y,L=0;for(;m>d;)f.push(new Ue({level:L,resolution:P,scale:m})),L++,m/=2,P/=2;return new R({size:[r,r],dpi:s,format:i||"pbf",origin:l,lods:f,spatialReference:o})}let p=class extends we(Ie(be(Ae(Se(ve(_e(xe(ge(me(fe)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type="vector-tile",this.url=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?.destroy();this.primarySource?.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?.id)return;const r=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await w(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},Re(this.portalItem,"portal-item"))}).catch(T).then(()=>this._loadStyle(e));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e?.serviceUrl&&x(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?S(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(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?x(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&Q(e)&&(e=`https:${e}`);const r=Z(e);t.styleUrl=ee(e,r)}get tileInfo(){const e=[];for(const r in this.sourceNameToSource)e.push(this.sourceNameToSource[r]);let t=this.primarySource?.tileInfo||new R;if(e.length>1)for(let r=0;r(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 g(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const i=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||i})}getStyleLayer(e){return g(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 g(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?.origin&&!this.styleUrl?(t.messages&&t.messages.push(new I("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 Me(e,{...t,query:{...this.customParameters,token:this.apiKey}});r.spriteFormat==="webp"&&(await Oe("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 Te(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=["OpenBasemap_v2","OpenBasemap_GCS_v2","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","World_Hillshade_v2"];if(!t)return;const i=t[2]&&t[2].toLowerCase();if(!i)return;const s=t[1]||"";for(const l of r)if(l.toLowerCase().includes(i))return F(`//static.arcgis.com/attribution/Vector${s}/${l}`)}async _loadStyle(e){return this._loadingTask?.promise??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:U})],p.prototype,"fullExtent",null),c([h({json:{read:!1},readOnly:!0,type:U})],p.prototype,"initialExtent",null),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({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),c([h({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"refreshInterval",void 0),c([h()],p.prototype,"style",void 0),c([h({readOnly:!0})],p.prototype,"serviceUrl",null),c([h({type:re,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([ie(["portal-item","web-document"],"styleUrl")],p.prototype,"writeStyleUrl",null),c([h({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:R})],p.prototype,"tileInfo",null),c([h()],p.prototype,"tilemapCache",void 0),c([E("service","tilemapCache",["capabilities","tileInfo"])],p.prototype,"readTilemapCache",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([E("version",["version","currentVersion"])],p.prototype,"readVersion",null),p=c([se("esri.layers.VectorTileLayer")],p);const Ct=p;export{Ct as default}; diff --git a/custom-toc-highlight/assets/VectorTileLayerView2D-B9OYHbL4-Ctr5GCiP.js b/custom-toc-highlight/assets/VectorTileLayerView2D-B9OYHbL4-ANKZ9nt1.js similarity index 95% rename from custom-toc-highlight/assets/VectorTileLayerView2D-B9OYHbL4-Ctr5GCiP.js rename to custom-toc-highlight/assets/VectorTileLayerView2D-B9OYHbL4-ANKZ9nt1.js index 57c5e648..4044b2c5 100644 --- a/custom-toc-highlight/assets/VectorTileLayerView2D-B9OYHbL4-Ctr5GCiP.js +++ b/custom-toc-highlight/assets/VectorTileLayerView2D-B9OYHbL4-ANKZ9nt1.js @@ -1 +1 @@ -import{aA as V,aC as Ve,aU as j,a1 as K,P as ze,bh as H,w as Fe,v as oe,S as He,i as qe,aW as Be,y as ne,bt as Ne,W as Qe,iF as ae,cf as We,ht as $e,bi as le,an as Je,f as Ke,hT as k,d1 as he}from"./story-BfX8CRfG.js";import{P as Ge,g as Ye}from"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import{C as I,I as R}from"./enums-qHpGJ28Q-CmnLAccm.js";import{q as je}from"./workers-PiCjreoO-idkDTJa3.js";import{a as P}from"./Rect-DD6XS68q-D_hsV3ag.js";import{D as O,L as ce,A as B,U as Xe,G as Me,n as D}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as Re,V as Pe}from"./Texture-BCt2hphT-hC4XzHg_.js";import{o as X}from"./pbf-D-y3_eZO-DQKnyfOm.js";import{k as Ze}from"./rasterizingUtils-BmlDdKBf-CpGlbhM3.js";import{s as A}from"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import{b as et}from"./LRUCache-C3erQTWv-0wD6drRf.js";import{$ as ue,k as Ae,Q as tt}from"./Tile-D75RMC64-Dj1SOP3K.js";import{R as st,C as it,D as rt,G as ot}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as z,E as N,c as nt}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{j as at,Q as lt}from"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import{r as M}from"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import{c as U}from"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import{e as W,c as ht,t as ct}from"./config-nuMERBvb-MDUrh2eL.js";import{K as Le}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{V as Oe}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import{o as ut}from"./signal-CETehA7D-DhpyJ8yp.js";import{p as C,a as Z,u as yt,n as L,i as dt}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{h as _t}from"./TileContainer-D48pXXgL-CdMiwPkS.js";import{N as pt}from"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";import{g as ye,f as de}from"./SourceLayerData-BT_Ywuvg-DFNndgqY.js";import{a as _e,K as ft}from"./StyleRepository-D3WuVprR-SmpmvCua.js";import{X as gt,Y as mt}from"./LayerView-Bish-E63-rB2WUWF4.js";import{n as bt}from"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";import{i as pe}from"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./main-ugzBrWNm.js";import"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";let F=class{constructor(i,e){this._width=0,this._height=0,this._free=[],this._width=i,this._height=e,this._free.push(new P(0,0,i,e))}get width(){return this._width}get height(){return this._height}allocate(i,e){if(i>this._width||e>this._height)return new P;let t=null,s=-1;for(let r=0;ri&&this._free.push(new P(t.x+i,t.y,t.width-i,e)),t.height>e&&this._free.push(new P(t.x,t.y+e,t.width,t.height-e))):(t.width>i&&this._free.push(new P(t.x+i,t.y,t.width-i,t.height)),t.height>e&&this._free.push(new P(t.x,t.y+e,i,t.height-e))),new P(t.x,t.y,i,e))}release(i){for(let e=0;e{const l=i+a;if(this._rangePromises.has(l))n.push(this._rangePromises.get(l));else{const h=s.getRange(i,a).then(()=>{this._rangePromises.delete(l)},()=>{this._rangePromises.delete(l)});this._rangePromises.set(l,h),n.push(h)}}),Promise.all(n).then(()=>{let a=this._glyphIndex[i];a||(a={},this._glyphIndex[i]=a);for(const l of e){const h=a[l];if(h){t[l]={sdf:!0,rect:h.rect,metrics:h.metrics,page:h.page,code:l};continue}const y=s.getGlyph(i,l);if(!y?.metrics)continue;const u=y.metrics;let d;if(u.width===0)d=new P(0,0,0,0);else{const c=u.width+6,_=u.height+2*3;let p=c%4?4-c%4:4,f=_%4?4-_%4:4;p===1&&(p=5),f===1&&(f=5),d=this._binPack.allocate(c+p,_+f),d.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 F(this.width-4,this.height-4),d=this._binPack.allocate(c+p,_+f));const g=this._glyphData[this._currentPage],m=y.bitmap;let b,x;if(m)for(let S=0;S<_;S++){b=c*S,x=this.width*(d.y+S+1)+d.x;for(let w=0;w{t.addRange(e,new G(new X(new Uint8Array(n.data),new DataView(n.data))))}).catch(()=>{t.addRange(e,new G)})}return t.addRange(e,new G),Promise.resolve()}getGlyph(i,e){const t=this._getFontStack(i);if(!t)return;const s=Math.floor(e/256),r=t.getRange(s);return r?{metrics:r.getMetrics(e),bitmap:r.getBitmap(e)}:void 0}_getFontStack(i){let e=this._glyphInfo[i];return e||(e=this._glyphInfo[i]=new wt),e}},St=class{constructor(i,e,t){this._array=i,this._start=e,this.length=t}at(i){return 0<=i&&i0&&(this._maxItemSize=s),this._binPack=new F(e-4,t-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,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 F(this._pageWidth-4,this._pageHeight-4);const t=Math.floor(this._pageWidth),s=Math.floor(this._pageHeight),r=new Uint32Array(t*s);this._mosaicsData[0]=r,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,t=!1){let s,r,o=this._mosaicRects[e];if(o)return o;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(xt)?([s,r]=this._rasterizeDash(e),t=!0):s=this._sprites.getSpriteInfo(e),!s?.width||!s.height||s.width<0||s.height<0))return null;const n=s.width,a=s.height,[l,h,y]=this._allocateImage(n,a);return l.width<=0?null:(this._copy(l,s,h,y,t,r),o={type:"sprite",rect:l,width:n,height:a,sdf:s.sdf,simplePattern:!1,rasterizationScale:s.pixelRatio,page:h},this._mosaicRects[e]=o,o)}getSpriteItems(e){const t={};for(const s of e)t[s.name]=this.getSpriteItem(s.name,s.repeat);return t}getMosaicItemPosition(e,t){const s=this.getSpriteItem(e,t),r=s?.rect;if(!r)return null;r.width=s.width,r.height=s.height;const o=s.width,n=s.height,a=2;return{tl:[r.x+a,r.y+a],br:[r.x+a+o,r.y+a+n],page:s.page}}bind(e,t,s=0,r=0){if(s>=this._size.length||s>=this._mosaicsData.length)return;if(!this._textures[s]){const n=new Re;n.wrapMode=Me.CLAMP_TO_EDGE,n.width=this._size[s][0],n.height=this._size[s][1],this._textures[s]=new Pe(e,n,new Uint8Array(this._mosaicsData[s].buffer))}const o=this._textures[s];o.setSamplingMode(t),this._dirties[s]&&o.setData(new Uint8Array(this._mosaicsData[s].buffer)),e.bindTexture(o,r),this._dirties[s]=!1}static _copyBits(e,t,s,r,o,n,a,l,h,y,u){let d=r*t+s,c=l*n+a;if(u){c-=n;for(let _=-1;_<=y;_++,d=((_+y)%y+r)*t+s,c+=n)for(let p=-1;p<=h;p++)o[c+p]=e[d+(p+h)%h]}else for(let _=0;_=this._mosaicsData.length)return;const a=new Uint32Array(n?n.buffer:this._sprites.image.buffer),l=this._mosaicsData[s],h=2,y=n?t.width:this._sprites.width;ke._copyBits(a,y,t.x,t.y,l,r[0],e.x+h,e.y+h,t.width,t.height,o),this._dirties[s]=!0}_allocateImage(e,t){e+=2,t+=2;const s=Math.max(e,t);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(i){this._requestSprite(i);const e=this._layer.currentStyleInfo.glyphsUrl,t=new ge(e?ne(e,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new fe(1024,1024,t),this._broadcastPromise=je("WorkerTileHandler",{client:this,schedule:i.schedule,signal:i.signal}).then(s=>{if(this._layer&&(this._connection?.close(),this._connection=s,this._layer&&!this._connection.closed)){const r=s.broadcast("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD},i);Promise.all(r).catch(o=>Ne(o))}})}_requestSprite(i){this._spriteSourceAbortController?.abort();const e=new AbortController;this._spriteSourceAbortController=e;const t=i?.signal;this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener("abort",this._inputSignalEventListener),this._startOptionsInputSignal=null,t&&(this._inputSignalEventListener=Tt(e),t.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:s}=e,r={...i,signal:s};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,r),this._spriteSourcePromise.then(o=>{Qe(s),this._spriteMosaic=new me(1024,1024,250),this._spriteMosaic.setSpriteSource(o)})}async updateStyle(i){const e=[];for(const t of i)t.type===I.SPRITES_CHANGED?e.push({type:I.SPRITES_CHANGED,data:{spriteSource:null}}):e.push(t);return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(i){const e=new me(1024,1024,250);return e.setSpriteSource(i),this._spriteMosaic=e,this._spriteSourcePromise=Promise.resolve(i),this._spriteSourceAbortController=null,e}async setStyle(i,e,t){await this._broadcastPromise,this._styleRepository=i,this._sourceDataMaxLOD=t,this._requestSprite();const s=new ge(this._layer.currentStyleInfo.glyphsUrl?ne(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new fe(1024,1024,s),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:e,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(i,e){const t=await this._getRefKeys(i,e);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),t,e)}async fetchTilePBFs(i){const e=Object.keys(this._layer.sourceNameToSource),t={},s=await this._getRefKeys(i,t),r=[],o=[];for(let n=0;n{r.push({...h,key:a})}),o.push(l)}return Promise.all(o).then(()=>r)}async parseTileData(i,e){const t=i&&i.data;if(!t)return null;const{sourceName2DataAndRefKey:s,transferList:r}=t;return Object.keys(s).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:i.key.id,sourceName2DataAndRefKey:s,styleLayerUIDs:i.styleLayerUIDs},{...e,transferList:r}))}async getSprites(i){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(i)}getGlyphs(i){return this._glyphMosaic.getGlyphItems(i.font,i.codePoints)}async _getTilePayload(i,e,t){const s=A.pool.acquire(i.id),r=this._layer.sourceNameToSource[e],{level:o,row:n,col:a}=s;A.pool.release(s);try{return{protobuff:await r.requestTile(o,n,a,t),sourceName:e}}catch(l){if(j(l))throw l;return{protobuff:null,sourceName:e}}}async _getRefKeys(i,e){const t=this._layer.sourceNameToSource,s=new Array;for(const r in t){const o=t[r].getRefKey(i,e);s.push(o)}return ae(s)}_getSourcesData(i,e,t){const s=[];for(let r=0;r{const o={},n=[];for(let a=0;a0){const h=e[a].value.id;o[l.sourceName]={refKey:h,protobuff:l.protobuff},n.push(l.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:n}})}};function Tt(i){return()=>i.abort()}const be=512,vt=1e-6,Ct=(i,e)=>i+1/(1<<2*e);let we=class{constructor(i,e){this._tiles=new Map,this._tileCache=new et(40,t=>t.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=i.acquireTile,this.releaseTile=i.releaseTile,this.tileInfoView=i.tileInfoView,this._container=e}destroy(){for(const i of this._tiles.values())i.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(i){this._updateCacheSize(i);const e=this.tileInfoView,t=e.getTileCoverage(i.state,0,!0,"smallest");if(!t)return!0;const{spans:s,lodInfo:r}=t,{level:o}=r,n=this._tiles,a=new Set,l=new Set;for(const{row:y,colFrom:u,colTo:d}of s)for(let c=u;c<=d;c++){const _=A.getId(o,y,r.normalizeCol(c),r.getWorldForColumn(c)),p=this._getOrAcquireTile(_);a.add(_),p.processed()?this._addToContainer(p):l.add(new A(_))}for(const[y,u]of n)u.isCoverage=a.has(y);for(const y of l)this._findPlaceholdersForMissingTiles(y,a);let h=!1;for(const[y,u]of n)u.neededForCoverage=a.has(y),u.neededForCoverage||u.isHoldingForFade&&e.intersects(t,u.key)&&a.add(y),u.isFading&&(h=!0);for(const y of this._tiles.keys())a.has(y)||this._releaseTile(y);return Ae.pool.release(t),!h}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(i,e,t,s,r){const o=[0,0],n=[0,0];s.toMap(o,i-t,e+t),s.toMap(n,i+t,e-t);const a=Math.min(o[0],n[0]),l=Math.min(o[1],n[1]),h=Math.max(o[0],n[0]),y=Math.max(o[1],n[1]),u=We(a,l,h,y),d=H(),c=[];for(const _ of this._visibleTiles.values())this.tileInfoView.getTileBounds(d,_.key),$e(u,d)&&c.push(_);if(r!=null&&r.length>0){const _=new Set(c.map(f=>f.id)),p=r.filter(f=>!_.has(f.tileKey.id)).map(f=>this._visibleTiles.get(f.tileKey.id)).filter(f=>f!==void 0);c.push(...p)}return c}_findPlaceholdersForMissingTiles(i,e){const t=[];for(const r of this._tiles.values())this._addPlaceholderChild(t,r,i,e);const s=t.reduce(Ct,0);Math.abs(1-s)0;){if(s--,r>>=1,o>>=1,t.level===s&&t.row===r&&t.col===o&&t.world===n)return!0;if(a.has(`${s}/${r}/${o}/${n}`))return!1}return!1}_updateCacheSize(i){const e=i.state.size;if(e[0]===this._viewSize[0]&&e[1]===this._viewSize[1])return;const t=Math.ceil(e[0]/be)+1,s=Math.ceil(e[1]/be)+1;this._viewSize[0]=e[0],this._viewSize[1]=e[1],this._tileCache.maxSize=5*t*s}};function Dt(i){const[e,t,s,r]=i.split("/"),o=parseInt(e,10);return o===0?null:`${o-1}/${parseInt(t,10)>>1}/${parseInt(s,10)>>1}/${parseInt(r,10)}`}function Mt(i,e){const t=e.level-i.level;return i.row===e.row>>t&&i.col===e.col>>t&&i.world===e.world}let Rt=class{constructor(i,e){this.sourceTile=e,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=i}};class Pt{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 Se(i,e,t,s,r,o){const n=t-r;if(n>=0)return(e>>n)+(s-(o<>n);const a=-n;return e-(o-(s<>a)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.lineMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}};class Et extends J{constructor(e,t){super(e,t),this.type=R.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const s=new Uint32Array(e);let r=this.bufferDataOffset;this.fillIndexStart=s[r++],this.fillIndexCount=s[r++],this.outlineIndexStart=s[r++],this.outlineIndexCount=s[r++];const o=s[r++];if(o>0){this.patternMap=new Map;for(let n=0;n0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=k(this.fillVAO),this.outlineVAO=k(this.outlineVAO)}doPrepareForRendering(e,t,s){const r=new Uint32Array(t),o=new Int32Array(r.buffer),n=r[s++],a=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,n));s+=n;const l=r[s++],h=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,l));s+=l;const y=r[s++],u=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,y));s+=y;const d=r[s++],c=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,d));s+=d;const _=this.layer,p=_.fillMaterial,f=_.outlineMaterial;this.fillVAO=new U(e,p.getAttributeLocations(),p.getLayoutInfo(),new Map([["geometry",a]]),h),this.outlineVAO=new U(e,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",u]]),c)}}let Vt=class extends J{constructor(i,e,t){super(i,e),this.type=R.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const s=new Uint32Array(i),r=new Int32Array(i),o=new Float32Array(i);let n=this.bufferDataOffset;this.isIconSDF=!!s[n++];const a=s[n++],l=s[n++],h=s[n++],y=new A(a,l,h,0),u=s[n++];for(let p=0;p0||this.glyphPerPageElementsMap.size>0}triangleCount(){let i=0;for(const e of this.iconPerPageElementsMap.values())i+=e[1];for(const e of this.glyphPerPageElementsMap.values())i+=e[1];return i/3}doDestroy(){this.iconVAO=k(this.iconVAO),this.textVAO=k(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const i=this.iconOpacity,e=this.iconVAO.vertexBuffers.get("opacity");i.length>0&&i.byteLength===e.usedMemory&&e.setSubData(i,0,0,i.length);const t=this.textOpacity,s=this.textVAO.vertexBuffers.get("opacity");t.length>0&&t.byteLength===s.usedMemory&&s.setSubData(t,0,0,t.length)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=s[t++],y=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,h));t+=h;const u=s[t++],d=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,u));t+=u;const c=M.createVertex(i,D.STATIC_DRAW,this.iconOpacity.buffer),_=M.createVertex(i,D.STATIC_DRAW,this.textOpacity.buffer),p=this.layer,f=p.iconMaterial,g=p.textMaterial;this.iconVAO=new U(i,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",n],["opacity",c]]),l),this.textVAO=new U(i,g.getAttributeLocations(),g.getLayoutInfo(),new Map([["geometry",y],["opacity",_]]),d)}},zt=class extends J{constructor(i,e){super(i,e),this.type=R.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const t=new Uint32Array(i);let s=this.bufferDataOffset;this.circleIndexStart=t[s++],this.circleIndexCount=t[s++],this.bufferDataOffset=s}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.circleMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}},Ft=class Ee extends Le{constructor(e,t,s,r,o,n,a,l=null){super(e,t,s,r,o,n,4096,4096),this.styleRepository=a,this._memCache=l,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){this.status!=="unloaded"&&(Ee._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){--this._referenced==0&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,o=this._createRenderBuckets(s);if(r&&r.byteLength>0){const n=new Uint32Array(r);for(const a of n)this._deleteLayerData(a)}for(const[n,a]of o)this._deleteLayerData(n),a.type===R.SYMBOL&&(this.symbols.set(n,a.symbols),t=!0),this._usedMemory+=a.usedMemory,this.layerData.set(n,a);this._memCache?.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===R.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(t){t.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),s=this.width/this.rangeX*t,r=this.height/this.rangeY*t,o=[0,0];e.toScreen(o,[this.x,this.y]);const n=this.transforms.tileUnitsToPixels;st(n),it(n,n,o),rt(n,n,Math.PI*e.rotation/180),ot(n,n,[s,r,1])}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z(),tileUnitsToPixels:z()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const o=this._deserializeBucket(r,s);for(const n of o.layerUIDs)t.set(n,o)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case R.FILL:s=new Et(e,this.styleRepository);break;case R.LINE:s=new Ut(e,this.styleRepository);break;case R.SYMBOL:s=new Vt(e,this.styleRepository,this);break;case R.CIRCLE:s=new zt(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}};function Ht(i,e,t,s,r,o){const{iconRotationAlignment:n,textRotationAlignment:a,iconTranslate:l,iconTranslateAnchor:h,textTranslate:y,textTranslateAnchor:u}=s;let d=0;for(const c of i.colliders){const[_,p]=c.partIndex===0?l:y,f=c.partIndex===0?h:u,g=c.minLod<=o&&o<=c.maxLod;d+=g?0:1,c.enabled=g,c.xScreen=c.xTile*r[0]+c.yTile*r[3]+r[6],c.yScreen=c.xTile*r[1]+c.yTile*r[4]+r[7],f===dt.MAP?(c.xScreen+=t*_-e*p,c.yScreen+=e*_+t*p):(c.xScreen+=_,c.yScreen+=p),L.VIEWPORT===(c.partIndex===0?n:a)?(c.dxScreen=c.dxPixels,c.dyScreen=c.dyPixels):(c.dxScreen=t*(c.dxPixels+c.width/2)-e*(c.dyPixels+c.height/2)-c.width/2,c.dyScreen=e*(c.dxPixels+c.width/2)+t*(c.dyPixels+c.height/2)-c.height/2)}i.colliders.length>0&&d===i.colliders.length&&(i.unique.show=!1)}class qt{constructor(e,t,s,r,o,n){this._symbols=e,this._styleRepository=r,this._zoom=o,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new Ue(t,s,ct),this._si=Math.sin(Math.PI*n/180),this._co=Math.cos(Math.PI*n/180);for(const a of e)for(const l of a.symbols)this._allNeededMatrices.has(l.tile)||this._allNeededMatrices.set(l.tile,nt(l.tile.transforms.tileUnitsToPixels))}work(e){const t=this._gridIndex;function s(o){const n=o.xScreen+o.dxScreen,a=o.yScreen+o.dyScreen,l=n+o.width,h=a+o.height,[y,u,d,c]=t.getCellSpan(n,a,l,h);for(let _=u;_<=c;_++)for(let p=y;p<=d;p++){const f=t.cells[_][p];for(const g of f){const m=g.xScreen+g.dxScreen,b=g.yScreen+g.dyScreen,x=m+g.width,S=b+g.height;if(!(lx||hS))return!0}}return!1}const r=performance.now();for(;this._currentLayerCursore)return!1;const a=o.symbols[this._currentSymbolCursor];if(!a.unique.show)continue;Ht(a,this._si,this._co,n,this._allNeededMatrices.get(a.tile),this._zoom);const l=a.unique;if(!l.show)continue;const{iconAllowOverlap:h,iconIgnorePlacement:y,textAllowOverlap:u,textIgnorePlacement:d}=n;for(const c of a.colliders){if(!c.enabled)continue;const _=l.parts[c.partIndex];_.show&&!(c.partIndex?u:h)&&s(c)&&(c.hard?l.show=!1:_.show=!1)}if(l.show)for(const c of a.colliders){if(!c.enabled||(c.partIndex?d:y)||!l.parts[c.partIndex].show)continue;const _=c.xScreen+c.dxScreen,p=c.yScreen+c.dyScreen,f=_+c.width,g=p+c.height,[m,b,x,S]=this._gridIndex.getCellSpan(_,p,f,g);for(let w=b;w<=S;w++)for(let T=m;T<=x;T++)this._gridIndex.cells[w][T].push(c)}}}return!0}_getProperties(e){const t=this._styleProps.get(e);if(t)return t;const s=this._zoom,r=this._styleRepository.getStyleLayerByUID(e),o=r.getLayoutValue("symbol-placement",s)!==yt.POINT;let n=r.getLayoutValue("icon-rotation-alignment",s);n===L.AUTO&&(n=o?L.MAP:L.VIEWPORT);let a=r.getLayoutValue("text-rotation-alignment",s);a===L.AUTO&&(a=o?L.MAP:L.VIEWPORT);const l=r.getPaintValue("icon-translate",s),h=r.getPaintValue("icon-translate-anchor",s),y=r.getPaintValue("text-translate",s),u=r.getPaintValue("text-translate-anchor",s),d={iconAllowOverlap:r.getLayoutValue("icon-allow-overlap",s),iconIgnorePlacement:r.getLayoutValue("icon-ignore-placement",s),textAllowOverlap:r.getLayoutValue("text-allow-overlap",s),textIgnorePlacement:r.getLayoutValue("text-ignore-placement",s),iconRotationAlignment:n,textRotationAlignment:a,iconTranslateAnchor:h,iconTranslate:l,textTranslateAnchor:u,textTranslate:y};return this._styleProps.set(e,d),d}}function Bt(i,e){if(i.priority-e.priority)return i.priority-e.priority;const t=i.tile.key,s=e.tile.key;return t.world-s.world?t.world-s.world:t.level-s.level?t.level-s.level:t.row-s.row?t.row-s.row:t.col-s.col?t.col-s.col:i.xTile-e.xTile?i.xTile-e.xTile:i.yTile-e.yTile}let Nt=class{get running(){return this._running}constructor(i,e,t,s,r,o){this._visibleTiles=i,this._symbolRepository=e,this._createCollisionJob=t,this._assignTileSymbolsOpacity=s,this._symbolLayerSorter=r,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(i,e){this._screenWidth===i&&this._screenHeight===e||this.restart(),this._screenWidth=i,this._screenHeight=e}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(i){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const e=performance.now();if(!this._selectionJob.work(i)||(this._selectionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const e=performance.now();if(!this._collisionJob.work(i)||(this._collisionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const e=performance.now();if(!this._opacityJob.work(i)||(this._opacityJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const i=this._symbolRepository.uniqueSymbols;for(let a=0;aa)return!1;let c=null,_=!1,p=!1;for(const f of l.tileSymbols)if(!p||!_){const g=f.tile;(!c||g.isCoverage||g.neededForCoverage&&!_)&&(c=f,(g.neededForCoverage||g.isCoverage)&&(p=!0),g.isCoverage&&(_=!0))}if(c.selectedForRendering=!0,p){d.symbols.push(c),l.show=!0;for(const f of l.parts)f.show=!0}else l.show=!1}}for(const y of e)y.symbols.sort(Bt);return!0}const n=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return e.sort(n)}}}_createOpacityJob(){const i=this._assignTileSymbolsOpacity,e=this._visibleTiles;let t=0;function s(r,o){for(const n of r.symbols.values())Qt(n,o);i(r,o);for(const n of r.childrenTiles)s(n,o)}return{work(r){const o=performance.now();for(;tr)return!1;const n=e[t];n.parentTile==null&&s(n,performance.now())}return!0}}}};function Qt(i,e){for(const t of i){const s=t.unique;for(const r of s.parts){const o=r.targetOpacity>.5?1:-1;r.startOpacity+=o*((e-r.startTime)/W),r.startOpacity=Math.min(Math.max(r.startOpacity,0),1),r.startTime=e,r.targetOpacity=s.show&&r.show?1:0}}}const Wt=32,$t=8,Jt=64,Kt=20;class Gt{constructor(e,t,s){this.tileCoordRange=e,this._visibleTiles=t,this._createUnique=s,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(e,t){this._uniqueSymbolLayerArray=null;let s=this._tiles.get(e.id);s||(s={symbols:new Map},this._tiles.set(e.id,s));const r=new Map;if(t)for(const a of t)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));else for(const[a,l]of e.layerData)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));this._removeSymbols(r);const o=e.symbols,n=new Map;for(const[a,l]of o){let h=l.length;if(h>=Wt){let y=this.tileCoordRange;do y/=2,h/=4;while(h>$t&&y>Jt);const u=new Ue(this.tileCoordRange,this.tileCoordRange,y);n.set(a,{flat:l,index:u}),s.symbols.set(a,{flat:l,index:u});for(const d of l)u.getCell(d.xTile,d.yTile).push(d)}else n.set(a,{flat:l}),s.symbols.set(a,{flat:l})}this._addSymbols(e.key,o)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[t,s]of this._tiles){const r=new Map;for(const o of e)s.symbols.has(o)&&(r.set(o,s.symbols.get(o)),s.symbols.delete(o));this._removeSymbols(r),s.symbols.size===0&&this._tiles.delete(t)}}removeTile(e){this._uniqueSymbolLayerArray=null;const t=this._tiles.get(e.id);if(!t)return;const s=new Map;for(const[r,o]of e.symbols)t.symbols.has(r)&&(s.set(r,t.symbols.get(r)),t.symbols.delete(r));this._removeSymbols(s),t.symbols.size===0&&this._tiles.delete(e.id)}querySymbols(e,t,s,r){const o=[],n=this.uniqueSymbols;for(const a of n){const l=a.styleLayerUID,h=a.uniqueSymbols;for(const y of h){const u=y.tileSymbols.find(d=>d.selectedForRendering);u&&kt(u,e,t*(window.devicePixelRatio||1),s)&&o.push({vtlSymbol:u,styleLayerUID:l,tileKey:u.tile.key})}}return o}_removeSymbols(e){for(const[t,{flat:s}]of e)for(const r of s){const o=r.unique,n=o.tileSymbols,a=n.length-1;for(let l=0;lt.level){const o=e.key.level-t.level;if(e.key.row>>o!==t.row||e.key.col>>o!==t.col)return}if(t.level>e.key.level){const o=t.level-e.key.level;if(t.row>>o!==e.key.row||t.col>>o!==e.key.col)return}if(t.equals(e.key)){for(const o of e.childrenTiles)this._matchSymbols(o,t,s);return}const r=new Map;for(const[o,n]of s){const a=[];for(const u of n){const d=Se(this.tileCoordRange,u.xTile,t.level,t.col,e.key.level,e.key.col),c=Se(this.tileCoordRange,u.yTile,t.level,t.row,e.key.level,e.key.row);d>=0&&d=0&&c0&&r.set(o,l)}for(const o of e.childrenTiles)this._matchSymbols(o,t,r)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,t=new Array(e.size);let s,r=0;for(const[o,n]of e){const a=new Array(n.size);s=0;for(const l of n)a[s++]=l;t[r]={styleLayerUID:o,uniqueSymbols:a},r++}return t}}const Yt=.5,xe=1e-6;class jt{constructor(e,t){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._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=ut(!1),this._symbolRepository=new Gt(4096,t,()=>new Pt),this._symbolDeclutterer=new Nt(t,this._symbolRepository,(s,r,o)=>this._createCollisionJob(s,r,o),(s,r)=>{s.allSymbolsFadingOut=!0,s.lastOpacityUpdate=r,Lt(s,r,!0),s.decluttered=!0,s.requestRender()},(s,r)=>this.styleRepository.getStyleLayerByUID(s.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(r.styleLayerUID).z,s=>{const r=this.styleRepository.getStyleLayerByUID(s);if(this._zoom+xe=r.maxzoom)return!1;const o=r.getLayoutProperty("visibility");return!o||o.getValue()!==Z.NONE})}get symbolRepository(){return this._symbolRepository}_createCollisionJob(e,t,s){return this.updateDecluttererViewState(),new qt(e,t,s,this.styleRepository,this._zoom,this._viewState.rotation)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}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 t=this._tileToHandle.get(e);t&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),t.remove(),this._tileToHandle.delete(e))}update(e,t){this._zoom=e,this._viewState={scale:t.scale,rotation:t.rotation,center:[t.center[0],t.center[1]],size:[t.size[0],t.size[1]]};const s=[0,0];t.toScreen(s,t.center);const r=[0,0];return t.toScreen(r,this._declutterViewState.center),this._offsetFromScreenCenter[0]=s[0]-r[0],this._offsetFromScreenCenter[1]=s[1]-r[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.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(ht),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){this._stableNotificationHandle!=null&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this._fading.value=!1},(1+Yt)*W)}_notifyUnstable(){this._stableNotificationHandle!=null&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){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._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}}let Xt=class extends Le{_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}};const $=1e-6;function Ie(i,e){if(i){const t=i.getLayoutProperty("visibility");if(!t||t.getValue()!==Z.NONE&&(i.minzoom===void 0||i.minzoom=e-$))return!0}return!1}let Zt=class extends _t{constructor(i){super(i),this._backgroundTiles=[],this._computeDisplayInfoView(i)}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(i,e,t,s){this._spriteMosaic=i,this._glyphMosaic=e,this._styleRepository=t,this.tileInfoView=s,this._computeDisplayInfoView(s),this._symbolFader==null&&(this._symbolFader=new jt(this._styleRepository,this.children)),this._symbolFader.styleRepository=t}setSpriteMosaic(i){this._spriteMosaic?.dispose(),this._spriteMosaic=i}deleteStyleLayers(i){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(i)}createRenderParams(i){return{...super.createRenderParams(i),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(i){!this.visible||i.drawPhase!==N.MAP&&i.drawPhase!==N.DEBUG||this._spriteMosaic===void 0||super.doRender(i)}addChild(i){return super.addChild(i),this._symbolFader!=null?this._symbolFader.addTile(i):i.decluttered=!0,this.requestRender(),i}removeChild(i){return this._symbolFader!=null&&this._symbolFader.removeTile(i),this.requestRender(),super.removeChild(i)}renderChildren(i){const{drawPhase:e}=i;e!==N.DEBUG?this._doRender(i):super.renderChildren(i)}removeAllChildren(){for(let i=0;ii.neededForCoverage&&i.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(i){const{context:e,state:t}=i,s=this._styleRepository;if(!s)return;const r=s.layers,o=this._displayInfo.scaleToZoom(t.scale);s.backgroundBucketIds.length>0&&(i.renderPass="background",this._renderBackgroundLayers(i,s.backgroundBucketIds,o)),super.renderChildren(i),i.drawPhase===N.MAP&&this._fade(o,t);const n=this.children.filter(a=>a.visible&&a.hasData());if(!n||n.length===0)return e.bindVAO(),e.setStencilTestEnabled(!0),void e.setBlendingEnabled(!0);for(const a of n)a.triangleCount=0;e.setStencilWriteMask(0),e.setColorMask(!0,!0,!0,!0),e.setStencilOp(O.KEEP,O.KEEP,O.REPLACE),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setDepthTestEnabled(!0),e.setDepthWriteEnabled(!0),e.setDepthFunction(ce.LEQUAL),e.setClearDepth(1),e.clear(e.gl.DEPTH_BUFFER_BIT),i.renderPass="opaque";for(let a=r.length-1;a>=0;a--)this._renderStyleLayer(r[a],i,n);e.setDepthWriteEnabled(!1),e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(B.ONE,B.ONE_MINUS_SRC_ALPHA,B.ONE,B.ONE_MINUS_SRC_ALPHA),i.renderPass="translucent";for(let a=0;ah.decluttered):t.filter(h=>h.neededForCoverage),a!=="vtlSymbol"&&(t.length===0||i.minzoom!==void 0&&i.minzoom>=s+$||i.maxzoom!==void 0&&i.maxzoom{const t=i.vtlSymbol.sourceTile,s=e.vtlSymbol.sourceTile;return t.level!==s.level?t.level-s.level:t.row!==s.row?t.row-s.row:t.col!==s.col?t.col-s.col:i.styleLayerUID-e.styleLayerUID};class ee{constructor(e,t,s,r,o){this.tileKey=e,this._tileLayerData=t,this._styleRepository=s,this._tileHandler=r,this._parentLayer=o,this._index=null,this._tileKeyToPBF=new Map}static create(e,t,s,r,o){return new ee(e,t,s,r,o)}clear(){this._index?.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,t,s,r,o){if(this._tileLayerData.size===0||!this._styleRepository||!this._tileHandler)return[];this._index===null&&(this._index=new pt(100,is),await this._indexLayers());const n=[];return this._queryIndex(n,e,t,s,this.tileKey.level,r),o&&o?.length>0&&await this._getSymbolsAttributes(n,o),n}async _indexLayers(){const e=this.tileKey,t=this._styleRepository.layers,s=await this._getTilePayload(e);for(const[r,o]of this._tileLayerData){const n=t[r],a=s.find(y=>y.sourceName===n.source);if(!a)continue;const{protobuff:l,key:h}=a;if(o.type!==R.SYMBOL){const y=1<=10*y||re&&re<=10*h)continue;const v=e.getFeatureInflatedBounds(q,h,_.extent,S);v==null||v[0]>b||v[1]>x||v[2]u.sourceName===a.source),l&&this._addSymbolsAttributes(e,t.slice(h.from,h.to).map(u=>u.vtlSymbol),r,l)}return e}_addSymbolsAttributes(e,t,s,r){const o=this._styleRepository.layers,n=r.key,a=this.tileKey,l=1<{const{attributes:d,tilePoint:c}=u;e.push({layerId:o[s].id,layerIndex:s,graphic:new le({attributes:d,origin:{type:"vector-tile",layerId:o[s].id,layerIndex:s,layer:this._parentLayer}}),tilePoint:c})})}_getSymbolAttributes(e,t,s,r,o,n){const a=[],l=this._styleRepository.layers;let h=0;t.sort((u,d)=>u.featureIndex-d.featureIndex);const y=new X(new Uint8Array(e),new DataView(e));for(;y.next();)switch(y.tag()){case 3:{const u=y.getMessage(),d=new ye(u);if(u.release(),d.name!==l[s].sourceLayer)continue;const c=d.getData(),_=d.extent/r,p=Te/_,f=_*n,g=_*o;let m=0;for(;c.nextTag(2);){const b=c.getMessage();if(m++===t[h].featureIndex){const x=new de(b,d),S=x.values,w=x.getGeometry(),T=w!=null?[p*(w[0][0].x-f),p*(w[0][0].y-g)]:null;a.push({attributes:S,tilePoint:T}),h++}if(b.release(),h===t.length)return a}break}default:y.skip()}return a}_queryIndex(e,t,s,r,o,n){const a=es*r*(window.devicePixelRatio||1);return this._index?.search({minX:t-a,minY:s-a,maxX:t+a,maxY:s+a},l=>{const{layer:h,feature:y}=l;h.isIntersectingFeature(t,s,r,y,o,n,l)&&e.push({layerId:h.id,layerIndex:h.uid,tilePoint:null,graphic:new le({attributes:y.values,origin:{type:"vector-tile",layerId:l.layer.id,layerIndex:l.layer.uid,layer:this._parentLayer}})})}),e}async _getTilePayload(e){return Je(this._tileKeyToPBF,e.id,()=>this._tileHandler.fetchTilePBFs(e)).then(t=>t)}}const is=i=>({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]});class ve extends tt{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const t=A.pool.acquire(e),s=t.level===0?null:A.getId(t.level-1,t.row>>1,t.col>>1,t.world);return A.pool.release(t),s}getTileCoverage(e,t,s=!0,r){const o=super.getTileCoverage(e,t,s,r);if(!o)return o;const n=1<a.row>=0&&a.rowt[0].scale)return t[0].level;let s,r;for(let o=0;or.scale)return s=t[o],s.level+(s.scale-e)/(s.scale-r.scale);return t[t.length-1].level}}_initializeFullCacheLODs(e){let t;if(e[0].level===0)t=e.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}));else{const s=this.tileInfo.size[0],r=this.tileInfo.spatialReference;t=Oe.create({size:s,spatialReference:r}).lods.map(o=>({level:o.level,resolution:o.resolution,scale:o.scale}))}for(let s=0;su.tileKey.id===y.id)));return await Promise.all(l),h}update(i){if(this._tileHandlerPromise&&this._isTileHandlerReady)return i.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=i.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=i.state,this._parseQueue.state=i.state,this._tileManager.update(i)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:i}=this.layer.currentStyleInfo;this._styleRepository=new _e(i),this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new Zt(this._tileInfoView),this._tileHandler=new It(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:I.PAINTER_CHANGED,data:e}),this.requestUpdate();else{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;const r=s.type===C.SYMBOL;t.setPaintProperties(e.layer,e.paint),r&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;this._styeChanged=!0;const r=Ge(s.layout,e.layout);if(r!=null){if(Ye(r,"visibility")&&rs(r)===1)return t.setLayoutProperties(e.layer,e.layout),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:I.LAYOUT_CHANGED,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);s&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:I.LAYER_CHANGED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:I.LAYER_REMOVED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:I.SPRITES_CHANGED,data:e});const t=this._styleRepository.layers;for(const s of t)switch(s.type){case C.SYMBOL:s.getLayoutProperty("icon-image")&&this._styleChanges.push({type:I.LAYOUT_CHANGED,data:{layer:s.id,layout:s.layout}});break;case C.LINE:s.getPaintProperty("line-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}});break;case C.FILL:s.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=V(this._vectorTileContainer),this._tileHandler=V(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(i){return Ve(this.layer.tileInfo?.spatialReference,i)}canResume(){let i=super.canResume();const{currentStyleInfo:e}=this.layer;if(i&&e?.layerDefinition){const t=this.view.scale,{minScale:s,maxScale:r}=e.layerDefinition;e?.layerDefinition&&(s&&st&&(i=!1))}return i}isUpdating(){return this.fading}acquireTile(i){const e=this._createVectorTile(i);return this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>this._parseQueue.push({key:e.key,data:t})).then(t=>{e.once("attach",()=>this.requestUpdate()),e.setData(t),this.requestUpdate()}).catch(t=>{j(t)||K.getLogger(this).error(t)})),e}releaseTile(i){const e=i.key.id;this._fetchQueue.abort(e),this._parseQueue.abort(e),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const i=this._vectorTileContainer.children,e=[];try{for(const t of i){const s=this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then(r=>this._parseQueue.push({key:t.key,data:r})).then(r=>t.setData(r)).finally(()=>t.featureIndex=null));e.push(s)}await Promise.all(e)}catch(t){K.getLogger(this).error("error refreshing vector-tiles layer-view",t),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new we({acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const i=new AbortController,e=this._tileHandler.start({signal:i.signal}).then(()=>{this._fetchQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._getTileData(t,s),concurrency:15,scheduler:this.scheduler,priority:pe.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._parseTileData(t,s),concurrency:8,scheduler:this.scheduler,priority:pe.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(t=>{this._vectorTileContainer.setStyleResources(t,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=i,this._tileHandlerPromise=e}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const i=this._tileHandlerAbortController;i&&i.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=V(this._fetchQueue),this._parseQueue=V(this._parseQueue),this._tileManager=V(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(i,e){return this._tileHandler.fetchTileData(i,e)}async _parseTileData(i,e){return this._tileHandler.parseTileData(i,e)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const i=this._styleChanges;try{await this._tileHandler.updateStyle(i)}catch(o){K.getLogger(this).error("error applying vector-tiles style update",o.message),this._resumeQueues(),this._isTileHandlerReady=!0}const e=this._styleRepository,t=new Set;i.forEach(o=>{if(o.type!==I.LAYER_REMOVED)return;const n=o.data,a=e.getLayerById(n.layer);a&&t.add(a.uid)});const s=new Set;i.forEach(o=>{let n;switch(o.type){case I.PAINTER_CHANGED:e.setPaintProperties(o.data.layer,o.data.paint),n=o.data.layer;break;case I.LAYOUT_CHANGED:e.setLayoutProperties(o.data.layer,o.data.layout),n=o.data.layer;break;case I.LAYER_REMOVED:return void e.deleteStyleLayer(o.data.layer);case I.LAYER_CHANGED:e.setStyleLayer(o.data.layer,o.data.index),n=o.data.layer.id;break;case I.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(o.data.spriteSource))}if(n){const a=e.getLayerById(n);a&&s.add(a.uid)}});const r=this._vectorTileContainer.children;if(t.size>0){const o=Array.from(t);this._vectorTileContainer.deleteStyleLayers(o);for(const n of r)n.deleteLayerData(o)}if(this._resumeQueues(),s.size>0){const o=Array.from(s),n=[];for(const a of r){const l=this._updatingHandles.addPromise(this._fetchQueue.push(a.key).then(h=>this._parseQueue.push({key:a.key,data:h,styleLayerUIDs:o})).then(h=>a.setData(h)).finally(()=>a.featureIndex=null));n.push(l)}await Promise.all(n)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:i}=this.layer.currentStyleInfo,e=ze(i);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new _e(e),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:t}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,e,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(o){if(!j(o))throw o}if(t.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const s=await this._tileHandler.spriteMosaic,r=this._vectorTileContainer;this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),r.setStyleResources(s,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new we({acquireTile:o=>this.acquireTile(o),releaseTile:o=>this.releaseTile(o),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(i){const e=this._tileInfoView.getTileBounds(H(),i),t=this._tileInfoView.getTileResolution(i.level);return new Ft(i,t,e[0],e[3],512,512,this._styleRepository)}async _queryTile(i,e,t,s,r,o){if(r.layerData.size===0)return;const n=this._ensureTileIndex(r),a=this._tileInfoView.getTileBounds(H(),r.key,!0),l=Ce*De*((e.x-a[0])/(a[2]-a[0])),h=Ce*De*(1-(e.y-a[1])/(a[3]-a[1])),y=await n.queryAttributes(l,h,t,s,o);for(const u of y)u.graphic.geometry=this._tileToMapPoint(u.tilePoint,r.transforms.tileUnitsToPixels),i.push({type:"graphic",layer:this.layer,graphic:u.graphic,mapPoint:e.clone()});i.sort((u,d)=>d.graphic.origin.layerIndex-u.graphic.origin.layerIndex)}_tileToMapPoint(i,e){if(!i)return null;const t=i[0]*e[0]+i[1]*e[3]+e[6],s=i[0]*e[1]+i[1]*e[4]+e[7],r=this.view.state,o=[0,0];return r.toMap(o,[t,s]),new Fe({x:o[0],y:o[1],spatialReference:r.spatialReference})}_ensureTileIndex(i){let e=i.featureIndex;return e||(e=ee.create(i.key,i.layerData,this._styleRepository,this._tileHandler,this.layer),i.featureIndex=e),e}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function rs(i){if(i==null)return 0;switch(i.type){case"partial":return Object.keys(i.diff).length;case"complete":return Math.max(Object.keys(i.oldValue).length,Object.keys(i.newValue).length);case"collection":return Object.keys(i.added).length+Object.keys(i.changed).length+Object.keys(i.removed).length}}oe([He()],Q.prototype,"_isTileHandlerReady",void 0),Q=oe([qe("esri.views.2d.layers.VectorTileLayerView2D")],Q);const Ni=Q;export{Ni as default}; +import{aA as V,aC as Ve,aU as j,a1 as K,P as ze,bh as H,w as Fe,v as oe,S as He,i as qe,aW as Be,y as ne,bt as Ne,W as Qe,iF as ae,cf as We,ht as $e,bi as le,an as Je,f as Ke,hT as k,d1 as he}from"./story-Doly9N9p.js";import{P as Ge,g as Ye}from"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import{C as I,I as R}from"./enums-qHpGJ28Q-CmnLAccm.js";import{q as je}from"./workers-PiCjreoO-Dc6Tqm-o.js";import{a as P}from"./Rect-DD6XS68q-D_hsV3ag.js";import{D as O,L as ce,A as B,U as Xe,G as Me,n as D}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as Re,V as Pe}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{o as X}from"./pbf-D-y3_eZO-CpHdkhuD.js";import{k as Ze}from"./rasterizingUtils-BmlDdKBf-BP52xgN-.js";import{s as A}from"./TileKey-C5IL-JBr-BGwa3-Dg.js";import{b as et}from"./LRUCache-C3erQTWv-grHgYSP-.js";import{$ as ue,k as Ae,Q as tt}from"./Tile-D75RMC64-g8Sx5TPr.js";import{R as st,C as it,D as rt,G as ot}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as z,E as N,c as nt}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{j as at,Q as lt}from"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import{r as M}from"./BufferObject-BM_7mcDb-EYaqMhmk.js";import{c as U}from"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import{e as W,c as ht,t as ct}from"./config-nuMERBvb-MDUrh2eL.js";import{K as Le}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{V as Oe}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import{o as ut}from"./signal-CETehA7D-DQA5V72u.js";import{p as C,a as Z,u as yt,n as L,i as dt}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{h as _t}from"./TileContainer-D48pXXgL-BzDz3Uqo.js";import{N as pt}from"./PooledRBush-DbfAmeLn-CPHfm9op.js";import{g as ye,f as de}from"./SourceLayerData-BT_Ywuvg-D7mjpcmo.js";import{a as _e,K as ft}from"./StyleRepository-D3WuVprR-B1BVbhGB.js";import{X as gt,Y as mt}from"./LayerView-Bish-E63-DK1SFHE3.js";import{n as bt}from"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";import{i as pe}from"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./main-QGPoLsvl.js";import"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";let F=class{constructor(i,e){this._width=0,this._height=0,this._free=[],this._width=i,this._height=e,this._free.push(new P(0,0,i,e))}get width(){return this._width}get height(){return this._height}allocate(i,e){if(i>this._width||e>this._height)return new P;let t=null,s=-1;for(let r=0;ri&&this._free.push(new P(t.x+i,t.y,t.width-i,e)),t.height>e&&this._free.push(new P(t.x,t.y+e,t.width,t.height-e))):(t.width>i&&this._free.push(new P(t.x+i,t.y,t.width-i,t.height)),t.height>e&&this._free.push(new P(t.x,t.y+e,i,t.height-e))),new P(t.x,t.y,i,e))}release(i){for(let e=0;e{const l=i+a;if(this._rangePromises.has(l))n.push(this._rangePromises.get(l));else{const h=s.getRange(i,a).then(()=>{this._rangePromises.delete(l)},()=>{this._rangePromises.delete(l)});this._rangePromises.set(l,h),n.push(h)}}),Promise.all(n).then(()=>{let a=this._glyphIndex[i];a||(a={},this._glyphIndex[i]=a);for(const l of e){const h=a[l];if(h){t[l]={sdf:!0,rect:h.rect,metrics:h.metrics,page:h.page,code:l};continue}const y=s.getGlyph(i,l);if(!y?.metrics)continue;const u=y.metrics;let d;if(u.width===0)d=new P(0,0,0,0);else{const c=u.width+6,_=u.height+2*3;let p=c%4?4-c%4:4,f=_%4?4-_%4:4;p===1&&(p=5),f===1&&(f=5),d=this._binPack.allocate(c+p,_+f),d.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 F(this.width-4,this.height-4),d=this._binPack.allocate(c+p,_+f));const g=this._glyphData[this._currentPage],m=y.bitmap;let b,x;if(m)for(let S=0;S<_;S++){b=c*S,x=this.width*(d.y+S+1)+d.x;for(let w=0;w{t.addRange(e,new G(new X(new Uint8Array(n.data),new DataView(n.data))))}).catch(()=>{t.addRange(e,new G)})}return t.addRange(e,new G),Promise.resolve()}getGlyph(i,e){const t=this._getFontStack(i);if(!t)return;const s=Math.floor(e/256),r=t.getRange(s);return r?{metrics:r.getMetrics(e),bitmap:r.getBitmap(e)}:void 0}_getFontStack(i){let e=this._glyphInfo[i];return e||(e=this._glyphInfo[i]=new wt),e}},St=class{constructor(i,e,t){this._array=i,this._start=e,this.length=t}at(i){return 0<=i&&i0&&(this._maxItemSize=s),this._binPack=new F(e-4,t-4)}destroy(){this.dispose()}dispose(){this._binPack=null,this._mosaicsData.length=0,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 F(this._pageWidth-4,this._pageHeight-4);const t=Math.floor(this._pageWidth),s=Math.floor(this._pageHeight),r=new Uint32Array(t*s);this._mosaicsData[0]=r,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,t=!1){let s,r,o=this._mosaicRects[e];if(o)return o;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(xt)?([s,r]=this._rasterizeDash(e),t=!0):s=this._sprites.getSpriteInfo(e),!s?.width||!s.height||s.width<0||s.height<0))return null;const n=s.width,a=s.height,[l,h,y]=this._allocateImage(n,a);return l.width<=0?null:(this._copy(l,s,h,y,t,r),o={type:"sprite",rect:l,width:n,height:a,sdf:s.sdf,simplePattern:!1,rasterizationScale:s.pixelRatio,page:h},this._mosaicRects[e]=o,o)}getSpriteItems(e){const t={};for(const s of e)t[s.name]=this.getSpriteItem(s.name,s.repeat);return t}getMosaicItemPosition(e,t){const s=this.getSpriteItem(e,t),r=s?.rect;if(!r)return null;r.width=s.width,r.height=s.height;const o=s.width,n=s.height,a=2;return{tl:[r.x+a,r.y+a],br:[r.x+a+o,r.y+a+n],page:s.page}}bind(e,t,s=0,r=0){if(s>=this._size.length||s>=this._mosaicsData.length)return;if(!this._textures[s]){const n=new Re;n.wrapMode=Me.CLAMP_TO_EDGE,n.width=this._size[s][0],n.height=this._size[s][1],this._textures[s]=new Pe(e,n,new Uint8Array(this._mosaicsData[s].buffer))}const o=this._textures[s];o.setSamplingMode(t),this._dirties[s]&&o.setData(new Uint8Array(this._mosaicsData[s].buffer)),e.bindTexture(o,r),this._dirties[s]=!1}static _copyBits(e,t,s,r,o,n,a,l,h,y,u){let d=r*t+s,c=l*n+a;if(u){c-=n;for(let _=-1;_<=y;_++,d=((_+y)%y+r)*t+s,c+=n)for(let p=-1;p<=h;p++)o[c+p]=e[d+(p+h)%h]}else for(let _=0;_=this._mosaicsData.length)return;const a=new Uint32Array(n?n.buffer:this._sprites.image.buffer),l=this._mosaicsData[s],h=2,y=n?t.width:this._sprites.width;ke._copyBits(a,y,t.x,t.y,l,r[0],e.x+h,e.y+h,t.width,t.height,o),this._dirties[s]=!0}_allocateImage(e,t){e+=2,t+=2;const s=Math.max(e,t);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(i){this._requestSprite(i);const e=this._layer.currentStyleInfo.glyphsUrl,t=new ge(e?ne(e,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new fe(1024,1024,t),this._broadcastPromise=je("WorkerTileHandler",{client:this,schedule:i.schedule,signal:i.signal}).then(s=>{if(this._layer&&(this._connection?.close(),this._connection=s,this._layer&&!this._connection.closed)){const r=s.broadcast("setStyle",{style:this._layer.currentStyleInfo.style,sourceDataMaxLOD:this._sourceDataMaxLOD},i);Promise.all(r).catch(o=>Ne(o))}})}_requestSprite(i){this._spriteSourceAbortController?.abort();const e=new AbortController;this._spriteSourceAbortController=e;const t=i?.signal;this._inputSignalEventListener&&this._startOptionsInputSignal?.removeEventListener("abort",this._inputSignalEventListener),this._startOptionsInputSignal=null,t&&(this._inputSignalEventListener=Tt(e),t.addEventListener("abort",this._inputSignalEventListener,{once:!0}));const{signal:s}=e,r={...i,signal:s};this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,r),this._spriteSourcePromise.then(o=>{Qe(s),this._spriteMosaic=new me(1024,1024,250),this._spriteMosaic.setSpriteSource(o)})}async updateStyle(i){const e=[];for(const t of i)t.type===I.SPRITES_CHANGED?e.push({type:I.SPRITES_CHANGED,data:{spriteSource:null}}):e.push(t);return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(i){const e=new me(1024,1024,250);return e.setSpriteSource(i),this._spriteMosaic=e,this._spriteSourcePromise=Promise.resolve(i),this._spriteSourceAbortController=null,e}async setStyle(i,e,t){await this._broadcastPromise,this._styleRepository=i,this._sourceDataMaxLOD=t,this._requestSprite();const s=new ge(this._layer.currentStyleInfo.glyphsUrl?ne(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new fe(1024,1024,s),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",{style:e,sourceDataMaxLOD:this._sourceDataMaxLOD})),this._broadcastPromise}async fetchTileData(i,e){const t=await this._getRefKeys(i,e);return this._getSourcesData(Object.keys(this._layer.sourceNameToSource),t,e)}async fetchTilePBFs(i){const e=Object.keys(this._layer.sourceNameToSource),t={},s=await this._getRefKeys(i,t),r=[],o=[];for(let n=0;n{r.push({...h,key:a})}),o.push(l)}return Promise.all(o).then(()=>r)}async parseTileData(i,e){const t=i&&i.data;if(!t)return null;const{sourceName2DataAndRefKey:s,transferList:r}=t;return Object.keys(s).length===0?null:this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:i.key.id,sourceName2DataAndRefKey:s,styleLayerUIDs:i.styleLayerUIDs},{...e,transferList:r}))}async getSprites(i){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(i)}getGlyphs(i){return this._glyphMosaic.getGlyphItems(i.font,i.codePoints)}async _getTilePayload(i,e,t){const s=A.pool.acquire(i.id),r=this._layer.sourceNameToSource[e],{level:o,row:n,col:a}=s;A.pool.release(s);try{return{protobuff:await r.requestTile(o,n,a,t),sourceName:e}}catch(l){if(j(l))throw l;return{protobuff:null,sourceName:e}}}async _getRefKeys(i,e){const t=this._layer.sourceNameToSource,s=new Array;for(const r in t){const o=t[r].getRefKey(i,e);s.push(o)}return ae(s)}_getSourcesData(i,e,t){const s=[];for(let r=0;r{const o={},n=[];for(let a=0;a0){const h=e[a].value.id;o[l.sourceName]={refKey:h,protobuff:l.protobuff},n.push(l.protobuff)}}return{sourceName2DataAndRefKey:o,transferList:n}})}};function Tt(i){return()=>i.abort()}const be=512,vt=1e-6,Ct=(i,e)=>i+1/(1<<2*e);let we=class{constructor(i,e){this._tiles=new Map,this._tileCache=new et(40,t=>t.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=i.acquireTile,this.releaseTile=i.releaseTile,this.tileInfoView=i.tileInfoView,this._container=e}destroy(){for(const i of this._tiles.values())i.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(i){this._updateCacheSize(i);const e=this.tileInfoView,t=e.getTileCoverage(i.state,0,!0,"smallest");if(!t)return!0;const{spans:s,lodInfo:r}=t,{level:o}=r,n=this._tiles,a=new Set,l=new Set;for(const{row:y,colFrom:u,colTo:d}of s)for(let c=u;c<=d;c++){const _=A.getId(o,y,r.normalizeCol(c),r.getWorldForColumn(c)),p=this._getOrAcquireTile(_);a.add(_),p.processed()?this._addToContainer(p):l.add(new A(_))}for(const[y,u]of n)u.isCoverage=a.has(y);for(const y of l)this._findPlaceholdersForMissingTiles(y,a);let h=!1;for(const[y,u]of n)u.neededForCoverage=a.has(y),u.neededForCoverage||u.isHoldingForFade&&e.intersects(t,u.key)&&a.add(y),u.isFading&&(h=!0);for(const y of this._tiles.keys())a.has(y)||this._releaseTile(y);return Ae.pool.release(t),!h}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}getIntersectingTiles(i,e,t,s,r){const o=[0,0],n=[0,0];s.toMap(o,i-t,e+t),s.toMap(n,i+t,e-t);const a=Math.min(o[0],n[0]),l=Math.min(o[1],n[1]),h=Math.max(o[0],n[0]),y=Math.max(o[1],n[1]),u=We(a,l,h,y),d=H(),c=[];for(const _ of this._visibleTiles.values())this.tileInfoView.getTileBounds(d,_.key),$e(u,d)&&c.push(_);if(r!=null&&r.length>0){const _=new Set(c.map(f=>f.id)),p=r.filter(f=>!_.has(f.tileKey.id)).map(f=>this._visibleTiles.get(f.tileKey.id)).filter(f=>f!==void 0);c.push(...p)}return c}_findPlaceholdersForMissingTiles(i,e){const t=[];for(const r of this._tiles.values())this._addPlaceholderChild(t,r,i,e);const s=t.reduce(Ct,0);Math.abs(1-s)0;){if(s--,r>>=1,o>>=1,t.level===s&&t.row===r&&t.col===o&&t.world===n)return!0;if(a.has(`${s}/${r}/${o}/${n}`))return!1}return!1}_updateCacheSize(i){const e=i.state.size;if(e[0]===this._viewSize[0]&&e[1]===this._viewSize[1])return;const t=Math.ceil(e[0]/be)+1,s=Math.ceil(e[1]/be)+1;this._viewSize[0]=e[0],this._viewSize[1]=e[1],this._tileCache.maxSize=5*t*s}};function Dt(i){const[e,t,s,r]=i.split("/"),o=parseInt(e,10);return o===0?null:`${o-1}/${parseInt(t,10)>>1}/${parseInt(s,10)>>1}/${parseInt(r,10)}`}function Mt(i,e){const t=e.level-i.level;return i.row===e.row>>t&&i.col===e.col>>t&&i.world===e.world}let Rt=class{constructor(i,e){this.sourceTile=e,this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.featureIndex=0,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=i}};class Pt{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 Se(i,e,t,s,r,o){const n=t-r;if(n>=0)return(e>>n)+(s-(o<>n);const a=-n;return e-(o-(s<>a)<0){this.patternMap=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.lineMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}};class Et extends J{constructor(e,t){super(e,t),this.type=R.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const s=new Uint32Array(e);let r=this.bufferDataOffset;this.fillIndexStart=s[r++],this.fillIndexCount=s[r++],this.outlineIndexStart=s[r++],this.outlineIndexCount=s[r++];const o=s[r++];if(o>0){this.patternMap=new Map;for(let n=0;n0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){this.fillVAO=k(this.fillVAO),this.outlineVAO=k(this.outlineVAO)}doPrepareForRendering(e,t,s){const r=new Uint32Array(t),o=new Int32Array(r.buffer),n=r[s++],a=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,n));s+=n;const l=r[s++],h=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,l));s+=l;const y=r[s++],u=M.createVertex(e,D.STATIC_DRAW,new Int32Array(o.buffer,4*s,y));s+=y;const d=r[s++],c=M.createIndex(e,D.STATIC_DRAW,new Uint32Array(r.buffer,4*s,d));s+=d;const _=this.layer,p=_.fillMaterial,f=_.outlineMaterial;this.fillVAO=new U(e,p.getAttributeLocations(),p.getLayoutInfo(),new Map([["geometry",a]]),h),this.outlineVAO=new U(e,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",u]]),c)}}let Vt=class extends J{constructor(i,e,t){super(i,e),this.type=R.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const s=new Uint32Array(i),r=new Int32Array(i),o=new Float32Array(i);let n=this.bufferDataOffset;this.isIconSDF=!!s[n++];const a=s[n++],l=s[n++],h=s[n++],y=new A(a,l,h,0),u=s[n++];for(let p=0;p0||this.glyphPerPageElementsMap.size>0}triangleCount(){let i=0;for(const e of this.iconPerPageElementsMap.values())i+=e[1];for(const e of this.glyphPerPageElementsMap.values())i+=e[1];return i/3}doDestroy(){this.iconVAO=k(this.iconVAO),this.textVAO=k(this.textVAO)}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const i=this.iconOpacity,e=this.iconVAO.vertexBuffers.get("opacity");i.length>0&&i.byteLength===e.usedMemory&&e.setSubData(i,0,0,i.length);const t=this.textOpacity,s=this.textVAO.vertexBuffers.get("opacity");t.length>0&&t.byteLength===s.usedMemory&&s.setSubData(t,0,0,t.length)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=s[t++],y=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,h));t+=h;const u=s[t++],d=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,u));t+=u;const c=M.createVertex(i,D.STATIC_DRAW,this.iconOpacity.buffer),_=M.createVertex(i,D.STATIC_DRAW,this.textOpacity.buffer),p=this.layer,f=p.iconMaterial,g=p.textMaterial;this.iconVAO=new U(i,f.getAttributeLocations(),f.getLayoutInfo(),new Map([["geometry",n],["opacity",c]]),l),this.textVAO=new U(i,g.getAttributeLocations(),g.getLayoutInfo(),new Map([["geometry",y],["opacity",_]]),d)}},zt=class extends J{constructor(i,e){super(i,e),this.type=R.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const t=new Uint32Array(i);let s=this.bufferDataOffset;this.circleIndexStart=t[s++],this.circleIndexCount=t[s++],this.bufferDataOffset=s}get usedMemory(){return(this.data?.byteLength??0)+(this.vao?.usedMemory??0)}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){this.vao=k(this.vao)}doPrepareForRendering(i,e,t){const s=new Uint32Array(e),r=new Int32Array(s.buffer),o=s[t++],n=M.createVertex(i,D.STATIC_DRAW,new Int32Array(r.buffer,4*t,o));t+=o;const a=s[t++],l=M.createIndex(i,D.STATIC_DRAW,new Uint32Array(s.buffer,4*t,a));t+=a;const h=this.layer.circleMaterial;this.vao=new U(i,h.getAttributeLocations(),h.getLayoutInfo(),new Map([["geometry",n]]),l)}},Ft=class Ee extends Le{constructor(e,t,s,r,o,n,a,l=null){super(e,t,s,r,o,n,4096,4096),this.styleRepository=a,this._memCache=l,this.type="vector-tile",this._referenced=1,this._hasSymbolBuckets=!1,this._usedMemory=256,this.layerData=new Map,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.parentTile=null,this.childrenTiles=new Set,this.featureIndex=null,this.triangleCount=0,this._processed=!1,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}hasFeatures(){const e=this.layerData.values();for(const t of e)if(t.hasData())return!0;return!1}dispose(){this.status!=="unloaded"&&(Ee._destroyRenderBuckets(this.layerData),this.layerData.clear(),this.featureIndex=null,this._usedMemory=0,this.destroy(),this.status="unloaded")}release(){--this._referenced==0&&(this.dispose(),this.stage=null)}retain(){++this._referenced}get usedMemory(){return this._usedMemory}get usedMemoryPerReference(){return this._usedMemory/(this._referenced||1)}changeDataImpl(e){this.featureIndex?.clear();let t=!1;if(e){const{bucketsWithData:s,emptyBuckets:r}=e,o=this._createRenderBuckets(s);if(r&&r.byteLength>0){const n=new Uint32Array(r);for(const a of n)this._deleteLayerData(a)}for(const[n,a]of o)this._deleteLayerData(n),a.type===R.SYMBOL&&(this.symbols.set(n,a.symbols),t=!0),this._usedMemory+=a.usedMemory,this.layerData.set(n,a);this._memCache?.updateSize(this.key.id,this,this.usedMemory)}this._hasSymbolBuckets=!1;for(const s of this.layerData.values())s.type===R.SYMBOL&&(this._hasSymbolBuckets=!0);t&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(t){t.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const t=this.resolution/(e.resolution*e.pixelRatio),s=this.width/this.rangeX*t,r=this.height/this.rangeY*t,o=[0,0];e.toScreen(o,[this.x,this.y]);const n=this.transforms.tileUnitsToPixels;st(n),it(n,n,o),rt(n,n,Math.PI*e.rotation/180),ot(n,n,[s,r,1])}_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z(),tileUnitsToPixels:z()}}static _destroyRenderBuckets(e){if(!e)return;const t=new Set;for(const s of e.values())t.has(s)||(s.destroy(),t.add(s));e.clear()}_createRenderBuckets(e){const t=new Map,s=new Map;for(const r of e){const o=this._deserializeBucket(r,s);for(const n of o.layerUIDs)t.set(n,o)}return t}_deserializeBucket(e,t){let s=t.get(e);if(s)return s;switch(new Uint32Array(e)[0]){case R.FILL:s=new Et(e,this.styleRepository);break;case R.LINE:s=new Ut(e,this.styleRepository);break;case R.SYMBOL:s=new Vt(e,this.styleRepository,this);break;case R.CIRCLE:s=new zt(e,this.styleRepository)}return t.set(e,s),s}_deleteLayerData(e){if(!this.layerData.has(e))return;const t=this.layerData.get(e);this._usedMemory-=t.usedMemory,t.destroy(),this.layerData.delete(e)}};function Ht(i,e,t,s,r,o){const{iconRotationAlignment:n,textRotationAlignment:a,iconTranslate:l,iconTranslateAnchor:h,textTranslate:y,textTranslateAnchor:u}=s;let d=0;for(const c of i.colliders){const[_,p]=c.partIndex===0?l:y,f=c.partIndex===0?h:u,g=c.minLod<=o&&o<=c.maxLod;d+=g?0:1,c.enabled=g,c.xScreen=c.xTile*r[0]+c.yTile*r[3]+r[6],c.yScreen=c.xTile*r[1]+c.yTile*r[4]+r[7],f===dt.MAP?(c.xScreen+=t*_-e*p,c.yScreen+=e*_+t*p):(c.xScreen+=_,c.yScreen+=p),L.VIEWPORT===(c.partIndex===0?n:a)?(c.dxScreen=c.dxPixels,c.dyScreen=c.dyPixels):(c.dxScreen=t*(c.dxPixels+c.width/2)-e*(c.dyPixels+c.height/2)-c.width/2,c.dyScreen=e*(c.dxPixels+c.width/2)+t*(c.dyPixels+c.height/2)-c.height/2)}i.colliders.length>0&&d===i.colliders.length&&(i.unique.show=!1)}class qt{constructor(e,t,s,r,o,n){this._symbols=e,this._styleRepository=r,this._zoom=o,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new Ue(t,s,ct),this._si=Math.sin(Math.PI*n/180),this._co=Math.cos(Math.PI*n/180);for(const a of e)for(const l of a.symbols)this._allNeededMatrices.has(l.tile)||this._allNeededMatrices.set(l.tile,nt(l.tile.transforms.tileUnitsToPixels))}work(e){const t=this._gridIndex;function s(o){const n=o.xScreen+o.dxScreen,a=o.yScreen+o.dyScreen,l=n+o.width,h=a+o.height,[y,u,d,c]=t.getCellSpan(n,a,l,h);for(let _=u;_<=c;_++)for(let p=y;p<=d;p++){const f=t.cells[_][p];for(const g of f){const m=g.xScreen+g.dxScreen,b=g.yScreen+g.dyScreen,x=m+g.width,S=b+g.height;if(!(lx||hS))return!0}}return!1}const r=performance.now();for(;this._currentLayerCursore)return!1;const a=o.symbols[this._currentSymbolCursor];if(!a.unique.show)continue;Ht(a,this._si,this._co,n,this._allNeededMatrices.get(a.tile),this._zoom);const l=a.unique;if(!l.show)continue;const{iconAllowOverlap:h,iconIgnorePlacement:y,textAllowOverlap:u,textIgnorePlacement:d}=n;for(const c of a.colliders){if(!c.enabled)continue;const _=l.parts[c.partIndex];_.show&&!(c.partIndex?u:h)&&s(c)&&(c.hard?l.show=!1:_.show=!1)}if(l.show)for(const c of a.colliders){if(!c.enabled||(c.partIndex?d:y)||!l.parts[c.partIndex].show)continue;const _=c.xScreen+c.dxScreen,p=c.yScreen+c.dyScreen,f=_+c.width,g=p+c.height,[m,b,x,S]=this._gridIndex.getCellSpan(_,p,f,g);for(let w=b;w<=S;w++)for(let T=m;T<=x;T++)this._gridIndex.cells[w][T].push(c)}}}return!0}_getProperties(e){const t=this._styleProps.get(e);if(t)return t;const s=this._zoom,r=this._styleRepository.getStyleLayerByUID(e),o=r.getLayoutValue("symbol-placement",s)!==yt.POINT;let n=r.getLayoutValue("icon-rotation-alignment",s);n===L.AUTO&&(n=o?L.MAP:L.VIEWPORT);let a=r.getLayoutValue("text-rotation-alignment",s);a===L.AUTO&&(a=o?L.MAP:L.VIEWPORT);const l=r.getPaintValue("icon-translate",s),h=r.getPaintValue("icon-translate-anchor",s),y=r.getPaintValue("text-translate",s),u=r.getPaintValue("text-translate-anchor",s),d={iconAllowOverlap:r.getLayoutValue("icon-allow-overlap",s),iconIgnorePlacement:r.getLayoutValue("icon-ignore-placement",s),textAllowOverlap:r.getLayoutValue("text-allow-overlap",s),textIgnorePlacement:r.getLayoutValue("text-ignore-placement",s),iconRotationAlignment:n,textRotationAlignment:a,iconTranslateAnchor:h,iconTranslate:l,textTranslateAnchor:u,textTranslate:y};return this._styleProps.set(e,d),d}}function Bt(i,e){if(i.priority-e.priority)return i.priority-e.priority;const t=i.tile.key,s=e.tile.key;return t.world-s.world?t.world-s.world:t.level-s.level?t.level-s.level:t.row-s.row?t.row-s.row:t.col-s.col?t.col-s.col:i.xTile-e.xTile?i.xTile-e.xTile:i.yTile-e.yTile}let Nt=class{get running(){return this._running}constructor(i,e,t,s,r,o){this._visibleTiles=i,this._symbolRepository=e,this._createCollisionJob=t,this._assignTileSymbolsOpacity=s,this._symbolLayerSorter=r,this._isLayerVisible=o,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}setScreenSize(i,e){this._screenWidth===i&&this._screenHeight===e||this.restart(),this._screenWidth=i,this._screenHeight=e}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(i){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const e=performance.now();if(!this._selectionJob.work(i)||(this._selectionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const e=performance.now();if(!this._collisionJob.work(i)||(this._collisionJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const e=performance.now();if(!this._opacityJob.work(i)||(this._opacityJobCompleted=!0,(i=Math.max(0,i-(performance.now()-e)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const i=this._symbolRepository.uniqueSymbols;for(let a=0;aa)return!1;let c=null,_=!1,p=!1;for(const f of l.tileSymbols)if(!p||!_){const g=f.tile;(!c||g.isCoverage||g.neededForCoverage&&!_)&&(c=f,(g.neededForCoverage||g.isCoverage)&&(p=!0),g.isCoverage&&(_=!0))}if(c.selectedForRendering=!0,p){d.symbols.push(c),l.show=!0;for(const f of l.parts)f.show=!0}else l.show=!1}}for(const y of e)y.symbols.sort(Bt);return!0}const n=this._symbolLayerSorter;return{work:o,get sortedSymbols(){return e.sort(n)}}}_createOpacityJob(){const i=this._assignTileSymbolsOpacity,e=this._visibleTiles;let t=0;function s(r,o){for(const n of r.symbols.values())Qt(n,o);i(r,o);for(const n of r.childrenTiles)s(n,o)}return{work(r){const o=performance.now();for(;tr)return!1;const n=e[t];n.parentTile==null&&s(n,performance.now())}return!0}}}};function Qt(i,e){for(const t of i){const s=t.unique;for(const r of s.parts){const o=r.targetOpacity>.5?1:-1;r.startOpacity+=o*((e-r.startTime)/W),r.startOpacity=Math.min(Math.max(r.startOpacity,0),1),r.startTime=e,r.targetOpacity=s.show&&r.show?1:0}}}const Wt=32,$t=8,Jt=64,Kt=20;class Gt{constructor(e,t,s){this.tileCoordRange=e,this._visibleTiles=t,this._createUnique=s,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return this._uniqueSymbolLayerArray==null&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}get uniqueSymbolsReferences(){return this._uniqueSymbolsReferences}add(e,t){this._uniqueSymbolLayerArray=null;let s=this._tiles.get(e.id);s||(s={symbols:new Map},this._tiles.set(e.id,s));const r=new Map;if(t)for(const a of t)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));else for(const[a,l]of e.layerData)s.symbols.has(a)&&(r.set(a,s.symbols.get(a)),s.symbols.delete(a));this._removeSymbols(r);const o=e.symbols,n=new Map;for(const[a,l]of o){let h=l.length;if(h>=Wt){let y=this.tileCoordRange;do y/=2,h/=4;while(h>$t&&y>Jt);const u=new Ue(this.tileCoordRange,this.tileCoordRange,y);n.set(a,{flat:l,index:u}),s.symbols.set(a,{flat:l,index:u});for(const d of l)u.getCell(d.xTile,d.yTile).push(d)}else n.set(a,{flat:l}),s.symbols.set(a,{flat:l})}this._addSymbols(e.key,o)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[t,s]of this._tiles){const r=new Map;for(const o of e)s.symbols.has(o)&&(r.set(o,s.symbols.get(o)),s.symbols.delete(o));this._removeSymbols(r),s.symbols.size===0&&this._tiles.delete(t)}}removeTile(e){this._uniqueSymbolLayerArray=null;const t=this._tiles.get(e.id);if(!t)return;const s=new Map;for(const[r,o]of e.symbols)t.symbols.has(r)&&(s.set(r,t.symbols.get(r)),t.symbols.delete(r));this._removeSymbols(s),t.symbols.size===0&&this._tiles.delete(e.id)}querySymbols(e,t,s,r){const o=[],n=this.uniqueSymbols;for(const a of n){const l=a.styleLayerUID,h=a.uniqueSymbols;for(const y of h){const u=y.tileSymbols.find(d=>d.selectedForRendering);u&&kt(u,e,t*(window.devicePixelRatio||1),s)&&o.push({vtlSymbol:u,styleLayerUID:l,tileKey:u.tile.key})}}return o}_removeSymbols(e){for(const[t,{flat:s}]of e)for(const r of s){const o=r.unique,n=o.tileSymbols,a=n.length-1;for(let l=0;lt.level){const o=e.key.level-t.level;if(e.key.row>>o!==t.row||e.key.col>>o!==t.col)return}if(t.level>e.key.level){const o=t.level-e.key.level;if(t.row>>o!==e.key.row||t.col>>o!==e.key.col)return}if(t.equals(e.key)){for(const o of e.childrenTiles)this._matchSymbols(o,t,s);return}const r=new Map;for(const[o,n]of s){const a=[];for(const u of n){const d=Se(this.tileCoordRange,u.xTile,t.level,t.col,e.key.level,e.key.col),c=Se(this.tileCoordRange,u.yTile,t.level,t.row,e.key.level,e.key.row);d>=0&&d=0&&c0&&r.set(o,l)}for(const o of e.childrenTiles)this._matchSymbols(o,t,r)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,t=new Array(e.size);let s,r=0;for(const[o,n]of e){const a=new Array(n.size);s=0;for(const l of n)a[s++]=l;t[r]={styleLayerUID:o,uniqueSymbols:a},r++}return t}}const Yt=.5,xe=1e-6;class jt{constructor(e,t){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._offsetFromScreenCenter=[0,0],this._completed=!1,this._fading=ut(!1),this._symbolRepository=new Gt(4096,t,()=>new Pt),this._symbolDeclutterer=new Nt(t,this._symbolRepository,(s,r,o)=>this._createCollisionJob(s,r,o),(s,r)=>{s.allSymbolsFadingOut=!0,s.lastOpacityUpdate=r,Lt(s,r,!0),s.decluttered=!0,s.requestRender()},(s,r)=>this.styleRepository.getStyleLayerByUID(s.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(r.styleLayerUID).z,s=>{const r=this.styleRepository.getStyleLayerByUID(s);if(this._zoom+xe=r.maxzoom)return!1;const o=r.getLayoutProperty("visibility");return!o||o.getValue()!==Z.NONE})}get symbolRepository(){return this._symbolRepository}_createCollisionJob(e,t,s){return this.updateDecluttererViewState(),new qt(e,t,s,this.styleRepository,this._zoom,this._viewState.rotation)}get fading(){return this._fading.value}get decluttererOffset(){return this._offsetFromScreenCenter}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 t=this._tileToHandle.get(e);t&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),t.remove(),this._tileToHandle.delete(e))}update(e,t){this._zoom=e,this._viewState={scale:t.scale,rotation:t.rotation,center:[t.center[0],t.center[1]],size:[t.size[0],t.size[1]]};const s=[0,0];t.toScreen(s,t.center);const r=[0,0];return t.toScreen(r,this._declutterViewState.center),this._offsetFromScreenCenter[0]=s[0]-r[0],this._offsetFromScreenCenter[1]=s[1]-r[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.updateDecluttererViewState(),this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(ht),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){this._stableNotificationHandle!=null&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this._fading.value=!1},(1+Yt)*W)}_notifyUnstable(){this._stableNotificationHandle!=null&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this._fading.value=!0}updateDecluttererViewState(){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._offsetFromScreenCenter[0]=0,this._offsetFromScreenCenter[1]=0}}let Xt=class extends Le{_createTransforms(){return{displayViewScreenMat3:z(),tileMat3:z()}}};const $=1e-6;function Ie(i,e){if(i){const t=i.getLayoutProperty("visibility");if(!t||t.getValue()!==Z.NONE&&(i.minzoom===void 0||i.minzoom=e-$))return!0}return!1}let Zt=class extends _t{constructor(i){super(i),this._backgroundTiles=[],this._computeDisplayInfoView(i)}destroy(){this.removeAllChildren(),this._spriteMosaic?.dispose(),this._spriteMosaic=null,this._glyphMosaic?.dispose(),this._glyphMosaic=null,this._symbolFader!=null&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[]}get fading(){return this._symbolFader?.fading??!1}get symbolFader(){return this._symbolFader}get symbolRepository(){return this._symbolFader?.symbolRepository}setStyleResources(i,e,t,s){this._spriteMosaic=i,this._glyphMosaic=e,this._styleRepository=t,this.tileInfoView=s,this._computeDisplayInfoView(s),this._symbolFader==null&&(this._symbolFader=new jt(this._styleRepository,this.children)),this._symbolFader.styleRepository=t}setSpriteMosaic(i){this._spriteMosaic?.dispose(),this._spriteMosaic=i}deleteStyleLayers(i){this._symbolFader!=null&&this._symbolFader.deleteStyleLayers(i)}createRenderParams(i){return{...super.createRenderParams(i),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(i){!this.visible||i.drawPhase!==N.MAP&&i.drawPhase!==N.DEBUG||this._spriteMosaic===void 0||super.doRender(i)}addChild(i){return super.addChild(i),this._symbolFader!=null?this._symbolFader.addTile(i):i.decluttered=!0,this.requestRender(),i}removeChild(i){return this._symbolFader!=null&&this._symbolFader.removeTile(i),this.requestRender(),super.removeChild(i)}renderChildren(i){const{drawPhase:e}=i;e!==N.DEBUG?this._doRender(i):super.renderChildren(i)}removeAllChildren(){for(let i=0;ii.neededForCoverage&&i.hasData())}restartDeclutter(){this._symbolFader!=null&&this._symbolFader.restartDeclutter()}_doRender(i){const{context:e,state:t}=i,s=this._styleRepository;if(!s)return;const r=s.layers,o=this._displayInfo.scaleToZoom(t.scale);s.backgroundBucketIds.length>0&&(i.renderPass="background",this._renderBackgroundLayers(i,s.backgroundBucketIds,o)),super.renderChildren(i),i.drawPhase===N.MAP&&this._fade(o,t);const n=this.children.filter(a=>a.visible&&a.hasData());if(!n||n.length===0)return e.bindVAO(),e.setStencilTestEnabled(!0),void e.setBlendingEnabled(!0);for(const a of n)a.triangleCount=0;e.setStencilWriteMask(0),e.setColorMask(!0,!0,!0,!0),e.setStencilOp(O.KEEP,O.KEEP,O.REPLACE),e.setStencilTestEnabled(!0),e.setBlendingEnabled(!1),e.setDepthTestEnabled(!0),e.setDepthWriteEnabled(!0),e.setDepthFunction(ce.LEQUAL),e.setClearDepth(1),e.clear(e.gl.DEPTH_BUFFER_BIT),i.renderPass="opaque";for(let a=r.length-1;a>=0;a--)this._renderStyleLayer(r[a],i,n);e.setDepthWriteEnabled(!1),e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(B.ONE,B.ONE_MINUS_SRC_ALPHA,B.ONE,B.ONE_MINUS_SRC_ALPHA),i.renderPass="translucent";for(let a=0;ah.decluttered):t.filter(h=>h.neededForCoverage),a!=="vtlSymbol"&&(t.length===0||i.minzoom!==void 0&&i.minzoom>=s+$||i.maxzoom!==void 0&&i.maxzoom{const t=i.vtlSymbol.sourceTile,s=e.vtlSymbol.sourceTile;return t.level!==s.level?t.level-s.level:t.row!==s.row?t.row-s.row:t.col!==s.col?t.col-s.col:i.styleLayerUID-e.styleLayerUID};class ee{constructor(e,t,s,r,o){this.tileKey=e,this._tileLayerData=t,this._styleRepository=s,this._tileHandler=r,this._parentLayer=o,this._index=null,this._tileKeyToPBF=new Map}static create(e,t,s,r,o){return new ee(e,t,s,r,o)}clear(){this._index?.clear(),this._tileKeyToPBF.clear()}async queryAttributes(e,t,s,r,o){if(this._tileLayerData.size===0||!this._styleRepository||!this._tileHandler)return[];this._index===null&&(this._index=new pt(100,is),await this._indexLayers());const n=[];return this._queryIndex(n,e,t,s,this.tileKey.level,r),o&&o?.length>0&&await this._getSymbolsAttributes(n,o),n}async _indexLayers(){const e=this.tileKey,t=this._styleRepository.layers,s=await this._getTilePayload(e);for(const[r,o]of this._tileLayerData){const n=t[r],a=s.find(y=>y.sourceName===n.source);if(!a)continue;const{protobuff:l,key:h}=a;if(o.type!==R.SYMBOL){const y=1<=10*y||re&&re<=10*h)continue;const v=e.getFeatureInflatedBounds(q,h,_.extent,S);v==null||v[0]>b||v[1]>x||v[2]u.sourceName===a.source),l&&this._addSymbolsAttributes(e,t.slice(h.from,h.to).map(u=>u.vtlSymbol),r,l)}return e}_addSymbolsAttributes(e,t,s,r){const o=this._styleRepository.layers,n=r.key,a=this.tileKey,l=1<{const{attributes:d,tilePoint:c}=u;e.push({layerId:o[s].id,layerIndex:s,graphic:new le({attributes:d,origin:{type:"vector-tile",layerId:o[s].id,layerIndex:s,layer:this._parentLayer}}),tilePoint:c})})}_getSymbolAttributes(e,t,s,r,o,n){const a=[],l=this._styleRepository.layers;let h=0;t.sort((u,d)=>u.featureIndex-d.featureIndex);const y=new X(new Uint8Array(e),new DataView(e));for(;y.next();)switch(y.tag()){case 3:{const u=y.getMessage(),d=new ye(u);if(u.release(),d.name!==l[s].sourceLayer)continue;const c=d.getData(),_=d.extent/r,p=Te/_,f=_*n,g=_*o;let m=0;for(;c.nextTag(2);){const b=c.getMessage();if(m++===t[h].featureIndex){const x=new de(b,d),S=x.values,w=x.getGeometry(),T=w!=null?[p*(w[0][0].x-f),p*(w[0][0].y-g)]:null;a.push({attributes:S,tilePoint:T}),h++}if(b.release(),h===t.length)return a}break}default:y.skip()}return a}_queryIndex(e,t,s,r,o,n){const a=es*r*(window.devicePixelRatio||1);return this._index?.search({minX:t-a,minY:s-a,maxX:t+a,maxY:s+a},l=>{const{layer:h,feature:y}=l;h.isIntersectingFeature(t,s,r,y,o,n,l)&&e.push({layerId:h.id,layerIndex:h.uid,tilePoint:null,graphic:new le({attributes:y.values,origin:{type:"vector-tile",layerId:l.layer.id,layerIndex:l.layer.uid,layer:this._parentLayer}})})}),e}async _getTilePayload(e){return Je(this._tileKeyToPBF,e.id,()=>this._tileHandler.fetchTilePBFs(e)).then(t=>t)}}const is=i=>({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]});class ve extends tt{constructor(){super(...arguments),this._fullCacheLodInfos=null,this._levelByScale={}}getTileParentId(e){const t=A.pool.acquire(e),s=t.level===0?null:A.getId(t.level-1,t.row>>1,t.col>>1,t.world);return A.pool.release(t),s}getTileCoverage(e,t,s=!0,r){const o=super.getTileCoverage(e,t,s,r);if(!o)return o;const n=1<a.row>=0&&a.rowt[0].scale)return t[0].level;let s,r;for(let o=0;or.scale)return s=t[o],s.level+(s.scale-e)/(s.scale-r.scale);return t[t.length-1].level}}_initializeFullCacheLODs(e){let t;if(e[0].level===0)t=e.map(s=>({level:s.level,resolution:s.resolution,scale:s.scale}));else{const s=this.tileInfo.size[0],r=this.tileInfo.spatialReference;t=Oe.create({size:s,spatialReference:r}).lods.map(o=>({level:o.level,resolution:o.resolution,scale:o.scale}))}for(let s=0;su.tileKey.id===y.id)));return await Promise.all(l),h}update(i){if(this._tileHandlerPromise&&this._isTileHandlerReady)return i.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=i.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._pauseQueues(),this._fetchQueue.state=i.state,this._parseQueue.state=i.state,this._tileManager.update(i)||this.requestUpdate(),this._resumeQueues()))}attach(){const{style:i}=this.layer.currentStyleInfo;this._styleRepository=new _e(i),this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new Zt(this._tileInfoView),this._tileHandler=new It(this.layer,this._styleRepository,window.devicePixelRatio||1,this.layer.tileInfo.lods.length-1),this.container.addChild(this._vectorTileContainer),this._start(),this.addAttachHandles([this.layer.on("paint-change",e=>{if(this._styeChanged=!0,e.isDataDriven)this._styleChanges.push({type:I.PAINTER_CHANGED,data:e}),this.requestUpdate();else{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;const r=s.type===C.SYMBOL;t.setPaintProperties(e.layer,e.paint),r&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender()}}),this.layer.on("layout-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);if(!s)return;this._styeChanged=!0;const r=Ge(s.layout,e.layout);if(r!=null){if(Ye(r,"visibility")&&rs(r)===1)return t.setLayoutProperties(e.layer,e.layout),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),void this._vectorTileContainer?.requestRender();this._styleChanges.push({type:I.LAYOUT_CHANGED,data:e}),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const t=this._styleRepository,s=t.getLayerById(e.layer);s&&(this._styeChanged=!0,t.setStyleLayerVisibility(e.layer,e.visibility),s.type===C.SYMBOL&&this._vectorTileContainer?.restartDeclutter(),this._vectorTileContainer?.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:I.LAYER_CHANGED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:I.LAYER_REMOVED,data:e}),this._styeChanged=!0,this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._spriteSourceChanged=!0,this._styleChanges.push({type:I.SPRITES_CHANGED,data:e});const t=this._styleRepository.layers;for(const s of t)switch(s.type){case C.SYMBOL:s.getLayoutProperty("icon-image")&&this._styleChanges.push({type:I.LAYOUT_CHANGED,data:{layer:s.id,layout:s.layout}});break;case C.LINE:s.getPaintProperty("line-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}});break;case C.FILL:s.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:I.PAINTER_CHANGED,data:{layer:s.id,paint:s.paint,isDataDriven:s.isPainterDataDriven()}})}this.requestUpdate()})])}detach(){this._stop(),this.container.removeAllChildren(),this._vectorTileContainer=V(this._vectorTileContainer),this._tileHandler=V(this._tileHandler)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(i){return Ve(this.layer.tileInfo?.spatialReference,i)}canResume(){let i=super.canResume();const{currentStyleInfo:e}=this.layer;if(i&&e?.layerDefinition){const t=this.view.scale,{minScale:s,maxScale:r}=e.layerDefinition;e?.layerDefinition&&(s&&st&&(i=!1))}return i}isUpdating(){return this.fading}acquireTile(i){const e=this._createVectorTile(i);return this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>this._parseQueue.push({key:e.key,data:t})).then(t=>{e.once("attach",()=>this.requestUpdate()),e.setData(t),this.requestUpdate()}).catch(t=>{j(t)||K.getLogger(this).error(t)})),e}releaseTile(i){const e=i.key.id;this._fetchQueue.abort(e),this._parseQueue.abort(e),this.requestUpdate()}async doRefresh(){if(!this.attached)return;if(this.suspended)return this._tileManager.clear(),void this.requestUpdate();this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache(),this._resumeQueues();const i=this._vectorTileContainer.children,e=[];try{for(const t of i){const s=this._updatingHandles.addPromise(this._fetchQueue.push(t.key).then(r=>this._parseQueue.push({key:t.key,data:r})).then(r=>t.setData(r)).finally(()=>t.featureIndex=null));e.push(s)}await Promise.all(e)}catch(t){K.getLogger(this).error("error refreshing vector-tiles layer-view",t),this._resumeQueues(),this._isTileHandlerReady=!0}this._isTileHandlerReady=!0,this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new we({acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const i=new AbortController,e=this._tileHandler.start({signal:i.signal}).then(()=>{this._fetchQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._getTileData(t,s),concurrency:15,scheduler:this.scheduler,priority:pe.MAPVIEW_FETCH_QUEUE}),this._parseQueue=new ue({tileInfoView:this._tileInfoView,process:(t,s)=>this._parseTileData(t,s),concurrency:8,scheduler:this.scheduler,priority:pe.MAPVIEW_VECTOR_TILE_PARSING_QUEUE}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(t=>{this._vectorTileContainer.setStyleResources(t,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this.requestUpdate()}),this._tileHandlerAbortController=i,this._tileHandlerPromise=e}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const i=this._tileHandlerAbortController;i&&i.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue=V(this._fetchQueue),this._parseQueue=V(this._parseQueue),this._tileManager=V(this._tileManager),this._vectorTileContainer.removeAllChildren()}async _getTileData(i,e){return this._tileHandler.fetchTileData(i,e)}async _parseTileData(i,e){return this._tileHandler.parseTileData(i,e)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._tileManager.clearCache();const i=this._styleChanges;try{await this._tileHandler.updateStyle(i)}catch(o){K.getLogger(this).error("error applying vector-tiles style update",o.message),this._resumeQueues(),this._isTileHandlerReady=!0}const e=this._styleRepository,t=new Set;i.forEach(o=>{if(o.type!==I.LAYER_REMOVED)return;const n=o.data,a=e.getLayerById(n.layer);a&&t.add(a.uid)});const s=new Set;i.forEach(o=>{let n;switch(o.type){case I.PAINTER_CHANGED:e.setPaintProperties(o.data.layer,o.data.paint),n=o.data.layer;break;case I.LAYOUT_CHANGED:e.setLayoutProperties(o.data.layer,o.data.layout),n=o.data.layer;break;case I.LAYER_REMOVED:return void e.deleteStyleLayer(o.data.layer);case I.LAYER_CHANGED:e.setStyleLayer(o.data.layer,o.data.index),n=o.data.layer.id;break;case I.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(o.data.spriteSource))}if(n){const a=e.getLayerById(n);a&&s.add(a.uid)}});const r=this._vectorTileContainer.children;if(t.size>0){const o=Array.from(t);this._vectorTileContainer.deleteStyleLayers(o);for(const n of r)n.deleteLayerData(o)}if(this._resumeQueues(),s.size>0){const o=Array.from(s),n=[];for(const a of r){const l=this._updatingHandles.addPromise(this._fetchQueue.push(a.key).then(h=>this._parseQueue.push({key:a.key,data:h,styleLayerUIDs:o})).then(h=>a.setData(h)).finally(()=>a.featureIndex=null));n.push(l)}await Promise.all(n)}this._styleChanges=[],this._isTileHandlerReady=!0,this.requestUpdate()}async _loadStyle(){const{style:i}=this.layer.currentStyleInfo,e=ze(i);this._isTileHandlerReady=!1,this._pauseQueues(),this._clearQueues(),this._styleRepository=new _e(e),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:t}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,e,this.layer.tileInfo.lods.length-1),await this._tileHandlerPromise}catch(o){if(!j(o))throw o}if(t.aborted)return this._resumeQueues(),this._isTileHandlerReady=!0,this._styeChanged=!1,this._spriteSourceChanged=!1,void this.requestUpdate();const s=await this._tileHandler.spriteMosaic,r=this._vectorTileContainer;this._tileInfoView=new ve(this.layer.tileInfo,this.layer.fullExtent),r.setStyleResources(s,this._tileHandler.glyphMosaic,this._styleRepository,this._tileInfoView),this._tileManager=new we({acquireTile:o=>this.acquireTile(o),releaseTile:o=>this.releaseTile(o),tileInfoView:this._tileInfoView},this._vectorTileContainer),this._resumeQueues(),this._isTileHandlerReady=!0,this.requestUpdate(),this._styeChanged=!1,this._spriteSourceChanged=!1}_createVectorTile(i){const e=this._tileInfoView.getTileBounds(H(),i),t=this._tileInfoView.getTileResolution(i.level);return new Ft(i,t,e[0],e[3],512,512,this._styleRepository)}async _queryTile(i,e,t,s,r,o){if(r.layerData.size===0)return;const n=this._ensureTileIndex(r),a=this._tileInfoView.getTileBounds(H(),r.key,!0),l=Ce*De*((e.x-a[0])/(a[2]-a[0])),h=Ce*De*(1-(e.y-a[1])/(a[3]-a[1])),y=await n.queryAttributes(l,h,t,s,o);for(const u of y)u.graphic.geometry=this._tileToMapPoint(u.tilePoint,r.transforms.tileUnitsToPixels),i.push({type:"graphic",layer:this.layer,graphic:u.graphic,mapPoint:e.clone()});i.sort((u,d)=>d.graphic.origin.layerIndex-u.graphic.origin.layerIndex)}_tileToMapPoint(i,e){if(!i)return null;const t=i[0]*e[0]+i[1]*e[3]+e[6],s=i[0]*e[1]+i[1]*e[4]+e[7],r=this.view.state,o=[0,0];return r.toMap(o,[t,s]),new Fe({x:o[0],y:o[1],spatialReference:r.spatialReference})}_ensureTileIndex(i){let e=i.featureIndex;return e||(e=ee.create(i.key,i.layerData,this._styleRepository,this._tileHandler,this.layer),i.featureIndex=e),e}_pauseQueues(){this._fetchQueue.pause(),this._parseQueue.pause()}_resumeQueues(){this._fetchQueue.resume(),this._parseQueue.resume()}_clearQueues(){this._fetchQueue.clear(),this._parseQueue.clear()}};function rs(i){if(i==null)return 0;switch(i.type){case"partial":return Object.keys(i.diff).length;case"complete":return Math.max(Object.keys(i.oldValue).length,Object.keys(i.newValue).length);case"collection":return Object.keys(i.added).length+Object.keys(i.changed).length+Object.keys(i.removed).length}}oe([He()],Q.prototype,"_isTileHandlerReady",void 0),Q=oe([qe("esri.views.2d.layers.VectorTileLayerView2D")],Q);const Ni=Q;export{Ni as default}; diff --git a/custom-toc-highlight/assets/Version-CoKzbupV-9-gg6ENz.js b/custom-toc-highlight/assets/Version-CoKzbupV-BDyz4v43.js similarity index 93% rename from custom-toc-highlight/assets/Version-CoKzbupV-9-gg6ENz.js rename to custom-toc-highlight/assets/Version-CoKzbupV-BDyz4v43.js index 922ca742..9de92019 100644 --- a/custom-toc-highlight/assets/Version-CoKzbupV-9-gg6ENz.js +++ b/custom-toc-highlight/assets/Version-CoKzbupV-BDyz4v43.js @@ -1 +1 @@ -import{o as i}from"./story-BfX8CRfG.js";let c=class n{constructor(t,e,o=""){this.major=t,this.minor=e,this._context=o}lessThan(t,e){return this.major_.getLogger("esri.views.webgl.VertexArrayObject");let g=class{constructor(t,e,i,r,s=null){this._context=t,this._locations=e,this._layout=i,this._buffers=r,this._indexBuffer=s,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer!=null?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*u}dispose(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=a(this._indexBuffer),this.disposeVAOOnly()):(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&n().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(h.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const{gl:t}=this._context,e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e,this._context.instanceCounter.increment(h.VertexArrayObject,this),this._initialized=!0}bind(){this.initialize(),this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const{_buffers:t,_layout:e,_indexBuffer:i}=this;t||n().error("Vertex buffer dictionary is empty!");const r=this._context.gl;this._buffers.forEach((s,l)=>{const o=e.get(l);o?f(this._context,this._locations,s,o):n().error("Vertex element descriptor is empty!")}),i!=null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,i.glName)}unbind(){this.initialize(),this._context.gl.bindVertexArray(null)}};export{g as c}; +import{iB as u,hT as a,a1 as _}from"./story-Doly9N9p.js";import{V as h}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{r as f}from"./Texture-BCt2hphT-Dk2JyWCy.js";const n=()=>_.getLogger("esri.views.webgl.VertexArrayObject");let g=class{constructor(t,e,i,r,s=null){this._context=t,this._locations=e,this._layout=i,this._buffers=r,this._indexBuffer=s,this._glName=null,this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Array.from(this._buffers.values()).reduce((t,e)=>t+e.usedMemory,this._indexBuffer!=null?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+(Object.keys(this._buffers).length+(this._indexBuffer?1:0))*u}dispose(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this._indexBuffer=a(this._indexBuffer),this.disposeVAOOnly()):(this._glName||Object.getOwnPropertyNames(this._buffers).length>0)&&n().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(h.VertexArrayObject,this)),this._context=null}initialize(){if(this._initialized)return;const{gl:t}=this._context,e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e,this._context.instanceCounter.increment(h.VertexArrayObject,this),this._initialized=!0}bind(){this.initialize(),this._context.gl.bindVertexArray(this.glName)}_bindLayout(){const{_buffers:t,_layout:e,_indexBuffer:i}=this;t||n().error("Vertex buffer dictionary is empty!");const r=this._context.gl;this._buffers.forEach((s,l)=>{const o=e.get(l);o?f(this._context,this._locations,s,o):n().error("Vertex element descriptor is empty!")}),i!=null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,i.glName)}unbind(){this.initialize(),this._context.gl.bindVertexArray(null)}};export{g as c}; diff --git a/custom-toc-highlight/assets/VideoLayer-Dxs-NJSn--54x1iM5.js b/custom-toc-highlight/assets/VideoLayer-Dxs-NJSn-NbdKBg3Z.js similarity index 99% rename from custom-toc-highlight/assets/VideoLayer-Dxs-NJSn--54x1iM5.js rename to custom-toc-highlight/assets/VideoLayer-Dxs-NJSn-NbdKBg3Z.js index 60b03894..bbc1d01f 100644 --- a/custom-toc-highlight/assets/VideoLayer-Dxs-NJSn--54x1iM5.js +++ b/custom-toc-highlight/assets/VideoLayer-Dxs-NJSn-NbdKBg3Z.js @@ -1,4 +1,4 @@ -import{aa as Ln,v as K,S as Z,i as Ds,w as Jt,l as On,m as rn,a0 as gi,ac as io,J as Zr,ah as nn,aL as xd,ae as kd,o as Vl,f as ro,n as zl,e as Nn,j as Lo,jZ as eg,dk as Wl,hZ as ni,a1 as tg,ai as sg,dg as ga}from"./story-BfX8CRfG.js";import{m as ig}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as rg}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{u as ng}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as ag}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{S as og}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{i as lg}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{Z as ug}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{q as hg}from"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import{a as Dd}from"./TelemetryDisplay-Bq2PXfI8-Z2CK355L.js";import{o as dg,n as Gl}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{E as cg,V as pg}from"./mat3-CC4Foazl-BWjyqE2v.js";import{y as fa,N as mg,r as gg,Z as Xl}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{m as ya}from"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import{n as Yl}from"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import{t as vr,l as an}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";let Es=class extends Ln(Nn){constructor(s){super(s),this.framerate=null,this.containerFormat=null,this.gop=null,this.aspectRatio=null,this.klv=null}};K([Z({type:String})],Es.prototype,"framerate",void 0),K([Z({type:String})],Es.prototype,"containerFormat",void 0),K([Z({type:Number})],Es.prototype,"gop",void 0),K([Z({type:String})],Es.prototype,"aspectRatio",void 0),K([Z({type:Object})],Es.prototype,"klv",void 0),Es=K([Ds("esri.layers.support.PlaybackInfo")],Es);const fg=Es;let Cs=class extends Ln(Nn){constructor(s){super(s),this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};K([Z({type:Jt})],Cs.prototype,"frameCenter",void 0),K([Z({type:On})],Cs.prototype,"frameOutline",void 0),K([Z({type:rn})],Cs.prototype,"lineOfSight",void 0),K([Z({type:Jt})],Cs.prototype,"sensorLocation",void 0),K([Z({type:rn})],Cs.prototype,"sensorTrail",void 0),Cs=K([Ds("esri.layers.support.TelemetryData")],Cs);const no=Cs;let rr=class extends Lo{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};function yg(s){return s?.sourcePoint!=null&&s.mapPoint!=null}K([Z()],rr.prototype,"sourcePoint",void 0),K([Z({type:Jt})],rr.prototype,"mapPoint",void 0),rr=K([Ds("esri.layers.support.VideoFrame.ControlPoint")],rr);let Fs=class extends Ln(Nn){constructor(s){super(s),this.frame=null,this.controlPoints=null}readControlPoints(s){return s.map(e=>({sourcePoint:{x:e.frameX,y:e.frameY},mapPoint:new Jt(e.point)}))}writeControlPoints(s,e){s!=null&&yg(s[0])&&(e.controlPoints=s.map(t=>{const i=t.sourcePoint,r=t.mapPoint;return{frameX:i.x,frameY:i.y,point:r.toJSON()}}))}};K([Z({type:String})],Fs.prototype,"frame",void 0),K([Z({type:[rr],json:{write:{allowNull:!1,isRequired:!0}}})],Fs.prototype,"controlPoints",void 0),K([gi("controlPoints")],Fs.prototype,"readControlPoints",null),K([io("controlPoints")],Fs.prototype,"writeControlPoints",null),Fs=K([Ds("esri.layers.support.VideoFrame")],Fs);const _g=Fs;let ui=class extends EventTarget{constructor(){super(...arguments),this._readyState=0,this._responseType="",this.timeout=0,this._withCredentials=!1,this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.onreadystatechange=null,this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this._abortController=null,this._error=null,this._options={},this._response=null,this._sendFlag=!1,this._url=""}get readyState(){return this._readyState}get response(){return this.responseType===""||this.responseType==="text"?this.responseText:this.readyState!==this.DONE||this._error||!this._response?null:this._response.data}get responseText(){return this.responseType!==""&&this.responseType!=="text"&&this._throwDOMException(),this.readyState!==this.DONE?"":this._response?this._response.data:this._error?.raw!=null?typeof this._error.raw=="string"?this._error.raw:JSON.stringify(this._error.raw):""}get responseType(){return this._responseType}set responseType(s){(s!=="document"||globalThis instanceof Window)&&(this.readyState!==this.LOADING&&this.readyState!==this.DONE||this._throwDOMException(),this._responseType=s)}get responseURL(){return(this._response||this._error)?.url??""}get responseXML(){return this.responseType!==""&&this.responseType!=="document"&&this._throwDOMException(),this.readyState!==this.DONE?null:this._response?.data??null}get status(){return(this._response||this._error)?.httpStatus??0}get statusText(){return""}get upload(){return console.warn("upload not implemented"),null}get withCredentials(){return this._withCredentials}set withCredentials(s){this.readyState!==this.UNSENT&&this.readyState!==this.OPENED&&this._throwDOMException(),this._withCredentials=s}abort(){this.readyState===this.OPENED&&this._sendFlag||this.readyState===this.HEADERS_RECEIVED||this.readyState===this.LOADING?(this._sendFlag=!1,this._error=null,this._response=null,this._abortController?.abort(),this._updateReadyState(this.DONE),this._dispatchProgressEvent("abort"),this._dispatchProgressEvent("loadend")):this.readyState===this.DONE&&this._updateReadyState(this.UNSENT)}getAllResponseHeaders(){let s="";const e=(this._response||this._error)?.getAllHeaders?.();if(e)for(const[t,i]of e)s+=`${t}: ${i}\r +import{aa as Ln,v as K,S as Z,i as Ds,w as Jt,l as On,m as rn,a0 as gi,ac as io,J as Zr,ah as nn,aL as xd,ae as kd,o as Vl,f as ro,n as zl,e as Nn,j as Lo,jZ as eg,dk as Wl,hZ as ni,a1 as tg,ai as sg,dg as ga}from"./story-Doly9N9p.js";import{m as ig}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as rg}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{u as ng}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as ag}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{S as og}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{i as lg}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{Z as ug}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{q as hg}from"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import{a as Dd}from"./TelemetryDisplay-Bq2PXfI8-BY_FrklG.js";import{o as dg,n as Gl}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{E as cg,V as pg}from"./mat3-CC4Foazl-BWjyqE2v.js";import{y as fa,N as mg,r as gg,Z as Xl}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{m as ya}from"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import{n as Yl}from"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import{t as vr,l as an}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";let Es=class extends Ln(Nn){constructor(s){super(s),this.framerate=null,this.containerFormat=null,this.gop=null,this.aspectRatio=null,this.klv=null}};K([Z({type:String})],Es.prototype,"framerate",void 0),K([Z({type:String})],Es.prototype,"containerFormat",void 0),K([Z({type:Number})],Es.prototype,"gop",void 0),K([Z({type:String})],Es.prototype,"aspectRatio",void 0),K([Z({type:Object})],Es.prototype,"klv",void 0),Es=K([Ds("esri.layers.support.PlaybackInfo")],Es);const fg=Es;let Cs=class extends Ln(Nn){constructor(s){super(s),this.frameCenter=null,this.frameOutline=null,this.lineOfSight=null,this.sensorLocation=null,this.sensorTrail=null}};K([Z({type:Jt})],Cs.prototype,"frameCenter",void 0),K([Z({type:On})],Cs.prototype,"frameOutline",void 0),K([Z({type:rn})],Cs.prototype,"lineOfSight",void 0),K([Z({type:Jt})],Cs.prototype,"sensorLocation",void 0),K([Z({type:rn})],Cs.prototype,"sensorTrail",void 0),Cs=K([Ds("esri.layers.support.TelemetryData")],Cs);const no=Cs;let rr=class extends Lo{constructor(){super(...arguments),this.sourcePoint=null,this.mapPoint=null}};function yg(s){return s?.sourcePoint!=null&&s.mapPoint!=null}K([Z()],rr.prototype,"sourcePoint",void 0),K([Z({type:Jt})],rr.prototype,"mapPoint",void 0),rr=K([Ds("esri.layers.support.VideoFrame.ControlPoint")],rr);let Fs=class extends Ln(Nn){constructor(s){super(s),this.frame=null,this.controlPoints=null}readControlPoints(s){return s.map(e=>({sourcePoint:{x:e.frameX,y:e.frameY},mapPoint:new Jt(e.point)}))}writeControlPoints(s,e){s!=null&&yg(s[0])&&(e.controlPoints=s.map(t=>{const i=t.sourcePoint,r=t.mapPoint;return{frameX:i.x,frameY:i.y,point:r.toJSON()}}))}};K([Z({type:String})],Fs.prototype,"frame",void 0),K([Z({type:[rr],json:{write:{allowNull:!1,isRequired:!0}}})],Fs.prototype,"controlPoints",void 0),K([gi("controlPoints")],Fs.prototype,"readControlPoints",null),K([io("controlPoints")],Fs.prototype,"writeControlPoints",null),Fs=K([Ds("esri.layers.support.VideoFrame")],Fs);const _g=Fs;let ui=class extends EventTarget{constructor(){super(...arguments),this._readyState=0,this._responseType="",this.timeout=0,this._withCredentials=!1,this.onabort=null,this.onerror=null,this.onload=null,this.onloadend=null,this.onloadstart=null,this.onprogress=null,this.ontimeout=null,this.onreadystatechange=null,this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this._abortController=null,this._error=null,this._options={},this._response=null,this._sendFlag=!1,this._url=""}get readyState(){return this._readyState}get response(){return this.responseType===""||this.responseType==="text"?this.responseText:this.readyState!==this.DONE||this._error||!this._response?null:this._response.data}get responseText(){return this.responseType!==""&&this.responseType!=="text"&&this._throwDOMException(),this.readyState!==this.DONE?"":this._response?this._response.data:this._error?.raw!=null?typeof this._error.raw=="string"?this._error.raw:JSON.stringify(this._error.raw):""}get responseType(){return this._responseType}set responseType(s){(s!=="document"||globalThis instanceof Window)&&(this.readyState!==this.LOADING&&this.readyState!==this.DONE||this._throwDOMException(),this._responseType=s)}get responseURL(){return(this._response||this._error)?.url??""}get responseXML(){return this.responseType!==""&&this.responseType!=="document"&&this._throwDOMException(),this.readyState!==this.DONE?null:this._response?.data??null}get status(){return(this._response||this._error)?.httpStatus??0}get statusText(){return""}get upload(){return console.warn("upload not implemented"),null}get withCredentials(){return this._withCredentials}set withCredentials(s){this.readyState!==this.UNSENT&&this.readyState!==this.OPENED&&this._throwDOMException(),this._withCredentials=s}abort(){this.readyState===this.OPENED&&this._sendFlag||this.readyState===this.HEADERS_RECEIVED||this.readyState===this.LOADING?(this._sendFlag=!1,this._error=null,this._response=null,this._abortController?.abort(),this._updateReadyState(this.DONE),this._dispatchProgressEvent("abort"),this._dispatchProgressEvent("loadend")):this.readyState===this.DONE&&this._updateReadyState(this.UNSENT)}getAllResponseHeaders(){let s="";const e=(this._response||this._error)?.getAllHeaders?.();if(e)for(const[t,i]of e)s+=`${t}: ${i}\r `;return s}getResponseHeader(s){return(this._response||this._error)?.getHeader?.(s)??null}open(s,e){switch(this._sendFlag=!1,this._options={},s){case"GET":this._options.method="auto";break;case"POST":this._options.method="post";break;case"HEAD":this._options.method="head";break;case"DELETE":this._options.method="delete";break;case"PUT":this._options.method="put"}this._url=e,this._error=null,this._response=null,this._abortController=new AbortController,this._updateReadyState(this.OPENED)}overrideMimeType(s){throw new Error("overrideMimeType not implemented")}send(s){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._sendFlag=!0,this._updateReadyState(this.LOADING),this._dispatchProgressEvent("loadstart");const e=this._options;s instanceof URLSearchParams?e.body=s.toString():e.body=s,e.responseType=this.responseType===""?"text":this.responseType==="arraybuffer"?"array-buffer":this.responseType,e.signal=this._abortController?.signal,this.timeout&&(e.timeout=this.timeout),this.withCredentials&&(e.withCredentials=!0),ro(this._url,e).then(t=>{this._response=t,this._updateReadyState(this.DONE),this._dispatchProgressEvent("load")}).catch(t=>{this._sendFlag&&(this._error=t.details,this._updateReadyState(this.DONE),eg(t)?this._dispatchProgressEvent("timeout"):t.name==="AbortError"?this._dispatchProgressEvent("abort"):this._dispatchProgressEvent("error"))}).finally(()=>{this._sendFlag&&this._dispatchProgressEvent("loadend")})}setRequestHeader(s,e){(this.readyState!==this.OPENED||this._sendFlag)&&this._throwDOMException(),this._options.headers??={},this._options.headers[s]=e}_dispatchProgressEvent(s){const e=new ProgressEvent(s,{loaded:0,total:0});this.dispatchEvent(e),this[`on${s}`]?.(e)}_throwDOMException(){throw new DOMException("","InvalidStateError")}_updateReadyState(s){if(this._readyState!==s&&(this._readyState=s,s!==this.UNSENT)){const e=new Event("readystatechange");this.dispatchEvent(e),this.onreadystatechange?.(e)}}};ui.UNSENT=0,ui.OPENED=1,ui.HEADERS_RECEIVED=2,ui.LOADING=3,ui.DONE=4;let Bt=class extends Ln(Nn){constructor(s){super(s),this.duration=null,this.end=null,this.start=null,this.timezone="UTC"}readEnd(s,e){return e.end!=null?new Date(e.end):null}writeEnd(s,e){e.end=s?s.getTime():null}readStart(s,e){return e.start!=null?new Date(e.start):null}writeStart(s,e){e.start=s?s.getTime():null}};K([Z({type:Number,json:{write:{allowNull:!0}}})],Bt.prototype,"duration",void 0),K([Z({type:Date,json:{write:{allowNull:!0}}})],Bt.prototype,"end",void 0),K([gi("end")],Bt.prototype,"readEnd",null),K([io("end")],Bt.prototype,"writeEnd",null),K([Z({type:Date,json:{write:{allowNull:!0}}})],Bt.prototype,"start",void 0),K([gi("start")],Bt.prototype,"readStart",null),K([io("start")],Bt.prototype,"writeStart",null),K([Z({type:String})],Bt.prototype,"timezone",void 0),Bt=K([Ds("esri.layers.support.VideoTimeExtent")],Bt);const vg=Bt,_a="application/x-mpegURL",bg="video/mp4",ne={UASDatalinkLocalSet:1e4,PrecisionTimeStamp:10002,MissionId:10003,PlatformTailNumber:10004,PlatformHeadingAngle:10005,PlatformPitchAngle:10006,PlatformRollAngle:10007,PlatformTrueAirspeed:10008,PlatformIndicatedAirspeed:10009,PlatformDesignation:10010,ImageSourceSensor:10011,ImageCoordinateSystem:10012,SensorLatitude:10013,SensorLongitude:10014,SensorTrueAltitude:10015,SensorHorizontalFOV:10016,SensorVerticalFOV:10017,SensorAzimuthAngle:10018,SensorElevationAngle:10019,SensorRollAngle:10020,PlatformSlantRange:10021,TargetWidth:10022,FrameCenterLatitude:10023,FrameCenterLongitude:10024,FrameCenterElevation:10025,OffsetCorner1Latitude:10026,OffsetCorner1Longitude:10027,OffsetCorner2Latitude:10028,OffsetCorner2Longitude:10029,OffsetCorner3Latitude:10030,OffsetCorner3Longitude:10031,OffsetCorner4Latitude:10032,OffsetCorner4Longitude:10033,TargetLocationLatitude:10040,TargetLocationLongitude:10041,TargetLocationElevation:10042,TargetTrackGateWidth:10043,TargetTrackGateHeight:10044,TargetErrorEstimateHorizontal:10045,TargetErrorEstimateLateral:10046,GenericFlagData:10047,PlatformGroundSpeed:10056,PlatformGroundRange:10057,PlatformRemainingFuel:10058,PlatformCallSign:10059,SensorFOVName:10063,PlatformMagneticHeading:10064,LDSVersionNumber:10065,AlternatePlatformName:10070,EventStartTimeUTC:10072,VMTIDataSet:10074,SensorEllipsoidHeight:10075,OperationalMode:10077,CornerLatitudePoint1:10082,CornerLongitudePoint1:10083,CornerLatitudePoint2:10084,CornerLongitudePoint2:10085,CornerLatitudePoint3:10086,CornerLongitudePoint3:10087,CornerLatitudePoint4:10088,CornerLongitudePoint4:10089,SARMotionImageryMetadata:10095,SecurityClassification:20001,SecurityClassifyingAuthority:20002,SecurityClassifyingCountry:20003,SecuritySCI:20004,SecurityCaveats:20005,SecurityReleaseInstructions:20006,SecurityLDSVersion:20022,EsriVideoWidth:90001,EsriVideoHeight:90002,EsriFrameCenterLatitude:90050,EsriFrameCenterLongitude:90051,EsriCornerLatitudePt1:90052,EsriCornerLongitudePt1:90053,EsriCornerLatitudePt2:90054,EsriCornerLongitudePt2:90055,EsriCornerLatitudePt3:90056,EsriCornerLongitudePt3:90057,EsriCornerLatitudePt4:90058,EsriCornerLongitudePt4:90059,EsriFrameOutline:90060,EsriSensorPosition:90061,EsriHorizonPixelPack:90063,EsriGroundControlPoints:90064};function Tg(s){const{duration:e,end:t,start:i,timezone:r="UTC"}=s||{};return typeof e!="number"?null:new vg({duration:e||null,end:typeof t=="number"?new Date(t):null,start:typeof i=="number"?new Date(i):null,timezone:r})}function Sg(s,e){const t=[...e],i=t.findIndex(r=>r.equals(s));return i>-1&&t.splice(i),t.push(s),t}function Eg(s){if(!s?.size)return new no;const e=Rg(s),t=Ag(s),i=Pg(s),r=Ng(e,t);return new no({frameCenter:t,frameOutline:i,lineOfSight:r,sensorLocation:e})}function Cg(s){return s?.size?s.get(ne.EsriGroundControlPoints)?.value??null??null:null}function wg(s){return s?.size?s.get(ne.EsriHorizonPixelPack)?.value??null:null}function Ag(s){return Dg(s)??Ig(s)}function xg(s){if(!s)return _a;let e="";const t=new RegExp(/\.(\w{3,4})(?:$|\?)/i),i=s?s.match(t):[];return i?.length?(e=i[0],e.toLowerCase().replaceAll(".","")==="mp4"?bg:_a):_a}function kg(s){const e=s?.layers;return e?.length?e.map(t=>({layerId:t.id,posterUrl:t.poster,sourceType:t.serviceType,title:t.name,type:t.type||"Video Layer"})):[]}function Dg(s){return s&&s.has(ne.EsriFrameCenterLatitude)&&s.has(ne.EsriFrameCenterLongitude)?new Jt({x:s.get(ne.EsriFrameCenterLongitude).value,y:s.get(ne.EsriFrameCenterLatitude).value,z:s.get(ne.FrameCenterElevation).value}):null}function Ig(s){return s&&s.has(ne.FrameCenterLatitude)&&s.has(ne.FrameCenterLongitude)?new Jt({x:s.get(ne.FrameCenterLongitude)?.value,y:s.get(ne.FrameCenterLatitude)?.value,z:s.get(ne.FrameCenterElevation)?.value}):null}function Pg(s){if(!s)return null;const e=s.get(ne.EsriFrameOutline)?.value;return e?On.fromJSON(e.geometry):Lg(s)??Og(s)}function Lg(s){if(!(s.has(ne.EsriCornerLatitudePt1)&&s.has(ne.EsriCornerLongitudePt1)&&s.has(ne.EsriCornerLatitudePt2)&&s.has(ne.EsriCornerLongitudePt2)&&s.has(ne.EsriCornerLatitudePt3)&&s.has(ne.EsriCornerLongitudePt3)&&s.has(ne.EsriCornerLatitudePt4)&&s.has(ne.EsriCornerLongitudePt4)))return null;const e=[s.get(ne.EsriCornerLongitudePt1)?.value,s.get(ne.EsriCornerLatitudePt1)?.value],t=[s.get(ne.EsriCornerLongitudePt2)?.value,s.get(ne.EsriCornerLatitudePt2)?.value],i=[s.get(ne.EsriCornerLongitudePt3)?.value,s.get(ne.EsriCornerLatitudePt3)?.value],r=[s.get(ne.EsriCornerLongitudePt4)?.value,s.get(ne.EsriCornerLatitudePt4)?.value];return new On({rings:[[e,t,i,r]]})}function Og(s){if(!(s.has(ne.OffsetCorner1Latitude)&&s.has(ne.OffsetCorner1Longitude)&&s.has(ne.OffsetCorner2Latitude)&&s.has(ne.OffsetCorner2Longitude)&&s.has(ne.OffsetCorner3Latitude)&&s.has(ne.OffsetCorner3Longitude)&&s.has(ne.OffsetCorner4Latitude)&&s.has(ne.OffsetCorner4Longitude)&&s.has(ne.FrameCenterLatitude)&&s.has(ne.FrameCenterLongitude)))return null;const e=s.get(ne.FrameCenterLatitude)?.value,t=s.get(ne.FrameCenterLongitude)?.value,i=e+s.get(ne.OffsetCorner1Latitude)?.value,r=t+s.get(ne.OffsetCorner1Longitude)?.value,n=e+s.get(ne.OffsetCorner2Latitude)?.value,a=t+s.get(ne.OffsetCorner2Longitude)?.value,l=e+s.get(ne.OffsetCorner3Latitude)?.value,h=t+s.get(ne.OffsetCorner3Longitude)?.value,p=e+s.get(ne.OffsetCorner4Latitude)?.value,g=t+s.get(ne.OffsetCorner4Longitude)?.value;return new On({rings:[[[r,i],[a,n],[h,l],[g,p]]]})}function Ng(s,e){if(!s||!e)return null;const t=[s.x,s.y,s.z??0],i=[e.x,e.y,e.z??0];return new rn({paths:[[t,i]]})}function Rg(s){if(!s?.size)return null;if(s.has(ne.EsriSensorPosition)){const e=s.get(ne.EsriSensorPosition)?.value;if(e)return Jt.fromJSON(e.geometry)}return s.has(ne.SensorLongitude)&&s.has(ne.SensorLatitude)&&s.has(ne.SensorTrueAltitude)?new Jt({x:s.get(ne.SensorLongitude)?.value,y:s.get(ne.SensorLatitude)?.value,z:s.get(ne.SensorTrueAltitude)?.value}):null}const ft=Math.PI/180;let Qe=class extends Lo{constructor(s){super(),this.averageElevation=0,this.imageHeight=0,this.imageWidth=0,this.metadataSupportsTransforms=!1,this.platformHeadingAngle=0,this.platformPitchAngle=0,this.platformRollAngle=0,this.sensorHeadingAngle=0,this.sensorAltitude=0,this.sensorHorizontalFieldOfView=0,this.sensorLatitude=0,this.sensorLongitude=0,this.sensorPitchAngle=0,this.sensorRollAngle=0,this.sensorVerticalFieldOfView=0,this.vttMetadata=new Map,this._createMat3FromValues=t=>{const i=t[0],r=t[1],n=t[2];return dg(i[0],r[0],n[0],i[1],r[1],n[1],i[2],r[2],n[2])},this._multiplyMat3=(t,i)=>{const r=Gl();return cg(r,t,i),r},this._transposeMat3=t=>{const i=Gl();return pg(i,t),i},this._calculateCameraFovForward=()=>this._createMat3FromValues([[0,0,1],[Math.tan(.5*this.sensorHorizontalFieldOfView*ft),0,0],[0,Math.tan(.5*this.sensorVerticalFieldOfView*ft),0]]),this._calculateCameraFovReverse=()=>this._createMat3FromValues([[0,1/Math.tan(.5*this.sensorHorizontalFieldOfView*ft),0],[0,0,1/Math.tan(.5*this.sensorVerticalFieldOfView*ft)],[1,0,0]]),this._calculateCameraLook=()=>this._getRotationMatrixZYX(this.sensorHeadingAngle*ft,this.sensorPitchAngle*ft,this.sensorRollAngle*ft),this._calculateImageDimensionsForward=()=>this._createMat3FromValues([[2/this.imageWidth,0,-1],[0,-2/this.imageHeight,-1],[0,0,1]]),this._calculateImageDimensionsReverse=()=>this._createMat3FromValues([[this.imageWidth/2,0,this.imageWidth/2],[0,-this.imageHeight/2,-this.imageHeight/2],[0,0,1]]),this._calculatePlatformPositionMatrix=()=>{const t=Math.sin(this.sensorLatitude*ft),i=Math.cos(this.sensorLatitude*ft),r=Math.sin(this.sensorLongitude*ft),n=Math.cos(this.sensorLongitude*ft);return this._createMat3FromValues([[-t*n,-r,-i*n],[-t*r,n,-i*r],[i,0,-t]])},this._calculatePlatformOrientation=()=>this._getRotationMatrixZYX(this.platformHeadingAngle*ft,this.platformPitchAngle*ft,this.platformRollAngle*ft),this._extractValues=t=>{this.imageWidth=t.get(ne.EsriVideoWidth)?.value,this.imageHeight=t.get(ne.EsriVideoHeight)?.value;const i=t.get(ne.SensorEllipsoidHeight)?.value;this.sensorAltitude=i??t.get(ne.SensorTrueAltitude)?.value,this.sensorLatitude=t.get(ne.SensorLatitude)?.value,this.sensorLongitude=t.get(ne.SensorLongitude)?.value,this.sensorHeadingAngle=t.get(ne.SensorAzimuthAngle)?.value,this.sensorPitchAngle=t.get(ne.SensorElevationAngle)?.value,this.sensorRollAngle=t.get(ne.SensorRollAngle)?.value,this.sensorHorizontalFieldOfView=t.get(ne.SensorHorizontalFOV)?.value,this.sensorVerticalFieldOfView=t.get(ne.SensorVerticalFOV)?.value,this.platformHeadingAngle=t.get(ne.PlatformHeadingAngle)?.value,this.platformPitchAngle=t.get(ne.PlatformPitchAngle)?.value,this.platformRollAngle=t.get(ne.PlatformRollAngle)?.value,this.averageElevation=t.get(ne.FrameCenterElevation)?.value||0},this._getRotationMatrixZYX=(t,i,r)=>{const n=Math.cos(t),a=Math.sin(t),l=Math.cos(i),h=Math.sin(i),p=Math.cos(r),g=Math.sin(r);return this._createMat3FromValues([[n*l,n*h*g-p*a,a*g+n*p*h],[l*a,n*p+a*h*g,p*a*h-n*g],[-h,l*g,l*p]])},this._initCameraSensor=()=>{const t=this._calculateCameraFovForward(),i=this._calculateCameraFovReverse(),r=this._calculateCameraLook(),n=this._calculateImageDimensionsForward(),a=this._calculateImageDimensionsReverse(),l=this._calculatePlatformPositionMatrix(),h=this._calculatePlatformOrientation(),p=this._multiplyMat3(this._multiplyMat3(l,h),r);this._imageToEarthTransform=this._multiplyMat3(this._multiplyMat3(p,t),n);const g=this._multiplyMat3(a,i);this._earthToImageTransform=this._multiplyMat3(g,this._transposeMat3(p)),this._platformPositionEcef=this._projectPointToECEF(this.sensorLongitude,this.sensorLatitude,this.sensorAltitude||this.averageElevation)},this._metadataSupportsTransforms=t=>{if(!t?.size)return!1;const i=t.get(ne.EsriVideoWidth)?.value??0,r=t.get(ne.EsriVideoHeight)?.value??0;if(i<=0||r<=0)return!1;const n=t.get(ne.SensorEllipsoidHeight)?.value,a=t.get(ne.SensorTrueAltitude)?.value,l=t.get(ne.SensorLatitude)?.value,h=t.get(ne.SensorLongitude)?.value;if(n==null&&a==null||l==null||h==null)return!1;const p=t.get(ne.PlatformHeadingAngle)?.value,g=t.get(ne.PlatformPitchAngle)?.value,y=t.get(ne.PlatformRollAngle)?.value;if(p==null||g==null||y==null)return!1;const w=t.get(ne.SensorHorizontalFOV)?.value,E=t.get(ne.SensorVerticalFOV)?.value;if(w==null||E==null)return!1;const I=t.get(ne.SensorAzimuthAngle)?.value,v=t.get(ne.SensorElevationAngle)?.value,L=t.get(ne.SensorRollAngle)?.value;return I!=null&&v!=null&&L!=null},this._projectPointToECEF=(t,i,r)=>{const n=[];return Yl([t,i,r],Zr.WGS84,0,n,ya,0),new Jt({x:n[0],y:n[1],z:n[2],spatialReference:ya})},this._projectImageVectorToEllipsoid=(t,i)=>{const r=Wl.semiMajorAxis+i,n=Wl.semiMinorAxis+i,a=n/r,l=r/n,{x:h,y:p,z:g}=this._platformPositionEcef,y=g??this.averageElevation,w=ni(h,p,l*y),E=fa(t,t),I=fa(t,w),v=fa(w,w)-r*r,L=(-I-Math.sqrt(I*I-E*v))/E;if(L<0)return[NaN,NaN,NaN];const R=ga();return mg(R,w,t,L),R[2]=R[2]*a,R};const e=s?.videoMetadata;this._set("metadataSupportsTransforms",this._metadataSupportsTransforms(e)),this.metadataSupportsTransforms&&(this._extractValues(e),this._initCameraSensor())}transformGeoToImage(s,e,t){const i=this._platformPositionEcef;if(!i)return[0,0];const{x:r,y:n,z:a}=i,l=ni(r,n,a),h=this._projectPointToECEF(s,e,t||this.averageElevation),p=ga(),g=ni(h.x,h.y,h.z);gg(p,g,l),Xl(p,p,this._earthToImageTransform);const y=p[0],w=p[1],E=p[2];let I=ni(NaN,NaN,NaN);return isNaN(E)||(I=ni(y/E,w/E,E/E)),[I[0],I[1]]}transformImageToGeo(s,e){const t=ni(s,e,1),i=ga();Xl(i,t,this._imageToEarthTransform);const r=this._projectImageVectorToEllipsoid(i,this.averageElevation);let n;if(!isNaN(r[0])){const a=[];Yl([r[0],r[1],r[2]],ya,0,a,Zr.WGS84,0),n=new Jt({x:a[0],y:a[1],z:a[2],spatialReference:Zr.WGS84})}return n}};K([Z()],Qe.prototype,"averageElevation",void 0),K([Z()],Qe.prototype,"imageHeight",void 0),K([Z()],Qe.prototype,"imageWidth",void 0),K([Z({readOnly:!0})],Qe.prototype,"metadataSupportsTransforms",void 0),K([Z()],Qe.prototype,"platformHeadingAngle",void 0),K([Z()],Qe.prototype,"platformPitchAngle",void 0),K([Z()],Qe.prototype,"platformRollAngle",void 0),K([Z()],Qe.prototype,"sensorHeadingAngle",void 0),K([Z()],Qe.prototype,"sensorAltitude",void 0),K([Z()],Qe.prototype,"sensorHorizontalFieldOfView",void 0),K([Z()],Qe.prototype,"sensorLatitude",void 0),K([Z()],Qe.prototype,"sensorLongitude",void 0),K([Z()],Qe.prototype,"sensorPitchAngle",void 0),K([Z()],Qe.prototype,"sensorRollAngle",void 0),K([Z()],Qe.prototype,"sensorVerticalFieldOfView",void 0),K([Z()],Qe.prototype,"vttMetadata",void 0),Qe=K([Ds("esri.layers.video.VideoCameraSensorModel")],Qe);const Mg=Qe;var Kl,Ql;function Rn(){return Ql?Kl:(Ql=1,s=typeof window<"u"?window:an!==void 0?an:typeof self<"u"?self:{},Kl=s);var s}const k=vr(Rn());var Jl,Zl,va,eu,ba,tu,su,iu,ru,nu,au,ou,lu,uu,Ta,hu,Sa,du,Ea,cu,Ca,pu,mu,gu,fu,yu;function Id(){if(Zl)return Jl;Zl=1;var s=Array.prototype.slice;function e(t,i){for(("length"in t)||(t=[t]),t=s.call(t);t.length;){var r=t.shift(),n=i(r);if(n)return n;r.childNodes&&r.childNodes.length&&(t=s.call(r.childNodes).concat(t))}}return Jl=e}function Bg(){if(eu)return va;function s(e,t){if(!(this instanceof s))return new s(e,t);this.data=e,this.nodeValue=e,this.length=e.length,this.ownerDocument=t||null}return eu=1,va=s,s.prototype.nodeType=8,s.prototype.nodeName="#comment",s.prototype.toString=function(){return"[object Comment]"},va}function Fg(){if(tu)return ba;function s(e,t){if(!(this instanceof s))return new s(e);this.data=e||"",this.length=this.data.length,this.ownerDocument=t||null}return tu=1,ba=s,s.prototype.type="DOMTextNode",s.prototype.nodeType=3,s.prototype.nodeName="#text",s.prototype.toString=function(){return this.data},s.prototype.replaceData=function(e,t,i){var r=this.data,n=r.substring(0,e),a=r.substring(e+t,r.length);this.data=n+i+a,this.length=this.data.length},ba}function Pd(){if(iu)return su;function s(e){var t=this,i=e.type;e.target||(e.target=t),t.listeners||(t.listeners={});var r=t.listeners[i];if(r)return r.forEach(function(n){e.currentTarget=t,typeof n=="function"?n(e):n.handleEvent(e)});t.parentNode&&t.parentNode.dispatchEvent(e)}return iu=1,su=s}function Ld(){if(nu)return ru;function s(e,t){var i=this;i.listeners||(i.listeners={}),i.listeners[e]||(i.listeners[e]=[]),i.listeners[e].indexOf(t)===-1&&i.listeners[e].push(t)}return nu=1,ru=s}function Od(){if(ou)return au;function s(e,t){var i=this;if(i.listeners&&i.listeners[e]){var r=i.listeners[e],n=r.indexOf(t);n!==-1&&r.splice(n,1)}}return ou=1,au=s}function Ug(){if(uu)return lu;uu=1;var s=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];function e(g){switch(g.nodeType){case 3:return h(g.data);case 8:return"";default:return t(g)}}function t(g){var y=[],w=g.tagName;return g.namespaceURI==="http://www.w3.org/1999/xhtml"&&(w=w.toLowerCase()),y.push("<"+w+l(g)+n(g)),s.indexOf(w)>-1?y.push(" />"):(y.push(">"),g.childNodes.length?y.push.apply(y,g.childNodes.map(e)):g.textContent||g.innerText?y.push(h(g.textContent||g.innerText)):g.innerHTML&&y.push(g.innerHTML),y.push("")),y.join("")}function i(g,y){var w=typeof g[y];return y==="style"&&Object.keys(g.style).length>0||g.hasOwnProperty(y)&&(w==="string"||w==="boolean"||w==="number")&&y!=="nodeName"&&y!=="className"&&y!=="tagName"&&y!=="textContent"&&y!=="innerText"&&y!=="namespaceURI"&&y!=="innerHTML"}function r(g){if(typeof g=="string")return g;var y="";return Object.keys(g).forEach(function(w){var E=g[w];w=w.replace(/[A-Z]/g,function(I){return"-"+I.toLowerCase()}),y+=w+":"+E+";"}),y}function n(g){var y=g.dataset,w=[];for(var E in y)w.push({name:"data-"+E,value:y[E]});return w.length?a(w):""}function a(g){var y=[];return g.forEach(function(w){var E=w.name,I=w.value;E==="style"&&(I=r(I)),y.push(E+'="'+p(I)+'"')}),y.length?" "+y.join(" "):""}function l(g){var y=[];for(var w in g)i(g,w)&&y.push({name:w,value:g[w]});for(var E in g._attributes)for(var I in g._attributes[E]){var v=g._attributes[E][I],L=(v.prefix?v.prefix+":":"")+I;y.push({name:L,value:v.value})}return g.className&&y.push({name:"class",value:g.className}),y.length?a(y):""}function h(g){var y="";return typeof g=="string"?y=g:g&&(y=g.toString()),y.replace(/&/g,"&").replace(//g,">")}function p(g){return h(g).replace(/"/g,""")}return lu=e}function Nd(){if(hu)return Ta;hu=1;var s=Id(),e=Pd(),t=Ld(),i=Od(),r=Ug(),n="http://www.w3.org/1999/xhtml";function a(l,h,p){if(!(this instanceof a))return new a(l);var g=p===void 0?n:p||null;this.tagName=g===n?String(l).toUpperCase():l,this.nodeName=this.tagName,this.className="",this.dataset={},this.childNodes=[],this.parentNode=null,this.style={},this.ownerDocument=h||null,this.namespaceURI=g,this._attributes={},this.tagName==="INPUT"&&(this.type="text")}return Ta=a,a.prototype.type="DOMElement",a.prototype.nodeType=1,a.prototype.appendChild=function(l){return l.parentNode&&l.parentNode.removeChild(l),this.childNodes.push(l),l.parentNode=this,l},a.prototype.replaceChild=function(l,h){l.parentNode&&l.parentNode.removeChild(l);var p=this.childNodes.indexOf(h);return h.parentNode=null,this.childNodes[p]=l,l.parentNode=this,h},a.prototype.removeChild=function(l){var h=this.childNodes.indexOf(l);return this.childNodes.splice(h,1),l.parentNode=null,l},a.prototype.insertBefore=function(l,h){l.parentNode&&l.parentNode.removeChild(l);var p=h==null?-1:this.childNodes.indexOf(h);return p>-1?this.childNodes.splice(p,0,l):this.childNodes.push(l),l.parentNode=this,l},a.prototype.setAttributeNS=function(l,h,p){var g=null,y=h,w=h.indexOf(":");w>-1&&(g=h.substr(0,w),y=h.substr(w+1)),this.tagName==="INPUT"&&h==="type"?this.type=p:(this._attributes[l]||(this._attributes[l]={}))[y]={value:p,prefix:g}},a.prototype.getAttributeNS=function(l,h){var p=this._attributes[l],g=p&&p[h]&&p[h].value;return this.tagName==="INPUT"&&h==="type"?this.type:typeof g!="string"?null:g},a.prototype.removeAttributeNS=function(l,h){var p=this._attributes[l];p&&delete p[h]},a.prototype.hasAttributeNS=function(l,h){var p=this._attributes[l];return!!p&&h in p},a.prototype.setAttribute=function(l,h){return this.setAttributeNS(null,l,h)},a.prototype.getAttribute=function(l){return this.getAttributeNS(null,l)},a.prototype.removeAttribute=function(l){return this.removeAttributeNS(null,l)},a.prototype.hasAttribute=function(l){return this.hasAttributeNS(null,l)},a.prototype.removeEventListener=i,a.prototype.addEventListener=t,a.prototype.dispatchEvent=e,a.prototype.focus=function(){},a.prototype.toString=function(){return r(this)},a.prototype.getElementsByClassName=function(l){var h=l.split(" "),p=[];return s(this,function(g){if(g.nodeType===1){var y=(g.className||"").split(" ");h.every(function(w){return y.indexOf(w)!==-1})&&p.push(g)}}),p},a.prototype.getElementsByTagName=function(l){l=l.toLowerCase();var h=[];return s(this.childNodes,function(p){p.nodeType!==1||l!=="*"&&p.tagName.toLowerCase()!==l||h.push(p)}),h},a.prototype.contains=function(l){return s(this,function(h){return l===h})||!1},Ta}function qg(){if(du)return Sa;du=1;var s=Nd();function e(t){if(!(this instanceof e))return new e;this.childNodes=[],this.parentNode=null,this.ownerDocument=t||null}return Sa=e,e.prototype.type="DocumentFragment",e.prototype.nodeType=11,e.prototype.nodeName="#document-fragment",e.prototype.appendChild=s.prototype.appendChild,e.prototype.replaceChild=s.prototype.replaceChild,e.prototype.removeChild=s.prototype.removeChild,e.prototype.toString=function(){return this.childNodes.map(function(t){return String(t)}).join("")},Sa}function jg(){if(cu)return Ea;function s(e){}return cu=1,Ea=s,s.prototype.initEvent=function(e,t,i){this.type=e,this.bubbles=t,this.cancelable=i},s.prototype.preventDefault=function(){},Ea}function Hg(){if(pu)return Ca;pu=1;var s=Id(),e=Bg(),t=Fg(),i=Nd(),r=qg(),n=jg(),a=Pd(),l=Ld(),h=Od();function p(){if(!(this instanceof p))return new p;this.head=this.createElement("head"),this.body=this.createElement("body"),this.documentElement=this.createElement("html"),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body),this.childNodes=[this.documentElement],this.nodeType=9}Ca=p;var g=p.prototype;return g.createTextNode=function(y){return new t(y,this)},g.createElementNS=function(y,w){var E=y===null?null:String(y);return new i(w,this,E)},g.createElement=function(y){return new i(y,this)},g.createDocumentFragment=function(){return new r(this)},g.createEvent=function(y){return new n(y)},g.createComment=function(y){return new e(y,this)},g.getElementById=function(y){return y=String(y),s(this.childNodes,function(w){if(String(w.id)===y)return w})||null},g.getElementsByClassName=i.prototype.getElementsByClassName,g.getElementsByTagName=i.prototype.getElementsByTagName,g.contains=i.prototype.contains,g.removeEventListener=h,g.addEventListener=l,g.dispatchEvent=a,Ca}function $g(){if(gu)return mu;gu=1;var s=Hg();return mu=new s}function Rd(){if(yu)return fu;yu=1;var s,e=an!==void 0?an:typeof window<"u"?window:{},t=$g();return typeof document<"u"?s=document:(s=e["__GLOBAL_DOCUMENT_CACHE@4"])||(s=e["__GLOBAL_DOCUMENT_CACHE@4"]=t),fu=s}const re=vr(Rd());var _u,wa,vu,bu,Tu,Su,Eu,Cu,wu,Au,$r={exports:{}},xu={exports:{}};function Vg(){return _u||(_u=1,function(s){function e(){return s.exports=e=Object.assign?Object.assign.bind():function(t){for(var i=1;i=i.length?{done:!0}:{done:!1,value:i[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(i,r){if(i){if(typeof i=="string")return t(i,r);var n=Object.prototype.toString.call(i).slice(8,-1);return n==="Object"&&i.constructor&&(n=i.constructor.name),n==="Map"||n==="Set"?Array.from(i):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(i,r):void 0}}function t(i,r){(r==null||r>i.length)&&(r=i.length);for(var n=0,a=new Array(r);n=400&&n.statusCode<=599){var l=a;if(i)if(s.TextDecoder){var h=e(n.headers&&n.headers["content-type"]);try{l=new TextDecoder(h).decode(a)}catch{}}else l=String.fromCharCode.apply(null,new Uint8Array(a));t({cause:l})}else t(null,a)}}}function Yg(){if(Au)return $r.exports;Au=1;var s=Rn(),e=Vg(),t=zg(),i=Wg(),r=Gg();p.httpHandler=Xg(),p.requestInterceptorsStorage=new i,p.responseInterceptorsStorage=new i,p.retryManager=new r;var n=function(E){var I={};return E&&E.trim().split(` `).forEach(function(v){var L=v.indexOf(":"),R=v.slice(0,L).trim().toLowerCase(),M=v.slice(L+1).trim();I[R]===void 0?I[R]=M:Array.isArray(I[R])?I[R].push(M):I[R]=[I[R],M]}),I};function a(E,I){for(var v=0;v0&&(S=setTimeout(function(){if(!U){U=!0,H.abort("timeout");var Q=new Error("XMLHttpRequest timeout");Q.code="ETIMEDOUT",G(Q)}},E.timeout)),H.setRequestHeader)for(z in W)W.hasOwnProperty(z)&&H.setRequestHeader(z,W[z]);else if(E.headers&&!l(E.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in E&&(H.responseType=E.responseType),"beforeSend"in E&&typeof E.beforeSend=="function"&&E.beforeSend(H),H.send($||null),H}function y(E){try{if(E.responseType==="document")return E.responseXML;var I=E.responseXML&&E.responseXML.documentElement.nodeName==="parsererror";if(E.responseType===""&&!I)return E.responseXML}catch{}return null}function w(){}return $r.exports=p,$r.exports.default=p,p.XMLHttpRequest=s.XMLHttpRequest||w,p.XDomainRequest="withCredentials"in new p.XMLHttpRequest?p.XMLHttpRequest:s.XDomainRequest,a(["get","put","post","patch","head","delete"],function(E){p[E==="delete"?"del":E]=function(I,v,L){return(v=h(I,v,L)).method=E.toUpperCase(),g(v)}}),$r.exports}const Md=vr(Yg());var ku,Du,Iu,Pu,Lu,Ou,Nu,Aa={exports:{}};function Kg(){if(Du)return ku;Du=1;var s=Rd(),e=Object.create||function(){function S(){}return function(A){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return S.prototype=A,new S}}();function t(S,A){this.name="ParsingError",this.code=S.code,this.message=A||S.message}function i(S){function A($,W,te,J){return 3600*(0|$)+60*(0|W)+(0|te)+(0|J)/1e3}var B=S.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return B?B[3]?A(B[1],B[2],B[3].replace(":",""),B[4]):B[1]>59?A(B[1],B[2],0,B[4]):A(0,B[1],B[2],B[4]):null}function r(){this.values=e(null)}function n(S,A,B,$){var W=$?S.split($):[S];for(var te in W)if(typeof W[te]=="string"){var J=W[te].split(B);J.length===2&&A(J[0].trim(),J[1].trim())}}function a(S,A,B){var $=S;function W(){var oe=i(S);if(oe===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+$);return S=S.replace(/^[^\sa-zA-Z-]+/,""),oe}function te(oe,Q){var Y=new r;n(oe,function(ie,se){switch(ie){case"region":for(var ee=B.length-1;ee>=0;ee--)if(B[ee].id===se){Y.set(ie,B[ee].region);break}break;case"vertical":Y.alt(ie,se,["rl","lr"]);break;case"line":var ye=se.split(","),_e=ye[0];Y.integer(ie,_e),Y.percent(ie,_e)&&Y.set("snapToLines",!1),Y.alt(ie,_e,["auto"]),ye.length===2&&Y.alt("lineAlign",ye[1],["start","center","end"]);break;case"position":ye=se.split(","),Y.percent(ie,ye[0]),ye.length===2&&Y.alt("positionAlign",ye[1],["start","center","end"]);break;case"size":Y.percent(ie,se);break;case"align":Y.alt(ie,se,["start","center","end","left","right"])}},/:/,/\s/),Q.region=Y.get("region",null),Q.vertical=Y.get("vertical","");try{Q.line=Y.get("line","auto")}catch{}Q.lineAlign=Y.get("lineAlign","start"),Q.snapToLines=Y.get("snapToLines",!0),Q.size=Y.get("size",100);try{Q.align=Y.get("align","center")}catch{Q.align=Y.get("align","middle")}try{Q.position=Y.get("position","auto")}catch{Q.position=Y.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},Q.align)}Q.positionAlign=Y.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},Q.align)}function J(){S=S.replace(/^\s+/,"")}if(J(),A.startTime=W(),J(),S.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+$);S=S.substr(3),J(),A.endTime=W(),J(),te(S,A)}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},r.prototype={set:function(S,A){this.get(S)||A===""||(this.values[S]=A)},get:function(S,A,B){return B?this.has(S)?this.values[S]:A[B]:this.has(S)?this.values[S]:A},has:function(S){return S in this.values},alt:function(S,A,B){for(var $=0;$=0&&A<=100)&&(this.set(S,A),!0)}};var l=s.createElement&&s.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},p={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},g={v:"title",lang:"lang"},y={rt:"ruby"};function w(S,A){function B(){if(!A)return null;function _e(me){return A=A.substr(me.length),me}var ve=A.match(/^([^<]*)(<[^>]*>?)?/);return _e(ve[1]?ve[1]:ve[2])}function $(_e){return l.innerHTML=_e,_e=l.textContent,l.textContent="",_e}function W(_e,ve){return!y[ve.localName]||y[ve.localName]===_e.localName}function te(_e,ve){var me=h[_e];if(!me)return null;var Fe=S.document.createElement(me),et=g[_e];return et&&ve&&(Fe[et]=ve.trim()),Fe}for(var J,oe=S.document.createElement("div"),Q=oe,Y=[];(J=B())!==null;)if(J[0]!=="<")Q.appendChild(S.document.createTextNode($(J)));else{if(J[1]==="/"){Y.length&&Y[Y.length-1]===J.substr(2).replace(">","")&&(Y.pop(),Q=Q.parentNode);continue}var ie,se=i(J.substr(1,J.length-2));if(se){ie=S.document.createProcessingInstruction("timestamp",se),Q.appendChild(ie);continue}var ee=J.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!ee||!(ie=te(ee[1],ee[3]))||!W(Q,ie))continue;if(ee[2]){var ye=ee[2].split(".");ye.forEach(function(_e){var ve=/^bg_/.test(_e),me=ve?_e.slice(3):_e;if(p.hasOwnProperty(me)){var Fe=ve?"background-color":"color",et=p[me];ie.style[Fe]=et}}),ie.className=ye.join(" ")}Y.push(ee[1]),Q.appendChild(ie),Q=ie}return oe}var E=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function I(S){for(var A=0;A=B[0]&&S<=B[1])return!0}return!1}function v(S){var A=[],B="";if(!S||!S.childNodes)return"ltr";function $(J,oe){for(var Q=oe.childNodes.length-1;Q>=0;Q--)J.push(oe.childNodes[Q])}function W(J){if(!J||!J.length)return null;var oe=J.pop(),Q=oe.textContent||oe.innerText;if(Q){var Y=Q.match(/^.*(\n|\r)/);return Y?(J.length=0,Y[0]):Q}return oe.tagName==="ruby"?W(J):oe.childNodes?($(J,oe),W(J)):void 0}for($(A,S);B=W(A);)for(var te=0;te=0&&S.line<=100))return S.line;if(!S.track||!S.track.textTrackList||!S.track.textTrackList.mediaElement)return-1;for(var A=S.track,B=A.textTrackList,$=0,W=0;WYe&&(et=new O(me),We=Ye),me=new O(Pe)}return et||Pe}var te=new O(A),J=A.cue,oe=L(J),Q=[];if(J.snapToLines){var Y;switch(J.vertical){case"":Q=["+y","-y"],Y="height";break;case"rl":Q=["+x","-x"],Y="width";break;case"lr":Q=["-x","+x"],Y="width"}var ie=te.lineHeight,se=ie*Math.round(oe),ee=B[Y]+ie,ye=Q[0];Math.abs(se)>ee&&(se=se<0?-1:1,se*=Math.ceil(ee/ie)*ie),oe<0&&(se+=J.vertical===""?B.height:B.width,Q=Q.reverse()),te.move(ye,se)}else{var _e=te.lineHeight/B.height*100;switch(J.lineAlign){case"center":oe-=_e/2;break;case"end":oe-=_e}switch(J.vertical){case"":A.applyStyles({top:A.formatStyle(oe,"%")});break;case"rl":A.applyStyles({left:A.formatStyle(oe,"%")});break;case"lr":A.applyStyles({right:A.formatStyle(oe,"%")})}Q=["+y","-x","+x","-y"],te=new O(A)}var ve=W(te,Q);A.move(ve.toCSSCompatValues(B))}function N(){}R.prototype.applyStyles=function(S,A){for(var B in A=A||this.div,S)S.hasOwnProperty(B)&&(A.style[B]=S[B])},R.prototype.formatStyle=function(S,A){return S===0?0:S+A},M.prototype=e(R.prototype),M.prototype.constructor=M,O.prototype.move=function(S,A){switch(A=A!==void 0?A:this.lineHeight,S){case"+x":this.left+=A,this.right+=A;break;case"-x":this.left-=A,this.right-=A;break;case"+y":this.top+=A,this.bottom+=A;break;case"-y":this.top-=A,this.bottom-=A}},O.prototype.overlaps=function(S){return this.leftS.left&&this.topS.top},O.prototype.overlapsAny=function(S){for(var A=0;A=S.top&&this.bottom<=S.bottom&&this.left>=S.left&&this.right<=S.right},O.prototype.overlapsOppositeAxis=function(S,A){switch(A){case"+x":return this.leftS.right;case"+y":return this.topS.bottom}},O.prototype.intersectPercentage=function(S){return Math.max(0,Math.min(this.right,S.right)-Math.max(this.left,S.left))*Math.max(0,Math.min(this.bottom,S.bottom)-Math.max(this.top,S.top))/(this.height*this.width)},O.prototype.toCSSCompatValues=function(S){return{top:this.top-S.top,bottom:S.bottom-this.bottom,left:this.left-S.left,right:S.right-this.right,height:this.height,width:this.width}},O.getSimpleBoxPosition=function(S){var A=S.div?S.div.offsetHeight:S.tagName?S.offsetHeight:0,B=S.div?S.div.offsetWidth:S.tagName?S.offsetWidth:0,$=S.div?S.div.offsetTop:S.tagName?S.offsetTop:0;return{left:(S=S.div?S.div.getBoundingClientRect():S.tagName?S.getBoundingClientRect():S).left,right:S.right,top:S.top||$,height:S.height||A,bottom:S.bottom||$+(S.height||A),width:S.width||B}},N.StringDecoder=function(){return{decode:function(S){if(!S)return"";if(typeof S!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(S))}}},N.convertCueToDOMTree=function(S,A){return S&&A?w(S,A):null};var z=.05,U="sans-serif",H="1.5%";return N.processCues=function(S,A,B){if(!S||!A||!B)return null;for(;B.firstChild;)B.removeChild(B.firstChild);var $=S.document.createElement("div");function W(Y){for(var ie=0;iethis.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(J(e,"play",()=>this.requestRender()))},b))}getMesh(t){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=K(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(e==null)return;const{context:s}=t,{videoWidth:a,videoHeight:r}=e;if(a!==0&&r!==0){if(this.texture)e.paused||this.texture.setData(e);else{const i=new nt;i.wrapMode=ot.CLAMP_TO_EDGE,i.preMultiplyAlpha=!0,i.width=a,i.height=r,this.texture=new at(s,i,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,s,a){const r=this.element,i=this._getFrameInfo();if(!r||!i)return;this._initializeData(t,i,s);const{controlPoints:l,horizon:h}=i,m=Math.sqrt(l.length),p=m,{x:o,y}=t,u=this._vertices,T=l[0],G=l[m-1],X=l[(p-1)*m],Y=l[(p-1)*m+m-1],O=g(h?h[0].mapPoint:T.mapPoint,s),P=g(h?h[1].mapPoint:G.mapPoint,s),f=g(X.mapPoint,s),L=g(Y.mapPoint,s);this.clipGeometry=h?new rt({geometry:N.fromJSON({rings:[[[f.x,f.y],[L.x,L.y],[P.x,P.y],[O.x,O.y],[f.x,f.y]]],spatialReference:s})}):null;for(let c=0;cw?E=S:D>H&&ci)),r=this.element.videoWidth/a;for(let i=0;ithis.symbolColor,()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor},b)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new W({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new Q,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new mt({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new lt(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([M(()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),b),M(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),b)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=F(this.graphicsView)}supportsSpatialReference(n){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(n){this.graphicsView.processUpdate(n)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:n}=this.layer,{visibleTelemetryElements:t}=this;n&&t&&(t.frameOutline&&n.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&n.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&n.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,t.sensorLocation&&n.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&n.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const n=new ht(this.layer.videoElement);this.addAttachHandles([M(()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints],()=>{const{visibleTelemetryElements:t}=this;t?.frame?(n.frameHorizonPoints=this.layer.frameHorizonPoints,n.groundControlPoints=this.layer.groundControlPoints,n.opacity=1):n.opacity=0},b)]),this._overlayContainer.addChild(n),this.view.stage.requestRender()}};C([V()],d.prototype,"graphicsView",void 0),C([V()],d.prototype,"layer",void 0),C([V()],d.prototype,"symbolColor",void 0),C([V({type:W})],d.prototype,"visibleTelemetryElements",void 0),d=C([k("esri.views.2d.layers.VideoLayerView2D")],d);const ui=d;export{ui as default}; +import{ar as I,bi as v,d$ as $,d_ as q,e0 as U,aA as F,ah as M,aL as b,v as C,S as V,i as k,au as j,aF as B,L as J,hT as K,l as N,as as z,w as R}from"./story-Doly9N9p.js";import Z from"./GraphicsLayer-DfeGaYc1-DRpZ_f0G.js";import{a as W}from"./TelemetryDisplay-Bq2PXfI8-BY_FrklG.js";import{A as Q}from"./OverlayContainer-BEHcBpu0-4o7Hmqgb.js";import{o as tt}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{K as g}from"./projection-BA9M1R7d-CAbqHZiw.js";import{T as et}from"./Container-BcuL1ZEG-DVZvemLA.js";import{X as it,A as rt,Y as st}from"./LayerView-Bish-E63-DK1SFHE3.js";import{G as ot}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as nt,V as at}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{d as lt}from"./GraphicContainer-DuOHUciE-XlTfJEn3.js";import{X as mt}from"./GraphicsView2D-C4wYE2ut-DdVMjjMv.js";import"./main-QGPoLsvl.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./Rect-DD6XS68q-D_hsV3ag.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";const x=2;class ht extends et{constructor(t){super(),this.element=t,this._handles=new j,this.isWrapAround=!1,this.perspectiveTransform=tt(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(B(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(J(e,"play",()=>this.requestRender()))},b))}getMesh(t){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=K(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(e==null)return;const{context:s}=t,{videoWidth:a,videoHeight:r}=e;if(a!==0&&r!==0){if(this.texture)e.paused||this.texture.setData(e);else{const i=new nt;i.wrapMode=ot.CLAMP_TO_EDGE,i.preMultiplyAlpha=!0,i.width=a,i.height=r,this.texture=new at(s,i,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,s,a){const r=this.element,i=this._getFrameInfo();if(!r||!i)return;this._initializeData(t,i,s);const{controlPoints:l,horizon:h}=i,m=Math.sqrt(l.length),p=m,{x:o,y}=t,u=this._vertices,T=l[0],G=l[m-1],X=l[(p-1)*m],Y=l[(p-1)*m+m-1],O=g(h?h[0].mapPoint:T.mapPoint,s),P=g(h?h[1].mapPoint:G.mapPoint,s),f=g(X.mapPoint,s),L=g(Y.mapPoint,s);this.clipGeometry=h?new rt({geometry:N.fromJSON({rings:[[[f.x,f.y],[L.x,L.y],[P.x,P.y],[O.x,O.y],[f.x,f.y]]],spatialReference:s})}):null;for(let c=0;cw?E=S:D>H&&ci)),r=this.element.videoWidth/a;for(let i=0;ithis.symbolColor,()=>{this._frameOutlineGraphic.symbol.outline.color=this.symbolColor,this._sensorTrailGraphic.symbol.color=this.symbolColor,this._lineOfSightGraphic.symbol.color=this.symbolColor,this._sensorLocationGraphic.symbol.color=this.symbolColor,this._frameCenterGraphic.symbol.color=this.symbolColor},b)),this._graphicsLayer.graphics.addMany([this._frameOutlineGraphic,this._sensorTrailGraphic,this._lineOfSightGraphic,this._sensorLocationGraphic,this._frameCenterGraphic]),this.visibleTelemetryElements=new W({frame:this.layer.telemetryDisplay?.frame??!1,frameCenter:this.layer.telemetryDisplay?.frameCenter??!0,frameOutline:this.layer.telemetryDisplay?.frameOutline??!0,lineOfSight:this.layer.telemetryDisplay?.lineOfSight??!0,sensorLocation:this.layer.telemetryDisplay?.sensorLocation??!0,sensorTrail:this.layer.telemetryDisplay?.sensorTrail??!0})}attach(){this._overlayContainer=new Q,this.container.addChild(this._overlayContainer),this._addOverlayMultipoint(),this.graphicsView=new mt({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this._graphicsLayer.graphics,container:new lt(this.view.featuresTilingScheme)}),this.container.addChild(this.graphicsView.container),this.addAttachHandles(this._graphicsLayer.on("graphic-update",this.graphicsView.graphicUpdateHandler)),this.addAttachHandles([M(()=>[this.layer.telemetryDisplay?.frame,this.layer.telemetryDisplay?.frameCenter,this.layer.telemetryDisplay?.frameOutline,this.layer.telemetryDisplay?.sensorLocation,this.layer.telemetryDisplay?.sensorTrail,this.layer.telemetryDisplay?.lineOfSight],()=>this._updateVisibleTelemetryElements(),b),M(()=>[this.layer.telemetry,this.visibleTelemetryElements?.frameCenter,this.visibleTelemetryElements?.frameOutline,this.visibleTelemetryElements?.sensorLocation,this.visibleTelemetryElements?.sensorTrail,this.visibleTelemetryElements?.lineOfSight],()=>this._updateGraphicGeometries(),b)])}detach(){this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this.graphicsView=F(this.graphicsView)}supportsSpatialReference(n){return!0}moveEnd(){}viewChange(){this.graphicsView.viewChange()}update(n){this.graphicsView.processUpdate(n)}isUpdating(){return!this.graphicsView||this.graphicsView.updating}_updateVisibleTelemetryElements(){this.visibleTelemetryElements&&this.layer.telemetryDisplay&&(this.visibleTelemetryElements.frame=this.layer.telemetryDisplay.frame,this.visibleTelemetryElements.frameCenter=this.layer.telemetryDisplay.frameCenter,this.visibleTelemetryElements.frameOutline=this.layer.telemetryDisplay.frameOutline,this.visibleTelemetryElements.lineOfSight=this.layer.telemetryDisplay.lineOfSight,this.visibleTelemetryElements.sensorLocation=this.layer.telemetryDisplay.sensorLocation,this.visibleTelemetryElements.sensorTrail=this.layer.telemetryDisplay.sensorTrail)}_updateGraphicGeometries(){const{telemetry:n}=this.layer,{visibleTelemetryElements:t}=this;n&&t&&(t.frameOutline&&n.frameOutline?this._frameOutlineGraphic.geometry=this.layer.telemetry.frameOutline:this._frameOutlineGraphic.geometry=null,t.sensorTrail&&n.sensorTrail?this._sensorTrailGraphic.geometry=this.layer.telemetry.sensorTrail:this._sensorTrailGraphic.geometry=null,t.lineOfSight&&n.lineOfSight?this._lineOfSightGraphic.geometry=this.layer.telemetry.lineOfSight:this._lineOfSightGraphic.geometry=null,t.sensorLocation&&n.sensorLocation?this._sensorLocationGraphic.geometry=this.layer.telemetry.sensorLocation:this._sensorLocationGraphic.geometry=null,t.frameCenter&&n.frameCenter?this._frameCenterGraphic.geometry=this.layer.telemetry.frameCenter:this._frameCenterGraphic.geometry=null)}async _addOverlayMultipoint(){if(!this.layer.videoElement)return;const n=new ht(this.layer.videoElement);this.addAttachHandles([M(()=>[this.layer.frameHorizonPoints,this.layer.groundControlPoints],()=>{const{visibleTelemetryElements:t}=this;t?.frame?(n.frameHorizonPoints=this.layer.frameHorizonPoints,n.groundControlPoints=this.layer.groundControlPoints,n.opacity=1):n.opacity=0},b)]),this._overlayContainer.addChild(n),this.view.stage.requestRender()}};C([V()],d.prototype,"graphicsView",void 0),C([V()],d.prototype,"layer",void 0),C([V()],d.prototype,"symbolColor",void 0),C([V({type:W})],d.prototype,"visibleTelemetryElements",void 0),d=C([k("esri.views.2d.layers.VideoLayerView2D")],d);const ui=d;export{ui as default}; diff --git a/custom-toc-highlight/assets/ViewshedLayer-BYX-h7eL-C8exBQCc.js b/custom-toc-highlight/assets/ViewshedLayer-BYX-h7eL-BRcm_3EL.js similarity index 84% rename from custom-toc-highlight/assets/ViewshedLayer-BYX-h7eL-C8exBQCc.js rename to custom-toc-highlight/assets/ViewshedLayer-BYX-h7eL-BRcm_3EL.js index 1b5e9a01..19d559f1 100644 --- a/custom-toc-highlight/assets/ViewshedLayer-BYX-h7eL-C8exBQCc.js +++ b/custom-toc-highlight/assets/ViewshedLayer-BYX-h7eL-BRcm_3EL.js @@ -1 +1 @@ -import{bA as C,d8 as H,v as t,S as i,w as J,ad as K,ab as U,i as F,ag as M,dA as X,ah as L,ax as P,ac as Y,aP as G,am as Z,n as k,bj as N,ae as q}from"./story-BfX8CRfG.js";import{n as B,u as I}from"./featureReferenceUtils-Ct4KY5u7-cLRdtKlb.js";import{c as g}from"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import{y as Q}from"./Analysis-BPgJ-FCw-D6W8PmkR.js";import{X as W}from"./projection-BA9M1R7d-BYoCXVXt.js";import{m as ee}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as te}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import"./main-ugzBrWNm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./sphere-BenPORjV-DaZ5Vv8x.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-CVSP2GQG.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./boundedPlane-DlvE0eNx-dpkNyaGh.js";import"./lineSegment-CcqvCARM-CF4YE8GC.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";let o=class extends C(G){constructor(e){super(e),this.observer=null,this.farDistance=1e3,this.heading=0,this.tilt=90,this.horizontalFieldOfView=45,this.verticalFieldOfView=45,this.feature=null}isValid(){return this.observer!=null&&this.farDistance>0}equals(e){return H(this.observer,e.observer)&&this.farDistance===e.farDistance&&this.heading===e.heading&&this.tilt===e.tilt&&this.horizontalFieldOfView===e.horizontalFieldOfView&&this.verticalFieldOfView===e.verticalFieldOfView&&B(this.feature,e.feature)}};t([i({type:J,json:{write:!0}})],o.prototype,"observer",void 0),t([i({type:Number,nonNullable:!0,range:{min:0},json:{write:{isRequired:!0}}})],o.prototype,"farDistance",void 0),t([i({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),K(e=>g.normalize(U(e),void 0,!0))],o.prototype,"heading",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"tilt",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:360},json:{write:{isRequired:!0}}})],o.prototype,"horizontalFieldOfView",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"verticalFieldOfView",void 0),t([i(I)],o.prototype,"feature",void 0),t([i({json:{read:!1}})],o.prototype,"isValid",null),o=t([F("esri.analysis.Viewshed")],o);const T=o,E=M.ofType(T);let p=class extends Q{constructor(e){super(e),this.type="viewshed",this._extent=null}initialize(){this.addHandles(L(()=>this._computeExtent(),e=>{e.pending==null&&(this._extent=e.extent)},P))}get viewsheds(){return this._get("viewsheds")||new E}set viewsheds(e){this._set("viewsheds",Z(e,this.viewsheds,E))}get spatialReference(){for(const e of this.viewsheds)if(e.observer!=null)return e.observer.spatialReference;return null}get extent(){return this._extent}get requiredPropertiesForEditing(){return this.viewsheds.items.map(({observer:e})=>e)}async waitComputeExtent(){const e=this._computeExtent();e.pending!=null&&await e.pending}_computeExtent(){const{spatialReference:e}=this;if(e==null)return{pending:null,extent:null};const s=this.viewsheds.filter(r=>r.observer!=null),c=s.map(r=>r.observer).toArray(),l=W(c,e);return l.pending!=null?{pending:l.pending,extent:null}:{pending:null,extent:l.geometries.map((r,u)=>{const x=s.at(u);return r!=null&&x!=null?this._computeViewshedExtent(this.viewsheds.at(u),r):null}).filter(r=>r!=null).reduce((r,u)=>re(r,u),null)}}_computeViewshedExtent(e,s){const{farDistance:c,heading:l,tilt:r,horizontalFieldOfView:u,verticalFieldOfView:x}=e,{spatialReference:j}=s,b=u/2,V=x/2,O=c/j.metersPerUnit,$=[g.normalize(l-b),l,g.normalize(l+b)],d=k.fromPoint(s),f=w=>{const h=$.map(a=>g.normalize(a-w));if(h[0]>h[2]||u===360)return O;const m=h.map(a=>Math.abs(a>180?360-a:a)).reduce((a,v)=>a>v?v:a);return m>90?0:O*Math.cos(N(m))};d.xmax+=f(90),d.xmin-=f(-90),d.ymax+=f(0),d.ymin-=f(180);const y=s.z;if(y!=null){let w=y,h=y;const m=r-90,a=q(m+V,-90,90),v=q(m-V,-90,90),z=j?.isGeographic?c:O;w+=z*R(a),h+=z*R(v);const S=A(V)*z,_=R(m)*S*(1-A(b));r<90&&(w-=_),r>90&&(h-=_),d.zmax=Math.max(w,y),d.zmin=Math.min(h,y)}return d}clear(){this.viewsheds.removeAll()}};function re(e,s){return e==null?s:s==null?e:e.union(s)}function A(e){return Math.cos(N(e))}function R(e){return Math.sin(N(e))}t([i({type:["viewshed"]})],p.prototype,"type",void 0),t([i({cast:X,type:E,nonNullable:!0})],p.prototype,"viewsheds",null),t([i({readOnly:!0})],p.prototype,"spatialReference",null),t([i()],p.prototype,"_extent",void 0),t([i({readOnly:!0})],p.prototype,"extent",null),t([i({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([F("esri.analysis.ViewshedAnalysis")],p);const D=p;let n=class extends ie(ee(te)){constructor(e){super(e),this.type="viewshed",this.operationalLayerType="ViewshedLayer",this.source=new D,this.opacity=1}initialize(){this.addHandles(L(()=>this.source,(e,s)=>{s!=null&&s.parent===this&&(s.parent=null),e!=null&&(e.parent=this)},P))}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new D)}get analysis(){return this.source}set analysis(e){this.source=e}get viewsheds(){return this.source.viewsheds}set viewsheds(e){this.source.viewsheds=e}writeViewsheds(e,s,c,l){s.viewsheds=e.filter(r=>r.isValid()).map(r=>r.toJSON(l)).toJSON()}};t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i({type:["ViewshedLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0})],n.prototype,"source",void 0),t([i({readOnly:!0})],n.prototype,"spatialReference",null),t([i({readOnly:!0})],n.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}}}})],n.prototype,"opacity",void 0),t([i({type:["show","hide"]})],n.prototype,"listMode",void 0),t([i({type:M.ofType(T),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],n.prototype,"viewsheds",null),t([Y("web-scene","viewsheds")],n.prototype,"writeViewsheds",null),n=t([F("esri.layers.ViewshedLayer")],n);const De=n;export{De as default}; +import{bA as C,d8 as H,v as t,S as i,w as J,ad as K,ab as U,i as F,ag as M,dA as X,ah as L,ax as P,ac as Y,aP as G,am as Z,n as k,bj as N,ae as q}from"./story-Doly9N9p.js";import{n as B,u as I}from"./featureReferenceUtils-Ct4KY5u7-DuNl8LtH.js";import{c as g}from"./Cyclical-C_9rKUUQ-DyGueJyk.js";import{y as Q}from"./Analysis-BPgJ-FCw-CJ_Utx59.js";import{X as W}from"./projection-BA9M1R7d-CAbqHZiw.js";import{m as ee}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as te}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{E as ie}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import"./main-QGPoLsvl.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./sphere-BenPORjV-B4uz1SYF.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./plane-Dt8R0KeE-Bqc6oVGz.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./boundedPlane-DlvE0eNx-BQ9Xop25.js";import"./lineSegment-CcqvCARM-CDEWcAzV.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";let o=class extends C(G){constructor(e){super(e),this.observer=null,this.farDistance=1e3,this.heading=0,this.tilt=90,this.horizontalFieldOfView=45,this.verticalFieldOfView=45,this.feature=null}isValid(){return this.observer!=null&&this.farDistance>0}equals(e){return H(this.observer,e.observer)&&this.farDistance===e.farDistance&&this.heading===e.heading&&this.tilt===e.tilt&&this.horizontalFieldOfView===e.horizontalFieldOfView&&this.verticalFieldOfView===e.verticalFieldOfView&&B(this.feature,e.feature)}};t([i({type:J,json:{write:!0}})],o.prototype,"observer",void 0),t([i({type:Number,nonNullable:!0,range:{min:0},json:{write:{isRequired:!0}}})],o.prototype,"farDistance",void 0),t([i({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),K(e=>g.normalize(U(e),void 0,!0))],o.prototype,"heading",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"tilt",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:360},json:{write:{isRequired:!0}}})],o.prototype,"horizontalFieldOfView",void 0),t([i({type:Number,nonNullable:!0,range:{min:0,max:180},json:{write:{isRequired:!0}}})],o.prototype,"verticalFieldOfView",void 0),t([i(I)],o.prototype,"feature",void 0),t([i({json:{read:!1}})],o.prototype,"isValid",null),o=t([F("esri.analysis.Viewshed")],o);const T=o,E=M.ofType(T);let p=class extends Q{constructor(e){super(e),this.type="viewshed",this._extent=null}initialize(){this.addHandles(L(()=>this._computeExtent(),e=>{e.pending==null&&(this._extent=e.extent)},P))}get viewsheds(){return this._get("viewsheds")||new E}set viewsheds(e){this._set("viewsheds",Z(e,this.viewsheds,E))}get spatialReference(){for(const e of this.viewsheds)if(e.observer!=null)return e.observer.spatialReference;return null}get extent(){return this._extent}get requiredPropertiesForEditing(){return this.viewsheds.items.map(({observer:e})=>e)}async waitComputeExtent(){const e=this._computeExtent();e.pending!=null&&await e.pending}_computeExtent(){const{spatialReference:e}=this;if(e==null)return{pending:null,extent:null};const s=this.viewsheds.filter(r=>r.observer!=null),c=s.map(r=>r.observer).toArray(),l=W(c,e);return l.pending!=null?{pending:l.pending,extent:null}:{pending:null,extent:l.geometries.map((r,u)=>{const x=s.at(u);return r!=null&&x!=null?this._computeViewshedExtent(this.viewsheds.at(u),r):null}).filter(r=>r!=null).reduce((r,u)=>re(r,u),null)}}_computeViewshedExtent(e,s){const{farDistance:c,heading:l,tilt:r,horizontalFieldOfView:u,verticalFieldOfView:x}=e,{spatialReference:j}=s,b=u/2,V=x/2,O=c/j.metersPerUnit,$=[g.normalize(l-b),l,g.normalize(l+b)],d=k.fromPoint(s),f=w=>{const h=$.map(a=>g.normalize(a-w));if(h[0]>h[2]||u===360)return O;const m=h.map(a=>Math.abs(a>180?360-a:a)).reduce((a,v)=>a>v?v:a);return m>90?0:O*Math.cos(N(m))};d.xmax+=f(90),d.xmin-=f(-90),d.ymax+=f(0),d.ymin-=f(180);const y=s.z;if(y!=null){let w=y,h=y;const m=r-90,a=q(m+V,-90,90),v=q(m-V,-90,90),z=j?.isGeographic?c:O;w+=z*R(a),h+=z*R(v);const S=A(V)*z,_=R(m)*S*(1-A(b));r<90&&(w-=_),r>90&&(h-=_),d.zmax=Math.max(w,y),d.zmin=Math.min(h,y)}return d}clear(){this.viewsheds.removeAll()}};function re(e,s){return e==null?s:s==null?e:e.union(s)}function A(e){return Math.cos(N(e))}function R(e){return Math.sin(N(e))}t([i({type:["viewshed"]})],p.prototype,"type",void 0),t([i({cast:X,type:E,nonNullable:!0})],p.prototype,"viewsheds",null),t([i({readOnly:!0})],p.prototype,"spatialReference",null),t([i()],p.prototype,"_extent",void 0),t([i({readOnly:!0})],p.prototype,"extent",null),t([i({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([F("esri.analysis.ViewshedAnalysis")],p);const D=p;let n=class extends ie(ee(te)){constructor(e){super(e),this.type="viewshed",this.operationalLayerType="ViewshedLayer",this.source=new D,this.opacity=1}initialize(){this.addHandles(L(()=>this.source,(e,s)=>{s!=null&&s.parent===this&&(s.parent=null),e!=null&&(e.parent=this)},P))}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return this.source.spatialReference}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new D)}get analysis(){return this.source}set analysis(e){this.source=e}get viewsheds(){return this.source.viewsheds}set viewsheds(e){this.source.viewsheds=e}writeViewsheds(e,s,c,l){s.viewsheds=e.filter(r=>r.isValid()).map(r=>r.toJSON(l)).toJSON()}};t([i({json:{read:!1},readOnly:!0})],n.prototype,"type",void 0),t([i({type:["ViewshedLayer"]})],n.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0})],n.prototype,"source",void 0),t([i({readOnly:!0})],n.prototype,"spatialReference",null),t([i({readOnly:!0})],n.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}}}})],n.prototype,"opacity",void 0),t([i({type:["show","hide"]})],n.prototype,"listMode",void 0),t([i({type:M.ofType(T),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],n.prototype,"viewsheds",null),t([Y("web-scene","viewsheds")],n.prototype,"writeViewsheds",null),n=t([F("esri.layers.ViewshedLayer")],n);const De=n;export{De as default}; diff --git a/custom-toc-highlight/assets/VoxelLayer-KL84GttA-aMQGBYli.js b/custom-toc-highlight/assets/VoxelLayer-KL84GttA-C5r9pgtQ.js similarity index 94% rename from custom-toc-highlight/assets/VoxelLayer-KL84GttA-aMQGBYli.js rename to custom-toc-highlight/assets/VoxelLayer-KL84GttA-C5r9pgtQ.js index 426c053e..54d5ad86 100644 --- a/custom-toc-highlight/assets/VoxelLayer-KL84GttA-aMQGBYli.js +++ b/custom-toc-highlight/assets/VoxelLayer-KL84GttA-C5r9pgtQ.js @@ -1 +1 @@ -import{aa as L,ab as N,v as t,S as o,ad as ce,i as m,jy as ot,bB as j,ar as k,ag as c,am as de,ae as le,bl as ae,J as Me,a1 as q,W as rt,o as fe,n as Oe,hZ as ie,a0 as Te,bL as st,e as g,P as te,aC as nt,w as be,il as lt,dg as at}from"./story-BfX8CRfG.js";import{m as pt}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{l as Re,A as Ce,w as Be,r as ut,x as ct,q as dt,j as yt}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{D as ht}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{n as mt}from"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import{a as gt}from"./ArcGISService-BYA-y6X6-C_YhndKK.js";import{i as vt}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{E as ft}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as bt}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{S as St}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{W as xt}from"./SceneService-BZqGtWmG-BWCHkX1O.js";import{j as wt}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{_ as Vt,Z as jt}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{y as W}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{o as Nt}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{w as Ee,r as zt}from"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import{c as z}from"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import{C as It}from"./persistable-C6RBwzJi-CMdP5i4h.js";import{A as Se,_ as Rt}from"./quat-BODLR7mS-BrXZAXDf.js";import{e as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{u as Ae,r as De}from"./common-CYWrYyJl-E8-sukrT.js";import{k as ke,j as Pe}from"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import{w as Tt}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./main-ugzBrWNm.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./jsonContext-BA8GHqVk-CWQlLGSw.js";import"./resourceUtils-BmW6QqlX-B1DAUGNs.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-BROWZCZ1.js";import"./saveUtils-CIYk-dsQ-VGcOewby.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-BNH6JkTz.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";const v=at(),qe=me(),Le=me(),$e=me(),Ue=ie(0,0,1),At=ie(0,1,0),Dt=ie(1,0,0);function J(e){Ce(v,e),Re(v,v);const i=Math.atan2(v[1],v[0]),r=Se(me(),Ue,-i);Be(v,v,r);const s=-1*Math.atan2(v[2],v[0]);return[Ae(i)+270,Ae(s)+90]}function ye(e,i){return Se(Le,Ue,De(e-270)),Se($e,At,De(i-90)),Rt(qe,Le,$e),Ce(v,Dt),Be(v,v,qe),Re(v,v),[v[0],v[1],v[2]]}let R=class extends L(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]=J(this.normal);return z.normalize(N(e),0,!0)}set orientation(e){const i=ye(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]=J(this.normal);return z.normalize(N(i),0,!0)}set tilt(e){const i=ye(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}}),ce(e=>z.normalize(N(e),0,!0))],R.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(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([m("esri.layers.voxel.VoxelSlice")],R);const he=R;let b=class extends L(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]=J(this.normal);return z.normalize(N(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(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:ot}},write:{enabled:!0,isRequired:!0}}}),It({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:[he],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([m("esri.layers.voxel.VoxelSection")],b);const xe=b;let H=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}})],H.prototype,"diffuseFactor",void 0),t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"specularFactor",void 0),H=t([m("esri.layers.voxel.VoxelSimpleShading")],H);const We=H;let T=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}})],T.prototype,"continuity",void 0),t([o({type:Boolean,json:{write:!0}})],T.prototype,"hasNoData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"noData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"offset",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"scale",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],T.prototype,"type",void 0),T=t([m("esri.layers.voxel.VoxelFormat")],T);const Fe=T;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:Fe,json:{write:!0}})],V.prototype,"originalFormat",void 0),t([o({type:Fe,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([m("esri.layers.voxel.VoxelVariable")],V);const Pt=V;let _=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],_.prototype,"color",void 0),t([o({type:Number,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([o({type:Boolean,json:{default:!1,write:!0}})],_.prototype,"colorLocked",void 0),_=t([m("esri.layers.voxel.VoxelIsosurface")],_);const Je=_;let X=class extends L(g){constructor(){super(...arguments),this.color=null,this.position=0}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],X.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"position",void 0),X=t([m("esri.layers.voxel.VoxelColorStop")],X);const we=X;let Y=class extends L(g){constructor(){super(...arguments),this.opacity=1,this.position=0}};t([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],Y.prototype,"opacity",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],Y.prototype,"position",void 0),Y=t([m("esri.layers.voxel.VoxelOpacityStop")],Y);const Ve=Y;let Q=class extends L(g){constructor(){super(...arguments),this.enabled=!1,this.range=null}};t([o({type:Boolean,json:{default:!1,write:!0}})],Q.prototype,"enabled",void 0),t([o({type:[Number],json:{write:!0}})],Q.prototype,"range",void 0),Q=t([m("esri.layers.voxel.VoxelRangeFilter")],Q);const qt=Q;var w;(function(e){e[e.Color=1]="Color",e[e.Alpha=2]="Alpha",e[e.Both=3]="Both"})(w||(w={}));let A=class extends L(g){constructor(e){super(e),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(we)),this.opacityStops=new(c.ofType(Ve))}set colorStops(e){this._set("colorStops",de(e,this._get("colorStops"),c.ofType(we)))}set opacityStops(e){this._set("opacityStops",de(e,this._get("opacityStops"),c.ofType(Ve)))}getPreviousNext(e,i,r){let s=e;for(;--s>0&&i[s].type!==r&&i[s].type!==w.Both;);let n=e;const a=i.length;for(;++nu.position{d.color[F]=Math.round(ae($[F],oe[F],y))})}else h!==-1?pe.forEach(y=>{d.color[y]=r[h].color[y]}):pe.forEach(y=>{d.color[y]=r[f].color[y]})}}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,a=1;for(let p=0;pi[a].position;)n=a++;const d=(u-i[n].position)/(i[a].position-i[n].position),h=i[n].color,f=i[a].color,y=new k;pe.forEach($=>{y[$]=Math.round(ae(h[$],f[$],d))}),y.a=le(1-ae(h.a,f.a,d)/255,0,1),e.push(y)}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 p=s;s=n,n=p}e=le(e,s,n);const a=r[Math.round((e-s)/(n-s)*(this._colorMapSize-1))].clone();return i||(a.a=1),a}};t([o({type:["linear","nearest"],json:{write:!0}})],A.prototype,"interpolation",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],A.prototype,"stretchRange",void 0),t([o({type:c.ofType(we),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],A.prototype,"colorStops",null),t([o({type:c.ofType(Ve),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],A.prototype,"opacityStops",null),t([o({type:qt,json:{write:!0}})],A.prototype,"rangeFilter",void 0),t([o({type:[k],clonable:!1,json:{read:!1}})],A.prototype,"rasterizedTransferFunction",null),A=t([m("esri.layers.voxel.VoxelTransferFunctionStyle")],A);const Lt=A,pe=["r","g","b"];let B=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],B.prototype,"color",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],B.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],B.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],B.prototype,"label",void 0),B=t([m("esri.layers.voxel.VoxelUniqueValue")],B);const Ze=B;var je;let M=je=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(Ze)),this.isosurfaces=new(c.ofType(Je))}clone(){return new je({variableId:this.variableId,label:this.label,transferFunction:te(this.transferFunction),uniqueValues:te(this.uniqueValues),isosurfaces:te(this.isosurfaces)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],M.prototype,"variableId",void 0),t([o({type:String,json:{write:!0}})],M.prototype,"label",void 0),t([o({type:Lt,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],M.prototype,"transferFunction",void 0),t([o({type:c.ofType(Ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],M.prototype,"uniqueValues",void 0),t([o({type:c.ofType(Je),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,i=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&i}}}}})],M.prototype,"isosurfaces",void 0),M=je=t([m("esri.layers.voxel.VoxelVariableStyle")],M);const Ke=M;function _e(e){const i=/^(days?|hours?|minutes?|seconds?|d|h|m|s) since (\d{1,4})-(\d{1,2})-(\d{1,2})[ |T](\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[\s|Z]?(([+|\-|\s?])(\d{1,2}):(\d{1,2}))?$/i.exec(e);if(i==null)return{didParse:!1};const[,r,s,n,a,p,u,d,h,f,y,$,oe]=i;let F="seconds";const ge=r.charAt(0).toLowerCase();ge==="d"?F="days":ge==="h"?F="hours":ge==="m"&&(F="minutes");const Z=parseInt(s,10);if(Number.isNaN(Z))return{didParse:!1};const I=parseInt(n,10);if(Number.isNaN(I)||I<1||I>12)return{didParse:!1};const O=parseInt(a,10);if(Number.isNaN(O)||O<1||O>31)return{didParse:!1};if(I===2){const G=Z%4==0&&(Z%100!=0||Z%400==0);if(G&&O>29||!G&&O>28)return{didParse:!1}}else if((I===4||I===6||I===9||I===11)&&O>30)return{didParse:!1};const re=parseInt(p,10);if(Number.isNaN(re)||re<0||re>23)return{didParse:!1};const se=parseInt(u,10);if(Number.isNaN(se)||se<0||se>59)return{didParse:!1};const ne=parseInt(d,10);if(Number.isNaN(ne)||ne<0||ne>59)return{didParse:!1};let ve=1,C=0,U=0;if(y&&(ve=y==="-"?-1:1),$){if(C=parseInt($,10),Number.isNaN(C)||C<0)return{didParse:!1};if(C!==0){const G=ve*C;if(G<-12||G>14)return{didParse:!1}}}if(oe&&(U=parseInt(oe,10),Number.isNaN(U)||U<0||U>59))return{didParse:!1};const Xe=`${Z}`.padStart(4,"0"),Ye=`${I}`.padStart(2,"0"),Qe=`${O}`.padStart(2,"0"),et=`${re}`.padStart(2,"0"),tt=`${se}`.padStart(2,"0"),it=`${ne}`.padStart(2,"0");let K="Z";return C===0&&U===0||(K=ve>0?"+":"-",K+=`${C}`.padStart(2,"0"),K+=":",K+=`${U}`.padStart(2,"0")),{didParse:!0,unit:F,reference:new Date(`${Xe}-${Ye}-${Qe}T${et}:${tt}:${it}.000${K}`)}}let ue=class extends g{constructor(){super(...arguments),this.values=null}};t([o({type:[Number],json:{write:!0}})],ue.prototype,"values",void 0),ue=t([m("esri.layers.voxel.VoxelIrregularSpacing")],ue);const $t=ue;let ee=class extends g{constructor(){super(...arguments),this.scale=1,this.offset=0}};t([o({type:Number,json:{write:!0}})],ee.prototype,"scale",void 0),t([o({type:Number,json:{write:!0}})],ee.prototype,"offset",void 0),ee=t([m("esri.layers.voxel.VoxelRegularSpacing")],ee);const Ft=ee;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(){return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray(this.irregularSpacing?.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};t([o({type:$t,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:Ft,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([m("esri.layers.voxel.VoxelDimension")],S);const _t=S;let x=class extends g{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=Me.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 a=0;a<3;++a)n[a]<2?n[a]=1:n[a]-=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;let i=this.dimensions[3].size>0;if(i){const r=this.dimensions[3];i=r.quantity==="time",i&&r.unit!==null&&(i=_e(r.unit).didParse)}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]}get timeStops(){if(this.volumeType!=="xyzt")return[];const e=this.dimensions[3],i=[],r=_e(e.unit);if(r.didParse){if(e.isRegular){const s=e.regularSpacing?.offset??0,n=e.regularSpacing?.scale||1;for(let a=0;a0)for(let s=0;s1){const s=e.z??0,n=r.irregularSpacing.values,a=r.isPositiveUp?1:-1,p=n.reduce((u,d)=>Math.abs(a*d-s)z.normalize(N(e),0,!0))],D.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],D.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],D.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],D.prototype,"point",void 0),D=t([m("esri.layers.voxel.VoxelDynamicSection")],D);const ze=D;var Ie;let P=Ie=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(he)),this.dynamicSections=new(c.ofType(ze))}set slices(e){this._set("slices",de(e,this._get("slices"),c.ofType(he)))}set dynamicSections(e){this._set("dynamicSections",de(e,this._get("dynamicSections"),c.ofType(ze)))}clone(){return new Ie({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:te(this.slices),dynamicSections:te(this.dynamicSections)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],P.prototype,"volumeId",void 0),t([o({type:Number,json:{default:1,write:!0}})],P.prototype,"verticalExaggeration",void 0),t([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],P.prototype,"exaggerationMode",void 0),t([o({type:Number,json:{default:0,write:!0}})],P.prototype,"verticalOffset",void 0),t([o({type:c.ofType(he),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],P.prototype,"slices",null),t([o({type:c.ofType(ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],P.prototype,"dynamicSections",null),P=Ie=t([m("esri.layers.voxel.VoxelVolumeStyle")],P);const He=P;let l=class extends xt(gt(ft(bt(St(pt(vt(mt(ht)))))))){constructor(e){super(e),this.serviceRoot="",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 We,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.popupEnabled=!1,this.popupTemplate=null,this.test=null,this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0,this.volumeStyles=new(c.ofType(He)),this.variableStyles=new(c.ofType(Ke)),this.sections=new(c.ofType(xe))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",wt(e,q.getLogger(this)))}load(e){const i=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(rt).then(()=>this._fetchService(i)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(r),Promise.resolve(this)}read(e,i){super.read(e,i),i?.origin==="service"&&this.version.major<=3&&this.version.minor<=0&&!this.getAtOrigin("popupTemplate","service")&&this.setAtOrigin("popupTemplate",this.createPopupTemplate(),"service");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 fe("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 fe("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new fe("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=Oe.fromJSON(e,r);if(s.zmin===0&&s.zmax===0&&Array.isArray(i.volumes)){const n=Ge.fromJSON(i.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const a=n.dimensions[2];if(a.isRegular){let p=a.regularSpacing.offset,u=a.regularSpacing.offset+a.regularSpacing.scale*(a.size-1);if(p>u){const d=p;p=u,u=d}s.zmin=p,s.zmax=u}}}return s}return null}get fields(){const e=[new W({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"}),new W({name:"Voxel.CurrentVariable",alias:"Current Variable",domain:null,editable:!1,length:128,type:"string"})];for(const r of this.variables){const s=new W({name:r.name,alias:r.description,domain:null,editable:!1,length:128,type:r.renderingFormat.continuity==="discrete"?"string":"double"});e.push(s)}const i=this.getVolume(null);if(i!=null){if(i.volumeType==="xyzt"||i.volumeType==="xyt"){const r=new W({name:"Voxel.LocalTime",alias:"Local Time",domain:null,editable:!1,length:256,type:"date"});e.push(r);const s=new W({name:"Voxel.SourceTime",alias:"Source Time",domain:null,editable:!1,length:256,type:"string"});e.push(s)}if(i.volumeType!=="xyt"){const r=new W({name:"Voxel.Depth",alias:"Depth",domain:null,editable:!1,length:128,type:"double"});e.push(r)}}return e}get fieldsIndex(){return this.loaded?new Nt(this.fields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const i=this.fields;return Tt({fields:i,title:"{Voxel.Position}"},e)}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=e??this.currentVariableId,!this.variableStyles||i===-1)return null;const r=this.variableStyles.findIndex(s=>s.variableId===i);return r<0?null:this.variableStyles.at(r)}getVariable(e){let i=-1;if(i=e??this.currentVariableId,!this.variables||i===-1)return null;const r=this.variables.findIndex(s=>s.id===i);return r<0?null:this.variables.at(r)}getVolume(e){const i=this.getVariable(e);return i!=null?this.volumes.find(({id:r})=>r===i.volumeId):null}get timeInfo(){const e=this.getVolume(null);if(e?.volumeType!=="xyzt")return null;const i=e.timeStops;if(!i?.length)return null;const r=new ke({start:i[0],end:i.at(-1)});return new Ee({fullTimeExtent:r,stops:i})}getVolumeStyle(e){const i=this.getVariable(e);return i!=null?this.volumeStyles.find(({volumeId:r})=>r===i.volumeId):null}getColorForContinuousDataValue(e,i,r){const s=this.getVariable(e);if(s==null||s.renderingFormat?.continuity!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(p=>p.variableId===e);if(n<0)return null;const a=this.variableStyles.at(n);return a?.transferFunction?a.transferFunction.getColorForContinuousDataValue(i,r):null}getSections(){const e=[];for(const i of this.sections)e.push(new xe({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(r!=null){const s=i.clone();s.isosurfaces.length>4&&(s.isosurfaces=s.isosurfaces.slice(0,3),q.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of s.isosurfaces)if(!n.colorLocked){const a=this.getColorForContinuousDataValue(s.variableId,n.value,!1);a===null||a.equals(n.color)||(n.color=a)}if(r.renderingFormat.continuity==="continuous")(s.transferFunction===null||s.transferFunction.colorStops.length<2)&&q.getLogger(this).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||(q.getLogger(this).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)q.getLogger(this).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 q.getLogger(this).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(r!=null){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 q.getLogger(this).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;const s=ie(e.normal[0],e.normal[1],e.normal[2]);return Re(s,s),!(Math.abs(s[0])+Math.abs(s[1])+Math.abs(s[2])<1e-6)&&(e.normal[0]=s[0],e.normal[1]=s[1],e.normal[2]=s[2],!0)}};t([o({type:["Voxel"]})],l.prototype,"operationalLayerType",void 0),t([o(Vt)],l.prototype,"legendEnabled",void 0),t([o({json:{write:!0}})],l.prototype,"title",void 0),t([o(jt)],l.prototype,"url",null),t([o({type:c.ofType(xe),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],l.prototype,"sections",void 0),t([o({type:j,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],l.prototype,"currentVariableId",void 0),t([o({type:c.ofType(He),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],l.prototype,"volumeStyles",void 0),t([o({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],l.prototype,"renderMode",void 0),t([o({type:c.ofType(Ke),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],l.prototype,"variableStyles",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],l.prototype,"enableSlices",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],l.prototype,"enableSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],l.prototype,"enableDynamicSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],l.prototype,"enableIsosurfaces",void 0),t([o({type:We,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],l.prototype,"shading",void 0),t([o({type:["show","hide"]})],l.prototype,"listMode",void 0),t([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"opacity",void 0),t([o({type:c.ofType(Pt)})],l.prototype,"variables",void 0),t([o({type:c.ofType(Ge)})],l.prototype,"volumes",void 0),t([o({type:Mt})],l.prototype,"index",void 0),t([o({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"minScale",void 0),t([o({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"maxScale",void 0),t([o({json:{read:!1},readOnly:!0})],l.prototype,"type",void 0),t([o({readOnly:!0,json:{name:"serviceVersion"}})],l.prototype,"version",void 0),t([Te("service","version")],l.prototype,"readVersion",null),t([o({type:Oe})],l.prototype,"fullExtent",void 0),t([Te("service","fullExtent",["fullExtent"])],l.prototype,"readFullExtent",null),t([o({readOnly:!0,clonable:!1,json:{read:!1}})],l.prototype,"fields",null),t([o({readOnly:!0})],l.prototype,"fieldsIndex",null),t([o({type:Boolean,json:{name:"disablePopup",read:{reader:(e,i)=>!i.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,i,r){i[r]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],l.prototype,"popupEnabled",void 0),t([o({type:st,json:{name:"popupInfo",write:!0}})],l.prototype,"popupTemplate",void 0),t([o({readOnly:!0,json:{read:!1}})],l.prototype,"defaultPopupTemplate",null),t([o({type:Ee,readOnly:!0,json:{read:!1}})],l.prototype,"timeInfo",null),t([o({type:ke,json:{read:!1}})],l.prototype,"timeExtent",void 0),t([o({type:zt,json:{read:!1}})],l.prototype,"timeOffset",void 0),t([o({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:"timeAnimation",write:!0},service:{read:!1}}}})],l.prototype,"useViewTime",void 0),l=t([m("esri.layers.VoxelLayer")],l);const Ti=l;export{Ti as default}; +import{aa as L,ab as N,v as t,S as o,ad as ce,i as m,jy as ot,bB as j,ar as k,ag as c,am as de,ae as le,bl as ae,J as Me,a1 as q,W as rt,o as fe,n as Oe,hZ as ie,a0 as Te,bL as st,e as g,P as te,aC as nt,w as be,il as lt,dg as at}from"./story-Doly9N9p.js";import{m as pt}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{l as Re,A as Ce,w as Be,r as ut,x as ct,q as dt,j as yt}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{D as ht}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{n as mt}from"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import{a as gt}from"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import{i as vt}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{E as ft}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as bt}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{S as St}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{W as xt}from"./SceneService-BZqGtWmG-BBytd6YJ.js";import{j as wt}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{_ as Vt,Z as jt}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{y as W}from"./Field-C6hA1tZj-CkWoRbmp.js";import{o as Nt}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{w as Ee,r as zt}from"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import{c as z}from"./Cyclical-C_9rKUUQ-DyGueJyk.js";import{C as It}from"./persistable-C6RBwzJi-CrVVP3ny.js";import{A as Se,_ as Rt}from"./quat-BODLR7mS-BQk2dgMZ.js";import{e as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{u as Ae,r as De}from"./common-CYWrYyJl-E8-sukrT.js";import{k as ke,j as Pe}from"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import{w as Tt}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./main-QGPoLsvl.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./jsonContext-BA8GHqVk-BsXRY5es.js";import"./resourceUtils-BmW6QqlX-D_AxNrCI.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-GPPQBysx.js";import"./saveUtils-CIYk-dsQ-Br9QCJTX.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./resourceExtension-CdQvIDKV-DCvzsrJt.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";const v=at(),qe=me(),Le=me(),$e=me(),Ue=ie(0,0,1),At=ie(0,1,0),Dt=ie(1,0,0);function J(e){Ce(v,e),Re(v,v);const i=Math.atan2(v[1],v[0]),r=Se(me(),Ue,-i);Be(v,v,r);const s=-1*Math.atan2(v[2],v[0]);return[Ae(i)+270,Ae(s)+90]}function ye(e,i){return Se(Le,Ue,De(e-270)),Se($e,At,De(i-90)),Rt(qe,Le,$e),Ce(v,Dt),Be(v,v,qe),Re(v,v),[v[0],v[1],v[2]]}let R=class extends L(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]=J(this.normal);return z.normalize(N(e),0,!0)}set orientation(e){const i=ye(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]=J(this.normal);return z.normalize(N(i),0,!0)}set tilt(e){const i=ye(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}}),ce(e=>z.normalize(N(e),0,!0))],R.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(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([m("esri.layers.voxel.VoxelSlice")],R);const he=R;let b=class extends L(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]=J(this.normal);return z.normalize(N(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=J(this.normal);return z.normalize(N(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:ot}},write:{enabled:!0,isRequired:!0}}}),It({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:[he],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([m("esri.layers.voxel.VoxelSection")],b);const xe=b;let H=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}})],H.prototype,"diffuseFactor",void 0),t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],H.prototype,"specularFactor",void 0),H=t([m("esri.layers.voxel.VoxelSimpleShading")],H);const We=H;let T=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}})],T.prototype,"continuity",void 0),t([o({type:Boolean,json:{write:!0}})],T.prototype,"hasNoData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"noData",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"offset",void 0),t([o({type:Number,json:{write:!0}})],T.prototype,"scale",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],T.prototype,"type",void 0),T=t([m("esri.layers.voxel.VoxelFormat")],T);const Fe=T;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:Fe,json:{write:!0}})],V.prototype,"originalFormat",void 0),t([o({type:Fe,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([m("esri.layers.voxel.VoxelVariable")],V);const Pt=V;let _=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!1}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],_.prototype,"color",void 0),t([o({type:Number,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([o({type:Boolean,json:{default:!1,write:!0}})],_.prototype,"colorLocked",void 0),_=t([m("esri.layers.voxel.VoxelIsosurface")],_);const Je=_;let X=class extends L(g){constructor(){super(...arguments),this.color=null,this.position=0}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],X.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],X.prototype,"position",void 0),X=t([m("esri.layers.voxel.VoxelColorStop")],X);const we=X;let Y=class extends L(g){constructor(){super(...arguments),this.opacity=1,this.position=0}};t([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],Y.prototype,"opacity",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],Y.prototype,"position",void 0),Y=t([m("esri.layers.voxel.VoxelOpacityStop")],Y);const Ve=Y;let Q=class extends L(g){constructor(){super(...arguments),this.enabled=!1,this.range=null}};t([o({type:Boolean,json:{default:!1,write:!0}})],Q.prototype,"enabled",void 0),t([o({type:[Number],json:{write:!0}})],Q.prototype,"range",void 0),Q=t([m("esri.layers.voxel.VoxelRangeFilter")],Q);const qt=Q;var w;(function(e){e[e.Color=1]="Color",e[e.Alpha=2]="Alpha",e[e.Both=3]="Both"})(w||(w={}));let A=class extends L(g){constructor(e){super(e),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(we)),this.opacityStops=new(c.ofType(Ve))}set colorStops(e){this._set("colorStops",de(e,this._get("colorStops"),c.ofType(we)))}set opacityStops(e){this._set("opacityStops",de(e,this._get("opacityStops"),c.ofType(Ve)))}getPreviousNext(e,i,r){let s=e;for(;--s>0&&i[s].type!==r&&i[s].type!==w.Both;);let n=e;const a=i.length;for(;++nu.position{d.color[F]=Math.round(ae($[F],oe[F],y))})}else h!==-1?pe.forEach(y=>{d.color[y]=r[h].color[y]}):pe.forEach(y=>{d.color[y]=r[f].color[y]})}}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,a=1;for(let p=0;pi[a].position;)n=a++;const d=(u-i[n].position)/(i[a].position-i[n].position),h=i[n].color,f=i[a].color,y=new k;pe.forEach($=>{y[$]=Math.round(ae(h[$],f[$],d))}),y.a=le(1-ae(h.a,f.a,d)/255,0,1),e.push(y)}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 p=s;s=n,n=p}e=le(e,s,n);const a=r[Math.round((e-s)/(n-s)*(this._colorMapSize-1))].clone();return i||(a.a=1),a}};t([o({type:["linear","nearest"],json:{write:!0}})],A.prototype,"interpolation",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],A.prototype,"stretchRange",void 0),t([o({type:c.ofType(we),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],A.prototype,"colorStops",null),t([o({type:c.ofType(Ve),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],A.prototype,"opacityStops",null),t([o({type:qt,json:{write:!0}})],A.prototype,"rangeFilter",void 0),t([o({type:[k],clonable:!1,json:{read:!1}})],A.prototype,"rasterizedTransferFunction",null),A=t([m("esri.layers.voxel.VoxelTransferFunctionStyle")],A);const Lt=A,pe=["r","g","b"];let B=class extends L(g){constructor(){super(...arguments),this.color=k.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};t([o({type:k,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],B.prototype,"color",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],B.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],B.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],B.prototype,"label",void 0),B=t([m("esri.layers.voxel.VoxelUniqueValue")],B);const Ze=B;var je;let M=je=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(Ze)),this.isosurfaces=new(c.ofType(Je))}clone(){return new je({variableId:this.variableId,label:this.label,transferFunction:te(this.transferFunction),uniqueValues:te(this.uniqueValues),isosurfaces:te(this.isosurfaces)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],M.prototype,"variableId",void 0),t([o({type:String,json:{write:!0}})],M.prototype,"label",void 0),t([o({type:Lt,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],M.prototype,"transferFunction",void 0),t([o({type:c.ofType(Ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],M.prototype,"uniqueValues",void 0),t([o({type:c.ofType(Je),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,i=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&i}}}}})],M.prototype,"isosurfaces",void 0),M=je=t([m("esri.layers.voxel.VoxelVariableStyle")],M);const Ke=M;function _e(e){const i=/^(days?|hours?|minutes?|seconds?|d|h|m|s) since (\d{1,4})-(\d{1,2})-(\d{1,2})[ |T](\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[\s|Z]?(([+|\-|\s?])(\d{1,2}):(\d{1,2}))?$/i.exec(e);if(i==null)return{didParse:!1};const[,r,s,n,a,p,u,d,h,f,y,$,oe]=i;let F="seconds";const ge=r.charAt(0).toLowerCase();ge==="d"?F="days":ge==="h"?F="hours":ge==="m"&&(F="minutes");const Z=parseInt(s,10);if(Number.isNaN(Z))return{didParse:!1};const I=parseInt(n,10);if(Number.isNaN(I)||I<1||I>12)return{didParse:!1};const O=parseInt(a,10);if(Number.isNaN(O)||O<1||O>31)return{didParse:!1};if(I===2){const G=Z%4==0&&(Z%100!=0||Z%400==0);if(G&&O>29||!G&&O>28)return{didParse:!1}}else if((I===4||I===6||I===9||I===11)&&O>30)return{didParse:!1};const re=parseInt(p,10);if(Number.isNaN(re)||re<0||re>23)return{didParse:!1};const se=parseInt(u,10);if(Number.isNaN(se)||se<0||se>59)return{didParse:!1};const ne=parseInt(d,10);if(Number.isNaN(ne)||ne<0||ne>59)return{didParse:!1};let ve=1,C=0,U=0;if(y&&(ve=y==="-"?-1:1),$){if(C=parseInt($,10),Number.isNaN(C)||C<0)return{didParse:!1};if(C!==0){const G=ve*C;if(G<-12||G>14)return{didParse:!1}}}if(oe&&(U=parseInt(oe,10),Number.isNaN(U)||U<0||U>59))return{didParse:!1};const Xe=`${Z}`.padStart(4,"0"),Ye=`${I}`.padStart(2,"0"),Qe=`${O}`.padStart(2,"0"),et=`${re}`.padStart(2,"0"),tt=`${se}`.padStart(2,"0"),it=`${ne}`.padStart(2,"0");let K="Z";return C===0&&U===0||(K=ve>0?"+":"-",K+=`${C}`.padStart(2,"0"),K+=":",K+=`${U}`.padStart(2,"0")),{didParse:!0,unit:F,reference:new Date(`${Xe}-${Ye}-${Qe}T${et}:${tt}:${it}.000${K}`)}}let ue=class extends g{constructor(){super(...arguments),this.values=null}};t([o({type:[Number],json:{write:!0}})],ue.prototype,"values",void 0),ue=t([m("esri.layers.voxel.VoxelIrregularSpacing")],ue);const $t=ue;let ee=class extends g{constructor(){super(...arguments),this.scale=1,this.offset=0}};t([o({type:Number,json:{write:!0}})],ee.prototype,"scale",void 0),t([o({type:Number,json:{write:!0}})],ee.prototype,"offset",void 0),ee=t([m("esri.layers.voxel.VoxelRegularSpacing")],ee);const Ft=ee;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(){return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray(this.irregularSpacing?.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};t([o({type:$t,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:Ft,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([m("esri.layers.voxel.VoxelDimension")],S);const _t=S;let x=class extends g{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=Me.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 a=0;a<3;++a)n[a]<2?n[a]=1:n[a]-=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;let i=this.dimensions[3].size>0;if(i){const r=this.dimensions[3];i=r.quantity==="time",i&&r.unit!==null&&(i=_e(r.unit).didParse)}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]}get timeStops(){if(this.volumeType!=="xyzt")return[];const e=this.dimensions[3],i=[],r=_e(e.unit);if(r.didParse){if(e.isRegular){const s=e.regularSpacing?.offset??0,n=e.regularSpacing?.scale||1;for(let a=0;a0)for(let s=0;s1){const s=e.z??0,n=r.irregularSpacing.values,a=r.isPositiveUp?1:-1,p=n.reduce((u,d)=>Math.abs(a*d-s)z.normalize(N(e),0,!0))],D.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),ce(e=>z.normalize(N(e),0,!0))],D.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],D.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],D.prototype,"point",void 0),D=t([m("esri.layers.voxel.VoxelDynamicSection")],D);const ze=D;var Ie;let P=Ie=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(he)),this.dynamicSections=new(c.ofType(ze))}set slices(e){this._set("slices",de(e,this._get("slices"),c.ofType(he)))}set dynamicSections(e){this._set("dynamicSections",de(e,this._get("dynamicSections"),c.ofType(ze)))}clone(){return new Ie({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:te(this.slices),dynamicSections:te(this.dynamicSections)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],P.prototype,"volumeId",void 0),t([o({type:Number,json:{default:1,write:!0}})],P.prototype,"verticalExaggeration",void 0),t([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],P.prototype,"exaggerationMode",void 0),t([o({type:Number,json:{default:0,write:!0}})],P.prototype,"verticalOffset",void 0),t([o({type:c.ofType(he),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],P.prototype,"slices",null),t([o({type:c.ofType(ze),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],P.prototype,"dynamicSections",null),P=Ie=t([m("esri.layers.voxel.VoxelVolumeStyle")],P);const He=P;let l=class extends xt(gt(ft(bt(St(pt(vt(mt(ht)))))))){constructor(e){super(e),this.serviceRoot="",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 We,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.popupEnabled=!1,this.popupTemplate=null,this.test=null,this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0,this.volumeStyles=new(c.ofType(He)),this.variableStyles=new(c.ofType(Ke)),this.sections=new(c.ofType(xe))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",wt(e,q.getLogger(this)))}load(e){const i=e!=null?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(rt).then(()=>this._fetchService(i)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(r),Promise.resolve(this)}read(e,i){super.read(e,i),i?.origin==="service"&&this.version.major<=3&&this.version.minor<=0&&!this.getAtOrigin("popupTemplate","service")&&this.setAtOrigin("popupTemplate",this.createPopupTemplate(),"service");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 fe("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 fe("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new fe("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=Oe.fromJSON(e,r);if(s.zmin===0&&s.zmax===0&&Array.isArray(i.volumes)){const n=Ge.fromJSON(i.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const a=n.dimensions[2];if(a.isRegular){let p=a.regularSpacing.offset,u=a.regularSpacing.offset+a.regularSpacing.scale*(a.size-1);if(p>u){const d=p;p=u,u=d}s.zmin=p,s.zmax=u}}}return s}return null}get fields(){const e=[new W({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"}),new W({name:"Voxel.CurrentVariable",alias:"Current Variable",domain:null,editable:!1,length:128,type:"string"})];for(const r of this.variables){const s=new W({name:r.name,alias:r.description,domain:null,editable:!1,length:128,type:r.renderingFormat.continuity==="discrete"?"string":"double"});e.push(s)}const i=this.getVolume(null);if(i!=null){if(i.volumeType==="xyzt"||i.volumeType==="xyt"){const r=new W({name:"Voxel.LocalTime",alias:"Local Time",domain:null,editable:!1,length:256,type:"date"});e.push(r);const s=new W({name:"Voxel.SourceTime",alias:"Source Time",domain:null,editable:!1,length:256,type:"string"});e.push(s)}if(i.volumeType!=="xyt"){const r=new W({name:"Voxel.Depth",alias:"Depth",domain:null,editable:!1,length:128,type:"double"});e.push(r)}}return e}get fieldsIndex(){return this.loaded?new Nt(this.fields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const i=this.fields;return Tt({fields:i,title:"{Voxel.Position}"},e)}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=e??this.currentVariableId,!this.variableStyles||i===-1)return null;const r=this.variableStyles.findIndex(s=>s.variableId===i);return r<0?null:this.variableStyles.at(r)}getVariable(e){let i=-1;if(i=e??this.currentVariableId,!this.variables||i===-1)return null;const r=this.variables.findIndex(s=>s.id===i);return r<0?null:this.variables.at(r)}getVolume(e){const i=this.getVariable(e);return i!=null?this.volumes.find(({id:r})=>r===i.volumeId):null}get timeInfo(){const e=this.getVolume(null);if(e?.volumeType!=="xyzt")return null;const i=e.timeStops;if(!i?.length)return null;const r=new ke({start:i[0],end:i.at(-1)});return new Ee({fullTimeExtent:r,stops:i})}getVolumeStyle(e){const i=this.getVariable(e);return i!=null?this.volumeStyles.find(({volumeId:r})=>r===i.volumeId):null}getColorForContinuousDataValue(e,i,r){const s=this.getVariable(e);if(s==null||s.renderingFormat?.continuity!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(p=>p.variableId===e);if(n<0)return null;const a=this.variableStyles.at(n);return a?.transferFunction?a.transferFunction.getColorForContinuousDataValue(i,r):null}getSections(){const e=[];for(const i of this.sections)e.push(new xe({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(r!=null){const s=i.clone();s.isosurfaces.length>4&&(s.isosurfaces=s.isosurfaces.slice(0,3),q.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of s.isosurfaces)if(!n.colorLocked){const a=this.getColorForContinuousDataValue(s.variableId,n.value,!1);a===null||a.equals(n.color)||(n.color=a)}if(r.renderingFormat.continuity==="continuous")(s.transferFunction===null||s.transferFunction.colorStops.length<2)&&q.getLogger(this).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||(q.getLogger(this).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)q.getLogger(this).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 q.getLogger(this).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(r!=null){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 q.getLogger(this).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;const s=ie(e.normal[0],e.normal[1],e.normal[2]);return Re(s,s),!(Math.abs(s[0])+Math.abs(s[1])+Math.abs(s[2])<1e-6)&&(e.normal[0]=s[0],e.normal[1]=s[1],e.normal[2]=s[2],!0)}};t([o({type:["Voxel"]})],l.prototype,"operationalLayerType",void 0),t([o(Vt)],l.prototype,"legendEnabled",void 0),t([o({json:{write:!0}})],l.prototype,"title",void 0),t([o(jt)],l.prototype,"url",null),t([o({type:c.ofType(xe),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],l.prototype,"sections",void 0),t([o({type:j,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],l.prototype,"currentVariableId",void 0),t([o({type:c.ofType(He),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],l.prototype,"volumeStyles",void 0),t([o({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],l.prototype,"renderMode",void 0),t([o({type:c.ofType(Ke),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],l.prototype,"variableStyles",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],l.prototype,"enableSlices",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],l.prototype,"enableSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],l.prototype,"enableDynamicSections",void 0),t([o({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],l.prototype,"enableIsosurfaces",void 0),t([o({type:We,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],l.prototype,"shading",void 0),t([o({type:["show","hide"]})],l.prototype,"listMode",void 0),t([o({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],l.prototype,"opacity",void 0),t([o({type:c.ofType(Pt)})],l.prototype,"variables",void 0),t([o({type:c.ofType(Ge)})],l.prototype,"volumes",void 0),t([o({type:Mt})],l.prototype,"index",void 0),t([o({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"minScale",void 0),t([o({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],l.prototype,"maxScale",void 0),t([o({json:{read:!1},readOnly:!0})],l.prototype,"type",void 0),t([o({readOnly:!0,json:{name:"serviceVersion"}})],l.prototype,"version",void 0),t([Te("service","version")],l.prototype,"readVersion",null),t([o({type:Oe})],l.prototype,"fullExtent",void 0),t([Te("service","fullExtent",["fullExtent"])],l.prototype,"readFullExtent",null),t([o({readOnly:!0,clonable:!1,json:{read:!1}})],l.prototype,"fields",null),t([o({readOnly:!0})],l.prototype,"fieldsIndex",null),t([o({type:Boolean,json:{name:"disablePopup",read:{reader:(e,i)=>!i.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,i,r){i[r]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],l.prototype,"popupEnabled",void 0),t([o({type:st,json:{name:"popupInfo",write:!0}})],l.prototype,"popupTemplate",void 0),t([o({readOnly:!0,json:{read:!1}})],l.prototype,"defaultPopupTemplate",null),t([o({type:Ee,readOnly:!0,json:{read:!1}})],l.prototype,"timeInfo",null),t([o({type:ke,json:{read:!1}})],l.prototype,"timeExtent",void 0),t([o({type:zt,json:{read:!1}})],l.prototype,"timeOffset",void 0),t([o({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:"timeAnimation",write:!0},service:{read:!1}}}})],l.prototype,"useViewTime",void 0),l=t([m("esri.layers.VoxelLayer")],l);const Ti=l;export{Ti as default}; diff --git a/custom-toc-highlight/assets/WFSLayer-DKnx5V8b-CqaZsJwu.js b/custom-toc-highlight/assets/WFSLayer-DKnx5V8b-BsCCMHBG.js similarity index 77% rename from custom-toc-highlight/assets/WFSLayer-DKnx5V8b-CqaZsJwu.js rename to custom-toc-highlight/assets/WFSLayer-DKnx5V8b-BsCCMHBG.js index 3377dcd3..e6820abb 100644 --- a/custom-toc-highlight/assets/WFSLayer-DKnx5V8b-CqaZsJwu.js +++ b/custom-toc-highlight/assets/WFSLayer-DKnx5V8b-BsCCMHBG.js @@ -1 +1 @@ -import{v as t,S as r,i as R,J as C,bT as O,dL as E,dK as U,a as J,bQ as $,ac as k,n as I,bW as h,bB as f,bL as Y,aB as D,bp as W,o as X,iF as L,K as H,a1 as Q,cl as G}from"./story-BfX8CRfG.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{m as V,u as K}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{m as Z}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as B}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{q as z}from"./workers-PiCjreoO-idkDTJa3.js";import{$ as A,d as M}from"./clientSideDefaults-BqqayPct-B-0mBem3.js";import{x as ee,r as te,c as re,G as ie,v as oe}from"./wfsUtils-DoLaqXsj-B0NjDgDj.js";import{O as se}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{u as ae}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import{l as pe}from"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import{E as de}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{p as me}from"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import{C as ue}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as ye}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as ce}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{$ as he,Y as ge,_ as we,K as ve,X as Fe,V as be,Z as xe}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{y as T}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{f as Oe}from"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import{C as Se,q as Re}from"./labelingInfo-DGVNul26-zkvIaBlq.js";import{b as y}from"./Query-BrwMGK8U-DoFNfkjX.js";import{w as Ce}from"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./main-ugzBrWNm.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./geojson-CNt_qtQf-B9F87hyc.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";let d=class extends D{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=A(!1,!1),this.type="wfs",this.refresh=W(async()=>{await this.load();const e={customParameters:this.layer.customParameters,maxRecordCount:this.layer.maxRecordCount,maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:o}=await this._workerHandler.refresh(e);return o&&(this.sourceJSON.extent=o),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const o=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:o})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,o={}){const s=await this.queryFeaturesJSON(e,o);return se.fromJSON(s)}async queryFeaturesJSON(e,o={}){return await this.load(o),this._workerHandler.queryFeatures(e?e.toJSON():void 0,o)}async queryFeatureCount(e,o={}){return await this.load(o),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,o)}async queryObjectIds(e,o={}){return await this.load(o),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,o)}async queryExtent(e,o={}){await this.load(o);const s=await this._workerHandler.queryExtent(e?e.toJSON():void 0,o);return{count:s.count,extent:I.fromJSON(s.extent)}}async querySnapping(e,o={}){return await this.load(o),this._workerHandler.querySnapping(e,o)}async _createLoadOptions(e){const{url:o,customParameters:s,name:n,namespaceUri:p,fields:a,geometryType:m,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,swapXY:v}=this.layer,c=this.layer.originOf("spatialReference")==="defaults"?void 0:this.layer.spatialReference;if(!o)throw new X("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await te(o,{customParameters:s,...e}));const P=["fields","geometryType","name","namespaceUri","swapXY"].some(F=>this.layer[F]==null),l=P?await re(this.wfsCapabilities,n,p,{spatialReference:c,customParameters:s,signal:e?.signal}):{...ie(a??[]),geometryType:m,name:n,namespaceUri:p,spatialReference:c,swapXY:v},q=oe(this.wfsCapabilities.readFeatureTypes(),l.name,l.namespaceUri),j=h.toJSON(l.geometryType),{operations:x}=this.wfsCapabilities,_=x.GetFeature.url,N=x.GetFeature.outputFormat;return{customParameters:s,featureType:q,fields:l.fields?.map(F=>F.toJSON())??[],geometryField:l.geometryField,geometryType:j,getFeatureUrl:_,getFeatureOutputFormat:N,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,objectIdField:l.objectIdField,spatialReference:l.spatialReference?.toJSON(),swapXY:!!l.swapXY}}async _startWorker(e){const[o,s]=await L([this._createLoadOptions(e),z("WFSSourceWorker",{...e,strategy:H("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),n=o.error||s.error||null,p=s.value||null;if(n)throw p&&p.close(),n;const a=o.value;this._connection=s.value,this._workerHandler=this._connection.createInvokeProxy();const m=await this._workerHandler.load(a,e);for(const u of m.warnings)Q.getLogger(this.layer).warn("#load()",`${u.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:u});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:G},extent:m.extent,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:M(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:a.maxRecordCount,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};t([r()],d.prototype,"capabilities",void 0),t([r({constructOnly:!0})],d.prototype,"layer",void 0),t([r()],d.prototype,"sourceJSON",void 0),t([r()],d.prototype,"type",void 0),t([r()],d.prototype,"wfsCapabilities",void 0),d=t([R("esri.layers.graphics.sources.WFSSource")],d);var b;const S=Oe();let i=b=class extends me(ne(le(pe(ae(fe(ye(ce(de(ue(Z(B))))))))))){static fromWFSLayerInfo(e){const{customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c}=e;return new b({customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=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.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,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=C.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){this.source?.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"),O(this.renderer,this.fieldsIndex),E(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){return this.source?.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,o,s){const n=e.filter(p=>p.name!==ee);this.geometryField&&n.unshift(new T({name:this.geometryField,alias:this.geometryField,type:"geometry"})),U(s,n.map(p=>p.toJSON()),o)}get parsedUrl(){return J(this.url)}set renderer(e){O(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return Ce(this,e)}createQuery(){const e=new y({returnGeometry:!0,outFields:["*"],where:this.definitionExpression||"1=1"}),{timeOffset:o,timeExtent:s}=this;return e.timeExtent=o!=null&&s!=null?s.offset(-o.value,o.unit):s||null,e}getFieldDomain(e,o){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,o){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),o)).then(s=>{if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,o){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),o))}queryFeatureCount(e,o){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),o))}queryExtent(e,o){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),o))}async hasDataChanged(){try{const{dataChanged:e,updates:o}=await this.source.refresh();return o!=null&&this.read(o,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};t([r({readOnly:!0})],i.prototype,"capabilities",null),t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"createQueryVersion",null),t([r({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],i.prototype,"customParameters",void 0),t([r($("dateFieldsTimeReference"))],i.prototype,"dateFieldsTimeZone",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r(he)],i.prototype,"elevationInfo",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"featureUrl",void 0),t([r({type:[T],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],i.prototype,"fields",void 0),t([k("fields")],i.prototype,"writeFields",null),t([r(S.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:I,json:{name:"extent"}})],i.prototype,"fullExtent",void 0),t([r()],i.prototype,"geometryField",void 0),t([r({type:String,json:{read:{source:"layerDefinition.geometryType",reader:h.read},write:{target:"layerDefinition.geometryType",writer:h.write,ignoreOrigin:!0},origins:{service:{read:h.read}}}})],i.prototype,"geometryType",void 0),t([r({type:String})],i.prototype,"id",void 0),t([r(ge)],i.prototype,"labelsVisible",void 0),t([r({type:[Se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Re},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(we)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"]})],i.prototype,"listMode",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({type:["WFS"]})],i.prototype,"operationalLayerType",void 0),t([r({type:f,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"maxRecordCount",void 0),t([r({type:f})],i.prototype,"maxPageCount",void 0),t([r({type:f})],i.prototype,"maxTotalRecordCount",void 0),t([r({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],i.prototype,"mode",void 0),t([r({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"name",void 0),t([r({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"namespaceUri",void 0),t([r(ve)],i.prototype,"opacity",void 0),t([r(S.outFields)],i.prototype,"outFields",void 0),t([r({readOnly:!0})],i.prototype,"parsedUrl",null),t([r(Fe)],i.prototype,"popupEnabled",void 0),t([r({type:Y,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({types:V,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:K,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],i.prototype,"renderer",null),t([r(be)],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r({readOnly:!0})],i.prototype,"source",void 0),t([r({type:C,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],i.prototype,"spatialReference",void 0),t([r({readOnly:!0,type:[f],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"spatialReferences",void 0),t([r({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"swapXY",void 0),t([r({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],i.prototype,"title",void 0),t([r({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),t([r(xe)],i.prototype,"url",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"version",void 0),t([r()],i.prototype,"wfsCapabilities",null),i=b=t([R("esri.layers.WFSLayer")],i);const Kt=i;export{Kt as default}; +import{v as t,S as r,i as R,J as C,bT as O,dL as E,dK as U,a as J,bQ as $,ac as k,n as I,bW as h,bB as f,bL as Y,aB as D,bp as W,o as X,iF as L,K as H,a1 as Q,cl as G}from"./story-Doly9N9p.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{m as V,u as K}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{m as Z}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as B}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{q as z}from"./workers-PiCjreoO-Dc6Tqm-o.js";import{$ as A,d as M}from"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import{x as ee,r as te,c as re,G as ie,v as oe}from"./wfsUtils-DoLaqXsj-DBVQwnFp.js";import{O as se}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{u as ae}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{i as ne}from"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import{l as pe}from"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import{v as le}from"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import{E as de}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{p as me}from"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import{C as ue}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as ye}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as ce}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{x as fe}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{$ as he,Y as ge,_ as we,K as ve,X as Fe,V as be,Z as xe}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{y as T}from"./Field-C6hA1tZj-CkWoRbmp.js";import{f as Oe}from"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import{C as Se,q as Re}from"./labelingInfo-DGVNul26-BDBqWm17.js";import{b as y}from"./Query-BrwMGK8U-BPr0_G9t.js";import{w as Ce}from"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./main-QGPoLsvl.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./capabilities-Cjn77swe-Y9lFlGVh.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./geojson-CNt_qtQf-X0105Nc8.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";let d=class extends D{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=A(!1,!1),this.type="wfs",this.refresh=W(async()=>{await this.load();const e={customParameters:this.layer.customParameters,maxRecordCount:this.layer.maxRecordCount,maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:o}=await this._workerHandler.refresh(e);return o&&(this.sourceJSON.extent=o),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const o=e!=null?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:o})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,o={}){const s=await this.queryFeaturesJSON(e,o);return se.fromJSON(s)}async queryFeaturesJSON(e,o={}){return await this.load(o),this._workerHandler.queryFeatures(e?e.toJSON():void 0,o)}async queryFeatureCount(e,o={}){return await this.load(o),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,o)}async queryObjectIds(e,o={}){return await this.load(o),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,o)}async queryExtent(e,o={}){await this.load(o);const s=await this._workerHandler.queryExtent(e?e.toJSON():void 0,o);return{count:s.count,extent:I.fromJSON(s.extent)}}async querySnapping(e,o={}){return await this.load(o),this._workerHandler.querySnapping(e,o)}async _createLoadOptions(e){const{url:o,customParameters:s,name:n,namespaceUri:p,fields:a,geometryType:m,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,swapXY:v}=this.layer,c=this.layer.originOf("spatialReference")==="defaults"?void 0:this.layer.spatialReference;if(!o)throw new X("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await te(o,{customParameters:s,...e}));const P=["fields","geometryType","name","namespaceUri","swapXY"].some(F=>this.layer[F]==null),l=P?await re(this.wfsCapabilities,n,p,{spatialReference:c,customParameters:s,signal:e?.signal}):{...ie(a??[]),geometryType:m,name:n,namespaceUri:p,spatialReference:c,swapXY:v},q=oe(this.wfsCapabilities.readFeatureTypes(),l.name,l.namespaceUri),j=h.toJSON(l.geometryType),{operations:x}=this.wfsCapabilities,_=x.GetFeature.url,N=x.GetFeature.outputFormat;return{customParameters:s,featureType:q,fields:l.fields?.map(F=>F.toJSON())??[],geometryField:l.geometryField,geometryType:j,getFeatureUrl:_,getFeatureOutputFormat:N,maxRecordCount:u,maxPageCount:g,maxTotalRecordCount:w,objectIdField:l.objectIdField,spatialReference:l.spatialReference?.toJSON(),swapXY:!!l.swapXY}}async _startWorker(e){const[o,s]=await L([this._createLoadOptions(e),z("WFSSourceWorker",{...e,strategy:H("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),n=o.error||s.error||null,p=s.value||null;if(n)throw p&&p.close(),n;const a=o.value;this._connection=s.value,this._workerHandler=this._connection.createInvokeProxy();const m=await this._workerHandler.load(a,e);for(const u of m.warnings)Q.getLogger(this.layer).warn("#load()",`${u.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:u});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:G},extent:m.extent,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:M(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:a.maxRecordCount,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};t([r()],d.prototype,"capabilities",void 0),t([r({constructOnly:!0})],d.prototype,"layer",void 0),t([r()],d.prototype,"sourceJSON",void 0),t([r()],d.prototype,"type",void 0),t([r()],d.prototype,"wfsCapabilities",void 0),d=t([R("esri.layers.graphics.sources.WFSSource")],d);var b;const S=Oe();let i=b=class extends me(ne(le(pe(ae(fe(ye(ce(de(ue(Z(B))))))))))){static fromWFSLayerInfo(e){const{customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c}=e;return new b({customParameters:o,fields:s,geometryField:n,geometryType:p,name:a,namespaceUri:m,objectIdField:u,spatialReference:g,swapXY:w,url:v,wfsCapabilities:c})}constructor(e){super(e),this.copyright=null,this.customParameters=null,this.dateFieldsTimeZone=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.maxRecordCount=3e3,this.maxPageCount=10,this.maxTotalRecordCount=2e5,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=C.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}destroy(){this.source?.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"),O(this.renderer,this.fieldsIndex),E(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){return this.source?.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,o,s){const n=e.filter(p=>p.name!==ee);this.geometryField&&n.unshift(new T({name:this.geometryField,alias:this.geometryField,type:"geometry"})),U(s,n.map(p=>p.toJSON()),o)}get parsedUrl(){return J(this.url)}set renderer(e){O(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){return this.source?.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return Ce(this,e)}createQuery(){const e=new y({returnGeometry:!0,outFields:["*"],where:this.definitionExpression||"1=1"}),{timeOffset:o,timeExtent:s}=this;return e.timeExtent=o!=null&&s!=null?s.offset(-o.value,o.unit):s||null,e}getFieldDomain(e,o){return this.getField(e)?.domain}getField(e){return this.fieldsIndex?.get(e)}queryFeatures(e,o){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),o)).then(s=>{if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,o){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),o))}queryFeatureCount(e,o){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),o))}queryExtent(e,o){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),o))}async hasDataChanged(){try{const{dataChanged:e,updates:o}=await this.source.refresh();return o!=null&&this.read(o,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};t([r({readOnly:!0})],i.prototype,"capabilities",null),t([r({type:String})],i.prototype,"copyright",void 0),t([r({readOnly:!0})],i.prototype,"createQueryVersion",null),t([r({json:{name:"wfsInfo.customParameters",write:{overridePolicy:e=>({enabled:!!(e&&Object.keys(e).length>0),ignoreOrigin:!0})}}})],i.prototype,"customParameters",void 0),t([r($("dateFieldsTimeReference"))],i.prototype,"dateFieldsTimeZone",void 0),t([r({readOnly:!0})],i.prototype,"defaultPopupTemplate",null),t([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),t([r({type:String})],i.prototype,"displayField",void 0),t([r(he)],i.prototype,"elevationInfo",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"featureUrl",void 0),t([r({type:[T],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],i.prototype,"fields",void 0),t([k("fields")],i.prototype,"writeFields",null),t([r(S.fieldsIndex)],i.prototype,"fieldsIndex",void 0),t([r({type:I,json:{name:"extent"}})],i.prototype,"fullExtent",void 0),t([r()],i.prototype,"geometryField",void 0),t([r({type:String,json:{read:{source:"layerDefinition.geometryType",reader:h.read},write:{target:"layerDefinition.geometryType",writer:h.write,ignoreOrigin:!0},origins:{service:{read:h.read}}}})],i.prototype,"geometryType",void 0),t([r({type:String})],i.prototype,"id",void 0),t([r(ge)],i.prototype,"labelsVisible",void 0),t([r({type:[Se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:Re},write:!0}})],i.prototype,"labelingInfo",void 0),t([r(we)],i.prototype,"legendEnabled",void 0),t([r({type:["show","hide"]})],i.prototype,"listMode",void 0),t([r({type:String})],i.prototype,"objectIdField",void 0),t([r({type:["WFS"]})],i.prototype,"operationalLayerType",void 0),t([r({type:f,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"maxRecordCount",void 0),t([r({type:f})],i.prototype,"maxPageCount",void 0),t([r({type:f})],i.prototype,"maxTotalRecordCount",void 0),t([r({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],i.prototype,"mode",void 0),t([r({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"name",void 0),t([r({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"namespaceUri",void 0),t([r(ve)],i.prototype,"opacity",void 0),t([r(S.outFields)],i.prototype,"outFields",void 0),t([r({readOnly:!0})],i.prototype,"parsedUrl",null),t([r(Fe)],i.prototype,"popupEnabled",void 0),t([r({type:Y,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),t([r({types:V,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:K,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],i.prototype,"renderer",null),t([r(be)],i.prototype,"screenSizePerspectiveEnabled",void 0),t([r({readOnly:!0})],i.prototype,"source",void 0),t([r({type:C,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],i.prototype,"spatialReference",void 0),t([r({readOnly:!0,type:[f],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"spatialReferences",void 0),t([r({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"swapXY",void 0),t([r({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],i.prototype,"title",void 0),t([r({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),t([r(xe)],i.prototype,"url",void 0),t([r({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],i.prototype,"version",void 0),t([r()],i.prototype,"wfsCapabilities",null),i=b=t([R("esri.layers.WFSLayer")],i);const Kt=i;export{Kt as default}; diff --git a/custom-toc-highlight/assets/WFSSourceWorker-CI7-tY7M-B1raNSo8.js b/custom-toc-highlight/assets/WFSSourceWorker-CI7-tY7M-CZ8uM4i-.js similarity index 73% rename from custom-toc-highlight/assets/WFSSourceWorker-CI7-tY7M-B1raNSo8.js rename to custom-toc-highlight/assets/WFSSourceWorker-CI7-tY7M-CZ8uM4i-.js index cddeef6b..ee811ab9 100644 --- a/custom-toc-highlight/assets/WFSSourceWorker-CI7-tY7M-B1raNSo8.js +++ b/custom-toc-highlight/assets/WFSSourceWorker-CI7-tY7M-CZ8uM4i-.js @@ -1 +1 @@ -import{o as y,$ as c,cl as T,ay as E,a1 as g,b0 as _,aU as w,aC as I}from"./story-BfX8CRfG.js";import{z as P,n as q}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{I as b}from"./FeatureStore-Co2V0sVE-BwnfsIjJ.js";import{f as j,h as $}from"./queryUtils-Brxu6254-PPvpiP5X.js";import{Z as O}from"./QueryEngine-CH5uUhZK-BP95Dm56.js";import{X as Q,_ as M}from"./geojson-CNt_qtQf-B9F87hyc.js";import{F as N}from"./sourceUtils-BMeqkJ5g-DxP4qerC.js";import{V as k,b as L,I as f}from"./wfsUtils-DoLaqXsj-B0NjDgDj.js";import{o as Z}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./main-ugzBrWNm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-BnCtocGj.js";import"./PooledRBush-DbfAmeLn-B9Pkw5Ae.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./WhereClause-DxwoyBMS-DnXKVpm2.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./utils-HtkT8Fn3-wUwu1nm1.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-BQ5pghrp.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./utils-tNxq3jkf-B78XlSIE.js";import"./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";const x="esri.layers.WFSLayer";class Ut{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:o,getFeatureOutputFormat:s,fields:n,geometryType:u,featureType:a,maxRecordCount:i,maxTotalRecordCount:h,maxPageCount:R,objectIdField:d,customParameters:F}=e,{spatialReference:p,getFeatureSpatialReference:l}=k(o,a,e.spatialReference);try{await j(l,p)}catch{throw new y("unsupported-projection","Projection not supported",{inSpatialReference:l,outSpatialReference:p})}c(t),this._customParameters=F,this._featureType=a,this._fieldsIndex=Z.fromLayerJSON({fields:n,dateFieldsTimeReference:n.some(S=>S.type==="esriFieldTypeDate")?{timeZoneIANA:T}:null}),this._geometryType=u,this._getFeatureUrl=o,this._getFeatureOutputFormat=s,this._getFeatureSpatialReference=l,this._maxRecordCount=i,this._maxTotalRecordCount=h,this._maxPageCount=R,this._objectIdField=d,this._spatialReference=p;let m=await this._snapshotFeatures(t);if(m.errors.length>0&&(this._supportsPagination=!1,m=await this._snapshotFeatures(t),m.errors.length>0))throw m.errors[0];return this._queryEngine=new O({fieldsIndex:this._fieldsIndex,geometryType:u,hasM:!1,hasZ:!1,objectIdField:d,spatialReference:p,timeInfo:null,featureStore:new b({geometryType:u,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(m.features),{warnings:C(m),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new y("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){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=E(t=>this._snapshotFeatures({signal:t})),this._snapshotTask.promise.then(t=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(t.features);for(const o of C(t))g.getLogger(x).warn(new _("wfs-layer:refresh-warning",o.message,o.details));t.errors?.length&&g.getLogger(x).warn(new _("wfs-layer:refresh-error","Refresh completed with errors",{errors:t.errors}))},()=>{this._queryEngine.featureStore.clear()}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,o=this._maxTotalRecordCount,s=this._maxPageCount,n=this._supportsPagination?await L(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let u=[];const a=[];if(n==null)try{u=await this._singleQuery(t)}catch(i){w(i)||a.push(i)}else{const i=Math.min(n,o),h=U(this,Math.max(1,Math.min(Math.ceil(i/this._maxRecordCount),s)),t);await Promise.allSettled(Array.from({length:10}).map(()=>J(h,u,a)))}return c(t),{features:u,totalRecordCount:n,maxTotalRecordCount:o,maxPageCount:s,errors:a}}async _singleQuery(e){const t=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const o=e*this._maxRecordCount,s=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:o,count:this._maxRecordCount,signal:t});return this._processGeoJSON(s,{startIndex:o,signal:t})}_processGeoJSON(e,t){Q(e,this._getFeatureSpatialReference.wkid);const{startIndex:o,signal:s}=t;c(s);const n=M(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!I(this._spatialReference,this._getFeatureSpatialReference))for(const a of n)a.geometry!=null&&(a.geometry=P($(q(a.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let u=o??1;for(const a of n){const i={};N(this._fieldsIndex,i,a.attributes,!0),a.attributes=i,i[this._objectIdField]==null&&(a.objectId=i[this._objectIdField]=u++)}return n}}function*U(r,e,t){for(let o=0;or.maxTotalRecordCount&&e.push({name:"wfs-layer:large-dataset",message:`The number of ${r.totalRecordCount} features exceeds the maximum allowed of ${r.maxTotalRecordCount}.`,details:{recordCount:r.features.length,totalRecordCount:r.totalRecordCount,maxTotalRecordCount:r.maxTotalRecordCount}})),e}export{Ut as default}; +import{o as y,$ as c,cl as T,ay as E,a1 as g,b0 as _,aU as w,aC as I}from"./story-Doly9N9p.js";import{z as P,n as q}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{I as b}from"./FeatureStore-Co2V0sVE-BK6XAR3o.js";import{f as j,h as $}from"./queryUtils-Brxu6254-CDiE0zms.js";import{Z as O}from"./QueryEngine-CH5uUhZK-DRGPyg2C.js";import{X as Q,_ as M}from"./geojson-CNt_qtQf-X0105Nc8.js";import{F as N}from"./sourceUtils-BMeqkJ5g-DcR3VPl5.js";import{V as k,b as L,I as f}from"./wfsUtils-DoLaqXsj-DBVQwnFp.js";import{o as Z}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./main-QGPoLsvl.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./BoundsStore--N6o1xkF-CQrhMeDa.js";import"./PooledRBush-DbfAmeLn-CPHfm9op.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./utils-HtkT8Fn3-Dd_0rdy5.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-DyydRFHu-1ITtOELE.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./utils-tNxq3jkf-nfQcZo7O.js";import"./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./date-Cqvy-TgA-DIf-QFLz.js";import"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./Field-C6hA1tZj-CkWoRbmp.js";const x="esri.layers.WFSLayer";class Ut{constructor(){this._customParameters=null,this._queryEngine=null,this._supportsPagination=!0}destroy(){this._queryEngine?.destroy(),this._queryEngine=null}async load(e,t={}){const{getFeatureUrl:o,getFeatureOutputFormat:s,fields:n,geometryType:u,featureType:a,maxRecordCount:i,maxTotalRecordCount:h,maxPageCount:R,objectIdField:d,customParameters:F}=e,{spatialReference:p,getFeatureSpatialReference:l}=k(o,a,e.spatialReference);try{await j(l,p)}catch{throw new y("unsupported-projection","Projection not supported",{inSpatialReference:l,outSpatialReference:p})}c(t),this._customParameters=F,this._featureType=a,this._fieldsIndex=Z.fromLayerJSON({fields:n,dateFieldsTimeReference:n.some(S=>S.type==="esriFieldTypeDate")?{timeZoneIANA:T}:null}),this._geometryType=u,this._getFeatureUrl=o,this._getFeatureOutputFormat=s,this._getFeatureSpatialReference=l,this._maxRecordCount=i,this._maxTotalRecordCount=h,this._maxPageCount=R,this._objectIdField=d,this._spatialReference=p;let m=await this._snapshotFeatures(t);if(m.errors.length>0&&(this._supportsPagination=!1,m=await this._snapshotFeatures(t),m.errors.length>0))throw m.errors[0];return this._queryEngine=new O({fieldsIndex:this._fieldsIndex,geometryType:u,hasM:!1,hasZ:!1,objectIdField:d,spatialReference:p,timeInfo:null,featureStore:new b({geometryType:u,hasM:!1,hasZ:!1})}),this._queryEngine.featureStore.addMany(m.features),{warnings:C(m),extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async applyEdits(){throw new y("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){return this._customParameters=e.customParameters,this._maxRecordCount=e.maxRecordCount,this._maxTotalRecordCount=e.maxTotalRecordCount,this._maxPageCount=e.maxPageCount,this._snapshotTask?.abort(),this._snapshotTask=E(t=>this._snapshotFeatures({signal:t})),this._snapshotTask.promise.then(t=>{this._queryEngine.featureStore.clear(),this._queryEngine.featureStore.addMany(t.features);for(const o of C(t))g.getLogger(x).warn(new _("wfs-layer:refresh-warning",o.message,o.details));t.errors?.length&&g.getLogger(x).warn(new _("wfs-layer:refresh-error","Refresh completed with errors",{errors:t.errors}))},()=>{this._queryEngine.featureStore.clear()}),await this._waitSnapshotComplete(),{extent:(await this._queryEngine.fetchRecomputedExtents()).fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _snapshotFeatures(e){const t=e?.signal,o=this._maxTotalRecordCount,s=this._maxPageCount,n=this._supportsPagination?await L(this._getFeatureUrl,this._featureType.typeName,{customParameters:this._customParameters,signal:t}):void 0;let u=[];const a=[];if(n==null)try{u=await this._singleQuery(t)}catch(i){w(i)||a.push(i)}else{const i=Math.min(n,o),h=U(this,Math.max(1,Math.min(Math.ceil(i/this._maxRecordCount),s)),t);await Promise.allSettled(Array.from({length:10}).map(()=>J(h,u,a)))}return c(t),{features:u,totalRecordCount:n,maxTotalRecordCount:o,maxPageCount:s,errors:a}}async _singleQuery(e){const t=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,signal:e});return this._processGeoJSON(t,{signal:e})}async _pageQuery(e,t){const o=e*this._maxRecordCount,s=await f(this._getFeatureUrl,this._featureType.typeName,this._getFeatureSpatialReference,this._getFeatureOutputFormat,{customParameters:this._customParameters,startIndex:o,count:this._maxRecordCount,signal:t});return this._processGeoJSON(s,{startIndex:o,signal:t})}_processGeoJSON(e,t){Q(e,this._getFeatureSpatialReference.wkid);const{startIndex:o,signal:s}=t;c(s);const n=M(e,{geometryType:this._geometryType,hasZ:!1,objectIdField:this._objectIdField});if(!I(this._spatialReference,this._getFeatureSpatialReference))for(const a of n)a.geometry!=null&&(a.geometry=P($(q(a.geometry,this._geometryType,!1,!1),this._getFeatureSpatialReference,this._spatialReference)));let u=o??1;for(const a of n){const i={};N(this._fieldsIndex,i,a.attributes,!0),a.attributes=i,i[this._objectIdField]==null&&(a.objectId=i[this._objectIdField]=u++)}return n}}function*U(r,e,t){for(let o=0;or.maxTotalRecordCount&&e.push({name:"wfs-layer:large-dataset",message:`The number of ${r.totalRecordCount} features exceeds the maximum allowed of ${r.maxTotalRecordCount}.`,details:{recordCount:r.features.length,totalRecordCount:r.totalRecordCount,maxTotalRecordCount:r.maxTotalRecordCount}})),e}export{Ut as default}; diff --git a/custom-toc-highlight/assets/WGLContainer-LxgEo4I_-C81rKEy3.js b/custom-toc-highlight/assets/WGLContainer-LxgEo4I_-uPdq0FyK.js similarity index 99% rename from custom-toc-highlight/assets/WGLContainer-LxgEo4I_-C81rKEy3.js rename to custom-toc-highlight/assets/WGLContainer-LxgEo4I_-uPdq0FyK.js index 8b0a849e..55bba3d7 100644 --- a/custom-toc-highlight/assets/WGLContainer-LxgEo4I_-C81rKEy3.js +++ b/custom-toc-highlight/assets/WGLContainer-LxgEo4I_-uPdq0FyK.js @@ -1,4 +1,4 @@ -import{K as j,O as ve,aA as Ee,a1 as Se,ah as ft,o as Te,iW as Oe}from"./story-BfX8CRfG.js";import{S as dt,W as _t,X as mt,Y as vt,t as ue,G as Ae,w as F,z as Pe,B as Ze}from"./definitions-DJSdSb77-DkoRHaVx.js";import{p as le,M as ne,s as Ke,T as pt,Z as gt,V as R,G as ht}from"./LabelMetric-BeluzH3o-C3fDXNzp.js";import{r as k}from"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import{M as B,I as P,T as A,n as W,A as N,L as U,D as Q,C as xt,G as yt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as K}from"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import{n as ie}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{c as St,d as ce}from"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import{l as pe,H as Tt,K as bt}from"./Tile-D75RMC64-Dj1SOP3K.js";import{Q as qe,E as ge,k as It}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as oe,N as he,S as Ce,E as ee,o as Et,q as Ot}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{_ as At,Z as Pt}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{o as Ct}from"./vec3f32-BS0cezmI-B_madU1n.js";import{T as $e,x as Dt}from"./Container-BcuL1ZEG-DxXVQv25.js";import{s as Rt}from"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import{H as Lt,V as Mt}from"./Texture-BCt2hphT-hC4XzHg_.js";import{i as J,n as G,u as De}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{o as zt,e as Vt}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{e as Re}from"./config-nuMERBvb-MDUrh2eL.js";import{m as Nt}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{m as wt}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Le}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{o as Ft,O as Bt}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{c as Me}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";let Ut=class{constructor(i,e){this._rctx=i,this._attributes=[{name:"position",offset:0,type:P.SHORT,count:2}],this.layout={hash:gt(this._attributes),attributes:this._attributes,stride:4},this._vertexBuffer=k.createVertex(i,W.STATIC_DRAW,new Uint16Array(e)),this._vao=new K(i,new Map([["a_position",0]]),new Map([["geometry",[new ie("a_position",2,P.SHORT,0,4)]]]),new Map([["geometry",this._vertexBuffer]])),this._count=e.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(A.TRIANGLE_STRIP,0,this._count)}},Z=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(i,e){}draw(i,e,t){}drawMany(i,e,t){for(const o of e)o.visible&&this.draw(i,o,t)}};const de={nearest:{defines:[],samplingMode:B.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:B.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:B.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:B.LINEAR_MIPMAP_LINEAR,mips:!0}},Gt=(i,e,t)=>{if(t.samplingMode==="dynamic"){const{state:o}=i,a=e.resolution/e.pixelRatio/o.resolution,r=Math.round(i.pixelRatio)!==i.pixelRatio,l=a>1.05||a<.95;return o.rotation||l||r||e.isSourceScaled||e.rotation?de.bilinear:de.nearest}return de[t.samplingMode]};let Yt=class extends Z{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:i}){i.setBlendingEnabled(!0),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!0)}draw(i,e){const{context:t,renderingOptions:o,painter:a,requestRender:r,allowDelayedRender:l}=i;if(!e.source||!e.isReady)return;const n=Gt(i,e,o),s=a.materialManager.getProgram(this._desc,n.defines);if(l&&r!=null&&!s.compiled)return void r();i.timeline.begin(this.name),e.blendFunction==="additive"?t.setBlendFunctionSeparate(N.ONE,N.ONE,N.ONE,N.ONE):t.setBlendFunctionSeparate(N.ONE,N.ONE_MINUS_SRC_ALPHA,N.ONE,N.ONE_MINUS_SRC_ALPHA),t.setStencilFunction(U.EQUAL,e.stencilRef,255),this._quad||(this._quad=new Ut(t,[0,0,1,0,0,1,1,1]));const{coordScale:c,computedOpacity:u,transforms:f}=e;e.setSamplingProfile(n),e.bind(i.context,Ae),t.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",f.displayViewScreenMat3),s.setUniform1i("u_texture",Ae),s.setUniform2fv("u_coordScale",c),s.setUniform1f("u_opacity",u),this._quad.draw(),i.timeline.end(this.name)}};function je(){return new Float32Array(4)}function kt(i){const e=new Float32Array(4);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e}function H(i,e,t,o){const a=new Float32Array(4);return a[0]=i,a[1]=e,a[2]=t,a[3]=o,a}function Ht(i,e){return new Float32Array(i,e,4)}function Xe(){return je()}function Qe(){return H(1,1,1,1)}function Je(){return H(1,0,0,0)}function et(){return H(0,1,0,0)}function tt(){return H(0,0,1,0)}function it(){return H(0,0,0,1)}const Wt=Xe(),Zt=Qe(),Kt=Je(),qt=et(),$t=tt(),jt=it();Object.freeze(Object.defineProperty({__proto__:null,ONES:Zt,UNIT_W:jt,UNIT_X:Kt,UNIT_Y:qt,UNIT_Z:$t,ZEROS:Wt,clone:kt,create:je,createView:Ht,fromValues:H,ones:Qe,unitW:it,unitX:Je,unitY:et,unitZ:tt,zeros:Xe},Symbol.toStringTag,{value:"Module"}));const Xt={background:{"background.frag":`uniform lowp vec4 u_color; +import{K as j,O as ve,aA as Ee,a1 as Se,ah as ft,o as Te,iW as Oe}from"./story-Doly9N9p.js";import{S as dt,W as _t,X as mt,Y as vt,t as ue,G as Ae,w as F,z as Pe,B as Ze}from"./definitions-DJSdSb77-DkoRHaVx.js";import{p as le,M as ne,s as Ke,T as pt,Z as gt,V as R,G as ht}from"./LabelMetric-BeluzH3o-Br-5CSAC.js";import{r as k}from"./BufferObject-BM_7mcDb-EYaqMhmk.js";import{M as B,I as P,T as A,n as W,A as N,L as U,D as Q,C as xt,G as yt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as K}from"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import{n as ie}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{c as St,d as ce}from"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import{l as pe,H as Tt,K as bt}from"./Tile-D75RMC64-g8Sx5TPr.js";import{Q as qe,E as ge,k as It}from"./mat3-CC4Foazl-BWjyqE2v.js";import{e as oe,N as he,S as Ce,E as ee,o as Et,q as Ot}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{_ as At,Z as Pt}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{o as Ct}from"./vec3f32-BS0cezmI-B_madU1n.js";import{T as $e,x as Dt}from"./Container-BcuL1ZEG-DVZvemLA.js";import{s as Rt}from"./TileKey-C5IL-JBr-BGwa3-Dg.js";import{H as Lt,V as Mt}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{i as J,n as G,u as De}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{o as zt,e as Vt}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{e as Re}from"./config-nuMERBvb-MDUrh2eL.js";import{m as Nt}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{m as wt}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as Le}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{o as Ft,O as Bt}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{c as Me}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";let Ut=class{constructor(i,e){this._rctx=i,this._attributes=[{name:"position",offset:0,type:P.SHORT,count:2}],this.layout={hash:gt(this._attributes),attributes:this._attributes,stride:4},this._vertexBuffer=k.createVertex(i,W.STATIC_DRAW,new Uint16Array(e)),this._vao=new K(i,new Map([["a_position",0]]),new Map([["geometry",[new ie("a_position",2,P.SHORT,0,4)]]]),new Map([["geometry",this._vertexBuffer]])),this._count=e.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(A.TRIANGLE_STRIP,0,this._count)}},Z=class{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(i,e){}draw(i,e,t){}drawMany(i,e,t){for(const o of e)o.visible&&this.draw(i,o,t)}};const de={nearest:{defines:[],samplingMode:B.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:B.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:B.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:B.LINEAR_MIPMAP_LINEAR,mips:!0}},Gt=(i,e,t)=>{if(t.samplingMode==="dynamic"){const{state:o}=i,a=e.resolution/e.pixelRatio/o.resolution,r=Math.round(i.pixelRatio)!==i.pixelRatio,l=a>1.05||a<.95;return o.rotation||l||r||e.isSourceScaled||e.rotation?de.bilinear:de.nearest}return de[t.samplingMode]};let Yt=class extends Z{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:i}){i.setBlendingEnabled(!0),i.setColorMask(!0,!0,!0,!0),i.setStencilWriteMask(0),i.setStencilTestEnabled(!0)}draw(i,e){const{context:t,renderingOptions:o,painter:a,requestRender:r,allowDelayedRender:l}=i;if(!e.source||!e.isReady)return;const n=Gt(i,e,o),s=a.materialManager.getProgram(this._desc,n.defines);if(l&&r!=null&&!s.compiled)return void r();i.timeline.begin(this.name),e.blendFunction==="additive"?t.setBlendFunctionSeparate(N.ONE,N.ONE,N.ONE,N.ONE):t.setBlendFunctionSeparate(N.ONE,N.ONE_MINUS_SRC_ALPHA,N.ONE,N.ONE_MINUS_SRC_ALPHA),t.setStencilFunction(U.EQUAL,e.stencilRef,255),this._quad||(this._quad=new Ut(t,[0,0,1,0,0,1,1,1]));const{coordScale:c,computedOpacity:u,transforms:f}=e;e.setSamplingProfile(n),e.bind(i.context,Ae),t.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",f.displayViewScreenMat3),s.setUniform1i("u_texture",Ae),s.setUniform2fv("u_coordScale",c),s.setUniform1f("u_opacity",u),this._quad.draw(),i.timeline.end(this.name)}};function je(){return new Float32Array(4)}function kt(i){const e=new Float32Array(4);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e}function H(i,e,t,o){const a=new Float32Array(4);return a[0]=i,a[1]=e,a[2]=t,a[3]=o,a}function Ht(i,e){return new Float32Array(i,e,4)}function Xe(){return je()}function Qe(){return H(1,1,1,1)}function Je(){return H(1,0,0,0)}function et(){return H(0,1,0,0)}function tt(){return H(0,0,1,0)}function it(){return H(0,0,0,1)}const Wt=Xe(),Zt=Qe(),Kt=Je(),qt=et(),$t=tt(),jt=it();Object.freeze(Object.defineProperty({__proto__:null,ONES:Zt,UNIT_W:jt,UNIT_X:Kt,UNIT_Y:qt,UNIT_Z:$t,ZEROS:Wt,clone:kt,create:je,createView:Ht,fromValues:H,ones:Qe,unitW:it,unitX:Je,unitY:et,unitZ:tt,zeros:Xe},Symbol.toStringTag,{value:"Module"}));const Xt={background:{"background.frag":`uniform lowp vec4 u_color; void main() { gl_FragColor = u_color; }`,"background.vert":`attribute vec2 a_pos; diff --git a/custom-toc-highlight/assets/WMSLayer-C8eYRV4V-DczckqqP.js b/custom-toc-highlight/assets/WMSLayer-C8eYRV4V-lRsRDNhJ.js similarity index 94% rename from custom-toc-highlight/assets/WMSLayer-C8eYRV4V-DczckqqP.js rename to custom-toc-highlight/assets/WMSLayer-C8eYRV4V-lRsRDNhJ.js index 5b99d9b1..31896696 100644 --- a/custom-toc-highlight/assets/WMSLayer-C8eYRV4V-DczckqqP.js +++ b/custom-toc-highlight/assets/WMSLayer-C8eYRV4V-lRsRDNhJ.js @@ -1,2 +1,2 @@ -import{bR as Me,ai as $,av as F,ah as H,bG as Ce,ag as z,v as a,S as u,n as L,a0 as O,ad as Te,i as xe,aK as je,W as $e,J as N,a as we,y as ie,f as W,aC as qe,bZ as Be,bL as Ve,bi as We,c as ke,C as De,o as ve,P as Ge,ac as k,bB as Xe,aq as U,F as He,b_ as Je,b$ as Ze}from"./story-BfX8CRfG.js";import{f as ze}from"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import{_ as Ke,m as Qe}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{c as se}from"./scaleUtils-DxsfQwK1-D7ZZd5W4.js";import{D as Ye}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{u as et}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{E as tt}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as rt}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as nt}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as it}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{x as st}from"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import{n as J}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{U as at}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{_ as ot,Z as lt}from"./commonProperties-BtIqvFU_-DVH0kGN9.js";import{r as ae}from"./ExportWMSImageParameters-CMk80WSM-sFuOAfxa.js";import{i as ut}from"./imageBitmapUtils-DA36kg39-CZPhYtU7.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";var M;let pt=0,y=M=class extends Me(Ke){constructor(e){super(e),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([$(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},F),$(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},F),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=this,n.layer=this.layer},F),H(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},F)])}get id(){return this._get("id")??pt++}set id(e){this._set("id",e)}readLegendUrl(e,t){return t.legendUrl??t.legendURL??null}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}castSublayers(e){return Ce(z.ofType(M),e)}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){const e=new M;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=this.fullExtents?.map(t=>t.clone())??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?.map(t=>t.clone())),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=this.spatialReferences?.map(t=>t)),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,t){const r=this.layer;this._get(e)!==t&&(this._set(e,t),r&&r.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};a([u()],y.prototype,"description",void 0),a([u({readOnly:!0})],y.prototype,"dimensions",void 0),a([u({type:L,json:{name:"extent"}})],y.prototype,"fullExtent",void 0),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:{name:"legendUrl",write:{ignoreOrigin:!0}}})],y.prototype,"legendUrl",void 0),a([O("legendUrl",["legendUrl","legendURL"])],y.prototype,"readLegendUrl",null),a([u({type:Boolean,json:{name:"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,json:{write:{ignoreOrigin:!0}}})],y.prototype,"name",void 0),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([Te("sublayers")],y.prototype,"castSublayers",null),a([u({type:[Number],json:{read:{source:"spatialReferences"}}})],y.prototype,"spatialReferences",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],y.prototype,"title",void 0),a([u({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],y.prototype,"visible",null),y=M=a([xe("esri.layers.support.WMSSublayer")],y);const Z=y,oe={84:4326,83:4269,27:4267};function mt(e){if(!e)return null;const t={idCounter:-1};typeof e=="string"&&(e=new DOMParser().parseFromString(e,"text/xml"));const r=e.documentElement;if(r.nodeName==="ServiceExceptionReport"){const b=Array.prototype.slice.call(r.childNodes).map(P=>P.textContent).join(`\r +import{bR as Me,ai as $,av as F,ah as H,bG as Ce,ag as z,v as a,S as u,n as L,a0 as O,ad as Te,i as xe,aK as je,W as $e,J as N,a as we,y as ie,f as W,aC as qe,bZ as Be,bL as Ve,bi as We,c as ke,C as De,o as ve,P as Ge,ac as k,bB as Xe,aq as U,F as He,b_ as Je,b$ as Ze}from"./story-Doly9N9p.js";import{f as ze}from"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import{_ as Ke,m as Qe}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{c as se}from"./scaleUtils-DxsfQwK1-CzyfErWH.js";import{D as Ye}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{u as et}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{E as tt}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as rt}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as nt}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as it}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{x as st}from"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import{n as J}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{U as at}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{_ as ot,Z as lt}from"./commonProperties-BtIqvFU_-DbZji2Rx.js";import{r as ae}from"./ExportWMSImageParameters-CMk80WSM-wEv_P_PY.js";import{i as ut}from"./imageBitmapUtils-DA36kg39-BfNbbEDs.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";var M;let pt=0,y=M=class extends Me(Ke){constructor(e){super(e),this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.name=null,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.title=null,this.addHandles([$(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},F),$(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},F),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=this,n.layer=this.layer},F),H(()=>this.layer,t=>{if(this.sublayers)for(const r of this.sublayers)r.layer=t},F)])}get id(){return this._get("id")??pt++}set id(e){this._set("id",e)}readLegendUrl(e,t){return t.legendUrl??t.legendURL??null}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}castSublayers(e){return Ce(z.ofType(M),e)}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){const e=new M;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=this.fullExtents?.map(t=>t.clone())??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?.map(t=>t.clone())),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=this.spatialReferences?.map(t=>t)),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,t){const r=this.layer;this._get(e)!==t&&(this._set(e,t),r&&r.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};a([u()],y.prototype,"description",void 0),a([u({readOnly:!0})],y.prototype,"dimensions",void 0),a([u({type:L,json:{name:"extent"}})],y.prototype,"fullExtent",void 0),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:{name:"legendUrl",write:{ignoreOrigin:!0}}})],y.prototype,"legendUrl",void 0),a([O("legendUrl",["legendUrl","legendURL"])],y.prototype,"readLegendUrl",null),a([u({type:Boolean,json:{name:"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,json:{write:{ignoreOrigin:!0}}})],y.prototype,"name",void 0),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([Te("sublayers")],y.prototype,"castSublayers",null),a([u({type:[Number],json:{read:{source:"spatialReferences"}}})],y.prototype,"spatialReferences",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],y.prototype,"title",void 0),a([u({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],y.prototype,"visible",null),y=M=a([xe("esri.layers.support.WMSSublayer")],y);const Z=y,oe={84:4326,83:4269,27:4267};function mt(e){if(!e)return null;const t={idCounter:-1};typeof e=="string"&&(e=new DOMParser().parseFromString(e,"text/xml"));const r=e.documentElement;if(r.nodeName==="ServiceExceptionReport"){const b=Array.prototype.slice.call(r.childNodes).map(P=>P.textContent).join(`\r `);throw new ve("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",b)}const n=g("Capability",r),i=g("Service",r),l=n&&g("Request",n);if(!n||!i||!l)return null;const s=g("Layer",n);if(!s)return null;const c=r.nodeName==="WMS_Capabilities"||r.nodeName==="WMT_MS_Capabilities"?r.getAttribute("version"):"1.3.0",o=w("Title",i,"")||w("Name",i,""),p=w("AccessConstraints",i,""),f=/^none$/i.test(p)?"":p,d=w("Abstract",i,""),x=parseInt(w("MaxWidth",i,"5000"),10),v=parseInt(w("MaxHeight",i,"5000"),10),S=ue(l,"GetMap"),I=le(l,"GetMap"),h=j(s,c,t);if(!h)return null;let K,q=0;const Ee=Array.prototype.slice.call(n.childNodes),Re=h.sublayers??[],Q=b=>{b!=null&&Re.push(b)};Ee.forEach(b=>{b.nodeName==="Layer"&&(q===0?K=b:(q===1&&h.name&&(h.name="",Q(j(K,c,t))),Q(j(b,c,t))),q++)});let E=h.sublayers,B=h.extent;const Oe=h.fullExtents??[];if(E||(E=[]),E.length===0&&E.push(h),!B){const b=new L(E[0].extent);h.extent=b.toJSON(),B=h.extent}const Le=h.spatialReferences.length>0?h.spatialReferences:Se(h),Y=le(l,"GetFeatureInfo"),Pe=Y?ue(l,"GetFeatureInfo"):null,ee=Ie(E),Ae=h.minScale||0,Ue=h.maxScale||0,te=h.dimensions??[],_e=ee.reduce((b,P)=>b.concat(P.dimensions??[]),[]),re=te.concat(_e).filter(Ne);let ne=null;if(re.length){const b=re.map(P=>{const{extent:V}=P;return ft(V)?V.map(_=>_.getTime()):V?.map(_=>[_.min.getTime(),_.max.getTime()])}).flat(2).filter(U);ne={startTimeField:null,endTimeField:null,trackIdField:void 0,timeExtent:[Math.min(...b),Math.max(...b)]}}return{copyright:f,description:d,dimensions:te,extent:B,fullExtents:Oe,featureInfoFormats:Pe,featureInfoUrl:Y,mapUrl:I,maxWidth:x,maxHeight:v,maxScale:Ue,minScale:Ae,layers:ee,spatialReferences:Le,supportedImageFormatTypes:S,timeInfo:ne,title:o,version:c}}function ct(e){const t=e.filter(r=>r.popupEnabled&&r.name&&r.queryable);return t.length?t.map(({name:r})=>r).join():null}function Se(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const t of e.sublayers){const r=Se(t);if(r.length>0)return r}return[]}function Ie(e){let t=[];for(const r of e)t.push(r),r.sublayers?.length&&(t=t.concat(Ie(r.sublayers)),delete r.sublayers);return t}function C(e,t,r){return t.getAttribute(e)??r}function dt(e,t,r,n){const i=g(e,r);return i?C(t,i,n):n}function g(e,t){for(let r=0;ri).filter(U);const n=[];for(const i of r)if(i.getAttribute("name")===t){const l=T("Format",i);for(const{textContent:s}of l)s!=null&&n.push(s)}return n}function pe(e,t,r){const n=g(t,e);if(!n)return r;const{textContent:i}=n;if(i==null||i==="")return r;const l=Number(i);return isNaN(l)?r:l}function j(e,t,r){if(!e)return null;const n={id:r.idCounter++,fullExtents:[],parentLayerId:null,queryable:e.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},i=g("LatLonBoundingBox",e),l=g("EX_GeographicBoundingBox",e);let s=null;i&&(s=A(i,4326)),l&&(s=new L(0,0,0,0,new N({wkid:4326})),s.xmin=parseFloat(w("westBoundLongitude",l,"0")),s.ymin=parseFloat(w("southBoundLatitude",l,"0")),s.xmax=parseFloat(w("eastBoundLongitude",l,"0")),s.ymax=parseFloat(w("northBoundLatitude",l,"0"))),i||l||(s=new L(-180,-90,180,90,new N({wkid:4326}))),n.minScale=pe(e,"MaxScaleDenominator",0),n.maxScale=pe(e,"MinScaleDenominator",0);const c=["1.0.0","1.1.0","1.1.1"].includes(t)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach(o=>{if(o.nodeName==="Name")n.name=o.textContent||"";else if(o.nodeName==="Title")n.title=o.textContent||"";else if(o.nodeName==="Abstract")n.description=o.textContent||"";else if(o.nodeName==="BoundingBox"){const p=o.getAttribute(c);if(p&&p.indexOf("EPSG:")===0){const d=parseInt(p.slice(5),10);d===0||isNaN(d)||s||(s=t==="1.3.0"?A(o,d,J(d)):A(o,d))}const f=p?.indexOf(":");if(f&&f>-1){let d=parseInt(p.slice(f+1),10);d===0||isNaN(d)||(d=oe[d]??d);const x=t==="1.3.0"?A(o,d,J(d)):A(o,d);x&&n.fullExtents&&n.fullExtents.push(x)}}else if(o.nodeName===c)(o.textContent?.split(" ")??[]).forEach(p=>{let f=NaN;if(p.includes(":")){const[d,x]=p.toUpperCase().split(":");d!=="CRS"&&d!=="EPSG"||(f=parseInt(x,10))}else f=parseInt(p,10);if(f!==0&&!isNaN(f)){const d=oe[f]??f;n.spatialReferences.includes(d)||n.spatialReferences.push(d)}});else if(o.nodeName!=="Style"||n.legendUrl){if(o.nodeName==="Layer"){const p=j(o,t,r);p&&(p.parentLayerId=n.id,n.sublayers||(n.sublayers=[]),n.sublayers.push(p))}}else{const p=g("LegendURL",o);if(p){const f=g("OnlineResource",p);f&&(n.legendUrl=f.getAttribute("xlink:href"))}}}),n.extent=s?.toJSON(),n.dimensions=T("Dimension",e).filter(o=>o.getAttribute("name")&&o.getAttribute("units")&&o.textContent).map(o=>{const p=o.getAttribute("name"),f=o.getAttribute("units"),d=o.textContent,x=o.getAttribute("unitSymbol")??void 0,v=o.getAttribute("default")??void 0,S=C("default",o,"0")!=="0",I=C("nearestValue",o,"0")!=="0",h=C("current",o,"0")!=="0";return Ne({name:p,units:f})?{name:"time",units:"ISO8601",extent:de(d),default:de(v),multipleValues:S,nearestValue:I,current:h}:yt({name:p,units:f})?{name:"elevation",units:f,extent:me(d),unitSymbol:x,default:me(v),multipleValues:S,nearestValue:I}:{name:p,units:f,extent:ce(d),unitSymbol:x,default:ce(v),multipleValues:S,nearestValue:I}}),n}function ft(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function Fe(e){return e.nodeType===Node.ELEMENT_NODE}function yt(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function Ne(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function ht(e,t){const r=[],n=we(e);for(const i in n.query)n.query.hasOwnProperty(i)&&(t.includes(i.toLowerCase())||r.push(i+"="+n.query[i]));return n.path+(r.length?"?"+r.join("&"):"")}function me(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:parseFloat(i[0]),max:parseFloat(i[1]),resolution:i.length>=3&&i[2]!=="0"?parseFloat(i[2]):void 0}}).filter(U):r.map(n=>parseFloat(n))}function ce(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:i[0],max:i[1],resolution:i.length>=3&&i[2]!=="0"?i[2]:void 0}}).filter(U):r}function de(e){if(!e)return;const t=e.includes("/"),r=e.split(",");return t?r.map(n=>{const i=n.split("/");return i.length<2?null:{min:D(i[0]),max:D(i[1]),resolution:i.length>=3&&i[2]!=="0"?gt(i[2]):void 0}}).filter(U):r.map(n=>D(n))}function D(e){return He.fromISO(e,{zone:Je.utcInstance}).toJSDate()}function gt(e){const t=/(?: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,r=e.match(t);return r?{years:R(r[1]),months:R(r[2]),days:R(r[3]),hours:R(r[4]),minutes:R(r[5]),seconds:R(r[6])}:null}function R(e){if(!e)return 0;const t=/(?:\d+(?:\.|,)\d+|\d+)/,r=e.match(t);if(!r)return 0;const n=r[0].replace(",",".");return Number(n)}function G(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const bt="0000-01-01T00:00:00Z",xt="9999-12-31T23:59:59Z";function fe(e){if(!e||e.isAllTime||e.isEmpty)return;const{start:t,end:r}=e;return t&&r&&t.getTime()===r.getTime()?`${G(t)}`:`${t?G(t):bt}/${r?G(r):xt}`}const ye=new Set([102100,3857,102113,900913]),wt=new Set([3395,54004]);function vt(e,t){let r=e.wkid;return t==null?r:(r!=null&&t.includes(r)||!e.latestWkid||(r=e.latestWkid),r!=null&&ye.has(r)?t.find(n=>ye.has(n))||t.find(n=>wt.has(n))||102100:r)}const X=new je({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function he(e){return e==="text/html"}function ge(e){return e==="text/plain"}let m=class extends et(st(nt(it(tt(rt(Qe(Ye))))))){constructor(...e){super(...e),this.allSublayers=new ze({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.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.version=null,this.addHandles([$(()=>this.sublayers,"after-add",({item:t})=>{t.parent=t.layer=this},F),$(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},F),H(()=>this.sublayers,(t,r)=>{if(r)for(const n of r)n.layer=n.parent=null;if(t)for(const n of t)n.parent=n.layer=this},F)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){const t=e!=null?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch($e).then(()=>this._fetchService(t)).then(()=>this._checkLayerValidity())),Promise.resolve(this)}readFullExtentFromItemOrMap(e,t){const r=t.extent;return r?new L({xmin:r[0][0],ymin:r[0][1],xmax:r[1][0],ymax:r[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(he)??this.featureInfoFormats.find(ge)??null}set featureInfoFormat(e){e==null?(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat")):(he(e)||ge(e))&&this._override("featureInfoFormat",e)}readImageFormat(e,t){const r=t.supportedImageFormatTypes;return r&&r.includes("image/png")?"image/png":r&&r[0]}readSpatialReferenceFromItemOrDocument(e,t){return new N(t.spatialReferences[0])}writeSpatialReferences(e,t){const r=this.spatialReference?.wkid;e&&r?(t.spatialReferences=e.filter(n=>n!==r),t.spatialReferences.unshift(r)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,r){return be(t.layers,r,t.visibleLayers)}readSublayers(e,t,r){return be(t.layers,r)}writeSublayers(e,t,r,n){t.layers=[];const i=new Map,l=e.flatten(({sublayers:s})=>s??[]);for(const s of l)if(typeof s.parent?.id=="number"){const c=i.get(s.parent.id);c!=null?c.push(s.id):i.set(s.parent.id,[s.id])}for(const s of l){const c={sublayer:s,...n},o=s.write({parentLayerId:typeof s.parent?.id=="number"?s.parent.id:-1},c);if(i.has(s.id)&&(o.sublayerIds=i.get(s.id)),!s.sublayers&&s.name){const p=s.write({},c);delete p.id,t.layers.push(p)}}t.visibleLayers=l.filter(({visible:s,sublayers:c})=>s&&!c).map(({name:s})=>s).toArray()}set url(e){if(!e)return void this._set("url",e);const{path:t,query:r}=we(e);for(const i in r)/^(request|service)$/i.test(i)&&delete r[i];const n=ie(t,r??{});this._set("url",n)}createExportImageParameters(e,t,r,n){const i=n?.pixelRatio??1,l=se({extent:e,width:t})*i,s=new ae({layer:this,scale:l}),{xmin:c,ymin:o,xmax:p,ymax:f,spatialReference:d}=e,x=vt(d,this.spatialReferences),v=this.version==="1.3.0"&&J(x)?`${o},${c},${f},${p}`:`${c},${o},${p},${f}`,S=s.toJSON(),I=this.version==="1.3.0"?"crs":"srs";return{bbox:v,[I]:x==null||isNaN(x)?void 0:"EPSG:"+x,...S}}async fetchImage(e,t,r,n){const i=this.mapUrl,l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const o=document.createElement("canvas");return o.width=t,o.height=r,o}const s=fe(n?.timeExtent),c={responseType:"image",query:this._mixCustomParameters({width:t,height:r,...l,time:s,...this.refreshParameters}),signal:n?.signal};return W(i??"",c).then(o=>o.data)}async fetchImageBitmap(e,t,r,n){const i=this.mapUrl??"",l=this.createExportImageParameters(e,t,r,n);if(!l.layers){const p=document.createElement("canvas");return p.width=t,p.height=r,p}const s=fe(n?.timeExtent),c={responseType:"blob",query:this._mixCustomParameters({width:t,height:r,...l,time:s,...this.refreshParameters}),signal:n?.signal},{data:o}=await W(i,c);return ut(o,i,n?.signal)}fetchFeatureInfo(e,t,r,n,i){const l=se({extent:e,width:t}),s=new ae({layer:this,scale:l}),c=ct(s.visibleSublayers);if(this.featureInfoUrl==null||c==null)return Promise.resolve([]);if(this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);const o=this.version==="1.3.0"?{I:n,J:i}:{x:n,y:i},p={query_layers:c,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:t,height:r,...o},f={...this.createExportImageParameters(e,t,r),...p},d=this._mixCustomParameters(f);return this.fetchFeatureInfoFunction!=null?this.fetchFeatureInfoFunction(d):this._defaultFetchFeatureInfoFunction(ie(this.featureInfoUrl,d))}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}findSublayerByName(e){return this.allSublayers.find(t=>t.name===e)}serviceSupportsSpatialReference(e){return at(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(t=>{const r=t===900913?N.WebMercator:new N({wkid:t});return qe(r,e)})}_defaultFetchFeatureInfoFunction(e){const t=document.createElement("iframe");t.src=Be(e),t.style.border="none",t.style.margin="0",t.style.width="100%",t.setAttribute("sandbox","");const r=new Ve({title:this.title,content:t}),n=new We({sourceLayer:this,popupTemplate:r});return Promise.resolve([n])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){const{path:t,query:r}=this.parsedUrl,{data:n}=await W(t,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...r,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=mt(n)}if(this.parsedUrl){const t=new ke(this.parsedUrl.path),{httpsDomains:r}=De.request;t.scheme!=="https"||t.port&&t.port!=="443"||!t.host||r.includes(t.host)||r.push(t.host)}this.read(this.resourceInfo,{origin:"service"})}_checkLayerValidity(){if(!this.allSublayers.length)throw new ve("wmslayer:empty-layer","The layer doesn't have any sublayer")}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const t={...this.customParameters,...this.customLayerParameters};for(const r in t)e[r.toLowerCase()]=t[r];return e}};function St(e,t){return e.some(r=>{for(const n in r)if(Ze(r,n,null,t))return!0;return!1})}function be(e,t,r){e=e??[];const n=new Map;e.every(l=>l.id==null)&&(e=Ge(e)).forEach((l,s)=>l.id=s);for(const l of e){const s=new Z;s.read(l,t),r&&!r.includes(s.name)&&(s.visible=!1),n.set(s.id,s)}const i=[];for(const l of e){const s=l.id!=null?n.get(l.id):null;if(s)if(l.parentLayerId!=null&&l.parentLayerId>=0){const c=n.get(l.parentLayerId);if(!c)continue;c.sublayers||(c.sublayers=new z),c.sublayers.push(s)}else i.push(s)}return i}a([u({readOnly:!0})],m.prototype,"allSublayers",void 0),a([u({json:{type:Object,write:!0}})],m.prototype,"customParameters",void 0),a([u({json:{type:Object,write:!0}})],m.prototype,"customLayerParameters",void 0),a([u({type:String,json:{write:!0}})],m.prototype,"copyright",void 0),a([u()],m.prototype,"description",void 0),a([u({readOnly:!0})],m.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}}}}})],m.prototype,"fullExtent",void 0),a([O(["web-document","portal-item"],"fullExtent",["extent"])],m.prototype,"readFullExtentFromItemOrMap",null),a([k(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],m.prototype,"writeFullExtent",null),a([u()],m.prototype,"fullExtents",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"featureInfoFormat",null),a([u({type:[String],readOnly:!0})],m.prototype,"featureInfoFormats",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"featureInfoUrl",void 0),a([u()],m.prototype,"fetchFeatureInfoFunction",void 0),a([u({type:String,json:{origins:{"web-document":{default:"image/png",type:X.jsonValues,read:{reader:X.read,source:"format"},write:{writer:X.write,target:"format"}}}}})],m.prototype,"imageFormat",void 0),a([O("imageFormat",["supportedImageFormatTypes"])],m.prototype,"readImageFormat",null),a([u({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],m.prototype,"imageMaxHeight",void 0),a([u({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],m.prototype,"imageMaxWidth",void 0),a([u()],m.prototype,"imageTransparency",void 0),a([u(ot)],m.prototype,"legendEnabled",void 0),a([u({type:["show","hide","hide-children"]})],m.prototype,"listMode",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"mapUrl",void 0),a([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],m.prototype,"isReference",void 0),a([u({type:["WMS"]})],m.prototype,"operationalLayerType",void 0),a([u()],m.prototype,"resourceInfo",void 0),a([u({type:N,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],m.prototype,"spatialReference",void 0),a([O(["web-document","portal-item"],"spatialReference",["spatialReferences"])],m.prototype,"readSpatialReferenceFromItemOrDocument",null),a([u({type:[Xe],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],m.prototype,"spatialReferences",void 0),a([k(["web-document","portal-item"],"spatialReferences")],m.prototype,"writeSpatialReferences",null),a([u({type:z.ofType(Z),json:{write:{target:"layers",overridePolicy(e,t,r){if(St(this.allSublayers,r))return{ignoreOrigin:!0}}}}})],m.prototype,"sublayers",void 0),a([O(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],m.prototype,"readSublayersFromItemOrMap",null),a([O("service","sublayers",["layers"])],m.prototype,"readSublayers",null),a([k("sublayers",{layers:{type:[Z]},visibleLayers:{type:[String]}})],m.prototype,"writeSublayers",null),a([u({json:{read:!1},readOnly:!0,value:"wms"})],m.prototype,"type",void 0),a([u(lt)],m.prototype,"url",null),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],m.prototype,"version",void 0),m=a([xe("esri.layers.WMSLayer")],m);const Yt=m;export{Yt as default}; diff --git a/custom-toc-highlight/assets/WMSLayerView2D-Dz-z-fa9-B7OZ7TF_.js b/custom-toc-highlight/assets/WMSLayerView2D-Dz-z-fa9-D5YTL9WO.js similarity index 52% rename from custom-toc-highlight/assets/WMSLayerView2D-Dz-z-fa9-B7OZ7TF_.js rename to custom-toc-highlight/assets/WMSLayerView2D-Dz-z-fa9-D5YTL9WO.js index f7dd7352..9bc130bb 100644 --- a/custom-toc-highlight/assets/WMSLayerView2D-Dz-z-fa9-B7OZ7TF_.js +++ b/custom-toc-highlight/assets/WMSLayerView2D-Dz-z-fa9-D5YTL9WO.js @@ -1 +1 @@ -import{aU as M,a1 as C,ah as R,aA as S,n as U,v as o,S as h,i as F,o as w,$ as V}from"./story-BfX8CRfG.js";import{d as b}from"./BitmapContainer-BC8fvmFc-myTzpniv.js";import{X as q,Y as L}from"./LayerView-Bish-E63-rB2WUWF4.js";import{K as W}from"./ExportStrategy-BNE7Gp0u-j76jQ8Ao.js";import{n as A}from"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";import{r as z}from"./ExportWMSImageParameters-CMk80WSM-sFuOAfxa.js";import{T as B}from"./timeSupport-ohWmWReZ-ByDHlqgT.js";import"./main-ugzBrWNm.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./Tile-D75RMC64-Dj1SOP3K.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";import"./Bitmap-CcqmzvfR-Bqft9oF3.js";const H=e=>{let t=class extends e{initialize(){this.exportImageParameters=new z({layer:this.layer})}destroy(){this.exportImageParameters=S(this.exportImageParameters)}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return B(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,p){const{layer:a}=this;if(!i)throw new w("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:d}=a;if(!d)throw new w("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:d});const r=this.createFetchPopupFeaturesQuery(i);if(!r)return[];const{extent:m,width:s,height:n,x:c,y:l}=r;if(!(m&&s&&n))throw new w("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:m,width:s,height:n});const y=await a.fetchFeatureInfo(m,s,n,c,l);return V(p),y}};return o([h()],t.prototype,"exportImageParameters",void 0),o([h({readOnly:!0})],t.prototype,"exportImageVersion",null),o([h()],t.prototype,"layer",void 0),o([h({readOnly:!0})],t.prototype,"timeExtent",null),t=o([F("esri.views.layers.WMSLayerView")],t),t};let u=class extends H(A(q(L))){constructor(){super(...arguments),this.bitmapContainer=new b}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(t=>{M(t)||C.getLogger(this).error(t)})}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:i}=e;this.bitmapContainer=new b,this.container.addChild(this.bitmapContainer),this.strategy=new W({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:i,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(R(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=S(this.strategy),this.container.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t,bitmapContainer:i}=this,{x:p,y:a}=e,{spatialReference:d}=t;let r,m=0,s=0;if(i.children.some(y=>{const{width:f,height:v,resolution:I,x:g,y:x}=y,P=g+I*f,E=x-I*v;return p>=g&&p<=P&&a<=x&&a>=E&&(r=new U({xmin:g,ymin:E,xmax:P,ymax:x,spatialReference:d}),m=f,s=v,!0)}),!r)return null;const n=r.width/m,c=Math.round((p-r.xmin)/n),l=Math.round((r.ymax-a)/n);return{extent:r,width:m,height:s,x:c,y:l}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,i,p){return this.layer.fetchImageBitmap(e,t,i,{timeExtent:this.timeExtent,...p})}};o([h()],u.prototype,"strategy",void 0),o([h()],u.prototype,"updating",void 0),u=o([F("esri.views.2d.layers.WMSLayerView2D")],u);const de=u;export{de as default}; +import{aU as M,a1 as C,ah as R,aA as S,n as U,v as o,S as h,i as F,o as w,$ as V}from"./story-Doly9N9p.js";import{d as b}from"./BitmapContainer-BC8fvmFc-C6Z_3UuF.js";import{X as q,Y as L}from"./LayerView-Bish-E63-DK1SFHE3.js";import{K as W}from"./ExportStrategy-BNE7Gp0u-CHHOPUHq.js";import{n as A}from"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";import{r as z}from"./ExportWMSImageParameters-CMk80WSM-wEv_P_PY.js";import{T as B}from"./timeSupport-ohWmWReZ-D2lpSlXU.js";import"./main-QGPoLsvl.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./Tile-D75RMC64-g8Sx5TPr.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";import"./Bitmap-CcqmzvfR-C22fE2NY.js";const H=e=>{let t=class extends e{initialize(){this.exportImageParameters=new z({layer:this.layer})}destroy(){this.exportImageParameters=S(this.exportImageParameters)}get exportImageVersion(){return this.exportImageParameters?.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}get timeExtent(){return B(this.layer,this.view?.timeExtent,this._get("timeExtent"))}async fetchPopupFeaturesAtLocation(i,p){const{layer:a}=this;if(!i)throw new w("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a});const{popupEnabled:d}=a;if(!d)throw new w("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:d});const r=this.createFetchPopupFeaturesQuery(i);if(!r)return[];const{extent:m,width:s,height:n,x:c,y:l}=r;if(!(m&&s&&n))throw new w("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:m,width:s,height:n});const y=await a.fetchFeatureInfo(m,s,n,c,l);return V(p),y}};return o([h()],t.prototype,"exportImageParameters",void 0),o([h({readOnly:!0})],t.prototype,"exportImageVersion",null),o([h()],t.prototype,"layer",void 0),o([h({readOnly:!0})],t.prototype,"timeExtent",null),t=o([F("esri.views.layers.WMSLayerView")],t),t};let u=class extends H(A(q(L))){constructor(){super(...arguments),this.bitmapContainer=new b}supportsSpatialReference(e){return this.layer.serviceSupportsSpatialReference(e)}update(e){this.strategy.update(e).catch(t=>{M(t)||C.getLogger(this).error(t)})}attach(){const{layer:e}=this,{imageMaxHeight:t,imageMaxWidth:i}=e;this.bitmapContainer=new b,this.container.addChild(this.bitmapContainer),this.strategy=new W({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:t,imageMaxWidth:i,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.addAttachHandles(R(()=>this.exportImageVersion,()=>this.requestUpdate()))}detach(){this.strategy=S(this.strategy),this.container.removeAllChildren()}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(e){const{view:t,bitmapContainer:i}=this,{x:p,y:a}=e,{spatialReference:d}=t;let r,m=0,s=0;if(i.children.some(y=>{const{width:f,height:v,resolution:I,x:g,y:x}=y,P=g+I*f,E=x-I*v;return p>=g&&p<=P&&a<=x&&a>=E&&(r=new U({xmin:g,ymin:E,xmax:P,ymax:x,spatialReference:d}),m=f,s=v,!0)}),!r)return null;const n=r.width/m,c=Math.round((p-r.xmin)/n),l=Math.round((r.ymax-a)/n);return{extent:r,width:m,height:s,x:c,y:l}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(e,t,i,p){return this.layer.fetchImageBitmap(e,t,i,{timeExtent:this.timeExtent,...p})}};o([h()],u.prototype,"strategy",void 0),o([h()],u.prototype,"updating",void 0),u=o([F("esri.views.2d.layers.WMSLayerView2D")],u);const de=u;export{de as default}; diff --git a/custom-toc-highlight/assets/WMTSLayer-DJY_jjIE-CRE9fTlG.js b/custom-toc-highlight/assets/WMTSLayer-DJY_jjIE-CgOVZJxi.js similarity index 94% rename from custom-toc-highlight/assets/WMTSLayer-DJY_jjIE-CRE9fTlG.js rename to custom-toc-highlight/assets/WMTSLayer-DJY_jjIE-CgOVZJxi.js index 6b4cdbaa..d637fe8d 100644 --- a/custom-toc-highlight/assets/WMTSLayer-DJY_jjIE-CRE9fTlG.js +++ b/custom-toc-highlight/assets/WMTSLayer-DJY_jjIE-CgOVZJxi.js @@ -1 +1 @@ -import{v as o,S as n,n as O,i as W,a0 as R,ag as G,ah as re,av as _,ai as ie,W as se,o as N,N as fe,aq as ce,f as B,P as le,a as K,X as ge,ac as we,e as Q,w as xe,j_ as q,j$ as ve}from"./story-BfX8CRfG.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as Me}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{p as Ie,I as Te}from"./WebTileLayer-CUoicUjK-CNTqPpZi.js";import{u as Le}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as Pe}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as Ce}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as be}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{u as ae}from"./imageBitmapUtils-DA36kg39-CZPhYtU7.js";import{V as Y,d as Re}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import{c as Ae}from"./TileInfoTilemapCache-D1SExPij-BhR83GZf.js";import{n as Z}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{l as oe}from"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var J;let F=J=class extends Q{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?.clone()??null),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo?.clone()??null),e}};o([n({type:O,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([n({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([n({type:Y,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=J=o([W("esri.layers.support.TileMatrixSet")],F);const Oe=F;var X;let L=X=class extends Q{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new X;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([n({json:{read:{source:"id"}}})],L.prototype,"id",void 0),o([n({json:{read:{source:"title"}}})],L.prototype,"title",void 0),o([n({json:{read:{source:"abstract"}}})],L.prototype,"description",void 0),o([n({json:{read:{source:"legendUrl"}}})],L.prototype,"legendUrl",void 0),o([n({json:{read:{source:"isDefault"}}})],L.prototype,"isDefault",void 0),o([n({json:{read:{source:"keywords"}}})],L.prototype,"keywords",void 0),L=X=o([W("esri.layers.support.WMTSStyle")],L);const Fe=L;var H;let w=H=class extends Q{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?O.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map(r=>O.fromJSON(r)):t.tileMatrixSets?.map(r=>O.fromJSON(r.fullExtent)).filter(r=>r)??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=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(){let e=this._get("styleId");return e||(e=this.styles?.at(0)?.id??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?.find(({id:e})=>e===this.tileMatrixSetId)??null}clone(){const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats?.slice()??null),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.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?.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([n()],w.prototype,"description",void 0),o([n()],w.prototype,"fullExtent",void 0),o([R("fullExtent",["fullExtent"])],w.prototype,"readFullExtent",null),o([n({readOnly:!0})],w.prototype,"fullExtents",void 0),o([R("fullExtents",["fullExtents","tileMatrixSets"])],w.prototype,"readFullExtents",null),o([n()],w.prototype,"id",void 0),o([n()],w.prototype,"imageFormat",null),o([n({json:{read:{source:"formats"}}})],w.prototype,"imageFormats",void 0),o([n()],w.prototype,"layer",void 0),o([n()],w.prototype,"parent",void 0),o([n()],w.prototype,"styleId",null),o([n({type:G.ofType(Fe),json:{read:{source:"styles"}}})],w.prototype,"styles",void 0),o([n({json:{write:{ignoreOrigin:!0}}})],w.prototype,"title",void 0),o([n()],w.prototype,"tileMatrixSetId",void 0),o([n({readOnly:!0})],w.prototype,"tileMatrixSet",null),o([n({type:G.ofType(Oe),json:{read:{source:"tileMatrixSets"}}})],w.prototype,"tileMatrixSets",void 0),w=H=o([W("esri.layers.support.WMTSSublayer")],w);const j=w,de=90.71428571428571;function ne(e){const t=e.replaceAll(/ows:/gi,"");if(!f("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 Ve(e,t){e=e.replaceAll(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,a=f("Contents",r);if(!a)throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid");const l=f("OperationsMetadata",r),p=l?.querySelector("[name='GetTile']"),u=p?.getElementsByTagName("Get"),m=u&&Array.prototype.slice.call(u),y=t.url?.indexOf("https"),c=y!==void 0&&y>-1;let g,I,v=t.serviceMode,x=t?.url;m?.length&&m.some(C=>{const T=f("Constraint",C);return!T||V("AllowedValues","Value",v,T)?(x=C.attributes[0].nodeValue,!0):(!T||V("AllowedValues","Value","RESTful",T)||V("AllowedValues","Value","REST",T)?I=C.attributes[0].nodeValue:T&&!V("AllowedValues","Value","KVP",T)||(g=C.attributes[0].nodeValue),!1)}),!x&&(I?(x=I,v="RESTful"):g?(x=g,v="KVP"):x=f("ServiceMetadataURL",r)?.getAttribute("xlink:href"));const E=x.indexOf("1.0.0/");E===-1&&v==="RESTful"?x+="/":E>-1&&(x=x.slice(0,E)),v==="KVP"&&(x+=E>-1?"":"?"),c&&(x=x.replace(/^http:/i,"https:"));const S=h("ServiceIdentification>ServiceTypeVersion",r),M=h("ServiceIdentification>AccessConstraints",r),P=M&&/^none$/i.test(M)?null:M,k=b("Layer",a),D=b("TileMatrixSet",a),$=k.map(C=>{const T=h("Identifier",C);return i.set(T,C),je(T,C,D,c,S)});return{copyright:P,dimensionMap:s,layerMap:i,layers:$,serviceMode:v,tileUrl:x}}function Ue(e){return e.layers.forEach(t=>{t.tileMatrixSets?.forEach(r=>{const i=r.tileInfo;i&&i.dpi!==96&&(i.lods?.forEach(s=>{s.scale=96*s.scale/i.dpi,s.resolution=ye(i.spatialReference?.wkid,s.scale*de/96,r.id)}),i.dpi=96)})}),e}function ee(e){return e.nodeType===Node.ELEMENT_NODE}function f(e,t){for(let r=0;ri.textContent).filter(ce)}function h(e,t){return e.split(">").forEach(r=>{t&&(t=f(r,t))}),t&&t.textContent}function V(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(a=>{if(a.nodeName.includes(e)){const l=f(t,a),p=l?.textContent;if(p===r||r.split(":")&&r.split(":")[1]===p)return s=a,!0}return!1}),s}function je(e,t,r,i,s){const a=h("Abstract",t),l=A("Format",t);return{id:e,fullExtent:ke(t),fullExtents:De(t),description:a,formats:l,styles:$e(t,i),title:h("Title",t),tileMatrixSets:Be(s,t,r)}}function me(e,t){const r=[],i=e.layerMap?.get(t);if(!i)return null;const s=b("ResourceURL",i),a=b("Dimension",i);let l,p,u,m;return a.length&&(l=h("Identifier",a[0]),p=A("Default",a[0])||A("Value",a[0])),a.length>1&&(u=h("Identifier",a[1]),m=A("Default",a[1])||A("Value",a[1])),e.dimensionMap.set(t,{dimensions:p,dimensions2:m}),s.forEach(y=>{let c=y.getAttribute("template");if(y.getAttribute("resourceType")==="tile"){if(l&&p.length)if(c.includes("{"+l+"}"))c=c.replace("{"+l+"}","{dimensionValue}");else{const g=c.toLowerCase().indexOf("{"+l.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue}"+c.slice(g+l.length+2))}if(u&&m.length)if(c.includes("{"+u+"}"))c=c.replace("{"+u+"}","{dimensionValue2}");else{const g=c.toLowerCase().indexOf("{"+u.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue2}"+c.slice(g+u.length+2))}r.push({template:c,format:y.getAttribute("format"),resourceType:"tile"})}}),r}function _e(e,t,r,i,s,a,l,p){const u=Ne(e,t,i);if(!(u?.length>0))return"";const{dimensionMap:m}=e,y=m.get(t).dimensions?.[0],c=m.get(t).dimensions2?.[0];return u[l%u.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,r??"").replaceAll(/\{TileMatrix\}/gi,a).replaceAll(/\{TileRow\}/gi,""+l).replaceAll(/\{TileCol\}/gi,""+p).replaceAll(/\{dimensionValue\}/gi,y).replaceAll(/\{dimensionValue2\}/gi,c)}function Ne(e,t,r){const i=me(e,t),s=i?.filter(a=>a.format===r);return(s?.length?s:i)??[]}function We(e,t,r,i){const{dimensionMap:s}=e,a=me(e,t);let l="";if(a&&a.length>0){const p=s.get(t).dimensions?.[0],u=s.get(t).dimensions2?.[0];l=a[0].template,l.endsWith(".xxx")&&(l=l.slice(0,-4)),l=l.replaceAll(/\{Style\}/gi,i),l=l.replaceAll(/\{TileMatrixSet\}/gi,r),l=l.replaceAll(/\{TileMatrix\}/gi,"{level}"),l=l.replaceAll(/\{TileRow\}/gi,"{row}"),l=l.replaceAll(/\{TileCol\}/gi,"{col}"),l=l.replaceAll(/\{dimensionValue\}/gi,p),l=l.replaceAll(/\{dimensionValue2\}/gi,u)}return l}function ke(e){const t=f("WGS84BoundingBox",e),r=t?h("LowerCorner",t).split(" "):["-180","-90"],i=t?h("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 De(e){const t=[];return oe(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=te(i),a=i.includes("epsg")&&Z(s.wkid);let l,p,u,m;oe(r,{LowerCorner:y=>{[l,p]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([l,p]=[p,l])},UpperCorner:y=>{[u,m]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([u,m]=[m,u])}}),t.push({xmin:l,ymin:p,xmax:u,ymax:m,spatialReference:s})}}),t}function $e(e,t){return b("Style",e).map(r=>{const i=f("LegendURL",r),s=f("Keywords",r),a=s?A("Keyword",s):[];let l=i?.getAttribute("xlink:href");return t&&(l=l?.replace(/^http:/i,"https:")),{abstract:h("Abstract",r),id:h("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:a,legendUrl:l,title:h("Title",r)}})}function Be(e,t,r){return b("TileMatrixSetLink",t).map(i=>Ke(e,i,r))}function Ke(e,t,r){const i=f("TileMatrixSet",t).textContent,s=A("TileMatrix",t),a=r.find(S=>{const M=f("Identifier",S),P=M?.textContent;return!!(P===i||i.split(":")&&i.split(":")[1]===P)}),l=f("TileMatrixSetLimits",t),p=l&&b("TileMatrixLimits",l),u=new Map;if(p?.length)for(const S of p){const M=f("TileMatrix",S).textContent,P=+f("MinTileRow",S).textContent,k=+f("MaxTileRow",S).textContent,D=+f("MinTileCol",S).textContent,$=+f("MaxTileCol",S).textContent;u.set(M,{minCol:D,maxCol:$,minRow:P,maxRow:k})}const m=h("SupportedCRS",a).toLowerCase(),y=qe(a,m),c=y.spatialReference,g=f("TileMatrix",a),I=[parseInt(h("TileWidth",g),10),parseInt(h("TileHeight",g),10)],v=[];s.length?s.forEach((S,M)=>{const P=V("TileMatrix","Identifier",S,a);v.push(pe(P,m,M,i,u))}):b("TileMatrix",a).forEach((S,M)=>{v.push(pe(S,m,M,i,u))});const x=Ge(e,a,y,I,v[0]).toJSON(),E=new Y({dpi:96,spatialReference:c,size:I,origin:y,lods:v}).toJSON();return{id:i,fullExtent:x,tileInfo:E}}function te(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=Xe(e);return r!=null&&(t=r),{wkid:t}}function qe(e,t){return he(f("TileMatrix",e),t)}function he(e,t){const r=te(t),[i,s]=h("TopLeftCorner",e).split(" ").map(l=>parseFloat(l)),a=t.includes("epsg")&&Z(r.wkid);return new xe(a?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function Ge(e,t,r,i,s){const a=f("BoundingBox",t);let l,p,u,m,y,c;if(a&&(l=h("LowerCorner",a).split(" "),p=h("UpperCorner",a).split(" ")),l&&l.length>1&&p&&p.length>1)u=parseFloat(l[0]),y=parseFloat(l[1]),m=parseFloat(p[0]),c=parseFloat(p[1]);else{const g=f("TileMatrix",t),I=parseInt(h("MatrixWidth",g),10),v=parseInt(h("MatrixHeight",g),10);u=r.x,c=r.y,m=u+I*i[0]*s.resolution,y=c-v*i[1]*s.resolution}return Je(e,r.spatialReference,r)?new O(y,u,c,m,r.spatialReference):new O(u,y,m,c,r.spatialReference)}function Je(e,t,r){return e==="1.0.0"&&Z(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var U;function Xe(e){return e.includes("crs84")||e.includes("crs:84")?U.CRS84:e.includes("crs83")||e.includes("crs:83")?U.CRS83:e.includes("crs27")||e.includes("crs:27")?U.CRS27:null}function pe(e,t,r,i,s){const a=te(t),l=h("Identifier",e);let p=parseFloat(h("ScaleDenominator",e));const u=ye(a.wkid,p,i);p*=96/de;const m=+h("MatrixWidth",e),y=+h("MatrixHeight",e),{maxCol:c=m-1,maxRow:g=y-1,minCol:I=0,minRow:v=0}=s.get(l)??{},{x,y:E}=he(e,t);return new Re({cols:[I,c],level:r,levelValue:l,origin:[x,E],scale:p,resolution:u,rows:[v,g]})}function ye(e,t,r){let i;return i=q.hasOwnProperty(""+e)?q.values[q[e]]:r==="default028mm"?6370997*Math.PI/180:ve(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(U||(U={}));var z;const ue={"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=z=class extends Le(Ce(be(Ee(Pe(Se(Me)))))){constructor(...e){super(...e),this.activeLayer=null,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([re(()=>this.activeLayer,(t,r)=>{r&&!this.sublayers?.includes(r)&&(r.layer=null,r.parent=null),t&&(t.layer=this,t.parent=this)},_),ie(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this,t.parent=this},_),ie(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null,t.parent=null},_),re(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null,i.parent=null;if(t)for(const i of t)i.layer=this,i.parent=this},_)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(se).then(()=>this._fetchService(e)).catch(t=>{throw se(t),new N("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new j);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,a=i?.layerIdentifier;let l=null;const p=i?.tileMatrixSet;p&&(Array.isArray(p)?p.length&&(l=p[0]):l=p);const u=s?.format,m=s?.style;return new j({id:a,imageFormat:u,styleId:m,tileMatrixSetId:l})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=fe("tileMatrixSet.tileInfo",s);t.tileInfo=a?a.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(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(ce)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new Ae(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.endsWith("/")?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r?.tileInfo,s=e.fullExtent,a=new Ie({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters),this.customParameters&&(a.customParameters=this.customParameters),new Te({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:a})}async fetchTile(e,t,r,i={}){const{signal:s}=i,a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"image",signal:s});return l}async fetchImageBitmapTile(e,t,r,i={}){const{signal:s}=i;if(this.fetchTile!==z.prototype.fetchTile){const p=await this.fetchTile(e,t,r,i);return ae(p,e,t,r,s)}const a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"blob",signal:s});return ae(l,e,t,r,s)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=i?.tileInfo?.lods[e],a=s?s.levelValue||`${s.level}`:`${e}`;let l=this.resourceInfo?"":_e({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,r);return l||(l=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)),l=this._appendCustomLayerParameters(l),l}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=We({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 ue[r.toLowerCase()]&&(s=ue[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),ne(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ne(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=Ue(t.data):t.data=Ve(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 B(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){return this.findSublayerById(this.activeLayer.id)?.tileMatrixSets?.find(t=>t.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=K(e),i={...r.query,...t},s=ge(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=K(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const r=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(r,"i");t=t.replace(i,""),t+=r;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=K(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 j;return i.read(r,t),i})}o([n()],d.prototype,"dimensionMap",void 0),o([n()],d.prototype,"layerMap",void 0),o([n({type:j,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],d.prototype,"activeLayer",void 0),o([R("service","activeLayer",["layers"])],d.prototype,"readActiveLayerFromService",null),o([R(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],d.prototype,"readActiveLayerFromItemOrWebDoc",null),o([we(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:Y},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],d.prototype,"writeActiveLayer",null),o([n({type:String,value:"",json:{write:!0}})],d.prototype,"copyright",void 0),o([n({type:["show","hide"]})],d.prototype,"listMode",void 0),o([n({json:{read:!0,write:!0}})],d.prototype,"blendMode",void 0),o([n({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([R(["portal-item","web-document"],"customParameters")],d.prototype,"readCustomParameters",null),o([n({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([n({type:O,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],d.prototype,"fullExtent",void 0),o([n({readOnly:!0})],d.prototype,"fullExtents",null),o([n({type:["WebTiledLayer"]})],d.prototype,"operationalLayerType",void 0),o([n()],d.prototype,"resourceInfo",void 0),o([n()],d.prototype,"serviceMode",void 0),o([R(["portal-item","web-document"],"serviceMode",["templateUrl"])],d.prototype,"readServiceMode",null),o([n({type:G.ofType(j)})],d.prototype,"sublayers",void 0),o([R("service","sublayers",["layers"])],d.prototype,"readSublayersFromService",null),o([n({readOnly:!0})],d.prototype,"supportedSpatialReferences",null),o([n({readOnly:!0})],d.prototype,"tilemapCache",null),o([n({json:{read:{source:"title"}}})],d.prototype,"title",null),o([n({json:{read:!1},readOnly:!0,value:"wmts"})],d.prototype,"type",void 0),o([n({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([n()],d.prototype,"version",void 0),d=z=o([W("esri.layers.WMTSLayer")],d);const Et=d;export{Et as default}; +import{v as o,S as n,n as O,i as W,a0 as R,ag as G,ah as re,av as _,ai as ie,W as se,o as N,N as fe,aq as ce,f as B,P as le,a as K,X as ge,ac as we,e as Q,w as xe,j_ as q,j$ as ve}from"./story-Doly9N9p.js";import{m as Se}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as Me}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{p as Ie,I as Te}from"./WebTileLayer-CUoicUjK-DGq3QB_9.js";import{u as Le}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{E as Ee}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as Pe}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as Ce}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as be}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{u as ae}from"./imageBitmapUtils-DA36kg39-BfNbbEDs.js";import{V as Y,d as Re}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import{c as Ae}from"./TileInfoTilemapCache-D1SExPij-BDoYZo_V.js";import{n as Z}from"./crsUtils-BLe27KvG-VS_BXVdj.js";import{l as oe}from"./xmlUtils-TLuV3CJ7-Cs2DGP6C.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var J;let F=J=class extends Q{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?.clone()??null),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo?.clone()??null),e}};o([n({type:O,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([n({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([n({type:Y,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=J=o([W("esri.layers.support.TileMatrixSet")],F);const Oe=F;var X;let L=X=class extends Q{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new X;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([n({json:{read:{source:"id"}}})],L.prototype,"id",void 0),o([n({json:{read:{source:"title"}}})],L.prototype,"title",void 0),o([n({json:{read:{source:"abstract"}}})],L.prototype,"description",void 0),o([n({json:{read:{source:"legendUrl"}}})],L.prototype,"legendUrl",void 0),o([n({json:{read:{source:"isDefault"}}})],L.prototype,"isDefault",void 0),o([n({json:{read:{source:"keywords"}}})],L.prototype,"keywords",void 0),L=X=o([W("esri.layers.support.WMTSStyle")],L);const Fe=L;var H;let w=H=class extends Q{constructor(e){super(e),this.description=null,this.fullExtent=null,this.fullExtents=null,this.id=null,this.imageFormats=null,this.layer=null,this.parent=null,this.styles=null,this.title=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}readFullExtent(e,t){return(e=t.fullExtent)?O.fromJSON(e):null}readFullExtents(e,t){return t.fullExtents?.length?t.fullExtents.map(r=>O.fromJSON(r)):t.tileMatrixSets?.map(r=>O.fromJSON(r.fullExtent)).filter(r=>r)??[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=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(){let e=this._get("styleId");return e||(e=this.styles?.at(0)?.id??""),e}set styleId(e){this._set("styleId",e)}get tileMatrixSet(){return this.tileMatrixSets?.find(({id:e})=>e===this.tileMatrixSetId)??null}clone(){const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats?.slice()??null),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.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?.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=this.tileMatrixSets?.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([n()],w.prototype,"description",void 0),o([n()],w.prototype,"fullExtent",void 0),o([R("fullExtent",["fullExtent"])],w.prototype,"readFullExtent",null),o([n({readOnly:!0})],w.prototype,"fullExtents",void 0),o([R("fullExtents",["fullExtents","tileMatrixSets"])],w.prototype,"readFullExtents",null),o([n()],w.prototype,"id",void 0),o([n()],w.prototype,"imageFormat",null),o([n({json:{read:{source:"formats"}}})],w.prototype,"imageFormats",void 0),o([n()],w.prototype,"layer",void 0),o([n()],w.prototype,"parent",void 0),o([n()],w.prototype,"styleId",null),o([n({type:G.ofType(Fe),json:{read:{source:"styles"}}})],w.prototype,"styles",void 0),o([n({json:{write:{ignoreOrigin:!0}}})],w.prototype,"title",void 0),o([n()],w.prototype,"tileMatrixSetId",void 0),o([n({readOnly:!0})],w.prototype,"tileMatrixSet",null),o([n({type:G.ofType(Oe),json:{read:{source:"tileMatrixSets"}}})],w.prototype,"tileMatrixSets",void 0),w=H=o([W("esri.layers.support.WMTSSublayer")],w);const j=w,de=90.71428571428571;function ne(e){const t=e.replaceAll(/ows:/gi,"");if(!f("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 Ve(e,t){e=e.replaceAll(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,a=f("Contents",r);if(!a)throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid");const l=f("OperationsMetadata",r),p=l?.querySelector("[name='GetTile']"),u=p?.getElementsByTagName("Get"),m=u&&Array.prototype.slice.call(u),y=t.url?.indexOf("https"),c=y!==void 0&&y>-1;let g,I,v=t.serviceMode,x=t?.url;m?.length&&m.some(C=>{const T=f("Constraint",C);return!T||V("AllowedValues","Value",v,T)?(x=C.attributes[0].nodeValue,!0):(!T||V("AllowedValues","Value","RESTful",T)||V("AllowedValues","Value","REST",T)?I=C.attributes[0].nodeValue:T&&!V("AllowedValues","Value","KVP",T)||(g=C.attributes[0].nodeValue),!1)}),!x&&(I?(x=I,v="RESTful"):g?(x=g,v="KVP"):x=f("ServiceMetadataURL",r)?.getAttribute("xlink:href"));const E=x.indexOf("1.0.0/");E===-1&&v==="RESTful"?x+="/":E>-1&&(x=x.slice(0,E)),v==="KVP"&&(x+=E>-1?"":"?"),c&&(x=x.replace(/^http:/i,"https:"));const S=h("ServiceIdentification>ServiceTypeVersion",r),M=h("ServiceIdentification>AccessConstraints",r),P=M&&/^none$/i.test(M)?null:M,k=b("Layer",a),D=b("TileMatrixSet",a),$=k.map(C=>{const T=h("Identifier",C);return i.set(T,C),je(T,C,D,c,S)});return{copyright:P,dimensionMap:s,layerMap:i,layers:$,serviceMode:v,tileUrl:x}}function Ue(e){return e.layers.forEach(t=>{t.tileMatrixSets?.forEach(r=>{const i=r.tileInfo;i&&i.dpi!==96&&(i.lods?.forEach(s=>{s.scale=96*s.scale/i.dpi,s.resolution=ye(i.spatialReference?.wkid,s.scale*de/96,r.id)}),i.dpi=96)})}),e}function ee(e){return e.nodeType===Node.ELEMENT_NODE}function f(e,t){for(let r=0;ri.textContent).filter(ce)}function h(e,t){return e.split(">").forEach(r=>{t&&(t=f(r,t))}),t&&t.textContent}function V(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(a=>{if(a.nodeName.includes(e)){const l=f(t,a),p=l?.textContent;if(p===r||r.split(":")&&r.split(":")[1]===p)return s=a,!0}return!1}),s}function je(e,t,r,i,s){const a=h("Abstract",t),l=A("Format",t);return{id:e,fullExtent:ke(t),fullExtents:De(t),description:a,formats:l,styles:$e(t,i),title:h("Title",t),tileMatrixSets:Be(s,t,r)}}function me(e,t){const r=[],i=e.layerMap?.get(t);if(!i)return null;const s=b("ResourceURL",i),a=b("Dimension",i);let l,p,u,m;return a.length&&(l=h("Identifier",a[0]),p=A("Default",a[0])||A("Value",a[0])),a.length>1&&(u=h("Identifier",a[1]),m=A("Default",a[1])||A("Value",a[1])),e.dimensionMap.set(t,{dimensions:p,dimensions2:m}),s.forEach(y=>{let c=y.getAttribute("template");if(y.getAttribute("resourceType")==="tile"){if(l&&p.length)if(c.includes("{"+l+"}"))c=c.replace("{"+l+"}","{dimensionValue}");else{const g=c.toLowerCase().indexOf("{"+l.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue}"+c.slice(g+l.length+2))}if(u&&m.length)if(c.includes("{"+u+"}"))c=c.replace("{"+u+"}","{dimensionValue2}");else{const g=c.toLowerCase().indexOf("{"+u.toLowerCase()+"}");g>-1&&(c=c.slice(0,g)+"{dimensionValue2}"+c.slice(g+u.length+2))}r.push({template:c,format:y.getAttribute("format"),resourceType:"tile"})}}),r}function _e(e,t,r,i,s,a,l,p){const u=Ne(e,t,i);if(!(u?.length>0))return"";const{dimensionMap:m}=e,y=m.get(t).dimensions?.[0],c=m.get(t).dimensions2?.[0];return u[l%u.length].template.replaceAll(/\{Style\}/gi,s??"").replaceAll(/\{TileMatrixSet\}/gi,r??"").replaceAll(/\{TileMatrix\}/gi,a).replaceAll(/\{TileRow\}/gi,""+l).replaceAll(/\{TileCol\}/gi,""+p).replaceAll(/\{dimensionValue\}/gi,y).replaceAll(/\{dimensionValue2\}/gi,c)}function Ne(e,t,r){const i=me(e,t),s=i?.filter(a=>a.format===r);return(s?.length?s:i)??[]}function We(e,t,r,i){const{dimensionMap:s}=e,a=me(e,t);let l="";if(a&&a.length>0){const p=s.get(t).dimensions?.[0],u=s.get(t).dimensions2?.[0];l=a[0].template,l.endsWith(".xxx")&&(l=l.slice(0,-4)),l=l.replaceAll(/\{Style\}/gi,i),l=l.replaceAll(/\{TileMatrixSet\}/gi,r),l=l.replaceAll(/\{TileMatrix\}/gi,"{level}"),l=l.replaceAll(/\{TileRow\}/gi,"{row}"),l=l.replaceAll(/\{TileCol\}/gi,"{col}"),l=l.replaceAll(/\{dimensionValue\}/gi,p),l=l.replaceAll(/\{dimensionValue2\}/gi,u)}return l}function ke(e){const t=f("WGS84BoundingBox",e),r=t?h("LowerCorner",t).split(" "):["-180","-90"],i=t?h("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 De(e){const t=[];return oe(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=te(i),a=i.includes("epsg")&&Z(s.wkid);let l,p,u,m;oe(r,{LowerCorner:y=>{[l,p]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([l,p]=[p,l])},UpperCorner:y=>{[u,m]=y.textContent.split(" ").map(c=>Number.parseFloat(c)),a&&([u,m]=[m,u])}}),t.push({xmin:l,ymin:p,xmax:u,ymax:m,spatialReference:s})}}),t}function $e(e,t){return b("Style",e).map(r=>{const i=f("LegendURL",r),s=f("Keywords",r),a=s?A("Keyword",s):[];let l=i?.getAttribute("xlink:href");return t&&(l=l?.replace(/^http:/i,"https:")),{abstract:h("Abstract",r),id:h("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:a,legendUrl:l,title:h("Title",r)}})}function Be(e,t,r){return b("TileMatrixSetLink",t).map(i=>Ke(e,i,r))}function Ke(e,t,r){const i=f("TileMatrixSet",t).textContent,s=A("TileMatrix",t),a=r.find(S=>{const M=f("Identifier",S),P=M?.textContent;return!!(P===i||i.split(":")&&i.split(":")[1]===P)}),l=f("TileMatrixSetLimits",t),p=l&&b("TileMatrixLimits",l),u=new Map;if(p?.length)for(const S of p){const M=f("TileMatrix",S).textContent,P=+f("MinTileRow",S).textContent,k=+f("MaxTileRow",S).textContent,D=+f("MinTileCol",S).textContent,$=+f("MaxTileCol",S).textContent;u.set(M,{minCol:D,maxCol:$,minRow:P,maxRow:k})}const m=h("SupportedCRS",a).toLowerCase(),y=qe(a,m),c=y.spatialReference,g=f("TileMatrix",a),I=[parseInt(h("TileWidth",g),10),parseInt(h("TileHeight",g),10)],v=[];s.length?s.forEach((S,M)=>{const P=V("TileMatrix","Identifier",S,a);v.push(pe(P,m,M,i,u))}):b("TileMatrix",a).forEach((S,M)=>{v.push(pe(S,m,M,i,u))});const x=Ge(e,a,y,I,v[0]).toJSON(),E=new Y({dpi:96,spatialReference:c,size:I,origin:y,lods:v}).toJSON();return{id:i,fullExtent:x,tileInfo:E}}function te(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=Xe(e);return r!=null&&(t=r),{wkid:t}}function qe(e,t){return he(f("TileMatrix",e),t)}function he(e,t){const r=te(t),[i,s]=h("TopLeftCorner",e).split(" ").map(l=>parseFloat(l)),a=t.includes("epsg")&&Z(r.wkid);return new xe(a?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function Ge(e,t,r,i,s){const a=f("BoundingBox",t);let l,p,u,m,y,c;if(a&&(l=h("LowerCorner",a).split(" "),p=h("UpperCorner",a).split(" ")),l&&l.length>1&&p&&p.length>1)u=parseFloat(l[0]),y=parseFloat(l[1]),m=parseFloat(p[0]),c=parseFloat(p[1]);else{const g=f("TileMatrix",t),I=parseInt(h("MatrixWidth",g),10),v=parseInt(h("MatrixHeight",g),10);u=r.x,c=r.y,m=u+I*i[0]*s.resolution,y=c-v*i[1]*s.resolution}return Je(e,r.spatialReference,r)?new O(y,u,c,m,r.spatialReference):new O(u,y,m,c,r.spatialReference)}function Je(e,t,r){return e==="1.0.0"&&Z(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var U;function Xe(e){return e.includes("crs84")||e.includes("crs:84")?U.CRS84:e.includes("crs83")||e.includes("crs:83")?U.CRS83:e.includes("crs27")||e.includes("crs:27")?U.CRS27:null}function pe(e,t,r,i,s){const a=te(t),l=h("Identifier",e);let p=parseFloat(h("ScaleDenominator",e));const u=ye(a.wkid,p,i);p*=96/de;const m=+h("MatrixWidth",e),y=+h("MatrixHeight",e),{maxCol:c=m-1,maxRow:g=y-1,minCol:I=0,minRow:v=0}=s.get(l)??{},{x,y:E}=he(e,t);return new Re({cols:[I,c],level:r,levelValue:l,origin:[x,E],scale:p,resolution:u,rows:[v,g]})}function ye(e,t,r){let i;return i=q.hasOwnProperty(""+e)?q.values[q[e]]:r==="default028mm"?6370997*Math.PI/180:ve(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(U||(U={}));var z;const ue={"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=z=class extends Le(Ce(be(Ee(Pe(Se(Me)))))){constructor(...e){super(...e),this.activeLayer=null,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([re(()=>this.activeLayer,(t,r)=>{r&&!this.sublayers?.includes(r)&&(r.layer=null,r.parent=null),t&&(t.layer=this,t.parent=this)},_),ie(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this,t.parent=this},_),ie(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null,t.parent=null},_),re(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null,i.parent=null;if(t)for(const i of t)i.layer=this,i.parent=this},_)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(se).then(()=>this._fetchService(e)).catch(t=>{throw se(t),new N("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new j);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,a=i?.layerIdentifier;let l=null;const p=i?.tileMatrixSet;p&&(Array.isArray(p)?p.length&&(l=p[0]):l=p);const u=s?.format,m=s?.style;return new j({id:a,imageFormat:u,styleId:m,tileMatrixSetId:l})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=fe("tileMatrixSet.tileInfo",s);t.tileInfo=a?a.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(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(ce)??[]}get tilemapCache(){const e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new Ae(e):void 0}get title(){return this.activeLayer?.title??"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.endsWith("/")?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId),i=r?.tileInfo,s=e.fullExtent,a=new Ie({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(a.customLayerParameters=this.customLayerParameters),this.customParameters&&(a.customParameters=this.customParameters),new Te({fullExtent:s,urlTemplate:t,tileInfo:i,wmtsInfo:a})}async fetchTile(e,t,r,i={}){const{signal:s}=i,a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"image",signal:s});return l}async fetchImageBitmapTile(e,t,r,i={}){const{signal:s}=i;if(this.fetchTile!==z.prototype.fetchTile){const p=await this.fetchTile(e,t,r,i);return ae(p,e,t,r,s)}const a=this.getTileUrl(e,t,r),{data:l}=await B(a,{responseType:"blob",signal:s});return ae(l,e,t,r,s)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId),s=i?.tileInfo?.lods[e],a=s?s.levelValue||`${s.level}`:`${e}`;let l=this.resourceInfo?"":_e({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,r);return l||(l=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${r}`)),l=this._appendCustomLayerParameters(l),l}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=We({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 ue[r.toLowerCase()]&&(s=ue[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),ne(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ne(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=Ue(t.data):t.data=Ve(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 B(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){return this.findSublayerById(this.activeLayer.id)?.tileMatrixSets?.find(t=>t.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=K(e),i={...r.query,...t},s=ge(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=K(this.url).path;let t=this.url;switch(e){case"KVP":t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case"RESTful":{const r=`/${this.version}/WMTSCapabilities.xml`,i=new RegExp(r,"i");t=t.replace(i,""),t+=r;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=K(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 j;return i.read(r,t),i})}o([n()],d.prototype,"dimensionMap",void 0),o([n()],d.prototype,"layerMap",void 0),o([n({type:j,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],d.prototype,"activeLayer",void 0),o([R("service","activeLayer",["layers"])],d.prototype,"readActiveLayerFromService",null),o([R(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],d.prototype,"readActiveLayerFromItemOrWebDoc",null),o([we(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:Y},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],d.prototype,"writeActiveLayer",null),o([n({type:String,value:"",json:{write:!0}})],d.prototype,"copyright",void 0),o([n({type:["show","hide"]})],d.prototype,"listMode",void 0),o([n({json:{read:!0,write:!0}})],d.prototype,"blendMode",void 0),o([n({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([R(["portal-item","web-document"],"customParameters")],d.prototype,"readCustomParameters",null),o([n({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([n({type:O,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],d.prototype,"fullExtent",void 0),o([n({readOnly:!0})],d.prototype,"fullExtents",null),o([n({type:["WebTiledLayer"]})],d.prototype,"operationalLayerType",void 0),o([n()],d.prototype,"resourceInfo",void 0),o([n()],d.prototype,"serviceMode",void 0),o([R(["portal-item","web-document"],"serviceMode",["templateUrl"])],d.prototype,"readServiceMode",null),o([n({type:G.ofType(j)})],d.prototype,"sublayers",void 0),o([R("service","sublayers",["layers"])],d.prototype,"readSublayersFromService",null),o([n({readOnly:!0})],d.prototype,"supportedSpatialReferences",null),o([n({readOnly:!0})],d.prototype,"tilemapCache",null),o([n({json:{read:{source:"title"}}})],d.prototype,"title",null),o([n({json:{read:!1},readOnly:!0,value:"wmts"})],d.prototype,"type",void 0),o([n({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([n()],d.prototype,"version",void 0),d=z=o([W("esri.layers.WMTSLayer")],d);const Et=d;export{Et as default}; diff --git a/custom-toc-highlight/assets/WMTSLayerView2D-Bl5FUDUu-DLQ4k-_a.js b/custom-toc-highlight/assets/WMTSLayerView2D-Bl5FUDUu-DwwTnV3d.js similarity index 58% rename from custom-toc-highlight/assets/WMTSLayerView2D-Bl5FUDUu-DLQ4k-_a.js rename to custom-toc-highlight/assets/WMTSLayerView2D-Bl5FUDUu-DwwTnV3d.js index a3636c9b..30a8e4a2 100644 --- a/custom-toc-highlight/assets/WMTSLayerView2D-Bl5FUDUu-DLQ4k-_a.js +++ b/custom-toc-highlight/assets/WMTSLayerView2D-Bl5FUDUu-DwwTnV3d.js @@ -1 +1 @@ -import{aC as l,aU as c,a1 as y,v as u,S as w,i as g}from"./story-BfX8CRfG.js";import{L as I,D as f}from"./imageUtils-Co-ELErj-Dh62T-vs.js";import{X as S,Y as T}from"./LayerView-Bish-E63-rB2WUWF4.js";import{Q as V,$ as v,a as x}from"./Tile-D75RMC64-Dj1SOP3K.js";import{s as d}from"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import{n as Q}from"./RefreshableLayerView-BdQpGYly-Bg8to7IY.js";import{i as M}from"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./main-ugzBrWNm.js";import"./MapView-BGOJJ8ch-DcHA1w96.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Bitmap-CcqmzvfR-Bqft9oF3.js";import"./Container-BcuL1ZEG-DxXVQv25.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./WGLContainer-LxgEo4I_-C81rKEy3.js";import"./LabelMetric-BeluzH3o-C3fDXNzp.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-C1hIaFuM.js";import"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";import"./layerViewUtils-DURAPenP-CfS78eqb.js";const R=[0,0];let r=class extends Q(I(S(T))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const{activeLayer:t}=this.layer,{tileMatrixSet:e}=t;if(e&&l(e.tileInfo?.spatialReference,this.view.spatialReference))return e;const i=this._getTileMatrixSetBySpatialReference(t);return i&&i.id!==t.tileMatrixSetId?(t.tileMatrixSetId=i.id,i):null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume()}attach(){const t=this.tileMatrixSet?.tileInfo;t&&(this._tileInfoView=new V(t),this._fetchQueue=new v({tileInfoView:this._tileInfoView,concurrency:16,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:M.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new x({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.activeLayer.tileMatrixSets?.some(e=>l(e.tileInfo?.spatialReference,t))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const e=this._bitmapView.createTile(t),i=e.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(R,e.key),i.resolution=this._tileInfoView.getTileResolution(e.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this._bitmapView.addChild(e),this.requestUpdate(),e}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,e={}){const i="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:s,resamplingLevel:p=0}=e;if(!i)return this._fetchImage(t,s);const a=new d(0,0,0,0);let h;try{await i.fetchAvailabilityUpsample(t.level,t.row,t.col,a,{signal:s}),h=await this._fetchImage(a,s)}catch(o){if(c(o))throw o;if(p<3){const m=this._tileInfoView.getTileParentId(t.id);if(m){const n=new d(m),_=await this.fetchTile(n,{...e,resamplingLevel:p+1});return f(this._tileInfoView,_,n,t)}}throw o}return f(this._tileInfoView,h,a,t)}canResume(){return super.canResume()&&this.tileMatrixSet!==null}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const e=await this._fetchQueue.push(t.key);t.bitmap.source=e,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(e){c(e)||y.getLogger(this).error(e)}this.requestUpdate()}}async _fetchImage(t,e){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:e})}_getTileMatrixSetBySpatialReference(t){return t.tileMatrixSets?.find(e=>l(e.tileInfo?.spatialReference,this.view.spatialReference))}};u([w({readOnly:!0})],r.prototype,"tileMatrixSet",null),r=u([g("esri.views.2d.layers.WMTSLayerView2D")],r);const te=r;export{te as default}; +import{aC as l,aU as c,a1 as y,v as u,S as w,i as g}from"./story-Doly9N9p.js";import{L as I,D as f}from"./imageUtils-Co-ELErj-D3GFlUnZ.js";import{X as S,Y as T}from"./LayerView-Bish-E63-DK1SFHE3.js";import{Q as V,$ as v,a as x}from"./Tile-D75RMC64-g8Sx5TPr.js";import{s as d}from"./TileKey-C5IL-JBr-BGwa3-Dg.js";import{n as Q}from"./RefreshableLayerView-BdQpGYly-DxrmlBaQ.js";import{i as M}from"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./main-QGPoLsvl.js";import"./MapView-BGOJJ8ch-CJtpe3RS.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import"./signal-CETehA7D-DQA5V72u.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./Bitmap-CcqmzvfR-C22fE2NY.js";import"./Container-BcuL1ZEG-DVZvemLA.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import"./LabelMetric-BeluzH3o-Br-5CSAC.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./Program-DLVwTiPA-DI0GKSfI.js";import"./BufferObject-BM_7mcDb-EYaqMhmk.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";import"./layerViewUtils-DURAPenP-BGA3o1Pf.js";const R=[0,0];let r=class extends Q(I(S(T))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get tileMatrixSet(){const{activeLayer:t}=this.layer,{tileMatrixSet:e}=t;if(e&&l(e.tileInfo?.spatialReference,this.view.spatialReference))return e;const i=this._getTileMatrixSetBySpatialReference(t);return i&&i.id!==t.tileMatrixSetId?(t.tileMatrixSetId=i.id,i):null}update(t){this._fetchQueue.pause(),this._fetchQueue.state=t.state,this._tileStrategy.update(t),this._fetchQueue.resume()}attach(){const t=this.tileMatrixSet?.tileInfo;t&&(this._tileInfoView=new V(t),this._fetchQueue=new v({tileInfoView:this._tileInfoView,concurrency:16,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:M.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new x({cachePolicy:"keep",resampling:!0,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),this.addAttachHandles(this._updatingHandles.add(()=>[this.layer?.activeLayer?.styleId,this.tileMatrixSet],()=>this.doRefresh())),super.attach())}detach(){super.detach(),this._tileStrategy?.destroy(),this._fetchQueue?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(t){return this.layer.activeLayer.tileMatrixSets?.some(e=>l(e.tileInfo?.spatialReference,t))??!1}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(t=>this._updatingHandles.addPromise(this._enqueueTileFetch(t)))}}acquireTile(t){const e=this._bitmapView.createTile(t),i=e.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(R,e.key),i.resolution=this._tileInfoView.getTileResolution(e.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(e)),this._bitmapView.addChild(e),this.requestUpdate(),e}releaseTile(t){this._fetchQueue.abort(t.key.id),this._bitmapView.removeChild(t),t.once("detach",()=>t.destroy()),this.requestUpdate()}async fetchTile(t,e={}){const i="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:s,resamplingLevel:p=0}=e;if(!i)return this._fetchImage(t,s);const a=new d(0,0,0,0);let h;try{await i.fetchAvailabilityUpsample(t.level,t.row,t.col,a,{signal:s}),h=await this._fetchImage(a,s)}catch(o){if(c(o))throw o;if(p<3){const m=this._tileInfoView.getTileParentId(t.id);if(m){const n=new d(m),_=await this.fetchTile(n,{...e,resamplingLevel:p+1});return f(this._tileInfoView,_,n,t)}}throw o}return f(this._tileInfoView,h,a,t)}canResume(){return super.canResume()&&this.tileMatrixSet!==null}async _enqueueTileFetch(t){if(!this._fetchQueue.has(t.key.id)){try{const e=await this._fetchQueue.push(t.key);t.bitmap.source=e,t.bitmap.width=this._tileInfoView.tileInfo.size[0],t.bitmap.height=this._tileInfoView.tileInfo.size[1],t.once("attach",()=>this.requestUpdate())}catch(e){c(e)||y.getLogger(this).error(e)}this.requestUpdate()}}async _fetchImage(t,e){return this.layer.fetchImageBitmapTile(t.level,t.row,t.col,{signal:e})}_getTileMatrixSetBySpatialReference(t){return t.tileMatrixSets?.find(e=>l(e.tileInfo?.spatialReference,this.view.spatialReference))}};u([w({readOnly:!0})],r.prototype,"tileMatrixSet",null),r=u([g("esri.views.2d.layers.WMTSLayerView2D")],r);const te=r;export{te as default}; diff --git a/custom-toc-highlight/assets/WebTileLayer-CUoicUjK-CNTqPpZi.js b/custom-toc-highlight/assets/WebTileLayer-CUoicUjK-DGq3QB_9.js similarity index 85% rename from custom-toc-highlight/assets/WebTileLayer-CUoicUjK-CNTqPpZi.js rename to custom-toc-highlight/assets/WebTileLayer-CUoicUjK-DGq3QB_9.js index 0a6eaf36..473830c5 100644 --- a/custom-toc-highlight/assets/WebTileLayer-CUoicUjK-CNTqPpZi.js +++ b/custom-toc-highlight/assets/WebTileLayer-CUoicUjK-DGq3QB_9.js @@ -1 +1 @@ -import{e as R,P as v,v as l,S as i,i as b,n as S,J as m,w as I,c as h,o as x,eL as M,cA as U,k as L,f as w,c2 as W,a0 as g,ac as D}from"./story-BfX8CRfG.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import{D as $}from"./Layer-ChoECxvZ-CQTFmFQa.js";import{u as O}from"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import{E as A}from"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import{C as z}from"./PortalLayer-CElnYuSQ-DvpreqYV.js";import{T as V}from"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import{u as T}from"./imageBitmapUtils-DA36kg39-CZPhYtU7.js";import{V as j,d as r}from"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./main-ugzBrWNm.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var d;let c=d=class extends R{constructor(e){super(e)}clone(){return new d({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([i({json:{type:Object,write:!0}})],c.prototype,"customLayerParameters",void 0),l([i({json:{type:Object,write:!0}})],c.prototype,"customParameters",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"layerIdentifier",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"tileMatrixSet",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"url",void 0),c=d=l([b("esri.layers.support.WMTSLayerInfo")],c);var f;let o=f=class extends O(V(q(A(z(E($)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new S(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,m.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=m.WebMercator,this.subDomains=null,this.tileInfo=new j({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new I({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:m.WebMercator}),spatialReference:m.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 s="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const a=new h(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&a.authority?.includes("{subDomain}")&&(s="is missing 'subDomains' property")}else s="spatialReference must match tileInfo.spatialReference";else s="is missing the required 'urlTemplate' property value";if(s)throw new x("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${s}`)});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||m.fromJSON(t.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:s}=this,a=new h(t),n=a.scheme?a.scheme+"://":"//",u=n+a.authority+"/",p=a.authority;if(p?.includes("{subDomain}")){if(s&&s.length>0&&p.split(".").length>1)for(const y of s)e.push(n+p.replaceAll(/\{subDomain\}/gi,y)+"/")}else e.push(u);return e.map(M)}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new h(e),s=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.slice(s.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){U(e)&&(e="https:"+e),e&&(e=e.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),e=L(e)),t.templateUrl=e}fetchTile(e,t,s,a={}){const{signal:n}=a,u=this.getTileUrl(e,t,s),p={responseType:"image",signal:n,query:{...this.refreshParameters}};return w(u,p).then(y=>y.data)}async fetchImageBitmapTile(e,t,s,a={}){const{signal:n}=a;if(this.fetchTile!==f.prototype.fetchTile){const P=await this.fetchTile(e,t,s,a);return T(P,e,t,s,n)}const u=this.getTileUrl(e,t,s),p={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:y}=await w(u,p);return T(y,e,t,s,n)}getTileUrl(e,t,s){const{levelValues:a,tileServers:n,urlPath:u}=this;if(!a||!n||!u)return"";const p=a[e];return n[t%n.length]+W(u,{level:p,z:p,col:s,x:s,row:t,y:t})}};l([i({type:String,value:"",json:{write:!0}})],o.prototype,"copyright",void 0),l([i({type:S,json:{write:!0},nonNullable:!0})],o.prototype,"fullExtent",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),l([i({type:["show","hide"]})],o.prototype,"listMode",void 0),l([i({json:{read:!0,write:!0}})],o.prototype,"blendMode",void 0),l([i()],o.prototype,"levelValues",null),l([i({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],o.prototype,"isReference",void 0),l([i({type:["WebTiledLayer"],value:"WebTiledLayer"})],o.prototype,"operationalLayerType",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"popupEnabled",void 0),l([i({type:m})],o.prototype,"spatialReference",void 0),l([g("spatialReference",["spatialReference","fullExtent.spatialReference"])],o.prototype,"readSpatialReference",null),l([i({type:[String],json:{write:!0}})],o.prototype,"subDomains",void 0),l([i({type:j,json:{write:!0}})],o.prototype,"tileInfo",void 0),l([i({readOnly:!0})],o.prototype,"tileServers",null),l([i({json:{read:!1}})],o.prototype,"type",void 0),l([i()],o.prototype,"urlPath",null),l([i({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],o.prototype,"urlTemplate",void 0),l([g("urlTemplate",["urlTemplate","templateUrl"])],o.prototype,"readUrlTemplate",null),l([D("urlTemplate",{templateUrl:{type:String}})],o.prototype,"writeUrlTemplate",null),l([i({type:c,json:{write:!0}})],o.prototype,"wmtsInfo",void 0),o=f=l([b("esri.layers.WebTileLayer")],o);const _=o,me=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"}));export{_ as I,me as W,c as p}; +import{e as R,P as v,v as l,S as i,i as b,n as S,J as m,w as I,c as h,o as x,eL as M,cA as U,k as L,f as w,c2 as W,a0 as g,ac as D}from"./story-Doly9N9p.js";import{m as E}from"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import{D as $}from"./Layer-ChoECxvZ-BmDHBjO8.js";import{u as O}from"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import{E as A}from"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import{C as z}from"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import{T as V}from"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import{S as q}from"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import{u as T}from"./imageBitmapUtils-DA36kg39-BfNbbEDs.js";import{V as j,d as r}from"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./main-QGPoLsvl.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";var d;let c=d=class extends R{constructor(e){super(e)}clone(){return new d({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([i({json:{type:Object,write:!0}})],c.prototype,"customLayerParameters",void 0),l([i({json:{type:Object,write:!0}})],c.prototype,"customParameters",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"layerIdentifier",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"tileMatrixSet",void 0),l([i({type:String,json:{write:!0}})],c.prototype,"url",void 0),c=d=l([b("esri.layers.support.WMTSLayerInfo")],c);var f;let o=f=class extends O(V(q(A(z(E($)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new S(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,m.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=m.WebMercator,this.subDomains=null,this.tileInfo=new j({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new I({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:m.WebMercator}),spatialReference:m.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 s="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const a=new h(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&a.authority?.includes("{subDomain}")&&(s="is missing 'subDomains' property")}else s="spatialReference must match tileInfo.spatialReference";else s="is missing the required 'urlTemplate' property value";if(s)throw new x("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${s}`)});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||m.fromJSON(t.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:s}=this,a=new h(t),n=a.scheme?a.scheme+"://":"//",u=n+a.authority+"/",p=a.authority;if(p?.includes("{subDomain}")){if(s&&s.length>0&&p.split(".").length>1)for(const y of s)e.push(n+p.replaceAll(/\{subDomain\}/gi,y)+"/")}else e.push(u);return e.map(M)}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new h(e),s=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.slice(s.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){U(e)&&(e="https:"+e),e&&(e=e.replaceAll(/\{z\}/gi,"{level}").replaceAll(/\{x\}/gi,"{col}").replaceAll(/\{y\}/gi,"{row}"),e=L(e)),t.templateUrl=e}fetchTile(e,t,s,a={}){const{signal:n}=a,u=this.getTileUrl(e,t,s),p={responseType:"image",signal:n,query:{...this.refreshParameters}};return w(u,p).then(y=>y.data)}async fetchImageBitmapTile(e,t,s,a={}){const{signal:n}=a;if(this.fetchTile!==f.prototype.fetchTile){const P=await this.fetchTile(e,t,s,a);return T(P,e,t,s,n)}const u=this.getTileUrl(e,t,s),p={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:y}=await w(u,p);return T(y,e,t,s,n)}getTileUrl(e,t,s){const{levelValues:a,tileServers:n,urlPath:u}=this;if(!a||!n||!u)return"";const p=a[e];return n[t%n.length]+W(u,{level:p,z:p,col:s,x:s,row:t,y:t})}};l([i({type:String,value:"",json:{write:!0}})],o.prototype,"copyright",void 0),l([i({type:S,json:{write:!0},nonNullable:!0})],o.prototype,"fullExtent",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"legendEnabled",void 0),l([i({type:["show","hide"]})],o.prototype,"listMode",void 0),l([i({json:{read:!0,write:!0}})],o.prototype,"blendMode",void 0),l([i()],o.prototype,"levelValues",null),l([i({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],o.prototype,"isReference",void 0),l([i({type:["WebTiledLayer"],value:"WebTiledLayer"})],o.prototype,"operationalLayerType",void 0),l([i({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"popupEnabled",void 0),l([i({type:m})],o.prototype,"spatialReference",void 0),l([g("spatialReference",["spatialReference","fullExtent.spatialReference"])],o.prototype,"readSpatialReference",null),l([i({type:[String],json:{write:!0}})],o.prototype,"subDomains",void 0),l([i({type:j,json:{write:!0}})],o.prototype,"tileInfo",void 0),l([i({readOnly:!0})],o.prototype,"tileServers",null),l([i({json:{read:!1}})],o.prototype,"type",void 0),l([i()],o.prototype,"urlPath",null),l([i({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],o.prototype,"urlTemplate",void 0),l([g("urlTemplate",["urlTemplate","templateUrl"])],o.prototype,"readUrlTemplate",null),l([D("urlTemplate",{templateUrl:{type:String}})],o.prototype,"writeUrlTemplate",null),l([i({type:c,json:{write:!0}})],o.prototype,"wmtsInfo",void 0),o=f=l([b("esri.layers.WebTileLayer")],o);const _=o,me=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"}));export{_ as I,me as W,c as p}; diff --git a/custom-toc-highlight/assets/WhereClause-DxwoyBMS-DnXKVpm2.js b/custom-toc-highlight/assets/WhereClause-DxwoyBMS-Cwdb_WC4.js similarity index 99% rename from custom-toc-highlight/assets/WhereClause-DxwoyBMS-DnXKVpm2.js rename to custom-toc-highlight/assets/WhereClause-DxwoyBMS-Cwdb_WC4.js index 836010b5..044f0b1b 100644 --- a/custom-toc-highlight/assets/WhereClause-DxwoyBMS-DnXKVpm2.js +++ b/custom-toc-highlight/assets/WhereClause-DxwoyBMS-Cwdb_WC4.js @@ -1,4 +1,4 @@ -import{O as j,m as $,r as qo}from"./TimeOnly-DSMefxKy-BU7RNYWc.js";import{c2 as jo,F as J,K as ur,b_ as Yo,c5 as Bo,c6 as Qo,q as Go}from"./story-BfX8CRfG.js";import{t as He,r as qe,a as pe}from"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./main-ugzBrWNm.js";var d;(function(a){a.InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters"})(d||(d={}));const Wo={[d.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[d.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[d.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[d.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[d.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[d.UnsupportedOperator]:"Unsupported operator - {operator}",[d.UnsupportedSyntax]:"Unsupported syntax - {node}",[d.UnsupportedSqlFunction]:"Sql function not found = {function}",[d.InvalidDataType]:"Invalid sql data type",[d.InvalidDate]:"Invalid date encountered",[d.InvalidOperator]:"Invalid operator encountered",[d.InvalidTime]:"Invalid time encountered",[d.IllegalInterval]:"Illegal interval",[d.FunctionNotRecognized]:"Function not recognized",[d.InvalidTimeStamp]:"Invalid timestamp encountered",[d.InvalidParameterCount]:"Invalid parameter count for call to {name}",[d.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[d.YearMonthIntervals]:"Year-Month Intervals not supported",[d.CannotCastValue]:"Cannot cast value to the required data type"};let m=class pr extends Error{constructor(i,u){super(jo(Wo[i],u)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,pr)}};function or(a){return Number.isNaN(a)||a===0?a:Math.trunc(a)}let Q=class oe{constructor(i){this._timeStampOffset=i,this._date=null}toDateTime(){return this._date??=J.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return or(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return or(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return oe.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(i){return new oe(J.fromJSDate(i).toISO({includeOffset:!0}))}static fromDateTime(i){return new oe(i.toISO({includeOffset:!0}))}static fromParts(i,u,t=0,l=0,v=0,g=0,T=0,S=!1,O=0,x=0){const D=`${i.toString().padStart(4,"0")}-${u.toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`;let F="";g<10&&(F="0");let X=`${l.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}:${F+g.toString()}`;T!==0&&(X+="."+T.toString().padStart(3,"0"));const ee=`${S?"-":"+"}${O.toString().padStart(2,"0")}:${x.toString().padStart(2,"0")}`;return new oe(D+"T"+X+ee)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let i=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return i&&(i=i.replace(".000","")),i}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(i){const u=this.toDateTime().plus(i);return oe.fromDateTime(u)}};function Ko(a,i){const u=mr[a.toLowerCase()];if(u==null)throw new m(d.FunctionNotRecognized);if(i.lengthu.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return u.evaluate(i)}function lr(a,i){const u=mr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}const mr={min:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"min")},max:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"max")},avg:{minParams:1,maxParams:1,evaluate:a=>vr(a[0])},sum:{minParams:1,maxParams:1,evaluate:a=>Xo(a[0])},stddev:{minParams:1,maxParams:1,evaluate:a=>el(a[0])},count:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].length},var:{minParams:1,maxParams:1,evaluate:a=>hr(a[0])}};function vr(a){if(a===null)return null;let i=0,u=0;for(let t=0;t=v)&&(u=l,t=v)}return u}function Xo(a){if(a===null)return null;let i=0;for(let u=0;ut!==null)).length===0)return null;const i=vr(a);if(i===null)return null;let u=0;for(const t of a){if(!et(t))throw new m(d.InvalidValueForAggregateFunction);u+=(i-t)**2}return u/(a.length-1)}class E{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(i){if(i.precision!==null||i.secondary!==null)throw new m(d.PrimarySecondaryQualifiers)}static _parseSecondsComponent(i,u){if(u.includes(".")){const t=u.split(".");i.second=parseFloat(t[0]),i.millis=parseInt(t[1],10)}else i.second=parseFloat(u)}static createFromMilliseconds(i){const u=new E;return u.second=i/1e3,u}static createFromValueAndQualifier(i,u,t){let l=null;const v=new E;if(v.op=t==="-"?"-":"+",u.type==="interval-period"){E._fixDefaults(u);const g=new RegExp("^[0-9]{1,}$");if(u.period==="year"||u.period==="month")throw new m(d.YearMonthIntervals);if(u.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(i))throw new m(d.IllegalInterval);E._parseSecondsComponent(v,i)}else{if(!g.test(i))throw new m(d.IllegalInterval);v[u.period]=parseFloat(i)}}else{if(E._fixDefaults(u.start),E._fixDefaults(u.end),u.start.period==="year"||u.start.period==="month"||u.end.period==="year"||u.end.period==="month")throw new m(d.YearMonthIntervals);switch(u.start.period){case"day":switch(u.end.period){case"hour":if(l=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v[u.start.period]=parseFloat(i.split(" ")[0]),v[u.end.period]=parseFloat(i.split(" ")[1]);break;case"minute":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1])}break;case"second":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"hour":switch(u.end.period){case"minute":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v.hour=parseFloat(i.split(":")[0]),v.minute=parseFloat(i.split(":")[1]);break;case"second":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"minute":if(u.end.period!=="second")throw new m(d.IllegalInterval);if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.minute=parseFloat(g[0]),E._parseSecondsComponent(v,g[1])}break;default:throw new m(d.IllegalInterval)}}return v}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+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)}}const tl=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,rl=/^(\d{1,2}):(\d{1,2})$/,nl=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,wr=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,il=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,al=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,sl=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,ul=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function Pe(a,i){if(i instanceof Bo)return i===He.instance?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i});switch(i){case"system":case"local":case null:return J.fromJSDate(a);default:return i?.toLowerCase()==="unknown"?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i})}}function V(a){return typeof a=="number"}function Z(a){return typeof a=="string"||a instanceof String}function K(a){return a instanceof E}function q(a){return a instanceof Date}function b(a){return a instanceof J}function A(a){return a instanceof j}function L(a){return a instanceof $}function P(a){return a instanceof Q}function tt(a){let i=tl.exec(a);if(i!==null){const[,u,t,l]=i,v=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),0);if(v!==null)return v;throw new m(d.InvalidTime)}if(i=rl.exec(a),i!==null){const[,u,t]=i,l=$.fromParts(parseInt(u,10),parseInt(t,10),0,0);if(l!==null)return l;throw new m(d.InvalidTime)}if(i=nl.exec(a),i!==null){const[,u,t,l,v]=i,g=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g!==null)return g;throw new m(d.InvalidTime)}throw new m(d.InvalidTime)}function De(a,i,u=!1){let t=il.exec(a);if(t!==null){const[,l,v,g,T,S,O,x]=t,D=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:parseInt(O,10),millisecond:x?parseInt(x.replace(".",""),10):0},{zone:qe(i)});if(D.isValid===!1)throw new m(d.InvalidTimeStamp);return D}if(t=al.exec(a),t!==null){const[,l,v,g,T,S,O,x,D,F,X]=t,ee=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),parseInt(O,10),x?parseInt(x.replace(".",""),10):0,D==="-",parseInt(F,10),parseInt(X,10));if(ee.isValid===!1)throw new m(d.InvalidTimeStamp);return ee}if(t=sl.exec(a),t!==null){const[,l,v,g,T,S,O,x,D]=t,F=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),0,0,O==="-",parseInt(x,10),parseInt(D,10));if(F.isValid===!1)throw new m(d.InvalidTimeStamp);return F}if(t=ul.exec(a),t!==null){const[,l,v,g,T,S]=t,O=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:0},{zone:qe(i)});if(O.isValid===!1)throw new m(d.InvalidTimeStamp);return O}if(t=wr.exec(a),t!==null){const[,l,v,g]=t,T=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:0,minute:0,second:0},{zone:qe(i)});if(T.isValid===!1)throw new m(d.InvalidTimeStamp);return T}throw new m(d.InvalidTimeStamp)}function Ir(a,i){const u=wr.exec(a);if(u===null)try{return De(a,i)}catch{throw new m(d.InvalidDate)}const[,t,l,v]=u,g=j.fromParts(parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g===null)throw new m(d.InvalidDate);return g}const ol=321408e5,ll=26784e5,cl=864e5,fl=36e5,dl=6e4;function je(a){return!!b(a)||!!P(a)}function Ge(a){return!!b(a)||!!A(a)||!!P(a)||!!L(a)}function Fe(a){if(b(a))return a.toMillis();if(A(a))return a.toNumber();if(P(a))return a.toMilliseconds();throw new m(d.InvalidDataType)}function z(a,i,u,t){if(a==null||i==null)return null;if(V(a)){if(V(i))return B(a,i,u);if(Z(i))return pl(a,i,u);if(Ge(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator)}else if(Z(a)){if(V(i))return ml(a,i,u);if(Z(i))return vl(a,i,u);if(b(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(L(i))throw new m(d.InvalidOperator);if(P(i))throw new m(d.InvalidOperator)}else if(b(a)){if(je(i)){if(a instanceof J&&pe(a.zone)){if(i instanceof J&&pe(i.zone)===!1||i instanceof Q)return Ye(a,i,u)}else if(i instanceof J&&pe(i.zone)&&(a instanceof J&&pe(a.zone)===!1||a instanceof Q))return Ye(a,i,u);return B(Fe(a),Fe(i),u)}if(Z(i))throw new m(d.InvalidOperator);if(A(i))return hl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(A(a)){if(P(i))return gl(a,i,u);if(b(i))return Il(a,i,u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return B(a.toNumber(),i.toNumber(),u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(L(a)){if(L(i))return B(a.toNumber(),i.toNumber(),u);if(Z(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(je(i))throw new m(d.InvalidOperator)}else if(P(a)){if(je(i))return i instanceof J&&pe(i.zone)?Ye(a,i,u):B(Fe(a),Fe(i),u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return wl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function B(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function pl(a,i,u){const t=parseFloat(i);if(!isNaN(t))return B(a,t,u);const l=a.toString();switch(u){case"<>":return l!==i;case"=":return l===i;case">":return l>i;case"<":return l=":return l>=i;case"<=":return l<=i}}function ml(a,i,u){const t=parseFloat(a);if(!isNaN(t))return B(t,i,u);const l=i.toString();switch(u){case"<>":return a!==l;case"=":return a===l;case">":return a>l;case"<":return a=":return a>=l;case"<=":return a<=l}}function vl(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function hl(a,i,u){const t=i.toDateTimeLuxon(a.zone);return B((a=a.startOf("day")).toMillis(),t.toMillis(),u)}function wl(a,i,u){const t=i.toDateTimeLuxon(a.toDateTime().zone);return B((a=a.startOfDay()).toMilliseconds(),t.toMillis(),u)}function Il(a,i,u){const t=a.toDateTimeLuxon(i.zone);return i=i.startOf("day"),B(t.toMillis(),i.toMillis(),u)}function gl(a,i,u){const t=a.toDateTimeLuxon(i.toDateTime().zone);return i=i.startOfDay(),B(t.toMillis(),i.toMilliseconds(),u)}function Ye(a,i,u){a instanceof Q&&(a=a.toDateTime()),i instanceof Q&&(i=i.toDateTime());const t=fr(a),l=fr(i);switch(u){case"<>":return t!==l;case"=":return t===l;case">":return t>l;case"<":return t=":return t>=l;case"<=":return t<=l}}function fr(a){return a.year*ol+a.month*ll+a.day*cl+a.hour*fl+a.minute*dl+1e3*a.second+a.millisecond}function rt(a,i,u){const t=yr[a.toLowerCase()];if(t==null)throw new m(d.FunctionNotRecognized);if(i.lengtht.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return t.evaluate(i,u)}function yl(a,i){const u=yr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}function Le(a){return typeof a=="string"||a instanceof String}function Be(a){return!q(a)&&!A(a)&&!b(a)&&!L(a)&&!P(a)}function gr(a){return A(a)||L(a)?a.toString():P(a)?a.toSQLValue():b(a)?a.millisecond===0?a.toFormat("yyyy-LL-dd HH:mm:ss"):a.toSQL({includeOffset:!1}):q(a)?gr(J.fromJSDate(a)):a.toString()}function Tl(a){if(q(a))return j.fromDateJS(a);if(b(a))return j.fromParts(a.year,a.month,a.day);if(A(a))return a;if(L(a))throw new m(d.CannotCastValue);if(P(a)&&j.fromParts(a.year,a.month,a.day)===null)throw new m(d.CannotCastValue);if(Le(a)){const i=j.fromReader(a);if(i!==null&&i.isValid)return i}throw new m(d.CannotCastValue)}function Nl(a,i,u){if(q(a))return Pe(a,i);if(b(a))return a;if(A(a))return a.toDateTimeLuxon("unknown");if(L(a))throw new m(d.CannotCastValue);if(P(a))return a;if(Le(a))return De(a,"unknown",u);throw new m(d.CannotCastValue)}function Ol(a){if(q(a))return $.fromDateJS(a);if(b(a))return $.fromDateTime(a);if(A(a))throw new m(d.CannotCastValue);if(L(a))return a;if(P(a))return $.fromSqlTimeStampOffset(a);if(Le(a))return tt(a);throw new m(d.CannotCastValue)}const yr={extract:{minParams:2,maxParams:2,evaluate:([a,i])=>{if(i==null)return null;if(q(i))switch(a.toUpperCase()){case"SECOND":return i.getSeconds();case"MINUTE":return i.getMinutes();case"HOUR":return i.getHours();case"DAY":return i.getDate();case"MONTH":return i.getMonth()+1;case"YEAR":return i.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(b(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(A(i))switch(a.toUpperCase()){case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(L(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour}else if(P(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":return i.timezoneOffsetHour;case"TIMEZONE_MINUTE":return i.timezoneOffsetMinutes}throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:a=>{if(a.length===2){const[i,u]=a;return i==null||u==null?null:i.toString().substring(u-1)}if(a.length===3){const[i,u,t]=a;return i==null||u==null||t==null?null:t<=0?"":i.toString().substring(u-1,u+t-1)}}},position:{minParams:2,maxParams:2,evaluate:([a,i])=>a==null||i==null?null:i.indexOf(a)+1},trim:{minParams:2,maxParams:3,evaluate:a=>{const i=a.length===3,u=i?a[1]:" ",t=i?a[2]:a[1];if(u==null||t==null)return null;const l=`(${Qo(u)})`;switch(a[0]){case"BOTH":return t.replaceAll(new RegExp(`^${l}*|${l}*$`,"g"),"");case"LEADING":return t.replaceAll(new RegExp(`^${l}*`,"g"),"");case"TRAILING":return t.replaceAll(new RegExp(`${l}*$`,"g"),"")}throw new m(d.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.abs(a[0])},ceiling:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.ceil(a[0])},floor:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.floor(a[0])},log:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])},log10:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sin(a[0])},cos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cos(a[0])},tan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tan(a[0])},asin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.asin(a[0])},acos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.acos(a[0])},atan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.atan(a[0])},sign:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0]>0?1:a[0]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]**a[1]},mod:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]%a[1]},round:{minParams:1,maxParams:2,evaluate:a=>{const i=a[0],u=a.length===2?10**a[1]:1;return i==null?null:Math.round(i*u)/u}},truncate:{minParams:1,maxParams:2,evaluate:a=>a[0]==null?null:a.length===1||a[1]===0?Math.trunc(a[0]):Go("trunc",a[0],-Number(a[1]))},char_length:{minParams:1,maxParams:1,evaluate:a=>Le(a[0])?a[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:a=>{let i="";for(let u=0;ua[0]==null?null:a[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:a=>{for(const i of a)if(i!==null)return i;return null}},cosh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cosh(a[0])},sinh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sinh(a[0])},tanh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tanh(a[0])},nullif:{minParams:2,maxParams:2,evaluate:(a,i)=>z(a[0],a[1],"=")?null:a[0]},cast:{minParams:2,maxParams:2,evaluate:(a,i)=>{const u=a[0],t=a[1];if(u===null)return null;switch(t.type){case"integer":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"smallint":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);if(l>32767||l<-32767)throw new m(d.CannotCastValue);return l}case"float":case"real":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseFloat(u);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"time":return Ol(u);case"date":return Tl(u);case"timestamp":return Nl(u,i,t.withtimezone===!0);case"varchar":{const l=gr(u);if(l.length>t.size)throw new m(d.CannotCastValue);return l}default:throw new m(d.InvalidDataType)}}}};function Tr(a,i,u,t){if(a==="||")return rt("concat",[i,u],t);if(i===null||u===null)return null;if(V(i)){if(V(u))return nt(i,u,a);if(K(u))return Al(i,u,a);if(L(u))return kl();if(A(u))return zl();if(P(u))return Zl();if(b(u))return Jl();if(Z(u))return $l(i,u,a);throw new m(d.InvalidOperator)}if(A(i)){if(V(u))return Rl(i,u,a);if(K(u))return Pl(i,u,a);if(L(u))return Wl();if(A(u))return Gl(i,u,a);if(P(u))return Ql(i,u,a);if(b(u))return Bl(i,u,a);if(Z(u))return cc();throw new m(d.InvalidOperator)}if(L(i)){if(V(u))return Ul(i,u,a);if(K(u))return Ml(i,u,a);if(L(u))return ac();if(A(u))return nc();if(P(u))return ic();if(b(u))return rc();if(Z(u))return fc();throw new m(d.InvalidOperator)}if(K(i)){if(V(u))return bl(i,u,a);if(K(u))return Fl(i,u,a);if(L(u))return xl(i,u,a);if(A(u))return Cl(i,u,a);if(P(u))return El(i,u,a);if(b(u))return Sl(i,u,a);if(Z(u))return jl();throw new m(d.InvalidOperator)}if(b(i)){if(V(u))return _l(i,u,a);if(K(u))return Dl(i,u,a);if(L(u))return lc();if(A(u))return uc(i,u,a);if(P(u))return oc(i,u,a);if(b(u))return sc(i,u,a);if(Z(u))return dc();throw new m(d.InvalidOperator)}if(P(i)){if(V(u))return Vl(i,u,a);if(K(u))return Ll(i,u,a);if(L(u))return Kl();if(A(u))return Xl(i,u,a);if(P(u))return tc(i,u,a);if(b(u))return ec(i,u,a);if(Z(u))return pc();throw new m(d.InvalidOperator)}if(Z(i)){if(V(u))return Hl(i,u,a);if(K(u))return Yl();if(L(u))return mc();if(A(u))return vc();if(P(u))return wc();if(b(u))return hc();if(Z(u))return ql(i,u,a);throw new m(d.InvalidOperator)}throw new m(d.InvalidOperator)}function nt(a,i,u){switch(u){case"+":return a+i;case"-":return a-i;case"*":return a*i;case"/":return a/i}throw new m(d.InvalidOperator)}function Sl(a,i,u){switch(u){case"+":return i.plus({milliseconds:a.valueInMilliseconds()});case"-":return a.valueInMilliseconds()-i.toMillis()}throw new m(d.InvalidOperator)}function xl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Cl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Ml(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function El(a,i,u){if(u==="+")return i.addMilliseconds(a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Fl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function bl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i);case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i);case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i);case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i)}throw new m(d.InvalidOperator)}function Al(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Pl(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Dl(a,i,u){switch(u){case"+":return a.plus({milliseconds:i.valueInMilliseconds()});case"-":return a.minus({milliseconds:i.valueInMilliseconds()})}throw new m(d.InvalidOperator)}function Ll(a,i,u){switch(u){case"+":return a.addMilliseconds(i.valueInMilliseconds());case"-":return a.addMilliseconds(-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function _l(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus({milliseconds:t});case"-":return a.minus({milliseconds:t})}throw new m(d.InvalidOperator)}function Rl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Ul(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Jl(a,i,u){throw new m(d.InvalidOperator)}function Vl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.addMilliseconds(t);case"-":return a.addMilliseconds(-1*t)}throw new m(d.InvalidOperator)}function Zl(a,i,u){throw new m(d.InvalidOperator)}function kl(a,i,u){throw new m(d.InvalidOperator)}function zl(a,i,u){throw new m(d.InvalidOperator)}function $l(a,i,u){const t=parseFloat(i);if(isNaN(t))throw new m(d.InvalidOperator);return nt(a,t,u)}function Hl(a,i,u){const t=parseFloat(a);if(isNaN(t))throw new m(d.InvalidOperator);return nt(t,i,u)}function ql(a,i,u){if(u==="+")return a+i;throw new m(d.InvalidOperator)}function jl(a,i,u){throw new m(d.InvalidOperator)}function Yl(a,i,u){throw new m(d.InvalidOperator)}function Bl(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.zone).diff(i).as("days");throw new m(d.InvalidOperator)}function Ql(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.toDateTime().zone).diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function Gl(a,i,u){if(u==="-")return a.toDateTimeLuxon("UTC").diff(i.toDateTimeLuxon("UTC")).as("days");throw new m(d.InvalidOperator)}function Wl(a,i,u){throw new m(d.InvalidOperator)}function Kl(a,i,u){throw new m(d.InvalidOperator)}function Xl(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTimeLuxon(a.toDateTime().zone)).as("days");throw new m(d.InvalidOperator)}function ec(a,i,u){if(u==="-")return a.toDateTime().diff(i).as("days");throw new m(d.InvalidOperator)}function tc(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function rc(a,i,u){throw new m(d.InvalidOperator)}function nc(a,i,u){throw new m(d.InvalidOperator)}function ic(a,i,u){throw new m(d.InvalidOperator)}function ac(a,i,u){throw new m(d.InvalidOperator)}function sc(a,i,u){if(u==="-")return a.diff(i).as("days");throw new m(d.InvalidOperator)}function uc(a,i,u){if(u==="-")return a.diff(i.toDateTimeLuxon(a.zone)).as("days");throw new m(d.InvalidOperator)}function oc(a,i,u){if(u==="-")return a.diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function lc(a,i,u){throw new m(d.InvalidOperator)}function cc(a,i,u){throw new m(d.InvalidOperator)}function fc(a,i,u){throw new m(d.InvalidOperator)}function dc(a,i,u){throw new m(d.InvalidOperator)}function pc(a,i,u){throw new m(d.InvalidOperator)}function mc(a,i,u){throw new m(d.InvalidOperator)}function vc(a,i,u){throw new m(d.InvalidOperator)}function hc(a,i,u){throw new m(d.InvalidOperator)}function wc(a,i,u){throw new m(d.InvalidOperator)}function Ic(a,i){function u(){this.constructor=a}u.prototype=i.prototype,a.prototype=new u}function se(a,i,u,t){var l=Error.call(this,a);return Object.setPrototypeOf&&Object.setPrototypeOf(l,se.prototype),l.expected=i,l.found=u,l.location=t,l.name="SyntaxError",l}function Qe(a,i,u){return u=u||" ",a.length>i?a:(i-=a.length,a+(u+=u.repeat(i)).slice(0,i))}function gc(a,i){var u,t={},l=(i=i!==void 0?i:{}).grammarSource,v={start:St},g=St,T="!",S="=",O=">=",x=">",D="<=",F="<>",X="!=",ee="||",Cr="@",at="'",st="N'",me="''",Mr=".",Er="null",Fr="true",br="false",Ar="in",Pr="is",Dr="like",Lr="escape",_r="not",Rr="and",Ur="or",Jr="between",Vr="from",Zr="for",kr="substring",zr="extract",$r="trim",Hr="position",qr="timestamp",jr="date",Yr="time",Br="leading",Qr="trailing",Gr="both",Wr="cast",Kr="as",Xr="integer",en="int",tn="smallint",rn="float",nn="real",an="varchar",sn="to",un="interval",on="year",ln="timezone_hour",cn="timezone_minute",fn="month",dn="day",pn="hour",mn="minute",vn="second",hn="case",wn="end",In="when",gn="then",yn="else",Tn=",",Nn="(",On=")",ut="`",Sn=/^[<-=]/,ve=/^[+\-]/,xn=/^[*\/]/,Cn=/^[A-Za-z_\x80-\uFFFF]/,Mn=/^[A-Za-z0-9_]/,ot=/^[A-Za-z0-9_.\x80-\uFFFF]/,En=/^["]/,lt=/^[^']/,Fn=/^[0-9]/,bn=/^[eE]/,An=/^[ \t\n\r]/,ct=/^[^`]/,Pn=y("!",!1),Dn=y("=",!1),Ln=y(">=",!1),_n=y(">",!1),Rn=y("<=",!1),Un=y("<>",!1),Jn=H([["<","="]],!1,!1),Vn=y("!=",!1),he=H(["+","-"],!1,!1),Zn=y("||",!1),kn=H(["*","/"],!1,!1),zn=H([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),$n=H([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ft=H([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),Hn=H(['"'],!1,!1),qn=y("@",!1),dt=y("'",!1),jn=y("N'",!1),pt=y("''",!1),mt=H(["'"],!0,!1),Yn=y(".",!1),Bn=H([["0","9"]],!1,!1),Qn=H(["e","E"],!1,!1),Gn=y("NULL",!0),Wn=y("TRUE",!0),Kn=y("FALSE",!0),Xn=y("IN",!0),ei=y("IS",!0),ti=y("LIKE",!0),ri=y("ESCAPE",!0),ni=y("NOT",!0),ii=y("AND",!0),ai=y("OR",!0),si=y("BETWEEN",!0),ui=y("FROM",!0),oi=y("FOR",!0),li=y("SUBSTRING",!0),ci=y("EXTRACT",!0),fi=y("TRIM",!0),di=y("POSITION",!0),pi=y("TIMESTAMP",!0),mi=y("DATE",!0),vi=y("TIME",!0),hi=y("LEADING",!0),wi=y("TRAILING",!0),Ii=y("BOTH",!0),gi=y("CAST",!0),yi=y("AS",!0),Ti=y("INTEGER",!0),Ni=y("INT",!0),Oi=y("SMALLINT",!0),Si=y("FLOAT",!0),xi=y("REAL",!0),Ci=y("VARCHAR",!0),Mi=y("TO",!0),Ei=y("INTERVAL",!0),Fi=y("YEAR",!0),bi=y("TIMEZONE_HOUR",!0),Ai=y("TIMEZONE_MINUTE",!0),Pi=y("MONTH",!0),Di=y("DAY",!0),Li=y("HOUR",!0),_i=y("MINUTE",!0),Ri=y("SECOND",!0),Ui=y("CASE",!0),Ji=y("END",!0),Vi=y("WHEN",!0),Zi=y("THEN",!0),ki=y("ELSE",!0),zi=y(",",!1),$i=y("(",!1),Hi=y(")",!1),qi=H([" "," ",` +import{O as j,m as $,r as qo}from"./TimeOnly-DSMefxKy-BHvJbNji.js";import{c2 as jo,F as J,K as ur,b_ as Yo,c5 as Bo,c6 as Qo,q as Go}from"./story-Doly9N9p.js";import{t as He,r as qe,a as pe}from"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./main-QGPoLsvl.js";var d;(function(a){a.InvalidFunctionParameters="InvalidFunctionParameters",a.InvalidValueForAggregateFunction="InvalidValueForAggregateFunction",a.UnsupportedSqlFunction="UnsupportedSqlFunction",a.UnsupportedOperator="UnsupportedOperator",a.UnsupportedSyntax="UnsupportedSyntax",a.UnsupportedIsRhs="UnsupportedIsRhs",a.UnsupportedIsLhs="UnsupportedIsLhs",a.InvalidDataType="InvalidDataType",a.CannotCastValue="CannotCastValue",a.FunctionNotRecognized="FunctionNotRecognized",a.InvalidTime="InvalidTime",a.InvalidParameterCount="InvalidParameterCount",a.InvalidTimeStamp="InvalidTimeStamp",a.InvalidDate="InvalidDate",a.InvalidOperator="InvalidOperator",a.IllegalInterval="IllegalInterval",a.YearMonthIntervals="YearMonthIntervals",a.PrimarySecondaryQualifiers="PrimarySecondaryQualifiers",a.MissingStatisticParameters="MissingStatisticParameters"})(d||(d={}));const Wo={[d.InvalidValueForAggregateFunction]:"Invalid value used in aggregate function",[d.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[d.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[d.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[d.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[d.UnsupportedOperator]:"Unsupported operator - {operator}",[d.UnsupportedSyntax]:"Unsupported syntax - {node}",[d.UnsupportedSqlFunction]:"Sql function not found = {function}",[d.InvalidDataType]:"Invalid sql data type",[d.InvalidDate]:"Invalid date encountered",[d.InvalidOperator]:"Invalid operator encountered",[d.InvalidTime]:"Invalid time encountered",[d.IllegalInterval]:"Illegal interval",[d.FunctionNotRecognized]:"Function not recognized",[d.InvalidTimeStamp]:"Invalid timestamp encountered",[d.InvalidParameterCount]:"Invalid parameter count for call to {name}",[d.PrimarySecondaryQualifiers]:"Primary and Secondary SqlInterval qualifiers not supported",[d.YearMonthIntervals]:"Year-Month Intervals not supported",[d.CannotCastValue]:"Cannot cast value to the required data type"};let m=class pr extends Error{constructor(i,u){super(jo(Wo[i],u)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,pr)}};function or(a){return Number.isNaN(a)||a===0?a:Math.trunc(a)}let Q=class oe{constructor(i){this._timeStampOffset=i,this._date=null}toDateTime(){return this._date??=J.fromISO(this._timeStampOffset,{setZone:!0}),this._date}get isValid(){return this.toDateTime().isValid}get timezoneOffsetHour(){return or(this.toDateTime().offset/60)}get timezoneOffsetMinutes(){return or(this.toDateTime().offset%60)}toMilliseconds(){return this.toDateTime().toMillis()}get hour(){return this.toDateTime().hour}get minute(){return this.toDateTime().minute}get second(){return this.toDateTime().second}get day(){return this.toDateTime().day}get month(){return this.toDateTime().month}get year(){return this.toDateTime().year}startOfDay(){return oe.fromDateTime(this.toDateTime().startOf("day"))}static fromJSDate(i){return new oe(J.fromJSDate(i).toISO({includeOffset:!0}))}static fromDateTime(i){return new oe(i.toISO({includeOffset:!0}))}static fromParts(i,u,t=0,l=0,v=0,g=0,T=0,S=!1,O=0,x=0){const D=`${i.toString().padStart(4,"0")}-${u.toString().padStart(2,"0")}-${t.toString().padStart(2,"0")}`;let F="";g<10&&(F="0");let X=`${l.toString().padStart(2,"0")}:${v.toString().padStart(2,"0")}:${F+g.toString()}`;T!==0&&(X+="."+T.toString().padStart(3,"0"));const ee=`${S?"-":"+"}${O.toString().padStart(2,"0")}:${x.toString().padStart(2,"0")}`;return new oe(D+"T"+X+ee)}toStorageFormat(){return this._timeStampOffset}toString(){return this._timeStampOffset}toSQLValue(){let i=this.toDateTime().toSQL({includeOffset:!0,includeOffsetSpace:!0});return i&&(i=i.replace(".000","")),i}toSQLWithKeyword(){return`timestamp '${this.toSQLValue()}'`}addMilliseconds(i){const u=this.toDateTime().plus(i);return oe.fromDateTime(u)}};function Ko(a,i){const u=mr[a.toLowerCase()];if(u==null)throw new m(d.FunctionNotRecognized);if(i.lengthu.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return u.evaluate(i)}function lr(a,i){const u=mr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}const mr={min:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"min")},max:{minParams:1,maxParams:1,evaluate:a=>cr(a[0],"max")},avg:{minParams:1,maxParams:1,evaluate:a=>vr(a[0])},sum:{minParams:1,maxParams:1,evaluate:a=>Xo(a[0])},stddev:{minParams:1,maxParams:1,evaluate:a=>el(a[0])},count:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].length},var:{minParams:1,maxParams:1,evaluate:a=>hr(a[0])}};function vr(a){if(a===null)return null;let i=0,u=0;for(let t=0;t=v)&&(u=l,t=v)}return u}function Xo(a){if(a===null)return null;let i=0;for(let u=0;ut!==null)).length===0)return null;const i=vr(a);if(i===null)return null;let u=0;for(const t of a){if(!et(t))throw new m(d.InvalidValueForAggregateFunction);u+=(i-t)**2}return u/(a.length-1)}class E{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0,this.millis=0}static _fixDefaults(i){if(i.precision!==null||i.secondary!==null)throw new m(d.PrimarySecondaryQualifiers)}static _parseSecondsComponent(i,u){if(u.includes(".")){const t=u.split(".");i.second=parseFloat(t[0]),i.millis=parseInt(t[1],10)}else i.second=parseFloat(u)}static createFromMilliseconds(i){const u=new E;return u.second=i/1e3,u}static createFromValueAndQualifier(i,u,t){let l=null;const v=new E;if(v.op=t==="-"?"-":"+",u.type==="interval-period"){E._fixDefaults(u);const g=new RegExp("^[0-9]{1,}$");if(u.period==="year"||u.period==="month")throw new m(d.YearMonthIntervals);if(u.period==="second"){if(!/^[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$/.test(i))throw new m(d.IllegalInterval);E._parseSecondsComponent(v,i)}else{if(!g.test(i))throw new m(d.IllegalInterval);v[u.period]=parseFloat(i)}}else{if(E._fixDefaults(u.start),E._fixDefaults(u.end),u.start.period==="year"||u.start.period==="month"||u.end.period==="year"||u.end.period==="month")throw new m(d.YearMonthIntervals);switch(u.start.period){case"day":switch(u.end.period){case"hour":if(l=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v[u.start.period]=parseFloat(i.split(" ")[0]),v[u.end.period]=parseFloat(i.split(" ")[1]);break;case"minute":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1])}break;case"second":if(l=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{v[u.start.period]=parseFloat(i.split(" ")[0]);const g=i.split(" ")[1].split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"hour":switch(u.end.period){case"minute":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!l.test(i))throw new m(d.IllegalInterval);v.hour=parseFloat(i.split(":")[0]),v.minute=parseFloat(i.split(":")[1]);break;case"second":if(l=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.hour=parseFloat(g[0]),v.minute=parseFloat(g[1]),E._parseSecondsComponent(v,g[2])}break;default:throw new m(d.IllegalInterval)}break;case"minute":if(u.end.period!=="second")throw new m(d.IllegalInterval);if(l=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!l.test(i))throw new m(d.IllegalInterval);{const g=i.split(":");v.minute=parseFloat(g[0]),E._parseSecondsComponent(v,g[1])}break;default:throw new m(d.IllegalInterval)}}return v}valueInMilliseconds(){return(this.op==="-"?-1:1)*(this.millis+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)}}const tl=/^(\d{1,2}):(\d{1,2}):(\d{1,2})$/,rl=/^(\d{1,2}):(\d{1,2})$/,nl=/^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/,wr=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,il=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$/,al=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,sl=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|-)(\d{1,2}):(\d{1,2})$/,ul=/^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;function Pe(a,i){if(i instanceof Bo)return i===He.instance?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i});switch(i){case"system":case"local":case null:return J.fromJSDate(a);default:return i?.toLowerCase()==="unknown"?J.fromMillis(a.getTime(),{zone:He.instance}):J.fromJSDate(a,{zone:i})}}function V(a){return typeof a=="number"}function Z(a){return typeof a=="string"||a instanceof String}function K(a){return a instanceof E}function q(a){return a instanceof Date}function b(a){return a instanceof J}function A(a){return a instanceof j}function L(a){return a instanceof $}function P(a){return a instanceof Q}function tt(a){let i=tl.exec(a);if(i!==null){const[,u,t,l]=i,v=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),0);if(v!==null)return v;throw new m(d.InvalidTime)}if(i=rl.exec(a),i!==null){const[,u,t]=i,l=$.fromParts(parseInt(u,10),parseInt(t,10),0,0);if(l!==null)return l;throw new m(d.InvalidTime)}if(i=nl.exec(a),i!==null){const[,u,t,l,v]=i,g=$.fromParts(parseInt(u,10),parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g!==null)return g;throw new m(d.InvalidTime)}throw new m(d.InvalidTime)}function De(a,i,u=!1){let t=il.exec(a);if(t!==null){const[,l,v,g,T,S,O,x]=t,D=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:parseInt(O,10),millisecond:x?parseInt(x.replace(".",""),10):0},{zone:qe(i)});if(D.isValid===!1)throw new m(d.InvalidTimeStamp);return D}if(t=al.exec(a),t!==null){const[,l,v,g,T,S,O,x,D,F,X]=t,ee=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),parseInt(O,10),x?parseInt(x.replace(".",""),10):0,D==="-",parseInt(F,10),parseInt(X,10));if(ee.isValid===!1)throw new m(d.InvalidTimeStamp);return ee}if(t=sl.exec(a),t!==null){const[,l,v,g,T,S,O,x,D]=t,F=Q.fromParts(parseInt(l,10),parseInt(v,10),parseInt(g,10),parseInt(T,10),parseInt(S,10),0,0,O==="-",parseInt(x,10),parseInt(D,10));if(F.isValid===!1)throw new m(d.InvalidTimeStamp);return F}if(t=ul.exec(a),t!==null){const[,l,v,g,T,S]=t,O=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:parseInt(T,10),minute:parseInt(S,10),second:0},{zone:qe(i)});if(O.isValid===!1)throw new m(d.InvalidTimeStamp);return O}if(t=wr.exec(a),t!==null){const[,l,v,g]=t,T=J.fromObject({year:parseInt(l,10),month:parseInt(v,10),day:parseInt(g,10),hour:0,minute:0,second:0},{zone:qe(i)});if(T.isValid===!1)throw new m(d.InvalidTimeStamp);return T}throw new m(d.InvalidTimeStamp)}function Ir(a,i){const u=wr.exec(a);if(u===null)try{return De(a,i)}catch{throw new m(d.InvalidDate)}const[,t,l,v]=u,g=j.fromParts(parseInt(t,10),parseInt(l,10),parseInt(v,10));if(g===null)throw new m(d.InvalidDate);return g}const ol=321408e5,ll=26784e5,cl=864e5,fl=36e5,dl=6e4;function je(a){return!!b(a)||!!P(a)}function Ge(a){return!!b(a)||!!A(a)||!!P(a)||!!L(a)}function Fe(a){if(b(a))return a.toMillis();if(A(a))return a.toNumber();if(P(a))return a.toMilliseconds();throw new m(d.InvalidDataType)}function z(a,i,u,t){if(a==null||i==null)return null;if(V(a)){if(V(i))return B(a,i,u);if(Z(i))return pl(a,i,u);if(Ge(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator)}else if(Z(a)){if(V(i))return ml(a,i,u);if(Z(i))return vl(a,i,u);if(b(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(L(i))throw new m(d.InvalidOperator);if(P(i))throw new m(d.InvalidOperator)}else if(b(a)){if(je(i)){if(a instanceof J&&pe(a.zone)){if(i instanceof J&&pe(i.zone)===!1||i instanceof Q)return Ye(a,i,u)}else if(i instanceof J&&pe(i.zone)&&(a instanceof J&&pe(a.zone)===!1||a instanceof Q))return Ye(a,i,u);return B(Fe(a),Fe(i),u)}if(Z(i))throw new m(d.InvalidOperator);if(A(i))return hl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(A(a)){if(P(i))return gl(a,i,u);if(b(i))return Il(a,i,u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return B(a.toNumber(),i.toNumber(),u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}else if(L(a)){if(L(i))return B(a.toNumber(),i.toNumber(),u);if(Z(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator);if(A(i))throw new m(d.InvalidOperator);if(je(i))throw new m(d.InvalidOperator)}else if(P(a)){if(je(i))return i instanceof J&&pe(i.zone)?Ye(a,i,u):B(Fe(a),Fe(i),u);if(Z(i))throw new m(d.InvalidOperator);if(A(i))return wl(a,i,u);if(L(i))throw new m(d.InvalidOperator);if(V(i))throw new m(d.InvalidOperator)}switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function B(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function pl(a,i,u){const t=parseFloat(i);if(!isNaN(t))return B(a,t,u);const l=a.toString();switch(u){case"<>":return l!==i;case"=":return l===i;case">":return l>i;case"<":return l=":return l>=i;case"<=":return l<=i}}function ml(a,i,u){const t=parseFloat(a);if(!isNaN(t))return B(t,i,u);const l=i.toString();switch(u){case"<>":return a!==l;case"=":return a===l;case">":return a>l;case"<":return a=":return a>=l;case"<=":return a<=l}}function vl(a,i,u){switch(u){case"<>":return a!==i;case"=":return a===i;case">":return a>i;case"<":return a=":return a>=i;case"<=":return a<=i}}function hl(a,i,u){const t=i.toDateTimeLuxon(a.zone);return B((a=a.startOf("day")).toMillis(),t.toMillis(),u)}function wl(a,i,u){const t=i.toDateTimeLuxon(a.toDateTime().zone);return B((a=a.startOfDay()).toMilliseconds(),t.toMillis(),u)}function Il(a,i,u){const t=a.toDateTimeLuxon(i.zone);return i=i.startOf("day"),B(t.toMillis(),i.toMillis(),u)}function gl(a,i,u){const t=a.toDateTimeLuxon(i.toDateTime().zone);return i=i.startOfDay(),B(t.toMillis(),i.toMilliseconds(),u)}function Ye(a,i,u){a instanceof Q&&(a=a.toDateTime()),i instanceof Q&&(i=i.toDateTime());const t=fr(a),l=fr(i);switch(u){case"<>":return t!==l;case"=":return t===l;case">":return t>l;case"<":return t=":return t>=l;case"<=":return t<=l}}function fr(a){return a.year*ol+a.month*ll+a.day*cl+a.hour*fl+a.minute*dl+1e3*a.second+a.millisecond}function rt(a,i,u){const t=yr[a.toLowerCase()];if(t==null)throw new m(d.FunctionNotRecognized);if(i.lengtht.maxParams)throw new m(d.InvalidParameterCount,{name:a.toUpperCase()});return t.evaluate(i,u)}function yl(a,i){const u=yr[a.toLowerCase()];return u!=null&&i>=u.minParams&&i<=u.maxParams}function Le(a){return typeof a=="string"||a instanceof String}function Be(a){return!q(a)&&!A(a)&&!b(a)&&!L(a)&&!P(a)}function gr(a){return A(a)||L(a)?a.toString():P(a)?a.toSQLValue():b(a)?a.millisecond===0?a.toFormat("yyyy-LL-dd HH:mm:ss"):a.toSQL({includeOffset:!1}):q(a)?gr(J.fromJSDate(a)):a.toString()}function Tl(a){if(q(a))return j.fromDateJS(a);if(b(a))return j.fromParts(a.year,a.month,a.day);if(A(a))return a;if(L(a))throw new m(d.CannotCastValue);if(P(a)&&j.fromParts(a.year,a.month,a.day)===null)throw new m(d.CannotCastValue);if(Le(a)){const i=j.fromReader(a);if(i!==null&&i.isValid)return i}throw new m(d.CannotCastValue)}function Nl(a,i,u){if(q(a))return Pe(a,i);if(b(a))return a;if(A(a))return a.toDateTimeLuxon("unknown");if(L(a))throw new m(d.CannotCastValue);if(P(a))return a;if(Le(a))return De(a,"unknown",u);throw new m(d.CannotCastValue)}function Ol(a){if(q(a))return $.fromDateJS(a);if(b(a))return $.fromDateTime(a);if(A(a))throw new m(d.CannotCastValue);if(L(a))return a;if(P(a))return $.fromSqlTimeStampOffset(a);if(Le(a))return tt(a);throw new m(d.CannotCastValue)}const yr={extract:{minParams:2,maxParams:2,evaluate:([a,i])=>{if(i==null)return null;if(q(i))switch(a.toUpperCase()){case"SECOND":return i.getSeconds();case"MINUTE":return i.getMinutes();case"HOUR":return i.getHours();case"DAY":return i.getDate();case"MONTH":return i.getMonth()+1;case"YEAR":return i.getFullYear();case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":return 0}else if(b(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(A(i))switch(a.toUpperCase()){case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":case"TIMEZONE_MINUTE":throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}else if(L(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour}else if(P(i))switch(a.toUpperCase()){case"SECOND":return i.second;case"MINUTE":return i.minute;case"HOUR":return i.hour;case"DAY":return i.day;case"MONTH":return i.month;case"YEAR":return i.year;case"TIMEZONE_HOUR":return i.timezoneOffsetHour;case"TIMEZONE_MINUTE":return i.timezoneOffsetMinutes}throw new m(d.InvalidFunctionParameters,{function:"EXTRACT"})}},substring:{minParams:2,maxParams:3,evaluate:a=>{if(a.length===2){const[i,u]=a;return i==null||u==null?null:i.toString().substring(u-1)}if(a.length===3){const[i,u,t]=a;return i==null||u==null||t==null?null:t<=0?"":i.toString().substring(u-1,u+t-1)}}},position:{minParams:2,maxParams:2,evaluate:([a,i])=>a==null||i==null?null:i.indexOf(a)+1},trim:{minParams:2,maxParams:3,evaluate:a=>{const i=a.length===3,u=i?a[1]:" ",t=i?a[2]:a[1];if(u==null||t==null)return null;const l=`(${Qo(u)})`;switch(a[0]){case"BOTH":return t.replaceAll(new RegExp(`^${l}*|${l}*$`,"g"),"");case"LEADING":return t.replaceAll(new RegExp(`^${l}*`,"g"),"");case"TRAILING":return t.replaceAll(new RegExp(`${l}*$`,"g"),"")}throw new m(d.InvalidFunctionParameters,{function:"TRIM"})}},abs:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.abs(a[0])},ceiling:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.ceil(a[0])},floor:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.floor(a[0])},log:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])},log10:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.log(a[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sin(a[0])},cos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cos(a[0])},tan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tan(a[0])},asin:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.asin(a[0])},acos:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.acos(a[0])},atan:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.atan(a[0])},sign:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0]>0?1:a[0]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]**a[1]},mod:{minParams:2,maxParams:2,evaluate:a=>a[0]==null||a[1]==null?null:a[0]%a[1]},round:{minParams:1,maxParams:2,evaluate:a=>{const i=a[0],u=a.length===2?10**a[1]:1;return i==null?null:Math.round(i*u)/u}},truncate:{minParams:1,maxParams:2,evaluate:a=>a[0]==null?null:a.length===1||a[1]===0?Math.trunc(a[0]):Go("trunc",a[0],-Number(a[1]))},char_length:{minParams:1,maxParams:1,evaluate:a=>Le(a[0])?a[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:a=>{let i="";for(let u=0;ua[0]==null?null:a[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:a[0].toString().toUpperCase()},coalesce:{minParams:1,maxParams:1/0,evaluate:a=>{for(const i of a)if(i!==null)return i;return null}},cosh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.cosh(a[0])},sinh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.sinh(a[0])},tanh:{minParams:1,maxParams:1,evaluate:a=>a[0]==null?null:Math.tanh(a[0])},nullif:{minParams:2,maxParams:2,evaluate:(a,i)=>z(a[0],a[1],"=")?null:a[0]},cast:{minParams:2,maxParams:2,evaluate:(a,i)=>{const u=a[0],t=a[1];if(u===null)return null;switch(t.type){case"integer":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"smallint":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseInt(u,10);if(isNaN(l))throw new m(d.CannotCastValue);if(l>32767||l<-32767)throw new m(d.CannotCastValue);return l}case"float":case"real":{if(!Be(u))throw new m(d.CannotCastValue);const l=parseFloat(u);if(isNaN(l))throw new m(d.CannotCastValue);return l}case"time":return Ol(u);case"date":return Tl(u);case"timestamp":return Nl(u,i,t.withtimezone===!0);case"varchar":{const l=gr(u);if(l.length>t.size)throw new m(d.CannotCastValue);return l}default:throw new m(d.InvalidDataType)}}}};function Tr(a,i,u,t){if(a==="||")return rt("concat",[i,u],t);if(i===null||u===null)return null;if(V(i)){if(V(u))return nt(i,u,a);if(K(u))return Al(i,u,a);if(L(u))return kl();if(A(u))return zl();if(P(u))return Zl();if(b(u))return Jl();if(Z(u))return $l(i,u,a);throw new m(d.InvalidOperator)}if(A(i)){if(V(u))return Rl(i,u,a);if(K(u))return Pl(i,u,a);if(L(u))return Wl();if(A(u))return Gl(i,u,a);if(P(u))return Ql(i,u,a);if(b(u))return Bl(i,u,a);if(Z(u))return cc();throw new m(d.InvalidOperator)}if(L(i)){if(V(u))return Ul(i,u,a);if(K(u))return Ml(i,u,a);if(L(u))return ac();if(A(u))return nc();if(P(u))return ic();if(b(u))return rc();if(Z(u))return fc();throw new m(d.InvalidOperator)}if(K(i)){if(V(u))return bl(i,u,a);if(K(u))return Fl(i,u,a);if(L(u))return xl(i,u,a);if(A(u))return Cl(i,u,a);if(P(u))return El(i,u,a);if(b(u))return Sl(i,u,a);if(Z(u))return jl();throw new m(d.InvalidOperator)}if(b(i)){if(V(u))return _l(i,u,a);if(K(u))return Dl(i,u,a);if(L(u))return lc();if(A(u))return uc(i,u,a);if(P(u))return oc(i,u,a);if(b(u))return sc(i,u,a);if(Z(u))return dc();throw new m(d.InvalidOperator)}if(P(i)){if(V(u))return Vl(i,u,a);if(K(u))return Ll(i,u,a);if(L(u))return Kl();if(A(u))return Xl(i,u,a);if(P(u))return tc(i,u,a);if(b(u))return ec(i,u,a);if(Z(u))return pc();throw new m(d.InvalidOperator)}if(Z(i)){if(V(u))return Hl(i,u,a);if(K(u))return Yl();if(L(u))return mc();if(A(u))return vc();if(P(u))return wc();if(b(u))return hc();if(Z(u))return ql(i,u,a);throw new m(d.InvalidOperator)}throw new m(d.InvalidOperator)}function nt(a,i,u){switch(u){case"+":return a+i;case"-":return a-i;case"*":return a*i;case"/":return a/i}throw new m(d.InvalidOperator)}function Sl(a,i,u){switch(u){case"+":return i.plus({milliseconds:a.valueInMilliseconds()});case"-":return a.valueInMilliseconds()-i.toMillis()}throw new m(d.InvalidOperator)}function xl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Cl(a,i,u){if(u==="+")return i.plus("milliseconds",a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Ml(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function El(a,i,u){if(u==="+")return i.addMilliseconds(a.valueInMilliseconds());throw new m(d.InvalidOperator)}function Fl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function bl(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a.valueInMilliseconds()+i);case"-":return E.createFromMilliseconds(a.valueInMilliseconds()-i);case"*":return E.createFromMilliseconds(a.valueInMilliseconds()*i);case"/":return E.createFromMilliseconds(a.valueInMilliseconds()/i)}throw new m(d.InvalidOperator)}function Al(a,i,u){switch(u){case"+":return E.createFromMilliseconds(a+i.valueInMilliseconds());case"-":return E.createFromMilliseconds(a-i.valueInMilliseconds());case"*":return E.createFromMilliseconds(a*i.valueInMilliseconds());case"/":return E.createFromMilliseconds(a/i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Pl(a,i,u){switch(u){case"+":return a.plus("milliseconds",i.valueInMilliseconds());case"-":return a.plus("milliseconds",-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function Dl(a,i,u){switch(u){case"+":return a.plus({milliseconds:i.valueInMilliseconds()});case"-":return a.minus({milliseconds:i.valueInMilliseconds()})}throw new m(d.InvalidOperator)}function Ll(a,i,u){switch(u){case"+":return a.addMilliseconds(i.valueInMilliseconds());case"-":return a.addMilliseconds(-1*i.valueInMilliseconds())}throw new m(d.InvalidOperator)}function _l(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus({milliseconds:t});case"-":return a.minus({milliseconds:t})}throw new m(d.InvalidOperator)}function Rl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Ul(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.plus("milliseconds",t);case"-":return a.plus("milliseconds",-1*t)}throw new m(d.InvalidOperator)}function Jl(a,i,u){throw new m(d.InvalidOperator)}function Vl(a,i,u){const t=1e3*i*24*60*60;switch(u){case"+":return a.addMilliseconds(t);case"-":return a.addMilliseconds(-1*t)}throw new m(d.InvalidOperator)}function Zl(a,i,u){throw new m(d.InvalidOperator)}function kl(a,i,u){throw new m(d.InvalidOperator)}function zl(a,i,u){throw new m(d.InvalidOperator)}function $l(a,i,u){const t=parseFloat(i);if(isNaN(t))throw new m(d.InvalidOperator);return nt(a,t,u)}function Hl(a,i,u){const t=parseFloat(a);if(isNaN(t))throw new m(d.InvalidOperator);return nt(t,i,u)}function ql(a,i,u){if(u==="+")return a+i;throw new m(d.InvalidOperator)}function jl(a,i,u){throw new m(d.InvalidOperator)}function Yl(a,i,u){throw new m(d.InvalidOperator)}function Bl(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.zone).diff(i).as("days");throw new m(d.InvalidOperator)}function Ql(a,i,u){if(u==="-")return a.toDateTimeLuxon(i.toDateTime().zone).diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function Gl(a,i,u){if(u==="-")return a.toDateTimeLuxon("UTC").diff(i.toDateTimeLuxon("UTC")).as("days");throw new m(d.InvalidOperator)}function Wl(a,i,u){throw new m(d.InvalidOperator)}function Kl(a,i,u){throw new m(d.InvalidOperator)}function Xl(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTimeLuxon(a.toDateTime().zone)).as("days");throw new m(d.InvalidOperator)}function ec(a,i,u){if(u==="-")return a.toDateTime().diff(i).as("days");throw new m(d.InvalidOperator)}function tc(a,i,u){if(u==="-")return a.toDateTime().diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function rc(a,i,u){throw new m(d.InvalidOperator)}function nc(a,i,u){throw new m(d.InvalidOperator)}function ic(a,i,u){throw new m(d.InvalidOperator)}function ac(a,i,u){throw new m(d.InvalidOperator)}function sc(a,i,u){if(u==="-")return a.diff(i).as("days");throw new m(d.InvalidOperator)}function uc(a,i,u){if(u==="-")return a.diff(i.toDateTimeLuxon(a.zone)).as("days");throw new m(d.InvalidOperator)}function oc(a,i,u){if(u==="-")return a.diff(i.toDateTime()).as("days");throw new m(d.InvalidOperator)}function lc(a,i,u){throw new m(d.InvalidOperator)}function cc(a,i,u){throw new m(d.InvalidOperator)}function fc(a,i,u){throw new m(d.InvalidOperator)}function dc(a,i,u){throw new m(d.InvalidOperator)}function pc(a,i,u){throw new m(d.InvalidOperator)}function mc(a,i,u){throw new m(d.InvalidOperator)}function vc(a,i,u){throw new m(d.InvalidOperator)}function hc(a,i,u){throw new m(d.InvalidOperator)}function wc(a,i,u){throw new m(d.InvalidOperator)}function Ic(a,i){function u(){this.constructor=a}u.prototype=i.prototype,a.prototype=new u}function se(a,i,u,t){var l=Error.call(this,a);return Object.setPrototypeOf&&Object.setPrototypeOf(l,se.prototype),l.expected=i,l.found=u,l.location=t,l.name="SyntaxError",l}function Qe(a,i,u){return u=u||" ",a.length>i?a:(i-=a.length,a+(u+=u.repeat(i)).slice(0,i))}function gc(a,i){var u,t={},l=(i=i!==void 0?i:{}).grammarSource,v={start:St},g=St,T="!",S="=",O=">=",x=">",D="<=",F="<>",X="!=",ee="||",Cr="@",at="'",st="N'",me="''",Mr=".",Er="null",Fr="true",br="false",Ar="in",Pr="is",Dr="like",Lr="escape",_r="not",Rr="and",Ur="or",Jr="between",Vr="from",Zr="for",kr="substring",zr="extract",$r="trim",Hr="position",qr="timestamp",jr="date",Yr="time",Br="leading",Qr="trailing",Gr="both",Wr="cast",Kr="as",Xr="integer",en="int",tn="smallint",rn="float",nn="real",an="varchar",sn="to",un="interval",on="year",ln="timezone_hour",cn="timezone_minute",fn="month",dn="day",pn="hour",mn="minute",vn="second",hn="case",wn="end",In="when",gn="then",yn="else",Tn=",",Nn="(",On=")",ut="`",Sn=/^[<-=]/,ve=/^[+\-]/,xn=/^[*\/]/,Cn=/^[A-Za-z_\x80-\uFFFF]/,Mn=/^[A-Za-z0-9_]/,ot=/^[A-Za-z0-9_.\x80-\uFFFF]/,En=/^["]/,lt=/^[^']/,Fn=/^[0-9]/,bn=/^[eE]/,An=/^[ \t\n\r]/,ct=/^[^`]/,Pn=y("!",!1),Dn=y("=",!1),Ln=y(">=",!1),_n=y(">",!1),Rn=y("<=",!1),Un=y("<>",!1),Jn=H([["<","="]],!1,!1),Vn=y("!=",!1),he=H(["+","-"],!1,!1),Zn=y("||",!1),kn=H(["*","/"],!1,!1),zn=H([["A","Z"],["a","z"],"_",["€","￿"]],!1,!1),$n=H([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),ft=H([["A","Z"],["a","z"],["0","9"],"_",".",["€","￿"]],!1,!1),Hn=H(['"'],!1,!1),qn=y("@",!1),dt=y("'",!1),jn=y("N'",!1),pt=y("''",!1),mt=H(["'"],!0,!1),Yn=y(".",!1),Bn=H([["0","9"]],!1,!1),Qn=H(["e","E"],!1,!1),Gn=y("NULL",!0),Wn=y("TRUE",!0),Kn=y("FALSE",!0),Xn=y("IN",!0),ei=y("IS",!0),ti=y("LIKE",!0),ri=y("ESCAPE",!0),ni=y("NOT",!0),ii=y("AND",!0),ai=y("OR",!0),si=y("BETWEEN",!0),ui=y("FROM",!0),oi=y("FOR",!0),li=y("SUBSTRING",!0),ci=y("EXTRACT",!0),fi=y("TRIM",!0),di=y("POSITION",!0),pi=y("TIMESTAMP",!0),mi=y("DATE",!0),vi=y("TIME",!0),hi=y("LEADING",!0),wi=y("TRAILING",!0),Ii=y("BOTH",!0),gi=y("CAST",!0),yi=y("AS",!0),Ti=y("INTEGER",!0),Ni=y("INT",!0),Oi=y("SMALLINT",!0),Si=y("FLOAT",!0),xi=y("REAL",!0),Ci=y("VARCHAR",!0),Mi=y("TO",!0),Ei=y("INTERVAL",!0),Fi=y("YEAR",!0),bi=y("TIMEZONE_HOUR",!0),Ai=y("TIMEZONE_MINUTE",!0),Pi=y("MONTH",!0),Di=y("DAY",!0),Li=y("HOUR",!0),_i=y("MINUTE",!0),Ri=y("SECOND",!0),Ui=y("CASE",!0),Ji=y("END",!0),Vi=y("WHEN",!0),Zi=y("THEN",!0),ki=y("ELSE",!0),zi=y(",",!1),$i=y("(",!1),Hi=y(")",!1),qi=H([" "," ",` `,"\r"],!1,!1),vt=y("`",!1),ht=H(["`"],!0,!1),ji=function(e){return e},Yi=function(e){return k(I(),...e)},wt=function(e,r,s){return{op:r,expr:s,location:I()}},Bi=function(e,r){return de(e,r)},It=function(e,r,s){return{op:r,expr:s,location:I()}},Qi=function(e,r){return de(e,r)},Gi=function(e){return ko("NOT",e,I())},Wi=function(e,r){return r==""||r==null||r==null?e:r.type=="arithmetic"?de(e,r.tail):ar(r.op,e,r.right,r.escape,I())},gt=function(e,r){return{op:e,expr:r,location:I()}},Ki=function(e){return{type:"arithmetic",tail:e}},Xi=function(e,r){return{op:e+"NOT",right:r}},ea=function(e,r){return{op:e,right:r}},ta=function(e,r,s){return k(I(),r,s)},ra=function(e,r){return{op:"NOT"+e,right:r}},na=function(e,r,s){return k(I(),r,s)},ia=function(e,r){return{op:e,right:r}},aa=function(e){return e[0]+" "+e[2]},sa=function(e){return e[0]+" "+e[2]},ua=function(e,r,s){return{op:e,right:r,escape:s.value}},oa=function(e,r){return{op:e,right:r,escape:""}},la=function(e,r){return{op:e,right:r}},ca=function(e,r){return{op:e,right:r}},yt=function(e,r,s){return{op:r,expr:s,location:I()}},fa=function(e,r){return de(e,r)},Tt=function(e,r,s){return{op:r,expr:s,location:I()}},da=function(e,r){return de(e,r)},pa=function(e){return e.paren=!0,e},ma=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",location:I(),mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",location:I(),mode:"timestamp"}:/^CURRENT_TIME$/i.test(e)?{type:"current-time",location:I(),mode:"time"}:/^CURRENT_USER$/i.test(e)?{type:"current-user",location:I()}:{type:"column-reference",location:I(),table:"",column:e}},va=function(e){return{type:"column-reference",location:I(),table:"",column:e,delimited:!0}},ha=function(e){return e},wa=function(e,r){return e+r.join("")},Ia=function(e,r){return e+r.join("")},ga=function(e){return e},ya=function(e){return e.join("")},Ta=function(){return'"'},Na=function(e){return{type:"parameter",location:I(),value:e[1]}},Oa=function(e,r){return k(I(),e,r)},Sa=function(e,r){return k(I(),e,r)},xa=function(e){return{type:"function",location:I(),name:"extract",args:e}},Ca=function(e,r,s){return k(I(),e,r,...s?[s]:[])},Ma=function(e,r,s){return k(I(),e,r,s)},Ea=function(e){return{type:"function",location:I(),name:"substring",args:e}},Fa=function(e,r){return k(I(),e,r)},ba=function(e,r){return k(I(),e,r)},Aa=function(e){return{type:"function",location:I(),name:"cast",args:e}},Pa=function(){return{type:"data-type",location:I(),value:{type:"integer"}}},Da=function(){return{type:"data-type",location:I(),value:{type:"smallint"}}},La=function(){return{type:"data-type",location:I(),value:{type:"float"}}},_a=function(){return{type:"data-type",location:I(),value:{type:"real"}}},Ra=function(){return{type:"data-type",location:I(),value:{type:"date"}}},Ua=function(){return{type:"data-type",location:I(),value:{type:"timestamp"}}},Ja=function(){return{type:"data-type",location:I(),value:{type:"time"}}},Va=function(e){return{type:"data-type",location:I(),value:{type:"varchar",size:parseInt(e)}}},Za=function(e,r,s){return k(I(),e,r,s)},ka=function(e,r){return k(I(),e,r)},za=function(e){return{type:"function",location:I(),name:"trim",args:e}},$a=function(e){return{type:"string",location:I(),value:e??"BOTH"}},Ha=function(e,r){return k(I(),e,r)},qa=function(e,r){return k(I(),e,r)},ja=function(e){return{type:"function",location:I(),name:"position",args:e}},Ya=function(e,r){return{type:"function",location:I(),name:e,args:r}},Ba=function(e){return{type:"string",location:I(),value:e}},Qa=function(e){return e.type==="string"&&zo(e.value),{type:"timestamp",location:I(),value:e.value}},Ga=function(e){return e.type==="string"&&$o(e.value),{type:"time",location:I(),value:e.value}},Wa=function(e,r,s){return{type:"interval",location:I(),value:r,qualifier:s,op:e}},Ka=function(e,r){return{type:"interval",location:I(),value:e,qualifier:r,op:""}},Xa=function(e,r){return{type:"interval-qualifier",location:I(),start:e,end:r}},es=function(e,r){return{type:"interval-period",location:I(),period:e.value,precision:r,secondary:null}},ts=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},rs=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},ns=function(e,r){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:r}},is=function(e){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:null}},as=function(){return{type:"interval-period",location:I(),period:"second",precision:null,secondary:null}},ss=function(e,r){return{type:"interval-period",location:I(),period:e.value,precision:r,secondary:null}},us=function(e){return{type:"interval-period",location:I(),period:e.value,precision:null,secondary:null}},os=function(e,r){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:r}},ls=function(e){return{type:"interval-period",location:I(),period:"second",precision:e,secondary:null}},cs=function(){return{type:"interval-period",location:I(),period:"second",precision:null,secondary:null}},fs=function(){return{type:"string",location:I(),value:"day"}},ds=function(){return{type:"string",location:I(),value:"hour"}},ps=function(){return{type:"string",location:I(),value:"minute"}},ms=function(){return{type:"string",location:I(),value:"month"}},vs=function(){return{type:"string",location:I(),value:"year"}},hs=function(e){return parseFloat(e)},ws=function(e){return parseFloat(e)},Is=function(e){return e.type==="string"&&Ho(e.value),{type:"date",location:I(),value:e.value}},gs=function(){return{type:"null",location:I(),value:null}},ys=function(){return{type:"boolean",location:I(),value:!0}},Ts=function(){return{type:"boolean",location:I(),value:!1}},Nt=function(){return"'"},Ns=function(e){return{type:"string",location:I(),value:e.join("")}},Os=function(e,r){return{type:"case-expression",location:I(),format:"simple",operand:e,clauses:r,else:null,elseLocation:null}},Ss=function(e,r,s){return{type:"case-expression",location:I(),format:"simple",operand:e,clauses:r,else:s.value,elseLocation:s.location}},xs=function(e){return{type:"case-expression",location:I(),format:"searched",clauses:e,else:null,elseLocation:null}},Cs=function(e,r){return{type:"case-expression",location:I(),format:"searched",clauses:e,else:r.value,elseLocation:r.location}},Ms=function(e,r){return{type:"when-clause",location:I(),operand:e,value:r}},Es=function(e,r){return{type:"when-clause",location:I(),operand:e,value:r}},Fs=function(e){return{type:"else-clause",location:I(),value:e}},bs=function(e){return{type:"number",location:I(),value:e}},As=function(e,r,s){return parseFloat(e+r+s)},Ps=function(e,r){return parseFloat(e+r)},Ds=function(e,r){return parseFloat(e+r)},Ls=function(e){return parseFloat(e)},_s=function(e,r){return e[0]+r},Rs=function(e){return"."+(e??"")},Us=function(e,r){return e+r},Js=function(e){return e.join("")},Vs=function(e,r){return"e"+(r===null?"":r)},Zs=function(){return"IN"},ks=function(){return"IS"},zs=function(){return"LIKE"},$s=function(){return"ESCAPE"},Hs=function(){return"NOT"},qs=function(){return"AND"},js=function(){return"OR"},Ys=function(){return"BETWEEN"},Bs=function(){return"FROM"},Qs=function(){return"FOR"},Gs=function(){return"SUBSTRING"},Ws=function(){return"EXTRACT"},Ks=function(){return"TRIM"},Xs=function(){return"POSITION"},eu=function(){return"TIMESTAMP"},tu=function(){return"DATE"},ru=function(){return"TIME"},nu=function(){return"LEADING"},iu=function(){return"TRAILING"},au=function(){return"BOTH"},su=function(){return"CAST"},uu=function(){return"AS"},ou=function(){return"INTEGER"},lu=function(){return"INT"},cu=function(){return"SMALLINT"},fu=function(){return"FLOAT"},du=function(){return"REAL"},pu=function(){return"VARCHAR"},mu=function(){return"TO"},vu=function(){return"INTERVAL"},hu=function(){return"YEAR"},wu=function(){return"TIMEZONE_HOUR"},Iu=function(){return"TIMEZONE_MINUTE"},gu=function(){return"MONTH"},yu=function(){return"DAY"},Tu=function(){return"HOUR"},Nu=function(){return"MINUTE"},Ou=function(){return"SECOND"},Su=function(){return"CASE"},xu=function(){return"END"},Cu=function(){return"WHEN"},Mu=function(){return"THEN"},Eu=function(){return"ELSE"},Fu=function(e){return e},bu=function(e){return e.join("")},n=0|i.peg$currPos,f=n,ue=[{line:1,column:1}],Y=n,we=i.peg$maxFailExpected||[],c=0|i.peg$silentFails;if(i.startRule){if(!(i.startRule in v))throw new Error(`Can't start parsing from rule "`+i.startRule+'".');g=v[i.startRule]}function I(){return Ie(f,n)}function _e(e,r){throw Pu(e,r=r!==void 0?r:Ie(f,n))}function y(e,r){return{type:"literal",text:e,ignoreCase:r}}function H(e,r,s){return{type:"class",parts:e,inverted:r,ignoreCase:s}}function Au(){return{type:"end"}}function Ot(e){var r,s=ue[e];if(s)return s;if(e>=ue.length)r=ue.length-1;else for(r=e;!ue[--r];);for(s={line:(s=ue[r]).line,column:s.column};rY&&(Y=n,we=[]),we.push(e))}function Pu(e,r){return new se(e,null,null,r)}function Du(e,r,s){return new se(se.buildMessage(e,r),e,r,s)}function St(){var e,r;return e=n,p(),(r=M())!==t?(p(),f=e,e=ji(r)):(n=e,e=t),e}function xt(){var e,r,s,o,h,C;if(e=n,_()!==t){for(p(),r=[],s=M();s!==t;)r.push(s),s=n,o=n,h=p(),(C=W())!==t?o=h=[h,C,p()]:(n=o,o=t),o!==t&&(o=M())===t?(n=s,s=t):s=o;s=p(),(o=R())!==t?(f=e,e=Yi(r)):(n=e,e=t)}else n=e,e=t;return e}function M(){var e,r,s,o,h,C;if(e=n,(r=Re())!==t){for(s=[],o=n,p(),(h=Ht())!==t?(p(),(C=Re())!==t?(f=o,o=wt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ht())!==t?(p(),(C=Re())!==t?(f=o,o=wt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=Bi(r,s)}else n=e,e=t;return e}function Re(){var e,r,s,o,h,C;if(e=n,(r=ge())!==t){for(s=[],o=n,p(),(h=Ce())!==t?(p(),(C=ge())!==t?(f=o,o=It(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ce())!==t?(p(),(C=ge())!==t?(f=o,o=It(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=Qi(r,s)}else n=e,e=t;return e}function ge(){var e,r,s,o,h;return e=n,(r=fe())===t&&(r=n,a.charCodeAt(n)===33?(s=T,n++):(s=t,c===0&&w(Pn)),s!==t?(o=n,c++,a.charCodeAt(n)===61?(h=S,n++):(h=t,c===0&&w(Dn)),c--,h===t?o=void 0:(n=o,o=t),o!==t?r=s=[s,o]:(n=r,r=t)):(n=r,r=t)),r!==t?(s=p(),(o=ge())!==t?(f=e,e=Gi(o)):(n=e,e=t)):(n=e,e=t),e===t&&(e=Lu()),e}function Lu(){var e,r,s,o;return e=n,(r=G())!==t?(s=n,p(),(o=_u())!==t?s=o:(n=s,s=t),s===t&&(s=null),f=e,e=Wi(r,s)):(n=e,e=t),e}function _u(){var e;return(e=Ru())===t&&(e=Zu())===t&&(e=Ju())===t&&(e=Uu())===t&&(e=Vu()),e}function Ru(){var e,r,s,o,h;if(e=n,r=[],s=n,p(),(o=Ct())!==t?(p(),(h=G())!==t?(f=s,s=gt(o,h)):(n=s,s=t)):(n=s,s=t),s!==t)for(;s!==t;)r.push(s),s=n,p(),(o=Ct())!==t?(p(),(h=G())!==t?(f=s,s=gt(o,h)):(n=s,s=t)):(n=s,s=t);else r=t;return r!==t&&(f=e,r=Ki(r)),e=r}function Ct(){var e;return a.substr(n,2)===O?(e=O,n+=2):(e=t,c===0&&w(Ln)),e===t&&(a.charCodeAt(n)===62?(e=x,n++):(e=t,c===0&&w(_n)),e===t&&(a.substr(n,2)===D?(e=D,n+=2):(e=t,c===0&&w(Rn)),e===t&&(a.substr(n,2)===F?(e=F,n+=2):(e=t,c===0&&w(Un)),e===t&&(e=a.charAt(n),Sn.test(e)?n++:(e=t,c===0&&w(Jn)),e===t&&(a.substr(n,2)===X?(e=X,n+=2):(e=t,c===0&&w(Vn))))))),e}function Uu(){var e,r,s,o;return e=n,(r=zt())!==t?(p(),(s=fe())!==t?(p(),(o=G())!==t?(f=e,e=Xi(r,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=zt())!==t?(p(),(s=G())!==t?(f=e,e=ea(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Ju(){var e,r,s,o,h,C,ie,sr;return e=n,(r=fe())!==t?(p(),(s=qt())!==t?(o=p(),h=n,(C=G())!==t?(p(),(ie=Ce())!==t?(p(),(sr=G())!==t?(f=h,h=ta(s,C,sr)):(n=h,h=t)):(n=h,h=t)):(n=h,h=t),h!==t?(f=e,e=ra(s,h)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=qt())!==t?(p(),s=n,(o=G())!==t?(h=p(),(C=Ce())!==t?(p(),(ie=G())!==t?(f=s,s=na(r,o,ie)):(n=s,s=t)):(n=s,s=t)):(n=s,s=t),s!==t?(f=e,e=ia(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Mt(){var e,r,s,o,h;return e=n,r=n,(s=fe())!==t?(o=p(),(h=$t())!==t?r=s=[s,o,h]:(n=r,r=t)):(n=r,r=t),r!==t&&(f=e,r=aa(r)),(e=r)===t&&(e=$t()),e}function Et(){var e,r,s,o,h;return e=n,r=n,(s=fe())!==t?(o=p(),(h=ze())!==t?r=s=[s,o,h]:(n=r,r=t)):(n=r,r=t),r!==t&&(f=e,r=sa(r)),(e=r)===t&&(e=ze()),e}function Vu(){var e,r,s,o;return e=n,(r=Mt())!==t?(p(),(s=te())!==t?(p(),yo()!==t?(p(),(o=ke())!==t?(f=e,e=ua(r,s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Mt())!==t?(p(),(s=te())!==t?(f=e,e=oa(r,s)):(n=e,e=t)):(n=e,e=t)),e}function Zu(){var e,r,s;return e=n,(r=Et())!==t?(p(),(s=xt())!==t?(f=e,e=la(r,s)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Et())!==t?(p(),(s=Ze())!==t?(f=e,e=ca(r,s)):(n=e,e=t)):(n=e,e=t)),e}function G(){var e,r,s,o,h,C;if(e=n,(r=Ue())!==t){for(s=[],o=n,p(),(h=Ft())!==t?(p(),(C=Ue())!==t?(f=o,o=yt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=Ft())!==t?(p(),(C=Ue())!==t?(f=o,o=yt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=fa(r,s)}else n=e,e=t;return e}function Ft(){var e;return e=a.charAt(n),ve.test(e)?n++:(e=t,c===0&&w(he)),e===t&&(a.substr(n,2)===ee?(e=ee,n+=2):(e=t,c===0&&w(Zn))),e}function Ue(){var e,r,s,o,h,C;if(e=n,(r=Je())!==t){for(s=[],o=n,p(),(h=bt())!==t?(p(),(C=Je())!==t?(f=o,o=Tt(r,h,C)):(n=o,o=t)):(n=o,o=t);o!==t;)s.push(o),o=n,p(),(h=bt())!==t?(p(),(C=Je())!==t?(f=o,o=Tt(r,h,C)):(n=o,o=t)):(n=o,o=t);f=e,e=da(r,s)}else n=e,e=t;return e}function bt(){var e;return e=a.charAt(n),xn.test(e)?n++:(e=t,c===0&&w(kn)),e}function Je(){var e,r;return(e=eo())===t&&(e=Bu())===t&&(e=Qu())===t&&(e=Wu())===t&&(e=Ku())===t&&(e=Gu())===t&&(e=Xu())===t&&(e=co())===t&&(e=ku())===t&&(e=Ze())===t&&(e=n,_()!==t?(p(),(r=M())!==t?(p(),R()!==t?(f=e,e=pa(r)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function ku(){var e,r;return e=n,(r=zu())!==t&&(f=e,r=ma(r)),(e=r)===t&&(e=n,(r=Hu())!==t&&(f=e,r=va(r)),e=r),e}function zu(){var e,r;return e=n,(r=$u())!==t&&(f=e,r=ha(r)),e=r}function $u(){var e,r,s,o;if(e=n,(r=Ve())!==t){for(s=[],o=Pt();o!==t;)s.push(o),o=Pt();f=e,e=wa(r,s)}else n=e,e=t;return e}function At(){var e,r,s,o;if(e=n,(r=Ve())!==t){for(s=[],o=N();o!==t;)s.push(o),o=N();f=e,e=Ia(r,s)}else n=e,e=t;return e}function Ve(){var e;return e=a.charAt(n),Cn.test(e)?n++:(e=t,c===0&&w(zn)),e}function N(){var e;return e=a.charAt(n),Mn.test(e)?n++:(e=t,c===0&&w($n)),e}function Pt(){var e;return e=a.charAt(n),ot.test(e)?n++:(e=t,c===0&&w(ft)),e}function Hu(){var e,r;return e=n,ye()!==t?(r=qu(),ye()!==t?(f=e,e=ga(r)):(n=e,e=t)):(n=e,e=t),e}function qu(){var e,r,s;for(e=n,r=[],s=Dt();s!==t;)r.push(s),s=Dt();return f=e,e=r=ya(r)}function Dt(){var e;return(e=Yu())===t&&(e=ju()),e}function ju(){var e;return e=n,ye()!==t&&ye()!==t?(f=e,e=Ta()):(n=e,e=t),e}function Yu(){var e;return e=a.charAt(n),ot.test(e)?n++:(e=t,c===0&&w(ft)),e}function ye(){var e;return e=a.charAt(n),En.test(e)?n++:(e=t,c===0&&w(Hn)),e}function Ze(){var e,r,s,o;return e=n,r=n,a.charCodeAt(n)===64?(s=Cr,n++):(s=t,c===0&&w(qn)),s!==t&&(o=At())!==t?r=s=[s,o]:(n=r,r=t),r!==t&&(f=e,r=Na(r)),e=r}function Bu(){var e,r,s,o;return e=n,jt()!==t?(p(),r=n,_()!==t?(p(),(s=Rt())!==t?(p(),$e()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Oa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=Rt())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Sa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=xa(r)):(n=e,e=t)):(n=e,e=t),e}function Qu(){var e,r,s,o,h,C,ie;return e=n,No()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),$e()!==t?(p(),(o=M())!==t?(p(),h=n,To()!==t?(C=p(),(ie=M())!==t?(p(),h=ie):(n=h,h=t)):(n=h,h=t),h===t&&(h=null),R()!==t?(f=r,r=Ca(s,o,h)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),(h=W())!==t?(p(),(C=M())!==t&&(ie=R())!==t?(f=r,r=Ma(s,o,C)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=Ea(r)):(n=e,e=t)):(n=e,e=t),e}function Gu(){var e,r,s,o;return e=n,Eo()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),Fo()!==t?(p(),(o=Lt())!==t?(p(),R()!==t?(f=r,r=Fa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=Lt())!==t?(p(),R()!==t?(f=r,r=ba(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=Aa(r)):(n=e,e=t)):(n=e,e=t),e}function Lt(){var e,r,s;return e=n,(r=bo())===t&&(r=Ao()),r!==t&&(f=e,r=Pa()),(e=r)===t&&(e=n,(r=Po())!==t&&(f=e,r=Da()),(e=r)===t&&(e=n,(r=Do())!==t&&(f=e,r=La()),(e=r)===t&&(e=n,(r=Lo())!==t&&(f=e,r=_a()),(e=r)===t&&(e=n,(r=Bt())!==t&&(f=e,r=Ra()),(e=r)===t&&(e=n,(r=Yt())!==t&&(f=e,r=Ua()),(e=r)===t&&(e=n,(r=Qt())!==t&&(f=e,r=Ja()),(e=r)===t&&(e=n,(r=_o())!==t?(p(),_()!==t?(p(),(s=re())!==t?(p(),R()!==t?(f=e,e=Va(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)))))))),e}function Wu(){var e,r,s,o,h;return e=n,Oo()!==t?(p(),r=n,_()!==t?(p(),s=_t(),p(),(o=M())!==t?(p(),$e()!==t?(p(),(h=M())!==t?(p(),R()!==t?(f=r,r=Za(s,o,h)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),s=_t(),p(),(o=M())!==t?(p(),R()!==t?(f=r,r=ka(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=za(r)):(n=e,e=t)):(n=e,e=t),e}function _t(){var e,r;return e=n,(r=xo())===t&&(r=Co())===t&&(r=Mo()),r===t&&(r=null),f=e,e=r=$a(r)}function Ku(){var e,r,s,o;return e=n,So()!==t?(p(),r=n,_()!==t?(p(),(s=M())!==t?(p(),ze()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=Ha(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t),r===t&&(r=n,_()!==t?(p(),(s=M())!==t?(p(),W()!==t?(p(),(o=M())!==t?(p(),R()!==t?(f=r,r=qa(s,o)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)):(n=r,r=t)),r!==t?(f=e,e=ja(r)):(n=e,e=t)):(n=e,e=t),e}function Xu(){var e,r,s,o;return e=n,r=n,c++,s=jt(),c--,s===t?r=void 0:(n=r,r=t),r!==t&&(s=Zo())!==t?(p(),(o=xt())!==t?(f=e,e=Ya(s,o)):(n=e,e=t)):(n=e,e=t),e}function Rt(){var e,r;return e=n,(r=Wt())===t&&(r=Kt())===t&&(r=Xt())===t&&(r=er())===t&&(r=tr())===t&&(r=ne())===t&&(r=Uo())===t&&(r=Jo()),r!==t&&(f=e,r=Ba(r)),e=r}function eo(){var e;return(e=ke())===t&&(e=mo())===t&&(e=lo())===t&&(e=oo())===t&&(e=uo())===t&&(e=to())===t&&(e=no())===t&&(e=ro()),e}function to(){var e,r;return e=n,Yt()!==t?(p(),(r=te())!==t?(f=e,e=Qa(r)):(n=e,e=t)):(n=e,e=t),e}function ro(){var e,r;return e=n,Qt()!==t?(p(),(r=te())!==t?(f=e,e=Ga(r)):(n=e,e=t)):(n=e,e=t),e}function no(){var e,r,s,o;return e=n,Gt()!==t?(p(),r=a.charAt(n),ve.test(r)?n++:(r=t,c===0&&w(he)),r!==t?(p(),(s=te())!==t?(p(),(o=Ut())!==t?(f=e,e=Wa(r,s,o)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,Gt()!==t?(p(),(r=te())!==t?(p(),(s=Ut())!==t?(f=e,e=Ka(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function Ut(){var e,r,s;return e=n,(r=io())!==t?(p(),Ro()!==t?(p(),(s=ao())!==t?(f=e,e=Xa(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=so()),e}function io(){var e,r,s;return e=n,(r=ce())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),R()!==t?(f=e,e=es(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ce())!==t&&(f=e,r=ts(r)),e=r),e}function ao(){var e,r,s,o;return e=n,(r=ce())!==t&&(f=e,r=rs(r)),(e=r)===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),W()!==t?(p(),(o=Te())!==t?(p(),R()!==t?(f=e,e=ns(s,o)):(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=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),R()!==t?(f=e,e=is(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(f=e,r=as()),e=r))),e}function so(){var e,r,s,o;return e=n,(r=ce())!==t?(p(),_()!==t?(p(),(s=Te())!==t?(p(),R()!==t?(f=e,e=ss(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ce())!==t&&(f=e,r=us(r)),(e=r)===t&&(e=n,(r=ne())!==t?(p(),_()!==t?(p(),(s=Ne())!==t?(p(),W()!==t?(p(),(o=Te())!==t?(p(),R()!==t?(f=e,e=os(s,o)):(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=ne())!==t?(p(),_()!==t?(p(),(s=Te())!==t?(p(),R()!==t?(f=e,e=ls(s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(f=e,r=cs()),e=r)))),e}function ce(){var e,r;return e=n,(r=Xt())!==t&&(f=e,r=fs()),(e=r)===t&&(e=n,(r=er())!==t&&(f=e,r=ds()),(e=r)===t&&(e=n,(r=tr())!==t&&(f=e,r=ps()),(e=r)===t&&(e=n,(r=Kt())!==t&&(f=e,r=ms()),(e=r)===t&&(e=n,(r=Wt())!==t&&(f=e,r=vs()),e=r)))),e}function Te(){var e,r;return e=n,(r=re())!==t&&(f=e,r=hs(r)),e=r}function Ne(){var e,r;return e=n,(r=re())!==t&&(f=e,r=ws(r)),e=r}function uo(){var e,r;return e=n,Bt()!==t?(p(),(r=te())!==t?(f=e,e=Is(r)):(n=e,e=t)):(n=e,e=t),e}function oo(){var e,r;return e=n,(r=wo())!==t&&(f=e,r=gs()),e=r}function lo(){var e,r;return e=n,(r=Io())!==t&&(f=e,r=ys()),(e=r)===t&&(e=n,(r=go())!==t&&(f=e,r=Ts()),e=r),e}function te(){var e;return(e=ke())===t&&(e=Ze()),e}function ke(){var e,r,s,o,h;if(e=n,a.charCodeAt(n)===39?(r=at,n++):(r=t,c===0&&w(dt)),r===t&&(a.substr(n,2)===st?(r=st,n+=2):(r=t,c===0&&w(jn))),r!==t){for(s=[],o=n,a.substr(n,2)===me?(h=me,n+=2):(h=t,c===0&&w(pt)),h!==t&&(f=o,h=Nt()),(o=h)===t&&(o=a.charAt(n),lt.test(o)?n++:(o=t,c===0&&w(mt)));o!==t;)s.push(o),o=n,a.substr(n,2)===me?(h=me,n+=2):(h=t,c===0&&w(pt)),h!==t&&(f=o,h=Nt()),(o=h)===t&&(o=a.charAt(n),lt.test(o)?n++:(o=t,c===0&&w(mt)));a.charCodeAt(n)===39?(o=at,n++):(o=t,c===0&&w(dt)),o!==t?(f=e,e=Ns(s)):(n=e,e=t)}else n=e,e=t;return e}function co(){var e;return(e=fo())===t&&(e=po()),e}function fo(){var e,r,s,o,h;if(e=n,Me()!==t)if(p(),(r=M())!==t){for(p(),s=[],o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);o!==t;)s.push(o),o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);(o=Ee())!==t?(f=e,e=Os(r,s)):(n=e,e=t)}else n=e,e=t;else n=e,e=t;if(e===t)if(e=n,Me()!==t)if(p(),(r=M())!==t){for(p(),s=[],o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);o!==t;)s.push(o),o=n,(h=Se())!==t?(p(),o=h):(n=o,o=t);(o=Jt())!==t?(h=p(),Ee()!==t?(f=e,e=Ss(r,s,o)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;else n=e,e=t;return e}function po(){var e,r,s,o;if(e=n,Me()!==t){for(p(),r=[],s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);s!==t;)r.push(s),s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);(s=Ee())!==t?(f=e,e=xs(r)):(n=e,e=t)}else n=e,e=t;if(e===t)if(e=n,Me()!==t){for(p(),r=[],s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);s!==t;)r.push(s),s=n,(o=Oe())!==t?(p(),s=o):(n=s,s=t);(s=Jt())!==t?(o=p(),Ee()!==t?(f=e,e=Cs(r,s)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function Oe(){var e,r,s;return e=n,rr()!==t?(p(),(r=M())!==t?(p(),nr()!==t?(p(),(s=M())!==t?(f=e,e=Ms(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Se(){var e,r,s;return e=n,rr()!==t?(p(),(r=M())!==t?(p(),nr()!==t?(p(),(s=M())!==t?(f=e,e=Es(r,s)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Jt(){var e,r;return e=n,Vo()!==t?(p(),(r=M())!==t?(f=e,e=Fs(r)):(n=e,e=t)):(n=e,e=t),e}function mo(){var e,r,s,o;return e=n,(r=vo())!==t?(s=n,c++,o=Ve(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=bs(r)):(n=e,e=t)):(n=e,e=t),e}function vo(){var e,r,s,o;return e=n,(r=xe())!==t&&(s=Vt())!==t&&(o=Zt())!==t?(f=e,e=As(r,s,o)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(s=Vt())!==t?(f=e,e=Ps(r,s)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(s=Zt())!==t?(f=e,e=Ds(r,s)):(n=e,e=t),e===t&&(e=n,(r=xe())!==t&&(f=e,r=Ls(r)),e=r))),e}function xe(){var e,r,s;return(e=re())===t&&(e=n,r=a.charAt(n),ve.test(r)?n++:(r=t,c===0&&w(he)),r!==t&&(s=re())!==t?(f=e,e=_s(r,s)):(n=e,e=t)),e}function Vt(){var e,r,s;return e=n,a.charCodeAt(n)===46?(r=Mr,n++):(r=t,c===0&&w(Yn)),r!==t?((s=re())===t&&(s=null),f=e,e=Rs(s)):(n=e,e=t),e}function Zt(){var e,r,s;return e=n,(r=ho())!==t&&(s=re())!==t?(f=e,e=Us(r,s)):(n=e,e=t),e}function re(){var e,r,s;if(e=n,r=[],(s=kt())!==t)for(;s!==t;)r.push(s),s=kt();else r=t;return r!==t&&(f=e,r=Js(r)),e=r}function kt(){var e;return e=a.charAt(n),Fn.test(e)?n++:(e=t,c===0&&w(Bn)),e}function ho(){var e,r,s;return e=n,r=a.charAt(n),bn.test(r)?n++:(r=t,c===0&&w(Qn)),r!==t?(s=a.charAt(n),ve.test(s)?n++:(s=t,c===0&&w(he)),s===t&&(s=null),f=e,e=Vs(r,s)):(n=e,e=t),e}function wo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Er?n+=4:(r=t,c===0&&w(Gn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function Io(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Fr?n+=4:(r=t,c===0&&w(Wn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function go(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===br?n+=5:(r=t,c===0&&w(Kn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?e=r=[r,s]:(n=e,e=t)):(n=e,e=t),e}function ze(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Ar?n+=2:(r=t,c===0&&w(Xn)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Zs()):(n=e,e=t)):(n=e,e=t),e}function zt(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Pr?n+=2:(r=t,c===0&&w(ei)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ks()):(n=e,e=t)):(n=e,e=t),e}function $t(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Dr?n+=4:(r=t,c===0&&w(ti)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=zs()):(n=e,e=t)):(n=e,e=t),e}function yo(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===Lr?n+=6:(r=t,c===0&&w(ri)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=$s()):(n=e,e=t)):(n=e,e=t),e}function fe(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===_r?n+=3:(r=t,c===0&&w(ni)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Hs()):(n=e,e=t)):(n=e,e=t),e}function Ce(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===Rr?n+=3:(r=t,c===0&&w(ii)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=qs()):(n=e,e=t)):(n=e,e=t),e}function Ht(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Ur?n+=2:(r=t,c===0&&w(ai)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=js()):(n=e,e=t)):(n=e,e=t),e}function qt(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Jr?n+=7:(r=t,c===0&&w(si)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ys()):(n=e,e=t)):(n=e,e=t),e}function $e(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Vr?n+=4:(r=t,c===0&&w(ui)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Bs()):(n=e,e=t)):(n=e,e=t),e}function To(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===Zr?n+=3:(r=t,c===0&&w(oi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Qs()):(n=e,e=t)):(n=e,e=t),e}function No(){var e,r,s,o;return e=n,(r=a.substr(n,9)).toLowerCase()===kr?n+=9:(r=t,c===0&&w(li)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Gs()):(n=e,e=t)):(n=e,e=t),e}function jt(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===zr?n+=7:(r=t,c===0&&w(ci)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ws()):(n=e,e=t)):(n=e,e=t),e}function Oo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===$r?n+=4:(r=t,c===0&&w(fi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ks()):(n=e,e=t)):(n=e,e=t),e}function So(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===Hr?n+=8:(r=t,c===0&&w(di)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Xs()):(n=e,e=t)):(n=e,e=t),e}function Yt(){var e,r,s,o;return e=n,(r=a.substr(n,9)).toLowerCase()===qr?n+=9:(r=t,c===0&&w(pi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=eu()):(n=e,e=t)):(n=e,e=t),e}function Bt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===jr?n+=4:(r=t,c===0&&w(mi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=tu()):(n=e,e=t)):(n=e,e=t),e}function Qt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Yr?n+=4:(r=t,c===0&&w(vi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ru()):(n=e,e=t)):(n=e,e=t),e}function xo(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Br?n+=7:(r=t,c===0&&w(hi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=nu()):(n=e,e=t)):(n=e,e=t),e}function Co(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===Qr?n+=8:(r=t,c===0&&w(wi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=iu()):(n=e,e=t)):(n=e,e=t),e}function Mo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Gr?n+=4:(r=t,c===0&&w(Ii)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=au()):(n=e,e=t)):(n=e,e=t),e}function Eo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===Wr?n+=4:(r=t,c===0&&w(gi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=su()):(n=e,e=t)):(n=e,e=t),e}function Fo(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===Kr?n+=2:(r=t,c===0&&w(yi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=uu()):(n=e,e=t)):(n=e,e=t),e}function bo(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===Xr?n+=7:(r=t,c===0&&w(Ti)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=ou()):(n=e,e=t)):(n=e,e=t),e}function Ao(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===en?n+=3:(r=t,c===0&&w(Ni)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=lu()):(n=e,e=t)):(n=e,e=t),e}function Po(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===tn?n+=8:(r=t,c===0&&w(Oi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=cu()):(n=e,e=t)):(n=e,e=t),e}function Do(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===rn?n+=5:(r=t,c===0&&w(Si)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=fu()):(n=e,e=t)):(n=e,e=t),e}function Lo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===nn?n+=4:(r=t,c===0&&w(xi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=du()):(n=e,e=t)):(n=e,e=t),e}function _o(){var e,r,s,o;return e=n,(r=a.substr(n,7)).toLowerCase()===an?n+=7:(r=t,c===0&&w(Ci)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=pu()):(n=e,e=t)):(n=e,e=t),e}function Ro(){var e,r,s,o;return e=n,(r=a.substr(n,2)).toLowerCase()===sn?n+=2:(r=t,c===0&&w(Mi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=mu()):(n=e,e=t)):(n=e,e=t),e}function Gt(){var e,r,s,o;return e=n,(r=a.substr(n,8)).toLowerCase()===un?n+=8:(r=t,c===0&&w(Ei)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=vu()):(n=e,e=t)):(n=e,e=t),e}function Wt(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===on?n+=4:(r=t,c===0&&w(Fi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=hu()):(n=e,e=t)):(n=e,e=t),e}function Uo(){var e,r,s,o;return e=n,(r=a.substr(n,13)).toLowerCase()===ln?n+=13:(r=t,c===0&&w(bi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=wu()):(n=e,e=t)):(n=e,e=t),e}function Jo(){var e,r,s,o;return e=n,(r=a.substr(n,15)).toLowerCase()===cn?n+=15:(r=t,c===0&&w(Ai)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Iu()):(n=e,e=t)):(n=e,e=t),e}function Kt(){var e,r,s,o;return e=n,(r=a.substr(n,5)).toLowerCase()===fn?n+=5:(r=t,c===0&&w(Pi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=gu()):(n=e,e=t)):(n=e,e=t),e}function Xt(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===dn?n+=3:(r=t,c===0&&w(Di)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=yu()):(n=e,e=t)):(n=e,e=t),e}function er(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===pn?n+=4:(r=t,c===0&&w(Li)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Tu()):(n=e,e=t)):(n=e,e=t),e}function tr(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===mn?n+=6:(r=t,c===0&&w(_i)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Nu()):(n=e,e=t)):(n=e,e=t),e}function ne(){var e,r,s,o;return e=n,(r=a.substr(n,6)).toLowerCase()===vn?n+=6:(r=t,c===0&&w(Ri)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Ou()):(n=e,e=t)):(n=e,e=t),e}function Me(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===hn?n+=4:(r=t,c===0&&w(Ui)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Su()):(n=e,e=t)):(n=e,e=t),e}function Ee(){var e,r,s,o;return e=n,(r=a.substr(n,3)).toLowerCase()===wn?n+=3:(r=t,c===0&&w(Ji)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=xu()):(n=e,e=t)):(n=e,e=t),e}function rr(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===In?n+=4:(r=t,c===0&&w(Vi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Cu()):(n=e,e=t)):(n=e,e=t),e}function nr(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===gn?n+=4:(r=t,c===0&&w(Zi)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Mu()):(n=e,e=t)):(n=e,e=t),e}function Vo(){var e,r,s,o;return e=n,(r=a.substr(n,4)).toLowerCase()===yn?n+=4:(r=t,c===0&&w(ki)),r!==t?(s=n,c++,o=N(),c--,o===t?s=void 0:(n=s,s=t),s!==t?(f=e,e=Eu()):(n=e,e=t)):(n=e,e=t),e}function W(){var e;return a.charCodeAt(n)===44?(e=Tn,n++):(e=t,c===0&&w(zi)),e}function _(){var e;return a.charCodeAt(n)===40?(e=Nn,n++):(e=t,c===0&&w($i)),e}function R(){var e;return a.charCodeAt(n)===41?(e=On,n++):(e=t,c===0&&w(Hi)),e}function p(){var e,r;for(e=[],r=ir();r!==t;)e.push(r),r=ir();return e}function ir(){var e;return e=a.charAt(n),An.test(e)?n++:(e=t,c===0&&w(qi)),e}function Zo(){var e,r,s,o;if(e=n,(r=At())!==t&&(f=e,r=Fu(r)),(e=r)===t)if(e=n,a.charCodeAt(n)===96?(r=ut,n++):(r=t,c===0&&w(vt)),r!==t){if(s=[],o=a.charAt(n),ct.test(o)?n++:(o=t,c===0&&w(ht)),o!==t)for(;o!==t;)s.push(o),o=a.charAt(n),ct.test(o)?n++:(o=t,c===0&&w(ht));else s=t;s!==t?(a.charCodeAt(n)===96?(o=ut,n++):(o=t,c===0&&w(vt)),o!==t?(f=e,e=bu(s)):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function ko(e,r,s){return{type:"unary-expression",location:s,operator:e,expr:r}}function ar(e,r,s,o,h){const C={type:"binary-expression",location:h,operator:e,left:r,right:s};return o!==void 0&&(C.escape=o),C}function k(e,...r){return{type:"expression-list",location:e,value:r}}function de(e,r){let s=e;for(const{op:o,expr:h,location:{end:C}}of r)s=ar(o,s,h,void 0,{...s.location,end:C});return s}function zo(e){/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)!==!0&&_e("Timestamp literal is invalid")}function $o(e){/^(\d{1,2}):(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2})$|^(\d{1,2}):(\d{1,2}):(\d{1,2}).([0-9]+)$/.test(e)!==!0&&_e("Time literal is invalid")}function Ho(e){/^(\d{4})-(\d{1,2})-(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})(\.[0-9]+)?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})?[ ]{0,1}(\+|\-)(\d{1,2}):(\d{1,2})$|^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/.test(e)!==!0&&_e("Date literal is invalid")}if(u=g(),i.peg$library)return{peg$result:u,peg$currPos:n,peg$FAILED:t,peg$maxFailExpected:we,peg$maxFailPos:Y};if(u!==t&&n===a.length)return u;throw u!==t&&n `+g+` `+S+` | diff --git a/custom-toc-highlight/assets/WorkerTileHandler-DLznBxmP-CJAvtX2q.js b/custom-toc-highlight/assets/WorkerTileHandler-DLznBxmP-BNSWrcCp.js similarity index 98% rename from custom-toc-highlight/assets/WorkerTileHandler-DLznBxmP-CJAvtX2q.js rename to custom-toc-highlight/assets/WorkerTileHandler-DLznBxmP-BNSWrcCp.js index ff3773c0..62d99a21 100644 --- a/custom-toc-highlight/assets/WorkerTileHandler-DLznBxmP-CJAvtX2q.js +++ b/custom-toc-highlight/assets/WorkerTileHandler-DLznBxmP-BNSWrcCp.js @@ -1,2 +1,2 @@ -import{aU as Ue,x as je,ba as Be,hm as Le,O as qe}from"./story-BfX8CRfG.js";import{C as oe,I as _e}from"./enums-qHpGJ28Q-CmnLAccm.js";import{g as V,B as Te,R as ne,E as te,C as Ge,b as Ve,V as Ae,j as Ye,D as $e,N as Ze,d as Je,U as $,F as ye}from"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import{a as ke}from"./Rect-DD6XS68q-D_hsV3ag.js";import{o as Ce}from"./config-nuMERBvb-MDUrh2eL.js";import{n as se,l as C,p as Q,o as Ee,u as Me,r as Xe,m as we}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{o as Qe}from"./pbf-D-y3_eZO-DQKnyfOm.js";import{M as et,k as tt,D as st}from"./TurboLine-CIlsAy5m-Cxo-QeJ4.js";import{f as it,g as rt}from"./SourceLayerData-BT_Ywuvg-DFNndgqY.js";import{a as at,X as v,W as ot,Z as nt}from"./StyleRepository-D3WuVprR-SmpmvCua.js";import{m as Se}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{d as lt}from"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./main-ugzBrWNm.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";function ht(a){return a===746||a===747||!(a<4352)&&(a>=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103&&!(a>=65097&&a<=65103)||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351&&!(a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=12592&&a<=12687||a>=43360&&a<=43391||a>=55216&&a<=55295||a>=4352&&a<=4607||a>=44032&&a<=55215||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12688&&a<=12703||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543&&a!==12540||a>=65280&&a<=65519&&!(a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||a>=65104&&a<=65135&&!(a>=65112&&a<=65118||a>=65123&&a<=65126)||a>=5120&&a<=5759||a>=6320&&a<=6399||a>=65040&&a<=65055||a>=19904&&a<=19967||a>=40960&&a<=42127||a>=42128&&a<=42191)}function ct(a){return!(a<11904)&&(a>=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=65280&&a<=65519||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543||a>=65040&&a<=65055||a>=42128&&a<=42191||a>=40960&&a<=42127)}function ut(a){switch(a){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 ve(a){switch(a){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const K=24,He=17;let Ke=class{constructor(a,t,e,i,s,n,o){this._glyphItems=a,this._maxWidth=t,this._lineHeight=e,this._letterSpacing=i,this._hAnchor=s,this._vAnchor=n,this._justify=o}getShaping(a,t,e){const i=this._letterSpacing,s=this._lineHeight,n=this._justify,o=this._maxWidth,r=[];let l=0,h=0;for(const p of a){const g=p.codePointAt(0);if(g==null)continue;const M=e&&ht(g);let m;for(const I of this._glyphItems)if(m=I[g],m)break;r.push({codePoint:g,x:l,y:h,vertical:M,glyphMosaicItem:m}),m&&(l+=m.metrics.advance+i)}let u=l;o>0&&(u=l/Math.max(1,Math.ceil(l/o)));const d=a.includes("​"),f=[],c=r.length;for(let p=0;pM&&ve(r[m].codePoint);)r[m].glyphMosaicItem=null,--m;if(M<=m){const I=r[M].x;for(let T=M;T<=m;T++)r[T].x-=I,r[T].y=h;let P=r[m].x;r[m].glyphMosaicItem&&(P+=r[m].glyphMosaicItem.metrics.advance),_=Math.max(P,_),n&&this._applyJustification(r,M,m)}y=g,h+=w}if(r.length>0){const p=x.length-1,g=(n-this._hAnchor)*_;let M=(-this._vAnchor*(p+1)+.5)*s;t&&p&&(M+=p*s);for(const m of r)m.x+=g,m.y+=M}return r.filter(p=>p.glyphMosaicItem)}static getTextBox(a,t){if(!a.length)return null;let e=1/0,i=1/0,s=0,n=0;for(const o of a){const r=o.glyphMosaicItem.metrics.advance,l=o.x,h=o.y-He,u=l+r,d=h+t;e=Math.min(e,l),s=Math.max(s,u),i=Math.min(i,h),n=Math.max(n,d)}return{x:e,y:i,width:s-e,height:n-i}}static getBox(a){if(!a.length)return null;let t=1/0,e=1/0,i=0,s=0;for(const n of a){const{height:o,left:r,top:l,width:h}=n.glyphMosaicItem.metrics,u=n.x,d=n.y-(o-Math.abs(l)),f=u+h+r,c=d+o;t=Math.min(t,u),i=Math.max(i,f),e=Math.min(e,d),s=Math.max(s,c)}return{x:t,y:e,width:i-t,height:s-e}}static addDecoration(a,t){const e=a.length;if(e===0)return;const i=3;let s=a[0].x+a[0].glyphMosaicItem.metrics.left,n=a[0].y;for(let r=1;r=0&&o,f=i.allowOverlap&&i.ignorePlacement?null:[],c=[],x=4,_=!d;let w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y;const M=(d||o)&&r,m=i.size/K;let I=!1;for(const D of t)if(D.vertical){I=!0;break}let P,T=0,b=0;if(!d&&I){const D=Ke.getTextBox(t,i.lineHeight*K);switch(i.anchor){case C.LEFT:T=D.height/2,b=-D.width/2;break;case C.RIGHT:T=-D.height/2,b=D.width/2;break;case C.TOP:T=D.height/2,b=D.width/2;break;case C.BOTTOM:T=-D.height/2,b=-D.width/2;break;case C.TOP_LEFT:T=D.height;break;case C.BOTTOM_LEFT:b=-D.width;break;case C.TOP_RIGHT:b=D.width;break;case C.BOTTOM_RIGHT:T=-D.height}}T+=i.offset[0]*K,b+=i.offset[1]*K;for(const D of t){const B=D.glyphMosaicItem;if(!B||B.rect.isEmpty)continue;const A=B.rect,k=B.metrics,E=B.page;if(f&&_){if(P!==void 0&&P!==D.y){let S,F,G,H;I?(S=-g+T,F=w+b,G=g-p,H=y-w):(S=w+T,F=p+b,G=y-w,H=g-p);const q={xTile:a.x,yTile:a.y,dxPixels:S*m-l,dyPixels:F*m-l,hard:!i.optional,partIndex:1,width:G*m+2*l,height:H*m+2*l,angle:n,minLod:X,maxLod:te};f.push(q),w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y}P=D.y}const R=[];if(d){const S=.5*B.metrics.width,F=(D.x+k.left-x+S)*m*le;if(h=this._placeGlyph(a,h,F,e,a.segment,1,D.vertical,E,R),r&&(h=this._placeGlyph(a,h,F,e,a.segment,-1,D.vertical,E,R)),h>=Pe)break}else R.push(new pe(s,u,u,E,!1)),o&&r&&R.push(new pe(s,u+ne,u+ne,E,!1));const N=D.x+k.left,j=D.y-He-k.top,Z=N+k.width,ie=j+k.height;let O,U,he,ce,J,ue,De,be;if(!d&&I)if(D.vertical){const S=(N+Z)/2-k.height/2,F=(j+ie)/2+k.width/2;O=new V(-F-x+T,S-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y)}else O=new V(-j+x+T,N-x+b),U=new V(O.x-A.height,O.y+A.width),he=new V(U.x,O.y),ce=new V(O.x,U.y);else O=new V(N-x+T,j-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y);for(const S of R){let F,G,H,q;if(S.alternateVerticalGlyph){if(!J){const Y=(j+ie)/2+b;J=new V((N+Z)/2+T-k.height/2-x,Y+k.width/2+x),ue=new V(J.x+A.height,J.y-A.width),De=new V(ue.x,J.y),be=new V(J.x,ue.y)}F=J,G=De,H=be,q=ue}else F=O,G=he,H=ce,q=U;const fe=j,Ie=ie,de=S.glyphAngle+n;if(de!==0){const Y=Math.cos(de),xe=Math.sin(de);F=F.clone(),G=G?.clone(),H=H?.clone(),q=q?.clone(),F.rotate(Y,xe),q?.rotate(Y,xe),G?.rotate(Y,xe),H?.rotate(Y,xe)}let re=0,ae=256;if(d&&I?D.vertical?S.alternateVerticalGlyph?(re=32,ae=96):(re=224,ae=32):(re=224,ae=96):(re=192,ae=64),c.push(new Oe(F,H,G,q,A,S.labelAngle,re,ae,S.anchor,S.minzoom,S.maxzoom,S.page)),f&&(!M||this._legible(S.labelAngle))){if(_)Ny&&(y=Z),Ie>g&&(g=Ie);else if(S.minzoom=Pe)return null;if(f&&_){let D,B,A,k;I?(D=-g+T,B=w+b,A=g-p,k=y-w):(D=w+T,B=p+b,A=y-w,k=g-p);const E={xTile:a.x,yTile:a.y,dxPixels:D*m-l,dyPixels:B*m-l,hard:!i.optional,partIndex:1,width:A*m+2*l,height:k*m+2*l,angle:n,minLod:X,maxLod:te};f.push(E)}const L=new Fe(c);return f&&f.length>0&&(L.textColliders=f),L}_legible(a){const t=Ge(a);return t<65||t>=193}_placeGlyph(a,t,e,i,s,n,o,r,l){let h=n;const u=h<0?Ve(a.angle+ne,Ae):a.angle;let d=0;e<0&&(h*=-1,e*=-1,d=ne),h>0&&++s;let f=new V(a.x,a.y),c=i[s],x=te;if(i.length<=s)return x;for(;;){const _=c.x-f.x,w=c.y-f.y,y=Math.sqrt(_*_+w*w),p=Math.max(e/y,t),g=_/y,M=w/y,m=Ve(Math.atan2(M,g)+d,Ae);if(l.push(new pe(f,u,m,r,!1,p,x)),o&&l.push(new pe(f,u,m,r,!0,p,x)),p<=t)return p;f=c.clone();do{if(s+=h,i.length<=s||s<0)return p;c=i[s]}while(f.isEqual(c));let I=c.x-f.x,P=c.y-f.y;const T=Math.sqrt(I*I+P*P);I*=y/T,P*=y/T,f.x-=I,f.y-=P,x=p}}},ee=class extends v{constructor(){super(12)}add(a,t,e){const i=this.array;i.push(a),i.push(t),i.push(e)}},dt=class extends v{constructor(a){super(a)}add(a,t,e,i,s,n,o,r,l,h,u,d){const f=this.array;let c=v.i1616to32(a,t);f.push(c);const x=31;c=v.i8888to32(Math.round(x*e),Math.round(x*i),Math.round(x*s),Math.round(x*n)),f.push(c),c=v.i8888to32(Math.round(x*o),Math.round(x*r),Math.round(x*l),Math.round(x*h)),f.push(c),c=v.i1616to32(u,0),f.push(c),d&&f.push(...d)}},xt=class extends v{constructor(a){super(a)}add(a,t,e){const i=this.array;i.push(v.i1616to32(a,t)),e&&i.push(...e)}};class yt extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r){const l=this.array,h=this.index;let u=v.i1616to32(t,e);l.push(u);const d=15;return u=v.i8888to32(Math.round(d*i),Math.round(d*s),n,o),l.push(u),r&&l.push(...r),h}}class ze extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r,l,h,u,d,f){const c=this.array;let x=v.i1616to32(t,e);c.push(x),x=v.i1616to32(Math.round(8*i),Math.round(8*s)),c.push(x),x=v.i8888to32(n/4,o/4,l,h),c.push(x),x=v.i8888to32(0,Ge(r),10*u,Math.min(10*d,255)),c.push(x),f&&c.push(...f)}}class gt extends v{constructor(t){super(t)}add(t,e,i,s,n){const o=this.array,r=v.i1616to32(2*t+i,2*e+s);o.push(r),n&&o.push(...n)}}class me{constructor(t,e,i){this.layerExtent=4096,this._features=[],this.layer=t,this.zoom=e,this._spriteInfo=i,this._filter=t.getFeatureFilter()}pushFeature(t){this._filter&&!this._filter.filter(t,this.zoom)||this._features.push(t)}hasFeatures(){return this._features.length>0}getResources(t,e,i){}}let pt=class extends me{constructor(a,t,e,i,s){super(a,t,e),this.type=_e.CIRCLE,this._circleVertexBuffer=i,this._circleIndexBuffer=s}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(a){const t=this._circleVertexBuffer,e=this._circleIndexBuffer;this._circleIndexStart=3*e.index,this._circleIndexCount=0;const i=this.layer,s=this.zoom;a&&a.setExtent(this.layerExtent);for(const n of this._features){const o=n.getGeometry(a);if(!o)continue;const r=i.circleMaterial.encodeAttributes(n,s,i);for(const l of o)if(l)for(const h of l){const u=t.index;t.add(h.x,h.y,0,0,r),t.add(h.x,h.y,0,1,r),t.add(h.x,h.y,1,0,r),t.add(h.x,h.y,1,1,r),e.add(u,u+1,u+2),e.add(u+1,u+2,u+3),this._circleIndexCount+=6}}}serialize(){let a=6;a+=this.layerUIDs.length,a+=this._circleVertexBuffer.array.length,a+=this._circleIndexBuffer.array.length;const t=new Uint32Array(a),e=new Int32Array(t.buffer);let i=0;t[i++]=this.type,t[i++]=this.layerUIDs.length;for(let s=0;sM.page-m.page);for(const{ddFillAttributes:M,ddOutlineAttributes:m,page:I,geometry:P}of c)this._processFeature(P,u,e.outlineUsesFillColor,M,m,f,I)}}else for(const c of d){const x=o?s.encodeAttributes(c,i,e):null,_=u&&r?n.encodeAttributes(c,i,e):null,w=c.getGeometry(t);this._processFeature(w,u,e.outlineUsesFillColor,x,_,f)}}serialize(){let t=10;t+=this.layerUIDs.length,t+=this._fillVertexBuffer.array.length,t+=this._fillIndexBuffer.array.length,t+=this._outlineVertexBuffer.array.length,t+=this._outlineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this._fillVertexBuffer.array.length;for(let r=0;ru?(d!==void 0&&this._processFill(t,d,s,o,r),d=[f]):c<-u&&d!==void 0&&d.push(f)}d!==void 0&&this._processFill(t,d,s,o,r)}_processOutline(t,e){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,n=s.index;let o,r,l;const h=new V(0,0),u=new V(0,0),d=new V(0,0);let f=-1,c=-1,x=-1,_=-1,w=-1,y=!1;const p=0;let g=t.length;if(g<2)return;const M=t[p];let m=t[g-1];for(;g&&m.isEqual(M);)--g,m=t[g-1];if(!(g-p<2)){for(let I=p;I8&&(L=8),T>=0?(x=i.add(r.x,r.y,h.x,h.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,L*-d.x,L*-d.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,d.x,d.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,u.x,u.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x)):(x=i.add(r.x,r.y,L*d.x,L*d.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,-h.x,-h.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,-d.x,-d.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=i.add(r.x,r.y,-u.x,-u.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x))}f>=0&&c>=0&&_>=0&&!y&&s.add(f,c,_),f>=0&&_>=0&&w>=0&&!y&&s.add(f,w,_),this._outlineIndexCount+=3*(s.index-n)}}_processFill(t,e,i,s,n){s=!0;let o;e.length>1&&(o=[]);let r=0;for(const d of e)r!==0&&o.push(r),r+=t[d].length;const l=2*r,h=Be.acquire();for(const d of e){const f=t[d],c=f.length;for(let x=0;x0){const d=e.map(x=>t[x].length),{buffer:f,vertexCount:c}=tt(h,d);if(c>0){const x=this._fillVertexBuffer.index;for(let _=0;_0){const f=this._fillVertexBuffer.index;let c=0;for(;c=4160:t.y===e.y&&(t.y<=-64||t.y>=4160)}static _area(t){let e=0;const i=t.length-1;for(let s=0;sB.page-A.page),n.textured=!0;for(const{ddAttributes:B,page:A,cap:k,join:E,miterLimit:R,roundLimit:N,halfWidth:j,offset:Z,geometry:ie}of D)n.capType=k,n.joinType=E,n.miterLimit=R,n.roundLimit=N,n.halfWidth=j,n.offset=Z,this._processFeature(ie,B,A)}else{if(l){const D=l.getValue(i);if(!this._spriteInfo[D]?.rect)return}n.textured=!(!l&&!h),n.capType=x,n.joinType=p,n.miterLimit=M,n.roundLimit=I,n.halfWidth=.5*T,n.offset=L;for(const D of s){const B=o?r.encodeAttributes(D,i,e):null;c&&(n.capType=c.getValue(i,D)),y&&(n.joinType=y.getValue(i,D)),g&&(n.miterLimit=g.getValue(i,D)),m&&(n.roundLimit=m.getValue(i,D)),P&&(n.halfWidth=.5*P.getValue(i,D)),b&&(n.offset=b.getValue(i,D));const A=D.getGeometry(t);this._processFeature(A,B)}}}serialize(){let t=6;t+=this.layerUIDs.length,t+=this.tessellationProperties._lineVertexBuffer.array.length,t+=this.tessellationProperties._lineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let r=0;r(t,e,i,s,n,o,r,l,h,u,d)=>(a._lineVertexBuffer.add(t,e,r,l,i,s,n,o,h,u,d,a._ddValues),a._lineVertexBuffer.index-1),wt=a=>(t,e,i)=>{a._lineIndexBuffer.add(t,e,i)},Ne=10;function Pt(a,t){return a.iconMosaicItem&&t.iconMosaicItem?a.iconMosaicItem.page===t.iconMosaicItem.page?0:a.iconMosaicItem.page-t.iconMosaicItem.page:a.iconMosaicItem&&!t.iconMosaicItem?1:!a.iconMosaicItem&&t.iconMosaicItem?-1:0}class z extends me{constructor(t,e,i,s,n,o,r,l,h){super(e,i,h.getSpriteItems()),this.type=_e.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=t,this._iconVertexBuffer=s,this._iconIndexBuffer=n,this._textVertexBuffer=o,this._textIndexBuffer=r,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(t,e,i){const s=this.layer,n=this.zoom;t&&t.setExtent(this.layerExtent);const o=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let l=s.getLayoutProperty("text-transform"),h=s.getLayoutProperty("text-font");const u=[];let d,f,c,x;o&&!o.isDataDriven&&(d=o.getValue(n)),r&&!r.isDataDriven&&(f=r.getValue(n)),l&&l.isDataDriven||(c=s.getLayoutValue("text-transform",n),l=null),h&&h.isDataDriven||(x=s.getLayoutValue("text-font",n),h=null);for(const _ of this._features){const w=_.getGeometry(t);if(!w||w.length===0)continue;let y,p;o&&(y=o.isDataDriven?o.getValue(n,_):this._replaceKeys(d,_.values),y&&e(y));let g=!1;if(r&&(p=r.isDataDriven?r.getValue(n,_):this._replaceKeys(f,_.values),p)){switch(p=p.replaceAll("\\n",` +import{aU as Ue,x as je,ba as Be,hm as Le,O as qe}from"./story-Doly9N9p.js";import{C as oe,I as _e}from"./enums-qHpGJ28Q-CmnLAccm.js";import{g as V,B as Te,R as ne,E as te,C as Ge,b as Ve,V as Ae,j as Ye,D as $e,N as Ze,d as Je,U as $,F as ye}from"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import{a as ke}from"./Rect-DD6XS68q-D_hsV3ag.js";import{o as Ce}from"./config-nuMERBvb-MDUrh2eL.js";import{n as se,l as C,p as Q,o as Ee,u as Me,r as Xe,m as we}from"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import{o as Qe}from"./pbf-D-y3_eZO-CpHdkhuD.js";import{M as et,k as tt,D as st}from"./TurboLine-CIlsAy5m-C6Kc2De-.js";import{f as it,g as rt}from"./SourceLayerData-BT_Ywuvg-D7mjpcmo.js";import{a as at,X as v,W as ot,Z as nt}from"./StyleRepository-D3WuVprR-B1BVbhGB.js";import{m as Se}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{d as lt}from"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./main-QGPoLsvl.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";function ht(a){return a===746||a===747||!(a<4352)&&(a>=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103&&!(a>=65097&&a<=65103)||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351&&!(a>=12296&&a<=12305||a>=12308&&a<=12319||a===12336)||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=12592&&a<=12687||a>=43360&&a<=43391||a>=55216&&a<=55295||a>=4352&&a<=4607||a>=44032&&a<=55215||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12688&&a<=12703||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543&&a!==12540||a>=65280&&a<=65519&&!(a===65288||a===65289||a===65293||a>=65306&&a<=65310||a===65339||a===65341||a===65343||a>=65371&&a<=65503||a===65507||a>=65512&&a<=65519)||a>=65104&&a<=65135&&!(a>=65112&&a<=65118||a>=65123&&a<=65126)||a>=5120&&a<=5759||a>=6320&&a<=6399||a>=65040&&a<=65055||a>=19904&&a<=19967||a>=40960&&a<=42127||a>=42128&&a<=42191)}function ct(a){return!(a<11904)&&(a>=12704&&a<=12735||a>=12544&&a<=12591||a>=65072&&a<=65103||a>=63744&&a<=64255||a>=13056&&a<=13311||a>=11904&&a<=12031||a>=12736&&a<=12783||a>=12288&&a<=12351||a>=13312&&a<=19903||a>=19968&&a<=40959||a>=12800&&a<=13055||a>=65280&&a<=65519||a>=12352&&a<=12447||a>=12272&&a<=12287||a>=12032&&a<=12255||a>=12784&&a<=12799||a>=12448&&a<=12543||a>=65040&&a<=65055||a>=42128&&a<=42191||a>=40960&&a<=42127)}function ut(a){switch(a){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 ve(a){switch(a){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const K=24,He=17;let Ke=class{constructor(a,t,e,i,s,n,o){this._glyphItems=a,this._maxWidth=t,this._lineHeight=e,this._letterSpacing=i,this._hAnchor=s,this._vAnchor=n,this._justify=o}getShaping(a,t,e){const i=this._letterSpacing,s=this._lineHeight,n=this._justify,o=this._maxWidth,r=[];let l=0,h=0;for(const p of a){const g=p.codePointAt(0);if(g==null)continue;const M=e&&ht(g);let m;for(const I of this._glyphItems)if(m=I[g],m)break;r.push({codePoint:g,x:l,y:h,vertical:M,glyphMosaicItem:m}),m&&(l+=m.metrics.advance+i)}let u=l;o>0&&(u=l/Math.max(1,Math.ceil(l/o)));const d=a.includes("​"),f=[],c=r.length;for(let p=0;pM&&ve(r[m].codePoint);)r[m].glyphMosaicItem=null,--m;if(M<=m){const I=r[M].x;for(let T=M;T<=m;T++)r[T].x-=I,r[T].y=h;let P=r[m].x;r[m].glyphMosaicItem&&(P+=r[m].glyphMosaicItem.metrics.advance),_=Math.max(P,_),n&&this._applyJustification(r,M,m)}y=g,h+=w}if(r.length>0){const p=x.length-1,g=(n-this._hAnchor)*_;let M=(-this._vAnchor*(p+1)+.5)*s;t&&p&&(M+=p*s);for(const m of r)m.x+=g,m.y+=M}return r.filter(p=>p.glyphMosaicItem)}static getTextBox(a,t){if(!a.length)return null;let e=1/0,i=1/0,s=0,n=0;for(const o of a){const r=o.glyphMosaicItem.metrics.advance,l=o.x,h=o.y-He,u=l+r,d=h+t;e=Math.min(e,l),s=Math.max(s,u),i=Math.min(i,h),n=Math.max(n,d)}return{x:e,y:i,width:s-e,height:n-i}}static getBox(a){if(!a.length)return null;let t=1/0,e=1/0,i=0,s=0;for(const n of a){const{height:o,left:r,top:l,width:h}=n.glyphMosaicItem.metrics,u=n.x,d=n.y-(o-Math.abs(l)),f=u+h+r,c=d+o;t=Math.min(t,u),i=Math.max(i,f),e=Math.min(e,d),s=Math.max(s,c)}return{x:t,y:e,width:i-t,height:s-e}}static addDecoration(a,t){const e=a.length;if(e===0)return;const i=3;let s=a[0].x+a[0].glyphMosaicItem.metrics.left,n=a[0].y;for(let r=1;r=0&&o,f=i.allowOverlap&&i.ignorePlacement?null:[],c=[],x=4,_=!d;let w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y;const M=(d||o)&&r,m=i.size/K;let I=!1;for(const D of t)if(D.vertical){I=!0;break}let P,T=0,b=0;if(!d&&I){const D=Ke.getTextBox(t,i.lineHeight*K);switch(i.anchor){case C.LEFT:T=D.height/2,b=-D.width/2;break;case C.RIGHT:T=-D.height/2,b=D.width/2;break;case C.TOP:T=D.height/2,b=D.width/2;break;case C.BOTTOM:T=-D.height/2,b=-D.width/2;break;case C.TOP_LEFT:T=D.height;break;case C.BOTTOM_LEFT:b=-D.width;break;case C.TOP_RIGHT:b=D.width;break;case C.BOTTOM_RIGHT:T=-D.height}}T+=i.offset[0]*K,b+=i.offset[1]*K;for(const D of t){const B=D.glyphMosaicItem;if(!B||B.rect.isEmpty)continue;const A=B.rect,k=B.metrics,E=B.page;if(f&&_){if(P!==void 0&&P!==D.y){let S,F,G,H;I?(S=-g+T,F=w+b,G=g-p,H=y-w):(S=w+T,F=p+b,G=y-w,H=g-p);const q={xTile:a.x,yTile:a.y,dxPixels:S*m-l,dyPixels:F*m-l,hard:!i.optional,partIndex:1,width:G*m+2*l,height:H*m+2*l,angle:n,minLod:X,maxLod:te};f.push(q),w=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,p=w,g=y}P=D.y}const R=[];if(d){const S=.5*B.metrics.width,F=(D.x+k.left-x+S)*m*le;if(h=this._placeGlyph(a,h,F,e,a.segment,1,D.vertical,E,R),r&&(h=this._placeGlyph(a,h,F,e,a.segment,-1,D.vertical,E,R)),h>=Pe)break}else R.push(new pe(s,u,u,E,!1)),o&&r&&R.push(new pe(s,u+ne,u+ne,E,!1));const N=D.x+k.left,j=D.y-He-k.top,Z=N+k.width,ie=j+k.height;let O,U,he,ce,J,ue,De,be;if(!d&&I)if(D.vertical){const S=(N+Z)/2-k.height/2,F=(j+ie)/2+k.width/2;O=new V(-F-x+T,S-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y)}else O=new V(-j+x+T,N-x+b),U=new V(O.x-A.height,O.y+A.width),he=new V(U.x,O.y),ce=new V(O.x,U.y);else O=new V(N-x+T,j-x+b),U=new V(O.x+A.width,O.y+A.height),he=new V(O.x,U.y),ce=new V(U.x,O.y);for(const S of R){let F,G,H,q;if(S.alternateVerticalGlyph){if(!J){const Y=(j+ie)/2+b;J=new V((N+Z)/2+T-k.height/2-x,Y+k.width/2+x),ue=new V(J.x+A.height,J.y-A.width),De=new V(ue.x,J.y),be=new V(J.x,ue.y)}F=J,G=De,H=be,q=ue}else F=O,G=he,H=ce,q=U;const fe=j,Ie=ie,de=S.glyphAngle+n;if(de!==0){const Y=Math.cos(de),xe=Math.sin(de);F=F.clone(),G=G?.clone(),H=H?.clone(),q=q?.clone(),F.rotate(Y,xe),q?.rotate(Y,xe),G?.rotate(Y,xe),H?.rotate(Y,xe)}let re=0,ae=256;if(d&&I?D.vertical?S.alternateVerticalGlyph?(re=32,ae=96):(re=224,ae=32):(re=224,ae=96):(re=192,ae=64),c.push(new Oe(F,H,G,q,A,S.labelAngle,re,ae,S.anchor,S.minzoom,S.maxzoom,S.page)),f&&(!M||this._legible(S.labelAngle))){if(_)Ny&&(y=Z),Ie>g&&(g=Ie);else if(S.minzoom=Pe)return null;if(f&&_){let D,B,A,k;I?(D=-g+T,B=w+b,A=g-p,k=y-w):(D=w+T,B=p+b,A=y-w,k=g-p);const E={xTile:a.x,yTile:a.y,dxPixels:D*m-l,dyPixels:B*m-l,hard:!i.optional,partIndex:1,width:A*m+2*l,height:k*m+2*l,angle:n,minLod:X,maxLod:te};f.push(E)}const L=new Fe(c);return f&&f.length>0&&(L.textColliders=f),L}_legible(a){const t=Ge(a);return t<65||t>=193}_placeGlyph(a,t,e,i,s,n,o,r,l){let h=n;const u=h<0?Ve(a.angle+ne,Ae):a.angle;let d=0;e<0&&(h*=-1,e*=-1,d=ne),h>0&&++s;let f=new V(a.x,a.y),c=i[s],x=te;if(i.length<=s)return x;for(;;){const _=c.x-f.x,w=c.y-f.y,y=Math.sqrt(_*_+w*w),p=Math.max(e/y,t),g=_/y,M=w/y,m=Ve(Math.atan2(M,g)+d,Ae);if(l.push(new pe(f,u,m,r,!1,p,x)),o&&l.push(new pe(f,u,m,r,!0,p,x)),p<=t)return p;f=c.clone();do{if(s+=h,i.length<=s||s<0)return p;c=i[s]}while(f.isEqual(c));let I=c.x-f.x,P=c.y-f.y;const T=Math.sqrt(I*I+P*P);I*=y/T,P*=y/T,f.x-=I,f.y-=P,x=p}}},ee=class extends v{constructor(){super(12)}add(a,t,e){const i=this.array;i.push(a),i.push(t),i.push(e)}},dt=class extends v{constructor(a){super(a)}add(a,t,e,i,s,n,o,r,l,h,u,d){const f=this.array;let c=v.i1616to32(a,t);f.push(c);const x=31;c=v.i8888to32(Math.round(x*e),Math.round(x*i),Math.round(x*s),Math.round(x*n)),f.push(c),c=v.i8888to32(Math.round(x*o),Math.round(x*r),Math.round(x*l),Math.round(x*h)),f.push(c),c=v.i1616to32(u,0),f.push(c),d&&f.push(...d)}},xt=class extends v{constructor(a){super(a)}add(a,t,e){const i=this.array;i.push(v.i1616to32(a,t)),e&&i.push(...e)}};class yt extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r){const l=this.array,h=this.index;let u=v.i1616to32(t,e);l.push(u);const d=15;return u=v.i8888to32(Math.round(d*i),Math.round(d*s),n,o),l.push(u),r&&l.push(...r),h}}class ze extends v{constructor(t){super(t)}add(t,e,i,s,n,o,r,l,h,u,d,f){const c=this.array;let x=v.i1616to32(t,e);c.push(x),x=v.i1616to32(Math.round(8*i),Math.round(8*s)),c.push(x),x=v.i8888to32(n/4,o/4,l,h),c.push(x),x=v.i8888to32(0,Ge(r),10*u,Math.min(10*d,255)),c.push(x),f&&c.push(...f)}}class gt extends v{constructor(t){super(t)}add(t,e,i,s,n){const o=this.array,r=v.i1616to32(2*t+i,2*e+s);o.push(r),n&&o.push(...n)}}class me{constructor(t,e,i){this.layerExtent=4096,this._features=[],this.layer=t,this.zoom=e,this._spriteInfo=i,this._filter=t.getFeatureFilter()}pushFeature(t){this._filter&&!this._filter.filter(t,this.zoom)||this._features.push(t)}hasFeatures(){return this._features.length>0}getResources(t,e,i){}}let pt=class extends me{constructor(a,t,e,i,s){super(a,t,e),this.type=_e.CIRCLE,this._circleVertexBuffer=i,this._circleIndexBuffer=s}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(a){const t=this._circleVertexBuffer,e=this._circleIndexBuffer;this._circleIndexStart=3*e.index,this._circleIndexCount=0;const i=this.layer,s=this.zoom;a&&a.setExtent(this.layerExtent);for(const n of this._features){const o=n.getGeometry(a);if(!o)continue;const r=i.circleMaterial.encodeAttributes(n,s,i);for(const l of o)if(l)for(const h of l){const u=t.index;t.add(h.x,h.y,0,0,r),t.add(h.x,h.y,0,1,r),t.add(h.x,h.y,1,0,r),t.add(h.x,h.y,1,1,r),e.add(u,u+1,u+2),e.add(u+1,u+2,u+3),this._circleIndexCount+=6}}}serialize(){let a=6;a+=this.layerUIDs.length,a+=this._circleVertexBuffer.array.length,a+=this._circleIndexBuffer.array.length;const t=new Uint32Array(a),e=new Int32Array(t.buffer);let i=0;t[i++]=this.type,t[i++]=this.layerUIDs.length;for(let s=0;sM.page-m.page);for(const{ddFillAttributes:M,ddOutlineAttributes:m,page:I,geometry:P}of c)this._processFeature(P,u,e.outlineUsesFillColor,M,m,f,I)}}else for(const c of d){const x=o?s.encodeAttributes(c,i,e):null,_=u&&r?n.encodeAttributes(c,i,e):null,w=c.getGeometry(t);this._processFeature(w,u,e.outlineUsesFillColor,x,_,f)}}serialize(){let t=10;t+=this.layerUIDs.length,t+=this._fillVertexBuffer.array.length,t+=this._fillIndexBuffer.array.length,t+=this._outlineVertexBuffer.array.length,t+=this._outlineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this._fillVertexBuffer.array.length;for(let r=0;ru?(d!==void 0&&this._processFill(t,d,s,o,r),d=[f]):c<-u&&d!==void 0&&d.push(f)}d!==void 0&&this._processFill(t,d,s,o,r)}_processOutline(t,e){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,n=s.index;let o,r,l;const h=new V(0,0),u=new V(0,0),d=new V(0,0);let f=-1,c=-1,x=-1,_=-1,w=-1,y=!1;const p=0;let g=t.length;if(g<2)return;const M=t[p];let m=t[g-1];for(;g&&m.isEqual(M);)--g,m=t[g-1];if(!(g-p<2)){for(let I=p;I8&&(L=8),T>=0?(x=i.add(r.x,r.y,h.x,h.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,L*-d.x,L*-d.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,d.x,d.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,u.x,u.y,0,1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x)):(x=i.add(r.x,r.y,L*d.x,L*d.y,0,1,e),_===-1&&(_=x),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),c=i.add(r.x,r.y,-h.x,-h.y,0,-1,e),w===-1&&(w=c),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=c,c=x,x=i.add(r.x,r.y,-d.x,-d.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x),f=i.add(r.x,r.y,-u.x,-u.y,0,-1,e),f>=0&&c>=0&&x>=0&&!P&&s.add(f,c,x))}f>=0&&c>=0&&_>=0&&!y&&s.add(f,c,_),f>=0&&_>=0&&w>=0&&!y&&s.add(f,w,_),this._outlineIndexCount+=3*(s.index-n)}}_processFill(t,e,i,s,n){s=!0;let o;e.length>1&&(o=[]);let r=0;for(const d of e)r!==0&&o.push(r),r+=t[d].length;const l=2*r,h=Be.acquire();for(const d of e){const f=t[d],c=f.length;for(let x=0;x0){const d=e.map(x=>t[x].length),{buffer:f,vertexCount:c}=tt(h,d);if(c>0){const x=this._fillVertexBuffer.index;for(let _=0;_0){const f=this._fillVertexBuffer.index;let c=0;for(;c=4160:t.y===e.y&&(t.y<=-64||t.y>=4160)}static _area(t){let e=0;const i=t.length-1;for(let s=0;sB.page-A.page),n.textured=!0;for(const{ddAttributes:B,page:A,cap:k,join:E,miterLimit:R,roundLimit:N,halfWidth:j,offset:Z,geometry:ie}of D)n.capType=k,n.joinType=E,n.miterLimit=R,n.roundLimit=N,n.halfWidth=j,n.offset=Z,this._processFeature(ie,B,A)}else{if(l){const D=l.getValue(i);if(!this._spriteInfo[D]?.rect)return}n.textured=!(!l&&!h),n.capType=x,n.joinType=p,n.miterLimit=M,n.roundLimit=I,n.halfWidth=.5*T,n.offset=L;for(const D of s){const B=o?r.encodeAttributes(D,i,e):null;c&&(n.capType=c.getValue(i,D)),y&&(n.joinType=y.getValue(i,D)),g&&(n.miterLimit=g.getValue(i,D)),m&&(n.roundLimit=m.getValue(i,D)),P&&(n.halfWidth=.5*P.getValue(i,D)),b&&(n.offset=b.getValue(i,D));const A=D.getGeometry(t);this._processFeature(A,B)}}}serialize(){let t=6;t+=this.layerUIDs.length,t+=this.tessellationProperties._lineVertexBuffer.array.length,t+=this.tessellationProperties._lineIndexBuffer.array.length,t+=3*this._patternMap.size+1;const e=new Uint32Array(t),i=new Int32Array(e.buffer);let s=0;e[s++]=this.type,e[s++]=this.layerUIDs.length;for(let r=0;r0)for(const[r,[l,h]]of n)e[s++]=r,e[s++]=l,e[s++]=h;e[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let r=0;r(t,e,i,s,n,o,r,l,h,u,d)=>(a._lineVertexBuffer.add(t,e,r,l,i,s,n,o,h,u,d,a._ddValues),a._lineVertexBuffer.index-1),wt=a=>(t,e,i)=>{a._lineIndexBuffer.add(t,e,i)},Ne=10;function Pt(a,t){return a.iconMosaicItem&&t.iconMosaicItem?a.iconMosaicItem.page===t.iconMosaicItem.page?0:a.iconMosaicItem.page-t.iconMosaicItem.page:a.iconMosaicItem&&!t.iconMosaicItem?1:!a.iconMosaicItem&&t.iconMosaicItem?-1:0}class z extends me{constructor(t,e,i,s,n,o,r,l,h){super(e,i,h.getSpriteItems()),this.type=_e.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._sourceTileKey=t,this._iconVertexBuffer=s,this._iconIndexBuffer=n,this._textVertexBuffer=o,this._textIndexBuffer=r,this._placementEngine=l,this._workerTileHandler=h}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(t,e,i){const s=this.layer,n=this.zoom;t&&t.setExtent(this.layerExtent);const o=s.getLayoutProperty("icon-image"),r=s.getLayoutProperty("text-field");let l=s.getLayoutProperty("text-transform"),h=s.getLayoutProperty("text-font");const u=[];let d,f,c,x;o&&!o.isDataDriven&&(d=o.getValue(n)),r&&!r.isDataDriven&&(f=r.getValue(n)),l&&l.isDataDriven||(c=s.getLayoutValue("text-transform",n),l=null),h&&h.isDataDriven||(x=s.getLayoutValue("text-font",n),h=null);for(const _ of this._features){const w=_.getGeometry(t);if(!w||w.length===0)continue;let y,p;o&&(y=o.isDataDriven?o.getValue(n,_):this._replaceKeys(d,_.values),y&&e(y));let g=!1;if(r&&(p=r.isDataDriven?r.getValue(n,_):this._replaceKeys(f,_.values),p)){switch(p=p.replaceAll("\\n",` `),l&&(c=l.getValue(n,_)),c){case Ee.LOWERCASE:p=p.toLowerCase();break;case Ee.UPPERCASE:p=p.toUpperCase()}if(z._bidiEngine.hasBidiChar(p)){let I;I=z._bidiEngine.checkContextual(p)==="rtl"?"IDNNN":"ICNNN",p=z._bidiEngine.bidiTransform(p,I,"VLYSN"),g=!0}if(p.length>0){h&&(x=h.getValue(n,_));for(const I of x){let P=i[I];P||(P=i[I]=new Set);for(const T of p){const b=T.codePointAt(0);b!=null&&P.add(b)}}}}if(!y&&!p)continue;const M=s.getLayoutValue("symbol-sort-key",n,_),m={feature:_,sprite:y,label:p,rtl:g,geometry:w,hash:(p?Le(p):0)^(y?Le(y):0),priority:M,textFont:x};u.push(m)}this._symbolFeatures=u}processFeatures(t){t&&t.setExtent(this.layerExtent);const e=this.layer,i=this.zoom,s=e.getLayoutValue("symbol-placement",i),n=s!==Me.POINT,o=e.getLayoutValue("symbol-spacing",i)*le,r=e.getLayoutProperty("icon-image"),l=e.getLayoutProperty("text-field"),h=r?new ot(e,i,n):null,u=l?new nt(e,i,n):null,d=this._workerTileHandler;let f;r&&(f=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 c=[];let x=1;u?.size&&(x=u.size/K);const _=u?u.maxAngle*Te:0,w=u?u.size*le:0;for(const y of this._symbolFeatures){let p;h&&f&&y.sprite&&(p=f[y.sprite],p&&p.sdf&&(this._isIconSDF=!0));let g;p&&h.update(i,y.feature);let M=0;const m=y.label;if(m){qe(u),u.update(i,y.feature);const I=n&&u.rotationAlignment===se.MAP?u.keepUpright:u.writingMode&&u.writingMode.includes(Xe.VERTICAL);let P=.5;switch(u.anchor){case C.TOP_LEFT:case C.LEFT:case C.BOTTOM_LEFT:P=0;break;case C.TOP_RIGHT:case C.RIGHT:case C.BOTTOM_RIGHT:P=1}let T=.5;switch(u.anchor){case C.TOP_LEFT:case C.TOP:case C.TOP_RIGHT:T=0;break;case C.BOTTOM_LEFT:case C.BOTTOM:case C.BOTTOM_RIGHT:T=1}let b=.5;switch(u.justify){case we.AUTO:b=P;break;case we.LEFT:b=0;break;case we.RIGHT:b=1}const L=u.letterSpacing*K,D=n?0:u.maxWidth*K,B=u.lineHeight*K,A=y.textFont.map(k=>d.getGlyphItems(k));if(g=new Ke(A,D,B,L,P,T,b).getShaping(m,y.rtl,I),g&&g.length>0){let k=1e30,E=-1e30;for(const R of g)k=Math.min(k,R.x),E=Math.max(E,R.x);M=(E-k+2*K)*x*le}}for(let I of y.geometry){const P=[];if(s===Me.LINE){if(g?.length&&u?.size){const T=u.size*le*(2+Math.min(2,4*Math.abs(u.offset[1])));I=z._smoothVertices(I,T)}z._pushAnchors(P,I,o,M)}else s===Me.LINE_CENTER?z._pushCenterAnchor(P,I):y.feature.type===Je.Polygon?z._pushCentroid(P,I):P.push(new ge(I[0].x,I[0].y));for(const T of P){if(T.x<0||T.x>Re||T.y<0||T.y>Re||n&&M>0&&u?.rotationAlignment===se.MAP&&!z._honorsTextMaxAngle(I,T,M,_,w))continue;const b={shaping:g,line:I,iconMosaicItem:p,anchor:T,symbolFeature:y,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};c.push(b),this._processFeature(b,h,u)}}}c.sort(Pt),this._addPlacedGlyphs(),this._symbolInstances=c}serialize(){let t=14;t+=this.layerUIDs.length,t+=3*this.markerPageMap.size,t+=3*this.glyphsPageMap.size,t+=z._symbolsSerializationLength(this._symbolInstances),t+=this._iconVertexBuffer.array.length,t+=this._iconIndexBuffer.array.length,t+=this._textVertexBuffer.array.length,t+=this._textIndexBuffer.array.length;const e=new Uint32Array(t),i=new Int32Array(e.buffer),s=new Float32Array(e.buffer),[n,o,r]=this._sourceTileKey.split("/");let l=0;e[l++]=this.type,e[l++]=this.layerUIDs.length;for(let h=0;hs in e?e[s]:"")}_processFeature(t,e,i){const{line:s,iconMosaicItem:n,shaping:o,anchor:r}=t,l=this.zoom,h=this.layer,u=!!n;let d=!0;u&&(d=e?.optional||!n);const f=o&&o.length>0,c=!f||i?.optional;let x,_;if(u&&(x=this._placementEngine.getIconPlacement(r,n,e)),(x||d)&&(f&&(_=this._placementEngine.getTextPlacement(r,o,s,i)),_||c)){if(x&&_||(c||d?c||_?d||x||(_=null):x=null:(x=null,_=null)),_){const w=h.hasDataDrivenText?h.textMaterial.encodeAttributes(t.symbolFeature.feature,l,h):null;if(this._storePlacedGlyphs(t,_.shapes,l,i.rotationAlignment,w),_.textColliders){t.textColliders=_.textColliders;for(const y of _.textColliders){y.minLod=Math.max(l+$(y.minLod),0),y.maxLod=Math.min(l+$(y.maxLod),25);const p=y.angle;if(p){const g=Math.cos(p),M=Math.sin(p),m=y.dxPixels*g-y.dyPixels*M,I=y.dxPixels*M+y.dyPixels*g,P=(y.dxPixels+y.width)*g-y.dyPixels*M,T=(y.dxPixels+y.width)*M+y.dyPixels*g,b=y.dxPixels*g-(y.dyPixels+y.height)*M,L=y.dxPixels*M+(y.dyPixels+y.height)*g,D=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*M,B=(y.dxPixels+y.width)*M+(y.dyPixels+y.height)*g,A=Math.min(m,P,b,D),k=Math.max(m,P,b,D),E=Math.min(I,T,L,B),R=Math.max(I,T,L,B);y.dxPixels=A,y.dyPixels=E,y.width=k-A,y.height=R-E}}}}if(x){const w=h.hasDataDrivenIcon?h.iconMaterial.encodeAttributes(t.symbolFeature.feature,l,h):null;if(this._addPlacedIcons(t,x.shapes,l,n.page,e.rotationAlignment===se.VIEWPORT,w),x.iconColliders){t.iconColliders=x.iconColliders;for(const y of x.iconColliders){y.minLod=Math.max(l+$(y.minLod),0),y.maxLod=Math.min(l+$(y.maxLod),25);const p=y.angle;if(p){const g=Math.cos(p),M=Math.sin(p),m=y.dxPixels*g-y.dyPixels*M,I=y.dxPixels*M+y.dyPixels*g,P=(y.dxPixels+y.width)*g-y.dyPixels*M,T=(y.dxPixels+y.width)*M+y.dyPixels*g,b=y.dxPixels*g-(y.dyPixels+y.height)*M,L=y.dxPixels*M+(y.dyPixels+y.height)*g,D=(y.dxPixels+y.width)*g-(y.dyPixels+y.height)*M,B=(y.dxPixels+y.width)*M+(y.dyPixels+y.height)*g,A=Math.min(m,P,b,D),k=Math.max(m,P,b,D),E=Math.min(I,T,L,B),R=Math.max(I,T,L,B);y.dxPixels=A,y.dyPixels=E,y.width=k-A,y.height=R-E}}}}}}_addPlacedIcons(t,e,i,s,n,o){const r=Math.max(i-1,0),l=this._iconVertexBuffer,h=this._iconIndexBuffer,u=this._markerMap;for(const d of e){const f=n?0:Math.max(i+$(d.minzoom),r),c=n?25:Math.min(i+$(d.maxzoom),25);if(c<=f)continue;const x=d.tl,_=d.tr,w=d.bl,y=d.br,p=d.mosaicRect,g=d.labelAngle,M=d.minAngle,m=d.maxAngle,I=d.anchor,P=l.index,T=p.x,b=p.y,L=T+p.width,D=b+p.height,B=l.index;l.add(I.x,I.y,x.x,x.y,T,b,g,M,m,f,c,o),l.add(I.x,I.y,_.x,_.y,L,b,g,M,m,f,c,o),l.add(I.x,I.y,w.x,w.y,T,D,g,M,m,f,c,o),l.add(I.x,I.y,y.x,y.y,L,D,g,M,m,f,c,o),t.iconVertexRanges.length>0&&t.iconVertexRanges[0][0]+t.iconVertexRanges[0][1]===B?t.iconVertexRanges[0][1]+=4:t.iconVertexRanges.push([B,4]),h.add(P,P+1,P+2),h.add(P+1,P+2,P+3),u.has(s)?u.get(s)[1]+=6:u.set(s,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const t=this._textVertexBuffer,e=this._textIndexBuffer,i=this._glyphMap;for(const[s,n]of this._glyphBufferDataStorage)for(const o of n){const r=t.index,l=o.symbolInstance,h=o.ddAttributes,u=t.index;t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tl[0],o.tl[1],o.xmin,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.tr[0],o.tr[1],o.xmax,o.ymin,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.bl[0],o.bl[1],o.xmin,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),t.add(o.glyphAnchor[0],o.glyphAnchor[1],o.br[0],o.br[1],o.xmax,o.ymax,o.labelAngle,o.minAngle,o.maxAngle,o.minLod,o.maxLod,h),l.textVertexRanges.length>0&&l.textVertexRanges[0][0]+l.textVertexRanges[0][1]===u?l.textVertexRanges[0][1]+=4:l.textVertexRanges.push([u,4]),e.add(r,r+1,r+2),e.add(r+1,r+2,r+3),i.has(s)?i.get(s)[1]+=6:i.set(s,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(t,e,i,s,n){const o=Math.max(i-1,0),r=s===se.VIEWPORT;let l,h,u,d,f,c,x,_,w,y,p;for(const g of e)l=r?0:Math.max(i+$(g.minzoom),o),h=r?25:Math.min(i+$(g.maxzoom),25),!(h<=l)&&(u=g.tl,d=g.tr,f=g.bl,c=g.br,x=g.labelAngle,_=g.minAngle,w=g.maxAngle,y=g.anchor,p=g.mosaicRect,this._glyphBufferDataStorage.has(g.page)||this._glyphBufferDataStorage.set(g.page,[]),this._glyphBufferDataStorage.get(g.page).push({glyphAnchor:[y.x,y.y],tl:[u.x,u.y],tr:[d.x,d.y],bl:[f.x,f.y],br:[c.x,c.y],xmin:p.x,ymin:p.y,xmax:p.x+p.width,ymax:p.y+p.height,labelAngle:x,minAngle:_,maxAngle:w,minLod:l,maxLod:h,placementLod:o,symbolInstance:t,ddAttributes:n}))}static _pushAnchors(t,e,i,s){i+=s;let n=0;const o=e.length-1;for(let f=0;f-r;){if(--h,h<0)return!1;o-=V.distance(t[h],l),l=t[h]}o+=V.distance(t[h],t[h+1]);const u=[];let d=0;const f=t.length;for(;on;)d-=u.shift().deviation;if(Math.abs(d)>s)return!1;o+=V.distance(x,w),h=_}return!0}static _smoothVertices(t,e){if(e<=0)return t;let i=t.length;if(i<3)return t;const s=[];let n=0,o=0;s.push(0);for(let _=1;_0&&(n+=w,s.push(n),o++,o!==_&&(t[o]=t[_]))}if(i=o+1,i<3)return t;e=Math.min(e,.2*n);const r=t[0].x,l=t[0].y,h=t[i-1].x,u=t[i-1].y,d=V.sub(t[0],t[1]);d.normalize(),t[0].x+=e*d.x,t[0].y+=e*d.y,d.assignSub(t[i-1],t[i-2]),d.normalize(),t[i-1].x+=e*d.x,t[i-1].y+=e*d.y,s[0]-=e,s[i-1]+=e;const f=[];f.push(new V(r,l));const c=1e-6,x=.5*e;for(let _=1;_=0;g--){const M=x+s[g+1]-s[_];if(M<0)break;const m=s[g+1]-s[g],I=s[_]-s[g]4096&&(r=4096),r<0&&(r=0),l>4096&&(l=4096),l<0&&(l=0);for(let h=1;h4096&&(u=4096),u<0&&(u=0),d>4096&&(d=4096),d<0&&(d=0),f>4096&&(f=4096),f<0&&(f=0),c>4096&&(c=4096),c<0&&(c=0);const x=(u-r)*(c-l)-(f-r)*(d-l);s+=x*(r+u+f),n+=x*(l+d+c),o+=x}s/=3*o,n/=3*o,isNaN(s)||isNaN(n)||t.push(new ge(s,n))}}z._bidiEngine=new lt;var W;(function(a){a[a.INITIALIZED=0]="INITIALIZED",a[a.NO_DATA=1]="NO_DATA",a[a.READY=2]="READY",a[a.MODIFIED=3]="MODIFIED",a[a.INVALID=4]="INVALID"})(W||(W={}));class Tt{constructor(t,e,i,s,n,o){if(this._pbfTiles={},this._tileClippers={},this._client=i,this._tile=e,this._sourceDataMaxLOD=s,o){this._styleLayerUIDs=new Set;for(const d of o)this._styleLayerUIDs.add(d)}this._styleRepository=n,this._layers=this._styleRepository?.layers??[];const[r,l,h]=e.tileKey.split("/").map(parseFloat);this._level=r;const u=Ye(this._level);for(const d of Object.keys(t)){const f=t[d];if(this._pbfTiles[d]=new Qe(new Uint8Array(f.protobuff),new DataView(f.protobuff)),f.refKey){const[c]=f.refKey.split("/").map(parseFloat),x=r-c;if(x>0){const _=(1<{o.has(u)||(n.push({name:u,repeat:d}),o.add(u))},l={};for(const u of s)u.getResources(u.tileClipper,r,l);if(this._tile.status===W.INVALID)return[];const h=this._fetchResources(n,l,t);return Promise.all([...h,e]).then(()=>this._processFeatures(i.returnedBuckets))}_initialize(t){return{signal:t?.signal,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(t){const{sourceNameToTileData:e,zoom:i,layers:s,sourceNameToTileClipper:n,sourceNameToUniqueSourceLayerBuckets:o,sourceNameToUniqueSourceLayers:r,returnedBuckets:l,layerIdToBucket:h,referencerUIDToReferencedId:u}=t,d=this._sourceDataMaxLOD;for(let f=s.length-1;f>=0;f--){const c=s[f];if(i=c.maxzoom)continue}else if(c.maxzoom&&i>=c.maxzoom)continue;if(c.type===Q.BACKGROUND||!this._canParseStyleLayer(c.uid)||!e[c.source]||!n[c.source])continue;const x=e[c.source],_=n[c.source],w=c.sourceLayer,y=x[w];if(y){let p=r[c.source];if(p||(p=r[c.source]=new Set),p.add(c.sourceLayer),c.refLayerId)u.set(c.uid,c.refLayerId);else{const g=this._createBucket(c);if(g){g.layerUIDs=[c.uid],g.layerExtent=y.extent,g.tileClipper=_;let M=o[c.source];M||(M=o[c.source]={});let m=M[w];m||(m=M[w]=[]),m.push(g),l.push(g),h[c.id]=g}}}}}_linkReferences(t){const{layerIdToBucket:e,referencerUIDToReferencedId:i}=t;i.forEach((s,n)=>{e[s]&&e[s].layerUIDs.push(n)})}_filterFeatures(t){const{signal:e,sourceNameToTileData:i,sourceNameToUniqueSourceLayerBuckets:s,sourceNameToUniqueSourceLayers:n}=t,o=10*this._level,r=10*(this._level+1),l=[],h=[];for(const u of Object.keys(n))n[u].forEach(d=>{l.push(d),h.push(u)});for(let u=0;u=r)continue;const m=g._maxzoom;if(m&&m<=o)continue}for(const M of x)M.pushFeature(p)}}}_fetchResources(t,e,i){const s=[],n=this._tile.getWorkerTileHandler();let o,r;t.length>0&&(o=n.fetchSprites(t,this._client,i),s.push(o));for(const l in e){const h=e[l];h.size>0&&(r=n.fetchGlyphs(this._tile.tileKey,l,h,this._client,i),s.push(r))}return s}_processFeatures(t){const e=t.filter(i=>i.hasFeatures()||this._canParseStyleLayer(i.layer.uid));for(const i of e)i.processFeatures(i.tileClipper);return e}_parseTileData(t){const e={};for(const i of Object.keys(t)){const s=t[i],n={};for(;s.next();)switch(s.tag()){case 3:{const o=s.getMessage(),r=new rt(o);o.release(),n[r.name]=r;break}default:s.skip()}e[i]=n}return e}_createBucket(t){switch(t.type){case Q.BACKGROUND:return null;case Q.FILL:return this._createFillBucket(t);case Q.LINE:return this._createLineBucket(t);case Q.CIRCLE:return this._createCircleBucket(t);case Q.SYMBOL:return this._createSymbolBucket(t)}}_createFillBucket(t){return new _t(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new xt(t.fillMaterial.getStride()),new ee,new yt(t.outlineMaterial.getStride()),new ee)}_createLineBucket(t){return new It(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new dt(t.lineMaterial.getStride()),new ee)}_createCircleBucket(t){return new pt(t,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new gt(t.circleMaterial.getStride()),new ee)}_createSymbolBucket(t){const e=this._tile;return new z(e.tileKey,t,this._level,new ze(t.iconMaterial.getStride()),new ee,new ze(t.textMaterial.getStride()),new ee,e.placementEngine,e.getWorkerTileHandler())}}let Dt=class{constructor(a,t,e,i){this.status=W.INITIALIZED,this.placementEngine=new ft,this.tileKey=a,this.refKeys=t,this._workerTileHandler=e,this._styleRepository=i}release(){this.tileKey="",this.refKeys=null,this.status=W.INITIALIZED,this._workerTileHandler=null}async parse(a,t){const e=t?.signal;if(e!=null){const h=()=>{e.removeEventListener("abort",h),this.status=W.INVALID};e.addEventListener("abort",h)}let i;const s={bucketsWithData:[],emptyBuckets:null};try{i=await this._parse(a,t)}catch(h){if(Ue(h))throw h;return{result:s,transferList:[]}}this.status=W.READY;const n=s.bucketsWithData,o=[];for(const h of i)if(h.hasFeatures()){const u=h.serialize();n.push(u)}else o.push(h.layer.uid);const r=[...n];let l=null;return o.length>0&&(l=Uint32Array.from(o),r.push(l.buffer)),s.emptyBuckets=l,{result:s,transferList:r}}setObsolete(){this.status=W.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(a,t){const e=a.sourceName2DataAndRefKey;return Object.keys(e).length===0?[]:(this.status=W.MODIFIED,new Tt(e,this,t.client,a.sourceDataMaxLOD,this._styleRepository,a.styleLayerUIDs).parse(t))}};const bt=25;class $t{constructor(){this._spriteInfo={},this._glyphInfo={},this._sourceDataMaxLOD=bt}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){return this._styleRepository?.layers??[]}async createTileAndParse(t,e){const{key:i}=t,s={};for(const o of Object.keys(t.sourceName2DataAndRefKey)){const r=t.sourceName2DataAndRefKey[o];s[o]=r.refKey}const n=new Dt(i,s,this,this._styleRepository);try{return await n.parse({...t,sourceDataMaxLOD:this._sourceDataMaxLOD},e)}catch(o){if(n.setObsolete(),n.release(),!Ue(o))throw o;return null}}updateStyle(t){if(!t||t.length===0||!this._styleRepository)return;const e=this._styleRepository;for(const i of t){const s=i.type,n=i.data;switch(s){case oe.PAINTER_CHANGED:e.setPaintProperties(n.layer,n.paint);break;case oe.LAYOUT_CHANGED:e.setLayoutProperties(n.layer,n.layout);break;case oe.LAYER_REMOVED:e.deleteStyleLayer(n.layer);break;case oe.LAYER_CHANGED:e.setStyleLayer(n.layer,n.index);break;case oe.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(t){const{style:e,sourceDataMaxLOD:i}=t;this._styleRepository=new at(e),this._sourceDataMaxLOD=i,this._spriteInfo={},this._glyphInfo={}}fetchSprites(t,e,i){const s=[],n=this._spriteInfo;for(const o of t)n[o.name]===void 0&&s.push(o);return s.length===0?Promise.resolve():e.invoke("getSprites",s,{signal:i?.signal}).then(o=>{for(const r in o){const l=o[r];n[r]=l}})}getSpriteItems(){return this._spriteInfo}fetchGlyphs(t,e,i,s,n){const o=[];let r=this._glyphInfo[e];return r?i.forEach(l=>{r[l]||o.push(l)}):(r=this._glyphInfo[e]=[],i.forEach(l=>o.push(l))),o.length===0?Promise.resolve():s.invoke("getGlyphs",{tileID:t,font:e,codePoints:o},n).then(l=>{for(let h=0;h{this.menuOpen=!!e.target.open},this.handleMenuActionsSlotChange=e=>{this.hasMenuActions=L(e)},this.expanded=!1,this.label=void 0,this.layout="vertical",this.columns=void 0,this.menuOpen=!1,this.overlayPositioning="absolute",this.scale=void 0,this.menuFlipPlacements=void 0,this.menuPlacement=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.hasMenuActions=!1}expandedHandler(){this.menuOpen=!1}onMessagesChange(){}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await f(this),this.el.focus()}connectedCallback(){x(this),k(this),h(this)}disconnectedCallback(){y(this),O(this),g(this)}async componentWillLoad(){v(this),await C(this)}componentDidLoad(){b(this)}renderMenu(){const{expanded:e,menuOpen:c,scale:o,layout:a,messages:n,overlayPositioning:l,hasMenuActions:r,menuFlipPlacements:m,menuPlacement:u}=this;return t("calcite-action-menu",{expanded:e,flipPlacements:m??(a==="horizontal"?["top","bottom"]:["left","right"]),hidden:!r,label:n.more,onCalciteActionMenuOpen:this.setMenuOpen,open:c,overlayPositioning:l,placement:u??(a==="horizontal"?"bottom-start":"leading-start"),scale:o},t("calcite-action",{icon:_.menu,scale:o,slot:s.trigger,text:n.more,textEnabled:e}),t("slot",{name:i.menuActions,onSlotchange:this.handleMenuActionsSlotChange}),t("slot",{name:i.menuTooltip,slot:s.tooltip}))}render(){return t("div",{key:"8143606c5745053f15140f34ff5ea375a683325f","aria-label":this.label,class:F.container,role:"group"},t("slot",{key:"e8c2821b9ce2e9d0293478989fc31d24f043f9c3"}),this.renderMenu())}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return $}},[17,"calcite-action-group",{expanded:[516],label:[1],layout:[513],columns:[514],menuOpen:[1540,"menu-open"],overlayPositioning:[513,"overlay-positioning"],scale:[513],menuFlipPlacements:[16],menuPlacement:[513,"menu-placement"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],hasMenuActions:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function D(){typeof customElements>"u"||["calcite-action-group","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-group":customElements.get(e)||customElements.define(e,S);break;case"calcite-action":customElements.get(e)||A();break;case"calcite-action-menu":customElements.get(e)||E();break;case"calcite-icon":customElements.get(e)||w();break;case"calcite-loader":customElements.get(e)||z();break;case"calcite-popover":customElements.get(e)||P();break}})}D();export{S as c,D as l,i as o}; +import{p as d,b as p,a as t}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{s as h,c as g}from"./conditionalSlot-DsCzytJ4-DM7mn4Oa.js";import{f,o as v,r as b}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{K as x,q as y}from"./locale-Cn_GDVD_-CCUxSwPB.js";import{l as M,d as k,M as O,h as C}from"./t9n-C_hcZMZJ-Du2NPCXI.js";import{_ as s,K as P,O as E}from"./action-menu-DTIJuZNc-DnQvHied.js";import{G as L}from"./dom-N58V0tYi-DBU3jlah.js";import{m as A}from"./action-GCQoufcz-DQvoWHlv.js";import{m as w}from"./icon-BXFbBbop-Bq4Zv26A.js";import{v as z}from"./loader-Ch7Jr16w-CF4bv9QO.js";const i={menuActions:"menu-actions",menuTooltip:"menu-tooltip"},_={menu:"ellipsis"},F={container:"container"},H=':host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:flex;flex-direction:column;padding:0px;background-color:transparent;border-color:var(--calcite-action-group-border-color, var(--calcite-color-border-3));border-style:solid;border-width:0}.container{display:flex;flex-grow:1;flex-direction:column}:host([columns="1"]){--calcite-internal-action-group-columns:1}:host([columns="2"]){--calcite-internal-action-group-columns:2}:host([columns="3"]){--calcite-internal-action-group-columns:3}:host([columns="4"]){--calcite-internal-action-group-columns:4}:host([columns="5"]){--calcite-internal-action-group-columns:5}:host([columns="6"]){--calcite-internal-action-group-columns:6}:host(:first-child){padding-block-start:0px}:host([layout=horizontal]),:host([layout=horizontal]) .container{flex-direction:row}:host([layout=grid]){display:grid}:host([layout=grid]) .container{display:grid;place-content:stretch;background-color:transparent;grid-template-columns:repeat(var(--calcite-action-group-columns, var(--calcite-internal-action-group-columns, 3)), auto);gap:var(--calcite-action-group-gap, 1px);padding:var(--calcite-action-group-gap, 1px)}:host([hidden]){display:none}[hidden]{display:none}',$=H,S=d(class extends p{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.setMenuOpen=e=>{this.menuOpen=!!e.target.open},this.handleMenuActionsSlotChange=e=>{this.hasMenuActions=L(e)},this.expanded=!1,this.label=void 0,this.layout="vertical",this.columns=void 0,this.menuOpen=!1,this.overlayPositioning="absolute",this.scale=void 0,this.menuFlipPlacements=void 0,this.menuPlacement=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale="",this.defaultMessages=void 0,this.hasMenuActions=!1}expandedHandler(){this.menuOpen=!1}onMessagesChange(){}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await f(this),this.el.focus()}connectedCallback(){x(this),k(this),h(this)}disconnectedCallback(){y(this),O(this),g(this)}async componentWillLoad(){v(this),await C(this)}componentDidLoad(){b(this)}renderMenu(){const{expanded:e,menuOpen:c,scale:o,layout:a,messages:n,overlayPositioning:l,hasMenuActions:r,menuFlipPlacements:m,menuPlacement:u}=this;return t("calcite-action-menu",{expanded:e,flipPlacements:m??(a==="horizontal"?["top","bottom"]:["left","right"]),hidden:!r,label:n.more,onCalciteActionMenuOpen:this.setMenuOpen,open:c,overlayPositioning:l,placement:u??(a==="horizontal"?"bottom-start":"leading-start"),scale:o},t("calcite-action",{icon:_.menu,scale:o,slot:s.trigger,text:n.more,textEnabled:e}),t("slot",{name:i.menuActions,onSlotchange:this.handleMenuActionsSlotChange}),t("slot",{name:i.menuTooltip,slot:s.tooltip}))}render(){return t("div",{key:"8143606c5745053f15140f34ff5ea375a683325f","aria-label":this.label,class:F.container,role:"group"},t("slot",{key:"e8c2821b9ce2e9d0293478989fc31d24f043f9c3"}),this.renderMenu())}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return $}},[17,"calcite-action-group",{expanded:[516],label:[1],layout:[513],columns:[514],menuOpen:[1540,"menu-open"],overlayPositioning:[513,"overlay-positioning"],scale:[513],menuFlipPlacements:[16],menuPlacement:[513,"menu-placement"],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],hasMenuActions:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function D(){typeof customElements>"u"||["calcite-action-group","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-group":customElements.get(e)||customElements.define(e,S);break;case"calcite-action":customElements.get(e)||A();break;case"calcite-action-menu":customElements.get(e)||E();break;case"calcite-icon":customElements.get(e)||w();break;case"calcite-loader":customElements.get(e)||z();break;case"calcite-popover":customElements.get(e)||P();break}})}D();export{S as c,D as l,i as o}; diff --git a/custom-toc-highlight/assets/action-menu-DTIJuZNc-C8BNxu3_.js b/custom-toc-highlight/assets/action-menu-DTIJuZNc-DnQvHied.js similarity index 97% rename from custom-toc-highlight/assets/action-menu-DTIJuZNc-C8BNxu3_.js rename to custom-toc-highlight/assets/action-menu-DTIJuZNc-DnQvHied.js index c0a6419f..93d5758b 100644 --- a/custom-toc-highlight/assets/action-menu-DTIJuZNc-C8BNxu3_.js +++ b/custom-toc-highlight/assets/action-menu-DTIJuZNc-DnQvHied.js @@ -1 +1 @@ -import{p as ue,b as fe,W as F,n as Oe,a as h,D as Ce,u as Be,m as Te}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{A as G,g as Ie,U as Fe,M as pe,j as Ae,D as Me,d as S,k as Le,c as Re,s as P,R as T}from"./dom-N58V0tYi-DBU3jlah.js";import{i as he}from"./guid-Dls486Er-CBh637k4.js";import{n as ve}from"./key-CZySMiwx-kmS7VeUz.js";import{o as me,r as be,f as ge}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{m as Ee}from"./action-GCQoufcz-CK-V5fzo.js";import{m as ye}from"./icon-BXFbBbop-BUyrjp8g.js";import{v as we}from"./loader-Ch7Jr16w-DUAf9YhQ.js";import{I as He,U as Ne,X as Se,q as ze,_ as Ge,j as J}from"./floating-ui-DKFFlLv3--KXNPa_R.js";import{p as Q}from"./openCloseComponent-BGQ6h7vg-COvbZ7sG.js";import{K as je,q as $e}from"./locale-Cn_GDVD_-Ar3RKmd3.js";import{l as Ke,d as _e,h as Ue,M as qe}from"./t9n-C_hcZMZJ-D4zmKT16.js";import{c as We}from"./observers-BigwqTsw-BNRQivHR.js";import{$ as Ve}from"./FloatingArrow-BG9llDYg-iM1y-TMJ.js";import{e as Xe}from"./component-CWGf1hug-BASJpoEG.js";function Ye(e,t,n){return(t=Qe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function ee(e){for(var t=1;t0){var n=e[e.length-1];n!==t&&n.pause()}var s=e.indexOf(t);s===-1||e.splice(s,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Ze=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},et=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},A=function(e){return e?.key==="Tab"||e?.keyCode===9},tt=function(e){return A(e)&&!e.shiftKey},nt=function(e){return A(e)&&e.shiftKey},ne=function(e){return setTimeout(e,0)},ie=function(e,t){var n=-1;return e.every(function(s,r){return t(s)?(n=r,!1):!0}),n},I=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s1?c-1:0),l=1;l=0)i=n.activeElement;else{var o=a.tabbableGroups[0],c=o&&o.firstTabbableNode;i=c||y("fallbackFocus")}if(!i)throw new Error("Your focus-trap needs to have at least one focusable element");return i},O=function(){if(a.containerGroups=a.containers.map(function(i){var o=Le(i,r.tabbableOptions),c=Re(i,r.tabbableOptions),d=o.length>0?o[0]:void 0,l=o.length>0?o[o.length-1]:void 0,u=c.find(function(p){return P(p)}),f=c.slice().reverse().find(function(p){return P(p)}),b=!!o.find(function(p){return T(p)>0});return{container:i,tabbableNodes:o,focusableNodes:c,posTabIndexesFound:b,firstTabbableNode:d,lastTabbableNode:l,firstDomTabbableNode:u,lastDomTabbableNode:f,nextTabbableNode:function(p){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=o.indexOf(p);return B<0?x?c.slice(c.indexOf(p)+1).find(function(w){return P(w)}):c.slice(0,c.indexOf(p)).reverse().find(function(w){return P(w)}):o[B+(x?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(i){return i.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!y("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(i){return i.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},j=function(i){var o=i.activeElement;if(o)return o.shadowRoot&&o.shadowRoot.activeElement!==null?j(o.shadowRoot):o},k=function(i){if(i!==!1&&i!==j(document)){if(!i||!i.focus){k(D());return}i.focus({preventScroll:!!r.preventScroll}),a.mostRecentlyFocusedNode=i,Ze(i)&&i.select()}},$=function(i){var o=y("setReturnFocus",i);return o||(o===!1?!1:i)},K=function(i){var o=i.target,c=i.event,d=i.isBackward,l=d===void 0?!1:d;o=o||L(c),O();var u=null;if(a.tabbableGroups.length>0){var f=g(o,c),b=f>=0?a.containerGroups[f]:void 0;if(f<0)l?u=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:u=a.tabbableGroups[0].firstTabbableNode;else if(l){var p=ie(a.tabbableGroups,function(H){var N=H.firstTabbableNode;return o===N});if(p<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o,!1))&&(p=f),p>=0){var x=p===0?a.tabbableGroups.length-1:p-1,B=a.tabbableGroups[x];u=T(o)>=0?B.lastTabbableNode:B.lastDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o,!1))}else{var w=ie(a.tabbableGroups,function(H){var N=H.lastTabbableNode;return o===N});if(w<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o))&&(w=f),w>=0){var De=w===a.tabbableGroups.length-1?0:w+1,Y=a.tabbableGroups[De];u=T(o)>=0?Y.firstTabbableNode:Y.firstDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o))}}else u=y("fallbackFocus");return u},M=function(i){var o=L(i);if(!(g(o,i)>=0)){if(I(r.clickOutsideDeactivates,i)){m.deactivate({returnFocus:r.returnFocusOnDeactivate});return}I(r.allowOutsideClick,i)||i.preventDefault()}},_=function(i){var o=L(i),c=g(o,i)>=0;if(c||o instanceof Document)c&&(a.mostRecentlyFocusedNode=o);else{i.stopImmediatePropagation();var d,l=!0;if(a.mostRecentlyFocusedNode)if(T(a.mostRecentlyFocusedNode)>0){var u=g(a.mostRecentlyFocusedNode),f=a.containerGroups[u].tabbableNodes;if(f.length>0){var b=f.findIndex(function(p){return p===a.mostRecentlyFocusedNode});b>=0&&(r.isKeyForward(a.recentNavEvent)?b+1=0&&(d=f[b-1],l=!1))}}else a.containerGroups.some(function(p){return p.tabbableNodes.some(function(x){return T(x)>0})})||(l=!1);else l=!1;l&&(d=K({target:a.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(a.recentNavEvent)})),k(d||a.mostRecentlyFocusedNode||D())}a.recentNavEvent=void 0},xe=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=i;var c=K({event:i,isBackward:o});c&&(A(i)&&i.preventDefault(),k(c))},U=function(i){(r.isKeyForward(i)||r.isKeyBackward(i))&&xe(i,r.isKeyBackward(i))},q=function(i){et(i)&&I(r.escapeDeactivates,i)!==!1&&(i.preventDefault(),m.deactivate())},W=function(i){var o=L(i);g(o,i)>=0||I(r.clickOutsideDeactivates,i)||I(r.allowOutsideClick,i)||(i.preventDefault(),i.stopImmediatePropagation())},V=function(){if(a.active)return te.activateTrap(s,m),a.delayInitialFocusTimer=r.delayInitialFocus?ne(function(){k(D())}):k(D()),n.addEventListener("focusin",_,!0),n.addEventListener("mousedown",M,{capture:!0,passive:!1}),n.addEventListener("touchstart",M,{capture:!0,passive:!1}),n.addEventListener("click",W,{capture:!0,passive:!1}),n.addEventListener("keydown",U,{capture:!0,passive:!1}),n.addEventListener("keydown",q),m},X=function(){if(a.active)return n.removeEventListener("focusin",_,!0),n.removeEventListener("mousedown",M,!0),n.removeEventListener("touchstart",M,!0),n.removeEventListener("click",W,!0),n.removeEventListener("keydown",U,!0),n.removeEventListener("keydown",q),m},Pe=function(i){var o=i.some(function(c){var d=Array.from(c.removedNodes);return d.some(function(l){return l===a.mostRecentlyFocusedNode})});o&&k(D())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(Pe):void 0,C=function(){R&&(R.disconnect(),a.active&&!a.paused&&a.containers.map(function(i){R.observe(i,{subtree:!0,childList:!0})}))};return m={get active(){return a.active},get paused(){return a.paused},activate:function(i){if(a.active)return this;var o=v(i,"onActivate"),c=v(i,"onPostActivate"),d=v(i,"checkCanFocusTrap");d||O(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=n.activeElement,o?.();var l=function(){d&&O(),V(),C(),c?.()};return d?(d(a.containers.concat()).then(l,l),this):(l(),this)},deactivate:function(i){if(!a.active)return this;var o=ee({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},i);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,X(),a.active=!1,a.paused=!1,C(),te.deactivateTrap(s,m);var c=v(o,"onDeactivate"),d=v(o,"onPostDeactivate"),l=v(o,"checkCanReturnFocus"),u=v(o,"returnFocus","returnFocusOnDeactivate");c?.();var f=function(){ne(function(){u&&k($(a.nodeFocusedBeforeActivation)),d?.()})};return u&&l?(l($(a.nodeFocusedBeforeActivation)).then(f,f),this):(f(),this)},pause:function(i){if(a.paused||!a.active)return this;var o=v(i,"onPause"),c=v(i,"onPostPause");return a.paused=!0,o?.(),X(),C(),c?.(),this},unpause:function(i){if(!a.paused||!a.active)return this;var o=v(i,"onUnpause"),c=v(i,"onPostUnpause");return a.paused=!1,o?.(),O(),V(),C(),c?.(),this},updateContainerElements:function(i){var o=[].concat(i).filter(Boolean);return a.containers=o.map(function(c){return typeof c=="string"?n.querySelector(c):c}),a.active&&O(),C(),this}},m.updateContainerElements(e),m};function at(e,t){const{el:n}=e,s=n;if(!s)return;const r={clickOutsideDeactivates:!0,escapeDeactivates:!1,fallbackFocus:s,setReturnFocus:a=>(pe(a),!1),...t?.focusTrapOptions,document:n.ownerDocument,tabbableOptions:Ae,trapStack:Te};e.focusTrap=ot(s,r)}function oe(e,t){e.focusTrapDisabled||e.focusTrap?.activate(t)}function z(e,t){e.focusTrap?.deactivate(t)}function rt(e){e.focusTrap?.updateContainerElements(e.el)}function ae(e,t){return(e+t)%t}const st=(e,t)=>{const n=e.level?`h${e.level}`:"div";return delete e.level,h(n,{class:e.class,key:e.key},t)};class ct{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=t=>{const{registeredElements:n}=this,s=t.find(r=>n.has(r));return n.get(s)},this.togglePopovers=t=>{const n=t.composedPath(),s=this.queryPopover(n);s&&!s.triggerDisabled&&(s.open=!s.open),Array.from(this.registeredElements.values()).filter(r=>r!==s&&r.autoClose&&r.open&&!n.includes(r)).forEach(r=>r.open=!1)},this.keyDownHandler=t=>{t.defaultPrevented||(t.key==="Escape"?this.closeAllPopovers():ve(t.key)&&this.togglePopovers(t))},this.clickHandler=t=>{Me(t)||this.togglePopovers(t)}}registerElement(t,n){this.registeredElementCount++,this.registeredElements.set(t,n),this.registeredElementCount===1&&this.addListeners()}unregisterElement(t){this.registeredElements.delete(t)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(t=>t.open=!1)}addListeners(){window.addEventListener("click",this.clickHandler),window.addEventListener("keydown",this.keyDownHandler)}removeListeners(){window.removeEventListener("click",this.clickHandler),window.removeEventListener("keydown",this.keyDownHandler)}}const E={container:"container",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContainer:"headerContainer",headerContent:"header-content",heading:"heading"},lt="auto",re="aria-controls",se="aria-expanded",dt=":host{--calcite-floating-ui-z-index:var(--calcite-popover-z-index, var(--calcite-z-index-popup));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]) .heading{padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding-inline:1.25rem;padding-block:1rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-floating-ui-anim{border-width:1px;border-style:solid;background-color:var(--calcite-popover-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-popover-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round))}.calcite-floating-ui-arrow{fill:var(--calcite-popover-background-color, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-block-end-width:1px;border-style:solid;border-block-end-color:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.heading{margin:0px;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer{position:relative;display:flex;block-size:100%;flex-direction:row;flex-wrap:nowrap;border-radius:0.25rem;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer.has-header{flex-direction:column}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));border-end-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));--calcite-action-corner-radius-start-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp));--calcite-action-corner-radius-end-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp))}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%}:host([hidden]){display:none}[hidden]{display:none}",ut=dt,ce=new ct,ft=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePopoverBeforeClose=F(this,"calcitePopoverBeforeClose",6),this.calcitePopoverClose=F(this,"calcitePopoverClose",6),this.calcitePopoverBeforeOpen=F(this,"calcitePopoverBeforeOpen",6),this.calcitePopoverOpen=F(this,"calcitePopoverOpen",6),this.mutationObserver=We("mutation",()=>this.updateFocusTrapElements()),this.guid=`calcite-popover-${he()}`,this.openTransitionProp="opacity",this.hasLoaded=!1,this.setTransitionEl=e=>{this.transitionEl=e},this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?He(t,e):null},this.setUpReferenceElement=(e=!0)=>{this.removeReferences(),this.effectiveReferenceElement=this.getReferenceElement(),Ne(this,this.effectiveReferenceElement,this.el);const{el:t,referenceElement:n,effectiveReferenceElement:s}=this;e&&n&&!s&&console.warn(`${t.tagName}: reference-element id "${n}" was not found.`,{el:t}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.setExpandedAttr=()=>{const{effectiveReferenceElement:e,open:t}=this;e&&"setAttribute"in e&&e.setAttribute(se,G(t))},this.addReferences=()=>{const{effectiveReferenceElement:e}=this;if(!e)return;const t=this.getId();"setAttribute"in e&&e.setAttribute(re,t),ce.registerElement(e,this.el),this.setExpandedAttr()},this.removeReferences=()=>{const{effectiveReferenceElement:e}=this;e&&("removeAttribute"in e&&(e.removeAttribute(re),e.removeAttribute(se)),ce.unregisterElement(e))},this.hide=()=>{this.open=!1},this.storeArrowEl=e=>{this.arrowEl=e,this.reposition(!0)},this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.pointerDisabled=!1,this.flipPlacements=void 0,this.heading=void 0,this.headingLevel=void 0,this.label=void 0,this.messageOverrides=void 0,this.messages=void 0,this.offsetDistance=Se,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=lt,this.referenceElement=void 0,this.scale="m",this.triggerDisabled=!1,this.effectiveLocale="",this.floatingLayout="vertical",this.effectiveReferenceElement=void 0,this.defaultMessages=void 0}handleFocusTrapDisabled(e){this.open&&(e?z(this):oe(this))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){Q(this),this.reposition(!0),this.setExpandedAttr()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}effectiveLocaleChange(){Ke(this,this.effectiveLocale)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),je(this),_e(this),at(this),requestAnimationFrame(()=>this.setUpReferenceElement(this.hasLoaded))}async componentWillLoad(){await Ue(this),me(this)}componentDidLoad(){be(this),this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.open&&Q(this),this.hasLoaded=!0}disconnectedCallback(){this.mutationObserver?.disconnect(),this.removeReferences(),$e(this),qe(this),ze(this,this.effectiveReferenceElement,this.el),z(this)}async reposition(e=!1){const{el:t,effectiveReferenceElement:n,placement:s,overlayPositioning:r,flipDisabled:a,filteredFlipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y}=this;return Ge(this,{floatingEl:t,referenceEl:n,overlayPositioning:r,placement:s,flipDisabled:a,flipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y,type:"popover"},e)}async setFocus(){await ge(this),Oe(this.el),Ie(this.el)}async updateFocusTrapElements(){rt(this)}getReferenceElement(){const{referenceElement:e,el:t}=this;return(typeof e=="string"?Fe(t,{id:e}):e)||null}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),oe(this)}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),z(this)}renderCloseButton(){const{messages:e,closable:t}=this;return t?h("div",{class:E.closeButtonContainer,key:E.closeButtonContainer},h("calcite-action",{appearance:"transparent",class:E.closeButton,onClick:this.hide,ref:n=>this.closeButtonEl=n,scale:this.scale,text:e.close},h("calcite-icon",{icon:"x",scale:Xe(this.scale)}))):null}renderHeader(){const{heading:e,headingLevel:t}=this,n=e?h(st,{class:E.heading,level:t},e):null;return n?h("div",{class:E.header,key:E.header},n,this.renderCloseButton()):null}render(){const{effectiveReferenceElement:e,heading:t,label:n,open:s,pointerDisabled:r,floatingLayout:a}=this,m=e&&s,v=!m,g=r?null:h(Ve,{floatingLayout:a,key:"floating-arrow",ref:this.storeArrowEl});return h(Ce,{key:"a563d48090d6e6c0c138023e169667834f657c4c","aria-hidden":G(v),"aria-label":n,"aria-live":"polite","calcite-hydrated-hidden":v,id:this.getId(),role:"dialog"},h("div",{key:"73053dbdce2cfc68fcd42667089d611e81010955",class:{[E.container]:!0,[J.animation]:!0,[J.animationActive]:m},ref:this.setTransitionEl},g,h("div",{key:"1fbcd45ee42b10a67881ced74db2db051231c94d",class:{[E.hasHeader]:!!t,[E.headerContainer]:!0}},this.renderHeader(),h("div",{key:"522abe801b98787863aac14d990b948d2d286156",class:E.content},h("slot",{key:"022a8f690288acdbac4ec1b3eccf807ffe382d5d"})),t?null:this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return ut}},[1,"calcite-popover",{autoClose:[516,"auto-close"],closable:[516],flipDisabled:[516,"flip-disabled"],focusTrapDisabled:[516,"focus-trap-disabled"],pointerDisabled:[516,"pointer-disabled"],flipPlacements:[16],heading:[1],headingLevel:[514,"heading-level"],label:[1],messageOverrides:[1040],messages:[1040],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],scale:[513],triggerDisabled:[516,"trigger-disabled"],effectiveLocale:[32],floatingLayout:[32],effectiveReferenceElement:[32],defaultMessages:[32],reposition:[64],setFocus:[64],updateFocusTrapElements:[64]},void 0,{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}]);function ke(){typeof customElements>"u"||["calcite-popover","calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-popover":customElements.get(e)||customElements.define(e,ft);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break}})}ke();const le={menu:"menu",defaultTrigger:"default-trigger"},de={tooltip:"tooltip",trigger:"trigger"},pt={menu:"ellipsis"},ht="data-active",vt=":host{box-sizing:border-box;display:flex;flex-direction:column;font-size:var(--calcite-font-size-1)}::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{display:flex;max-block-size:45vh;flex-direction:column;flex-wrap:nowrap;overflow-y:auto;overflow-x:hidden;outline:2px solid transparent;outline-offset:2px;gap:var(--calcite-action-menu-items-space, 0)}:host([hidden]){display:none}[hidden]{display:none}",mt=vt,bt=["ArrowUp","ArrowDown","End","Home"],gt=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionMenuOpen=F(this,"calciteActionMenuOpen",6),this.actionElements=[],this.guid=`calcite-action-menu-${he()}`,this.menuId=`${this.guid}-menu`,this.menuButtonId=`${this.guid}-menu-button`,this.connectMenuButtonEl=()=>{const{menuButtonId:e,menuId:t,open:n,label:s}=this,r=this.slottedMenuButtonEl||this.defaultMenuButtonEl;this.menuButtonEl!==r&&(this.disconnectMenuButtonEl(),this.menuButtonEl=r,this.setTooltipReferenceElement(),r&&(r.active=n,r.setAttribute("aria-controls",t),r.setAttribute("aria-expanded",G(n)),r.setAttribute("aria-haspopup","true"),r.id||(r.id=e),r.label||(r.label=s),r.text||(r.text=s),r.addEventListener("click",this.menuButtonClick),r.addEventListener("keydown",this.menuButtonKeyDown)))},this.disconnectMenuButtonEl=()=>{const{menuButtonEl:e}=this;e&&(e.removeEventListener("click",this.menuButtonClick),e.removeEventListener("keydown",this.menuButtonKeyDown))},this.setMenuButtonEl=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-action"));this.slottedMenuButtonEl=t[0],this.connectMenuButtonEl()},this.setDefaultMenuButtonEl=e=>{this.defaultMenuButtonEl=e,this.connectMenuButtonEl()},this.handleCalciteActionClick=()=>{this.open=!1,this.setFocus()},this.menuButtonClick=()=>{this.toggleOpen()},this.updateTooltip=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-tooltip"));this.tooltipEl=t[0],this.setTooltipReferenceElement()},this.setTooltipReferenceElement=()=>{const{tooltipEl:e,expanded:t,menuButtonEl:n,open:s}=this;e&&(e.referenceElement=!t&&!s?n:null)},this.updateAction=(e,t)=>{const{guid:n,activeMenuItemIndex:s}=this,r=`${n}-action-${t}`;e.tabIndex=-1,e.setAttribute("role","menuitem"),e.id||(e.id=r),e.toggleAttribute(ht,t===s)},this.updateActions=e=>{e?.forEach(this.updateAction)},this.handleDefaultSlotChange=e=>{const t=e.target.assignedElements({flatten:!0}).reduce((n,s)=>s?.matches("calcite-action")?(n.push(s),n):s?.matches("calcite-action-group")?n.concat(Array.from(s.querySelectorAll("calcite-action"))):n,[]);this.actionElements=t.filter(n=>!n.disabled&&!n.hidden)},this.menuButtonKeyDown=e=>{const{key:t}=e,{actionElements:n,activeMenuItemIndex:s,open:r}=this;if(n.length){if(ve(t)){if(e.preventDefault(),!r){this.toggleOpen();return}const a=n[s];a?a.click():this.toggleOpen(!1)}if(t==="Tab"){this.open=!1;return}if(t==="Escape"){this.toggleOpen(!1),e.preventDefault();return}this.handleActionNavigation(e,t,n)}},this.handleActionNavigation=(e,t,n)=>{if(!this.isValidKey(t,bt))return;if(e.preventDefault(),!this.open){this.toggleOpen(),(t==="Home"||t==="ArrowDown")&&(this.activeMenuItemIndex=0),(t==="End"||t==="ArrowUp")&&(this.activeMenuItemIndex=n.length-1);return}t==="Home"&&(this.activeMenuItemIndex=0),t==="End"&&(this.activeMenuItemIndex=n.length-1);const s=this.activeMenuItemIndex;t==="ArrowUp"&&(this.activeMenuItemIndex=ae(Math.max(s-1,-1),n.length)),t==="ArrowDown"&&(this.activeMenuItemIndex=ae(s+1,n.length))},this.toggleOpenEnd=()=>{this.setFocus(),this.el.removeEventListener("calcitePopoverOpen",this.toggleOpenEnd)},this.toggleOpen=(e=!this.open)=>{this.el.addEventListener("calcitePopoverOpen",this.toggleOpenEnd),this.open=e},this.handlePopoverOpen=()=>{this.open=!0},this.handlePopoverClose=()=>{this.open=!1},this.appearance="solid",this.expanded=!1,this.flipPlacements=void 0,this.label=void 0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.scale=void 0,this.menuButtonEl=void 0,this.activeMenuItemIndex=-1}connectedCallback(){this.connectMenuButtonEl()}componentWillLoad(){me(this)}componentDidLoad(){be(this)}disconnectedCallback(){this.disconnectMenuButtonEl()}expandedHandler(){this.open=!1,this.setTooltipReferenceElement()}openHandler(e){this.activeMenuItemIndex=this.open?0:-1,this.menuButtonEl&&(this.menuButtonEl.active=e),this.calciteActionMenuOpen.emit(),this.setTooltipReferenceElement()}activeMenuItemIndexHandler(){this.updateActions(this.actionElements)}async setFocus(){return await ge(this),pe(this.menuButtonEl)}renderMenuButton(){const{appearance:e,label:t,scale:n,expanded:s}=this;return h("slot",{name:de.trigger,onSlotchange:this.setMenuButtonEl},h("calcite-action",{appearance:e,class:le.defaultTrigger,icon:pt.menu,ref:this.setDefaultMenuButtonEl,scale:n,text:t,textEnabled:s}))}renderMenuItems(){const{actionElements:e,activeMenuItemIndex:t,open:n,menuId:s,menuButtonEl:r,label:a,placement:m,overlayPositioning:v,flipPlacements:g}=this,y=e[t]?.id||null;return h("calcite-popover",{autoClose:!0,flipPlacements:g,focusTrapDisabled:!0,label:a,offsetDistance:0,onCalcitePopoverClose:this.handlePopoverClose,onCalcitePopoverOpen:this.handlePopoverOpen,open:n,overlayPositioning:v,placement:m,pointerDisabled:!0,referenceElement:r},h("div",{"aria-activedescendant":y,"aria-labelledby":r?.id,class:le.menu,id:s,onClick:this.handleCalciteActionClick,role:"menu",tabIndex:-1},h("slot",{onSlotchange:this.handleDefaultSlotChange})))}render(){return h(Be,{key:"d13aa4f3d43fb5651c0487ccfa456813f69955d2"},this.renderMenuButton(),this.renderMenuItems(),h("slot",{key:"b63d187516c766db6a1b1db3df34050fdec9e6ce",name:de.tooltip,onSlotchange:this.updateTooltip}))}isValidKey(e,t){return!!t.find(n=>n===e)}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}}static get style(){return mt}},[1,"calcite-action-menu",{appearance:[513],expanded:[516],flipPlacements:[16],label:[1],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],scale:[513],menuButtonEl:[32],activeMenuItemIndex:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}]);function Et(){typeof customElements>"u"||["calcite-action-menu","calcite-action","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-menu":customElements.get(e)||customElements.define(e,gt);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break;case"calcite-popover":customElements.get(e)||ke();break}})}Et();export{rt as E,z as H,ke as K,Et as O,de as _,at as g,oe as j,st as w}; +import{p as ue,b as fe,W as F,n as Oe,a as h,D as Ce,u as Be,m as Te}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{A as G,g as Ie,U as Fe,M as pe,j as Ae,D as Me,d as S,k as Le,c as Re,s as P,R as T}from"./dom-N58V0tYi-DBU3jlah.js";import{i as he}from"./guid-Dls486Er-CBh637k4.js";import{n as ve}from"./key-CZySMiwx-kmS7VeUz.js";import{o as me,r as be,f as ge}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{m as Ee}from"./action-GCQoufcz-DQvoWHlv.js";import{m as ye}from"./icon-BXFbBbop-Bq4Zv26A.js";import{v as we}from"./loader-Ch7Jr16w-CF4bv9QO.js";import{I as He,U as Ne,X as Se,q as ze,_ as Ge,j as J}from"./floating-ui-DKFFlLv3-8lk8tQD2.js";import{p as Q}from"./openCloseComponent-BGQ6h7vg-BO0gc3O8.js";import{K as je,q as $e}from"./locale-Cn_GDVD_-CCUxSwPB.js";import{l as Ke,d as _e,h as Ue,M as qe}from"./t9n-C_hcZMZJ-Du2NPCXI.js";import{c as We}from"./observers-BigwqTsw-CfIXp3Nz.js";import{$ as Ve}from"./FloatingArrow-BG9llDYg-Ct2kNlPu.js";import{e as Xe}from"./component-CWGf1hug-BASJpoEG.js";function Ye(e,t,n){return(t=Qe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function ee(e){for(var t=1;t0){var n=e[e.length-1];n!==t&&n.pause()}var s=e.indexOf(t);s===-1||e.splice(s,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},Ze=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},et=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},A=function(e){return e?.key==="Tab"||e?.keyCode===9},tt=function(e){return A(e)&&!e.shiftKey},nt=function(e){return A(e)&&e.shiftKey},ne=function(e){return setTimeout(e,0)},ie=function(e,t){var n=-1;return e.every(function(s,r){return t(s)?(n=r,!1):!0}),n},I=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s1?c-1:0),l=1;l=0)i=n.activeElement;else{var o=a.tabbableGroups[0],c=o&&o.firstTabbableNode;i=c||y("fallbackFocus")}if(!i)throw new Error("Your focus-trap needs to have at least one focusable element");return i},O=function(){if(a.containerGroups=a.containers.map(function(i){var o=Le(i,r.tabbableOptions),c=Re(i,r.tabbableOptions),d=o.length>0?o[0]:void 0,l=o.length>0?o[o.length-1]:void 0,u=c.find(function(p){return P(p)}),f=c.slice().reverse().find(function(p){return P(p)}),b=!!o.find(function(p){return T(p)>0});return{container:i,tabbableNodes:o,focusableNodes:c,posTabIndexesFound:b,firstTabbableNode:d,lastTabbableNode:l,firstDomTabbableNode:u,lastDomTabbableNode:f,nextTabbableNode:function(p){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,B=o.indexOf(p);return B<0?x?c.slice(c.indexOf(p)+1).find(function(w){return P(w)}):c.slice(0,c.indexOf(p)).reverse().find(function(w){return P(w)}):o[B+(x?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(i){return i.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!y("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(i){return i.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},j=function(i){var o=i.activeElement;if(o)return o.shadowRoot&&o.shadowRoot.activeElement!==null?j(o.shadowRoot):o},k=function(i){if(i!==!1&&i!==j(document)){if(!i||!i.focus){k(D());return}i.focus({preventScroll:!!r.preventScroll}),a.mostRecentlyFocusedNode=i,Ze(i)&&i.select()}},$=function(i){var o=y("setReturnFocus",i);return o||(o===!1?!1:i)},K=function(i){var o=i.target,c=i.event,d=i.isBackward,l=d===void 0?!1:d;o=o||L(c),O();var u=null;if(a.tabbableGroups.length>0){var f=g(o,c),b=f>=0?a.containerGroups[f]:void 0;if(f<0)l?u=a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:u=a.tabbableGroups[0].firstTabbableNode;else if(l){var p=ie(a.tabbableGroups,function(H){var N=H.firstTabbableNode;return o===N});if(p<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o,!1))&&(p=f),p>=0){var x=p===0?a.tabbableGroups.length-1:p-1,B=a.tabbableGroups[x];u=T(o)>=0?B.lastTabbableNode:B.lastDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o,!1))}else{var w=ie(a.tabbableGroups,function(H){var N=H.lastTabbableNode;return o===N});if(w<0&&(b.container===o||S(o,r.tabbableOptions)&&!P(o,r.tabbableOptions)&&!b.nextTabbableNode(o))&&(w=f),w>=0){var De=w===a.tabbableGroups.length-1?0:w+1,Y=a.tabbableGroups[De];u=T(o)>=0?Y.firstTabbableNode:Y.firstDomTabbableNode}else A(c)||(u=b.nextTabbableNode(o))}}else u=y("fallbackFocus");return u},M=function(i){var o=L(i);if(!(g(o,i)>=0)){if(I(r.clickOutsideDeactivates,i)){m.deactivate({returnFocus:r.returnFocusOnDeactivate});return}I(r.allowOutsideClick,i)||i.preventDefault()}},_=function(i){var o=L(i),c=g(o,i)>=0;if(c||o instanceof Document)c&&(a.mostRecentlyFocusedNode=o);else{i.stopImmediatePropagation();var d,l=!0;if(a.mostRecentlyFocusedNode)if(T(a.mostRecentlyFocusedNode)>0){var u=g(a.mostRecentlyFocusedNode),f=a.containerGroups[u].tabbableNodes;if(f.length>0){var b=f.findIndex(function(p){return p===a.mostRecentlyFocusedNode});b>=0&&(r.isKeyForward(a.recentNavEvent)?b+1=0&&(d=f[b-1],l=!1))}}else a.containerGroups.some(function(p){return p.tabbableNodes.some(function(x){return T(x)>0})})||(l=!1);else l=!1;l&&(d=K({target:a.mostRecentlyFocusedNode,isBackward:r.isKeyBackward(a.recentNavEvent)})),k(d||a.mostRecentlyFocusedNode||D())}a.recentNavEvent=void 0},xe=function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;a.recentNavEvent=i;var c=K({event:i,isBackward:o});c&&(A(i)&&i.preventDefault(),k(c))},U=function(i){(r.isKeyForward(i)||r.isKeyBackward(i))&&xe(i,r.isKeyBackward(i))},q=function(i){et(i)&&I(r.escapeDeactivates,i)!==!1&&(i.preventDefault(),m.deactivate())},W=function(i){var o=L(i);g(o,i)>=0||I(r.clickOutsideDeactivates,i)||I(r.allowOutsideClick,i)||(i.preventDefault(),i.stopImmediatePropagation())},V=function(){if(a.active)return te.activateTrap(s,m),a.delayInitialFocusTimer=r.delayInitialFocus?ne(function(){k(D())}):k(D()),n.addEventListener("focusin",_,!0),n.addEventListener("mousedown",M,{capture:!0,passive:!1}),n.addEventListener("touchstart",M,{capture:!0,passive:!1}),n.addEventListener("click",W,{capture:!0,passive:!1}),n.addEventListener("keydown",U,{capture:!0,passive:!1}),n.addEventListener("keydown",q),m},X=function(){if(a.active)return n.removeEventListener("focusin",_,!0),n.removeEventListener("mousedown",M,!0),n.removeEventListener("touchstart",M,!0),n.removeEventListener("click",W,!0),n.removeEventListener("keydown",U,!0),n.removeEventListener("keydown",q),m},Pe=function(i){var o=i.some(function(c){var d=Array.from(c.removedNodes);return d.some(function(l){return l===a.mostRecentlyFocusedNode})});o&&k(D())},R=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(Pe):void 0,C=function(){R&&(R.disconnect(),a.active&&!a.paused&&a.containers.map(function(i){R.observe(i,{subtree:!0,childList:!0})}))};return m={get active(){return a.active},get paused(){return a.paused},activate:function(i){if(a.active)return this;var o=v(i,"onActivate"),c=v(i,"onPostActivate"),d=v(i,"checkCanFocusTrap");d||O(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=n.activeElement,o?.();var l=function(){d&&O(),V(),C(),c?.()};return d?(d(a.containers.concat()).then(l,l),this):(l(),this)},deactivate:function(i){if(!a.active)return this;var o=ee({onDeactivate:r.onDeactivate,onPostDeactivate:r.onPostDeactivate,checkCanReturnFocus:r.checkCanReturnFocus},i);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,X(),a.active=!1,a.paused=!1,C(),te.deactivateTrap(s,m);var c=v(o,"onDeactivate"),d=v(o,"onPostDeactivate"),l=v(o,"checkCanReturnFocus"),u=v(o,"returnFocus","returnFocusOnDeactivate");c?.();var f=function(){ne(function(){u&&k($(a.nodeFocusedBeforeActivation)),d?.()})};return u&&l?(l($(a.nodeFocusedBeforeActivation)).then(f,f),this):(f(),this)},pause:function(i){if(a.paused||!a.active)return this;var o=v(i,"onPause"),c=v(i,"onPostPause");return a.paused=!0,o?.(),X(),C(),c?.(),this},unpause:function(i){if(!a.paused||!a.active)return this;var o=v(i,"onUnpause"),c=v(i,"onPostUnpause");return a.paused=!1,o?.(),O(),V(),C(),c?.(),this},updateContainerElements:function(i){var o=[].concat(i).filter(Boolean);return a.containers=o.map(function(c){return typeof c=="string"?n.querySelector(c):c}),a.active&&O(),C(),this}},m.updateContainerElements(e),m};function at(e,t){const{el:n}=e,s=n;if(!s)return;const r={clickOutsideDeactivates:!0,escapeDeactivates:!1,fallbackFocus:s,setReturnFocus:a=>(pe(a),!1),...t?.focusTrapOptions,document:n.ownerDocument,tabbableOptions:Ae,trapStack:Te};e.focusTrap=ot(s,r)}function oe(e,t){e.focusTrapDisabled||e.focusTrap?.activate(t)}function z(e,t){e.focusTrap?.deactivate(t)}function rt(e){e.focusTrap?.updateContainerElements(e.el)}function ae(e,t){return(e+t)%t}const st=(e,t)=>{const n=e.level?`h${e.level}`:"div";return delete e.level,h(n,{class:e.class,key:e.key},t)};class ct{constructor(){this.registeredElements=new Map,this.registeredElementCount=0,this.queryPopover=t=>{const{registeredElements:n}=this,s=t.find(r=>n.has(r));return n.get(s)},this.togglePopovers=t=>{const n=t.composedPath(),s=this.queryPopover(n);s&&!s.triggerDisabled&&(s.open=!s.open),Array.from(this.registeredElements.values()).filter(r=>r!==s&&r.autoClose&&r.open&&!n.includes(r)).forEach(r=>r.open=!1)},this.keyDownHandler=t=>{t.defaultPrevented||(t.key==="Escape"?this.closeAllPopovers():ve(t.key)&&this.togglePopovers(t))},this.clickHandler=t=>{Me(t)||this.togglePopovers(t)}}registerElement(t,n){this.registeredElementCount++,this.registeredElements.set(t,n),this.registeredElementCount===1&&this.addListeners()}unregisterElement(t){this.registeredElements.delete(t)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}closeAllPopovers(){Array.from(this.registeredElements.values()).forEach(t=>t.open=!1)}addListeners(){window.addEventListener("click",this.clickHandler),window.addEventListener("keydown",this.keyDownHandler)}removeListeners(){window.removeEventListener("click",this.clickHandler),window.removeEventListener("keydown",this.keyDownHandler)}}const E={container:"container",imageContainer:"image-container",closeButtonContainer:"close-button-container",closeButton:"close-button",content:"content",hasHeader:"has-header",header:"header",headerContainer:"headerContainer",headerContent:"header-content",heading:"heading"},lt="auto",re="aria-controls",se="aria-expanded",dt=":host{--calcite-floating-ui-z-index:var(--calcite-popover-z-index, var(--calcite-z-index-popup));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}:host([scale=s]) .heading{padding-inline:0.75rem;padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) .heading{padding-inline:1rem;padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) .heading{padding-inline:1.25rem;padding-block:1rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host{pointer-events:none}:host([open]){pointer-events:initial}.calcite-floating-ui-anim{border-width:1px;border-style:solid;background-color:var(--calcite-popover-background-color, var(--calcite-color-foreground-1));border-color:var(--calcite-popover-border-color, var(--calcite-color-border-3));border-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round))}.calcite-floating-ui-arrow{fill:var(--calcite-popover-background-color, var(--calcite-color-foreground-1))}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.header{display:flex;flex:1 1 auto;align-items:stretch;justify-content:flex-start;border-width:0px;border-block-end-width:1px;border-style:solid;border-block-end-color:var(--calcite-popover-border-color, var(--calcite-color-border-3))}.heading{margin:0px;display:block;flex:1 1 auto;align-self:center;white-space:normal;font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer{position:relative;display:flex;block-size:100%;flex-direction:row;flex-wrap:nowrap;border-radius:0.25rem;color:var(--calcite-popover-text-color, var(--calcite-color-text-1))}.headerContainer.has-header{flex-direction:column}.content{display:flex;block-size:100%;inline-size:100%;flex-direction:column;flex-wrap:nowrap;align-self:center;word-wrap:break-word;word-break:break-word}.close-button-container{display:flex;overflow:hidden;flex:0 0 auto;border-start-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));border-end-end-radius:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-round));--calcite-action-corner-radius-start-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp));--calcite-action-corner-radius-end-end:var(--calcite-popover-corner-radius, var(--calcite-corner-radius-sharp))}::slotted(calcite-panel),::slotted(calcite-flow){block-size:100%}:host([hidden]){display:none}[hidden]{display:none}",ut=dt,ce=new ct,ft=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calcitePopoverBeforeClose=F(this,"calcitePopoverBeforeClose",6),this.calcitePopoverClose=F(this,"calcitePopoverClose",6),this.calcitePopoverBeforeOpen=F(this,"calcitePopoverBeforeOpen",6),this.calcitePopoverOpen=F(this,"calcitePopoverOpen",6),this.mutationObserver=We("mutation",()=>this.updateFocusTrapElements()),this.guid=`calcite-popover-${he()}`,this.openTransitionProp="opacity",this.hasLoaded=!1,this.setTransitionEl=e=>{this.transitionEl=e},this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?He(t,e):null},this.setUpReferenceElement=(e=!0)=>{this.removeReferences(),this.effectiveReferenceElement=this.getReferenceElement(),Ne(this,this.effectiveReferenceElement,this.el);const{el:t,referenceElement:n,effectiveReferenceElement:s}=this;e&&n&&!s&&console.warn(`${t.tagName}: reference-element id "${n}" was not found.`,{el:t}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.setExpandedAttr=()=>{const{effectiveReferenceElement:e,open:t}=this;e&&"setAttribute"in e&&e.setAttribute(se,G(t))},this.addReferences=()=>{const{effectiveReferenceElement:e}=this;if(!e)return;const t=this.getId();"setAttribute"in e&&e.setAttribute(re,t),ce.registerElement(e,this.el),this.setExpandedAttr()},this.removeReferences=()=>{const{effectiveReferenceElement:e}=this;e&&("removeAttribute"in e&&(e.removeAttribute(re),e.removeAttribute(se)),ce.unregisterElement(e))},this.hide=()=>{this.open=!1},this.storeArrowEl=e=>{this.arrowEl=e,this.reposition(!0)},this.autoClose=!1,this.closable=!1,this.flipDisabled=!1,this.focusTrapDisabled=!1,this.pointerDisabled=!1,this.flipPlacements=void 0,this.heading=void 0,this.headingLevel=void 0,this.label=void 0,this.messageOverrides=void 0,this.messages=void 0,this.offsetDistance=Se,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement=lt,this.referenceElement=void 0,this.scale="m",this.triggerDisabled=!1,this.effectiveLocale="",this.floatingLayout="vertical",this.effectiveReferenceElement=void 0,this.defaultMessages=void 0}handleFocusTrapDisabled(e){this.open&&(e?z(this):oe(this))}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){Q(this),this.reposition(!0),this.setExpandedAttr()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement(),this.reposition(!0)}effectiveLocaleChange(){Ke(this,this.effectiveLocale)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),je(this),_e(this),at(this),requestAnimationFrame(()=>this.setUpReferenceElement(this.hasLoaded))}async componentWillLoad(){await Ue(this),me(this)}componentDidLoad(){be(this),this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement(),this.open&&Q(this),this.hasLoaded=!0}disconnectedCallback(){this.mutationObserver?.disconnect(),this.removeReferences(),$e(this),qe(this),ze(this,this.effectiveReferenceElement,this.el),z(this)}async reposition(e=!1){const{el:t,effectiveReferenceElement:n,placement:s,overlayPositioning:r,flipDisabled:a,filteredFlipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y}=this;return Ge(this,{floatingEl:t,referenceEl:n,overlayPositioning:r,placement:s,flipDisabled:a,flipPlacements:m,offsetDistance:v,offsetSkidding:g,arrowEl:y,type:"popover"},e)}async setFocus(){await ge(this),Oe(this.el),Ie(this.el)}async updateFocusTrapElements(){rt(this)}getReferenceElement(){const{referenceElement:e,el:t}=this;return(typeof e=="string"?Fe(t,{id:e}):e)||null}onBeforeOpen(){this.calcitePopoverBeforeOpen.emit()}onOpen(){this.calcitePopoverOpen.emit(),oe(this)}onBeforeClose(){this.calcitePopoverBeforeClose.emit()}onClose(){this.calcitePopoverClose.emit(),z(this)}renderCloseButton(){const{messages:e,closable:t}=this;return t?h("div",{class:E.closeButtonContainer,key:E.closeButtonContainer},h("calcite-action",{appearance:"transparent",class:E.closeButton,onClick:this.hide,ref:n=>this.closeButtonEl=n,scale:this.scale,text:e.close},h("calcite-icon",{icon:"x",scale:Xe(this.scale)}))):null}renderHeader(){const{heading:e,headingLevel:t}=this,n=e?h(st,{class:E.heading,level:t},e):null;return n?h("div",{class:E.header,key:E.header},n,this.renderCloseButton()):null}render(){const{effectiveReferenceElement:e,heading:t,label:n,open:s,pointerDisabled:r,floatingLayout:a}=this,m=e&&s,v=!m,g=r?null:h(Ve,{floatingLayout:a,key:"floating-arrow",ref:this.storeArrowEl});return h(Ce,{key:"a563d48090d6e6c0c138023e169667834f657c4c","aria-hidden":G(v),"aria-label":n,"aria-live":"polite","calcite-hydrated-hidden":v,id:this.getId(),role:"dialog"},h("div",{key:"73053dbdce2cfc68fcd42667089d611e81010955",class:{[E.container]:!0,[J.animation]:!0,[J.animationActive]:m},ref:this.setTransitionEl},g,h("div",{key:"1fbcd45ee42b10a67881ced74db2db051231c94d",class:{[E.hasHeader]:!!t,[E.headerContainer]:!0}},this.renderHeader(),h("div",{key:"522abe801b98787863aac14d990b948d2d286156",class:E.content},h("slot",{key:"022a8f690288acdbac4ec1b3eccf807ffe382d5d"})),t?null:this.renderCloseButton())))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return ut}},[1,"calcite-popover",{autoClose:[516,"auto-close"],closable:[516],flipDisabled:[516,"flip-disabled"],focusTrapDisabled:[516,"focus-trap-disabled"],pointerDisabled:[516,"pointer-disabled"],flipPlacements:[16],heading:[1],headingLevel:[514,"heading-level"],label:[1],messageOverrides:[1040],messages:[1040],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],scale:[513],triggerDisabled:[516,"trigger-disabled"],effectiveLocale:[32],floatingLayout:[32],effectiveReferenceElement:[32],defaultMessages:[32],reposition:[64],setFocus:[64],updateFocusTrapElements:[64]},void 0,{focusTrapDisabled:["handleFocusTrapDisabled"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"],effectiveLocale:["effectiveLocaleChange"]}]);function ke(){typeof customElements>"u"||["calcite-popover","calcite-action","calcite-icon","calcite-loader"].forEach(e=>{switch(e){case"calcite-popover":customElements.get(e)||customElements.define(e,ft);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break}})}ke();const le={menu:"menu",defaultTrigger:"default-trigger"},de={tooltip:"tooltip",trigger:"trigger"},pt={menu:"ellipsis"},ht="data-active",vt=":host{box-sizing:border-box;display:flex;flex-direction:column;font-size:var(--calcite-font-size-1)}::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}.default-trigger{position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}slot[name=trigger]::slotted(calcite-action),calcite-action::slotted([slot=trigger]){position:relative;block-size:100%;flex:0 1 auto;align-self:stretch}.menu{display:flex;max-block-size:45vh;flex-direction:column;flex-wrap:nowrap;overflow-y:auto;overflow-x:hidden;outline:2px solid transparent;outline-offset:2px;gap:var(--calcite-action-menu-items-space, 0)}:host([hidden]){display:none}[hidden]{display:none}",mt=vt,bt=["ArrowUp","ArrowDown","End","Home"],gt=ue(class extends fe{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionMenuOpen=F(this,"calciteActionMenuOpen",6),this.actionElements=[],this.guid=`calcite-action-menu-${he()}`,this.menuId=`${this.guid}-menu`,this.menuButtonId=`${this.guid}-menu-button`,this.connectMenuButtonEl=()=>{const{menuButtonId:e,menuId:t,open:n,label:s}=this,r=this.slottedMenuButtonEl||this.defaultMenuButtonEl;this.menuButtonEl!==r&&(this.disconnectMenuButtonEl(),this.menuButtonEl=r,this.setTooltipReferenceElement(),r&&(r.active=n,r.setAttribute("aria-controls",t),r.setAttribute("aria-expanded",G(n)),r.setAttribute("aria-haspopup","true"),r.id||(r.id=e),r.label||(r.label=s),r.text||(r.text=s),r.addEventListener("click",this.menuButtonClick),r.addEventListener("keydown",this.menuButtonKeyDown)))},this.disconnectMenuButtonEl=()=>{const{menuButtonEl:e}=this;e&&(e.removeEventListener("click",this.menuButtonClick),e.removeEventListener("keydown",this.menuButtonKeyDown))},this.setMenuButtonEl=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-action"));this.slottedMenuButtonEl=t[0],this.connectMenuButtonEl()},this.setDefaultMenuButtonEl=e=>{this.defaultMenuButtonEl=e,this.connectMenuButtonEl()},this.handleCalciteActionClick=()=>{this.open=!1,this.setFocus()},this.menuButtonClick=()=>{this.toggleOpen()},this.updateTooltip=e=>{const t=e.target.assignedElements({flatten:!0}).filter(n=>n?.matches("calcite-tooltip"));this.tooltipEl=t[0],this.setTooltipReferenceElement()},this.setTooltipReferenceElement=()=>{const{tooltipEl:e,expanded:t,menuButtonEl:n,open:s}=this;e&&(e.referenceElement=!t&&!s?n:null)},this.updateAction=(e,t)=>{const{guid:n,activeMenuItemIndex:s}=this,r=`${n}-action-${t}`;e.tabIndex=-1,e.setAttribute("role","menuitem"),e.id||(e.id=r),e.toggleAttribute(ht,t===s)},this.updateActions=e=>{e?.forEach(this.updateAction)},this.handleDefaultSlotChange=e=>{const t=e.target.assignedElements({flatten:!0}).reduce((n,s)=>s?.matches("calcite-action")?(n.push(s),n):s?.matches("calcite-action-group")?n.concat(Array.from(s.querySelectorAll("calcite-action"))):n,[]);this.actionElements=t.filter(n=>!n.disabled&&!n.hidden)},this.menuButtonKeyDown=e=>{const{key:t}=e,{actionElements:n,activeMenuItemIndex:s,open:r}=this;if(n.length){if(ve(t)){if(e.preventDefault(),!r){this.toggleOpen();return}const a=n[s];a?a.click():this.toggleOpen(!1)}if(t==="Tab"){this.open=!1;return}if(t==="Escape"){this.toggleOpen(!1),e.preventDefault();return}this.handleActionNavigation(e,t,n)}},this.handleActionNavigation=(e,t,n)=>{if(!this.isValidKey(t,bt))return;if(e.preventDefault(),!this.open){this.toggleOpen(),(t==="Home"||t==="ArrowDown")&&(this.activeMenuItemIndex=0),(t==="End"||t==="ArrowUp")&&(this.activeMenuItemIndex=n.length-1);return}t==="Home"&&(this.activeMenuItemIndex=0),t==="End"&&(this.activeMenuItemIndex=n.length-1);const s=this.activeMenuItemIndex;t==="ArrowUp"&&(this.activeMenuItemIndex=ae(Math.max(s-1,-1),n.length)),t==="ArrowDown"&&(this.activeMenuItemIndex=ae(s+1,n.length))},this.toggleOpenEnd=()=>{this.setFocus(),this.el.removeEventListener("calcitePopoverOpen",this.toggleOpenEnd)},this.toggleOpen=(e=!this.open)=>{this.el.addEventListener("calcitePopoverOpen",this.toggleOpenEnd),this.open=e},this.handlePopoverOpen=()=>{this.open=!0},this.handlePopoverClose=()=>{this.open=!1},this.appearance="solid",this.expanded=!1,this.flipPlacements=void 0,this.label=void 0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.scale=void 0,this.menuButtonEl=void 0,this.activeMenuItemIndex=-1}connectedCallback(){this.connectMenuButtonEl()}componentWillLoad(){me(this)}componentDidLoad(){be(this)}disconnectedCallback(){this.disconnectMenuButtonEl()}expandedHandler(){this.open=!1,this.setTooltipReferenceElement()}openHandler(e){this.activeMenuItemIndex=this.open?0:-1,this.menuButtonEl&&(this.menuButtonEl.active=e),this.calciteActionMenuOpen.emit(),this.setTooltipReferenceElement()}activeMenuItemIndexHandler(){this.updateActions(this.actionElements)}async setFocus(){return await ge(this),pe(this.menuButtonEl)}renderMenuButton(){const{appearance:e,label:t,scale:n,expanded:s}=this;return h("slot",{name:de.trigger,onSlotchange:this.setMenuButtonEl},h("calcite-action",{appearance:e,class:le.defaultTrigger,icon:pt.menu,ref:this.setDefaultMenuButtonEl,scale:n,text:t,textEnabled:s}))}renderMenuItems(){const{actionElements:e,activeMenuItemIndex:t,open:n,menuId:s,menuButtonEl:r,label:a,placement:m,overlayPositioning:v,flipPlacements:g}=this,y=e[t]?.id||null;return h("calcite-popover",{autoClose:!0,flipPlacements:g,focusTrapDisabled:!0,label:a,offsetDistance:0,onCalcitePopoverClose:this.handlePopoverClose,onCalcitePopoverOpen:this.handlePopoverOpen,open:n,overlayPositioning:v,placement:m,pointerDisabled:!0,referenceElement:r},h("div",{"aria-activedescendant":y,"aria-labelledby":r?.id,class:le.menu,id:s,onClick:this.handleCalciteActionClick,role:"menu",tabIndex:-1},h("slot",{onSlotchange:this.handleDefaultSlotChange})))}render(){return h(Be,{key:"d13aa4f3d43fb5651c0487ccfa456813f69955d2"},this.renderMenuButton(),this.renderMenuItems(),h("slot",{key:"b63d187516c766db6a1b1db3df34050fdec9e6ce",name:de.tooltip,onSlotchange:this.updateTooltip}))}isValidKey(e,t){return!!t.find(n=>n===e)}get el(){return this}static get watchers(){return{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}}static get style(){return mt}},[1,"calcite-action-menu",{appearance:[513],expanded:[516],flipPlacements:[16],label:[1],open:[1540],overlayPositioning:[513,"overlay-positioning"],placement:[513],scale:[513],menuButtonEl:[32],activeMenuItemIndex:[32],setFocus:[64]},void 0,{expanded:["expandedHandler"],open:["openHandler"],activeMenuItemIndex:["activeMenuItemIndexHandler"]}]);function Et(){typeof customElements>"u"||["calcite-action-menu","calcite-action","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-menu":customElements.get(e)||customElements.define(e,gt);break;case"calcite-action":customElements.get(e)||Ee();break;case"calcite-icon":customElements.get(e)||ye();break;case"calcite-loader":customElements.get(e)||we();break;case"calcite-popover":customElements.get(e)||ke();break}})}Et();export{rt as E,z as H,ke as K,Et as O,de as _,at as g,oe as j,st as w}; diff --git a/custom-toc-highlight/assets/apng-DuERAVke-BAEONUn6.js b/custom-toc-highlight/assets/apng-DuERAVke-D1GuG4Xy.js similarity index 98% rename from custom-toc-highlight/assets/apng-DuERAVke-BAEONUn6.js rename to custom-toc-highlight/assets/apng-DuERAVke-D1GuG4Xy.js index 9f30f01d..8b5f6e66 100644 --- a/custom-toc-highlight/assets/apng-DuERAVke-BAEONUn6.js +++ b/custom-toc-highlight/assets/apng-DuERAVke-D1GuG4Xy.js @@ -1 +1 @@ -import{t as G}from"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import{$ as B,aN as S}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";var R,T={exports:{}};function V(){return R||(R=1,E=function(){return function(w){var o={};function s(a){if(o[a])return o[a].exports;var l=o[a]={exports:{},id:a,loaded:!1};return w[a].call(l.exports,l,l.exports,s),l.loaded=!0,l.exports}return s.m=w,s.c=o,s.p="",s(0)}([function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0}),o.isNotPNG=n,o.isNotAPNG=r,o.default=i;var a=v(s(1)),l=s(2);function v(h){return h&&h.__esModule?h:{default:h}}var f=new Error("Not a PNG"),e=new Error("Not an animated PNG");function n(h){return h===f}function r(h){return h===e}var t=new Uint8Array([137,80,78,71,13,10,26,10]);function i(h){var _=new Uint8Array(h);if(Array.prototype.some.call(t,function(L,b){return L!==_[b]}))return f;var y=!1;if(u(_,function(L){return!(y=L==="acTL")}),!y)return e;var d=[],k=[],x=null,c=null,I=0,F=new l.APNG;if(u(_,function(L,b,p,U){var P=new DataView(b.buffer);switch(L){case"IHDR":x=b.subarray(p+8,p+8+U),F.width=P.getUint32(p+8),F.height=P.getUint32(p+12);break;case"acTL":F.numPlays=P.getUint32(p+8+4);break;case"fcTL":c&&(F.frames.push(c),I++),(c=new l.Frame).width=P.getUint32(p+8+4),c.height=P.getUint32(p+8+8),c.left=P.getUint32(p+8+12),c.top=P.getUint32(p+8+16);var M=P.getUint16(p+8+20),N=P.getUint16(p+8+22);N===0&&(N=100),c.delay=1e3*M/N,c.delay<=10&&(c.delay=100),F.playTime+=c.delay,c.disposeOp=P.getUint8(p+8+24),c.blendOp=P.getUint8(p+8+25),c.dataParts=[],I===0&&c.disposeOp===2&&(c.disposeOp=1);break;case"fdAT":c&&c.dataParts.push(b.subarray(p+8+4,p+8+U));break;case"IDAT":c&&c.dataParts.push(b.subarray(p+8,p+8+U));break;case"IEND":k.push(O(b,p,12+U));break;default:d.push(O(b,p,12+U))}}),c&&F.frames.push(c),F.frames.length==0)return e;var j=new Blob(d),C=new Blob(k);return F.frames.forEach(function(L){var b=[];b.push(t),x.set(D(L.width),0),x.set(D(L.height),4),b.push(A("IHDR",x)),b.push(j),L.dataParts.forEach(function(p){return b.push(A("IDAT",p))}),b.push(C),L.imageData=new Blob(b,{type:"image/png"}),delete L.dataParts,b=null}),F}function u(h,_){var y=new DataView(h.buffer),d=8,k=void 0,x=void 0,c=void 0;do x=y.getUint32(d),c=_(k=g(h,d+4,4),h,d,x),d+=12+x;while(c!==!1&&k!="IEND"&&d>>24&255,h>>>16&255,h>>>8&255,255&h])}},function(w,o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(f){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=e,t=e+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.length-e);r>>8^s[255&(n^f[r])];return~n};for(var s=new Uint32Array(256),a=0;a<256;a++){for(var l=a,v=0;v<8;v++)l=1&l?3988292384^l>>>1:l>>>1;s[a]=l}},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0}),o.Frame=o.APNG=void 0;var a=function(){function e(n,r){for(var t=0;t1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new l.default(r,n,t)})}}]),e}(),o.Frame=function(){function e(){f(this,e),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 a(e,[{key:"createImage",value:function(){var n=this;return this.imageElement?Promise.resolve():new Promise(function(r,t){var i=URL.createObjectURL(n.imageData);n.imageElement=document.createElement("img"),n.imageElement.onload=function(){URL.revokeObjectURL(i),r()},n.imageElement.onerror=function(){URL.revokeObjectURL(i),n.imageElement=null,t(new Error("Image creation error"))},n.imageElement.src=i})}}]),e}()},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0});var a=function(){function r(t,i){for(var u=0;u=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 i=this.currentFrame;this._prevFrame=i,this._prevFrameData=null,i.disposeOp==2&&(this._prevFrameData=this.context.getImageData(i.left,i.top,i.width,i.height)),i.blendOp==0&&this.context.clearRect(i.left,i.top,i.width,i.height),this.context.drawImage(i.imageElement,i.left,i.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var i=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var u=performance.now()+this.currentFrame.delay/this.playbackRate,g=function m(O){if(!i._ended&&!i._paused){if(O>=u){for(;O-u>=i._apng.playTime/i.playbackRate;)u+=i._apng.playTime/i.playbackRate,i._numPlays++;do i.renderNextFrame(),u+=i.currentFrame.delay/i.playbackRate;while(!i._ended&&!i._paused&&O>u)}requestAnimationFrame(m)}};requestAnimationFrame(g)}},{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}}]),t}(l(s(4)).default);o.default=n},function(w,o){function s(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(e){return typeof e=="function"}function l(e){return typeof e=="number"}function v(e){return typeof e=="object"&&e!==null}function f(e){return e===void 0}w.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.prototype.setMaxListeners=function(e){if(!l(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},s.prototype.emit=function(e){var n,r,t,i,u,g;if(this._events||(this._events={}),e==="error"&&(!this._events.error||v(this._events.error)&&!this._events.error.length)){if((n=arguments[1])instanceof Error)throw n;var m=new Error('Uncaught, unspecified "error" event. ('+n+")");throw m.context=n,m}if(f(r=this._events[e]))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(v(r))for(i=Array.prototype.slice.call(arguments,1),t=(g=r.slice()).length,u=0;u0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace()),this},s.prototype.on=s.prototype.addListener,s.prototype.once=function(e,n){if(!a(n))throw TypeError("listener must be a function");var r=!1;function t(){this.removeListener(e,t),r||(r=!0,n.apply(this,arguments))}return t.listener=n,this.on(e,t),this},s.prototype.removeListener=function(e,n){var r,t,i,u;if(!a(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(r=this._events[e]).length,t=-1,r===n||a(r.listener)&&r.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(v(r)){for(u=i;u-- >0;)if(r[u]===n||r[u].listener&&r[u].listener===n){t=u;break}if(t<0)return this;r.length===1?(r.length=0,delete this._events[e]):r.splice(t,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},s.prototype.removeAllListeners=function(e){var n,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(a(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},s.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},s.prototype.listenerCount=function(e){if(this._events){var n=this._events[e];if(a(n))return 1;if(n)return n.length}return 0},s.listenerCount=function(e,n){return e.listenerCount(n)}}])},T.exports=E()),T.exports;var E}const q=G(V());async function J(E,w){const o=q(E);if(o instanceof Error)throw o;await o.createImages(),B(w);const{frames:s,width:a,height:l}=o,v=document.createElement("canvas");v.width=a,v.height=l;const f=v.getContext("2d",{willReadFrequently:!0}),e=[],n=[];let r=0;for(const t of s){const i=S(t.delay||100);n.push(i),r+=i;const u=t.imageElement;t.blendOp===0?f.globalCompositeOperation="copy":f.globalCompositeOperation="source-over";const g=t.disposeOp===2?f.getImageData(t.left,t.top,t.width,t.height):void 0;f.drawImage(u,t.left,t.top);const m=f.getImageData(0,0,a,l);e.push(m),t.disposeOp===0||(t.disposeOp===1?f.clearRect(t.left,t.top,t.width,t.height):t.disposeOp===2&&f.putImageData(g,t.left,t.top))}return{frameCount:s.length,duration:r,frameDurations:n,getFrame:t=>e[t],width:a,height:l}}const H=[137,80,78,71,13,10,26,10];function $(E){const w=new Uint8Array(E);return!H.some((o,s)=>o!==w[s])}function W(E){if(!$(E))return!1;const w=new DataView(E),o=new Uint8Array(E);let s,a=8;do{const l=w.getUint32(a);if(s=String.fromCharCode.apply(String,Array.prototype.slice.call(o.subarray(a+4,a+8))),s==="acTL")return!0;a+=12+l}while(s!=="IEND"&&a>>24&255,h>>>16&255,h>>>8&255,255&h])}},function(w,o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=function(f){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=e,t=e+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:f.length-e);r>>8^s[255&(n^f[r])];return~n};for(var s=new Uint32Array(256),a=0;a<256;a++){for(var l=a,v=0;v<8;v++)l=1&l?3988292384^l>>>1:l>>>1;s[a]=l}},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0}),o.Frame=o.APNG=void 0;var a=function(){function e(n,r){for(var t=0;t1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new l.default(r,n,t)})}}]),e}(),o.Frame=function(){function e(){f(this,e),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 a(e,[{key:"createImage",value:function(){var n=this;return this.imageElement?Promise.resolve():new Promise(function(r,t){var i=URL.createObjectURL(n.imageData);n.imageElement=document.createElement("img"),n.imageElement.onload=function(){URL.revokeObjectURL(i),r()},n.imageElement.onerror=function(){URL.revokeObjectURL(i),n.imageElement=null,t(new Error("Image creation error"))},n.imageElement.src=i})}}]),e}()},function(w,o,s){Object.defineProperty(o,"__esModule",{value:!0});var a=function(){function r(t,i){for(var u=0;u=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 i=this.currentFrame;this._prevFrame=i,this._prevFrameData=null,i.disposeOp==2&&(this._prevFrameData=this.context.getImageData(i.left,i.top,i.width,i.height)),i.blendOp==0&&this.context.clearRect(i.left,i.top,i.width,i.height),this.context.drawImage(i.imageElement,i.left,i.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var i=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var u=performance.now()+this.currentFrame.delay/this.playbackRate,g=function m(O){if(!i._ended&&!i._paused){if(O>=u){for(;O-u>=i._apng.playTime/i.playbackRate;)u+=i._apng.playTime/i.playbackRate,i._numPlays++;do i.renderNextFrame(),u+=i.currentFrame.delay/i.playbackRate;while(!i._ended&&!i._paused&&O>u)}requestAnimationFrame(m)}};requestAnimationFrame(g)}},{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}}]),t}(l(s(4)).default);o.default=n},function(w,o){function s(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function a(e){return typeof e=="function"}function l(e){return typeof e=="number"}function v(e){return typeof e=="object"&&e!==null}function f(e){return e===void 0}w.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._maxListeners=void 0,s.defaultMaxListeners=10,s.prototype.setMaxListeners=function(e){if(!l(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},s.prototype.emit=function(e){var n,r,t,i,u,g;if(this._events||(this._events={}),e==="error"&&(!this._events.error||v(this._events.error)&&!this._events.error.length)){if((n=arguments[1])instanceof Error)throw n;var m=new Error('Uncaught, unspecified "error" event. ('+n+")");throw m.context=n,m}if(f(r=this._events[e]))return!1;if(a(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(v(r))for(i=Array.prototype.slice.call(arguments,1),t=(g=r.slice()).length,u=0;u0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace()),this},s.prototype.on=s.prototype.addListener,s.prototype.once=function(e,n){if(!a(n))throw TypeError("listener must be a function");var r=!1;function t(){this.removeListener(e,t),r||(r=!0,n.apply(this,arguments))}return t.listener=n,this.on(e,t),this},s.prototype.removeListener=function(e,n){var r,t,i,u;if(!a(n))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(r=this._events[e]).length,t=-1,r===n||a(r.listener)&&r.listener===n)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,n);else if(v(r)){for(u=i;u-- >0;)if(r[u]===n||r[u].listener&&r[u].listener===n){t=u;break}if(t<0)return this;r.length===1?(r.length=0,delete this._events[e]):r.splice(t,1),this._events.removeListener&&this.emit("removeListener",e,n)}return this},s.prototype.removeAllListeners=function(e){var n,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(n in this._events)n!=="removeListener"&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(a(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},s.prototype.listeners=function(e){return this._events&&this._events[e]?a(this._events[e])?[this._events[e]]:this._events[e].slice():[]},s.prototype.listenerCount=function(e){if(this._events){var n=this._events[e];if(a(n))return 1;if(n)return n.length}return 0},s.listenerCount=function(e,n){return e.listenerCount(n)}}])},T.exports=E()),T.exports;var E}const q=G(V());async function J(E,w){const o=q(E);if(o instanceof Error)throw o;await o.createImages(),B(w);const{frames:s,width:a,height:l}=o,v=document.createElement("canvas");v.width=a,v.height=l;const f=v.getContext("2d",{willReadFrequently:!0}),e=[],n=[];let r=0;for(const t of s){const i=S(t.delay||100);n.push(i),r+=i;const u=t.imageElement;t.blendOp===0?f.globalCompositeOperation="copy":f.globalCompositeOperation="source-over";const g=t.disposeOp===2?f.getImageData(t.left,t.top,t.width,t.height):void 0;f.drawImage(u,t.left,t.top);const m=f.getImageData(0,0,a,l);e.push(m),t.disposeOp===0||(t.disposeOp===1?f.clearRect(t.left,t.top,t.width,t.height):t.disposeOp===2&&f.putImageData(g,t.left,t.top))}return{frameCount:s.length,duration:r,frameDurations:n,getFrame:t=>e[t],width:a,height:l}}const H=[137,80,78,71,13,10,26,10];function $(E){const w=new Uint8Array(E);return!H.some((o,s)=>o!==w[s])}function W(E){if(!$(E))return!1;const w=new DataView(E),o=new Uint8Array(E);let s,a=8;do{const l=w.getUint32(a);if(s=String.fromCharCode.apply(String,Array.prototype.slice.call(o.subarray(a+4,a+8))),s==="acTL")return!0;a+=12+l}while(s!=="IEND"&&a{const t={};return h(t,c,{[n]:p},r,o),t[n]}))}function N(e,i,r={}){const o=e instanceof z?new J({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return i.constructFeatureSet(o,r.spatialReference,null,!0,r.lruCache,r.interceptor)}function W(e,i,r={}){const{spatialReference:o,interceptor:a,lruCache:n}=r;return typeof e=="string"?i.createFeatureSetCollectionFromService(e,o,n,a):i.createFeatureSetCollectionFromMap(e,o,n,a)}function Y(e,i,r,o={}){const a={};return h(a,i.properties,e,r,o),new d.Dictionary(a)}function h(e,i,r,o,a={}){const n={};for(const c of Object.keys(r))n[c.toLowerCase()]=r[c];for(const c of i){const p=c.name.toLowerCase();if(a.variablesPreProcessed)e[p]=n[p];else switch(c.type){case"array":{const t=n[p];e[p]=t==null?null:E(t,c,o,a);break}case"feature":{const t=n[p];e[p]=t==null?null:d.Feature.createFromGraphic(t,a?.timeZone);break}case"featureSet":{const t=n[p];e[p]=t==null?null:o?N(t,o,a):null;break}case"featureSetCollection":{const t=n[p];e[p]=t==null?null:o?W(t,o,a):null;break}case"dictionary":{const t=n[p];e[p]=t==null?null:Y(t,c,o,a);break}case"date":{const t=n[p];e[p]=t?t instanceof g?t:a?.timeZone?g.dateJSAndZoneToArcadeDate(t,a?.timeZone):g.dateJSToArcadeDate(t):null;break}case"dateOnly":{const t=n[p];e[p]=t?t instanceof O?t:O.fromReader(t):null;break}case"time":{const t=n[p];e[p]=t?t instanceof T?t:T.fromReader(t):null;break}case"knowledgeGraph":case"geometry":case"boolean":case"text":case"number":e[p]=n[p]}}}function Z(e,i){for(const r of e)i.push(r),r.type==="dictionary"&&Z(r.properties,i);return i}function R(e,i,r,o,a){const{spatialReference:n,interceptor:c,lruCache:p,console:t,abortSignal:u,timeZone:m,services:S={portal:M.getDefault()}}=r,b={vars:{},spatialReference:n,interceptor:c,timeZone:m,lrucache:p,useAsync:a,services:S,console:t,abortSignal:u};return i&&h(b.vars,e.variables,i,o,r),b}function v(e,i){switch(i.getArcadeType(e)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return e;case"date":return e.toJSDate();case"time":case"dateOnly":return e.toString();case"feature":{const r=(e.type,e),o="geometry"in r?r.geometry():null,a="readAttributes"in r?r.readAttributes():r.attributes;return new j({geometry:o,attributes:a})}case"dictionary":{const r=e,o=r.attributes,a={};for(const n of Object.keys(o))a[n]=v(r.field(n),i);return a}case"array":return("toArray"in e?e.toArray():e).map(r=>v(r,i))}return e}const F={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$userInput",type:"geometry"},{name:"$graph",type:"knowledgeGraph"}]},D={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"}]},U=new Map([["aggregate-field",{variables:[{name:"$feature",type:"feature"}]}],["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"}]}],["popup",F],["popup-element",F],["feature-reduction-popup",D],["feature-reduction-popup-element",D],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"}]}]}]]);function At(e){const i=U.get(e);if(!i){const r=Array.from(U.keys()).map(o=>`'${o}'`).join(", ");throw new w("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${r}`)}return P(i)}async function xt(e,i,r={}){d||(d=await L());const{arcade:o,arcadeUtils:a}=d,{loadScriptDependencies:n,referencesMember:c,scriptIsAsync:p}=o,t=Z(i.variables,[]),u=t.filter(s=>s.type==="featureSet"||s.type==="featureSetCollection").map(s=>s.name.toLowerCase()),m=o.parseScript(e,u);if(!m)throw new w("arcade:invalid-script","Unable to create SyntaxTree");const S=a.extractFieldNames(m),b=o.scriptTouchesGeometry(m),C=t.map(s=>s.name.toLowerCase()).filter(s=>c(m,s)),l=p(m,u);await n(m,l,u);const $={vars:{},spatialReference:null,useAsync:l};for(const s of C)$.vars[s]="any";const{lruCache:A}=r,x=o.compileScript(m,$),k=o.featureSetUtils(),{services:G}=r;return{execute:(s,f={})=>{if(l)throw new w("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const y=x(R(i,s,{lruCache:A,...f},k,l));return f.rawOutput?y:v(y,a)},executeAsync:async(s,f={})=>{const y=await x(R(i,s,{lruCache:A,services:G,...f},k,l));return f.rawOutput?y:v(y,a)},isAsync:l,variablesUsed:C,fieldsUsed:S,geometryUsed:b,syntaxTree:m}}export{xt as createArcadeExecutor,At as createArcadeProfile}; +import{o as w,P,dW as L,r as M,bi as j}from"./story-Doly9N9p.js";import{m as T,O,r as g}from"./TimeOnly-DSMefxKy-BHvJbNji.js";import{n as I}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import J from"./FeatureLayer-BrRKw5Si-DuA2fyE_.js";import{O as z}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./main-QGPoLsvl.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./editsZScale-BDsX6vv--C-4n90TZ.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import"./EditBusLayer-Df29OyJh-OmdJOLws.js";import"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import"./FeatureType-C9hJmS6_-CNlvn5D1.js";import"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import"./versionUtils-LZYZz-38-B8C5OAjF.js";import"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";let d=null;function E(e,i,r,o={}){const a=i.elementType,n="value",c=a.type==="array"?[{name:n,type:a.type,elementType:a.elementType}]:a.type==="dictionary"?[{name:n,type:a.type,properties:a.properties}]:[{name:n,type:a.type}];return new I(e.map(p=>{const t={};return h(t,c,{[n]:p},r,o),t[n]}))}function N(e,i,r={}){const o=e instanceof z?new J({source:e.features,geometryType:e.geometryType,fields:e.fields,spatialReference:e.spatialReference}):e;return i.constructFeatureSet(o,r.spatialReference,null,!0,r.lruCache,r.interceptor)}function W(e,i,r={}){const{spatialReference:o,interceptor:a,lruCache:n}=r;return typeof e=="string"?i.createFeatureSetCollectionFromService(e,o,n,a):i.createFeatureSetCollectionFromMap(e,o,n,a)}function Y(e,i,r,o={}){const a={};return h(a,i.properties,e,r,o),new d.Dictionary(a)}function h(e,i,r,o,a={}){const n={};for(const c of Object.keys(r))n[c.toLowerCase()]=r[c];for(const c of i){const p=c.name.toLowerCase();if(a.variablesPreProcessed)e[p]=n[p];else switch(c.type){case"array":{const t=n[p];e[p]=t==null?null:E(t,c,o,a);break}case"feature":{const t=n[p];e[p]=t==null?null:d.Feature.createFromGraphic(t,a?.timeZone);break}case"featureSet":{const t=n[p];e[p]=t==null?null:o?N(t,o,a):null;break}case"featureSetCollection":{const t=n[p];e[p]=t==null?null:o?W(t,o,a):null;break}case"dictionary":{const t=n[p];e[p]=t==null?null:Y(t,c,o,a);break}case"date":{const t=n[p];e[p]=t?t instanceof g?t:a?.timeZone?g.dateJSAndZoneToArcadeDate(t,a?.timeZone):g.dateJSToArcadeDate(t):null;break}case"dateOnly":{const t=n[p];e[p]=t?t instanceof O?t:O.fromReader(t):null;break}case"time":{const t=n[p];e[p]=t?t instanceof T?t:T.fromReader(t):null;break}case"knowledgeGraph":case"geometry":case"boolean":case"text":case"number":e[p]=n[p]}}}function Z(e,i){for(const r of e)i.push(r),r.type==="dictionary"&&Z(r.properties,i);return i}function R(e,i,r,o,a){const{spatialReference:n,interceptor:c,lruCache:p,console:t,abortSignal:u,timeZone:m,services:S={portal:M.getDefault()}}=r,b={vars:{},spatialReference:n,interceptor:c,timeZone:m,lrucache:p,useAsync:a,services:S,console:t,abortSignal:u};return i&&h(b.vars,e.variables,i,o,r),b}function v(e,i){switch(i.getArcadeType(e)){case"number":case"text":case"boolean":case"point":case"polygon":case"polyline":case"multipoint":case"extent":return e;case"date":return e.toJSDate();case"time":case"dateOnly":return e.toString();case"feature":{const r=(e.type,e),o="geometry"in r?r.geometry():null,a="readAttributes"in r?r.readAttributes():r.attributes;return new j({geometry:o,attributes:a})}case"dictionary":{const r=e,o=r.attributes,a={};for(const n of Object.keys(o))a[n]=v(r.field(n),i);return a}case"array":return("toArray"in e?e.toArray():e).map(r=>v(r,i))}return e}const F={variables:[{name:"$feature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$userInput",type:"geometry"},{name:"$graph",type:"knowledgeGraph"}]},D={variables:[{name:"$feature",type:"feature"},{name:"$aggregatedFeatures",type:"featureSet"}]},U=new Map([["aggregate-field",{variables:[{name:"$feature",type:"feature"}]}],["form-constraint",{variables:[{name:"$feature",type:"feature"}]}],["feature-z",{variables:[{name:"$feature",type:"feature"}]}],["field-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$datastore",type:"featureSetCollection"}]}],["form-calculation",{variables:[{name:"$feature",type:"feature"},{name:"$originalFeature",type:"feature"},{name:"$layer",type:"featureSet"},{name:"$featureSet",type:"featureSet"},{name:"$datastore",type:"featureSetCollection"},{name:"$map",type:"featureSetCollection"},{name:"$editContext",type:"dictionary",properties:[{name:"editType",type:"text"}]}]}],["labeling",{variables:[{name:"$feature",type:"feature"}]}],["popup",F],["popup-element",F],["feature-reduction-popup",D],["feature-reduction-popup-element",D],["visualization",{variables:[{name:"$feature",type:"feature"},{name:"$view",type:"dictionary",properties:[{name:"scale",type:"number"}]}]}]]);function At(e){const i=U.get(e);if(!i){const r=Array.from(U.keys()).map(o=>`'${o}'`).join(", ");throw new w("createArcadeProfile:invalid-profile-name",`Invalid profile name '${e}'. You must specify one of the following values: ${r}`)}return P(i)}async function xt(e,i,r={}){d||(d=await L());const{arcade:o,arcadeUtils:a}=d,{loadScriptDependencies:n,referencesMember:c,scriptIsAsync:p}=o,t=Z(i.variables,[]),u=t.filter(s=>s.type==="featureSet"||s.type==="featureSetCollection").map(s=>s.name.toLowerCase()),m=o.parseScript(e,u);if(!m)throw new w("arcade:invalid-script","Unable to create SyntaxTree");const S=a.extractFieldNames(m),b=o.scriptTouchesGeometry(m),C=t.map(s=>s.name.toLowerCase()).filter(s=>c(m,s)),l=p(m,u);await n(m,l,u);const $={vars:{},spatialReference:null,useAsync:l};for(const s of C)$.vars[s]="any";const{lruCache:A}=r,x=o.compileScript(m,$),k=o.featureSetUtils(),{services:G}=r;return{execute:(s,f={})=>{if(l)throw new w("arcade:invalid-execution-mode","Cannot execute the script in synchronous mode");const y=x(R(i,s,{lruCache:A,...f},k,l));return f.rawOutput?y:v(y,a)},executeAsync:async(s,f={})=>{const y=await x(R(i,s,{lruCache:A,services:G,...f},k,l));return f.rawOutput?y:v(y,a)},isAsync:l,variablesUsed:C,fieldsUsed:S,geometryUsed:b,syntaxTree:m}}export{xt as createArcadeExecutor,At as createArcadeProfile}; diff --git a/custom-toc-highlight/assets/arcadeAsyncRuntime-B-LnqhTo-DU6gqwwh.js b/custom-toc-highlight/assets/arcadeAsyncRuntime-B-LnqhTo-BP4d9xu9.js similarity index 95% rename from custom-toc-highlight/assets/arcadeAsyncRuntime-B-LnqhTo-DU6gqwwh.js rename to custom-toc-highlight/assets/arcadeAsyncRuntime-B-LnqhTo-BP4d9xu9.js index d1440f5e..06823411 100644 --- a/custom-toc-highlight/assets/arcadeAsyncRuntime-B-LnqhTo-DU6gqwwh.js +++ b/custom-toc-highlight/assets/arcadeAsyncRuntime-B-LnqhTo-BP4d9xu9.js @@ -1,2 +1,2 @@ -import{C as pt,X as wt,M as dt,L as ht,f as gt,m as mt,s as yt,a as rt,p as vt,N as M,e as y,b as J,D as ot}from"./arcadeUtils-DpP0k7IY-BXaTThTL.js";import{w as Q,b as R,T as l,n as s,B as W,a5 as v,a9 as z,l as p,U as S,a6 as F,a7 as E,N as at,y as g,C as U,S as C,f,t as k,Z as j,M as O,V as bt,o as D,a0 as St,z as xt,a8 as Ft,H as It,a4 as T,r as Rt,ac as Mt,ad as $}from"./languageUtils-BYxF9hRA-BBstOXAc.js";import{registerFunctions as At}from"./geomasync-uGYsifQH-DIhokorn.js";import{J as nt,d as tt}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./number-eRKYXfX9-eI8aiR_7.js";import"./shared-D1w-26bA-B8KlJvO_.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./portalUtils-CKN9iXwH-B2zCer9u.js";import"./geometryEngineAsync-D7oEu5dd-B6AE24vD.js";import"./workers-PiCjreoO-idkDTJa3.js";const K=100;async function X(e,t){const r=[];for(let o=0;o{const o={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:t.depthCounter+1},globalScope:this.context.globalScope};if(o.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,null);return Z(this.definition,o,r,null)}}call(t,r){return B(t,r,(o,a,n)=>{const i={spatialReference:t.spatialReference,services:t.services,console:t.console,libraryResolver:t.libraryResolver,exports:t.exports,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{},abortSignal:t.abortSignal,globalScope:t.globalScope,depthCounter:{depth:t.depthCounter.depth+1}};if(i.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,r);return Z(this.definition,i,n,r)})}marshalledCall(t,r,o,a){return a(t,r,async(n,i,c)=>{const w={spatialReference:t.spatialReference,globalScope:o.globalScope,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,console:t.console,abortSignal:t.abortSignal,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{}};return c=c.map(d=>!S(d)||d instanceof T?d:$(d,t,a)),$(await Z(this.definition,w,c,r),o,a)})}}class A extends It{constructor(t){super(),this.source=t}async global(t){const r=this.executingContext.globalScope[t.toLowerCase()];if(r.valueset||(r.value=await u(this.executingContext,r.node),r.valueset=!0),S(r.value)&&!(r.value instanceof T)){const o=new T;o.fn=r.value,o.parameterEvaluator=B,o.context=this.executingContext,r.value=o}return r.value}setGlobal(t,r){if(S(r))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[t.toLowerCase()]={value:r,valueset:!0,node:null}}hasGlobal(t){return this.executingContext.exports[t]===void 0&&(t=t.toLowerCase()),this.executingContext.exports[t]!==void 0}async loadModule(t){let r=t.spatialReference;r==null&&(r=new nt({wkid:102100})),this.moduleScope=ut({},t.customfunctions,t.timeZone),this.executingContext={spatialReference:r,services:t.services,libraryResolver:new rt(t.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:t.abortSignal===void 0||t.abortSignal===null?{aborted:!1}:t.abortSignal,globalScope:this.moduleScope,console:t.console??ft,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:null,depthCounter:{depth:1}},await H(this.executingContext,this.source.syntax)}}async function B(e,t,r){return t.preparsed===!0?r(e,null,t.arguments):r(e,t,await X(e,t))}async function u(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"UpdateExpression":return await Kt(e,t);case"AssignmentExpression":return await Lt(e,t);case"TemplateLiteral":return await Jt(e,t);case"Identifier":return await Y(e,t);case"MemberExpression":return await _t(e,t);case"Literal":return t.value;case"CallExpression":return await Yt(e,t);case"UnaryExpression":return await Wt(e,t);case"BinaryExpression":return await Xt(e,t);case"LogicalExpression":return await Ht(e,t);case"ArrayExpression":return await zt(e,t);case"ObjectExpression":return await Nt(e,t);default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function b(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"ImportDeclaration":return await qt(e,t);case"ExportNamedDeclaration":return await Gt(e,t);case"VariableDeclaration":return await lt(e,t,0);case"BlockStatement":return await H(e,t);case"FunctionDeclaration":return await Pt(e,t);case"ReturnStatement":return await Tt(e,t);case"IfStatement":return await Dt(e,t);case"ExpressionStatement":return await Zt(e,t);case"ForStatement":return await Bt(e,t);case"WhileStatement":return await kt(e,t);case"ForInStatement":return await jt(e,t);case"BreakStatement":return F;case"EmptyStatement":return p;case"ContinueStatement":return E;default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function Nt(e,t){const r=[];for(let i=0;i{try{r.testResult===!0?++n>K?(n=0,setTimeout(()=>{P(e,t,r,o,a,n)},0)):P(e,t,r,o,a,n):r.lastAction instanceof v?o(r.lastAction):o(p)}catch(i){a(i)}},i=>{a(i)})}catch(i){a(i)}}async function Bt(e,t){try{return t.init!==null&&(t.init.type==="VariableDeclaration"?await b(e,t.init):await u(e,t.init)),await new Promise((r,o)=>{P(e,t,{testResult:!0,lastAction:p},a=>{r(a)},a=>{o(a)},0)})}catch(r){throw r}}function q(e,t,r,o,a,n,i,c,w,d){try{if(o<=n)return void c(p);a.value=i==="k"?r[n]:n,b(e,t.body).then(m=>{try{m instanceof v?c(m):m===F?c(p):++d>K?(d=0,setTimeout(()=>{q(e,t,r,o,a,n+1,i,c,w,d)},0)):q(e,t,r,o,a,n+1,i,c,w,d)}catch(L){w(L)}},m=>{w(m)})}catch(m){w(m)}}function G(e,t,r,o,a,n,i,c,w){try{if(r.length()<=a)return void i(p);o.value=n==="k"?r.get(a):a,b(e,t.body).then(d=>{d instanceof v?i(d):d===F?i(p):++w>K?(w=0,setTimeout(()=>{G(e,t,r,o,a+1,n,i,c,w)},0)):G(e,t,r,o,a+1,n,i,c,w)},d=>{c(d)})}catch(d){c(d)}}function V(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length===0)return void o.resolve(p);q(e,t,r,r.length,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Et(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length()===0)return void o.resolve(p);G(e,t,r,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Ut(e,t,r,o,a){try{V(e,t,r.keys(),o,a,"k")}catch(n){o.reject(n)}}function _(e,t,r,o,a,n,i,c){try{e.next().then(w=>{try{if(w===null)n(p);else{const d=ot.createFromGraphicLikeObject(w.geometry,w.attributes,o,t.timeZone);d._underlyingGraphic=w,a.value=d,b(t,r.body).then(m=>{try{m===F?n(p):m instanceof v?n(m):++c>K?(c=0,setTimeout(()=>{_(e,t,r,o,a,n,i,c)},0)):_(e,t,r,o,a,n,i,c)}catch(L){i(L)}},m=>{i(m)})}}catch(d){i(d)}},w=>{i(w)})}catch(w){i(w)}}async function jt(e,t){return new Promise((r,o)=>{u(e,t.right).then(a=>{try{let n;n=t.left.type==="VariableDeclaration"?b(e,t.left):Promise.resolve(),n.then(()=>{try{const i=y(t.left.type==="VariableDeclaration"?t.left.declarations[0].id:t.left);let c=null;if(e.localScope!=null&&e.localScope[i]!==void 0&&(c=e.localScope[i]),c===null&&e.globalScope[i]!==void 0&&(c=e.globalScope[i]),c===null)return void o(new l(e,s.InvalidIdentifier,t));U(a)||g(a)?V(e,t,a,{reject:o,resolve:r},c):j(a)?Et(e,t,a,{reject:o,resolve:r},c):a instanceof M||k(a)?Ut(e,t,a,{reject:o,resolve:r},c):Rt(a)?_(a.iterator(e.abortSignal),e,t,a,c,w=>{r(w)},w=>{o(w)},0):V(e,t,[],{reject:o,resolve:r},c)}catch(i){o(i)}},o)}catch(n){o(n)}},o)})}async function Kt(e,t){const r=t.argument;if(r.type==="CallExpression")throw new l(e,s.NeverReach,t);if(r.type==="MemberExpression"){const n=await u(e,r.object);let i,c;if(r.computed===!0)i=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.Unrecognized,t);i=r.property.name}if(U(n)){if(!C(i))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(i<0&&(i=n.length+i),i<0||i>=n.length)throw new l(e,s.OutOfBounds,t);c=f(n[i]),n[i]=t.operator==="++"?c+1:c-1}else if(n instanceof M){if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}else if(n instanceof A){if(g(i)===!1)throw new l(e,s.ModuleAccessorMustBeString,t);if(n.hasGlobal(i)!==!0)throw new l(e,s.ModuleExportNotFound,t);c=f(await n.global(i)),n.setGlobal(i,t.operator==="++"?c+1:c-1)}else{if(!k(n))throw j(n)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}return t.prefix===!1?c:t.operator==="++"?c+1:c-1}const o=y(r);let a;if(e.localScope!=null&&e.localScope[o]!==void 0)return a=f(e.localScope[o].value),e.localScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;if(e.globalScope[o]!==void 0)return a=f(e.globalScope[o].value),e.globalScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;throw new l(e,s.InvalidIdentifier,t)}function x(e,t,r,o,a){switch(t){case"=":return e===p?null:e;case"/=":return f(r)/f(e);case"*=":return f(r)*f(e);case"-=":return f(r)-f(e);case"+=":return g(r)||g(e)?O(r)+O(e):f(r)+f(e);case"%=":return f(r)%f(e);default:throw new l(a,s.UnsupportedOperator,o)}}async function Lt(e,t){const r=t.left;if(r.type==="MemberExpression"){const a=await u(e,r.object);let n;if(r.computed===!0)n=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);n=r.property.name}const i=await u(e,t.right);if(U(a)){if(!C(n))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(n<0&&(n=a.length+n),n<0||n>a.length)throw new l(e,s.OutOfBounds,t);if(n===a.length){if(t.operator!=="=")throw new l(e,s.OutOfBounds,t);a[n]=x(i,t.operator,a[n],t,e)}else a[n]=x(i,t.operator,a[n],t,e)}else if(a instanceof M){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}else if(a instanceof A){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasGlobal(n)!==!0)throw new l(e,s.ModuleExportNotFound,t);a.setGlobal(n,x(i,t.operator,await a.global(n),t,e))}else{if(!k(a))throw j(a)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}return p}const o=y(r);if(e.localScope!=null&&e.localScope[o]!==void 0){const a=await u(e,t.right);return e.localScope[o]={value:x(a,t.operator,e.localScope[o].value,t,e),valueset:!0,node:t.right},p}if(e.globalScope[o]!==void 0){const a=await u(e,t.right);return e.globalScope[o]={value:x(a,t.operator,e.globalScope[o].value,t,e),valueset:!0,node:t.right},p}throw new l(e,s.InvalidIdentifier,t)}async function Zt(e,t){const r=await u(e,t.expression);return r===p?p:new z(r)}async function Dt(e,t){const r=await u(e,t.test);if(r===!0)return b(e,t.consequent);if(r===!1)return t.alternate!==null?b(e,t.alternate):p;throw new l(e,s.BooleanConditionRequired,t)}async function H(e,t){return it(e,t,0)}async function it(e,t,r){if(r>=t.body.length)return p;const o=await b(e,t.body[r]);return o instanceof v||o===F||o===E||r===t.body.length-1?o:it(e,t,r+1)}async function Tt(e,t){if(t.argument===null)return new v(p);const r=await u(e,t.argument);return new v(r)}async function Pt(e,t){const r=y(t.id);return e.globalScope[r]={valueset:!0,node:null,value:new Ct(t,e)},p}async function qt(e,t){const r=y(t.specifiers[0].local),o=e.libraryResolver.loadLibrary(r);let a;return e.libraryResolver._moduleSingletons?.has(o.uri)?a=e.libraryResolver._moduleSingletons.get(o.uri):(a=new A(o),await a.loadModule(e),e.libraryResolver._moduleSingletons?.set(o.uri,a)),e.globalScope[r]={value:a,valueset:!0,node:t},p}async function Gt(e,t){if(await b(e,t.declaration),t.declaration.type==="FunctionDeclaration")e.exports[y(t.declaration.id)]="function";else if(t.declaration.type==="VariableDeclaration")for(const r of t.declaration.declarations)e.exports[y(r.id)]="variable";return p}async function lt(e,t,r){return r>=t.declarations.length?p:(await Vt(e,t.declarations[r]),r===t.declarations.length-1||await lt(e,t,r+1),p)}async function Vt(e,t){let r=null;if(r=t.init===null?null:await u(e,t.init),e.localScope!==null){if(r===p&&(r=null),t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const a=y(t.id);return void(e.localScope!=null&&(e.localScope[a]={value:r,valueset:!0,node:t.init}))}if(t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const o=y(t.id);r===p&&(r=null),e.globalScope[o]={value:r,valueset:!0,node:t.init}}async function _t(e,t){const r=await u(e,t.object);if(r===null)throw new l(e,s.MemberOfNull,t);if(t.computed===!1){if(t.property.type==="Identifier"){if(r instanceof M||k(r))return r.field(t.property.name);if(r instanceof tt)return J(r,t.property.name,e,t);if(r instanceof A){if(!r.hasGlobal(t.property.name))throw new l(e,s.InvalidIdentifier,t);return r.global(t.property.name)}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}let o=await u(e,t.property);if(r instanceof M||k(r)){if(g(o))return r.field(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof A){if(g(o))return r.global(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof tt){if(g(o))return J(r,o,e,t);throw new l(e,s.InvalidMemberAccessKey,t)}if(U(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}if(j(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length()+o),o>=r.length()||o<0)throw new l(e,s.OutOfBounds,t);return r.get(o)}throw new l(e,s.InvalidMemberAccessKey,t)}if(g(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}async function Wt(e,t){const r=await u(e,t.argument);if(R(r)){if(t.operator==="!")return!r;if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}async function zt(e,t){const r=[];for(let o=0;o>":case">>>":case"^":case"&":return St(f(r),f(o),t.operator);case"==":return D(r,o);case"!=":return!D(r,o);case"<":case">":case"<=":case">=":return bt(r,o,t.operator);case"+":return g(r)||g(o)?O(r)+O(o):f(r)+f(o);case"-":return f(r)-f(o);case"*":return f(r)*f(o);case"/":return f(r)/f(o);case"%":return f(r)%f(o);default:throw new l(e,s.UnsupportedOperator,t)}}async function Ht(e,t){const r=await u(e,t.left);if(!R(r))throw new l(e,s.LogicalExpressionOnlyBoolean,t);switch(t.operator){case"||":{if(r===!0)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}case"&&":{if(r===!1)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}default:throw new l(e,s.LogicExpressionOrAnd,t)}}async function Y(e,t){const r=y(t);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}throw new l(e,s.InvalidIdentifier,t)}async function Yt(e,t){if(t.callee.type==="MemberExpression"){const o=await u(e,t.callee.object);if(!(o instanceof A))throw new l(e,s.FunctionNotFound,t);const a=t.callee.computed===!1?t.callee.property.name:await u(e,t.callee.property);if(!o.hasGlobal(a))throw new l(e,s.FunctionNotFound,t);const n=await o.global(a);if(!S(n))throw new l(e,s.CallNonFunction,t);return n.call(e,t)}if(t.callee.type!=="Identifier")throw new l(e,s.FunctionNotFound,t);const r=y(t.callee);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}throw new l(e,s.FunctionNotFound,t)}async function Jt(e,t){let r="",o=0;for(const a of t.quasis)if(r+=a.value?a.value.cooked:"",a.tail===!1){if(t.expressions[o]){const n=await u(e,t.expressions[o]);if(S(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);r+=O(n)}o++}return r}const h={};async function st(e,t,r,o){const a=await u(e,t.arguments[r]);if(D(a,o))return u(e,t.arguments[r+1]);const n=t.arguments.length-r;return n===1?u(e,t.arguments[r]):n===2?null:n===3?u(e,t.arguments[r+2]):st(e,t,r+2,o)}async function ct(e,t,r,o){if(o===!0)return u(e,t.arguments[r+1]);if(t.arguments.length-r===3)return u(e,t.arguments[r+2]);const a=await u(e,t.arguments[r+2]);if(R(a)===!1)throw new l(e,s.ModuleExportNotFound,t.arguments[r+2]);return ct(e,t,r+2,a)}async function Z(e,t,r,o){const a=e.body;if(r.length!==e.params.length)throw new l(t,s.WrongNumberOfParameters,null);for(let i=0;i{const o={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,timeZone:this.context.timeZone??null,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:t.depthCounter+1},globalScope:this.context.globalScope};if(o.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,null);return Z(this.definition,o,r,null)}}call(t,r){return B(t,r,(o,a,n)=>{const i={spatialReference:t.spatialReference,services:t.services,console:t.console,libraryResolver:t.libraryResolver,exports:t.exports,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{},abortSignal:t.abortSignal,globalScope:t.globalScope,depthCounter:{depth:t.depthCounter.depth+1}};if(i.depthCounter.depth>64)throw new l(t,s.MaximumCallDepth,r);return Z(this.definition,i,n,r)})}marshalledCall(t,r,o,a){return a(t,r,async(n,i,c)=>{const w={spatialReference:t.spatialReference,globalScope:o.globalScope,depthCounter:{depth:t.depthCounter.depth+1},libraryResolver:t.libraryResolver,exports:t.exports,console:t.console,abortSignal:t.abortSignal,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:{}};return c=c.map(d=>!S(d)||d instanceof T?d:$(d,t,a)),$(await Z(this.definition,w,c,r),o,a)})}}class A extends It{constructor(t){super(),this.source=t}async global(t){const r=this.executingContext.globalScope[t.toLowerCase()];if(r.valueset||(r.value=await u(this.executingContext,r.node),r.valueset=!0),S(r.value)&&!(r.value instanceof T)){const o=new T;o.fn=r.value,o.parameterEvaluator=B,o.context=this.executingContext,r.value=o}return r.value}setGlobal(t,r){if(S(r))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[t.toLowerCase()]={value:r,valueset:!0,node:null}}hasGlobal(t){return this.executingContext.exports[t]===void 0&&(t=t.toLowerCase()),this.executingContext.exports[t]!==void 0}async loadModule(t){let r=t.spatialReference;r==null&&(r=new nt({wkid:102100})),this.moduleScope=ut({},t.customfunctions,t.timeZone),this.executingContext={spatialReference:r,services:t.services,libraryResolver:new rt(t.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:t.abortSignal===void 0||t.abortSignal===null?{aborted:!1}:t.abortSignal,globalScope:this.moduleScope,console:t.console??ft,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,localScope:null,depthCounter:{depth:1}},await H(this.executingContext,this.source.syntax)}}async function B(e,t,r){return t.preparsed===!0?r(e,null,t.arguments):r(e,t,await X(e,t))}async function u(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"UpdateExpression":return await Kt(e,t);case"AssignmentExpression":return await Lt(e,t);case"TemplateLiteral":return await Jt(e,t);case"Identifier":return await Y(e,t);case"MemberExpression":return await _t(e,t);case"Literal":return t.value;case"CallExpression":return await Yt(e,t);case"UnaryExpression":return await Wt(e,t);case"BinaryExpression":return await Xt(e,t);case"LogicalExpression":return await Ht(e,t);case"ArrayExpression":return await zt(e,t);case"ObjectExpression":return await Nt(e,t);default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function b(e,t){t.breakpoint&&await t.breakpoint();try{switch(t.type){case"ImportDeclaration":return await qt(e,t);case"ExportNamedDeclaration":return await Gt(e,t);case"VariableDeclaration":return await lt(e,t,0);case"BlockStatement":return await H(e,t);case"FunctionDeclaration":return await Pt(e,t);case"ReturnStatement":return await Tt(e,t);case"IfStatement":return await Dt(e,t);case"ExpressionStatement":return await Zt(e,t);case"ForStatement":return await Bt(e,t);case"WhileStatement":return await kt(e,t);case"ForInStatement":return await jt(e,t);case"BreakStatement":return F;case"EmptyStatement":return p;case"ContinueStatement":return E;default:throw new l(e,s.Unrecognized,t)}}catch(r){throw at(e,t,r)}}async function Nt(e,t){const r=[];for(let i=0;i{try{r.testResult===!0?++n>K?(n=0,setTimeout(()=>{P(e,t,r,o,a,n)},0)):P(e,t,r,o,a,n):r.lastAction instanceof v?o(r.lastAction):o(p)}catch(i){a(i)}},i=>{a(i)})}catch(i){a(i)}}async function Bt(e,t){try{return t.init!==null&&(t.init.type==="VariableDeclaration"?await b(e,t.init):await u(e,t.init)),await new Promise((r,o)=>{P(e,t,{testResult:!0,lastAction:p},a=>{r(a)},a=>{o(a)},0)})}catch(r){throw r}}function q(e,t,r,o,a,n,i,c,w,d){try{if(o<=n)return void c(p);a.value=i==="k"?r[n]:n,b(e,t.body).then(m=>{try{m instanceof v?c(m):m===F?c(p):++d>K?(d=0,setTimeout(()=>{q(e,t,r,o,a,n+1,i,c,w,d)},0)):q(e,t,r,o,a,n+1,i,c,w,d)}catch(L){w(L)}},m=>{w(m)})}catch(m){w(m)}}function G(e,t,r,o,a,n,i,c,w){try{if(r.length()<=a)return void i(p);o.value=n==="k"?r.get(a):a,b(e,t.body).then(d=>{d instanceof v?i(d):d===F?i(p):++w>K?(w=0,setTimeout(()=>{G(e,t,r,o,a+1,n,i,c,w)},0)):G(e,t,r,o,a+1,n,i,c,w)},d=>{c(d)})}catch(d){c(d)}}function V(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length===0)return void o.resolve(p);q(e,t,r,r.length,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Et(e,t,r,o,a,n){try{if(n===void 0&&(n="i"),r.length()===0)return void o.resolve(p);G(e,t,r,a,0,n,i=>{o.resolve(i)},i=>{o.reject(i)},0)}catch(i){o.reject(i)}}function Ut(e,t,r,o,a){try{V(e,t,r.keys(),o,a,"k")}catch(n){o.reject(n)}}function _(e,t,r,o,a,n,i,c){try{e.next().then(w=>{try{if(w===null)n(p);else{const d=ot.createFromGraphicLikeObject(w.geometry,w.attributes,o,t.timeZone);d._underlyingGraphic=w,a.value=d,b(t,r.body).then(m=>{try{m===F?n(p):m instanceof v?n(m):++c>K?(c=0,setTimeout(()=>{_(e,t,r,o,a,n,i,c)},0)):_(e,t,r,o,a,n,i,c)}catch(L){i(L)}},m=>{i(m)})}}catch(d){i(d)}},w=>{i(w)})}catch(w){i(w)}}async function jt(e,t){return new Promise((r,o)=>{u(e,t.right).then(a=>{try{let n;n=t.left.type==="VariableDeclaration"?b(e,t.left):Promise.resolve(),n.then(()=>{try{const i=y(t.left.type==="VariableDeclaration"?t.left.declarations[0].id:t.left);let c=null;if(e.localScope!=null&&e.localScope[i]!==void 0&&(c=e.localScope[i]),c===null&&e.globalScope[i]!==void 0&&(c=e.globalScope[i]),c===null)return void o(new l(e,s.InvalidIdentifier,t));U(a)||g(a)?V(e,t,a,{reject:o,resolve:r},c):j(a)?Et(e,t,a,{reject:o,resolve:r},c):a instanceof M||k(a)?Ut(e,t,a,{reject:o,resolve:r},c):Rt(a)?_(a.iterator(e.abortSignal),e,t,a,c,w=>{r(w)},w=>{o(w)},0):V(e,t,[],{reject:o,resolve:r},c)}catch(i){o(i)}},o)}catch(n){o(n)}},o)})}async function Kt(e,t){const r=t.argument;if(r.type==="CallExpression")throw new l(e,s.NeverReach,t);if(r.type==="MemberExpression"){const n=await u(e,r.object);let i,c;if(r.computed===!0)i=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.Unrecognized,t);i=r.property.name}if(U(n)){if(!C(i))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(i<0&&(i=n.length+i),i<0||i>=n.length)throw new l(e,s.OutOfBounds,t);c=f(n[i]),n[i]=t.operator==="++"?c+1:c-1}else if(n instanceof M){if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}else if(n instanceof A){if(g(i)===!1)throw new l(e,s.ModuleAccessorMustBeString,t);if(n.hasGlobal(i)!==!0)throw new l(e,s.ModuleExportNotFound,t);c=f(await n.global(i)),n.setGlobal(i,t.operator==="++"?c+1:c-1)}else{if(!k(n))throw j(n)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(i)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(n.hasField(i)!==!0)throw new l(e,s.FieldNotFound,t,{key:i});c=f(n.field(i)),n.setField(i,t.operator==="++"?c+1:c-1)}return t.prefix===!1?c:t.operator==="++"?c+1:c-1}const o=y(r);let a;if(e.localScope!=null&&e.localScope[o]!==void 0)return a=f(e.localScope[o].value),e.localScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;if(e.globalScope[o]!==void 0)return a=f(e.globalScope[o].value),e.globalScope[o]={value:t.operator==="++"?a+1:a-1,valueset:!0,node:t},t.prefix===!1?a:t.operator==="++"?a+1:a-1;throw new l(e,s.InvalidIdentifier,t)}function x(e,t,r,o,a){switch(t){case"=":return e===p?null:e;case"/=":return f(r)/f(e);case"*=":return f(r)*f(e);case"-=":return f(r)-f(e);case"+=":return g(r)||g(e)?O(r)+O(e):f(r)+f(e);case"%=":return f(r)%f(e);default:throw new l(a,s.UnsupportedOperator,o)}}async function Lt(e,t){const r=t.left;if(r.type==="MemberExpression"){const a=await u(e,r.object);let n;if(r.computed===!0)n=await u(e,r.property);else{if(r.property.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);n=r.property.name}const i=await u(e,t.right);if(U(a)){if(!C(n))throw new l(e,s.ArrayAccessorMustBeNumber,t);if(n<0&&(n=a.length+n),n<0||n>a.length)throw new l(e,s.OutOfBounds,t);if(n===a.length){if(t.operator!=="=")throw new l(e,s.OutOfBounds,t);a[n]=x(i,t.operator,a[n],t,e)}else a[n]=x(i,t.operator,a[n],t,e)}else if(a instanceof M){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}else if(a instanceof A){if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasGlobal(n)!==!0)throw new l(e,s.ModuleExportNotFound,t);a.setGlobal(n,x(i,t.operator,await a.global(n),t,e))}else{if(!k(a))throw j(a)?new l(e,s.Immutable,t):new l(e,s.InvalidParameter,t);if(g(n)===!1)throw new l(e,s.KeyAccessorMustBeString,t);if(a.hasField(n)===!0)a.setField(n,x(i,t.operator,a.field(n),t,e));else{if(t.operator!=="=")throw new l(e,s.FieldNotFound,t,{key:n});a.setField(n,x(i,t.operator,null,t,e))}}return p}const o=y(r);if(e.localScope!=null&&e.localScope[o]!==void 0){const a=await u(e,t.right);return e.localScope[o]={value:x(a,t.operator,e.localScope[o].value,t,e),valueset:!0,node:t.right},p}if(e.globalScope[o]!==void 0){const a=await u(e,t.right);return e.globalScope[o]={value:x(a,t.operator,e.globalScope[o].value,t,e),valueset:!0,node:t.right},p}throw new l(e,s.InvalidIdentifier,t)}async function Zt(e,t){const r=await u(e,t.expression);return r===p?p:new z(r)}async function Dt(e,t){const r=await u(e,t.test);if(r===!0)return b(e,t.consequent);if(r===!1)return t.alternate!==null?b(e,t.alternate):p;throw new l(e,s.BooleanConditionRequired,t)}async function H(e,t){return it(e,t,0)}async function it(e,t,r){if(r>=t.body.length)return p;const o=await b(e,t.body[r]);return o instanceof v||o===F||o===E||r===t.body.length-1?o:it(e,t,r+1)}async function Tt(e,t){if(t.argument===null)return new v(p);const r=await u(e,t.argument);return new v(r)}async function Pt(e,t){const r=y(t.id);return e.globalScope[r]={valueset:!0,node:null,value:new Ct(t,e)},p}async function qt(e,t){const r=y(t.specifiers[0].local),o=e.libraryResolver.loadLibrary(r);let a;return e.libraryResolver._moduleSingletons?.has(o.uri)?a=e.libraryResolver._moduleSingletons.get(o.uri):(a=new A(o),await a.loadModule(e),e.libraryResolver._moduleSingletons?.set(o.uri,a)),e.globalScope[r]={value:a,valueset:!0,node:t},p}async function Gt(e,t){if(await b(e,t.declaration),t.declaration.type==="FunctionDeclaration")e.exports[y(t.declaration.id)]="function";else if(t.declaration.type==="VariableDeclaration")for(const r of t.declaration.declarations)e.exports[y(r.id)]="variable";return p}async function lt(e,t,r){return r>=t.declarations.length?p:(await Vt(e,t.declarations[r]),r===t.declarations.length-1||await lt(e,t,r+1),p)}async function Vt(e,t){let r=null;if(r=t.init===null?null:await u(e,t.init),e.localScope!==null){if(r===p&&(r=null),t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const a=y(t.id);return void(e.localScope!=null&&(e.localScope[a]={value:r,valueset:!0,node:t.init}))}if(t.id.type!=="Identifier")throw new l(e,s.InvalidIdentifier,t);const o=y(t.id);r===p&&(r=null),e.globalScope[o]={value:r,valueset:!0,node:t.init}}async function _t(e,t){const r=await u(e,t.object);if(r===null)throw new l(e,s.MemberOfNull,t);if(t.computed===!1){if(t.property.type==="Identifier"){if(r instanceof M||k(r))return r.field(t.property.name);if(r instanceof tt)return J(r,t.property.name,e,t);if(r instanceof A){if(!r.hasGlobal(t.property.name))throw new l(e,s.InvalidIdentifier,t);return r.global(t.property.name)}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}let o=await u(e,t.property);if(r instanceof M||k(r)){if(g(o))return r.field(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof A){if(g(o))return r.global(o);throw new l(e,s.InvalidMemberAccessKey,t)}if(r instanceof tt){if(g(o))return J(r,o,e,t);throw new l(e,s.InvalidMemberAccessKey,t)}if(U(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}if(j(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length()+o),o>=r.length()||o<0)throw new l(e,s.OutOfBounds,t);return r.get(o)}throw new l(e,s.InvalidMemberAccessKey,t)}if(g(r)){if(C(o)&&isFinite(o)&&Math.floor(o)===o){if(o<0&&(o=r.length+o),o>=r.length||o<0)throw new l(e,s.OutOfBounds,t);return r[o]}throw new l(e,s.InvalidMemberAccessKey,t)}throw new l(e,s.InvalidMemberAccessKey,t)}async function Wt(e,t){const r=await u(e,t.argument);if(R(r)){if(t.operator==="!")return!r;if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}if(t.operator==="-")return-1*f(r);if(t.operator==="+")return 1*f(r);if(t.operator==="~")return~f(r);throw new l(e,s.UnsupportedUnaryOperator,t)}async function zt(e,t){const r=[];for(let o=0;o>":case">>>":case"^":case"&":return St(f(r),f(o),t.operator);case"==":return D(r,o);case"!=":return!D(r,o);case"<":case">":case"<=":case">=":return bt(r,o,t.operator);case"+":return g(r)||g(o)?O(r)+O(o):f(r)+f(o);case"-":return f(r)-f(o);case"*":return f(r)*f(o);case"/":return f(r)/f(o);case"%":return f(r)%f(o);default:throw new l(e,s.UnsupportedOperator,t)}}async function Ht(e,t){const r=await u(e,t.left);if(!R(r))throw new l(e,s.LogicalExpressionOnlyBoolean,t);switch(t.operator){case"||":{if(r===!0)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}case"&&":{if(r===!1)return r;const o=await u(e,t.right);if(R(o))return o;throw new l(e,s.LogicExpressionOrAnd,t)}default:throw new l(e,s.LogicExpressionOrAnd,t)}}async function Y(e,t){const r=y(t);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(o.valueset===!0)return o.value;if(o.d!==null)return o.d;o.d=u(e,o.node);const a=await o.d;return o.value=a,o.valueset=!0,a}throw new l(e,s.InvalidIdentifier,t)}async function Yt(e,t){if(t.callee.type==="MemberExpression"){const o=await u(e,t.callee.object);if(!(o instanceof A))throw new l(e,s.FunctionNotFound,t);const a=t.callee.computed===!1?t.callee.property.name:await u(e,t.callee.property);if(!o.hasGlobal(a))throw new l(e,s.FunctionNotFound,t);const n=await o.global(a);if(!S(n))throw new l(e,s.CallNonFunction,t);return n.call(e,t)}if(t.callee.type!=="Identifier")throw new l(e,s.FunctionNotFound,t);const r=y(t.callee);if(e.localScope!=null&&e.localScope[r]!==void 0){const o=e.localScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}if(e.globalScope[r]!==void 0){const o=e.globalScope[r];if(S(o.value))return o.value.call(e,t);throw new l(e,s.CallNonFunction,t)}throw new l(e,s.FunctionNotFound,t)}async function Jt(e,t){let r="",o=0;for(const a of t.quasis)if(r+=a.value?a.value.cooked:"",a.tail===!1){if(t.expressions[o]){const n=await u(e,t.expressions[o]);if(S(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);r+=O(n)}o++}return r}const h={};async function st(e,t,r,o){const a=await u(e,t.arguments[r]);if(D(a,o))return u(e,t.arguments[r+1]);const n=t.arguments.length-r;return n===1?u(e,t.arguments[r]):n===2?null:n===3?u(e,t.arguments[r+2]):st(e,t,r+2,o)}async function ct(e,t,r,o){if(o===!0)return u(e,t.arguments[r+1]);if(t.arguments.length-r===3)return u(e,t.arguments[r+2]);const a=await u(e,t.arguments[r+2]);if(R(a)===!1)throw new l(e,s.ModuleExportNotFound,t.arguments[r+2]);return ct(e,t,r+2,a)}async function Z(e,t,r,o){const a=e.body;if(r.length!==e.params.length)throw new l(t,s.WrongNumberOfParameters,null);for(let i=0;ii.map(i=>d[i]); -import{_ as je}from"./main-ugzBrWNm.js";import{d as k,j as Ki,g as se,w as V,F as Gt,h as Xi,D as Qi,l as le,m as ae,G as We,n as Ne,p as yt,q as fn,r as Wn,t as $e,B as Gr,R as sr,Q as Yi,J as Pt,K as Zr,O as jr,P as $i,f as ea}from"./story-BfX8CRfG.js";import{T as h,n as c,U as Y,b as X,S as W,y as S,u as qe,v as _n,m as ta,E as _t,k as Vr,G as ur,C as _,Z as P,t as K,a as qn,R as nn,r as rn,h as Q,c as q,d as ce,w as D,e as B,f as m,M as E,P as oe,g as N,i as na,_ as lr,z as te,j as it,J as L,l as I,o as Pe,p as Ye,q as Tn,L as Tt,s as at,I as Jr,x as ra,$ as mn,W as ia,Q as aa,X as oa,A as sa,B as nt,D as Hn,F as ua,H as Kn,O as He,Y as cr,K as pn,N as la,V as Wr,a0 as qr,a1 as he,a2 as Dn,a3 as gn,a4 as ft,a5 as Fe,a6 as Le,a7 as Ot,a8 as Hr,a9 as an,aa as Kr,ab as Zt,ac as Xr,ad as Kt}from"./languageUtils-BYxF9hRA-BBstOXAc.js";import{r as G,m as ye,O as we,u as jt,I as Se,A as Vt,z as re}from"./TimeOnly-DSMefxKy-BU7RNYWc.js";import{n as et}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{n as ca}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{o as ha}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{M as da}from"./number-eRKYXfX9-eI8aiR_7.js";import{M as hr}from"./shared-D1w-26bA-B8KlJvO_.js";import{r as Ft}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";function $(e){return e.name.toLowerCase()}let on=class{constructor(e,t){this._moduleSingletons=e,this._syntaxModules=t}loadLibrary(e){if(this._syntaxModules==null)return null;const t=this._syntaxModules[e];return t?{syntax:t.script,uri:t.uri}:null}};function fa(e){Qr=e}let Qr;function Mt(e){return e===null?null:ce(e)?e.clone():_t(e)?e:nn(e)?e.clone():P(e)?e.toArray().map(t=>Mt(t)):_(e)?e.map(t=>Mt(t)):K(e)?Qr.createFromArcadeFeature(e):Hn(e)||rn(e)?e:qn(e)||e?.declaredClass==="esri.arcade.Attachment"?e.deepClone():(e?.declaredClass==="esri.arcade.Portal"||ua(e)||e instanceof Kn||Y(e),e)}function Xt(e,t,n=!1,r=!1){if(e==null)return null;if(W(e))return m(e);if(X(e))return Tt(e);if(S(e))return E(e);if(ce(e))return oe(e,t);if(q(e)||Q(e))return e;if(_(e)){const s=[];for(const o of e)s.push(Xt(o,t,n,r));return s}if(r&&nn(e))return e;const a=new v;a.immutable=!1;for(const s of Object.keys(e)){const o=e[s];o!==void 0&&a.setField(s,Xt(o,t,n,r))}return a.immutable=n,a}let v=class Wt{constructor(t){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=t instanceof Wt?t.attributes:t??{}}field(t){const n=t.toLowerCase(),r=this.attributes[t];if(r!==void 0)return r;for(const a in this.attributes)if(a.toLowerCase()===n)return this.attributes[a];throw new h(null,c.FieldNotFound,null,{key:t})}setField(t,n){if(this.immutable)throw new h(null,c.Immutable,null);if(Y(n))throw new h(null,c.NoFunctionInDictionary,null);const r=t.toLowerCase();if(n instanceof Date&&(n=G.dateJSToArcadeDate(n)),this.attributes[t]===void 0){for(const a in this.attributes)if(a.toLowerCase()===r)return void(this.attributes[a]=n);this.attributes[t]=n}else this.attributes[t]=n}hasField(t){const n=t.toLowerCase();if(this.attributes[t]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let t=[];for(const n in this.attributes)t.push(n);return t=t.sort(),t}castToText(t=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return"{"+n+"}"}static convertObjectToArcadeDictionary(t,n,r=!0,a=!1){const s=new Wt;s.immutable=!1;for(const o in t){const i=t[o];i!==void 0&&s.setField(o.toString(),Xt(i,n,r,a))}return s.immutable=r,s}static convertJsonToArcade(t,n,r=!1,a=!1){return Xt(t,n,r,a)}castAsJson(t=null){const n={};for(let r in this.attributes){const a=this.attributes[r];a!==void 0&&(t?.keyTranslate&&(r=t.keyTranslate(r)),n[r]=_n(a,t))}return n}async castDictionaryValueAsJsonAsync(t,n,r,a=null,s){const o=await ta(r,a,s);return t[n]=o,o}async castAsJsonAsync(t=null,n=null){const r={},a=[];for(let s in this.attributes){const o=this.attributes[s];n?.keyTranslate&&(s=n.keyTranslate(s)),o!==void 0&&(_t(o)||o instanceof k||o instanceof G?r[s]=_n(o,n):a.push(this.castDictionaryValueAsJsonAsync(r,s,o,t,n)))}return a.length>0&&await Promise.all(a),r}deepClone(){const t=new Wt;t.immutable=!1;for(const n of this.keys())t.setField(n,Mt(this.field(n)));return t}},Oe=0;function mt(e,t,n,r,a=1){let s;switch(t=t.toLowerCase()){case"hasz":{const o=e.hasZ;return o!==void 0&&o}case"hasm":{const o=e.hasM;return o!==void 0&&o}case"spatialreference":{let o=e.spatialReference._arcadeCacheId;if(o===void 0){let u=!0;Ki.isFrozen(e.spatialReference)&&(u=!1),u&&(Oe++,e.spatialReference._arcadeCacheId=Oe,o=Oe)}const i=new v({wkt:e.spatialReference.wkt,wkid:e.spatialReference.wkid});return o!==void 0&&(i._arcadeCacheId="SPREF"+o.toString()),i}}switch(e.type){case"extent":switch(t){case"xmin":case"xmax":case"ymin":case"ymax":case"zmin":case"zmax":case"mmin":case"mmax":{const o=e[t];return o!==void 0?o:null}case"type":return"Extent"}break;case"polygon":switch(t){case"rings":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.rings,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polygon"}break;case"point":switch(t){case"x":case"y":case"z":case"m":return e[t]??null;case"type":return"Point"}break;case"polyline":switch(t){case"paths":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.paths,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polyline"}break;case"multipoint":switch(t){case"points":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new Vr(e.points,e.spatialReference,e.hasZ===!0,e.hasM===!0,s,1);case"type":return"Multipoint"}}if(a===1)throw new h(n,c.InvalidIdentifier,r);return a===2?{keystate:"notfound"}:null}function Xn(e,t){let n,r=e;if(r==null)return null;if(_(t))n=t;else if(P(t))n=t.toArray();else{if(t==null)return null;n=[t]}for(const a of n){if(K(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(qn(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(nn(r)){if(S(a)===!1)return null;r=mt(r,a,null,null,0)}else if(_(r)){if(W(a)===!1)return null;r=a>=0?r[a]:r[r.length+a]}else{if(!P(r)||W(a)===!1)return null;r=a>=0?r.get(a):r.get(r.length()+a)}if(r==null)return null}return r}let H=class Ce{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(t,n){const r=new Ce;return r.contextTimeZone=n??null,r._geometry=t.geometry!=null?t.geometry:null,t.attributes===void 0||t.attributes===null?r.attributes={}:r.attributes=t.attributes,t._sourceLayer?(r._layer=t._sourceLayer,r._fieldTypesFixed=!1):t._layer?(r._layer=t._layer,r._fieldTypesFixed=!1):t.layer&&"fields"in t.layer?(r._layer=t.layer,r._fieldTypesFixed=!1):t.sourceLayer&&"fields"in t.sourceLayer&&(r._layer=t.sourceLayer,r._fieldTypesFixed=!1),r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static createFromArcadeFeature(t){if(t instanceof Ce){const r=new Ce;return r._fieldTypesFixed=t._fieldTypesFixed,r.attributes=t.attributes,r._geometry=t._geometry,r._optimizedGeomDefinition=t._optimizedGeomDefinition,t._layer&&(r._layer=t._layer),r.fieldsIndex=t.fieldsIndex,r.contextTimeZone=t.contextTimeZone,r}const n={};for(const r of t.keys())n[r]=t.field(r);return Ce.createFromGraphicLikeObject(t.geometry(),n,t.fullSchema(),t.contextTimeZone)}static createFromOptimisedFeature(t,n,r){const a=new Ce;return a._geometry=t.geometry?{geometry:t.geometry}:null,a._optimizedGeomDefinition=r,a.attributes=t.attributes||{},a._layer=n,a._fieldTypesFixed=!1,a}static createFromArcadeDictionary(t,n){const r=new Ce;return r.attributes=t.field("attributes"),r.attributes!==null&&r.attributes instanceof v?(r.attributes=r.attributes.attributes,r.attributes===null&&(r.attributes={})):r.attributes={},r._geometry=t.field("geometry"),r._geometry!==null&&(r._geometry instanceof v?r._geometry=Ce.parseGeometryFromDictionary(r._geometry,n):r._geometry instanceof k||(r._geometry=null)),r}static createFromGraphicLikeObject(t,n,r=null,a){const s=new Ce;return s.contextTimeZone=a??null,n===null&&(n={}),s.attributes=n,s._geometry=t??null,s._layer=r,s._layer&&(s._fieldTypesFixed=!1,s.fieldsIndex=this.hydrateFieldsIndex(s._layer)),s}static hydrateFieldsIndex(t){return t===null?null:rn(t)?t.getFieldsIndex():t.fieldsIndex?t.fieldsIndex:ha.fromLayerJSON({datesInUnknownTimezone:t.datesInUnknownTimezone,fields:t.fields,timeInfo:t.timeInfo,editFieldsInfo:t.editFieldsInfo,dateFieldsTimeReference:t.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(t,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=t??null,this._layer=r,this._layer?this._fieldTypesFixed=!1:this._fieldTypesFixed=!0}castToText(t=!1){let n="";this._fieldTypesFixed===!1&&this._fixFieldTypes();for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof ye||a instanceof we?n+=`${JSON.stringify(r)}:${JSON.stringify(a.toString())}`:a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return'{"geometry":'+(this.geometry()===null?"null":qe(this.geometry()))+',"attributes":{'+n+"}}"}_fixFieldTypes(){if(this._fieldsToFixDataTypes&&this._fieldsToFixDataTypes?.length>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const t=[],n=this._layer.fields;for(let r=0;r0&&this._fixAllFields(t),this._fieldTypesFixed=!0}isUnknownDateTimeField(t){return this.fieldsIndex?.getTimeZone(t)==="unknown"}_fixAllFields(t){this.attributes={...this.attributes};const n=this.contextTimeZone??"system";for(let r=0;r!n&&(a.type==="Identifier"&&a.name&&a.name.toLowerCase()===r&&(n=!0),!0)),n}function $r(e){const t=[];return j(e,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&t.push({libname:$(n.specifiers[0].local),source:n.source.value}),!0)),t}function Da(e,t){let n=!1;const r=t.toLowerCase();return j(e,a=>!n&&(a.type!=="CallExpression"||a.callee.type!=="Identifier"||!a.callee.name||a.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function ga(e){const t=[];return j(e,n=>n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.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"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)),t}function ya(e){const t=[];return j(e,n=>{if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let r="";for(let a=0;a<(n.arguments||[]).length;a++)a===0?n.arguments[a].type==="Identifier"&&(r=n.arguments[a].name.toLowerCase()):r&&n.arguments[a].type==="Literal"&&fr(n.arguments[a].value)&&t.push(r+"."+n.arguments[a].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let r="";return n.arguments[0].type==="Identifier"&&(r=n.arguments[0].name.toLowerCase()),r&&n.arguments[1].type==="Literal"&&fr(n.arguments[1].value)&&t.push(r+"."+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?t.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"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)}),t}function Nn(e){const t=[];return j(e,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&t.push(n.callee.name.toLowerCase()),!0)),t}function Ut(e,t=[]){let n=null;if(e.usesFeatureSet===void 0){n===null&&(n=Nn(e)),e.usesFeatureSet=!1;for(let r=0;r0){for(const r of t)if(Yr(e,r)){e.usesFeatureSet=!0,e.isAsync=!0;break}}}if(e.usesModules===void 0&&(e.usesModules=!1,$r(e).length>0&&(e.usesModules=!0)),e.usesGeometry===void 0){e.usesGeometry=!1,n===null&&(n=Nn(e));for(let r=0;r0||u.length>0;)if(i.length>0&&u.length>0){let d=l(i[0],u[0]);isNaN(d)&&(d=0),d<=0?(f.push(i[0]),i=i.slice(1)):(f.push(u[0]),u=u.slice(1))}else i.length>0?(f.push(i[0]),i=i.slice(1)):u.length>0&&(f.push(u[0]),u=u.slice(1));return f}async function a(i,u){const l=i.length,f=Math.floor(l/2);if(l===0)return[];if(l===1)return[i[0]];const d=[await a(i.slice(0,f),u),await a(i.slice(f,l),u)];return s(d[0],d[1],u,[])}async function s(i,u,l,f){const d=f;if(i.length>0||u.length>0){if(i.length>0&&u.length>0){let p=await l(i[0],u[0]);return isNaN(p)&&(p=1),p<=0?(d.push(i[0]),i=i.slice(1)):(d.push(u[0]),u=u.slice(1)),s(i,u,l,f)}return i.length>0?(d.push(i[0]),s(i=i.slice(1),u,l,f)):(d.push(u[0]),s(i,u=u.slice(1),l,f))}return f}function o(i,u,l,f){D(l,1,2,i,u);let d=l[0];if(P(d)&&(d=d.toArray()),_(d)===!1)throw new h(i,c.InvalidParameter,u);if(l.length>1){if(Y(l[1])===!1)throw new h(i,c.InvalidParameter,u);let x=d;const O=l[1].createFunction(i);return f?a(x,O):(x=n(x,(ne,de)=>O(ne,de)),x)}let p=d;if(p.length===0)return[];const g={};for(let x=0;x1||b==="String"?n(p,(x,O)=>{if(x==null||x===I)return O==null||O===I?0:1;if(O==null||O===I)return-1;const ne=E(x),de=E(O);return nex-O):b==="Boolean"?n(p,(x,O)=>x===O?0:O?-1:1):b==="Date"?n(p,(x,O)=>O-x):p.slice(),p}e.functions.array=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,0,2,i,u),d.length===0)return[];if(d.length===1&&d[0]===null)return[];if(_(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].slice()}if(P(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].toArray().slice()}const p=m(d[0]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=N(d[1],null),y=new Array(p);return y.fill(g),y})},e.functions.front=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(0)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][0]}throw new h(i,c.InvalidParameter,u)})},e.functions.back=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(d[0].length()-1)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][d[0].length-1]}throw new h(i,c.InvalidParameter,u)})},e.functions.push=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,2,i,u),_(d[0]))return d[0][d[0].length]=d[1],d[0].length;throw new h(i,c.InvalidParameter,u)})},e.functions.pop=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);const p=d[0][d[0].length-1];return d[0].length=d[0].length-1,p}throw new h(i,c.InvalidParameter,u)})},e.functions.erase=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,2,i,u),_(d[0])){let p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[0];if(g.length<=0)throw new h(i,c.OutOfBounds,u);if(p<0&&(p=g.length+p),p<0)throw new h(i,c.OutOfBounds,u);if(p>=g.length)throw new h(i,c.OutOfBounds,u);return g.splice(p,1),I}throw new h(i,c.InvalidParameter,u)})},e.functions.insert=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,3,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[2],y=d[0];if(p>y.length)throw new h(i,c.OutOfBounds,u);if(p<0&&p<-1*y.length)throw new h(i,c.OutOfBounds,u);return p===y.length?(y[p]=g,I):(y.splice(p,0,g),I)}throw new h(i,c.InvalidParameter,u)})},e.functions.resize=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(p<0)throw new h(i,c.InvalidParameter,u);const g=N(d[2],null),y=d[0];if(y.length>=p)return y.length=p,I;const b=y.length;y.length=p;for(let x=b;x{if(D(d,2,2,i,u),_(d[0])){const p=d[1];return!!d[0].some(g=>Pe(g,p))}if(P(d[0])){const p=d[1];return!!d[0].toArray().some(g=>Pe(g,p))}throw new h(i,c.InvalidParameter,u)})},e.functions.slice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,3,i,u),_(d[0])){const p=m(N(d[1],0)),g=m(N(d[2],d[0].length));if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);return d[0].slice(p,g)}if(P(d[0])){const p=d[0],g=m(N(d[1],0)),y=m(N(d[2],p.length()));if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(y)||He(y)===!1)throw new h(i,c.InvalidParameter,u);return p.toArray().slice(g,y)}throw new h(i,c.InvalidParameter,u)})},e.functions.splice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{const p=[];for(let g=0;g{if(D(d,2,2,i,u),_(d[0]))return m(d[1])>=d[0].length?d[0].slice():d[0].slice(0,m(d[1]));if(P(d[0]))return m(d[1])>=d[0].length()?d[0].slice():d[0].slice(0,m(d[1]));throw new h(i,c.InvalidParameter,u)})},e.functions.first=function(i,u){return e.standardFunction(i,u,(l,f,d)=>(D(d,1,1,i,u),_(d[0])?d[0].length===0?null:d[0][0]:P(d[0])?d[0].length()===0?null:d[0].get(0):null))},e.mode==="sync"&&(e.functions.sort=function(i,u){return e.standardFunction(i,u,(l,f,d)=>o(i,f,d,!1))},e.functions.any=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=p(y);if(X(b)&&b===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)!==!0)return!1;return!0})},e.functions.none=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)===!0)return!1;return!0})},e.functions.reduce=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);return d.length===2?g.length===0?null:g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null}):g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null},d[2])})},e.functions.map=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=p(b);x!==void 0&&x!==I?y.push(x):y.push(null)}return y})},e.functions.filter=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g)p(b)===!0&&y.push(b);return y})}),e.mode==="async"&&(e.functions.sort=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>o(i,f,d,!0))},e.functions.any=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,X(x)&&x===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x!==!0)return!1}return!0})},e.functions.none=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x===!0)return!1}return!0})},e.functions.filter=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O===!0&&y.push(b)}return y})},e.functions.reduce=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);let y;if(d.length>2){const b=N(d[2],null);y=g.reduce(async(x,O)=>{let ne=await x;return ne!==void 0&&ne!==I||(ne=null),p(ne,O)},Promise.resolve(b))}else{if(g.length===0)return null;y=g.reduce(async(b,x,O)=>{if(O<=1)return p(b,x);let ne=await b;return ne!==void 0&&ne!==I||(ne=null),p(ne,x)})}return y.then(b=>b!==void 0&&b!==I?b:null)})},e.functions.map=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O!==void 0&&O!==I?y.push(O):y.push(null)}return y})})}const Rn=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:wa},Symbol.toStringTag,{value:"Module"}));function xa(e,t,n){return e+(Fa(n)?Ca:Aa)[t]}function Fa(e){return e%4==0&&(e%100!=0||e%400==0)}const Aa=[0,31,59,90,120,151,181,212,243,273,304,334],Ca=[0,31,60,91,121,152,182,213,244,274,305,335];function Te(e){return e===null?e:e.isValid===!1?null:e}function At(e,t){return e===""||e.toLowerCase().trim()==="default"?B(t):e==="z"||e==="Z"?"UTC":e}function ze(e,t){return q(e)?e.toArcadeDate():oe(e,B(t))}function ei(e,t){e.today=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=new Date;return i.setHours(0,0,0,0),G.dateJSAndZoneToArcadeDate(i,B(n))})},e.time=function(n,r){return t(n,r,(a,s,o)=>{switch(D(o,0,4,n,r),o.length){case 0:{const i=G.nowToArcadeDate(B(n));return new ye(i.hour,i.minute,i.second,i.millisecond)}case 1:{if(Q(o[0]))return o[0].clone();if(ce(o[0]))return new ye(o[0].hour,o[0].minute,o[0].second,o[0].millisecond);if(q(o[0]))return new ye(0,0,0,0);if(S(o[0]))return ye.fromString(o[0]);const i=m(o[0]);return isNaN(i)===!1?ye.fromMilliseconds(i):null}case 2:return S(o[0])&&S(o[1])?ye.fromString(o[0],o[1]):ye.fromParts(m(o[0]),m(o[1]),0,0);case 3:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),0);case 4:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),m(o[3]))}throw new h(n,c.InvalidParameter,r)})},e.dateonly=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,3,n,r),o.length===3)return we.fromParts(m(o[0]),m(o[1])+1,m(o[2]));if(o.length===2){const i=E(o[1]);return i===""?null:i==="X"?we.fromSeconds(m(o[0])):i==="x"?we.fromMilliseconds(m(o[0])):we.fromString(E(o[0]),i)}if(o.length===1){if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return we.fromString(o[0]+"-01-01")}if(q(o[0]))return o[0].clone();if(ce(o[0]))return we.fromParts(o[0].year,o[0].monthJS+1,o[0].day);const i=m(o[0]);return isNaN(i)===!1?we.fromMilliseconds(i):S(o[0])?we.fromString(o[0]):null}if(o.length===0){const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:we.fromParts(i.year,i.monthJS+1,i.day)}return null})},e.changetimezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),o[0]===null)return null;if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneDateOnly,r);if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneTime,r);const i=oe(o[0],B(n));if(i===null)throw new h(n,c.InvalidParameter,r);const u=jt(At(E(o[1]),n),!1);if(u===null)return null;const l=G.arcadeDateAndZoneToArcadeDate(i,u);return l.isValid===!1?null:l})},e.timezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,2,n,r),Q(o[0])||q(o[0]))return"Unknown";const i=oe(o[0],B(n));if(i===null)return null;const u=i.timeZone;return u==="system"?G.systemTimeZoneCanonicalName:u.toLowerCase()==="utc"?"UTC":u.toLowerCase()==="unknown"?"Unknown":u})},e.timezoneoffset=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:60*i.timeZoneOffset*1e3})},e.now=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:i})},e.timestamp=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowUTCToArcadeDate();return i.isValid===!1?null:i})},e.toutc=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toUTC()})},e.tolocal=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toLocal()})},e.day=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.day})},e.month=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthJS})},e.year=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.year})},e.hour=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].hour;const i=oe(o[0],B(n));return i===null?NaN:i.hour})},e.second=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].second;const i=oe(o[0],B(n));return i===null?NaN:i.second})},e.millisecond=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].millisecond;const i=oe(o[0],B(n));return i===null?NaN:i.millisecond})},e.minute=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].minute;const i=oe(o[0],B(n));return i===null?NaN:i.minute})},e.week=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=ze(o[0],B(n));if(i===null)return NaN;const u=m(N(o[1],0));if(u<0||u>6)throw new h(n,c.InvalidParameter,r);const l=i.day,f=i.monthJS,d=i.year,p=i.dayOfWeekJS,g=xa(l,f,d)-1,y=Math.floor(g/7);return p-u+(p-u<0?7:0){D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekJS})},e.isoweekday=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekISO})},e.isomonth=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthISO})},e.isoweek=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.weekISO})},e.isoyear=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.yearISO})},e.date=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,8,n,r),o.length===3){if(q(o[0])&&Q(o[1])&&S(o[2])){const i=jt(At(E(o[2])??"unknown",n),!1);return i===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,i))}return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),0,0,0,0,B(n)))}if(o.length===4)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),0,0,0,B(n)));if(o.length===5)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),0,0,B(n)));if(o.length===6)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),0,B(n)));if(o.length===7)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),B(n)));if(o.length===8){const i=jt(At(E(o[7])??"unknown",n),!1);return i===null?null:Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),i))}if(o.length===2){if(q(o[0])&&S(o[1])){const l=jt(At(E(o[1])??"unknown",n),!1);return l===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,l))}if(q(o[0])&&Q(o[1]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,"unknown"));let i,u=E(o[1]);return u===""?null:(u=na(u,!0),i=u==="X"?Gt.fromSeconds(m(o[0])):u==="x"?Gt.fromMillis(m(o[0])):Gt.fromFormat(E(o[0]),u,{locale:Xi(),numberingSystem:"latn"}),i.isValid?G.dateTimeToArcadeDate(i):null)}if(o.length===1){if(q(o[0]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,"unknown"));if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return oe(o[0]+"-01-01",B(n))}const i=m(o[0]);if(isNaN(i)===!1){const u=Gt.fromMillis(i);return u.isValid?G.dateTimeAndZoneToArcadeDate(u,B(n)):null}return oe(o[0],B(n))}return o.length===0?G.nowToArcadeDate(B(n)):null})},e.datediff=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),Q(o[0]))return Q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(Q(o[1]))return NaN;if(q(o[0]))return q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(q(o[1]))return NaN;let i=oe(o[0],B(n)),u=oe(o[1],B(n));if(i===null||u===null)return NaN;let l=N(o[3],"");switch(l!==""&&l!==null?(l=At(E(l),n),i=G.arcadeDateAndZoneToArcadeDate(i,l),u=G.arcadeDateAndZoneToArcadeDate(u,l)):i.timeZone!==u.timeZone&&(i.isUnknownTimeZone?i=G.arcadeDateAndZoneToArcadeDate(i,u.timeZone):u=(u.isUnknownTimeZone,G.arcadeDateAndZoneToArcadeDate(u,i.timeZone))),E(o[2]).toLowerCase()){case"days":case"day":case"d":return i.diff(u,"days");case"months":case"month":return i.diff(u,"months");case"minutes":case"minute":case"m":return o[2]==="M"?i.diff(u,"months"):i.diff(u,"minutes");case"seconds":case"second":case"s":return i.diff(u,"seconds");case"milliseconds":case"millisecond":case"ms":default:return i.diff(u);case"hours":case"hour":case"h":return i.diff(u,"hours");case"years":case"year":case"y":return i.diff(u,"years")}})},e.dateadd=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=m(o[1]);if(isNaN(i)||i===1/0||i===-1/0)return Q(o[0])||q(o[0])?o[0].clone():oe(o[0],B(n));let u="milliseconds";switch(E(o[2]).toLowerCase()){case"days":case"day":case"d":u="days",i=q(o[0])?i:lr(i);break;case"months":case"month":u="months",i=q(o[0])?i:lr(i);break;case"minutes":case"minute":case"m":u=o[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":u="seconds";break;case"milliseconds":case"millisecond":case"ms":u="milliseconds";break;case"hours":case"hour":case"h":u="hours";break;case"years":case"year":case"y":u="years"}if(Q(o[0])||q(o[0]))return o[0].plus(u,i);const l=oe(o[0],B(n));return l===null?null:l.plus({[u]:i})})}}function De(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}function ti(e,t,n){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0)}const Et=[];for(const e of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const t=e[0];for(let n=1;n0?(r.x/=a,r.y/=a,t&&(r.z/=a),n&&(r.m/=a)):(r.x=e[0][0],r.y=e[0][1],t&&(r.z=e[0][2]),n&&t?r.m=e[0][3]:n&&(r.m=e[0][2])),r}function Ea(e,t,n,r){const a={x:(e[0]+t[0])/2,y:(e[1]+t[1])/2};return n&&(a.z=(e[2]+t[2])/2),n&&r?a.m=(e[3]+t[3])/2:r&&(a.m=(e[2]+t[2])/2),a}function ba(e,t){if(e.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=a,n.y/=a,e.hasZ===!0&&(n.z/=a),e.hasM===!0&&(n.m/=a),new V(n)):r>0?(t.x/=r,t.y/=r,e.hasZ===!0&&(n.z/=r),e.hasM===!0&&(t.m/=r),new V(t)):null}function Ia(e){if(e.points.length===0)return null;let t=0,n=0,r=0,a=0;for(let o=0;o=r;)e-=t;return e}function ri(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function _a(e,t){return ln(ri(e,t),2*Math.PI)*(180/Math.PI)}function Ta(e,t){return ln(Math.PI/2-ri(e,t),2*Math.PI)*(180/Math.PI)}function ii(e,t,n){const r={x:e.x-t.x,y:e.y-t.y},a={x:n.x-t.x,y:n.y-t.y};return Math.atan2(Ba(r,a),ka(r,a))}function Ma(e,t,n){return Gr(ln(ii(e,t,n),2*Math.PI))}function Na(e,t,n){return Gr(ln(-1*ii(e,t,n),2*Math.PI))}It[9002]=.3048,It[9003]=.3048006096012192,It[9095]=.3048007491;const ie=[0,0];function pr(e){for(let t=0;t1&&(r=1)),r<=.5?[t[0]+(n[0]-t[0])*r,t[1]+(n[1]-t[1])*r]:[n[0]-(n[0]-t[0])*(1-r),n[1]-(n[1]-t[1])*(1-r)]}function ai(e,t){e.ringisclockwise=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=[];if(o[0]===null)return!1;if(_(o[0]))for(const u of o[0]){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}else if(o[0]instanceof Vr)i=o[0]._elements;else{if(!P(o[0]))throw new h(n,c.InvalidParameter,r);for(const u of o[0].toArray()){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}}return!(i.length<3)&&Qi(i)})},e.polygon=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof le))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof le)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new le(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.polyline=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof ae))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof ae)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new ae(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.point=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof V)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new V(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.multipoint=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof We))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof We)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new We(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.extent=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=null;if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else if(o[0]instanceof V){const u={xmin:o[0].x,ymin:o[0].y,xmax:o[0].x,ymax:o[0].y,spatialReference:o[0].spatialReference.toJSON()},l=o[0];l.hasZ?(u.zmin=l.z,u.zmax=l.z):l.hasM&&(u.mmin=l.m,u.mmax=l.m),i=se(u)}else if(o[0]instanceof le)i=se(o[0].extent?.toJSON());else if(o[0]instanceof ae)i=se(o[0].extent?.toJSON());else if(o[0]instanceof We)i=se(o[0].extent?.toJSON());else if(o[0]instanceof Ne)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new Ne(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.geometry=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=null;if(o[0]===null)return null;if(K(o[0]))i=te(o[0].geometry(),n.spatialReference);else if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(se(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.setgeometry=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),!K(o[0]))throw new h(n,c.InvalidParameter,r);if(o[0].immutable===!0)throw new h(n,c.Immutable,r);if(!(o[1]instanceof k||o[1]===null))throw new h(n,c.InvalidParameter,r);return o[0]._geometry=o[1],I})},e.feature=function(n,r){return t(n,r,(a,s,o)=>{if(o.length===0)throw new h(n,c.WrongNumberOfParameters,r);let i;if(o.length===1)if(S(o[0]))i=H.fromJson(JSON.parse(o[0]),n.timeZone);else if(K(o[0]))i=H.createFromArcadeFeature(o[0]);else if(o[0]instanceof k)i=H.createFromGraphicLikeObject(o[0],null,null,n.timeZone);else{if(!(o[0]instanceof v))throw new h(n,c.InvalidParameter,r);{let u=o[0].hasField("geometry")?o[0].field("geometry"):null,l=o[0].hasField("attributes")?o[0].field("attributes"):null;u!==null&&u instanceof v&&(u=H.parseGeometryFromDictionary(u,n.spatialReference)),l!==null&&(l=H.parseAttributesFromDictionary(l)),i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}}else if(o.length===2){let u=null,l=null;if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}if(o[1]!==null){if(!(o[1]instanceof v))throw new h(n,c.InvalidParameter,r);l=H.parseAttributesFromDictionary(o[1])}i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}else{let u=null;const l={};if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}for(let f=1;f{if(o.length===0||o.length===1&&o[0]===null){const l=new v;return l.immutable=!1,l}if(o.length===1&&S(o[0]))try{const l=JSON.parse(o[0]),f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof k)try{const l=o[0].toJSON();l.hasZ=o[0].hasZ===!0,l.hasM=o[0].hasM===!0;const f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&K(o[0]))try{const l=new v;l.immutable=!1,l.setField("geometry",o[0].geometry());const f=new v;f.immutable=!1,l.setField("attributes",f);for(const d of o[0].keys())f.setField(d,o[0].field(d));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof v)try{const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===2&&o[0]instanceof v&&X(o[1]))try{if(o[1]!==!0){const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}return o[0].deepClone()}catch{throw new h(n,c.InvalidParameter,r)}if(o.length%2!=0)throw new h(n,c.WrongNumberOfParameters,r);const i={};for(let l=0;l{D(o,2,2,n,r);const i=E(o[1]);if(K(o[0])||o[0]instanceof v)return o[0].hasField(i);if(o[0]instanceof k){const u=mt(o[0],i,null,null,2);return!u||u.keystate!=="notfound"}throw new h(n,c.InvalidParameter,r)})},e.hasvalue=function(n,r){return t(n,r,(a,s,o)=>(D(o,2,2,n,r),Xn(o[0],o[1])!=null))},e.indexof=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);const i=o[1];if(_(o[0])){for(let u=0;u{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?_a(o[0],o[1]):Ma(o[0],o[1],o[2])})},e.bearing=function(n,r){return t(n,r,(a,s,o)=>{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?Ta(o[0],o[1]):Na(o[0],o[1],o[2])})},e.isselfintersecting=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=o[0];if(i instanceof le)return i.isSelfIntersecting;if(i instanceof ae)return pr(i.paths);if(i instanceof We){const u=i.points;for(let l=0;l0&&l[0][i]===t)return{partId:a,distanceAlong:s,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:l[0][0],y:l[0][1],...e.hasZ?{z:l[0][u]}:{},...e.hasM?{m:l[0][i]}:{}}),segmentId:0};let f=-1;for(let d=1;dt&&t>l[d-1][i]){const b=(t-l[d-1][i])/g*p;let x=e.hasZ?si(l[d-1],l[d],b,r):ui(l[d-1],l[d],b);x=[...x,t];const O=new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:x[0],y:x[1],...e.hasZ?{z:x[u]}:{},...e.hasM?{m:x[i]}:{}});return{partId:a,distanceAlong:s+o(l[d-1],[O.x,O.y,...O.hasZ?[O.z]:[],...O.hasM?[O.m]:[]],r),coordinate:O,segmentId:f}}s+=p}}return null}function ja(e,t){if(!e)return null;switch(e.type){case"extent":case"multipoint":case"mesh":case"point":return null}const n=e.type==="polygon"?e.rings:e.paths;if(t<0)return null;let r=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(r=wt(e.spatialReference)/yt(e.spatialReference));let a=0;const s=e.hasZ?3:2,o=2,i=e.hasZ?De:oi;let u=-1;if(t===0)return n.length===0||n[0].length===0?null:{partId:0,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:n[0][0][0],y:n[0][0][1],...e.hasZ?{z:n[0][0][o]}:{},...e.hasM?{m:n[0][0][s]}:{}}),segmentId:0};for(const l of n){u++;let f=-1;for(let d=1;dt){let y=e.hasZ?si(l[d-1],l[d],t-a,r):ui(l[d-1],l[d],t-a);return y=[...y,Ln(l[d-1][s],l[d][s],p,t-a)],{partId:u,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:y[0],y:y[1],...e.hasZ?{z:y[o]}:{},...e.hasM?{m:y[s]}:{}}),segmentId:f}}a=g}}return null}function Va(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0;return r=e,a=e.hasZ&&t.hasZ?De([t.x,t.y,t.z],[e.x,e.y,e.z],n):Ve([t.x,t.y],[e.x,e.y],!1),{coordinate:r,distance:a}}function Ja(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0,s=Number.MAX_VALUE,o=-1,i=-1;for(const u of e.points||[]){i++;const l=e.hasZ&&t.hasZ?ti([u[0],u[1],u[2]],[t.x,t.y,t.z],n):ni([u[0],u[1]],[t.x,t.y]);l(i=L(i),n(r,a,i),i[0]===null||i[1]===null||R.disjoint(i[0],i[1])))},e.intersects=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.intersects(i[0],i[1])))},e.touches=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.touches(i[0],i[1])))},e.crosses=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.crosses(i[0],i[1])))},e.within=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.within(i[0],i[1])))},e.contains=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.contains(i[0],i[1])))},e.overlaps=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.overlaps(i[0],i[1])))},e.equals=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),i[0]===i[1]||(i[0]instanceof k&&i[1]instanceof k?R.equals(i[0],i[1]):(ce(i[0])&&ce(i[1])||Q(i[0])&&Q(i[1])||!(!q(i[0])||!q(i[1])))&&i[0].equals(i[1]))))},e.relate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,3,3,r,a),i[0]instanceof k&&i[1]instanceof k)return R.relate(i[0],i[1],E(i[2]));if(i[0]instanceof k&&i[1]===null||i[1]instanceof k&&i[0]===null||i[0]===null&&i[1]===null)return!1;throw new h(r,c.InvalidParameter,a)})},e.intersection=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null||i[1]===null?null:R.intersect(i[0],i[1])))},e.union=function(r,a){return t(r,a,(s,o,i)=>{const u=[];if((i=L(i)).length===0)throw new h(r,c.WrongNumberOfParameters,a);if(i.length===1)if(_(i[0])){const l=L(i[0]);for(let f=0;f(i=L(i),n(r,a,i),i[0]===null?null:i[1]===null?Se(i[0]):R.difference(i[0],i[1])))},e.symmetricdifference=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null&&i[1]===null?null:i[0]===null?Se(i[1]):i[1]===null?Se(i[0]):R.symmetricDifference(i[0],i[1])))},e.clip=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof Ne)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?null:R.clip(i[0],i[1])})},e.cut=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof ae)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return[];if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?[Se(i[0])]:R.cut(i[0],i[1])})},e.area=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.planarArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarArea(i[0],Vt(N(i[1],-1)))})},e.areageodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.geodesicArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicArea(i[0],Vt(N(i[1],-1)))})},e.length=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarLength(i[0],re(N(i[1],-1)))})},e.length3d=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:u.hasZ===!0?Dr(u,re(N(i[1],-1))):R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[0].hasZ===!0?Dr(i[0],re(N(i[1],-1))):R.planarLength(i[0],re(N(i[1],-1)))})},e.lengthgeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.geodesicLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicLength(i[0],re(N(i[1],-1)))})},e.distance=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);let u=i[0];(_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference));let l=i[1];if((_(i[1])||P(i[1]))&&(l=pn(i[1],r.spatialReference)),!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(l instanceof k))throw new h(r,c.InvalidParameter,a);return R.distance(u,l,re(N(i[2],-1)))})},e.distancegeodetic=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);const u=i[0],l=i[1];if(!(u instanceof V))throw new h(r,c.InvalidParameter,a);if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);const f=new ae({paths:[],spatialReference:u.spatialReference});return f.addPath([u,l]),R.geodesicLength(f,re(N(i[2],-1)))})},e.densify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.densify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.densify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.densifygeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.geodesicDensify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.geodesicDensify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.generalize=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,4,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return R.generalize(i[0],u,Tt(N(i[2],!0)),re(N(i[3],-1)))})},e.buffer=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.buffer(i[0],u,re(N(i[2],-1)))})},e.buffergeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.geodesicBuffer(i[0],u,re(N(i[2],-1)))})},e.offset=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,6,r,a),i[0]===null)return null;if(!(i[0]instanceof le||i[0]instanceof ae))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);const l=m(N(i[4],10));if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=m(N(i[5],0));if(isNaN(f))throw new h(r,c.InvalidParameter,a);return R.offset(i[0],u,re(N(i[2],-1)),E(N(i[3],"round")).toLowerCase(),l,f)})},e.rotate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=i[0]instanceof Ne?le.fromExtent(i[0]):i[0],l=m(i[1]);if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=N(i[2],null);if(f===null)return R.rotate(u,l);if(f instanceof V)return R.rotate(u,l,f);throw new h(r,c.InvalidParameter,a)})},e.centroid=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);return u instanceof V?te(Se(u),r.spatialReference):u instanceof le?u.centroid:u instanceof ae?Sa(u):u instanceof We?Ia(u):u instanceof Ne?u.center:null})},e.measuretocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=Za(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.pointtocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);const l=i[1];if(l===null)return null;if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const f=qa(u,l);return f?v.convertObjectToArcadeDictionary(f,B(r),!1,!0):null})},e.distancetocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=ja(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.multiparttosinglepart=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);if(i[0]instanceof V)return[te(Se(i[0]),r.spatialReference)];if(i[0]instanceof Ne)return[te(Se(i[0]),r.spatialReference)];const u=R.simplify(i[0]);if(u instanceof le){const l=[],f=[];for(let d=0;d{if(i=L(i),D(i,1,1,r,a),i[0]===null)return!0;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.isSimple(i[0])})},e.simplify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.simplify(i[0])})},e.convexhull=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.convexHull(i[0])})},e.nearestcoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestCoordinate(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})},e.nearestvertex=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestVertex(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})}}function ci(e,t){function n(r,a,s){const o=m(r);return isNaN(o)?o:isNaN(a)||isNaN(s)||a>s?NaN:os?s:o}e.number=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,2,r,a);const u=i[0];if(W(u))return u;if(u===null)return 0;if(ce(u)||Q(u)||q(u))return u.toNumber();if(X(u))return Number(u);if(_(u))return NaN;if(u===""||u===void 0)return Number(u);if(S(u)){if(i[1]!==void 0){let l=Tn(i[1],"‰","");return l=Tn(l,"¤",""),da(u,{pattern:l})}return Number(u.trim())}return Number(u)})},e.abs=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.abs(m(i[0]))))},e.acos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.acos(m(i[0]))))},e.asin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.asin(m(i[0]))))},e.atan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.atan(m(i[0]))))},e.atan2=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),Math.atan2(m(i[0]),m(i[1]))))},e.ceil=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("ceil",m(i[0]),-1*u)}return Math.ceil(m(i[0]))})},e.round=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("round",m(i[0]),-1*u)}return Math.round(m(i[0]))})},e.floor=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("floor",m(i[0]),-1*u)}return Math.floor(m(i[0]))})},e.cos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.cos(m(i[0]))))},e.isnan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),typeof i[0]=="number"&&isNaN(i[0])))},e.exp=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.exp(m(i[0]))))},e.log=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.log(m(i[0]))))},e.pow=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),m(i[0])**m(i[1])))},e.random=function(r,a){return t(r,a,(s,o,i)=>(D(i,0,0,r,a),Math.random()))},e.sin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sin(m(i[0]))))},e.sqrt=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sqrt(m(i[0]))))},e.tan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.tan(m(i[0]))))},e.isempty=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),i[0]===null||i[0]===""||i[0]===void 0||i[0]===I))},e.boolean=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,1,r,a);const u=i[0];return Tt(u)})},e.constrain=function(r,a){return t(r,a,(s,o,i)=>{D(i,3,3,r,a);const u=m(i[1]),l=m(i[2]);if(_(i[0])){const f=[];for(const d of i[0])f.push(n(d,u,l));return f}if(P(i[0])){const f=[];for(let d=0;d=t&&t!==-1)return n}return n}function yn(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return Xa(t,n);case"avg":case"mean":return hi(at(t));case"min":return Math.min.apply(Math,at(t));case"sum":return Ka(at(t));case"max":return Math.max.apply(Math,at(t));case"stdev":case"stddev":return Math.sqrt(gr(at(t)));case"var":case"variance":return gr(at(t));case"count":return t.length}return 0}function Ke(e,t){if(t.length===1){if(_(t[0]))return yn(e,t[0],-1);if(P(t[0]))return yn(e,t[0].toArray(),-1)}return yn(e,t,-1)}function di(e,t){e.stdev=function(n,r){return t(n,r,(a,s,o)=>Ke("stdev",o))},e.variance=function(n,r){return t(n,r,(a,s,o)=>Ke("variance",o))},e.average=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.mean=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.sum=function(n,r){return t(n,r,(a,s,o)=>Ke("sum",o))},e.min=function(n,r){return t(n,r,(a,s,o)=>Ke("min",o))},e.max=function(n,r){return t(n,r,(a,s,o)=>Ke("max",o))},e.distinct=function(n,r){return t(n,r,(a,s,o)=>Ke("distinct",o))},e.count=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),_(o[0])||S(o[0]))return o[0].length;if(P(o[0]))return o[0].length();throw new h(n,c.InvalidParameter,r)})}}let Pn=class extends v{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}},Qa=class fi extends v{constructor(t,n,r,a,s,o,i){super(),this.attachmentUrl=s,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",t),this.setField("name",n),this.setField("contenttype",r),this.setField("size",a),this.setField("exifinfo",o),this.setField("keywords",i),this.immutable=!0}deepClone(){return new fi(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,this.field("exifinfo")?.deepClone()??null,this.field("keywords"))}};const Qn=e=>(t,n,r=14)=>+e(t,n).toFixed(r),Ya=(e,t)=>e+t,$a=(e,t)=>e*t,eo=(e,t)=>e/t,yr=(e,t,n)=>Qn(Ya)(e,t,n),dt=(e,t,n)=>Qn($a)(e,t,n),Qt=(e,t,n)=>Qn(eo)(e,t,n),Yt=360,to=400,no=2*Math.PI,Ie=3600,wr=3240,kt=60,Qe=60,xr=180*Ie/Math.PI,bt=Yt*kt*Qe,wn=90*Ie,ot=180*Ie,ro=270*Ie,mi="ᵍ",vt="°";function Ct(e){if(S(e)===!1)throw new h(null,c.InvalidParameter,null);return e}function On(e,t){const n=10**t;return Math.round(e*n)/n}function io(e,t){return e%t}function st(e){const t=parseFloat(e.toString().replace(Math.trunc(e).toString(),"0"))*Math.sign(e);return e<0?{fraction:t,integer:Math.ceil(e)}:{fraction:t,integer:Math.floor(e)}}var J,w,Z,Un;function ht(e,t){switch(e){case J.north:return t==="SHORT"?"N":"North";case J.east:return t==="SHORT"?"E":"East";case J.south:return t==="SHORT"?"S":"South";case J.west:return t==="SHORT"?"W":"West"}}function xn(e,t){return e-Math.floor(e/t)*t}function Fn(e){switch(e){case w.truncated_degrees:case w.decimal_degrees:return Yt;case w.radians:return no;case w.gradians:return to;case w.seconds:return bt;case w.fractional_degree_minutes:return kt;case w.fractional_minute_seconds:return Qe;default:throw new h(null,c.LogicError,null,{reason:"unsupported evaluations"})}}function Fr(e){switch(e.toUpperCase().trim()){case"NORTH":case"NORTHAZIMUTH":case"NORTH AZIMUTH":return Z.north_azimuth;case"POLAR":return Z.polar;case"QUADRANT":return Z.quadrant;case"SOUTH":case"SOUTHAZIMUTH":case"SOUTH AZIMUTH":return Z.south_azimuth}throw new h(null,c.LogicError,null,{reason:"unsupported directionType"})}function Ar(e){switch(e.toUpperCase().trim()){case"D":case"DD":case"DECIMALDEGREE":case"DECIMAL DEGREE":case"DEGREE":case"DECIMALDEGREES":case"DECIMAL DEGREES":case"DEGREES":return w.decimal_degrees;case"DMS":case"DEGREESMINUTESSECONDS":case"DEGREES MINUTES SECONDS":return w.degrees_minutes_seconds;case"R":case"RAD":case"RADS":case"RADIAN":case"RADIANS":return w.radians;case"G":case"GON":case"GONS":case"GRAD":case"GRADS":case"GRADIAN":case"GRADIANS":return w.gradians}throw new h(null,c.LogicError,null,{reason:"unsupported units"})}(function(e){e[e.north=0]="north",e[e.east=1]="east",e[e.south=2]="south",e[e.west=3]="west"})(J||(J={})),function(e){e[e.decimal_degrees=1]="decimal_degrees",e[e.seconds=2]="seconds",e[e.degrees_minutes_seconds=3]="degrees_minutes_seconds",e[e.radians=4]="radians",e[e.gradians=5]="gradians",e[e.truncated_degrees=6]="truncated_degrees",e[e.fractional_degree_minutes=7]="fractional_degree_minutes",e[e.fractional_minute_seconds=8]="fractional_minute_seconds"}(w||(w={})),function(e){e[e.north_azimuth=1]="north_azimuth",e[e.polar=2]="polar",e[e.quadrant=3]="quadrant",e[e.south_azimuth=4]="south_azimuth"}(Z||(Z={})),function(e){e[e.meridian=0]="meridian",e[e.direction=1]="direction"}(Un||(Un={}));let pt=class qt{constructor(t,n,r){this.m_degrees=t,this.m_minutes=n,this.m_seconds=r}getField(t){switch(t){case w.decimal_degrees:case w.truncated_degrees:return this.m_degrees;case w.fractional_degree_minutes:return this.m_minutes;case w.seconds:case w.fractional_minute_seconds:return this.m_seconds;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}static secondsToDMS(t){const n=st(t).fraction;let r=st(t).integer;const a=Math.floor(r/Ie);r-=a*Ie;const s=Math.floor(r/Qe);return r-=s*Qe,new qt(a,s,r+n)}static numberToDms(t){const n=st(t).fraction,r=st(t).integer,a=dt(st(100*n).fraction,100),s=st(100*n).integer;return new qt(r,s,a)}format(t,n){let r=On(this.m_seconds,n),a=this.m_minutes,s=this.m_degrees;if(t===w.seconds||t===w.fractional_minute_seconds)Qe<=r&&(r-=Qe,++a),kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.fractional_degree_minutes)r=0,a=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,s=this.m_degrees,kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.decimal_degrees||t===w.truncated_degrees){const o=Qt(this.m_seconds,Ie),i=Qt(this.m_minutes,kt);s=Math.round(this.m_degrees+i+o),a=0,r=0}return new qt(s,a,r)}static dmsToSeconds(t,n,r){return t*Ie+n*Qe+r}},ao=class{constructor(e,t,n){this.meridian=e,this.angle=t,this.direction=n}fetchAzimuth(e){return e===Un.meridian?this.meridian:this.direction}},Xe=class Ze{constructor(t){this._angle=t}static createFromAngleAndDirection(t,n){return new Ze(new Re(Ze._convertDirectionFormat(t.extractAngularUnits(w.seconds),n,Z.north_azimuth)))}getAngle(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:case Z.south_azimuth:case Z.polar:return new Re(Ze._convertDirectionFormat(n,Z.north_azimuth,t));case Z.quadrant:{const r=Ze.secondsNorthAzimuthToQuadrant(n);return new Re(r.angle)}}}getMeridian(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.north;case Z.south_azimuth:return J.south;case Z.polar:return J.east;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).meridian}}getDirection(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.east;case Z.south_azimuth:return J.west;case Z.polar:return J.north;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).direction}}static secondsNorthAzimuthToQuadrant(t){const n=t<=wn||t>=ro?J.north:J.south,r=n===J.north?Math.min(bt-t,t):Math.abs(t-ot),a=t>ot?J.west:J.east;return new ao(n,r,a)}static createFromAngleMeridianAndDirection(t,n,r){return new Ze(new Re(Ze.secondsQuadrantToNorthAzimuth(t.extractAngularUnits(w.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(t,n,r){return n===J.north?r===J.east?t:bt-t:r===J.east?ot-t:ot+t}static _convertDirectionFormat(t,n,r){let a=0;switch(n){case Z.north_azimuth:a=t;break;case Z.polar:a=wn-t;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:a=t+ot}let s=0;switch(r){case Z.north_azimuth:s=a;break;case Z.polar:s=wn-a;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:s=a-ot}return s=io(s,bt),s<0?bt+s:s}};function Cr(e,t,n){let r=null;switch(t){case w.decimal_degrees:r=dt(e,Ie);break;case w.seconds:r=e;break;case w.gradians:r=dt(e,wr);break;case w.radians:r=dt(e,xr);break;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case w.decimal_degrees:return Qt(r,Ie);case w.seconds:return r;case w.gradians:return Qt(r,wr);case w.radians:return r/xr;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}let Re=class zn{constructor(t){this._seconds=t}static createFromAngleAndUnits(t,n){return new zn(Cr(t,n,w.seconds))}extractAngularUnits(t){return Cr(this._seconds,w.seconds,Nt(t))}static createFromDegreesMinutesSeconds(t,n,r){return new zn(yr(yr(dt(t,Ie),dt(n,Qe)),r))}};function Nt(e){switch(jr(e),e){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}}let oo=class pi{constructor(t,n,r,a){this.view=t,this.angle=n,this.merdian=r,this.direction=a,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(t,n,r){return new pi(t,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 t=null,n=w.truncated_degrees,r=0;for(let a=0;a0?1:0),"0");case w.truncated_degrees:case w.fractional_degree_minutes:return s=xn(a.fetchFormattedDms().getField(t),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");case w.fractional_minute_seconds:return s=xn(On(a.fetchDms().getField(t),r),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}function uo(e,t,n){if(n===Z.quadrant)throw new h(null,c.LogicError,null,{reason:"conversion error"});if(t===w.degrees_minutes_seconds){const r=pt.numberToDms(e);return Xe.createFromAngleAndDirection(Re.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(e,Nt(t)),n)}function lo(e){switch(m(e)){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 Er(e){switch(e.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 ut(e){const t=parseFloat(e);if(W(t)){if(isNaN(t))throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return t}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function An(e,t,n){const r=n===Z.quadrant;let a=null,s=null,o=0,i=0,u=0;if(r){if(e.length<2)throw new h(null,c.LogicError,null,{reason:"conversion error"});u=1;const l=lo(E(e[e.length-1]));if(l?(a=l.first,s=l.second):(o=1,a=Er(E(e[0])),s=Er(E(e[e.length-1]))),a===null||s===null)throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}switch(t){case w.decimal_degrees:case w.radians:case w.gradians:if(e.length===0)throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return r?Xe.createFromAngleMeridianAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),a,s):Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),n);case w.degrees_minutes_seconds:if(i=e.length-u-o,i===3){const l=Re.createFromDegreesMinutesSeconds(ut(e[o]),ut(e[o+1]),ut(e[o+2]));return r?Xe.createFromAngleMeridianAndDirection(l,a,s):Xe.createFromAngleAndDirection(l,n)}if(i===1){const l=ut(e[o]),f=pt.numberToDms(l),d=Re.createFromDegreesMinutesSeconds(f.m_degrees,f.m_minutes,f.m_seconds);return r?Xe.createFromAngleMeridianAndDirection(d,a,s):Xe.createFromAngleAndDirection(d,n)}}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function co(e){const t=new Set([" ","-","/","'",'"',"\\","^",vt,mi," ","\r",` +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geomasync-uGYsifQH-B8w8CEL3.js","./languageUtils-BYxF9hRA-DnySuvAL.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./TimeOnly-DSMefxKy-BHvJbNji.js","./UnknownTimeZone-C--TOcPG-9of9030I.js","./ImmutableArray-CiJxhY8_-Kqx7aWRu.js","./shared-D1w-26bA-BBIRhcUQ.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./number-eRKYXfX9-bCdnHRN-.js","./Query-BrwMGK8U-BPr0_G9t.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./portalUtils-CKN9iXwH-BDO5uTJS.js","./geometryEngineAsync-D7oEu5dd-CZIKaTd9.js","./workers-PiCjreoO-Dc6Tqm-o.js","./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./FieldsIndex-HmzMbJQG-Du7S47uJ.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./geometryEngine-CdPoFSE4-ChEr_3ja.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-McBHp1Y5.js","./arcadeAsyncRuntime-B-LnqhTo-BP4d9xu9.js","./featureSetUtils-wd4FcF3A-Bjqg1VXd.js","./SpatialFilter-BlQBFhwz-B_LMwz1c.js","./WhereClause-DxwoyBMS-Cwdb_WC4.js","./MD5-CHHr-oed-SuyrCYQ0.js","./FeatureLayer-BrRKw5Si-DuA2fyE_.js","./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js","./RendererLegendOptions-K3md58-X-JLOOdHLz.js","./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js","./colorRamps-q0bZVhs2-BnivlaV9.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-tyrXoPjU.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js","./styleUtils-BtpNqZyT-Bnq2S5kK.js","./jsonUtils-C64Zfu7c-BtrwAD3_.js","./LRUCache-C3erQTWv-grHgYSP-.js","./Version-CoKzbupV-BDyz4v43.js","./OverrideHelper-DWRbVlj1-BnPmqHJ3.js","./colorUtils-Cthpxcks-cHaMZbaf.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-CiwW7WzR.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-DFYZs_ns.js","./heatmapUtils-seiMkkkR-CrSLbaQx.js","./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js","./commonProperties-BtIqvFU_-DbZji2Rx.js","./ElevationInfo-yv2-9tj6-CkIHeL1t.js","./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js","./HeightModelInfo-C5vFqzyF-BH6aliHn.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js","./RelationshipQuery-DJsz3K0U-BKFa46R1.js","./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js","./Relationship-PyhUibYK-DN6K3ukS.js","./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js","./Layer-ChoECxvZ-BmDHBjO8.js","./editsZScale-BDsX6vv--C-4n90TZ.js","./queryZScale-BiYV6Pr6-B7zp5L1G.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./FeatureSet-BkVNthuN-DPQqwkNN.js","./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js","./ArcGISService-BYA-y6X6-DNHMEBm_.js","./BlendLayer-D1WkSmwP-BeUsb4u9.js","./jsonUtils-wIllKWI4-MQQ-E5fj.js","./parser-DyDJ-rlI-CvOs11Ip.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-6clJxb1Q.js","./CustomParametersMixin-vdKsTHer-5EfrrVMH.js","./EditBusLayer-Df29OyJh-OmdJOLws.js","./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js","./FeatureEffect-CDEk9Es7-Cd4-I1fy.js","./FeatureFilter-BCFHgLVU-DwigNbnH.js","./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js","./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js","./labelingInfo-DGVNul26-BDBqWm17.js","./labelUtils-BW14kBqX-Tk7uOiPw.js","./OperationalLayer-B5IXiMa2-DTTV2F9z.js","./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js","./OrderByInfo-GD2XnU8e-BaEpZLaO.js","./PortalLayer-CElnYuSQ-CCe4TMEA.js","./PortalItem-CctGdnxF-CfFOGshS.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./RefreshableLayer-a8BQ58Xh-CxfquKbp.js","./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js","./TemporalLayer-CpOrN_w9-8nvJFP_-.js","./TimeInfo-w_HB2CsF-B2qHZyfS.js","./FeatureTemplate-SPHPD45f-CZ7E6_6b.js","./FeatureType-C9hJmS6_-CNlvn5D1.js","./fieldProperties-Bq26w7gt-BiKrD4ue.js","./versionUtils-LZYZz-38-B8C5OAjF.js","./styleUtils-ChrJTYIw-C6xq7Jeu.js","./popupUtils-B0uZcXX0-DHyOz1jC.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./featuresetbase-BDDCCC0O---spEhjc.js","./featuresetgeom-BftbGgg3-BLGpCbU5.js","./featuresetstats-CY6YJ8Jt-BEjsGFcp.js","./featuresetstring-DFELZWNA-DaxbyWAc.js","./knowledgegraph-Dt7zfNlJ-CqBwig9B.js","./project-DQKhruav-CyFgbMSU.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./Relationship-Db9GUmYx-B84JspfN.js"])))=>i.map(i=>d[i]); +import{_ as je}from"./main-QGPoLsvl.js";import{d as k,j as Ki,g as se,w as V,F as Gt,h as Xi,D as Qi,l as le,m as ae,G as We,n as Ne,p as yt,q as fn,r as Wn,t as $e,B as Gr,R as sr,Q as Yi,J as Pt,K as Zr,O as jr,P as $i,f as ea}from"./story-Doly9N9p.js";import{T as h,n as c,U as Y,b as X,S as W,y as S,u as qe,v as _n,m as ta,E as _t,k as Vr,G as ur,C as _,Z as P,t as K,a as qn,R as nn,r as rn,h as Q,c as q,d as ce,w as D,e as B,f as m,M as E,P as oe,g as N,i as na,_ as lr,z as te,j as it,J as L,l as I,o as Pe,p as Ye,q as Tn,L as Tt,s as at,I as Jr,x as ra,$ as mn,W as ia,Q as aa,X as oa,A as sa,B as nt,D as Hn,F as ua,H as Kn,O as He,Y as cr,K as pn,N as la,V as Wr,a0 as qr,a1 as he,a2 as Dn,a3 as gn,a4 as ft,a5 as Fe,a6 as Le,a7 as Ot,a8 as Hr,a9 as an,aa as Kr,ab as Zt,ac as Xr,ad as Kt}from"./languageUtils-BYxF9hRA-DnySuvAL.js";import{r as G,m as ye,O as we,u as jt,I as Se,A as Vt,z as re}from"./TimeOnly-DSMefxKy-BHvJbNji.js";import{n as et}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{n as ca}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{o as ha}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{M as da}from"./number-eRKYXfX9-bCdnHRN-.js";import{M as hr}from"./shared-D1w-26bA-BBIRhcUQ.js";import{r as Ft}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";function $(e){return e.name.toLowerCase()}let on=class{constructor(e,t){this._moduleSingletons=e,this._syntaxModules=t}loadLibrary(e){if(this._syntaxModules==null)return null;const t=this._syntaxModules[e];return t?{syntax:t.script,uri:t.uri}:null}};function fa(e){Qr=e}let Qr;function Mt(e){return e===null?null:ce(e)?e.clone():_t(e)?e:nn(e)?e.clone():P(e)?e.toArray().map(t=>Mt(t)):_(e)?e.map(t=>Mt(t)):K(e)?Qr.createFromArcadeFeature(e):Hn(e)||rn(e)?e:qn(e)||e?.declaredClass==="esri.arcade.Attachment"?e.deepClone():(e?.declaredClass==="esri.arcade.Portal"||ua(e)||e instanceof Kn||Y(e),e)}function Xt(e,t,n=!1,r=!1){if(e==null)return null;if(W(e))return m(e);if(X(e))return Tt(e);if(S(e))return E(e);if(ce(e))return oe(e,t);if(q(e)||Q(e))return e;if(_(e)){const s=[];for(const o of e)s.push(Xt(o,t,n,r));return s}if(r&&nn(e))return e;const a=new v;a.immutable=!1;for(const s of Object.keys(e)){const o=e[s];o!==void 0&&a.setField(s,Xt(o,t,n,r))}return a.immutable=n,a}let v=class Wt{constructor(t){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=t instanceof Wt?t.attributes:t??{}}field(t){const n=t.toLowerCase(),r=this.attributes[t];if(r!==void 0)return r;for(const a in this.attributes)if(a.toLowerCase()===n)return this.attributes[a];throw new h(null,c.FieldNotFound,null,{key:t})}setField(t,n){if(this.immutable)throw new h(null,c.Immutable,null);if(Y(n))throw new h(null,c.NoFunctionInDictionary,null);const r=t.toLowerCase();if(n instanceof Date&&(n=G.dateJSToArcadeDate(n)),this.attributes[t]===void 0){for(const a in this.attributes)if(a.toLowerCase()===r)return void(this.attributes[a]=n);this.attributes[t]=n}else this.attributes[t]=n}hasField(t){const n=t.toLowerCase();if(this.attributes[t]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let t=[];for(const n in this.attributes)t.push(n);return t=t.sort(),t}castToText(t=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return"{"+n+"}"}static convertObjectToArcadeDictionary(t,n,r=!0,a=!1){const s=new Wt;s.immutable=!1;for(const o in t){const i=t[o];i!==void 0&&s.setField(o.toString(),Xt(i,n,r,a))}return s.immutable=r,s}static convertJsonToArcade(t,n,r=!1,a=!1){return Xt(t,n,r,a)}castAsJson(t=null){const n={};for(let r in this.attributes){const a=this.attributes[r];a!==void 0&&(t?.keyTranslate&&(r=t.keyTranslate(r)),n[r]=_n(a,t))}return n}async castDictionaryValueAsJsonAsync(t,n,r,a=null,s){const o=await ta(r,a,s);return t[n]=o,o}async castAsJsonAsync(t=null,n=null){const r={},a=[];for(let s in this.attributes){const o=this.attributes[s];n?.keyTranslate&&(s=n.keyTranslate(s)),o!==void 0&&(_t(o)||o instanceof k||o instanceof G?r[s]=_n(o,n):a.push(this.castDictionaryValueAsJsonAsync(r,s,o,t,n)))}return a.length>0&&await Promise.all(a),r}deepClone(){const t=new Wt;t.immutable=!1;for(const n of this.keys())t.setField(n,Mt(this.field(n)));return t}},Oe=0;function mt(e,t,n,r,a=1){let s;switch(t=t.toLowerCase()){case"hasz":{const o=e.hasZ;return o!==void 0&&o}case"hasm":{const o=e.hasM;return o!==void 0&&o}case"spatialreference":{let o=e.spatialReference._arcadeCacheId;if(o===void 0){let u=!0;Ki.isFrozen(e.spatialReference)&&(u=!1),u&&(Oe++,e.spatialReference._arcadeCacheId=Oe,o=Oe)}const i=new v({wkt:e.spatialReference.wkt,wkid:e.spatialReference.wkid});return o!==void 0&&(i._arcadeCacheId="SPREF"+o.toString()),i}}switch(e.type){case"extent":switch(t){case"xmin":case"xmax":case"ymin":case"ymax":case"zmin":case"zmax":case"mmin":case"mmax":{const o=e[t];return o!==void 0?o:null}case"type":return"Extent"}break;case"polygon":switch(t){case"rings":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.rings,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polygon"}break;case"point":switch(t){case"x":case"y":case"z":case"m":return e[t]??null;case"type":return"Point"}break;case"polyline":switch(t){case"paths":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new ur(e.paths,e.spatialReference,e.hasZ===!0,e.hasM===!0,s);case"type":return"Polyline"}break;case"multipoint":switch(t){case"points":return s=e.cache._arcadeCacheId,s===void 0&&(Oe++,s=Oe,e.cache._arcadeCacheId=s),new Vr(e.points,e.spatialReference,e.hasZ===!0,e.hasM===!0,s,1);case"type":return"Multipoint"}}if(a===1)throw new h(n,c.InvalidIdentifier,r);return a===2?{keystate:"notfound"}:null}function Xn(e,t){let n,r=e;if(r==null)return null;if(_(t))n=t;else if(P(t))n=t.toArray();else{if(t==null)return null;n=[t]}for(const a of n){if(K(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(qn(r)){if(S(a)===!1||!r.hasField(a))return null;r=r.field(a)}else if(nn(r)){if(S(a)===!1)return null;r=mt(r,a,null,null,0)}else if(_(r)){if(W(a)===!1)return null;r=a>=0?r[a]:r[r.length+a]}else{if(!P(r)||W(a)===!1)return null;r=a>=0?r.get(a):r.get(r.length()+a)}if(r==null)return null}return r}let H=class Ce{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._fieldTypesFixed=!0,this.fieldsIndex=null,this.contextTimeZone=null,this.immutable=!0,this._fieldsToFixDataTypes=null,this.immutable=!0}static createFromGraphic(t,n){const r=new Ce;return r.contextTimeZone=n??null,r._geometry=t.geometry!=null?t.geometry:null,t.attributes===void 0||t.attributes===null?r.attributes={}:r.attributes=t.attributes,t._sourceLayer?(r._layer=t._sourceLayer,r._fieldTypesFixed=!1):t._layer?(r._layer=t._layer,r._fieldTypesFixed=!1):t.layer&&"fields"in t.layer?(r._layer=t.layer,r._fieldTypesFixed=!1):t.sourceLayer&&"fields"in t.sourceLayer&&(r._layer=t.sourceLayer,r._fieldTypesFixed=!1),r._layer&&!r._fieldTypesFixed&&(r.fieldsIndex=this.hydrateFieldsIndex(r._layer)),r}static createFromArcadeFeature(t){if(t instanceof Ce){const r=new Ce;return r._fieldTypesFixed=t._fieldTypesFixed,r.attributes=t.attributes,r._geometry=t._geometry,r._optimizedGeomDefinition=t._optimizedGeomDefinition,t._layer&&(r._layer=t._layer),r.fieldsIndex=t.fieldsIndex,r.contextTimeZone=t.contextTimeZone,r}const n={};for(const r of t.keys())n[r]=t.field(r);return Ce.createFromGraphicLikeObject(t.geometry(),n,t.fullSchema(),t.contextTimeZone)}static createFromOptimisedFeature(t,n,r){const a=new Ce;return a._geometry=t.geometry?{geometry:t.geometry}:null,a._optimizedGeomDefinition=r,a.attributes=t.attributes||{},a._layer=n,a._fieldTypesFixed=!1,a}static createFromArcadeDictionary(t,n){const r=new Ce;return r.attributes=t.field("attributes"),r.attributes!==null&&r.attributes instanceof v?(r.attributes=r.attributes.attributes,r.attributes===null&&(r.attributes={})):r.attributes={},r._geometry=t.field("geometry"),r._geometry!==null&&(r._geometry instanceof v?r._geometry=Ce.parseGeometryFromDictionary(r._geometry,n):r._geometry instanceof k||(r._geometry=null)),r}static createFromGraphicLikeObject(t,n,r=null,a){const s=new Ce;return s.contextTimeZone=a??null,n===null&&(n={}),s.attributes=n,s._geometry=t??null,s._layer=r,s._layer&&(s._fieldTypesFixed=!1,s.fieldsIndex=this.hydrateFieldsIndex(s._layer)),s}static hydrateFieldsIndex(t){return t===null?null:rn(t)?t.getFieldsIndex():t.fieldsIndex?t.fieldsIndex:ha.fromLayerJSON({datesInUnknownTimezone:t.datesInUnknownTimezone,fields:t.fields,timeInfo:t.timeInfo,editFieldsInfo:t.editFieldsInfo,dateFieldsTimeReference:t.dateFieldsTimeReference??{timeZone:"UTC",respectsDaylightSaving:!1}})}repurposeFromGraphicLikeObject(t,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=t??null,this._layer=r,this._layer?this._fieldTypesFixed=!1:this._fieldTypesFixed=!0}castToText(t=!1){let n="";this._fieldTypesFixed===!1&&this._fixFieldTypes();for(const r in this.attributes){n!==""&&(n+=",");const a=this.attributes[r];a==null?n+=JSON.stringify(r)+":null":X(a)||W(a)||S(a)?n+=JSON.stringify(r)+":"+JSON.stringify(a):a instanceof k?n+=JSON.stringify(r)+":"+qe(a):a instanceof ye||a instanceof we?n+=`${JSON.stringify(r)}:${JSON.stringify(a.toString())}`:a instanceof et||Array.isArray(a)?n+=JSON.stringify(r)+":"+qe(a,null,t):a instanceof G?n+=t?JSON.stringify(r)+":"+JSON.stringify(a.getTime()):JSON.stringify(r)+":"+a.stringify():a!==null&&typeof a=="object"&&a.castToText!==void 0&&(n+=JSON.stringify(r)+":"+a.castToText(t))}return'{"geometry":'+(this.geometry()===null?"null":qe(this.geometry()))+',"attributes":{'+n+"}}"}_fixFieldTypes(){if(this._fieldsToFixDataTypes&&this._fieldsToFixDataTypes?.length>0)return this._fixAllFields(this._fieldsToFixDataTypes),void(this._fieldTypesFixed=!0);const t=[],n=this._layer.fields;for(let r=0;r0&&this._fixAllFields(t),this._fieldTypesFixed=!0}isUnknownDateTimeField(t){return this.fieldsIndex?.getTimeZone(t)==="unknown"}_fixAllFields(t){this.attributes={...this.attributes};const n=this.contextTimeZone??"system";for(let r=0;r!n&&(a.type==="Identifier"&&a.name&&a.name.toLowerCase()===r&&(n=!0),!0)),n}function $r(e){const t=[];return j(e,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&t.push({libname:$(n.specifiers[0].local),source:n.source.value}),!0)),t}function Da(e,t){let n=!1;const r=t.toLowerCase();return j(e,a=>!n&&(a.type!=="CallExpression"||a.callee.type!=="Identifier"||!a.callee.name||a.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function ga(e){const t=[];return j(e,n=>n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?t.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"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)),t}function ya(e){const t=[];return j(e,n=>{if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let r="";for(let a=0;a<(n.arguments||[]).length;a++)a===0?n.arguments[a].type==="Identifier"&&(r=n.arguments[a].name.toLowerCase()):r&&n.arguments[a].type==="Literal"&&fr(n.arguments[a].value)&&t.push(r+"."+n.arguments[a].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let r="";return n.arguments[0].type==="Identifier"&&(r=n.arguments[0].name.toLowerCase()),r&&n.arguments[1].type==="Literal"&&fr(n.arguments[1].value)&&t.push(r+"."+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?t.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"&&t.push(n.object.name.toLowerCase()+"."+n.property.value?.toString().toLowerCase()),!1)}),t}function Nn(e){const t=[];return j(e,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&t.push(n.callee.name.toLowerCase()),!0)),t}function Ut(e,t=[]){let n=null;if(e.usesFeatureSet===void 0){n===null&&(n=Nn(e)),e.usesFeatureSet=!1;for(let r=0;r0){for(const r of t)if(Yr(e,r)){e.usesFeatureSet=!0,e.isAsync=!0;break}}}if(e.usesModules===void 0&&(e.usesModules=!1,$r(e).length>0&&(e.usesModules=!0)),e.usesGeometry===void 0){e.usesGeometry=!1,n===null&&(n=Nn(e));for(let r=0;r0||u.length>0;)if(i.length>0&&u.length>0){let d=l(i[0],u[0]);isNaN(d)&&(d=0),d<=0?(f.push(i[0]),i=i.slice(1)):(f.push(u[0]),u=u.slice(1))}else i.length>0?(f.push(i[0]),i=i.slice(1)):u.length>0&&(f.push(u[0]),u=u.slice(1));return f}async function a(i,u){const l=i.length,f=Math.floor(l/2);if(l===0)return[];if(l===1)return[i[0]];const d=[await a(i.slice(0,f),u),await a(i.slice(f,l),u)];return s(d[0],d[1],u,[])}async function s(i,u,l,f){const d=f;if(i.length>0||u.length>0){if(i.length>0&&u.length>0){let p=await l(i[0],u[0]);return isNaN(p)&&(p=1),p<=0?(d.push(i[0]),i=i.slice(1)):(d.push(u[0]),u=u.slice(1)),s(i,u,l,f)}return i.length>0?(d.push(i[0]),s(i=i.slice(1),u,l,f)):(d.push(u[0]),s(i,u=u.slice(1),l,f))}return f}function o(i,u,l,f){D(l,1,2,i,u);let d=l[0];if(P(d)&&(d=d.toArray()),_(d)===!1)throw new h(i,c.InvalidParameter,u);if(l.length>1){if(Y(l[1])===!1)throw new h(i,c.InvalidParameter,u);let x=d;const O=l[1].createFunction(i);return f?a(x,O):(x=n(x,(ne,de)=>O(ne,de)),x)}let p=d;if(p.length===0)return[];const g={};for(let x=0;x1||b==="String"?n(p,(x,O)=>{if(x==null||x===I)return O==null||O===I?0:1;if(O==null||O===I)return-1;const ne=E(x),de=E(O);return nex-O):b==="Boolean"?n(p,(x,O)=>x===O?0:O?-1:1):b==="Date"?n(p,(x,O)=>O-x):p.slice(),p}e.functions.array=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,0,2,i,u),d.length===0)return[];if(d.length===1&&d[0]===null)return[];if(_(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].slice()}if(P(d[0])){if(d.length===2&&X(d[1])===!1)throw new h(i,c.InvalidParameter,u);return N(d[1],!1)===!0?Mt(d[0]):d[0].toArray().slice()}const p=m(d[0]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=N(d[1],null),y=new Array(p);return y.fill(g),y})},e.functions.front=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(0)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][0]}throw new h(i,c.InvalidParameter,u)})},e.functions.back=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),P(d[0])){if(d[0].length()<=0)throw new h(i,c.OutOfBounds,u);return d[0].get(d[0].length()-1)}if(_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);return d[0][d[0].length-1]}throw new h(i,c.InvalidParameter,u)})},e.functions.push=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,2,i,u),_(d[0]))return d[0][d[0].length]=d[1],d[0].length;throw new h(i,c.InvalidParameter,u)})},e.functions.pop=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,1,i,u),_(d[0])){if(d[0].length<=0)throw new h(i,c.OutOfBounds,u);const p=d[0][d[0].length-1];return d[0].length=d[0].length-1,p}throw new h(i,c.InvalidParameter,u)})},e.functions.erase=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,2,i,u),_(d[0])){let p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[0];if(g.length<=0)throw new h(i,c.OutOfBounds,u);if(p<0&&(p=g.length+p),p<0)throw new h(i,c.OutOfBounds,u);if(p>=g.length)throw new h(i,c.OutOfBounds,u);return g.splice(p,1),I}throw new h(i,c.InvalidParameter,u)})},e.functions.insert=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,3,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);const g=d[2],y=d[0];if(p>y.length)throw new h(i,c.OutOfBounds,u);if(p<0&&p<-1*y.length)throw new h(i,c.OutOfBounds,u);return p===y.length?(y[p]=g,I):(y.splice(p,0,g),I)}throw new h(i,c.InvalidParameter,u)})},e.functions.resize=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,2,3,i,u),_(d[0])){const p=m(d[1]);if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(p<0)throw new h(i,c.InvalidParameter,u);const g=N(d[2],null),y=d[0];if(y.length>=p)return y.length=p,I;const b=y.length;y.length=p;for(let x=b;x{if(D(d,2,2,i,u),_(d[0])){const p=d[1];return!!d[0].some(g=>Pe(g,p))}if(P(d[0])){const p=d[1];return!!d[0].toArray().some(g=>Pe(g,p))}throw new h(i,c.InvalidParameter,u)})},e.functions.slice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{if(D(d,1,3,i,u),_(d[0])){const p=m(N(d[1],0)),g=m(N(d[2],d[0].length));if(isNaN(p)||He(p)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);return d[0].slice(p,g)}if(P(d[0])){const p=d[0],g=m(N(d[1],0)),y=m(N(d[2],p.length()));if(isNaN(g)||He(g)===!1)throw new h(i,c.InvalidParameter,u);if(isNaN(y)||He(y)===!1)throw new h(i,c.InvalidParameter,u);return p.toArray().slice(g,y)}throw new h(i,c.InvalidParameter,u)})},e.functions.splice=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{const p=[];for(let g=0;g{if(D(d,2,2,i,u),_(d[0]))return m(d[1])>=d[0].length?d[0].slice():d[0].slice(0,m(d[1]));if(P(d[0]))return m(d[1])>=d[0].length()?d[0].slice():d[0].slice(0,m(d[1]));throw new h(i,c.InvalidParameter,u)})},e.functions.first=function(i,u){return e.standardFunction(i,u,(l,f,d)=>(D(d,1,1,i,u),_(d[0])?d[0].length===0?null:d[0][0]:P(d[0])?d[0].length()===0?null:d[0].get(0):null))},e.mode==="sync"&&(e.functions.sort=function(i,u){return e.standardFunction(i,u,(l,f,d)=>o(i,f,d,!1))},e.functions.any=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=p(y);if(X(b)&&b===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)!==!0)return!1;return!0})},e.functions.none=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g)if(p(y)===!0)return!1;return!0})},e.functions.reduce=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);return d.length===2?g.length===0?null:g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null}):g.reduce((y,b)=>{const x=p(y,b);return y=x!==void 0&&x!==I?x:null},d[2])})},e.functions.map=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=p(b);x!==void 0&&x!==I?y.push(x):y.push(null)}return y})},e.functions.filter=function(i,u){return e.standardFunction(i,u,(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g)p(b)===!0&&y.push(b);return y})}),e.mode==="async"&&(e.functions.sort=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>o(i,f,d,!0))},e.functions.any=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,X(x)&&x===!0)return!0}return!1})},e.functions.all=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x!==!0)return!1}return!0})},e.functions.none=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);for(const y of g){const b=await p(y);let x=null;if(x=$e(x)?await b:b,x===!0)return!1}return!0})},e.functions.filter=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O===!0&&y.push(b)}return y})},e.functions.reduce=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,3,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f);let y;if(d.length>2){const b=N(d[2],null);y=g.reduce(async(x,O)=>{let ne=await x;return ne!==void 0&&ne!==I||(ne=null),p(ne,O)},Promise.resolve(b))}else{if(g.length===0)return null;y=g.reduce(async(b,x,O)=>{if(O<=1)return p(b,x);let ne=await b;return ne!==void 0&&ne!==I||(ne=null),p(ne,x)})}return y.then(b=>b!==void 0&&b!==I?b:null)})},e.functions.map=function(i,u){return e.standardFunctionAsync(i,u,async(l,f,d)=>{D(d,2,2,i,f);const p=d[1].createFunction(i),g=t(d[0],i,f),y=[];for(const b of g){const x=await p(b);let O=null;O=$e(O)?await x:x,O!==void 0&&O!==I?y.push(O):y.push(null)}return y})})}const Rn=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:wa},Symbol.toStringTag,{value:"Module"}));function xa(e,t,n){return e+(Fa(n)?Ca:Aa)[t]}function Fa(e){return e%4==0&&(e%100!=0||e%400==0)}const Aa=[0,31,59,90,120,151,181,212,243,273,304,334],Ca=[0,31,60,91,121,152,182,213,244,274,305,335];function Te(e){return e===null?e:e.isValid===!1?null:e}function At(e,t){return e===""||e.toLowerCase().trim()==="default"?B(t):e==="z"||e==="Z"?"UTC":e}function ze(e,t){return q(e)?e.toArcadeDate():oe(e,B(t))}function ei(e,t){e.today=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=new Date;return i.setHours(0,0,0,0),G.dateJSAndZoneToArcadeDate(i,B(n))})},e.time=function(n,r){return t(n,r,(a,s,o)=>{switch(D(o,0,4,n,r),o.length){case 0:{const i=G.nowToArcadeDate(B(n));return new ye(i.hour,i.minute,i.second,i.millisecond)}case 1:{if(Q(o[0]))return o[0].clone();if(ce(o[0]))return new ye(o[0].hour,o[0].minute,o[0].second,o[0].millisecond);if(q(o[0]))return new ye(0,0,0,0);if(S(o[0]))return ye.fromString(o[0]);const i=m(o[0]);return isNaN(i)===!1?ye.fromMilliseconds(i):null}case 2:return S(o[0])&&S(o[1])?ye.fromString(o[0],o[1]):ye.fromParts(m(o[0]),m(o[1]),0,0);case 3:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),0);case 4:return ye.fromParts(m(o[0]),m(o[1]),m(o[2]),m(o[3]))}throw new h(n,c.InvalidParameter,r)})},e.dateonly=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,3,n,r),o.length===3)return we.fromParts(m(o[0]),m(o[1])+1,m(o[2]));if(o.length===2){const i=E(o[1]);return i===""?null:i==="X"?we.fromSeconds(m(o[0])):i==="x"?we.fromMilliseconds(m(o[0])):we.fromString(E(o[0]),i)}if(o.length===1){if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return we.fromString(o[0]+"-01-01")}if(q(o[0]))return o[0].clone();if(ce(o[0]))return we.fromParts(o[0].year,o[0].monthJS+1,o[0].day);const i=m(o[0]);return isNaN(i)===!1?we.fromMilliseconds(i):S(o[0])?we.fromString(o[0]):null}if(o.length===0){const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:we.fromParts(i.year,i.monthJS+1,i.day)}return null})},e.changetimezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),o[0]===null)return null;if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneDateOnly,r);if(q(o[0]))throw new h(n,c.CannotChangeTimeZoneTime,r);const i=oe(o[0],B(n));if(i===null)throw new h(n,c.InvalidParameter,r);const u=jt(At(E(o[1]),n),!1);if(u===null)return null;const l=G.arcadeDateAndZoneToArcadeDate(i,u);return l.isValid===!1?null:l})},e.timezone=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,2,n,r),Q(o[0])||q(o[0]))return"Unknown";const i=oe(o[0],B(n));if(i===null)return null;const u=i.timeZone;return u==="system"?G.systemTimeZoneCanonicalName:u.toLowerCase()==="utc"?"UTC":u.toLowerCase()==="unknown"?"Unknown":u})},e.timezoneoffset=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:60*i.timeZoneOffset*1e3})},e.now=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowToArcadeDate(B(n));return i.isValid===!1?null:i})},e.timestamp=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,0,n,r);const i=G.nowUTCToArcadeDate();return i.isValid===!1?null:i})},e.toutc=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toUTC()})},e.tolocal=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=oe(o[0],B(n));return i===null?null:i.toLocal()})},e.day=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.day})},e.month=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthJS})},e.year=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.year})},e.hour=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].hour;const i=oe(o[0],B(n));return i===null?NaN:i.hour})},e.second=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].second;const i=oe(o[0],B(n));return i===null?NaN:i.second})},e.millisecond=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].millisecond;const i=oe(o[0],B(n));return i===null?NaN:i.millisecond})},e.minute=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),Q(o[0]))return o[0].minute;const i=oe(o[0],B(n));return i===null?NaN:i.minute})},e.week=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=ze(o[0],B(n));if(i===null)return NaN;const u=m(N(o[1],0));if(u<0||u>6)throw new h(n,c.InvalidParameter,r);const l=i.day,f=i.monthJS,d=i.year,p=i.dayOfWeekJS,g=xa(l,f,d)-1,y=Math.floor(g/7);return p-u+(p-u<0?7:0){D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekJS})},e.isoweekday=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.dayOfWeekISO})},e.isomonth=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.monthISO})},e.isoweek=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.weekISO})},e.isoyear=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=ze(o[0],B(n));return i===null?NaN:i.yearISO})},e.date=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,8,n,r),o.length===3){if(q(o[0])&&Q(o[1])&&S(o[2])){const i=jt(At(E(o[2])??"unknown",n),!1);return i===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,i))}return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),0,0,0,0,B(n)))}if(o.length===4)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),0,0,0,B(n)));if(o.length===5)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),0,0,B(n)));if(o.length===6)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),0,B(n)));if(o.length===7)return Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),B(n)));if(o.length===8){const i=jt(At(E(o[7])??"unknown",n),!1);return i===null?null:Te(G.fromParts(m(o[0]),m(o[1])+1,m(o[2]),m(o[3]),m(o[4]),m(o[5]),m(o[6]),i))}if(o.length===2){if(q(o[0])&&S(o[1])){const l=jt(At(E(o[1])??"unknown",n),!1);return l===null?null:Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,l))}if(q(o[0])&&Q(o[1]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,o[1].hour,o[1].minute,o[1].second,o[1].millisecond,"unknown"));let i,u=E(o[1]);return u===""?null:(u=na(u,!0),i=u==="X"?Gt.fromSeconds(m(o[0])):u==="x"?Gt.fromMillis(m(o[0])):Gt.fromFormat(E(o[0]),u,{locale:Xi(),numberingSystem:"latn"}),i.isValid?G.dateTimeToArcadeDate(i):null)}if(o.length===1){if(q(o[0]))return Te(G.fromParts(o[0].year,o[0].month,o[0].day,0,0,0,0,"unknown"));if(S(o[0])){if(o[0].replaceAll(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(o[0])===!0)return oe(o[0]+"-01-01",B(n))}const i=m(o[0]);if(isNaN(i)===!1){const u=Gt.fromMillis(i);return u.isValid?G.dateTimeAndZoneToArcadeDate(u,B(n)):null}return oe(o[0],B(n))}return o.length===0?G.nowToArcadeDate(B(n)):null})},e.datediff=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),Q(o[0]))return Q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(Q(o[1]))return NaN;if(q(o[0]))return q(o[1])?o[0].difference(o[1],E(o[2])):NaN;if(q(o[1]))return NaN;let i=oe(o[0],B(n)),u=oe(o[1],B(n));if(i===null||u===null)return NaN;let l=N(o[3],"");switch(l!==""&&l!==null?(l=At(E(l),n),i=G.arcadeDateAndZoneToArcadeDate(i,l),u=G.arcadeDateAndZoneToArcadeDate(u,l)):i.timeZone!==u.timeZone&&(i.isUnknownTimeZone?i=G.arcadeDateAndZoneToArcadeDate(i,u.timeZone):u=(u.isUnknownTimeZone,G.arcadeDateAndZoneToArcadeDate(u,i.timeZone))),E(o[2]).toLowerCase()){case"days":case"day":case"d":return i.diff(u,"days");case"months":case"month":return i.diff(u,"months");case"minutes":case"minute":case"m":return o[2]==="M"?i.diff(u,"months"):i.diff(u,"minutes");case"seconds":case"second":case"s":return i.diff(u,"seconds");case"milliseconds":case"millisecond":case"ms":default:return i.diff(u);case"hours":case"hour":case"h":return i.diff(u,"hours");case"years":case"year":case"y":return i.diff(u,"years")}})},e.dateadd=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=m(o[1]);if(isNaN(i)||i===1/0||i===-1/0)return Q(o[0])||q(o[0])?o[0].clone():oe(o[0],B(n));let u="milliseconds";switch(E(o[2]).toLowerCase()){case"days":case"day":case"d":u="days",i=q(o[0])?i:lr(i);break;case"months":case"month":u="months",i=q(o[0])?i:lr(i);break;case"minutes":case"minute":case"m":u=o[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":u="seconds";break;case"milliseconds":case"millisecond":case"ms":u="milliseconds";break;case"hours":case"hour":case"h":u="hours";break;case"years":case"year":case"y":u="years"}if(Q(o[0])||q(o[0]))return o[0].plus(u,i);const l=oe(o[0],B(n));return l===null?null:l.plus({[u]:i})})}}function De(e,t,n){return Math.sqrt((e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0))}function ti(e,t,n){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]!==void 0&&t[2]!==void 0?(e[2]*n-t[2]*n)**2:0)}const Et=[];for(const e of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const t=e[0];for(let n=1;n0?(r.x/=a,r.y/=a,t&&(r.z/=a),n&&(r.m/=a)):(r.x=e[0][0],r.y=e[0][1],t&&(r.z=e[0][2]),n&&t?r.m=e[0][3]:n&&(r.m=e[0][2])),r}function Ea(e,t,n,r){const a={x:(e[0]+t[0])/2,y:(e[1]+t[1])/2};return n&&(a.z=(e[2]+t[2])/2),n&&r?a.m=(e[3]+t[3])/2:r&&(a.m=(e[2]+t[2])/2),a}function ba(e,t){if(e.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=a,n.y/=a,e.hasZ===!0&&(n.z/=a),e.hasM===!0&&(n.m/=a),new V(n)):r>0?(t.x/=r,t.y/=r,e.hasZ===!0&&(n.z/=r),e.hasM===!0&&(t.m/=r),new V(t)):null}function Ia(e){if(e.points.length===0)return null;let t=0,n=0,r=0,a=0;for(let o=0;o=r;)e-=t;return e}function ri(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function _a(e,t){return ln(ri(e,t),2*Math.PI)*(180/Math.PI)}function Ta(e,t){return ln(Math.PI/2-ri(e,t),2*Math.PI)*(180/Math.PI)}function ii(e,t,n){const r={x:e.x-t.x,y:e.y-t.y},a={x:n.x-t.x,y:n.y-t.y};return Math.atan2(Ba(r,a),ka(r,a))}function Ma(e,t,n){return Gr(ln(ii(e,t,n),2*Math.PI))}function Na(e,t,n){return Gr(ln(-1*ii(e,t,n),2*Math.PI))}It[9002]=.3048,It[9003]=.3048006096012192,It[9095]=.3048007491;const ie=[0,0];function pr(e){for(let t=0;t1&&(r=1)),r<=.5?[t[0]+(n[0]-t[0])*r,t[1]+(n[1]-t[1])*r]:[n[0]-(n[0]-t[0])*(1-r),n[1]-(n[1]-t[1])*(1-r)]}function ai(e,t){e.ringisclockwise=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=[];if(o[0]===null)return!1;if(_(o[0]))for(const u of o[0]){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}else if(o[0]instanceof Vr)i=o[0]._elements;else{if(!P(o[0]))throw new h(n,c.InvalidParameter,r);for(const u of o[0].toArray()){if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i.push(u.hasZ?u.hasM?[u.x,u.y,u.z,u.m]:[u.x,u.y,u.z]:[u.x,u.y])}}return!(i.length<3)&&Qi(i)})},e.polygon=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof le))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof le)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new le(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.polyline=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof ae))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof ae)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new ae(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.point=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof V))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof V)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new V(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.multipoint=function(n,r){return t(n,r,(a,s,o)=>{let i;if(D(o,1,1,n,r),o[0]instanceof v){const u=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);if(!(u instanceof We))throw new h(n,c.InvalidParameter,r);i=u}else if(o[0]instanceof We)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new We(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.extent=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=null;if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else if(o[0]instanceof V){const u={xmin:o[0].x,ymin:o[0].y,xmax:o[0].x,ymax:o[0].y,spatialReference:o[0].spatialReference.toJSON()},l=o[0];l.hasZ?(u.zmin=l.z,u.zmax=l.z):l.hasM&&(u.mmin=l.m,u.mmax=l.m),i=se(u)}else if(o[0]instanceof le)i=se(o[0].extent?.toJSON());else if(o[0]instanceof ae)i=se(o[0].extent?.toJSON());else if(o[0]instanceof We)i=se(o[0].extent?.toJSON());else if(o[0]instanceof Ne)i=se(o[0].toJSON());else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(new Ne(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.geometry=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);let i=null;if(o[0]===null)return null;if(K(o[0]))i=te(o[0].geometry(),n.spatialReference);else if(o[0]instanceof v)i=te(H.parseGeometryFromDictionary(o[0],n.spatialReference),n.spatialReference);else{const u=JSON.parse(o[0]);u&&!u.spatialReference&&(u.spatialReference=n.spatialReference),i=te(se(u),n.spatialReference)}if(i!==null&&i.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return it(i)})},e.setgeometry=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,2,n,r),!K(o[0]))throw new h(n,c.InvalidParameter,r);if(o[0].immutable===!0)throw new h(n,c.Immutable,r);if(!(o[1]instanceof k||o[1]===null))throw new h(n,c.InvalidParameter,r);return o[0]._geometry=o[1],I})},e.feature=function(n,r){return t(n,r,(a,s,o)=>{if(o.length===0)throw new h(n,c.WrongNumberOfParameters,r);let i;if(o.length===1)if(S(o[0]))i=H.fromJson(JSON.parse(o[0]),n.timeZone);else if(K(o[0]))i=H.createFromArcadeFeature(o[0]);else if(o[0]instanceof k)i=H.createFromGraphicLikeObject(o[0],null,null,n.timeZone);else{if(!(o[0]instanceof v))throw new h(n,c.InvalidParameter,r);{let u=o[0].hasField("geometry")?o[0].field("geometry"):null,l=o[0].hasField("attributes")?o[0].field("attributes"):null;u!==null&&u instanceof v&&(u=H.parseGeometryFromDictionary(u,n.spatialReference)),l!==null&&(l=H.parseAttributesFromDictionary(l)),i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}}else if(o.length===2){let u=null,l=null;if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}if(o[1]!==null){if(!(o[1]instanceof v))throw new h(n,c.InvalidParameter,r);l=H.parseAttributesFromDictionary(o[1])}i=H.createFromGraphicLikeObject(u,l,null,n.timeZone)}else{let u=null;const l={};if(o[0]!==null)if(o[0]instanceof k)u=o[0];else{if(!(u instanceof v))throw new h(n,c.InvalidParameter,r);u=H.parseGeometryFromDictionary(o[0],n.spatialReference)}for(let f=1;f{if(o.length===0||o.length===1&&o[0]===null){const l=new v;return l.immutable=!1,l}if(o.length===1&&S(o[0]))try{const l=JSON.parse(o[0]),f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof k)try{const l=o[0].toJSON();l.hasZ=o[0].hasZ===!0,l.hasM=o[0].hasM===!0;const f=v.convertObjectToArcadeDictionary(l,B(n),!1);return f.immutable=!1,f}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&K(o[0]))try{const l=new v;l.immutable=!1,l.setField("geometry",o[0].geometry());const f=new v;f.immutable=!1,l.setField("attributes",f);for(const d of o[0].keys())f.setField(d,o[0].field(d));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===1&&o[0]instanceof v)try{const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}catch{throw new h(n,c.InvalidParameter,r)}if(o.length===2&&o[0]instanceof v&&X(o[1]))try{if(o[1]!==!0){const l=new v;l.immutable=!1;for(const f of o[0].keys())l.setField(f,o[0].field(f));return l}return o[0].deepClone()}catch{throw new h(n,c.InvalidParameter,r)}if(o.length%2!=0)throw new h(n,c.WrongNumberOfParameters,r);const i={};for(let l=0;l{D(o,2,2,n,r);const i=E(o[1]);if(K(o[0])||o[0]instanceof v)return o[0].hasField(i);if(o[0]instanceof k){const u=mt(o[0],i,null,null,2);return!u||u.keystate!=="notfound"}throw new h(n,c.InvalidParameter,r)})},e.hasvalue=function(n,r){return t(n,r,(a,s,o)=>(D(o,2,2,n,r),Xn(o[0],o[1])!=null))},e.indexof=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);const i=o[1];if(_(o[0])){for(let u=0;u{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?_a(o[0],o[1]):Ma(o[0],o[1],o[2])})},e.bearing=function(n,r){return t(n,r,(a,s,o)=>{if(o=L(o),D(o,2,3,n,r),!(o[0]instanceof V))throw new h(n,c.InvalidParameter,r);if(!(o[1]instanceof V))throw new h(n,c.InvalidParameter,r);if(o.length>2&&!(o[2]instanceof V))throw new h(n,c.InvalidParameter,r);return o.length===2?Ta(o[0],o[1]):Na(o[0],o[1],o[2])})},e.isselfintersecting=function(n,r){return t(n,r,(a,s,o)=>{o=L(o),D(o,1,1,n,r);let i=o[0];if(i instanceof le)return i.isSelfIntersecting;if(i instanceof ae)return pr(i.paths);if(i instanceof We){const u=i.points;for(let l=0;l0&&l[0][i]===t)return{partId:a,distanceAlong:s,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:l[0][0],y:l[0][1],...e.hasZ?{z:l[0][u]}:{},...e.hasM?{m:l[0][i]}:{}}),segmentId:0};let f=-1;for(let d=1;dt&&t>l[d-1][i]){const b=(t-l[d-1][i])/g*p;let x=e.hasZ?si(l[d-1],l[d],b,r):ui(l[d-1],l[d],b);x=[...x,t];const O=new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:x[0],y:x[1],...e.hasZ?{z:x[u]}:{},...e.hasM?{m:x[i]}:{}});return{partId:a,distanceAlong:s+o(l[d-1],[O.x,O.y,...O.hasZ?[O.z]:[],...O.hasM?[O.m]:[]],r),coordinate:O,segmentId:f}}s+=p}}return null}function ja(e,t){if(!e)return null;switch(e.type){case"extent":case"multipoint":case"mesh":case"point":return null}const n=e.type==="polygon"?e.rings:e.paths;if(t<0)return null;let r=1;(e.spatialReference.vcsWkid||e.spatialReference.latestVcsWkid)&&(r=wt(e.spatialReference)/yt(e.spatialReference));let a=0;const s=e.hasZ?3:2,o=2,i=e.hasZ?De:oi;let u=-1;if(t===0)return n.length===0||n[0].length===0?null:{partId:0,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:n[0][0][0],y:n[0][0][1],...e.hasZ?{z:n[0][0][o]}:{},...e.hasM?{m:n[0][0][s]}:{}}),segmentId:0};for(const l of n){u++;let f=-1;for(let d=1;dt){let y=e.hasZ?si(l[d-1],l[d],t-a,r):ui(l[d-1],l[d],t-a);return y=[...y,Ln(l[d-1][s],l[d][s],p,t-a)],{partId:u,coordinate:new V({hasZ:e.hasZ,hasM:e.hasM,spatialReference:e.spatialReference,x:y[0],y:y[1],...e.hasZ?{z:y[o]}:{},...e.hasM?{m:y[s]}:{}}),segmentId:f}}a=g}}return null}function Va(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0;return r=e,a=e.hasZ&&t.hasZ?De([t.x,t.y,t.z],[e.x,e.y,e.z],n):Ve([t.x,t.y],[e.x,e.y],!1),{coordinate:r,distance:a}}function Ja(e,t){if(!e||!t)return null;let n=1;(t.spatialReference.vcsWkid||t.spatialReference.latestVcsWkid)&&(n=wt(t.spatialReference)/yt(t.spatialReference));let r=null,a=0,s=Number.MAX_VALUE,o=-1,i=-1;for(const u of e.points||[]){i++;const l=e.hasZ&&t.hasZ?ti([u[0],u[1],u[2]],[t.x,t.y,t.z],n):ni([u[0],u[1]],[t.x,t.y]);l(i=L(i),n(r,a,i),i[0]===null||i[1]===null||R.disjoint(i[0],i[1])))},e.intersects=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.intersects(i[0],i[1])))},e.touches=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.touches(i[0],i[1])))},e.crosses=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.crosses(i[0],i[1])))},e.within=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.within(i[0],i[1])))},e.contains=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.contains(i[0],i[1])))},e.overlaps=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]!==null&&i[1]!==null&&R.overlaps(i[0],i[1])))},e.equals=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),i[0]===i[1]||(i[0]instanceof k&&i[1]instanceof k?R.equals(i[0],i[1]):(ce(i[0])&&ce(i[1])||Q(i[0])&&Q(i[1])||!(!q(i[0])||!q(i[1])))&&i[0].equals(i[1]))))},e.relate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,3,3,r,a),i[0]instanceof k&&i[1]instanceof k)return R.relate(i[0],i[1],E(i[2]));if(i[0]instanceof k&&i[1]===null||i[1]instanceof k&&i[0]===null||i[0]===null&&i[1]===null)return!1;throw new h(r,c.InvalidParameter,a)})},e.intersection=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null||i[1]===null?null:R.intersect(i[0],i[1])))},e.union=function(r,a){return t(r,a,(s,o,i)=>{const u=[];if((i=L(i)).length===0)throw new h(r,c.WrongNumberOfParameters,a);if(i.length===1)if(_(i[0])){const l=L(i[0]);for(let f=0;f(i=L(i),n(r,a,i),i[0]===null?null:i[1]===null?Se(i[0]):R.difference(i[0],i[1])))},e.symmetricdifference=function(r,a){return t(r,a,(s,o,i)=>(i=L(i),n(r,a,i),i[0]===null&&i[1]===null?null:i[0]===null?Se(i[1]):i[1]===null?Se(i[0]):R.symmetricDifference(i[0],i[1])))},e.clip=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof Ne)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?null:R.clip(i[0],i[1])})},e.cut=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[1]instanceof ae)&&i[1]!==null)throw new h(r,c.InvalidParameter,a);if(i[0]===null)return[];if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[1]===null?[Se(i[0])]:R.cut(i[0],i[1])})},e.area=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.planarArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarArea(i[0],Vt(N(i[1],-1)))})},e.areageodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=cr(i[0],r.spatialReference);return u===null?0:R.geodesicArea(u,Vt(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicArea(i[0],Vt(N(i[1],-1)))})},e.length=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.planarLength(i[0],re(N(i[1],-1)))})},e.length3d=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:u.hasZ===!0?Dr(u,re(N(i[1],-1))):R.planarLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return i[0].hasZ===!0?Dr(i[0],re(N(i[1],-1))):R.planarLength(i[0],re(N(i[1],-1)))})},e.lengthgeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),(i=L(i))[0]===null)return 0;if(_(i[0])||P(i[0])){const u=Ye(i[0],r.spatialReference);return u===null?0:R.geodesicLength(u,re(N(i[1],-1)))}if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.geodesicLength(i[0],re(N(i[1],-1)))})},e.distance=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);let u=i[0];(_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference));let l=i[1];if((_(i[1])||P(i[1]))&&(l=pn(i[1],r.spatialReference)),!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(l instanceof k))throw new h(r,c.InvalidParameter,a);return R.distance(u,l,re(N(i[2],-1)))})},e.distancegeodetic=function(r,a){return t(r,a,(s,o,i)=>{i=L(i),D(i,2,3,r,a);const u=i[0],l=i[1];if(!(u instanceof V))throw new h(r,c.InvalidParameter,a);if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);const f=new ae({paths:[],spatialReference:u.spatialReference});return f.addPath([u,l]),R.geodesicLength(f,re(N(i[2],-1)))})},e.densify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.densify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.densify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.densifygeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);if(u<=0)throw new h(r,c.InvalidParameter,a);return i[0]instanceof le||i[0]instanceof ae?R.geodesicDensify(i[0],u,re(N(i[2],-1))):i[0]instanceof Ne?R.geodesicDensify(le.fromExtent(i[0]),u,re(N(i[2],-1))):i[0]})},e.generalize=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,4,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return R.generalize(i[0],u,Tt(N(i[2],!0)),re(N(i[3],-1)))})},e.buffer=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.buffer(i[0],u,re(N(i[2],-1)))})},e.buffergeodetic=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);return u===0?Se(i[0]):R.geodesicBuffer(i[0],u,re(N(i[2],-1)))})},e.offset=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,6,r,a),i[0]===null)return null;if(!(i[0]instanceof le||i[0]instanceof ae))throw new h(r,c.InvalidParameter,a);const u=m(i[1]);if(isNaN(u))throw new h(r,c.InvalidParameter,a);const l=m(N(i[4],10));if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=m(N(i[5],0));if(isNaN(f))throw new h(r,c.InvalidParameter,a);return R.offset(i[0],u,re(N(i[2],-1)),E(N(i[3],"round")).toLowerCase(),l,f)})},e.rotate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,3,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);const u=i[0]instanceof Ne?le.fromExtent(i[0]):i[0],l=m(i[1]);if(isNaN(l))throw new h(r,c.InvalidParameter,a);const f=N(i[2],null);if(f===null)return R.rotate(u,l);if(f instanceof V)return R.rotate(u,l,f);throw new h(r,c.InvalidParameter,a)})},e.centroid=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=pn(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);return u instanceof V?te(Se(u),r.spatialReference):u instanceof le?u.centroid:u instanceof ae?Sa(u):u instanceof We?Ia(u):u instanceof Ne?u.center:null})},e.measuretocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=Za(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.pointtocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);const l=i[1];if(l===null)return null;if(!(l instanceof V))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const f=qa(u,l);return f?v.convertObjectToArcadeDictionary(f,B(r),!1,!0):null})},e.distancetocoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),i[0]===null)return null;let u=i[0];if((_(i[0])||P(i[0]))&&(u=Ye(i[0],r.spatialReference)),u===null)return null;if(!(u instanceof k))throw new h(r,c.InvalidParameter,a);if(!(u instanceof ae))throw new h(r,c.InvalidParameter,a);if(W(i[1]===!1))throw new h(r,c.InvalidParameter,a);const l=ja(u,i[1]);return l?v.convertObjectToArcadeDictionary(l,B(r),!1,!0):null})},e.multiparttosinglepart=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);if(i[0]instanceof V)return[te(Se(i[0]),r.spatialReference)];if(i[0]instanceof Ne)return[te(Se(i[0]),r.spatialReference)];const u=R.simplify(i[0]);if(u instanceof le){const l=[],f=[];for(let d=0;d{if(i=L(i),D(i,1,1,r,a),i[0]===null)return!0;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.isSimple(i[0])})},e.simplify=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.simplify(i[0])})},e.convexhull=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,1,1,r,a),i[0]===null)return null;if(!(i[0]instanceof k))throw new h(r,c.InvalidParameter,a);return R.convexHull(i[0])})},e.nearestcoordinate=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestCoordinate(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})},e.nearestvertex=function(r,a){return t(r,a,(s,o,i)=>{if(i=L(i),D(i,2,2,r,a),!(i[0]instanceof k||i[0]===null))throw new h(r,c.InvalidParameter,a);if(!(i[1]instanceof V||i[1]===null))throw new h(r,c.InvalidParameter,a);if(i[0]===null||i[1]===null)return null;const u=R.nearestVertex(i[0],i[1]);return u===null||u.isEmpty?null:v.convertObjectToArcadeDictionary({coordinate:u.coordinate,distance:u.distance,sideOfLine:u.distance===0?"straddle":u.isRightSide?"right":"left"},B(r),!1,!0)})}}function ci(e,t){function n(r,a,s){const o=m(r);return isNaN(o)?o:isNaN(a)||isNaN(s)||a>s?NaN:os?s:o}e.number=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,2,r,a);const u=i[0];if(W(u))return u;if(u===null)return 0;if(ce(u)||Q(u)||q(u))return u.toNumber();if(X(u))return Number(u);if(_(u))return NaN;if(u===""||u===void 0)return Number(u);if(S(u)){if(i[1]!==void 0){let l=Tn(i[1],"‰","");return l=Tn(l,"¤",""),da(u,{pattern:l})}return Number(u.trim())}return Number(u)})},e.abs=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.abs(m(i[0]))))},e.acos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.acos(m(i[0]))))},e.asin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.asin(m(i[0]))))},e.atan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.atan(m(i[0]))))},e.atan2=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),Math.atan2(m(i[0]),m(i[1]))))},e.ceil=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("ceil",m(i[0]),-1*u)}return Math.ceil(m(i[0]))})},e.round=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("round",m(i[0]),-1*u)}return Math.round(m(i[0]))})},e.floor=function(r,a){return t(r,a,(s,o,i)=>{if(D(i,1,2,r,a),i.length===2){let u=m(i[1]);return isNaN(u)&&(u=0),fn("floor",m(i[0]),-1*u)}return Math.floor(m(i[0]))})},e.cos=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.cos(m(i[0]))))},e.isnan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),typeof i[0]=="number"&&isNaN(i[0])))},e.exp=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.exp(m(i[0]))))},e.log=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.log(m(i[0]))))},e.pow=function(r,a){return t(r,a,(s,o,i)=>(D(i,2,2,r,a),m(i[0])**m(i[1])))},e.random=function(r,a){return t(r,a,(s,o,i)=>(D(i,0,0,r,a),Math.random()))},e.sin=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sin(m(i[0]))))},e.sqrt=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.sqrt(m(i[0]))))},e.tan=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),Math.tan(m(i[0]))))},e.isempty=function(r,a){return t(r,a,(s,o,i)=>(D(i,1,1,r,a),i[0]===null||i[0]===""||i[0]===void 0||i[0]===I))},e.boolean=function(r,a){return t(r,a,(s,o,i)=>{D(i,1,1,r,a);const u=i[0];return Tt(u)})},e.constrain=function(r,a){return t(r,a,(s,o,i)=>{D(i,3,3,r,a);const u=m(i[1]),l=m(i[2]);if(_(i[0])){const f=[];for(const d of i[0])f.push(n(d,u,l));return f}if(P(i[0])){const f=[];for(let d=0;d=t&&t!==-1)return n}return n}function yn(e,t,n=1e3){switch(e.toLowerCase()){case"distinct":return Xa(t,n);case"avg":case"mean":return hi(at(t));case"min":return Math.min.apply(Math,at(t));case"sum":return Ka(at(t));case"max":return Math.max.apply(Math,at(t));case"stdev":case"stddev":return Math.sqrt(gr(at(t)));case"var":case"variance":return gr(at(t));case"count":return t.length}return 0}function Ke(e,t){if(t.length===1){if(_(t[0]))return yn(e,t[0],-1);if(P(t[0]))return yn(e,t[0].toArray(),-1)}return yn(e,t,-1)}function di(e,t){e.stdev=function(n,r){return t(n,r,(a,s,o)=>Ke("stdev",o))},e.variance=function(n,r){return t(n,r,(a,s,o)=>Ke("variance",o))},e.average=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.mean=function(n,r){return t(n,r,(a,s,o)=>Ke("mean",o))},e.sum=function(n,r){return t(n,r,(a,s,o)=>Ke("sum",o))},e.min=function(n,r){return t(n,r,(a,s,o)=>Ke("min",o))},e.max=function(n,r){return t(n,r,(a,s,o)=>Ke("max",o))},e.distinct=function(n,r){return t(n,r,(a,s,o)=>Ke("distinct",o))},e.count=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),_(o[0])||S(o[0]))return o[0].length;if(P(o[0]))return o[0].length();throw new h(n,c.InvalidParameter,r)})}}let Pn=class extends v{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}},Qa=class fi extends v{constructor(t,n,r,a,s,o,i){super(),this.attachmentUrl=s,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",t),this.setField("name",n),this.setField("contenttype",r),this.setField("size",a),this.setField("exifinfo",o),this.setField("keywords",i),this.immutable=!0}deepClone(){return new fi(this.field("id"),this.field("name"),this.field("contenttype"),this.field("size"),this.attachmentUrl,this.field("exifinfo")?.deepClone()??null,this.field("keywords"))}};const Qn=e=>(t,n,r=14)=>+e(t,n).toFixed(r),Ya=(e,t)=>e+t,$a=(e,t)=>e*t,eo=(e,t)=>e/t,yr=(e,t,n)=>Qn(Ya)(e,t,n),dt=(e,t,n)=>Qn($a)(e,t,n),Qt=(e,t,n)=>Qn(eo)(e,t,n),Yt=360,to=400,no=2*Math.PI,Ie=3600,wr=3240,kt=60,Qe=60,xr=180*Ie/Math.PI,bt=Yt*kt*Qe,wn=90*Ie,ot=180*Ie,ro=270*Ie,mi="ᵍ",vt="°";function Ct(e){if(S(e)===!1)throw new h(null,c.InvalidParameter,null);return e}function On(e,t){const n=10**t;return Math.round(e*n)/n}function io(e,t){return e%t}function st(e){const t=parseFloat(e.toString().replace(Math.trunc(e).toString(),"0"))*Math.sign(e);return e<0?{fraction:t,integer:Math.ceil(e)}:{fraction:t,integer:Math.floor(e)}}var J,w,Z,Un;function ht(e,t){switch(e){case J.north:return t==="SHORT"?"N":"North";case J.east:return t==="SHORT"?"E":"East";case J.south:return t==="SHORT"?"S":"South";case J.west:return t==="SHORT"?"W":"West"}}function xn(e,t){return e-Math.floor(e/t)*t}function Fn(e){switch(e){case w.truncated_degrees:case w.decimal_degrees:return Yt;case w.radians:return no;case w.gradians:return to;case w.seconds:return bt;case w.fractional_degree_minutes:return kt;case w.fractional_minute_seconds:return Qe;default:throw new h(null,c.LogicError,null,{reason:"unsupported evaluations"})}}function Fr(e){switch(e.toUpperCase().trim()){case"NORTH":case"NORTHAZIMUTH":case"NORTH AZIMUTH":return Z.north_azimuth;case"POLAR":return Z.polar;case"QUADRANT":return Z.quadrant;case"SOUTH":case"SOUTHAZIMUTH":case"SOUTH AZIMUTH":return Z.south_azimuth}throw new h(null,c.LogicError,null,{reason:"unsupported directionType"})}function Ar(e){switch(e.toUpperCase().trim()){case"D":case"DD":case"DECIMALDEGREE":case"DECIMAL DEGREE":case"DEGREE":case"DECIMALDEGREES":case"DECIMAL DEGREES":case"DEGREES":return w.decimal_degrees;case"DMS":case"DEGREESMINUTESSECONDS":case"DEGREES MINUTES SECONDS":return w.degrees_minutes_seconds;case"R":case"RAD":case"RADS":case"RADIAN":case"RADIANS":return w.radians;case"G":case"GON":case"GONS":case"GRAD":case"GRADS":case"GRADIAN":case"GRADIANS":return w.gradians}throw new h(null,c.LogicError,null,{reason:"unsupported units"})}(function(e){e[e.north=0]="north",e[e.east=1]="east",e[e.south=2]="south",e[e.west=3]="west"})(J||(J={})),function(e){e[e.decimal_degrees=1]="decimal_degrees",e[e.seconds=2]="seconds",e[e.degrees_minutes_seconds=3]="degrees_minutes_seconds",e[e.radians=4]="radians",e[e.gradians=5]="gradians",e[e.truncated_degrees=6]="truncated_degrees",e[e.fractional_degree_minutes=7]="fractional_degree_minutes",e[e.fractional_minute_seconds=8]="fractional_minute_seconds"}(w||(w={})),function(e){e[e.north_azimuth=1]="north_azimuth",e[e.polar=2]="polar",e[e.quadrant=3]="quadrant",e[e.south_azimuth=4]="south_azimuth"}(Z||(Z={})),function(e){e[e.meridian=0]="meridian",e[e.direction=1]="direction"}(Un||(Un={}));let pt=class qt{constructor(t,n,r){this.m_degrees=t,this.m_minutes=n,this.m_seconds=r}getField(t){switch(t){case w.decimal_degrees:case w.truncated_degrees:return this.m_degrees;case w.fractional_degree_minutes:return this.m_minutes;case w.seconds:case w.fractional_minute_seconds:return this.m_seconds;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}static secondsToDMS(t){const n=st(t).fraction;let r=st(t).integer;const a=Math.floor(r/Ie);r-=a*Ie;const s=Math.floor(r/Qe);return r-=s*Qe,new qt(a,s,r+n)}static numberToDms(t){const n=st(t).fraction,r=st(t).integer,a=dt(st(100*n).fraction,100),s=st(100*n).integer;return new qt(r,s,a)}format(t,n){let r=On(this.m_seconds,n),a=this.m_minutes,s=this.m_degrees;if(t===w.seconds||t===w.fractional_minute_seconds)Qe<=r&&(r-=Qe,++a),kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.fractional_degree_minutes)r=0,a=30<=this.m_seconds?this.m_minutes+1:this.m_minutes,s=this.m_degrees,kt<=a&&(a=0,++s),Yt<=s&&(s=0);else if(t===w.decimal_degrees||t===w.truncated_degrees){const o=Qt(this.m_seconds,Ie),i=Qt(this.m_minutes,kt);s=Math.round(this.m_degrees+i+o),a=0,r=0}return new qt(s,a,r)}static dmsToSeconds(t,n,r){return t*Ie+n*Qe+r}},ao=class{constructor(e,t,n){this.meridian=e,this.angle=t,this.direction=n}fetchAzimuth(e){return e===Un.meridian?this.meridian:this.direction}},Xe=class Ze{constructor(t){this._angle=t}static createFromAngleAndDirection(t,n){return new Ze(new Re(Ze._convertDirectionFormat(t.extractAngularUnits(w.seconds),n,Z.north_azimuth)))}getAngle(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:case Z.south_azimuth:case Z.polar:return new Re(Ze._convertDirectionFormat(n,Z.north_azimuth,t));case Z.quadrant:{const r=Ze.secondsNorthAzimuthToQuadrant(n);return new Re(r.angle)}}}getMeridian(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.north;case Z.south_azimuth:return J.south;case Z.polar:return J.east;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).meridian}}getDirection(t){const n=this._angle.extractAngularUnits(w.seconds);switch(t){case Z.north_azimuth:return J.east;case Z.south_azimuth:return J.west;case Z.polar:return J.north;case Z.quadrant:return Ze.secondsNorthAzimuthToQuadrant(n).direction}}static secondsNorthAzimuthToQuadrant(t){const n=t<=wn||t>=ro?J.north:J.south,r=n===J.north?Math.min(bt-t,t):Math.abs(t-ot),a=t>ot?J.west:J.east;return new ao(n,r,a)}static createFromAngleMeridianAndDirection(t,n,r){return new Ze(new Re(Ze.secondsQuadrantToNorthAzimuth(t.extractAngularUnits(w.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(t,n,r){return n===J.north?r===J.east?t:bt-t:r===J.east?ot-t:ot+t}static _convertDirectionFormat(t,n,r){let a=0;switch(n){case Z.north_azimuth:a=t;break;case Z.polar:a=wn-t;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:a=t+ot}let s=0;switch(r){case Z.north_azimuth:s=a;break;case Z.polar:s=wn-a;break;case Z.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case Z.south_azimuth:s=a-ot}return s=io(s,bt),s<0?bt+s:s}};function Cr(e,t,n){let r=null;switch(t){case w.decimal_degrees:r=dt(e,Ie);break;case w.seconds:r=e;break;case w.gradians:r=dt(e,wr);break;case w.radians:r=dt(e,xr);break;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case w.decimal_degrees:return Qt(r,Ie);case w.seconds:return r;case w.gradians:return Qt(r,wr);case w.radians:return r/xr;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}let Re=class zn{constructor(t){this._seconds=t}static createFromAngleAndUnits(t,n){return new zn(Cr(t,n,w.seconds))}extractAngularUnits(t){return Cr(this._seconds,w.seconds,Nt(t))}static createFromDegreesMinutesSeconds(t,n,r){return new zn(yr(yr(dt(t,Ie),dt(n,Qe)),r))}};function Nt(e){switch(jr(e),e){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}}let oo=class pi{constructor(t,n,r,a){this.view=t,this.angle=n,this.merdian=r,this.direction=a,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(t,n,r){return new pi(t,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 t=null,n=w.truncated_degrees,r=0;for(let a=0;a0?1:0),"0");case w.truncated_degrees:case w.fractional_degree_minutes:return s=xn(a.fetchFormattedDms().getField(t),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");case w.fractional_minute_seconds:return s=xn(On(a.fetchDms().getField(t),r),Fn(t)),s.toFixed(r).padStart(n+r+(r>0?1:0),"0");default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}function uo(e,t,n){if(n===Z.quadrant)throw new h(null,c.LogicError,null,{reason:"conversion error"});if(t===w.degrees_minutes_seconds){const r=pt.numberToDms(e);return Xe.createFromAngleAndDirection(Re.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(e,Nt(t)),n)}function lo(e){switch(m(e)){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 Er(e){switch(e.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 ut(e){const t=parseFloat(e);if(W(t)){if(isNaN(t))throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return t}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function An(e,t,n){const r=n===Z.quadrant;let a=null,s=null,o=0,i=0,u=0;if(r){if(e.length<2)throw new h(null,c.LogicError,null,{reason:"conversion error"});u=1;const l=lo(E(e[e.length-1]));if(l?(a=l.first,s=l.second):(o=1,a=Er(E(e[0])),s=Er(E(e[e.length-1]))),a===null||s===null)throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}switch(t){case w.decimal_degrees:case w.radians:case w.gradians:if(e.length===0)throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return r?Xe.createFromAngleMeridianAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),a,s):Xe.createFromAngleAndDirection(Re.createFromAngleAndUnits(ut(e[o]),Nt(t)),n);case w.degrees_minutes_seconds:if(i=e.length-u-o,i===3){const l=Re.createFromDegreesMinutesSeconds(ut(e[o]),ut(e[o+1]),ut(e[o+2]));return r?Xe.createFromAngleMeridianAndDirection(l,a,s):Xe.createFromAngleAndDirection(l,n)}if(i===1){const l=ut(e[o]),f=pt.numberToDms(l),d=Re.createFromDegreesMinutesSeconds(f.m_degrees,f.m_minutes,f.m_seconds);return r?Xe.createFromAngleMeridianAndDirection(d,a,s):Xe.createFromAngleAndDirection(d,n)}}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function co(e){const t=new Set([" ","-","/","'",'"',"\\","^",vt,mi," ","\r",` `,"*"]);let n="";for(let r=0;rr!=="")}function ho(e,t,n){if(W(e))return uo(m(e),t,n);if(S(e))return An(co(e),t,n);if(_(e))return An(e,t,n);if(P(e))return An(e.toArray(),t,n);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function fo(e,t,n){const r=Nt(n);if(r&&n!==w.degrees_minutes_seconds)return e.getAngle(t).extractAngularUnits(r);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function mo(e,t,n){const r=e.getAngle(t);if(t===Z.quadrant&&n===w.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(w.seconds));return[ht(e.getMeridian(t),"SHORT"),a.m_degrees,a.m_minutes,a.m_seconds,ht(e.getDirection(t),"SHORT")]}if(n===w.degrees_minutes_seconds){const a=pt.secondsToDMS(r.extractAngularUnits(w.seconds));return[a.m_degrees,a.m_minutes,a.m_seconds]}return t===Z.quadrant?[ht(e.getMeridian(t),"SHORT"),r.extractAngularUnits(n),ht(e.getDirection(t),"SHORT")]:[r.extractAngularUnits(n)]}function po(e,t){let n="";switch(e){case w.decimal_degrees:n=t===Z.quadrant?"DD.DD"+vt:"DDD.DD"+vt;break;case w.degrees_minutes_seconds:n=t===Z.quadrant?"dd"+vt+` mm' ss"`:"ddd"+vt+` mm' ss.ss"`;break;case w.radians:n="R.RR";break;case w.gradians:n="GGG.GG"+mi;break;default:throw new h(null,c.LogicError,null,{reason:"conversion error"})}return t===Z.quadrant&&(n="p "+n+" b"),n}function Gn(e,t,n){const r={padding:0,rounding:0,newpos:t};let a=!1;for(;t>6,128|63&a):a<55296||a>=57344?t.push(224|a>>12,128|a>>6&63,128|63&a):(n++,a=65536+((1023&a)<<10|1023&e.charCodeAt(n)),t.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|63&a))}return new Uint8Array(t)}let wo=class{constructor(e){this._seed=e,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(e){const t=[];for(const n of e)isNaN(n)?t.push("NaN"):n===1/0?t.push("Infinity"):n===-1/0?t.push("-Infinity"):n===0?t.push("0"):t.push(n.toString(16));this.update(Sr(t.join("")))}updateIntArray(e){const t=Int32Array.from(e);this.update(new Uint8Array(t.buffer))}updateUint8Array(e){this.update(Uint8Array.from(e))}updateWithString(e){return this.update(Sr(e))}update(e){return this._bufs.push(e),this._totallen+=e.length,this}digest(){const e=new Uint8Array(this._totallen);let t=0;for(const n of this._bufs)e.set(n,t),t+=n.length;return this.init(),this._xxHash32(e,this._seed)}_xxHash32(e,t=0){const n=e;let r=t+vr&4294967295,a=0;if(n.length>=16){const o=[t+lt+ct&4294967295,t+ct&4294967295,t+0&4294967295,t-lt&4294967295],i=e,u=i.length-16;let l=0;for(a=0;(4294967280&a)<=u;a+=4){const f=a,d=i[f]+(i[f+1]<<8),p=i[f+2]+(i[f+3]<<8),g=d*ct+(p*ct<<16);let y=o[l]+g&4294967295;y=y<<13|y>>>19;const b=65535&y,x=y>>>16;o[l]=b*lt+(x*lt<<16)&4294967295,l=l+1&3}r=(o[0]<<1|o[0]>>>31)+(o[1]<<7|o[1]>>>25)+(o[2]<<12|o[2]>>>20)+(o[3]<<18|o[3]>>>14)&4294967295}r=r+e.length&4294967295;const s=e.length-4;for(;a<=s;a+=4){const o=a,i=n[o]+(n[o+1]<<8),u=n[o+2]+(n[o+3]<<8);r=r+(i*Jt+(u*Jt<<16))&4294967295,r=r<<17|r>>>15,r=(65535&r)*br+((r>>>16)*br<<16)&4294967295}for(;a>>21,r=(65535&r)*lt+((r>>>16)*lt<<16)&4294967295;return r^=r>>>15,r=((65535&r)*ct&4294967295)+((r>>>16)*ct<<16),r^=r>>>13,r=((65535&r)*Jt&4294967295)+((r>>>16)*Jt<<16),r^=r>>>16,r<0?r+4294967296:r}};function xo(e){return e.loadStatus==="loaded"&&e.user?.sourceJSON?e.user.sourceJSON:null}function Fo(e,t){return!!e&&Yi(e,t?.restUrl||"")}function Ir(e,t){if(!e||!t)return e===t;if(e.x===t.x&&e.y===t.y){if(e.hasZ){if(e.z!==t.z)return!1}else if(t.hasZ)return!1;if(e.hasM){if(e.m!==t.m)return!1}else if(t.hasM)return!1;return!0}return!1}function Ee(e,t,n){if(e!==null)if(_(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e)Ee(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else if(P(e)){if(t.updateUint8Array([61]),n.map.has(e)){const r=n.map.get(e);t.updateIntArray([61237541^r])}else{n.map.set(e,n.currentLength++);for(const r of e.toArray())Ee(r,t,n);n.map.delete(e),n.currentLength--}t.updateUint8Array([199])}else{if(ce(e))return t.updateIntArray([e.toNumber()]),void t.updateUint8Array([241]);if(q(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([257]);if(Q(e))return t.updateIntArray([e.toNumber()]),void t.updateIntArray([263]);if(S(e))return t.updateIntArray([e.length]),t.updateWithString(e),void t.updateUint8Array([41]);if(X(e))t.updateUint8Array([e===!0?1:0,113]);else{if(W(e))return t.updateFloatArray([e]),void t.updateUint8Array([173]);if(e instanceof Qa)throw new h(n.context,c.UnsupportedHashType,n.node);if(e instanceof Pn)throw new h(n.context,c.UnsupportedHashType,n.node);if(!(e instanceof v)){if(K(e))throw new h(n.context,c.UnsupportedHashType,n.node);if(e instanceof V)return t.updateIntArray([3833836621]),t.updateIntArray([0]),t.updateFloatArray([e.x]),t.updateIntArray([1]),t.updateFloatArray([e.y]),e.hasZ&&(t.updateIntArray([2]),t.updateFloatArray([e.z])),e.hasM&&(t.updateIntArray([3]),t.updateFloatArray([e.m])),t.updateIntArray([3765347959]),void Ee(e.spatialReference.wkid,t,n);if(e instanceof le){t.updateIntArray([1266616829]);for(let r=0;r(D(o,1,1,n,r),new Pn(E(o[0]))))},e.typeof=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=Jr(o[0]);if(i==="Unrecognized Type")throw new h(n,c.UnrecognizedType,r);return i})},e.trim=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,1,n,r),E(o[0]).trim()))},e.tohex=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=m(o[0]);return isNaN(i)?i:i.toString(16)})},e.upper=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,1,n,r),E(o[0]).toUpperCase()))},e.proper=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);let i=1;o.length===2&&E(o[1]).toLowerCase()==="firstword"&&(i=2);const u=/\s/,l=E(o[0]);let f="",d=!0;for(let p=0;p(D(o,1,1,n,r),E(o[0]).toLowerCase()))},e.guid=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,0,1,n,r),o.length>0)switch(E(o[0]).toLowerCase()){case"digits":return Ft().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return Ft();case"digits-hyphen-braces":return"{"+Ft()+"}";case"digits-hyphen-parentheses":return"("+Ft()+")"}return"{"+Ft()+"}"})},e.standardizeguid=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);let i=E(o[0]);if(i===""||i===null)return"";const u=/^(\{|\()?(?[0-9a-z]{8})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{4})(-?)(?[0-9a-z]{12})(\}|\))?$/gim.exec(i);if(!u)return"";const l=u.groups;switch(i=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,E(o[1]).toLowerCase()){case"digits":return i.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return i;case"digits-hyphen-braces":return"{"+i+"}";case"digits-hyphen-parentheses":return"("+i+")"}return"{"+i+"}"})},e.console=function(n,r){return t(n,r,(a,s,o)=>(o.length===0||(o.length===1?n.console(E(o[0])):n.console(E(o))),I))},e.mid=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=m(o[1]);if(isNaN(i))return"";if(i=Math.max(0,i),o.length===2)return E(o[0]).slice(i);let u=m(o[2]);return isNaN(u)?"":(u<0&&(u=0),E(o[0]).slice(i,i+u))})},e.find=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,3,n,r);let i=0;if(o.length>2){if(i=m(N(o[2],0)),isNaN(i))return-1;i<0&&(i=0)}return E(o[1]).indexOf(E(o[0]),i)})},e.left=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);let i=m(o[1]);return isNaN(i)?"":(i<0&&(i=0),E(o[0]).slice(0,i))})},e.right=function(n,r){return t(n,r,(a,s,o)=>{D(o,2,2,n,r);const i=m(o[1]);return isNaN(i)||i<=0?"":E(o[0]).slice(-i)})},e.split=function(n,r){return t(n,r,(a,s,o)=>{let i;D(o,2,4,n,r);let u=m(N(o[2],-1));const l=Tt(N(o[3],!1));if(u===-1||u===null||l===!0?i=E(o[0]).split(E(o[1])):(isNaN(u)&&(u=-1),u<-1&&(u=-1),i=E(o[0]).split(E(o[1]),u)),l===!1)return i;const f=[];for(let d=0;d=u);d++)i[d]!==""&&i[d]!==void 0&&f.push(i[d]);return f})},e.text=function(n,r){return t(n,r,(a,s,o)=>(D(o,1,2,n,r),qe(o[0],o[1])))},e.concatenate=function(n,r){return t(n,r,(a,s,o)=>{const i=[];if(o.length<1)return"";if(_(o[0])){const u=N(o[2],"");for(let l=0;l1?i.join(o[1]):i.join("")}if(P(o[0])){const u=N(o[2],"");for(let l=0;l1?i.join(o[1]):i.join("")}for(let u=0;u{if(D(o,1,1,n,r),_(o[0])){const i=o[0].slice();return i.reverse(),i}if(P(o[0])){const i=o[0].toArray().slice();return i.reverse(),i}throw new h(n,c.InvalidParameter,r)})},e.replace=function(n,r){return t(n,r,(a,s,o)=>{D(o,3,4,n,r);const i=E(o[0]),u=E(o[1]),l=E(o[2]);return o.length!==4||Tt(o[3])?Tn(i,u,l):i.replace(u,l)})},e.schema=function(n,r){return t(n,r,(a,s,o)=>{if(K(o[0])){const i=ra(o[0]);return i?v.convertObjectToArcadeDictionary(i,B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.subtypes=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);return i?v.convertObjectToArcadeDictionary(i,B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.subtypecode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);if(!i)return null;if(i.subtypeField&&o[0].hasField(i.subtypeField)){const u=o[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.code;return null}return null}throw new h(n,c.InvalidParameter,r)})},e.subtypename=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0])){const i=mn(o[0]);if(!i)return"";if(i.subtypeField&&o[0].hasField(i.subtypeField)){const u=o[0].field(i.subtypeField);for(const l of i.subtypes)if(l.code===u)return l.name;return""}return""}throw new h(n,c.InvalidParameter,r)})},e.gdbversion=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),K(o[0]))return o[0].gdbVersion();throw new h(n,c.InvalidParameter,r)})},e.domain=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,3,n,r),K(o[0])){const i=ia(o[0],E(o[1]),o[2]===void 0?void 0:o[2]);return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?v.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:hr[i.field.type],codedValues:i.domain.codedValues.map(u=>({name:u.name,code:u.code}))},B(n)):v.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:hr[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},B(n)):null}throw new h(n,c.InvalidParameter,r)})},e.domainname=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),K(o[0]))return aa(o[0],E(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new h(n,c.InvalidParameter,r)})},e.domaincode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,2,4,n,r),K(o[0]))return oa(o[0],E(o[1]),o[2],o[3]===void 0?void 0:o[3]);throw new h(n,c.InvalidParameter,r)})},e.urlencode=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),o[0]===null)return"";if(o[0]instanceof v){let i="";for(const u of o[0].keys()){const l=o[0].field(u);i!==""&&(i+="&"),i+=l===null?encodeURIComponent(u)+"=":encodeURIComponent(u)+"="+encodeURIComponent(l)}return i}return encodeURIComponent(E(o[0]))})},e.hash=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,1,n,r);const i=new wo(0);return Ee(o[0],i,{context:n,node:r,map:new Map,currentLength:0}),i.digest()})},e.convertdirection=function(n,r){return t(n,r,(a,s,o)=>(D(o,3,3,n,r),yo(o[0],o[1],o[2])))},e.fromjson=function(n,r){return t(n,r,(a,s,o)=>{if(D(o,1,1,n,r),S(o[0])===!1)throw new h(n,c.InvalidParameter,r);return v.convertJsonToArcade(JSON.parse(E(o[0])),B(n))})},e.expects=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);return I})},e.tocharcode=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=m(N(o[1],0)),u=E(o[0]);if(u.length===0&&o.length===1)return null;if(u.length<=i||i<0)throw new h(n,c.OutOfBounds,r);return u.charCodeAt(i)})},e.tocodepoint=function(n,r){return t(n,r,(a,s,o)=>{D(o,1,2,n,r);const i=m(N(o[1],0)),u=E(o[0]);if(u.length===0&&o.length===1)return null;if(u.length<=i||i<0)throw new h(n,c.OutOfBounds,r);return u.codePointAt(i)})},e.fromcharcode=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);const i=o.map(u=>Math.trunc(m(u))).filter(u=>u>=0&&u<=65535);return i.length===0?null:String.fromCharCode.apply(null,i)})},e.fromcodepoint=function(n,r){return t(n,r,(a,s,o)=>{if(o.length<1)throw new h(n,c.WrongNumberOfParameters,r);let i;try{i=o.map(u=>Math.trunc(m(u))).filter(u=>u<=1114111&&u>>>0===u)}catch{return null}return i.length===0?null:String.fromCodePoint.apply(null,i)})},e.getuser=function(n,r){return t(n,r,(a,s,o)=>{D(o,0,2,n,r);let i=N(o[1],"");if(i=i===!0||i===!1?"":E(i),i!==null&&i!=="")return null;if(o.length===0||o[0]instanceof Pn){let u=null;if(u=n.services?.portal?n.services.portal:Wn.getDefault(),o.length>0&&!Fo(o[0].field("url"),u)||!u)return null;if(i===""){const l=xo(u);if(l){const f=JSON.parse(JSON.stringify(l));for(const d of["lastLogin","created","modified"])f[d]!==void 0&&f[d]!==null&&(f[d]=new Date(f[d]));return v.convertObjectToArcadeDictionary(f,B(n))}}return null}throw new h(n,c.InvalidParameter,r)})},e.getenvironment=function(n,r){return t(n,r,(a,s,o)=>(D(o,0,0,n,r),v.convertObjectToArcadeDictionary(sa(B(n),n.spatialReference),B(n),!0)))}}let Ao=class extends Xr{constructor(e,t){super(),this.paramCount=t,this.fn=e}createFunction(e){return(...t)=>{if(t.length!==this.paramCount)throw new h(e,c.WrongNumberOfParameters,null);return this.fn(...t)}}call(e,t){return this.fn(...t.arguments)}marshalledCall(e,t,n,r){return r(e,t,(a,s,o)=>{o=o.map(u=>!Y(u)||u instanceof ft?u:Kt(u,e,r));const i=this.call(n,{arguments:o});return $e(i)?i.then(u=>Kt(u,n,r)):i})}};function xe(e,t,n){try{return n(e,null,t.arguments)}catch(r){throw r}}function T(e,t){switch(t.type){case"AssignmentExpression":return Io(e,t);case"UpdateExpression":return vo(e,t);case"TemplateLiteral":return Uo(e,t);case"Identifier":return Zo(e,t);case"MemberExpression":return Lo(e,t);case"Literal":return t.value===null||t.value===void 0?"null":JSON.stringify(t.value);case"CallExpression":return jo(e,t);case"UnaryExpression":return Po(e,t);case"BinaryExpression":return zo(e,t);case"LogicalExpression":return Go(e,t);case"ArrayExpression":return Oo(e,t);case"ObjectExpression":return Co(e,t);default:throw new he(e,c.Unrecognized,t)}}function pe(e,t){switch(t.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclaration":return No(e,t);case"BlockStatement":return Rt(e,t);case"FunctionDeclaration":return Mo(e,t);case"ImportDeclaration":return _o(e,t);case"ExportNamedDeclaration":return To(e,t);case"ReturnStatement":return Bo(e,t);case"IfStatement":return gi(e,t);case"ExpressionStatement":return ko(e,t);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"ForStatement":return bo(e,t);case"ForInStatement":return Eo(e,t);case"WhileStatement":return So(e,t);default:throw new he(e,c.Unrecognized,t)}}function Co(e,t){let n="lang.dictionary([";for(let r=0;r0&&(n+=","),n+="lang.strCheck("+s+",'ObjectExpression'),lang.aCheck("+T(e,a.value)+", 'ObjectExpression')"}return n+="])",n}function Eo(e,t){const n=be(e),r=be(e),a=be(e);let s="var "+n+" = "+T(e,t.right)+`; `;t.left.type==="VariableDeclaration"&&(s+=pe(e,t.left));const o=$(t.left.type==="VariableDeclaration"?t.left.declarations[0].id:t.left);Ae(o);let i="";e.localScope!==null&&(e.localScope[o]!==void 0?i="lscope['"+o+"']":e.localScope._SymbolsMap[o]!==void 0&&(i="lscope['"+e.localScope._SymbolsMap[o]+"']"));let u="";if(i===""){if(e.globalScope[o]!==void 0)i="gscope['"+o+"']";else if(e.globalScope._SymbolsMap[o]!==void 0)i="gscope['"+e.globalScope._SymbolsMap[o]+"']";else if(e.localScope!==null)if(e.undeclaredGlobalsInFunctions.has(o))i="gscope['"+e.undeclaredGlobalsInFunctions.get(o).manglename+"']",u=e.undeclaredGlobalsInFunctions.get(o).manglename;else{const l={manglename:_e(e),node:t.left};e.undeclaredGlobalsInFunctions.set(o,l),i="gscope['"+l.manglename+"']",u=l.manglename}}return u&&(s+="lang.chkAssig('"+u+`',runtimeCtx); `),s+="if ("+n+`===null) { lastStatement = lc.voidOperation; } @@ -150,7 +150,7 @@ return lang.__awaiter(this, void 0, void 0, function* () { var lastStatement=lc.voidOperation; `+s+` return lastStatement; } - return this.postProcess(mainBody()); `;const i=a.moduleFactory,u=a.moduleFactoryMap,l=a.exports,f={};let d;for(d in l)f[d]=a.mangleMap[d]??d;const p={lc:Kr,lang:xi,mangles:a.mangleMap,postProcess(g){if(g instanceof Fe&&(g=g.value),g instanceof an&&(g=g.value),g===I&&(g=null),g===Le)throw new h(null,c.IllegalResult,null);if(g===Ot)throw new h(null,c.IllegalResult,null);if(Y(g))throw new h(null,c.IllegalResult,null);return g},prepare(g,y){let b=g.spatialReference;b==null&&(b=Pt.WebMercator);const x=wi(g.vars,g.customfunctions,y,g.timeZone);return{localStack:[],isAsync:y,moduleFactory:i,moduleFactoryMap:u,mangleMap:this.mangles,moduleSingletons:{},exports:l,gdefs:{},exportmangle:f,spatialReference:b,globalScope:x,abortSignal:g.abortSignal===void 0||g.abortSignal===null?{aborted:!1}:g.abortSignal,localScope:null,services:g.services,console:g.console??$t,lrucache:g.lrucache,timeZone:g.timeZone??null,interceptor:g.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",o).bind(p)}async function Ko(){return rt([await je(()=>import("./geomasync-uGYsifQH-DIhokorn.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url)],"async"),!0}class St extends Kn{constructor(t){super(),this.moduleContext=t}hasGlobal(t){return this.moduleContext.exports[t]===void 0&&(t=t.toLowerCase()),this.moduleContext.exports[t]!==void 0}setGlobal(t,n){const r=this.moduleContext.globalScope,a=t.toLowerCase();if(Y(n))throw new h(null,c.AssignModuleFunction,null);r[this.moduleContext.exportmangle[a]]=n}global(t){const n=this.moduleContext.globalScope,r=t.toLowerCase(),a=n[this.moduleContext.exportmangle[r]];if(a===void 0)throw new h(null,c.InvalidIdentifier,null);if(Y(a)&&!(a instanceof ft)){const s=new ft;return s.fn=a,s.parameterEvaluator=xe,s.context=this.moduleContext,n[this.moduleContext.exportmangle[r]]=s,s}return a}}function Xo(e,t,n=!1){const r={isAsync:n,moduleFactory:t.moduleFactory,moduleFactoryMap:{},libraryResolver:new on(null,e.loadedModules),globalScope:yi(t.vars,n?Dt:ee,t.customfunctions),customfunctions:t.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:$t,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let a=Rt(r,e);a===""&&(a="lc.voidOperation; ");let s="";s=n?`var runtimeCtx=this.prepare(context, true); + return this.postProcess(mainBody()); `;const i=a.moduleFactory,u=a.moduleFactoryMap,l=a.exports,f={};let d;for(d in l)f[d]=a.mangleMap[d]??d;const p={lc:Kr,lang:xi,mangles:a.mangleMap,postProcess(g){if(g instanceof Fe&&(g=g.value),g instanceof an&&(g=g.value),g===I&&(g=null),g===Le)throw new h(null,c.IllegalResult,null);if(g===Ot)throw new h(null,c.IllegalResult,null);if(Y(g))throw new h(null,c.IllegalResult,null);return g},prepare(g,y){let b=g.spatialReference;b==null&&(b=Pt.WebMercator);const x=wi(g.vars,g.customfunctions,y,g.timeZone);return{localStack:[],isAsync:y,moduleFactory:i,moduleFactoryMap:u,mangleMap:this.mangles,moduleSingletons:{},exports:l,gdefs:{},exportmangle:f,spatialReference:b,globalScope:x,abortSignal:g.abortSignal===void 0||g.abortSignal===null?{aborted:!1}:g.abortSignal,localScope:null,services:g.services,console:g.console??$t,lrucache:g.lrucache,timeZone:g.timeZone??null,interceptor:g.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",o).bind(p)}async function Ko(){return rt([await je(()=>import("./geomasync-uGYsifQH-B8w8CEL3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url)],"async"),!0}class St extends Kn{constructor(t){super(),this.moduleContext=t}hasGlobal(t){return this.moduleContext.exports[t]===void 0&&(t=t.toLowerCase()),this.moduleContext.exports[t]!==void 0}setGlobal(t,n){const r=this.moduleContext.globalScope,a=t.toLowerCase();if(Y(n))throw new h(null,c.AssignModuleFunction,null);r[this.moduleContext.exportmangle[a]]=n}global(t){const n=this.moduleContext.globalScope,r=t.toLowerCase(),a=n[this.moduleContext.exportmangle[r]];if(a===void 0)throw new h(null,c.InvalidIdentifier,null);if(Y(a)&&!(a instanceof ft)){const s=new ft;return s.fn=a,s.parameterEvaluator=xe,s.context=this.moduleContext,n[this.moduleContext.exportmangle[r]]=s,s}return a}}function Xo(e,t,n=!1){const r={isAsync:n,moduleFactory:t.moduleFactory,moduleFactoryMap:{},libraryResolver:new on(null,e.loadedModules),globalScope:yi(t.vars,n?Dt:ee,t.customfunctions),customfunctions:t.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:$t,lrucache:t.lrucache,timeZone:t.timeZone??null,interceptor:t.interceptor,services:t.services,symbols:{symbolCounter:0}};let a=Rt(r,e);a===""&&(a="lc.voidOperation; ");let s="";s=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* () { @@ -179,4 +179,4 @@ return lang.__awaiter(this, void 0, void 0, function* () { return "Hello World " + hello; } `,uri:"mock"};const i=t.replace("mock:","");if(me.mocks[i]!==void 0)return{url:"",scheme:"mock",data:me.mocks[i],uri:t}}throw new Dn(gn.UnrecognizedUri,{uri:t})}async fetchModule(t){const n=me.cachedModules.getFromCache(t.uri);if(n)return n;const r=this.fetchSource(t);me.cachedModules.addToCache(t.uri,r);let a=null;try{a=await r}catch(s){throw me.cachedModules.removeFromCache(t.uri),s}return a}async fetchSource(t){if(t.scheme==="portal"){const n=await ea(t.url,{responseType:"text",query:{}});if(n.data)return en(n.data,[])}if(t.scheme==="mock")return en(t.data??"",[]);throw new Dn(gn.UnsupportedUriProtocol)}static create(t){return new me(t)}static getDefault(){return this._default??(me._default=me._moduleResolverFactory())}static set moduleResolverClass(t){this._moduleResolverFactory=t,this._default=null}}me.mocks={},me.cachedModules=new cs(30),me._default=null,me._moduleResolverFactory=()=>{const e=Wn.getDefault();return new me(e.url)};let hs=class extends Xr{constructor(e,t){super(),this.definition=e,this.context=t}createFunction(e){return(...t)=>{const n={spatialReference:this.context.spatialReference,console:this.context.console,services:this.context.services,timeZone:this.context.timeZone??null,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(n.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,null);return Sn(this.definition,n,t,null)}}call(e,t){return Je(e,t,(n,r,a)=>{const s={spatialReference:e.spatialReference,services:e.services,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,timeZone:e.timeZone??null,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(s.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,t);return Sn(this.definition,s,a,t)})}marshalledCall(e,t,n,r){return r(e,t,(a,s,o)=>{const i={spatialReference:e.spatialReference,globalScope:n.globalScope,services:e.services,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return o=o.map(u=>!Y(u)||u instanceof ft?u:Kt(u,e,r)),Kt(Sn(this.definition,i,o,t),n,r)})}},gt=class extends Kn{constructor(e){super(),this.source=e}global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=M(this.executingContext,t.node),t.valueset=!0),Y(t.value)&&!(t.value instanceof ft)){const n=new ft;n.fn=t.value,n.parameterEvaluator=Je,n.context=this.executingContext,t.value=n}return t.value}setGlobal(e,t){if(Y(t))throw new h(null,c.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}loadModule(e){let t=e.spatialReference;t==null&&(t=new Pt({wkid:102100})),this.moduleScope=Bi({},e.customfunctions,e.timeZone),this.executingContext={spatialReference:t,globalScope:this.moduleScope,localScope:null,libraryResolver:new on(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},services:e.services,console:e.console??_i,timeZone:e.timeZone??null,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},er(this.executingContext,this.source.syntax)}};function ds(e,t){const n=[];for(let r=0;r=a.length)throw new h(e,c.OutOfBounds,t);n=m(a[s]),a[s]=t.operator==="++"?n+1:n-1}else if(a instanceof v){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)!==!0)throw new h(e,c.FieldNotFound,t);n=m(a.field(s)),a.setField(s,t.operator==="++"?n+1:n-1)}else if(K(a)){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)!==!0)throw new h(e,c.FieldNotFound,t);n=m(a.field(s)),a.setField(s,t.operator==="++"?n+1:n-1)}else{if(P(a))throw new h(e,c.Immutable,t);if(!(a instanceof gt))throw new h(e,c.InvalidParameter,t);if(S(s)===!1)throw new h(e,c.ModuleAccessorMustBeString,t);if(a.hasGlobal(s)!==!0)throw new h(e,c.ModuleExportNotFound,t);n=m(a.global(s)),a.setGlobal(s,t.operator==="++"?n+1:n-1)}return t.prefix===!1?n:t.operator==="++"?n+1:n-1}const r=$(t.argument);if(e.localScope!=null&&e.localScope[r]!==void 0)return n=m(e.localScope[r].value),e.localScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;if(e.globalScope[r]!==void 0)return n=m(e.globalScope[r].value),e.globalScope[r]={value:t.operator==="++"?n+1:n-1,valueset:!0,node:t},t.prefix===!1?n:t.operator==="++"?n+1:n-1;throw new h(e,c.InvalidIdentifier,t)}function Ge(e,t,n,r,a){switch(t){case"=":return e===I?null:e;case"/=":return m(n)/m(e);case"*=":return m(n)*m(e);case"-=":return m(n)-m(e);case"+=":return S(n)||S(e)?E(n)+E(e):m(n)+m(e);case"%=":return m(n)%m(e);default:throw new h(a,c.UnsupportedOperator,r)}}function ws(e,t){if(t.left.type==="MemberExpression"){const a=M(e,t.left.object);let s;if(t.left.computed===!0)s=M(e,t.left.property);else{if(t.left.property.type!=="Identifier")throw new h(e,c.InvalidIdentifier,t);s=t.left.property.name}const o=M(e,t.right);if(_(a)){if(!W(s))throw new h(e,c.ArrayAccessorMustBeNumber,t);if(s<0&&(s=a.length+s),s<0||s>a.length)throw new h(e,c.OutOfBounds,t);if(s===a.length){if(t.operator!=="=")throw new h(e,c.OutOfBounds,t);a[s]=Ge(o,t.operator,a[s],t,e)}else a[s]=Ge(o,t.operator,a[s],t,e)}else if(a instanceof v){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)===!0)a.setField(s,Ge(o,t.operator,a.field(s),t,e));else{if(t.operator!=="=")throw new h(e,c.FieldNotFound,t,{key:s});a.setField(s,Ge(o,t.operator,null,t,e))}}else if(K(a)){if(S(s)===!1)throw new h(e,c.KeyAccessorMustBeString,t);if(a.hasField(s)===!0)a.setField(s,Ge(o,t.operator,a.field(s),t,e));else{if(t.operator!=="=")throw new h(e,c.FieldNotFound,t,{key:s});a.setField(s,Ge(o,t.operator,null,t,e))}}else{if(P(a))throw new h(e,c.Immutable,t);if(!(a instanceof gt))throw new h(e,c.InvalidIdentifier,t);if(S(s)===!1)throw new h(e,c.ModuleAccessorMustBeString,t);if(a.hasGlobal(s)!==!0)throw new h(e,c.ModuleExportNotFound,t);a.setGlobal(s,Ge(o,t.operator,a.global(s),t,e))}return I}const n=$(t.left),r=M(e,t.right);if(e.localScope!=null&&e.localScope[n]!==void 0)return e.localScope[n]={value:Ge(r,t.operator,e.localScope[n].value,t,e),valueset:!0,node:t.right},I;if(e.globalScope[n]!==void 0)return e.globalScope[n]={value:Ge(r,t.operator,e.globalScope[n].value,t,e),valueset:!0,node:t.right},I;throw new h(e,c.InvalidIdentifier,t)}function xs(e,t){const n=M(e,t.expression);return n===I?I:new an(n)}function Fs(e,t){const n=M(e,t.test);if(n===!0)return ke(e,t.consequent);if(n===!1)return t.alternate!==null?ke(e,t.alternate):I;throw new h(e,c.BooleanConditionRequired,t)}function er(e,t){let n=I;for(let r=0;r=n.length||r<0)throw new h(e,c.OutOfBounds,t);return n[r]}throw new h(e,c.InvalidMemberAccessKey,t)}if(S(n)){if(W(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length+r),r>=n.length||r<0)throw new h(e,c.OutOfBounds,t);return n[r]}throw new h(e,c.InvalidMemberAccessKey,t)}if(P(n)){if(W(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length()+r),r>=n.length()||r<0)throw new h(e,c.OutOfBounds,t);return n.get(r)}throw new h(e,c.InvalidMemberAccessKey,t)}throw new h(e,c.InvalidMemberAccessKey,t)}catch(n){throw n}}function Is(e,t){try{const n=M(e,t.argument);if(X(n)){if(t.operator==="!")return!n;if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);if(t.operator==="~")return~m(n);throw new h(e,c.UnsupportedUnaryOperator,t)}if(t.operator==="~")return~m(n);if(t.operator==="-")return-1*m(n);if(t.operator==="+")return 1*m(n);throw new h(e,c.UnsupportedUnaryOperator,t)}catch(n){throw n}}function ks(e,t){try{const n=[];for(let r=0;r>":case">>>":case"^":case"&":return qr(m(n),m(r),t.operator);case"==":return Pe(n,r);case"!=":return!Pe(n,r);case"<":case">":case"<=":case">=":return Wr(n,r,t.operator);case"+":return S(n)||S(r)?E(n)+E(r):m(n)+m(r);case"-":return m(n)-m(r);case"*":return m(n)*m(r);case"/":return m(n)/m(r);case"%":return m(n)%m(r);default:throw new h(e,c.UnsupportedOperator,t)}}catch(n){throw n}}function _s(e,t){try{const n=M(e,t.left);if(X(n))switch(t.operator){case"||":{if(n===!0)return n;const r=M(e,t.right);if(X(r))return r;throw new h(e,c.LogicExpressionOrAnd,t)}case"&&":{if(n===!1)return n;const r=M(e,t.right);if(X(r))return r;throw new h(e,c.LogicExpressionOrAnd,t)}default:throw new h(e,c.LogicExpressionOrAnd,t)}throw new h(e,c.LogicalExpressionOnlyBoolean,t)}catch(n){throw n}}function Ts(e,t,n){if(Y(e))throw new h(t,c.NoFunctionInTemplateLiteral,n);return e}function Ms(e,t){let n="",r=0;for(const a of t.quasis)n+=a.value?a.value.cooked:"",a.tail===!1&&(n+=t.expressions[r]?E(Ts(M(e,t.expressions[r]),e,t)):"",r++);return n}function Si(e,t){try{const n=$(t);if(e.localScope!=null&&e.localScope[n]!==void 0){const r=e.localScope[n];return r.valueset===!0||(r.value=M(e,r.node),r.valueset=!0),r.value}if(e.globalScope[n]!==void 0){const r=e.globalScope[n];return r.valueset===!0||(r.value=M(e,r.node),r.valueset=!0),r.value}throw new h(e,c.InvalidIdentifier,t)}catch(n){throw n}}function Ns(e,t){try{if(t.callee.type==="MemberExpression"){const r=M(e,t.callee.object);if(!(r instanceof gt))throw new h(e,c.FunctionNotFound,t);const a=t.callee.computed===!1?t.callee.property.name:M(e,t.callee.property);if(!r.hasGlobal(a))throw new h(e,c.FunctionNotFound,t);const s=r.global(a);if(!Y(s))throw new h(e,c.CallNonFunction,t);return s.call(e,t)}if(t.callee.type!=="Identifier")throw new h(e,c.FunctionNotFound,t);const n=$(t.callee);if(e.localScope!=null&&e.localScope[n]!==void 0){const r=e.localScope[n];if(Y(r.value))return r.value.call(e,t);throw new h(e,c.CallNonFunction,t)}if(e.globalScope[n]!==void 0){const r=e.globalScope[n];if(Y(r.value))return r.value.call(e,t);throw new h(e,c.CallNonFunction,t)}throw new h(e,c.FunctionNotFound,t)}catch(n){throw n}}const ue={};function Ii(e,t,n,r){try{const a=t.arguments,s=M(e,a[n]);if(Pe(s,r))return M(e,a[n+1]);{const o=a.length-n;return o===1?M(e,a[n]):o===2?null:o===3?M(e,a[n+2]):Ii(e,t,n+2,r)}}catch(a){throw a}}function ki(e,t,n,r){try{const a=t.arguments;if(r===!0)return M(e,a[n+1]);if(a.length-n===3)return M(e,a[n+2]);{const s=M(e,a[n+2]);if(X(s)===!1)throw new h(e,c.BooleanConditionRequired,a[n+2]);return ki(e,t,n+2,s)}}catch(a){throw a}}function Sn(e,t,n,r){try{const a=e.body;if(n.length!==e.params.length)throw new h(t,c.WrongNumberOfParameters,r);if(t.localScope!=null)for(let o=0;oimport("./geometryEngine-CdPoFSE4-zj0NdzY3.js"),__vite__mapDeps([23,2,3,4,5,24,25,26]),import.meta.url);return Ni=!0,Ha(e),!0}let kn=null;function ir(){return kn!==null||(kn=Oi()),kn}async function Oi(){await Ko(),Be=await je(()=>import("./arcadeAsyncRuntime-B-LnqhTo-DU6gqwwh.js"),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,0,15,16,17,18,19,20,21,22]),import.meta.url);for(const e of Jn)Be.extend(e),rt(e,"async");return Jn=null,!0}function Ui(){return Mi}function zi(){return!!Be}function Gi(){return Ni}let Bn=null;function ar(){return Bn||(Bn=Zi(),Bn)}async function Zi(){await ir();const[e,t,n,r,a,s]=await Promise.all([je(()=>import("./featureSetUtils-wd4FcF3A-33TmIeRJ.js"),__vite__mapDeps([28,2,3,4,5,1,6,7,8,9,10,11,12,13,14,29,30,16,17,21,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,22,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,18,19,20]),import.meta.url).then(o=>o.g),je(()=>import("./featuresetbase-BDDCCC0O-CfxSVZfS.js"),__vite__mapDeps([105,6,2,3,4,5,7,1,8,9,10,11,12,13,14,28,29,30,16,17,21,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,22,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,18,19,20,15]),import.meta.url),je(()=>import("./featuresetgeom-BftbGgg3-DE0snMCi.js"),__vite__mapDeps([106,1,2,3,4,5,6,7,8,9,10,11,12,13,14,29,30,16,17,21,18,19,20,22]),import.meta.url),je(()=>import("./featuresetstats-CY6YJ8Jt-BoMAU3Jh.js"),__vite__mapDeps([107,6,2,3,4,5,7,1,8,9,10,11,12,13,14,30,18,19,20,21,22]),import.meta.url),je(()=>import("./featuresetstring-DFELZWNA-CM9MGIid.js"),__vite__mapDeps([108,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18,19,20,21,22]),import.meta.url),je(()=>import("./knowledgegraph-Dt7zfNlJ-BeekZJr0.js"),__vite__mapDeps([109,3,4,2,5,1,6,7,8,9,10,11,12,13,14,15,68,69,91,110,111,112,113,18,19,20,21,22]),import.meta.url)]);return qi=e,Be.extend([t,n,r,a,s]),rt([t,n,r,a,s],"async"),Mi=!0,!0}function ji(e,t=[]){return e.usesFeatureSet===void 0&&Ut(e,t),e.usesFeatureSet===!0}function Gs(e,t=[]){return e.isAsync===void 0&&Ut(e,t),e.isAsync===!0}function Zs(e,t){if(t){for(const n of t)if(cn(e,n))return!0;return!1}return!1}async function Vi(e,t,n=[],r=!1,a=null){return or(new Set,e,t,n,r,a)}async function or(e,t,n,r=[],a=!1,s=null){const o=typeof t=="string"?tr(t):t,i=[];return o&&(Gi()===!1&&(hn(o)||a)&&i.push(rr()),zi()===!1&&(o.isAsync===!0||n)&&i.push(ir()),Ui()===!1&&(ji(o)||Zs(o,r))&&i.push(ar())),i.length&&await Promise.all(i),await Ji(e,o,s,n,a),!0}function js(e,t=[]){return e.usesModules===void 0&&Ut(e,t),e.usesModules===!0}async function Ji(e,t,n=null,r=!1,a=!1){const s=$r(t);n===null&&s.length>0&&(n=me.getDefault()),t.loadedModules={};for(const o of s){jr(n);const i=n.normalizeModuleUri(o.source);if(e.has(i.uri))throw new h(null,c.CircularModules,null);e.add(i.uri);const u=await n.fetchModule(i);await or(e,u,r,[],a,n),e.delete(i.uri),u.isAsync&&(t.isAsync=!0),u.usesFeatureSet&&(t.usesFeatureSet=!0),u.usesGeometry&&(t.usesGeometry=!0),t.loadedModules[o.libname]={uri:i.uri,script:u}}}function Wi(e){if(hn(e))return!0;const t=Nn(e);let n=!1;for(let r=0;r{Ur.test(o)&&(o=o.replace(Ur,""),a.push(o))});const s=a.filter(o=>o.includes("*"));return a=a.filter(o=>!s.includes(o)),t&&s.forEach(o=>{const i=new RegExp(`^${o.split(/\*+/).map(Ws).join(".*")}$`,"i");t.forEach(u=>i.test(u)?a.push(u):null)}),[...new Set(a.sort())]}function nu(e){return cn(e,"$view")}function ru(e,t){return!!e&&cn(e,t)}function iu(e){if(!(!e||e.spatialReference==null&&(e.scale==null||e.viewingMode==null)))return{view:e.viewingMode&&e.scale!=null?new v({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function au({url:e,spatialReference:t,lrucache:n,interceptor:r}){const a=dn();return a?a.createFeatureSetCollectionFromService(e,t,n,r):null}function ou({layer:e,spatialReference:t,outFields:n,returnGeometry:r,lrucache:a,interceptor:s}){if(e===null)return null;const o=dn();return o?o.constructFeatureSet(e,t,n,r??!0,a,s):null}function su(e){if(e?.map===null)return null;const t=dn();return t?t.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function uu(e,t){return v.convertJsonToArcade(e,t)}function lu(e,t,n=[]){return Vi(e,t,n)}function cu(){return rr()}function hu(){return ar()}function du(e){return e.type==="simple"||e.type==="class-breaks"||e.type==="unique-value"||e.type==="dot-density"||e.type==="dictionary"||e.type==="pie-chart"}function fu(e){return e.declaredClass==="esri.layers.support.LabelClass"}function mu(e){return e.declaredClass==="esri.PopupTemplate"}function Hi(e,t){if(!e)return!1;if(typeof e=="string")return t(e);const n=e;if(du(n)){if(n.type==="dot-density"){const s=n.attributes?.some(o=>t(o.valueExpression));if(s)return s}const r=n.visualVariables,a=!!r&&r.some(s=>{let o=t(s.valueExpression);return s.type==="size"&&(zr(s.minSize)&&(o=o||t(s.minSize.valueExpression)),zr(s.maxSize)&&(o=o||t(s.maxSize.valueExpression))),o});return!(!("valueExpression"in n)||!t(n.valueExpression))||a}if(fu(n)){const r=n.labelExpressionInfo?.expression;return!(!r||!t(r))||!1}return!!mu(n)&&(!!n.expressionInfos&&n.expressionInfos.some(r=>t(r.expression))||Array.isArray(n.content)&&n.content.some(r=>r.type==="expression"&&t(r.expressionInfo?.expression)))}function pu(e){const t=zt(e);return!!t&&Wi(t)}function Du(e){return Hi(e,pu)}function gu(e){const t=zt(e);return!!t&&hn(t)}function yu(e){return Hi(e,gu)}function zr(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const Lu=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:v,arcade:Vs,arcadeFeature:H,convertFeatureLayerToFeatureSet:ou,convertJsonToArcade:uu,convertMapToFeatureSetCollection:su,convertServiceUrlToWorkspace:au,createExecContext:Ks,createFeature:Xs,createFunction:Hs,createSyntaxTree:zt,dependsOnView:nu,enableFeatureSetOperations:hu,enableGeometryOperations:cu,evalSyntaxTree:Ys,executeAsyncFunction:eu,executeFunction:$s,extractFieldNames:tu,getArcadeType:qs,getViewInfo:iu,hasGeometryFunctions:Du,hasGeometryOperations:yu,hasVariable:ru,loadScriptDependencies:lu,updateExecContext:Qs},Symbol.toStringTag,{value:"Module"}));export{ei as C,H as D,ai as L,ci as M,v as N,Di as X,ja as Z,on as a,mt as b,Ia as c,Za as d,$ as e,di as f,wt as g,Qa as h,Lu as i,yn as l,Xn as m,Rn as p,De as r,Mn as s,Pn as t,qa as x,Sa as y}; +`,tab:" ",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});a.immutable=!1,r.textformatting={value:a,valueset:!0,node:null};for(const s in t)r[s]={value:new nt(t[s]),native:!0,valueset:!0,node:null};for(const s in e)r[s]={value:Hr(e[s])?H.createFromGraphic(e[s],n):e[s],valueset:!0,node:null};return r}Bt.prototype=ue,Bt.prototype.infinity={value:Number.POSITIVE_INFINITY,valueset:!0,node:null},Bt.prototype.pi={value:Math.PI,valueset:!0,node:null};function _i(e){console.log(e)}function Ti(e){const t={mode:"sync",compiled:!1,functions:{},signatures:[],standardFunction:Je,evaluateIdentifier:Si};for(let n=0;nimport("./geometryEngine-CdPoFSE4-ChEr_3ja.js"),__vite__mapDeps([23,2,3,4,5,24,25,26]),import.meta.url);return Ni=!0,Ha(e),!0}let kn=null;function ir(){return kn!==null||(kn=Oi()),kn}async function Oi(){await Ko(),Be=await je(()=>import("./arcadeAsyncRuntime-B-LnqhTo-BP4d9xu9.js"),__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,0,15,16,17,18,19,20,21,22]),import.meta.url);for(const e of Jn)Be.extend(e),rt(e,"async");return Jn=null,!0}function Ui(){return Mi}function zi(){return!!Be}function Gi(){return Ni}let Bn=null;function ar(){return Bn||(Bn=Zi(),Bn)}async function Zi(){await ir();const[e,t,n,r,a,s]=await Promise.all([je(()=>import("./featureSetUtils-wd4FcF3A-Bjqg1VXd.js"),__vite__mapDeps([28,2,3,4,5,1,6,7,8,9,10,11,12,13,14,29,30,16,17,21,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,22,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,18,19,20]),import.meta.url).then(o=>o.g),je(()=>import("./featuresetbase-BDDCCC0O---spEhjc.js"),__vite__mapDeps([105,6,2,3,4,5,7,1,8,9,10,11,12,13,14,28,29,30,16,17,21,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,22,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,18,19,20,15]),import.meta.url),je(()=>import("./featuresetgeom-BftbGgg3-BLGpCbU5.js"),__vite__mapDeps([106,1,2,3,4,5,6,7,8,9,10,11,12,13,14,29,30,16,17,21,18,19,20,22]),import.meta.url),je(()=>import("./featuresetstats-CY6YJ8Jt-BEjsGFcp.js"),__vite__mapDeps([107,6,2,3,4,5,7,1,8,9,10,11,12,13,14,30,18,19,20,21,22]),import.meta.url),je(()=>import("./featuresetstring-DFELZWNA-DaxbyWAc.js"),__vite__mapDeps([108,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18,19,20,21,22]),import.meta.url),je(()=>import("./knowledgegraph-Dt7zfNlJ-CqBwig9B.js"),__vite__mapDeps([109,3,4,2,5,1,6,7,8,9,10,11,12,13,14,15,68,69,91,110,111,112,113,18,19,20,21,22]),import.meta.url)]);return qi=e,Be.extend([t,n,r,a,s]),rt([t,n,r,a,s],"async"),Mi=!0,!0}function ji(e,t=[]){return e.usesFeatureSet===void 0&&Ut(e,t),e.usesFeatureSet===!0}function Gs(e,t=[]){return e.isAsync===void 0&&Ut(e,t),e.isAsync===!0}function Zs(e,t){if(t){for(const n of t)if(cn(e,n))return!0;return!1}return!1}async function Vi(e,t,n=[],r=!1,a=null){return or(new Set,e,t,n,r,a)}async function or(e,t,n,r=[],a=!1,s=null){const o=typeof t=="string"?tr(t):t,i=[];return o&&(Gi()===!1&&(hn(o)||a)&&i.push(rr()),zi()===!1&&(o.isAsync===!0||n)&&i.push(ir()),Ui()===!1&&(ji(o)||Zs(o,r))&&i.push(ar())),i.length&&await Promise.all(i),await Ji(e,o,s,n,a),!0}function js(e,t=[]){return e.usesModules===void 0&&Ut(e,t),e.usesModules===!0}async function Ji(e,t,n=null,r=!1,a=!1){const s=$r(t);n===null&&s.length>0&&(n=me.getDefault()),t.loadedModules={};for(const o of s){jr(n);const i=n.normalizeModuleUri(o.source);if(e.has(i.uri))throw new h(null,c.CircularModules,null);e.add(i.uri);const u=await n.fetchModule(i);await or(e,u,r,[],a,n),e.delete(i.uri),u.isAsync&&(t.isAsync=!0),u.usesFeatureSet&&(t.usesFeatureSet=!0),u.usesGeometry&&(t.usesGeometry=!0),t.loadedModules[o.libname]={uri:i.uri,script:u}}}function Wi(e){if(hn(e))return!0;const t=Nn(e);let n=!1;for(let r=0;r{Ur.test(o)&&(o=o.replace(Ur,""),a.push(o))});const s=a.filter(o=>o.includes("*"));return a=a.filter(o=>!s.includes(o)),t&&s.forEach(o=>{const i=new RegExp(`^${o.split(/\*+/).map(Ws).join(".*")}$`,"i");t.forEach(u=>i.test(u)?a.push(u):null)}),[...new Set(a.sort())]}function nu(e){return cn(e,"$view")}function ru(e,t){return!!e&&cn(e,t)}function iu(e){if(!(!e||e.spatialReference==null&&(e.scale==null||e.viewingMode==null)))return{view:e.viewingMode&&e.scale!=null?new v({viewingMode:e.viewingMode,scale:e.scale}):null,sr:e.spatialReference}}function au({url:e,spatialReference:t,lrucache:n,interceptor:r}){const a=dn();return a?a.createFeatureSetCollectionFromService(e,t,n,r):null}function ou({layer:e,spatialReference:t,outFields:n,returnGeometry:r,lrucache:a,interceptor:s}){if(e===null)return null;const o=dn();return o?o.constructFeatureSet(e,t,n,r??!0,a,s):null}function su(e){if(e?.map===null)return null;const t=dn();return t?t.createFeatureSetCollectionFromMap(e.map,e.spatialReference,e.lrucache,e.interceptor):null}function uu(e,t){return v.convertJsonToArcade(e,t)}function lu(e,t,n=[]){return Vi(e,t,n)}function cu(){return rr()}function hu(){return ar()}function du(e){return e.type==="simple"||e.type==="class-breaks"||e.type==="unique-value"||e.type==="dot-density"||e.type==="dictionary"||e.type==="pie-chart"}function fu(e){return e.declaredClass==="esri.layers.support.LabelClass"}function mu(e){return e.declaredClass==="esri.PopupTemplate"}function Hi(e,t){if(!e)return!1;if(typeof e=="string")return t(e);const n=e;if(du(n)){if(n.type==="dot-density"){const s=n.attributes?.some(o=>t(o.valueExpression));if(s)return s}const r=n.visualVariables,a=!!r&&r.some(s=>{let o=t(s.valueExpression);return s.type==="size"&&(zr(s.minSize)&&(o=o||t(s.minSize.valueExpression)),zr(s.maxSize)&&(o=o||t(s.maxSize.valueExpression))),o});return!(!("valueExpression"in n)||!t(n.valueExpression))||a}if(fu(n)){const r=n.labelExpressionInfo?.expression;return!(!r||!t(r))||!1}return!!mu(n)&&(!!n.expressionInfos&&n.expressionInfos.some(r=>t(r.expression))||Array.isArray(n.content)&&n.content.some(r=>r.type==="expression"&&t(r.expressionInfo?.expression)))}function pu(e){const t=zt(e);return!!t&&Wi(t)}function Du(e){return Hi(e,pu)}function gu(e){const t=zt(e);return!!t&&hn(t)}function yu(e){return Hi(e,gu)}function zr(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}const Lu=Object.freeze(Object.defineProperty({__proto__:null,Dictionary:v,arcade:Vs,arcadeFeature:H,convertFeatureLayerToFeatureSet:ou,convertJsonToArcade:uu,convertMapToFeatureSetCollection:su,convertServiceUrlToWorkspace:au,createExecContext:Ks,createFeature:Xs,createFunction:Hs,createSyntaxTree:zt,dependsOnView:nu,enableFeatureSetOperations:hu,enableGeometryOperations:cu,evalSyntaxTree:Ys,executeAsyncFunction:eu,executeFunction:$s,extractFieldNames:tu,getArcadeType:qs,getViewInfo:iu,hasGeometryFunctions:Du,hasGeometryOperations:yu,hasVariable:ru,loadScriptDependencies:lu,updateExecContext:Qs},Symbol.toStringTag,{value:"Module"}));export{ei as C,H as D,ai as L,ci as M,v as N,Di as X,ja as Z,on as a,mt as b,Ia as c,Za as d,$ as e,di as f,wt as g,Qa as h,Lu as i,yn as l,Xn as m,Rn as p,De as r,Mn as s,Pn as t,qa as x,Sa as y}; diff --git a/custom-toc-highlight/assets/arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js b/custom-toc-highlight/assets/arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js similarity index 94% rename from custom-toc-highlight/assets/arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js rename to custom-toc-highlight/assets/arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js index 605cd408..2a515d50 100644 --- a/custom-toc-highlight/assets/arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js +++ b/custom-toc-highlight/assets/arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js @@ -1 +1 @@ -import{a,d3 as m,d4 as o,d5 as c,cS as S,bX as y}from"./story-BfX8CRfG.js";const v={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",knowledgegraphserver:"KnowledgeGraphServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer",videoserver:"VideoServer"},d=Object.values(v),p=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),w=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^/\\n]+)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),g=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function I(r){return p.test(r)}function f(r){if(r==null)return null;const e=a(r),t=e?.path.match(p)||e?.path.match(w);if(!t)return null;const[,s,n,l,u]=t,i=n.indexOf("/");return{title:h(i!==-1?n.slice(i+1):n),serverType:v[l.toLowerCase()],sublayer:u!=null&&u!==""?parseInt(u,10):null,url:{path:s}}}function b(r){const e=a(r).path.match(g);return e?{serviceUrl:e[1],sublayerId:Number(e[2])}:null}function h(r){return(r=r.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+r.slice(1)}function L(r,e){const t=[];if(r){const s=f(r);s!=null&&s.title&&t.push(s.title)}if(e){const s=h(e);t.push(s)}if(t.length===2){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}function j(r){let e=m(r,!0);return!!e&&(e=e.toLowerCase(),e.endsWith(".arcgis.com")&&(e.startsWith("services")||e.startsWith("tiles")||e.startsWith("features")))}function x(r,e){return r&&o(c(r,e))}function U(r){let{url:e}=r;if(!e)return{url:e};e=c(e,r.logger);const t=a(e),s=f(t.path);let n;if(s!=null)s.sublayer!=null&&r.layer.layerId==null&&(n=s.sublayer),e=s.url.path;else if(r.nonStandardUrlAllowed){const l=b(t.path);l!=null&&(e=l.serviceUrl,n=l.sublayerId)}return{url:o(e),layerId:n}}function T(r,e,t,s,n){S(e,s,"url",n),s.url&&r.layerId!=null&&(s.url=y(s.url,t,r.layerId.toString()))}function W(r){if(!r)return!1;const e=r.toLowerCase(),t=e.includes("/services/"),s=e.includes("/mapserver/wmsserver"),n=e.includes("/imageserver/wmsserver"),l=e.includes("/wmsserver");return t&&(s||n||l)}export{L as I,j as L,T,W as U,I as b,f as i,x as j,b as m,h as o,U as x}; +import{a,d3 as m,d4 as o,d5 as c,cS as S,bX as y}from"./story-Doly9N9p.js";const v={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",knowledgegraphserver:"KnowledgeGraphServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer","3dtilesserver":"3DTilesServer",videoserver:"VideoServer"},d=Object.values(v),p=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),w=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^/\\n]+)\\/(${d.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),g=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function I(r){return p.test(r)}function f(r){if(r==null)return null;const e=a(r),t=e?.path.match(p)||e?.path.match(w);if(!t)return null;const[,s,n,l,u]=t,i=n.indexOf("/");return{title:h(i!==-1?n.slice(i+1):n),serverType:v[l.toLowerCase()],sublayer:u!=null&&u!==""?parseInt(u,10):null,url:{path:s}}}function b(r){const e=a(r).path.match(g);return e?{serviceUrl:e[1],sublayerId:Number(e[2])}:null}function h(r){return(r=r.replaceAll(/\s*[/_]+\s*/g," "))[0].toUpperCase()+r.slice(1)}function L(r,e){const t=[];if(r){const s=f(r);s!=null&&s.title&&t.push(s.title)}if(e){const s=h(e);t.push(s)}if(t.length===2){if(t[0].toLowerCase().includes(t[1].toLowerCase()))return t[0];if(t[1].toLowerCase().includes(t[0].toLowerCase()))return t[1]}return t.join(" - ")}function j(r){let e=m(r,!0);return!!e&&(e=e.toLowerCase(),e.endsWith(".arcgis.com")&&(e.startsWith("services")||e.startsWith("tiles")||e.startsWith("features")))}function x(r,e){return r&&o(c(r,e))}function U(r){let{url:e}=r;if(!e)return{url:e};e=c(e,r.logger);const t=a(e),s=f(t.path);let n;if(s!=null)s.sublayer!=null&&r.layer.layerId==null&&(n=s.sublayer),e=s.url.path;else if(r.nonStandardUrlAllowed){const l=b(t.path);l!=null&&(e=l.serviceUrl,n=l.sublayerId)}return{url:o(e),layerId:n}}function T(r,e,t,s,n){S(e,s,"url",n),s.url&&r.layerId!=null&&(s.url=y(s.url,t,r.layerId.toString()))}function W(r){if(!r)return!1;const e=r.toLowerCase(),t=e.includes("/services/"),s=e.includes("/mapserver/wmsserver"),n=e.includes("/imageserver/wmsserver"),l=e.includes("/wmsserver");return t&&(s||n||l)}export{L as I,j as L,T,W as U,I as b,f as i,x as j,b as m,h as o,U as x}; diff --git a/custom-toc-highlight/assets/arcgisLayers-CL8_MH7S-D1YV7ss3.js b/custom-toc-highlight/assets/arcgisLayers-CL8_MH7S-u1jA7AmV.js similarity index 76% rename from custom-toc-highlight/assets/arcgisLayers-CL8_MH7S-D1YV7ss3.js rename to custom-toc-highlight/assets/arcgisLayers-CL8_MH7S-u1jA7AmV.js index 0cd18745..fe455923 100644 --- a/custom-toc-highlight/assets/arcgisLayers-CL8_MH7S-D1YV7ss3.js +++ b/custom-toc-highlight/assets/arcgisLayers-CL8_MH7S-u1jA7AmV.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GroupLayer-ER-XzoYr-LPsQSYf2.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-BfX8CRfG.js","./story-D5JOvNzl.css","./CollectionFlattener-DkHuHn5E-BKutaakg.js","./loadAll-e978YItg-CdtGGDtb.js","./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js","./Layer-ChoECxvZ-CQTFmFQa.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./BlendLayer-D1WkSmwP-Bad8_eoW.js","./jsonUtils-wIllKWI4-DrGIvCCq.js","./parser-DyDJ-rlI-C9jRH52J.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-DVqdGrVU.js","./common-CYWrYyJl-E8-sukrT.js","./OperationalLayer-B5IXiMa2-9OHGXI1g.js","./commonProperties-BtIqvFU_-DVH0kGN9.js","./ElevationInfo-yv2-9tj6-C2hC6Vpl.js","./lengthUtils-DKpMe5qR-C2NPRwwl.js","./PortalLayer-CElnYuSQ-DvpreqYV.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js","./fetchService-DbaKmJhP-W7rGyykJ.js","./TablesMixin-C8RojhYs-AdFcW_TR.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./saveUtils-CIYk-dsQ-VGcOewby.js","./writeUtils-D5qlLkwk-xd5TEmf9.js"])))=>i.map(i=>d[i]); -import{_ as I}from"./main-ugzBrWNm.js";import{o as m,gK as g,a as P,gG as v}from"./story-BfX8CRfG.js";import{i as L,m as O}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{b as T}from"./associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js";import{o as p,g as d,d as C,p as U}from"./fetchService-DbaKmJhP-W7rGyykJ.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";const F={FeatureLayer:!0,SceneLayer:!0};async function A(r){const{properties:l,url:e}=r,t={...l,url:e},s=await N(e,l?.customParameters),{Constructor:a,layerId:o,sourceJSON:c,parsedUrl:i,layers:u,tables:n}=s;if(u.length+n.length===0)return o!=null&&(t.layerId=o),c!=null&&(t.sourceJSON=c),new a(t);const y=new(await I(async()=>{const{default:f}=await import("./GroupLayer-ER-XzoYr-LPsQSYf2.js");return{default:f}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url)).default({title:i.title});return await _(y,s,t),y}function S(r,l){return r?r.find(({id:e})=>e===l):null}function b(r,l,e,t,s){const a={...s,layerId:l};return r!=null&&(a.url=r),e!=null&&(a.sourceJSON=e),"sublayerTitleMode"in t.prototype&&(a.sublayerTitleMode="service-name"),new t(a)}async function _(r,l,e){const t=l.sublayerConstructorProvider;for(const{id:s,serverUrl:a}of l.layers){const o=S(l.sublayerInfos,s),c=b(a,s,o,(o&&t?.(o))??l.Constructor,e);r.add(c)}if(l.tables.length){const s=await w("FeatureLayer");l.tables.forEach(({id:a,serverUrl:o})=>{const c=b(o,a,S(l.tableInfos,a),s,e);r.tables.add(c)})}}async function N(r,l){let e=L(r);if(e==null&&(e=await V(r,l)),e==null)throw new m("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:t,sublayer:s}=e;let a;const o={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},c=t==="FeatureServer",i=t==="SceneServer",u={parsedUrl:e,Constructor:null,layerId:c||i?s??void 0:void 0,layers:[],tables:[]};switch(t){case"MapServer":if(s!=null){const{type:n}=await p(r,{customParameters:l});switch(a="FeatureLayer",n){case"Catalog Layer":a="CatalogLayer";break;case"Catalog Dynamic Group Layer":throw new m("arcgis-layers:unsupported",`fromUrl() not supported for "${n}" layers`)}}else a=await x(r,l)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const n=await p(r,{customParameters:l}),{tileInfo:y,cacheType:f}=n;a=y?y?.format?.toUpperCase()!=="LERC"||f&&f.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const n=await p(e.url.path,{customParameters:l});if(a="SceneLayer",n){const y=n?.layers;if(n?.layerType==="Voxel")a="VoxelLayer";else if(y?.length){const f=y[0]?.layerType;f!=null&&v[f]!=null&&(a=v[f])}}break}case"3DTilesServer":throw new m("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(a="FeatureLayer",s!=null){const n=await p(r,{customParameters:l});u.sourceJSON=n,a=d(n.type)}break;default:a=o[t]}if(F[a]&&s==null){const n=await k(r,t,l);if(c&&(u.sublayerInfos=n.layerInfos,u.tableInfos=n.tableInfos),n.layers.length+n.tables.length!==1)u.layers=n.layers,u.tables=n.tables,c&&n.layerInfos?.length&&(u.sublayerConstructorProvider=await E(n.layerInfos));else if(c||i){const y=n.layerInfos?.[0]??n.tableInfos?.[0];if(u.layerId=n.layers[0]?.id??n.tables[0]?.id,u.sourceJSON=y,c){const f=y?.type;a=d(f)}}}return u.Constructor=await w(a),u}async function V(r,l){const e=await p(r,{customParameters:l});let t=null,s=null;const a=e.type;if(a==="Feature Layer"||a==="Table"?(t="FeatureServer",s=e.id??null):a==="indexedVector"?t="VectorTileServer":e.hasOwnProperty("mapName")?t="MapServer":e.hasOwnProperty("bandCount")&&e.hasOwnProperty("pixelSizeX")?t="ImageServer":e.hasOwnProperty("maxRecordCount")&&e.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":e.hasOwnProperty("streamUrls")?t="StreamServer":h(e)?(t="SceneServer",s=e.id):e.hasOwnProperty("layers")&&h(e.layers?.[0])&&(t="SceneServer"),!t)return null;const o=s!=null?O(r):null;return{title:o!=null&&e.name||g(r),serverType:t,sublayer:s,url:{path:o!=null?o.serviceUrl:P(r).path}}}function h(r){return r!=null&&r.hasOwnProperty("store")&&r.hasOwnProperty("id")&&typeof r.id=="number"}async function k(r,l,e){let t,s,a=!1;switch(l){case"FeatureServer":{const i=await C(r,{customParameters:e});a=!!i.layersJSON,t=i.layersJSON||i.serviceJSON;break}case"SceneServer":{const i=await J(r,e);t=i.serviceInfo,s=i.tableServerUrl;break}default:t=await p(r,{customParameters:e})}const o=t?.layers,c=t?.tables;return{layers:o?.map(i=>({id:i.id})).reverse()||[],tables:c?.map(i=>({serverUrl:s,id:i.id})).reverse()||[],layerInfos:a?o:[],tableInfos:a?c:[]}}async function J(r,l){const e=await p(r,{customParameters:l});if(!e.layers?.[0])return{serviceInfo:e};try{const{serverUrl:t}=await T(r),s=await p(t,{customParameters:l}).catch(()=>null);return s&&(e.tables=s.tables),{serviceInfo:e,tableServerUrl:t}}catch{return{serviceInfo:e}}}async function w(r){return(0,U[r])()}async function x(r,l){return(await p(r,{customParameters:l})).tileInfo}async function E(r){if(!r.length)return;const l=new Set,e=[];for(const{type:a}of r)l.has(a)||(l.add(a),e.push(w(d(a))));const t=await Promise.all(e),s=new Map;return Array.from(l).forEach((a,o)=>{s.set(a,t[o])}),a=>s.get(a.type)}export{A as fromUrl}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GroupLayer-ER-XzoYr-DlHeNdGj.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-Doly9N9p.js","./story-DbFhYdqg.css","./CollectionFlattener-DkHuHn5E-dp3hDI2N.js","./loadAll-e978YItg-4pMG3qU7.js","./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js","./Layer-ChoECxvZ-BmDHBjO8.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./BlendLayer-D1WkSmwP-BeUsb4u9.js","./jsonUtils-wIllKWI4-MQQ-E5fj.js","./parser-DyDJ-rlI-CvOs11Ip.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-6clJxb1Q.js","./common-CYWrYyJl-E8-sukrT.js","./OperationalLayer-B5IXiMa2-DTTV2F9z.js","./commonProperties-BtIqvFU_-DbZji2Rx.js","./ElevationInfo-yv2-9tj6-CkIHeL1t.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js","./PortalLayer-CElnYuSQ-CCe4TMEA.js","./PortalItem-CctGdnxF-CfFOGshS.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js","./fetchService-DbaKmJhP-Ccg-phWf.js","./TablesMixin-C8RojhYs-LCBvmsnP.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./saveUtils-CIYk-dsQ-Br9QCJTX.js","./writeUtils-D5qlLkwk-enZap9KW.js"])))=>i.map(i=>d[i]); +import{_ as I}from"./main-QGPoLsvl.js";import{o as m,gK as g,a as P,gG as v}from"./story-Doly9N9p.js";import{i as L,m as O}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{b as T}from"./associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js";import{o as p,g as d,d as C,p as U}from"./fetchService-DbaKmJhP-Ccg-phWf.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";const F={FeatureLayer:!0,SceneLayer:!0};async function A(r){const{properties:l,url:e}=r,t={...l,url:e},s=await N(e,l?.customParameters),{Constructor:a,layerId:o,sourceJSON:c,parsedUrl:i,layers:u,tables:n}=s;if(u.length+n.length===0)return o!=null&&(t.layerId=o),c!=null&&(t.sourceJSON=c),new a(t);const y=new(await I(async()=>{const{default:f}=await import("./GroupLayer-ER-XzoYr-DlHeNdGj.js");return{default:f}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]),import.meta.url)).default({title:i.title});return await _(y,s,t),y}function S(r,l){return r?r.find(({id:e})=>e===l):null}function b(r,l,e,t,s){const a={...s,layerId:l};return r!=null&&(a.url=r),e!=null&&(a.sourceJSON=e),"sublayerTitleMode"in t.prototype&&(a.sublayerTitleMode="service-name"),new t(a)}async function _(r,l,e){const t=l.sublayerConstructorProvider;for(const{id:s,serverUrl:a}of l.layers){const o=S(l.sublayerInfos,s),c=b(a,s,o,(o&&t?.(o))??l.Constructor,e);r.add(c)}if(l.tables.length){const s=await w("FeatureLayer");l.tables.forEach(({id:a,serverUrl:o})=>{const c=b(o,a,S(l.tableInfos,a),s,e);r.tables.add(c)})}}async function N(r,l){let e=L(r);if(e==null&&(e=await V(r,l)),e==null)throw new m("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:t,sublayer:s}=e;let a;const o={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},c=t==="FeatureServer",i=t==="SceneServer",u={parsedUrl:e,Constructor:null,layerId:c||i?s??void 0:void 0,layers:[],tables:[]};switch(t){case"MapServer":if(s!=null){const{type:n}=await p(r,{customParameters:l});switch(a="FeatureLayer",n){case"Catalog Layer":a="CatalogLayer";break;case"Catalog Dynamic Group Layer":throw new m("arcgis-layers:unsupported",`fromUrl() not supported for "${n}" layers`)}}else a=await x(r,l)?"TileLayer":"MapImageLayer";break;case"ImageServer":{const n=await p(r,{customParameters:l}),{tileInfo:y,cacheType:f}=n;a=y?y?.format?.toUpperCase()!=="LERC"||f&&f.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const n=await p(e.url.path,{customParameters:l});if(a="SceneLayer",n){const y=n?.layers;if(n?.layerType==="Voxel")a="VoxelLayer";else if(y?.length){const f=y[0]?.layerType;f!=null&&v[f]!=null&&(a=v[f])}}break}case"3DTilesServer":throw new m("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(a="FeatureLayer",s!=null){const n=await p(r,{customParameters:l});u.sourceJSON=n,a=d(n.type)}break;default:a=o[t]}if(F[a]&&s==null){const n=await k(r,t,l);if(c&&(u.sublayerInfos=n.layerInfos,u.tableInfos=n.tableInfos),n.layers.length+n.tables.length!==1)u.layers=n.layers,u.tables=n.tables,c&&n.layerInfos?.length&&(u.sublayerConstructorProvider=await E(n.layerInfos));else if(c||i){const y=n.layerInfos?.[0]??n.tableInfos?.[0];if(u.layerId=n.layers[0]?.id??n.tables[0]?.id,u.sourceJSON=y,c){const f=y?.type;a=d(f)}}}return u.Constructor=await w(a),u}async function V(r,l){const e=await p(r,{customParameters:l});let t=null,s=null;const a=e.type;if(a==="Feature Layer"||a==="Table"?(t="FeatureServer",s=e.id??null):a==="indexedVector"?t="VectorTileServer":e.hasOwnProperty("mapName")?t="MapServer":e.hasOwnProperty("bandCount")&&e.hasOwnProperty("pixelSizeX")?t="ImageServer":e.hasOwnProperty("maxRecordCount")&&e.hasOwnProperty("allowGeometryUpdates")?t="FeatureServer":e.hasOwnProperty("streamUrls")?t="StreamServer":h(e)?(t="SceneServer",s=e.id):e.hasOwnProperty("layers")&&h(e.layers?.[0])&&(t="SceneServer"),!t)return null;const o=s!=null?O(r):null;return{title:o!=null&&e.name||g(r),serverType:t,sublayer:s,url:{path:o!=null?o.serviceUrl:P(r).path}}}function h(r){return r!=null&&r.hasOwnProperty("store")&&r.hasOwnProperty("id")&&typeof r.id=="number"}async function k(r,l,e){let t,s,a=!1;switch(l){case"FeatureServer":{const i=await C(r,{customParameters:e});a=!!i.layersJSON,t=i.layersJSON||i.serviceJSON;break}case"SceneServer":{const i=await J(r,e);t=i.serviceInfo,s=i.tableServerUrl;break}default:t=await p(r,{customParameters:e})}const o=t?.layers,c=t?.tables;return{layers:o?.map(i=>({id:i.id})).reverse()||[],tables:c?.map(i=>({serverUrl:s,id:i.id})).reverse()||[],layerInfos:a?o:[],tableInfos:a?c:[]}}async function J(r,l){const e=await p(r,{customParameters:l});if(!e.layers?.[0])return{serviceInfo:e};try{const{serverUrl:t}=await T(r),s=await p(t,{customParameters:l}).catch(()=>null);return s&&(e.tables=s.tables),{serviceInfo:e,tableServerUrl:t}}catch{return{serviceInfo:e}}}async function w(r){return(0,U[r])()}async function x(r,l){return(await p(r,{customParameters:l})).tileInfo}async function E(r){if(!r.length)return;const l=new Set,e=[];for(const{type:a}of r)l.has(a)||(l.add(a),e.push(w(d(a))));const t=await Promise.all(e),s=new Map;return Array.from(l).forEach((a,o)=>{s.set(a,t[o])}),a=>s.get(a.type)}export{A as fromUrl}; diff --git a/custom-toc-highlight/assets/associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js b/custom-toc-highlight/assets/associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js similarity index 92% rename from custom-toc-highlight/assets/associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js rename to custom-toc-highlight/assets/associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js index 88e9107d..c25fbfdc 100644 --- a/custom-toc-highlight/assets/associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js +++ b/custom-toc-highlight/assets/associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js @@ -1 +1 @@ -import{o as c,r as j,W as u,f,V as D}from"./story-BfX8CRfG.js";import{i as v}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import w from"./PortalItem-CctGdnxF-C7IJrZYq.js";async function x(e,n){const t=v(e);if(!t)throw new c("invalid-url","Invalid scene service url");const r={...n,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(r.sceneLayerItem??=await A(r),r.sceneLayerItem==null)return p(r.sceneServerUrl.replace("/SceneServer","/FeatureServer"),r);const a=await K(r);if(!a?.url)throw new c("related-service-not-found","Could not find feature service through portal item relationship");r.featureServiceItem=a;const s=await p(a.url,r);return s.portalItem=a,s}async function A(e){const n=(await h(e)).serviceItemId;if(!n)return null;const t=new w({id:n,apiKey:e.apiKey}),r=await b(e);r!=null&&(t.portal=new j({url:r}));try{return await t.load({signal:e.signal})}catch(a){return u(a),null}}async function h(e){if(e.rootDocument)return e.rootDocument;const n={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await f(e.sceneServerUrl,n);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function b(e){const n=D?.findServerInfo(e.sceneServerUrl);if(n?.owningSystemUrl)return n.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const r=(await f(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(r)return r}catch(r){u(r)}return null}async function p(e,n){const t=v(e);if(!t)throw new c("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,a=n.layerId;if(a==null)return{serverUrl:r};const s=h(n),y=n.featureServiceItem?await n.featureServiceItem.fetchData("json"):null,g=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=o=>{const U={query:{f:"json",...g},responseType:"json",authMode:o,signal:n.signal};return f(r,U)},S=d("anonymous").catch(()=>d("no-prompt")),[m,I]=await Promise.all([S,s]),l=I?.layers,i=m.data&&m.data.layers;if(!Array.isArray(i))throw new Error("expected layers array");if(Array.isArray(l)){for(let o=0;oa.type==="Feature Service")||null;if(!t)return null;const r=new w({portal:t.portal,id:t.id});return await r.load(),r}catch(t){return u(t),null}}export{x as b}; +import{o as c,r as j,W as u,f,V as D}from"./story-Doly9N9p.js";import{i as v}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import w from"./PortalItem-CctGdnxF-CfFOGshS.js";async function x(e,n){const t=v(e);if(!t)throw new c("invalid-url","Invalid scene service url");const r={...n,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(r.sceneLayerItem??=await A(r),r.sceneLayerItem==null)return p(r.sceneServerUrl.replace("/SceneServer","/FeatureServer"),r);const a=await K(r);if(!a?.url)throw new c("related-service-not-found","Could not find feature service through portal item relationship");r.featureServiceItem=a;const s=await p(a.url,r);return s.portalItem=a,s}async function A(e){const n=(await h(e)).serviceItemId;if(!n)return null;const t=new w({id:n,apiKey:e.apiKey}),r=await b(e);r!=null&&(t.portal=new j({url:r}));try{return await t.load({signal:e.signal})}catch(a){return u(a),null}}async function h(e){if(e.rootDocument)return e.rootDocument;const n={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await f(e.sceneServerUrl,n);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function b(e){const n=D?.findServerInfo(e.sceneServerUrl);if(n?.owningSystemUrl)return n.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const r=(await f(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(r)return r}catch(r){u(r)}return null}async function p(e,n){const t=v(e);if(!t)throw new c("invalid-feature-service-url","Invalid feature service url");const r=t.url.path,a=n.layerId;if(a==null)return{serverUrl:r};const s=h(n),y=n.featureServiceItem?await n.featureServiceItem.fetchData("json"):null,g=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=o=>{const U={query:{f:"json",...g},responseType:"json",authMode:o,signal:n.signal};return f(r,U)},S=d("anonymous").catch(()=>d("no-prompt")),[m,I]=await Promise.all([S,s]),l=I?.layers,i=m.data&&m.data.layers;if(!Array.isArray(i))throw new Error("expected layers array");if(Array.isArray(l)){for(let o=0;oa.type==="Feature Service")||null;if(!t)return null;const r=new w({portal:t.portal,id:t.id});return await r.load(),r}catch(t){return u(t),null}}export{x as b}; diff --git a/custom-toc-highlight/assets/boundedPlane-DlvE0eNx-dpkNyaGh.js b/custom-toc-highlight/assets/boundedPlane-DlvE0eNx-BQ9Xop25.js similarity index 93% rename from custom-toc-highlight/assets/boundedPlane-DlvE0eNx-dpkNyaGh.js rename to custom-toc-highlight/assets/boundedPlane-DlvE0eNx-BQ9Xop25.js index 1501db27..95f90616 100644 --- a/custom-toc-highlight/assets/boundedPlane-DlvE0eNx-dpkNyaGh.js +++ b/custom-toc-highlight/assets/boundedPlane-DlvE0eNx-BQ9Xop25.js @@ -1 +1 @@ -import{hZ as w,i8 as E,cf as rt,ha as st,i9 as _,dg as N,a1 as at}from"./story-BfX8CRfG.js";import{X as O,p as ct}from"./sphere-BenPORjV-DaZ5Vv8x.js";import{z as ut,G as gt,K as bt}from"./mat4-DX7gBViE-DVqdGrVU.js";import{t as L}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as u,L as l,j as p,_ as M,g as ft,b as I,W as lt,y as h,r as z,R as A,Y as m,l as D,v as G}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{u as pt,j as H,x as dt}from"./lineSegment-CcqvCARM-CF4YE8GC.js";import{y,a as mt,j as ht,T as F,f as s,H as It,M as $t,S as Nt,m as Mt,g as X,D as Pt,l as P,N as T,h as Tt}from"./plane-Dt8R0KeE-CVSP2GQG.js";const Y=()=>at.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");class xt{constructor(){this.plane=y(),this.origin=N(),this.basis1=N(),this.basis2=N()}}const yt=xt;function $(t=ot){return{plane:y(t.plane),origin:E(t.origin),basis1:E(t.basis1),basis2:E(t.basis2)}}function jt(t,n,i){const e=Dt.get();return e.origin=t,e.basis1=n,e.basis2=i,e.plane=mt(0,0,0,0),S(e),e}function j(t,n=$()){return Z(t.origin,t.basis1,t.basis2,n)}function St(t,n){u(n.origin,t.origin),u(n.basis1,t.basis1),u(n.basis2,t.basis2),ht(n.plane,t.plane)}function Z(t,n,i,e=$()){return u(e.origin,t),u(e.basis1,n),u(e.basis2,i),S(e),Ct(e,"fromValues()"),e}function S(t){F(t.basis2,t.basis1,t.origin,t.plane)}function U(t,n,i){t!==i&&j(t,i);const e=l(s.get(),f(t),n);return p(i.origin,i.origin,e),i.plane[3]-=n,i}function vt(t,n,i){return W(n,i),U(i,B(t,t.origin),i),i}function wt(t,n){const i=t.basis1[0],e=t.basis2[1],[o,r]=t.origin;return rt(o-i,r-e,o+i,r+e,n)}function W(t,n=$()){const i=(t[2]-t[0])/2,e=(t[3]-t[1])/2;return M(n.origin,t[0]+i,t[1]+e,0),M(n.basis1,i,0,0),M(n.basis2,0,e,0),It(0,0,1,0,n.plane),n}function R(t,n,i){return!!$t(t.plane,n,i)&&nt(t,i)}function Et(t,n,i){if(R(t,n,i))return i;const e=Q(t,n,s.get());return p(i,n.origin,l(s.get(),n.direction,ft(n.origin,e)/I(n.direction))),i}function Q(t,n,i){const e=x.get();et(t,n,e,x.get());let o=Number.POSITIVE_INFINITY;for(const r of k){const a=C(t,r,v.get()),g=s.get();if(Nt(e,a,g)){const c=lt(s.get(),n.origin,g),b=Math.abs(st(h(n.direction,c)));bi&&(i=r)}return Math.sqrt(i)}function Vt(t,n){return X(t.plane,n)&&nt(t,n)}function Ft(t,n,i,e){return Bt(t,i,e)}function B(t,n){const i=-t.plane[3];return P(f(t),n)-i}function Ot(t,n,i,e){const o=B(t,n),r=l(kt,f(t),i-o);return p(e,n,r),e}function zt(t,n){return A(t.basis1,n.basis1)&&A(t.basis2,n.basis2)&&A(t.origin,n.origin)}function Rt(t,n,i){return t!==i&&j(t,i),ut(d,n),gt(d,d),m(i.basis1,t.basis1,d),m(i.basis2,t.basis2,d),m(T(i.plane),T(t.plane),d),m(i.origin,t.origin,n),Tt(i.plane,i.plane,i.origin),i}function qt(t,n,i,e){return t!==e&&j(t,e),bt(V,n,i),m(e.basis1,t.basis1,V),m(e.basis2,t.basis2,V),S(e),e}function f(t){return T(t.plane)}function Bt(t,n,i){switch(n){case _.X:u(i,t.basis1),D(i,i);break;case _.Y:u(i,t.basis2),D(i,i);break;case _.Z:u(i,f(t))}return i}function nt(t,n){const i=z(s.get(),n,t.origin),e=G(t.basis1),o=G(t.basis2),r=h(t.basis1,i),a=h(t.basis2,i);return-r-e<0&&r-e<0&&-a-o<0&&a-o<0}function K(t,n){const i=v.get();return u(i.origin,t.origin),u(i.vector,n),i}function C(t,n,i){const{basis1:e,basis2:o,origin:r}=t,a=l(s.get(),e,n.origin[0]),g=l(s.get(),o,n.origin[1]);p(i.origin,a,g),p(i.origin,i.origin,r);const c=l(s.get(),e,n.direction[0]),b=l(s.get(),o,n.direction[1]);return l(i.vector,p(c,c,b),2),i}function Ct(t,n){Math.abs(h(t.basis1,t.basis2)/(I(t.basis1)*I(t.basis2)))>1e-6&&Y().warn(n,"Provided basis vectors are not perpendicular"),Math.abs(h(t.basis1,f(t)))>1e-6&&Y().warn(n,"Basis vectors and plane normal are not perpendicular"),Math.abs(-h(f(t),t.origin)-t.plane[3])>1e-6&&Y().warn(n,"Plane offset is not consistent with plane origin")}function et(t,n,i,e){const o=f(t);F(o,n.direction,n.origin,i),F(T(i),o,n.origin,e)}const ot={plane:y(),origin:w(0,0,0),basis1:w(1,0,0),basis2:w(0,1,0)},x=new O(y),v=new O(pt),kt=N(),Dt=new O(()=>$()),k=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],d=L(),V=L(),Wt=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:yt,altitudeAt:B,axisAt:Ft,cameraFrustumCoverage:_t,closestPoint:J,closestPointOnSilhouette:Q,copy:j,copyWithoutVerify:St,create:$,distance:At,distance2:q,distanceToSilhouette:Yt,elevate:U,equals:zt,extrusionContainsPoint:Vt,fromAABoundingRect:W,fromValues:Z,getExtent:wt,intersectRay:R,intersectRayClosestSilhouette:Et,normal:f,projectPoint:tt,projectPointLocal:it,rotate:qt,setAltitudeAt:Ot,setExtent:vt,transform:Rt,up:ot,updateUnboundedPlane:S,wrap:jt},Symbol.toStringTag,{value:"Module"}));export{j as M,S as N,Wt as R,$ as h,Z as q}; +import{hZ as w,i8 as E,cf as rt,ha as st,i9 as _,dg as N,a1 as at}from"./story-Doly9N9p.js";import{X as O,p as ct}from"./sphere-BenPORjV-B4uz1SYF.js";import{z as ut,G as gt,K as bt}from"./mat4-DX7gBViE-6clJxb1Q.js";import{t as L}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{A as u,L as l,j as p,_ as M,g as ft,b as I,W as lt,y as h,r as z,R as A,Y as m,l as D,v as G}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{u as pt,j as H,x as dt}from"./lineSegment-CcqvCARM-CDEWcAzV.js";import{y,a as mt,j as ht,T as F,f as s,H as It,M as $t,S as Nt,m as Mt,g as X,D as Pt,l as P,N as T,h as Tt}from"./plane-Dt8R0KeE-Bqc6oVGz.js";const Y=()=>at.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");class xt{constructor(){this.plane=y(),this.origin=N(),this.basis1=N(),this.basis2=N()}}const yt=xt;function $(t=ot){return{plane:y(t.plane),origin:E(t.origin),basis1:E(t.basis1),basis2:E(t.basis2)}}function jt(t,n,i){const e=Dt.get();return e.origin=t,e.basis1=n,e.basis2=i,e.plane=mt(0,0,0,0),S(e),e}function j(t,n=$()){return Z(t.origin,t.basis1,t.basis2,n)}function St(t,n){u(n.origin,t.origin),u(n.basis1,t.basis1),u(n.basis2,t.basis2),ht(n.plane,t.plane)}function Z(t,n,i,e=$()){return u(e.origin,t),u(e.basis1,n),u(e.basis2,i),S(e),Ct(e,"fromValues()"),e}function S(t){F(t.basis2,t.basis1,t.origin,t.plane)}function U(t,n,i){t!==i&&j(t,i);const e=l(s.get(),f(t),n);return p(i.origin,i.origin,e),i.plane[3]-=n,i}function vt(t,n,i){return W(n,i),U(i,B(t,t.origin),i),i}function wt(t,n){const i=t.basis1[0],e=t.basis2[1],[o,r]=t.origin;return rt(o-i,r-e,o+i,r+e,n)}function W(t,n=$()){const i=(t[2]-t[0])/2,e=(t[3]-t[1])/2;return M(n.origin,t[0]+i,t[1]+e,0),M(n.basis1,i,0,0),M(n.basis2,0,e,0),It(0,0,1,0,n.plane),n}function R(t,n,i){return!!$t(t.plane,n,i)&&nt(t,i)}function Et(t,n,i){if(R(t,n,i))return i;const e=Q(t,n,s.get());return p(i,n.origin,l(s.get(),n.direction,ft(n.origin,e)/I(n.direction))),i}function Q(t,n,i){const e=x.get();et(t,n,e,x.get());let o=Number.POSITIVE_INFINITY;for(const r of k){const a=C(t,r,v.get()),g=s.get();if(Nt(e,a,g)){const c=lt(s.get(),n.origin,g),b=Math.abs(st(h(n.direction,c)));bi&&(i=r)}return Math.sqrt(i)}function Vt(t,n){return X(t.plane,n)&&nt(t,n)}function Ft(t,n,i,e){return Bt(t,i,e)}function B(t,n){const i=-t.plane[3];return P(f(t),n)-i}function Ot(t,n,i,e){const o=B(t,n),r=l(kt,f(t),i-o);return p(e,n,r),e}function zt(t,n){return A(t.basis1,n.basis1)&&A(t.basis2,n.basis2)&&A(t.origin,n.origin)}function Rt(t,n,i){return t!==i&&j(t,i),ut(d,n),gt(d,d),m(i.basis1,t.basis1,d),m(i.basis2,t.basis2,d),m(T(i.plane),T(t.plane),d),m(i.origin,t.origin,n),Tt(i.plane,i.plane,i.origin),i}function qt(t,n,i,e){return t!==e&&j(t,e),bt(V,n,i),m(e.basis1,t.basis1,V),m(e.basis2,t.basis2,V),S(e),e}function f(t){return T(t.plane)}function Bt(t,n,i){switch(n){case _.X:u(i,t.basis1),D(i,i);break;case _.Y:u(i,t.basis2),D(i,i);break;case _.Z:u(i,f(t))}return i}function nt(t,n){const i=z(s.get(),n,t.origin),e=G(t.basis1),o=G(t.basis2),r=h(t.basis1,i),a=h(t.basis2,i);return-r-e<0&&r-e<0&&-a-o<0&&a-o<0}function K(t,n){const i=v.get();return u(i.origin,t.origin),u(i.vector,n),i}function C(t,n,i){const{basis1:e,basis2:o,origin:r}=t,a=l(s.get(),e,n.origin[0]),g=l(s.get(),o,n.origin[1]);p(i.origin,a,g),p(i.origin,i.origin,r);const c=l(s.get(),e,n.direction[0]),b=l(s.get(),o,n.direction[1]);return l(i.vector,p(c,c,b),2),i}function Ct(t,n){Math.abs(h(t.basis1,t.basis2)/(I(t.basis1)*I(t.basis2)))>1e-6&&Y().warn(n,"Provided basis vectors are not perpendicular"),Math.abs(h(t.basis1,f(t)))>1e-6&&Y().warn(n,"Basis vectors and plane normal are not perpendicular"),Math.abs(-h(f(t),t.origin)-t.plane[3])>1e-6&&Y().warn(n,"Plane offset is not consistent with plane origin")}function et(t,n,i,e){const o=f(t);F(o,n.direction,n.origin,i),F(T(i),o,n.origin,e)}const ot={plane:y(),origin:w(0,0,0),basis1:w(1,0,0),basis2:w(0,1,0)},x=new O(y),v=new O(pt),kt=N(),Dt=new O(()=>$()),k=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],d=L(),V=L(),Wt=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:yt,altitudeAt:B,axisAt:Ft,cameraFrustumCoverage:_t,closestPoint:J,closestPointOnSilhouette:Q,copy:j,copyWithoutVerify:St,create:$,distance:At,distance2:q,distanceToSilhouette:Yt,elevate:U,equals:zt,extrusionContainsPoint:Vt,fromAABoundingRect:W,fromValues:Z,getExtent:wt,intersectRay:R,intersectRayClosestSilhouette:Et,normal:f,projectPoint:tt,projectPointLocal:it,rotate:qt,setAltitudeAt:Ot,setExtent:vt,transform:Rt,up:ot,updateUnboundedPlane:S,wrap:jt},Symbol.toStringTag,{value:"Module"}));export{j as M,S as N,Wt as R,$ as h,Z as q}; diff --git a/custom-toc-highlight/assets/calcite-action-2fclGKoO-DEiRzt3o.js b/custom-toc-highlight/assets/calcite-action-2fclGKoO-DEiRzt3o.js new file mode 100644 index 00000000..829bc3b6 --- /dev/null +++ b/custom-toc-highlight/assets/calcite-action-2fclGKoO-DEiRzt3o.js @@ -0,0 +1 @@ +import{f as o,m as t}from"./action-GCQoufcz-DQvoWHlv.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./guid-Dls486Er-CBh637k4.js";import"./interactive-DqhNilgd-BbTDbq0n.js";import"./loadable-DbNDKH4r-CSXrQx_7.js";import"./locale-Cn_GDVD_-CCUxSwPB.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-CfIXp3Nz.js";import"./component-CWGf1hug-BASJpoEG.js";import"./t9n-C_hcZMZJ-Du2NPCXI.js";import"./icon-BXFbBbop-Bq4Zv26A.js";import"./loader-Ch7Jr16w-CF4bv9QO.js";const E=o,b=t;export{E as CalciteAction,b as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-action-2fclGKoO-DO9-6_VR.js b/custom-toc-highlight/assets/calcite-action-2fclGKoO-DO9-6_VR.js deleted file mode 100644 index f37c0cdc..00000000 --- a/custom-toc-highlight/assets/calcite-action-2fclGKoO-DO9-6_VR.js +++ /dev/null @@ -1 +0,0 @@ -import{f as o,m as t}from"./action-GCQoufcz-CK-V5fzo.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./guid-Dls486Er-CBh637k4.js";import"./interactive-DqhNilgd-BPt2o3jA.js";import"./loadable-DbNDKH4r-D4CSNQAA.js";import"./locale-Cn_GDVD_-Ar3RKmd3.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-BNRQivHR.js";import"./component-CWGf1hug-BASJpoEG.js";import"./t9n-C_hcZMZJ-D4zmKT16.js";import"./icon-BXFbBbop-BUyrjp8g.js";import"./loader-Ch7Jr16w-DUAf9YhQ.js";const E=o,b=t;export{E as CalciteAction,b as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-action-bar-ugh74qU5-trFy58rx.js b/custom-toc-highlight/assets/calcite-action-bar-ugh74qU5-C59I7NOF.js similarity index 90% rename from custom-toc-highlight/assets/calcite-action-bar-ugh74qU5-trFy58rx.js rename to custom-toc-highlight/assets/calcite-action-bar-ugh74qU5-C59I7NOF.js index df8d928a..9d8bc3f9 100644 --- a/custom-toc-highlight/assets/calcite-action-bar-ugh74qU5-trFy58rx.js +++ b/custom-toc-highlight/assets/calcite-action-bar-ugh74qU5-C59I7NOF.js @@ -1 +1 @@ -import{p as G,b as k,W as T,a as d,D as B,n as M,h as W}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{s as $,c as q}from"./conditionalSlot-DsCzytJ4-8LGFSrPC.js";import{V as A,G as w,g as P,p as _}from"./dom-N58V0tYi-DBU3jlah.js";import{r as K,o as R,f as F}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{K as j,q as V}from"./locale-Cn_GDVD_-Ar3RKmd3.js";import{c as E}from"./observers-BigwqTsw-BNRQivHR.js";import{l as I,d as J,h as N,M as Q}from"./t9n-C_hcZMZJ-D4zmKT16.js";import{o as g,l as U}from"./action-group-DhwU7QZv-gljbsXvo.js";import{K as X,O as Y,_ as Z}from"./action-menu-DTIJuZNc-C8BNxu3_.js";import{m as ee}from"./action-GCQoufcz-CK-V5fzo.js";import{m as te}from"./icon-BXFbBbop-BUyrjp8g.js";import{v as oe}from"./loader-Ch7Jr16w-DUAf9YhQ.js";import{l as ie}from"./debounce-27Hmkkyg-Th7bw3mg.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";import"./floating-ui-DKFFlLv3--KXNPa_R.js";import"./openCloseComponent-BGQ6h7vg-COvbZ7sG.js";import"./FloatingArrow-BG9llDYg-iM1y-TMJ.js";import"./component-CWGf1hug-BASJpoEG.js";import"./interactive-DqhNilgd-BPt2o3jA.js";const ae=2,C=e=>e.reduce((t,o)=>t+o,0)/e.length,se=e=>{const t=e.filter(i=>i.slot!==g.menuActions),o=t?.length;return{actionWidth:o?C(t.map(i=>i.clientWidth||0)):0,actionHeight:o?C(t.map(i=>i.clientHeight||0)):0}},ne=({width:e,actionWidth:t,layout:o,height:i,actionHeight:l,groupCount:s})=>{const n=o==="horizontal"?e:i,a=o==="horizontal"?t:l;return Math.floor((n-s*ae)/a)},le=({layout:e,actionCount:t,actionWidth:o,width:i,actionHeight:l,height:s,groupCount:n})=>Math.max(t-ne({width:i,actionWidth:o,layout:e,height:s,actionHeight:l,groupCount:n}),0),x=e=>Array.from(e.querySelectorAll("calcite-action")).filter(t=>t.closest("calcite-action-menu")?t.slot===Z.trigger:!0),ce=({actionGroups:e,expanded:t,overflowCount:o})=>{let i=o;e.reverse().forEach(l=>{let s=0;const n=x(l).reverse();n.forEach(a=>{a.slot===g.menuActions&&(a.removeAttribute("slot"),a.textEnabled=t)}),i>0&&n.some(a=>(n.filter(c=>!c.slot).length>1&&n.length>2&&!a.closest("calcite-action-menu")&&(a.textEnabled=!0,a.setAttribute("slot",g.menuActions),s++,s>1&&i--),i<1)),M(l)})},H={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function re(e,t){return e||t.closest("calcite-shell-panel")?.position||"start"}function m({el:e,expanded:t}){x(e).filter(o=>o.slot!==g.menuActions).forEach(o=>o.textEnabled=t),e.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(o=>o.expanded=t)}const de=({tooltip:e,referenceElement:t,expanded:o,ref:i})=>(e&&(e.referenceElement=!o&&t?t:null),i&&i(t),t),he=({expanded:e,expandText:t,collapseText:o,expandLabel:i,collapseLabel:l,toggle:s,el:n,position:a,tooltip:c,ref:r,scale:h})=>{const f=_(n)==="rtl",u=e?o:t,b=e?l:i,p=[H.chevronsLeft,H.chevronsRight];f&&p.reverse();const y=re(a,n)==="end",D=y?p[1]:p[0],O=y?p[0]:p[1];return d("calcite-action",{icon:e?D:O,id:"expand-toggle",label:b,onClick:s,ref:S=>de({tooltip:c,referenceElement:S,expanded:e,ref:r}),scale:h,text:u,textEnabled:e,title:!e&&!c?u:null})},pe={actionGroupEnd:"action-group--end"},v={actionsEnd:"actions-end",bottomActions:"bottom-actions",expandTooltip:"expand-tooltip"},ue=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{pointer-events:auto;display:inline-flex;align-self:stretch;gap:var(--calcite-action-bar-items-space, 0)}:host([layout=vertical]){flex-direction:column}:host([layout=vertical]):host([overflow-actions-disabled]){overflow-y:auto}:host([layout=vertical]):host([expanded]){max-inline-size:var(--calcite-action-bar-expanded-max-width, auto)}:host([layout=vertical]) .action-group--end{margin-block-start:auto}:host([layout=vertical]) ::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}:host([layout=horizontal]){flex-direction:row}:host([layout=horizontal]):host([overflow-actions-disabled]){overflow-x:auto}:host([layout=horizontal]) .action-group--end{margin-inline-start:auto}:host([layout=horizontal]) ::slotted(calcite-action-group:not(:last-of-type)){border-inline-end-width:var(--calcite-border-width-sm)}.action-group--end{justify-content:flex-end}:host([hidden]){display:none}[hidden]{display:none}",me=ue,z=G(class extends k{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionBarToggle=T(this,"calciteActionBarToggle",6),this.mutationObserver=E("mutation",()=>{const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}),this.resizeObserver=E("resize",e=>this.resizeHandlerEntries(e)),this.actionMenuOpenHandler=e=>{if(e.target.menuOpen){const t=e.composedPath();Array.from(this.el.querySelectorAll("calcite-action-group")).forEach(o=>{t.includes(o)||(o.menuOpen=!1)})}},this.resizeHandlerEntries=e=>{e.forEach(this.resizeHandler)},this.resizeHandler=e=>{const{width:t,height:o}=e.contentRect;this.resize({width:t,height:o})},this.resize=ie(({width:e,height:t})=>{const{el:o,expanded:i,expandDisabled:l,layout:s,overflowActionsDisabled:n}=this;if(n||s==="vertical"&&!t||s==="horizontal"&&!e)return;const a=x(o),c=l?a.length:a.length+1,r=Array.from(o.querySelectorAll("calcite-action-group"));this.setGroupLayout(r);const h=this.hasActionsEnd||this.hasBottomActions||!l?r.length+1:r.length,{actionHeight:f,actionWidth:u}=se(a),b=le({layout:s,actionCount:c,actionHeight:f,actionWidth:u,height:t,width:e,groupCount:h});ce({actionGroups:r,expanded:i,overflowCount:b})},W.resize),this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionBarToggle.emit()},this.handleDefaultSlotChange=e=>{const t=A(e).filter(o=>o.matches("calcite-action-group"));this.setGroupLayout(t)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=w(e)},this.handleBottomActionsSlotChange=e=>{this.hasBottomActions=w(e)},this.handleTooltipSlotChange=e=>{const t=A(e).filter(o=>o?.matches("calcite-tooltip"));this.expandTooltip=t[0]},this.actionsEndGroupLabel=void 0,this.expandDisabled=!1,this.expanded=!1,this.layout="vertical",this.overflowActionsDisabled=!1,this.overlayPositioning="absolute",this.position=void 0,this.scale=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.hasActionsEnd=!1,this.hasBottomActions=!1,this.expandTooltip=void 0,this.defaultMessages=void 0}expandHandler(){this.overflowActions()}expandedHandler(){const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}layoutHandler(){this.updateGroups()}overflowDisabledHandler(e){if(e){this.resizeObserver?.disconnect();return}this.resizeObserver?.observe(this.el),this.overflowActions()}onMessagesChange(){}effectiveLocaleChange(){I(this,this.effectiveLocale)}componentDidLoad(){const{el:e,expanded:t}=this;K(this),m({el:e,expanded:t}),this.overflowActions()}connectedCallback(){const{el:e,expanded:t}=this;j(this),J(this),m({el:e,expanded:t}),this.mutationObserver?.observe(e,{childList:!0,subtree:!0}),this.overflowActionsDisabled||this.resizeObserver?.observe(e),this.overflowActions(),$(this)}async componentWillLoad(){R(this),await N(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),q(this),V(this),Q(this)}async overflowActions(){this.resize({width:this.el.clientWidth,height:this.el.clientHeight})}async setFocus(){await F(this),P(this.el)}updateGroups(){this.setGroupLayout(Array.from(this.el.querySelectorAll("calcite-action-group")))}setGroupLayout(e){e.forEach(t=>t.layout=this.layout)}renderBottomActionGroup(){const{expanded:e,expandDisabled:t,el:o,position:i,toggleExpand:l,scale:s,layout:n,messages:a,actionsEndGroupLabel:c,overlayPositioning:r}=this,h=t?null:d(he,{collapseLabel:a.collapseLabel,collapseText:a.collapse,el:o,expandLabel:a.expandLabel,expandText:a.expand,expanded:e,position:i,scale:s,toggle:l,tooltip:this.expandTooltip});return d("calcite-action-group",{class:pe.actionGroupEnd,hidden:this.expandDisabled&&!(this.hasActionsEnd||this.hasBottomActions),label:c,layout:n,overlayPositioning:r,scale:s},d("slot",{name:v.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),d("slot",{name:v.bottomActions,onSlotchange:this.handleBottomActionsSlotChange}),d("slot",{name:v.expandTooltip,onSlotchange:this.handleTooltipSlotChange}),h)}render(){return d(B,{key:"ff6e365531a0ed2032864bb0777910c3932e9c6b",onCalciteActionMenuOpen:this.actionMenuOpenHandler},d("slot",{key:"f12b2f455752a62ee32b65224bed385940135a49",onSlotchange:this.handleDefaultSlotChange}),this.renderBottomActionGroup())}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return me}},[1,"calcite-action-bar",{actionsEndGroupLabel:[1,"actions-end-group-label"],expandDisabled:[516,"expand-disabled"],expanded:[1540],layout:[513],overflowActionsDisabled:[516,"overflow-actions-disabled"],overlayPositioning:[513,"overlay-positioning"],position:[513],scale:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],hasActionsEnd:[32],hasBottomActions:[32],expandTooltip:[32],defaultMessages:[32],overflowActions:[64],setFocus:[64]},void 0,{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function L(){typeof customElements>"u"||["calcite-action-bar","calcite-action","calcite-action-group","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-bar":customElements.get(e)||customElements.define(e,z);break;case"calcite-action":customElements.get(e)||ee();break;case"calcite-action-group":customElements.get(e)||U();break;case"calcite-action-menu":customElements.get(e)||Y();break;case"calcite-icon":customElements.get(e)||te();break;case"calcite-loader":customElements.get(e)||oe();break;case"calcite-popover":customElements.get(e)||X();break}})}L();const qe=z,Pe=L;export{qe as CalciteActionBar,Pe as defineCustomElement}; +import{p as G,b as k,W as T,a as d,D as B,n as M,h as W}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{s as $,c as q}from"./conditionalSlot-DsCzytJ4-DM7mn4Oa.js";import{V as A,G as w,g as P,p as _}from"./dom-N58V0tYi-DBU3jlah.js";import{r as K,o as R,f as F}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{K as j,q as V}from"./locale-Cn_GDVD_-CCUxSwPB.js";import{c as E}from"./observers-BigwqTsw-CfIXp3Nz.js";import{l as I,d as J,h as N,M as Q}from"./t9n-C_hcZMZJ-Du2NPCXI.js";import{o as g,l as U}from"./action-group-DhwU7QZv-CXvhCgpT.js";import{K as X,O as Y,_ as Z}from"./action-menu-DTIJuZNc-DnQvHied.js";import{m as ee}from"./action-GCQoufcz-DQvoWHlv.js";import{m as te}from"./icon-BXFbBbop-Bq4Zv26A.js";import{v as oe}from"./loader-Ch7Jr16w-CF4bv9QO.js";import{l as ie}from"./debounce-27Hmkkyg-Th7bw3mg.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";import"./floating-ui-DKFFlLv3-8lk8tQD2.js";import"./openCloseComponent-BGQ6h7vg-BO0gc3O8.js";import"./FloatingArrow-BG9llDYg-Ct2kNlPu.js";import"./component-CWGf1hug-BASJpoEG.js";import"./interactive-DqhNilgd-BbTDbq0n.js";const ae=2,C=e=>e.reduce((t,o)=>t+o,0)/e.length,se=e=>{const t=e.filter(i=>i.slot!==g.menuActions),o=t?.length;return{actionWidth:o?C(t.map(i=>i.clientWidth||0)):0,actionHeight:o?C(t.map(i=>i.clientHeight||0)):0}},ne=({width:e,actionWidth:t,layout:o,height:i,actionHeight:l,groupCount:s})=>{const n=o==="horizontal"?e:i,a=o==="horizontal"?t:l;return Math.floor((n-s*ae)/a)},le=({layout:e,actionCount:t,actionWidth:o,width:i,actionHeight:l,height:s,groupCount:n})=>Math.max(t-ne({width:i,actionWidth:o,layout:e,height:s,actionHeight:l,groupCount:n}),0),x=e=>Array.from(e.querySelectorAll("calcite-action")).filter(t=>t.closest("calcite-action-menu")?t.slot===Z.trigger:!0),ce=({actionGroups:e,expanded:t,overflowCount:o})=>{let i=o;e.reverse().forEach(l=>{let s=0;const n=x(l).reverse();n.forEach(a=>{a.slot===g.menuActions&&(a.removeAttribute("slot"),a.textEnabled=t)}),i>0&&n.some(a=>(n.filter(c=>!c.slot).length>1&&n.length>2&&!a.closest("calcite-action-menu")&&(a.textEnabled=!0,a.setAttribute("slot",g.menuActions),s++,s>1&&i--),i<1)),M(l)})},H={chevronsLeft:"chevrons-left",chevronsRight:"chevrons-right"};function re(e,t){return e||t.closest("calcite-shell-panel")?.position||"start"}function m({el:e,expanded:t}){x(e).filter(o=>o.slot!==g.menuActions).forEach(o=>o.textEnabled=t),e.querySelectorAll("calcite-action-group, calcite-action-menu").forEach(o=>o.expanded=t)}const de=({tooltip:e,referenceElement:t,expanded:o,ref:i})=>(e&&(e.referenceElement=!o&&t?t:null),i&&i(t),t),he=({expanded:e,expandText:t,collapseText:o,expandLabel:i,collapseLabel:l,toggle:s,el:n,position:a,tooltip:c,ref:r,scale:h})=>{const f=_(n)==="rtl",u=e?o:t,b=e?l:i,p=[H.chevronsLeft,H.chevronsRight];f&&p.reverse();const y=re(a,n)==="end",D=y?p[1]:p[0],O=y?p[0]:p[1];return d("calcite-action",{icon:e?D:O,id:"expand-toggle",label:b,onClick:s,ref:S=>de({tooltip:c,referenceElement:S,expanded:e,ref:r}),scale:h,text:u,textEnabled:e,title:!e&&!c?u:null})},pe={actionGroupEnd:"action-group--end"},v={actionsEnd:"actions-end",bottomActions:"bottom-actions",expandTooltip:"expand-tooltip"},ue=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{pointer-events:auto;display:inline-flex;align-self:stretch;gap:var(--calcite-action-bar-items-space, 0)}:host([layout=vertical]){flex-direction:column}:host([layout=vertical]):host([overflow-actions-disabled]){overflow-y:auto}:host([layout=vertical]):host([expanded]){max-inline-size:var(--calcite-action-bar-expanded-max-width, auto)}:host([layout=vertical]) .action-group--end{margin-block-start:auto}:host([layout=vertical]) ::slotted(calcite-action-group:not(:last-of-type)){border-block-end-width:var(--calcite-border-width-sm)}:host([layout=horizontal]){flex-direction:row}:host([layout=horizontal]):host([overflow-actions-disabled]){overflow-x:auto}:host([layout=horizontal]) .action-group--end{margin-inline-start:auto}:host([layout=horizontal]) ::slotted(calcite-action-group:not(:last-of-type)){border-inline-end-width:var(--calcite-border-width-sm)}.action-group--end{justify-content:flex-end}:host([hidden]){display:none}[hidden]{display:none}",me=ue,z=G(class extends k{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteActionBarToggle=T(this,"calciteActionBarToggle",6),this.mutationObserver=E("mutation",()=>{const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}),this.resizeObserver=E("resize",e=>this.resizeHandlerEntries(e)),this.actionMenuOpenHandler=e=>{if(e.target.menuOpen){const t=e.composedPath();Array.from(this.el.querySelectorAll("calcite-action-group")).forEach(o=>{t.includes(o)||(o.menuOpen=!1)})}},this.resizeHandlerEntries=e=>{e.forEach(this.resizeHandler)},this.resizeHandler=e=>{const{width:t,height:o}=e.contentRect;this.resize({width:t,height:o})},this.resize=ie(({width:e,height:t})=>{const{el:o,expanded:i,expandDisabled:l,layout:s,overflowActionsDisabled:n}=this;if(n||s==="vertical"&&!t||s==="horizontal"&&!e)return;const a=x(o),c=l?a.length:a.length+1,r=Array.from(o.querySelectorAll("calcite-action-group"));this.setGroupLayout(r);const h=this.hasActionsEnd||this.hasBottomActions||!l?r.length+1:r.length,{actionHeight:f,actionWidth:u}=se(a),b=le({layout:s,actionCount:c,actionHeight:f,actionWidth:u,height:t,width:e,groupCount:h});ce({actionGroups:r,expanded:i,overflowCount:b})},W.resize),this.toggleExpand=()=>{this.expanded=!this.expanded,this.calciteActionBarToggle.emit()},this.handleDefaultSlotChange=e=>{const t=A(e).filter(o=>o.matches("calcite-action-group"));this.setGroupLayout(t)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=w(e)},this.handleBottomActionsSlotChange=e=>{this.hasBottomActions=w(e)},this.handleTooltipSlotChange=e=>{const t=A(e).filter(o=>o?.matches("calcite-tooltip"));this.expandTooltip=t[0]},this.actionsEndGroupLabel=void 0,this.expandDisabled=!1,this.expanded=!1,this.layout="vertical",this.overflowActionsDisabled=!1,this.overlayPositioning="absolute",this.position=void 0,this.scale=void 0,this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.hasActionsEnd=!1,this.hasBottomActions=!1,this.expandTooltip=void 0,this.defaultMessages=void 0}expandHandler(){this.overflowActions()}expandedHandler(){const{el:e,expanded:t}=this;m({el:e,expanded:t}),this.overflowActions()}layoutHandler(){this.updateGroups()}overflowDisabledHandler(e){if(e){this.resizeObserver?.disconnect();return}this.resizeObserver?.observe(this.el),this.overflowActions()}onMessagesChange(){}effectiveLocaleChange(){I(this,this.effectiveLocale)}componentDidLoad(){const{el:e,expanded:t}=this;K(this),m({el:e,expanded:t}),this.overflowActions()}connectedCallback(){const{el:e,expanded:t}=this;j(this),J(this),m({el:e,expanded:t}),this.mutationObserver?.observe(e,{childList:!0,subtree:!0}),this.overflowActionsDisabled||this.resizeObserver?.observe(e),this.overflowActions(),$(this)}async componentWillLoad(){R(this),await N(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),q(this),V(this),Q(this)}async overflowActions(){this.resize({width:this.el.clientWidth,height:this.el.clientHeight})}async setFocus(){await F(this),P(this.el)}updateGroups(){this.setGroupLayout(Array.from(this.el.querySelectorAll("calcite-action-group")))}setGroupLayout(e){e.forEach(t=>t.layout=this.layout)}renderBottomActionGroup(){const{expanded:e,expandDisabled:t,el:o,position:i,toggleExpand:l,scale:s,layout:n,messages:a,actionsEndGroupLabel:c,overlayPositioning:r}=this,h=t?null:d(he,{collapseLabel:a.collapseLabel,collapseText:a.collapse,el:o,expandLabel:a.expandLabel,expandText:a.expand,expanded:e,position:i,scale:s,toggle:l,tooltip:this.expandTooltip});return d("calcite-action-group",{class:pe.actionGroupEnd,hidden:this.expandDisabled&&!(this.hasActionsEnd||this.hasBottomActions),label:c,layout:n,overlayPositioning:r,scale:s},d("slot",{name:v.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}),d("slot",{name:v.bottomActions,onSlotchange:this.handleBottomActionsSlotChange}),d("slot",{name:v.expandTooltip,onSlotchange:this.handleTooltipSlotChange}),h)}render(){return d(B,{key:"ff6e365531a0ed2032864bb0777910c3932e9c6b",onCalciteActionMenuOpen:this.actionMenuOpenHandler},d("slot",{key:"f12b2f455752a62ee32b65224bed385940135a49",onSlotchange:this.handleDefaultSlotChange}),this.renderBottomActionGroup())}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return me}},[1,"calcite-action-bar",{actionsEndGroupLabel:[1,"actions-end-group-label"],expandDisabled:[516,"expand-disabled"],expanded:[1540],layout:[513],overflowActionsDisabled:[516,"overflow-actions-disabled"],overlayPositioning:[513,"overlay-positioning"],position:[513],scale:[513],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],hasActionsEnd:[32],hasBottomActions:[32],expandTooltip:[32],defaultMessages:[32],overflowActions:[64],setFocus:[64]},void 0,{expandDisabled:["expandHandler"],expanded:["expandedHandler"],layout:["layoutHandler"],overflowActionsDisabled:["overflowDisabledHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function L(){typeof customElements>"u"||["calcite-action-bar","calcite-action","calcite-action-group","calcite-action-menu","calcite-icon","calcite-loader","calcite-popover"].forEach(e=>{switch(e){case"calcite-action-bar":customElements.get(e)||customElements.define(e,z);break;case"calcite-action":customElements.get(e)||ee();break;case"calcite-action-group":customElements.get(e)||U();break;case"calcite-action-menu":customElements.get(e)||Y();break;case"calcite-icon":customElements.get(e)||te();break;case"calcite-loader":customElements.get(e)||oe();break;case"calcite-popover":customElements.get(e)||X();break}})}L();const qe=z,Pe=L;export{qe as CalciteActionBar,Pe as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-action-group-qlkUfh_o-H6U8Q6wA.js b/custom-toc-highlight/assets/calcite-action-group-qlkUfh_o-H6U8Q6wA.js new file mode 100644 index 00000000..9dd86d1a --- /dev/null +++ b/custom-toc-highlight/assets/calcite-action-group-qlkUfh_o-H6U8Q6wA.js @@ -0,0 +1 @@ +import{c as o,l as t}from"./action-group-DhwU7QZv-CXvhCgpT.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./conditionalSlot-DsCzytJ4-DM7mn4Oa.js";import"./observers-BigwqTsw-CfIXp3Nz.js";import"./loadable-DbNDKH4r-CSXrQx_7.js";import"./locale-Cn_GDVD_-CCUxSwPB.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./t9n-C_hcZMZJ-Du2NPCXI.js";import"./action-menu-DTIJuZNc-DnQvHied.js";import"./guid-Dls486Er-CBh637k4.js";import"./action-GCQoufcz-DQvoWHlv.js";import"./interactive-DqhNilgd-BbTDbq0n.js";import"./component-CWGf1hug-BASJpoEG.js";import"./icon-BXFbBbop-Bq4Zv26A.js";import"./loader-Ch7Jr16w-CF4bv9QO.js";import"./floating-ui-DKFFlLv3-8lk8tQD2.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./openCloseComponent-BGQ6h7vg-BO0gc3O8.js";import"./FloatingArrow-BG9llDYg-Ct2kNlPu.js";const q=o,v=t;export{q as CalciteActionGroup,v as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-action-group-qlkUfh_o-wUTthgYu.js b/custom-toc-highlight/assets/calcite-action-group-qlkUfh_o-wUTthgYu.js deleted file mode 100644 index ae95c0bf..00000000 --- a/custom-toc-highlight/assets/calcite-action-group-qlkUfh_o-wUTthgYu.js +++ /dev/null @@ -1 +0,0 @@ -import{c as o,l as t}from"./action-group-DhwU7QZv-gljbsXvo.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./conditionalSlot-DsCzytJ4-8LGFSrPC.js";import"./observers-BigwqTsw-BNRQivHR.js";import"./loadable-DbNDKH4r-D4CSNQAA.js";import"./locale-Cn_GDVD_-Ar3RKmd3.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./t9n-C_hcZMZJ-D4zmKT16.js";import"./action-menu-DTIJuZNc-C8BNxu3_.js";import"./guid-Dls486Er-CBh637k4.js";import"./action-GCQoufcz-CK-V5fzo.js";import"./interactive-DqhNilgd-BPt2o3jA.js";import"./component-CWGf1hug-BASJpoEG.js";import"./icon-BXFbBbop-BUyrjp8g.js";import"./loader-Ch7Jr16w-DUAf9YhQ.js";import"./floating-ui-DKFFlLv3--KXNPa_R.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./openCloseComponent-BGQ6h7vg-COvbZ7sG.js";import"./FloatingArrow-BG9llDYg-iM1y-TMJ.js";const q=o,v=t;export{q as CalciteActionGroup,v as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-button-Cm9_TJei-By40tgvH.js b/custom-toc-highlight/assets/calcite-button-Cm9_TJei-DvwKP8jU.js similarity index 97% rename from custom-toc-highlight/assets/calcite-button-Cm9_TJei-By40tgvH.js rename to custom-toc-highlight/assets/calcite-button-Cm9_TJei-DvwKP8jU.js index d5651a47..10669ba6 100644 --- a/custom-toc-highlight/assets/calcite-button-Cm9_TJei-By40tgvH.js +++ b/custom-toc-highlight/assets/calcite-button-Cm9_TJei-DvwKP8jU.js @@ -1,4 +1,4 @@ -import{p as b,b as v,n as g,c as f,a}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{D as k,V as m,I as x}from"./form-CRSw616T-DZVFUlxN.js";import{l as w,p as y}from"./interactive-DqhNilgd-BPt2o3jA.js";import{b as z,I as C,M as E}from"./label-Dys24PJn-BCewo2Re.js";import{o as S,r as L,f as O}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{K as T,q as F}from"./locale-Cn_GDVD_-Ar3RKmd3.js";import{c as o}from"./observers-BigwqTsw-BNRQivHR.js";import{e as r}from"./component-CWGf1hug-BASJpoEG.js";import{d as R,M,h as $,l as A}from"./t9n-C_hcZMZJ-D4zmKT16.js";import{A as D}from"./dom-N58V0tYi-DBU3jlah.js";import{m as I}from"./icon-BXFbBbop-BUyrjp8g.js";import{v as j}from"./loader-Ch7Jr16w-DUAf9YhQ.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";const e={buttonLoader:"calcite-button--loader",content:"content",contentSlotted:"content--slotted",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",loadingIn:"loading-in",loadingOut:"loading-out",iconStartEmpty:"icon-start-empty",iconEndEmpty:"icon-end-empty",buttonPadding:"button-padding",buttonPaddingShrunk:"button-padding--shrunk"},H=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle}:host([round]){border-radius:50px}:host([round]) a,:host([round]) button{border-radius:50px}:host button,:host a{outline-color:transparent}:host button:focus,:host a:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( +import{p as b,b as v,n as g,c as f,a}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{D as k,V as m,I as x}from"./form-CRSw616T-wY3ZjFlq.js";import{l as w,p as y}from"./interactive-DqhNilgd-BbTDbq0n.js";import{b as z,I as C,M as E}from"./label-Dys24PJn-BCewo2Re.js";import{o as S,r as L,f as O}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{K as T,q as F}from"./locale-Cn_GDVD_-CCUxSwPB.js";import{c as o}from"./observers-BigwqTsw-CfIXp3Nz.js";import{e as r}from"./component-CWGf1hug-BASJpoEG.js";import{d as R,M,h as $,l as A}from"./t9n-C_hcZMZJ-Du2NPCXI.js";import{A as D}from"./dom-N58V0tYi-DBU3jlah.js";import{m as I}from"./icon-BXFbBbop-Bq4Zv26A.js";import{v as j}from"./loader-Ch7Jr16w-CF4bv9QO.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./guid-Dls486Er-CBh637k4.js";const e={buttonLoader:"calcite-button--loader",content:"content",contentSlotted:"content--slotted",icon:"icon",iconStart:"icon--start",iconEnd:"icon--end",loadingIn:"loading-in",loadingOut:"loading-out",iconStartEmpty:"icon-start-empty",iconEndEmpty:"icon-end-empty",buttonPadding:"button-padding",buttonPaddingShrunk:"button-padding--shrunk"},H=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle}:host([round]){border-radius:50px}:host([round]) a,:host([round]) button{border-radius:50px}:host button,:host a{outline-color:transparent}:host button:focus,:host a:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( 2px * calc( 1 - diff --git a/custom-toc-highlight/assets/calcite-chip-DE_c-1hr-BB941sYj.js b/custom-toc-highlight/assets/calcite-chip-DE_c-1hr-DI1-84AU.js similarity index 97% rename from custom-toc-highlight/assets/calcite-chip-DE_c-1hr-BB941sYj.js rename to custom-toc-highlight/assets/calcite-chip-DE_c-1hr-DI1-84AU.js index 22aa17b2..e4a86fd4 100644 --- a/custom-toc-highlight/assets/calcite-chip-DE_c-1hr-BB941sYj.js +++ b/custom-toc-highlight/assets/calcite-chip-DE_c-1hr-DI1-84AU.js @@ -1,4 +1,4 @@ -import{p,b as d,W as c,c as m,a as i,D as v}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{G as g,A as u}from"./dom-N58V0tYi-DBU3jlah.js";import{r as b,o as x,f}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{l as k,d as y,M as C,h as z}from"./t9n-C_hcZMZJ-D4zmKT16.js";import{l as S,p as I}from"./interactive-DqhNilgd-BPt2o3jA.js";import{K as w,q as M}from"./locale-Cn_GDVD_-Ar3RKmd3.js";import{n as E}from"./key-CZySMiwx-kmS7VeUz.js";import{e as n}from"./component-CWGf1hug-BASJpoEG.js";import{m as D}from"./icon-BXFbBbop-BUyrjp8g.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-BNRQivHR.js";const t={title:"title",close:"close",imageContainer:"image-container",chipIcon:"chip-icon",textSlotted:"text--slotted",container:"container",imageSlotted:"image--slotted",closable:"closable",multiple:"multiple",single:"single",selectable:"selectable",selectIcon:"select-icon",selectIconActive:"select-icon--active",nonInteractive:"non-interactive",isCircle:"is-circle",selected:"selected"},H={image:"image"},a={close:"x",checkedSingle:"circle-f",uncheckedMultiple:"square",checkedMultiple:"check-square-f"},L=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-flex;cursor:default;border-radius:var(--calcite-chip-corner-radius, 9999px)}:host([closed]){display:none}:host([appearance=outline]) .container,:host([appearance=outline-fill]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([appearance=outline]):host([kind=brand]) .container,:host([appearance=outline-fill]):host([kind=brand]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-brand))}:host([appearance=outline]):host([kind=inverse]) .container,:host([appearance=outline-fill]):host([kind=inverse]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-inverse))}:host([appearance=outline]):host([kind=neutral]) .container,:host([appearance=outline-fill]):host([kind=neutral]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-1))}:host([appearance=outline]) .container{background-color:transparent}:host([appearance=outline-fill]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-1))}:host([appearance=solid]) .container{border-color:transparent}:host([appearance=solid]):host([kind=brand]) .container,:host([appearance=solid]):host([kind=inverse]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-inverse))}:host([appearance=solid]):host([kind=brand]) .close,:host([appearance=solid]):host([kind=inverse]) .close{outline-color:var(--calcite-color-text-inverse)}:host([appearance=solid]):host([kind=brand]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-brand))}:host([appearance=solid]):host([kind=inverse]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-inverse))}:host([appearance=solid]):host([kind=neutral]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-2))}:host([kind=neutral]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([selected]) .select-icon{opacity:1}:host([scale=s]) .container{--calcite-internal-chip-block-size:1.5rem ;--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--2);--calcite-internal-chip-icon-size:1rem ;--calcite-internal-chip-icon-space:0.25rem ;--calcite-internal-chip-image-size:1.25rem ;--calcite-internal-chip-title-space:0.25rem ;--calcite-internal-close-size:1rem }:host([scale=s]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px)}:host([scale=s]) .container.image--slotted:has(.chip-icon),:host([scale=s]) .container.image--slotted.text--slotted,:host([scale=s]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.25rem }:host([scale=s]) .container.image--slotted:not(.text--slotted,:has(.chip-icon)),:host([scale=s]) .container.image--slotted:not(.selectable){--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=s]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=s]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=s]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.375rem ;--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.multiple:not(.is-circle).image--slotted:not(.text--slotted){--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container{--calcite-internal-chip-block-size:2rem ;--calcite-internal-chip-container-space-x-end:0.375rem ;--calcite-internal-chip-container-space-x-start:0.375rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--1);--calcite-internal-chip-icon-size:1.5rem ;--calcite-internal-chip-icon-space:0.375rem ;--calcite-internal-chip-image-size:1.5rem ;--calcite-internal-chip-title-space:0.375rem ;--calcite-internal-close-size:1.5rem }:host([scale=m]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=m]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.image--slotted:has(.chip-icon),:host([scale=m]) .container.image--slotted.text--slotted,:host([scale=m]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.375rem }:host([scale=m]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-select-space-x-start:0}:host([scale=m]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container.multiple:not(.is-circle){--calcite-internal-chip-select-space-x-end:0.125rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=m]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=m]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.25rem }:host([scale=l]) .container{--calcite-internal-chip-block-size:2.75rem ;--calcite-internal-chip-container-space-x-end:0.5rem ;--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-font-size:var(--calcite-font-size-0);--calcite-internal-chip-icon-size:2rem ;--calcite-internal-chip-icon-space:0.5rem ;--calcite-internal-chip-image-size:2rem ;--calcite-internal-chip-title-space:0.5rem ;--calcite-internal-close-size:2rem }:host([scale=l]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=l]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.image--slotted:has(.chip-icon),:host([scale=l]) .container.image--slotted.text--slotted,:host([scale=l]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.5rem }:host([scale=l]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=l]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0.5rem }:host([scale=l]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=l]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.75rem }:host([scale=l]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.375rem }.container{box-sizing:border-box;display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center;justify-content:center;font-weight:var(--calcite-font-weight-medium);outline-color:transparent;border-radius:var(--calcite-chip-corner-radius, 9999px);border-width:var(--calcite-border-width-sm);border-style:solid;font-size:var(--calcite-internal-chip-font-size, var(--calcite-font-size));padding-inline-start:var(--calcite-internal-chip-container-space-x-start);padding-inline-end:var(--calcite-internal-chip-container-space-x-end);block-size:var(--calcite-internal-chip-block-size, auto);inline-size:var(--calcite-internal-chip-inline-size, auto);min-inline-size:var(--calcite-internal-chip-block-size, auto)}.container:hover .select-icon--active{opacity:1}.container.selectable{cursor:pointer}.container:not(.non-interactive):focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( +import{p,b as d,W as c,c as m,a as i,D as v}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{G as g,A as u}from"./dom-N58V0tYi-DBU3jlah.js";import{r as b,o as x,f}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{l as k,d as y,M as C,h as z}from"./t9n-C_hcZMZJ-Du2NPCXI.js";import{l as S,p as I}from"./interactive-DqhNilgd-BbTDbq0n.js";import{K as w,q as M}from"./locale-Cn_GDVD_-CCUxSwPB.js";import{n as E}from"./key-CZySMiwx-kmS7VeUz.js";import{e as n}from"./component-CWGf1hug-BASJpoEG.js";import{m as D}from"./icon-BXFbBbop-Bq4Zv26A.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-CfIXp3Nz.js";const t={title:"title",close:"close",imageContainer:"image-container",chipIcon:"chip-icon",textSlotted:"text--slotted",container:"container",imageSlotted:"image--slotted",closable:"closable",multiple:"multiple",single:"single",selectable:"selectable",selectIcon:"select-icon",selectIconActive:"select-icon--active",nonInteractive:"non-interactive",isCircle:"is-circle",selected:"selected"},H={image:"image"},a={close:"x",checkedSingle:"circle-f",uncheckedMultiple:"square",checkedMultiple:"check-square-f"},L=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-flex;cursor:default;border-radius:var(--calcite-chip-corner-radius, 9999px)}:host([closed]){display:none}:host([appearance=outline]) .container,:host([appearance=outline-fill]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([appearance=outline]):host([kind=brand]) .container,:host([appearance=outline-fill]):host([kind=brand]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-brand))}:host([appearance=outline]):host([kind=inverse]) .container,:host([appearance=outline-fill]):host([kind=inverse]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-inverse))}:host([appearance=outline]):host([kind=neutral]) .container,:host([appearance=outline-fill]):host([kind=neutral]) .container{border-color:var(--calcite-chip-border-color, var(--calcite-color-border-1))}:host([appearance=outline]) .container{background-color:transparent}:host([appearance=outline-fill]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-1))}:host([appearance=solid]) .container{border-color:transparent}:host([appearance=solid]):host([kind=brand]) .container,:host([appearance=solid]):host([kind=inverse]) .container{color:var(--calcite-chip-text-color, var(--calcite-color-text-inverse))}:host([appearance=solid]):host([kind=brand]) .close,:host([appearance=solid]):host([kind=inverse]) .close{outline-color:var(--calcite-color-text-inverse)}:host([appearance=solid]):host([kind=brand]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-brand))}:host([appearance=solid]):host([kind=inverse]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-inverse))}:host([appearance=solid]):host([kind=neutral]) .container{background-color:var(--calcite-chip-background-color, var(--calcite-color-foreground-2))}:host([kind=neutral]) .container{--calcite-internal-chip-close-icon-color:var(--calcite-color-text-3);color:var(--calcite-chip-text-color, var(--calcite-color-text-1))}:host([selected]) .select-icon{opacity:1}:host([scale=s]) .container{--calcite-internal-chip-block-size:1.5rem ;--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--2);--calcite-internal-chip-icon-size:1rem ;--calcite-internal-chip-icon-space:0.25rem ;--calcite-internal-chip-image-size:1.25rem ;--calcite-internal-chip-title-space:0.25rem ;--calcite-internal-close-size:1rem }:host([scale=s]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px)}:host([scale=s]) .container.image--slotted:has(.chip-icon),:host([scale=s]) .container.image--slotted.text--slotted,:host([scale=s]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.25rem }:host([scale=s]) .container.image--slotted:not(.text--slotted,:has(.chip-icon)),:host([scale=s]) .container.image--slotted:not(.selectable){--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=s]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=s]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=s]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.375rem ;--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=s]) .container.multiple:not(.is-circle).image--slotted:not(.text--slotted){--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container{--calcite-internal-chip-block-size:2rem ;--calcite-internal-chip-container-space-x-end:0.375rem ;--calcite-internal-chip-container-space-x-start:0.375rem ;--calcite-internal-chip-font-size:var(--calcite-font-size--1);--calcite-internal-chip-icon-size:1.5rem ;--calcite-internal-chip-icon-space:0.375rem ;--calcite-internal-chip-image-size:1.5rem ;--calcite-internal-chip-title-space:0.375rem ;--calcite-internal-close-size:1.5rem }:host([scale=m]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-container-space-x-start:var(--calcite-spacing-px)}:host([scale=m]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.image--slotted:has(.chip-icon),:host([scale=m]) .container.image--slotted.text--slotted,:host([scale=m]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.375rem }:host([scale=m]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=m]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:var(--calcite-spacing-px);--calcite-internal-chip-select-space-x-start:0}:host([scale=m]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.375rem }:host([scale=m]) .container.multiple:not(.is-circle){--calcite-internal-chip-select-space-x-end:0.125rem ;--calcite-internal-chip-select-space-x-start:0.125rem }:host([scale=m]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.5rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=m]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.25rem }:host([scale=l]) .container{--calcite-internal-chip-block-size:2.75rem ;--calcite-internal-chip-container-space-x-end:0.5rem ;--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-font-size:var(--calcite-font-size-0);--calcite-internal-chip-icon-size:2rem ;--calcite-internal-chip-icon-space:0.5rem ;--calcite-internal-chip-image-size:2rem ;--calcite-internal-chip-title-space:0.5rem ;--calcite-internal-close-size:2rem }:host([scale=l]) .container:not(.closable).is-circle{--calcite-internal-chip-container-space-x-end:0.25rem ;--calcite-internal-chip-container-space-x-start:0.25rem }:host([scale=l]) .container.image--slotted:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.image--slotted:has(.chip-icon),:host([scale=l]) .container.image--slotted.text--slotted,:host([scale=l]) .container.image--slotted.closable{--calcite-internal-chip-image-space-x-end:0.5rem }:host([scale=l]) .container.selectable.single:not(.is-circle).image--slotted{--calcite-internal-chip-container-space-x-start:0.375rem }:host([scale=l]) .container.selectable.single:not(.is-circle).selected{--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0}:host([scale=l]) .container.selectable.single:not(.is-circle).selected.image--slotted{--calcite-internal-chip-select-space-x-end:0.375rem ;--calcite-internal-chip-select-space-x-start:0.5rem }:host([scale=l]) .container.multiple:not(.is-circle){--calcite-internal-chip-container-space-x-start:0.5rem ;--calcite-internal-chip-select-space-x-end:0.25rem ;--calcite-internal-chip-select-space-x-start:0.25rem }:host([scale=l]) .container.multiple:not(.is-circle).image--slotted{--calcite-internal-chip-select-space-x-end:0.75rem }:host([scale=l]) .container.closable:not(.is-circle){--calcite-internal-chip-container-space-x-end:0.375rem }.container{box-sizing:border-box;display:inline-flex;block-size:100%;max-inline-size:100%;align-items:center;justify-content:center;font-weight:var(--calcite-font-weight-medium);outline-color:transparent;border-radius:var(--calcite-chip-corner-radius, 9999px);border-width:var(--calcite-border-width-sm);border-style:solid;font-size:var(--calcite-internal-chip-font-size, var(--calcite-font-size));padding-inline-start:var(--calcite-internal-chip-container-space-x-start);padding-inline-end:var(--calcite-internal-chip-container-space-x-end);block-size:var(--calcite-internal-chip-block-size, auto);inline-size:var(--calcite-internal-chip-inline-size, auto);min-inline-size:var(--calcite-internal-chip-block-size, auto)}.container:hover .select-icon--active{opacity:1}.container.selectable{cursor:pointer}.container:not(.non-interactive):focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( 2px * calc( 1 - diff --git a/custom-toc-highlight/assets/calcite-dialog-DAngwHC1-BqNAvWKZ.js b/custom-toc-highlight/assets/calcite-dialog-DAngwHC1-C6d9gJgf.js similarity index 99% rename from custom-toc-highlight/assets/calcite-dialog-DAngwHC1-BqNAvWKZ.js rename to custom-toc-highlight/assets/calcite-dialog-DAngwHC1-C6d9gJgf.js index 75c28dd8..8e4ab82b 100644 --- a/custom-toc-highlight/assets/calcite-dialog-DAngwHC1-BqNAvWKZ.js +++ b/custom-toc-highlight/assets/calcite-dialog-DAngwHC1-C6d9gJgf.js @@ -1,4 +1,4 @@ -import{p as Ni,b as Ji,W as Ot,a as C,D as Qi}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{A as Zi,g as tr}from"./dom-N58V0tYi-DBU3jlah.js";import{g as er,H as _n,E as nr,j as ir,K as rr,O as or}from"./action-menu-DTIJuZNc-C8BNxu3_.js";import{o as ar,r as sr,f as cr}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{c as lr}from"./observers-BigwqTsw-BNRQivHR.js";import{p as ur}from"./openCloseComponent-BGQ6h7vg-COvbZ7sG.js";import{K as pr,q as dr}from"./locale-Cn_GDVD_-Ar3RKmd3.js";import{h as fr,d as hr,M as vr,l as gr}from"./t9n-C_hcZMZJ-D4zmKT16.js";import{o as mr}from"./component-CWGf1hug-BASJpoEG.js";import{s as V,y as yr}from"./panel-DRUEhsxp-Bbd7sTo9.js";import{m as br}from"./action-GCQoufcz-CK-V5fzo.js";import{m as xr}from"./icon-BXFbBbop-BUyrjp8g.js";import{v as wr}from"./loader-Ch7Jr16w-DUAf9YhQ.js";import{c as Er}from"./scrim-BscQh4v9-DU79ospE.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./guid-Dls486Er-CBh637k4.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./floating-ui-DKFFlLv3--KXNPa_R.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./FloatingArrow-BG9llDYg-iM1y-TMJ.js";import"./interactive-DqhNilgd-BPt2o3jA.js";var kr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},An={exports:{}};(function(y,A){(function(O,M){y.exports=M()})(kr,function(){function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function M(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,i=B(e);if(t){var r=B(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(o,a){if(a&&(typeof a=="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _t(o)}(this,n)}}function It(){return It=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(o,a){for(;!Object.prototype.hasOwnProperty.call(o,a)&&(o=B(o))!==null;);return o}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},It.apply(this,arguments)}function Se(e){var t=function(n,i){if(typeof n!="object"||n===null)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var o=r.call(n,i);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(e,"string");return typeof t=="symbol"?t:t+""}var Pe=function(e){return!(!e||!e.Window)&&e instanceof e.Window},De=void 0,ct=void 0;function Oe(e){De=e;var t=e.document.createTextNode("");t.ownerDocument!==e.document&&typeof e.wrap=="function"&&e.wrap(t)===t&&(e=e.wrap(e)),ct=e}function N(e){return Pe(e)?e:(e.ownerDocument||e).defaultView||ct.window}typeof window<"u"&&window&&Oe(window);var Mt=function(e){return!!e&&I(e)==="object"},_e=function(e){return typeof e=="function"},f={window:function(e){return e===ct||Pe(e)},docFrag:function(e){return Mt(e)&&e.nodeType===11},object:Mt,func:_e,number:function(e){return typeof e=="number"},bool:function(e){return typeof e=="boolean"},string:function(e){return typeof e=="string"},element:function(e){if(!e||I(e)!=="object")return!1;var t=N(e)||ct;return/object|function/.test(typeof Element>"u"?"undefined":I(Element))?e instanceof Element||e instanceof t.Element:e.nodeType===1&&typeof e.nodeName=="string"},plainObject:function(e){return Mt(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return Mt(e)&&e.length!==void 0&&_e(e.splice)}};function Jt(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.prepared.axis;n==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):n==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function Ie(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="drag"){var i=n.prepared.axis;if(i==="x"||i==="y"){var r=i==="x"?"y":"x";t.page[r]=n.coords.start.page[r],t.client[r]=n.coords.start.client[r],t.delta[r]=0}}}var Ct={id:"actions/drag",install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.draggable=Ct.draggable,t.map.drag=Ct,t.methodDict.drag="draggable",i.actions.drag=Ct.defaults},listeners:{"interactions:before-action-move":Jt,"interactions:action-resume":Jt,"interactions:action-move":Ie,"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.buttons,r=n.options.drag;if(r&&r.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||i&n.options.drag.mouseButtons))return e.action={name:"drag",axis:r.lockAxis==="start"?r.startAxis:r.lockAxis},!1}},draggable:function(e){return f.object(e)?(this.options.drag.enabled=e.enabled!==!1,this.setPerAction("drag",e),this.setOnEvents("drag",e),/^(xy|x|y|start)$/.test(e.lockAxis)&&(this.options.drag.lockAxis=e.lockAxis),/^(xy|x|y)$/.test(e.startAxis)&&(this.options.drag.startAxis=e.startAxis),this):f.bool(e)?(this.options.drag.enabled=e,this):this.options.drag},beforeMove:Jt,move:Ie,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(e){return e.search("drag")===0}},Me=Ct,X={init:function(e){var t=e;X.document=t.document,X.DocumentFragment=t.DocumentFragment||ft,X.SVGElement=t.SVGElement||ft,X.SVGSVGElement=t.SVGSVGElement||ft,X.SVGElementInstance=t.SVGElementInstance||ft,X.Element=t.Element||ft,X.HTMLElement=t.HTMLElement||X.Element,X.Event=t.Event,X.Touch=t.Touch||ft,X.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function ft(){}var R=X,q={init:function(e){var t=R.Element,n=e.navigator||{};q.supportsTouch="ontouchstart"in e||f.func(e.DocumentTouch)&&R.document instanceof e.DocumentTouch,q.supportsPointerEvent=n.pointerEnabled!==!1&&!!R.PointerEvent,q.isIOS=/iP(hone|od|ad)/.test(n.platform),q.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),q.isIe9=/MSIE 9/.test(n.userAgent),q.isOperaMobile=n.appName==="Opera"&&q.supportsTouch&&/Presto/.test(n.userAgent),q.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",q.pEventTypes=q.supportsPointerEvent?R.PointerEvent===e.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,q.wheelEvent=R.document&&"onmousewheel"in R.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},U=q;function lt(e,t){if(e.contains)return e.contains(t);for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Ce(e,t){for(;f.element(e);){if(et(e,t))return e;e=J(e)}return null}function J(e){var t=e.parentNode;if(f.docFrag(t)){for(;(t=t.host)&&f.docFrag(t););return t}return t}function et(e,t){return ct!==De&&(t=t.replace(/\/deep\//g," ")),e[U.prefixedMatchesSelector](t)}var Qt=function(e){return e.parentNode||e.host};function Ae(e,t){for(var n,i=[],r=e;(n=Qt(r))&&r!==t&&n!==r.ownerDocument;)i.unshift(r),r=n;return i}function Zt(e,t,n){for(;f.element(e);){if(et(e,t))return!0;if((e=J(e))===n)return et(e,t)}return!1}function Re(e){return e.correspondingUseElement||e}function te(e){var t=e instanceof R.SVGElement?e.getBoundingClientRect():e.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ee(e){var t,n=te(e);if(!U.isIOS7&&n){var i={x:(t=(t=N(e))||ct).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};n.left+=i.x,n.right+=i.x,n.top+=i.y,n.bottom+=i.y}return n}function je(e){for(var t=[];e;)t.push(e),e=J(e);return t}function Fe(e){return!!f.string(e)&&(R.document.querySelector(e),!0)}function w(e,t){for(var n in t)e[n]=t[n];return e}function Le(e,t,n){return e==="parent"?J(n):e==="self"?t.getRect(n):Ce(n,e)}function mt(e,t,n,i){var r=e;return f.string(r)?r=Le(r,t,n):f.func(r)&&(r=r.apply(void 0,i)),f.element(r)&&(r=ee(r)),r}function At(e){return e&&{x:"x"in e?e.x:e.left,y:"y"in e?e.y:e.top}}function ne(e){return!e||"x"in e&&"y"in e||((e=w({},e)).x=e.left||0,e.y=e.top||0,e.width=e.width||(e.right||0)-e.x,e.height=e.height||(e.bottom||0)-e.y),e}function Rt(e,t,n){e.left&&(t.left+=n.x),e.right&&(t.right+=n.x),e.top&&(t.top+=n.y),e.bottom&&(t.bottom+=n.y),t.width=t.right-t.left,t.height=t.bottom-t.top}function yt(e,t,n){var i=n&&e.options[n];return At(mt(i&&i.origin||e.options.origin,e,t,[e&&t]))||{x:0,y:0}}function ut(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(c){return!0},i=arguments.length>3?arguments[3]:void 0;if(i=i||{},f.string(e)&&e.search(" ")!==-1&&(e=Be(e)),f.array(e))return e.forEach(function(c){return ut(c,t,n,i)}),i;if(f.object(e)&&(t=e,e=""),f.func(t)&&n(e))i[e]=i[e]||[],i[e].push(t);else if(f.array(t))for(var r=0,o=t;r1?Xe(t):t[0];Ke(i,e.page),function(r,o){o=o||{},U.isOperaMobile&&He(r)?Lt("screen",r,o):Lt("client",r,o)}(i,e.client),e.timeStamp=n}function ie(e){var t=[];return f.array(e)?(t[0]=e[0],t[1]=e[1]):e.type==="touchend"?e.touches.length===1?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):e.touches.length===0&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function Xe(e){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},n=0;n=(parseInt(N(x).getComputedStyle(x).zIndex,10)||0)&&(b=S);else b=S}else b=S}return b}(a);return i.activeDrops[h]||null}function ce(e,t,n){var i=e.dropState,r={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return n.type==="dragstart"&&(r.activate=new ht(i,n,"dropactivate"),r.activate.target=null,r.activate.dropzone=null),n.type==="dragend"&&(r.deactivate=new ht(i,n,"dropdeactivate"),r.deactivate.target=null,r.deactivate.dropzone=null),i.rejected||(i.cur.element!==i.prev.element&&(i.prev.dropzone&&(r.leave=new ht(i,n,"dragleave"),n.dragLeave=r.leave.target=i.prev.element,n.prevDropzone=r.leave.dropzone=i.prev.dropzone),i.cur.dropzone&&(r.enter=new ht(i,n,"dragenter"),n.dragEnter=i.cur.element,n.dropzone=i.cur.dropzone)),n.type==="dragend"&&i.cur.dropzone&&(r.drop=new ht(i,n,"drop"),n.dropzone=i.cur.dropzone,n.relatedTarget=i.cur.element),n.type==="dragmove"&&i.cur.dropzone&&(r.move=new ht(i,n,"dropmove"),n.dropzone=i.cur.dropzone)),r}function le(e,t){var n=e.dropState,i=n.activeDrops,r=n.cur,o=n.prev;t.leave&&o.dropzone.fire(t.leave),t.enter&&r.dropzone.fire(t.enter),t.move&&r.dropzone.fire(t.move),t.drop&&r.dropzone.fire(t.drop),t.deactivate&&Ge(i,t.deactivate),n.prev.dropzone=r.dropzone,n.prev.element=r.element}function Ne(e,t){var n=e.interaction,i=e.iEvent,r=e.event;if(i.type==="dragmove"||i.type==="dragend"){var o=n.dropState;t.dynamicDrop&&(o.activeDrops=se(t,n.element));var a=i,s=$e(n,a,r);o.rejected=o.rejected&&!!s&&s.dropzone===o.cur.dropzone&&s.element===o.cur.element,o.cur.dropzone=s&&s.dropzone,o.cur.element=s&&s.element,o.events=ce(n,0,a)}}var Je={id:"actions/drop",install:function(e){var t=e.actions,n=e.interactStatic,i=e.Interactable,r=e.defaults;e.usePlugin(Me),i.prototype.dropzone=function(o){return function(a,s){if(f.object(s)){if(a.options.drop.enabled=s.enabled!==!1,s.listeners){var c=ut(s.listeners),u=Object.keys(c).reduce(function(p,d){return p[/^(enter|leave)/.test(d)?"drag".concat(d):/^(activate|deactivate|move)/.test(d)?"drop".concat(d):d]=c[d],p},{}),l=a.options.drop.listeners;l&&a.off(l),a.on(u),a.options.drop.listeners=u}return f.func(s.ondrop)&&a.on("drop",s.ondrop),f.func(s.ondropactivate)&&a.on("dropactivate",s.ondropactivate),f.func(s.ondropdeactivate)&&a.on("dropdeactivate",s.ondropdeactivate),f.func(s.ondragenter)&&a.on("dragenter",s.ondragenter),f.func(s.ondragleave)&&a.on("dragleave",s.ondragleave),f.func(s.ondropmove)&&a.on("dropmove",s.ondropmove),/^(pointer|center)$/.test(s.overlap)?a.options.drop.overlap=s.overlap:f.number(s.overlap)&&(a.options.drop.overlap=Math.max(Math.min(1,s.overlap),0)),"accept"in s&&(a.options.drop.accept=s.accept),"checker"in s&&(a.options.drop.checker=s.checker),a}return f.bool(s)?(a.options.drop.enabled=s,a):a.options.drop}(this,o)},i.prototype.dropCheck=function(o,a,s,c,u,l){return function(p,d,v,h,g,b,m){var x=!1;if(!(m=m||p.getRect(b)))return!!p.options.drop.checker&&p.options.drop.checker(d,v,x,p,b,h,g);var T=p.options.drop.overlap;if(T==="pointer"){var S=yt(h,g,"drag"),E=Ke(d);E.x+=S.x,E.y+=S.y;var z=E.x>m.left&&E.xm.top&&E.y=m.left&&Y<=m.right&&G>=m.top&&G<=m.bottom}return _&&f.number(T)&&(x=Math.max(0,Math.min(m.right,_.right)-Math.max(m.left,_.left))*Math.max(0,Math.min(m.bottom,_.bottom)-Math.max(m.top,_.top))/(_.width*_.height)>=T),p.options.drop.checker&&(x=p.options.drop.checker(d,v,x,p,b,h,g)),x}(this,o,a,s,c,u,l)},n.dynamicDrop=function(o){return f.bool(o)?(e.dynamicDrop=o,n):e.dynamicDrop},w(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",e.dynamicDrop=!1,r.actions.drop=Je.defaults},listeners:{"interactions:before-action-start":function(e){var t=e.interaction;t.prepared.name==="drag"&&(t.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;r.activeDrops=[],r.events={},r.activeDrops=se(t,n.element),r.events=ce(n,0,i),r.events.activate&&(Ge(r.activeDrops,r.events.activate),t.fire("actions/drop:start",{interaction:n,dragEvent:i}))}},"interactions:action-move":Ne,"interactions:after-action-move":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;le(n,r.events),t.fire("actions/drop:move",{interaction:n,dragEvent:i}),r.events={}}},"interactions:action-end":function(e,t){if(e.interaction.prepared.name==="drag"){var n=e.interaction,i=e.iEvent;Ne(e,t),le(n,n.dropState.events),t.fire("actions/drop:end",{interaction:n,dragEvent:i})}},"interactions:stop":function(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.dropState;n&&(n.activeDrops=null,n.events=null,n.cur.dropzone=null,n.cur.element=null,n.prev.dropzone=null,n.prev.element=null,n.rejected=!1)}}},getActiveDrops:se,getDrop:$e,getDropEvents:ce,fireDropEvents:le,filterEventType:function(e){return e.search("drag")===0||e.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Bn=Je;function ue(e){var t=e.interaction,n=e.iEvent,i=e.phase;if(t.prepared.name==="gesture"){var r=t.pointers.map(function(u){return u.pointer}),o=i==="start",a=i==="end",s=t.interactable.options.deltaSource;if(n.touches=[r[0],r[1]],o)n.distance=oe(r,s),n.box=re(r),n.scale=1,n.ds=0,n.angle=ae(r,s),n.da=0,t.gesture.startDistance=n.distance,t.gesture.startAngle=n.angle;else if(a||t.pointers.length<2){var c=t.prevEvent;n.distance=c.distance,n.box=c.box,n.scale=c.scale,n.ds=0,n.angle=c.angle,n.da=0}else n.distance=oe(r,s),n.box=re(r),n.scale=n.distance/t.gesture.startDistance,n.angle=ae(r,s),n.ds=n.scale-t.gesture.scale,n.da=n.angle-t.gesture.angle;t.gesture.distance=n.distance,t.gesture.angle=n.angle,f.number(n.scale)&&n.scale!==1/0&&!isNaN(n.scale)&&(t.gesture.scale=n.scale)}}var pe={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.gesturable=function(r){return f.object(r)?(this.options.gesture.enabled=r.enabled!==!1,this.setPerAction("gesture",r),this.setOnEvents("gesture",r),this):f.bool(r)?(this.options.gesture.enabled=r,this):this.options.gesture},t.map.gesture=pe,t.methodDict.gesture="gesturable",i.actions.gesture=pe.defaults},listeners:{"interactions:action-start":ue,"interactions:action-move":ue,"interactions:action-end":ue,"interactions:new":function(e){e.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(e){if(!(e.interaction.pointers.length<2)){var t=e.interactable.options.gesture;if(t&&t.enabled)return e.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(e){return e.search("gesture")===0}},Yn=pe;function Hn(e,t,n,i,r,o,a){if(!t)return!1;if(t===!0){var s=f.number(o.width)?o.width:o.right-o.left,c=f.number(o.height)?o.height:o.bottom-o.top;if(a=Math.min(a,Math.abs((e==="left"||e==="right"?s:c)/2)),s<0&&(e==="left"?e="right":e==="right"&&(e="left")),c<0&&(e==="top"?e="bottom":e==="bottom"&&(e="top")),e==="left"){var u=s>=0?o.left:o.right;return n.x=0?o.top:o.bottom;return n.y(s>=0?o.right:o.left)-a;if(e==="bottom")return n.y>(c>=0?o.bottom:o.top)-a}return!!f.element(i)&&(f.element(t)?t===i:Zt(i,t,r))}function Qe(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.resizeAxes){var i=t;n.interactable.options.resize.square?(n.resizeAxes==="y"?i.delta.x=i.delta.y:i.delta.y=i.delta.x,i.axes="xy"):(i.axes=n.resizeAxes,n.resizeAxes==="x"?i.delta.y=0:n.resizeAxes==="y"&&(i.delta.x=0))}}var Q,pt,Z={id:"actions/resize",before:["actions/drag"],install:function(e){var t=e.actions,n=e.browser,i=e.Interactable,r=e.defaults;Z.cursors=function(o){return o.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(n),Z.defaultMargin=n.supportsTouch||n.supportsPointerEvent?20:10,i.prototype.resizable=function(o){return function(a,s,c){return f.object(s)?(a.options.resize.enabled=s.enabled!==!1,a.setPerAction("resize",s),a.setOnEvents("resize",s),f.string(s.axis)&&/^x$|^y$|^xy$/.test(s.axis)?a.options.resize.axis=s.axis:s.axis===null&&(a.options.resize.axis=c.defaults.actions.resize.axis),f.bool(s.preserveAspectRatio)?a.options.resize.preserveAspectRatio=s.preserveAspectRatio:f.bool(s.square)&&(a.options.resize.square=s.square),a):f.bool(s)?(a.options.resize.enabled=s,a):a.options.resize}(this,o,e)},t.map.resize=Z,t.methodDict.resize="resizable",r.actions.resize=Z.defaults},listeners:{"interactions:new":function(e){e.interaction.resizeAxes="xy"},"interactions:action-start":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.rect;i._rects={start:w({},o),corrected:w({},o),previous:w({},o),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},r.edges=i.prepared.edges,r.rect=i._rects.corrected,r.deltaRect=i._rects.delta}})(e),Qe(e)},"interactions:action-move":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.interactable.options.resize.invert,a=o==="reposition"||o==="negate",s=i.rect,c=i._rects,u=c.start,l=c.corrected,p=c.delta,d=c.previous;if(w(d,l),a){if(w(l,s),o==="reposition"){if(l.top>l.bottom){var v=l.top;l.top=l.bottom,l.bottom=v}if(l.left>l.right){var h=l.left;l.left=l.right,l.right=h}}}else l.top=Math.min(s.top,u.bottom),l.bottom=Math.max(s.bottom,u.top),l.left=Math.min(s.left,u.right),l.right=Math.max(s.right,u.left);for(var g in l.width=l.right-l.left,l.height=l.bottom-l.top,l)p[g]=l[g]-d[g];r.edges=i.prepared.edges,r.rect=l,r.deltaRect=p}})(e),Qe(e)},"interactions:action-end":function(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.prepared.edges){var i=t;i.edges=n.prepared.edges,i.rect=n._rects.corrected,i.deltaRect=n._rects.delta}},"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.element,r=e.rect,o=e.buttons;if(r){var a=w({},t.coords.cur.page),s=n.options.resize;if(s&&s.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||o&s.mouseButtons)){if(f.object(s.edges)){var c={left:!1,right:!1,top:!1,bottom:!1};for(var u in c)c[u]=Hn(u,s.edges[u],a,t._latestPointer.eventTarget,i,r,s.margin||Z.defaultMargin);c.left=c.left&&!c.right,c.top=c.top&&!c.bottom,(c.left||c.right||c.top||c.bottom)&&(e.action={name:"resize",edges:c})}else{var l=s.axis!=="y"&&a.x>r.right-Z.defaultMargin,p=s.axis!=="x"&&a.y>r.bottom-Z.defaultMargin;(l||p)&&(e.action={name:"resize",axes:(l?"x":"")+(p?"y":"")})}return!e.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(e){var t=e.edges,n=e.axis,i=e.name,r=Z.cursors,o=null;if(n)o=r[i+n];else if(t){for(var a="",s=0,c=["top","bottom","left","right"];s=1){var u={x:k.x*c,y:k.y*c};if(u.x||u.y){var l=en(o);f.window(o)?o.scrollBy(u.x,u.y):o&&(o.scrollLeft+=u.x,o.scrollTop+=u.y);var p=en(o),d={x:p.x-l.x,y:p.y-l.y};(d.x||d.y)&&t.fire({type:"autoscroll",target:n,interactable:t,delta:d,interaction:e,container:o})}k.prevTime=a}k.isScrolling&&(nt.cancel(k.i),k.i=nt.request(k.scroll))},check:function(e,t){var n;return(n=e.options[t].autoScroll)==null?void 0:n.enabled},onInteractionMove:function(e){var t=e.interaction,n=e.pointer;if(t.interacting()&&k.check(t.interactable,t.prepared.name))if(t.simulation)k.x=k.y=0;else{var i,r,o,a,s=t.interactable,c=t.element,u=t.prepared.name,l=s.options[u].autoScroll,p=tn(l.container,s,c);if(f.window(p))a=n.clientXp.innerWidth-k.margin,o=n.clientY>p.innerHeight-k.margin;else{var d=te(p);a=n.clientXd.right-k.margin,o=n.clientY>d.bottom-k.margin}k.x=r?1:a?-1:0,k.y=o?1:i?-1:0,k.isScrolling||(k.margin=l.margin,k.speed=l.speed,k.start(t))}}};function tn(e,t,n){return(f.string(e)?Le(e,t,n):e)||N(n)}function en(e){return f.window(e)&&(e=window.document.body),{x:e.scrollLeft,y:e.scrollTop}}var qn={id:"auto-scroll",install:function(e){var t=e.defaults,n=e.actions;e.autoScroll=k,k.now=function(){return e.now()},n.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=k.defaults},listeners:{"interactions:new":function(e){e.interaction.autoScroll=null},"interactions:destroy":function(e){e.interaction.autoScroll=null,k.stop(),k.interaction&&(k.interaction=null)},"interactions:stop":k.stop,"interactions:action-move":function(e){return k.onInteractionMove(e)}}},Vn=qn;function kt(e,t){var n=!1;return function(){return n||(ct.console.warn(t),n=!0),e.apply(this,arguments)}}function de(e,t){return e.name=t.name,e.axis=t.axis,e.edges=t.edges,e}function Wn(e){return f.bool(e)?(this.options.styleCursor=e,this):e===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Un(e){return f.func(e)?(this.options.actionChecker=e,this):e===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Gn={id:"auto-start/interactableMethods",install:function(e){var t=e.Interactable;t.prototype.getAction=function(n,i,r,o){var a=function(s,c,u,l,p){var d=s.getRect(l),v=c.buttons||{0:1,1:4,3:8,4:16}[c.button],h={action:null,interactable:s,interaction:u,element:l,rect:d,buttons:v};return p.fire("auto-start:check",h),h.action}(this,i,r,o,e);return this.options.actionChecker?this.options.actionChecker(n,i,a,this,o,r):a},t.prototype.ignoreFrom=kt(function(n){return this._backCompatOption("ignoreFrom",n)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=kt(function(n){return this._backCompatOption("allowFrom",n)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Un,t.prototype.styleCursor=Wn}};function nn(e,t,n,i,r){return t.testIgnoreAllow(t.options[e.name],n,i)&&t.options[e.name].enabled&&Yt(t,n,e,r)?e:null}function $n(e,t,n,i,r,o,a){for(var s=0,c=i.length;s=s||v.interactable===e&&((u+=h===n.name?1:0)>=o||v.element===t&&(l++,h===n.name&&l>=a))))return!1}return s>0}function an(e,t){return f.number(e)?(t.autoStart.maxInteractions=e,this):t.autoStart.maxInteractions}function fe(e,t,n){var i=n.autoStart.cursorElement;i&&i!==e&&(i.style.cursor=""),e.ownerDocument.documentElement.style.cursor=t,e.style.cursor=t,n.autoStart.cursorElement=t?e:null}function sn(e,t){var n=e.interactable,i=e.element,r=e.prepared;if(e.pointerType==="mouse"&&n&&n.options.styleCursor){var o="";if(r.name){var a=n.options[r.name].cursorChecker;o=f.func(a)?a(r,n,i,e._interacting):t.actions.map[r.name].getCursor(r)}fe(e.element,o||"",t)}else t.autoStart.cursorElement&&fe(t.autoStart.cursorElement,"",t)}var Nn={id:"auto-start/base",before:["actions"],install:function(e){var t=e.interactStatic,n=e.defaults;e.usePlugin(Gn),n.base.actionChecker=null,n.base.styleCursor=!0,w(n.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(i){return an(i,e)},e.autoStart={maxInteractions:1/0,withinInteractionLimit:Yt,cursorElement:null}},listeners:{"interactions:down":function(e,t){var n=e.interaction,i=e.pointer,r=e.event,o=e.eventTarget;n.interacting()||on(n,rn(n,i,r,o,t),t)},"interactions:move":function(e,t){(function(n,i){var r=n.interaction,o=n.pointer,a=n.event,s=n.eventTarget;r.pointerType!=="mouse"||r.pointerIsDown||r.interacting()||on(r,rn(r,o,a,s,i),i)})(e,t),function(n,i){var r=n.interaction;if(r.pointerIsDown&&!r.interacting()&&r.pointerWasMoved&&r.prepared.name){i.fire("autoStart:before-start",n);var o=r.interactable,a=r.prepared.name;a&&o&&(o.options[a].manualStart||!Yt(o,r.element,r.prepared,i)?r.stop():(r.start(r.prepared,o,r.element),sn(r,i)))}}(e,t)},"interactions:stop":function(e,t){var n=e.interaction,i=n.interactable;i&&i.options.styleCursor&&fe(n.element,"",t)}},maxInteractions:an,withinInteractionLimit:Yt,validateAction:nn},he=Nn,Jn={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(e,t){var n=e.interaction,i=e.eventTarget,r=e.dx,o=e.dy;if(n.prepared.name==="drag"){var a=Math.abs(r),s=Math.abs(o),c=n.interactable.options.drag,u=c.startAxis,l=a>s?"x":a0&&(t.autoStartHoldTimer=setTimeout(function(){t.start(t.prepared,t.interactable,t.element)},n))},"interactions:move":function(e){var t=e.interaction,n=e.duplicate;t.autoStartHoldTimer&&t.pointerWasMoved&&!n&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":function(e){var t=e.interaction;ve(t)>0&&(t.prepared.name=null)}},getHoldDuration:ve},Zn=Qn,ti={id:"auto-start",install:function(e){e.usePlugin(he),e.usePlugin(Zn),e.usePlugin(Jn)}},ei=function(e){return/^(always|never|auto)$/.test(e)?(this.options.preventDefault=e,this):f.bool(e)?(this.options.preventDefault=e?"always":"never",this):this.options.preventDefault};function ni(e){var t=e.interaction,n=e.event;t.interactable&&t.interactable.checkAndPreventDefault(n)}var cn={id:"core/interactablePreventDefault",install:function(e){var t=e.Interactable;t.prototype.preventDefault=ei,t.prototype.checkAndPreventDefault=function(n){return function(i,r,o){var a=i.options.preventDefault;if(a!=="never")if(a!=="always"){if(r.events.supportsPassive&&/^touch(start|move)$/.test(o.type)){var s=N(o.target).document,c=r.getDocOptions(s);if(!c||!c.events||c.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(o.type)||f.element(o.target)&&et(o.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||o.preventDefault()}else o.preventDefault()}(this,e,n)},e.interactions.docEvents.push({type:"dragstart",listener:function(n){for(var i=0,r=e.interactions.list;i150)return null;var r=180*Math.atan2(i.prevEvent.velocityY,i.prevEvent.velocityX)/Math.PI;r<0&&(r+=360);var o=112.5<=r&&r<247.5,a=202.5<=r&&r<337.5;return{up:a,down:!a&&22.5<=r&&r<157.5,left:o,right:!o&&(292.5<=r||r<67.5),angle:r,speed:i.prevEvent.speed,velocity:{x:i.prevEvent.velocityX,y:i.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),n}(Bt);Object.defineProperties(me.prototype,{pageX:{get:function(){return this.page.x},set:function(e){this.page.x=e}},pageY:{get:function(){return this.page.y},set:function(e){this.page.y=e}},clientX:{get:function(){return this.client.x},set:function(e){this.client.x=e}},clientY:{get:function(){return this.client.y},set:function(e){this.client.y=e}},dx:{get:function(){return this.delta.x},set:function(e){this.delta.x=e}},dy:{get:function(){return this.delta.y},set:function(e){this.delta.y=e}},velocityX:{get:function(){return this.velocity.x},set:function(e){this.velocity.x=e}},velocityY:{get:function(){return this.velocity.y},set:function(e){this.velocity.y=e}}});var ri=P(function e(t,n,i,r,o){D(this,e),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=t,this.pointer=n,this.event=i,this.downTime=r,this.downTarget=o}),oi=function(e){return e.interactable="",e.element="",e.prepared="",e.pointerIsDown="",e.pointerWasMoved="",e._proxy="",e}({}),pn=function(e){return e.start="",e.move="",e.end="",e.stop="",e.interacting="",e}({}),ai=0,si=function(){function e(t){var n=this,i=t.pointerType,r=t.scopeFire;D(this,e),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=kt(function(l){this.move(l)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=ai++,this._scopeFire=r,this.pointerType=i;var o=this;this._proxy={};var a=function(l){Object.defineProperty(n._proxy,l,{get:function(){return o[l]}})};for(var s in oi)a(s);var c=function(l){Object.defineProperty(n._proxy,l,{value:function(){return o[l].apply(o,arguments)}})};for(var u in pn)c(u);this._scopeFire("interactions:new",{interaction:this})}return P(e,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,n,i){var r=this.updatePointer(t,n,i,!0),o=this.pointers[r];this._scopeFire("interactions:down",{pointer:t,event:n,eventTarget:i,pointerIndex:r,pointerInfo:o,type:"down",interaction:this})}},{key:"start",value:function(t,n,i){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!n.options[t.name].enabled)&&(de(this.prepared,t),this.interactable=n,this.element=i,this.rect=n.getRect(i),this.edges=this.prepared.edges?w({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(t,n,i){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,n,i,!1);var r,o,a=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(r=this.coords.cur.client.x-this.coords.start.client.x,o=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=bt(r,o)>this.pointerMoveTolerance);var s,c,u,l=this.getPointerIndex(t),p={pointer:t,pointerIndex:l,pointerInfo:this.pointers[l],event:n,type:"move",eventTarget:i,dx:r,dy:o,duplicate:a,interaction:this};a||(s=this.coords.velocity,c=this.coords.delta,u=Math.max(c.timeStamp/1e3,.001),s.page.x=c.page.x/u,s.page.y=c.page.y/u,s.client.x=c.client.x/u,s.client.y=c.client.y/u,s.timeStamp=u),this._scopeFire("interactions:move",p),a||this.simulation||(this.interacting()&&(p.type=null,this.move(p)),this.pointerWasMoved&&Ft(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||Ye(this.coords.delta),(t=w({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,n,i,r){var o=this.getPointerIndex(t);o===-1&&(o=this.updatePointer(t,n,i,!1));var a=/cancel$/i.test(n.type)?"cancel":"up";this._scopeFire("interactions:".concat(a),{pointer:t,pointerIndex:o,pointerInfo:this.pointers[o],event:n,eventTarget:i,type:a,curEventTarget:r,interaction:this}),this.simulation||this.end(n),this.removePointer(t,n)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var n;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(n=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,n===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var n=xt(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:wt(this.pointers,function(i){return i.id===n})}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,n,i,r){var o,a,s,c=xt(t),u=this.getPointerIndex(t),l=this.pointers[u];return r=r!==!1&&(r||/(down|start)$/i.test(n.type)),l?l.pointer=t:(l=new ri(c,t,n,null,null),u=this.pointers.length,this.pointers.push(l)),Ln(this.coords.cur,this.pointers.map(function(p){return p.pointer}),this._now()),o=this.coords.delta,a=this.coords.prev,s=this.coords.cur,o.page.x=s.page.x-a.page.x,o.page.y=s.page.y-a.page.y,o.client.x=s.client.x-a.client.x,o.client.y=s.client.y-a.client.y,o.timeStamp=s.timeStamp-a.timeStamp,r&&(this.pointerIsDown=!0,l.downTime=this.coords.cur.timeStamp,l.downTarget=i,jt(this.downPointer,t),this.interacting()||(Ft(this.coords.start,this.coords.cur),Ft(this.coords.prev,this.coords.cur),this.downEvent=n,this.pointerWasMoved=!1)),this._updateLatestPointer(t,n,i),this._scopeFire("interactions:update-pointer",{pointer:t,event:n,eventTarget:i,down:r,pointerInfo:l,pointerIndex:u,interaction:this}),u}},{key:"removePointer",value:function(t,n){var i=this.getPointerIndex(t);if(i!==-1){var r=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:t,event:n,eventTarget:null,pointerIndex:i,pointerInfo:r,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,n,i){this._latestPointer.pointer=t,this._latestPointer.event=n,this._latestPointer.eventTarget=i}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,n,i,r){return new me(this,t,this.prepared.name,n,this.element,i,r)}},{key:"_fireEvent",value:function(t){var n;(n=this.interactable)==null||n.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var n=t.event,i=t.phase,r=t.preEnd,o=t.type,a=this.rect;if(a&&i==="move"&&(Rt(this.edges,a,this.coords.delta[this.interactable.options.deltaSource]),a.width=a.right-a.left,a.height=a.bottom-a.top),this._scopeFire("interactions:before-action-".concat(i),t)===!1)return!1;var s=t.iEvent=this._createPreparedEvent(n,i,r,o);return this._scopeFire("interactions:action-".concat(i),t),i==="start"&&(this.prevEvent=s),this._fireEvent(s),this._scopeFire("interactions:after-action-".concat(i),t),!0}},{key:"_now",value:function(){return Date.now()}}]),e}();function dn(e){fn(e.interaction)}function fn(e){if(!function(n){return!(!n.offset.pending.x&&!n.offset.pending.y)}(e))return!1;var t=e.offset.pending;return ye(e.coords.cur,t),ye(e.coords.delta,t),Rt(e.edges,e.rect,t),t.x=0,t.y=0,!0}function ci(e){var t=e.x,n=e.y;this.offset.pending.x+=t,this.offset.pending.y+=n,this.offset.total.x+=t,this.offset.total.y+=n}function ye(e,t){var n=e.page,i=e.client,r=t.x,o=t.y;n.x+=r,n.y+=o,i.x+=r,i.y+=o}pn.offsetBy="";var li={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(e){e.Interaction.prototype.offsetBy=ci},listeners:{"interactions:new":function(e){e.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(e){return function(t){t.pointerIsDown&&(ye(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}(e.interaction)},"interactions:before-action-start":dn,"interactions:before-action-move":dn,"interactions:before-action-end":function(e){var t=e.interaction;if(fn(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop":function(e){var t=e.interaction;t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}},hn=li,ui=function(){function e(t){D(this,e),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=t}return P(e,[{key:"start",value:function(t){var n=this.interaction,i=Xt(n);if(!i||!i.enabled)return!1;var r=n.coords.velocity.client,o=bt(r.x,r.y),a=this.modification||(this.modification=new ge(n));if(a.copyFrom(n.modification),this.t0=n._now(),this.allowResume=i.allowResume,this.v0=o,this.currentOffset={x:0,y:0},this.startCoords=n.coords.cur.page,this.modifierArg=a.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-n.coords.cur.timeStamp<50&&o>i.minSpeed&&o>i.endSpeed)this.startInertia();else{if(a.result=a.setAll(this.modifierArg),!a.result.changed)return!1;this.startSmoothEnd()}return n.modification.result.rect=null,n.offsetBy(this.targetOffset),n._doPhase({interaction:n,event:t,phase:"inertiastart"}),n.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),n.modification.result.rect=null,this.active=!0,n.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,n=this.interaction.coords.velocity.client,i=Xt(this.interaction),r=i.resistance,o=-Math.log(i.endSpeed/this.v0)/r;this.targetOffset={x:(n.x-o)/r,y:(n.y-o)/r},this.te=o,this.lambda_v0=r/this.v0,this.one_ve_v0=1-i.endSpeed/this.v0;var a=this.modification,s=this.modifierArg;s.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},a.result=a.setAll(s),a.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+a.result.delta.x,y:this.targetOffset.y+a.result.delta.y}),this.onNextFrame(function(){return t.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return t.smoothEndTick()})}},{key:"onNextFrame",value:function(t){var n=this;this.timeout=nt.request(function(){n.active&&t()})}},{key:"inertiaTick",value:function(){var t,n,i,r,o,a,s,c=this,u=this.interaction,l=Xt(u).resistance,p=(u._now()-this.t0)/1e3;if(p=0;g--){var T=m[g];if(T.selector===l&&T.context===p){for(var S=T.listeners,E=S.length-1;E>=0;E--){var z=S[E];if(z.func===v&&qt(z.options,b)){S.splice(E,1),S.length||(m.splice(g,1),s(p,d,c),s(p,d,u,!0)),x=!0;break}}if(x)break}}},delegateListener:c,delegateUseCapture:u,delegatedEvents:i,documents:r,targets:n,supportsOptions:!1,supportsPassive:!1};function a(l,p,d,v){if(l.addEventListener){var h=zt(v),g=Et(n,function(b){return b.eventTarget===l});g||(g={eventTarget:l,events:{}},n.push(g)),g.events[p]||(g.events[p]=[]),Et(g.events[p],function(b){return b.func===d&&qt(b.options,h)})||(l.addEventListener(p,d,o.supportsOptions?h:h.capture),g.events[p].push({func:d,options:h}))}}function s(l,p,d,v){if(l.addEventListener&&l.removeEventListener){var h=wt(n,function(L){return L.eventTarget===l}),g=n[h];if(g&&g.events)if(p!=="all"){var b=!1,m=g.events[p];if(m){if(d==="all"){for(var x=m.length-1;x>=0;x--){var T=m[x];s(l,p,T.func,T.options)}return}for(var S=zt(v),E=0;E=2)continue;if(!r.interacting()&&t===r.pointerType)return r}return null}};function bn(e,t){return e.pointers.some(function(n){return n.id===t})}var vi=be,xe=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function xn(e,t){return function(n){var i=t.interactions.list,r=qe(n),o=Ve(n),a=o[0],s=o[1],c=[];if(/^touch/.test(n.type)){t.prevTouchTime=t.now();for(var u=0,l=n.changedTouches;u=0;i--){var r=t.interactions.list[i];r.interactable===n&&(r.stop(),t.fire("interactions:destroy",{interaction:r}),r.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(i,1))}}},onDocSignal:we,doOnInteractions:xn,methodNames:xe},mi=gi,rt=function(e){return e[e.On=0]="On",e[e.Off=1]="Off",e}(rt||{}),yi=function(){function e(t,n,i,r){D(this,e),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new yn,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=n.actions,this.target=t,this._context=n.context||i,this._win=N(Fe(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=r,this.set(n)}return P(e,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(t,n){return f.func(n.onstart)&&this.on("".concat(t,"start"),n.onstart),f.func(n.onmove)&&this.on("".concat(t,"move"),n.onmove),f.func(n.onend)&&this.on("".concat(t,"end"),n.onend),f.func(n.oninertiastart)&&this.on("".concat(t,"inertiastart"),n.oninertiastart),this}},{key:"updatePerActionListeners",value:function(t,n,i){var r,o=this,a=(r=this._actions.map[t])==null?void 0:r.filterEventType,s=function(c){return(a==null||a(c))&&Ht(c,o._actions)};(f.array(n)||f.object(n))&&this._onOff(rt.Off,t,n,void 0,s),(f.array(i)||f.object(i))&&this._onOff(rt.On,t,i,void 0,s)}},{key:"setPerAction",value:function(t,n){var i=this._defaults;for(var r in n){var o=r,a=this.options[t],s=n[o];o==="listeners"&&this.updatePerActionListeners(t,a.listeners,s),f.array(s)?a[o]=Ue(s):f.plainObject(s)?(a[o]=w(a[o]||{},vt(s)),f.object(i.perAction[o])&&"enabled"in i.perAction[o]&&(a[o].enabled=s.enabled!==!1)):f.bool(s)&&f.object(i.perAction[o])?a[o].enabled=s:a[o]=s}}},{key:"getRect",value:function(t){return t=t||(f.element(this.target)?this.target:null),f.string(this.target)&&(t=t||this._context.querySelector(this.target)),ee(t)}},{key:"rectChecker",value:function(t){var n=this;return f.func(t)?(this.getRect=function(i){var r=w({},t.apply(n,i));return"width"in r||(r.width=r.right-r.left,r.height=r.bottom-r.top),r},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,n){if(Fe(n)||f.object(n)){for(var i in this.options[t]=n,this._actions.map)this.options[i][t]=n;return this}return this.options[t]}},{key:"origin",value:function(t){return this._backCompatOption("origin",t)}},{key:"deltaSource",value:function(t){return t==="page"||t==="client"?(this.options.deltaSource=t,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var t=this.target;return f.string(t)?Array.from(this._context.querySelectorAll(t)):f.func(t)&&t.getAllElements?t.getAllElements():f.element(t)?[t]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(t){return this._context===t.ownerDocument||lt(this._context,t)}},{key:"testIgnoreAllow",value:function(t,n,i){return!this.testIgnore(t.ignoreFrom,n,i)&&this.testAllow(t.allowFrom,n,i)}},{key:"testAllow",value:function(t,n,i){return!t||!!f.element(i)&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"testIgnore",value:function(t,n,i){return!(!t||!f.element(i))&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,n,i,r,o){f.object(n)&&!f.array(n)&&(r=i,i=null);var a=ut(n,i,o);for(var s in a){s==="wheel"&&(s=U.wheelEvent);for(var c=0,u=a[s];c=0;i--){var r=n[i],o=r.selector,a=r.context,s=r.listeners;o===this.target&&a===this._context&&n.splice(i,1);for(var c=s.length-1;c>=0;c--)this._scopeEvents.removeDelegate(this.target,this._context,t,s[c][0],s[c][1])}else this._scopeEvents.remove(this.target,"all")}}]),e}(),bi=function(){function e(t){var n=this;D(this,e),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=t,t.addListeners({"interactable:unset":function(i){var r=i.interactable,o=r.target,a=f.string(o)?n.selectorMap[o]:o[n.scope.id],s=wt(a,function(c){return c===r});a.splice(s,1)}})}return P(e,[{key:"new",value:function(t,n){n=w(n||{},{actions:this.scope.actions});var i=new this.scope.Interactable(t,n,this.scope.document,this.scope.events);return this.scope.addDocument(i._doc),this.list.push(i),f.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(i)):(i.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(i)),this.scope.fire("interactable:new",{target:t,options:n,interactable:i,win:this.scope._win}),i}},{key:"getExisting",value:function(t,n){var i=n&&n.context||this.scope.document,r=f.string(t),o=r?this.selectorMap[t]:t[this.scope.id];if(o)return Et(o,function(a){return a._context===i&&(r||a.inContext(t))})}},{key:"forEachMatch",value:function(t,n){for(var i=0,r=this.list;iMath.abs(u.y),c.coords,c.rect),w(i,c.coords)),c.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Si(e,t,n){var i=e.startCoords,r=e.edgeSign;t?n.y=i.y+(n.x-i.x)*r.y:n.x=i.x+(n.y-i.y)*r.x}function Pi(e,t,n,i){var r=e.startRect,o=e.startCoords,a=e.ratio,s=e.edgeSign;if(t){var c=i.width/a;n.y=o.y+(c-r.height)*s.y}else{var u=i.height*a;n.x=o.x+(u-r.width)*s.x}}var Di=it(zi,"aspectRatio"),Tn=function(){};Tn._defaults={};var Vt=Tn;function dt(e,t,n){return f.func(e)?mt(e,t.interactable,t.element,[n.x,n.y,t]):mt(e,t.interactable,t.element)}var Wt={start:function(e){var t=e.rect,n=e.startOffset,i=e.state,r=e.interaction,o=e.pageCoords,a=i.options,s=a.elementRect,c=w({left:0,top:0,right:0,bottom:0},a.offset||{});if(t&&s){var u=dt(a.restriction,r,o);if(u){var l=u.right-u.left-t.width,p=u.bottom-u.top-t.height;l<0&&(c.left+=l,c.right+=l),p<0&&(c.top+=p,c.bottom+=p)}c.left+=n.left-t.width*s.left,c.top+=n.top-t.height*s.top,c.right+=n.right-t.width*(1-s.right),c.bottom+=n.bottom-t.height*(1-s.bottom)}i.offset=c},set:function(e){var t=e.coords,n=e.interaction,i=e.state,r=i.options,o=i.offset,a=dt(r.restriction,n,t);if(a){var s=function(c){return!c||"left"in c&&"top"in c||((c=w({},c)).left=c.x||0,c.top=c.y||0,c.right=c.right||c.left+c.width,c.bottom=c.bottom||c.top+c.height),c}(a);t.x=Math.max(Math.min(s.right-o.right,t.x),s.left+o.left),t.y=Math.max(Math.min(s.bottom-o.bottom,t.y),s.top+o.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Oi=it(Wt,"restrict"),zn={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Sn={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Pn(e,t){for(var n=0,i=["top","left","bottom","right"];n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var n,i=B(e);if(t){var r=B(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return function(o,a){if(a&&(typeof a=="object"||typeof a=="function"))return a;if(a!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _t(o)}(this,n)}}function It(){return It=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(o,a){for(;!Object.prototype.hasOwnProperty.call(o,a)&&(o=B(o))!==null;);return o}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},It.apply(this,arguments)}function Se(e){var t=function(n,i){if(typeof n!="object"||n===null)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var o=r.call(n,i);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(e,"string");return typeof t=="symbol"?t:t+""}var Pe=function(e){return!(!e||!e.Window)&&e instanceof e.Window},De=void 0,ct=void 0;function Oe(e){De=e;var t=e.document.createTextNode("");t.ownerDocument!==e.document&&typeof e.wrap=="function"&&e.wrap(t)===t&&(e=e.wrap(e)),ct=e}function N(e){return Pe(e)?e:(e.ownerDocument||e).defaultView||ct.window}typeof window<"u"&&window&&Oe(window);var Mt=function(e){return!!e&&I(e)==="object"},_e=function(e){return typeof e=="function"},f={window:function(e){return e===ct||Pe(e)},docFrag:function(e){return Mt(e)&&e.nodeType===11},object:Mt,func:_e,number:function(e){return typeof e=="number"},bool:function(e){return typeof e=="boolean"},string:function(e){return typeof e=="string"},element:function(e){if(!e||I(e)!=="object")return!1;var t=N(e)||ct;return/object|function/.test(typeof Element>"u"?"undefined":I(Element))?e instanceof Element||e instanceof t.Element:e.nodeType===1&&typeof e.nodeName=="string"},plainObject:function(e){return Mt(e)&&!!e.constructor&&/function Object\b/.test(e.constructor.toString())},array:function(e){return Mt(e)&&e.length!==void 0&&_e(e.splice)}};function Jt(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.prepared.axis;n==="x"?(t.coords.cur.page.y=t.coords.start.page.y,t.coords.cur.client.y=t.coords.start.client.y,t.coords.velocity.client.y=0,t.coords.velocity.page.y=0):n==="y"&&(t.coords.cur.page.x=t.coords.start.page.x,t.coords.cur.client.x=t.coords.start.client.x,t.coords.velocity.client.x=0,t.coords.velocity.page.x=0)}}function Ie(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="drag"){var i=n.prepared.axis;if(i==="x"||i==="y"){var r=i==="x"?"y":"x";t.page[r]=n.coords.start.page[r],t.client[r]=n.coords.start.client[r],t.delta[r]=0}}}var Ct={id:"actions/drag",install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.draggable=Ct.draggable,t.map.drag=Ct,t.methodDict.drag="draggable",i.actions.drag=Ct.defaults},listeners:{"interactions:before-action-move":Jt,"interactions:action-resume":Jt,"interactions:action-move":Ie,"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.buttons,r=n.options.drag;if(r&&r.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||i&n.options.drag.mouseButtons))return e.action={name:"drag",axis:r.lockAxis==="start"?r.startAxis:r.lockAxis},!1}},draggable:function(e){return f.object(e)?(this.options.drag.enabled=e.enabled!==!1,this.setPerAction("drag",e),this.setOnEvents("drag",e),/^(xy|x|y|start)$/.test(e.lockAxis)&&(this.options.drag.lockAxis=e.lockAxis),/^(xy|x|y)$/.test(e.startAxis)&&(this.options.drag.startAxis=e.startAxis),this):f.bool(e)?(this.options.drag.enabled=e,this):this.options.drag},beforeMove:Jt,move:Ie,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(e){return e.search("drag")===0}},Me=Ct,X={init:function(e){var t=e;X.document=t.document,X.DocumentFragment=t.DocumentFragment||ft,X.SVGElement=t.SVGElement||ft,X.SVGSVGElement=t.SVGSVGElement||ft,X.SVGElementInstance=t.SVGElementInstance||ft,X.Element=t.Element||ft,X.HTMLElement=t.HTMLElement||X.Element,X.Event=t.Event,X.Touch=t.Touch||ft,X.PointerEvent=t.PointerEvent||t.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function ft(){}var R=X,q={init:function(e){var t=R.Element,n=e.navigator||{};q.supportsTouch="ontouchstart"in e||f.func(e.DocumentTouch)&&R.document instanceof e.DocumentTouch,q.supportsPointerEvent=n.pointerEnabled!==!1&&!!R.PointerEvent,q.isIOS=/iP(hone|od|ad)/.test(n.platform),q.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),q.isIe9=/MSIE 9/.test(n.userAgent),q.isOperaMobile=n.appName==="Opera"&&q.supportsTouch&&/Presto/.test(n.userAgent),q.prefixedMatchesSelector="matches"in t.prototype?"matches":"webkitMatchesSelector"in t.prototype?"webkitMatchesSelector":"mozMatchesSelector"in t.prototype?"mozMatchesSelector":"oMatchesSelector"in t.prototype?"oMatchesSelector":"msMatchesSelector",q.pEventTypes=q.supportsPointerEvent?R.PointerEvent===e.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,q.wheelEvent=R.document&&"onmousewheel"in R.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},U=q;function lt(e,t){if(e.contains)return e.contains(t);for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Ce(e,t){for(;f.element(e);){if(et(e,t))return e;e=J(e)}return null}function J(e){var t=e.parentNode;if(f.docFrag(t)){for(;(t=t.host)&&f.docFrag(t););return t}return t}function et(e,t){return ct!==De&&(t=t.replace(/\/deep\//g," ")),e[U.prefixedMatchesSelector](t)}var Qt=function(e){return e.parentNode||e.host};function Ae(e,t){for(var n,i=[],r=e;(n=Qt(r))&&r!==t&&n!==r.ownerDocument;)i.unshift(r),r=n;return i}function Zt(e,t,n){for(;f.element(e);){if(et(e,t))return!0;if((e=J(e))===n)return et(e,t)}return!1}function Re(e){return e.correspondingUseElement||e}function te(e){var t=e instanceof R.SVGElement?e.getBoundingClientRect():e.getClientRects()[0];return t&&{left:t.left,right:t.right,top:t.top,bottom:t.bottom,width:t.width||t.right-t.left,height:t.height||t.bottom-t.top}}function ee(e){var t,n=te(e);if(!U.isIOS7&&n){var i={x:(t=(t=N(e))||ct).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop};n.left+=i.x,n.right+=i.x,n.top+=i.y,n.bottom+=i.y}return n}function je(e){for(var t=[];e;)t.push(e),e=J(e);return t}function Fe(e){return!!f.string(e)&&(R.document.querySelector(e),!0)}function w(e,t){for(var n in t)e[n]=t[n];return e}function Le(e,t,n){return e==="parent"?J(n):e==="self"?t.getRect(n):Ce(n,e)}function mt(e,t,n,i){var r=e;return f.string(r)?r=Le(r,t,n):f.func(r)&&(r=r.apply(void 0,i)),f.element(r)&&(r=ee(r)),r}function At(e){return e&&{x:"x"in e?e.x:e.left,y:"y"in e?e.y:e.top}}function ne(e){return!e||"x"in e&&"y"in e||((e=w({},e)).x=e.left||0,e.y=e.top||0,e.width=e.width||(e.right||0)-e.x,e.height=e.height||(e.bottom||0)-e.y),e}function Rt(e,t,n){e.left&&(t.left+=n.x),e.right&&(t.right+=n.x),e.top&&(t.top+=n.y),e.bottom&&(t.bottom+=n.y),t.width=t.right-t.left,t.height=t.bottom-t.top}function yt(e,t,n){var i=n&&e.options[n];return At(mt(i&&i.origin||e.options.origin,e,t,[e&&t]))||{x:0,y:0}}function ut(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(c){return!0},i=arguments.length>3?arguments[3]:void 0;if(i=i||{},f.string(e)&&e.search(" ")!==-1&&(e=Be(e)),f.array(e))return e.forEach(function(c){return ut(c,t,n,i)}),i;if(f.object(e)&&(t=e,e=""),f.func(t)&&n(e))i[e]=i[e]||[],i[e].push(t);else if(f.array(t))for(var r=0,o=t;r1?Xe(t):t[0];Ke(i,e.page),function(r,o){o=o||{},U.isOperaMobile&&He(r)?Lt("screen",r,o):Lt("client",r,o)}(i,e.client),e.timeStamp=n}function ie(e){var t=[];return f.array(e)?(t[0]=e[0],t[1]=e[1]):e.type==="touchend"?e.touches.length===1?(t[0]=e.touches[0],t[1]=e.changedTouches[0]):e.touches.length===0&&(t[0]=e.changedTouches[0],t[1]=e.changedTouches[1]):(t[0]=e.touches[0],t[1]=e.touches[1]),t}function Xe(e){for(var t={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},n=0;n=(parseInt(N(x).getComputedStyle(x).zIndex,10)||0)&&(b=S);else b=S}else b=S}return b}(a);return i.activeDrops[h]||null}function ce(e,t,n){var i=e.dropState,r={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return n.type==="dragstart"&&(r.activate=new ht(i,n,"dropactivate"),r.activate.target=null,r.activate.dropzone=null),n.type==="dragend"&&(r.deactivate=new ht(i,n,"dropdeactivate"),r.deactivate.target=null,r.deactivate.dropzone=null),i.rejected||(i.cur.element!==i.prev.element&&(i.prev.dropzone&&(r.leave=new ht(i,n,"dragleave"),n.dragLeave=r.leave.target=i.prev.element,n.prevDropzone=r.leave.dropzone=i.prev.dropzone),i.cur.dropzone&&(r.enter=new ht(i,n,"dragenter"),n.dragEnter=i.cur.element,n.dropzone=i.cur.dropzone)),n.type==="dragend"&&i.cur.dropzone&&(r.drop=new ht(i,n,"drop"),n.dropzone=i.cur.dropzone,n.relatedTarget=i.cur.element),n.type==="dragmove"&&i.cur.dropzone&&(r.move=new ht(i,n,"dropmove"),n.dropzone=i.cur.dropzone)),r}function le(e,t){var n=e.dropState,i=n.activeDrops,r=n.cur,o=n.prev;t.leave&&o.dropzone.fire(t.leave),t.enter&&r.dropzone.fire(t.enter),t.move&&r.dropzone.fire(t.move),t.drop&&r.dropzone.fire(t.drop),t.deactivate&&Ge(i,t.deactivate),n.prev.dropzone=r.dropzone,n.prev.element=r.element}function Ne(e,t){var n=e.interaction,i=e.iEvent,r=e.event;if(i.type==="dragmove"||i.type==="dragend"){var o=n.dropState;t.dynamicDrop&&(o.activeDrops=se(t,n.element));var a=i,s=$e(n,a,r);o.rejected=o.rejected&&!!s&&s.dropzone===o.cur.dropzone&&s.element===o.cur.element,o.cur.dropzone=s&&s.dropzone,o.cur.element=s&&s.element,o.events=ce(n,0,a)}}var Je={id:"actions/drop",install:function(e){var t=e.actions,n=e.interactStatic,i=e.Interactable,r=e.defaults;e.usePlugin(Me),i.prototype.dropzone=function(o){return function(a,s){if(f.object(s)){if(a.options.drop.enabled=s.enabled!==!1,s.listeners){var c=ut(s.listeners),u=Object.keys(c).reduce(function(p,d){return p[/^(enter|leave)/.test(d)?"drag".concat(d):/^(activate|deactivate|move)/.test(d)?"drop".concat(d):d]=c[d],p},{}),l=a.options.drop.listeners;l&&a.off(l),a.on(u),a.options.drop.listeners=u}return f.func(s.ondrop)&&a.on("drop",s.ondrop),f.func(s.ondropactivate)&&a.on("dropactivate",s.ondropactivate),f.func(s.ondropdeactivate)&&a.on("dropdeactivate",s.ondropdeactivate),f.func(s.ondragenter)&&a.on("dragenter",s.ondragenter),f.func(s.ondragleave)&&a.on("dragleave",s.ondragleave),f.func(s.ondropmove)&&a.on("dropmove",s.ondropmove),/^(pointer|center)$/.test(s.overlap)?a.options.drop.overlap=s.overlap:f.number(s.overlap)&&(a.options.drop.overlap=Math.max(Math.min(1,s.overlap),0)),"accept"in s&&(a.options.drop.accept=s.accept),"checker"in s&&(a.options.drop.checker=s.checker),a}return f.bool(s)?(a.options.drop.enabled=s,a):a.options.drop}(this,o)},i.prototype.dropCheck=function(o,a,s,c,u,l){return function(p,d,v,h,g,b,m){var x=!1;if(!(m=m||p.getRect(b)))return!!p.options.drop.checker&&p.options.drop.checker(d,v,x,p,b,h,g);var T=p.options.drop.overlap;if(T==="pointer"){var S=yt(h,g,"drag"),E=Ke(d);E.x+=S.x,E.y+=S.y;var z=E.x>m.left&&E.xm.top&&E.y=m.left&&Y<=m.right&&G>=m.top&&G<=m.bottom}return _&&f.number(T)&&(x=Math.max(0,Math.min(m.right,_.right)-Math.max(m.left,_.left))*Math.max(0,Math.min(m.bottom,_.bottom)-Math.max(m.top,_.top))/(_.width*_.height)>=T),p.options.drop.checker&&(x=p.options.drop.checker(d,v,x,p,b,h,g)),x}(this,o,a,s,c,u,l)},n.dynamicDrop=function(o){return f.bool(o)?(e.dynamicDrop=o,n):e.dynamicDrop},w(t.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),t.methodDict.drop="dropzone",e.dynamicDrop=!1,r.actions.drop=Je.defaults},listeners:{"interactions:before-action-start":function(e){var t=e.interaction;t.prepared.name==="drag"&&(t.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;r.activeDrops=[],r.events={},r.activeDrops=se(t,n.element),r.events=ce(n,0,i),r.events.activate&&(Ge(r.activeDrops,r.events.activate),t.fire("actions/drop:start",{interaction:n,dragEvent:i}))}},"interactions:action-move":Ne,"interactions:after-action-move":function(e,t){var n=e.interaction,i=e.iEvent;if(n.prepared.name==="drag"){var r=n.dropState;le(n,r.events),t.fire("actions/drop:move",{interaction:n,dragEvent:i}),r.events={}}},"interactions:action-end":function(e,t){if(e.interaction.prepared.name==="drag"){var n=e.interaction,i=e.iEvent;Ne(e,t),le(n,n.dropState.events),t.fire("actions/drop:end",{interaction:n,dragEvent:i})}},"interactions:stop":function(e){var t=e.interaction;if(t.prepared.name==="drag"){var n=t.dropState;n&&(n.activeDrops=null,n.events=null,n.cur.dropzone=null,n.cur.element=null,n.prev.dropzone=null,n.prev.element=null,n.rejected=!1)}}},getActiveDrops:se,getDrop:$e,getDropEvents:ce,fireDropEvents:le,filterEventType:function(e){return e.search("drag")===0||e.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},Bn=Je;function ue(e){var t=e.interaction,n=e.iEvent,i=e.phase;if(t.prepared.name==="gesture"){var r=t.pointers.map(function(u){return u.pointer}),o=i==="start",a=i==="end",s=t.interactable.options.deltaSource;if(n.touches=[r[0],r[1]],o)n.distance=oe(r,s),n.box=re(r),n.scale=1,n.ds=0,n.angle=ae(r,s),n.da=0,t.gesture.startDistance=n.distance,t.gesture.startAngle=n.angle;else if(a||t.pointers.length<2){var c=t.prevEvent;n.distance=c.distance,n.box=c.box,n.scale=c.scale,n.ds=0,n.angle=c.angle,n.da=0}else n.distance=oe(r,s),n.box=re(r),n.scale=n.distance/t.gesture.startDistance,n.angle=ae(r,s),n.ds=n.scale-t.gesture.scale,n.da=n.angle-t.gesture.angle;t.gesture.distance=n.distance,t.gesture.angle=n.angle,f.number(n.scale)&&n.scale!==1/0&&!isNaN(n.scale)&&(t.gesture.scale=n.scale)}}var pe={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(e){var t=e.actions,n=e.Interactable,i=e.defaults;n.prototype.gesturable=function(r){return f.object(r)?(this.options.gesture.enabled=r.enabled!==!1,this.setPerAction("gesture",r),this.setOnEvents("gesture",r),this):f.bool(r)?(this.options.gesture.enabled=r,this):this.options.gesture},t.map.gesture=pe,t.methodDict.gesture="gesturable",i.actions.gesture=pe.defaults},listeners:{"interactions:action-start":ue,"interactions:action-move":ue,"interactions:action-end":ue,"interactions:new":function(e){e.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(e){if(!(e.interaction.pointers.length<2)){var t=e.interactable.options.gesture;if(t&&t.enabled)return e.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(e){return e.search("gesture")===0}},Yn=pe;function Hn(e,t,n,i,r,o,a){if(!t)return!1;if(t===!0){var s=f.number(o.width)?o.width:o.right-o.left,c=f.number(o.height)?o.height:o.bottom-o.top;if(a=Math.min(a,Math.abs((e==="left"||e==="right"?s:c)/2)),s<0&&(e==="left"?e="right":e==="right"&&(e="left")),c<0&&(e==="top"?e="bottom":e==="bottom"&&(e="top")),e==="left"){var u=s>=0?o.left:o.right;return n.x=0?o.top:o.bottom;return n.y(s>=0?o.right:o.left)-a;if(e==="bottom")return n.y>(c>=0?o.bottom:o.top)-a}return!!f.element(i)&&(f.element(t)?t===i:Zt(i,t,r))}function Qe(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.resizeAxes){var i=t;n.interactable.options.resize.square?(n.resizeAxes==="y"?i.delta.x=i.delta.y:i.delta.y=i.delta.x,i.axes="xy"):(i.axes=n.resizeAxes,n.resizeAxes==="x"?i.delta.y=0:n.resizeAxes==="y"&&(i.delta.x=0))}}var Q,pt,Z={id:"actions/resize",before:["actions/drag"],install:function(e){var t=e.actions,n=e.browser,i=e.Interactable,r=e.defaults;Z.cursors=function(o){return o.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(n),Z.defaultMargin=n.supportsTouch||n.supportsPointerEvent?20:10,i.prototype.resizable=function(o){return function(a,s,c){return f.object(s)?(a.options.resize.enabled=s.enabled!==!1,a.setPerAction("resize",s),a.setOnEvents("resize",s),f.string(s.axis)&&/^x$|^y$|^xy$/.test(s.axis)?a.options.resize.axis=s.axis:s.axis===null&&(a.options.resize.axis=c.defaults.actions.resize.axis),f.bool(s.preserveAspectRatio)?a.options.resize.preserveAspectRatio=s.preserveAspectRatio:f.bool(s.square)&&(a.options.resize.square=s.square),a):f.bool(s)?(a.options.resize.enabled=s,a):a.options.resize}(this,o,e)},t.map.resize=Z,t.methodDict.resize="resizable",r.actions.resize=Z.defaults},listeners:{"interactions:new":function(e){e.interaction.resizeAxes="xy"},"interactions:action-start":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.rect;i._rects={start:w({},o),corrected:w({},o),previous:w({},o),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},r.edges=i.prepared.edges,r.rect=i._rects.corrected,r.deltaRect=i._rects.delta}})(e),Qe(e)},"interactions:action-move":function(e){(function(t){var n=t.iEvent,i=t.interaction;if(i.prepared.name==="resize"&&i.prepared.edges){var r=n,o=i.interactable.options.resize.invert,a=o==="reposition"||o==="negate",s=i.rect,c=i._rects,u=c.start,l=c.corrected,p=c.delta,d=c.previous;if(w(d,l),a){if(w(l,s),o==="reposition"){if(l.top>l.bottom){var v=l.top;l.top=l.bottom,l.bottom=v}if(l.left>l.right){var h=l.left;l.left=l.right,l.right=h}}}else l.top=Math.min(s.top,u.bottom),l.bottom=Math.max(s.bottom,u.top),l.left=Math.min(s.left,u.right),l.right=Math.max(s.right,u.left);for(var g in l.width=l.right-l.left,l.height=l.bottom-l.top,l)p[g]=l[g]-d[g];r.edges=i.prepared.edges,r.rect=l,r.deltaRect=p}})(e),Qe(e)},"interactions:action-end":function(e){var t=e.iEvent,n=e.interaction;if(n.prepared.name==="resize"&&n.prepared.edges){var i=t;i.edges=n.prepared.edges,i.rect=n._rects.corrected,i.deltaRect=n._rects.delta}},"auto-start:check":function(e){var t=e.interaction,n=e.interactable,i=e.element,r=e.rect,o=e.buttons;if(r){var a=w({},t.coords.cur.page),s=n.options.resize;if(s&&s.enabled&&(!t.pointerIsDown||!/mouse|pointer/.test(t.pointerType)||o&s.mouseButtons)){if(f.object(s.edges)){var c={left:!1,right:!1,top:!1,bottom:!1};for(var u in c)c[u]=Hn(u,s.edges[u],a,t._latestPointer.eventTarget,i,r,s.margin||Z.defaultMargin);c.left=c.left&&!c.right,c.top=c.top&&!c.bottom,(c.left||c.right||c.top||c.bottom)&&(e.action={name:"resize",edges:c})}else{var l=s.axis!=="y"&&a.x>r.right-Z.defaultMargin,p=s.axis!=="x"&&a.y>r.bottom-Z.defaultMargin;(l||p)&&(e.action={name:"resize",axes:(l?"x":"")+(p?"y":"")})}return!e.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(e){var t=e.edges,n=e.axis,i=e.name,r=Z.cursors,o=null;if(n)o=r[i+n];else if(t){for(var a="",s=0,c=["top","bottom","left","right"];s=1){var u={x:k.x*c,y:k.y*c};if(u.x||u.y){var l=en(o);f.window(o)?o.scrollBy(u.x,u.y):o&&(o.scrollLeft+=u.x,o.scrollTop+=u.y);var p=en(o),d={x:p.x-l.x,y:p.y-l.y};(d.x||d.y)&&t.fire({type:"autoscroll",target:n,interactable:t,delta:d,interaction:e,container:o})}k.prevTime=a}k.isScrolling&&(nt.cancel(k.i),k.i=nt.request(k.scroll))},check:function(e,t){var n;return(n=e.options[t].autoScroll)==null?void 0:n.enabled},onInteractionMove:function(e){var t=e.interaction,n=e.pointer;if(t.interacting()&&k.check(t.interactable,t.prepared.name))if(t.simulation)k.x=k.y=0;else{var i,r,o,a,s=t.interactable,c=t.element,u=t.prepared.name,l=s.options[u].autoScroll,p=tn(l.container,s,c);if(f.window(p))a=n.clientXp.innerWidth-k.margin,o=n.clientY>p.innerHeight-k.margin;else{var d=te(p);a=n.clientXd.right-k.margin,o=n.clientY>d.bottom-k.margin}k.x=r?1:a?-1:0,k.y=o?1:i?-1:0,k.isScrolling||(k.margin=l.margin,k.speed=l.speed,k.start(t))}}};function tn(e,t,n){return(f.string(e)?Le(e,t,n):e)||N(n)}function en(e){return f.window(e)&&(e=window.document.body),{x:e.scrollLeft,y:e.scrollTop}}var qn={id:"auto-scroll",install:function(e){var t=e.defaults,n=e.actions;e.autoScroll=k,k.now=function(){return e.now()},n.phaselessTypes.autoscroll=!0,t.perAction.autoScroll=k.defaults},listeners:{"interactions:new":function(e){e.interaction.autoScroll=null},"interactions:destroy":function(e){e.interaction.autoScroll=null,k.stop(),k.interaction&&(k.interaction=null)},"interactions:stop":k.stop,"interactions:action-move":function(e){return k.onInteractionMove(e)}}},Vn=qn;function kt(e,t){var n=!1;return function(){return n||(ct.console.warn(t),n=!0),e.apply(this,arguments)}}function de(e,t){return e.name=t.name,e.axis=t.axis,e.edges=t.edges,e}function Wn(e){return f.bool(e)?(this.options.styleCursor=e,this):e===null?(delete this.options.styleCursor,this):this.options.styleCursor}function Un(e){return f.func(e)?(this.options.actionChecker=e,this):e===null?(delete this.options.actionChecker,this):this.options.actionChecker}var Gn={id:"auto-start/interactableMethods",install:function(e){var t=e.Interactable;t.prototype.getAction=function(n,i,r,o){var a=function(s,c,u,l,p){var d=s.getRect(l),v=c.buttons||{0:1,1:4,3:8,4:16}[c.button],h={action:null,interactable:s,interaction:u,element:l,rect:d,buttons:v};return p.fire("auto-start:check",h),h.action}(this,i,r,o,e);return this.options.actionChecker?this.options.actionChecker(n,i,a,this,o,r):a},t.prototype.ignoreFrom=kt(function(n){return this._backCompatOption("ignoreFrom",n)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),t.prototype.allowFrom=kt(function(n){return this._backCompatOption("allowFrom",n)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),t.prototype.actionChecker=Un,t.prototype.styleCursor=Wn}};function nn(e,t,n,i,r){return t.testIgnoreAllow(t.options[e.name],n,i)&&t.options[e.name].enabled&&Yt(t,n,e,r)?e:null}function $n(e,t,n,i,r,o,a){for(var s=0,c=i.length;s=s||v.interactable===e&&((u+=h===n.name?1:0)>=o||v.element===t&&(l++,h===n.name&&l>=a))))return!1}return s>0}function an(e,t){return f.number(e)?(t.autoStart.maxInteractions=e,this):t.autoStart.maxInteractions}function fe(e,t,n){var i=n.autoStart.cursorElement;i&&i!==e&&(i.style.cursor=""),e.ownerDocument.documentElement.style.cursor=t,e.style.cursor=t,n.autoStart.cursorElement=t?e:null}function sn(e,t){var n=e.interactable,i=e.element,r=e.prepared;if(e.pointerType==="mouse"&&n&&n.options.styleCursor){var o="";if(r.name){var a=n.options[r.name].cursorChecker;o=f.func(a)?a(r,n,i,e._interacting):t.actions.map[r.name].getCursor(r)}fe(e.element,o||"",t)}else t.autoStart.cursorElement&&fe(t.autoStart.cursorElement,"",t)}var Nn={id:"auto-start/base",before:["actions"],install:function(e){var t=e.interactStatic,n=e.defaults;e.usePlugin(Gn),n.base.actionChecker=null,n.base.styleCursor=!0,w(n.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),t.maxInteractions=function(i){return an(i,e)},e.autoStart={maxInteractions:1/0,withinInteractionLimit:Yt,cursorElement:null}},listeners:{"interactions:down":function(e,t){var n=e.interaction,i=e.pointer,r=e.event,o=e.eventTarget;n.interacting()||on(n,rn(n,i,r,o,t),t)},"interactions:move":function(e,t){(function(n,i){var r=n.interaction,o=n.pointer,a=n.event,s=n.eventTarget;r.pointerType!=="mouse"||r.pointerIsDown||r.interacting()||on(r,rn(r,o,a,s,i),i)})(e,t),function(n,i){var r=n.interaction;if(r.pointerIsDown&&!r.interacting()&&r.pointerWasMoved&&r.prepared.name){i.fire("autoStart:before-start",n);var o=r.interactable,a=r.prepared.name;a&&o&&(o.options[a].manualStart||!Yt(o,r.element,r.prepared,i)?r.stop():(r.start(r.prepared,o,r.element),sn(r,i)))}}(e,t)},"interactions:stop":function(e,t){var n=e.interaction,i=n.interactable;i&&i.options.styleCursor&&fe(n.element,"",t)}},maxInteractions:an,withinInteractionLimit:Yt,validateAction:nn},he=Nn,Jn={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(e,t){var n=e.interaction,i=e.eventTarget,r=e.dx,o=e.dy;if(n.prepared.name==="drag"){var a=Math.abs(r),s=Math.abs(o),c=n.interactable.options.drag,u=c.startAxis,l=a>s?"x":a0&&(t.autoStartHoldTimer=setTimeout(function(){t.start(t.prepared,t.interactable,t.element)},n))},"interactions:move":function(e){var t=e.interaction,n=e.duplicate;t.autoStartHoldTimer&&t.pointerWasMoved&&!n&&(clearTimeout(t.autoStartHoldTimer),t.autoStartHoldTimer=null)},"autoStart:before-start":function(e){var t=e.interaction;ve(t)>0&&(t.prepared.name=null)}},getHoldDuration:ve},Zn=Qn,ti={id:"auto-start",install:function(e){e.usePlugin(he),e.usePlugin(Zn),e.usePlugin(Jn)}},ei=function(e){return/^(always|never|auto)$/.test(e)?(this.options.preventDefault=e,this):f.bool(e)?(this.options.preventDefault=e?"always":"never",this):this.options.preventDefault};function ni(e){var t=e.interaction,n=e.event;t.interactable&&t.interactable.checkAndPreventDefault(n)}var cn={id:"core/interactablePreventDefault",install:function(e){var t=e.Interactable;t.prototype.preventDefault=ei,t.prototype.checkAndPreventDefault=function(n){return function(i,r,o){var a=i.options.preventDefault;if(a!=="never")if(a!=="always"){if(r.events.supportsPassive&&/^touch(start|move)$/.test(o.type)){var s=N(o.target).document,c=r.getDocOptions(s);if(!c||!c.events||c.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(o.type)||f.element(o.target)&&et(o.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||o.preventDefault()}else o.preventDefault()}(this,e,n)},e.interactions.docEvents.push({type:"dragstart",listener:function(n){for(var i=0,r=e.interactions.list;i150)return null;var r=180*Math.atan2(i.prevEvent.velocityY,i.prevEvent.velocityX)/Math.PI;r<0&&(r+=360);var o=112.5<=r&&r<247.5,a=202.5<=r&&r<337.5;return{up:a,down:!a&&22.5<=r&&r<157.5,left:o,right:!o&&(292.5<=r||r<67.5),angle:r,speed:i.prevEvent.speed,velocity:{x:i.prevEvent.velocityX,y:i.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),n}(Bt);Object.defineProperties(me.prototype,{pageX:{get:function(){return this.page.x},set:function(e){this.page.x=e}},pageY:{get:function(){return this.page.y},set:function(e){this.page.y=e}},clientX:{get:function(){return this.client.x},set:function(e){this.client.x=e}},clientY:{get:function(){return this.client.y},set:function(e){this.client.y=e}},dx:{get:function(){return this.delta.x},set:function(e){this.delta.x=e}},dy:{get:function(){return this.delta.y},set:function(e){this.delta.y=e}},velocityX:{get:function(){return this.velocity.x},set:function(e){this.velocity.x=e}},velocityY:{get:function(){return this.velocity.y},set:function(e){this.velocity.y=e}}});var ri=P(function e(t,n,i,r,o){D(this,e),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=t,this.pointer=n,this.event=i,this.downTime=r,this.downTarget=o}),oi=function(e){return e.interactable="",e.element="",e.prepared="",e.pointerIsDown="",e.pointerWasMoved="",e._proxy="",e}({}),pn=function(e){return e.start="",e.move="",e.end="",e.stop="",e.interacting="",e}({}),ai=0,si=function(){function e(t){var n=this,i=t.pointerType,r=t.scopeFire;D(this,e),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=kt(function(l){this.move(l)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=ai++,this._scopeFire=r,this.pointerType=i;var o=this;this._proxy={};var a=function(l){Object.defineProperty(n._proxy,l,{get:function(){return o[l]}})};for(var s in oi)a(s);var c=function(l){Object.defineProperty(n._proxy,l,{value:function(){return o[l].apply(o,arguments)}})};for(var u in pn)c(u);this._scopeFire("interactions:new",{interaction:this})}return P(e,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(t,n,i){var r=this.updatePointer(t,n,i,!0),o=this.pointers[r];this._scopeFire("interactions:down",{pointer:t,event:n,eventTarget:i,pointerIndex:r,pointerInfo:o,type:"down",interaction:this})}},{key:"start",value:function(t,n,i){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(t.name==="gesture"?2:1)||!n.options[t.name].enabled)&&(de(this.prepared,t),this.interactable=n,this.element=i,this.rect=n.getRect(i),this.edges=this.prepared.edges?w({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(t,n,i){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(t,n,i,!1);var r,o,a=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(r=this.coords.cur.client.x-this.coords.start.client.x,o=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=bt(r,o)>this.pointerMoveTolerance);var s,c,u,l=this.getPointerIndex(t),p={pointer:t,pointerIndex:l,pointerInfo:this.pointers[l],event:n,type:"move",eventTarget:i,dx:r,dy:o,duplicate:a,interaction:this};a||(s=this.coords.velocity,c=this.coords.delta,u=Math.max(c.timeStamp/1e3,.001),s.page.x=c.page.x/u,s.page.y=c.page.y/u,s.client.x=c.client.x/u,s.client.y=c.client.y/u,s.timeStamp=u),this._scopeFire("interactions:move",p),a||this.simulation||(this.interacting()&&(p.type=null,this.move(p)),this.pointerWasMoved&&Ft(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||Ye(this.coords.delta),(t=w({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,n,i,r){var o=this.getPointerIndex(t);o===-1&&(o=this.updatePointer(t,n,i,!1));var a=/cancel$/i.test(n.type)?"cancel":"up";this._scopeFire("interactions:".concat(a),{pointer:t,pointerIndex:o,pointerInfo:this.pointers[o],event:n,eventTarget:i,type:a,curEventTarget:r,interaction:this}),this.simulation||this.end(n),this.removePointer(t,n)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var n;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(n=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,n===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var n=xt(t);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:wt(this.pointers,function(i){return i.id===n})}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,n,i,r){var o,a,s,c=xt(t),u=this.getPointerIndex(t),l=this.pointers[u];return r=r!==!1&&(r||/(down|start)$/i.test(n.type)),l?l.pointer=t:(l=new ri(c,t,n,null,null),u=this.pointers.length,this.pointers.push(l)),Ln(this.coords.cur,this.pointers.map(function(p){return p.pointer}),this._now()),o=this.coords.delta,a=this.coords.prev,s=this.coords.cur,o.page.x=s.page.x-a.page.x,o.page.y=s.page.y-a.page.y,o.client.x=s.client.x-a.client.x,o.client.y=s.client.y-a.client.y,o.timeStamp=s.timeStamp-a.timeStamp,r&&(this.pointerIsDown=!0,l.downTime=this.coords.cur.timeStamp,l.downTarget=i,jt(this.downPointer,t),this.interacting()||(Ft(this.coords.start,this.coords.cur),Ft(this.coords.prev,this.coords.cur),this.downEvent=n,this.pointerWasMoved=!1)),this._updateLatestPointer(t,n,i),this._scopeFire("interactions:update-pointer",{pointer:t,event:n,eventTarget:i,down:r,pointerInfo:l,pointerIndex:u,interaction:this}),u}},{key:"removePointer",value:function(t,n){var i=this.getPointerIndex(t);if(i!==-1){var r=this.pointers[i];this._scopeFire("interactions:remove-pointer",{pointer:t,event:n,eventTarget:null,pointerIndex:i,pointerInfo:r,interaction:this}),this.pointers.splice(i,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,n,i){this._latestPointer.pointer=t,this._latestPointer.event=n,this._latestPointer.eventTarget=i}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,n,i,r){return new me(this,t,this.prepared.name,n,this.element,i,r)}},{key:"_fireEvent",value:function(t){var n;(n=this.interactable)==null||n.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var n=t.event,i=t.phase,r=t.preEnd,o=t.type,a=this.rect;if(a&&i==="move"&&(Rt(this.edges,a,this.coords.delta[this.interactable.options.deltaSource]),a.width=a.right-a.left,a.height=a.bottom-a.top),this._scopeFire("interactions:before-action-".concat(i),t)===!1)return!1;var s=t.iEvent=this._createPreparedEvent(n,i,r,o);return this._scopeFire("interactions:action-".concat(i),t),i==="start"&&(this.prevEvent=s),this._fireEvent(s),this._scopeFire("interactions:after-action-".concat(i),t),!0}},{key:"_now",value:function(){return Date.now()}}]),e}();function dn(e){fn(e.interaction)}function fn(e){if(!function(n){return!(!n.offset.pending.x&&!n.offset.pending.y)}(e))return!1;var t=e.offset.pending;return ye(e.coords.cur,t),ye(e.coords.delta,t),Rt(e.edges,e.rect,t),t.x=0,t.y=0,!0}function ci(e){var t=e.x,n=e.y;this.offset.pending.x+=t,this.offset.pending.y+=n,this.offset.total.x+=t,this.offset.total.y+=n}function ye(e,t){var n=e.page,i=e.client,r=t.x,o=t.y;n.x+=r,n.y+=o,i.x+=r,i.y+=o}pn.offsetBy="";var li={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(e){e.Interaction.prototype.offsetBy=ci},listeners:{"interactions:new":function(e){e.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(e){return function(t){t.pointerIsDown&&(ye(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}(e.interaction)},"interactions:before-action-start":dn,"interactions:before-action-move":dn,"interactions:before-action-end":function(e){var t=e.interaction;if(fn(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop":function(e){var t=e.interaction;t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}},hn=li,ui=function(){function e(t){D(this,e),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=t}return P(e,[{key:"start",value:function(t){var n=this.interaction,i=Xt(n);if(!i||!i.enabled)return!1;var r=n.coords.velocity.client,o=bt(r.x,r.y),a=this.modification||(this.modification=new ge(n));if(a.copyFrom(n.modification),this.t0=n._now(),this.allowResume=i.allowResume,this.v0=o,this.currentOffset={x:0,y:0},this.startCoords=n.coords.cur.page,this.modifierArg=a.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-n.coords.cur.timeStamp<50&&o>i.minSpeed&&o>i.endSpeed)this.startInertia();else{if(a.result=a.setAll(this.modifierArg),!a.result.changed)return!1;this.startSmoothEnd()}return n.modification.result.rect=null,n.offsetBy(this.targetOffset),n._doPhase({interaction:n,event:t,phase:"inertiastart"}),n.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),n.modification.result.rect=null,this.active=!0,n.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,n=this.interaction.coords.velocity.client,i=Xt(this.interaction),r=i.resistance,o=-Math.log(i.endSpeed/this.v0)/r;this.targetOffset={x:(n.x-o)/r,y:(n.y-o)/r},this.te=o,this.lambda_v0=r/this.v0,this.one_ve_v0=1-i.endSpeed/this.v0;var a=this.modification,s=this.modifierArg;s.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},a.result=a.setAll(s),a.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+a.result.delta.x,y:this.targetOffset.y+a.result.delta.y}),this.onNextFrame(function(){return t.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return t.smoothEndTick()})}},{key:"onNextFrame",value:function(t){var n=this;this.timeout=nt.request(function(){n.active&&t()})}},{key:"inertiaTick",value:function(){var t,n,i,r,o,a,s,c=this,u=this.interaction,l=Xt(u).resistance,p=(u._now()-this.t0)/1e3;if(p=0;g--){var T=m[g];if(T.selector===l&&T.context===p){for(var S=T.listeners,E=S.length-1;E>=0;E--){var z=S[E];if(z.func===v&&qt(z.options,b)){S.splice(E,1),S.length||(m.splice(g,1),s(p,d,c),s(p,d,u,!0)),x=!0;break}}if(x)break}}},delegateListener:c,delegateUseCapture:u,delegatedEvents:i,documents:r,targets:n,supportsOptions:!1,supportsPassive:!1};function a(l,p,d,v){if(l.addEventListener){var h=zt(v),g=Et(n,function(b){return b.eventTarget===l});g||(g={eventTarget:l,events:{}},n.push(g)),g.events[p]||(g.events[p]=[]),Et(g.events[p],function(b){return b.func===d&&qt(b.options,h)})||(l.addEventListener(p,d,o.supportsOptions?h:h.capture),g.events[p].push({func:d,options:h}))}}function s(l,p,d,v){if(l.addEventListener&&l.removeEventListener){var h=wt(n,function(L){return L.eventTarget===l}),g=n[h];if(g&&g.events)if(p!=="all"){var b=!1,m=g.events[p];if(m){if(d==="all"){for(var x=m.length-1;x>=0;x--){var T=m[x];s(l,p,T.func,T.options)}return}for(var S=zt(v),E=0;E=2)continue;if(!r.interacting()&&t===r.pointerType)return r}return null}};function bn(e,t){return e.pointers.some(function(n){return n.id===t})}var vi=be,xe=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function xn(e,t){return function(n){var i=t.interactions.list,r=qe(n),o=Ve(n),a=o[0],s=o[1],c=[];if(/^touch/.test(n.type)){t.prevTouchTime=t.now();for(var u=0,l=n.changedTouches;u=0;i--){var r=t.interactions.list[i];r.interactable===n&&(r.stop(),t.fire("interactions:destroy",{interaction:r}),r.destroy(),t.interactions.list.length>2&&t.interactions.list.splice(i,1))}}},onDocSignal:we,doOnInteractions:xn,methodNames:xe},mi=gi,rt=function(e){return e[e.On=0]="On",e[e.Off=1]="Off",e}(rt||{}),yi=function(){function e(t,n,i,r){D(this,e),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new yn,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=n.actions,this.target=t,this._context=n.context||i,this._win=N(Fe(t)?this._context:t),this._doc=this._win.document,this._scopeEvents=r,this.set(n)}return P(e,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(t,n){return f.func(n.onstart)&&this.on("".concat(t,"start"),n.onstart),f.func(n.onmove)&&this.on("".concat(t,"move"),n.onmove),f.func(n.onend)&&this.on("".concat(t,"end"),n.onend),f.func(n.oninertiastart)&&this.on("".concat(t,"inertiastart"),n.oninertiastart),this}},{key:"updatePerActionListeners",value:function(t,n,i){var r,o=this,a=(r=this._actions.map[t])==null?void 0:r.filterEventType,s=function(c){return(a==null||a(c))&&Ht(c,o._actions)};(f.array(n)||f.object(n))&&this._onOff(rt.Off,t,n,void 0,s),(f.array(i)||f.object(i))&&this._onOff(rt.On,t,i,void 0,s)}},{key:"setPerAction",value:function(t,n){var i=this._defaults;for(var r in n){var o=r,a=this.options[t],s=n[o];o==="listeners"&&this.updatePerActionListeners(t,a.listeners,s),f.array(s)?a[o]=Ue(s):f.plainObject(s)?(a[o]=w(a[o]||{},vt(s)),f.object(i.perAction[o])&&"enabled"in i.perAction[o]&&(a[o].enabled=s.enabled!==!1)):f.bool(s)&&f.object(i.perAction[o])?a[o].enabled=s:a[o]=s}}},{key:"getRect",value:function(t){return t=t||(f.element(this.target)?this.target:null),f.string(this.target)&&(t=t||this._context.querySelector(this.target)),ee(t)}},{key:"rectChecker",value:function(t){var n=this;return f.func(t)?(this.getRect=function(i){var r=w({},t.apply(n,i));return"width"in r||(r.width=r.right-r.left,r.height=r.bottom-r.top),r},this):t===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(t,n){if(Fe(n)||f.object(n)){for(var i in this.options[t]=n,this._actions.map)this.options[i][t]=n;return this}return this.options[t]}},{key:"origin",value:function(t){return this._backCompatOption("origin",t)}},{key:"deltaSource",value:function(t){return t==="page"||t==="client"?(this.options.deltaSource=t,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var t=this.target;return f.string(t)?Array.from(this._context.querySelectorAll(t)):f.func(t)&&t.getAllElements?t.getAllElements():f.element(t)?[t]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(t){return this._context===t.ownerDocument||lt(this._context,t)}},{key:"testIgnoreAllow",value:function(t,n,i){return!this.testIgnore(t.ignoreFrom,n,i)&&this.testAllow(t.allowFrom,n,i)}},{key:"testAllow",value:function(t,n,i){return!t||!!f.element(i)&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"testIgnore",value:function(t,n,i){return!(!t||!f.element(i))&&(f.string(t)?Zt(i,t,n):!!f.element(t)&<(t,i))}},{key:"fire",value:function(t){return this.events.fire(t),this}},{key:"_onOff",value:function(t,n,i,r,o){f.object(n)&&!f.array(n)&&(r=i,i=null);var a=ut(n,i,o);for(var s in a){s==="wheel"&&(s=U.wheelEvent);for(var c=0,u=a[s];c=0;i--){var r=n[i],o=r.selector,a=r.context,s=r.listeners;o===this.target&&a===this._context&&n.splice(i,1);for(var c=s.length-1;c>=0;c--)this._scopeEvents.removeDelegate(this.target,this._context,t,s[c][0],s[c][1])}else this._scopeEvents.remove(this.target,"all")}}]),e}(),bi=function(){function e(t){var n=this;D(this,e),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=t,t.addListeners({"interactable:unset":function(i){var r=i.interactable,o=r.target,a=f.string(o)?n.selectorMap[o]:o[n.scope.id],s=wt(a,function(c){return c===r});a.splice(s,1)}})}return P(e,[{key:"new",value:function(t,n){n=w(n||{},{actions:this.scope.actions});var i=new this.scope.Interactable(t,n,this.scope.document,this.scope.events);return this.scope.addDocument(i._doc),this.list.push(i),f.string(t)?(this.selectorMap[t]||(this.selectorMap[t]=[]),this.selectorMap[t].push(i)):(i.target[this.scope.id]||Object.defineProperty(t,this.scope.id,{value:[],configurable:!0}),t[this.scope.id].push(i)),this.scope.fire("interactable:new",{target:t,options:n,interactable:i,win:this.scope._win}),i}},{key:"getExisting",value:function(t,n){var i=n&&n.context||this.scope.document,r=f.string(t),o=r?this.selectorMap[t]:t[this.scope.id];if(o)return Et(o,function(a){return a._context===i&&(r||a.inContext(t))})}},{key:"forEachMatch",value:function(t,n){for(var i=0,r=this.list;iMath.abs(u.y),c.coords,c.rect),w(i,c.coords)),c.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Si(e,t,n){var i=e.startCoords,r=e.edgeSign;t?n.y=i.y+(n.x-i.x)*r.y:n.x=i.x+(n.y-i.y)*r.x}function Pi(e,t,n,i){var r=e.startRect,o=e.startCoords,a=e.ratio,s=e.edgeSign;if(t){var c=i.width/a;n.y=o.y+(c-r.height)*s.y}else{var u=i.height*a;n.x=o.x+(u-r.width)*s.x}}var Di=it(zi,"aspectRatio"),Tn=function(){};Tn._defaults={};var Vt=Tn;function dt(e,t,n){return f.func(e)?mt(e,t.interactable,t.element,[n.x,n.y,t]):mt(e,t.interactable,t.element)}var Wt={start:function(e){var t=e.rect,n=e.startOffset,i=e.state,r=e.interaction,o=e.pageCoords,a=i.options,s=a.elementRect,c=w({left:0,top:0,right:0,bottom:0},a.offset||{});if(t&&s){var u=dt(a.restriction,r,o);if(u){var l=u.right-u.left-t.width,p=u.bottom-u.top-t.height;l<0&&(c.left+=l,c.right+=l),p<0&&(c.top+=p,c.bottom+=p)}c.left+=n.left-t.width*s.left,c.top+=n.top-t.height*s.top,c.right+=n.right-t.width*(1-s.right),c.bottom+=n.bottom-t.height*(1-s.bottom)}i.offset=c},set:function(e){var t=e.coords,n=e.interaction,i=e.state,r=i.options,o=i.offset,a=dt(r.restriction,n,t);if(a){var s=function(c){return!c||"left"in c&&"top"in c||((c=w({},c)).left=c.x||0,c.top=c.y||0,c.right=c.right||c.left+c.width,c.bottom=c.bottom||c.top+c.height),c}(a);t.x=Math.max(Math.min(s.right-o.right,t.x),s.left+o.left),t.y=Math.max(Math.min(s.bottom-o.bottom,t.y),s.top+o.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},Oi=it(Wt,"restrict"),zn={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Sn={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Pn(e,t){for(var n=0,i=["top","left","bottom","right"];nthis.updateItems()),this.resizeObserver=f("resize",e=>this.resizeObserverCallback(e)),this.openTransitionProp="opacity",this.guid=`calcite-dropdown-${C()}`,this.focusLastDropdownItem=!1,this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?I(t,e):null},this.updateTriggers=e=>{this.triggers=e.target.assignedElements({flatten:!0}),this.reposition(!0)},this.updateItems=()=>{this.items=this.groups.map(e=>Array.from(e?.querySelectorAll("calcite-dropdown-item"))).reduce((e,t)=>[...e,...t],[]),this.updateSelectedItems(),this.reposition(!0),this.items.forEach(e=>e.scale=this.scale)},this.updateGroups=e=>{const t=e.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-dropdown-group"));this.groups=t,this.updateItems(),this.updateGroupScale()},this.resizeObserverCallback=e=>{e.forEach(t=>{const{target:i}=t;i===this.referenceEl?this.setDropdownWidth():i===this.scrollerEl&&this.setMaxScrollerHeight()})},this.setDropdownWidth=()=>{const{referenceEl:e,scrollerEl:t}=this,i=e?.clientWidth;!i||!t||(t.style.minWidth=`${i}px`)},this.setMaxScrollerHeight=()=>{const{scrollerEl:e}=this;if(!e)return;this.reposition(!0);const t=this.getMaxScrollerHeight();e.style.maxHeight=t>0?`${t}px`:"",this.reposition(!0)},this.setScrollerAndTransitionEl=e=>{this.resizeObserver.observe(e),this.scrollerEl=e,this.transitionEl=e},this.setReferenceEl=e=>{this.referenceEl=e,l(this,this.referenceEl,this.floatingEl),this.resizeObserver.observe(e)},this.setFloatingEl=e=>{this.floatingEl=e,l(this,this.referenceEl,this.floatingEl)},this.keyDownHandler=e=>{if(!e.composedPath().includes(this.referenceEl))return;const{defaultPrevented:t,key:i}=e;if(!t){if(i==="Escape"){this.closeCalciteDropdown(),e.preventDefault();return}if(this.open&&e.shiftKey&&i==="Tab"){this.closeCalciteDropdown(),e.preventDefault();return}S(i)?(this.toggleDropdown(),e.preventDefault()):(i==="ArrowDown"||i==="ArrowUp")&&(this.focusLastDropdownItem=i==="ArrowUp",this.open=!0,this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd))}},this.focusOnFirstActiveOrDefaultItem=()=>{const e=this.getTraversableItems().find(t=>t.selected)||(this.focusLastDropdownItem?this.items[this.items.length-1]:this.items[0]);this.focusLastDropdownItem=!1,e&&p(e)},this.onOpenEnd=()=>{this.focusOnFirstActiveOrDefaultItem(),this.el.removeEventListener("calciteDropdownOpen",this.onOpenEnd)},this.toggleDropdown=()=>{this.open=!this.open,this.open&&this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd)},this.open=!1,this.closeOnSelectDisabled=!1,this.disabled=!1,this.flipPlacements=void 0,this.maxItems=0,this.overlayPositioning="absolute",this.placement=O,this.selectedItems=[],this.type="click",this.widthScale=void 0,this.scale="m"}openHandler(){if(w(this),this.disabled){this.open=!1;return}this.reposition(!0)}handleDisabledChange(e){e||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}handlePropsChange(){this.updateItems(),this.updateGroupScale()}async setFocus(){await z(this),y(this.referenceEl)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.open&&(this.openHandler(),w(this)),this.updateItems(),l(this,this.referenceEl,this.floatingEl)}componentWillLoad(){T(this)}componentDidLoad(){A(this),l(this,this.referenceEl,this.floatingEl)}componentDidRender(){P(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),x(this,this.referenceEl,this.floatingEl)}render(){const{open:e,guid:t}=this;return o(E,{key:"377c3d9687bc025f004b4efe58bfa5f0893d86d0"},o(H,{key:"9e2f48be045fc6db10cc7203a8b998ec2b6abafd",disabled:this.disabled},o("div",{key:"8607de2d53a4f8c4b29206ee56aa23ad4c2cbe3d",class:"calcite-trigger-container",id:`${t}-menubutton`,onClick:this.toggleDropdown,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},o("slot",{key:"07de8df34055ddc39301654a5ca312ddf293e6a9","aria-controls":`${t}-menu`,"aria-expanded":h(e),"aria-haspopup":"menu",name:F.dropdownTrigger,onSlotchange:this.updateTriggers})),o("div",{key:"c1469efb62eb704b021ce6479ad55deda59582d4","aria-hidden":h(!e),class:"calcite-dropdown-wrapper",ref:this.setFloatingEl},o("div",{key:"f875166d486a53cd393f17d9295974aa449d449f","aria-labelledby":`${t}-menubutton`,class:{"calcite-dropdown-content":!0,[m.animation]:!0,[m.animationActive]:e},id:`${t}-menu`,ref:this.setScrollerAndTransitionEl,role:"menu"},o("slot",{key:"bc6e61383aaf85b3d6242a86c50da68bc8b31e27",onSlotchange:this.updateGroups})))))}async reposition(e=!1){const{floatingEl:t,referenceEl:i,placement:s,overlayPositioning:n,filteredFlipPlacements:c}=this;return k(this,{floatingEl:t,referenceEl:i,overlayPositioning:n,placement:s,flipPlacements:c,type:"menu"},e)}closeCalciteDropdownOnClick(e){this.disabled||!this.open||e.composedPath().includes(this.el)||this.closeCalciteDropdown(!1)}closeCalciteDropdownOnEvent(e){this.closeCalciteDropdown(),e.stopPropagation()}closeCalciteDropdownOnOpenEvent(e){e.composedPath().includes(this.el)||(this.open=!1)}pointerEnterHandler(){this.disabled||this.type!=="hover"||this.toggleDropdown()}pointerLeaveHandler(){this.disabled||this.type!=="hover"||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter(e=>!e.disabled&&!e.hidden)}calciteInternalDropdownItemKeyEvent(e){const{keyboardEvent:t}=e.detail,i=t.target,s=this.getTraversableItems();switch(t.key){case"Tab":this.open=!1,this.updateTabIndexOfItems(i);break;case"ArrowDown":r(s,i,"next");break;case"ArrowUp":r(s,i,"previous");break;case"Home":r(s,i,"first");break;case"End":r(s,i,"last");break}e.stopPropagation()}handleItemSelect(e){this.updateSelectedItems(),e.stopPropagation(),this.calciteDropdownSelect.emit(),(!this.closeOnSelectDisabled||e.detail.requestedDropdownGroup.selectionMode==="none")&&this.closeCalciteDropdown(),e.stopPropagation()}updateGroupScale(){this.groups?.forEach(e=>e.scale=this.scale)}onBeforeOpen(){this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit()}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}getMaxScrollerHeight(){const{maxItems:e,items:t}=this;let i=0,s=0,n;return this.groups.forEach(c=>{e>0&&i{b===0&&(isNaN(n)&&(n=d.offsetTop),s+=n),ie?s:0}closeCalciteDropdown(e=!0){this.open=!1,e&&p(this.triggers[0])}updateTabIndexOfItems(e){this.items.forEach(t=>{t.tabIndex=e!==t?-1:0})}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}}static get style(){return B}},[17,"calcite-dropdown",{open:[1540],closeOnSelectDisabled:[516,"close-on-select-disabled"],disabled:[516],flipPlacements:[16],maxItems:[514,"max-items"],overlayPositioning:[513,"overlay-positioning"],placement:[513],selectedItems:[1040],type:[513],widthScale:[513,"width-scale"],scale:[513],setFocus:[64],reposition:[64]},[[8,"click","closeCalciteDropdownOnClick"],[0,"calciteInternalDropdownCloseRequest","closeCalciteDropdownOnEvent"],[8,"calciteDropdownOpen","closeCalciteDropdownOnOpenEvent"],[1,"pointerenter","pointerEnterHandler"],[1,"pointerleave","pointerLeaveHandler"],[0,"calciteInternalDropdownItemKeyEvent","calciteInternalDropdownItemKeyEvent"],[0,"calciteInternalDropdownItemSelect","handleItemSelect"]],{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}]);function g(){typeof customElements>"u"||["calcite-dropdown"].forEach(e=>{switch(e){case"calcite-dropdown":customElements.get(e)||customElements.define(e,u);break}})}g();const Q=u,X=g;export{Q as CalciteDropdown,X as defineCustomElement}; +import{p as v,b as D,W as a,a as o,D as E}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{M as p,g as y,A as h,O as r}from"./dom-N58V0tYi-DBU3jlah.js";import{I,U as l,V as O,q as x,j as m,_ as k}from"./floating-ui-DKFFlLv3-8lk8tQD2.js";import{i as C}from"./guid-Dls486Er-CBh637k4.js";import{l as P,p as H}from"./interactive-DqhNilgd-BbTDbq0n.js";import{n as S}from"./key-CZySMiwx-kmS7VeUz.js";import{f as z,o as T,r as A}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{c as f}from"./observers-BigwqTsw-CfIXp3Nz.js";import{p as w}from"./openCloseComponent-BGQ6h7vg-BO0gc3O8.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";const F={dropdownTrigger:"trigger"},L=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host .calcite-dropdown-wrapper{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{left:5px}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([open]) .calcite-dropdown-wrapper{visibility:visible}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-color-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-trigger-container{position:relative;display:flex;block-size:100%;flex:1 1 auto;word-wrap:break-word;word-break:break-word}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width-scale=s]){--calcite-dropdown-width:12rem}:host([width-scale=m]){--calcite-dropdown-width:14rem}:host([width-scale=l]){--calcite-dropdown-width:16rem}:host([hidden]){display:none}[hidden]{display:none}",B=L,u=v(class extends D{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteDropdownSelect=a(this,"calciteDropdownSelect",6),this.calciteDropdownBeforeClose=a(this,"calciteDropdownBeforeClose",6),this.calciteDropdownClose=a(this,"calciteDropdownClose",6),this.calciteDropdownBeforeOpen=a(this,"calciteDropdownBeforeOpen",6),this.calciteDropdownOpen=a(this,"calciteDropdownOpen",6),this.items=[],this.groups=[],this.mutationObserver=f("mutation",()=>this.updateItems()),this.resizeObserver=f("resize",e=>this.resizeObserverCallback(e)),this.openTransitionProp="opacity",this.guid=`calcite-dropdown-${C()}`,this.focusLastDropdownItem=!1,this.setFilteredPlacements=()=>{const{el:e,flipPlacements:t}=this;this.filteredFlipPlacements=t?I(t,e):null},this.updateTriggers=e=>{this.triggers=e.target.assignedElements({flatten:!0}),this.reposition(!0)},this.updateItems=()=>{this.items=this.groups.map(e=>Array.from(e?.querySelectorAll("calcite-dropdown-item"))).reduce((e,t)=>[...e,...t],[]),this.updateSelectedItems(),this.reposition(!0),this.items.forEach(e=>e.scale=this.scale)},this.updateGroups=e=>{const t=e.target.assignedElements({flatten:!0}).filter(i=>i?.matches("calcite-dropdown-group"));this.groups=t,this.updateItems(),this.updateGroupScale()},this.resizeObserverCallback=e=>{e.forEach(t=>{const{target:i}=t;i===this.referenceEl?this.setDropdownWidth():i===this.scrollerEl&&this.setMaxScrollerHeight()})},this.setDropdownWidth=()=>{const{referenceEl:e,scrollerEl:t}=this,i=e?.clientWidth;!i||!t||(t.style.minWidth=`${i}px`)},this.setMaxScrollerHeight=()=>{const{scrollerEl:e}=this;if(!e)return;this.reposition(!0);const t=this.getMaxScrollerHeight();e.style.maxHeight=t>0?`${t}px`:"",this.reposition(!0)},this.setScrollerAndTransitionEl=e=>{this.resizeObserver.observe(e),this.scrollerEl=e,this.transitionEl=e},this.setReferenceEl=e=>{this.referenceEl=e,l(this,this.referenceEl,this.floatingEl),this.resizeObserver.observe(e)},this.setFloatingEl=e=>{this.floatingEl=e,l(this,this.referenceEl,this.floatingEl)},this.keyDownHandler=e=>{if(!e.composedPath().includes(this.referenceEl))return;const{defaultPrevented:t,key:i}=e;if(!t){if(i==="Escape"){this.closeCalciteDropdown(),e.preventDefault();return}if(this.open&&e.shiftKey&&i==="Tab"){this.closeCalciteDropdown(),e.preventDefault();return}S(i)?(this.toggleDropdown(),e.preventDefault()):(i==="ArrowDown"||i==="ArrowUp")&&(this.focusLastDropdownItem=i==="ArrowUp",this.open=!0,this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd))}},this.focusOnFirstActiveOrDefaultItem=()=>{const e=this.getTraversableItems().find(t=>t.selected)||(this.focusLastDropdownItem?this.items[this.items.length-1]:this.items[0]);this.focusLastDropdownItem=!1,e&&p(e)},this.onOpenEnd=()=>{this.focusOnFirstActiveOrDefaultItem(),this.el.removeEventListener("calciteDropdownOpen",this.onOpenEnd)},this.toggleDropdown=()=>{this.open=!this.open,this.open&&this.el.addEventListener("calciteDropdownOpen",this.onOpenEnd)},this.open=!1,this.closeOnSelectDisabled=!1,this.disabled=!1,this.flipPlacements=void 0,this.maxItems=0,this.overlayPositioning="absolute",this.placement=O,this.selectedItems=[],this.type="click",this.widthScale=void 0,this.scale="m"}openHandler(){if(w(this),this.disabled){this.open=!1;return}this.reposition(!0)}handleDisabledChange(e){e||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}handlePropsChange(){this.updateItems(),this.updateGroupScale()}async setFocus(){await z(this),y(this.referenceEl)}connectedCallback(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.open&&(this.openHandler(),w(this)),this.updateItems(),l(this,this.referenceEl,this.floatingEl)}componentWillLoad(){T(this)}componentDidLoad(){A(this),l(this,this.referenceEl,this.floatingEl)}componentDidRender(){P(this)}disconnectedCallback(){this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect(),x(this,this.referenceEl,this.floatingEl)}render(){const{open:e,guid:t}=this;return o(E,{key:"377c3d9687bc025f004b4efe58bfa5f0893d86d0"},o(H,{key:"9e2f48be045fc6db10cc7203a8b998ec2b6abafd",disabled:this.disabled},o("div",{key:"8607de2d53a4f8c4b29206ee56aa23ad4c2cbe3d",class:"calcite-trigger-container",id:`${t}-menubutton`,onClick:this.toggleDropdown,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},o("slot",{key:"07de8df34055ddc39301654a5ca312ddf293e6a9","aria-controls":`${t}-menu`,"aria-expanded":h(e),"aria-haspopup":"menu",name:F.dropdownTrigger,onSlotchange:this.updateTriggers})),o("div",{key:"c1469efb62eb704b021ce6479ad55deda59582d4","aria-hidden":h(!e),class:"calcite-dropdown-wrapper",ref:this.setFloatingEl},o("div",{key:"f875166d486a53cd393f17d9295974aa449d449f","aria-labelledby":`${t}-menubutton`,class:{"calcite-dropdown-content":!0,[m.animation]:!0,[m.animationActive]:e},id:`${t}-menu`,ref:this.setScrollerAndTransitionEl,role:"menu"},o("slot",{key:"bc6e61383aaf85b3d6242a86c50da68bc8b31e27",onSlotchange:this.updateGroups})))))}async reposition(e=!1){const{floatingEl:t,referenceEl:i,placement:s,overlayPositioning:n,filteredFlipPlacements:c}=this;return k(this,{floatingEl:t,referenceEl:i,overlayPositioning:n,placement:s,flipPlacements:c,type:"menu"},e)}closeCalciteDropdownOnClick(e){this.disabled||!this.open||e.composedPath().includes(this.el)||this.closeCalciteDropdown(!1)}closeCalciteDropdownOnEvent(e){this.closeCalciteDropdown(),e.stopPropagation()}closeCalciteDropdownOnOpenEvent(e){e.composedPath().includes(this.el)||(this.open=!1)}pointerEnterHandler(){this.disabled||this.type!=="hover"||this.toggleDropdown()}pointerLeaveHandler(){this.disabled||this.type!=="hover"||this.closeCalciteDropdown()}getTraversableItems(){return this.items.filter(e=>!e.disabled&&!e.hidden)}calciteInternalDropdownItemKeyEvent(e){const{keyboardEvent:t}=e.detail,i=t.target,s=this.getTraversableItems();switch(t.key){case"Tab":this.open=!1,this.updateTabIndexOfItems(i);break;case"ArrowDown":r(s,i,"next");break;case"ArrowUp":r(s,i,"previous");break;case"Home":r(s,i,"first");break;case"End":r(s,i,"last");break}e.stopPropagation()}handleItemSelect(e){this.updateSelectedItems(),e.stopPropagation(),this.calciteDropdownSelect.emit(),(!this.closeOnSelectDisabled||e.detail.requestedDropdownGroup.selectionMode==="none")&&this.closeCalciteDropdown(),e.stopPropagation()}updateGroupScale(){this.groups?.forEach(e=>e.scale=this.scale)}onBeforeOpen(){this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit()}updateSelectedItems(){this.selectedItems=this.items.filter(e=>e.selected)}getMaxScrollerHeight(){const{maxItems:e,items:t}=this;let i=0,s=0,n;return this.groups.forEach(c=>{e>0&&i{b===0&&(isNaN(n)&&(n=d.offsetTop),s+=n),ie?s:0}closeCalciteDropdown(e=!0){this.open=!1,e&&p(this.triggers[0])}updateTabIndexOfItems(e){this.items.forEach(t=>{t.tabIndex=e!==t?-1:0})}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}}static get style(){return B}},[17,"calcite-dropdown",{open:[1540],closeOnSelectDisabled:[516,"close-on-select-disabled"],disabled:[516],flipPlacements:[16],maxItems:[514,"max-items"],overlayPositioning:[513,"overlay-positioning"],placement:[513],selectedItems:[1040],type:[513],widthScale:[513,"width-scale"],scale:[513],setFocus:[64],reposition:[64]},[[8,"click","closeCalciteDropdownOnClick"],[0,"calciteInternalDropdownCloseRequest","closeCalciteDropdownOnEvent"],[8,"calciteDropdownOpen","closeCalciteDropdownOnOpenEvent"],[1,"pointerenter","pointerEnterHandler"],[1,"pointerleave","pointerLeaveHandler"],[0,"calciteInternalDropdownItemKeyEvent","calciteInternalDropdownItemKeyEvent"],[0,"calciteInternalDropdownItemSelect","handleItemSelect"]],{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],scale:["handlePropsChange"]}]);function g(){typeof customElements>"u"||["calcite-dropdown"].forEach(e=>{switch(e){case"calcite-dropdown":customElements.get(e)||customElements.define(e,u);break}})}g();const Q=u,X=g;export{Q as CalciteDropdown,X as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-dropdown-group-0sIPwaDd-Bs73CRS2.js b/custom-toc-highlight/assets/calcite-dropdown-group-0sIPwaDd-DiD7sdrQ.js similarity index 94% rename from custom-toc-highlight/assets/calcite-dropdown-group-0sIPwaDd-Bs73CRS2.js rename to custom-toc-highlight/assets/calcite-dropdown-group-0sIPwaDd-DiD7sdrQ.js index d9750b1c..ff8bf03d 100644 --- a/custom-toc-highlight/assets/calcite-dropdown-group-0sIPwaDd-Bs73CRS2.js +++ b/custom-toc-highlight/assets/calcite-dropdown-group-0sIPwaDd-DiD7sdrQ.js @@ -1 +1 @@ -import{p as s,b as a,W as n,a as t,D as l}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{c as d}from"./observers-BigwqTsw-BNRQivHR.js";import{n as c}from"./resources3-Duvedxls-DbbvfBW6.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const p=":host{position:relative;display:block}.container{text-align:start}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([scale=s]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-title{padding:0.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-title{padding:0.75rem}:host([scale=l]){font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-title{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}",h=p,o=s(class extends a{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalDropdownItemChange=n(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach(e=>e.selectionMode=this.selectionMode)},this.mutationObserver=d("mutation",()=>this.updateItems()),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){this.updateItems(),this.mutationObserver?.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){this.mutationObserver?.disconnect()}render(){const e=this.groupTitle?t("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,i=this.groupPosition>0?t("div",{class:"dropdown-separator",role:"separator"}):null;return t(l,{key:"f41943751aefdb17d4f5d5bd8778c219cfd01a00","aria-label":this.groupTitle,role:"group"},t("div",{key:"87b78040b93c06081ca8282a785d466ed8fcf334",class:{[c.container]:!0}},i,e,t("slot",{key:"f635a5bdbe439315eba6292a4858cbd8519d23d1"})))}updateActiveItemOnChange(e){this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{selectionMode:["handlePropsChange"]}}static get style(){return h}},[17,"calcite-dropdown-group",{groupTitle:[513,"group-title"],scale:[513],selectionMode:[513,"selection-mode"]},[[0,"calciteInternalDropdownItemSelect","updateActiveItemOnChange"]],{selectionMode:["handlePropsChange"]}]);function r(){typeof customElements>"u"||["calcite-dropdown-group"].forEach(e=>{switch(e){case"calcite-dropdown-group":customElements.get(e)||customElements.define(e,o);break}})}r();const v=o,I=r;export{v as CalciteDropdownGroup,I as defineCustomElement}; +import{p as s,b as a,W as n,a as t,D as l}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{c as d}from"./observers-BigwqTsw-CfIXp3Nz.js";import{n as c}from"./resources3-Duvedxls-DbbvfBW6.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const p=":host{position:relative;display:block}.container{text-align:start}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([scale=s]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-title{padding:0.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-title{padding:0.75rem}:host([scale=l]){font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-title{padding:1rem}:host([hidden]){display:none}[hidden]{display:none}",h=p,o=s(class extends a{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalDropdownItemChange=n(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach(e=>e.selectionMode=this.selectionMode)},this.mutationObserver=d("mutation",()=>this.updateItems()),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){this.updateItems(),this.mutationObserver?.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){this.mutationObserver?.disconnect()}render(){const e=this.groupTitle?t("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,i=this.groupPosition>0?t("div",{class:"dropdown-separator",role:"separator"}):null;return t(l,{key:"f41943751aefdb17d4f5d5bd8778c219cfd01a00","aria-label":this.groupTitle,role:"group"},t("div",{key:"87b78040b93c06081ca8282a785d466ed8fcf334",class:{[c.container]:!0}},i,e,t("slot",{key:"f635a5bdbe439315eba6292a4858cbd8519d23d1"})))}updateActiveItemOnChange(e){this.requestedDropdownGroup=e.detail.requestedDropdownGroup,this.requestedDropdownItem=e.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{selectionMode:["handlePropsChange"]}}static get style(){return h}},[17,"calcite-dropdown-group",{groupTitle:[513,"group-title"],scale:[513],selectionMode:[513,"selection-mode"]},[[0,"calciteInternalDropdownItemSelect","updateActiveItemOnChange"]],{selectionMode:["handlePropsChange"]}]);function r(){typeof customElements>"u"||["calcite-dropdown-group"].forEach(e=>{switch(e){case"calcite-dropdown-group":customElements.get(e)||customElements.define(e,o);break}})}r();const v=o,I=r;export{v as CalciteDropdownGroup,I as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-dropdown-item-DpLfv4A0-C0tcRIAy.js b/custom-toc-highlight/assets/calcite-dropdown-item-DpLfv4A0-CIOTjei7.js similarity index 95% rename from custom-toc-highlight/assets/calcite-dropdown-item-DpLfv4A0-C0tcRIAy.js rename to custom-toc-highlight/assets/calcite-dropdown-item-DpLfv4A0-CIOTjei7.js index 65404442..10298975 100644 --- a/custom-toc-highlight/assets/calcite-dropdown-item-DpLfv4A0-C0tcRIAy.js +++ b/custom-toc-highlight/assets/calcite-dropdown-item-DpLfv4A0-CIOTjei7.js @@ -1,4 +1,4 @@ -import{p as g,b as k,W as a,a as t,D}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{A as I}from"./dom-N58V0tYi-DBU3jlah.js";import{f as y,o as x,r as E}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{e as s}from"./component-CWGf1hug-BASJpoEG.js";import{l as q,p as z}from"./interactive-DqhNilgd-BPt2o3jA.js";import{n as i}from"./resources3-Duvedxls-DbbvfBW6.js";import{m as R}from"./icon-BXFbBbop-BUyrjp8g.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-BNRQivHR.js";const S=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;flex-grow:1;align-items:center;outline-color:transparent}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.container a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);outline-color:transparent}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem}.dropdown-item-icon{position:relative;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}:host([scale=s]) .container{padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-item-icon,:host([scale=s]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .container{padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-item-icon,:host([scale=m]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-md)}:host([scale=m]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .container{padding-block:0.625rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-item-icon,:host([scale=l]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-xl)}:host([scale=l]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-xl)}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( +import{p as g,b as k,W as a,a as t,D}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{A as I}from"./dom-N58V0tYi-DBU3jlah.js";import{f as y,o as x,r as E}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{e as s}from"./component-CWGf1hug-BASJpoEG.js";import{l as q,p as z}from"./interactive-DqhNilgd-BbTDbq0n.js";import{n as i}from"./resources3-Duvedxls-DbbvfBW6.js";import{m as R}from"./icon-BXFbBbop-Bq4Zv26A.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-CfIXp3Nz.js";const S=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;flex-grow:1;align-items:center;outline-color:transparent}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.container a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-color-text-3);text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);outline-color:transparent}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem}.dropdown-item-icon{position:relative;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}:host([scale=s]) .container{padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .dropdown-item-icon,:host([scale=s]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-sm)}:host([scale=s]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-sm)}:host([scale=m]) .container{padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .dropdown-item-icon,:host([scale=m]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-md)}:host([scale=m]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-md)}:host([scale=l]) .container{padding-block:0.625rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .dropdown-item-icon,:host([scale=l]) .dropdown-item-icon--start{padding-inline-end:var(--calcite-spacing-xl)}:host([scale=l]) .dropdown-item-icon--end{padding-inline-start:var(--calcite-spacing-xl)}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( -2px * calc( 1 - diff --git a/custom-toc-highlight/assets/calcite-flow-CAdorlph-NGgeuOPy.js b/custom-toc-highlight/assets/calcite-flow-CAdorlph-DQjwYgyL.js similarity index 92% rename from custom-toc-highlight/assets/calcite-flow-CAdorlph-NGgeuOPy.js rename to custom-toc-highlight/assets/calcite-flow-CAdorlph-DQjwYgyL.js index b73f91e0..15147f70 100644 --- a/custom-toc-highlight/assets/calcite-flow-CAdorlph-NGgeuOPy.js +++ b/custom-toc-highlight/assets/calcite-flow-CAdorlph-DQjwYgyL.js @@ -1 +1 @@ -import{p as h,b as u,a as m}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{c as g}from"./observers-BigwqTsw-BNRQivHR.js";import{f as p,o as b,r as w}from"./loadable-DbNDKH4r-D4CSNQAA.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const c={frame:"frame",frameAdvancing:"frame--advancing",frameRetreating:"frame--retreating"},v=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",y=v,f=h(class extends u{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.itemMutationObserver=g("mutation",()=>this.updateFlowProps()),this.getFlowDirection=(t,e)=>{const o=t>1;return!(t&&e>1)&&!o?null:e{const{customItemSelectors:t,el:e,items:o}=this,s=Array.from(e.querySelectorAll(`calcite-flow-item${t?`,${t}`:""}`)).filter(i=>i.closest("calcite-flow")===e),n=o.length,a=s.length,r=s[a-1],l=s[a-2];if(a&&r&&s.forEach(i=>{i.showBackButton=i===r&&a>1,i.hidden=i!==r}),l&&(l.menuOpen=!1),this.items=s,n!==a){const i=this.getFlowDirection(n,a);this.itemCount=a,this.flowDirection=i}},this.customItemSelectors=void 0,this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,e=t[t.length-1];if(!e)return;const o=e.beforeBack?e.beforeBack:()=>Promise.resolve();try{await o.call(e)}catch{return}return e.remove(),e}async setFocus(){await p(this);const{items:t}=this;return t[t.length-1]?.setFocus()}connectedCallback(){this.itemMutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}async componentWillLoad(){b(this)}componentDidLoad(){w(this)}disconnectedCallback(){this.itemMutationObserver?.disconnect()}async handleItemBackClick(t){if(!t.defaultPrevented)return await this.back(),this.setFocus()}render(){const{flowDirection:t}=this,e={[c.frame]:!0,[c.frameAdvancing]:t==="advancing",[c.frameRetreating]:t==="retreating"};return m("div",{key:"01fbee965d48cb54fa5bd1b53a3435538df84332",class:e},m("slot",{key:"495880eceeb04387dd1352aa00337f037ab0636c"}))}get el(){return this}static get style(){return y}},[1,"calcite-flow",{customItemSelectors:[1,"custom-item-selectors"],flowDirection:[32],itemCount:[32],items:[32],back:[64],setFocus:[64]},[[0,"calciteFlowItemBack","handleItemBackClick"]]]);function d(){typeof customElements>"u"||["calcite-flow"].forEach(t=>{switch(t){case"calcite-flow":customElements.get(t)||customElements.define(t,f);break}})}d();const D=f,E=d;export{D as CalciteFlow,E as defineCustomElement}; +import{p as h,b as u,a as m}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{c as g}from"./observers-BigwqTsw-CfIXp3Nz.js";import{f as p,o as b,r as w}from"./loadable-DbNDKH4r-CSXrQx_7.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const c={frame:"frame",frameAdvancing:"frame--advancing",frameRetreating:"frame--retreating"},v=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",y=v,f=h(class extends u{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.itemMutationObserver=g("mutation",()=>this.updateFlowProps()),this.getFlowDirection=(t,e)=>{const o=t>1;return!(t&&e>1)&&!o?null:e{const{customItemSelectors:t,el:e,items:o}=this,s=Array.from(e.querySelectorAll(`calcite-flow-item${t?`,${t}`:""}`)).filter(i=>i.closest("calcite-flow")===e),n=o.length,a=s.length,r=s[a-1],l=s[a-2];if(a&&r&&s.forEach(i=>{i.showBackButton=i===r&&a>1,i.hidden=i!==r}),l&&(l.menuOpen=!1),this.items=s,n!==a){const i=this.getFlowDirection(n,a);this.itemCount=a,this.flowDirection=i}},this.customItemSelectors=void 0,this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,e=t[t.length-1];if(!e)return;const o=e.beforeBack?e.beforeBack:()=>Promise.resolve();try{await o.call(e)}catch{return}return e.remove(),e}async setFocus(){await p(this);const{items:t}=this;return t[t.length-1]?.setFocus()}connectedCallback(){this.itemMutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}async componentWillLoad(){b(this)}componentDidLoad(){w(this)}disconnectedCallback(){this.itemMutationObserver?.disconnect()}async handleItemBackClick(t){if(!t.defaultPrevented)return await this.back(),this.setFocus()}render(){const{flowDirection:t}=this,e={[c.frame]:!0,[c.frameAdvancing]:t==="advancing",[c.frameRetreating]:t==="retreating"};return m("div",{key:"01fbee965d48cb54fa5bd1b53a3435538df84332",class:e},m("slot",{key:"495880eceeb04387dd1352aa00337f037ab0636c"}))}get el(){return this}static get style(){return y}},[1,"calcite-flow",{customItemSelectors:[1,"custom-item-selectors"],flowDirection:[32],itemCount:[32],items:[32],back:[64],setFocus:[64]},[[0,"calciteFlowItemBack","handleItemBackClick"]]]);function d(){typeof customElements>"u"||["calcite-flow"].forEach(t=>{switch(t){case"calcite-flow":customElements.get(t)||customElements.define(t,f);break}})}d();const D=f,E=d;export{D as CalciteFlow,E as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-flow-item-uRuGc3ks-DCl4Mpal.js b/custom-toc-highlight/assets/calcite-flow-item-uRuGc3ks-Cp1dKuD0.js similarity index 88% rename from custom-toc-highlight/assets/calcite-flow-item-uRuGc3ks-DCl4Mpal.js rename to custom-toc-highlight/assets/calcite-flow-item-uRuGc3ks-Cp1dKuD0.js index f4d94ed8..4299edaa 100644 --- a/custom-toc-highlight/assets/calcite-flow-item-uRuGc3ks-DCl4Mpal.js +++ b/custom-toc-highlight/assets/calcite-flow-item-uRuGc3ks-Cp1dKuD0.js @@ -1 +1 @@ -import{p as w,b as C,W as l,a as t,D as B}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{p as E}from"./dom-N58V0tYi-DBU3jlah.js";import{l as I,p as F}from"./interactive-DqhNilgd-BPt2o3jA.js";import{o as L,r as P,f as S}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{K as x,q as A}from"./locale-Cn_GDVD_-Ar3RKmd3.js";import{d as T,h as O,M as D,l as M}from"./t9n-C_hcZMZJ-D4zmKT16.js";import{s as o,y as $}from"./panel-DRUEhsxp-Bbd7sTo9.js";import{m as R}from"./action-GCQoufcz-CK-V5fzo.js";import{K as z,O as K}from"./action-menu-DTIJuZNc-C8BNxu3_.js";import{m as _}from"./icon-BXFbBbop-BUyrjp8g.js";import{v as W}from"./loader-Ch7Jr16w-DUAf9YhQ.js";import{c as H}from"./scrim-BscQh4v9-DU79ospE.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-BNRQivHR.js";import"./floating-ui-DKFFlLv3--KXNPa_R.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";import"./openCloseComponent-BGQ6h7vg-COvbZ7sG.js";import"./FloatingArrow-BG9llDYg-iM1y-TMJ.js";const q={backButton:"back-button"},h={backLeft:"chevron-left",backRight:"chevron-right"},a={actionBar:"action-bar",alerts:"alerts",contentTop:"content-top",contentBottom:"content-bottom",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions",footerEnd:"footer-end",footerStart:"footer-start"},G=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}",J=G,f=w(class extends C{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFlowItemBack=l(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=l(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=l(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=l(this,"calciteFlowItemToggle",6),this.handleInternalPanelScroll=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.calciteFlowItemScroll.emit())},this.handleInternalPanelClose=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.closed=!0,this.calciteFlowItemClose.emit())},this.handleInternalPanelToggle=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.collapsed=e.target.collapsed,this.calciteFlowItemToggle.emit())},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=e=>{this.backButtonEl=e},this.setContainerRef=e=>{this.containerEl=e},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.beforeClose=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.scale="m",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){x(this),T(this)}async componentWillLoad(){await O(this),L(this)}componentDidRender(){I(this)}disconnectedCallback(){A(this),D(this)}componentDidLoad(){P(this)}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await S(this);const{backButtonEl:e,containerEl:s}=this;if(e)return e.setFocus();if(s)return s.setFocus()}async scrollContentTo(e){await this.containerEl?.scrollContentTo(e)}renderBackButton(){const{el:e}=this,s=E(e)==="rtl",{showBackButton:n,backButtonClick:r,messages:d}=this,c=d.back,i=s?h.backRight:h.backLeft;return n?t("calcite-action",{"aria-label":c,class:q.backButton,icon:i,key:"flow-back-button",onClick:r,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:c,title:c}):null}render(){const{collapsed:e,collapseDirection:s,collapsible:n,closable:r,closed:d,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messages:k,overlayPositioning:v,beforeClose:y}=this;return t(B,{key:"2e7872bb2687db0b67ddbf375f8ec0beaabbda36"},t(F,{key:"a9418954405a2cec2092bae3be5d77f02306e3c9",disabled:i},t("calcite-panel",{key:"d563c751421bf2d66c03286deaa613e09f585546",beforeClose:y,closable:r,closed:d,collapseDirection:s,collapsed:e,collapsible:n,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messageOverrides:k,onCalcitePanelClose:this.handleInternalPanelClose,onCalcitePanelScroll:this.handleInternalPanelScroll,onCalcitePanelToggle:this.handleInternalPanelToggle,overlayPositioning:v,ref:this.setContainerRef,scale:this.scale},this.renderBackButton(),t("slot",{key:"c506ec8bb4debbd6a9da6c7941878de49776f614",name:a.actionBar,slot:o.actionBar}),t("slot",{key:"e76e55e654ff878acff734bdf387402a9e262159",name:a.alerts,slot:o.alerts}),t("slot",{key:"f7ab8839d7b101e31087130ebf3e36af1ec7da24",name:a.headerActionsStart,slot:o.headerActionsStart}),t("slot",{key:"2932c4c15b168732356b8e55fcc3064f5b3f4cf5",name:a.headerActionsEnd,slot:o.headerActionsEnd}),t("slot",{key:"1ef8a9050683022733695445092f8c626487d87b",name:a.headerContent,slot:o.headerContent}),t("slot",{key:"24c0ab570a601a6c0edfb0c820e580fd24b158ce",name:a.headerMenuActions,slot:o.headerMenuActions}),t("slot",{key:"ec55bbe7ba939a6efb35225850c37a1aadb97275",name:a.fab,slot:o.fab}),t("slot",{key:"aa0bfec47656ef9f7f575cd933897a7909e5badc",name:a.contentTop,slot:o.contentTop}),t("slot",{key:"e23532d080e2df529c2aeb6af043c6efe7a0ab6d",name:a.contentBottom,slot:o.contentBottom}),t("slot",{key:"db6ffc0d9300c77067a4c88ab277de685c7713af",name:a.footerStart,slot:o.footerStart}),t("slot",{key:"5f249356da9292f34c4036d0d0741f048fe999e9",name:a.footer,slot:o.footer}),t("slot",{key:"7476137bacc0f3be5c97682c5027f74d73254765",name:a.footerEnd,slot:o.footerEnd}),t("slot",{key:"58f60a46c42a05abe9b100a57d478d991e4f25bc",name:a.footerActions,slot:o.footerActions}),t("slot",{key:"926a8d94b76b6fcdef6dfd219ba8180c44f81c35"}))))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return J}},[1,"calcite-flow-item",{closable:[516],closed:[516],collapsed:[516],collapseDirection:[1,"collapse-direction"],collapsible:[516],beforeBack:[16],beforeClose:[16],description:[1],disabled:[516],heading:[1],headingLevel:[514,"heading-level"],loading:[516],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],overlayPositioning:[513,"overlay-positioning"],scale:[513],showBackButton:[4,"show-back-button"],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]},void 0,{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function b(){typeof customElements>"u"||["calcite-flow-item","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-flow-item":customElements.get(e)||customElements.define(e,f);break;case"calcite-action":customElements.get(e)||R();break;case"calcite-action-menu":customElements.get(e)||K();break;case"calcite-icon":customElements.get(e)||_();break;case"calcite-loader":customElements.get(e)||W();break;case"calcite-panel":customElements.get(e)||$();break;case"calcite-popover":customElements.get(e)||z();break;case"calcite-scrim":customElements.get(e)||H();break}})}b();const pe=f,ge=b;export{pe as CalciteFlowItem,ge as defineCustomElement}; +import{p as w,b as C,W as l,a as t,D as B}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{p as E}from"./dom-N58V0tYi-DBU3jlah.js";import{l as I,p as F}from"./interactive-DqhNilgd-BbTDbq0n.js";import{o as L,r as P,f as S}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{K as x,q as A}from"./locale-Cn_GDVD_-CCUxSwPB.js";import{d as T,h as O,M as D,l as M}from"./t9n-C_hcZMZJ-Du2NPCXI.js";import{s as o,y as $}from"./panel-DRUEhsxp-KxESJ732.js";import{m as R}from"./action-GCQoufcz-DQvoWHlv.js";import{K as z,O as K}from"./action-menu-DTIJuZNc-DnQvHied.js";import{m as _}from"./icon-BXFbBbop-Bq4Zv26A.js";import{v as W}from"./loader-Ch7Jr16w-CF4bv9QO.js";import{c as H}from"./scrim-BscQh4v9-CloQFru7.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-CfIXp3Nz.js";import"./floating-ui-DKFFlLv3-8lk8tQD2.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";import"./openCloseComponent-BGQ6h7vg-BO0gc3O8.js";import"./FloatingArrow-BG9llDYg-Ct2kNlPu.js";const q={backButton:"back-button"},h={backLeft:"chevron-left",backRight:"chevron-right"},a={actionBar:"action-bar",alerts:"alerts",contentTop:"content-top",contentBottom:"content-bottom",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerActions:"footer-actions",footerEnd:"footer-end",footerStart:"footer-start"},G=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;overflow:hidden}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}calcite-panel{--calcite-panel-footer-padding:var(--calcite-flow-item-footer-padding);--calcite-panel-header-border-block-end:var(--calcite-flow-item-header-border-block-end)}:host([hidden]){display:none}[hidden]{display:none}",J=G,f=w(class extends C{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFlowItemBack=l(this,"calciteFlowItemBack",7),this.calciteFlowItemScroll=l(this,"calciteFlowItemScroll",6),this.calciteFlowItemClose=l(this,"calciteFlowItemClose",6),this.calciteFlowItemToggle=l(this,"calciteFlowItemToggle",6),this.handleInternalPanelScroll=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.calciteFlowItemScroll.emit())},this.handleInternalPanelClose=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.closed=!0,this.calciteFlowItemClose.emit())},this.handleInternalPanelToggle=e=>{e.target===this.containerEl&&(e.stopPropagation(),this.collapsed=e.target.collapsed,this.calciteFlowItemToggle.emit())},this.backButtonClick=()=>{this.calciteFlowItemBack.emit()},this.setBackRef=e=>{this.backButtonEl=e},this.setContainerRef=e=>{this.containerEl=e},this.closable=!1,this.closed=!1,this.collapsed=!1,this.collapseDirection="down",this.collapsible=!1,this.beforeBack=void 0,this.beforeClose=void 0,this.description=void 0,this.disabled=!1,this.heading=void 0,this.headingLevel=void 0,this.loading=!1,this.menuOpen=!1,this.messageOverrides=void 0,this.messages=void 0,this.overlayPositioning="absolute",this.scale="m",this.showBackButton=!1,this.defaultMessages=void 0,this.effectiveLocale=""}onMessagesChange(){}connectedCallback(){x(this),T(this)}async componentWillLoad(){await O(this),L(this)}componentDidRender(){I(this)}disconnectedCallback(){A(this),D(this)}componentDidLoad(){P(this)}effectiveLocaleChange(){M(this,this.effectiveLocale)}async setFocus(){await S(this);const{backButtonEl:e,containerEl:s}=this;if(e)return e.setFocus();if(s)return s.setFocus()}async scrollContentTo(e){await this.containerEl?.scrollContentTo(e)}renderBackButton(){const{el:e}=this,s=E(e)==="rtl",{showBackButton:n,backButtonClick:r,messages:d}=this,c=d.back,i=s?h.backRight:h.backLeft;return n?t("calcite-action",{"aria-label":c,class:q.backButton,icon:i,key:"flow-back-button",onClick:r,ref:this.setBackRef,scale:"s",slot:"header-actions-start",text:c,title:c}):null}render(){const{collapsed:e,collapseDirection:s,collapsible:n,closable:r,closed:d,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messages:k,overlayPositioning:v,beforeClose:y}=this;return t(B,{key:"2e7872bb2687db0b67ddbf375f8ec0beaabbda36"},t(F,{key:"a9418954405a2cec2092bae3be5d77f02306e3c9",disabled:i},t("calcite-panel",{key:"d563c751421bf2d66c03286deaa613e09f585546",beforeClose:y,closable:r,closed:d,collapseDirection:s,collapsed:e,collapsible:n,description:c,disabled:i,heading:m,headingLevel:p,loading:g,menuOpen:u,messageOverrides:k,onCalcitePanelClose:this.handleInternalPanelClose,onCalcitePanelScroll:this.handleInternalPanelScroll,onCalcitePanelToggle:this.handleInternalPanelToggle,overlayPositioning:v,ref:this.setContainerRef,scale:this.scale},this.renderBackButton(),t("slot",{key:"c506ec8bb4debbd6a9da6c7941878de49776f614",name:a.actionBar,slot:o.actionBar}),t("slot",{key:"e76e55e654ff878acff734bdf387402a9e262159",name:a.alerts,slot:o.alerts}),t("slot",{key:"f7ab8839d7b101e31087130ebf3e36af1ec7da24",name:a.headerActionsStart,slot:o.headerActionsStart}),t("slot",{key:"2932c4c15b168732356b8e55fcc3064f5b3f4cf5",name:a.headerActionsEnd,slot:o.headerActionsEnd}),t("slot",{key:"1ef8a9050683022733695445092f8c626487d87b",name:a.headerContent,slot:o.headerContent}),t("slot",{key:"24c0ab570a601a6c0edfb0c820e580fd24b158ce",name:a.headerMenuActions,slot:o.headerMenuActions}),t("slot",{key:"ec55bbe7ba939a6efb35225850c37a1aadb97275",name:a.fab,slot:o.fab}),t("slot",{key:"aa0bfec47656ef9f7f575cd933897a7909e5badc",name:a.contentTop,slot:o.contentTop}),t("slot",{key:"e23532d080e2df529c2aeb6af043c6efe7a0ab6d",name:a.contentBottom,slot:o.contentBottom}),t("slot",{key:"db6ffc0d9300c77067a4c88ab277de685c7713af",name:a.footerStart,slot:o.footerStart}),t("slot",{key:"5f249356da9292f34c4036d0d0741f048fe999e9",name:a.footer,slot:o.footer}),t("slot",{key:"7476137bacc0f3be5c97682c5027f74d73254765",name:a.footerEnd,slot:o.footerEnd}),t("slot",{key:"58f60a46c42a05abe9b100a57d478d991e4f25bc",name:a.footerActions,slot:o.footerActions}),t("slot",{key:"926a8d94b76b6fcdef6dfd219ba8180c44f81c35"}))))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return J}},[1,"calcite-flow-item",{closable:[516],closed:[516],collapsed:[516],collapseDirection:[1,"collapse-direction"],collapsible:[516],beforeBack:[16],beforeClose:[16],description:[1],disabled:[516],heading:[1],headingLevel:[514,"heading-level"],loading:[516],menuOpen:[516,"menu-open"],messageOverrides:[1040],messages:[1040],overlayPositioning:[513,"overlay-positioning"],scale:[513],showBackButton:[4,"show-back-button"],defaultMessages:[32],effectiveLocale:[32],setFocus:[64],scrollContentTo:[64]},void 0,{messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}]);function b(){typeof customElements>"u"||["calcite-flow-item","calcite-action","calcite-action-menu","calcite-icon","calcite-loader","calcite-panel","calcite-popover","calcite-scrim"].forEach(e=>{switch(e){case"calcite-flow-item":customElements.get(e)||customElements.define(e,f);break;case"calcite-action":customElements.get(e)||R();break;case"calcite-action-menu":customElements.get(e)||K();break;case"calcite-icon":customElements.get(e)||_();break;case"calcite-loader":customElements.get(e)||W();break;case"calcite-panel":customElements.get(e)||$();break;case"calcite-popover":customElements.get(e)||z();break;case"calcite-scrim":customElements.get(e)||H();break}})}b();const pe=f,ge=b;export{pe as CalciteFlowItem,ge as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-icon-laqhdRBY-8qK5FfMb.js b/custom-toc-highlight/assets/calcite-icon-laqhdRBY-8qK5FfMb.js new file mode 100644 index 00000000..c4fae25e --- /dev/null +++ b/custom-toc-highlight/assets/calcite-icon-laqhdRBY-8qK5FfMb.js @@ -0,0 +1 @@ +import{f as t,m as o}from"./icon-BXFbBbop-Bq4Zv26A.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./observers-BigwqTsw-CfIXp3Nz.js";const a=t,c=o;export{a as CalciteIcon,c as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-icon-laqhdRBY-Dn93dMQE.js b/custom-toc-highlight/assets/calcite-icon-laqhdRBY-Dn93dMQE.js deleted file mode 100644 index 89c295f2..00000000 --- a/custom-toc-highlight/assets/calcite-icon-laqhdRBY-Dn93dMQE.js +++ /dev/null @@ -1 +0,0 @@ -import{f as t,m as o}from"./icon-BXFbBbop-BUyrjp8g.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./observers-BigwqTsw-BNRQivHR.js";const a=t,c=o;export{a as CalciteIcon,c as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-input-BKRd7MCS-BhvpT25V.js b/custom-toc-highlight/assets/calcite-input-BKRd7MCS-BhvpT25V.js new file mode 100644 index 00000000..7ec89527 --- /dev/null +++ b/custom-toc-highlight/assets/calcite-input-BKRd7MCS-BhvpT25V.js @@ -0,0 +1 @@ +import{F as t,M as o}from"./input2-eOtqu-iO-DiRyHCWP.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./form-CRSw616T-wY3ZjFlq.js";import"./interactive-DqhNilgd-BbTDbq0n.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./loadable-DbNDKH4r-CSXrQx_7.js";import"./locale-Cn_GDVD_-CCUxSwPB.js";import"./observers-BigwqTsw-CfIXp3Nz.js";import"./t9n-C_hcZMZJ-Du2NPCXI.js";import"./icon-BXFbBbop-Bq4Zv26A.js";const F=t,I=o;export{F as CalciteInput,I as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-input-BKRd7MCS-DN64wHsO.js b/custom-toc-highlight/assets/calcite-input-BKRd7MCS-DN64wHsO.js deleted file mode 100644 index 04bf8737..00000000 --- a/custom-toc-highlight/assets/calcite-input-BKRd7MCS-DN64wHsO.js +++ /dev/null @@ -1 +0,0 @@ -import{F as t,M as o}from"./input2-eOtqu-iO-DwuPmAAc.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./form-CRSw616T-DZVFUlxN.js";import"./interactive-DqhNilgd-BPt2o3jA.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./loadable-DbNDKH4r-D4CSNQAA.js";import"./locale-Cn_GDVD_-Ar3RKmd3.js";import"./observers-BigwqTsw-BNRQivHR.js";import"./t9n-C_hcZMZJ-D4zmKT16.js";import"./icon-BXFbBbop-BUyrjp8g.js";const F=t,I=o;export{F as CalciteInput,I as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-label-DMj3M4QR-C-hEqjQX.js b/custom-toc-highlight/assets/calcite-label-DMj3M4QR-BaEG55cn.js similarity index 94% rename from custom-toc-highlight/assets/calcite-label-DMj3M4QR-C-hEqjQX.js rename to custom-toc-highlight/assets/calcite-label-DMj3M4QR-BaEG55cn.js index 29c98aac..ce6c42bc 100644 --- a/custom-toc-highlight/assets/calcite-label-DMj3M4QR-C-hEqjQX.js +++ b/custom-toc-highlight/assets/calcite-label-DMj3M4QR-BaEG55cn.js @@ -1 +1 @@ -import{p as n,b as l,W as o,a as t,D as s}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{y as c,d as r,u as d}from"./label-Dys24PJn-BCewo2Re.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./component-CWGf1hug-BASJpoEG.js";const h={container:"container"},m=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}:host([alignment=start]){text-align:start}:host([alignment=end]){text-align:end}:host([alignment=center]){text-align:center}:host([scale=s]) .container{gap:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.5rem)}:host([scale=m]) .container{gap:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.75rem)}:host([scale=l]) .container{gap:0.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;margin-block-end:var(--calcite-label-margin-bottom, 1rem)}:host .container{margin-inline:0px;margin-block-start:0px;inline-size:100%;line-height:1.375;color:var(--calcite-color-text-1)}:host([layout=default]) .container{display:flex;flex-direction:column}:host([layout=inline]) .container,:host([layout=inline-space-between]) .container{display:flex;flex-direction:row;align-items:center;gap:0.5rem}:host([layout=inline][scale=l]) .container{gap:0.75rem}:host([layout=inline-space-between]) .container{justify-content:space-between}:host([disabled])>.container{opacity:var(--calcite-opacity-disabled)}:host([disabled]) ::slotted(*[disabled]),:host([disabled]) ::slotted(*[disabled] *){--tw-bg-opacity:1}:host([disabled]) ::slotted(calcite-input-message:not([active])){--tw-bg-opacity:0}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}",b=m,a=n(class extends l{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalLabelClick=o(this,"calciteInternalLabelClick",2),this.labelClickHandler=e=>{window.getSelection()?.type!=="Range"&&this.calciteInternalLabelClick.emit({sourceEvent:e})},this.alignment="start",this.for=void 0,this.scale="m",this.layout="default"}handleForChange(){c(this.el)}connectedCallback(){document.dispatchEvent(new CustomEvent(r))}disconnectedCallback(){document.dispatchEvent(new CustomEvent(d))}render(){return t(s,{key:"c3eff09792519c9e5a76ee28e3754db83b536f99",onClick:this.labelClickHandler},t("div",{key:"387902edd9b59be290f95ad6c2721584037d7256",class:h.container},t("slot",{key:"b54d782522e95323333040e40e1a6dd06b52a575"})))}get el(){return this}static get watchers(){return{for:["handleForChange"]}}static get style(){return b}},[1,"calcite-label",{alignment:[513],for:[513],scale:[513],layout:[513]},void 0,{for:["handleForChange"]}]);function i(){typeof customElements>"u"||["calcite-label"].forEach(e=>{switch(e){case"calcite-label":customElements.get(e)||customElements.define(e,a);break}})}i();const C=a,w=i;export{C as CalciteLabel,w as defineCustomElement}; +import{p as n,b as l,W as o,a as t,D as s}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{y as c,d as r,u as d}from"./label-Dys24PJn-BCewo2Re.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./component-CWGf1hug-BASJpoEG.js";const h={container:"container"},m=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}:host([alignment=start]){text-align:start}:host([alignment=end]){text-align:end}:host([alignment=center]){text-align:center}:host([scale=s]) .container{gap:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.5rem)}:host([scale=m]) .container{gap:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;margin-block-end:var(--calcite-label-margin-bottom, 0.75rem)}:host([scale=l]) .container{gap:0.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;margin-block-end:var(--calcite-label-margin-bottom, 1rem)}:host .container{margin-inline:0px;margin-block-start:0px;inline-size:100%;line-height:1.375;color:var(--calcite-color-text-1)}:host([layout=default]) .container{display:flex;flex-direction:column}:host([layout=inline]) .container,:host([layout=inline-space-between]) .container{display:flex;flex-direction:row;align-items:center;gap:0.5rem}:host([layout=inline][scale=l]) .container{gap:0.75rem}:host([layout=inline-space-between]) .container{justify-content:space-between}:host([disabled])>.container{opacity:var(--calcite-opacity-disabled)}:host([disabled]) ::slotted(*[disabled]),:host([disabled]) ::slotted(*[disabled] *){--tw-bg-opacity:1}:host([disabled]) ::slotted(calcite-input-message:not([active])){--tw-bg-opacity:0}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}:host([hidden]){display:none}[hidden]{display:none}",b=m,a=n(class extends l{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalLabelClick=o(this,"calciteInternalLabelClick",2),this.labelClickHandler=e=>{window.getSelection()?.type!=="Range"&&this.calciteInternalLabelClick.emit({sourceEvent:e})},this.alignment="start",this.for=void 0,this.scale="m",this.layout="default"}handleForChange(){c(this.el)}connectedCallback(){document.dispatchEvent(new CustomEvent(r))}disconnectedCallback(){document.dispatchEvent(new CustomEvent(d))}render(){return t(s,{key:"c3eff09792519c9e5a76ee28e3754db83b536f99",onClick:this.labelClickHandler},t("div",{key:"387902edd9b59be290f95ad6c2721584037d7256",class:h.container},t("slot",{key:"b54d782522e95323333040e40e1a6dd06b52a575"})))}get el(){return this}static get watchers(){return{for:["handleForChange"]}}static get style(){return b}},[1,"calcite-label",{alignment:[513],for:[513],scale:[513],layout:[513]},void 0,{for:["handleForChange"]}]);function i(){typeof customElements>"u"||["calcite-label"].forEach(e=>{switch(e){case"calcite-label":customElements.get(e)||customElements.define(e,a);break}})}i();const C=a,w=i;export{C as CalciteLabel,w as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-list-item-VYBhSMxV-CrZ_qcBF.js b/custom-toc-highlight/assets/calcite-list-item-VYBhSMxV-C8kSjE5V.js similarity index 97% rename from custom-toc-highlight/assets/calcite-list-item-VYBhSMxV-CrZ_qcBF.js rename to custom-toc-highlight/assets/calcite-list-item-VYBhSMxV-C8kSjE5V.js index 5b1f9f27..be2b4c6f 100644 --- a/custom-toc-highlight/assets/calcite-list-item-VYBhSMxV-CrZ_qcBF.js +++ b/custom-toc-highlight/assets/calcite-list-item-VYBhSMxV-C8kSjE5V.js @@ -1,4 +1,4 @@ -import{p as k,b as L,W as c,a as i,D as q}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{A as C,G as m,X as I,p as X}from"./dom-N58V0tYi-DBU3jlah.js";import{l as E,p as A}from"./interactive-DqhNilgd-BPt2o3jA.js";import{K as w,q as D}from"./locale-Cn_GDVD_-Ar3RKmd3.js";import{d as H,h as T,M,l as z}from"./t9n-C_hcZMZJ-D4zmKT16.js";import{o as F,r as $,f as P}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{h as J,m as Q,u as V,f as Y}from"./utils3-BSH0zqNl-7T4-U7N_.js";import{c as y,o as f,n as a,e as p}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{m as Z}from"./action-GCQoufcz-CK-V5fzo.js";import{m as B}from"./icon-BXFbBbop-BUyrjp8g.js";import{v as ee}from"./loader-Ch7Jr16w-DUAf9YhQ.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-BNRQivHR.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";const x={handle:"handle",handleSelected:"handle--selected"},te={drag:"drag"},b={itemLabel:"{itemLabel}",position:"{position}",total:"{total}"},ne=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}.handle{display:flex;align-items:center;justify-content:center;align-self:stretch;border-style:none;outline-color:transparent;color:var(--calcite-handle-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-handle-background-color, transparent);padding-block:0.75rem;padding-inline:0.25rem;line-height:0}.handle calcite-icon{color:inherit}:host(:not([disabled])) .handle{cursor:move}:host(:not([disabled])) .handle:hover{color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-hover, var(--calcite-color-foreground-2))}:host(:not([disabled])) .handle:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( +import{p as k,b as L,W as c,a as i,D as q}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{A as C,G as m,X as I,p as X}from"./dom-N58V0tYi-DBU3jlah.js";import{l as E,p as A}from"./interactive-DqhNilgd-BbTDbq0n.js";import{K as w,q as D}from"./locale-Cn_GDVD_-CCUxSwPB.js";import{d as H,h as T,M,l as z}from"./t9n-C_hcZMZJ-Du2NPCXI.js";import{o as F,r as $,f as P}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{h as J,m as Q,u as V,f as Y}from"./utils3-BSH0zqNl-90fd1I_b.js";import{c as y,o as f,n as a,e as p}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{m as Z}from"./action-GCQoufcz-DQvoWHlv.js";import{m as B}from"./icon-BXFbBbop-Bq4Zv26A.js";import{v as ee}from"./loader-Ch7Jr16w-CF4bv9QO.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-CfIXp3Nz.js";import"./guid-Dls486Er-CBh637k4.js";import"./component-CWGf1hug-BASJpoEG.js";const x={handle:"handle",handleSelected:"handle--selected"},te={drag:"drag"},b={itemLabel:"{itemLabel}",position:"{position}",total:"{total}"},ne=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex}.handle{display:flex;align-items:center;justify-content:center;align-self:stretch;border-style:none;outline-color:transparent;color:var(--calcite-handle-icon-color, var(--calcite-color-border-input));background-color:var(--calcite-handle-background-color, transparent);padding-block:0.75rem;padding-inline:0.25rem;line-height:0}.handle calcite-icon{color:inherit}:host(:not([disabled])) .handle{cursor:move}:host(:not([disabled])) .handle:hover{color:var(--calcite-handle-icon-color-hover, var(--calcite-color-text-1));background-color:var(--calcite-handle-background-color-hover, var(--calcite-color-foreground-2))}:host(:not([disabled])) .handle:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( -2px * calc( 1 - diff --git a/custom-toc-highlight/assets/calcite-list-item-group-CuQ2MPLW-DacaGEdY.js b/custom-toc-highlight/assets/calcite-list-item-group-CuQ2MPLW-CwdP7Iq_.js similarity index 91% rename from custom-toc-highlight/assets/calcite-list-item-group-CuQ2MPLW-DacaGEdY.js rename to custom-toc-highlight/assets/calcite-list-item-group-CuQ2MPLW-CwdP7Iq_.js index 30e807b6..f9a9ae10 100644 --- a/custom-toc-highlight/assets/calcite-list-item-group-CuQ2MPLW-DacaGEdY.js +++ b/custom-toc-highlight/assets/calcite-list-item-group-CuQ2MPLW-CwdP7Iq_.js @@ -1 +1 @@ -import{p as o,b as n,W as l,a as t,D as c}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{l as r,p as h}from"./interactive-DqhNilgd-BPt2o3jA.js";import{t as f}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const i={container:"container",heading:"heading"},p=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1)}:host([filter-hidden]){display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{margin:0px;display:flex;flex:1 1 0%;padding:0.75rem;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-2)}.heading{padding:0px}:host([hidden]){display:none}[hidden]{display:none}",m=p,a=o(class extends n{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalListItemGroupDefaultSlotChange=l(this,"calciteInternalListItemGroupDefaultSlotChange",6),this.handleDefaultSlotChange=()=>{this.calciteInternalListItemGroupDefaultSlotChange.emit()},this.disabled=!1,this.filterHidden=!1,this.heading=void 0}componentDidRender(){r(this)}render(){const{disabled:e,heading:d}=this;return t(c,{key:"e1e0304c3d4fe02909fd0075de2e4f5ef806be39"},t(h,{key:"5fb0861fb58de90808e98b7061d3c906c822203c",disabled:e},t("tr",{key:"c77af78f937c3135601df2c4574b858662d5fcdb",class:i.container},t("td",{key:"f1ae6b9e09e78f87b814287f8eaeb0a105575c7a",class:i.heading,colSpan:f},d)),t("slot",{key:"7346d5d774173403910eddd35bf700ccd1437c4f",onSlotchange:this.handleDefaultSlotChange})))}get el(){return this}static get style(){return m}},[1,"calcite-list-item-group",{disabled:[516],filterHidden:[516,"filter-hidden"],heading:[513]}]);function s(){typeof customElements>"u"||["calcite-list-item-group"].forEach(e=>{switch(e){case"calcite-list-item-group":customElements.get(e)||customElements.define(e,a);break}})}s();const D=a,S=s;export{D as CalciteListItemGroup,S as defineCustomElement}; +import{p as o,b as n,W as l,a as t,D as c}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{l as r,p as h}from"./interactive-DqhNilgd-BbTDbq0n.js";import{t as f}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";const i={container:"container",heading:"heading"},p=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1)}:host([filter-hidden]){display:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{margin:0px;display:flex;flex:1 1 0%;padding:0.75rem;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-2)}.heading{padding:0px}:host([hidden]){display:none}[hidden]{display:none}",m=p,a=o(class extends n{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteInternalListItemGroupDefaultSlotChange=l(this,"calciteInternalListItemGroupDefaultSlotChange",6),this.handleDefaultSlotChange=()=>{this.calciteInternalListItemGroupDefaultSlotChange.emit()},this.disabled=!1,this.filterHidden=!1,this.heading=void 0}componentDidRender(){r(this)}render(){const{disabled:e,heading:d}=this;return t(c,{key:"e1e0304c3d4fe02909fd0075de2e4f5ef806be39"},t(h,{key:"5fb0861fb58de90808e98b7061d3c906c822203c",disabled:e},t("tr",{key:"c77af78f937c3135601df2c4574b858662d5fcdb",class:i.container},t("td",{key:"f1ae6b9e09e78f87b814287f8eaeb0a105575c7a",class:i.heading,colSpan:f},d)),t("slot",{key:"7346d5d774173403910eddd35bf700ccd1437c4f",onSlotchange:this.handleDefaultSlotChange})))}get el(){return this}static get style(){return m}},[1,"calcite-list-item-group",{disabled:[516],filterHidden:[516,"filter-hidden"],heading:[513]}]);function s(){typeof customElements>"u"||["calcite-list-item-group"].forEach(e=>{switch(e){case"calcite-list-item-group":customElements.get(e)||customElements.define(e,a);break}})}s();const D=a,S=s;export{D as CalciteListItemGroup,S as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-list-rnu1YzAl-CeNaNcvH.js b/custom-toc-highlight/assets/calcite-list-rnu1YzAl-DCH8F59s.js similarity index 98% rename from custom-toc-highlight/assets/calcite-list-rnu1YzAl-CeNaNcvH.js rename to custom-toc-highlight/assets/calcite-list-rnu1YzAl-DCH8F59s.js index d9710749..344c335d 100644 --- a/custom-toc-highlight/assets/calcite-list-rnu1YzAl-CeNaNcvH.js +++ b/custom-toc-highlight/assets/calcite-list-rnu1YzAl-DCH8F59s.js @@ -1,2 +1,2 @@ -import{p as vt,b as bt,a as v,D as Nn,W as ce,h as jn}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{G as he,A as Rn}from"./dom-N58V0tYi-DBU3jlah.js";import{l as zt,p as $t}from"./interactive-DqhNilgd-BPt2o3jA.js";import{c as Hn}from"./observers-BigwqTsw-BNRQivHR.js";import{t as Xn}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{f as Yn,m as zn}from"./utils3-BSH0zqNl-7T4-U7N_.js";import{o as Bt,r as Wt,f as Ut}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{l as Gt,h as Vt,d as Zt,M as Kt}from"./t9n-C_hcZMZJ-D4zmKT16.js";import{K as Qt,q as qt,X as It}from"./locale-Cn_GDVD_-Ar3RKmd3.js";import{b as Ct,A as yt,O as $n,l as Jt,W as Et,$ as Bn,D as Wn,g as en}from"./debounce-27Hmkkyg-Th7bw3mg.js";import{m as tn}from"./icon-BXFbBbop-BUyrjp8g.js";import{z as nn,w as an,M as on}from"./input2-eOtqu-iO-DwuPmAAc.js";import{v as Un}from"./loader-Ch7Jr16w-DUAf9YhQ.js";import{c as Gn}from"./scrim-BscQh4v9-DU79ospE.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./form-CRSw616T-DZVFUlxN.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./guid-Dls486Er-CBh637k4.js";function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,i)}return n}function B(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function Kn(e,t){if(e==null)return{};var n=Zn(e,t),i,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var Qn="1.15.3";function V(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var K=V(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Oe=V(/Edge/i),Dt=V(/firefox/i),Ae=V(/safari/i)&&!V(/chrome/i)&&!V(/android/i),rn=V(/iP(ad|od|hone)/i),ln=V(/chrome/i)&&V(/android/i),sn={capture:!1,passive:!1};function E(e,t,n){e.addEventListener(t,n,!K&&sn)}function b(e,t,n){e.removeEventListener(t,n,!K&&sn)}function Ue(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function cn(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Y(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Ue(e,t):Ue(e,t))||i&&e===n)return e;if(e===n)break}while(e=cn(e))}return null}var At=/\s+/g;function j(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(At," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(At," ")}}function f(e,t,n){var i=e&&e.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=n+(typeof n=="string"?"":"px")}}function Ee(e,t){var n="";if(typeof e=="string")n=e;else do{var i=f(e,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function dn(e,t,n){if(e){var i=e.getElementsByTagName(t),a=0,o=i.length;if(n)for(;a=o,!r)return i;if(i===$())break;i=ne(i,!1)}return!1}function we(e,t,n,i){for(var a=0,o=0,r=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,a=Kn(n,oi);Fe.pluginEvent.bind(p)(e,t,B({dragEl:d,parentEl:D,ghostEl:g,rootEl:C,nextEl:de,lastDownEl:ze,cloneEl:x,cloneHidden:te,dragStarted:Ce,putSortable:_,activeSortable:p.active,originalEvent:i,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee,hideGhostForTarget:bn,unhideGhostForTarget:yn,cloneNowHidden:function(){te=!0},cloneNowShown:function(){te=!1},dispatchSortableEvent:function(o){O({sortable:t,name:o,originalEvent:i})}},a))};function O(e){ai(B({putSortable:_,cloneEl:x,targetEl:d,rootEl:C,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee},e))}var d,D,g,C,de,ze,x,te,be,R,_e,ee,Ne,_,ve=!1,Ge=!1,Ve=[],le,X,tt,nt,Lt,Pt,Ce,ge,Le,Pe=!1,je=!1,$e,P,it=[],ht=!1,Ze=[],Qe=typeof document<"u",Re=rn,kt=Oe||K?"cssFloat":"float",ri=Qe&&!ln&&!rn&&"draggable"in document.createElement("div"),gn=function(){if(Qe){if(K)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),mn=function(e,t){var n=f(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=we(e,0,t),o=we(e,1,t),r=a&&f(a),s=o&&f(o),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+T(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+T(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&r.float&&r.float!=="none"){var h=r.float==="left"?"left":"right";return o&&(s.clear==="both"||s.clear===h)?"vertical":"horizontal"}return a&&(r.display==="block"||r.display==="flex"||r.display==="table"||r.display==="grid"||l>=i&&n[kt]==="none"||o&&n[kt]==="none"&&l+c>i)?"vertical":"horizontal"},li=function(e,t,n){var i=n?e.left:e.top,a=n?e.right:e.bottom,o=n?e.width:e.height,r=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return i===r||a===s||i+o/2===r+l/2},si=function(e,t){var n;return Ve.some(function(i){var a=i[M].options.emptyInsertThreshold;if(!(!a||wt(i))){var o=T(i),r=e>=o.left-a&&e<=o.right+a,s=t>=o.top-a&&t<=o.bottom+a;if(r&&s)return n=i}}),n},vn=function(e){function t(a,o){return function(r,s,l,c){var h=r.options.group.name&&s.options.group.name&&r.options.group.name===s.options.group.name;if(a==null&&(o||h))return!0;if(a==null||a===!1)return!1;if(o&&a==="clone")return a;if(typeof a=="function")return t(a(r,s,l,c),o)(r,s,l,c);var u=(o?r:s).options.group.name;return a===!0||typeof a=="string"&&a===u||a.join&&a.indexOf(u)>-1}}var n={},i=e.group;(!i||Ye(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},bn=function(){!gn&&g&&f(g,"display","none")},yn=function(){!gn&&g&&f(g,"display","")};Qe&&!ln&&document.addEventListener("click",function(e){if(Ge)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ge=!1,!1},!0);var se=function(e){if(d){e=e.touches?e.touches[0]:e;var t=si(e.clientX,e.clientY);if(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[M]._onDragOver(n)}}},ci=function(e){d&&d.parentNode[M]._isOutsideThisEl(e.target)};function p(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Z({},t),e[M]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return mn(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,r){o.setData("Text",r.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:p.supportPointer!==!1&&"PointerEvent"in window&&!Ae,emptyInsertThreshold:5};Fe.initializePlugins(this,e,n);for(var i in n)!(i in t)&&(t[i]=n[i]);vn(t);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=t.forceFallback?!1:ri,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?E(e,"pointerdown",this._onTapStart):(E(e,"mousedown",this._onTapStart),E(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(e,"dragover",this),E(e,"dragenter",this)),Ve.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Z(this,ti())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ge=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,d):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,i=this.options,a=i.preventOnFilter,o=e.type,r=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=i.filter;if(vi(n),!d&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||i.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&Ae&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Y(s,i.draggable,n,!1),!(s&&s.animated)&&ze!==s)){if(be=H(s),_e=H(s,i.draggable),typeof c=="function"){if(c.call(this,e,s,this)){O({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),F("filter",t,{evt:e}),a&&e.cancelable&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(h){if(h=Y(l,h.trim(),n,!1),h)return O({sortable:t,rootEl:h,name:"filter",targetEl:s,fromEl:n,toEl:n}),F("filter",t,{evt:e}),!0}),c)){a&&e.cancelable&&e.preventDefault();return}i.handle&&!Y(l,i.handle,n,!1)||this._prepareDragStart(e,r,s)}}},_prepareDragStart:function(e,t,n){var i=this,a=i.el,o=i.options,r=a.ownerDocument,s;if(n&&!d&&n.parentNode===a){var l=T(n);if(C=a,d=n,D=d.parentNode,de=d.nextSibling,ze=n,Ne=o.group,p.dragged=d,le={target:d,clientX:(t||e).clientX,clientY:(t||e).clientY},Lt=le.clientX-l.left,Pt=le.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,d.style["will-change"]="all",s=function(){if(F("delayEnded",i,{evt:e}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Dt&&i.nativeDraggable&&(d.draggable=!0),i._triggerDragStart(e,t),O({sortable:i,name:"choose",originalEvent:e}),j(d,o.chosenClass,!0)},o.ignore.split(",").forEach(function(c){dn(d,c.trim(),at)}),E(r,"dragover",se),E(r,"mousemove",se),E(r,"touchmove",se),E(r,"mouseup",i._onDrop),E(r,"touchend",i._onDrop),E(r,"touchcancel",i._onDrop),Dt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),F("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Oe||K))){if(p.eventCanceled){this._onDrop();return}E(r,"mouseup",i._disableDelayedDrag),E(r,"touchend",i._disableDelayedDrag),E(r,"touchcancel",i._disableDelayedDrag),E(r,"mousemove",i._delayedDragTouchMoveHandler),E(r,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&E(r,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,o.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&at(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):t?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(d,"dragend",this),E(C,"dragstart",this._onDragStart));try{document.selection?Be(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(ve=!1,C&&d){F("dragStarted",this,{evt:t}),this.nativeDraggable&&E(document,"dragover",ci);var n=this.options;!e&&j(d,n.dragClass,!1),j(d,n.ghostClass,!0),p.active=this,e&&this._appendGhost(),O({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(X){this._lastX=X.clientX,this._lastY=X.clientY,bn();for(var e=document.elementFromPoint(X.clientX,X.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(X.clientX,X.clientY),e!==t);)t=e;if(d.parentNode[M]._isOutsideThisEl(e),t)do{if(t[M]){var n=void 0;if(n=t[M]._onDragOver({clientX:X.clientX,clientY:X.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=cn(t));yn()}},_onTouchMove:function(e){if(le){var t=this.options,n=t.fallbackTolerance,i=t.fallbackOffset,a=e.touches?e.touches[0]:e,o=g&&Ee(g,!0),r=g&&o&&o.a,s=g&&o&&o.d,l=Re&&P&&_t(P),c=(a.clientX-le.clientX+i.x)/(r||1)+(l?l[0]-it[0]:0)/(r||1),h=(a.clientY-le.clientY+i.y)/(s||1)+(l?l[1]-it[1]:0)/(s||1);if(!p.active&&!ve){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))=0&&(O({rootEl:D,name:"add",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"remove",toEl:D,originalEvent:e}),O({rootEl:D,name:"sort",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),_&&_.save()):R!==be&&R>=0&&(O({sortable:this,name:"update",toEl:D,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),p.active&&((R==null||R===-1)&&(R=be,ee=_e),O({sortable:this,name:"end",toEl:D,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){F("nulling",this),C=d=D=g=de=x=ze=te=le=X=Ce=R=ee=be=_e=ge=Le=_=Ne=p.dragged=p.ghost=p.clone=p.active=null,Ze.forEach(function(e){e.checked=!0}),Ze.length=tt=nt=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":d&&(this._onDragOver(e),di(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,i=0,a=n.length,o=this.options;ia.right+o||e.clientY>i.bottom&&e.clientX>i.left:e.clientY>a.bottom+o||e.clientX>i.right&&e.clientY>i.top}function pi(e,t,n,i,a,o,r,s){var l=i?e.clientY:e.clientX,c=i?n.height:n.width,h=i?n.top:n.left,u=i?n.bottom:n.right,y=!1;if(!r){if(s&&$eh+c*o/2:lu-$e)return-Le}else if(l>h+c*(1-a)/2&&lu-c*o/2)?l>h+c/2?1:-1:0}function gi(e){return H(d)e.canPull({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})},...!!e.canPut&&{put:(o,r,s,{newIndex:l,oldIndex:c})=>e.canPut({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})}}},handle:i,filter:`${i}[disabled]`,onStart:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!0,wi(),e.onDragStart({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onEnd:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!1,Si(),e.onDragEnd({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onSort:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{e.onDragSort({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})}})}function wn(e){Sn(e)||(qe.delete(e),e.sortable?.destroy(),e.sortable=null)}const mt={active:!1};function Sn(e){return e.dragEnabled&&mt.active}function wi(){Array.from(qe).forEach(e=>e.onGlobalDragStart())}function Si(){Array.from(qe).forEach(e=>e.onGlobalDragEnd())}const me={container:"container",actionsStart:"actions-start",contentStart:"content-start",content:"content",contentEnd:"content-end",actionsEnd:"actions-end"},ye={actionsStart:"actions-start",contentStart:"content-start",contentEnd:"content-end",actionsEnd:"actions-end"},Ii=":host([disabled]) .content{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) .content *,:host([disabled]) .content ::slotted(*){pointer-events:none}:host{display:flex;flex:1 1 0%;flex-direction:column}.container{display:flex;flex:1 1 auto;align-items:stretch;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;font-size:var(--calcite-font-size--2);line-height:1.375;padding-inline:var(--calcite-stack-padding-inline, 0.75rem);padding-block:var(--calcite-stack-padding-block, 0.5rem)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:0 1 auto}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start,.actions-end,.content-start,.content-end{display:flex;align-items:center}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}:host([hidden]){display:none}[hidden]{display:none}",Ci=Ii,xi=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.handleActionsStartSlotChange=e=>{this.hasActionsStart=he(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=he(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=he(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=he(e)},this.disabled=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasContentStart=!1,this.hasContentEnd=!1}renderActionsStart(){const{hasActionsStart:e}=this;return v("div",{class:me.actionsStart,hidden:!e,key:"actions-start-container"},v("slot",{name:ye.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{hasActionsEnd:e}=this;return v("div",{class:me.actionsEnd,hidden:!e,key:"actions-end-container"},v("slot",{name:ye.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}))}renderContentStart(){const{hasContentStart:e}=this;return v("div",{class:me.contentStart,hidden:!e},v("slot",{name:ye.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderDefaultContent(){return v("div",{class:me.content},v("slot",null))}renderContentEnd(){const{hasContentEnd:e}=this;return v("div",{class:me.contentEnd,hidden:!e},v("slot",{name:ye.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}render(){return v(Nn,{key:"97f052828720d715fd3b11a4b0e77fa085127796"},v("div",{key:"5351cc20a8a437763894fef35ecc7a7240cb7c46",class:me.container},this.renderActionsStart(),this.renderContentStart(),this.renderDefaultContent(),this.renderContentEnd(),this.renderActionsEnd()))}static get style(){return Ci}},[1,"calcite-stack",{disabled:[516],hasActionsStart:[32],hasActionsEnd:[32],hasContentStart:[32],hasContentEnd:[32]}]);function In(){typeof customElements>"u"||["calcite-stack"].forEach(e=>{switch(e){case"calcite-stack":customElements.get(e)||customElements.define(e,xi);break}})}In();function Di(e,t){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n-1&&e%1==0&&e-1&&e%1==0&&e<=Ri}function Hi(e){return e!=null&&Dn(e.length)&&!Fi(e)}var Xi=Object.prototype;function Yi(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Xi;return e===n}function zi(e,t){for(var n=-1,i=Array(e);++n{const i=Ya(t),a=new RegExp(i,"i");e.length===0&&console.warn(`No data was passed to the filter function. +import{p as vt,b as bt,a as v,D as Nn,W as ce,h as jn}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{G as he,A as Rn}from"./dom-N58V0tYi-DBU3jlah.js";import{l as zt,p as $t}from"./interactive-DqhNilgd-BbTDbq0n.js";import{c as Hn}from"./observers-BigwqTsw-CfIXp3Nz.js";import{t as Xn}from"./resources4-Bi43yZeq-Ca3PT_gb.js";import{f as Yn,m as zn}from"./utils3-BSH0zqNl-90fd1I_b.js";import{o as Bt,r as Wt,f as Ut}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{l as Gt,h as Vt,d as Zt,M as Kt}from"./t9n-C_hcZMZJ-Du2NPCXI.js";import{K as Qt,q as qt,X as It}from"./locale-Cn_GDVD_-CCUxSwPB.js";import{b as Ct,A as yt,O as $n,l as Jt,W as Et,$ as Bn,D as Wn,g as en}from"./debounce-27Hmkkyg-Th7bw3mg.js";import{m as tn}from"./icon-BXFbBbop-Bq4Zv26A.js";import{z as nn,w as an,M as on}from"./input2-eOtqu-iO-DiRyHCWP.js";import{v as Un}from"./loader-Ch7Jr16w-CF4bv9QO.js";import{c as Gn}from"./scrim-BscQh4v9-CloQFru7.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./form-CRSw616T-wY3ZjFlq.js";import"./label-Dys24PJn-BCewo2Re.js";import"./component-CWGf1hug-BASJpoEG.js";import"./guid-Dls486Er-CBh637k4.js";function xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,i)}return n}function B(e){for(var t=1;t=0)&&(n[a]=e[a]);return n}function Kn(e,t){if(e==null)return{};var n=Zn(e,t),i,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var Qn="1.15.3";function V(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var K=V(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Oe=V(/Edge/i),Dt=V(/firefox/i),Ae=V(/safari/i)&&!V(/chrome/i)&&!V(/android/i),rn=V(/iP(ad|od|hone)/i),ln=V(/chrome/i)&&V(/android/i),sn={capture:!1,passive:!1};function E(e,t,n){e.addEventListener(t,n,!K&&sn)}function b(e,t,n){e.removeEventListener(t,n,!K&&sn)}function Ue(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function cn(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function Y(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Ue(e,t):Ue(e,t))||i&&e===n)return e;if(e===n)break}while(e=cn(e))}return null}var At=/\s+/g;function j(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(At," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(At," ")}}function f(e,t,n){var i=e&&e.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=n+(typeof n=="string"?"":"px")}}function Ee(e,t){var n="";if(typeof e=="string")n=e;else do{var i=f(e,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function dn(e,t,n){if(e){var i=e.getElementsByTagName(t),a=0,o=i.length;if(n)for(;a=o,!r)return i;if(i===$())break;i=ne(i,!1)}return!1}function we(e,t,n,i){for(var a=0,o=0,r=e.children;o2&&arguments[2]!==void 0?arguments[2]:{},i=n.evt,a=Kn(n,oi);Fe.pluginEvent.bind(p)(e,t,B({dragEl:d,parentEl:D,ghostEl:g,rootEl:C,nextEl:de,lastDownEl:ze,cloneEl:x,cloneHidden:te,dragStarted:Ce,putSortable:_,activeSortable:p.active,originalEvent:i,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee,hideGhostForTarget:bn,unhideGhostForTarget:yn,cloneNowHidden:function(){te=!0},cloneNowShown:function(){te=!1},dispatchSortableEvent:function(o){O({sortable:t,name:o,originalEvent:i})}},a))};function O(e){ai(B({putSortable:_,cloneEl:x,targetEl:d,rootEl:C,oldIndex:be,oldDraggableIndex:_e,newIndex:R,newDraggableIndex:ee},e))}var d,D,g,C,de,ze,x,te,be,R,_e,ee,Ne,_,ve=!1,Ge=!1,Ve=[],le,X,tt,nt,Lt,Pt,Ce,ge,Le,Pe=!1,je=!1,$e,P,it=[],ht=!1,Ze=[],Qe=typeof document<"u",Re=rn,kt=Oe||K?"cssFloat":"float",ri=Qe&&!ln&&!rn&&"draggable"in document.createElement("div"),gn=function(){if(Qe){if(K)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),mn=function(e,t){var n=f(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=we(e,0,t),o=we(e,1,t),r=a&&f(a),s=o&&f(o),l=r&&parseInt(r.marginLeft)+parseInt(r.marginRight)+T(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+T(o).width;if(n.display==="flex")return n.flexDirection==="column"||n.flexDirection==="column-reverse"?"vertical":"horizontal";if(n.display==="grid")return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&r.float&&r.float!=="none"){var h=r.float==="left"?"left":"right";return o&&(s.clear==="both"||s.clear===h)?"vertical":"horizontal"}return a&&(r.display==="block"||r.display==="flex"||r.display==="table"||r.display==="grid"||l>=i&&n[kt]==="none"||o&&n[kt]==="none"&&l+c>i)?"vertical":"horizontal"},li=function(e,t,n){var i=n?e.left:e.top,a=n?e.right:e.bottom,o=n?e.width:e.height,r=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return i===r||a===s||i+o/2===r+l/2},si=function(e,t){var n;return Ve.some(function(i){var a=i[M].options.emptyInsertThreshold;if(!(!a||wt(i))){var o=T(i),r=e>=o.left-a&&e<=o.right+a,s=t>=o.top-a&&t<=o.bottom+a;if(r&&s)return n=i}}),n},vn=function(e){function t(a,o){return function(r,s,l,c){var h=r.options.group.name&&s.options.group.name&&r.options.group.name===s.options.group.name;if(a==null&&(o||h))return!0;if(a==null||a===!1)return!1;if(o&&a==="clone")return a;if(typeof a=="function")return t(a(r,s,l,c),o)(r,s,l,c);var u=(o?r:s).options.group.name;return a===!0||typeof a=="string"&&a===u||a.join&&a.indexOf(u)>-1}}var n={},i=e.group;(!i||Ye(i)!="object")&&(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},bn=function(){!gn&&g&&f(g,"display","none")},yn=function(){!gn&&g&&f(g,"display","")};Qe&&!ln&&document.addEventListener("click",function(e){if(Ge)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ge=!1,!1},!0);var se=function(e){if(d){e=e.touches?e.touches[0]:e;var t=si(e.clientX,e.clientY);if(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[M]._onDragOver(n)}}},ci=function(e){d&&d.parentNode[M]._isOutsideThisEl(e.target)};function p(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Z({},t),e[M]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return mn(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,r){o.setData("Text",r.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:p.supportPointer!==!1&&"PointerEvent"in window&&!Ae,emptyInsertThreshold:5};Fe.initializePlugins(this,e,n);for(var i in n)!(i in t)&&(t[i]=n[i]);vn(t);for(var a in this)a.charAt(0)==="_"&&typeof this[a]=="function"&&(this[a]=this[a].bind(this));this.nativeDraggable=t.forceFallback?!1:ri,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?E(e,"pointerdown",this._onTapStart):(E(e,"mousedown",this._onTapStart),E(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(E(e,"dragover",this),E(e,"dragenter",this)),Ve.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Z(this,ti())}p.prototype={constructor:p,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ge=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,d):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,i=this.options,a=i.preventOnFilter,o=e.type,r=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,s=(r||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=i.filter;if(vi(n),!d&&!(/mousedown|pointerdown/.test(o)&&e.button!==0||i.disabled)&&!l.isContentEditable&&!(!this.nativeDraggable&&Ae&&s&&s.tagName.toUpperCase()==="SELECT")&&(s=Y(s,i.draggable,n,!1),!(s&&s.animated)&&ze!==s)){if(be=H(s),_e=H(s,i.draggable),typeof c=="function"){if(c.call(this,e,s,this)){O({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),F("filter",t,{evt:e}),a&&e.cancelable&&e.preventDefault();return}}else if(c&&(c=c.split(",").some(function(h){if(h=Y(l,h.trim(),n,!1),h)return O({sortable:t,rootEl:h,name:"filter",targetEl:s,fromEl:n,toEl:n}),F("filter",t,{evt:e}),!0}),c)){a&&e.cancelable&&e.preventDefault();return}i.handle&&!Y(l,i.handle,n,!1)||this._prepareDragStart(e,r,s)}}},_prepareDragStart:function(e,t,n){var i=this,a=i.el,o=i.options,r=a.ownerDocument,s;if(n&&!d&&n.parentNode===a){var l=T(n);if(C=a,d=n,D=d.parentNode,de=d.nextSibling,ze=n,Ne=o.group,p.dragged=d,le={target:d,clientX:(t||e).clientX,clientY:(t||e).clientY},Lt=le.clientX-l.left,Pt=le.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,d.style["will-change"]="all",s=function(){if(F("delayEnded",i,{evt:e}),p.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Dt&&i.nativeDraggable&&(d.draggable=!0),i._triggerDragStart(e,t),O({sortable:i,name:"choose",originalEvent:e}),j(d,o.chosenClass,!0)},o.ignore.split(",").forEach(function(c){dn(d,c.trim(),at)}),E(r,"dragover",se),E(r,"mousemove",se),E(r,"touchmove",se),E(r,"mouseup",i._onDrop),E(r,"touchend",i._onDrop),E(r,"touchcancel",i._onDrop),Dt&&this.nativeDraggable&&(this.options.touchStartThreshold=4,d.draggable=!0),F("delayStart",this,{evt:e}),o.delay&&(!o.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Oe||K))){if(p.eventCanceled){this._onDrop();return}E(r,"mouseup",i._disableDelayedDrag),E(r,"touchend",i._disableDelayedDrag),E(r,"touchcancel",i._disableDelayedDrag),E(r,"mousemove",i._delayedDragTouchMoveHandler),E(r,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&E(r,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(s,o.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){d&&at(d),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;b(e,"mouseup",this._disableDelayedDrag),b(e,"touchend",this._disableDelayedDrag),b(e,"touchcancel",this._disableDelayedDrag),b(e,"mousemove",this._delayedDragTouchMoveHandler),b(e,"touchmove",this._delayedDragTouchMoveHandler),b(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?E(document,"pointermove",this._onTouchMove):t?E(document,"touchmove",this._onTouchMove):E(document,"mousemove",this._onTouchMove):(E(d,"dragend",this),E(C,"dragstart",this._onDragStart));try{document.selection?Be(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(ve=!1,C&&d){F("dragStarted",this,{evt:t}),this.nativeDraggable&&E(document,"dragover",ci);var n=this.options;!e&&j(d,n.dragClass,!1),j(d,n.ghostClass,!0),p.active=this,e&&this._appendGhost(),O({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(X){this._lastX=X.clientX,this._lastY=X.clientY,bn();for(var e=document.elementFromPoint(X.clientX,X.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(X.clientX,X.clientY),e!==t);)t=e;if(d.parentNode[M]._isOutsideThisEl(e),t)do{if(t[M]){var n=void 0;if(n=t[M]._onDragOver({clientX:X.clientX,clientY:X.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=cn(t));yn()}},_onTouchMove:function(e){if(le){var t=this.options,n=t.fallbackTolerance,i=t.fallbackOffset,a=e.touches?e.touches[0]:e,o=g&&Ee(g,!0),r=g&&o&&o.a,s=g&&o&&o.d,l=Re&&P&&_t(P),c=(a.clientX-le.clientX+i.x)/(r||1)+(l?l[0]-it[0]:0)/(r||1),h=(a.clientY-le.clientY+i.y)/(s||1)+(l?l[1]-it[1]:0)/(s||1);if(!p.active&&!ve){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))=0&&(O({rootEl:D,name:"add",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"remove",toEl:D,originalEvent:e}),O({rootEl:D,name:"sort",toEl:D,fromEl:C,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),_&&_.save()):R!==be&&R>=0&&(O({sortable:this,name:"update",toEl:D,originalEvent:e}),O({sortable:this,name:"sort",toEl:D,originalEvent:e})),p.active&&((R==null||R===-1)&&(R=be,ee=_e),O({sortable:this,name:"end",toEl:D,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){F("nulling",this),C=d=D=g=de=x=ze=te=le=X=Ce=R=ee=be=_e=ge=Le=_=Ne=p.dragged=p.ghost=p.clone=p.active=null,Ze.forEach(function(e){e.checked=!0}),Ze.length=tt=nt=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":d&&(this._onDragOver(e),di(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,i=0,a=n.length,o=this.options;ia.right+o||e.clientY>i.bottom&&e.clientX>i.left:e.clientY>a.bottom+o||e.clientX>i.right&&e.clientY>i.top}function pi(e,t,n,i,a,o,r,s){var l=i?e.clientY:e.clientX,c=i?n.height:n.width,h=i?n.top:n.left,u=i?n.bottom:n.right,y=!1;if(!r){if(s&&$eh+c*o/2:lu-$e)return-Le}else if(l>h+c*(1-a)/2&&lu-c*o/2)?l>h+c/2?1:-1:0}function gi(e){return H(d)e.canPull({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})},...!!e.canPut&&{put:(o,r,s,{newIndex:l,oldIndex:c})=>e.canPut({toEl:o.el,fromEl:r.el,dragEl:s,newIndex:l,oldIndex:c})}}},handle:i,filter:`${i}[disabled]`,onStart:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!0,wi(),e.onDragStart({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onEnd:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{mt.active=!1,Si(),e.onDragEnd({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})},onSort:({from:o,item:r,to:s,newIndex:l,oldIndex:c})=>{e.onDragSort({fromEl:o,dragEl:r,toEl:s,newIndex:l,oldIndex:c})}})}function wn(e){Sn(e)||(qe.delete(e),e.sortable?.destroy(),e.sortable=null)}const mt={active:!1};function Sn(e){return e.dragEnabled&&mt.active}function wi(){Array.from(qe).forEach(e=>e.onGlobalDragStart())}function Si(){Array.from(qe).forEach(e=>e.onGlobalDragEnd())}const me={container:"container",actionsStart:"actions-start",contentStart:"content-start",content:"content",contentEnd:"content-end",actionsEnd:"actions-end"},ye={actionsStart:"actions-start",contentStart:"content-start",contentEnd:"content-end",actionsEnd:"actions-end"},Ii=":host([disabled]) .content{cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) .content *,:host([disabled]) .content ::slotted(*){pointer-events:none}:host{display:flex;flex:1 1 0%;flex-direction:column}.container{display:flex;flex:1 1 auto;align-items:stretch;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}.content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;font-size:var(--calcite-font-size--2);line-height:1.375;padding-inline:var(--calcite-stack-padding-inline, 0.75rem);padding-block:var(--calcite-stack-padding-block, 0.5rem)}.content-start{justify-content:flex-start}.content-end{justify-content:flex-end}.content-start,.content-end{flex:0 1 auto}.content-start ::slotted(calcite-icon),.content-end ::slotted(calcite-icon){margin-inline:0.75rem;align-self:center}.actions-start,.actions-end,.content-start,.content-end{display:flex;align-items:center}.actions-start ::slotted(calcite-action),.actions-start ::slotted(calcite-action-menu),.actions-start ::slotted(calcite-handle),.actions-start ::slotted(calcite-dropdown),.actions-end ::slotted(calcite-action),.actions-end ::slotted(calcite-action-menu),.actions-end ::slotted(calcite-handle),.actions-end ::slotted(calcite-dropdown){align-self:stretch;color:inherit}:host([hidden]){display:none}[hidden]{display:none}",Ci=Ii,xi=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.handleActionsStartSlotChange=e=>{this.hasActionsStart=he(e)},this.handleActionsEndSlotChange=e=>{this.hasActionsEnd=he(e)},this.handleContentStartSlotChange=e=>{this.hasContentStart=he(e)},this.handleContentEndSlotChange=e=>{this.hasContentEnd=he(e)},this.disabled=!1,this.hasActionsStart=!1,this.hasActionsEnd=!1,this.hasContentStart=!1,this.hasContentEnd=!1}renderActionsStart(){const{hasActionsStart:e}=this;return v("div",{class:me.actionsStart,hidden:!e,key:"actions-start-container"},v("slot",{name:ye.actionsStart,onSlotchange:this.handleActionsStartSlotChange}))}renderActionsEnd(){const{hasActionsEnd:e}=this;return v("div",{class:me.actionsEnd,hidden:!e,key:"actions-end-container"},v("slot",{name:ye.actionsEnd,onSlotchange:this.handleActionsEndSlotChange}))}renderContentStart(){const{hasContentStart:e}=this;return v("div",{class:me.contentStart,hidden:!e},v("slot",{name:ye.contentStart,onSlotchange:this.handleContentStartSlotChange}))}renderDefaultContent(){return v("div",{class:me.content},v("slot",null))}renderContentEnd(){const{hasContentEnd:e}=this;return v("div",{class:me.contentEnd,hidden:!e},v("slot",{name:ye.contentEnd,onSlotchange:this.handleContentEndSlotChange}))}render(){return v(Nn,{key:"97f052828720d715fd3b11a4b0e77fa085127796"},v("div",{key:"5351cc20a8a437763894fef35ecc7a7240cb7c46",class:me.container},this.renderActionsStart(),this.renderContentStart(),this.renderDefaultContent(),this.renderContentEnd(),this.renderActionsEnd()))}static get style(){return Ci}},[1,"calcite-stack",{disabled:[516],hasActionsStart:[32],hasActionsEnd:[32],hasContentStart:[32],hasContentEnd:[32]}]);function In(){typeof customElements>"u"||["calcite-stack"].forEach(e=>{switch(e){case"calcite-stack":customElements.get(e)||customElements.define(e,xi);break}})}In();function Di(e,t){for(var n=-1,i=e==null?0:e.length,a=Array(i);++n-1&&e%1==0&&e-1&&e%1==0&&e<=Ri}function Hi(e){return e!=null&&Dn(e.length)&&!Fi(e)}var Xi=Object.prototype;function Yi(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Xi;return e===n}function zi(e,t){for(var n=-1,i=Array(e);++n{const i=Ya(t),a=new RegExp(i,"i");e.length===0&&console.warn(`No data was passed to the filter function. The data argument should be an array of objects`);const o=(r,s,l)=>{if(r?.constant||r?.filterDisabled)return!0;let c=!1;return za(r,(h,u)=>{typeof h=="function"||h==null||l&&!l.includes(u)||(Array.isArray(h)||typeof h=="object"&&h!==null?o(h,s)&&(c=!0):s.test(h)&&(c=!0))}),c};return e.filter(r=>o(r,a,n))},$a={container:"container",searchIcon:"search-icon"},Ba={search:"search",close:"x"},Wa=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;inline-size:100%}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{display:flex;inline-size:100%;padding:0.5rem}label{position:relative;margin-inline:0.25rem;margin-block:0px;display:flex;inline-size:100%;align-items:center;overflow:hidden}input[type=text]{margin-block-end:0.25rem;inline-size:100%;border-style:none;background-color:transparent;padding-block:0.25rem;font-family:inherit;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);padding-inline-end:0.25rem;padding-inline-start:1.5rem;transition:padding var(--calcite-animation-timing), box-shadow var(--calcite-animation-timing)}input[type=text]::-ms-clear{display:none}calcite-input{inline-size:100%}.search-icon{position:absolute;display:flex;color:var(--calcite-color-text-2);inset-inline-start:0;transition:inset-inline-start var(--calcite-animation-timing), inset-inline-end var(--calcite-animation-timing), opacity var(--calcite-animation-timing)}input[type=text]:focus{border-color:var(--calcite-color-brand);outline:2px solid transparent;outline-offset:2px;padding-inline:0.25rem}input[type=text]:focus~.search-icon{inset-inline-start:calc(1rem * -1);opacity:0}.clear-button{display:flex;cursor:pointer;align-items:center;border-width:0px;background-color:transparent;color:var(--calcite-color-text-2)}.clear-button:hover,.clear-button:focus{color:var(--calcite-color-text-1)}:host([hidden]){display:none}[hidden]{display:none}",Ua=Wa,Ga=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteFilterChange=ce(this,"calciteFilterChange",6),this.filterDebounced=Jt((e,t=!1,n)=>this.updateFiltered(Yt(this.items??[],e,this.filterProps),t,n),jn.filter),this.inputHandler=e=>{const t=e.target;this.value=t.value,this.filterDebounced(t.value,!0)},this.keyDownHandler=e=>{e.defaultPrevented||(e.key==="Escape"&&(this.clear(),e.preventDefault()),e.key==="Enter"&&e.preventDefault())},this.clear=()=>{this.value="",this.filterDebounced("",!0),this.setFocus()},this.items=[],this.disabled=!1,this.filteredItems=[],this.filterProps=void 0,this.placeholder=void 0,this.scale="m",this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0}watchItemsHandler(){this.filterDebounced(this.value)}filterPropsHandler(){this.filterDebounced(this.value)}onMessagesChange(){}valueHandler(e){this.filterDebounced(e)}effectiveLocaleChange(){Gt(this,this.effectiveLocale)}async componentWillLoad(){Bt(this),this.updateFiltered(Yt(this.items??[],this.value,this.filterProps)),await Vt(this)}connectedCallback(){Qt(this),Zt(this)}componentDidRender(){zt(this)}disconnectedCallback(){qt(this),Kt(this),this.filterDebounced.cancel()}componentDidLoad(){Wt(this)}async filter(e=this.value){return new Promise(t=>{this.value=e,this.filterDebounced(e,!1,t)})}async setFocus(){return await Ut(this),this.textInput?.setFocus()}updateFiltered(e,t=!1,n){this.filteredItems=e,t&&this.calciteFilterChange.emit(),n?.()}render(){const{disabled:e,scale:t}=this;return v($t,{key:"c4a624e52409ed90839b506f5d99ab623767260e",disabled:e},v("div",{key:"1f2ef99156489719dd2f938bc5ce8a05185866bf",class:$a.container},v("label",{key:"6fe8c6cf73f554908be38299263d23380a4ed089"},v("calcite-input",{key:"6765e00d208d6898221540769865d84aa1c64974",clearable:!0,disabled:e,icon:Ba.search,label:this.messages.label,messageOverrides:{clear:this.messages.clear},onCalciteInputInput:this.inputHandler,onKeyDown:this.keyDownHandler,placeholder:this.placeholder,ref:n=>{this.textInput=n},scale:t,type:"text",value:this.value}))))}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{items:["watchItemsHandler"],filterProps:["filterPropsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ua}},[17,"calcite-filter",{items:[16],disabled:[516],filteredItems:[1040],filterProps:[16],placeholder:[1],scale:[513],value:[1025],messages:[1040],messageOverrides:[1040],effectiveLocale:[32],defaultMessages:[32],filter:[64],setFocus:[64]},void 0,{items:["watchItemsHandler"],filterProps:["filterPropsHandler"],messageOverrides:["onMessagesChange"],value:["valueHandler"],effectiveLocale:["effectiveLocaleChange"]}]);function Pn(){typeof customElements>"u"||["calcite-filter","calcite-icon","calcite-input","calcite-input-message","calcite-progress"].forEach(e=>{switch(e){case"calcite-filter":customElements.get(e)||customElements.define(e,Ga);break;case"calcite-icon":customElements.get(e)||tn();break;case"calcite-input":customElements.get(e)||on();break;case"calcite-input-message":customElements.get(e)||an();break;case"calcite-progress":customElements.get(e)||nn();break}})}Pn();const J={container:"container",table:"table",scrim:"scrim",stack:"stack",tableContainer:"table-container",sticky:"sticky-pos",assistiveText:"assistive-text"},Va=0,dt={filterNoResults:"filter-no-results",filterActionsStart:"filter-actions-start",filterActionsEnd:"filter-actions-end"},Za=":host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.container{position:relative}.table-container{box-sizing:border-box;display:flex;inline-size:100%;flex-direction:column;background-color:transparent}.table-container *{box-sizing:border-box}.table{inline-size:100%;border-collapse:collapse}.stack{--calcite-stack-padding-inline:0;--calcite-stack-padding-block:0}.sticky-pos{position:sticky;inset-block-start:0px;z-index:var(--calcite-z-index-sticky);background-color:var(--calcite-color-foreground-1)}.sticky-pos th{padding:0px}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}",Ka=Za,Xe="calcite-list-item",Qa="calcite-list-item-group, calcite-list-item",kn=vt(class extends bt{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteListChange=ce(this,"calciteListChange",6),this.calciteListDragEnd=ce(this,"calciteListDragEnd",6),this.calciteListDragStart=ce(this,"calciteListDragStart",6),this.calciteListFilter=ce(this,"calciteListFilter",6),this.calciteListOrderChange=ce(this,"calciteListOrderChange",6),this.calciteInternalListDefaultSlotChange=ce(this,"calciteInternalListDefaultSlotChange",6),this.dragSelector=Xe,this.focusableItems=[],this.handleSelector="calcite-handle",this.listItems=[],this.mutationObserver=Hn("mutation",()=>this.updateListItems({performFilter:!0})),this.visibleItems=[],this.handleDefaultSlotChange=e=>{Yn(zn(e.target)),this.parentListEl&&this.calciteInternalListDefaultSlotChange.emit()},this.handleFilterActionsStartSlotChange=e=>{this.hasFilterActionsStart=he(e)},this.handleFilterActionsEndSlotChange=e=>{this.hasFilterActionsEnd=he(e)},this.handleFilterNoResultsSlotChange=e=>{this.hasFilterNoResults=he(e)},this.setActiveListItem=()=>{const{focusableItems:e}=this;e.some(t=>t.active)||e[0]&&(e[0].active=!0)},this.updateSelectedItems=(e=!1)=>{this.selectedItems=this.visibleItems.filter(t=>t.selected),e&&this.calciteListChange.emit()},this.borderItems=()=>{const e=this.visibleItems.filter(t=>!t.filterHidden&&this.allParentListItemsOpen(t));e.forEach(t=>t.bordered=t!==e[e.length-1])},this.updateFilteredItems=(e=!1)=>{const{visibleItems:t,filteredData:n,filterText:i}=this,a=n.map(l=>l.value),o=t?.filter(l=>t.every(c=>c===l||!l.contains(c))),r=t.filter(l=>!i||a.includes(l.value))||[],s=new WeakSet;o.forEach(l=>this.filterElements({el:l,filteredItems:r,visibleParents:s})),this.filteredItems=r,e&&this.calciteListFilter.emit()},this.setFilterEl=e=>{this.filterEl=e,this.performFilter()},this.handleFilterChange=e=>{e.stopPropagation();const{value:t}=e.currentTarget;this.filterText=t,this.updateFilteredData(!0)},this.getItemData=()=>this.listItems.map(e=>({label:e.label,description:e.description,metadata:e.metadata,value:e.value})),this.updateListItems=Jt(e=>{const t=e?.emitFilterChange??!1,n=e?.performFilter??!1,{selectionAppearance:i,selectionMode:a,dragEnabled:o,el:r,filterEl:s,filterEnabled:l}=this,c=Array.from(this.el.querySelectorAll(Xe));if(c.forEach(h=>{h.selectionAppearance=i,h.selectionMode=a,h.closest("calcite-list")===r&&(h.dragHandle=o)}),this.parentListEl){this.setUpSorting();return}this.listItems=c,l&&n&&(this.dataForFilter=this.getItemData(),s&&(s.items=this.dataForFilter,this.filterAndUpdateData())),this.visibleItems=this.listItems.filter(h=>!h.closed&&!h.hidden),this.updateFilteredItems(t),this.borderItems(),this.focusableItems=this.filteredItems.filter(h=>!h.disabled),this.setActiveListItem(),this.updateSelectedItems(),this.setUpSorting()},Va),this.focusRow=e=>{const{focusableItems:t}=this;e&&(t.forEach(n=>n.active=n===e),e.setFocus())},this.isNavigable=e=>{const t=e.parentElement?.closest(Xe);return t?t.open&&this.isNavigable(t):!0},this.handleListKeydown=e=>{if(e.defaultPrevented||this.parentListEl)return;const{key:t}=e,n=this.focusableItems.filter(a=>this.isNavigable(a)),i=n.findIndex(a=>a.active);if(t==="ArrowDown"){e.preventDefault();const a=e.target===this.filterEl?0:i+1;n[a]&&this.focusRow(n[a])}else if(t==="ArrowUp"){if(e.preventDefault(),i===0&&this.filterEnabled){this.filterEl?.setFocus();return}const a=i-1;n[a]&&this.focusRow(n[a])}else if(t==="Home"){e.preventDefault();const a=n[0];a&&this.focusRow(a)}else if(t==="End"){e.preventDefault();const a=n[n.length-1];a&&this.focusRow(a)}},this.disabled=!1,this.canPull=void 0,this.canPut=void 0,this.dragEnabled=!1,this.group=void 0,this.filterEnabled=!1,this.filteredItems=[],this.filteredData=[],this.filterPlaceholder=void 0,this.filterText=void 0,this.label=void 0,this.loading=!1,this.filterProps=void 0,this.messageOverrides=void 0,this.messages=void 0,this.numberingSystem=void 0,this.openable=!1,this.selectedItems=[],this.selectionMode="none",this.selectionAppearance="icon",this.effectiveLocale="",this.defaultMessages=void 0,this.assistiveText=void 0,this.dataForFilter=[],this.hasFilterActionsEnd=!1,this.hasFilterActionsStart=!1,this.hasFilterNoResults=!1}async handleFilterTextChange(){this.performFilter()}async handleFilterPropsChange(){this.performFilter()}onMessagesChange(){}handleListItemChange(){this.updateListItems({performFilter:!0})}handleCalciteListItemToggle(e){this.parentListEl||(e.stopPropagation(),this.borderItems())}handleCalciteInternalFocusPreviousItem(e){if(this.parentListEl)return;e.stopPropagation();const{focusableItems:t}=this,n=t.findIndex(i=>i.active)-1;t[n]&&this.focusRow(t[n])}handleCalciteInternalListItemActive(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:n}=this;n.forEach(i=>{i.active=i===t})}handleCalciteListItemSelect(){this.parentListEl||this.updateSelectedItems(!0)}handleCalciteInternalAssistiveTextChange(e){this.assistiveText=e.detail.message,e.stopPropagation()}handleCalciteHandleNudge(e){this.parentListEl||this.handleNudgeEvent(e)}handleCalciteInternalListItemSelect(e){if(this.parentListEl)return;e.stopPropagation();const t=e.target,{listItems:n,selectionMode:i}=this;t.selected&&(i==="single"||i==="single-persist")&&n.forEach(a=>a.selected=a===t),this.updateSelectedItems()}handleCalciteInternalListItemSelectMultiple(e){if(this.parentListEl)return;e.stopPropagation();const{target:t,detail:n}=e,{focusableItems:i,lastSelectedInfo:a}=this,o=t;if(n.selectMultiple&&a){const r=i.indexOf(o),s=i.indexOf(a.selectedItem),l=Math.min(s,r),c=Math.max(s,r);i.slice(l,c+1).forEach(h=>h.selected=a.selected)}else this.lastSelectedInfo={selectedItem:o,selected:o.selected}}handleCalciteInternalListItemChange(e){this.parentListEl||(e.stopPropagation(),this.updateListItems())}handleCalciteInternalListItemGroupDefaultSlotChange(e){e.stopPropagation()}connectedCallback(){Qt(this),Zt(this),this.connectObserver(),this.updateListItems({performFilter:!0}),this.setUpSorting(),this.setParentList()}async componentWillLoad(){Bt(this),await Vt(this)}componentDidRender(){zt(this)}componentDidLoad(){Wt(this)}disconnectedCallback(){this.disconnectObserver(),wn(this),qt(this),Kt(this)}effectiveLocaleChange(){Gt(this,this.effectiveLocale)}async setFocus(){return await Ut(this),this.filterEnabled?this.filterEl?.setFocus():this.focusableItems.find(e=>e.active)?.setFocus()}render(){const{loading:e,label:t,disabled:n,dataForFilter:i,filterEnabled:a,filterPlaceholder:o,filterText:r,filteredItems:s,hasFilterActionsStart:l,hasFilterActionsEnd:c,hasFilterNoResults:h,filterProps:u}=this;return v($t,{key:"c3139afe4fe7c7462578a51a4578971c97473167",disabled:this.disabled},v("div",{key:"5e99dc8b479c35609c5f0318723b3da84ec23ef4",class:J.container},this.dragEnabled?v("span",{"aria-live":"assertive",class:J.assistiveText},this.assistiveText):null,this.renderItemAriaLive(),e?v("calcite-scrim",{class:J.scrim,loading:e}):null,v("table",{key:"a31ba050d3141351e491141365e8244ed3ca5303","aria-busy":Rn(e),"aria-label":t||"",class:J.table,onKeyDown:this.handleListKeydown,role:"treegrid"},a||l||c?v("thead",{class:J.sticky},v("tr",null,v("th",{colSpan:Xn},v("calcite-stack",{class:J.stack},v("slot",{name:dt.filterActionsStart,onSlotchange:this.handleFilterActionsStartSlotChange,slot:ye.actionsStart}),v("calcite-filter",{"aria-label":o,disabled:n,filterProps:u,items:i,onCalciteFilterChange:this.handleFilterChange,placeholder:o,ref:this.setFilterEl,value:r}),v("slot",{name:dt.filterActionsEnd,onSlotchange:this.handleFilterActionsEndSlotChange,slot:ye.actionsEnd}))))):null,v("tbody",{key:"3ed1b8d9a4387c3ea0f4ff38e5388be35b32d89b",class:J.tableContainer},v("slot",{key:"712562533b4609749cbff0968bd0a9e77d99758e",onSlotchange:this.handleDefaultSlotChange}))),v("div",{key:"3ff977013e0ca0d58229e1305dca702000d91a99","aria-live":"polite","data-test-id":"no-results-container",hidden:!(h&&a&&r&&!s.length)},v("slot",{key:"7c2bf6389c8b5f4b6f617950e4068baf6b1dc358",name:dt.filterNoResults,onSlotchange:this.handleFilterNoResultsSlotChange}))))}renderItemAriaLive(){const{messages:e,filteredItems:t,parentListEl:n,effectiveLocale:i,numberingSystem:a,filterEnabled:o,filterText:r,filteredData:s}=this;return It.numberFormatOptions={locale:i,numberingSystem:a},n?null:v("div",{"aria-live":"polite",class:J.assistiveText},o&&r&&s?.length?v("div",{key:"aria-filter-enabled"},e.filterEnabled):null,v("div",{key:"aria-item-count"},e.total.replace("{count}",It.localize(t.length.toString()))),t.length?v("ol",{key:"aria-item-list"},t.map(l=>v("li",null,l.label))):null)}connectObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}disconnectObserver(){this.mutationObserver?.disconnect()}setUpSorting(){const{dragEnabled:e}=this;e&&Ei(this)}onGlobalDragStart(){this.disconnectObserver()}onGlobalDragEnd(){this.connectObserver()}onDragEnd(e){this.calciteListDragEnd.emit(e)}onDragStart(e){this.calciteListDragStart.emit(e)}onDragSort(e){this.setParentList(),this.updateListItems(),this.calciteListOrderChange.emit(e)}setParentList(){this.parentListEl=this.el.parentElement?.closest("calcite-list")}filterElements({el:e,filteredItems:t,visibleParents:n}){const i=!n.has(e)&&!t.includes(e);e.filterHidden=i;const a=e.parentElement.closest(Qa);a&&(i||n.add(a),this.filterElements({el:a,filteredItems:t,visibleParents:n}))}allParentListItemsOpen(e){const t=e.parentElement?.closest(Xe);if(t){if(!t.open)return!1}else return!0;return this.allParentListItemsOpen(t)}updateFilteredData(e=!1){const{filterEl:t}=this;t&&(t.filteredItems&&(this.filteredData=t.filteredItems),this.updateListItems({emitFilterChange:e}))}async filterAndUpdateData(){await this.filterEl?.filter(this.filterText),this.updateFilteredData()}performFilter(){const{filterEl:e,filterText:t,filterProps:n}=this;e&&(e.value=t,e.filterProps=n,this.filterAndUpdateData())}handleNudgeEvent(e){const{handleSelector:t,dragSelector:n}=this,{direction:i}=e.detail,a=e.composedPath(),o=a.find(S=>S?.tagName&&S.matches(t)),r=a.find(S=>S?.tagName&&S.matches(n)),s=r?.parentElement;if(!s)return;const{filteredItems:l}=this,c=l.filter(S=>S.parentElement===s),h=c.length-1,u=c.indexOf(r);let y;i==="up"?y=u===0?h:u-1:y=u===h?0:u+1,this.disconnectObserver(),o.blurUnselectDisabled=!0;const m=i==="up"&&y!==h||i==="down"&&y===0?c[y]:c[y].nextSibling;s.insertBefore(r,m),this.updateListItems(),this.connectObserver(),this.calciteListOrderChange.emit({dragEl:r,fromEl:s,toEl:s,newIndex:y,oldIndex:u}),o.setFocus().then(()=>o.blurUnselectDisabled=!1)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{filterText:["handleFilterTextChange"],filterProps:["handleFilterPropsChange"],messageOverrides:["onMessagesChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"],effectiveLocale:["effectiveLocaleChange"]}}static get style(){return Ka}},[1,"calcite-list",{disabled:[516],canPull:[16],canPut:[16],dragEnabled:[516,"drag-enabled"],group:[513],filterEnabled:[516,"filter-enabled"],filteredItems:[1040],filteredData:[1040],filterPlaceholder:[513,"filter-placeholder"],filterText:[1537,"filter-text"],label:[1],loading:[516],filterProps:[16],messageOverrides:[1040],messages:[1040],numberingSystem:[1,"numbering-system"],openable:[4],selectedItems:[1040],selectionMode:[513,"selection-mode"],selectionAppearance:[513,"selection-appearance"],effectiveLocale:[32],defaultMessages:[32],assistiveText:[32],dataForFilter:[32],hasFilterActionsEnd:[32],hasFilterActionsStart:[32],hasFilterNoResults:[32],setFocus:[64]},[[0,"calciteInternalListItemToggle","handleCalciteListItemToggle"],[0,"calciteInternalFocusPreviousItem","handleCalciteInternalFocusPreviousItem"],[0,"calciteInternalListItemActive","handleCalciteInternalListItemActive"],[0,"calciteListItemSelect","handleCalciteListItemSelect"],[0,"calciteInternalAssistiveTextChange","handleCalciteInternalAssistiveTextChange"],[0,"calciteHandleNudge","handleCalciteHandleNudge"],[0,"calciteInternalListItemSelect","handleCalciteInternalListItemSelect"],[0,"calciteInternalListItemSelectMultiple","handleCalciteInternalListItemSelectMultiple"],[0,"calciteInternalListItemChange","handleCalciteInternalListItemChange"],[0,"calciteInternalListItemGroupDefaultSlotChange","handleCalciteInternalListItemGroupDefaultSlotChange"]],{filterText:["handleFilterTextChange"],filterProps:["handleFilterPropsChange"],messageOverrides:["onMessagesChange"],filterEnabled:["handleListItemChange"],group:["handleListItemChange"],dragEnabled:["handleListItemChange"],selectionMode:["handleListItemChange"],selectionAppearance:["handleListItemChange"],effectiveLocale:["effectiveLocaleChange"]}]);function On(){typeof customElements>"u"||["calcite-list","calcite-filter","calcite-icon","calcite-input","calcite-input-message","calcite-loader","calcite-progress","calcite-scrim","calcite-stack"].forEach(e=>{switch(e){case"calcite-list":customElements.get(e)||customElements.define(e,kn);break;case"calcite-filter":customElements.get(e)||Pn();break;case"calcite-icon":customElements.get(e)||tn();break;case"calcite-input":customElements.get(e)||on();break;case"calcite-input-message":customElements.get(e)||an();break;case"calcite-loader":customElements.get(e)||Un();break;case"calcite-progress":customElements.get(e)||nn();break;case"calcite-scrim":customElements.get(e)||Gn();break;case"calcite-stack":customElements.get(e)||In();break}})}On();const wo=kn,So=On;export{wo as CalciteList,So as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-loader-CtpHSU2--B8aaTEnB.js b/custom-toc-highlight/assets/calcite-loader-CtpHSU2--B8aaTEnB.js new file mode 100644 index 00000000..889095c5 --- /dev/null +++ b/custom-toc-highlight/assets/calcite-loader-CtpHSU2--B8aaTEnB.js @@ -0,0 +1 @@ +import{f as o,v as t}from"./loader-Ch7Jr16w-CF4bv9QO.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./guid-Dls486Er-CBh637k4.js";import"./locale-Cn_GDVD_-CCUxSwPB.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-CfIXp3Nz.js";const d=o,l=t;export{d as CalciteLoader,l as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-loader-CtpHSU2--Bzq4cVWG.js b/custom-toc-highlight/assets/calcite-loader-CtpHSU2--Bzq4cVWG.js deleted file mode 100644 index 6da4a775..00000000 --- a/custom-toc-highlight/assets/calcite-loader-CtpHSU2--Bzq4cVWG.js +++ /dev/null @@ -1 +0,0 @@ -import{f as o,v as t}from"./loader-Ch7Jr16w-DUAf9YhQ.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./guid-Dls486Er-CBh637k4.js";import"./locale-Cn_GDVD_-Ar3RKmd3.js";import"./dom-N58V0tYi-DBU3jlah.js";import"./key-CZySMiwx-kmS7VeUz.js";import"./observers-BigwqTsw-BNRQivHR.js";const d=o,l=t;export{d as CalciteLoader,l as defineCustomElement}; diff --git a/custom-toc-highlight/assets/calcite-notice-DeAGopAs-Cd7Uc4RY.js b/custom-toc-highlight/assets/calcite-notice-DeAGopAs-BI9wdRMa.js similarity index 94% rename from custom-toc-highlight/assets/calcite-notice-DeAGopAs-Cd7Uc4RY.js rename to custom-toc-highlight/assets/calcite-notice-DeAGopAs-BI9wdRMa.js index 52873a6d..1e79144d 100644 --- a/custom-toc-highlight/assets/calcite-notice-DeAGopAs-Cd7Uc4RY.js +++ b/custom-toc-highlight/assets/calcite-notice-DeAGopAs-BI9wdRMa.js @@ -1,4 +1,4 @@ -import{p as f,b as p,W as n,a as t}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{s as b,c as u}from"./conditionalSlot-DsCzytJ4-8LGFSrPC.js";import{b as c,w as k}from"./dom-N58V0tYi-DBU3jlah.js";import{o as v,r as x,f as w}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{K as y,q as z}from"./locale-Cn_GDVD_-Ar3RKmd3.js";import{d as C,M as E,h as q,l as N}from"./t9n-C_hcZMZJ-D4zmKT16.js";import{p as s}from"./openCloseComponent-BGQ6h7vg-COvbZ7sG.js";import{e as a}from"./component-CWGf1hug-BASJpoEG.js";import{m as B}from"./icon-BXFbBbop-BUyrjp8g.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-BNRQivHR.js";import"./key-CZySMiwx-kmS7VeUz.js";const l={brand:"lightbulb",danger:"exclamationMarkTriangle",info:"information",success:"checkCircle",warning:"exclamationMarkTriangle"},o={title:"title",message:"message",link:"link",actionsEnd:"actions-end"},i={actionsEnd:"actions-end",close:"notice-close",container:"container",content:"notice-content",icon:"notice-icon"},O=`:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;background-color:var(--calcite-color-foreground-1);opacity:0;overflow:hidden;max-block-size:0;transition-property:opacity, max-block-size;transition-duration:var(--calcite-animation-timing);text-align:start;border-inline-start:var(--calcite-border-width-md) solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( +import{p as f,b as p,W as n,a as t}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{s as b,c as u}from"./conditionalSlot-DsCzytJ4-DM7mn4Oa.js";import{b as c,w as k}from"./dom-N58V0tYi-DBU3jlah.js";import{o as v,r as x,f as w}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{K as y,q as z}from"./locale-Cn_GDVD_-CCUxSwPB.js";import{d as C,M as E,h as q,l as N}from"./t9n-C_hcZMZJ-Du2NPCXI.js";import{p as s}from"./openCloseComponent-BGQ6h7vg-BO0gc3O8.js";import{e as a}from"./component-CWGf1hug-BASJpoEG.js";import{m as B}from"./icon-BXFbBbop-Bq4Zv26A.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./observers-BigwqTsw-CfIXp3Nz.js";import"./key-CZySMiwx-kmS7VeUz.js";const l={brand:"lightbulb",danger:"exclamationMarkTriangle",info:"information",success:"checkCircle",warning:"exclamationMarkTriangle"},o={title:"title",message:"message",link:"link",actionsEnd:"actions-end"},i={actionsEnd:"actions-end",close:"notice-close",container:"container",content:"notice-content",icon:"notice-icon"},O=`:host([scale=s]){--calcite-notice-spacing-token-small:0.5rem;--calcite-notice-spacing-token-large:0.75rem}:host([scale=s]) .container slot[name=title]::slotted(*),:host([scale=s]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=s]) .container slot[name=message]::slotted(*),:host([scale=s]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--2);line-height:1.375}:host([scale=s]) .notice-close{padding:0.5rem}:host([scale=m]){--calcite-notice-spacing-token-small:0.75rem;--calcite-notice-spacing-token-large:1rem}:host([scale=m]) .container slot[name=title]::slotted(*),:host([scale=m]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=m]) .container slot[name=message]::slotted(*),:host([scale=m]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=m]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size--1);line-height:1.375}:host([scale=l]){--calcite-notice-spacing-token-small:1rem;--calcite-notice-spacing-token-large:1.25rem}:host([scale=l]) .container slot[name=title]::slotted(*),:host([scale=l]) .container *::slotted([slot=title]){margin-block:0.125rem;font-size:var(--calcite-font-size-1);line-height:1.375}:host([scale=l]) .container slot[name=message]::slotted(*),:host([scale=l]) .container *::slotted([slot=message]){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([scale=l]) ::slotted(calcite-link){margin-block:0.125rem;font-size:var(--calcite-font-size-0);line-height:1.375}:host([width=auto]){--calcite-notice-width:auto}:host([width=half]){--calcite-notice-width:50%}:host([width=full]){--calcite-notice-width:100%}:host{margin-inline:auto;display:none;max-inline-size:100%;align-items:center;inline-size:var(--calcite-notice-width)}.container{pointer-events:none;margin-block:0px;box-sizing:border-box;display:flex;inline-size:100%;background-color:var(--calcite-color-foreground-1);opacity:0;overflow:hidden;max-block-size:0;transition-property:opacity, max-block-size;transition-duration:var(--calcite-animation-timing);text-align:start;border-inline-start:var(--calcite-border-width-md) solid;box-shadow:0 0 0 0 transparent}.notice-close{outline-color:transparent}.notice-close:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( -2px * calc( 1 - diff --git a/custom-toc-highlight/assets/calcite-tooltip-63c9fmIw-DyfFML0E.js b/custom-toc-highlight/assets/calcite-tooltip-63c9fmIw-BI9m24xG.js similarity index 97% rename from custom-toc-highlight/assets/calcite-tooltip-63c9fmIw-DyfFML0E.js rename to custom-toc-highlight/assets/calcite-tooltip-63c9fmIw-BI9m24xG.js index dbd808e3..c532a2aa 100644 --- a/custom-toc-highlight/assets/calcite-tooltip-63c9fmIw-DyfFML0E.js +++ b/custom-toc-highlight/assets/calcite-tooltip-63c9fmIw-BI9m24xG.js @@ -1 +1 @@ -import{p as g,b as T,W as l,a as s,D as E}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{A as w,U as b,m as H}from"./dom-N58V0tYi-DBU3jlah.js";import{U as y,X as k,q as R,_ as C,j as d}from"./floating-ui-DKFFlLv3--KXNPa_R.js";import{i as L}from"./guid-Dls486Er-CBh637k4.js";import{p as c}from"./openCloseComponent-BGQ6h7vg-COvbZ7sG.js";import{$ as x}from"./FloatingArrow-BG9llDYg-iM1y-TMJ.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";const O={container:"container"},S=300,A=500,h="aria-describedby";function f(o){const{referenceElement:e}=o;return(typeof e=="string"?b(o,{id:e}):e)||null}class D{constructor(){this.registeredElements=new WeakMap,this.registeredShadowRootCounts=new WeakMap,this.hoverOpenTimeout=null,this.hoverCloseTimeout=null,this.activeTooltip=null,this.registeredElementCount=0,this.clickedTooltip=null,this.queryTooltip=e=>{const{registeredElements:t}=this,i=e.find(n=>t.has(n));return t.get(i)},this.keyDownHandler=e=>{if(e.key==="Escape"&&!e.defaultPrevented){const{activeTooltip:t}=this;if(t?.open){this.clearHoverTimeout(),this.closeActiveTooltip();const i=f(t);i instanceof Element&&i.contains(e.target)&&e.preventDefault()}}},this.pointerMoveHandler=e=>{const t=e.composedPath(),{activeTooltip:i}=this,n=this.queryTooltip(t);if(this.pathHasOpenTooltip(n,t)){this.clearHoverTimeout();return}n!==this.clickedTooltip&&(n?this.openHoveredTooltip(n):i?.open&&this.closeHoveredTooltip(),this.clickedTooltip=null)},this.clickHandler=e=>{this.clickedTooltip=null;const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}if(this.closeActiveTooltip(),!!i){if(this.clearHoverTimeout(),i.closeOnClick){this.clickedTooltip=i,this.toggleTooltip(i,!1);return}this.toggleTooltip(i,!0)}},this.blurHandler=()=>{this.closeActiveTooltip()},this.focusInHandler=e=>{const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}this.closeTooltipIfNotActive(i),i&&this.toggleFocusedTooltip(i,!0)},this.openHoveredTooltip=e=>{this.hoverOpenTimeout=window.setTimeout(()=>{this.hoverOpenTimeout!==null&&(this.clearHoverCloseTimeout(),this.closeTooltipIfNotActive(e),this.toggleTooltip(e,!0))},this.activeTooltip?.open?0:S)},this.closeHoveredTooltip=()=>{this.hoverCloseTimeout=window.setTimeout(()=>{this.hoverCloseTimeout!==null&&this.closeActiveTooltip()},A)}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t);const i=this.getReferenceElShadowRootNode(e);i&&this.registerShadowRoot(i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){const t=this.getReferenceElShadowRootNode(e);t&&this.unregisterShadowRoot(t),this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}pathHasOpenTooltip(e,t){const{activeTooltip:i}=this;return i?.open&&t.includes(i)||e?.open&&t.includes(e)}addShadowListeners(e){e.addEventListener("focusin",this.focusInHandler,{capture:!0})}removeShadowListeners(e){e.removeEventListener("focusin",this.focusInHandler,{capture:!0})}addListeners(){window.addEventListener("keydown",this.keyDownHandler,{capture:!0}),window.addEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.addEventListener("click",this.clickHandler,{capture:!0}),window.addEventListener("focusin",this.focusInHandler,{capture:!0}),window.addEventListener("blur",this.blurHandler)}removeListeners(){window.removeEventListener("keydown",this.keyDownHandler,{capture:!0}),window.removeEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.removeEventListener("click",this.clickHandler,{capture:!0}),window.removeEventListener("focusin",this.focusInHandler,{capture:!0}),window.removeEventListener("blur",this.blurHandler)}clearHoverOpenTimeout(){window.clearTimeout(this.hoverOpenTimeout),this.hoverOpenTimeout=null}clearHoverCloseTimeout(){window.clearTimeout(this.hoverCloseTimeout),this.hoverCloseTimeout=null}clearHoverTimeout(){this.clearHoverOpenTimeout(),this.clearHoverCloseTimeout()}closeTooltipIfNotActive(e){this.activeTooltip!==e&&this.closeActiveTooltip()}closeActiveTooltip(){const{activeTooltip:e}=this;e?.open&&this.toggleTooltip(e,!1)}toggleFocusedTooltip(e,t){t&&this.clearHoverTimeout(),this.toggleTooltip(e,t)}toggleTooltip(e,t){e.open=t,this.activeTooltip=t?e:null}registerShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.min((typeof i=="number"?i:0)+1,1);n===1&&this.addShadowListeners(e),t.set(e,n)}unregisterShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.max((typeof i=="number"?i:1)-1,0);n===0&&this.removeShadowListeners(e),t.set(e,n)}getReferenceElShadowRootNode(e){return e instanceof Element?H(e):null}}const P=":host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, var(--calcite-z-index-tooltip));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}.container{position:relative;overflow:hidden;border-radius:0.25rem;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.arrow::before{outline:1px solid var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}",z=P,p=new D,m=g(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTooltipBeforeClose=l(this,"calciteTooltipBeforeClose",6),this.calciteTooltipClose=l(this,"calciteTooltipClose",6),this.calciteTooltipBeforeOpen=l(this,"calciteTooltipBeforeOpen",6),this.calciteTooltipOpen=l(this,"calciteTooltipOpen",6),this.guid=`calcite-tooltip-${L()}`,this.openTransitionProp="opacity",this.setTransitionEl=o=>{this.transitionEl=o},this.setUpReferenceElement=(o=!0)=>{this.removeReferences(),this.effectiveReferenceElement=f(this.el),y(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:t,effectiveReferenceElement:i}=this;o&&t&&!i&&console.warn(`${e.tagName}: reference-element id "${t}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:o}=this;if(!o)return;const e=this.getId();"setAttribute"in o&&o.setAttribute(h,e),p.registerElement(o,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:o}=this;o&&("removeAttribute"in o&&o.removeAttribute(h),p.unregisterElement(o))},this.closeOnClick=!1,this.label=void 0,this.offsetDistance=k,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.referenceElement=void 0,this.effectiveReferenceElement=void 0,this.floatingLayout="vertical"}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){c(this),this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){this.setUpReferenceElement(!0),this.open&&c(this)}async componentWillLoad(){this.open&&c(this)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement()}disconnectedCallback(){this.removeReferences(),R(this,this.effectiveReferenceElement,this.el)}async reposition(o=!1){const{el:e,effectiveReferenceElement:t,placement:i,overlayPositioning:n,offsetDistance:r,offsetSkidding:a,arrowEl:v}=this;return C(this,{floatingEl:e,referenceEl:t,overlayPositioning:n,placement:i,offsetDistance:r,offsetSkidding:a,arrowEl:v,type:"tooltip"},o)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit()}render(){const{effectiveReferenceElement:o,label:e,open:t,floatingLayout:i}=this,n=o&&t,r=!n;return s(E,{key:"4f097fd8c6eda6dfcd5734e5aaea1f52092501e7","aria-hidden":w(r),"aria-label":e,"aria-live":"polite","calcite-hydrated-hidden":r,id:this.getId(),role:"tooltip"},s("div",{key:"6b5055ab6f95277dd4daeaaff15cb9848d85eea0",class:{[d.animation]:!0,[d.animationActive]:n},ref:this.setTransitionEl},s(x,{key:"57f68bea5a7bb369d82437f10535cab9753677ea",floatingLayout:i,ref:a=>this.arrowEl=a}),s("div",{key:"100b8318173849508952f996acaeb5bf81b8af43",class:O.container},s("slot",{key:"f89d3ae9313d9555e6a7acdc32c323de85319a3a"}))))}get el(){return this}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}static get style(){return z}},[1,"calcite-tooltip",{closeOnClick:[516,"close-on-click"],label:[1],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[516],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],effectiveReferenceElement:[32],floatingLayout:[32],reposition:[64]},void 0,{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}]);function u(){typeof customElements>"u"||["calcite-tooltip"].forEach(o=>{switch(o){case"calcite-tooltip":customElements.get(o)||customElements.define(o,m);break}})}u();const F=m,X=u;export{F as CalciteTooltip,X as defineCustomElement}; +import{p as g,b as T,W as l,a as s,D as E}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{A as w,U as b,m as H}from"./dom-N58V0tYi-DBU3jlah.js";import{U as y,X as k,q as R,_ as C,j as d}from"./floating-ui-DKFFlLv3-8lk8tQD2.js";import{i as L}from"./guid-Dls486Er-CBh637k4.js";import{p as c}from"./openCloseComponent-BGQ6h7vg-BO0gc3O8.js";import{$ as x}from"./FloatingArrow-BG9llDYg-Ct2kNlPu.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./debounce-27Hmkkyg-Th7bw3mg.js";const O={container:"container"},S=300,A=500,h="aria-describedby";function f(o){const{referenceElement:e}=o;return(typeof e=="string"?b(o,{id:e}):e)||null}class D{constructor(){this.registeredElements=new WeakMap,this.registeredShadowRootCounts=new WeakMap,this.hoverOpenTimeout=null,this.hoverCloseTimeout=null,this.activeTooltip=null,this.registeredElementCount=0,this.clickedTooltip=null,this.queryTooltip=e=>{const{registeredElements:t}=this,i=e.find(n=>t.has(n));return t.get(i)},this.keyDownHandler=e=>{if(e.key==="Escape"&&!e.defaultPrevented){const{activeTooltip:t}=this;if(t?.open){this.clearHoverTimeout(),this.closeActiveTooltip();const i=f(t);i instanceof Element&&i.contains(e.target)&&e.preventDefault()}}},this.pointerMoveHandler=e=>{const t=e.composedPath(),{activeTooltip:i}=this,n=this.queryTooltip(t);if(this.pathHasOpenTooltip(n,t)){this.clearHoverTimeout();return}n!==this.clickedTooltip&&(n?this.openHoveredTooltip(n):i?.open&&this.closeHoveredTooltip(),this.clickedTooltip=null)},this.clickHandler=e=>{this.clickedTooltip=null;const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}if(this.closeActiveTooltip(),!!i){if(this.clearHoverTimeout(),i.closeOnClick){this.clickedTooltip=i,this.toggleTooltip(i,!1);return}this.toggleTooltip(i,!0)}},this.blurHandler=()=>{this.closeActiveTooltip()},this.focusInHandler=e=>{const t=e.composedPath(),i=this.queryTooltip(t);if(this.pathHasOpenTooltip(i,t)){this.clearHoverTimeout();return}this.closeTooltipIfNotActive(i),i&&this.toggleFocusedTooltip(i,!0)},this.openHoveredTooltip=e=>{this.hoverOpenTimeout=window.setTimeout(()=>{this.hoverOpenTimeout!==null&&(this.clearHoverCloseTimeout(),this.closeTooltipIfNotActive(e),this.toggleTooltip(e,!0))},this.activeTooltip?.open?0:S)},this.closeHoveredTooltip=()=>{this.hoverCloseTimeout=window.setTimeout(()=>{this.hoverCloseTimeout!==null&&this.closeActiveTooltip()},A)}}registerElement(e,t){this.registeredElementCount++,this.registeredElements.set(e,t);const i=this.getReferenceElShadowRootNode(e);i&&this.registerShadowRoot(i),this.registeredElementCount===1&&this.addListeners()}unregisterElement(e){const t=this.getReferenceElShadowRootNode(e);t&&this.unregisterShadowRoot(t),this.registeredElements.delete(e)&&this.registeredElementCount--,this.registeredElementCount===0&&this.removeListeners()}pathHasOpenTooltip(e,t){const{activeTooltip:i}=this;return i?.open&&t.includes(i)||e?.open&&t.includes(e)}addShadowListeners(e){e.addEventListener("focusin",this.focusInHandler,{capture:!0})}removeShadowListeners(e){e.removeEventListener("focusin",this.focusInHandler,{capture:!0})}addListeners(){window.addEventListener("keydown",this.keyDownHandler,{capture:!0}),window.addEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.addEventListener("click",this.clickHandler,{capture:!0}),window.addEventListener("focusin",this.focusInHandler,{capture:!0}),window.addEventListener("blur",this.blurHandler)}removeListeners(){window.removeEventListener("keydown",this.keyDownHandler,{capture:!0}),window.removeEventListener("pointermove",this.pointerMoveHandler,{capture:!0}),window.removeEventListener("click",this.clickHandler,{capture:!0}),window.removeEventListener("focusin",this.focusInHandler,{capture:!0}),window.removeEventListener("blur",this.blurHandler)}clearHoverOpenTimeout(){window.clearTimeout(this.hoverOpenTimeout),this.hoverOpenTimeout=null}clearHoverCloseTimeout(){window.clearTimeout(this.hoverCloseTimeout),this.hoverCloseTimeout=null}clearHoverTimeout(){this.clearHoverOpenTimeout(),this.clearHoverCloseTimeout()}closeTooltipIfNotActive(e){this.activeTooltip!==e&&this.closeActiveTooltip()}closeActiveTooltip(){const{activeTooltip:e}=this;e?.open&&this.toggleTooltip(e,!1)}toggleFocusedTooltip(e,t){t&&this.clearHoverTimeout(),this.toggleTooltip(e,t)}toggleTooltip(e,t){e.open=t,this.activeTooltip=t?e:null}registerShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.min((typeof i=="number"?i:0)+1,1);n===1&&this.addShadowListeners(e),t.set(e,n)}unregisterShadowRoot(e){const{registeredShadowRootCounts:t}=this,i=t.get(e),n=Math.max((typeof i=="number"?i:1)-1,0);n===0&&this.removeShadowListeners(e),t.set(e,n)}getReferenceElShadowRootNode(e){return e instanceof Element?H(e):null}}const P=":host{--calcite-floating-ui-z-index:var(--calcite-tooltip-z-index, var(--calcite-z-index-tooltip));display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index)}.calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host([data-placement^=bottom]) .calcite-floating-ui-anim{inset-block-start:-5px}:host([data-placement^=top]) .calcite-floating-ui-anim{inset-block-start:5px}:host([data-placement^=left]) .calcite-floating-ui-anim{left:5px}:host([data-placement^=right]) .calcite-floating-ui-anim{left:-5px}:host([data-placement]) .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([calcite-hydrated-hidden]){visibility:hidden !important;pointer-events:none}.calcite-floating-ui-arrow{pointer-events:none;position:absolute;z-index:calc(var(--calcite-z-index) * -1);fill:var(--calcite-color-foreground-1)}.calcite-floating-ui-arrow__stroke{stroke:var(--calcite-color-border-3)}.container{position:relative;overflow:hidden;border-radius:0.25rem;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size--2);line-height:1.375;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);max-inline-size:20rem;max-block-size:20rem;text-align:start}.calcite-floating-ui-anim{border-radius:0.25rem;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.arrow::before{outline:1px solid var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}",z=P,p=new D,m=g(class extends T{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.calciteTooltipBeforeClose=l(this,"calciteTooltipBeforeClose",6),this.calciteTooltipClose=l(this,"calciteTooltipClose",6),this.calciteTooltipBeforeOpen=l(this,"calciteTooltipBeforeOpen",6),this.calciteTooltipOpen=l(this,"calciteTooltipOpen",6),this.guid=`calcite-tooltip-${L()}`,this.openTransitionProp="opacity",this.setTransitionEl=o=>{this.transitionEl=o},this.setUpReferenceElement=(o=!0)=>{this.removeReferences(),this.effectiveReferenceElement=f(this.el),y(this,this.effectiveReferenceElement,this.el);const{el:e,referenceElement:t,effectiveReferenceElement:i}=this;o&&t&&!i&&console.warn(`${e.tagName}: reference-element id "${t}" was not found.`,{el:e}),this.addReferences()},this.getId=()=>this.el.id||this.guid,this.addReferences=()=>{const{effectiveReferenceElement:o}=this;if(!o)return;const e=this.getId();"setAttribute"in o&&o.setAttribute(h,e),p.registerElement(o,this.el)},this.removeReferences=()=>{const{effectiveReferenceElement:o}=this;o&&("removeAttribute"in o&&o.removeAttribute(h),p.unregisterElement(o))},this.closeOnClick=!1,this.label=void 0,this.offsetDistance=k,this.offsetSkidding=0,this.open=!1,this.overlayPositioning="absolute",this.placement="auto",this.referenceElement=void 0,this.effectiveReferenceElement=void 0,this.floatingLayout="vertical"}offsetDistanceOffsetHandler(){this.reposition(!0)}offsetSkiddingHandler(){this.reposition(!0)}openHandler(){c(this),this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}referenceElementHandler(){this.setUpReferenceElement()}connectedCallback(){this.setUpReferenceElement(!0),this.open&&c(this)}async componentWillLoad(){this.open&&c(this)}componentDidLoad(){this.referenceElement&&!this.effectiveReferenceElement&&this.setUpReferenceElement()}disconnectedCallback(){this.removeReferences(),R(this,this.effectiveReferenceElement,this.el)}async reposition(o=!1){const{el:e,effectiveReferenceElement:t,placement:i,overlayPositioning:n,offsetDistance:r,offsetSkidding:a,arrowEl:v}=this;return C(this,{floatingEl:e,referenceEl:t,overlayPositioning:n,placement:i,offsetDistance:r,offsetSkidding:a,arrowEl:v,type:"tooltip"},o)}onBeforeOpen(){this.calciteTooltipBeforeOpen.emit()}onOpen(){this.calciteTooltipOpen.emit()}onBeforeClose(){this.calciteTooltipBeforeClose.emit()}onClose(){this.calciteTooltipClose.emit()}render(){const{effectiveReferenceElement:o,label:e,open:t,floatingLayout:i}=this,n=o&&t,r=!n;return s(E,{key:"4f097fd8c6eda6dfcd5734e5aaea1f52092501e7","aria-hidden":w(r),"aria-label":e,"aria-live":"polite","calcite-hydrated-hidden":r,id:this.getId(),role:"tooltip"},s("div",{key:"6b5055ab6f95277dd4daeaaff15cb9848d85eea0",class:{[d.animation]:!0,[d.animationActive]:n},ref:this.setTransitionEl},s(x,{key:"57f68bea5a7bb369d82437f10535cab9753677ea",floatingLayout:i,ref:a=>this.arrowEl=a}),s("div",{key:"100b8318173849508952f996acaeb5bf81b8af43",class:O.container},s("slot",{key:"f89d3ae9313d9555e6a7acdc32c323de85319a3a"}))))}get el(){return this}static get watchers(){return{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}}static get style(){return z}},[1,"calcite-tooltip",{closeOnClick:[516,"close-on-click"],label:[1],offsetDistance:[514,"offset-distance"],offsetSkidding:[514,"offset-skidding"],open:[516],overlayPositioning:[513,"overlay-positioning"],placement:[513],referenceElement:[1,"reference-element"],effectiveReferenceElement:[32],floatingLayout:[32],reposition:[64]},void 0,{offsetDistance:["offsetDistanceOffsetHandler"],offsetSkidding:["offsetSkiddingHandler"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"],referenceElement:["referenceElementHandler"]}]);function u(){typeof customElements>"u"||["calcite-tooltip"].forEach(o=>{switch(o){case"calcite-tooltip":customElements.get(o)||customElements.define(o,m);break}})}u();const F=m,X=u;export{F as CalciteTooltip,X as defineCustomElement}; diff --git a/custom-toc-highlight/assets/chartCommon-rWfJsTPl-BkhcWsMI.js b/custom-toc-highlight/assets/chartCommon-rWfJsTPl-C_UBBu0e.js similarity index 98% rename from custom-toc-highlight/assets/chartCommon-rWfJsTPl-BkhcWsMI.js rename to custom-toc-highlight/assets/chartCommon-rWfJsTPl-C_UBBu0e.js index 58fc4871..0de8c6e7 100644 --- a/custom-toc-highlight/assets/chartCommon-rWfJsTPl-BkhcWsMI.js +++ b/custom-toc-highlight/assets/chartCommon-rWfJsTPl-C_UBBu0e.js @@ -1 +1 @@ -import{ar as X,a8 as s,ab as P,e as T,c as x,U as A,s as f,H,ao as S,V as B,av as R,B as b,l as M}from"./Theme-rblUnB2V-D2UsCNGl.js";import{l as L,m as k}from"./Button-MQvwxOnj-CVmrxfGx.js";import{w as U}from"./Tooltip-B0HefZ7r-yfksLaF6.js";import{i as $}from"./ColorSet-DkIwOmgs-C-GAktW1.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";class G extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("InterfaceColors").setAll({stroke:s.fromHex(0),fill:s.fromHex(2829099),primaryButton:s.lighten(s.fromHex(6788316),-.2),primaryButtonHover:s.lighten(s.fromHex(6779356),-.2),primaryButtonDown:s.lighten(s.fromHex(6872181),-.2),primaryButtonActive:s.lighten(s.fromHex(6872182),-.2),primaryButtonText:s.fromHex(16777215),primaryButtonStroke:s.lighten(s.fromHex(6788316),-.2),secondaryButton:s.fromHex(3881787),secondaryButtonHover:s.lighten(s.fromHex(3881787),.1),secondaryButtonDown:s.lighten(s.fromHex(3881787),.15),secondaryButtonActive:s.lighten(s.fromHex(3881787),.2),secondaryButtonText:s.fromHex(12303291),secondaryButtonStroke:s.lighten(s.fromHex(3881787),-.2),grid:s.fromHex(12303291),background:s.fromHex(0),alternativeBackground:s.fromHex(16777215),text:s.fromHex(16777215),alternativeText:s.fromHex(0),disabled:s.fromHex(11382189),positive:s.fromHex(5288704),negative:s.fromHex(11730944)})}}class e extends X{constructor(t,i){super(t,i),Object.defineProperty(this,"_dp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responsiveRules",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._dp=new P([this._root._rootContainer.onPrivate("width",n=>{this._isUsed()&&this._maybeApplyRules()}),this._root._rootContainer.onPrivate("height",n=>{this._isUsed()&&this._maybeApplyRules()})])}static widthXXS(t,i){return t<=e.XXS}static widthXS(t,i){return t<=e.XS}static widthS(t,i){return t<=e.S}static widthM(t,i){return t<=e.M}static widthL(t,i){return t<=e.L}static widthXL(t,i){return t<=e.XL}static widthXXL(t,i){return t<=e.XXL}static heightXXS(t,i){return i<=e.XXS}static heightXS(t,i){return i<=e.XS}static heightS(t,i){return i<=e.S}static heightM(t,i){return i<=e.M}static heightL(t,i){return i<=e.L}static heightXL(t,i){return i<=e.XL}static heightXXL(t,i){return i<=e.XXL}static isXXS(t,i){return t<=e.XXS&&i<=e.XXS}static isXS(t,i){return t<=e.XS&&i<=e.XS}static isS(t,i){return t<=e.S&&i<=e.S}static isM(t,i){return t<=e.M&&i<=e.M}static isL(t,i){return t<=e.L&&i<=e.L}static isXL(t,i){return t<=e.XL&&i<=e.XL}static isXXL(t,i){return t<=e.XXL&&i<=e.XXL}static maybeXXS(t,i){return t<=e.XXS||i<=e.XXS}static maybeXS(t,i){return t<=e.XS||i<=e.XS}static maybeS(t,i){return t<=e.S||i<=e.S}static maybeM(t,i){return t<=e.M||i<=e.M}static maybeL(t,i){return t<=e.L||i<=e.L}static maybeXL(t,i){return t<=e.XL||i<=e.XL}static maybeXXL(t,i){return t<=e.XXL||i<=e.XXL}static newEmpty(t){return new this(t,!0)}addRule(t){return t.name&&!t.template&&(t.template=this.rule(t.name,t.tags)),this.responsiveRules.push(t),this._maybeApplyRule(t),t}removeRule(t){T(this.responsiveRules,t)}dispose(){this._dp&&this._dp.dispose()}_isUsed(){return this._root._rootContainer.get("themes").indexOf(this)!==-1}_maybeApplyRules(){x(this.responsiveRules,t=>{this._maybeUnapplyRule(t)}),x(this.responsiveRules,t=>{this._maybeApplyRule(t)})}_maybeApplyRule(t){if(t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)&&(t.applied=!0,t.template&&t.settings&&t.template.setAll(t.settings),t.applying&&t.applying.call(t))}_maybeUnapplyRule(t){if(!t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)||(t.applied=!1,t.template&&t.template.removeAll(),t.removing&&t.removing.call(t))}setupDefaultRules(){super.setupDefaultRules();const t=i=>this.addRule(i);t({name:"Chart",relevant:e.widthXXS,settings:{paddingLeft:0,paddingRight:0}}),t({name:"Chart",relevant:e.heightXXS,settings:{paddingTop:0,paddingBottom:0}}),t({name:"Bullet",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"Legend",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["vertical"],relevant:e.widthXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["horizontal"],relevant:e.heightXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","start"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","end"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Button",tags:["resize"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisRendererX",relevant:e.heightXS,settings:{inside:!0}}),t({name:"AxisRendererY",relevant:e.widthXS,settings:{inside:!0}}),t({name:"AxisRendererXLabel",relevant:e.heightXS,settings:{minPosition:.1,maxPosition:.9}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXS,settings:{centerY:A,maxPosition:.9}}),t({name:"AxisLabel",tags:["x"],relevant:e.heightXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["x","minor"],relevant:e.widthXXL,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y","minor"],relevant:e.heightXXL,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["x"],relevant:e.heightXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"AxisTick",tags:["y"],relevant:e.widthXXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"Grid",relevant:e.maybeXXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["radial"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeS,settings:{inside:!0}}),t({name:"AxisTick",relevant:e.maybeS,settings:{inside:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["circular"],relevant:e.maybeXS,settings:{inside:!0}}),t({name:"PieChart",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"PieChart",relevant:e.widthM,settings:{radius:f(99)}}),t({name:"RadialLabel",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"FunnelSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PyramidSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PictorialStackedSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","horizontal"],relevant:e.widthS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","vertical"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Chord",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"Label",tags:["hierarchy","node"],relevant:e.maybeXS,settings:{forceHidden:!0}})}}Object.defineProperty(e,"XXS",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(e,"XS",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(e,"S",{enumerable:!0,configurable:!0,writable:!0,value:300}),Object.defineProperty(e,"M",{enumerable:!0,configurable:!0,writable:!0,value:400}),Object.defineProperty(e,"L",{enumerable:!0,configurable:!0,writable:!0,value:600}),Object.defineProperty(e,"XL",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(e,"XXL",{enumerable:!0,configurable:!0,writable:!0,value:1e3});class w extends H{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()}),Object.defineProperty(this,"startGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"endGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"_thumbBusy",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_startDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_endDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_thumbDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_gripDown",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_addOrientationClass(){this._settings.themeTags=S(this._settings.themeTags,["scrollbar",this._settings.orientation]),this._settings.background||(this._settings.background=L.new(this._root,{themeTags:S(this._settings.themeTags,["main","background"])}))}_makeButton(){return this.children.push(k.new(this._root,{themeTags:["resize","button",this.get("orientation")],icon:B.new(this._root,{themeTags:["icon"]})}))}_makeThumb(){return this.children.push(L.new(this._root,{themeTags:["thumb",this.get("orientation")]}))}_handleAnimation(t){t&&this._disposers.push(t.events.on("stopped",()=>{this.setPrivateRaw("isBusy",!1),this._thumbBusy=!1}))}_afterNew(){this._addOrientationClass(),super._afterNew();const t=this.startGrip,i=this.endGrip,n=this.thumb,o=this.get("background");o&&this._disposers.push(o.events.on("click",a=>{this.setPrivateRaw("isBusy",!0);const r=this._display.toLocal(a.point),h=this.width(),d=this.height(),u=this.get("orientation");let l,m,g;l=u=="vertical"?(r.y-n.height()/2)/d:(r.x-n.width()/2)/h,u=="vertical"?(m=l*d,g="y"):(m=l*h,g="x");const p=this.get("animationDuration",0);p>0?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:g,to:m,duration:p,easing:this.get("animationEasing")}))):(this.thumb.set(g,m),this._root.events.once("frameended",()=>{this.setPrivateRaw("isBusy",!1)}))})),this._disposers.push(n.events.on("dblclick",a=>{if(!R(a.originalEvent,this))return;const r=this.get("animationDuration",0),h=this.get("animationEasing");this.animate({key:"start",to:0,duration:r,easing:h}),this.animate({key:"end",to:1,duration:r,easing:h})})),this._disposers.push(t.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._startDown=!0,this._gripDown="start"})),this._disposers.push(i.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._endDown=!0,this._gripDown="end"})),this._disposers.push(n.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._thumbDown=!0,this._gripDown=void 0})),this._disposers.push(t.events.on("globalpointerup",()=>{this._startDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._startDown=!1})),this._disposers.push(i.events.on("globalpointerup",()=>{this._endDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._endDown=!1})),this._disposers.push(n.events.on("globalpointerup",()=>{this._thumbDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._thumbDown=!1})),this._disposers.push(t.on("x",()=>{this._updateThumb()})),this._disposers.push(i.on("x",()=>{this._updateThumb()})),this._disposers.push(t.on("y",()=>{this._updateThumb()})),this._disposers.push(i.on("y",()=>{this._updateThumb()})),this._disposers.push(n.events.on("positionchanged",()=>{this._updateGripsByThumb()})),this.get("orientation")=="vertical"?(t.set("x",0),i.set("x",0),this._disposers.push(n.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()-n.height()),0))),this._disposers.push(n.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("x",a=>this.width()/2)),this._disposers.push(i.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0))),this._disposers.push(i.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0)))):(t.set("y",0),i.set("y",0),this._disposers.push(n.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()-n.width()),0))),this._disposers.push(n.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("y",a=>this.height()/2)),this._disposers.push(i.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))),this._disposers.push(i.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))))}_updateChildren(){super._updateChildren(),(this.isDirty("end")||this.isDirty("start")||this._sizeDirty)&&this.updateGrips()}_changed(){if(super._changed(),this.isDirty("start")||this.isDirty("end")){const t="rangechanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,start:this.get("start",0),end:this.get("end",1),grip:this._gripDown})}}_released(){const t="released";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}updateGrips(){const t=this.startGrip,i=this.endGrip,n=this.get("orientation"),o=this.height(),a=this.width();n=="vertical"?(t.set("y",o*this.get("start",0)),i.set("y",o*this.get("end",1))):(t.set("x",a*this.get("start",0)),i.set("x",a*this.get("end",1)));const r=this.getPrivate("positionTextFunction"),h=Math.round(100*this.get("start",0)),d=Math.round(100*this.get("end",0));let u,l;r?(u=r.call(this,this.get("start",0)),l=r.call(this,this.get("end",0))):(u=h+"%",l=d+"%"),t.set("ariaLabel",this._t("From %1",void 0,u)),t.set("ariaValueNow",""+h),t.set("ariaValueText",h+"%"),t.set("ariaValueMin","0"),t.set("ariaValueMax","100"),i.set("ariaLabel",this._t("To %1",void 0,l)),i.set("ariaValueNow",""+d),i.set("ariaValueText",d+"%"),i.set("ariaValueMin","0"),i.set("ariaValueMax","100")}_updateThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip,o=this.height(),a=this.width();let r=i.x(),h=n.x(),d=i.y(),u=n.y(),l=0,m=1;this.get("orientation")=="vertical"?b(d)&&b(u)&&(this._thumbBusy||t.isDragging()||(t.set("height",u-d),t.set("y",d)),l=d/o,m=u/o):b(r)&&b(h)&&(this._thumbBusy||t.isDragging()||(t.set("width",h-r),t.set("x",r)),l=r/a,m=h/a),!this.getPrivate("isBusy")||this.get("start")==l&&this.get("end")==m||(this.set("start",l),this.set("end",m));const g=this.getPrivate("positionTextFunction"),p=Math.round(100*this.get("start",0)),D=Math.round(100*this.get("end",0));let v,y;g?(v=g.call(this,this.get("start",0)),y=g.call(this,this.get("end",0))):(v=p+"%",y=D+"%"),t.set("ariaLabel",this._t("From %1 to %2",void 0,v,y)),t.set("ariaValueNow",""+p),t.set("ariaValueText",p+"%")}_updateGripsByThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip;if(this.get("orientation")=="vertical"){const o=t.height();i.set("y",t.y()),n.set("y",t.y()+o)}else{const o=t.width();i.set("x",t.x()),n.set("x",t.x()+o)}}}Object.defineProperty(w,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Scrollbar"}),Object.defineProperty(w,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([w.className])});class N extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("Component").setAll({interpolationDuration:600}),this.rule("Hierarchy").set("animationDuration",600),this.rule("Scrollbar").set("animationDuration",600),this.rule("Tooltip").set("animationDuration",300),this.rule("MapChart").set("animationDuration",1e3),this.rule("MapChart").set("wheelDuration",300),this.rule("Entity").setAll({stateAnimationDuration:600}),this.rule("Sprite").states.create("default",{stateAnimationDuration:600}),this.rule("Tooltip",["axis"]).setAll({animationDuration:200}),this.rule("WordCloud").set("animationDuration",500),this.rule("Polygon").set("animationDuration",600),this.rule("ArcDiagram").set("animationDuration",600)}}const z=["#2888B8","#EB7028","#48A375","#9370B1","#e55035","#3d9ccc","#DC7B04","#b87bb0","#3fa681","#EE6386"].map(c=>M(c));export{N as AnimatedThemeAm5,$ as ColorSetAm5,G as DarkThemeAm5,e as ResponsiveThemeAm5,w as ScrollbarAm5,X as ThemeAm5,U as TooltipAm5,M as colorAm5,z as esriChartColorSet}; +import{ar as X,a8 as s,ab as P,e as T,c as x,U as A,s as f,H,ao as S,V as B,av as R,B as b,l as M}from"./Theme-rblUnB2V-Dc7wtY6B.js";import{l as L,m as k}from"./Button-MQvwxOnj-Bxdd1k4u.js";import{w as U}from"./Tooltip-B0HefZ7r-CZdyswYp.js";import{i as $}from"./ColorSet-DkIwOmgs-Bdz0YXw-.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";class G extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("InterfaceColors").setAll({stroke:s.fromHex(0),fill:s.fromHex(2829099),primaryButton:s.lighten(s.fromHex(6788316),-.2),primaryButtonHover:s.lighten(s.fromHex(6779356),-.2),primaryButtonDown:s.lighten(s.fromHex(6872181),-.2),primaryButtonActive:s.lighten(s.fromHex(6872182),-.2),primaryButtonText:s.fromHex(16777215),primaryButtonStroke:s.lighten(s.fromHex(6788316),-.2),secondaryButton:s.fromHex(3881787),secondaryButtonHover:s.lighten(s.fromHex(3881787),.1),secondaryButtonDown:s.lighten(s.fromHex(3881787),.15),secondaryButtonActive:s.lighten(s.fromHex(3881787),.2),secondaryButtonText:s.fromHex(12303291),secondaryButtonStroke:s.lighten(s.fromHex(3881787),-.2),grid:s.fromHex(12303291),background:s.fromHex(0),alternativeBackground:s.fromHex(16777215),text:s.fromHex(16777215),alternativeText:s.fromHex(0),disabled:s.fromHex(11382189),positive:s.fromHex(5288704),negative:s.fromHex(11730944)})}}class e extends X{constructor(t,i){super(t,i),Object.defineProperty(this,"_dp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"responsiveRules",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._dp=new P([this._root._rootContainer.onPrivate("width",n=>{this._isUsed()&&this._maybeApplyRules()}),this._root._rootContainer.onPrivate("height",n=>{this._isUsed()&&this._maybeApplyRules()})])}static widthXXS(t,i){return t<=e.XXS}static widthXS(t,i){return t<=e.XS}static widthS(t,i){return t<=e.S}static widthM(t,i){return t<=e.M}static widthL(t,i){return t<=e.L}static widthXL(t,i){return t<=e.XL}static widthXXL(t,i){return t<=e.XXL}static heightXXS(t,i){return i<=e.XXS}static heightXS(t,i){return i<=e.XS}static heightS(t,i){return i<=e.S}static heightM(t,i){return i<=e.M}static heightL(t,i){return i<=e.L}static heightXL(t,i){return i<=e.XL}static heightXXL(t,i){return i<=e.XXL}static isXXS(t,i){return t<=e.XXS&&i<=e.XXS}static isXS(t,i){return t<=e.XS&&i<=e.XS}static isS(t,i){return t<=e.S&&i<=e.S}static isM(t,i){return t<=e.M&&i<=e.M}static isL(t,i){return t<=e.L&&i<=e.L}static isXL(t,i){return t<=e.XL&&i<=e.XL}static isXXL(t,i){return t<=e.XXL&&i<=e.XXL}static maybeXXS(t,i){return t<=e.XXS||i<=e.XXS}static maybeXS(t,i){return t<=e.XS||i<=e.XS}static maybeS(t,i){return t<=e.S||i<=e.S}static maybeM(t,i){return t<=e.M||i<=e.M}static maybeL(t,i){return t<=e.L||i<=e.L}static maybeXL(t,i){return t<=e.XL||i<=e.XL}static maybeXXL(t,i){return t<=e.XXL||i<=e.XXL}static newEmpty(t){return new this(t,!0)}addRule(t){return t.name&&!t.template&&(t.template=this.rule(t.name,t.tags)),this.responsiveRules.push(t),this._maybeApplyRule(t),t}removeRule(t){T(this.responsiveRules,t)}dispose(){this._dp&&this._dp.dispose()}_isUsed(){return this._root._rootContainer.get("themes").indexOf(this)!==-1}_maybeApplyRules(){x(this.responsiveRules,t=>{this._maybeUnapplyRule(t)}),x(this.responsiveRules,t=>{this._maybeApplyRule(t)})}_maybeApplyRule(t){if(t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)&&(t.applied=!0,t.template&&t.settings&&t.template.setAll(t.settings),t.applying&&t.applying.call(t))}_maybeUnapplyRule(t){if(!t.applied)return;const i=this._root._rootContainer.getPrivate("width"),n=this._root._rootContainer.getPrivate("height");t.relevant.call(t,i,n)||(t.applied=!1,t.template&&t.template.removeAll(),t.removing&&t.removing.call(t))}setupDefaultRules(){super.setupDefaultRules();const t=i=>this.addRule(i);t({name:"Chart",relevant:e.widthXXS,settings:{paddingLeft:0,paddingRight:0}}),t({name:"Chart",relevant:e.heightXXS,settings:{paddingTop:0,paddingBottom:0}}),t({name:"Bullet",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"Legend",relevant:e.isXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["vertical"],relevant:e.widthXS,settings:{forceHidden:!0}}),t({name:"HeatLegend",tags:["horizontal"],relevant:e.heightXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","start"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Label",tags:["heatlegend","end"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Button",tags:["resize"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisRendererX",relevant:e.heightXS,settings:{inside:!0}}),t({name:"AxisRendererY",relevant:e.widthXS,settings:{inside:!0}}),t({name:"AxisRendererXLabel",relevant:e.heightXS,settings:{minPosition:.1,maxPosition:.9}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXS,settings:{centerY:A,maxPosition:.9}}),t({name:"AxisLabel",tags:["x"],relevant:e.heightXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["x","minor"],relevant:e.widthXXL,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y"],relevant:e.widthXXS,settings:{forceHidden:!0}}),t({name:"AxisLabel",tags:["y","minor"],relevant:e.heightXXL,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["x"],relevant:e.heightXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"AxisTick",tags:["y"],relevant:e.widthXXS,settings:{inside:!0,minPosition:.1,maxPosition:.9}}),t({name:"Grid",relevant:e.maybeXXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["radial"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeS,settings:{inside:!0}}),t({name:"AxisTick",relevant:e.maybeS,settings:{inside:!0}}),t({name:"RadialLabel",tags:["circular"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"AxisTick",tags:["circular"],relevant:e.maybeXS,settings:{inside:!0}}),t({name:"PieChart",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"PieChart",relevant:e.widthM,settings:{radius:f(99)}}),t({name:"RadialLabel",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"RadialLabel",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.maybeXS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pie"],relevant:e.widthM,settings:{forceHidden:!0}}),t({name:"FunnelSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["funnel","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PyramidSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pyramid","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"PictorialStackedSeries",relevant:e.widthM,settings:{alignLabels:!1}}),t({name:"Label",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","vertical"],relevant:e.widthL,settings:{forceHidden:!0}}),t({name:"Label",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Tick",tags:["pictorial","horizontal"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","horizontal"],relevant:e.widthS,settings:{forceHidden:!0}}),t({name:"Label",tags:["flow","vertical"],relevant:e.heightS,settings:{forceHidden:!0}}),t({name:"Chord",relevant:e.maybeXS,settings:{radius:f(99)}}),t({name:"Label",tags:["hierarchy","node"],relevant:e.maybeXS,settings:{forceHidden:!0}})}}Object.defineProperty(e,"XXS",{enumerable:!0,configurable:!0,writable:!0,value:100}),Object.defineProperty(e,"XS",{enumerable:!0,configurable:!0,writable:!0,value:200}),Object.defineProperty(e,"S",{enumerable:!0,configurable:!0,writable:!0,value:300}),Object.defineProperty(e,"M",{enumerable:!0,configurable:!0,writable:!0,value:400}),Object.defineProperty(e,"L",{enumerable:!0,configurable:!0,writable:!0,value:600}),Object.defineProperty(e,"XL",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(e,"XXL",{enumerable:!0,configurable:!0,writable:!0,value:1e3});class w extends H{constructor(){super(...arguments),Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()}),Object.defineProperty(this,"startGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"endGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()}),Object.defineProperty(this,"_thumbBusy",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_startDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_endDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_thumbDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_gripDown",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}_addOrientationClass(){this._settings.themeTags=S(this._settings.themeTags,["scrollbar",this._settings.orientation]),this._settings.background||(this._settings.background=L.new(this._root,{themeTags:S(this._settings.themeTags,["main","background"])}))}_makeButton(){return this.children.push(k.new(this._root,{themeTags:["resize","button",this.get("orientation")],icon:B.new(this._root,{themeTags:["icon"]})}))}_makeThumb(){return this.children.push(L.new(this._root,{themeTags:["thumb",this.get("orientation")]}))}_handleAnimation(t){t&&this._disposers.push(t.events.on("stopped",()=>{this.setPrivateRaw("isBusy",!1),this._thumbBusy=!1}))}_afterNew(){this._addOrientationClass(),super._afterNew();const t=this.startGrip,i=this.endGrip,n=this.thumb,o=this.get("background");o&&this._disposers.push(o.events.on("click",a=>{this.setPrivateRaw("isBusy",!0);const r=this._display.toLocal(a.point),h=this.width(),d=this.height(),u=this.get("orientation");let l,m,g;l=u=="vertical"?(r.y-n.height()/2)/d:(r.x-n.width()/2)/h,u=="vertical"?(m=l*d,g="y"):(m=l*h,g="x");const p=this.get("animationDuration",0);p>0?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:g,to:m,duration:p,easing:this.get("animationEasing")}))):(this.thumb.set(g,m),this._root.events.once("frameended",()=>{this.setPrivateRaw("isBusy",!1)}))})),this._disposers.push(n.events.on("dblclick",a=>{if(!R(a.originalEvent,this))return;const r=this.get("animationDuration",0),h=this.get("animationEasing");this.animate({key:"start",to:0,duration:r,easing:h}),this.animate({key:"end",to:1,duration:r,easing:h})})),this._disposers.push(t.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._startDown=!0,this._gripDown="start"})),this._disposers.push(i.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._endDown=!0,this._gripDown="end"})),this._disposers.push(n.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0),this._thumbDown=!0,this._gripDown=void 0})),this._disposers.push(t.events.on("globalpointerup",()=>{this._startDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._startDown=!1})),this._disposers.push(i.events.on("globalpointerup",()=>{this._endDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._endDown=!1})),this._disposers.push(n.events.on("globalpointerup",()=>{this._thumbDown&&(this.setPrivateRaw("isBusy",!1),this._released()),this._thumbDown=!1})),this._disposers.push(t.on("x",()=>{this._updateThumb()})),this._disposers.push(i.on("x",()=>{this._updateThumb()})),this._disposers.push(t.on("y",()=>{this._updateThumb()})),this._disposers.push(i.on("y",()=>{this._updateThumb()})),this._disposers.push(n.events.on("positionchanged",()=>{this._updateGripsByThumb()})),this.get("orientation")=="vertical"?(t.set("x",0),i.set("x",0),this._disposers.push(n.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()-n.height()),0))),this._disposers.push(n.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("x",a=>this.width()/2)),this._disposers.push(i.adapters.add("x",a=>this.width()/2)),this._disposers.push(t.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0))),this._disposers.push(i.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0)))):(t.set("y",0),i.set("y",0),this._disposers.push(n.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()-n.width()),0))),this._disposers.push(n.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("y",a=>this.height()/2)),this._disposers.push(i.adapters.add("y",a=>this.height()/2)),this._disposers.push(t.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))),this._disposers.push(i.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))))}_updateChildren(){super._updateChildren(),(this.isDirty("end")||this.isDirty("start")||this._sizeDirty)&&this.updateGrips()}_changed(){if(super._changed(),this.isDirty("start")||this.isDirty("end")){const t="rangechanged";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this,start:this.get("start",0),end:this.get("end",1),grip:this._gripDown})}}_released(){const t="released";this.events.isEnabled(t)&&this.events.dispatch(t,{type:t,target:this})}updateGrips(){const t=this.startGrip,i=this.endGrip,n=this.get("orientation"),o=this.height(),a=this.width();n=="vertical"?(t.set("y",o*this.get("start",0)),i.set("y",o*this.get("end",1))):(t.set("x",a*this.get("start",0)),i.set("x",a*this.get("end",1)));const r=this.getPrivate("positionTextFunction"),h=Math.round(100*this.get("start",0)),d=Math.round(100*this.get("end",0));let u,l;r?(u=r.call(this,this.get("start",0)),l=r.call(this,this.get("end",0))):(u=h+"%",l=d+"%"),t.set("ariaLabel",this._t("From %1",void 0,u)),t.set("ariaValueNow",""+h),t.set("ariaValueText",h+"%"),t.set("ariaValueMin","0"),t.set("ariaValueMax","100"),i.set("ariaLabel",this._t("To %1",void 0,l)),i.set("ariaValueNow",""+d),i.set("ariaValueText",d+"%"),i.set("ariaValueMin","0"),i.set("ariaValueMax","100")}_updateThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip,o=this.height(),a=this.width();let r=i.x(),h=n.x(),d=i.y(),u=n.y(),l=0,m=1;this.get("orientation")=="vertical"?b(d)&&b(u)&&(this._thumbBusy||t.isDragging()||(t.set("height",u-d),t.set("y",d)),l=d/o,m=u/o):b(r)&&b(h)&&(this._thumbBusy||t.isDragging()||(t.set("width",h-r),t.set("x",r)),l=r/a,m=h/a),!this.getPrivate("isBusy")||this.get("start")==l&&this.get("end")==m||(this.set("start",l),this.set("end",m));const g=this.getPrivate("positionTextFunction"),p=Math.round(100*this.get("start",0)),D=Math.round(100*this.get("end",0));let v,y;g?(v=g.call(this,this.get("start",0)),y=g.call(this,this.get("end",0))):(v=p+"%",y=D+"%"),t.set("ariaLabel",this._t("From %1 to %2",void 0,v,y)),t.set("ariaValueNow",""+p),t.set("ariaValueText",p+"%")}_updateGripsByThumb(){const t=this.thumb,i=this.startGrip,n=this.endGrip;if(this.get("orientation")=="vertical"){const o=t.height();i.set("y",t.y()),n.set("y",t.y()+o)}else{const o=t.width();i.set("x",t.x()),n.set("x",t.x()+o)}}}Object.defineProperty(w,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Scrollbar"}),Object.defineProperty(w,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:H.classNames.concat([w.className])});class N extends X{setupDefaultRules(){super.setupDefaultRules(),this.rule("Component").setAll({interpolationDuration:600}),this.rule("Hierarchy").set("animationDuration",600),this.rule("Scrollbar").set("animationDuration",600),this.rule("Tooltip").set("animationDuration",300),this.rule("MapChart").set("animationDuration",1e3),this.rule("MapChart").set("wheelDuration",300),this.rule("Entity").setAll({stateAnimationDuration:600}),this.rule("Sprite").states.create("default",{stateAnimationDuration:600}),this.rule("Tooltip",["axis"]).setAll({animationDuration:200}),this.rule("WordCloud").set("animationDuration",500),this.rule("Polygon").set("animationDuration",600),this.rule("ArcDiagram").set("animationDuration",600)}}const z=["#2888B8","#EB7028","#48A375","#9370B1","#e55035","#3d9ccc","#DC7B04","#b87bb0","#3fa681","#EE6386"].map(c=>M(c));export{N as AnimatedThemeAm5,$ as ColorSetAm5,G as DarkThemeAm5,e as ResponsiveThemeAm5,w as ScrollbarAm5,X as ThemeAm5,U as TooltipAm5,M as colorAm5,z as esriChartColorSet}; diff --git a/custom-toc-highlight/assets/chartUtilsAm5-CtY-kHPy-B6BgNVnq.js b/custom-toc-highlight/assets/chartUtilsAm5-CtY-kHPy-KDNsYH7z.js similarity index 99% rename from custom-toc-highlight/assets/chartUtilsAm5-CtY-kHPy-B6BgNVnq.js rename to custom-toc-highlight/assets/chartUtilsAm5-CtY-kHPy-KDNsYH7z.js index 7e2eba16..7afb5e30 100644 --- a/custom-toc-highlight/assets/chartUtilsAm5-CtY-kHPy-B6BgNVnq.js +++ b/custom-toc-highlight/assets/chartUtilsAm5-CtY-kHPy-KDNsYH7z.js @@ -1 +1 @@ -import{_ as P}from"./main-ugzBrWNm.js";import{h as ut}from"./story-BfX8CRfG.js";import{E as te,O as ct,W as dt,z as bt,G as ft,Y as _t,R as mt,c as y,L as ie,H as Z,s as tt,U as J,K as pt,l as re,V as Fe,I as K,o as ge,a as C,b as de,j as gt,d as yt,w as we,k as se,N as vt,D as X,P as Ae,T as wt,e as ae,f as Ye,g as De,t as xt,h as Ce,v as ue,i as ye,m as Pt,n as ve,p as He,S as it,q as rt,r as Le,u as Ot,x as ee,y as Q,_ as W,F as kt,A as Et,B as H,C as Mt,J as B,Q as be,M as fe,X as Ve,Z as St,$ as Ue,a0 as Tt,a1 as jt,a2 as V,a3 as We,a4 as Dt,a5 as Bt,a6 as At,a7 as Ct,a8 as $,a9 as _e,aa as Lt,ab as Ge,ac as Be,ad as st,ae as Xe,af as zt,ag as It,ah as ke,ai as Rt,aj as Ft,ak as Yt,al as Ht,am as Vt,an as le}from"./Theme-rblUnB2V-D2UsCNGl.js";import{w as $e}from"./Tooltip-B0HefZ7r-yfksLaF6.js";import{h as Ut}from"./DefaultTheme-Bt5OI-Ht-Dfb13wye.js";class Wt{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver(e=>{y(e,t=>{y(this._targets,i=>{i.target===t.target&&i.callback()})})})}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),we(this._targets,t=>t.target!==e)}}class xe{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,t){if(this._timer===null){let r=null;const a=()=>{const s=Date.now();(r===null||s>r+xe.delay)&&(r=s,y(this._targets,n=>{let l=n.target.getBoundingClientRect();l.width===n.size.width&&l.height===n.size.height||(n.size=l,n.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(a)};this._timer=requestAnimationFrame(a)}let i={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:t,size:i})}removeTarget(e){we(this._targets,t=>t.target!==e),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(xe,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let Ee=null;function Gt(){return Ee===null&&(Ee=typeof ResizeObserver<"u"?new Wt:new xe),Ee}class Xt{constructor(e,t){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=Gt(),this._element=e,this._listener=it(t),this._sensor.addTarget(e,t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class pe extends te{}Object.defineProperty(pe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"}),Object.defineProperty(pe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:te.classNames.concat([pe.className])});class $t extends te{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let r;(t==null||ye(t)&&t.toLowerCase()==="number")&&(t=this.get("numberFormat",""));let a=Number(e);if(rt(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(a):new Intl.NumberFormat(void 0,t).format(a)}catch{return"Invalid"}else{t=Le(t);let s,n=this.parseFormat(t,this._root.language);s=a>this.get("negativeBase")?n.positive:a{if(l.parsed)return;let d=l.source;d.toLowerCase()==="number"&&(d=this.get("numberFormat","#,###.#####"));let m=W.chunk(d,!0);for(let c=0;c=0?e.toExponential(t.decimals.passive).split("e"):e.toExponential().split("e"),e=Number(c[0]),a="e"+c[1],t.modSpacing&&(a=" "+a)}else if(t.decimals.passive===0)e=Math.round(e);else if(t.decimals.passive>0){const c=kt(e);if(c>0){const f=Math.pow(10,t.decimals.passive);e=Math.round(parseFloat((e*f).toFixed(c)))/f}}let n="",l=Et(e).split("."),d=l[0];if(d.length0){let c=[],f=d.split("").reverse().join("");for(let o=0,p=d.length;o<=p;o+=t.thousands.interval){let h=f.substr(o,t.thousands.interval).split("").reverse().join("");h!==""&&c.unshift(h)}d=c.join(t.thousands.separator)}n+=d,l.length===1&&l.push("");let m=l[1];return m.length{switch(m.type){case"year":t=+m.value;break;case"month":i=+m.value-1;break;case"day":r=+m.value;break;case"hour":a=+m.value;break;case"minute":s=+m.value;break;case"second":n=+m.value;break;case"fractionalSecond":l=+m.value;break;case"weekday":switch(m.value){case"Sun":d=0;break;case"Mon":d=1;break;case"Tue":d=2;break;case"Wed":d=3;break;case"Thu":d=4;break;case"Fri":d=5;break;case"Sat":d=6}}}),a===24&&(a=0),{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l,weekday:d}}function Ne(b,e){const{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l}=at(b,e);return Date.UTC(t,i,r,a,s,n,l)}class Nt{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),r=new Date(e);r.setUTCMinutes(r.getUTCMinutes()-(t-i));const a=r.getTimezoneOffset();return i!=a&&r.setUTCMinutes(r.getUTCMinutes()+a-i),r}offsetUTC(e){return(Ne(this._utc,e)-Ne(this._dtf,e))/6e4}parseDate(e){return at(this._dtf,e)}}class qt extends te{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i=!1){let r;t!==void 0&&t!==""||(t=this.get("dateFormat","yyyy-MM-dd"));let a=e;if(rt(t))try{const l=this.get("intlLocales");return l?new Intl.DateTimeFormat(l,t).format(a):new Intl.DateTimeFormat(void 0,t).format(a)}catch{return"Invalid"}let s=this.parseFormat(t);const n=this._root.timezone;return!n||this._root.utc||i||(a=n.convertLocal(a)),H(a.getTime())?(r=this.applyFormat(a,s,i),this.get("capitalize")&&(r=r.replace(/^.{1}/,r.substr(0,1).toUpperCase())),r):"Invalid date"}applyFormat(e,t,i=!1){let r,a,s,n,l,d,m,c,f=t.template,o=e.getTime();this._root.utc&&!i?(r=e.getUTCFullYear(),a=e.getUTCMonth(),s=e.getUTCDay(),n=e.getUTCDate(),l=e.getUTCHours(),d=e.getUTCMinutes(),m=e.getUTCSeconds(),c=e.getUTCMilliseconds()):(r=e.getFullYear(),a=e.getMonth(),s=e.getDay(),n=e.getDate(),l=e.getHours(),d=e.getMinutes(),m=e.getSeconds(),c=e.getMilliseconds());for(let p=0,h=t.parts.length;p=12?this._t("PM"):this._t("AM");break;case"aa":u=l>=12?this._t("P.M."):this._t("A.M.");break;case"aaa":u=l>=12?this._t("P"):this._t("A");break;case"h":u=fe(l).toString();break;case"hh":u=B(fe(l),2,"0");break;case"H":u=l.toString();break;case"HH":u=B(l,2,"0");break;case"K":u=fe(l,0).toString();break;case"KK":u=B(fe(l,0),2,"0");break;case"k":u=(l+1).toString();break;case"kk":u=B(l+1,2,"0");break;case"m":u=d.toString();break;case"mm":u=B(d,2,"0");break;case"s":u=m.toString();break;case"ss":u=B(m,2,"0");break;case"S":case"SS":case"SSS":u=Math.round(c/1e3*Math.pow(10,t.parts[p].length)).toString();break;case"x":u=o.toString();break;case"n":case"nn":case"nnn":u=B(c,t.parts[p].length,"0");break;case"z":u=be(e,!1,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zz":u=be(e,!0,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zzz":u=be(e,!1,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zzzz":u=be(e,!0,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"Z":case"ZZ":let w=this._root.utc?"UTC":this._root.timezone;w instanceof Nt&&(w=w.name);const v=w?Mt(w):e.getTimezoneOffset();let _=Math.abs(v)/60,x=Math.floor(_),E=60*_-60*x;this._root.utc&&(x=0,E=0),t.parts[p]=="Z"?(u="GMT",u+=v>0?"-":"+",u+=B(x,2)+":"+B(E,2)):(u=v>0?"-":"+",u+=B(x,2)+B(E,2));break;case"i":u=e.toISOString();break;case"I":u=e.toUTCString()}f=f.replace(ee,u)}return f}parseFormat(e){let t={template:"",parts:[]},i=W.chunk(e,!0);for(let r=0;r-1&&(n.year=parseInt(c[s.year])),s.year3>-1){let f=parseInt(c[s.year3]);f+=1e3,n.year=f}if(s.year2>-1){let f=parseInt(c[s.year2]);f+=f>50?1e3:2e3,n.year=f}if(s.year1>-1){let f=parseInt(c[s.year1]);f=10*Math.floor(new Date().getFullYear()/10)+f,n.year=f}if(s.monthLong>-1&&(n.month=this.resolveMonth(c[s.monthLong])),s.monthShort>-1&&(n.month=this.resolveShortMonth(c[s.monthShort])),s.month>-1&&(n.month=parseInt(c[s.month])-1),s.week>-1&&s.day===-1&&(n.month=0,n.day=jt(parseInt(c[s.week]),n.year,1,this._root.utc)),s.day>-1&&(n.day=parseInt(c[s.day])),s.yearDay>-1&&(n.month=0,n.day=parseInt(c[s.yearDay])),s.hourBase0>-1&&(n.hour=parseInt(c[s.hourBase0])),s.hourBase1>-1&&(n.hour=parseInt(c[s.hourBase1])-1),s.hour12Base0>-1){let f=parseInt(c[s.hour12Base0]);f==11&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.hour12Base1>-1){let f=parseInt(c[s.hour12Base1]);f==12&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.minute>-1&&(n.minute=parseInt(c[s.minute])),s.second>-1&&(n.second=parseInt(c[s.second])),s.millisecond>-1){let f=parseInt(c[s.millisecond]);s.millisecondDigits==2?f*=10:s.millisecondDigits==1&&(f*=100),n.millisecond=f}if(s.timestamp>-1){n.timestamp=parseInt(c[s.timestamp]);const f=new Date(n.timestamp);n.year=f.getUTCFullYear(),n.month=f.getUTCMonth(),n.day=f.getUTCDate(),n.hour=f.getUTCHours(),n.minute=f.getUTCMinutes(),n.second=f.getUTCSeconds(),n.millisecond=f.getUTCMilliseconds()}s.zone>-1&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.zone])),s.iso>-1&&(n.year=V(c[s.iso+0]),n.month=V(c[s.iso+1])-1,n.day=V(c[s.iso+2]),n.hour=V(c[s.iso+3]),n.minute=V(c[s.iso+4]),n.second=V(c[s.iso+5]),n.millisecond=V(c[s.iso+6]),c[s.iso+7]=="Z"||c[s.iso+7]=="z"?n.utc=!0:c[s.iso+7]!=""&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.iso+7]))),i=n.utc?new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond)):new Date(n.year,n.month,n.day,n.hour,n.minute+n.offset,n.second,n.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),r=i[1],a=i[2],s=i[3],n=60*parseInt(a)+parseInt(s);return r=="+"&&(n*=-1),n-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;ithis.get("negativeBase")?s.positive:n{if(n.parsed)return;let l=n.source,d=[];d=n.source.match(/^\[([^\]]*)\]/),d&&d.length&&d[0]!==""&&(l=n.source.substr(d[0].length),n.color=d[1]);let m=W.chunk(l,!0);for(let c=0;c{if(a==t||i){if(r/s<=1)return i||(i=a),!1;i=a}return!0}),i}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const nt={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(b){let e="th";if(b<11||b>13)switch(b%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class Jt extends te{_setDefaults(){this.setPrivate("defaultLocale",nt),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let r=e,a=t[e];if(a===null)r="";else if(a!=null)a&&(r=a);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...i);if(i.length)for(let s=i.length,n=0;n{this.setTranslationAny(i,r,t)})}translateEmpty(e,t,...i){let r=this.translate(e,t,...i);return r==e?"":r}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:Bt(e,i=>this.translate(i,t))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class Me{constructor(e=1,t=0,i=0,r=1,a=0,s=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=r,this.tx=a,this.ty=s}setTransform(e,t,i,r,a,s=1){this.a=Math.cos(a)*s,this.b=Math.sin(a)*s,this.c=-Math.sin(a)*s,this.d=Math.cos(a)*s,this.tx=e-(i*this.a+r*this.c),this.ty=t-(i*this.b+r*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,r=this.c,a=this.d;this.a=e.a*t+e.b*r,this.b=e.a*i+e.b*a,this.c=e.c*t+e.d*r,this.d=e.c*i+e.d*a,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*a+this.ty}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var Kt=function(){function b(e,t){var i=[],r=!0,a=!1,s=void 0;try{for(var n,l=e[Symbol.iterator]();!(r=(n=l.next()).done)&&(i.push(n.value),!t||i.length!==t);r=!0);}catch(d){a=!0,s=d}finally{try{!r&&l.return&&l.return()}finally{if(a)throw s}}return i}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return b(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),he=2*Math.PI,Se=function(b,e,t,i,r,a,s){var n=b.x,l=b.y;return{x:i*(n*=e)-r*(l*=t)+a,y:r*n+i*l+s}},Qt=function(b,e){var t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(b),r=Math.sin(b),a=Math.cos(b+e),s=Math.sin(b+e);return[{x:i-r*t,y:r+i*t},{x:a+s*t,y:s-a*t},{x:a,y:s}]},qe=function(b,e,t,i){var r=b*t+e*i;return r>1&&(r=1),r<-1&&(r=-1),(b*i-e*t<0?-1:1)*Math.acos(r)},ei=function(b,e,t,i,r,a,s,n,l,d,m,c){var f=Math.pow(r,2),o=Math.pow(a,2),p=Math.pow(m,2),h=Math.pow(c,2),u=f*o-f*h-o*p;u<0&&(u=0),u/=f*h+o*p;var g=(u=Math.sqrt(u)*(s===n?-1:1))*r/a*c,w=u*-a/r*m,v=d*g-l*w+(b+t)/2,_=l*g+d*w+(e+i)/2,x=(m-g)/r,E=(c-w)/a,k=(-m-g)/r,M=(-c-w)/a,j=qe(1,0,x,E),O=qe(x,E,k,M);return n===0&&O>0&&(O-=he),n===1&&O<0&&(O+=he),[v,_,j,O]},ti=function(b){var e=b.px,t=b.py,i=b.cx,r=b.cy,a=b.rx,s=b.ry,n=b.xAxisRotation,l=n===void 0?0:n,d=b.largeArcFlag,m=d===void 0?0:d,c=b.sweepFlag,f=c===void 0?0:c,o=[];if(a===0||s===0)return[];var p=Math.sin(l*he/360),h=Math.cos(l*he/360),u=h*(e-i)/2+p*(t-r)/2,g=-p*(e-i)/2+h*(t-r)/2;if(u===0&&g===0)return[];a=Math.abs(a),s=Math.abs(s);var w=Math.pow(u,2)/Math.pow(a,2)+Math.pow(g,2)/Math.pow(s,2);w>1&&(a*=Math.sqrt(w),s*=Math.sqrt(w));var v=ei(e,t,i,r,a,s,m,f,p,h,u,g),_=Kt(v,4),x=_[0],E=_[1],k=_[2],M=_[3],j=Math.abs(M)/(he/4);Math.abs(1-j)<1e-7&&(j=1);var O=Math.max(Math.ceil(j),1);M/=O;for(var I=0;I1){const r=/^([01])([01])(.*)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b.splice(t,0,r[2]),++t,r[3].length>0?b[t]=r[3]:b.splice(t,1))}if(++t,i=b[t],i.length>1){const r=/^([01])(.+)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b[t]=r[2])}}}function Ze(b){if(b===0||b===1)return b;throw new Error("Flag must be 0 or 1")}function si(b){const e=[0,0,0];for(let t=0;t<24;t++)e[t%3]<<=1,e[t%3]|=1&b,b>>=1;return(0|e[0])+(e[1]<<8)+(e[2]<<16)}function me(b,e){for(;(!b.interactive||e(b))&&b._parent;)b=b._parent}function ai(b,e,t){return C(b,Be(e),i=>{const r=st(i);let a=i.touches;a?(a.length==0&&(a=i.changedTouches),t(zt(a),r)):t([i],r)})}function Je(b){const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});t.drawImage(b,0,0,1,1);try{return t.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+b.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function oe(b){b.width=0,b.height=0,b.style.width="0px",b.style.height="0px"}function Ke(b){return Math.floor(b)+.5}class ni{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class Pe extends Ht{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new ni}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}subStatus(e){return{inactive:this.inactive==null?e.inactive:this.inactive,layer:this._layer||e.layer}}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){e==null?this._layer=void 0:(this._layer=this._renderer.getLayer(e,!0),this._layer.visible=!0,this._layer.margin=t,t&&K(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(e){return!e.inactive&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(e){return this._isInteractive(e)}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),r=t.apply({x:e.right,y:e.top}),a=t.apply({x:e.right,y:e.bottom}),s=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,r.x,a.x,s.x),top:Math.min(i.y,r.y,a.y,s.y),right:Math.max(i.x,r.x,a.x,s.x),bottom:Math.max(i.y,r.y,a.y,s.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new X(()=>{})}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let r=i.tx*t,a=i.ty*t;this.crisp&&(r=Ke(r),a=Ke(a)),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,r,a)}_transformMargin(e,t,i){const r=this._matrix;e.setTransform(r.a*t,r.b*t,r.c*t,r.d*t,(r.tx+i.left)*t,(r.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();const t=this.subStatus(e),i=this._renderer.resolution,r=this._renderer.layers,a=this._renderer._ghostLayer,s=a.context,n=this.mask;n&&n._setMatrix(),y(r,l=>{if(l){const d=l.context;d.save(),n&&(n._transformLayer(d,i,l),n._runPath(d),d.clip()),d.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(d,i,l),this.filter&&(d.filter=this.filter)}}),s.save(),n&&this._isInteractiveMask(t)&&(n._transformMargin(s,i,a.margin),n._runPath(s),s.clip()),this._transformMargin(s,i,a.margin),this._render(t),s.restore(),y(r,l=>{l&&l.context.restore()})}}_render(e){this.exportable===!1&&(e.layer.tainted=!0)}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(e=>e.value===this)}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class oi extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(e){return this.interactiveChildren||super._isInteractiveMask(e)}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,Ae(this._children,e)}_render(e){super._render(e);const t=this._renderer;this.interactive&&this.interactiveChildren&&++t._forceInteractive,y(this._children,i=>{i.compoundAlpha=this.compoundAlpha*this.alpha,i.render(e)}),this.interactive&&this.interactiveChildren&&--t._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),De(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&y(this._childLayers,t=>t.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&y(this._childLayers,e=>{e.dirty=!0})}}function T(b,e){b.left=Math.min(b.left,e.x),b.top=Math.min(b.top,e.y),b.right=Math.max(b.right,e.x),b.bottom=Math.max(b.bottom,e.y)}class D{colorize(e,t){}colorizeGhost(e,t){this.colorize(e,t)}path(e){}pathGhost(e){this.path(e)}addBounds(e){}}class li extends D{colorize(e,t){e.beginPath()}}class Te extends D{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=t!==void 0?t:this.color}}class hi extends D{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class ui extends D{colorize(e,t){e.stroke()}}class je extends D{constructor(e,t,i){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=t!==void 0?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class ci extends D{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class di extends D{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class bi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,r=t+this.width,a=i+this.height;T(e,{x:t,y:i}),T(e,{x:r,y:i}),T(e,{x:t,y:a}),T(e,{x:r,y:a})}}class fi extends D{constructor(e,t,i){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radius,y:this.y-this.radius}),T(e,{x:this.x+this.radius,y:this.y+this.radius})}}class _i extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),T(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class mi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=Vt(this.cx,this.cy,this.startAngle*le,this.endAngle*le,this.radius);T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}class pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class gi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class yi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class vi extends D{path(e){e.closePath()}}class wi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.cpX2,y:this.cpY2}),T(e,{x:this.toX,y:this.toY})}}class xi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.toX,y:this.toY})}}class Pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:a})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}colorizeGhost(e,t){}}class Oi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){T(e,{x:this.x,y:this.y}),T(e,{x:this.width,y:this.height})}}class ki extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:It.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof $?this._pushOp(new Te(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new Te(e))):this._pushOp(new Te("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new hi(this._hasShadows))}endStroke(){this._pushOp(new ui)}beginPath(){this._pushOp(new li)}lineStyle(e=0,t,i=1,r){this._strokeAlpha=i,t?t instanceof $?this._pushOp(new je(e,t.toCSS(i),r)):this._pushOp(new je(e,t,r)):this._pushOp(new je(e,"rgba(0, 0, 0, "+i+")",r))}setLineDash(e){this._pushOp(new ci(e||[]))}setLineDashOffset(e=0){this._pushOp(new di(e))}drawRect(e,t,i,r){this._pushOp(new bi(e,t,i,r))}drawCircle(e,t,i){this._pushOp(new fi(e,t,i))}drawEllipse(e,t,i,r){this._pushOp(new _i(e,t,i,r))}arc(e,t,i,r,a,s=!1){this._pushOp(new mi(e,t,i,r,a,s))}arcTo(e,t,i,r,a){this._pushOp(new pi(e,t,i,r,a))}lineTo(e,t){this._pushOp(new gi(e,t))}moveTo(e,t){this._pushOp(new yi(e,t))}bezierCurveTo(e,t,i,r,a,s){this._pushOp(new wi(e,t,i,r,a,s))}quadraticCurveTo(e,t,i,r){this._pushOp(new xi(e,t,i,r))}closePath(){this._pushOp(new vi)}shadow(e,t=0,i=0,r=0,a){this._hasShadows=!0,this._pushOp(new Pi(a?e.toCSS(a):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,r))}image(e,t,i,r,a){this._pushOp(new Oi(e,t,i,r,a))}svgPath(e){let t=0,i=0,r=null,a=null,s=null,n=null;const l=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,d=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let m;for(;(m=l.exec(e))!==null;){const c=m[1],f=m[2],o=[];for(;(m=d.exec(f))!==null;)o.push(m[1]);switch(c!=="S"&&c!=="s"&&c!=="C"&&c!=="c"&&(r=null,a=null),c!=="Q"&&c!=="q"&&c!=="T"&&c!=="t"&&(s=null,n=null),c){case"M":z(c,o.length,2),t=+o[0],i=+o[1],this.moveTo(t,i);for(let h=2;h{this.bezierCurveTo(v.x1,v.y1,v.x2,v.y2,v.x,v.y),t=v.x,i=v.y})}break;case"Z":case"z":ii(c,o.length,0),this.closePath()}}}_runPath(e){e.beginPath(),y(this._operations,t=>{t.path(e)})}_render(e){super._render(e);const t=e.layer.dirty,i=this._isInteractive(e);if(t||i){const r=e.layer.context,a=this._renderer._ghostLayer.context;let s;t&&(r.globalCompositeOperation=this.blendMode,r.beginPath()),i&&(a.beginPath(),s=this._getColorId()),y(this._operations,n=>{t&&(n.path(r),n.colorize(r,void 0)),i&&(n.pathGhost(a),n.colorizeGhost(a,s))})}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const t=this.mask;t&&(t._setMatrix(),t._transform(e,1),t._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),y(this._operations,i=>{i.path(e),i.colorize(e,void 0)}),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&y(this._operations,t=>{t.addBounds(e)})}}class ot extends Pe{constructor(e,t,i){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const r=e.layer.context,a=this._renderer._ghostLayer.context,s=this.style;let n=this._getFontStyle(void 0,i);r.font=n,this._isInteractive(e)&&!t&&(a.font=n),s.fill&&(s.fill instanceof $?r.fillStyle=s.fill.toCSS(s.fillOpacity!=null?s.fillOpacity:1):r.fillStyle=s.fill),s.shadowColor&&(e.layer.context.shadowColor=s.shadowColor.toCSS(s.shadowOpacity||1)),s.shadowBlur&&(e.layer.context.shadowBlur=s.shadowBlur),s.shadowOffsetX&&(e.layer.context.shadowOffsetX=s.shadowOffsetX),s.shadowOffsetY&&(e.layer.context.shadowOffsetY=s.shadowOffsetY),this._shared(r),this._isInteractive(e)&&!t&&(a.fillStyle=this._getColorId(),this._shared(a))}_getFontStyle(e,t=!1){const i=this.style;let r=[];return e&&e.fontVariant?r.push(e.fontVariant):i.fontVariant&&r.push(i.fontVariant),t||(e&&e.fontWeight?r.push(e.fontWeight):i.fontWeight&&r.push(i.fontWeight)),e&&e.fontStyle?r.push(e.fontStyle):i.fontStyle&&r.push(i.fontStyle),e&&e.fontSize?(H(e.fontSize)&&(e.fontSize=e.fontSize+"px"),r.push(e.fontSize)):i.fontSize&&(H(i.fontSize)&&(i.fontSize=i.fontSize+"px"),r.push(i.fontSize)),e&&e.fontFamily?r.push(e.fontFamily):i.fontFamily?r.push(i.fontFamily):r.length&&r.push("Arial"),r.join(" ")}_render(e){if(this._textInfo||this._measure(e),this.textVisible){const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),a.save(),this._prerender(e),y(this._textInfo,(s,n)=>{y(s.textChunks,(l,d)=>{if(l.style&&(i.save(),a.save(),i.font=l.style,this._isInteractive(e)&&(a.font=l.style)),l.fill&&(i.save(),i.fillStyle=l.fill.toCSS()),r&&i.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.textDecoration=="underline"||l.textDecoration=="line-through"){let m=1,c=1,f=l.height;const o=this.style.oversizedBehavior||"";if(["truncate","wrap","wrap-no-break"].indexOf(o)>-1){const u=this._measureText(l.text,i);l.width=u.actualBoundingBoxLeft+u.actualBoundingBoxRight}let p,h=l.offsetX;switch(this.style.textAlign){case"right":case"end":h-=l.width;break;case"center":h-=l.width/2}if(l.style)switch(W.getTextStyle(l.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":m=2}f&&(c=f/20),p=l.textDecoration=="line-through"?m+s.offsetY+l.offsetY-l.height/2:m+1.5*c+s.offsetY+l.offsetY,i.save(),i.beginPath(),l.fill?i.strokeStyle=l.fill.toCSS():this.style.fill&&this.style.fill instanceof $&&(i.strokeStyle=this.style.fill.toCSS()),i.lineWidth=m*c,i.moveTo(h,p),i.lineTo(h+l.width,p),i.stroke(),i.restore()}t&&this.interactive&&a.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.fill&&i.restore(),l.style&&(i.restore(),a.restore())})}),i.restore(),a.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure({inactive:this.inactive,layer:this.getLayer()});T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl";this._textInfo=[];const a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=H(s)&&(a=="wrap"||a=="wrap-no-break");t.save(),i.save(),this._prerender(e,!0,this._ignoreFontWeight());const d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",m=this.text.toString().replace(/\r/g,"").split(/\n/);let c,f=!0,o=0,p=0,h=0;y(m,(g,w)=>{let v;for(v=g==""?[{type:"value",text:""}]:W.chunk(g,!1,this.style.ignoreFormatting);v.length>0;){let _={offsetY:h,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const x=this._measureText(d,t),E=x.actualBoundingBoxAscent+x.actualBoundingBoxDescent;let k;_.height=E,_.ascent=x.actualBoundingBoxAscent;let M,j,O,I=this.style.textDecoration,L=!1,Y=!0,N=[];Ce(v,(A,ce)=>{if(A.type=="format")if(A.text=="[/]")f||(t.restore(),i.restore(),f=!0),M=void 0,c=void 0,j=void 0,I=this.style.textDecoration,O=void 0,k=A.text;else{f||(t.restore(),i.restore());let S=W.getTextStyle(A.text);const R=this._getFontStyle(S);t.save(),i.save(),t.font=R,c=R,k=A.text,S.textDecoration&&(I=S.textDecoration),S.fill&&(M=S.fill),S.width&&(j=V(S.width)),S.verticalAlign&&(O=S.verticalAlign),f=!1;const F=this._measureText(d,t),q=F.actualBoundingBoxAscent+F.actualBoundingBoxDescent;q>_.height&&(_.height=q),F.actualBoundingBoxAscent>_.ascent&&(_.ascent=F.actualBoundingBoxAscent)}else if(A.type=="value"&&!L){const S=this._measureText(A.text,t);let R=S.actualBoundingBoxLeft+S.actualBoundingBoxRight;if(n){let U=Y||this.style.breakWords||!1;const G=this.style.ellipsis||"",Re=this._measureText(G,t),lt=Re.actualBoundingBoxLeft+Re.actualBoundingBoxRight;if(_.width+R>s){const ht=s-_.width-lt;A.text=this._truncateText(t,A.text,ht,U),A.text+=G,L=!0}}else if(l&&_.width+R>s){const U=s-_.width,G=this._truncateText(t,A.text,U,!1,Y&&this.style.oversizedBehavior!="wrap-no-break");if(G=="")return this.textVisible=!0,!1;N=v.slice(ce+1),ke(G)!=ke(A.text)&&(N.unshift({type:"value",text:A.text.substr(G.length)}),k&&N.unshift({type:"format",text:k})),A.text=ke(G),v=[],L=!0}let F=1,q=1;if(c&&j&&j>R){const U=R/j;switch(this.style.textAlign){case"right":case"end":F=U;break;case"center":F=U,q=U;break;default:q=U}R=j}const Oe=S.actualBoundingBoxAscent+S.actualBoundingBoxDescent;Oe>_.height&&(_.height=Oe),S.actualBoundingBoxAscent>_.ascent&&(_.ascent=S.actualBoundingBoxAscent),_.width+=R,_.left+=S.actualBoundingBoxLeft/F,_.right+=S.actualBoundingBoxRight/q,_.textChunks.push({style:c,fill:M,text:A.text,width:R,height:Oe,left:S.actualBoundingBoxLeft,right:S.actualBoundingBoxRight,ascent:S.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:I,verticalAlign:O}),Y=!1}return!0}),this.style.lineHeight instanceof ve?(_.height*=this.style.lineHeight.value,_.ascent*=this.style.lineHeight.value):(_.height*=this.style.lineHeight||1.2,_.ascent*=this.style.lineHeight||1.2),o<_.left&&(o=_.left),p<_.right&&(p=_.right),this._textInfo.push(_),h+=_.height,v=N||[]}}),f||(t.restore(),i.restore()),y(this._textInfo,(g,w)=>{let v=0;y(g.textChunks,_=>{if(_.offsetX=v+_.left-g.left,_.offsetY+=g.height-g.height*(this.style.baselineRatio||.19),v+=_.width,_.verticalAlign)switch(_.verticalAlign){case"super":_.offsetY-=g.height/2-_.height/2;break;case"sub":_.offsetY+=_.height/2}})});const u={left:r?-p:-o,top:0,right:r?o:p,bottom:h};if(a!=="none"){const g=this._fitRatio(u);if(g<1)if(a=="fit")H(this.style.minScale)&&gi&&t!="");return t}_measureText(e,t){let i=t.measureText(e),r={};if(i.actualBoundingBoxAscent==null){const s=document.createElement("div");s.innerText=e,s.style.visibility="hidden",s.style.position="absolute",s.style.top="-1000000px;",s.style.fontFamily=this.style.fontFamily||"",s.style.fontSize=this.style.fontSize+"",document.body.appendChild(s);const n=s.getBoundingClientRect();document.body.removeChild(s);const l=n.height,d=i.width;r={actualBoundingBoxAscent:l,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:d,fontBoundingBoxAscent:l,fontBoundingBoxDescent:0,width:d}}else r={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const a=i.width;switch(this.style.textAlign){case"right":case"end":r.actualBoundingBoxLeft=a,r.actualBoundingBoxRight=0;break;case"center":r.actualBoundingBoxLeft=a/2,r.actualBoundingBoxRight=a/2;break;default:r.actualBoundingBoxLeft=0,r.actualBoundingBoxRight=a}return r}}class Ei{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:tt(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class Mi extends ot{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){this.textType==="circular"?this._renderCircular(e):super._render(e)}_renderCircular(e){if(this.textVisible){this._prerender(e);const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),t&&a.save(),this._textInfo||this._measure(e);let s=this.radius||0,n=this.startAngle||0,l=0,d=this.orientation,m=d=="auto"?"auto":d=="inward";const c=this.inside,f=this.style.textAlign||"left",o=this.kerning||0;let p=f=="left"?1:-1;const h=!this._textReversed;if(m=="auto"){let u=0,g=0;y(this._textInfo,(w,v)=>{const _=n+w.width/(s-w.height)/2*-p;_>u&&(u=_)}),g=f=="left"?(u+l/2)*le:f=="right"?(u-l/2)*le:n*le,g=Rt(g),m=g>=270||g<=90}m==1&&h&&(this._textInfo.reverse(),this._textReversed=!0),y(this._textInfo,(u,g)=>{const w=u.height;c||(s+=w),(p==-1&&m||p==1&&!m)&&h&&u.textChunks.reverse();let v=n;l=0,f=="center"&&(v+=u.width/(s-w)/2*-p,l=v-n),v+=Math.PI*(m?0:1),i.save(),t&&a.save(),i.rotate(v),t&&a.rotate(v);let _=0;y(u.textChunks,(x,E)=>{const k=x.text,M=x.width;_=M/2/(s-w)*p,i.rotate(_),t&&a.rotate(_),x.style&&(i.save(),a.save(),i.font=x.style,t&&(a.font=x.style)),x.fill&&(i.save(),i.fillStyle=x.fill.toCSS()),i.textBaseline="middle",i.textAlign="center",t&&(a.textBaseline="middle",a.textAlign="center"),r&&i.fillText(k,0,(m?1:-1)*(0-s+w/2)),t&&a.fillText(k,0,(m?1:-1)*(0-s+w/2)),x.fill&&i.restore(),x.style&&(i.restore(),a.restore()),_=(M/2+o)/(s-w)*p,i.rotate(_),t&&a.rotate(_)}),i.restore(),t&&a.restore(),c&&(s-=w)}),i.restore(),t&&a.restore()}}_measure(e){return this.textType==="circular"?this._measureCircular(e):super._measure(e)}_measureCircular(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl",a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=this.style.ellipsis||"";let d;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,t.save(),i.save(),this._prerender(e,!0);const m=this.text.toString().replace(/\r/g,"").split(/\n/);let c=!0,f=0,o=0;return y(m,(p,h)=>{let u,g,w,v=W.chunk(p,!1,this.style.ignoreFormatting),_={offsetY:o,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};y(v,(x,E)=>{if(x.type=="format"){if(x.text=="[/]")c||(t.restore(),i.restore(),c=!0),g=void 0,u=void 0,w=void 0;else{let k=W.getTextStyle(x.text);const M=this._getFontStyle(k);t.save(),i.save(),t.font=M,u=M,k.fill&&(g=k.fill),k.width&&(w=V(k.width)),c=!1}n&&(d=this._measureText(l,t))}else if(x.type=="value"){let k=x.text.match(/./gu)||[];r&&(k=Ft(x.text),k.reverse());for(let M=0;MI&&(I=w);const L=O.actualBoundingBoxAscent+O.actualBoundingBoxDescent;if(L>_.height&&(_.height=L),O.actualBoundingBoxAscent>_.ascent&&(_.ascent=O.actualBoundingBoxAscent),f+=I,n){d||(d=this._measureText(l,t));const Y=d.actualBoundingBoxLeft+d.actualBoundingBoxRight;if(f+Y>s){_.textChunks.length==1?this.textVisible=!1:(_.width+=Y,_.left+=d.actualBoundingBoxLeft,_.right+=d.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:l,width:Y,height:L+d.actualBoundingBoxDescent,left:d.actualBoundingBoxLeft,right:d.actualBoundingBoxRight,ascent:d.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0}));break}}_.width+=I,_.left+=O.actualBoundingBoxLeft,_.right+=O.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:j,width:I,height:L+O.actualBoundingBoxDescent,left:O.actualBoundingBoxLeft,right:O.actualBoundingBoxRight,ascent:O.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0})}}}),this.style.lineHeight instanceof ve?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),o+=_.height}),c||(t.restore(),i.restore()),a=="hide"&&f>s&&(this.textVisible=!1),y(this._textInfo,p=>{y(p.textChunks,h=>{h.offsetY+=Math.round((p.height-h.height+(p.ascent-h.ascent))/2)})}),t.restore(),i.restore(),{left:0,top:0,right:0,bottom:0}}}class Si extends Pe{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&oe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){if(this.tainted===void 0&&(this.tainted=Je(this.image),e.layer.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(e.layer.dirty){this.shadowColor&&(e.layer.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(e.layer.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(e.layer.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(e.layer.context.shadowOffsetY=this.shadowOffsetY);const t=this.width||this.image.naturalWidth,i=this.height||this.image.naturalHeight;e.layer.context.drawImage(this.image,0,0,t,i)}if(this.interactive&&this._isInteractive(e)){const t=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(t,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(this._imageMask===void 0){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,r=document.createElement("canvas");r.width=t,r.height=i;const a=r.getContext("2d");a.imageSmoothingEnabled=!1,a.fillStyle=this._getColorId(),a.fillRect(0,0,t,i),Je(e)||(a.globalCompositeOperation="destination-in",a.drawImage(e,0,0,t,i)),this._imageMask=r}return this._imageMask}}class Ti{constructor(e,t,i,r){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),ge("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class ji extends At{constructor(e){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new Di}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_realWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=e??window.devicePixelRatio,this.view.style.position="absolute",this.view.setAttribute("aria-hidden","true"),this.view.appendChild(this._layerDom),this._disposers.push(new X(()=>{ue(this._events,(t,i)=>{i.disposer.dispose()}),y(this.layers,t=>{oe(t.view),t.exportableView&&oe(t.exportableView)}),oe(this._ghostLayer.view),oe(this._patternCanvas)})),this._disposers.push(it(()=>{e==null&&(this.resolution=window.devicePixelRatio)})),ge("touchevents")){const t=i=>{this._dragging.length!==0&&Ce(this._dragging,r=>!r.value.shouldCancelTouch()||(i.preventDefault(),!1)),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(C(window,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(C(window,"click",i=>{this._touchActive=!1},{passive:!0})),this._disposers.push(C(this.view,"click",i=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}ge("wheelevents")&&this._disposers.push(C(this.view,"wheel",t=>{let i=!1;this._hovering.forEach(r=>{if(r.wheelable)return i=!0,!1}),i&&t.preventDefault()},{passive:!1}))}resetImageArray(){this._ghostLayer.imageArray=void 0}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,r){return this.defaultLayer.context.createLinearGradient(e,t,i,r)}createRadialGradient(e,t,i,r,a,s){return this.defaultLayer.context.createRadialGradient(e,t,i,r,a,s)}createPattern(e,t,i,r,a){return this._patternCanvas.width=r,this._patternCanvas.height=a,this._patternContext.clearRect(0,0,r,a),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new oi(this)}makeGraphics(){return new ki(this)}makeText(e,t){return new ot(this,e,t)}makeTextStyle(){return new Ei}makeRadialText(e,t){return new Mi(this,e,t)}makePicture(e){return new Si(this,e)}resizeLayer(e){e.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resize(e,t,i,r){this._realWidth=e,this._realHeight=t,this._calculatedWidth=i,this._calculatedHeight=r,y(this.layers,a=>{a&&(a.dirty=!0,this.resizeLayer(a))}),this.resizeGhost(),this.view.style.width=i+"px",this.view.style.height=r+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:e}),r=new Bi(t,i);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",r}getLayerByOrder(e){const t=this.layers,i=t.length;for(let r=0;rl.order>d.order?1:l.order{t&&t.dirty&&t.visible&&(this._dirtyLayers.push(t),t.clear())}),this._ghostLayer.clear(),e.render({inactive:null,layer:this.defaultLayer}),this._ghostLayer.context.restore(),y(this.layers,t=>{if(t){const i=t.context;i.beginPath(),i.moveTo(0,0),i.stroke()}}),y(this._dirtyLayers,t=>{t.context.restore(),t.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){const{events:t,target:i,native:r}=this._lastPointerMoveEvent;y(t,a=>{this._dispatchGlobalMousemove(a,i,r)})}}paintId(e){const t=si(++this._colorId),i=$.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){e._colorId!==void 0&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(-t.left,-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),r=e.clientX||0,a=e.clientY||0,s=this._calculatedWidth/this._realWidth,n=this._calculatedHeight/this._realHeight,l={x:r-i.left,y:a-i.top},d={x:(r-(t?i.left:0))*s,y:(a-(t?i.top:0))*n};return new Ti(e,l,d,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(t.width===0||t.height===0||e.xt.right||e.yt.bottom||!i||!this._layerDom.contains(i))return;const r=this._ghostLayer.getImageData(e,t);if(r.data[0]===0&&r.data[1]===0&&r.data[2]===0)return!1;const a=$.fromRGB(r.data[0],r.data[1],r.data[2]).toCSS();return this._colorMap[a]}getObjectAtPoint(e){const t=this._ghostLayer.getImageArray(e);if(t[0]===0&&t[1]===0&&t[2]===0)return;const i=$.fromRGB(t[0],t[1],t[2]).toCSS();return this._colorMap[i]}_withEvents(e,t){const i=this._events[e];if(i!==void 0){i.dispatching=!0;try{t(i)}finally{i.dispatching=!1,i.cleanup&&(i.cleanup=!1,we(i.callbacks,r=>!r.disposed),i.callbacks.length===0&&(i.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,t){this.interactionsEnabled&&this._withEvents(e,i=>{y(i.callbacks,r=>{r.disposed||r.callback.call(r.context,t)})})}_dispatchEvent(e,t,i){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,a=>{y(a.callbacks,s=>{s.disposed||s.object!==t||(s.callback.call(s.context,i),r=!0)})}),r}_dispatchMousedown(e,t){const i=e.button;if(i!=0&&i!=2&&i!=1&&i!==void 0)return;const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);if(a){const s=r.id;let n=!1;me(a,l=>{const d={id:s,value:l};return this._mousedown.push(d),!n&&this._dispatchEvent("pointerdown",l,r)&&(n=!0,this._dragging.some(m=>m.value===l&&m.id===s)||this._dragging.push(d)),!0})}}_dispatchGlobalMousemove(e,t,i){const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);r.native=i,a?(this._hovering.forEach(s=>{s.contains(a)||(this._hovering.delete(s),s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r))}),r.native&&me(a,s=>(this._hovering.has(s)||(this._hovering.add(s),s.cursorOverStyle&&(s._replacedCursorStyle=Yt(document.body,"cursor"),_e(document.body,"cursor",s.cursorOverStyle)),this._dispatchEvent("pointerover",s,r)),!0))):(this._hovering.forEach(s=>{s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",r)}removeHovering(e){this._hovering.delete(e),e.cursorOverStyle&&_e(document.body,"cursor",e._replacedCursorStyle)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(e){if(this._dragging.length!==0){const t=this.getEvent(e),i=t.id;this._dragging.forEach(r=>{r.id===i&&this._dispatchEvent("pointermove",r.value,t)})}}_dispatchDragEnd(e,t){const i=e.button;let r;if(i==0||i===void 0)r="click";else if(i==2)r="rightclick";else{if(i!=1)return;r="middleclick"}const a=this.getEvent(e),s=a.id;if(this._mousedown.length!==0){const n=this._getHitTarget(a.originalPoint,a.bbox,t);n&&this._mousedown.forEach(l=>{l.id===s&&l.value.contains(n)&&this._dispatchEvent(r,l.value,a)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(n=>{n.id===s&&this._dispatchEvent("pointerup",n.value,a)}),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("dblclick",a,i))}_dispatchWheel(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("wheel",a,i))}_makeSharedEvent(e,t){if(this._listeners[e]===void 0){const i=t();this._listeners[e]=new Lt(()=>{delete this._listeners[e],i.dispose()})}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,r=null;function a(){r=null,i=!1}return new Ge([new X(()=>{r!==null&&clearTimeout(r),a()}),C(this.view,Be(e),s=>{i=!0,r!==null&&clearTimeout(r),r=window.setTimeout(a,0)}),ai(window,e,(s,n)=>{r!==null&&(clearTimeout(r),r=null),t(s,n,i),i=!1})])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{const t=(i,r,a)=>{this._lastPointerMoveEvent={events:i,target:r,native:a},y(i,s=>{this._dispatchGlobalMousemove(s,r,a)})};return new Ge([this._onPointerEvent("pointerdown",t),this._onPointerEvent("pointermove",t)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{const t=this._onPointerEvent("pointerup",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}}),i=this._onPointerEvent("pointercancel",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}});return new X(()=>{t.dispose(),i.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{const t=this._onPointerEvent("pointerdown",(s,n)=>{y(s,l=>{this._dispatchMousedown(l,n)})}),i=this._onPointerEvent("pointermove",s=>{y(s,n=>{this._dispatchDragMove(n)})}),r=this._onPointerEvent("pointerup",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})}),a=this._onPointerEvent("pointercancel",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})});return new X(()=>{t.dispose(),i.dispose(),r.dispose(),a.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",(t,i)=>{y(t,r=>{this._dispatchDoubleClick(r,i)})}));case"wheel":return this._makeSharedEvent("wheel",()=>C(this.view,Be("wheel"),t=>{this._dispatchWheel(t,st(t))},{passive:!1}))}}_addEvent(e,t,i,r){let a=this._events[t];a===void 0&&(a=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const s={object:e,context:r,callback:i,disposed:!1};return a.callbacks.push(s),new X(()=>{s.disposed=!0,a.dispatching?a.cleanup=!0:(Ae(a.callbacks,s),a.callbacks.length===0&&(a.disposer.dispose(),delete this._events[t]))})}getCanvas(e,t){this.render(e),t||(t={});let i=this.resolution,r=Math.floor(this._calculatedWidth*this.resolution),a=Math.floor(this._calculatedHeight*this.resolution);if(t.minWidth&&t.minWidth>r){let o=t.minWidth/r;o>i&&(i=o*this.resolution)}if(t.minHeight&&t.minHeight>a){let o=t.minHeight/a;o>i&&(i=o*this.resolution)}if(t.maxWidth&&t.maxWidtha){let o=t.maxHeight/a;o{if(o&&o.visible&&(o.tainted||n)){f=!0,o.exportableView=o.view,o.exportableContext=o.context,o.view=document.createElement("canvas"),o.view.style.position="fixed",o.view.style.top="-10000px",this.view.appendChild(o.view),s.push(o.view);let p=0,h=0;o.margin&&(p+=o.margin.left||0+o.margin.right||0,h+=o.margin.top||0+o.margin.bottom||0),o.view.width=r+p,o.view.height=a+h,o.context=o.view.getContext("2d"),o.dirty=!0,o.scale=i}}),f&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),y(this.layers,o=>{if(o&&o.visible){let p=0,h=0;o.margin&&(p=-(o.margin.left||0)*this.resolution,h=-(o.margin.top||0)*this.resolution),d.drawImage(o.view,p,h),o.exportableView&&(o.view=o.exportableView,o.exportableView=void 0),o.exportableContext&&(o.context=o.exportableContext,o.exportableContext=void 0),m{o.style.position="",o.style.top="",this.view.removeChild(o)}),l}}class Di{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"imageArray",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,i,r,a){this._resolution=a,e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}getImageArray(e){this.imageArray||(this.imageArray=this.context.getImageData(0,0,this._width,this._height).data);const t=this.imageArray,i=Math.round(e.x*this._resolution),r=4*(Math.round(e.y*this._resolution)*this._width+i);return[t[r],t[r+1],t[r+2],t[r+3]]}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,y(e,t=>{t.margin&&(this.margin.left=Math.max(this.margin.left,t.margin.left),this.margin.right=Math.max(this.margin.right,t.margin.right),this.margin.top=Math.max(this.margin.top,t.margin.top),this.margin.bottom=Math.max(this.margin.bottom,t.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class Bi{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,r,a){this.width!=null&&(e=this.width,i=this.width),this.height!=null&&(t=this.height,r=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function Qe(b,e){b==null?requestAnimationFrame(e):setTimeout(()=>{requestAnimationFrame(e)},1e3/b)}class ze{constructor(e,t={},i){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyAnimation",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new dt}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:Jt.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:nt}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:$t.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:qt.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Zt.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:bt.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:ft.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:_t.new(this,{})}),Object.defineProperty(this,"_paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");let r,a;if(this._settings=t,t.accessible==0&&(this._a11yD=!0),t.useSafeResolution==null&&(t.useSafeResolution=!0),t.useSafeResolution&&(r=mt()),this._renderer=new ji(r),a=e instanceof HTMLElement?e:document.getElementById(e),y(ie.rootElements,l=>{if(l.dom===a)throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=pe.new(this,{}),a===null)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=a;let s=document.createElement("div");s.style.position="relative",s.style.width="100%",s.style.height="100%",a.appendChild(s);const n=t.tooltipContainerBounds;n&&(this._tooltipContainerSettings=n),this._inner=s,this._updateComputedStyles(),ie.rootElements.push(this)}static new(e,t){const i=new ze(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(Z.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:tt(100),centerY:J,tooltipText:"Created using amCharts 5",tooltipX:J,cursorOverStyle:"pointer",background:pt.new(this,{fill:re(4671320),fillOpacity:0,tooltipY:5})})),t=$e.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),e.states.create("hover",{}),e.children.push(Fe.new(this,{stroke:re(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:re(3976191)}),e.children.push(Fe.new(this,{stroke:re(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:re(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._settings;e.accessible!==!1&&(e.focusable&&(this._inner.setAttribute("focusable","true"),this._inner.setAttribute("tabindex",this.tabindex+"")),e.ariaLabel&&this._inner.setAttribute("aria-label",e.ariaLabel),e.role&&this._inner.setAttribute("role",e.role));const t=this._renderer,i=this._getRealSize(),r=this._getCalculatedSize(i),a=Math.floor(r.width),s=Math.floor(r.height),n=Math.floor(i.width),l=Math.floor(i.height),d=Z.new(this,{visible:!0,width:a,height:s});this._rootContainer=d,this._rootContainer._defaultThemes.push(Ut.new(this));const m=d.children.push(Z.new(this,{visible:!0,width:J,height:J}));this.container=m,t.resize(n,l,a,s),this._inner.appendChild(t.view),this._initResizeSensor();const c=document.createElement("div");if(this._htmlElementContainer=c,c.className="am5-html-container",c.style.position="absolute",c.style.pointerEvents="none",this._tooltipContainerSettings||(c.style.overflow="hidden"),this._inner.appendChild(c),this._a11yD!==!0){const f=document.createElement("div");f.className="am5-reader-container",f.setAttribute("role","alert"),f.style.position="absolute",f.style.width="1px",f.style.height="1px",f.style.overflow="hidden",f.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=f,this._inner.appendChild(this._readerAlertElement);const o=document.createElement("div");o.className="am5-focus-container",o.style.position="absolute",o.style.pointerEvents="none",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.width=a+"px",o.style.height=s+"px",o.setAttribute("role","graphics-document"),K(o,!1),this._focusElementContainer=o,this._inner.appendChild(this._focusElementContainer);const p=document.createElement("div");this._tooltipElementContainer=p,p.className="am5-tooltip-container",this._inner.appendChild(p),ge("keyboardevents")&&(this._disposers.push(C(window,"keydown",h=>{const u=de(h);u=="Shift"?this._isShift=!0:u=="Tab"&&(this._isShift=h.shiftKey)})),this._disposers.push(C(window,"keyup",h=>{de(h)=="Shift"&&(this._isShift=!1)})),this._disposers.push(C(o,"click",()=>{const h=this._focusedSprite;if(h){const u=t.getEvent(new MouseEvent("click"));h.events.dispatch("click",{type:"click",originalEvent:u.event,point:u.point,simulated:!0,target:h})}})),this._disposers.push(C(o,"keydown",h=>{const u=this._focusedSprite;if(u){h.key=="Escape"&&(gt(),this._focusedSprite=void 0);let g=0,w=0;const v=de(h);switch(v){case"Enter":case" ":if(v==" "&&u.get("role")!="checkbox")return;h.preventDefault();const _=t.getEvent(new MouseEvent("mouse"));return void u.events.dispatch("click",{type:"click",originalEvent:_.event,point:_.point,simulated:!0,target:u});case"ArrowLeft":g=-6;break;case"ArrowRight":g=6;break;case"ArrowUp":w=-6;break;case"ArrowDown":w=6;break;default:return}if(g!=0||w!=0){if(h.preventDefault(),!u.isDragging()){this._keyboardDragPoint={x:0,y:0};const E=t.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));E.point={x:0,y:0},u.events.isEnabled("pointerdown")&&u.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:E.event,point:E.point,simulated:!0,target:u})}const _=this._keyboardDragPoint;_.x+=g,_.y+=w;const x=t.getEvent(new MouseEvent("mousemove",{clientX:_.x,clientY:_.y}),!1);u.events.isEnabled("globalpointermove")&&u.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:x.event,point:x.point,simulated:!0,target:u})}}})),this._disposers.push(C(o,"keyup",h=>{if(this._focusedSprite){const u=this._focusedSprite,g=de(h);switch(g){case"ArrowLeft":case"ArrowRight":case"ArrowTop":case"ArrowDown":if(u.isDragging()){const w=this._keyboardDragPoint,v=t.getEvent(new MouseEvent("mouseup",{clientX:w.x,clientY:w.y}));return u.events.isEnabled("globalpointerup")&&u.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:v.event,point:v.point,simulated:!0,target:u}),void(this._keyboardDragPoint=void 0)}if(u.get("focusableGroup")){const w=u.get("focusableGroup"),v=this._tabindexes.filter(E=>!(E.get("focusableGroup")!=w||E.getPrivate("focusable")===!1||!E.isVisibleDeep()));let _=v.indexOf(u);const x=v.length-1;_+=g=="ArrowRight"||g=="ArrowDown"?1:-1,_<0?_=x:_>x&&(_=0),yt(v[_].getPrivate("focusElement").dom)}}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new Xt(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),r=Math.floor(t.height);if(i>0&&r>0){const a=Math.floor(e.width),s=Math.floor(e.height),n=this._htmlElementContainer;if(n.style.width=i+"px",n.style.height=r+"px",this._a11yD!==!0){const d=this._focusElementContainer;d.style.width=i+"px",d.style.height=r+"px"}this._renderer.resize(a,s,i,r);const l=this._rootContainer;l.setPrivate("width",i),l.setPrivate("height",r),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){y(this._tickers,t=>{t(e)})}_runAnimations(e){let t=0;return we(this._animations,i=>{const r=i._runAnimation(e);return r!==Xe.Stopped&&(r!==Xe.Playing||(++t,!0))}),this._isDirtyAnimation=!1,t===0}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,se(this._dirtyParents).forEach(s=>{const n=this._dirtyParents[s];delete this._dirtyParents[s],n.isDisposed()||(e[n.uid]=n,n._prepareChildren())});se(e).forEach(s=>{e[s]._updateChildren()});const t=[];se(this._dirty).forEach(s=>{const n=this._dirty[s];n.isDisposed()?delete this._dirty[n.uid]:(t.push(n),n._beforeChanged())}),t.forEach(s=>{s._changed(),delete this._dirty[s.uid],s._clearDirty()}),this._isDirty=!1;const i={},r=[];se(this._dirtyBounds).forEach(s=>{const n=this._dirtyBounds[s];delete this._dirtyBounds[s],n.isDisposed()||(i[n.uid]=n.depth(),r.push(n))}),this._positionHTMLElements(),r.sort((s,n)=>vt(i[n.uid],i[s.uid])),r.forEach(s=>{s._updateBounds()});const a=this._dirtyPositions;se(a).forEach(s=>{const n=a[s];delete a[s],n.isDisposed()||n._updatePosition()}),t.forEach(s=>{s._afterChanged()})}_renderFrame(e){if(this._updateTick){this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e);const t=this._runAnimations(e);return this._runDirties(),this._render(),this._renderer.resetImageArray(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),this._tickers.length===0&&t&&!this._isDirtyAnimation&&!this._isDirty}return!0}_runTicker(e,t){this.isDisposed()||(this.animationTime=e,this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:Qe(this.fps,this._ticker)))}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const i=performance.now();if(i>=t){this.animationTime=null;break}if(this.animationTime=i,this._renderFrame(i)){this.animationTime=null;break}}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},Qe(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){this._isDirty=!0,this._dirty[e.uid]===void 0&&(this._dirty[e.uid]=e),this._startTicker()}_addDirtyParent(e){this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]===void 0&&(this._dirtyParents[e.uid]=e),this._startTicker()}_addDirtyBounds(e){this._isDirty=!0,this._dirtyBounds[e.uid]===void 0&&(this._dirtyBounds[e.uid]=e),this._startTicker()}_addDirtyPosition(e){this._isDirty=!0,this._dirtyPositions[e.uid]===void 0&&(this._dirtyPositions[e.uid]=e),this._startTicker()}_addAnimation(e){this._isDirtyAnimation=!0,this._animations.indexOf(e)===-1&&this._animations.push(e),this._startTicker()}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(e){return this._tickers.push(e),this._startTicker(),new X(()=>{Ae(this._tickers,e)})}markDirtyGlobal(e){e||(e=this.container),e.walkChildren(t=>{t instanceof Z&&this.markDirtyGlobal(t),t.markDirty(),t.markDirtyBounds()})}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),y(this._disposers,e=>{e.dispose()}),this._inner&&wt(this._inner),ae(ie.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){this._a11yD!==!0&&(this._readerAlertElement.innerHTML=Ye(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(Z.new(this,{position:"absolute",isMeasured:!1,width:J,height:J,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=$e.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){this._a11yD!=1&&(e.get("focusable")?De(this._tabindexes,e):ae(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){this._a11yD!=1&&(ae(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==1)return;this._tabindexes.sort((t,i)=>{const r=t.get("tabindexOrder",0),a=i.get("tabindexOrder",0);return r==a?0:r>a?1:-1});const e=[];y(this._tabindexes,(t,i)=>{t.getPrivate("focusElement")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const r=t.get("focusableGroup");r&&t.getPrivate("focusable")!==!1&&(e.indexOf(r)!==-1?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(r))})}_updateCurrentFocus(){this._a11yD!=1&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(this._a11yD==1||(t||(t=e.getPrivate("focusElement").dom),!t))return;const i=e.get("role");i?t.setAttribute("role",i):t.removeAttribute("role");const r=e.get("ariaLabel");if(r){const h=xt(e,r);t.setAttribute("aria-label",h)}else t.removeAttribute("aria-label");const a=e.get("ariaLive");a?t.setAttribute("aria-live",a):t.removeAttribute("aria-live");const s=e.get("ariaChecked");s!=null&&i&&["checkbox","option","radio","menuitemcheckbox","menuitemradio","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-checked",s?"true":"false"):t.removeAttribute("aria-checked");const n=e.get("ariaCurrent");n!=null?t.setAttribute("aria-current",n):t.removeAttribute("aria-current");const l=e.get("ariaSelected");l!=null&&i&&["gridcell","option","row","tab","columnheader","rowheader","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-selected",l?"true":"false"):t.removeAttribute("aria-selected"),e.get("ariaHidden")?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden");const d=e.get("ariaOrientation");d?t.setAttribute("aria-orientation",d):t.removeAttribute("aria-orientation");const m=e.get("ariaValueNow");m?t.setAttribute("aria-valuenow",m):t.removeAttribute("aria-valuenow");const c=e.get("ariaValueMin");c?t.setAttribute("aria-valuemin",c):t.removeAttribute("aria-valuemin");const f=e.get("ariaValueMax");f?t.setAttribute("aria-valuemax",f):t.removeAttribute("aria-valuemax");const o=e.get("ariaValueText");o?t.setAttribute("aria-valuetext",o):t.removeAttribute("aria-valuetext");const p=e.get("ariaControls");p?t.setAttribute("aria-controls",p):t.removeAttribute("aria-controls"),e.get("visible")&&e.get("opacity")!==0&&e.get("role")!="tooltip"&&!e.isHidden()&&e.getPrivate("focusable")!==!1?(t.getAttribute("tabindex")!="-1"&&t.setAttribute("tabindex",""+this.tabindex),t.removeAttribute("aria-hidden")):(t.removeAttribute("tabindex"),t.setAttribute("aria-hidden","true"))}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||this._a11yD==1)return;const i=document.createElement("div");t.get("role")!="tooltip"&&(i.tabIndex=this.tabindex),i.style.position="absolute",K(i,!1);const r=[];t.setPrivate("focusElement",{dom:i,disposers:r}),this._decorateFocusElement(t),r.push(C(i,"focus",a=>{this._handleFocus(a)})),r.push(C(i,"blur",a=>{this._handleBlur(a)})),this._moveFocusElement(e,t)}_removeFocusElement(e){if(this._a11yD==1)return;ae(this._tabindexes,e);const t=e.getPrivate("focusElement");t&&(this._focusElementContainer.removeChild(t.dom),y(t.disposers,i=>{i.dispose()}))}_hideFocusElement(e){this._a11yD!=1&&(e.getPrivate("focusElement").dom.style.display="none")}_moveFocusElement(e,t){if(this._a11yD==1)return;const i=this._focusElementContainer,r=t.getPrivate("focusElement").dom;if(r===this._focusElementContainer.children[e])return;const a=this._focusElementContainer.children[e+1];a?i.insertBefore(r,a):i.append(r)}_positionFocusElement(e){if(this._a11yD==1||e==null)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,r=t.top==t.bottom?e.height():t.bottom-t.top;const a=this._settings.focusPadding!==void 0?this._settings.focusPadding:2;let s=t.left-a,n=t.top-a;i<0&&(s+=i,i=Math.abs(i)),r<0&&(n+=r,r=Math.abs(r));const l=e.getPrivate("focusElement").dom;l.style.top=n+"px",l.style.left=s+"px",l.style.width=i+2*a+"px",l.style.height=r+2*a+"px"}_getSpriteByFocusElement(e){let t;return Ce(this._tabindexes,(i,r)=>i.getPrivate("focusElement").dom!==e||(t=i,!1)),t}_handleFocus(e){if(this._a11yD==1)return;const t=this._getSpriteByFocusElement(e.target);t&&(t.isVisibleDeep()?(this._positionFocusElement(t),this._focusedSprite=t,t.events.isEnabled("focus")&&t.events.dispatch("focus",{type:"focus",originalEvent:e,target:t})):this._focusNext(e.target,this._isShift?-1:1))}_focusNext(e,t){if(this._a11yD==1)return;const i=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let r=i.indexOf(e)+t;r<0?r=i.length-1:r>=i.length&&(r=0),i[r].focus()}_handleBlur(e){if(this._a11yD==1)return;const t=this._focusedSprite;t&&!t.isDisposed()&&t.events.isEnabled("blur")&&t.events.dispatch("blur",{type:"blur",originalEvent:e,target:t}),this._focusedSprite=void 0}updateTooltip(e){if(this._a11yD==1)return;const t=Ye(e._getText());let i=e.getPrivate("tooltipElement");e.get("role")=="tooltip"&&t!=""?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t),i.setAttribute("aria-hidden",e.isVisibleDeep()?"false":"true")):i&&(i.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",K(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate("tooltipElement",i),i}_removeTooltipElement(e){if(this._a11yD==1)return;const t=e.getPrivate("tooltipElement");if(t){const i=t.parentElement;i&&i.removeChild(t)}}_invalidateAccessibility(e){if(this._a11yD==1)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:(e.x-t.left)*r,y:(e.y-t.top)*a}}rootPointToDocument(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:e.x/r+t.left,y:e.y/a+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";ue(e,(r,a)=>{ye(r)&&r.match(/^font/)&&(t+=a)});const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof Z?e.children.each(t=>{this._invalidateLabelBounds(t)}):e instanceof Pt&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e{const a=this._renderer.getEvent(r);e.events.dispatch("click",{type:"click",originalEvent:a.event,point:a.point,simulated:!1,target:e})}))),this._positionHTMLElement(e),t.append(i),De(this._htmlEnabledContainers,e),i}_positionHTMLElements(){y(this._htmlEnabledContainers,e=>{this._positionHTMLElement(e)})}_positionHTMLElement(e){const t=e.getPrivate("htmlElement");if(t){y(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],u=>{const g=e.get(u);t.style[u]=g?g+"px":""});const i=e.compositeScale()||1,r=e.compositeRotation()||0;t.style.transform="",t.style.transformOrigin="";const a=e.compositeOpacity();setTimeout(()=>{t.style.opacity=a+""},10);const s=e.isVisibleDeep();s&&(t.style.display="block");let n={x:e.x(),y:e.y()};e.parent&&(n=e.parent.toGlobal(n)),t.style.top=n.y+"px",t.style.left=n.x+"px";const l=e.get("width"),d=e.get("height");let m=0,c=0;if(l&&(m=e.width()),d&&(c=e.height()),!l||!d){t.style.position="fixed",t.style.width="",t.style.height="";const u=t.getBoundingClientRect();t.style.position="absolute",l||(m=u.width),d||(c=u.height);let g=m/i,w=c/i,v=e.get("centerX",0),_=e.get("centerY",0),x=0,E=0,k=0,M=0;v instanceof ve?(x=-v.value*g,E=(1-v.value)*g):(x=-v,E=g-v),_ instanceof ve?(k=-_.value*w,M=(1-_.value)*w):(k=-_,M=w-_),e._localBounds={left:x,right:E,top:k,bottom:M};let j=e._adjustedLocalBounds,O=e._display.getAdjustedBounds(e._localBounds);e._adjustedLocalBounds=O,j.left===O.left&&j.right===O.right&&j.top===O.top&&j.bottom===O.bottom||e.markDirtyBounds()}m>0&&(t.style.minWidth=m+"px"),c>0&&(t.style.minHeight=c+"px"),s&&a!=0||(t.style.display="none");const f=e.get("centerX",0),o=He(f)?f.percent+"%":f+"px",p=e.get("centerY",0),h=He(p)?p.percent+"%":p+"px";(f||p)&&(t.style.transform="translate(-"+o+", -"+h+")"+t.style.transform),i!=1&&(t.style.transform+="scale("+i+")"),r!=0&&(t.style.transform+=" rotate("+r+"deg)"),t.style.transform!=""&&(t.style.transformOrigin=o+" "+h)}}_setHTMLContent(e,t){let i=e.getPrivate("htmlElement");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&(this._htmlElementContainer.removeChild(t),e.removePrivate("htmlElement")),ae(this._htmlEnabledContainers,e)}}ct("AM5C241025748");const et="en-us",Ie=new Map([["ar",()=>P(()=>import("./ar-69w_pNvD-7lDIs8Pw.js"),[],import.meta.url)],["bg-bg",()=>P(()=>import("./bg_BG-HxX0GdS4-O8Kpb0zp.js"),[],import.meta.url)],["bs-ba",()=>P(()=>import("./bs_BA-DrqKjqQh-Cr-VUOtJ.js"),[],import.meta.url)],["ca-es",()=>P(()=>import("./ca_ES-B8P53VJs-DWC4n8NA.js"),[],import.meta.url)],["cs-cz",()=>P(()=>import("./cs_CZ-Bqde4kKV-CyqqX6ir.js"),[],import.meta.url)],["da-dk",()=>P(()=>import("./da_DK-BHlKtWuS-2ex9kBWh.js"),[],import.meta.url)],["de-de",()=>P(()=>import("./de_DE-BjuOMedt-BF1_XBt7.js"),[],import.meta.url)],["de-ch",()=>P(()=>import("./de_CH-DAPp1Ncl-B97rjhoW.js"),[],import.meta.url)],["el-gr",()=>P(()=>import("./el_GR-C1WdWwt2-BN9c0-aL.js"),[],import.meta.url)],["en-us",()=>P(()=>import("./en_US-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["en-ca",()=>P(()=>import("./en_CA-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["es-es",()=>P(()=>import("./es_ES-D1FgMsXM-_3WcXaQ2.js"),[],import.meta.url)],["et-ee",()=>P(()=>import("./et_EE-Dz_TpNNF-F7kgGek-.js"),[],import.meta.url)],["fi-fi",()=>P(()=>import("./fi_FI-Cte3XVjc-Bozs9Z2H.js"),[],import.meta.url)],["fr-fr",()=>P(()=>import("./fr_FR-D4Jnvm3b-BkfBDc1T.js"),[],import.meta.url)],["he-il",()=>P(()=>import("./he_IL-DcsZ56bm-B900khEo.js"),[],import.meta.url)],["hr-hr",()=>P(()=>import("./hr_HR-C0BJtvO7-BXNws4dg.js"),[],import.meta.url)],["hu-hu",()=>P(()=>import("./hu_HU-BGreOcqI-BPCtb03x.js"),[],import.meta.url)],["id-id",()=>P(()=>import("./id_ID-DCZBbKD3-Bk2oUsUi.js"),[],import.meta.url)],["it-it",()=>P(()=>import("./it_IT-BeKgphnk-BU_dnupK.js"),[],import.meta.url)],["ja-jp",()=>P(()=>import("./ja_JP-gzKc2xa8-BjWjUZZi.js"),[],import.meta.url)],["ko-kr",()=>P(()=>import("./ko_KR-sv9FjurR-C63G07Pj.js"),[],import.meta.url)],["lt-lt",()=>P(()=>import("./lt_LT-yZNULmv_-DHDBnlgq.js"),[],import.meta.url)],["lv-lv",()=>P(()=>import("./lv_LV-Cu8aigXF-BGX5_oyM.js"),[],import.meta.url)],["nb-no",()=>P(()=>import("./nb_NO-CqN3wUJH-BVuLzJb0.js"),[],import.meta.url)],["nl-nl",()=>P(()=>import("./nl_NL-DAiuag9r-DiE2F1Fx.js"),[],import.meta.url)],["pl-pl",()=>P(()=>import("./pl_PL-BDbrX9O9-CCCo8oJV.js"),[],import.meta.url)],["pt-br",()=>P(()=>import("./pt_BR-D3fc0auN-ClOz39JC.js"),[],import.meta.url)],["pt-pt",()=>P(()=>import("./pt_PT-ne3A0-MZ-CugZtzXR.js"),[],import.meta.url)],["ro-ro",()=>P(()=>import("./ro_RO-BfLaePMk-D4DP893q.js"),[],import.meta.url)],["ru-ru",()=>P(()=>import("./ru_RU-jSaqVZwA-TpCrDGWK.js"),[],import.meta.url)],["sk-sk",()=>P(()=>import("./sk_SK-Dp9r7-Al-CP61SfDR.js"),[],import.meta.url)],["sl-sl",()=>P(()=>import("./sl_SL-CArbvniK-hZyOU_tZ.js"),[],import.meta.url)],["sr-rs",()=>P(()=>import("./sr_RS-KKcjmG1u-BY82CeQm.js"),[],import.meta.url)],["sv-se",()=>P(()=>import("./sv_SE-CT8Rd8gJ-CRc7K9Uw.js"),[],import.meta.url)],["th-th",()=>P(()=>import("./th_TH-DHvdpgHD-CZOpdnuT.js"),[],import.meta.url)],["tr-tr",()=>P(()=>import("./tr_TR-CooWKX5o-BqZDkyaY.js"),[],import.meta.url)],["uk-ua",()=>P(()=>import("./uk_UA-D4LhzxxY-iB1TkjZJ.js"),[],import.meta.url)],["vi-vn",()=>P(()=>import("./vi_VN-Byu5lfYa-DrrDewoL.js"),[],import.meta.url)],["zh-cn",()=>P(()=>import("./zh_Hans-DQ0VpKp5-DN9wG9bm.js"),[],import.meta.url)],["zh-hk",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)],["zh-tw",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)]]);function Ai(b){const e=b.split("-")[0].toLowerCase();let t=null;for(const i of Ie.keys())if(i.startsWith(e)){t=i;break}return t}function Ci(b){return b?Ie.has(b.toLowerCase())?b.toLowerCase():Ai(b)||et:et}async function Yi(b,e=ut()){const t=ze.new(b);return t.locale=(await Ie.get(Ci(e))()).default,t}export{Yi as createRoot}; +import{_ as P}from"./main-QGPoLsvl.js";import{h as ut}from"./story-Doly9N9p.js";import{E as te,O as ct,W as dt,z as bt,G as ft,Y as _t,R as mt,c as y,L as ie,H as Z,s as tt,U as J,K as pt,l as re,V as Fe,I as K,o as ge,a as C,b as de,j as gt,d as yt,w as we,k as se,N as vt,D as X,P as Ae,T as wt,e as ae,f as Ye,g as De,t as xt,h as Ce,v as ue,i as ye,m as Pt,n as ve,p as He,S as it,q as rt,r as Le,u as Ot,x as ee,y as Q,_ as W,F as kt,A as Et,B as H,C as Mt,J as B,Q as be,M as fe,X as Ve,Z as St,$ as Ue,a0 as Tt,a1 as jt,a2 as V,a3 as We,a4 as Dt,a5 as Bt,a6 as At,a7 as Ct,a8 as $,a9 as _e,aa as Lt,ab as Ge,ac as Be,ad as st,ae as Xe,af as zt,ag as It,ah as ke,ai as Rt,aj as Ft,ak as Yt,al as Ht,am as Vt,an as le}from"./Theme-rblUnB2V-Dc7wtY6B.js";import{w as $e}from"./Tooltip-B0HefZ7r-CZdyswYp.js";import{h as Ut}from"./DefaultTheme-Bt5OI-Ht-BKAw1o4a.js";class Wt{constructor(){Object.defineProperty(this,"_observer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this._observer=new ResizeObserver(e=>{y(e,t=>{y(this._targets,i=>{i.target===t.target&&i.callback()})})})}addTarget(e,t){this._observer.observe(e,{box:"border-box"}),this._targets.push({target:e,callback:t})}removeTarget(e){this._observer.unobserve(e),we(this._targets,t=>t.target!==e)}}class xe{constructor(){Object.defineProperty(this,"_timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_targets",{enumerable:!0,configurable:!0,writable:!0,value:[]})}addTarget(e,t){if(this._timer===null){let r=null;const a=()=>{const s=Date.now();(r===null||s>r+xe.delay)&&(r=s,y(this._targets,n=>{let l=n.target.getBoundingClientRect();l.width===n.size.width&&l.height===n.size.height||(n.size=l,n.callback())})),this._targets.length===0?this._timer=null:this._timer=requestAnimationFrame(a)};this._timer=requestAnimationFrame(a)}let i={width:0,height:0,left:0,right:0,top:0,bottom:0,x:0,y:0};this._targets.push({target:e,callback:t,size:i})}removeTarget(e){we(this._targets,t=>t.target!==e),this._targets.length===0&&this._timer!==null&&(cancelAnimationFrame(this._timer),this._timer=null)}}Object.defineProperty(xe,"delay",{enumerable:!0,configurable:!0,writable:!0,value:200});let Ee=null;function Gt(){return Ee===null&&(Ee=typeof ResizeObserver<"u"?new Wt:new xe),Ee}class Xt{constructor(e,t){Object.defineProperty(this,"_sensor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_listener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_disposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this._sensor=Gt(),this._element=e,this._listener=it(t),this._sensor.addTarget(e,t)}isDisposed(){return this._disposed}dispose(){this._disposed||(this._disposed=!0,this._sensor.removeTarget(this._element),this._listener.dispose())}get sensor(){return this._sensor}}class pe extends te{}Object.defineProperty(pe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"InterfaceColors"}),Object.defineProperty(pe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:te.classNames.concat([pe.className])});class $t extends te{_setDefaults(){this._setDefault("negativeBase",0),this._setDefault("numberFormat","#,###.#####"),this._setDefault("smallNumberThreshold",1);const e="_big_number_suffix_",t="_small_number_suffix_",i="_byte_suffix_";this._setDefault("bigNumberPrefixes",[{number:1e3,suffix:this._t(e+"3")},{number:1e6,suffix:this._t(e+"6")},{number:1e9,suffix:this._t(e+"9")},{number:1e12,suffix:this._t(e+"12")},{number:1e15,suffix:this._t(e+"15")},{number:1e18,suffix:this._t(e+"18")},{number:1e21,suffix:this._t(e+"21")},{number:1e24,suffix:this._t(e+"24")}]),this._setDefault("smallNumberPrefixes",[{number:1e-24,suffix:this._t(t+"24")},{number:1e-21,suffix:this._t(t+"21")},{number:1e-18,suffix:this._t(t+"18")},{number:1e-15,suffix:this._t(t+"15")},{number:1e-12,suffix:this._t(t+"12")},{number:1e-9,suffix:this._t(t+"9")},{number:1e-6,suffix:this._t(t+"6")},{number:.001,suffix:this._t(t+"3")}]),this._setDefault("bytePrefixes",[{number:1,suffix:this._t(i+"B")},{number:1024,suffix:this._t(i+"KB")},{number:1048576,suffix:this._t(i+"MB")},{number:1073741824,suffix:this._t(i+"GB")},{number:1099511627776,suffix:this._t(i+"TB")},{number:0x4000000000000,suffix:this._t(i+"PB")}]),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i){let r;(t==null||ye(t)&&t.toLowerCase()==="number")&&(t=this.get("numberFormat",""));let a=Number(e);if(rt(t))try{return this.get("intlLocales")?new Intl.NumberFormat(this.get("intlLocales"),t).format(a):new Intl.NumberFormat(void 0,t).format(a)}catch{return"Invalid"}else{t=Le(t);let s,n=this.parseFormat(t,this._root.language);s=a>this.get("negativeBase")?n.positive:a{if(l.parsed)return;let d=l.source;d.toLowerCase()==="number"&&(d=this.get("numberFormat","#,###.#####"));let m=W.chunk(d,!0);for(let c=0;c=0?e.toExponential(t.decimals.passive).split("e"):e.toExponential().split("e"),e=Number(c[0]),a="e"+c[1],t.modSpacing&&(a=" "+a)}else if(t.decimals.passive===0)e=Math.round(e);else if(t.decimals.passive>0){const c=kt(e);if(c>0){const f=Math.pow(10,t.decimals.passive);e=Math.round(parseFloat((e*f).toFixed(c)))/f}}let n="",l=Et(e).split("."),d=l[0];if(d.length0){let c=[],f=d.split("").reverse().join("");for(let o=0,p=d.length;o<=p;o+=t.thousands.interval){let h=f.substr(o,t.thousands.interval).split("").reverse().join("");h!==""&&c.unshift(h)}d=c.join(t.thousands.separator)}n+=d,l.length===1&&l.push("");let m=l[1];return m.length{switch(m.type){case"year":t=+m.value;break;case"month":i=+m.value-1;break;case"day":r=+m.value;break;case"hour":a=+m.value;break;case"minute":s=+m.value;break;case"second":n=+m.value;break;case"fractionalSecond":l=+m.value;break;case"weekday":switch(m.value){case"Sun":d=0;break;case"Mon":d=1;break;case"Tue":d=2;break;case"Wed":d=3;break;case"Thu":d=4;break;case"Fri":d=5;break;case"Sat":d=6}}}),a===24&&(a=0),{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l,weekday:d}}function Ne(b,e){const{year:t,month:i,day:r,hour:a,minute:s,second:n,millisecond:l}=at(b,e);return Date.UTC(t,i,r,a,s,n,l)}class Nt{constructor(e,t){if(Object.defineProperty(this,"_utc",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_dtf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!t)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");this.name=e,this._utc=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3}),this._dtf=new Intl.DateTimeFormat("UTC",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",weekday:"short",fractionalSecondDigits:3})}static new(e){return new this(e,!0)}convertLocal(e){const t=this.offsetUTC(e),i=e.getTimezoneOffset(),r=new Date(e);r.setUTCMinutes(r.getUTCMinutes()-(t-i));const a=r.getTimezoneOffset();return i!=a&&r.setUTCMinutes(r.getUTCMinutes()+a-i),r}offsetUTC(e){return(Ne(this._utc,e)-Ne(this._dtf,e))/6e4}parseDate(e){return at(this._dtf,e)}}class qt extends te{_setDefaults(){this._setDefault("capitalize",!0),this._setDefault("dateFormat","yyyy-MM-dd"),super._setDefaults()}_beforeChanged(){super._beforeChanged()}format(e,t,i=!1){let r;t!==void 0&&t!==""||(t=this.get("dateFormat","yyyy-MM-dd"));let a=e;if(rt(t))try{const l=this.get("intlLocales");return l?new Intl.DateTimeFormat(l,t).format(a):new Intl.DateTimeFormat(void 0,t).format(a)}catch{return"Invalid"}let s=this.parseFormat(t);const n=this._root.timezone;return!n||this._root.utc||i||(a=n.convertLocal(a)),H(a.getTime())?(r=this.applyFormat(a,s,i),this.get("capitalize")&&(r=r.replace(/^.{1}/,r.substr(0,1).toUpperCase())),r):"Invalid date"}applyFormat(e,t,i=!1){let r,a,s,n,l,d,m,c,f=t.template,o=e.getTime();this._root.utc&&!i?(r=e.getUTCFullYear(),a=e.getUTCMonth(),s=e.getUTCDay(),n=e.getUTCDate(),l=e.getUTCHours(),d=e.getUTCMinutes(),m=e.getUTCSeconds(),c=e.getUTCMilliseconds()):(r=e.getFullYear(),a=e.getMonth(),s=e.getDay(),n=e.getDate(),l=e.getHours(),d=e.getMinutes(),m=e.getSeconds(),c=e.getMilliseconds());for(let p=0,h=t.parts.length;p=12?this._t("PM"):this._t("AM");break;case"aa":u=l>=12?this._t("P.M."):this._t("A.M.");break;case"aaa":u=l>=12?this._t("P"):this._t("A");break;case"h":u=fe(l).toString();break;case"hh":u=B(fe(l),2,"0");break;case"H":u=l.toString();break;case"HH":u=B(l,2,"0");break;case"K":u=fe(l,0).toString();break;case"KK":u=B(fe(l,0),2,"0");break;case"k":u=(l+1).toString();break;case"kk":u=B(l+1,2,"0");break;case"m":u=d.toString();break;case"mm":u=B(d,2,"0");break;case"s":u=m.toString();break;case"ss":u=B(m,2,"0");break;case"S":case"SS":case"SSS":u=Math.round(c/1e3*Math.pow(10,t.parts[p].length)).toString();break;case"x":u=o.toString();break;case"n":case"nn":case"nnn":u=B(c,t.parts[p].length,"0");break;case"z":u=be(e,!1,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zz":u=be(e,!0,!1,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"zzz":u=be(e,!1,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0).replace(/[+-]+[0-9]+$/,"");break;case"zzzz":u=be(e,!0,!0,this._root.utc,this._root.timezone?this._root.timezone.name:void 0);break;case"Z":case"ZZ":let w=this._root.utc?"UTC":this._root.timezone;w instanceof Nt&&(w=w.name);const v=w?Mt(w):e.getTimezoneOffset();let _=Math.abs(v)/60,x=Math.floor(_),E=60*_-60*x;this._root.utc&&(x=0,E=0),t.parts[p]=="Z"?(u="GMT",u+=v>0?"-":"+",u+=B(x,2)+":"+B(E,2)):(u=v>0?"-":"+",u+=B(x,2)+B(E,2));break;case"i":u=e.toISOString();break;case"I":u=e.toUTCString()}f=f.replace(ee,u)}return f}parseFormat(e){let t={template:"",parts:[]},i=W.chunk(e,!0);for(let r=0;r-1&&(n.year=parseInt(c[s.year])),s.year3>-1){let f=parseInt(c[s.year3]);f+=1e3,n.year=f}if(s.year2>-1){let f=parseInt(c[s.year2]);f+=f>50?1e3:2e3,n.year=f}if(s.year1>-1){let f=parseInt(c[s.year1]);f=10*Math.floor(new Date().getFullYear()/10)+f,n.year=f}if(s.monthLong>-1&&(n.month=this.resolveMonth(c[s.monthLong])),s.monthShort>-1&&(n.month=this.resolveShortMonth(c[s.monthShort])),s.month>-1&&(n.month=parseInt(c[s.month])-1),s.week>-1&&s.day===-1&&(n.month=0,n.day=jt(parseInt(c[s.week]),n.year,1,this._root.utc)),s.day>-1&&(n.day=parseInt(c[s.day])),s.yearDay>-1&&(n.month=0,n.day=parseInt(c[s.yearDay])),s.hourBase0>-1&&(n.hour=parseInt(c[s.hourBase0])),s.hourBase1>-1&&(n.hour=parseInt(c[s.hourBase1])-1),s.hour12Base0>-1){let f=parseInt(c[s.hour12Base0]);f==11&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.hour12Base1>-1){let f=parseInt(c[s.hour12Base1]);f==12&&(f=0),s.am>-1&&!this.isAm(c[s.am])&&(f+=12),n.hour=f}if(s.minute>-1&&(n.minute=parseInt(c[s.minute])),s.second>-1&&(n.second=parseInt(c[s.second])),s.millisecond>-1){let f=parseInt(c[s.millisecond]);s.millisecondDigits==2?f*=10:s.millisecondDigits==1&&(f*=100),n.millisecond=f}if(s.timestamp>-1){n.timestamp=parseInt(c[s.timestamp]);const f=new Date(n.timestamp);n.year=f.getUTCFullYear(),n.month=f.getUTCMonth(),n.day=f.getUTCDate(),n.hour=f.getUTCHours(),n.minute=f.getUTCMinutes(),n.second=f.getUTCSeconds(),n.millisecond=f.getUTCMilliseconds()}s.zone>-1&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.zone])),s.iso>-1&&(n.year=V(c[s.iso+0]),n.month=V(c[s.iso+1])-1,n.day=V(c[s.iso+2]),n.hour=V(c[s.iso+3]),n.minute=V(c[s.iso+4]),n.second=V(c[s.iso+5]),n.millisecond=V(c[s.iso+6]),c[s.iso+7]=="Z"||c[s.iso+7]=="z"?n.utc=!0:c[s.iso+7]!=""&&(n.offset=this.resolveTimezoneOffset(new Date(n.year,n.month,n.day),c[s.iso+7]))),i=n.utc?new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond)):new Date(n.year,n.month,n.day,n.hour,n.minute+n.offset,n.second,n.millisecond)}else i=new Date(e);return i}resolveTimezoneOffset(e,t){if(t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/)){let i=t.match(/([+\-]?)([0-9]{2}):?([0-9]{2})/),r=i[1],a=i[2],s=i[3],n=60*parseInt(a)+parseInt(s);return r=="+"&&(n*=-1),n-(e||new Date).getTimezoneOffset()}return 0}resolveMonth(e){let t=this._months().indexOf(e);return t>-1||!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._months()).indexOf(e),t>-1)?t:0}resolveShortMonth(e){let t=this._shortMonths().indexOf(e);return t>-1?t:(t=this._months().indexOf(e),t>-1||this._root.language&&!this._root.language.isDefault()&&(t=this._root.language.translateAll(this._shortMonths()).indexOf(e),t>-1)?t:0)}isAm(e){return this.getStringList(["AM","A.M.","A"]).indexOf(e.toUpperCase())>-1}getStringList(e){let t=[];for(let i=0;ithis.get("negativeBase")?s.positive:n{if(n.parsed)return;let l=n.source,d=[];d=n.source.match(/^\[([^\]]*)\]/),d&&d.length&&d[0]!==""&&(l=n.source.substr(d[0].length),n.color=d[1]);let m=W.chunk(l,!0);for(let c=0;c{if(a==t||i){if(r/s<=1)return i||(i=a),!1;i=a}return!0}),i}getMilliseconds(e,t){return t||(t=this.get("baseUnit")),e*this._getUnitValue(t)}_getUnitValue(e){return this._getUnitValues()[e]}_getUnitValues(){return{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:2592e6,year:31536e6}}}const nt={firstDayOfWeek:1,_decimalSeparator:".",_thousandSeparator:",",_percentPrefix:null,_percentSuffix:"%",_big_number_suffix_3:"k",_big_number_suffix_6:"M",_big_number_suffix_9:"G",_big_number_suffix_12:"T",_big_number_suffix_15:"P",_big_number_suffix_18:"E",_big_number_suffix_21:"Z",_big_number_suffix_24:"Y",_small_number_suffix_3:"m",_small_number_suffix_6:"μ",_small_number_suffix_9:"n",_small_number_suffix_12:"p",_small_number_suffix_15:"f",_small_number_suffix_18:"a",_small_number_suffix_21:"z",_small_number_suffix_24:"y",_byte_suffix_B:"B",_byte_suffix_KB:"KB",_byte_suffix_MB:"MB",_byte_suffix_GB:"GB",_byte_suffix_TB:"TB",_byte_suffix_PB:"PB",_date:"yyyy-MM-dd",_date_millisecond:"mm:ss SSS",_date_millisecond_full:"HH:mm:ss SSS",_date_second:"HH:mm:ss",_date_second_full:"HH:mm:ss",_date_minute:"HH:mm",_date_minute_full:"HH:mm - MMM dd, yyyy",_date_hour:"HH:mm",_date_hour_full:"HH:mm - MMM dd, yyyy",_date_day:"MMM dd",_date_day_full:"MMM dd, yyyy",_date_week:"ww",_date_week_full:"MMM dd, yyyy",_date_month:"MMM",_date_month_full:"MMM, yyyy",_date_year:"yyyy",_duration_millisecond:"SSS",_duration_millisecond_second:"ss.SSS",_duration_millisecond_minute:"mm:ss SSS",_duration_millisecond_hour:"hh:mm:ss SSS",_duration_millisecond_day:"d'd' mm:ss SSS",_duration_millisecond_week:"d'd' mm:ss SSS",_duration_millisecond_month:"M'm' dd'd' mm:ss SSS",_duration_millisecond_year:"y'y' MM'm' dd'd' mm:ss SSS",_duration_second:"ss",_duration_second_minute:"mm:ss",_duration_second_hour:"hh:mm:ss",_duration_second_day:"d'd' hh:mm:ss",_duration_second_week:"d'd' hh:mm:ss",_duration_second_month:"M'm' dd'd' hh:mm:ss",_duration_second_year:"y'y' MM'm' dd'd' hh:mm:ss",_duration_minute:"mm",_duration_minute_hour:"hh:mm",_duration_minute_day:"d'd' hh:mm",_duration_minute_week:"d'd' hh:mm",_duration_minute_month:"M'm' dd'd' hh:mm",_duration_minute_year:"y'y' MM'm' dd'd' hh:mm",_duration_hour:"hh'h'",_duration_hour_day:"d'd' hh'h'",_duration_hour_week:"d'd' hh'h'",_duration_hour_month:"M'm' dd'd' hh'h'",_duration_hour_year:"y'y' MM'm' dd'd' hh'h'",_duration_day:"d'd'",_duration_day_week:"d'd'",_duration_day_month:"M'm' dd'd'",_duration_day_year:"y'y' MM'm' dd'd'",_duration_week:"w'w'",_duration_week_month:"w'w'",_duration_week_year:"w'w'",_duration_month:"M'm'",_duration_month_year:"y'y' MM'm'",_duration_year:"y'y'",_era_ad:"AD",_era_bc:"BC",A:"",P:"",AM:"",PM:"","A.M.":"","P.M.":"",January:"",February:"",March:"",April:"",May:"",June:"",July:"",August:"",September:"",October:"",November:"",December:"",Jan:"",Feb:"",Mar:"",Apr:"","May(short)":"May",Jun:"",Jul:"",Aug:"",Sep:"",Oct:"",Nov:"",Dec:"",Sunday:"",Monday:"",Tuesday:"",Wednesday:"",Thursday:"",Friday:"",Saturday:"",Sun:"",Mon:"",Tue:"",Wed:"",Thu:"",Fri:"",Sat:"",_dateOrd:function(b){let e="th";if(b<11||b>13)switch(b%10){case 1:e="st";break;case 2:e="nd";break;case 3:e="rd"}return e},"Zoom Out":"",Play:"",Stop:"",Legend:"","Press ENTER to toggle":"",Loading:"",Home:"",Chart:"","Serial chart":"","X/Y chart":"","Pie chart":"","Gauge chart":"","Radar chart":"","Sankey diagram":"","Flow diagram":"","Chord diagram":"","TreeMap chart":"","Force directed tree":"","Sliced chart":"",Series:"","Candlestick Series":"","OHLC Series":"","Column Series":"","Line Series":"","Pie Slice Series":"","Funnel Series":"","Pyramid Series":"","X/Y Series":"",Map:"","Press ENTER to zoom in":"","Press ENTER to zoom out":"","Use arrow keys to zoom in and out":"","Use plus and minus keys on your keyboard to zoom in and out":"",Export:"",Image:"",Data:"",Print:"","Press ENTER or use arrow keys to navigate":"","Press ENTER to open":"","Press ENTER to print.":"","Press ENTER to export as %1.":"","(Press ESC to close this message)":"","Image Export Complete":"","Export operation took longer than expected. Something might have gone wrong.":"","Saved from":"",PNG:"",JPG:"",GIF:"",SVG:"",PDF:"",JSON:"",CSV:"",XLSX:"",HTML:"","Use TAB to select grip buttons or left and right arrows to change selection":"","Use left and right arrows to move selection":"","Use left and right arrows to move left selection":"","Use left and right arrows to move right selection":"","Use TAB select grip buttons or up and down arrows to change selection":"","Use up and down arrows to move selection":"","Use up and down arrows to move lower selection":"","Use up and down arrows to move upper selection":"","From %1 to %2":"","From %1":"","To %1":"","No parser available for file: %1":"","Error parsing file: %1":"","Unable to load file: %1":"","Invalid date":"",Close:"",Minimize:""};class Jt extends te{_setDefaults(){this.setPrivate("defaultLocale",nt),super._setDefaults()}translate(e,t,...i){t||(t=this._root.locale||this.getPrivate("defaultLocale"));let r=e,a=t[e];if(a===null)r="";else if(a!=null)a&&(r=a);else if(t!==this.getPrivate("defaultLocale"))return this.translate(e,this.getPrivate("defaultLocale"),...i);if(i.length)for(let s=i.length,n=0;n{this.setTranslationAny(i,r,t)})}translateEmpty(e,t,...i){let r=this.translate(e,t,...i);return r==e?"":r}translateFunc(e,t){return this._root.locale[e]?this._root.locale[e]:t!==this.getPrivate("defaultLocale")?this.translateFunc(e,this.getPrivate("defaultLocale")):()=>""}translateAll(e,t){return this.isDefault()?e:Bt(e,i=>this.translate(i,t))}isDefault(){return this.getPrivate("defaultLocale")===this._root.locale}}class Me{constructor(e=1,t=0,i=0,r=1,a=0,s=0){Object.defineProperty(this,"a",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"b",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"c",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"d",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tx",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ty",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.a=e,this.b=t,this.c=i,this.d=r,this.tx=a,this.ty=s}setTransform(e,t,i,r,a,s=1){this.a=Math.cos(a)*s,this.b=Math.sin(a)*s,this.c=-Math.sin(a)*s,this.d=Math.cos(a)*s,this.tx=e-(i*this.a+r*this.c),this.ty=t-(i*this.b+r*this.d)}apply(e){return{x:this.a*e.x+this.c*e.y+this.tx,y:this.b*e.x+this.d*e.y+this.ty}}applyInverse(e){const t=1/(this.a*this.d+this.c*-this.b);return{x:this.d*t*e.x+-this.c*t*e.y+(this.ty*this.c-this.tx*this.d)*t,y:this.a*t*e.y+-this.b*t*e.x+(-this.ty*this.a+this.tx*this.b)*t}}append(e){const t=this.a,i=this.b,r=this.c,a=this.d;this.a=e.a*t+e.b*r,this.b=e.a*i+e.b*a,this.c=e.c*t+e.d*r,this.d=e.c*i+e.d*a,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*a+this.ty}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty}copyFrom(e){this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty}}var Kt=function(){function b(e,t){var i=[],r=!0,a=!1,s=void 0;try{for(var n,l=e[Symbol.iterator]();!(r=(n=l.next()).done)&&(i.push(n.value),!t||i.length!==t);r=!0);}catch(d){a=!0,s=d}finally{try{!r&&l.return&&l.return()}finally{if(a)throw s}}return i}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return b(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),he=2*Math.PI,Se=function(b,e,t,i,r,a,s){var n=b.x,l=b.y;return{x:i*(n*=e)-r*(l*=t)+a,y:r*n+i*l+s}},Qt=function(b,e){var t=e===1.5707963267948966?.551915024494:e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),i=Math.cos(b),r=Math.sin(b),a=Math.cos(b+e),s=Math.sin(b+e);return[{x:i-r*t,y:r+i*t},{x:a+s*t,y:s-a*t},{x:a,y:s}]},qe=function(b,e,t,i){var r=b*t+e*i;return r>1&&(r=1),r<-1&&(r=-1),(b*i-e*t<0?-1:1)*Math.acos(r)},ei=function(b,e,t,i,r,a,s,n,l,d,m,c){var f=Math.pow(r,2),o=Math.pow(a,2),p=Math.pow(m,2),h=Math.pow(c,2),u=f*o-f*h-o*p;u<0&&(u=0),u/=f*h+o*p;var g=(u=Math.sqrt(u)*(s===n?-1:1))*r/a*c,w=u*-a/r*m,v=d*g-l*w+(b+t)/2,_=l*g+d*w+(e+i)/2,x=(m-g)/r,E=(c-w)/a,k=(-m-g)/r,M=(-c-w)/a,j=qe(1,0,x,E),O=qe(x,E,k,M);return n===0&&O>0&&(O-=he),n===1&&O<0&&(O+=he),[v,_,j,O]},ti=function(b){var e=b.px,t=b.py,i=b.cx,r=b.cy,a=b.rx,s=b.ry,n=b.xAxisRotation,l=n===void 0?0:n,d=b.largeArcFlag,m=d===void 0?0:d,c=b.sweepFlag,f=c===void 0?0:c,o=[];if(a===0||s===0)return[];var p=Math.sin(l*he/360),h=Math.cos(l*he/360),u=h*(e-i)/2+p*(t-r)/2,g=-p*(e-i)/2+h*(t-r)/2;if(u===0&&g===0)return[];a=Math.abs(a),s=Math.abs(s);var w=Math.pow(u,2)/Math.pow(a,2)+Math.pow(g,2)/Math.pow(s,2);w>1&&(a*=Math.sqrt(w),s*=Math.sqrt(w));var v=ei(e,t,i,r,a,s,m,f,p,h,u,g),_=Kt(v,4),x=_[0],E=_[1],k=_[2],M=_[3],j=Math.abs(M)/(he/4);Math.abs(1-j)<1e-7&&(j=1);var O=Math.max(Math.ceil(j),1);M/=O;for(var I=0;I1){const r=/^([01])([01])(.*)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b.splice(t,0,r[2]),++t,r[3].length>0?b[t]=r[3]:b.splice(t,1))}if(++t,i=b[t],i.length>1){const r=/^([01])(.+)$/.exec(i);r!==null&&(b.splice(t,0,r[1]),++t,b[t]=r[2])}}}function Ze(b){if(b===0||b===1)return b;throw new Error("Flag must be 0 or 1")}function si(b){const e=[0,0,0];for(let t=0;t<24;t++)e[t%3]<<=1,e[t%3]|=1&b,b>>=1;return(0|e[0])+(e[1]<<8)+(e[2]<<16)}function me(b,e){for(;(!b.interactive||e(b))&&b._parent;)b=b._parent}function ai(b,e,t){return C(b,Be(e),i=>{const r=st(i);let a=i.touches;a?(a.length==0&&(a=i.changedTouches),t(zt(a),r)):t([i],r)})}function Je(b){const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});t.drawImage(b,0,0,1,1);try{return t.getImageData(0,0,1,1),!1}catch{return console.warn('Image "'+b.src+'" is loaded from different host and is not covered by CORS policy. For more information about the implications read here: https://www.amcharts.com/docs/v5/concepts/cors'),!0}}function oe(b){b.width=0,b.height=0,b.style.width="0px",b.style.height="0px"}function Ke(b){return Math.floor(b)+.5}class ni{constructor(){Object.defineProperty(this,"_x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_y",{enumerable:!0,configurable:!0,writable:!0,value:0})}get x(){return this._x}get y(){return this._y}set x(e){this._x=e}set y(e){this._y=e}}class Pe extends Ht{constructor(e){super(),Object.defineProperty(this,"_layer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"interactive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactive",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"wheelable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cancelTouch",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isMeasured",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"buttonMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"alpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"compoundAlpha",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"angle",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"crisp",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"pivot",{enumerable:!0,configurable:!0,writable:!0,value:new ni}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cursorOverStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_replacedCursorStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_matrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_uMatrix",{enumerable:!0,configurable:!0,writable:!0,value:new Me}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_localBounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_bounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._renderer=e}subStatus(e){return{inactive:this.inactive==null?e.inactive:this.inactive,layer:this._layer||e.layer}}_dispose(){this._renderer._removeObject(this),this.getLayer().dirty=!0}getCanvas(){return this.getLayer().view}getLayer(){let e=this;for(;;){if(e._layer)return e._layer;if(!e._parent)return this._renderer.defaultLayer;e=e._parent}}setLayer(e,t){e==null?this._layer=void 0:(this._layer=this._renderer.getLayer(e,!0),this._layer.visible=!0,this._layer.margin=t,t&&K(this._layer.view,!1),this._renderer._ghostLayer.setMargin(this._renderer.layers),this._parent&&this._parent.registerChildLayer(this._layer),this._layer.dirty=!0,this._renderer.resizeLayer(this._layer),this._renderer.resizeGhost())}markDirtyLayer(){this.getLayer().dirty=!0}clear(){this.invalidateBounds()}invalidateBounds(){this._localBounds=void 0}_addBounds(e){}_getColorId(){return this._colorId===void 0&&(this._colorId=this._renderer.paintId(this)),this._colorId}_isInteractive(e){return!e.inactive&&(this.interactive||this._renderer._forceInteractive>0)}_isInteractiveMask(e){return this._isInteractive(e)}contains(e){for(;;){if(e===this)return!0;if(!e._parent)return!1;e=e._parent}}toGlobal(e){return this._matrix.apply(e)}toLocal(e){return this._matrix.applyInverse(e)}getLocalMatrix(){return this._uMatrix.setTransform(0,0,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._uMatrix}getLocalBounds(){return this._localBounds||(this._localBounds={left:1e7,top:1e7,right:-1e7,bottom:-1e7},this._addBounds(this._localBounds)),this._localBounds}getAdjustedBounds(e){this._setMatrix();const t=this.getLocalMatrix(),i=t.apply({x:e.left,y:e.top}),r=t.apply({x:e.right,y:e.top}),a=t.apply({x:e.right,y:e.bottom}),s=t.apply({x:e.left,y:e.bottom});return{left:Math.min(i.x,r.x,a.x,s.x),top:Math.min(i.y,r.y,a.y,s.y),right:Math.max(i.x,r.x,a.x,s.x),bottom:Math.max(i.y,r.y,a.y,s.y)}}on(e,t,i){return this.interactive?this._renderer._addEvent(this,e,t,i):new X(()=>{})}_setMatrix(){this._localMatrix.setTransform(this.x,this.y,this.pivot.x,this.pivot.y,this.angle*Math.PI/180,this.scale),this._matrix.copyFrom(this._localMatrix),this._parent&&this._matrix.prepend(this._parent._matrix)}_transform(e,t){const i=this._matrix;let r=i.tx*t,a=i.ty*t;this.crisp&&(r=Ke(r),a=Ke(a)),e.setTransform(i.a*t,i.b*t,i.c*t,i.d*t,r,a)}_transformMargin(e,t,i){const r=this._matrix;e.setTransform(r.a*t,r.b*t,r.c*t,r.d*t,(r.tx+i.left)*t,(r.ty+i.top)*t)}_transformLayer(e,t,i){i.margin?this._transformMargin(e,i.scale||t,i.margin):this._transform(e,i.scale||t)}render(e){if(this.visible&&(this.exportable!==!1||!this._renderer._omitTainted)){this._setMatrix();const t=this.subStatus(e),i=this._renderer.resolution,r=this._renderer.layers,a=this._renderer._ghostLayer,s=a.context,n=this.mask;n&&n._setMatrix(),y(r,l=>{if(l){const d=l.context;d.save(),n&&(n._transformLayer(d,i,l),n._runPath(d),d.clip()),d.globalAlpha=this.compoundAlpha*this.alpha,this._transformLayer(d,i,l),this.filter&&(d.filter=this.filter)}}),s.save(),n&&this._isInteractiveMask(t)&&(n._transformMargin(s,i,a.margin),n._runPath(s),s.clip()),this._transformMargin(s,i,a.margin),this._render(t),s.restore(),y(r,l=>{l&&l.context.restore()})}}_render(e){this.exportable===!1&&(e.layer.tainted=!0)}hovering(){return this._renderer._hovering.has(this)}dragging(){return this._renderer._dragging.some(e=>e.value===this)}shouldCancelTouch(){const e=this._renderer;return!(e.tapToActivate&&!e._touchActive)&&(!!this.cancelTouch||!!this._parent&&this._parent.shouldCancelTouch())}}class oi extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"interactiveChildren",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_childLayers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_children",{enumerable:!0,configurable:!0,writable:!0,value:[]})}_isInteractiveMask(e){return this.interactiveChildren||super._isInteractiveMask(e)}addChild(e){e._parent=this,this._children.push(e),e._layer&&this.registerChildLayer(e._layer)}addChildAt(e,t){e._parent=this,this._children.splice(t,0,e),e._layer&&this.registerChildLayer(e._layer)}removeChild(e){e._parent=void 0,Ae(this._children,e)}_render(e){super._render(e);const t=this._renderer;this.interactive&&this.interactiveChildren&&++t._forceInteractive,y(this._children,i=>{i.compoundAlpha=this.compoundAlpha*this.alpha,i.render(e)}),this.interactive&&this.interactiveChildren&&--t._forceInteractive}registerChildLayer(e){this._childLayers||(this._childLayers=[]),De(this._childLayers,e),this._parent&&this._parent.registerChildLayer(e)}markDirtyLayer(e=!1){super.markDirtyLayer(),e&&this._childLayers&&y(this._childLayers,t=>t.dirty=!0)}_dispose(){super._dispose(),this._childLayers&&y(this._childLayers,e=>{e.dirty=!0})}}function T(b,e){b.left=Math.min(b.left,e.x),b.top=Math.min(b.top,e.y),b.right=Math.max(b.right,e.x),b.bottom=Math.max(b.bottom,e.y)}class D{colorize(e,t){}colorizeGhost(e,t){this.colorize(e,t)}path(e){}pathGhost(e){this.path(e)}addBounds(e){}}class li extends D{colorize(e,t){e.beginPath()}}class Te extends D{constructor(e){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fillStyle=t!==void 0?t:this.color}}class hi extends D{constructor(e){super(),Object.defineProperty(this,"clearShadow",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.fill(),this.clearShadow&&(e.shadowColor="",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0)}}class ui extends D{colorize(e,t){e.stroke()}}class je extends D{constructor(e,t,i){super(),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"lineJoin",{enumerable:!0,configurable:!0,writable:!0,value:i})}colorize(e,t){e.strokeStyle=t!==void 0?t:this.color,e.lineWidth=this.width,this.lineJoin&&(e.lineJoin=this.lineJoin)}}class ci extends D{constructor(e){super(),Object.defineProperty(this,"dash",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.setLineDash(this.dash)}}class di extends D{constructor(e){super(),Object.defineProperty(this,"dashOffset",{enumerable:!0,configurable:!0,writable:!0,value:e})}colorize(e,t){e.lineDashOffset=this.dashOffset}}class bi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.rect(this.x,this.y,this.width,this.height)}addBounds(e){const t=this.x,i=this.y,r=t+this.width,a=i+this.height;T(e,{x:t,y:i}),T(e,{x:r,y:i}),T(e,{x:t,y:a}),T(e,{x:r,y:a})}}class fi extends D{constructor(e,t,i){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i})}path(e){e.moveTo(this.x+this.radius,this.y),e.arc(this.x,this.y,this.radius,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radius,y:this.y-this.radius}),T(e,{x:this.x+this.radius,y:this.y+this.radius})}}class _i extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radiusX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"radiusY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.ellipse(0,0,this.radiusX,this.radiusY,0,0,2*Math.PI)}addBounds(e){T(e,{x:this.x-this.radiusX,y:this.y-this.radiusY}),T(e,{x:this.x+this.radiusX,y:this.y+this.radiusY})}}class mi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cx",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"endAngle",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"anticlockwise",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){this.radius>0&&e.arc(this.cx,this.cy,this.radius,this.startAngle,this.endAngle,this.anticlockwise)}addBounds(e){let t=Vt(this.cx,this.cy,this.startAngle*le,this.endAngle*le,this.radius);T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}class pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"x1",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y1",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"x2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"y2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){this.radius>0&&e.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)}addBounds(e){}}class gi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.lineTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class yi extends D{constructor(e,t){super(),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:t})}path(e){e.moveTo(this.x,this.y)}addBounds(e){T(e,{x:this.x,y:this.y})}}class vi extends D{path(e){e.closePath()}}class wi extends D{constructor(e,t,i,r,a,s){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"cpX2",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"cpY2",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:s})}path(e){e.bezierCurveTo(this.cpX,this.cpY,this.cpX2,this.cpY2,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.cpX2,y:this.cpY2}),T(e,{x:this.toX,y:this.toY})}}class xi extends D{constructor(e,t,i,r){super(),Object.defineProperty(this,"cpX",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"cpY",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"toX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"toY",{enumerable:!0,configurable:!0,writable:!0,value:r})}path(e){e.quadraticCurveTo(this.cpX,this.cpY,this.toX,this.toY)}addBounds(e){T(e,{x:this.cpX,y:this.cpY}),T(e,{x:this.toX,y:this.toY})}}class Pi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"blur",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"offsetX",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"offsetY",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"opacity",{enumerable:!0,configurable:!0,writable:!0,value:a})}colorize(e,t){this.opacity&&(e.fillStyle=this.color),e.shadowColor=this.color,e.shadowBlur=this.blur,e.shadowOffsetX=this.offsetX,e.shadowOffsetY=this.offsetY}colorizeGhost(e,t){}}class Oi extends D{constructor(e,t,i,r,a){super(),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,writable:!0,value:a})}path(e){e.drawImage(this.image,this.x,this.y,this.width,this.height)}addBounds(e){T(e,{x:this.x,y:this.y}),T(e,{x:this.width,y:this.height})}}class ki extends Pe{constructor(){super(...arguments),Object.defineProperty(this,"_operations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"blendMode",{enumerable:!0,configurable:!0,writable:!0,value:It.NORMAL}),Object.defineProperty(this,"_hasShadows",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_fillAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_strokeAlpha",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clear(){super.clear(),this._operations.length=0}_pushOp(e){this._operations.push(e)}beginFill(e,t=1){this._fillAlpha=t,e?e instanceof $?this._pushOp(new Te(e.toCSS(t))):(this.isMeasured=!0,this._pushOp(new Te(e))):this._pushOp(new Te("rgba(0, 0, 0, "+t+")"))}endFill(){this._pushOp(new hi(this._hasShadows))}endStroke(){this._pushOp(new ui)}beginPath(){this._pushOp(new li)}lineStyle(e=0,t,i=1,r){this._strokeAlpha=i,t?t instanceof $?this._pushOp(new je(e,t.toCSS(i),r)):this._pushOp(new je(e,t,r)):this._pushOp(new je(e,"rgba(0, 0, 0, "+i+")",r))}setLineDash(e){this._pushOp(new ci(e||[]))}setLineDashOffset(e=0){this._pushOp(new di(e))}drawRect(e,t,i,r){this._pushOp(new bi(e,t,i,r))}drawCircle(e,t,i){this._pushOp(new fi(e,t,i))}drawEllipse(e,t,i,r){this._pushOp(new _i(e,t,i,r))}arc(e,t,i,r,a,s=!1){this._pushOp(new mi(e,t,i,r,a,s))}arcTo(e,t,i,r,a){this._pushOp(new pi(e,t,i,r,a))}lineTo(e,t){this._pushOp(new gi(e,t))}moveTo(e,t){this._pushOp(new yi(e,t))}bezierCurveTo(e,t,i,r,a,s){this._pushOp(new wi(e,t,i,r,a,s))}quadraticCurveTo(e,t,i,r){this._pushOp(new xi(e,t,i,r))}closePath(){this._pushOp(new vi)}shadow(e,t=0,i=0,r=0,a){this._hasShadows=!0,this._pushOp(new Pi(a?e.toCSS(a):e.toCSS(this._fillAlpha||this._strokeAlpha),t,i,r))}image(e,t,i,r,a){this._pushOp(new Oi(e,t,i,r,a))}svgPath(e){let t=0,i=0,r=null,a=null,s=null,n=null;const l=/([MmZzLlHhVvCcSsQqTtAa])([^MmZzLlHhVvCcSsQqTtAa]*)/g,d=/[\u0009\u0020\u000A\u000C\u000D]*([\+\-]?[0-9]*\.?[0-9]+(?:[eE][\+\-]?[0-9]+)?)[\u0009\u0020\u000A\u000C\u000D]*,?/g;let m;for(;(m=l.exec(e))!==null;){const c=m[1],f=m[2],o=[];for(;(m=d.exec(f))!==null;)o.push(m[1]);switch(c!=="S"&&c!=="s"&&c!=="C"&&c!=="c"&&(r=null,a=null),c!=="Q"&&c!=="q"&&c!=="T"&&c!=="t"&&(s=null,n=null),c){case"M":z(c,o.length,2),t=+o[0],i=+o[1],this.moveTo(t,i);for(let h=2;h{this.bezierCurveTo(v.x1,v.y1,v.x2,v.y2,v.x,v.y),t=v.x,i=v.y})}break;case"Z":case"z":ii(c,o.length,0),this.closePath()}}}_runPath(e){e.beginPath(),y(this._operations,t=>{t.path(e)})}_render(e){super._render(e);const t=e.layer.dirty,i=this._isInteractive(e);if(t||i){const r=e.layer.context,a=this._renderer._ghostLayer.context;let s;t&&(r.globalCompositeOperation=this.blendMode,r.beginPath()),i&&(a.beginPath(),s=this._getColorId()),y(this._operations,n=>{t&&(n.path(r),n.colorize(r,void 0)),i&&(n.pathGhost(a),n.colorizeGhost(a,s))})}}renderDetached(e){if(this.visible){this._setMatrix(),e.save();const t=this.mask;t&&(t._setMatrix(),t._transform(e,1),t._runPath(e),e.clip()),e.globalAlpha=this.compoundAlpha*this.alpha,this._transform(e,1),this.filter&&(e.filter=this.filter),e.globalCompositeOperation=this.blendMode,e.beginPath(),y(this._operations,i=>{i.path(e),i.colorize(e,void 0)}),e.restore()}}_addBounds(e){this.visible&&this.isMeasured&&y(this._operations,t=>{t.addBounds(e)})}}class ot extends Pe{constructor(e,t,i){super(e),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"textVisible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_textInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScale",{enumerable:!0,configurable:!0,writable:!0,value:1}),this.text=t,this.style=i}invalidateBounds(){super.invalidateBounds(),this._textInfo=void 0}_shared(e){this.style.textAlign&&(e.textAlign=this.style.textAlign),this.style.direction&&(e.direction=this.style.direction),this.style.textBaseline&&(e.textBaseline=this.style.textBaseline)}_prerender(e,t=!1,i=!1){super._render(e);const r=e.layer.context,a=this._renderer._ghostLayer.context,s=this.style;let n=this._getFontStyle(void 0,i);r.font=n,this._isInteractive(e)&&!t&&(a.font=n),s.fill&&(s.fill instanceof $?r.fillStyle=s.fill.toCSS(s.fillOpacity!=null?s.fillOpacity:1):r.fillStyle=s.fill),s.shadowColor&&(e.layer.context.shadowColor=s.shadowColor.toCSS(s.shadowOpacity||1)),s.shadowBlur&&(e.layer.context.shadowBlur=s.shadowBlur),s.shadowOffsetX&&(e.layer.context.shadowOffsetX=s.shadowOffsetX),s.shadowOffsetY&&(e.layer.context.shadowOffsetY=s.shadowOffsetY),this._shared(r),this._isInteractive(e)&&!t&&(a.fillStyle=this._getColorId(),this._shared(a))}_getFontStyle(e,t=!1){const i=this.style;let r=[];return e&&e.fontVariant?r.push(e.fontVariant):i.fontVariant&&r.push(i.fontVariant),t||(e&&e.fontWeight?r.push(e.fontWeight):i.fontWeight&&r.push(i.fontWeight)),e&&e.fontStyle?r.push(e.fontStyle):i.fontStyle&&r.push(i.fontStyle),e&&e.fontSize?(H(e.fontSize)&&(e.fontSize=e.fontSize+"px"),r.push(e.fontSize)):i.fontSize&&(H(i.fontSize)&&(i.fontSize=i.fontSize+"px"),r.push(i.fontSize)),e&&e.fontFamily?r.push(e.fontFamily):i.fontFamily?r.push(i.fontFamily):r.length&&r.push("Arial"),r.join(" ")}_render(e){if(this._textInfo||this._measure(e),this.textVisible){const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),a.save(),this._prerender(e),y(this._textInfo,(s,n)=>{y(s.textChunks,(l,d)=>{if(l.style&&(i.save(),a.save(),i.font=l.style,this._isInteractive(e)&&(a.font=l.style)),l.fill&&(i.save(),i.fillStyle=l.fill.toCSS()),r&&i.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.textDecoration=="underline"||l.textDecoration=="line-through"){let m=1,c=1,f=l.height;const o=this.style.oversizedBehavior||"";if(["truncate","wrap","wrap-no-break"].indexOf(o)>-1){const u=this._measureText(l.text,i);l.width=u.actualBoundingBoxLeft+u.actualBoundingBoxRight}let p,h=l.offsetX;switch(this.style.textAlign){case"right":case"end":h-=l.width;break;case"center":h-=l.width/2}if(l.style)switch(W.getTextStyle(l.style).fontWeight){case"bolder":case"bold":case"700":case"800":case"900":m=2}f&&(c=f/20),p=l.textDecoration=="line-through"?m+s.offsetY+l.offsetY-l.height/2:m+1.5*c+s.offsetY+l.offsetY,i.save(),i.beginPath(),l.fill?i.strokeStyle=l.fill.toCSS():this.style.fill&&this.style.fill instanceof $&&(i.strokeStyle=this.style.fill.toCSS()),i.lineWidth=m*c,i.moveTo(h,p),i.lineTo(h+l.width,p),i.stroke(),i.restore()}t&&this.interactive&&a.fillText(l.text,l.offsetX,s.offsetY+l.offsetY),l.fill&&i.restore(),l.style&&(i.restore(),a.restore())})}),i.restore(),a.restore()}}_addBounds(e){if(this.visible&&this.isMeasured){const t=this._measure({inactive:this.inactive,layer:this.getLayer()});T(e,{x:t.left,y:t.top}),T(e,{x:t.right,y:t.bottom})}}_ignoreFontWeight(){return/apple/i.test(navigator.vendor)}_measure(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl";this._textInfo=[];const a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=H(s)&&(a=="wrap"||a=="wrap-no-break");t.save(),i.save(),this._prerender(e,!0,this._ignoreFontWeight());const d="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",m=this.text.toString().replace(/\r/g,"").split(/\n/);let c,f=!0,o=0,p=0,h=0;y(m,(g,w)=>{let v;for(v=g==""?[{type:"value",text:""}]:W.chunk(g,!1,this.style.ignoreFormatting);v.length>0;){let _={offsetY:h,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};const x=this._measureText(d,t),E=x.actualBoundingBoxAscent+x.actualBoundingBoxDescent;let k;_.height=E,_.ascent=x.actualBoundingBoxAscent;let M,j,O,I=this.style.textDecoration,L=!1,Y=!0,N=[];Ce(v,(A,ce)=>{if(A.type=="format")if(A.text=="[/]")f||(t.restore(),i.restore(),f=!0),M=void 0,c=void 0,j=void 0,I=this.style.textDecoration,O=void 0,k=A.text;else{f||(t.restore(),i.restore());let S=W.getTextStyle(A.text);const R=this._getFontStyle(S);t.save(),i.save(),t.font=R,c=R,k=A.text,S.textDecoration&&(I=S.textDecoration),S.fill&&(M=S.fill),S.width&&(j=V(S.width)),S.verticalAlign&&(O=S.verticalAlign),f=!1;const F=this._measureText(d,t),q=F.actualBoundingBoxAscent+F.actualBoundingBoxDescent;q>_.height&&(_.height=q),F.actualBoundingBoxAscent>_.ascent&&(_.ascent=F.actualBoundingBoxAscent)}else if(A.type=="value"&&!L){const S=this._measureText(A.text,t);let R=S.actualBoundingBoxLeft+S.actualBoundingBoxRight;if(n){let U=Y||this.style.breakWords||!1;const G=this.style.ellipsis||"",Re=this._measureText(G,t),lt=Re.actualBoundingBoxLeft+Re.actualBoundingBoxRight;if(_.width+R>s){const ht=s-_.width-lt;A.text=this._truncateText(t,A.text,ht,U),A.text+=G,L=!0}}else if(l&&_.width+R>s){const U=s-_.width,G=this._truncateText(t,A.text,U,!1,Y&&this.style.oversizedBehavior!="wrap-no-break");if(G=="")return this.textVisible=!0,!1;N=v.slice(ce+1),ke(G)!=ke(A.text)&&(N.unshift({type:"value",text:A.text.substr(G.length)}),k&&N.unshift({type:"format",text:k})),A.text=ke(G),v=[],L=!0}let F=1,q=1;if(c&&j&&j>R){const U=R/j;switch(this.style.textAlign){case"right":case"end":F=U;break;case"center":F=U,q=U;break;default:q=U}R=j}const Oe=S.actualBoundingBoxAscent+S.actualBoundingBoxDescent;Oe>_.height&&(_.height=Oe),S.actualBoundingBoxAscent>_.ascent&&(_.ascent=S.actualBoundingBoxAscent),_.width+=R,_.left+=S.actualBoundingBoxLeft/F,_.right+=S.actualBoundingBoxRight/q,_.textChunks.push({style:c,fill:M,text:A.text,width:R,height:Oe,left:S.actualBoundingBoxLeft,right:S.actualBoundingBoxRight,ascent:S.actualBoundingBoxAscent,offsetX:0,offsetY:0,textDecoration:I,verticalAlign:O}),Y=!1}return!0}),this.style.lineHeight instanceof ve?(_.height*=this.style.lineHeight.value,_.ascent*=this.style.lineHeight.value):(_.height*=this.style.lineHeight||1.2,_.ascent*=this.style.lineHeight||1.2),o<_.left&&(o=_.left),p<_.right&&(p=_.right),this._textInfo.push(_),h+=_.height,v=N||[]}}),f||(t.restore(),i.restore()),y(this._textInfo,(g,w)=>{let v=0;y(g.textChunks,_=>{if(_.offsetX=v+_.left-g.left,_.offsetY+=g.height-g.height*(this.style.baselineRatio||.19),v+=_.width,_.verticalAlign)switch(_.verticalAlign){case"super":_.offsetY-=g.height/2-_.height/2;break;case"sub":_.offsetY+=_.height/2}})});const u={left:r?-p:-o,top:0,right:r?o:p,bottom:h};if(a!=="none"){const g=this._fitRatio(u);if(g<1)if(a=="fit")H(this.style.minScale)&&gi&&t!="");return t}_measureText(e,t){let i=t.measureText(e),r={};if(i.actualBoundingBoxAscent==null){const s=document.createElement("div");s.innerText=e,s.style.visibility="hidden",s.style.position="absolute",s.style.top="-1000000px;",s.style.fontFamily=this.style.fontFamily||"",s.style.fontSize=this.style.fontSize+"",document.body.appendChild(s);const n=s.getBoundingClientRect();document.body.removeChild(s);const l=n.height,d=i.width;r={actualBoundingBoxAscent:l,actualBoundingBoxDescent:0,actualBoundingBoxLeft:0,actualBoundingBoxRight:d,fontBoundingBoxAscent:l,fontBoundingBoxDescent:0,width:d}}else r={actualBoundingBoxAscent:i.actualBoundingBoxAscent,actualBoundingBoxDescent:i.actualBoundingBoxDescent,actualBoundingBoxLeft:i.actualBoundingBoxLeft,actualBoundingBoxRight:i.actualBoundingBoxRight,fontBoundingBoxAscent:i.actualBoundingBoxAscent,fontBoundingBoxDescent:i.actualBoundingBoxDescent,width:i.width};const a=i.width;switch(this.style.textAlign){case"right":case"end":r.actualBoundingBoxLeft=a,r.actualBoundingBoxRight=0;break;case"center":r.actualBoundingBoxLeft=a/2,r.actualBoundingBoxRight=a/2;break;default:r.actualBoundingBoxLeft=0,r.actualBoundingBoxRight=a}return r}}class Ei{constructor(){Object.defineProperty(this,"fill",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fillOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textAlign",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontFamily",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontWeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fontVariant",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textDecoration",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lineHeight",{enumerable:!0,configurable:!0,writable:!0,value:tt(120)}),Object.defineProperty(this,"baselineRatio",{enumerable:!0,configurable:!0,writable:!0,value:.19}),Object.defineProperty(this,"direction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"textBaseline",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oversizedBehavior",{enumerable:!0,configurable:!0,writable:!0,value:"none"}),Object.defineProperty(this,"breakWords",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ellipsis",{enumerable:!0,configurable:!0,writable:!0,value:"…"}),Object.defineProperty(this,"maxWidth",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minScale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ignoreFormatting",{enumerable:!0,configurable:!0,writable:!0,value:!1})}}class Mi extends ot{constructor(){super(...arguments),Object.defineProperty(this,"textType",{enumerable:!0,configurable:!0,writable:!0,value:"circular"}),Object.defineProperty(this,"radius",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startAngle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inside",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"orientation",{enumerable:!0,configurable:!0,writable:!0,value:"auto"}),Object.defineProperty(this,"kerning",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_textReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_render(e){this.textType==="circular"?this._renderCircular(e):super._render(e)}_renderCircular(e){if(this.textVisible){this._prerender(e);const t=this._isInteractive(e),i=e.layer.context,r=e.layer.dirty,a=this._renderer._ghostLayer.context;i.save(),t&&a.save(),this._textInfo||this._measure(e);let s=this.radius||0,n=this.startAngle||0,l=0,d=this.orientation,m=d=="auto"?"auto":d=="inward";const c=this.inside,f=this.style.textAlign||"left",o=this.kerning||0;let p=f=="left"?1:-1;const h=!this._textReversed;if(m=="auto"){let u=0,g=0;y(this._textInfo,(w,v)=>{const _=n+w.width/(s-w.height)/2*-p;_>u&&(u=_)}),g=f=="left"?(u+l/2)*le:f=="right"?(u-l/2)*le:n*le,g=Rt(g),m=g>=270||g<=90}m==1&&h&&(this._textInfo.reverse(),this._textReversed=!0),y(this._textInfo,(u,g)=>{const w=u.height;c||(s+=w),(p==-1&&m||p==1&&!m)&&h&&u.textChunks.reverse();let v=n;l=0,f=="center"&&(v+=u.width/(s-w)/2*-p,l=v-n),v+=Math.PI*(m?0:1),i.save(),t&&a.save(),i.rotate(v),t&&a.rotate(v);let _=0;y(u.textChunks,(x,E)=>{const k=x.text,M=x.width;_=M/2/(s-w)*p,i.rotate(_),t&&a.rotate(_),x.style&&(i.save(),a.save(),i.font=x.style,t&&(a.font=x.style)),x.fill&&(i.save(),i.fillStyle=x.fill.toCSS()),i.textBaseline="middle",i.textAlign="center",t&&(a.textBaseline="middle",a.textAlign="center"),r&&i.fillText(k,0,(m?1:-1)*(0-s+w/2)),t&&a.fillText(k,0,(m?1:-1)*(0-s+w/2)),x.fill&&i.restore(),x.style&&(i.restore(),a.restore()),_=(M/2+o)/(s-w)*p,i.rotate(_),t&&a.rotate(_)}),i.restore(),t&&a.restore(),c&&(s-=w)}),i.restore(),t&&a.restore()}}_measure(e){return this.textType==="circular"?this._measureCircular(e):super._measure(e)}_measureCircular(e){const t=e.layer.context,i=this._renderer._ghostLayer.context,r=this.style.direction=="rtl",a=this.style.oversizedBehavior,s=this.style.maxWidth,n=H(s)&&a=="truncate",l=this.style.ellipsis||"";let d;this.textVisible=!0,this._textInfo=[],this._textReversed=!1,t.save(),i.save(),this._prerender(e,!0);const m=this.text.toString().replace(/\r/g,"").split(/\n/);let c=!0,f=0,o=0;return y(m,(p,h)=>{let u,g,w,v=W.chunk(p,!1,this.style.ignoreFormatting),_={offsetY:o,ascent:0,width:0,height:0,left:0,right:0,textChunks:[]};y(v,(x,E)=>{if(x.type=="format"){if(x.text=="[/]")c||(t.restore(),i.restore(),c=!0),g=void 0,u=void 0,w=void 0;else{let k=W.getTextStyle(x.text);const M=this._getFontStyle(k);t.save(),i.save(),t.font=M,u=M,k.fill&&(g=k.fill),k.width&&(w=V(k.width)),c=!1}n&&(d=this._measureText(l,t))}else if(x.type=="value"){let k=x.text.match(/./gu)||[];r&&(k=Ft(x.text),k.reverse());for(let M=0;MI&&(I=w);const L=O.actualBoundingBoxAscent+O.actualBoundingBoxDescent;if(L>_.height&&(_.height=L),O.actualBoundingBoxAscent>_.ascent&&(_.ascent=O.actualBoundingBoxAscent),f+=I,n){d||(d=this._measureText(l,t));const Y=d.actualBoundingBoxLeft+d.actualBoundingBoxRight;if(f+Y>s){_.textChunks.length==1?this.textVisible=!1:(_.width+=Y,_.left+=d.actualBoundingBoxLeft,_.right+=d.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:l,width:Y,height:L+d.actualBoundingBoxDescent,left:d.actualBoundingBoxLeft,right:d.actualBoundingBoxRight,ascent:d.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0}));break}}_.width+=I,_.left+=O.actualBoundingBoxLeft,_.right+=O.actualBoundingBoxRight,_.textChunks.push({style:u,fill:g,text:j,width:I,height:L+O.actualBoundingBoxDescent,left:O.actualBoundingBoxLeft,right:O.actualBoundingBoxRight,ascent:O.actualBoundingBoxAscent,offsetX:0,offsetY:L,textDecoration:void 0})}}}),this.style.lineHeight instanceof ve?_.height*=this.style.lineHeight.value:_.height*=this.style.lineHeight||1.2,this._textInfo.push(_),o+=_.height}),c||(t.restore(),i.restore()),a=="hide"&&f>s&&(this.textVisible=!1),y(this._textInfo,p=>{y(p.textChunks,h=>{h.offsetY+=Math.round((p.height-h.height+(p.ascent-h.ascent))/2)})}),t.restore(),i.restore(),{left:0,top:0,right:0,bottom:0}}}class Si extends Pe{constructor(e,t){super(e),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"image",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowColor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowBlur",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOffsetY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shadowOpacity",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_imageMask",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.image=t}_dispose(){super._dispose(),this._imageMask&&oe(this._imageMask)}getLocalBounds(){if(!this._localBounds){let e=0,t=0;this.width&&(e=this.width),this.height&&(t=this.height),this._localBounds={left:0,top:0,right:e,bottom:t},this._addBounds(this._localBounds)}return this._localBounds}_render(e){if(super._render(e),this.image){if(this.tainted===void 0&&(this.tainted=Je(this.image),e.layer.tainted=!0),this.tainted&&this._renderer._omitTainted)return;if(e.layer.dirty){this.shadowColor&&(e.layer.context.shadowColor=this.shadowColor.toCSS(this.shadowOpacity||1)),this.shadowBlur&&(e.layer.context.shadowBlur=this.shadowBlur),this.shadowOffsetX&&(e.layer.context.shadowOffsetX=this.shadowOffsetX),this.shadowOffsetY&&(e.layer.context.shadowOffsetY=this.shadowOffsetY);const t=this.width||this.image.naturalWidth,i=this.height||this.image.naturalHeight;e.layer.context.drawImage(this.image,0,0,t,i)}if(this.interactive&&this._isInteractive(e)){const t=this._getMask(this.image);this._renderer._ghostLayer.context.drawImage(t,0,0)}}}clear(){super.clear(),this.image=void 0,this._imageMask=void 0}_getMask(e){if(this._imageMask===void 0){const t=this.width||e.naturalWidth,i=this.height||e.naturalHeight,r=document.createElement("canvas");r.width=t,r.height=i;const a=r.getContext("2d");a.imageSmoothingEnabled=!1,a.fillStyle=this._getColorId(),a.fillRect(0,0,t,i),Je(e)||(a.globalCompositeOperation="destination-in",a.drawImage(e,0,0,t,i)),this._imageMask=r}return this._imageMask}}class Ti{constructor(e,t,i,r){Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"originalPoint",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"point",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"bbox",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"simulated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"native",{enumerable:!0,configurable:!0,writable:!0,value:!0}),ge("touchevents")&&e instanceof Touch?this.id=e.identifier:this.id=null}}class ji extends At{constructor(e){if(super(),Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"_layerDom",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("div")}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_dirtyLayers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"defaultLayer",{enumerable:!0,configurable:!0,writable:!0,value:this.getLayer(0)}),Object.defineProperty(this,"_ghostLayer",{enumerable:!0,configurable:!0,writable:!0,value:new Di}),Object.defineProperty(this,"_patternCanvas",{enumerable:!0,configurable:!0,writable:!0,value:document.createElement("canvas")}),Object.defineProperty(this,"_patternContext",{enumerable:!0,configurable:!0,writable:!0,value:this._patternCanvas.getContext("2d")}),Object.defineProperty(this,"_realWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_realHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_calculatedHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"resolution",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interactionsEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_listeners",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_events",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_colorId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_colorMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_forceInteractive",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_omitTainted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_hovering",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"_dragging",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_mousedown",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_lastPointerMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tapToActivate",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tapToActivateTimeout",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"_touchActive",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_touchActiveTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.resolution=e??window.devicePixelRatio,this.view.style.position="absolute",this.view.setAttribute("aria-hidden","true"),this.view.appendChild(this._layerDom),this._disposers.push(new X(()=>{ue(this._events,(t,i)=>{i.disposer.dispose()}),y(this.layers,t=>{oe(t.view),t.exportableView&&oe(t.exportableView)}),oe(this._ghostLayer.view),oe(this._patternCanvas)})),this._disposers.push(it(()=>{e==null&&(this.resolution=window.devicePixelRatio)})),ge("touchevents")){const t=i=>{this._dragging.length!==0&&Ce(this._dragging,r=>!r.value.shouldCancelTouch()||(i.preventDefault(),!1)),this._touchActiveTimeout&&this._delayTouchDeactivate()};this._disposers.push(C(window,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchstart",t,{passive:!1})),this._disposers.push(C(this.view,"touchmove",()=>{this._touchActiveTimeout&&this._delayTouchDeactivate()},{passive:!0})),this._disposers.push(C(window,"click",i=>{this._touchActive=!1},{passive:!0})),this._disposers.push(C(this.view,"click",i=>{window.setTimeout(()=>{this._touchActive=!0,this._delayTouchDeactivate()},100)},{passive:!0}))}ge("wheelevents")&&this._disposers.push(C(this.view,"wheel",t=>{let i=!1;this._hovering.forEach(r=>{if(r.wheelable)return i=!0,!1}),i&&t.preventDefault()},{passive:!1}))}resetImageArray(){this._ghostLayer.imageArray=void 0}_delayTouchDeactivate(){this._touchActiveTimeout&&clearTimeout(this._touchActiveTimeout),this.tapToActivateTimeout>0&&(this._touchActiveTimeout=window.setTimeout(()=>{this._touchActive=!1},this.tapToActivateTimeout))}get debugGhostView(){return!!this._ghostLayer.view.parentNode}set debugGhostView(e){e?this._ghostLayer.view.parentNode||this.view.appendChild(this._ghostLayer.view):this._ghostLayer.view.parentNode&&this._ghostLayer.view.parentNode.removeChild(this._ghostLayer.view)}createLinearGradient(e,t,i,r){return this.defaultLayer.context.createLinearGradient(e,t,i,r)}createRadialGradient(e,t,i,r,a,s){return this.defaultLayer.context.createRadialGradient(e,t,i,r,a,s)}createPattern(e,t,i,r,a){return this._patternCanvas.width=r,this._patternCanvas.height=a,this._patternContext.clearRect(0,0,r,a),t.renderDetached(this._patternContext),e.renderDetached(this._patternContext),this._patternContext.createPattern(this._patternCanvas,i)}makeContainer(){return new oi(this)}makeGraphics(){return new ki(this)}makeText(e,t){return new ot(this,e,t)}makeTextStyle(){return new Ei}makeRadialText(e,t){return new Mi(this,e,t)}makePicture(e){return new Si(this,e)}resizeLayer(e){e.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resizeGhost(){this._ghostLayer.resize(this._calculatedWidth,this._calculatedHeight,this._calculatedWidth,this._calculatedHeight,this.resolution)}resize(e,t,i,r){this._realWidth=e,this._realHeight=t,this._calculatedWidth=i,this._calculatedHeight=r,y(this.layers,a=>{a&&(a.dirty=!0,this.resizeLayer(a))}),this.resizeGhost(),this.view.style.width=i+"px",this.view.style.height=r+"px"}createDetachedLayer(e=!1){const t=document.createElement("canvas"),i=t.getContext("2d",{willReadFrequently:e}),r=new Bi(t,i);return t.style.position="absolute",t.style.top="0px",t.style.left="0px",r}getLayerByOrder(e){const t=this.layers,i=t.length;for(let r=0;rl.order>d.order?1:l.order{t&&t.dirty&&t.visible&&(this._dirtyLayers.push(t),t.clear())}),this._ghostLayer.clear(),e.render({inactive:null,layer:this.defaultLayer}),this._ghostLayer.context.restore(),y(this.layers,t=>{if(t){const i=t.context;i.beginPath(),i.moveTo(0,0),i.stroke()}}),y(this._dirtyLayers,t=>{t.context.restore(),t.dirty=!1}),this._hovering.size&&this._lastPointerMoveEvent){const{events:t,target:i,native:r}=this._lastPointerMoveEvent;y(t,a=>{this._dispatchGlobalMousemove(a,i,r)})}}paintId(e){const t=si(++this._colorId),i=$.fromHex(t).toCSS();return this._colorMap[i]=e,i}_removeObject(e){e._colorId!==void 0&&delete this._colorMap[e._colorId]}_adjustBoundingBox(e){const t=this._ghostLayer.margin;return new DOMRect(-t.left,-t.top,e.width+t.left+t.right,e.height+t.top+t.bottom)}getEvent(e,t=!0){const i=this.view.getBoundingClientRect(),r=e.clientX||0,a=e.clientY||0,s=this._calculatedWidth/this._realWidth,n=this._calculatedHeight/this._realHeight,l={x:r-i.left,y:a-i.top},d={x:(r-(t?i.left:0))*s,y:(a-(t?i.top:0))*n};return new Ti(e,l,d,this._adjustBoundingBox(i))}_getHitTarget(e,t,i){if(t.width===0||t.height===0||e.xt.right||e.yt.bottom||!i||!this._layerDom.contains(i))return;const r=this._ghostLayer.getImageData(e,t);if(r.data[0]===0&&r.data[1]===0&&r.data[2]===0)return!1;const a=$.fromRGB(r.data[0],r.data[1],r.data[2]).toCSS();return this._colorMap[a]}getObjectAtPoint(e){const t=this._ghostLayer.getImageArray(e);if(t[0]===0&&t[1]===0&&t[2]===0)return;const i=$.fromRGB(t[0],t[1],t[2]).toCSS();return this._colorMap[i]}_withEvents(e,t){const i=this._events[e];if(i!==void 0){i.dispatching=!0;try{t(i)}finally{i.dispatching=!1,i.cleanup&&(i.cleanup=!1,we(i.callbacks,r=>!r.disposed),i.callbacks.length===0&&(i.disposer.dispose(),delete this._events[e]))}}}_dispatchEventAll(e,t){this.interactionsEnabled&&this._withEvents(e,i=>{y(i.callbacks,r=>{r.disposed||r.callback.call(r.context,t)})})}_dispatchEvent(e,t,i){if(!this.interactionsEnabled)return!1;let r=!1;return this._withEvents(e,a=>{y(a.callbacks,s=>{s.disposed||s.object!==t||(s.callback.call(s.context,i),r=!0)})}),r}_dispatchMousedown(e,t){const i=e.button;if(i!=0&&i!=2&&i!=1&&i!==void 0)return;const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);if(a){const s=r.id;let n=!1;me(a,l=>{const d={id:s,value:l};return this._mousedown.push(d),!n&&this._dispatchEvent("pointerdown",l,r)&&(n=!0,this._dragging.some(m=>m.value===l&&m.id===s)||this._dragging.push(d)),!0})}}_dispatchGlobalMousemove(e,t,i){const r=this.getEvent(e),a=this._getHitTarget(r.originalPoint,r.bbox,t);r.native=i,a?(this._hovering.forEach(s=>{s.contains(a)||(this._hovering.delete(s),s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r))}),r.native&&me(a,s=>(this._hovering.has(s)||(this._hovering.add(s),s.cursorOverStyle&&(s._replacedCursorStyle=Yt(document.body,"cursor"),_e(document.body,"cursor",s.cursorOverStyle)),this._dispatchEvent("pointerover",s,r)),!0))):(this._hovering.forEach(s=>{s.cursorOverStyle&&_e(document.body,"cursor",s._replacedCursorStyle),this._dispatchEvent("pointerout",s,r)}),this._hovering.clear()),this._dispatchEventAll("globalpointermove",r)}removeHovering(e){this._hovering.delete(e),e.cursorOverStyle&&_e(document.body,"cursor",e._replacedCursorStyle)}_dispatchGlobalMouseup(e,t){const i=this.getEvent(e);i.native=t,this._dispatchEventAll("globalpointerup",i)}_dispatchDragMove(e){if(this._dragging.length!==0){const t=this.getEvent(e),i=t.id;this._dragging.forEach(r=>{r.id===i&&this._dispatchEvent("pointermove",r.value,t)})}}_dispatchDragEnd(e,t){const i=e.button;let r;if(i==0||i===void 0)r="click";else if(i==2)r="rightclick";else{if(i!=1)return;r="middleclick"}const a=this.getEvent(e),s=a.id;if(this._mousedown.length!==0){const n=this._getHitTarget(a.originalPoint,a.bbox,t);n&&this._mousedown.forEach(l=>{l.id===s&&l.value.contains(n)&&this._dispatchEvent(r,l.value,a)}),this._mousedown.length=0}this._dragging.length!==0&&(this._dragging.forEach(n=>{n.id===s&&this._dispatchEvent("pointerup",n.value,a)}),this._dragging.length=0)}_dispatchDoubleClick(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("dblclick",a,i))}_dispatchWheel(e,t){const i=this.getEvent(e),r=this._getHitTarget(i.originalPoint,i.bbox,t);r&&me(r,a=>!this._dispatchEvent("wheel",a,i))}_makeSharedEvent(e,t){if(this._listeners[e]===void 0){const i=t();this._listeners[e]=new Lt(()=>{delete this._listeners[e],i.dispose()})}return this._listeners[e].increment()}_onPointerEvent(e,t){let i=!1,r=null;function a(){r=null,i=!1}return new Ge([new X(()=>{r!==null&&clearTimeout(r),a()}),C(this.view,Be(e),s=>{i=!0,r!==null&&clearTimeout(r),r=window.setTimeout(a,0)}),ai(window,e,(s,n)=>{r!==null&&(clearTimeout(r),r=null),t(s,n,i),i=!1})])}_initEvent(e){switch(e){case"globalpointermove":case"pointerover":case"pointerout":return this._makeSharedEvent("pointermove",()=>{const t=(i,r,a)=>{this._lastPointerMoveEvent={events:i,target:r,native:a},y(i,s=>{this._dispatchGlobalMousemove(s,r,a)})};return new Ge([this._onPointerEvent("pointerdown",t),this._onPointerEvent("pointermove",t)])});case"globalpointerup":return this._makeSharedEvent("pointerup",()=>{const t=this._onPointerEvent("pointerup",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}}),i=this._onPointerEvent("pointercancel",(r,a,s)=>{y(r,n=>{this._dispatchGlobalMouseup(n,s)}),this._lastPointerMoveEvent={events:r,target:a,native:s}});return new X(()=>{t.dispose(),i.dispose()})});case"click":case"rightclick":case"middleclick":case"pointerdown":case"pointermove":case"pointerup":return this._makeSharedEvent("pointerdown",()=>{const t=this._onPointerEvent("pointerdown",(s,n)=>{y(s,l=>{this._dispatchMousedown(l,n)})}),i=this._onPointerEvent("pointermove",s=>{y(s,n=>{this._dispatchDragMove(n)})}),r=this._onPointerEvent("pointerup",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})}),a=this._onPointerEvent("pointercancel",(s,n)=>{y(s,l=>{this._dispatchDragEnd(l,n)})});return new X(()=>{t.dispose(),i.dispose(),r.dispose(),a.dispose()})});case"dblclick":return this._makeSharedEvent("dblclick",()=>this._onPointerEvent("dblclick",(t,i)=>{y(t,r=>{this._dispatchDoubleClick(r,i)})}));case"wheel":return this._makeSharedEvent("wheel",()=>C(this.view,Be("wheel"),t=>{this._dispatchWheel(t,st(t))},{passive:!1}))}}_addEvent(e,t,i,r){let a=this._events[t];a===void 0&&(a=this._events[t]={disposer:this._initEvent(t),callbacks:[],dispatching:!1,cleanup:!1});const s={object:e,context:r,callback:i,disposed:!1};return a.callbacks.push(s),new X(()=>{s.disposed=!0,a.dispatching?a.cleanup=!0:(Ae(a.callbacks,s),a.callbacks.length===0&&(a.disposer.dispose(),delete this._events[t]))})}getCanvas(e,t){this.render(e),t||(t={});let i=this.resolution,r=Math.floor(this._calculatedWidth*this.resolution),a=Math.floor(this._calculatedHeight*this.resolution);if(t.minWidth&&t.minWidth>r){let o=t.minWidth/r;o>i&&(i=o*this.resolution)}if(t.minHeight&&t.minHeight>a){let o=t.minHeight/a;o>i&&(i=o*this.resolution)}if(t.maxWidth&&t.maxWidtha){let o=t.maxHeight/a;o{if(o&&o.visible&&(o.tainted||n)){f=!0,o.exportableView=o.view,o.exportableContext=o.context,o.view=document.createElement("canvas"),o.view.style.position="fixed",o.view.style.top="-10000px",this.view.appendChild(o.view),s.push(o.view);let p=0,h=0;o.margin&&(p+=o.margin.left||0+o.margin.right||0,h+=o.margin.top||0+o.margin.bottom||0),o.view.width=r+p,o.view.height=a+h,o.context=o.view.getContext("2d"),o.dirty=!0,o.scale=i}}),f&&(this._omitTainted=!0,this.render(e),this._omitTainted=!1),y(this.layers,o=>{if(o&&o.visible){let p=0,h=0;o.margin&&(p=-(o.margin.left||0)*this.resolution,h=-(o.margin.top||0)*this.resolution),d.drawImage(o.view,p,h),o.exportableView&&(o.view=o.exportableView,o.exportableView=void 0),o.exportableContext&&(o.context=o.exportableContext,o.exportableContext=void 0),m{o.style.position="",o.style.top="",this.view.removeChild(o)}),l}}class Di{constructor(){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:{left:0,right:0,top:0,bottom:0}}),Object.defineProperty(this,"_resolution",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"imageArray",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.view=document.createElement("canvas"),this.context=this.view.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.context.imageSmoothingEnabled=!1,this.view.style.position="absolute",this.view.style.top="0px",this.view.style.left="0px"}resize(e,t,i,r,a){this._resolution=a,e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px",this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}getImageData(e,t){return this.context.getImageData(Math.round((e.x-t.left)/t.width*this._width),Math.round((e.y-t.top)/t.height*this._height),1,1)}getImageArray(e){this.imageArray||(this.imageArray=this.context.getImageData(0,0,this._width,this._height).data);const t=this.imageArray,i=Math.round(e.x*this._resolution),r=4*(Math.round(e.y*this._resolution)*this._width+i);return[t[r],t[r+1],t[r+2],t[r+3]]}setMargin(e){this.margin.left=0,this.margin.right=0,this.margin.top=0,this.margin.bottom=0,y(e,t=>{t.margin&&(this.margin.left=Math.max(this.margin.left,t.margin.left),this.margin.right=Math.max(this.margin.right,t.margin.right),this.margin.top=Math.max(this.margin.top,t.margin.top),this.margin.bottom=Math.max(this.margin.bottom,t.margin.bottom))})}clear(){this.context.save(),this.context.fillStyle="#000",this.context.fillRect(0,0,this._width,this._height)}}class Bi{constructor(e,t){Object.defineProperty(this,"view",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tainted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"margin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"order",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scale",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dirty",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"exportableView",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exportableContext",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_width",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_height",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.view=e,this.context=t}resize(e,t,i,r,a){this.width!=null&&(e=this.width,i=this.width),this.height!=null&&(t=this.height,r=this.height),this.margin?(e+=this.margin.left+this.margin.right,t+=this.margin.top+this.margin.bottom,i+=this.margin.left+this.margin.right,r+=this.margin.top+this.margin.bottom,this.view.style.left=-this.margin.left+"px",this.view.style.top=-this.margin.top+"px"):(this.view.style.left="0px",this.view.style.top="0px"),this._width=Math.floor(e*a),this._height=Math.floor(t*a),this.view.width=this._width,this.view.style.width=i+"px",this.view.height=this._height,this.view.style.height=r+"px"}clear(){this.context.save(),this.context.clearRect(0,0,this._width,this._height)}}function Qe(b,e){b==null?requestAnimationFrame(e):setTimeout(()=>{requestAnimationFrame(e)},1e3/b)}class ze{constructor(e,t={},i){if(Object.defineProperty(this,"dom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_inner",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isDirtyAnimation",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dirty",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyParents",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyBounds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_dirtyPositions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_ticker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tickers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_updateTick",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new dt}),Object.defineProperty(this,"animationTime",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_animations",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_renderer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_rootContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tooltipContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipContainerSettings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltip",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:Jt.new(this,{})}),Object.defineProperty(this,"locale",{enumerable:!0,configurable:!0,writable:!0,value:nt}),Object.defineProperty(this,"utc",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timezone",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fps",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"numberFormatter",{enumerable:!0,configurable:!0,writable:!0,value:$t.new(this,{})}),Object.defineProperty(this,"dateFormatter",{enumerable:!0,configurable:!0,writable:!0,value:qt.new(this,{})}),Object.defineProperty(this,"durationFormatter",{enumerable:!0,configurable:!0,writable:!0,value:Zt.new(this,{})}),Object.defineProperty(this,"tabindex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_tabindexes",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_a11yD",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementDirty",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_focusElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_focusedSprite",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isShift",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardDragPoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_readerAlertElement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_logo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltipDiv",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nonce",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"interfaceColors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"verticalLayout",{enumerable:!0,configurable:!0,writable:!0,value:bt.new(this,{})}),Object.defineProperty(this,"horizontalLayout",{enumerable:!0,configurable:!0,writable:!0,value:ft.new(this,{})}),Object.defineProperty(this,"gridLayout",{enumerable:!0,configurable:!0,writable:!0,value:_t.new(this,{})}),Object.defineProperty(this,"_paused",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"autoResize",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_fontHash",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_isDisposed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_disposers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_resizeSensorDisposer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tooltips",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_htmlElementContainer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_htmlEnabledContainers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),!i)throw new Error("You cannot use `new Class()`, instead use `Class.new()`");let r,a;if(this._settings=t,t.accessible==0&&(this._a11yD=!0),t.useSafeResolution==null&&(t.useSafeResolution=!0),t.useSafeResolution&&(r=mt()),this._renderer=new ji(r),a=e instanceof HTMLElement?e:document.getElementById(e),y(ie.rootElements,l=>{if(l.dom===a)throw new Error("You cannot have multiple Roots on the same DOM node")}),this.interfaceColors=pe.new(this,{}),a===null)throw new Error("Could not find HTML element with id `"+e+"`");this.dom=a;let s=document.createElement("div");s.style.position="relative",s.style.width="100%",s.style.height="100%",a.appendChild(s);const n=t.tooltipContainerBounds;n&&(this._tooltipContainerSettings=n),this._inner=s,this._updateComputedStyles(),ie.rootElements.push(this)}static new(e,t){const i=new ze(e,t,!0);return i._init(),i}moveDOM(e){let t;if(t=e instanceof HTMLElement?e:document.getElementById(e),t){for(;this.dom.childNodes.length>0;)t.appendChild(this.dom.childNodes[0]);this.dom=t,this._initResizeSensor(),this.resize()}}_handleLogo(){if(this._logo){const e=this.dom.offsetWidth,t=this.dom.offsetHeight;e<=150||t<=60?this._logo.hide():this._logo.show()}}_showBranding(){if(!this._logo){const e=this.tooltipContainer.children.push(Z.new(this,{interactive:!0,interactiveChildren:!1,position:"absolute",setStateOnChildren:!0,paddingTop:9,paddingRight:9,paddingBottom:9,paddingLeft:9,scale:.6,y:tt(100),centerY:J,tooltipText:"Created using amCharts 5",tooltipX:J,cursorOverStyle:"pointer",background:pt.new(this,{fill:re(4671320),fillOpacity:0,tooltipY:5})})),t=$e.new(this,{pointerOrientation:"horizontal",paddingTop:4,paddingRight:7,paddingBottom:4,paddingLeft:7});t.label.setAll({fontSize:12}),t.get("background").setAll({fill:this.interfaceColors.get("background"),stroke:this.interfaceColors.get("grid"),strokeOpacity:.3}),e.set("tooltip",t),e.events.on("click",()=>{window.open("https://www.amcharts.com/","_blank")}),e.states.create("hover",{}),e.children.push(Fe.new(this,{stroke:re(13421772),strokeWidth:3,svgPath:"M5 25 L13 25h13.6c3.4 0 6 0 10.3-4.3s5.2-12 8.6-12c3.4 0 4.3 8.6 7.7 8.6M83.4 25H79.8c-3.4 0-6 0-10.3-4.3s-5.2-12-8.6-12-4.3 8.6-7.7 8.6"})).states.create("hover",{stroke:re(3976191)}),e.children.push(Fe.new(this,{stroke:re(8947848),strokeWidth:3,svgPath:"M83.4 25h-31C37 25 39.5 4.4 28.4 4.4S18.9 24.2 4.3 25H0"})).states.create("hover",{stroke:re(4671320)}),this._logo=e,this._handleLogo()}}_getRealSize(){return this.dom.getBoundingClientRect()}_getCalculatedSize(e){return this._settings.calculateSize?this._settings.calculateSize(e):{width:e.width,height:e.height}}_init(){const e=this._settings;e.accessible!==!1&&(e.focusable&&(this._inner.setAttribute("focusable","true"),this._inner.setAttribute("tabindex",this.tabindex+"")),e.ariaLabel&&this._inner.setAttribute("aria-label",e.ariaLabel),e.role&&this._inner.setAttribute("role",e.role));const t=this._renderer,i=this._getRealSize(),r=this._getCalculatedSize(i),a=Math.floor(r.width),s=Math.floor(r.height),n=Math.floor(i.width),l=Math.floor(i.height),d=Z.new(this,{visible:!0,width:a,height:s});this._rootContainer=d,this._rootContainer._defaultThemes.push(Ut.new(this));const m=d.children.push(Z.new(this,{visible:!0,width:J,height:J}));this.container=m,t.resize(n,l,a,s),this._inner.appendChild(t.view),this._initResizeSensor();const c=document.createElement("div");if(this._htmlElementContainer=c,c.className="am5-html-container",c.style.position="absolute",c.style.pointerEvents="none",this._tooltipContainerSettings||(c.style.overflow="hidden"),this._inner.appendChild(c),this._a11yD!==!0){const f=document.createElement("div");f.className="am5-reader-container",f.setAttribute("role","alert"),f.style.position="absolute",f.style.width="1px",f.style.height="1px",f.style.overflow="hidden",f.style.clip="rect(1px, 1px, 1px, 1px)",this._readerAlertElement=f,this._inner.appendChild(this._readerAlertElement);const o=document.createElement("div");o.className="am5-focus-container",o.style.position="absolute",o.style.pointerEvents="none",o.style.top="0px",o.style.left="0px",o.style.overflow="hidden",o.style.width=a+"px",o.style.height=s+"px",o.setAttribute("role","graphics-document"),K(o,!1),this._focusElementContainer=o,this._inner.appendChild(this._focusElementContainer);const p=document.createElement("div");this._tooltipElementContainer=p,p.className="am5-tooltip-container",this._inner.appendChild(p),ge("keyboardevents")&&(this._disposers.push(C(window,"keydown",h=>{const u=de(h);u=="Shift"?this._isShift=!0:u=="Tab"&&(this._isShift=h.shiftKey)})),this._disposers.push(C(window,"keyup",h=>{de(h)=="Shift"&&(this._isShift=!1)})),this._disposers.push(C(o,"click",()=>{const h=this._focusedSprite;if(h){const u=t.getEvent(new MouseEvent("click"));h.events.dispatch("click",{type:"click",originalEvent:u.event,point:u.point,simulated:!0,target:h})}})),this._disposers.push(C(o,"keydown",h=>{const u=this._focusedSprite;if(u){h.key=="Escape"&&(gt(),this._focusedSprite=void 0);let g=0,w=0;const v=de(h);switch(v){case"Enter":case" ":if(v==" "&&u.get("role")!="checkbox")return;h.preventDefault();const _=t.getEvent(new MouseEvent("mouse"));return void u.events.dispatch("click",{type:"click",originalEvent:_.event,point:_.point,simulated:!0,target:u});case"ArrowLeft":g=-6;break;case"ArrowRight":g=6;break;case"ArrowUp":w=-6;break;case"ArrowDown":w=6;break;default:return}if(g!=0||w!=0){if(h.preventDefault(),!u.isDragging()){this._keyboardDragPoint={x:0,y:0};const E=t.getEvent(new MouseEvent("mousedown",{clientX:0,clientY:0}));E.point={x:0,y:0},u.events.isEnabled("pointerdown")&&u.events.dispatch("pointerdown",{type:"pointerdown",originalEvent:E.event,point:E.point,simulated:!0,target:u})}const _=this._keyboardDragPoint;_.x+=g,_.y+=w;const x=t.getEvent(new MouseEvent("mousemove",{clientX:_.x,clientY:_.y}),!1);u.events.isEnabled("globalpointermove")&&u.events.dispatch("globalpointermove",{type:"globalpointermove",originalEvent:x.event,point:x.point,simulated:!0,target:u})}}})),this._disposers.push(C(o,"keyup",h=>{if(this._focusedSprite){const u=this._focusedSprite,g=de(h);switch(g){case"ArrowLeft":case"ArrowRight":case"ArrowTop":case"ArrowDown":if(u.isDragging()){const w=this._keyboardDragPoint,v=t.getEvent(new MouseEvent("mouseup",{clientX:w.x,clientY:w.y}));return u.events.isEnabled("globalpointerup")&&u.events.dispatch("globalpointerup",{type:"globalpointerup",originalEvent:v.event,point:v.point,simulated:!0,target:u}),void(this._keyboardDragPoint=void 0)}if(u.get("focusableGroup")){const w=u.get("focusableGroup"),v=this._tabindexes.filter(E=>!(E.get("focusableGroup")!=w||E.getPrivate("focusable")===!1||!E.isVisibleDeep()));let _=v.indexOf(u);const x=v.length-1;_+=g=="ArrowRight"||g=="ArrowDown"?1:-1,_<0?_=x:_>x&&(_=0),yt(v[_].getPrivate("focusElement").dom)}}}})))}this._startTicker(),this.setThemes([]),this._addTooltip(),this._hasLicense()||this._showBranding()}_initResizeSensor(){this._resizeSensorDisposer&&this._resizeSensorDisposer.dispose(),this._resizeSensorDisposer=new Xt(this.dom,()=>{this.autoResize&&this.resize()}),this._disposers.push(this._resizeSensorDisposer)}resize(){const e=this._getRealSize(),t=this._getCalculatedSize(e),i=Math.floor(t.width),r=Math.floor(t.height);if(i>0&&r>0){const a=Math.floor(e.width),s=Math.floor(e.height),n=this._htmlElementContainer;if(n.style.width=i+"px",n.style.height=r+"px",this._a11yD!==!0){const d=this._focusElementContainer;d.style.width=i+"px",d.style.height=r+"px"}this._renderer.resize(a,s,i,r);const l=this._rootContainer;l.setPrivate("width",i),l.setPrivate("height",r),this._render(),this._handleLogo()}}_render(){this._renderer.render(this._rootContainer._display),this._focusElementDirty&&(this._updateCurrentFocus(),this._focusElementDirty=!1)}_runTickers(e){y(this._tickers,t=>{t(e)})}_runAnimations(e){let t=0;return we(this._animations,i=>{const r=i._runAnimation(e);return r!==Xe.Stopped&&(r!==Xe.Playing||(++t,!0))}),this._isDirtyAnimation=!1,t===0}_runDirties(){let e={};for(;this._isDirtyParents;)this._isDirtyParents=!1,se(this._dirtyParents).forEach(s=>{const n=this._dirtyParents[s];delete this._dirtyParents[s],n.isDisposed()||(e[n.uid]=n,n._prepareChildren())});se(e).forEach(s=>{e[s]._updateChildren()});const t=[];se(this._dirty).forEach(s=>{const n=this._dirty[s];n.isDisposed()?delete this._dirty[n.uid]:(t.push(n),n._beforeChanged())}),t.forEach(s=>{s._changed(),delete this._dirty[s.uid],s._clearDirty()}),this._isDirty=!1;const i={},r=[];se(this._dirtyBounds).forEach(s=>{const n=this._dirtyBounds[s];delete this._dirtyBounds[s],n.isDisposed()||(i[n.uid]=n.depth(),r.push(n))}),this._positionHTMLElements(),r.sort((s,n)=>vt(i[n.uid],i[s.uid])),r.forEach(s=>{s._updateBounds()});const a=this._dirtyPositions;se(a).forEach(s=>{const n=a[s];delete a[s],n.isDisposed()||n._updatePosition()}),t.forEach(s=>{s._afterChanged()})}_renderFrame(e){if(this._updateTick){this.events.isEnabled("framestarted")&&this.events.dispatch("framestarted",{type:"framestarted",target:this,timestamp:e}),this._checkComputedStyles(),this._runTickers(e);const t=this._runAnimations(e);return this._runDirties(),this._render(),this._renderer.resetImageArray(),this._positionHTMLElements(),this.events.isEnabled("frameended")&&this.events.dispatch("frameended",{type:"frameended",target:this,timestamp:e}),this._tickers.length===0&&t&&!this._isDirtyAnimation&&!this._isDirty}return!0}_runTicker(e,t){this.isDisposed()||(this.animationTime=e,this._renderFrame(e)?(this._ticker=null,this.animationTime=null):this._paused||(t?this._ticker:Qe(this.fps,this._ticker)))}_runTickerNow(e=1e4){if(!this.isDisposed()){const t=performance.now()+e;for(;;){const i=performance.now();if(i>=t){this.animationTime=null;break}if(this.animationTime=i,this._renderFrame(i)){this.animationTime=null;break}}}}_startTicker(){this._ticker===null&&(this.animationTime=null,this._ticker=e=>{this._runTicker(e)},Qe(this.fps,this._ticker))}get updateTick(){return this._updateTick}set updateTick(e){this._updateTick=e,e&&this._startTicker()}_addDirtyEntity(e){this._isDirty=!0,this._dirty[e.uid]===void 0&&(this._dirty[e.uid]=e),this._startTicker()}_addDirtyParent(e){this._isDirty=!0,this._isDirtyParents=!0,this._dirtyParents[e.uid]===void 0&&(this._dirtyParents[e.uid]=e),this._startTicker()}_addDirtyBounds(e){this._isDirty=!0,this._dirtyBounds[e.uid]===void 0&&(this._dirtyBounds[e.uid]=e),this._startTicker()}_addDirtyPosition(e){this._isDirty=!0,this._dirtyPositions[e.uid]===void 0&&(this._dirtyPositions[e.uid]=e),this._startTicker()}_addAnimation(e){this._isDirtyAnimation=!0,this._animations.indexOf(e)===-1&&this._animations.push(e),this._startTicker()}_markDirty(){this._isDirty=!0}_markDirtyRedraw(){this.events.once("frameended",()=>{this._isDirty=!0,this._startTicker()})}eachFrame(e){return this._tickers.push(e),this._startTicker(),new X(()=>{Ae(this._tickers,e)})}markDirtyGlobal(e){e||(e=this.container),e.walkChildren(t=>{t instanceof Z&&this.markDirtyGlobal(t),t.markDirty(),t.markDirtyBounds()})}width(){return Math.floor(this._getCalculatedSize(this._getRealSize()).width)}height(){return Math.floor(this._getCalculatedSize(this._getRealSize()).height)}dispose(){this._isDisposed||(this._isDisposed=!0,this._rootContainer.dispose(),this._renderer.dispose(),this.horizontalLayout.dispose(),this.verticalLayout.dispose(),this.interfaceColors.dispose(),y(this._disposers,e=>{e.dispose()}),this._inner&&wt(this._inner),ae(ie.rootElements,this))}isDisposed(){return this._isDisposed}readerAlert(e){this._a11yD!==!0&&(this._readerAlertElement.innerHTML=Ye(e))}setThemes(e){this._rootContainer.set("themes",e);const t=this.tooltipContainer;t&&t._applyThemes();const i=this.interfaceColors;i&&i._applyThemes()}_addTooltip(){if(!this.tooltipContainer){const e=this._tooltipContainerSettings,t=this._rootContainer.children.push(Z.new(this,{position:"absolute",isMeasured:!1,width:J,height:J,layer:e?35:30,layerMargin:e||void 0}));this.tooltipContainer=t;const i=$e.new(this,{});this.container.set("tooltip",i),i.hide(0),this._tooltip=i}}_registerTabindexOrder(e){this._a11yD!=1&&(e.get("focusable")?De(this._tabindexes,e):ae(this._tabindexes,e),this._invalidateTabindexes())}_unregisterTabindexOrder(e){this._a11yD!=1&&(ae(this._tabindexes,e),this._invalidateTabindexes())}_invalidateTabindexes(){if(this._a11yD==1)return;this._tabindexes.sort((t,i)=>{const r=t.get("tabindexOrder",0),a=i.get("tabindexOrder",0);return r==a?0:r>a?1:-1});const e=[];y(this._tabindexes,(t,i)=>{t.getPrivate("focusElement")?this._moveFocusElement(i,t):this._makeFocusElement(i,t);const r=t.get("focusableGroup");r&&t.getPrivate("focusable")!==!1&&(e.indexOf(r)!==-1?t.getPrivate("focusElement").dom.setAttribute("tabindex","-1"):e.push(r))})}_updateCurrentFocus(){this._a11yD!=1&&this._focusedSprite&&(this._decorateFocusElement(this._focusedSprite),this._positionFocusElement(this._focusedSprite))}_decorateFocusElement(e,t){if(this._a11yD==1||(t||(t=e.getPrivate("focusElement").dom),!t))return;const i=e.get("role");i?t.setAttribute("role",i):t.removeAttribute("role");const r=e.get("ariaLabel");if(r){const h=xt(e,r);t.setAttribute("aria-label",h)}else t.removeAttribute("aria-label");const a=e.get("ariaLive");a?t.setAttribute("aria-live",a):t.removeAttribute("aria-live");const s=e.get("ariaChecked");s!=null&&i&&["checkbox","option","radio","menuitemcheckbox","menuitemradio","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-checked",s?"true":"false"):t.removeAttribute("aria-checked");const n=e.get("ariaCurrent");n!=null?t.setAttribute("aria-current",n):t.removeAttribute("aria-current");const l=e.get("ariaSelected");l!=null&&i&&["gridcell","option","row","tab","columnheader","rowheader","treeitem"].indexOf(i)!==-1?t.setAttribute("aria-selected",l?"true":"false"):t.removeAttribute("aria-selected"),e.get("ariaHidden")?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden");const d=e.get("ariaOrientation");d?t.setAttribute("aria-orientation",d):t.removeAttribute("aria-orientation");const m=e.get("ariaValueNow");m?t.setAttribute("aria-valuenow",m):t.removeAttribute("aria-valuenow");const c=e.get("ariaValueMin");c?t.setAttribute("aria-valuemin",c):t.removeAttribute("aria-valuemin");const f=e.get("ariaValueMax");f?t.setAttribute("aria-valuemax",f):t.removeAttribute("aria-valuemax");const o=e.get("ariaValueText");o?t.setAttribute("aria-valuetext",o):t.removeAttribute("aria-valuetext");const p=e.get("ariaControls");p?t.setAttribute("aria-controls",p):t.removeAttribute("aria-controls"),e.get("visible")&&e.get("opacity")!==0&&e.get("role")!="tooltip"&&!e.isHidden()&&e.getPrivate("focusable")!==!1?(t.getAttribute("tabindex")!="-1"&&t.setAttribute("tabindex",""+this.tabindex),t.removeAttribute("aria-hidden")):(t.removeAttribute("tabindex"),t.setAttribute("aria-hidden","true"))}_makeFocusElement(e,t){if(t.getPrivate("focusElement")||this._a11yD==1)return;const i=document.createElement("div");t.get("role")!="tooltip"&&(i.tabIndex=this.tabindex),i.style.position="absolute",K(i,!1);const r=[];t.setPrivate("focusElement",{dom:i,disposers:r}),this._decorateFocusElement(t),r.push(C(i,"focus",a=>{this._handleFocus(a)})),r.push(C(i,"blur",a=>{this._handleBlur(a)})),this._moveFocusElement(e,t)}_removeFocusElement(e){if(this._a11yD==1)return;ae(this._tabindexes,e);const t=e.getPrivate("focusElement");t&&(this._focusElementContainer.removeChild(t.dom),y(t.disposers,i=>{i.dispose()}))}_hideFocusElement(e){this._a11yD!=1&&(e.getPrivate("focusElement").dom.style.display="none")}_moveFocusElement(e,t){if(this._a11yD==1)return;const i=this._focusElementContainer,r=t.getPrivate("focusElement").dom;if(r===this._focusElementContainer.children[e])return;const a=this._focusElementContainer.children[e+1];a?i.insertBefore(r,a):i.append(r)}_positionFocusElement(e){if(this._a11yD==1||e==null)return;const t=e.globalBounds();let i=t.right==t.left?e.width():t.right-t.left,r=t.top==t.bottom?e.height():t.bottom-t.top;const a=this._settings.focusPadding!==void 0?this._settings.focusPadding:2;let s=t.left-a,n=t.top-a;i<0&&(s+=i,i=Math.abs(i)),r<0&&(n+=r,r=Math.abs(r));const l=e.getPrivate("focusElement").dom;l.style.top=n+"px",l.style.left=s+"px",l.style.width=i+2*a+"px",l.style.height=r+2*a+"px"}_getSpriteByFocusElement(e){let t;return Ce(this._tabindexes,(i,r)=>i.getPrivate("focusElement").dom!==e||(t=i,!1)),t}_handleFocus(e){if(this._a11yD==1)return;const t=this._getSpriteByFocusElement(e.target);t&&(t.isVisibleDeep()?(this._positionFocusElement(t),this._focusedSprite=t,t.events.isEnabled("focus")&&t.events.dispatch("focus",{type:"focus",originalEvent:e,target:t})):this._focusNext(e.target,this._isShift?-1:1))}_focusNext(e,t){if(this._a11yD==1)return;const i=Array.from(document.querySelectorAll(["a[href]","area[href]","button:not([disabled])","details","input:not([disabled])","iframe:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contentEditable=""]','[contentEditable="true"]','[contentEditable="TRUE"]','[tabindex]:not([tabindex^="-"])'].join(",")));let r=i.indexOf(e)+t;r<0?r=i.length-1:r>=i.length&&(r=0),i[r].focus()}_handleBlur(e){if(this._a11yD==1)return;const t=this._focusedSprite;t&&!t.isDisposed()&&t.events.isEnabled("blur")&&t.events.dispatch("blur",{type:"blur",originalEvent:e,target:t}),this._focusedSprite=void 0}updateTooltip(e){if(this._a11yD==1)return;const t=Ye(e._getText());let i=e.getPrivate("tooltipElement");e.get("role")=="tooltip"&&t!=""?(i||(i=this._makeTooltipElement(e)),i.innerHTML!=t&&(i.innerHTML=t),i.setAttribute("aria-hidden",e.isVisibleDeep()?"false":"true")):i&&(i.remove(),e.removePrivate("tooltipElement"))}_makeTooltipElement(e){const t=this._tooltipElementContainer,i=document.createElement("div");return i.style.position="absolute",i.style.width="1px",i.style.height="1px",i.style.overflow="hidden",i.style.clip="rect(1px, 1px, 1px, 1px)",K(i,!1),this._decorateFocusElement(e,i),t.append(i),e.setPrivate("tooltipElement",i),i}_removeTooltipElement(e){if(this._a11yD==1)return;const t=e.getPrivate("tooltipElement");if(t){const i=t.parentElement;i&&i.removeChild(t)}}_invalidateAccessibility(e){if(this._a11yD==1)return;this._focusElementDirty=!0;const t=e.getPrivate("focusElement");e.get("focusable")?t&&(this._decorateFocusElement(e),this._positionFocusElement(e)):t&&this._removeFocusElement(e)}focused(e){return this._focusedSprite===e}documentPointToRoot(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:(e.x-t.left)*r,y:(e.y-t.top)*a}}rootPointToDocument(e){const t=this._getRealSize(),i=this._getCalculatedSize(t),r=i.width/t.width,a=i.height/t.height;return{x:e.x/r+t.left,y:e.y/a+t.top}}addDisposer(e){return this._disposers.push(e),e}_updateComputedStyles(){const e=window.getComputedStyle(this.dom);let t="";ue(e,(r,a)=>{ye(r)&&r.match(/^font/)&&(t+=a)});const i=t!=this._fontHash;return i&&(this._fontHash=t),i}_checkComputedStyles(){this._updateComputedStyles()&&this._invalidateLabelBounds(this.container)}_invalidateLabelBounds(e){e instanceof Z?e.children.each(t=>{this._invalidateLabelBounds(t)}):e instanceof Pt&&e.markDirtyBounds()}_hasLicense(){for(let e=0;e{const a=this._renderer.getEvent(r);e.events.dispatch("click",{type:"click",originalEvent:a.event,point:a.point,simulated:!1,target:e})}))),this._positionHTMLElement(e),t.append(i),De(this._htmlEnabledContainers,e),i}_positionHTMLElements(){y(this._htmlEnabledContainers,e=>{this._positionHTMLElement(e)})}_positionHTMLElement(e){const t=e.getPrivate("htmlElement");if(t){y(["paddingTop","paddingRight","paddingBottom","paddingLeft","minWidth","minHeight","maxWidth","maxHeight"],u=>{const g=e.get(u);t.style[u]=g?g+"px":""});const i=e.compositeScale()||1,r=e.compositeRotation()||0;t.style.transform="",t.style.transformOrigin="";const a=e.compositeOpacity();setTimeout(()=>{t.style.opacity=a+""},10);const s=e.isVisibleDeep();s&&(t.style.display="block");let n={x:e.x(),y:e.y()};e.parent&&(n=e.parent.toGlobal(n)),t.style.top=n.y+"px",t.style.left=n.x+"px";const l=e.get("width"),d=e.get("height");let m=0,c=0;if(l&&(m=e.width()),d&&(c=e.height()),!l||!d){t.style.position="fixed",t.style.width="",t.style.height="";const u=t.getBoundingClientRect();t.style.position="absolute",l||(m=u.width),d||(c=u.height);let g=m/i,w=c/i,v=e.get("centerX",0),_=e.get("centerY",0),x=0,E=0,k=0,M=0;v instanceof ve?(x=-v.value*g,E=(1-v.value)*g):(x=-v,E=g-v),_ instanceof ve?(k=-_.value*w,M=(1-_.value)*w):(k=-_,M=w-_),e._localBounds={left:x,right:E,top:k,bottom:M};let j=e._adjustedLocalBounds,O=e._display.getAdjustedBounds(e._localBounds);e._adjustedLocalBounds=O,j.left===O.left&&j.right===O.right&&j.top===O.top&&j.bottom===O.bottom||e.markDirtyBounds()}m>0&&(t.style.minWidth=m+"px"),c>0&&(t.style.minHeight=c+"px"),s&&a!=0||(t.style.display="none");const f=e.get("centerX",0),o=He(f)?f.percent+"%":f+"px",p=e.get("centerY",0),h=He(p)?p.percent+"%":p+"px";(f||p)&&(t.style.transform="translate(-"+o+", -"+h+")"+t.style.transform),i!=1&&(t.style.transform+="scale("+i+")"),r!=0&&(t.style.transform+=" rotate("+r+"deg)"),t.style.transform!=""&&(t.style.transformOrigin=o+" "+h)}}_setHTMLContent(e,t){let i=e.getPrivate("htmlElement");i||(i=this._makeHTMLElement(e)),i.innerHTML!=t&&(i.innerHTML=t)}_removeHTMLContent(e){let t=e.getPrivate("htmlElement");t&&(this._htmlElementContainer.removeChild(t),e.removePrivate("htmlElement")),ae(this._htmlEnabledContainers,e)}}ct("AM5C241025748");const et="en-us",Ie=new Map([["ar",()=>P(()=>import("./ar-69w_pNvD-7lDIs8Pw.js"),[],import.meta.url)],["bg-bg",()=>P(()=>import("./bg_BG-HxX0GdS4-O8Kpb0zp.js"),[],import.meta.url)],["bs-ba",()=>P(()=>import("./bs_BA-DrqKjqQh-Cr-VUOtJ.js"),[],import.meta.url)],["ca-es",()=>P(()=>import("./ca_ES-B8P53VJs-DWC4n8NA.js"),[],import.meta.url)],["cs-cz",()=>P(()=>import("./cs_CZ-Bqde4kKV-CyqqX6ir.js"),[],import.meta.url)],["da-dk",()=>P(()=>import("./da_DK-BHlKtWuS-2ex9kBWh.js"),[],import.meta.url)],["de-de",()=>P(()=>import("./de_DE-BjuOMedt-BF1_XBt7.js"),[],import.meta.url)],["de-ch",()=>P(()=>import("./de_CH-DAPp1Ncl-B97rjhoW.js"),[],import.meta.url)],["el-gr",()=>P(()=>import("./el_GR-C1WdWwt2-BN9c0-aL.js"),[],import.meta.url)],["en-us",()=>P(()=>import("./en_US-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["en-ca",()=>P(()=>import("./en_CA-9ASyeqlk-COWxzRR4.js"),[],import.meta.url)],["es-es",()=>P(()=>import("./es_ES-D1FgMsXM-_3WcXaQ2.js"),[],import.meta.url)],["et-ee",()=>P(()=>import("./et_EE-Dz_TpNNF-F7kgGek-.js"),[],import.meta.url)],["fi-fi",()=>P(()=>import("./fi_FI-Cte3XVjc-Bozs9Z2H.js"),[],import.meta.url)],["fr-fr",()=>P(()=>import("./fr_FR-D4Jnvm3b-BkfBDc1T.js"),[],import.meta.url)],["he-il",()=>P(()=>import("./he_IL-DcsZ56bm-B900khEo.js"),[],import.meta.url)],["hr-hr",()=>P(()=>import("./hr_HR-C0BJtvO7-BXNws4dg.js"),[],import.meta.url)],["hu-hu",()=>P(()=>import("./hu_HU-BGreOcqI-BPCtb03x.js"),[],import.meta.url)],["id-id",()=>P(()=>import("./id_ID-DCZBbKD3-Bk2oUsUi.js"),[],import.meta.url)],["it-it",()=>P(()=>import("./it_IT-BeKgphnk-BU_dnupK.js"),[],import.meta.url)],["ja-jp",()=>P(()=>import("./ja_JP-gzKc2xa8-BjWjUZZi.js"),[],import.meta.url)],["ko-kr",()=>P(()=>import("./ko_KR-sv9FjurR-C63G07Pj.js"),[],import.meta.url)],["lt-lt",()=>P(()=>import("./lt_LT-yZNULmv_-DHDBnlgq.js"),[],import.meta.url)],["lv-lv",()=>P(()=>import("./lv_LV-Cu8aigXF-BGX5_oyM.js"),[],import.meta.url)],["nb-no",()=>P(()=>import("./nb_NO-CqN3wUJH-BVuLzJb0.js"),[],import.meta.url)],["nl-nl",()=>P(()=>import("./nl_NL-DAiuag9r-DiE2F1Fx.js"),[],import.meta.url)],["pl-pl",()=>P(()=>import("./pl_PL-BDbrX9O9-CCCo8oJV.js"),[],import.meta.url)],["pt-br",()=>P(()=>import("./pt_BR-D3fc0auN-ClOz39JC.js"),[],import.meta.url)],["pt-pt",()=>P(()=>import("./pt_PT-ne3A0-MZ-CugZtzXR.js"),[],import.meta.url)],["ro-ro",()=>P(()=>import("./ro_RO-BfLaePMk-D4DP893q.js"),[],import.meta.url)],["ru-ru",()=>P(()=>import("./ru_RU-jSaqVZwA-TpCrDGWK.js"),[],import.meta.url)],["sk-sk",()=>P(()=>import("./sk_SK-Dp9r7-Al-CP61SfDR.js"),[],import.meta.url)],["sl-sl",()=>P(()=>import("./sl_SL-CArbvniK-hZyOU_tZ.js"),[],import.meta.url)],["sr-rs",()=>P(()=>import("./sr_RS-KKcjmG1u-BY82CeQm.js"),[],import.meta.url)],["sv-se",()=>P(()=>import("./sv_SE-CT8Rd8gJ-CRc7K9Uw.js"),[],import.meta.url)],["th-th",()=>P(()=>import("./th_TH-DHvdpgHD-CZOpdnuT.js"),[],import.meta.url)],["tr-tr",()=>P(()=>import("./tr_TR-CooWKX5o-BqZDkyaY.js"),[],import.meta.url)],["uk-ua",()=>P(()=>import("./uk_UA-D4LhzxxY-iB1TkjZJ.js"),[],import.meta.url)],["vi-vn",()=>P(()=>import("./vi_VN-Byu5lfYa-DrrDewoL.js"),[],import.meta.url)],["zh-cn",()=>P(()=>import("./zh_Hans-DQ0VpKp5-DN9wG9bm.js"),[],import.meta.url)],["zh-hk",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)],["zh-tw",()=>P(()=>import("./zh_Hant-Di2gjomG-C6TuzFvp.js"),[],import.meta.url)]]);function Ai(b){const e=b.split("-")[0].toLowerCase();let t=null;for(const i of Ie.keys())if(i.startsWith(e)){t=i;break}return t}function Ci(b){return b?Ie.has(b.toLowerCase())?b.toLowerCase():Ai(b)||et:et}async function Yi(b,e=ut()){const t=ze.new(b);return t.locale=(await Ie.get(Ci(e))()).default,t}export{Yi as createRoot}; diff --git a/custom-toc-highlight/assets/cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js b/custom-toc-highlight/assets/cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js similarity index 91% rename from custom-toc-highlight/assets/cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js rename to custom-toc-highlight/assets/cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js index b9b7ce79..d2f4ff8f 100644 --- a/custom-toc-highlight/assets/cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js +++ b/custom-toc-highlight/assets/cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js @@ -1 +1 @@ -import{ar as l}from"./story-BfX8CRfG.js";import{e as y,r as f,t as k,N as M,T as b}from"./utils-SPbpQbmm-B3hR8LxB.js";function S(e){const o=[];return s(y(e),o),o.length?new l(b(o[0])):null}function s(e,o){if(!e)return;let a;a=e.type==="CIMTextSymbol"?e.symbol:e;const c=e.type==="CIMPolygonSymbol";if(a?.symbolLayers){for(const r of a.symbolLayers)if(!(r.colorLocked||c&&(f(r)||k(r)&&r.markerPlacement&&M(r.markerPlacement))))switch(r.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":r.tintColor&&m(o,r.tintColor);break;case"CIMVectorMarker":r.markerGraphics?.forEach(t=>{s(t.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":m(o,r.color);break;case"CIMHatchFill":s(r.lineSymbol,o)}}}function m(e,o){for(const a of e)if(a.join(".")===o.join("."))return;e.push(o)}function p(e,o,a){o instanceof l||(o=new l(o));const c=y(e);c&&i(c,o)}function i(e,o,a){if(!e)return;let c;c=e.type==="CIMTextSymbol"?e.symbol:e;const r=c?.type==="CIMPolygonSymbol";if(c?.symbolLayers)for(const t of c.symbolLayers){if(t.colorLocked||r&&(f(t)||k(t)&&t.markerPlacement&&M(t.markerPlacement)))continue;const n=o.toArray();switch(t.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":t.tintColor=n;break;case"CIMVectorMarker":t.markerGraphics?.forEach(C=>{i(C.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":t.color=n;break;case"CIMHatchFill":i(t.lineSymbol,o)}}}export{S as I,p as u}; +import{ar as l}from"./story-Doly9N9p.js";import{e as y,r as f,t as k,N as M,T as b}from"./utils-SPbpQbmm-CiwW7WzR.js";function S(e){const o=[];return s(y(e),o),o.length?new l(b(o[0])):null}function s(e,o){if(!e)return;let a;a=e.type==="CIMTextSymbol"?e.symbol:e;const c=e.type==="CIMPolygonSymbol";if(a?.symbolLayers){for(const r of a.symbolLayers)if(!(r.colorLocked||c&&(f(r)||k(r)&&r.markerPlacement&&M(r.markerPlacement))))switch(r.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":r.tintColor&&m(o,r.tintColor);break;case"CIMVectorMarker":r.markerGraphics?.forEach(t=>{s(t.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":m(o,r.color);break;case"CIMHatchFill":s(r.lineSymbol,o)}}}function m(e,o){for(const a of e)if(a.join(".")===o.join("."))return;e.push(o)}function p(e,o,a){o instanceof l||(o=new l(o));const c=y(e);c&&i(c,o)}function i(e,o,a){if(!e)return;let c;c=e.type==="CIMTextSymbol"?e.symbol:e;const r=c?.type==="CIMPolygonSymbol";if(c?.symbolLayers)for(const t of c.symbolLayers){if(t.colorLocked||r&&(f(t)||k(t)&&t.markerPlacement&&M(t.markerPlacement)))continue;const n=o.toArray();switch(t.type){case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":t.tintColor=n;break;case"CIMVectorMarker":t.markerGraphics?.forEach(C=>{i(C.symbol,o)});break;case"CIMSolidStroke":case"CIMSolidFill":t.color=n;break;case"CIMHatchFill":i(t.lineSymbol,o)}}}export{S as I,p as u}; diff --git a/custom-toc-highlight/assets/clientSideDefaults-BqqayPct-B-0mBem3.js b/custom-toc-highlight/assets/clientSideDefaults-BqqayPct-Vv2Kv9CL.js similarity index 93% rename from custom-toc-highlight/assets/clientSideDefaults-BqqayPct-B-0mBem3.js rename to custom-toc-highlight/assets/clientSideDefaults-BqqayPct-Vv2Kv9CL.js index 56848f7c..c23e3bd2 100644 --- a/custom-toc-highlight/assets/clientSideDefaults-BqqayPct-B-0mBem3.js +++ b/custom-toc-highlight/assets/clientSideDefaults-BqqayPct-Vv2Kv9CL.js @@ -1,4 +1,4 @@ -import{h3 as u,h4 as n,h5 as i,K as a,P as c}from"./story-BfX8CRfG.js";import{t as l}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{s as y}from"./capabilities-Cjn77swe-Y9lFlGVh.js";function $(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?u:t==="esriGeometryPolyline"?n:i}}}const d=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let m=1;function B(t,s){if(a("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this${p(s)} = null;`;for(const e in t)r+=`this${p(e)} = ${JSON.stringify(t[e])};`;const o=new Function(` +import{h3 as u,h4 as n,h5 as i,K as a,P as c}from"./story-Doly9N9p.js";import{t as l}from"./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js";import{s as y}from"./capabilities-Cjn77swe-Y9lFlGVh.js";function $(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?u:t==="esriGeometryPolyline"?n:i}}}const d=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let m=1;function B(t,s){if(a("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this${p(s)} = null;`;for(const e in t)r+=`this${p(e)} = ${JSON.stringify(t[e])};`;const o=new Function(` return class AttributesClass$${m++} { constructor() { ${r}; diff --git a/custom-toc-highlight/assets/colorRamps-q0bZVhs2-DQZn2xZS.js b/custom-toc-highlight/assets/colorRamps-q0bZVhs2-BnivlaV9.js similarity index 95% rename from custom-toc-highlight/assets/colorRamps-q0bZVhs2-DQZn2xZS.js rename to custom-toc-highlight/assets/colorRamps-q0bZVhs2-BnivlaV9.js index 2fca6054..b5a05c34 100644 --- a/custom-toc-highlight/assets/colorRamps-q0bZVhs2-DQZn2xZS.js +++ b/custom-toc-highlight/assets/colorRamps-q0bZVhs2-BnivlaV9.js @@ -1 +1 @@ -import{v as o,S as e,i as m,bz as g,ar as c,bB as h,e as v,P as p}from"./story-BfX8CRfG.js";let s=class extends v{constructor(t){super(t),this.type=null}};o([e({readOnly:!0,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=o([m("esri.rest.support.ColorRamp")],s);const n=s;var i;let r=i=class extends n{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new i({fromColor:p(this.fromColor),toColor:p(this.toColor),algorithm:this.algorithm})}};o([g({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],r.prototype,"algorithm",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"fromColor",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"toColor",void 0),o([e({type:["algorithmic"]})],r.prototype,"type",void 0),r=i=o([m("esri.rest.support.AlgorithmicColorRamp")],r);const y=r;var a;let l=a=class extends n{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new a({colorRamps:p(this.colorRamps)})}};o([e({type:[y],json:{write:!0}})],l.prototype,"colorRamps",void 0),o([e({type:["multipart"]})],l.prototype,"type",void 0),l=a=o([m("esri.rest.support.MultipartColorRamp")],l);const u=l,d={key:"type",base:n,typeMap:{algorithmic:y,multipart:u}};function f(t){return t?.type?t.type==="algorithmic"?y.fromJSON(t):t.type==="multipart"?u.fromJSON(t):null:null}export{u as c,d as g,f as v}; +import{v as o,S as e,i as m,bz as g,ar as c,bB as h,e as v,P as p}from"./story-Doly9N9p.js";let s=class extends v{constructor(t){super(t),this.type=null}};o([e({readOnly:!0,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=o([m("esri.rest.support.ColorRamp")],s);const n=s;var i;let r=i=class extends n{constructor(t){super(t),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new i({fromColor:p(this.fromColor),toColor:p(this.toColor),algorithm:this.algorithm})}};o([g({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],r.prototype,"algorithm",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"fromColor",void 0),o([e({type:c,json:{type:[h],write:!0}})],r.prototype,"toColor",void 0),o([e({type:["algorithmic"]})],r.prototype,"type",void 0),r=i=o([m("esri.rest.support.AlgorithmicColorRamp")],r);const y=r;var a;let l=a=class extends n{constructor(t){super(t),this.colorRamps=null,this.type="multipart"}clone(){return new a({colorRamps:p(this.colorRamps)})}};o([e({type:[y],json:{write:!0}})],l.prototype,"colorRamps",void 0),o([e({type:["multipart"]})],l.prototype,"type",void 0),l=a=o([m("esri.rest.support.MultipartColorRamp")],l);const u=l,d={key:"type",base:n,typeMap:{algorithmic:y,multipart:u}};function f(t){return t?.type?t.type==="algorithmic"?y.fromJSON(t):t.type==="multipart"?u.fromJSON(t):null:null}export{u as c,d as g,f as v}; diff --git a/custom-toc-highlight/assets/colorUtils-Cthpxcks-ZRnr1H1b.js b/custom-toc-highlight/assets/colorUtils-Cthpxcks-cHaMZbaf.js similarity index 98% rename from custom-toc-highlight/assets/colorUtils-Cthpxcks-ZRnr1H1b.js rename to custom-toc-highlight/assets/colorUtils-Cthpxcks-cHaMZbaf.js index 9f543ef2..c9972952 100644 --- a/custom-toc-highlight/assets/colorUtils-Cthpxcks-ZRnr1H1b.js +++ b/custom-toc-highlight/assets/colorUtils-Cthpxcks-cHaMZbaf.js @@ -1 +1 @@ -import{ar as h,eu as w,P,ev as A}from"./story-BfX8CRfG.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";function E(t){return"r"in t&&"g"in t&&"b"in t}function x(t){return"h"in t&&"s"in t&&"v"in t}function k(t){return"l"in t&&"a"in t&&"b"in t}function y(t){return"l"in t&&"c"in t&&"h"in t}function I(t){return"x"in t&&"y"in t&&"z"in t}const j=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],q=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function v(t,r){const e=[];let n,o;if(t[0].length!==r.length)throw new Error("dimensions do not match");const u=t.length,a=t[0].length;let c=0;for(n=0;nn<=.04045?n/12.92:((n+.055)/1.055)**2.4),e=v(j,r);return{x:100*e[0],y:100*e[1],z:100*e[2]}}function M(t){const r=v(q,[t.x/100,t.y/100,t.z/100]).map(e=>{const n=e<=.0031308?12.92*e:1.055*e**.4166666666666667-.055;return Math.min(1,Math.max(n,0))});return{r:Math.round(255*r[0]),g:Math.round(255*r[1]),b:Math.round(255*r[2])}}function H(t){const r=[t.x/95.047,t.y/100,t.z/108.883].map(e=>e>.008856451679035631?e**.3333333333333333:7.787037037037035*e+.13793103448275862);return{l:116*r[1]-16,a:500*(r[0]-r[1]),b:200*(r[1]-r[2])}}function L(t){const r=t.l,e=[(r+16)/116+t.a/500,(r+16)/116,(r+16)/116-t.b/200].map(n=>n>6/29?n**3:3*(6/29)**2*(n-4/29));return{x:95.047*e[0],y:100*e[1],z:108.883*e[2]}}function B(t){const r=t.l,e=t.a,n=t.b,o=Math.sqrt(e*e+n*n);let u=Math.atan2(n,e);return u=u>0?u:u+2*Math.PI,{l:r,c:o,h:u}}function C(t){const r=t.l,e=t.c,n=t.h;return{l:r,a:e*Math.cos(n),b:e*Math.sin(n)}}function D(t){return H(z(t))}function F(t){return M(L(t))}function G(t){return B(H(z(t)))}function O(t){return M(L(C(t)))}function Q(t){const r=t.r,e=t.g,n=t.b,o=Math.max(r,e,n),u=o-Math.min(r,e,n);let a=o,c=u===0?0:o===r?(e-n)/u%6:o===e?(n-r)/u+2:(r-e)/u+4,i=u===0?0:u/a;return c<0&&(c+=6),c*=60,i*=100,a*=100/255,{h:c,s:i,v:a}}function R(t){const r=(t.h+360)%360/60,e=t.s/100,n=t.v/100*255,o=n*e,u=o*(1-Math.abs(r%2-1));let a;switch(Math.floor(r)){case 0:a={r:o,g:u,b:0};break;case 1:a={r:u,g:o,b:0};break;case 2:a={r:0,g:o,b:u};break;case 3:a={r:0,g:u,b:o};break;case 4:a={r:u,g:0,b:o};break;case 5:case 6:a={r:o,g:0,b:u};break;default:a={r:0,g:0,b:0}}return a.r=Math.round(a.r+n-o),a.g=Math.round(a.g+n-o),a.b=Math.round(a.b+n-o),a}function m(t){return E(t)?t:y(t)?O(t):k(t)?F(t):I(t)?M(t):x(t)?R(t):t}function Y(t){return x(t)?t:Q(m(t))}function _(t){return k(t)?t:D(m(t))}function $(t){return y(t)?t:G(m(t))}function S(t,r){const{r:e,g:n,b:o}=t;return .2126*e+.7152*n+.0722*o}var b;function J(t,r=b.High){return S(t)>r?new h([0,0,0,t.a]):new h([255,255,255,t.a])}function K(t,r,e={}){if(t.length===0||r<=0)return[];if((t=t.map(n=>typeof n=="string"?new h(n):n)).length===1||r===1){const n=[],o=t[0];for(let u=0;u=r){const n=[],o=(t.length-1)/(r-1);for(let u=0;ua.clone()),...w(n,e.seed??1)]}(function(t){t[t.Low=160]="Low",t[t.High=225]="High"})(b||(b={}));const g=(t,r)=>{const e=Math.floor(10*r())-5;return Math.min(255,Math.max(0,t+e))};function U(t,r,e,n={}){const o=t.r,u=t.g,a=t.b,c=r.r,i=r.g,s=r.b,f=Math.round(o+(c-o)*e),d=Math.round(u+(i-u)*e),p=Math.round(a+(s-a)*e);if(!n.offset)return new h([f,d,p]);const l=A(n.seed);return new h([g(f,l),g(d,l),g(p,l)])}export{Y as S,_ as T,$ as U,J as W,K as X,m as l,E as x}; +import{ar as h,eu as w,P,ev as A}from"./story-Doly9N9p.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";function E(t){return"r"in t&&"g"in t&&"b"in t}function x(t){return"h"in t&&"s"in t&&"v"in t}function k(t){return"l"in t&&"a"in t&&"b"in t}function y(t){return"l"in t&&"c"in t&&"h"in t}function I(t){return"x"in t&&"y"in t&&"z"in t}const j=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],q=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function v(t,r){const e=[];let n,o;if(t[0].length!==r.length)throw new Error("dimensions do not match");const u=t.length,a=t[0].length;let c=0;for(n=0;nn<=.04045?n/12.92:((n+.055)/1.055)**2.4),e=v(j,r);return{x:100*e[0],y:100*e[1],z:100*e[2]}}function M(t){const r=v(q,[t.x/100,t.y/100,t.z/100]).map(e=>{const n=e<=.0031308?12.92*e:1.055*e**.4166666666666667-.055;return Math.min(1,Math.max(n,0))});return{r:Math.round(255*r[0]),g:Math.round(255*r[1]),b:Math.round(255*r[2])}}function H(t){const r=[t.x/95.047,t.y/100,t.z/108.883].map(e=>e>.008856451679035631?e**.3333333333333333:7.787037037037035*e+.13793103448275862);return{l:116*r[1]-16,a:500*(r[0]-r[1]),b:200*(r[1]-r[2])}}function L(t){const r=t.l,e=[(r+16)/116+t.a/500,(r+16)/116,(r+16)/116-t.b/200].map(n=>n>6/29?n**3:3*(6/29)**2*(n-4/29));return{x:95.047*e[0],y:100*e[1],z:108.883*e[2]}}function B(t){const r=t.l,e=t.a,n=t.b,o=Math.sqrt(e*e+n*n);let u=Math.atan2(n,e);return u=u>0?u:u+2*Math.PI,{l:r,c:o,h:u}}function C(t){const r=t.l,e=t.c,n=t.h;return{l:r,a:e*Math.cos(n),b:e*Math.sin(n)}}function D(t){return H(z(t))}function F(t){return M(L(t))}function G(t){return B(H(z(t)))}function O(t){return M(L(C(t)))}function Q(t){const r=t.r,e=t.g,n=t.b,o=Math.max(r,e,n),u=o-Math.min(r,e,n);let a=o,c=u===0?0:o===r?(e-n)/u%6:o===e?(n-r)/u+2:(r-e)/u+4,i=u===0?0:u/a;return c<0&&(c+=6),c*=60,i*=100,a*=100/255,{h:c,s:i,v:a}}function R(t){const r=(t.h+360)%360/60,e=t.s/100,n=t.v/100*255,o=n*e,u=o*(1-Math.abs(r%2-1));let a;switch(Math.floor(r)){case 0:a={r:o,g:u,b:0};break;case 1:a={r:u,g:o,b:0};break;case 2:a={r:0,g:o,b:u};break;case 3:a={r:0,g:u,b:o};break;case 4:a={r:u,g:0,b:o};break;case 5:case 6:a={r:o,g:0,b:u};break;default:a={r:0,g:0,b:0}}return a.r=Math.round(a.r+n-o),a.g=Math.round(a.g+n-o),a.b=Math.round(a.b+n-o),a}function m(t){return E(t)?t:y(t)?O(t):k(t)?F(t):I(t)?M(t):x(t)?R(t):t}function Y(t){return x(t)?t:Q(m(t))}function _(t){return k(t)?t:D(m(t))}function $(t){return y(t)?t:G(m(t))}function S(t,r){const{r:e,g:n,b:o}=t;return .2126*e+.7152*n+.0722*o}var b;function J(t,r=b.High){return S(t)>r?new h([0,0,0,t.a]):new h([255,255,255,t.a])}function K(t,r,e={}){if(t.length===0||r<=0)return[];if((t=t.map(n=>typeof n=="string"?new h(n):n)).length===1||r===1){const n=[],o=t[0];for(let u=0;u=r){const n=[],o=(t.length-1)/(r-1);for(let u=0;ua.clone()),...w(n,e.seed??1)]}(function(t){t[t.Low=160]="Low",t[t.High=225]="High"})(b||(b={}));const g=(t,r)=>{const e=Math.floor(10*r())-5;return Math.min(255,Math.max(0,t+e))};function U(t,r,e,n={}){const o=t.r,u=t.g,a=t.b,c=r.r,i=r.g,s=r.b,f=Math.round(o+(c-o)*e),d=Math.round(u+(i-u)*e),p=Math.round(a+(s-a)*e);if(!n.offset)return new h([f,d,p]);const l=A(n.seed);return new h([g(f,l),g(d,l),g(p,l)])}export{Y as S,_ as T,$ as U,J as W,K as X,m as l,E as x}; diff --git a/custom-toc-highlight/assets/commonProperties-BtIqvFU_-DVH0kGN9.js b/custom-toc-highlight/assets/commonProperties-BtIqvFU_-DbZji2Rx.js similarity index 98% rename from custom-toc-highlight/assets/commonProperties-BtIqvFU_-DVH0kGN9.js rename to custom-toc-highlight/assets/commonProperties-BtIqvFU_-DbZji2Rx.js index 4b8c3056..d94b5836 100644 --- a/custom-toc-highlight/assets/commonProperties-BtIqvFU_-DVH0kGN9.js +++ b/custom-toc-highlight/assets/commonProperties-BtIqvFU_-DbZji2Rx.js @@ -1 +1 @@ -import{v as n,S as i,ad as D,a0 as G,ac as O,bC as E,i as u,P as W,e as A,cs as P,cS as k,n as S,J as $}from"./story-BfX8CRfG.js";import{q}from"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";const a=(e=>e)(["operational-layers","basemap","ground"]);let y=class extends A{constructor(e){super(e),this.description=null,this.label=null,this.type=null}};n([i({type:String,json:{write:!0}})],y.prototype,"description",void 0),n([i({type:String,json:{write:!0}})],y.prototype,"label",void 0),n([i()],y.prototype,"type",void 0),y=n([u("esri.tables.elements.AttributeTableElement")],y);const d=y;var f;let c=f=class extends d{constructor(e){super(e),this.displayType="auto",this.type="attachment"}clone(){return new f({description:this.description,displayType:this.displayType,label:this.label})}};n([i({type:["auto"],json:{write:!0}})],c.prototype,"displayType",void 0),n([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],c.prototype,"type",void 0),c=f=n([u("esri.tables.elements.AttributeTableAttachmentElement")],c);const I=c;var g;let m=g=class extends d{constructor(e){super(e),this.fieldName=null,this.type="field"}clone(){return new g({description:this.description,fieldName:this.fieldName,label:this.label})}};n([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),n([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),m=g=n([u("esri.tables.elements.AttributeTableFieldElement")],m);const N=m;var v;let b=v=class extends d{constructor(e){super(e),this.relationshipId=null,this.type="relationship"}clone(){return new v({description:this.description,label:this.label,relationshipId:this.relationshipId})}};n([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),n([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=v=n([u("esri.tables.elements.AttributeTableRelationshipElement")],b);const C=b;function B(e){return{typesWithGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,group:e,relationship:C}},typesWithoutGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,relationship:C}}}}function R(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>p[o.type].fromJSON(o))}function M(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>o.toJSON())}function F(e,t,r=!0){return e?e.map(p=>P(r?t.typesWithGroup:t.typesWithoutGroup,p)):null}var j;let s=j=class extends d{constructor(e){super(e),this.elements=null,this.type="group"}castElements(e){return F(e,w,!1)}readElements(e,t){return R(t.attributeTableElements,w,!1)}writeElements(e,t){t.attributeTableElements=M(e,w,!1)}clone(){return new j({description:this.description,elements:W(this.elements),label:this.label})}};n([i({json:{write:!0}})],s.prototype,"elements",void 0),n([D("elements")],s.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],s.prototype,"readElements",null),n([O("elements")],s.prototype,"writeElements",null),n([i({type:String,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=j=n([u("esri.tables.elements.AttributeTableGroupElement")],s);const w=B(s),K=s;var T;const h=B(K);let l=T=class extends A{constructor(e){super(e),this.elements=null,this.orderByFields=null}castElements(e){return F(e,h)}readElements(e,t){return R(t.attributeTableElements,h)}writeElements(e,t){t.attributeTableElements=M(e,h)}clone(){return new T({elements:W(this.elements),orderByFields:this.orderByFields})}};n([i({json:{write:!0}})],l.prototype,"elements",void 0),n([D("elements")],l.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],l.prototype,"readElements",null),n([O("elements")],l.prototype,"writeElements",null),n([i({type:[Object],json:{write:!0}})],l.prototype,"orderByFields",void 0),l=T=n([u("esri.tables.AttributeTableTemplate")],l);const L=l,z={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:a}}},H={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,writer(e,t,r){t[r]=!e}}}},Q={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:a}}},V={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:k}}},X={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:a}}},Y={value:null,type:q,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:a}}};function Z(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const J={write:{enabled:!0,layerContainerTypes:a},read:!0},x={type:Number,json:{origins:{"web-document":J,"portal-item":{write:!0}}}},ee={...x,json:{...x.json,origins:{"web-document":{...J,write:{enabled:!0,layerContainerTypes:a,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,t,r)=>r&&r.origin!=="service"||!t.drawingInfo||t.drawingInfo.transparency===void 0?t.layerDefinition?.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0?E(t.layerDefinition.drawingInfo.transparency):void 0:E(t.drawingInfo.transparency)}}},te={type:S,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,t)=>{const r=S.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference=="object"&&(r.spatialReference=$.fromJSON(t.spatialReference)),r}}}},read:!1}},ne={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},re={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.minScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.minScale",write:!0}},ie={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.maxScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.maxScale",write:!0}},se={json:{write:{ignoreOrigin:!0,layerContainerTypes:a},origins:{"web-map":{read:!1,write:!1}}}},ae={type:L,json:{name:"attributeTableInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}};export{Y as $,x as E,Z as H,L as J,ee as K,te as Q,z as V,H as X,Q as Y,V as Z,X as _,ne as e,ae as i,ie as n,se as r,a as s,re as t}; +import{v as n,S as i,ad as D,a0 as G,ac as O,bC as E,i as u,P as W,e as A,cs as P,cS as k,n as S,J as $}from"./story-Doly9N9p.js";import{q}from"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";const a=(e=>e)(["operational-layers","basemap","ground"]);let y=class extends A{constructor(e){super(e),this.description=null,this.label=null,this.type=null}};n([i({type:String,json:{write:!0}})],y.prototype,"description",void 0),n([i({type:String,json:{write:!0}})],y.prototype,"label",void 0),n([i()],y.prototype,"type",void 0),y=n([u("esri.tables.elements.AttributeTableElement")],y);const d=y;var f;let c=f=class extends d{constructor(e){super(e),this.displayType="auto",this.type="attachment"}clone(){return new f({description:this.description,displayType:this.displayType,label:this.label})}};n([i({type:["auto"],json:{write:!0}})],c.prototype,"displayType",void 0),n([i({type:["attachment"],readOnly:!0,json:{read:!1,write:!0}})],c.prototype,"type",void 0),c=f=n([u("esri.tables.elements.AttributeTableAttachmentElement")],c);const I=c;var g;let m=g=class extends d{constructor(e){super(e),this.fieldName=null,this.type="field"}clone(){return new g({description:this.description,fieldName:this.fieldName,label:this.label})}};n([i({type:String,json:{write:!0}})],m.prototype,"fieldName",void 0),n([i({type:String,json:{read:!1,write:!0}})],m.prototype,"type",void 0),m=g=n([u("esri.tables.elements.AttributeTableFieldElement")],m);const N=m;var v;let b=v=class extends d{constructor(e){super(e),this.relationshipId=null,this.type="relationship"}clone(){return new v({description:this.description,label:this.label,relationshipId:this.relationshipId})}};n([i({type:Number,json:{write:!0}})],b.prototype,"relationshipId",void 0),n([i({type:["relationship"],json:{read:!1,write:!0}})],b.prototype,"type",void 0),b=v=n([u("esri.tables.elements.AttributeTableRelationshipElement")],b);const C=b;function B(e){return{typesWithGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,group:e,relationship:C}},typesWithoutGroup:{base:d,key:"type",typeMap:{attachment:I,field:N,relationship:C}}}}function R(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>p[o.type].fromJSON(o))}function M(e,t,r=!0){if(!e)return null;const p=r?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(o=>p[o.type]).map(o=>o.toJSON())}function F(e,t,r=!0){return e?e.map(p=>P(r?t.typesWithGroup:t.typesWithoutGroup,p)):null}var j;let s=j=class extends d{constructor(e){super(e),this.elements=null,this.type="group"}castElements(e){return F(e,w,!1)}readElements(e,t){return R(t.attributeTableElements,w,!1)}writeElements(e,t){t.attributeTableElements=M(e,w,!1)}clone(){return new j({description:this.description,elements:W(this.elements),label:this.label})}};n([i({json:{write:!0}})],s.prototype,"elements",void 0),n([D("elements")],s.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],s.prototype,"readElements",null),n([O("elements")],s.prototype,"writeElements",null),n([i({type:String,json:{read:!1,write:!0}})],s.prototype,"type",void 0),s=j=n([u("esri.tables.elements.AttributeTableGroupElement")],s);const w=B(s),K=s;var T;const h=B(K);let l=T=class extends A{constructor(e){super(e),this.elements=null,this.orderByFields=null}castElements(e){return F(e,h)}readElements(e,t){return R(t.attributeTableElements,h)}writeElements(e,t){t.attributeTableElements=M(e,h)}clone(){return new T({elements:W(this.elements),orderByFields:this.orderByFields})}};n([i({json:{write:!0}})],l.prototype,"elements",void 0),n([D("elements")],l.prototype,"castElements",null),n([G("elements",["attributeTableElements"])],l.prototype,"readElements",null),n([O("elements")],l.prototype,"writeElements",null),n([i({type:[Object],json:{write:!0}})],l.prototype,"orderByFields",void 0),l=T=n([u("esri.tables.AttributeTableTemplate")],l);const L=l,z={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:a}}},H={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,writer(e,t,r){t[r]=!e}}}},Q={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:a}}},V={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:k}}},X={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:a}}},Y={value:null,type:q,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:a}}};function Z(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const J={write:{enabled:!0,layerContainerTypes:a},read:!0},x={type:Number,json:{origins:{"web-document":J,"portal-item":{write:!0}}}},ee={...x,json:{...x.json,origins:{"web-document":{...J,write:{enabled:!0,layerContainerTypes:a,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,t,r)=>r&&r.origin!=="service"||!t.drawingInfo||t.drawingInfo.transparency===void 0?t.layerDefinition?.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0?E(t.layerDefinition.drawingInfo.transparency):void 0:E(t.drawingInfo.transparency)}}},te={type:S,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,t)=>{const r=S.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference=="object"&&(r.spatialReference=$.fromJSON(t.spatialReference)),r}}}},read:!1}},ne={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},re={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.minScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.minScale",write:!0}},ie={type:Number,json:{origins:{service:{write:{enabled:!1}},"web-scene":{name:"layerDefinition.maxScale",write:{enabled:!0,layerContainerTypes:a}}},name:"layerDefinition.maxScale",write:!0}},se={json:{write:{ignoreOrigin:!0,layerContainerTypes:a},origins:{"web-map":{read:!1,write:!1}}}},ae={type:L,json:{name:"attributeTableInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}};export{Y as $,x as E,Z as H,L as J,ee as K,te as Q,z as V,H as X,Q as Y,V as Z,X as _,ne as e,ae as i,ie as n,se as r,a as s,re as t}; diff --git a/custom-toc-highlight/assets/compilerUtils-CV1QYWI8-C9dYdAV0.js b/custom-toc-highlight/assets/compilerUtils-CV1QYWI8-C9dYdAV0.js deleted file mode 100644 index 9df2b88f..00000000 --- a/custom-toc-highlight/assets/compilerUtils-CV1QYWI8-C9dYdAV0.js +++ /dev/null @@ -1 +0,0 @@ -import"./story-BfX8CRfG.js";function o(n){}function r(n){return()=>n}export{r as o,o as t}; diff --git a/custom-toc-highlight/assets/compilerUtils-CV1QYWI8-VdY86_Y-.js b/custom-toc-highlight/assets/compilerUtils-CV1QYWI8-VdY86_Y-.js new file mode 100644 index 00000000..cfa2793e --- /dev/null +++ b/custom-toc-highlight/assets/compilerUtils-CV1QYWI8-VdY86_Y-.js @@ -0,0 +1 @@ +import"./story-Doly9N9p.js";function o(n){}function r(n){return()=>n}export{r as o,o as t}; diff --git a/custom-toc-highlight/assets/computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js b/custom-toc-highlight/assets/computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js similarity index 78% rename from custom-toc-highlight/assets/computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js rename to custom-toc-highlight/assets/computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js index 221d3aed..e51fbce8 100644 --- a/custom-toc-highlight/assets/computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js +++ b/custom-toc-highlight/assets/computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js @@ -1 +1 @@ -import{aC as O,bj as S,dg as R}from"./story-BfX8CRfG.js";import{J as G,Z as M,G as P}from"./mat4-DX7gBViE-DVqdGrVU.js";import{F as e,l as s,e as T,N as r,L as i}from"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";function N(o,E,t){const A=Math.sin(o),L=Math.cos(o),a=Math.sin(E),c=Math.cos(E),n=t;return n[0]=-A,n[4]=-a*L,n[8]=c*L,n[12]=0,n[1]=L,n[5]=-a*A,n[9]=c*A,n[13]=0,n[2]=0,n[6]=c,n[10]=a,n[14]=0,n[3]=0,n[7]=0,n[11]=0,n[15]=1,n}function W(o,E,t){return N(o,E,t),P(t,t),t}function p(o,E,t,A){if(o==null||A==null)return!1;const L=e(o,s),a=e(A,T);if(L===a&&!C(a)&&(L!==r.UNKNOWN||O(o,A)))return G(t,E),!0;if(C(a)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),N(u*_[0],u*_[1],t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}const c=C(L);if((a===r.WEB_MERCATOR||a===r.PLATE_CARREE||a===r.WGS84||a===r.CGCS2000)&&(L===r.WGS84||c||L===r.WEB_MERCATOR||L===r.CGCS2000)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),c?W(u*_[0],u*_[1],t):M(t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}return!1}function C(o){return o===r.SPHERICAL_ECEF||o===r.SPHERICAL_MARS_PCPF||o===r.SPHERICAL_MOON_PCPF||o===r.WGS84_ECEF}const u=S(1),_=R(),l=R();export{p as G}; +import{aC as O,bj as S,dg as R}from"./story-Doly9N9p.js";import{J as G,Z as M,G as P}from"./mat4-DX7gBViE-6clJxb1Q.js";import{F as e,l as s,e as T,N as r,L as i}from"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";function N(o,E,t){const A=Math.sin(o),L=Math.cos(o),a=Math.sin(E),c=Math.cos(E),n=t;return n[0]=-A,n[4]=-a*L,n[8]=c*L,n[12]=0,n[1]=L,n[5]=-a*A,n[9]=c*A,n[13]=0,n[2]=0,n[6]=c,n[10]=a,n[14]=0,n[3]=0,n[7]=0,n[11]=0,n[15]=1,n}function W(o,E,t){return N(o,E,t),P(t,t),t}function p(o,E,t,A){if(o==null||A==null)return!1;const L=e(o,s),a=e(A,T);if(L===a&&!C(a)&&(L!==r.UNKNOWN||O(o,A)))return G(t,E),!0;if(C(a)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),N(u*_[0],u*_[1],t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}const c=C(L);if((a===r.WEB_MERCATOR||a===r.PLATE_CARREE||a===r.WGS84||a===r.CGCS2000)&&(L===r.WGS84||c||L===r.WEB_MERCATOR||L===r.CGCS2000)){const n=i[L][r.LON_LAT],f=i[r.LON_LAT][a];return n!=null&&f!=null&&(n(E,0,_,0),f(_,0,l,0),c?W(u*_[0],u*_[1],t):M(t),t[12]=l[0],t[13]=l[1],t[14]=l[2],!0)}return!1}function C(o){return o===r.SPHERICAL_ECEF||o===r.SPHERICAL_MARS_PCPF||o===r.SPHERICAL_MOON_PCPF||o===r.WGS84_ECEF}const u=S(1),_=R(),l=R();export{p as G}; diff --git a/custom-toc-highlight/assets/conditionalSlot-DsCzytJ4-8LGFSrPC.js b/custom-toc-highlight/assets/conditionalSlot-DsCzytJ4-DM7mn4Oa.js similarity index 55% rename from custom-toc-highlight/assets/conditionalSlot-DsCzytJ4-8LGFSrPC.js rename to custom-toc-highlight/assets/conditionalSlot-DsCzytJ4-DM7mn4Oa.js index 6769b21f..5a2d92d2 100644 --- a/custom-toc-highlight/assets/conditionalSlot-DsCzytJ4-8LGFSrPC.js +++ b/custom-toc-highlight/assets/conditionalSlot-DsCzytJ4-DM7mn4Oa.js @@ -1 +1 @@ -import{n as i}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{c}from"./observers-BigwqTsw-BNRQivHR.js";let t;const e={childList:!0};function a(o){t||(t=c("mutation",r)),t.observe(o.el,e)}function m(o){t.unobserve(o.el)}function r(o){o.forEach(({target:n})=>{i(n)})}export{m as c,a as s}; +import{n as i}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{c}from"./observers-BigwqTsw-CfIXp3Nz.js";let t;const e={childList:!0};function a(o){t||(t=c("mutation",r)),t.observe(o.el,e)}function m(o){t.unobserve(o.el)}function r(o){o.forEach(({target:n})=>{i(n)})}export{m as c,a as s}; diff --git a/custom-toc-highlight/assets/convertMeshVertexSpace-BO7NR5uA-DNqSWhor.js b/custom-toc-highlight/assets/convertMeshVertexSpace-BO7NR5uA-DNqSWhor.js deleted file mode 100644 index 686bef51..00000000 --- a/custom-toc-highlight/assets/convertMeshVertexSpace-BO7NR5uA-DNqSWhor.js +++ /dev/null @@ -1 +0,0 @@ -import{$ as m,o as s,P as p}from"./story-BfX8CRfG.js";import{o as n}from"./MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js";import{b as c}from"./vertexSpaceConversion-CiKaVq_u-D2kQTb17.js";import"./main-ugzBrWNm.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./projectPointToVector-B2UUY9SE-BChPjj6-.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js";import"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import"./vec3-BazNroeq-PdcGTXFi.js";import"./BufferView-PQoE3GL7-Duht5lAO.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-BagfV9qf.js";async function k(o,r,t){await Promise.resolve(),m(t);const i=c(o,r,{useEllipsoid:t?.useEllipsoid});if(!i)throw new s("meshUtils:convertVertexSpace()","Failed to convert to provided vertex space due to projection errors");const e=o.cloneAndModifyVertexAttributes(new n({...i,uv:p(o.vertexAttributes.uv),color:p(o.vertexAttributes.color)}),r);return e.transform=null,e}export{k as convertMeshVertexSpace}; diff --git a/custom-toc-highlight/assets/convertMeshVertexSpace-BO7NR5uA-DneeGgyd.js b/custom-toc-highlight/assets/convertMeshVertexSpace-BO7NR5uA-DneeGgyd.js new file mode 100644 index 00000000..e4202694 --- /dev/null +++ b/custom-toc-highlight/assets/convertMeshVertexSpace-BO7NR5uA-DneeGgyd.js @@ -0,0 +1 @@ +import{$ as m,o as s,P as p}from"./story-Doly9N9p.js";import{o as n}from"./MeshVertexAttributes-CbNpPur2-c8zcl8rF.js";import{b as c}from"./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js";import"./main-QGPoLsvl.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./projectPointToVector-B2UUY9SE-BIKNGLey.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js";import"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import"./vec3-BazNroeq-CRjQH4Pj.js";import"./BufferView-PQoE3GL7-B9DLdqO9.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4-DWDdg1fj-BHg6FqkT.js";async function k(o,r,t){await Promise.resolve(),m(t);const i=c(o,r,{useEllipsoid:t?.useEllipsoid});if(!i)throw new s("meshUtils:convertVertexSpace()","Failed to convert to provided vertex space due to projection errors");const e=o.cloneAndModifyVertexAttributes(new n({...i,uv:p(o.vertexAttributes.uv),color:p(o.vertexAttributes.color)}),r);return e.transform=null,e}export{k as convertMeshVertexSpace}; diff --git a/custom-toc-highlight/assets/createConnection-CrkuTLXs-DgS-Wx7n.js b/custom-toc-highlight/assets/createConnection-CrkuTLXs-CK5s-xN-.js similarity index 74% rename from custom-toc-highlight/assets/createConnection-CrkuTLXs-DgS-Wx7n.js rename to custom-toc-highlight/assets/createConnection-CrkuTLXs-CK5s-xN-.js index 8ae9c2fa..38b12826 100644 --- a/custom-toc-highlight/assets/createConnection-CrkuTLXs-DgS-Wx7n.js +++ b/custom-toc-highlight/assets/createConnection-CrkuTLXs-CK5s-xN-.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FeatureLayer-BrRKw5Si-D6Z5CL70.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-BfX8CRfG.js","./story-D5JOvNzl.css","./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js","./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js","./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js","./colorRamps-q0bZVhs2-DQZn2xZS.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-23qzp7zg.js","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./lengthUtils-DKpMe5qR-C2NPRwwl.js","./styleUtils-BtpNqZyT-D2Hj1Rgz.js","./jsonUtils-C64Zfu7c-CitE8NjK.js","./LRUCache-C3erQTWv-0wD6drRf.js","./Version-CoKzbupV-9-gg6ENz.js","./FieldsIndex-HmzMbJQG-DZuFWLvd.js","./UnknownTimeZone-C--TOcPG-D3CAoWPX.js","./OverrideHelper-DWRbVlj1-BZq72sbX.js","./colorUtils-Cthpxcks-ZRnr1H1b.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-B3hR8LxB.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-B-lEhyoX.js","./heatmapUtils-seiMkkkR-Cj1KmweL.js","./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js","./commonProperties-BtIqvFU_-DVH0kGN9.js","./ElevationInfo-yv2-9tj6-C2hC6Vpl.js","./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./HeightModelInfo-C5vFqzyF-CupKpfDx.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-DoFNfkjX.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./RelationshipQuery-DJsz3K0U-yAwL-qLW.js","./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js","./Relationship-PyhUibYK-BgFx3_5x.js","./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js","./Layer-ChoECxvZ-CQTFmFQa.js","./workers-PiCjreoO-idkDTJa3.js","./editsZScale-BDsX6vv--CttUpViY.js","./queryZScale-BiYV6Pr6-B5UMbu5B.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./FeatureSet-BkVNthuN-CwS44--W.js","./APIKeyMixin-BUMSx9ny-D_H-H5sI.js","./ArcGISService-BYA-y6X6-C_YhndKK.js","./BlendLayer-D1WkSmwP-Bad8_eoW.js","./jsonUtils-wIllKWI4-DrGIvCCq.js","./parser-DyDJ-rlI-C9jRH52J.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-DVqdGrVU.js","./CustomParametersMixin-vdKsTHer-BOFVTNLw.js","./EditBusLayer-Df29OyJh-DkVkxUAl.js","./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js","./FeatureEffect-CDEk9Es7-CEiHf7-6.js","./FeatureFilter-BCFHgLVU-CXZvxasm.js","./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js","./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js","./labelingInfo-DGVNul26-zkvIaBlq.js","./labelUtils-BW14kBqX-BkXd4VJn.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-9OHGXI1g.js","./OrderedLayer-6Qsmrd_l-BG3Yganz.js","./OrderByInfo-GD2XnU8e-NtCi3yT-.js","./PortalLayer-CElnYuSQ-DvpreqYV.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js","./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js","./TemporalLayer-CpOrN_w9-BDEJ3v2O.js","./TimeInfo-w_HB2CsF-CZutzBPZ.js","./FeatureTemplate-SPHPD45f-DFBQobBO.js","./FeatureType-C9hJmS6_-BXWT6QCe.js","./fieldProperties-Bq26w7gt-CFQbsGDX.js","./versionUtils-LZYZz-38-DxOZEoAg.js","./styleUtils-ChrJTYIw-BfDrXrWd.js","./popupUtils-B0uZcXX0-DtBp-byj.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js"])))=>i.map(i=>d[i]); -import{_ as L}from"./main-ugzBrWNm.js";import{I as N,o as c,v as d,S as _,i as m,y as b,a1 as a,az as O,b as k,f as x,g as E,J as P}from"./story-BfX8CRfG.js";import{o as v}from"./projection-BA9M1R7d-BYoCXVXt.js";import{q as S}from"./query-DFW9-NG_-gbjlxRZk.js";import{b as q}from"./Query-BrwMGK8U-DoFNfkjX.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";let p=class extends N.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new c("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};d([_({readOnly:!0})],p.prototype,"connectionError",null),p=d([m("esri.layers.support.StreamConnection")],p);const F=p;var g;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(g||(g={}));let f=class extends F{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:o}=e;this._config=e,this._featureZScaler=v(t,o,r),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(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(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(e){this._websocket!=null?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const o=b(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).error(new c("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(a.getLogger(this).error(new c("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,o)),await O(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=t=>{try{const r=JSON.parse(t.data);this._onMessage(r)}catch(r){return void a.getLogger(this).error(new c("websocket-connection","Failed to parse message, invalid JSON",{error:r}))}}}_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),this._setWebSocketJSONParseHandler(o),t(o)},o.onclose=s=>{o.onopen=o.onclose=null,r(s)}})}async _handshake(e=1e4){const t=this._websocket;if(t==null)return;const r=k(),o=t.onmessage,{filter:s,outFields:n,spatialReference:u}=this._config;return r.timeout(e),t.onmessage=h=>{let l=null;try{l=JSON.parse(h.data)}catch{}l&&typeof l=="object"||(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - malformed message",h.data)),r.reject(),this.destroy()),l.spatialReference?.wkid!==u?.wkid&&(a.getLogger(this).error(new c("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${u.wkid}`,h.data)),r.reject(),this.destroy()),l.format!=="json"&&(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - format is not set",h.data)),r.reject(),this.destroy()),s&&l.filter!==s&&a.getLogger(this).error(new c("websocket-connection","Tried to set filter, but server doesn't support it")),n&&l.outFields!==n&&a.getLogger(this).error(new c("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=o;for(const i of this._outstandingMessages)t.send(JSON.stringify(i));this._outstandingMessages=[],r.resolve()},t.send(JSON.stringify({filter:s,outFields:n,format:"json",spatialReference:{wkid:u.wkid}})),r.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),a.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&a.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};d([_()],f.prototype,"connectionStatus",null),d([_()],f.prototype,"errorString",void 0),f=d([m("esri.layers.graphics.sources.connections.WebSocketConnection")],f);const M=1e4,T={maxQueryDepth:5,maxRecordCountFactor:3};let w=class extends f{constructor(e){super({...T,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||a.getLogger(this).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){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void a.getLogger(this).error(new c("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=x(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 b(`${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).error(new c("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const o=JSON.stringify({filter:this._serializeFilter(e,t)});let s=!1;const n=k(),u=()=>{s||(this.destroyed||this._websocket!==r||a.getLogger(this).error(new c("geoevent-connection","Server timed out when setting filter")),n.reject())},h=l=>{const i=JSON.parse(l.data);i.filter&&(i.error&&(a.getLogger(this).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)),this._setWebSocketJSONParseHandler(r),s=!0,n.resolve())};return r.onmessage=h,r.send(o),setTimeout(u,M),n.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e?.geometry)try{const o=E(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).error(new c("geoevent-connection","Encountered an error when setting connection geometryDefinition",o))}return e?.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],o=this._relatedFeatures.get(r);if(!o)return a.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:s,geometry:n}=o;for(const u in s)e.attributes[u]=s[u];return n&&(e.geometry=n),e.geometry||e.centroid||a.getLogger(this).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).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 L(async()=>{const{default:R}=await import("./FeatureLayer-BrRKw5Si-D6Z5CL70.js");return{default:R}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]),import.meta.url)).default({url:e}),{capabilities:r}=await t.load(),o=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,n=r.query.supportsCentroid,u=this._config.maxRecordCountFactor,h=t.capabilities.query.maxRecordCount,l=o?h*u:h,i=new q;if(i.outFields=this._config.outFields??["*"],i.where=this._config.filter?.where??"1=1",i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=P.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),o&&(i.maxRecordCountFactor=u),s)return i.num=l,t.destroy(),this._queryPages(e,i);const C=await S(e,i,this._config.sourceSpatialReference);return t.destroy(),C.data}async _queryPages(e,t,r=[],o=0){t.start=t.num!=null?o*t.num:null;const{data:s}=await S(e,t,this._config.sourceSpatialReference);return s.exceededTransferLimit&&o<(this._config.maxQueryDepth??0)?(s.features.forEach(n=>r.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}};w=d([m("esri.layers.graphics.sources.connections.GeoEventConnection")],w);const W=w;let y=class extends F{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:o}=e;this._featureZScaler=v(t,o,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};d([_()],y.prototype,"connectionStatus",void 0),d([_()],y.prototype,"errorString",void 0),y=d([m("esri.layers.support.ClientSideConnection")],y);function I(e,t){if(e==null&&t==null)return null;const r={};return t!=null&&(r.geometry=t),e!=null&&(r.where=e),r}function re(e,t,r,o,s,n,u,h,l){const i={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:o,filter:I(s,n),maxReconnectionAttempts:u,maxReconnectionInterval:h,customParameters:l};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new f(i):new W(i):new y(i)}export{re as createConnection}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FeatureLayer-BrRKw5Si-DuA2fyE_.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-Doly9N9p.js","./story-DbFhYdqg.css","./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js","./RendererLegendOptions-K3md58-X-JLOOdHLz.js","./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js","./colorRamps-q0bZVhs2-BnivlaV9.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-tyrXoPjU.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js","./styleUtils-BtpNqZyT-Bnq2S5kK.js","./jsonUtils-C64Zfu7c-BtrwAD3_.js","./LRUCache-C3erQTWv-grHgYSP-.js","./Version-CoKzbupV-BDyz4v43.js","./FieldsIndex-HmzMbJQG-Du7S47uJ.js","./UnknownTimeZone-C--TOcPG-9of9030I.js","./OverrideHelper-DWRbVlj1-BnPmqHJ3.js","./colorUtils-Cthpxcks-cHaMZbaf.js","./vec42-D8CJyqHG-DnfLTeQH.js","./common-CYWrYyJl-E8-sukrT.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-CiwW7WzR.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-DFYZs_ns.js","./heatmapUtils-seiMkkkR-CrSLbaQx.js","./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js","./commonProperties-BtIqvFU_-DbZji2Rx.js","./ElevationInfo-yv2-9tj6-CkIHeL1t.js","./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./HeightModelInfo-C5vFqzyF-BH6aliHn.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-BPr0_G9t.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./RelationshipQuery-DJsz3K0U-BKFa46R1.js","./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js","./Relationship-PyhUibYK-DN6K3ukS.js","./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js","./Layer-ChoECxvZ-BmDHBjO8.js","./workers-PiCjreoO-Dc6Tqm-o.js","./editsZScale-BDsX6vv--C-4n90TZ.js","./queryZScale-BiYV6Pr6-B7zp5L1G.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./FeatureSet-BkVNthuN-DPQqwkNN.js","./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js","./ArcGISService-BYA-y6X6-DNHMEBm_.js","./BlendLayer-D1WkSmwP-BeUsb4u9.js","./jsonUtils-wIllKWI4-MQQ-E5fj.js","./parser-DyDJ-rlI-CvOs11Ip.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-6clJxb1Q.js","./CustomParametersMixin-vdKsTHer-5EfrrVMH.js","./EditBusLayer-Df29OyJh-OmdJOLws.js","./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js","./FeatureEffect-CDEk9Es7-Cd4-I1fy.js","./FeatureFilter-BCFHgLVU-DwigNbnH.js","./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js","./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js","./labelingInfo-DGVNul26-BDBqWm17.js","./labelUtils-BW14kBqX-Tk7uOiPw.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OperationalLayer-B5IXiMa2-DTTV2F9z.js","./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js","./OrderByInfo-GD2XnU8e-BaEpZLaO.js","./PortalLayer-CElnYuSQ-CCe4TMEA.js","./PortalItem-CctGdnxF-CfFOGshS.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./RefreshableLayer-a8BQ58Xh-CxfquKbp.js","./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js","./TemporalLayer-CpOrN_w9-8nvJFP_-.js","./TimeInfo-w_HB2CsF-B2qHZyfS.js","./FeatureTemplate-SPHPD45f-CZ7E6_6b.js","./FeatureType-C9hJmS6_-CNlvn5D1.js","./fieldProperties-Bq26w7gt-BiKrD4ue.js","./versionUtils-LZYZz-38-B8C5OAjF.js","./styleUtils-ChrJTYIw-C6xq7Jeu.js","./popupUtils-B0uZcXX0-DHyOz1jC.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js"])))=>i.map(i=>d[i]); +import{_ as L}from"./main-QGPoLsvl.js";import{I as N,o as c,v as d,S as _,i as m,y as b,a1 as a,az as O,b as k,f as x,g as E,J as P}from"./story-Doly9N9p.js";import{o as v}from"./projection-BA9M1R7d-CAbqHZiw.js";import{q as S}from"./query-DFW9-NG_-C3TyGmiM.js";import{b as q}from"./Query-BrwMGK8U-BPr0_G9t.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";let p=class extends N.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new c("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}onMessage(e){this.emit("message-received",e)}};d([_({readOnly:!0})],p.prototype,"connectionError",null),p=d([m("esri.layers.support.StreamConnection")],p);const F=p;var g;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(g||(g={}));let f=class extends F{constructor(e){super({}),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:o}=e;this._config=e,this._featureZScaler=v(t,o,r),this._open()}normalizeCtorArgs(){return{}}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),this._websocket!=null&&(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(this._websocket==null)return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessageToSocket(e){this._websocket!=null?this._websocket.send(JSON.stringify(e)):this._outstandingMessages.push(e)}sendMessageToClient(e){this._onMessage(e)}updateCustomParameters(e){this._config.customParameters=e,this._websocket!=null&&this._websocket.close()}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const o=b(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).error(new c("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(a.getLogger(this).error(new c("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,o)),await O(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_setWebSocketJSONParseHandler(e){e.onmessage=t=>{try{const r=JSON.parse(t.data);this._onMessage(r)}catch(r){return void a.getLogger(this).error(new c("websocket-connection","Failed to parse message, invalid JSON",{error:r}))}}}_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),this._setWebSocketJSONParseHandler(o),t(o)},o.onclose=s=>{o.onopen=o.onclose=null,r(s)}})}async _handshake(e=1e4){const t=this._websocket;if(t==null)return;const r=k(),o=t.onmessage,{filter:s,outFields:n,spatialReference:u}=this._config;return r.timeout(e),t.onmessage=h=>{let l=null;try{l=JSON.parse(h.data)}catch{}l&&typeof l=="object"||(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - malformed message",h.data)),r.reject(),this.destroy()),l.spatialReference?.wkid!==u?.wkid&&(a.getLogger(this).error(new c("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${u.wkid}`,h.data)),r.reject(),this.destroy()),l.format!=="json"&&(a.getLogger(this).error(new c("websocket-connection","Protocol violation. Handshake failed - format is not set",h.data)),r.reject(),this.destroy()),s&&l.filter!==s&&a.getLogger(this).error(new c("websocket-connection","Tried to set filter, but server doesn't support it")),n&&l.outFields!==n&&a.getLogger(this).error(new c("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=o;for(const i of this._outstandingMessages)t.send(JSON.stringify(i));this._outstandingMessages=[],r.resolve()},t.send(JSON.stringify({filter:s,outFields:n,format:"json",spatialReference:{wkid:u.wkid}})),r.promise}_onMessage(e){if(this.onMessage(e),"type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),a.getLogger(this).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&a.getLogger(this).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};d([_()],f.prototype,"connectionStatus",null),d([_()],f.prototype,"errorString",void 0),f=d([m("esri.layers.graphics.sources.connections.WebSocketConnection")],f);const M=1e4,T={maxQueryDepth:5,maxRecordCountFactor:3};let w=class extends f{constructor(e){super({...T,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||a.getLogger(this).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){if("attributes"in e){let t;try{t=this._enrich(e),this._featureZScaler!=null&&this._featureZScaler(t.geometry)}catch(r){return void a.getLogger(this).error(new c("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}else this.onMessage(e)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=x(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 b(`${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).error(new c("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(r==null||e==null&&t==null)return;const o=JSON.stringify({filter:this._serializeFilter(e,t)});let s=!1;const n=k(),u=()=>{s||(this.destroyed||this._websocket!==r||a.getLogger(this).error(new c("geoevent-connection","Server timed out when setting filter")),n.reject())},h=l=>{const i=JSON.parse(l.data);i.filter&&(i.error&&(a.getLogger(this).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)),this._setWebSocketJSONParseHandler(r),s=!0,n.resolve())};return r.onmessage=h,r.send(o),setTimeout(u,M),n.promise}_serializeFilter(e,t){const r={};if(e==null&&t==null)return r;if(e?.geometry)try{const o=E(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).error(new c("geoevent-connection","Encountered an error when setting connection geometryDefinition",o))}return e?.where&&e.where!=="1 = 1"&&e.where!=="1=1"&&(r.where=e.where),t!=null&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t],o=this._relatedFeatures.get(r);if(!o)return a.getLogger(this).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:s,geometry:n}=o;for(const u in s)e.attributes[u]=s[u];return n&&(e.geometry=n),e.geometry||e.centroid||a.getLogger(this).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).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 L(async()=>{const{default:R}=await import("./FeatureLayer-BrRKw5Si-DuA2fyE_.js");return{default:R}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85]),import.meta.url)).default({url:e}),{capabilities:r}=await t.load(),o=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,n=r.query.supportsCentroid,u=this._config.maxRecordCountFactor,h=t.capabilities.query.maxRecordCount,l=o?h*u:h,i=new q;if(i.outFields=this._config.outFields??["*"],i.where=this._config.filter?.where??"1=1",i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=P.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),o&&(i.maxRecordCountFactor=u),s)return i.num=l,t.destroy(),this._queryPages(e,i);const C=await S(e,i,this._config.sourceSpatialReference);return t.destroy(),C.data}async _queryPages(e,t,r=[],o=0){t.start=t.num!=null?o*t.num:null;const{data:s}=await S(e,t,this._config.sourceSpatialReference);return s.exceededTransferLimit&&o<(this._config.maxQueryDepth??0)?(s.features.forEach(n=>r.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}};w=d([m("esri.layers.graphics.sources.connections.GeoEventConnection")],w);const W=w;let y=class extends F{constructor(e){super({}),this.connectionStatus="connected",this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:o}=e;this._featureZScaler=v(t,o,r)}normalizeCtorArgs(){return{}}updateCustomParameters(e){}sendMessageToSocket(e){}sendMessageToClient(e){if("type"in e)switch(e.type){case"features":case"featureResult":for(const t of e.features)this._featureZScaler!=null&&this._featureZScaler(t.geometry),this.onFeature(t)}this.onMessage(e)}};d([_()],y.prototype,"connectionStatus",void 0),d([_()],y.prototype,"errorString",void 0),y=d([m("esri.layers.support.ClientSideConnection")],y);function I(e,t){if(e==null&&t==null)return null;const r={};return t!=null&&(r.geometry=t),e!=null&&(r.where=e),r}function re(e,t,r,o,s,n,u,h,l){const i={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:o,filter:I(s,n),maxReconnectionAttempts:u,maxReconnectionInterval:h,customParameters:l};return e?e.path.startsWith("wss://")||e.path.startsWith("ws://")?new f(i):new W(i):new y(i)}export{re as createConnection}; diff --git a/custom-toc-highlight/assets/dataUtils-BkPy4R3C-Cb9EIxnj.js b/custom-toc-highlight/assets/dataUtils-BkPy4R3C-Dzc1QGGb.js similarity index 99% rename from custom-toc-highlight/assets/dataUtils-BkPy4R3C-Cb9EIxnj.js rename to custom-toc-highlight/assets/dataUtils-BkPy4R3C-Dzc1QGGb.js index 34f3aada..5c7236f0 100644 --- a/custom-toc-highlight/assets/dataUtils-BkPy4R3C-Cb9EIxnj.js +++ b/custom-toc-highlight/assets/dataUtils-BkPy4R3C-Dzc1QGGb.js @@ -1 +1 @@ -import{v as O,S as $,ad as _t,i as Dt,aK as Rt,e as Lt,o as Nt,P as Et,a1 as Z,K as et,$ as jt,eE as At,aG as Gt,n as Ot,bj as Wt}from"./story-BfX8CRfG.js";let bt=class{constructor(t=null,e=null,n=null){this.minValue=t,this.maxValue=e,this.noDataValue=n}};const $t=9999999e31,qt=2e-7,zt={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:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function lt(t){return zt[t]??[-34028234663852886e22,34028234663852886e22]}function ke(t,e){return t==null||e==null?"s32":t<0?t>=-128&&e<128?"s8":t>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function Kt(t){return(t?.startsWith("s")||t?.startsWith("u"))??!1}function Me(t,e,n,r){let[o,s]=lt(n);const i=Kt(n);return i&&(o-=1e-5,s+=1e-5),i?n.startsWith("u")?Xt(t,e,r,[o,s]):Jt(t,e,r,[o,s]):Ht(t,e,r,[o,s])}function Ae(t,e){for(let n=0;ns?e[i]=0:n[i]=c+.5|0}}function Jt(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c+(c>0?.5:-.5)|0}}function Ht(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c}}function be(t,e,n){if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:o,pixelType:s}=t,i=r[0].length,c=t.bandMasks??[],a=t.mask??new Uint8Array(i).fill(255),h=s==="f32"||s==="f64",l=lt(s);let f=!1;for(let p=0;pu+Number.EPSILON||d=$t?qt*Math.abs(u):s==="f32"?2**-23:Number.EPSILON);for(let w=0;w1?c:null,t.mask=a),f&&"updateStatistics"in t&&t.updateStatistics()}var J;let G=J=class extends Lt{static createEmptyBand(t,e){return new(J.getPixelArrayConstructor(t))(e)}static combineBandMasks(t){if(t.length<2)return t[0];const e=t[0].length,n=new Uint8Array(e).fill(255);for(let r=0;rYt(n,this.mask));const t=this.mask;let e=0;if(t!=null)for(let n=0;nn?n:cf>=e.length),s=r===t.length&&!t.some((f,p)=>f!==p);if(o||s)return this;const i=this.bandMasks?.length===r?t.map(f=>this.bandMasks[f]):void 0;let{mask:c,validPixelCount:a}=this;const{width:h,height:l}=this;return i?.length&&(c=J.combineBandMasks(i),a=c.filter(f=>!!f).length),new J({pixelType:this.pixelType,width:h,height:l,mask:c,bandMasks:i,validPixelCount:a,maskIsAlpha:this.maskIsAlpha,pixels:t.map(f=>e[f]),statistics:n&&t.map(f=>n[f])})}clone(){const t=new J({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(t.mask=new Uint8Array(this.mask)),this.bandMasks&&(t.bandMasks=this.bandMasks.map(r=>new Uint8Array(r)));const n=J.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const r=!!this.pixels[0].slice;for(e=0;e=3?(i=o[1],c=o[2]):o.length===2&&(i=o[1]);const h=new Uint32Array(t),l=this.width*this.height;if(s.length===l)if(e!=null&&e.length===l)if(n)for(a=0;a0){for(const d of r)if(d.minValue!=null&&(i=Math.min(i,d.minValue)),d.maxValue!=null&&d.minValue!=null){const g=d.maxValue-d.minValue;c=Math.max(c,g)}s=255/c}else{let d=255;o==="s8"?(i=-128,d=127):o==="u16"?d=65535:o==="s16"?(i=-32768,d=32767):o==="u32"?d=4294967295:o==="s32"?(i=-2147483648,d=2147483647):o==="f32"?(i=-34e38,d=34e38):o==="f64"&&(i=-Number.MAX_VALUE,d=Number.MAX_VALUE),s=255/(d-i)}const a=new Uint32Array(t),h=this.width*this.height;let l,f,p,u,m;if(l=f=p=e[0],l.length!==h)return Z.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(f=e[1],e.length>=3&&(p=e[2]),n!=null&&n.length===h)for(u=0;u=3?(o=e[1],s=e[2]):e.length===2&&(o=e[1]);const c=this.width*this.height;if(r.length!==c)return Z.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let a=0;if(n!=null&&n.length===c)for(i=0;ir?i:r);else for(s=0;sr?i:r;return new bt(n,r)}O([$({json:{write:!0}})],G.prototype,"width",void 0),O([$({json:{write:!0}})],G.prototype,"height",void 0),O([$({json:{write:!0}})],G.prototype,"pixelType",void 0),O([_t("pixelType")],G.prototype,"castPixelType",null),O([$({json:{write:!0}})],G.prototype,"validPixelCount",void 0),O([$({json:{write:!0}})],G.prototype,"mask",void 0),O([$({json:{write:!0}})],G.prototype,"maskIsAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"pixels",void 0),O([$()],G.prototype,"premultiplyAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"statistics",void 0),O([$({json:{write:!0}})],G.prototype,"depthCount",void 0),O([$({json:{write:!0}})],G.prototype,"noDataValues",void 0),O([$({json:{write:!0}})],G.prototype,"bandMasks",void 0),G=J=O([Dt("esri.layers.support.PixelBlock")],G);const D=G;var dt,mt;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})(dt||(dt={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(mt||(mt={}));const ve=6;function L(t){return t!=null&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function Ue(t){if(!t?.length||t.some(l=>!L(l)))return null;if(t.length===1)return t[0]?.clone()??null;const e=t,{width:n,height:r,pixelType:o}=e[0];if(e.some(l=>l.width!==n||l.height!==r))return null;const s=e.map(({mask:l})=>l).filter(l=>l!=null);let i=null;s.length&&(i=new Uint8Array(n*r),i.set(s[0]),s.length>1&&Ut(s.slice(1),i));const c=[];e.forEach(({pixels:l})=>c.push(...l));const a=e.map(({statistics:l})=>l).filter(l=>l?.length),h=[];return a.forEach(l=>h.push(...l)),new D({pixelType:o,width:n,height:r,mask:i,pixels:c,statistics:h.length?h:null})}function Pe(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const n=e.sort((f,p)=>f[0]-p[0]);let r=0;n[0][0]<0&&(r=n[0][0]);const o=Math.max(256,n[n.length-1][0]-r+1),s=new Uint8Array(4*o),i=[];let c,a=0,h=0;const l=n[0].length===5;if(o>65536)return n.forEach(f=>{i[f[0]-r]=l?f.slice(1):f.slice(1).concat([255])}),{indexed2DColormap:i,offset:r,alphaSpecified:l};if(t.fillUnspecified)for(c=n[h],a=c[0]-r;ak?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]));else{for(o=new Uint8Array(s),l=0;lk?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]);n.mask=o}}else if(c)if(o!=null)for(l=0;ls));const c=[],a=e.outputPixelType||"u8";for(let l=0;l1;){if(h===l.value){d=!0;break}h>l.value?f=m:p=m,m=Math.floor((f+p)/2),l=e[Math.floor(m)]}d||(h===e[f].value?(l=e[f],d=!0):h===e[p].value?(l=e[p],d=!0):he[f].value&&(hw-m);d[0]=o[0],d[d.length-1]=o[o.length-1]+(h?1e-6:0);const g=o.length/2,[k,M]=lt(i);for(let w=0;w=0;T--)if(U===d[2*T]||U>d[2*T]&&UM?M:U=c[P]&&U<=c[P+1]){f[b]=0,u[b]=0;break}}}return new D({width:n,height:r,pixelType:i,pixels:[f],mask:u})}function gt(t,e,n,r){const o=n!=null&&n.length>=2?new Set(n):null,s=n?.length===1?n[0]:null,i=!!e?.length;for(let c=0;c=e[l]&&a<=e[l+1]){h=!0;break}h||(r[c]=0)}r[c]&&(a===s||o?.has(a))&&(r[c]=0)}}function xt(t,e){const n=t[0].length;for(let r=0;rd-1e-6);m[0]=n[0],i&&(m[m.length-1]=n[n.length-1]);for(let d=0;du?u:r[d]m.pixelBlock);if(n?.pixelBlock==null)return null;const r=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,o=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,s=.01*Math.min(r,o),i=t.sort((m,d)=>Math.abs(m.extent.ymax-d.extent.ymax)>s?d.extent.ymax-m.extent.ymax:Math.abs(m.extent.xmin-d.extent.xmin)>s?m.extent.xmin-d.extent.xmin:0),c=Math.min.apply(null,i.map(m=>m.extent.xmin)),a=Math.min.apply(null,i.map(m=>m.extent.ymin)),h=Math.max.apply(null,i.map(m=>m.extent.xmax)),l=Math.max.apply(null,i.map(m=>m.extent.ymax)),f={x:Math.round((e.xmin-c)/r),y:Math.round((l-e.ymax)/o)},p={width:Math.round((h-c)/r),height:Math.round((l-a)/o)},u={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/o)};return Math.round(p.width/n.pixelBlock.width)*Math.round(p.height/n.pixelBlock.height)!==i.length||f.x<0||f.y<0||p.widthm.pixelBlock),p,{clipOffset:f,clipSize:u})}}function ht(t,e,n,r,o,s){const{width:i,height:c}=n.block,{x:a,y:h}=n.offset,{width:l,height:f}=n.mosaic,p=Zt(i,c,r,o,a,h,l,f);let u=0,m=0;if(s){const d=s.hasGCSSShiftTransform?360:s.halfWorldWidth??0,g=i*s.resolutionX,k=s.startX+r*g;kd?m=s.rightPadding:k>=d&&(u=s.leftMargin-s.rightPadding,m=0)}if(p.xmax-=m,typeof e!="number")for(let d=p.ymin;dL(v));if(c==null)return null;const a=o?o.width:e.width,h=o?o.height:e.height,l=c.width,f=c.height,p=e.width/l,u=e.height/f,m={offset:r||{x:0,y:0},mosaic:o||e,block:{width:l,height:f}},d=c.pixelType,g=D.getPixelArrayConstructor(d),k=c.pixels.length,M=[];let y,w;for(let v=0;vv==null||v.mask!=null&&v.mask.length>0),b=t.some(v=>v?.bandMasks&&v.bandMasks.length>1),U=x?new Uint8Array(a*h):void 0,P=b?[]:void 0;if(U){for(let v=0;vg!=null);if(r==null)return null;const o=t.some(g=>g==null||!!g.mask),{width:s,height:i}=e,c=o?new Uint8Array(s*i):null,{blockWidths:a}=n,h=[],l=r.getPlaneCount(),f=D.getPixelArrayConstructor(r.pixelType);if(o)for(let g=0,k=0;gg?.bandMasks&&g.bandMasks.length>1),u=p?[]:void 0,m=s*i;for(let g=0;gr||a>o||s===0&&i===0&&c===r&&a===o)return t;t.mask||(t.mask=new Uint8Array(r*o));const h=t.mask;for(let l=0;l=a||p=c?0:1}return t.updateStatistics(),t}function ee(t){if(!L(t))return null;const e=t.clone(),{width:n,height:r,pixels:o}=t,s=o[0],i=e.pixels[0],c=t.mask;for(let a=2;ae&&(n=s.value,e=r),s=o.next();return n}function rt(t,e,n){if(n===0)return;const r=t.get(e);r===1?t.delete(e):t.set(e,r-1)}function st(t,e,n){n!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function Pt(t,e,n){let{x:r,y:o}=e;const{width:s,height:i}=n;if(r===0&&o===0&&i===t.height&&s===t.width)return t;const{width:c,height:a}=t,h=Math.max(0,o),l=Math.max(0,r),f=Math.min(r+s,c),p=Math.min(o+i,a);if(f<0||p<0||!L(t))return null;r=Math.max(0,-r),o=Math.max(0,-o);const{pixels:u}=t,m=s*i,d=u.length,g=[];for(let w=0;w0;u--)p=It(p,i);return p}function Bt(t,e,n,r,o=0){const{width:s,height:i}=t,{width:c,height:a}=e,h=r.cols,l=r.rows,f=Math.ceil(c/h-.1/h),p=Math.ceil(a/l-.1/l);let u,m,d,g,k,M,y;const w=f*h,x=w*p*l,b=new Float32Array(x),U=new Float32Array(x),P=new Uint32Array(x),T=new Uint32Array(x);let v,B,A=0;for(let I=0;I{const F=A instanceof Float32Array||A instanceof Float64Array?0:.5;for(let N=0;N0){const[_,R]=E(M,U,e,a),[nt,it]=E(g,k,e,a);A.push(_),A.push(R),A.push(H),A.push(tt),A.push(nt),A.push(it)}else{const[_,R]=E(M,y,e,a),[nt,it]=E(w,x,e,a),[Vt,Ct]=E(P,T,e,a);I.push(H),I.push(tt),I.push(Vt),I.push(Ct),I.push(nt),I.push(it),I.push(_),I.push(R)}U+=s,k+=s,y+=s,x+=s,T+=s}const[V,S]=E(h+d,l+i,e,a),F=(r/2+f)*m,[N,C]=E(h+F,l+i,e,a),[j,W]=E(h+d,l-c,e,a),[q,X]=E(h+F,l-c,e,a);return{pennants:A,barbs:I,shaft:[V,S,N,C,j,W,q,X]}}function E(t,e,n,r=1){const o=Math.sqrt(t*t+e*e)/r,s=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+s-n)%(2*Math.PI)]}const ot=[0,1,3,6,10,16,21,27,33,40,47,55,63],le=[0,.5,1,1.5,2],re=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function Y(t,e,n,r){const o=pt(r||"knots",n);let s;for(s=1;sx>0).length:p*u,M=new Float32Array(k*a),y=new Uint32Array(h*k),w=e.invertDirection?Ft(0,0,0,!1):ie;for(let x=0;x=ut){const k=(c[d]+360)%360/180*Math.PI,{pennants:M,barbs:y,shaft:w}=ct[Math.min(Math.floor(g/5),29)];if(M.length+y.length===0)continue;let x=h.length/a;const b=(m+.5)/r,U=(u+.5)/o;for(let P=0;P=(T-U)*(v-P)*(1-o)){k[b]=1;const[B,A]=St([d[b]/x,g[b]/x]);d[b]=B,g[b]=A}else k[b]=0,d[b]=0,g[b]=0}const M=new D({width:p,height:u,pixels:[d,g],mask:k});return M.updateStatistics(),M}const z=()=>Z.getLogger("esri.views.2d.engine.flow.dataUtils"),fe=10;async function qe(t,e,n,r){const o=performance.now(),s=ue(e,n),i=performance.now(),c=de(e,s,n.width,n.height),a=performance.now(),h=ge(c),l=performance.now(),f=t==="Streamlines"?xe(h,fe):we(h),p=performance.now();return et("esri-2d-profiler")&&(z().info("I.1","_createFlowFieldFromData (ms)",Math.round(i-o)),z().info("I.2","_getStreamlines (ms)",Math.round(a-i)),z().info("I.3","createAnimatedLinesData (ms)",Math.round(l-a)),z().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-l)),z().info("I.5","createFlowMesh (ms)",Math.round(p-o)),z().info("I.6","Mesh size (bytes)",f.vertexData.buffer.byteLength+f.indexData.buffer.byteLength)),await Promise.resolve(),jt(r),f}function ue(t,e){const n=me(e.data,e.width,e.height,t.smoothing);return t.interpolate?(r,o)=>{const s=Math.floor(r),i=Math.floor(o);if(s<0||s>=e.width)return[0,0];if(i<0||i>=e.height)return[0,0];const c=r-s,a=o-i,h=s,l=i,f=s{const s=Math.round(r),i=Math.round(o);return s<0||s>=e.width||i<0||i>=e.height?[0,0]:[n[2*(i*e.width+s)],n[2*(i*e.width+s)+1]]}}function pe(t,e,n,r,o,s,i,c,a){const h=[];let l=n,f=r,p=0,[u,m]=e(l,f);u*=t.velocityScale,m*=t.velocityScale;const d=Math.sqrt(u*u+m*m);let g,k;h.push({x:l,y:f,t:p,speed:d});for(let M=0;Mt.maxTurnAngle)return h;if(t.collisions){const P=Math.round(l*a),T=Math.round(f*a);if(P<0||P>i-1||T<0||T>c-1)return h;const v=s[T*i+P];if(v!==-1&&v!==o)return h;s[T*i+P]=o}h.push({x:l,y:f,t:p,speed:x}),g=b,k=U}return h}function de(t,e,n,r){const o=[],s=new At,i=1/Math.max(t.lineCollisionWidth,1),c=Math.round(n*i),a=Math.round(r*i),h=new Int32Array(c*a);for(let f=0;ff.sort-p.sort);for(const{x:f,y:p}of l)if(s.getFloat()=e)continue;const m=s[u+o];f+=m*t[2*(h*e+(l+u))],p+=m*t[2*(h*e+(l+u))+1]}c[2*(h*e+l)]=f,c[2*(h*e+l)+1]=p}const a=new Float32Array(t.length);for(let h=0;h=n)continue;const m=s[u+o];f+=m*c[2*((l+u)*e+h)],p+=m*c[2*((l+u)*e+h)+1]}a[2*(l*e+h)]=f,a[2*(l*e+h)+1]=p}return a}function ge(t,e){const n=new At,r=t.reduce((a,h)=>a+h.length,0),o=new Float32Array(4*r),s=new Array(t.length);let i=0,c=0;for(const a of t){const h=i;for(const l of a)o[4*i]=l.x,o[4*i+1]=l.y,o[4*i+2]=l.t,o[4*i+3]=l.speed,i++;s[c++]={startVertex:h,numberOfVertices:a.length,totalTime:a[a.length-1].t,timeSeed:n.getFloat()}}return{lineVertices:o,lineDescriptors:s}}function xe(t,e){const{lineVertices:n,lineDescriptors:r}=t;let o=0,s=0;for(const p of r)o+=2*p.numberOfVertices,s+=6*(p.numberOfVertices-1);const i=new Float32Array(o*9),c=new Uint32Array(s);let a=0,h=0;function l(){c[h++]=a-2,c[h++]=a,c[h++]=a-1,c[h++]=a,c[h++]=a+1,c[h++]=a-1}function f(p,u,m,d,g,k,M,y){const w=a*9;let x=0;i[w+x++]=p,i[w+x++]=u,i[w+x++]=1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=d/2,i[w+x++]=g/2,i[w+x++]=y,a++,i[w+x++]=p,i[w+x++]=u,i[w+x++]=-1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=-d/2,i[w+x++]=-g/2,i[w+x++]=y,a++}for(const p of r){const{totalTime:u,timeSeed:m}=p;let d=null,g=null,k=null,M=null,y=null,w=null;for(let x=0;x0){v=b-d,B=U-g;const V=Math.sqrt(v*v+B*B);if(v/=V,B/=V,x>1){let S=v+y,F=B+w;const N=Math.sqrt(S*S+F*F);S/=N,F/=N;const C=Math.min(1/(S*v+F*B),e);S*=C,F*=C,A=-F,I=S}else A=-B,I=v;A!==null&&I!==null&&(f(d,g,k,A,I,u,m,T),l())}d=b,g=U,k=P,y=v,w=B,M=T}f(d,g,k,-w,y,u,m,M)}return{vertexData:i,indexData:c}}function we(t){const{lineVertices:e,lineDescriptors:n}=t;let r=0,o=0;for(const A of n){const I=A.numberOfVertices-1;r+=4*I*2,o+=6*I*2}const s=new Float32Array(r*16),i=new Uint32Array(o);let c,a,h,l,f,p,u,m,d,g,k,M,y,w,x=0,b=0;function U(){i[b++]=x-8,i[b++]=x-7,i[b++]=x-6,i[b++]=x-7,i[b++]=x-5,i[b++]=x-6,i[b++]=x-4,i[b++]=x-3,i[b++]=x-2,i[b++]=x-3,i[b++]=x-1,i[b++]=x-2}function P(A,I,V,S,F,N,C,j,W,q,X,K,H,tt){const _=x*16;let R=0;for(const nt of[1,2])for(const it of[1,2,3,4])s[_+R++]=A,s[_+R++]=I,s[_+R++]=V,s[_+R++]=S,s[_+R++]=C,s[_+R++]=j,s[_+R++]=W,s[_+R++]=q,s[_+R++]=nt,s[_+R++]=it,s[_+R++]=H,s[_+R++]=tt,s[_+R++]=F/2,s[_+R++]=N/2,s[_+R++]=X/2,s[_+R++]=K/2,x++}function T(A,I){let V=d+k,S=g+M;const F=Math.sqrt(V*V+S*S);V/=F,S/=F;const N=d*V+g*S;V/=N,S/=N;let C=k+y,j=M+w;const W=Math.sqrt(C*C+j*j);C/=W,j/=W;const q=k*C+M*j;C/=q,j/=q,P(c,a,h,l,-S,V,f,p,u,m,-j,C,A,I),U()}function v(A,I,V,S,F,N){if(d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),f!=null&&p!=null){y=A-f,w=I-p;const C=Math.sqrt(y*y+w*w);y/=C,w/=C}d!=null&&g!=null&&T(F,N),c=f,a=p,h=u,l=m,f=A,p=I,u=V,m=S}function B(A,I){d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),d!=null&&g!=null&&T(A,I)}for(const A of n){c=null,a=null,h=null,l=null,f=null,p=null,u=null,m=null,d=null,g=null,k=null,M=null,y=null,w=null;const{totalTime:I,timeSeed:V}=A;for(let S=0;S=n||(M.data[2*(x*n+y+b)]=w.data[2*(x*w.width+b)],M.data[2*(x*n+y+b)+1]=w.data[2*(x*w.width+b)+1],M.mask[x*n+y+b]=w.mask[x*w.width+b]);y+=w.width}return et("esri-2d-profiler")&&z().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-i)),M}async function Mt(t,e,n,r,o,s){const i={requestProjectedLocalDirections:!0,signal:s};if(o!=null&&(i.timeExtent=o),t.type==="imagery"){await t.load({signal:s});const h=t.rasterInfo.dataType,l=await t.fetchImage(e,n,r,i);return l?.pixelData?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(h,l.pixelData.pixelBlock)}await t.load({signal:s});const c=t.serviceRasterInfo.dataType,a=await t.fetchPixels(e,n,r,i);return a?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(c,a.pixelBlock)}export{ze as $,Ee as A,$e as B,ce as C,D,De as E,ke as K,L,Ne as M,Oe as P,Me as Q,qe as R,Ge as U,Ae as Y,We as _,pt as a,be as b,bt as c,Be as d,Pe as e,Qt as f,Kt as g,Te as h,dt as i,Fe as j,Le as k,Ue as l,Ve as m,lt as n,at as o,Ce as p,vt as q,Ie as r,ve as s,Se as t,mt as u,je as v,yt as w,St as x,Re as y,_e as z}; +import{v as O,S as $,ad as _t,i as Dt,aK as Rt,e as Lt,o as Nt,P as Et,a1 as Z,K as et,$ as jt,eE as At,aG as Gt,n as Ot,bj as Wt}from"./story-Doly9N9p.js";let bt=class{constructor(t=null,e=null,n=null){this.minValue=t,this.maxValue=e,this.noDataValue=n}};const $t=9999999e31,qt=2e-7,zt={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:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE],unknown:void 0,c64:void 0,c128:void 0};function lt(t){return zt[t]??[-34028234663852886e22,34028234663852886e22]}function ke(t,e){return t==null||e==null?"s32":t<0?t>=-128&&e<128?"s8":t>=-32768&&e<32768?"s16":"s32":e<256?"u8":e<65536?"u16":"u32"}function Kt(t){return(t?.startsWith("s")||t?.startsWith("u"))??!1}function Me(t,e,n,r){let[o,s]=lt(n);const i=Kt(n);return i&&(o-=1e-5,s+=1e-5),i?n.startsWith("u")?Xt(t,e,r,[o,s]):Jt(t,e,r,[o,s]):Ht(t,e,r,[o,s])}function Ae(t,e){for(let n=0;ns?e[i]=0:n[i]=c+.5|0}}function Jt(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c+(c>0?.5:-.5)|0}}function Ht(t,e,n,r){const[o,s]=r;for(let i=0;is?e[i]=0:n[i]=c}}function be(t,e,n){if(t.depthCount&&t.depthCount>1)return;const{pixels:r,statistics:o,pixelType:s}=t,i=r[0].length,c=t.bandMasks??[],a=t.mask??new Uint8Array(i).fill(255),h=s==="f32"||s==="f64",l=lt(s);let f=!1;for(let p=0;pu+Number.EPSILON||d=$t?qt*Math.abs(u):s==="f32"?2**-23:Number.EPSILON);for(let w=0;w1?c:null,t.mask=a),f&&"updateStatistics"in t&&t.updateStatistics()}var J;let G=J=class extends Lt{static createEmptyBand(t,e){return new(J.getPixelArrayConstructor(t))(e)}static combineBandMasks(t){if(t.length<2)return t[0];const e=t[0].length,n=new Uint8Array(e).fill(255);for(let r=0;rYt(n,this.mask));const t=this.mask;let e=0;if(t!=null)for(let n=0;nn?n:cf>=e.length),s=r===t.length&&!t.some((f,p)=>f!==p);if(o||s)return this;const i=this.bandMasks?.length===r?t.map(f=>this.bandMasks[f]):void 0;let{mask:c,validPixelCount:a}=this;const{width:h,height:l}=this;return i?.length&&(c=J.combineBandMasks(i),a=c.filter(f=>!!f).length),new J({pixelType:this.pixelType,width:h,height:l,mask:c,bandMasks:i,validPixelCount:a,maskIsAlpha:this.maskIsAlpha,pixels:t.map(f=>e[f]),statistics:n&&t.map(f=>n[f])})}clone(){const t=new J({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;this.mask!=null&&(t.mask=new Uint8Array(this.mask)),this.bandMasks&&(t.bandMasks=this.bandMasks.map(r=>new Uint8Array(r)));const n=J.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const r=!!this.pixels[0].slice;for(e=0;e=3?(i=o[1],c=o[2]):o.length===2&&(i=o[1]);const h=new Uint32Array(t),l=this.width*this.height;if(s.length===l)if(e!=null&&e.length===l)if(n)for(a=0;a0){for(const d of r)if(d.minValue!=null&&(i=Math.min(i,d.minValue)),d.maxValue!=null&&d.minValue!=null){const g=d.maxValue-d.minValue;c=Math.max(c,g)}s=255/c}else{let d=255;o==="s8"?(i=-128,d=127):o==="u16"?d=65535:o==="s16"?(i=-32768,d=32767):o==="u32"?d=4294967295:o==="s32"?(i=-2147483648,d=2147483647):o==="f32"?(i=-34e38,d=34e38):o==="f64"&&(i=-Number.MAX_VALUE,d=Number.MAX_VALUE),s=255/(d-i)}const a=new Uint32Array(t),h=this.width*this.height;let l,f,p,u,m;if(l=f=p=e[0],l.length!==h)return Z.getLogger(this).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(f=e[1],e.length>=3&&(p=e[2]),n!=null&&n.length===h)for(u=0;u=3?(o=e[1],s=e[2]):e.length===2&&(o=e[1]);const c=this.width*this.height;if(r.length!==c)return Z.getLogger(this).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let a=0;if(n!=null&&n.length===c)for(i=0;ir?i:r);else for(s=0;sr?i:r;return new bt(n,r)}O([$({json:{write:!0}})],G.prototype,"width",void 0),O([$({json:{write:!0}})],G.prototype,"height",void 0),O([$({json:{write:!0}})],G.prototype,"pixelType",void 0),O([_t("pixelType")],G.prototype,"castPixelType",null),O([$({json:{write:!0}})],G.prototype,"validPixelCount",void 0),O([$({json:{write:!0}})],G.prototype,"mask",void 0),O([$({json:{write:!0}})],G.prototype,"maskIsAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"pixels",void 0),O([$()],G.prototype,"premultiplyAlpha",void 0),O([$({json:{write:!0}})],G.prototype,"statistics",void 0),O([$({json:{write:!0}})],G.prototype,"depthCount",void 0),O([$({json:{write:!0}})],G.prototype,"noDataValues",void 0),O([$({json:{write:!0}})],G.prototype,"bandMasks",void 0),G=J=O([Dt("esri.layers.support.PixelBlock")],G);const D=G;var dt,mt;(function(t){t[t.matchAny=0]="matchAny",t[t.matchAll=1]="matchAll"})(dt||(dt={})),function(t){t[t.bestMatch=0]="bestMatch",t[t.fail=1]="fail"}(mt||(mt={}));const ve=6;function L(t){return t!=null&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function Ue(t){if(!t?.length||t.some(l=>!L(l)))return null;if(t.length===1)return t[0]?.clone()??null;const e=t,{width:n,height:r,pixelType:o}=e[0];if(e.some(l=>l.width!==n||l.height!==r))return null;const s=e.map(({mask:l})=>l).filter(l=>l!=null);let i=null;s.length&&(i=new Uint8Array(n*r),i.set(s[0]),s.length>1&&Ut(s.slice(1),i));const c=[];e.forEach(({pixels:l})=>c.push(...l));const a=e.map(({statistics:l})=>l).filter(l=>l?.length),h=[];return a.forEach(l=>h.push(...l)),new D({pixelType:o,width:n,height:r,mask:i,pixels:c,statistics:h.length?h:null})}function Pe(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const n=e.sort((f,p)=>f[0]-p[0]);let r=0;n[0][0]<0&&(r=n[0][0]);const o=Math.max(256,n[n.length-1][0]-r+1),s=new Uint8Array(4*o),i=[];let c,a=0,h=0;const l=n[0].length===5;if(o>65536)return n.forEach(f=>{i[f[0]-r]=l?f.slice(1):f.slice(1).concat([255])}),{indexed2DColormap:i,offset:r,alphaSpecified:l};if(t.fillUnspecified)for(c=n[h],a=c[0]-r;ak?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]));else{for(o=new Uint8Array(s),l=0;lk?o[l]=0:(p[l]=i[g],u[l]=i[g+1],m[l]=i[g+2],o[l]=i[g+3]);n.mask=o}}else if(c)if(o!=null)for(l=0;ls));const c=[],a=e.outputPixelType||"u8";for(let l=0;l1;){if(h===l.value){d=!0;break}h>l.value?f=m:p=m,m=Math.floor((f+p)/2),l=e[Math.floor(m)]}d||(h===e[f].value?(l=e[f],d=!0):h===e[p].value?(l=e[p],d=!0):he[f].value&&(hw-m);d[0]=o[0],d[d.length-1]=o[o.length-1]+(h?1e-6:0);const g=o.length/2,[k,M]=lt(i);for(let w=0;w=0;T--)if(U===d[2*T]||U>d[2*T]&&UM?M:U=c[P]&&U<=c[P+1]){f[b]=0,u[b]=0;break}}}return new D({width:n,height:r,pixelType:i,pixels:[f],mask:u})}function gt(t,e,n,r){const o=n!=null&&n.length>=2?new Set(n):null,s=n?.length===1?n[0]:null,i=!!e?.length;for(let c=0;c=e[l]&&a<=e[l+1]){h=!0;break}h||(r[c]=0)}r[c]&&(a===s||o?.has(a))&&(r[c]=0)}}function xt(t,e){const n=t[0].length;for(let r=0;rd-1e-6);m[0]=n[0],i&&(m[m.length-1]=n[n.length-1]);for(let d=0;du?u:r[d]m.pixelBlock);if(n?.pixelBlock==null)return null;const r=(n.extent.xmax-n.extent.xmin)/n.pixelBlock.width,o=(n.extent.ymax-n.extent.ymin)/n.pixelBlock.height,s=.01*Math.min(r,o),i=t.sort((m,d)=>Math.abs(m.extent.ymax-d.extent.ymax)>s?d.extent.ymax-m.extent.ymax:Math.abs(m.extent.xmin-d.extent.xmin)>s?m.extent.xmin-d.extent.xmin:0),c=Math.min.apply(null,i.map(m=>m.extent.xmin)),a=Math.min.apply(null,i.map(m=>m.extent.ymin)),h=Math.max.apply(null,i.map(m=>m.extent.xmax)),l=Math.max.apply(null,i.map(m=>m.extent.ymax)),f={x:Math.round((e.xmin-c)/r),y:Math.round((l-e.ymax)/o)},p={width:Math.round((h-c)/r),height:Math.round((l-a)/o)},u={width:Math.round((e.xmax-e.xmin)/r),height:Math.round((e.ymax-e.ymin)/o)};return Math.round(p.width/n.pixelBlock.width)*Math.round(p.height/n.pixelBlock.height)!==i.length||f.x<0||f.y<0||p.widthm.pixelBlock),p,{clipOffset:f,clipSize:u})}}function ht(t,e,n,r,o,s){const{width:i,height:c}=n.block,{x:a,y:h}=n.offset,{width:l,height:f}=n.mosaic,p=Zt(i,c,r,o,a,h,l,f);let u=0,m=0;if(s){const d=s.hasGCSSShiftTransform?360:s.halfWorldWidth??0,g=i*s.resolutionX,k=s.startX+r*g;kd?m=s.rightPadding:k>=d&&(u=s.leftMargin-s.rightPadding,m=0)}if(p.xmax-=m,typeof e!="number")for(let d=p.ymin;dL(v));if(c==null)return null;const a=o?o.width:e.width,h=o?o.height:e.height,l=c.width,f=c.height,p=e.width/l,u=e.height/f,m={offset:r||{x:0,y:0},mosaic:o||e,block:{width:l,height:f}},d=c.pixelType,g=D.getPixelArrayConstructor(d),k=c.pixels.length,M=[];let y,w;for(let v=0;vv==null||v.mask!=null&&v.mask.length>0),b=t.some(v=>v?.bandMasks&&v.bandMasks.length>1),U=x?new Uint8Array(a*h):void 0,P=b?[]:void 0;if(U){for(let v=0;vg!=null);if(r==null)return null;const o=t.some(g=>g==null||!!g.mask),{width:s,height:i}=e,c=o?new Uint8Array(s*i):null,{blockWidths:a}=n,h=[],l=r.getPlaneCount(),f=D.getPixelArrayConstructor(r.pixelType);if(o)for(let g=0,k=0;gg?.bandMasks&&g.bandMasks.length>1),u=p?[]:void 0,m=s*i;for(let g=0;gr||a>o||s===0&&i===0&&c===r&&a===o)return t;t.mask||(t.mask=new Uint8Array(r*o));const h=t.mask;for(let l=0;l=a||p=c?0:1}return t.updateStatistics(),t}function ee(t){if(!L(t))return null;const e=t.clone(),{width:n,height:r,pixels:o}=t,s=o[0],i=e.pixels[0],c=t.mask;for(let a=2;ae&&(n=s.value,e=r),s=o.next();return n}function rt(t,e,n){if(n===0)return;const r=t.get(e);r===1?t.delete(e):t.set(e,r-1)}function st(t,e,n){n!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function Pt(t,e,n){let{x:r,y:o}=e;const{width:s,height:i}=n;if(r===0&&o===0&&i===t.height&&s===t.width)return t;const{width:c,height:a}=t,h=Math.max(0,o),l=Math.max(0,r),f=Math.min(r+s,c),p=Math.min(o+i,a);if(f<0||p<0||!L(t))return null;r=Math.max(0,-r),o=Math.max(0,-o);const{pixels:u}=t,m=s*i,d=u.length,g=[];for(let w=0;w0;u--)p=It(p,i);return p}function Bt(t,e,n,r,o=0){const{width:s,height:i}=t,{width:c,height:a}=e,h=r.cols,l=r.rows,f=Math.ceil(c/h-.1/h),p=Math.ceil(a/l-.1/l);let u,m,d,g,k,M,y;const w=f*h,x=w*p*l,b=new Float32Array(x),U=new Float32Array(x),P=new Uint32Array(x),T=new Uint32Array(x);let v,B,A=0;for(let I=0;I{const F=A instanceof Float32Array||A instanceof Float64Array?0:.5;for(let N=0;N0){const[_,R]=E(M,U,e,a),[nt,it]=E(g,k,e,a);A.push(_),A.push(R),A.push(H),A.push(tt),A.push(nt),A.push(it)}else{const[_,R]=E(M,y,e,a),[nt,it]=E(w,x,e,a),[Vt,Ct]=E(P,T,e,a);I.push(H),I.push(tt),I.push(Vt),I.push(Ct),I.push(nt),I.push(it),I.push(_),I.push(R)}U+=s,k+=s,y+=s,x+=s,T+=s}const[V,S]=E(h+d,l+i,e,a),F=(r/2+f)*m,[N,C]=E(h+F,l+i,e,a),[j,W]=E(h+d,l-c,e,a),[q,X]=E(h+F,l-c,e,a);return{pennants:A,barbs:I,shaft:[V,S,N,C,j,W,q,X]}}function E(t,e,n,r=1){const o=Math.sqrt(t*t+e*e)/r,s=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+s-n)%(2*Math.PI)]}const ot=[0,1,3,6,10,16,21,27,33,40,47,55,63],le=[0,.5,1,1.5,2],re=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function Y(t,e,n,r){const o=pt(r||"knots",n);let s;for(s=1;sx>0).length:p*u,M=new Float32Array(k*a),y=new Uint32Array(h*k),w=e.invertDirection?Ft(0,0,0,!1):ie;for(let x=0;x=ut){const k=(c[d]+360)%360/180*Math.PI,{pennants:M,barbs:y,shaft:w}=ct[Math.min(Math.floor(g/5),29)];if(M.length+y.length===0)continue;let x=h.length/a;const b=(m+.5)/r,U=(u+.5)/o;for(let P=0;P=(T-U)*(v-P)*(1-o)){k[b]=1;const[B,A]=St([d[b]/x,g[b]/x]);d[b]=B,g[b]=A}else k[b]=0,d[b]=0,g[b]=0}const M=new D({width:p,height:u,pixels:[d,g],mask:k});return M.updateStatistics(),M}const z=()=>Z.getLogger("esri.views.2d.engine.flow.dataUtils"),fe=10;async function qe(t,e,n,r){const o=performance.now(),s=ue(e,n),i=performance.now(),c=de(e,s,n.width,n.height),a=performance.now(),h=ge(c),l=performance.now(),f=t==="Streamlines"?xe(h,fe):we(h),p=performance.now();return et("esri-2d-profiler")&&(z().info("I.1","_createFlowFieldFromData (ms)",Math.round(i-o)),z().info("I.2","_getStreamlines (ms)",Math.round(a-i)),z().info("I.3","createAnimatedLinesData (ms)",Math.round(l-a)),z().info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(p-l)),z().info("I.5","createFlowMesh (ms)",Math.round(p-o)),z().info("I.6","Mesh size (bytes)",f.vertexData.buffer.byteLength+f.indexData.buffer.byteLength)),await Promise.resolve(),jt(r),f}function ue(t,e){const n=me(e.data,e.width,e.height,t.smoothing);return t.interpolate?(r,o)=>{const s=Math.floor(r),i=Math.floor(o);if(s<0||s>=e.width)return[0,0];if(i<0||i>=e.height)return[0,0];const c=r-s,a=o-i,h=s,l=i,f=s{const s=Math.round(r),i=Math.round(o);return s<0||s>=e.width||i<0||i>=e.height?[0,0]:[n[2*(i*e.width+s)],n[2*(i*e.width+s)+1]]}}function pe(t,e,n,r,o,s,i,c,a){const h=[];let l=n,f=r,p=0,[u,m]=e(l,f);u*=t.velocityScale,m*=t.velocityScale;const d=Math.sqrt(u*u+m*m);let g,k;h.push({x:l,y:f,t:p,speed:d});for(let M=0;Mt.maxTurnAngle)return h;if(t.collisions){const P=Math.round(l*a),T=Math.round(f*a);if(P<0||P>i-1||T<0||T>c-1)return h;const v=s[T*i+P];if(v!==-1&&v!==o)return h;s[T*i+P]=o}h.push({x:l,y:f,t:p,speed:x}),g=b,k=U}return h}function de(t,e,n,r){const o=[],s=new At,i=1/Math.max(t.lineCollisionWidth,1),c=Math.round(n*i),a=Math.round(r*i),h=new Int32Array(c*a);for(let f=0;ff.sort-p.sort);for(const{x:f,y:p}of l)if(s.getFloat()=e)continue;const m=s[u+o];f+=m*t[2*(h*e+(l+u))],p+=m*t[2*(h*e+(l+u))+1]}c[2*(h*e+l)]=f,c[2*(h*e+l)+1]=p}const a=new Float32Array(t.length);for(let h=0;h=n)continue;const m=s[u+o];f+=m*c[2*((l+u)*e+h)],p+=m*c[2*((l+u)*e+h)+1]}a[2*(l*e+h)]=f,a[2*(l*e+h)+1]=p}return a}function ge(t,e){const n=new At,r=t.reduce((a,h)=>a+h.length,0),o=new Float32Array(4*r),s=new Array(t.length);let i=0,c=0;for(const a of t){const h=i;for(const l of a)o[4*i]=l.x,o[4*i+1]=l.y,o[4*i+2]=l.t,o[4*i+3]=l.speed,i++;s[c++]={startVertex:h,numberOfVertices:a.length,totalTime:a[a.length-1].t,timeSeed:n.getFloat()}}return{lineVertices:o,lineDescriptors:s}}function xe(t,e){const{lineVertices:n,lineDescriptors:r}=t;let o=0,s=0;for(const p of r)o+=2*p.numberOfVertices,s+=6*(p.numberOfVertices-1);const i=new Float32Array(o*9),c=new Uint32Array(s);let a=0,h=0;function l(){c[h++]=a-2,c[h++]=a,c[h++]=a-1,c[h++]=a,c[h++]=a+1,c[h++]=a-1}function f(p,u,m,d,g,k,M,y){const w=a*9;let x=0;i[w+x++]=p,i[w+x++]=u,i[w+x++]=1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=d/2,i[w+x++]=g/2,i[w+x++]=y,a++,i[w+x++]=p,i[w+x++]=u,i[w+x++]=-1,i[w+x++]=m,i[w+x++]=k,i[w+x++]=M,i[w+x++]=-d/2,i[w+x++]=-g/2,i[w+x++]=y,a++}for(const p of r){const{totalTime:u,timeSeed:m}=p;let d=null,g=null,k=null,M=null,y=null,w=null;for(let x=0;x0){v=b-d,B=U-g;const V=Math.sqrt(v*v+B*B);if(v/=V,B/=V,x>1){let S=v+y,F=B+w;const N=Math.sqrt(S*S+F*F);S/=N,F/=N;const C=Math.min(1/(S*v+F*B),e);S*=C,F*=C,A=-F,I=S}else A=-B,I=v;A!==null&&I!==null&&(f(d,g,k,A,I,u,m,T),l())}d=b,g=U,k=P,y=v,w=B,M=T}f(d,g,k,-w,y,u,m,M)}return{vertexData:i,indexData:c}}function we(t){const{lineVertices:e,lineDescriptors:n}=t;let r=0,o=0;for(const A of n){const I=A.numberOfVertices-1;r+=4*I*2,o+=6*I*2}const s=new Float32Array(r*16),i=new Uint32Array(o);let c,a,h,l,f,p,u,m,d,g,k,M,y,w,x=0,b=0;function U(){i[b++]=x-8,i[b++]=x-7,i[b++]=x-6,i[b++]=x-7,i[b++]=x-5,i[b++]=x-6,i[b++]=x-4,i[b++]=x-3,i[b++]=x-2,i[b++]=x-3,i[b++]=x-1,i[b++]=x-2}function P(A,I,V,S,F,N,C,j,W,q,X,K,H,tt){const _=x*16;let R=0;for(const nt of[1,2])for(const it of[1,2,3,4])s[_+R++]=A,s[_+R++]=I,s[_+R++]=V,s[_+R++]=S,s[_+R++]=C,s[_+R++]=j,s[_+R++]=W,s[_+R++]=q,s[_+R++]=nt,s[_+R++]=it,s[_+R++]=H,s[_+R++]=tt,s[_+R++]=F/2,s[_+R++]=N/2,s[_+R++]=X/2,s[_+R++]=K/2,x++}function T(A,I){let V=d+k,S=g+M;const F=Math.sqrt(V*V+S*S);V/=F,S/=F;const N=d*V+g*S;V/=N,S/=N;let C=k+y,j=M+w;const W=Math.sqrt(C*C+j*j);C/=W,j/=W;const q=k*C+M*j;C/=q,j/=q,P(c,a,h,l,-S,V,f,p,u,m,-j,C,A,I),U()}function v(A,I,V,S,F,N){if(d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),f!=null&&p!=null){y=A-f,w=I-p;const C=Math.sqrt(y*y+w*w);y/=C,w/=C}d!=null&&g!=null&&T(F,N),c=f,a=p,h=u,l=m,f=A,p=I,u=V,m=S}function B(A,I){d=k,g=M,k=y,M=w,d==null&&g==null&&(d=k,g=M),d!=null&&g!=null&&T(A,I)}for(const A of n){c=null,a=null,h=null,l=null,f=null,p=null,u=null,m=null,d=null,g=null,k=null,M=null,y=null,w=null;const{totalTime:I,timeSeed:V}=A;for(let S=0;S=n||(M.data[2*(x*n+y+b)]=w.data[2*(x*w.width+b)],M.data[2*(x*n+y+b)+1]=w.data[2*(x*w.width+b)+1],M.mask[x*n+y+b]=w.mask[x*w.width+b]);y+=w.width}return et("esri-2d-profiler")&&z().info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-i)),M}async function Mt(t,e,n,r,o,s){const i={requestProjectedLocalDirections:!0,signal:s};if(o!=null&&(i.timeExtent=o),t.type==="imagery"){await t.load({signal:s});const h=t.rasterInfo.dataType,l=await t.fetchImage(e,n,r,i);return l?.pixelData?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(h,l.pixelData.pixelBlock)}await t.load({signal:s});const c=t.serviceRasterInfo.dataType,a=await t.fetchPixels(e,n,r,i);return a?.pixelBlock==null?{data:new Float32Array(n*r*2),mask:new Uint8Array(n*r),width:n,height:r}:kt(c,a.pixelBlock)}export{ze as $,Ee as A,$e as B,ce as C,D,De as E,ke as K,L,Ne as M,Oe as P,Me as Q,qe as R,Ge as U,Ae as Y,We as _,pt as a,be as b,bt as c,Be as d,Pe as e,Qt as f,Kt as g,Te as h,dt as i,Fe as j,Le as k,Ue as l,Ve as m,lt as n,at as o,Ce as p,vt as q,Ie as r,ve as s,Se as t,mt as u,je as v,yt as w,St as x,Re as y,_e as z}; diff --git a/custom-toc-highlight/assets/deduplicate-D2d-E5Pw-CQcmF3ab.js b/custom-toc-highlight/assets/deduplicate-D2d-E5Pw-CTlujluz.js similarity index 92% rename from custom-toc-highlight/assets/deduplicate-D2d-E5Pw-CQcmF3ab.js rename to custom-toc-highlight/assets/deduplicate-D2d-E5Pw-CTlujluz.js index c6171766..d01f40bb 100644 --- a/custom-toc-highlight/assets/deduplicate-D2d-E5Pw-CQcmF3ab.js +++ b/custom-toc-highlight/assets/deduplicate-D2d-E5Pw-CTlujluz.js @@ -1 +1 @@ -import{hb as v}from"./story-BfX8CRfG.js";import{h as z,w as O}from"./Indices-DEr2HrWx-BuNk6xPZ.js";function B(o,n,c){const r=Array.isArray(o),e=r?o.length/n:o.byteLength/(4*n),y=r?o:new Uint32Array(o,0,e*n),A=c?.minReduction??0,s=c?.originalIndices||null,q=s?s.length:0,f=c?.componentOffsets||null;let b=0;if(f)for(let t=0;tb&&(b=u)}else b=e;const w=Math.floor(1.1*b)+1;(a==null||a.length<2*w)&&(a=new Uint32Array(v(2*w)));for(let t=0;t<2*w;t++)a[t]=0;let i=0;const m=!!f&&!!s,U=m?q:e;let h=z(e);const p=new Uint32Array(q),$=1.96;let C=A!==0?Math.ceil(4*$*$/(A*A)*A*(1-A)):U,d=1,I=f?f[1]:U;for(let t=0;t=w&&(g-=w)}x===i&&(a[2*g]=k,a[2*g+1]=u+1,i++),h[u]=x}if(A!==0&&1-i/e>>2)|0;return r>>>0}let a=null;export{B as v}; +import{hb as v}from"./story-Doly9N9p.js";import{h as z,w as O}from"./Indices-DEr2HrWx-cFTwC5-9.js";function B(o,n,c){const r=Array.isArray(o),e=r?o.length/n:o.byteLength/(4*n),y=r?o:new Uint32Array(o,0,e*n),A=c?.minReduction??0,s=c?.originalIndices||null,q=s?s.length:0,f=c?.componentOffsets||null;let b=0;if(f)for(let t=0;tb&&(b=u)}else b=e;const w=Math.floor(1.1*b)+1;(a==null||a.length<2*w)&&(a=new Uint32Array(v(2*w)));for(let t=0;t<2*w;t++)a[t]=0;let i=0;const m=!!f&&!!s,U=m?q:e;let h=z(e);const p=new Uint32Array(q),$=1.96;let C=A!==0?Math.ceil(4*$*$/(A*A)*A*(1-A)):U,d=1,I=f?f[1]:U;for(let t=0;t=w&&(g-=w)}x===i&&(a[2*g]=k,a[2*g+1]=u+1,i++),h[u]=x}if(A!==0&&1-i/e>>2)|0;return r>>>0}let a=null;export{B as v}; diff --git a/custom-toc-highlight/assets/deleteForwardEdits-BHWvOnK8-C0YwmPr6.js b/custom-toc-highlight/assets/deleteForwardEdits-BHWvOnK8-P72OARG2.js similarity index 59% rename from custom-toc-highlight/assets/deleteForwardEdits-BHWvOnK8-C0YwmPr6.js rename to custom-toc-highlight/assets/deleteForwardEdits-BHWvOnK8-P72OARG2.js index 03c2b8af..34870146 100644 --- a/custom-toc-highlight/assets/deleteForwardEdits-BHWvOnK8-C0YwmPr6.js +++ b/custom-toc-highlight/assets/deleteForwardEdits-BHWvOnK8-P72OARG2.js @@ -1 +1 @@ -import{o as f,f as m}from"./story-BfX8CRfG.js";import{y as p,a as u,n as c}from"./utils-9sQxfkoa-KicvrT8N.js";import"./main-ugzBrWNm.js";async function y(i,t,r,s){if(!t)throw new f("post:missing-guid","guid for version is missing");const o=p(i),e=r.toJSON(),n=u(o.query,{query:c({...e,f:"json"}),...s,method:"post"});t.startsWith("{")&&(t=t.slice(1,-1));const a=`${o.path}/versions/${t}/deleteForwardEdits`,{data:d}=await m(a,n);return d}export{y as deleteForwardEdits}; +import{o as f,f as m}from"./story-Doly9N9p.js";import{y as p,a as u,n as c}from"./utils-9sQxfkoa-D8FX0sO8.js";import"./main-QGPoLsvl.js";async function y(i,t,r,s){if(!t)throw new f("post:missing-guid","guid for version is missing");const o=p(i),e=r.toJSON(),n=u(o.query,{query:c({...e,f:"json"}),...s,method:"post"});t.startsWith("{")&&(t=t.slice(1,-1));const a=`${o.path}/versions/${t}/deleteForwardEdits`,{data:d}=await m(a,n);return d}export{y as deleteForwardEdits}; diff --git a/custom-toc-highlight/assets/details-screen-DE85sbTV-D3mJWX0Z.js b/custom-toc-highlight/assets/details-screen-DE85sbTV-BZ2qdeGe.js similarity index 99% rename from custom-toc-highlight/assets/details-screen-DE85sbTV-D3mJWX0Z.js rename to custom-toc-highlight/assets/details-screen-DE85sbTV-BZ2qdeGe.js index ba822217..7e8c9695 100644 --- a/custom-toc-highlight/assets/details-screen-DE85sbTV-D3mJWX0Z.js +++ b/custom-toc-highlight/assets/details-screen-DE85sbTV-BZ2qdeGe.js @@ -1 +1 @@ -import{eT as F,eU as se,f6 as L,f8 as ie,e$ as t,fb as a,f2 as h,fl as R,fm as Y,f3 as U,fF as ve,f5 as O,fg as I,fx as X,eZ as M,fa as N,fc as A,fo as le,gb as pe,eX as Z,gj as ne,fi as J,f7 as G,f9 as Q,f0 as V,f4 as w,eY as ee,fn as _e,eV as W,fG as ae,e_ as Te,f1 as de,gq as me,fK as je,gp as Me}from"./story-BfX8CRfG.js";import{Z as ze}from"./toggle-switch-control-B4JzuvHa-xR5vylCb.js";import"./main-ugzBrWNm.js";const He={key:0,class:"relative"},$e={key:0,class:"relative"},qe=["innerHTML"],Ee=["src"],Ie={key:1,class:"w-32 h-32"},Oe={class:"symbologyIcon"},Ce=["innerHTML"],Be=["src"],De={class:"badge z-50 rounded-full text-white absolute h-10 w-10 p-8 inline-flex items-center justify-center"},Ae={key:0,class:"px-5"},Ne={key:1,class:"inline-flex justify-center items-center relative"},Pe=F({__name:"symbology-stack",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0}},setup(v){const k=v,i=L([]);return ie(()=>{i.value=k.layer.legend}),(d,p)=>v.result.loaded?(t(),a("div",He,[h("div",{class:U(v.result.items.length===0?"opacity-50":"")},[i.value.length>1?(t(),a("div",$e,[(t(!0),a(R,null,Y(i.value.slice(0,3).reverse(),(_,y)=>(t(),a("div",{class:U(["absolute",[y==0?"symbol-0":y==1?"left-3":"left-6"]]),style:ve({"z-index":3-y}),key:y},[i.value[y].svgcode?(t(),a("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[y].svgcode},null,8,qe)):i.value[y].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[y].imgUrl},null,8,Ee)):O("",!0)],6))),128))])):i.value.length>0?(t(),a("div",Ie,[h("div",Oe,[i.value[0].svgcode?(t(),a("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ce)):i.value[0].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Be)):O("",!0)])])):O("",!0)],2),h("div",De,[v.result.loaded?(t(),a("div",Ae,I(v.result.items.length),1)):O("",!0)])])):(t(),a("div",Ne,p[0]||(p[0]=[h("div",{class:"symbologyIcon h-32 w-32"},[h("div",{class:"relative animate-spin spinner h-24 w-24"})],-1)])))}}),Fe=se(Pe,[["__scopeId","data-v-496d788d"]]),Se=["content"],Ge={class:"symbologyLayerName truncate"},Ue=F({__name:"symbology-item",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0},selected:{type:Boolean,required:!0}},setup(v){const k=X(),i=M(()=>k.properties),d=v,p=()=>{const _=d.layer;return _&&i.value[_.id]&&i.value[_.id].name?i.value[_.id].name:_?.name??""};return(_,y)=>{const b=N("tippy");return A((t(),a("button",{class:U(["flex flex-grow justify-start items-center px-7 py-10 default-focus-style symbologyStackButton truncate",v.selected?"detailsButtonSelected":"px-11"]),onClick:y[0]||(y[0]=pe(()=>{},["stop"])),content:p()},[le(Fe,{class:"symbStack w-32 h-32 mr-10",layer:v.layer,result:v.result},null,8,["layer","result"]),h("div",Ge,I(p()),1)],10,Se)),[[b,{placement:"right",sticky:!0}]])}}}),Ve=["content"],Ze=F({__name:"symbology-list",props:{results:{type:Object,required:!0},selected:{type:String,required:!0}},emits:["selection-changed"],setup(v,{emit:k}){const{t:i}=Z(),d=ne(),p=L(),_=()=>{p.value._tippy.hide()},y=f=>{f.key==="Tab"&&p.value?.matches(":focus")&&p.value._tippy.show()},b=k,o=v,r=L(""),c=L([]),u=L(!1),e=L(!1),n=f=>d.getLayerByUid(f),z=f=>{r.value=f,b("selection-changed",f),u.value=!1},C=()=>{e.value||setTimeout(()=>{u.value=e.value},500),e.value=!0},E=()=>{u.value=e.value=!1},m=()=>{e.value||(u.value=!0),e.value=!0},H=()=>{u.value=e.value=!1};return J(()=>{c.value.push(G(o,()=>{r.value=o.selected}))}),ie(()=>{p.value?.addEventListener("blur",_),p.value?.addEventListener("keyup",y)}),Q(()=>{c.value.forEach(f=>f()),p.value?.removeEventListener("blur",_),p.value?.removeEventListener("keyup",y)}),(f,P)=>{const D=N("focus-item"),q=N("focus-list"),$=N("tippy");return A((t(),a("div",{class:U(["symbology-list absolute overflow-hidden z-50 p-0 w-48 bg-white text-sm inline-flex flex-col",{"symbology-list-expanded":u.value}]),onMouseover:C,onMouseleave:E,onFocus:m,onBlur:pe(H,["self"]),content:w(i)("details.layers.results.list.tooltip"),ref_key:"el",ref:p},[(t(!0),a(R,null,Y(o.results,(l,g)=>(t(),a("div",{class:"flex justify-start relative",key:g},[A((t(),V(Ue,{key:l.uid,layer:n(l.uid),result:l,selected:l.uid===r.value,onClick:x=>z(l.uid)},null,8,["layer","result","selected","onClick"])),[[D]])]))),128))],42,Ve)),[[q],[$,{trigger:"manual",placement:"top-start",touch:!1}]])}}}),Re={class:"inline font-bold"},Ke=["innerHTML"],We=F({__name:"esri-default",props:{fixtureFields:{type:Object,required:!1},fields:{type:Object,required:!0},identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=v,p=(r,c,u,e)=>{const n=r.find(z=>z[c].toLowerCase()===u.toLowerCase());n&&delete e[n.name]},_=()=>{const r=Object.assign({},d.identifyData.data);p(d.fields,"type","geometry",r),i?.ui.exposeOids||p(d.fields,"type","oid",r),i?.ui.exposeMeasurements||(p(d.fields,"name","shape_length",r),p(d.fields,"name","shape_area",r));const c={};d.fields.forEach(e=>{const n=d.fixtureFields?.find(z=>e.name===z.field);c[e.name]={name:n?.alias||e.alias||e.name,type:e.type,visible:n?.visible??!0}});const u={};Object.keys(r).forEach(e=>{const n=c[e];if(n&&n.visible){const z=r[e];u[e]={value:typeof z=="number"?i?.ui.formatNumber(z):z,alias:n.name,type:n.type}}});for(const[e]of Object.entries(u))i.ui.isPlainText(u[e].value)&&(u[e].value=i.ui.escapeHtml(u[e].value));return u},y=(r,c,u)=>{switch(u){case"date":return o(r);default:return b(r,c)}},b=(r,c)=>{if(!r)return r;if(r.trim().match(/\.(jpeg|jpg|gif|png)$/)||r.trim().match(/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i))return`${k(`;const u="underline text-blue-700 break-all",e=document.createElement("div");return e.innerHTML=r.trim(),e.firstElementChild?.tagName=="A"?(e.firstElementChild.className=u,e.innerHTML):me(r,{className:u,target:"_blank",validate:{url:n=>/^https?:\/\//.test(n)}})},o=r=>{const c=parseInt(r);return isNaN(c)?r:new Date(c).toISOString().split("T")[0]};return(r,c)=>(t(),a("div",null,[(t(!0),a(R,null,Y(_(),(u,e,n)=>(t(),a("div",{class:"p-5 pl-3 flex justify-end flex-wrap even:bg-gray-300",key:n},[h("span",Re,I(u.alias),1),c[0]||(c[0]=h("span",{class:"flex-auto"},null,-1)),h("span",{class:"inline",innerHTML:y(u.value,u.alias,u.type)},null,8,Ke)]))),128))]))}}),Ye=["innerHTML"],Xe={key:1},Je=F({__name:"html-default",props:{identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z();return(i,d)=>v.identifyData?(t(),a("div",{key:0,class:"whitespace-pre-wrap break-words h-full overflow-auto",innerHTML:v.identifyData.data.data??v.identifyData.data},null,8,Ye)):(t(),a("div",Xe,I(w(k)("details.layers.results.empty")),1))}}),Qe={class:"relative flex flex-grow truncate"},et={key:0,class:"flex flex-grow items-center truncate"},tt={class:"flex p-8 items-center"},lt=["innerHTML"],at={key:1,class:"symbologyIcon p-6"},st=["content","innerHTML","tabindex"],it={key:1,class:"flex p-6 flex-grow"},nt={key:2,class:"zoomButton text-center p-3"},ut=["content","aria-label"],rt={key:0,class:"m-auto animate-spin spinner h-20 w-20"},ot={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"green",class:"m-auto w-20 h-20"},dt={key:2,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"m-auto w-20 h-20"},ct=["innerHTML"],ce=F({__name:"result-item",props:{uid:{type:String,required:!0},data:{type:Object,required:!0},open:{type:Boolean,required:!1},inList:{type:Boolean,required:!1}},setup(v){const k=ne(),i=v,d=ee("iApi"),p=L([]),_=X(),{t:y}=Z(),b=L(""),o=L("none"),r=L(),c=()=>k.getLayerByUid(i.uid),u=M(()=>_.properties),e=M(()=>_.defaultTemplates),n=M(()=>c()?.supportsFeatures??!1),z=M(()=>c()?.mapLayer??!1),C=M(()=>{const l=c()?.nameField;let g=l&&i.data.loaded?i.data.data[l]:d.$i18n.t("details.items.title");return d.ui.isPlainText(g)&&(g=d.ui.escapeHtml(g)),g}),E=l=>{if(typeof l=="string"){const g="underline text-blue-700 break-all",x=document.createElement("div");return x.innerHTML=l.trim(),x.firstElementChild?.tagName=="A"?(x.firstElementChild.className=g,x.innerHTML):me(l,{className:g,target:"_blank",validate:{url:T=>/^https?:\/\//.test(T)}})}return l},m=()=>{q("none"),i.data.loaded?H():i.data.load().then(()=>{H()})},H=()=>{if(b.value="",!(i.data&&i.data.loaded))return;const l=c();if(l===void 0){console.warn(`could not find layer for uid ${i.uid} during icon lookup`);return}if(l.supportsFeatures){const g=l.oidField;l.getIcon(i.data.data[g]).then(x=>{b.value=x})}},f=M(()=>{const l=c();return l&&u.value[l.id]&&u.value[l.id].template?u.value[l.id].template:e.value&&e.value[i.data.format]?e.value[i.data.format]:n.value?We:Je}),P=M(()=>n.value?c()?.fields||[]:[]),D=M(()=>{const l=c();if(l&&u.value[l.id]&&u.value[l.id].fields)return u.value[l.id].fields}),q=l=>{l==="zoomed"||l==="error"?setTimeout(()=>{o.value=l,r.value?._tippy.show(),setTimeout(()=>{r.value?._tippy.hide(),o.value="none"},3e3)},300):o.value=l},$=()=>{if(o.value!=="none")return;q("zooming");const l=c();if(l===void 0||!l.isLoaded){console.warn(`Could not find layer for uid ${i.uid} during zoom geometry lookup`),q("error");return}if(!i.data.loaded){console.warn("Details zoomToFeature call on item that is still loading. Should be impossible, alert the devs."),q("error");return}const g=i.data.data[l.oidField],x=()=>{const T={getGeom:!0};l.getGraphic(g,T).then(B=>{B.geometry.invalid()?(console.error(`Could not find graphic for objectid ${g}`),q("error")):(d.geo.map.zoomMapTo(B.geometry),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom")))}).catch(()=>{q("error")})};l.layerType===je.FEATURE&&l.geomType!==Me.POINT?l.getGraphicExtent(g).then(T=>{d.geo.map.zoomMapTo(T),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom"))}).catch(()=>{x()}):x()};return J(()=>{p.value.push(G(i,()=>{m()},{deep:!1,immediate:!0}))}),Q(()=>{p.value.forEach(l=>l())}),(l,g)=>{const x=N("truncate"),T=N("tippy");return t(),a(R,null,[h("div",Qe,[n.value?(t(),a("div",et,[h("div",tt,[v.data.loaded&&b.value?(t(),a("span",{key:0,class:"flex-none symbologyIcon",innerHTML:b.value},null,8,lt)):(t(),a("div",at,g[1]||(g[1]=[h("div",{class:"animate-spin spinner h-20 w-20"},null,-1)])))]),v.data.loaded?A((t(),a("span",{key:0,class:"pl-3 text-left flex-grow itemName",content:C.value,innerHTML:E(C.value),tabindex:v.inList?-1:0},null,8,st)),[[x,{options:{placement:"right"}}]]):(t(),a("div",it,I(w(y)("details.loading")),1)),v.data.loaded?(t(),a("span",nt,[z.value?A((t(),a("button",{key:0,type:"button",content:w(y)(`details.item.zoom${o.value==="none"?"":`.${o.value}`}`),"aria-label":w(y)(`grid.cells.zoom${o.value==="none"?"":`.${o.value}`}`),ref_key:"zoomButton",ref:r,onClick:g[0]||(g[0]=B=>{B.stopPropagation(),$()}),class:"text-gray-600 w-24 h-24 p-2 flex justify-center items-center"},[o.value==="zooming"?(t(),a("div",rt)):o.value==="zoomed"?(t(),a("svg",ot,g[2]||(g[2]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)]))):o.value==="error"?(t(),a("svg",dt,g[3]||(g[3]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(t(),a("span",{key:3,innerHTML:w(d).ui.getZoomIcon()},null,8,ct))],8,ut)),[[T,{placement:"bottom"}]]):O("",!0)])):O("",!0)])):O("",!0)]),v.open?(t(),V(_e(f.value),{key:0,identifyData:v.data,fields:P.value,fixtureFields:D.value,class:"p-8"},null,8,["identifyData","fields","fixtureFields"])):O("",!0)],64)}}}),vt={key:0,class:"layerName w-full flex-grow p-5 pb-8 font-bold truncate",tabIndex:"0"},pt={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},mt={for:"toggle"},yt={key:2,class:"flex flex-col justify-between p-8 mb-8 bg-gray-100"},ft={class:"flex"},gt=["aria-label"],ht=["content","aria-label","disabled"],bt={class:"px-3 text-center flex-grow"},kt=["content","aria-label","disabled"],xt={key:3},wt={key:0},Lt=["content"],_t=["onClick"],Tt={key:1,class:"text-center"},jt={key:4,class:"p-5"},Mt=F({__name:"result-list",props:{uid:{type:String,required:!0},results:{type:Object,required:!0}},setup(v){const k=L(),i=()=>{k.value._tippy.hide()},d=s=>{s.key==="Tab"&&k.value?.matches(":focus")&&k.value._tippy.show()},p=ee("iApi"),_=X(),y=ne(),b=v,{t:o}=Z(),r=L(!1),c=L(p.fixture.get("details")),u=L(!0),e=L(!1),n=L(0),z=L(20),C=L([]),E=L([]),m=M(()=>_.activeGreedy),H=M(()=>_.properties),f=M(()=>n.value+z.value),P=()=>y.getLayerByUid(b.uid),D=()=>b.results.find(s=>s.uid===b.uid),q=M(()=>D()?.loaded??!1),$=M(()=>D()?.requestTime),l=M(()=>r.value&&(!e.value&&T().length>1||e.value&&T().length>z.value)),g=M(()=>{const s=P();return s&&H.value[s.id]&&H.value[s.id].name?H.value[s.id].name:s?.name??""}),x=M(()=>b.uid),T=()=>{const s=D();return s?s.items:[]},B=M(()=>T()[n.value]),ue=M(()=>{if(c.value.hasHilighter()){const s=P();if(s)return s.mapLayer&&s.supportsFeatures}return!1}),ye=s=>{u.value=s,_.hilightToggle=s,S()},fe=()=>{const s=P();n.value=n.value??0,u.value=_.hilightToggle??u.value,e.value=!1,r.value=!!s,S()},re=s=>{e.value?(n.value+=s*z.value,S()):n.value+=s},S=()=>{const s=T();if(u.value&&q.value&&s.length>0&&ue.value)if(e.value)c.value.hilightDetailsItems(s.slice(n.value,f.value),b.uid);else{const j=s[n.value];j&&c.value.hilightDetailsItems([j],b.uid)}else c.value.removeDetailsHilight()},ge=()=>{e.value=!0,n.value=Math.floor(n.value/z.value)*z.value,S()},he=()=>{c.value.removeDetailsHilight()},be=()=>{c.value.removeDetailsHilight()},ke=s=>{const j=n.value;n.value=s,e.value=!1,j===s&&S()};return ie(()=>{C.value.push(p.event.on(W.LAYER_REMOVE,s=>{const j=p.panel.get("details");b.uid===s.uid&&j&&j.close()})),C.value.push(p.event.on(W.PANEL_CLOSED,s=>{s.id==="details"&&he()})),C.value.push(p.event.on(W.PANEL_MINIMIZED,s=>{s.id==="details"&&be()})),C.value.push(p.event.on(W.MAP_BASEMAPCHANGE,s=>{u.value&&s.schemaChanged&&S()})),k.value?.addEventListener("blur",i),k.value?.addEventListener("keyup",d)}),J(()=>{E.value.push(G(B,()=>{e.value||(fe(),B.value===void 0&&c.value.removeDetailsHilight())},{deep:!1,immediate:!0})),E.value.push(G(x,()=>{const s=b.uid;if(e.value&&s){const j=D();j&&j.loading.then(()=>{b.uid===s&&e.value&&S()})}},{deep:!1,immediate:!0})),E.value.push(G($,()=>{n.value=0})),E.value.push(G(()=>b.uid,()=>{n.value=0}))}),Q(()=>{E.value.forEach(s=>s()),C.value.forEach(s=>p.event.off(s)),k.value?.removeEventListener("blur",i),k.value?.removeEventListener("keyup",d)}),(s,j)=>{const xe=N("truncate"),te=N("tippy"),we=N("focus-item"),Le=N("focus-list");return q.value&&m.value===0?(t(),a("div",{key:0,class:"detailsContent relative flex flex-col flex-grow pl-5",style:ve(v.results.length>1?{"margin-left":"42px"}:"")},[r.value?A((t(),a("h1",vt,[ae(I(g.value),1)])),[[xe,{options:{placement:"top-start"}}]]):O("",!0),ue.value?(t(),a("div",pt,[h("label",mt,I(w(o)("details.togglehilight.title")),1),le(ze,{config:{value:u.value,disabled:!1},onToggled:ye},null,8,["config"])])):O("",!0),l.value?(t(),a("div",yt,[h("div",ft,[e.value?O("",!0):(t(),a("button",{key:0,type:"button",class:"px-8 font-bold hover:bg-gray-200 focus:bg-gray-200","aria-label":w(o)("details.item.see.list"),onClick:j[0]||(j[0]=K=>ge())},I(w(o)("details.item.see.list")),9,gt)),h("div",{class:U(["flex ml-auto bg-gray-200 py-8 items-center",{"w-full":e.value}])},[A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.previous":"details.item.previous.item"),onClick:j[1]||(j[1]=K=>re(-1)),class:"mx-2 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.previous":"details.item.previous.item"),disabled:n.value===0},j[3]||(j[3]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,ht)),[[te,{placement:"top"}]]),h("span",bt,I(e.value?w(o)("details.items.range",[n.value+1,Math.min(f.value,T().length),T().length]):w(o)("details.item.count",[n.value+1,T().length])),1),A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.next":"details.item.next.item"),onClick:j[2]||(j[2]=K=>re(1)),class:"mx-2 rotate-180 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.next":"details.item.next.item"),disabled:!e.value&&n.value===T().length-1||e.value&&f.value>=T().length},j[4]||(j[4]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,kt)),[[te,{placement:"top"}]])],2)])])):O("",!0),r.value?(t(),a("div",xt,[T().length>0?(t(),a("div",wt,[e.value?A((t(),a("div",{key:0,class:"flex flex-col",content:w(o)("details.layers.results.list.tooltip"),ref_key:"el",ref:k},[(t(!0),a(R,null,Y(T().slice(n.value,f.value),(K,oe)=>A((t(),a("button",{class:"flex flex-grow truncate default-focus-style hover:bg-gray-200",key:oe,onClick:Et=>ke(n.value+oe)},[le(ce,{data:K,uid:v.uid,open:!1,"in-list":!0},null,8,["data","uid"])],8,_t)),[[we,"show-truncate"]])),128))],8,Lt)),[[Le],[te,{trigger:"manual",placement:"top-start",touch:!1}]]):(t(),V(ce,{key:1,data:B.value,uid:v.uid,open:!0,"in-list":!1},null,8,["data","uid"]))])):(t(),a("div",Tt,I(w(o)("details.layers.results.empty.currentLayer")),1))])):(t(),a("div",jt,I(w(o)("details.item.no.data")),1))],4)):(t(),a("div",{key:1,class:U(["flex justify-center py-10 items-center",v.results.length>1?"ml-42":""])},[j[5]||(j[5]=h("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1)),ae(" "+I(w(o)("details.item.loading")),1)],2))}}}),zt=se(Mt,[["__scopeId","data-v-3a47d6ad"]]),Ht={class:"relative h-full"},$t={class:"detailsContentSection overflow-y-auto h-full"},qt=F({__name:"details-screen",props:{panel:{type:Object}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=X(),p=L([]),_=L([]),y=L([]),b=L(!1),o=L(""),r=M(()=>d.activeGreedy),c=M(()=>d.payload),u=M(()=>d.properties),e=m=>{o.value=m},n=m=>y.value.find(H=>H.uid===m),z=m=>{m!==void 0&&(d.activeGreedy=m.length===0?0:m[0].requestTime,y.value=m,C(m))},C=m=>{if(o.value){const H=n(o.value);H?H.loading.then(()=>{H.requestTime===r.value&&(H.items.length>0?(d.activeGreedy=0,b.value=!1):E(m))}):E(m)}else E(m)},E=(m,H)=>{let f;if(H)f=H;else{const $=d.properties,l=m.map(x=>[$[x.layerId]?.priority??50,x.layerId]),g=new Set(l.map(x=>x[0]));f=[],g.forEach(x=>{const T=l.filter(B=>B[0]===x).map(B=>B[1]);f.push([x,T])}),f.sort((x,T)=>T[0]-x[0])}if(f.length===0){d.activeGreedy=0,b.value=!0;return}const P=f[f.length-1][1],D=m.filter($=>P.includes($.layerId)).map($=>$.loading.then(()=>$.items.length>0?Promise.resolve($):Promise.reject())),q=m.length===0?0:m[0].requestTime;Promise.any(D).then($=>{$.requestTime===r.value&&(d.activeGreedy=0,o.value=$.uid,b.value=!1)}).catch(()=>{q===r.value&&(f.pop(),E(m,f))})};return J(()=>{_.value.push(G(c,m=>{z(m)},{deep:!1,immediate:!0}))}),Q(()=>{p.value.forEach(m=>i.event.off(m)),_.value.forEach(m=>m())}),(m,H)=>{const f=Te("panel-screen");return t(),V(f,{panel:v.panel},{header:de(()=>[ae(I(w(d).origin==="toggleEvent"?w(k)("details.layers.title.gridOrigin"):w(k)("details.layers.title.identifyOrigin")),1)]),content:de(()=>[h("div",Ht,[y.value.length>1?(t(),V(Ze,{key:0,results:y.value,detailsProperties:u.value,selected:o.value,onSelectionChanged:e},null,8,["results","detailsProperties","selected"])):O("",!0),h("div",$t,[b.value?(t(),a("div",{key:1,class:U(["text-center",{"ml-42":y.value.length>1}])},I(y.value.length>=1?w(k)("details.layers.results.empty"):w(k)("details.layers.results.empty.noLayers")),3)):(t(),V(zt,{key:0,uid:o.value,results:y.value},null,8,["uid","results"]))])])]),_:1},8,["panel"])}}}),Bt=se(qt,[["__scopeId","data-v-2a8a1e06"]]);export{Bt as default}; +import{eT as F,eU as se,f6 as L,f8 as ie,e$ as t,fb as a,f2 as h,fl as R,fm as Y,f3 as U,fF as ve,f5 as O,fg as I,fx as X,eZ as M,fa as N,fc as A,fo as le,gb as pe,eX as Z,gj as ne,fi as J,f7 as G,f9 as Q,f0 as V,f4 as w,eY as ee,fn as _e,eV as W,fG as ae,e_ as Te,f1 as de,gq as me,fK as je,gp as Me}from"./story-Doly9N9p.js";import{Z as ze}from"./toggle-switch-control-B4JzuvHa-B1HiDvC7.js";import"./main-QGPoLsvl.js";const He={key:0,class:"relative"},$e={key:0,class:"relative"},qe=["innerHTML"],Ee=["src"],Ie={key:1,class:"w-32 h-32"},Oe={class:"symbologyIcon"},Ce=["innerHTML"],Be=["src"],De={class:"badge z-50 rounded-full text-white absolute h-10 w-10 p-8 inline-flex items-center justify-center"},Ae={key:0,class:"px-5"},Ne={key:1,class:"inline-flex justify-center items-center relative"},Pe=F({__name:"symbology-stack",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0}},setup(v){const k=v,i=L([]);return ie(()=>{i.value=k.layer.legend}),(d,p)=>v.result.loaded?(t(),a("div",He,[h("div",{class:U(v.result.items.length===0?"opacity-50":"")},[i.value.length>1?(t(),a("div",$e,[(t(!0),a(R,null,Y(i.value.slice(0,3).reverse(),(_,y)=>(t(),a("div",{class:U(["absolute",[y==0?"symbol-0":y==1?"left-3":"left-6"]]),style:ve({"z-index":3-y}),key:y},[i.value[y].svgcode?(t(),a("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[y].svgcode},null,8,qe)):i.value[y].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[y].imgUrl},null,8,Ee)):O("",!0)],6))),128))])):i.value.length>0?(t(),a("div",Ie,[h("div",Oe,[i.value[0].svgcode?(t(),a("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ce)):i.value[0].imgUrl?(t(),a("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Be)):O("",!0)])])):O("",!0)],2),h("div",De,[v.result.loaded?(t(),a("div",Ae,I(v.result.items.length),1)):O("",!0)])])):(t(),a("div",Ne,p[0]||(p[0]=[h("div",{class:"symbologyIcon h-32 w-32"},[h("div",{class:"relative animate-spin spinner h-24 w-24"})],-1)])))}}),Fe=se(Pe,[["__scopeId","data-v-496d788d"]]),Se=["content"],Ge={class:"symbologyLayerName truncate"},Ue=F({__name:"symbology-item",props:{layer:{type:Object,required:!0},result:{type:Object,required:!0},selected:{type:Boolean,required:!0}},setup(v){const k=X(),i=M(()=>k.properties),d=v,p=()=>{const _=d.layer;return _&&i.value[_.id]&&i.value[_.id].name?i.value[_.id].name:_?.name??""};return(_,y)=>{const b=N("tippy");return A((t(),a("button",{class:U(["flex flex-grow justify-start items-center px-7 py-10 default-focus-style symbologyStackButton truncate",v.selected?"detailsButtonSelected":"px-11"]),onClick:y[0]||(y[0]=pe(()=>{},["stop"])),content:p()},[le(Fe,{class:"symbStack w-32 h-32 mr-10",layer:v.layer,result:v.result},null,8,["layer","result"]),h("div",Ge,I(p()),1)],10,Se)),[[b,{placement:"right",sticky:!0}]])}}}),Ve=["content"],Ze=F({__name:"symbology-list",props:{results:{type:Object,required:!0},selected:{type:String,required:!0}},emits:["selection-changed"],setup(v,{emit:k}){const{t:i}=Z(),d=ne(),p=L(),_=()=>{p.value._tippy.hide()},y=f=>{f.key==="Tab"&&p.value?.matches(":focus")&&p.value._tippy.show()},b=k,o=v,r=L(""),c=L([]),u=L(!1),e=L(!1),n=f=>d.getLayerByUid(f),z=f=>{r.value=f,b("selection-changed",f),u.value=!1},C=()=>{e.value||setTimeout(()=>{u.value=e.value},500),e.value=!0},E=()=>{u.value=e.value=!1},m=()=>{e.value||(u.value=!0),e.value=!0},H=()=>{u.value=e.value=!1};return J(()=>{c.value.push(G(o,()=>{r.value=o.selected}))}),ie(()=>{p.value?.addEventListener("blur",_),p.value?.addEventListener("keyup",y)}),Q(()=>{c.value.forEach(f=>f()),p.value?.removeEventListener("blur",_),p.value?.removeEventListener("keyup",y)}),(f,P)=>{const D=N("focus-item"),q=N("focus-list"),$=N("tippy");return A((t(),a("div",{class:U(["symbology-list absolute overflow-hidden z-50 p-0 w-48 bg-white text-sm inline-flex flex-col",{"symbology-list-expanded":u.value}]),onMouseover:C,onMouseleave:E,onFocus:m,onBlur:pe(H,["self"]),content:w(i)("details.layers.results.list.tooltip"),ref_key:"el",ref:p},[(t(!0),a(R,null,Y(o.results,(l,g)=>(t(),a("div",{class:"flex justify-start relative",key:g},[A((t(),V(Ue,{key:l.uid,layer:n(l.uid),result:l,selected:l.uid===r.value,onClick:x=>z(l.uid)},null,8,["layer","result","selected","onClick"])),[[D]])]))),128))],42,Ve)),[[q],[$,{trigger:"manual",placement:"top-start",touch:!1}]])}}}),Re={class:"inline font-bold"},Ke=["innerHTML"],We=F({__name:"esri-default",props:{fixtureFields:{type:Object,required:!1},fields:{type:Object,required:!0},identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=v,p=(r,c,u,e)=>{const n=r.find(z=>z[c].toLowerCase()===u.toLowerCase());n&&delete e[n.name]},_=()=>{const r=Object.assign({},d.identifyData.data);p(d.fields,"type","geometry",r),i?.ui.exposeOids||p(d.fields,"type","oid",r),i?.ui.exposeMeasurements||(p(d.fields,"name","shape_length",r),p(d.fields,"name","shape_area",r));const c={};d.fields.forEach(e=>{const n=d.fixtureFields?.find(z=>e.name===z.field);c[e.name]={name:n?.alias||e.alias||e.name,type:e.type,visible:n?.visible??!0}});const u={};Object.keys(r).forEach(e=>{const n=c[e];if(n&&n.visible){const z=r[e];u[e]={value:typeof z=="number"?i?.ui.formatNumber(z):z,alias:n.name,type:n.type}}});for(const[e]of Object.entries(u))i.ui.isPlainText(u[e].value)&&(u[e].value=i.ui.escapeHtml(u[e].value));return u},y=(r,c,u)=>{switch(u){case"date":return o(r);default:return b(r,c)}},b=(r,c)=>{if(!r)return r;if(r.trim().match(/\.(jpeg|jpg|gif|png)$/)||r.trim().match(/^\s*data:([a-z]+\/[a-z]+(;[a-z\-]+\=[a-z\-]+)?)?(;base64)?,[a-z0-9\!\$\&\'\,\(\)\*\+\,\;\=\-\.\_\~\:\@\/\?\%\s]*\s*$/i))return`${k(`;const u="underline text-blue-700 break-all",e=document.createElement("div");return e.innerHTML=r.trim(),e.firstElementChild?.tagName=="A"?(e.firstElementChild.className=u,e.innerHTML):me(r,{className:u,target:"_blank",validate:{url:n=>/^https?:\/\//.test(n)}})},o=r=>{const c=parseInt(r);return isNaN(c)?r:new Date(c).toISOString().split("T")[0]};return(r,c)=>(t(),a("div",null,[(t(!0),a(R,null,Y(_(),(u,e,n)=>(t(),a("div",{class:"p-5 pl-3 flex justify-end flex-wrap even:bg-gray-300",key:n},[h("span",Re,I(u.alias),1),c[0]||(c[0]=h("span",{class:"flex-auto"},null,-1)),h("span",{class:"inline",innerHTML:y(u.value,u.alias,u.type)},null,8,Ke)]))),128))]))}}),Ye=["innerHTML"],Xe={key:1},Je=F({__name:"html-default",props:{identifyData:{type:Object,required:!0}},setup(v){const{t:k}=Z();return(i,d)=>v.identifyData?(t(),a("div",{key:0,class:"whitespace-pre-wrap break-words h-full overflow-auto",innerHTML:v.identifyData.data.data??v.identifyData.data},null,8,Ye)):(t(),a("div",Xe,I(w(k)("details.layers.results.empty")),1))}}),Qe={class:"relative flex flex-grow truncate"},et={key:0,class:"flex flex-grow items-center truncate"},tt={class:"flex p-8 items-center"},lt=["innerHTML"],at={key:1,class:"symbologyIcon p-6"},st=["content","innerHTML","tabindex"],it={key:1,class:"flex p-6 flex-grow"},nt={key:2,class:"zoomButton text-center p-3"},ut=["content","aria-label"],rt={key:0,class:"m-auto animate-spin spinner h-20 w-20"},ot={key:1,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"green",class:"m-auto w-20 h-20"},dt={key:2,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"red",class:"m-auto w-20 h-20"},ct=["innerHTML"],ce=F({__name:"result-item",props:{uid:{type:String,required:!0},data:{type:Object,required:!0},open:{type:Boolean,required:!1},inList:{type:Boolean,required:!1}},setup(v){const k=ne(),i=v,d=ee("iApi"),p=L([]),_=X(),{t:y}=Z(),b=L(""),o=L("none"),r=L(),c=()=>k.getLayerByUid(i.uid),u=M(()=>_.properties),e=M(()=>_.defaultTemplates),n=M(()=>c()?.supportsFeatures??!1),z=M(()=>c()?.mapLayer??!1),C=M(()=>{const l=c()?.nameField;let g=l&&i.data.loaded?i.data.data[l]:d.$i18n.t("details.items.title");return d.ui.isPlainText(g)&&(g=d.ui.escapeHtml(g)),g}),E=l=>{if(typeof l=="string"){const g="underline text-blue-700 break-all",x=document.createElement("div");return x.innerHTML=l.trim(),x.firstElementChild?.tagName=="A"?(x.firstElementChild.className=g,x.innerHTML):me(l,{className:g,target:"_blank",validate:{url:T=>/^https?:\/\//.test(T)}})}return l},m=()=>{q("none"),i.data.loaded?H():i.data.load().then(()=>{H()})},H=()=>{if(b.value="",!(i.data&&i.data.loaded))return;const l=c();if(l===void 0){console.warn(`could not find layer for uid ${i.uid} during icon lookup`);return}if(l.supportsFeatures){const g=l.oidField;l.getIcon(i.data.data[g]).then(x=>{b.value=x})}},f=M(()=>{const l=c();return l&&u.value[l.id]&&u.value[l.id].template?u.value[l.id].template:e.value&&e.value[i.data.format]?e.value[i.data.format]:n.value?We:Je}),P=M(()=>n.value?c()?.fields||[]:[]),D=M(()=>{const l=c();if(l&&u.value[l.id]&&u.value[l.id].fields)return u.value[l.id].fields}),q=l=>{l==="zoomed"||l==="error"?setTimeout(()=>{o.value=l,r.value?._tippy.show(),setTimeout(()=>{r.value?._tippy.hide(),o.value="none"},3e3)},300):o.value=l},$=()=>{if(o.value!=="none")return;q("zooming");const l=c();if(l===void 0||!l.isLoaded){console.warn(`Could not find layer for uid ${i.uid} during zoom geometry lookup`),q("error");return}if(!i.data.loaded){console.warn("Details zoomToFeature call on item that is still loading. Should be impossible, alert the devs."),q("error");return}const g=i.data.data[l.oidField],x=()=>{const T={getGeom:!0};l.getGraphic(g,T).then(B=>{B.geometry.invalid()?(console.error(`Could not find graphic for objectid ${g}`),q("error")):(d.geo.map.zoomMapTo(B.geometry),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom")))}).catch(()=>{q("error")})};l.layerType===je.FEATURE&&l.geomType!==Me.POINT?l.getGraphicExtent(g).then(T=>{d.geo.map.zoomMapTo(T),q("zoomed"),d.updateAlert(d.$i18n.t("details.item.alert.zoom"))}).catch(()=>{x()}):x()};return J(()=>{p.value.push(G(i,()=>{m()},{deep:!1,immediate:!0}))}),Q(()=>{p.value.forEach(l=>l())}),(l,g)=>{const x=N("truncate"),T=N("tippy");return t(),a(R,null,[h("div",Qe,[n.value?(t(),a("div",et,[h("div",tt,[v.data.loaded&&b.value?(t(),a("span",{key:0,class:"flex-none symbologyIcon",innerHTML:b.value},null,8,lt)):(t(),a("div",at,g[1]||(g[1]=[h("div",{class:"animate-spin spinner h-20 w-20"},null,-1)])))]),v.data.loaded?A((t(),a("span",{key:0,class:"pl-3 text-left flex-grow itemName",content:C.value,innerHTML:E(C.value),tabindex:v.inList?-1:0},null,8,st)),[[x,{options:{placement:"right"}}]]):(t(),a("div",it,I(w(y)("details.loading")),1)),v.data.loaded?(t(),a("span",nt,[z.value?A((t(),a("button",{key:0,type:"button",content:w(y)(`details.item.zoom${o.value==="none"?"":`.${o.value}`}`),"aria-label":w(y)(`grid.cells.zoom${o.value==="none"?"":`.${o.value}`}`),ref_key:"zoomButton",ref:r,onClick:g[0]||(g[0]=B=>{B.stopPropagation(),$()}),class:"text-gray-600 w-24 h-24 p-2 flex justify-center items-center"},[o.value==="zooming"?(t(),a("div",rt)):o.value==="zoomed"?(t(),a("svg",ot,g[2]||(g[2]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)]))):o.value==="error"?(t(),a("svg",dt,g[3]||(g[3]=[h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(t(),a("span",{key:3,innerHTML:w(d).ui.getZoomIcon()},null,8,ct))],8,ut)),[[T,{placement:"bottom"}]]):O("",!0)])):O("",!0)])):O("",!0)]),v.open?(t(),V(_e(f.value),{key:0,identifyData:v.data,fields:P.value,fixtureFields:D.value,class:"p-8"},null,8,["identifyData","fields","fixtureFields"])):O("",!0)],64)}}}),vt={key:0,class:"layerName w-full flex-grow p-5 pb-8 font-bold truncate",tabIndex:"0"},pt={key:1,class:"p-8 mb-8 bg-gray-100 flex justify-between"},mt={for:"toggle"},yt={key:2,class:"flex flex-col justify-between p-8 mb-8 bg-gray-100"},ft={class:"flex"},gt=["aria-label"],ht=["content","aria-label","disabled"],bt={class:"px-3 text-center flex-grow"},kt=["content","aria-label","disabled"],xt={key:3},wt={key:0},Lt=["content"],_t=["onClick"],Tt={key:1,class:"text-center"},jt={key:4,class:"p-5"},Mt=F({__name:"result-list",props:{uid:{type:String,required:!0},results:{type:Object,required:!0}},setup(v){const k=L(),i=()=>{k.value._tippy.hide()},d=s=>{s.key==="Tab"&&k.value?.matches(":focus")&&k.value._tippy.show()},p=ee("iApi"),_=X(),y=ne(),b=v,{t:o}=Z(),r=L(!1),c=L(p.fixture.get("details")),u=L(!0),e=L(!1),n=L(0),z=L(20),C=L([]),E=L([]),m=M(()=>_.activeGreedy),H=M(()=>_.properties),f=M(()=>n.value+z.value),P=()=>y.getLayerByUid(b.uid),D=()=>b.results.find(s=>s.uid===b.uid),q=M(()=>D()?.loaded??!1),$=M(()=>D()?.requestTime),l=M(()=>r.value&&(!e.value&&T().length>1||e.value&&T().length>z.value)),g=M(()=>{const s=P();return s&&H.value[s.id]&&H.value[s.id].name?H.value[s.id].name:s?.name??""}),x=M(()=>b.uid),T=()=>{const s=D();return s?s.items:[]},B=M(()=>T()[n.value]),ue=M(()=>{if(c.value.hasHilighter()){const s=P();if(s)return s.mapLayer&&s.supportsFeatures}return!1}),ye=s=>{u.value=s,_.hilightToggle=s,S()},fe=()=>{const s=P();n.value=n.value??0,u.value=_.hilightToggle??u.value,e.value=!1,r.value=!!s,S()},re=s=>{e.value?(n.value+=s*z.value,S()):n.value+=s},S=()=>{const s=T();if(u.value&&q.value&&s.length>0&&ue.value)if(e.value)c.value.hilightDetailsItems(s.slice(n.value,f.value),b.uid);else{const j=s[n.value];j&&c.value.hilightDetailsItems([j],b.uid)}else c.value.removeDetailsHilight()},ge=()=>{e.value=!0,n.value=Math.floor(n.value/z.value)*z.value,S()},he=()=>{c.value.removeDetailsHilight()},be=()=>{c.value.removeDetailsHilight()},ke=s=>{const j=n.value;n.value=s,e.value=!1,j===s&&S()};return ie(()=>{C.value.push(p.event.on(W.LAYER_REMOVE,s=>{const j=p.panel.get("details");b.uid===s.uid&&j&&j.close()})),C.value.push(p.event.on(W.PANEL_CLOSED,s=>{s.id==="details"&&he()})),C.value.push(p.event.on(W.PANEL_MINIMIZED,s=>{s.id==="details"&&be()})),C.value.push(p.event.on(W.MAP_BASEMAPCHANGE,s=>{u.value&&s.schemaChanged&&S()})),k.value?.addEventListener("blur",i),k.value?.addEventListener("keyup",d)}),J(()=>{E.value.push(G(B,()=>{e.value||(fe(),B.value===void 0&&c.value.removeDetailsHilight())},{deep:!1,immediate:!0})),E.value.push(G(x,()=>{const s=b.uid;if(e.value&&s){const j=D();j&&j.loading.then(()=>{b.uid===s&&e.value&&S()})}},{deep:!1,immediate:!0})),E.value.push(G($,()=>{n.value=0})),E.value.push(G(()=>b.uid,()=>{n.value=0}))}),Q(()=>{E.value.forEach(s=>s()),C.value.forEach(s=>p.event.off(s)),k.value?.removeEventListener("blur",i),k.value?.removeEventListener("keyup",d)}),(s,j)=>{const xe=N("truncate"),te=N("tippy"),we=N("focus-item"),Le=N("focus-list");return q.value&&m.value===0?(t(),a("div",{key:0,class:"detailsContent relative flex flex-col flex-grow pl-5",style:ve(v.results.length>1?{"margin-left":"42px"}:"")},[r.value?A((t(),a("h1",vt,[ae(I(g.value),1)])),[[xe,{options:{placement:"top-start"}}]]):O("",!0),ue.value?(t(),a("div",pt,[h("label",mt,I(w(o)("details.togglehilight.title")),1),le(ze,{config:{value:u.value,disabled:!1},onToggled:ye},null,8,["config"])])):O("",!0),l.value?(t(),a("div",yt,[h("div",ft,[e.value?O("",!0):(t(),a("button",{key:0,type:"button",class:"px-8 font-bold hover:bg-gray-200 focus:bg-gray-200","aria-label":w(o)("details.item.see.list"),onClick:j[0]||(j[0]=K=>ge())},I(w(o)("details.item.see.list")),9,gt)),h("div",{class:U(["flex ml-auto bg-gray-200 py-8 items-center",{"w-full":e.value}])},[A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.previous":"details.item.previous.item"),onClick:j[1]||(j[1]=K=>re(-1)),class:"mx-2 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.previous":"details.item.previous.item"),disabled:n.value===0},j[3]||(j[3]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,ht)),[[te,{placement:"top"}]]),h("span",bt,I(e.value?w(o)("details.items.range",[n.value+1,Math.min(f.value,T().length),T().length]):w(o)("details.item.count",[n.value+1,T().length])),1),A((t(),a("button",{type:"button",content:w(o)(e.value?"details.items.next":"details.item.next.item"),onClick:j[2]||(j[2]=K=>re(1)),class:"mx-2 rotate-180 opacity-60 hover:opacity-90 disabled:opacity-30 disabled:cursor-default","aria-label":w(o)(e.value?"details.items.next":"details.item.next.item"),disabled:!e.value&&n.value===T().length-1||e.value&&f.value>=T().length},j[4]||(j[4]=[h("svg",{height:"24",width:"24",viewBox:"0 0 23 23"},[h("g",null,[h("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})])],-1)]),8,kt)),[[te,{placement:"top"}]])],2)])])):O("",!0),r.value?(t(),a("div",xt,[T().length>0?(t(),a("div",wt,[e.value?A((t(),a("div",{key:0,class:"flex flex-col",content:w(o)("details.layers.results.list.tooltip"),ref_key:"el",ref:k},[(t(!0),a(R,null,Y(T().slice(n.value,f.value),(K,oe)=>A((t(),a("button",{class:"flex flex-grow truncate default-focus-style hover:bg-gray-200",key:oe,onClick:Et=>ke(n.value+oe)},[le(ce,{data:K,uid:v.uid,open:!1,"in-list":!0},null,8,["data","uid"])],8,_t)),[[we,"show-truncate"]])),128))],8,Lt)),[[Le],[te,{trigger:"manual",placement:"top-start",touch:!1}]]):(t(),V(ce,{key:1,data:B.value,uid:v.uid,open:!0,"in-list":!1},null,8,["data","uid"]))])):(t(),a("div",Tt,I(w(o)("details.layers.results.empty.currentLayer")),1))])):(t(),a("div",jt,I(w(o)("details.item.no.data")),1))],4)):(t(),a("div",{key:1,class:U(["flex justify-center py-10 items-center",v.results.length>1?"ml-42":""])},[j[5]||(j[5]=h("span",{class:"animate-spin spinner h-20 w-20 px-5 mr-8"},null,-1)),ae(" "+I(w(o)("details.item.loading")),1)],2))}}}),zt=se(Mt,[["__scopeId","data-v-3a47d6ad"]]),Ht={class:"relative h-full"},$t={class:"detailsContentSection overflow-y-auto h-full"},qt=F({__name:"details-screen",props:{panel:{type:Object}},setup(v){const{t:k}=Z(),i=ee("iApi"),d=X(),p=L([]),_=L([]),y=L([]),b=L(!1),o=L(""),r=M(()=>d.activeGreedy),c=M(()=>d.payload),u=M(()=>d.properties),e=m=>{o.value=m},n=m=>y.value.find(H=>H.uid===m),z=m=>{m!==void 0&&(d.activeGreedy=m.length===0?0:m[0].requestTime,y.value=m,C(m))},C=m=>{if(o.value){const H=n(o.value);H?H.loading.then(()=>{H.requestTime===r.value&&(H.items.length>0?(d.activeGreedy=0,b.value=!1):E(m))}):E(m)}else E(m)},E=(m,H)=>{let f;if(H)f=H;else{const $=d.properties,l=m.map(x=>[$[x.layerId]?.priority??50,x.layerId]),g=new Set(l.map(x=>x[0]));f=[],g.forEach(x=>{const T=l.filter(B=>B[0]===x).map(B=>B[1]);f.push([x,T])}),f.sort((x,T)=>T[0]-x[0])}if(f.length===0){d.activeGreedy=0,b.value=!0;return}const P=f[f.length-1][1],D=m.filter($=>P.includes($.layerId)).map($=>$.loading.then(()=>$.items.length>0?Promise.resolve($):Promise.reject())),q=m.length===0?0:m[0].requestTime;Promise.any(D).then($=>{$.requestTime===r.value&&(d.activeGreedy=0,o.value=$.uid,b.value=!1)}).catch(()=>{q===r.value&&(f.pop(),E(m,f))})};return J(()=>{_.value.push(G(c,m=>{z(m)},{deep:!1,immediate:!0}))}),Q(()=>{p.value.forEach(m=>i.event.off(m)),_.value.forEach(m=>m())}),(m,H)=>{const f=Te("panel-screen");return t(),V(f,{panel:v.panel},{header:de(()=>[ae(I(w(d).origin==="toggleEvent"?w(k)("details.layers.title.gridOrigin"):w(k)("details.layers.title.identifyOrigin")),1)]),content:de(()=>[h("div",Ht,[y.value.length>1?(t(),V(Ze,{key:0,results:y.value,detailsProperties:u.value,selected:o.value,onSelectionChanged:e},null,8,["results","detailsProperties","selected"])):O("",!0),h("div",$t,[b.value?(t(),a("div",{key:1,class:U(["text-center",{"ml-42":y.value.length>1}])},I(y.value.length>=1?w(k)("details.layers.results.empty"):w(k)("details.layers.results.empty.noLayers")),3)):(t(),V(zt,{key:0,uid:o.value,results:y.value},null,8,["uid","results"]))])])]),_:1},8,["panel"])}}}),Bt=se(qt,[["__scopeId","data-v-2a8a1e06"]]);export{Bt as default}; diff --git a/custom-toc-highlight/assets/diffUtils-Cz3Fi8Xb-BE5g3Qm4.js b/custom-toc-highlight/assets/diffUtils-Cz3Fi8Xb-Cwe8AFcX.js similarity index 96% rename from custom-toc-highlight/assets/diffUtils-Cz3Fi8Xb-BE5g3Qm4.js rename to custom-toc-highlight/assets/diffUtils-Cz3Fi8Xb-Cwe8AFcX.js index bbd74839..10c46e97 100644 --- a/custom-toc-highlight/assets/diffUtils-Cz3Fi8Xb-BE5g3Qm4.js +++ b/custom-toc-highlight/assets/diffUtils-Cz3Fi8Xb-Cwe8AFcX.js @@ -1 +1 @@ -import{ag as g,bU as D,j as w}from"./story-BfX8CRfG.js";const A=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function y(e){return e instanceof w}function b(e){return e instanceof g?Object.keys(e.items):y(e)?D(e).keys():e?Object.keys(e):[]}function p(e,n){return e instanceof g?e.items[n]:e[n]}function k(e,n){return!(!Array.isArray(e)||!Array.isArray(n))&&e.length!==n.length}function c(e){return e?e.declaredClass:null}function h(e,n){const o=e.diff;if(o&&typeof o=="function")return o(e,n);const i=b(e),f=b(n);if(i.length===0&&f.length===0)return;if(!i.length||!f.length||k(e,n))return{type:"complete",oldValue:e,newValue:n};const s=f.filter(t=>!i.includes(t)),V=i.filter(t=>!f.includes(t)),m=i.filter(t=>f.includes(t)&&p(e,t)!==p(n,t)).concat(s,V).sort(),d=c(e);if(d&&A.has(d)&&m.length)return{type:"complete",oldValue:e,newValue:n};let a;const j=y(e)&&y(n);for(const t of m){const l=p(e,t),r=p(n,t);let u;if((j||typeof l!="function"&&typeof r!="function")&&l!==r&&(l!=null||r!=null)){if(o&&o[t]&&typeof o[t]=="function")u=o[t]?.(l,r);else if(l instanceof Date&&r instanceof Date){if(l.getTime()===r.getTime())continue;u={type:"complete",oldValue:l,newValue:r}}else u=typeof l=="object"&&typeof r=="object"&&c(l)===c(r)?h(l,r):{type:"complete",oldValue:l,newValue:r};u!=null&&(a!=null?a.diff[t]=u:a={type:"partial",diff:{[t]:u}})}}return a}function S(e,n){return O(e,n)}function O(e,n){if(e==null)return!1;const o=n.split(".");let i=e;for(const f of o){if(i.type==="complete")return!0;if(i.type!=="partial")return!1;{const s=i.diff[f];if(!s)return!1;i=s}}return!0}function C(e,n){if(!e)return!1;if(e.type==="partial"){const o=Object.keys(e.diff);return o.length===1&&o[0]===n}return!1}function T(e,n){if(typeof e!="function"&&typeof n!="function"&&(e!=null||n!=null))return e==null||n==null||typeof e=="object"&&typeof n=="object"&&c(e)!==c(n)?{type:"complete",oldValue:e,newValue:n}:h(e,n)}export{C,T as P,S,O as g}; +import{ag as g,bU as D,j as w}from"./story-Doly9N9p.js";const A=new Set(["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"]);function y(e){return e instanceof w}function b(e){return e instanceof g?Object.keys(e.items):y(e)?D(e).keys():e?Object.keys(e):[]}function p(e,n){return e instanceof g?e.items[n]:e[n]}function k(e,n){return!(!Array.isArray(e)||!Array.isArray(n))&&e.length!==n.length}function c(e){return e?e.declaredClass:null}function h(e,n){const o=e.diff;if(o&&typeof o=="function")return o(e,n);const i=b(e),f=b(n);if(i.length===0&&f.length===0)return;if(!i.length||!f.length||k(e,n))return{type:"complete",oldValue:e,newValue:n};const s=f.filter(t=>!i.includes(t)),V=i.filter(t=>!f.includes(t)),m=i.filter(t=>f.includes(t)&&p(e,t)!==p(n,t)).concat(s,V).sort(),d=c(e);if(d&&A.has(d)&&m.length)return{type:"complete",oldValue:e,newValue:n};let a;const j=y(e)&&y(n);for(const t of m){const l=p(e,t),r=p(n,t);let u;if((j||typeof l!="function"&&typeof r!="function")&&l!==r&&(l!=null||r!=null)){if(o&&o[t]&&typeof o[t]=="function")u=o[t]?.(l,r);else if(l instanceof Date&&r instanceof Date){if(l.getTime()===r.getTime())continue;u={type:"complete",oldValue:l,newValue:r}}else u=typeof l=="object"&&typeof r=="object"&&c(l)===c(r)?h(l,r):{type:"complete",oldValue:l,newValue:r};u!=null&&(a!=null?a.diff[t]=u:a={type:"partial",diff:{[t]:u}})}}return a}function S(e,n){return O(e,n)}function O(e,n){if(e==null)return!1;const o=n.split(".");let i=e;for(const f of o){if(i.type==="complete")return!0;if(i.type!=="partial")return!1;{const s=i.diff[f];if(!s)return!1;i=s}}return!0}function C(e,n){if(!e)return!1;if(e.type==="partial"){const o=Object.keys(e.diff);return o.length===1&&o[0]===n}return!1}function T(e,n){if(typeof e!="function"&&typeof n!="function"&&(e!=null||n!=null))return e==null||n==null||typeof e=="object"&&typeof n=="object"&&c(e)!==c(n)?{type:"complete",oldValue:e,newValue:n}:h(e,n)}export{C,T as P,S,O as g}; diff --git a/custom-toc-highlight/assets/drapedUtils-BZ1SGPtE-B2FavufJ.js b/custom-toc-highlight/assets/drapedUtils-BZ1SGPtE-bBUh2hex.js similarity index 95% rename from custom-toc-highlight/assets/drapedUtils-BZ1SGPtE-B2FavufJ.js rename to custom-toc-highlight/assets/drapedUtils-BZ1SGPtE-bBUh2hex.js index 7a70cbf9..5e55d590 100644 --- a/custom-toc-highlight/assets/drapedUtils-BZ1SGPtE-B2FavufJ.js +++ b/custom-toc-highlight/assets/drapedUtils-BZ1SGPtE-bBUh2hex.js @@ -1 +1 @@ -import{n as m,p as c}from"./story-BfX8CRfG.js";function u(n,e){return e?"xoffset"in e&&e.xoffset?Math.max(n,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(n,Math.abs(e.yoffset||0)):n:n}function x(n){let e=0,r=0;for(let t=0;ta.type==="size").map(a=>{const{maxSize:s,minSize:f}=a;return(p(s,n)+p(f,n))/2});let t=0;const i=r.length;if(i===0)return n;for(let a=0;a{o=u(o,a.symbol)}),o}if(e.type==="class-breaks"){let o=i;return e.classBreakInfos.forEach(a=>{o=u(o,a.symbol)}),o}return e.type==="dot-density"||e.type,i}function d(n,e,r,t=new m){let i=0;if(r.type==="2d")i=e*(r.resolution??0);else if(r.type==="3d"){const h=r.overlayPixelSizeInMapUnits(n),l=r.basemapSpatialReference;i=l==null||l.equals(r.spatialReference)?e*h:c(l)/c(r.spatialReference)}const o=n.x-i,a=n.y-i,s=n.x+i,f=n.y+i,{spatialReference:y}=r;return t.xmin=Math.min(o,s),t.ymin=Math.min(a,f),t.xmax=Math.max(o,s),t.ymax=Math.max(a,f),t.spatialReference=y,t}function q(n,e,r){const t=r.toMap(n);return t==null?!1:d(t,b(),r,z).intersects(e)}const z=new m;export{d as x,b as y,q as z}; +import{n as m,p as c}from"./story-Doly9N9p.js";function u(n,e){return e?"xoffset"in e&&e.xoffset?Math.max(n,Math.abs(e.xoffset)):"yoffset"in e&&e.yoffset?Math.max(n,Math.abs(e.yoffset||0)):n:n}function x(n){let e=0,r=0;for(let t=0;ta.type==="size").map(a=>{const{maxSize:s,minSize:f}=a;return(p(s,n)+p(f,n))/2});let t=0;const i=r.length;if(i===0)return n;for(let a=0;a{o=u(o,a.symbol)}),o}if(e.type==="class-breaks"){let o=i;return e.classBreakInfos.forEach(a=>{o=u(o,a.symbol)}),o}return e.type==="dot-density"||e.type,i}function d(n,e,r,t=new m){let i=0;if(r.type==="2d")i=e*(r.resolution??0);else if(r.type==="3d"){const h=r.overlayPixelSizeInMapUnits(n),l=r.basemapSpatialReference;i=l==null||l.equals(r.spatialReference)?e*h:c(l)/c(r.spatialReference)}const o=n.x-i,a=n.y-i,s=n.x+i,f=n.y+i,{spatialReference:y}=r;return t.xmin=Math.min(o,s),t.ymin=Math.min(a,f),t.xmax=Math.max(o,s),t.ymax=Math.max(a,f),t.spatialReference=y,t}function q(n,e,r){const t=r.toMap(n);return t==null?!1:d(t,b(),r,z).intersects(e)}const z=new m;export{d as x,b as y,q as z}; diff --git a/custom-toc-highlight/assets/edgeProcessing-CALv8P-b-BbEOWK4a.js b/custom-toc-highlight/assets/edgeProcessing-CALv8P-b-sDvNynj9.js similarity index 96% rename from custom-toc-highlight/assets/edgeProcessing-CALv8P-b-BbEOWK4a.js rename to custom-toc-highlight/assets/edgeProcessing-CALv8P-b-sDvNynj9.js index bcb71626..5163c914 100644 --- a/custom-toc-highlight/assets/edgeProcessing-CALv8P-b-BbEOWK4a.js +++ b/custom-toc-highlight/assets/edgeProcessing-CALv8P-b-sDvNynj9.js @@ -1 +1 @@ -import{v as It}from"./deduplicate-D2d-E5Pw-CQcmF3ab.js";import{R as F}from"./InterleavedLayout-DXzw3B2n-iCEii9j9.js";import{T as l}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{p as Q}from"./glUtil-n1JOrdV3-CRAZdee5.js";import{c$ as tt,ha as St,dg as w,bj as ht,ae as Ot,eE as At}from"./story-BfX8CRfG.js";import{g as Et,_ as j,A as st,y as H,W as wt,S as dt,r as rt,l as pt,j as Tt}from"./vec32-D9GsKZ1t-BjayBdwt.js";const Mt=F().vec3f(l.POSITION).u16(l.COMPONENTINDEX).freeze(),Rt=F().vec2u8(l.SIDENESS).freeze();Q(Rt);const q=F().vec3f(l.POSITION0).vec3f(l.POSITION1).vec2i16(l.NORMALCOMPRESSED).u16(l.COMPONENTINDEX).u8(l.VARIANTOFFSET,{glNormalized:!0}).u8(l.VARIANTSTROKE).u8(l.VARIANTEXTENSION,{glNormalized:!0}).freeze(),G=F().vec3f(l.POSITION0).vec3f(l.POSITION1).vec2i16(l.NORMALCOMPRESSED).vec2i16(l.NORMAL2COMPRESSED).u16(l.COMPONENTINDEX).u8(l.VARIANTOFFSET,{glNormalized:!0}).u8(l.VARIANTSTROKE).u8(l.VARIANTEXTENSION,{glNormalized:!0}).freeze();l.POSITION0,l.POSITION1,l.COMPONENTINDEX,l.VARIANTOFFSET,l.VARIANTSTROKE,l.VARIANTEXTENSION,l.NORMALCOMPRESSED,l.NORMAL2COMPRESSED,l.SIDENESS;let yt=class{constructor(){this.position0=w(),this.position1=w(),this.faceNormal0=w(),this.faceNormal1=w(),this.componentIndex=0,this.cosAngle=0}};const U=-1;function vt(t,n,o){const r=t.vertices.position,i=t.vertices.componentIndex,c=S.position0,d=S.position1,g=S.faceNormal0,m=S.faceNormal1,{edges:a,normals:h}=Ct(t),N=a.length/4,A=n.allocate(N);let V=0;const _=N,T=o?.allocate(_);let B=0,e=0,s=0;W.length=0;for(let p=0;pR.length-p.length);const f=new Array,u=new Array;W.forAll(({length:p,index:R})=>{const C=a.data[R],mt=a.data[R+1],et=a.data[R+2],nt=a.data[R+3],ot=nt===U;if(r.getVec(C,c),r.getVec(mt,d),ot){const E=3*et;j(g,h.data[E],h.data[E+1],h.data[E+2]),st(m,g),S.componentIndex=i.get(C),S.cosAngle=H(g,m)}else{let E=3*et;if(j(g,h.data[E],h.data[E+1],h.data[E+2]),E=3*nt,j(m,h.data[E],h.data[E+1],h.data[E+2]),S.componentIndex=i.get(C),S.cosAngle=H(g,m),Vt(S,Lt))return;S.cosAngle<-.9999&&st(m,g)}e+=p,s++,ot||Pt(S,_t)?(n.write(A,V++,S),f.push(p)):Dt(S,gt)&&(T&&o&&o.write(T,B++,S),u.push(p))});const O=new Float32Array(f.reverse()),M=new Float32Array(u.reverse()),y=T&&o?{instancesData:T.slice(0,B),lodInfo:{lengths:M}}:void 0;return{regular:{instancesData:A.slice(0,V),lodInfo:{lengths:O}},silhouette:y,averageEdgeLength:e/s}}function Pt(t,n){return t.cosAnglen}function Dt(t,n){const o=St(t.cosAngle);return wt(it,t.position1,t.position0),o*(H(dt(xt,t.faceNormal0,t.faceNormal1),it)>0?-1:1)>n}function Ct(t){const n=t.faces.length/3,o=t.faces,r=t.neighbors,i=t.vertices.position;I.length=k.length=0;for(let c=0;ct||new bt,deallocator:null}),I=new tt({deallocator:null}),k=new tt({deallocator:null}),S=new yt,xt=w(),it=w(),D=w(),X=w(),z=w(),gt=ht(4),Lt=Math.cos(gt),Ft=ht(35),_t=Math.cos(Ft);function at(t,n,o){const r=n/3,i=new Uint32Array(o+1),c=new Uint32Array(o+1),d=(e,s)=>{e{if(e{const f=2*e,u=s-e;for(let O=1;O=0&&a[f+2*p]>M;p--)a[f+2*p+2]=a[f+2*p],a[f+2*p+3]=a[f+2*p+1];a[f+2*p+2]=M,a[f+2*p+3]=y}};for(let e=0;ee===t[3*s]?0:e===t[3*s+1]?1:e===t[3*s+2]?2:-1,T=(e,s)=>{const f=_(e,s);V[3*s+f]=-1},B=(e,s,f,u)=>{const O=_(e,s);V[3*s+O]=u;const M=_(f,u);V[3*u+M]=s};for(let e=0;e=0?1:-1)*(1-Math.abs(m)):g,h=i<=0?(m>=0?1:-1)*(1-Math.abs(g)):m,N=n*c;t[N]=ct(a),t[N+1]=ct(h)}function ct(t){return Ot(Math.round(32767*t),-32767,32767)}const K=.7;let Nt=class{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?Wt:Bt}write(t,n,o){$.seed=this._edgeHashFunction(o);const r=$.getIntRange(0,255),i=$.getIntRange(0,this.settings.variants-1),c=$.getFloat(),d=255*(.5*Xt(-(1-Math.min(c/K,1))+Math.max(0,c-K)/(1-K),1.2)+.5);t.position0.setVec(n,o.position0),t.position1.setVec(n,o.position1),t.componentIndex.set(n,o.componentIndex),t.variantOffset.set(n,r),t.variantStroke.set(n,i),t.variantExtension.set(n,d)}};const v=new Float32Array(6),P=new Uint32Array(v.buffer),L=new Uint32Array(1);function Bt(t){return v[0]=t.position0[0],v[1]=t.position0[1],v[2]=t.position0[2],v[3]=t.position1[0],v[4]=t.position1[1],v[5]=t.position1[2],L[0]=31*(31*(31*(31*(31*(166811+P[0])+P[1])+P[2])+P[3])+P[4])+P[5],L[0]}function Wt(t){const n=v;n[0]=b(t.position0[0]),n[1]=b(t.position0[1]),n[2]=b(t.position0[2]),n[3]=b(t.position1[0]),n[4]=b(t.position1[1]),n[5]=b(t.position1[2]),L[0]=5381;for(let o=0;oR.length-p.length);const f=new Array,u=new Array;W.forAll(({length:p,index:R})=>{const C=a.data[R],mt=a.data[R+1],et=a.data[R+2],nt=a.data[R+3],ot=nt===U;if(r.getVec(C,c),r.getVec(mt,d),ot){const E=3*et;j(g,h.data[E],h.data[E+1],h.data[E+2]),st(m,g),S.componentIndex=i.get(C),S.cosAngle=H(g,m)}else{let E=3*et;if(j(g,h.data[E],h.data[E+1],h.data[E+2]),E=3*nt,j(m,h.data[E],h.data[E+1],h.data[E+2]),S.componentIndex=i.get(C),S.cosAngle=H(g,m),Vt(S,Lt))return;S.cosAngle<-.9999&&st(m,g)}e+=p,s++,ot||Pt(S,_t)?(n.write(A,V++,S),f.push(p)):Dt(S,gt)&&(T&&o&&o.write(T,B++,S),u.push(p))});const O=new Float32Array(f.reverse()),M=new Float32Array(u.reverse()),y=T&&o?{instancesData:T.slice(0,B),lodInfo:{lengths:M}}:void 0;return{regular:{instancesData:A.slice(0,V),lodInfo:{lengths:O}},silhouette:y,averageEdgeLength:e/s}}function Pt(t,n){return t.cosAnglen}function Dt(t,n){const o=St(t.cosAngle);return wt(it,t.position1,t.position0),o*(H(dt(xt,t.faceNormal0,t.faceNormal1),it)>0?-1:1)>n}function Ct(t){const n=t.faces.length/3,o=t.faces,r=t.neighbors,i=t.vertices.position;I.length=k.length=0;for(let c=0;ct||new bt,deallocator:null}),I=new tt({deallocator:null}),k=new tt({deallocator:null}),S=new yt,xt=w(),it=w(),D=w(),X=w(),z=w(),gt=ht(4),Lt=Math.cos(gt),Ft=ht(35),_t=Math.cos(Ft);function at(t,n,o){const r=n/3,i=new Uint32Array(o+1),c=new Uint32Array(o+1),d=(e,s)=>{e{if(e{const f=2*e,u=s-e;for(let O=1;O=0&&a[f+2*p]>M;p--)a[f+2*p+2]=a[f+2*p],a[f+2*p+3]=a[f+2*p+1];a[f+2*p+2]=M,a[f+2*p+3]=y}};for(let e=0;ee===t[3*s]?0:e===t[3*s+1]?1:e===t[3*s+2]?2:-1,T=(e,s)=>{const f=_(e,s);V[3*s+f]=-1},B=(e,s,f,u)=>{const O=_(e,s);V[3*s+O]=u;const M=_(f,u);V[3*u+M]=s};for(let e=0;e=0?1:-1)*(1-Math.abs(m)):g,h=i<=0?(m>=0?1:-1)*(1-Math.abs(g)):m,N=n*c;t[N]=ct(a),t[N+1]=ct(h)}function ct(t){return Ot(Math.round(32767*t),-32767,32767)}const K=.7;let Nt=class{updateSettings(t){this.settings=t,this._edgeHashFunction=t.reducedPrecision?Wt:Bt}write(t,n,o){$.seed=this._edgeHashFunction(o);const r=$.getIntRange(0,255),i=$.getIntRange(0,this.settings.variants-1),c=$.getFloat(),d=255*(.5*Xt(-(1-Math.min(c/K,1))+Math.max(0,c-K)/(1-K),1.2)+.5);t.position0.setVec(n,o.position0),t.position1.setVec(n,o.position1),t.componentIndex.set(n,o.componentIndex),t.variantOffset.set(n,r),t.variantStroke.set(n,i),t.variantExtension.set(n,d)}};const v=new Float32Array(6),P=new Uint32Array(v.buffer),L=new Uint32Array(1);function Bt(t){return v[0]=t.position0[0],v[1]=t.position0[1],v[2]=t.position0[2],v[3]=t.position1[0],v[4]=t.position1[1],v[5]=t.position1[2],L[0]=31*(31*(31*(31*(31*(166811+P[0])+P[1])+P[2])+P[3])+P[4])+P[5],L[0]}function Wt(t){const n=v;n[0]=b(t.position0[0]),n[1]=b(t.position0[1]),n[2]=b(t.position0[2]),n[3]=b(t.position1[0]),n[4]=b(t.position1[1]),n[5]=b(t.position1[2]),L[0]=5381;for(let o=0;o{(o.addedFeatures.length||o.updatedFeatures.length||o.deletedFeatures.length||o.addedAttachments.length||o.updatedAttachments.length||o.deletedAttachments.length)&&e.emit("edits",o)});const i={result:s.promise};e.emit("apply-edits",i)}try{const{results:i,edits:o}=await C(e,t,r,a),u=l=>l.filter(h=>!h.error).map(v),c={edits:o,addedFeatures:u(i.addFeatureResults),updatedFeatures:u(i.updateFeatureResults),deletedFeatures:u(i.deleteFeatureResults),addedAttachments:u(i.addAttachmentResults),updatedAttachments:u(i.updateAttachmentResults),deletedAttachments:u(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:a.globalIdToObjectId};return i.editedFeatureResults?.length&&(c.editedFeatures=i.editedFeatureResults),s.resolve(c),i}catch(i){throw s.reject(i),i}}async function C(e,t,r,a){if(await e.load(),!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!$(e))throw new n(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:s,options:d}=await D(e,r,a);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,d)}:{edits:s,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function D(e,t,r){const a=w(e),s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),d=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),p=e.infoFor3D!=null;if(X(t,a,r,!!s,!!d,`${e.type}-layer`),!a.data.isVersioned&&r?.gdbVersion)throw new n(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!a.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const i={...r};if(i.rollbackOnFailureEnabled!=null||a.editing.supportsRollbackOnFailure||(i.rollbackOnFailureEnabled=!0),i.rollbackOnFailureEnabled||i.returnServiceEditsOption!=="original-and-current-features"||(i.rollbackOnFailureEnabled===!1&&E.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),i.rollbackOnFailureEnabled=!0),!a.editing.supportsReturnServiceEditsInSourceSpatialReference&&i.returnServiceEditsInSourceSR)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(i.returnServiceEditsInSourceSR&&i.returnServiceEditsOption!=="original-and-current-features")throw new n(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const o=P(t,a,`${e.type}-layer`),u=r?.globalIdUsed||p,c=e.fields.filter(l=>l.type==="big-integer"||l.type==="oid"&&(l.length||0)>=8);if(u){const{globalIdField:l}=e;if(l==null)throw new n(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");o.addFeatures.forEach(h=>q(h,l))}return o.addFeatures.forEach(l=>Z(l,e,u,c)),o.updateFeatures.forEach(l=>x(l,e,u,c)),o.deleteFeatures.forEach(l=>N(l,e,u,c)),o.addAttachments.forEach(l=>m(l,e)),o.updateAttachments.forEach(l=>m(l,e)),p&&await H(o,e),{edits:await J(o),options:i}}function f(e,t,r,a){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(a.length&&"attributes"in e)for(const s of a){const d=e.attributes[s.name];if(d!==void 0&&!k(s,d))throw new n(`${t.type}-layer:invalid-parameter`,`Big-integer field '${s.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&e.geometry!=null){if(e.geometry.hasZ&&t.capabilities?.data.supportsZ===!1)throw new n(`${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 n(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function I(e,t){if("geometry"in e&&e.geometry?.type==="mesh"&&t.infoFor3D!=null&&t.spatialReference!=null){const{geometry:r}=e,{spatialReference:a,vertexSpace:s}=r,d=t.spatialReference,p=s.type==="local",i=L(d),o=U(d,a),u=o||y(d)&&(y(a)||j(a));if(!(p&&i&&u||!p&&!i&&o))throw new n(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${s.type} vertex space and a spatial reference wkid:${a.wkid} to a layer with a spatial reference wkid:${d.wkid} is not supported.`)}}function Z(e,t,r,a){f(e,t,r,a),I(e,t)}function N(e,t,r,a){f(e,t,r,a)}function x(e,t,r,a){f(e,t,r,a),I(e,t);const s=w(t);if("geometry"in e&&e.geometry!=null&&!s?.editing.supportsGeometryUpdate)throw new n(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function m(e,t){const{feature:r,attachment:a}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!a.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!a.data&&!a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(a.data instanceof File&&a.data.name)&&!a.name)throw new n(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof a.data=="string"){const s=S(a.data);if(s&&!s.isBase64)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function q(e,t){const{attributes:r}=e;r[t]==null&&(r[t]=B())}async function J(e){const t=e.addFeatures??[],r=e.updateFeatures??[],a=t.concat(r).map(i=>i.geometry),s=await G(a),d=t.length,p=r.length;return s.slice(0,d).forEach((i,o)=>t[o].geometry=i),s.slice(d,d+p).forEach((i,o)=>r[o].geometry=i),e}function _(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&R.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function P(e,t,r){const a=_(e);if(a.addFeatures?.length&&!t.operations.supportsAdd)throw new n(`${r}:unsupported-operation`,"Layer does not support adding features.");if(a.updateFeatures?.length&&!t.operations.supportsUpdate)throw new n(`${r}:unsupported-operation`,"Layer does not support updating features.");if(a.deleteFeatures?.length&&!t.operations.supportsDelete)throw new n(`${r}:unsupported-operation`,"Layer does not support deleting features.");return a.addFeatures=a.addFeatures.map(g),a.updateFeatures=a.updateFeatures.map(g),a.addAssetFeatures=[],a}function X(e,t,r,a,s,d){if(!e||!a&&!s)throw new n(`${d}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed)throw new n(`${d}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&s)throw new n(`${d}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&s)throw new n(`${d}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function g(e){const t=new O;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function H(e,t){const{infoFor3D:r}=t;if(r==null)return;if(!M(r))throw new n(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:a}=e;for(const s of e.addFeatures??[])b(s)&&a.push(s);for(const s of e.updateFeatures??[])b(s)&&a.push(s)}function b(e){return e?.geometry?.type==="mesh"}function le(e,t,r,a){if(!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new n(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,a)}export{de as applyEdits,X as checkEditingCapabilities,oe as isFeatureIdentifierArrayWithGlobalId,ne as isFeatureIdentifierArrayWithObjectId,W as isFeatureIdentifierWithGlobalId,V as isFeatureIdentifierWithObjectId,_ as normalizeCollections,P as normalizeEdits,J as normalizeGeometries,g as shallowCloneFeature,le as uploadAssets}; +import{b as A,P as v,o as n,bF as $,bE as w,a1 as E,dG as S,ag as R,bi as O,jg as k,cZ as L,aC as U,dc as y,dd as j}from"./story-Doly9N9p.js";import{a as B}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{B as G}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{B as T,z}from"./EditBusLayer-Df29OyJh-OmdJOLws.js";import{g as M}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./main-QGPoLsvl.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";function F(e){return e?.applyEdits!=null}function V(e){return typeof e=="object"&&e!=null&&"objectId"in e&&!!e.objectId}function ne(e){return e.every(V)}function W(e){return typeof e=="object"&&e!=null&&"globalId"in e&&!!e.globalId}function oe(e){return e.every(W)}async function de(e,t,r,a={}){let s;const d="gdbVersion"in e?e.gdbVersion:null,p=a.gdbVersion??d;if(T(e)&&e.url)s=z(e.url,e.layerId,p,a.returnServiceEditsOption==="original-and-current-features");else{s=A(),s.promise.then(o=>{(o.addedFeatures.length||o.updatedFeatures.length||o.deletedFeatures.length||o.addedAttachments.length||o.updatedAttachments.length||o.deletedAttachments.length)&&e.emit("edits",o)});const i={result:s.promise};e.emit("apply-edits",i)}try{const{results:i,edits:o}=await C(e,t,r,a),u=l=>l.filter(h=>!h.error).map(v),c={edits:o,addedFeatures:u(i.addFeatureResults),updatedFeatures:u(i.updateFeatureResults),deletedFeatures:u(i.deleteFeatureResults),addedAttachments:u(i.addAttachmentResults),updatedAttachments:u(i.updateAttachmentResults),deletedAttachments:u(i.deleteAttachmentResults),exceededTransferLimit:!1,historicMoment:i.editMoment?new Date(i.editMoment):null,globalIdToObjectId:a.globalIdToObjectId};return i.editedFeatureResults?.length&&(c.editedFeatures=i.editedFeatureResults),s.resolve(c),i}catch(i){throw s.reject(i),i}}async function C(e,t,r,a){if(await e.load(),!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!$(e))throw new n(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:s,options:d}=await D(e,r,a);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,d)}:{edits:s,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function D(e,t,r){const a=w(e),s=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),d=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),p=e.infoFor3D!=null;if(X(t,a,r,!!s,!!d,`${e.type}-layer`),!a.data.isVersioned&&r?.gdbVersion)throw new n(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!a.editing.supportsRollbackOnFailure&&r?.rollbackOnFailureEnabled)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");const i={...r};if(i.rollbackOnFailureEnabled!=null||a.editing.supportsRollbackOnFailure||(i.rollbackOnFailureEnabled=!0),i.rollbackOnFailureEnabled||i.returnServiceEditsOption!=="original-and-current-features"||(i.rollbackOnFailureEnabled===!1&&E.getLogger("esri.layers.graphics.editingSupport").warn(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true, but 'rollBackOnFailure' was set to false. 'rollBackOnFailure' has been overwritten and set to true."),i.rollbackOnFailureEnabled=!0),!a.editing.supportsReturnServiceEditsInSourceSpatialReference&&i.returnServiceEditsInSourceSR)throw new n(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(i.returnServiceEditsInSourceSR&&i.returnServiceEditsOption!=="original-and-current-features")throw new n(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsInSourceSR' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const o=P(t,a,`${e.type}-layer`),u=r?.globalIdUsed||p,c=e.fields.filter(l=>l.type==="big-integer"||l.type==="oid"&&(l.length||0)>=8);if(u){const{globalIdField:l}=e;if(l==null)throw new n(`${e.type}-layer:invalid-parameter`,"Layer does not specify a global id field.");o.addFeatures.forEach(h=>q(h,l))}return o.addFeatures.forEach(l=>Z(l,e,u,c)),o.updateFeatures.forEach(l=>x(l,e,u,c)),o.deleteFeatures.forEach(l=>N(l,e,u,c)),o.addAttachments.forEach(l=>m(l,e)),o.updateAttachments.forEach(l=>m(l,e)),p&&await H(o,e),{edits:await J(o),options:i}}function f(e,t,r,a){if(r){if("attributes"in e&&!e.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,`Feature should have '${t.globalIdField}' when 'globalIdUsed' is true`);if(!("attributes"in e)&&!e.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"`'globalId' of the feature should be passed when 'globalIdUsed' is true")}if(a.length&&"attributes"in e)for(const s of a){const d=e.attributes[s.name];if(d!==void 0&&!k(s,d))throw new n(`${t.type}-layer:invalid-parameter`,`Big-integer field '${s.name}' of the feature must be less than ${Number.MAX_SAFE_INTEGER}`,{feature:e})}if("geometry"in e&&e.geometry!=null){if(e.geometry.hasZ&&t.capabilities?.data.supportsZ===!1)throw new n(`${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 n(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function I(e,t){if("geometry"in e&&e.geometry?.type==="mesh"&&t.infoFor3D!=null&&t.spatialReference!=null){const{geometry:r}=e,{spatialReference:a,vertexSpace:s}=r,d=t.spatialReference,p=s.type==="local",i=L(d),o=U(d,a),u=o||y(d)&&(y(a)||j(a));if(!(p&&i&&u||!p&&!i&&o))throw new n(`${t.type}-layer:mesh-unsupported`,`Uploading a mesh with a ${s.type} vertex space and a spatial reference wkid:${a.wkid} to a layer with a spatial reference wkid:${d.wkid} is not supported.`)}}function Z(e,t,r,a){f(e,t,r,a),I(e,t)}function N(e,t,r,a){f(e,t,r,a)}function x(e,t,r,a){f(e,t,r,a),I(e,t);const s=w(t);if("geometry"in e&&e.geometry!=null&&!s?.editing.supportsGeometryUpdate)throw new n(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function m(e,t){const{feature:r,attachment:a}=e;if(!r||"attributes"in r&&!r.attributes[t.globalIdField])throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in r)&&!r.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!a.globalId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!a.data&&!a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(a.data instanceof File&&a.data.name)&&!a.name)throw new n(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities?.editing.supportsUploadWithItemId&&a.uploadId)throw new n(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof a.data=="string"){const s=S(a.data);if(s&&!s.isBase64)throw new n(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}function q(e,t){const{attributes:r}=e;r[t]==null&&(r[t]=B())}async function J(e){const t=e.addFeatures??[],r=e.updateFeatures??[],a=t.concat(r).map(i=>i.geometry),s=await G(a),d=t.length,p=r.length;return s.slice(0,d).forEach((i,o)=>t[o].geometry=i),s.slice(d,d+p).forEach((i,o)=>r[o].geometry=i),e}function _(e){return{addFeatures:Array.from(e?.addFeatures??[]),updateFeatures:Array.from(e?.updateFeatures??[]),deleteFeatures:e&&R.isCollection(e.deleteFeatures)?e.deleteFeatures.toArray():e.deleteFeatures||[],addAttachments:e.addAttachments||[],updateAttachments:e.updateAttachments||[],deleteAttachments:e.deleteAttachments||[]}}function P(e,t,r){const a=_(e);if(a.addFeatures?.length&&!t.operations.supportsAdd)throw new n(`${r}:unsupported-operation`,"Layer does not support adding features.");if(a.updateFeatures?.length&&!t.operations.supportsUpdate)throw new n(`${r}:unsupported-operation`,"Layer does not support updating features.");if(a.deleteFeatures?.length&&!t.operations.supportsDelete)throw new n(`${r}:unsupported-operation`,"Layer does not support deleting features.");return a.addFeatures=a.addFeatures.map(g),a.updateFeatures=a.updateFeatures.map(g),a.addAssetFeatures=[],a}function X(e,t,r,a,s,d){if(!e||!a&&!s)throw new n(`${d}:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!t.editing.supportsGlobalId&&r?.globalIdUsed)throw new n(`${d}:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!t.editing.supportsGlobalId&&s)throw new n(`${d}:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if(!r?.globalIdUsed&&s)throw new n(`${d}:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true")}function g(e){const t=new O;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function H(e,t){const{infoFor3D:r}=t;if(r==null)return;if(!M(r))throw new n(`${t.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");e.addAssetFeatures??=[];const{addAssetFeatures:a}=e;for(const s of e.addFeatures??[])b(s)&&a.push(s);for(const s of e.updateFeatures??[])b(s)&&a.push(s)}function b(e){return e?.geometry?.type==="mesh"}function le(e,t,r,a){if(!F(t))throw new n(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!t.uploadAssets)throw new n(`${e.type}-layer:no-asset-upload-support`,"Layer source does not support uploadAssets capability",{layer:e});return t.uploadAssets(r,a)}export{de as applyEdits,X as checkEditingCapabilities,oe as isFeatureIdentifierArrayWithGlobalId,ne as isFeatureIdentifierArrayWithObjectId,W as isFeatureIdentifierWithGlobalId,V as isFeatureIdentifierWithObjectId,_ as normalizeCollections,P as normalizeEdits,J as normalizeGeometries,g as shallowCloneFeature,le as uploadAssets}; diff --git a/custom-toc-highlight/assets/editingTools-BZ3yVmXf-C2YZAZMV.js b/custom-toc-highlight/assets/editingTools-BZ3yVmXf-C6oQif6A.js similarity index 97% rename from custom-toc-highlight/assets/editingTools-BZ3yVmXf-C2YZAZMV.js rename to custom-toc-highlight/assets/editingTools-BZ3yVmXf-C6oQif6A.js index d4953730..6fabdc8f 100644 --- a/custom-toc-highlight/assets/editingTools-BZ3yVmXf-C2YZAZMV.js +++ b/custom-toc-highlight/assets/editingTools-BZ3yVmXf-C6oQif6A.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-button-Cm9_TJei-By40tgvH.js","./themeUtils-YjM7iIiX-3_GiOEs2.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./form-CRSw616T-DZVFUlxN.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-BPt2o3jA.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-D4CSNQAA.js","./locale-Cn_GDVD_-Ar3RKmd3.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-BNRQivHR.js","./t9n-C_hcZMZJ-D4zmKT16.js","./icon-BXFbBbop-BUyrjp8g.js","./loader-Ch7Jr16w-DUAf9YhQ.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-Dn93dMQE.js","./calcite-input-BKRd7MCS-DN64wHsO.js","./input2-eOtqu-iO-DwuPmAAc.js","./calcite-dropdown-CLrG397W-CnAw_6_z.js","./floating-ui-DKFFlLv3--KXNPa_R.js","./debounce-27Hmkkyg-Th7bw3mg.js","./openCloseComponent-BGQ6h7vg-COvbZ7sG.js","./calcite-dropdown-item-DpLfv4A0-C0tcRIAy.js","./resources3-Duvedxls-DbbvfBW6.js","./calcite-dropdown-group-0sIPwaDd-Bs73CRS2.js"])))=>i.map(i=>d[i]); -import{_ as It}from"./main-ugzBrWNm.js";import{v as a,S as c,i as x,ar as _i,e2 as pi,e0 as Ne,w as C,dg as g,i8 as ye,aq as ki,J as ue,I as Ce,ah as U,ax as ke,aA as dt,aL as es,aF as Il,av as $s,L as di,k8 as So,as as Us,i1 as Hs,ay as Ll,dx as Po,bi as Lt,a2 as Y,j as tt,d8 as Gl,P as is,b9 as ns,G as Mr,aY as Ns,aC as Qe,p as vi,l as De,d$ as Dl,eK as li,e as kr,m as fi,aO as Gn,es as Dn,d_ as zl,ag as ss,aw as Mo,d9 as $l,di as fn,j_ as Ul,k9 as Hl,d6 as Nl,b7 as Fl,ka as Zl,dj as Bl,h$ as Yl,kb as Cr,hq as Fe,D as Wl,kc as Xl,bt as ko,$ as ql,az as jl,bx as Rr,dh as Fs,b as Kl,kd as Ql,bp as Vr,aW as os,al as Ar,ke as Jl,kf as Co,et as ze,B as Or,bj as Ir,au as Lr,hZ as pe,bo as Gr,i9 as zn,dn as tc,an as ec,a3 as Dr,r as ic,kg as nc,kh as Ze,ki as sc,kj as oc,kk as rc,kl as Ro,km as ac,jw as zr,il as lc,aG as $r,ae as cc,ih as hc,b1 as uc,kn as pc,i3 as Vo,o as $n,i4 as dc,c3 as Ci,dd as Zs,ko as Bs,h_ as Ao,hh as fc,dc as gc,de as mc,db as yc,kp as _c}from"./story-BfX8CRfG.js";import{i as q,j as Ys,A as vc,l as Be,S as _e,y as qt,M as sn,m as Yt,x as xc,g as bc,b as Un,v as Oo,I as Ur,f as Hr,d as wc,E as Tc,P as Ec,O as on,T as Sc,z as Pc,h as Mc,D as Io}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as G,_ as kc,e as de,u as Cc,m as Rc,s as Vc}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{S as Ac,R as Oc}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as Ws,p as xt,f as Ic}from"./projectVectorToVector-sIYLNlex-B_PqSyiH.js";import{x as Lc,f as Nr,m as gn,y as Gc,P as Dc,w as zc,I as $c,g as Uc,Z as Lo}from"./elevationInfoUtils-mOZsPH2J-If61I1du.js";import{N as z,O as rs,L as fe,b as xi,l as le,j as ut,X as Pe,r as Et,R as H,p as Hc,k as pt,v as Fr,y as Z,S as Ot,A as rt,g as ge,w as Go,_ as N,T as Ye,W as Do,G as as,H as zo}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{i as Zr}from"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import Xs from"./GraphicsLayer-DfeGaYc1-BYhO2Zs8.js";import{O as bi,u as rn,E as mn,D as yn,P as Br,h as Nc,c as Fc}from"./geodesicUtils-B8mFUfTk-DkviSp9u.js";import{simplify as Zc,distance as Bc,geodesicArea as Yc,geodesicLength as Yr}from"./geometryEngine-CdPoFSE4-zj0NdzY3.js";import{U as Wc}from"./Tile-D75RMC64-Dj1SOP3K.js";import{T as Xc,P as Wr,J as qc,Q as we,_ as Xr,u as $o,O as jc}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{Y as Kc,L as Qc}from"./quat-BODLR7mS-BrXZAXDf.js";import{e as Uo}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{s as Jc,N as We,L as Kt,K as te,P as qs,U as Qt,Q as th,x as _n,D as ft,c as Dt,F as qr,W as eh,m as ih,S as vn,u as nh,b as sh,R as oh,Y as rh,Z as ah,q as lh,G as ch,J as hh,j as uh,A as ph,C as dh,H as fh}from"./ReactiveSet-QxEZenFW-DlICHtLT.js";import{y as gh,w as mh,A as yh,p as _h,O as vh}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as jr,e as Hn,c as xh}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{i as bh}from"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import{y as at,_ as js,w as Ae,D as Ks,N as $e,g as Kr,B as Ri,$ as Qr,P as ls,c as ii,e as wh,l as Ho,j as Nn,G as Jr,a as Th,O as Eh}from"./plane-Dt8R0KeE-CVSP2GQG.js";import{U as Sh,z as Ph,k as Mh,w as kh,F as Ch}from"./sphere-BenPORjV-DaZ5Vv8x.js";import{n as wi}from"./common-CYWrYyJl-E8-sukrT.js";import{c as ta,o as Qs}from"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./MeshTransform-C--IG09w-DoQndDth.js";import{t as Rh}from"./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js";import{_ as cs,H as Vh,z as Ah,R as Vi,P as v,F as wt,$ as Oh,k as Js}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{r as Ih}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{m as Lh}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{S as Gh}from"./triangle-hqU-Tc1X-DLjOhwz3.js";import{m as Dh,x as zh}from"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import{P as $h}from"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import{l as Ti}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{K as Xe,N as ea,J as Uh}from"./projection-BA9M1R7d-BYoCXVXt.js";import"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import{t as Hh}from"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import{i as ia,f as na}from"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import{q as Nh}from"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import{u as No}from"./cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js";import{p as Fh}from"./projectPointToVector-B2UUY9SE-BChPjj6-.js";import{z as Zh}from"./drapedUtils-BZ1SGPtE-B2FavufJ.js";import{W as Fo}from"./colorUtils-Cthpxcks-ZRnr1H1b.js";import{h as Ei,M as Qi,N as xn}from"./boundedPlane-DlvE0eNx-dpkNyaGh.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./geometryEngineBase-DueYg7ux-CCeespPx.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./hydrated-CplJC1Fs-BIb5_ysY.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./signal-CETehA7D-DhpyJ8yp.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./lineSegment-CcqvCARM-CF4YE8GC.js";import"./utils-SPbpQbmm-B3hR8LxB.js";function gi(e,t){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.m===t.m}function Fn(e,t,i){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&li(e.x,t.x,i)&&li(e.y,t.y,i)&&li(e.z??0,t.z??0,i)&&li(e.m??0,t.m??0,i)}function Bh(e){return"declaredClass"in e}function sa(e,t){if(!e)return null;let i;return Bh(e)?e.clone():(i=Ws(e.x,e.y,e.z,e.spatialReference),e.hasM&&(i.m=e.m,i.hasM=!0),i)}var Zo;function oa(e,t,i){return j(e,t,i)}function j(e=0,t=0,i=0){return pe(e,t,i)}function ve(e,t,i){return pe(e,t,i)}function qe(e){const[t,i,n]=e;return e.length>3?[t,i,n,e[3]]:[t,i,n]}function to(e,t,i,n=j()){return n[0]=e.x,n[1]=e.y,n[2]=e.z??0,t==null||(t.type==="2d"?n[2]=0:n[2]=Dc(t,e,i,gn)??0),n}function Yh(e,t,{z:i,m:n},s,o){const{spatialReference:r,elevationInfo:l}=s;let h;i==null&&n==null?h=void 0:t==null||t.type==="2d"?h=i??void 0:h=zc(t,e,r,gn,l)??0;const[u,p]=e;return o?Ic(o,u,p,h,r):o=Ws(u,p,h,r),n!=null&&(o.m=n,o.hasM=!0),o}(function(e){e[e.NONE=0]="NONE",e[e.TARGET=1]="TARGET"})(Zo||(Zo={}));let St=class extends kr{constructor(){super(...arguments),this.enabled=!0}};a([c({type:Boolean})],St.prototype,"enabled",void 0),St=a([x("esri.views.interactive.snapping.Settings.DefaultSnappingAlgorithm")],St);let V=class extends kr{constructor(e){super(e),this.lineSnapper=new St,this.parallelLineSnapper=new St,this.rightAngleSnapper=new St,this.rightAngleTriangleSnapper=new St,this.shortLineThreshold=15,this.distance=5,this.pointThreshold=1e-6,this.intersectionParallelLineThreshold=1e-6,this.parallelLineThreshold=1e-6,this.verticalLineThresholdMeters=.3,this.touchSensitivityMultiplier=1.5,this.pointOnLineThreshold=1e-6,this.orange=new _i([255,127,0]),this.orangeTransparent=new _i([255,127,0,.5]),this.lineHintWidthReference=3,this.lineHintWidthTarget=3,this.lineHintFadedExtensions=.3,this.parallelLineHintWidth=2,this.parallelLineHintLength=24,this.parallelLineHintOffset=1.5,this.rightAngleHintSize=24,this.rightAngleHintOutlineSize=1.5,this.satisfiesConstraintScreenThreshold=1}};a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"lineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"parallelLineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleTriangleSnapper",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"shortLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"distance",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"intersectionParallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"parallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"verticalLineThresholdMeters",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"touchSensitivityMultiplier",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointOnLineThreshold",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orange",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orangeTransparent",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthReference",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthTarget",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"lineHintFadedExtensions",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"parallelLineHintWidth",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:50},json:{write:!0}})],V.prototype,"parallelLineHintLength",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"parallelLineHintOffset",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:46},json:{write:!0}})],V.prototype,"rightAngleHintSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:6},json:{write:!0}})],V.prototype,"rightAngleHintOutlineSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"satisfiesConstraintScreenThreshold",void 0),V=a([x("esri.views.interactive.snapping.Settings.Defaults")],V);const Zn=new V;var je;(function(e){e[e.FEATURE=1]="FEATURE",e[e.SELF=2]="SELF",e[e.ALL=3]="ALL"})(je||(je={}));let Ai=class{constructor(e,t){this.isDraped=e,this.domain=t}},Wh=class ra extends Ai{constructor(t,i,n=je.ALL){super(i,n),this.intersectionPoint=t}equals(t){return t instanceof ra&&H(this.intersectionPoint,t.intersectionPoint)}},Xh=class aa extends Ai{constructor(t,i,n,s,o=je.ALL,r=!0,l=!0){super(s,o),this.type=t,this.lineStart=i,this.lineEnd=n,this.fadeLeft=r,this.fadeRight=l}equals(t){return t instanceof aa&&this.type===t.type&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)&&this.fadeLeft===t.fadeLeft&&this.fadeRight===t.fadeRight}get length(){return ge(this.lineStart,this.lineEnd)}},qh=class la extends Ai{constructor(t,i,n,s=je.ALL){super(n,s),this.lineStart=t,this.lineEnd=i}equals(t){return t instanceof la&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)}},jh=class ca extends Ai{constructor(t,i,n){super(i,n),this.point=t}equals(t){return t instanceof ca&&H(this.point,t.point)}},Kh=class ha extends Ai{constructor(t,i,n,s,o=je.ALL){super(s,o),this.previousVertex=t,this.centerVertex=i,this.nextVertex=n}equals(t){return t instanceof ha&&H(this.previousVertex,t.previousVertex)&&H(this.centerVertex,t.centerVertex)&&H(this.nextVertex,t.nextVertex)}},Qh=class{draw(e,t){const i=Jh(e),n=this.sortUniqueHints(i),s=[];for(const o of n)o instanceof Wh&&s.push(this.visualizeIntersectionPoint(o,t)),o instanceof Xh&&s.push(this.visualizeLine(o,t)),o instanceof qh&&s.push(this.visualizeParallelSign(o,t)),o instanceof Kh&&s.push(this.visualizeRightAngleQuad(o,t)),o instanceof jh&&s.push(this.visualizePoint(o,t));return Gr(s)}sortUniqueHints(e){return e}};function Jh(e){const t=[];for(const i of e){let n=!0;for(const s of t)if(i.equals(s)){n=!1;break}n&&t.push(i)}return t}let tu=class extends Qh{constructor(e){super(),this._graphicsLayer=e,this._symbolPairingsByType=new Map}visualizeIntersectionPoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.intersectionPoint[0],y:e.intersectionPoint[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("intersectionPoint",t.view.effectiveTheme.accentColor))}visualizePoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.point[0],y:e.point[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("point",t.view.effectiveTheme.accentColor))}visualizeLine(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("line",t.view.effectiveTheme.accentColor))}visualizeParallelSign(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("parallelSign",t.view.effectiveTheme.accentColor))}visualizeRightAngleQuad(e,t){const i=G(),n=G(),s=g();q(i,e.centerVertex,e.previousVertex),q(n,e.nextVertex,e.previousVertex),vc(s,i,n);const o=`rightAngleQuad${s[2]<0?45:225}`;return this._visualizeSnappingIndicator(new fi({paths:[[[...e.previousVertex],[...e.centerVertex],[...e.nextVertex]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol(o,t.view.effectiveTheme.accentColor))}_visualizeSnappingIndicator(e,t){const i=new Lt({geometry:e,symbol:t});return this._graphicsLayer.add(i),Y(()=>{this._graphicsLayer.remove(i)})}_getOrCreateSymbol(e,t){const i=this._symbolPairingsByType;return i.get(e)?.color!==t&&i.set(e,{color:t,symbol:eu(e,t)}),i.get(e).symbol}};function eu(e,t){const i=[...t.toRgb(),255*t.a];switch(e){case"point":return new Ne({outline:{width:.5,color:[0,0,0,1]},size:10,color:t});case"intersectionPoint":return new Ne({outline:new zl({width:1.5,color:t}),size:15,color:[0,0,0,0]});case"line":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:Ac.Butt,joinStyle:Oc.Round,miterLimit:10,width:Dn(Zn.lineHintWidthTarget),color:i}]}}});case"parallelSign":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,1.5],[7,1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,-1.5],[7,-1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}});case"rightAngleQuad45":case"rightAngleQuad225":{const n=e==="rightAngleQuad45"?45:225;return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:.5,y:.5,z:0},anchorPointUnits:"Relative",size:Dn(Zn.rightAngleHintSize),rotation:n,markerPlacement:{type:"CIMMarkerPlacementOnVertices",placePerPart:!0,angleToLine:!0,placeOnEndPoints:!1},frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[5,-5],[-5,-5],[-5,5],[5,5],[5,-5]]]},symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:Dn(Zn.rightAngleHintOutlineSize),color:i},{type:"CIMSolidFill",enable:!0,color:[...t.toRgb(),255*t.a*.4]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}})}}}const iu=new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[3.75,3.75],lineDashEnding:"HalfPattern",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:1.6,color:[255,255,255,255]},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:2,color:[0,0,0,255]}]}}}),nu=new Ne({style:"circle",size:6,color:[127,127,127,1],outline:{color:[50,50,50],width:1}}),su=new Ne({style:"circle",size:6,color:[255,127,0,1],outline:{color:[50,50,50],width:1}});var ht;(function(e){e[e.NeverApplied=0]="NeverApplied",e[e.Applied=1]="Applied",e[e.Undone=2]="Undone"})(ht||(ht={}));var Gt;(function(e){e.UndoRedoUpdating="UndoRedoUpdating",e.UndoInvalidError="UndoInvalidError",e.RedoInvalidError="RedoInvalidError",e.ApplyInvalidError="ApplyInvalidError"})(Gt||(Gt={}));const bn={[Gt.UndoRedoUpdating]:"Cannot perform operation whilst undo redo is updating",[Gt.UndoInvalidError]:"There are no items to Undo",[Gt.RedoInvalidError]:"There are no items to Redo",[Gt.ApplyInvalidError]:"Cannot apply an item that is already applied"};let ni=class extends Error{constructor(){super(bn[Gt.UndoRedoUpdating]),this.type="undo-redo-updating-error"}},hs=class extends Error{constructor(){super(bn[Gt.UndoInvalidError]),this.type="undo-redo-undo-error"}},Bo=class extends Error{constructor(){super(bn[Gt.RedoInvalidError]),this.type="undo-redo-redo-error"}},ou=class extends Error{constructor(){super(bn[Gt.ApplyInvalidError]),this.type="undo-redo-apply-error"}};var Xt;(function(e){e[e.Apply=0]="Apply",e[e.Undo=1]="Undo",e[e.Redo=2]="Redo"})(Xt||(Xt={}));let Di=class extends tt{constructor(){super(...arguments),this.name="",this.tag=Symbol(),this.status=ht.NeverApplied}get canUndo(){return this.status===ht.Applied}get canRedo(){return this.status===ht.Undone}async executeUndoRedoOperation(e){switch(e){case Xt.Apply:if(this.status!==ht.NeverApplied)throw new ou;return await this.apply(),void(this.status=ht.Applied);case Xt.Undo:if(this.status!==ht.Applied)throw new hs;return await this.undo(),void(this.status=ht.Undone);case Xt.Redo:if(this.status!==ht.Undone)throw new hs;return await this.redo(),void(this.status=ht.Applied)}}};a([c()],Di.prototype,"name",void 0),a([c()],Di.prototype,"tag",void 0),Di=a([x("esri.undoredo.UndoableOperation")],Di);let Ct=class extends tt{constructor(){super(...arguments),this._stack=new ss,this._stackPosition=-1,this._updatingHandles=new Zr}get updating(){return this._updatingHandles.updating}get canUndo(){return this.hasUndo&&!this.updating}get hasUndo(){return this._stackPosition>=0}get canRedo(){return this.hasRedo&&!this.updating}get hasRedo(){return this._stackPositione.destroy())}_drainStack(){this._stack.drain(e=>e.destroy()),this._stackPosition=-1}async undo(){if(!this.hasUndo)throw new hs;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition);e&&await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Undo),--this._stackPosition,e.canRedo||this._truncateForwardStack()})())}async redo(){if(!this.hasRedo)throw new Bo;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition+1);if(!e)throw new Bo;await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Redo),++this._stackPosition})())}peekUndo(){if(this.canUndo)return this._stack.getItemAt(this._stackPosition)}peekRedo(){if(this.canRedo)return this._stack.getItemAt(this._stackPosition+1)}async inject(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),e.canUndo?(this._stack.splice(this._stackPosition+1,0,e),this._stackPosition++):this._stackPosition>-1&&(this._stack.splice(0,this._stackPosition+1).forEach(t=>t.destroy()),this._stackPosition=-1)})())}async add(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),this._stackPosition>=-1&&this._truncateForwardStack(),e.canUndo?(this._stack.push(e),this._stackPosition=this._stack.length-1):this._drainStack()})())}async removeTagged(e,t=!1){if(this.updating&&!t)return;await Mo(()=>!this.updating);const i=new ss;for(let n=0;ni.length-1&&(this._stackPosition=i.length-1)}async clear(e=!1){if(this.updating&&!e)throw new ni;await Mo(()=>!this.updating),this._drainStack()}};a([c()],Ct.prototype,"_stack",void 0),a([c()],Ct.prototype,"_stackPosition",void 0),a([c()],Ct.prototype,"updating",null),a([c({readOnly:!0})],Ct.prototype,"canUndo",null),a([c({readOnly:!0})],Ct.prototype,"hasUndo",null),a([c({readOnly:!0})],Ct.prototype,"canRedo",null),a([c({readOnly:!0})],Ct.prototype,"hasRedo",null),Ct=a([x("esri.UndoRedo")],Ct);function eo(){return uc()}function ru(){return $l()}function Si(e,t){const i=[];e=(e=(e=e.replaceAll(/[\u00B0\u00BA]/g,"^")).replaceAll("′","'")).replaceAll("″",'"');const n=cu(t);return pc.dmsToGeog(n,1,[e],i)?new C(i[0][0],i[0][1],ue.WGS84):null}function au(e){return e&&eo()?Ze(e)??Si(`0° 0' 0" N | ${e}`)?.longitude??Si(`0 | ${e}`)?.longitude??null:null}function lu(e){return e&&eo()?Ze(e)??Si(`${e} | 0° 0' 0" E`)?.latitude??Si(`${e} | 0`)?.latitude??null:null}function cu(e){let t=null;if(e||(e=ue.WGS84),e.wkid){if(t=Vo.geogcs(e.wkid),!t)throw new $n("coordinate-formatter:invalid-spatial-reference","wkid is not valid")}else{if(!e.wkt2&&!e.wkt)throw new $n("coordinate-formatter:invalid-spatial-reference","wkid and wkt are missing");if(t=Vo.fromString(dc.PE_TYPE_GEOGCS,e.wkt2||e.wkt),!t)throw new $n("coordinate-formatter:invalid-spatial-reference","wkt is not valid")}return t}let hu=class{constructor(){this.committedVertices=null,this.cursorVertex=null,this.full=null,this.outline=null,this.cursorEdge=null,this.circle=null,this.rectangle=null}};var us;let se=us=class extends De{constructor(e){super(e),this.center=null,this.geodesic=!1,this.numberOfPoints=60,this.radius=1e3,this.radiusUnit="meters"}initialize(){const e=this.center,t=this.numberOfPoints;if(this.hasZ=e?.hasZ??!1,this.rings.length!==0||!e)return;const i=fn(this.radius,this.radiusUnit,"meters"),n=e.spatialReference;let s,o="geographic";if(n.isWebMercator?o="webMercator":((n.wkid&&Ul[n.wkid])!=null||(n.wkt2||n.wkt)&&Hl(n.wkt2||n.wkt))&&(o="projected"),this.geodesic){let r;switch(o){case"webMercator":r=Nl(e);break;case"projected":console.error("Creating a geodesic circle requires the center to be specified in web mercator or geographic coordinate system");break;case"geographic":r=e}s=this._createGeodesicCircle(r,i,t),o==="webMercator"&&(s=Fl(s))}else{let r;o==="webMercator"||o==="projected"?r=i/Zl(e.spatialReference):o==="geographic"&&(r=Bl(i,"meters",Yl(e.spatialReference).radius)),s=this._createPlanarCircle(e,r,t)}this.spatialReference=s.spatialReference,this.addRing(s.rings[0])}clone(){const{center:e,numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s}=this;return new us({center:e?.clone(),numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s})}_createGeodesicCircle(e,t,i){let n=0;const s=[];for(;n<360;){const o=[0,0],r=[e.x,e.y];bi(o,r,n,t,ue.WGS84),this.hasZ&&o.push(e.z),s.push(o),n+=360/i}return s.push(s[0]),new De({rings:[s]})}_createPlanarCircle(e,t,i){const n=[],s=2*Math.PI/i;for(let o=0;othis.mapToLocal(t)).filter(ki)}get doUnnormalization(){return!1}},pu=class extends ua{constructor(e,t,i=null){super(t),this._defaultZ=i,this.transform=$o(),this.transformInv=$o(),this.transform=jc(e),Wc(this.transformInv,this.transform)}makeMapPoint(e,t){return an(e,t,this._defaultZ)}mapToLocal(e){return k(this.transform[0]*e[0]+this.transform[2]*e[1]+this.transform[4],this.transform[1]*e[0]+this.transform[3]*e[1]+this.transform[5])}localToMap(e){return an(this.transformInv[0]*e.x+this.transformInv[2]*e.y+this.transformInv[4],this.transformInv[1]*e.x+this.transformInv[3]*e.y+this.transformInv[5],this._defaultZ)}},du=class extends ua{constructor(e,t){super(e.spatialReference),this.view=e,this.defaultZ=null,this.pWS=g(),this.tangentFrameUpWS=g(),this.tangentFrameRightWS=g(),this.tangentFrameForwardWS=g(),this.localFrameRightWS=g(),this.localFrameUpWS=g(),this.worldToLocalTransform=Uo(),this.localToWorldTransform=Uo(),this.scale=1,this.scale=e.resolution,this.referenceMapPoint=t,this.defaultZ=t.hasZ?t.z:null;const i=e.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.X,this.tangentFrameRightWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Y,this.tangentFrameUpWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Z,this.tangentFrameForwardWS);const n=g();fe(n,this.tangentFrameForwardWS,Z(i,this.tangentFrameForwardWS)),Et(this.localFrameRightWS,i,n),le(this.localFrameRightWS,this.localFrameRightWS),Ot(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS),Kc(this.worldToLocalTransform,this.localFrameRightWS,this.tangentFrameRightWS),Qc(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return this.view.viewingMode==="global"}makeMapPoint(e,t){return an(e,t,this.defaultZ)}mapToLocal(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e[0],y:e[1],spatialReference:this.spatialReference}),t),Go(t,t,this.worldToLocalTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?k(i.x/this.scale,i.y/this.scale):null}localToMap(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e.x*this.scale,y:e.y*this.scale,spatialReference:this.spatialReference}),t),Go(t,t,this.localToWorldTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?an(i.x,i.y,this.defaultZ):null}};function fu(e,t){if(e.type==="2d")return new pu(e.state.transform,e.spatialReference,t.length>2?t[2]:null);if(e.type==="3d"){const i=t.length>2?new C({x:t[0],y:t[1],z:t[2],spatialReference:e.spatialReference}):new C({x:t[0],y:t[1],spatialReference:e.spatialReference});return new du(e,i)}return null}function Me(e,t){const i=new C({x:e[0],y:e[1],spatialReference:t});return e.length>2&&(i.z=e[2]),i}function gu(e,t){return new Mr({points:e,spatialReference:t})}function Yo(e,t,i){const n=new fi({paths:e,spatialReference:t});return i&&Cr(n),n}function Oi(e,t,i,n=!0){const s=is(e);s.forEach(r=>{const l=r[0],h=r[r.length-1];Fe(l,h)&&r.length!==1||r.push(r[0])});let o=new De({rings:s,spatialReference:t});return o.rings.forEach(r=>{Wl(r)||r.reverse()}),i&&Cr(o),n&&o.isSelfIntersecting&&Ns(t)&&(o=Zc(o)),o}function Wo(e,t,i){const n=t.mapToLocalMultiple(e),s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y},l=Math.round(r.x-o.x),h=Math.round(r.y-o.y),u=Math.max(Math.abs(l),Math.abs(h));if(i){const p={x:o.x+u,y:o.y+u},d={x:o.x-u,y:o.y-u};s.push(k(p.x,d.y),k(d.x,d.y),k(d.x,p.y),k(p.x,p.y))}else{const p={x:l>0?o.x+u:o.x-u,y:h>0?o.y+u:o.y-u};s.push(k(o.x,o.y),k(p.x,o.y),k(p.x,p.y),k(o.x,p.y))}return pa(Oi([s.map(p=>t.localToMap(p)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function mu(e,t,i){let n=t.mapToLocalMultiple(e);if(n.length===1){const l=n[0];n=[k(l.x-48,l.y+48),k(l.x+48,l.y-48),k(l.x+48,l.y-48),k(l.x-48,l.y+48)]}const s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y};if(i){const l=Math.round(r.x-o.x),h=Math.round(r.y-o.y);s.push(k(o.x-l,o.y-h),k(r.x,o.y-h),k(r.x,r.y),k(o.x-l,r.y))}else s.push(k(o.x,o.y),k(r.x,o.y),k(r.x,r.y),k(o.x,r.y));return pa(Oi([s.map(l=>t.localToMap(l)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function pa(e,t,i){const n=zi(t[3],t[2],i),s=zi(t[1],t[2],i),o=zi(t[0],t[1],i),r=zi(t[0],t[3],i);return{geometry:e,midpoints:n!=null&&s!=null&&o!=null&&r!=null?{top:n,right:s,bottom:o,left:r}:null}}function zi(e,t,i){Re[0]=e.x,Re[1]=e.y,Re[2]=0,Ve[0]=t.x,Ve[1]=t.y,Ve[2]=0,Pe(Re,Re,Ve,.5),$i.x=Re[0],$i.y=Ve[1],$i.z=Ve[2];const n=i.localToMap($i);return n!=null?Me(n,i.spatialReference):null}const $i=k(0,0,0),Re=g(),Ve=g();function Xo(e,t,i,n){const s=t.mapToLocalMultiple(e);let o=null,r=null;if(i)o=s[0],r=s[1];else{const _=s[0],y=s[1],w=Math.round(y.x-_.x),b=Math.round(y.y-_.y),S=Math.max(Math.abs(w),Math.abs(b));o=k(w>0?_.x+S/2:_.x-S/2,b>0?_.y+S/2:_.y-S/2),r=k(Math.abs(w)>Math.abs(b)?o.x-S/2:o.x,Math.abs(w)>Math.abs(b)?o.y:o.y-S/2)}const l=t.localToMap(o),h=t.localToMap(r);if(l==null||h==null)return null;t.doUnnormalization&&Xl([[l,h]],t.spatialReference);const u=Me(l,t.spatialReference),p=Me(h,t.spatialReference),d=vi(t.spatialReference);let m=0;if(Ns(t.spatialReference))m=d*Bc(u,p,null);else{const _=o.x-r.x,y=o.y-r.y;m=d*Math.sqrt(_*_+y*y)*1}const f=new uu({center:u,radius:m,radiusUnit:"meters",spatialReference:t.spatialReference});return{geometry:Oi(f.rings,f.spatialReference,!1),center:u,edge:p}}function yu(e,t,i){const n=t.mapToLocalMultiple(e),s=n[0],o=n[1],r=Math.round(o.x-s.x),l=Math.round(o.y-s.y),h=k(i?s.x:s.x+r/2,i?s.y:s.y+l/2),u=i?r:r/2,p=i?l:l/2,d=60,m=[],f=2*Math.PI/d;function _(W){const gt=Math.cos(W),lt=Math.sin(W);return k(u*gt+h.x,p*lt+h.y)}for(let W=0;Wt.localToMap(W)).filter(ki)],y,w,!1),S=t.localToMap(_(Math.PI/2)),I=t.localToMap(_(0)),K=t.localToMap(_(-Math.PI/2)),et=t.localToMap(_(Math.PI));return{geometry:b,midpoints:S!=null&&I!=null&&K!=null&&et!=null?{top:Me(S,y),right:Me(I,y),bottom:Me(K,y),left:Me(et,y)}:null}}function io(e,t){switch(e){case"point":case"multipoint":return _u();case"polyline":return vu(t);case"polygon":return xu(t);default:return}}function _u(e){return"point"}function vu(e){return(e!=null&&e.type==="polyline"&&e.paths.length?e.paths[0].length:0)<2?"polylineZeroVertices":"polylineOneVertex"}function xu(e){const t=e!=null&&e.type==="polygon"&&e.rings.length?e.rings[0].length:0;return t<3?"polylineZeroVertices":t<4?"polygonOneVertex":"polygonTwoVertices"}function bu(e,t){const i=e?.geometry;if(!e||i?.type!=="mesh"||!t)return;const{renderCoordsHelper:n,elevationProvider:s}=t,{camera:o}=t.state,{extent:r}=i,{center:l,spatialReference:h}=r,u=vi(h),p=Fs(h),d=vi(n.spatialReference),m=r.width*u,f=r.height*p,_=(r.zmax??0)*p,y=_-(r.zmin??0)*p,w=Math.max(m,f,y)/d,{x:b,y:S}=l,I=l.z??0;N(Ui,b,S,I),n.toRenderCoords(Ui,h,Ui);const K=w/o.computeScreenPixelSizeAt(Ui);if(K>o.width*Tu)return"meshTooClose";if(K=0){if(d>=0||t.type===O.LINE)return[qt(ln,i,r,p)]}else if(e.type===O.LINE&&(d>=0||t.type===O.LINE))return[qt(ln,i,r,p)];return[]}function Pu(e,t,i){const n=[],s=q(da,e.end,e.start),o=q(fa,e.start,t),r=Be(s),l=2*_e(s,o),h=l*l-4*r*(Be(o)-i*i);if(h===0){const u=-l/(2*r);(e.type===O.LINE||u>=0)&&n.push(qt(ln,e.start,s,u))}else if(h>0){const u=Math.sqrt(h),p=(-l+u)/(2*r);(e.type===O.LINE||p>=0)&&n.push(qt(ln,e.start,s,p));const d=(-l-u)/(2*r);(e.type===O.LINE||d>=0)&&n.push(qt(ga,e.start,s,d))}return n}var O;(function(e){e[e.RAY=0]="RAY",e[e.LINE=1]="LINE"})(O||(O={}));const Mu=1e-6,da=G(),fa=G(),ga=G(),ln=G();function no({start:e,end:t,type:i},n,s){const o=[],r=q(Ii,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===bt.PLANE||d>=0)&&o.push(qt(G(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===bt.PLANE||m>=0)&&o.push(qt(G(),e,r,m));const f=(-u-d)/(2*h);(i===bt.PLANE||f>=0)&&o.push(qt(G(),e,r,f))}return o}function ma(e,t){const i=e.start,n=e.end,s=q(Ii,n,i),o=N(En,-s[1],s[0],0),r=t.start,l=t.end,h=pt(oo,l,r),u=Z(h,o),p=N(Ea,i[0],i[1],0),d=pt(Sa,p,r),m=Z(d,o),f=wi();if(Math.abs(u)de(i,n))}function _a(e,t,i){return xa(e,cn(ro,e[2],t),i)}function va(e,t,i,n=g()){const s=q(Ii,e,t),o=Mc(s);return qt(n,t,s,o===0?1:i/o),n[2]=e[2],n}function xa(e,{start:t,end:i,type:n},s=g()){const o=pt(Tn,e,t),r=pt(En,i,t),l=Z(o,r)/Z(r,r);return z(s,t,r,n===O.RAY?Math.max(l,0):l)}const Cu=(()=>{const e=g(),t=g(),i=g();return({start:n,end:s},{center:o,radius:r,normal:l,slicePlane:h})=>{const u=Ri(o,l,Ou);if(R(ls(u,n),0)&&R(ls(u,s),0)){Qr(l,e,t);const d=(_,y)=>(Et(i,y,o),Yt(_,Z(i,e),Z(i,t)),_),m=Pu({start:d(Ii,n),end:d(wn,s),type:O.LINE},Vc,r),f=[];for(const[_,y]of m){const w=rt(g(),o);z(w,w,e,_),z(w,w,t,y),h&&!me(h,w)||f.push(w)}return f}const p=g();return js(u,n,s,p)?!R(ge(p,o),r)||h&&!me(h,p)?[]:[p]:[]}})();function ba({start:e,end:t,type:i},n,s){const o=[],r=Et(Tn,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===O.LINE||d>=0)&&o.push(z(g(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===O.LINE||m>=0)&&o.push(z(g(),e,r,m));const f=(-u-d)/(2*h);(i===O.LINE||f>=0)&&o.push(z(g(),e,r,f))}return o}function wa(e,t){const i=e.start,n=e.end,s=t.start,o=t.end,r=pt(Tn,n,i),l=pt(En,o,s),h=pt(oo,s,i),u=Ot(Ea,r,l);if(!R(Z(h,u),0))return[];const p=as(u);if(R(p,0))return[];const d=Ot(Sa,h,l),m=Z(d,u)/p,f=z(Pa,i,r,m);if(e.type===O.RAY){const _=pt(ps,f,i);if(Z(r,_)<-wi())return[]}if(t.type===O.RAY){const _=pt(ps,f,s);if(Z(l,_)<-wi())return[]}return[ye(f)]}function Ru({start:e,end:t,type:i},n){const s=pt(Tn,n,e),o=pt(En,t,e),r=Ot(oo,o,s),l=as(r)/as(o),h=wi();if(lt+n)return[];if(dme(e,i))}function me(e,t){return Kr(e,t)}var bt;(function(e){e[e.PLANE=0]="PLANE",e[e.HALF_PLANE=1]="HALF_PLANE"})(bt||(bt={}));const Au={[bt.PLANE]:O.LINE,[bt.HALF_PLANE]:O.RAY},Ii=G(),wn=G(),Tn=g(),En=g(),oo=g(),Ea=g(),Sa=g(),Pa=g(),ps=g(),Ou=at(),ro={start:g(),end:g(),type:O.LINE},Iu={start:g(),end:g(),type:O.LINE};class Tt{intersect(t){return Ut(this,t)}closestPoints(t){return[this.closestTo(t)]}}class Je extends Tt{constructor(t){super(),this.point=t}equals(t){return this===t||vt(t)&&H(this.point,t.point)}closestTo(){return qe(this.point)}}class ao extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.lineLike={start:t,end:i,type:n}}equals(t){return this===t||Rt(t)&&this.lineLike.type===t.lineLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return xa(t,this.lineLike,i),i}}class Ma extends ao{constructor(t,i){super(t,i,O.LINE)}}class Lu extends ao{constructor(t,i){super(t,i,O.RAY)}}class ka extends Tt{constructor(t){super(),this.constraints=t}equals(t){return this===t||ds(t)&&Fe(this.constraints,t.constraints,(i,n)=>i.equals(n))}closestTo(t){let i,n=1/0;for(const s of this.constraints){const o=s.closestTo(t),r=Hc(t,o);ri===this?[]:i.closestPoints(t))}}class Ca extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||At(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i}}class lo extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||Nt(t)&&H(this.center,t.center)&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i[2]=this.center[2],i}asCircle(){return new co(qe(this.center),this.radius,ve(0,0,1))}}class co extends Tt{constructor(t,i,n,s=void 0){super(),this.center=t,this.radius=i,this.normal=n,this.slicePlane=s}equals(t){return this===t||oe(t)&&H(this.center,t.center)&&H(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:i,radius:n}=this;Ks(this.getPlane(Gu),t,Yn);const s=pt(Yn,Yn,i),o=Fr(s);if(R(o,0))return qe(t);const r=n/Math.sqrt(o),l=j();z(l,i,s,r);const{slicePlane:h}=this;return h&&!me(h,l)?uo(h,this)?.closestTo(t)??qe(t):l}getPlane(t=at()){return Ri(this.center,this.normal,t)}}const Yn=g(),Gu=at();class Ra extends Tt{constructor(t){super(),this.z=t}equals(t){return this===t||Ht(t)&&this.z===t.z}closestTo(t){return ve(t[0],t[1],this.z)}getPlane(t=at()){return N(qo,0,0,this.z),Ri(qo,Hs,t)}}const qo=g();class Va extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.planeLike={start:t,end:i,type:n}}equals(t){return this===t||Vt(t)&&this.planeLike.type===t.planeLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return _a(t,this.planeLike,i),i}closestEndTo(t){const{start:i,end:n}=this.planeLike;return Math.sign(_e(q(Du,n,i),q(zu,t,i)))>0?this.end:this.start}getPlane(t=at()){const i=rt(jo,this.end);return i[2]+=1,Jr(this.start,this.end,i,t)}getSlicePlane(t=at()){const{start:i,end:n,type:s}=this.planeLike;if(s===bt.PLANE)return;const o=N(jo,i[0],i[1],0),r=N(Ko,n[0],n[1],0),l=Et(Ko,r,o);return Ri(o,l,t),t}}const Du=G(),zu=G(),jo=g(),Ko=g();class $u extends Va{constructor(t,i){super(t,i,bt.HALF_PLANE)}}class Uu extends Tt{constructor(t,i){super(),this.sphere=Ph(t,i)}equals(t){return this===t||Ft(t)&&Mh(this.sphere,t.sphere)}closestTo(t){const i=j();return kh(this.sphere,t,i),i}get center(){return Ch(this.sphere)}get radius(){return this.sphere[3]}}class Hu extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.getZ=n,this.planeLike={start:t,end:i,type:bt.PLANE}}equals(t){return this===t||hn(t)&&H(this.start,t.start)&&H(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Bu(this,t)}addIfOnTheGround(t,i){for(const n of i){const s=this.getZ(n[0],n[1])??0;R(n[2],s)&&(n[2]=s,t.push(n))}}}class ho extends Tt{constructor(t,i,n){super(),this._x=t,this._y=i,this._z=n}equals(t){return this===t||ap(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,i,n]){return oa(this._x??t,this._y??i,this._z??n)}}class Aa extends Tt{constructor(t,i,n,s,o){super(),this._origin=t,this._spatialReference=i,this._distanceMeters=n,this._z=s,this._directionDegrees=o}equals(t){return this===t||rp(t)&&Io(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,i,n]){return Yt(si,t,i),Io(si,this._origin)||this._applyDirectionAndDistance(si),oa(si[0],si[1],this._z??n)}_applyDirectionAndDistance(t){if(this._directionDegrees!=null&&this._distanceMeters!=null)bi(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(this._directionDegrees!=null)Fu(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(this._distanceMeters!=null){const{azimuth:i}=mn(Nu,this._origin,t,this._spatialReference);bi(t,this._origin,i??0,this._distanceMeters,this._spatialReference)}}}const si=[0,0],Nu=new yn;function Fu(e,t,i,n,s){let{azimuth:o,distance:r}=mn(Zu,t,n,s);o??=0;let l=r*Math.cos((o-i)*bh);l=Math.max(0,l),bi(e,t,i,l,s)}const Zu=new yn;function Bu(e,t){const i=j();return _a(t,e.planeLike,i),i[2]=e.getZ(i[0],i[1])??Ia,i}function Ut(e,t){if(ds(e)){const i=[];for(const n of e.constraints){const s=n.intersect(t);s&&i.push(s)}return Li(i)}if(ds(t))return Ut(t,e);if(hn(e))return Qo(e,t);if(hn(t))return Qo(t,e);if(vt(e)){const{point:i}=e;if(vt(t))return H(i,t.point)?e:void 0;const n=t.closestTo(i);return Ye(n,i)?e:void 0}if(Rt(e)){if(vt(t))return Ut(t,e);if(Rt(t))return Pt(wa(e.lineLike,t.lineLike));if(Ht(t))return Yu(e,t);if(Vt(t))return Pt(ma(t.planeLike,e.lineLike));if(At(t))return Pt(ba(e.lineLike,t.center,t.radius));if(oe(t))return Pt(Cu(e.lineLike,t));if(Nt(t))return Wu(e,t);if(Ft(t))return Xu(e,t)}else if(Ht(e)){if(vt(t)||Rt(t))return Ut(t,e);if(Ht(t))return qu(e,t);if(Vt(t))return ju(e,t);if(At(t))return Ku(e,t);if(oe(t))return Ju(e,t);if(Nt(t))return Qu(e,t);if(Ft(t))return tp(e,t)}else if(Vt(e)){if(vt(t)||Rt(t)||Ht(t))return Ut(t,e);if(Vt(t))return Wn(ya(e.planeLike,t.planeLike));if(At(t))return Wn(no(e.planeLike,t.center,t.radius));if(oe(t))return ip(e,t);if(Nt(t))return ep(e,t);if(Ft(t))return np(e,t)}else if(At(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t))return Ut(t,e);if(At(t))return Wn(so(e.center,e.radius,t.center,t.radius));if(oe(t))return;if(Nt(t))return sp(e,t);if(Ft(t))return}else if(oe(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t))return Ut(t,e);if(oe(t))return;if(Nt(t))return t.asCircle(),void 0;if(Ft(t))return}else if(Nt(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||oe(t))return Ut(t,e);if(Nt(t))return op(t,e);if(Ft(t))return}else if(Ft(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||Nt(t))return Ut(t,e);if(Ft(t))return}}const Yu=(()=>{const e=at();return(t,i)=>{const{start:n,end:s}=t;if(Ta(n,s)&&R(n[2],i.z))return t;const o=j();return js(i.getPlane(e),n,s,o)?new Je(o):void 0}})();function Wu({lineLike:e},{center:t,radius:i}){const n=t[2];return Pt(ba(e,t,i).filter(s=>R(s[2],n)))}function Xu({lineLike:e},{sphere:t}){return Pt(Sh(t,e.start,e.end))}const uo=(()=>{const e=jr(),t=g(),i=g();return(n,s,o)=>{const{normal:r,center:l,radius:h}=s;Qr(r,t,i);const u=$e(n),p=h*Z(u,t),d=h*Z(u,i);gh(e,l[0],l[1],l[2],1);const m=mh(n,e),f=Math.hypot(p,d),_=R(f,0);if(R(ls(n,l),0)){if(_)return s;if(R(h,0))return!o||me(o,l)?new Je(qe(l)):void 0;Ot(t,u,r),le(t,t);const W=new Array,gt=ye(l);z(gt,gt,t,h),o&&!me(o,gt)||W.push(gt);const lt=ye(l);return z(lt,lt,t,-h),o&&!me(o,lt)||W.push(lt),Pt(W)}if(_)return;const y=-m/f;if(Math.abs(y)>1||R(y,1))return;const w=Math.atan(p/d),b=tc(y)-w,S=Math.PI-b,I=new Array,K=g();z(K,l,t,h*Math.cos(b)),z(K,K,i,h*Math.sin(b)),I.push(K);const et=g();return z(et,l,t,h*Math.cos(S)),z(et,et,i,h*Math.sin(S)),I.push(et),Pt(o?Vu(o,I):I)}})();function qu(e,t){return R(e.z,t.z)?e:void 0}function ju({z:e},{planeLike:t}){const[i,n]=t.start,[s,o]=t.end,r=ve(i,n,e),l=ve(s,o,e);return t.type===bt.PLANE?new Ma(r,l):new Lu(r,l)}function Ku(e,t){const[i,n]=t.center;return new lo(ve(i,n,e.z),t.radius)}function Qu(e,t){return R(t.center[2],e.z)?t:void 0}const Ju=(()=>{const e=at();return(t,i)=>uo(t.getPlane(e),i,i.slicePlane)})();function tp(e,{center:t,radius:i}){const n=Math.abs(t[2]-e.z);if(n>i&&!R(n,i))return;const s=ve(t[0],t[1],e.z),o=Math.sqrt(i**2-n**2);return R(o,0)?void 0:new lo(s,o)}const ep=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=no(t.planeLike,i,n),o=i[2];t.getSlicePlane(e);const r=new Array;for(const[l,h]of s){const u=[l,h,o];me(e,u)&&r.push(u)}return Pt(r)}})(),ip=(()=>{const e=at(),t=at();return(i,n)=>uo(i.getPlane(e),n,i.getSlicePlane(t))})(),np=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=t.getPlane(e),o=Ae(s,i),r=Math.abs(o);if(r>n&&!R(r,n))return;const l=Math.sqrt(n**2-o**2);if(R(l,0)){const p=j();return Ks(s,i,p),new Je(p)}const h=j(),u=ye($e(s));return z(h,i,u,o),new co(h,l,u,t.getSlicePlane())}})();function sp(e,t){const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?t:Oa(so(e.center,e.radius,t.center,t.radius),t.center[2])}function op(e,t){if(!Ta(e.center,t.center))return;const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?e:Oa(so(e.center,e.radius,t.center,t.radius),e.center[2])}function Qo(e,t){const{planeLike:i,getZ:n}=e,s=new Array;if(vt(t))e.addIfOnTheGround(s,ku(i,t.point));else if(Rt(t))e.addIfOnTheGround(s,ma(i,t.lineLike));else if(At(t))for(const[o,r]of no(i,t.center,t.radius)){const l=n(o,r);l!=null&&s.push(pe(o,r,l))}else if(Vt(t)||hn(t))for(const[o,r]of ya(i,t.planeLike)){const l=n(o,r)??Ia;s.push(pe(o,r,l))}return Pt(s)}function Wn(e){return Li(e.map(([t,i])=>{const n=ve(t,i,0),s=ve(t,i,1);return new Ma(n,s)}))}function Pt(e){return Li(e.map(t=>t?new Je(t):void 0))}function Oa(e,t){return Pt(e.map(([i,n])=>[i,n,t]))}function Li(e){if(e.length!==0)return e.length===1?e[0]??void 0:new ka(e.filter(ki))}function ds(e){return e instanceof ka}function vt(e){return e instanceof Je}function Rt(e){return e instanceof ao}function Ht(e){return e instanceof Ra}function Vt(e){return e instanceof Va}function At(e){return e instanceof Ca}function Nt(e){return e instanceof lo}function oe(e){return e instanceof co}function Ft(e){return e instanceof Uu}function hn(e){return e instanceof Hu}function rp(e){return e instanceof Aa}function ap(e){return e instanceof ho}const Ia=0;var A;function po(e,t){if(e==null||t==null)return;const i=fs(e,t);return i!=null?Dt(i,"radians","geographic"):void 0}(function(e){e.Absolute="absolute",e.Relative="relative",e.RelativeBilateral="relative-bilateral"})(A||(A={}));const fs=(()=>{const e=g(),t=g();return(i,n)=>(N(e,i.x,i.y,i.z??0),N(t,n.x,n.y,n.z??0),lp(e,t,i.spatialReference,n.spatialReference))})(),lp=(()=>{const e=G(),t=g(),i=g();return(n,s,o,r)=>{if(H(n,s))return;const l=rn(o),h=rn(r);if(l&&h&&Qe(l,h)&&xt(n,o,t,l)&&xt(s,r,i,h)){const{azimuth:p}=mn(pp,t,i,l);return p!=null?fn(p,"degrees","radians"):void 0}e[0]=s[0]-n[0],e[1]=s[1]-n[1];let u=Pc(Rc,e);return e[0]<0&&(u=dp-u),u}})();function cp(e,t,i,n=A.Absolute){if(t&&i)switch(n){case A.Absolute:return po(t,i);case A.Relative:return un(Jo(e,t,i),A.Relative);case A.RelativeBilateral:return un(Jo(e,t,i),A.RelativeBilateral)}}function Jo(e,t,i){if(!e||!t||!i)return;const n=fs(e,t),s=fs(t,i);return n!=null&&s!=null?Dt(s-n,"radians","geographic"):void 0}function un(e,t){if(e!=null)switch(t){case A.Absolute:return gs(e);case A.Relative:{const i=Mt(e);let n=tr.normalize(i,0,!0);return n===-180&&(n=180),Dt(n,"degrees","geographic")}case A.RelativeBilateral:{const i=Mt(e),n=Math.abs(tr.normalize(i,0,!0));return Dt(n,"degrees","geographic")}}}function gs(e){const t=Mt(e),i=fp.normalize(t,0,!0);return Dt(i,"degrees","geographic")}const hp=(()=>{const e=g();return(t,i,n,s,o,r="geodesic")=>{rt(e,i);const l=Mt(o);if(r==="geodesic"){const f=rn(n);if(f&&xt(e,n,e,f))return bi(t,e,l,s,f),t[2]=i[2],!!xt(t,f,t,n)}const h=qr(l,"geographic","arithmetic"),u=fn(h,"degrees","radians"),p=i[0]+s*Math.cos(u),d=i[1]+s*Math.sin(u),m=i[2];return N(t,p,d,m),!0}})();function Mt(e){if(e!=null)return qr(up(e),e.rotationType,"geographic")}function up(e){return fn(e.value,e.unit,"degrees")}const pp=new yn,dp=2*Math.PI,fp=ta,tr=new Qs(-180,180);function gp(e,t,i,n,s,o){let r="geodesic",l=rn(i);const h=j();return to(e,t,n,h),h[2]=0,l&&xt(h,i,h,l)||(r="euclidean",l=i),{mode:r,view:t,elevationInfo:n,hasZ:s,directionMode:o,spatialReference:e.spatialReference,measurementSR:l,origin:h}}function mp(e,t,i){if(t==null||e==null)return;const n=Bs(i.measurementSR);if(n==null)return;const s=Sn(e,i);if(s==null)return;const o=_n(t,n);return new Ca(s,o)}function yp(e,t,i,n){if(i==null||e==null)return;const s=Sn(e,n);if(s==null)return;const o=Mt(i),r=10,l=u=>{if(u==null)return;const p=j(),d=Dt(u,"degrees","geographic");return hp(p,s,n.measurementSR,r,d,n.mode)?new $u(s,p):void 0},h=()=>{if(t!=null&&e!=null)return Mt(po(t,e))};switch(n.directionMode){case A.Absolute:return l(o);case A.Relative:{const u=h();return u==null?void 0:l(u+o)}case A.RelativeBilateral:{const u=h();return u==null?void 0:Li([l(u+o),l(u-o)])}}}function La(e,t){const i=Pn(e,t);return i!=null?new Ra(i):void 0}function Ga(e,t,i){const{context:n,longitude:s,latitude:o,direction:r,distance:l,elevation:h}=i;if(s!=null||o!=null||l!=null||h!=null||r!=null){if(s!=null||o!=null){const u=Mt(s),p=Mt(o),d=Pn(h,n);return new ho(u,p,d)}return _p(e,t,i)}}function _p(e,t,{context:i,direction:n,distance:s,elevation:o}){if(t==null)return La(o,i);const{view:r,elevationInfo:l,measurementSR:h}=i,u=to(t,r,l);if(!h||!xt(u,t.spatialReference,er,h))return;const[p,d]=er,m=s!=null?_n(s,"meters"):void 0,f=Mt(n),_=Pn(o,i),y=b=>{const S=new Aa([p,d],h,m,_,b);return m==null||b==null||_==null&&i.hasZ?S:new Je(S.closestTo(u))};if(f==null)return y(void 0);const w=()=>{if(e!=null&&t!=null)return Mt(po(e,t))};switch(i.directionMode){case A.Absolute:return y(f);case A.Relative:{const b=w();return b==null?void 0:y(b+f)}case A.RelativeBilateral:{const b=w();return b==null?void 0:Li([y(b+f),y(b-f)])}}}function vp(e){return e.context.mode==="geodesic"?Ga(null,null,e):Da(e)}function xp(e,t,i){const{context:n,x:s,y:o,distance:r,direction:l,elevation:h}=i;return n.mode==="geodesic"?Ga(t,e,i):s!=null||o!=null?Da(i):bp([mp(e,r,n),yp(e,t,l,n),La(h,n)])}function Da({x:e,y:t,elevation:i,context:n}){Hi.x=e?.value??0,Hi.y=t?.value??0,Hi.spatialReference=n.spatialReference;const s=Sn(Hi,n,Ep);return new ho(e!=null&&s!=null?s[0]:void 0,t!=null&&s!=null?s[1]:void 0,Pn(i,n))}function bp(e){let t;for(const i of e)i&&(t=t?.intersect(i)??i);return t}function Sn(e,t,i=j()){const{view:n,elevationInfo:s,measurementSR:o,origin:r,mode:l}=t;if(to(e,n,s,i),xt(i,e.spatialReference,i,o))return l!=="geodesic"&&Et(i,i,r),i}function wp(e,t,i,n){const{view:s,measurementSR:o,spatialReference:r,origin:l,mode:h}=i;if(h==="geodesic"?rt(oi,e):ut(oi,e,l),xt(oi,o,oi,r))return Yh(oi,s,t,i,n)}function Pn(e,t){return Tp(e,t)?.value??void 0}function Tp(e,{view:t,origin:i,elevationInfo:n,hasZ:s,measurementSR:o}){if(e==null||!s)return;const r=zr(o);if(r==null)return;const[l,h]=i,u=_n(e,r),p=t?.type==="3d"?Nr(t,l,h,u,o,n):u;return p!=null?ft(p,r):void 0}const er=j(),Ep=j(),oi=j(),Hi=Ws(0,0,0,ue.WGS84),Sp="z",Pp="r",ir={toggle:"Control"},Ue={enterInputMode:"Tab",commit:"Enter",discard:"Escape",next:"Tab"},kt={moveUp:{key:"ArrowUp",modifier:"Shift",repeats:!0},moveDown:{key:"ArrowDown",modifier:"Shift",repeats:!0},moveLeft:{key:"ArrowLeft",modifier:"Shift",repeats:!0},moveRight:{key:"ArrowRight",modifier:"Shift",repeats:!0},scaleUp:{key:"+",modifier:"Shift"},scaleDown:{key:"-",modifier:"Shift"},factorModifier:{key:Wr,continuePropagation:!0},toggleOpacity:"t",preserveAspectRatio:{key:"Shift",continuePropagation:!0},rotateIncrements:{key:"Shift",continuePropagation:!0},undo:Sp,redo:Pp};let Mp=class{constructor(){this._bindings=new Map}add(e,t){return this.addToggle(e,i=>{i.type==="key-down"&&t(i)})}addToggle(e,t){const i=kp.fromDefinition(e,t),n=ec(this._bindings,i.key,()=>[]);return n.push(i),Y(()=>Dr(n,i))}register(e,t=Xr.WIDGET){return Gr([e.on("key-down",i=>this.dispatch(e.inputManager,i),t),e.on("key-up",i=>this.dispatch(e.inputManager,i),t)])}dispatch(e,t){const i=t.key,n=this._bindings.get(i);if(n)for(const s of n)s.process(e,t)}},kp=class ms{constructor(t,i,n,s,o){this.key=t,this.modifiers=i,this.repeats=n,this.continuePropagation=s,this.callback=o}process(t,i){if(!(i.key!==this.key||"repeat"in i&&i.repeat&&!this.repeats)){for(const n of this.modifiers)if(!t.isModifierKeyDown(n))return;this.continuePropagation||i.stopPropagation(),this.callback(i)}}static fromDefinition(t,i){if(typeof t=="string")return new ms(t,[],!1,!1,i);const{key:n,modifier:s,repeats:o,continuePropagation:r}=t;return new ms(n,s?Array.isArray(s)?s:[s]:[],!!o,!!r,i)}};const Q="esri-tooltip",Cp=`${Q}-content`,Rp=`${Q}-content--input`,Vp=`${Q}-content__header`,Ap=`${Q}-content__header__spacer`,nr=`${Q}-content__header__actions`,za=`${Q}-draw-header-actions`,Op=`${Q}-table`,Ip=`${Q}-help-message`,Lp=`${Q}-help-message__text`,Gp=`${Q}-help-message__icon`,Ni=`${Q}-field`,Fi={base:Ni,inputMode:`${Ni}--input`,title:`${Ni}__title`,value:`${Ni}__value`};let $=class extends Vi{constructor(){super(...arguments),this.hidden=!1,this.mode="feedback"}render(){return v("div",{class:this.classes({[Fi.base]:!0,[Fi.inputMode]:this.mode==="input"})},v("div",{class:Fi.title,key:"title"},this.title),v("div",{class:Fi.value,key:"value"},this.value))}};a([c()],$.prototype,"hidden",void 0),a([c()],$.prototype,"mode",void 0),a([c()],$.prototype,"title",void 0),a([c()],$.prototype,"value",void 0),$=a([x("esri.views.interactive.tooltip.components.TooltipField")],$);const Dp={base:`${Q}-value-by-value`};let Wt=class extends Vi{constructor(){super(...arguments),this.divider="×"}render(){return v("div",{class:Dp.base},v("span",null,this.left),v("span",null,this.divider),v("span",null,this.right))}};a([c()],Wt.prototype,"left",void 0),a([c()],Wt.prototype,"divider",void 0),a([c()],Wt.prototype,"right",void 0),Wt=a([x("esri.views.interactive.tooltip.components.ValueByValue")],Wt);function ys(e){let t,i,n=[],s=!1;function o(...r){return s&&t===this&&zp(r,n)||(i=e.apply(this,r),t=this,n=r,s=!0),i}return o}function zp(e,t){if(e.length!==t.length)return!1;for(let i=0;iQp(e,i,n??t.area),length:(i,n,s)=>or(e,i,n??t.length,s),lengthRelative:(i,n)=>qp(e,i,n??t.length),totalLength:(i,n)=>or(e,i,n??t.length),verticalLength:(i,n)=>jp(e,i,n??t.verticalLength),verticalLengthRelative:(i,n)=>Kp(e,i,n??t.verticalLength),percentage:ld,scalar:Fa,scale:cd}}function td(e){return Ci(e,{signDisplay:"exceptZero",...go(kn)})}function ed(e){return Mn(e,e.rotationType,kn)}function id(e){const t=Mt(e);return Ci(t,{style:"unit",unitDisplay:"narrow",unit:"degree",signDisplay:t>0?"never":"exceptZero",...go(kn)})}function nd(e){return Mn(e,e.rotationType,kn)}function sd(e){return Ha(e,Ya)}function od(e){return Ha(e,Wa)}function rd(e){return Na(e,Ya)}function ad(e){return Na(e,Wa)}function Ha(e,t){return Mn(te(e,"degrees"),"geographic",Ua,t,!1)}function Na(e,t){const i=t.normalize(te(e,"degrees").value,void 0,!1);return Fa(Qt(i),Ua)}function ld(e){return Ci(e.value,{style:"percent"})}function cd(e){return Ci(e,{style:"percent",maximumFractionDigits:0})}function Fa(e,t){return Ci(e.value,go(t))}function go(e){return{minimumFractionDigits:e,maximumFractionDigits:e}}function xe({createQuantity:e,sanitize:t}){return(i,n)=>{if(i==null)return null;t&&(i=t(i));const s=Ze(i);return s==null?null:e(s,n)}}function Za(e){return e.replaceAll(/[*^~°º]/g,"")}const hd=e=>{let t=`[-+]?[0-9${e.thousands}]+`;return e.decimal!==""&&(t+=`${e.decimal}[0-9]+`),new RegExp(`^(${t}\\s*)${e.separator}(\\s*${t})$`,"i")},ud=" ",Ba=[];for(const e of[",","\\|","\\s+"])for(const t of["\\.",",",""])for(const i of["",",","\\.",ud,"\\s+"])e!==t&&e!==i&&t!==i&&Ba.push({separator:e,decimal:t,thousands:i,pattern:hd({decimal:t,thousands:i,separator:e})});function pd(e){for(const{decimal:t,thousands:i,pattern:n}of Ba){n.lastIndex=0;const s=e.match(n);if(!s)continue;const o=Ze(rr(s[1],t,i)),r=Ze(rr(s[2],t,i));if(o!=null&&r!=null)return{x:Qt(o),y:Qt(r)}}return null}function rr(e,t,i){let n=e.replaceAll(/[\s+]/g,"");return i!==""&&(n=n.replaceAll(i,"")),t!==""&&(n=n.replaceAll(t,".")),n}function dd(e){if(!e||Ze(e)!=null||!eo())return null;const t=Si(e),i=Ke(t?.latitude),n=Ke(t?.longitude);return n!=null&&i!=null?{latitude:i,longitude:n}:null}function fd(e){return Ke(au(e))}function gd(e){return Ke(lu(e))}function Ke(e){return e!=null?Dt(e,"degrees","geographic"):null}const Ya=new Qs(-180,180),Wa=new Qs(-90,90),Xn=Symbol("dragHandles");let E=class extends Vi{constructor(){super(...arguments),this._focusAbortController=new AbortController,this._transitionInfo=null,this._mode="feedback",this._getFormatters=ys(Jp),this._onHeaderPointerDown=e=>{const t=e.target;t instanceof HTMLElement&&t?.tagName?.toLowerCase()!=="calcite-button"&&(this.removeHandles(Xn),t.setPointerCapture(e.pointerId),this.tooltip.onDragStart(e.clientX,e.clientY),this.addHandles([di(t,"pointermove",({clientX:i,clientY:n})=>{this.tooltip.onDrag(i,n)}),di(t,["pointerup","pointercancel"],i=>{this.removeHandles(Xn),t.releasePointerCapture(e.pointerId),this.tooltip.onDragEnd()}),di(t,"touchstart",i=>i.preventDefault())],Xn))},this._onDiscard=()=>{this.destroyed||(this.tooltip.emit("discard"),this.info.clearInputValues(),this.exitInputMode())},this._onCommit=(e,t)=>{if(this.destroyed)return;if(this.tooltip.emit("commit",{type:t}),t==="commit-and-exit")return void this.exitInputMode();if(t==="commit-on-blur")return;const i=this._getFocusableElements(),n=i.length,s=i.indexOf(e);if(s===-1)return void this.exitInputMode();const o=((s+(t==="commit-and-next"?1:-1))%n+n)%n;Zi(i.at(o))},this._onKeyDown=e=>{switch(e.code){case Ue.next:return this._onNextKey(e);case Ue.discard:return e.stopPropagation(),this._onDiscard()}}}get mode(){return this._mode}get _displayUnits(){const{displayUnits:e}=this.info.sketchOptions.values,t=sr(this.tooltip.view);return{length:e.length??t,verticalLength:e.verticalLength??t,area:e.area??t}}get _inputUnitInfos(){const e=this._messagesUnits,t=l=>({unit:l,abbreviation:ih(e,l,"abbr")}),{inputUnits:i}=this.info.sketchOptions.values,n=sr(this.tooltip.view),s=i.length??n,o=i.verticalLength??n,r=i.area??n;return{length:t(sc(s)),verticalLength:t(oc(o)),area:t(rc(r)),angle:t("degrees")}}get _formatters(){return this._getFormatters(this._messagesUnits,this._displayUnits)}get fieldContext(){return{formatters:this._formatters,inputUnitInfos:this._inputUnitInfos,messages:this._messagesTooltip,sketchOptions:this.info.sketchOptions,onCommit:this._onCommit,onDiscard:this._onDiscard}}render(){const{visibleElements:e}=this.info.sketchOptions.tooltips,t=this._renderedContent,i=this._renderedActions,n=this._renderedHelpMessage,s=t.length>0,o=s||!!n,r=this.mode==="input";return v("div",{class:Oh(Cp,r&&Rp),onkeydown:this._onKeyDown,tabIndex:-1},r&&o&&e.header?v("div",{class:Vp,"data-testid":"tooltip-header",key:"header",onpointerdown:this._onHeaderPointerDown},v("calcite-button",{appearance:"transparent","data-testid":"tooltip-back-button",iconFlipRtl:"both",iconStart:"chevron-left",key:"discard-button",kind:"neutral",onclick:this._onDiscard,scale:"s",tabIndex:-1}),i.length>0?v(wt,null,v("div",{class:Ap,key:"spacer"}),v("div",{class:nr,key:"actions"},i)):null):null,s?v("div",{class:Op,key:"content"},...t):null,n)}destroy(){this._focusAbortController.abort(),this._transitionInfo?.transition.skipTransition()}_renderActions(){return null}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-By40tgvH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),icon:()=>It(()=>import("./calcite-icon-laqhdRBY-Dn93dMQE.js"),__vite__mapDeps([20,17,1,2,3,4,5,6,8,15]),import.meta.url),input:()=>It(()=>import("./calcite-input-BKRd7MCS-DN64wHsO.js"),__vite__mapDeps([21,22,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url)})}async enterInputMode(e,t){try{await this._transitionTo("input",t),await this._focusField(e)}catch(i){ko(i)}}async exitInputMode({focusOnView:e=!0}={}){try{const{container:t,info:i}=this;i.clearInputValues();const n=e?t?.closest(".esri-view")?.querySelector(".esri-view-surface"):null;await this._transitionTo("feedback"),n instanceof HTMLElement&&n.focus()}catch(t){ko(t)}}_onNextKey(e){const t=this._getFocusableElements(),i=t.at(0),n=t.at(-1);i&&n&&(e.shiftKey?document.activeElement===i&&(e.preventDefault(),e.stopPropagation(),Zi(n)):document.activeElement===n&&(e.preventDefault(),e.stopPropagation(),Zi(i)))}get _renderedContent(){return ar(this._renderContent())}get _renderedActions(){return ar(this._renderActions())}get _renderedHelpMessage(){const{sketchOptions:e,visibleElements:t}=this.info;if(!t.helpMessage)return null;const i=e.tooltips.helpMessage??this._defaultHelpMessage;if(!i)return null;const n=e.tooltips.helpMessageIcon??"information";return v("div",{class:Ip,key:"help-message"},n?v("calcite-icon",{class:Gp,icon:n,scale:"s"}):null,v("div",{class:Lp},i))}get _defaultHelpMessage(){const{helpMessage:e,viewType:t}=this.info;if(e==null)return null;const i=t==="3d"?"helpMessages3d":"helpMessages2d";return this._messagesTooltip?.sketch?.[i]?.[e]}async _focusField(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const{signal:t}=this._focusAbortController;await this._waitForInputs(),ql(t);const i=this._getFocusableInputs(),n=e?i.find(s=>s.getAttribute("data-field-name")===e):i.at(0);await Zi(n)}async _transitionTo(e,t){if(this._mode===e&&!this._transitionInfo)return;if(this._transitionInfo?.mode===e)return this._transitionInfo.transition.finished;this._transitionInfo?.transition.skipTransition();const i=async()=>{this.destroyed||(this._mode=e,await Ro(),this.destroyed||(this.renderNow(),await Ro(),this.destroyed||t?.()))};if(!this.domNode?.firstChild||!document.startViewTransition||qc())return void await i();this.autoRenderingEnabled=!1;const n=this._transitionInfo={transition:document.startViewTransition(async()=>{this.destroyed||n!==this._transitionInfo||(this.autoRenderingEnabled=!0,await i())}),mode:e};try{await n.transition.finished}finally{n===this._transitionInfo&&(this._transitionInfo=null)}}async _waitForInputs(){const e=()=>Array.from(this.domNode?.querySelectorAll("calcite-input")??[]);for(;e().length===0;)await jl(md);await Rr()}_getFocusableInputs(){return Array.from(this.domNode?.querySelectorAll("calcite-input:not([read-only]):not([disabled])")??[])}_getFocusableElements(){const e=this.domNode?.querySelector(`.${za}`);return[...Array.from(e?.querySelectorAll(`.${nr} calcite-button:not([disabled])`)??[]),...this._getFocusableInputs()]}};async function Zi(e){await e?.setFocus()}function ar(e){return(Array.isArray(e)?e:[e]).flat(10).filter(t=>!!t)}a([cs("esri/core/t9n/Units"),c()],E.prototype,"_messagesUnits",void 0),a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],E.prototype,"_messagesTooltip",void 0),a([c()],E.prototype,"info",void 0),a([c()],E.prototype,"tooltip",void 0),a([c()],E.prototype,"_mode",void 0),a([c()],E.prototype,"mode",null),a([c()],E.prototype,"_displayUnits",null),a([c()],E.prototype,"_inputUnitInfos",null),a([c()],E.prototype,"_formatters",null),a([c()],E.prototype,"fieldContext",null),a([c()],E.prototype,"_renderedContent",null),a([c()],E.prototype,"_renderedActions",null),a([c()],E.prototype,"_renderedHelpMessage",null),a([c()],E.prototype,"_defaultHelpMessage",null),E=a([x("esri.views.interactive.tooltip.content.TooltipContent")],E);const md=20;let _s=class extends E{_renderContent(){const{area:e,radius:t,xSize:i,ySize:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.radius&&t!=null?v($,{title:o.radius,value:r.length(t)}):null,s.size&&i!=null&&n!=null?v($,{title:o.size,value:v(Wt,{left:r.length(i),right:r.length(n)})}):null,s.area?v($,{title:o.area,value:r.area(e)}):null)}};_s=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawCircle")],_s);const ct=`${Q}-editable-field`,st={base:ct,inputMode:`${ct}--input`,feedbackMode:`${ct}--feedback`,readOnly:`${ct}--read-only`,locked:`${ct}--locked`,title:`${ct}__title`,value:`${ct}__value`,valueContent:`${ct}__value__content`,valueContentReadOnly:`${ct}__value__content--read-only`,lockIcon:`${ct}__lock-icon`,input:`${ct}__input`,inputSuffix:`${ct}__input-suffix`,button:`${ct}__button`},qn={lock:"lock",unlock:"unlock"};let yt=class extends Vi{constructor(){super(...arguments),this._input=null,this._lock=null,this._onLockClick=()=>{this.field.toggleLock(this.context)},this._onLockAfterCreate=e=>{this._lock=e},this._onLockAfterRemoved=()=>{this._lock=null},this._onKeyDown=e=>{e.key===Ue.discard&&this.mode==="input"&&this._input&&this.context.onDiscard(this._input)},this._onInputKeyDown=e=>{const t=this._input;if(t)switch(e.key){case Ue.commit:return this.field.onCommit("commit-and-exit",t,this.context);case Ue.next:{e.preventDefault(),e.stopPropagation();const i=e.shiftKey?"commit-and-previous":"commit-and-next";return this.field.onCommit(i,t,this.context)}}},this._onInput=e=>{this.field.onInput(e.target.value)},this._onInputBlur=e=>{const t=this._input;t&&e.relatedTarget!==this._lock&&this.field.onCommit("commit-on-blur",t,this.context)},this._selectText=()=>{const e=()=>{this._input===document.activeElement&&this._input?.selectText()};e(),Rr().then(e)},this._onAfterCreate=e=>{this._input=e,e.addEventListener("paste",this._onPaste),e.addEventListener("beforeinput",this._onBeforeInput)},this._onAfterRemoved=e=>{e.removeEventListener("paste",this._onPaste),e.removeEventListener("beforeinput",this._onBeforeInput)},this._onPaste=e=>{const t=e.clipboardData?.getData("text");t&&this.field.parse(t,this.context)!=null&&(e.stopPropagation(),this.field.onInput(t))},this._onBeforeInput=e=>{(e.inputType==="historyUndo"||e.inputType==="historyRedo")&&!this.field.dirty&&e.preventDefault()}}initialize(){this.addHandles(U(()=>this._rawDisplayValue,()=>{const{committed:e,inputValue:t}=this.field;e||t||this._input!==document.activeElement||this._selectText()}))}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-By40tgvH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),icon:()=>It(()=>import("./calcite-icon-laqhdRBY-Dn93dMQE.js"),__vite__mapDeps([20,17,1,2,3,4,5,6,8,15]),import.meta.url),input:()=>It(()=>import("./calcite-input-BKRd7MCS-DN64wHsO.js"),__vite__mapDeps([21,22,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url)})}render(){const{field:e,mode:t}=this,i=t==="input",{locked:n,readOnly:s}=e;return v("div",{class:this.classes({[st.base]:!0,[st.feedbackMode]:t==="feedback",[st.inputMode]:t==="input",[st.locked]:n,[st.readOnly]:s})},v("div",{class:st.title,key:"title"},this._title),v("div",{class:st.value,key:"value",onkeydown:this._onKeyDown},i?this._renderValueInputMode():this._renderValueFeedbackMode()))}get _formattedValue(){return this.field.getFormattedValue(this.context)||lr}get _rawDisplayValue(){return this.field.getRawDisplayValue(this.context)}get _suffix(){return this.field.getSuffix(this.context)}get _title(){const{title:e}=this.field;return typeof e=="string"?e:e(this.context)}_renderValueFeedbackMode(){return v(wt,null,v("div",{class:st.valueContent,key:"value-feedback"},this._formattedValue),this.field.locked&&this.mode!=="input"?v("calcite-icon",{class:st.lockIcon,icon:qn.lock,key:"icon",scale:"s"}):null)}_renderValueInputMode(){return this.field.readOnly?this._renderValueReadOnly():this._renderValueWritable()}_renderValueReadOnly(){return v("div",{class:this.classes(st.valueContent,st.valueContentReadOnly),key:"value-read-only"},this._formattedValue)}_renderValueWritable(){const{field:e}=this,{name:t,invalid:i,locked:n}=e,s=this.context?.messages.sketch??{},o=n?s.unlockConstraint:s.lockConstraint;return v(wt,null,v("calcite-input",{afterCreate:this._onAfterCreate,afterRemoved:this._onAfterRemoved,class:st.input,"data-field-name":t,"data-testid":`tooltip-field-${t}`,key:"input",onblur:this._onInputBlur,onfocus:this._selectText,onkeydown:this._onInputKeyDown,scale:"s",status:i?"invalid":"idle",type:"text",value:this._rawDisplayValue??lr,onCalciteInputInput:this._onInput}),v("div",{class:st.inputSuffix,key:"suffix"},this._suffix),e.lockable?v("calcite-button",{afterCreate:this._onLockAfterCreate,afterRemoved:this._onLockAfterRemoved,alignment:"center",appearance:"transparent",class:st.button,"data-testid":`tooltip-field-${t}-lock`,iconStart:n?qn.lock:qn.unlock,key:"lock",kind:"neutral",label:o,onclick:this._onLockClick,scale:"s",tabIndex:-1,title:o}):v("div",{key:"lock-empty"}))}};a([c()],yt.prototype,"field",void 0),a([c()],yt.prototype,"context",void 0),a([c()],yt.prototype,"mode",void 0),a([c()],yt.prototype,"_input",void 0),a([c()],yt.prototype,"_lock",void 0),a([c()],yt.prototype,"_formattedValue",null),a([c()],yt.prototype,"_rawDisplayValue",null),a([c()],yt.prototype,"_suffix",null),a([c()],yt.prototype,"_title",null),yt=a([x("esri.views.interactive.tooltip.components.TooltipEditableField")],yt);const lr="—";function ee(e){const t=e.fields.filter(i=>i?.visible===!0);return t.length===0?null:v(wt,null,t.map(i=>v(yt,{context:e.context,field:i,key:i.id,mode:e.mode})))}let vs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};vs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawMesh")],vs);let xs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{elevation:n,visibleElements:s}=t;return v(ee,{context:e,fields:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0,s.elevation?n:void 0],mode:i})}};xs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],xs);const jn={absolute:"absolute-direction",relative:"relative-direction"};let Ee=class extends Vi{constructor(e){super(e),this.visibleElements={}}render(){return v("div",{class:za},this._isElementVisible("direction")?v(yd,{messages:this.messages,sketchOptions:this.sketchOptions}):null)}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-By40tgvH.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),dropdown:()=>It(()=>import("./calcite-dropdown-CLrG397W-CnAw_6_z.js"),__vite__mapDeps([23,1,2,3,4,5,6,8,24,25,19,9,14,12,15,26]),import.meta.url),"dropdown-item":()=>It(()=>import("./calcite-dropdown-item-DpLfv4A0-C0tcRIAy.js"),__vite__mapDeps([27,1,2,3,4,5,6,8,12,11,9,28,17,15]),import.meta.url),"dropdown-group":()=>It(()=>import("./calcite-dropdown-group-0sIPwaDd-Bs73CRS2.js"),__vite__mapDeps([29,1,2,3,4,5,6,15,28]),import.meta.url)})}_isElementVisible(e){return this.visibleElements?.[e]??this.sketchOptions.tooltips.visibleElements[e]}};function yd(e){const{directionMode:t}=e.sketchOptions.values,i=e.messages?.sketch,n=i?.directionModeSelect?.title,s="absolute",o="relative";return v("calcite-dropdown",{key:"direction-mode",placement:"bottom-end",scale:"s",widthScale:"s",onCalciteDropdownSelect:r=>{const l=r.target.selectedItems?.[0]?.getAttribute("data-mode");e.sketchOptions.values.directionMode=l??"absolute"}},v("calcite-button",{alignment:"end",appearance:"transparent",iconStart:jn[t],kind:"neutral",label:n,scale:"s",slot:"trigger",title:n}),v("calcite-dropdown-group",{selectionMode:"single"},v("calcite-dropdown-item",{"data-mode":o,"data-testid":"tooltip-direction-mode-relative",iconStart:jn.relative,key:"relative",selected:t===o},i?.directionModeSelect?.relative),v("calcite-dropdown-item",{"data-mode":s,"data-testid":"tooltip-direction-mode-absolute",iconStart:jn.absolute,key:"absolute",selected:t===s},i?.directionModeSelect?.absolute)))}a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],Ee.prototype,"messages",void 0),a([c()],Ee.prototype,"sketchOptions",void 0),a([c()],Ee.prototype,"visibleElements",void 0),Ee=a([x("esri.views.interactive.tooltip.components.DrawHeaderActions")],Ee);let bs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.area?t.area:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};bs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],bs);let ws=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.totalLength?t.totalLength:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};ws=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],ws);let Ts=class extends E{_renderContent(){const{area:e,xSize:t,ySize:i,visibleElements:n}=this.info,s=this._messagesTooltip.sketch,o=this._formatters;return v(wt,null,n.size&&t!=null&&i!=null?v($,{title:s.size,value:v(Wt,{left:o.length(t),right:o.length(i)})}):null,n.area?v($,{title:s.area,value:o.area(e)}):null)}};Ts=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawRectangle")],Ts);let Es=class extends E{_renderContent(){const{angle:e,visibleElements:t}=this.info,i=this._messagesTooltip.sketch;return v(wt,null,t.rotation?v($,{title:i.rotation,value:this._formatters.angleRelative(e)}):null)}};Es=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentRotate")],Es);let Ss=class extends E{_renderContent(){const e=this.info,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.size?v($,{title:i.size,value:v(Wt,{left:n.length(e.xSize),right:n.length(e.ySize)})}):null,t.scale?v($,{title:i.scale,value:v(Wt,{left:n.scale(e.xScale),right:n.scale(e.yScale)})}):null)}};Ss=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentScale")],Ss);let Ps=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0],mode:i})}};Ps=a([x("esri.views.interactive.tooltip.content.TooltipContentMovePoint")],Ps);let Ms=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.distance?t.distance:void 0,n.area?t.area:void 0,n.totalLength?t.totalLength:void 0],mode:i})}};Ms=a([x("esri.views.interactive.tooltip.content.TooltipContentReshapeEdgeOffset")],Ms);let ks=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.area&&t.geometryType==="polygon"?t.area:null,n.totalLength&&t.geometryType==="polyline"?t.totalLength:null],mode:i})}};ks=a([x("esri.views.interactive.tooltip.content.TooltipContentSelectedVertex")],ks);let Cs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};Cs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformMesh")],Cs);let Rs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.size?t.size:void 0],mode:i})}};Rs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformPoint")],Rs);let Vs=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v($,{title:i.distance,value:n.length(e.distance)}):null)}};Vs=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslate")],Vs);let As=class extends E{_renderContent(){const{distance:e,elevation:t,area:i,totalLength:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.distance?v($,{title:o.distance,value:r.length(e)}):null,s.elevation&&t?.actual!=null?v($,{title:o.elevation,value:r.verticalLength(t.actual)}):null,s.area&&i!=null?v($,{title:o.area,value:r.area(i)}):null,s.totalLength&&n!=null?v($,{title:o.totalLength,value:r.length(n)}):null)}};As=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateVertex")],As);let Os=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v($,{title:i.distance,value:n.length(e.distance)}):null)}};Os=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateXY")],Os);let Is=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch;return v(wt,null,t.distance?v($,{title:i.distance,value:this._formatters.verticalLengthRelative(e.distance)}):null)}};Is=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateZ")],Is);function _d(e,t){if(t==null)return null;const i=document.createElement("div");switch(t.type){case"draw-point":return new xs({tooltip:e,info:t,container:i});case"draw-polygon":return new bs({tooltip:e,info:t,container:i});case"draw-polyline":return new ws({tooltip:e,info:t,container:i});case"draw-mesh":return new vs({tooltip:e,info:t,container:i});case"draw-rectangle":return new Ts({tooltip:e,info:t,container:i});case"draw-circle":return new _s({tooltip:e,info:t,container:i});case"extent-rotate":return new Es({tooltip:e,info:t,container:i});case"extent-scale":return new Ss({tooltip:e,info:t,container:i});case"move-point":return new Ps({tooltip:e,info:t,container:i});case"selected-vertex":return new ks({tooltip:e,info:t,container:i});case"transform-point":return new Rs({tooltip:e,info:t,container:i});case"transform-mesh":return new Cs({tooltip:e,info:t,container:i});case"translate":return new Vs({tooltip:e,info:t,container:i});case"translate-vertex":return new As({tooltip:e,info:t,container:i});case"translate-z":return new Is({tooltip:e,info:t,container:i});case"translate-xy":return new Os({tooltip:e,info:t,container:i});case"reshape-edge-offset":return new Ms({tooltip:e,info:t,container:i})}}const ci={base:`${Q}`,ltr:`${Q}--ltr`,rtl:`${Q}--rtl`,debug:`${Q}--debug`},vd=20,xd=16,bd="bottom-end";let F=class extends Ce.EventedAccessor{constructor(e){super(e),this.info=null,this.options=null,this.position=null,this.content=null,this._focused=!1,this.outerContainer=document.createElement("div"),this.debug=!1,this._lastPosition=null,this._rtl=!1,this._prevXY=[0,0]}initialize(){const{outerContainer:e}=this;this.addHandles([U(()=>this.view.overlay?.surface,t=>{e.remove(),t?.appendChild(e),this._rtl=Vh(t)},ke),U(()=>this.info,(t,i)=>{if(this.content!=null&&t!=null&&i!=null&&t.type===i.type)this.content.info=t;else{dt(this.content);const n=_d(this,t);n?(this.content=n,n.container&&e.appendChild(n.container),this.exitInputMode()):this.content=null}},ke),U(()=>({container:this.outerContainer,style:this._outerContainerStyle}),({container:t,style:i})=>{Object.assign(t.style,i)},es),U(()=>({outerContainer:this.outerContainer,placement:this.effectivePlacement,effectiveOffset:this._effectiveOffset,rtl:this._rtl,debug:this.debug}),({outerContainer:t,placement:i,effectiveOffset:n,rtl:s,debug:o})=>{const{classList:r}=t;r.add(ci.base),r.toggle(ci.rtl,s),r.toggle(ci.ltr,!s),r.toggle(ci.debug,o),this.outerContainer.style.setProperty("--offset",`${n}px`),Ah(t),Ed(t,i)},es),Il(()=>this.mode==="feedback",()=>{this.position=null,this._clearOverride("effectivePlacement")},$s),di(this.outerContainer,"paste",t=>{this.emit("paste",t)}),di(this.outerContainer,["focusin","focusout"],()=>{setTimeout(()=>{this._focused=this.content?.container?.contains(document.activeElement)??!1})})])}destroy(){this.info=null,this.content=dt(this.content),this.outerContainer.remove()}get mode(){return this.content?.mode??"feedback"}get focused(){return this._focused}get visible(){return this._outerContainerStyle.display!=="none"}get contentContainer(){return this.content?.container}get effectivePlacement(){const e=this.options?.placement;return e==="auto"?"bottom-end":e??bd}get _screenPoint(){const{inputManager:e}=this.view;return e?.multiTouchActive?null:e?.latestPointerLocation}get _effectiveOffset(){return this.options?.offset??vd}get _outerContainerStyle(){const e=this.position??this._screenPoint;return this._lastPosition=So(e),e!=null&&this.content!=null?{display:"block",transform:`translate(${Math.round(e.x)}px, ${Math.round(e.y)}px)`}:{display:"none",transform:"none"}}clear(){this.info=null}async enterInputMode(e){const t=this.position??this._lastPosition??this._screenPoint,i=this.position=So(t),{effectivePlacement:n}=this;this._override("effectivePlacement",n);const s=()=>{i&&(this.position=wd(this.contentContainer,i,this._effectiveOffset,this.view),Object.assign(this.outerContainer.style,this._outerContainerStyle))};await this.content?.enterInputMode(e,s)}async exitInputMode(e){await this.content?.exitInputMode(e)}onDragStart(e,t){this._prevXY=[e,t]}onDrag(e,t){const i=e-this._prevXY[0],n=t-this._prevXY[1];this._prevXY=[e,t];const{position:s}=this;if(s){const{view:o}=this,r=e-o.position[0],l=t-o.position[1];if(r<0||r>o.width||l<0||l>o.height-xd)return;this.position=Us(s.x+i,s.y+n)}}onDragEnd(){this._prevXY=[0,0]}};function wd(e,t,i,n){if(!e||!n.container)return t;const s=e.getBoundingClientRect(),{left:o,top:r}=n.container.getBoundingClientRect();let{x:l,y:h}=t;const u=s.left-o-i;u<0&&(l-=u);const p=s.right-o+i-n.width;p>0&&(l-=p);const d=s.top-r-i;d<0&&(h-=d);const m=s.bottom-r+i-n.height;return m>0&&(h-=m),Us(l,h)}a([c({nonNullable:!0})],F.prototype,"view",void 0),a([c()],F.prototype,"info",void 0),a([c()],F.prototype,"options",void 0),a([c()],F.prototype,"position",void 0),a([c()],F.prototype,"content",void 0),a([c({readOnly:!0})],F.prototype,"mode",null),a([c()],F.prototype,"_focused",void 0),a([c({readOnly:!0})],F.prototype,"focused",null),a([c({readOnly:!0})],F.prototype,"outerContainer",void 0),a([c({readOnly:!0})],F.prototype,"contentContainer",null),a([c({readOnly:!0})],F.prototype,"effectivePlacement",null),a([c()],F.prototype,"debug",void 0),a([c()],F.prototype,"_lastPosition",void 0),a([c()],F.prototype,"_screenPoint",null),a([c()],F.prototype,"_rtl",void 0),a([c()],F.prototype,"_effectiveOffset",null),a([c()],F.prototype,"_outerContainerStyle",null),F=a([x("esri.views.interactive.Tooltip")],F);const Td=["top","bottom","leading","trailing"].flatMap(e=>[Ji(`${e}-start`),Ji(e),Ji(`${e}-end`)]);function Ji(e){return`${ci.base}--${e}`}function Ed({classList:e},t){Td.forEach(i=>e.remove(i)),e.add(Ji(t))}const Sd=F;function Pd(e){const t=new Sd(e());return t.addHandles(U(()=>e(),({view:i,options:n,info:s})=>{t.view=i,n!==void 0&&(t.options=n),s!==void 0&&(t.info=s)})),t}function Md(e,t){const i=Rh(t.vertexSpace),{scale:n,orientation:s}=e,{transform:o}=t,r=kd(o);i&&r!=null?(s.actual=Dt(r,"degrees","arithmetic"),s.visible=!0):(s.actual=null,s.visible=!1),i?(n.actual=Qt(Vd(o)),n.visible=!0):(n.actual=null,n.visible=!1)}function kd(e){if(!e)return 0;const t=Cd(e.rotationAxis);return t!=null?t*e.rotationAngle:null}function Cd(e){return Ye(e,Hs)?1:Ye(e,Rd)?-1:null}const Rd=rs(g(),Hs);function Vd(e){return e?Math.max(...e.scale):1}function Ad(e,t){return!(e.type!=="key-down"||e.key!==Ue.enterInputMode||!t||!Od(t.info))&&(t.enterInputMode(),e.preventDefault(),e.stopPropagation(),!0)}function Od(e){const t=e?.sketchOptions;if(!t)return!1;const{inputEnabled:i,visibleElements:n}=t.tooltips;return i&&e.editableFields.some(({name:s})=>s==="x"||s==="y"?n.coordinates:n[s])===!0}function Id(e,t,i){if(!t||!("geographic"in t))return;const n=e.clipboardData?.getData("text");if(!n)return;const s=o=>{e.stopPropagation(),e.preventDefault(),o()};if(t.geographic){const o=dd(n);o&&s(()=>{t.longitude.applyValue(o.longitude),t.latitude.applyValue(o.latitude)})}else{const o=pd(n);o&&s(()=>{t.x.applyValue(o.x),t.y.applyValue(o.y)})}}let ot=class extends tt{constructor(e){super(e),this.helpMessage=void 0,this.viewType=void 0}get visibleElements(){return this.sketchOptions.tooltips.visibleElements}get allFields(){return[]}get editableFields(){return this.allFields.filter(e=>e.visible&&!e.readOnly)}clearInputValues(){this.allFields.forEach(e=>e.clearInputValue())}};a([c()],ot.prototype,"sketchOptions",void 0),a([c()],ot.prototype,"visibleElements",null),a([c()],ot.prototype,"helpMessage",void 0),a([c()],ot.prototype,"viewType",void 0),a([c()],ot.prototype,"allFields",null),a([c()],ot.prototype,"editableFields",null),ot=a([x("esri.views.interactive.tooltip.infos.SketchTooltipInfo")],ot);let Zt=class extends ot{constructor(e){super(e),this.type="draw-circle",this.radius=null,this.xSize=null,this.ySize=null,this.area=We}get allFields(){return[]}};a([c()],Zt.prototype,"type",void 0),a([c()],Zt.prototype,"radius",void 0),a([c()],Zt.prototype,"xSize",void 0),a([c()],Zt.prototype,"ySize",void 0),a([c()],Zt.prototype,"area",void 0),a([c()],Zt.prototype,"allFields",null),Zt=a([x("esri.views.interactive.tooltip.infos.DrawCircleTooltipInfo")],Zt);let M=class extends tt{constructor(e){super(e),this.actual=null,this.lockable=!0,this.id=Ih(),this.inputValue=null,this.readOnly=!1,this.suffix=null,this.visible=!0,this.invalid=!1,this.unlockOnVertexPlacement=!0}get committed(){return this.lockable?this._get("committed"):null}set committed(e){this.lockable&&this._set("committed",e)}get dirty(){return this.inputValue!=null}get locked(){return this.lockable&&this.committed!=null}onInput(e){this.inputValue=e}onCommit(e,t,i){this.lockable?this._onCommitLockable(e,i):this._onCommitNonLockable(i),this.invalid&&e==="commit-and-exit"||i.onCommit(t,e)}_onCommitLockable(e,t){const{inputValue:i,locked:n}=this;n&&Bi(i)?this.unlock():(e==="commit-and-exit"&&!n||i!=null)&&this._parseInputAndLock(t)}_onCommitNonLockable(e){const{inputValue:t}=this;Bi(t)?this.setActual(null):t!=null&&this._parseInputAndSetActual(e)}applyValue(e){this.lockable?this.lock(e):this.setActual(e)}clearInputValue(){this.inputValue=null,this.invalid=!1}setActual(e){this.actual=e,this.clearInputValue()}lock(e){this.lockable&&(this.committed=e??this.actual,this.clearInputValue())}unlock(){this.lockable&&(this.committed=null,this.clearInputValue())}toggleLock(e){this.lockable&&(this.locked?this.unlock():this._parseInputAndLock(e))}getSuffix(e){const{suffix:t}=this;return typeof t=="function"?t(e):t}getFormattedValue(e){const{actual:t,committed:i,format:n}=this;return i!=null?n(i,e):t!=null?n(t,e):null}getRawDisplayValue(e){const{actual:t,committed:i,inputValue:n}=this;return n??(this.lockable&&i!=null?this.formatForInputMode(i,e):t!=null?this.formatForInputMode(t,e):null)}_parseInputAndSetActual(e){const{inputValue:t}=this;if(t==null||Bi(t))return this.setActual(null);const i=this.parse(t,e);i!=null?this.setActual(i):this.invalid=!0}_parseInputAndLock(e){const{inputValue:t,actual:i}=this;if(Bi(t))return this.unlock();if(t==null)return this.lock(i);const n=this.parse(t,e);n!=null?this.lock(n):this.invalid=!0}};function Bi(e){return e!=null&&e.trim()===""}a([c()],M.prototype,"actual",void 0),a([c()],M.prototype,"committed",null),a([c()],M.prototype,"dirty",null),a([c()],M.prototype,"format",void 0),a([c()],M.prototype,"formatForInputMode",void 0),a([c()],M.prototype,"lockable",void 0),a([c()],M.prototype,"locked",null),a([c()],M.prototype,"id",void 0),a([c()],M.prototype,"inputValue",void 0),a([c()],M.prototype,"name",void 0),a([c()],M.prototype,"parse",void 0),a([c()],M.prototype,"readOnly",void 0),a([c()],M.prototype,"suffix",void 0),a([c()],M.prototype,"title",void 0),a([c()],M.prototype,"visible",void 0),a([c()],M.prototype,"invalid",void 0),a([c()],M.prototype,"unlockOnVertexPlacement",void 0),M=a([x("esri.views.interactive.tooltip.fields.TooltipField")],M);let tn=class extends M{constructor(e){super(e),this.showAsZ=!1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.verticalLength.unit;return{name:"elevation",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.verticalLength(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.verticalLength.abbreviation,title:i=>i.messages.sketch[this.showAsZ?"z":"elevation"],unlockOnVertexPlacement:!1,...e}}};a([c()],tn.prototype,"showAsZ",void 0),tn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldElevation")],tn);let en=class extends M{constructor(e){super(e),this.precision=1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.angle.unit;return{name:"orientation",actual:null,parse:xe({createQuantity:(i,n)=>Dt(i,t(n),"geographic"),sanitize:Za}),format:i=>{const n=gs(i);return Mn(n,"geographic",this.precision)},formatForInputMode:(i,n)=>{const s=gs(i);return n.formatters.scalar(s)},suffix:i=>i.inputUnitInfos.angle.abbreviation,title:i=>i.messages.sketch.orientation,...e}}};a([c()],en.prototype,"precision",void 0),en=a([x("esri.views.interactive.tooltip.fields.TooltipFieldOrientation")],en);let Kn=class extends M{constructor(e){super(e),this.precision=null}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.length.unit;return{name:"size",actual:null,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.size,...e}}};a([c()],Kn.prototype,"precision",void 0),Kn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldSize")],Kn);function Xa(e){const t=n=>n.inputUnitInfos.angle.unit,i=n=>n.sketchOptions.values.effectiveDirectionMode;return new M({name:"direction",actual:qs,parse:xe({createQuantity:(n,s)=>Dt(n,t(s),"geographic"),sanitize:Za}),format:(n,s)=>{const o=i(s),r=un(n,o);switch(o){case A.Absolute:return s.formatters.direction(r);case A.Relative:return s.formatters.directionRelative(r);case A.RelativeBilateral:return s.formatters.directionRelativeBilateral(r)}},formatForInputMode:(n,s)=>{const o=un(n,i(s));return s.formatters.scalar(te(o,t(s)))},suffix:n=>n.inputUnitInfos.angle.abbreviation,title:n=>{const s=i(n),{absolute:o,relative:r}=n.messages.sketch.direction;switch(s){case A.Absolute:return o;case A.Relative:case A.RelativeBilateral:return r}},...e})}function qa(e){const t=i=>i.inputUnitInfos.length.unit;return new M({name:"distance",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(Math.max(i,0),t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.distance,...e})}function Ld(e){return qa({format:(t,i)=>i.formatters.totalLength(t),title:t=>t.messages.sketch.totalLength,readOnly:!0,...e})}function ja(e){return qa({...e})}function Gd(e){return new tn(e)}function Dd(e){return new en(e)}function zd(e){return mo("scale",{name:"scale",actual:null,parse:xe({createQuantity:t=>Qt(Math.abs(t))}),...e})}function $d(e){const t=i=>i.inputUnitInfos.area.unit;return new M({name:"area",actual:We,parse:xe({createQuantity:(i,n)=>vn(i,t(n))}),format:(i,n)=>n.formatters.area(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.area.abbreviation,title:i=>i.messages.sketch.area,readOnly:!0,...e})}function Ud(e){return new M({name:"x",actual:qs,parse:fd,format:(t,i)=>i.formatters.longitudeDecimalDegrees(t),formatForInputMode:t=>rd(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.longitude,...e})}function Hd(e){return new M({name:"y",actual:qs,parse:gd,format:(t,i)=>i.formatters.latitudeDecimalDegrees(t),formatForInputMode:t=>ad(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.latitude,...e})}function Nd(e){return mo("x",{name:"x",...e})}function Fd(e){return mo("y",{name:"y",...e})}function mo(e,t){return new M({actual:Qt(0),parse:xe({createQuantity:i=>Qt(i)}),format:(i,n)=>n.formatters.scalar(i),formatForInputMode:(i,n)=>n.formatters.scalar(i),title:i=>i.messages.sketch[e],...t})}function Zd(e){return Br(e)||Zs(e)}function yo(e,t,i,...n){return Br(e)?t.apply(void 0,n):Zs(e)?i.apply(void 0,n):null}const Cn=e=>{let t=class extends e{constructor(){super(...arguments),this.longitude=Ud(),this.latitude=Hd(),this.x=Nd(),this.y=Fd(),this.elevation=Gd(),this.geographic=!1}get effectiveX(){return this.geographic?this.longitude:this.x}get effectiveY(){return this.geographic?this.latitude:this.y}get key(){return{longitude:this.longitude.actual,latitude:this.latitude.actual,x:this.x.actual,y:this.y.actual,elevation:this.elevation.actual,geographic:this.geographic}}setLocationFromPoint(i,n=i?.spatialReference){if(this.geographic=!!n&&Zd(n),i==null)return this._setActualLonLat(null,null),void this._setActualXY(null,null);if(this.geographic){const s=ac(i,Bd);this._setActualLonLat(Ke(s?.[0]),Ke(s?.[1]))}else this._setActualXY(Qt(i.x),Qt(i.y))}_setActualLonLat(i,n){this.longitude.actual=i,this.latitude.actual=n}_setActualXY(i,n){this.x.actual=i,this.y.actual=n}};return a([c()],t.prototype,"geographic",void 0),a([c()],t.prototype,"effectiveX",null),a([c()],t.prototype,"effectiveY",null),a([c()],t.prototype,"key",null),t=a([x("esri.views.interactive.tooltip.infos.TooltipInfoWithCoordinates")],t),t},Bd=[0,0];let hi=class extends Cn(ot){constructor(e){super(e),this.type="draw-mesh",this.orientation=Dd({lockable:!1}),this.scale=zd({lockable:!1})}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation,this.orientation,this.scale]}};a([c()],hi.prototype,"helpMessage",void 0),a([c()],hi.prototype,"allFields",null),hi=a([x("esri.views.interactive.tooltip.infos.DrawMeshTooltipInfo")],hi);let ui=class extends Cn(ot){constructor(e){super(e),this.type="draw-point"}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation]}};a([c()],ui.prototype,"helpMessage",void 0),a([c()],ui.prototype,"allFields",null),ui=a([x("esri.views.interactive.tooltip.infos.DrawPointTooltipInfo")],ui);let Oe=class extends Cn(ot){constructor(e){super(e),this.type="draw-polygon",this.direction=Xa(),this.distance=ja(),this.area=$d(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.area]}};a([c()],Oe.prototype,"xyMode",void 0),a([c()],Oe.prototype,"helpMessage",void 0),a([c()],Oe.prototype,"allFields",null),Oe=a([x("esri.views.interactive.tooltip.infos.DrawPolygonTooltipInfo")],Oe);let Ie=class extends Cn(ot){constructor(e){super(e),this.type="draw-polyline",this.direction=Xa(),this.distance=ja(),this.totalLength=Ld(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.totalLength]}};a([c()],Ie.prototype,"helpMessage",void 0),a([c()],Ie.prototype,"xyMode",void 0),a([c()],Ie.prototype,"allFields",null),Ie=a([x("esri.views.interactive.tooltip.infos.DrawPolylineTooltipInfo")],Ie);let re=class extends ot{constructor(e){super(e),this.type="draw-rectangle",this.xSize=Kt,this.ySize=Kt,this.area=We}get allFields(){return[]}};a([c()],re.prototype,"type",void 0),a([c()],re.prototype,"xSize",void 0),a([c()],re.prototype,"ySize",void 0),a([c()],re.prototype,"area",void 0),a([c()],re.prototype,"allFields",null),re=a([x("esri.views.interactive.tooltip.infos.DrawRectangleTooltipInfo")],re);function _o(e){return fc(e)?gc(e)||Zs(e)||mc(e)||yc(e)?Dh:e:zh(e)}function Yd(e,t=vo()){return Wd(e,t,!1)}function Wd(e,t,i=e.hasZ){const n=_o(e.spatialReference),s=_c(n);if(s==null)return null;const o=(l,h)=>!(h.length<2)&&(N(l,h[0],h[1],i&&h[2]||0),!0);let r=0;for(const l of e.rings){const h=l.length;if(h<3)continue;const{positionsWorldCoords:u}=t;for(;u.length{const h=Vn(e).mode,u=s[l].elevation;h==="relative-to-ground"||h==="relative-to-scene"||h==="on-the-ground"?u.lock(bo(e)):u.unlock()},r=l=>{if(t){const h=s[l].direction;h.committed=t.angle,h.unlockOnVertexPlacement=!1,n.values.directionMode=t.mode}};switch(i){case"polygon":case"polyline":o(i),r(i);break;case"point":case"mesh":o(i)}}function vf(e,t){const{drawOperation:i,view:n}=t,s=xo(t),o=Vn(t);if(n.type==="2d"||!e||o.mode!=="absolute-height"||i?.numCommittedVertices!==1||!s||s.type!=="draw-polyline"&&s.type!=="draw-polygon"||s.elevation.locked)return;const[r,l,h]=e,u=Vf(r,l,h,o,t);u!=null&&s.elevation.lock(u)}function hr(e){xo(e)?.allFields.forEach(t=>{t.unlockOnVertexPlacement&&t.unlock()})}function xo({geometryType:e,graphic:t,tooltipInfos:i}){return e==="multipoint"||t?.geometry?.type!==xf[e]?null:i[e]}const xf={point:"point",mesh:"mesh",polyline:"polyline",polygon:"polygon",circle:"polygon",rectangle:"polygon"};function bf(e,t){switch(e?.type){case"draw-point":wf(e,t);break;case"draw-polyline":Ef(e,t);break;case"draw-polygon":Sf(e,t);break;case"draw-rectangle":Mf(e,t);break;case"draw-circle":kf(e,t);break;case"draw-mesh":Tf(e,t)}}function wf(e,t){const i=t.graphic?.geometry;i?.type==="point"&&(el(e,i,t),e.helpMessage=io("point",i))}function Tf(e,t){const{graphic:i,view:n}=t,s=i?.geometry;n.type!=="3d"||s&&s.type!=="mesh"||(el(e,s?.origin,t),s&&Md(e,s),e.helpMessage=bu(i,n))}function el(e,t,i){const{drawOperation:n,view:s,sketchOptions:o}=i,{cursorVertex:r}=n;if(e.sketchOptions=o,e.viewType=s.type,e.setLocationFromPoint(t,ti(i)),nl(e.elevation,i),!r)return void(n.constraints=void 0);const l=r;n.constraints={context:al(l,i),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:null,direction:null}}function Ef(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polyline"||(il(e,t),e.totalLength.actual=n.lastVertex?(s?yf(s):null)??Kt:null,e.helpMessage=io("polyline",s))}function Sf(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polygon"||(il(e,t),e.area.actual=n.lastVertex?(s?Ka(s):null)??We:null,e.helpMessage=io("polygon",s))}function il(e,t){const{drawOperation:i,sketchOptions:n,view:s}=t,{cursorVertex:o,lastVertex:r,secondToLastVertex:l}=i,h=n.values.effectiveDirectionMode;e.sketchOptions=n,e.viewType=s.type;const u=r&&o?Rn(r,o)??Kt:null;if(e.distance.actual=u,e.distance.readOnly=r==null,e.direction.actual=null,e.direction.readOnly=!0,r&&o&&(h==="absolute"||l)){const m=cp(l,r,o,h);e.direction.actual=m??th,e.direction.readOnly=!1}e.setLocationFromPoint(o,ti(t)),nl(e.elevation,t);const p=Pf(r,t);e.xyMode=p,e.direction.visible=p==="direction-distance",e.distance.visible=p==="direction-distance",e.effectiveX.visible=p==="coordinates",e.effectiveY.visible=p==="coordinates";const d=o??r;i.constraints=d?{context:al(d,t),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:e.distance.committed,direction:e.direction.committed}:void 0}function Pf(e,{sketchOptions:t}){const i=t.tooltips.xyMode;return i==="auto"?e?"direction-distance":"coordinates":i}function Mf(e,t){e.sketchOptions=t.sketchOptions,e.xSize=ol(t),e.ySize=rl(t),e.area=sl(t)}function kf(e,t){const{forceUniformSize:i,sketchOptions:n}=t;e.sketchOptions=n,e.radius=i?Cf(t):null,e.xSize=i?null:ol(t),e.ySize=i?null:rl(t),e.area=sl(t)}function nl(e,t){const{drawOperation:i}=t,n=i?.cursorVertex??i?.lastVertex;e.actual=rf(n)??bo(t),e.visible=i.hasZ,e.readOnly=!1,e.showAsZ=!0}function sl(e){const t=e.createOperationGeometry?.full;return t?.type!=="polygon"?We:Ka(t)??We}function ol(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.left,t.right):null)??Kt}function rl(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.top,t.bottom):null)??Kt}function Cf({createOperationGeometry:e}){return(e?.circle?.center!=null&&e.circle.edge!=null?Rn(e.circle.center,e.circle.edge):null)??Kt}function Rf(e){const{geometryType:t,tooltipInfos:i}=e;switch(t){case"point":case"mesh":case"polyline":case"polygon":{const n=i[t].elevation.committed;return n?_n(n,"meters")/Fs(ti(e)):void 0}default:return}}function Vf(e,t,i,n,s){const{view:o,drawOperation:r}=s;if(o.type!=="3d"||!r)return;i??=0;const l=ti(s),h=Vn(s),u=Nr(o,e,t,i,l,h,n);return Qa(u,l)??bo(s)}function Vn(e){return e.drawOperation.elevationInfo??gn}function ti(e){return e.drawOperation.coordinateHelper.spatialReference}function bo(e){const t=Fs(ti(e));return ft(e.defaultZ*t,"meters")}function al(e,t){return gp(e,t.view,ti(t),Vn(t),t.drawOperation.coordinateHelper.hasZ(),t.sketchOptions.values.effectiveDirectionMode)}var Se;(function(e){e[e.WhenToolEditable=0]="WhenToolEditable",e[e.WhenToolNotEditable=1]="WhenToolNotEditable",e[e.Always=2]="Always"})(Se||(Se={}));let Af=class{constructor(){this._isToolEditable=!0,this._manipulators=new ss,this._resourceContexts={manipulator3D:{}},this._attached=!1}set isToolEditable(e){this._isToolEditable=e}get length(){return this._manipulators.length}add(e,t=Se.WhenToolEditable){this.addMany([e],t)}addMany(e,t=Se.WhenToolEditable){for(const i of e){const n={manipulator:i,visibilityPredicate:t,attached:!1};this._manipulators.add(n),this._attached&&this._updateManipulatorAttachment(n)}}remove(e){for(let t=0;t{this._detachManipulator(e)}),this._manipulators.removeAll()}attach(){this._manipulators.forEach(e=>{this._updateManipulatorAttachment(e)}),this._attached=!0}detach(){this._manipulators.forEach(e=>{this._detachManipulator(e)}),this._attached=!1}destroy(){this.detach(),this._manipulators.forEach(({manipulator:e})=>e.destroy()),this._manipulators.destroy(),this._resourceContexts=null}on(e,t){return this._manipulators.on(e,i=>{t(i)})}forEach(e){for(const t of this._manipulators.items)e(t)}some(e){return this._manipulators.items.some(e)}toArray(){const e=[];return this.forEach(t=>e.push(t.manipulator)),e}intersect(e,t){let i=null,n=Number.MAX_VALUE;return this._manipulators.forEach(({manipulator:s,attached:o})=>{if(!o||!s.interactive)return;const r=s.intersectionDistance(e,t);r!=null&&r{i.dragging&&(t=!0,i.events.emit("drag",{action:"end",start:e,screenPoint:e}))}),t&&(this.view.toolViewManager.activeTool=null)}whenCreated(){return this._creationFinishedResolver.promise}onManipulatorSelectionChanged(){}onActivate(){}onDeactivate(){}onShow(){}onHide(){}onEditableChange(){}onInputEvent(e){}onInputEventAfter(e){}get internallyEditable(){return this.getEditableFlag(we.USER)&&this.getEditableFlag(we.MANAGER)}finishToolCreation(){this.created||this._creationFinishedResolver.resolve(this),this._set("created",!0)}_syncVisible(){if(this.initialized){if(this.visible)this._show();else if(this._hide(),this.active)return void(this.view.activeTool=null)}}_show(){this._updateManipulatorAttachment(),this.onShow()}_hide(){this._updateManipulatorAttachment(),this.onHide()}_updateManipulatorAttachment(){this.visible?this.manipulators.attach():this.manipulators.detach()}};a([c({constructOnly:!0})],B.prototype,"view",void 0),a([c({readOnly:!0})],B.prototype,"active",null),a([c({value:!0})],B.prototype,"visible",null),a([c({value:!0})],B.prototype,"editable",null),a([c({readOnly:!0})],B.prototype,"manipulators",void 0),a([c({readOnly:!0})],B.prototype,"updating",null),a([c()],B.prototype,"cursor",null),a([c({readOnly:!0})],B.prototype,"automaticManipulatorSelection",void 0),a([c()],B.prototype,"hasFocusedManipulators",null),a([c()],B.prototype,"hasGrabbedManipulators",void 0),a([c()],B.prototype,"hasHoveredManipulators",void 0),a([c()],B.prototype,"firstGrabbedManipulator",void 0),a([c({readOnly:!0})],B.prototype,"created",void 0),a([c({readOnly:!0})],B.prototype,"removeIncompleteOnCancel",void 0),B=a([x("esri.views.interactive.InteractiveToolBase")],B);let nn=class extends tt{constructor(e){super(e),this.enabled=!1}};a([c({type:Boolean,nonNullable:!0})],nn.prototype,"enabled",void 0),nn=a([x("esri.views.interactive.sketch.SketchLabelOptions")],nn);const An=nn;let mi=class extends tt{constructor(e){super(e),this.mode="absolute-height"}toJSON(){return{mode:this.mode}}};a([c({type:String,nonNullable:!0})],mi.prototype,"mode",void 0),mi=a([x("esri.views.interactive.sketch.SketchTooltipElevationOptions")],mi);let J=class extends tt{constructor(e){super(e),this.area=!0,this.coordinates=!0,this.direction=!0,this.distance=!0,this.elevation=!0,this.header=!0,this.helpMessage=!1,this.orientation=!0,this.radius=!0,this.rotation=!0,this.scale=!0,this.size=!0,this.totalLength=!0}};a([c({type:Boolean,nonNullable:!0})],J.prototype,"area",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"coordinates",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"direction",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"distance",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"elevation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"header",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"helpMessage",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"orientation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"radius",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"rotation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"scale",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"size",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"totalLength",void 0),J=a([x("esri.views.interactive.sketch.SketchTooltipVisibleElements")],J);const ll=J;let it=class extends tt{constructor(e){super(e),this.enabled=!1,this.forceEnabled=!1,this.helpMessage=null,this.helpMessageIcon=null,this.inputEnabled=!0,this.elevation=new mi,this.placement="auto",this.offset=null,this.visibleElements=new ll,this.visualVariables=null,this.xyMode="auto"}get effectiveEnabled(){return this.forceEnabled||this.enabled}};a([c({type:Boolean,nonNullable:!0})],it.prototype,"enabled",void 0),a([c()],it.prototype,"forceEnabled",void 0),a([c()],it.prototype,"effectiveEnabled",null),a([c()],it.prototype,"helpMessage",void 0),a([c()],it.prototype,"helpMessageIcon",void 0),a([c({type:Boolean,nonNullable:!0})],it.prototype,"inputEnabled",void 0),a([c({type:mi,nonNullable:!0})],it.prototype,"elevation",void 0),a([c()],it.prototype,"placement",void 0),a([c()],it.prototype,"offset",void 0),a([c({type:ll,nonNullable:!0})],it.prototype,"visibleElements",void 0),a([c()],it.prototype,"visualVariables",void 0),a([c()],it.prototype,"xyMode",void 0),it=a([x("esri.views.interactive.sketch.SketchTooltipOptions")],it);const cl=it;let Le=class extends tt{constructor(e){super(e),this.length=null,this.verticalLength=null,this.area=null}};a([c()],Le.prototype,"length",void 0),a([c()],Le.prototype,"verticalLength",void 0),a([c()],Le.prototype,"area",void 0),Le=a([x("esri.views.interactive.sketch.Units")],Le);const pn=Le;let ae=class extends tt{constructor(e){super(e),this.directionMode="relative",this.relativeDirectionIsBilateral=!1}get effectiveDirectionMode(){switch(this.directionMode){case"relative":return this.relativeDirectionIsBilateral?A.RelativeBilateral:A.Relative;case"absolute":return A.Absolute}}get displayUnits(){return this._get("displayUnits")??new pn}set displayUnits(e){this._set("displayUnits",e)}get inputUnits(){return this._get("inputUnits")??new pn}set inputUnits(e){this._set("inputUnits",e)}};a([c({type:String,nonNullable:!0})],ae.prototype,"directionMode",void 0),a([c({type:Boolean,nonNullable:!0})],ae.prototype,"relativeDirectionIsBilateral",void 0),a([c()],ae.prototype,"effectiveDirectionMode",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"displayUnits",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"inputUnits",null),ae=a([x("esri.views.interactive.sketch.SketchValueOptions")],ae);const hl=ae;let Ge=class extends tt{constructor(e){super(e),this.labels=new An,this.tooltips=new cl,this.values=new hl}};a([c({nonNullable:!0,type:An})],Ge.prototype,"labels",void 0),a([c({nonNullable:!0,type:cl})],Ge.prototype,"tooltips",void 0),a([c({nonNullable:!0,type:hl})],Ge.prototype,"values",void 0),Ge=a([x("esri.views.interactive.sketch.SketchOptions")],Ge);const ul=Ge;let P=class extends Ce.EventedMixin(B){constructor(e){super(e),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.sketchOptions=new ul}initialize(){const{view:e}=this;this.internalGraphicsLayer=new Xs({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer);const t=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=_f(e.type,this.sketchOptions);const i=Pd(()=>({view:e,options:this.sketchOptions.tooltips}));this.tooltip=i,cr(this._tooltipsContext),this._coordinateFormatterLoadTask=Ll(()=>ru()),this.addHandles([t.on("vertex-add",n=>this.onVertexAdd(n)),t.on("vertex-remove",n=>this.onVertexRemove(n)),t.on("vertex-update",n=>this.onVertexUpdate(n)),t.on("cursor-update",n=>this.onCursorUpdate(n)),t.on("cursor-remove",()=>this._updateGraphic()),t.on("complete",n=>this.onComplete(n)),this._coordinateFormatterLoadTask,i.on("paste",n=>Id(n,this.activeTooltipInfo)),U(()=>this.cursor,n=>{t.cursor=n},ke),Po(()=>{const{activeTooltipInfo:n,sketchOptions:s}=this;bf(n,this._tooltipsContext),i.info=s.tooltips.effectiveEnabled?n:null}),Po(()=>{t.constraintZ=Rf(this._tooltipsContext)},$s)]),this.finishToolCreation()}destroy(){this.drawOperation=dt(this.drawOperation),this.tooltip=dt(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=dt(this.internalGraphicsLayer),this._set("view",null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){return{createOperationGeometry:this._createOperationGeometry,defaultZ:this.defaultZ,directionOptions:this.directionOptions,drawOperation:this.drawOperation,forceUniformSize:this.forceUniformSize,geometryType:this.geometryType,graphic:this.graphic,sketchOptions:this.sketchOptions,tooltipInfos:this.tooltipInfos,view:this.view}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}get cursor(){return this._get("cursor")}set cursor(e){this._set("cursor",e)}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),this._graphic!=null&&(this._graphic.symbol=e)}set mode(e){const t=this.drawOperation;t&&(t.drawingMode=e),this._set("mode",e)}get updating(){return this.drawOperation?.updating??!1}get undoRedo(){const{view:{type:e,map:t}}=this;return e==="2d"&&t&&"undoRedo"in t&&t.undoRedo instanceof Ct?t.undoRedo:null}set undoRedo(e){this._override("undoRedo",e)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||Ad(e,this.tooltip)||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),this.drawOperation.numCommittedVertices===0&&cr(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(mt.outline),this.removeHandles(mt.regularVertices),this.removeHandles(mt.activeVertex),this.removeHandles(mt.activeEdge),this.removeHandles(Jn)}_createOrUpdateGraphic(e){if(this._graphic!=null)return this.updateGraphicGeometry(e),this._graphic;const t=new Lt({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=t,this.updateGraphicGeometry(e),this.internalGraphicsLayer.add(t),this.addHandles(this.initializeGraphic(t)),this.notifyChange("graphic"),this.addHandles(Y(()=>{this.internalGraphicsLayer.remove(t),this._graphic===t&&(this._graphic=null)}),Jn),t}updateGraphicGeometry(e){this._graphic.geometry=e}_getCreateOperationGeometry(e={operationComplete:!1}){if(this.drawOperation==null)return;const{coordinateHelper:t,view:i,visualizationCursorVertex:n,lastVertex:s,committedVertices:o,geometryIncludingUncommittedVertices:r,numCommittedVertices:l}=this.drawOperation;if(!(l>0||n!=null))return;const h=e.operationComplete?o:r,u=h.length,p=n!=null?t.pointToArray(n):null,d=this._drawSpatialReference,m=i.type==="3d"&&i.viewingMode==="global",f=new hu;f.committedVertices=o,f.cursorVertex=p;const{geometryType:_}=this;switch(_){case"point":case"mesh":f.full=t.arrayToPoint(h[0]);break;case"multipoint":f.full=u>0?gu(h,d):null;break;case"polyline":case"polygon":u>0&&(f.full=_==="polygon"?Oi([h],d,m,!0):Yo([h],d,m),f.cursorEdge=p!=null&&s&&!gi(n,s)?Yo([[p,t.pointToArray(s)]],d,m):null,f.outline=u>1?f.full:null);break;case"circle":case"rectangle":{if(f.committedVertices=f.cursorVertex=null,!u)break;const y=fu(i,h[0]),w=h[0],b=y.makeMapPoint(w[0]+If*i.resolution,w[1]);_==="circle"?u===1&&e.operationComplete?f.circle=Xo([w,b],y,!0):u===2&&(this.forceUniformSize?f.circle=Xo(h,y,this.centered):f.rectangle=yu(h,y,this.centered)):u===1&&e.operationComplete?f.rectangle=Wo([w,b],y,!0):u===2&&(f.rectangle=this.forceUniformSize?Wo(h,y,this.centered):mu(h,y,this.centered)),f.full=f.circle!=null?f.circle.geometry:f.rectangle?.geometry,f.outline=f.full?.type==="polygon"?f.full:null;break}default:return null}return f}initializeGraphic(e){return Y()}onComplete(e){if(!this.drawOperation)return;this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const i=this._getCreateOperationGeometry({operationComplete:!0});i!=null&&(t=this._createOrUpdateGraphic(i.full))}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){const{drawOperation:e}=this;e&&(e.isCompleted||e.cancel())}onOutlineChanged(e){return Y()}onCursorEdgeChanged(e){return Y()}onVertexAdd(e){hr(this._tooltipsContext),this._updateGraphic(),vf(e.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit("vertex-add",e)}onVertexRemove(e){hr(this._tooltipsContext),this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,e!=null?(e.cursorEdge!=null?this.addHandles(this.onCursorEdgeChanged(e.cursorEdge),mt.activeEdge):this.removeHandles(mt.activeEdge),e.outline!=null?this.addHandles(this.onOutlineChanged(e.outline),mt.outline):this.removeHandles(mt.outline),e.committedVertices!=null?this.addHandles(this.onRegularVerticesChanged(e.committedVertices),mt.regularVertices):this.removeHandles(mt.regularVertices),e.cursorVertex!=null?this.addHandles(this.onActiveVertexChanged(e.cursorVertex),mt.activeVertex):this.removeHandles(mt.activeVertex),e.full!=null?this._createOrUpdateGraphic(e.full):this.removeHandles(Jn)):this._destroyAllVisualizations()}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?xo(this._tooltipsContext):null}};a([c()],P.prototype,"_coordinateFormatterLoadTask",void 0),a([c()],P.prototype,"_createOperationGeometry",void 0),a([c()],P.prototype,"_tooltipsContext",null),a([c({value:!0})],P.prototype,"centered",null),a([c()],P.prototype,"cursor",null),a([c({nonNullable:!0})],P.prototype,"defaultZ",void 0),a([c({constructOnly:!0})],P.prototype,"directionOptions",void 0),a([c()],P.prototype,"drawOperation",void 0),a([c({value:!0})],P.prototype,"enabled",null),a([c({value:!0})],P.prototype,"forceUniformSize",null),a([c({constructOnly:!0})],P.prototype,"geometryType",void 0),a([c()],P.prototype,"graphic",null),a([c({constructOnly:!0})],P.prototype,"graphicProperties",void 0),a([c()],P.prototype,"graphicSymbol",null),a([c({constructOnly:!0})],P.prototype,"hasZ",void 0),a([c({constructOnly:!0})],P.prototype,"geometryToPlace",void 0),a([c()],P.prototype,"mode",null),a([c()],P.prototype,"snappingManager",void 0),a([c()],P.prototype,"snapToScene",void 0),a([c()],P.prototype,"tooltip",void 0),a([c()],P.prototype,"tooltipInfos",void 0),a([c({constructOnly:!0,type:ul})],P.prototype,"sketchOptions",void 0),a([c()],P.prototype,"updating",null),a([c({constructOnly:!0,nonNullable:!0})],P.prototype,"view",void 0),a([c({constructOnly:!0})],P.prototype,"undoRedo",null),a([c()],P.prototype,"activeTooltipInfo",null),P=a([x("esri.views.draw.DrawGraphicTool")],P);const Jn=Symbol("create-operation-graphic"),mt={outline:Symbol("outline-visual"),regularVertices:Symbol("regular-vertices-visual"),activeVertex:Symbol("active-vertex-visual"),activeEdge:Symbol("active-edge-visual")};function Of(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const If=48,pl="click";let Lf=class{constructor({consumesClicks:e,grabbableForEvent:t}){this.events=new Ce,this.interactive=!0,this.selectable=!1,this.cursor=null,this.grabbable=!0,this.consumesClicks=e,this.grabbableForEvent=t}destroy(){}intersectionDistance(e,t){return 0}attach(){}detach(){}onElevationChange(){}onViewChange(){}};var D;(function(e){e[e.Z=0]="Z",e[e.M=1]="M"})(D||(D={}));let Gf=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(G())}pointToVector(e){return this._tag(de(e.x,e.y))}arrayToVector(e){return this._tag(de(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return Ur(n,e,t,i)}addDelta(e,t,i){e[0]+=t,e[1]+=i}distance(e,t){return Hr(e,t)}getZ(e,t=void 0){return t}hasZ(){return!1}getM(e,t=void 0){return t}hasM(){return!1}clone(e){return this._tag(Cc(e))}copy(e,t){return wc(t,e)}fromXYZ(e){return this._tag(de(e[0],e[1]))}toXYZ(e,t=g()){return N(t,e[0],e[1],0)}pointToXYZ(e,t=g()){return N(t,e.x,e.y,0)}equals(e,t){return Tc(e,t)}_tag(e){return e}};class ur{constructor(t,i){this._valueType=t,this.spatialReference=i}createVector(){return this._tag(g())}pointToVector(t){return this._tag(pe(t.x,t.y,this._valueType===D.Z?t.z:t.m))}arrayToVector(t){return this._tag(pe(t[0],t[1],t[2]||0))}vectorToArray(t){return[t[0],t[1],t[2]]}pointToArray(t){return this._valueType===D.Z?[t.x,t.y,t.z]:[t.x,t.y,t.m]}vectorToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}arrayToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}vectorToDehydratedPoint(t,i){if(!t)return;i??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const n=this._valueType===D.Z,s=this._valueType===D.M;return i.x=t[0],i.y=t[1],i.z=n?t[2]:void 0,i.m=s?t[2]:void 0,i.hasZ=n,i.hasM=s,i.spatialReference=this.spatialReference,i}lerp(t,i,n,s){return Pe(s,t,i,n)}addDelta(t,i,n,s){t[0]+=i,t[1]+=n,this._valueType===D.Z&&(t[2]+=s)}distance(t,i){return this._valueType===D.Z?ge(t,i):Hr(t,i)}getZ(t,i=void 0){return this._valueType===D.Z?t[2]:i}hasZ(){return this._valueType===D.Z}getM(t,i=void 0){return this._valueType===D.M?t[2]:i}hasM(){return this._valueType===D.M}clone(t){return this._tag(lc(t))}copy(t,i){return rt(i,t)}fromXYZ(t,i=0,n=0){return this._tag(pe(t[0],t[1],this._valueType===D.Z?t.length>2?t[2]:i:n))}toXYZ(t,i=g()){return N(i,t[0],t[1],this._valueType===D.Z?t[2]:0)}pointToXYZ(t,i=g()){return N(i,t.x,t.y,this._valueType===D.Z?t.z??0:0)}equals(t,i){return Ye(t,i)}_tag(t){return t}}let Df=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(jr())}pointToVector(e){return this._tag(Hn(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Hn(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return yh(n,e,t,i)}addDelta(e,t,i,n){e[0]+=t,e[1]+=i,e[2]+=n}distance(e,t){return ge(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(xh(e))}copy(e,t){return _h(t,e)}fromXYZ(e,t=0,i=0){return this._tag(Hn(e[0],e[1],e.length>2?e[2]:t,i))}toXYZ(e,t=g()){return N(t,e[0],e[1],e[2])}pointToXYZ(e,t=g()){return N(t,e.x,e.y,e.z??0)}equals(e,t){return vh(e,t)}_tag(e){return e}};function dl(e,t,i){return e&&t?new Df(i):t?new ur(D.M,i):e?new ur(D.Z,i):new Gf(i)}function zf(e,t){if(!t.supported)return;let i=1/0,n=-1/0;const s=t.upperBoundX-t.lowerBoundX;e.forEach(r=>{let l=r.pos[0];for(;lt.upperBoundX;)l-=s;i=Math.min(i,l),n=Math.max(n,l),r.pos[0]=l});const o=n-i;s-o{r.pos[0]<0&&(r.pos[0]+=s)})}function $f(e,t){const i=$r(e);return t===Ti.Global&&i?{supported:!0,lowerBoundX:i.valid[0],upperBoundX:i.valid[1]}:{supported:!1,lowerBoundX:null,upperBoundX:null}}let Gi=class{constructor(e){this.component=e,this.leftEdge=null,this.rightEdge=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(e){this._pos=e,this.component.unnormalizeVertexPositions()}};class Jt{constructor(t,i,n){this.component=t,this.leftVertex=i,this.rightVertex=n,this.type="edge",i.rightEdge=this,n.leftEdge=this}}class On{constructor(t,i){this._spatialReference=t,this._viewingMode=i,this.vertices=[],this.edges=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||zf(this.vertices,$f(this._spatialReference,this._viewingMode))}updateVertexIndex(t,i){if(this.vertices.length===0)return;const n=this.vertices[0];let s=null,o=t,r=i;do s=o,s.index=r++,o=s.rightEdge?s.rightEdge.rightVertex:null;while(o!=null&&o!==n);s.leftEdge&&s!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(s),this.vertices.length-1)}getFirstVertex(){return this.vertices.at(0)}getLastVertex(){return this.vertices.at(-1)}isClosed(){return this.vertices.length>2&&this.vertices[0].leftEdge!==null}swapVertices(t,i){const n=this.vertices[t];this.vertices[t]=this.vertices[i],this.vertices[i]=n}iterateVertices(t){if(this.vertices.length===0)return;const i=this.vertices[0];let n=i;do t(n,n.index),n=n.rightEdge!=null?n.rightEdge.rightVertex:null;while(n!==i&&n!=null)}}let dn=class fl extends Ce{constructor(t,i){super(),this.type=t,this.coordinateHelper=i,this._geometry=null,this._dirty=!0,this.components=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon();break;case"mesh":break;default:Hh(this.type)}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}get allVertices(){return Array.from(this.iterateVertices())}*iterateVertices(){for(const t of this.components)for(const i of t.vertices)yield i}notifyChanges(t){this._dirty=!0,this.emit("change",t)}_toPoint(){return this.components.length===0||this.components[0].vertices.length===0?null:this.coordinateHelper.vectorToPoint(this.components[0].vertices[0].pos)}_toPolyline(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[];let o=n.vertices.find(l=>l.leftEdge==null);const r=o;do s.push(i(o.pos)),o=o.rightEdge?o.rightEdge.rightVertex:null;while(o&&o!==r);t.push(s)}return new fi({paths:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[],o=n.vertices[0];let r=o;const l=r;do s.push(i(r.pos)),r=r.rightEdge!=null?r.rightEdge.rightVertex:null;while(r&&r!==l);n.isClosed()&&s.push(i(o.pos)),t.push(s)}return new De({rings:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,i){const n=t.spatialReference,s=dl(t.hasZ,t.hasM,n),o=new fl(t.type,s);switch(t.type){case"polygon":Uf(o,t,i);break;case"polyline":Hf(o,t,i);break;case"point":pr(o,t,i);break;case"mesh":pr(o,t.origin,i),o._geometry=t,o._dirty=!1}return o}};function Uf(e,t,i){const n=t.spatialReference,s=e.coordinateHelper,o=t.rings;for(let r=0;r2&&Fe(l[0],l[l.length-1]),p=u?l.length-1:l.length;for(let m=0;mthis.operation.apply(t)),this._editGeometry.components.forEach(t=>t.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:this._undone?"redo":"apply",updatedVertices:this._vertices})}undo(){this._vertices.forEach(t=>this.operation.undo(t)),this._editGeometry.notifyChanges({operation:"undo",updatedVertices:this._vertices}),this._undone=!0}canAccumulate(t){if(this._undone||t._vertices.length!==this._vertices.length)return!1;for(let i=0;ithis.operation.accumulate(i,t.operation)),this.operation.accumulateParams(t.operation),this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:"apply",updatedVertices:this._vertices}),!0)}};var nt;(function(e){e[e.CUMULATIVE=0]="CUMULATIVE",e[e.REPLACE=1]="REPLACE"})(nt||(nt={}));let Ff=class{constructor(e,t,i=0){this._editGeometry=e,this._vertices=t,this._minNumberOfVertices=i,this.removedVertices=null}apply(){let e="redo";if(this.removedVertices==null){const t=this.removedVertices=[];this._vertices.forEach(i=>{const n=this._removeVertex(i);n!=null&&t.push(n)}),e="apply"}else this.removedVertices.forEach(t=>{this._removeVertex(t.removedVertex)});this._editGeometry.notifyChanges({operation:e,removedVertices:this._vertices})}undo(){this.removedVertices?.forEach(e=>{this._undoRemoveVertex(e)}),this._editGeometry.notifyChanges({operation:"undo",addedVertices:this._vertices})}accumulate(){return!1}_removeVertex(e){const t=e.component;if(t.vertices.length<=this._minNumberOfVertices)return null;const i={removedVertex:e,createdEdge:null},n=e.leftEdge,s=e.rightEdge;return t.vertices.splice(t.vertices.indexOf(e),1),n&&(t.edges.splice(t.edges.indexOf(n),1),n.leftVertex.rightEdge=null),s&&(t.edges.splice(t.edges.indexOf(s),1),s.rightVertex.leftEdge=null),e.index===0&&s&&this._vertices.length>0&&t.swapVertices(t.vertices.indexOf(s.rightVertex),0),n&&s&&(i.createdEdge=new Jt(t,n.leftVertex,s.rightVertex),t.edges.push(i.createdEdge)),s&&t.updateVertexIndex(s.rightVertex,s.rightVertex.index-1),i}_undoRemoveVertex(e){const t=e.removedVertex,i=e.removedVertex.component,n=t.leftEdge,s=t.rightEdge;e.createdEdge&&i.edges.splice(i.edges.indexOf(e.createdEdge),1),i.vertices.push(t),n&&(i.edges.push(n),n.leftVertex.rightEdge=n),s&&(i.edges.push(s),s.rightVertex.leftEdge=s),i.updateVertexIndex(t,t.index)}},Zf=class{constructor(e,t,i){this._editGeometry=e,this._edge=t,this._t=i,this.createdVertex=null,this._left=null,this._right=null}apply(){let e="redo";const t=this._edge,i=t.component,n=t.leftVertex,s=t.rightVertex;i.edges.splice(i.edges.indexOf(t),1),this.createdVertex==null&&(e="apply",this.createdVertex=new Gi(t.component)),i.vertices.push(this.createdVertex),this.createdVertex.pos=this._editGeometry.coordinateHelper.lerp(t.leftVertex.pos,t.rightVertex.pos,this._t,this._editGeometry.coordinateHelper.createVector()),this._left==null&&(this._left=new Jt(i,n,this.createdVertex)),this._left.leftVertex.leftEdge?i.edges.push(this._left):i.edges.unshift(this._left),n.rightEdge=this._left,this._right==null&&(this._right=new Jt(i,this.createdVertex,s)),i.edges.push(this._right),s.leftEdge=this._right,i.updateVertexIndex(this.createdVertex,n.index+1),this._editGeometry.notifyChanges({operation:e,addedVertices:[this.createdVertex]})}undo(){if(this.createdVertex==null||this._left==null||this._right==null)return null;const e=this._edge,t=e.component,i=this.createdVertex.leftEdge,n=this.createdVertex.rightEdge,s=i?.leftVertex,o=n?.rightVertex;t.vertices.splice(t.vertices.indexOf(this.createdVertex),1),t.edges.splice(t.edges.indexOf(this._left),1),t.edges.splice(t.edges.indexOf(this._right),1),this._edge.leftVertex.leftEdge?t.edges.push(this._edge):t.edges.unshift(this._edge),s&&(s.rightEdge=e),o&&(o.leftEdge=e),s&&t.updateVertexIndex(s,s.index),this._editGeometry.notifyChanges({operation:"undo",removedVertices:[this.createdVertex]})}accumulate(){return!1}},Bf=class yl{constructor(t,i,n){this._editGeometry=t,this._vertex=i,this._pos=n}apply(){const t=this._originalPosition==null;t&&(this._originalPosition=this._vertex.pos),this._apply(t?"apply":"redo")}undo(){this._vertex.pos=this._originalPosition,this._editGeometry.notifyChanges({operation:"undo",updatedVertices:[this._vertex]})}accumulate(t){return t instanceof yl&&t._vertex===this._vertex&&(this._pos=t._pos,this._apply("apply"),!0)}_apply(t){this._vertex.pos=this._pos,this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:[this._vertex]})}},Yf=class{constructor(e,t){this._editGeometry=e,this._component=t,this._createdEdge=null}apply(){let e="redo";if(this._createdEdge==null){e="apply";const t=this._component.getFirstVertex(),i=this._component.getLastVertex();if(this._component.isClosed()||this._component.vertices.length<3||t==null||i==null)return;this._createdEdge=new Jt(this._component,i,t)}this._createdEdge.leftVertex.rightEdge=this._createdEdge,this._createdEdge.rightVertex.leftEdge=this._createdEdge,this._component.edges.push(this._createdEdge),this._editGeometry.notifyChanges({operation:e})}undo(){this._createdEdge!=null&&(Dr(this._component.edges,this._createdEdge),this._createdEdge.leftVertex.rightEdge=null,this._createdEdge.rightVertex.leftEdge=null,this._editGeometry.notifyChanges({operation:"undo"}))}accumulate(){return!1}},dr=class _l{constructor(t,i,n,s){this._editGeometry=t,this.dx=i,this.dy=n,this.dz=s,this._firstTime=!0}apply(){const t=this._firstTime?"apply":"redo";this._firstTime=!1,this._apply(t,this.dx,this.dy,this.dz)}undo(){this._apply("undo",-this.dx,-this.dy,-this.dz)}accumulate(t){const i=this._editGeometry.geometry;return t instanceof _l&&t._editGeometry.geometry===i&&(this._apply("apply",t.dx,t.dy,t.dz),this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz,!0)}_apply(t,i,n,s){const o=this._editGeometry.geometry;o.offset(i,n,s);const r=this._editGeometry.components[0].getFirstVertex();if(!r)return;const l=this._editGeometry.coordinateHelper;r.pos=l.pointToVector(o.origin),this._editGeometry.notifyChanges({operation:t,updatedVertices:[r]})}},vl=class xl{constructor(t,i,n,s){this._helper=t,this.dx=i,this.dy=n,this.dz=s}_move(t,i,n,s){this._helper.addDelta(t.pos,i,n,s)}apply(t){this._move(t,this.dx,this.dy,this.dz)}undo(t){this._move(t,-this.dx,-this.dy,-this.dz)}canAccumulate(t){return t instanceof xl}accumulate(t,i){this._move(t,i.dx,i.dy,i.dz)}accumulateParams(t){this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz}},Wf=class Ls{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,n,s=0,o=yi.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=n,this.distance=s,this._plane=at(),this._offsetPlane=at(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,o===yi.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),n=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=Do(g(),t,n),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(n,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(n,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return t!=null?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,n,s){const o=g();if(i){Do(o,t,i);const r=!this._passesBisectingAngleThreshold(o,n);return{start:t,end:i,direction:r?this._bisectVectorsPerpendicular(n,o):o,isOriginalDirection:!r}}return this._helper.hasZ()?s&&(Ot(o,n,s.direction),Ot(o,o,n),le(o,o),Math.sign(o[1])!==Math.sign(n[0])&&fe(o,o,-1)):N(o,-n[1],n[0],0),{start:t,end:i,direction:o,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const n=Math.abs(wh(i,t));return n>=fr&&n<=Math.PI-fr}_bisectVectorsPerpendicular(t,i){const n=Z(t,i)<0?t:rs(g(),t),s=Math.abs(Z(n,i));if(!(s1-gr))return this._bisectDirection(n,i);const o=Ot(g(),n,[0,0,1]);return le(o,o)}_bisectDirection(t,i){const n=ut(g(),t,i);return le(n,n)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);Z(t,i)<0&&rs(i,i),Ri(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=Ot(g(),t.direction,this._edgeDirection);le(i,i);const n=Ot(g(),this._edgeDirection,i);return this._planeType===Gs.XY&&(n[2]=0),le(n,n)}_initializeDistanceConstraints(){this._left.end==null||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(Ae(this._plane,this._left.end)),this._right.end==null||this.requiresSplitEdgeRight||this._updateDistanceConstraint(Ae(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=$e(t),n=this._edgeDirection,s=ut(g(),this._left.start,this._left.direction),o=ut(g(),this._right.start,this._right.direction),r=this._pointInBasis2D(G(),i,n,this._left.start),l=this._pointInBasis2D(G(),i,n,s),h=this._pointInBasis2D(G(),i,n,this._right.start),u=this._pointInBasis2D(G(),i,n,o),[p]=Su({start:l,end:r,type:O.LINE},{start:u,end:h,type:O.LINE});if(!p)return;const d=q(G(),r,l);Ys(d,d);const m=q(G(),p,l),f=_e(d,m),_=ut(g(),s,fe(g(),this._left.direction,-f)),y=Ae(t,_);this._updateDistanceConstraint(y)}_pointInBasis2D(t,i,n,s){return t[0]=Ho(i,s),t[1]=Ho(n,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),Nn(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const n=(o,r,l)=>r!=null&&js(this._offsetPlane,o,ut(g(),o,r),l),s=g();(t===this._edge.leftVertex?n(this._left.start,this._left.direction,s):n(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=Kr(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return Ae(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(t){const i=this._helper.toXYZ(this._helper.pointToVector(t)),n=Ks(this._plane,i,g()),s=Ae(this._plane,i),o=cc(s,this._minDistance,this._maxDistance);return Pe(i,n,i,o/s),{start:n,end:i}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof Ls&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&Ye($e(this._plane),$e(t._plane))}accumulate(t,i){const n=this._plane[3]-i._plane[3]+i.distance;this._offset(t,n)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new Ls(this._helper,this._planeType,this._edge,this.distance,yi.DEFERRED);return Nn(t._plane,this._plane),Nn(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=rt(g(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return t==null&&i==null||t!=null&&i!=null&&Ye(t,i)}_cloneNeighbor({start:t,end:i,direction:n,isOriginalDirection:s}){return{start:rt(g(),t),end:i!=null?rt(g(),i):null,direction:rt(g(),n),isOriginalDirection:s}}};const fr=Ir(15),gr=.001;var Gs,yi;(function(e){e[e.XYZ=0]="XYZ",e[e.XY=1]="XY"})(Gs||(Gs={})),function(e){e[e.IMMEDIATE=0]="IMMEDIATE",e[e.DEFERRED=1]="DEFERRED"}(yi||(yi={}));let bl=class wl{constructor(t,i,n=nt.CUMULATIVE){this.origin=t,this.angle=i,this._accumulationType=n}_rotate(t,i){Ec(t.pos,t.pos,this.origin,i)}apply(t){this._rotate(t,this.angle)}undo(t){this._rotate(t,-this.angle)}canAccumulate(t){return t instanceof wl&&Fe(this.origin,t.origin)}accumulate(t,i){const n=i._accumulationType===nt.REPLACE;this._rotate(t,n?i.angle-this.angle:i.angle)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.angle=i?t.angle:this.angle+t.angle}};class In{constructor(t,i,n,s,o=nt.CUMULATIVE){this.origin=t,this.axis1=i,this.factor1=n,this.factor2=s,this._accumulationType=o,this.axis2=de(i[1],-i[0])}_scale(t,i,n){on(t.pos,t.pos,this.origin,this.axis1,i),on(t.pos,t.pos,this.origin,this.axis2,n)}apply(t){this._scale(t,this.factor1,this.factor2)}undo(t){this._scale(t,1/this.factor1,1/this.factor2)}canAccumulate(t){return t instanceof In&&Fe(this.origin,t.origin)&&Fe(this.axis1,t.axis1)}accumulate(t,i){i._accumulationType===nt.REPLACE?this._scale(t,i.factor1/this.factor1,i.factor2/this.factor2):this._scale(t,i.factor1,i.factor2)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.factor1=i?t.factor1:this.factor1*t.factor1,this.factor2=i?t.factor2:this.factor2*t.factor2}}let Xf=class Tl{constructor(t,i){this._editGeometry=t,this._newPositions=i}apply(){const t=this._originalPositions==null?"apply":"redo";if(!this._originalPositions){const i=this._editGeometry.coordinateHelper;this._originalPositions=this._editGeometry.allVertices.map(n=>i.clone(n.pos))}this._apply(t,this._newPositions)}undo(){this._originalPositions&&this._apply("undo",this._originalPositions)}accumulate(t){return t instanceof Tl&&(this._newPositions=t._newPositions,this._apply("apply",this._newPositions),!0)}_apply(t,i){const n=this._editGeometry.coordinateHelper,s=this._editGeometry.allVertices;for(let o=0;oo.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:s})}};var El;const qf=Symbol();let jf=class{constructor(e){this._operations=[],this._closed=!1,this[El]=!0,e&&(this._operations=e,this._closed=!0)}close(){this._closed=!0}apply(){for(const e of this._operations)e.apply()}undo(){for(let e=this._operations.length-1;e>=0;e--)this._operations[e].undo()}accumulate(e){if(this._closed)return!1;const t=this._operations.length?this._operations[this._operations.length-1]:null;return t&&t.accumulate(e)||(this._operations.push(e),e.apply()),!0}};El=qf;let wo=class Sl extends Ce{constructor(t,i){super(),this.data=t,this.viewingMode=i,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",n=>{n.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:n.addedVertices,operation:n.operation}),n.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:n.removedVertices,operation:n.operation}),n.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:n.updatedVertices,operation:n.operation})})}destroy(){this._listener.remove()}splitEdge(t,i){return this._apply(new Zf(this.data,t,i))}updateVertices(t,i,n=L.ACCUMULATE_STEPS){return this._apply(new gl(this.data,t,i),n)}move(t,i,n,s=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,t,i,n),s):this.moveVertices(this.data.allVertices,t,i,n,s)}moveVertices(t,i,n,s,o=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,i,n,s),o):this.updateVertices(t,new vl(this.data.coordinateHelper,i,n,s),o)}scale(t,i,n,s,o=L.ACCUMULATE_STEPS,r=nt.CUMULATIVE){return this.scaleVertices(this.data.allVertices,t,i,n,s,o,r)}scaleVertices(t,i,n,s,o,r=L.ACCUMULATE_STEPS,l=nt.CUMULATIVE){return this.updateVertices(t,new In(i,n,s,o,l),r)}rotate(t,i,n=L.ACCUMULATE_STEPS,s=nt.CUMULATIVE){return this.rotateVertices(this.data.allVertices,t,i,n,s)}rotateVertices(t,i,n,s=L.ACCUMULATE_STEPS,o=nt.CUMULATIVE){return this.updateVertices(t,new bl(i,n,o),s)}removeVertices(t){return this._apply(new Ff(this.data,t,this._minNumVerticesPerType))}appendVertex(t){return this.data.components.length===0?null:this._apply(new Nf(this.data,this.data.components[0],t))}setVertexPosition(t,i){return this._apply(new Bf(this.data,t,i))}offsetEdge(t,i,n,s=L.ACCUMULATE_STEPS){return this.updateVertices([i.leftVertex,i.rightVertex],new Wf(this.data.coordinateHelper,t,i,n),s)}trySetGeometry(t,i=L.ACCUMULATE_STEPS){const{data:n}=this,{coordinateHelper:s}=n;if(n.type!==t.type||!n.spatialReference.equals(t.spatialReference)||s.hasZ()!==t.hasZ||s.hasM()!==t.hasM||!Ql(n.geometry,t)||ri(n))return;const o=Array.from(dn.fromGeometry(t,this.viewingMode).iterateVertices(),r=>r.pos);return this.setVertexPositions(o,i)}setVertexPositions(t,i=L.ACCUMULATE_STEPS){return this._apply(new Xf(this.data,t),i)}createResetState(){if(ri(this.data))return this._createResetStateMesh();const t=this.data.geometry.clone();return Y(()=>this.trySetGeometry(t))}closeComponent(t){return this.data.components.includes(t)?this._apply(new Yf(this.data,t)):null}canRemoveVertex(t){return t.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const t=new jf;return this._apply(t),Y(()=>t.close())}undo(){if(this._undoStack.length>0){const t=this._undoStack.pop();return t.undo(),this._redoStack.push(t),t}return null}redo(){if(this._redoStack.length>0){const t=this._redoStack.pop();return t.apply(),this._undoStack.push(t),t}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(t,i=L.ACCUMULATE_STEPS){return i!==L.NEW_STEP&&this.lastOperation!=null&&this.lastOperation.accumulate(t)||(t.apply(),this._undoStack.push(t),this._redoStack=[]),t}_createResetStateMesh(){if(!ri(this.data))return Y();const t=this.data.geometry,{vertexSpace:i}=t;if(i.origin){const s=ye(i.origin);return Y(()=>{t.vertexSpace.origin=s})}const n=t.vertexAttributes.clonePositional();return Y(()=>{t.vertexAttributes=n,t.vertexAttributesChanged()})}static fromGeometry(t,i){return new Sl(dn.fromGeometry(t,i),i)}};function Kf(e,t){let i=null,n=null;return s=>{if(s.action==="cancel")return void(n!=null&&(n.execute({action:"cancel"}),i=null,n=null));const o={action:s.action,screenStart:s.start,screenEnd:s.screenPoint};s.action==="start"&&i==null&&(i=new Pi,n=new Pi,t(e,i,n,s.pointerType,o)),i?.execute(o),s.action==="end"&&i!=null&&(i=null,n=null)}}function He(e,t){return e.events.on("drag",Kf(e,t))}function To(e,t=null,i){let n=null;const s=t==null||e.spatialReference?.equals(t)?r=>r:r=>r!=null?Xe(r,t):r,o={exclude:[],...i};return r=>{if(r.action==="start"&&(n=s(e.toMap(r.screenStart,o))),n==null)return null;const l=s(e.toMap(r.screenEnd,o));return l!=null?{...r,mapStart:n,mapEnd:l}:null}}const Qf=()=>{};let Pi=class Pl{constructor(){this.execute=Qf}next(t,i=new Pl){return t!=null&&(this.execute=n=>{const s=t(n);s!=null&&i.execute(s)}),i}};function Jf(e,t,i=[]){if(e.type==="2d")return s=>s;let n=null;return s=>{s.action==="start"&&(n=e.toMap(s.screenStart,{exclude:i}),n!=null&&(n.z=Lo(n,e,t)));const o=e.toMap(s.screenEnd,{exclude:i});o!=null&&(o.z=Lo(o,e,t));const r=n!=null&&o!=null?{sceneStart:n,sceneEnd:o}:null;return{...s,scenePoints:r}}}let Ds=class{constructor(e){this.vertexHandle=null,this.excludeFeature=null,this.visualizer=null,this.selfSnappingZ=null,this.drawConstraints=null,this.editGeometryOperations=e.editGeometryOperations,this.elevationInfo=e.elevationInfo,this.pointer=e.pointer,this.vertexHandle=e.vertexHandle,this.excludeFeature=e.excludeFeature,this.feature=e.feature,this.visualizer=e.visualizer,this.selfSnappingZ=e.selfSnappingZ,this.drawConstraints=e.drawConstraints}get coordinateHelper(){return this.editGeometryOperations.data.coordinateHelper}get spatialReference(){return this.coordinateHelper.spatialReference}};function tg({predicate:e=()=>!0,snappingManager:t,snappingContext:i,updatingHandles:n,useZ:s=!0}){const o=new Pi;if(t==null)return{snappingStep:[mr,o],cancelSnapping:mr};let r,l=null,h=null,u=null;const p=()=>{l=os(l),t.doneSnapping(),h?.frameTask.remove(),h=null,r=Ar(r),u=null},d=eg(t,s,o);let m=null,f=null,_=null;return{snappingStep:[y=>{if(!e(y))return y;const{action:w}=y;if(w==="start"){const{info:b}=y,S=ig(t.view);if(h=ng(i,y,S),h.context.selfSnappingZ=null,!s&&b!=null){const I=og(i.coordinateHelper,b.handle.component);I!=null&&(h.context.selfSnappingZ={value:I,elevationInfo:i.elevationInfo??gn})}}if(h!=null){const{context:b,originalScenePos:S,originalPos:I}=h,{mapEnd:K,mapStart:et,scenePoints:W}=y,gt=Ml(I,zs(K,et)),lt=zs(et,I),ei={...y,action:"update"},zt=h.context,ie=sg(S,W),be=t.update({point:gt,scenePoint:ie,context:b});if(_=be,kl(K,be,lt,s),m=gt,f=ie,w!=="end"){const{frameTask:Ln}=h;l==null&&(l=new AbortController),u=Ol=>{n.addPromise(ns(d({frameTask:Ln,event:ei,context:zt,point:gt,scenePoint:ie,delta:lt,getLastState:()=>({point:m,scenePoint:f,updatePoint:Ol.forceUpdate?null:_})},l.signal)))},u({forceUpdate:!1}),r==null&&(r=U(()=>t.options.effectiveEnabled,()=>u?.({forceUpdate:!0})))}}return w==="end"&&p(),y},o],cancelSnapping:y=>(p(),y)}}function eg(e,t,i){return Vr(async({frameTask:n,point:s,scenePoint:o,context:r,event:l,delta:h,getLastState:u},p)=>{const d=await n.schedule(()=>e.snap({point:s,scenePoint:o,context:r,signal:p}),p);if(d.valid){let m=await n.schedule(()=>d.apply(),p);const f=u();f.point!=null&&s!==f.point&&(m=e.update({point:f.point,scenePoint:f.scenePoint,context:r})),f.updatePoint!=null&&gi(m,f.updatePoint)||(kl(l.mapEnd,m,h,t),i.execute(l))}})}function ig(e){return e.type==="3d"?e.resourceController.scheduler.registerTask(ia.SNAPPING):na}function ng(e,t,i){return{context:new Ds({editGeometryOperations:e.editGeometryOperations,elevationInfo:e.elevationInfo,pointer:e.pointer,vertexHandle:t.info!=null?t.info.handle:null,excludeFeature:e.excludeFeature,feature:e.feature,visualizer:e.visualizer}),originalPos:t.snapOrigin!=null?e.coordinateHelper.vectorToDehydratedPoint(t.snapOrigin):t.mapStart,originalScenePos:t.scenePoints!=null?t.scenePoints.sceneStart:null,frameTask:i}}function Ml(e,[t,i,n]){const s=sa(e);return s.x+=t,s.y+=i,s.hasZ&&(s.z+=n),s}function sg(e,t){return e==null||t==null?null:Ml(e,zs(t.sceneEnd,t.sceneStart))}function zs(e,t){const i=e.hasZ&&t.hasZ?e.z-t.z:0;return[e.x-t.x,e.y-t.y,i]}function kl(e,t,[i,n,s],o){e.x=t.x+i,e.y=t.y+n,o&&e.hasZ&&t.hasZ&&(e.z=t.z+s)}function og(e,t){if(!e.hasZ())return null;const i=t.vertices;let n=null;for(const s of i){const o=e.getZ(s.pos);if(n!=null&&o!=null&&Math.abs(o-n)>1e-6)return null;n==null&&(n=o)}return n}function mr(e){return e}let Te=class extends tt{constructor(e){super(e),this.constrainResult=t=>t,this._snapPoints=null,this._frameTask=null,this._abortController=null,this._stagedPoint=null,this._snap=Vr(async(t,i,n,s)=>{const o=this._frameTask;if(o==null)return;const r=await o.schedule(()=>i.snap({...t,context:n,signal:s}),s);r.valid&&await o.schedule(()=>{this.stagedPoint=r.apply(),t!==this._snapPoints&&this._snapPoints!=null&&(this.stagedPoint=i.update({...this._snapPoints,context:n}))},s)})}get stagedPoint(){return this._stagedPoint}set stagedPoint(e){this._stagedPoint=this.constrainResult(e)}initialize(){const e=this.view.type==="3d"?this.view?.resourceController?.scheduler:null;this._frameTask=e!=null?e.registerTask(ia.SNAPPING):na}destroy(){this._abortController=os(this._abortController),this._frameTask=Ar(this._frameTask)}update(e,t,i){this._snapPoints=e;const{point:n,scenePoint:s}=e,o=t.update({point:n,scenePoint:s,context:i});return this.stagedPoint=o,o}async snap(e,t,i){const{point:n,scenePoint:s}=e;return this.stagedPoint=t.update({point:n,scenePoint:s,context:i}),this._snapPoints=e,this._abortController==null&&(this._abortController=new AbortController),this._snap(e,t,i,this._abortController.signal)}async snapAgainNearPreviousMapPoint(e,t){this._snapPoints!=null&&await this.snap(this._snapPoints,e,t)}abort(){this._abortController=os(this._abortController),this._snapPoints=null}};a([c({constructOnly:!0})],Te.prototype,"view",void 0),a([c()],Te.prototype,"stagedPoint",null),a([c()],Te.prototype,"constrainResult",void 0),a([c()],Te.prototype,"_stagedPoint",void 0),Te=a([x("esri.views.interactive.snapping.SnappingOperation")],Te);var yr;(function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"})(yr||(yr={}));const _r=Symbol("snapping-toggle");function rg(e,t=()=>{}){const i=U(()=>({view:e.view,snappingOptions:e.snappingOptions}),({view:n,snappingOptions:s})=>{if(e.removeHandles(_r),!n||!s)return;const o=Xr.TOOL,r=[n.on("key-down",l=>{l.key!==ir.toggle||l.repeat||(s.enabledToggled=!0,t())},o),n.on("key-up",l=>{l.key===ir.toggle&&(s.enabledToggled=!1,t())},o),n.on("pointer-move",l=>{const h=l.native.ctrlKey;s.enabledToggled!==h&&(s.enabledToggled=h,t())},o)];e.addHandles(r,_r)},ke);e.addHandles(i)}const ag="crosshair",lg="progress",vr=Symbol(),xr=Symbol();let T=class extends Ce.EventedMixin(tt){constructor(e){super(e),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new Jc,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new Zr,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=ys(vp),this._getPolylineOrPolygonConstraint=ys(xp),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new An,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,e.elevationInfo==null&&(this.elevationInfo=Lc(!!e.hasZ))}initialize(){const{geometryType:e,view:t}=this,i=t.spatialReference,n="viewingMode"in t.state?t.state.viewingMode:Ti.Local,s=e==="segment"||e==="multipoint"?"polyline":e;this.coordinateHelper=dl(this.hasZ,this.hasM,i),this._editGeometryOperations=new wo(new dn(s,this.coordinateHelper),n),this._snappingOperation=new Te({view:t}),this.addHandles([U(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:l,constraint:h},u)=>{const{snappingOptions:p}=this;if(p&&(p.forceDisabled=h!=null&&vt(h)),u!=null&&l===u.stagedPoint&&h!==u.constraint)return this._onKeyboardBasedChange();this._processCursor(l??this._screenToMap(this._stagedScreenPoint))},{equals:(l,h)=>l.stagedPoint===h.stagedPoint&&Gl(l.constraint,h.constraint)}),U(()=>this.view.viewpoint,(l,h)=>{l&&h&&$h(l,h)&&this._onKeyboardBasedChange()})]),this._activeComponent=new On(i,n),this._editGeometryOperations.data.components.push(this._activeComponent);const o=this.segmentLabels;o!=null&&(o.context={view:t,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles(U(()=>this.labelOptions.enabled,l=>{o.visible=l},ke))),this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],l=>{const h=l.vertices.map(f=>({componentIndex:0,vertexIndex:f.index,coordinates:this.coordinateHelper.vectorToArray(f.pos)})),u=h.map(f=>f.coordinates),p=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getFirstVertex()?.pos)??null;gi(p,this.firstVertex)||(this.firstVertex=p);const d=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getLastVertex()?.pos)??null;gi(d,this.lastVertex)||(this.lastVertex=d);const m=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.edges.at(-1)?.leftVertex?.pos)??null;switch(gi(m,this.secondToLastVertex)||(this.secondToLastVertex=m),this._processCursor(this.cursorVertex),l.type){case"vertex-add":this.emit(l.type,{...l,added:u,vertices:h});break;case"vertex-update":this.emit(l.type,{...l,updated:u,vertices:h});break;case"vertex-remove":this.emit(l.type,{...l,removed:u,vertices:h})}}));const r=this._manipulator=new Lf({consumesClicks:!1,grabbableForEvent:l=>this.drawingMode!=="click"||l.pointerType==="touch"&&this._snappingEnabled&&this._pointerDownStates.size===1});this.manipulators.add(r),r.grabbable=e!=="point",this.addHandles([r.events.on("immediate-click",l=>this._onImmediateClick(l)),r.events.on("immediate-double-click",l=>this._onImmediateDoubleClick(l)),U(()=>this.drawingMode,()=>{this.removeHandles(vr),this.addHandles(this._createManipulatorDragPipeline(r),vr)},ke),U(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:l})=>{r.cursor=l},ke)]),rg(this,()=>{const l=this.view.inputManager.latestPointerType??"mouse",h=this._getSnappingContext(l);if(this.snappingManager!=null){const u=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,h);this._updatingHandles.addPromise(ns(u))}})}destroy(){dt(this.segmentLabels),dt(this._snappingOperation),this._editGeometryOperations=dt(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){const{_stagedPointerId:e,_manipulator:t}=this;return e!=null&&this._pointerDownStates.has(e)||t.grabbing||!t.interactive}get _snappingEnabled(){return this.snappingManager!=null&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const e=this._updateAndGetEffectiveDrawSurface();return this.view.type==="3d"&&this.drawSurface!==e}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map(e=>this.coordinateHelper.vectorToArray(e.pos))}get _constraint(){const{constraints:e,constraintsEnabled:t}=this;if(e&&t)switch(this.geometryType){case"point":return this._getPointConstraint(e);case"polygon":case"polyline":return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,e)}}set drawingMode(e){this._set("drawingMode",e??pl)}get effectiveCursor(){return this.loading?lg:this._hideDefaultCursor?null:this.cursor||ag}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get snappingOptions(){return this.snappingManager!=null?this.snappingManager.options:null}get cursorVertex(){return this._get("cursorVertex")}get visualizationCursorVertex(){return this._stagedPointerType==="mouse"?this.cursorVertex:null}get committableVertex(){const{cursorVertex:e,lastVertex:t,firstVertex:i,geometryType:n}=this;return n==="polygon"&&Fn(e,i)||Fn(e,t)?null:e}get updating(){return this._updatingHandles.updating}get geometryIncludingUncommittedVertices(){const{committedVertices:e,committableVertex:t,coordinateHelper:i}=this,n=e.slice();return t!=null&&n.push(i.pointToArray(t)),n}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();const{committableVertex:e}=this;e!=null&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e))}complete(e){const t=e?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();const{geometryType:i,numCommittedVertices:n}=this,s=i==="multipoint"&&n===0||i==="polyline"&&n<2||i==="polygon"&&n<3;i!=="segment"&&i!=="point"||this.commitStagedVertex(),this._createOperationCompleted=!s,(this.isCompleted||t)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit("complete",{vertices:this.committedVertices.map((o,r)=>({componentIndex:0,vertexIndex:r,coordinates:o})),aborted:t,type:"complete"}))}onInputEvent(e){switch(e.type){case"pointer-down":this._pointerDownStates.add(e.pointerId);break;case"pointer-up":this._pointerDownStates.delete(e.pointerId)}switch(e.type){case"pointer-move":return this._onPointerMove(e);case"hold":return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(e){const t=is(this.cursorVertex),i=is(e),n=i&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(i)??i),s=this._snapToClosingVertex(n),o=this._applyConstraints(s);Fn(t,o)||(this._set("cursorVertex",o),this.segmentLabels?.set("stagedVertex",o!=null?this.coordinateHelper.pointToVector(o):null),o==null||this._stagedPointerType!=="mouse"?this.emit("cursor-remove"):this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:"apply",type:"vertex-update"}))}_snapToClosingVertex(e){if(e==null||this._isDragging||this.geometryType!=="polygon"||this.numCommittedVertices<=2)return e;const t=this._mapToScreen(e);if(!t)return e;const i=this._activeComponent;return this._vertexWithinPointerDistance(i.vertices[0].pos,t)?this.firstVertex:this._vertexWithinPointerDistance(i.vertices.at(-1).pos,t)?this.lastVertex:e}_createManipulatorDragPipeline(e){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(e);case"freehand":return this._createManipulatorDragPipelineFreehand(e);case"hybrid":return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return He(e,(t,i,n,s)=>{const o=s==="touch"&&this._snappingEnabled;if(this.isCompleted||!o)return;const{snappingStep:r,cancelSnapping:l}=tg({predicate:()=>o,snappingManager:this.snappingManager,snappingContext:new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:s,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});n=n.next(h=>(o&&this.snappingManager!=null&&this.snappingManager.doneSnapping(),h)).next(l),i.next(this._screenToMapDragEventStep()).next(h=>(h.action==="start"&&(this._processCursor(h.mapStart),(this.geometryType==="segment"||o&&!this.numCommittedVertices)&&this.commitStagedVertex()),h)).next(Jf(this.view,this.elevationInfo)).next(...r).next(h=>(o&&(this._processCursor(h.mapEnd),h.action==="end"&&this.commitStagedVertex()),h)).next(h=>(h.action==="end"&&(this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()),h))})}_createManipulatorDragPipelineFreehand(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.committableVertex==null&&this._processCursor(n.mapStart),this.geometryType==="segment"&&this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this.complete()}return n})})}_createManipulatorDragPipelineHybrid(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),xr),this._processCursor(n.mapStart),this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.removeHandles(xr),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()}return n})})}get _drawAtFixedElevation(){const{constraintsEnabled:e,constraintZ:t,geometryType:i,numCommittedVertices:n}=this;return e?t!=null||i==="segment"&&n>0:(i==="segment"||i==="polygon")&&n>0}_updateAndGetEffectiveDrawSurface(){const{constraintsEnabled:e,coordinateHelper:t,drawSurface:i,elevationDrawSurface:n,snapToSceneEnabled:s}=this;if(n==null)return i;if(!this.hasZ)return n.defaultZ=null,n;const o=this.elevationInfo?.mode;let r=this.defaultZ,l=e||o==="absolute-height";return s!=null&&(l=s),o==="on-the-ground"&&(l=!1),this._drawAtFixedElevation&&(r=(e?this.constraintZ:null)??t.getZ(this._activeComponent.vertices[0].pos),l=!1),l?i:(n.defaultZ=r,n)}_mapToScreen(e){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(e)}_onHold(e){this._snappingOperation.abort(),this.drawingMode==="click"&&e.pointerType==="touch"&&this._snappingEnabled&&this._processCursor(e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if(!(e.pointerType==="mouse"&&e.button===2||this._manipulator.dragging))try{const{drawingMode:t,geometryType:i}=this;this._stagedPointerType=e.pointerType,this._stagedScreenPoint=e.screenPoint;const n=this._screenToMap(e.screenPoint);if(n==null||n==null||t==="freehand"&&i!=="point")return;if(this._snappingEnabled&&this.cursorVertex!=null||this._processCursor(n),this.committableVertex==null)return void this.complete();this.commitStagedVertex(),e.pointerType!=="mouse"&&this._processCursor(null),(t==="freehand"||i==="point"||i==="segment"&&this.numCommittedVertices===2||i==="segment"&&t==="hybrid"&&this.numCommittedVertices===1)&&this.complete()}finally{e.stopPropagation()}}_onImmediateDoubleClick(e){this._manipulator.dragging||this.geometryType==="point"||(this.complete(),e.stopPropagation())}_onPointerMove(e){const t=Us(e.x,e.y);this._stagedScreenPoint=t,this._stagedPointerType=e.pointerType,this._stagedPointerId=e.pointerId,this._isDragging?this._snappingOperation.abort():(e.stopPropagation(),this._processCursorMovementRelativeToSurface(t,e.pointerType))}_onKeyboardBasedChange(){this._stagedPointerType==="mouse"&&this._stagedScreenPoint&&this._stagedPointerId!=null&&!this._isDragging?this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType):this._snappingOperation.abort()}_processCursorMovementRelativeToSurface(e,t){const i=this._snappingOperation,n=this._screenToMap(e),s=this._requiresScenePoint?this.drawSurface?.screenToMap(e):null;if(n==null)return this._hideDefaultCursor=!0,this._processCursor(null),void i.abort();this._hideDefaultCursor=!1;const o=this.snappingManager;if(o==null)return this._processCursor(n),void i.abort();const r=this._getSnappingContext(t);this._updatingHandles.addPromise(ns(i.snap({point:n,scenePoint:s},o,r)))}_applyConstraints(e){const{_constraint:t,constraints:i}=this;if(!e||!i||!t)return e;const{context:n}=i,s=Sn(e,n),o=s?t.closestTo(s):void 0;if(!o)return e;const r=wp(o,e,n),l=this.view.type==="2d"||n.elevationInfo.mode!=="absolute-height";return r!=null&&l&&this.constraintZ!=null&&this.hasZ&&(r.z=this.constraintZ),r}_screenToMap(e){return e?this._updateAndGetEffectiveDrawSurface()?.screenToMap(e):null}_screenToMapDragEventStep(){let e=null;return t=>{if(t.action==="start"&&(e=this._screenToMap(t.screenStart)),e==null)return null;const i=this._screenToMap(t.screenEnd);return i!=null?{...t,mapStart:e,mapEnd:i}:null}}_vertexWithinPointerDistance(e,t){const i=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return i!=null&&cg(i,t,25)}_getSnappingContext(e){const t=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:t!=null?{value:t,elevationInfo:this.elevationInfo}:null,drawConstraints:this.constraints})}};function cg(e,t,i){const n=e.x-t.x,s=e.y-t.y;return n*n+s*s<=i}a([c()],T.prototype,"_hideDefaultCursor",void 0),a([c()],T.prototype,"_stagedPointerId",void 0),a([c()],T.prototype,"_isDragging",null),a([c()],T.prototype,"_snappingOperation",void 0),a([c()],T.prototype,"_snappingEnabled",null),a([c({constructOnly:!0})],T.prototype,"graphic",void 0),a([c()],T.prototype,"constraintsEnabled",void 0),a([c()],T.prototype,"constraints",void 0),a([c()],T.prototype,"_constraint",null),a([c()],T.prototype,"constraintZ",void 0),a([c()],T.prototype,"defaultZ",void 0),a([c()],T.prototype,"isDraped",void 0),a([c({value:pl})],T.prototype,"drawingMode",null),a([c({constructOnly:!0})],T.prototype,"elevationDrawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"elevationInfo",void 0),a([c({constructOnly:!0,type:An})],T.prototype,"labelOptions",void 0),a([c({constructOnly:!0})],T.prototype,"geometryType",void 0),a([c({constructOnly:!0})],T.prototype,"hasM",void 0),a([c({constructOnly:!0})],T.prototype,"hasZ",void 0),a([c()],T.prototype,"cursor",void 0),a([c()],T.prototype,"effectiveCursor",null),a([c()],T.prototype,"loading",void 0),a([c({constructOnly:!0})],T.prototype,"manipulators",void 0),a([c({constructOnly:!0})],T.prototype,"drawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"segmentLabels",void 0),a([c({constructOnly:!0})],T.prototype,"snappingManager",void 0),a([c({constructOnly:!0})],T.prototype,"snappingVisualizer",void 0),a([c()],T.prototype,"snapToSceneEnabled",void 0),a([c({readOnly:!0})],T.prototype,"cursorVertex",null),a([c({readOnly:!0})],T.prototype,"visualizationCursorVertex",null),a([c()],T.prototype,"committableVertex",null),a([c()],T.prototype,"firstVertex",void 0),a([c()],T.prototype,"lastVertex",void 0),a([c()],T.prototype,"secondToLastVertex",void 0),a([c()],T.prototype,"updating",null),a([c({constructOnly:!0})],T.prototype,"view",void 0),T=a([x("esri.views.draw.DrawOperation")],T);let hg=class{constructor(e,t=!1,i=0){this.view=e,this.hasZ=t,this.defaultZ=i,this.mapToScreen=n=>e.toScreen(n),this.screenToMap=t?n=>{const s=e.toMap(n);return s.z=i,s}:n=>e.toMap(n)}constrainZ(e){const{defaultZ:t}=this;return this.hasZ&&e.z!==t&&((e=sa(e)).z=t),e}};new ue;let ai=class extends P{constructor(e){super(e),this._visualElementGraphics={regularVertices:null,activeVertex:null,activeEdge:null},this.activeFillSymbol=null,this.type="draw-2d",this._visualElementSymbols={outline:e.activeLineSymbol??iu,regularVertices:e.regularVerticesSymbol??nu,activeVertex:e.activeVertexSymbol??su,fill:e.activeFillSymbol},e.activeVertexSymbol||this.addHandles(U(()=>this.view?.effectiveTheme?.accentColor,t=>{if(!t)return;const i=this._visualElementSymbols.activeVertex.clone().set({color:t});this._visualElementGraphics.activeVertex?.set("symbol",i),this._visualElementSymbols={...this._visualElementSymbols,activeVertex:i}},es))}normalizeCtorArgs(e){const t={...e};return delete t.activeFillSymbol,delete t.activeVertexSymbol,delete t.regularVerticesSymbol,delete t.activeLineSymbol,t}initializeGraphic(e){return this._visualElementSymbols.fill!=null&&(e.symbol=this._visualElementSymbols.fill),this.internalGraphicsLayer.graphics.sort(ji),Y()}makeDrawOperation(){const{defaultZ:e,hasZ:t,view:i}=this;return this._createOrUpdateGraphic(null),new T({view:i,manipulators:this.manipulators,geometryType:Of(this.geometryType),drawingMode:this.mode,hasZ:t,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new hg(i,t,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new tu(this.internalGraphicsLayer),graphic:this.graphic,cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){if(this.geometryType==="point")return Y();const[t,i]=e,n=new C({x:t,y:i,spatialReference:this.view.spatialReference});return this._visualElementGraphics.activeVertex!=null?(this._visualElementGraphics.activeVertex.geometry=n,Y()):(this._visualElementGraphics.activeVertex=new Lt({geometry:n,symbol:this._visualElementSymbols.activeVertex,attributes:{displayOrder:2}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.activeVertex!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeVertex),this._visualElementGraphics.activeVertex=dt(this._visualElementGraphics.activeVertex))}))}onCursorEdgeChanged(e){return this._visualElementGraphics.activeEdge!=null?(this._visualElementGraphics.activeEdge.geometry=e,Y()):(this._visualElementGraphics.activeEdge=new Lt({geometry:e,symbol:this._visualElementSymbols.outline,attributes:{displayOrder:0}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeEdge),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.activeEdge!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeEdge),this._visualElementGraphics.activeEdge=dt(this._visualElementGraphics.activeEdge))}))}onRegularVerticesChanged(e){const t=new Mr({points:e,spatialReference:this.view.spatialReference});return this._visualElementGraphics.regularVertices!=null?(this._visualElementGraphics.regularVertices.geometry=t,Y()):(this._visualElementGraphics.regularVertices=new Lt({geometry:t,symbol:this._visualElementSymbols.regularVertices,attributes:{displayOrder:1}}),this.internalGraphicsLayer.add(this._visualElementGraphics.regularVertices),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.regularVertices!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.regularVertices),this._visualElementGraphics.regularVertices=dt(this._visualElementGraphics.regularVertices))}))}};function ji(e,t){return(e.attributes?.displayOrder??-1/0)-(t.attributes?.displayOrder??-1/0)}a([c()],ai.prototype,"activeFillSymbol",void 0),a([c({readOnly:!0})],ai.prototype,"type",void 0),a([c({constructOnly:!0,nonNullable:!0})],ai.prototype,"view",void 0),ai=a([x("esri.views.2d.interactive.editingTools.draw.DrawGraphicTool2D")],ai);let Eo=class{get hovering(){return this.someManipulator(e=>e.hovering)}get grabbing(){return this.someManipulator(e=>e.grabbing)}get dragging(){return this.someManipulator(e=>e.dragging)}hasManipulator(e){return this.someManipulator(t=>t===e)}someManipulator(e){let t=!1;return this.forEachManipulator(i=>{!t&&e(i)&&(t=!0)}),t}};var Mi;(function(e){e[e.TRANSLATE_XY=0]="TRANSLATE_XY",e[e.SCALE=1]="SCALE",e[e.ROTATE=2]="ROTATE"})(Mi||(Mi={}));function Cl(e){let t=0,i=0,n=0;return e?(e.type==="cim"&&e.data.symbol&&"symbolLayers"in e.data.symbol&&e.data.symbol.symbolLayers&&e.data.symbol.symbolLayers.map(s=>{s.type==="CIMVectorMarker"&&s.anchorPoint&&(Math.abs(s.anchorPoint.x)>t&&(t=s.anchorPoint.x),Math.abs(s.anchorPoint.y)>i&&(i=s.anchorPoint.y),s.size!=null&&s.size>n&&(n=s.size))}),t=ze(t),i=ze(i),n=ze(n),{offsetX:t,offsetY:i,size:n}):{offsetX:t,offsetY:i,size:n}}let X=class extends tt{set graphic(e){this._circleCollisionCache=null,this._originalSymbol=e.symbol,this._set("graphic",e),this.attachSymbolChanged()}get elevationInfo(){const{layer:e}=this.graphic,t=e&&"elevationInfo"in e?e.elevationInfo:null,i=Gc(this.graphic),n=t?t.offset:0;return new Nh({mode:i,offset:n})}set focusedSymbol(e){e!==this._get("focusedSymbol")&&(this._set("focusedSymbol",e),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(e){e!==this._get("grabbing")&&(this._set("grabbing",e),this._updateGraphicSymbol())}set hovering(e){e!==this._get("hovering")&&(this._set("hovering",e),this._updateGraphicSymbol())}set selected(e){e!==this._get("selected")&&(this._set("selected",e),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(e){super(e),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new Ce.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(e){const t=this.graphic;if(t.visible===!1)return null;const i=t.geometry;if(i==null)return null;const n=this._get("focusedSymbol"),s=n??t.symbol;return this.view.type==="2d"?this._intersectDistance2D(this.view,e,i,s):this._intersectDistance3D(this.view,e,t)}attach(){this.attachSymbolChanged(),this.layer!=null&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this.layer!=null&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=U(()=>this.graphic?.symbol,e=>{e!=null&&e!==this.focusedSymbol&&e!==this._originalSymbol&&(this._originalSymbol=e,this._focused&&this.focusedSymbol!=null&&(this.graphic.symbol=this.focusedSymbol))},$s)}detachSymbolChanged(){this._graphicSymbolChangedHandle!=null&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&this.focusedSymbol!=null?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(e,t,i,n){if((n=n||Jl(i))==null)return null;const s=1;let o=this._circleCollisionCache;if(i.type==="point"&&n.type==="cim"&&n.data.symbol?.type==="CIMPointSymbol"&&n.data.symbol.symbolLayers){const{offsetX:r,offsetY:l,size:h}=Cl(n),u=Co(t,wr),p=h/2,d=e.toScreen(i),m=d.x+r,f=d.y+l;return sn(u,[m,f])this._tool.manipulators.add(t))}destroy(){this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._graphic=null}forEachManipulator(e){e(this._manipulator,Mi.TRANSLATE_XY)}createDragPipeline(e,t){let i=null,n=null,s=0,o=0,r=0;const{offsetX:l,offsetY:h,size:u}=Cl(this._graphic.symbol);return He(this._manipulator,(p,d)=>{d.next(m=>{if(m.action==="start"){const f=e();i=f.editGeometryOperations,n=f.constraints}return m}).next(To(this._view)).next(m=>{const{x:f,y:_,z:y}=m.mapEnd;if(n&&(f+ln.xmax||_+h-u>n.ymax))return m;(m.action==="start"||s===0&&o===0&&r===0)&&(s=m.mapStart.x,o=m.mapStart.y,r=m.mapStart.z);const w=f-s,b=_-o,S=y-r;s=f,o=_,r=y;const I=m.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,K=i.move(w,b,S,I);return t(m,K),m})})}_createManipulator(){const e=this._view,t=this._graphic;return new X({view:e,graphic:t,selectable:!0,cursor:"move"})}};const $t={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",toggleOpacity:"t",shift:"Shift",primaryKey:Wr},ug=1,pg=10,Tr=new _i("#009af2");let Bt=class extends B{constructor(e){super(e),this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this._highlightHandle=null,this.activeHandle=0,this.type="reshape"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._controlPointManipulations.forEach(t=>t.destroy()),this._controlPointEditGeometryOperations.forEach(t=>t.destroy()),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return Ns(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const e=this._undoStack[this._undoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canUndo}canRedo(){const e=this._redoStack[this._redoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canRedo}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();this._controlPointEditGeometryOperations[e].undo(),this.updateGraphics(),this._redoStack.push(e)}}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();this._controlPointEditGeometryOperations[e].redo(),this.updateGraphics(),this._undoStack.push(e)}}refresh(){const{mediaElement:e}=this;if(e.georeference==null)return;const t=e.georeference;t.type==="control-points"&&t.coords!=null&&(this._georeference=t,this._georeference.controlPoints.forEach(({mapPoint:i},n)=>{const s=this._controlPointEditGeometryOperations[n],o=s.data.components[0].vertices[0];s.setVertexPosition(o,s.data.coordinateHelper.pointToVector(i))}),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._georeference,t=e.controlPoints,i=t[0].mapPoint.spatialReference,n=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map((s,o)=>{const r=s.data.geometry;return this._controlPointGraphics[o].geometry=r,{mapPoint:Xe(r,i),sourcePoint:n?t[o].sourcePoint:e.toSource(r)}})}updateActiveHandle(e){if(this.activeHandle===e)return;const t=this._controlPointGraphics[this.activeHandle].symbol.clone();No(t,this.view.effectiveTheme.accentColor),this._controlPointGraphics[this.activeHandle].symbol=t;const i=this._controlPointGraphics[e].symbol.clone();No(i,Tr),this._controlPointGraphics[e].symbol=i,this.activeHandle=e,this.view.surface===document.activeElement&&this.highlightActiveHandle()}async highlightActiveHandle(){this.removeHighlightActiveHandle();const e=await this.view.whenLayerView(this._graphicsLayer);this._highlightHandle=e.highlight(this._controlPointGraphics[this.activeHandle])}removeHighlightActiveHandle(){this._highlightHandle&&this._highlightHandle.remove()}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,mediaElement:t}=this;if(t.georeference==null)return;const i=t.georeference;i.type==="control-points"&&i.coords!=null&&(this._georeference=i,this._initialControlPoints=this._georeference.controlPoints,e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._controlPointEditGeometryOperations=this._georeference.controlPoints.map(({mapPoint:n})=>wo.fromGeometry(Xe(n,e.spatialReference),Ti.Local)),this._controlPointGraphics=this._controlPointEditGeometryOperations.map((n,s)=>new Lt({symbol:new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:s===this.activeHandle?Tr.toArray():this.view.effectiveTheme.accentColor.toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:n.data.geometry})),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map(n=>new Rl({tool:this,view:e,graphic:n})),this.addHandles([...this._controlPointManipulations.map((n,s)=>n.createDragPipeline(this._getInfo.bind(this,s),(o,r)=>{o.action==="start"&&(this._undoStack.push(s),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0),this.updateGraphics()})),U(()=>this.view.scale,()=>this.active?this.updateGraphics():null)]),this._controlPointManipulations.forEach((n,s)=>{const o=r=>{this.addHandles([r.events.on(["click","grab-changed"],l=>this.updateActiveHandle(s))])};n.forEachManipulator(o)}),this.addHandles([e.on("key-down",n=>{e.activeTool===this&&(n.key!==$t.shift||n.repeat||(this._isModifierActive=!0,n.stopPropagation()),n.key!==$t.toggleOpacity||n.repeat||(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled,n.stopPropagation()),n.key!==$t.primaryKey||n.repeat||(this._factor=pg,n.stopPropagation()),this._isModifierActive&&(n.key===$t.up&&(this._move(0,this._factor),n.stopPropagation()),n.key===$t.down&&(this._move(0,-this._factor),n.stopPropagation()),n.key===$t.left&&(this._move(-this._factor,0),n.stopPropagation()),n.key===$t.right&&(this._move(this._factor,0),n.stopPropagation())))}),e.on("key-up",n=>{e.activeTool===this&&(n.key===$t.shift&&(this._isModifierActive=!1,n.stopPropagation()),n.key===$t.primaryKey&&(this._factor=ug,n.stopPropagation()))})]))}async _loadProjectionEngine(){const e=this._georeference.controlPoints[0].mapPoint;return ea(e.spatialReference,this.view.spatialReference)}_getInfo(e){return{editGeometryOperations:this._controlPointEditGeometryOperations[e],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(e,t){const i=this._controlPointEditGeometryOperations[this.activeHandle].move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],Bt.prototype,"_hasValidSpatialReference",null),a([c()],Bt.prototype,"activeHandle",void 0),a([c({constructOnly:!0,nonNullable:!0})],Bt.prototype,"mediaElement",void 0),a([c({readOnly:!0})],Bt.prototype,"type",void 0),a([c({constructOnly:!0})],Bt.prototype,"view",void 0),Bt=a([x("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],Bt);function Vl(e,t){e.action==="start"?t.cursor="grabbing":t.cursor="grab"}class dg{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(t){if(this._enabled!==t&&this._lastDragEvent!=null){const i={...this._lastDragEvent,action:"update"};t&&this._adjustScaleFactors(i),this.next.execute(i)}this._enabled=t}createDragEventPipelineStep(){return this._lastDragEvent=null,t=>(this._lastDragEvent=t.action!=="end"?{...t}:null,this._enabled&&this._adjustScaleFactors(t),t)}_adjustScaleFactors(t){const i=t.direction[0]!==0&&t.direction[1]!==0?Math.max(Math.abs(t.factor1),Math.abs(t.factor2)):t.direction[0]===0?Math.abs(t.factor2):Math.abs(t.factor1);t.factor1=t.factor1<0?-i:i,t.factor2=t.factor2<0?-i:i}}let fg=class{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(e){if(this._enabled!==e&&this._lastDragEvent!=null){const t={...this._lastDragEvent,action:"update"};e&&this._adjustRotateAngle(t),this.next.execute(t)}this._enabled=e}createDragEventPipelineStep(){return this._lastDragEvent=null,e=>(this._lastDragEvent=e.action!=="end"?{...e}:null,this._enabled&&this._adjustRotateAngle(e),e)}_adjustRotateAngle(e){const t=Or(e.rotateAngle);e.rotateAngle=Ir(5*Math.round(t/5))}};function gg(e,t,i,n=!1){const s=Math.atan2(t.y-i.y,t.x-i.x)-Math.atan2(e.y-i.y,e.x-i.x),o=Math.atan2(Math.sin(s),Math.cos(s));return n?o:Or(o)}function Al(e,t){return mg(e,t,!1)}function mg(e,t,i){if(e instanceof gl){if(e.operation instanceof vl)return yg(e.operation,t,i),!0;if(e.operation instanceof bl)return _g(e.operation,t,i),!0;if(e.operation instanceof In)return vg(e.operation,t,i),!0}return!1}function yg(e,t,i=!1){const n=i?-1:1,s=pe(n*e.dx,n*e.dy,n*e.dz);ut(t.origin,t.origin,s),xn(t)}function _g(e,t,i=!1){const n=i?-e.angle:e.angle;zo(t.basis1,t.basis1,Ao,n),zo(t.basis2,t.basis2,Ao,n),xn(t)}function vg(e,t,i=!1){const n=i?1/e.factor1:e.factor1,s=i?1/e.factor2:e.factor2;fe(t.basis1,t.basis1,n),fe(t.basis2,t.basis2,s),on(t.origin,t.origin,e.origin,e.axis1,n),on(t.origin,t.origin,e.origin,e.axis2,s),xn(t)}function xg(e,t,i,n){n||(n=Ei());const s=Yt(ii.get(),e[1],-e[0]),o=Yt(ii.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=Yt(ii.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),l=ii.get();t.components.forEach(p=>p.vertices.forEach(({pos:d})=>{Yt(l,_e(e,d),_e(s,d)),xc(o,o,l),bc(r,r,l)}));const h=1e-6,u=Yt(ii.get(),r[0]-o[0]Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._snapRotation=null,this._graphic=null,this._handles=null,this._originCache=null}forEachManipulator(t){t(this._manipulator,Mi.ROTATE)}createDragPipeline(t,i){let n=null,s=null;return He(this._manipulator,(o,r)=>{r.next(l=>{if(l.action==="start"){o.cursor="grabbing";const h=t();n=h.plane,s=h.editGeometryOperations}return l}).next(To(this._view)).next(l=>({...l,rotateAngle:gg(l.mapStart,l.mapEnd,{x:n.origin[0],y:n.origin[1]},!0)})).next(this._snapRotation.createDragEventPipelineStep(),this._snapRotation.next).next(l=>{const h=rt(this._originCache,n.origin),u=l.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,p=s.rotate(h,l.rotateAngle,u,nt.REPLACE);return Al(p,n),i(l,p),l}).next(l=>(l.action==="end"&&(o.cursor="grab"),l))})}_createManipulator(){const t=this._view,i=this._graphic;return new X({view:t,graphic:i,selectable:!0,cursor:"grab"})}}const ts=10,Er=1e-6,wg=.3;function Sr(e){const t=xi(e.basis1),i=xi(e.basis2);return wg*Math.min(t,i)}class Tg extends Eo{constructor(t){super(),this._handles=new Lr,this._planeStart=Ei(),this._displayPlaneStart=Ei(),this._originCache=g(),this._axisCache=G(),this._renderStartCache=g(),this._renderEndCache=g(),this._resizeOriginCache=g(),this._view=t.view,this._tool=t.tool,this._graphic=t.graphic,this._direction=t.direction,this._preserveAspectRatio=t.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",i=>Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,Mi.SCALE)}createDragPipeline(t,i){let n=null,s=null,o=null,r=0,l=null,h=null;const u=this._planeStart,p=this._displayPlaneStart,d=this._direction;return He(this._manipulator,(m,f)=>{f.next(_=>{if(_.action==="start"){m.cursor="grabbing";const y=t();n=y.plane,s=y.displayPlane,o=y.editGeometryOperations,r=ts*this._view.resolution,Qi(n,u),Qi(s,p);const w=$r(o.data.spatialReference);l=w?w.valid[1]-w.valid[0]-3*ts*this._view.resolution:null}return _}).next(To(this._view)).next(_=>{const y=rt(this._renderStartCache,[_.mapStart.x,_.mapStart.y,0]),w=rt(this._renderEndCache,[_.mapEnd.x,_.mapEnd.y,0]),b=rt(this._resizeOriginCache,p.origin);z(b,b,p.basis1,-d[0]),z(b,b,p.basis2,-d[1]),Et(w,w,b),Et(y,y,b);const S=d[0]!==0&&d[1]!==0,I=Sr(p),K=Sr(s)/I,et=(lt,ei)=>{if(lt===0)return 1;let zt=xi(ei),ie=.5*lt*Z(ei,w)/zt;const be=ie<0?-1:1;S&&(ie+=(zt-.5*lt*Z(ei,y)/zt)*be*K);const Ln=zt<1.5*r?1:Er;return zt=Math.max(zt-r,Er),be>0&&(ie-=ts*this._view.resolution),be*Math.max(be*(ie/zt),Ln)},W=et(d[0],p.basis1),gt=et(d[1],p.basis2);return{..._,direction:d,factor1:W,factor2:gt}}).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(_=>{const y=rt(this._originCache,u.origin);z(y,y,u.basis1,-d[0]),z(y,y,u.basis2,-d[1]);const w=Yt(this._axisCache,u.basis1[0],u.basis1[1]);Ys(w,w);const b=o.data.allVertices,S=_.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,I=o.scaleVertices(b,y,w,_.factor1,_.factor2,S,nt.REPLACE);return l&&l(_.action==="end"&&(m.cursor="grab"),_))})}_createManipulator(){return new X({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}function Eg(e){return e?.type==="graphic"}function Sg(e){return e.find(Eg)??null}const Pg=80,Mg=10,kg=30,Cg=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Pr=1,Rg=10;let _t=class extends B{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=Ei(),this._displayPlaneCache=Ei(),this._mainAxisCache=G(),this._rotationHandleCache=g(),this._cornerA=g(),this._cornerB=g(),this._cornerC=g(),this._cornerD=g(),this._avgAB=g(),this._avgBC=g(),this._avgCD=g(),this._avgDA=g(),this._preserveAspectRatio=new dg,this._snapRotation=new fg,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._factor=Pr,this.preserveAspectRatio=null,this.snapRotation=null,this.type="transform"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach(t=>t.destroy()),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(e==null)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],n=q(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);Ys(n,n);let s=Pg*this.view.resolution;const o=this.view.spatialReference;return Qe(o,e.spatialReference)&&(s*=vi(o)/vi(e.spatialReference)),xg(n,t,s,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;Qi(e,t);const i=Mg*this.view.resolution;return fe(t.basis1,t.basis1,1+i/xi(t.basis1)),fe(t.basis2,t.basis2,1+i/xi(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new De({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return le(t,e.basis1),fe(t,t,kg*this.view.resolution),ut(t,t,e.origin),ut(t,t,e.basis1),new C({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:n,_cornerC:s,_cornerD:o}=this,r=Pe(this._avgAB,i,n,.5),l=Pe(this._avgBC,n,s,.5),h=Pe(this._avgCD,s,o,.5),u=Pe(this._avgDA,o,i,.5);return[new C({x:i[0],y:i[1],spatialReference:t}),new C({x:n[0],y:n[1],spatialReference:t}),new C({x:s[0],y:s[1],spatialReference:t}),new C({x:o[0],y:o[1],spatialReference:t}),new C({x:r[0],y:r[1],spatialReference:t}),new C({x:l[0],y:l[1],spatialReference:t}),new C({x:h[0],y:h[1],spatialReference:t}),new C({x:u[0],y:u[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,n=this._editGeometryOperations,s=n.data.components[0].vertices,o=dn.fromGeometry(Xe(i,e.spatialReference),Ti.Local).components[0].vertices;s.forEach((r,l)=>{n.setVertexPosition(r,o[l].pos)}),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;t.type==="control-points"&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;"georeference"in this.target&&(this.target.georeference.coords=e),this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach((t,i)=>{this._scaleGraphics[i].geometry=t})}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:t}=this;if("georeference"in t){const s=t.georeference;this._graphic=new Lt({geometry:s.coords}),this._initialControlPoints=s.type==="control-points"?s.controlPoints:null}else this._graphic=t,this._initialGeometry=t.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=wo.fromGeometry(Xe(this._graphic.geometry,e.spatialReference),Ti.Local),this._backgroundGraphic=new Lt({symbol:new Dl({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new Lt({symbol:new Ne({color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map(s=>new Lt({symbol:new Ne({size:6,style:"square",color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s})),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new Rl({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new bg({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map((s,o)=>new Tg({tool:this,view:e,graphic:s,direction:Cg[o],preserveAspectRatio:this._preserveAspectRatio})),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map(s=>s.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this))),U(()=>this.view.scale,()=>this.active?this.updateGraphics():null),e.on("click",async s=>{if(e.activeTool!=null&&e.activeTool!==this)return;const o=Xc(s),r=[];e.map.allLayers.forEach(u=>{u.type!=="vector-tile"&&u.type!=="imagery"||r.push(u)});const l=await this.view.hitTest(o,{exclude:r}),h=l.results;if(h.length===0)e.activeTool=null;else{const u=Sg(l.results),p="georeference"in t,d=h.map(f=>f.type==="media"?f.element:null).filter(Boolean),m=new Set([...this._graphicsLayer.graphics,p?null:t].filter(Boolean));p&&d.includes(t)||u!=null&&m.has(u.graphic)?e.activeTool==null&&(e.activeTool=this):e.activeTool=null}})]);const i=s=>{this.addHandles(s.events.on("grab-changed",o=>{"georeference"in t&&(o.action==="start"?t.opacity*=.5:o.action==="end"&&(t.opacity*=2))}))};this._dragManipulation.forEachManipulator(i),this._rotateManipulation.forEachManipulator(i),this._scaleManipulations.forEach(s=>s.forEachManipulator(i));const n=new Mp;n.addToggle(kt.preserveAspectRatio,()=>{this.preserveAspectRatio==null&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled)}),n.addToggle(kt.rotateIncrements,()=>{this.snapRotation==null&&(this._snapRotation.enabled=!this._snapRotation.enabled)}),n.add(kt.toggleOpacity,()=>{"georeference"in t&&(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)}),n.addToggle(kt.factorModifier,s=>this._factor=s.type==="key-down"?Rg:Pr),n.add(kt.scaleUp,()=>this._scale(this._factor)),n.add(kt.scaleDown,()=>this._scale(-this._factor)),n.add(kt.moveUp,()=>this._move(0,this._factor)),n.add(kt.moveDown,()=>this._move(0,-this._factor)),n.add(kt.moveLeft,()=>this._move(-this._factor,0)),n.add(kt.moveRight,()=>this._move(this._factor,0)),this.addHandles([e.on("key-down",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)}),e.on("key-up",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)})])}async _loadProjectionEngine(){const e=this._graphic.geometry;return ea(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:n}=e,s=this._cornerA;ut(s,n,t),ut(s,s,i);const o=this._cornerB;ut(o,n,t),Et(o,o,i);const r=this._cornerC;Et(r,n,t),Et(r,r,i);const l=this._cornerD;Et(l,n,t),ut(l,l,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){e.action==="start"&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=t.data.geometry.extent?.width,n=(i+e*this.view.resolution)/i,s=t.scale(this._plane.origin,kc,n,n,L.NEW_STEP,nt.REPLACE);this._sharedUndoStack.push({tool:this,operation:s}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations.move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],_t.prototype,"_plane",null),a([c()],_t.prototype,"_backgroundGraphicGeometry",null),a([c()],_t.prototype,"_rotateGraphicGeometry",null),a([c()],_t.prototype,"_scaleGraphicGeometries",null),a([c()],_t.prototype,"preserveAspectRatio",void 0),a([c()],_t.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],_t.prototype,"target",void 0),a([c({readOnly:!0})],_t.prototype,"type",void 0),a([c({constructOnly:!0})],_t.prototype,"view",void 0),_t=a([x("esri.views.2d.interactive.editingTools.TransformTool")],_t);const Ki={redo:"r",undo:"z"};let ne=class extends tt{constructor(e){super(e),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=[],this._sharedRedoStack=[],this._originalOpacity=null,this.activeHandle=0}initialize(){const{view:e,mediaElement:t,preserveAspectRatio:i,snapRotation:n,advancedMode:s}=this;this._originalOpacity=t.opacity,this._transformTool=new _t({target:t,view:e,preserveAspectRatio:i,snapRotation:n}),this._controlPointsTransformTool=new Bt({mediaElement:t,view:e}),this._advancedModeTransformTool=new Bt({mediaElement:s.mediaElement,view:s.view}),this._transformTool.setSharedUndoStack(this._sharedUndoStack),this._transformTool.setSharedRedoStack(this._sharedRedoStack),this._controlPointsTransformTool.setSharedUndoStack(this._sharedUndoStack),this._controlPointsTransformTool.setSharedRedoStack(this._sharedRedoStack),this._advancedModeTransformTool.setSharedUndoStack(this._sharedUndoStack),this._advancedModeTransformTool.setSharedRedoStack(this._sharedRedoStack);const o=t.georeference,r=s.mediaElement.georeference;s.view.tools.addMany([this._advancedModeTransformTool]),"controlPoints"in r&&"controlPoints"in o&&this.addHandles([s.view.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),s.view.on("focus",async l=>{this._controlPointsTransformTool.removeHighlightActiveHandle(),this._advancedModeTransformTool.highlightActiveHandle()}),U(()=>r.controlPoints,l=>{o.controlPoints=l.map(({sourcePoint:h},u)=>({sourcePoint:h,mapPoint:o.controlPoints[u].mapPoint})),this._activeTool?.refresh()}),U(()=>this._controlPointsTransformTool.activeHandle,l=>{this._advancedModeTransformTool.updateActiveHandle(l),this.activeHandle=l}),U(()=>this._advancedModeTransformTool.activeHandle,l=>{this._controlPointsTransformTool.updateActiveHandle(l),this.activeHandle=l})]),this.addHandles([e.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),e.on("focus",async l=>{this._advancedModeTransformTool.removeHighlightActiveHandle(),this._controlPointsTransformTool.highlightActiveHandle()})]),e.tools.addMany([this._transformTool,this._controlPointsTransformTool]),e.activeTool=this._transformTool,this._activeTool=this._transformTool,e.focus()}destroy(){this._transformTool?.destroy(),this._controlPointsTransformTool?.destroy(),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=null,this._sharedRedoStack=null}canUndo(){return this._sharedUndoStack.length>0}canRedo(){return this._sharedRedoStack.length>0}undo(){if(this._sharedUndoStack.length>0){const{tool:e,operation:t}=this._sharedUndoStack.pop();e!==this._activeTool&&e.refresh(),t.undo(),e.updateGraphics(),this._sharedRedoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}redo(){if(this._sharedRedoStack.length>0){const{tool:e,operation:t}=this._sharedRedoStack.pop();e!==this._activeTool&&e.refresh(),t.apply(),e.updateGraphics(),this._sharedUndoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}refresh(){this._activeTool.refresh()}reset(){this._activeTool.reset(),this._advancedModeTransformTool.reset()}async enableAdvancedMode(){this.view.activeTool=this._controlPointsTransformTool,this._activeTool=this._controlPointsTransformTool,this._activeTool.refresh(),await this.advancedMode.view.when(),this.advancedMode.view.activeTool=this._advancedModeTransformTool,this._originalOpacity=this._controlPointsTransformTool.mediaElement.opacity,this._controlPointsTransformTool.mediaElement.opacity=.25*this._originalOpacity}disableAdvancedMode(){this.view.activeTool=this._transformTool,this._activeTool=this._transformTool,this._activeTool.refresh(),this.advancedMode.view.activeTool=null,this._controlPointsTransformTool.mediaElement.opacity=this._originalOpacity}};a([c()],ne.prototype,"activeHandle",void 0),a([c({constructOnly:!0})],ne.prototype,"advancedMode",void 0),a([c()],ne.prototype,"preserveAspectRatio",void 0),a([c()],ne.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],ne.prototype,"mediaElement",void 0),a([c({constructOnly:!0})],ne.prototype,"view",void 0),ne=a([x("esri.views.2d.interactive.editingTools.MediaTransformToolsWrapper")],ne);export{Bt as ControlPointsTransformTool,ai as DrawGraphicTool2D,ne as MediaTransformToolsWrapper,_t as TransformTool}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./calcite-button-Cm9_TJei-DvwKP8jU.js","./themeUtils-YjM7iIiX-DGrOr3vp.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./form-CRSw616T-wY3ZjFlq.js","./dom-N58V0tYi-DBU3jlah.js","./interactive-DqhNilgd-BbTDbq0n.js","./label-Dys24PJn-BCewo2Re.js","./component-CWGf1hug-BASJpoEG.js","./loadable-DbNDKH4r-CSXrQx_7.js","./locale-Cn_GDVD_-CCUxSwPB.js","./key-CZySMiwx-kmS7VeUz.js","./observers-BigwqTsw-CfIXp3Nz.js","./t9n-C_hcZMZJ-Du2NPCXI.js","./icon-BXFbBbop-Bq4Zv26A.js","./loader-Ch7Jr16w-CF4bv9QO.js","./guid-Dls486Er-CBh637k4.js","./calcite-icon-laqhdRBY-8qK5FfMb.js","./calcite-input-BKRd7MCS-BhvpT25V.js","./input2-eOtqu-iO-DiRyHCWP.js","./calcite-dropdown-CLrG397W-Dl2b91G4.js","./floating-ui-DKFFlLv3-8lk8tQD2.js","./debounce-27Hmkkyg-Th7bw3mg.js","./openCloseComponent-BGQ6h7vg-BO0gc3O8.js","./calcite-dropdown-item-DpLfv4A0-CIOTjei7.js","./resources3-Duvedxls-DbbvfBW6.js","./calcite-dropdown-group-0sIPwaDd-DiD7sdrQ.js"])))=>i.map(i=>d[i]); +import{_ as It}from"./main-QGPoLsvl.js";import{v as a,S as c,i as x,ar as _i,e2 as pi,e0 as Ne,w as C,dg as g,i8 as ye,aq as ki,J as ue,I as Ce,ah as U,ax as ke,aA as dt,aL as es,aF as Il,av as $s,L as di,k8 as So,as as Us,i1 as Hs,ay as Ll,dx as Po,bi as Lt,a2 as Y,j as tt,d8 as Gl,P as is,b9 as ns,G as Mr,aY as Ns,aC as Qe,p as vi,l as De,d$ as Dl,eK as li,e as kr,m as fi,aO as Gn,es as Dn,d_ as zl,ag as ss,aw as Mo,d9 as $l,di as fn,j_ as Ul,k9 as Hl,d6 as Nl,b7 as Fl,ka as Zl,dj as Bl,h$ as Yl,kb as Cr,hq as Fe,D as Wl,kc as Xl,bt as ko,$ as ql,az as jl,bx as Rr,dh as Fs,b as Kl,kd as Ql,bp as Vr,aW as os,al as Ar,ke as Jl,kf as Co,et as ze,B as Or,bj as Ir,au as Lr,hZ as pe,bo as Gr,i9 as zn,dn as tc,an as ec,a3 as Dr,r as ic,kg as nc,kh as Ze,ki as sc,kj as oc,kk as rc,kl as Ro,km as ac,jw as zr,il as lc,aG as $r,ae as cc,ih as hc,b1 as uc,kn as pc,i3 as Vo,o as $n,i4 as dc,c3 as Ci,dd as Zs,ko as Bs,h_ as Ao,hh as fc,dc as gc,de as mc,db as yc,kp as _c}from"./story-Doly9N9p.js";import{i as q,j as Ys,A as vc,l as Be,S as _e,y as qt,M as sn,m as Yt,x as xc,g as bc,b as Un,v as Oo,I as Ur,f as Hr,d as wc,E as Tc,P as Ec,O as on,T as Sc,z as Pc,h as Mc,D as Io}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{o as G,_ as kc,e as de,u as Cc,m as Rc,s as Vc}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{S as Ac,R as Oc}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{n as Ws,p as xt,f as Ic}from"./projectVectorToVector-sIYLNlex-DexDhaq1.js";import{x as Lc,f as Nr,m as gn,y as Gc,P as Dc,w as zc,I as $c,g as Uc,Z as Lo}from"./elevationInfoUtils-mOZsPH2J-BlRQDLDN.js";import{N as z,O as rs,L as fe,b as xi,l as le,j as ut,X as Pe,r as Et,R as H,p as Hc,k as pt,v as Fr,y as Z,S as Ot,A as rt,g as ge,w as Go,_ as N,T as Ye,W as Do,G as as,H as zo}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{i as Zr}from"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import Xs from"./GraphicsLayer-DfeGaYc1-DRpZ_f0G.js";import{O as bi,u as rn,E as mn,D as yn,P as Br,h as Nc,c as Fc}from"./geodesicUtils-B8mFUfTk-BNOCxMeb.js";import{simplify as Zc,distance as Bc,geodesicArea as Yc,geodesicLength as Yr}from"./geometryEngine-CdPoFSE4-ChEr_3ja.js";import{U as Wc}from"./Tile-D75RMC64-g8Sx5TPr.js";import{T as Xc,P as Wr,J as qc,Q as we,_ as Xr,u as $o,O as jc}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{Y as Kc,L as Qc}from"./quat-BODLR7mS-BQk2dgMZ.js";import{e as Uo}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{s as Jc,N as We,L as Kt,K as te,P as qs,U as Qt,Q as th,x as _n,D as ft,c as Dt,F as qr,W as eh,m as ih,S as vn,u as nh,b as sh,R as oh,Y as rh,Z as ah,q as lh,G as ch,J as hh,j as uh,A as ph,C as dh,H as fh}from"./ReactiveSet-QxEZenFW-tC7C9rTp.js";import{y as gh,w as mh,A as yh,p as _h,O as vh}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as jr,e as Hn,c as xh}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{i as bh}from"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import{y as at,_ as js,w as Ae,D as Ks,N as $e,g as Kr,B as Ri,$ as Qr,P as ls,c as ii,e as wh,l as Ho,j as Nn,G as Jr,a as Th,O as Eh}from"./plane-Dt8R0KeE-Bqc6oVGz.js";import{U as Sh,z as Ph,k as Mh,w as kh,F as Ch}from"./sphere-BenPORjV-B4uz1SYF.js";import{n as wi}from"./common-CYWrYyJl-E8-sukrT.js";import{c as ta,o as Qs}from"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./MeshTransform-C--IG09w-Bbqagf1g.js";import{t as Rh}from"./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js";import{_ as cs,H as Vh,z as Ah,R as Vi,P as v,F as wt,$ as Oh,k as Js}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{r as Ih}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{m as Lh}from"./earcut-XDcq3zAf-BcwyrT7l.js";import{S as Gh}from"./triangle-hqU-Tc1X-CaBFJROi.js";import{m as Dh,x as zh}from"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import{P as $h}from"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import{l as Ti}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{K as Xe,N as ea,J as Uh}from"./projection-BA9M1R7d-CAbqHZiw.js";import"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import{t as Hh}from"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import{i as ia,f as na}from"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import{q as Nh}from"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import{u as No}from"./cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js";import{p as Fh}from"./projectPointToVector-B2UUY9SE-BIKNGLey.js";import{z as Zh}from"./drapedUtils-BZ1SGPtE-bBUh2hex.js";import{W as Fo}from"./colorUtils-Cthpxcks-cHaMZbaf.js";import{h as Ei,M as Qi,N as xn}from"./boundedPlane-DlvE0eNx-BQ9Xop25.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./geometryEngineBase-DueYg7ux-CCeespPx.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";import"./hydrated-CplJC1Fs-McBHp1Y5.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./signal-CETehA7D-DQA5V72u.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./vec2f32-CVhmN3Me-DxoqVD7C.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./definitions-DJSdSb77-DkoRHaVx.js";import"./enums-DBi1-Mm2-CUS1pvQe.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./lineSegment-CcqvCARM-CDEWcAzV.js";import"./utils-SPbpQbmm-CiwW7WzR.js";function gi(e,t){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.m===t.m}function Fn(e,t,i){return e===t||e!=null&&t!=null&&Qe(e.spatialReference,t.spatialReference)&&li(e.x,t.x,i)&&li(e.y,t.y,i)&&li(e.z??0,t.z??0,i)&&li(e.m??0,t.m??0,i)}function Bh(e){return"declaredClass"in e}function sa(e,t){if(!e)return null;let i;return Bh(e)?e.clone():(i=Ws(e.x,e.y,e.z,e.spatialReference),e.hasM&&(i.m=e.m,i.hasM=!0),i)}var Zo;function oa(e,t,i){return j(e,t,i)}function j(e=0,t=0,i=0){return pe(e,t,i)}function ve(e,t,i){return pe(e,t,i)}function qe(e){const[t,i,n]=e;return e.length>3?[t,i,n,e[3]]:[t,i,n]}function to(e,t,i,n=j()){return n[0]=e.x,n[1]=e.y,n[2]=e.z??0,t==null||(t.type==="2d"?n[2]=0:n[2]=Dc(t,e,i,gn)??0),n}function Yh(e,t,{z:i,m:n},s,o){const{spatialReference:r,elevationInfo:l}=s;let h;i==null&&n==null?h=void 0:t==null||t.type==="2d"?h=i??void 0:h=zc(t,e,r,gn,l)??0;const[u,p]=e;return o?Ic(o,u,p,h,r):o=Ws(u,p,h,r),n!=null&&(o.m=n,o.hasM=!0),o}(function(e){e[e.NONE=0]="NONE",e[e.TARGET=1]="TARGET"})(Zo||(Zo={}));let St=class extends kr{constructor(){super(...arguments),this.enabled=!0}};a([c({type:Boolean})],St.prototype,"enabled",void 0),St=a([x("esri.views.interactive.snapping.Settings.DefaultSnappingAlgorithm")],St);let V=class extends kr{constructor(e){super(e),this.lineSnapper=new St,this.parallelLineSnapper=new St,this.rightAngleSnapper=new St,this.rightAngleTriangleSnapper=new St,this.shortLineThreshold=15,this.distance=5,this.pointThreshold=1e-6,this.intersectionParallelLineThreshold=1e-6,this.parallelLineThreshold=1e-6,this.verticalLineThresholdMeters=.3,this.touchSensitivityMultiplier=1.5,this.pointOnLineThreshold=1e-6,this.orange=new _i([255,127,0]),this.orangeTransparent=new _i([255,127,0,.5]),this.lineHintWidthReference=3,this.lineHintWidthTarget=3,this.lineHintFadedExtensions=.3,this.parallelLineHintWidth=2,this.parallelLineHintLength=24,this.parallelLineHintOffset=1.5,this.rightAngleHintSize=24,this.rightAngleHintOutlineSize=1.5,this.satisfiesConstraintScreenThreshold=1}};a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"lineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"parallelLineSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleSnapper",void 0),a([c({type:St,constructOnly:!0,nonNullable:!0,json:{write:!0}})],V.prototype,"rightAngleTriangleSnapper",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"shortLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:-1,max:50,step:1},json:{write:!0}})],V.prototype,"distance",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"intersectionParallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"parallelLineThreshold",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"verticalLineThresholdMeters",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"touchSensitivityMultiplier",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1e-5},json:{write:!0}})],V.prototype,"pointOnLineThreshold",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orange",void 0),a([c({type:_i,nonNullable:!0})],V.prototype,"orangeTransparent",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthReference",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"lineHintWidthTarget",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:1},json:{write:!0}})],V.prototype,"lineHintFadedExtensions",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:10},json:{write:!0}})],V.prototype,"parallelLineHintWidth",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:50},json:{write:!0}})],V.prototype,"parallelLineHintLength",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"parallelLineHintOffset",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:46},json:{write:!0}})],V.prototype,"rightAngleHintSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:6},json:{write:!0}})],V.prototype,"rightAngleHintOutlineSize",void 0),a([c({type:Number,nonNullable:!0,range:{min:0,max:5},json:{write:!0}})],V.prototype,"satisfiesConstraintScreenThreshold",void 0),V=a([x("esri.views.interactive.snapping.Settings.Defaults")],V);const Zn=new V;var je;(function(e){e[e.FEATURE=1]="FEATURE",e[e.SELF=2]="SELF",e[e.ALL=3]="ALL"})(je||(je={}));let Ai=class{constructor(e,t){this.isDraped=e,this.domain=t}},Wh=class ra extends Ai{constructor(t,i,n=je.ALL){super(i,n),this.intersectionPoint=t}equals(t){return t instanceof ra&&H(this.intersectionPoint,t.intersectionPoint)}},Xh=class aa extends Ai{constructor(t,i,n,s,o=je.ALL,r=!0,l=!0){super(s,o),this.type=t,this.lineStart=i,this.lineEnd=n,this.fadeLeft=r,this.fadeRight=l}equals(t){return t instanceof aa&&this.type===t.type&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)&&this.fadeLeft===t.fadeLeft&&this.fadeRight===t.fadeRight}get length(){return ge(this.lineStart,this.lineEnd)}},qh=class la extends Ai{constructor(t,i,n,s=je.ALL){super(n,s),this.lineStart=t,this.lineEnd=i}equals(t){return t instanceof la&&H(this.lineStart,t.lineStart)&&H(this.lineEnd,t.lineEnd)}},jh=class ca extends Ai{constructor(t,i,n){super(i,n),this.point=t}equals(t){return t instanceof ca&&H(this.point,t.point)}},Kh=class ha extends Ai{constructor(t,i,n,s,o=je.ALL){super(s,o),this.previousVertex=t,this.centerVertex=i,this.nextVertex=n}equals(t){return t instanceof ha&&H(this.previousVertex,t.previousVertex)&&H(this.centerVertex,t.centerVertex)&&H(this.nextVertex,t.nextVertex)}},Qh=class{draw(e,t){const i=Jh(e),n=this.sortUniqueHints(i),s=[];for(const o of n)o instanceof Wh&&s.push(this.visualizeIntersectionPoint(o,t)),o instanceof Xh&&s.push(this.visualizeLine(o,t)),o instanceof qh&&s.push(this.visualizeParallelSign(o,t)),o instanceof Kh&&s.push(this.visualizeRightAngleQuad(o,t)),o instanceof jh&&s.push(this.visualizePoint(o,t));return Gr(s)}sortUniqueHints(e){return e}};function Jh(e){const t=[];for(const i of e){let n=!0;for(const s of t)if(i.equals(s)){n=!1;break}n&&t.push(i)}return t}let tu=class extends Qh{constructor(e){super(),this._graphicsLayer=e,this._symbolPairingsByType=new Map}visualizeIntersectionPoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.intersectionPoint[0],y:e.intersectionPoint[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("intersectionPoint",t.view.effectiveTheme.accentColor))}visualizePoint(e,t){return this._visualizeSnappingIndicator(new C({x:e.point[0],y:e.point[1],spatialReference:t.spatialReference}),this._getOrCreateSymbol("point",t.view.effectiveTheme.accentColor))}visualizeLine(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("line",t.view.effectiveTheme.accentColor))}visualizeParallelSign(e,t){return this._visualizeSnappingIndicator(new fi({paths:[[[...e.lineStart],[...e.lineEnd]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol("parallelSign",t.view.effectiveTheme.accentColor))}visualizeRightAngleQuad(e,t){const i=G(),n=G(),s=g();q(i,e.centerVertex,e.previousVertex),q(n,e.nextVertex,e.previousVertex),vc(s,i,n);const o=`rightAngleQuad${s[2]<0?45:225}`;return this._visualizeSnappingIndicator(new fi({paths:[[[...e.previousVertex],[...e.centerVertex],[...e.nextVertex]]],spatialReference:Gn(ue,t.spatialReference)}),this._getOrCreateSymbol(o,t.view.effectiveTheme.accentColor))}_visualizeSnappingIndicator(e,t){const i=new Lt({geometry:e,symbol:t});return this._graphicsLayer.add(i),Y(()=>{this._graphicsLayer.remove(i)})}_getOrCreateSymbol(e,t){const i=this._symbolPairingsByType;return i.get(e)?.color!==t&&i.set(e,{color:t,symbol:eu(e,t)}),i.get(e).symbol}};function eu(e,t){const i=[...t.toRgb(),255*t.a];switch(e){case"point":return new Ne({outline:{width:.5,color:[0,0,0,1]},size:10,color:t});case"intersectionPoint":return new Ne({outline:new zl({width:1.5,color:t}),size:15,color:[0,0,0,0]});case"line":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:Ac.Butt,joinStyle:Oc.Round,miterLimit:10,width:Dn(Zn.lineHintWidthTarget),color:i}]}}});case"parallelSign":return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,1.5],[7,1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:1,z:0},anchorPointUnits:"Relative",size:5,markerPlacement:{type:"CIMMarkerPlacementOnLine",placePerPart:!0,angleToLine:!0,relativeTo:"LineMiddle"},frame:{xmin:-5,ymin:-1.5,xmax:5,ymax:1.5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[7,0],[-7,0],[-7,-1.5],[7,-1.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:i}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}});case"rightAngleQuad45":case"rightAngleQuad225":{const n=e==="rightAngleQuad45"?45:225;return new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:.5,y:.5,z:0},anchorPointUnits:"Relative",size:Dn(Zn.rightAngleHintSize),rotation:n,markerPlacement:{type:"CIMMarkerPlacementOnVertices",placePerPart:!0,angleToLine:!0,placeOnEndPoints:!1},frame:{xmin:-5,ymin:-5,xmax:5,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[5,-5],[-5,-5],[-5,5],[5,5],[5,-5]]]},symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:Dn(Zn.rightAngleHintOutlineSize),color:i},{type:"CIMSolidFill",enable:!0,color:[...t.toRgb(),255*t.a*.4]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0}]}}})}}}const iu=new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",effects:[{type:"CIMGeometricEffectDashes",dashTemplate:[3.75,3.75],lineDashEnding:"HalfPattern",controlPointEnding:"NoConstraint"}],enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:1.6,color:[255,255,255,255]},{type:"CIMSolidStroke",enable:!0,capStyle:"Butt",joinStyle:"Round",miterLimit:10,width:2,color:[0,0,0,255]}]}}}),nu=new Ne({style:"circle",size:6,color:[127,127,127,1],outline:{color:[50,50,50],width:1}}),su=new Ne({style:"circle",size:6,color:[255,127,0,1],outline:{color:[50,50,50],width:1}});var ht;(function(e){e[e.NeverApplied=0]="NeverApplied",e[e.Applied=1]="Applied",e[e.Undone=2]="Undone"})(ht||(ht={}));var Gt;(function(e){e.UndoRedoUpdating="UndoRedoUpdating",e.UndoInvalidError="UndoInvalidError",e.RedoInvalidError="RedoInvalidError",e.ApplyInvalidError="ApplyInvalidError"})(Gt||(Gt={}));const bn={[Gt.UndoRedoUpdating]:"Cannot perform operation whilst undo redo is updating",[Gt.UndoInvalidError]:"There are no items to Undo",[Gt.RedoInvalidError]:"There are no items to Redo",[Gt.ApplyInvalidError]:"Cannot apply an item that is already applied"};let ni=class extends Error{constructor(){super(bn[Gt.UndoRedoUpdating]),this.type="undo-redo-updating-error"}},hs=class extends Error{constructor(){super(bn[Gt.UndoInvalidError]),this.type="undo-redo-undo-error"}},Bo=class extends Error{constructor(){super(bn[Gt.RedoInvalidError]),this.type="undo-redo-redo-error"}},ou=class extends Error{constructor(){super(bn[Gt.ApplyInvalidError]),this.type="undo-redo-apply-error"}};var Xt;(function(e){e[e.Apply=0]="Apply",e[e.Undo=1]="Undo",e[e.Redo=2]="Redo"})(Xt||(Xt={}));let Di=class extends tt{constructor(){super(...arguments),this.name="",this.tag=Symbol(),this.status=ht.NeverApplied}get canUndo(){return this.status===ht.Applied}get canRedo(){return this.status===ht.Undone}async executeUndoRedoOperation(e){switch(e){case Xt.Apply:if(this.status!==ht.NeverApplied)throw new ou;return await this.apply(),void(this.status=ht.Applied);case Xt.Undo:if(this.status!==ht.Applied)throw new hs;return await this.undo(),void(this.status=ht.Undone);case Xt.Redo:if(this.status!==ht.Undone)throw new hs;return await this.redo(),void(this.status=ht.Applied)}}};a([c()],Di.prototype,"name",void 0),a([c()],Di.prototype,"tag",void 0),Di=a([x("esri.undoredo.UndoableOperation")],Di);let Ct=class extends tt{constructor(){super(...arguments),this._stack=new ss,this._stackPosition=-1,this._updatingHandles=new Zr}get updating(){return this._updatingHandles.updating}get canUndo(){return this.hasUndo&&!this.updating}get hasUndo(){return this._stackPosition>=0}get canRedo(){return this.hasRedo&&!this.updating}get hasRedo(){return this._stackPositione.destroy())}_drainStack(){this._stack.drain(e=>e.destroy()),this._stackPosition=-1}async undo(){if(!this.hasUndo)throw new hs;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition);e&&await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Undo),--this._stackPosition,e.canRedo||this._truncateForwardStack()})())}async redo(){if(!this.hasRedo)throw new Bo;if(this.updating)throw new ni;const e=this._stack.getItemAt(this._stackPosition+1);if(!e)throw new Bo;await this._updatingHandles.addPromise((async()=>{await e.executeUndoRedoOperation(Xt.Redo),++this._stackPosition})())}peekUndo(){if(this.canUndo)return this._stack.getItemAt(this._stackPosition)}peekRedo(){if(this.canRedo)return this._stack.getItemAt(this._stackPosition+1)}async inject(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),e.canUndo?(this._stack.splice(this._stackPosition+1,0,e),this._stackPosition++):this._stackPosition>-1&&(this._stack.splice(0,this._stackPosition+1).forEach(t=>t.destroy()),this._stackPosition=-1)})())}async add(e){if(this.updating)throw new ni;await this._updatingHandles.addPromise((async()=>{e.status===ht.NeverApplied&&await e.executeUndoRedoOperation(Xt.Apply),this._stackPosition>=-1&&this._truncateForwardStack(),e.canUndo?(this._stack.push(e),this._stackPosition=this._stack.length-1):this._drainStack()})())}async removeTagged(e,t=!1){if(this.updating&&!t)return;await Mo(()=>!this.updating);const i=new ss;for(let n=0;ni.length-1&&(this._stackPosition=i.length-1)}async clear(e=!1){if(this.updating&&!e)throw new ni;await Mo(()=>!this.updating),this._drainStack()}};a([c()],Ct.prototype,"_stack",void 0),a([c()],Ct.prototype,"_stackPosition",void 0),a([c()],Ct.prototype,"updating",null),a([c({readOnly:!0})],Ct.prototype,"canUndo",null),a([c({readOnly:!0})],Ct.prototype,"hasUndo",null),a([c({readOnly:!0})],Ct.prototype,"canRedo",null),a([c({readOnly:!0})],Ct.prototype,"hasRedo",null),Ct=a([x("esri.UndoRedo")],Ct);function eo(){return uc()}function ru(){return $l()}function Si(e,t){const i=[];e=(e=(e=e.replaceAll(/[\u00B0\u00BA]/g,"^")).replaceAll("′","'")).replaceAll("″",'"');const n=cu(t);return pc.dmsToGeog(n,1,[e],i)?new C(i[0][0],i[0][1],ue.WGS84):null}function au(e){return e&&eo()?Ze(e)??Si(`0° 0' 0" N | ${e}`)?.longitude??Si(`0 | ${e}`)?.longitude??null:null}function lu(e){return e&&eo()?Ze(e)??Si(`${e} | 0° 0' 0" E`)?.latitude??Si(`${e} | 0`)?.latitude??null:null}function cu(e){let t=null;if(e||(e=ue.WGS84),e.wkid){if(t=Vo.geogcs(e.wkid),!t)throw new $n("coordinate-formatter:invalid-spatial-reference","wkid is not valid")}else{if(!e.wkt2&&!e.wkt)throw new $n("coordinate-formatter:invalid-spatial-reference","wkid and wkt are missing");if(t=Vo.fromString(dc.PE_TYPE_GEOGCS,e.wkt2||e.wkt),!t)throw new $n("coordinate-formatter:invalid-spatial-reference","wkt is not valid")}return t}let hu=class{constructor(){this.committedVertices=null,this.cursorVertex=null,this.full=null,this.outline=null,this.cursorEdge=null,this.circle=null,this.rectangle=null}};var us;let se=us=class extends De{constructor(e){super(e),this.center=null,this.geodesic=!1,this.numberOfPoints=60,this.radius=1e3,this.radiusUnit="meters"}initialize(){const e=this.center,t=this.numberOfPoints;if(this.hasZ=e?.hasZ??!1,this.rings.length!==0||!e)return;const i=fn(this.radius,this.radiusUnit,"meters"),n=e.spatialReference;let s,o="geographic";if(n.isWebMercator?o="webMercator":((n.wkid&&Ul[n.wkid])!=null||(n.wkt2||n.wkt)&&Hl(n.wkt2||n.wkt))&&(o="projected"),this.geodesic){let r;switch(o){case"webMercator":r=Nl(e);break;case"projected":console.error("Creating a geodesic circle requires the center to be specified in web mercator or geographic coordinate system");break;case"geographic":r=e}s=this._createGeodesicCircle(r,i,t),o==="webMercator"&&(s=Fl(s))}else{let r;o==="webMercator"||o==="projected"?r=i/Zl(e.spatialReference):o==="geographic"&&(r=Bl(i,"meters",Yl(e.spatialReference).radius)),s=this._createPlanarCircle(e,r,t)}this.spatialReference=s.spatialReference,this.addRing(s.rings[0])}clone(){const{center:e,numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s}=this;return new us({center:e?.clone(),numberOfPoints:t,radius:i,radiusUnit:n,geodesic:s})}_createGeodesicCircle(e,t,i){let n=0;const s=[];for(;n<360;){const o=[0,0],r=[e.x,e.y];bi(o,r,n,t,ue.WGS84),this.hasZ&&o.push(e.z),s.push(o),n+=360/i}return s.push(s[0]),new De({rings:[s]})}_createPlanarCircle(e,t,i){const n=[],s=2*Math.PI/i;for(let o=0;othis.mapToLocal(t)).filter(ki)}get doUnnormalization(){return!1}},pu=class extends ua{constructor(e,t,i=null){super(t),this._defaultZ=i,this.transform=$o(),this.transformInv=$o(),this.transform=jc(e),Wc(this.transformInv,this.transform)}makeMapPoint(e,t){return an(e,t,this._defaultZ)}mapToLocal(e){return k(this.transform[0]*e[0]+this.transform[2]*e[1]+this.transform[4],this.transform[1]*e[0]+this.transform[3]*e[1]+this.transform[5])}localToMap(e){return an(this.transformInv[0]*e.x+this.transformInv[2]*e.y+this.transformInv[4],this.transformInv[1]*e.x+this.transformInv[3]*e.y+this.transformInv[5],this._defaultZ)}},du=class extends ua{constructor(e,t){super(e.spatialReference),this.view=e,this.defaultZ=null,this.pWS=g(),this.tangentFrameUpWS=g(),this.tangentFrameRightWS=g(),this.tangentFrameForwardWS=g(),this.localFrameRightWS=g(),this.localFrameUpWS=g(),this.worldToLocalTransform=Uo(),this.localToWorldTransform=Uo(),this.scale=1,this.scale=e.resolution,this.referenceMapPoint=t,this.defaultZ=t.hasZ?t.z:null;const i=e.state.camera.viewRight;this.view.renderCoordsHelper.toRenderCoords(this.referenceMapPoint,this.pWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.X,this.tangentFrameRightWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Y,this.tangentFrameUpWS),this.view.renderCoordsHelper.worldBasisAtPosition(this.pWS,zn.Z,this.tangentFrameForwardWS);const n=g();fe(n,this.tangentFrameForwardWS,Z(i,this.tangentFrameForwardWS)),Et(this.localFrameRightWS,i,n),le(this.localFrameRightWS,this.localFrameRightWS),Ot(this.localFrameUpWS,this.tangentFrameForwardWS,this.localFrameRightWS),Kc(this.worldToLocalTransform,this.localFrameRightWS,this.tangentFrameRightWS),Qc(this.localToWorldTransform,this.worldToLocalTransform)}get doUnnormalization(){return this.view.viewingMode==="global"}makeMapPoint(e,t){return an(e,t,this.defaultZ)}mapToLocal(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e[0],y:e[1],spatialReference:this.spatialReference}),t),Go(t,t,this.worldToLocalTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?k(i.x/this.scale,i.y/this.scale):null}localToMap(e){const t=g();this.view.renderCoordsHelper.toRenderCoords(new C({x:e.x*this.scale,y:e.y*this.scale,spatialReference:this.spatialReference}),t),Go(t,t,this.localToWorldTransform);const i=this.view.renderCoordsHelper.fromRenderCoords(t,new C({spatialReference:this.view.spatialReference}));return i!=null?an(i.x,i.y,this.defaultZ):null}};function fu(e,t){if(e.type==="2d")return new pu(e.state.transform,e.spatialReference,t.length>2?t[2]:null);if(e.type==="3d"){const i=t.length>2?new C({x:t[0],y:t[1],z:t[2],spatialReference:e.spatialReference}):new C({x:t[0],y:t[1],spatialReference:e.spatialReference});return new du(e,i)}return null}function Me(e,t){const i=new C({x:e[0],y:e[1],spatialReference:t});return e.length>2&&(i.z=e[2]),i}function gu(e,t){return new Mr({points:e,spatialReference:t})}function Yo(e,t,i){const n=new fi({paths:e,spatialReference:t});return i&&Cr(n),n}function Oi(e,t,i,n=!0){const s=is(e);s.forEach(r=>{const l=r[0],h=r[r.length-1];Fe(l,h)&&r.length!==1||r.push(r[0])});let o=new De({rings:s,spatialReference:t});return o.rings.forEach(r=>{Wl(r)||r.reverse()}),i&&Cr(o),n&&o.isSelfIntersecting&&Ns(t)&&(o=Zc(o)),o}function Wo(e,t,i){const n=t.mapToLocalMultiple(e),s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y},l=Math.round(r.x-o.x),h=Math.round(r.y-o.y),u=Math.max(Math.abs(l),Math.abs(h));if(i){const p={x:o.x+u,y:o.y+u},d={x:o.x-u,y:o.y-u};s.push(k(p.x,d.y),k(d.x,d.y),k(d.x,p.y),k(p.x,p.y))}else{const p={x:l>0?o.x+u:o.x-u,y:h>0?o.y+u:o.y-u};s.push(k(o.x,o.y),k(p.x,o.y),k(p.x,p.y),k(o.x,p.y))}return pa(Oi([s.map(p=>t.localToMap(p)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function mu(e,t,i){let n=t.mapToLocalMultiple(e);if(n.length===1){const l=n[0];n=[k(l.x-48,l.y+48),k(l.x+48,l.y-48),k(l.x+48,l.y-48),k(l.x-48,l.y+48)]}const s=[],o={x:n[0].x,y:n[0].y},r={x:n[1].x,y:n[1].y};if(i){const l=Math.round(r.x-o.x),h=Math.round(r.y-o.y);s.push(k(o.x-l,o.y-h),k(r.x,o.y-h),k(r.x,r.y),k(o.x-l,r.y))}else s.push(k(o.x,o.y),k(r.x,o.y),k(r.x,r.y),k(o.x,r.y));return pa(Oi([s.map(l=>t.localToMap(l)).filter(ki)],t.spatialReference,t.doUnnormalization,!0),s,t)}function pa(e,t,i){const n=zi(t[3],t[2],i),s=zi(t[1],t[2],i),o=zi(t[0],t[1],i),r=zi(t[0],t[3],i);return{geometry:e,midpoints:n!=null&&s!=null&&o!=null&&r!=null?{top:n,right:s,bottom:o,left:r}:null}}function zi(e,t,i){Re[0]=e.x,Re[1]=e.y,Re[2]=0,Ve[0]=t.x,Ve[1]=t.y,Ve[2]=0,Pe(Re,Re,Ve,.5),$i.x=Re[0],$i.y=Ve[1],$i.z=Ve[2];const n=i.localToMap($i);return n!=null?Me(n,i.spatialReference):null}const $i=k(0,0,0),Re=g(),Ve=g();function Xo(e,t,i,n){const s=t.mapToLocalMultiple(e);let o=null,r=null;if(i)o=s[0],r=s[1];else{const _=s[0],y=s[1],w=Math.round(y.x-_.x),b=Math.round(y.y-_.y),S=Math.max(Math.abs(w),Math.abs(b));o=k(w>0?_.x+S/2:_.x-S/2,b>0?_.y+S/2:_.y-S/2),r=k(Math.abs(w)>Math.abs(b)?o.x-S/2:o.x,Math.abs(w)>Math.abs(b)?o.y:o.y-S/2)}const l=t.localToMap(o),h=t.localToMap(r);if(l==null||h==null)return null;t.doUnnormalization&&Xl([[l,h]],t.spatialReference);const u=Me(l,t.spatialReference),p=Me(h,t.spatialReference),d=vi(t.spatialReference);let m=0;if(Ns(t.spatialReference))m=d*Bc(u,p,null);else{const _=o.x-r.x,y=o.y-r.y;m=d*Math.sqrt(_*_+y*y)*1}const f=new uu({center:u,radius:m,radiusUnit:"meters",spatialReference:t.spatialReference});return{geometry:Oi(f.rings,f.spatialReference,!1),center:u,edge:p}}function yu(e,t,i){const n=t.mapToLocalMultiple(e),s=n[0],o=n[1],r=Math.round(o.x-s.x),l=Math.round(o.y-s.y),h=k(i?s.x:s.x+r/2,i?s.y:s.y+l/2),u=i?r:r/2,p=i?l:l/2,d=60,m=[],f=2*Math.PI/d;function _(W){const gt=Math.cos(W),lt=Math.sin(W);return k(u*gt+h.x,p*lt+h.y)}for(let W=0;Wt.localToMap(W)).filter(ki)],y,w,!1),S=t.localToMap(_(Math.PI/2)),I=t.localToMap(_(0)),K=t.localToMap(_(-Math.PI/2)),et=t.localToMap(_(Math.PI));return{geometry:b,midpoints:S!=null&&I!=null&&K!=null&&et!=null?{top:Me(S,y),right:Me(I,y),bottom:Me(K,y),left:Me(et,y)}:null}}function io(e,t){switch(e){case"point":case"multipoint":return _u();case"polyline":return vu(t);case"polygon":return xu(t);default:return}}function _u(e){return"point"}function vu(e){return(e!=null&&e.type==="polyline"&&e.paths.length?e.paths[0].length:0)<2?"polylineZeroVertices":"polylineOneVertex"}function xu(e){const t=e!=null&&e.type==="polygon"&&e.rings.length?e.rings[0].length:0;return t<3?"polylineZeroVertices":t<4?"polygonOneVertex":"polygonTwoVertices"}function bu(e,t){const i=e?.geometry;if(!e||i?.type!=="mesh"||!t)return;const{renderCoordsHelper:n,elevationProvider:s}=t,{camera:o}=t.state,{extent:r}=i,{center:l,spatialReference:h}=r,u=vi(h),p=Fs(h),d=vi(n.spatialReference),m=r.width*u,f=r.height*p,_=(r.zmax??0)*p,y=_-(r.zmin??0)*p,w=Math.max(m,f,y)/d,{x:b,y:S}=l,I=l.z??0;N(Ui,b,S,I),n.toRenderCoords(Ui,h,Ui);const K=w/o.computeScreenPixelSizeAt(Ui);if(K>o.width*Tu)return"meshTooClose";if(K=0){if(d>=0||t.type===O.LINE)return[qt(ln,i,r,p)]}else if(e.type===O.LINE&&(d>=0||t.type===O.LINE))return[qt(ln,i,r,p)];return[]}function Pu(e,t,i){const n=[],s=q(da,e.end,e.start),o=q(fa,e.start,t),r=Be(s),l=2*_e(s,o),h=l*l-4*r*(Be(o)-i*i);if(h===0){const u=-l/(2*r);(e.type===O.LINE||u>=0)&&n.push(qt(ln,e.start,s,u))}else if(h>0){const u=Math.sqrt(h),p=(-l+u)/(2*r);(e.type===O.LINE||p>=0)&&n.push(qt(ln,e.start,s,p));const d=(-l-u)/(2*r);(e.type===O.LINE||d>=0)&&n.push(qt(ga,e.start,s,d))}return n}var O;(function(e){e[e.RAY=0]="RAY",e[e.LINE=1]="LINE"})(O||(O={}));const Mu=1e-6,da=G(),fa=G(),ga=G(),ln=G();function no({start:e,end:t,type:i},n,s){const o=[],r=q(Ii,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===bt.PLANE||d>=0)&&o.push(qt(G(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===bt.PLANE||m>=0)&&o.push(qt(G(),e,r,m));const f=(-u-d)/(2*h);(i===bt.PLANE||f>=0)&&o.push(qt(G(),e,r,f))}return o}function ma(e,t){const i=e.start,n=e.end,s=q(Ii,n,i),o=N(En,-s[1],s[0],0),r=t.start,l=t.end,h=pt(oo,l,r),u=Z(h,o),p=N(Ea,i[0],i[1],0),d=pt(Sa,p,r),m=Z(d,o),f=wi();if(Math.abs(u)de(i,n))}function _a(e,t,i){return xa(e,cn(ro,e[2],t),i)}function va(e,t,i,n=g()){const s=q(Ii,e,t),o=Mc(s);return qt(n,t,s,o===0?1:i/o),n[2]=e[2],n}function xa(e,{start:t,end:i,type:n},s=g()){const o=pt(Tn,e,t),r=pt(En,i,t),l=Z(o,r)/Z(r,r);return z(s,t,r,n===O.RAY?Math.max(l,0):l)}const Cu=(()=>{const e=g(),t=g(),i=g();return({start:n,end:s},{center:o,radius:r,normal:l,slicePlane:h})=>{const u=Ri(o,l,Ou);if(R(ls(u,n),0)&&R(ls(u,s),0)){Qr(l,e,t);const d=(_,y)=>(Et(i,y,o),Yt(_,Z(i,e),Z(i,t)),_),m=Pu({start:d(Ii,n),end:d(wn,s),type:O.LINE},Vc,r),f=[];for(const[_,y]of m){const w=rt(g(),o);z(w,w,e,_),z(w,w,t,y),h&&!me(h,w)||f.push(w)}return f}const p=g();return js(u,n,s,p)?!R(ge(p,o),r)||h&&!me(h,p)?[]:[p]:[]}})();function ba({start:e,end:t,type:i},n,s){const o=[],r=Et(Tn,t,e),l=q(wn,e,n),h=Be(r),u=2*_e(r,l),p=u*u-4*h*(Be(l)-s*s);if(p===0){const d=-u/(2*h);(i===O.LINE||d>=0)&&o.push(z(g(),e,r,d))}else if(p>0){const d=Math.sqrt(p),m=(-u+d)/(2*h);(i===O.LINE||m>=0)&&o.push(z(g(),e,r,m));const f=(-u-d)/(2*h);(i===O.LINE||f>=0)&&o.push(z(g(),e,r,f))}return o}function wa(e,t){const i=e.start,n=e.end,s=t.start,o=t.end,r=pt(Tn,n,i),l=pt(En,o,s),h=pt(oo,s,i),u=Ot(Ea,r,l);if(!R(Z(h,u),0))return[];const p=as(u);if(R(p,0))return[];const d=Ot(Sa,h,l),m=Z(d,u)/p,f=z(Pa,i,r,m);if(e.type===O.RAY){const _=pt(ps,f,i);if(Z(r,_)<-wi())return[]}if(t.type===O.RAY){const _=pt(ps,f,s);if(Z(l,_)<-wi())return[]}return[ye(f)]}function Ru({start:e,end:t,type:i},n){const s=pt(Tn,n,e),o=pt(En,t,e),r=Ot(oo,o,s),l=as(r)/as(o),h=wi();if(lt+n)return[];if(dme(e,i))}function me(e,t){return Kr(e,t)}var bt;(function(e){e[e.PLANE=0]="PLANE",e[e.HALF_PLANE=1]="HALF_PLANE"})(bt||(bt={}));const Au={[bt.PLANE]:O.LINE,[bt.HALF_PLANE]:O.RAY},Ii=G(),wn=G(),Tn=g(),En=g(),oo=g(),Ea=g(),Sa=g(),Pa=g(),ps=g(),Ou=at(),ro={start:g(),end:g(),type:O.LINE},Iu={start:g(),end:g(),type:O.LINE};class Tt{intersect(t){return Ut(this,t)}closestPoints(t){return[this.closestTo(t)]}}class Je extends Tt{constructor(t){super(),this.point=t}equals(t){return this===t||vt(t)&&H(this.point,t.point)}closestTo(){return qe(this.point)}}class ao extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.lineLike={start:t,end:i,type:n}}equals(t){return this===t||Rt(t)&&this.lineLike.type===t.lineLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return xa(t,this.lineLike,i),i}}class Ma extends ao{constructor(t,i){super(t,i,O.LINE)}}class Lu extends ao{constructor(t,i){super(t,i,O.RAY)}}class ka extends Tt{constructor(t){super(),this.constraints=t}equals(t){return this===t||ds(t)&&Fe(this.constraints,t.constraints,(i,n)=>i.equals(n))}closestTo(t){let i,n=1/0;for(const s of this.constraints){const o=s.closestTo(t),r=Hc(t,o);ri===this?[]:i.closestPoints(t))}}class Ca extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||At(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i}}class lo extends Tt{constructor(t,i){super(),this.center=t,this.radius=i}equals(t){return this===t||Nt(t)&&H(this.center,t.center)&&this.radius===t.radius}closestTo(t){const i=j();return va(t,this.center,this.radius,i),i[2]=this.center[2],i}asCircle(){return new co(qe(this.center),this.radius,ve(0,0,1))}}class co extends Tt{constructor(t,i,n,s=void 0){super(),this.center=t,this.radius=i,this.normal=n,this.slicePlane=s}equals(t){return this===t||oe(t)&&H(this.center,t.center)&&H(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:i,radius:n}=this;Ks(this.getPlane(Gu),t,Yn);const s=pt(Yn,Yn,i),o=Fr(s);if(R(o,0))return qe(t);const r=n/Math.sqrt(o),l=j();z(l,i,s,r);const{slicePlane:h}=this;return h&&!me(h,l)?uo(h,this)?.closestTo(t)??qe(t):l}getPlane(t=at()){return Ri(this.center,this.normal,t)}}const Yn=g(),Gu=at();class Ra extends Tt{constructor(t){super(),this.z=t}equals(t){return this===t||Ht(t)&&this.z===t.z}closestTo(t){return ve(t[0],t[1],this.z)}getPlane(t=at()){return N(qo,0,0,this.z),Ri(qo,Hs,t)}}const qo=g();class Va extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.planeLike={start:t,end:i,type:n}}equals(t){return this===t||Vt(t)&&this.planeLike.type===t.planeLike.type&&H(this.start,t.start)&&H(this.end,t.end)}closestTo(t){const i=j();return _a(t,this.planeLike,i),i}closestEndTo(t){const{start:i,end:n}=this.planeLike;return Math.sign(_e(q(Du,n,i),q(zu,t,i)))>0?this.end:this.start}getPlane(t=at()){const i=rt(jo,this.end);return i[2]+=1,Jr(this.start,this.end,i,t)}getSlicePlane(t=at()){const{start:i,end:n,type:s}=this.planeLike;if(s===bt.PLANE)return;const o=N(jo,i[0],i[1],0),r=N(Ko,n[0],n[1],0),l=Et(Ko,r,o);return Ri(o,l,t),t}}const Du=G(),zu=G(),jo=g(),Ko=g();class $u extends Va{constructor(t,i){super(t,i,bt.HALF_PLANE)}}class Uu extends Tt{constructor(t,i){super(),this.sphere=Ph(t,i)}equals(t){return this===t||Ft(t)&&Mh(this.sphere,t.sphere)}closestTo(t){const i=j();return kh(this.sphere,t,i),i}get center(){return Ch(this.sphere)}get radius(){return this.sphere[3]}}class Hu extends Tt{constructor(t,i,n){super(),this.start=t,this.end=i,this.getZ=n,this.planeLike={start:t,end:i,type:bt.PLANE}}equals(t){return this===t||hn(t)&&H(this.start,t.start)&&H(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return Bu(this,t)}addIfOnTheGround(t,i){for(const n of i){const s=this.getZ(n[0],n[1])??0;R(n[2],s)&&(n[2]=s,t.push(n))}}}class ho extends Tt{constructor(t,i,n){super(),this._x=t,this._y=i,this._z=n}equals(t){return this===t||ap(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,i,n]){return oa(this._x??t,this._y??i,this._z??n)}}class Aa extends Tt{constructor(t,i,n,s,o){super(),this._origin=t,this._spatialReference=i,this._distanceMeters=n,this._z=s,this._directionDegrees=o}equals(t){return this===t||rp(t)&&Io(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,i,n]){return Yt(si,t,i),Io(si,this._origin)||this._applyDirectionAndDistance(si),oa(si[0],si[1],this._z??n)}_applyDirectionAndDistance(t){if(this._directionDegrees!=null&&this._distanceMeters!=null)bi(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(this._directionDegrees!=null)Fu(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(this._distanceMeters!=null){const{azimuth:i}=mn(Nu,this._origin,t,this._spatialReference);bi(t,this._origin,i??0,this._distanceMeters,this._spatialReference)}}}const si=[0,0],Nu=new yn;function Fu(e,t,i,n,s){let{azimuth:o,distance:r}=mn(Zu,t,n,s);o??=0;let l=r*Math.cos((o-i)*bh);l=Math.max(0,l),bi(e,t,i,l,s)}const Zu=new yn;function Bu(e,t){const i=j();return _a(t,e.planeLike,i),i[2]=e.getZ(i[0],i[1])??Ia,i}function Ut(e,t){if(ds(e)){const i=[];for(const n of e.constraints){const s=n.intersect(t);s&&i.push(s)}return Li(i)}if(ds(t))return Ut(t,e);if(hn(e))return Qo(e,t);if(hn(t))return Qo(t,e);if(vt(e)){const{point:i}=e;if(vt(t))return H(i,t.point)?e:void 0;const n=t.closestTo(i);return Ye(n,i)?e:void 0}if(Rt(e)){if(vt(t))return Ut(t,e);if(Rt(t))return Pt(wa(e.lineLike,t.lineLike));if(Ht(t))return Yu(e,t);if(Vt(t))return Pt(ma(t.planeLike,e.lineLike));if(At(t))return Pt(ba(e.lineLike,t.center,t.radius));if(oe(t))return Pt(Cu(e.lineLike,t));if(Nt(t))return Wu(e,t);if(Ft(t))return Xu(e,t)}else if(Ht(e)){if(vt(t)||Rt(t))return Ut(t,e);if(Ht(t))return qu(e,t);if(Vt(t))return ju(e,t);if(At(t))return Ku(e,t);if(oe(t))return Ju(e,t);if(Nt(t))return Qu(e,t);if(Ft(t))return tp(e,t)}else if(Vt(e)){if(vt(t)||Rt(t)||Ht(t))return Ut(t,e);if(Vt(t))return Wn(ya(e.planeLike,t.planeLike));if(At(t))return Wn(no(e.planeLike,t.center,t.radius));if(oe(t))return ip(e,t);if(Nt(t))return ep(e,t);if(Ft(t))return np(e,t)}else if(At(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t))return Ut(t,e);if(At(t))return Wn(so(e.center,e.radius,t.center,t.radius));if(oe(t))return;if(Nt(t))return sp(e,t);if(Ft(t))return}else if(oe(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t))return Ut(t,e);if(oe(t))return;if(Nt(t))return t.asCircle(),void 0;if(Ft(t))return}else if(Nt(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||oe(t))return Ut(t,e);if(Nt(t))return op(t,e);if(Ft(t))return}else if(Ft(e)){if(vt(t)||Rt(t)||Ht(t)||Vt(t)||At(t)||Nt(t))return Ut(t,e);if(Ft(t))return}}const Yu=(()=>{const e=at();return(t,i)=>{const{start:n,end:s}=t;if(Ta(n,s)&&R(n[2],i.z))return t;const o=j();return js(i.getPlane(e),n,s,o)?new Je(o):void 0}})();function Wu({lineLike:e},{center:t,radius:i}){const n=t[2];return Pt(ba(e,t,i).filter(s=>R(s[2],n)))}function Xu({lineLike:e},{sphere:t}){return Pt(Sh(t,e.start,e.end))}const uo=(()=>{const e=jr(),t=g(),i=g();return(n,s,o)=>{const{normal:r,center:l,radius:h}=s;Qr(r,t,i);const u=$e(n),p=h*Z(u,t),d=h*Z(u,i);gh(e,l[0],l[1],l[2],1);const m=mh(n,e),f=Math.hypot(p,d),_=R(f,0);if(R(ls(n,l),0)){if(_)return s;if(R(h,0))return!o||me(o,l)?new Je(qe(l)):void 0;Ot(t,u,r),le(t,t);const W=new Array,gt=ye(l);z(gt,gt,t,h),o&&!me(o,gt)||W.push(gt);const lt=ye(l);return z(lt,lt,t,-h),o&&!me(o,lt)||W.push(lt),Pt(W)}if(_)return;const y=-m/f;if(Math.abs(y)>1||R(y,1))return;const w=Math.atan(p/d),b=tc(y)-w,S=Math.PI-b,I=new Array,K=g();z(K,l,t,h*Math.cos(b)),z(K,K,i,h*Math.sin(b)),I.push(K);const et=g();return z(et,l,t,h*Math.cos(S)),z(et,et,i,h*Math.sin(S)),I.push(et),Pt(o?Vu(o,I):I)}})();function qu(e,t){return R(e.z,t.z)?e:void 0}function ju({z:e},{planeLike:t}){const[i,n]=t.start,[s,o]=t.end,r=ve(i,n,e),l=ve(s,o,e);return t.type===bt.PLANE?new Ma(r,l):new Lu(r,l)}function Ku(e,t){const[i,n]=t.center;return new lo(ve(i,n,e.z),t.radius)}function Qu(e,t){return R(t.center[2],e.z)?t:void 0}const Ju=(()=>{const e=at();return(t,i)=>uo(t.getPlane(e),i,i.slicePlane)})();function tp(e,{center:t,radius:i}){const n=Math.abs(t[2]-e.z);if(n>i&&!R(n,i))return;const s=ve(t[0],t[1],e.z),o=Math.sqrt(i**2-n**2);return R(o,0)?void 0:new lo(s,o)}const ep=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=no(t.planeLike,i,n),o=i[2];t.getSlicePlane(e);const r=new Array;for(const[l,h]of s){const u=[l,h,o];me(e,u)&&r.push(u)}return Pt(r)}})(),ip=(()=>{const e=at(),t=at();return(i,n)=>uo(i.getPlane(e),n,i.getSlicePlane(t))})(),np=(()=>{const e=at();return(t,{center:i,radius:n})=>{const s=t.getPlane(e),o=Ae(s,i),r=Math.abs(o);if(r>n&&!R(r,n))return;const l=Math.sqrt(n**2-o**2);if(R(l,0)){const p=j();return Ks(s,i,p),new Je(p)}const h=j(),u=ye($e(s));return z(h,i,u,o),new co(h,l,u,t.getSlicePlane())}})();function sp(e,t){const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?t:Oa(so(e.center,e.radius,t.center,t.radius),t.center[2])}function op(e,t){if(!Ta(e.center,t.center))return;const i=sn(e.center,t.center);return R(i,0)&&R(e.radius,t.radius)?e:Oa(so(e.center,e.radius,t.center,t.radius),e.center[2])}function Qo(e,t){const{planeLike:i,getZ:n}=e,s=new Array;if(vt(t))e.addIfOnTheGround(s,ku(i,t.point));else if(Rt(t))e.addIfOnTheGround(s,ma(i,t.lineLike));else if(At(t))for(const[o,r]of no(i,t.center,t.radius)){const l=n(o,r);l!=null&&s.push(pe(o,r,l))}else if(Vt(t)||hn(t))for(const[o,r]of ya(i,t.planeLike)){const l=n(o,r)??Ia;s.push(pe(o,r,l))}return Pt(s)}function Wn(e){return Li(e.map(([t,i])=>{const n=ve(t,i,0),s=ve(t,i,1);return new Ma(n,s)}))}function Pt(e){return Li(e.map(t=>t?new Je(t):void 0))}function Oa(e,t){return Pt(e.map(([i,n])=>[i,n,t]))}function Li(e){if(e.length!==0)return e.length===1?e[0]??void 0:new ka(e.filter(ki))}function ds(e){return e instanceof ka}function vt(e){return e instanceof Je}function Rt(e){return e instanceof ao}function Ht(e){return e instanceof Ra}function Vt(e){return e instanceof Va}function At(e){return e instanceof Ca}function Nt(e){return e instanceof lo}function oe(e){return e instanceof co}function Ft(e){return e instanceof Uu}function hn(e){return e instanceof Hu}function rp(e){return e instanceof Aa}function ap(e){return e instanceof ho}const Ia=0;var A;function po(e,t){if(e==null||t==null)return;const i=fs(e,t);return i!=null?Dt(i,"radians","geographic"):void 0}(function(e){e.Absolute="absolute",e.Relative="relative",e.RelativeBilateral="relative-bilateral"})(A||(A={}));const fs=(()=>{const e=g(),t=g();return(i,n)=>(N(e,i.x,i.y,i.z??0),N(t,n.x,n.y,n.z??0),lp(e,t,i.spatialReference,n.spatialReference))})(),lp=(()=>{const e=G(),t=g(),i=g();return(n,s,o,r)=>{if(H(n,s))return;const l=rn(o),h=rn(r);if(l&&h&&Qe(l,h)&&xt(n,o,t,l)&&xt(s,r,i,h)){const{azimuth:p}=mn(pp,t,i,l);return p!=null?fn(p,"degrees","radians"):void 0}e[0]=s[0]-n[0],e[1]=s[1]-n[1];let u=Pc(Rc,e);return e[0]<0&&(u=dp-u),u}})();function cp(e,t,i,n=A.Absolute){if(t&&i)switch(n){case A.Absolute:return po(t,i);case A.Relative:return un(Jo(e,t,i),A.Relative);case A.RelativeBilateral:return un(Jo(e,t,i),A.RelativeBilateral)}}function Jo(e,t,i){if(!e||!t||!i)return;const n=fs(e,t),s=fs(t,i);return n!=null&&s!=null?Dt(s-n,"radians","geographic"):void 0}function un(e,t){if(e!=null)switch(t){case A.Absolute:return gs(e);case A.Relative:{const i=Mt(e);let n=tr.normalize(i,0,!0);return n===-180&&(n=180),Dt(n,"degrees","geographic")}case A.RelativeBilateral:{const i=Mt(e),n=Math.abs(tr.normalize(i,0,!0));return Dt(n,"degrees","geographic")}}}function gs(e){const t=Mt(e),i=fp.normalize(t,0,!0);return Dt(i,"degrees","geographic")}const hp=(()=>{const e=g();return(t,i,n,s,o,r="geodesic")=>{rt(e,i);const l=Mt(o);if(r==="geodesic"){const f=rn(n);if(f&&xt(e,n,e,f))return bi(t,e,l,s,f),t[2]=i[2],!!xt(t,f,t,n)}const h=qr(l,"geographic","arithmetic"),u=fn(h,"degrees","radians"),p=i[0]+s*Math.cos(u),d=i[1]+s*Math.sin(u),m=i[2];return N(t,p,d,m),!0}})();function Mt(e){if(e!=null)return qr(up(e),e.rotationType,"geographic")}function up(e){return fn(e.value,e.unit,"degrees")}const pp=new yn,dp=2*Math.PI,fp=ta,tr=new Qs(-180,180);function gp(e,t,i,n,s,o){let r="geodesic",l=rn(i);const h=j();return to(e,t,n,h),h[2]=0,l&&xt(h,i,h,l)||(r="euclidean",l=i),{mode:r,view:t,elevationInfo:n,hasZ:s,directionMode:o,spatialReference:e.spatialReference,measurementSR:l,origin:h}}function mp(e,t,i){if(t==null||e==null)return;const n=Bs(i.measurementSR);if(n==null)return;const s=Sn(e,i);if(s==null)return;const o=_n(t,n);return new Ca(s,o)}function yp(e,t,i,n){if(i==null||e==null)return;const s=Sn(e,n);if(s==null)return;const o=Mt(i),r=10,l=u=>{if(u==null)return;const p=j(),d=Dt(u,"degrees","geographic");return hp(p,s,n.measurementSR,r,d,n.mode)?new $u(s,p):void 0},h=()=>{if(t!=null&&e!=null)return Mt(po(t,e))};switch(n.directionMode){case A.Absolute:return l(o);case A.Relative:{const u=h();return u==null?void 0:l(u+o)}case A.RelativeBilateral:{const u=h();return u==null?void 0:Li([l(u+o),l(u-o)])}}}function La(e,t){const i=Pn(e,t);return i!=null?new Ra(i):void 0}function Ga(e,t,i){const{context:n,longitude:s,latitude:o,direction:r,distance:l,elevation:h}=i;if(s!=null||o!=null||l!=null||h!=null||r!=null){if(s!=null||o!=null){const u=Mt(s),p=Mt(o),d=Pn(h,n);return new ho(u,p,d)}return _p(e,t,i)}}function _p(e,t,{context:i,direction:n,distance:s,elevation:o}){if(t==null)return La(o,i);const{view:r,elevationInfo:l,measurementSR:h}=i,u=to(t,r,l);if(!h||!xt(u,t.spatialReference,er,h))return;const[p,d]=er,m=s!=null?_n(s,"meters"):void 0,f=Mt(n),_=Pn(o,i),y=b=>{const S=new Aa([p,d],h,m,_,b);return m==null||b==null||_==null&&i.hasZ?S:new Je(S.closestTo(u))};if(f==null)return y(void 0);const w=()=>{if(e!=null&&t!=null)return Mt(po(e,t))};switch(i.directionMode){case A.Absolute:return y(f);case A.Relative:{const b=w();return b==null?void 0:y(b+f)}case A.RelativeBilateral:{const b=w();return b==null?void 0:Li([y(b+f),y(b-f)])}}}function vp(e){return e.context.mode==="geodesic"?Ga(null,null,e):Da(e)}function xp(e,t,i){const{context:n,x:s,y:o,distance:r,direction:l,elevation:h}=i;return n.mode==="geodesic"?Ga(t,e,i):s!=null||o!=null?Da(i):bp([mp(e,r,n),yp(e,t,l,n),La(h,n)])}function Da({x:e,y:t,elevation:i,context:n}){Hi.x=e?.value??0,Hi.y=t?.value??0,Hi.spatialReference=n.spatialReference;const s=Sn(Hi,n,Ep);return new ho(e!=null&&s!=null?s[0]:void 0,t!=null&&s!=null?s[1]:void 0,Pn(i,n))}function bp(e){let t;for(const i of e)i&&(t=t?.intersect(i)??i);return t}function Sn(e,t,i=j()){const{view:n,elevationInfo:s,measurementSR:o,origin:r,mode:l}=t;if(to(e,n,s,i),xt(i,e.spatialReference,i,o))return l!=="geodesic"&&Et(i,i,r),i}function wp(e,t,i,n){const{view:s,measurementSR:o,spatialReference:r,origin:l,mode:h}=i;if(h==="geodesic"?rt(oi,e):ut(oi,e,l),xt(oi,o,oi,r))return Yh(oi,s,t,i,n)}function Pn(e,t){return Tp(e,t)?.value??void 0}function Tp(e,{view:t,origin:i,elevationInfo:n,hasZ:s,measurementSR:o}){if(e==null||!s)return;const r=zr(o);if(r==null)return;const[l,h]=i,u=_n(e,r),p=t?.type==="3d"?Nr(t,l,h,u,o,n):u;return p!=null?ft(p,r):void 0}const er=j(),Ep=j(),oi=j(),Hi=Ws(0,0,0,ue.WGS84),Sp="z",Pp="r",ir={toggle:"Control"},Ue={enterInputMode:"Tab",commit:"Enter",discard:"Escape",next:"Tab"},kt={moveUp:{key:"ArrowUp",modifier:"Shift",repeats:!0},moveDown:{key:"ArrowDown",modifier:"Shift",repeats:!0},moveLeft:{key:"ArrowLeft",modifier:"Shift",repeats:!0},moveRight:{key:"ArrowRight",modifier:"Shift",repeats:!0},scaleUp:{key:"+",modifier:"Shift"},scaleDown:{key:"-",modifier:"Shift"},factorModifier:{key:Wr,continuePropagation:!0},toggleOpacity:"t",preserveAspectRatio:{key:"Shift",continuePropagation:!0},rotateIncrements:{key:"Shift",continuePropagation:!0},undo:Sp,redo:Pp};let Mp=class{constructor(){this._bindings=new Map}add(e,t){return this.addToggle(e,i=>{i.type==="key-down"&&t(i)})}addToggle(e,t){const i=kp.fromDefinition(e,t),n=ec(this._bindings,i.key,()=>[]);return n.push(i),Y(()=>Dr(n,i))}register(e,t=Xr.WIDGET){return Gr([e.on("key-down",i=>this.dispatch(e.inputManager,i),t),e.on("key-up",i=>this.dispatch(e.inputManager,i),t)])}dispatch(e,t){const i=t.key,n=this._bindings.get(i);if(n)for(const s of n)s.process(e,t)}},kp=class ms{constructor(t,i,n,s,o){this.key=t,this.modifiers=i,this.repeats=n,this.continuePropagation=s,this.callback=o}process(t,i){if(!(i.key!==this.key||"repeat"in i&&i.repeat&&!this.repeats)){for(const n of this.modifiers)if(!t.isModifierKeyDown(n))return;this.continuePropagation||i.stopPropagation(),this.callback(i)}}static fromDefinition(t,i){if(typeof t=="string")return new ms(t,[],!1,!1,i);const{key:n,modifier:s,repeats:o,continuePropagation:r}=t;return new ms(n,s?Array.isArray(s)?s:[s]:[],!!o,!!r,i)}};const Q="esri-tooltip",Cp=`${Q}-content`,Rp=`${Q}-content--input`,Vp=`${Q}-content__header`,Ap=`${Q}-content__header__spacer`,nr=`${Q}-content__header__actions`,za=`${Q}-draw-header-actions`,Op=`${Q}-table`,Ip=`${Q}-help-message`,Lp=`${Q}-help-message__text`,Gp=`${Q}-help-message__icon`,Ni=`${Q}-field`,Fi={base:Ni,inputMode:`${Ni}--input`,title:`${Ni}__title`,value:`${Ni}__value`};let $=class extends Vi{constructor(){super(...arguments),this.hidden=!1,this.mode="feedback"}render(){return v("div",{class:this.classes({[Fi.base]:!0,[Fi.inputMode]:this.mode==="input"})},v("div",{class:Fi.title,key:"title"},this.title),v("div",{class:Fi.value,key:"value"},this.value))}};a([c()],$.prototype,"hidden",void 0),a([c()],$.prototype,"mode",void 0),a([c()],$.prototype,"title",void 0),a([c()],$.prototype,"value",void 0),$=a([x("esri.views.interactive.tooltip.components.TooltipField")],$);const Dp={base:`${Q}-value-by-value`};let Wt=class extends Vi{constructor(){super(...arguments),this.divider="×"}render(){return v("div",{class:Dp.base},v("span",null,this.left),v("span",null,this.divider),v("span",null,this.right))}};a([c()],Wt.prototype,"left",void 0),a([c()],Wt.prototype,"divider",void 0),a([c()],Wt.prototype,"right",void 0),Wt=a([x("esri.views.interactive.tooltip.components.ValueByValue")],Wt);function ys(e){let t,i,n=[],s=!1;function o(...r){return s&&t===this&&zp(r,n)||(i=e.apply(this,r),t=this,n=r,s=!0),i}return o}function zp(e,t){if(e.length!==t.length)return!1;for(let i=0;iQp(e,i,n??t.area),length:(i,n,s)=>or(e,i,n??t.length,s),lengthRelative:(i,n)=>qp(e,i,n??t.length),totalLength:(i,n)=>or(e,i,n??t.length),verticalLength:(i,n)=>jp(e,i,n??t.verticalLength),verticalLengthRelative:(i,n)=>Kp(e,i,n??t.verticalLength),percentage:ld,scalar:Fa,scale:cd}}function td(e){return Ci(e,{signDisplay:"exceptZero",...go(kn)})}function ed(e){return Mn(e,e.rotationType,kn)}function id(e){const t=Mt(e);return Ci(t,{style:"unit",unitDisplay:"narrow",unit:"degree",signDisplay:t>0?"never":"exceptZero",...go(kn)})}function nd(e){return Mn(e,e.rotationType,kn)}function sd(e){return Ha(e,Ya)}function od(e){return Ha(e,Wa)}function rd(e){return Na(e,Ya)}function ad(e){return Na(e,Wa)}function Ha(e,t){return Mn(te(e,"degrees"),"geographic",Ua,t,!1)}function Na(e,t){const i=t.normalize(te(e,"degrees").value,void 0,!1);return Fa(Qt(i),Ua)}function ld(e){return Ci(e.value,{style:"percent"})}function cd(e){return Ci(e,{style:"percent",maximumFractionDigits:0})}function Fa(e,t){return Ci(e.value,go(t))}function go(e){return{minimumFractionDigits:e,maximumFractionDigits:e}}function xe({createQuantity:e,sanitize:t}){return(i,n)=>{if(i==null)return null;t&&(i=t(i));const s=Ze(i);return s==null?null:e(s,n)}}function Za(e){return e.replaceAll(/[*^~°º]/g,"")}const hd=e=>{let t=`[-+]?[0-9${e.thousands}]+`;return e.decimal!==""&&(t+=`${e.decimal}[0-9]+`),new RegExp(`^(${t}\\s*)${e.separator}(\\s*${t})$`,"i")},ud=" ",Ba=[];for(const e of[",","\\|","\\s+"])for(const t of["\\.",",",""])for(const i of["",",","\\.",ud,"\\s+"])e!==t&&e!==i&&t!==i&&Ba.push({separator:e,decimal:t,thousands:i,pattern:hd({decimal:t,thousands:i,separator:e})});function pd(e){for(const{decimal:t,thousands:i,pattern:n}of Ba){n.lastIndex=0;const s=e.match(n);if(!s)continue;const o=Ze(rr(s[1],t,i)),r=Ze(rr(s[2],t,i));if(o!=null&&r!=null)return{x:Qt(o),y:Qt(r)}}return null}function rr(e,t,i){let n=e.replaceAll(/[\s+]/g,"");return i!==""&&(n=n.replaceAll(i,"")),t!==""&&(n=n.replaceAll(t,".")),n}function dd(e){if(!e||Ze(e)!=null||!eo())return null;const t=Si(e),i=Ke(t?.latitude),n=Ke(t?.longitude);return n!=null&&i!=null?{latitude:i,longitude:n}:null}function fd(e){return Ke(au(e))}function gd(e){return Ke(lu(e))}function Ke(e){return e!=null?Dt(e,"degrees","geographic"):null}const Ya=new Qs(-180,180),Wa=new Qs(-90,90),Xn=Symbol("dragHandles");let E=class extends Vi{constructor(){super(...arguments),this._focusAbortController=new AbortController,this._transitionInfo=null,this._mode="feedback",this._getFormatters=ys(Jp),this._onHeaderPointerDown=e=>{const t=e.target;t instanceof HTMLElement&&t?.tagName?.toLowerCase()!=="calcite-button"&&(this.removeHandles(Xn),t.setPointerCapture(e.pointerId),this.tooltip.onDragStart(e.clientX,e.clientY),this.addHandles([di(t,"pointermove",({clientX:i,clientY:n})=>{this.tooltip.onDrag(i,n)}),di(t,["pointerup","pointercancel"],i=>{this.removeHandles(Xn),t.releasePointerCapture(e.pointerId),this.tooltip.onDragEnd()}),di(t,"touchstart",i=>i.preventDefault())],Xn))},this._onDiscard=()=>{this.destroyed||(this.tooltip.emit("discard"),this.info.clearInputValues(),this.exitInputMode())},this._onCommit=(e,t)=>{if(this.destroyed)return;if(this.tooltip.emit("commit",{type:t}),t==="commit-and-exit")return void this.exitInputMode();if(t==="commit-on-blur")return;const i=this._getFocusableElements(),n=i.length,s=i.indexOf(e);if(s===-1)return void this.exitInputMode();const o=((s+(t==="commit-and-next"?1:-1))%n+n)%n;Zi(i.at(o))},this._onKeyDown=e=>{switch(e.code){case Ue.next:return this._onNextKey(e);case Ue.discard:return e.stopPropagation(),this._onDiscard()}}}get mode(){return this._mode}get _displayUnits(){const{displayUnits:e}=this.info.sketchOptions.values,t=sr(this.tooltip.view);return{length:e.length??t,verticalLength:e.verticalLength??t,area:e.area??t}}get _inputUnitInfos(){const e=this._messagesUnits,t=l=>({unit:l,abbreviation:ih(e,l,"abbr")}),{inputUnits:i}=this.info.sketchOptions.values,n=sr(this.tooltip.view),s=i.length??n,o=i.verticalLength??n,r=i.area??n;return{length:t(sc(s)),verticalLength:t(oc(o)),area:t(rc(r)),angle:t("degrees")}}get _formatters(){return this._getFormatters(this._messagesUnits,this._displayUnits)}get fieldContext(){return{formatters:this._formatters,inputUnitInfos:this._inputUnitInfos,messages:this._messagesTooltip,sketchOptions:this.info.sketchOptions,onCommit:this._onCommit,onDiscard:this._onDiscard}}render(){const{visibleElements:e}=this.info.sketchOptions.tooltips,t=this._renderedContent,i=this._renderedActions,n=this._renderedHelpMessage,s=t.length>0,o=s||!!n,r=this.mode==="input";return v("div",{class:Oh(Cp,r&&Rp),onkeydown:this._onKeyDown,tabIndex:-1},r&&o&&e.header?v("div",{class:Vp,"data-testid":"tooltip-header",key:"header",onpointerdown:this._onHeaderPointerDown},v("calcite-button",{appearance:"transparent","data-testid":"tooltip-back-button",iconFlipRtl:"both",iconStart:"chevron-left",key:"discard-button",kind:"neutral",onclick:this._onDiscard,scale:"s",tabIndex:-1}),i.length>0?v(wt,null,v("div",{class:Ap,key:"spacer"}),v("div",{class:nr,key:"actions"},i)):null):null,s?v("div",{class:Op,key:"content"},...t):null,n)}destroy(){this._focusAbortController.abort(),this._transitionInfo?.transition.skipTransition()}_renderActions(){return null}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-DvwKP8jU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),icon:()=>It(()=>import("./calcite-icon-laqhdRBY-8qK5FfMb.js"),__vite__mapDeps([20,17,1,2,3,4,5,6,8,15]),import.meta.url),input:()=>It(()=>import("./calcite-input-BKRd7MCS-BhvpT25V.js"),__vite__mapDeps([21,22,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url)})}async enterInputMode(e,t){try{await this._transitionTo("input",t),await this._focusField(e)}catch(i){ko(i)}}async exitInputMode({focusOnView:e=!0}={}){try{const{container:t,info:i}=this;i.clearInputValues();const n=e?t?.closest(".esri-view")?.querySelector(".esri-view-surface"):null;await this._transitionTo("feedback"),n instanceof HTMLElement&&n.focus()}catch(t){ko(t)}}_onNextKey(e){const t=this._getFocusableElements(),i=t.at(0),n=t.at(-1);i&&n&&(e.shiftKey?document.activeElement===i&&(e.preventDefault(),e.stopPropagation(),Zi(n)):document.activeElement===n&&(e.preventDefault(),e.stopPropagation(),Zi(i)))}get _renderedContent(){return ar(this._renderContent())}get _renderedActions(){return ar(this._renderActions())}get _renderedHelpMessage(){const{sketchOptions:e,visibleElements:t}=this.info;if(!t.helpMessage)return null;const i=e.tooltips.helpMessage??this._defaultHelpMessage;if(!i)return null;const n=e.tooltips.helpMessageIcon??"information";return v("div",{class:Ip,key:"help-message"},n?v("calcite-icon",{class:Gp,icon:n,scale:"s"}):null,v("div",{class:Lp},i))}get _defaultHelpMessage(){const{helpMessage:e,viewType:t}=this.info;if(e==null)return null;const i=t==="3d"?"helpMessages3d":"helpMessages2d";return this._messagesTooltip?.sketch?.[i]?.[e]}async _focusField(e){this._focusAbortController?.abort(),this._focusAbortController=new AbortController;const{signal:t}=this._focusAbortController;await this._waitForInputs(),ql(t);const i=this._getFocusableInputs(),n=e?i.find(s=>s.getAttribute("data-field-name")===e):i.at(0);await Zi(n)}async _transitionTo(e,t){if(this._mode===e&&!this._transitionInfo)return;if(this._transitionInfo?.mode===e)return this._transitionInfo.transition.finished;this._transitionInfo?.transition.skipTransition();const i=async()=>{this.destroyed||(this._mode=e,await Ro(),this.destroyed||(this.renderNow(),await Ro(),this.destroyed||t?.()))};if(!this.domNode?.firstChild||!document.startViewTransition||qc())return void await i();this.autoRenderingEnabled=!1;const n=this._transitionInfo={transition:document.startViewTransition(async()=>{this.destroyed||n!==this._transitionInfo||(this.autoRenderingEnabled=!0,await i())}),mode:e};try{await n.transition.finished}finally{n===this._transitionInfo&&(this._transitionInfo=null)}}async _waitForInputs(){const e=()=>Array.from(this.domNode?.querySelectorAll("calcite-input")??[]);for(;e().length===0;)await jl(md);await Rr()}_getFocusableInputs(){return Array.from(this.domNode?.querySelectorAll("calcite-input:not([read-only]):not([disabled])")??[])}_getFocusableElements(){const e=this.domNode?.querySelector(`.${za}`);return[...Array.from(e?.querySelectorAll(`.${nr} calcite-button:not([disabled])`)??[]),...this._getFocusableInputs()]}};async function Zi(e){await e?.setFocus()}function ar(e){return(Array.isArray(e)?e:[e]).flat(10).filter(t=>!!t)}a([cs("esri/core/t9n/Units"),c()],E.prototype,"_messagesUnits",void 0),a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],E.prototype,"_messagesTooltip",void 0),a([c()],E.prototype,"info",void 0),a([c()],E.prototype,"tooltip",void 0),a([c()],E.prototype,"_mode",void 0),a([c()],E.prototype,"mode",null),a([c()],E.prototype,"_displayUnits",null),a([c()],E.prototype,"_inputUnitInfos",null),a([c()],E.prototype,"_formatters",null),a([c()],E.prototype,"fieldContext",null),a([c()],E.prototype,"_renderedContent",null),a([c()],E.prototype,"_renderedActions",null),a([c()],E.prototype,"_renderedHelpMessage",null),a([c()],E.prototype,"_defaultHelpMessage",null),E=a([x("esri.views.interactive.tooltip.content.TooltipContent")],E);const md=20;let _s=class extends E{_renderContent(){const{area:e,radius:t,xSize:i,ySize:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.radius&&t!=null?v($,{title:o.radius,value:r.length(t)}):null,s.size&&i!=null&&n!=null?v($,{title:o.size,value:v(Wt,{left:r.length(i),right:r.length(n)})}):null,s.area?v($,{title:o.area,value:r.area(e)}):null)}};_s=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawCircle")],_s);const ct=`${Q}-editable-field`,st={base:ct,inputMode:`${ct}--input`,feedbackMode:`${ct}--feedback`,readOnly:`${ct}--read-only`,locked:`${ct}--locked`,title:`${ct}__title`,value:`${ct}__value`,valueContent:`${ct}__value__content`,valueContentReadOnly:`${ct}__value__content--read-only`,lockIcon:`${ct}__lock-icon`,input:`${ct}__input`,inputSuffix:`${ct}__input-suffix`,button:`${ct}__button`},qn={lock:"lock",unlock:"unlock"};let yt=class extends Vi{constructor(){super(...arguments),this._input=null,this._lock=null,this._onLockClick=()=>{this.field.toggleLock(this.context)},this._onLockAfterCreate=e=>{this._lock=e},this._onLockAfterRemoved=()=>{this._lock=null},this._onKeyDown=e=>{e.key===Ue.discard&&this.mode==="input"&&this._input&&this.context.onDiscard(this._input)},this._onInputKeyDown=e=>{const t=this._input;if(t)switch(e.key){case Ue.commit:return this.field.onCommit("commit-and-exit",t,this.context);case Ue.next:{e.preventDefault(),e.stopPropagation();const i=e.shiftKey?"commit-and-previous":"commit-and-next";return this.field.onCommit(i,t,this.context)}}},this._onInput=e=>{this.field.onInput(e.target.value)},this._onInputBlur=e=>{const t=this._input;t&&e.relatedTarget!==this._lock&&this.field.onCommit("commit-on-blur",t,this.context)},this._selectText=()=>{const e=()=>{this._input===document.activeElement&&this._input?.selectText()};e(),Rr().then(e)},this._onAfterCreate=e=>{this._input=e,e.addEventListener("paste",this._onPaste),e.addEventListener("beforeinput",this._onBeforeInput)},this._onAfterRemoved=e=>{e.removeEventListener("paste",this._onPaste),e.removeEventListener("beforeinput",this._onBeforeInput)},this._onPaste=e=>{const t=e.clipboardData?.getData("text");t&&this.field.parse(t,this.context)!=null&&(e.stopPropagation(),this.field.onInput(t))},this._onBeforeInput=e=>{(e.inputType==="historyUndo"||e.inputType==="historyRedo")&&!this.field.dirty&&e.preventDefault()}}initialize(){this.addHandles(U(()=>this._rawDisplayValue,()=>{const{committed:e,inputValue:t}=this.field;e||t||this._input!==document.activeElement||this._selectText()}))}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-DvwKP8jU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),icon:()=>It(()=>import("./calcite-icon-laqhdRBY-8qK5FfMb.js"),__vite__mapDeps([20,17,1,2,3,4,5,6,8,15]),import.meta.url),input:()=>It(()=>import("./calcite-input-BKRd7MCS-BhvpT25V.js"),__vite__mapDeps([21,22,1,2,3,4,5,6,8,7,9,14,10,11,12,13,15,16,17]),import.meta.url)})}render(){const{field:e,mode:t}=this,i=t==="input",{locked:n,readOnly:s}=e;return v("div",{class:this.classes({[st.base]:!0,[st.feedbackMode]:t==="feedback",[st.inputMode]:t==="input",[st.locked]:n,[st.readOnly]:s})},v("div",{class:st.title,key:"title"},this._title),v("div",{class:st.value,key:"value",onkeydown:this._onKeyDown},i?this._renderValueInputMode():this._renderValueFeedbackMode()))}get _formattedValue(){return this.field.getFormattedValue(this.context)||lr}get _rawDisplayValue(){return this.field.getRawDisplayValue(this.context)}get _suffix(){return this.field.getSuffix(this.context)}get _title(){const{title:e}=this.field;return typeof e=="string"?e:e(this.context)}_renderValueFeedbackMode(){return v(wt,null,v("div",{class:st.valueContent,key:"value-feedback"},this._formattedValue),this.field.locked&&this.mode!=="input"?v("calcite-icon",{class:st.lockIcon,icon:qn.lock,key:"icon",scale:"s"}):null)}_renderValueInputMode(){return this.field.readOnly?this._renderValueReadOnly():this._renderValueWritable()}_renderValueReadOnly(){return v("div",{class:this.classes(st.valueContent,st.valueContentReadOnly),key:"value-read-only"},this._formattedValue)}_renderValueWritable(){const{field:e}=this,{name:t,invalid:i,locked:n}=e,s=this.context?.messages.sketch??{},o=n?s.unlockConstraint:s.lockConstraint;return v(wt,null,v("calcite-input",{afterCreate:this._onAfterCreate,afterRemoved:this._onAfterRemoved,class:st.input,"data-field-name":t,"data-testid":`tooltip-field-${t}`,key:"input",onblur:this._onInputBlur,onfocus:this._selectText,onkeydown:this._onInputKeyDown,scale:"s",status:i?"invalid":"idle",type:"text",value:this._rawDisplayValue??lr,onCalciteInputInput:this._onInput}),v("div",{class:st.inputSuffix,key:"suffix"},this._suffix),e.lockable?v("calcite-button",{afterCreate:this._onLockAfterCreate,afterRemoved:this._onLockAfterRemoved,alignment:"center",appearance:"transparent",class:st.button,"data-testid":`tooltip-field-${t}-lock`,iconStart:n?qn.lock:qn.unlock,key:"lock",kind:"neutral",label:o,onclick:this._onLockClick,scale:"s",tabIndex:-1,title:o}):v("div",{key:"lock-empty"}))}};a([c()],yt.prototype,"field",void 0),a([c()],yt.prototype,"context",void 0),a([c()],yt.prototype,"mode",void 0),a([c()],yt.prototype,"_input",void 0),a([c()],yt.prototype,"_lock",void 0),a([c()],yt.prototype,"_formattedValue",null),a([c()],yt.prototype,"_rawDisplayValue",null),a([c()],yt.prototype,"_suffix",null),a([c()],yt.prototype,"_title",null),yt=a([x("esri.views.interactive.tooltip.components.TooltipEditableField")],yt);const lr="—";function ee(e){const t=e.fields.filter(i=>i?.visible===!0);return t.length===0?null:v(wt,null,t.map(i=>v(yt,{context:e.context,field:i,key:i.id,mode:e.mode})))}let vs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};vs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawMesh")],vs);let xs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{elevation:n,visibleElements:s}=t;return v(ee,{context:e,fields:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0,s.elevation?n:void 0],mode:i})}};xs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPoint")],xs);const jn={absolute:"absolute-direction",relative:"relative-direction"};let Ee=class extends Vi{constructor(e){super(e),this.visibleElements={}}render(){return v("div",{class:za},this._isElementVisible("direction")?v(yd,{messages:this.messages,sketchOptions:this.sketchOptions}):null)}loadDependencies(){return Js({button:()=>It(()=>import("./calcite-button-Cm9_TJei-DvwKP8jU.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url),dropdown:()=>It(()=>import("./calcite-dropdown-CLrG397W-Dl2b91G4.js"),__vite__mapDeps([23,1,2,3,4,5,6,8,24,25,19,9,14,12,15,26]),import.meta.url),"dropdown-item":()=>It(()=>import("./calcite-dropdown-item-DpLfv4A0-CIOTjei7.js"),__vite__mapDeps([27,1,2,3,4,5,6,8,12,11,9,28,17,15]),import.meta.url),"dropdown-group":()=>It(()=>import("./calcite-dropdown-group-0sIPwaDd-DiD7sdrQ.js"),__vite__mapDeps([29,1,2,3,4,5,6,15,28]),import.meta.url)})}_isElementVisible(e){return this.visibleElements?.[e]??this.sketchOptions.tooltips.visibleElements[e]}};function yd(e){const{directionMode:t}=e.sketchOptions.values,i=e.messages?.sketch,n=i?.directionModeSelect?.title,s="absolute",o="relative";return v("calcite-dropdown",{key:"direction-mode",placement:"bottom-end",scale:"s",widthScale:"s",onCalciteDropdownSelect:r=>{const l=r.target.selectedItems?.[0]?.getAttribute("data-mode");e.sketchOptions.values.directionMode=l??"absolute"}},v("calcite-button",{alignment:"end",appearance:"transparent",iconStart:jn[t],kind:"neutral",label:n,scale:"s",slot:"trigger",title:n}),v("calcite-dropdown-group",{selectionMode:"single"},v("calcite-dropdown-item",{"data-mode":o,"data-testid":"tooltip-direction-mode-relative",iconStart:jn.relative,key:"relative",selected:t===o},i?.directionModeSelect?.relative),v("calcite-dropdown-item",{"data-mode":s,"data-testid":"tooltip-direction-mode-absolute",iconStart:jn.absolute,key:"absolute",selected:t===s},i?.directionModeSelect?.absolute)))}a([cs("esri/views/interactive/tooltip/t9n/Tooltip"),c()],Ee.prototype,"messages",void 0),a([c()],Ee.prototype,"sketchOptions",void 0),a([c()],Ee.prototype,"visibleElements",void 0),Ee=a([x("esri.views.interactive.tooltip.components.DrawHeaderActions")],Ee);let bs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.area?t.area:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};bs=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolygon")],bs);let ws=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{xyMode:n,visibleElements:s}=t;return v(ee,{context:e,fields:[...n==="direction-distance"?[s.direction?t.direction:void 0,s.distance?t.distance:void 0]:[s.coordinates?t.effectiveX:void 0,s.coordinates?t.effectiveY:void 0],s.elevation?t.elevation:void 0,s.totalLength?t.totalLength:void 0],mode:i})}_renderActions(){const{xyMode:e,sketchOptions:t}=this.info;return v(Ee,{sketchOptions:t,visibleElements:{direction:e==="direction-distance"}})}};ws=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawPolyline")],ws);let Ts=class extends E{_renderContent(){const{area:e,xSize:t,ySize:i,visibleElements:n}=this.info,s=this._messagesTooltip.sketch,o=this._formatters;return v(wt,null,n.size&&t!=null&&i!=null?v($,{title:s.size,value:v(Wt,{left:o.length(t),right:o.length(i)})}):null,n.area?v($,{title:s.area,value:o.area(e)}):null)}};Ts=a([x("esri.views.interactive.tooltip.content.TooltipContentDrawRectangle")],Ts);let Es=class extends E{_renderContent(){const{angle:e,visibleElements:t}=this.info,i=this._messagesTooltip.sketch;return v(wt,null,t.rotation?v($,{title:i.rotation,value:this._formatters.angleRelative(e)}):null)}};Es=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentRotate")],Es);let Ss=class extends E{_renderContent(){const e=this.info,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.size?v($,{title:i.size,value:v(Wt,{left:n.length(e.xSize),right:n.length(e.ySize)})}):null,t.scale?v($,{title:i.scale,value:v(Wt,{left:n.scale(e.xScale),right:n.scale(e.yScale)})}):null)}};Ss=a([x("esri.views.interactive.tooltip.content.TooltipContentExtentScale")],Ss);let Ps=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0],mode:i})}};Ps=a([x("esri.views.interactive.tooltip.content.TooltipContentMovePoint")],Ps);let Ms=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.distance?t.distance:void 0,n.area?t.area:void 0,n.totalLength?t.totalLength:void 0],mode:i})}};Ms=a([x("esri.views.interactive.tooltip.content.TooltipContentReshapeEdgeOffset")],Ms);let ks=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.area&&t.geometryType==="polygon"?t.area:null,n.totalLength&&t.geometryType==="polyline"?t.totalLength:null],mode:i})}};ks=a([x("esri.views.interactive.tooltip.content.TooltipContentSelectedVertex")],ks);let Cs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.scale?t.scale:void 0],mode:i})}};Cs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformMesh")],Cs);let Rs=class extends E{_renderContent(){const{fieldContext:e,info:t,mode:i}=this,{visibleElements:n}=t;return v(ee,{context:e,fields:[n.coordinates?t.effectiveX:void 0,n.coordinates?t.effectiveY:void 0,n.elevation?t.elevation:void 0,n.orientation?t.orientation:void 0,n.size?t.size:void 0],mode:i})}};Rs=a([x("esri.views.interactive.tooltip.content.TooltipContentTransformPoint")],Rs);let Vs=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v($,{title:i.distance,value:n.length(e.distance)}):null)}};Vs=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslate")],Vs);let As=class extends E{_renderContent(){const{distance:e,elevation:t,area:i,totalLength:n,visibleElements:s}=this.info,o=this._messagesTooltip.sketch,r=this._formatters;return v(wt,null,s.distance?v($,{title:o.distance,value:r.length(e)}):null,s.elevation&&t?.actual!=null?v($,{title:o.elevation,value:r.verticalLength(t.actual)}):null,s.area&&i!=null?v($,{title:o.area,value:r.area(i)}):null,s.totalLength&&n!=null?v($,{title:o.totalLength,value:r.length(n)}):null)}};As=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateVertex")],As);let Os=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch,n=this._formatters;return v(wt,null,t.distance?v($,{title:i.distance,value:n.length(e.distance)}):null)}};Os=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateXY")],Os);let Is=class extends E{_renderContent(){const{info:e}=this,{visibleElements:t}=e,i=this._messagesTooltip.sketch;return v(wt,null,t.distance?v($,{title:i.distance,value:this._formatters.verticalLengthRelative(e.distance)}):null)}};Is=a([x("esri.views.interactive.tooltip.content.TooltipContentTranslateZ")],Is);function _d(e,t){if(t==null)return null;const i=document.createElement("div");switch(t.type){case"draw-point":return new xs({tooltip:e,info:t,container:i});case"draw-polygon":return new bs({tooltip:e,info:t,container:i});case"draw-polyline":return new ws({tooltip:e,info:t,container:i});case"draw-mesh":return new vs({tooltip:e,info:t,container:i});case"draw-rectangle":return new Ts({tooltip:e,info:t,container:i});case"draw-circle":return new _s({tooltip:e,info:t,container:i});case"extent-rotate":return new Es({tooltip:e,info:t,container:i});case"extent-scale":return new Ss({tooltip:e,info:t,container:i});case"move-point":return new Ps({tooltip:e,info:t,container:i});case"selected-vertex":return new ks({tooltip:e,info:t,container:i});case"transform-point":return new Rs({tooltip:e,info:t,container:i});case"transform-mesh":return new Cs({tooltip:e,info:t,container:i});case"translate":return new Vs({tooltip:e,info:t,container:i});case"translate-vertex":return new As({tooltip:e,info:t,container:i});case"translate-z":return new Is({tooltip:e,info:t,container:i});case"translate-xy":return new Os({tooltip:e,info:t,container:i});case"reshape-edge-offset":return new Ms({tooltip:e,info:t,container:i})}}const ci={base:`${Q}`,ltr:`${Q}--ltr`,rtl:`${Q}--rtl`,debug:`${Q}--debug`},vd=20,xd=16,bd="bottom-end";let F=class extends Ce.EventedAccessor{constructor(e){super(e),this.info=null,this.options=null,this.position=null,this.content=null,this._focused=!1,this.outerContainer=document.createElement("div"),this.debug=!1,this._lastPosition=null,this._rtl=!1,this._prevXY=[0,0]}initialize(){const{outerContainer:e}=this;this.addHandles([U(()=>this.view.overlay?.surface,t=>{e.remove(),t?.appendChild(e),this._rtl=Vh(t)},ke),U(()=>this.info,(t,i)=>{if(this.content!=null&&t!=null&&i!=null&&t.type===i.type)this.content.info=t;else{dt(this.content);const n=_d(this,t);n?(this.content=n,n.container&&e.appendChild(n.container),this.exitInputMode()):this.content=null}},ke),U(()=>({container:this.outerContainer,style:this._outerContainerStyle}),({container:t,style:i})=>{Object.assign(t.style,i)},es),U(()=>({outerContainer:this.outerContainer,placement:this.effectivePlacement,effectiveOffset:this._effectiveOffset,rtl:this._rtl,debug:this.debug}),({outerContainer:t,placement:i,effectiveOffset:n,rtl:s,debug:o})=>{const{classList:r}=t;r.add(ci.base),r.toggle(ci.rtl,s),r.toggle(ci.ltr,!s),r.toggle(ci.debug,o),this.outerContainer.style.setProperty("--offset",`${n}px`),Ah(t),Ed(t,i)},es),Il(()=>this.mode==="feedback",()=>{this.position=null,this._clearOverride("effectivePlacement")},$s),di(this.outerContainer,"paste",t=>{this.emit("paste",t)}),di(this.outerContainer,["focusin","focusout"],()=>{setTimeout(()=>{this._focused=this.content?.container?.contains(document.activeElement)??!1})})])}destroy(){this.info=null,this.content=dt(this.content),this.outerContainer.remove()}get mode(){return this.content?.mode??"feedback"}get focused(){return this._focused}get visible(){return this._outerContainerStyle.display!=="none"}get contentContainer(){return this.content?.container}get effectivePlacement(){const e=this.options?.placement;return e==="auto"?"bottom-end":e??bd}get _screenPoint(){const{inputManager:e}=this.view;return e?.multiTouchActive?null:e?.latestPointerLocation}get _effectiveOffset(){return this.options?.offset??vd}get _outerContainerStyle(){const e=this.position??this._screenPoint;return this._lastPosition=So(e),e!=null&&this.content!=null?{display:"block",transform:`translate(${Math.round(e.x)}px, ${Math.round(e.y)}px)`}:{display:"none",transform:"none"}}clear(){this.info=null}async enterInputMode(e){const t=this.position??this._lastPosition??this._screenPoint,i=this.position=So(t),{effectivePlacement:n}=this;this._override("effectivePlacement",n);const s=()=>{i&&(this.position=wd(this.contentContainer,i,this._effectiveOffset,this.view),Object.assign(this.outerContainer.style,this._outerContainerStyle))};await this.content?.enterInputMode(e,s)}async exitInputMode(e){await this.content?.exitInputMode(e)}onDragStart(e,t){this._prevXY=[e,t]}onDrag(e,t){const i=e-this._prevXY[0],n=t-this._prevXY[1];this._prevXY=[e,t];const{position:s}=this;if(s){const{view:o}=this,r=e-o.position[0],l=t-o.position[1];if(r<0||r>o.width||l<0||l>o.height-xd)return;this.position=Us(s.x+i,s.y+n)}}onDragEnd(){this._prevXY=[0,0]}};function wd(e,t,i,n){if(!e||!n.container)return t;const s=e.getBoundingClientRect(),{left:o,top:r}=n.container.getBoundingClientRect();let{x:l,y:h}=t;const u=s.left-o-i;u<0&&(l-=u);const p=s.right-o+i-n.width;p>0&&(l-=p);const d=s.top-r-i;d<0&&(h-=d);const m=s.bottom-r+i-n.height;return m>0&&(h-=m),Us(l,h)}a([c({nonNullable:!0})],F.prototype,"view",void 0),a([c()],F.prototype,"info",void 0),a([c()],F.prototype,"options",void 0),a([c()],F.prototype,"position",void 0),a([c()],F.prototype,"content",void 0),a([c({readOnly:!0})],F.prototype,"mode",null),a([c()],F.prototype,"_focused",void 0),a([c({readOnly:!0})],F.prototype,"focused",null),a([c({readOnly:!0})],F.prototype,"outerContainer",void 0),a([c({readOnly:!0})],F.prototype,"contentContainer",null),a([c({readOnly:!0})],F.prototype,"effectivePlacement",null),a([c()],F.prototype,"debug",void 0),a([c()],F.prototype,"_lastPosition",void 0),a([c()],F.prototype,"_screenPoint",null),a([c()],F.prototype,"_rtl",void 0),a([c()],F.prototype,"_effectiveOffset",null),a([c()],F.prototype,"_outerContainerStyle",null),F=a([x("esri.views.interactive.Tooltip")],F);const Td=["top","bottom","leading","trailing"].flatMap(e=>[Ji(`${e}-start`),Ji(e),Ji(`${e}-end`)]);function Ji(e){return`${ci.base}--${e}`}function Ed({classList:e},t){Td.forEach(i=>e.remove(i)),e.add(Ji(t))}const Sd=F;function Pd(e){const t=new Sd(e());return t.addHandles(U(()=>e(),({view:i,options:n,info:s})=>{t.view=i,n!==void 0&&(t.options=n),s!==void 0&&(t.info=s)})),t}function Md(e,t){const i=Rh(t.vertexSpace),{scale:n,orientation:s}=e,{transform:o}=t,r=kd(o);i&&r!=null?(s.actual=Dt(r,"degrees","arithmetic"),s.visible=!0):(s.actual=null,s.visible=!1),i?(n.actual=Qt(Vd(o)),n.visible=!0):(n.actual=null,n.visible=!1)}function kd(e){if(!e)return 0;const t=Cd(e.rotationAxis);return t!=null?t*e.rotationAngle:null}function Cd(e){return Ye(e,Hs)?1:Ye(e,Rd)?-1:null}const Rd=rs(g(),Hs);function Vd(e){return e?Math.max(...e.scale):1}function Ad(e,t){return!(e.type!=="key-down"||e.key!==Ue.enterInputMode||!t||!Od(t.info))&&(t.enterInputMode(),e.preventDefault(),e.stopPropagation(),!0)}function Od(e){const t=e?.sketchOptions;if(!t)return!1;const{inputEnabled:i,visibleElements:n}=t.tooltips;return i&&e.editableFields.some(({name:s})=>s==="x"||s==="y"?n.coordinates:n[s])===!0}function Id(e,t,i){if(!t||!("geographic"in t))return;const n=e.clipboardData?.getData("text");if(!n)return;const s=o=>{e.stopPropagation(),e.preventDefault(),o()};if(t.geographic){const o=dd(n);o&&s(()=>{t.longitude.applyValue(o.longitude),t.latitude.applyValue(o.latitude)})}else{const o=pd(n);o&&s(()=>{t.x.applyValue(o.x),t.y.applyValue(o.y)})}}let ot=class extends tt{constructor(e){super(e),this.helpMessage=void 0,this.viewType=void 0}get visibleElements(){return this.sketchOptions.tooltips.visibleElements}get allFields(){return[]}get editableFields(){return this.allFields.filter(e=>e.visible&&!e.readOnly)}clearInputValues(){this.allFields.forEach(e=>e.clearInputValue())}};a([c()],ot.prototype,"sketchOptions",void 0),a([c()],ot.prototype,"visibleElements",null),a([c()],ot.prototype,"helpMessage",void 0),a([c()],ot.prototype,"viewType",void 0),a([c()],ot.prototype,"allFields",null),a([c()],ot.prototype,"editableFields",null),ot=a([x("esri.views.interactive.tooltip.infos.SketchTooltipInfo")],ot);let Zt=class extends ot{constructor(e){super(e),this.type="draw-circle",this.radius=null,this.xSize=null,this.ySize=null,this.area=We}get allFields(){return[]}};a([c()],Zt.prototype,"type",void 0),a([c()],Zt.prototype,"radius",void 0),a([c()],Zt.prototype,"xSize",void 0),a([c()],Zt.prototype,"ySize",void 0),a([c()],Zt.prototype,"area",void 0),a([c()],Zt.prototype,"allFields",null),Zt=a([x("esri.views.interactive.tooltip.infos.DrawCircleTooltipInfo")],Zt);let M=class extends tt{constructor(e){super(e),this.actual=null,this.lockable=!0,this.id=Ih(),this.inputValue=null,this.readOnly=!1,this.suffix=null,this.visible=!0,this.invalid=!1,this.unlockOnVertexPlacement=!0}get committed(){return this.lockable?this._get("committed"):null}set committed(e){this.lockable&&this._set("committed",e)}get dirty(){return this.inputValue!=null}get locked(){return this.lockable&&this.committed!=null}onInput(e){this.inputValue=e}onCommit(e,t,i){this.lockable?this._onCommitLockable(e,i):this._onCommitNonLockable(i),this.invalid&&e==="commit-and-exit"||i.onCommit(t,e)}_onCommitLockable(e,t){const{inputValue:i,locked:n}=this;n&&Bi(i)?this.unlock():(e==="commit-and-exit"&&!n||i!=null)&&this._parseInputAndLock(t)}_onCommitNonLockable(e){const{inputValue:t}=this;Bi(t)?this.setActual(null):t!=null&&this._parseInputAndSetActual(e)}applyValue(e){this.lockable?this.lock(e):this.setActual(e)}clearInputValue(){this.inputValue=null,this.invalid=!1}setActual(e){this.actual=e,this.clearInputValue()}lock(e){this.lockable&&(this.committed=e??this.actual,this.clearInputValue())}unlock(){this.lockable&&(this.committed=null,this.clearInputValue())}toggleLock(e){this.lockable&&(this.locked?this.unlock():this._parseInputAndLock(e))}getSuffix(e){const{suffix:t}=this;return typeof t=="function"?t(e):t}getFormattedValue(e){const{actual:t,committed:i,format:n}=this;return i!=null?n(i,e):t!=null?n(t,e):null}getRawDisplayValue(e){const{actual:t,committed:i,inputValue:n}=this;return n??(this.lockable&&i!=null?this.formatForInputMode(i,e):t!=null?this.formatForInputMode(t,e):null)}_parseInputAndSetActual(e){const{inputValue:t}=this;if(t==null||Bi(t))return this.setActual(null);const i=this.parse(t,e);i!=null?this.setActual(i):this.invalid=!0}_parseInputAndLock(e){const{inputValue:t,actual:i}=this;if(Bi(t))return this.unlock();if(t==null)return this.lock(i);const n=this.parse(t,e);n!=null?this.lock(n):this.invalid=!0}};function Bi(e){return e!=null&&e.trim()===""}a([c()],M.prototype,"actual",void 0),a([c()],M.prototype,"committed",null),a([c()],M.prototype,"dirty",null),a([c()],M.prototype,"format",void 0),a([c()],M.prototype,"formatForInputMode",void 0),a([c()],M.prototype,"lockable",void 0),a([c()],M.prototype,"locked",null),a([c()],M.prototype,"id",void 0),a([c()],M.prototype,"inputValue",void 0),a([c()],M.prototype,"name",void 0),a([c()],M.prototype,"parse",void 0),a([c()],M.prototype,"readOnly",void 0),a([c()],M.prototype,"suffix",void 0),a([c()],M.prototype,"title",void 0),a([c()],M.prototype,"visible",void 0),a([c()],M.prototype,"invalid",void 0),a([c()],M.prototype,"unlockOnVertexPlacement",void 0),M=a([x("esri.views.interactive.tooltip.fields.TooltipField")],M);let tn=class extends M{constructor(e){super(e),this.showAsZ=!1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.verticalLength.unit;return{name:"elevation",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.verticalLength(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.verticalLength.abbreviation,title:i=>i.messages.sketch[this.showAsZ?"z":"elevation"],unlockOnVertexPlacement:!1,...e}}};a([c()],tn.prototype,"showAsZ",void 0),tn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldElevation")],tn);let en=class extends M{constructor(e){super(e),this.precision=1}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.angle.unit;return{name:"orientation",actual:null,parse:xe({createQuantity:(i,n)=>Dt(i,t(n),"geographic"),sanitize:Za}),format:i=>{const n=gs(i);return Mn(n,"geographic",this.precision)},formatForInputMode:(i,n)=>{const s=gs(i);return n.formatters.scalar(s)},suffix:i=>i.inputUnitInfos.angle.abbreviation,title:i=>i.messages.sketch.orientation,...e}}};a([c()],en.prototype,"precision",void 0),en=a([x("esri.views.interactive.tooltip.fields.TooltipFieldOrientation")],en);let Kn=class extends M{constructor(e){super(e),this.precision=null}normalizeCtorArgs(e){const t=i=>i.inputUnitInfos.length.unit;return{name:"size",actual:null,parse:xe({createQuantity:(i,n)=>ft(i,t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.size,...e}}};a([c()],Kn.prototype,"precision",void 0),Kn=a([x("esri.views.interactive.tooltip.fields.TooltipFieldSize")],Kn);function Xa(e){const t=n=>n.inputUnitInfos.angle.unit,i=n=>n.sketchOptions.values.effectiveDirectionMode;return new M({name:"direction",actual:qs,parse:xe({createQuantity:(n,s)=>Dt(n,t(s),"geographic"),sanitize:Za}),format:(n,s)=>{const o=i(s),r=un(n,o);switch(o){case A.Absolute:return s.formatters.direction(r);case A.Relative:return s.formatters.directionRelative(r);case A.RelativeBilateral:return s.formatters.directionRelativeBilateral(r)}},formatForInputMode:(n,s)=>{const o=un(n,i(s));return s.formatters.scalar(te(o,t(s)))},suffix:n=>n.inputUnitInfos.angle.abbreviation,title:n=>{const s=i(n),{absolute:o,relative:r}=n.messages.sketch.direction;switch(s){case A.Absolute:return o;case A.Relative:case A.RelativeBilateral:return r}},...e})}function qa(e){const t=i=>i.inputUnitInfos.length.unit;return new M({name:"distance",actual:Kt,parse:xe({createQuantity:(i,n)=>ft(Math.max(i,0),t(n))}),format:(i,n)=>n.formatters.length(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.length.abbreviation,title:i=>i.messages.sketch.distance,...e})}function Ld(e){return qa({format:(t,i)=>i.formatters.totalLength(t),title:t=>t.messages.sketch.totalLength,readOnly:!0,...e})}function ja(e){return qa({...e})}function Gd(e){return new tn(e)}function Dd(e){return new en(e)}function zd(e){return mo("scale",{name:"scale",actual:null,parse:xe({createQuantity:t=>Qt(Math.abs(t))}),...e})}function $d(e){const t=i=>i.inputUnitInfos.area.unit;return new M({name:"area",actual:We,parse:xe({createQuantity:(i,n)=>vn(i,t(n))}),format:(i,n)=>n.formatters.area(i),formatForInputMode:(i,n)=>n.formatters.scalar(te(i,t(n))),suffix:i=>i.inputUnitInfos.area.abbreviation,title:i=>i.messages.sketch.area,readOnly:!0,...e})}function Ud(e){return new M({name:"x",actual:qs,parse:fd,format:(t,i)=>i.formatters.longitudeDecimalDegrees(t),formatForInputMode:t=>rd(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.longitude,...e})}function Hd(e){return new M({name:"y",actual:qs,parse:gd,format:(t,i)=>i.formatters.latitudeDecimalDegrees(t),formatForInputMode:t=>ad(t),suffix:t=>t.inputUnitInfos.angle.abbreviation,title:t=>t.messages.sketch.latitude,...e})}function Nd(e){return mo("x",{name:"x",...e})}function Fd(e){return mo("y",{name:"y",...e})}function mo(e,t){return new M({actual:Qt(0),parse:xe({createQuantity:i=>Qt(i)}),format:(i,n)=>n.formatters.scalar(i),formatForInputMode:(i,n)=>n.formatters.scalar(i),title:i=>i.messages.sketch[e],...t})}function Zd(e){return Br(e)||Zs(e)}function yo(e,t,i,...n){return Br(e)?t.apply(void 0,n):Zs(e)?i.apply(void 0,n):null}const Cn=e=>{let t=class extends e{constructor(){super(...arguments),this.longitude=Ud(),this.latitude=Hd(),this.x=Nd(),this.y=Fd(),this.elevation=Gd(),this.geographic=!1}get effectiveX(){return this.geographic?this.longitude:this.x}get effectiveY(){return this.geographic?this.latitude:this.y}get key(){return{longitude:this.longitude.actual,latitude:this.latitude.actual,x:this.x.actual,y:this.y.actual,elevation:this.elevation.actual,geographic:this.geographic}}setLocationFromPoint(i,n=i?.spatialReference){if(this.geographic=!!n&&Zd(n),i==null)return this._setActualLonLat(null,null),void this._setActualXY(null,null);if(this.geographic){const s=ac(i,Bd);this._setActualLonLat(Ke(s?.[0]),Ke(s?.[1]))}else this._setActualXY(Qt(i.x),Qt(i.y))}_setActualLonLat(i,n){this.longitude.actual=i,this.latitude.actual=n}_setActualXY(i,n){this.x.actual=i,this.y.actual=n}};return a([c()],t.prototype,"geographic",void 0),a([c()],t.prototype,"effectiveX",null),a([c()],t.prototype,"effectiveY",null),a([c()],t.prototype,"key",null),t=a([x("esri.views.interactive.tooltip.infos.TooltipInfoWithCoordinates")],t),t},Bd=[0,0];let hi=class extends Cn(ot){constructor(e){super(e),this.type="draw-mesh",this.orientation=Dd({lockable:!1}),this.scale=zd({lockable:!1})}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation,this.orientation,this.scale]}};a([c()],hi.prototype,"helpMessage",void 0),a([c()],hi.prototype,"allFields",null),hi=a([x("esri.views.interactive.tooltip.infos.DrawMeshTooltipInfo")],hi);let ui=class extends Cn(ot){constructor(e){super(e),this.type="draw-point"}get allFields(){return[this.longitude,this.latitude,this.x,this.y,this.elevation]}};a([c()],ui.prototype,"helpMessage",void 0),a([c()],ui.prototype,"allFields",null),ui=a([x("esri.views.interactive.tooltip.infos.DrawPointTooltipInfo")],ui);let Oe=class extends Cn(ot){constructor(e){super(e),this.type="draw-polygon",this.direction=Xa(),this.distance=ja(),this.area=$d(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.area]}};a([c()],Oe.prototype,"xyMode",void 0),a([c()],Oe.prototype,"helpMessage",void 0),a([c()],Oe.prototype,"allFields",null),Oe=a([x("esri.views.interactive.tooltip.infos.DrawPolygonTooltipInfo")],Oe);let Ie=class extends Cn(ot){constructor(e){super(e),this.type="draw-polyline",this.direction=Xa(),this.distance=ja(),this.totalLength=Ld(),this.xyMode="direction-distance"}get allFields(){return[this.direction,this.distance,this.longitude,this.latitude,this.x,this.y,this.elevation,this.totalLength]}};a([c()],Ie.prototype,"helpMessage",void 0),a([c()],Ie.prototype,"xyMode",void 0),a([c()],Ie.prototype,"allFields",null),Ie=a([x("esri.views.interactive.tooltip.infos.DrawPolylineTooltipInfo")],Ie);let re=class extends ot{constructor(e){super(e),this.type="draw-rectangle",this.xSize=Kt,this.ySize=Kt,this.area=We}get allFields(){return[]}};a([c()],re.prototype,"type",void 0),a([c()],re.prototype,"xSize",void 0),a([c()],re.prototype,"ySize",void 0),a([c()],re.prototype,"area",void 0),a([c()],re.prototype,"allFields",null),re=a([x("esri.views.interactive.tooltip.infos.DrawRectangleTooltipInfo")],re);function _o(e){return fc(e)?gc(e)||Zs(e)||mc(e)||yc(e)?Dh:e:zh(e)}function Yd(e,t=vo()){return Wd(e,t,!1)}function Wd(e,t,i=e.hasZ){const n=_o(e.spatialReference),s=_c(n);if(s==null)return null;const o=(l,h)=>!(h.length<2)&&(N(l,h[0],h[1],i&&h[2]||0),!0);let r=0;for(const l of e.rings){const h=l.length;if(h<3)continue;const{positionsWorldCoords:u}=t;for(;u.length{const h=Vn(e).mode,u=s[l].elevation;h==="relative-to-ground"||h==="relative-to-scene"||h==="on-the-ground"?u.lock(bo(e)):u.unlock()},r=l=>{if(t){const h=s[l].direction;h.committed=t.angle,h.unlockOnVertexPlacement=!1,n.values.directionMode=t.mode}};switch(i){case"polygon":case"polyline":o(i),r(i);break;case"point":case"mesh":o(i)}}function vf(e,t){const{drawOperation:i,view:n}=t,s=xo(t),o=Vn(t);if(n.type==="2d"||!e||o.mode!=="absolute-height"||i?.numCommittedVertices!==1||!s||s.type!=="draw-polyline"&&s.type!=="draw-polygon"||s.elevation.locked)return;const[r,l,h]=e,u=Vf(r,l,h,o,t);u!=null&&s.elevation.lock(u)}function hr(e){xo(e)?.allFields.forEach(t=>{t.unlockOnVertexPlacement&&t.unlock()})}function xo({geometryType:e,graphic:t,tooltipInfos:i}){return e==="multipoint"||t?.geometry?.type!==xf[e]?null:i[e]}const xf={point:"point",mesh:"mesh",polyline:"polyline",polygon:"polygon",circle:"polygon",rectangle:"polygon"};function bf(e,t){switch(e?.type){case"draw-point":wf(e,t);break;case"draw-polyline":Ef(e,t);break;case"draw-polygon":Sf(e,t);break;case"draw-rectangle":Mf(e,t);break;case"draw-circle":kf(e,t);break;case"draw-mesh":Tf(e,t)}}function wf(e,t){const i=t.graphic?.geometry;i?.type==="point"&&(el(e,i,t),e.helpMessage=io("point",i))}function Tf(e,t){const{graphic:i,view:n}=t,s=i?.geometry;n.type!=="3d"||s&&s.type!=="mesh"||(el(e,s?.origin,t),s&&Md(e,s),e.helpMessage=bu(i,n))}function el(e,t,i){const{drawOperation:n,view:s,sketchOptions:o}=i,{cursorVertex:r}=n;if(e.sketchOptions=o,e.viewType=s.type,e.setLocationFromPoint(t,ti(i)),nl(e.elevation,i),!r)return void(n.constraints=void 0);const l=r;n.constraints={context:al(l,i),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:null,direction:null}}function Ef(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polyline"||(il(e,t),e.totalLength.actual=n.lastVertex?(s?yf(s):null)??Kt:null,e.helpMessage=io("polyline",s))}function Sf(e,t){const{createOperationGeometry:i,drawOperation:n}=t,s=i!=null?i.full:null;s&&s.type!=="polygon"||(il(e,t),e.area.actual=n.lastVertex?(s?Ka(s):null)??We:null,e.helpMessage=io("polygon",s))}function il(e,t){const{drawOperation:i,sketchOptions:n,view:s}=t,{cursorVertex:o,lastVertex:r,secondToLastVertex:l}=i,h=n.values.effectiveDirectionMode;e.sketchOptions=n,e.viewType=s.type;const u=r&&o?Rn(r,o)??Kt:null;if(e.distance.actual=u,e.distance.readOnly=r==null,e.direction.actual=null,e.direction.readOnly=!0,r&&o&&(h==="absolute"||l)){const m=cp(l,r,o,h);e.direction.actual=m??th,e.direction.readOnly=!1}e.setLocationFromPoint(o,ti(t)),nl(e.elevation,t);const p=Pf(r,t);e.xyMode=p,e.direction.visible=p==="direction-distance",e.distance.visible=p==="direction-distance",e.effectiveX.visible=p==="coordinates",e.effectiveY.visible=p==="coordinates";const d=o??r;i.constraints=d?{context:al(d,t),x:e.x.committed,y:e.y.committed,longitude:e.longitude.committed,latitude:e.latitude.committed,elevation:e.elevation.committed,distance:e.distance.committed,direction:e.direction.committed}:void 0}function Pf(e,{sketchOptions:t}){const i=t.tooltips.xyMode;return i==="auto"?e?"direction-distance":"coordinates":i}function Mf(e,t){e.sketchOptions=t.sketchOptions,e.xSize=ol(t),e.ySize=rl(t),e.area=sl(t)}function kf(e,t){const{forceUniformSize:i,sketchOptions:n}=t;e.sketchOptions=n,e.radius=i?Cf(t):null,e.xSize=i?null:ol(t),e.ySize=i?null:rl(t),e.area=sl(t)}function nl(e,t){const{drawOperation:i}=t,n=i?.cursorVertex??i?.lastVertex;e.actual=rf(n)??bo(t),e.visible=i.hasZ,e.readOnly=!1,e.showAsZ=!0}function sl(e){const t=e.createOperationGeometry?.full;return t?.type!=="polygon"?We:Ka(t)??We}function ol(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.left,t.right):null)??Kt}function rl(e){const t=e.createOperationGeometry?.rectangle?.midpoints;return(t!=null?Rn(t.top,t.bottom):null)??Kt}function Cf({createOperationGeometry:e}){return(e?.circle?.center!=null&&e.circle.edge!=null?Rn(e.circle.center,e.circle.edge):null)??Kt}function Rf(e){const{geometryType:t,tooltipInfos:i}=e;switch(t){case"point":case"mesh":case"polyline":case"polygon":{const n=i[t].elevation.committed;return n?_n(n,"meters")/Fs(ti(e)):void 0}default:return}}function Vf(e,t,i,n,s){const{view:o,drawOperation:r}=s;if(o.type!=="3d"||!r)return;i??=0;const l=ti(s),h=Vn(s),u=Nr(o,e,t,i,l,h,n);return Qa(u,l)??bo(s)}function Vn(e){return e.drawOperation.elevationInfo??gn}function ti(e){return e.drawOperation.coordinateHelper.spatialReference}function bo(e){const t=Fs(ti(e));return ft(e.defaultZ*t,"meters")}function al(e,t){return gp(e,t.view,ti(t),Vn(t),t.drawOperation.coordinateHelper.hasZ(),t.sketchOptions.values.effectiveDirectionMode)}var Se;(function(e){e[e.WhenToolEditable=0]="WhenToolEditable",e[e.WhenToolNotEditable=1]="WhenToolNotEditable",e[e.Always=2]="Always"})(Se||(Se={}));let Af=class{constructor(){this._isToolEditable=!0,this._manipulators=new ss,this._resourceContexts={manipulator3D:{}},this._attached=!1}set isToolEditable(e){this._isToolEditable=e}get length(){return this._manipulators.length}add(e,t=Se.WhenToolEditable){this.addMany([e],t)}addMany(e,t=Se.WhenToolEditable){for(const i of e){const n={manipulator:i,visibilityPredicate:t,attached:!1};this._manipulators.add(n),this._attached&&this._updateManipulatorAttachment(n)}}remove(e){for(let t=0;t{this._detachManipulator(e)}),this._manipulators.removeAll()}attach(){this._manipulators.forEach(e=>{this._updateManipulatorAttachment(e)}),this._attached=!0}detach(){this._manipulators.forEach(e=>{this._detachManipulator(e)}),this._attached=!1}destroy(){this.detach(),this._manipulators.forEach(({manipulator:e})=>e.destroy()),this._manipulators.destroy(),this._resourceContexts=null}on(e,t){return this._manipulators.on(e,i=>{t(i)})}forEach(e){for(const t of this._manipulators.items)e(t)}some(e){return this._manipulators.items.some(e)}toArray(){const e=[];return this.forEach(t=>e.push(t.manipulator)),e}intersect(e,t){let i=null,n=Number.MAX_VALUE;return this._manipulators.forEach(({manipulator:s,attached:o})=>{if(!o||!s.interactive)return;const r=s.intersectionDistance(e,t);r!=null&&r{i.dragging&&(t=!0,i.events.emit("drag",{action:"end",start:e,screenPoint:e}))}),t&&(this.view.toolViewManager.activeTool=null)}whenCreated(){return this._creationFinishedResolver.promise}onManipulatorSelectionChanged(){}onActivate(){}onDeactivate(){}onShow(){}onHide(){}onEditableChange(){}onInputEvent(e){}onInputEventAfter(e){}get internallyEditable(){return this.getEditableFlag(we.USER)&&this.getEditableFlag(we.MANAGER)}finishToolCreation(){this.created||this._creationFinishedResolver.resolve(this),this._set("created",!0)}_syncVisible(){if(this.initialized){if(this.visible)this._show();else if(this._hide(),this.active)return void(this.view.activeTool=null)}}_show(){this._updateManipulatorAttachment(),this.onShow()}_hide(){this._updateManipulatorAttachment(),this.onHide()}_updateManipulatorAttachment(){this.visible?this.manipulators.attach():this.manipulators.detach()}};a([c({constructOnly:!0})],B.prototype,"view",void 0),a([c({readOnly:!0})],B.prototype,"active",null),a([c({value:!0})],B.prototype,"visible",null),a([c({value:!0})],B.prototype,"editable",null),a([c({readOnly:!0})],B.prototype,"manipulators",void 0),a([c({readOnly:!0})],B.prototype,"updating",null),a([c()],B.prototype,"cursor",null),a([c({readOnly:!0})],B.prototype,"automaticManipulatorSelection",void 0),a([c()],B.prototype,"hasFocusedManipulators",null),a([c()],B.prototype,"hasGrabbedManipulators",void 0),a([c()],B.prototype,"hasHoveredManipulators",void 0),a([c()],B.prototype,"firstGrabbedManipulator",void 0),a([c({readOnly:!0})],B.prototype,"created",void 0),a([c({readOnly:!0})],B.prototype,"removeIncompleteOnCancel",void 0),B=a([x("esri.views.interactive.InteractiveToolBase")],B);let nn=class extends tt{constructor(e){super(e),this.enabled=!1}};a([c({type:Boolean,nonNullable:!0})],nn.prototype,"enabled",void 0),nn=a([x("esri.views.interactive.sketch.SketchLabelOptions")],nn);const An=nn;let mi=class extends tt{constructor(e){super(e),this.mode="absolute-height"}toJSON(){return{mode:this.mode}}};a([c({type:String,nonNullable:!0})],mi.prototype,"mode",void 0),mi=a([x("esri.views.interactive.sketch.SketchTooltipElevationOptions")],mi);let J=class extends tt{constructor(e){super(e),this.area=!0,this.coordinates=!0,this.direction=!0,this.distance=!0,this.elevation=!0,this.header=!0,this.helpMessage=!1,this.orientation=!0,this.radius=!0,this.rotation=!0,this.scale=!0,this.size=!0,this.totalLength=!0}};a([c({type:Boolean,nonNullable:!0})],J.prototype,"area",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"coordinates",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"direction",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"distance",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"elevation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"header",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"helpMessage",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"orientation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"radius",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"rotation",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"scale",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"size",void 0),a([c({type:Boolean,nonNullable:!0})],J.prototype,"totalLength",void 0),J=a([x("esri.views.interactive.sketch.SketchTooltipVisibleElements")],J);const ll=J;let it=class extends tt{constructor(e){super(e),this.enabled=!1,this.forceEnabled=!1,this.helpMessage=null,this.helpMessageIcon=null,this.inputEnabled=!0,this.elevation=new mi,this.placement="auto",this.offset=null,this.visibleElements=new ll,this.visualVariables=null,this.xyMode="auto"}get effectiveEnabled(){return this.forceEnabled||this.enabled}};a([c({type:Boolean,nonNullable:!0})],it.prototype,"enabled",void 0),a([c()],it.prototype,"forceEnabled",void 0),a([c()],it.prototype,"effectiveEnabled",null),a([c()],it.prototype,"helpMessage",void 0),a([c()],it.prototype,"helpMessageIcon",void 0),a([c({type:Boolean,nonNullable:!0})],it.prototype,"inputEnabled",void 0),a([c({type:mi,nonNullable:!0})],it.prototype,"elevation",void 0),a([c()],it.prototype,"placement",void 0),a([c()],it.prototype,"offset",void 0),a([c({type:ll,nonNullable:!0})],it.prototype,"visibleElements",void 0),a([c()],it.prototype,"visualVariables",void 0),a([c()],it.prototype,"xyMode",void 0),it=a([x("esri.views.interactive.sketch.SketchTooltipOptions")],it);const cl=it;let Le=class extends tt{constructor(e){super(e),this.length=null,this.verticalLength=null,this.area=null}};a([c()],Le.prototype,"length",void 0),a([c()],Le.prototype,"verticalLength",void 0),a([c()],Le.prototype,"area",void 0),Le=a([x("esri.views.interactive.sketch.Units")],Le);const pn=Le;let ae=class extends tt{constructor(e){super(e),this.directionMode="relative",this.relativeDirectionIsBilateral=!1}get effectiveDirectionMode(){switch(this.directionMode){case"relative":return this.relativeDirectionIsBilateral?A.RelativeBilateral:A.Relative;case"absolute":return A.Absolute}}get displayUnits(){return this._get("displayUnits")??new pn}set displayUnits(e){this._set("displayUnits",e)}get inputUnits(){return this._get("inputUnits")??new pn}set inputUnits(e){this._set("inputUnits",e)}};a([c({type:String,nonNullable:!0})],ae.prototype,"directionMode",void 0),a([c({type:Boolean,nonNullable:!0})],ae.prototype,"relativeDirectionIsBilateral",void 0),a([c()],ae.prototype,"effectiveDirectionMode",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"displayUnits",null),a([c({type:pn,nonNullable:!0})],ae.prototype,"inputUnits",null),ae=a([x("esri.views.interactive.sketch.SketchValueOptions")],ae);const hl=ae;let Ge=class extends tt{constructor(e){super(e),this.labels=new An,this.tooltips=new cl,this.values=new hl}};a([c({nonNullable:!0,type:An})],Ge.prototype,"labels",void 0),a([c({nonNullable:!0,type:cl})],Ge.prototype,"tooltips",void 0),a([c({nonNullable:!0,type:hl})],Ge.prototype,"values",void 0),Ge=a([x("esri.views.interactive.sketch.SketchOptions")],Ge);const ul=Ge;let P=class extends Ce.EventedMixin(B){constructor(e){super(e),this._graphic=null,this._coordinateFormatterLoadTask=null,this._createOperationGeometry=null,this.defaultZ=0,this.directionOptions=null,this.geometryType=null,this.hasZ=!0,this.geometryToPlace=null,this.snappingManager=null,this.snapToScene=!1,this.sketchOptions=new ul}initialize(){const{view:e}=this;this.internalGraphicsLayer=new Xs({listMode:"hide",internal:!0}),this.view.map.layers.add(this.internalGraphicsLayer);const t=this.drawOperation=this.makeDrawOperation();this.tooltipInfos=_f(e.type,this.sketchOptions);const i=Pd(()=>({view:e,options:this.sketchOptions.tooltips}));this.tooltip=i,cr(this._tooltipsContext),this._coordinateFormatterLoadTask=Ll(()=>ru()),this.addHandles([t.on("vertex-add",n=>this.onVertexAdd(n)),t.on("vertex-remove",n=>this.onVertexRemove(n)),t.on("vertex-update",n=>this.onVertexUpdate(n)),t.on("cursor-update",n=>this.onCursorUpdate(n)),t.on("cursor-remove",()=>this._updateGraphic()),t.on("complete",n=>this.onComplete(n)),this._coordinateFormatterLoadTask,i.on("paste",n=>Id(n,this.activeTooltipInfo)),U(()=>this.cursor,n=>{t.cursor=n},ke),Po(()=>{const{activeTooltipInfo:n,sketchOptions:s}=this;bf(n,this._tooltipsContext),i.info=s.tooltips.effectiveEnabled?n:null}),Po(()=>{t.constraintZ=Rf(this._tooltipsContext)},$s)]),this.finishToolCreation()}destroy(){this.drawOperation=dt(this.drawOperation),this.tooltip=dt(this.tooltip),this._destroyAllVisualizations(),this.view.map.remove(this.internalGraphicsLayer),this.internalGraphicsLayer=dt(this.internalGraphicsLayer),this._set("view",null)}get _drawSpatialReference(){return this.drawOperation.coordinateHelper.spatialReference}get _tooltipsContext(){return{createOperationGeometry:this._createOperationGeometry,defaultZ:this.defaultZ,directionOptions:this.directionOptions,drawOperation:this.drawOperation,forceUniformSize:this.forceUniformSize,geometryType:this.geometryType,graphic:this.graphic,sketchOptions:this.sketchOptions,tooltipInfos:this.tooltipInfos,view:this.view}}get canRedo(){return this.drawOperation.canRedo}get canUndo(){return this.drawOperation.canUndo}set centered(e){this._set("centered",e),this._updateGraphic()}get cursor(){return this._get("cursor")}set cursor(e){this._set("cursor",e)}set enabled(e){this.drawOperation.interactive=e,this._set("enabled",e)}set forceUniformSize(e){this._set("forceUniformSize",e),this._updateGraphic()}get graphic(){return this._graphic}set graphicSymbol(e){this._set("graphicSymbol",e),this._graphic!=null&&(this._graphic.symbol=e)}set mode(e){const t=this.drawOperation;t&&(t.drawingMode=e),this._set("mode",e)}get updating(){return this.drawOperation?.updating??!1}get undoRedo(){const{view:{type:e,map:t}}=this;return e==="2d"&&t&&"undoRedo"in t&&t.undoRedo instanceof Ct?t.undoRedo:null}set undoRedo(e){this._override("undoRedo",e)}completeCreateOperation(){this.drawOperation.complete()}onInputEvent(e){this.destroyed||Ad(e,this.tooltip)||this.drawOperation.onInputEvent(e)}redo(){this.drawOperation.redo()}reset(){}undo(){this.drawOperation.undo(),this.drawOperation.numCommittedVertices===0&&cr(this._tooltipsContext)}_destroyAllVisualizations(){this.removeHandles(mt.outline),this.removeHandles(mt.regularVertices),this.removeHandles(mt.activeVertex),this.removeHandles(mt.activeEdge),this.removeHandles(Jn)}_createOrUpdateGraphic(e){if(this._graphic!=null)return this.updateGraphicGeometry(e),this._graphic;const t=new Lt({...this.graphicProperties,symbol:this.graphicSymbol});return this._graphic=t,this.updateGraphicGeometry(e),this.internalGraphicsLayer.add(t),this.addHandles(this.initializeGraphic(t)),this.notifyChange("graphic"),this.addHandles(Y(()=>{this.internalGraphicsLayer.remove(t),this._graphic===t&&(this._graphic=null)}),Jn),t}updateGraphicGeometry(e){this._graphic.geometry=e}_getCreateOperationGeometry(e={operationComplete:!1}){if(this.drawOperation==null)return;const{coordinateHelper:t,view:i,visualizationCursorVertex:n,lastVertex:s,committedVertices:o,geometryIncludingUncommittedVertices:r,numCommittedVertices:l}=this.drawOperation;if(!(l>0||n!=null))return;const h=e.operationComplete?o:r,u=h.length,p=n!=null?t.pointToArray(n):null,d=this._drawSpatialReference,m=i.type==="3d"&&i.viewingMode==="global",f=new hu;f.committedVertices=o,f.cursorVertex=p;const{geometryType:_}=this;switch(_){case"point":case"mesh":f.full=t.arrayToPoint(h[0]);break;case"multipoint":f.full=u>0?gu(h,d):null;break;case"polyline":case"polygon":u>0&&(f.full=_==="polygon"?Oi([h],d,m,!0):Yo([h],d,m),f.cursorEdge=p!=null&&s&&!gi(n,s)?Yo([[p,t.pointToArray(s)]],d,m):null,f.outline=u>1?f.full:null);break;case"circle":case"rectangle":{if(f.committedVertices=f.cursorVertex=null,!u)break;const y=fu(i,h[0]),w=h[0],b=y.makeMapPoint(w[0]+If*i.resolution,w[1]);_==="circle"?u===1&&e.operationComplete?f.circle=Xo([w,b],y,!0):u===2&&(this.forceUniformSize?f.circle=Xo(h,y,this.centered):f.rectangle=yu(h,y,this.centered)):u===1&&e.operationComplete?f.rectangle=Wo([w,b],y,!0):u===2&&(f.rectangle=this.forceUniformSize?Wo(h,y,this.centered):mu(h,y,this.centered)),f.full=f.circle!=null?f.circle.geometry:f.rectangle?.geometry,f.outline=f.full?.type==="polygon"?f.full:null;break}default:return null}return f}initializeGraphic(e){return Y()}onComplete(e){if(!this.drawOperation)return;this._updateGraphic();let t=null;if(this.drawOperation.isCompleted){const i=this._getCreateOperationGeometry({operationComplete:!0});i!=null&&(t=this._createOrUpdateGraphic(i.full))}this._createOperationGeometry=null,this.emit("complete",{graphic:t,...e})}onCursorUpdate(e){this._updateGraphic(),this.emit("cursor-update",e)}onDeactivate(){const{drawOperation:e}=this;e&&(e.isCompleted||e.cancel())}onOutlineChanged(e){return Y()}onCursorEdgeChanged(e){return Y()}onVertexAdd(e){hr(this._tooltipsContext),this._updateGraphic(),vf(e.vertices.at(0)?.coordinates,this._tooltipsContext),this.emit("vertex-add",e)}onVertexRemove(e){hr(this._tooltipsContext),this._updateGraphic(),this.emit("vertex-remove",e)}onVertexUpdate(e){this._updateGraphic(),this.emit("vertex-update",e)}_updateGraphic(){const e=this._getCreateOperationGeometry();this._createOperationGeometry=e,e!=null?(e.cursorEdge!=null?this.addHandles(this.onCursorEdgeChanged(e.cursorEdge),mt.activeEdge):this.removeHandles(mt.activeEdge),e.outline!=null?this.addHandles(this.onOutlineChanged(e.outline),mt.outline):this.removeHandles(mt.outline),e.committedVertices!=null?this.addHandles(this.onRegularVerticesChanged(e.committedVertices),mt.regularVertices):this.removeHandles(mt.regularVertices),e.cursorVertex!=null?this.addHandles(this.onActiveVertexChanged(e.cursorVertex),mt.activeVertex):this.removeHandles(mt.activeVertex),e.full!=null?this._createOrUpdateGraphic(e.full):this.removeHandles(Jn)):this._destroyAllVisualizations()}get activeTooltipInfo(){return this._coordinateFormatterLoadTask?.finished?xo(this._tooltipsContext):null}};a([c()],P.prototype,"_coordinateFormatterLoadTask",void 0),a([c()],P.prototype,"_createOperationGeometry",void 0),a([c()],P.prototype,"_tooltipsContext",null),a([c({value:!0})],P.prototype,"centered",null),a([c()],P.prototype,"cursor",null),a([c({nonNullable:!0})],P.prototype,"defaultZ",void 0),a([c({constructOnly:!0})],P.prototype,"directionOptions",void 0),a([c()],P.prototype,"drawOperation",void 0),a([c({value:!0})],P.prototype,"enabled",null),a([c({value:!0})],P.prototype,"forceUniformSize",null),a([c({constructOnly:!0})],P.prototype,"geometryType",void 0),a([c()],P.prototype,"graphic",null),a([c({constructOnly:!0})],P.prototype,"graphicProperties",void 0),a([c()],P.prototype,"graphicSymbol",null),a([c({constructOnly:!0})],P.prototype,"hasZ",void 0),a([c({constructOnly:!0})],P.prototype,"geometryToPlace",void 0),a([c()],P.prototype,"mode",null),a([c()],P.prototype,"snappingManager",void 0),a([c()],P.prototype,"snapToScene",void 0),a([c()],P.prototype,"tooltip",void 0),a([c()],P.prototype,"tooltipInfos",void 0),a([c({constructOnly:!0,type:ul})],P.prototype,"sketchOptions",void 0),a([c()],P.prototype,"updating",null),a([c({constructOnly:!0,nonNullable:!0})],P.prototype,"view",void 0),a([c({constructOnly:!0})],P.prototype,"undoRedo",null),a([c()],P.prototype,"activeTooltipInfo",null),P=a([x("esri.views.draw.DrawGraphicTool")],P);const Jn=Symbol("create-operation-graphic"),mt={outline:Symbol("outline-visual"),regularVertices:Symbol("regular-vertices-visual"),activeVertex:Symbol("active-vertex-visual"),activeEdge:Symbol("active-edge-visual")};function Of(e){switch(e){case"point":case"polyline":case"polygon":case"multipoint":return e;case"circle":case"rectangle":return"segment";case"mesh":return"point"}}const If=48,pl="click";let Lf=class{constructor({consumesClicks:e,grabbableForEvent:t}){this.events=new Ce,this.interactive=!0,this.selectable=!1,this.cursor=null,this.grabbable=!0,this.consumesClicks=e,this.grabbableForEvent=t}destroy(){}intersectionDistance(e,t){return 0}attach(){}detach(){}onElevationChange(){}onViewChange(){}};var D;(function(e){e[e.Z=0]="Z",e[e.M=1]="M"})(D||(D={}));let Gf=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(G())}pointToVector(e){return this._tag(de(e.x,e.y))}arrayToVector(e){return this._tag(de(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=void 0,t.m=void 0,t.hasZ=!1,t.hasM=!1,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return Ur(n,e,t,i)}addDelta(e,t,i){e[0]+=t,e[1]+=i}distance(e,t){return Hr(e,t)}getZ(e,t=void 0){return t}hasZ(){return!1}getM(e,t=void 0){return t}hasM(){return!1}clone(e){return this._tag(Cc(e))}copy(e,t){return wc(t,e)}fromXYZ(e){return this._tag(de(e[0],e[1]))}toXYZ(e,t=g()){return N(t,e[0],e[1],0)}pointToXYZ(e,t=g()){return N(t,e.x,e.y,0)}equals(e,t){return Tc(e,t)}_tag(e){return e}};class ur{constructor(t,i){this._valueType=t,this.spatialReference=i}createVector(){return this._tag(g())}pointToVector(t){return this._tag(pe(t.x,t.y,this._valueType===D.Z?t.z:t.m))}arrayToVector(t){return this._tag(pe(t[0],t[1],t[2]||0))}vectorToArray(t){return[t[0],t[1],t[2]]}pointToArray(t){return this._valueType===D.Z?[t.x,t.y,t.z]:[t.x,t.y,t.m]}vectorToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}arrayToPoint(t,i=new C){return i.x=t[0],i.y=t[1],i.z=this._valueType===D.Z?t[2]:void 0,i.m=this._valueType===D.M?t[2]:void 0,i.spatialReference=this.spatialReference,i}vectorToDehydratedPoint(t,i){if(!t)return;i??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const n=this._valueType===D.Z,s=this._valueType===D.M;return i.x=t[0],i.y=t[1],i.z=n?t[2]:void 0,i.m=s?t[2]:void 0,i.hasZ=n,i.hasM=s,i.spatialReference=this.spatialReference,i}lerp(t,i,n,s){return Pe(s,t,i,n)}addDelta(t,i,n,s){t[0]+=i,t[1]+=n,this._valueType===D.Z&&(t[2]+=s)}distance(t,i){return this._valueType===D.Z?ge(t,i):Hr(t,i)}getZ(t,i=void 0){return this._valueType===D.Z?t[2]:i}hasZ(){return this._valueType===D.Z}getM(t,i=void 0){return this._valueType===D.M?t[2]:i}hasM(){return this._valueType===D.M}clone(t){return this._tag(lc(t))}copy(t,i){return rt(i,t)}fromXYZ(t,i=0,n=0){return this._tag(pe(t[0],t[1],this._valueType===D.Z?t.length>2?t[2]:i:n))}toXYZ(t,i=g()){return N(i,t[0],t[1],this._valueType===D.Z?t[2]:0)}pointToXYZ(t,i=g()){return N(i,t.x,t.y,this._valueType===D.Z?t.z??0:0)}equals(t,i){return Ye(t,i)}_tag(t){return t}}let Df=class{constructor(e){this.spatialReference=e}createVector(){return this._tag(jr())}pointToVector(e){return this._tag(Hn(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(Hn(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}arrayToPoint(e,t=new C){return t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.spatialReference=this.spatialReference,t}vectorToDehydratedPoint(e,t){if(e)return t??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},t.x=e[0],t.y=e[1],t.z=e[2],t.m=e[3],t.hasZ=!0,t.hasM=!0,t.spatialReference=this.spatialReference,t}lerp(e,t,i,n){return yh(n,e,t,i)}addDelta(e,t,i,n){e[0]+=t,e[1]+=i,e[2]+=n}distance(e,t){return ge(e,t)}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(xh(e))}copy(e,t){return _h(t,e)}fromXYZ(e,t=0,i=0){return this._tag(Hn(e[0],e[1],e.length>2?e[2]:t,i))}toXYZ(e,t=g()){return N(t,e[0],e[1],e[2])}pointToXYZ(e,t=g()){return N(t,e.x,e.y,e.z??0)}equals(e,t){return vh(e,t)}_tag(e){return e}};function dl(e,t,i){return e&&t?new Df(i):t?new ur(D.M,i):e?new ur(D.Z,i):new Gf(i)}function zf(e,t){if(!t.supported)return;let i=1/0,n=-1/0;const s=t.upperBoundX-t.lowerBoundX;e.forEach(r=>{let l=r.pos[0];for(;lt.upperBoundX;)l-=s;i=Math.min(i,l),n=Math.max(n,l),r.pos[0]=l});const o=n-i;s-o{r.pos[0]<0&&(r.pos[0]+=s)})}function $f(e,t){const i=$r(e);return t===Ti.Global&&i?{supported:!0,lowerBoundX:i.valid[0],upperBoundX:i.valid[1]}:{supported:!1,lowerBoundX:null,upperBoundX:null}}let Gi=class{constructor(e){this.component=e,this.leftEdge=null,this.rightEdge=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(e){this._pos=e,this.component.unnormalizeVertexPositions()}};class Jt{constructor(t,i,n){this.component=t,this.leftVertex=i,this.rightVertex=n,this.type="edge",i.rightEdge=this,n.leftEdge=this}}class On{constructor(t,i){this._spatialReference=t,this._viewingMode=i,this.vertices=[],this.edges=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||zf(this.vertices,$f(this._spatialReference,this._viewingMode))}updateVertexIndex(t,i){if(this.vertices.length===0)return;const n=this.vertices[0];let s=null,o=t,r=i;do s=o,s.index=r++,o=s.rightEdge?s.rightEdge.rightVertex:null;while(o!=null&&o!==n);s.leftEdge&&s!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(s),this.vertices.length-1)}getFirstVertex(){return this.vertices.at(0)}getLastVertex(){return this.vertices.at(-1)}isClosed(){return this.vertices.length>2&&this.vertices[0].leftEdge!==null}swapVertices(t,i){const n=this.vertices[t];this.vertices[t]=this.vertices[i],this.vertices[i]=n}iterateVertices(t){if(this.vertices.length===0)return;const i=this.vertices[0];let n=i;do t(n,n.index),n=n.rightEdge!=null?n.rightEdge.rightVertex:null;while(n!==i&&n!=null)}}let dn=class fl extends Ce{constructor(t,i){super(),this.type=t,this.coordinateHelper=i,this._geometry=null,this._dirty=!0,this.components=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon();break;case"mesh":break;default:Hh(this.type)}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}get allVertices(){return Array.from(this.iterateVertices())}*iterateVertices(){for(const t of this.components)for(const i of t.vertices)yield i}notifyChanges(t){this._dirty=!0,this.emit("change",t)}_toPoint(){return this.components.length===0||this.components[0].vertices.length===0?null:this.coordinateHelper.vectorToPoint(this.components[0].vertices[0].pos)}_toPolyline(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[];let o=n.vertices.find(l=>l.leftEdge==null);const r=o;do s.push(i(o.pos)),o=o.rightEdge?o.rightEdge.rightVertex:null;while(o&&o!==r);t.push(s)}return new fi({paths:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const t=[],i=this.coordinateHelper.vectorToArray;for(const n of this.components){if(n.vertices.length<1)continue;const s=[],o=n.vertices[0];let r=o;const l=r;do s.push(i(r.pos)),r=r.rightEdge!=null?r.rightEdge.rightVertex:null;while(r&&r!==l);n.isClosed()&&s.push(i(o.pos)),t.push(s)}return new De({rings:t,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,i){const n=t.spatialReference,s=dl(t.hasZ,t.hasM,n),o=new fl(t.type,s);switch(t.type){case"polygon":Uf(o,t,i);break;case"polyline":Hf(o,t,i);break;case"point":pr(o,t,i);break;case"mesh":pr(o,t.origin,i),o._geometry=t,o._dirty=!1}return o}};function Uf(e,t,i){const n=t.spatialReference,s=e.coordinateHelper,o=t.rings;for(let r=0;r2&&Fe(l[0],l[l.length-1]),p=u?l.length-1:l.length;for(let m=0;mthis.operation.apply(t)),this._editGeometry.components.forEach(t=>t.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:this._undone?"redo":"apply",updatedVertices:this._vertices})}undo(){this._vertices.forEach(t=>this.operation.undo(t)),this._editGeometry.notifyChanges({operation:"undo",updatedVertices:this._vertices}),this._undone=!0}canAccumulate(t){if(this._undone||t._vertices.length!==this._vertices.length)return!1;for(let i=0;ithis.operation.accumulate(i,t.operation)),this.operation.accumulateParams(t.operation),this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:"apply",updatedVertices:this._vertices}),!0)}};var nt;(function(e){e[e.CUMULATIVE=0]="CUMULATIVE",e[e.REPLACE=1]="REPLACE"})(nt||(nt={}));let Ff=class{constructor(e,t,i=0){this._editGeometry=e,this._vertices=t,this._minNumberOfVertices=i,this.removedVertices=null}apply(){let e="redo";if(this.removedVertices==null){const t=this.removedVertices=[];this._vertices.forEach(i=>{const n=this._removeVertex(i);n!=null&&t.push(n)}),e="apply"}else this.removedVertices.forEach(t=>{this._removeVertex(t.removedVertex)});this._editGeometry.notifyChanges({operation:e,removedVertices:this._vertices})}undo(){this.removedVertices?.forEach(e=>{this._undoRemoveVertex(e)}),this._editGeometry.notifyChanges({operation:"undo",addedVertices:this._vertices})}accumulate(){return!1}_removeVertex(e){const t=e.component;if(t.vertices.length<=this._minNumberOfVertices)return null;const i={removedVertex:e,createdEdge:null},n=e.leftEdge,s=e.rightEdge;return t.vertices.splice(t.vertices.indexOf(e),1),n&&(t.edges.splice(t.edges.indexOf(n),1),n.leftVertex.rightEdge=null),s&&(t.edges.splice(t.edges.indexOf(s),1),s.rightVertex.leftEdge=null),e.index===0&&s&&this._vertices.length>0&&t.swapVertices(t.vertices.indexOf(s.rightVertex),0),n&&s&&(i.createdEdge=new Jt(t,n.leftVertex,s.rightVertex),t.edges.push(i.createdEdge)),s&&t.updateVertexIndex(s.rightVertex,s.rightVertex.index-1),i}_undoRemoveVertex(e){const t=e.removedVertex,i=e.removedVertex.component,n=t.leftEdge,s=t.rightEdge;e.createdEdge&&i.edges.splice(i.edges.indexOf(e.createdEdge),1),i.vertices.push(t),n&&(i.edges.push(n),n.leftVertex.rightEdge=n),s&&(i.edges.push(s),s.rightVertex.leftEdge=s),i.updateVertexIndex(t,t.index)}},Zf=class{constructor(e,t,i){this._editGeometry=e,this._edge=t,this._t=i,this.createdVertex=null,this._left=null,this._right=null}apply(){let e="redo";const t=this._edge,i=t.component,n=t.leftVertex,s=t.rightVertex;i.edges.splice(i.edges.indexOf(t),1),this.createdVertex==null&&(e="apply",this.createdVertex=new Gi(t.component)),i.vertices.push(this.createdVertex),this.createdVertex.pos=this._editGeometry.coordinateHelper.lerp(t.leftVertex.pos,t.rightVertex.pos,this._t,this._editGeometry.coordinateHelper.createVector()),this._left==null&&(this._left=new Jt(i,n,this.createdVertex)),this._left.leftVertex.leftEdge?i.edges.push(this._left):i.edges.unshift(this._left),n.rightEdge=this._left,this._right==null&&(this._right=new Jt(i,this.createdVertex,s)),i.edges.push(this._right),s.leftEdge=this._right,i.updateVertexIndex(this.createdVertex,n.index+1),this._editGeometry.notifyChanges({operation:e,addedVertices:[this.createdVertex]})}undo(){if(this.createdVertex==null||this._left==null||this._right==null)return null;const e=this._edge,t=e.component,i=this.createdVertex.leftEdge,n=this.createdVertex.rightEdge,s=i?.leftVertex,o=n?.rightVertex;t.vertices.splice(t.vertices.indexOf(this.createdVertex),1),t.edges.splice(t.edges.indexOf(this._left),1),t.edges.splice(t.edges.indexOf(this._right),1),this._edge.leftVertex.leftEdge?t.edges.push(this._edge):t.edges.unshift(this._edge),s&&(s.rightEdge=e),o&&(o.leftEdge=e),s&&t.updateVertexIndex(s,s.index),this._editGeometry.notifyChanges({operation:"undo",removedVertices:[this.createdVertex]})}accumulate(){return!1}},Bf=class yl{constructor(t,i,n){this._editGeometry=t,this._vertex=i,this._pos=n}apply(){const t=this._originalPosition==null;t&&(this._originalPosition=this._vertex.pos),this._apply(t?"apply":"redo")}undo(){this._vertex.pos=this._originalPosition,this._editGeometry.notifyChanges({operation:"undo",updatedVertices:[this._vertex]})}accumulate(t){return t instanceof yl&&t._vertex===this._vertex&&(this._pos=t._pos,this._apply("apply"),!0)}_apply(t){this._vertex.pos=this._pos,this._editGeometry.components.forEach(i=>i.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:[this._vertex]})}},Yf=class{constructor(e,t){this._editGeometry=e,this._component=t,this._createdEdge=null}apply(){let e="redo";if(this._createdEdge==null){e="apply";const t=this._component.getFirstVertex(),i=this._component.getLastVertex();if(this._component.isClosed()||this._component.vertices.length<3||t==null||i==null)return;this._createdEdge=new Jt(this._component,i,t)}this._createdEdge.leftVertex.rightEdge=this._createdEdge,this._createdEdge.rightVertex.leftEdge=this._createdEdge,this._component.edges.push(this._createdEdge),this._editGeometry.notifyChanges({operation:e})}undo(){this._createdEdge!=null&&(Dr(this._component.edges,this._createdEdge),this._createdEdge.leftVertex.rightEdge=null,this._createdEdge.rightVertex.leftEdge=null,this._editGeometry.notifyChanges({operation:"undo"}))}accumulate(){return!1}},dr=class _l{constructor(t,i,n,s){this._editGeometry=t,this.dx=i,this.dy=n,this.dz=s,this._firstTime=!0}apply(){const t=this._firstTime?"apply":"redo";this._firstTime=!1,this._apply(t,this.dx,this.dy,this.dz)}undo(){this._apply("undo",-this.dx,-this.dy,-this.dz)}accumulate(t){const i=this._editGeometry.geometry;return t instanceof _l&&t._editGeometry.geometry===i&&(this._apply("apply",t.dx,t.dy,t.dz),this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz,!0)}_apply(t,i,n,s){const o=this._editGeometry.geometry;o.offset(i,n,s);const r=this._editGeometry.components[0].getFirstVertex();if(!r)return;const l=this._editGeometry.coordinateHelper;r.pos=l.pointToVector(o.origin),this._editGeometry.notifyChanges({operation:t,updatedVertices:[r]})}},vl=class xl{constructor(t,i,n,s){this._helper=t,this.dx=i,this.dy=n,this.dz=s}_move(t,i,n,s){this._helper.addDelta(t.pos,i,n,s)}apply(t){this._move(t,this.dx,this.dy,this.dz)}undo(t){this._move(t,-this.dx,-this.dy,-this.dz)}canAccumulate(t){return t instanceof xl}accumulate(t,i){this._move(t,i.dx,i.dy,i.dz)}accumulateParams(t){this.dx+=t.dx,this.dy+=t.dy,this.dz+=t.dz}},Wf=class Ls{get plane(){return this._plane}get requiresSplitEdgeLeft(){return!this._left.isOriginalDirection}get requiresSplitEdgeRight(){return!this._right.isOriginalDirection}get edgeDirection(){return this._edgeDirection}constructor(t,i,n,s=0,o=yi.IMMEDIATE){this._helper=t,this._planeType=i,this._edge=n,this.distance=s,this._plane=at(),this._offsetPlane=at(),this._minDistance=-1/0,this._maxDistance=1/0,this._selectedArrow=1,o===yi.IMMEDIATE&&this._initialize()}_initialize(){this._initializeNeighbors(),this._initializePlane(),this._initializeDistanceConstraints()}_initializeNeighbors(){const t=this._toXYZ(this._edge.leftVertex.pos),i=this._toXYZ(this._edge.leftVertex.leftEdge?.leftVertex?.pos),n=this._toXYZ(this._edge.rightVertex.pos),s=this._toXYZ(this._edge.rightVertex.rightEdge?.rightVertex?.pos);this._edgeDirection=Do(g(),t,n),i?(this._left=this._computeNeighbor(t,i,this._edgeDirection),this._right=this._computeNeighbor(n,s,this._edgeDirection,this._left)):(this._right=this._computeNeighbor(n,s,this._edgeDirection),this._left=this._computeNeighbor(t,i,this._edgeDirection,this._right))}_toXYZ(t){return t!=null?this._helper.toXYZ(t):null}_pointToXYZ(t){return this._toXYZ(this._helper.pointToVector(t))}_computeNeighbor(t,i,n,s){const o=g();if(i){Do(o,t,i);const r=!this._passesBisectingAngleThreshold(o,n);return{start:t,end:i,direction:r?this._bisectVectorsPerpendicular(n,o):o,isOriginalDirection:!r}}return this._helper.hasZ()?s&&(Ot(o,n,s.direction),Ot(o,o,n),le(o,o),Math.sign(o[1])!==Math.sign(n[0])&&fe(o,o,-1)):N(o,-n[1],n[0],0),{start:t,end:i,direction:o,isOriginalDirection:!0}}_passesBisectingAngleThreshold(t,i){const n=Math.abs(wh(i,t));return n>=fr&&n<=Math.PI-fr}_bisectVectorsPerpendicular(t,i){const n=Z(t,i)<0?t:rs(g(),t),s=Math.abs(Z(n,i));if(!(s1-gr))return this._bisectDirection(n,i);const o=Ot(g(),n,[0,0,1]);return le(o,o)}_bisectDirection(t,i){const n=ut(g(),t,i);return le(n,n)}_initializePlane(){const t=this._computeNormalDirection(this._left),i=this._computeNormalDirection(this._right);Z(t,i)<0&&rs(i,i),Ri(this._left.start,this._bisectDirection(t,i),this._plane)}_computeNormalDirection(t){const i=Ot(g(),t.direction,this._edgeDirection);le(i,i);const n=Ot(g(),this._edgeDirection,i);return this._planeType===Gs.XY&&(n[2]=0),le(n,n)}_initializeDistanceConstraints(){this._left.end==null||this.requiresSplitEdgeLeft||this._updateDistanceConstraint(Ae(this._plane,this._left.end)),this._right.end==null||this.requiresSplitEdgeRight||this._updateDistanceConstraint(Ae(this._plane,this._right.end)),this._updateIntersectDistanceConstraint(this._plane)}_updateDistanceConstraint(t){t<=0&&(this._minDistance=Math.max(this._minDistance,t)),t>=0&&(this._maxDistance=Math.min(this._maxDistance,t))}_updateIntersectDistanceConstraint(t){const i=$e(t),n=this._edgeDirection,s=ut(g(),this._left.start,this._left.direction),o=ut(g(),this._right.start,this._right.direction),r=this._pointInBasis2D(G(),i,n,this._left.start),l=this._pointInBasis2D(G(),i,n,s),h=this._pointInBasis2D(G(),i,n,this._right.start),u=this._pointInBasis2D(G(),i,n,o),[p]=Su({start:l,end:r,type:O.LINE},{start:u,end:h,type:O.LINE});if(!p)return;const d=q(G(),r,l);Ys(d,d);const m=q(G(),p,l),f=_e(d,m),_=ut(g(),s,fe(g(),this._left.direction,-f)),y=Ae(t,_);this._updateDistanceConstraint(y)}_pointInBasis2D(t,i,n,s){return t[0]=Ho(i,s),t[1]=Ho(n,s),t}_offset(t,i){Number.isFinite(this._minDistance)&&(i=Math.max(this._minDistance,i)),Number.isFinite(this._maxDistance)&&(i=Math.min(this._maxDistance,i)),Nn(this._offsetPlane,this._plane),this._offsetPlane[3]-=i;const n=(o,r,l)=>r!=null&&js(this._offsetPlane,o,ut(g(),o,r),l),s=g();(t===this._edge.leftVertex?n(this._left.start,this._left.direction,s):n(this._right.start,this._right.direction,s))&&this._helper.copy(this._helper.fromXYZ(s,void 0,this._helper.getM(t.pos)),t.pos)}selectArrowFromStartPoint(t){this._selectedArrow=Kr(this.plane,this._pointToXYZ(t))?1:-1}get selectedArrow(){return this._selectedArrow}signedDistanceToPoint(t){return Ae(this.plane,this._pointToXYZ(t))}clampedStartAndEnd(t){const i=this._helper.toXYZ(this._helper.pointToVector(t)),n=Ks(this._plane,i,g()),s=Ae(this._plane,i),o=cc(s,this._minDistance,this._maxDistance);return Pe(i,n,i,o/s),{start:n,end:i}}apply(t){this._offset(t,this.distance)}undo(t){this._offset(t,0)}canAccumulate(t){return t instanceof Ls&&this._edge.leftVertex.index===t._edge.leftVertex.index&&this._edge.rightVertex.index===t._edge.rightVertex.index&&this._edge.component===t._edge.component&&this._maybeEqualsVec3(this._left.direction,t._left.direction)&&this._maybeEqualsVec3(this._right.direction,t._right.direction)&&Ye($e(this._plane),$e(t._plane))}accumulate(t,i){const n=this._plane[3]-i._plane[3]+i.distance;this._offset(t,n)}accumulateParams(t){const i=t.distance-t._plane[3];this.distance=i+this._plane[3]}clone(){const t=new Ls(this._helper,this._planeType,this._edge,this.distance,yi.DEFERRED);return Nn(t._plane,this._plane),Nn(t._offsetPlane,this._offsetPlane),t._maxDistance=this._maxDistance,t._minDistance=this._minDistance,t._left=this._cloneNeighbor(this._left),t._right=this._cloneNeighbor(this._right),t._edgeDirection=rt(g(),this._edgeDirection),t}_maybeEqualsVec3(t,i){return t==null&&i==null||t!=null&&i!=null&&Ye(t,i)}_cloneNeighbor({start:t,end:i,direction:n,isOriginalDirection:s}){return{start:rt(g(),t),end:i!=null?rt(g(),i):null,direction:rt(g(),n),isOriginalDirection:s}}};const fr=Ir(15),gr=.001;var Gs,yi;(function(e){e[e.XYZ=0]="XYZ",e[e.XY=1]="XY"})(Gs||(Gs={})),function(e){e[e.IMMEDIATE=0]="IMMEDIATE",e[e.DEFERRED=1]="DEFERRED"}(yi||(yi={}));let bl=class wl{constructor(t,i,n=nt.CUMULATIVE){this.origin=t,this.angle=i,this._accumulationType=n}_rotate(t,i){Ec(t.pos,t.pos,this.origin,i)}apply(t){this._rotate(t,this.angle)}undo(t){this._rotate(t,-this.angle)}canAccumulate(t){return t instanceof wl&&Fe(this.origin,t.origin)}accumulate(t,i){const n=i._accumulationType===nt.REPLACE;this._rotate(t,n?i.angle-this.angle:i.angle)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.angle=i?t.angle:this.angle+t.angle}};class In{constructor(t,i,n,s,o=nt.CUMULATIVE){this.origin=t,this.axis1=i,this.factor1=n,this.factor2=s,this._accumulationType=o,this.axis2=de(i[1],-i[0])}_scale(t,i,n){on(t.pos,t.pos,this.origin,this.axis1,i),on(t.pos,t.pos,this.origin,this.axis2,n)}apply(t){this._scale(t,this.factor1,this.factor2)}undo(t){this._scale(t,1/this.factor1,1/this.factor2)}canAccumulate(t){return t instanceof In&&Fe(this.origin,t.origin)&&Fe(this.axis1,t.axis1)}accumulate(t,i){i._accumulationType===nt.REPLACE?this._scale(t,i.factor1/this.factor1,i.factor2/this.factor2):this._scale(t,i.factor1,i.factor2)}accumulateParams(t){const i=t._accumulationType===nt.REPLACE;this.factor1=i?t.factor1:this.factor1*t.factor1,this.factor2=i?t.factor2:this.factor2*t.factor2}}let Xf=class Tl{constructor(t,i){this._editGeometry=t,this._newPositions=i}apply(){const t=this._originalPositions==null?"apply":"redo";if(!this._originalPositions){const i=this._editGeometry.coordinateHelper;this._originalPositions=this._editGeometry.allVertices.map(n=>i.clone(n.pos))}this._apply(t,this._newPositions)}undo(){this._originalPositions&&this._apply("undo",this._originalPositions)}accumulate(t){return t instanceof Tl&&(this._newPositions=t._newPositions,this._apply("apply",this._newPositions),!0)}_apply(t,i){const n=this._editGeometry.coordinateHelper,s=this._editGeometry.allVertices;for(let o=0;oo.unnormalizeVertexPositions()),this._editGeometry.notifyChanges({operation:t,updatedVertices:s})}};var El;const qf=Symbol();let jf=class{constructor(e){this._operations=[],this._closed=!1,this[El]=!0,e&&(this._operations=e,this._closed=!0)}close(){this._closed=!0}apply(){for(const e of this._operations)e.apply()}undo(){for(let e=this._operations.length-1;e>=0;e--)this._operations[e].undo()}accumulate(e){if(this._closed)return!1;const t=this._operations.length?this._operations[this._operations.length-1]:null;return t&&t.accumulate(e)||(this._operations.push(e),e.apply()),!0}};El=qf;let wo=class Sl extends Ce{constructor(t,i){super(),this.data=t,this.viewingMode=i,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",n=>{n.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:n.addedVertices,operation:n.operation}),n.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:n.removedVertices,operation:n.operation}),n.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:n.updatedVertices,operation:n.operation})})}destroy(){this._listener.remove()}splitEdge(t,i){return this._apply(new Zf(this.data,t,i))}updateVertices(t,i,n=L.ACCUMULATE_STEPS){return this._apply(new gl(this.data,t,i),n)}move(t,i,n,s=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,t,i,n),s):this.moveVertices(this.data.allVertices,t,i,n,s)}moveVertices(t,i,n,s,o=L.ACCUMULATE_STEPS){return ri(this.data)?this._apply(new dr(this.data,i,n,s),o):this.updateVertices(t,new vl(this.data.coordinateHelper,i,n,s),o)}scale(t,i,n,s,o=L.ACCUMULATE_STEPS,r=nt.CUMULATIVE){return this.scaleVertices(this.data.allVertices,t,i,n,s,o,r)}scaleVertices(t,i,n,s,o,r=L.ACCUMULATE_STEPS,l=nt.CUMULATIVE){return this.updateVertices(t,new In(i,n,s,o,l),r)}rotate(t,i,n=L.ACCUMULATE_STEPS,s=nt.CUMULATIVE){return this.rotateVertices(this.data.allVertices,t,i,n,s)}rotateVertices(t,i,n,s=L.ACCUMULATE_STEPS,o=nt.CUMULATIVE){return this.updateVertices(t,new bl(i,n,o),s)}removeVertices(t){return this._apply(new Ff(this.data,t,this._minNumVerticesPerType))}appendVertex(t){return this.data.components.length===0?null:this._apply(new Nf(this.data,this.data.components[0],t))}setVertexPosition(t,i){return this._apply(new Bf(this.data,t,i))}offsetEdge(t,i,n,s=L.ACCUMULATE_STEPS){return this.updateVertices([i.leftVertex,i.rightVertex],new Wf(this.data.coordinateHelper,t,i,n),s)}trySetGeometry(t,i=L.ACCUMULATE_STEPS){const{data:n}=this,{coordinateHelper:s}=n;if(n.type!==t.type||!n.spatialReference.equals(t.spatialReference)||s.hasZ()!==t.hasZ||s.hasM()!==t.hasM||!Ql(n.geometry,t)||ri(n))return;const o=Array.from(dn.fromGeometry(t,this.viewingMode).iterateVertices(),r=>r.pos);return this.setVertexPositions(o,i)}setVertexPositions(t,i=L.ACCUMULATE_STEPS){return this._apply(new Xf(this.data,t),i)}createResetState(){if(ri(this.data))return this._createResetStateMesh();const t=this.data.geometry.clone();return Y(()=>this.trySetGeometry(t))}closeComponent(t){return this.data.components.includes(t)?this._apply(new Yf(this.data,t)):null}canRemoveVertex(t){return t.vertices.length>this._minNumVerticesPerType}createUndoGroup(){const t=new jf;return this._apply(t),Y(()=>t.close())}undo(){if(this._undoStack.length>0){const t=this._undoStack.pop();return t.undo(),this._redoStack.push(t),t}return null}redo(){if(this._redoStack.length>0){const t=this._redoStack.pop();return t.apply(),this._undoStack.push(t),t}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(t,i=L.ACCUMULATE_STEPS){return i!==L.NEW_STEP&&this.lastOperation!=null&&this.lastOperation.accumulate(t)||(t.apply(),this._undoStack.push(t),this._redoStack=[]),t}_createResetStateMesh(){if(!ri(this.data))return Y();const t=this.data.geometry,{vertexSpace:i}=t;if(i.origin){const s=ye(i.origin);return Y(()=>{t.vertexSpace.origin=s})}const n=t.vertexAttributes.clonePositional();return Y(()=>{t.vertexAttributes=n,t.vertexAttributesChanged()})}static fromGeometry(t,i){return new Sl(dn.fromGeometry(t,i),i)}};function Kf(e,t){let i=null,n=null;return s=>{if(s.action==="cancel")return void(n!=null&&(n.execute({action:"cancel"}),i=null,n=null));const o={action:s.action,screenStart:s.start,screenEnd:s.screenPoint};s.action==="start"&&i==null&&(i=new Pi,n=new Pi,t(e,i,n,s.pointerType,o)),i?.execute(o),s.action==="end"&&i!=null&&(i=null,n=null)}}function He(e,t){return e.events.on("drag",Kf(e,t))}function To(e,t=null,i){let n=null;const s=t==null||e.spatialReference?.equals(t)?r=>r:r=>r!=null?Xe(r,t):r,o={exclude:[],...i};return r=>{if(r.action==="start"&&(n=s(e.toMap(r.screenStart,o))),n==null)return null;const l=s(e.toMap(r.screenEnd,o));return l!=null?{...r,mapStart:n,mapEnd:l}:null}}const Qf=()=>{};let Pi=class Pl{constructor(){this.execute=Qf}next(t,i=new Pl){return t!=null&&(this.execute=n=>{const s=t(n);s!=null&&i.execute(s)}),i}};function Jf(e,t,i=[]){if(e.type==="2d")return s=>s;let n=null;return s=>{s.action==="start"&&(n=e.toMap(s.screenStart,{exclude:i}),n!=null&&(n.z=Lo(n,e,t)));const o=e.toMap(s.screenEnd,{exclude:i});o!=null&&(o.z=Lo(o,e,t));const r=n!=null&&o!=null?{sceneStart:n,sceneEnd:o}:null;return{...s,scenePoints:r}}}let Ds=class{constructor(e){this.vertexHandle=null,this.excludeFeature=null,this.visualizer=null,this.selfSnappingZ=null,this.drawConstraints=null,this.editGeometryOperations=e.editGeometryOperations,this.elevationInfo=e.elevationInfo,this.pointer=e.pointer,this.vertexHandle=e.vertexHandle,this.excludeFeature=e.excludeFeature,this.feature=e.feature,this.visualizer=e.visualizer,this.selfSnappingZ=e.selfSnappingZ,this.drawConstraints=e.drawConstraints}get coordinateHelper(){return this.editGeometryOperations.data.coordinateHelper}get spatialReference(){return this.coordinateHelper.spatialReference}};function tg({predicate:e=()=>!0,snappingManager:t,snappingContext:i,updatingHandles:n,useZ:s=!0}){const o=new Pi;if(t==null)return{snappingStep:[mr,o],cancelSnapping:mr};let r,l=null,h=null,u=null;const p=()=>{l=os(l),t.doneSnapping(),h?.frameTask.remove(),h=null,r=Ar(r),u=null},d=eg(t,s,o);let m=null,f=null,_=null;return{snappingStep:[y=>{if(!e(y))return y;const{action:w}=y;if(w==="start"){const{info:b}=y,S=ig(t.view);if(h=ng(i,y,S),h.context.selfSnappingZ=null,!s&&b!=null){const I=og(i.coordinateHelper,b.handle.component);I!=null&&(h.context.selfSnappingZ={value:I,elevationInfo:i.elevationInfo??gn})}}if(h!=null){const{context:b,originalScenePos:S,originalPos:I}=h,{mapEnd:K,mapStart:et,scenePoints:W}=y,gt=Ml(I,zs(K,et)),lt=zs(et,I),ei={...y,action:"update"},zt=h.context,ie=sg(S,W),be=t.update({point:gt,scenePoint:ie,context:b});if(_=be,kl(K,be,lt,s),m=gt,f=ie,w!=="end"){const{frameTask:Ln}=h;l==null&&(l=new AbortController),u=Ol=>{n.addPromise(ns(d({frameTask:Ln,event:ei,context:zt,point:gt,scenePoint:ie,delta:lt,getLastState:()=>({point:m,scenePoint:f,updatePoint:Ol.forceUpdate?null:_})},l.signal)))},u({forceUpdate:!1}),r==null&&(r=U(()=>t.options.effectiveEnabled,()=>u?.({forceUpdate:!0})))}}return w==="end"&&p(),y},o],cancelSnapping:y=>(p(),y)}}function eg(e,t,i){return Vr(async({frameTask:n,point:s,scenePoint:o,context:r,event:l,delta:h,getLastState:u},p)=>{const d=await n.schedule(()=>e.snap({point:s,scenePoint:o,context:r,signal:p}),p);if(d.valid){let m=await n.schedule(()=>d.apply(),p);const f=u();f.point!=null&&s!==f.point&&(m=e.update({point:f.point,scenePoint:f.scenePoint,context:r})),f.updatePoint!=null&&gi(m,f.updatePoint)||(kl(l.mapEnd,m,h,t),i.execute(l))}})}function ig(e){return e.type==="3d"?e.resourceController.scheduler.registerTask(ia.SNAPPING):na}function ng(e,t,i){return{context:new Ds({editGeometryOperations:e.editGeometryOperations,elevationInfo:e.elevationInfo,pointer:e.pointer,vertexHandle:t.info!=null?t.info.handle:null,excludeFeature:e.excludeFeature,feature:e.feature,visualizer:e.visualizer}),originalPos:t.snapOrigin!=null?e.coordinateHelper.vectorToDehydratedPoint(t.snapOrigin):t.mapStart,originalScenePos:t.scenePoints!=null?t.scenePoints.sceneStart:null,frameTask:i}}function Ml(e,[t,i,n]){const s=sa(e);return s.x+=t,s.y+=i,s.hasZ&&(s.z+=n),s}function sg(e,t){return e==null||t==null?null:Ml(e,zs(t.sceneEnd,t.sceneStart))}function zs(e,t){const i=e.hasZ&&t.hasZ?e.z-t.z:0;return[e.x-t.x,e.y-t.y,i]}function kl(e,t,[i,n,s],o){e.x=t.x+i,e.y=t.y+n,o&&e.hasZ&&t.hasZ&&(e.z=t.z+s)}function og(e,t){if(!e.hasZ())return null;const i=t.vertices;let n=null;for(const s of i){const o=e.getZ(s.pos);if(n!=null&&o!=null&&Math.abs(o-n)>1e-6)return null;n==null&&(n=o)}return n}function mr(e){return e}let Te=class extends tt{constructor(e){super(e),this.constrainResult=t=>t,this._snapPoints=null,this._frameTask=null,this._abortController=null,this._stagedPoint=null,this._snap=Vr(async(t,i,n,s)=>{const o=this._frameTask;if(o==null)return;const r=await o.schedule(()=>i.snap({...t,context:n,signal:s}),s);r.valid&&await o.schedule(()=>{this.stagedPoint=r.apply(),t!==this._snapPoints&&this._snapPoints!=null&&(this.stagedPoint=i.update({...this._snapPoints,context:n}))},s)})}get stagedPoint(){return this._stagedPoint}set stagedPoint(e){this._stagedPoint=this.constrainResult(e)}initialize(){const e=this.view.type==="3d"?this.view?.resourceController?.scheduler:null;this._frameTask=e!=null?e.registerTask(ia.SNAPPING):na}destroy(){this._abortController=os(this._abortController),this._frameTask=Ar(this._frameTask)}update(e,t,i){this._snapPoints=e;const{point:n,scenePoint:s}=e,o=t.update({point:n,scenePoint:s,context:i});return this.stagedPoint=o,o}async snap(e,t,i){const{point:n,scenePoint:s}=e;return this.stagedPoint=t.update({point:n,scenePoint:s,context:i}),this._snapPoints=e,this._abortController==null&&(this._abortController=new AbortController),this._snap(e,t,i,this._abortController.signal)}async snapAgainNearPreviousMapPoint(e,t){this._snapPoints!=null&&await this.snap(this._snapPoints,e,t)}abort(){this._abortController=os(this._abortController),this._snapPoints=null}};a([c({constructOnly:!0})],Te.prototype,"view",void 0),a([c()],Te.prototype,"stagedPoint",null),a([c()],Te.prototype,"constrainResult",void 0),a([c()],Te.prototype,"_stagedPoint",void 0),Te=a([x("esri.views.interactive.snapping.SnappingOperation")],Te);var yr;(function(e){e[e.TARGET=0]="TARGET",e[e.REFERENCE=1]="REFERENCE",e[e.REFERENCE_EXTENSION=2]="REFERENCE_EXTENSION"})(yr||(yr={}));const _r=Symbol("snapping-toggle");function rg(e,t=()=>{}){const i=U(()=>({view:e.view,snappingOptions:e.snappingOptions}),({view:n,snappingOptions:s})=>{if(e.removeHandles(_r),!n||!s)return;const o=Xr.TOOL,r=[n.on("key-down",l=>{l.key!==ir.toggle||l.repeat||(s.enabledToggled=!0,t())},o),n.on("key-up",l=>{l.key===ir.toggle&&(s.enabledToggled=!1,t())},o),n.on("pointer-move",l=>{const h=l.native.ctrlKey;s.enabledToggled!==h&&(s.enabledToggled=h,t())},o)];e.addHandles(r,_r)},ke);e.addHandles(i)}const ag="crosshair",lg="progress",vr=Symbol(),xr=Symbol();let T=class extends Ce.EventedMixin(tt){constructor(e){super(e),this._createOperationCompleted=!1,this._hideDefaultCursor=!1,this._pointerDownStates=new Jc,this._stagedScreenPoint=null,this._stagedPointerType=null,this._updatingHandles=new Zr,this._stagedPointerId=null,this.constraintsEnabled=!1,this.constraints=void 0,this._getPointConstraint=ys(vp),this._getPolylineOrPolygonConstraint=ys(xp),this.constraintZ=null,this.defaultZ=null,this.isDraped=!0,this.labelOptions=new An,this.cursor=null,this.loading=!1,this.snapToSceneEnabled=null,this.firstVertex=null,this.lastVertex=null,this.secondToLastVertex=null,e.elevationInfo==null&&(this.elevationInfo=Lc(!!e.hasZ))}initialize(){const{geometryType:e,view:t}=this,i=t.spatialReference,n="viewingMode"in t.state?t.state.viewingMode:Ti.Local,s=e==="segment"||e==="multipoint"?"polyline":e;this.coordinateHelper=dl(this.hasZ,this.hasM,i),this._editGeometryOperations=new wo(new dn(s,this.coordinateHelper),n),this._snappingOperation=new Te({view:t}),this.addHandles([U(()=>({stagedPoint:this._snappingOperation.stagedPoint,constraint:this._constraint}),({stagedPoint:l,constraint:h},u)=>{const{snappingOptions:p}=this;if(p&&(p.forceDisabled=h!=null&&vt(h)),u!=null&&l===u.stagedPoint&&h!==u.constraint)return this._onKeyboardBasedChange();this._processCursor(l??this._screenToMap(this._stagedScreenPoint))},{equals:(l,h)=>l.stagedPoint===h.stagedPoint&&Gl(l.constraint,h.constraint)}),U(()=>this.view.viewpoint,(l,h)=>{l&&h&&$h(l,h)&&this._onKeyboardBasedChange()})]),this._activeComponent=new On(i,n),this._editGeometryOperations.data.components.push(this._activeComponent);const o=this.segmentLabels;o!=null&&(o.context={view:t,editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,labelOptions:this.labelOptions},this.addHandles(U(()=>this.labelOptions.enabled,l=>{o.visible=l},ke))),this.addHandles(this._editGeometryOperations.on(["vertex-add","vertex-update","vertex-remove"],l=>{const h=l.vertices.map(f=>({componentIndex:0,vertexIndex:f.index,coordinates:this.coordinateHelper.vectorToArray(f.pos)})),u=h.map(f=>f.coordinates),p=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getFirstVertex()?.pos)??null;gi(p,this.firstVertex)||(this.firstVertex=p);const d=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.getLastVertex()?.pos)??null;gi(d,this.lastVertex)||(this.lastVertex=d);const m=this.coordinateHelper.vectorToDehydratedPoint(this._activeComponent.edges.at(-1)?.leftVertex?.pos)??null;switch(gi(m,this.secondToLastVertex)||(this.secondToLastVertex=m),this._processCursor(this.cursorVertex),l.type){case"vertex-add":this.emit(l.type,{...l,added:u,vertices:h});break;case"vertex-update":this.emit(l.type,{...l,updated:u,vertices:h});break;case"vertex-remove":this.emit(l.type,{...l,removed:u,vertices:h})}}));const r=this._manipulator=new Lf({consumesClicks:!1,grabbableForEvent:l=>this.drawingMode!=="click"||l.pointerType==="touch"&&this._snappingEnabled&&this._pointerDownStates.size===1});this.manipulators.add(r),r.grabbable=e!=="point",this.addHandles([r.events.on("immediate-click",l=>this._onImmediateClick(l)),r.events.on("immediate-double-click",l=>this._onImmediateDoubleClick(l)),U(()=>this.drawingMode,()=>{this.removeHandles(vr),this.addHandles(this._createManipulatorDragPipeline(r),vr)},ke),U(()=>({effectiveCursor:this.effectiveCursor}),({effectiveCursor:l})=>{r.cursor=l},ke)]),rg(this,()=>{const l=this.view.inputManager.latestPointerType??"mouse",h=this._getSnappingContext(l);if(this.snappingManager!=null){const u=this._snappingOperation.snapAgainNearPreviousMapPoint(this.snappingManager,h);this._updatingHandles.addPromise(ns(u))}})}destroy(){dt(this.segmentLabels),dt(this._snappingOperation),this._editGeometryOperations=dt(this._editGeometryOperations),this._updatingHandles.destroy()}get _isDragging(){const{_stagedPointerId:e,_manipulator:t}=this;return e!=null&&this._pointerDownStates.has(e)||t.grabbing||!t.interactive}get _snappingEnabled(){return this.snappingManager!=null&&this.snappingManager.options.effectiveEnabled}get _requiresScenePoint(){const e=this._updateAndGetEffectiveDrawSurface();return this.view.type==="3d"&&this.drawSurface!==e}get canRedo(){return this._editGeometryOperations.canRedo}get canUndo(){return this._editGeometryOperations.canUndo}get committedVertices(){return this._activeComponent.vertices.map(e=>this.coordinateHelper.vectorToArray(e.pos))}get _constraint(){const{constraints:e,constraintsEnabled:t}=this;if(e&&t)switch(this.geometryType){case"point":return this._getPointConstraint(e);case"polygon":case"polyline":return this._getPolylineOrPolygonConstraint(this.lastVertex,this.secondToLastVertex,e)}}set drawingMode(e){this._set("drawingMode",e??pl)}get effectiveCursor(){return this.loading?lg:this._hideDefaultCursor?null:this.cursor||ag}get interactive(){return this._manipulator.interactive}set interactive(e){this._manipulator.interactive=e}get isCompleted(){return this._createOperationCompleted}get numCommittedVertices(){return this._activeComponent.vertices.length}get snappingOptions(){return this.snappingManager!=null?this.snappingManager.options:null}get cursorVertex(){return this._get("cursorVertex")}get visualizationCursorVertex(){return this._stagedPointerType==="mouse"?this.cursorVertex:null}get committableVertex(){const{cursorVertex:e,lastVertex:t,firstVertex:i,geometryType:n}=this;return n==="polygon"&&Fn(e,i)||Fn(e,t)?null:e}get updating(){return this._updatingHandles.updating}get geometryIncludingUncommittedVertices(){const{committedVertices:e,committableVertex:t,coordinateHelper:i}=this,n=e.slice();return t!=null&&n.push(i.pointToArray(t)),n}cancel(){this.complete({aborted:!0})}commitStagedVertex(){this._snappingOperation.abort();const{committableVertex:e}=this;e!=null&&this._editGeometryOperations.appendVertex(this.coordinateHelper.pointToVector(e))}complete(e){const t=e?.aborted||!1;this._snappingOperation.abort(),this.snappingManager?.doneSnapping();const{geometryType:i,numCommittedVertices:n}=this,s=i==="multipoint"&&n===0||i==="polyline"&&n<2||i==="polygon"&&n<3;i!=="segment"&&i!=="point"||this.commitStagedVertex(),this._createOperationCompleted=!s,(this.isCompleted||t)&&(this._stagedScreenPoint=null,this._stagedPointerId=null,this._stagedPointerType=null,this._processCursor(null),this.emit("complete",{vertices:this.committedVertices.map((o,r)=>({componentIndex:0,vertexIndex:r,coordinates:o})),aborted:t,type:"complete"}))}onInputEvent(e){switch(e.type){case"pointer-down":this._pointerDownStates.add(e.pointerId);break;case"pointer-up":this._pointerDownStates.delete(e.pointerId)}switch(e.type){case"pointer-move":return this._onPointerMove(e);case"hold":return this._onHold(e)}}redo(){this._editGeometryOperations.redo()}undo(){this.snappingManager!=null&&this.snappingManager.doneSnapping(),this._editGeometryOperations.undo()}_processCursor(e){const t=is(this.cursorVertex),i=is(e),n=i&&(this._updateAndGetEffectiveDrawSurface()?.constrainZ(i)??i),s=this._snapToClosingVertex(n),o=this._applyConstraints(s);Fn(t,o)||(this._set("cursorVertex",o),this.segmentLabels?.set("stagedVertex",o!=null?this.coordinateHelper.pointToVector(o):null),o==null||this._stagedPointerType!=="mouse"?this.emit("cursor-remove"):this.emit("cursor-update",{updated:null,vertices:[{componentIndex:0,vertexIndex:this._activeComponent.vertices.length,coordinates:this.coordinateHelper.pointToArray(o)}],operation:"apply",type:"vertex-update"}))}_snapToClosingVertex(e){if(e==null||this._isDragging||this.geometryType!=="polygon"||this.numCommittedVertices<=2)return e;const t=this._mapToScreen(e);if(!t)return e;const i=this._activeComponent;return this._vertexWithinPointerDistance(i.vertices[0].pos,t)?this.firstVertex:this._vertexWithinPointerDistance(i.vertices.at(-1).pos,t)?this.lastVertex:e}_createManipulatorDragPipeline(e){switch(this.drawingMode){case"click":return this._createManipulatorDragPipelineClick(e);case"freehand":return this._createManipulatorDragPipelineFreehand(e);case"hybrid":return this._createManipulatorDragPipelineHybrid(e)}}_createManipulatorDragPipelineClick(e){return He(e,(t,i,n,s)=>{const o=s==="touch"&&this._snappingEnabled;if(this.isCompleted||!o)return;const{snappingStep:r,cancelSnapping:l}=tg({predicate:()=>o,snappingManager:this.snappingManager,snappingContext:new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,feature:this.graphic,pointer:s,visualizer:this.snappingVisualizer,drawConstraints:this.constraints}),updatingHandles:this._updatingHandles,useZ:!this._requiresScenePoint});n=n.next(h=>(o&&this.snappingManager!=null&&this.snappingManager.doneSnapping(),h)).next(l),i.next(this._screenToMapDragEventStep()).next(h=>(h.action==="start"&&(this._processCursor(h.mapStart),(this.geometryType==="segment"||o&&!this.numCommittedVertices)&&this.commitStagedVertex()),h)).next(Jf(this.view,this.elevationInfo)).next(...r).next(h=>(o&&(this._processCursor(h.mapEnd),h.action==="end"&&this.commitStagedVertex()),h)).next(h=>(h.action==="end"&&(this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()),h))})}_createManipulatorDragPipelineFreehand(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.committableVertex==null&&this._processCursor(n.mapStart),this.geometryType==="segment"&&this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this.complete()}return n})})}_createManipulatorDragPipelineHybrid(e){return He(e,(t,i)=>{this.isCompleted||i.next(this._screenToMapDragEventStep()).next(n=>(n.action==="start"&&(this._snappingOperation.abort(),this.addHandles(this._editGeometryOperations.createUndoGroup(),xr),this._processCursor(n.mapStart),this.commitStagedVertex()),n)).next(n=>{switch(n.action){case"start":case"update":this._processCursor(n.mapEnd),this.geometryType!=="polygon"&&this.geometryType!=="polyline"||this.commitStagedVertex();break;case"end":this._stagedPointerType!=="mouse"&&this._snappingOperation.abort(),this.removeHandles(xr),this.geometryType!=="segment"&&this.geometryType!=="point"||this.complete()}return n})})}get _drawAtFixedElevation(){const{constraintsEnabled:e,constraintZ:t,geometryType:i,numCommittedVertices:n}=this;return e?t!=null||i==="segment"&&n>0:(i==="segment"||i==="polygon")&&n>0}_updateAndGetEffectiveDrawSurface(){const{constraintsEnabled:e,coordinateHelper:t,drawSurface:i,elevationDrawSurface:n,snapToSceneEnabled:s}=this;if(n==null)return i;if(!this.hasZ)return n.defaultZ=null,n;const o=this.elevationInfo?.mode;let r=this.defaultZ,l=e||o==="absolute-height";return s!=null&&(l=s),o==="on-the-ground"&&(l=!1),this._drawAtFixedElevation&&(r=(e?this.constraintZ:null)??t.getZ(this._activeComponent.vertices[0].pos),l=!1),l?i:(n.defaultZ=r,n)}_mapToScreen(e){return this._updateAndGetEffectiveDrawSurface()?.mapToScreen(e)}_onHold(e){this._snappingOperation.abort(),this.drawingMode==="click"&&e.pointerType==="touch"&&this._snappingEnabled&&this._processCursor(e.mapPoint),e.stopPropagation()}_onImmediateClick(e){if(!(e.pointerType==="mouse"&&e.button===2||this._manipulator.dragging))try{const{drawingMode:t,geometryType:i}=this;this._stagedPointerType=e.pointerType,this._stagedScreenPoint=e.screenPoint;const n=this._screenToMap(e.screenPoint);if(n==null||n==null||t==="freehand"&&i!=="point")return;if(this._snappingEnabled&&this.cursorVertex!=null||this._processCursor(n),this.committableVertex==null)return void this.complete();this.commitStagedVertex(),e.pointerType!=="mouse"&&this._processCursor(null),(t==="freehand"||i==="point"||i==="segment"&&this.numCommittedVertices===2||i==="segment"&&t==="hybrid"&&this.numCommittedVertices===1)&&this.complete()}finally{e.stopPropagation()}}_onImmediateDoubleClick(e){this._manipulator.dragging||this.geometryType==="point"||(this.complete(),e.stopPropagation())}_onPointerMove(e){const t=Us(e.x,e.y);this._stagedScreenPoint=t,this._stagedPointerType=e.pointerType,this._stagedPointerId=e.pointerId,this._isDragging?this._snappingOperation.abort():(e.stopPropagation(),this._processCursorMovementRelativeToSurface(t,e.pointerType))}_onKeyboardBasedChange(){this._stagedPointerType==="mouse"&&this._stagedScreenPoint&&this._stagedPointerId!=null&&!this._isDragging?this._processCursorMovementRelativeToSurface(this._stagedScreenPoint,this._stagedPointerType):this._snappingOperation.abort()}_processCursorMovementRelativeToSurface(e,t){const i=this._snappingOperation,n=this._screenToMap(e),s=this._requiresScenePoint?this.drawSurface?.screenToMap(e):null;if(n==null)return this._hideDefaultCursor=!0,this._processCursor(null),void i.abort();this._hideDefaultCursor=!1;const o=this.snappingManager;if(o==null)return this._processCursor(n),void i.abort();const r=this._getSnappingContext(t);this._updatingHandles.addPromise(ns(i.snap({point:n,scenePoint:s},o,r)))}_applyConstraints(e){const{_constraint:t,constraints:i}=this;if(!e||!i||!t)return e;const{context:n}=i,s=Sn(e,n),o=s?t.closestTo(s):void 0;if(!o)return e;const r=wp(o,e,n),l=this.view.type==="2d"||n.elevationInfo.mode!=="absolute-height";return r!=null&&l&&this.constraintZ!=null&&this.hasZ&&(r.z=this.constraintZ),r}_screenToMap(e){return e?this._updateAndGetEffectiveDrawSurface()?.screenToMap(e):null}_screenToMapDragEventStep(){let e=null;return t=>{if(t.action==="start"&&(e=this._screenToMap(t.screenStart)),e==null)return null;const i=this._screenToMap(t.screenEnd);return i!=null?{...t,mapStart:e,mapEnd:i}:null}}_vertexWithinPointerDistance(e,t){const i=this._mapToScreen(this.coordinateHelper.vectorToDehydratedPoint(e));return i!=null&&cg(i,t,25)}_getSnappingContext(e){const t=this._drawAtFixedElevation?this.elevationDrawSurface?.defaultZ:null;return new Ds({editGeometryOperations:this._editGeometryOperations,elevationInfo:this.elevationInfo,pointer:e,feature:this.graphic,visualizer:this.snappingVisualizer,selfSnappingZ:t!=null?{value:t,elevationInfo:this.elevationInfo}:null,drawConstraints:this.constraints})}};function cg(e,t,i){const n=e.x-t.x,s=e.y-t.y;return n*n+s*s<=i}a([c()],T.prototype,"_hideDefaultCursor",void 0),a([c()],T.prototype,"_stagedPointerId",void 0),a([c()],T.prototype,"_isDragging",null),a([c()],T.prototype,"_snappingOperation",void 0),a([c()],T.prototype,"_snappingEnabled",null),a([c({constructOnly:!0})],T.prototype,"graphic",void 0),a([c()],T.prototype,"constraintsEnabled",void 0),a([c()],T.prototype,"constraints",void 0),a([c()],T.prototype,"_constraint",null),a([c()],T.prototype,"constraintZ",void 0),a([c()],T.prototype,"defaultZ",void 0),a([c()],T.prototype,"isDraped",void 0),a([c({value:pl})],T.prototype,"drawingMode",null),a([c({constructOnly:!0})],T.prototype,"elevationDrawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"elevationInfo",void 0),a([c({constructOnly:!0,type:An})],T.prototype,"labelOptions",void 0),a([c({constructOnly:!0})],T.prototype,"geometryType",void 0),a([c({constructOnly:!0})],T.prototype,"hasM",void 0),a([c({constructOnly:!0})],T.prototype,"hasZ",void 0),a([c()],T.prototype,"cursor",void 0),a([c()],T.prototype,"effectiveCursor",null),a([c()],T.prototype,"loading",void 0),a([c({constructOnly:!0})],T.prototype,"manipulators",void 0),a([c({constructOnly:!0})],T.prototype,"drawSurface",void 0),a([c({constructOnly:!0})],T.prototype,"segmentLabels",void 0),a([c({constructOnly:!0})],T.prototype,"snappingManager",void 0),a([c({constructOnly:!0})],T.prototype,"snappingVisualizer",void 0),a([c()],T.prototype,"snapToSceneEnabled",void 0),a([c({readOnly:!0})],T.prototype,"cursorVertex",null),a([c({readOnly:!0})],T.prototype,"visualizationCursorVertex",null),a([c()],T.prototype,"committableVertex",null),a([c()],T.prototype,"firstVertex",void 0),a([c()],T.prototype,"lastVertex",void 0),a([c()],T.prototype,"secondToLastVertex",void 0),a([c()],T.prototype,"updating",null),a([c({constructOnly:!0})],T.prototype,"view",void 0),T=a([x("esri.views.draw.DrawOperation")],T);let hg=class{constructor(e,t=!1,i=0){this.view=e,this.hasZ=t,this.defaultZ=i,this.mapToScreen=n=>e.toScreen(n),this.screenToMap=t?n=>{const s=e.toMap(n);return s.z=i,s}:n=>e.toMap(n)}constrainZ(e){const{defaultZ:t}=this;return this.hasZ&&e.z!==t&&((e=sa(e)).z=t),e}};new ue;let ai=class extends P{constructor(e){super(e),this._visualElementGraphics={regularVertices:null,activeVertex:null,activeEdge:null},this.activeFillSymbol=null,this.type="draw-2d",this._visualElementSymbols={outline:e.activeLineSymbol??iu,regularVertices:e.regularVerticesSymbol??nu,activeVertex:e.activeVertexSymbol??su,fill:e.activeFillSymbol},e.activeVertexSymbol||this.addHandles(U(()=>this.view?.effectiveTheme?.accentColor,t=>{if(!t)return;const i=this._visualElementSymbols.activeVertex.clone().set({color:t});this._visualElementGraphics.activeVertex?.set("symbol",i),this._visualElementSymbols={...this._visualElementSymbols,activeVertex:i}},es))}normalizeCtorArgs(e){const t={...e};return delete t.activeFillSymbol,delete t.activeVertexSymbol,delete t.regularVerticesSymbol,delete t.activeLineSymbol,t}initializeGraphic(e){return this._visualElementSymbols.fill!=null&&(e.symbol=this._visualElementSymbols.fill),this.internalGraphicsLayer.graphics.sort(ji),Y()}makeDrawOperation(){const{defaultZ:e,hasZ:t,view:i}=this;return this._createOrUpdateGraphic(null),new T({view:i,manipulators:this.manipulators,geometryType:Of(this.geometryType),drawingMode:this.mode,hasZ:t,defaultZ:e,snapToSceneEnabled:this.snapToScene,drawSurface:new hg(i,t,e),hasM:!1,snappingManager:this.snappingManager,snappingVisualizer:new tu(this.internalGraphicsLayer),graphic:this.graphic,cursor:this.cursor,constraintsEnabled:!0})}onActiveVertexChanged(e){if(this.geometryType==="point")return Y();const[t,i]=e,n=new C({x:t,y:i,spatialReference:this.view.spatialReference});return this._visualElementGraphics.activeVertex!=null?(this._visualElementGraphics.activeVertex.geometry=n,Y()):(this._visualElementGraphics.activeVertex=new Lt({geometry:n,symbol:this._visualElementSymbols.activeVertex,attributes:{displayOrder:2}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeVertex),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.activeVertex!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeVertex),this._visualElementGraphics.activeVertex=dt(this._visualElementGraphics.activeVertex))}))}onCursorEdgeChanged(e){return this._visualElementGraphics.activeEdge!=null?(this._visualElementGraphics.activeEdge.geometry=e,Y()):(this._visualElementGraphics.activeEdge=new Lt({geometry:e,symbol:this._visualElementSymbols.outline,attributes:{displayOrder:0}}),this.internalGraphicsLayer.add(this._visualElementGraphics.activeEdge),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.activeEdge!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.activeEdge),this._visualElementGraphics.activeEdge=dt(this._visualElementGraphics.activeEdge))}))}onRegularVerticesChanged(e){const t=new Mr({points:e,spatialReference:this.view.spatialReference});return this._visualElementGraphics.regularVertices!=null?(this._visualElementGraphics.regularVertices.geometry=t,Y()):(this._visualElementGraphics.regularVertices=new Lt({geometry:t,symbol:this._visualElementSymbols.regularVertices,attributes:{displayOrder:1}}),this.internalGraphicsLayer.add(this._visualElementGraphics.regularVertices),this.internalGraphicsLayer.graphics.sort(ji),Y(()=>{this._visualElementGraphics.regularVertices!=null&&(this.internalGraphicsLayer.remove(this._visualElementGraphics.regularVertices),this._visualElementGraphics.regularVertices=dt(this._visualElementGraphics.regularVertices))}))}};function ji(e,t){return(e.attributes?.displayOrder??-1/0)-(t.attributes?.displayOrder??-1/0)}a([c()],ai.prototype,"activeFillSymbol",void 0),a([c({readOnly:!0})],ai.prototype,"type",void 0),a([c({constructOnly:!0,nonNullable:!0})],ai.prototype,"view",void 0),ai=a([x("esri.views.2d.interactive.editingTools.draw.DrawGraphicTool2D")],ai);let Eo=class{get hovering(){return this.someManipulator(e=>e.hovering)}get grabbing(){return this.someManipulator(e=>e.grabbing)}get dragging(){return this.someManipulator(e=>e.dragging)}hasManipulator(e){return this.someManipulator(t=>t===e)}someManipulator(e){let t=!1;return this.forEachManipulator(i=>{!t&&e(i)&&(t=!0)}),t}};var Mi;(function(e){e[e.TRANSLATE_XY=0]="TRANSLATE_XY",e[e.SCALE=1]="SCALE",e[e.ROTATE=2]="ROTATE"})(Mi||(Mi={}));function Cl(e){let t=0,i=0,n=0;return e?(e.type==="cim"&&e.data.symbol&&"symbolLayers"in e.data.symbol&&e.data.symbol.symbolLayers&&e.data.symbol.symbolLayers.map(s=>{s.type==="CIMVectorMarker"&&s.anchorPoint&&(Math.abs(s.anchorPoint.x)>t&&(t=s.anchorPoint.x),Math.abs(s.anchorPoint.y)>i&&(i=s.anchorPoint.y),s.size!=null&&s.size>n&&(n=s.size))}),t=ze(t),i=ze(i),n=ze(n),{offsetX:t,offsetY:i,size:n}):{offsetX:t,offsetY:i,size:n}}let X=class extends tt{set graphic(e){this._circleCollisionCache=null,this._originalSymbol=e.symbol,this._set("graphic",e),this.attachSymbolChanged()}get elevationInfo(){const{layer:e}=this.graphic,t=e&&"elevationInfo"in e?e.elevationInfo:null,i=Gc(this.graphic),n=t?t.offset:0;return new Nh({mode:i,offset:n})}set focusedSymbol(e){e!==this._get("focusedSymbol")&&(this._set("focusedSymbol",e),this._updateGraphicSymbol(),this._circleCollisionCache=null)}grabbableForEvent(){return!0}set grabbing(e){e!==this._get("grabbing")&&(this._set("grabbing",e),this._updateGraphicSymbol())}set hovering(e){e!==this._get("hovering")&&(this._set("hovering",e),this._updateGraphicSymbol())}set selected(e){e!==this._get("selected")&&(this._set("selected",e),this._updateGraphicSymbol(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get _focused(){return this._get("hovering")||this._get("grabbing")}constructor(e){super(e),this.layer=null,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.dragging=!1,this.cursor=null,this.consumesClicks=!0,this.events=new Ce.EventEmitter,this._circleCollisionCache=null,this._graphicSymbolChangedHandle=null,this._originalSymbol=null}destroy(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this._set("view",null)}intersectionDistance(e){const t=this.graphic;if(t.visible===!1)return null;const i=t.geometry;if(i==null)return null;const n=this._get("focusedSymbol"),s=n??t.symbol;return this.view.type==="2d"?this._intersectDistance2D(this.view,e,i,s):this._intersectDistance3D(this.view,e,t)}attach(){this.attachSymbolChanged(),this.layer!=null&&this.layer.add(this.graphic)}detach(){this.detachSymbolChanged(),this._resetGraphicSymbol(),this.layer!=null&&this.layer.remove(this.graphic)}attachSymbolChanged(){this.detachSymbolChanged(),this._graphicSymbolChangedHandle=U(()=>this.graphic?.symbol,e=>{e!=null&&e!==this.focusedSymbol&&e!==this._originalSymbol&&(this._originalSymbol=e,this._focused&&this.focusedSymbol!=null&&(this.graphic.symbol=this.focusedSymbol))},$s)}detachSymbolChanged(){this._graphicSymbolChangedHandle!=null&&(this._graphicSymbolChangedHandle.remove(),this._graphicSymbolChangedHandle=null)}onElevationChange(){}onViewChange(){}_updateGraphicSymbol(){this.graphic.symbol=this._focused&&this.focusedSymbol!=null?this.focusedSymbol:this._originalSymbol}_resetGraphicSymbol(){this.graphic.symbol=this._originalSymbol}_intersectDistance2D(e,t,i,n){if((n=n||Jl(i))==null)return null;const s=1;let o=this._circleCollisionCache;if(i.type==="point"&&n.type==="cim"&&n.data.symbol?.type==="CIMPointSymbol"&&n.data.symbol.symbolLayers){const{offsetX:r,offsetY:l,size:h}=Cl(n),u=Co(t,wr),p=h/2,d=e.toScreen(i),m=d.x+r,f=d.y+l;return sn(u,[m,f])this._tool.manipulators.add(t))}destroy(){this.forEachManipulator(e=>{this._tool.manipulators.remove(e),e.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._graphic=null}forEachManipulator(e){e(this._manipulator,Mi.TRANSLATE_XY)}createDragPipeline(e,t){let i=null,n=null,s=0,o=0,r=0;const{offsetX:l,offsetY:h,size:u}=Cl(this._graphic.symbol);return He(this._manipulator,(p,d)=>{d.next(m=>{if(m.action==="start"){const f=e();i=f.editGeometryOperations,n=f.constraints}return m}).next(To(this._view)).next(m=>{const{x:f,y:_,z:y}=m.mapEnd;if(n&&(f+ln.xmax||_+h-u>n.ymax))return m;(m.action==="start"||s===0&&o===0&&r===0)&&(s=m.mapStart.x,o=m.mapStart.y,r=m.mapStart.z);const w=f-s,b=_-o,S=y-r;s=f,o=_,r=y;const I=m.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,K=i.move(w,b,S,I);return t(m,K),m})})}_createManipulator(){const e=this._view,t=this._graphic;return new X({view:e,graphic:t,selectable:!0,cursor:"move"})}};const $t={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",toggleOpacity:"t",shift:"Shift",primaryKey:Wr},ug=1,pg=10,Tr=new _i("#009af2");let Bt=class extends B{constructor(e){super(e),this._isOpacityToggled=!1,this._isModifierActive=!1,this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this._highlightHandle=null,this.activeHandle=0,this.type="reshape"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._controlPointManipulations.forEach(t=>t.destroy()),this._controlPointEditGeometryOperations.forEach(t=>t.destroy()),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return Ns(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const e=this._undoStack[this._undoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canUndo}canRedo(){const e=this._redoStack[this._redoStack.length-1];return e!=null&&this._controlPointEditGeometryOperations[e].canRedo}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();this._controlPointEditGeometryOperations[e].undo(),this.updateGraphics(),this._redoStack.push(e)}}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();this._controlPointEditGeometryOperations[e].redo(),this.updateGraphics(),this._undoStack.push(e)}}refresh(){const{mediaElement:e}=this;if(e.georeference==null)return;const t=e.georeference;t.type==="control-points"&&t.coords!=null&&(this._georeference=t,this._georeference.controlPoints.forEach(({mapPoint:i},n)=>{const s=this._controlPointEditGeometryOperations[n],o=s.data.components[0].vertices[0];s.setVertexPosition(o,s.data.coordinateHelper.pointToVector(i))}),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._georeference,t=e.controlPoints,i=t[0].mapPoint.spatialReference,n=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map((s,o)=>{const r=s.data.geometry;return this._controlPointGraphics[o].geometry=r,{mapPoint:Xe(r,i),sourcePoint:n?t[o].sourcePoint:e.toSource(r)}})}updateActiveHandle(e){if(this.activeHandle===e)return;const t=this._controlPointGraphics[this.activeHandle].symbol.clone();No(t,this.view.effectiveTheme.accentColor),this._controlPointGraphics[this.activeHandle].symbol=t;const i=this._controlPointGraphics[e].symbol.clone();No(i,Tr),this._controlPointGraphics[e].symbol=i,this.activeHandle=e,this.view.surface===document.activeElement&&this.highlightActiveHandle()}async highlightActiveHandle(){this.removeHighlightActiveHandle();const e=await this.view.whenLayerView(this._graphicsLayer);this._highlightHandle=e.highlight(this._controlPointGraphics[this.activeHandle])}removeHighlightActiveHandle(){this._highlightHandle&&this._highlightHandle.remove()}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,mediaElement:t}=this;if(t.georeference==null)return;const i=t.georeference;i.type==="control-points"&&i.coords!=null&&(this._georeference=i,this._initialControlPoints=this._georeference.controlPoints,e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._controlPointEditGeometryOperations=this._georeference.controlPoints.map(({mapPoint:n})=>wo.fromGeometry(Xe(n,e.spatialReference),Ti.Local)),this._controlPointGraphics=this._controlPointEditGeometryOperations.map((n,s)=>new Lt({symbol:new pi({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:s===this.activeHandle?Tr.toArray():this.view.effectiveTheme.accentColor.toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:n.data.geometry})),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map(n=>new Rl({tool:this,view:e,graphic:n})),this.addHandles([...this._controlPointManipulations.map((n,s)=>n.createDragPipeline(this._getInfo.bind(this,s),(o,r)=>{o.action==="start"&&(this._undoStack.push(s),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0),this.updateGraphics()})),U(()=>this.view.scale,()=>this.active?this.updateGraphics():null)]),this._controlPointManipulations.forEach((n,s)=>{const o=r=>{this.addHandles([r.events.on(["click","grab-changed"],l=>this.updateActiveHandle(s))])};n.forEachManipulator(o)}),this.addHandles([e.on("key-down",n=>{e.activeTool===this&&(n.key!==$t.shift||n.repeat||(this._isModifierActive=!0,n.stopPropagation()),n.key!==$t.toggleOpacity||n.repeat||(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled,n.stopPropagation()),n.key!==$t.primaryKey||n.repeat||(this._factor=pg,n.stopPropagation()),this._isModifierActive&&(n.key===$t.up&&(this._move(0,this._factor),n.stopPropagation()),n.key===$t.down&&(this._move(0,-this._factor),n.stopPropagation()),n.key===$t.left&&(this._move(-this._factor,0),n.stopPropagation()),n.key===$t.right&&(this._move(this._factor,0),n.stopPropagation())))}),e.on("key-up",n=>{e.activeTool===this&&(n.key===$t.shift&&(this._isModifierActive=!1,n.stopPropagation()),n.key===$t.primaryKey&&(this._factor=ug,n.stopPropagation()))})]))}async _loadProjectionEngine(){const e=this._georeference.controlPoints[0].mapPoint;return ea(e.spatialReference,this.view.spatialReference)}_getInfo(e){return{editGeometryOperations:this._controlPointEditGeometryOperations[e],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(e,t){const i=this._controlPointEditGeometryOperations[this.activeHandle].move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],Bt.prototype,"_hasValidSpatialReference",null),a([c()],Bt.prototype,"activeHandle",void 0),a([c({constructOnly:!0,nonNullable:!0})],Bt.prototype,"mediaElement",void 0),a([c({readOnly:!0})],Bt.prototype,"type",void 0),a([c({constructOnly:!0})],Bt.prototype,"view",void 0),Bt=a([x("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],Bt);function Vl(e,t){e.action==="start"?t.cursor="grabbing":t.cursor="grab"}class dg{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(t){if(this._enabled!==t&&this._lastDragEvent!=null){const i={...this._lastDragEvent,action:"update"};t&&this._adjustScaleFactors(i),this.next.execute(i)}this._enabled=t}createDragEventPipelineStep(){return this._lastDragEvent=null,t=>(this._lastDragEvent=t.action!=="end"?{...t}:null,this._enabled&&this._adjustScaleFactors(t),t)}_adjustScaleFactors(t){const i=t.direction[0]!==0&&t.direction[1]!==0?Math.max(Math.abs(t.factor1),Math.abs(t.factor2)):t.direction[0]===0?Math.abs(t.factor2):Math.abs(t.factor1);t.factor1=t.factor1<0?-i:i,t.factor2=t.factor2<0?-i:i}}let fg=class{constructor(){this._lastDragEvent=null,this.next=new Pi,this._enabled=!1}get enabled(){return this._enabled}set enabled(e){if(this._enabled!==e&&this._lastDragEvent!=null){const t={...this._lastDragEvent,action:"update"};e&&this._adjustRotateAngle(t),this.next.execute(t)}this._enabled=e}createDragEventPipelineStep(){return this._lastDragEvent=null,e=>(this._lastDragEvent=e.action!=="end"?{...e}:null,this._enabled&&this._adjustRotateAngle(e),e)}_adjustRotateAngle(e){const t=Or(e.rotateAngle);e.rotateAngle=Ir(5*Math.round(t/5))}};function gg(e,t,i,n=!1){const s=Math.atan2(t.y-i.y,t.x-i.x)-Math.atan2(e.y-i.y,e.x-i.x),o=Math.atan2(Math.sin(s),Math.cos(s));return n?o:Or(o)}function Al(e,t){return mg(e,t,!1)}function mg(e,t,i){if(e instanceof gl){if(e.operation instanceof vl)return yg(e.operation,t,i),!0;if(e.operation instanceof bl)return _g(e.operation,t,i),!0;if(e.operation instanceof In)return vg(e.operation,t,i),!0}return!1}function yg(e,t,i=!1){const n=i?-1:1,s=pe(n*e.dx,n*e.dy,n*e.dz);ut(t.origin,t.origin,s),xn(t)}function _g(e,t,i=!1){const n=i?-e.angle:e.angle;zo(t.basis1,t.basis1,Ao,n),zo(t.basis2,t.basis2,Ao,n),xn(t)}function vg(e,t,i=!1){const n=i?1/e.factor1:e.factor1,s=i?1/e.factor2:e.factor2;fe(t.basis1,t.basis1,n),fe(t.basis2,t.basis2,s),on(t.origin,t.origin,e.origin,e.axis1,n),on(t.origin,t.origin,e.origin,e.axis2,s),xn(t)}function xg(e,t,i,n){n||(n=Ei());const s=Yt(ii.get(),e[1],-e[0]),o=Yt(ii.get(),Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=Yt(ii.get(),Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),l=ii.get();t.components.forEach(p=>p.vertices.forEach(({pos:d})=>{Yt(l,_e(e,d),_e(s,d)),xc(o,o,l),bc(r,r,l)}));const h=1e-6,u=Yt(ii.get(),r[0]-o[0]Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulator=null,this._snapRotation=null,this._graphic=null,this._handles=null,this._originCache=null}forEachManipulator(t){t(this._manipulator,Mi.ROTATE)}createDragPipeline(t,i){let n=null,s=null;return He(this._manipulator,(o,r)=>{r.next(l=>{if(l.action==="start"){o.cursor="grabbing";const h=t();n=h.plane,s=h.editGeometryOperations}return l}).next(To(this._view)).next(l=>({...l,rotateAngle:gg(l.mapStart,l.mapEnd,{x:n.origin[0],y:n.origin[1]},!0)})).next(this._snapRotation.createDragEventPipelineStep(),this._snapRotation.next).next(l=>{const h=rt(this._originCache,n.origin),u=l.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,p=s.rotate(h,l.rotateAngle,u,nt.REPLACE);return Al(p,n),i(l,p),l}).next(l=>(l.action==="end"&&(o.cursor="grab"),l))})}_createManipulator(){const t=this._view,i=this._graphic;return new X({view:t,graphic:i,selectable:!0,cursor:"grab"})}}const ts=10,Er=1e-6,wg=.3;function Sr(e){const t=xi(e.basis1),i=xi(e.basis2);return wg*Math.min(t,i)}class Tg extends Eo{constructor(t){super(),this._handles=new Lr,this._planeStart=Ei(),this._displayPlaneStart=Ei(),this._originCache=g(),this._axisCache=G(),this._renderStartCache=g(),this._renderEndCache=g(),this._resizeOriginCache=g(),this._view=t.view,this._tool=t.tool,this._graphic=t.graphic,this._direction=t.direction,this._preserveAspectRatio=t.preserveAspectRatio,this._manipulator=this._createManipulator(),this._handles.add([this._manipulator.events.on("grab-changed",i=>Vl(i,this._manipulator))]),this.forEachManipulator(i=>this._tool.manipulators.add(i))}destroy(){this._handles.destroy(),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._graphic=null,this._manipulator=null,this._direction=null,this._handles=null,this._planeStart=null,this._displayPlaneStart=null,this._originCache=null,this._axisCache=null,this._renderStartCache=null,this._renderEndCache=null,this._resizeOriginCache=null,this._preserveAspectRatio=null}forEachManipulator(t){t(this._manipulator,Mi.SCALE)}createDragPipeline(t,i){let n=null,s=null,o=null,r=0,l=null,h=null;const u=this._planeStart,p=this._displayPlaneStart,d=this._direction;return He(this._manipulator,(m,f)=>{f.next(_=>{if(_.action==="start"){m.cursor="grabbing";const y=t();n=y.plane,s=y.displayPlane,o=y.editGeometryOperations,r=ts*this._view.resolution,Qi(n,u),Qi(s,p);const w=$r(o.data.spatialReference);l=w?w.valid[1]-w.valid[0]-3*ts*this._view.resolution:null}return _}).next(To(this._view)).next(_=>{const y=rt(this._renderStartCache,[_.mapStart.x,_.mapStart.y,0]),w=rt(this._renderEndCache,[_.mapEnd.x,_.mapEnd.y,0]),b=rt(this._resizeOriginCache,p.origin);z(b,b,p.basis1,-d[0]),z(b,b,p.basis2,-d[1]),Et(w,w,b),Et(y,y,b);const S=d[0]!==0&&d[1]!==0,I=Sr(p),K=Sr(s)/I,et=(lt,ei)=>{if(lt===0)return 1;let zt=xi(ei),ie=.5*lt*Z(ei,w)/zt;const be=ie<0?-1:1;S&&(ie+=(zt-.5*lt*Z(ei,y)/zt)*be*K);const Ln=zt<1.5*r?1:Er;return zt=Math.max(zt-r,Er),be>0&&(ie-=ts*this._view.resolution),be*Math.max(be*(ie/zt),Ln)},W=et(d[0],p.basis1),gt=et(d[1],p.basis2);return{..._,direction:d,factor1:W,factor2:gt}}).next(this._preserveAspectRatio.createDragEventPipelineStep(),this._preserveAspectRatio.next).next(_=>{const y=rt(this._originCache,u.origin);z(y,y,u.basis1,-d[0]),z(y,y,u.basis2,-d[1]);const w=Yt(this._axisCache,u.basis1[0],u.basis1[1]);Ys(w,w);const b=o.data.allVertices,S=_.action==="start"?L.NEW_STEP:L.ACCUMULATE_STEPS,I=o.scaleVertices(b,y,w,_.factor1,_.factor2,S,nt.REPLACE);return l&&l(_.action==="end"&&(m.cursor="grab"),_))})}_createManipulator(){return new X({view:this._view,graphic:this._graphic,selectable:!0,cursor:"grab"})}}function Eg(e){return e?.type==="graphic"}function Sg(e){return e.find(Eg)??null}const Pg=80,Mg=10,kg=30,Cg=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],Pr=1,Rg=10;let _t=class extends B{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=Ei(),this._displayPlaneCache=Ei(),this._mainAxisCache=G(),this._rotationHandleCache=g(),this._cornerA=g(),this._cornerB=g(),this._cornerC=g(),this._cornerD=g(),this._avgAB=g(),this._avgBC=g(),this._avgCD=g(),this._avgDA=g(),this._preserveAspectRatio=new dg,this._snapRotation=new fg,this._graphicsLayer=new Xs({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._isOpacityToggled=!1,this._factor=Pr,this.preserveAspectRatio=null,this.snapRotation=null,this.type="transform"}initialize(){this._initialize()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach(t=>t.destroy()),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=dt(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(e==null)return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],n=q(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);Ys(n,n);let s=Pg*this.view.resolution;const o=this.view.spatialReference;return Qe(o,e.spatialReference)&&(s*=vi(o)/vi(e.spatialReference)),xg(n,t,s,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;Qi(e,t);const i=Mg*this.view.resolution;return fe(t.basis1,t.basis1,1+i/xi(t.basis1)),fe(t.basis2,t.basis2,1+i/xi(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new De({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return le(t,e.basis1),fe(t,t,kg*this.view.resolution),ut(t,t,e.origin),ut(t,t,e.basis1),new C({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:n,_cornerC:s,_cornerD:o}=this,r=Pe(this._avgAB,i,n,.5),l=Pe(this._avgBC,n,s,.5),h=Pe(this._avgCD,s,o,.5),u=Pe(this._avgDA,o,i,.5);return[new C({x:i[0],y:i[1],spatialReference:t}),new C({x:n[0],y:n[1],spatialReference:t}),new C({x:s[0],y:s[1],spatialReference:t}),new C({x:o[0],y:o[1],spatialReference:t}),new C({x:r[0],y:r[1],spatialReference:t}),new C({x:l[0],y:l[1],spatialReference:t}),new C({x:h[0],y:h[1],spatialReference:t}),new C({x:u[0],y:u[1],spatialReference:t})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?t.georeference.coords:t.geometry,n=this._editGeometryOperations,s=n.data.components[0].vertices,o=dn.fromGeometry(Xe(i,e.spatialReference),Ti.Local).components[0].vertices;s.forEach((r,l)=>{n.setVertexPosition(r,o[l].pos)}),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=e.georeference;t.type==="control-points"&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;"georeference"in this.target&&(this.target.georeference.coords=e),this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach((t,i)=>{this._scaleGraphics[i].geometry=t})}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}async _initialize(){const{view:e,target:t}=this;if("georeference"in t){const s=t.georeference;this._graphic=new Lt({geometry:s.coords}),this._initialControlPoints=s.type==="control-points"?s.controlPoints:null}else this._graphic=t,this._initialGeometry=t.geometry;e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation(),await this._loadProjectionEngine(),this._editGeometryOperations=wo.fromGeometry(Xe(this._graphic.geometry,e.spatialReference),Ti.Local),this._backgroundGraphic=new Lt({symbol:new Dl({color:"transparent",outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new Lt({symbol:new Ne({color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map(s=>new Lt({symbol:new Ne({size:6,style:"square",color:Fo(e.effectiveTheme.accentColor),outline:{type:"simple-line",color:e.effectiveTheme.accentColor,width:1}}),geometry:s})),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new Rl({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new bg({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map((s,o)=>new Tg({tool:this,view:e,graphic:s,direction:Cg[o],preserveAspectRatio:this._preserveAspectRatio})),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map(s=>s.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this))),U(()=>this.view.scale,()=>this.active?this.updateGraphics():null),e.on("click",async s=>{if(e.activeTool!=null&&e.activeTool!==this)return;const o=Xc(s),r=[];e.map.allLayers.forEach(u=>{u.type!=="vector-tile"&&u.type!=="imagery"||r.push(u)});const l=await this.view.hitTest(o,{exclude:r}),h=l.results;if(h.length===0)e.activeTool=null;else{const u=Sg(l.results),p="georeference"in t,d=h.map(f=>f.type==="media"?f.element:null).filter(Boolean),m=new Set([...this._graphicsLayer.graphics,p?null:t].filter(Boolean));p&&d.includes(t)||u!=null&&m.has(u.graphic)?e.activeTool==null&&(e.activeTool=this):e.activeTool=null}})]);const i=s=>{this.addHandles(s.events.on("grab-changed",o=>{"georeference"in t&&(o.action==="start"?t.opacity*=.5:o.action==="end"&&(t.opacity*=2))}))};this._dragManipulation.forEachManipulator(i),this._rotateManipulation.forEachManipulator(i),this._scaleManipulations.forEach(s=>s.forEachManipulator(i));const n=new Mp;n.addToggle(kt.preserveAspectRatio,()=>{this.preserveAspectRatio==null&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled)}),n.addToggle(kt.rotateIncrements,()=>{this.snapRotation==null&&(this._snapRotation.enabled=!this._snapRotation.enabled)}),n.add(kt.toggleOpacity,()=>{"georeference"in t&&(t.opacity*=this._isOpacityToggled?2:.5,this._isOpacityToggled=!this._isOpacityToggled)}),n.addToggle(kt.factorModifier,s=>this._factor=s.type==="key-down"?Rg:Pr),n.add(kt.scaleUp,()=>this._scale(this._factor)),n.add(kt.scaleDown,()=>this._scale(-this._factor)),n.add(kt.moveUp,()=>this._move(0,this._factor)),n.add(kt.moveDown,()=>this._move(0,-this._factor)),n.add(kt.moveLeft,()=>this._move(-this._factor,0)),n.add(kt.moveRight,()=>this._move(this._factor,0)),this.addHandles([e.on("key-down",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)}),e.on("key-up",s=>{e.activeTool===this&&n.dispatch(e.inputManager,s)})])}async _loadProjectionEngine(){const e=this._graphic.geometry;return ea(e.spatialReference,this.view.spatialReference)}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:n}=e,s=this._cornerA;ut(s,n,t),ut(s,s,i);const o=this._cornerB;ut(o,n,t),Et(o,o,i);const r=this._cornerC;Et(r,n,t),Et(r,r,i);const l=this._cornerD;Et(l,n,t),ut(l,l,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){e.action==="start"&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(e){const t=this._editGeometryOperations,i=t.data.geometry.extent?.width,n=(i+e*this.view.resolution)/i,s=t.scale(this._plane.origin,kc,n,n,L.NEW_STEP,nt.REPLACE);this._sharedUndoStack.push({tool:this,operation:s}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(e,t){const i=this._editGeometryOperations.move(e*this.view.resolution,t*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:i}),this._sharedRedoStack.length=0,this.updateGraphics()}};a([c()],_t.prototype,"_plane",null),a([c()],_t.prototype,"_backgroundGraphicGeometry",null),a([c()],_t.prototype,"_rotateGraphicGeometry",null),a([c()],_t.prototype,"_scaleGraphicGeometries",null),a([c()],_t.prototype,"preserveAspectRatio",void 0),a([c()],_t.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],_t.prototype,"target",void 0),a([c({readOnly:!0})],_t.prototype,"type",void 0),a([c({constructOnly:!0})],_t.prototype,"view",void 0),_t=a([x("esri.views.2d.interactive.editingTools.TransformTool")],_t);const Ki={redo:"r",undo:"z"};let ne=class extends tt{constructor(e){super(e),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=[],this._sharedRedoStack=[],this._originalOpacity=null,this.activeHandle=0}initialize(){const{view:e,mediaElement:t,preserveAspectRatio:i,snapRotation:n,advancedMode:s}=this;this._originalOpacity=t.opacity,this._transformTool=new _t({target:t,view:e,preserveAspectRatio:i,snapRotation:n}),this._controlPointsTransformTool=new Bt({mediaElement:t,view:e}),this._advancedModeTransformTool=new Bt({mediaElement:s.mediaElement,view:s.view}),this._transformTool.setSharedUndoStack(this._sharedUndoStack),this._transformTool.setSharedRedoStack(this._sharedRedoStack),this._controlPointsTransformTool.setSharedUndoStack(this._sharedUndoStack),this._controlPointsTransformTool.setSharedRedoStack(this._sharedRedoStack),this._advancedModeTransformTool.setSharedUndoStack(this._sharedUndoStack),this._advancedModeTransformTool.setSharedRedoStack(this._sharedRedoStack);const o=t.georeference,r=s.mediaElement.georeference;s.view.tools.addMany([this._advancedModeTransformTool]),"controlPoints"in r&&"controlPoints"in o&&this.addHandles([s.view.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),s.view.on("focus",async l=>{this._controlPointsTransformTool.removeHighlightActiveHandle(),this._advancedModeTransformTool.highlightActiveHandle()}),U(()=>r.controlPoints,l=>{o.controlPoints=l.map(({sourcePoint:h},u)=>({sourcePoint:h,mapPoint:o.controlPoints[u].mapPoint})),this._activeTool?.refresh()}),U(()=>this._controlPointsTransformTool.activeHandle,l=>{this._advancedModeTransformTool.updateActiveHandle(l),this.activeHandle=l}),U(()=>this._advancedModeTransformTool.activeHandle,l=>{this._controlPointsTransformTool.updateActiveHandle(l),this.activeHandle=l})]),this.addHandles([e.on("key-down",l=>{l.key===Ki.undo&&this.canUndo()&&(this.undo(),l.stopPropagation()),l.key===Ki.redo&&this.canRedo()&&(this.redo(),l.stopPropagation())}),e.on("focus",async l=>{this._advancedModeTransformTool.removeHighlightActiveHandle(),this._controlPointsTransformTool.highlightActiveHandle()})]),e.tools.addMany([this._transformTool,this._controlPointsTransformTool]),e.activeTool=this._transformTool,this._activeTool=this._transformTool,e.focus()}destroy(){this._transformTool?.destroy(),this._controlPointsTransformTool?.destroy(),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=null,this._sharedRedoStack=null}canUndo(){return this._sharedUndoStack.length>0}canRedo(){return this._sharedRedoStack.length>0}undo(){if(this._sharedUndoStack.length>0){const{tool:e,operation:t}=this._sharedUndoStack.pop();e!==this._activeTool&&e.refresh(),t.undo(),e.updateGraphics(),this._sharedRedoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}redo(){if(this._sharedRedoStack.length>0){const{tool:e,operation:t}=this._sharedRedoStack.pop();e!==this._activeTool&&e.refresh(),t.apply(),e.updateGraphics(),this._sharedUndoStack.push({tool:e,operation:t}),this._activeTool!==e&&this._activeTool?.refresh()}}refresh(){this._activeTool.refresh()}reset(){this._activeTool.reset(),this._advancedModeTransformTool.reset()}async enableAdvancedMode(){this.view.activeTool=this._controlPointsTransformTool,this._activeTool=this._controlPointsTransformTool,this._activeTool.refresh(),await this.advancedMode.view.when(),this.advancedMode.view.activeTool=this._advancedModeTransformTool,this._originalOpacity=this._controlPointsTransformTool.mediaElement.opacity,this._controlPointsTransformTool.mediaElement.opacity=.25*this._originalOpacity}disableAdvancedMode(){this.view.activeTool=this._transformTool,this._activeTool=this._transformTool,this._activeTool.refresh(),this.advancedMode.view.activeTool=null,this._controlPointsTransformTool.mediaElement.opacity=this._originalOpacity}};a([c()],ne.prototype,"activeHandle",void 0),a([c({constructOnly:!0})],ne.prototype,"advancedMode",void 0),a([c()],ne.prototype,"preserveAspectRatio",void 0),a([c()],ne.prototype,"snapRotation",void 0),a([c({constructOnly:!0,nonNullable:!0})],ne.prototype,"mediaElement",void 0),a([c({constructOnly:!0})],ne.prototype,"view",void 0),ne=a([x("esri.views.2d.interactive.editingTools.MediaTransformToolsWrapper")],ne);export{Bt as ControlPointsTransformTool,ai as DrawGraphicTool2D,ne as MediaTransformToolsWrapper,_t as TransformTool}; diff --git a/custom-toc-highlight/assets/editsZScale-BDsX6vv--CttUpViY.js b/custom-toc-highlight/assets/editsZScale-BDsX6vv--C-4n90TZ.js similarity index 89% rename from custom-toc-highlight/assets/editsZScale-BDsX6vv--CttUpViY.js rename to custom-toc-highlight/assets/editsZScale-BDsX6vv--C-4n90TZ.js index 1a7020aa..88a15f62 100644 --- a/custom-toc-highlight/assets/editsZScale-BDsX6vv--CttUpViY.js +++ b/custom-toc-highlight/assets/editsZScale-BDsX6vv--C-4n90TZ.js @@ -1 +1 @@ -import{dh as a,aC as c}from"./story-BfX8CRfG.js";function i(n,f,o){if(n.hasM==null||n.hasZ)for(const e of f)for(const t of e)t.length>2&&(t[2]*=o)}function p(n,f,o){if(!n&&!f||!o)return;const e=a(o);r(n,o,e),r(f,o,e)}function r(n,f,o){if(n)for(const e of n)l(e.geometry,f,o)}function l(n,f,o){if(!n?.spatialReference||c(n.spatialReference,f))return;const e=a(n.spatialReference)/o;if(e!==1){if("x"in n)n.z!=null&&(n.z*=e);else if("rings"in n)i(n,n.rings,e);else if("paths"in n)i(n,n.paths,e);else if("points"in n&&(n.hasM==null||n.hasZ))for(const t of n.points)t.length>2&&(t[2]*=e)}}export{p as c}; +import{dh as a,aC as c}from"./story-Doly9N9p.js";function i(n,f,o){if(n.hasM==null||n.hasZ)for(const e of f)for(const t of e)t.length>2&&(t[2]*=o)}function p(n,f,o){if(!n&&!f||!o)return;const e=a(o);r(n,o,e),r(f,o,e)}function r(n,f,o){if(n)for(const e of n)l(e.geometry,f,o)}function l(n,f,o){if(!n?.spatialReference||c(n.spatialReference,f))return;const e=a(n.spatialReference)/o;if(e!==1){if("x"in n)n.z!=null&&(n.z*=e);else if("rings"in n)i(n,n.rings,e);else if("paths"in n)i(n,n.paths,e);else if("points"in n&&(n.hasM==null||n.hasZ))for(const t of n.points)t.length>2&&(t[2]*=e)}}export{p as c}; diff --git a/custom-toc-highlight/assets/elevationInfoUtils-mOZsPH2J-If61I1du.js b/custom-toc-highlight/assets/elevationInfoUtils-mOZsPH2J-BlRQDLDN.js similarity index 95% rename from custom-toc-highlight/assets/elevationInfoUtils-mOZsPH2J-If61I1du.js rename to custom-toc-highlight/assets/elevationInfoUtils-mOZsPH2J-BlRQDLDN.js index 226677cc..a529f1ad 100644 --- a/custom-toc-highlight/assets/elevationInfoUtils-mOZsPH2J-If61I1du.js +++ b/custom-toc-highlight/assets/elevationInfoUtils-mOZsPH2J-BlRQDLDN.js @@ -1 +1 @@ -import{jw as g,di as m}from"./story-BfX8CRfG.js";import{j as h}from"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";function c(e){return e?y:I}function p(e,n){return n?.mode?n.mode:c(e).mode}function w(e,n){return n??c(e)}function f(e,n){return p(e==null||(e.hasZ??!1),n)}function $(e){const n=d(e);return f(e.geometry,n)}function R(e){const n=d(e),t=f(e.geometry,n),o=n!=null&&t!=="on-the-ground"?x(n):0,r=n?.featureExpressionInfo;return{mode:t,offset:o,featureExpressionInfo:r}}function d(e){return e.layer&&"elevationInfo"in e.layer?e.layer.elevationInfo:null}function s(e,n){if(!e?.offset)return 0;const{offset:t,unit:o}=e;if(o==="decimal-degrees")return 0;const r=o!=="unknown"&&o?o:"meters",i=g(n);return i?m(t,r,i):0}function j(e,n,t){if(!t?.mode)return;const o=e.hasZ?e.z:0,r=s(t,e.spatialReference);switch(t.mode){case"absolute-height":return o-r;case"on-the-ground":return 0;case"relative-to-ground":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"ground")??0)+r);case"relative-to-scene":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"scene")??0)+r)}}function z(e,n,t,o=null){return v(e,n.x,n.y,n.hasZ?n.z:0,n.spatialReference,t,o)}function k(e,n,t,o,r=null){return v(e,n[0],n[1],n.length>2?n[2]:0,t,o,r)}function v(e,n,t,o,r,i,l=null){if(i==null)return;const u=l!=null?l.mode:"absolute-height";if(u==="on-the-ground")return 0;const{absoluteZ:a}=E(n,t,o,r,e,i);return b(a,n,t,o,r,e,l,u)}function E(e,n,t,o,r,i){const l=s(i,o);switch(i.mode){case"absolute-height":return{absoluteZ:t+l,elevation:0};case"on-the-ground":{const u=r.elevationProvider.getElevation(e,n,0,o,"ground")??0;return{absoluteZ:u,elevation:u}}case"relative-to-ground":{const u=r.elevationProvider.getElevation(e,n,t,o,"ground")??0;return{absoluteZ:t+u+l,elevation:u}}case"relative-to-scene":{const u=r.elevationProvider.getElevation(e,n,t,o,"scene")??0;return{absoluteZ:t+u+l,elevation:u}}}}function b(e,n,t,o,r,i,l,u){const a=s(l,r);switch(u){case"absolute-height":return e-a;case"relative-to-ground":return e-((i.elevationProvider.getElevation(n,t,o,r,"ground")??0)+a);case"relative-to-scene":return e-((i.elevationProvider.getElevation(n,t,o,r,"scene")??0)+a)}}function V(e,n,t){return t&&t.mode!==n?`${e} only support ${n} elevation mode`:null}function q(e,n,t){return t?.mode===n?`${e} do not support ${n} elevation mode`:null}function A(e,n){return n?.featureExpressionInfo!=null&&n.featureExpressionInfo.expression!=="0"?`${e} do not support featureExpressionInfo`:null}function O(e,n){n&&e.warn(".elevationInfo=",n)}function x(e){return(e?.offset??0)*h(e?.unit)}const y={mode:"absolute-height",offset:0},I={mode:"on-the-ground",offset:null};export{R as I,z as P,V as R,j as Z,v as f,E as g,A as j,O as k,f as l,y as m,k as w,w as x,$ as y,q as z}; +import{jw as g,di as m}from"./story-Doly9N9p.js";import{j as h}from"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";function c(e){return e?y:I}function p(e,n){return n?.mode?n.mode:c(e).mode}function w(e,n){return n??c(e)}function f(e,n){return p(e==null||(e.hasZ??!1),n)}function $(e){const n=d(e);return f(e.geometry,n)}function R(e){const n=d(e),t=f(e.geometry,n),o=n!=null&&t!=="on-the-ground"?x(n):0,r=n?.featureExpressionInfo;return{mode:t,offset:o,featureExpressionInfo:r}}function d(e){return e.layer&&"elevationInfo"in e.layer?e.layer.elevationInfo:null}function s(e,n){if(!e?.offset)return 0;const{offset:t,unit:o}=e;if(o==="decimal-degrees")return 0;const r=o!=="unknown"&&o?o:"meters",i=g(n);return i?m(t,r,i):0}function j(e,n,t){if(!t?.mode)return;const o=e.hasZ?e.z:0,r=s(t,e.spatialReference);switch(t.mode){case"absolute-height":return o-r;case"on-the-ground":return 0;case"relative-to-ground":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"ground")??0)+r);case"relative-to-scene":return o-((n.elevationProvider.getElevation(e.x,e.y,o,e.spatialReference,"scene")??0)+r)}}function z(e,n,t,o=null){return v(e,n.x,n.y,n.hasZ?n.z:0,n.spatialReference,t,o)}function k(e,n,t,o,r=null){return v(e,n[0],n[1],n.length>2?n[2]:0,t,o,r)}function v(e,n,t,o,r,i,l=null){if(i==null)return;const u=l!=null?l.mode:"absolute-height";if(u==="on-the-ground")return 0;const{absoluteZ:a}=E(n,t,o,r,e,i);return b(a,n,t,o,r,e,l,u)}function E(e,n,t,o,r,i){const l=s(i,o);switch(i.mode){case"absolute-height":return{absoluteZ:t+l,elevation:0};case"on-the-ground":{const u=r.elevationProvider.getElevation(e,n,0,o,"ground")??0;return{absoluteZ:u,elevation:u}}case"relative-to-ground":{const u=r.elevationProvider.getElevation(e,n,t,o,"ground")??0;return{absoluteZ:t+u+l,elevation:u}}case"relative-to-scene":{const u=r.elevationProvider.getElevation(e,n,t,o,"scene")??0;return{absoluteZ:t+u+l,elevation:u}}}}function b(e,n,t,o,r,i,l,u){const a=s(l,r);switch(u){case"absolute-height":return e-a;case"relative-to-ground":return e-((i.elevationProvider.getElevation(n,t,o,r,"ground")??0)+a);case"relative-to-scene":return e-((i.elevationProvider.getElevation(n,t,o,r,"scene")??0)+a)}}function V(e,n,t){return t&&t.mode!==n?`${e} only support ${n} elevation mode`:null}function q(e,n,t){return t?.mode===n?`${e} do not support ${n} elevation mode`:null}function A(e,n){return n?.featureExpressionInfo!=null&&n.featureExpressionInfo.expression!=="0"?`${e} do not support featureExpressionInfo`:null}function O(e,n){n&&e.warn(".elevationInfo=",n)}function x(e){return(e?.offset??0)*h(e?.unit)}const y={mode:"absolute-height",offset:0},I={mode:"on-the-ground",offset:null};export{R as I,z as P,V as R,j as Z,v as f,E as g,A as j,O as k,f as l,y as m,k as w,w as x,$ as y,q as z}; diff --git a/custom-toc-highlight/assets/executeBinsQuery-26-59HNS-BdRaQbV5.js b/custom-toc-highlight/assets/executeBinsQuery-26-59HNS-DKYB7wBm.js similarity index 50% rename from custom-toc-highlight/assets/executeBinsQuery-26-59HNS-BdRaQbV5.js rename to custom-toc-highlight/assets/executeBinsQuery-26-59HNS-DKYB7wBm.js index 9bc11957..e324e933 100644 --- a/custom-toc-highlight/assets/executeBinsQuery-26-59HNS-BdRaQbV5.js +++ b/custom-toc-highlight/assets/executeBinsQuery-26-59HNS-DKYB7wBm.js @@ -1 +1 @@ -import{y as u}from"./utils-9sQxfkoa-KicvrT8N.js";import{a as p,f,bX as y,bM as m,bK as S,aC as c}from"./story-BfX8CRfG.js";import{B as l}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{f as R}from"./query-DFW9-NG_-gbjlxRZk.js";import g from"./BinsQuery-DjwQZqB8-DL4eLh1p.js";import{O}from"./FeatureSet-BkVNthuN-CwS44--W.js";import"./main-ugzBrWNm.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";function N(i){const r=i.geometry,e=i.toJSON(),t=e;let n,o,a;return r!=null&&(o=r.spatialReference,a=m(o),t.geometryType=S(r),t.geometry=JSON.stringify(r),t.inSR=a),e.outSR?(t.outSR=m(e.outSR),n=i.outSpatialReference):r&&(t.outSR=t.inSR,n=o),t.bin&&=JSON.stringify(t.bin),t.quantizationParameters&&=JSON.stringify(t.quantizationParameters),t.outStatistics&&=JSON.stringify(t.outStatistics),t.outTimeReference&&=JSON.stringify(t.outTimeReference),i.defaultSpatialReference&&c(o,n)&&(t.defaultSR=t.inSR,delete t.inSR,delete t.outSR),t}async function d(i,r,e){return q(i,r,e)}async function q(i,r,e={}){const t=typeof i=="string"?p(i):i,n=r.geometry?[r.geometry]:[],o=await l(n,null,{signal:e.signal}),a=o?.[0];a!=null&&((r=r.clone()).geometry=a);const s=R({...t.query,f:"json",...N(r)});return f(y(t.path,"queryBins"),{...e,query:{...s,...e.query}})}async function D(i,r,e){const{data:t}=await d(u(i),g.from(r),e);return O.fromJSON(t)}export{D as executeBinsQuery}; +import{y as u}from"./utils-9sQxfkoa-D8FX0sO8.js";import{a as p,f,bX as y,bM as m,bK as S,aC as c}from"./story-Doly9N9p.js";import{B as l}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{f as R}from"./query-DFW9-NG_-C3TyGmiM.js";import g from"./BinsQuery-DjwQZqB8-Ch0CPJ5I.js";import{O}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./main-QGPoLsvl.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";function N(i){const r=i.geometry,e=i.toJSON(),t=e;let n,o,a;return r!=null&&(o=r.spatialReference,a=m(o),t.geometryType=S(r),t.geometry=JSON.stringify(r),t.inSR=a),e.outSR?(t.outSR=m(e.outSR),n=i.outSpatialReference):r&&(t.outSR=t.inSR,n=o),t.bin&&=JSON.stringify(t.bin),t.quantizationParameters&&=JSON.stringify(t.quantizationParameters),t.outStatistics&&=JSON.stringify(t.outStatistics),t.outTimeReference&&=JSON.stringify(t.outTimeReference),i.defaultSpatialReference&&c(o,n)&&(t.defaultSR=t.inSR,delete t.inSR,delete t.outSR),t}async function d(i,r,e){return q(i,r,e)}async function q(i,r,e={}){const t=typeof i=="string"?p(i):i,n=r.geometry?[r.geometry]:[],o=await l(n,null,{signal:e.signal}),a=o?.[0];a!=null&&((r=r.clone()).geometry=a);const s=R({...t.query,f:"json",...N(r)});return f(y(t.path,"queryBins"),{...e,query:{...s,...e.query}})}async function D(i,r,e){const{data:t}=await d(u(i),g.from(r),e);return O.fromJSON(t)}export{D as executeBinsQuery}; diff --git a/custom-toc-highlight/assets/executeForIds-Z1gkLduF-CrWEksFG.js b/custom-toc-highlight/assets/executeForIds-Z1gkLduF-CrWEksFG.js new file mode 100644 index 00000000..36bc4d71 --- /dev/null +++ b/custom-toc-highlight/assets/executeForIds-Z1gkLduF-CrWEksFG.js @@ -0,0 +1 @@ +import{y as c}from"./utils-9sQxfkoa-D8FX0sO8.js";import{P as m,N as f}from"./query-DFW9-NG_-C3TyGmiM.js";import{b as i}from"./Query-BrwMGK8U-BPr0_G9t.js";async function p(t,o,r){const n=c(t),{data:a}=await m(n,i.from(o),r);return a.count}async function d(t,o,r){const n=c(t),{data:a}=await f(n,i.from(o),r);return a.objectIds}export{d as e,p as i}; diff --git a/custom-toc-highlight/assets/executeForIds-Z1gkLduF-D8DZG8qZ.js b/custom-toc-highlight/assets/executeForIds-Z1gkLduF-D8DZG8qZ.js deleted file mode 100644 index 30879802..00000000 --- a/custom-toc-highlight/assets/executeForIds-Z1gkLduF-D8DZG8qZ.js +++ /dev/null @@ -1 +0,0 @@ -import{y as c}from"./utils-9sQxfkoa-KicvrT8N.js";import{P as m,N as f}from"./query-DFW9-NG_-gbjlxRZk.js";import{b as i}from"./Query-BrwMGK8U-DoFNfkjX.js";async function p(t,o,r){const n=c(t),{data:a}=await m(n,i.from(o),r);return a.count}async function d(t,o,r){const n=c(t),{data:a}=await f(n,i.from(o),r);return a.objectIds}export{d as e,p as i}; diff --git a/custom-toc-highlight/assets/executeForTopCount-Dx1gCDe1-BVXGJFEi.js b/custom-toc-highlight/assets/executeForTopCount-Dx1gCDe1-BVXGJFEi.js new file mode 100644 index 00000000..514846e2 --- /dev/null +++ b/custom-toc-highlight/assets/executeForTopCount-Dx1gCDe1-BVXGJFEi.js @@ -0,0 +1 @@ +import{y as i}from"./utils-9sQxfkoa-D8FX0sO8.js";import{S as p}from"./queryTopFeatures-IbhAPJlP-DZGdrKJR.js";import a from"./TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./query-DFW9-NG_-C3TyGmiM.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";async function j(o,t,r){const m=i(o);return(await p(m,a.from(t),{...r})).data.count}export{j as executeForTopCount}; diff --git a/custom-toc-highlight/assets/executeForTopCount-Dx1gCDe1-JhF_sU0m.js b/custom-toc-highlight/assets/executeForTopCount-Dx1gCDe1-JhF_sU0m.js deleted file mode 100644 index 9a8ef205..00000000 --- a/custom-toc-highlight/assets/executeForTopCount-Dx1gCDe1-JhF_sU0m.js +++ /dev/null @@ -1 +0,0 @@ -import{y as i}from"./utils-9sQxfkoa-KicvrT8N.js";import{S as p}from"./queryTopFeatures-IbhAPJlP-DYmbt-VV.js";import a from"./TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./query-DFW9-NG_-gbjlxRZk.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";async function j(o,t,r){const m=i(o);return(await p(m,a.from(t),{...r})).data.count}export{j as executeForTopCount}; diff --git a/custom-toc-highlight/assets/executeForTopExtents-3NOTiZTn-7q7qEr0x.js b/custom-toc-highlight/assets/executeForTopExtents-3NOTiZTn-7q7qEr0x.js new file mode 100644 index 00000000..f34c5c5c --- /dev/null +++ b/custom-toc-highlight/assets/executeForTopExtents-3NOTiZTn-7q7qEr0x.js @@ -0,0 +1 @@ +import{n as a}from"./story-Doly9N9p.js";import{y as n}from"./utils-9sQxfkoa-D8FX0sO8.js";import{R as e}from"./queryTopFeatures-IbhAPJlP-DZGdrKJR.js";import x from"./TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js";import"./main-QGPoLsvl.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./query-DFW9-NG_-C3TyGmiM.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";async function b(m,r,i){const p=n(m),o=await e(p,x.from(r),{...i}),t=o.data.extent;return!t||isNaN(t.xmin)||isNaN(t.ymin)||isNaN(t.xmax)||isNaN(t.ymax)?{count:o.data.count,extent:null}:{count:o.data.count,extent:a.fromJSON(t)}}export{b as executeForTopExtents}; diff --git a/custom-toc-highlight/assets/executeForTopExtents-3NOTiZTn-K-9KTgQh.js b/custom-toc-highlight/assets/executeForTopExtents-3NOTiZTn-K-9KTgQh.js deleted file mode 100644 index 7986adbd..00000000 --- a/custom-toc-highlight/assets/executeForTopExtents-3NOTiZTn-K-9KTgQh.js +++ /dev/null @@ -1 +0,0 @@ -import{n as a}from"./story-BfX8CRfG.js";import{y as n}from"./utils-9sQxfkoa-KicvrT8N.js";import{R as e}from"./queryTopFeatures-IbhAPJlP-DYmbt-VV.js";import x from"./TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js";import"./main-ugzBrWNm.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./query-DFW9-NG_-gbjlxRZk.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";async function b(m,r,i){const p=n(m),o=await e(p,x.from(r),{...i}),t=o.data.extent;return!t||isNaN(t.xmin)||isNaN(t.ymin)||isNaN(t.xmax)||isNaN(t.ymax)?{count:o.data.count,extent:null}:{count:o.data.count,extent:a.fromJSON(t)}}export{b as executeForTopExtents}; diff --git a/custom-toc-highlight/assets/executeForTopIds-BWxBZygF-D-DeY4Tc.js b/custom-toc-highlight/assets/executeForTopIds-BWxBZygF-D-DeY4Tc.js new file mode 100644 index 00000000..2771d426 --- /dev/null +++ b/custom-toc-highlight/assets/executeForTopIds-BWxBZygF-D-DeY4Tc.js @@ -0,0 +1 @@ +import{y as i}from"./utils-9sQxfkoa-D8FX0sO8.js";import{B as p}from"./queryTopFeatures-IbhAPJlP-DZGdrKJR.js";import a from"./TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./query-DFW9-NG_-C3TyGmiM.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";async function h(o,r,t){const m=i(o);return(await p(m,a.from(r),{...t})).data.objectIds}export{h as executeForTopIds}; diff --git a/custom-toc-highlight/assets/executeForTopIds-BWxBZygF-myXyOtDE.js b/custom-toc-highlight/assets/executeForTopIds-BWxBZygF-myXyOtDE.js deleted file mode 100644 index 9553eade..00000000 --- a/custom-toc-highlight/assets/executeForTopIds-BWxBZygF-myXyOtDE.js +++ /dev/null @@ -1 +0,0 @@ -import{y as i}from"./utils-9sQxfkoa-KicvrT8N.js";import{B as p}from"./queryTopFeatures-IbhAPJlP-DYmbt-VV.js";import a from"./TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./query-DFW9-NG_-gbjlxRZk.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";async function h(o,r,t){const m=i(o);return(await p(m,a.from(r),{...t})).data.objectIds}export{h as executeForTopIds}; diff --git a/custom-toc-highlight/assets/executeQueryJSON-CcHnccia-BW7_NQxl.js b/custom-toc-highlight/assets/executeQueryJSON-CcHnccia-BW7_NQxl.js deleted file mode 100644 index c7dec167..00000000 --- a/custom-toc-highlight/assets/executeQueryJSON-CcHnccia-BW7_NQxl.js +++ /dev/null @@ -1 +0,0 @@ -import{y as i}from"./utils-9sQxfkoa-KicvrT8N.js";import{q as s}from"./query-DFW9-NG_-gbjlxRZk.js";import{O as c}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{b as e}from"./Query-BrwMGK8U-DoFNfkjX.js";async function S(r,t,o){const a=await p(r,t,o);return c.fromJSON(a)}async function p(r,t,o){const a=i(r),m={...o},n=e.from(t),{data:f}=await s(a,n,n.sourceSpatialReference,m);return f}export{p as s,S as u}; diff --git a/custom-toc-highlight/assets/executeQueryJSON-CcHnccia-M-vnTvKl.js b/custom-toc-highlight/assets/executeQueryJSON-CcHnccia-M-vnTvKl.js new file mode 100644 index 00000000..4256ca2d --- /dev/null +++ b/custom-toc-highlight/assets/executeQueryJSON-CcHnccia-M-vnTvKl.js @@ -0,0 +1 @@ +import{y as i}from"./utils-9sQxfkoa-D8FX0sO8.js";import{q as s}from"./query-DFW9-NG_-C3TyGmiM.js";import{O as c}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{b as e}from"./Query-BrwMGK8U-BPr0_G9t.js";async function S(r,t,o){const a=await p(r,t,o);return c.fromJSON(a)}async function p(r,t,o){const a=i(r),m={...o},n=e.from(t),{data:f}=await s(a,n,n.sourceSpatialReference,m);return f}export{p as s,S as u}; diff --git a/custom-toc-highlight/assets/executeQueryPBF-o8010HS9-BgTBXvCY.js b/custom-toc-highlight/assets/executeQueryPBF-o8010HS9-B7Z-YQyg.js similarity index 92% rename from custom-toc-highlight/assets/executeQueryPBF-o8010HS9-BgTBXvCY.js rename to custom-toc-highlight/assets/executeQueryPBF-o8010HS9-B7Z-YQyg.js index b993d3ad..778cb990 100644 --- a/custom-toc-highlight/assets/executeQueryPBF-o8010HS9-BgTBXvCY.js +++ b/custom-toc-highlight/assets/executeQueryPBF-o8010HS9-B7Z-YQyg.js @@ -1 +1 @@ -import{n as f,O as m}from"./story-BfX8CRfG.js";import{y as u}from"./utils-9sQxfkoa-KicvrT8N.js";import{w as _,J as p}from"./query-DFW9-NG_-gbjlxRZk.js";import{b as l}from"./Query-BrwMGK8U-DoFNfkjX.js";import{o as y}from"./projection-BA9M1R7d-BYoCXVXt.js";import{D as P,n as C}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";async function k(o,t,e){const r=u(o),s=await _(r,l.from(t),{...e}),n=s.data.extent;return!n||isNaN(n.xmin)||isNaN(n.ymin)||isNaN(n.xmax)||isNaN(n.ymax)?{count:s.data.count,extent:null}:{count:s.data.count,extent:f.fromJSON(n)}}function g(o,t){return t}function h(o,t,e,r){switch(e){case 0:return i(o,t+r,0);case 1:return o.originPosition==="lowerLeft"?i(o,t+r,1):v(o,t+r,1)}}function d(o,t,e,r){return e===2?i(o,t,2):h(o,t,e,r)}function G(o,t,e,r){return e===2?t===0?0:i(o,t,3):h(o,t,e,r)}function x(o,t,e,r){return e===3?t===0?0:i(o,t,3):d(o,t,e,r)}function i({translate:o,scale:t},e,r){return o[r]+e*t[r]}function v({translate:o,scale:t},e,r){return o[r]-e*t[r]}class M{constructor(t){this._options=t,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=g,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=y(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const r of t.features)e(r.geometry)}createSpatialReference(){return{}}addField(t,e){const r=t.fields;m(r),r.push(e);const s=r.map(n=>n.name);this._attributesConstructor=function(){for(const n of s)this[n]=null}}addFeature(t,e){t.features.push(e)}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._mValueOffset=null,this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),t.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,r,s)=>this.addCoordinatePoint(e,r,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,r,s)=>this._addCoordinatePolygon(e,r,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,r,s)=>this._addCoordinatePolyline(e,r,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,r,s)=>this._addCoordinateMultipoint(e,r,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}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(t,e,r){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,n=P(r.clone(),r,!1,!1,this._transform),a=C(n,s,!1,!1);t.queryGeometryType=s,t.queryGeometry={...a}}createPointGeometry(t){const e={x:0,y:0,spatialReference:t.spatialReference};return t.hasZ&&(e.z=0),t.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform;switch(e=this._applyTransform(s,e,r,0),r){case 0:t.x=e;break;case 1:t.y=e;break;case 2:"z"in t?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let r=0;e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t);const s=this._transform;return this._mValueOffset!==null&&t===0&&e>0&&!(e%this._mValueOffset)?0:this._applyTransform(s,t,e,r)}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){r===0&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){r===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),n=t[t.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),n.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?x:e?d:r?G:h}}async function N(o,t,e){const r=u(o),s={...e},n=l.from(t),a=!n.quantizationParameters,{data:c}=await p(r,n,new M({sourceSpatialReference:n.sourceSpatialReference,applyTransform:a}),s);return c}export{N as T,k as g}; +import{n as f,O as m}from"./story-Doly9N9p.js";import{y as u}from"./utils-9sQxfkoa-D8FX0sO8.js";import{w as _,J as p}from"./query-DFW9-NG_-C3TyGmiM.js";import{b as l}from"./Query-BrwMGK8U-BPr0_G9t.js";import{o as y}from"./projection-BA9M1R7d-CAbqHZiw.js";import{D as P,n as C}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";async function k(o,t,e){const r=u(o),s=await _(r,l.from(t),{...e}),n=s.data.extent;return!n||isNaN(n.xmin)||isNaN(n.ymin)||isNaN(n.xmax)||isNaN(n.ymax)?{count:s.data.count,extent:null}:{count:s.data.count,extent:f.fromJSON(n)}}function g(o,t){return t}function h(o,t,e,r){switch(e){case 0:return i(o,t+r,0);case 1:return o.originPosition==="lowerLeft"?i(o,t+r,1):v(o,t+r,1)}}function d(o,t,e,r){return e===2?i(o,t,2):h(o,t,e,r)}function G(o,t,e,r){return e===2?t===0?0:i(o,t,3):h(o,t,e,r)}function x(o,t,e,r){return e===3?t===0?0:i(o,t,3):d(o,t,e,r)}function i({translate:o,scale:t},e,r){return o[r]+e*t[r]}function v({translate:o,scale:t},e,r){return o[r]-e*t[r]}class M{constructor(t){this._options=t,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=g,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._mValueOffset=null,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=y(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(e!=null)for(const r of t.features)e(r.geometry)}createSpatialReference(){return{}}addField(t,e){const r=t.fields;m(r),r.push(e);const s=r.map(n=>n.name);this._attributesConstructor=function(){for(const n of s)this[n]=null}}addFeature(t,e){t.features.push(e)}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._mValueOffset=null,this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&(this._mValueOffset=this._vertexDimension,this._vertexDimension++),t.geometryType){case"esriGeometryPoint":this.addCoordinate=(e,r,s)=>this.addCoordinatePoint(e,r,s),this.createGeometry=e=>this.createPointGeometry(e);break;case"esriGeometryPolygon":this.addCoordinate=(e,r,s)=>this._addCoordinatePolygon(e,r,s),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"esriGeometryPolyline":this.addCoordinate=(e,r,s)=>this._addCoordinatePolyline(e,r,s),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"esriGeometryMultipoint":this.addCoordinate=(e,r,s)=>this._addCoordinateMultipoint(e,r,s),this.createGeometry=e=>this._createMultipointGeometry(e)}}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(t,e,r){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}addQueryGeometry(t,e){const{queryGeometry:r,queryGeometryType:s}=e,n=P(r.clone(),r,!1,!1,this._transform),a=C(n,s,!1,!1);t.queryGeometryType=s,t.queryGeometry={...a}}createPointGeometry(t){const e={x:0,y:0,spatialReference:t.spatialReference};return t.hasZ&&(e.z=0),t.hasM&&(e.m=0),e}addCoordinatePoint(t,e,r){const s=this._transform;switch(e=this._applyTransform(s,e,r,0),r){case 0:t.x=e;break;case 1:t.y=e;break;case 2:"z"in t?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let r=0;e<=1&&(r=this._previousCoordinate[e],this._previousCoordinate[e]+=t);const s=this._transform;return this._mValueOffset!==null&&t===0&&e>0&&!(e%this._mValueOffset)?0:this._applyTransform(s,t,e,r)}_addCoordinatePolyline(t,e,r){this._dehydratedAddPointsCoordinate(t.paths,e,r)}_addCoordinatePolygon(t,e,r){this._dehydratedAddPointsCoordinate(t.rings,e,r)}_addCoordinateMultipoint(t,e,r){r===0&&t.points.push([]);const s=this._transformPathLikeValue(e,r);t.points[t.points.length-1].push(s)}_createPolygonGeometry(t){return{rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,r){r===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const s=this._transformPathLikeValue(e,r),n=t[t.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),n.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=s}_deriveApplyTransform(t){const{hasZ:e,hasM:r}=t;return e&&r?x:e?d:r?G:h}}async function N(o,t,e){const r=u(o),s={...e},n=l.from(t),a=!n.quantizationParameters,{data:c}=await p(r,n,new M({sourceSpatialReference:n.sourceSpatialReference,applyTransform:a}),s);return c}export{N as T,k as g}; diff --git a/custom-toc-highlight/assets/executeRelationshipQuery-BlX9_g4g-CUgaAeUL.js b/custom-toc-highlight/assets/executeRelationshipQuery-BlX9_g4g-QPs1Jx7X.js similarity index 64% rename from custom-toc-highlight/assets/executeRelationshipQuery-BlX9_g4g-CUgaAeUL.js rename to custom-toc-highlight/assets/executeRelationshipQuery-BlX9_g4g-QPs1Jx7X.js index ba819b2e..79e79f18 100644 --- a/custom-toc-highlight/assets/executeRelationshipQuery-BlX9_g4g-CUgaAeUL.js +++ b/custom-toc-highlight/assets/executeRelationshipQuery-BlX9_g4g-QPs1Jx7X.js @@ -1 +1 @@ -import{y as m}from"./utils-9sQxfkoa-KicvrT8N.js";import{f as p,bM as y}from"./story-BfX8CRfG.js";import{f as j}from"./query-DFW9-NG_-gbjlxRZk.js";import{O as R}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{d as f}from"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import"./main-ugzBrWNm.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";function b(r,e){const t=r.toJSON();return t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.orderByFields&&(t.orderByFields=t.orderByFields.join(",")),t.outFields&&!e?.returnCountOnly?t.outFields.includes("*")?t.outFields="*":t.outFields=t.outFields.join(","):delete t.outFields,t.outSR&&(t.outSR=y(t.outSR)),t.dynamicDataSource&&(t.layer=JSON.stringify({source:t.dynamicDataSource}),delete t.dynamicDataSource),t}async function F(r,e,t){const n=await l(r,e,t),o=n.data,s=o.geometryType,a=o.spatialReference,i={};for(const c of o.relatedRecordGroups){const d={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:a,hasZ:!!o.hasZ,hasM:!!o.hasM,features:c.relatedRecords};if(c.objectId!=null)i[c.objectId]=d;else for(const u of Object.keys(c))u!=="relatedRecords"&&(i[c[u]]=d)}return{...n,data:i}}async function h(r,e,t){const n=await l(r,e,t,{returnCountOnly:!0}),o=n.data,s={};for(const a of o.relatedRecordGroups)a.objectId!=null&&(s[a.objectId]=a.count);return{...n,data:s}}async function l(r,e,t={},n){const o=j({...r.query,f:"json",...n,...b(e,n)});return p(r.path+"/queryRelatedRecords",{...t,query:{...t.query,...o}})}async function V(r,e,t){e=f.from(e);const n=m(r);return F(n,e,t).then(o=>{const s=o.data,a={};return Object.keys(s).forEach(i=>a[i]=R.fromJSON(s[i])),a})}async function $(r,e,t){e=f.from(e);const n=m(r);return h(n,e,{...t}).then(o=>o.data)}export{V as executeRelationshipQuery,$ as executeRelationshipQueryForCount}; +import{y as m}from"./utils-9sQxfkoa-D8FX0sO8.js";import{f as p,bM as y}from"./story-Doly9N9p.js";import{f as j}from"./query-DFW9-NG_-C3TyGmiM.js";import{O as R}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{d as f}from"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./main-QGPoLsvl.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";function b(r,e){const t=r.toJSON();return t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.orderByFields&&(t.orderByFields=t.orderByFields.join(",")),t.outFields&&!e?.returnCountOnly?t.outFields.includes("*")?t.outFields="*":t.outFields=t.outFields.join(","):delete t.outFields,t.outSR&&(t.outSR=y(t.outSR)),t.dynamicDataSource&&(t.layer=JSON.stringify({source:t.dynamicDataSource}),delete t.dynamicDataSource),t}async function F(r,e,t){const n=await l(r,e,t),o=n.data,s=o.geometryType,a=o.spatialReference,i={};for(const c of o.relatedRecordGroups){const d={fields:void 0,objectIdFieldName:void 0,geometryType:s,spatialReference:a,hasZ:!!o.hasZ,hasM:!!o.hasM,features:c.relatedRecords};if(c.objectId!=null)i[c.objectId]=d;else for(const u of Object.keys(c))u!=="relatedRecords"&&(i[c[u]]=d)}return{...n,data:i}}async function h(r,e,t){const n=await l(r,e,t,{returnCountOnly:!0}),o=n.data,s={};for(const a of o.relatedRecordGroups)a.objectId!=null&&(s[a.objectId]=a.count);return{...n,data:s}}async function l(r,e,t={},n){const o=j({...r.query,f:"json",...n,...b(e,n)});return p(r.path+"/queryRelatedRecords",{...t,query:{...t.query,...o}})}async function V(r,e,t){e=f.from(e);const n=m(r);return F(n,e,t).then(o=>{const s=o.data,a={};return Object.keys(s).forEach(i=>a[i]=R.fromJSON(s[i])),a})}async function $(r,e,t){e=f.from(e);const n=m(r);return h(n,e,{...t}).then(o=>o.data)}export{V as executeRelationshipQuery,$ as executeRelationshipQueryForCount}; diff --git a/custom-toc-highlight/assets/executeTopFeaturesQuery-CjTd36wS-B31_Gdx0.js b/custom-toc-highlight/assets/executeTopFeaturesQuery-CjTd36wS-B31_Gdx0.js deleted file mode 100644 index 7b2d259f..00000000 --- a/custom-toc-highlight/assets/executeTopFeaturesQuery-CjTd36wS-B31_Gdx0.js +++ /dev/null @@ -1 +0,0 @@ -import{y as f}from"./utils-9sQxfkoa-KicvrT8N.js";import{g as a}from"./queryTopFeatures-IbhAPJlP-DYmbt-VV.js";import{O as u}from"./FeatureSet-BkVNthuN-CwS44--W.js";import n from"./TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./query-DFW9-NG_-gbjlxRZk.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";async function v(r,o,t,m){const i=f(r),p={...m},{data:e}=await a(i,n.from(o),t,p);return u.fromJSON(e)}export{v as executeTopFeaturesQuery}; diff --git a/custom-toc-highlight/assets/executeTopFeaturesQuery-CjTd36wS-CcVA1k2F.js b/custom-toc-highlight/assets/executeTopFeaturesQuery-CjTd36wS-CcVA1k2F.js new file mode 100644 index 00000000..d4bccb77 --- /dev/null +++ b/custom-toc-highlight/assets/executeTopFeaturesQuery-CjTd36wS-CcVA1k2F.js @@ -0,0 +1 @@ +import{y as f}from"./utils-9sQxfkoa-D8FX0sO8.js";import{g as a}from"./queryTopFeatures-IbhAPJlP-DZGdrKJR.js";import{O as u}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import n from"./TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./query-DFW9-NG_-C3TyGmiM.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";async function v(r,o,t,m){const i=f(r),p={...m},{data:e}=await a(i,n.from(o),t,p);return u.fromJSON(e)}export{v as executeTopFeaturesQuery}; diff --git a/custom-toc-highlight/assets/fabric-Df28hv38-CC2TWXwY.js b/custom-toc-highlight/assets/fabric-Df28hv38-DoClkw8Q.js similarity index 99% rename from custom-toc-highlight/assets/fabric-Df28hv38-CC2TWXwY.js rename to custom-toc-highlight/assets/fabric-Df28hv38-DoClkw8Q.js index cb4559be..a90fbbbb 100644 --- a/custom-toc-highlight/assets/fabric-Df28hv38-CC2TWXwY.js +++ b/custom-toc-highlight/assets/fabric-Df28hv38-DoClkw8Q.js @@ -1,4 +1,4 @@ -import{fA as Ct}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";function St(Z,f){for(var ft=0;ftht[lt]})}}}return Object.freeze(Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"}))}var mt={};const Tt={},wt=Object.freeze(Object.defineProperty({__proto__:null,default:Tt},Symbol.toStringTag,{value:"Module"})),pt=Ct(wt);var yt;function Ot(){return yt||(yt=1,function(Z){var f=f||{version:"5.3.0"};if(Z.fabric=f,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?f.document=document:f.document=document.implementation.createHTMLDocument(""),f.window=window;else{var ft=pt,ht=new ft.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;f.document=ht.document,f.jsdomImplForWrapper=pt.implForWrapper,f.nodeCanvas=pt.Canvas,f.window=ht,DOMParser=f.window.DOMParser}f.isTouchSupported="ontouchstart"in f.window||"ontouchstart"in f.document||f.window&&f.window.navigator&&f.window.navigator.maxTouchPoints>0,f.isLikelyNode=typeof Buffer<"u"&&typeof window>"u",f.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],f.DPI=96,f.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",f.commaWsp="(?:\\s+,?\\s*|,\\s*)",f.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,f.reNonWord=/[ \n\.,;!\?\-]/,f.fontPaths={},f.iMatrix=[1,0,0,1,0,0],f.svgNS="http://www.w3.org/2000/svg",f.perfLimitSizeTotal=2097152,f.maxCacheSideLimit=4096,f.minCacheSideLimit=256,f.charWidthsCache={},f.textureSize=2048,f.disableStyleCopyPaste=!1,f.enableGLFiltering=!0,f.devicePixelRatio=f.window.devicePixelRatio||f.window.webkitDevicePixelRatio||f.window.mozDevicePixelRatio||1,f.browserShadowBlurConstant=1,f.arcToSegmentsCache={},f.boundsOfCurveCache={},f.cachesBoundsOfCurve=!0,f.forceGLPutImageData=!1,f.initFilterBackend=function(){if(f.enableGLFiltering&&f.isWebglSupported&&f.isWebglSupported(f.textureSize))return console.log("max texture size: "+f.maxTextureSize),new f.WebglFilterBackend({tileSize:f.textureSize});if(f.Canvas2dFilterBackend)return new f.Canvas2dFilterBackend},typeof document<"u"&&typeof window<"u"&&(window.fabric=f),function(){function c(t,n){if(this.__eventListeners[t]){var a=this.__eventListeners[t];n?a[a.indexOf(n)]=!1:f.util.array.fill(a,!1)}}function s(t,n){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var a in t)this.on(a,t[a]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(n);return this}function h(t,n){var a=function(){n.apply(this,arguments),this.off(t,a)}.bind(this);this.on(t,a)}function o(t,n){if(arguments.length===1)for(var a in t)h.call(this,a,t[a]);else h.call(this,t,n);return this}function e(t,n){if(!this.__eventListeners)return this;if(arguments.length===0)for(t in this.__eventListeners)c.call(this,t);else if(arguments.length===1&&typeof arguments[0]=="object")for(var a in t)c.call(this,a,t[a]);else c.call(this,t,n);return this}function r(t,n){if(!this.__eventListeners)return this;var a=this.__eventListeners[t];if(!a)return this;for(var i=0,l=a.length;i"u"?this._objects.concat():this._objects.filter(function(s){return s.type===c})},item:function(c){return this._objects[c]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(c,s){return this._objects.indexOf(c)>-1?!0:s?this._objects.some(function(h){return typeof h.contains=="function"&&h.contains(c,!0)}):!1},complexity:function(){return this._objects.reduce(function(c,s){return c+=s.complexity?s.complexity():0,c},0)}},f.CommonMethods={_setOptions:function(c){for(var s in c)this.set(s,c[s])},_initGradient:function(c,s){c&&c.colorStops&&!(c instanceof f.Gradient)&&this.set(s,new f.Gradient(c))},_initPattern:function(c,s,h){c&&c.source&&!(c instanceof f.Pattern)?this.set(s,new f.Pattern(c,h)):h&&h()},_setObject:function(c){for(var s in c)this._set(s,c[s])},set:function(c,s){return typeof c=="object"?this._setObject(c):this._set(c,s),this},_set:function(c,s){this[c]=s},toggle:function(c){var s=this.get(c);return typeof s=="boolean"&&this.set(c,!s),this},get:function(c){return this[c]}},function(c){var s=Math.sqrt,h=Math.atan2,o=Math.pow,e=Math.PI/180,r=Math.PI/2;f.util={cos:function(t){if(t===0)return 1;t<0&&(t=-t);var n=t/r;switch(n){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(t===0)return 0;var n=t/r,a=1;switch(t<0&&(a=-1),n){case 1:return a;case 2:return 0;case 3:return-a}return Math.sin(t)},removeFromArray:function(t,n){var a=t.indexOf(n);return a!==-1&&t.splice(a,1),t},getRandomInt:function(t,n){return Math.floor(Math.random()*(n-t+1))+t},degreesToRadians:function(t){return t*e},radiansToDegrees:function(t){return t/e},rotatePoint:function(t,n,a){var i=new f.Point(t.x-n.x,t.y-n.y),l=f.util.rotateVector(i,a);return new f.Point(l.x,l.y).addEquals(n)},rotateVector:function(t,n){var a=f.util.sin(n),i=f.util.cos(n),l=t.x*i-t.y*a,u=t.x*a+t.y*i;return{x:l,y:u}},createVector:function(t,n){return new f.Point(n.x-t.x,n.y-t.y)},calcAngleBetweenVectors:function(t,n){return Math.acos((t.x*n.x+t.y*n.y)/(Math.hypot(t.x,t.y)*Math.hypot(n.x,n.y)))},getHatVector:function(t){return new f.Point(t.x,t.y).multiply(1/Math.hypot(t.x,t.y))},getBisector:function(t,n,a){var i=f.util.createVector(t,n),l=f.util.createVector(t,a),u=f.util.calcAngleBetweenVectors(i,l),d=f.util.calcAngleBetweenVectors(f.util.rotateVector(i,u),l),g=u*(d===0?1:-1)/2;return{vector:f.util.getHatVector(f.util.rotateVector(i,g)),angle:u}},projectStrokeOnPoints:function(t,n,a){var i=[],l=n.strokeWidth/2,u=n.strokeUniform?new f.Point(1/n.scaleX,1/n.scaleY):new f.Point(1,1),d=function(g){var p=l/Math.hypot(g.x,g.y);return new f.Point(g.x*p*u.x,g.y*p*u.y)};return t.length<=1||t.forEach(function(g,p){var v=new f.Point(g.x,g.y),_,T;p===0?(T=t[p+1],_=a?d(f.util.createVector(T,v)).addEquals(v):t[t.length-1]):p===t.length-1?(_=t[p-1],T=a?d(f.util.createVector(_,v)).addEquals(v):t[0]):(_=t[p-1],T=t[p+1]);var A=f.util.getBisector(v,_,T),X=A.vector,W=A.angle,N,V;if(n.strokeLineJoin==="miter"&&(N=-l/Math.sin(W/2),V=new f.Point(X.x*N*u.x,X.y*N*u.y),Math.hypot(V.x,V.y)/l<=n.strokeMiterLimit)){i.push(v.add(V)),i.push(v.subtract(V));return}N=-l*Math.SQRT2,V=new f.Point(X.x*N*u.x,X.y*N*u.y),i.push(v.add(V)),i.push(v.subtract(V))}),i},transformPoint:function(t,n,a){return a?new f.Point(n[0]*t.x+n[2]*t.y,n[1]*t.x+n[3]*t.y):new f.Point(n[0]*t.x+n[2]*t.y+n[4],n[1]*t.x+n[3]*t.y+n[5])},makeBoundingBoxFromPoints:function(t,n){if(n)for(var a=0;a"u"?1:t.scaleX,a=typeof t.scaleY>"u"?1:t.scaleY,i=[t.flipX?-n:n,0,0,t.flipY?-a:a,0,0],l=f.util.multiplyTransformMatrices,u=f.util.degreesToRadians;return t.skewX&&(i=l(i,[1,0,Math.tan(u(t.skewX)),1],!0)),t.skewY&&(i=l(i,[1,Math.tan(u(t.skewY)),0,1],!0)),i},composeMatrix:function(t){var n=[1,0,0,1,t.translateX||0,t.translateY||0],a=f.util.multiplyTransformMatrices;return t.angle&&(n=a(n,f.util.calcRotateMatrix(t))),(t.scaleX!==1||t.scaleY!==1||t.skewX||t.skewY||t.flipX||t.flipY)&&(n=a(n,f.util.calcDimensionsMatrix(t))),n},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,n,a,i){i>0&&(n>i?n-=i:n=0,a>i?a-=i:a=0);var l=!0,u,d,g=t.getImageData(n,a,i*2||1,i*2||1),p=g.data.length;for(u=3;uht[lt]})}}}return Object.freeze(Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"}))}var mt={};const Tt={},wt=Object.freeze(Object.defineProperty({__proto__:null,default:Tt},Symbol.toStringTag,{value:"Module"})),pt=Ct(wt);var yt;function Ot(){return yt||(yt=1,function(Z){var f=f||{version:"5.3.0"};if(Z.fabric=f,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?f.document=document:f.document=document.implementation.createHTMLDocument(""),f.window=window;else{var ft=pt,ht=new ft.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;f.document=ht.document,f.jsdomImplForWrapper=pt.implForWrapper,f.nodeCanvas=pt.Canvas,f.window=ht,DOMParser=f.window.DOMParser}f.isTouchSupported="ontouchstart"in f.window||"ontouchstart"in f.document||f.window&&f.window.navigator&&f.window.navigator.maxTouchPoints>0,f.isLikelyNode=typeof Buffer<"u"&&typeof window>"u",f.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],f.DPI=96,f.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",f.commaWsp="(?:\\s+,?\\s*|,\\s*)",f.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/ig,f.reNonWord=/[ \n\.,;!\?\-]/,f.fontPaths={},f.iMatrix=[1,0,0,1,0,0],f.svgNS="http://www.w3.org/2000/svg",f.perfLimitSizeTotal=2097152,f.maxCacheSideLimit=4096,f.minCacheSideLimit=256,f.charWidthsCache={},f.textureSize=2048,f.disableStyleCopyPaste=!1,f.enableGLFiltering=!0,f.devicePixelRatio=f.window.devicePixelRatio||f.window.webkitDevicePixelRatio||f.window.mozDevicePixelRatio||1,f.browserShadowBlurConstant=1,f.arcToSegmentsCache={},f.boundsOfCurveCache={},f.cachesBoundsOfCurve=!0,f.forceGLPutImageData=!1,f.initFilterBackend=function(){if(f.enableGLFiltering&&f.isWebglSupported&&f.isWebglSupported(f.textureSize))return console.log("max texture size: "+f.maxTextureSize),new f.WebglFilterBackend({tileSize:f.textureSize});if(f.Canvas2dFilterBackend)return new f.Canvas2dFilterBackend},typeof document<"u"&&typeof window<"u"&&(window.fabric=f),function(){function c(t,n){if(this.__eventListeners[t]){var a=this.__eventListeners[t];n?a[a.indexOf(n)]=!1:f.util.array.fill(a,!1)}}function s(t,n){if(this.__eventListeners||(this.__eventListeners={}),arguments.length===1)for(var a in t)this.on(a,t[a]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(n);return this}function h(t,n){var a=function(){n.apply(this,arguments),this.off(t,a)}.bind(this);this.on(t,a)}function o(t,n){if(arguments.length===1)for(var a in t)h.call(this,a,t[a]);else h.call(this,t,n);return this}function e(t,n){if(!this.__eventListeners)return this;if(arguments.length===0)for(t in this.__eventListeners)c.call(this,t);else if(arguments.length===1&&typeof arguments[0]=="object")for(var a in t)c.call(this,a,t[a]);else c.call(this,t,n);return this}function r(t,n){if(!this.__eventListeners)return this;var a=this.__eventListeners[t];if(!a)return this;for(var i=0,l=a.length;i"u"?this._objects.concat():this._objects.filter(function(s){return s.type===c})},item:function(c){return this._objects[c]},isEmpty:function(){return this._objects.length===0},size:function(){return this._objects.length},contains:function(c,s){return this._objects.indexOf(c)>-1?!0:s?this._objects.some(function(h){return typeof h.contains=="function"&&h.contains(c,!0)}):!1},complexity:function(){return this._objects.reduce(function(c,s){return c+=s.complexity?s.complexity():0,c},0)}},f.CommonMethods={_setOptions:function(c){for(var s in c)this.set(s,c[s])},_initGradient:function(c,s){c&&c.colorStops&&!(c instanceof f.Gradient)&&this.set(s,new f.Gradient(c))},_initPattern:function(c,s,h){c&&c.source&&!(c instanceof f.Pattern)?this.set(s,new f.Pattern(c,h)):h&&h()},_setObject:function(c){for(var s in c)this._set(s,c[s])},set:function(c,s){return typeof c=="object"?this._setObject(c):this._set(c,s),this},_set:function(c,s){this[c]=s},toggle:function(c){var s=this.get(c);return typeof s=="boolean"&&this.set(c,!s),this},get:function(c){return this[c]}},function(c){var s=Math.sqrt,h=Math.atan2,o=Math.pow,e=Math.PI/180,r=Math.PI/2;f.util={cos:function(t){if(t===0)return 1;t<0&&(t=-t);var n=t/r;switch(n){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(t===0)return 0;var n=t/r,a=1;switch(t<0&&(a=-1),n){case 1:return a;case 2:return 0;case 3:return-a}return Math.sin(t)},removeFromArray:function(t,n){var a=t.indexOf(n);return a!==-1&&t.splice(a,1),t},getRandomInt:function(t,n){return Math.floor(Math.random()*(n-t+1))+t},degreesToRadians:function(t){return t*e},radiansToDegrees:function(t){return t/e},rotatePoint:function(t,n,a){var i=new f.Point(t.x-n.x,t.y-n.y),l=f.util.rotateVector(i,a);return new f.Point(l.x,l.y).addEquals(n)},rotateVector:function(t,n){var a=f.util.sin(n),i=f.util.cos(n),l=t.x*i-t.y*a,u=t.x*a+t.y*i;return{x:l,y:u}},createVector:function(t,n){return new f.Point(n.x-t.x,n.y-t.y)},calcAngleBetweenVectors:function(t,n){return Math.acos((t.x*n.x+t.y*n.y)/(Math.hypot(t.x,t.y)*Math.hypot(n.x,n.y)))},getHatVector:function(t){return new f.Point(t.x,t.y).multiply(1/Math.hypot(t.x,t.y))},getBisector:function(t,n,a){var i=f.util.createVector(t,n),l=f.util.createVector(t,a),u=f.util.calcAngleBetweenVectors(i,l),d=f.util.calcAngleBetweenVectors(f.util.rotateVector(i,u),l),g=u*(d===0?1:-1)/2;return{vector:f.util.getHatVector(f.util.rotateVector(i,g)),angle:u}},projectStrokeOnPoints:function(t,n,a){var i=[],l=n.strokeWidth/2,u=n.strokeUniform?new f.Point(1/n.scaleX,1/n.scaleY):new f.Point(1,1),d=function(g){var p=l/Math.hypot(g.x,g.y);return new f.Point(g.x*p*u.x,g.y*p*u.y)};return t.length<=1||t.forEach(function(g,p){var v=new f.Point(g.x,g.y),_,T;p===0?(T=t[p+1],_=a?d(f.util.createVector(T,v)).addEquals(v):t[t.length-1]):p===t.length-1?(_=t[p-1],T=a?d(f.util.createVector(_,v)).addEquals(v):t[0]):(_=t[p-1],T=t[p+1]);var A=f.util.getBisector(v,_,T),X=A.vector,W=A.angle,N,V;if(n.strokeLineJoin==="miter"&&(N=-l/Math.sin(W/2),V=new f.Point(X.x*N*u.x,X.y*N*u.y),Math.hypot(V.x,V.y)/l<=n.strokeMiterLimit)){i.push(v.add(V)),i.push(v.subtract(V));return}N=-l*Math.SQRT2,V=new f.Point(X.x*N*u.x,X.y*N*u.y),i.push(v.add(V)),i.push(v.subtract(V))}),i},transformPoint:function(t,n,a){return a?new f.Point(n[0]*t.x+n[2]*t.y,n[1]*t.x+n[3]*t.y):new f.Point(n[0]*t.x+n[2]*t.y+n[4],n[1]*t.x+n[3]*t.y+n[5])},makeBoundingBoxFromPoints:function(t,n){if(n)for(var a=0;a"u"?1:t.scaleX,a=typeof t.scaleY>"u"?1:t.scaleY,i=[t.flipX?-n:n,0,0,t.flipY?-a:a,0,0],l=f.util.multiplyTransformMatrices,u=f.util.degreesToRadians;return t.skewX&&(i=l(i,[1,0,Math.tan(u(t.skewX)),1],!0)),t.skewY&&(i=l(i,[1,Math.tan(u(t.skewY)),0,1],!0)),i},composeMatrix:function(t){var n=[1,0,0,1,t.translateX||0,t.translateY||0],a=f.util.multiplyTransformMatrices;return t.angle&&(n=a(n,f.util.calcRotateMatrix(t))),(t.scaleX!==1||t.scaleY!==1||t.skewX||t.skewY||t.flipX||t.flipY)&&(n=a(n,f.util.calcDimensionsMatrix(t))),n},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,n,a,i){i>0&&(n>i?n-=i:n=0,a>i?a-=i:a=0);var l=!0,u,d,g=t.getImageData(n,a,i*2||1,i*2||1),p=g.data.length;for(u=3;u0){var v=f.util.hasStyleChanged(l,p,!0);v?u.push({start:i,end:i+1,style:p}):u[u.length-1].end++}l=p||{}}}return u},stylesFromArray:function(t,n){if(!Array.isArray(t))return t;for(var a=n.split(` `),i=-1,l=0,u={},d=0;d0?nt-=2*w:x===1&&nt<0&&(nt+=2*w);for(var rt=Math.ceil(Math.abs(nt/w*2)),ot=[],st=nt/rt,ut=8/3*Math.sin(st/4)*Math.sin(st/4)/Math.sin(st/2),dt=it+st,at=0;at=P?x-P:2*Math.PI-(P-x)}function t(m,C,S,b,P,x,y,w){var k;if(f.cachesBoundsOfCurve&&(k=c.call(arguments),f.boundsOfCurveCache[k]))return f.boundsOfCurveCache[k];var M=Math.sqrt,E=Math.min,R=Math.max,Y=Math.abs,z=[],j=[[],[]],O,I,L,D,B,H,tt,Q;I=6*m-12*S+6*P,O=-3*m+9*S-9*P+3*y,L=3*S-3*m;for(var F=0;F<2;++F){if(F>0&&(I=6*C-12*b+6*x,O=-3*C+9*b-9*x+3*w,L=3*b-3*C),Y(O)<1e-12){if(Y(I)<1e-12)continue;D=-L/I,01e-4;)y=P(S),E=S,w=i(x.x,x.y,y.x,y.y),w+b>C?(S-=k,k/=2):(x=y,S+=k,b+=w);return y.angle=M(E),y}function U(m){for(var C=0,S=m.length,b,P=0,x=0,y=0,w=0,k=[],M,E,R,Y=0;Y0&&btt)for(var F=1,$=O.length;F<$;F+=tt)C.push([L].concat(O.slice(F,F+tt))),L=Q;else C.push(O)}return C}function J(m,C){var S=[],b,P=new f.Point(m[0].x,m[0].y),x=new f.Point(m[1].x,m[1].y),y=m.length,w=1,k=0,M=y>2;for(C=C||0,M&&(w=m[2].xm[b-2].x?1:P.x===m[b-2].x?0:-1,k=P.y>m[b-2].y?1:P.y===m[b-2].y?0:-1),S.push(["L",P.x+w*C,P.y+k*C]),S}function K(m,C,S){return S&&(C=f.util.multiplyTransformMatrices(C,[1,0,0,1,-S.x,-S.y])),m.map(function(b){for(var P=b.slice(0),x={},y=1;y=i})}function o(t,n){return r(t,n,function(a,i){return a/g,">")}function o(r){var t=0,n,a=[];for(t=0,n;t57343)return r.charAt(t);if(55296<=n&&n<=56319){if(r.length<=t+1)throw"High surrogate without following low surrogate";var a=r.charCodeAt(t+1);if(56320>a||a>57343)throw"High surrogate without following low surrogate";return r.charAt(t)+r.charAt(t+1)}if(t===0)throw"Low surrogate without preceding high surrogate";var i=r.charCodeAt(t-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1}f.util.string={camelize:c,capitalize:s,escapeXml:h,graphemeSplit:o}}(),function(){var c=Array.prototype.slice,s=function(){},h=function(){for(var n in{toString:1})if(n==="toString")return!1;return!0}(),o=function(n,a,i){for(var l in a)l in n.prototype&&typeof n.prototype[l]=="function"&&(a[l]+"").indexOf("callSuper")>-1?n.prototype[l]=function(u){return function(){var d=this.constructor.superclass;this.constructor.superclass=i;var g=a[u].apply(this,arguments);if(this.constructor.superclass=d,u!=="initialize")return g}}(l):n.prototype[l]=a[l],h&&(a.toString!==Object.prototype.toString&&(n.prototype.toString=a.toString),a.valueOf!==Object.prototype.valueOf&&(n.prototype.valueOf=a.valueOf))};function e(){}function r(n){for(var a=null,i=this;i.constructor.superclass;){var l=i.constructor.superclass.prototype[n];if(i[n]!==l){a=l;break}i=i.constructor.superclass.prototype}return a?arguments.length>1?a.apply(this,c.call(arguments,1)):a.call(this):console.log("tried to callSuper "+n+", method not found in prototype chain",this)}function t(){var n=null,a=c.call(arguments,0);typeof a[0]=="function"&&(n=a.shift());function i(){this.initialize.apply(this,arguments)}i.superclass=n,i.subclasses=[],n&&(e.prototype=n.prototype,i.prototype=new e,n.subclasses.push(i));for(var l=0,u=a.length;l-1||o.pointerType==="touch"}}(),function(){function c(t,n){var a=t.style;if(!a)return t;if(typeof n=="string")return t.style.cssText+=";"+n,n.indexOf("opacity")>-1?r(t,n.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var i in n)if(i==="opacity")r(t,n[i]);else{var l=i==="float"||i==="cssFloat"?typeof a.styleFloat>"u"?"cssFloat":"styleFloat":i;a.setProperty(l,n[i])}return t}var s=f.document.createElement("div"),h=typeof s.style.opacity=="string",o=typeof s.style.filter=="string",e=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,r=function(t){return t};h?r=function(t,n){return t.style.opacity=n,t}:o&&(r=function(t,n){var a=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(a.zoom=1),e.test(a.filter)?(n=n>=.9999?"":"alpha(opacity="+n*100+")",a.filter=a.filter.replace(e,n)):a.filter+=" alpha(opacity="+n*100+")",t}),f.util.setStyle=c}(),function(){var c=Array.prototype.slice;function s(g){return typeof g=="string"?f.document.getElementById(g):g}var h,o=function(g){return c.call(g,0)};try{h=o(f.document.childNodes)instanceof Array}catch{}h||(o=function(g){for(var p=new Array(g.length),v=g.length;v--;)p[v]=g[v];return p});function e(g,p){var v=f.document.createElement(g);for(var _ in p)_==="class"?v.className=p[_]:_==="for"?v.htmlFor=p[_]:v.setAttribute(_,p[_]);return v}function r(g,p){g&&(" "+g.className+" ").indexOf(" "+p+" ")===-1&&(g.className+=(g.className?" ":"")+p)}function t(g,p,v){return typeof p=="string"&&(p=e(p,v)),g.parentNode&&g.parentNode.replaceChild(p,g),p.appendChild(g),p}function n(g){for(var p=0,v=0,_=f.document.documentElement,T=f.document.body||{scrollLeft:0,scrollTop:0};g&&(g.parentNode||g.host)&&(g=g.parentNode||g.host,g===f.document?(p=T.scrollLeft||_.scrollLeft||0,v=T.scrollTop||_.scrollTop||0):(p+=g.scrollLeft||0,v+=g.scrollTop||0),!(g.nodeType===1&&g.style.position==="fixed")););return{left:p,top:v}}function a(g){var p,v=g&&g.ownerDocument,_={left:0,top:0},T={left:0,top:0},A,X={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!v)return T;for(var W in X)T[X[W]]+=parseInt(i(g,W),10)||0;return p=v.documentElement,typeof g.getBoundingClientRect<"u"&&(_=g.getBoundingClientRect()),A=n(g),{left:_.left+A.left-(p.clientLeft||0)+T.left,top:_.top+A.top-(p.clientTop||0)+T.top}}var i;f.document.defaultView&&f.document.defaultView.getComputedStyle?i=function(g,p){var v=f.document.defaultView.getComputedStyle(g,null);return v?v[p]:void 0}:i=function(g,p){var v=g.style[p];return!v&&g.currentStyle&&(v=g.currentStyle[p]),v},function(){var g=f.document.documentElement.style,p="userSelect"in g?"userSelect":"MozUserSelect"in g?"MozUserSelect":"WebkitUserSelect"in g?"WebkitUserSelect":"KhtmlUserSelect"in g?"KhtmlUserSelect":"";function v(T){return typeof T.onselectstart<"u"&&(T.onselectstart=f.util.falseFunction),p?T.style[p]="none":typeof T.unselectable=="string"&&(T.unselectable="on"),T}function _(T){return typeof T.onselectstart<"u"&&(T.onselectstart=null),p?T.style[p]="":typeof T.unselectable=="string"&&(T.unselectable=""),T}f.util.makeElementUnselectable=v,f.util.makeElementSelectable=_}();function l(g){var p=f.jsdomImplForWrapper(g);return p._canvas||p._image}function u(g){if(f.isLikelyNode){var p=f.jsdomImplForWrapper(g);p&&(p._image=null,p._canvas=null,p._currentSrc=null,p._attributes=null,p._classList=null)}}function d(g,p){g.imageSmoothingEnabled=g.imageSmoothingEnabled||g.webkitImageSmoothingEnabled||g.mozImageSmoothingEnabled||g.msImageSmoothingEnabled||g.oImageSmoothingEnabled,g.imageSmoothingEnabled=p}f.util.setImageSmoothing=d,f.util.getById=s,f.util.toArray=o,f.util.addClass=r,f.util.makeElement=e,f.util.wrapElement=t,f.util.getScrollLeftTop=n,f.util.getElementOffset=a,f.util.getNodeCanvas=l,f.util.cleanUpJsdomNode=u}(),function(){function c(o,e){return o+(/\?/.test(o)?"&":"?")+e}function s(){}function h(o,e){e||(e={});var r=e.method?e.method.toUpperCase():"GET",t=e.onComplete||function(){},n=new f.window.XMLHttpRequest,a=e.body||e.parameters;return n.onreadystatechange=function(){n.readyState===4&&(t(n),n.onreadystatechange=s)},r==="GET"&&(a=null,typeof e.parameters=="string"&&(o=c(o,e.parameters))),n.open(r,o,!0),(r==="POST"||r==="PUT")&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),n.send(a),n}f.util.request=h}(),f.log=console.log,f.warn=console.warn,function(){var c=f.util.object.extend,s=f.util.object.clone,h=[];f.util.object.extend(h,{cancelAll:function(){var l=this.splice(0);return l.forEach(function(u){u.cancel()}),l},cancelByCanvas:function(l){if(!l)return[];var u=this.filter(function(d){return typeof d.target=="object"&&d.target.canvas===l});return u.forEach(function(d){d.cancel()}),u},cancelByTarget:function(l){var u=this.findAnimationsByTarget(l);return u.forEach(function(d){d.cancel()}),u},findAnimationIndex:function(l){return this.indexOf(this.findAnimation(l))},findAnimation:function(l){return this.find(function(u){return u.cancel===l})},findAnimationsByTarget:function(l){return l?this.filter(function(u){return u.target===l}):[]}});function o(){return!1}function e(l,u,d,g){return-d*Math.cos(l/g*(Math.PI/2))+d+u}function r(l){l||(l={});var u=!1,d,g=function(){var p=f.runningAnimations.indexOf(d);return p>-1&&f.runningAnimations.splice(p,1)[0]};return d=c(s(l),{cancel:function(){return u=!0,g()},currentValue:"startValue"in l?l.startValue:0,completionRate:0,durationRate:0}),f.runningAnimations.push(d),a(function(p){var v=p||+new Date,_=l.duration||500,T=v+_,A,X=l.onChange||o,W=l.abort||o,N=l.onComplete||o,V=l.easing||e,U="startValue"in l?l.startValue.length>0:!1,G="startValue"in l?l.startValue:0,q="endValue"in l?l.endValue:100,J=l.byValue||(U?G.map(function(K,m){return q[m]-G[m]}):q-G);l.onStart&&l.onStart(),function K(m){A=m||+new Date;var C=A>T?_:A-v,S=C/_,b=U?G.map(function(x,y){return V(C,G[y],J[y],_)}):V(C,G,J,_),P=Math.abs(U?(b[0]-G[0])/J[0]:(b-G)/J);if(d.currentValue=U?b.slice():b,d.completionRate=P,d.durationRate=S,!u){if(W(b,P,S)){g();return}if(A>T){d.currentValue=U?q.slice():q,d.completionRate=1,d.durationRate=1,X(U?q.slice():q,1,1),N(q,1,1),g();return}else X(b,P,S),a(K)}}(v)}),d.cancel}var t=f.window.requestAnimationFrame||f.window.webkitRequestAnimationFrame||f.window.mozRequestAnimationFrame||f.window.oRequestAnimationFrame||f.window.msRequestAnimationFrame||function(l){return f.window.setTimeout(l,1e3/60)},n=f.window.cancelAnimationFrame||f.window.clearTimeout;function a(){return t.apply(f.window,arguments)}function i(){return n.apply(f.window,arguments)}f.util.animate=r,f.util.requestAnimFrame=a,f.util.cancelAnimFrame=i,f.runningAnimations=h}(),function(){function c(h,o,e){var r="rgba("+parseInt(h[0]+e*(o[0]-h[0]),10)+","+parseInt(h[1]+e*(o[1]-h[1]),10)+","+parseInt(h[2]+e*(o[2]-h[2]),10);return r+=","+(h&&o?parseFloat(h[3]+e*(o[3]-h[3])):1),r+=")",r}function s(h,o,e,r){var t=new f.Color(h).getSource(),n=new f.Color(o).getSource(),a=r.onComplete,i=r.onChange;return r=r||{},f.util.animate(f.util.object.extend(r,{duration:e||500,startValue:t,endValue:n,byValue:n,easing:function(l,u,d,g){var p=r.colorEasing?r.colorEasing(l,g):1-Math.cos(l/g*(Math.PI/2));return c(u,d,p)},onComplete:function(l,u,d){if(a)return a(c(n,n,0),u,d)},onChange:function(l,u,d){if(i){if(Array.isArray(l))return i(c(l,l,0),u,d);i(l,u,d)}}}))}f.util.animateColor=s}(),function(){function c(m,C,S,b){return m-1&&Y>-1&&Y-1)&&(y="stroke")}else{if(x==="href"||x==="xlink:href"||x==="font")return y;if(x==="imageSmoothing")return y==="optimizeQuality";E=M?y.map(r):r(y,k)}}return!M&&isNaN(E)?y:E}function T(x){return new RegExp("^("+x.join("|")+")\\b","i")}function A(x){for(var y in d)if(!(typeof x[d[y]]>"u"||x[y]==="")){if(typeof x[y]>"u"){if(!s.Object.prototype[y])continue;x[y]=s.Object.prototype[y]}if(x[y].indexOf("url(")!==0){var w=new s.Color(x[y]);x[y]=w.setAlpha(e(w.getAlpha()*x[d[y]],2)).toRgba()}}return x}function X(x,y){var w,k=[],M,E,R;for(E=0,R=y.length;E1;)et.shift(),it=s.util.multiplyTransformMatrices(it,et[0]);return it}}();function W(x,y){var w,k;x.replace(/;\s*$/,"").split(";").forEach(function(M){var E=M.split(":");w=E[0].trim().toLowerCase(),k=E[1].trim(),y[w]=k})}function N(x,y){var w,k;for(var M in x)typeof x[M]>"u"||(w=M.toLowerCase(),k=x[M],y[w]=k)}function V(x,y){var w={};for(var k in s.cssRules[y])if(U(x,k.split(" ")))for(var M in s.cssRules[y][k])w[M]=s.cssRules[y][k][M];return w}function U(x,y){var w,k=!0;return w=q(x,y.pop()),w&&y.length&&(k=G(x,y)),w&&k&&y.length===0}function G(x,y){for(var w,k=!0;x.parentNode&&x.parentNode.nodeType===1&&y.length;)k&&(w=y.pop()),x=x.parentNode,k=q(x,w);return y.length===0}function q(x,y){var w=x.nodeName,k=x.getAttribute("class"),M=x.getAttribute("id"),E,R;if(E=new RegExp("^"+w,"i"),y=y.replace(E,""),M&&y.length&&(E=new RegExp("#"+M+"(?![a-zA-Z\\-]+)","i"),y=y.replace(E,"")),k&&y.length)for(k=k.split(" "),R=k.length;R--;)E=new RegExp("\\."+k[R]+"(?![a-zA-Z\\-]+)","i"),y=y.replace(E,"");return y.length===0}function J(x,y){var w;if(x.getElementById&&(w=x.getElementById(y)),w)return w;var k,M,E,R=x.getElementsByTagName("*");for(M=0,E=R.length;Mk?k:w),B.meetOrSlice==="slice"&&(k=w=w>k?w:k),et=F.width-R*w,it=F.height-Y*w,B.alignX==="Mid"&&(et/=2),B.alignY==="Mid"&&(it/=2),B.alignX==="Min"&&(et=0),B.alignY==="Min"&&(it=0)),w===1&&k===1&&M===0&&E===0&&L===0&&D===0)return F;if((L||D)&&x.parentNode.nodeName!=="#document"&&($=" translate("+r(L)+" "+r(D)+") "),z=$+" matrix("+w+" 0 0 "+k+" "+(M*w+et)+" "+(E*k+it)+") ",x.nodeName==="svg"){for(j=x.ownerDocument.createElementNS(s.svgNS,"g");x.firstChild;)j.appendChild(x.firstChild);x.appendChild(j)}else j=x,j.removeAttribute("x"),j.removeAttribute("y"),z=j.getAttribute("transform")+z;return j.setAttribute("transform",z),F}function S(x,y){for(;x&&(x=x.parentNode);)if(x.nodeName&&y.test(x.nodeName.replace("svg:",""))&&!x.getAttribute("instantiated_by_use"))return!0;return!1}s.parseSVGDocument=function(x,y,w,k){if(x){K(x);var M=s.Object.__uid++,E,R,Y=C(x),z=s.util.toArray(x.getElementsByTagName("*"));if(Y.crossOrigin=k&&k.crossOrigin,Y.svgUid=M,z.length===0&&s.isLikelyNode){z=x.selectNodes('//*[name(.)!="svg"]');var j=[];for(E=0,R=z.length;E"u"&&(w=x.getAttribute("svgUid")),x.parentNode&&s.svgValidParentsRegEx.test(x.parentNode.nodeName)&&(M=s.parseAttributes(x.parentNode,y,w));var Y=y.reduce(function(B,H){return k=x.getAttribute(H),k&&(B[H]=k),B},{}),z=h(V(x,w),s.parseStyleAttribute(x));Y=h(Y,z),z[p]&&x.setAttribute(p,z[p]),E=R=M.fontSize||s.Text.DEFAULT_SVG_FONT_SIZE,Y[g]&&(Y[g]=E=r(Y[g],R));var j,O,I={};for(var L in Y)j=v(L),O=_(j,Y[L],M,E),I[j]=O;I&&I.font&&s.parseFontDeclaration(I.font,I);var D=h(M,I);return s.svgValidParentsRegEx.test(x.nodeName)?D:A(D)}},parseElements:function(x,y,w,k,M){new s.ElementsParser(x,y,w,k,M).parse()},parseStyleAttribute:function(x){var y={},w=x.getAttribute("style");return w&&(typeof w=="string"?W(w,y):N(w,y)),y},parsePointsAttribute:function(x){if(!x)return null;x=x.replace(/,/g," ").trim(),x=x.split(/\s+/);var y=[],w,k;for(w=0,k=x.length;wo.x&&this.y>o.y},gte:function(o){return this.x>=o.x&&this.y>=o.y},lerp:function(o,e){return typeof e>"u"&&(e=.5),e=Math.max(Math.min(1,e),0),new h(this.x+(o.x-this.x)*e,this.y+(o.y-this.y)*e)},distanceFrom:function(o){var e=this.x-o.x,r=this.y-o.y;return Math.sqrt(e*e+r*r)},midPointFrom:function(o){return this.lerp(o)},min:function(o){return new h(Math.min(this.x,o.x),Math.min(this.y,o.y))},max:function(o){return new h(Math.max(this.x,o.x),Math.max(this.y,o.y))},toString:function(){return this.x+","+this.y},setXY:function(o,e){return this.x=o,this.y=e,this},setX:function(o){return this.x=o,this},setY:function(o){return this.y=o,this},setFromPoint:function(o){return this.x=o.x,this.y=o.y,this},swap:function(o){var e=this.x,r=this.y;this.x=o.x,this.y=o.y,o.x=e,o.y=r},clone:function(){return new h(this.x,this.y)}}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Intersection){s.warn("fabric.Intersection is already defined");return}function h(o){this.status=o,this.points=[]}s.Intersection=h,s.Intersection.prototype={constructor:h,appendPoint:function(o){return this.points.push(o),this},appendPoints:function(o){return this.points=this.points.concat(o),this}},s.Intersection.intersectLineLine=function(o,e,r,t){var n,a=(t.x-r.x)*(o.y-r.y)-(t.y-r.y)*(o.x-r.x),i=(e.x-o.x)*(o.y-r.y)-(e.y-o.y)*(o.x-r.x),l=(t.y-r.y)*(e.x-o.x)-(t.x-r.x)*(e.y-o.y);if(l!==0){var u=a/l,d=i/l;0<=u&&u<=1&&0<=d&&d<=1?(n=new h("Intersection"),n.appendPoint(new s.Point(o.x+u*(e.x-o.x),o.y+u*(e.y-o.y)))):n=new h}else a===0||i===0?n=new h("Coincident"):n=new h("Parallel");return n},s.Intersection.intersectLinePolygon=function(o,e,r){var t=new h,n=r.length,a,i,l,u;for(u=0;u0&&(t.status="Intersection"),t},s.Intersection.intersectPolygonPolygon=function(o,e){var r=new h,t=o.length,n;for(n=0;n0&&(r.status="Intersection"),r},s.Intersection.intersectPolygonRectangle=function(o,e,r){var t=e.min(r),n=e.max(r),a=new s.Point(n.x,t.y),i=new s.Point(t.x,n.y),l=h.intersectLinePolygon(t,a,o),u=h.intersectLinePolygon(a,n,o),d=h.intersectLinePolygon(n,i,o),g=h.intersectLinePolygon(i,t,o),p=new h;return p.appendPoints(l.points),p.appendPoints(u.points),p.appendPoints(d.points),p.appendPoints(g.points),p.points.length>0&&(p.status="Intersection"),p}}(Z),function(c){var s=c.fabric||(c.fabric={});if(s.Color){s.warn("fabric.Color is already defined.");return}function h(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}s.Color=h,s.Color.prototype={_tryParsingColor:function(e){var r;e in h.colorNameMap&&(e=h.colorNameMap[e]),e==="transparent"&&(r=[255,255,255,0]),r||(r=h.sourceFromHex(e)),r||(r=h.sourceFromRgb(e)),r||(r=h.sourceFromHsl(e)),r||(r=[0,0,0,1]),r&&this.setSource(r)},_rgbToHsl:function(e,r,t){e/=255,r/=255,t/=255;var n,a,i,l=s.util.array.max([e,r,t]),u=s.util.array.min([e,r,t]);if(i=(l+u)/2,l===u)n=a=0;else{var d=l-u;switch(a=i>.5?d/(2-l-u):d/(l+u),l){case e:n=(r-t)/d+(r1&&(t-=1),t<1/6?e+(r-e)*6*t:t<1/2?r:t<2/3?e+(r-e)*(2/3-t)*6:e}s.Color.fromRgb=function(e){return h.fromSource(h.sourceFromRgb(e))},s.Color.sourceFromRgb=function(e){var r=e.match(h.reRGBa);if(r){var t=parseInt(r[1],10)/(/%$/.test(r[1])?100:1)*(/%$/.test(r[1])?255:1),n=parseInt(r[2],10)/(/%$/.test(r[2])?100:1)*(/%$/.test(r[2])?255:1),a=parseInt(r[3],10)/(/%$/.test(r[3])?100:1)*(/%$/.test(r[3])?255:1);return[parseInt(t,10),parseInt(n,10),parseInt(a,10),r[4]?parseFloat(r[4]):1]}},s.Color.fromRgba=h.fromRgb,s.Color.fromHsl=function(e){return h.fromSource(h.sourceFromHsl(e))},s.Color.sourceFromHsl=function(e){var r=e.match(h.reHSLa);if(r){var t=(parseFloat(r[1])%360+360)%360/360,n=parseFloat(r[2])/(/%$/.test(r[2])?100:1),a=parseFloat(r[3])/(/%$/.test(r[3])?100:1),i,l,u;if(n===0)i=l=u=a;else{var d=a<=.5?a*(n+1):a+n-a*n,g=a*2-d;i=o(g,d,t+1/3),l=o(g,d,t),u=o(g,d,t-1/3)}return[Math.round(i*255),Math.round(l*255),Math.round(u*255),r[4]?parseFloat(r[4]):1]}},s.Color.fromHsla=h.fromHsl,s.Color.fromHex=function(e){return h.fromSource(h.sourceFromHex(e))},s.Color.sourceFromHex=function(e){if(e.match(h.reHex)){var r=e.slice(e.indexOf("#")+1),t=r.length===3||r.length===4,n=r.length===8||r.length===4,a=t?r.charAt(0)+r.charAt(0):r.substring(0,2),i=t?r.charAt(1)+r.charAt(1):r.substring(2,4),l=t?r.charAt(2)+r.charAt(2):r.substring(4,6),u=n?t?r.charAt(3)+r.charAt(3):r.substring(6,8):"FF";return[parseInt(a,16),parseInt(i,16),parseInt(l,16),parseFloat((parseInt(u,16)/255).toFixed(2))]}},s.Color.fromSource=function(e){var r=new h;return r.setSource(e),r}}(Z),function(c){var s=c.fabric||(c.fabric={}),h=["e","se","s","sw","w","nw","n","ne","e"],o=["ns","nesw","ew","nwse"],e={},r="left",t="top",n="right",a="bottom",i="center",l={top:a,bottom:t,left:n,right:r,center:i},u=s.util.radiansToDegrees,d=Math.sign||function(j){return(j>0)-(j<0)||+j};function g(j,O){var I=j.angle+u(Math.atan2(O.y,O.x))+360;return Math.round(I%360/45)}function p(j,O){var I=O.transform.target,L=I.canvas,D=s.util.object.clone(O);D.target=I,L&&L.fire("object:"+j,D),I.fire(j,O)}function v(j,O){var I=O.canvas,L=I.uniScaleKey,D=j[L];return I.uniformScaling&&!D||!I.uniformScaling&&D}function _(j){return j.originX===i&&j.originY===i}function T(j,O,I){var L=j.lockScalingX,D=j.lockScalingY;return!!(L&&D||!O&&(L||D)&&I||L&&O==="x"||D&&O==="y")}function A(j,O,I){var L="not-allowed",D=v(j,I),B="";if(O.x!==0&&O.y===0?B="x":O.x===0&&O.y!==0&&(B="y"),T(I,B,D))return L;var H=g(I,O);return h[H]+"-resize"}function X(j,O,I){var L="not-allowed";if(O.x!==0&&I.lockSkewingY||O.y!==0&&I.lockSkewingX)return L;var D=g(I,O)%4;return o[D]+"-resize"}function W(j,O,I){return j[I.canvas.altActionKey]?e.skewCursorStyleHandler(j,O,I):e.scaleCursorStyleHandler(j,O,I)}function N(j,O,I){var L=j[I.canvas.altActionKey];if(O.x===0)return L?"skewX":"scaleY";if(O.y===0)return L?"skewY":"scaleX"}function V(j,O,I){return I.lockRotation?"not-allowed":O.cursorStyle}function U(j,O,I,L){return{e:j,transform:O,pointer:{x:I,y:L}}}function G(j){return function(O,I,L,D){var B=I.target,H=B.getCenterPoint(),tt=B.translateToOriginPoint(H,I.originX,I.originY),Q=j(O,I,L,D);return B.setPositionByOrigin(tt,I.originX,I.originY),Q}}function q(j,O){return function(I,L,D,B){var H=O(I,L,D,B);return H&&p(j,U(I,L,D,B)),H}}function J(j,O,I,L,D){var B=j.target,H=B.controls[j.corner],tt=B.canvas.getZoom(),Q=B.padding/tt,F=B.toLocalPoint(new s.Point(L,D),O,I);return F.x>=Q&&(F.x-=Q),F.x<=-Q&&(F.x+=Q),F.y>=Q&&(F.y-=Q),F.y<=Q&&(F.y+=Q),F.x-=H.offsetX,F.y-=H.offsetY,F}function K(j){return j.flipX!==j.flipY}function m(j,O,I,L,D){if(j[O]!==0){var B=j._getTransformedDimensions()[L],H=D/B*j[I];j.set(I,H)}}function C(j,O,I,L){var D=O.target,B=D._getTransformedDimensions(0,D.skewY),H=J(O,O.originX,O.originY,I,L),tt=Math.abs(H.x*2)-B.x,Q=D.skewX,F;tt<2?F=0:(F=u(Math.atan2(tt/D.scaleX,B.y/D.scaleY)),O.originX===r&&O.originY===a&&(F=-F),O.originX===n&&O.originY===t&&(F=-F),K(D)&&(F=-F));var $=Q!==F;if($){var et=D._getTransformedDimensions().y;D.set("skewX",F),m(D,"skewY","scaleY","y",et)}return $}function S(j,O,I,L){var D=O.target,B=D._getTransformedDimensions(D.skewX,0),H=J(O,O.originX,O.originY,I,L),tt=Math.abs(H.y*2)-B.y,Q=D.skewY,F;tt<2?F=0:(F=u(Math.atan2(tt/D.scaleY,B.x/D.scaleX)),O.originX===r&&O.originY===a&&(F=-F),O.originX===n&&O.originY===t&&(F=-F),K(D)&&(F=-F));var $=Q!==F;if($){var et=D._getTransformedDimensions().x;D.set("skewY",F),m(D,"skewX","scaleX","x",et)}return $}function b(j,O,I,L){var D=O.target,B=D.skewX,H,tt=O.originY;if(D.lockSkewingX)return!1;if(B===0){var Q=J(O,i,i,I,L);Q.x>0?H=r:H=n}else B>0&&(H=tt===t?r:n),B<0&&(H=tt===t?n:r),K(D)&&(H=H===r?n:r);O.originX=H;var F=q("skewing",G(C));return F(j,O,I,L)}function P(j,O,I,L){var D=O.target,B=D.skewY,H,tt=O.originX;if(D.lockSkewingY)return!1;if(B===0){var Q=J(O,i,i,I,L);Q.y>0?H=t:H=a}else B>0&&(H=tt===r?t:a),B<0&&(H=tt===r?a:t),K(D)&&(H=H===t?a:t);O.originY=H;var F=q("skewing",G(S));return F(j,O,I,L)}function x(j,O,I,L){var D=O,B=D.target,H=B.translateToOriginPoint(B.getCenterPoint(),D.originX,D.originY);if(B.lockRotation)return!1;var tt=Math.atan2(D.ey-H.y,D.ex-H.x),Q=Math.atan2(L-H.y,I-H.x),F=u(Q-tt+D.theta),$=!0;if(B.snapAngle>0){var et=B.snapAngle,it=B.snapThreshold||et,nt=Math.ceil(F/et)*et,rt=Math.floor(F/et)*et;Math.abs(F-rt)d?(A=u,t.scale(1,d/u),T=a*u/d):d>u?(A=d,t.scale(u/d,1),_=n*d/u):A=u,t.lineWidth=1,t.beginPath(),t.arc(_,T,A/2,0,2*Math.PI,!1),t[p](),v&&t.stroke(),t.restore()}function r(t,n,a,i,l){i=i||{};var u=this.sizeX||i.cornerSize||l.cornerSize,d=this.sizeY||i.cornerSize||l.cornerSize,g=typeof i.transparentCorners<"u"?i.transparentCorners:l.transparentCorners,p=g?"stroke":"fill",v=!g&&(i.cornerStrokeColor||l.cornerStrokeColor),_=u/2,T=d/2;t.save(),t.fillStyle=i.cornerColor||l.cornerColor,t.strokeStyle=i.cornerStrokeColor||l.cornerStrokeColor,t.lineWidth=1,t.translate(n,a),t.rotate(h(l.angle)),t[p+"Rect"](-_,-T,u,d),v&&t.strokeRect(-_,-T,u,d),t.restore()}o.renderCircleControl=e,o.renderSquareControl=r}(Z),function(c){var s=c.fabric||(c.fabric={});function h(o){for(var e in o)this[e]=o[e]}s.Control=h,s.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(o,e){return e.cursorStyle},getActionName:function(o,e){return e.actionName},getVisibility:function(o,e){var r=o._controlsVisibility;return r&&typeof r[e]<"u"?r[e]:this.visible},setVisibility:function(o){this.visible=o},positionHandler:function(o,e){var r=s.util.transformPoint({x:this.x*o.x+this.offsetX,y:this.y*o.y+this.offsetY},e);return r},calcCornerCoords:function(o,e,r,t,n){var a,i,l,u,d=n?this.touchSizeX:this.sizeX,g=n?this.touchSizeY:this.sizeY;if(d&&g&&d!==g){var p=Math.atan2(g,d),v=Math.sqrt(d*d+g*g)/2,_=p-s.util.degreesToRadians(o),T=Math.PI/2-p-s.util.degreesToRadians(o);a=v*s.util.cos(_),i=v*s.util.sin(_),l=v*s.util.cos(T),u=v*s.util.sin(T)}else{var A=d&&g?d:e;v=A*.7071067812;var _=s.util.degreesToRadians(45-o);a=l=v*s.util.cos(_),i=u=v*s.util.sin(_)}return{tl:{x:r-u,y:t-l},tr:{x:r+a,y:t-i},bl:{x:r-a,y:t+i},br:{x:r+u,y:t+l}}},render:function(o,e,r,t,n){switch(t=t||{},t.cornerStyle||n.cornerStyle){case"circle":s.controlsUtils.renderCircleControl.call(this,o,e,r,t,n);break;default:s.controlsUtils.renderSquareControl.call(this,o,e,r,t,n)}}}}(Z),function(){function c(r,t){var n=r.getAttribute("style"),a=r.getAttribute("offset")||0,i,l,u,d;if(a=parseFloat(a)/(/%$/.test(a)?100:1),a=a<0?0:a>1?1:a,n){var g=n.split(/\s*;\s*/);for(g[g.length-1]===""&&g.pop(),d=g.length;d--;){var p=g[d].split(/\s*:\s*/),v=p[0].trim(),_=p[1].trim();v==="stop-color"?i=_:v==="stop-opacity"&&(u=_)}}return i||(i=r.getAttribute("stop-color")||"rgb(0,0,0)"),u||(u=r.getAttribute("stop-opacity")),i=new f.Color(i),l=i.getAlpha(),u=isNaN(parseFloat(u))?1:parseFloat(u),u*=l*t,{offset:a,color:i.toRgb(),opacity:u}}function s(r){return{x1:r.getAttribute("x1")||0,y1:r.getAttribute("y1")||0,x2:r.getAttribute("x2")||"100%",y2:r.getAttribute("y2")||0}}function h(r){return{x1:r.getAttribute("fx")||r.getAttribute("cx")||"50%",y1:r.getAttribute("fy")||r.getAttribute("cy")||"50%",r1:0,x2:r.getAttribute("cx")||"50%",y2:r.getAttribute("cy")||"50%",r2:r.getAttribute("r")||"50%"}}var o=f.util.object.clone;f.Gradient=f.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(r){r||(r={}),r.coords||(r.coords={});var t,n=this;Object.keys(r).forEach(function(a){n[a]=r[a]}),this.id?this.id+="_"+f.Object.__uid++:this.id=f.Object.__uid++,t={x1:r.coords.x1||0,y1:r.coords.y1||0,x2:r.coords.x2||0,y2:r.coords.y2||0},this.type==="radial"&&(t.r1=r.coords.r1||0,t.r2=r.coords.r2||0),this.coords=t,this.colorStops=r.colorStops.slice()},addColorStop:function(r){for(var t in r){var n=new f.Color(r[t]);this.colorStops.push({offset:parseFloat(t),color:n.toRgb(),opacity:n.getAlpha()})}return this},toObject:function(r){var t={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return f.util.populateWithProperties(this,t,r),t},toSVG:function(r,l){var n=o(this.coords,!0),a,i,l=l||{},u,d,g=o(this.colorStops,!0),p=n.r1>n.r2,v=this.gradientTransform?this.gradientTransform.concat():f.iMatrix.concat(),_=-this.offsetX,T=-this.offsetY,A=!!l.additionalTransform,X=this.gradientUnits==="pixels"?"userSpaceOnUse":"objectBoundingBox";if(g.sort(function(G,q){return G.offset-q.offset}),X==="objectBoundingBox"?(_/=r.width,T/=r.height):(_+=r.width/2,T+=r.height/2),r.type==="path"&&this.gradientUnits!=="percentage"&&(_-=r.pathOffset.x,T-=r.pathOffset.y),v[4]-=_,v[5]-=T,d='id="SVGID_'+this.id+'" gradientUnits="'+X+'"',d+=' gradientTransform="'+(A?l.additionalTransform+" ":"")+f.util.matrixToSVG(v)+'" ',this.type==="linear"?u=[" `]:this.type==="radial"&&(u=[" diff --git a/custom-toc-highlight/assets/featureConversionUtils-D6hFQ4Af-C2GV38KQ.js b/custom-toc-highlight/assets/featureConversionUtils-D6hFQ4Af-qxGGE-I8.js similarity index 99% rename from custom-toc-highlight/assets/featureConversionUtils-D6hFQ4Af-C2GV38KQ.js rename to custom-toc-highlight/assets/featureConversionUtils-D6hFQ4Af-qxGGE-I8.js index 2e2b72bb..557dba4c 100644 --- a/custom-toc-highlight/assets/featureConversionUtils-D6hFQ4Af-C2GV38KQ.js +++ b/custom-toc-highlight/assets/featureConversionUtils-D6hFQ4Af-qxGGE-I8.js @@ -1 +1 @@ -import{c9 as en,ca as on,cb as tn,cc as sn,o as Z,a1 as un,cd as cn,ce as ln,cf as an,O as fn}from"./story-BfX8CRfG.js";import{c as T,i as F}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{t as hn}from"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";function p(n,r){return n?r?4:3:r?3:2}const $=()=>un.getLogger("esri.layers.graphics.featureConversionUtils"),H={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0},dn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t},O=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2]},mn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+3]},gn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2],n[e+3]=r[o+3]};function q(n,r,e,o){if(n){if(e)return r&&o?gn:O;if(r&&o)return mn}else if(r&&o)return O;return dn}function j({scale:n,translate:r},e){return Math.round((e-r[0])/n[0])}function z({scale:n,translate:r},e){return Math.round((r[1]-e)/n[1])}function L({scale:n,translate:r},e,o){return e*n[o]+r[o]}function En(n,r,e){return n?r?e?Y(n):E(n):e?U(n):k(n):null}function k(n){const r=n.coords;return{x:r[0],y:r[1]}}function W(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n}function E(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2]}}function yn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n}function U(n){const r=n.coords;return{x:r[0],y:r[1],m:r[2]}}function pn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.m,n}function Y(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2],m:r[3]}}function bn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n.coords[3]=r.m,n}function wn(n,r,e,o){let s=k;e&&o?s=Y:e?s=E:o&&(s=U);for(const t of r){const{geometry:u,attributes:c}=t,i=u!=null?s(u):null;n.push({attributes:c,geometry:i})}return n}function R(n,r){return n&&r?bn:n?yn:r?pn:W}function Mn(n,r,e,o,s){const t=R(e,o);for(const{geometry:u,attributes:c}of r){const i=u!=null?t(new T,u):null;n.push(new F(i,c,null,s?c[s]:void 0))}return n}function In(n,r,e=R(r.z!=null,r.m!=null)){return e(n,r)}function Gn(n,r,e,o){for(const{geometry:s,attributes:t}of r)n.push({attributes:t,geometry:s!=null?X(s,e,o):null});return n}function X(n,r,e){if(n==null)return null;const o=p(r,e),s=[];for(let t=0;t=i&&(n.lengths.push(v),I=g)}return G(n.coords,I),n.coords.length?n:null}function Cn(n,r,e,o,s,t,u=e,c=o){if(N(n),!r?.coords.length)return null;const i=H[s],{coords:l,lengths:a}=r,f=p(e,o),h=p(e&&u,o&&c),d=q(e,o,u,c);if(!a.length)return d(n.coords,l,0,0,l[0],l[1]),N(n,f,0),n;let m=0;const y=t*t;for(const w of a){if(w=i?n.lengths.push(I):G(n.coords,M*h),m+=w*f}return n.coords.length?n:null}function kn(n,r,e,o){const s=n[r],t=n[r+1],u=n[e],c=n[e+1],i=n[o],l=n[o+1];let a=u,f=c,h=i-a,d=l-f;if(h!==0||d!==0){const m=((s-a)*h+(t-f)*d)/(h*h+d*d);m>1?(a=i,f=l):m>0&&(a+=h*m,f+=d*m)}return h=s-a,d=t-f,h*h+d*d}function _(n,r,e,o,s,t,u){let c,i=o,l=0;for(let a=t+e;ai&&(l=a,i=c);i>o&&(l-t>e&&_(n,r,e,o,s,t,l),s(n,r,n.length,l,r[l],r[l+1]),u-l>e&&_(n,r,e,o,s,l,u))}function Hn(n,r,e,o){if(!r?.coords?.length)return null;const s=p(e,o);let t=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(r&&r.coords){const l=r.coords;for(let a=0;aun.getLogger("esri.layers.graphics.featureConversionUtils"),H={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryMultiPatch:3,esriGeometryEnvelope:0},dn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t},O=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2]},mn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+3]},gn=(n,r,e,o,s,t)=>{n[e]=s,n[e+1]=t,n[e+2]=r[o+2],n[e+3]=r[o+3]};function q(n,r,e,o){if(n){if(e)return r&&o?gn:O;if(r&&o)return mn}else if(r&&o)return O;return dn}function j({scale:n,translate:r},e){return Math.round((e-r[0])/n[0])}function z({scale:n,translate:r},e){return Math.round((r[1]-e)/n[1])}function L({scale:n,translate:r},e,o){return e*n[o]+r[o]}function En(n,r,e){return n?r?e?Y(n):E(n):e?U(n):k(n):null}function k(n){const r=n.coords;return{x:r[0],y:r[1]}}function W(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n}function E(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2]}}function yn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n}function U(n){const r=n.coords;return{x:r[0],y:r[1],m:r[2]}}function pn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.m,n}function Y(n){const r=n.coords;return{x:r[0],y:r[1],z:r[2],m:r[3]}}function bn(n,r){return n.coords[0]=r.x,n.coords[1]=r.y,n.coords[2]=r.z,n.coords[3]=r.m,n}function wn(n,r,e,o){let s=k;e&&o?s=Y:e?s=E:o&&(s=U);for(const t of r){const{geometry:u,attributes:c}=t,i=u!=null?s(u):null;n.push({attributes:c,geometry:i})}return n}function R(n,r){return n&&r?bn:n?yn:r?pn:W}function Mn(n,r,e,o,s){const t=R(e,o);for(const{geometry:u,attributes:c}of r){const i=u!=null?t(new T,u):null;n.push(new F(i,c,null,s?c[s]:void 0))}return n}function In(n,r,e=R(r.z!=null,r.m!=null)){return e(n,r)}function Gn(n,r,e,o){for(const{geometry:s,attributes:t}of r)n.push({attributes:t,geometry:s!=null?X(s,e,o):null});return n}function X(n,r,e){if(n==null)return null;const o=p(r,e),s=[];for(let t=0;t=i&&(n.lengths.push(v),I=g)}return G(n.coords,I),n.coords.length?n:null}function Cn(n,r,e,o,s,t,u=e,c=o){if(N(n),!r?.coords.length)return null;const i=H[s],{coords:l,lengths:a}=r,f=p(e,o),h=p(e&&u,o&&c),d=q(e,o,u,c);if(!a.length)return d(n.coords,l,0,0,l[0],l[1]),N(n,f,0),n;let m=0;const y=t*t;for(const w of a){if(w=i?n.lengths.push(I):G(n.coords,M*h),m+=w*f}return n.coords.length?n:null}function kn(n,r,e,o){const s=n[r],t=n[r+1],u=n[e],c=n[e+1],i=n[o],l=n[o+1];let a=u,f=c,h=i-a,d=l-f;if(h!==0||d!==0){const m=((s-a)*h+(t-f)*d)/(h*h+d*d);m>1?(a=i,f=l):m>0&&(a+=h*m,f+=d*m)}return h=s-a,d=t-f,h*h+d*d}function _(n,r,e,o,s,t,u){let c,i=o,l=0;for(let a=t+e;ai&&(l=a,i=c);i>o&&(l-t>e&&_(n,r,e,o,s,t,l),s(n,r,n.length,l,r[l],r[l+1]),u-l>e&&_(n,r,e,o,s,l,u))}function Hn(n,r,e,o){if(!r?.coords?.length)return null;const s=p(e,o);let t=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,i=Number.NEGATIVE_INFINITY;if(r&&r.coords){const l=r.coords;for(let a=0;an.layer.layerId)),a}function j(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function C(e){e.layers||=[],e.tables||=[]}function q(e,t){const a=[],r=[];for(const{layer:s}of t){const{isTable:o,layerId:n}=s;o?r.push(n):a.push(n)}d(e.layers,a),d(e.tables,r)}function d(e,t){if(e.length<2)return;const a=[];for(const{id:r}of e)a.push(r);w(a.sort(p),t.slice().sort(p))&&e.sort((r,s)=>{const o=t.indexOf(r.id),n=t.indexOf(s.id);return on?1:0})}function p(e,t){return et?1:0}async function B(e,t,a){const{url:r,customParameters:s,apiKey:o}=t,{serviceJSON:n,layersJSON:i}=await x(r,{customParameters:s,apiKey:o}),c=E(e.layers,n.layers,a),u=E(e.tables,n.tables,a);e.layers=c.itemResources,e.tables=u.itemResources;const y=[...c.added,...u.added],S=i?[...i.layers,...i.tables]:[];await U(e,y,r,S)}function E(e,t,a){const r=$(e,t,(o,n)=>o.id===n.id);e=e.filter(o=>!r.removed.some(n=>n.id===o.id));const s=r.added;return s.forEach(({id:o})=>{e.push({id:o})}),{itemResources:e,added:s.filter(({id:o})=>!a.includes(o))}}async function U(e,t,a,r){const s=await V(t),o=t.map(({id:n,type:i})=>new(s.get(i))({url:a,layerId:n,sourceJSON:r.find(({id:c})=>c===n)}));await Promise.allSettled(o.map(n=>n.load())),o.forEach(n=>{const{layerId:i,loaded:c,defaultPopupTemplate:u}=n;if(!c||u==null)return;const y={id:i,popupInfo:u.toJSON()};n.operationalLayerType!=="ArcGISFeatureLayer"&&(y.layerType=n.operationalLayerType),v(n,y,e)})}async function V(e){const t=[];e.forEach(({type:s})=>{const o=g(s),n=D[o];t.push(n())});const a=await Promise.all(t),r=new Map;return e.forEach(({type:s},o)=>{r.set(s,a[o])}),r}function v(e,t,a){e.isTable?I(a.tables,t):I(a.layers,t)}function I(e,t){const a=e.findIndex(({id:r})=>r===t.id);a===-1?e.push(t):e[a]=t}function Z(e,t){const a=e.layers.some(r=>r.layerType==="OrientedImageryLayer");f(t,l.ORIENTED_IMAGERY_LAYER,a)}function k(e,t){const a=e.some(r=>r.type==="oriented-imagery");f(t,l.ORIENTED_IMAGERY_LAYER,a)}async function z(e,t,a){Z(a,t)}async function H(e,t){const{url:a,layerId:r,title:s,fullExtent:o,isTable:n}=e,i=R(a);t.url=(i?.serverType==="FeatureServer"?a:`${a}/${r}`)??null,t.title||=s,t.extent=null,n||o==null||(t.extent=await J(o)),m(t,l.METADATA),m(t,l.MULTI_LAYER),M(t,l.SINGLE_LAYER),f(t,l.TABLE,n),k([e],t)}async function ue(e,t){return N({layer:e,itemType:T,validateLayer:h,createItemData:(a,r)=>F(r,[a]),errorNamePrefix:Y,setItemProperties:z},t)}async function ye(e,t,a){return O({layer:e,itemType:T,validateLayer:h,createItemData:(r,s)=>Promise.resolve(L(r)),errorNamePrefix:_,newItem:t,setItemProperties:H},a)}export{ue as save,ye as saveAs}; +import{jc as P,hq as w,ao as $}from"./story-Doly9N9p.js";import{C as N,D as O}from"./utils-BVWK2jiA-i-Dn2Ad8.js";import{i as R}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{d as x,p as D,g}from"./fetchService-DbaKmJhP-Ccg-phWf.js";import{S as J,l as m,u as M,L as f,E as l}from"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./main-QGPoLsvl.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./jsonContext-BA8GHqVk-BsXRY5es.js";import"./saveUtils-CIYk-dsQ-Br9QCJTX.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";const T="Feature Service",A="feature-layer-utils",Y=`${A}-save`,_=`${A}-save-as`;function h(e){return{isValid:P(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function b(e){const t=[],a=[];for(const{layer:r,layerJSON:s}of e)r.isTable?a.push(s):t.push(s);return{layers:t,tables:a}}function L(e){return b([e])}async function F(e,t){return/\/\d+\/?$/.test(e.url)?L(t[0]):G(t,e)}async function G(e,t){if(e.reverse(),!t)return b(e);const a=await K(t,e);for(const r of e)v(r.layer,r.layerJSON,a);return q(a,e),a}async function K(e,t){let a=await e.fetchData("json");if(j(a))return a;a||={},C(a);const{layer:{url:r,customParameters:s,apiKey:o}}=t[0];return await B(a,{url:r??"",customParameters:s,apiKey:o},t.map(n=>n.layer.layerId)),a}function j(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function C(e){e.layers||=[],e.tables||=[]}function q(e,t){const a=[],r=[];for(const{layer:s}of t){const{isTable:o,layerId:n}=s;o?r.push(n):a.push(n)}d(e.layers,a),d(e.tables,r)}function d(e,t){if(e.length<2)return;const a=[];for(const{id:r}of e)a.push(r);w(a.sort(p),t.slice().sort(p))&&e.sort((r,s)=>{const o=t.indexOf(r.id),n=t.indexOf(s.id);return on?1:0})}function p(e,t){return et?1:0}async function B(e,t,a){const{url:r,customParameters:s,apiKey:o}=t,{serviceJSON:n,layersJSON:i}=await x(r,{customParameters:s,apiKey:o}),c=E(e.layers,n.layers,a),u=E(e.tables,n.tables,a);e.layers=c.itemResources,e.tables=u.itemResources;const y=[...c.added,...u.added],S=i?[...i.layers,...i.tables]:[];await U(e,y,r,S)}function E(e,t,a){const r=$(e,t,(o,n)=>o.id===n.id);e=e.filter(o=>!r.removed.some(n=>n.id===o.id));const s=r.added;return s.forEach(({id:o})=>{e.push({id:o})}),{itemResources:e,added:s.filter(({id:o})=>!a.includes(o))}}async function U(e,t,a,r){const s=await V(t),o=t.map(({id:n,type:i})=>new(s.get(i))({url:a,layerId:n,sourceJSON:r.find(({id:c})=>c===n)}));await Promise.allSettled(o.map(n=>n.load())),o.forEach(n=>{const{layerId:i,loaded:c,defaultPopupTemplate:u}=n;if(!c||u==null)return;const y={id:i,popupInfo:u.toJSON()};n.operationalLayerType!=="ArcGISFeatureLayer"&&(y.layerType=n.operationalLayerType),v(n,y,e)})}async function V(e){const t=[];e.forEach(({type:s})=>{const o=g(s),n=D[o];t.push(n())});const a=await Promise.all(t),r=new Map;return e.forEach(({type:s},o)=>{r.set(s,a[o])}),r}function v(e,t,a){e.isTable?I(a.tables,t):I(a.layers,t)}function I(e,t){const a=e.findIndex(({id:r})=>r===t.id);a===-1?e.push(t):e[a]=t}function Z(e,t){const a=e.layers.some(r=>r.layerType==="OrientedImageryLayer");f(t,l.ORIENTED_IMAGERY_LAYER,a)}function k(e,t){const a=e.some(r=>r.type==="oriented-imagery");f(t,l.ORIENTED_IMAGERY_LAYER,a)}async function z(e,t,a){Z(a,t)}async function H(e,t){const{url:a,layerId:r,title:s,fullExtent:o,isTable:n}=e,i=R(a);t.url=(i?.serverType==="FeatureServer"?a:`${a}/${r}`)??null,t.title||=s,t.extent=null,n||o==null||(t.extent=await J(o)),m(t,l.METADATA),m(t,l.MULTI_LAYER),M(t,l.SINGLE_LAYER),f(t,l.TABLE,n),k([e],t)}async function ue(e,t){return N({layer:e,itemType:T,validateLayer:h,createItemData:(a,r)=>F(r,[a]),errorNamePrefix:Y,setItemProperties:z},t)}async function ye(e,t,a){return O({layer:e,itemType:T,validateLayer:h,createItemData:(r,s)=>Promise.resolve(L(r)),errorNamePrefix:_,newItem:t,setItemProperties:H},a)}export{ue as save,ye as saveAs}; diff --git a/custom-toc-highlight/assets/featureLayerUtils-DgfQQyK4-Ba-CbhYv.js b/custom-toc-highlight/assets/featureLayerUtils-DgfQQyK4-Cfw8eI8B.js similarity index 91% rename from custom-toc-highlight/assets/featureLayerUtils-DgfQQyK4-Ba-CbhYv.js rename to custom-toc-highlight/assets/featureLayerUtils-DgfQQyK4-Cfw8eI8B.js index 65aa7ccb..ddeafa80 100644 --- a/custom-toc-highlight/assets/featureLayerUtils-DgfQQyK4-Ba-CbhYv.js +++ b/custom-toc-highlight/assets/featureLayerUtils-DgfQQyK4-Cfw8eI8B.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-BcQn3A1C.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-9sQxfkoa-KicvrT8N.js","./utils-Bq23Xwmj--_SaacS5.js","./EditBusLayer-Df29OyJh-DkVkxUAl.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); -import{_ as g}from"./main-ugzBrWNm.js";import{aK as A,o as s,e9 as v,ea as P,eb as j,ct as L,dO as E,ec as R,V as m,cP as C}from"./story-BfX8CRfG.js";import{s as S}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{p as I,a as F}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{b as f}from"./Query-BrwMGK8U-DoFNfkjX.js";import{p as _}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{d as M}from"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{c as T,d as x}from"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";async function V(t,e,r){e=e.clone(),t.capabilities.query.supportsMaxRecordCountFactor&&(e.maxRecordCountFactor=q(t));const n=D(t),a=t.capabilities.query.supportsPagination;e.start=0,e.num=n;let o=null;for(;;){const i=await t.source.queryFeaturesJSON(e,r);if(o==null?o=i:o.features=o.features.concat(i.features),o.exceededTransferLimit=i.exceededTransferLimit,!a||!i.exceededTransferLimit)break;e.start+=n}return o}function D(t){return q(t)*G(t)}function G(t){return t.capabilities.query.maxRecordCount||2e3}function q(t){return t.capabilities.query.supportsMaxRecordCountFactor?f.MAX_MAX_RECORD_COUNT_FACTOR:1}const W=new A({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function Y(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.addAttachment)throw new s(n,"Layer source does not support addAttachment capability");return a.addAttachment(e,r)}function w(t,e,r){const{attributes:n}=e,{objectIdField:a}=t;return t.capabilities?.data?.supportsAttachment?e?n?a&&n[a]?Promise.resolve():Promise.reject(new s(r,`feature is missing the identifying attribute ${a}`)):Promise.reject(new s(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new s(r,"A feature is required to add/delete/update attachments")):Promise.reject(new s(r,"this layer doesn't support attachments"))}async function tt(t,e,r,n,a){const o=await d(t);if(await w(t,e,a),!o.updateAttachment)throw new s(a,"Layer source does not support updateAttachment capability");return o.updateAttachment(e,r,n)}async function et(t,e,r){const{applyEdits:n}=await g(()=>import("./editingSupport-gUqP9iyf-BcQn3A1C.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),a=await t.load();let o=r;return a.type==="feature"&&a.infoFor3D&&e.deleteFeatures!=null&&a.globalIdField!=null&&(o={...o,globalIdToObjectId:await $(a,e.deleteFeatures,a.globalIdField)}),n(a,a.source,e,r)}async function nt(t,e,r){const{uploadAssets:n}=await g(()=>import("./editingSupport-gUqP9iyf-BcQn3A1C.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),a=await t.load();return n(a,a.source,e,r)}async function rt(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.deleteAttachments)throw new s(n,"Layer source does not support deleteAttachments capability");return a.deleteAttachments(e,r)}async function at(t,e,r){const n=(await t.load({signal:e?.signal})).source;if(!n.fetchRecomputedExtents)throw new s(r,"Layer source does not support fetchUpdates capability");return n.fetchRecomputedExtents(e)}async function ot(t,e,r,n){e=T.from(e),await t.load();const a=t.source,o=t.capabilities;if(!o?.data?.supportsAttachment)throw new s(n,"this layer doesn't support attachments");const{attachmentTypes:i,objectIds:l,globalIds:y,num:u,size:c,start:p,where:b}=e;if(!o?.operations?.supportsQueryAttachments&&(i?.length>0||y?.length>0||c?.length>0||u||p||b))throw new s(n,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(l?.length||y?.length||b))throw new s(n,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!a.queryAttachments)throw new s(n,"Layer source does not support queryAttachments capability",e);return a.queryAttachments(e)}async function st(t,e,r,n){const a=await d(t);if(!a.queryObjectIds)throw new s(n,"Layer source does not support queryObjectIds capability");return a.queryObjectIds(f.from(e)??t.createQuery(),r)}async function it(t,e,r,n){const a=await d(t);if(!a.queryFeatureCount)throw new s(n,"Layer source does not support queryFeatureCount capability");return a.queryFeatureCount(f.from(e)??t.createQuery(),r)}async function ut(t,e,r,n){const a=await d(t);if(!a.queryExtent)throw new s(n,"Layer source does not support queryExtent capability");return a.queryExtent(f.from(e)??t.createQuery(),r)}async function ct(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeatures)throw new s(n,"Layer source does not support queryRelatedFeatures capability");return a.queryRelatedFeatures(x.from(e),r)}async function lt(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeaturesCount)throw new s(n,"Layer source does not support queryRelatedFeaturesCount capability");return a.queryRelatedFeaturesCount(x.from(e),r)}async function pt(t){const e=t.source;if(e?.refresh)try{const{dataChanged:r,updates:n}=await e.refresh();if(n!=null&&(t.sourceJSON={...t.sourceJSON,...n},t.read(n,{origin:"service",url:t.parsedUrl})),r)return!0}catch{}if(t.definitionExpression)try{return(await v(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function dt(t){const e=new f,r=t.capabilities?.data,n=t.capabilities?.query;e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,n&&(e.compactGeometryEnabled=n.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&t.returnZ!=null&&(e.returnZ=t.returnZ),r.supportsM&&t.returnM!=null&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:a,timeExtent:o}=t;return e.timeExtent=a!=null&&o!=null?o.offset(-a.value,a.unit):o||null,e.multipatchOption=t.geometryType==="multipatch"?"xyFootprint":null,e}function ft(t){const{globalIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeGlobalID")return n.name}}function yt(t){const{objectIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeOID")return n.name}}function mt(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}function ht(t,e){const{subtypes:r,subtypeField:n}=t;if(!e?.attributes||!r?.length||!n)return null;const a=e.attributes[n];return a==null?null:r.find(o=>o.code===a)}function wt(t,e){const{fieldsIndex:r,subtypeField:n}=t,{name:a,type:o}=r.get(e)??{};if(!a)return null;if((n&&r.get(n)?.name)===a&&t.subtypes?.length){const i=t.subtypes.map(l=>new I({code:O(l.code,o),name:l.name}));if(i?.length)return new F({codedValues:i})}return null}function bt(t,e){const{fieldsIndex:r}=t,{name:n,type:a}=r.get(e)??{};if(!n)return null;if(("typeIdField"in t?r.get(t.typeIdField)?.name:null)===n&&"types"in t&&t.types?.length){const o=t.types.map(i=>new I({code:O(i.id,a),name:i.name}));return new F({codedValues:o})}return null}function O(t,e){return e?P({type:e})&&typeof t=="number"?`${t}`:j({type:e})&&typeof t=="string"?Number.parseInt(t,10):t:t}async function d(t){return(await t.load()).source}async function N(t,e){if(!m||m.findCredential(t))return;let r;try{const n=await C(t,e);n&&(r=await m.checkSignInStatus(`${n}/sharing`))}catch{}if(r)try{const n=e!=null?e.signal:null;await m.getCredential(t,{signal:n})}catch{}}async function gt(t,e,r){const n=t.parsedUrl?.path;n&&t.authenticationTriggerEvent===e&&await N(n,r)}function It(t){return!Q(t)&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}const h=L({types:E});function Ft(t,e){if(t.defaultSymbol)return t.types?.length?new M({defaultSymbol:h(t.defaultSymbol,t,e),field:t.typeIdField,uniqueValueInfos:t.types.map(r=>({id:r.id,symbol:h(r.symbol,r,e)}))}):new _({symbol:h(t.defaultSymbol,t,e)})}function xt(t){let e=t.sourceJSON?.cacheMaxAge;if(!e)return!1;const r=t.editingInfo?.lastEditDate?.getTime();return r==null||(e*=1e3,Date.now()-r{let c=null;if("attributes"in u){const{attributes:p}=u;c={globalId:p[r],objectId:p[a]!=null&&p[a]!==-1?p[a]:null}}else c={globalId:u.globalId,objectId:u.objectId!=null&&u.objectId!==-1?u.objectId:null};c.globalId!=null&&(c.objectId!=null&&c.objectId!==-1||n.push(c.globalId))}),n.length===0)return null;const o=t.createQuery();o.where=n.map(u=>`${r}='${u}'`).join(" OR "),o.returnGeometry=!1,o.outFields=[a,r],o.cacheHint=!1;const i=await R(V(t,o));if(!i.ok)return null;const l=new Map,y=i.value.features;for(const u of y){const c=u.attributes[r],p=u.attributes[a];c!=null&&p!=null&&p!==-1&&l.set(S(c),p)}return l}function qt(t,e,r){if(!e||!r||!t)return null;const n=r.getAttribute(e);return n==null?null:t.find(a=>{const{id:o}=a;return o!=null&&o.toString()===n.toString()})??null}function Q(t){return t.sourceJSON?.isMultiServicesView||J(t)}function J(t){return!!t.sourceJSON?.capabilities?.toLowerCase().split(",").map(e=>e.trim()).includes("map")}function Ot(t,e,r){const n=e?.queryBins;if(!n)throw new s(r,"Layer source does not support binning");switch(t.binParameters.type){case"auto-interval":if(!n.supportsAutoInterval)throw new s(r,"Layer source does not support auto-interval binning");break;case"date":if(!n.supportsDate)throw new s(r,"Layer source does not support date binning");break;case"fixed-boundaries":if(!n.supportsFixedBoundaries)throw new s(r,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!n.supportsFixedInterval)throw new s(r,"Layer source does not support fixed-interval binning")}const a=n?.supportedStatistics;if(t.outStatistics&&a){const o=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:i}of t.outStatistics){const l=o.get(i);if(l&&!a[l])throw new s(r,`Layer source does not support ${i} statistic type`)}}}export{tt as $,$ as A,ot as B,st as H,it as K,Q as O,Y as Q,et as U,ct as W,ut as X,lt as Y,nt as Z,rt as _,mt as a,gt as c,xt as d,pt as e,qt as f,bt as i,W as k,It as l,Ot as m,ft as n,ht as o,Ft as p,yt as r,wt as s,dt as t,at as z}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editingSupport-gUqP9iyf-C_ld1skV.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./uuid-Dj9mdEVg-BaKSCiyT.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./EditBusLayer-Df29OyJh-OmdJOLws.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js"])))=>i.map(i=>d[i]); +import{_ as g}from"./main-QGPoLsvl.js";import{aK as A,o as s,e9 as v,ea as P,eb as j,ct as L,dO as E,ec as R,V as m,cP as C}from"./story-Doly9N9p.js";import{s as S}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{p as I,a as F}from"./Field-C6hA1tZj-CkWoRbmp.js";import{b as f}from"./Query-BrwMGK8U-BPr0_G9t.js";import{p as _}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{d as M}from"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{c as T,d as x}from"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";async function V(t,e,r){e=e.clone(),t.capabilities.query.supportsMaxRecordCountFactor&&(e.maxRecordCountFactor=q(t));const n=D(t),a=t.capabilities.query.supportsPagination;e.start=0,e.num=n;let o=null;for(;;){const i=await t.source.queryFeaturesJSON(e,r);if(o==null?o=i:o.features=o.features.concat(i.features),o.exceededTransferLimit=i.exceededTransferLimit,!a||!i.exceededTransferLimit)break;e.start+=n}return o}function D(t){return q(t)*G(t)}function G(t){return t.capabilities.query.maxRecordCount||2e3}function q(t){return t.capabilities.query.supportsMaxRecordCountFactor?f.MAX_MAX_RECORD_COUNT_FACTOR:1}const W=new A({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function Y(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.addAttachment)throw new s(n,"Layer source does not support addAttachment capability");return a.addAttachment(e,r)}function w(t,e,r){const{attributes:n}=e,{objectIdField:a}=t;return t.capabilities?.data?.supportsAttachment?e?n?a&&n[a]?Promise.resolve():Promise.reject(new s(r,`feature is missing the identifying attribute ${a}`)):Promise.reject(new s(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new s(r,"A feature is required to add/delete/update attachments")):Promise.reject(new s(r,"this layer doesn't support attachments"))}async function tt(t,e,r,n,a){const o=await d(t);if(await w(t,e,a),!o.updateAttachment)throw new s(a,"Layer source does not support updateAttachment capability");return o.updateAttachment(e,r,n)}async function et(t,e,r){const{applyEdits:n}=await g(()=>import("./editingSupport-gUqP9iyf-C_ld1skV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),a=await t.load();let o=r;return a.type==="feature"&&a.infoFor3D&&e.deleteFeatures!=null&&a.globalIdField!=null&&(o={...o,globalIdToObjectId:await $(a,e.deleteFeatures,a.globalIdField)}),n(a,a.source,e,r)}async function nt(t,e,r){const{uploadAssets:n}=await g(()=>import("./editingSupport-gUqP9iyf-C_ld1skV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),a=await t.load();return n(a,a.source,e,r)}async function rt(t,e,r,n){const a=await d(t);if(await w(t,e,n),!a.deleteAttachments)throw new s(n,"Layer source does not support deleteAttachments capability");return a.deleteAttachments(e,r)}async function at(t,e,r){const n=(await t.load({signal:e?.signal})).source;if(!n.fetchRecomputedExtents)throw new s(r,"Layer source does not support fetchUpdates capability");return n.fetchRecomputedExtents(e)}async function ot(t,e,r,n){e=T.from(e),await t.load();const a=t.source,o=t.capabilities;if(!o?.data?.supportsAttachment)throw new s(n,"this layer doesn't support attachments");const{attachmentTypes:i,objectIds:l,globalIds:y,num:u,size:c,start:p,where:b}=e;if(!o?.operations?.supportsQueryAttachments&&(i?.length>0||y?.length>0||c?.length>0||u||p||b))throw new s(n,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e);if(!(l?.length||y?.length||b))throw new s(n,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!a.queryAttachments)throw new s(n,"Layer source does not support queryAttachments capability",e);return a.queryAttachments(e)}async function st(t,e,r,n){const a=await d(t);if(!a.queryObjectIds)throw new s(n,"Layer source does not support queryObjectIds capability");return a.queryObjectIds(f.from(e)??t.createQuery(),r)}async function it(t,e,r,n){const a=await d(t);if(!a.queryFeatureCount)throw new s(n,"Layer source does not support queryFeatureCount capability");return a.queryFeatureCount(f.from(e)??t.createQuery(),r)}async function ut(t,e,r,n){const a=await d(t);if(!a.queryExtent)throw new s(n,"Layer source does not support queryExtent capability");return a.queryExtent(f.from(e)??t.createQuery(),r)}async function ct(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeatures)throw new s(n,"Layer source does not support queryRelatedFeatures capability");return a.queryRelatedFeatures(x.from(e),r)}async function lt(t,e,r,n){const a=await d(t);if(!a.queryRelatedFeaturesCount)throw new s(n,"Layer source does not support queryRelatedFeaturesCount capability");return a.queryRelatedFeaturesCount(x.from(e),r)}async function pt(t){const e=t.source;if(e?.refresh)try{const{dataChanged:r,updates:n}=await e.refresh();if(n!=null&&(t.sourceJSON={...t.sourceJSON,...n},t.read(n,{origin:"service",url:t.parsedUrl})),r)return!0}catch{}if(t.definitionExpression)try{return(await v(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function dt(t){const e=new f,r=t.capabilities?.data,n=t.capabilities?.query;e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,n&&(e.compactGeometryEnabled=n.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&t.returnZ!=null&&(e.returnZ=t.returnZ),r.supportsM&&t.returnM!=null&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:a,timeExtent:o}=t;return e.timeExtent=a!=null&&o!=null?o.offset(-a.value,a.unit):o||null,e.multipatchOption=t.geometryType==="multipatch"?"xyFootprint":null,e}function ft(t){const{globalIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeGlobalID")return n.name}}function yt(t){const{objectIdField:e,fields:r}=t;if(e)return e;if(r){for(const n of r)if(n.type==="esriFieldTypeOID")return n.name}}function mt(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}function ht(t,e){const{subtypes:r,subtypeField:n}=t;if(!e?.attributes||!r?.length||!n)return null;const a=e.attributes[n];return a==null?null:r.find(o=>o.code===a)}function wt(t,e){const{fieldsIndex:r,subtypeField:n}=t,{name:a,type:o}=r.get(e)??{};if(!a)return null;if((n&&r.get(n)?.name)===a&&t.subtypes?.length){const i=t.subtypes.map(l=>new I({code:O(l.code,o),name:l.name}));if(i?.length)return new F({codedValues:i})}return null}function bt(t,e){const{fieldsIndex:r}=t,{name:n,type:a}=r.get(e)??{};if(!n)return null;if(("typeIdField"in t?r.get(t.typeIdField)?.name:null)===n&&"types"in t&&t.types?.length){const o=t.types.map(i=>new I({code:O(i.id,a),name:i.name}));return new F({codedValues:o})}return null}function O(t,e){return e?P({type:e})&&typeof t=="number"?`${t}`:j({type:e})&&typeof t=="string"?Number.parseInt(t,10):t:t}async function d(t){return(await t.load()).source}async function N(t,e){if(!m||m.findCredential(t))return;let r;try{const n=await C(t,e);n&&(r=await m.checkSignInStatus(`${n}/sharing`))}catch{}if(r)try{const n=e!=null?e.signal:null;await m.getCredential(t,{signal:n})}catch{}}async function gt(t,e,r){const n=t.parsedUrl?.path;n&&t.authenticationTriggerEvent===e&&await N(n,r)}function It(t){return!Q(t)&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}const h=L({types:E});function Ft(t,e){if(t.defaultSymbol)return t.types?.length?new M({defaultSymbol:h(t.defaultSymbol,t,e),field:t.typeIdField,uniqueValueInfos:t.types.map(r=>({id:r.id,symbol:h(r.symbol,r,e)}))}):new _({symbol:h(t.defaultSymbol,t,e)})}function xt(t){let e=t.sourceJSON?.cacheMaxAge;if(!e)return!1;const r=t.editingInfo?.lastEditDate?.getTime();return r==null||(e*=1e3,Date.now()-r{let c=null;if("attributes"in u){const{attributes:p}=u;c={globalId:p[r],objectId:p[a]!=null&&p[a]!==-1?p[a]:null}}else c={globalId:u.globalId,objectId:u.objectId!=null&&u.objectId!==-1?u.objectId:null};c.globalId!=null&&(c.objectId!=null&&c.objectId!==-1||n.push(c.globalId))}),n.length===0)return null;const o=t.createQuery();o.where=n.map(u=>`${r}='${u}'`).join(" OR "),o.returnGeometry=!1,o.outFields=[a,r],o.cacheHint=!1;const i=await R(V(t,o));if(!i.ok)return null;const l=new Map,y=i.value.features;for(const u of y){const c=u.attributes[r],p=u.attributes[a];c!=null&&p!=null&&p!==-1&&l.set(S(c),p)}return l}function qt(t,e,r){if(!e||!r||!t)return null;const n=r.getAttribute(e);return n==null?null:t.find(a=>{const{id:o}=a;return o!=null&&o.toString()===n.toString()})??null}function Q(t){return t.sourceJSON?.isMultiServicesView||J(t)}function J(t){return!!t.sourceJSON?.capabilities?.toLowerCase().split(",").map(e=>e.trim()).includes("map")}function Ot(t,e,r){const n=e?.queryBins;if(!n)throw new s(r,"Layer source does not support binning");switch(t.binParameters.type){case"auto-interval":if(!n.supportsAutoInterval)throw new s(r,"Layer source does not support auto-interval binning");break;case"date":if(!n.supportsDate)throw new s(r,"Layer source does not support date binning");break;case"fixed-boundaries":if(!n.supportsFixedBoundaries)throw new s(r,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!n.supportsFixedInterval)throw new s(r,"Layer source does not support fixed-interval binning")}const a=n?.supportedStatistics;if(t.outStatistics&&a){const o=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:i}of t.outStatistics){const l=o.get(i);if(l&&!a[l])throw new s(r,`Layer source does not support ${i} statistic type`)}}}export{tt as $,$ as A,ot as B,st as H,it as K,Q as O,Y as Q,et as U,ct as W,ut as X,lt as Y,nt as Z,rt as _,mt as a,gt as c,xt as d,pt as e,qt as f,bt as i,W as k,It as l,Ot as m,ft as n,ht as o,Ft as p,yt as r,wt as s,dt as t,at as z}; diff --git a/custom-toc-highlight/assets/featureReferenceUtils-Ct4KY5u7-cLRdtKlb.js b/custom-toc-highlight/assets/featureReferenceUtils-Ct4KY5u7-DuNl8LtH.js similarity index 75% rename from custom-toc-highlight/assets/featureReferenceUtils-Ct4KY5u7-cLRdtKlb.js rename to custom-toc-highlight/assets/featureReferenceUtils-Ct4KY5u7-DuNl8LtH.js index 4dd9d01c..5b78e3e3 100644 --- a/custom-toc-highlight/assets/featureReferenceUtils-Ct4KY5u7-cLRdtKlb.js +++ b/custom-toc-highlight/assets/featureReferenceUtils-Ct4KY5u7-DuNl8LtH.js @@ -1 +1 @@ -import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./story-BfX8CRfG.js";import{d as n}from"./sphere-BenPORjV-DaZ5Vv8x.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./boundedPlane-DlvE0eNx-dpkNyaGh.js";function y(t,l){return e(t)===e(l)}function e(t){if(t==null)return null;const l=t.layer!=null?t.layer.id:"";let r=null;return r=t.objectId!=null?t.objectId:t.layer!=null&&"objectIdField"in t.layer&&t.layer.objectIdField!=null&&t.attributes!=null?t.attributes[t.layer.objectIdField]:t.uid,r==null?null:`o-${l}-${r}`}const j={json:{write:{writer:u,target:{"feature.layerId":{type:[Number,String]},"feature.objectId":{type:[Number,String]}}},origins:{"web-scene":{read:i}}}};function u(t,l){t?.layer?.objectIdField!=null&&t.attributes!=null&&(l.feature={layerId:t.layer.id,objectId:t.attributes[t.layer.objectIdField]})}function i(t){if(t.layerId!=null&&t.objectId!=null)return{uid:null,layer:{id:t.layerId,objectIdField:"ObjectId"},attributes:{ObjectId:t.objectId}}}n();export{y as n,j as u}; +import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./story-Doly9N9p.js";import{d as n}from"./sphere-BenPORjV-B4uz1SYF.js";import"./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./boundedPlane-DlvE0eNx-BQ9Xop25.js";function y(t,l){return e(t)===e(l)}function e(t){if(t==null)return null;const l=t.layer!=null?t.layer.id:"";let r=null;return r=t.objectId!=null?t.objectId:t.layer!=null&&"objectIdField"in t.layer&&t.layer.objectIdField!=null&&t.attributes!=null?t.attributes[t.layer.objectIdField]:t.uid,r==null?null:`o-${l}-${r}`}const j={json:{write:{writer:u,target:{"feature.layerId":{type:[Number,String]},"feature.objectId":{type:[Number,String]}}},origins:{"web-scene":{read:i}}}};function u(t,l){t?.layer?.objectIdField!=null&&t.attributes!=null&&(l.feature={layerId:t.layer.id,objectId:t.attributes[t.layer.objectIdField]})}function i(t){if(t.layerId!=null&&t.objectId!=null)return{uid:null,layer:{id:t.layerId,objectIdField:"ObjectId"},attributes:{ObjectId:t.objectId}}}n();export{y as n,j as u}; diff --git a/custom-toc-highlight/assets/featureSetUtils-wd4FcF3A-33TmIeRJ.js b/custom-toc-highlight/assets/featureSetUtils-wd4FcF3A-Bjqg1VXd.js similarity index 95% rename from custom-toc-highlight/assets/featureSetUtils-wd4FcF3A-33TmIeRJ.js rename to custom-toc-highlight/assets/featureSetUtils-wd4FcF3A-Bjqg1VXd.js index 5326d550..ff10a829 100644 --- a/custom-toc-highlight/assets/featureSetUtils-wd4FcF3A-33TmIeRJ.js +++ b/custom-toc-highlight/assets/featureSetUtils-wd4FcF3A-Bjqg1VXd.js @@ -1 +1 @@ -import{J as te,t as Ne,O as Le,bi as E,bV as P,d as Ae,bM as Pe,f as j,g as Oe,V as le,aB as oe}from"./story-BfX8CRfG.js";import{ae as U,r as Ee,af as je}from"./languageUtils-BYxF9hRA-BBstOXAc.js";import{p as x,b as y,v as O,y as I,f as b,D as M,U as T,W as Ge,J as qe,z as Be,G as J,M as ue,R as de,O as he,t as Ue,a as Ie,I as Me,A as g,e as W,V as We,x as Qe,c as Ve}from"./SpatialFilter-BlQBFhwz-BhB6yT4Z.js";import{L as ie,y as S,I as Ze,a as R,D as ce,N as pe,w as fe,P as ye,x as _e,B as re,d as $e,R as be,U as Je,j as ge}from"./shared-D1w-26bA-B8KlJvO_.js";import{Z as C,n as v,a as k,r as Ke,u as ze}from"./WhereClause-DxwoyBMS-DnXKVpm2.js";import{I as He,O as Xe,m as Ye}from"./TimeOnly-DSMefxKy-BU7RNYWc.js";import{k as Ce,g as Te}from"./MD5-CHHr-oed-SuyrCYQ0.js";import{y as G}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{o as et}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{N as tt,h as it}from"./arcadeUtils-DpP0k7IY-BXaTThTL.js";import N from"./FeatureLayer-BrRKw5Si-D6Z5CL70.js";import{c as rt,d as me}from"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import{b as z,m as we}from"./Query-BrwMGK8U-DoFNfkjX.js";import{y as st}from"./FeatureType-C9hJmS6_-BXWT6QCe.js";import{D as H}from"./Layer-ChoECxvZ-CQTFmFQa.js";import at from"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./main-ugzBrWNm.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./number-eRKYXfX9-eI8aiR_7.js";import"./geometryEngineAsync-D7oEu5dd-B6AE24vD.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./jsonUtils-C64Zfu7c-CitE8NjK.js";import"./LRUCache-C3erQTWv-0wD6drRf.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-B3hR8LxB.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import"./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js";import"./commonProperties-BtIqvFU_-DVH0kGN9.js";import"./ElevationInfo-yv2-9tj6-C2hC6Vpl.js";import"./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js";import"./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js";import"./Relationship-PyhUibYK-BgFx3_5x.js";import"./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js";import"./editsZScale-BDsX6vv--CttUpViY.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./APIKeyMixin-BUMSx9ny-D_H-H5sI.js";import"./ArcGISService-BYA-y6X6-C_YhndKK.js";import"./BlendLayer-D1WkSmwP-Bad8_eoW.js";import"./jsonUtils-wIllKWI4-DrGIvCCq.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./CustomParametersMixin-vdKsTHer-BOFVTNLw.js";import"./EditBusLayer-Df29OyJh-DkVkxUAl.js";import"./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js";import"./FeatureEffect-CDEk9Es7-CEiHf7-6.js";import"./FeatureFilter-BCFHgLVU-CXZvxasm.js";import"./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js";import"./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js";import"./labelingInfo-DGVNul26-zkvIaBlq.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./OperationalLayer-B5IXiMa2-9OHGXI1g.js";import"./OrderedLayer-6Qsmrd_l-BG3Yganz.js";import"./OrderByInfo-GD2XnU8e-NtCi3yT-.js";import"./PortalLayer-CElnYuSQ-DvpreqYV.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js";import"./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js";import"./TemporalLayer-CpOrN_w9-BDEJ3v2O.js";import"./TimeInfo-w_HB2CsF-CZutzBPZ.js";import"./FeatureTemplate-SPHPD45f-DFBQobBO.js";import"./fieldProperties-Bq26w7gt-CFQbsGDX.js";import"./versionUtils-LZYZz-38-DxOZEoAg.js";import"./styleUtils-ChrJTYIw-BfDrXrWd.js";import"./popupUtils-B0uZcXX0-DtBp-byj.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";let Re=class{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(u,e,t){this._layerById[e]=t,this._layerByName[u]=t}async featureSetByName(u,e=!0,t=["*"]){return this._layerByName[u]===void 0?null:this._layerByName[u]}async featureSetById(u,e=!0,t=["*"]){return this._layerById[u]===void 0?null:this._layerById[u]}castToText(u=!1){return"object, FeatureSetCollection"}};class q extends x{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof C?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new te({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().concat(t._known.slice()),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new y(t._candidates.slice(),t._known.slice(),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent?._isInFeatureSet(e);return t===S.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?S.Unknown:t)}_getFeature(e,t,i){return this._parent._getFeature(e,t,i)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){return this._whereclause?.testFeature(e)??!1}async executeWhereClauseDeferred(e){if(this._whereClauseFunction!==null){const t=this._whereClauseFunction(e);return Ne(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,i){const r=new y([],e,!1,null),s=Math.min(t,e.length);if(await this._parent?._getFeatures(r,-1,s,i),this._checkCancelled(i),this._whereClauseFunction==null){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" ("+r+" "+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+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return Be(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+r+")":qe(e.column);case"data-type":return e.value;case"function":{const d=this.evaluateNodeToWhereClause(e.args,t,i,F.BADNESS,s);return Ge(e.name,d,t)}}throw new v(k.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof C?this.reverseLkp[C.convertValueToStorageFormat(this.codefield.calculateValueCompiled(e))]:this.reverseLkp[e.attributes[this.codefield]]}}F.BADNESS="_!!!_BAD_LKP_!!!!";class lt extends ${constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:M(e,this.field.name,T(this._sql,R.Standardised),t.getFieldsIndex())}}extractValue(e){return C.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}let ot=class extends x{static findField(u,e){for(const t of u)if(t.name.toLowerCase()===e.toString().toLowerCase())return t;return null}constructor(u){super(u),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=u.extraFilter,this._parent=u.parentfeatureset,this._maxProcessing=30,this.adaptedFields=u.adaptedFields}_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 te({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=ie.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const u of this.adaptedFields)u.postInitialization(this,this._parent),this.fields.push(u.field)}async _getSet(u){if(this._wset===null){await this._ensureLoaded();let e=null;return e=this._extraFilter?await this._getFilteredSet("",null,null,null,u):await this._parent?._getSet(u),this._checkCancelled(u),Le(e),this._wset=new y(e._candidates.slice(),e._known.slice(),e._ordered,this._clonePageDefinition(e.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(u){return this._parent._isInFeatureSet(u)}async _getFeatures(u,e,t,i){const r=[];e!==-1&&this._featureCache[e]===void 0&&r.push(e);const s=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(u,s)===!0)return await this._expandPagedSet(u,s,0,0,i),this._getFeatures(u,e,t,i);let a=0;for(let o=u._lastFetchedIndex;o=s)));o++);if(r.length===0)return"success";u=new y([],r,u._ordered,null);const n=Math.min(r.length,t);await this._parent?._getFeatures(u,-1,n,i),this._checkCancelled(i);const l=[];for(let o=0;o0&&(i=i.replaceFields(d))}t!==null?this._extraFilter!==null&&(t=O(this._extraFilter,t)):t=this._extraFilter,await this._ensureLoaded();const l=await this._parent._getFilteredSet(u,e,t,i,r);let o;return this._checkCancelled(r),o=s===!0?new y(l._candidates.slice().concat(l._known.slice()),[],n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)):new y(l._candidates.slice(),l._known.slice(),n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)),o}_reformulateWithoutAdaptions(u){const e={cannot:!1,where:u};if(u!==null){for(const t of this.adaptedFields)if(Ie(u,t.field.name)===!0){const i=t.rewriteSql(u,this);if(i.rewritten!==!0){e.cannot=!0,e.where=null;break}e.where=i.where}}return e}async _stat(u,e,t,i,r,s,a){let n=!1,l=this._reformulateWithoutAdaptions(e);if(n=l.cannot,e=l.where,l=this._reformulateWithoutAdaptions(r),n=n||l.cannot,(r=l.where)!==null?this._extraFilter!==null&&(r=O(this._extraFilter,r)):r=this._extraFilter,n===!0)return r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1};const o=await this._parent._stat(u,e,t,i,r,s,a);return o.calculated===!1?r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1}:o}async _canDoAggregates(u,e,t,i,r){if(this._parent===null)return!1;for(let n=0;n{for(let r=0;r0?(await U(this._refineSetBlock(e,this._maxProcessingRate(),r)),this._checkCancelled(r),this.getIdColumnDictionary(e,t,i,r)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_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 I(b.NeverReach)}async _getFilteredSet(e,t,i,r,s){await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,i,r===null?this._orderbyclause:r,s);this._checkCancelled(s);const n=new y(a._candidates.slice(),a._known.slice(),a._ordered,this._clonePageDefinition(a.pagesDefinition));let l=!0;if(a._candidates.length>0&&(l=!1),n._ordered===!1){let o=await this.manualOrderSet(n,s);return l===!1&&(t===null&&i===null||(o=new y(o._candidates.slice().concat(o._known.slice()),[],o._ordered,this._clonePageDefinition(o.pagesDefinition)))),o}return n}static registerAction(){x._featuresetFunctions.orderBy=function(e){return e===""?this:new De({parentfeatureset:this,orderbyclause:new B(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}};function ut(u){if(u.parseTree.type==="function"){if(u.parseTree.args.value.length===0)return{name:u.parseTree.name,expr:null};if(u.parseTree.args.value.length>1)throw new v(k.MissingStatisticParameters);const e=C.create(Ve(u.parseTree.args.value[0],R.Standardised,u.parameters),{fieldsIndex:u.fieldsIndex,timeZone:u.timeZone,currentUser:u.currentUser});return{name:u.parseTree.name,expr:e}}return null}let Se=class ee{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new ee;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,r){const s=new ee;s.field=e;const a=C.create(t,{fieldsIndex:i,timeZone:r}),n=ut(a);if(n===null)throw new v(k.UnsupportedSqlFunction,{function:""});const l=n.name.toUpperCase().trim();if(l==="MIN"){if(s.typeofstat="MIN",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"min"})}else if(l==="MAX"){if(s.typeofstat="MAX",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"max"})}else if(l==="COUNT")s.typeofstat="COUNT",s.workingexpr=n.expr;else if(l==="STDEV"){if(s.typeofstat="STDDEV",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"stdev"})}else if(l==="SUM"){if(s.typeofstat="SUM",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"sum"})}else if(l==="MEAN"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:l})}else if(l==="AVG"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"avg"})}else{if(l!=="VAR")throw new v(k.UnsupportedSqlFunction,{function:l});if(s.typeofstat="VAR",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"var"})}return s}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 dt(u){if(!u)return"COUNT";switch(u.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"}let ht=class ve extends x{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,i=1;const r=this._parent?this._parent.getFieldsIndex():new et([]);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 X(a));for(let a=0;a0&&(l=new ot({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 Y({parentfeatureset:l,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let o=l;if(i!==null){let d=null;i&&(d=this._reformulateWhereClauseWithoutGroupByFields(i)),o=new q({parentfeatureset:o,whereclause:d})}a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new Y({parentfeatureset:o,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return a}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=M(e,t.tofieldname,T(t.workingexpr,R.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=M(e,t.tofieldname,T(t.expression,R.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const i of this._decodedGroupbyfield)i.tofieldname!==i.name&&t.push({field:i.tofieldname,newfield:i.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,i){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getPhysicalPage(e,t,i){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const r=await this._getAgregagtePhysicalPage(e,t,i);for(const s of r){const a={geometry:s.geometry,attributes:{}},n={};for(const l in s.attributes)n[l.toLowerCase()]=s.attributes[l];for(const l of this._decodedGroupbyfield)a.attributes[l.tofieldname]=n[l.name.toLowerCase()];for(const l of this._decodedStatsfield)a.attributes[l.tofieldname]=n[l.field.toLowerCase()];this._featureCache[a.attributes[this.objectIdField]]=new E(a)}return r.length}_sequentialGetPhysicalItem(e,t,i,r){return new Promise((s,a)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),e.pagesDefinition.internal.fullyResolved===!0||t===0?s(r.length):this._nextAggregateItem(e,t,i,r,n=>{n===null?s(r.length):(t-=1,s(this._sequentialGetPhysicalItem(e,t,i,r)))},a)})}_nextAggregateItem(e,t,i,r,s,a){try{U(e.pagesDefinition.internal.iterator.next()).then(n=>{if(n===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);r.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,s(null)}else e.pagesDefinition.internal.fullyResolved=!0,s(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 o=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return r.push(o),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(o.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void s(o)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,i,r,s,a)}},a)}catch(n){a(n)}}_calculateFieldStat(e,t,i){const r=[];for(const s of e.features)if(t.workingexpr!==null){const a=t.workingexpr.calculateValue(s);a!==null&&(a instanceof Xe||a instanceof Ye?r.push(a.toNumber()):a instanceof Ke?r.push(a.toMilliseconds()):r.push(a))}else r.push(null);i.attributes[t.tofieldname]=ze(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const r of this._decodedGroupbyfield){const s=r.singlefield?e.features[0].attributes[r.singlefield]:C.convertValueToStorageFormat(r.expression.calculateValue(e.features[0]),r.sqlType);t.attributes[r.tofieldname]=s}for(const r of this._decodedStatsfield)this._calculateFieldStat(e,r,t);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 i=this._idstates[e];return i===S.InFeatureSet||i===S.NotInFeatureSet?i:t===S.InFeatureSet&&i===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,i,r,s);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,i,r){const s=[],a=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,a)===!0)return await this._expandPagedSet(e,a,0,0,r),this._getFeatures(e,t,i,r);t!==-1&&this._featureCache[t]===void 0&&s.push(t);let n=0;for(let d=e._lastFetchedIndex;da)));d++);if(s.length===0)return"success";const l=new y([],s,!1,null),o=Math.min(s.length,i);await this._parent._getFeatures(l,-1,o,r);for(let d=0;d=this._topnum)break}else if(n===S.NotInFeatureSet)r===null?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),i+=1;else if(n===S.Unknown)break;if(i>=t)break}r!==null&&s.push(r);for(let a=s.length-1;a>=0;a--)e._candidates.splice(s[a].start,s[a].end-s[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(){x._featuresetFunctions.top=function(e){return new se({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}class Q extends x{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}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+Je(e.toJSON());return Ce(t,Te.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=R.StandardisedNoInterval,e!=null&&e>=10.61&&(this._databaseType=R.Standardised)):e!=null&&(e>=10.5&&(this._databaseType=R.StandardisedNoInterval,this._requestStandardised=!0),e>=10.61&&(this._databaseType=R.Standardised))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}_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 z;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?this._layer.type==="subtype-group"&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const i=t==="execute"?this._layer.queryFeatures.bind(this._layer):t==="executeForCount"?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let r=null;if(this.recentlyUsedQueries){const s=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(s),r===null&&(r=i(e),this.recentlyUsedQueries.addToCache(s,r),r=r.catch(a=>{throw this.recentlyUsedQueries?.removeFromCache(s),a}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),r===null&&(r=i(e)),r}async _getFilteredSet(e,t,i,r,s){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,i,r,s);let n="",l=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=r.constructClause(),l=!0);const o=this._createQuery();o.where=P(o.where,i===null?t===null?"1=1":"":T(i,a)),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null,o.geometry=t===null?null:t,o.relationParameter=this._makeRelationshipParam(e);let d=await this.executeQuery(o,"executeForIds");return d===null&&(d=[]),this._checkCancelled(s),new y([],d,l,null)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getFilteredSetUsingPaging(e,t,i,r,s){let a="",n=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(a=r.constructClause(),n=!0);const l=await this.databaseType(),o=i===null?t===null?"1=1":"":T(i,l);let d=this._maxQueryRate();const h=this._layer.capabilities?.query.maxRecordCount;h!=null&&h=this._maxProcessingRate()-1))break}if(a>=i&&s.length===0)break}if(s.length===0)return"success";const n=this._createQuery();n.objectIds=s,n.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),n.returnGeometry=!0,this._removeGeometry===!0&&(n.returnGeometry=!1),n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(r),l.error!==void 0)throw new I(b.RequestFailed,{reason:l.error});const o=this._layer.objectIdField;for(let d=0;d=n)break}return p.features.length===0?l:p.features.length===this._layer.capabilities?.query.maxRecordCount&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()));const s=e.pagesDefinition.internal.lastRetrieved,a=s,n=e.pagesDefinition.internal.lastPage,l=this._createQuery();if(l.where=P(l.where,r),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 o=await this.executeQuery(l,"execute");if(this._checkCancelled(i),!o.hasOwnProperty("features"))throw new I(b.InvalidStatResponse);const d=[];if(e.pagesDefinition.internal.lastPage!==n)return[];o.features.length>0&&o.features[0].attributes[e.pagesDefinition.generatedOid]===void 0&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let h=0;h0||i&&i>0)&&(l.size=[t&&t>0?t:0,i&&i>0?i:t+1]),r&&r.length>0&&(l.attachmentTypes=r),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:n,query:l,method:"attachments"});const o=await n.queryAttachments(new rt(l)),d=[];return o&&o[e]&&o[e].forEach(h=>{const c=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+h.id.toString();let f=null;s&&h.exifInfo&&(f=tt.convertJsonToArcade(h.exifInfo,"system",!0)),d.push(new it(h.id,h.name,h.contentType,h.size,c,f,h.keywords??null))}),d}return[]}async queryRelatedFeatures(e){const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields?.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=Pe(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await j(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const r={},s=i.data;if(s?.relatedRecordGroups){const a=s.spatialReference;for(const n of s.relatedRecordGroups){const l=n.objectId,o=[];for(const d of n.relatedRecords){d.geometry&&(d.geometry.spatialReference=a);const h=new E({geometry:d.geometry?Oe(d.geometry):null,attributes:d.attributes});o.push(h)}r[l]={features:o,exceededTransferLimit:s.exceededTransferLimit===!0}}}return r}throw new I(b.InvalidRequest)}async getFeatureByObjectId(e,t){const i=this._createQuery();i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=P(i.where,this.objectIdField+"="+e.toString()),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const r=await this._layer.queryFeatures(i);return r.features.length===1?r.features[0]:null}async getIdentityUser(){await this.load();const e=le?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=le?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.slice(0,i):t,t){t+="/rest/info";try{const r=await j(t,{query:{f:"json"}});let s="";return r.data?.owningSystemUrl&&(s=r.data.owningSystemUrl),s}catch{return""}}return""}getDataSourceFeatureSet(){const e=new Q({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this.fsetInfo)return this.fsetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const i=this._layer.parsedUrl.path;if(i){const s=await j(i,{responseType:"json",query:{f:"json"}});e=s?.data?.name??null,t=s?.data?.serviceItemId??null}const r=this._layer.title&&(this._layer.parent??null)!==null;return this.featureSetInfo={layerId:this._layer.layerId,layerName:e===""?null:e,itemId:t===""?null:t,serviceLayerUrl:i===""?null:i,webMapLayerId:r?this._layer.id??null:null,webMapLayerTitle:r?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}class V extends x{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(),this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this._databaseType=R.Standardised,this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||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 i of this.fields)t[i.name]=e.attributes[i.name];return new E({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,s){let a="",n=!1;if(r!==null&&(a=r.constructClause(),n=!0),this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);const l=this._layer.createQuery();l.returnZ=this.hasZ,l.returnM=this.hasM,l.where=P(l.where,i===null?t===null?"1=1":"":T(i,R.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 o=await this._layer.queryFeatures(l);if(o===null)return new y([],[],n,null);this._checkCancelled(s);const d=[];return o.features.forEach(h=>{const c=h.attributes[this._layer.objectIdField];d.push(c),this._featureCache[c]=this._changeFeature(h)}),new y([],d,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 z;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const r=[];return this._layer.source.items.forEach(s=>{const a=s.attributes[this._layer.objectIdField];r.push(a),this._featureCache[a]=this._changeFeature(s)}),this._wset=new y([],r,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(r=>{const s=r.attributes[this._layer.objectIdField];i.push(s),this._featureCache[s]=this._changeFeature(r)}),this._wset=new y([],i,!1,null),this._wset}async _getFeatures(e,t,i){const r=[];t!==-1&&this._featureCache[t]===void 0&&r.push(t);for(let s=e._lastFetchedIndex;si)));s++);if(r.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let i=e.layerDefinition.objectIdField;const r=e.layerDefinition.typeIdField??"",s=[];if(e.layerDefinition.types)for(const p of e.layerDefinition.types)s.push(st.fromJSON(p));let a=e.layerDefinition.geometryType;a===void 0&&(a=e.featureSet.geometryType||"");let n=e.featureSet.features;const l=t.toJSON();if(!i){let p=!1;for(const m of e.layerDefinition.fields)if(m.type==="oid"||m.type==="esriFieldTypeOID"){i=m.name,p=!0;break}if(p===!1){let m="FID",_=!0,w=0;for(;_;){let A=!0;for(const xe of e.layerDefinition.fields)if(xe.name===m){A=!1;break}A===!0?_=!1:(w++,m="FID"+w.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:m,alias:m});const D=[];for(let A=0;Aw.name):["*"]);o.outFields=d,o.relationshipId=this.relationship.id,o.where="1=1";let h=!0;this._removeGeometry===!0&&(h=!1),o.returnGeometry=h,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null;const c=await a.source.queryRelatedFeatures(o);this._checkCancelled(s);const f=c[this._findObjectId]?c[this._findObjectId].features:[],p=[];for(let w=0;ww.name):["*"]);return p=new y(c||f?["GETPAGES"]:[],c||f?[]:["GETPAGES"],n,{outFields:_.join(","),resultRecordCount:d,resultOffset:0,objectIds:[this._findObjectId],where:o,orderByFields:a,returnGeometry:m,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(p,d,0,0,s),p}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}_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,i){const r=e.pagesDefinition.internal.lastRetrieved,s=r,a=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),l=new me;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 o=await n.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==a)return 0;const d=o[this._findObjectId]?o[this._findObjectId].features:[];for(let c=0;ci)))&&!(n>=i&&s.length===0);l++);if(s.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,r,s,a,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,r,s){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,s){return this._relatedLayer.queryAttachments(e,t,i,r,s)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer?.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer?.editFieldsInfo??null}get timeInfo(){return this._relatedLayer?.timeInfo??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}function pt(){g.applicationCache===null&&(g.applicationCache=new g)}async function Z(u,e,t){if(g.applicationCache){const i=g.applicationCache.getLayerInfo(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();if(g.applicationCache){g.applicationCache.setLayerInfo(u,s);try{return await s,r}catch(a){throw g.applicationCache.clearLayerInfo(u),a}}return await s,r}if(t!=null){const i=t.getCachedLayerMetadata(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();t.setCachedLayerMetadata(u,s);try{return await s,r}catch(a){throw t.removeCachedLayerMetadata(u,s),a}}return new N({url:u,outFields:e})}async function ae(u,e,t,i,r,s=null){return L(await Z(u,["*"],r),e,t,i,r,s)}function L(u,e=null,t=null,i=!0,r=null,s=null){switch(u.type){case"catalog-footprint":return L(u.parent,e,t,i,r,s);case"subtype-sublayer":{const a=L(u.parent,e,t,i,r,s);return a.filter(C.create(u.parent.subtypeField+"="+u.subtypeCode.toString(),{fieldsIndex:u.parent.fieldsIndex,timeZone:a.dateFieldsTimeZoneDefaultUTC}))}case"csv":case"geojson":case"wfs":return new V({layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const a={layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s};return!u.url&&u.source?new V(a):new Q(a)}default:throw new Error(`Unsupported layer type: ${u.type}`)}}async function ft(u){if(g.applicationCache!==null){const t=g.applicationCache.getLayerInfo(u);if(t!==null)return t}const e=(async()=>{const t=await j(u,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,e);try{return await e}catch(t){throw g.applicationCache.clearLayerInfo(u),t}}return e}async function yt(u,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+u;if(g.applicationCache!==null){const r=g.applicationCache.getLayerInfo(t);if(r!==null)return r}const i=(async()=>{const r=await j(u+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(r.data){const s=r.data;if(s.layerDataElements?.[0])return s.layerDataElements[0]}throw new I(b.DataElementsNotFound)})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(t,i);try{return await i}catch(r){throw g.applicationCache.clearLayerInfo(t),r}}return i}async function ke(u,e){if(g.applicationCache!==null){const i=g.applicationCache.getLayerInfo(u);if(i!==null)return i}if(e!=null){const i=e.getCachedServiceMetadata(u);if(i!=null)return i}const t=(async()=>{const i=await j(u,{responseType:"json",query:{f:"json"}});if(i.data){const r=i.data;return r.layers||(r.layers=[]),r.tables||(r.tables=[]),r}return{layers:[],tables:[]}})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,t);try{return await t}catch(i){throw g.applicationCache.clearLayerInfo(u),i}}if(e!=null){e.setCachedServiceMetadata(u,t);try{return await t}catch(i){throw e.removeCachedServiceMetadata(u,t),i}}return t}async function _t(u,e){const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},i=await ke(u,null);if(t.metadata=i,i.controllerDatasetLayers?.utilityNetworkLayerId!==void 0&&i.controllerDatasetLayers.utilityNetworkLayerId!==null){if(i.layers)for(const a of i.layers)t.layerNameLkp[a.id]=a.name;if(i.tables)for(const a of i.tables)t.layerNameLkp[a.id]=a.name;const r=i.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=r;const s=await yt(u,r);if(s){t.queryelem=s,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??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}for(const l of n.junctionSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}}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 ft(u+"/"+r);if(a.systemLayers?.associationsTableId!==void 0&&a.systemLayers.associationsTableId!==null){const n=[];t.unVersion>=4&&(n.push("STATUS"),n.push("PERCENTALONG"));let l=await ae(u+"/"+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(C.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:l.getFieldsIndex(),timeZone:l.dateFieldsTimeZoneDefaultUTC})),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 gt(u,e,t,i=null,r=null,s=!0,a=null,n=null){let l=u.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const o=await ae(l,i,r,s,a,n);return new ct({layer:u,relatedLayer:o,relationship:e,objectId:t,spatialReference:i,outFields:r,includeGeometry:s,lrucache:a,interceptor:n})}q.registerAction(),ht.registerAction(),Y.registerAction(),Me.registerAction(),se.registerAction();class mt extends Re{constructor(e,t=null,i=null,r=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async featureSetByName(e,t=!0,i=null){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.title===e);if(s!=null)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.title===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n=a.outFields?a:{...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}async featureSetById(e,t=!0,i=["*"]){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.id===e);if(s)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.id===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n={...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}}class ne extends Re{constructor(e,t=null,i=null,r=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async _loadMetaData(){const e=await ke(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ne(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);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" ("+r+" "+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+" "+r+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":case"||":return" ("+this.evaluateNodeToWhereClause(e.left,t,i,F.BADNESS,s)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,i,F.BADNESS,s)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replaceAll("'","''")+"'";case"timestamp":return`timestamp '${e.value}'`;case"date":return`date '${e.value}'`;case"time":return`time '${e.value}'`;case"number":return e.value.toString();case"current-time":return Be(e.mode,t);case"current-user":return"CURRENT_USER";case"column-reference":return i&&i.toLowerCase()===e.column.toLowerCase()?"("+r+")":qe(e.column);case"data-type":return e.value;case"function":{const d=this.evaluateNodeToWhereClause(e.args,t,i,F.BADNESS,s);return Ge(e.name,d,t)}}throw new v(k.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof C?this.reverseLkp[C.convertValueToStorageFormat(this.codefield.calculateValueCompiled(e))]:this.reverseLkp[e.attributes[this.codefield]]}}F.BADNESS="_!!!_BAD_LKP_!!!!";class lt extends ${constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:M(e,this.field.name,T(this._sql,R.Standardised),t.getFieldsIndex())}}extractValue(e){return C.convertValueToStorageFormat(this._sql.calculateValueCompiled(e),this.field.type)}}let ot=class extends x{static findField(u,e){for(const t of u)if(t.name.toLowerCase()===e.toString().toLowerCase())return t;return null}constructor(u){super(u),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=u.extraFilter,this._parent=u.parentfeatureset,this._maxProcessing=30,this.adaptedFields=u.adaptedFields}_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 te({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=ie.point,this.typeIdField="",this.types=null,this.subtypeField=null,this.subtypes=null),this.fields=[];for(const u of this.adaptedFields)u.postInitialization(this,this._parent),this.fields.push(u.field)}async _getSet(u){if(this._wset===null){await this._ensureLoaded();let e=null;return e=this._extraFilter?await this._getFilteredSet("",null,null,null,u):await this._parent?._getSet(u),this._checkCancelled(u),Le(e),this._wset=new y(e._candidates.slice(),e._known.slice(),e._ordered,this._clonePageDefinition(e.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(u){return this._parent._isInFeatureSet(u)}async _getFeatures(u,e,t,i){const r=[];e!==-1&&this._featureCache[e]===void 0&&r.push(e);const s=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(u,s)===!0)return await this._expandPagedSet(u,s,0,0,i),this._getFeatures(u,e,t,i);let a=0;for(let o=u._lastFetchedIndex;o=s)));o++);if(r.length===0)return"success";u=new y([],r,u._ordered,null);const n=Math.min(r.length,t);await this._parent?._getFeatures(u,-1,n,i),this._checkCancelled(i);const l=[];for(let o=0;o0&&(i=i.replaceFields(d))}t!==null?this._extraFilter!==null&&(t=O(this._extraFilter,t)):t=this._extraFilter,await this._ensureLoaded();const l=await this._parent._getFilteredSet(u,e,t,i,r);let o;return this._checkCancelled(r),o=s===!0?new y(l._candidates.slice().concat(l._known.slice()),[],n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)):new y(l._candidates.slice(),l._known.slice(),n===!0&&l._ordered,this._clonePageDefinition(l.pagesDefinition)),o}_reformulateWithoutAdaptions(u){const e={cannot:!1,where:u};if(u!==null){for(const t of this.adaptedFields)if(Ie(u,t.field.name)===!0){const i=t.rewriteSql(u,this);if(i.rewritten!==!0){e.cannot=!0,e.where=null;break}e.where=i.where}}return e}async _stat(u,e,t,i,r,s,a){let n=!1,l=this._reformulateWithoutAdaptions(e);if(n=l.cannot,e=l.where,l=this._reformulateWithoutAdaptions(r),n=n||l.cannot,(r=l.where)!==null?this._extraFilter!==null&&(r=O(this._extraFilter,r)):r=this._extraFilter,n===!0)return r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1};const o=await this._parent._stat(u,e,t,i,r,s,a);return o.calculated===!1?r===null&&t===""&&i===null?this._manualStat(u,e,s,a):{calculated:!1}:o}async _canDoAggregates(u,e,t,i,r){if(this._parent===null)return!1;for(let n=0;n{for(let r=0;r0?(await U(this._refineSetBlock(e,this._maxProcessingRate(),r)),this._checkCancelled(r),this.getIdColumnDictionary(e,t,i,r)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,i,r){return this._parent._getFeatures(e,t,i,r)}_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 I(b.NeverReach)}async _getFilteredSet(e,t,i,r,s){await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,i,r===null?this._orderbyclause:r,s);this._checkCancelled(s);const n=new y(a._candidates.slice(),a._known.slice(),a._ordered,this._clonePageDefinition(a.pagesDefinition));let l=!0;if(a._candidates.length>0&&(l=!1),n._ordered===!1){let o=await this.manualOrderSet(n,s);return l===!1&&(t===null&&i===null||(o=new y(o._candidates.slice().concat(o._known.slice()),[],o._ordered,this._clonePageDefinition(o.pagesDefinition)))),o}return n}static registerAction(){x._featuresetFunctions.orderBy=function(e){return e===""?this:new De({parentfeatureset:this,orderbyclause:new B(e)})}}getFieldsIndex(){return this._parent.getFieldsIndex()}};function ut(u){if(u.parseTree.type==="function"){if(u.parseTree.args.value.length===0)return{name:u.parseTree.name,expr:null};if(u.parseTree.args.value.length>1)throw new v(k.MissingStatisticParameters);const e=C.create(Ve(u.parseTree.args.value[0],R.Standardised,u.parameters),{fieldsIndex:u.fieldsIndex,timeZone:u.timeZone,currentUser:u.currentUser});return{name:u.parseTree.name,expr:e}}return null}let Se=class ee{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new ee;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,i,r){const s=new ee;s.field=e;const a=C.create(t,{fieldsIndex:i,timeZone:r}),n=ut(a);if(n===null)throw new v(k.UnsupportedSqlFunction,{function:""});const l=n.name.toUpperCase().trim();if(l==="MIN"){if(s.typeofstat="MIN",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"min"})}else if(l==="MAX"){if(s.typeofstat="MAX",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"max"})}else if(l==="COUNT")s.typeofstat="COUNT",s.workingexpr=n.expr;else if(l==="STDEV"){if(s.typeofstat="STDDEV",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"stdev"})}else if(l==="SUM"){if(s.typeofstat="SUM",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"sum"})}else if(l==="MEAN"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:l})}else if(l==="AVG"){if(s.typeofstat="AVG",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"avg"})}else{if(l!=="VAR")throw new v(k.UnsupportedSqlFunction,{function:l});if(s.typeofstat="VAR",s.workingexpr=n.expr,a===null)throw new v(k.InvalidFunctionParameters,{function:"var"})}return s}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 dt(u){if(!u)return"COUNT";switch(u.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"}let ht=class ve extends x{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,i=1;const r=this._parent?this._parent.getFieldsIndex():new et([]);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 X(a));for(let a=0;a0&&(l=new ot({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 Y({parentfeatureset:l,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let o=l;if(i!==null){let d=null;i&&(d=this._reformulateWhereClauseWithoutGroupByFields(i)),o=new q({parentfeatureset:o,whereclause:d})}a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new Y({parentfeatureset:o,orderbyclause:new B(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return a}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=M(e,t.tofieldname,T(t.workingexpr,R.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=M(e,t.tofieldname,T(t.expression,R.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const i of this._decodedGroupbyfield)i.tofieldname!==i.name&&t.push({field:i.tofieldname,newfield:i.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,i){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,i),this._refineSetBlock(e,t,i)):(this._checkCancelled(i),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getPhysicalPage(e,t,i){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,i,[]);const r=await this._getAgregagtePhysicalPage(e,t,i);for(const s of r){const a={geometry:s.geometry,attributes:{}},n={};for(const l in s.attributes)n[l.toLowerCase()]=s.attributes[l];for(const l of this._decodedGroupbyfield)a.attributes[l.tofieldname]=n[l.name.toLowerCase()];for(const l of this._decodedStatsfield)a.attributes[l.tofieldname]=n[l.field.toLowerCase()];this._featureCache[a.attributes[this.objectIdField]]=new E(a)}return r.length}_sequentialGetPhysicalItem(e,t,i,r){return new Promise((s,a)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(i)),e.pagesDefinition.internal.fullyResolved===!0||t===0?s(r.length):this._nextAggregateItem(e,t,i,r,n=>{n===null?s(r.length):(t-=1,s(this._sequentialGetPhysicalItem(e,t,i,r)))},a)})}_nextAggregateItem(e,t,i,r,s,a){try{U(e.pagesDefinition.internal.iterator.next()).then(n=>{if(n===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);r.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,s(null)}else e.pagesDefinition.internal.fullyResolved=!0,s(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 o=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return r.push(o),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(o.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void s(o)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,i,r,s,a)}},a)}catch(n){a(n)}}_calculateFieldStat(e,t,i){const r=[];for(const s of e.features)if(t.workingexpr!==null){const a=t.workingexpr.calculateValue(s);a!==null&&(a instanceof Xe||a instanceof Ye?r.push(a.toNumber()):a instanceof Ke?r.push(a.toMilliseconds()):r.push(a))}else r.push(null);i.attributes[t.tofieldname]=ze(t.typeofstat,[r])}_calculateAndAppendAggregateItem(e){const t={attributes:{},geometry:null};for(const r of this._decodedGroupbyfield){const s=r.singlefield?e.features[0].attributes[r.singlefield]:C.convertValueToStorageFormat(r.expression.calculateValue(e.features[0]),r.sqlType);t.attributes[r.tofieldname]=s}for(const r of this._decodedStatsfield)this._calculateFieldStat(e,r,t);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 i=this._idstates[e];return i===S.InFeatureSet||i===S.NotInFeatureSet?i:t===S.InFeatureSet&&i===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,i,r,s);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,i,r){const s=[],a=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,a)===!0)return await this._expandPagedSet(e,a,0,0,r),this._getFeatures(e,t,i,r);t!==-1&&this._featureCache[t]===void 0&&s.push(t);let n=0;for(let d=e._lastFetchedIndex;da)));d++);if(s.length===0)return"success";const l=new y([],s,!1,null),o=Math.min(s.length,i);await this._parent._getFeatures(l,-1,o,r);for(let d=0;d=this._topnum)break}else if(n===S.NotInFeatureSet)r===null?r={start:a,end:a}:r.end===a-1?r.end=a:(s.push(r),r={start:a,end:a}),i+=1;else if(n===S.Unknown)break;if(i>=t)break}r!==null&&s.push(r);for(let a=s.length-1;a>=0;a--)e._candidates.splice(s[a].start,s[a].end-s[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(){x._featuresetFunctions.top=function(e){return new se({parentfeatureset:this,topnum:e})}}getFieldsIndex(){return this._parent.getFieldsIndex()}}class Q extends x{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}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+Je(e.toJSON());return Ce(t,Te.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=R.StandardisedNoInterval,e!=null&&e>=10.61&&(this._databaseType=R.Standardised)):e!=null&&(e>=10.5&&(this._databaseType=R.StandardisedNoInterval,this._requestStandardised=!0),e>=10.61&&(this._databaseType=R.Standardised))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}_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 z;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?this._layer.type==="subtype-group"&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const i=t==="execute"?this._layer.queryFeatures.bind(this._layer):t==="executeForCount"?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let r=null;if(this.recentlyUsedQueries){const s=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(s),r===null&&(r=i(e),this.recentlyUsedQueries.addToCache(s,r),r=r.catch(a=>{throw this.recentlyUsedQueries?.removeFromCache(s),a}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),r===null&&(r=i(e)),r}async _getFilteredSet(e,t,i,r,s){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,i,r,s);let n="",l=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=r.constructClause(),l=!0);const o=this._createQuery();o.where=P(o.where,i===null?t===null?"1=1":"":T(i,a)),o.spatialRelationship=this._makeRelationshipEnum(e),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null,o.geometry=t===null?null:t,o.relationParameter=this._makeRelationshipParam(e);let d=await this.executeQuery(o,"executeForIds");return d===null&&(d=[]),this._checkCancelled(s),new y([],d,l,null)}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}async _getFilteredSetUsingPaging(e,t,i,r,s){let a="",n=!1;r!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(a=r.constructClause(),n=!0);const l=await this.databaseType(),o=i===null?t===null?"1=1":"":T(i,l);let d=this._maxQueryRate();const h=this._layer.capabilities?.query.maxRecordCount;h!=null&&h=this._maxProcessingRate()-1))break}if(a>=i&&s.length===0)break}if(s.length===0)return"success";const n=this._createQuery();n.objectIds=s,n.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),n.returnGeometry=!0,this._removeGeometry===!0&&(n.returnGeometry=!1),n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(r),l.error!==void 0)throw new I(b.RequestFailed,{reason:l.error});const o=this._layer.objectIdField;for(let d=0;d=n)break}return p.features.length===0?l:p.features.length===this._layer.capabilities?.query.maxRecordCount&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()));const s=e.pagesDefinition.internal.lastRetrieved,a=s,n=e.pagesDefinition.internal.lastPage,l=this._createQuery();if(l.where=P(l.where,r),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 o=await this.executeQuery(l,"execute");if(this._checkCancelled(i),!o.hasOwnProperty("features"))throw new I(b.InvalidStatResponse);const d=[];if(e.pagesDefinition.internal.lastPage!==n)return[];o.features.length>0&&o.features[0].attributes[e.pagesDefinition.generatedOid]===void 0&&(e.pagesDefinition.generatedOid=e.pagesDefinition.generatedOid.toLowerCase());for(let h=0;h0||i&&i>0)&&(l.size=[t&&t>0?t:0,i&&i>0?i:t+1]),r&&r.length>0&&(l.attachmentTypes=r),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:n,query:l,method:"attachments"});const o=await n.queryAttachments(new rt(l)),d=[];return o&&o[e]&&o[e].forEach(h=>{const c=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+h.id.toString();let f=null;s&&h.exifInfo&&(f=tt.convertJsonToArcade(h.exifInfo,"system",!0)),d.push(new it(h.id,h.name,h.contentType,h.size,c,f,h.keywords??null))}),d}return[]}async queryRelatedFeatures(e){const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:e.outFields?.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=Pe(e.outSpatialReference)),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await j(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(i.data){const r={},s=i.data;if(s?.relatedRecordGroups){const a=s.spatialReference;for(const n of s.relatedRecordGroups){const l=n.objectId,o=[];for(const d of n.relatedRecords){d.geometry&&(d.geometry.spatialReference=a);const h=new E({geometry:d.geometry?Oe(d.geometry):null,attributes:d.attributes});o.push(h)}r[l]={features:o,exceededTransferLimit:s.exceededTransferLimit===!0}}}return r}throw new I(b.InvalidRequest)}async getFeatureByObjectId(e,t){const i=this._createQuery();i.outFields=t,i.returnGeometry=!1,i.outSpatialReference=this.spatialReference,i.where=P(i.where,this.objectIdField+"="+e.toString()),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:i,method:"execute"});const r=await this._layer.queryFeatures(i);return r.features.length===1?r.features[0]:null}async getIdentityUser(){await this.load();const e=le?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=le?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const i=t.toLowerCase().indexOf("/rest/services");if(t=i>-1?t.slice(0,i):t,t){t+="/rest/info";try{const r=await j(t,{query:{f:"json"}});let s="";return r.data?.owningSystemUrl&&(s=r.data.owningSystemUrl),s}catch{return""}}return""}getDataSourceFeatureSet(){const e=new Q({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this.recentlyUsedQueries??void 0,interceptor:this.featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this.fsetInfo)return this.fsetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const i=this._layer.parsedUrl.path;if(i){const s=await j(i,{responseType:"json",query:{f:"json"}});e=s?.data?.name??null,t=s?.data?.serviceItemId??null}const r=this._layer.title&&(this._layer.parent??null)!==null;return this.featureSetInfo={layerId:this._layer.layerId,layerName:e===""?null:e,itemId:t===""?null:t,serviceLayerUrl:i===""?null:i,webMapLayerId:r?this._layer.id??null:null,webMapLayerTitle:r?this._layer.title??null:null,className:null,objectClassId:null},this.fsetInfo}}class V extends x{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(),this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const i of this.fields)if(i.type==="oid")e.push(i),t.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){e.push(i),t.push(i.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this._databaseType=R.Standardised,this.hasZ=this._layer?.capabilities?.data?.supportsZ===!0,this.hasM=this._layer?.capabilities?.data?.supportsM===!0,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||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 i of this.fields)t[i.name]=e.attributes[i.name];return new E({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,i,r,s){let a="",n=!1;if(r!==null&&(a=r.constructClause(),n=!0),this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);const l=this._layer.createQuery();l.returnZ=this.hasZ,l.returnM=this.hasM,l.where=P(l.where,i===null?t===null?"1=1":"":T(i,R.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 o=await this._layer.queryFeatures(l);if(o===null)return new y([],[],n,null);this._checkCancelled(s);const d=[];return o.features.forEach(h=>{const c=h.attributes[this._layer.objectIdField];d.push(c),this._featureCache[c]=this._changeFeature(h)}),new y([],d,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 z;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const r=[];return this._layer.source.items.forEach(s=>{const a=s.attributes[this._layer.objectIdField];r.push(a),this._featureCache[a]=this._changeFeature(s)}),this._wset=new y([],r,!1,null),this._wset}e.returnZ=this.hasZ,e.returnM=this.hasM;const t=await this._layer.queryFeatures(e),i=[];return t.features.forEach(r=>{const s=r.attributes[this._layer.objectIdField];i.push(s),this._featureCache[s]=this._changeFeature(r)}),this._wset=new y([],i,!1,null),this._wset}async _getFeatures(e,t,i){const r=[];t!==-1&&this._featureCache[t]===void 0&&r.push(t);for(let s=e._lastFetchedIndex;si)));s++);if(r.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const i in e)t[i]=e[i];return t}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let i=e.layerDefinition.objectIdField;const r=e.layerDefinition.typeIdField??"",s=[];if(e.layerDefinition.types)for(const p of e.layerDefinition.types)s.push(st.fromJSON(p));let a=e.layerDefinition.geometryType;a===void 0&&(a=e.featureSet.geometryType||"");let n=e.featureSet.features;const l=t.toJSON();if(!i){let p=!1;for(const m of e.layerDefinition.fields)if(m.type==="oid"||m.type==="esriFieldTypeOID"){i=m.name,p=!0;break}if(p===!1){let m="FID",_=!0,w=0;for(;_;){let A=!0;for(const xe of e.layerDefinition.fields)if(xe.name===m){A=!1;break}A===!0?_=!1:(w++,m="FID"+w.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:m,alias:m});const D=[];for(let A=0;Aw.name):["*"]);o.outFields=d,o.relationshipId=this.relationship.id,o.where="1=1";let h=!0;this._removeGeometry===!0&&(h=!1),o.returnGeometry=h,this._requestStandardised&&(o.sqlFormat="standard"),o.outSpatialReference=this.spatialReference,o.orderByFields=n!==""?n.split(","):null;const c=await a.source.queryRelatedFeatures(o);this._checkCancelled(s);const f=c[this._findObjectId]?c[this._findObjectId].features:[],p=[];for(let w=0;ww.name):["*"]);return p=new y(c||f?["GETPAGES"]:[],c||f?[]:["GETPAGES"],n,{outFields:_.join(","),resultRecordCount:d,resultOffset:0,objectIds:[this._findObjectId],where:o,orderByFields:a,returnGeometry:m,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(p,d,0,0,s),p}_expandPagedSet(e,t,i,r,s){return this._expandPagedSetFeatureSet(e,t,i,r,s)}_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,i){const r=e.pagesDefinition.internal.lastRetrieved,s=r,a=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),l=new me;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 o=await n.source.queryRelatedFeatures(l);if(this._checkCancelled(i),e.pagesDefinition.internal.lastPage!==a)return 0;const d=o[this._findObjectId]?o[this._findObjectId].features:[];for(let c=0;ci)))&&!(n>=i&&s.length===0);l++);if(s.length===0)return"success";throw new I(b.MissingFeatures)}async _refineSetBlock(e,t,i){return e}async _stat(e,t,i,r,s,a,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,i,r,s){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,i,r,s){return this._relatedLayer.queryAttachments(e,t,i,r,s)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer?.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer?.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer?.editFieldsInfo??null}get timeInfo(){return this._relatedLayer?.timeInfo??null}async getFeatureSetInfo(){return this.fsetInfo??this._layer.featureSetInfo}}function pt(){g.applicationCache===null&&(g.applicationCache=new g)}async function Z(u,e,t){if(g.applicationCache){const i=g.applicationCache.getLayerInfo(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();if(g.applicationCache){g.applicationCache.setLayerInfo(u,s);try{return await s,r}catch(a){throw g.applicationCache.clearLayerInfo(u),a}}return await s,r}if(t!=null){const i=t.getCachedLayerMetadata(u);if(i){const a=await i;return new N({url:u,outFields:e,sourceJSON:a})}const r=new N({url:u,outFields:e}),s=(async()=>(await r.load(),r.sourceJSON))();t.setCachedLayerMetadata(u,s);try{return await s,r}catch(a){throw t.removeCachedLayerMetadata(u,s),a}}return new N({url:u,outFields:e})}async function ae(u,e,t,i,r,s=null){return L(await Z(u,["*"],r),e,t,i,r,s)}function L(u,e=null,t=null,i=!0,r=null,s=null){switch(u.type){case"catalog-footprint":return L(u.parent,e,t,i,r,s);case"subtype-sublayer":{const a=L(u.parent,e,t,i,r,s);return a.filter(C.create(u.parent.subtypeField+"="+u.subtypeCode.toString(),{fieldsIndex:u.parent.fieldsIndex,timeZone:a.dateFieldsTimeZoneDefaultUTC}))}case"csv":case"geojson":case"wfs":return new V({layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s});case"catalog":case"feature":case"oriented-imagery":case"subtype-group":{const a={layer:u,spatialReference:e,outFields:t,includeGeometry:i,lrucache:r,interceptor:s};return!u.url&&u.source?new V(a):new Q(a)}default:throw new Error(`Unsupported layer type: ${u.type}`)}}async function ft(u){if(g.applicationCache!==null){const t=g.applicationCache.getLayerInfo(u);if(t!==null)return t}const e=(async()=>{const t=await j(u,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,e);try{return await e}catch(t){throw g.applicationCache.clearLayerInfo(u),t}}return e}async function yt(u,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+u;if(g.applicationCache!==null){const r=g.applicationCache.getLayerInfo(t);if(r!==null)return r}const i=(async()=>{const r=await j(u+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(r.data){const s=r.data;if(s.layerDataElements?.[0])return s.layerDataElements[0]}throw new I(b.DataElementsNotFound)})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(t,i);try{return await i}catch(r){throw g.applicationCache.clearLayerInfo(t),r}}return i}async function ke(u,e){if(g.applicationCache!==null){const i=g.applicationCache.getLayerInfo(u);if(i!==null)return i}if(e!=null){const i=e.getCachedServiceMetadata(u);if(i!=null)return i}const t=(async()=>{const i=await j(u,{responseType:"json",query:{f:"json"}});if(i.data){const r=i.data;return r.layers||(r.layers=[]),r.tables||(r.tables=[]),r}return{layers:[],tables:[]}})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(u,t);try{return await t}catch(i){throw g.applicationCache.clearLayerInfo(u),i}}if(e!=null){e.setCachedServiceMetadata(u,t);try{return await t}catch(i){throw e.removeCachedServiceMetadata(u,t),i}}return t}async function _t(u,e){const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},i=await ke(u,null);if(t.metadata=i,i.controllerDatasetLayers?.utilityNetworkLayerId!==void 0&&i.controllerDatasetLayers.utilityNetworkLayerId!==null){if(i.layers)for(const a of i.layers)t.layerNameLkp[a.id]=a.name;if(i.tables)for(const a of i.tables)t.layerNameLkp[a.id]=a.name;const r=i.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=r;const s=await yt(u,r);if(s){t.queryelem=s,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??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}for(const l of n.junctionSources??[]){const o={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]??null};o.className&&(t.lkp[o.className]=o)}}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 ft(u+"/"+r);if(a.systemLayers?.associationsTableId!==void 0&&a.systemLayers.associationsTableId!==null){const n=[];t.unVersion>=4&&(n.push("STATUS"),n.push("PERCENTALONG"));let l=await ae(u+"/"+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(C.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, 63)",{fieldsIndex:l.getFieldsIndex(),timeZone:l.dateFieldsTimeZoneDefaultUTC})),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 gt(u,e,t,i=null,r=null,s=!0,a=null,n=null){let l=u.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const o=await ae(l,i,r,s,a,n);return new ct({layer:u,relatedLayer:o,relationship:e,objectId:t,spatialReference:i,outFields:r,includeGeometry:s,lrucache:a,interceptor:n})}q.registerAction(),ht.registerAction(),Y.registerAction(),Me.registerAction(),se.registerAction();class mt extends Re{constructor(e,t=null,i=null,r=null){super(),this._map=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async featureSetByName(e,t=!0,i=null){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetByName(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.title===e);if(s!=null)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.title===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n=a.outFields?a:{...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}async featureSetById(e,t=!0,i=["*"]){if(oe.isLoadable(this._map)&&!this._map.loaded)return await this._map.load(),this.featureSetById(e,t,i);i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let a=0;age(a)&&a.id===e);if(s)return this._makeAndAddFeatureSet(s,t,i);if(this._map.tables){const a=this._map.tables.find(n=>n.id===e);if(a!=null){if(a instanceof N)return this._makeAndAddFeatureSet(a,t,i);if(a._materializedTable==null){const n={...a,outFields:["*"]};a._materializedTable=new N(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,i)}}return null}}class ne extends Re{constructor(e,t=null,i=null,r=null){super(),this._url=e,this._overrideSpatialReference=t,this._lrucache=i,this._interceptor=r,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,i=null){const r=L(e,this._overrideSpatialReference,i===null?["*"]:i,t,this._lrucache);return this._instantLayers.push({featureset:r,opitem:e,includeGeometry:t,outFields:JSON.stringify(i)}),r}async _loadMetaData(){const e=await ke(this._url,this._lrucache);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ne(this._url,this._overrideSpatialReference,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,i=null){i===null&&(i=["*"]),i=(i=i.slice()).sort();const r=JSON.stringify(i);for(let n=0;n0){const F=[];for(let t=0;t{if(x(e,1,2,n,i),$e(e[0])||Y(e[0]))return"Unknown";if(N(e[0])){if(await e[0].load(),e.length===1||e[1]===null)return e[0].datesInUnknownTimezone?z("unknown"):z(e[0].dateFieldsTimeZone);if(!(e[1]instanceof Z)||e[1].hasField("type")===!1)throw new c(n,m.InvalidParameter,i);const s=e[1].field("type");if(C(s)===!1)throw new c(n,m.InvalidParameter,i);switch(E(s).toLowerCase()){case"preferredtimezone":return z(e[0].preferredTimeZone);case"editfieldsinfo":return z(e[0].editFieldsInfo?.timeZone??null);case"timeinfo":return z(e[0].timeInfo?.timeZone??null);case"field":if(e[1].hasField("fieldname")&&C(e[1].field("fieldname")))return z(e[0].fieldTimeZone(E(e[1].field("fieldname"))))}throw new c(n,m.InvalidParameter,i)}const t=xe(e[0],de(n));if(t===null)return null;const o=t.timeZone;return o==="system"?Fe.systemTimeZoneCanonicalName:o.toLowerCase()==="utc"?"UTC":o.toLowerCase()==="unknown"?"Unknown":o})},r.functions.sqltimestamp=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,3,n,i);const t=e[0];if(ue(t)){if(e.length===1)return t.toSQLWithKeyword();if(e.length===2)return t.changeTimeZone(E(e[1])).toSQLWithKeyword();throw new c(n,m.InvalidParameter,i)}if(Y(t))return t.toSQLWithKeyword();if(N(t)){if(e.length!==3)throw new c(n,m.InvalidParameter,i);await t.load();const o=E(e[1]);if(Y(e[2]))return e[2].toSQLWithKeyword();if(ue(e[2])===!1)throw new c(n,m.InvalidParameter,i);const s=t.fieldTimeZone(o);return s===null?e[2].toSQLWithKeyword():e[2].changeTimeZone(s).toSQLWithKeyword()}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"sqltimestamp",min:2,max:4}),r.functions.featuresetbyid=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetById(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyid",min:2,max:4}),r.functions.getfeatureset=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,2,n,i),G(e[0])){let t=L(e[1],"datasource");return t===null&&(t="datasource"),t=E(t).toLowerCase(),Ae(e[0].fullSchema(),t,n.lrucache,n.interceptor,n.spatialReference??null)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"getfeatureset",min:1,max:2}),r.functions.featuresetbyportalitem=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,5,n,i),e[0]===null)throw new c(n,m.PortalRequired,i);if(e[0]instanceof De){const f=E(e[1]),a=E(e[2]);let l=L(e[3],null);const d=k(L(e[4],!0));if(l===null&&(l=["*"]),b(l)===!1)throw new c(n,m.InvalidParameter,i);let w;return w=n.services?.portal?n.services.portal:ye.getDefault(),w=ke(e[0],w),me(f,a,n.spatialReference??null,l,d,w,n.lrucache,n.interceptor)}if(C(e[0])===!1)throw new c(n,m.PortalRequired,i);const t=E(e[0]),o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);return me(t,o,n.spatialReference??null,s,p,n.services?.portal??ye.getDefault(),n.lrucache,n.interceptor)})},r.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),r.functions.featuresetbyname=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetByName(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyname",min:2,max:4}),r.functions.featureset=function(n,i){return r.standardFunction(n,i,(y,F,e)=>{x(e,1,1,n,i);const t={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if(C(e[0])){const o=JSON.parse(e[0]);o.layerDefinition!==void 0?(t.layerDefinition=o.layerDefinition,t.featureSet=o.featureSet,o.layerDefinition.spatialReference&&(t.layerDefinition.spatialReference=o.layerDefinition.spatialReference)):(t.featureSet.features=o.features,t.featureSet.geometryType=o.geometryType,t.layerDefinition.geometryType=t.featureSet.geometryType,t.layerDefinition.objectIdField=o.objectIdFieldName??"",t.layerDefinition.typeIdField=o.typeIdFieldName,t.layerDefinition.globalIdField=o.globalIdFieldName,t.layerDefinition.fields=o.fields,o.spatialReference&&(t.layerDefinition.spatialReference=o.spatialReference))}else{if(!(e[0]instanceof Z))throw new c(n,m.InvalidParameter,i);{const o=JSON.parse(e[0].castToText(!0)),s=u(o,"layerdefinition");if(s!==null){t.layerDefinition.geometryType=u(s,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.globalIdField=u(s,"globalidfield",""),t.layerDefinition.objectIdField=u(s,"objectidfield",""),t.layerDefinition.typeIdField=u(s,"typeidfield",""),t.layerDefinition.hasZ=u(s,"hasz",!1)===!0,t.layerDefinition.hasM=u(s,"hasm",!1)===!0;const p=u(s,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[];for(const l of u(s,"fields",[])){const d={name:u(l,"name",""),alias:u(l,"alias",""),type:u(l,"type",""),nullable:u(l,"nullable",!0),editable:u(l,"editable",!0),length:u(l,"length",null),domain:we(u(l,"domain"))};f.push(d)}t.layerDefinition.fields=f;const a=u(o,"featureset");if(a){const l={};for(const d of f)l[d.name.toLowerCase()]=d.name;for(const d of u(a,"features",[])){const w={},D=u(d,"attributes",{});for(const g in D)w[l[g.toLowerCase()]]=D[g];t.featureSet.features.push({attributes:w,geometry:he(u(d,"geometry"))})}}}else{t.layerDefinition.hasZ=u(o,"hasz",!1)===!0,t.layerDefinition.hasM=u(o,"hasm",!1)===!0,t.layerDefinition.geometryType=u(o,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.objectIdField=u(o,"objectidfieldname",""),t.layerDefinition.typeIdField=u(o,"typeidfieldname","");const p=u(o,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[],a=u(o,"fields",null);if(!b(a))throw new c(n,m.InvalidParameter,i);for(const w of a){const D={name:u(w,"name",""),alias:u(w,"alias",""),type:u(w,"type",""),nullable:u(w,"nullable",!0),editable:u(w,"editable",!0),length:u(w,"length",null),domain:we(u(w,"domain"))};f.push(D)}t.layerDefinition.fields=f;const l={};for(const w of f)l[w.name.toLowerCase()]=w.name;let d=u(o,"features",null);if(b(d))for(const w of d){const D={},g=u(w,"attributes",{});for(const T in g)D[l[T.toLowerCase()]]=g[T];t.featureSet.features.push({attributes:D,geometry:he(u(w,"geometry",null))})}else d=null,t.featureSet.features=d}}}if(We(t)===!1)throw new c(n,m.InvalidParameter,i);return t.layerDefinition.geometryType||(t.layerDefinition.geometryType="esriGeometryNull"),Le.create(t,n.spatialReference)})},r.signatures.push({name:"featureset",min:1,max:1}),r.functions.filter=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),b(e[0])||M(e[0])){const t=[];let o,s=e[0];if(s instanceof Me&&(s=s.toArray()),!Ee(e[1]))throw new c(n,m.InvalidParameter,i);o=e[1].createFunction(n);for(const p of s){const f=o(p);ze(f)?await f===!0&&t.push(p):f===!0&&t.push(p)}return t}if(N(e[0])){const t=await e[0].load(),o=$.create(e[1],{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),s=o.getVariables();if(s.length>0){const p=[];for(let a=0;a{if(x(e,2,2,n,i),N(e[0])){const t=new Se(e[1]);return new Ze({parentfeatureset:e[0],orderbyclause:t})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"orderby",min:2,max:2}),r.functions.top=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0]))return new Ce({parentfeatureset:e[0],topnum:e[1]});if(b(e[0]))return O(e[1])>=e[0].length?e[0].slice():e[0].slice(0,O(e[1]));if(M(e[0]))return O(e[1])>=e[0].length()?e[0].slice():e[0].slice(0,O(e[1]));throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"top",min:2,max:2}),r.functions.first=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),N(e[0])){const t=await e[0].first(y.abortSignal);if(t!==null){const o=Te.createFromGraphicLikeObject(t.geometry,t.attributes,e[0],n.timeZone);return o._underlyingGraphic=t,o}return t}return b(e[0])?e[0].length===0?null:e[0][0]:M(e[0])?e[0].length()===0?null:e[0].get(0):null})},r.signatures.push({name:"first",min:1,max:1}),r.functions.attachments=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,2,n,i);const t={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof Z){if(e[1].hasField("minsize")&&(t.minsize=O(e[1].field("minsize"))),e[1].hasField("metadata")&&(t.returnMetadata=k(e[1].field("metadata"))),e[1].hasField("maxsize")&&(t.maxsize=O(e[1].field("maxsize"))),e[1].hasField("types")){const o=be(e[1].field("types"),!1);o.length>0&&(t.types=o)}}else if(e[1]!==null)throw new c(n,m.InvalidParameter,i)}if(G(e[0])){let o=e[0]._layer;return o instanceof te&&(o=X(o,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),o===null?[]:N(o)===!1?[]:(await o.load(),o.queryAttachments(e[0].field(o.objectIdField),t.minsize,t.maxsize,t.types,t.returnMetadata))}if(e[0]===null)return[];throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"attachments",min:1,max:2}),r.functions.featuresetbyrelationshipname=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,4,n,i);const t=e[0],o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let f=t._layer;if(f instanceof te&&(f=X(f,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),f===null||N(f)===!1)return null;f=await f.load();const a=f.relationshipMetaData().filter(g=>g.name===o);if(a.length===0)return null;if(a[0].relationshipTableId!==void 0&&a[0].relationshipTableId!==null&&a[0].relationshipTableId>-1)return ve(f,a[0],t.field(f.objectIdField),f.spatialReference,s,p,n.lrucache,n.interceptor);let l=f.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+a[0].relatedTableId.toString():l+"/"+a[0].relatedTableId.toString();const d=await Pe(l,f.spatialReference,s,p,n.lrucache,n.interceptor);await d.load();let w=d.relationshipMetaData();if(w=w.filter(g=>g.id===a[0].id),t.hasField(a[0].keyField)===!1||t.field(a[0].keyField)===null){const g=await f.getFeatureByObjectId(t.field(f.objectIdField),[a[0].keyField]);if(g){const T=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return T.parameters={id:g.attributes[a[0].keyField]},d.filter(T)}return new Oe({parentfeatureset:d})}const D=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return D.parameters={id:t.field(a[0].keyField)},d.filter(D)})},r.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),r.functions.featuresetbyassociation=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,3,n,i);const t=e[0],o=E(L(e[1],"")).toLowerCase(),s=C(e[2])?E(e[2]):null;if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let p=t._layer;if(p instanceof te&&(p=X(p,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),p===null||N(p)===!1)return null;await p.load();const f=p.serviceUrl(),a=await Re(f,n.spatialReference);let l=null,d=null,w=!1;if(s!==null&&s!==""&&s!==void 0){for(const I of a.terminals)I.terminalName===s&&(d=I.terminalId);d===null&&(w=!0)}const D=a.associations.getFieldsIndex(),g=D.get("TOGLOBALID").name,T=D.get("FROMGLOBALID").name,B=D.get("TOTERMINALID").name,K=D.get("FROMTERMINALID").name,H=D.get("FROMNETWORKSOURCEID").name,j=D.get("TONETWORKSOURCEID").name,R=D.get("ASSOCIATIONTYPE").name,ge=D.get("ISCONTENTVISIBLE").name,Ie=D.get("OBJECTID").name;for(const I of p.fields)if(I.type==="global-id"){l=t.field(I.name);break}let v=null,re=new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create("''",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));const A="globalid",le="globalId",se={};for(const I in a.lkp)se[I]=a.lkp[I].sourceId;const P=new Ue(new W({name:"classname",alias:"classname",type:"string"}),null,se);let h="";switch(o){case"midspan":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (5))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),re=a.unVersion>=4?new ee(S.findField(a.associations.fields,D.get("PERCENTALONG").name)):new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (4,6))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create(`CASE WHEN (${R}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let I=`${g}='@T'`,fe=`${T}='@T'`;d!==null&&(I+=` AND ${B}=@A`,fe+=` AND ${K}=@A`),h="(("+I+") OR ("+fe+"))",h=q(h,"@T",l??""),I=q(I,"@T",l??""),d!==null&&(I=q(I,"@A",d.toString()),h=q(h,"@A",d.toString())),P.codefield=$.create("CASE WHEN "+I+` THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const Q=ne(S.findField(a.associations.fields,T));Q.name=A,Q.alias=A,v=new U(Q,$.create("CASE WHEN "+I+` THEN ${T} ELSE ${g} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"container":h=`${g}='${l}' AND ${R} = 2`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,A);break;case"content":h=`(${T}='${l}' AND ${R} = 2)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,A);break;case"structure":h=`(${g}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,le);break;case"attached":h=`(${T}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,le);break;default:throw new c(n,m.InvalidParameter,i)}return w&&(h="1 <> 1"),new S({parentfeatureset:a.associations,adaptedFields:[new ee(S.findField(a.associations.fields,Ie)),new ee(S.findField(a.associations.fields,ge)),v,oe,P,re],extraFilter:h?$.create(h,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}):null})})},r.signatures.push({name:"featuresetbyassociation",min:2,max:6}),r.functions.groupby=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,3,3,n,i),!N(e[0]))throw new c(n,m.InvalidParameter,i);const t=await e[0].load(),o=[],s=[];let p=!1,f=[];if(C(e[1]))f.push(e[1]);else if(e[1]instanceof Z)f.push(e[1]);else if(b(e[1]))f=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);f=e[1].toArray()}for(const a of f)if(C(a)){const l=$.create(E(a),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),d=pe(l)===!0?E(a):"%%%%FIELDNAME";o.push({name:d,expression:l}),d==="%%%%FIELDNAME"&&(p=!0)}else{if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"%%%%FIELDNAME",d=a.hasField("expression")?a.field("expression"):"";if(l==="%%%%FIELDNAME"&&(p=!0),!l)throw new c(n,m.InvalidParameter,i);o.push({name:l,expression:$.create(d||l,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(f=[],C(e[2]))f.push(e[2]);else if(b(e[2]))f=e[2];else if(M(e[2]))f=e[2].toArray();else{if(!(e[2]instanceof Z))throw new c(n,m.InvalidParameter,i);f.push(e[2])}for(const a of f){if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"",d=a.hasField("statistic")?a.field("statistic"):"",w=a.hasField("expression")?a.field("expression"):"";if(!l||!d||!w)throw new c(n,m.InvalidParameter,i);s.push({name:l,statistic:d.toLowerCase(),expression:$.create(w,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const a={};for(const d of t.fields)a[d.name.toLowerCase()]=1;for(const d of o)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);for(const d of s)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);let l=0;for(const d of o)if(d.name==="%%%%FIELDNAME"){for(;a["field_"+l.toString()]===1;)l++;a["field_"+l.toString()]=1,d.name="FIELD_"+l.toString()}}for(const a of o)await ie(a.expression,r,n);for(const a of s)await ie(a.expression,r,n);return e[0].groupby(o,s)})},r.signatures.push({name:"groupby",min:3,max:3}),r.functions.distinct=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(N(e[0])){x(e,2,2,n,i);const t=await e[0].load(),o=[];let s=[];if(C(e[1]))s.push(e[1]);else if(e[1]instanceof Z)s.push(e[1]);else if(b(e[1]))s=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);s=e[1].toArray()}let p=!1;for(const f of s)if(C(f)){const a=$.create(E(f),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),l=pe(a)===!0?E(f):"%%%%FIELDNAME";o.push({name:l,expression:a}),l==="%%%%FIELDNAME"&&(p=!0)}else{if(!(f instanceof Z))throw new c(n,m.InvalidParameter,i);{const a=f.hasField("name")?f.field("name"):"%%%%FIELDNAME",l=f.hasField("expression")?f.field("expression"):"";if(a==="%%%%FIELDNAME"&&(p=!0),!a)throw new c(n,m.InvalidParameter,i);o.push({name:a,expression:$.create(l||a,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const f={};for(const l of t.fields)f[l.name.toLowerCase()]=1;for(const l of o)l.name!=="%%%%FIELDNAME"&&(f[l.name.toLowerCase()]=1);let a=0;for(const l of o)if(l.name==="%%%%FIELDNAME"){for(;f["field_"+a.toString()]===1;)a++;f["field_"+a.toString()]=1,l.name="FIELD_"+a.toString()}}for(const f of o)await ie(f.expression,r,n);return e[0].groupby(o,[])}return He(e)})},r.functions.getfeaturesetinfo=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),!N(e[0]))return null;const t=await e[0].getFeatureSetInfo();return t?Z.convertObjectToArcadeDictionary({layerId:t.layerId,layerName:t.layerName,itemId:t.itemId,serviceLayerUrl:t.serviceLayerUrl,webMapLayerId:t.webMapLayerId??null,webMapLayerTitle:t.webMapLayerTitle??null,className:null,objectClassId:null},de(n),!1,!1):null})},r.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),r.functions.filterbysubtypecode=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0])){const t=await e[0].load(),o=e[1];if(!Ne(o))throw new c(n,m.InvalidParameter,i);if(t.subtypeField){const p=$.create(`${t.subtypeField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:p})}if(t.typeIdField===null||t.typeIdField==="")throw new c(n,m.FeatureSetDoesNotHaveSubtypes,i);const s=$.create(`${t.typeIdField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:s})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"filterbysubtypecode",min:2,max:2}))}export{Rt as registerFunctions}; +import{r as Fe}from"./TimeOnly-DSMefxKy-BHvJbNji.js";import{N as Z,t as De,D as Te,l as J}from"./arcadeUtils-DpP0k7IY-C-RKTwge.js";import{w as x,h as $e,c as Y,r as N,T as c,n as m,y as C,M as E,P as xe,e as de,d as ue,D as ce,g as L,L as k,C as b,t as G,Z as M,U as Ee,f as O,ag as be,q,O as Ne}from"./languageUtils-BYxF9hRA-DnySuvAL.js";import{M as Ae,q as me,f as Le,c as _,e as Se,a as Ze,b as Ce,T as X,E as ve,N as Pe,O as Re,L as U,B as Ue,d as V,R as S,k as ee}from"./featureSetUtils-wd4FcF3A-Bjqg1VXd.js";import{n as Me}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{n as ke}from"./portalUtils-CKN9iXwH-BDO5uTJS.js";import{E as Oe,e as pe}from"./SpatialFilter-BlQBFhwz-B_LMwz1c.js";import{I as ne}from"./shared-D1w-26bA-BBIRhcUQ.js";import{r as ye,t as ze}from"./story-Doly9N9p.js";import{Z as $}from"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import te from"./FeatureLayer-BrRKw5Si-DuA2fyE_.js";import{y as W}from"./Field-C6hA1tZj-CkWoRbmp.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./main-QGPoLsvl.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./number-eRKYXfX9-bCdnHRN-.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./MD5-CHHr-oed-SuyrCYQ0.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import"./FeatureType-C9hJmS6_-CNlvn5D1.js";import"./FeatureTemplate-SPHPD45f-CZ7E6_6b.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./geometryEngineAsync-D7oEu5dd-CZIKaTd9.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import"./LRUCache-C3erQTWv-grHgYSP-.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./utils-SPbpQbmm-CiwW7WzR.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import"./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js";import"./commonProperties-BtIqvFU_-DbZji2Rx.js";import"./ElevationInfo-yv2-9tj6-CkIHeL1t.js";import"./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js";import"./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js";import"./Relationship-PyhUibYK-DN6K3ukS.js";import"./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js";import"./editsZScale-BDsX6vv--C-4n90TZ.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js";import"./ArcGISService-BYA-y6X6-DNHMEBm_.js";import"./BlendLayer-D1WkSmwP-BeUsb4u9.js";import"./jsonUtils-wIllKWI4-MQQ-E5fj.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./CustomParametersMixin-vdKsTHer-5EfrrVMH.js";import"./EditBusLayer-Df29OyJh-OmdJOLws.js";import"./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js";import"./FeatureEffect-CDEk9Es7-Cd4-I1fy.js";import"./FeatureFilter-BCFHgLVU-DwigNbnH.js";import"./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js";import"./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js";import"./labelingInfo-DGVNul26-BDBqWm17.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./OperationalLayer-B5IXiMa2-DTTV2F9z.js";import"./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js";import"./OrderByInfo-GD2XnU8e-BaEpZLaO.js";import"./PortalLayer-CElnYuSQ-CCe4TMEA.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./RefreshableLayer-a8BQ58Xh-CxfquKbp.js";import"./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js";import"./TemporalLayer-CpOrN_w9-8nvJFP_-.js";import"./TimeInfo-w_HB2CsF-B2qHZyfS.js";import"./fieldProperties-Bq26w7gt-BiKrD4ue.js";import"./versionUtils-LZYZz-38-B8C5OAjF.js";import"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import"./popupUtils-B0uZcXX0-DHyOz1jC.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./interfaces-Cwm0pihk-Ptzy6gTd.js";function He(r){if(r.length===1){if(b(r[0]))return J("distinct",r[0],-1);if(M(r[0]))return J("distinct",r[0].toArray(),-1)}return J("distinct",r,-1)}async function ie(r,n,i){const y=r.getVariables();if(y.length>0){const F=[];for(let t=0;t{if(x(e,1,2,n,i),$e(e[0])||Y(e[0]))return"Unknown";if(N(e[0])){if(await e[0].load(),e.length===1||e[1]===null)return e[0].datesInUnknownTimezone?z("unknown"):z(e[0].dateFieldsTimeZone);if(!(e[1]instanceof Z)||e[1].hasField("type")===!1)throw new c(n,m.InvalidParameter,i);const s=e[1].field("type");if(C(s)===!1)throw new c(n,m.InvalidParameter,i);switch(E(s).toLowerCase()){case"preferredtimezone":return z(e[0].preferredTimeZone);case"editfieldsinfo":return z(e[0].editFieldsInfo?.timeZone??null);case"timeinfo":return z(e[0].timeInfo?.timeZone??null);case"field":if(e[1].hasField("fieldname")&&C(e[1].field("fieldname")))return z(e[0].fieldTimeZone(E(e[1].field("fieldname"))))}throw new c(n,m.InvalidParameter,i)}const t=xe(e[0],de(n));if(t===null)return null;const o=t.timeZone;return o==="system"?Fe.systemTimeZoneCanonicalName:o.toLowerCase()==="utc"?"UTC":o.toLowerCase()==="unknown"?"Unknown":o})},r.functions.sqltimestamp=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,3,n,i);const t=e[0];if(ue(t)){if(e.length===1)return t.toSQLWithKeyword();if(e.length===2)return t.changeTimeZone(E(e[1])).toSQLWithKeyword();throw new c(n,m.InvalidParameter,i)}if(Y(t))return t.toSQLWithKeyword();if(N(t)){if(e.length!==3)throw new c(n,m.InvalidParameter,i);await t.load();const o=E(e[1]);if(Y(e[2]))return e[2].toSQLWithKeyword();if(ue(e[2])===!1)throw new c(n,m.InvalidParameter,i);const s=t.fieldTimeZone(o);return s===null?e[2].toSQLWithKeyword():e[2].changeTimeZone(s).toSQLWithKeyword()}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"sqltimestamp",min:2,max:4}),r.functions.featuresetbyid=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetById(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyid",min:2,max:4}),r.functions.getfeatureset=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,2,n,i),G(e[0])){let t=L(e[1],"datasource");return t===null&&(t="datasource"),t=E(t).toLowerCase(),Ae(e[0].fullSchema(),t,n.lrucache,n.interceptor,n.spatialReference??null)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"getfeatureset",min:1,max:2}),r.functions.featuresetbyportalitem=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,5,n,i),e[0]===null)throw new c(n,m.PortalRequired,i);if(e[0]instanceof De){const f=E(e[1]),a=E(e[2]);let l=L(e[3],null);const d=k(L(e[4],!0));if(l===null&&(l=["*"]),b(l)===!1)throw new c(n,m.InvalidParameter,i);let w;return w=n.services?.portal?n.services.portal:ye.getDefault(),w=ke(e[0],w),me(f,a,n.spatialReference??null,l,d,w,n.lrucache,n.interceptor)}if(C(e[0])===!1)throw new c(n,m.PortalRequired,i);const t=E(e[0]),o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);return me(t,o,n.spatialReference??null,s,p,n.services?.portal??ye.getDefault(),n.lrucache,n.interceptor)})},r.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),r.functions.featuresetbyname=function(n,i){return r.standardFunctionAsync(n,i,(y,F,e)=>{if(x(e,2,4,n,i),ce(e[0])){const t=E(e[1]);let o=L(e[2],null);const s=k(L(e[3],!0));if(o===null&&(o=["*"]),b(o)===!1)throw new c(n,m.InvalidParameter,i);return e[0].featureSetByName(t,s,o)}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"featuresetbyname",min:2,max:4}),r.functions.featureset=function(n,i){return r.standardFunction(n,i,(y,F,e)=>{x(e,1,1,n,i);const t={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",hasM:!1,hasZ:!1,fields:[]},featureSet:{geometryType:"",features:[]}};if(C(e[0])){const o=JSON.parse(e[0]);o.layerDefinition!==void 0?(t.layerDefinition=o.layerDefinition,t.featureSet=o.featureSet,o.layerDefinition.spatialReference&&(t.layerDefinition.spatialReference=o.layerDefinition.spatialReference)):(t.featureSet.features=o.features,t.featureSet.geometryType=o.geometryType,t.layerDefinition.geometryType=t.featureSet.geometryType,t.layerDefinition.objectIdField=o.objectIdFieldName??"",t.layerDefinition.typeIdField=o.typeIdFieldName,t.layerDefinition.globalIdField=o.globalIdFieldName,t.layerDefinition.fields=o.fields,o.spatialReference&&(t.layerDefinition.spatialReference=o.spatialReference))}else{if(!(e[0]instanceof Z))throw new c(n,m.InvalidParameter,i);{const o=JSON.parse(e[0].castToText(!0)),s=u(o,"layerdefinition");if(s!==null){t.layerDefinition.geometryType=u(s,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.globalIdField=u(s,"globalidfield",""),t.layerDefinition.objectIdField=u(s,"objectidfield",""),t.layerDefinition.typeIdField=u(s,"typeidfield",""),t.layerDefinition.hasZ=u(s,"hasz",!1)===!0,t.layerDefinition.hasM=u(s,"hasm",!1)===!0;const p=u(s,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[];for(const l of u(s,"fields",[])){const d={name:u(l,"name",""),alias:u(l,"alias",""),type:u(l,"type",""),nullable:u(l,"nullable",!0),editable:u(l,"editable",!0),length:u(l,"length",null),domain:we(u(l,"domain"))};f.push(d)}t.layerDefinition.fields=f;const a=u(o,"featureset");if(a){const l={};for(const d of f)l[d.name.toLowerCase()]=d.name;for(const d of u(a,"features",[])){const w={},D=u(d,"attributes",{});for(const g in D)w[l[g.toLowerCase()]]=D[g];t.featureSet.features.push({attributes:w,geometry:he(u(d,"geometry"))})}}}else{t.layerDefinition.hasZ=u(o,"hasz",!1)===!0,t.layerDefinition.hasM=u(o,"hasm",!1)===!0,t.layerDefinition.geometryType=u(o,"geometrytype",""),t.featureSet.geometryType=t.layerDefinition.geometryType,t.layerDefinition.objectIdField=u(o,"objectidfieldname",""),t.layerDefinition.typeIdField=u(o,"typeidfieldname","");const p=u(o,"spatialreference");p&&(t.layerDefinition.spatialReference=ae(p));const f=[],a=u(o,"fields",null);if(!b(a))throw new c(n,m.InvalidParameter,i);for(const w of a){const D={name:u(w,"name",""),alias:u(w,"alias",""),type:u(w,"type",""),nullable:u(w,"nullable",!0),editable:u(w,"editable",!0),length:u(w,"length",null),domain:we(u(w,"domain"))};f.push(D)}t.layerDefinition.fields=f;const l={};for(const w of f)l[w.name.toLowerCase()]=w.name;let d=u(o,"features",null);if(b(d))for(const w of d){const D={},g=u(w,"attributes",{});for(const T in g)D[l[T.toLowerCase()]]=g[T];t.featureSet.features.push({attributes:D,geometry:he(u(w,"geometry",null))})}else d=null,t.featureSet.features=d}}}if(We(t)===!1)throw new c(n,m.InvalidParameter,i);return t.layerDefinition.geometryType||(t.layerDefinition.geometryType="esriGeometryNull"),Le.create(t,n.spatialReference)})},r.signatures.push({name:"featureset",min:1,max:1}),r.functions.filter=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),b(e[0])||M(e[0])){const t=[];let o,s=e[0];if(s instanceof Me&&(s=s.toArray()),!Ee(e[1]))throw new c(n,m.InvalidParameter,i);o=e[1].createFunction(n);for(const p of s){const f=o(p);ze(f)?await f===!0&&t.push(p):f===!0&&t.push(p)}return t}if(N(e[0])){const t=await e[0].load(),o=$.create(e[1],{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),s=o.getVariables();if(s.length>0){const p=[];for(let a=0;a{if(x(e,2,2,n,i),N(e[0])){const t=new Se(e[1]);return new Ze({parentfeatureset:e[0],orderbyclause:t})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"orderby",min:2,max:2}),r.functions.top=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0]))return new Ce({parentfeatureset:e[0],topnum:e[1]});if(b(e[0]))return O(e[1])>=e[0].length?e[0].slice():e[0].slice(0,O(e[1]));if(M(e[0]))return O(e[1])>=e[0].length()?e[0].slice():e[0].slice(0,O(e[1]));throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"top",min:2,max:2}),r.functions.first=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),N(e[0])){const t=await e[0].first(y.abortSignal);if(t!==null){const o=Te.createFromGraphicLikeObject(t.geometry,t.attributes,e[0],n.timeZone);return o._underlyingGraphic=t,o}return t}return b(e[0])?e[0].length===0?null:e[0][0]:M(e[0])?e[0].length()===0?null:e[0].get(0):null})},r.signatures.push({name:"first",min:1,max:1}),r.functions.attachments=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,1,2,n,i);const t={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof Z){if(e[1].hasField("minsize")&&(t.minsize=O(e[1].field("minsize"))),e[1].hasField("metadata")&&(t.returnMetadata=k(e[1].field("metadata"))),e[1].hasField("maxsize")&&(t.maxsize=O(e[1].field("maxsize"))),e[1].hasField("types")){const o=be(e[1].field("types"),!1);o.length>0&&(t.types=o)}}else if(e[1]!==null)throw new c(n,m.InvalidParameter,i)}if(G(e[0])){let o=e[0]._layer;return o instanceof te&&(o=X(o,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),o===null?[]:N(o)===!1?[]:(await o.load(),o.queryAttachments(e[0].field(o.objectIdField),t.minsize,t.maxsize,t.types,t.returnMetadata))}if(e[0]===null)return[];throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"attachments",min:1,max:2}),r.functions.featuresetbyrelationshipname=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,4,n,i);const t=e[0],o=E(e[1]);let s=L(e[2],null);const p=k(L(e[3],!0));if(s===null&&(s=["*"]),b(s)===!1)throw new c(n,m.InvalidParameter,i);if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let f=t._layer;if(f instanceof te&&(f=X(f,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),f===null||N(f)===!1)return null;f=await f.load();const a=f.relationshipMetaData().filter(g=>g.name===o);if(a.length===0)return null;if(a[0].relationshipTableId!==void 0&&a[0].relationshipTableId!==null&&a[0].relationshipTableId>-1)return ve(f,a[0],t.field(f.objectIdField),f.spatialReference,s,p,n.lrucache,n.interceptor);let l=f.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+a[0].relatedTableId.toString():l+"/"+a[0].relatedTableId.toString();const d=await Pe(l,f.spatialReference,s,p,n.lrucache,n.interceptor);await d.load();let w=d.relationshipMetaData();if(w=w.filter(g=>g.id===a[0].id),t.hasField(a[0].keyField)===!1||t.field(a[0].keyField)===null){const g=await f.getFeatureByObjectId(t.field(f.objectIdField),[a[0].keyField]);if(g){const T=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return T.parameters={id:g.attributes[a[0].keyField]},d.filter(T)}return new Oe({parentfeatureset:d})}const D=$.create(w[0].keyField+"= @id",{fieldsIndex:d.getFieldsIndex(),timeZone:d.dateFieldsTimeZoneDefaultUTC});return D.parameters={id:t.field(a[0].keyField)},d.filter(D)})},r.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),r.functions.featuresetbyassociation=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{x(e,2,3,n,i);const t=e[0],o=E(L(e[1],"")).toLowerCase(),s=C(e[2])?E(e[2]):null;if(e[0]===null)return null;if(!G(e[0]))throw new c(n,m.InvalidParameter,i);let p=t._layer;if(p instanceof te&&(p=X(p,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),p===null||N(p)===!1)return null;await p.load();const f=p.serviceUrl(),a=await Re(f,n.spatialReference);let l=null,d=null,w=!1;if(s!==null&&s!==""&&s!==void 0){for(const I of a.terminals)I.terminalName===s&&(d=I.terminalId);d===null&&(w=!0)}const D=a.associations.getFieldsIndex(),g=D.get("TOGLOBALID").name,T=D.get("FROMGLOBALID").name,B=D.get("TOTERMINALID").name,K=D.get("FROMTERMINALID").name,H=D.get("FROMNETWORKSOURCEID").name,j=D.get("TONETWORKSOURCEID").name,R=D.get("ASSOCIATIONTYPE").name,ge=D.get("ISCONTENTVISIBLE").name,Ie=D.get("OBJECTID").name;for(const I of p.fields)if(I.type==="global-id"){l=t.field(I.name);break}let v=null,re=new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create("''",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));const A="globalid",le="globalId",se={};for(const I in a.lkp)se[I]=a.lkp[I].sourceId;const P=new Ue(new W({name:"classname",alias:"classname",type:"string"}),null,se);let h="";switch(o){case"midspan":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (5))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),re=a.unVersion>=4?new ee(S.findField(a.associations.fields,D.get("PERCENTALONG").name)):new U(new W({name:"percentalong",alias:"percentalong",type:"double"}),$.create("0",{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"junctionedge":{h=`((${g}='${l}') OR ( ${T}='${l}')) AND (${R} IN (4,6))`,P.codefield=$.create(`CASE WHEN (${g}='${l}') THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const I=ne(S.findField(a.associations.fields,T));I.name=A,I.alias=A,v=new U(I,$.create(`CASE WHEN (${T}='${l}') THEN ${g} ELSE ${T} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC})),oe=new U(new W({name:"side",alias:"side",type:"string"}),$.create(`CASE WHEN (${R}=4) THEN 'from' ELSE 'to' END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"connected":{let I=`${g}='@T'`,fe=`${T}='@T'`;d!==null&&(I+=` AND ${B}=@A`,fe+=` AND ${K}=@A`),h="(("+I+") OR ("+fe+"))",h=q(h,"@T",l??""),I=q(I,"@T",l??""),d!==null&&(I=q(I,"@A",d.toString()),h=q(h,"@A",d.toString())),P.codefield=$.create("CASE WHEN "+I+` THEN ${H} ELSE ${j} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC});const Q=ne(S.findField(a.associations.fields,T));Q.name=A,Q.alias=A,v=new U(Q,$.create("CASE WHEN "+I+` THEN ${T} ELSE ${g} END`,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}));break}case"container":h=`${g}='${l}' AND ${R} = 2`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,A);break;case"content":h=`(${T}='${l}' AND ${R} = 2)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,A);break;case"structure":h=`(${g}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${B} = `+d.toString()),P.codefield=H,h="( "+h+" )",v=new V(S.findField(a.associations.fields,T),A,le);break;case"attached":h=`(${T}='${l}' AND ${R} = 3)`,d!==null&&(h+=` AND ${K} = `+d.toString()),P.codefield=j,h="( "+h+" )",v=new V(S.findField(a.associations.fields,g),A,le);break;default:throw new c(n,m.InvalidParameter,i)}return w&&(h="1 <> 1"),new S({parentfeatureset:a.associations,adaptedFields:[new ee(S.findField(a.associations.fields,Ie)),new ee(S.findField(a.associations.fields,ge)),v,oe,P,re],extraFilter:h?$.create(h,{fieldsIndex:a.associations.getFieldsIndex(),timeZone:a.associations.dateFieldsTimeZoneDefaultUTC}):null})})},r.signatures.push({name:"featuresetbyassociation",min:2,max:6}),r.functions.groupby=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,3,3,n,i),!N(e[0]))throw new c(n,m.InvalidParameter,i);const t=await e[0].load(),o=[],s=[];let p=!1,f=[];if(C(e[1]))f.push(e[1]);else if(e[1]instanceof Z)f.push(e[1]);else if(b(e[1]))f=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);f=e[1].toArray()}for(const a of f)if(C(a)){const l=$.create(E(a),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),d=pe(l)===!0?E(a):"%%%%FIELDNAME";o.push({name:d,expression:l}),d==="%%%%FIELDNAME"&&(p=!0)}else{if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"%%%%FIELDNAME",d=a.hasField("expression")?a.field("expression"):"";if(l==="%%%%FIELDNAME"&&(p=!0),!l)throw new c(n,m.InvalidParameter,i);o.push({name:l,expression:$.create(d||l,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(f=[],C(e[2]))f.push(e[2]);else if(b(e[2]))f=e[2];else if(M(e[2]))f=e[2].toArray();else{if(!(e[2]instanceof Z))throw new c(n,m.InvalidParameter,i);f.push(e[2])}for(const a of f){if(!(a instanceof Z))throw new c(n,m.InvalidParameter,i);{const l=a.hasField("name")?a.field("name"):"",d=a.hasField("statistic")?a.field("statistic"):"",w=a.hasField("expression")?a.field("expression"):"";if(!l||!d||!w)throw new c(n,m.InvalidParameter,i);s.push({name:l,statistic:d.toLowerCase(),expression:$.create(w,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const a={};for(const d of t.fields)a[d.name.toLowerCase()]=1;for(const d of o)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);for(const d of s)d.name!=="%%%%FIELDNAME"&&(a[d.name.toLowerCase()]=1);let l=0;for(const d of o)if(d.name==="%%%%FIELDNAME"){for(;a["field_"+l.toString()]===1;)l++;a["field_"+l.toString()]=1,d.name="FIELD_"+l.toString()}}for(const a of o)await ie(a.expression,r,n);for(const a of s)await ie(a.expression,r,n);return e[0].groupby(o,s)})},r.signatures.push({name:"groupby",min:3,max:3}),r.functions.distinct=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(N(e[0])){x(e,2,2,n,i);const t=await e[0].load(),o=[];let s=[];if(C(e[1]))s.push(e[1]);else if(e[1]instanceof Z)s.push(e[1]);else if(b(e[1]))s=e[1];else{if(!M(e[1]))throw new c(n,m.InvalidParameter,i);s=e[1].toArray()}let p=!1;for(const f of s)if(C(f)){const a=$.create(E(f),{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC}),l=pe(a)===!0?E(f):"%%%%FIELDNAME";o.push({name:l,expression:a}),l==="%%%%FIELDNAME"&&(p=!0)}else{if(!(f instanceof Z))throw new c(n,m.InvalidParameter,i);{const a=f.hasField("name")?f.field("name"):"%%%%FIELDNAME",l=f.hasField("expression")?f.field("expression"):"";if(a==="%%%%FIELDNAME"&&(p=!0),!a)throw new c(n,m.InvalidParameter,i);o.push({name:a,expression:$.create(l||a,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC})})}}if(p){const f={};for(const l of t.fields)f[l.name.toLowerCase()]=1;for(const l of o)l.name!=="%%%%FIELDNAME"&&(f[l.name.toLowerCase()]=1);let a=0;for(const l of o)if(l.name==="%%%%FIELDNAME"){for(;f["field_"+a.toString()]===1;)a++;f["field_"+a.toString()]=1,l.name="FIELD_"+a.toString()}}for(const f of o)await ie(f.expression,r,n);return e[0].groupby(o,[])}return He(e)})},r.functions.getfeaturesetinfo=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,1,1,n,i),!N(e[0]))return null;const t=await e[0].getFeatureSetInfo();return t?Z.convertObjectToArcadeDictionary({layerId:t.layerId,layerName:t.layerName,itemId:t.itemId,serviceLayerUrl:t.serviceLayerUrl,webMapLayerId:t.webMapLayerId??null,webMapLayerTitle:t.webMapLayerTitle??null,className:null,objectClassId:null},de(n),!1,!1):null})},r.signatures.push({name:"getfeaturesetinfo",min:1,max:1}),r.functions.filterbysubtypecode=function(n,i){return r.standardFunctionAsync(n,i,async(y,F,e)=>{if(x(e,2,2,n,i),N(e[0])){const t=await e[0].load(),o=e[1];if(!Ne(o))throw new c(n,m.InvalidParameter,i);if(t.subtypeField){const p=$.create(`${t.subtypeField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:p})}if(t.typeIdField===null||t.typeIdField==="")throw new c(n,m.FeatureSetDoesNotHaveSubtypes,i);const s=$.create(`${t.typeIdField}= ${e[1]}`,{fieldsIndex:t.getFieldsIndex(),timeZone:t.dateFieldsTimeZoneDefaultUTC});return new _({parentfeatureset:e[0],whereclause:s})}throw new c(n,m.InvalidParameter,i)})},r.signatures.push({name:"filterbysubtypecode",min:2,max:2}))}export{Rt as registerFunctions}; diff --git a/custom-toc-highlight/assets/featuresetgeom-BftbGgg3-DE0snMCi.js b/custom-toc-highlight/assets/featuresetgeom-BftbGgg3-BLGpCbU5.js similarity index 74% rename from custom-toc-highlight/assets/featuresetgeom-BftbGgg3-DE0snMCi.js rename to custom-toc-highlight/assets/featuresetgeom-BftbGgg3-BLGpCbU5.js index 98399bfa..df2111a8 100644 --- a/custom-toc-highlight/assets/featuresetgeom-BftbGgg3-DE0snMCi.js +++ b/custom-toc-highlight/assets/featuresetgeom-BftbGgg3-BLGpCbU5.js @@ -1 +1 @@ -import{J as S,w as R,M as p,r as a,T as u,n as l}from"./languageUtils-BYxF9hRA-BBstOXAc.js";import{Y as d}from"./TimeOnly-DSMefxKy-BU7RNYWc.js";import{E as c,I as w}from"./SpatialFilter-BlQBFhwz-BhB6yT4Z.js";import{d as o}from"./story-BfX8CRfG.js";import{relate as y,crosses as I,touches as F,within as A,overlaps as C,contains as P,intersects as h}from"./geometryEngineAsync-D7oEu5dd-B6AE24vD.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-B8KlJvO_.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./main-ugzBrWNm.js";import"./number-eRKYXfX9-eI8aiR_7.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./arcadeUtils-DpP0k7IY-BXaTThTL.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./WhereClause-DxwoyBMS-DnXKVpm2.js";import"./workers-PiCjreoO-idkDTJa3.js";function f(n){return n instanceof o}function s(n,t,i,m){return m(n,t,async(v,e,r)=>{if(r.length<2)throw new u(n,l.WrongNumberOfParameters,t);if((r=S(r))[0]===null&&r[1]===null)return!1;if(a(r[0])){if(r[1]instanceof o)return new w({parentfeatureset:r[0],relation:i,relationGeom:r[1]});if(r[1]===null)return new c({parentfeatureset:r[0]});throw new u(n,l.InvalidParameter,t)}if(f(r[0])){if(f(r[1])){switch(i){case"esriSpatialRelEnvelopeIntersects":return h(d(r[0]),d(r[1]));case"esriSpatialRelIntersects":return h(r[0],r[1]);case"esriSpatialRelContains":return P(r[0],r[1]);case"esriSpatialRelOverlaps":return C(r[0],r[1]);case"esriSpatialRelWithin":return A(r[0],r[1]);case"esriSpatialRelTouches":return F(r[0],r[1]);case"esriSpatialRelCrosses":return I(r[0],r[1])}throw new u(n,l.InvalidParameter,t)}if(a(r[1]))return new w({parentfeatureset:r[1],relation:i,relationGeom:r[0]});if(r[1]===null)return!1;throw new u(n,l.InvalidParameter,t)}if(r[0]===null){if(a(r[1]))return new c({parentfeatureset:r[1]});if(r[1]instanceof o||r[1]===null)return!1}throw new u(n,l.InvalidParameter,t)})}function Q(n){n.mode==="async"&&(n.functions.intersects=function(t,i){return s(t,i,"esriSpatialRelIntersects",n.standardFunctionAsync)},n.functions.envelopeintersects=function(t,i){return s(t,i,"esriSpatialRelEnvelopeIntersects",n.standardFunctionAsync)},n.signatures.push({name:"envelopeintersects",min:2,max:2}),n.functions.contains=function(t,i){return s(t,i,"esriSpatialRelContains",n.standardFunctionAsync)},n.functions.overlaps=function(t,i){return s(t,i,"esriSpatialRelOverlaps",n.standardFunctionAsync)},n.functions.within=function(t,i){return s(t,i,"esriSpatialRelWithin",n.standardFunctionAsync)},n.functions.touches=function(t,i){return s(t,i,"esriSpatialRelTouches",n.standardFunctionAsync)},n.functions.crosses=function(t,i){return s(t,i,"esriSpatialRelCrosses",n.standardFunctionAsync)},n.functions.relate=function(t,i){return n.standardFunctionAsync(t,i,async(m,v,e)=>{if(e=S(e),R(e,3,3,t,i),f(e[0])&&f(e[1]))return y(e[0],e[1],p(e[2]));if(e[0]instanceof o&&e[1]===null||e[1]instanceof o&&e[0]===null)return!1;if(a(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(a(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(a(e[0])&&e[1]instanceof o)return e[0].relate(e[1],p(e[2]));if(a(e[1])&&e[0]instanceof o)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new u(t,l.InvalidParameter,i)})})}export{Q as registerFunctions}; +import{J as S,w as R,M as p,r as a,T as u,n as l}from"./languageUtils-BYxF9hRA-DnySuvAL.js";import{Y as d}from"./TimeOnly-DSMefxKy-BHvJbNji.js";import{E as c,I as w}from"./SpatialFilter-BlQBFhwz-B_LMwz1c.js";import{d as o}from"./story-Doly9N9p.js";import{relate as y,crosses as I,touches as F,within as A,overlaps as C,contains as P,intersects as h}from"./geometryEngineAsync-D7oEu5dd-CZIKaTd9.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BBIRhcUQ.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./main-QGPoLsvl.js";import"./number-eRKYXfX9-bCdnHRN-.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./arcadeUtils-DpP0k7IY-C-RKTwge.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";function f(n){return n instanceof o}function s(n,t,i,m){return m(n,t,async(v,e,r)=>{if(r.length<2)throw new u(n,l.WrongNumberOfParameters,t);if((r=S(r))[0]===null&&r[1]===null)return!1;if(a(r[0])){if(r[1]instanceof o)return new w({parentfeatureset:r[0],relation:i,relationGeom:r[1]});if(r[1]===null)return new c({parentfeatureset:r[0]});throw new u(n,l.InvalidParameter,t)}if(f(r[0])){if(f(r[1])){switch(i){case"esriSpatialRelEnvelopeIntersects":return h(d(r[0]),d(r[1]));case"esriSpatialRelIntersects":return h(r[0],r[1]);case"esriSpatialRelContains":return P(r[0],r[1]);case"esriSpatialRelOverlaps":return C(r[0],r[1]);case"esriSpatialRelWithin":return A(r[0],r[1]);case"esriSpatialRelTouches":return F(r[0],r[1]);case"esriSpatialRelCrosses":return I(r[0],r[1])}throw new u(n,l.InvalidParameter,t)}if(a(r[1]))return new w({parentfeatureset:r[1],relation:i,relationGeom:r[0]});if(r[1]===null)return!1;throw new u(n,l.InvalidParameter,t)}if(r[0]===null){if(a(r[1]))return new c({parentfeatureset:r[1]});if(r[1]instanceof o||r[1]===null)return!1}throw new u(n,l.InvalidParameter,t)})}function Q(n){n.mode==="async"&&(n.functions.intersects=function(t,i){return s(t,i,"esriSpatialRelIntersects",n.standardFunctionAsync)},n.functions.envelopeintersects=function(t,i){return s(t,i,"esriSpatialRelEnvelopeIntersects",n.standardFunctionAsync)},n.signatures.push({name:"envelopeintersects",min:2,max:2}),n.functions.contains=function(t,i){return s(t,i,"esriSpatialRelContains",n.standardFunctionAsync)},n.functions.overlaps=function(t,i){return s(t,i,"esriSpatialRelOverlaps",n.standardFunctionAsync)},n.functions.within=function(t,i){return s(t,i,"esriSpatialRelWithin",n.standardFunctionAsync)},n.functions.touches=function(t,i){return s(t,i,"esriSpatialRelTouches",n.standardFunctionAsync)},n.functions.crosses=function(t,i){return s(t,i,"esriSpatialRelCrosses",n.standardFunctionAsync)},n.functions.relate=function(t,i){return n.standardFunctionAsync(t,i,async(m,v,e)=>{if(e=S(e),R(e,3,3,t,i),f(e[0])&&f(e[1]))return y(e[0],e[1],p(e[2]));if(e[0]instanceof o&&e[1]===null||e[1]instanceof o&&e[0]===null)return!1;if(a(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(a(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(a(e[0])&&e[1]instanceof o)return e[0].relate(e[1],p(e[2]));if(a(e[1])&&e[0]instanceof o)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new u(t,l.InvalidParameter,i)})})}export{Q as registerFunctions}; diff --git a/custom-toc-highlight/assets/featuresetstats-CY6YJ8Jt-BoMAU3Jh.js b/custom-toc-highlight/assets/featuresetstats-CY6YJ8Jt-BEjsGFcp.js similarity index 76% rename from custom-toc-highlight/assets/featuresetstats-CY6YJ8Jt-BoMAU3Jh.js rename to custom-toc-highlight/assets/featuresetstats-CY6YJ8Jt-BEjsGFcp.js index 912344ec..c4cab567 100644 --- a/custom-toc-highlight/assets/featuresetstats-CY6YJ8Jt-BoMAU3Jh.js +++ b/custom-toc-highlight/assets/featuresetstats-CY6YJ8Jt-BEjsGFcp.js @@ -1 +1 @@ -import{r as l}from"./TimeOnly-DSMefxKy-BU7RNYWc.js";import{w as A,r as f,C as m,y as w,Z as d,T as h,n as S,g as c,e as v}from"./languageUtils-BYxF9hRA-BBstOXAc.js";import{l as u}from"./arcadeUtils-DpP0k7IY-BXaTThTL.js";import{Z as p,r as x}from"./WhereClause-DxwoyBMS-DnXKVpm2.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-B8KlJvO_.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./number-eRKYXfX9-eI8aiR_7.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";async function s(n,r,t,i){if(t.length===1){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1))}else if(t.length===2){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1));if(f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}}else if(t.length===3&&f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}return u(n,t,-1)}function g(n,r){return r instanceof x?l.fromReaderAsTimeStampOffset(r.toStorageFormat()):r instanceof Date?l.dateJSAndZoneToArcadeDate(r,v(n)):r}async function y(n,r,t){const i=n.getVariables();if(i.length>0){const o=[];for(let e=0;es("stdev",r,a,n))},n.functions.variance=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("variance",r,a,n))},n.functions.average=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.mean=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.sum=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("sum",r,a,n))},n.functions.min=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("min",r,a,n))},n.functions.max=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("max",r,a,n))},n.functions.count=function(r,t){return n.standardFunctionAsync(r,t,async(i,o,a)=>{if(A(a,1,1,r,t),f(a[0]))return a[0].count(i.abortSignal);if(m(a[0])||w(a[0]))return a[0].length;if(d(a[0]))return a[0].length();throw new h(r,S.InvalidParameter,t)})})}export{G as registerFunctions}; +import{r as l}from"./TimeOnly-DSMefxKy-BHvJbNji.js";import{w as A,r as f,C as m,y as w,Z as d,T as h,n as S,g as c,e as v}from"./languageUtils-BYxF9hRA-DnySuvAL.js";import{l as u}from"./arcadeUtils-DpP0k7IY-C-RKTwge.js";import{Z as p,r as x}from"./WhereClause-DxwoyBMS-Cwdb_WC4.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./shared-D1w-26bA-BBIRhcUQ.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./number-eRKYXfX9-bCdnHRN-.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";async function s(n,r,t,i){if(t.length===1){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1))}else if(t.length===2){if(m(t[0]))return u(n,t[0],c(t[1],-1));if(d(t[0]))return u(n,t[0].toArray(),c(t[1],-1));if(f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}}else if(t.length===3&&f(t[0])){const o=await t[0].load(),a=await y(p.create(t[1],{fieldsIndex:o.getFieldsIndex(),timeZone:o.dateFieldsTimeZoneDefaultUTC}),i,r);return g(r,await t[0].calculateStatistic(n,a,c(t[2],1e3),r.abortSignal))}return u(n,t,-1)}function g(n,r){return r instanceof x?l.fromReaderAsTimeStampOffset(r.toStorageFormat()):r instanceof Date?l.dateJSAndZoneToArcadeDate(r,v(n)):r}async function y(n,r,t){const i=n.getVariables();if(i.length>0){const o=[];for(let e=0;es("stdev",r,a,n))},n.functions.variance=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("variance",r,a,n))},n.functions.average=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.mean=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("mean",r,a,n))},n.functions.sum=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("sum",r,a,n))},n.functions.min=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("min",r,a,n))},n.functions.max=function(r,t){return n.standardFunctionAsync(r,t,(i,o,a)=>s("max",r,a,n))},n.functions.count=function(r,t){return n.standardFunctionAsync(r,t,async(i,o,a)=>{if(A(a,1,1,r,t),f(a[0]))return a[0].count(i.abortSignal);if(m(a[0])||w(a[0]))return a[0].length;if(d(a[0]))return a[0].length();throw new h(r,S.InvalidParameter,t)})})}export{G as registerFunctions}; diff --git a/custom-toc-highlight/assets/featuresetstring-DFELZWNA-CM9MGIid.js b/custom-toc-highlight/assets/featuresetstring-DFELZWNA-DaxbyWAc.js similarity index 80% rename from custom-toc-highlight/assets/featuresetstring-DFELZWNA-CM9MGIid.js rename to custom-toc-highlight/assets/featuresetstring-DFELZWNA-DaxbyWAc.js index c312df31..af7cb7ff 100644 --- a/custom-toc-highlight/assets/featuresetstring-DFELZWNA-CM9MGIid.js +++ b/custom-toc-highlight/assets/featuresetstring-DFELZWNA-DaxbyWAc.js @@ -1 +1 @@ -import{N as l}from"./arcadeUtils-DpP0k7IY-BXaTThTL.js";import{w as a,t as m,W as T,M as f,r as c,ah as y,T as d,n as u,$ as h,e as p,Q as b,ai as A,X as g,aj as x,g as j,u as F,x as V}from"./languageUtils-BYxF9hRA-BBstOXAc.js";import{M as v}from"./shared-D1w-26bA-B8KlJvO_.js";import"./main-ugzBrWNm.js";import"./story-BfX8CRfG.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./number-eRKYXfX9-eI8aiR_7.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";function w(i,t){return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?l.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:v[i.field.type],codedValues:i.domain.codedValues.map(e=>({name:e.name,code:e.code}))},p(t)):l.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:v[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},p(t)):null}function E(i){i.mode==="async"&&(i.functions.domain=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,3,t,e),m(n[0]))return w(T(n[0],f(n[1]),n[2]===void 0?void 0:n[2]),t);if(c(n[0]))return await n[0]._ensureLoaded(),w(y(f(n[1]),n[0],null,n[2]===void 0?void 0:n[2]),t);throw new d(t,u.InvalidParameter,e)})},i.functions.subtypes=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0])){const r=h(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypeMetaData();return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})},i.functions.domainname=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return b(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return A(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domainname",min:2,max:4}),i.functions.domaincode=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return g(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return x(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domaincode",min:2,max:4}),i.functions.text=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,2,t,e),c(n[0])){const r=j(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",o.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",o.abortSignal);throw new d(t,u.InvalidParameter,e)}return F(n[0],n[1])})},i.functions.gdbversion=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new d(t,u.InvalidParameter,e)})},i.functions.schema=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),c(n[0]))return await n[0].load(),l.convertObjectToArcadeDictionary(n[0].schema(),p(t));if(m(n[0])){const r=V(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})})}export{E as registerFunctions}; +import{N as l}from"./arcadeUtils-DpP0k7IY-C-RKTwge.js";import{w as a,t as m,W as T,M as f,r as c,ah as y,T as d,n as u,$ as h,e as p,Q as b,ai as A,X as g,aj as x,g as j,u as F,x as V}from"./languageUtils-BYxF9hRA-DnySuvAL.js";import{M as v}from"./shared-D1w-26bA-BBIRhcUQ.js";import"./main-QGPoLsvl.js";import"./story-Doly9N9p.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./number-eRKYXfX9-bCdnHRN-.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";function w(i,t){return i&&i.domain?i.domain.type==="coded-value"||i.domain.type==="codedValue"?l.convertObjectToArcadeDictionary({type:"codedValue",name:i.domain.name,dataType:v[i.field.type],codedValues:i.domain.codedValues.map(e=>({name:e.name,code:e.code}))},p(t)):l.convertObjectToArcadeDictionary({type:"range",name:i.domain.name,dataType:v[i.field.type],min:i.domain.minValue,max:i.domain.maxValue},p(t)):null}function E(i){i.mode==="async"&&(i.functions.domain=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,3,t,e),m(n[0]))return w(T(n[0],f(n[1]),n[2]===void 0?void 0:n[2]),t);if(c(n[0]))return await n[0]._ensureLoaded(),w(y(f(n[1]),n[0],null,n[2]===void 0?void 0:n[2]),t);throw new d(t,u.InvalidParameter,e)})},i.functions.subtypes=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0])){const r=h(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypeMetaData();return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})},i.functions.domainname=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return b(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return A(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domainname",min:2,max:4}),i.functions.domaincode=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,2,4,t,e),m(n[0]))return g(n[0],f(n[1]),n[2],n[3]===void 0?void 0:n[3]);if(c(n[0])){await n[0]._ensureLoaded();const r=y(f(n[1]),n[0],null,n[3]===void 0?void 0:n[3]);return x(r,n[2])}throw new d(t,u.InvalidParameter,e)})},i.signatures.push({name:"domaincode",min:2,max:4}),i.functions.text=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,2,t,e),c(n[0])){const r=j(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",o.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",o.abortSignal);throw new d(t,u.InvalidParameter,e)}return F(n[0],n[1])})},i.functions.gdbversion=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),m(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new d(t,u.InvalidParameter,e)})},i.functions.schema=function(t,e){return i.standardFunctionAsync(t,e,async(o,s,n)=>{if(a(n,1,1,t,e),c(n[0]))return await n[0].load(),l.convertObjectToArcadeDictionary(n[0].schema(),p(t));if(m(n[0])){const r=V(n[0]);return r?l.convertObjectToArcadeDictionary(r,p(t)):null}throw new d(t,u.InvalidParameter,e)})})}export{E as registerFunctions}; diff --git a/custom-toc-highlight/assets/fetchService-DbaKmJhP-W7rGyykJ.js b/custom-toc-highlight/assets/fetchService-DbaKmJhP-Ccg-phWf.js similarity index 50% rename from custom-toc-highlight/assets/fetchService-DbaKmJhP-W7rGyykJ.js rename to custom-toc-highlight/assets/fetchService-DbaKmJhP-Ccg-phWf.js index 7610372c..1cb8ff13 100644 --- a/custom-toc-highlight/assets/fetchService-DbaKmJhP-W7rGyykJ.js +++ b/custom-toc-highlight/assets/fetchService-DbaKmJhP-Ccg-phWf.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BingMapsLayer-BigMnKl_-CZ_oLWcb.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./MultiOriginJSONSupport-DKRh9P6w-BmqJtpg1.js","./Layer-ChoECxvZ-CQTFmFQa.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./BlendLayer-D1WkSmwP-Bad8_eoW.js","./jsonUtils-wIllKWI4-DrGIvCCq.js","./parser-DyDJ-rlI-C9jRH52J.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-DVqdGrVU.js","./common-CYWrYyJl-E8-sukrT.js","./RefreshableLayer-a8BQ58Xh-D1Kebw4J.js","./commonProperties-BtIqvFU_-DVH0kGN9.js","./ElevationInfo-yv2-9tj6-C2hC6Vpl.js","./lengthUtils-DKpMe5qR-C2NPRwwl.js","./ScaleRangeLayer-Bz0DcnvM-DZW8yVWp.js","./imageBitmapUtils-DA36kg39-CZPhYtU7.js","./TileInfo-CWIRDhZl-BkCC-9e9.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./OperationalLayer-B5IXiMa2-9OHGXI1g.js","./BuildingSceneLayer-IIePcdNz-52pkRQg3.js","./CollectionFlattener-DkHuHn5E-BKutaakg.js","./loadAll-e978YItg-CdtGGDtb.js","./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js","./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js","./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js","./colorRamps-q0bZVhs2-DQZn2xZS.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-23qzp7zg.js","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./styleUtils-BtpNqZyT-D2Hj1Rgz.js","./jsonUtils-C64Zfu7c-CitE8NjK.js","./LRUCache-C3erQTWv-0wD6drRf.js","./Version-CoKzbupV-9-gg6ENz.js","./FieldsIndex-HmzMbJQG-DZuFWLvd.js","./UnknownTimeZone-C--TOcPG-D3CAoWPX.js","./OverrideHelper-DWRbVlj1-BZq72sbX.js","./colorUtils-Cthpxcks-ZRnr1H1b.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-B3hR8LxB.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-B-lEhyoX.js","./heatmapUtils-seiMkkkR-Cj1KmweL.js","./FeatureLayer-BrRKw5Si-D6Z5CL70.js","./FeatureLayerBase-vvYyZTfh-j6CuO_ok.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./HeightModelInfo-C5vFqzyF-CupKpfDx.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./featureLayerUtils-DgfQQyK4-Ba-CbhYv.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-DoFNfkjX.js","./RelationshipQuery-DJsz3K0U-yAwL-qLW.js","./LayerFloorInfo-DRJ8wfwx-JhB5TQoy.js","./Relationship-PyhUibYK-BgFx3_5x.js","./serviceCapabilitiesUtils-rPjN5QBe-D8SbLb58.js","./workers-PiCjreoO-idkDTJa3.js","./editsZScale-BDsX6vv--CttUpViY.js","./queryZScale-BiYV6Pr6-B5UMbu5B.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./FeatureSet-BkVNthuN-CwS44--W.js","./APIKeyMixin-BUMSx9ny-D_H-H5sI.js","./ArcGISService-BYA-y6X6-C_YhndKK.js","./CustomParametersMixin-vdKsTHer-BOFVTNLw.js","./EditBusLayer-Df29OyJh-DkVkxUAl.js","./FeatureEffectLayer-Cro89IEC-DNMQ4wnv.js","./FeatureEffect-CDEk9Es7-CEiHf7-6.js","./FeatureFilter-BCFHgLVU-CXZvxasm.js","./FeatureReductionLayer-BTZjL0_Z-BI4dLtY8.js","./FeatureReductionSelection-BjX3h7Sz-AQOxSofI.js","./labelingInfo-DGVNul26-zkvIaBlq.js","./labelUtils-BW14kBqX-BkXd4VJn.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OrderedLayer-6Qsmrd_l-BG3Yganz.js","./OrderByInfo-GD2XnU8e-NtCi3yT-.js","./PortalLayer-CElnYuSQ-DvpreqYV.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./portalItemUtils-B8bw6SAG-CuS3mZw4.js","./TemporalLayer-CpOrN_w9-BDEJ3v2O.js","./TimeInfo-w_HB2CsF-CZutzBPZ.js","./FeatureTemplate-SPHPD45f-DFBQobBO.js","./FeatureType-C9hJmS6_-BXWT6QCe.js","./fieldProperties-Bq26w7gt-CFQbsGDX.js","./versionUtils-LZYZz-38-DxOZEoAg.js","./styleUtils-ChrJTYIw-BfDrXrWd.js","./popupUtils-B0uZcXX0-DtBp-byj.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./SceneService-BZqGtWmG-BWCHkX1O.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./jsonContext-BA8GHqVk-CWQlLGSw.js","./resourceUtils-BmW6QqlX-B1DAUGNs.js","./resourceUtils-rTM6Iemx-BROWZCZ1.js","./saveUtils-CIYk-dsQ-VGcOewby.js","./I3SLayerDefinitions-CwLXCKtU-CvmIU1C5.js","./I3SUtil-Bq8KpP2j-BW-Cczln.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./vec32-D9GsKZ1t-BjayBdwt.js","./projectVectorToVector-sIYLNlex-B_PqSyiH.js","./projectPointToVector-B2UUY9SE-BChPjj6-.js","./sphere-BenPORjV-DaZ5Vv8x.js","./mat3-CC4Foazl-BWjyqE2v.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./plane-Dt8R0KeE-CVSP2GQG.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./I3SBinaryReader-DEbI3cKZ-Bdob26G6.js","./VertexAttribute-DqD5S0a2-3q90nikV.js","./floatRGBA-4pIJN00G-BsIUaPaZ.js","./NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./BindType-9iOk18Ed-CRW1cdX4.js","./orientedBoundingBox-oHezdpWm-BCiifXla.js","./quat-BODLR7mS-BrXZAXDf.js","./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js","./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./popupUtils-nV1O8RUO-DAL58cHP.js","./associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js","./elevationInfoUtils-mOZsPH2J-If61I1du.js","./CSVLayer-CJQy-BsL-BUdGsKHu.js","./clientSideDefaults-BqqayPct-B-0mBem3.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./CatalogLayer-BeO1fLsl-idS3vnNO.js","./ReactiveMap-CFk6jPfN-Du1XE-2a.js","./signal-CETehA7D-DhpyJ8yp.js","./utils-tNxq3jkf-B78XlSIE.js","./ClassBreaksDefinition-bYRgYgPp-BeJWsoeO.js","./FeatureLayerSource-k4WMYop1-BFUwA-tw.js","./MeshLocalVertexSpace-BqgocsoS-Dycut332.js","./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js","./External-D_wl4XAw-P7VLSnKi.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-DoQndDth.js","./editingSupport-gUqP9iyf-BcQn3A1C.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-9sQxfkoa-KicvrT8N.js","./utils-Bq23Xwmj--_SaacS5.js","./QueryTask-CwHwH2rS-B8khefoW.js","./executeForIds-Z1gkLduF-D8DZG8qZ.js","./query-DFW9-NG_-gbjlxRZk.js","./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js","./pbf-D-y3_eZO-DQKnyfOm.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./executeQueryPBF-o8010HS9-BgTBXvCY.js","./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js","./executeQueryJSON-CcHnccia-BW7_NQxl.js","./DimensionLayer-DFh7fPYo-D38O23av.js","./Analysis-BPgJ-FCw-D6W8PmkR.js","./Cyclical-C_9rKUUQ-Dl9v9oo8.js","./ElevationLayer-G6y-P-jo-Dn65xXOv.js","./ArcGISCachedService-C64Ko1TY-9EmQxNmS.js","./TileInfoTilemapCache-D1SExPij-BhR83GZf.js","./TilemapCache-CRRxws77-BBkZHUXn.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./GeoJSONLayer-BFFwDRph-DcfWJyiN.js","./GeoRSSLayer-DgF8xnYi-BcGrr8g_.js","./GroupLayer-ER-XzoYr-LPsQSYf2.js","./TablesMixin-C8RojhYs-AdFcW_TR.js","./writeUtils-D5qlLkwk-xd5TEmf9.js","./ImageryLayer-B-bJb8lU-DAjXPfZr.js","./RasterPresetRendererMixin-D6W9pUY6-DKpsAOdT.js","./multidimensionalUtils-BwTugeu7-BTG9Of02.js","./dataUtils-BkPy4R3C-Cb9EIxnj.js","./RasterSymbolizer-BVys6HkM-BrCOeMHl.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./utils-DPtQ14k3-CAwuJg76.js","./cimSymbolUtils-CKIzBgMU-1dGx6jKJ.js","./ImageryTileLayer-DixyNESc-DnXgKCIh.js","./RawBlockCache-Cj_tmHDm-CHpXSnmO.js","./rasterProjectionHelper-Calp0o_1-DktPwJyi.js","./QueueProcessor-DbfV9fLy-CxiRQqTa.js","./PolynomialTransform-C3nWCu0l-CtkqeHeV.js","./IntegratedMesh3DTilesLayer-BEcgXCkk-v3TYApnj.js","./IntegratedMeshLayer-C-XaBbXd-Bw4BDqVq.js","./persistable-C6RBwzJi-CMdP5i4h.js","./resourceExtension-CdQvIDKV-BNH6JkTz.js","./KMLLayer-DwQXpcMB-3uH69meo.js","./kmlUtils-C5oIEoOy-BsvzFJRs.js","./KnowledgeGraphLayer-BjNFJGLf-2GmTU8yN.js","./KnowledgeGraphSublayer-DPj4igi1-BV31Zmdo.js","./GraphicsLayer-DfeGaYc1-BYhO2Zs8.js","./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js","./knowledgeGraphService-DOJz0fzA-DDr_20o0.js","./Relationship-Db9GUmYx-Cq6n6OX7.js","./FeatureStore-Co2V0sVE-BwnfsIjJ.js","./BoundsStore--N6o1xkF-BnCtocGj.js","./PooledRBush-DbfAmeLn-B9Pkw5Ae.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./timeSupport-jPViR5jn-GyoVmGVI.js","./queryUtils-Brxu6254-PPvpiP5X.js","./json-BI97KiBB-Ce5cWfI2.js","./optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js","./QueryEngine-CH5uUhZK-BP95Dm56.js","./WhereClause-DxwoyBMS-DnXKVpm2.js","./TimeOnly-DSMefxKy-BU7RNYWc.js","./utils-HtkT8Fn3-wUwu1nm1.js","./utils-DyydRFHu-BQ5pghrp.js","./Basemap-BEqqSTw9-B5O9ub1-.js","./Scheduler-B7UX7Wr5-DQCcMKpm.js","./LineOfSightLayer-D6sUQaEP-aejAAhNq.js","./featureReferenceUtils-Ct4KY5u7-cLRdtKlb.js","./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js","./boundedPlane-DlvE0eNx-dpkNyaGh.js","./lineSegment-CcqvCARM-CF4YE8GC.js","./LinkChartLayer-KcYDvLxD-c7VHqPSL.js","./MapImageLayer-B_rP0PhA-D0-dI6ut.js","./scaleUtils-DxsfQwK1-D7ZZd5W4.js","./SublayersOwner-DfTaMJ5V-DMBhnxeT.js","./sublayerUtils-CyM0QC5B-D9HVKWXR.js","./ExportImageParameters-DxyNGQ57-0etxSPmv.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./MapNotesLayer-DauvjDLM-CHkiPy5B.js","./objectIdUtils-EszJVKSV-Bi133oF_.js","./MediaLayer-DiCs97gD-D8BtJysn.js","./perspectiveUtils-Bu88xlbg-DGihQXe_.js","./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js","./vec2-tHZ6OaOy-xCj1obDt.js","./imageUtils-BA2D6Uf1-DgLNtmEY.js","./OGCFeatureLayer-DPXQjO1S-DQtwLAZb.js","./ogcFeatureUtils-Bs12bZY3-BXRrRRmn.js","./geojson-CNt_qtQf-B9F87hyc.js","./date-Cqvy-TgA-DIf-QFLz.js","./sourceUtils-BMeqkJ5g-DxP4qerC.js","./OpenStreetMapLayer-Bx4EhJij-Ob9DgNzQ.js","./WebTileLayer-CUoicUjK-CNTqPpZi.js","./OrientedImageryLayer-CwG5o4Di-DoKQbTo3.js","./PointCloudLayer-CkxImr5P-JsLK1ZeI.js","./PointCloudUniqueValueRenderer-C-5hwEaR-CLxe58O_.js","./RouteLayer-BQQ6WxtH-gcXmCkYw.js","./Stop-he5xSAJJ-CGB43GGR.js","./SceneLayer-DOh9PmQy-CNOlY0yu.js","./Mesh-DLzjDUIO-COeC-iS-.js","./MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-BuNk6xPZ.js","./deduplicate-D2d-E5Pw-CQcmF3ab.js","./vertexSpaceConversion-CiKaVq_u-D2kQTb17.js","./vec3-BazNroeq-PdcGTXFi.js","./BufferView-PQoE3GL7-Duht5lAO.js","./vec4-DWDdg1fj-BagfV9qf.js","./meshSpatialReferenceScaleUtils-B1zR72Os-D-3pcUSm.js","./StreamLayer-Bqnt-d3H-Dsh94g7_.js","./SubtypeGroupLayer-D1vAbwEU-CDpC08_d.js","./TileLayer-Be5tWeN5-CZVaOU3u.js","./UnknownLayer-DwWK383_-yIdidO-4.js","./UnsupportedLayer-CCUtmZ2i-DjI3xgYe.js","./VectorTileLayer-DruyQukp-O9fRyiwY.js","./TileKey-C5IL-JBr-CJMvJ-lJ.js","./StyleRepository-D3WuVprR-SmpmvCua.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./enums-qHpGJ28Q-CmnLAccm.js","./GeometryUtils-NHgB9gGQ-DrtZFKub.js","./enums-DBi1-Mm2-CUS1pvQe.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./definitions-DJSdSb77-DkoRHaVx.js","./capabilities-agoTWNzb-CtsNgRyk.js","./VideoLayer-Dxs-NJSn--54x1iM5.js","./TelemetryDisplay-Bq2PXfI8-Z2CK355L.js","./ViewshedLayer-BYX-h7eL-C8exBQCc.js","./VoxelLayer-KL84GttA-aMQGBYli.js","./WFSLayer-DKnx5V8b-CqaZsJwu.js","./wfsUtils-DoLaqXsj-B0NjDgDj.js","./xmlUtils-TLuV3CJ7-Cs2DGP6C.js","./WMSLayer-C8eYRV4V-DczckqqP.js","./crsUtils-BLe27KvG-VS_BXVdj.js","./ExportWMSImageParameters-CMk80WSM-sFuOAfxa.js","./WMTSLayer-DJY_jjIE-CRE9fTlG.js"])))=>i.map(i=>d[i]); -import{_ as a}from"./main-ugzBrWNm.js";import{f as s}from"./story-BfX8CRfG.js";async function d(t,e){const{data:_}=await s(t,{responseType:"json",query:{f:"json",...e?.customParameters,token:e?.apiKey}});return _}const E={BingMapsLayer:async()=>(await a(async()=>{const{default:t}=await import("./BingMapsLayer-BigMnKl_-CZ_oLWcb.js");return{default:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url)).default,BuildingSceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./BuildingSceneLayer-IIePcdNz-52pkRQg3.js");return{default:t}},__vite__mapDeps([23,1,2,3,4,24,25,5,6,7,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,47,15,16,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126]),import.meta.url)).default,CSVLayer:async()=>(await a(async()=>{const{default:t}=await import("./CSVLayer-CJQy-BsL-BUdGsKHu.js");return{default:t}},__vite__mapDeps([127,1,2,3,4,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,128,129,93]),import.meta.url)).default,CatalogLayer:async()=>(await a(async()=>{const{default:t}=await import("./CatalogLayer-BeO1fLsl-idS3vnNO.js");return{default:t}},__vite__mapDeps([130,1,2,3,4,5,6,7,35,131,132,8,9,10,11,12,13,18,15,16,17,79,133,134,26,27,28,29,30,31,32,33,34,36,37,38,39,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,56,57,58,59,70,71,72,75,76,90,135,136,137,104,138,139,63,64,140,103,120,109,111,141,142,143,144,145,69,128,129,93,146,147,148,149,150,151,152,62,153,154,65,155,61,66,67,68,22,78,80,81,82,14,83,84,86,85,87,88]),import.meta.url)).default,DimensionLayer:async()=>(await a(async()=>{const{default:t}=await import("./DimensionLayer-DFh7fPYo-D38O23av.js");return{default:t}},__vite__mapDeps([156,1,2,3,4,157,158,63,64,5,6,7,22,15,16,17]),import.meta.url)).default,ElevationLayer:async()=>(await a(async()=>{const{default:t}=await import("./ElevationLayer-G6y-P-jo-Dn65xXOv.js");return{default:t}},__vite__mapDeps([159,2,3,1,4,5,51,6,7,160,20,21,161,162,163,35,67,52,22,15,16,17,80,81,82,63,64,60]),import.meta.url)).default,FeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./FeatureLayer-BrRKw5Si-D6Z5CL70.js");return{default:t}},__vite__mapDeps([47,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92]),import.meta.url)).default,GeoJSONLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoJSONLayer-BFFwDRph-DcfWJyiN.js");return{default:t}},__vite__mapDeps([164,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,60,128,129,93,65,49,50,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,63,64,14,18,83,84,85,87,90]),import.meta.url)).default,GeoRSSLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoRSSLayer-DgF8xnYi-BcGrr8g_.js");return{default:t}},__vite__mapDeps([165,1,2,3,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18]),import.meta.url)).default,GroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./GroupLayer-ER-XzoYr-LPsQSYf2.js");return{default:t}},__vite__mapDeps([166,2,3,1,4,24,25,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,18,167,92,100,168]),import.meta.url)).default,ImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryLayer-B-bJb8lU-DAjXPfZr.js");return{default:t}},__vite__mapDeps([169,2,3,1,4,5,6,7,170,171,60,172,49,50,26,27,28,29,30,31,32,17,33,173,174,40,41,13,42,134,144,65,142,143,145,175,10,11,12,176,43,44,35,15,16,37,38,19,55,147,148,149,150,151,152,62,63,64,155,67,52,8,9,68,22,80,81,82,14,18,83,84,88,90,92]),import.meta.url)).default,ImageryTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryTileLayer-DixyNESc-DnXgKCIh.js");return{default:t}},__vite__mapDeps([177,2,3,1,4,5,6,7,67,52,8,9,10,11,12,13,68,170,171,60,172,49,50,26,27,28,29,30,31,32,17,33,173,174,40,41,42,134,144,65,142,143,145,175,176,43,44,35,15,16,20,21,178,179,63,64,180,131,132,181,22,80,81,82,14,18,83,84,162,163,90,92]),import.meta.url)).default,IntegratedMesh3DTilesLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMesh3DTilesLayer-BEcgXCkk-v3TYApnj.js");return{default:t}},__vite__mapDeps([182,1,2,3,4,5,104,13,64,6,7,66,67,52,68,22,15,16,17,80,81,82,63,18,126]),import.meta.url)).default,IntegratedMeshLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMeshLayer-C-XaBbXd-Bw4BDqVq.js");return{default:t}},__vite__mapDeps([183,1,2,3,4,5,184,77,96,54,185,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,51,97,98,99,100,101,126]),import.meta.url)).default,KMLLayer:async()=>(await a(async()=>{const{default:t}=await import("./KMLLayer-DwQXpcMB-3uH69meo.js");return{default:t}},__vite__mapDeps([186,1,2,3,4,24,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,187,34,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,65,49,50]),import.meta.url)).default,KnowledgeGraphLayer:async()=>(await a(async()=>{const{default:t}=await import("./KnowledgeGraphLayer-BjNFJGLf-2GmTU8yN.js");return{default:t}},__vite__mapDeps([188,1,2,3,4,5,54,6,7,189,63,64,154,151,152,190,191,8,9,10,11,12,13,18,16,17,192,193,55,49,50,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,60,194,195,196,197,198,199,142,143,144,145,200,201,202,203,204,129,205,206,207,25,81,168,133,134,208,132,128,93,87,70,71,72,73,15,74,53,56,75,76,77,78,79,14,83,84,65,90,67,52,68,22,80,82]),import.meta.url)).default,LineOfSightLayer:async()=>(await a(async()=>{const{default:t}=await import("./LineOfSightLayer-D6sUQaEP-aejAAhNq.js");return{default:t}},__vite__mapDeps([209,1,2,3,4,157,210,104,13,107,12,41,42,108,109,110,103,111,112,211,212,213,184,77,96,54,185,16,17,63,64,126,5,6,7,22,15]),import.meta.url)).default,LinkChartLayer:async()=>(await a(async()=>{const{default:t}=await import("./LinkChartLayer-KcYDvLxD-c7VHqPSL.js");return{default:t}},__vite__mapDeps([214,1,2,3,4,5,6,7,154,151,152,189,63,64,190,191,8,9,10,11,12,13,18,16,17,192,193,55,49,50,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,60,194,195,196,197,198,199,142,143,144,145,200,201,202,203,204,129,205,206,207,25,81,168,133,134,208,132,128,93,87,70,71,72,73,15,74,53,54,56,75,76,77,78,79,14,83,84,65,90,22]),import.meta.url)).default,MapImageLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapImageLayer-B_rP0PhA-D0-dI6ut.js");return{default:t}},__vite__mapDeps([215,1,2,3,4,25,5,216,6,7,66,217,36,52,15,16,17,82,63,64,24,26,27,28,29,30,31,32,33,34,35,37,38,39,40,41,13,42,43,44,45,46,146,139,55,49,50,144,147,148,142,143,145,149,150,151,152,62,153,154,65,155,53,54,56,86,85,75,76,57,58,59,90,218,67,8,9,10,11,12,68,22,80,81,14,18,83,84,219,220,19,88]),import.meta.url)).default,MapNotesLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapNotesLayer-DauvjDLM-CHkiPy5B.js");return{default:t}},__vite__mapDeps([221,1,2,3,4,5,63,64,142,143,144,145,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,190,191,222]),import.meta.url)).default,MediaLayer:async()=>(await a(async()=>{const{default:t}=await import("./MediaLayer-DiCs97gD-D8BtJysn.js");return{default:t}},__vite__mapDeps([223,2,3,1,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,18,224,225,143,108,109,226,104,112,227,54,185,195,196,197,92]),import.meta.url)).default,OGCFeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./OGCFeatureLayer-DPXQjO1S-DQtwLAZb.js");return{default:t}},__vite__mapDeps([228,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,229,154,151,152,230,231,128,129,93,232,50,65,49,66,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,63,64,14,18,83,84,86,85,87,90]),import.meta.url)).default,OpenStreetMapLayer:async()=>(await a(async()=>{const{default:t}=await import("./OpenStreetMapLayer-Bx4EhJij-Ob9DgNzQ.js");return{default:t}},__vite__mapDeps([233,1,2,3,4,234,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21]),import.meta.url)).default,OrientedImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./OrientedImageryLayer-CwG5o4Di-DoKQbTo3.js");return{default:t}},__vite__mapDeps([235,1,2,3,4,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92]),import.meta.url)).default,PointCloudLayer:async()=>(await a(async()=>{const{default:t}=await import("./PointCloudLayer-CkxImr5P-JsLK1ZeI.js");return{default:t}},__vite__mapDeps([236,1,2,3,4,5,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,96,51,97,98,54,99,100,49,50,87,37,38,237,27,126,90]),import.meta.url)).default,RouteLayer:async()=>(await a(async()=>{const{default:t}=await import("./RouteLayer-BQQ6WxtH-gcXmCkYw.js");return{default:t}},__vite__mapDeps([238,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,95,96,63,64,6,7,8,9,10,11,12,22,15,16,80,81,82,18,52,144,239,142,143,145,65,49,50]),import.meta.url)).default,SceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./SceneLayer-DOh9PmQy-CNOlY0yu.js");return{default:t}},__vite__mapDeps([240,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,241,140,12,103,120,109,111,104,227,242,136,137,243,244,110,112,245,106,63,64,246,108,121,122,247,248,226,249,138,139,6,7,250,66,67,52,68,69,54,22,15,16,80,81,82,18,94,95,96,51,97,98,99,100,83,84,125,93,53,49,50,55,56,74,87,101,75,76,57,184,77,185,89,126,90,102,105,107,113,114,115,116,117,118,119,123,124]),import.meta.url)).default,StreamLayer:async()=>(await a(async()=>{const{default:t}=await import("./StreamLayer-Bqnt-d3H-Dsh94g7_.js");return{default:t}},__vite__mapDeps([251,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,67,52,8,9,10,11,12,68,70,71,72,55,49,50,73,15,16,74,53,54,56,75,76,77,22,80,81,82,63,64,14,18,83,84,87,89,90,92]),import.meta.url)).default,SubtypeGroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./SubtypeGroupLayer-D1vAbwEU-CDpC08_d.js");return{default:t}},__vite__mapDeps([252,2,3,1,4,25,5,6,7,66,67,52,8,9,10,11,12,13,68,69,54,48,49,50,15,16,17,51,53,55,34,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,56,57,58,59,22,80,81,82,63,64,14,18,83,84,87,176,175,85,75,76,90,88,92]),import.meta.url)).default,TileLayer:async()=>(await a(async()=>{const{default:t}=await import("./TileLayer-Be5tWeN5-CZVaOU3u.js");return{default:t}},__vite__mapDeps([253,1,2,3,4,25,5,6,7,66,160,20,21,161,162,163,35,217,36,52,15,16,17,82,63,64,24,26,27,28,29,30,31,32,33,34,37,38,39,40,41,13,42,43,44,45,46,146,139,55,49,50,144,147,148,142,143,145,149,150,151,152,62,153,154,65,155,53,54,56,86,85,75,76,57,58,59,90,218,67,8,9,10,11,12,68,22,80,81,14,18,19]),import.meta.url)).default,UnknownLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnknownLayer-DwWK383_-yIdidO-4.js");return{default:t}},__vite__mapDeps([254,1,2,3,4,5,6,7,80,81,82,63,64]),import.meta.url)).default,UnsupportedLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnsupportedLayer-CCUtmZ2i-DjI3xgYe.js");return{default:t}},__vite__mapDeps([255,1,2,3,4,5,6,7,80,81,82,63,64]),import.meta.url)).default,VectorTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./VectorTileLayer-DruyQukp-O9fRyiwY.js");return{default:t}},__vite__mapDeps([256,1,2,3,4,5,6,7,66,160,20,21,161,162,163,35,67,52,8,9,10,11,12,13,68,22,15,16,17,80,81,82,63,64,14,18,257,97,258,259,44,260,261,262,263,40,41,42,264,265,266]),import.meta.url)).default,VideoLayer:async()=>(await a(async()=>{const{default:t}=await import("./VideoLayer-Dxs-NJSn--54x1iM5.js");return{default:t}},__vite__mapDeps([267,1,2,3,4,5,6,7,8,9,10,11,12,13,68,18,52,15,16,17,59,268,109,108,104,121,64,174]),import.meta.url)).default,ViewshedLayer:async()=>(await a(async()=>{const{default:t}=await import("./ViewshedLayer-BYX-h7eL-C8exBQCc.js");return{default:t}},__vite__mapDeps([269,1,2,3,4,210,104,13,107,12,41,42,108,109,110,103,111,112,211,212,213,158,157,63,64,5,6,7,22,15,16,17]),import.meta.url)).default,VoxelLayer:async()=>(await a(async()=>{const{default:t}=await import("./VoxelLayer-KL84GttA-aMQGBYli.js");return{default:t}},__vite__mapDeps([270,1,2,3,4,5,104,13,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,96,51,97,98,54,99,100,49,50,37,38,84,158,184,77,185,120,109,111,41,90]),import.meta.url)).default,WFSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WFSLayer-DKnx5V8b-CqaZsJwu.js");return{default:t}},__vite__mapDeps([271,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,60,128,129,93,272,63,64,230,231,151,273,52,49,50,65,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,14,18,83,84,87,90]),import.meta.url)).default,WMSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMSLayer-C8eYRV4V-DczckqqP.js");return{default:t}},__vite__mapDeps([274,1,2,3,4,24,5,216,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,83,84,275,52,276,19]),import.meta.url)).default,WMTSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMTSLayer-DJY_jjIE-CRE9fTlG.js");return{default:t}},__vite__mapDeps([277,1,2,3,4,5,6,7,234,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21,161,275,273]),import.meta.url)).default,WebTileLayer:async()=>(await a(()=>import("./WebTileLayer-CUoicUjK-CNTqPpZi.js"),__vite__mapDeps([234,1,2,3,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21]),import.meta.url).then(t=>t.W)).default},y=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function O(t,e){const{loadContext:_,...r}=e||{},u=_?await _.fetchServiceMetadata(t,r):await d(t,r);f(u),o(u);const l={serviceJSON:u};if((u.currentVersion??0)<10.5)return l;const n=`${t}/layers`,i=_?await _.fetchServiceMetadata(n,r):await d(n,r);return f(i),o(i),l.layersJSON={layers:i.layers,tables:i.tables},l}function c(t){const{type:e}=t;return!!e&&y.has(e)}function m(t){return t.type==="Table"}function o(t){t.layers=t.layers?.filter(c),t.tables=t.tables?.filter(m)}function p(t){t.type||="Feature Layer"}function L(t){t.type||="Table"}function f(t){t.layers?.forEach(p),t.tables?.forEach(L)}function T(t){switch(t){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}export{O as d,T as g,d as o,E as p}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BingMapsLayer-BigMnKl_-BCPSKyeE.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./MultiOriginJSONSupport-DKRh9P6w-CJ-PTteo.js","./Layer-ChoECxvZ-BmDHBjO8.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./BlendLayer-D1WkSmwP-BeUsb4u9.js","./jsonUtils-wIllKWI4-MQQ-E5fj.js","./parser-DyDJ-rlI-CvOs11Ip.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-6clJxb1Q.js","./common-CYWrYyJl-E8-sukrT.js","./RefreshableLayer-a8BQ58Xh-CxfquKbp.js","./commonProperties-BtIqvFU_-DbZji2Rx.js","./ElevationInfo-yv2-9tj6-CkIHeL1t.js","./lengthUtils-DKpMe5qR-CsqJSDh_.js","./ScaleRangeLayer-Bz0DcnvM-CMeIxDsk.js","./imageBitmapUtils-DA36kg39-BfNbbEDs.js","./TileInfo-CWIRDhZl-RqA7tkOZ.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./OperationalLayer-B5IXiMa2-DTTV2F9z.js","./BuildingSceneLayer-IIePcdNz-BJDsdW-f.js","./CollectionFlattener-DkHuHn5E-dp3hDI2N.js","./loadAll-e978YItg-4pMG3qU7.js","./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js","./RendererLegendOptions-K3md58-X-JLOOdHLz.js","./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js","./colorRamps-q0bZVhs2-BnivlaV9.js","./sizeVariableUtils-t52KcLLi-D0hbQF8b.js","./visualVariableUtils-D3kZJRyn-tyrXoPjU.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./styleUtils-BtpNqZyT-Bnq2S5kK.js","./jsonUtils-C64Zfu7c-BtrwAD3_.js","./LRUCache-C3erQTWv-grHgYSP-.js","./Version-CoKzbupV-BDyz4v43.js","./FieldsIndex-HmzMbJQG-Du7S47uJ.js","./UnknownTimeZone-C--TOcPG-9of9030I.js","./OverrideHelper-DWRbVlj1-BnPmqHJ3.js","./colorUtils-Cthpxcks-cHaMZbaf.js","./vec42-D8CJyqHG-DnfLTeQH.js","./vec4f64-hf2nxvhQ-CaAr8PTM.js","./utils-SPbpQbmm-CiwW7WzR.js","./enums-CpSG_SL3-BMD3Tb1v.js","./quantizationUtils-bJy1cRwp-DFYZs_ns.js","./heatmapUtils-seiMkkkR-CrSLbaQx.js","./FeatureLayer-BrRKw5Si-DuA2fyE_.js","./FeatureLayerBase-vvYyZTfh-DJHk8NKC.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./HeightModelInfo-C5vFqzyF-BH6aliHn.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./featureLayerUtils-DgfQQyK4-Cfw8eI8B.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./Query-BrwMGK8U-BPr0_G9t.js","./RelationshipQuery-DJsz3K0U-BKFa46R1.js","./LayerFloorInfo-DRJ8wfwx-DKergZyZ.js","./Relationship-PyhUibYK-DN6K3ukS.js","./serviceCapabilitiesUtils-rPjN5QBe-DFLcYQTb.js","./workers-PiCjreoO-Dc6Tqm-o.js","./editsZScale-BDsX6vv--C-4n90TZ.js","./queryZScale-BiYV6Pr6-B7zp5L1G.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./FeatureSet-BkVNthuN-DPQqwkNN.js","./APIKeyMixin-BUMSx9ny-C9ZHhLj0.js","./ArcGISService-BYA-y6X6-DNHMEBm_.js","./CustomParametersMixin-vdKsTHer-5EfrrVMH.js","./EditBusLayer-Df29OyJh-OmdJOLws.js","./FeatureEffectLayer-Cro89IEC-B2s0Xww8.js","./FeatureEffect-CDEk9Es7-Cd4-I1fy.js","./FeatureFilter-BCFHgLVU-DwigNbnH.js","./FeatureReductionLayer-BTZjL0_Z-CFZCe5aZ.js","./FeatureReductionSelection-BjX3h7Sz-B6ZLbiBW.js","./labelingInfo-DGVNul26-BDBqWm17.js","./labelUtils-BW14kBqX-Tk7uOiPw.js","./MD5-CHHr-oed-SuyrCYQ0.js","./OrderedLayer-6Qsmrd_l-Ck8MCw7w.js","./OrderByInfo-GD2XnU8e-BaEpZLaO.js","./PortalLayer-CElnYuSQ-CCe4TMEA.js","./PortalItem-CctGdnxF-CfFOGshS.js","./portalItemUtils-B8bw6SAG-DF460C0Y.js","./TemporalLayer-CpOrN_w9-8nvJFP_-.js","./TimeInfo-w_HB2CsF-B2qHZyfS.js","./FeatureTemplate-SPHPD45f-CZ7E6_6b.js","./FeatureType-C9hJmS6_-CNlvn5D1.js","./fieldProperties-Bq26w7gt-BiKrD4ue.js","./versionUtils-LZYZz-38-B8C5OAjF.js","./styleUtils-ChrJTYIw-C6xq7Jeu.js","./popupUtils-B0uZcXX0-DHyOz1jC.js","./AlphaCutoff-ZPx1GqOi-UcccL64p.js","./interfaces-Cwm0pihk-Ptzy6gTd.js","./capabilities-Cjn77swe-Y9lFlGVh.js","./SceneService-BZqGtWmG-BBytd6YJ.js","./originUtils-BLsWtgV9-B4sclfuf.js","./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js","./jsonContext-BA8GHqVk-BsXRY5es.js","./resourceUtils-BmW6QqlX-D_AxNrCI.js","./resourceUtils-rTM6Iemx-GPPQBysx.js","./saveUtils-CIYk-dsQ-Br9QCJTX.js","./I3SLayerDefinitions-CwLXCKtU-BdHWzf5u.js","./I3SUtil-Bq8KpP2j--Kmryq4i.js","./mat4f64-Dn1WEGBx-C99QVUMW.js","./vec32-D9GsKZ1t-BPSFE14A.js","./projectVectorToVector-sIYLNlex-DexDhaq1.js","./projectPointToVector-B2UUY9SE-BIKNGLey.js","./sphere-BenPORjV-B4uz1SYF.js","./mat3-CC4Foazl-BWjyqE2v.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./plane-Dt8R0KeE-Bqc6oVGz.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./I3SBinaryReader-DEbI3cKZ-0ASBQHPj.js","./VertexAttribute-DqD5S0a2-3q90nikV.js","./floatRGBA-4pIJN00G-Cz2BV8ih.js","./NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js","./interfaces-DN2-jsJC-DzMTiT5R.js","./BindType-9iOk18Ed-CRW1cdX4.js","./orientedBoundingBox-oHezdpWm-ilptOsP0.js","./quat-BODLR7mS-BQk2dgMZ.js","./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js","./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./popupUtils-nV1O8RUO-BYG2KoFf.js","./associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js","./elevationInfoUtils-mOZsPH2J-BlRQDLDN.js","./CSVLayer-CJQy-BsL-SmEBKuSE.js","./clientSideDefaults-BqqayPct-Vv2Kv9CL.js","./QueryEngineCapabilities-Gr588n9t-DjYb9CEb.js","./CatalogLayer-BeO1fLsl-B5ozPHOs.js","./ReactiveMap-CFk6jPfN-CSefy1PZ.js","./signal-CETehA7D-DQA5V72u.js","./utils-tNxq3jkf-nfQcZo7O.js","./ClassBreaksDefinition-bYRgYgPp-VhoiAZje.js","./FeatureLayerSource-k4WMYop1-B19OqXBO.js","./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js","./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js","./External-D_wl4XAw-DrOy4LUr.js","./infoFor3D-DIuYZyyK-BtH19JJ7.js","./MeshTransform-C--IG09w-Bbqagf1g.js","./editingSupport-gUqP9iyf-C_ld1skV.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./QueryTask-CwHwH2rS-D4f5dsGo.js","./executeForIds-Z1gkLduF-CrWEksFG.js","./query-DFW9-NG_-C3TyGmiM.js","./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js","./pbf-D-y3_eZO-CpHdkhuD.js","./OptimizedFeature-EIithYlr-Cq64mIT3.js","./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js","./executeQueryPBF-o8010HS9-B7Z-YQyg.js","./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js","./executeQueryJSON-CcHnccia-M-vnTvKl.js","./DimensionLayer-DFh7fPYo-BMjvVx5w.js","./Analysis-BPgJ-FCw-CJ_Utx59.js","./Cyclical-C_9rKUUQ-DyGueJyk.js","./ElevationLayer-G6y-P-jo-DIAelIek.js","./ArcGISCachedService-C64Ko1TY-COmlLbBz.js","./TileInfoTilemapCache-D1SExPij-BDoYZo_V.js","./TilemapCache-CRRxws77-CCC00Yar.js","./ByteSizeUnit-DL8UhsB0-B2-AmVRx.js","./GeoJSONLayer-BFFwDRph-C3_g8RHm.js","./GeoRSSLayer-DgF8xnYi-Cl1Qae5D.js","./GroupLayer-ER-XzoYr-DlHeNdGj.js","./TablesMixin-C8RojhYs-LCBvmsnP.js","./writeUtils-D5qlLkwk-enZap9KW.js","./ImageryLayer-B-bJb8lU-DBN_Mc6Q.js","./RasterPresetRendererMixin-D6W9pUY6-Bm_m_CYY.js","./multidimensionalUtils-BwTugeu7-C75LYPc9.js","./dataUtils-BkPy4R3C-Dzc1QGGb.js","./RasterSymbolizer-BVys6HkM-DCN-TPRo.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./utils-DPtQ14k3-CBDffBYM.js","./cimSymbolUtils-CKIzBgMU-CJBUl5ZP.js","./ImageryTileLayer-DixyNESc-BQ0NIE-T.js","./RawBlockCache-Cj_tmHDm-gcQCDGFb.js","./rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js","./QueueProcessor-DbfV9fLy-2F5OgLgJ.js","./PolynomialTransform-C3nWCu0l-BJIAAiDA.js","./IntegratedMesh3DTilesLayer-BEcgXCkk-B81HIVpX.js","./IntegratedMeshLayer-C-XaBbXd-BuHI7xrr.js","./persistable-C6RBwzJi-CrVVP3ny.js","./resourceExtension-CdQvIDKV-DCvzsrJt.js","./KMLLayer-DwQXpcMB-Bnm-cRpP.js","./kmlUtils-C5oIEoOy-CPvy9nME.js","./KnowledgeGraphLayer-BjNFJGLf-CnmSgfq3.js","./KnowledgeGraphSublayer-DPj4igi1-BoqyUmfs.js","./GraphicsLayer-DfeGaYc1-DRpZ_f0G.js","./GraphicsCollection-CWTXNZOX-BdlDfR8M.js","./knowledgeGraphService-DOJz0fzA-BlihQLi8.js","./Relationship-Db9GUmYx-B84JspfN.js","./FeatureStore-Co2V0sVE-BK6XAR3o.js","./BoundsStore--N6o1xkF-CQrhMeDa.js","./PooledRBush-DbfAmeLn-CPHfm9op.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./timeSupport-jPViR5jn-7bshRI7L.js","./queryUtils-Brxu6254-CDiE0zms.js","./json-BI97KiBB-Ce5cWfI2.js","./optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js","./QueryEngine-CH5uUhZK-DRGPyg2C.js","./WhereClause-DxwoyBMS-Cwdb_WC4.js","./TimeOnly-DSMefxKy-BHvJbNji.js","./utils-HtkT8Fn3-Dd_0rdy5.js","./utils-DyydRFHu-1ITtOELE.js","./Basemap-BEqqSTw9-yGsB1EL7.js","./Scheduler-B7UX7Wr5-DriQgzLZ.js","./LineOfSightLayer-D6sUQaEP-83QjyQPT.js","./featureReferenceUtils-Ct4KY5u7-DuNl8LtH.js","./IntersectorInterfaces-CrXe7z5S-tY6PKd-m.js","./boundedPlane-DlvE0eNx-BQ9Xop25.js","./lineSegment-CcqvCARM-CDEWcAzV.js","./LinkChartLayer-KcYDvLxD-DTFlqiUN.js","./MapImageLayer-B_rP0PhA-BDp1ZtcT.js","./scaleUtils-DxsfQwK1-CzyfErWH.js","./SublayersOwner-DfTaMJ5V-DrC0bgDm.js","./sublayerUtils-CyM0QC5B-B1ryunQi.js","./ExportImageParameters-DxyNGQ57-D1Dwm6AT.js","./floorFilterUtils-4r-vVdzs-C43jLoAE.js","./MapNotesLayer-DauvjDLM-CxPThSsi.js","./objectIdUtils-EszJVKSV-Bi133oF_.js","./MediaLayer-DiCs97gD-S0-qCmPh.js","./perspectiveUtils-Bu88xlbg-Cn6YpKwC.js","./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js","./vec2-tHZ6OaOy-xCj1obDt.js","./imageUtils-BA2D6Uf1-CYx0DlwL.js","./OGCFeatureLayer-DPXQjO1S-CQDhGgy_.js","./ogcFeatureUtils-Bs12bZY3-bQ3aM3rZ.js","./geojson-CNt_qtQf-X0105Nc8.js","./date-Cqvy-TgA-DIf-QFLz.js","./sourceUtils-BMeqkJ5g-DcR3VPl5.js","./OpenStreetMapLayer-Bx4EhJij-WBr50b29.js","./WebTileLayer-CUoicUjK-DGq3QB_9.js","./OrientedImageryLayer-CwG5o4Di--YfSXT-B.js","./PointCloudLayer-CkxImr5P-DqGHCOp3.js","./PointCloudUniqueValueRenderer-C-5hwEaR-CgVBPOu4.js","./RouteLayer-BQQ6WxtH-DV30CZ3n.js","./Stop-he5xSAJJ-BA1tUkNc.js","./SceneLayer-DOh9PmQy-BMYFGe4d.js","./Mesh-DLzjDUIO-BwXS6N6_.js","./MeshVertexAttributes-CbNpPur2-c8zcl8rF.js","./earcut-XDcq3zAf-BcwyrT7l.js","./Indices-DEr2HrWx-cFTwC5-9.js","./deduplicate-D2d-E5Pw-CTlujluz.js","./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js","./vec3-BazNroeq-CRjQH4Pj.js","./BufferView-PQoE3GL7-B9DLdqO9.js","./vec4-DWDdg1fj-BHg6FqkT.js","./meshSpatialReferenceScaleUtils-B1zR72Os-ndChBRyc.js","./StreamLayer-Bqnt-d3H-Cf1JxEuo.js","./SubtypeGroupLayer-D1vAbwEU-D1p0P2KY.js","./TileLayer-Be5tWeN5-CUL4Ato2.js","./UnknownLayer-DwWK383_-ChM426K1.js","./UnsupportedLayer-CCUtmZ2i-Cmkro0SF.js","./VectorTileLayer-DruyQukp-BQMpjmuu.js","./TileKey-C5IL-JBr-BGwa3-Dg.js","./StyleRepository-D3WuVprR-B1BVbhGB.js","./StyleDefinition-Ct4HIk9T-B82pTf0h.js","./enums-qHpGJ28Q-CmnLAccm.js","./GeometryUtils-NHgB9gGQ-DtpzGERq.js","./enums-DBi1-Mm2-CUS1pvQe.js","./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./definitions-DJSdSb77-DkoRHaVx.js","./capabilities-agoTWNzb-CtsNgRyk.js","./VideoLayer-Dxs-NJSn-NbdKBg3Z.js","./TelemetryDisplay-Bq2PXfI8-BY_FrklG.js","./ViewshedLayer-BYX-h7eL-BRcm_3EL.js","./VoxelLayer-KL84GttA-C5r9pgtQ.js","./WFSLayer-DKnx5V8b-BsCCMHBG.js","./wfsUtils-DoLaqXsj-DBVQwnFp.js","./xmlUtils-TLuV3CJ7-Cs2DGP6C.js","./WMSLayer-C8eYRV4V-lRsRDNhJ.js","./crsUtils-BLe27KvG-VS_BXVdj.js","./ExportWMSImageParameters-CMk80WSM-wEv_P_PY.js","./WMTSLayer-DJY_jjIE-CgOVZJxi.js"])))=>i.map(i=>d[i]); +import{_ as a}from"./main-QGPoLsvl.js";import{f as s}from"./story-Doly9N9p.js";async function d(t,e){const{data:_}=await s(t,{responseType:"json",query:{f:"json",...e?.customParameters,token:e?.apiKey}});return _}const E={BingMapsLayer:async()=>(await a(async()=>{const{default:t}=await import("./BingMapsLayer-BigMnKl_-BCPSKyeE.js");return{default:t}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url)).default,BuildingSceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./BuildingSceneLayer-IIePcdNz-BJDsdW-f.js");return{default:t}},__vite__mapDeps([23,1,2,3,4,24,25,5,6,7,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,47,15,16,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126]),import.meta.url)).default,CSVLayer:async()=>(await a(async()=>{const{default:t}=await import("./CSVLayer-CJQy-BsL-SmEBKuSE.js");return{default:t}},__vite__mapDeps([127,1,2,3,4,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,128,129,93]),import.meta.url)).default,CatalogLayer:async()=>(await a(async()=>{const{default:t}=await import("./CatalogLayer-BeO1fLsl-B5ozPHOs.js");return{default:t}},__vite__mapDeps([130,1,2,3,4,5,6,7,35,131,132,8,9,10,11,12,13,18,15,16,17,79,133,134,26,27,28,29,30,31,32,33,34,36,37,38,39,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,56,57,58,59,70,71,72,75,76,90,135,136,137,104,138,139,63,64,140,103,120,109,111,141,142,143,144,145,69,128,129,93,146,147,148,149,150,151,152,62,153,154,65,155,61,66,67,68,22,78,80,81,82,14,83,84,86,85,87,88]),import.meta.url)).default,DimensionLayer:async()=>(await a(async()=>{const{default:t}=await import("./DimensionLayer-DFh7fPYo-BMjvVx5w.js");return{default:t}},__vite__mapDeps([156,1,2,3,4,157,158,63,64,5,6,7,22,15,16,17]),import.meta.url)).default,ElevationLayer:async()=>(await a(async()=>{const{default:t}=await import("./ElevationLayer-G6y-P-jo-DIAelIek.js");return{default:t}},__vite__mapDeps([159,2,3,1,4,5,51,6,7,160,20,21,161,162,163,35,67,52,22,15,16,17,80,81,82,63,64,60]),import.meta.url)).default,FeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./FeatureLayer-BrRKw5Si-DuA2fyE_.js");return{default:t}},__vite__mapDeps([47,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92]),import.meta.url)).default,GeoJSONLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoJSONLayer-BFFwDRph-C3_g8RHm.js");return{default:t}},__vite__mapDeps([164,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,60,128,129,93,65,49,50,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,63,64,14,18,83,84,85,87,90]),import.meta.url)).default,GeoRSSLayer:async()=>(await a(async()=>{const{default:t}=await import("./GeoRSSLayer-DgF8xnYi-Cl1Qae5D.js");return{default:t}},__vite__mapDeps([165,1,2,3,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18]),import.meta.url)).default,GroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./GroupLayer-ER-XzoYr-DlHeNdGj.js");return{default:t}},__vite__mapDeps([166,2,3,1,4,24,25,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,18,167,92,100,168]),import.meta.url)).default,ImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryLayer-B-bJb8lU-DBN_Mc6Q.js");return{default:t}},__vite__mapDeps([169,2,3,1,4,5,6,7,170,171,60,172,49,50,26,27,28,29,30,31,32,17,33,173,174,40,41,13,42,134,144,65,142,143,145,175,10,11,12,176,43,44,35,15,16,37,38,19,55,147,148,149,150,151,152,62,63,64,155,67,52,8,9,68,22,80,81,82,14,18,83,84,88,90,92]),import.meta.url)).default,ImageryTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./ImageryTileLayer-DixyNESc-BQ0NIE-T.js");return{default:t}},__vite__mapDeps([177,2,3,1,4,5,6,7,67,52,8,9,10,11,12,13,68,170,171,60,172,49,50,26,27,28,29,30,31,32,17,33,173,174,40,41,42,134,144,65,142,143,145,175,176,43,44,35,15,16,20,21,178,179,63,64,180,131,132,181,22,80,81,82,14,18,83,84,162,163,90,92]),import.meta.url)).default,IntegratedMesh3DTilesLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMesh3DTilesLayer-BEcgXCkk-B81HIVpX.js");return{default:t}},__vite__mapDeps([182,1,2,3,4,5,104,13,64,6,7,66,67,52,68,22,15,16,17,80,81,82,63,18,126]),import.meta.url)).default,IntegratedMeshLayer:async()=>(await a(async()=>{const{default:t}=await import("./IntegratedMeshLayer-C-XaBbXd-BuHI7xrr.js");return{default:t}},__vite__mapDeps([183,1,2,3,4,5,184,77,96,54,185,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,51,97,98,99,100,101,126]),import.meta.url)).default,KMLLayer:async()=>(await a(async()=>{const{default:t}=await import("./KMLLayer-DwQXpcMB-Bnm-cRpP.js");return{default:t}},__vite__mapDeps([186,1,2,3,4,24,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,187,34,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,65,49,50]),import.meta.url)).default,KnowledgeGraphLayer:async()=>(await a(async()=>{const{default:t}=await import("./KnowledgeGraphLayer-BjNFJGLf-CnmSgfq3.js");return{default:t}},__vite__mapDeps([188,1,2,3,4,5,54,6,7,189,63,64,154,151,152,190,191,8,9,10,11,12,13,18,16,17,192,193,55,49,50,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,60,194,195,196,197,198,199,142,143,144,145,200,201,202,203,204,129,205,206,207,25,81,168,133,134,208,132,128,93,87,70,71,72,73,15,74,53,56,75,76,77,78,79,14,83,84,65,90,67,52,68,22,80,82]),import.meta.url)).default,LineOfSightLayer:async()=>(await a(async()=>{const{default:t}=await import("./LineOfSightLayer-D6sUQaEP-83QjyQPT.js");return{default:t}},__vite__mapDeps([209,1,2,3,4,157,210,104,13,107,12,41,42,108,109,110,103,111,112,211,212,213,184,77,96,54,185,16,17,63,64,126,5,6,7,22,15]),import.meta.url)).default,LinkChartLayer:async()=>(await a(async()=>{const{default:t}=await import("./LinkChartLayer-KcYDvLxD-DTFlqiUN.js");return{default:t}},__vite__mapDeps([214,1,2,3,4,5,6,7,154,151,152,189,63,64,190,191,8,9,10,11,12,13,18,16,17,192,193,55,49,50,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,60,194,195,196,197,198,199,142,143,144,145,200,201,202,203,204,129,205,206,207,25,81,168,133,134,208,132,128,93,87,70,71,72,73,15,74,53,54,56,75,76,77,78,79,14,83,84,65,90,22]),import.meta.url)).default,MapImageLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapImageLayer-B_rP0PhA-BDp1ZtcT.js");return{default:t}},__vite__mapDeps([215,1,2,3,4,25,5,216,6,7,66,217,36,52,15,16,17,82,63,64,24,26,27,28,29,30,31,32,33,34,35,37,38,39,40,41,13,42,43,44,45,46,146,139,55,49,50,144,147,148,142,143,145,149,150,151,152,62,153,154,65,155,53,54,56,86,85,75,76,57,58,59,90,218,67,8,9,10,11,12,68,22,80,81,14,18,83,84,219,220,19,88]),import.meta.url)).default,MapNotesLayer:async()=>(await a(async()=>{const{default:t}=await import("./MapNotesLayer-DauvjDLM-CxPThSsi.js");return{default:t}},__vite__mapDeps([221,1,2,3,4,5,63,64,142,143,144,145,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92,190,191,222]),import.meta.url)).default,MediaLayer:async()=>(await a(async()=>{const{default:t}=await import("./MediaLayer-DiCs97gD-S0-qCmPh.js");return{default:t}},__vite__mapDeps([223,2,3,1,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,18,224,225,143,108,109,226,104,112,227,54,185,195,196,197,92]),import.meta.url)).default,OGCFeatureLayer:async()=>(await a(async()=>{const{default:t}=await import("./OGCFeatureLayer-DPXQjO1S-CQDhGgy_.js");return{default:t}},__vite__mapDeps([228,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,229,154,151,152,230,231,128,129,93,232,50,65,49,66,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,63,64,14,18,83,84,86,85,87,90]),import.meta.url)).default,OpenStreetMapLayer:async()=>(await a(async()=>{const{default:t}=await import("./OpenStreetMapLayer-Bx4EhJij-WBr50b29.js");return{default:t}},__vite__mapDeps([233,1,2,3,4,234,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21]),import.meta.url)).default,OrientedImageryLayer:async()=>(await a(async()=>{const{default:t}=await import("./OrientedImageryLayer-CwG5o4Di--YfSXT-B.js");return{default:t}},__vite__mapDeps([235,1,2,3,4,47,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,15,16,48,49,50,51,52,53,54,55,7,56,57,58,59,6,60,61,62,63,64,65,66,67,8,9,10,11,12,68,69,70,71,72,73,74,75,76,77,22,78,79,80,81,82,14,18,83,84,85,86,87,88,89,90,91,92]),import.meta.url)).default,PointCloudLayer:async()=>(await a(async()=>{const{default:t}=await import("./PointCloudLayer-CkxImr5P-DqGHCOp3.js");return{default:t}},__vite__mapDeps([236,1,2,3,4,5,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,96,51,97,98,54,99,100,49,50,87,37,38,237,27,126,90]),import.meta.url)).default,RouteLayer:async()=>(await a(async()=>{const{default:t}=await import("./RouteLayer-BQQ6WxtH-DV30CZ3n.js");return{default:t}},__vite__mapDeps([238,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,95,96,63,64,6,7,8,9,10,11,12,22,15,16,80,81,82,18,52,144,239,142,143,145,65,49,50]),import.meta.url)).default,SceneLayer:async()=>(await a(async()=>{const{default:t}=await import("./SceneLayer-DOh9PmQy-BMYFGe4d.js");return{default:t}},__vite__mapDeps([240,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,241,140,12,103,120,109,111,104,227,242,136,137,243,244,110,112,245,106,63,64,246,108,121,122,247,248,226,249,138,139,6,7,250,66,67,52,68,69,54,22,15,16,80,81,82,18,94,95,96,51,97,98,99,100,83,84,125,93,53,49,50,55,56,74,87,101,75,76,57,184,77,185,89,126,90,102,105,107,113,114,115,116,117,118,119,123,124]),import.meta.url)).default,StreamLayer:async()=>(await a(async()=>{const{default:t}=await import("./StreamLayer-Bqnt-d3H-Cf1JxEuo.js");return{default:t}},__vite__mapDeps([251,2,3,1,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,67,52,8,9,10,11,12,68,70,71,72,55,49,50,73,15,16,74,53,54,56,75,76,77,22,80,81,82,63,64,14,18,83,84,87,89,90,92]),import.meta.url)).default,SubtypeGroupLayer:async()=>(await a(async()=>{const{default:t}=await import("./SubtypeGroupLayer-D1vAbwEU-D1p0P2KY.js");return{default:t}},__vite__mapDeps([252,2,3,1,4,25,5,6,7,66,67,52,8,9,10,11,12,13,68,69,54,48,49,50,15,16,17,51,53,55,34,26,27,28,29,30,31,32,33,35,36,37,38,39,40,41,42,43,44,45,46,56,57,58,59,22,80,81,82,63,64,14,18,83,84,87,176,175,85,75,76,90,88,92]),import.meta.url)).default,TileLayer:async()=>(await a(async()=>{const{default:t}=await import("./TileLayer-Be5tWeN5-CUL4Ato2.js");return{default:t}},__vite__mapDeps([253,1,2,3,4,25,5,6,7,66,160,20,21,161,162,163,35,217,36,52,15,16,17,82,63,64,24,26,27,28,29,30,31,32,33,34,37,38,39,40,41,13,42,43,44,45,46,146,139,55,49,50,144,147,148,142,143,145,149,150,151,152,62,153,154,65,155,53,54,56,86,85,75,76,57,58,59,90,218,67,8,9,10,11,12,68,22,80,81,14,18,19]),import.meta.url)).default,UnknownLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnknownLayer-DwWK383_-ChM426K1.js");return{default:t}},__vite__mapDeps([254,1,2,3,4,5,6,7,80,81,82,63,64]),import.meta.url)).default,UnsupportedLayer:async()=>(await a(async()=>{const{default:t}=await import("./UnsupportedLayer-CCUtmZ2i-Cmkro0SF.js");return{default:t}},__vite__mapDeps([255,1,2,3,4,5,6,7,80,81,82,63,64]),import.meta.url)).default,VectorTileLayer:async()=>(await a(async()=>{const{default:t}=await import("./VectorTileLayer-DruyQukp-BQMpjmuu.js");return{default:t}},__vite__mapDeps([256,1,2,3,4,5,6,7,66,160,20,21,161,162,163,35,67,52,8,9,10,11,12,13,68,22,15,16,17,80,81,82,63,64,14,18,257,97,258,259,44,260,261,262,263,40,41,42,264,265,266]),import.meta.url)).default,VideoLayer:async()=>(await a(async()=>{const{default:t}=await import("./VideoLayer-Dxs-NJSn-NbdKBg3Z.js");return{default:t}},__vite__mapDeps([267,1,2,3,4,5,6,7,8,9,10,11,12,13,68,18,52,15,16,17,59,268,109,108,104,121,64,174]),import.meta.url)).default,ViewshedLayer:async()=>(await a(async()=>{const{default:t}=await import("./ViewshedLayer-BYX-h7eL-BRcm_3EL.js");return{default:t}},__vite__mapDeps([269,1,2,3,4,210,104,13,107,12,41,42,108,109,110,103,111,112,211,212,213,158,157,63,64,5,6,7,22,15,16,17]),import.meta.url)).default,VoxelLayer:async()=>(await a(async()=>{const{default:t}=await import("./VoxelLayer-KL84GttA-C5r9pgtQ.js");return{default:t}},__vite__mapDeps([270,1,2,3,4,5,104,13,6,7,66,67,52,68,22,15,16,17,80,81,82,63,64,18,94,95,96,51,97,98,54,99,100,49,50,37,38,84,158,184,77,185,120,109,111,41,90]),import.meta.url)).default,WFSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WFSLayer-DKnx5V8b-BsCCMHBG.js");return{default:t}},__vite__mapDeps([271,1,2,3,4,26,27,28,29,30,31,32,17,33,34,35,36,37,38,39,40,41,13,42,43,44,45,46,5,6,7,60,128,129,93,272,63,64,230,231,151,273,52,49,50,65,8,9,10,11,12,68,70,71,72,55,73,15,16,74,53,54,56,75,76,77,22,78,79,80,81,82,14,18,83,84,87,90]),import.meta.url)).default,WMSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMSLayer-C8eYRV4V-lRsRDNhJ.js");return{default:t}},__vite__mapDeps([274,1,2,3,4,24,5,216,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,83,84,275,52,276,19]),import.meta.url)).default,WMTSLayer:async()=>(await a(async()=>{const{default:t}=await import("./WMTSLayer-DJY_jjIE-CgOVZJxi.js");return{default:t}},__vite__mapDeps([277,1,2,3,4,5,6,7,234,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21,161,275,273]),import.meta.url)).default,WebTileLayer:async()=>(await a(()=>import("./WebTileLayer-CUoicUjK-DGq3QB_9.js"),__vite__mapDeps([234,1,2,3,4,5,6,7,8,9,10,11,12,13,22,15,16,17,80,81,82,63,64,14,18,19,20,21]),import.meta.url).then(t=>t.W)).default},y=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function O(t,e){const{loadContext:_,...r}=e||{},u=_?await _.fetchServiceMetadata(t,r):await d(t,r);f(u),o(u);const l={serviceJSON:u};if((u.currentVersion??0)<10.5)return l;const n=`${t}/layers`,i=_?await _.fetchServiceMetadata(n,r):await d(n,r);return f(i),o(i),l.layersJSON={layers:i.layers,tables:i.tables},l}function c(t){const{type:e}=t;return!!e&&y.has(e)}function m(t){return t.type==="Table"}function o(t){t.layers=t.layers?.filter(c),t.tables=t.tables?.filter(m)}function p(t){t.type||="Feature Layer"}function L(t){t.type||="Table"}function f(t){t.layers?.forEach(p),t.tables?.forEach(L)}function T(t){switch(t){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}export{O as d,T as g,d as o,E as p}; diff --git a/custom-toc-highlight/assets/fieldProperties-Bq26w7gt-CFQbsGDX.js b/custom-toc-highlight/assets/fieldProperties-Bq26w7gt-BiKrD4ue.js similarity index 84% rename from custom-toc-highlight/assets/fieldProperties-Bq26w7gt-CFQbsGDX.js rename to custom-toc-highlight/assets/fieldProperties-Bq26w7gt-BiKrD4ue.js index 6c8293ac..230c6a15 100644 --- a/custom-toc-highlight/assets/fieldProperties-Bq26w7gt-CFQbsGDX.js +++ b/custom-toc-highlight/assets/fieldProperties-Bq26w7gt-BiKrD4ue.js @@ -1 +1 @@ -import{K as n,a1 as r,ed as l}from"./story-BfX8CRfG.js";import{y as o}from"./Field-C6hA1tZj-CpGOU6Y4.js";import{o as d}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";function g(){return{fields:{type:[o],value:null,set:function(e){if(e&&n("big-integer-warning-enabled")){const i=e.filter(t=>t.type==="big-integer"||t.type==="oid"&&(t.length||0)>=8);if(i.length){const t=i.map(s=>`'${s.name}'`).join(", ");r.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${t}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return d.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const i of e)this.fieldsIndex?.has(i)||r.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${i} found in outFields`,{layer:this,outFields:e});return l(this.fieldsIndex,e)}}}}export{g as f}; +import{K as n,a1 as r,ed as l}from"./story-Doly9N9p.js";import{y as o}from"./Field-C6hA1tZj-CkWoRbmp.js";import{o as d}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";function g(){return{fields:{type:[o],value:null,set:function(e){if(e&&n("big-integer-warning-enabled")){const i=e.filter(t=>t.type==="big-integer"||t.type==="oid"&&(t.length||0)>=8);if(i.length){const t=i.map(s=>`'${s.name}'`).join(", ");r.getLogger(this).warn("#fields",`Layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}') references big-integer field(s): ${t}, support for which is experimental. Only integers less than ${Number.MAX_SAFE_INTEGER} (Number.MAX_SAFE_INTEGER) are supported.`)}}this._set("fields",e)}},fieldsIndex:{readOnly:!0,get(){return d.fromLayer(this)}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){const e=this._userOutFields;if(!e?.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const i of e)this.fieldsIndex?.has(i)||r.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${i} found in outFields`,{layer:this,outFields:e});return l(this.fieldsIndex,e)}}}}export{g as f}; diff --git a/custom-toc-highlight/assets/fieldType-CD2CL2hr-CMChCO5s.js b/custom-toc-highlight/assets/fieldType-CD2CL2hr-Do9kp-dx.js similarity index 89% rename from custom-toc-highlight/assets/fieldType-CD2CL2hr-CMChCO5s.js rename to custom-toc-highlight/assets/fieldType-CD2CL2hr-Do9kp-dx.js index 16b559ed..af3b6a40 100644 --- a/custom-toc-highlight/assets/fieldType-CD2CL2hr-CMChCO5s.js +++ b/custom-toc-highlight/assets/fieldType-CD2CL2hr-Do9kp-dx.js @@ -1 +1 @@ -import{aK as e}from"./story-BfX8CRfG.js";const l=new e({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",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});export{l as i}; +import{aK as e}from"./story-Doly9N9p.js";const l=new e({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",esriFieldTypeBigInteger:"big-integer",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"});export{l as i}; diff --git a/custom-toc-highlight/assets/floatRGBA-4pIJN00G-BsIUaPaZ.js b/custom-toc-highlight/assets/floatRGBA-4pIJN00G-Cz2BV8ih.js similarity index 83% rename from custom-toc-highlight/assets/floatRGBA-4pIJN00G-BsIUaPaZ.js rename to custom-toc-highlight/assets/floatRGBA-4pIJN00G-Cz2BV8ih.js index c607602b..7a76edf8 100644 --- a/custom-toc-highlight/assets/floatRGBA-4pIJN00G-BsIUaPaZ.js +++ b/custom-toc-highlight/assets/floatRGBA-4pIJN00G-Cz2BV8ih.js @@ -1 +1 @@ -import{ae as f}from"./story-BfX8CRfG.js";function m(t,e,n=0){const r=f(t,0,i);for(let o=0;o<4;o++)e[n+o]=Math.floor(256*u(r*l[o]))}function a(t,e=0){let n=0;for(let r=0;r<4;r++)n+=t[e+r]*c[r];return n}const l=[1,256,65536,16777216],c=[1/256,1/65536,1/16777216,1/4294967296],i=a(new Uint8ClampedArray([255,255,255,255]));function u(t){return t-Math.floor(t)}export{a as f,m as l}; +import{ae as f}from"./story-Doly9N9p.js";function m(t,e,n=0){const r=f(t,0,i);for(let o=0;o<4;o++)e[n+o]=Math.floor(256*u(r*l[o]))}function a(t,e=0){let n=0;for(let r=0;r<4;r++)n+=t[e+r]*c[r];return n}const l=[1,256,65536,16777216],c=[1/256,1/65536,1/16777216,1/4294967296],i=a(new Uint8ClampedArray([255,255,255,255]));function u(t){return t-Math.floor(t)}export{a as f,m as l}; diff --git a/custom-toc-highlight/assets/floating-ui-DKFFlLv3--KXNPa_R.js b/custom-toc-highlight/assets/floating-ui-DKFFlLv3-8lk8tQD2.js similarity index 99% rename from custom-toc-highlight/assets/floating-ui-DKFFlLv3--KXNPa_R.js rename to custom-toc-highlight/assets/floating-ui-DKFFlLv3-8lk8tQD2.js index 244d2015..46b01fe0 100644 --- a/custom-toc-highlight/assets/floating-ui-DKFFlLv3--KXNPa_R.js +++ b/custom-toc-highlight/assets/floating-ui-DKFFlLv3-8lk8tQD2.js @@ -1 +1 @@ -import{h as xt,c as Ht}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{p as Xt}from"./dom-N58V0tYi-DBU3jlah.js";import{l as Gt}from"./debounce-27Hmkkyg-Th7bw3mg.js";const Ft=["top","right","bottom","left"],vt=["start","end"],bt=Ft.reduce((t,e)=>t.concat(e,e+"-"+vt[0],e+"-"+vt[1]),[]),U=Math.min,j=Math.max,et=Math.round,tt=Math.floor,V=t=>({x:t,y:t}),Kt={left:"right",right:"left",bottom:"top",top:"bottom"},Qt={start:"end",end:"start"};function pt(t,e,n){return j(t,U(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function B(t){return t.split("-")[0]}function F(t){return t.split("-")[1]}function Wt(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}function lt(t){return["top","bottom"].includes(B(t))?"y":"x"}function ht(t){return Wt(lt(t))}function Mt(t,e,n){n===void 0&&(n=!1);const o=F(t),i=ht(t),l=gt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(r=ot(r)),[r,ot(r)]}function Zt(t){const e=ot(t);return[nt(t),e,nt(e)]}function nt(t){return t.replace(/start|end/g,e=>Qt[e])}function Jt(t,e,n){const o=["left","right"],i=["right","left"],l=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?l:r;default:return[]}}function te(t,e,n,o){const i=F(t);let l=Jt(B(t),n==="start",o);return i&&(l=l.map(r=>r+"-"+i),e&&(l=l.concat(l.map(nt)))),l}function ot(t){return t.replace(/left|right|bottom|top/g,e=>Kt[e])}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Bt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function it(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:i}=t;const l=lt(e),r=ht(e),a=gt(r),c=B(e),s=l==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,h=o[a]/2-i[a]/2;let f;switch(c){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(F(e)){case"start":f[r]-=h*(n&&s?-1:1);break;case"end":f[r]+=h*(n&&s?-1:1);break}return f}const ne=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:r}=n,a=l.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let s=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Et(s,o,c),h=o,f={},p=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:l,platform:r,elements:a,middlewareData:c}=e,{element:s,padding:u=0}=_(t,e)||{};if(s==null)return{};const d=Bt(u),h={x:n,y:o},f=ht(i),p=gt(f),m=await r.getDimensions(s),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=l.reference[p]+l.reference[f]-h[f]-l.floating[p],b=h[f]-l.reference[f],T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s));let R=T?T[x]:0;(!R||!await(r.isElement==null?void 0:r.isElement(T)))&&(R=a.floating[x]||l.floating[p]);const A=v/2-b/2,E=R/2-m[p]/2-1,O=U(d[g],E),z=U(d[w],E),L=O,G=R-m[p]-z,P=R/2-m[p]/2+A,C=pt(L,P,G),H=!c.arrow&&F(i)!=null&&P!==C&&l.reference[p]/2-(PF(o)===t),...n.filter(o=>F(o)!==t)]:n.filter(o=>B(o)===o)).filter(o=>t?F(o)===t||(e?nt(o)!==o:!1):!0)}const re=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:l,middlewareData:r,placement:a,platform:c,elements:s}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:h=bt,autoAlignment:f=!0,...p}=_(t,e),m=d!==void 0||h===bt?ie(d||null,f,h):h,y=await K(e,p),g=((n=r.autoPlacement)==null?void 0:n.index)||0,w=m[g];if(w==null)return{};const x=Mt(w,l,await(c.isRTL==null?void 0:c.isRTL(s.floating)));if(a!==w)return{reset:{placement:m[0]}};const v=[y[B(w)],y[x[0]],y[x[1]]],b=[...((o=r.autoPlacement)==null?void 0:o.overflows)||[],{placement:w,overflows:v}],T=m[g+1];if(T)return{data:{index:g+1,overflows:b},reset:{placement:T}};const R=b.map(E=>{const O=F(E.placement);return[E.placement,O&&u?E.overflows.slice(0,2).reduce((z,L)=>z+L,0):E.overflows[0],E.overflows]}).sort((E,O)=>E[1]-O[1]),A=((i=R.filter(E=>E[2].slice(0,F(E[0])?2:3).every(O=>O<=0))[0])==null?void 0:i[0])||R[0][0];return A!==a?{data:{index:g+1,overflows:b},reset:{placement:A}}:{}}}},le=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:l,rects:r,initialPlacement:a,platform:c,elements:s}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=_(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const g=B(i),w=B(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(s.floating)),v=h||(w||!m?[ot(a)]:Zt(a));!h&&p!=="none"&&v.push(...te(a,m,p,x));const b=[a,...v],T=await K(e,y),R=[];let A=((o=l.flip)==null?void 0:o.overflows)||[];if(u&&R.push(T[g]),d){const L=Mt(i,r,x);R.push(T[L[0]],T[L[1]])}if(A=[...A,{placement:i,overflows:R}],!R.every(L=>L<=0)){var E,O;const L=(((E=l.flip)==null?void 0:E.index)||0)+1,G=b[L];if(G)return{data:{index:L,overflows:A},reset:{placement:G}};let P=(O=A.filter(C=>C.overflows[0]<=0).sort((C,H)=>C.overflows[1]-H.overflows[1])[0])==null?void 0:O.placement;if(!P)switch(f){case"bestFit":{var z;const C=(z=A.map(H=>[H.placement,H.overflows.filter(M=>M>0).reduce((M,Yt)=>M+Yt,0)]).sort((H,M)=>H[1]-M[1])[0])==null?void 0:z[0];C&&(P=C);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function Rt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Tt(t){return Ft.some(e=>t[e]>=0)}const ae=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=_(t,e);switch(o){case"referenceHidden":{const l=await K(e,{...i,elementContext:"reference"}),r=Rt(l,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Tt(r)}}}case"escaped":{const l=await K(e,{...i,altBoundary:!0}),r=Rt(l,n.floating);return{data:{escapedOffsets:r,escaped:Tt(r)}}}default:return{}}}}};async function ce(t,e){const{placement:n,platform:o,elements:i}=t,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=B(n),a=F(n),c=lt(n)==="y",s=["left","top"].includes(r)?-1:1,u=l&&c?-1:1,d=_(e,t);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),c?{x:f*u,y:h*s}:{x:h*s,y:f*u}}const se=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:l,placement:r,middlewareData:a}=e,c=await ce(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:l+c.y,data:{...c,placement:r}}}}},fe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:l=!0,crossAxis:r=!1,limiter:a={fn:y=>{let{x:g,y:w}=y;return{x:g,y:w}}},...c}=_(t,e),s={x:n,y:o},u=await K(e,c),d=lt(B(i)),h=Wt(d);let f=s[h],p=s[d];if(l){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",w=f+u[y],x=f-u[g];f=pt(w,f,x)}if(r){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",w=p+u[y],x=p-u[g];p=pt(w,p,x)}const m=a.fn({...e,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function at(){return typeof window<"u"}function X(t){return Nt(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(Nt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Nt(t){return at()?t instanceof Node||t instanceof D(t).Node:!1}function S(t){return at()?t instanceof Element||t instanceof D(t).Element:!1}function W(t){return at()?t instanceof HTMLElement||t instanceof D(t).HTMLElement:!1}function Lt(t){return!at()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof D(t).ShadowRoot}function J(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function ue(t){return["table","td","th"].includes(X(t))}function ct(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function st(t){const e=yt(),n=S(t)?k(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function de(t){let e=$(t);for(;W(e)&&!Y(e);){if(st(e))return e;if(ct(e))return null;e=$(e)}return null}function yt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Y(t){return["html","body","#document"].includes(X(t))}function k(t){return D(t).getComputedStyle(t)}function ft(t){return S(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $(t){if(X(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||N(t);return Lt(e)?e.host:e}function Vt(t){const e=$(t);return Y(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&J(e)?e:Vt(e)}function Q(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Vt(t),l=i===((o=t.ownerDocument)==null?void 0:o.body),r=D(i);if(l){const a=pe(r);return e.concat(r,r.visualViewport||[],J(i)?i:[],a&&n?Q(a):[])}return e.concat(i,Q(i,[],n))}function pe(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function $t(t){const e=k(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=W(t),l=i?t.offsetWidth:n,r=i?t.offsetHeight:o,a=et(n)!==l||et(o)!==r;return a&&(n=l,o=r),{width:n,height:o,$:a}}function wt(t){return S(t)?t:t.contextElement}function q(t){const e=wt(t);if(!W(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=$t(e);let r=(l?et(n.width):n.width)/o,a=(l?et(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const me=V(0);function zt(t){const e=D(t);return!yt()||!e.visualViewport?me:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ge(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==D(t)?!1:e}function I(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),l=wt(t);let r=V(1);e&&(o?S(o)&&(r=q(o)):r=q(t));const a=ge(l,n,o)?zt(l):V(0);let c=(i.left+a.x)/r.x,s=(i.top+a.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(l){const h=D(l),f=o&&S(o)?D(o):o;let p=h,m=p.frameElement;for(;m&&o&&f!==p;){const y=q(m),g=m.getBoundingClientRect(),w=k(m),x=g.left+(m.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(m.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,s*=y.y,u*=y.x,d*=y.y,c+=x,s+=v,p=D(m),m=p.frameElement}}return it({width:u,height:d,x:c,y:s})}function he(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const l=i==="fixed",r=N(o),a=e?ct(e.floating):!1;if(o===r||a&&l)return n;let c={scrollLeft:0,scrollTop:0},s=V(1);const u=V(0),d=W(o);if((d||!d&&!l)&&((X(o)!=="body"||J(r))&&(c=ft(o)),W(o))){const h=I(o);s=q(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+u.x,y:n.y*s.y-c.scrollTop*s.y+u.y}}function ye(t){return Array.from(t.getClientRects())}function jt(t){return I(N(t)).left+ft(t).scrollLeft}function we(t){const e=N(t),n=ft(t),o=t.ownerDocument.body,i=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+jt(t);const a=-n.scrollTop;return k(o).direction==="rtl"&&(r+=j(e.clientWidth,o.clientWidth)-i),{width:i,height:l,x:r,y:a}}function xe(t,e){const n=D(t),o=N(t),i=n.visualViewport;let l=o.clientWidth,r=o.clientHeight,a=0,c=0;if(i){l=i.width,r=i.height;const s=yt();(!s||s&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:l,height:r,x:a,y:c}}function ve(t,e){const n=I(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,l=W(t)?q(t):V(1),r=t.clientWidth*l.x,a=t.clientHeight*l.y,c=i*l.x,s=o*l.y;return{width:r,height:a,x:c,y:s}}function Pt(t,e,n){let o;if(e==="viewport")o=xe(t,n);else if(e==="document")o=we(N(t));else if(S(e))o=ve(e,n);else{const i=zt(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return it(o)}function It(t,e){const n=$(t);return n===e||!S(n)||Y(n)?!1:k(n).position==="fixed"||It(n,e)}function be(t,e){const n=e.get(t);if(n)return n;let o=Q(t,[],!1).filter(a=>S(a)&&X(a)!=="body"),i=null;const l=k(t).position==="fixed";let r=l?$(t):t;for(;S(r)&&!Y(r);){const a=k(r),c=st(r);!c&&a.position==="fixed"&&(i=null),(l?!c&&!i:!c&&a.position==="static"&&i&&["absolute","fixed"].includes(i.position)||J(r)&&!c&&It(t,r))?o=o.filter(s=>s!==r):i=a,r=$(r)}return e.set(t,o),o}function Ee(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[...n==="clippingAncestors"?ct(e)?[]:be(e,this._c):[].concat(n),o],r=l[0],a=l.reduce((c,s)=>{const u=Pt(e,s,i);return c.top=j(u.top,c.top),c.right=U(u.right,c.right),c.bottom=U(u.bottom,c.bottom),c.left=j(u.left,c.left),c},Pt(e,r,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Re(t){const{width:e,height:n}=$t(t);return{width:e,height:n}}function Te(t,e,n){const o=W(e),i=N(e),l=n==="fixed",r=I(t,!0,l,e);let a={scrollLeft:0,scrollTop:0};const c=V(0);if(o||!o&&!l)if((X(e)!=="body"||J(i))&&(a=ft(e)),o){const d=I(e,!0,l,e);c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}else i&&(c.x=jt(i));const s=r.left+a.scrollLeft-c.x,u=r.top+a.scrollTop-c.y;return{x:s,y:u,width:r.width,height:r.height}}function ut(t){return k(t).position==="static"}function Dt(t,e){return!W(t)||k(t).position==="fixed"?null:e?e(t):t.offsetParent}function _t(t,e){const n=D(t);if(ct(t))return n;if(!W(t)){let i=$(t);for(;i&&!Y(i);){if(S(i)&&!ut(i))return i;i=$(i)}return n}let o=Dt(t,e);for(;o&&ue(o)&&ut(o);)o=Dt(o,e);return o&&Y(o)&&ut(o)&&!st(o)?n:o||de(t)||n}const Le=async function(t){const e=this.getOffsetParent||_t,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Pe(t){return k(t).direction==="rtl"}const mt={convertOffsetParentRelativeRectToViewportRelativeRect:he,getDocumentElement:N,getClippingRect:Ee,getOffsetParent:_t,getElementRects:Le,getClientRects:ye,getDimensions:Re,getScale:q,isElement:S,isRTL:Pe};function De(t,e){let n=null,o;const i=N(t);function l(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),l();const{left:s,top:u,width:d,height:h}=t.getBoundingClientRect();if(a||e(),!d||!h)return;const f=tt(u),p=tt(i.clientWidth-(s+d)),m=tt(i.clientHeight-(u+h)),y=tt(s),g={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:j(0,U(1,c))||1};let w=!0;function x(v){const b=v[0].intersectionRatio;if(b!==c){if(!w)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,g)}n.observe(t)}return r(!0),l}function Ae(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,s=wt(t),u=i||l?[...s?Q(s):[],...Q(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),l&&g.addEventListener("resize",n)});const d=s&&a?De(s,n):null;let h=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===s&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),s&&!c&&f.observe(s),f.observe(e));let p,m=c?I(t):null;c&&y();function y(){const g=I(t);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,p=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),l&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const Oe=se,Se=re,ke=fe,At=le,Ce=ae,He=oe,Fe=(t,e,n)=>{const o=new Map,i={platform:mt,...n},l={...i.platform,_c:o};return ne(t,e,{...i,platform:l})};function We(t){return Me(t)}function dt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Me(t){for(let e=t;e;e=dt(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=dt(t);e;e=dt(e)){if(!(e instanceof Element))continue;const n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||st(n)||e.tagName==="BODY"))return e}return null}(function(){if(Ht()){const t=mt.getOffsetParent;mt.getOffsetParent=e=>t(e,We)}})();function Ot(t){const e=window.devicePixelRatio||1;return Math.round(t*e)/e}const qt=async(t,{referenceEl:e,floatingEl:n,overlayPositioning:o="absolute",placement:i,flipDisabled:l,flipPlacements:r,offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})=>{if(!e||!n)return null;const d=Xt(n)==="rtl",{x:h,y:f,placement:p,strategy:m,middlewareData:y}=await Fe(e,n,{strategy:o,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:kt(i,d),middleware:Ne({placement:i,flipDisabled:l,flipPlacements:r?.map(v=>kt(v,d)),offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})});if(s&&y.arrow){const{x:v,y:b}=y.arrow,T=p.split("-")[0],R=v!=null?"left":"top",A=$e[T],E={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=T==="left"||T==="right"?"horizontal":"vertical"),Object.assign(s.style,{...E,[R]:`${R=="left"?v:b}px`,[T]:"100%",transform:A})}const g=y.hide?.referenceHidden?"hidden":null,w=g?"none":null;n.setAttribute(Be,p);const{open:x}=t;Object.assign(n.style,{visibility:g,pointerEvents:w,position:m,transform:x?`translate(${Ot(h)}px,${Ot(f)}px)`:"",top:0,left:0})},Be="data-placement",St=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","leading","trailing","leading-start","leading-end","trailing-start","trailing-end"],qe="bottom-start",Ue="bottom-end",Ye={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active",arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"};function Ne({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:o,offsetSkidding:i,arrowEl:l,type:r}){const a=[ke(),Ce()];if(r==="menu")return[...a,At({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(r==="popover"||r==="tooltip"){const c=[...a,Oe({mainAxis:typeof o=="number"?o:0,crossAxis:typeof i=="number"?i:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?c.push(Se({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(At(n?{fallbackPlacements:n}:{})),l&&c.push(He({element:l})),c}return[]}function Xe(t,e){const n=t.filter(o=>St.includes(o));return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${St.map(o=>`"${o}"`).join(", ").trim()}`,{el:e}),n}function kt(t,e=!1){const n=["left","right"];return e&&n.reverse(),t.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function Ge(t,e,n=!1){if(!(!t.open||!e.floatingEl||!e.referenceEl)){if(!Z.get(t))return Ut(t,e.referenceEl,e.floatingEl);await(n?Ve(t):qt)(t,e)}}function Ve(t){let e=rt.get(t);return e||(e=Gt(qt,xt.reposition,{leading:!0,maxWait:xt.reposition}),rt.set(t,e),e)}const $e={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},Z=new WeakMap,rt=new WeakMap;async function Ut(t,e,n){if(!n.isConnected)return;const o=Ht()?Ae:(r,a,c)=>(c(),()=>{});Z.set(t,{state:"pending"});let i;const l=o(e,n,()=>{const r=t.reposition();i||(i=r)});return Z.set(t,{state:"active",cleanUp:l}),i}async function Ke(t,e,n){if(!(!n||!e)&&(ze(t,e,n),Object.assign(n.style,{visibility:"hidden",pointerEvents:"none",position:t.overlayPositioning}),!!t.open))return Ut(t,e,n)}function ze(t,e,n){if(!n||!e)return;const o=Z.get(t);o?.state==="active"&&o.cleanUp(),Z.delete(t),rt.get(t)?.cancel(),rt.delete(t)}const Ct=4,Qe=Math.ceil(Math.hypot(Ct,Ct));export{Ue as $,Xe as I,Ke as U,qe as V,Qe as X,Ge as _,Ye as j,ze as q}; +import{h as xt,c as Ht}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{p as Xt}from"./dom-N58V0tYi-DBU3jlah.js";import{l as Gt}from"./debounce-27Hmkkyg-Th7bw3mg.js";const Ft=["top","right","bottom","left"],vt=["start","end"],bt=Ft.reduce((t,e)=>t.concat(e,e+"-"+vt[0],e+"-"+vt[1]),[]),U=Math.min,j=Math.max,et=Math.round,tt=Math.floor,V=t=>({x:t,y:t}),Kt={left:"right",right:"left",bottom:"top",top:"bottom"},Qt={start:"end",end:"start"};function pt(t,e,n){return j(t,U(e,n))}function _(t,e){return typeof t=="function"?t(e):t}function B(t){return t.split("-")[0]}function F(t){return t.split("-")[1]}function Wt(t){return t==="x"?"y":"x"}function gt(t){return t==="y"?"height":"width"}function lt(t){return["top","bottom"].includes(B(t))?"y":"x"}function ht(t){return Wt(lt(t))}function Mt(t,e,n){n===void 0&&(n=!1);const o=F(t),i=ht(t),l=gt(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(r=ot(r)),[r,ot(r)]}function Zt(t){const e=ot(t);return[nt(t),e,nt(e)]}function nt(t){return t.replace(/start|end/g,e=>Qt[e])}function Jt(t,e,n){const o=["left","right"],i=["right","left"],l=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?l:r;default:return[]}}function te(t,e,n,o){const i=F(t);let l=Jt(B(t),n==="start",o);return i&&(l=l.map(r=>r+"-"+i),e&&(l=l.concat(l.map(nt)))),l}function ot(t){return t.replace(/left|right|bottom|top/g,e=>Kt[e])}function ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Bt(t){return typeof t!="number"?ee(t):{top:t,right:t,bottom:t,left:t}}function it(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:i}=t;const l=lt(e),r=ht(e),a=gt(r),c=B(e),s=l==="y",u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,h=o[a]/2-i[a]/2;let f;switch(c){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:d};break;case"left":f={x:o.x-i.width,y:d};break;default:f={x:o.x,y:o.y}}switch(F(e)){case"start":f[r]-=h*(n&&s?-1:1);break;case"end":f[r]+=h*(n&&s?-1:1);break}return f}const ne=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:l=[],platform:r}=n,a=l.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let s=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Et(s,o,c),h=o,f={},p=0;for(let m=0;m({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:l,platform:r,elements:a,middlewareData:c}=e,{element:s,padding:u=0}=_(t,e)||{};if(s==null)return{};const d=Bt(u),h={x:n,y:o},f=ht(i),p=gt(f),m=await r.getDimensions(s),y=f==="y",g=y?"top":"left",w=y?"bottom":"right",x=y?"clientHeight":"clientWidth",v=l.reference[p]+l.reference[f]-h[f]-l.floating[p],b=h[f]-l.reference[f],T=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s));let R=T?T[x]:0;(!R||!await(r.isElement==null?void 0:r.isElement(T)))&&(R=a.floating[x]||l.floating[p]);const A=v/2-b/2,E=R/2-m[p]/2-1,O=U(d[g],E),z=U(d[w],E),L=O,G=R-m[p]-z,P=R/2-m[p]/2+A,C=pt(L,P,G),H=!c.arrow&&F(i)!=null&&P!==C&&l.reference[p]/2-(PF(o)===t),...n.filter(o=>F(o)!==t)]:n.filter(o=>B(o)===o)).filter(o=>t?F(o)===t||(e?nt(o)!==o:!1):!0)}const re=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:l,middlewareData:r,placement:a,platform:c,elements:s}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:h=bt,autoAlignment:f=!0,...p}=_(t,e),m=d!==void 0||h===bt?ie(d||null,f,h):h,y=await K(e,p),g=((n=r.autoPlacement)==null?void 0:n.index)||0,w=m[g];if(w==null)return{};const x=Mt(w,l,await(c.isRTL==null?void 0:c.isRTL(s.floating)));if(a!==w)return{reset:{placement:m[0]}};const v=[y[B(w)],y[x[0]],y[x[1]]],b=[...((o=r.autoPlacement)==null?void 0:o.overflows)||[],{placement:w,overflows:v}],T=m[g+1];if(T)return{data:{index:g+1,overflows:b},reset:{placement:T}};const R=b.map(E=>{const O=F(E.placement);return[E.placement,O&&u?E.overflows.slice(0,2).reduce((z,L)=>z+L,0):E.overflows[0],E.overflows]}).sort((E,O)=>E[1]-O[1]),A=((i=R.filter(E=>E[2].slice(0,F(E[0])?2:3).every(O=>O<=0))[0])==null?void 0:i[0])||R[0][0];return A!==a?{data:{index:g+1,overflows:b},reset:{placement:A}}:{}}}},le=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:l,rects:r,initialPlacement:a,platform:c,elements:s}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=_(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const g=B(i),w=B(a)===a,x=await(c.isRTL==null?void 0:c.isRTL(s.floating)),v=h||(w||!m?[ot(a)]:Zt(a));!h&&p!=="none"&&v.push(...te(a,m,p,x));const b=[a,...v],T=await K(e,y),R=[];let A=((o=l.flip)==null?void 0:o.overflows)||[];if(u&&R.push(T[g]),d){const L=Mt(i,r,x);R.push(T[L[0]],T[L[1]])}if(A=[...A,{placement:i,overflows:R}],!R.every(L=>L<=0)){var E,O;const L=(((E=l.flip)==null?void 0:E.index)||0)+1,G=b[L];if(G)return{data:{index:L,overflows:A},reset:{placement:G}};let P=(O=A.filter(C=>C.overflows[0]<=0).sort((C,H)=>C.overflows[1]-H.overflows[1])[0])==null?void 0:O.placement;if(!P)switch(f){case"bestFit":{var z;const C=(z=A.map(H=>[H.placement,H.overflows.filter(M=>M>0).reduce((M,Yt)=>M+Yt,0)]).sort((H,M)=>H[1]-M[1])[0])==null?void 0:z[0];C&&(P=C);break}case"initialPlacement":P=a;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function Rt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Tt(t){return Ft.some(e=>t[e]>=0)}const ae=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=_(t,e);switch(o){case"referenceHidden":{const l=await K(e,{...i,elementContext:"reference"}),r=Rt(l,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Tt(r)}}}case"escaped":{const l=await K(e,{...i,altBoundary:!0}),r=Rt(l,n.floating);return{data:{escapedOffsets:r,escaped:Tt(r)}}}default:return{}}}}};async function ce(t,e){const{placement:n,platform:o,elements:i}=t,l=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=B(n),a=F(n),c=lt(n)==="y",s=["left","top"].includes(r)?-1:1,u=l&&c?-1:1,d=_(e,t);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),c?{x:f*u,y:h*s}:{x:h*s,y:f*u}}const se=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:l,placement:r,middlewareData:a}=e,c=await ce(e,t);return r===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:l+c.y,data:{...c,placement:r}}}}},fe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i}=e,{mainAxis:l=!0,crossAxis:r=!1,limiter:a={fn:y=>{let{x:g,y:w}=y;return{x:g,y:w}}},...c}=_(t,e),s={x:n,y:o},u=await K(e,c),d=lt(B(i)),h=Wt(d);let f=s[h],p=s[d];if(l){const y=h==="y"?"top":"left",g=h==="y"?"bottom":"right",w=f+u[y],x=f-u[g];f=pt(w,f,x)}if(r){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",w=p+u[y],x=p-u[g];p=pt(w,p,x)}const m=a.fn({...e,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function at(){return typeof window<"u"}function X(t){return Nt(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function N(t){var e;return(e=(Nt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Nt(t){return at()?t instanceof Node||t instanceof D(t).Node:!1}function S(t){return at()?t instanceof Element||t instanceof D(t).Element:!1}function W(t){return at()?t instanceof HTMLElement||t instanceof D(t).HTMLElement:!1}function Lt(t){return!at()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof D(t).ShadowRoot}function J(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function ue(t){return["table","td","th"].includes(X(t))}function ct(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function st(t){const e=yt(),n=S(t)?k(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function de(t){let e=$(t);for(;W(e)&&!Y(e);){if(st(e))return e;if(ct(e))return null;e=$(e)}return null}function yt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Y(t){return["html","body","#document"].includes(X(t))}function k(t){return D(t).getComputedStyle(t)}function ft(t){return S(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $(t){if(X(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Lt(t)&&t.host||N(t);return Lt(e)?e.host:e}function Vt(t){const e=$(t);return Y(e)?t.ownerDocument?t.ownerDocument.body:t.body:W(e)&&J(e)?e:Vt(e)}function Q(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Vt(t),l=i===((o=t.ownerDocument)==null?void 0:o.body),r=D(i);if(l){const a=pe(r);return e.concat(r,r.visualViewport||[],J(i)?i:[],a&&n?Q(a):[])}return e.concat(i,Q(i,[],n))}function pe(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function $t(t){const e=k(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=W(t),l=i?t.offsetWidth:n,r=i?t.offsetHeight:o,a=et(n)!==l||et(o)!==r;return a&&(n=l,o=r),{width:n,height:o,$:a}}function wt(t){return S(t)?t:t.contextElement}function q(t){const e=wt(t);if(!W(e))return V(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=$t(e);let r=(l?et(n.width):n.width)/o,a=(l?et(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const me=V(0);function zt(t){const e=D(t);return!yt()||!e.visualViewport?me:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ge(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==D(t)?!1:e}function I(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),l=wt(t);let r=V(1);e&&(o?S(o)&&(r=q(o)):r=q(t));const a=ge(l,n,o)?zt(l):V(0);let c=(i.left+a.x)/r.x,s=(i.top+a.y)/r.y,u=i.width/r.x,d=i.height/r.y;if(l){const h=D(l),f=o&&S(o)?D(o):o;let p=h,m=p.frameElement;for(;m&&o&&f!==p;){const y=q(m),g=m.getBoundingClientRect(),w=k(m),x=g.left+(m.clientLeft+parseFloat(w.paddingLeft))*y.x,v=g.top+(m.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,s*=y.y,u*=y.x,d*=y.y,c+=x,s+=v,p=D(m),m=p.frameElement}}return it({width:u,height:d,x:c,y:s})}function he(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const l=i==="fixed",r=N(o),a=e?ct(e.floating):!1;if(o===r||a&&l)return n;let c={scrollLeft:0,scrollTop:0},s=V(1);const u=V(0),d=W(o);if((d||!d&&!l)&&((X(o)!=="body"||J(r))&&(c=ft(o)),W(o))){const h=I(o);s=q(o),u.x=h.x+o.clientLeft,u.y=h.y+o.clientTop}return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+u.x,y:n.y*s.y-c.scrollTop*s.y+u.y}}function ye(t){return Array.from(t.getClientRects())}function jt(t){return I(N(t)).left+ft(t).scrollLeft}function we(t){const e=N(t),n=ft(t),o=t.ownerDocument.body,i=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+jt(t);const a=-n.scrollTop;return k(o).direction==="rtl"&&(r+=j(e.clientWidth,o.clientWidth)-i),{width:i,height:l,x:r,y:a}}function xe(t,e){const n=D(t),o=N(t),i=n.visualViewport;let l=o.clientWidth,r=o.clientHeight,a=0,c=0;if(i){l=i.width,r=i.height;const s=yt();(!s||s&&e==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:l,height:r,x:a,y:c}}function ve(t,e){const n=I(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,l=W(t)?q(t):V(1),r=t.clientWidth*l.x,a=t.clientHeight*l.y,c=i*l.x,s=o*l.y;return{width:r,height:a,x:c,y:s}}function Pt(t,e,n){let o;if(e==="viewport")o=xe(t,n);else if(e==="document")o=we(N(t));else if(S(e))o=ve(e,n);else{const i=zt(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return it(o)}function It(t,e){const n=$(t);return n===e||!S(n)||Y(n)?!1:k(n).position==="fixed"||It(n,e)}function be(t,e){const n=e.get(t);if(n)return n;let o=Q(t,[],!1).filter(a=>S(a)&&X(a)!=="body"),i=null;const l=k(t).position==="fixed";let r=l?$(t):t;for(;S(r)&&!Y(r);){const a=k(r),c=st(r);!c&&a.position==="fixed"&&(i=null),(l?!c&&!i:!c&&a.position==="static"&&i&&["absolute","fixed"].includes(i.position)||J(r)&&!c&&It(t,r))?o=o.filter(s=>s!==r):i=a,r=$(r)}return e.set(t,o),o}function Ee(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[...n==="clippingAncestors"?ct(e)?[]:be(e,this._c):[].concat(n),o],r=l[0],a=l.reduce((c,s)=>{const u=Pt(e,s,i);return c.top=j(u.top,c.top),c.right=U(u.right,c.right),c.bottom=U(u.bottom,c.bottom),c.left=j(u.left,c.left),c},Pt(e,r,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Re(t){const{width:e,height:n}=$t(t);return{width:e,height:n}}function Te(t,e,n){const o=W(e),i=N(e),l=n==="fixed",r=I(t,!0,l,e);let a={scrollLeft:0,scrollTop:0};const c=V(0);if(o||!o&&!l)if((X(e)!=="body"||J(i))&&(a=ft(e)),o){const d=I(e,!0,l,e);c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}else i&&(c.x=jt(i));const s=r.left+a.scrollLeft-c.x,u=r.top+a.scrollTop-c.y;return{x:s,y:u,width:r.width,height:r.height}}function ut(t){return k(t).position==="static"}function Dt(t,e){return!W(t)||k(t).position==="fixed"?null:e?e(t):t.offsetParent}function _t(t,e){const n=D(t);if(ct(t))return n;if(!W(t)){let i=$(t);for(;i&&!Y(i);){if(S(i)&&!ut(i))return i;i=$(i)}return n}let o=Dt(t,e);for(;o&&ue(o)&&ut(o);)o=Dt(o,e);return o&&Y(o)&&ut(o)&&!st(o)?n:o||de(t)||n}const Le=async function(t){const e=this.getOffsetParent||_t,n=this.getDimensions,o=await n(t.floating);return{reference:Te(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Pe(t){return k(t).direction==="rtl"}const mt={convertOffsetParentRelativeRectToViewportRelativeRect:he,getDocumentElement:N,getClippingRect:Ee,getOffsetParent:_t,getElementRects:Le,getClientRects:ye,getDimensions:Re,getScale:q,isElement:S,isRTL:Pe};function De(t,e){let n=null,o;const i=N(t);function l(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function r(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),l();const{left:s,top:u,width:d,height:h}=t.getBoundingClientRect();if(a||e(),!d||!h)return;const f=tt(u),p=tt(i.clientWidth-(s+d)),m=tt(i.clientHeight-(u+h)),y=tt(s),g={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:j(0,U(1,c))||1};let w=!0;function x(v){const b=v[0].intersectionRatio;if(b!==c){if(!w)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}w=!1}try{n=new IntersectionObserver(x,{...g,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,g)}n.observe(t)}return r(!0),l}function Ae(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:l=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,s=wt(t),u=i||l?[...s?Q(s):[],...Q(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),l&&g.addEventListener("resize",n)});const d=s&&a?De(s,n):null;let h=-1,f=null;r&&(f=new ResizeObserver(g=>{let[w]=g;w&&w.target===s&&f&&(f.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=f)==null||x.observe(e)})),n()}),s&&!c&&f.observe(s),f.observe(e));let p,m=c?I(t):null;c&&y();function y(){const g=I(t);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&n(),m=g,p=requestAnimationFrame(y)}return n(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",n),l&&w.removeEventListener("resize",n)}),d?.(),(g=f)==null||g.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const Oe=se,Se=re,ke=fe,At=le,Ce=ae,He=oe,Fe=(t,e,n)=>{const o=new Map,i={platform:mt,...n},l={...i.platform,_c:o};return ne(t,e,{...i,platform:l})};function We(t){return Me(t)}function dt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function Me(t){for(let e=t;e;e=dt(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=dt(t);e;e=dt(e)){if(!(e instanceof Element))continue;const n=getComputedStyle(e);if(n.display!=="contents"&&(n.position!=="static"||st(n)||e.tagName==="BODY"))return e}return null}(function(){if(Ht()){const t=mt.getOffsetParent;mt.getOffsetParent=e=>t(e,We)}})();function Ot(t){const e=window.devicePixelRatio||1;return Math.round(t*e)/e}const qt=async(t,{referenceEl:e,floatingEl:n,overlayPositioning:o="absolute",placement:i,flipDisabled:l,flipPlacements:r,offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})=>{if(!e||!n)return null;const d=Xt(n)==="rtl",{x:h,y:f,placement:p,strategy:m,middlewareData:y}=await Fe(e,n,{strategy:o,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:kt(i,d),middleware:Ne({placement:i,flipDisabled:l,flipPlacements:r?.map(v=>kt(v,d)),offsetDistance:a,offsetSkidding:c,arrowEl:s,type:u})});if(s&&y.arrow){const{x:v,y:b}=y.arrow,T=p.split("-")[0],R=v!=null?"left":"top",A=$e[T],E={left:"",top:"",bottom:"",right:""};"floatingLayout"in t&&(t.floatingLayout=T==="left"||T==="right"?"horizontal":"vertical"),Object.assign(s.style,{...E,[R]:`${R=="left"?v:b}px`,[T]:"100%",transform:A})}const g=y.hide?.referenceHidden?"hidden":null,w=g?"none":null;n.setAttribute(Be,p);const{open:x}=t;Object.assign(n.style,{visibility:g,pointerEvents:w,position:m,transform:x?`translate(${Ot(h)}px,${Ot(f)}px)`:"",top:0,left:0})},Be="data-placement",St=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end","leading","trailing","leading-start","leading-end","trailing-start","trailing-end"],qe="bottom-start",Ue="bottom-end",Ye={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active",arrow:"calcite-floating-ui-arrow",arrowStroke:"calcite-floating-ui-arrow__stroke"};function Ne({placement:t,flipDisabled:e,flipPlacements:n,offsetDistance:o,offsetSkidding:i,arrowEl:l,type:r}){const a=[ke(),Ce()];if(r==="menu")return[...a,At({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(r==="popover"||r==="tooltip"){const c=[...a,Oe({mainAxis:typeof o=="number"?o:0,crossAxis:typeof i=="number"?i:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?c.push(Se({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(At(n?{fallbackPlacements:n}:{})),l&&c.push(He({element:l})),c}return[]}function Xe(t,e){const n=t.filter(o=>St.includes(o));return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${St.map(o=>`"${o}"`).join(", ").trim()}`,{el:e}),n}function kt(t,e=!1){const n=["left","right"];return e&&n.reverse(),t.replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function Ge(t,e,n=!1){if(!(!t.open||!e.floatingEl||!e.referenceEl)){if(!Z.get(t))return Ut(t,e.referenceEl,e.floatingEl);await(n?Ve(t):qt)(t,e)}}function Ve(t){let e=rt.get(t);return e||(e=Gt(qt,xt.reposition,{leading:!0,maxWait:xt.reposition}),rt.set(t,e),e)}const $e={top:"",left:"rotate(-90deg)",bottom:"rotate(180deg)",right:"rotate(90deg)"},Z=new WeakMap,rt=new WeakMap;async function Ut(t,e,n){if(!n.isConnected)return;const o=Ht()?Ae:(r,a,c)=>(c(),()=>{});Z.set(t,{state:"pending"});let i;const l=o(e,n,()=>{const r=t.reposition();i||(i=r)});return Z.set(t,{state:"active",cleanUp:l}),i}async function Ke(t,e,n){if(!(!n||!e)&&(ze(t,e,n),Object.assign(n.style,{visibility:"hidden",pointerEvents:"none",position:t.overlayPositioning}),!!t.open))return Ut(t,e,n)}function ze(t,e,n){if(!n||!e)return;const o=Z.get(t);o?.state==="active"&&o.cleanUp(),Z.delete(t),rt.get(t)?.cancel(),rt.delete(t)}const Ct=4,Qe=Math.ceil(Math.hypot(Ct,Ct));export{Ue as $,Xe as I,Ke as U,qe as V,Qe as X,Ge as _,Ye as j,ze as q}; diff --git a/custom-toc-highlight/assets/form-CRSw616T-DZVFUlxN.js b/custom-toc-highlight/assets/form-CRSw616T-wY3ZjFlq.js similarity index 98% rename from custom-toc-highlight/assets/form-CRSw616T-DZVFUlxN.js rename to custom-toc-highlight/assets/form-CRSw616T-wY3ZjFlq.js index b1aaba6f..c5c8910b 100644 --- a/custom-toc-highlight/assets/form-CRSw616T-DZVFUlxN.js +++ b/custom-toc-highlight/assets/form-CRSw616T-wY3ZjFlq.js @@ -1 +1 @@ -import{a as M}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{U as L,T as p}from"./dom-N58V0tYi-DBU3jlah.js";const A=["calcite-input","calcite-input-number","calcite-input-text","calcite-text-area"];function w(e){return`${e.split("-").map((n,i)=>i===0?n:`${n[0].toUpperCase()}${n.slice(1)}`).join("")}${A.includes(e)?"Input":"Change"}`}const f="hidden-form-input";function h(e){return"checked"in e}const m=new WeakMap,E=new WeakSet;function q(e,n){if(p(n.parentElement,"[form]"))return!0;const i="calciteInternalFormComponentRegister";let t=!1;return e.addEventListener(i,a=>{t=a.composedPath().some(s=>E.has(s)),a.stopPropagation()},{once:!0}),n.dispatchEvent(new CustomEvent(i,{bubbles:!0,composed:!0})),t}function F(e,{status:n,message:i,icon:t}){"status"in e&&(e.status=n),"validationIcon"in e&&typeof e.validationIcon!="string"&&(e.validationIcon=t),"validationMessage"in e&&!e.validationMessage&&(e.validationMessage=i)}function y(e){return e.nodeName==="CALCITE-RADIO-BUTTON"?p(e,"calcite-radio-button-group"):e}const S=new CustomEvent("calciteInvalid",{bubbles:!0,composed:!0});function g(e){const n=e?.target,i=n?.validationMessage,t=y(n?.parentElement);if(!t)return;const a=t?.nodeName?.toLowerCase(),s=a?.split("-");if(s.length<2||s[0]!=="calcite")return;e?.preventDefault(),"validity"in t&&(t.validity=n?.validity),t.dispatchEvent(S),F(t,{message:i,icon:!0,status:"invalid"});const c=w(a);t.addEventListener(c,()=>{"status"in t&&(t.status="idle"),"validationIcon"in t&&!t.validationIcon&&(t.validationIcon=!1),"validationMessage"in t&&t.validationMessage===i&&(t.validationMessage=""),"validity"in t&&(t.validity=n?.validity)},{once:!0})}function R(e){const{formEl:n}=e;return n?(n.addEventListener("invalid",g,!0),n.requestSubmit(),n.removeEventListener("invalid",g,!0),requestAnimationFrame(()=>{const i=n.querySelectorAll("[status=invalid]");for(const t of i)if(t?.validationMessage){t?.setFocus();break}}),!0):!1}function T(e){e.formEl?.reset()}function O(e){const{el:n,value:i}=e,t=$(e);if(!t||q(t,n))return;e.formEl=t,e.defaultValue=i,h(e)&&(e.defaultChecked=e.checked);const a=(e.onFormReset||x).bind(e);t.addEventListener("reset",a),m.set(e.el,a),E.add(n)}function $(e){const{el:n,form:i}=e;return i?L(n,{id:i}):p(n,"form")}function x(){if("status"in this&&(this.status="idle"),"validationIcon"in this&&(this.validationIcon=!1),"validationMessage"in this&&(this.validationMessage=""),h(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function P(e){const{el:n,formEl:i}=e;if(!i)return;const t=m.get(n);i.removeEventListener("reset",t),m.delete(n),e.formEl=null,E.delete(n)}const D="calciteInternalHiddenInputInput",k=e=>{e.target.dispatchEvent(new CustomEvent(D,{bubbles:!0}))},b=e=>e.removeEventListener("input",k);function V(e){const{el:n,formEl:i,name:t,value:a}=e,{ownerDocument:s}=n,c=n.querySelectorAll(`input[slot="${f}"]`);if(!i||!t){c.forEach(o=>{b(o),o.remove()});return}const v=Array.isArray(a)?a:[a],l=[],d=new Set;c.forEach(o=>{const r=v.find(C=>C==o.value);r!=null?(d.add(r),I(e,o,r)):l.push(o)});let u;v.forEach(o=>{if(d.has(o))return;let r=l.pop();r||(r=s.createElement("input"),r.slot=f),u||(u=s.createDocumentFragment()),u.append(r),r.addEventListener("input",k),I(e,r,o)}),u&&n.append(u),l.forEach(o=>{b(o),o.remove()})}function I(e,n,i){const{defaultValue:t,disabled:a,form:s,name:c,required:v}=e;n.defaultValue=t,n.disabled=a,n.name=c,n.required=v,n.tabIndex=-1,s?n.setAttribute("form",s):n.removeAttribute("form"),h(e)?(n.checked=e.checked,n.defaultChecked=e.defaultChecked,n.value=e.checked?i||"on":""):n.value=i||"",e.syncHiddenFormInput?.(n);const l=y(e.el);if(l&&"validity"in l)for(const d in{...n?.validity})l.validity[d]=n.validity[d]}const U=({component:e})=>(V(e),M("slot",{name:f}));export{R as D,O as H,$ as I,P as N,U as P,T as V,D as y}; +import{a as M}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{U as L,T as p}from"./dom-N58V0tYi-DBU3jlah.js";const A=["calcite-input","calcite-input-number","calcite-input-text","calcite-text-area"];function w(e){return`${e.split("-").map((n,i)=>i===0?n:`${n[0].toUpperCase()}${n.slice(1)}`).join("")}${A.includes(e)?"Input":"Change"}`}const f="hidden-form-input";function h(e){return"checked"in e}const m=new WeakMap,E=new WeakSet;function q(e,n){if(p(n.parentElement,"[form]"))return!0;const i="calciteInternalFormComponentRegister";let t=!1;return e.addEventListener(i,a=>{t=a.composedPath().some(s=>E.has(s)),a.stopPropagation()},{once:!0}),n.dispatchEvent(new CustomEvent(i,{bubbles:!0,composed:!0})),t}function F(e,{status:n,message:i,icon:t}){"status"in e&&(e.status=n),"validationIcon"in e&&typeof e.validationIcon!="string"&&(e.validationIcon=t),"validationMessage"in e&&!e.validationMessage&&(e.validationMessage=i)}function y(e){return e.nodeName==="CALCITE-RADIO-BUTTON"?p(e,"calcite-radio-button-group"):e}const S=new CustomEvent("calciteInvalid",{bubbles:!0,composed:!0});function g(e){const n=e?.target,i=n?.validationMessage,t=y(n?.parentElement);if(!t)return;const a=t?.nodeName?.toLowerCase(),s=a?.split("-");if(s.length<2||s[0]!=="calcite")return;e?.preventDefault(),"validity"in t&&(t.validity=n?.validity),t.dispatchEvent(S),F(t,{message:i,icon:!0,status:"invalid"});const c=w(a);t.addEventListener(c,()=>{"status"in t&&(t.status="idle"),"validationIcon"in t&&!t.validationIcon&&(t.validationIcon=!1),"validationMessage"in t&&t.validationMessage===i&&(t.validationMessage=""),"validity"in t&&(t.validity=n?.validity)},{once:!0})}function R(e){const{formEl:n}=e;return n?(n.addEventListener("invalid",g,!0),n.requestSubmit(),n.removeEventListener("invalid",g,!0),requestAnimationFrame(()=>{const i=n.querySelectorAll("[status=invalid]");for(const t of i)if(t?.validationMessage){t?.setFocus();break}}),!0):!1}function T(e){e.formEl?.reset()}function O(e){const{el:n,value:i}=e,t=$(e);if(!t||q(t,n))return;e.formEl=t,e.defaultValue=i,h(e)&&(e.defaultChecked=e.checked);const a=(e.onFormReset||x).bind(e);t.addEventListener("reset",a),m.set(e.el,a),E.add(n)}function $(e){const{el:n,form:i}=e;return i?L(n,{id:i}):p(n,"form")}function x(){if("status"in this&&(this.status="idle"),"validationIcon"in this&&(this.validationIcon=!1),"validationMessage"in this&&(this.validationMessage=""),h(this)){this.checked=this.defaultChecked;return}this.value=this.defaultValue}function P(e){const{el:n,formEl:i}=e;if(!i)return;const t=m.get(n);i.removeEventListener("reset",t),m.delete(n),e.formEl=null,E.delete(n)}const D="calciteInternalHiddenInputInput",k=e=>{e.target.dispatchEvent(new CustomEvent(D,{bubbles:!0}))},b=e=>e.removeEventListener("input",k);function V(e){const{el:n,formEl:i,name:t,value:a}=e,{ownerDocument:s}=n,c=n.querySelectorAll(`input[slot="${f}"]`);if(!i||!t){c.forEach(o=>{b(o),o.remove()});return}const v=Array.isArray(a)?a:[a],l=[],d=new Set;c.forEach(o=>{const r=v.find(C=>C==o.value);r!=null?(d.add(r),I(e,o,r)):l.push(o)});let u;v.forEach(o=>{if(d.has(o))return;let r=l.pop();r||(r=s.createElement("input"),r.slot=f),u||(u=s.createDocumentFragment()),u.append(r),r.addEventListener("input",k),I(e,r,o)}),u&&n.append(u),l.forEach(o=>{b(o),o.remove()})}function I(e,n,i){const{defaultValue:t,disabled:a,form:s,name:c,required:v}=e;n.defaultValue=t,n.disabled=a,n.name=c,n.required=v,n.tabIndex=-1,s?n.setAttribute("form",s):n.removeAttribute("form"),h(e)?(n.checked=e.checked,n.defaultChecked=e.defaultChecked,n.value=e.checked?i||"on":""):n.value=i||"",e.syncHiddenFormInput?.(n);const l=y(e.el);if(l&&"validity"in l)for(const d in{...n?.validity})l.validity[d]=n.validity[d]}const U=({component:e})=>(V(e),M("slot",{name:f}));export{R as D,O as H,$ as I,P as N,U as P,T as V,D as y}; diff --git a/custom-toc-highlight/assets/geodesicUtils-B8mFUfTk-DkviSp9u.js b/custom-toc-highlight/assets/geodesicUtils-B8mFUfTk-BNOCxMeb.js similarity index 97% rename from custom-toc-highlight/assets/geodesicUtils-B8mFUfTk-DkviSp9u.js rename to custom-toc-highlight/assets/geodesicUtils-B8mFUfTk-BNOCxMeb.js index 22793f47..f5bf2b15 100644 --- a/custom-toc-highlight/assets/geodesicUtils-B8mFUfTk-DkviSp9u.js +++ b/custom-toc-highlight/assets/geodesicUtils-B8mFUfTk-BNOCxMeb.js @@ -1 +1 @@ -import{cZ as $,o as T,di as H,dd as ee,J,aO as te,m as ne,l as se}from"./story-BfX8CRfG.js";import{i as q,d as ae,t as ie}from"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";function L(e){if(!e)return null;const n=e.wkid;if(n)return ae[n];const t=e.wkt2??e.wkt;return t?oe(t):null}function oe(e){const n=ie.exec(e);if(!n||n.length!==2)return null;const t=n[1].split(",");if(!t||t.length<3)return null;const c=parseFloat(t[1]),s=parseFloat(t[2]);return isNaN(c)||isNaN(s)?null:{a:c,f:s===0?0:1/s}}function B(e){const n=L(e);if(re(n))return n;const t=n.a*(1-n.f);return Object.assign(n,{b:t,eSq:1-(t/n.a)**2,radius:(2*n.a+t)/3,densificationRatio:1e4/((2*n.a+t)/3)})}function re(e){return e!=null&&"b"in e&&"eSq"in e&&"radius"in e}function W(e,n,t){const{a:c,eSq:s}=B(t),a=Math.sqrt(s),i=Math.sin(n[1]*q),l=c*n[0]*q;let r;return s>0?r=c*((1-s)*(i/(1-s*(i*i))-1/(2*a)*Math.log((1-a*i)/(1+a*i))))*.5:r=c*i,e[0]=l,e[1]=r,e}function C(e){return $(e)&&!!L(e)}function ue(e,n="square-meters"){if(e.some(i=>!C(i.spatialReference)))throw new T("geodesic-areas:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let i=0;i!C(c.spatialReference)))throw new T("geodesic-lengths:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let c=0;c1){for(let S=1;S<=w-1;S++)Z(a,g,p,S*n,t),h.push(a.slice());Z(a,g,p,(v+Math.floor(w-1)*n)/2,t),h.push(a.slice())}Z(a,g,p,v,t),h.push(a.slice()),M=a[0],d=a[1]}}const l=te(J,t);return e.type==="polyline"?new ne({paths:s,spatialReference:l}):new se({rings:s,spatialReference:l})}class V{constructor(n=0,t=void 0,c=void 0){this.distance=n,this.azimuth=t,this.reverseAzimuth=c}}function Z(e,n,t,c,s){const a=n[0],i=n[1],l=a*q,r=i*q,h=(t??0)*q,{a:u,b:o,f:M}=B(s),d=Math.sin(h),m=Math.cos(h),g=(1-M)*Math.tan(r),p=1/Math.sqrt(1+g*g),v=g*p,w=Math.atan2(g,m),S=p*d,F=S*S,z=1-F,f=z*(u*u-o*o)/(o*o),I=1+f/16384*(4096+f*(f*(320-175*f)-768)),O=f/1024*(256+f*(f*(74-47*f)-128));let R,N,y,x,k=c/(o*I),A=2*Math.PI;for(;Math.abs(k-A)>1e-12;)y=Math.cos(2*w+k),R=Math.sin(k),N=Math.cos(k),x=O*R*(y+O/4*(N*(2*y*y-1)-O/6*y*(4*R*R-3)*(4*y*y-3))),A=k,k=c/(o*I)+x;const b=v*R-p*N*m,j=Math.atan2(v*N+p*R*m,(1-M)*Math.sqrt(F+b*b)),D=Math.atan2(R*d,p*N-v*R*m),G=M/16*z*(4+M*(4-3*z)),P=j/q,U=(l+(D-(1-G)*M*S*(k+G*R*(y+G*N*(2*y*y-1)))))/q;return e[0]=U,e[1]=P,e}function X(e,n,t,c){const s=n[0]*q,a=n[1]*q,i=t[0]*q,l=t[1]*q,{a:r,b:h,f:u,radius:o}=B(c),M=i-s,d=Math.atan((1-u)*Math.tan(a)),m=Math.atan((1-u)*Math.tan(l)),g=Math.sin(d),p=Math.cos(d),v=Math.sin(m),w=Math.cos(m);let S,F,z,f,I,O,R,N,y,x,k=1e3,A=M;do{if(R=Math.sin(A),N=Math.cos(A),z=Math.sqrt(w*R*(w*R)+(p*v-g*w*N)*(p*v-g*w*N)),z===0)return e.distance=0,e.azimuth=void 0,e.reverseAzimuth=void 0,e;I=g*v+p*w*N,O=Math.atan2(z,I),y=p*w*R/z,F=1-y*y,f=I-2*g*v/F,isNaN(f)&&(f=0),x=u/16*F*(4+u*(4-3*F)),S=A,A=M+(1-x)*u*y*(O+x*z*(f+x*I*(2*f*f-1)))}while(Math.abs(A-S)>1e-12&&--k>0);if(k===0){const U=o,Y=Math.acos(Math.sin(a)*Math.sin(l)+Math.cos(a)*Math.cos(l)*Math.cos(i-s))*U,E=i-s,_=Math.sin(E)*Math.cos(l),K=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(E),Q=Math.atan2(_,K);return e.azimuth=Q/q,e.distance=Y,e.reverseAzimuth=void 0,e}const b=F*(r*r-h*h)/(h*h),j=b/1024*(256+b*(b*(74-47*b)-128)),D=h*(1+b/16384*(4096+b*(b*(320-175*b)-768)))*(O-j*z*(f+j/4*(I*(2*f*f-1)-j/6*f*(4*z*z-3)*(4*f*f-3)))),G=Math.atan2(w*Math.sin(A),p*v-g*w*Math.cos(A)),P=Math.atan2(p*Math.sin(A),p*v*Math.cos(A)-g*w);return e.azimuth=G/q,e.distance=D,e.reverseAzimuth=P/q,e}function pe(e){return C(e)?e:ee(e)?J.WGS84:null}export{V as D,X as E,Z as O,C as P,fe as c,ue as h,pe as u}; +import{cZ as $,o as T,di as H,dd as ee,J,aO as te,m as ne,l as se}from"./story-Doly9N9p.js";import{i as q,d as ae,t as ie}from"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";function L(e){if(!e)return null;const n=e.wkid;if(n)return ae[n];const t=e.wkt2??e.wkt;return t?oe(t):null}function oe(e){const n=ie.exec(e);if(!n||n.length!==2)return null;const t=n[1].split(",");if(!t||t.length<3)return null;const c=parseFloat(t[1]),s=parseFloat(t[2]);return isNaN(c)||isNaN(s)?null:{a:c,f:s===0?0:1/s}}function B(e){const n=L(e);if(re(n))return n;const t=n.a*(1-n.f);return Object.assign(n,{b:t,eSq:1-(t/n.a)**2,radius:(2*n.a+t)/3,densificationRatio:1e4/((2*n.a+t)/3)})}function re(e){return e!=null&&"b"in e&&"eSq"in e&&"radius"in e}function W(e,n,t){const{a:c,eSq:s}=B(t),a=Math.sqrt(s),i=Math.sin(n[1]*q),l=c*n[0]*q;let r;return s>0?r=c*((1-s)*(i/(1-s*(i*i))-1/(2*a)*Math.log((1-a*i)/(1+a*i))))*.5:r=c*i,e[0]=l,e[1]=r,e}function C(e){return $(e)&&!!L(e)}function ue(e,n="square-meters"){if(e.some(i=>!C(i.spatialReference)))throw new T("geodesic-areas:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let i=0;i!C(c.spatialReference)))throw new T("geodesic-lengths:invalid-spatial-reference","the input geometries spatial reference is not supported");const t=[];for(let c=0;c1){for(let S=1;S<=w-1;S++)Z(a,g,p,S*n,t),h.push(a.slice());Z(a,g,p,(v+Math.floor(w-1)*n)/2,t),h.push(a.slice())}Z(a,g,p,v,t),h.push(a.slice()),M=a[0],d=a[1]}}const l=te(J,t);return e.type==="polyline"?new ne({paths:s,spatialReference:l}):new se({rings:s,spatialReference:l})}class V{constructor(n=0,t=void 0,c=void 0){this.distance=n,this.azimuth=t,this.reverseAzimuth=c}}function Z(e,n,t,c,s){const a=n[0],i=n[1],l=a*q,r=i*q,h=(t??0)*q,{a:u,b:o,f:M}=B(s),d=Math.sin(h),m=Math.cos(h),g=(1-M)*Math.tan(r),p=1/Math.sqrt(1+g*g),v=g*p,w=Math.atan2(g,m),S=p*d,F=S*S,z=1-F,f=z*(u*u-o*o)/(o*o),I=1+f/16384*(4096+f*(f*(320-175*f)-768)),O=f/1024*(256+f*(f*(74-47*f)-128));let R,N,y,x,k=c/(o*I),A=2*Math.PI;for(;Math.abs(k-A)>1e-12;)y=Math.cos(2*w+k),R=Math.sin(k),N=Math.cos(k),x=O*R*(y+O/4*(N*(2*y*y-1)-O/6*y*(4*R*R-3)*(4*y*y-3))),A=k,k=c/(o*I)+x;const b=v*R-p*N*m,j=Math.atan2(v*N+p*R*m,(1-M)*Math.sqrt(F+b*b)),D=Math.atan2(R*d,p*N-v*R*m),G=M/16*z*(4+M*(4-3*z)),P=j/q,U=(l+(D-(1-G)*M*S*(k+G*R*(y+G*N*(2*y*y-1)))))/q;return e[0]=U,e[1]=P,e}function X(e,n,t,c){const s=n[0]*q,a=n[1]*q,i=t[0]*q,l=t[1]*q,{a:r,b:h,f:u,radius:o}=B(c),M=i-s,d=Math.atan((1-u)*Math.tan(a)),m=Math.atan((1-u)*Math.tan(l)),g=Math.sin(d),p=Math.cos(d),v=Math.sin(m),w=Math.cos(m);let S,F,z,f,I,O,R,N,y,x,k=1e3,A=M;do{if(R=Math.sin(A),N=Math.cos(A),z=Math.sqrt(w*R*(w*R)+(p*v-g*w*N)*(p*v-g*w*N)),z===0)return e.distance=0,e.azimuth=void 0,e.reverseAzimuth=void 0,e;I=g*v+p*w*N,O=Math.atan2(z,I),y=p*w*R/z,F=1-y*y,f=I-2*g*v/F,isNaN(f)&&(f=0),x=u/16*F*(4+u*(4-3*F)),S=A,A=M+(1-x)*u*y*(O+x*z*(f+x*I*(2*f*f-1)))}while(Math.abs(A-S)>1e-12&&--k>0);if(k===0){const U=o,Y=Math.acos(Math.sin(a)*Math.sin(l)+Math.cos(a)*Math.cos(l)*Math.cos(i-s))*U,E=i-s,_=Math.sin(E)*Math.cos(l),K=Math.cos(a)*Math.sin(l)-Math.sin(a)*Math.cos(l)*Math.cos(E),Q=Math.atan2(_,K);return e.azimuth=Q/q,e.distance=Y,e.reverseAzimuth=void 0,e}const b=F*(r*r-h*h)/(h*h),j=b/1024*(256+b*(b*(74-47*b)-128)),D=h*(1+b/16384*(4096+b*(b*(320-175*b)-768)))*(O-j*z*(f+j/4*(I*(2*f*f-1)-j/6*f*(4*z*z-3)*(4*f*f-3)))),G=Math.atan2(w*Math.sin(A),p*v-g*w*Math.cos(A)),P=Math.atan2(p*Math.sin(A),p*v*Math.cos(A)-g*w);return e.azimuth=G/q,e.distance=D,e.reverseAzimuth=P/q,e}function pe(e){return C(e)?e:ee(e)?J.WGS84:null}export{V as D,X as E,Z as O,C as P,fe as c,ue as h,pe as u}; diff --git a/custom-toc-highlight/assets/geojson-CNt_qtQf-B9F87hyc.js b/custom-toc-highlight/assets/geojson-CNt_qtQf-X0105Nc8.js similarity index 98% rename from custom-toc-highlight/assets/geojson-CNt_qtQf-B9F87hyc.js rename to custom-toc-highlight/assets/geojson-CNt_qtQf-X0105Nc8.js index b64ffe83..6b963d16 100644 --- a/custom-toc-highlight/assets/geojson-CNt_qtQf-B9F87hyc.js +++ b/custom-toc-highlight/assets/geojson-CNt_qtQf-X0105Nc8.js @@ -1 +1 @@ -import{y as $}from"./date-Cqvy-TgA-DIf-QFLz.js";import{o as m,dc as C,cp as F,ch as N}from"./story-BfX8CRfG.js";import{i as O,c as v}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";const D={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function w(t){return D[t]}function*j(t){switch(t.type){case"Feature":yield t;break;case"FeatureCollection":for(const n of t.features)n&&(yield n)}}function*I(t){if(t)switch(t.type){case"Point":yield t.coordinates;break;case"LineString":case"MultiPoint":yield*t.coordinates;break;case"MultiLineString":case"Polygon":for(const n of t.coordinates)yield*n;break;case"MultiPolygon":for(const n of t.coordinates)for(const e of n)yield*e}}function*J(t,n={}){const{geometryType:e,objectIdField:o}=n;for(const r of t){const{geometry:c,properties:y,id:i}=r;if(c&&w(c.type)!==e)continue;const f=y||{};let u;o&&(u=f[o],i==null||u||(f[o]=u=i)),yield new O(c?E(new v,c,n):null,f,null,u??void 0)}}function R(t){for(const n of t)if(n.length>2)return!0;return!1}function x(t){return!k(t)}function A(t){return k(t)}function k(t){let n=0;for(let e=0;e=0;o--)P(t,n[o],e);t.lengths.push(n.length)}function P(t,n,e){const[o,r,c]=n;t.coords.push(o,r),e.hasZ&&t.coords.push(c||0)}function K(t){switch(typeof t){case"string":return $(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function U(t,n=4326){if(!t)throw new m("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new m("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:e}=t;if(!e)return;const o=typeof e=="string"?e:e.type==="name"?e.properties.name:e.type==="EPSG"?e.properties.code:null,r=C({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!o||!r.test(o))throw new m("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:e})}function V(t,n={}){const e=[],o=new Set,r=new Set;let c,y=!1,i=null,f=!1,{geometryType:u=null}=n;for(const p of j(t)){const{geometry:g,properties:l,id:a}=p;if((!g||(u||(u=w(g.type)),w(g.type)===u))&&(y||(y=R(I(g))),f||(f=a!=null,f&&(c=typeof a,l&&(i=Object.keys(l).filter(s=>l[s]===a)))),l&&i&&f&&a!=null&&(i.length>1?i=i.filter(s=>l[s]===a):i.length===1&&(i=l[i[0]]===a?i:[])),l))for(const s in l){if(o.has(s))continue;const b=K(l[s]);if(b==="unknown"){r.add(s);continue}r.delete(s),o.add(s);const S=F(s);S&&e.push({name:S,alias:s,type:b})}}const h=F(i?.length===1&&i[0]||null)??void 0;if(h){for(const p of e)if(p.name===h&&N(p)){p.type="esriFieldTypeOID";break}}return{fields:e,geometryType:u,hasZ:y,objectIdFieldName:h,objectIdFieldType:c,unknownFields:Array.from(r)}}function W(t,n){return Array.from(J(j(t),n))}export{U as X,V as Y,W as _,w as h}; +import{y as $}from"./date-Cqvy-TgA-DIf-QFLz.js";import{o as m,dc as C,cp as F,ch as N}from"./story-Doly9N9p.js";import{i as O,c as v}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";const D={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function w(t){return D[t]}function*j(t){switch(t.type){case"Feature":yield t;break;case"FeatureCollection":for(const n of t.features)n&&(yield n)}}function*I(t){if(t)switch(t.type){case"Point":yield t.coordinates;break;case"LineString":case"MultiPoint":yield*t.coordinates;break;case"MultiLineString":case"Polygon":for(const n of t.coordinates)yield*n;break;case"MultiPolygon":for(const n of t.coordinates)for(const e of n)yield*e}}function*J(t,n={}){const{geometryType:e,objectIdField:o}=n;for(const r of t){const{geometry:c,properties:y,id:i}=r;if(c&&w(c.type)!==e)continue;const f=y||{};let u;o&&(u=f[o],i==null||u||(f[o]=u=i)),yield new O(c?E(new v,c,n):null,f,null,u??void 0)}}function R(t){for(const n of t)if(n.length>2)return!0;return!1}function x(t){return!k(t)}function A(t){return k(t)}function k(t){let n=0;for(let e=0;e=0;o--)P(t,n[o],e);t.lengths.push(n.length)}function P(t,n,e){const[o,r,c]=n;t.coords.push(o,r),e.hasZ&&t.coords.push(c||0)}function K(t){switch(typeof t){case"string":return $(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function U(t,n=4326){if(!t)throw new m("geojson-layer:empty","GeoJSON data is empty");if(t.type!=="Feature"&&t.type!=="FeatureCollection")throw new m("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:t});const{crs:e}=t;if(!e)return;const o=typeof e=="string"?e:e.type==="name"?e.properties.name:e.type==="EPSG"?e.properties.code:null,r=C({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!o||!r.test(o))throw new m("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:e})}function V(t,n={}){const e=[],o=new Set,r=new Set;let c,y=!1,i=null,f=!1,{geometryType:u=null}=n;for(const p of j(t)){const{geometry:g,properties:l,id:a}=p;if((!g||(u||(u=w(g.type)),w(g.type)===u))&&(y||(y=R(I(g))),f||(f=a!=null,f&&(c=typeof a,l&&(i=Object.keys(l).filter(s=>l[s]===a)))),l&&i&&f&&a!=null&&(i.length>1?i=i.filter(s=>l[s]===a):i.length===1&&(i=l[i[0]]===a?i:[])),l))for(const s in l){if(o.has(s))continue;const b=K(l[s]);if(b==="unknown"){r.add(s);continue}r.delete(s),o.add(s);const S=F(s);S&&e.push({name:S,alias:s,type:b})}}const h=F(i?.length===1&&i[0]||null)??void 0;if(h){for(const p of e)if(p.name===h&&N(p)){p.type="esriFieldTypeOID";break}}return{fields:e,geometryType:u,hasZ:y,objectIdFieldName:h,objectIdFieldType:c,unknownFields:Array.from(r)}}function W(t,n){return Array.from(J(j(t),n))}export{U as X,V as Y,W as _,w as h}; diff --git a/custom-toc-highlight/assets/geomasync-uGYsifQH-DIhokorn.js b/custom-toc-highlight/assets/geomasync-uGYsifQH-B8w8CEL3.js similarity index 94% rename from custom-toc-highlight/assets/geomasync-uGYsifQH-DIhokorn.js rename to custom-toc-highlight/assets/geomasync-uGYsifQH-B8w8CEL3.js index 081fcedf..599786e8 100644 --- a/custom-toc-highlight/assets/geomasync-uGYsifQH-DIhokorn.js +++ b/custom-toc-highlight/assets/geomasync-uGYsifQH-B8w8CEL3.js @@ -1 +1 @@ -import{y as ie,c as le,d as oe,N as b,x as ce,Z as ue,t as E,g as fe,r as T}from"./arcadeUtils-DpP0k7IY-BXaTThTL.js";import{J as f,w as m,d as V,h as G,c as W,M as z,T as s,n as i,C as g,Z as P,z as C,r as J,g as w,Y,p as D,K as M,f as R,L as de,S as q,e as S}from"./languageUtils-BYxF9hRA-BBstOXAc.js";import{I,A as j,z as p}from"./TimeOnly-DSMefxKy-BU7RNYWc.js";import{n as B}from"./portalUtils-CKN9iXwH-B2zCer9u.js";import{d,n as L,m as A,w as O,l as x,G as H,g as K,r as X,V as we,f as _,p as me}from"./story-BfX8CRfG.js";import{disjoint as he,intersects as pe,touches as ye,crosses as ve,within as ge,contains as Pe,overlaps as Ie,equals as Ae,relate as Fe,intersect as Re,union as Ne,difference as be,symmetricDifference as Se,clip as Oe,cut as xe,planarArea as Q,geodesicArea as $,planarLength as Z,geodesicLength as U,distance as De,densify as ee,geodesicDensify as ne,generalize as je,buffer as Le,geodesicBuffer as Te,offset as Ce,rotate as te,simplify as ae,isSimple as Je,convexHull as Ze,nearestCoordinate as ke,nearestVertex as ze}from"./geometryEngineAsync-D7oEu5dd-B6AE24vD.js";import"./main-ugzBrWNm.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./number-eRKYXfX9-eI8aiR_7.js";import"./shared-D1w-26bA-B8KlJvO_.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./workers-PiCjreoO-idkDTJa3.js";async function re(r,n,t){if(!we?.findCredential(r.restUrl))return null;if(r.loadStatus==="loaded"&&n===""&&r.user?.sourceJSON&&t===!1)return r.user.sourceJSON;const o={responseType:"json",query:{f:"json"}};if(t&&(o.query.returnUserLicenseTypeExtensions=!0),n===""){const e=await _(r.restUrl+"/community/self",o);if(e.data){const a=e.data;if(a?.username)return a}return null}const c=await _(r.restUrl+"/community/users/"+n,o);if(c.data){const e=c.data;return e.error?null:e}return null}function F(r,n,t){if(m(r,2,2,n,t),!(r[0]instanceof d&&r[1]instanceof d)&&!(r[0]instanceof d&&r[1]===null)&&!(r[1]instanceof d&&r[0]===null)&&(r[0]!==null||r[1]!==null))throw new s(n,i.InvalidParameter,t)}async function se(r,n){if(r.type!=="polygon"&&r.type!=="polyline"&&r.type!=="extent")return 0;let t=1;(r.spatialReference.vcsWkid||r.spatialReference.latestVcsWkid)&&(t=fe(r.spatialReference)/me(r.spatialReference));let o=0;if(r.type==="polyline")for(const e of r.paths)for(let a=1;a(F(e=f(e),n,t),e[0]===null||e[1]===null||he(e[0],e[1])))},r.functions.intersects=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&pe(e[0],e[1])))},r.functions.touches=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ye(e[0],e[1])))},r.functions.crosses=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ve(e[0],e[1])))},r.functions.within=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ge(e[0],e[1])))},r.functions.contains=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Pe(e[0],e[1])))},r.functions.overlaps=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Ie(e[0],e[1])))},r.functions.equals=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(m(e,2,2,n,t),e[0]===e[1]||(e[0]instanceof d&&e[1]instanceof d?Ae(e[0],e[1]):(V(e[0])&&V(e[1])||!!(G(e[0])&&G(e[1])||W(e[0])&&W(e[1])))&&e[0].equals(e[1]))))},r.functions.relate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,3,3,n,t),e[0]instanceof d&&e[1]instanceof d)return Fe(e[0],e[1],z(e[2]));if(e[0]instanceof d&&e[1]===null||e[1]instanceof d&&e[0]===null||e[0]===null&&e[1]===null)return!1;throw new s(n,i.InvalidParameter,t)})},r.functions.intersection=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null||e[1]===null?null:Re(e[0],e[1])))},r.functions.union=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{const a=[];if((e=f(e)).length===0)throw new s(n,i.WrongNumberOfParameters,t);if(e.length===1)if(g(e[0])){const l=f(e[0]);for(let u=0;u(F(e=f(e),n,t),e[0]===null?null:e[1]===null?I(e[0]):be(e[0],e[1])))},r.functions.symmetricdifference=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null&&e[1]===null?null:e[0]===null?I(e[1]):e[1]===null?I(e[0]):Se(e[0],e[1])))},r.functions.clip=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof L)&&e[1]!==null)throw new s(n,i.InvalidParameter,t);if(e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[1]===null?null:Oe(e[0],e[1])})},r.functions.cut=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof A)&&e[1]!==null)throw new s(n,i.InvalidParameter,t);if(e[0]===null)return[];if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[1]===null?[I(e[0])]:xe(e[0],e[1])})},r.functions.area=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:Q(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Q(e[0],j(w(e[1],-1)))})},r.functions.areageodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:$(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return $(e[0],j(w(e[1],-1)))})},r.functions.length=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Z(e[0],p(w(e[1],-1)))})},r.functions.length3d=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:a.hasZ===!0?se(a,p(w(e[1],-1))):Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[0].hasZ===!0?se(e[0],p(w(e[1],-1))):Z(e[0],p(w(e[1],-1)))})},r.functions.lengthgeodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:U(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return U(e[0],p(w(e[1],-1)))})},r.functions.distance=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);let a=e[0];(g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference));let l=e[1];if((g(e[1])||P(e[1]))&&(l=M(e[1],n.spatialReference)),!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(l instanceof d))throw new s(n,i.InvalidParameter,t);return De(a,l,p(w(e[2],-1)))})},r.functions.distancegeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);const a=e[0],l=e[1];if(!(a instanceof O))throw new s(n,i.InvalidParameter,t);if(!(l instanceof O))throw new s(n,i.InvalidParameter,t);const u=new A({paths:[],spatialReference:a.spatialReference});return u.addPath([a,l]),U(u,p(w(e[2],-1)))})},r.functions.densify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);if(a<=0)throw new s(n,i.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ee(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ee(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.densifygeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);if(a<=0)throw new s(n,i.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ne(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ne(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.generalize=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,4,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return je(e[0],a,de(w(e[2],!0)),p(w(e[3],-1)))})},r.functions.buffer=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return a===0?I(e[0]):Le(e[0],a,p(w(e[2],-1)))})},r.functions.buffergeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return a===0?I(e[0]):Te(e[0],a,p(w(e[2],-1)))})},r.functions.offset=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,6,n,t),e[0]===null)return null;if(!(e[0]instanceof x||e[0]instanceof A))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);const l=R(w(e[4],10));if(isNaN(l))throw new s(n,i.InvalidParameter,t);const u=R(w(e[5],0));if(isNaN(u))throw new s(n,i.InvalidParameter,t);return Ce(e[0],a,p(w(e[2],-1)),z(w(e[3],"round")).toLowerCase(),l,u)})},r.functions.rotate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=e[0]instanceof L?x.fromExtent(e[0]):e[0],l=R(e[1]);if(isNaN(l))throw new s(n,i.InvalidParameter,t);const u=w(e[2],null);if(u===null)return te(a,l);if(u instanceof O)return te(a,l,u);throw new s(n,i.InvalidParameter,t)})},r.functions.centroid=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);return a instanceof O?C(I(a),n.spatialReference):a instanceof x?a.centroid:a instanceof A?ie(a):a instanceof H?le(a):a instanceof L?a.center:null})},r.functions.measuretocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const l=oe(a,e[1]);return l?b.convertObjectToArcadeDictionary(l,S(n),!1,!0):null})},r.functions.pointtocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);const l=e[1];if(l===null)return null;if(!(l instanceof O))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const u=ce(a,l);return u?b.convertObjectToArcadeDictionary(u,S(n),!1,!0):null})},r.functions.distancetocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const l=ue(a,e[1]);return l?b.convertObjectToArcadeDictionary(l,S(n),!1,!0):null})},r.functions.multiparttosinglepart=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);if(e[0]instanceof O)return[C(I(e[0]),n.spatialReference)];if(e[0]instanceof L)return[C(I(e[0]),n.spatialReference)];const a=await ae(e[0]);if(a instanceof x){const l=[],u=[];for(let h=0;h{if(e=f(e),m(e,1,1,n,t),e[0]===null)return!0;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Je(e[0])})},r.functions.simplify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return ae(e[0])})},r.functions.convexhull=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Ze(e[0])})},r.functions.getuser=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{m(e,0,2,n,t);let a=w(e[1],""),l=a===!0;if(a=a===!0||a===!1?"":z(a),e.length===0||e[0]instanceof E){let h;h=n.services?.portal?n.services.portal:X.getDefault(),e.length>0&&(h=B(e[0],h));const y=await re(h,a,l);if(y){const N=JSON.parse(JSON.stringify(y));for(const v of["lastLogin","created","modified"])N[v]!==void 0&&N[v]!==null&&(N[v]=new Date(N[v]));return b.convertObjectToArcadeDictionary(N,S(n))}return null}let u=null;if(J(e[0])&&(u=e[0]),u){if(l=!1,a)return null;await u.load();const h=await u.getOwningSystemUrl();if(!h){if(!a){const v=await u.getIdentityUser();return v?b.convertObjectToArcadeDictionary({username:v},S(n)):null}return null}let y;y=n.services?.portal?n.services.portal:X.getDefault(),y=B(new E(h),y);const N=await re(y,a,l);if(N){const v=JSON.parse(JSON.stringify(N));for(const k of["lastLogin","created","modified"])v[k]!==void 0&&v[k]!==null&&(v[k]=new Date(v[k]));return b.convertObjectToArcadeDictionary(v,S(n))}return null}throw new s(n,i.InvalidParameter,t)})},r.functions.nearestcoordinate=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,i.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,i.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ke(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})},r.functions.nearestvertex=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,i.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,i.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ze(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})})}export{ln as registerFunctions}; +import{y as ie,c as le,d as oe,N as b,x as ce,Z as ue,t as E,g as fe,r as T}from"./arcadeUtils-DpP0k7IY-C-RKTwge.js";import{J as f,w as m,d as V,h as G,c as W,M as z,T as s,n as i,C as g,Z as P,z as C,r as J,g as w,Y,p as D,K as M,f as R,L as de,S as q,e as S}from"./languageUtils-BYxF9hRA-DnySuvAL.js";import{I,A as j,z as p}from"./TimeOnly-DSMefxKy-BHvJbNji.js";import{n as B}from"./portalUtils-CKN9iXwH-BDO5uTJS.js";import{d,n as L,m as A,w as O,l as x,G as H,g as K,r as X,V as we,f as _,p as me}from"./story-Doly9N9p.js";import{disjoint as he,intersects as pe,touches as ye,crosses as ve,within as ge,contains as Pe,overlaps as Ie,equals as Ae,relate as Fe,intersect as Re,union as Ne,difference as be,symmetricDifference as Se,clip as Oe,cut as xe,planarArea as Q,geodesicArea as $,planarLength as Z,geodesicLength as U,distance as De,densify as ee,geodesicDensify as ne,generalize as je,buffer as Le,geodesicBuffer as Te,offset as Ce,rotate as te,simplify as ae,isSimple as Je,convexHull as Ze,nearestCoordinate as ke,nearestVertex as ze}from"./geometryEngineAsync-D7oEu5dd-CZIKaTd9.js";import"./main-QGPoLsvl.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./number-eRKYXfX9-bCdnHRN-.js";import"./shared-D1w-26bA-BBIRhcUQ.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";async function re(r,n,t){if(!we?.findCredential(r.restUrl))return null;if(r.loadStatus==="loaded"&&n===""&&r.user?.sourceJSON&&t===!1)return r.user.sourceJSON;const o={responseType:"json",query:{f:"json"}};if(t&&(o.query.returnUserLicenseTypeExtensions=!0),n===""){const e=await _(r.restUrl+"/community/self",o);if(e.data){const a=e.data;if(a?.username)return a}return null}const c=await _(r.restUrl+"/community/users/"+n,o);if(c.data){const e=c.data;return e.error?null:e}return null}function F(r,n,t){if(m(r,2,2,n,t),!(r[0]instanceof d&&r[1]instanceof d)&&!(r[0]instanceof d&&r[1]===null)&&!(r[1]instanceof d&&r[0]===null)&&(r[0]!==null||r[1]!==null))throw new s(n,i.InvalidParameter,t)}async function se(r,n){if(r.type!=="polygon"&&r.type!=="polyline"&&r.type!=="extent")return 0;let t=1;(r.spatialReference.vcsWkid||r.spatialReference.latestVcsWkid)&&(t=fe(r.spatialReference)/me(r.spatialReference));let o=0;if(r.type==="polyline")for(const e of r.paths)for(let a=1;a(F(e=f(e),n,t),e[0]===null||e[1]===null||he(e[0],e[1])))},r.functions.intersects=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&pe(e[0],e[1])))},r.functions.touches=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ye(e[0],e[1])))},r.functions.crosses=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ve(e[0],e[1])))},r.functions.within=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&ge(e[0],e[1])))},r.functions.contains=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Pe(e[0],e[1])))},r.functions.overlaps=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]!==null&&e[1]!==null&&Ie(e[0],e[1])))},r.functions.equals=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(m(e,2,2,n,t),e[0]===e[1]||(e[0]instanceof d&&e[1]instanceof d?Ae(e[0],e[1]):(V(e[0])&&V(e[1])||!!(G(e[0])&&G(e[1])||W(e[0])&&W(e[1])))&&e[0].equals(e[1]))))},r.functions.relate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,3,3,n,t),e[0]instanceof d&&e[1]instanceof d)return Fe(e[0],e[1],z(e[2]));if(e[0]instanceof d&&e[1]===null||e[1]instanceof d&&e[0]===null||e[0]===null&&e[1]===null)return!1;throw new s(n,i.InvalidParameter,t)})},r.functions.intersection=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null||e[1]===null?null:Re(e[0],e[1])))},r.functions.union=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{const a=[];if((e=f(e)).length===0)throw new s(n,i.WrongNumberOfParameters,t);if(e.length===1)if(g(e[0])){const l=f(e[0]);for(let u=0;u(F(e=f(e),n,t),e[0]===null?null:e[1]===null?I(e[0]):be(e[0],e[1])))},r.functions.symmetricdifference=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>(F(e=f(e),n,t),e[0]===null&&e[1]===null?null:e[0]===null?I(e[1]):e[1]===null?I(e[0]):Se(e[0],e[1])))},r.functions.clip=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof L)&&e[1]!==null)throw new s(n,i.InvalidParameter,t);if(e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[1]===null?null:Oe(e[0],e[1])})},r.functions.cut=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[1]instanceof A)&&e[1]!==null)throw new s(n,i.InvalidParameter,t);if(e[0]===null)return[];if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[1]===null?[I(e[0])]:xe(e[0],e[1])})},r.functions.area=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:Q(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Q(e[0],j(w(e[1],-1)))})},r.functions.areageodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumArea(j(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=Y(e[0],n.spatialReference);return a===null?0:$(a,j(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return $(e[0],j(w(e[1],-1)))})},r.functions.length=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!1,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Z(e[0],p(w(e[1],-1)))})},r.functions.length3d=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:a.hasZ===!0?se(a,p(w(e[1],-1))):Z(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return e[0].hasZ===!0?se(e[0],p(w(e[1],-1))):Z(e[0],p(w(e[1],-1)))})},r.functions.lengthgeodetic=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(m(e,1,2,n,t),(e=f(e))[0]===null)return 0;if(J(e[0])){const a=await e[0].sumLength(p(w(e[1],-1)),!0,n.abortSignal);if(n.abortSignal.aborted)throw new s(n,i.Cancelled,t);return a}if(g(e[0])||P(e[0])){const a=D(e[0],n.spatialReference);return a===null?0:U(a,p(w(e[1],-1)))}if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return U(e[0],p(w(e[1],-1)))})},r.functions.distance=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);let a=e[0];(g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference));let l=e[1];if((g(e[1])||P(e[1]))&&(l=M(e[1],n.spatialReference)),!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(l instanceof d))throw new s(n,i.InvalidParameter,t);return De(a,l,p(w(e[2],-1)))})},r.functions.distancegeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{e=f(e),m(e,2,3,n,t);const a=e[0],l=e[1];if(!(a instanceof O))throw new s(n,i.InvalidParameter,t);if(!(l instanceof O))throw new s(n,i.InvalidParameter,t);const u=new A({paths:[],spatialReference:a.spatialReference});return u.addPath([a,l]),U(u,p(w(e[2],-1)))})},r.functions.densify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);if(a<=0)throw new s(n,i.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ee(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ee(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.densifygeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);if(a<=0)throw new s(n,i.InvalidParameter,t);return e[0]instanceof x||e[0]instanceof A?ne(e[0],a,p(w(e[2],-1))):e[0]instanceof L?ne(x.fromExtent(e[0]),a,p(w(e[2],-1))):e[0]})},r.functions.generalize=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,4,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return je(e[0],a,de(w(e[2],!0)),p(w(e[3],-1)))})},r.functions.buffer=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return a===0?I(e[0]):Le(e[0],a,p(w(e[2],-1)))})},r.functions.buffergeodetic=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);return a===0?I(e[0]):Te(e[0],a,p(w(e[2],-1)))})},r.functions.offset=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,6,n,t),e[0]===null)return null;if(!(e[0]instanceof x||e[0]instanceof A))throw new s(n,i.InvalidParameter,t);const a=R(e[1]);if(isNaN(a))throw new s(n,i.InvalidParameter,t);const l=R(w(e[4],10));if(isNaN(l))throw new s(n,i.InvalidParameter,t);const u=R(w(e[5],0));if(isNaN(u))throw new s(n,i.InvalidParameter,t);return Ce(e[0],a,p(w(e[2],-1)),z(w(e[3],"round")).toLowerCase(),l,u)})},r.functions.rotate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,3,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);const a=e[0]instanceof L?x.fromExtent(e[0]):e[0],l=R(e[1]);if(isNaN(l))throw new s(n,i.InvalidParameter,t);const u=w(e[2],null);if(u===null)return te(a,l);if(u instanceof O)return te(a,l,u);throw new s(n,i.InvalidParameter,t)})},r.functions.centroid=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=M(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);return a instanceof O?C(I(a),n.spatialReference):a instanceof x?a.centroid:a instanceof A?ie(a):a instanceof H?le(a):a instanceof L?a.center:null})},r.functions.measuretocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const l=oe(a,e[1]);return l?b.convertObjectToArcadeDictionary(l,S(n),!1,!0):null})},r.functions.pointtocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);const l=e[1];if(l===null)return null;if(!(l instanceof O))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const u=ce(a,l);return u?b.convertObjectToArcadeDictionary(u,S(n),!1,!0):null})},r.functions.distancetocoordinate=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),e[0]===null)return null;let a=e[0];if((g(e[0])||P(e[0]))&&(a=D(e[0],n.spatialReference)),a===null)return null;if(!(a instanceof d))throw new s(n,i.InvalidParameter,t);if(!(a instanceof A))throw new s(n,i.InvalidParameter,t);if(q(e[1]===!1))throw new s(n,i.InvalidParameter,t);const l=ue(a,e[1]);return l?b.convertObjectToArcadeDictionary(l,S(n),!1,!0):null})},r.functions.multiparttosinglepart=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);if(e[0]instanceof O)return[C(I(e[0]),n.spatialReference)];if(e[0]instanceof L)return[C(I(e[0]),n.spatialReference)];const a=await ae(e[0]);if(a instanceof x){const l=[],u=[];for(let h=0;h{if(e=f(e),m(e,1,1,n,t),e[0]===null)return!0;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Je(e[0])})},r.functions.simplify=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return ae(e[0])})},r.functions.convexhull=function(n,t){return r.standardFunctionAsync(n,t,(o,c,e)=>{if(e=f(e),m(e,1,1,n,t),e[0]===null)return null;if(!(e[0]instanceof d))throw new s(n,i.InvalidParameter,t);return Ze(e[0])})},r.functions.getuser=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{m(e,0,2,n,t);let a=w(e[1],""),l=a===!0;if(a=a===!0||a===!1?"":z(a),e.length===0||e[0]instanceof E){let h;h=n.services?.portal?n.services.portal:X.getDefault(),e.length>0&&(h=B(e[0],h));const y=await re(h,a,l);if(y){const N=JSON.parse(JSON.stringify(y));for(const v of["lastLogin","created","modified"])N[v]!==void 0&&N[v]!==null&&(N[v]=new Date(N[v]));return b.convertObjectToArcadeDictionary(N,S(n))}return null}let u=null;if(J(e[0])&&(u=e[0]),u){if(l=!1,a)return null;await u.load();const h=await u.getOwningSystemUrl();if(!h){if(!a){const v=await u.getIdentityUser();return v?b.convertObjectToArcadeDictionary({username:v},S(n)):null}return null}let y;y=n.services?.portal?n.services.portal:X.getDefault(),y=B(new E(h),y);const N=await re(y,a,l);if(N){const v=JSON.parse(JSON.stringify(N));for(const k of["lastLogin","created","modified"])v[k]!==void 0&&v[k]!==null&&(v[k]=new Date(v[k]));return b.convertObjectToArcadeDictionary(v,S(n))}return null}throw new s(n,i.InvalidParameter,t)})},r.functions.nearestcoordinate=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,i.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,i.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ke(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})},r.functions.nearestvertex=function(n,t){return r.standardFunctionAsync(n,t,async(o,c,e)=>{if(e=f(e),m(e,2,2,n,t),!(e[0]instanceof d||e[0]===null))throw new s(n,i.InvalidParameter,t);if(!(e[1]instanceof O||e[1]===null))throw new s(n,i.InvalidParameter,t);if(e[0]===null||e[1]===null)return null;const a=await ze(e[0],e[1]);return a===null?null:b.convertObjectToArcadeDictionary({coordinate:a.coordinate,distance:a.distance,sideOfLine:a.distance===0?"straddle":a.isRightSide?"right":"left"},S(n),!1,!0)})})}export{ln as registerFunctions}; diff --git a/custom-toc-highlight/assets/geometryEngine-CdPoFSE4-zj0NdzY3.js b/custom-toc-highlight/assets/geometryEngine-CdPoFSE4-ChEr_3ja.js similarity index 94% rename from custom-toc-highlight/assets/geometryEngine-CdPoFSE4-zj0NdzY3.js rename to custom-toc-highlight/assets/geometryEngine-CdPoFSE4-ChEr_3ja.js index d6010a7c..05c29238 100644 --- a/custom-toc-highlight/assets/geometryEngine-CdPoFSE4-zj0NdzY3.js +++ b/custom-toc-highlight/assets/geometryEngine-CdPoFSE4-ChEr_3ja.js @@ -1 +1 @@ -import{aO as p,J as l}from"./story-BfX8CRfG.js";import{G as r}from"./geometryEngineBase-DueYg7ux-CCeespPx.js";import{hydratedAdapter as n}from"./hydrated-CplJC1Fs-BIb5_ysY.js";import"./main-ugzBrWNm.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";function i(e){const t=Array.isArray(e)?e[0].spatialReference:e.spatialReference;return t?p(l,t):l.WGS84}function R(e){return r.extendedSpatialReferenceInfo(e)}function x(e,t){return r.clip(n,i(e),e,t)}function S(e,t){return r.cut(n,i(e),e,t)}function y(e,t){return r.contains(n,i(e),e,t)}function A(e,t){return r.crosses(n,i(e),e,t)}function D(e,t,a){return r.distance(n,i(e),e,t,a)}function L(e,t){return r.equals(n,i(e),e,t)}function T(e,t){return r.intersects(n,i(e),e,t)}function V(e,t){return r.touches(n,i(e),e,t)}function O(e,t){return r.within(n,i(e),e,t)}function v(e,t){return r.disjoint(n,i(e),e,t)}function z(e,t){return r.overlaps(n,i(e),e,t)}function H(e,t,a){return r.relate(n,i(e),e,t,a)}function J(e){return r.isSimple(n,i(e),e)}function C(e){return r.simplify(n,i(e),e)}function I(e,t=!1){return r.convexHull(n,i(e),e,t)}function N(e,t){return r.difference(n,i(e),e,t)}function b(e,t){return r.symmetricDifference(n,i(e),e,t)}function j(e,t){return r.intersect(n,i(e),e,t)}function q(e,t=null){return r.union(n,i(e),e,t)}function B(e,t,a,s,c,u){return r.offset(n,i(e),e,t,a,s,c,u)}function E(e,t,a,s=!1){return r.buffer(n,i(e),e,t,a,s)}function G(e,t,a,s,c,u){return r.geodesicBuffer(n,i(e),e,t,a,s,c,u)}function P(e,t,a=!0){return r.nearestCoordinate(n,i(e),e,t,a)}function W(e,t){return r.nearestVertex(n,i(e),e,t)}function k(e,t,a,s){return r.nearestVertices(n,i(e),e,t,a,s)}function f(e){return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e?e.extent?.center??null:null}function F(e,t,a){if(e==null)throw new o;const s=e.spatialReference;if((a=a??f(e))==null)throw new o;const c=e.constructor.fromJSON(r.rotate(e,t,a));return c.spatialReference=s,c}function K(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(r.flipHorizontal(e,t));return s.spatialReference=a,s}function M(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(r.flipVertical(e,t));return s.spatialReference=a,s}function Q(e,t,a,s){return r.generalize(n,i(e),e,t,a,s)}function U(e,t,a){return r.densify(n,i(e),e,t,a)}function X(e,t,a,s=0){return r.geodesicDensify(n,i(e),e,t,a,s)}function Y(e,t){return r.planarArea(n,i(e),e,t)}function Z(e,t){return r.planarLength(n,i(e),e,t)}function $(e,t,a){return r.geodesicArea(n,i(e),e,t,a)}function _(e,t,a){return r.geodesicLength(n,i(e),e,t,a)}function ee(e,t){return r.intersectLinesToPoints(n,i(e),e,t)}function te(e,t){r.changeDefaultSpatialReferenceTolerance(e,t)}function re(e){r.clearDefaultSpatialReferenceTolerance(e)}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{E as buffer,te as changeDefaultSpatialReferenceTolerance,re as clearDefaultSpatialReferenceTolerance,x as clip,y as contains,I as convexHull,A as crosses,S as cut,U as densify,N as difference,v as disjoint,D as distance,L as equals,R as extendedSpatialReferenceInfo,K as flipHorizontal,M as flipVertical,Q as generalize,$ as geodesicArea,G as geodesicBuffer,X as geodesicDensify,_ as geodesicLength,j as intersect,ee as intersectLinesToPoints,T as intersects,J as isSimple,P as nearestCoordinate,W as nearestVertex,k as nearestVertices,B as offset,z as overlaps,Y as planarArea,Z as planarLength,H as relate,F as rotate,C as simplify,b as symmetricDifference,V as touches,q as union,O as within}; +import{aO as p,J as l}from"./story-Doly9N9p.js";import{G as r}from"./geometryEngineBase-DueYg7ux-CCeespPx.js";import{hydratedAdapter as n}from"./hydrated-CplJC1Fs-McBHp1Y5.js";import"./main-QGPoLsvl.js";import"./_commonjsHelpers-BITg13Vk-KnjfkSck.js";function i(e){const t=Array.isArray(e)?e[0].spatialReference:e.spatialReference;return t?p(l,t):l.WGS84}function R(e){return r.extendedSpatialReferenceInfo(e)}function x(e,t){return r.clip(n,i(e),e,t)}function S(e,t){return r.cut(n,i(e),e,t)}function y(e,t){return r.contains(n,i(e),e,t)}function A(e,t){return r.crosses(n,i(e),e,t)}function D(e,t,a){return r.distance(n,i(e),e,t,a)}function L(e,t){return r.equals(n,i(e),e,t)}function T(e,t){return r.intersects(n,i(e),e,t)}function V(e,t){return r.touches(n,i(e),e,t)}function O(e,t){return r.within(n,i(e),e,t)}function v(e,t){return r.disjoint(n,i(e),e,t)}function z(e,t){return r.overlaps(n,i(e),e,t)}function H(e,t,a){return r.relate(n,i(e),e,t,a)}function J(e){return r.isSimple(n,i(e),e)}function C(e){return r.simplify(n,i(e),e)}function I(e,t=!1){return r.convexHull(n,i(e),e,t)}function N(e,t){return r.difference(n,i(e),e,t)}function b(e,t){return r.symmetricDifference(n,i(e),e,t)}function j(e,t){return r.intersect(n,i(e),e,t)}function q(e,t=null){return r.union(n,i(e),e,t)}function B(e,t,a,s,c,u){return r.offset(n,i(e),e,t,a,s,c,u)}function E(e,t,a,s=!1){return r.buffer(n,i(e),e,t,a,s)}function G(e,t,a,s,c,u){return r.geodesicBuffer(n,i(e),e,t,a,s,c,u)}function P(e,t,a=!0){return r.nearestCoordinate(n,i(e),e,t,a)}function W(e,t){return r.nearestVertex(n,i(e),e,t)}function k(e,t,a,s){return r.nearestVertices(n,i(e),e,t,a,s)}function f(e){return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e?e.extent?.center??null:null}function F(e,t,a){if(e==null)throw new o;const s=e.spatialReference;if((a=a??f(e))==null)throw new o;const c=e.constructor.fromJSON(r.rotate(e,t,a));return c.spatialReference=s,c}function K(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(r.flipHorizontal(e,t));return s.spatialReference=a,s}function M(e,t){if(e==null)throw new o;const a=e.spatialReference;if((t=t??f(e))==null)throw new o;const s=e.constructor.fromJSON(r.flipVertical(e,t));return s.spatialReference=a,s}function Q(e,t,a,s){return r.generalize(n,i(e),e,t,a,s)}function U(e,t,a){return r.densify(n,i(e),e,t,a)}function X(e,t,a,s=0){return r.geodesicDensify(n,i(e),e,t,a,s)}function Y(e,t){return r.planarArea(n,i(e),e,t)}function Z(e,t){return r.planarLength(n,i(e),e,t)}function $(e,t,a){return r.geodesicArea(n,i(e),e,t,a)}function _(e,t,a){return r.geodesicLength(n,i(e),e,t,a)}function ee(e,t){return r.intersectLinesToPoints(n,i(e),e,t)}function te(e,t){r.changeDefaultSpatialReferenceTolerance(e,t)}function re(e){r.clearDefaultSpatialReferenceTolerance(e)}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{E as buffer,te as changeDefaultSpatialReferenceTolerance,re as clearDefaultSpatialReferenceTolerance,x as clip,y as contains,I as convexHull,A as crosses,S as cut,U as densify,N as difference,v as disjoint,D as distance,L as equals,R as extendedSpatialReferenceInfo,K as flipHorizontal,M as flipVertical,Q as generalize,$ as geodesicArea,G as geodesicBuffer,X as geodesicDensify,_ as geodesicLength,j as intersect,ee as intersectLinesToPoints,T as intersects,J as isSimple,P as nearestCoordinate,W as nearestVertex,k as nearestVertices,B as offset,z as overlaps,Y as planarArea,Z as planarLength,H as relate,F as rotate,C as simplify,b as symmetricDifference,V as touches,q as union,O as within}; diff --git a/custom-toc-highlight/assets/geometryEngineAsync-D7oEu5dd-B6AE24vD.js b/custom-toc-highlight/assets/geometryEngineAsync-D7oEu5dd-CZIKaTd9.js similarity index 97% rename from custom-toc-highlight/assets/geometryEngineAsync-D7oEu5dd-B6AE24vD.js rename to custom-toc-highlight/assets/geometryEngineAsync-D7oEu5dd-CZIKaTd9.js index 86da004a..7a924857 100644 --- a/custom-toc-highlight/assets/geometryEngineAsync-D7oEu5dd-B6AE24vD.js +++ b/custom-toc-highlight/assets/geometryEngineAsync-D7oEu5dd-CZIKaTd9.js @@ -1 +1 @@ -import{w as l,g as w}from"./story-BfX8CRfG.js";import{q as h}from"./workers-PiCjreoO-idkDTJa3.js";import"./main-ugzBrWNm.js";function a(e){return Array.isArray(e)?e[0]?.spatialReference:e?.spatialReference}function p(e){return e&&(Array.isArray(e)?e.map(p):e.toJSON?e.toJSON():e)}function c(e){return Array.isArray(e)?e.map(t=>w(t)):w(e)}function S(e,t){let n;return Array.isArray(e)?n=e:(n=[],n.push(e),t!=null&&n.push(t)),n}let f;async function d(){return f||(f=h("geometryEngineWorker",{strategy:"distributed"})),f}async function r(e,t){return(await d()).invoke("executeGEOperation",{operation:e,parameters:p(t)})}async function m(e,t){const n=await d();return Promise.all(n.broadcast("executeGEOperation",{operation:e,parameters:p(t)}))}function O(e){return r("extendedSpatialReferenceInfo",[e])}async function D(e,t){return c(await r("clip",[a(e),e,t]))}async function J(e,t){return c(await r("cut",[a(e),e,t]))}function N(e,t){return r("contains",[a(e),e,t])}function L(e,t){return r("crosses",[a(e),e,t])}function T(e,t,n){return r("distance",[a(e),e,t,n])}function V(e,t){return r("equals",[a(e),e,t])}function v(e,t){return r("intersects",[a(e),e,t])}function E(e,t){return r("touches",[a(e),e,t])}function b(e,t){return r("within",[a(e),e,t])}function q(e,t){return r("disjoint",[a(e),e,t])}function z(e,t){return r("overlaps",[a(e),e,t])}function H(e,t,n){return r("relate",[a(e),e,t,n])}function I(e){return r("isSimple",[a(e),e])}async function P(e){return c(await r("simplify",[a(e),e]))}async function j(e,t=!1){return c(await r("convexHull",[a(e),e,t]))}async function k(e,t){return c(await r("difference",[a(e),e,t]))}async function B(e,t){return c(await r("symmetricDifference",[a(e),e,t]))}async function C(e,t){return c(await r("intersect",[a(e),e,t]))}async function G(e,t=null){const n=S(e,t);return c(await r("union",[a(n),n]))}async function W(e,t,n,i,s,u){return c(await r("offset",[a(e),e,t,n,i,s,u]))}async function F(e,t,n,i=!1){const s=[a(e),e,t,n,i];return c(await r("buffer",s))}async function K(e,t,n,i,s,u){const g=[a(e),e,t,n,i,s,u];return c(await r("geodesicBuffer",g))}async function M(e,t,n=!0){const i=await r("nearestCoordinate",[a(e),e,t,n]);return{...i,coordinate:l.fromJSON(i.coordinate)}}async function Q(e,t){const n=await r("nearestVertex",[a(e),e,t]);return{...n,coordinate:l.fromJSON(n.coordinate)}}async function U(e,t,n,i){return(await r("nearestVertices",[a(e),e,t,n,i])).map(s=>({...s,coordinate:l.fromJSON(s.coordinate)}))}function y(e){return"xmin"in e?e.center:"x"in e?e:e.extent?.center}async function X(e,t,n){if(e==null)throw new o;const i=e.spatialReference;if((n=n??y(e))==null)throw new o;const s=e.constructor.fromJSON(await r("rotate",[i,e,t,n]));return s.spatialReference=i,s}async function Y(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipHorizontal",[n,e,t]));return i.spatialReference=n,i}async function Z(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipVertical",[n,e,t]));return i.spatialReference=n,i}async function _(e,t,n,i){return c(await r("generalize",[a(e),e,t,n,i]))}async function $(e,t,n){return c(await r("densify",[a(e),e,t,n]))}async function ee(e,t,n,i=0){return c(await r("geodesicDensify",[a(e),e,t,n,i]))}function te(e,t){return r("planarArea",[a(e),e,t])}function ne(e,t){return r("planarLength",[a(e),e,t])}function re(e,t,n){return r("geodesicArea",[a(e),e,t,n])}function ae(e,t,n){return r("geodesicLength",[a(e),e,t,n])}async function ie(e,t){return c(await r("intersectLinesToPoints",[a(e),e,t]))}async function ce(e,t){await m("changeDefaultSpatialReferenceTolerance",[e,t])}async function se(e){await m("clearDefaultSpatialReferenceTolerance",[e])}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{F as buffer,ce as changeDefaultSpatialReferenceTolerance,se as clearDefaultSpatialReferenceTolerance,D as clip,N as contains,j as convexHull,L as crosses,J as cut,$ as densify,k as difference,q as disjoint,T as distance,V as equals,O as extendedSpatialReferenceInfo,Y as flipHorizontal,Z as flipVertical,_ as generalize,re as geodesicArea,K as geodesicBuffer,ee as geodesicDensify,ae as geodesicLength,C as intersect,ie as intersectLinesToPoints,v as intersects,I as isSimple,M as nearestCoordinate,Q as nearestVertex,U as nearestVertices,W as offset,z as overlaps,te as planarArea,ne as planarLength,H as relate,X as rotate,P as simplify,B as symmetricDifference,E as touches,G as union,b as within}; +import{w as l,g as w}from"./story-Doly9N9p.js";import{q as h}from"./workers-PiCjreoO-Dc6Tqm-o.js";import"./main-QGPoLsvl.js";function a(e){return Array.isArray(e)?e[0]?.spatialReference:e?.spatialReference}function p(e){return e&&(Array.isArray(e)?e.map(p):e.toJSON?e.toJSON():e)}function c(e){return Array.isArray(e)?e.map(t=>w(t)):w(e)}function S(e,t){let n;return Array.isArray(e)?n=e:(n=[],n.push(e),t!=null&&n.push(t)),n}let f;async function d(){return f||(f=h("geometryEngineWorker",{strategy:"distributed"})),f}async function r(e,t){return(await d()).invoke("executeGEOperation",{operation:e,parameters:p(t)})}async function m(e,t){const n=await d();return Promise.all(n.broadcast("executeGEOperation",{operation:e,parameters:p(t)}))}function O(e){return r("extendedSpatialReferenceInfo",[e])}async function D(e,t){return c(await r("clip",[a(e),e,t]))}async function J(e,t){return c(await r("cut",[a(e),e,t]))}function N(e,t){return r("contains",[a(e),e,t])}function L(e,t){return r("crosses",[a(e),e,t])}function T(e,t,n){return r("distance",[a(e),e,t,n])}function V(e,t){return r("equals",[a(e),e,t])}function v(e,t){return r("intersects",[a(e),e,t])}function E(e,t){return r("touches",[a(e),e,t])}function b(e,t){return r("within",[a(e),e,t])}function q(e,t){return r("disjoint",[a(e),e,t])}function z(e,t){return r("overlaps",[a(e),e,t])}function H(e,t,n){return r("relate",[a(e),e,t,n])}function I(e){return r("isSimple",[a(e),e])}async function P(e){return c(await r("simplify",[a(e),e]))}async function j(e,t=!1){return c(await r("convexHull",[a(e),e,t]))}async function k(e,t){return c(await r("difference",[a(e),e,t]))}async function B(e,t){return c(await r("symmetricDifference",[a(e),e,t]))}async function C(e,t){return c(await r("intersect",[a(e),e,t]))}async function G(e,t=null){const n=S(e,t);return c(await r("union",[a(n),n]))}async function W(e,t,n,i,s,u){return c(await r("offset",[a(e),e,t,n,i,s,u]))}async function F(e,t,n,i=!1){const s=[a(e),e,t,n,i];return c(await r("buffer",s))}async function K(e,t,n,i,s,u){const g=[a(e),e,t,n,i,s,u];return c(await r("geodesicBuffer",g))}async function M(e,t,n=!0){const i=await r("nearestCoordinate",[a(e),e,t,n]);return{...i,coordinate:l.fromJSON(i.coordinate)}}async function Q(e,t){const n=await r("nearestVertex",[a(e),e,t]);return{...n,coordinate:l.fromJSON(n.coordinate)}}async function U(e,t,n,i){return(await r("nearestVertices",[a(e),e,t,n,i])).map(s=>({...s,coordinate:l.fromJSON(s.coordinate)}))}function y(e){return"xmin"in e?e.center:"x"in e?e:e.extent?.center}async function X(e,t,n){if(e==null)throw new o;const i=e.spatialReference;if((n=n??y(e))==null)throw new o;const s=e.constructor.fromJSON(await r("rotate",[i,e,t,n]));return s.spatialReference=i,s}async function Y(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipHorizontal",[n,e,t]));return i.spatialReference=n,i}async function Z(e,t){if(e==null)throw new o;const n=e.spatialReference;if((t=t??y(e))==null)throw new o;const i=e.constructor.fromJSON(await r("flipVertical",[n,e,t]));return i.spatialReference=n,i}async function _(e,t,n,i){return c(await r("generalize",[a(e),e,t,n,i]))}async function $(e,t,n){return c(await r("densify",[a(e),e,t,n]))}async function ee(e,t,n,i=0){return c(await r("geodesicDensify",[a(e),e,t,n,i]))}function te(e,t){return r("planarArea",[a(e),e,t])}function ne(e,t){return r("planarLength",[a(e),e,t])}function re(e,t,n){return r("geodesicArea",[a(e),e,t,n])}function ae(e,t,n){return r("geodesicLength",[a(e),e,t,n])}async function ie(e,t){return c(await r("intersectLinesToPoints",[a(e),e,t]))}async function ce(e,t){await m("changeDefaultSpatialReferenceTolerance",[e,t])}async function se(e){await m("clearDefaultSpatialReferenceTolerance",[e])}class o extends Error{constructor(){super("Illegal Argument Exception")}}export{F as buffer,ce as changeDefaultSpatialReferenceTolerance,se as clearDefaultSpatialReferenceTolerance,D as clip,N as contains,j as convexHull,L as crosses,J as cut,$ as densify,k as difference,q as disjoint,T as distance,V as equals,O as extendedSpatialReferenceInfo,Y as flipHorizontal,Z as flipVertical,_ as generalize,re as geodesicArea,K as geodesicBuffer,ee as geodesicDensify,ae as geodesicLength,C as intersect,ie as intersectLinesToPoints,v as intersects,I as isSimple,M as nearestCoordinate,Q as nearestVertex,U as nearestVertices,W as offset,z as overlaps,te as planarArea,ne as planarLength,H as relate,X as rotate,P as simplify,B as symmetricDifference,E as touches,G as union,b as within}; diff --git a/custom-toc-highlight/assets/geometryServiceUtils-nsujb7BH-C2AslH-O.js b/custom-toc-highlight/assets/geometryServiceUtils-nsujb7BH-BeXUhRCo.js similarity index 69% rename from custom-toc-highlight/assets/geometryServiceUtils-nsujb7BH-C2AslH-O.js rename to custom-toc-highlight/assets/geometryServiceUtils-nsujb7BH-BeXUhRCo.js index 3e8fde6b..838b55d9 100644 --- a/custom-toc-highlight/assets/geometryServiceUtils-nsujb7BH-C2AslH-O.js +++ b/custom-toc-highlight/assets/geometryServiceUtils-nsujb7BH-BeXUhRCo.js @@ -1 +1 @@ -import{C as a,o as n,r as s}from"./story-BfX8CRfG.js";import{f,j as m}from"./project-DQKhruav-DBiiXhMD.js";import"./main-ugzBrWNm.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";async function g(e=null,i){if(a.geometryServiceUrl)return a.geometryServiceUrl;if(!e)throw new n("internal:geometry-service-url-not-configured");let r;r="portal"in e?e.portal||s.getDefault():e,await r.load({signal:i});const t=r.helperServices?.geometry?.url;if(!t)throw new n("internal:geometry-service-url-not-configured");return t}async function h(e,i,r=null,t){const l=await g(r,t),c=new f({geometries:[e],outSpatialReference:i}),o=await m(l,c,{signal:t});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new n("internal:geometry-service-projection-failed")}export{g as getGeometryServiceURL,h as projectGeometry}; +import{C as a,o as n,r as s}from"./story-Doly9N9p.js";import{f,j as m}from"./project-DQKhruav-CyFgbMSU.js";import"./main-QGPoLsvl.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";async function g(e=null,i){if(a.geometryServiceUrl)return a.geometryServiceUrl;if(!e)throw new n("internal:geometry-service-url-not-configured");let r;r="portal"in e?e.portal||s.getDefault():e,await r.load({signal:i});const t=r.helperServices?.geometry?.url;if(!t)throw new n("internal:geometry-service-url-not-configured");return t}async function h(e,i,r=null,t){const l=await g(r,t),c=new f({geometries:[e],outSpatialReference:i}),o=await m(l,c,{signal:t});if(o&&Array.isArray(o)&&o.length===1)return o[0];throw new n("internal:geometry-service-projection-failed")}export{g as getGeometryServiceURL,h as projectGeometry}; diff --git a/custom-toc-highlight/assets/gif-BZzSowd2-DsEs7FgS.js b/custom-toc-highlight/assets/gif-BZzSowd2-49ll32ZF.js similarity index 99% rename from custom-toc-highlight/assets/gif-BZzSowd2-DsEs7FgS.js rename to custom-toc-highlight/assets/gif-BZzSowd2-49ll32ZF.js index 5d229792..ce0da77a 100644 --- a/custom-toc-highlight/assets/gif-BZzSowd2-DsEs7FgS.js +++ b/custom-toc-highlight/assets/gif-BZzSowd2-49ll32ZF.js @@ -1 +1 @@ -import{aN as H}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";var D,x={},G={},B={};function V(){if(D)return B;D=1,Object.defineProperty(B,"__esModule",{value:!0}),B.loop=B.conditional=B.parse=void 0;var g=function a(d,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:s;if(Array.isArray(o))o.forEach(function(h){return a(d,h,s,c)});else if(typeof o=="function")o(d,s,c,a);else{var l=Object.keys(o)[0];Array.isArray(o[l])?(c[l]={},a(d,o[l],s,c[l])):c[l]=o[l](d,s,c,a)}return s};B.parse=g;var u=function(a,d){return function(o,s,c,l){d(o,s,c)&&l(o,a,s,c)}};B.conditional=u;var t=function(a,d){return function(o,s,c,l){for(var h=[],e=o.pos;d(o,s,c);){var r={};if(l(o,a,s,r),o.pos===e)break;e=o.pos,h.push(r)}return h}};return B.loop=t,B}var O,T,v={};function $(){if(O)return v;O=1,Object.defineProperty(v,"__esModule",{value:!0}),v.readBits=v.readArray=v.readUnsigned=v.readString=v.peekBytes=v.readBytes=v.peekByte=v.readByte=v.buildStream=void 0;var g=function(e){return{data:e,pos:0}};v.buildStream=g;var u=function(){return function(e){return e.data[e.pos++]}};v.readByte=u;var t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};v.peekByte=t;var a=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};v.readBytes=a;var d=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};v.peekBytes=d;var o=function(e){return function(r){return Array.from(a(e)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};v.readString=o;var s=function(e){return function(r){var n=a(2)(r);return e?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};v.readUnsigned=s;var c=function(e,r){return function(n,i,f){for(var y=typeof r=="function"?r(n,i,f):r,p=a(e),m=new Array(y),w=0;w=i){var p=i-e.pos;n.push((0,t.readBytes)(p)(e)),f+=p;break}n.push((0,t.readBytes)(y)(e)),f+=y}for(var m=new Uint8Array(f),w=0,b=0;b>=c,y-=c,r>d||r==l)break;if(r==o){s=(1<<(c=i+1))-1,d=o+2,e=C;continue}if(e==C){U[m++]=A[r],e=r,p=r;continue}for(h=r,r==d&&(U[m++]=p,r=e);r>o;)U[m++]=A[r],r=M[r];p=255&A[r],U[m++]=p,dc[e],width:d,height:o}}function Y(g){return z??=document.createElement("canvas"),N??=z.getContext("2d",{willReadFrequently:!0}),z.width=g.width,z.height=g.height,N.putImageData(g,0,0),z}const Z=[71,73,70];function L(g){const u=new Uint8Array(g);return!Z.some((t,a)=>t!==u[a])}function ne(g){if(!L(g))return!1;const u=new DataView(g),t=u.getUint8(10);let a=13+(128&t?3*2**(1+(7&t)):0),d=0,o=!1;for(;!o;){switch(u.getUint8(a++)){case 33:if(!s())return!1;break;case 44:c();break;case 59:o=!0;break;default:return!1}if(d>1)return!0}function s(){switch(u.getUint8(a++)){case 249:l();break;case 1:h();break;case 254:e();break;case 255:r();break;default:return!1}return!0}function c(){d++,a+=8;const i=u.getUint8(a++);a+=128&i?3*2**(1+(7&i)):0,a++,n()}function l(){a++,a+=4,n()}function h(){d++,a++,a+=12,n()}function e(){n()}function r(){a++,a+=8,a+=3,n()}function n(){let i;for(;i=u.getUint8(a++);)a+=i}return!1}export{ne as isAnimatedGIF,L as isGIF,te as parseGif}; +import{aN as H}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";var D,x={},G={},B={};function V(){if(D)return B;D=1,Object.defineProperty(B,"__esModule",{value:!0}),B.loop=B.conditional=B.parse=void 0;var g=function a(d,o){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:s;if(Array.isArray(o))o.forEach(function(h){return a(d,h,s,c)});else if(typeof o=="function")o(d,s,c,a);else{var l=Object.keys(o)[0];Array.isArray(o[l])?(c[l]={},a(d,o[l],s,c[l])):c[l]=o[l](d,s,c,a)}return s};B.parse=g;var u=function(a,d){return function(o,s,c,l){d(o,s,c)&&l(o,a,s,c)}};B.conditional=u;var t=function(a,d){return function(o,s,c,l){for(var h=[],e=o.pos;d(o,s,c);){var r={};if(l(o,a,s,r),o.pos===e)break;e=o.pos,h.push(r)}return h}};return B.loop=t,B}var O,T,v={};function $(){if(O)return v;O=1,Object.defineProperty(v,"__esModule",{value:!0}),v.readBits=v.readArray=v.readUnsigned=v.readString=v.peekBytes=v.readBytes=v.peekByte=v.readByte=v.buildStream=void 0;var g=function(e){return{data:e,pos:0}};v.buildStream=g;var u=function(){return function(e){return e.data[e.pos++]}};v.readByte=u;var t=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(r){return r.data[r.pos+e]}};v.peekByte=t;var a=function(e){return function(r){return r.data.subarray(r.pos,r.pos+=e)}};v.readBytes=a;var d=function(e){return function(r){return r.data.subarray(r.pos,r.pos+e)}};v.peekBytes=d;var o=function(e){return function(r){return Array.from(a(e)(r)).map(function(n){return String.fromCharCode(n)}).join("")}};v.readString=o;var s=function(e){return function(r){var n=a(2)(r);return e?(n[1]<<8)+n[0]:(n[0]<<8)+n[1]}};v.readUnsigned=s;var c=function(e,r){return function(n,i,f){for(var y=typeof r=="function"?r(n,i,f):r,p=a(e),m=new Array(y),w=0;w=i){var p=i-e.pos;n.push((0,t.readBytes)(p)(e)),f+=p;break}n.push((0,t.readBytes)(y)(e)),f+=y}for(var m=new Uint8Array(f),w=0,b=0;b>=c,y-=c,r>d||r==l)break;if(r==o){s=(1<<(c=i+1))-1,d=o+2,e=C;continue}if(e==C){U[m++]=A[r],e=r,p=r;continue}for(h=r,r==d&&(U[m++]=p,r=e);r>o;)U[m++]=A[r],r=M[r];p=255&A[r],U[m++]=p,dc[e],width:d,height:o}}function Y(g){return z??=document.createElement("canvas"),N??=z.getContext("2d",{willReadFrequently:!0}),z.width=g.width,z.height=g.height,N.putImageData(g,0,0),z}const Z=[71,73,70];function L(g){const u=new Uint8Array(g);return!Z.some((t,a)=>t!==u[a])}function ne(g){if(!L(g))return!1;const u=new DataView(g),t=u.getUint8(10);let a=13+(128&t?3*2**(1+(7&t)):0),d=0,o=!1;for(;!o;){switch(u.getUint8(a++)){case 33:if(!s())return!1;break;case 44:c();break;case 59:o=!0;break;default:return!1}if(d>1)return!0}function s(){switch(u.getUint8(a++)){case 249:l();break;case 1:h();break;case 254:e();break;case 255:r();break;default:return!1}return!0}function c(){d++,a+=8;const i=u.getUint8(a++);a+=128&i?3*2**(1+(7&i)):0,a++,n()}function l(){a++,a+=4,n()}function h(){d++,a++,a+=12,n()}function e(){n()}function r(){a++,a+=8,a+=3,n()}function n(){let i;for(;i=u.getUint8(a++);)a+=i}return!1}export{ne as isAnimatedGIF,L as isGIF,te as parseGif}; diff --git a/custom-toc-highlight/assets/gltfexport-Dj6nF2RN-B_wJbbRp.js b/custom-toc-highlight/assets/gltfexport-Dj6nF2RN-CAFBwudx.js similarity index 93% rename from custom-toc-highlight/assets/gltfexport-Dj6nF2RN-B_wJbbRp.js rename to custom-toc-highlight/assets/gltfexport-Dj6nF2RN-CAFBwudx.js index 69f953a4..28358dcc 100644 --- a/custom-toc-highlight/assets/gltfexport-Dj6nF2RN-B_wJbbRp.js +++ b/custom-toc-highlight/assets/gltfexport-Dj6nF2RN-CAFBwudx.js @@ -1 +1 @@ -import{dg as S,i8 as v,eI as Q,a3 as re,$ as k,h_ as ie,bj as ne,an as oe,o as Y,cw as ae,dG as ce,a1 as he}from"./story-BfX8CRfG.js";import{O as fe,X as ue}from"./quat-BODLR7mS-BrXZAXDf.js";import{e as le,n as de,r as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{R as $,_ as O,r as j,S as pe,l as _e}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{m as ge}from"./Mesh-DLzjDUIO-COeC-iS-.js";import{b as we}from"./vertexSpaceConversion-CiKaVq_u-D2kQTb17.js";import{I as p,G as T}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{f as U}from"./resourceUtils-Ds65naCv-jCWWLIQy.js";import"./main-ugzBrWNm.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./MeshTransform-C--IG09w-DoQndDth.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js";import"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import"./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-BuNk6xPZ.js";import"./plane-Dt8R0KeE-CVSP2GQG.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-CQcmF3ab.js";import"./projectPointToVector-B2UUY9SE-BChPjj6-.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import"./vec3-BazNroeq-PdcGTXFi.js";import"./External-D_wl4XAw-P7VLSnKi.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./BufferView-PQoE3GL7-Duht5lAO.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-BagfV9qf.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function Ee(t){const e=q(t);return e!=null?e.toDataURL():""}async function J(t,e){const s=q(t);if(s==null)throw new Y("imageToArrayBuffer","Unsupported image type");const r=Ae(t),i=await new Promise(o=>s.toBlob(o,r));if(k(e),!i)throw new Y("imageToArrayBuffer","Failed to encode image");const a=await i.arrayBuffer();return k(e),{data:a,type:r}}function Ae(t){if(!(t instanceof HTMLImageElement))return"image/png";const e=t.src;if(ae(e)){const s=ce(e);return s?.mediaType==="image/jpeg"?s.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function q(t){if(t instanceof HTMLCanvasElement)return t;if(t instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const s=e.getContext("2d");return t instanceof HTMLImageElement?s.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&s.putImageData(t,0,0),e}function Te(t){const e=[],s=new Uint8Array(t);for(let r=0;r=4&&i!==y.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),e.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(t){const e=this._data.length;if(this._data.push(t),this._accessorIndex>=0){const s=e%this._numComponentsForDataType,r=this._accessorMin[s];this._accessorMin[s]=typeof r!="number"?t:Math.min(r,t);const i=this._accessorMax[s];this._accessorMax[s]=typeof i!="number"?t:Math.max(i,t)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function t(e,s){return s*Math.ceil(e/s)}return t(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(t,e){switch(this._componentType){case p.BYTE:return new Int8Array(t,e);case p.FLOAT:return new Float32Array(t,e);case p.SHORT:return new Int16Array(t,e);case p.UNSIGNED_BYTE:return new Uint8Array(t,e);case p.UNSIGNED_INT:return new Uint32Array(t,e);case p.UNSIGNED_SHORT:return new Uint16Array(t,e)}}writeOutToBuffer(t,e){this._createTypedArray(t,e).set(this._data)}writeAsync(t){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=t.then(e=>{const s=new Uint8Array(e);for(let r=0;r=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=t;const e=this._numComponentsForDataType;this._accessorMin=new Array(e),this._accessorMax=new Array(e)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const t=this._getElementSize(),e=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/e;if(s%1)throw new Error("An accessor was ended with missing component values");for(let i=0;ithis._finalizedPromiseResolve=t)}async finalize(){const t=this._bufferView,e=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&e.push(this._asyncWritePromise),await Promise.allSettled(e),this._isFinalized=!0,t.byteOffset=this.getByteOffset(),t.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case p.BYTE:case p.UNSIGNED_BYTE:return 1;case p.SHORT:case p.UNSIGNED_SHORT:return 2;case p.UNSIGNED_INT:case p.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case g.SCALAR:return 1;case g.VEC2:return 2;case g.VEC3:return 3;case g.VEC4:case g.MAT2:return 4;case g.MAT3:return 9;case g.MAT4:return 16}}},Z=class{constructor(t){this._gltf=t,this._bufferViews=[],this._isFinalized=!1,t.buffers||(t.buffers=[]),this.index=t.buffers.length;const e={byteLength:-1};t.buffers.push(e),this._buffer=e}addBufferView(t,e,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const r=new xe(this,this._gltf,t,e,s);return this._bufferViews.push(r),r}getByteOffset(t){let e=0;for(const s of this._bufferViews){if(s===t)return e;e+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(t){const e=[];for(const s of this._bufferViews){if(t&&s===t)return e;e.push(s.finalized)}return e}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const t=this._getTotalSize(),e=new ArrayBuffer(t);let s=0;for(const r of this._bufferViews)r.writeOutToBuffer(e,s),s+=r.byteSize;return e}finalize(){if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),this._gltf.extras.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let t=0;for(const e of this._bufferViews)t+=e.byteSize;return t}};function Ie(t,e){if(t.components)for(const s of t.components)s.faces&&s.shading==="smooth"&&Ne(s,e)}function Ne(t,e){e.normal==null&&(e.normal=new Float32Array(e.position.length));const s=t.faces,{position:r,normal:i}=e,a=s.length/3;for(let o=0;ohe.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class Le{constructor(e,s){this.options=s,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:s.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const s=this.gltf.extras,r=s.output.buffer===R.GLB||s.output.image===b.GLB;r&&(s.binChunkBuffer=new Z(this.gltf)),e.forEachScene(i=>{this._addScene(i)}),r&&s.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const s={};e.name&&(s.name=e.name),e.forEachNode(r=>{s.nodes||(s.nodes=[]),s.nodes.push(...this._addNodes(r))}),this.gltf.scenes.push(s)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const s={};e.name&&(s.name=e.name);const r=e.translation;$(r,ie)||(s.translation=v(r));const i=e.rotation;ue(i,de)||(s.rotation=me(i));const a=e.scale;$(a,Q)||(s.scale=v(a));const o=this.gltf.nodes.length;if(this.gltf.nodes.push(s),e.mesh&&e.mesh.vertexAttributes.position){const n=this._createMeshes(e.mesh),c=[o];if(n.length===1)this._addMesh(s,n[0]);else for(const h of n){const u={};this._addMesh(u,h),c.push(this.gltf.nodes.length),this.gltf.nodes.push(u)}return c}return e.forEachNode(n=>{s.children||(s.children=[]),s.children.push(...this._addNodes(n))}),[o]}_addMesh(e,s){this.gltf.meshes??=[];const r=this.gltf.meshes.length;this.gltf.meshes.push(s),e.mesh=r}_createMeshes(e){const s=this.gltf.extras,r=s.output.buffer===R.GLB;let i;i=r?s.binChunkBuffer:new Z(this.gltf);const a=this.options.origin,o=e.vertexSpace.clone();o.origin=[a.x,a.y,a.z??0];const n=we({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!n)return[];Ie(e,n),Be(n);const{position:c,normal:h,tangent:u}=n,{uv:_,color:l}=e.vertexAttributes,w=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER);let d,m,E,A;h&&(d=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER)),_&&(m=i.addBufferView(p.FLOAT,g.VEC2,y.ARRAY_BUFFER)),u&&(E=i.addBufferView(p.FLOAT,g.VEC4,y.ARRAY_BUFFER)),l&&(A=i.addBufferView(p.UNSIGNED_BYTE,g.VEC4,y.ARRAY_BUFFER)),w.startAccessor("POSITION"),d&&d.startAccessor("NORMAL"),m&&m.startAccessor("TEXCOORD_0"),E&&E.startAccessor("TANGENT"),A&&A.startAccessor("COLOR_0");const te=n.position.length/3;for(let f=0;f0&&e.components[0].faces?(M=i.addBufferView(p.UNSIGNED_INT,g.SCALAR,y.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(M,e.components,D,H,C,V,z,F)):this._addMeshVertexNonIndexed(e.components,D,H,C,V,z,F),w.finalize(),d&&d.finalize(),m&&m.finalize(),E&&E.finalize(),M&&M.finalize(),A&&A.finalize(),r||i.finalize(),D}_addMaterial(e){if(e===null)return;const s=this._materialMap.indexOf(e);if(s!==-1)return s;this.gltf.materials||(this.gltf.materials=[]);const r={};switch(e.alphaMode){case"mask":r.alphaMode=B.MASK;break;case"auto":case"blend":r.alphaMode=B.BLEND}r.alphaCutoff=e.alphaCutoff,e.doubleSided&&(r.doubleSided=e.doubleSided),r.pbrMetallicRoughness={};const i=n=>n**2.1,a=n=>{const c=n.toRgba();return c[0]=i(c[0]/255),c[1]=i(c[1]/255),c[2]=i(c[2]/255),c};if(e.color!=null&&(r.pbrMetallicRoughness.baseColorFactor=a(e.color)),e.colorTexture!=null&&(r.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),e.normalTexture!=null&&(r.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof ge){if(e.emissiveTexture!=null&&(r.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),e.emissiveColor!=null){const n=a(e.emissiveColor);r.emissiveFactor=[n[0],n[1],n[2]]}e.occlusionTexture!=null&&(r.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),e.metallicRoughnessTexture!=null&&(r.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),r.pbrMetallicRoughness.metallicFactor=e.metallic,r.pbrMetallicRoughness.roughnessFactor=e.roughness}else r.pbrMetallicRoughness.metallicFactor=1,r.pbrMetallicRoughness.roughnessFactor=1,P().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const o=this.gltf.materials.length;return this.gltf.materials.push(r),this._materialMap.push(e),o}_createTextureInfo(e,s){const r={index:this._addTexture(e)};return s&&(r.extensions||(r.extensions={}),r.extensions.KHR_texture_transform={scale:s.scale,offset:s.offset,rotation:ne(s.rotation)}),r}_addTexture(e){const s=this.gltf.textures??[];return this.gltf.textures=s,oe(this._textureMap,e,()=>{const r={sampler:this._addSampler(e),source:this._addImage(e)},i=s.length;return s.push(r),i})}_addImage(e){const s=this._imageMap.get(e);if(s!=null)return s;this.gltf.images||(this.gltf.images=[]);const r={};if(e.url)r.uri=e.url;else{const a=e.data;r.extras=a;for(let n=0;n(r.mimeType=u,h));o.promises.push(n.writeAsync(c).then(()=>{n.finalize()}))}r.bufferView=n.index;break}case b.DataURI:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}r.uri=Ee(a);break;default:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}o.promises.push(J(a,this.options.signal).then(({data:n,type:c})=>{r.uri=n,r.mimeType=c}))}}const i=this.gltf.images.length;return this.gltf.images.push(r),this._imageMap.set(e,i),i}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let s=T.REPEAT,r=T.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":s=T.CLAMP_TO_EDGE,r=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT,r=T.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":r=T.CLAMP_TO_EDGE;break;case"mirror":r=T.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":s=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT}}const i={wrapS:s,wrapT:r};for(let o=0;o{if(u!=="extras"){if(_ instanceof ArrayBuffer){if(be(_))switch(e.output?.image){case b.DataURI:case b.GLB:break;case b.External:default:{const l=`img${a}.png`;return a++,c.set(l,_),l}}switch(e.output?.buffer){case R.DataURI:return Te(_);case R.GLB:if(o)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(o=_);case R.External:default:{const l=`data${i}.bin`;return i++,c.set(l,_),l}}}return _}},n);return e.output?.buffer===R.GLB||e.output?.image===b.GLB?c.set(ee,new N(h,o).buffer):c.set(Fe,h),c}async function Ue(t,e){const s=(await De(t,{output:{buffer:R.GLB,image:b.GLB},jsonSpacing:0,...e})).get(ee);if(!(s&&s instanceof ArrayBuffer))throw new Error("failed to export to glb");return s}async function yt(t,e){const s=new Ce,r=new Ve;return s.addScene(r),r.addNode(new ze(t)),await Ue(s,{origin:t.origin,...e})}export{yt as toBinaryGLTF}; +import{dg as S,i8 as v,eI as Q,a3 as re,$ as k,h_ as ie,bj as ne,an as oe,o as Y,cw as ae,dG as ce,a1 as he}from"./story-Doly9N9p.js";import{O as fe,X as ue}from"./quat-BODLR7mS-BQk2dgMZ.js";import{e as le,n as de,r as me}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{R as $,_ as O,r as j,S as pe,l as _e}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{m as ge}from"./Mesh-DLzjDUIO-BwXS6N6_.js";import{b as we}from"./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js";import{I as p,G as T}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{f as U}from"./resourceUtils-Ds65naCv-PY5SfRMU.js";import"./main-QGPoLsvl.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./MeshTransform-C--IG09w-Bbqagf1g.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./MeshVertexAttributes-CbNpPur2-c8zcl8rF.js";import"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import"./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-cFTwC5-9.js";import"./plane-Dt8R0KeE-Bqc6oVGz.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-CTlujluz.js";import"./projectPointToVector-B2UUY9SE-BIKNGLey.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js";import"./vec3-BazNroeq-CRjQH4Pj.js";import"./External-D_wl4XAw-DrOy4LUr.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./BufferView-PQoE3GL7-B9DLdqO9.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-BHg6FqkT.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function Ee(t){const e=q(t);return e!=null?e.toDataURL():""}async function J(t,e){const s=q(t);if(s==null)throw new Y("imageToArrayBuffer","Unsupported image type");const r=Ae(t),i=await new Promise(o=>s.toBlob(o,r));if(k(e),!i)throw new Y("imageToArrayBuffer","Failed to encode image");const a=await i.arrayBuffer();return k(e),{data:a,type:r}}function Ae(t){if(!(t instanceof HTMLImageElement))return"image/png";const e=t.src;if(ae(e)){const s=ce(e);return s?.mediaType==="image/jpeg"?s.mediaType:"image/png"}return/\.png$/i.test(e)?"image/png":/\.(jpg|jpeg)$/i.test(e)?"image/jpeg":"image/png"}function q(t){if(t instanceof HTMLCanvasElement)return t;if(t instanceof HTMLVideoElement)return null;const e=document.createElement("canvas");e.width=t.width,e.height=t.height;const s=e.getContext("2d");return t instanceof HTMLImageElement?s.drawImage(t,0,0,t.width,t.height):t instanceof ImageData&&s.putImageData(t,0,0),e}function Te(t){const e=[],s=new Uint8Array(t);for(let r=0;r=4&&i!==y.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),e.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(t){const e=this._data.length;if(this._data.push(t),this._accessorIndex>=0){const s=e%this._numComponentsForDataType,r=this._accessorMin[s];this._accessorMin[s]=typeof r!="number"?t:Math.min(r,t);const i=this._accessorMax[s];this._accessorMax[s]=typeof i!="number"?t:Math.max(i,t)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function t(e,s){return s*Math.ceil(e/s)}return t(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(t,e){switch(this._componentType){case p.BYTE:return new Int8Array(t,e);case p.FLOAT:return new Float32Array(t,e);case p.SHORT:return new Int16Array(t,e);case p.UNSIGNED_BYTE:return new Uint8Array(t,e);case p.UNSIGNED_INT:return new Uint32Array(t,e);case p.UNSIGNED_SHORT:return new Uint16Array(t,e)}}writeOutToBuffer(t,e){this._createTypedArray(t,e).set(this._data)}writeAsync(t){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=t.then(e=>{const s=new Uint8Array(e);for(let r=0;r=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=t;const e=this._numComponentsForDataType;this._accessorMin=new Array(e),this._accessorMax=new Array(e)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const t=this._getElementSize(),e=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/e;if(s%1)throw new Error("An accessor was ended with missing component values");for(let i=0;ithis._finalizedPromiseResolve=t)}async finalize(){const t=this._bufferView,e=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&e.push(this._asyncWritePromise),await Promise.allSettled(e),this._isFinalized=!0,t.byteOffset=this.getByteOffset(),t.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case p.BYTE:case p.UNSIGNED_BYTE:return 1;case p.SHORT:case p.UNSIGNED_SHORT:return 2;case p.UNSIGNED_INT:case p.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case g.SCALAR:return 1;case g.VEC2:return 2;case g.VEC3:return 3;case g.VEC4:case g.MAT2:return 4;case g.MAT3:return 9;case g.MAT4:return 16}}},Z=class{constructor(t){this._gltf=t,this._bufferViews=[],this._isFinalized=!1,t.buffers||(t.buffers=[]),this.index=t.buffers.length;const e={byteLength:-1};t.buffers.push(e),this._buffer=e}addBufferView(t,e,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const r=new xe(this,this._gltf,t,e,s);return this._bufferViews.push(r),r}getByteOffset(t){let e=0;for(const s of this._bufferViews){if(s===t)return e;e+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(t){const e=[];for(const s of this._bufferViews){if(t&&s===t)return e;e.push(s.finalized)}return e}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const t=this._getTotalSize(),e=new ArrayBuffer(t);let s=0;for(const r of this._bufferViews)r.writeOutToBuffer(e,s),s+=r.byteSize;return e}finalize(){if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=Promise.allSettled(this.getViewFinalizePromises()).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),this._gltf.extras.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let t=0;for(const e of this._bufferViews)t+=e.byteSize;return t}};function Ie(t,e){if(t.components)for(const s of t.components)s.faces&&s.shading==="smooth"&&Ne(s,e)}function Ne(t,e){e.normal==null&&(e.normal=new Float32Array(e.position.length));const s=t.faces,{position:r,normal:i}=e,a=s.length/3;for(let o=0;ohe.getLogger("esri.geometry.support.meshUtils.exporters.gltf.gltf");class Le{constructor(e,s){this.options=s,this._materialMap=new Array,this._imageMap=new Map,this._textureMap=new Map,this.gltf={asset:{version:"2.0",copyright:e.copyright,generator:e.generator},extras:{output:s.output,binChunkBuffer:null,promises:[]}},this._addScenes(e)}_addScenes(e){this.gltf.scene=e.defaultScene;const s=this.gltf.extras,r=s.output.buffer===R.GLB||s.output.image===b.GLB;r&&(s.binChunkBuffer=new Z(this.gltf)),e.forEachScene(i=>{this._addScene(i)}),r&&s.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const s={};e.name&&(s.name=e.name),e.forEachNode(r=>{s.nodes||(s.nodes=[]),s.nodes.push(...this._addNodes(r))}),this.gltf.scenes.push(s)}_addNodes(e){this.gltf.nodes||(this.gltf.nodes=[]);const s={};e.name&&(s.name=e.name);const r=e.translation;$(r,ie)||(s.translation=v(r));const i=e.rotation;ue(i,de)||(s.rotation=me(i));const a=e.scale;$(a,Q)||(s.scale=v(a));const o=this.gltf.nodes.length;if(this.gltf.nodes.push(s),e.mesh&&e.mesh.vertexAttributes.position){const n=this._createMeshes(e.mesh),c=[o];if(n.length===1)this._addMesh(s,n[0]);else for(const h of n){const u={};this._addMesh(u,h),c.push(this.gltf.nodes.length),this.gltf.nodes.push(u)}return c}return e.forEachNode(n=>{s.children||(s.children=[]),s.children.push(...this._addNodes(n))}),[o]}_addMesh(e,s){this.gltf.meshes??=[];const r=this.gltf.meshes.length;this.gltf.meshes.push(s),e.mesh=r}_createMeshes(e){const s=this.gltf.extras,r=s.output.buffer===R.GLB;let i;i=r?s.binChunkBuffer:new Z(this.gltf);const a=this.options.origin,o=e.vertexSpace.clone();o.origin=[a.x,a.y,a.z??0];const n=we({vertexAttributes:e.vertexAttributes,vertexSpace:e.vertexSpace,transform:this.options?.ignoreLocalTransform?null:e.transform,spatialReference:e.spatialReference},o,{targetUnit:this.options.unitConversionDisabled?void 0:"meters"});if(!n)return[];Ie(e,n),Be(n);const{position:c,normal:h,tangent:u}=n,{uv:_,color:l}=e.vertexAttributes,w=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER);let d,m,E,A;h&&(d=i.addBufferView(p.FLOAT,g.VEC3,y.ARRAY_BUFFER)),_&&(m=i.addBufferView(p.FLOAT,g.VEC2,y.ARRAY_BUFFER)),u&&(E=i.addBufferView(p.FLOAT,g.VEC4,y.ARRAY_BUFFER)),l&&(A=i.addBufferView(p.UNSIGNED_BYTE,g.VEC4,y.ARRAY_BUFFER)),w.startAccessor("POSITION"),d&&d.startAccessor("NORMAL"),m&&m.startAccessor("TEXCOORD_0"),E&&E.startAccessor("TANGENT"),A&&A.startAccessor("COLOR_0");const te=n.position.length/3;for(let f=0;f0&&e.components[0].faces?(M=i.addBufferView(p.UNSIGNED_INT,g.SCALAR,y.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(M,e.components,D,H,C,V,z,F)):this._addMeshVertexNonIndexed(e.components,D,H,C,V,z,F),w.finalize(),d&&d.finalize(),m&&m.finalize(),E&&E.finalize(),M&&M.finalize(),A&&A.finalize(),r||i.finalize(),D}_addMaterial(e){if(e===null)return;const s=this._materialMap.indexOf(e);if(s!==-1)return s;this.gltf.materials||(this.gltf.materials=[]);const r={};switch(e.alphaMode){case"mask":r.alphaMode=B.MASK;break;case"auto":case"blend":r.alphaMode=B.BLEND}r.alphaCutoff=e.alphaCutoff,e.doubleSided&&(r.doubleSided=e.doubleSided),r.pbrMetallicRoughness={};const i=n=>n**2.1,a=n=>{const c=n.toRgba();return c[0]=i(c[0]/255),c[1]=i(c[1]/255),c[2]=i(c[2]/255),c};if(e.color!=null&&(r.pbrMetallicRoughness.baseColorFactor=a(e.color)),e.colorTexture!=null&&(r.pbrMetallicRoughness.baseColorTexture=this._createTextureInfo(e.colorTexture,e.colorTextureTransform)),e.normalTexture!=null&&(r.normalTexture=this._createTextureInfo(e.normalTexture,e.normalTextureTransform)),e instanceof ge){if(e.emissiveTexture!=null&&(r.emissiveTexture=this._createTextureInfo(e.emissiveTexture,e.emissiveTextureTransform)),e.emissiveColor!=null){const n=a(e.emissiveColor);r.emissiveFactor=[n[0],n[1],n[2]]}e.occlusionTexture!=null&&(r.occlusionTexture=this._createTextureInfo(e.occlusionTexture,e.occlusionTextureTransform)),e.metallicRoughnessTexture!=null&&(r.pbrMetallicRoughness.metallicRoughnessTexture=this._createTextureInfo(e.metallicRoughnessTexture,e.metallicRoughnessTextureTransform)),r.pbrMetallicRoughness.metallicFactor=e.metallic,r.pbrMetallicRoughness.roughnessFactor=e.roughness}else r.pbrMetallicRoughness.metallicFactor=1,r.pbrMetallicRoughness.roughnessFactor=1,P().warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const o=this.gltf.materials.length;return this.gltf.materials.push(r),this._materialMap.push(e),o}_createTextureInfo(e,s){const r={index:this._addTexture(e)};return s&&(r.extensions||(r.extensions={}),r.extensions.KHR_texture_transform={scale:s.scale,offset:s.offset,rotation:ne(s.rotation)}),r}_addTexture(e){const s=this.gltf.textures??[];return this.gltf.textures=s,oe(this._textureMap,e,()=>{const r={sampler:this._addSampler(e),source:this._addImage(e)},i=s.length;return s.push(r),i})}_addImage(e){const s=this._imageMap.get(e);if(s!=null)return s;this.gltf.images||(this.gltf.images=[]);const r={};if(e.url)r.uri=e.url;else{const a=e.data;r.extras=a;for(let n=0;n(r.mimeType=u,h));o.promises.push(n.writeAsync(c).then(()=>{n.finalize()}))}r.bufferView=n.index;break}case b.DataURI:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}r.uri=Ee(a);break;default:if(U(a)){P().warnOnce("Image export for basis compressed textures not available.");break}o.promises.push(J(a,this.options.signal).then(({data:n,type:c})=>{r.uri=n,r.mimeType=c}))}}const i=this.gltf.images.length;return this.gltf.images.push(r),this._imageMap.set(e,i),i}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let s=T.REPEAT,r=T.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":s=T.CLAMP_TO_EDGE,r=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT,r=T.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":r=T.CLAMP_TO_EDGE;break;case"mirror":r=T.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":s=T.CLAMP_TO_EDGE;break;case"mirror":s=T.MIRRORED_REPEAT}}const i={wrapS:s,wrapT:r};for(let o=0;o{if(u!=="extras"){if(_ instanceof ArrayBuffer){if(be(_))switch(e.output?.image){case b.DataURI:case b.GLB:break;case b.External:default:{const l=`img${a}.png`;return a++,c.set(l,_),l}}switch(e.output?.buffer){case R.DataURI:return Te(_);case R.GLB:if(o)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(o=_);case R.External:default:{const l=`data${i}.bin`;return i++,c.set(l,_),l}}}return _}},n);return e.output?.buffer===R.GLB||e.output?.image===b.GLB?c.set(ee,new N(h,o).buffer):c.set(Fe,h),c}async function Ue(t,e){const s=(await De(t,{output:{buffer:R.GLB,image:b.GLB},jsonSpacing:0,...e})).get(ee);if(!(s&&s instanceof ArrayBuffer))throw new Error("failed to export to glb");return s}async function yt(t,e){const s=new Ce,r=new Ve;return s.addScene(r),r.addNode(new ze(t)),await Ue(s,{origin:t.origin,...e})}export{yt as toBinaryGLTF}; diff --git a/custom-toc-highlight/assets/groupLayerUtils-D-25JsA_-D02uFLM4.js b/custom-toc-highlight/assets/groupLayerUtils-D-25JsA_-CvTWRcG7.js similarity index 65% rename from custom-toc-highlight/assets/groupLayerUtils-D-25JsA_-D02uFLM4.js rename to custom-toc-highlight/assets/groupLayerUtils-D-25JsA_-CvTWRcG7.js index cf1a9349..29051c0e 100644 --- a/custom-toc-highlight/assets/groupLayerUtils-D-25JsA_-D02uFLM4.js +++ b/custom-toc-highlight/assets/groupLayerUtils-D-25JsA_-CvTWRcG7.js @@ -1 +1 @@ -import{C as l,D as y}from"./utils-BVWK2jiA-Btpo3M9u.js";import{i as f}from"./jsonContext-BA8GHqVk-CWQlLGSw.js";import{o as v,l as d,u as g,E as s}from"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import{T as i}from"./resourceUtils-BmW6QqlX-B1DAUGNs.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./saveUtils-CIYk-dsQ-VGcOewby.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-BROWZCZ1.js";const n="Group Layer",A="group-layer-save",I="group-layer-save-as",a=s.GROUP_LAYER_MAP;function m(e){return{isValid:e.type==="group",errorMessage:"Layer.type should be 'group'"}}function P(e){return{isValid:v(e,a),errorMessage:`Layer.portalItem.typeKeywords should have '${a}'`}}function u(e,r){return{...f(e,"web-map",!0),initiator:r}}function c(e){const r=e.layerJSON;return Promise.resolve(r&&Object.keys(r).length?r:null)}async function R(e,r){r.title||=e.title,d(r,s.METADATA),g(r,a)}async function S(e,r){return l({layer:e,itemType:n,validateLayer:m,validateItem:P,createJSONContext:t=>u(t,e),createItemData:c,errorNamePrefix:A,saveResources:async(t,o)=>(e.sourceIsPortalItem||await t.removeAllResources().catch(()=>{}),i(e.resourceReferences,o))},r)}async function G(e,r,t){return y({layer:e,itemType:n,validateLayer:m,createJSONContext:o=>u(o,e),createItemData:c,errorNamePrefix:I,newItem:r,setItemProperties:R,saveResources:(o,p)=>i(e.resourceReferences,p)},t)}export{S as save,G as saveAs}; +import{C as l,D as y}from"./utils-BVWK2jiA-i-Dn2Ad8.js";import{i as f}from"./jsonContext-BA8GHqVk-BsXRY5es.js";import{o as v,l as d,u as g,E as s}from"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import{T as i}from"./resourceUtils-BmW6QqlX-D_AxNrCI.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./saveUtils-CIYk-dsQ-Br9QCJTX.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-GPPQBysx.js";const n="Group Layer",A="group-layer-save",I="group-layer-save-as",a=s.GROUP_LAYER_MAP;function m(e){return{isValid:e.type==="group",errorMessage:"Layer.type should be 'group'"}}function P(e){return{isValid:v(e,a),errorMessage:`Layer.portalItem.typeKeywords should have '${a}'`}}function u(e,r){return{...f(e,"web-map",!0),initiator:r}}function c(e){const r=e.layerJSON;return Promise.resolve(r&&Object.keys(r).length?r:null)}async function R(e,r){r.title||=e.title,d(r,s.METADATA),g(r,a)}async function S(e,r){return l({layer:e,itemType:n,validateLayer:m,validateItem:P,createJSONContext:t=>u(t,e),createItemData:c,errorNamePrefix:A,saveResources:async(t,o)=>(e.sourceIsPortalItem||await t.removeAllResources().catch(()=>{}),i(e.resourceReferences,o))},r)}async function G(e,r,t){return y({layer:e,itemType:n,validateLayer:m,createJSONContext:o=>u(o,e),createItemData:c,errorNamePrefix:I,newItem:r,setItemProperties:R,saveResources:(o,p)=>i(e.resourceReferences,p)},t)}export{S as save,G as saveAs}; diff --git a/custom-toc-highlight/assets/grouping-RwmXkHDc-Binxobs4.js b/custom-toc-highlight/assets/grouping-RwmXkHDc-CCFLL7L_.js similarity index 75% rename from custom-toc-highlight/assets/grouping-RwmXkHDc-Binxobs4.js rename to custom-toc-highlight/assets/grouping-RwmXkHDc-CCFLL7L_.js index b8acc21c..41f1530d 100644 --- a/custom-toc-highlight/assets/grouping-RwmXkHDc-Binxobs4.js +++ b/custom-toc-highlight/assets/grouping-RwmXkHDc-CCFLL7L_.js @@ -1 +1 @@ -import{hm as o}from"./story-BfX8CRfG.js";function i(e,r){let t;if(typeof e=="string")t=o(e+`-seed(${r})`);else{let n=12;t=e^r;do t=107*(t>>8^t)+n|0;while(--n!=0)}return(1+t/(1<<31))/2}function c(e){return Math.floor(i(e,f)*l)}const f=53290320,l=10;export{i,c as r}; +import{hm as o}from"./story-Doly9N9p.js";function i(e,r){let t;if(typeof e=="string")t=o(e+`-seed(${r})`);else{let n=12;t=e^r;do t=107*(t>>8^t)+n|0;while(--n!=0)}return(1+t/(1<<31))/2}function c(e){return Math.floor(i(e,f)*l)}const f=53290320,l=10;export{i,c as r}; diff --git a/custom-toc-highlight/assets/header-BRE2xzQs-fBrTtAlS.js b/custom-toc-highlight/assets/header-BRE2xzQs-CjQ_sd4f.js similarity index 96% rename from custom-toc-highlight/assets/header-BRE2xzQs-fBrTtAlS.js rename to custom-toc-highlight/assets/header-BRE2xzQs-CjQ_sd4f.js index a93d0bdd..461ee2f2 100644 --- a/custom-toc-highlight/assets/header-BRE2xzQs-fBrTtAlS.js +++ b/custom-toc-highlight/assets/header-BRE2xzQs-CjQ_sd4f.js @@ -1 +1 @@ -import{eT as _,fQ as k,eX as I,eY as M,eZ as A,e_ as E,fa as G,e$ as p,fb as v,f2 as e,fc as n,fd as o,f4 as a,fo as m,f1 as d,fg as c,eU as H,eV as w}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";const P={class:"relative legend-header flex align-middle"},j=["content","aria-label"],B=["content","aria-label"],R=_({__name:"header",setup(T){const x=k(),{t:l}=I(),s=M("iApi"),r=A(()=>s.fixture.get("legend")),b=()=>{s.event.emit(w.WIZARD_TOGGLE)},y=()=>{try{return s.fixture.exists("wizard")}catch{return!1}},z=()=>{s.event.emit(w.REORDER_TOGGLE)},C=()=>{try{return s.fixture.exists("layer-reorder")}catch{return!1}},i=f=>x.headerControls.includes(f);return(f,t)=>{const u=E("dropdown-menu"),g=G("tippy");return p(),v("div",P,[e("div",null,[n((p(),v("button",{type:"button",onClick:b,class:"relative mr-auto text-gray-500 hover:text-black",content:a(l)("legend.header.addlayer"),"aria-label":a(l)("legend.header.addlayer")},t[4]||(t[4]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})])],-1)]),8,j)),[[o,y()&&i("wizard")],[g,{placement:"right"}]])]),e("div",null,[n((p(),v("button",{type:"button",onClick:z,class:"relative mr-auto text-gray-500 hover:text-black flex justify-center items-center",content:a(l)("legend.header.reorderlayers"),"aria-label":a(l)("legend.header.reorderlayers")},t[5]||(t[5]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M14 5h8v2h-8zm0 5.5h8v2h-8zm0 5.5h8v2h-8zM2 11.5C2 15.08 4.92 18 8.5 18H9v2l3-3-3-3v2h-.5C6.02 16 4 13.98 4 11.5S6.02 7 8.5 7H12V5H8.5C4.92 5 2 7.92 2 11.5z"})])],-1)]),8,B)),[[o,C()&&i("layerReorder")],[g,{placement:"right"}]])]),t[8]||(t[8]=e("span",{class:"flex-1"},null,-1)),n(m(u,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.groups"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:d(()=>t[6]||(t[6]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})])],-1)])),default:d(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[0]||(t[0]=h=>r.value.expandItems(!0))},c(a(l)("legend.header.groups.expand")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[1]||(t[1]=h=>r.value.expandItems(!1))},c(a(l)("legend.header.groups.collapse")),1)]),_:1},8,["tooltip"]),[[o,i("groupToggle")]]),n(m(u,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.visible"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:d(()=>t[7]||(t[7]=[e("div",{class:"flex p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})])],-1)])),default:d(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[2]||(t[2]=h=>r.value.showItems(!0))},c(a(l)("legend.header.visible.show")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[3]||(t[3]=h=>r.value.showItems(!1))},c(a(l)("legend.header.visible.hide")),1)]),_:1},8,["tooltip"]),[[o,i("visibilityToggle")]])])}}}),V=H(R,[["__scopeId","data-v-e8031c30"]]);export{V as default}; +import{eT as _,fQ as k,eX as I,eY as M,eZ as A,e_ as E,fa as G,e$ as p,fb as v,f2 as e,fc as n,fd as o,f4 as a,fo as m,f1 as d,fg as c,eU as H,eV as w}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";const P={class:"relative legend-header flex align-middle"},j=["content","aria-label"],B=["content","aria-label"],R=_({__name:"header",setup(T){const x=k(),{t:l}=I(),s=M("iApi"),r=A(()=>s.fixture.get("legend")),b=()=>{s.event.emit(w.WIZARD_TOGGLE)},y=()=>{try{return s.fixture.exists("wizard")}catch{return!1}},z=()=>{s.event.emit(w.REORDER_TOGGLE)},C=()=>{try{return s.fixture.exists("layer-reorder")}catch{return!1}},i=f=>x.headerControls.includes(f);return(f,t)=>{const u=E("dropdown-menu"),g=G("tippy");return p(),v("div",P,[e("div",null,[n((p(),v("button",{type:"button",onClick:b,class:"relative mr-auto text-gray-500 hover:text-black",content:a(l)("legend.header.addlayer"),"aria-label":a(l)("legend.header.addlayer")},t[4]||(t[4]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})])],-1)]),8,j)),[[o,y()&&i("wizard")],[g,{placement:"right"}]])]),e("div",null,[n((p(),v("button",{type:"button",onClick:z,class:"relative mr-auto text-gray-500 hover:text-black flex justify-center items-center",content:a(l)("legend.header.reorderlayers"),"aria-label":a(l)("legend.header.reorderlayers")},t[5]||(t[5]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18 flip",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M14 5h8v2h-8zm0 5.5h8v2h-8zm0 5.5h8v2h-8zM2 11.5C2 15.08 4.92 18 8.5 18H9v2l3-3-3-3v2h-.5C6.02 16 4 13.98 4 11.5S6.02 7 8.5 7H12V5H8.5C4.92 5 2 7.92 2 11.5z"})])],-1)]),8,B)),[[o,C()&&i("layerReorder")],[g,{placement:"right"}]])]),t[8]||(t[8]=e("span",{class:"flex-1"},null,-1)),n(m(u,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.groups"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:d(()=>t[6]||(t[6]=[e("div",{class:"p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})])],-1)])),default:d(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[0]||(t[0]=h=>r.value.expandItems(!0))},c(a(l)("legend.header.groups.expand")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[1]||(t[1]=h=>r.value.expandItems(!1))},c(a(l)("legend.header.groups.collapse")),1)]),_:1},8,["tooltip"]),[[o,i("groupToggle")]]),n(m(u,{class:"relative",position:"left-start",tooltip:a(l)("legend.header.visible"),tooltipPlacement:"left-start",tooltipPlacementAlt:"bottom-end"},{header:d(()=>t[7]||(t[7]=[e("div",{class:"flex p-8"},[e("svg",{class:"fill-current w-18 h-18",viewBox:"0 0 24 24"},[e("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"})])],-1)])),default:d(()=>[e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[2]||(t[2]=h=>r.value.showItems(!0))},c(a(l)("legend.header.visible.show")),1),e("a",{href:"javascript:;",class:"flex leading-snug items-center overflow-hidden whitespace-nowrap",onClick:t[3]||(t[3]=h=>r.value.showItems(!1))},c(a(l)("legend.header.visible.hide")),1)]),_:1},8,["tooltip"]),[[o,i("visibilityToggle")]])])}}}),V=H(R,[["__scopeId","data-v-e8031c30"]]);export{V as default}; diff --git a/custom-toc-highlight/assets/heatmapUtils-seiMkkkR-Cj1KmweL.js b/custom-toc-highlight/assets/heatmapUtils-seiMkkkR-CrSLbaQx.js similarity index 93% rename from custom-toc-highlight/assets/heatmapUtils-seiMkkkR-Cj1KmweL.js rename to custom-toc-highlight/assets/heatmapUtils-seiMkkkR-CrSLbaQx.js index fd02102b..38c0edc8 100644 --- a/custom-toc-highlight/assets/heatmapUtils-seiMkkkR-Cj1KmweL.js +++ b/custom-toc-highlight/assets/heatmapUtils-seiMkkkR-CrSLbaQx.js @@ -1 +1 @@ -import{es as u,et as l,ae as m}from"./story-BfX8CRfG.js";import{A as p}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as A}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";const s=2.4;function g(o){return u(o*s)}function x(o){return l(o)/s}function h(o,n,i,a){let{color:c,ratio:e}=n,{color:r,ratio:t}=i;t===e&&(t===1?e-=1e-6:t+=1e-6);const f=m((a-e)/(t-e),0,1);p(o,c.toArray(),r.toArray(),f)}function P(o){const n=new Uint8ClampedArray(2048);if(o=o.filter(({ratio:r})=>r>=0&&r<=1).sort((r,t)=>r.ratio-t.ratio).map(({color:r,ratio:t})=>({color:r,ratio:Math.max(t,.001)})),o.length<1)return n;let i=o[0],a=o[0],c=1;const e=A();for(let r=0;r<512;r++){const t=(r+.5)/512;for(;t>a.ratio&&c1?0:3/(Math.PI*i**2)*(1-a**2)**2}function w(o){return typeof o=="function"?o:o?n=>+n[o]:()=>1}export{q as A,w as M,s as c,x as d,P as x,g as y}; +import{es as u,et as l,ae as m}from"./story-Doly9N9p.js";import{A as p}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as A}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";const s=2.4;function g(o){return u(o*s)}function x(o){return l(o)/s}function h(o,n,i,a){let{color:c,ratio:e}=n,{color:r,ratio:t}=i;t===e&&(t===1?e-=1e-6:t+=1e-6);const f=m((a-e)/(t-e),0,1);p(o,c.toArray(),r.toArray(),f)}function P(o){const n=new Uint8ClampedArray(2048);if(o=o.filter(({ratio:r})=>r>=0&&r<=1).sort((r,t)=>r.ratio-t.ratio).map(({color:r,ratio:t})=>({color:r,ratio:Math.max(t,.001)})),o.length<1)return n;let i=o[0],a=o[0],c=1;const e=A();for(let r=0;r<512;r++){const t=(r+.5)/512;for(;t>a.ratio&&c1?0:3/(Math.PI*i**2)*(1-a**2)**2}function w(o){return typeof o=="function"?o:o?n=>+n[o]:()=>1}export{q as A,w as M,s as c,x as d,P as x,g as y}; diff --git a/custom-toc-highlight/assets/hydrated-CplJC1Fs-BIb5_ysY.js b/custom-toc-highlight/assets/hydrated-CplJC1Fs-McBHp1Y5.js similarity index 90% rename from custom-toc-highlight/assets/hydrated-CplJC1Fs-BIb5_ysY.js rename to custom-toc-highlight/assets/hydrated-CplJC1Fs-McBHp1Y5.js index a85238ce..c92b2261 100644 --- a/custom-toc-highlight/assets/hydrated-CplJC1Fs-BIb5_ysY.js +++ b/custom-toc-highlight/assets/hydrated-CplJC1Fs-McBHp1Y5.js @@ -1 +1 @@ -import{w as r,l as c,m as h,G as x,n as m}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";const y={convertToGEGeometry:p,exportPoint:g,exportPolygon:l,exportPolyline:u,exportMultipoint:f,exportExtent:M};function p(e,t){if(t==null)return null;let a="cache"in t?t.cache._geVersion:void 0;return a==null&&(a=e.convertJSONToGeometry(t),"cache"in t&&(t.cache._geVersion=a)),a}function g(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new r({x:e.getPointX(t),y:e.getPointY(t),spatialReference:a});return o&&(s.z=e.getPointZ(t)),n&&(s.m=e.getPointM(t)),s.cache._geVersion=t,s}function l(e,t,a){const o=new c({rings:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function u(e,t,a){const o=new h({paths:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function f(e,t,a){const o=new x({hasZ:e.hasZ(t),hasM:e.hasM(t),points:e.exportPoints(t),spatialReference:a});return o.cache._geVersion=t,o}function M(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new m({xmin:e.getXMin(t),ymin:e.getYMin(t),xmax:e.getXMax(t),ymax:e.getYMax(t),spatialReference:a});if(o){const i=e.getZExtent(t);s.zmin=i.vmin,s.zmax=i.vmax}if(n){const i=e.getMExtent(t);s.mmin=i.vmin,s.mmax=i.vmax}return s.cache._geVersion=t,s}export{y as hydratedAdapter}; +import{w as r,l as c,m as h,G as x,n as m}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";const y={convertToGEGeometry:p,exportPoint:g,exportPolygon:l,exportPolyline:u,exportMultipoint:f,exportExtent:M};function p(e,t){if(t==null)return null;let a="cache"in t?t.cache._geVersion:void 0;return a==null&&(a=e.convertJSONToGeometry(t),"cache"in t&&(t.cache._geVersion=a)),a}function g(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new r({x:e.getPointX(t),y:e.getPointY(t),spatialReference:a});return o&&(s.z=e.getPointZ(t)),n&&(s.m=e.getPointM(t)),s.cache._geVersion=t,s}function l(e,t,a){const o=new c({rings:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function u(e,t,a){const o=new h({paths:e.exportPaths(t),hasZ:e.hasZ(t),hasM:e.hasM(t),spatialReference:a});return o.cache._geVersion=t,o}function f(e,t,a){const o=new x({hasZ:e.hasZ(t),hasM:e.hasM(t),points:e.exportPoints(t),spatialReference:a});return o.cache._geVersion=t,o}function M(e,t,a){const o=e.hasZ(t),n=e.hasM(t),s=new m({xmin:e.getXMin(t),ymin:e.getYMin(t),xmax:e.getXMax(t),ymax:e.getYMax(t),spatialReference:a});if(o){const i=e.getZExtent(t);s.zmin=i.vmin,s.zmax=i.vmax}if(n){const i=e.getMExtent(t);s.mmin=i.vmin,s.mmax=i.vmax}return s.cache._geVersion=t,s}export{y as hydratedAdapter}; diff --git a/custom-toc-highlight/assets/icon-BXFbBbop-BUyrjp8g.js b/custom-toc-highlight/assets/icon-BXFbBbop-Bq4Zv26A.js similarity index 96% rename from custom-toc-highlight/assets/icon-BXFbBbop-BUyrjp8g.js rename to custom-toc-highlight/assets/icon-BXFbBbop-Bq4Zv26A.js index 567802e4..d1633efc 100644 --- a/custom-toc-highlight/assets/icon-BXFbBbop-BUyrjp8g.js +++ b/custom-toc-highlight/assets/icon-BXFbBbop-Bq4Zv26A.js @@ -1 +1 @@ -import{p as m,b as v,a as l,D as x,c as g,M as y}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{p as w,A as z}from"./dom-N58V0tYi-DBU3jlah.js";import{c as D}from"./observers-BigwqTsw-BNRQivHR.js";const k={icon:"icon",flipRtl:"flip-rtl"},p={},h={},b={s:16,m:24,l:32};function d({icon:t,scale:i}){const s=b[i],e=I(t),n=e.charAt(e.length-1)==="F";return`${n?e.substring(0,e.length-1):e}${s}${n?"F":""}`}async function $(t){const i=d(t),s=u(i);if(s)return s;h[i]||(h[i]=fetch(y(`./assets/icon/${i}.json`)).then(n=>n.json()).catch(()=>(console.error(`"${i}" is not a valid calcite-ui-icon name`),"")));const e=await h[i];return p[i]=e,e}function O(t){return u(d(t))}function u(t){return p[t]}function I(t){const i=!isNaN(Number(t.charAt(0))),s=t.split("-");if(s.length>0){const e=/[a-z]/i;t=s.map((n,r)=>n.replace(e,function(c,a){return r===0&&a===0?c:c.toUpperCase()})).join("")}return i?`i${t}`:t}const P=":host{display:inline-flex;color:var(--calcite-icon-color, var(--calcite-ui-icon-color, currentColor))}:host([scale=s]){inline-size:16px;block-size:16px;min-inline-size:16px;min-block-size:16px}:host([scale=m]){inline-size:24px;block-size:24px;min-inline-size:24px;min-block-size:24px}:host([scale=l]){inline-size:32px;block-size:32px;min-inline-size:32px;min-block-size:32px}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}",C=P,E=m(class extends v{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=null,this.flipRtl=!1,this.scale="m",this.textLabel=void 0,this.pathData=void 0,this.visible=!1}connectedCallback(){this.visible||this.waitUntilVisible(()=>{this.visible=!0,this.loadIconPathData()})}disconnectedCallback(){this.intersectionObserver?.disconnect(),this.intersectionObserver=null}render(){const{el:t,flipRtl:i,pathData:s,scale:e,textLabel:n}=this,r=w(t),c=b[e],a=!!n,f=[].concat(s||"");return l(x,{key:"724265acdc6fb528bf7b25d7ec445c73a63f4c8e","aria-hidden":z(!a),"aria-label":a?n:null,role:a?"img":null},l("svg",{key:"864ee2d80bebd282543ba5d94c57f84b48a6204d","aria-hidden":"true",class:{[k.flipRtl]:r==="rtl"&&i,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${c} ${c}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},f.map(o=>typeof o=="string"?l("path",{d:o}):l("path",{d:o.d,opacity:"opacity"in o?o.opacity:1}))))}async loadIconPathData(){const{icon:t,scale:i,visible:s}=this;if(!g()||!t||!s)return;const e={icon:t,scale:i},n=O(e)||await $(e);t===this.icon&&(this.pathData=n)}waitUntilVisible(t){if(this.intersectionObserver=D("intersection",i=>{i.forEach(s=>{s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t())})},{rootMargin:"50px"}),!this.intersectionObserver){t();return}this.intersectionObserver.observe(this.el)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{icon:["loadIconPathData"],scale:["loadIconPathData"]}}static get style(){return C}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]},void 0,{icon:["loadIconPathData"],scale:["loadIconPathData"]}]);function R(){typeof customElements>"u"||["calcite-icon"].forEach(t=>{switch(t){case"calcite-icon":customElements.get(t)||customElements.define(t,E);break}})}R();export{E as f,R as m}; +import{p as m,b as v,a as l,D as x,c as g,M as y}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{p as w,A as z}from"./dom-N58V0tYi-DBU3jlah.js";import{c as D}from"./observers-BigwqTsw-CfIXp3Nz.js";const k={icon:"icon",flipRtl:"flip-rtl"},p={},h={},b={s:16,m:24,l:32};function d({icon:t,scale:i}){const s=b[i],e=I(t),n=e.charAt(e.length-1)==="F";return`${n?e.substring(0,e.length-1):e}${s}${n?"F":""}`}async function $(t){const i=d(t),s=u(i);if(s)return s;h[i]||(h[i]=fetch(y(`./assets/icon/${i}.json`)).then(n=>n.json()).catch(()=>(console.error(`"${i}" is not a valid calcite-ui-icon name`),"")));const e=await h[i];return p[i]=e,e}function O(t){return u(d(t))}function u(t){return p[t]}function I(t){const i=!isNaN(Number(t.charAt(0))),s=t.split("-");if(s.length>0){const e=/[a-z]/i;t=s.map((n,r)=>n.replace(e,function(c,a){return r===0&&a===0?c:c.toUpperCase()})).join("")}return i?`i${t}`:t}const P=":host{display:inline-flex;color:var(--calcite-icon-color, var(--calcite-ui-icon-color, currentColor))}:host([scale=s]){inline-size:16px;block-size:16px;min-inline-size:16px;min-block-size:16px}:host([scale=m]){inline-size:24px;block-size:24px;min-inline-size:24px;min-block-size:24px}:host([scale=l]){inline-size:32px;block-size:32px;min-inline-size:32px;min-block-size:32px}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}",C=P,E=m(class extends v{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=null,this.flipRtl=!1,this.scale="m",this.textLabel=void 0,this.pathData=void 0,this.visible=!1}connectedCallback(){this.visible||this.waitUntilVisible(()=>{this.visible=!0,this.loadIconPathData()})}disconnectedCallback(){this.intersectionObserver?.disconnect(),this.intersectionObserver=null}render(){const{el:t,flipRtl:i,pathData:s,scale:e,textLabel:n}=this,r=w(t),c=b[e],a=!!n,f=[].concat(s||"");return l(x,{key:"724265acdc6fb528bf7b25d7ec445c73a63f4c8e","aria-hidden":z(!a),"aria-label":a?n:null,role:a?"img":null},l("svg",{key:"864ee2d80bebd282543ba5d94c57f84b48a6204d","aria-hidden":"true",class:{[k.flipRtl]:r==="rtl"&&i,svg:!0},fill:"currentColor",height:"100%",viewBox:`0 0 ${c} ${c}`,width:"100%",xmlns:"http://www.w3.org/2000/svg"},f.map(o=>typeof o=="string"?l("path",{d:o}):l("path",{d:o.d,opacity:"opacity"in o?o.opacity:1}))))}async loadIconPathData(){const{icon:t,scale:i,visible:s}=this;if(!g()||!t||!s)return;const e={icon:t,scale:i},n=O(e)||await $(e);t===this.icon&&(this.pathData=n)}waitUntilVisible(t){if(this.intersectionObserver=D("intersection",i=>{i.forEach(s=>{s.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t())})},{rootMargin:"50px"}),!this.intersectionObserver){t();return}this.intersectionObserver.observe(this.el)}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{icon:["loadIconPathData"],scale:["loadIconPathData"]}}static get style(){return C}},[1,"calcite-icon",{icon:[513],flipRtl:[516,"flip-rtl"],scale:[513],textLabel:[1,"text-label"],pathData:[32],visible:[32]},void 0,{icon:["loadIconPathData"],scale:["loadIconPathData"]}]);function R(){typeof customElements>"u"||["calcite-icon"].forEach(t=>{switch(t){case"calcite-icon":customElements.get(t)||customElements.define(t,E);break}})}R();export{E as f,R as m}; diff --git a/custom-toc-highlight/assets/imageBitmapUtils-DA36kg39-CZPhYtU7.js b/custom-toc-highlight/assets/imageBitmapUtils-DA36kg39-BfNbbEDs.js similarity index 84% rename from custom-toc-highlight/assets/imageBitmapUtils-DA36kg39-CZPhYtU7.js rename to custom-toc-highlight/assets/imageBitmapUtils-DA36kg39-BfNbbEDs.js index 9479e413..b1ecbd9f 100644 --- a/custom-toc-highlight/assets/imageBitmapUtils-DA36kg39-CZPhYtU7.js +++ b/custom-toc-highlight/assets/imageBitmapUtils-DA36kg39-BfNbbEDs.js @@ -1 +1 @@ -import{o as c,$ as l}from"./story-BfX8CRfG.js";async function u(a,e,t){let r;try{r=await createImageBitmap(a)}catch(o){throw new c("request:server",`Unable to load ${e}`,{url:e,error:o})}return l(t),r}async function w(a,e,t,r,o){let n;try{n=await createImageBitmap(a)}catch(i){throw new c("request:server",`Unable to load tile ${e}/${t}/${r}`,{error:i,level:e,row:t,col:r})}return l(o),n}export{u as i,w as u}; +import{o as c,$ as l}from"./story-Doly9N9p.js";async function u(a,e,t){let r;try{r=await createImageBitmap(a)}catch(o){throw new c("request:server",`Unable to load ${e}`,{url:e,error:o})}return l(t),r}async function w(a,e,t,r,o){let n;try{n=await createImageBitmap(a)}catch(i){throw new c("request:server",`Unable to load tile ${e}/${t}/${r}`,{error:i,level:e,row:t,col:r})}return l(o),n}export{u as i,w as u}; diff --git a/custom-toc-highlight/assets/imageUtils-BA2D6Uf1-DgLNtmEY.js b/custom-toc-highlight/assets/imageUtils-BA2D6Uf1-CYx0DlwL.js similarity index 75% rename from custom-toc-highlight/assets/imageUtils-BA2D6Uf1-DgLNtmEY.js rename to custom-toc-highlight/assets/imageUtils-BA2D6Uf1-CYx0DlwL.js index a13347be..dcbeb640 100644 --- a/custom-toc-highlight/assets/imageUtils-BA2D6Uf1-DgLNtmEY.js +++ b/custom-toc-highlight/assets/imageUtils-BA2D6Uf1-CYx0DlwL.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./gif-BZzSowd2-DsEs7FgS.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./apng-DuERAVke-BAEONUn6.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); -import{_ as u}from"./main-ugzBrWNm.js";import{dG as d,dH as p,f,aU as w,o as y}from"./story-BfX8CRfG.js";let r=null,o=!0;function E(a,e,t){if(!a||!e)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e)}catch{o=!1}return m(a,e,t)}function I(a,e,t,n){if(!e||!t)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e,t)}catch{o=!1}const i=m(e,t,n);return i.data.set(a,0),i}function g(){return r||(r=document.createElement("canvas"),r.width=1,r.height=1),r}function m(a,e,t){return t||(t=g()),t.getContext("2d").createImageData(a,e)}async function h(a,e){const t=window.URL.createObjectURL(a);try{const{data:n}=await f(t,{...e,responseType:"image"});return n}catch(n){throw w(n)?n:new y("invalid-image",`Could not fetch requested image at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function v(a,e){const{arrayBuffer:t,mediaType:n}=await l(a,e),i=n==="image/png";if(n==="image/gif"){const{isAnimatedGIF:c,parseGif:s}=await u(()=>import("./gif-BZzSowd2-DsEs7FgS.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);if(c(t))return s(t,e)}if(i){const{isAnimatedPNG:c,parseApng:s}=await u(()=>import("./apng-DuERAVke-BAEONUn6.js"),__vite__mapDeps([5,6,1,2,3,4]),import.meta.url);if(c(t))return s(t,e)}return h(new Blob([t],{type:n}),e)}async function l(a,e){const t=d(a);if(t?.isBase64)return{arrayBuffer:p(t.data),mediaType:t.mediaType};const n=await f(a,{responseType:"array-buffer",...e});return{arrayBuffer:n.data,mediaType:n.getHeader?.("Content-Type")??""}}export{v as T,I as g,E as y}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./gif-BZzSowd2-49ll32ZF.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./apng-DuERAVke-D1GuG4Xy.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js"])))=>i.map(i=>d[i]); +import{_ as u}from"./main-QGPoLsvl.js";import{dG as d,dH as p,f,aU as w,o as y}from"./story-Doly9N9p.js";let r=null,o=!0;function E(a,e,t){if(!a||!e)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e)}catch{o=!1}return m(a,e,t)}function I(a,e,t,n){if(!e||!t)throw new Error("Cannot construct image data without dimensions");if(o)try{return new ImageData(a,e,t)}catch{o=!1}const i=m(e,t,n);return i.data.set(a,0),i}function g(){return r||(r=document.createElement("canvas"),r.width=1,r.height=1),r}function m(a,e,t){return t||(t=g()),t.getContext("2d").createImageData(a,e)}async function h(a,e){const t=window.URL.createObjectURL(a);try{const{data:n}=await f(t,{...e,responseType:"image"});return n}catch(n){throw w(n)?n:new y("invalid-image",`Could not fetch requested image at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function v(a,e){const{arrayBuffer:t,mediaType:n}=await l(a,e),i=n==="image/png";if(n==="image/gif"){const{isAnimatedGIF:c,parseGif:s}=await u(()=>import("./gif-BZzSowd2-49ll32ZF.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);if(c(t))return s(t,e)}if(i){const{isAnimatedPNG:c,parseApng:s}=await u(()=>import("./apng-DuERAVke-D1GuG4Xy.js"),__vite__mapDeps([5,6,1,2,3,4]),import.meta.url);if(c(t))return s(t,e)}return h(new Blob([t],{type:n}),e)}async function l(a,e){const t=d(a);if(t?.isBase64)return{arrayBuffer:p(t.data),mediaType:t.mediaType};const n=await f(a,{responseType:"array-buffer",...e});return{arrayBuffer:n.data,mediaType:n.getHeader?.("Content-Type")??""}}export{v as T,I as g,E as y}; diff --git a/custom-toc-highlight/assets/imageUtils-Co-ELErj-Dh62T-vs.js b/custom-toc-highlight/assets/imageUtils-Co-ELErj-D3GFlUnZ.js similarity index 88% rename from custom-toc-highlight/assets/imageUtils-Co-ELErj-Dh62T-vs.js rename to custom-toc-highlight/assets/imageUtils-Co-ELErj-D3GFlUnZ.js index c3d83cd7..52d349b2 100644 --- a/custom-toc-highlight/assets/imageUtils-Co-ELErj-Dh62T-vs.js +++ b/custom-toc-highlight/assets/imageUtils-Co-ELErj-D3GFlUnZ.js @@ -1 +1 @@ -import{v as V,i as y,bh as I}from"./story-BfX8CRfG.js";import{E as m,e as c}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{I as M}from"./Bitmap-CcqmzvfR-Bqft9oF3.js";import{s as T,K as C}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{h as P}from"./TileContainer-D48pXXgL-CdMiwPkS.js";let A=class extends C{constructor(e,t,r,s,i,n,o=null){super(e,t,r,s,i,n),this.bitmap=new M(o),this.bitmap.coordScale=[i,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){this.bitmap.beforeRender(e),super.beforeRender(e)}afterRender(e){this.bitmap.afterRender(e),super.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:c(),tileMat3:c()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},F=class extends P{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const t=this.tileInfoView.getTileBounds(I(),e),r=this.tileInfoView.getTileResolution(e.level),[s,i]=this.tileInfoView.tileInfo.size;return new A(e,r,t[0],t[3],s,i)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap (tile)",brushes:[T.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:m.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===m.MAP&&super.doRender(e)}};const O=e=>{let t=class extends e{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new F(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){this.container.removeChild(this._bitmapView),this._bitmapView?.removeAllChildren(),this._bitmapView=null}};return t=V([y("esri.views.2d.layers.BitmapTileLayerView2D")],t),t};function L(e){return e instanceof HTMLImageElement?e.naturalWidth:e.width}function _(e){return e instanceof HTMLImageElement?e.naturalHeight:e.height}function z(e,t,r,s){if(r.level===s.level)return t;const i=e.tileInfo.size,n=e.getTileResolution(r.level),o=e.getTileResolution(s.level);let a=e.getLODInfoAt(s.level);const p=a.getXForColumn(s.col),u=a.getYForRow(s.row);a=e.getLODInfoAt(r.level);const f=a.getXForColumn(r.col),b=a.getYForRow(r.row),l=L(t)/i[0],h=_(t)/i[1],w=Math.round(l*((p-f)/n)),g=Math.round(h*(-(u-b)/n)),R=Math.round(l*i[0]*(o/n)),v=Math.round(h*i[1]*(o/n)),d=x(i);return d.getContext("2d").drawImage(t,w,g,R,v,0,0,i[0],i[1]),d}function x(e){const t=document.createElement("canvas");return[t.width,t.height]=e,t}export{z as D,O as L,x as p}; +import{v as V,i as y,bh as I}from"./story-Doly9N9p.js";import{E as m,e as c}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{I as M}from"./Bitmap-CcqmzvfR-C22fE2NY.js";import{s as T,K as C}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{h as P}from"./TileContainer-D48pXXgL-BzDz3Uqo.js";let A=class extends C{constructor(e,t,r,s,i,n,o=null){super(e,t,r,s,i,n),this.bitmap=new M(o),this.bitmap.coordScale=[i,n],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){this.bitmap.beforeRender(e),super.beforeRender(e)}afterRender(e){this.bitmap.afterRender(e),super.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{displayViewScreenMat3:c(),tileMat3:c()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.displayViewScreenMat3=this.transforms.displayViewScreenMat3}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}},F=class extends P{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const t=this.tileInfoView.getTileBounds(I(),e),r=this.tileInfoView.getTileResolution(e.level),[s,i]=this.tileInfoView.tileInfo.size;return new A(e,r,t[0],t[3],s,i)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap (tile)",brushes:[T.bitmap],target:()=>this.children.map(r=>r.bitmap),drawPhase:m.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===m.MAP&&super.doRender(e)}};const O=e=>{let t=class extends e{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new F(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){this.container.removeChild(this._bitmapView),this._bitmapView?.removeAllChildren(),this._bitmapView=null}};return t=V([y("esri.views.2d.layers.BitmapTileLayerView2D")],t),t};function L(e){return e instanceof HTMLImageElement?e.naturalWidth:e.width}function _(e){return e instanceof HTMLImageElement?e.naturalHeight:e.height}function z(e,t,r,s){if(r.level===s.level)return t;const i=e.tileInfo.size,n=e.getTileResolution(r.level),o=e.getTileResolution(s.level);let a=e.getLODInfoAt(s.level);const p=a.getXForColumn(s.col),u=a.getYForRow(s.row);a=e.getLODInfoAt(r.level);const f=a.getXForColumn(r.col),b=a.getYForRow(r.row),l=L(t)/i[0],h=_(t)/i[1],w=Math.round(l*((p-f)/n)),g=Math.round(h*(-(u-b)/n)),R=Math.round(l*i[0]*(o/n)),v=Math.round(h*i[1]*(o/n)),d=x(i);return d.getContext("2d").drawImage(t,w,g,R,v,0,0,i[0],i[1]),d}function x(e){const t=document.createElement("canvas");return[t.width,t.height]=e,t}export{z as D,O as L,x as p}; diff --git a/custom-toc-highlight/assets/imageryUtils-6MVSqijr-B_Ii3EHZ.js b/custom-toc-highlight/assets/imageryUtils-6MVSqijr-2ufISwt4.js similarity index 75% rename from custom-toc-highlight/assets/imageryUtils-6MVSqijr-B_Ii3EHZ.js rename to custom-toc-highlight/assets/imageryUtils-6MVSqijr-2ufISwt4.js index b3bf05a0..e3d333ee 100644 --- a/custom-toc-highlight/assets/imageryUtils-6MVSqijr-B_Ii3EHZ.js +++ b/custom-toc-highlight/assets/imageryUtils-6MVSqijr-2ufISwt4.js @@ -1 +1 @@ -import{C as y,D as n}from"./utils-BVWK2jiA-Btpo3M9u.js";import{S as p,l as c,L as u,E as i}from"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./jsonContext-BA8GHqVk-CWQlLGSw.js";import"./saveUtils-CIYk-dsQ-VGcOewby.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";const s="Image Service",g="imagery-layer-save",v="imagery-layer-save-as",f="imagery-tile-layer-save",d="imagery-tile-layer-save-as";function m(t){if(t.type==="imagery")return{isValid:!0};const{raster:e}=t,r=e?.datasetFormat==="Function"?e.primaryRasters?.rasters[0]:e;return{isValid:r?.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"),errorMessage:"imagery tile layer should be created from a tiled image service."}}function o(t){const e=t.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function T(t,e){const{parsedUrl:r,title:a,fullExtent:l}=t;e.url=r.path,e.title||=a;try{e.extent=await p(l)}catch{e.extent=void 0}c(e,i.METADATA),u(e,i.TILED_IMAGERY,t.type==="imagery-tile")}async function F(t,e){const r=t.type==="imagery"?g:f;return y({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:r},e)}async function N(t,e,r){const a=t.type==="imagery"?v:d;return n({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:a,newItem:e,setItemProperties:T},r)}export{F as save,N as saveAs}; +import{C as y,D as n}from"./utils-BVWK2jiA-i-Dn2Ad8.js";import{S as p,l as c,L as u,E as i}from"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./jsonContext-BA8GHqVk-BsXRY5es.js";import"./saveUtils-CIYk-dsQ-Br9QCJTX.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";const s="Image Service",g="imagery-layer-save",v="imagery-layer-save-as",f="imagery-tile-layer-save",d="imagery-tile-layer-save-as";function m(t){if(t.type==="imagery")return{isValid:!0};const{raster:e}=t,r=e?.datasetFormat==="Function"?e.primaryRasters?.rasters[0]:e;return{isValid:r?.datasetFormat==="RasterTileServer"&&(r.tileType==="Raster"||r.tileType==="Map"),errorMessage:"imagery tile layer should be created from a tiled image service."}}function o(t){const e=t.layerJSON;return Promise.resolve(e&&Object.keys(e).length?e:null)}async function T(t,e){const{parsedUrl:r,title:a,fullExtent:l}=t;e.url=r.path,e.title||=a;try{e.extent=await p(l)}catch{e.extent=void 0}c(e,i.METADATA),u(e,i.TILED_IMAGERY,t.type==="imagery-tile")}async function F(t,e){const r=t.type==="imagery"?g:f;return y({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:r},e)}async function N(t,e,r){const a=t.type==="imagery"?v:d;return n({layer:t,itemType:s,validateLayer:m,createItemData:o,errorNamePrefix:a,newItem:e,setItemProperties:T},r)}export{F as save,N as saveAs}; diff --git a/custom-toc-highlight/assets/index--i98kM5n-D5qo9Ek1.js b/custom-toc-highlight/assets/index--i98kM5n-wnGfY6-E.js similarity index 69% rename from custom-toc-highlight/assets/index--i98kM5n-D5qo9Ek1.js rename to custom-toc-highlight/assets/index--i98kM5n-wnGfY6-E.js index c0ae540c..e332e44e 100644 --- a/custom-toc-highlight/assets/index--i98kM5n-D5qo9Ek1.js +++ b/custom-toc-highlight/assets/index--i98kM5n-wnGfY6-E.js @@ -1 +1 @@ -import{a as o}from"./fabric-Df28hv38-CC2TWXwY.js";import{fq as s}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";class f extends s{get config(){return this.$iApi.fixture.get("export").config?.map}async make(t){const e=await this.$iApi.geo.map.takeScreenshot({quality:1,format:"png"}),a=new Image;a.src=e.dataUrl;const r=await new Promise(i=>a.onload=()=>i(a));return new o.fabric.Image(r,t)}}export{f as default}; +import{a as o}from"./fabric-Df28hv38-DoClkw8Q.js";import{fq as s}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";class f extends s{get config(){return this.$iApi.fixture.get("export").config?.map}async make(t){const e=await this.$iApi.geo.map.takeScreenshot({quality:1,format:"png"}),a=new Image;a.src=e.dataUrl;const r=await new Promise(i=>a.onload=()=>i(a));return new o.fabric.Image(r,t)}}export{f as default}; diff --git a/custom-toc-highlight/assets/index-5nGe0Bgx-DXktt_T1.js b/custom-toc-highlight/assets/index-5nGe0Bgx-PuzIaK3Y.js similarity index 96% rename from custom-toc-highlight/assets/index-5nGe0Bgx-DXktt_T1.js rename to custom-toc-highlight/assets/index-5nGe0Bgx-PuzIaK3Y.js index 75d551f6..3c6a4642 100644 --- a/custom-toc-highlight/assets/index-5nGe0Bgx-DXktt_T1.js +++ b/custom-toc-highlight/assets/index-5nGe0Bgx-PuzIaK3Y.js @@ -1,4 +1,4 @@ -import{eT as Y,fX as w,fq as q,fN as z,eY as N,f6 as s,eZ as b,fY as R,f8 as S,eV as T,fZ as W,f9 as B,fB as G,f_ as X,fK as F,f$ as O,g0 as V,e$ as Z,fb as j,f2 as D,fF as K}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";class J extends q{_parseConfig(t){const a=w(this.$vApp.$pinia);t&&(a.arrowIcon=t.arrowIcon,a.poleIcon=t.poleIcon)}get config(){return super.config}}const U="path",Q=12,ee="M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6z",te="#ff0000ff",ae=5,se=6,ie={style:U,size:Q,path:ee,colour:te,xOffset:ae,yOffset:se},oe=["innerHTML"],re=Y({__name:"northarrow",setup(y){const t=z(),a=w(),e=N("iApi"),n=s(),M=b(()=>a.arrowIcon),$=b(()=>a.poleIcon),p=s(0),r=s(0),h=s(!1),k=s(` +import{eT as Y,fX as w,fq as q,fN as z,eY as N,f6 as s,eZ as b,fY as R,f8 as S,eV as T,fZ as W,f9 as B,fB as G,f_ as X,fK as F,f$ as O,g0 as V,e$ as Z,fb as j,f2 as D,fF as K}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";class J extends q{_parseConfig(t){const a=w(this.$vApp.$pinia);t&&(a.arrowIcon=t.arrowIcon,a.poleIcon=t.poleIcon)}get config(){return super.config}}const U="path",Q=12,ee="M14.4 6L14 4H5v17h2v-7h5.6l.4 2h7V6z",te="#ff0000ff",ae=5,se=6,ie={style:U,size:Q,path:ee,colour:te,xOffset:ae,yOffset:se},oe=["innerHTML"],re=Y({__name:"northarrow",setup(y){const t=z(),a=w(),e=N("iApi"),n=s(),M=b(()=>a.arrowIcon),$=b(()=>a.poleIcon),p=s(0),r=s(0),h=s(!1),k=s(` diff --git a/custom-toc-highlight/assets/index-7blUq_oP-DVsFK_oh.js b/custom-toc-highlight/assets/index-7blUq_oP-dtZV9W0P.js similarity index 83% rename from custom-toc-highlight/assets/index-7blUq_oP-DVsFK_oh.js rename to custom-toc-highlight/assets/index-7blUq_oP-dtZV9W0P.js index 335e49d0..cd21922e 100644 --- a/custom-toc-highlight/assets/index-7blUq_oP-DVsFK_oh.js +++ b/custom-toc-highlight/assets/index-7blUq_oP-dtZV9W0P.js @@ -1 +1 @@ -import{a as i}from"./fabric-Df28hv38-CC2TWXwY.js";import{fq as a}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";class m extends a{get config(){return this.$iApi.fixture.get("export").config?.mapElements}make(o){const t=this.$iApi.geo.map.caption.scaleHelper(),r=[];for(let e=0;e<2;e++){const n=new i.fabric.Text(this.$iApi.$i18n.t("export.scaleBar.approx",[`${this.$iApi.$i18n.n(t[e].distance,"number")}${t[e].units}`]),{fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:16,top:e*50,left:0,originX:"left",originY:"top"}),s=new i.fabric.Line([0,e===0?30:40,t[e].pixels,e===0?30:40],{stroke:"black",strokeWidth:3});r.push(new i.fabric.Group([s,n]))}return Promise.resolve(new i.fabric.Group(r,o))}}export{m as default}; +import{a as i}from"./fabric-Df28hv38-DoClkw8Q.js";import{fq as a}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";class m extends a{get config(){return this.$iApi.fixture.get("export").config?.mapElements}make(o){const t=this.$iApi.geo.map.caption.scaleHelper(),r=[];for(let e=0;e<2;e++){const n=new i.fabric.Text(this.$iApi.$i18n.t("export.scaleBar.approx",[`${this.$iApi.$i18n.n(t[e].distance,"number")}${t[e].units}`]),{fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:16,top:e*50,left:0,originX:"left",originY:"top"}),s=new i.fabric.Line([0,e===0?30:40,t[e].pixels,e===0?30:40],{stroke:"black",strokeWidth:3});r.push(new i.fabric.Group([s,n]))}return Promise.resolve(new i.fabric.Group(r,o))}}export{m as default}; diff --git a/custom-toc-highlight/assets/index-98it_ulG-BsOnjtDb.js b/custom-toc-highlight/assets/index-98it_ulG-w2DJElWd.js similarity index 94% rename from custom-toc-highlight/assets/index-98it_ulG-BsOnjtDb.js rename to custom-toc-highlight/assets/index-98it_ulG-w2DJElWd.js index 510cd865..67741eda 100644 --- a/custom-toc-highlight/assets/index-98it_ulG-BsOnjtDb.js +++ b/custom-toc-highlight/assets/index-98it_ulG-w2DJElWd.js @@ -1 +1 @@ -import{a as o}from"./fabric-Df28hv38-CC2TWXwY.js";import{fq as k,fB as M,fz as y}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";class P extends k{get config(){return this.$iApi.fixture.get("export").config?.mapElements}async make(c){let h=i=>0,s=0;const f='N',t=this.$vApp.$el.querySelector(".inner-shell"),p=this.$iApi.geo.map.getSR();let a=0;if(p.isWebMercator())a=0;else{const i=new M("pole",{x:-96,y:90}),n=await this.$iApi.geo.proj.projectGeometry(p,i),r=this.$iApi.geo.map.mapPointToScreenPoint(n),d={screenX:t.clientWidth/2,screenY:t.clientHeight};a=Math.atan((r.screenX-d.screenX)/(d.screenY-r.screenY))*180/Math.PI;const w=t.clientWidth/2+t.clientHeight*Math.tan(a*Math.PI/180)-50/2,x=Math.round(w/t.clientWidth*100);s=Math.min(Math.max(x,0),100),h=l=>{if(l<0||l>100)throw new Error("Normalized position must be between 0 and 100");const u=t.clientWidth*l/100;return Math.atan((r.screenX-u)/(50/2-r.screenY))*(180/Math.PI)}}const g={top:0,left:0,originX:"center",originY:"center",angle:a},m=[];let e=new o.fabric.Group;return o.fabric.loadSVGFromString(f,()=>{e=new o.fabric.Group(m),e.positionX=s,e.getAngleFromPosition=h},(i,n)=>{m.push(n)}),e.set(y(g,c||{})),Promise.resolve(e)}}export{P as default}; +import{a as o}from"./fabric-Df28hv38-DoClkw8Q.js";import{fq as k,fB as M,fz as y}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";class P extends k{get config(){return this.$iApi.fixture.get("export").config?.mapElements}async make(c){let h=i=>0,s=0;const f='N',t=this.$vApp.$el.querySelector(".inner-shell"),p=this.$iApi.geo.map.getSR();let a=0;if(p.isWebMercator())a=0;else{const i=new M("pole",{x:-96,y:90}),n=await this.$iApi.geo.proj.projectGeometry(p,i),r=this.$iApi.geo.map.mapPointToScreenPoint(n),d={screenX:t.clientWidth/2,screenY:t.clientHeight};a=Math.atan((r.screenX-d.screenX)/(d.screenY-r.screenY))*180/Math.PI;const w=t.clientWidth/2+t.clientHeight*Math.tan(a*Math.PI/180)-50/2,x=Math.round(w/t.clientWidth*100);s=Math.min(Math.max(x,0),100),h=l=>{if(l<0||l>100)throw new Error("Normalized position must be between 0 and 100");const u=t.clientWidth*l/100;return Math.atan((r.screenX-u)/(50/2-r.screenY))*(180/Math.PI)}}const g={top:0,left:0,originX:"center",originY:"center",angle:a},m=[];let e=new o.fabric.Group;return o.fabric.loadSVGFromString(f,()=>{e=new o.fabric.Group(m),e.positionX=s,e.getAngleFromPosition=h},(i,n)=>{m.push(n)}),e.set(y(g,c||{})),Promise.resolve(e)}}export{P as default}; diff --git a/custom-toc-highlight/assets/index-B0lfXXMz-C5AduZae.js b/custom-toc-highlight/assets/index-B0lfXXMz-B4yTazBh.js similarity index 77% rename from custom-toc-highlight/assets/index-B0lfXXMz-C5AduZae.js rename to custom-toc-highlight/assets/index-B0lfXXMz-B4yTazBh.js index fcc91344..43bb1a1f 100644 --- a/custom-toc-highlight/assets/index-B0lfXXMz-C5AduZae.js +++ b/custom-toc-highlight/assets/index-B0lfXXMz-B4yTazBh.js @@ -1 +1 @@ -import{a as r}from"./fabric-Df28hv38-CC2TWXwY.js";import{fq as n,fz as s}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";class x extends n{get config(){return this.$iApi.fixture.get("export").config?.timestamp}make(o){const t=this.config,e={text:new Date().toLocaleString("en-CA"),fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0,left:0,originX:"left"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),a=new r.fabric.Textbox(i.text,i);return Promise.resolve(a)}}export{x as default}; +import{a as r}from"./fabric-Df28hv38-DoClkw8Q.js";import{fq as n,fz as s}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";class x extends n{get config(){return this.$iApi.fixture.get("export").config?.timestamp}make(o){const t=this.config,e={text:new Date().toLocaleString("en-CA"),fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0,left:0,originX:"left"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),a=new r.fabric.Textbox(i.text,i);return Promise.resolve(a)}}export{x as default}; diff --git a/custom-toc-highlight/assets/index-BAU9PUzR-Dm0i0OJc.js b/custom-toc-highlight/assets/index-BAU9PUzR-GOdyBPEe.js similarity index 86% rename from custom-toc-highlight/assets/index-BAU9PUzR-Dm0i0OJc.js rename to custom-toc-highlight/assets/index-BAU9PUzR-GOdyBPEe.js index a02aac4a..fdb341a1 100644 --- a/custom-toc-highlight/assets/index-BAU9PUzR-Dm0i0OJc.js +++ b/custom-toc-highlight/assets/index-BAU9PUzR-GOdyBPEe.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-x-yg_fPu-DpiHFK6N.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); -import{_ as o}from"./main-ugzBrWNm.js";import{eT as h,fu as r,fw as c,fJ as p,fq as u,eY as f,eX as d,e_ as v,e$ as m,f0 as g,f1 as x,f2 as s,f4 as _,eV as $}from"./story-BfX8CRfG.js";class A extends u{toggleHelp(e){const t=this.$iApi.panel.get("help");this.$iApi.panel.toggle(t,e)}get config(){return super.config}_parseConfig(e){const t=p(this.$vApp.$pinia);t.location=e?.location??"./help/",this.handlePanelWidths(["help"]),this.handlePanelTeleports(["help"])}}const w=h({__name:"nav-button",setup(i){const e=f("iApi"),{t}=d(),l=()=>e.event.emit($.HELP_TOGGLE);return(C,n)=>{const a=v("mapnav-button");return m(),g(a,{onClickFunction:l,tooltip:_(t)("help.title")},{default:x(()=>n[0]||(n[0]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[s("path",{d:"M0 0h24v24H0z",fill:"none"}),s("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})],-1)])),_:1},8,["tooltip"])}}}),E={en:{"help.title":"Help","help.search":"Search Help","help.section.expand":"Expand section","help.section.collapse":"Collapse section","help.noResults":"Nothing is found. Please try a different search."},fr:{"help.title":"Aide","help.search":"Aide à la recherche","help.section.expand":"Développer une section","help.section.collapse":"Réduire une section","help.noResults":"Aucun résultat. Veuillez essayer une autre recherche."}};class z extends A{added(){this.$iApi.component("help-nav-button",w),this.$iApi.panel.register({help:{screens:{"help-screen":()=>r(o(()=>import("./screen-x-yg_fPu-DpiHFK6N.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{"flex-grow":"1","max-width":"750px"},alertName:"help.title"}},{i18n:{messages:E}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("mapnav")&&c(this.$vApp.$pinia).removeItem("help"),p(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("help")}}}export{z as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-x-yg_fPu-CAXKOE6F.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); +import{_ as o}from"./main-QGPoLsvl.js";import{eT as h,fu as r,fw as c,fJ as p,fq as u,eY as f,eX as d,e_ as v,e$ as m,f0 as g,f1 as x,f2 as s,f4 as _,eV as $}from"./story-Doly9N9p.js";class A extends u{toggleHelp(e){const t=this.$iApi.panel.get("help");this.$iApi.panel.toggle(t,e)}get config(){return super.config}_parseConfig(e){const t=p(this.$vApp.$pinia);t.location=e?.location??"./help/",this.handlePanelWidths(["help"]),this.handlePanelTeleports(["help"])}}const w=h({__name:"nav-button",setup(i){const e=f("iApi"),{t}=d(),l=()=>e.event.emit($.HELP_TOGGLE);return(C,n)=>{const a=v("mapnav-button");return m(),g(a,{onClickFunction:l,tooltip:_(t)("help.title")},{default:x(()=>n[0]||(n[0]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[s("path",{d:"M0 0h24v24H0z",fill:"none"}),s("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 17h-2v-2h2v2zm2.07-7.75l-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25z"})],-1)])),_:1},8,["tooltip"])}}}),E={en:{"help.title":"Help","help.search":"Search Help","help.section.expand":"Expand section","help.section.collapse":"Collapse section","help.noResults":"Nothing is found. Please try a different search."},fr:{"help.title":"Aide","help.search":"Aide à la recherche","help.section.expand":"Développer une section","help.section.collapse":"Réduire une section","help.noResults":"Aucun résultat. Veuillez essayer une autre recherche."}};class z extends A{added(){this.$iApi.component("help-nav-button",w),this.$iApi.panel.register({help:{screens:{"help-screen":()=>r(o(()=>import("./screen-x-yg_fPu-CAXKOE6F.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{"flex-grow":"1","max-width":"750px"},alertName:"help.title"}},{i18n:{messages:E}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("mapnav")&&c(this.$vApp.$pinia).removeItem("help"),p(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("help")}}}export{z as default}; diff --git a/custom-toc-highlight/assets/index-BCHMro24-BPmciRPg.js b/custom-toc-highlight/assets/index-BCHMro24-CwIpWYn_.js similarity index 94% rename from custom-toc-highlight/assets/index-BCHMro24-BPmciRPg.js rename to custom-toc-highlight/assets/index-BCHMro24-CwIpWYn_.js index 97bfc12a..20bfb662 100644 --- a/custom-toc-highlight/assets/index-BCHMro24-BPmciRPg.js +++ b/custom-toc-highlight/assets/index-BCHMro24-CwIpWYn_.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DOMT-YVI-Bf21b3uS.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./table-state-manager-CQv-OGS1-24xBkGVS.js"])))=>i.map(i=>d[i]); -import{_ as m}from"./main-ugzBrWNm.js";import{fu as u,eW as x,fI as n,fq as b}from"./story-BfX8CRfG.js";import{a as o}from"./table-state-manager-CQv-OGS1-24xBkGVS.js";class E extends b{gridStore=n(this.$vApp.$pinia);toggleGrid(e,l){const i=this.gridStore.getGridId(e);if(!i){const d=this.getLayerFixtureConfigs();this.gridStore.addGrid({id:e,layerIds:[e],state:new o(d[e]),fieldMap:{}})}const t=this.gridStore.currentId;this.gridStore.currentId=i??e;const s=this.$iApi.panel.get("grid");if(l===!1){s.close();return}!s.isOpen||!s.isVisible?this.$iApi.panel.open("grid"):t!==e||l===!0?s.show({screen:"grid-screen",props:{key:e}}):s.close()}_parseConfig(e){this.handlePanelWidths(["grid"]),this.handlePanelTeleports(["grid"]);const l=this.getLayerFixtureConfigs();e&&e.mergeGrids&&e.mergeGrids.forEach(i=>{const t=[],{gridId:s,layers:d,fieldMap:p,options:h}=i;d.forEach(r=>{r.sublayers?r.sublayers?.forEach(a=>{t.push(`${r.layerId}-${a}`),delete l[`${r.layerId}-${a}`]}):(t.push(r.layerId),delete l[r.layerId])});const g={};p?.forEach(r=>{r.sources.forEach(a=>{g[a]=r.field})});const f={id:s,layerIds:t,state:new o(h),fieldMap:g};this.gridStore.addGrid(f)}),Object.keys(l).forEach(i=>{const t={id:i,layerIds:[i],state:new o(l[i]),fieldMap:{}};this.gridStore.addGrid(t)})}}const y={en:{"grid.title":"Datatable","grid.alertName":"Grid","grid.splash.error":"Error: Failed to load the layer's data.","grid.splash.loading":"Loading data...","grid.splash.building":"Building table...","grid.splash.cancel":"Cancel","grid.clearAll":"Clear search and filters","grid.layer.loading":"The layer is loading...","grid.label.pinColumns":"Pin columns","grid.label.export":"Export","grid.label.columns":"Hide columns","grid.label.copied":"Copied","grid.label.copy":"Press ctrl + c or double click to copy","grid.label.specialColumn":"Special Column","grid.label.filters.show":"Show filters","grid.label.filters.hide":"Hide filters","grid.label.filters.apply":"Apply filters to map","grid.header.sort.0":"Sort ascending","grid.header.sort.1":"Sort descending","grid.header.sort.2":"Sort default","grid.header.reorder.left":"Move left","grid.header.reorder.right":"Move right","grid.filters.label.global":"Search table","grid.filters.column.label.text":"Search {0}...","grid.filters.clear":"Clear filters","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Max Date","grid.filters.date.min":"Min Date","grid.filters.label.info":"{range} of {total} entries shown","grid.filters.label.filtered":"(filtered from {max} total entries)","grid.filters.label.extent":"Filter by extent","grid.cells.controls":"Use arrow keys to navigate grid cells. Press Tab to proceed","grid.cells.zoom":"Zoom to feature","grid.cells.zoom.zooming":"Zooming...","grid.cells.zoom.error":"Zoom failed","grid.cells.zoom.zoomed":"Zoomed","grid.cells.alert.zoom":"Zoomed into feature","grid.cells.details":"Details","grid.button.title":"Grid"},fr:{"grid.title":"Tableau de données","grid.alertName":"Grille","grid.splash.error":"Erreur : Échec du chargement des données de la couche.","grid.splash.loading":"Chargement des données...","grid.splash.building":"Création du tableau...","grid.splash.cancel":"Annuler","grid.clearAll":"Effacer la recherche et les filtres","grid.layer.loading":"La couche est en cours de téléchargement...","grid.label.pinColumns":"Épingler les colonnes","grid.label.export":"Exporter","grid.label.columns":"Masquer les colonnes","grid.label.copied":"Copié","grid.label.copy":"Appuyez sur Ctrl + C ou double-cliquez pour copier","grid.label.specialColumn":"Colonne spéciale","grid.label.filters.show":"Afficher les filtres","grid.label.filters.hide":"Masquer les filtres","grid.label.filters.apply":"Appliquer les filtres à la carte","grid.header.sort.0":"Tri ascendant","grid.header.sort.1":"Tri descendant","grid.header.sort.2":"Tri par défaut","grid.header.reorder.left":"Déplacer vers la gauche","grid.header.reorder.right":"Déplacer vers la droite","grid.filters.label.global":"Tableau de recherche","grid.filters.column.label.text":"Rechercher {0}...","grid.filters.clear":"Supprimer les filtres","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Date max","grid.filters.date.min":"Date min","grid.filters.label.info":"{range} de {total} saisies affichées","grid.filters.label.filtered":"(filtré à partir d'un total de {max} saisies)","grid.filters.label.extent":"Filtrer par étendue","grid.cells.controls":"Utilisez les flèches pour parcourir les cellules de la grille. Appuyez sur Tab pour continuer","grid.cells.zoom":"Zoom à l'élément","grid.cells.zoom.zooming":"Zoom en cours...","grid.cells.zoom.error":"Échec du zoom","grid.cells.zoom.zoomed":"Zoom terminé","grid.cells.alert.zoom":"Zoom sur la caractéristique","grid.cells.details":"Détails","grid.button.title":"Grille"}};class A extends E{async added(){this.$iApi.panel.register({grid:{screens:{"grid-screen":()=>u(m(()=>import("./screen-DOMT-YVI-Bf21b3uS.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"450px"},controls:{expand:!0},button:{tooltip:"grid.button.title",icon:' '},expanded:!0,alertName:"grid.alertName"}},{i18n:{messages:y}}),this._parseConfig(this.config)}removed(){this.$iApi.fixture.exists("appbar")&&x(this.$vApp.$pinia).removeButton("grid"),n(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("grid")}}export{A as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DOMT-YVI-wvT49eu9.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./table-state-manager-CQv-OGS1-24xBkGVS.js"])))=>i.map(i=>d[i]); +import{_ as m}from"./main-QGPoLsvl.js";import{fu as u,eW as x,fI as n,fq as b}from"./story-Doly9N9p.js";import{a as o}from"./table-state-manager-CQv-OGS1-24xBkGVS.js";class E extends b{gridStore=n(this.$vApp.$pinia);toggleGrid(e,l){const i=this.gridStore.getGridId(e);if(!i){const d=this.getLayerFixtureConfigs();this.gridStore.addGrid({id:e,layerIds:[e],state:new o(d[e]),fieldMap:{}})}const t=this.gridStore.currentId;this.gridStore.currentId=i??e;const s=this.$iApi.panel.get("grid");if(l===!1){s.close();return}!s.isOpen||!s.isVisible?this.$iApi.panel.open("grid"):t!==e||l===!0?s.show({screen:"grid-screen",props:{key:e}}):s.close()}_parseConfig(e){this.handlePanelWidths(["grid"]),this.handlePanelTeleports(["grid"]);const l=this.getLayerFixtureConfigs();e&&e.mergeGrids&&e.mergeGrids.forEach(i=>{const t=[],{gridId:s,layers:d,fieldMap:p,options:h}=i;d.forEach(r=>{r.sublayers?r.sublayers?.forEach(a=>{t.push(`${r.layerId}-${a}`),delete l[`${r.layerId}-${a}`]}):(t.push(r.layerId),delete l[r.layerId])});const g={};p?.forEach(r=>{r.sources.forEach(a=>{g[a]=r.field})});const f={id:s,layerIds:t,state:new o(h),fieldMap:g};this.gridStore.addGrid(f)}),Object.keys(l).forEach(i=>{const t={id:i,layerIds:[i],state:new o(l[i]),fieldMap:{}};this.gridStore.addGrid(t)})}}const y={en:{"grid.title":"Datatable","grid.alertName":"Grid","grid.splash.error":"Error: Failed to load the layer's data.","grid.splash.loading":"Loading data...","grid.splash.building":"Building table...","grid.splash.cancel":"Cancel","grid.clearAll":"Clear search and filters","grid.layer.loading":"The layer is loading...","grid.label.pinColumns":"Pin columns","grid.label.export":"Export","grid.label.columns":"Hide columns","grid.label.copied":"Copied","grid.label.copy":"Press ctrl + c or double click to copy","grid.label.specialColumn":"Special Column","grid.label.filters.show":"Show filters","grid.label.filters.hide":"Hide filters","grid.label.filters.apply":"Apply filters to map","grid.header.sort.0":"Sort ascending","grid.header.sort.1":"Sort descending","grid.header.sort.2":"Sort default","grid.header.reorder.left":"Move left","grid.header.reorder.right":"Move right","grid.filters.label.global":"Search table","grid.filters.column.label.text":"Search {0}...","grid.filters.clear":"Clear filters","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Max Date","grid.filters.date.min":"Min Date","grid.filters.label.info":"{range} of {total} entries shown","grid.filters.label.filtered":"(filtered from {max} total entries)","grid.filters.label.extent":"Filter by extent","grid.cells.controls":"Use arrow keys to navigate grid cells. Press Tab to proceed","grid.cells.zoom":"Zoom to feature","grid.cells.zoom.zooming":"Zooming...","grid.cells.zoom.error":"Zoom failed","grid.cells.zoom.zoomed":"Zoomed","grid.cells.alert.zoom":"Zoomed into feature","grid.cells.details":"Details","grid.button.title":"Grid"},fr:{"grid.title":"Tableau de données","grid.alertName":"Grille","grid.splash.error":"Erreur : Échec du chargement des données de la couche.","grid.splash.loading":"Chargement des données...","grid.splash.building":"Création du tableau...","grid.splash.cancel":"Annuler","grid.clearAll":"Effacer la recherche et les filtres","grid.layer.loading":"La couche est en cours de téléchargement...","grid.label.pinColumns":"Épingler les colonnes","grid.label.export":"Exporter","grid.label.columns":"Masquer les colonnes","grid.label.copied":"Copié","grid.label.copy":"Appuyez sur Ctrl + C ou double-cliquez pour copier","grid.label.specialColumn":"Colonne spéciale","grid.label.filters.show":"Afficher les filtres","grid.label.filters.hide":"Masquer les filtres","grid.label.filters.apply":"Appliquer les filtres à la carte","grid.header.sort.0":"Tri ascendant","grid.header.sort.1":"Tri descendant","grid.header.sort.2":"Tri par défaut","grid.header.reorder.left":"Déplacer vers la gauche","grid.header.reorder.right":"Déplacer vers la droite","grid.filters.label.global":"Tableau de recherche","grid.filters.column.label.text":"Rechercher {0}...","grid.filters.clear":"Supprimer les filtres","grid.filters.number.max":"Max","grid.filters.number.min":"Min","grid.filters.date.max":"Date max","grid.filters.date.min":"Date min","grid.filters.label.info":"{range} de {total} saisies affichées","grid.filters.label.filtered":"(filtré à partir d'un total de {max} saisies)","grid.filters.label.extent":"Filtrer par étendue","grid.cells.controls":"Utilisez les flèches pour parcourir les cellules de la grille. Appuyez sur Tab pour continuer","grid.cells.zoom":"Zoom à l'élément","grid.cells.zoom.zooming":"Zoom en cours...","grid.cells.zoom.error":"Échec du zoom","grid.cells.zoom.zoomed":"Zoom terminé","grid.cells.alert.zoom":"Zoom sur la caractéristique","grid.cells.details":"Détails","grid.button.title":"Grille"}};class A extends E{async added(){this.$iApi.panel.register({grid:{screens:{"grid-screen":()=>u(m(()=>import("./screen-DOMT-YVI-wvT49eu9.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"450px"},controls:{expand:!0},button:{tooltip:"grid.button.title",icon:' '},expanded:!0,alertName:"grid.alertName"}},{i18n:{messages:y}}),this._parseConfig(this.config)}removed(){this.$iApi.fixture.exists("appbar")&&x(this.$vApp.$pinia).removeButton("grid"),n(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("grid")}}export{A as default}; diff --git a/custom-toc-highlight/assets/index-BSr9u_6r-DyyAtPyf.js b/custom-toc-highlight/assets/index-BSr9u_6r-ynd9tPq5.js similarity index 88% rename from custom-toc-highlight/assets/index-BSr9u_6r-DyyAtPyf.js rename to custom-toc-highlight/assets/index-BSr9u_6r-ynd9tPq5.js index 3ba4a9f6..64d0d407 100644 --- a/custom-toc-highlight/assets/index-BSr9u_6r-DyyAtPyf.js +++ b/custom-toc-highlight/assets/index-BSr9u_6r-ynd9tPq5.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./fabric-Df28hv38-CC2TWXwY.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./index-DY4XJa1m-CNSHrnyD.js","./index--i98kM5n-D5qo9Ek1.js","./index-DLWeBByc-q_J35KkL.js","./index-98it_ulG-BsOnjtDb.js","./index-7blUq_oP-DVsFK_oh.js","./index-B0lfXXMz-C5AduZae.js","./index-CWPzg1w2-dFHsYLYO.js"])))=>i.map(i=>d[i]); -import{_ as w}from"./main-ugzBrWNm.js";import{c0 as D,fu as M,eV as S,eW as k,fC as y,c1 as T,fq as P}from"./story-BfX8CRfG.js";import B from"./screen-CmNk4p3g-sxLtN1_r.js";var H={exports:{}},j=H.exports,R;function C(){return R||(R=1,function($,o){(function(n,s){s()})(j,function(){function n(t,e){return typeof e>"u"?e={autoBom:!1}:typeof e!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function s(t,e,d){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){a(i.response,e,d)},i.onerror=function(){console.error("could not download file")},i.send()}function b(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return 200<=e.status&&299>=e.status}function c(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof T=="object"&&T.global===T?T:void 0,_=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!_?function(t,e,d){var i=r.URL||r.webkitURL,l=document.createElement("a");e=e||t.name||"download",l.download=e,l.rel="noopener",typeof t=="string"?(l.href=t,l.origin===location.origin?c(l):b(l.href)?s(t,e,d):c(l,l.target="_blank")):(l.href=i.createObjectURL(t),setTimeout(function(){i.revokeObjectURL(l.href)},4e4),setTimeout(function(){c(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,d){if(e=e||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(n(t,d),e);else if(b(t))s(t,e,d);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){c(i)})}}:function(t,e,d,i){if(i=i||open("","_blank"),i&&(i.document.title=i.document.body.innerText="downloading..."),typeof t=="string")return s(t,e,d);var l=t.type==="application/octet-stream",f=/constructor/i.test(r.HTMLElement)||r.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||l&&f||_)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var p=g.result;p=h?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=p:location=p,i=null},g.readAsDataURL(t)}else{var m=r.URL||r.webkitURL,x=m.createObjectURL(t);i?i.location=x:location.href=x,i=null,setTimeout(function(){m.revokeObjectURL(x)},4e4)}});r.saveAs=a.saveAs=a,$.exports=a})}(H)),H.exports}var I=C();const N=D(I),A=1200,u={TOP:40,RIGHT:40,BOTTOM:40,LEFT:40};class U extends P{fcFabric;fcFabricDownload;options={runningHeight:0,scale:1};customRendererFunc=void 0;customRenderer(o){this.customRendererFunc=o}get config(){return super.config}_parseConfig(o){if(!o)return;const n=y(this.$vApp.$pinia);n.componentSelectedState={title:o.title?.selected??!0,map:o.map?.selected??!0,mapElements:o.mapElements?.selected??!0,legend:o.legend?.selected??!0,footnote:o.footnote?.selected??!0,timestamp:o.timestamp?.selected??!0},n.fileName=o.fileName||"",this.handlePanelWidths(["export"]),this.handlePanelTeleports(["export"])}getSubFixture(o){return this.$iApi.fixture.get(o)}async make(o,n){const{fabric:s}=await w(()=>import("./fabric-Df28hv38-CC2TWXwY.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(v=>v.f);s.Object.prototype.objectCaching=!1;const b=y(this.$vApp.$pinia),c={};this.fcFabric=new s.StaticCanvas(o,{backgroundColor:"#fff"}),this.fcFabricDownload=new s.StaticCanvas(null,{backgroundColor:"#fff"}),this.options.runningHeight=0;const r=b.componentSelectedState,_=this.getSubFixture("export-title"),a=this.getSubFixture("export-map"),t=this.getSubFixture("export-scalebar"),e=this.getSubFixture("export-northarrow"),d=this.getSubFixture("export-legend"),i=this.getSubFixture("export-footnote"),l=this.getSubFixture("export-timestamp");let f,h,g,m,x,p,F;if(r.title&&_&&(f=await _.make({top:this.options.runningHeight,left:0,originX:"left",width:n,textAlign:"center"}),this.options.runningHeight+=f.height+40,c.title=f),r.map&&a&&(h=await a.make({top:this.options.runningHeight}),f&&(f.left=h.width/2,f.originX="center"),this.options.runningHeight+=h.height+40,c.map=h),!h&&f&&(f.width=A),this.options.scale=n/((h?.width??A)+u.LEFT+u.RIGHT),r.mapElements&&t&&(g=await t.make({top:this.options.runningHeight,left:0}),this.options.runningHeight+=g.height+40,c.scaleBar=g,e&&(m=await e.make({top:g.top,left:n/this.options.scale}),m.top+=m.height/2-20,m.left+=-m.width*2,c.northArrow=m)),r.legend&&d&&(x=await d.make({width:d.config?.columnWidth??h?.width??A}),x.top=this.options.runningHeight,this.options.runningHeight+=x.height,c.legend=x),r.timestamp&&l&&(F=await l.make({top:this.options.runningHeight+40,width:n*1.5}),this.options.runningHeight+=!r.footnote||!i?F.height+40:F.height+20,c.timestamp=F),r.footnote&&i&&(p=await i.make({top:this.options.runningHeight-2.5,left:n/this.options.scale+40}),r.timestamp&&l?n-c.timestamp.getMinWidth()<=p.getMinWidth()+30?(p.top+=30,p.left=0,p.originX="left",this.options.runningHeight+=20):p.left+=-p.width*2:(p.top+=20,p.left+=-p.width*2,this.options.runningHeight+=20),this.options.runningHeight+=p.height,c.footnote=p),this.customRendererFunc){this.fcFabric.setWidth(n);const v={panelWidth:n,margin:u,defaultWidth:A,fabric:s};await this.customRendererFunc(this.fcFabric,c,v),this.fcFabric.renderAll(),this.fcFabric.clone(E=>{this.fcFabricDownload=E,this.fcFabricDownload.setDimensions({width:this.fcFabric?.getWidth(),height:this.fcFabric.getHeight()}),this.fcFabricDownload.renderAll()})}else{const v=new s.Group(Object.values(c),{top:u.TOP*this.options.scale,left:u.LEFT*this.options.scale}),E=await new Promise(O=>{v.clone(L=>{O(L)})});E.top=u.TOP,E.left=u.LEFT,this.fcFabricDownload.add(E),v.scale(this.options.scale),this.fcFabric.add(v),this.fcFabric.setDimensions({width:n,height:(this.options.runningHeight+u.TOP+u.BOTTOM)*this.options.scale}),this.fcFabric.renderAll(),this.fcFabricDownload.setDimensions({width:(h?.width??A)+u.LEFT+u.RIGHT,height:this.options.runningHeight+u.TOP+u.BOTTOM}),this.fcFabricDownload.renderAll()}}export(){if(!this.fcFabric)return;const o=new Date,n=this.config?.fileName||`map-carte - ${o.getFullYear()}-${o.getMonth()}-${o.getDay()}, ${o.getHours()}_${o.getMinutes()}`;N.saveAs(this.fcFabricDownload.toDataURL({format:"png",quality:1}),`${n}.png`)}}const W={en:{"export.title":"Export","export.alertName":"Export","export.download":"Download image","export.refresh":"Refresh","export.scaleBar.approx":"{0} approx.","export.menu":"Settings Menu","export.menu.component.title":"Title","export.menu.component.map":"Map","export.menu.component.mapElements":"North arrow and scalebar","export.menu.component.legend":"Legend","export.menu.component.footnote":"Footnote","export.menu.component.timestamp":"Timestamp"},fr:{"export.title":"Exporter","export.alertName":"Exporter","export.download":"Télécharger l'image","export.refresh":"Rafraîchir","export.scaleBar.approx":"Environ {0}","export.menu":"Menu des paramètres","export.menu.component.title":"Titre","export.menu.component.map":"Carte","export.menu.component.mapElements":"Flèche du nord et échelle graphique","export.menu.component.legend":"Légende","export.menu.component.footnote":"Référence","export.menu.component.timestamp":"Horodatage"}};class X extends U{initialized(){}async needed(){const o=(await w(async()=>{const{default:a}=await import("./index-DY4XJa1m-CNSHrnyD.js");return{default:a}},__vite__mapDeps([5,0,1,2,3,4]),import.meta.url)).default,n=(await w(async()=>{const{default:a}=await import("./index--i98kM5n-D5qo9Ek1.js");return{default:a}},__vite__mapDeps([6,0,1,2,3,4]),import.meta.url)).default,s=(await w(async()=>{const{default:a}=await import("./index-DLWeBByc-q_J35KkL.js");return{default:a}},__vite__mapDeps([7,1,2,3,4,0]),import.meta.url)).default,b=(await w(async()=>{const{default:a}=await import("./index-98it_ulG-BsOnjtDb.js");return{default:a}},__vite__mapDeps([8,0,1,2,3,4]),import.meta.url)).default,c=(await w(async()=>{const{default:a}=await import("./index-7blUq_oP-DVsFK_oh.js");return{default:a}},__vite__mapDeps([9,0,1,2,3,4]),import.meta.url)).default,r=(await w(async()=>{const{default:a}=await import("./index-B0lfXXMz-C5AduZae.js");return{default:a}},__vite__mapDeps([10,0,1,2,3,4]),import.meta.url)).default,_=(await w(async()=>{const{default:a}=await import("./index-CWPzg1w2-dFHsYLYO.js");return{default:a}},__vite__mapDeps([11,0,1,2,3,4]),import.meta.url)).default;this.$iApi.fixture.add("export-title",o),this.$iApi.fixture.add("export-map",n),this.$iApi.fixture.add("export-legend",s),this.$iApi.fixture.add("export-northarrow",b),this.$iApi.fixture.add("export-scalebar",c),this.$iApi.fixture.add("export-timestamp",r),this.$iApi.fixture.add("export-footnote",_)}added(){this.$iApi.panel.register({id:"export",config:{screens:{"export-screen":M(B)},style:{"flex-grow":"1","max-width":"800px"},button:{tooltip:"export.title",icon:''},alertName:"export.alertName"}},{i18n:{messages:W}});const o=this.$iApi.event.on(S.PANEL_OPENED,async s=>{s.id==="export"&&(this.$iApi.event.off(o),await this.needed(),s.exportMake())});this._parseConfig(this.config);const n=this.$vApp.$watch(()=>this.config,s=>this._parseConfig(s));this.removed=()=>{n(),this.$iApi.fixture.get("export-title")?.remove(),this.$iApi.fixture.get("export-map")?.remove(),this.$iApi.fixture.get("export-legend")?.remove(),this.$iApi.fixture.get("export-northarrow")?.remove(),this.$iApi.fixture.get("export-scalebar")?.remove(),this.$iApi.fixture.get("export-timestamp")?.remove(),this.$iApi.fixture.get("export-footnote")?.remove(),this.$iApi.fixture.exists("appbar")&&k(this.$vApp.$pinia).removeButton("export"),y(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("export")}}}export{X as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./fabric-Df28hv38-DoClkw8Q.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./index-DY4XJa1m-CinpT_5l.js","./index--i98kM5n-wnGfY6-E.js","./index-DLWeBByc-DDoUT1cR.js","./index-98it_ulG-w2DJElWd.js","./index-7blUq_oP-dtZV9W0P.js","./index-B0lfXXMz-B4yTazBh.js","./index-CWPzg1w2-Duz60wim.js"])))=>i.map(i=>d[i]); +import{_ as w}from"./main-QGPoLsvl.js";import{c0 as D,fu as M,eV as S,eW as k,fC as y,c1 as T,fq as P}from"./story-Doly9N9p.js";import B from"./screen-CmNk4p3g-CWwKxIyL.js";var H={exports:{}},j=H.exports,R;function C(){return R||(R=1,function($,o){(function(n,s){s()})(j,function(){function n(t,e){return typeof e>"u"?e={autoBom:!1}:typeof e!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),e={autoBom:!e}),e.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob(["\uFEFF",t],{type:t.type}):t}function s(t,e,d){var i=new XMLHttpRequest;i.open("GET",t),i.responseType="blob",i.onload=function(){a(i.response,e,d)},i.onerror=function(){console.error("could not download file")},i.send()}function b(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return 200<=e.status&&299>=e.status}function c(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof T=="object"&&T.global===T?T:void 0,_=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!_?function(t,e,d){var i=r.URL||r.webkitURL,l=document.createElement("a");e=e||t.name||"download",l.download=e,l.rel="noopener",typeof t=="string"?(l.href=t,l.origin===location.origin?c(l):b(l.href)?s(t,e,d):c(l,l.target="_blank")):(l.href=i.createObjectURL(t),setTimeout(function(){i.revokeObjectURL(l.href)},4e4),setTimeout(function(){c(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,d){if(e=e||t.name||"download",typeof t!="string")navigator.msSaveOrOpenBlob(n(t,d),e);else if(b(t))s(t,e,d);else{var i=document.createElement("a");i.href=t,i.target="_blank",setTimeout(function(){c(i)})}}:function(t,e,d,i){if(i=i||open("","_blank"),i&&(i.document.title=i.document.body.innerText="downloading..."),typeof t=="string")return s(t,e,d);var l=t.type==="application/octet-stream",f=/constructor/i.test(r.HTMLElement)||r.safari,h=/CriOS\/[\d]+/.test(navigator.userAgent);if((h||l&&f||_)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var p=g.result;p=h?p:p.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=p:location=p,i=null},g.readAsDataURL(t)}else{var m=r.URL||r.webkitURL,x=m.createObjectURL(t);i?i.location=x:location.href=x,i=null,setTimeout(function(){m.revokeObjectURL(x)},4e4)}});r.saveAs=a.saveAs=a,$.exports=a})}(H)),H.exports}var I=C();const N=D(I),A=1200,u={TOP:40,RIGHT:40,BOTTOM:40,LEFT:40};class U extends P{fcFabric;fcFabricDownload;options={runningHeight:0,scale:1};customRendererFunc=void 0;customRenderer(o){this.customRendererFunc=o}get config(){return super.config}_parseConfig(o){if(!o)return;const n=y(this.$vApp.$pinia);n.componentSelectedState={title:o.title?.selected??!0,map:o.map?.selected??!0,mapElements:o.mapElements?.selected??!0,legend:o.legend?.selected??!0,footnote:o.footnote?.selected??!0,timestamp:o.timestamp?.selected??!0},n.fileName=o.fileName||"",this.handlePanelWidths(["export"]),this.handlePanelTeleports(["export"])}getSubFixture(o){return this.$iApi.fixture.get(o)}async make(o,n){const{fabric:s}=await w(()=>import("./fabric-Df28hv38-DoClkw8Q.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(v=>v.f);s.Object.prototype.objectCaching=!1;const b=y(this.$vApp.$pinia),c={};this.fcFabric=new s.StaticCanvas(o,{backgroundColor:"#fff"}),this.fcFabricDownload=new s.StaticCanvas(null,{backgroundColor:"#fff"}),this.options.runningHeight=0;const r=b.componentSelectedState,_=this.getSubFixture("export-title"),a=this.getSubFixture("export-map"),t=this.getSubFixture("export-scalebar"),e=this.getSubFixture("export-northarrow"),d=this.getSubFixture("export-legend"),i=this.getSubFixture("export-footnote"),l=this.getSubFixture("export-timestamp");let f,h,g,m,x,p,F;if(r.title&&_&&(f=await _.make({top:this.options.runningHeight,left:0,originX:"left",width:n,textAlign:"center"}),this.options.runningHeight+=f.height+40,c.title=f),r.map&&a&&(h=await a.make({top:this.options.runningHeight}),f&&(f.left=h.width/2,f.originX="center"),this.options.runningHeight+=h.height+40,c.map=h),!h&&f&&(f.width=A),this.options.scale=n/((h?.width??A)+u.LEFT+u.RIGHT),r.mapElements&&t&&(g=await t.make({top:this.options.runningHeight,left:0}),this.options.runningHeight+=g.height+40,c.scaleBar=g,e&&(m=await e.make({top:g.top,left:n/this.options.scale}),m.top+=m.height/2-20,m.left+=-m.width*2,c.northArrow=m)),r.legend&&d&&(x=await d.make({width:d.config?.columnWidth??h?.width??A}),x.top=this.options.runningHeight,this.options.runningHeight+=x.height,c.legend=x),r.timestamp&&l&&(F=await l.make({top:this.options.runningHeight+40,width:n*1.5}),this.options.runningHeight+=!r.footnote||!i?F.height+40:F.height+20,c.timestamp=F),r.footnote&&i&&(p=await i.make({top:this.options.runningHeight-2.5,left:n/this.options.scale+40}),r.timestamp&&l?n-c.timestamp.getMinWidth()<=p.getMinWidth()+30?(p.top+=30,p.left=0,p.originX="left",this.options.runningHeight+=20):p.left+=-p.width*2:(p.top+=20,p.left+=-p.width*2,this.options.runningHeight+=20),this.options.runningHeight+=p.height,c.footnote=p),this.customRendererFunc){this.fcFabric.setWidth(n);const v={panelWidth:n,margin:u,defaultWidth:A,fabric:s};await this.customRendererFunc(this.fcFabric,c,v),this.fcFabric.renderAll(),this.fcFabric.clone(E=>{this.fcFabricDownload=E,this.fcFabricDownload.setDimensions({width:this.fcFabric?.getWidth(),height:this.fcFabric.getHeight()}),this.fcFabricDownload.renderAll()})}else{const v=new s.Group(Object.values(c),{top:u.TOP*this.options.scale,left:u.LEFT*this.options.scale}),E=await new Promise(O=>{v.clone(L=>{O(L)})});E.top=u.TOP,E.left=u.LEFT,this.fcFabricDownload.add(E),v.scale(this.options.scale),this.fcFabric.add(v),this.fcFabric.setDimensions({width:n,height:(this.options.runningHeight+u.TOP+u.BOTTOM)*this.options.scale}),this.fcFabric.renderAll(),this.fcFabricDownload.setDimensions({width:(h?.width??A)+u.LEFT+u.RIGHT,height:this.options.runningHeight+u.TOP+u.BOTTOM}),this.fcFabricDownload.renderAll()}}export(){if(!this.fcFabric)return;const o=new Date,n=this.config?.fileName||`map-carte - ${o.getFullYear()}-${o.getMonth()}-${o.getDay()}, ${o.getHours()}_${o.getMinutes()}`;N.saveAs(this.fcFabricDownload.toDataURL({format:"png",quality:1}),`${n}.png`)}}const W={en:{"export.title":"Export","export.alertName":"Export","export.download":"Download image","export.refresh":"Refresh","export.scaleBar.approx":"{0} approx.","export.menu":"Settings Menu","export.menu.component.title":"Title","export.menu.component.map":"Map","export.menu.component.mapElements":"North arrow and scalebar","export.menu.component.legend":"Legend","export.menu.component.footnote":"Footnote","export.menu.component.timestamp":"Timestamp"},fr:{"export.title":"Exporter","export.alertName":"Exporter","export.download":"Télécharger l'image","export.refresh":"Rafraîchir","export.scaleBar.approx":"Environ {0}","export.menu":"Menu des paramètres","export.menu.component.title":"Titre","export.menu.component.map":"Carte","export.menu.component.mapElements":"Flèche du nord et échelle graphique","export.menu.component.legend":"Légende","export.menu.component.footnote":"Référence","export.menu.component.timestamp":"Horodatage"}};class X extends U{initialized(){}async needed(){const o=(await w(async()=>{const{default:a}=await import("./index-DY4XJa1m-CinpT_5l.js");return{default:a}},__vite__mapDeps([5,0,1,2,3,4]),import.meta.url)).default,n=(await w(async()=>{const{default:a}=await import("./index--i98kM5n-wnGfY6-E.js");return{default:a}},__vite__mapDeps([6,0,1,2,3,4]),import.meta.url)).default,s=(await w(async()=>{const{default:a}=await import("./index-DLWeBByc-DDoUT1cR.js");return{default:a}},__vite__mapDeps([7,1,2,3,4,0]),import.meta.url)).default,b=(await w(async()=>{const{default:a}=await import("./index-98it_ulG-w2DJElWd.js");return{default:a}},__vite__mapDeps([8,0,1,2,3,4]),import.meta.url)).default,c=(await w(async()=>{const{default:a}=await import("./index-7blUq_oP-dtZV9W0P.js");return{default:a}},__vite__mapDeps([9,0,1,2,3,4]),import.meta.url)).default,r=(await w(async()=>{const{default:a}=await import("./index-B0lfXXMz-B4yTazBh.js");return{default:a}},__vite__mapDeps([10,0,1,2,3,4]),import.meta.url)).default,_=(await w(async()=>{const{default:a}=await import("./index-CWPzg1w2-Duz60wim.js");return{default:a}},__vite__mapDeps([11,0,1,2,3,4]),import.meta.url)).default;this.$iApi.fixture.add("export-title",o),this.$iApi.fixture.add("export-map",n),this.$iApi.fixture.add("export-legend",s),this.$iApi.fixture.add("export-northarrow",b),this.$iApi.fixture.add("export-scalebar",c),this.$iApi.fixture.add("export-timestamp",r),this.$iApi.fixture.add("export-footnote",_)}added(){this.$iApi.panel.register({id:"export",config:{screens:{"export-screen":M(B)},style:{"flex-grow":"1","max-width":"800px"},button:{tooltip:"export.title",icon:''},alertName:"export.alertName"}},{i18n:{messages:W}});const o=this.$iApi.event.on(S.PANEL_OPENED,async s=>{s.id==="export"&&(this.$iApi.event.off(o),await this.needed(),s.exportMake())});this._parseConfig(this.config);const n=this.$vApp.$watch(()=>this.config,s=>this._parseConfig(s));this.removed=()=>{n(),this.$iApi.fixture.get("export-title")?.remove(),this.$iApi.fixture.get("export-map")?.remove(),this.$iApi.fixture.get("export-legend")?.remove(),this.$iApi.fixture.get("export-northarrow")?.remove(),this.$iApi.fixture.get("export-scalebar")?.remove(),this.$iApi.fixture.get("export-timestamp")?.remove(),this.$iApi.fixture.get("export-footnote")?.remove(),this.$iApi.fixture.exists("appbar")&&k(this.$vApp.$pinia).removeButton("export"),y(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("export")}}}export{X as default}; diff --git a/custom-toc-highlight/assets/index-Bo-4afBP-B5GWFE2k.js b/custom-toc-highlight/assets/index-Bo-4afBP-DBinFmis.js similarity index 99% rename from custom-toc-highlight/assets/index-Bo-4afBP-B5GWFE2k.js rename to custom-toc-highlight/assets/index-Bo-4afBP-DBinFmis.js index de394da9..89f4ae47 100644 --- a/custom-toc-highlight/assets/index-Bo-4afBP-B5GWFE2k.js +++ b/custom-toc-highlight/assets/index-Bo-4afBP-DBinFmis.js @@ -1 +1 @@ -import{eT as T,eU as F,eV as te,eW as S,eX as W,eY as V,eZ as q,e_ as G,e$ as l,f0 as k,f1 as X,f2 as A,f3 as E,f4 as O,f5 as L,f6 as I,f7 as ae,f8 as J,f9 as Q,fa as N,fb as g,fc as P,fd as ee,fe as ne,ff as ie,fg as se,fh as oe,fi as le,fj as re,fk as R,fl as x,fm as M,fn as K,fo as U,fp as pe,fq as ue,fr as ce,fs as j,ft as de}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";class D{id;options;componentId;constructor(a){const r={options:{},...a};({id:this.id,options:this.options,componentId:this.componentId}=r)}}const fe=["innerHTML"],H=T({__name:"default-button",props:{panelId:{type:String,required:!0},minimize:{type:Boolean,default:!1},overflow:{type:Boolean}},setup(v){const{t:a}=W(),r=V("iApi"),n=v,d=q(()=>r?.panel.get(n.panelId)?.button),o=()=>{n.minimize?r?.panel.toggleMinimize(n.panelId):r?.panel.toggle(n.panelId)};return(e,y)=>{const p=G("appbar-button");return d.value?(l(),k(p,{key:0,onClickFunction:o,tooltip:O(a)(d.value.tooltip),id:v.panelId},{default:X(()=>[A("div",{class:E(["default fill-current w-24 h-24 ml-8 sm:ml-20",{"ml-20":v.overflow}]),innerHTML:d.value.icon},null,10,fe)]),_:1},8,["tooltip","id"])):L("",!0)}}}),me={},ve={class:"border-b p-0 self-center w-2/3"};function he(v,a){return l(),g("span",ve)}const Y=F(me,[["render",he],["__scopeId","data-v-5d32b715"]]);var ge={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(v){var a=v.state,r=v.name,n=v.options,d=de(a,n),o=a.modifiersData.preventOverflow||{x:0,y:0},e=o.x,y=o.y,p=a.rects.popper,u=p.width,h=p.height,z=a.placement.split("-"),w=z[0],_=w==="left"?"left":"right",m=w==="top"?"top":"bottom";a.modifiersData[r]={width:u-d[_]-e,height:h-d[m]-y}}};const be=["content","aria-label"],$e=T({__name:"more-button",props:{position:{type:String,default:"right-end"},popperOptions:{type:Object,default(){return{}}},numItems:{type:Number,default:1},renderWatch:{type:Number,default:0}},emits:["updateParent"],setup(v,{expose:a,emit:r}){const{t:n}=W(),d=V("iApi"),o=v,e=r;function y(){e("updateParent")}const p=I(!1),u=I(0),h=I(),z=I(),w=I();function _(){y(),R(()=>{m(),p.value=!p.value})}ae(()=>o.renderWatch,()=>{_()});const m=()=>{p.value=!p.value;const c=d.$vApp.$el.querySelector(".inner-shell"),b={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:f}){const{width:i}=f.modifiersData.maxSize;f.styles.popper={...f.styles.popper,maxWidth:`${i}px`,maxHeight:`${c.offsetHeight-45}px`};const $=Math.min(o.numItems<=0?0:55+44*(o.numItems-1),c.offsetHeight-45);f.styles.popper.height=`${$}px`,w?.value?.offsetHeight&&(w.value.style.height=`${$}px`),f.styles.popper.overflowY="auto",f.styles.popper.overflowX="hidden"}};z.value&&w.value&&(u.value++,ce(z.value,w.value,{placement:o.position||"right-end",modifiers:[{...ge,options:{boundary:c}},b,{name:"offset",options:{offset:[0,5]}},{name:"preventOverflow",enabled:!0,options:{boundary:c}}],...o.popperOptions})),u.value===1&&_()};return J(()=>{window.addEventListener("click",c=>{c.target instanceof HTMLElement&&!h.value?.contains(c.target)&&(p.value=!1)},{capture:!0})}),Q(()=>{window.removeEventListener("click",c=>{c.target instanceof HTMLElement&&!h.value?.contains(c.target)&&(p.value=!1)},{capture:!0})}),a({rerender:_}),(c,b)=>{const f=N("focus-item"),i=N("tippy");return l(),g("div",{class:"appbar-item relative inset-x-0 w-full text-center",ref_key:"el",ref:h},[P((l(),g("button",{type:"button",class:"text-gray-400 w-full h-48 focus:outline-none hover:text-white",onClick:b[0]||(b[0]=$=>m()),content:O(n)("appbar.more"),"aria-label":O(n)("appbar.more"),ref_key:"dropdownTrigger",ref:z},b[1]||(b[1]=[A("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M0 0h24v24H0z",fill:"none"}),A("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})],-1)]),8,be)),[[f],[i,{placement:"right-end"}]]),P(A("div",{id:"dropdown",class:"dropdown shadow-md border border-gray:200 absolute w-64 flex flex-col bg-white rounded",ref_key:"dropdown",ref:w},[ne(c.$slots,"default",{},void 0,!0)],512),[[ee,p.value]])],512)}}}),ye=F($e,[["__scopeId","data-v-93661050"]]),we={key:0,class:"number absolute top-1 right-2 text-white w-18 rounded-full"},xe=T({__name:"appbar-button",setup(v){const a=ie(),{t:r}=W(),n=V("iApi"),d=q(()=>a.notificationNumber),o=()=>{n.panel.toggle("notifications")};return(e,y)=>{const p=G("appbar-button",!0);return l(),k(p,{onClickFunction:o,tooltip:O(r)("notifications.title"),class:"notification-button",id:""},{default:X(()=>[y[0]||(y[0]=A("svg",{class:"fill-current w-24 h-24 mx-8 sm:mx-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})],-1)),d.value&&d.value>0?(l(),g("span",we,se(d.value),1)):L("",!0)]),_:1},8,["tooltip"])}}}),ke=F(xe,[["__scopeId","data-v-787da765"]]),Ie=["content"],Ee=T({__name:"appbar",setup(v){const a=oe(),r=S(),n=I(0),d=I(0),o=q(()=>r.visible),e=q(()=>r.temporary),{t:y}=W(),p=I(!1),u=I({}),h=I(),z=()=>{R(()=>{j()?.proxy?.$forceUpdate()})},w=()=>{h.value._tippy.hide()},_=m=>{m.key==="Tab"&&h.value?.matches(":focus")&&h.value._tippy.show()};return J(()=>{h.value?.addEventListener("blur",w),h.value?.addEventListener("keyup",_)}),le(()=>{const m=j();window.addEventListener("resize",()=>m?.proxy?.$forceUpdate())}),Q(()=>{const m=j();window.removeEventListener("resize",()=>m?.proxy?.$forceUpdate()),h.value?.removeEventListener("blur",w),h.value?.removeEventListener("keyup",_)}),re(()=>{R(()=>{const m=h.value;let c,b=[...m.children],f=b[b.length-2].getBoundingClientRect().top;a.mobileView||(f=m.getBoundingClientRect().bottom-38);let i=m.querySelector("#dropdown");for(let s=b.length-4;s>=0;s--){let C=b[s].getBoundingClientRect().bottom;if(f&&i&&(C>f||p.value&&C+56>f))b[s].classList.forEach(B=>{B.includes("identifier")&&(c=B.slice(11))}),c&&(u.value[c]=!0,c.includes("divider")||n.value++,d.value++),p.value||(p.value=!0);else if(C!==0)break}let $=m.querySelector("#more"),t=$.getBoundingClientRect().bottom;if(c=void 0,p.value&&f&&$&&i&&t!==0&&(t<=f-56||i.childElementCount==1&&t<=f)){let s=i.childElementCount,C=0;for(;t<=f-56||s==1;){let B=i.children[C];if(B&&(B.classList.forEach(Z=>{Z.includes("identifier")&&(c=Z.slice(11))}),c&&(u.value[c]=!1,c.includes("divider")||n.value--),t+=48,s-=1,C+=1),s===0){p.value=!1;break}}}Object.keys(u.value).forEach(s=>{m.querySelector(`.identifier-${s}`)||(delete u.value[s],s.includes("divider")||(n.value=Math.max(0,n.value-1)),d.value++)})})}),(m,c)=>{const b=N("focus-list"),f=N("tippy");return P((l(),g("div",{class:"absolute top-0 left-0 bottom-28 flex flex-col w-40 pointer-events-auto appbar z-50 sm:z-20 bg-black-75 sm:w-64 sm:bottom-38",content:O(y)("panels.controls.items"),ref_key:"el",ref:h},[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,null,[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&u.value[`${t}-${s}`]!==!0?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:E(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["panelId","class"])):u.value[`${t}-${s}`]!==!0?(l(),k(K(t.componentId),{key:`${t}-${s}-custom`,options:t.options,class:E(["appbar-item h-48",`identifier-${t}-${s}`]),id:t.id},null,8,["options","id","class"])):L("",!0)],64))),256)),u.value[`divider-${$}`]!==!0?(l(),k(Y,{class:E(["appbar-item",`identifier-divider-${$}`]),key:`${i}-${$}-default`},null,8,["class"])):L("",!0)],64))),256)),(l(!0),g(x,null,M(e.value?.filter(i=>u.value[`${i}-temp`]!==!0),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:E([`identifier-${i}-temp`,"appbar-item h-48"])},null,8,["panelId","class"]))),128)),P(U(ye,{id:"more",numItems:n.value,renderWatch:d.value,onUpdateParent:z},{default:X(()=>[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,{key:$},[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&u.value[`${t}-${s}`]?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:E(["text-black hover:bg-gray my-4 h-36",`identifier-${t}-${s}`]),overflow:""},null,8,["panelId","class"])):u.value[`${t}-${s}`]?(l(),k(K(t.componentId),{key:`${t}-${s}-custom`,options:t.options,id:t.id,class:E(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["options","id","class"])):L("",!0)],64))),256)),u.value[`divider-${$}`]?(l(),k(Y,{key:0,class:E(["border-black my-4",`identifier-divider-${$}`])},null,8,["class"])):L("",!0)],64))),128)),(l(!0),g(x,null,M(e.value?.filter(i=>u.value[`${i}-temp`]),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:E([`identifier-${i}-temp`,"text-black hover:bg-gray my-4 h-36"]),overflow:""},null,8,["panelId","class"]))),128))]),_:1},8,["numItems","renderWatch"]),[[ee,p.value]]),U(ke,{class:"appbar-item bottom-48 h-48 sm:display-none"}),U(pe,{class:"absolute bottom-0 h-40 sm:display-none w-full text-center",position:"right-start"})],8,Ie)),[[b],[f,{trigger:"manual",touch:!1,placement:"top-end",popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}});class _e extends ue{get config(){return super.config}_parseConfig(a){if(!a)return;const r=S(this.$vApp.$pinia);let n;Array.isArray(a.items[0])?n=a.items:n=[a.items];const d=[];n.forEach(o=>{d.push(o.map(e=>typeof e=="string"?e:new D(e)))}),r.items=d.flat().reduce((o,e)=>(o[e instanceof D?e.id:e]=e,o),{}),r.order=d.map(o=>o.map(e=>e instanceof D?e.id:e)),this._validateItems()}_validateItems(){const a=S(this.$vApp.$pinia);a.order.flat().forEach(r=>{typeof a.items[r]!="string"&&[r].some(n=>{this.$iApi.fixture.exists(n)&&!a.items[r]&&(a.items[r].componentId=`${n}-appbar-button`)})})}}const ze={en:{"appbar.navigation":"Navigation","appbar.more":"More","navigation.export":"Export","navigation.map.export":"Export Map"},fr:{"appbar.navigation":"Navigation","appbar.more":"Plus","navigation.export":"Exporter","navigation.map.export":"Exporter la Carte"}};class Me extends _e{initialized(){}async added(){Object.entries(ze).forEach(e=>this.$iApi.$i18n.mergeLocaleMessage(...e));const{destroy:a,el:r}=this.mount(Ee,{app:this.$element}),n=this.$vApp.$el.getElementsByClassName("inner-shell")[0];n.insertBefore(r.childNodes[0],n.querySelector(".panel-stack")),this._parseConfig(this.config);const d=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e)),o=[];o.push(this.$iApi.event.on(te.COMPONENT,()=>{this._parseConfig(this.config)})),this.removed=()=>{const e=S(this.$vApp.$pinia);d(),o.forEach(u=>this.$iApi.event.off(u));const y={...e.items},p=[...e.temporary];Object.keys(y).forEach(u=>e.removeButton(u)),p.forEach(u=>e.removeButton(u)),a(),e.$reset()}}}export{Me as default}; +import{eT as T,eU as F,eV as te,eW as S,eX as W,eY as V,eZ as q,e_ as G,e$ as l,f0 as k,f1 as X,f2 as A,f3 as E,f4 as O,f5 as L,f6 as I,f7 as ae,f8 as J,f9 as Q,fa as N,fb as g,fc as P,fd as ee,fe as ne,ff as ie,fg as se,fh as oe,fi as le,fj as re,fk as R,fl as x,fm as M,fn as K,fo as U,fp as pe,fq as ue,fr as ce,fs as j,ft as de}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";class D{id;options;componentId;constructor(a){const r={options:{},...a};({id:this.id,options:this.options,componentId:this.componentId}=r)}}const fe=["innerHTML"],H=T({__name:"default-button",props:{panelId:{type:String,required:!0},minimize:{type:Boolean,default:!1},overflow:{type:Boolean}},setup(v){const{t:a}=W(),r=V("iApi"),n=v,d=q(()=>r?.panel.get(n.panelId)?.button),o=()=>{n.minimize?r?.panel.toggleMinimize(n.panelId):r?.panel.toggle(n.panelId)};return(e,y)=>{const p=G("appbar-button");return d.value?(l(),k(p,{key:0,onClickFunction:o,tooltip:O(a)(d.value.tooltip),id:v.panelId},{default:X(()=>[A("div",{class:E(["default fill-current w-24 h-24 ml-8 sm:ml-20",{"ml-20":v.overflow}]),innerHTML:d.value.icon},null,10,fe)]),_:1},8,["tooltip","id"])):L("",!0)}}}),me={},ve={class:"border-b p-0 self-center w-2/3"};function he(v,a){return l(),g("span",ve)}const Y=F(me,[["render",he],["__scopeId","data-v-5d32b715"]]);var ge={name:"maxSize",enabled:!0,phase:"main",requiresIfExists:["offset","preventOverflow","flip"],fn:function(v){var a=v.state,r=v.name,n=v.options,d=de(a,n),o=a.modifiersData.preventOverflow||{x:0,y:0},e=o.x,y=o.y,p=a.rects.popper,u=p.width,h=p.height,z=a.placement.split("-"),w=z[0],_=w==="left"?"left":"right",m=w==="top"?"top":"bottom";a.modifiersData[r]={width:u-d[_]-e,height:h-d[m]-y}}};const be=["content","aria-label"],$e=T({__name:"more-button",props:{position:{type:String,default:"right-end"},popperOptions:{type:Object,default(){return{}}},numItems:{type:Number,default:1},renderWatch:{type:Number,default:0}},emits:["updateParent"],setup(v,{expose:a,emit:r}){const{t:n}=W(),d=V("iApi"),o=v,e=r;function y(){e("updateParent")}const p=I(!1),u=I(0),h=I(),z=I(),w=I();function _(){y(),R(()=>{m(),p.value=!p.value})}ae(()=>o.renderWatch,()=>{_()});const m=()=>{p.value=!p.value;const c=d.$vApp.$el.querySelector(".inner-shell"),b={name:"applyMaxSize",enabled:!0,phase:"beforeWrite",requires:["maxSize"],fn({state:f}){const{width:i}=f.modifiersData.maxSize;f.styles.popper={...f.styles.popper,maxWidth:`${i}px`,maxHeight:`${c.offsetHeight-45}px`};const $=Math.min(o.numItems<=0?0:55+44*(o.numItems-1),c.offsetHeight-45);f.styles.popper.height=`${$}px`,w?.value?.offsetHeight&&(w.value.style.height=`${$}px`),f.styles.popper.overflowY="auto",f.styles.popper.overflowX="hidden"}};z.value&&w.value&&(u.value++,ce(z.value,w.value,{placement:o.position||"right-end",modifiers:[{...ge,options:{boundary:c}},b,{name:"offset",options:{offset:[0,5]}},{name:"preventOverflow",enabled:!0,options:{boundary:c}}],...o.popperOptions})),u.value===1&&_()};return J(()=>{window.addEventListener("click",c=>{c.target instanceof HTMLElement&&!h.value?.contains(c.target)&&(p.value=!1)},{capture:!0})}),Q(()=>{window.removeEventListener("click",c=>{c.target instanceof HTMLElement&&!h.value?.contains(c.target)&&(p.value=!1)},{capture:!0})}),a({rerender:_}),(c,b)=>{const f=N("focus-item"),i=N("tippy");return l(),g("div",{class:"appbar-item relative inset-x-0 w-full text-center",ref_key:"el",ref:h},[P((l(),g("button",{type:"button",class:"text-gray-400 w-full h-48 focus:outline-none hover:text-white",onClick:b[0]||(b[0]=$=>m()),content:O(n)("appbar.more"),"aria-label":O(n)("appbar.more"),ref_key:"dropdownTrigger",ref:z},b[1]||(b[1]=[A("svg",{class:"fill-current w-24 h-24 m-auto",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M0 0h24v24H0z",fill:"none"}),A("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})],-1)]),8,be)),[[f],[i,{placement:"right-end"}]]),P(A("div",{id:"dropdown",class:"dropdown shadow-md border border-gray:200 absolute w-64 flex flex-col bg-white rounded",ref_key:"dropdown",ref:w},[ne(c.$slots,"default",{},void 0,!0)],512),[[ee,p.value]])],512)}}}),ye=F($e,[["__scopeId","data-v-93661050"]]),we={key:0,class:"number absolute top-1 right-2 text-white w-18 rounded-full"},xe=T({__name:"appbar-button",setup(v){const a=ie(),{t:r}=W(),n=V("iApi"),d=q(()=>a.notificationNumber),o=()=>{n.panel.toggle("notifications")};return(e,y)=>{const p=G("appbar-button",!0);return l(),k(p,{onClickFunction:o,tooltip:O(r)("notifications.title"),class:"notification-button",id:""},{default:X(()=>[y[0]||(y[0]=A("svg",{class:"fill-current w-24 h-24 mx-8 sm:mx-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[A("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z"})],-1)),d.value&&d.value>0?(l(),g("span",we,se(d.value),1)):L("",!0)]),_:1},8,["tooltip"])}}}),ke=F(xe,[["__scopeId","data-v-787da765"]]),Ie=["content"],Ee=T({__name:"appbar",setup(v){const a=oe(),r=S(),n=I(0),d=I(0),o=q(()=>r.visible),e=q(()=>r.temporary),{t:y}=W(),p=I(!1),u=I({}),h=I(),z=()=>{R(()=>{j()?.proxy?.$forceUpdate()})},w=()=>{h.value._tippy.hide()},_=m=>{m.key==="Tab"&&h.value?.matches(":focus")&&h.value._tippy.show()};return J(()=>{h.value?.addEventListener("blur",w),h.value?.addEventListener("keyup",_)}),le(()=>{const m=j();window.addEventListener("resize",()=>m?.proxy?.$forceUpdate())}),Q(()=>{const m=j();window.removeEventListener("resize",()=>m?.proxy?.$forceUpdate()),h.value?.removeEventListener("blur",w),h.value?.removeEventListener("keyup",_)}),re(()=>{R(()=>{const m=h.value;let c,b=[...m.children],f=b[b.length-2].getBoundingClientRect().top;a.mobileView||(f=m.getBoundingClientRect().bottom-38);let i=m.querySelector("#dropdown");for(let s=b.length-4;s>=0;s--){let C=b[s].getBoundingClientRect().bottom;if(f&&i&&(C>f||p.value&&C+56>f))b[s].classList.forEach(B=>{B.includes("identifier")&&(c=B.slice(11))}),c&&(u.value[c]=!0,c.includes("divider")||n.value++,d.value++),p.value||(p.value=!0);else if(C!==0)break}let $=m.querySelector("#more"),t=$.getBoundingClientRect().bottom;if(c=void 0,p.value&&f&&$&&i&&t!==0&&(t<=f-56||i.childElementCount==1&&t<=f)){let s=i.childElementCount,C=0;for(;t<=f-56||s==1;){let B=i.children[C];if(B&&(B.classList.forEach(Z=>{Z.includes("identifier")&&(c=Z.slice(11))}),c&&(u.value[c]=!1,c.includes("divider")||n.value--),t+=48,s-=1,C+=1),s===0){p.value=!1;break}}}Object.keys(u.value).forEach(s=>{m.querySelector(`.identifier-${s}`)||(delete u.value[s],s.includes("divider")||(n.value=Math.max(0,n.value-1)),d.value++)})})}),(m,c)=>{const b=N("focus-list"),f=N("tippy");return P((l(),g("div",{class:"absolute top-0 left-0 bottom-28 flex flex-col w-40 pointer-events-auto appbar z-50 sm:z-20 bg-black-75 sm:w-64 sm:bottom-38",content:O(y)("panels.controls.items"),ref_key:"el",ref:h},[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,null,[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&u.value[`${t}-${s}`]!==!0?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:E(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["panelId","class"])):u.value[`${t}-${s}`]!==!0?(l(),k(K(t.componentId),{key:`${t}-${s}-custom`,options:t.options,class:E(["appbar-item h-48",`identifier-${t}-${s}`]),id:t.id},null,8,["options","id","class"])):L("",!0)],64))),256)),u.value[`divider-${$}`]!==!0?(l(),k(Y,{class:E(["appbar-item",`identifier-divider-${$}`]),key:`${i}-${$}-default`},null,8,["class"])):L("",!0)],64))),256)),(l(!0),g(x,null,M(e.value?.filter(i=>u.value[`${i}-temp`]!==!0),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:E([`identifier-${i}-temp`,"appbar-item h-48"])},null,8,["panelId","class"]))),128)),P(U(ye,{id:"more",numItems:n.value,renderWatch:d.value,onUpdateParent:z},{default:X(()=>[(l(!0),g(x,null,M(o.value,(i,$)=>(l(),g(x,{key:$},[(l(!0),g(x,null,M(i,(t,s)=>(l(),g(x,null,[typeof t=="string"&&u.value[`${t}-${s}`]?(l(),k(H,{key:`${t}-${s}-default`,panelId:t,class:E(["text-black hover:bg-gray my-4 h-36",`identifier-${t}-${s}`]),overflow:""},null,8,["panelId","class"])):u.value[`${t}-${s}`]?(l(),k(K(t.componentId),{key:`${t}-${s}-custom`,options:t.options,id:t.id,class:E(["appbar-item h-48",`identifier-${t}-${s}`])},null,8,["options","id","class"])):L("",!0)],64))),256)),u.value[`divider-${$}`]?(l(),k(Y,{key:0,class:E(["border-black my-4",`identifier-divider-${$}`])},null,8,["class"])):L("",!0)],64))),128)),(l(!0),g(x,null,M(e.value?.filter(i=>u.value[`${i}-temp`]),i=>(l(),k(H,{panelId:i,minimize:!0,key:`${i}-temp`,class:E([`identifier-${i}-temp`,"text-black hover:bg-gray my-4 h-36"]),overflow:""},null,8,["panelId","class"]))),128))]),_:1},8,["numItems","renderWatch"]),[[ee,p.value]]),U(ke,{class:"appbar-item bottom-48 h-48 sm:display-none"}),U(pe,{class:"absolute bottom-0 h-40 sm:display-none w-full text-center",position:"right-start"})],8,Ie)),[[b],[f,{trigger:"manual",touch:!1,placement:"top-end",popperOptions:{placement:"top",modifiers:[{name:"preventOverflow",options:{altAxis:!0}},{name:"flip",options:{fallbackPlacements:["top"]}}]}}]])}}});class _e extends ue{get config(){return super.config}_parseConfig(a){if(!a)return;const r=S(this.$vApp.$pinia);let n;Array.isArray(a.items[0])?n=a.items:n=[a.items];const d=[];n.forEach(o=>{d.push(o.map(e=>typeof e=="string"?e:new D(e)))}),r.items=d.flat().reduce((o,e)=>(o[e instanceof D?e.id:e]=e,o),{}),r.order=d.map(o=>o.map(e=>e instanceof D?e.id:e)),this._validateItems()}_validateItems(){const a=S(this.$vApp.$pinia);a.order.flat().forEach(r=>{typeof a.items[r]!="string"&&[r].some(n=>{this.$iApi.fixture.exists(n)&&!a.items[r]&&(a.items[r].componentId=`${n}-appbar-button`)})})}}const ze={en:{"appbar.navigation":"Navigation","appbar.more":"More","navigation.export":"Export","navigation.map.export":"Export Map"},fr:{"appbar.navigation":"Navigation","appbar.more":"Plus","navigation.export":"Exporter","navigation.map.export":"Exporter la Carte"}};class Me extends _e{initialized(){}async added(){Object.entries(ze).forEach(e=>this.$iApi.$i18n.mergeLocaleMessage(...e));const{destroy:a,el:r}=this.mount(Ee,{app:this.$element}),n=this.$vApp.$el.getElementsByClassName("inner-shell")[0];n.insertBefore(r.childNodes[0],n.querySelector(".panel-stack")),this._parseConfig(this.config);const d=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e)),o=[];o.push(this.$iApi.event.on(te.COMPONENT,()=>{this._parseConfig(this.config)})),this.removed=()=>{const e=S(this.$vApp.$pinia);d(),o.forEach(u=>this.$iApi.event.off(u));const y={...e.items},p=[...e.temporary];Object.keys(y).forEach(u=>e.removeButton(u)),p.forEach(u=>e.removeButton(u)),a(),e.$reset()}}}export{Me as default}; diff --git a/custom-toc-highlight/assets/index-CDhNyq-A-rV_P8aO5.js b/custom-toc-highlight/assets/index-CDhNyq-A-E2rRJpfZ.js similarity index 89% rename from custom-toc-highlight/assets/index-CDhNyq-A-rV_P8aO5.js rename to custom-toc-highlight/assets/index-CDhNyq-A-E2rRJpfZ.js index c89e0ff0..2cf9625f 100644 --- a/custom-toc-highlight/assets/index-CDhNyq-A-rV_P8aO5.js +++ b/custom-toc-highlight/assets/index-CDhNyq-A-E2rRJpfZ.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-oq2ZVtwf-pDGs-Ow3.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css"])))=>i.map(i=>d[i]); -import{_ as n}from"./main-ugzBrWNm.js";import{eT as l,fH as a,fu as h,eW as p,fw as g,fq as v,eX as f,eY as m,e_ as u,e$ as d,f0 as x,f1 as $,f2 as e,f4 as b}from"./story-BfX8CRfG.js";class w extends v{}const A=l({__name:"nav-button",setup(s){const{t}=f(),o=m("iApi"),i=()=>{o?.panel.toggle("geosearch")};return(E,r)=>{const c=u("mapnav-button");return d(),x(c,{onClickFunction:i,tooltip:b(t)("geosearch.title")},{default:$(()=>r[0]||(r[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),e("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["tooltip"])}}}),_={en:{"geosearch.title":"Geolocation Search","geosearch.noResults":"No results to show for ","geosearch.searchText":"Search for a location...","geosearch.visible":"Visible on map","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Clear filters","geosearch.serviceError":"No response from {services} service(s)","geosearch.badChars":"The character(s) {chars} are not supported and will be ignored"},fr:{"geosearch.title":"Recherche géolocalisée","geosearch.noResults":"Aucun résultat à afficher pour ","geosearch.searchText":"Rechercher un emplacement...","geosearch.visible":"Visible sur la carte","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Effacer les filtres","geosearch.serviceError":"Pas de réponse de la part des services de {services}","geosearch.badChars":"Les caractères {chars} ne sont pas pris en charge et seront ignorés"}};class S extends w{async added(){a(this.$vApp.$pinia).initService(this.$iApi.language,this.config),this.$iApi.component("geosearch-nav-button",A),this.$iApi.panel.register({id:"geosearch",config:{screens:{"geosearch-component":()=>h(n(()=>import("./screen-oq2ZVtwf-pDGs-Ow3.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},button:{tooltip:"geosearch.title",icon:''},alertName:"geosearch.title"}},{i18n:{messages:_}}),this.handlePanelTeleports(["geosearch"])}removed(){this.$iApi.fixture.exists("appbar")&&p(this.$vApp.$pinia).removeButton("geosearch"),this.$iApi.fixture.exists("mapnav")&&g(this.$vApp.$pinia).removeItem("geosearch"),a(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("geosearch")}}export{S as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-oq2ZVtwf-B7xZh-jW.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css"])))=>i.map(i=>d[i]); +import{_ as n}from"./main-QGPoLsvl.js";import{eT as l,fH as a,fu as h,eW as p,fw as g,fq as v,eX as f,eY as m,e_ as u,e$ as d,f0 as x,f1 as $,f2 as e,f4 as b}from"./story-Doly9N9p.js";class w extends v{}const A=l({__name:"nav-button",setup(s){const{t}=f(),o=m("iApi"),i=()=>{o?.panel.toggle("geosearch")};return(E,r)=>{const c=u("mapnav-button");return d(),x(c,{onClickFunction:i,tooltip:b(t)("geosearch.title")},{default:$(()=>r[0]||(r[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),e("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["tooltip"])}}}),_={en:{"geosearch.title":"Geolocation Search","geosearch.noResults":"No results to show for ","geosearch.searchText":"Search for a location...","geosearch.visible":"Visible on map","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Clear filters","geosearch.serviceError":"No response from {services} service(s)","geosearch.badChars":"The character(s) {chars} are not supported and will be ignored"},fr:{"geosearch.title":"Recherche géolocalisée","geosearch.noResults":"Aucun résultat à afficher pour ","geosearch.searchText":"Rechercher un emplacement...","geosearch.visible":"Visible sur la carte","geosearch.filters.province":"Province","geosearch.filters.type":"Type","geosearch.filters.clear":"Effacer les filtres","geosearch.serviceError":"Pas de réponse de la part des services de {services}","geosearch.badChars":"Les caractères {chars} ne sont pas pris en charge et seront ignorés"}};class S extends w{async added(){a(this.$vApp.$pinia).initService(this.$iApi.language,this.config),this.$iApi.component("geosearch-nav-button",A),this.$iApi.panel.register({id:"geosearch",config:{screens:{"geosearch-component":()=>h(n(()=>import("./screen-oq2ZVtwf-B7xZh-jW.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},button:{tooltip:"geosearch.title",icon:''},alertName:"geosearch.title"}},{i18n:{messages:_}}),this.handlePanelTeleports(["geosearch"])}removed(){this.$iApi.fixture.exists("appbar")&&p(this.$vApp.$pinia).removeButton("geosearch"),this.$iApi.fixture.exists("mapnav")&&g(this.$vApp.$pinia).removeItem("geosearch"),a(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("geosearch")}}export{S as default}; diff --git a/custom-toc-highlight/assets/index-CMEOtVDx-ChyOSGzz.js b/custom-toc-highlight/assets/index-CMEOtVDx-BTZ-Taoh.js similarity index 91% rename from custom-toc-highlight/assets/index-CMEOtVDx-ChyOSGzz.js rename to custom-toc-highlight/assets/index-CMEOtVDx-BTZ-Taoh.js index 64f7b851..084c99b6 100644 --- a/custom-toc-highlight/assets/index-CMEOtVDx-ChyOSGzz.js +++ b/custom-toc-highlight/assets/index-CMEOtVDx-BTZ-Taoh.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-D-fcMt_1-CqBjqxx_.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); -import{_ as s}from"./main-ugzBrWNm.js";import{fu as o,eW as d,fW as i,fq as l}from"./story-BfX8CRfG.js";class m extends l{toggleMetadata(a,e){const t=this.$iApi.panel.get("metadata");if(e===!1){t.close();return}!t.isOpen||!t.isVisible?this.$iApi.panel.open({id:"metadata",props:{payload:a}}):t.route.props.payload.layer.uid!==a?.layer?.uid||e?t.show({screen:"metadata-screen-content",props:{payload:a}}):t.close()}}const n={en:{"metadata.title":"Metadata","metadata.loading":"Loading...","metadata.error":"There was an error retrieving this resource. Please try again.","metadata.label.no.layer":"No metadata to show because the layer has been removed","metadata.xslt.Abstract":"Abstract","metadata.xslt.Scope":"Scope","metadata.xslt.hereBeScope":"here be scope","metadata.xslt.timePeriod":"Time Period","metadata.xslt.supplementalData":"Supplemental Data","metadata.xslt.contactInfo":"Contact Information","metadata.xslt.resourceProvider":"Resource Provider","metadata.xslt.custodian":"Custodian","metadata.xslt.owner":"Owner","metadata.xslt.user":"User","metadata.xslt.distributor":"Distributor","metadata.xslt.originator":"Originator","metadata.xslt.pointOfContact":"Point of Contact","metadata.xslt.principalInvestigator":"Principal Investigator","metadata.xslt.processor":"Processor","metadata.xslt.publisher":"Publisher","metadata.xslt.author":"Author","metadata.xslt.collaborator":"Collaborator","metadata.xslt.editor":"Editor","metadata.xslt.mediator":"Mediator","metadata.xslt.rightsHolder":"Rights Holder","metadata.xslt.cataloguePage":"Data Catalogue Page","metadata.xslt.metadataPage":"Raw Metadata","metadata.xslt.metadata":"Metadata"},fr:{"metadata.title":"Métadonnées","metadata.loading":"Chargement en cours...","metadata.error":"Une erreur s'est produite lors du chargement de cette ressource. Veuillez essayer de nouveau.","metadata.label.no.layer":"Aucune métadonnée à afficher","metadata.xslt.Abstract":"Résumé","metadata.xslt.Scope":"Portée","metadata.xslt.hereBeScope":"la portée jusqu'ici","metadata.xslt.timePeriod":"Période","metadata.xslt.supplementalData":"Données supplémentaires","metadata.xslt.contactInfo":"Coordonnées","metadata.xslt.resourceProvider":"Fournisseur de la ressource","metadata.xslt.custodian":"Dépositaire","metadata.xslt.owner":"Propriétaire","metadata.xslt.user":"Utilisateur","metadata.xslt.distributor":"Distributeur","metadata.xslt.originator":"Auteur","metadata.xslt.pointOfContact":"Point de contact","metadata.xslt.principalInvestigator":"Chercheur principal","metadata.xslt.processor":"Préparateur","metadata.xslt.publisher":"Éditeur","metadata.xslt.author":"Auteur","metadata.xslt.collaborator":"Collaborateur","metadata.xslt.editor":"Éditeur","metadata.xslt.mediator":"Médiateur","metadata.xslt.rightsHolder":"Titulaire des droits","metadata.xslt.cataloguePage":"Page des données du catalogue","metadata.xslt.metadataPage":"Métadonnées brutes","metadata.xslt.metadata":"Métadonnées"}};class u extends m{async added(){this.$iApi.panel.register({metadata:{screens:{"metadata-screen-content":()=>o(s(()=>import("./screen-D-fcMt_1-CqBjqxx_.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"350px"},button:{tooltip:"metadata.title",icon:''},alertName:"metadata.title"}},{i18n:{messages:n}}),this.handlePanelTeleports(["metadata"]),this.removed=()=>{this.$iApi.fixture.exists("appbar")&&d(this.$vApp.$pinia).removeButton("metadata"),i(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("metadata")}}}export{u as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-D-fcMt_1-D3QyEveF.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./marked.esm-DgqJBp_S-CCvGNfAT.js"])))=>i.map(i=>d[i]); +import{_ as s}from"./main-QGPoLsvl.js";import{fu as o,eW as d,fW as i,fq as l}from"./story-Doly9N9p.js";class m extends l{toggleMetadata(a,e){const t=this.$iApi.panel.get("metadata");if(e===!1){t.close();return}!t.isOpen||!t.isVisible?this.$iApi.panel.open({id:"metadata",props:{payload:a}}):t.route.props.payload.layer.uid!==a?.layer?.uid||e?t.show({screen:"metadata-screen-content",props:{payload:a}}):t.close()}}const n={en:{"metadata.title":"Metadata","metadata.loading":"Loading...","metadata.error":"There was an error retrieving this resource. Please try again.","metadata.label.no.layer":"No metadata to show because the layer has been removed","metadata.xslt.Abstract":"Abstract","metadata.xslt.Scope":"Scope","metadata.xslt.hereBeScope":"here be scope","metadata.xslt.timePeriod":"Time Period","metadata.xslt.supplementalData":"Supplemental Data","metadata.xslt.contactInfo":"Contact Information","metadata.xslt.resourceProvider":"Resource Provider","metadata.xslt.custodian":"Custodian","metadata.xslt.owner":"Owner","metadata.xslt.user":"User","metadata.xslt.distributor":"Distributor","metadata.xslt.originator":"Originator","metadata.xslt.pointOfContact":"Point of Contact","metadata.xslt.principalInvestigator":"Principal Investigator","metadata.xslt.processor":"Processor","metadata.xslt.publisher":"Publisher","metadata.xslt.author":"Author","metadata.xslt.collaborator":"Collaborator","metadata.xslt.editor":"Editor","metadata.xslt.mediator":"Mediator","metadata.xslt.rightsHolder":"Rights Holder","metadata.xslt.cataloguePage":"Data Catalogue Page","metadata.xslt.metadataPage":"Raw Metadata","metadata.xslt.metadata":"Metadata"},fr:{"metadata.title":"Métadonnées","metadata.loading":"Chargement en cours...","metadata.error":"Une erreur s'est produite lors du chargement de cette ressource. Veuillez essayer de nouveau.","metadata.label.no.layer":"Aucune métadonnée à afficher","metadata.xslt.Abstract":"Résumé","metadata.xslt.Scope":"Portée","metadata.xslt.hereBeScope":"la portée jusqu'ici","metadata.xslt.timePeriod":"Période","metadata.xslt.supplementalData":"Données supplémentaires","metadata.xslt.contactInfo":"Coordonnées","metadata.xslt.resourceProvider":"Fournisseur de la ressource","metadata.xslt.custodian":"Dépositaire","metadata.xslt.owner":"Propriétaire","metadata.xslt.user":"Utilisateur","metadata.xslt.distributor":"Distributeur","metadata.xslt.originator":"Auteur","metadata.xslt.pointOfContact":"Point de contact","metadata.xslt.principalInvestigator":"Chercheur principal","metadata.xslt.processor":"Préparateur","metadata.xslt.publisher":"Éditeur","metadata.xslt.author":"Auteur","metadata.xslt.collaborator":"Collaborateur","metadata.xslt.editor":"Éditeur","metadata.xslt.mediator":"Médiateur","metadata.xslt.rightsHolder":"Titulaire des droits","metadata.xslt.cataloguePage":"Page des données du catalogue","metadata.xslt.metadataPage":"Métadonnées brutes","metadata.xslt.metadata":"Métadonnées"}};class u extends m{async added(){this.$iApi.panel.register({metadata:{screens:{"metadata-screen-content":()=>o(s(()=>import("./screen-D-fcMt_1-D3QyEveF.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"350px"},button:{tooltip:"metadata.title",icon:''},alertName:"metadata.title"}},{i18n:{messages:n}}),this.handlePanelTeleports(["metadata"]),this.removed=()=>{this.$iApi.fixture.exists("appbar")&&d(this.$vApp.$pinia).removeButton("metadata"),i(this.$vApp.$pinia).$reset(),this.$iApi.panel.remove("metadata")}}}export{u as default}; diff --git a/custom-toc-highlight/assets/index-CRabsHaP-D1Fjorzw.js b/custom-toc-highlight/assets/index-CRabsHaP-BfTKXoCA.js similarity index 96% rename from custom-toc-highlight/assets/index-CRabsHaP-D1Fjorzw.js rename to custom-toc-highlight/assets/index-CRabsHaP-BfTKXoCA.js index 23dae2cd..df979827 100644 --- a/custom-toc-highlight/assets/index-CRabsHaP-D1Fjorzw.js +++ b/custom-toc-highlight/assets/index-CRabsHaP-BfTKXoCA.js @@ -1 +1 @@ -import{fq as f,fK as y,fL as m,fM as u,eV as l,fN as w,fO as A,fP as L}from"./story-BfX8CRfG.js";import{a as h,t as $,l as n,s as c}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";import"./main-ugzBrWNm.js";class d extends m{config={};mode=h.NONE;constructor(i,e){super(e),this.config=i,this.mode=i.mode}async add(i){this.notImplementedError("addGraphics")}async remove(i){this.notImplementedError("removeGraphics")}async reloadHilight(i){this.notImplementedError("reloadHilight")}async getHilightLayer(){const i=await this.layerFetcher();if(i){if(i.isLoaded&&i instanceof u)return i;console.warn("Hilight layer exists but is in bad form.");return}else{console.warn("Hilight layer could not be fetched.");return}}notImplementedError(i){console.warn(`Hilight mode method ${i} was not implemented by subclass.`)}layerFetcher(){const i=this.$iApi.geo.layer.getLayer(n);return i?Promise.resolve(i):new Promise(e=>{let t=0;const s=setInterval(()=>{const a=this.$iApi.geo.layer.getLayer(n);if(a)clearInterval(s),e(a);else if(t+=125,t>=1125){clearInterval(s),e(void 0);return}},125)})}}class g extends d{async add(i){const e=await this.getHilightLayer();e&&await e.addGraphic(i)}async remove(i){const e=await this.getHilightLayer();e&&e.removeGraphic(i)}async reloadHilight(i){await this.remove(i),await this.add(i)}}class v extends g{handlers=[];onOpacity;offOpacity;lastAdd=0;constructor(i,e){super(i,e),this.onOpacity=i.options?.onOpacity??.75,this.offOpacity=i.options?.offOpacity>.02?i.options.offOpacity:.02,this.$iApi.geo.map.created?this.hilightSetup():this.handlers.push(this.$iApi.event.on(l.MAP_CREATED,()=>{this.hilightSetup()})),this.handlers.push(this.$iApi.event.on(l.MAP_BASEMAPCHANGE,()=>{this.getHilightLayer().then(t=>{t&&t.graphics.length===0&&this.updateFogLayer()})}))}async hilightSetup(){const i=w(this.$vApp.$pinia).activeBasemapConfig;try{const e=this.$iApi.geo.layer.createLayer({id:c,layerType:y.TILE,cosmetic:!0,url:i.layers[0].url});await this.$iApi.geo.map.addLayer(e),e.opacity=this.offOpacity,await this.reorderFogLayer()}catch{console.error("Something went wrong while setting up the hilighter.")}}async updateFogLayer(){this.$iApi.geo.map.removeLayer(c),await this.hilightSetup()}async reorderFogLayer(){const i=this.getFogLayer(),e=await this.getHilightLayer();if(!e||!i)return;const t=this.$iApi.geo.layer.layerOrderIds(),s=t.indexOf(i.id),a=t.indexOf(e.id);a-1&&s>-1&&this.$iApi.geo.map.reorder(e,s,!1)}async add(i){this.lastAdd=Date.now();const e=this.getFogLayer();e&&(e.opacity=this.onOpacity,await super.add(i))}async remove(i){await super.remove(i);const e=this.getFogLayer();if(!e)return;const t=Date.now(),s=await this.getHilightLayer();s&&setTimeout(()=>{this.lastAdd{this.hilightSetup(i)}))}hilightSetup(i){this.$iApi.geo.map.viewPromise.then(()=>{this.$iApi.geo.map.esriView.highlightOptions=i.options})}async add(i){await super.add(i);const e=this.$iApi.geo.layer.getLayer(n);if(e&&e.esriLayer&&e.isLoaded&&e instanceof L){const t=i instanceof Array?i:[i];this.$iApi.geo.map.esriView?.whenLayerView(e.esriLayer)?.then(function(s){s.highlight(t.map(a=>e.getEsriGraphic(a.id)))})}}async remove(i){await super.remove(i)}}class H extends f{hilightMode=new d({},this.$iApi);initialized(){this.initHilightLayer()}_parseConfig(i){if(i)switch(i.mode){case h.NONE:this.hilightMode=new d(i,this.$iApi);break;case h.GLOW:this.hilightMode=new p(i,this.$iApi);break;case h.LIFT:this.hilightMode=new g(i,this.$iApi);break;case h.FOG:this.hilightMode=new v(i,this.$iApi);break;default:console.error("Could not find hilight mode:",i.mode);break}else this.hilightMode=new p($,this.$iApi)}async initHilightLayer(){const i=this.$iApi.geo.layer.createLayer({id:n,layerType:y.GRAPHIC,cosmetic:!0,url:""});await this.$iApi.geo.map.addLayer(i)}async addHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.add(e)}async removeHilight(i){const e=i?i instanceof Array?i:[i]:void 0;await this.hilightMode.remove(e)}async reloadHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.reloadHilight(e)}async getGraphicsByKey(i,e,t){const s=await this.getHilightLayer();if(!s)return[];let a=s.graphics.map(r=>({...this.deconstructGraphicKey(r.id),og:r}));return i&&(a=a.filter(r=>r.origin===i)),e&&(a=a.filter(r=>r.uid===e)),t&&(a=a.filter(r=>r.oid===t)),a.map(r=>r.og)}constructGraphicKey(i,e,t){return`${n}~${i}~${e}~${t}`}deconstructGraphicKey(i){const e=i.split("~");return e.length!==4&&console.warn("Malformed Hilight Graphic key provided:",i),{origin:e[1],uid:e[2],oid:parseInt(e[3])}}async getHilightLayer(){if(this.hilightMode)return await this.hilightMode.getHilightLayer();console.warn("API get layer request before highlight mode object exists")}}class F extends H{async added(){this._parseConfig(this.config);const i=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e));this.removed=()=>{i()}}}export{F as default}; +import{fq as f,fK as y,fL as m,fM as u,eV as l,fN as w,fO as A,fP as L}from"./story-Doly9N9p.js";import{a as h,t as $,l as n,s as c}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";import"./main-QGPoLsvl.js";class d extends m{config={};mode=h.NONE;constructor(i,e){super(e),this.config=i,this.mode=i.mode}async add(i){this.notImplementedError("addGraphics")}async remove(i){this.notImplementedError("removeGraphics")}async reloadHilight(i){this.notImplementedError("reloadHilight")}async getHilightLayer(){const i=await this.layerFetcher();if(i){if(i.isLoaded&&i instanceof u)return i;console.warn("Hilight layer exists but is in bad form.");return}else{console.warn("Hilight layer could not be fetched.");return}}notImplementedError(i){console.warn(`Hilight mode method ${i} was not implemented by subclass.`)}layerFetcher(){const i=this.$iApi.geo.layer.getLayer(n);return i?Promise.resolve(i):new Promise(e=>{let t=0;const s=setInterval(()=>{const a=this.$iApi.geo.layer.getLayer(n);if(a)clearInterval(s),e(a);else if(t+=125,t>=1125){clearInterval(s),e(void 0);return}},125)})}}class g extends d{async add(i){const e=await this.getHilightLayer();e&&await e.addGraphic(i)}async remove(i){const e=await this.getHilightLayer();e&&e.removeGraphic(i)}async reloadHilight(i){await this.remove(i),await this.add(i)}}class v extends g{handlers=[];onOpacity;offOpacity;lastAdd=0;constructor(i,e){super(i,e),this.onOpacity=i.options?.onOpacity??.75,this.offOpacity=i.options?.offOpacity>.02?i.options.offOpacity:.02,this.$iApi.geo.map.created?this.hilightSetup():this.handlers.push(this.$iApi.event.on(l.MAP_CREATED,()=>{this.hilightSetup()})),this.handlers.push(this.$iApi.event.on(l.MAP_BASEMAPCHANGE,()=>{this.getHilightLayer().then(t=>{t&&t.graphics.length===0&&this.updateFogLayer()})}))}async hilightSetup(){const i=w(this.$vApp.$pinia).activeBasemapConfig;try{const e=this.$iApi.geo.layer.createLayer({id:c,layerType:y.TILE,cosmetic:!0,url:i.layers[0].url});await this.$iApi.geo.map.addLayer(e),e.opacity=this.offOpacity,await this.reorderFogLayer()}catch{console.error("Something went wrong while setting up the hilighter.")}}async updateFogLayer(){this.$iApi.geo.map.removeLayer(c),await this.hilightSetup()}async reorderFogLayer(){const i=this.getFogLayer(),e=await this.getHilightLayer();if(!e||!i)return;const t=this.$iApi.geo.layer.layerOrderIds(),s=t.indexOf(i.id),a=t.indexOf(e.id);a-1&&s>-1&&this.$iApi.geo.map.reorder(e,s,!1)}async add(i){this.lastAdd=Date.now();const e=this.getFogLayer();e&&(e.opacity=this.onOpacity,await super.add(i))}async remove(i){await super.remove(i);const e=this.getFogLayer();if(!e)return;const t=Date.now(),s=await this.getHilightLayer();s&&setTimeout(()=>{this.lastAdd{this.hilightSetup(i)}))}hilightSetup(i){this.$iApi.geo.map.viewPromise.then(()=>{this.$iApi.geo.map.esriView.highlightOptions=i.options})}async add(i){await super.add(i);const e=this.$iApi.geo.layer.getLayer(n);if(e&&e.esriLayer&&e.isLoaded&&e instanceof L){const t=i instanceof Array?i:[i];this.$iApi.geo.map.esriView?.whenLayerView(e.esriLayer)?.then(function(s){s.highlight(t.map(a=>e.getEsriGraphic(a.id)))})}}async remove(i){await super.remove(i)}}class H extends f{hilightMode=new d({},this.$iApi);initialized(){this.initHilightLayer()}_parseConfig(i){if(i)switch(i.mode){case h.NONE:this.hilightMode=new d(i,this.$iApi);break;case h.GLOW:this.hilightMode=new p(i,this.$iApi);break;case h.LIFT:this.hilightMode=new g(i,this.$iApi);break;case h.FOG:this.hilightMode=new v(i,this.$iApi);break;default:console.error("Could not find hilight mode:",i.mode);break}else this.hilightMode=new p($,this.$iApi)}async initHilightLayer(){const i=this.$iApi.geo.layer.createLayer({id:n,layerType:y.GRAPHIC,cosmetic:!0,url:""});await this.$iApi.geo.map.addLayer(i)}async addHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.add(e)}async removeHilight(i){const e=i?i instanceof Array?i:[i]:void 0;await this.hilightMode.remove(e)}async reloadHilight(i){const e=i instanceof Array?i:[i];await this.hilightMode.reloadHilight(e)}async getGraphicsByKey(i,e,t){const s=await this.getHilightLayer();if(!s)return[];let a=s.graphics.map(r=>({...this.deconstructGraphicKey(r.id),og:r}));return i&&(a=a.filter(r=>r.origin===i)),e&&(a=a.filter(r=>r.uid===e)),t&&(a=a.filter(r=>r.oid===t)),a.map(r=>r.og)}constructGraphicKey(i,e,t){return`${n}~${i}~${e}~${t}`}deconstructGraphicKey(i){const e=i.split("~");return e.length!==4&&console.warn("Malformed Hilight Graphic key provided:",i),{origin:e[1],uid:e[2],oid:parseInt(e[3])}}async getHilightLayer(){if(this.hilightMode)return await this.hilightMode.getHilightLayer();console.warn("API get layer request before highlight mode object exists")}}class F extends H{async added(){this._parseConfig(this.config);const i=this.$vApp.$watch(()=>this.config,e=>this._parseConfig(e));this.removed=()=>{i()}}}export{F as default}; diff --git a/custom-toc-highlight/assets/index-CWPzg1w2-dFHsYLYO.js b/custom-toc-highlight/assets/index-CWPzg1w2-Duz60wim.js similarity index 75% rename from custom-toc-highlight/assets/index-CWPzg1w2-dFHsYLYO.js rename to custom-toc-highlight/assets/index-CWPzg1w2-Duz60wim.js index 48e739fe..95d560fe 100644 --- a/custom-toc-highlight/assets/index-CWPzg1w2-dFHsYLYO.js +++ b/custom-toc-highlight/assets/index-CWPzg1w2-Duz60wim.js @@ -1 +1 @@ -import{a as s}from"./fabric-Df28hv38-CC2TWXwY.js";import{fq as a,fz as f}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";class x extends a{get config(){return this.$iApi.fixture.get("export").config?.footnote}make(i){const t=this.config,e={text:"RAMP-PCAR",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0};t?.value!==void 0&&(e.text=t.value);const o=f(e,i||{}),r=new s.fabric.Textbox(o.text,o);return Promise.resolve(r)}}export{x as default}; +import{a as s}from"./fabric-Df28hv38-DoClkw8Q.js";import{fq as a,fz as f}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";class x extends a{get config(){return this.$iApi.fixture.get("export").config?.footnote}make(i){const t=this.config,e={text:"RAMP-PCAR",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:20,top:0};t?.value!==void 0&&(e.text=t.value);const o=f(e,i||{}),r=new s.fabric.Textbox(o.text,o);return Promise.resolve(r)}}export{x as default}; diff --git a/custom-toc-highlight/assets/index-CfINOE3J-rJJ_H7b3.js b/custom-toc-highlight/assets/index-CfINOE3J-D35QOhUy.js similarity index 92% rename from custom-toc-highlight/assets/index-CfINOE3J-rJJ_H7b3.js rename to custom-toc-highlight/assets/index-CfINOE3J-D35QOhUy.js index 23f996bd..340f8140 100644 --- a/custom-toc-highlight/assets/index-CfINOE3J-rJJ_H7b3.js +++ b/custom-toc-highlight/assets/index-CfINOE3J-D35QOhUy.js @@ -1 +1 @@ -import{fD as c,eV as o,fE as f,fq as r}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";class A extends r{_parseConfig(t){if(t){const e=c(this.$vApp.$pinia);t.alwaysOn&&e.setAlwaysOn(!0);const i=t.extentSetIds;i&&Array.isArray(i)&&i.length>0&&e.setExtentSetIds(i)}}get config(){return super.config}}function p(a,t,e,i){const n=a-t,s=t+n/2,h=Math.min(n,e-i);return s>e?{min:e-h,max:e,changed:!0}:sthis.config,e=>this._parseConfig(e));this.removed=()=>{t(),c(this.$vApp.$pinia).$reset(),this.evtOff("schemaEH"),this.evtOff("extentEH")},this.schemaEH=this.$iApi.event.on(o.MAP_BASEMAPCHANGE,e=>{e.schemaChanged&&this.checkActive()}),this.$iApi.geo.map.created?this.checkActive():this.$iApi.event.once(o.MAP_CREATED,()=>{this.checkActive()})}checkActive(){const t=c(this.$vApp.$pinia);t.alwaysOn||t.extentSetIds.includes(this.$iApi.geo.map.getExtentSet().id)?t.active||(t.setActive(!0),this.extentEH=this.$iApi.event.on(o.MAP_EXTENTCHANGE,e=>{t.enforcing||this.enforceBoundary(e,!1)})):t.active&&(t.setActive(!1),this.evtOff("extentEH"))}evtOff(t){this[t]&&(this.$iApi.event.off(this[t]),this[t]="")}enforceBoundary(t,e){const i=this.$iApi.geo.map.getExtentSet().maximumExtent,n=p(t.xmax,t.xmin,i.xmax,i.xmin),s=p(t.ymax,t.ymin,i.ymax,i.ymin);if(s.changed||n.changed){e&&(this.$iApi.geo.map.esriView.extent=i.toESRI());const h=f.fromParams("extguard",n.min,s.min,n.max,s.max,t.sr),m=c(this.$vApp.$pinia);m.setEnforcing(!0),setTimeout(()=>{this.$iApi.geo.map.zoomMapTo(h,void 0,!0,400,"ease-in-out").then(()=>{m.setEnforcing(!1),this.enforceBoundary(this.$iApi.geo.map.getExtent(),!0)})},150)}}}export{d as default}; +import{fD as c,eV as o,fE as f,fq as r}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";class A extends r{_parseConfig(t){if(t){const e=c(this.$vApp.$pinia);t.alwaysOn&&e.setAlwaysOn(!0);const i=t.extentSetIds;i&&Array.isArray(i)&&i.length>0&&e.setExtentSetIds(i)}}get config(){return super.config}}function p(a,t,e,i){const n=a-t,s=t+n/2,h=Math.min(n,e-i);return s>e?{min:e-h,max:e,changed:!0}:sthis.config,e=>this._parseConfig(e));this.removed=()=>{t(),c(this.$vApp.$pinia).$reset(),this.evtOff("schemaEH"),this.evtOff("extentEH")},this.schemaEH=this.$iApi.event.on(o.MAP_BASEMAPCHANGE,e=>{e.schemaChanged&&this.checkActive()}),this.$iApi.geo.map.created?this.checkActive():this.$iApi.event.once(o.MAP_CREATED,()=>{this.checkActive()})}checkActive(){const t=c(this.$vApp.$pinia);t.alwaysOn||t.extentSetIds.includes(this.$iApi.geo.map.getExtentSet().id)?t.active||(t.setActive(!0),this.extentEH=this.$iApi.event.on(o.MAP_EXTENTCHANGE,e=>{t.enforcing||this.enforceBoundary(e,!1)})):t.active&&(t.setActive(!1),this.evtOff("extentEH"))}evtOff(t){this[t]&&(this.$iApi.event.off(this[t]),this[t]="")}enforceBoundary(t,e){const i=this.$iApi.geo.map.getExtentSet().maximumExtent,n=p(t.xmax,t.xmin,i.xmax,i.xmin),s=p(t.ymax,t.ymin,i.ymax,i.ymin);if(s.changed||n.changed){e&&(this.$iApi.geo.map.esriView.extent=i.toESRI());const h=f.fromParams("extguard",n.min,s.min,n.max,s.max,t.sr),m=c(this.$vApp.$pinia);m.setEnforcing(!0),setTimeout(()=>{this.$iApi.geo.map.zoomMapTo(h,void 0,!0,400,"ease-in-out").then(()=>{m.setEnforcing(!1),this.enforceBoundary(this.$iApi.geo.map.getExtent(),!0)})},150)}}}export{d as default}; diff --git a/custom-toc-highlight/assets/index-ChMe1Rap-m0hgXXvs.js b/custom-toc-highlight/assets/index-ChMe1Rap-CzOnqpfO.js similarity index 84% rename from custom-toc-highlight/assets/index-ChMe1Rap-m0hgXXvs.js rename to custom-toc-highlight/assets/index-ChMe1Rap-CzOnqpfO.js index c53084ca..0f903f84 100644 --- a/custom-toc-highlight/assets/index-ChMe1Rap-m0hgXXvs.js +++ b/custom-toc-highlight/assets/index-ChMe1Rap-CzOnqpfO.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-CcinMdyM-Bc6n_y5I.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css"])))=>i.map(i=>d[i]); -import{_ as l}from"./main-ugzBrWNm.js";import{eT as o,fq as m,fu as r,eW as c,fw as b,eX as v,eY as f,e_ as h,e$ as d,f0 as u,f1 as g,f2 as e,f4 as w}from"./story-BfX8CRfG.js";const x=o({__name:"nav-button",setup(t){const{t:s}=v(),i=f("iApi"),p=()=>i?.panel.toggle("basemap");return(A,a)=>{const n=h("mapnav-button");return d(),u(n,{onClickFunction:p,tooltip:w(s)("basemap.title")},{default:g(()=>a[0]||(a[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"})],-1)])),_:1},8,["tooltip"])}}}),_={en:{"basemap.select":"Select basemap","basemap.title":"Basemap"},fr:{"basemap.select":"Sélectionner la carte de base","basemap.title":"Carte de base"}};class z extends m{added(){this.$iApi.component("basemap-nav-button",x),this.$iApi.panel.register({id:"basemap",config:{screens:{"basemap-component":()=>r(l(()=>import("./screen-CcinMdyM-Bc6n_y5I.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},button:{tooltip:"basemap.title",icon:''},alertName:"basemap.title"}},{i18n:{messages:_}}),this.handlePanelTeleports(["basemap"])}removed(){this.$iApi.fixture.exists("appbar")&&c(this.$vApp.$pinia).removeButton("basemap"),this.$iApi.fixture.exists("mapnav")&&b(this.$vApp.$pinia).removeItem("basemap"),this.$iApi.panel.remove("basemap")}}export{z as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-CcinMdyM-CM_vb3KL.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css"])))=>i.map(i=>d[i]); +import{_ as l}from"./main-QGPoLsvl.js";import{eT as o,fq as m,fu as r,eW as c,fw as b,eX as v,eY as f,e_ as h,e$ as d,f0 as u,f1 as g,f2 as e,f4 as w}from"./story-Doly9N9p.js";const x=o({__name:"nav-button",setup(t){const{t:s}=v(),i=f("iApi"),p=()=>i?.panel.toggle("basemap");return(A,a)=>{const n=h("mapnav-button");return d(),u(n,{onClickFunction:p,tooltip:w(s)("basemap.title")},{default:g(()=>a[0]||(a[0]=[e("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[e("path",{d:"M0 0h24v24H0z",fill:"none"}),e("path",{d:"M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM15 19l-6-2.11V5l6 2.11V19z"})],-1)])),_:1},8,["tooltip"])}}}),_={en:{"basemap.select":"Select basemap","basemap.title":"Basemap"},fr:{"basemap.select":"Sélectionner la carte de base","basemap.title":"Carte de base"}};class z extends m{added(){this.$iApi.component("basemap-nav-button",x),this.$iApi.panel.register({id:"basemap",config:{screens:{"basemap-component":()=>r(l(()=>import("./screen-CcinMdyM-CM_vb3KL.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},button:{tooltip:"basemap.title",icon:''},alertName:"basemap.title"}},{i18n:{messages:_}}),this.handlePanelTeleports(["basemap"])}removed(){this.$iApi.fixture.exists("appbar")&&c(this.$vApp.$pinia).removeButton("basemap"),this.$iApi.fixture.exists("mapnav")&&b(this.$vApp.$pinia).removeItem("basemap"),this.$iApi.panel.remove("basemap")}}export{z as default}; diff --git a/custom-toc-highlight/assets/index-CobT58Py-hm1bMD7r.js b/custom-toc-highlight/assets/index-CobT58Py-D8ewubJk.js similarity index 96% rename from custom-toc-highlight/assets/index-CobT58Py-hm1bMD7r.js rename to custom-toc-highlight/assets/index-CobT58Py-D8ewubJk.js index f2569b9b..e542f220 100644 --- a/custom-toc-highlight/assets/index-CobT58Py-hm1bMD7r.js +++ b/custom-toc-highlight/assets/index-CobT58Py-D8ewubJk.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-NGXXpKUs-C6NVgv_3.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./vue.esm-bundler-D2erd_gM-D0q3-bhf.js"])))=>i.map(i=>d[i]); -import{_ as f}from"./main-ugzBrWNm.js";import{fu as p,g7 as y,fq as g,fL as m,fK as i,g8 as n,g9 as w}from"./story-BfX8CRfG.js";class h extends g{toggleWizard(e){const r=this.$iApi.panel.get("wizard");this.$iApi.panel.toggle(r,e)}}class z extends m{layerCount=0;sublayerCount=0;constructor(e){super(e)}async fetchFileInfo(e,r,a){switch(a||(a=await this.$iApi.geo.layer.files.fetchFileData(e,r)),r){case i.GEOJSON:return this.getGeojsonInfo(e,a);case i.SHAPEFILE:return this.getShapfileInfo(e,a);case i.CSV:return this.getCsvInfo(e,a);default:console.error(`Unsupported file type passed to fetchFileInfo - '${r}'`)}}async getGeojsonInfo(e,r){return r instanceof ArrayBuffer&&(r=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(r)))),{config:{id:`geojson#${++this.layerCount}`,layerType:i.GEOJSON,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractGeoJsonFields(r)),configOptions:["name","nameField","tooltipField","colour"]}}async getCsvInfo(e,r){return r instanceof ArrayBuffer&&(r=new TextDecoder("utf-8").decode(new Uint8Array(r))),{config:{id:`csv#${++this.layerCount}`,layerType:i.CSV,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractCsvFields(r)),latLonFields:this.$iApi.geo.layer.files.filterCsvLatLonFields(r),configOptions:["name","nameField","tooltipField","latField","longField","colour"]}}async getShapfileInfo(e,r){const a=await this.$iApi.geo.layer.files.shapefileToGeoJson(r);return this.getGeojsonInfo(e,a)}async fetchServiceInfo(e,r,a){switch(r){case i.FEATURE:return this.getFeatureInfo(e);case i.MAPIMAGE:return this.getMapImageInfo(e,a);case i.TILE:return this.getTileInfo(e);case i.IMAGERY:return this.getImageryInfo(e);case i.WFS:return this.getWfsInfo(e);case i.WMS:return this.getWmsInfo(e,a)}}async getFeatureInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.FEATURE}#${++this.layerCount}`,url:e,layerType:i.FEATURE,name:r.data.name,nameField:r.data.displayField,tooltipField:r.data.displayField,state:{opacity:1,visibility:!0}},fields:r.data.fields,configOptions:["name","nameField","tooltipField"]}}async getMapImageInfo(e,r){const a=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.MAPIMAGE}#${++this.layerCount}`,url:e,layerType:i.MAPIMAGE,name:a.data.mapName,sublayers:[],state:{opacity:1,visibility:!0}},layers:this.createLayerHierarchy(a.data.layers,r),configOptions:["name","sublayers"],layersRaw:a.data.layers}}createLayerHierarchy(e,r){e.sort((l,s)=>l.id-s.id);const a=(l,s)=>{if(s===void 0)return!1;let c;if(s.find(o=>o.id===l))return s.find(o=>o.id===l);for(const o of s)if(c=a(l,o.children),c!==!1)return c;return!1},t=[],d=new Set(e.filter(l=>l.subLayerIds&&l.subLayerIds.length>0).map(l=>l.id));for(const l of e)if(r&&l.parentLayerId===-1)t.push({id:l.id,label:l.name,children:l.subLayerIds?[]:void 0});else if(r){const s=a(l.parentLayerId,t);s.children=[...s.children,{id:l.id,label:l.name,children:l.subLayerIds?[]:void 0}]}else d.has(l.id)||t.push({id:l.id,label:l.name,children:void 0});return t}async getTileInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.TILE}#${++this.layerCount}`,url:e,layerType:i.TILE,name:r.data.mapName,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getImageryInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.IMAGERY}#${++this.layerCount}`,url:e,layerType:i.IMAGERY,name:r.data.name,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getWfsInfo(e){const r=new w(e),{offset:a,limit:t}=r.queryMap,d=await this.$iApi.geo.layer.ogc.loadWfsData(e,-1,parseInt(a)||0,parseInt(t)||1e3);return this.getGeojsonInfo(e.match(/\/([^/]+)\/items/)?.[1]||"Layer",d)}async getWmsInfo(e,r){const a=await this.$iApi.geo.layer.ogc.parseCapabilities(e);return{config:{id:`${i.WMS}#${++this.layerCount}`,url:e,layerType:i.WMS,name:e,featureInfoMimeType:a.queryTypes[0],state:{opacity:1,visibility:!0}},layers:this.mapWmsLayerList(a.layers,r),configOptions:["name","sublayers"],layersRaw:a.layers}}mapWmsLayerList(e,r){let a=[];return e.forEach(t=>{t.name===null&&t.layers?a=[...a,...t.layers]:a.push(t)}),r?a.flatMap(t=>({id:`${t.name}#${++this.sublayerCount}`,label:t.title,children:t.layers.length>0?this.mapWmsLayerList(t.layers,r):void 0})):a.flatMap(t=>t.layers&&t.layers.length>0?this.mapWmsLayerList(t.layers,r):{id:`${t.name}#${++this.sublayerCount}`,label:t.title})}guessFormatFromURL(e){switch(e.match(/\.(zip|csv|geojson|json)$/)?.[1]){case"zip":return i.SHAPEFILE;case"csv":return i.CSV;case"geojson":case"json":return i.GEOJSON}return e.match(/\/ImageServer\/?$/gi)?i.IMAGERY:e.match(/\/collections\//gi)?i.WFS:e.match(/arcgis\/rest\/services\//gi)?e.match(/\/\d+\/?$/g)?i.FEATURE:i.MAPIMAGE:e.match(/service=|version=|\/wms/gi)?i.WMS:""}}const E={en:{"wizard.title":"Import Layer","wizard.upload.title":"Upload data","wizard.upload.or":"or","wizard.upload.file.label":"Upload a file","wizard.upload.file.help":"Drop or select a file to upload","wizard.upload.file.error.failed":"File upload failed","wizard.upload.url.label":"URL to file or service","wizard.upload.url.error.required":"URL is required","wizard.upload.url.error.url":"Please enter a valid URL","wizard.format.title":"Select format","wizard.format.type.service":"Service type","wizard.format.type.file":"File format","wizard.format.type.error.required":"Service or file type is required","wizard.format.type.error.invalid":"Invalid file or service type","wizard.format.type.error.failure":"Failed to load data from file/service","wizard.format.info.cors":"Service needs to be CORS enabled","wizard.format.warn.cors":"Service may not support CORS","wizard.format.warn.vpn":"Service may require a VPN connection","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"zipped Shapefile","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"ESRI Feature Layer","wizard.layerType.esriMapImage":"ESRI Map Image Layer","wizard.layerType.esriImagery":"ESRI Imagery Layer","wizard.layerType.esriTile":"ESRI Tile Layer","wizard.layerType.ogcWms":"OGC Web Map Service","wizard.layerType.ogcWfs":"OGC Web Feature Service","wizard.configure.title":"Configure layer","wizard.configure.name.error.required":"Name is required","wizard.configure.name.label":"Layer Name","wizard.configure.nameField.label":"Primary Field","wizard.configure.tooltipField.label":"Tooltip Field","wizard.configure.latField.label":"Latitude Field","wizard.configure.longField.label":"Longitude Field","wizard.configure.sublayers.error.required":"Sublayers are required","wizard.configure.sublayers.label":"Layers","wizard.configure.sublayers.results":"No results","wizard.configure.sublayers.search":"Search layers","wizard.configure.sublayers.select":"Select layer(s)","wizard.configure.sublayers.clearAll":"Clear all","wizard.configure.sublayers.nested":"Nested","wizard.configure.colour.label":"Colour","wizard.configure.colour.hue":"Hue","wizard.configure.colour.copy":"Copy colour","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Cancel","wizard.step.continue":"Continue","wizard.upload.success":"has been uploaded successfully.","wizard.upload.fail":"failed to upload."},fr:{"wizard.title":"Importer un fichier","wizard.upload.title":"Charger des données","wizard.upload.or":"ou","wizard.upload.file.label":"Télécharger un fichier","wizard.upload.file.help":"Déposer ou sélectionner un fichier à télécharger","wizard.upload.file.error.failed":"Le téléchargement du fichier a échoué","wizard.upload.url.label":"URL vers fichier ou service","wizard.upload.url.error.required":"L'URL est requise","wizard.upload.url.error.url":"Veuillez saisir une adresse URL valide","wizard.format.title":"Choisir un format","wizard.format.type.service":"Type de service","wizard.format.type.file":"Format du fichier","wizard.format.type.error.required":"Le service ou le type de fichier est requis","wizard.format.type.error.invalid":"Type de fichier ou de service non valide","wizard.format.type.error.failure":"Échec du chargement des données à partir du fichier/service","wizard.format.info.cors":"Le service doit être compatible CORS.","wizard.format.warn.cors":"Le service ne pend peut-être pas en charge CORS.","wizard.format.warn.vpn":"Le service peut nécessiter une connexion RPV","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"Shapefile zippé","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"Couche d'éléments d'ESRI","wizard.layerType.esriMapImage":"Couche d'image de la carte ESRI","wizard.layerType.esriImagery":"Couche d'imagerie d'ESRI","wizard.layerType.esriTile":"Couche de tuiles d'ESRI","wizard.layerType.ogcWms":"Couche WMS de l'OGC","wizard.layerType.ogcWfs":"Service d'entités Web OGC","wizard.configure.title":"Configurer la couche","wizard.configure.name.error.required":"Le champ Nom est obligatoire","wizard.configure.name.label":"Nom de la couche","wizard.configure.nameField.label":"Champ clé","wizard.configure.tooltipField.label":"Champ infobulle","wizard.configure.latField.label":"Champ latitude","wizard.configure.longField.label":"Champ longitude","wizard.configure.sublayers.error.required":"Des sous-couches sont requises","wizard.configure.sublayers.label":"Couches","wizard.configure.sublayers.results":"Aucun résultat","wizard.configure.sublayers.search":"Rechercher des couches","wizard.configure.sublayers.select":"Sélectionner les couches","wizard.configure.sublayers.clearAll":"Effacer tout","wizard.configure.sublayers.nested":"Imbriquées","wizard.configure.colour.label":"Couleur","wizard.configure.colour.hue":"Teinte","wizard.configure.colour.copy":"Copier la couleur","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Annuler","wizard.step.continue":"Continuer","wizard.upload.success":"a été téléversé avec succès.","wizard.upload.fail":"n'a pas pu être téléversé."}};class b extends h{added(){this.$iApi.panel.register({wizard:{screens:{"wizard-screen":()=>p(f(()=>import("./screen-NGXXpKUs-C6NVgv_3.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},button:{tooltip:"wizard.title",icon:''},style:{width:"350px"},alertName:"wizard.title"}},{i18n:{messages:E}}),this.handlePanelTeleports(["wizard"]);let e=new z(this.$iApi);const r=y(this.$vApp.$pinia);r.layerSource=e,this.removed=()=>{this.$iApi.panel.remove("wizard"),e=void 0,r.$reset()}}}export{b as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-NGXXpKUs-DF8RN7bq.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./vue.esm-bundler-D2erd_gM-C7Afc0Sc.js"])))=>i.map(i=>d[i]); +import{_ as f}from"./main-QGPoLsvl.js";import{fu as p,g7 as y,fq as g,fL as m,fK as i,g8 as n,g9 as w}from"./story-Doly9N9p.js";class h extends g{toggleWizard(e){const r=this.$iApi.panel.get("wizard");this.$iApi.panel.toggle(r,e)}}class z extends m{layerCount=0;sublayerCount=0;constructor(e){super(e)}async fetchFileInfo(e,r,a){switch(a||(a=await this.$iApi.geo.layer.files.fetchFileData(e,r)),r){case i.GEOJSON:return this.getGeojsonInfo(e,a);case i.SHAPEFILE:return this.getShapfileInfo(e,a);case i.CSV:return this.getCsvInfo(e,a);default:console.error(`Unsupported file type passed to fetchFileInfo - '${r}'`)}}async getGeojsonInfo(e,r){return r instanceof ArrayBuffer&&(r=JSON.parse(new TextDecoder("utf-8").decode(new Uint8Array(r)))),{config:{id:`geojson#${++this.layerCount}`,layerType:i.GEOJSON,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractGeoJsonFields(r)),configOptions:["name","nameField","tooltipField","colour"]}}async getCsvInfo(e,r){return r instanceof ArrayBuffer&&(r=new TextDecoder("utf-8").decode(new Uint8Array(r))),{config:{id:`csv#${++this.layerCount}`,layerType:i.CSV,url:e,name:e.substring(e.lastIndexOf("/")+1),state:{opacity:1,visibility:!0},rawData:r},fields:[{name:"OBJECTID",type:"oid"}].concat(this.$iApi.geo.layer.files.extractCsvFields(r)),latLonFields:this.$iApi.geo.layer.files.filterCsvLatLonFields(r),configOptions:["name","nameField","tooltipField","latField","longField","colour"]}}async getShapfileInfo(e,r){const a=await this.$iApi.geo.layer.files.shapefileToGeoJson(r);return this.getGeojsonInfo(e,a)}async fetchServiceInfo(e,r,a){switch(r){case i.FEATURE:return this.getFeatureInfo(e);case i.MAPIMAGE:return this.getMapImageInfo(e,a);case i.TILE:return this.getTileInfo(e);case i.IMAGERY:return this.getImageryInfo(e);case i.WFS:return this.getWfsInfo(e);case i.WMS:return this.getWmsInfo(e,a)}}async getFeatureInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.FEATURE}#${++this.layerCount}`,url:e,layerType:i.FEATURE,name:r.data.name,nameField:r.data.displayField,tooltipField:r.data.displayField,state:{opacity:1,visibility:!0}},fields:r.data.fields,configOptions:["name","nameField","tooltipField"]}}async getMapImageInfo(e,r){const a=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.MAPIMAGE}#${++this.layerCount}`,url:e,layerType:i.MAPIMAGE,name:a.data.mapName,sublayers:[],state:{opacity:1,visibility:!0}},layers:this.createLayerHierarchy(a.data.layers,r),configOptions:["name","sublayers"],layersRaw:a.data.layers}}createLayerHierarchy(e,r){e.sort((l,s)=>l.id-s.id);const a=(l,s)=>{if(s===void 0)return!1;let c;if(s.find(o=>o.id===l))return s.find(o=>o.id===l);for(const o of s)if(c=a(l,o.children),c!==!1)return c;return!1},t=[],d=new Set(e.filter(l=>l.subLayerIds&&l.subLayerIds.length>0).map(l=>l.id));for(const l of e)if(r&&l.parentLayerId===-1)t.push({id:l.id,label:l.name,children:l.subLayerIds?[]:void 0});else if(r){const s=a(l.parentLayerId,t);s.children=[...s.children,{id:l.id,label:l.name,children:l.subLayerIds?[]:void 0}]}else d.has(l.id)||t.push({id:l.id,label:l.name,children:void 0});return t}async getTileInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.TILE}#${++this.layerCount}`,url:e,layerType:i.TILE,name:r.data.mapName,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getImageryInfo(e){const r=await n.get(e,{params:{f:"json"}});return{config:{id:`${i.IMAGERY}#${++this.layerCount}`,url:e,layerType:i.IMAGERY,name:r.data.name,state:{opacity:1,visibility:!0}},configOptions:["name"]}}async getWfsInfo(e){const r=new w(e),{offset:a,limit:t}=r.queryMap,d=await this.$iApi.geo.layer.ogc.loadWfsData(e,-1,parseInt(a)||0,parseInt(t)||1e3);return this.getGeojsonInfo(e.match(/\/([^/]+)\/items/)?.[1]||"Layer",d)}async getWmsInfo(e,r){const a=await this.$iApi.geo.layer.ogc.parseCapabilities(e);return{config:{id:`${i.WMS}#${++this.layerCount}`,url:e,layerType:i.WMS,name:e,featureInfoMimeType:a.queryTypes[0],state:{opacity:1,visibility:!0}},layers:this.mapWmsLayerList(a.layers,r),configOptions:["name","sublayers"],layersRaw:a.layers}}mapWmsLayerList(e,r){let a=[];return e.forEach(t=>{t.name===null&&t.layers?a=[...a,...t.layers]:a.push(t)}),r?a.flatMap(t=>({id:`${t.name}#${++this.sublayerCount}`,label:t.title,children:t.layers.length>0?this.mapWmsLayerList(t.layers,r):void 0})):a.flatMap(t=>t.layers&&t.layers.length>0?this.mapWmsLayerList(t.layers,r):{id:`${t.name}#${++this.sublayerCount}`,label:t.title})}guessFormatFromURL(e){switch(e.match(/\.(zip|csv|geojson|json)$/)?.[1]){case"zip":return i.SHAPEFILE;case"csv":return i.CSV;case"geojson":case"json":return i.GEOJSON}return e.match(/\/ImageServer\/?$/gi)?i.IMAGERY:e.match(/\/collections\//gi)?i.WFS:e.match(/arcgis\/rest\/services\//gi)?e.match(/\/\d+\/?$/g)?i.FEATURE:i.MAPIMAGE:e.match(/service=|version=|\/wms/gi)?i.WMS:""}}const E={en:{"wizard.title":"Import Layer","wizard.upload.title":"Upload data","wizard.upload.or":"or","wizard.upload.file.label":"Upload a file","wizard.upload.file.help":"Drop or select a file to upload","wizard.upload.file.error.failed":"File upload failed","wizard.upload.url.label":"URL to file or service","wizard.upload.url.error.required":"URL is required","wizard.upload.url.error.url":"Please enter a valid URL","wizard.format.title":"Select format","wizard.format.type.service":"Service type","wizard.format.type.file":"File format","wizard.format.type.error.required":"Service or file type is required","wizard.format.type.error.invalid":"Invalid file or service type","wizard.format.type.error.failure":"Failed to load data from file/service","wizard.format.info.cors":"Service needs to be CORS enabled","wizard.format.warn.cors":"Service may not support CORS","wizard.format.warn.vpn":"Service may require a VPN connection","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"zipped Shapefile","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"ESRI Feature Layer","wizard.layerType.esriMapImage":"ESRI Map Image Layer","wizard.layerType.esriImagery":"ESRI Imagery Layer","wizard.layerType.esriTile":"ESRI Tile Layer","wizard.layerType.ogcWms":"OGC Web Map Service","wizard.layerType.ogcWfs":"OGC Web Feature Service","wizard.configure.title":"Configure layer","wizard.configure.name.error.required":"Name is required","wizard.configure.name.label":"Layer Name","wizard.configure.nameField.label":"Primary Field","wizard.configure.tooltipField.label":"Tooltip Field","wizard.configure.latField.label":"Latitude Field","wizard.configure.longField.label":"Longitude Field","wizard.configure.sublayers.error.required":"Sublayers are required","wizard.configure.sublayers.label":"Layers","wizard.configure.sublayers.results":"No results","wizard.configure.sublayers.search":"Search layers","wizard.configure.sublayers.select":"Select layer(s)","wizard.configure.sublayers.clearAll":"Clear all","wizard.configure.sublayers.nested":"Nested","wizard.configure.colour.label":"Colour","wizard.configure.colour.hue":"Hue","wizard.configure.colour.copy":"Copy colour","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Cancel","wizard.step.continue":"Continue","wizard.upload.success":"has been uploaded successfully.","wizard.upload.fail":"failed to upload."},fr:{"wizard.title":"Importer un fichier","wizard.upload.title":"Charger des données","wizard.upload.or":"ou","wizard.upload.file.label":"Télécharger un fichier","wizard.upload.file.help":"Déposer ou sélectionner un fichier à télécharger","wizard.upload.file.error.failed":"Le téléchargement du fichier a échoué","wizard.upload.url.label":"URL vers fichier ou service","wizard.upload.url.error.required":"L'URL est requise","wizard.upload.url.error.url":"Veuillez saisir une adresse URL valide","wizard.format.title":"Choisir un format","wizard.format.type.service":"Type de service","wizard.format.type.file":"Format du fichier","wizard.format.type.error.required":"Le service ou le type de fichier est requis","wizard.format.type.error.invalid":"Type de fichier ou de service non valide","wizard.format.type.error.failure":"Échec du chargement des données à partir du fichier/service","wizard.format.info.cors":"Le service doit être compatible CORS.","wizard.format.warn.cors":"Le service ne pend peut-être pas en charge CORS.","wizard.format.warn.vpn":"Le service peut nécessiter une connexion RPV","wizard.fileType.csv":"CSV","wizard.fileType.shapefile":"Shapefile zippé","wizard.fileType.geojson":"GeoJSON","wizard.layerType.esriFeature":"Couche d'éléments d'ESRI","wizard.layerType.esriMapImage":"Couche d'image de la carte ESRI","wizard.layerType.esriImagery":"Couche d'imagerie d'ESRI","wizard.layerType.esriTile":"Couche de tuiles d'ESRI","wizard.layerType.ogcWms":"Couche WMS de l'OGC","wizard.layerType.ogcWfs":"Service d'entités Web OGC","wizard.configure.title":"Configurer la couche","wizard.configure.name.error.required":"Le champ Nom est obligatoire","wizard.configure.name.label":"Nom de la couche","wizard.configure.nameField.label":"Champ clé","wizard.configure.tooltipField.label":"Champ infobulle","wizard.configure.latField.label":"Champ latitude","wizard.configure.longField.label":"Champ longitude","wizard.configure.sublayers.error.required":"Des sous-couches sont requises","wizard.configure.sublayers.label":"Couches","wizard.configure.sublayers.results":"Aucun résultat","wizard.configure.sublayers.search":"Rechercher des couches","wizard.configure.sublayers.select":"Sélectionner les couches","wizard.configure.sublayers.clearAll":"Effacer tout","wizard.configure.sublayers.nested":"Imbriquées","wizard.configure.colour.label":"Couleur","wizard.configure.colour.hue":"Teinte","wizard.configure.colour.copy":"Copier la couleur","wizard.configure.colour.hex":"Hex","wizard.step.cancel":"Annuler","wizard.step.continue":"Continuer","wizard.upload.success":"a été téléversé avec succès.","wizard.upload.fail":"n'a pas pu être téléversé."}};class b extends h{added(){this.$iApi.panel.register({wizard:{screens:{"wizard-screen":()=>p(f(()=>import("./screen-NGXXpKUs-DF8RN7bq.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},button:{tooltip:"wizard.title",icon:''},style:{width:"350px"},alertName:"wizard.title"}},{i18n:{messages:E}}),this.handlePanelTeleports(["wizard"]);let e=new z(this.$iApi);const r=y(this.$vApp.$pinia);r.layerSource=e,this.removed=()=>{this.$iApi.panel.remove("wizard"),e=void 0,r.$reset()}}}export{b as default}; diff --git a/custom-toc-highlight/assets/index-CuDicHX--DyH65FLJ.js b/custom-toc-highlight/assets/index-CuDicHX--VLwELiqf.js similarity index 98% rename from custom-toc-highlight/assets/index-CuDicHX--DyH65FLJ.js rename to custom-toc-highlight/assets/index-CuDicHX--VLwELiqf.js index 1a049618..4859fc10 100644 --- a/custom-toc-highlight/assets/index-CuDicHX--DyH65FLJ.js +++ b/custom-toc-highlight/assets/index-CuDicHX--VLwELiqf.js @@ -1 +1 @@ -import{eT as I,eU as P,g1 as m,fq as O,eX as R,eY as F,fN as $,f6 as f,eZ as l,fY as M,f8 as T,eV as d,fZ as k,f9 as z,fa as D,e$ as y,fb as g,f2 as v,f3 as H,fc as N,f4 as x,fF as L,g2 as q,fK as W,fu as G,g3 as Z,f$ as K,g4 as Y,g5 as j}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";class U extends q{overviewGraphicLayer;overviewmapStore;constructor(e){super(e),this.overviewGraphicLayer=this.$iApi.geo.layer.createLayer({id:"RampOverviewGraphic",layerType:W.GRAPHIC,url:"",cosmetic:!0}),this.overviewmapStore=m(this.$vApp.$pinia)}async createMapView(e){if(!e)throw new Error("Attempted to create overview map view without a basemap");const t=typeof e=="string"?await this.findBasemap(e):e;await this.applyBasemap(t),this._rampExtentSet=this.$iApi.geo.map.getExtentSet().clone(),this._rampSR=this._rampExtentSet.sr.clone();const i=this.overviewmapStore.expandFactor;this.esriView=G(await Z.MapView({map:this.esriMap,container:this._targetDiv,constraints:{rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this.$iApi.geo.map.getExtent().toESRI().expand(i)})),this.esriView.ui.components=[],this.handlers.push({type:"mouse-wheel",handler:this.esriView.on("mouse-wheel",a=>{a.stopPropagation()})}),this.handlers.push({type:"double-click",handler:this.esriView.on("double-click",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",a=>{a.stopPropagation()})}),this.handlers.push({type:"drag",handler:this.esriView.on("drag",a=>{a.stopPropagation(),this.mapDrag(a)})}),this.esriView.container.addEventListener("touchmove",a=>{a.preventDefault()}),this.esriView.watch("fatalError",()=>{const a=new IntersectionObserver(h=>{h.forEach(n=>{n.isIntersecting&&(this.esriView?.tryFatalErrorRecovery(),a.disconnect())})});a.observe(this.esriView.container)}),this.esriView.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}async addMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}const e=new K(this.$iApi.geo.map.getExtent(),"overview-graphic"),t=this.overviewmapStore.borderColour??"#FF0000",i=this.overviewmapStore.borderWidth??1,a=this.overviewmapStore.areaColour??"#000000",h=this.overviewmapStore.areaOpacity??.25,n=`${a}${Math.round(h*255).toString(16)}`;e.style=new Y({fill:{colour:n},outline:{colour:t,width:i}}),await this.overviewGraphicLayer.initiate(),await this.overviewGraphicLayer.addGraphic(e),this.esriMap?.add(this.overviewGraphicLayer.esriLayer)}async removeMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}if(!this.overviewGraphicLayer.esriLayer)throw new Error("Attempted to remove layer from the map without an esri layer. Likely layer.initiate() was not called or had not finished.");this.overviewGraphicLayer.removeGraphic(),this.esriMap.remove(this.overviewGraphicLayer.esriLayer),await this.overviewGraphicLayer.terminate()}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}async findBasemap(e){const t=this._basemapStore.find(i=>i.id===e);if(t)return t;{const i=$(this.$vApp.$pinia).config.map;if(i){const a=i.basemaps.find(h=>h.id===e);if(a)return j.create(a)}}throw new Error(`Invalid basemap id requested: ${e}`)}async setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const t=await this.findBasemap(e),i=(this.getCurrentBasemapId()?await this.findBasemap(this.getCurrentBasemapId()):void 0)?.tileSchemaId!==t.tileSchemaId;return i?(this.destroyMapView(),await this.createMapView(t)):await this.applyBasemap(t),i}startExtent=null;async mapDrag(e){if(e.native.pointerType==="mouse"){if(e.action==="start")await this.cursorHitTest(e)&&(this.startExtent=G(this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry));else if(this.startExtent){const t=this.esriView.toMap(e.origin),i=this.esriView.toMap({x:e.x,y:e.y}),a=this.startExtent.clone().offset(i.x-t.x,i.y-t.y,0);this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry=a,e.action==="end"&&(this.$iApi.geo.map.zoomMapTo(this.$iApi.geo.geom.geomEsriToRamp(a),void 0,!1),this.startExtent=null)}}}updateOverview(e){const t=this.overviewmapStore.expandFactor,i=this.zoomMapTo(e.expand(t),void 0,!1),a=this.overviewGraphicLayer.getLocalGraphic("overview-graphic");return this.overviewGraphicLayer.removeGraphic(a),a.geometry=e,this.overviewGraphicLayer.addGraphic(a),i}async cursorHitTest(e){return(await this.esriView.hitTest(e)).results.length>0}}class X extends O{_parseConfig(e){const t=m(this.$vApp.$pinia);t.basemaps=e?.basemaps||{},t.mapConfig.basemaps=e?Object.values(e.basemaps):[],t.startMinimized=e?.startMinimized??!0,t.expandFactor=e?.expandFactor??1.5,t.borderColour=e?.borderColour??"#FF0000",t.borderWidth=e?.borderWidth??1,t.areaColour=e?.areaColour??"#000000",t.areaOpacity=e?.areaOpacity??.25}get config(){return super.config}}const J={class:"relative h-full w-full overflow-hidden"},Q={class:"absolute h-30 w-30 top-0 right-0"},ee=["content","aria-label"],ae=I({__name:"overviewmap",setup(w){const e=m(),{t}=R(),i=F("iApi"),a=$(),h=f(),n=l(()=>a.activeBasemapConfig),A=l(()=>e.mapConfig),b=l(()=>e.basemaps),S=l(()=>e.startMinimized);let r=M(new U(i));const o=f(!0),E=f(!1),c=M([]);T(async()=>{await i.geo.map.viewPromise,u(),await r.createMap(A.value,h.value.querySelector(".overviewmap")),await r.viewPromise,await r.addMapGraphicLayer(),o.value=S.value;let p=r.updateOverview(i.geo.map.getExtent());c.push(i.event.on(d.MAP_EXTENTCHANGE,k(100,s=>{p.then(()=>{r.updateOverview(s)})}))),c.push(i.event.on(d.MAP_CREATED,()=>{u()})),c.push(i.event.on(d.MAP_REFRESH_END,()=>{u()})),c.push(i.event.on(d.MAP_BASEMAPCHANGE,async s=>{!s.schemaChanged&&r.created&&n.value&&b.value[n.value.tileSchemaId]===void 0&&(await r.removeMapGraphicLayer(),await r.setBasemap(s.basemapId),await r.addMapGraphicLayer())}))}),z(()=>{c.forEach(p=>i.event.off(p)),r.destroyMap()});const V=async p=>{E.value=!o.value&&await r.cursorHitTest(p)},C=()=>({height:`${o.value?48:200}px`,width:`${o.value?48:200}px`}),_=()=>({top:`${o.value?-6:-3}px`,right:`${o.value?-6:-3}px`,transform:`rotate(${o.value?225:45}deg)`}),u=()=>{if(!n.value){console.error("Overview Map could not obtain the basemap config used by the main map");return}try{const p=n.value?.tileSchemaId;if(!p)throw new Error("Overview Map could not obtain the tile schema of the main map");const s=b.value[p];if(!s)throw new Error("Overview Map could not find a suitable basemap that matches the tile schema of the main map");r.created?r.viewPromise.then(()=>r.setBasemap(s.id)):e.updateInitialBasemap(s.id)}catch{r.created||e.updateInitialBasemap(n.value.id),r.viewPromise.then(()=>r.setBasemap(n.value.id))}};return(p,s)=>{const B=D("tippy");return y(),g("div",{class:"relative",ref_key:"el",ref:h},[v("div",{style:L(C()),class:"pointer-events-auto absolute top-0 right-0 mt-12 mr-12 shadow-tm border-4 border-solid border-white bg-white transition-all duration-300 ease-out"},[v("div",J,[v("div",{class:H(["overviewmap absolute top-0 right-0 h-192 w-192",{"cursor-move":E.value}]),onMousemove:V},null,34)]),v("div",Q,[N((y(),g("button",{type:"button",tabindex:"0",class:"cursor-pointer absolute h-full w-full",onClick:s[0]||(s[0]=re=>o.value=!o.value),content:x(t)(o.value?"overviewmap.expand":"overviewmap.minimize"),"aria-label":x(t)(o.value?"overviewmap.expand":"overviewmap.minimize")},[(y(),g("svg",{class:"absolute fill-current text-gray-500 transition-all duration-300 ease-out",style:L(_()),xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},s[1]||(s[1]=[v("g",{id:"apple-keyboard-control"},[v("path",{d:"M 19.7782,11.7782L 18.364,13.1924L 12,6.82843L 5.63604,13.1924L 4.22183,11.7782L 12,4L 19.7782,11.7782 Z "})],-1)]),4))],8,ee)),[[B,{placement:"left",hideOnClick:!1}]])])],4)],512)}}}),te=P(ae,[["__scopeId","data-v-cee79589"]]),ie={en:{"overviewmap.expand":"Expand Overview","overviewmap.minimize":"Minimize Overview"},fr:{"overviewmap.expand":"Développer l'aperçu","overviewmap.minimize":"Réduire l'aperçu"}};class ne extends X{added(){Object.entries(ie).forEach(a=>this.$iApi.$i18n.mergeLocaleMessage(...a)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,a=>this._parseConfig(a)),{destroy:t,el:i}=this.mount(te,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(i.childNodes[0]),this.removed=()=>{e(),t(),m(this.$vApp.$pinia).$reset()}}}export{ne as default}; +import{eT as I,eU as P,g1 as m,fq as O,eX as R,eY as F,fN as $,f6 as f,eZ as l,fY as M,f8 as T,eV as d,fZ as k,f9 as z,fa as D,e$ as y,fb as g,f2 as v,f3 as H,fc as N,f4 as x,fF as L,g2 as q,fK as W,fu as G,g3 as Z,f$ as K,g4 as Y,g5 as j}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";class U extends q{overviewGraphicLayer;overviewmapStore;constructor(e){super(e),this.overviewGraphicLayer=this.$iApi.geo.layer.createLayer({id:"RampOverviewGraphic",layerType:W.GRAPHIC,url:"",cosmetic:!0}),this.overviewmapStore=m(this.$vApp.$pinia)}async createMapView(e){if(!e)throw new Error("Attempted to create overview map view without a basemap");const t=typeof e=="string"?await this.findBasemap(e):e;await this.applyBasemap(t),this._rampExtentSet=this.$iApi.geo.map.getExtentSet().clone(),this._rampSR=this._rampExtentSet.sr.clone();const i=this.overviewmapStore.expandFactor;this.esriView=G(await Z.MapView({map:this.esriMap,container:this._targetDiv,constraints:{rotationEnabled:!1},spatialReference:this._rampSR.toESRI(),extent:this.$iApi.geo.map.getExtent().toESRI().expand(i)})),this.esriView.ui.components=[],this.handlers.push({type:"mouse-wheel",handler:this.esriView.on("mouse-wheel",a=>{a.stopPropagation()})}),this.handlers.push({type:"double-click",handler:this.esriView.on("double-click",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-down",handler:this.esriView.on("key-down",a=>{a.stopPropagation()})}),this.handlers.push({type:"key-up",handler:this.esriView.on("key-up",a=>{a.stopPropagation()})}),this.handlers.push({type:"drag",handler:this.esriView.on("drag",a=>{a.stopPropagation(),this.mapDrag(a)})}),this.esriView.container.addEventListener("touchmove",a=>{a.preventDefault()}),this.esriView.watch("fatalError",()=>{const a=new IntersectionObserver(h=>{h.forEach(n=>{n.isIntersecting&&(this.esriView?.tryFatalErrorRecovery(),a.disconnect())})});a.observe(this.esriView.container)}),this.esriView.when(()=>{this._viewPromise.resolveMe(),this.created=!0})}async addMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}const e=new K(this.$iApi.geo.map.getExtent(),"overview-graphic"),t=this.overviewmapStore.borderColour??"#FF0000",i=this.overviewmapStore.borderWidth??1,a=this.overviewmapStore.areaColour??"#000000",h=this.overviewmapStore.areaOpacity??.25,n=`${a}${Math.round(h*255).toString(16)}`;e.style=new Y({fill:{colour:n},outline:{colour:t,width:i}}),await this.overviewGraphicLayer.initiate(),await this.overviewGraphicLayer.addGraphic(e),this.esriMap?.add(this.overviewGraphicLayer.esriLayer)}async removeMapGraphicLayer(){if(!this.esriMap){this.noMapErr();return}if(!this.overviewGraphicLayer.esriLayer)throw new Error("Attempted to remove layer from the map without an esri layer. Likely layer.initiate() was not called or had not finished.");this.overviewGraphicLayer.removeGraphic(),this.esriMap.remove(this.overviewGraphicLayer.esriLayer),await this.overviewGraphicLayer.terminate()}destroyMapView(){this.esriView?.container.removeEventListener("touchmove",e=>{e.preventDefault()}),super.destroyMapView()}async findBasemap(e){const t=this._basemapStore.find(i=>i.id===e);if(t)return t;{const i=$(this.$vApp.$pinia).config.map;if(i){const a=i.basemaps.find(h=>h.id===e);if(a)return j.create(a)}}throw new Error(`Invalid basemap id requested: ${e}`)}async setBasemap(e){if(!this.esriView||!this.esriMap)return this.noMapErr(),!1;const t=await this.findBasemap(e),i=(this.getCurrentBasemapId()?await this.findBasemap(this.getCurrentBasemapId()):void 0)?.tileSchemaId!==t.tileSchemaId;return i?(this.destroyMapView(),await this.createMapView(t)):await this.applyBasemap(t),i}startExtent=null;async mapDrag(e){if(e.native.pointerType==="mouse"){if(e.action==="start")await this.cursorHitTest(e)&&(this.startExtent=G(this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry));else if(this.startExtent){const t=this.esriView.toMap(e.origin),i=this.esriView.toMap({x:e.x,y:e.y}),a=this.startExtent.clone().offset(i.x-t.x,i.y-t.y,0);this.overviewGraphicLayer.getEsriGraphic("overview-graphic").geometry=a,e.action==="end"&&(this.$iApi.geo.map.zoomMapTo(this.$iApi.geo.geom.geomEsriToRamp(a),void 0,!1),this.startExtent=null)}}}updateOverview(e){const t=this.overviewmapStore.expandFactor,i=this.zoomMapTo(e.expand(t),void 0,!1),a=this.overviewGraphicLayer.getLocalGraphic("overview-graphic");return this.overviewGraphicLayer.removeGraphic(a),a.geometry=e,this.overviewGraphicLayer.addGraphic(a),i}async cursorHitTest(e){return(await this.esriView.hitTest(e)).results.length>0}}class X extends O{_parseConfig(e){const t=m(this.$vApp.$pinia);t.basemaps=e?.basemaps||{},t.mapConfig.basemaps=e?Object.values(e.basemaps):[],t.startMinimized=e?.startMinimized??!0,t.expandFactor=e?.expandFactor??1.5,t.borderColour=e?.borderColour??"#FF0000",t.borderWidth=e?.borderWidth??1,t.areaColour=e?.areaColour??"#000000",t.areaOpacity=e?.areaOpacity??.25}get config(){return super.config}}const J={class:"relative h-full w-full overflow-hidden"},Q={class:"absolute h-30 w-30 top-0 right-0"},ee=["content","aria-label"],ae=I({__name:"overviewmap",setup(w){const e=m(),{t}=R(),i=F("iApi"),a=$(),h=f(),n=l(()=>a.activeBasemapConfig),A=l(()=>e.mapConfig),b=l(()=>e.basemaps),S=l(()=>e.startMinimized);let r=M(new U(i));const o=f(!0),E=f(!1),c=M([]);T(async()=>{await i.geo.map.viewPromise,u(),await r.createMap(A.value,h.value.querySelector(".overviewmap")),await r.viewPromise,await r.addMapGraphicLayer(),o.value=S.value;let p=r.updateOverview(i.geo.map.getExtent());c.push(i.event.on(d.MAP_EXTENTCHANGE,k(100,s=>{p.then(()=>{r.updateOverview(s)})}))),c.push(i.event.on(d.MAP_CREATED,()=>{u()})),c.push(i.event.on(d.MAP_REFRESH_END,()=>{u()})),c.push(i.event.on(d.MAP_BASEMAPCHANGE,async s=>{!s.schemaChanged&&r.created&&n.value&&b.value[n.value.tileSchemaId]===void 0&&(await r.removeMapGraphicLayer(),await r.setBasemap(s.basemapId),await r.addMapGraphicLayer())}))}),z(()=>{c.forEach(p=>i.event.off(p)),r.destroyMap()});const V=async p=>{E.value=!o.value&&await r.cursorHitTest(p)},C=()=>({height:`${o.value?48:200}px`,width:`${o.value?48:200}px`}),_=()=>({top:`${o.value?-6:-3}px`,right:`${o.value?-6:-3}px`,transform:`rotate(${o.value?225:45}deg)`}),u=()=>{if(!n.value){console.error("Overview Map could not obtain the basemap config used by the main map");return}try{const p=n.value?.tileSchemaId;if(!p)throw new Error("Overview Map could not obtain the tile schema of the main map");const s=b.value[p];if(!s)throw new Error("Overview Map could not find a suitable basemap that matches the tile schema of the main map");r.created?r.viewPromise.then(()=>r.setBasemap(s.id)):e.updateInitialBasemap(s.id)}catch{r.created||e.updateInitialBasemap(n.value.id),r.viewPromise.then(()=>r.setBasemap(n.value.id))}};return(p,s)=>{const B=D("tippy");return y(),g("div",{class:"relative",ref_key:"el",ref:h},[v("div",{style:L(C()),class:"pointer-events-auto absolute top-0 right-0 mt-12 mr-12 shadow-tm border-4 border-solid border-white bg-white transition-all duration-300 ease-out"},[v("div",J,[v("div",{class:H(["overviewmap absolute top-0 right-0 h-192 w-192",{"cursor-move":E.value}]),onMousemove:V},null,34)]),v("div",Q,[N((y(),g("button",{type:"button",tabindex:"0",class:"cursor-pointer absolute h-full w-full",onClick:s[0]||(s[0]=re=>o.value=!o.value),content:x(t)(o.value?"overviewmap.expand":"overviewmap.minimize"),"aria-label":x(t)(o.value?"overviewmap.expand":"overviewmap.minimize")},[(y(),g("svg",{class:"absolute fill-current text-gray-500 transition-all duration-300 ease-out",style:L(_()),xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},s[1]||(s[1]=[v("g",{id:"apple-keyboard-control"},[v("path",{d:"M 19.7782,11.7782L 18.364,13.1924L 12,6.82843L 5.63604,13.1924L 4.22183,11.7782L 12,4L 19.7782,11.7782 Z "})],-1)]),4))],8,ee)),[[B,{placement:"left",hideOnClick:!1}]])])],4)],512)}}}),te=P(ae,[["__scopeId","data-v-cee79589"]]),ie={en:{"overviewmap.expand":"Expand Overview","overviewmap.minimize":"Minimize Overview"},fr:{"overviewmap.expand":"Développer l'aperçu","overviewmap.minimize":"Réduire l'aperçu"}};class ne extends X{added(){Object.entries(ie).forEach(a=>this.$iApi.$i18n.mergeLocaleMessage(...a)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,a=>this._parseConfig(a)),{destroy:t,el:i}=this.mount(te,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(i.childNodes[0]),this.removed=()=>{e(),t(),m(this.$vApp.$pinia).$reset()}}}export{ne as default}; diff --git a/custom-toc-highlight/assets/index-Czft7XuG-o1pa2FUA.js b/custom-toc-highlight/assets/index-Czft7XuG-BLbk_j4S.js similarity index 96% rename from custom-toc-highlight/assets/index-Czft7XuG-o1pa2FUA.js rename to custom-toc-highlight/assets/index-Czft7XuG-BLbk_j4S.js index 20636cb6..00924dc6 100644 --- a/custom-toc-highlight/assets/index-Czft7XuG-o1pa2FUA.js +++ b/custom-toc-highlight/assets/index-Czft7XuG-BLbk_j4S.js @@ -1 +1 @@ -import{eT as p,eU as d,g6 as i,eX as g,eY as u,f6 as v,eZ as h,f8 as f,eV as $,f9 as m,e$ as A,fb as b,f2 as w,fg as _,f4 as C,fq as E}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";const y={en:{"scrollguard.instructions":"Use ctrl + scroll to zoom the map"},fr:{"scrollguard.instructions":"Utilisez les touches Ctrl et + pour faire un zoom de la carte"}},q={class:"sg-label"},L=p({__name:"map-scrollguard",setup(o){const e=i(),{t:r}=g(),s=u("iApi"),t=v(),c=h(()=>e.enabled);f(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0}),s.event.on($.MAP_CREATED,()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0})})}),m(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.removeEventListener("wheel",l,{capture:!0})});const l=n=>{if(!c.value)return;const a=t.value.classList;n.ctrlKey?(a.remove("sg-active"),a.add("sg-scrolling")):(n.stopPropagation(),a.remove("sg-scrolling"),a.add("sg-active"),window.setTimeout(()=>a.remove("sg-active"),2e3))};return(n,a)=>(A(),b("div",{class:"sg",ref_key:"scrollGuard",ref:t},[w("p",q,_(C(r)("scrollguard.instructions")),1)],512))}}),x=d(L,[["__scopeId","data-v-bf6386a4"]]);class z extends E{setEnabled(e){i(this.$vApp.$pinia).enabled=e}_parseConfig(e){i(this.$vApp.$pinia).enabled=e?.enabled||!1}get config(){return super.config}}class N extends z{added(){Object.entries(y).forEach(t=>this.$iApi.$i18n.mergeLocaleMessage(...t)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t)),{destroy:r,el:s}=this.mount(x,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e(),r(),i(this.$vApp.$pinia).$reset()}}}export{N as default}; +import{eT as p,eU as d,g6 as i,eX as g,eY as u,f6 as v,eZ as h,f8 as f,eV as $,f9 as m,e$ as A,fb as b,f2 as w,fg as _,f4 as C,fq as E}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";const y={en:{"scrollguard.instructions":"Use ctrl + scroll to zoom the map"},fr:{"scrollguard.instructions":"Utilisez les touches Ctrl et + pour faire un zoom de la carte"}},q={class:"sg-label"},L=p({__name:"map-scrollguard",setup(o){const e=i(),{t:r}=g(),s=u("iApi"),t=v(),c=h(()=>e.enabled);f(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0}),s.event.on($.MAP_CREATED,()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.addEventListener("wheel",l,{capture:!0})})}),m(()=>{s.$vApp.$el.querySelector(".inner-shell + .esri-view")?.removeEventListener("wheel",l,{capture:!0})});const l=n=>{if(!c.value)return;const a=t.value.classList;n.ctrlKey?(a.remove("sg-active"),a.add("sg-scrolling")):(n.stopPropagation(),a.remove("sg-scrolling"),a.add("sg-active"),window.setTimeout(()=>a.remove("sg-active"),2e3))};return(n,a)=>(A(),b("div",{class:"sg",ref_key:"scrollGuard",ref:t},[w("p",q,_(C(r)("scrollguard.instructions")),1)],512))}}),x=d(L,[["__scopeId","data-v-bf6386a4"]]);class z extends E{setEnabled(e){i(this.$vApp.$pinia).enabled=e}_parseConfig(e){i(this.$vApp.$pinia).enabled=e?.enabled||!1}get config(){return super.config}}class N extends z{added(){Object.entries(y).forEach(t=>this.$iApi.$i18n.mergeLocaleMessage(...t)),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t)),{destroy:r,el:s}=this.mount(x,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e(),r(),i(this.$vApp.$pinia).$reset()}}}export{N as default}; diff --git a/custom-toc-highlight/assets/index-DDW2D8Uj-C3tgdysx.js b/custom-toc-highlight/assets/index-DDW2D8Uj-BucO7Mr0.js similarity index 86% rename from custom-toc-highlight/assets/index-DDW2D8Uj-C3tgdysx.js rename to custom-toc-highlight/assets/index-DDW2D8Uj-BucO7Mr0.js index a114430b..b31cd533 100644 --- a/custom-toc-highlight/assets/index-DDW2D8Uj-C3tgdysx.js +++ b/custom-toc-highlight/assets/index-DDW2D8Uj-BucO7Mr0.js @@ -1 +1 @@ -import{fu as r,eW as a,fv as s,fq as n}from"./story-BfX8CRfG.js";import o from"./screen-bYjBkDBU-C7Z9GxGM.js";import"./main-ugzBrWNm.js";const p={en:{"areas-of-interest.title":"Areas of Interest","areas-of-interest.select":"Select area of interest"},fr:{"areas-of-interest.title":"Zones d'intérêt","areas-of-interest.select":"Sélectionner la zone d'intérêt"}};class f extends n{get config(){return super.config}_parseConfig(e){if(!e)return;const t=s(this.$vApp.$pinia);t.areas=e.areas,this.handlePanelTeleports(["areas-of-interest"])}}class g extends f{added(){this.$iApi.panel.register({"areas-of-interest":{screens:{"areas-of-interest-screen":r(o)},style:{width:"350px"},button:{tooltip:"areas-of-interest.title",icon:''},alertName:"areas-of-interest.title"}},{i18n:{messages:p}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&a(this.$vApp.$pinia).removeButton("areas-of-interest"),this.$iApi.panel.remove("areas-of-interest"),s(this.$vApp.$pinia).$reset()}}}export{g as default}; +import{fu as r,eW as a,fv as s,fq as n}from"./story-Doly9N9p.js";import o from"./screen-bYjBkDBU-CqvHQESh.js";import"./main-QGPoLsvl.js";const p={en:{"areas-of-interest.title":"Areas of Interest","areas-of-interest.select":"Select area of interest"},fr:{"areas-of-interest.title":"Zones d'intérêt","areas-of-interest.select":"Sélectionner la zone d'intérêt"}};class f extends n{get config(){return super.config}_parseConfig(e){if(!e)return;const t=s(this.$vApp.$pinia);t.areas=e.areas,this.handlePanelTeleports(["areas-of-interest"])}}class g extends f{added(){this.$iApi.panel.register({"areas-of-interest":{screens:{"areas-of-interest-screen":r(o)},style:{width:"350px"},button:{tooltip:"areas-of-interest.title",icon:''},alertName:"areas-of-interest.title"}},{i18n:{messages:p}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&a(this.$vApp.$pinia).removeButton("areas-of-interest"),this.$iApi.panel.remove("areas-of-interest"),s(this.$vApp.$pinia).$reset()}}}export{g as default}; diff --git a/custom-toc-highlight/assets/index-DH-yVcMF-BUFT5eJ2.js b/custom-toc-highlight/assets/index-DH-yVcMF-o6W3s-NP.js similarity index 96% rename from custom-toc-highlight/assets/index-DH-yVcMF-BUFT5eJ2.js rename to custom-toc-highlight/assets/index-DH-yVcMF-o6W3s-NP.js index d54d2e65..d216063e 100644 --- a/custom-toc-highlight/assets/index-DH-yVcMF-BUFT5eJ2.js +++ b/custom-toc-highlight/assets/index-DH-yVcMF-o6W3s-NP.js @@ -1 +1 @@ -import{eT as w,eU as E,fq as y,eX as T,eY as _,f6 as h,fY as f,f8 as M,eV as p,f9 as A,e$ as x,fb as R,f2 as $,fg as I,f4 as P}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";const D={en:{"panguard.instructions":"Use two fingers to pan the map"},fr:{"panguard.instructions":"Utilisez deux doigts pour faire un panoramique de la carte"}},L={class:"pg-label"},S=w({__name:"map-panguard",setup(m){const{t:r}=T(),t=_("iApi"),s=h(),u=h(-1),o=f([]),n=f([]);M(()=>{c(),n.push(t.event.on(p.MAP_CREATED,()=>{c()})),n.push(t.event.on(p.MAP_DESTROYED,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(p.MAP_REFRESH_START,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(p.MAP_REFRESH_END,()=>{c()}))}),A(()=>{n.forEach(e=>t.event.off(e)),o.forEach(e=>e.remove())});const c=()=>{const e=new Map;t.geo.map.viewPromise.then(()=>{o.push(t.geo.map.esriView.on("pointer-down",a=>{a.pointerType==="touch"&&e.set(a.pointerId,{x:a.x,y:a.y})})),o.push(t.geo.map.esriView.on(["pointer-up","pointer-leave"],a=>{a.pointerType==="touch"&&window.setTimeout(()=>{e.delete(a.pointerId)},200)})),o.push(t.geo.map.esriView.on("pointer-move",a=>{const{pointerId:v,pointerType:g,x:l,y:d}=a,i=e.get(v);if(!i||g!=="touch"||e.size!==1){s.value.classList.remove("pg-active");return}Math.sqrt(Math.pow(l-i.x,2)+Math.pow(d-i.y,2))<20||(s.value.classList.add("pg-active"),u.value!==-1&&clearTimeout(u.value),u.value=window.setTimeout(()=>{s.value.classList.remove("pg-active")},2e3),window.scrollBy(i.x-l,i.y-d))}))})};return(e,a)=>(x(),R("div",{class:"pg",ref_key:"panGuard",ref:s},[$("p",L,I(P(r)("panguard.instructions")),1)],512))}}),V=E(S,[["__scopeId","data-v-e91f9000"]]);class C extends y{added(){Object.entries(D).forEach(s=>this.$iApi.$i18n.mergeLocaleMessage(...s));const{destroy:r,el:t}=this.mount(V,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this.removed=()=>{r()}}}export{C as default}; +import{eT as w,eU as E,fq as y,eX as T,eY as _,f6 as h,fY as f,f8 as M,eV as p,f9 as A,e$ as x,fb as R,f2 as $,fg as I,f4 as P}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";const D={en:{"panguard.instructions":"Use two fingers to pan the map"},fr:{"panguard.instructions":"Utilisez deux doigts pour faire un panoramique de la carte"}},L={class:"pg-label"},S=w({__name:"map-panguard",setup(m){const{t:r}=T(),t=_("iApi"),s=h(),u=h(-1),o=f([]),n=f([]);M(()=>{c(),n.push(t.event.on(p.MAP_CREATED,()=>{c()})),n.push(t.event.on(p.MAP_DESTROYED,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(p.MAP_REFRESH_START,()=>{o.forEach(e=>e.remove())})),n.push(t.event.on(p.MAP_REFRESH_END,()=>{c()}))}),A(()=>{n.forEach(e=>t.event.off(e)),o.forEach(e=>e.remove())});const c=()=>{const e=new Map;t.geo.map.viewPromise.then(()=>{o.push(t.geo.map.esriView.on("pointer-down",a=>{a.pointerType==="touch"&&e.set(a.pointerId,{x:a.x,y:a.y})})),o.push(t.geo.map.esriView.on(["pointer-up","pointer-leave"],a=>{a.pointerType==="touch"&&window.setTimeout(()=>{e.delete(a.pointerId)},200)})),o.push(t.geo.map.esriView.on("pointer-move",a=>{const{pointerId:v,pointerType:g,x:l,y:d}=a,i=e.get(v);if(!i||g!=="touch"||e.size!==1){s.value.classList.remove("pg-active");return}Math.sqrt(Math.pow(l-i.x,2)+Math.pow(d-i.y,2))<20||(s.value.classList.add("pg-active"),u.value!==-1&&clearTimeout(u.value),u.value=window.setTimeout(()=>{s.value.classList.remove("pg-active")},2e3),window.scrollBy(i.x-l,i.y-d))}))})};return(e,a)=>(x(),R("div",{class:"pg",ref_key:"panGuard",ref:s},[$("p",L,I(P(r)("panguard.instructions")),1)],512))}}),V=E(S,[["__scopeId","data-v-e91f9000"]]);class C extends y{added(){Object.entries(D).forEach(s=>this.$iApi.$i18n.mergeLocaleMessage(...s));const{destroy:r,el:t}=this.mount(V,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this.removed=()=>{r()}}}export{C as default}; diff --git a/custom-toc-highlight/assets/index-DLWeBByc-q_J35KkL.js b/custom-toc-highlight/assets/index-DLWeBByc-DDoUT1cR.js similarity index 95% rename from custom-toc-highlight/assets/index-DLWeBByc-q_J35KkL.js rename to custom-toc-highlight/assets/index-DLWeBByc-DDoUT1cR.js index 2eede9e9..e99cb1f4 100644 --- a/custom-toc-highlight/assets/index-DLWeBByc-q_J35KkL.js +++ b/custom-toc-highlight/assets/index-DLWeBByc-DDoUT1cR.js @@ -1 +1 @@ -import{fq as k}from"./story-BfX8CRfG.js";import{a}from"./fabric-Df28hv38-CC2TWXwY.js";import"./main-ugzBrWNm.js";const _=30,C=20,T=16,F=12,P=8,f=32,S=32,G=350,w=20,g="Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif";class Y extends k{get config(){return this.$iApi.fixture.get("export").config?.legend}async make(r){const n=this.$iApi.geo.layer.allLayersOnMap().filter(o=>!o.isCosmetic);if(n.length===0)return new a.fabric.Group([],{originX:"left"});const t=Math.min(n.length,Math.floor(r.width/(G+w))||1),e=(r.width-(t-1)*w)/t;let i=0;const s=(await Promise.all(this._makeSegments(n,e))).map(({title:o,items:m},c)=>{c>0&&(i+=_),o.top=i,i+=o.height+C;const b=m.map(({title:h,items:u},x)=>{const y=[];return h&&!(m.length===1&&h.text===o.text)&&(x>0&&(i+=T),h.top=i,i+=h.height+F,y.push(h)),u.forEach(p=>{p.top=i,i+=p.height+P}),[...y,...u].filter(p=>p)});return new a.fabric.Group([o,...b.flat()])}).flat(),l=this._makeColumns(s,e,t);return Promise.resolve(l)}_makeColumns(r,n,t){let e=0,i=0,s=0;const l=r[r.length-1].aCoords.bl.y/t;return r.forEach((o,m)=>{const c=m!==r.length-1?r[m+1].top-o.top:o.height,b=s>l*(e+1),h=i!==0&&c>l,u=t-e>r.length-m;(b||h||u)&&e{const e=new a.fabric.Textbox(t.name,{fontSize:24,fontFamily:g,width:n}),i=this._getLayerTreeIds(t);let s=[];return s=t.supportsSublayers?await Promise.all(this._makeSegmentChunks(i,t,n)):await Promise.all(this._makeSegmentChunks([-1],t,n)),{title:e,items:s}})}_makeSegmentChunks(r,n,t){const e=n;return r.map(async i=>{const s=i===-1?e:e.getSublayer(i);if(!s)return{title:new a.fabric.Textbox("ERROR",{fontSize:20,fontFamily:g,width:t}),items:[]};await Promise.all(s.legend.map(c=>c.drawPromise));const l=s.legend,o=new a.fabric.Textbox(s.name,{fontSize:20,fontFamily:g,width:t}),m=await Promise.all(this._makeChunkItems(l,t));return{title:o,items:m}})}_makeChunkItems(r,n){return r.map(async t=>{const e=(await I(a.fabric.loadSVGFromString)(t.svgcode))[0];if(t.esriStandard){e.originY="center",e.top=f/2;const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:S+20,top:f/2,width:n-S-20});return new a.fabric.Group([e,i],{height:f})}else{const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:0,top:f/2,width:n}),s=Number(t.imgWidth),l=Number(t.imgHeight),o=Math.min(1,n/s);return e&&(e.originY="center",e.top=l*o/2+f,e.scaleToHeight(l*o),e.scaleToWidth(s*o)),new a.fabric.Group([i,e].filter(Boolean),{height:l*o+f})}})}_getLayerTreeIds(r){const n=[],t=[...r.sublayers];for(;t.length>0;){const e=t.shift();e&&(e.visibility&&n.push(e.layerIdx),t.push(...e.sublayers))}return n}}const I=d=>r=>new Promise(n=>{d(r,t=>{n(t)})});export{Y as default}; +import{fq as k}from"./story-Doly9N9p.js";import{a}from"./fabric-Df28hv38-DoClkw8Q.js";import"./main-QGPoLsvl.js";const _=30,C=20,T=16,F=12,P=8,f=32,S=32,G=350,w=20,g="Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif";class Y extends k{get config(){return this.$iApi.fixture.get("export").config?.legend}async make(r){const n=this.$iApi.geo.layer.allLayersOnMap().filter(o=>!o.isCosmetic);if(n.length===0)return new a.fabric.Group([],{originX:"left"});const t=Math.min(n.length,Math.floor(r.width/(G+w))||1),e=(r.width-(t-1)*w)/t;let i=0;const s=(await Promise.all(this._makeSegments(n,e))).map(({title:o,items:m},c)=>{c>0&&(i+=_),o.top=i,i+=o.height+C;const b=m.map(({title:h,items:u},x)=>{const y=[];return h&&!(m.length===1&&h.text===o.text)&&(x>0&&(i+=T),h.top=i,i+=h.height+F,y.push(h)),u.forEach(p=>{p.top=i,i+=p.height+P}),[...y,...u].filter(p=>p)});return new a.fabric.Group([o,...b.flat()])}).flat(),l=this._makeColumns(s,e,t);return Promise.resolve(l)}_makeColumns(r,n,t){let e=0,i=0,s=0;const l=r[r.length-1].aCoords.bl.y/t;return r.forEach((o,m)=>{const c=m!==r.length-1?r[m+1].top-o.top:o.height,b=s>l*(e+1),h=i!==0&&c>l,u=t-e>r.length-m;(b||h||u)&&e{const e=new a.fabric.Textbox(t.name,{fontSize:24,fontFamily:g,width:n}),i=this._getLayerTreeIds(t);let s=[];return s=t.supportsSublayers?await Promise.all(this._makeSegmentChunks(i,t,n)):await Promise.all(this._makeSegmentChunks([-1],t,n)),{title:e,items:s}})}_makeSegmentChunks(r,n,t){const e=n;return r.map(async i=>{const s=i===-1?e:e.getSublayer(i);if(!s)return{title:new a.fabric.Textbox("ERROR",{fontSize:20,fontFamily:g,width:t}),items:[]};await Promise.all(s.legend.map(c=>c.drawPromise));const l=s.legend,o=new a.fabric.Textbox(s.name,{fontSize:20,fontFamily:g,width:t}),m=await Promise.all(this._makeChunkItems(l,t));return{title:o,items:m}})}_makeChunkItems(r,n){return r.map(async t=>{const e=(await I(a.fabric.loadSVGFromString)(t.svgcode))[0];if(t.esriStandard){e.originY="center",e.top=f/2;const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:S+20,top:f/2,width:n-S-20});return new a.fabric.Group([e,i],{height:f})}else{const i=new a.fabric.Textbox(t.label,{fontSize:12,fontFamily:g,originY:"center",left:0,top:f/2,width:n}),s=Number(t.imgWidth),l=Number(t.imgHeight),o=Math.min(1,n/s);return e&&(e.originY="center",e.top=l*o/2+f,e.scaleToHeight(l*o),e.scaleToWidth(s*o)),new a.fabric.Group([i,e].filter(Boolean),{height:l*o+f})}})}_getLayerTreeIds(r){const n=[],t=[...r.sublayers];for(;t.length>0;){const e=t.shift();e&&(e.visibility&&n.push(e.layerIdx),t.push(...e.sublayers))}return n}}const I=d=>r=>new Promise(n=>{d(r,t=>{n(t)})});export{Y as default}; diff --git a/custom-toc-highlight/assets/index-DMxHNnSm-CqvPwsqc.js b/custom-toc-highlight/assets/index-DMxHNnSm-Dbw9Xbwt.js similarity index 97% rename from custom-toc-highlight/assets/index-DMxHNnSm-CqvPwsqc.js rename to custom-toc-highlight/assets/index-DMxHNnSm-Dbw9Xbwt.js index cab0676a..ad8759f0 100644 --- a/custom-toc-highlight/assets/index-DMxHNnSm-CqvPwsqc.js +++ b/custom-toc-highlight/assets/index-DMxHNnSm-Dbw9Xbwt.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DTrOvIb7-BtDirMSz.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-BfX8CRfG.js","./story-D5JOvNzl.css"])))=>i.map(i=>d[i]); -import{_ as c}from"./main-ugzBrWNm.js";import{eT as y,fu as u,eW as m,fw as f,fQ as a,fq as v,fR as L,fS as s,fT as x,fU as g,fK as b,eX as I,eY as E,e_ as A,e$ as $,f0 as w,f1 as _,f2 as h,f4 as C}from"./story-BfX8CRfG.js";class S extends v{_parseConfig(e){const l=e?.headerControls?.slice()??["wizard","layerReorder","groupToggle","visibilityToggle"];if(a(this.$vApp.$pinia).headerControls=l,!e||!e.root.children)return;a(this.$vApp.$pinia).multilineItems=e.multilineItems?.enabled??!0;const t=[1,2,3,4,5,6];!e.multilineItems?.maxLines||!t.includes(e.multilineItems?.maxLines)?a(this.$vApp.$pinia).maxLines=3:a(this.$vApp.$pinia).maxLines=e.multilineItems.maxLines,this.handlePanelWidths(["legend"]),this.handlePanelTeleports(["legend"]);const i=this.getLayerFixtureConfigs();e.root.children.forEach(r=>{r.layerLegendConfigs=i,this.addItem(r)}),this.$iApi.geo.layer.allLayers().forEach(r=>{this.updateLegend(r)})}createItem(e,l){let t;e.layerId===void 0?t=new L(this.$iApi,e,l):(e.sublayerIndex!==void 0&&(e.layerId=`${e.layerId}-${e.sublayerIndex}`),t=new s(this.$iApi,e,l));const i=e.children;return i&&i.forEach(r=>{e.layerLegendConfigs!==void 0&&(r.layerLegendConfigs=e.layerLegendConfigs),t.children.push(this.createItem(r,t))}),t}addItem(e,l){const t=e instanceof x?e:this.createItem(e,l);return this._insertItem(t,l),t}async addLayerItem(e,l){const t=new s(this.$iApi,{layerId:e.id,sublayerIndex:e.isSublayer?e.layerIdx:void 0,name:e.name},l);return this._insertItem(t,l),this.updateLegend(e),t}get config(){return super.config}getLegend(){return a(this.$vApp.$pinia).children||[]}getLegendConfig(){return{root:{children:this.getLegend().map(e=>e.getConfig())}}}getItem(e){const l=this.getLegend();let t;return l.some(i=>(t=this.searchTreeFirst(i,r=>r.uid===e),t!==void 0)),t}getLayerItem(e){let l,t,i;return typeof e=="string"?(t=e,l=e):(t=e.id,l=e.uid),this.getLegend().some(r=>(i=this.searchTreeFirst(r,n=>n instanceof s&&(n.layerId===t||n.uid===l)),i!==void 0)),i}getAllExpanded(e){const l=e??!0;return this.searchLegend(t=>t.children.length>0&&t.expanded===l)}getAllVisible(e){const l=e??!0;return this.searchLegend(t=>t.visibility===l)}getLayerBoundItems(e){let l="";const t=e instanceof g?e:this.$iApi.geo.layer.getLayer(e);if(t)l=t.isSublayer?t.parentLayer?.id||"":t.id;else return[];return this.searchLegend(i=>i instanceof s&&(i.layerId===l||i.parentLayerId===l))}updateLegend(e){const l=(t,i)=>{const r=this.getLayerItem(t);i?(r&&t instanceof g&&(r.layer=t),r?.error()):r?.load(t instanceof g?t:void 0)};e.loadPromise().then(()=>{let t=this.getLayerItem(e);if(e.layerType===b.MAPIMAGE){const i=r=>{if(r.isLayerRoot&&!r.isLogicalLayer)t=this.getLayerItem(e),l(e,!1),t&&!t.treeGrown&&(r.children.map(n=>this._treeWalker(e,n)).map(n=>this.addItem(n,t)),t.treeGrown=!0),r.children.forEach(n=>i(n));else if(!r.isLayerRoot&&!r.isLogicalLayer){if(t=this.getLayerItem(`${e.id}-${r.layerIdx}`),t){const n=t.getConfig();delete n.layerId,delete n.sublayerIndex,delete n.children,n.name||delete n.name;const d={...this._treeWalker(e,r),...n},o=this.createItem(d);this._replaceItem(t,o)}r.children.forEach(n=>i(n))}else r.isLogicalLayer&&l(this._treeWalker(e,r).layer,!1)};i(e.getLayerTree())}else l(e,!1)}).catch(()=>{l(e,!0),e.supportsSublayers&&e.config.sublayers.forEach(t=>{l(`${e.id}-${t.index}`,!0)})})}expandItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{expanded:e}),i.forEach(r=>{this._toggleState(r,{expanded:e})})}showItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{visibility:e}),i.forEach(r=>{this._toggleState(r,{visibility:e})})}reloadLayerItem(e){const l=this.getLayerBoundItems(e);return l.forEach(t=>t.reload()),l.length>0}removeItem(e){const l=typeof e=="string"?this.getItem(e):e;return l!==void 0?this._deleteItem(l):!1}removeLayerItem(e){const l=this.getLayerItem(e);return l!==void 0?this._deleteItem(l):!1}searchTreeFirst(e,l){if(l(e))return e;{let t;return e.children.some(i=>(t=this.searchTreeFirst(i,l),t!==void 0)),t}}searchTreeAll(e,l){const t=[],i=[e];for(;i.length>0;){const r=i.shift();r&&l(r)&&t.push(r),r&&i.push(...r.children)}return t}searchLegend(e){return this.getLegend().map(l=>this.searchTreeAll(l,e)).flat()}_toggleState(e,l){const t=l.visibility,i=l.expanded;t!==void 0&&e.toggleVisibility(t),i!==void 0&&e.children.length>0&&e.toggleExpanded(i),e.children&&e.children.length>0&&e.children.forEach(r=>{this._toggleState(r,l)})}_insertItem(e,l){a(this.$vApp.$pinia).addItem({item:e,parent:l})}_deleteItem(e){const l=a(this.$vApp.$pinia),t=i=>{i.children.length>0&&i.children.forEach(r=>{t(r)}),i instanceof s&&i.handlers.forEach(r=>this.$iApi.event.off(r)),l.removeItem(i)};return t(e),!0}_replaceItem(e,l){a(this.$vApp.$pinia).replaceItem({oldItem:e,newItem:l})}_treeWalker(e,l,t){const i=(n=>{const d=[e];for(;d.length>0;){const o=d.shift();if(o&&o.uid===n)return o;o&&d.push(...o.sublayers)}})(l.uid),r={};return l.isLayerRoot&&!l.isLogicalLayer?(r.layer=i,r.name=i.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):!l.isLayerRoot&&!l.isLogicalLayer?(r.name=l.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):l.isLogicalLayer&&(r.layer=i,r.name=i.name,r.layerId=i.id,r.sublayerIndex=e.isSublayer?e.layerIdx:void 0),{...r,...t}}}const T=y({__name:"nav-button",setup(p){const{t:e}=I(),l=E("iApi"),t=()=>{l.panel.toggle("legend")};return(i,r)=>{const n=A("mapnav-button");return $(),w(n,{onClickFunction:t,tooltip:C(e)("legend.title")},{default:_(()=>r[0]||(r[0]=[h("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[h("path",{d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)])),_:1},8,["tooltip"])}}}),R={en:{"legend.title":"Legend","legend.header.addlayer":"Add Layer","legend.header.reorderlayers":"Reorder Layers","legend.header.groups":"Toggle Groups","legend.header.groups.expand":"Expand All","legend.header.groups.collapse":"Collapse All","legend.header.visible":"Toggle Visibility","legend.header.visible.show":"Show All","legend.header.visible.hide":"Hide All","legend.group.expand":"Expand Group","legend.group.collapse":"Collapse Group","legend.visibility.showLayer":"Show layer","legend.visibility.hideLayer":"Hide layer","legend.visibility.showSymbol":"Show symbol","legend.visibility.hideSymbol":"Hide symbol","legend.visibility.showGroup":"Show group","legend.visibility.hideGroup":"Hide group","legend.symbology.expand":"Expand legend","legend.symbology.hide":"Hide legend","legend.symbology.loading":"Loading...","legend.layer.data":"Show more data","legend.layer.data.only":"Layer not on map","legend.layer.offscale":"Layer out of scale","legend.layer.zoomToVisible":"Zoom to visible scale","legend.layer.options":"More options","legend.layer.controls.metadata":"Metadata","legend.layer.controls.settings":"Settings","legend.layer.controls.datatable":"Datatable","legend.layer.controls.symbology":"Legend","legend.layer.controls.boundaryzoom":"Zoom to Layer Boundary","legend.layer.controls.cancel":"Cancel","legend.layer.controls.remove":"Remove","legend.layer.controls.reload":"Reload","legend.layer.controls.reloadDisabled":"Layer cannot be reloaded","legend.alert.symbologyExpanded":"Layer legend expanded","legend.alert.symbologyCollapsed":"Layer legend collapsed","legend.alert.groupExpanded":"Legend group expanded","legend.alert.groupCollapsed":"Legend group collapsed","legend.alert.layerAdded":"{name} layer added to legend","legend.alert.layerRemoved":"{name} layer removed from legend"},fr:{"legend.title":"Légende","legend.header.addlayer":"Ajouter une couche","legend.header.reorderlayers":"Réorganiser les couches","legend.header.groups":"Basculer les Groupes","legend.header.groups.expand":"Élargir les groupes","legend.header.groups.collapse":"Réduire les groupes","legend.header.visible":"Basculer la Visibilité","legend.header.visible.show":"Montrer tout","legend.header.visible.hide":"Cacher tout","legend.group.expand":"Développer un groupe","legend.group.collapse":"Réduire un groupe","legend.visibility.showLayer":"Afficher la couche","legend.visibility.hideLayer":"Masquer la couche","legend.visibility.showSymbol":"Afficher le symbole","legend.visibility.hideSymbol":"Masquer le symbole","legend.visibility.showGroup":"Afficher le groupe","legend.visibility.hideGroup":"Masquer le groupe","legend.symbology.expand":"Développer la légende","legend.symbology.hide":"Masquer la légende","legend.symbology.loading":"Chargement en cours...","legend.layer.data":"Afficher plus de données","legend.layer.data.only":"Couche non visualisable","legend.layer.offscale":"Couche hors de portée","legend.layer.zoomToVisible":"Zoom sur l'échelle visible","legend.layer.options":"Plus d'options","legend.layer.controls.metadata":"Métadonnées","legend.layer.controls.settings":"Paramètres","legend.layer.controls.datatable":"Tableau de données","legend.layer.controls.symbology":"Légende","legend.layer.controls.boundaryzoom":"Zoomer à la limite","legend.layer.controls.cancel":"Annuler","legend.layer.controls.remove":"Retirer","legend.layer.controls.reload":"Recharger","legend.layer.controls.reloadDisabled":"Le calque ne peut pas être rechargé","legend.alert.symbologyExpanded":"Légende de la couche développée","legend.alert.symbologyCollapsed":"Légende de la couche réduite","legend.alert.groupExpanded":"Groupe de légende développé","legend.alert.groupCollapsed":"Groupe de légende réduit","legend.alert.layerAdded":"{name} couche ajoutée à la légende","legend.alert.layerRemoved":"Couche {name} retiré de la légende"}};class z extends S{added(){this.$iApi.component("legend-nav-button",T),this.$iApi.panel.register({legend:{screens:{"legend-screen":()=>u(c(()=>import("./screen-DTrOvIb7-BtDirMSz.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},style:{width:"350px"},alertName:"legend.title",button:{tooltip:"legend.title",icon:''}}},{i18n:{messages:R}}),this._parseConfig(this.config!==void 0?JSON.parse(JSON.stringify(this.config)):void 0);const e=this.$vApp.$watch(()=>this.config,l=>this._parseConfig(l!==void 0?JSON.parse(JSON.stringify(l)):void 0));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&m(this.$vApp.$pinia).removeButton("legend"),this.$iApi.fixture.exists("mapnav")&&f(this.$vApp.$pinia).removeItem("legend"),a().$reset(),this.$iApi.panel.remove("legend")}}}export{z as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-DTrOvIb7-CxTZcnC-.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-Doly9N9p.js","./story-DbFhYdqg.css"])))=>i.map(i=>d[i]); +import{_ as c}from"./main-QGPoLsvl.js";import{eT as y,fu as u,eW as m,fw as f,fQ as a,fq as v,fR as L,fS as s,fT as x,fU as g,fK as b,eX as I,eY as E,e_ as A,e$ as $,f0 as w,f1 as _,f2 as h,f4 as C}from"./story-Doly9N9p.js";class S extends v{_parseConfig(e){const l=e?.headerControls?.slice()??["wizard","layerReorder","groupToggle","visibilityToggle"];if(a(this.$vApp.$pinia).headerControls=l,!e||!e.root.children)return;a(this.$vApp.$pinia).multilineItems=e.multilineItems?.enabled??!0;const t=[1,2,3,4,5,6];!e.multilineItems?.maxLines||!t.includes(e.multilineItems?.maxLines)?a(this.$vApp.$pinia).maxLines=3:a(this.$vApp.$pinia).maxLines=e.multilineItems.maxLines,this.handlePanelWidths(["legend"]),this.handlePanelTeleports(["legend"]);const i=this.getLayerFixtureConfigs();e.root.children.forEach(r=>{r.layerLegendConfigs=i,this.addItem(r)}),this.$iApi.geo.layer.allLayers().forEach(r=>{this.updateLegend(r)})}createItem(e,l){let t;e.layerId===void 0?t=new L(this.$iApi,e,l):(e.sublayerIndex!==void 0&&(e.layerId=`${e.layerId}-${e.sublayerIndex}`),t=new s(this.$iApi,e,l));const i=e.children;return i&&i.forEach(r=>{e.layerLegendConfigs!==void 0&&(r.layerLegendConfigs=e.layerLegendConfigs),t.children.push(this.createItem(r,t))}),t}addItem(e,l){const t=e instanceof x?e:this.createItem(e,l);return this._insertItem(t,l),t}async addLayerItem(e,l){const t=new s(this.$iApi,{layerId:e.id,sublayerIndex:e.isSublayer?e.layerIdx:void 0,name:e.name},l);return this._insertItem(t,l),this.updateLegend(e),t}get config(){return super.config}getLegend(){return a(this.$vApp.$pinia).children||[]}getLegendConfig(){return{root:{children:this.getLegend().map(e=>e.getConfig())}}}getItem(e){const l=this.getLegend();let t;return l.some(i=>(t=this.searchTreeFirst(i,r=>r.uid===e),t!==void 0)),t}getLayerItem(e){let l,t,i;return typeof e=="string"?(t=e,l=e):(t=e.id,l=e.uid),this.getLegend().some(r=>(i=this.searchTreeFirst(r,n=>n instanceof s&&(n.layerId===t||n.uid===l)),i!==void 0)),i}getAllExpanded(e){const l=e??!0;return this.searchLegend(t=>t.children.length>0&&t.expanded===l)}getAllVisible(e){const l=e??!0;return this.searchLegend(t=>t.visibility===l)}getLayerBoundItems(e){let l="";const t=e instanceof g?e:this.$iApi.geo.layer.getLayer(e);if(t)l=t.isSublayer?t.parentLayer?.id||"":t.id;else return[];return this.searchLegend(i=>i instanceof s&&(i.layerId===l||i.parentLayerId===l))}updateLegend(e){const l=(t,i)=>{const r=this.getLayerItem(t);i?(r&&t instanceof g&&(r.layer=t),r?.error()):r?.load(t instanceof g?t:void 0)};e.loadPromise().then(()=>{let t=this.getLayerItem(e);if(e.layerType===b.MAPIMAGE){const i=r=>{if(r.isLayerRoot&&!r.isLogicalLayer)t=this.getLayerItem(e),l(e,!1),t&&!t.treeGrown&&(r.children.map(n=>this._treeWalker(e,n)).map(n=>this.addItem(n,t)),t.treeGrown=!0),r.children.forEach(n=>i(n));else if(!r.isLayerRoot&&!r.isLogicalLayer){if(t=this.getLayerItem(`${e.id}-${r.layerIdx}`),t){const n=t.getConfig();delete n.layerId,delete n.sublayerIndex,delete n.children,n.name||delete n.name;const d={...this._treeWalker(e,r),...n},o=this.createItem(d);this._replaceItem(t,o)}r.children.forEach(n=>i(n))}else r.isLogicalLayer&&l(this._treeWalker(e,r).layer,!1)};i(e.getLayerTree())}else l(e,!1)}).catch(()=>{l(e,!0),e.supportsSublayers&&e.config.sublayers.forEach(t=>{l(`${e.id}-${t.index}`,!0)})})}expandItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{expanded:e}),i.forEach(r=>{this._toggleState(r,{expanded:e})})}showItems(e,l){const t=this.getLegend(),i=l===void 0?t:l.children;l!==void 0&&this._toggleState(l,{visibility:e}),i.forEach(r=>{this._toggleState(r,{visibility:e})})}reloadLayerItem(e){const l=this.getLayerBoundItems(e);return l.forEach(t=>t.reload()),l.length>0}removeItem(e){const l=typeof e=="string"?this.getItem(e):e;return l!==void 0?this._deleteItem(l):!1}removeLayerItem(e){const l=this.getLayerItem(e);return l!==void 0?this._deleteItem(l):!1}searchTreeFirst(e,l){if(l(e))return e;{let t;return e.children.some(i=>(t=this.searchTreeFirst(i,l),t!==void 0)),t}}searchTreeAll(e,l){const t=[],i=[e];for(;i.length>0;){const r=i.shift();r&&l(r)&&t.push(r),r&&i.push(...r.children)}return t}searchLegend(e){return this.getLegend().map(l=>this.searchTreeAll(l,e)).flat()}_toggleState(e,l){const t=l.visibility,i=l.expanded;t!==void 0&&e.toggleVisibility(t),i!==void 0&&e.children.length>0&&e.toggleExpanded(i),e.children&&e.children.length>0&&e.children.forEach(r=>{this._toggleState(r,l)})}_insertItem(e,l){a(this.$vApp.$pinia).addItem({item:e,parent:l})}_deleteItem(e){const l=a(this.$vApp.$pinia),t=i=>{i.children.length>0&&i.children.forEach(r=>{t(r)}),i instanceof s&&i.handlers.forEach(r=>this.$iApi.event.off(r)),l.removeItem(i)};return t(e),!0}_replaceItem(e,l){a(this.$vApp.$pinia).replaceItem({oldItem:e,newItem:l})}_treeWalker(e,l,t){const i=(n=>{const d=[e];for(;d.length>0;){const o=d.shift();if(o&&o.uid===n)return o;o&&d.push(...o.sublayers)}})(l.uid),r={};return l.isLayerRoot&&!l.isLogicalLayer?(r.layer=i,r.name=i.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):!l.isLayerRoot&&!l.isLogicalLayer?(r.name=l.name,r.children=l.children.map(n=>this._treeWalker(e,n,t))):l.isLogicalLayer&&(r.layer=i,r.name=i.name,r.layerId=i.id,r.sublayerIndex=e.isSublayer?e.layerIdx:void 0),{...r,...t}}}const T=y({__name:"nav-button",setup(p){const{t:e}=I(),l=E("iApi"),t=()=>{l.panel.toggle("legend")};return(i,r)=>{const n=A("mapnav-button");return $(),w(n,{onClickFunction:t,tooltip:C(e)("legend.title")},{default:_(()=>r[0]||(r[0]=[h("svg",{class:"fill-current w-32 h-20",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[h("path",{d:"M0 0h24v24H0z",fill:"none"}),h("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)])),_:1},8,["tooltip"])}}}),R={en:{"legend.title":"Legend","legend.header.addlayer":"Add Layer","legend.header.reorderlayers":"Reorder Layers","legend.header.groups":"Toggle Groups","legend.header.groups.expand":"Expand All","legend.header.groups.collapse":"Collapse All","legend.header.visible":"Toggle Visibility","legend.header.visible.show":"Show All","legend.header.visible.hide":"Hide All","legend.group.expand":"Expand Group","legend.group.collapse":"Collapse Group","legend.visibility.showLayer":"Show layer","legend.visibility.hideLayer":"Hide layer","legend.visibility.showSymbol":"Show symbol","legend.visibility.hideSymbol":"Hide symbol","legend.visibility.showGroup":"Show group","legend.visibility.hideGroup":"Hide group","legend.symbology.expand":"Expand legend","legend.symbology.hide":"Hide legend","legend.symbology.loading":"Loading...","legend.layer.data":"Show more data","legend.layer.data.only":"Layer not on map","legend.layer.offscale":"Layer out of scale","legend.layer.zoomToVisible":"Zoom to visible scale","legend.layer.options":"More options","legend.layer.controls.metadata":"Metadata","legend.layer.controls.settings":"Settings","legend.layer.controls.datatable":"Datatable","legend.layer.controls.symbology":"Legend","legend.layer.controls.boundaryzoom":"Zoom to Layer Boundary","legend.layer.controls.cancel":"Cancel","legend.layer.controls.remove":"Remove","legend.layer.controls.reload":"Reload","legend.layer.controls.reloadDisabled":"Layer cannot be reloaded","legend.alert.symbologyExpanded":"Layer legend expanded","legend.alert.symbologyCollapsed":"Layer legend collapsed","legend.alert.groupExpanded":"Legend group expanded","legend.alert.groupCollapsed":"Legend group collapsed","legend.alert.layerAdded":"{name} layer added to legend","legend.alert.layerRemoved":"{name} layer removed from legend"},fr:{"legend.title":"Légende","legend.header.addlayer":"Ajouter une couche","legend.header.reorderlayers":"Réorganiser les couches","legend.header.groups":"Basculer les Groupes","legend.header.groups.expand":"Élargir les groupes","legend.header.groups.collapse":"Réduire les groupes","legend.header.visible":"Basculer la Visibilité","legend.header.visible.show":"Montrer tout","legend.header.visible.hide":"Cacher tout","legend.group.expand":"Développer un groupe","legend.group.collapse":"Réduire un groupe","legend.visibility.showLayer":"Afficher la couche","legend.visibility.hideLayer":"Masquer la couche","legend.visibility.showSymbol":"Afficher le symbole","legend.visibility.hideSymbol":"Masquer le symbole","legend.visibility.showGroup":"Afficher le groupe","legend.visibility.hideGroup":"Masquer le groupe","legend.symbology.expand":"Développer la légende","legend.symbology.hide":"Masquer la légende","legend.symbology.loading":"Chargement en cours...","legend.layer.data":"Afficher plus de données","legend.layer.data.only":"Couche non visualisable","legend.layer.offscale":"Couche hors de portée","legend.layer.zoomToVisible":"Zoom sur l'échelle visible","legend.layer.options":"Plus d'options","legend.layer.controls.metadata":"Métadonnées","legend.layer.controls.settings":"Paramètres","legend.layer.controls.datatable":"Tableau de données","legend.layer.controls.symbology":"Légende","legend.layer.controls.boundaryzoom":"Zoomer à la limite","legend.layer.controls.cancel":"Annuler","legend.layer.controls.remove":"Retirer","legend.layer.controls.reload":"Recharger","legend.layer.controls.reloadDisabled":"Le calque ne peut pas être rechargé","legend.alert.symbologyExpanded":"Légende de la couche développée","legend.alert.symbologyCollapsed":"Légende de la couche réduite","legend.alert.groupExpanded":"Groupe de légende développé","legend.alert.groupCollapsed":"Groupe de légende réduit","legend.alert.layerAdded":"{name} couche ajoutée à la légende","legend.alert.layerRemoved":"Couche {name} retiré de la légende"}};class z extends S{added(){this.$iApi.component("legend-nav-button",T),this.$iApi.panel.register({legend:{screens:{"legend-screen":()=>u(c(()=>import("./screen-DTrOvIb7-CxTZcnC-.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url))},style:{width:"350px"},alertName:"legend.title",button:{tooltip:"legend.title",icon:''}}},{i18n:{messages:R}}),this._parseConfig(this.config!==void 0?JSON.parse(JSON.stringify(this.config)):void 0);const e=this.$vApp.$watch(()=>this.config,l=>this._parseConfig(l!==void 0?JSON.parse(JSON.stringify(l)):void 0));this.removed=()=>{e(),this.$iApi.fixture.exists("appbar")&&m(this.$vApp.$pinia).removeButton("legend"),this.$iApi.fixture.exists("mapnav")&&f(this.$vApp.$pinia).removeItem("legend"),a().$reset(),this.$iApi.panel.remove("legend")}}}export{z as default}; diff --git a/custom-toc-highlight/assets/index-DRrktYRZ-BJGx8CJ2.js b/custom-toc-highlight/assets/index-DRrktYRZ-Cdk3b_aC.js similarity index 88% rename from custom-toc-highlight/assets/index-DRrktYRZ-BJGx8CJ2.js rename to custom-toc-highlight/assets/index-DRrktYRZ-Cdk3b_aC.js index 7a9cf64d..38acc408 100644 --- a/custom-toc-highlight/assets/index-DRrktYRZ-BJGx8CJ2.js +++ b/custom-toc-highlight/assets/index-DRrktYRZ-Cdk3b_aC.js @@ -1 +1 @@ -import{eT as r,fq as i,f6 as p,f8 as m,e$ as u,fb as d,f2 as l,eY as c,e_ as f,f0 as h,f1 as b}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";const v=["src"],g=r({__name:"snowman",props:{fixture:{type:i,required:!0},message:String},setup(s){const e=s,t=p(),a=p("https://i.imgur.com/p13yknD.png");return m(()=>{setTimeout(()=>{t.value.parentNode.removeChild(t.value),e.fixture.remove()},6e3)}),(n,o)=>(u(),d("div",{class:"absolute top-0 right-0",ref_key:"el",ref:t},[l("img",{style:{width:"250px"},src:a.value,alt:"Snowman",srcset:""},null,8,v)],512))}}),w=r({__name:"appbar-button",setup(s){const e=c("iApi"),t=()=>{e.fixture.add("snowman")};return(a,n)=>{const o=f("appbar-button",!0);return u(),h(o,{onClickFunction:t,tooltip:"⛄"},{default:b(()=>n[0]||(n[0]=[l("span",{class:"block h-24"},"⛄",-1)])),_:1})}}});class C extends i{added(){this.$iApi.component("snowman-appbar-button",w);const{el:e}=this.mount(g,{app:this.$element,props:{message:"This is a snowman prop.",fixture:this}});this.$vApp.$el.appendChild(e.childNodes[0])}removed(){}}export{C as default}; +import{eT as r,fq as i,f6 as p,f8 as m,e$ as u,fb as d,f2 as l,eY as c,e_ as f,f0 as h,f1 as b}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";const v=["src"],g=r({__name:"snowman",props:{fixture:{type:i,required:!0},message:String},setup(s){const e=s,t=p(),a=p("https://i.imgur.com/p13yknD.png");return m(()=>{setTimeout(()=>{t.value.parentNode.removeChild(t.value),e.fixture.remove()},6e3)}),(n,o)=>(u(),d("div",{class:"absolute top-0 right-0",ref_key:"el",ref:t},[l("img",{style:{width:"250px"},src:a.value,alt:"Snowman",srcset:""},null,8,v)],512))}}),w=r({__name:"appbar-button",setup(s){const e=c("iApi"),t=()=>{e.fixture.add("snowman")};return(a,n)=>{const o=f("appbar-button",!0);return u(),h(o,{onClickFunction:t,tooltip:"⛄"},{default:b(()=>n[0]||(n[0]=[l("span",{class:"block h-24"},"⛄",-1)])),_:1})}}});class C extends i{added(){this.$iApi.component("snowman-appbar-button",w);const{el:e}=this.mount(g,{app:this.$element,props:{message:"This is a snowman prop.",fixture:this}});this.$vApp.$el.appendChild(e.childNodes[0])}removed(){}}export{C as default}; diff --git a/custom-toc-highlight/assets/index-DY4XJa1m-CNSHrnyD.js b/custom-toc-highlight/assets/index-DY4XJa1m-CinpT_5l.js similarity index 76% rename from custom-toc-highlight/assets/index-DY4XJa1m-CNSHrnyD.js rename to custom-toc-highlight/assets/index-DY4XJa1m-CinpT_5l.js index 5a292a86..13a8ebe3 100644 --- a/custom-toc-highlight/assets/index-DY4XJa1m-CNSHrnyD.js +++ b/custom-toc-highlight/assets/index-DY4XJa1m-CinpT_5l.js @@ -1 +1 @@ -import{a}from"./fabric-Df28hv38-CC2TWXwY.js";import{fq as n,fz as s}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";class p extends n{get config(){return this.$iApi.fixture.get("export").config?.title}make(o){const t=this.config,e={text:"RAMP-Map / PCAR-Carte",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:30,top:0,left:0,originX:"center",originY:"top"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),r=new a.fabric.Textbox(i.text,i);return Promise.resolve(r)}}export{p as default}; +import{a}from"./fabric-Df28hv38-DoClkw8Q.js";import{fq as n,fz as s}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";class p extends n{get config(){return this.$iApi.fixture.get("export").config?.title}make(o){const t=this.config,e={text:"RAMP-Map / PCAR-Carte",fontFamily:"Montserrat, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",fill:"#000",fontSize:30,top:0,left:0,originX:"center",originY:"top"};t?.value!==void 0&&(e.text=t.value);const i=s(e,o||{}),r=new a.fabric.Textbox(i.text,i);return Promise.resolve(r)}}export{p as default}; diff --git a/custom-toc-highlight/assets/index-DfBq89c3-BlZPQ9vY.js b/custom-toc-highlight/assets/index-DfBq89c3-eMYAVigg.js similarity index 83% rename from custom-toc-highlight/assets/index-DfBq89c3-BlZPQ9vY.js rename to custom-toc-highlight/assets/index-DfBq89c3-eMYAVigg.js index 4793d34a..e9a33d49 100644 --- a/custom-toc-highlight/assets/index-DfBq89c3-BlZPQ9vY.js +++ b/custom-toc-highlight/assets/index-DfBq89c3-eMYAVigg.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-N-CoZlcH-DEJO0pOT.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./vue.esm-bundler-D2erd_gM-D0q3-bhf.js"])))=>i.map(i=>d[i]); -import{_ as o}from"./main-ugzBrWNm.js";import{fu as l,eW as s,fq as d}from"./story-BfX8CRfG.js";const t={en:{"layer-reorder.title":"Reorder Layers","layer-reorder.nolayers":"No Layers","layer-reorder.loading":"Loading","layer-reorder.expand":"Expand Sublayers","layer-reorder.expanded":"{name} sublayers expanded","layer-reorder.collapse":"Collapse Sublayers","layer-reorder.collapsed":"{name} sublayers collapsed","layer-reorder.move.up":"Move up","layer-reorder.move.down":"Move down","layer-reorder.layermoved":"{name} moved to index {index}"},fr:{"layer-reorder.title":"Réorganiser les couches","layer-reorder.nolayers":"Aucune couche","layer-reorder.loading":"Chargement","layer-reorder.expand":"Développer les sous-couches","layer-reorder.expanded":"Sous-couches {name} développées","layer-reorder.collapse":"Réduire les sous-couches","layer-reorder.collapsed":"Sous-couches {name} réduites","layer-reorder.move.up":"Déplacer vers le haut","layer-reorder.move.down":"Déplacer vers le bas","layer-reorder.layermoved":"{name} déplacé vers l'index {index}"}};class n extends d{toggleLayerReorder(r){const a=this.$iApi.panel.get("layer-reorder");this.$iApi.panel.toggle(a,r)}}class y extends n{added(){this.$iApi.panel.register({"layer-reorder":{screens:{"layer-reorder-screen":()=>l(o(()=>import("./screen-N-CoZlcH-DEJO0pOT.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"350px"},button:{tooltip:"layer-reorder.title",icon:''},alertName:"layer-reorder.title"}},{i18n:{messages:t}}),this.handlePanelTeleports(["layer-reorder"])}removed(){this.$iApi.fixture.exists("appbar")&&s(this.$vApp.$pinia).removeButton("layer-reorder"),this.$iApi.panel.remove("layer-reorder")}}export{y as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-N-CoZlcH-D0u53zN0.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./vue.esm-bundler-D2erd_gM-C7Afc0Sc.js"])))=>i.map(i=>d[i]); +import{_ as o}from"./main-QGPoLsvl.js";import{fu as l,eW as s,fq as d}from"./story-Doly9N9p.js";const t={en:{"layer-reorder.title":"Reorder Layers","layer-reorder.nolayers":"No Layers","layer-reorder.loading":"Loading","layer-reorder.expand":"Expand Sublayers","layer-reorder.expanded":"{name} sublayers expanded","layer-reorder.collapse":"Collapse Sublayers","layer-reorder.collapsed":"{name} sublayers collapsed","layer-reorder.move.up":"Move up","layer-reorder.move.down":"Move down","layer-reorder.layermoved":"{name} moved to index {index}"},fr:{"layer-reorder.title":"Réorganiser les couches","layer-reorder.nolayers":"Aucune couche","layer-reorder.loading":"Chargement","layer-reorder.expand":"Développer les sous-couches","layer-reorder.expanded":"Sous-couches {name} développées","layer-reorder.collapse":"Réduire les sous-couches","layer-reorder.collapsed":"Sous-couches {name} réduites","layer-reorder.move.up":"Déplacer vers le haut","layer-reorder.move.down":"Déplacer vers le bas","layer-reorder.layermoved":"{name} déplacé vers l'index {index}"}};class n extends d{toggleLayerReorder(r){const a=this.$iApi.panel.get("layer-reorder");this.$iApi.panel.toggle(a,r)}}class y extends n{added(){this.$iApi.panel.register({"layer-reorder":{screens:{"layer-reorder-screen":()=>l(o(()=>import("./screen-N-CoZlcH-D0u53zN0.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"350px"},button:{tooltip:"layer-reorder.title",icon:''},alertName:"layer-reorder.title"}},{i18n:{messages:t}}),this.handlePanelTeleports(["layer-reorder"])}removed(){this.$iApi.fixture.exists("appbar")&&s(this.$vApp.$pinia).removeButton("layer-reorder"),this.$iApi.panel.remove("layer-reorder")}}export{y as default}; diff --git a/custom-toc-highlight/assets/index-DmuJEjwc-CFxZGX5E.js b/custom-toc-highlight/assets/index-DmuJEjwc-CFoy2sko.js similarity index 95% rename from custom-toc-highlight/assets/index-DmuJEjwc-CFxZGX5E.js rename to custom-toc-highlight/assets/index-DmuJEjwc-CFoy2sko.js index f0f63ea1..52ea9749 100644 --- a/custom-toc-highlight/assets/index-DmuJEjwc-CFxZGX5E.js +++ b/custom-toc-highlight/assets/index-DmuJEjwc-CFoy2sko.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./details-screen-DE85sbTV-D3mJWX0Z.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./toggle-switch-control-B4JzuvHa-xR5vylCb.js"])))=>i.map(i=>d[i]); -import{_ as h}from"./main-ugzBrWNm.js";import{fu as p,eW as g,fx as m,fq as u,fy as c}from"./story-BfX8CRfG.js";import{a as y}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";class f{id;name;template;priority;fields;componentId;constructor(e){const t={...typeof e=="string"?{id:e,template:"",name:"",priority:50}:e};({template:this.template,id:this.id,name:this.name,fields:this.fields,priority:this.priority}=t)}}const o="details";class x extends u{detailsStore=m(this.$vApp.$pinia);get config(){return super.config}openDetails(e){e.forEach(i=>{this._loadDetailsConfig(this.$iApi.geo.layer.getLayer(i.uid))}),this.detailsStore.payload=e;const t=this.$iApi.panel.get("details");this.detailsStore.origin="identify",t.button.tooltip="details.layers.title.identifyOrigin",this.$iApi.panel.get("details").isOpen||this.$iApi.panel.open({id:"details"})}toggleFeature(e,t){const i=this.$iApi.panel.get("details");if(t===!1){i.close(),this.detailsStore.currentFeatureId=void 0;return}const a=this.$iApi.geo.layer.getLayer(e.uid),s=`${e.uid}-${a?.supportsFeatures?e.data[a?.oidField??""]:JSON.stringify(e.data)}`;if(i.isOpen&&s===this.detailsStore.currentFeatureId&&t!==!0){i.close(),this.detailsStore.currentFeatureId=void 0;return}this.detailsStore.origin="toggleEvent",i.button.tooltip="details.layers.title.gridOrigin",this.detailsStore.currentFeatureId=s,this._loadDetailsConfig(a);const l={items:[c.makeRawItem(e.format,e.data)],uid:e.uid,layerId:e.layerId||a?.id||"error-not-found",loading:Promise.resolve(),loaded:!0,errored:!1,requestTime:Date.now()};this.detailsStore.payload=[l],i.isOpen||i.open()}_parseConfig(e){e&&e.templates&&(this.detailsStore.defaultTemplates=e.templates),this.handlePanelWidths(["details"]),this.handlePanelTeleports(["details"]);const t=this.getLayerFixtureConfigs(),i=[];Object.keys(t).forEach(s=>{i.push({id:s,name:t[s].name,template:t[s].template,fields:t[s].fields,priority:t[s].priority??50})});const a=i.map(s=>new f(s));this.detailsStore.properties=a.reduce((s,l)=>(s[l.id]=l,s),{}),this._validateItems()}_loadDetailsConfig(e){if(e&&this.detailsStore.properties[e.id]===void 0){const t=this.getLayerFixtureConfigs()[e.id];t&&this.detailsStore.addConfigProperty({id:e.id,name:t.name,template:t.template,fields:t.fields,priority:t.priority??50})}}_validateItems(){Object.values(this.detailsStore.properties).forEach(e=>{e.template in this.$vApp.$options.components&&(this.detailsStore.properties[e.id].componentId=e.template)})}async hilightDetailsItems(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await a.getGraphicsByKey(o);await a.removeHilight(s);const l=Date.now();this.detailsStore.lastHilight=l;const r=await this.getHilightGraphics(i,t);this.detailsStore.lastHilight===l&&(await a.addHilight(r),this.detailsStore.lastHilight!==l&&a.removeHilight(r))}}async removeDetailsHilight(){const e=this.$iApi.fixture.get("hilight");if(e){this.detailsStore.lastHilight=Date.now();const t=await e.getGraphicsByKey(o);await e.removeHilight(t)}}async reloadDetailsHilight(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await this.getHilightGraphics(i,t);a.reloadHilight(s)}}async getHilightGraphics(e,t){const i=this.$iApi.geo.layer.getLayer(t),a=this.$iApi.fixture.get("hilight"),s=[];return i&&await Promise.all(e.map(async l=>{await l.loading;const r=l.data[i.oidField],n=await i.getGraphic(r,{getGeom:!0,getAttribs:!0,getStyle:!0});n.id=a.constructGraphicKey(o,t,r),s.push(n)})),s}onHilightToggle(e,t,i){this.detailsStore.hilightToggle=e,e&&t&&i?this.hilightDetailsItems(t,i):e||this.removeDetailsHilight()}hasHilighter(){const e=this.$iApi.fixture.get("hilight");return e&&e.hilightMode.mode!==y.NONE}}const v={en:{"details.layers.title.identifyOrigin":"Identify Details","details.layers.title.gridOrigin":"Details","details.layers.found":"Found {numResults} results in {numLayers} layers","details.layers.loading":"The layer is loading...","details.layers.error":"Error","details.layers.results.empty":"No results found for any layer.","details.layers.results.empty.currentLayer":"No results found for the selected layer.","details.layers.results.empty.noLayers":"No layers for identification.","details.layers.results.list.tooltip":"Use the arrow keys to navigate the items","details.result.default.name":"Identify Item {0}","details.loading":"Loading...","details.items.title":"Details","details.items.range":"{0} - {1} of {2}","details.items.next":"Next page","details.items.previous":"Previous page","details.items.page":"Items per page","details.item.see.list":"See List","details.item.zoom":"Zoom to feature","details.item.zoom.zooming":"Zooming...","details.item.zoom.error":"Zoom failed","details.item.zoom.zoomed":"Zoomed","details.item.previous.item":"Previous item","details.item.next.item":"Next item","details.item.count":"{0} of {1}","details.item.loading":"Loading results...","details.item.no.data":"No data to show because the layer has been removed","details.item.alert.zoom":"Zoomed into feature","details.item.alert.show.item":"Showing result {itemName}","details.item.alert.show.list":"Showing all results for {layerName}","details.item.alert.defaultAltText":"Image associated with {alias} field","details.togglehilight.title":"Toggle Highlight","details.item.open":"Expand","details.item.collapse":"Collapse"},fr:{"details.layers.title.identifyOrigin":"Identifier les détails","details.layers.title.gridOrigin":"Détails","details.layers.found":"{numResults} résultats trouvés dans {numLayers} couches","details.layers.loading":"La couche est en cours de chargement...","details.layers.error":"Erreur","details.layers.results.empty":"Aucun résultat trouvé pour aucune couche.","details.layers.results.empty.currentLayer":"Aucun résultat trouvé pour la couche sélectionnée.","details.layers.results.empty.noLayers":"Pas de couches pour l'identification.","details.layers.results.list.tooltip":"Utilisez les touches fléchées pour naviguer entre les éléments","details.result.default.name":"Désigner l'élément {0}","details.loading":"Chargement en cours...","details.items.title":"Détails","details.items.range":"{0} - {1} de {2}","details.items.next":"Page suivante","details.items.previous":"Page précédente","details.items.page":"éléments par page","details.item.see.list":"Voir la liste","details.item.zoom":"Zoom à l'élément","details.item.zoom.zooming":"Zoom en cours...","details.item.zoom.error":"Échec du zoom","details.item.zoom.zoomed":"Zoom terminé","details.item.previous.item":"Élément précédent","details.item.next.item":"Élément suivant","details.item.count":"{0} de {1}","details.item.loading":"Chargement des résultats...","details.item.no.data":"Aucune donnée à afficher","details.item.alert.zoom":"Zoom sur la caractéristique","details.item.alert.show.item":"Affichage du résultat {itemName}","details.item.alert.show.list":"Affichage de tous les résultats pour {layerName}","details.item.alert.defaultAltText":"Image associée au champ {alias}","details.togglehilight.title":"Basculer vers l'élément principal","details.item.open":"Développer","details.item.collapse":"Réduire"}};class $ extends x{async added(){this.$iApi.panel.register({details:{screens:{"details-screen":()=>p(h(()=>import("./details-screen-DE85sbTV-D3mJWX0Z.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"425px"},button:{tooltip:"details.layers.title.identifyOrigin",icon:''},alertName:"details.items.title"}},{i18n:{messages:v}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.panel.remove("details"),this.$iApi.fixture.exists("appbar")&&g(this.$vApp.$pinia).removeButton("details"),m(this.$vApp.$pinia).$reset()}}}export{$ as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./details-screen-DE85sbTV-BZ2qdeGe.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./toggle-switch-control-B4JzuvHa-B1HiDvC7.js"])))=>i.map(i=>d[i]); +import{_ as h}from"./main-QGPoLsvl.js";import{fu as p,eW as g,fx as m,fq as u,fy as c}from"./story-Doly9N9p.js";import{a as y}from"./hilight-defs-DzKgjtLG-D-utaUCJ.js";class f{id;name;template;priority;fields;componentId;constructor(e){const t={...typeof e=="string"?{id:e,template:"",name:"",priority:50}:e};({template:this.template,id:this.id,name:this.name,fields:this.fields,priority:this.priority}=t)}}const o="details";class x extends u{detailsStore=m(this.$vApp.$pinia);get config(){return super.config}openDetails(e){e.forEach(i=>{this._loadDetailsConfig(this.$iApi.geo.layer.getLayer(i.uid))}),this.detailsStore.payload=e;const t=this.$iApi.panel.get("details");this.detailsStore.origin="identify",t.button.tooltip="details.layers.title.identifyOrigin",this.$iApi.panel.get("details").isOpen||this.$iApi.panel.open({id:"details"})}toggleFeature(e,t){const i=this.$iApi.panel.get("details");if(t===!1){i.close(),this.detailsStore.currentFeatureId=void 0;return}const a=this.$iApi.geo.layer.getLayer(e.uid),s=`${e.uid}-${a?.supportsFeatures?e.data[a?.oidField??""]:JSON.stringify(e.data)}`;if(i.isOpen&&s===this.detailsStore.currentFeatureId&&t!==!0){i.close(),this.detailsStore.currentFeatureId=void 0;return}this.detailsStore.origin="toggleEvent",i.button.tooltip="details.layers.title.gridOrigin",this.detailsStore.currentFeatureId=s,this._loadDetailsConfig(a);const l={items:[c.makeRawItem(e.format,e.data)],uid:e.uid,layerId:e.layerId||a?.id||"error-not-found",loading:Promise.resolve(),loaded:!0,errored:!1,requestTime:Date.now()};this.detailsStore.payload=[l],i.isOpen||i.open()}_parseConfig(e){e&&e.templates&&(this.detailsStore.defaultTemplates=e.templates),this.handlePanelWidths(["details"]),this.handlePanelTeleports(["details"]);const t=this.getLayerFixtureConfigs(),i=[];Object.keys(t).forEach(s=>{i.push({id:s,name:t[s].name,template:t[s].template,fields:t[s].fields,priority:t[s].priority??50})});const a=i.map(s=>new f(s));this.detailsStore.properties=a.reduce((s,l)=>(s[l.id]=l,s),{}),this._validateItems()}_loadDetailsConfig(e){if(e&&this.detailsStore.properties[e.id]===void 0){const t=this.getLayerFixtureConfigs()[e.id];t&&this.detailsStore.addConfigProperty({id:e.id,name:t.name,template:t.template,fields:t.fields,priority:t.priority??50})}}_validateItems(){Object.values(this.detailsStore.properties).forEach(e=>{e.template in this.$vApp.$options.components&&(this.detailsStore.properties[e.id].componentId=e.template)})}async hilightDetailsItems(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await a.getGraphicsByKey(o);await a.removeHilight(s);const l=Date.now();this.detailsStore.lastHilight=l;const r=await this.getHilightGraphics(i,t);this.detailsStore.lastHilight===l&&(await a.addHilight(r),this.detailsStore.lastHilight!==l&&a.removeHilight(r))}}async removeDetailsHilight(){const e=this.$iApi.fixture.get("hilight");if(e){this.detailsStore.lastHilight=Date.now();const t=await e.getGraphicsByKey(o);await e.removeHilight(t)}}async reloadDetailsHilight(e,t){const i=e instanceof Array?e:[e],a=this.$iApi.fixture.get("hilight");if(a){const s=await this.getHilightGraphics(i,t);a.reloadHilight(s)}}async getHilightGraphics(e,t){const i=this.$iApi.geo.layer.getLayer(t),a=this.$iApi.fixture.get("hilight"),s=[];return i&&await Promise.all(e.map(async l=>{await l.loading;const r=l.data[i.oidField],n=await i.getGraphic(r,{getGeom:!0,getAttribs:!0,getStyle:!0});n.id=a.constructGraphicKey(o,t,r),s.push(n)})),s}onHilightToggle(e,t,i){this.detailsStore.hilightToggle=e,e&&t&&i?this.hilightDetailsItems(t,i):e||this.removeDetailsHilight()}hasHilighter(){const e=this.$iApi.fixture.get("hilight");return e&&e.hilightMode.mode!==y.NONE}}const v={en:{"details.layers.title.identifyOrigin":"Identify Details","details.layers.title.gridOrigin":"Details","details.layers.found":"Found {numResults} results in {numLayers} layers","details.layers.loading":"The layer is loading...","details.layers.error":"Error","details.layers.results.empty":"No results found for any layer.","details.layers.results.empty.currentLayer":"No results found for the selected layer.","details.layers.results.empty.noLayers":"No layers for identification.","details.layers.results.list.tooltip":"Use the arrow keys to navigate the items","details.result.default.name":"Identify Item {0}","details.loading":"Loading...","details.items.title":"Details","details.items.range":"{0} - {1} of {2}","details.items.next":"Next page","details.items.previous":"Previous page","details.items.page":"Items per page","details.item.see.list":"See List","details.item.zoom":"Zoom to feature","details.item.zoom.zooming":"Zooming...","details.item.zoom.error":"Zoom failed","details.item.zoom.zoomed":"Zoomed","details.item.previous.item":"Previous item","details.item.next.item":"Next item","details.item.count":"{0} of {1}","details.item.loading":"Loading results...","details.item.no.data":"No data to show because the layer has been removed","details.item.alert.zoom":"Zoomed into feature","details.item.alert.show.item":"Showing result {itemName}","details.item.alert.show.list":"Showing all results for {layerName}","details.item.alert.defaultAltText":"Image associated with {alias} field","details.togglehilight.title":"Toggle Highlight","details.item.open":"Expand","details.item.collapse":"Collapse"},fr:{"details.layers.title.identifyOrigin":"Identifier les détails","details.layers.title.gridOrigin":"Détails","details.layers.found":"{numResults} résultats trouvés dans {numLayers} couches","details.layers.loading":"La couche est en cours de chargement...","details.layers.error":"Erreur","details.layers.results.empty":"Aucun résultat trouvé pour aucune couche.","details.layers.results.empty.currentLayer":"Aucun résultat trouvé pour la couche sélectionnée.","details.layers.results.empty.noLayers":"Pas de couches pour l'identification.","details.layers.results.list.tooltip":"Utilisez les touches fléchées pour naviguer entre les éléments","details.result.default.name":"Désigner l'élément {0}","details.loading":"Chargement en cours...","details.items.title":"Détails","details.items.range":"{0} - {1} de {2}","details.items.next":"Page suivante","details.items.previous":"Page précédente","details.items.page":"éléments par page","details.item.see.list":"Voir la liste","details.item.zoom":"Zoom à l'élément","details.item.zoom.zooming":"Zoom en cours...","details.item.zoom.error":"Échec du zoom","details.item.zoom.zoomed":"Zoom terminé","details.item.previous.item":"Élément précédent","details.item.next.item":"Élément suivant","details.item.count":"{0} de {1}","details.item.loading":"Chargement des résultats...","details.item.no.data":"Aucune donnée à afficher","details.item.alert.zoom":"Zoom sur la caractéristique","details.item.alert.show.item":"Affichage du résultat {itemName}","details.item.alert.show.list":"Affichage de tous les résultats pour {layerName}","details.item.alert.defaultAltText":"Image associée au champ {alias}","details.togglehilight.title":"Basculer vers l'élément principal","details.item.open":"Développer","details.item.collapse":"Réduire"}};class $ extends x{async added(){this.$iApi.panel.register({details:{screens:{"details-screen":()=>p(h(()=>import("./details-screen-DE85sbTV-BZ2qdeGe.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url))},style:{width:"425px"},button:{tooltip:"details.layers.title.identifyOrigin",icon:''},alertName:"details.items.title"}},{i18n:{messages:v}}),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,t=>this._parseConfig(t));this.removed=()=>{e(),this.$iApi.panel.remove("details"),this.$iApi.fixture.exists("appbar")&&g(this.$vApp.$pinia).removeButton("details"),m(this.$vApp.$pinia).$reset()}}}export{$ as default}; diff --git a/custom-toc-highlight/assets/index-DxH-DOHz-Dd8g4fh-.js b/custom-toc-highlight/assets/index-DxH-DOHz-BNodbAX5.js similarity index 93% rename from custom-toc-highlight/assets/index-DxH-DOHz-Dd8g4fh-.js rename to custom-toc-highlight/assets/index-DxH-DOHz-BNodbAX5.js index 593ec954..34269819 100644 --- a/custom-toc-highlight/assets/index-DxH-DOHz-Dd8g4fh-.js +++ b/custom-toc-highlight/assets/index-DxH-DOHz-BNodbAX5.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./p2-screen-1-CQoqpp13-mlPgztrW.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css"])))=>i.map(i=>d[i]); -import{_ as w}from"./main-ugzBrWNm.js";import{eT as i,fq as v,fu as m,eY as x,e_ as b,e$ as u,f0 as g,f1 as r,f2 as e,fF as G,fG as c,eX as y,fg as p,f4 as h}from"./story-BfX8CRfG.js";const A=i({__name:"appbar-button",props:{options:{type:Object}},setup(l){const a=x("iApi"),t=()=>{a.panel.toggle({id:"p2",screen:"p-2-screen-2"})};return(n,s)=>{const d=b("appbar-button",!0);return u(),g(d,{onClickFunction:t,tooltip:"Gazebo"},{default:r(()=>[e("span",{style:G({color:l.options?.colour??"#BDBDBD"})},"G ",4)]),_:1})}}}),S={class:"flex flex-col items-center"},j=i({__name:"p1-screen-1",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:r(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen A ")])),controls:r(()=>t[2]||(t[2]=[e("a",{href:"javascript:;"},"Option 1",-1),e("a",{href:"javascript:;"},"Option 2",-1),e("a",{href:"javascript:;"},"Option 3",-1)])),content:r(()=>[e("div",S,[e("button",{type:"button",onClick:t[0]||(t[0]=s=>l.panel.show({screen:"p-1-screen-2"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 2 "),t[3]||(t[3]=e("br",null,null,-1)),t[4]||(t[4]=e("img",{src:"https://c.tenor.com/RJ3ZG5beDhIAAAAC/napoleon-dynamite-napoleon.gif",alt:"Gazebo1"},null,-1))])]),_:1},8,["panel"])}}}),B={class:"flex flex-col items-center"},P=i({__name:"p1-screen-2",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:r(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen B ")])),content:r(()=>[e("div",B,[e("button",{type:"button",onClick:t[0]||(t[0]=s=>l.panel.show({screen:"p-1-screen-1"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 1 "),t[2]||(t[2]=e("br",null,null,-1)),t[3]||(t[3]=e("img",{src:"http://nesn.com/wp-content/uploads/2014/09/jeternephew.gif",alt:"Gazebo2"},null,-1))])]),_:1},8,["panel"])}}}),C={class:"flex flex-row justify-center items-center mt-16"},O={class:"mt-16"},k=i({__name:"p2-screen-2",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(l){const a=l,{t}=y(),n=x("iApi"),s=()=>{a.panel.show("p-2-screen-3"),n.event.emit("gazebo/beholdMyText","I am a cat")};return(d,o)=>{const z=b("panel-screen");return u(),g(z,{panel:l.panel},{header:r(()=>o[2]||(o[2]=[c(" Gazebo/Panel 2/Screen B ")])),content:r(()=>[c(p(h(t)("gz.hello2"))+" ",1),e("div",C,[e("button",{type:"button",onClick:o[0]||(o[0]=_=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen B"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),e("button",{type:"button",onClick:o[1]||(o[1]=_=>s()),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," See a cat ")]),e("p",O,p(l.greeting),1)]),_:1},8,["panel"])}}}),T={class:"flex flex-col items-center mt-16"},D={class:"ml-32 font-bold"},$={class:"ml-32 font-bold"},q={class:"ml-32 font-bold"},I=i({__name:"p2-screen-3",props:{panel:{type:Object,required:!0}},setup(l){const{t:a}=y({messages:{en:{lang_native:"En",who:"[me cat]"},fr:{lang_native:"Fr",who:"[moi chat]"}}});return(t,n)=>{const s=b("panel-screen");return u(),g(s,{panel:l.panel},{header:r(()=>n[1]||(n[1]=[c(" Gazebo/Panel 2/Screen C ")])),content:r(()=>[e("div",T,[e("button",{type:"button",onClick:n[0]||(n[0]=d=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen C"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),n[5]||(n[5]=e("img",{class:"my-16",src:"https://media.giphy.com/media/iWkHDNtcHpB5e/giphy.gif",alt:"",srcset:""},null,-1)),n[6]||(n[6]=e("p",null,"Locale merging:",-1)),e("dl",null,[n[2]||(n[2]=e("dt",null,"global locale:",-1)),e("dd",D,p(h(a)("lang_native")),1),n[3]||(n[3]=e("dt",null,"fixture locale:",-1)),e("dd",$,p(h(a)("gz.hello")),1),n[4]||(n[4]=e("dt",null,"common panels locale:",-1)),e("dd",q,p(h(a)("who")),1)])])]),_:1},8,["panel"])}}}),f={en:{"gz.hello":"I'm a simple panel - but from a locale file","gz.hello2":"I'm a simple panel","gz.alert1":"Gazebo","gz.alert2":"Gazebo two"},fr:{"gz.hello":'Bonjour. Je suis un panel"',"gz.hello2":'Bonjour. Je suis un panel"',"gz.alert1":"Gazebo","gz.alert2":"Gazebo deux"}},F="gazebo/beholdMyText";class J extends v{added(){this.$iApi.event.registerEventName(F),this.$iApi.component("gazebo-appbar-button",A),this.$iApi.panel.register({id:"p1",config:{screens:{"p-1-screen-1":m(j),"p-1-screen-2":m(P)},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert1"}},{i18n:{messages:f}}),this.$iApi.panel.register({id:"p2",config:{screens:{"p-2-screen-1":()=>new Promise(a=>setTimeout(()=>w(()=>import("./p2-screen-1-CQoqpp13-mlPgztrW.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(t=>{a(t)}),2e3)),"p-2-screen-2":m(k),"p-2-screen-3":()=>new Promise(a=>a(m(I)))},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert2"}},{i18n:{messages:f}}),this.handlePanelTeleports(["p1","p2"])}}export{J as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./p2-screen-1-CQoqpp13-CqrIhWtO.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css"])))=>i.map(i=>d[i]); +import{_ as w}from"./main-QGPoLsvl.js";import{eT as i,fq as v,fu as m,eY as x,e_ as b,e$ as u,f0 as g,f1 as r,f2 as e,fF as G,fG as c,eX as y,fg as p,f4 as h}from"./story-Doly9N9p.js";const A=i({__name:"appbar-button",props:{options:{type:Object}},setup(l){const a=x("iApi"),t=()=>{a.panel.toggle({id:"p2",screen:"p-2-screen-2"})};return(n,s)=>{const d=b("appbar-button",!0);return u(),g(d,{onClickFunction:t,tooltip:"Gazebo"},{default:r(()=>[e("span",{style:G({color:l.options?.colour??"#BDBDBD"})},"G ",4)]),_:1})}}}),S={class:"flex flex-col items-center"},j=i({__name:"p1-screen-1",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:r(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen A ")])),controls:r(()=>t[2]||(t[2]=[e("a",{href:"javascript:;"},"Option 1",-1),e("a",{href:"javascript:;"},"Option 2",-1),e("a",{href:"javascript:;"},"Option 3",-1)])),content:r(()=>[e("div",S,[e("button",{type:"button",onClick:t[0]||(t[0]=s=>l.panel.show({screen:"p-1-screen-2"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 2 "),t[3]||(t[3]=e("br",null,null,-1)),t[4]||(t[4]=e("img",{src:"https://c.tenor.com/RJ3ZG5beDhIAAAAC/napoleon-dynamite-napoleon.gif",alt:"Gazebo1"},null,-1))])]),_:1},8,["panel"])}}}),B={class:"flex flex-col items-center"},P=i({__name:"p1-screen-2",props:{panel:{type:Object,required:!0}},setup(l){return(a,t)=>{const n=b("panel-screen");return u(),g(n,{panel:l.panel},{header:r(()=>t[1]||(t[1]=[c(" Gazebo/Panel 1/Screen B ")])),content:r(()=>[e("div",B,[e("button",{type:"button",onClick:t[0]||(t[0]=s=>l.panel.show({screen:"p-1-screen-1"})),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16"}," See Gazebo 1 "),t[2]||(t[2]=e("br",null,null,-1)),t[3]||(t[3]=e("img",{src:"http://nesn.com/wp-content/uploads/2014/09/jeternephew.gif",alt:"Gazebo2"},null,-1))])]),_:1},8,["panel"])}}}),C={class:"flex flex-row justify-center items-center mt-16"},O={class:"mt-16"},k=i({__name:"p2-screen-2",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(l){const a=l,{t}=y(),n=x("iApi"),s=()=>{a.panel.show("p-2-screen-3"),n.event.emit("gazebo/beholdMyText","I am a cat")};return(d,o)=>{const z=b("panel-screen");return u(),g(z,{panel:l.panel},{header:r(()=>o[2]||(o[2]=[c(" Gazebo/Panel 2/Screen B ")])),content:r(()=>[c(p(h(t)("gz.hello2"))+" ",1),e("div",C,[e("button",{type:"button",onClick:o[0]||(o[0]=_=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen B"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),e("button",{type:"button",onClick:o[1]||(o[1]=_=>s()),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," See a cat ")]),e("p",O,p(l.greeting),1)]),_:1},8,["panel"])}}}),T={class:"flex flex-col items-center mt-16"},D={class:"ml-32 font-bold"},$={class:"ml-32 font-bold"},q={class:"ml-32 font-bold"},I=i({__name:"p2-screen-3",props:{panel:{type:Object,required:!0}},setup(l){const{t:a}=y({messages:{en:{lang_native:"En",who:"[me cat]"},fr:{lang_native:"Fr",who:"[moi chat]"}}});return(t,n)=>{const s=b("panel-screen");return u(),g(s,{panel:l.panel},{header:r(()=>n[1]||(n[1]=[c(" Gazebo/Panel 2/Screen C ")])),content:r(()=>[e("div",T,[e("button",{type:"button",onClick:n[0]||(n[0]=d=>l.panel.show({screen:"p-2-screen-1",props:{greeting:"Greeting from Screen C"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16"}," Switch to Screen A "),n[5]||(n[5]=e("img",{class:"my-16",src:"https://media.giphy.com/media/iWkHDNtcHpB5e/giphy.gif",alt:"",srcset:""},null,-1)),n[6]||(n[6]=e("p",null,"Locale merging:",-1)),e("dl",null,[n[2]||(n[2]=e("dt",null,"global locale:",-1)),e("dd",D,p(h(a)("lang_native")),1),n[3]||(n[3]=e("dt",null,"fixture locale:",-1)),e("dd",$,p(h(a)("gz.hello")),1),n[4]||(n[4]=e("dt",null,"common panels locale:",-1)),e("dd",q,p(h(a)("who")),1)])])]),_:1},8,["panel"])}}}),f={en:{"gz.hello":"I'm a simple panel - but from a locale file","gz.hello2":"I'm a simple panel","gz.alert1":"Gazebo","gz.alert2":"Gazebo two"},fr:{"gz.hello":'Bonjour. Je suis un panel"',"gz.hello2":'Bonjour. Je suis un panel"',"gz.alert1":"Gazebo","gz.alert2":"Gazebo deux"}},F="gazebo/beholdMyText";class J extends v{added(){this.$iApi.event.registerEventName(F),this.$iApi.component("gazebo-appbar-button",A),this.$iApi.panel.register({id:"p1",config:{screens:{"p-1-screen-1":m(j),"p-1-screen-2":m(P)},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert1"}},{i18n:{messages:f}}),this.$iApi.panel.register({id:"p2",config:{screens:{"p-2-screen-1":()=>new Promise(a=>setTimeout(()=>w(()=>import("./p2-screen-1-CQoqpp13-CqrIhWtO.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url).then(t=>{a(t)}),2e3)),"p-2-screen-2":m(k),"p-2-screen-3":()=>new Promise(a=>a(m(I)))},style:{"flex-grow":"1","max-width":"500px"},alertName:"gz.alert2"}},{i18n:{messages:f}}),this.handlePanelTeleports(["p1","p2"])}}export{J as default}; diff --git a/custom-toc-highlight/assets/index-I3HFsMjx-ztAvlKEH.js b/custom-toc-highlight/assets/index-I3HFsMjx-DYqxaWUq.js similarity index 92% rename from custom-toc-highlight/assets/index-I3HFsMjx-ztAvlKEH.js rename to custom-toc-highlight/assets/index-I3HFsMjx-DYqxaWUq.js index f0603cc1..b14b14b5 100644 --- a/custom-toc-highlight/assets/index-I3HFsMjx-ztAvlKEH.js +++ b/custom-toc-highlight/assets/index-I3HFsMjx-DYqxaWUq.js @@ -1 +1 @@ -import{eT as r,eU as p,fq as v,eY as n,f6 as h,f8 as u,eV as l,f9 as c,e$ as f,fb as m,f2 as t,f3 as w}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";const M=r({__name:"crosshairs",setup(d){const e=n("iApi"),s=h(!1),a=h([]);return u(()=>{a.value.push(e.event.on(l.MAP_EXTENTCHANGE,()=>{e.geo.map.keysActive&&(s.value=!0)})),a.value.push(e.event.on(l.MAP_FOCUS,()=>{e.geo.map.mouseFocus||(s.value=!0)})),a.value.push(e.event.on(l.MAP_MOUSEDOWN,()=>{s.value=!1})),a.value.push(e.event.on(l.MAP_BLUR,()=>{s.value=!1}))}),c(()=>{a.value.forEach(i=>e.event.off(i))}),(i,o)=>(f(),m("div",{class:w(["crosshairs absolute duration-150 top-1/2 left-1/2 h-230 w-230",{"opacity-0":!s.value}])},o[0]||(o[0]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},[t("g",{fill:"#545353",stroke:"#fff",id:"crosshairs"},[t("ellipse",{ry:".254",rx:".262",id:"path3808",cx:"12",cy:"12","stroke-width":".076"}),t("path",{d:"M.045 12.047l6.093.051 4.264.068v-.332l-4.264.067-6.093.064v.039z",id:"rect4632-6","stroke-width":".09"}),t("path",{d:"M12.047 23.955l.051-6.093.068-4.264h-.332l.067 4.264.064 6.093h.039z",id:"rect4632-6-0","stroke-width":".09"}),t("path",{d:"M23.955 11.953l-6.093-.051-4.264-.068v.332l4.264-.067 6.093-.064v-.039z",id:"rect4632-6-4","stroke-width":".09"}),t("path",{d:"M11.953.045l-.051 6.093-.068 4.264h.332l-.067-4.264-.064-6.093h-.039z",id:"rect4632-6-9","stroke-width":".09"})])],-1)]),2))}}),A=p(M,[["__scopeId","data-v-55a2f166"]]);class k extends v{added(){const{destroy:e,el:s}=this.mount(A,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e()}}}export{k as default}; +import{eT as r,eU as p,fq as v,eY as n,f6 as h,f8 as u,eV as l,f9 as c,e$ as f,fb as m,f2 as t,f3 as w}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";const M=r({__name:"crosshairs",setup(d){const e=n("iApi"),s=h(!1),a=h([]);return u(()=>{a.value.push(e.event.on(l.MAP_EXTENTCHANGE,()=>{e.geo.map.keysActive&&(s.value=!0)})),a.value.push(e.event.on(l.MAP_FOCUS,()=>{e.geo.map.mouseFocus||(s.value=!0)})),a.value.push(e.event.on(l.MAP_MOUSEDOWN,()=>{s.value=!1})),a.value.push(e.event.on(l.MAP_BLUR,()=>{s.value=!1}))}),c(()=>{a.value.forEach(i=>e.event.off(i))}),(i,o)=>(f(),m("div",{class:w(["crosshairs absolute duration-150 top-1/2 left-1/2 h-230 w-230",{"opacity-0":!s.value}])},o[0]||(o[0]=[t("svg",{xmlns:"http://www.w3.org/2000/svg",fit:"",height:"100%",width:"100%",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 24 24",focusable:"false"},[t("g",{fill:"#545353",stroke:"#fff",id:"crosshairs"},[t("ellipse",{ry:".254",rx:".262",id:"path3808",cx:"12",cy:"12","stroke-width":".076"}),t("path",{d:"M.045 12.047l6.093.051 4.264.068v-.332l-4.264.067-6.093.064v.039z",id:"rect4632-6","stroke-width":".09"}),t("path",{d:"M12.047 23.955l.051-6.093.068-4.264h-.332l.067 4.264.064 6.093h.039z",id:"rect4632-6-0","stroke-width":".09"}),t("path",{d:"M23.955 11.953l-6.093-.051-4.264-.068v.332l4.264-.067 6.093-.064v-.039z",id:"rect4632-6-4","stroke-width":".09"}),t("path",{d:"M11.953.045l-.051 6.093-.068 4.264h.332l-.067-4.264-.064-6.093h-.039z",id:"rect4632-6-9","stroke-width":".09"})])],-1)]),2))}}),A=p(M,[["__scopeId","data-v-55a2f166"]]);class k extends v{added(){const{destroy:e,el:s}=this.mount(A,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(s.childNodes[0]),this.removed=()=>{e()}}}export{k as default}; diff --git a/custom-toc-highlight/assets/index-WLSkOrf3-VEDWJShX.js b/custom-toc-highlight/assets/index-WLSkOrf3-CdD0dr9H.js similarity index 87% rename from custom-toc-highlight/assets/index-WLSkOrf3-VEDWJShX.js rename to custom-toc-highlight/assets/index-WLSkOrf3-CdD0dr9H.js index 5caf61b3..ae801ad4 100644 --- a/custom-toc-highlight/assets/index-WLSkOrf3-VEDWJShX.js +++ b/custom-toc-highlight/assets/index-WLSkOrf3-CdD0dr9H.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-BGsID61t-Co1xWElA.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./vue.esm-bundler-D2erd_gM-D0q3-bhf.js","./toggle-switch-control-B4JzuvHa-xR5vylCb.js"])))=>i.map(i=>d[i]); -import{_ as a}from"./main-ugzBrWNm.js";import{fu as n,eW as r,fq as o}from"./story-BfX8CRfG.js";class g extends o{toggleSettings(e,s){const t=this.$iApi.panel.get("settings");if(!t.isOpen&&s!==!1)this.$iApi.panel.open({id:"settings",props:{layer:e}});else{const l=t.route.props.layer.uid;s!==!0&&t.close(),l!==e.uid&&setTimeout(()=>{this.$iApi.panel.open({id:"settings",props:{layer:e}})},100)}}}const c={en:{"settings.title":"Settings","settings.layer.loading":"The layer is loading...","settings.label.display":"Display","settings.label.visibility":"Show layer","settings.label.opacity":"Opacity","settings.label.boundingBox":"Bounding box","settings.label.data":"Data","settings.label.identify":"Toggle identify","settings.label.interval":"Refresh interval","settings.label.refreshHint":"Refresh interval in minutes","settings.label.refreshOff":" Leave blank or 0 to turn off automatic refresh","settings.label.no.layer":"The layer has been removed"},fr:{"settings.title":"Paramètres","settings.layer.loading":"La couche est en cours de chargement...","settings.label.display":"Affichage","settings.label.visibility":"Afficher la couche","settings.label.opacity":"Opacité","settings.label.boundingBox":"Zone de délimitation","settings.label.data":"Données","settings.label.identify":"Basculer vers la désignation","settings.label.interval":"Intervalle d'actualisation","settings.label.refreshHint":"Intervalle d'actualisation en minutes","settings.label.refreshOff":"Laisser le champ vide ou y inscrire 0 pour désactiver l'actualisation automatique","settings.label.no.layer":"La couche a été supprimée."}};class h extends g{async added(){this.$iApi.panel.register({settings:{screens:{"settings-screen-content":()=>n(a(()=>import("./screen-BGsID61t-Co1xWElA.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url))},style:{width:"350px"},button:{tooltip:"settings.title",icon:''},alertName:"settings.title"}},{i18n:{messages:c}}),this.handlePanelTeleports(["settings"])}removed(){this.$iApi.fixture.exists("appbar")&&r(this.$vApp.$pinia).removeButton("settings"),this.$iApi.panel.remove("settings")}}export{h as default}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./screen-BGsID61t-BTqeBZJo.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./vue.esm-bundler-D2erd_gM-C7Afc0Sc.js","./toggle-switch-control-B4JzuvHa-B1HiDvC7.js"])))=>i.map(i=>d[i]); +import{_ as a}from"./main-QGPoLsvl.js";import{fu as n,eW as r,fq as o}from"./story-Doly9N9p.js";class g extends o{toggleSettings(e,s){const t=this.$iApi.panel.get("settings");if(!t.isOpen&&s!==!1)this.$iApi.panel.open({id:"settings",props:{layer:e}});else{const l=t.route.props.layer.uid;s!==!0&&t.close(),l!==e.uid&&setTimeout(()=>{this.$iApi.panel.open({id:"settings",props:{layer:e}})},100)}}}const c={en:{"settings.title":"Settings","settings.layer.loading":"The layer is loading...","settings.label.display":"Display","settings.label.visibility":"Show layer","settings.label.opacity":"Opacity","settings.label.boundingBox":"Bounding box","settings.label.data":"Data","settings.label.identify":"Toggle identify","settings.label.interval":"Refresh interval","settings.label.refreshHint":"Refresh interval in minutes","settings.label.refreshOff":" Leave blank or 0 to turn off automatic refresh","settings.label.no.layer":"The layer has been removed"},fr:{"settings.title":"Paramètres","settings.layer.loading":"La couche est en cours de chargement...","settings.label.display":"Affichage","settings.label.visibility":"Afficher la couche","settings.label.opacity":"Opacité","settings.label.boundingBox":"Zone de délimitation","settings.label.data":"Données","settings.label.identify":"Basculer vers la désignation","settings.label.interval":"Intervalle d'actualisation","settings.label.refreshHint":"Intervalle d'actualisation en minutes","settings.label.refreshOff":"Laisser le champ vide ou y inscrire 0 pour désactiver l'actualisation automatique","settings.label.no.layer":"La couche a été supprimée."}};class h extends g{async added(){this.$iApi.panel.register({settings:{screens:{"settings-screen-content":()=>n(a(()=>import("./screen-BGsID61t-BTqeBZJo.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url))},style:{width:"350px"},button:{tooltip:"settings.title",icon:''},alertName:"settings.title"}},{i18n:{messages:c}}),this.handlePanelTeleports(["settings"])}removed(){this.$iApi.fixture.exists("appbar")&&r(this.$vApp.$pinia).removeButton("settings"),this.$iApi.panel.remove("settings")}}export{h as default}; diff --git a/custom-toc-highlight/assets/index-sFd78-sx-DdarRIaz.js b/custom-toc-highlight/assets/index-sFd78-sx-Df2sAvfD.js similarity index 96% rename from custom-toc-highlight/assets/index-sFd78-sx-DdarRIaz.js rename to custom-toc-highlight/assets/index-sFd78-sx-Df2sAvfD.js index c0d7c5da..44de2134 100644 --- a/custom-toc-highlight/assets/index-sFd78-sx-DdarRIaz.js +++ b/custom-toc-highlight/assets/index-sFd78-sx-Df2sAvfD.js @@ -1 +1 @@ -import{eU as _,eT as $,eV as I,fw as u,eX as z,eY as A,fV as d,e_ as O,e$ as r,fb as p,fo as v,f1 as g,f2 as l,f4 as m,f6 as M,f8 as F,f9 as L,eZ as S,fa as b,fc as V,fl as w,fm as Z,f0 as x,fn as B,f5 as H,fq as P}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";const T={},q={class:"border-b p-0 self-center w-2/3"};function N(c,a){return r(),p("span",q)}const k=_(T,[["render",N]]),Y=$({__name:"zoom-nav",setup(c){const{t:a}=z(),t=A("iApi"),e=d(400,!0,()=>t.geo.map.zoomIn()),s=d(400,!0,()=>t.geo.map.zoomOut());return(o,i)=>{const n=O("mapnav-button");return r(),p("div",null,[v(n,{onClickFunction:m(e),tooltip:m(a)("mapnav.zoomIn")},{default:g(()=>i[0]||(i[0]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[l("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),l("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"]),v(k),v(n,{onClickFunction:m(s),tooltip:m(a)("mapnav.zoomOut")},{default:g(()=>i[1]||(i[1]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[l("path",{d:"M19 13H5v-2h14v2z"}),l("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"])])}}}),j={class:"mapnav absolute right-0 bottom-0 pb-36 sm:pb-48 pr-12"},W=["content"],D={class:"mapnav-section bg-white-75 hover:bg-white"},G=$({__name:"mapnav",setup(c){const a=u(),{t}=z(),e=M(),s=()=>{e.value._tippy.hide()},o=n=>{n.key==="Tab"&&e.value?.matches(":focus")&&e.value._tippy.show()};F(()=>{e.value?.addEventListener("blur",s),e.value?.addEventListener("keyup",o)}),L(()=>{e.value?.removeEventListener("blur",s),e.value?.removeEventListener("keyup",o)});const i=S(()=>a.order.map(n=>a.items[n]).filter(n=>n.componentId));return(n,h)=>{const y=b("focus-list"),E=b("tippy");return r(),p("div",j,[V((r(),p("div",{class:"flex flex-col",content:m(t)("panels.controls.items"),ref_key:"el",ref:e},[v(Y,{class:"mapnav-section bg-white-75 hover:bg-white"}),h[0]||(h[0]=l("span",{class:"py-1"},null,-1)),l("div",D,[(r(!0),p(w,null,Z(i.value,(f,C)=>(r(),p(w,{key:f.id+"button"},[(r(),x(B(f.id+"-nav-button"))),C!==i.value.length-1?(r(),x(k,{key:0,class:"mapnav-divider"})):H("",!0)],64))),128))])],8,W)),[[y],[E,{trigger:"manual",placement:"top-end",touch:!1,maxWidth:190}]])])}}}),U=_(G,[["__scopeId","data-v-41a5c7b7"]]);class J extends P{mapnavStore=u(this.$vApp.$pinia);get config(){return super.config}_parseConfig(a){if(!a)return;const t=a.items.map(e=>({id:e}));this.mapnavStore.items=t.reduce((e,s)=>(e[s.id]=s,e),{}),this.mapnavStore.order=t.map(e=>e.id),this._validateItems()}_validateItems(){const a=["geolocator","zoom","home","fullscreen"];this.mapnavStore.order.forEach(t=>{(this.$iApi.fixture.exists(t)||a.includes(t))&&(this.mapnavStore.items[t].componentId=`${t}-nav-button`)})}}const K={en:{"mapnav.zoomIn":"Zoom In","mapnav.zoomOut":"Zoom Out","mapnav.home":"Home","mapnav.fullscreen":"Full Screen","mapnav.geolocator":"Your Location","mapnav.geolocator.error.permission":"The location request was denied. Please check your browser permission settings.","mapnav.geolocator.error.internal":"Your location could not be found."},fr:{"mapnav.zoomIn":"Zoom avant","mapnav.zoomOut":"Zoom arrière","mapnav.home":"Accueil","mapnav.fullscreen":"Plein Écran","mapnav.geolocator":"Votre position","mapnav.geolocator.error.permission":"Demande de localisation refusée. Veuillez vérifier les paramètres d'autorisation de votre navigateur.","mapnav.geolocator.error.internal":"Votre emplacement n'a pu être trouvé."}};class X extends J{async added(){Object.entries(K).forEach(o=>this.$iApi.$i18n.mergeLocaleMessage(...o));const{destroy:a,el:t}=this.mount(U,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,o=>this._parseConfig(o)),s=this.$iApi.event.on(I.COMPONENT,()=>{this._parseConfig(this.config)});this.removed=()=>{e(),this.$iApi.event.off(s);const o=u(this.$vApp.$pinia),i={...o.items};Object.keys(i).forEach(n=>o.removeItem(n)),o.$reset(),a()}}}export{X as default}; +import{eU as _,eT as $,eV as I,fw as u,eX as z,eY as A,fV as d,e_ as O,e$ as r,fb as p,fo as v,f1 as g,f2 as l,f4 as m,f6 as M,f8 as F,f9 as L,eZ as S,fa as b,fc as V,fl as w,fm as Z,f0 as x,fn as B,f5 as H,fq as P}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";const T={},q={class:"border-b p-0 self-center w-2/3"};function N(c,a){return r(),p("span",q)}const k=_(T,[["render",N]]),Y=$({__name:"zoom-nav",setup(c){const{t:a}=z(),t=A("iApi"),e=d(400,!0,()=>t.geo.map.zoomIn()),s=d(400,!0,()=>t.geo.map.zoomOut());return(o,i)=>{const n=O("mapnav-button");return r(),p("div",null,[v(n,{onClickFunction:m(e),tooltip:m(a)("mapnav.zoomIn")},{default:g(()=>i[0]||(i[0]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[l("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),l("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"]),v(k),v(n,{onClickFunction:m(s),tooltip:m(a)("mapnav.zoomOut")},{default:g(()=>i[1]||(i[1]=[l("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",class:"fill-current w-32 h-20"},[l("path",{d:"M19 13H5v-2h14v2z"}),l("path",{d:"M0 0h24v24H0z",fill:"none"})],-1)])),_:1},8,["onClickFunction","tooltip"])])}}}),j={class:"mapnav absolute right-0 bottom-0 pb-36 sm:pb-48 pr-12"},W=["content"],D={class:"mapnav-section bg-white-75 hover:bg-white"},G=$({__name:"mapnav",setup(c){const a=u(),{t}=z(),e=M(),s=()=>{e.value._tippy.hide()},o=n=>{n.key==="Tab"&&e.value?.matches(":focus")&&e.value._tippy.show()};F(()=>{e.value?.addEventListener("blur",s),e.value?.addEventListener("keyup",o)}),L(()=>{e.value?.removeEventListener("blur",s),e.value?.removeEventListener("keyup",o)});const i=S(()=>a.order.map(n=>a.items[n]).filter(n=>n.componentId));return(n,h)=>{const y=b("focus-list"),E=b("tippy");return r(),p("div",j,[V((r(),p("div",{class:"flex flex-col",content:m(t)("panels.controls.items"),ref_key:"el",ref:e},[v(Y,{class:"mapnav-section bg-white-75 hover:bg-white"}),h[0]||(h[0]=l("span",{class:"py-1"},null,-1)),l("div",D,[(r(!0),p(w,null,Z(i.value,(f,C)=>(r(),p(w,{key:f.id+"button"},[(r(),x(B(f.id+"-nav-button"))),C!==i.value.length-1?(r(),x(k,{key:0,class:"mapnav-divider"})):H("",!0)],64))),128))])],8,W)),[[y],[E,{trigger:"manual",placement:"top-end",touch:!1,maxWidth:190}]])])}}}),U=_(G,[["__scopeId","data-v-41a5c7b7"]]);class J extends P{mapnavStore=u(this.$vApp.$pinia);get config(){return super.config}_parseConfig(a){if(!a)return;const t=a.items.map(e=>({id:e}));this.mapnavStore.items=t.reduce((e,s)=>(e[s.id]=s,e),{}),this.mapnavStore.order=t.map(e=>e.id),this._validateItems()}_validateItems(){const a=["geolocator","zoom","home","fullscreen"];this.mapnavStore.order.forEach(t=>{(this.$iApi.fixture.exists(t)||a.includes(t))&&(this.mapnavStore.items[t].componentId=`${t}-nav-button`)})}}const K={en:{"mapnav.zoomIn":"Zoom In","mapnav.zoomOut":"Zoom Out","mapnav.home":"Home","mapnav.fullscreen":"Full Screen","mapnav.geolocator":"Your Location","mapnav.geolocator.error.permission":"The location request was denied. Please check your browser permission settings.","mapnav.geolocator.error.internal":"Your location could not be found."},fr:{"mapnav.zoomIn":"Zoom avant","mapnav.zoomOut":"Zoom arrière","mapnav.home":"Accueil","mapnav.fullscreen":"Plein Écran","mapnav.geolocator":"Votre position","mapnav.geolocator.error.permission":"Demande de localisation refusée. Veuillez vérifier les paramètres d'autorisation de votre navigateur.","mapnav.geolocator.error.internal":"Votre emplacement n'a pu être trouvé."}};class X extends J{async added(){Object.entries(K).forEach(o=>this.$iApi.$i18n.mergeLocaleMessage(...o));const{destroy:a,el:t}=this.mount(U,{app:this.$element});this.$vApp.$el.getElementsByClassName("inner-shell")[0].appendChild(t.childNodes[0]),this._parseConfig(this.config);const e=this.$vApp.$watch(()=>this.config,o=>this._parseConfig(o)),s=this.$iApi.event.on(I.COMPONENT,()=>{this._parseConfig(this.config)});this.removed=()=>{e(),this.$iApi.event.off(s);const o=u(this.$vApp.$pinia),i={...o.items};Object.keys(i).forEach(n=>o.removeItem(n)),o.$reset(),a()}}}export{X as default}; diff --git a/custom-toc-highlight/assets/input2-eOtqu-iO-DwuPmAAc.js b/custom-toc-highlight/assets/input2-eOtqu-iO-DiRyHCWP.js similarity index 98% rename from custom-toc-highlight/assets/input2-eOtqu-iO-DwuPmAAc.js rename to custom-toc-highlight/assets/input2-eOtqu-iO-DiRyHCWP.js index 139c7265..adacb095 100644 --- a/custom-toc-highlight/assets/input2-eOtqu-iO-DwuPmAAc.js +++ b/custom-toc-highlight/assets/input2-eOtqu-iO-DiRyHCWP.js @@ -1,4 +1,4 @@ -import{p as k,b as w,a as n,D as O,f as N,W as v,n as T}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{b as g,p as A,L as P,w as W,A as E}from"./dom-N58V0tYi-DBU3jlah.js";import{D as $,H as K,y as V,N as j,P as U}from"./form-CRSw616T-DZVFUlxN.js";import{l as R,p as q}from"./interactive-DqhNilgd-BPt2o3jA.js";import{e as _}from"./key-CZySMiwx-kmS7VeUz.js";import{b as G,I as X,M as H}from"./label-Dys24PJn-BCewo2Re.js";import{o as J,r as Q,f as Y}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{X as u,h as p,B as Z,T as ee,H as te,K as ie,q as ne,s as ae}from"./locale-Cn_GDVD_-Ar3RKmd3.js";import{c as se}from"./observers-BigwqTsw-BNRQivHR.js";import{l as oe,d as re,M as le,h as ce}from"./t9n-C_hcZMZJ-D4zmKT16.js";import{e as m}from"./component-CWGf1hug-BASJpoEG.js";import{m as L}from"./icon-BXFbBbop-BUyrjp8g.js";const ue={validationContainer:"validation-container"},de=({scale:e,status:t,id:i,icon:s,message:a})=>n("div",{class:ue.validationContainer},n("calcite-input-message",{"aria-live":"polite",icon:s,id:i,scale:e,status:t},a)),he=["date","datetime-local","month","number","range","time","week"],pe=["email","password","search","tel","text","url"],be=["email","password","search","tel","text","textarea","url"];function b(e,t,i,s){const a=i.toLowerCase(),o=e[i];s&&o!=null?t.setAttribute(a,`${o}`):t.removeAttribute(a)}function me(e,t,i){i.type=e==="textarea"?"text":e;const s=he.includes(e),a=t;b(a,i,"min",s),b(a,i,"max",s),b(a,i,"step",s);const o=be.includes(e),l=t;b(l,i,"minLength",o),b(l,i,"maxLength",o);const c=pe.includes(e);b(l,i,"pattern",c)}const C={valid:"check-circle",invalid:"exclamation-mark-triangle",idle:"information"},fe=":host{box-sizing:border-box;display:flex;block-size:auto;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);opacity:1;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;--calcite-input-message-spacing-value:0.25rem;margin-block-start:var(--calcite-input-message-spacing-value)}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-color-status-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-color-status-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-color-status-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-color-brand)}:host([scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([scale=m]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([hidden]){display:none}[hidden]{display:none}",ve=fe,ge=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.status="idle"}handleIconEl(){this.requestedIcon=g(C,this.icon,this.status)}connectedCallback(){this.requestedIcon=g(C,this.icon,this.status)}render(){const e=this.el.hidden;return n(O,{key:"c7d1b37721cec28dee1020b81ff66dee7fc8bc44","calcite-hydrated-hidden":e},this.renderIcon(this.requestedIcon),n("slot",{key:"7147d81e906765c154b4a61e31706a72c1ef3ae0"}))}renderIcon(e){if(e)return n("calcite-icon",{class:"calcite-input-message-icon",flipRtl:this.iconFlipRtl,icon:e,scale:"s"})}get el(){return this}static get watchers(){return{status:["handleIconEl"],icon:["handleIconEl"]}}static get style(){return ve}},[1,"calcite-input-message",{icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],status:[513]},void 0,{status:["handleIconEl"],icon:["handleIconEl"]}]);function B(){typeof customElements>"u"||["calcite-input-message","calcite-icon"].forEach(e=>{switch(e){case"calcite-input-message":customElements.get(e)||customElements.define(e,ge);break;case"calcite-icon":customElements.get(e)||L();break}})}B();const ye=":host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:var(--calcite-z-index);inline-size:100%;overflow:hidden;background-color:var(--calcite-progress-background-color, var(--calcite-color-border-3))}.bar{z-index:var(--calcite-z-index);background-color:var(--calcite-progress-fill-color, var(--calcite-color-brand))}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) / var(--calcite-internal-duration-factor) * 11 / var(--calcite-internal-duration-factor)) linear infinite}.indeterminate.calcite--rtl{animation-name:looping-progress-bar-ani-rtl}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-progress-text-color, var(--calcite-color-text-2))}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}@keyframes looping-progress-bar-ani-rtl{0%{transform:translate3d(100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(-600%, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",xe=ye,ke=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.type="determinate",this.value=0,this.label=void 0,this.text=void 0,this.reversed=!1}render(){const e=this.type==="determinate"?{width:`${this.value*100}%`}:{},t=A(this.el);return n("div",{key:"92597fefec948e4494425db28cd87bfad3cc76f8","aria-label":this.label||this.text,"aria-valuemax":1,"aria-valuemin":0,"aria-valuenow":this.value,role:"progressbar"},n("div",{key:"d2a8ec085909b4bd35f443d0e831d645fb159317",class:"track"},n("div",{key:"2dd26e56a0f344d02f1b4068167f61d9da4d2cbd",class:{bar:!0,indeterminate:this.type==="indeterminate",[N.rtl]:t==="rtl",reversed:this.reversed},style:e})),this.text?n("div",{class:"text"},this.text):null)}get el(){return this}static get style(){return xe}},[1,"calcite-progress",{type:[513],value:[2],label:[1],text:[1],reversed:[516]}]);function M(){typeof customElements>"u"||["calcite-progress"].forEach(e=>{switch(e){case"calcite-progress":customElements.get(e)||customElements.define(e,ke);break}})}M();const r={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",numberButtonWrapper:"number-button-wrapper",buttonItemHorizontal:"number-button-item--horizontal",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper",numberButtonItem:"number-button-item"},x={validationMessage:"inputValidationMessage"},D={tel:"phone",password:"lock",email:"email-address",date:"calendar",time:"clock",search:"search"},we={action:"action"},ze=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{block-size:1.5rem;min-block-size:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) input[type=file]{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=s]) textarea{block-size:auto;padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-block-size:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) input[type=file]{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=m]) textarea{block-size:auto;padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-block-size:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) input[type=file]{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([scale=l]) textarea{block-size:auto;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}textarea,input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-color-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-1)}input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input,textarea{text-overflow:ellipsis;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);color:var(--calcite-color-text-1)}input:placeholder-shown,textarea:placeholder-shown{text-overflow:ellipsis}input:focus,textarea:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-text-1)}input[readonly],textarea[readonly]{background-color:var(--calcite-color-background);font-weight:var(--calcite-font-weight-medium)}input[readonly]:focus,textarea[readonly]:focus{color:var(--calcite-color-text-1)}calcite-icon{color:var(--calcite-color-text-3)}textarea,input{outline-color:transparent}textarea:focus,input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( +import{p as k,b as w,a as n,D as O,f as N,W as v,n as T}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{b as g,p as A,L as P,w as W,A as E}from"./dom-N58V0tYi-DBU3jlah.js";import{D as $,H as K,y as V,N as j,P as U}from"./form-CRSw616T-wY3ZjFlq.js";import{l as R,p as q}from"./interactive-DqhNilgd-BbTDbq0n.js";import{e as _}from"./key-CZySMiwx-kmS7VeUz.js";import{b as G,I as X,M as H}from"./label-Dys24PJn-BCewo2Re.js";import{o as J,r as Q,f as Y}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{X as u,h as p,B as Z,T as ee,H as te,K as ie,q as ne,s as ae}from"./locale-Cn_GDVD_-CCUxSwPB.js";import{c as se}from"./observers-BigwqTsw-CfIXp3Nz.js";import{l as oe,d as re,M as le,h as ce}from"./t9n-C_hcZMZJ-Du2NPCXI.js";import{e as m}from"./component-CWGf1hug-BASJpoEG.js";import{m as L}from"./icon-BXFbBbop-Bq4Zv26A.js";const ue={validationContainer:"validation-container"},de=({scale:e,status:t,id:i,icon:s,message:a})=>n("div",{class:ue.validationContainer},n("calcite-input-message",{"aria-live":"polite",icon:s,id:i,scale:e,status:t},a)),he=["date","datetime-local","month","number","range","time","week"],pe=["email","password","search","tel","text","url"],be=["email","password","search","tel","text","textarea","url"];function b(e,t,i,s){const a=i.toLowerCase(),o=e[i];s&&o!=null?t.setAttribute(a,`${o}`):t.removeAttribute(a)}function me(e,t,i){i.type=e==="textarea"?"text":e;const s=he.includes(e),a=t;b(a,i,"min",s),b(a,i,"max",s),b(a,i,"step",s);const o=be.includes(e),l=t;b(l,i,"minLength",o),b(l,i,"maxLength",o);const c=pe.includes(e);b(l,i,"pattern",c)}const C={valid:"check-circle",invalid:"exclamation-mark-triangle",idle:"information"},fe=":host{box-sizing:border-box;display:flex;block-size:auto;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);opacity:1;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;--calcite-input-message-spacing-value:0.25rem;margin-block-start:var(--calcite-input-message-spacing-value)}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-color-status-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-color-status-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-color-status-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-color-brand)}:host([scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([scale=m]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([hidden]){display:none}[hidden]{display:none}",ve=fe,ge=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.status="idle"}handleIconEl(){this.requestedIcon=g(C,this.icon,this.status)}connectedCallback(){this.requestedIcon=g(C,this.icon,this.status)}render(){const e=this.el.hidden;return n(O,{key:"c7d1b37721cec28dee1020b81ff66dee7fc8bc44","calcite-hydrated-hidden":e},this.renderIcon(this.requestedIcon),n("slot",{key:"7147d81e906765c154b4a61e31706a72c1ef3ae0"}))}renderIcon(e){if(e)return n("calcite-icon",{class:"calcite-input-message-icon",flipRtl:this.iconFlipRtl,icon:e,scale:"s"})}get el(){return this}static get watchers(){return{status:["handleIconEl"],icon:["handleIconEl"]}}static get style(){return ve}},[1,"calcite-input-message",{icon:[520],iconFlipRtl:[516,"icon-flip-rtl"],scale:[513],status:[513]},void 0,{status:["handleIconEl"],icon:["handleIconEl"]}]);function B(){typeof customElements>"u"||["calcite-input-message","calcite-icon"].forEach(e=>{switch(e){case"calcite-input-message":customElements.get(e)||customElements.define(e,ge);break;case"calcite-icon":customElements.get(e)||L();break}})}B();const ye=":host{position:relative;display:block;inline-size:100%}.track,.bar{position:absolute;inset-block-start:0px;block-size:2px}.track{z-index:var(--calcite-z-index);inline-size:100%;overflow:hidden;background-color:var(--calcite-progress-background-color, var(--calcite-color-border-3))}.bar{z-index:var(--calcite-z-index);background-color:var(--calcite-progress-fill-color, var(--calcite-color-brand))}@media (forced-colors: active){.track{background-color:highlightText}.bar{background-color:linkText}}.indeterminate{inline-size:20%;animation:looping-progress-bar-ani calc(var(--calcite-internal-animation-timing-medium) / var(--calcite-internal-duration-factor) * 11 / var(--calcite-internal-duration-factor)) linear infinite}.indeterminate.calcite--rtl{animation-name:looping-progress-bar-ani-rtl}.reversed{animation-direction:reverse}.text{padding-inline:0px;padding-block:1rem 0px;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-progress-text-color, var(--calcite-color-text-2))}@keyframes looping-progress-bar-ani{0%{transform:translate3d(-100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(600%, 0, 0)}}@keyframes looping-progress-bar-ani-rtl{0%{transform:translate3d(100%, 0, 0)}50%{inline-size:40%}100%{transform:translate3d(-600%, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}",xe=ye,ke=k(class extends w{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.type="determinate",this.value=0,this.label=void 0,this.text=void 0,this.reversed=!1}render(){const e=this.type==="determinate"?{width:`${this.value*100}%`}:{},t=A(this.el);return n("div",{key:"92597fefec948e4494425db28cd87bfad3cc76f8","aria-label":this.label||this.text,"aria-valuemax":1,"aria-valuemin":0,"aria-valuenow":this.value,role:"progressbar"},n("div",{key:"d2a8ec085909b4bd35f443d0e831d645fb159317",class:"track"},n("div",{key:"2dd26e56a0f344d02f1b4068167f61d9da4d2cbd",class:{bar:!0,indeterminate:this.type==="indeterminate",[N.rtl]:t==="rtl",reversed:this.reversed},style:e})),this.text?n("div",{class:"text"},this.text):null)}get el(){return this}static get style(){return xe}},[1,"calcite-progress",{type:[513],value:[2],label:[1],text:[1],reversed:[516]}]);function M(){typeof customElements>"u"||["calcite-progress"].forEach(e=>{switch(e){case"calcite-progress":customElements.get(e)||customElements.define(e,ke);break}})}M();const r={loader:"loader",clearButton:"clear-button",editingEnabled:"editing-enabled",inlineChild:"inline-child",inputIcon:"icon",prefix:"prefix",suffix:"suffix",numberButtonWrapper:"number-button-wrapper",buttonItemHorizontal:"number-button-item--horizontal",wrapper:"element-wrapper",inputWrapper:"wrapper",actionWrapper:"action-wrapper",resizeIconWrapper:"resize-icon-wrapper",numberButtonItem:"number-button-item"},x={validationMessage:"inputValidationMessage"},D={tel:"phone",password:"lock",email:"email-address",date:"calendar",time:"clock",search:"search"},we={action:"action"},ze=`:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{block-size:1.5rem;min-block-size:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) input[type=file]{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=s]) textarea{block-size:auto;padding-block:0.25rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-block-size:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) input[type=file]{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=m]) textarea{block-size:auto;padding-block:0.5rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-block-size:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) input[type=file]{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([scale=l]) textarea{block-size:auto;padding-block:0.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}textarea,input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-color-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-1)}input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input,textarea{text-overflow:ellipsis;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-input);color:var(--calcite-color-text-1)}input:placeholder-shown,textarea:placeholder-shown{text-overflow:ellipsis}input:focus,textarea:focus{border-color:var(--calcite-color-brand);color:var(--calcite-color-text-1)}input[readonly],textarea[readonly]{background-color:var(--calcite-color-background);font-weight:var(--calcite-font-weight-medium)}input[readonly]:focus,textarea[readonly]:focus{color:var(--calcite-color-text-1)}calcite-icon{color:var(--calcite-color-text-3)}textarea,input{outline-color:transparent}textarea:focus,input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( -2px * calc( 1 - diff --git a/custom-toc-highlight/assets/interactive-DqhNilgd-BPt2o3jA.js b/custom-toc-highlight/assets/interactive-DqhNilgd-BbTDbq0n.js similarity index 93% rename from custom-toc-highlight/assets/interactive-DqhNilgd-BPt2o3jA.js rename to custom-toc-highlight/assets/interactive-DqhNilgd-BbTDbq0n.js index a1570368..1296bbeb 100644 --- a/custom-toc-highlight/assets/interactive-DqhNilgd-BPt2o3jA.js +++ b/custom-toc-highlight/assets/interactive-DqhNilgd-BbTDbq0n.js @@ -1 +1 @@ -import{a as r}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";function c(){const{disabled:e}=this;e||HTMLElement.prototype.click.call(this)}function i(e){e.target.disabled&&e.preventDefault()}const o=["mousedown","mouseup","click"];function a(e){e.target.disabled&&(e.stopImmediatePropagation(),e.preventDefault())}const t={capture:!0};function p(e){if(e.disabled){e.el.setAttribute("aria-disabled","true"),e.el.contains(document.activeElement)&&document.activeElement.blur(),l(e);return}s(e),e.el.removeAttribute("aria-disabled")}function l(e){e.el.click=c,d(e.el)}function d(e){e.addEventListener("pointerdown",i,t),o.forEach(n=>e.addEventListener(n,a,t))}function s(e){delete e.el.click,u(e.el)}function u(e){e.removeEventListener("pointerdown",i,t),o.forEach(n=>e.removeEventListener(n,a,t))}const f={container:"interaction-container"},v=({disabled:e},n)=>r("div",{class:f.container,inert:e},...n);export{p as l,v as p}; +import{a as r}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";function c(){const{disabled:e}=this;e||HTMLElement.prototype.click.call(this)}function i(e){e.target.disabled&&e.preventDefault()}const o=["mousedown","mouseup","click"];function a(e){e.target.disabled&&(e.stopImmediatePropagation(),e.preventDefault())}const t={capture:!0};function p(e){if(e.disabled){e.el.setAttribute("aria-disabled","true"),e.el.contains(document.activeElement)&&document.activeElement.blur(),l(e);return}s(e),e.el.removeAttribute("aria-disabled")}function l(e){e.el.click=c,d(e.el)}function d(e){e.addEventListener("pointerdown",i,t),o.forEach(n=>e.addEventListener(n,a,t))}function s(e){delete e.el.click,u(e.el)}function u(e){e.removeEventListener("pointerdown",i,t),o.forEach(n=>e.removeEventListener(n,a,t))}const f={container:"interaction-container"},v=({disabled:e},n)=>r("div",{class:f.container,inert:e},...n);export{p as l,v as p}; diff --git a/custom-toc-highlight/assets/item-DaimTDdD-BK_A0qEn.js b/custom-toc-highlight/assets/item-DaimTDdD-CosqhjDY.js similarity index 99% rename from custom-toc-highlight/assets/item-DaimTDdD-BK_A0qEn.js rename to custom-toc-highlight/assets/item-DaimTDdD-CosqhjDY.js index b9e38d17..743d2869 100644 --- a/custom-toc-highlight/assets/item-DaimTDdD-BK_A0qEn.js +++ b/custom-toc-highlight/assets/item-DaimTDdD-CosqhjDY.js @@ -1 +1 @@ -import{eT as Y,eX as ne,f6 as H,f8 as ce,fa as q,e$ as t,fb as n,fc as k,f2 as o,f4 as l,gb as x,gc as ie,f3 as M,fS as v,eY as ge,fh as me,eZ as U,gy as u,gg as C,e_ as ye,fo as fe,f1 as re,fG as Z,fg as w,eU as oe,fl as te,fm as ae,fF as Le,f5 as p,gj as xe,fQ as ke,f7 as we,jp as b,jq as _,jr as de,f0 as j,fR as Me,js as O,fn as Ce,fT as Te,gr as ze,eV as W,jt as Se,ju as ee}from"./story-BfX8CRfG.js";import{u as He}from"./marked.esm-DgqJBp_S-CCvGNfAT.js";import"./main-ugzBrWNm.js";const Ee=["type","aria-label","checked","disabled","content"],le=Y({__name:"checkbox",props:{value:{type:Object,required:!0},legendItem:{type:Object,required:!0},checked:{type:Boolean},label:{type:String},isRadio:{type:Boolean},disabled:{type:Boolean}},setup(e){const{t:y}=ne(),i=e,m=H(i.legendItem.visibility);ce(()=>{i.legendItem.checkVisibilityRules(),m.value=i.legendItem.visibility===i.checked});const I=s=>!s.symbologyStack.some(r=>r.visibility),B=()=>{if(i.value instanceof Te)i.legendItem.toggleVisibility();else if(i.legendItem instanceof v){if(I(i.legendItem)?(i.legendItem.setSymbologyVisibility(void 0,!1),i.legendItem.setSymbologyVisibility(i.value.uid,!0),i.legendItem.toggleVisibility(!0)):i.legendItem.setSymbologyVisibility(i.value.uid,!i.value.lastVisbility),I(i.legendItem)&&i.legendItem.toggleVisibility(!1),i.legendItem.layer?.supportsFeatures){const s=i.legendItem.symbologyStack.filter(z=>z.lastVisbility===!0).map(z=>z.definitionClause||"");let r="";s.length===0?r="1=2":s.length{const z=q("tippy");return t(),n("div",{class:"relative",onMouseover:r[3]||(r[3]=x(()=>{},["stop"]))},[k(o("input",{type:e.isRadio?"radio":"checkbox","aria-label":l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`),onClick:r[0]||(r[0]=x(G=>B(),["stop"])),checked:e.checked&&m.value,onKeypress:r[1]||(r[1]=ie(x(()=>{},["prevent"]),["enter"])),onKeyup:r[2]||(r[2]=ie(x(G=>B(),["stop"]),["enter"])),class:M([[e.disabled?"text-gray-400 border-gray-300":"text-black cursor-pointer border-gray-500 hover:border-black"],"mx-5 h-15 w-15"]),tabindex:"-1",disabled:e.disabled,content:l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`)},null,42,Ee),[[z,{placement:"top-end",hideOnClick:!1}]])],32)}}}),Ve=["aria-label"],Ae=["aria-label"],Ze=["aria-label"],Be=["aria-label"],_e=["aria-label"],je=["aria-label"],Ue=["content","aria-label"],$e=Y({__name:"legend-options",props:{legendItem:v},setup(e){const{t:y}=ne(),i=ge("iApi"),m=H(),I=H(!1),B=me(),s=H(B.mobileView),r=e,z=()=>{r.legendItem.layerControlAvailable(u.Symbology)&&r.legendItem.toggleSymbology()},G=()=>{r.legendItem.layerControlAvailable(u.Datatable)&&A("grid")&&i.event.emit(W.GRID_TOGGLE,r.legendItem.layer)},D=()=>{r.legendItem.layerControlAvailable(u.Settings)&&A("settings")&&i.event.emit(W.SETTINGS_TOGGLE,r.legendItem.layer)},Q=()=>{if(r.legendItem.layerControlAvailable(u.Metadata)&&A("metadata")){const S=r.legendItem?.layer?.config.metadata||r.legendItem?.layer?.parentLayer?.config?.metadata||{},c=S?.name||r.legendItem?.layer?.name||"",f=r.legendItem?.layer?.config?.catalogueUrl||r.legendItem?.layer?.layerType==="sublayer"&&r.legendItem?.layer?.parentLayer?.config?.catalogueUrl||void 0;if(S.url){const $=S.url.split("."),E=$[$.length-1],X=E==="xml"||E==="md"?E:"html";i.event.emit(W.METADATA_TOGGLE,{type:X,layerName:c,url:S.url,catalogueUrl:f,layer:r.legendItem.layer})}else console.warn("Layer does not have a metadata url defined")}},V=()=>{r.legendItem.layerControlAvailable(u.BoundaryZoom)&&r.legendItem?.layer?.zoomToLayerBoundary()},N=()=>{r.legendItem.layerControlAvailable(u.Remove)&&i.geo.map.removeLayer(r.legendItem.layerUid)},P=()=>{R.value&&(C(r.legendItem.layer).reload(),m.value.open=!1)},R=U(()=>r.legendItem.layerControlAvailable(u.Reload)&&r.legendItem instanceof v&&C(r.legendItem.layer)?.canReload),J=S=>{I.value=!0,setTimeout(()=>{I.value&&(s.value||S._tippy?.show())},300)},A=S=>{try{return i.fixture.exists(S)}catch{return!1}};return(S,c)=>{const f=ye("dropdown-menu"),$=q("tippy");return t(),n("div",{onClick:c[2]||(c[2]=x(()=>{},["stop"])),onMouseover:c[3]||(c[3]=x(()=>{},["stop"])),class:"options display-block cursor-auto"},[fe(f,{class:"flex-shrink-0",position:"bottom-end",tooltip:l(y)("legend.layer.options"),tooltipPlacement:"left",tooltipPlacementAlt:"left",ref_key:"dropdown",ref:m},{header:re(()=>c[4]||(c[4]=[o("div",{class:"flex p-4 justify-center items-center"},[o("svg",{class:"inline-block fill-current w-18 h-18 mx-4",viewBox:"0 0 23 21"},[o("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})])],-1)])),default:re(()=>[o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Metadata)||!A("metadata")}]),onClick:Q,role:"button","aria-label":l(y)("legend.layer.controls.metadata")},[c[5]||(c[5]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.metadata")),1)],10,Ve),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Settings)||!A("settings")}]),onClick:D,role:"button","aria-label":l(y)("legend.layer.controls.settings")},[c[6]||(c[6]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("g",null,[o("path",{d:"M 3,17L 3,19L 9,19L 9,17L 3,17 Z M 3,5L 3,7L 13,7L 13,5L 3,5 Z M 13,21L 13,19L 21,19L 21,17L 13,17L 13,15L 11,15L 11,21L 13,21 Z M 7,9L 7,11L 3,11L 3,13L 7,13L 7,15L 9,15L 9,9L 7,9 Z M 21,13L 21,11L 11,11L 11,13L 21,13 Z M 15,9L 17,9L 17,7L 21,7L 21,5L 17,5L 17,3L 15,3L 15,9 Z "})])],-1)),Z(" "+w(l(y)("legend.layer.controls.settings")),1)],10,Ae),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Datatable)||!A("grid")}]),onClick:G,role:"button","aria-label":l(y)("legend.layer.controls.datatable")},[c[7]||(c[7]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M 4.00002,3L 20,3C 21.1046,3 22,3.89543 22,5L 22,20C 22,21.1046 21.1046,22 20,22L 4.00001,22C 2.89544,22 2.00001,21.1046 2.00001,20L 2.00002,5C 2.00002,3.89543 2.89545,3 4.00002,3 Z M 4.00002,7L 4.00001,10L 8,10L 8,7.00001L 4.00002,7 Z M 10,7.00001L 9.99999,10L 14,10L 14,7.00001L 10,7.00001 Z M 20,10L 20,7L 16,7.00001L 16,10L 20,10 Z M 4.00002,12L 4.00002,15L 8,15L 8,12L 4.00002,12 Z M 4.00001,20L 8,20L 8,17L 4.00002,17L 4.00001,20 Z M 9.99999,12L 9.99999,15L 14,15L 14,12L 9.99999,12 Z M 9.99999,20L 14,20L 14,17L 9.99999,17L 9.99999,20 Z M 20,20L 20,17L 16,17L 16,20L 20,20 Z M 20,12L 16,12L 16,15L 20,15L 20,12 Z "})],-1)),Z(" "+w(l(y)("legend.layer.controls.datatable")),1)],10,Ze),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Symbology)}]),onClick:z,role:"button","aria-label":l(y)("legend.layer.controls.symbology")},[c[8]||(c[8]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.symbology")),1)],10,Be),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).BoundaryZoom)}]),onClick:V,role:"button","aria-label":l(y)("legend.layer.controls.boundaryzoom")},[c[9]||(c[9]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.boundaryzoom")),1)],10,_e),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Remove)}]),onClick:N,role:"button","aria-label":l(y)("legend.layer.controls.remove")},[c[10]||(c[10]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.remove")),1)],10,je),k((t(),n("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!R.value}]),content:R.value?"":l(y)("legend.layer.controls.reloadDisabled"),onMouseover:c[0]||(c[0]=x(E=>J(E.currentTarget),["stop"])),onMouseout:c[1]||(c[1]=E=>(s.value||E.currentTarget?._tippy?.hide(),I.value=!1)),onClick:P,role:"button","aria-label":l(y)("legend.layer.controls.reload")},[c[11]||(c[11]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.reload")),1)],42,Ue)),[[$,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]])]),_:1},8,["tooltip"])],32)}}}),Ge=oe($e,[["__scopeId","data-v-9590866e"]]),Pe={key:0},Re={key:0,class:"relative left-3"},Oe=["innerHTML"],qe=["src"],De={key:1,class:"symbologyIcon w-32 h-32"},Ne=["innerHTML"],Fe=["src"],Ke={key:1,class:"h-32 w-32 inline-flex justify-center items-center"},We=Y({__name:"symbology-stack",props:{visible:{type:Boolean,required:!0},legendItem:{type:Object,required:!0}},setup(e){const y=e,i=H([]);return ce(()=>{y.legendItem.loadPromise.then(()=>{y.legendItem.layerUid!==void 0&&Promise.all(C(y.legendItem.symbologyStack).map(m=>m.drawPromise)).then(()=>{i.value=C(y.legendItem).symbologyStack})})}),(m,I)=>e.visible?(t(),n("div",Ke,I[0]||(I[0]=[o("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1)]))):(t(),n("div",Pe,[i.value.length>1?(t(),n("div",Re,[(t(!0),n(te,null,ae(i.value.slice(0,3).reverse(),(B,s)=>(t(),n("div",{class:M(["absolute",[s==0?"symbol-0":s==1?"left-3 symbol-1":"left-6 symbol-2"]]),style:Le({"z-index":3-s}),key:s},[i.value[s].svgcode?(t(),n("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[s].svgcode},null,8,Oe)):i.value[s].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[s].imgUrl},null,8,qe)):p("",!0)],6))),128))])):i.value.length>0?(t(),n("div",De,[i.value[0].svgcode?(t(),n("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ne)):i.value[0].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Fe)):p("",!0)])):p("",!0)]))}}),Ye=oe(We,[["__scopeId","data-v-34dfeccd"]]),Qe={class:"relative"},Je=["content"],Xe={key:0,class:"flex p-5 mr-[13px]"},el={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},ll={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},tl=["disabled","content","aria-label"],al=["src"],nl={class:"h-auto break-words text-ellipsis"},ol={key:4,class:"flex-1 pointer-events-none p-5"},sl={key:5,class:"flex-1"},il={key:0,class:"text-lg font-bold"},rl={key:1},dl={key:2},cl=["src"],gl=["innerHTML"],ml={key:6,class:"relative"},yl=["content","aria-label"],vl={key:8,class:"relative"},pl=["content","aria-label"],ul={class:"flex p-5"},Il={key:0,class:"fill-current w-18 h-18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},bl={key:1,class:"inline-block fill-current w-18 h-18 mr-1",viewBox:"0 1 23 22"},hl=["content"],fl=["content"],Ll={key:11,class:"relative top-1"},xl=["content"],kl={key:0,class:"h-3 w-full absolute bottom-0"},wl={key:0,class:"symbology-stack default-focus-style"},Ml={key:0},Cl={key:0,class:"m-5"},Tl={key:0,class:"items-center grid-cols-1"},zl={key:0,class:"symbologyIcon w-full p-5"},Sl=["src"],Hl=["innerHTML"],El={key:2,class:"flex-1 p-5 bg-black-75 text-white"},Vl={key:1,class:"flex items-center"},Al={key:0,class:"symbologyIcon"},Zl=["src"],Bl={key:1,class:"symbologyIcon"},_l=["innerHTML"],jl={class:"flex-1 ml-15"},Ul={key:1},$l={class:"flex p-5 ml-48"},Gl={key:0,class:"relative animate-spin spinner h-20 w-20 mr-10 pt-2"},Pl={class:"flex-1 text-gray-500"},Rl={key:1,class:"legend-group border-l-2 ml-4 pl-4"},Ol=Y({__name:"item",props:{legendItem:{type:Object,required:!0}},setup(e){const y=xe(),i=me(),{t:m}=ne(),I=ge("iApi"),B=H(),s=e,r=ke(),z=r.multilineItems,G=(s.legendItem instanceof v&&s.legendItem.maxLines)??r.maxLines,D=H(i.mobileView),Q=U(()=>y.layerConfigs),V=H([]),N=H(!1),P=H(!1),R=U(()=>s.legendItem instanceof v?C(s.legendItem.layer)?.layerType:""),J=U(()=>s.legendItem instanceof v&&C(s.legendItem.layer)?.canModifyLayer),A=U(()=>{if(s.legendItem instanceof v){const d=C(s.legendItem.layer);return d?d.canReload:!0}else return!1}),S=U(()=>I.animate),c=U(()=>s.legendItem.children.length>0||s.legendItem instanceof v&&C(s.legendItem.layer)?.sublayers.length>0),f=d=>d===_.Expand||d===_.Visibility?s.legendItem.controlAvailable(d):s.legendItem.layerControlAvailable(d),$=d=>He(d),E=()=>{s.legendItem.children.length===0||!f(_.Expand)||(s.legendItem.toggleExpanded(),I.updateAlert(m(`legend.alert.group${s.legendItem.expanded?"Expanded":"Collapsed"}`)))},X=()=>{if(f(u.Symbology)){const d=s.legendItem.toggleSymbology();I.updateAlert(m(`legend.alert.symbology${d?"Expanded":"Collapsed"}`))}},ve=()=>{f(u.Datatable)&&F()&&I.event.emit(W.GRID_TOGGLE,s.legendItem.layer)},pe=d=>{const a=document.createElement("span");a.innerHTML=d.svgcode;const h=a.firstElementChild;return h?.classList.add("max-w-full"),h?.classList.add("h-full"),h?.setAttribute("height",d.imgHeight),h?.setAttribute("width",d.imgWidth),a.outerHTML},F=()=>{try{return I.fixture.exists("grid")}catch{return!1}},ue=()=>{s.legendItem.reload(),setTimeout(()=>{const d=s.legendItem;let a=!0;if(d.layer)C(d.layer).reload(),a=!1;else if(d.isSublayer&&d.parentLayerId){const h=I.geo.layer.getLayer(d.parentLayerId);h&&(C(h).reload(),a=!1)}if(a){const h=d.isSublayer?d.parentLayerId:d.layerId,L=Q.value.find(T=>T.id===h);L!==void 0&&Ie(L)}s.legendItem.loadPromise.catch(()=>{})},400)},Ie=async d=>{try{const a=I.geo.layer.getLayer(d.id);if(a){const[h]=await Se(C(a).reload());if(h)throw new Error;return a}else{const h=I.geo.layer.createLayer(d);return await I.geo.map.addLayer(h).catch(()=>{throw new Error}),h}}catch{return}},be=()=>{const d=C(s.legendItem);let a=0;if(d.type===b.Error){s.legendItem.toggleHidden(!0);const h=setInterval(()=>{const L=d.layer;(L&&(L.layerExists||L.initiationState===ee.NEW||L.initiationState===ee.TERMINATING||L.initiationState===ee.TERMINATED)||a>1200)&&(clearInterval(h),L&&I.geo.map.removeLayer(L),y.removeLayerConfig(d.layerId),I.fixture.get("legend")?.removeLayerItem(d.layerId)),a++},250)}else{s.legendItem.error();const h=setInterval(()=>{const L=d.parentLayerId||d.layerId,T=I.geo.layer.getLayer(L);T&&(clearInterval(h),T.cancelLoad(),(I.fixture.get("legend")?.getLayerBoundItems(T)||[]).forEach(K=>K.error())),a>1200&&clearInterval(h),a++},50)}},se=()=>{s.legendItem.loadPromise.then(()=>{if(V.value=[],!s.legendItem.layer){console.warn("Attempted to mount legend item component with undefined layer");return}Promise.all(C(s.legendItem.symbologyStack.map(d=>d.drawPromise))).then(()=>{V.value=s.legendItem.symbologyStack,N.value=!0})}).catch(()=>{})},he=d=>{P.value=!0,setTimeout(()=>{P.value&&(D.value||d._tippy?.show())},300)};return s.legendItem instanceof v&&(se(),we(()=>s.legendItem.symbologyStack,()=>{se()})),(d,a)=>{const h=ye("item",!0),L=q("tippy"),T=q("truncate"),K=q("focus-item");return e.legendItem.hidden?p("",!0):(t(),n("div",{key:`${e.legendItem.uid}-${e.legendItem.visibility}`,ref_key:"el",ref:B},[o("div",Qe,[k((t(),n("div",{class:M(["flex items-center hover:bg-gray-200 default-focus-style !p-5",[e.legendItem.type===l(b).Item?"loaded-item":e.legendItem.type===l(b).Error?"non-loaded-item bg-red-200":"non-loaded-item",c.value&&f(l(_).Expand)||!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?"cursor-pointer":"cursor-default",l(z)?"multilined":"singlelined"]]),onMouseover:a[9]||(a[9]=x(g=>he(g.currentTarget),["stop"])),onMouseout:a[10]||(a[10]=g=>(D.value||g.currentTarget?._tippy?.hide(),P.value=!1)),onClick:a[11]||(a[11]=()=>{!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?ve():c.value&&E()}),content:c.value&&f(l(_).Expand)?l(m)(e.legendItem.expanded?"legend.group.collapse":"legend.group.expand"):e.legendItem instanceof l(v)&&e.legendItem.type===l(b).Item&&f(l(u).Datatable)&&F()?l(m)("legend.layer.data"):"","truncate-trigger":""},[e.legendItem.type!==l(b).Item?(t(),n("div",Xe,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",el,a[12]||(a[12]=[de('',7)]))):(t(),n("svg",ll,a[13]||(a[13]=[de('',7)])))])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layer.legend.length>0?(t(),n("div",{key:1,class:"relative w-32 h-32 mr-15",onMouseover:a[0]||(a[0]=x(()=>{},["stop"]))},[k((t(),n("button",{type:"button",onClick:x(X,["stop"]),class:M([f(l(u).Symbology)?"cursor-pointer":"cursor-default"]),disabled:!f(l(u).Symbology),content:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand"),"aria-label":e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand")},[e.legendItem.coverIcon?(t(),n("img",{key:1,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32 hover:scale-105"]),src:e.legendItem.coverIcon,alt:"Cover icon not found :("},null,10,al)):(t(),j(Ye,{key:0,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32"]),visible:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded,legendItem:e.legendItem},null,8,["class","visible","legendItem"]))],10,tl)),[[L,{placement:"top-start"}]])],32)):p("",!0),c.value&&f(l(_).Expand)?(t(),n("div",{key:2,class:M(["expand-toggle p-8 pointer-events-none",{"rotate-180":e.legendItem.expanded}])},a[14]||(a[14]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1)]),2)):p("",!0),e.legendItem instanceof l(v)&&l(z)?k((t(),n("div",{key:3,class:M(["flex-1 pointer-events-none m-5",`line-clamp-${l(G)}`])},[o("span",nl,w(e.legendItem.name??(e.legendItem?.layer?.name?e.legendItem.layer?.name:e.legendItem.layerId)),1)],2)),[[T,{externalTrigger:!0,noTruncateClass:!0}]]):e.legendItem instanceof l(v)?k((t(),n("div",ol,[o("span",null,w(e.legendItem.name??(!e.legendItem.layer||e.legendItem?.layer?.name===""?e.legendItem.layerId:e.legendItem.layer?.name)),1)])),[[T,{externalTrigger:!0}]]):e.legendItem instanceof l(Me)?(t(),n("div",sl,[e.legendItem.infoType===l(O).Title&&e.legendItem.content?(t(),n("h3",il,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Title?(t(),n("h3",rl,w(e.legendItem.name),1)):e.legendItem.infoType===l(O).Text?(t(),n("p",dl,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Image?(t(),n("img",{key:3,src:e.legendItem.content,alt:"InfoType image not found :("},null,8,cl)):e.legendItem.infoType===l(O).Markdown?(t(),n("div",{key:4,class:"ramp-markdown",innerHTML:$(e.legendItem.content)},null,8,gl)):(t(),j(Ce(`${e.legendItem.uid}-info-section`),{key:5}))])):p("",!0),e.legendItem.type===l(b).Error&&A.value?(t(),n("div",ml,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:l(m)("legend.layer.controls.reload"),onMouseover:a[1]||(a[1]=x(()=>{},["stop"])),onClick:x(ue,["stop"]),"aria-label":l(m)("legend.layer.controls.reload")},a[15]||(a[15]=[o("div",{class:"flex p-8"},[o("svg",{class:"inline-block fill-current w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})])],-1)]),40,yl)),[[L,{placement:"top-start"}]])])):p("",!0),(e.legendItem.type===l(b).Item||e.legendItem.type===l(b).Placeholder&&l(z))&&e.legendItem instanceof l(v)?(t(),j(Ge,{key:7,class:M({invisible:e.legendItem.type===l(b).Placeholder}),legendItem:e.legendItem},null,8,["class","legendItem"])):p("",!0),e.legendItem.type!==l(b).Item&&e.legendItem instanceof l(v)?(t(),n("div",vl,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel"),onMouseover:a[2]||(a[2]=x(()=>{},["stop"])),onClick:x(be,["stop"]),"aria-label":e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel")},[o("div",ul,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",Il,a[16]||(a[16]=[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},null,-1)]))):(t(),n("svg",bl,a[17]||(a[17]=[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},null,-1)])))])],40,pl)),[[L,{placement:"top-start"}]])])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?k((t(),n("div",{key:9,class:"relative p-4 cursor-default",content:l(m)("legend.layer.offscale"),onMouseover:a[3]||(a[3]=x(()=>{},["stop"])),onClick:a[4]||(a[4]=x(()=>{},["stop"])),"focus-icon":""},a[18]||(a[18]=[o("svg",{class:"inline-block fill-gray-400 w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M19.81 14.99l1.19-.92-1.43-1.43-1.19.92 1.43 1.43zm-.45-4.72L21 9l-9-7-2.91 2.27 7.87 7.88 2.4-1.88zM3.27 1L2 2.27l4.22 4.22L3 9l1.63 1.27L12 16l2.1-1.63 1.43 1.43L12 18.54l-7.37-5.73L3 14.07l9 7 4.95-3.85L20.73 21 22 19.73 3.27 1z"})],-1)]),40,hl)),[[L,{placement:"top-start"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&!e.legendItem.layer?.mapLayer?k((t(),n("div",{key:10,class:"relative p-4 cursor-default",content:l(m)("legend.layer.data.only"),onMouseover:a[5]||(a[5]=x(()=>{},["stop"])),onClick:a[6]||(a[6]=x(()=>{},["stop"])),"focus-icon":""},a[19]||(a[19]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 -960 960 960",width:"18",class:"inline-block fill-gray-400"},[o("path",{d:"m776.109-63.565-73.435-69.196q-51.302 32.573-106.091 59.145-54.788 26.572-116.255 26.572-88.94 0-167.803-33.893-78.862-33.894-138.052-93.239-59.19-59.346-93.19-138.205-34-78.86-34-167.619 0-64.607 19.12-125.521Q85.521-666.435 120-719.674l-50.848-50.848 68.761-68.761L844.87-132.326l-68.761 68.76Zm-345.392-92.653v-72.5l-52.25-52.086v-50.009l-219.01-218.752q-3 17.015-5 34.031-2 17.015-2 35.136 0 124.449 78.826 214.674 78.826 90.224 199.434 109.506Zm410.392-85.412-76.739-77.74q21.288-37.275 32.35-77.847 11.062-40.572 11.062-84.059 0-95.003-56.304-169.853-56.304-74.849-145.391-108.893v.522l-174.413 76.087v31.348L241.87-842.109q52.483-34.989 113.387-52.918 60.903-17.93 125.159-17.93 89.709 0 168.127 33.869 78.418 33.868 137.435 93.28 59.016 59.413 92.997 137.683 33.982 78.269 33.982 167.993 0 64.203-18.43 125.111-18.429 60.907-53.418 113.391Z"})],-1)]),40,fl)),[[L,{placement:"top-end"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?(t(),n("div",Ll,[k((t(),n("button",{type:"button",class:"p-4",content:l(m)("legend.layer.zoomToVisible"),onMouseover:a[7]||(a[7]=x(()=>{},["stop"])),onClick:a[8]||(a[8]=x(g=>e.legendItem.layer.zoomToVisibleScale(),["stop"]))},a[20]||(a[20]=[o("svg",{class:"m-auto",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)]),40,xl)),[[L,{placement:"top-start"}]])])):e.legendItem.type===l(b).Item&&f(l(_).Visibility)?(t(),j(le,{key:12,checked:e.legendItem.visibility,value:e.legendItem,isRadio:e.legendItem.parent&&e.legendItem.parent.exclusive,legendItem:e.legendItem,disabled:e.legendItem instanceof l(v)&&!e.legendItem.layerControlAvailable(l(u).Visibility),label:c.value?"Group":"Layer"},null,8,["checked","value","isRadio","legendItem","disabled","label"])):p("",!0)],42,Je)),[[K,"show-truncate"],[L,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]]),e.legendItem.type===l(b).Placeholder||e.legendItem instanceof l(v)&&e.legendItem.layerRedrawing&&e.legendItem.visibility?(t(),n("div",kl,a[21]||(a[21]=[o("div",{class:"progress-line"},null,-1)]))):p("",!0)]),e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?k((t(),n("div",wl,[V.value.length>0?(t(),n("div",Ml,[e.legendItem instanceof l(v)&&e.legendItem.description?(t(),n("p",Cl,w(e.legendItem.description),1)):p("",!0),(t(!0),n(te,null,ae(V.value,g=>(t(),n("div",{class:"m-5",key:g.uid},[g.imgUrl&&e.legendItem.symbologyRenderStyle==="images"||!g.imgUrl&&R.value==="ogc-wms"?(t(),n("div",Tl,[g.imgUrl?(t(),n("div",zl,[o("img",{class:"max-w-full",src:g.imgUrl},null,8,Sl)])):g.imgHeight?(t(),n("div",{key:1,class:"symbologyIcon w-full p-5",innerHTML:pe(g)},null,8,Hl)):p("",!0),g.label?k((t(),n("div",El,[o("span",null,w(g.label),1),!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause?(t(),j(le,{key:0,class:"float-right",value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)])),[[T]]):p("",!0)])):(t(),n("div",Vl,[g.imgUrl?(t(),n("div",Al,[o("img",{class:"w-32 h-32",src:g.imgUrl},null,8,Zl)])):g.svgcode?(t(),n("div",Bl,[o("span",{innerHTML:g.svgcode},null,8,_l)])):p("",!0),k((t(),n("div",jl,[Z(w(g.label),1)])),[[T]]),J.value&&e.legendItem.layer.supportsFeatures&&(!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause)?(t(),j(le,{key:2,value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)]))]))),128))])):p("",!0),N.value?p("",!0):(t(),n("div",Ul,[k((t(),n("div",$l,[S.value?(t(),n("div",Gl)):p("",!0),k((t(),n("div",Pl,[o("span",null,w(l(m)("legend.symbology.loading")),1)])),[[T]])])),[[T]])]))])),[[K]]):p("",!0),e.legendItem.expanded?(t(),n("div",Rl,[(t(!0),n(te,null,ae(e.legendItem.children,g=>(t(),j(h,{legendItem:g,key:g.uid},null,8,["legendItem"]))),128))])):p("",!0)]))}}}),Fl=oe(Ol,[["__scopeId","data-v-b1261e08"]]);export{Fl as default}; +import{eT as Y,eX as ne,f6 as H,f8 as ce,fa as q,e$ as t,fb as n,fc as k,f2 as o,f4 as l,gb as x,gc as ie,f3 as M,fS as v,eY as ge,fh as me,eZ as U,gy as u,gg as C,e_ as ye,fo as fe,f1 as re,fG as Z,fg as w,eU as oe,fl as te,fm as ae,fF as Le,f5 as p,gj as xe,fQ as ke,f7 as we,jp as b,jq as _,jr as de,f0 as j,fR as Me,js as O,fn as Ce,fT as Te,gr as ze,eV as W,jt as Se,ju as ee}from"./story-Doly9N9p.js";import{u as He}from"./marked.esm-DgqJBp_S-CCvGNfAT.js";import"./main-QGPoLsvl.js";const Ee=["type","aria-label","checked","disabled","content"],le=Y({__name:"checkbox",props:{value:{type:Object,required:!0},legendItem:{type:Object,required:!0},checked:{type:Boolean},label:{type:String},isRadio:{type:Boolean},disabled:{type:Boolean}},setup(e){const{t:y}=ne(),i=e,m=H(i.legendItem.visibility);ce(()=>{i.legendItem.checkVisibilityRules(),m.value=i.legendItem.visibility===i.checked});const I=s=>!s.symbologyStack.some(r=>r.visibility),B=()=>{if(i.value instanceof Te)i.legendItem.toggleVisibility();else if(i.legendItem instanceof v){if(I(i.legendItem)?(i.legendItem.setSymbologyVisibility(void 0,!1),i.legendItem.setSymbologyVisibility(i.value.uid,!0),i.legendItem.toggleVisibility(!0)):i.legendItem.setSymbologyVisibility(i.value.uid,!i.value.lastVisbility),I(i.legendItem)&&i.legendItem.toggleVisibility(!1),i.legendItem.layer?.supportsFeatures){const s=i.legendItem.symbologyStack.filter(z=>z.lastVisbility===!0).map(z=>z.definitionClause||"");let r="";s.length===0?r="1=2":s.length{const z=q("tippy");return t(),n("div",{class:"relative",onMouseover:r[3]||(r[3]=x(()=>{},["stop"]))},[k(o("input",{type:e.isRadio?"radio":"checkbox","aria-label":l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`),onClick:r[0]||(r[0]=x(G=>B(),["stop"])),checked:e.checked&&m.value,onKeypress:r[1]||(r[1]=ie(x(()=>{},["prevent"]),["enter"])),onKeyup:r[2]||(r[2]=ie(x(G=>B(),["stop"]),["enter"])),class:M([[e.disabled?"text-gray-400 border-gray-300":"text-black cursor-pointer border-gray-500 hover:border-black"],"mx-5 h-15 w-15"]),tabindex:"-1",disabled:e.disabled,content:l(y)(e.checked?`legend.visibility.hide${e.label}`:`legend.visibility.show${e.label}`)},null,42,Ee),[[z,{placement:"top-end",hideOnClick:!1}]])],32)}}}),Ve=["aria-label"],Ae=["aria-label"],Ze=["aria-label"],Be=["aria-label"],_e=["aria-label"],je=["aria-label"],Ue=["content","aria-label"],$e=Y({__name:"legend-options",props:{legendItem:v},setup(e){const{t:y}=ne(),i=ge("iApi"),m=H(),I=H(!1),B=me(),s=H(B.mobileView),r=e,z=()=>{r.legendItem.layerControlAvailable(u.Symbology)&&r.legendItem.toggleSymbology()},G=()=>{r.legendItem.layerControlAvailable(u.Datatable)&&A("grid")&&i.event.emit(W.GRID_TOGGLE,r.legendItem.layer)},D=()=>{r.legendItem.layerControlAvailable(u.Settings)&&A("settings")&&i.event.emit(W.SETTINGS_TOGGLE,r.legendItem.layer)},Q=()=>{if(r.legendItem.layerControlAvailable(u.Metadata)&&A("metadata")){const S=r.legendItem?.layer?.config.metadata||r.legendItem?.layer?.parentLayer?.config?.metadata||{},c=S?.name||r.legendItem?.layer?.name||"",f=r.legendItem?.layer?.config?.catalogueUrl||r.legendItem?.layer?.layerType==="sublayer"&&r.legendItem?.layer?.parentLayer?.config?.catalogueUrl||void 0;if(S.url){const $=S.url.split("."),E=$[$.length-1],X=E==="xml"||E==="md"?E:"html";i.event.emit(W.METADATA_TOGGLE,{type:X,layerName:c,url:S.url,catalogueUrl:f,layer:r.legendItem.layer})}else console.warn("Layer does not have a metadata url defined")}},V=()=>{r.legendItem.layerControlAvailable(u.BoundaryZoom)&&r.legendItem?.layer?.zoomToLayerBoundary()},N=()=>{r.legendItem.layerControlAvailable(u.Remove)&&i.geo.map.removeLayer(r.legendItem.layerUid)},P=()=>{R.value&&(C(r.legendItem.layer).reload(),m.value.open=!1)},R=U(()=>r.legendItem.layerControlAvailable(u.Reload)&&r.legendItem instanceof v&&C(r.legendItem.layer)?.canReload),J=S=>{I.value=!0,setTimeout(()=>{I.value&&(s.value||S._tippy?.show())},300)},A=S=>{try{return i.fixture.exists(S)}catch{return!1}};return(S,c)=>{const f=ye("dropdown-menu"),$=q("tippy");return t(),n("div",{onClick:c[2]||(c[2]=x(()=>{},["stop"])),onMouseover:c[3]||(c[3]=x(()=>{},["stop"])),class:"options display-block cursor-auto"},[fe(f,{class:"flex-shrink-0",position:"bottom-end",tooltip:l(y)("legend.layer.options"),tooltipPlacement:"left",tooltipPlacementAlt:"left",ref_key:"dropdown",ref:m},{header:re(()=>c[4]||(c[4]=[o("div",{class:"flex p-4 justify-center items-center"},[o("svg",{class:"inline-block fill-current w-18 h-18 mx-4",viewBox:"0 0 23 21"},[o("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})])],-1)])),default:re(()=>[o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Metadata)||!A("metadata")}]),onClick:Q,role:"button","aria-label":l(y)("legend.layer.controls.metadata")},[c[5]||(c[5]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.metadata")),1)],10,Ve),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Settings)||!A("settings")}]),onClick:D,role:"button","aria-label":l(y)("legend.layer.controls.settings")},[c[6]||(c[6]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("g",null,[o("path",{d:"M 3,17L 3,19L 9,19L 9,17L 3,17 Z M 3,5L 3,7L 13,7L 13,5L 3,5 Z M 13,21L 13,19L 21,19L 21,17L 13,17L 13,15L 11,15L 11,21L 13,21 Z M 7,9L 7,11L 3,11L 3,13L 7,13L 7,15L 9,15L 9,9L 7,9 Z M 21,13L 21,11L 11,11L 11,13L 21,13 Z M 15,9L 17,9L 17,7L 21,7L 21,5L 17,5L 17,3L 15,3L 15,9 Z "})])],-1)),Z(" "+w(l(y)("legend.layer.controls.settings")),1)],10,Ae),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Datatable)||!A("grid")}]),onClick:G,role:"button","aria-label":l(y)("legend.layer.controls.datatable")},[c[7]||(c[7]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M 4.00002,3L 20,3C 21.1046,3 22,3.89543 22,5L 22,20C 22,21.1046 21.1046,22 20,22L 4.00001,22C 2.89544,22 2.00001,21.1046 2.00001,20L 2.00002,5C 2.00002,3.89543 2.89545,3 4.00002,3 Z M 4.00002,7L 4.00001,10L 8,10L 8,7.00001L 4.00002,7 Z M 10,7.00001L 9.99999,10L 14,10L 14,7.00001L 10,7.00001 Z M 20,10L 20,7L 16,7.00001L 16,10L 20,10 Z M 4.00002,12L 4.00002,15L 8,15L 8,12L 4.00002,12 Z M 4.00001,20L 8,20L 8,17L 4.00002,17L 4.00001,20 Z M 9.99999,12L 9.99999,15L 14,15L 14,12L 9.99999,12 Z M 9.99999,20L 14,20L 14,17L 9.99999,17L 9.99999,20 Z M 20,20L 20,17L 16,17L 16,20L 20,20 Z M 20,12L 16,12L 16,15L 20,15L 20,12 Z "})],-1)),Z(" "+w(l(y)("legend.layer.controls.datatable")),1)],10,Ze),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Symbology)}]),onClick:z,role:"button","aria-label":l(y)("legend.layer.controls.symbology")},[c[8]||(c[8]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M11.99 18.54l-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27-7.38 5.74zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.symbology")),1)],10,Be),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).BoundaryZoom)}]),onClick:V,role:"button","aria-label":l(y)("legend.layer.controls.boundaryzoom")},[c[9]||(c[9]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.boundaryzoom")),1)],10,_e),o("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!e.legendItem.layerControlAvailable(l(u).Remove)}]),onClick:N,role:"button","aria-label":l(y)("legend.layer.controls.remove")},[c[10]||(c[10]=o("svg",{class:"setting-svg",viewBox:"0 0 23 21"},[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.remove")),1)],10,je),k((t(),n("a",{href:"javascript:;",class:M(["flex leading-snug items-center text-left w-auto",{disabled:!R.value}]),content:R.value?"":l(y)("legend.layer.controls.reloadDisabled"),onMouseover:c[0]||(c[0]=x(E=>J(E.currentTarget),["stop"])),onMouseout:c[1]||(c[1]=E=>(s.value||E.currentTarget?._tippy?.hide(),I.value=!1)),onClick:P,role:"button","aria-label":l(y)("legend.layer.controls.reload")},[c[11]||(c[11]=o("svg",{class:"setting-svg",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})],-1)),Z(" "+w(l(y)("legend.layer.controls.reload")),1)],42,Ue)),[[$,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]])]),_:1},8,["tooltip"])],32)}}}),Ge=oe($e,[["__scopeId","data-v-9590866e"]]),Pe={key:0},Re={key:0,class:"relative left-3"},Oe=["innerHTML"],qe=["src"],De={key:1,class:"symbologyIcon w-32 h-32"},Ne=["innerHTML"],Fe=["src"],Ke={key:1,class:"h-32 w-32 inline-flex justify-center items-center"},We=Y({__name:"symbology-stack",props:{visible:{type:Boolean,required:!0},legendItem:{type:Object,required:!0}},setup(e){const y=e,i=H([]);return ce(()=>{y.legendItem.loadPromise.then(()=>{y.legendItem.layerUid!==void 0&&Promise.all(C(y.legendItem.symbologyStack).map(m=>m.drawPromise)).then(()=>{i.value=C(y.legendItem).symbologyStack})})}),(m,I)=>e.visible?(t(),n("div",Ke,I[0]||(I[0]=[o("svg",{class:"fill-current w-16 h-16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"})],-1)]))):(t(),n("div",Pe,[i.value.length>1?(t(),n("div",Re,[(t(!0),n(te,null,ae(i.value.slice(0,3).reverse(),(B,s)=>(t(),n("div",{class:M(["absolute",[s==0?"symbol-0":s==1?"left-3 symbol-1":"left-6 symbol-2"]]),style:Le({"z-index":3-s}),key:s},[i.value[s].svgcode?(t(),n("span",{key:0,class:"symbologyIcon w-28 h-28",innerHTML:i.value[s].svgcode},null,8,Oe)):i.value[s].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-28 h-28",src:i.value[s].imgUrl},null,8,qe)):p("",!0)],6))),128))])):i.value.length>0?(t(),n("div",De,[i.value[0].svgcode?(t(),n("span",{key:0,innerHTML:i.value[0].svgcode},null,8,Ne)):i.value[0].imgUrl?(t(),n("img",{key:1,class:"symbologyIcon w-full h-full",src:i.value[0].imgUrl},null,8,Fe)):p("",!0)])):p("",!0)]))}}),Ye=oe(We,[["__scopeId","data-v-34dfeccd"]]),Qe={class:"relative"},Je=["content"],Xe={key:0,class:"flex p-5 mr-[13px]"},el={key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},ll={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"black",width:"24px",height:"24px"},tl=["disabled","content","aria-label"],al=["src"],nl={class:"h-auto break-words text-ellipsis"},ol={key:4,class:"flex-1 pointer-events-none p-5"},sl={key:5,class:"flex-1"},il={key:0,class:"text-lg font-bold"},rl={key:1},dl={key:2},cl=["src"],gl=["innerHTML"],ml={key:6,class:"relative"},yl=["content","aria-label"],vl={key:8,class:"relative"},pl=["content","aria-label"],ul={class:"flex p-5"},Il={key:0,class:"fill-current w-18 h-18",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 352 512"},bl={key:1,class:"inline-block fill-current w-18 h-18 mr-1",viewBox:"0 1 23 22"},hl=["content"],fl=["content"],Ll={key:11,class:"relative top-1"},xl=["content"],kl={key:0,class:"h-3 w-full absolute bottom-0"},wl={key:0,class:"symbology-stack default-focus-style"},Ml={key:0},Cl={key:0,class:"m-5"},Tl={key:0,class:"items-center grid-cols-1"},zl={key:0,class:"symbologyIcon w-full p-5"},Sl=["src"],Hl=["innerHTML"],El={key:2,class:"flex-1 p-5 bg-black-75 text-white"},Vl={key:1,class:"flex items-center"},Al={key:0,class:"symbologyIcon"},Zl=["src"],Bl={key:1,class:"symbologyIcon"},_l=["innerHTML"],jl={class:"flex-1 ml-15"},Ul={key:1},$l={class:"flex p-5 ml-48"},Gl={key:0,class:"relative animate-spin spinner h-20 w-20 mr-10 pt-2"},Pl={class:"flex-1 text-gray-500"},Rl={key:1,class:"legend-group border-l-2 ml-4 pl-4"},Ol=Y({__name:"item",props:{legendItem:{type:Object,required:!0}},setup(e){const y=xe(),i=me(),{t:m}=ne(),I=ge("iApi"),B=H(),s=e,r=ke(),z=r.multilineItems,G=(s.legendItem instanceof v&&s.legendItem.maxLines)??r.maxLines,D=H(i.mobileView),Q=U(()=>y.layerConfigs),V=H([]),N=H(!1),P=H(!1),R=U(()=>s.legendItem instanceof v?C(s.legendItem.layer)?.layerType:""),J=U(()=>s.legendItem instanceof v&&C(s.legendItem.layer)?.canModifyLayer),A=U(()=>{if(s.legendItem instanceof v){const d=C(s.legendItem.layer);return d?d.canReload:!0}else return!1}),S=U(()=>I.animate),c=U(()=>s.legendItem.children.length>0||s.legendItem instanceof v&&C(s.legendItem.layer)?.sublayers.length>0),f=d=>d===_.Expand||d===_.Visibility?s.legendItem.controlAvailable(d):s.legendItem.layerControlAvailable(d),$=d=>He(d),E=()=>{s.legendItem.children.length===0||!f(_.Expand)||(s.legendItem.toggleExpanded(),I.updateAlert(m(`legend.alert.group${s.legendItem.expanded?"Expanded":"Collapsed"}`)))},X=()=>{if(f(u.Symbology)){const d=s.legendItem.toggleSymbology();I.updateAlert(m(`legend.alert.symbology${d?"Expanded":"Collapsed"}`))}},ve=()=>{f(u.Datatable)&&F()&&I.event.emit(W.GRID_TOGGLE,s.legendItem.layer)},pe=d=>{const a=document.createElement("span");a.innerHTML=d.svgcode;const h=a.firstElementChild;return h?.classList.add("max-w-full"),h?.classList.add("h-full"),h?.setAttribute("height",d.imgHeight),h?.setAttribute("width",d.imgWidth),a.outerHTML},F=()=>{try{return I.fixture.exists("grid")}catch{return!1}},ue=()=>{s.legendItem.reload(),setTimeout(()=>{const d=s.legendItem;let a=!0;if(d.layer)C(d.layer).reload(),a=!1;else if(d.isSublayer&&d.parentLayerId){const h=I.geo.layer.getLayer(d.parentLayerId);h&&(C(h).reload(),a=!1)}if(a){const h=d.isSublayer?d.parentLayerId:d.layerId,L=Q.value.find(T=>T.id===h);L!==void 0&&Ie(L)}s.legendItem.loadPromise.catch(()=>{})},400)},Ie=async d=>{try{const a=I.geo.layer.getLayer(d.id);if(a){const[h]=await Se(C(a).reload());if(h)throw new Error;return a}else{const h=I.geo.layer.createLayer(d);return await I.geo.map.addLayer(h).catch(()=>{throw new Error}),h}}catch{return}},be=()=>{const d=C(s.legendItem);let a=0;if(d.type===b.Error){s.legendItem.toggleHidden(!0);const h=setInterval(()=>{const L=d.layer;(L&&(L.layerExists||L.initiationState===ee.NEW||L.initiationState===ee.TERMINATING||L.initiationState===ee.TERMINATED)||a>1200)&&(clearInterval(h),L&&I.geo.map.removeLayer(L),y.removeLayerConfig(d.layerId),I.fixture.get("legend")?.removeLayerItem(d.layerId)),a++},250)}else{s.legendItem.error();const h=setInterval(()=>{const L=d.parentLayerId||d.layerId,T=I.geo.layer.getLayer(L);T&&(clearInterval(h),T.cancelLoad(),(I.fixture.get("legend")?.getLayerBoundItems(T)||[]).forEach(K=>K.error())),a>1200&&clearInterval(h),a++},50)}},se=()=>{s.legendItem.loadPromise.then(()=>{if(V.value=[],!s.legendItem.layer){console.warn("Attempted to mount legend item component with undefined layer");return}Promise.all(C(s.legendItem.symbologyStack.map(d=>d.drawPromise))).then(()=>{V.value=s.legendItem.symbologyStack,N.value=!0})}).catch(()=>{})},he=d=>{P.value=!0,setTimeout(()=>{P.value&&(D.value||d._tippy?.show())},300)};return s.legendItem instanceof v&&(se(),we(()=>s.legendItem.symbologyStack,()=>{se()})),(d,a)=>{const h=ye("item",!0),L=q("tippy"),T=q("truncate"),K=q("focus-item");return e.legendItem.hidden?p("",!0):(t(),n("div",{key:`${e.legendItem.uid}-${e.legendItem.visibility}`,ref_key:"el",ref:B},[o("div",Qe,[k((t(),n("div",{class:M(["flex items-center hover:bg-gray-200 default-focus-style !p-5",[e.legendItem.type===l(b).Item?"loaded-item":e.legendItem.type===l(b).Error?"non-loaded-item bg-red-200":"non-loaded-item",c.value&&f(l(_).Expand)||!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?"cursor-pointer":"cursor-default",l(z)?"multilined":"singlelined"]]),onMouseover:a[9]||(a[9]=x(g=>he(g.currentTarget),["stop"])),onMouseout:a[10]||(a[10]=g=>(D.value||g.currentTarget?._tippy?.hide(),P.value=!1)),onClick:a[11]||(a[11]=()=>{!c.value&&e.legendItem instanceof l(v)&&f(l(u).Datatable)&&F()&&e.legendItem.type===l(b).Item?ve():c.value&&E()}),content:c.value&&f(l(_).Expand)?l(m)(e.legendItem.expanded?"legend.group.collapse":"legend.group.expand"):e.legendItem instanceof l(v)&&e.legendItem.type===l(b).Item&&f(l(u).Datatable)&&F()?l(m)("legend.layer.data"):"","truncate-trigger":""},[e.legendItem.type!==l(b).Item?(t(),n("div",Xe,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",el,a[12]||(a[12]=[de('',7)]))):(t(),n("svg",ll,a[13]||(a[13]=[de('',7)])))])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layer.legend.length>0?(t(),n("div",{key:1,class:"relative w-32 h-32 mr-15",onMouseover:a[0]||(a[0]=x(()=>{},["stop"]))},[k((t(),n("button",{type:"button",onClick:x(X,["stop"]),class:M([f(l(u).Symbology)?"cursor-pointer":"cursor-default"]),disabled:!f(l(u).Symbology),content:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand"),"aria-label":e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?l(m)("legend.symbology.hide"):l(m)("legend.symbology.expand")},[e.legendItem.coverIcon?(t(),n("img",{key:1,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32 hover:scale-105"]),src:e.legendItem.coverIcon,alt:"Cover icon not found :("},null,10,al)):(t(),j(Ye,{key:0,class:M([{"pointer-events-none":!f(l(u).Symbology)},"w-32 h-32"]),visible:e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded,legendItem:e.legendItem},null,8,["class","visible","legendItem"]))],10,tl)),[[L,{placement:"top-start"}]])],32)):p("",!0),c.value&&f(l(_).Expand)?(t(),n("div",{key:2,class:M(["expand-toggle p-8 pointer-events-none",{"rotate-180":e.legendItem.expanded}])},a[14]||(a[14]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"})],-1)]),2)):p("",!0),e.legendItem instanceof l(v)&&l(z)?k((t(),n("div",{key:3,class:M(["flex-1 pointer-events-none m-5",`line-clamp-${l(G)}`])},[o("span",nl,w(e.legendItem.name??(e.legendItem?.layer?.name?e.legendItem.layer?.name:e.legendItem.layerId)),1)],2)),[[T,{externalTrigger:!0,noTruncateClass:!0}]]):e.legendItem instanceof l(v)?k((t(),n("div",ol,[o("span",null,w(e.legendItem.name??(!e.legendItem.layer||e.legendItem?.layer?.name===""?e.legendItem.layerId:e.legendItem.layer?.name)),1)])),[[T,{externalTrigger:!0}]]):e.legendItem instanceof l(Me)?(t(),n("div",sl,[e.legendItem.infoType===l(O).Title&&e.legendItem.content?(t(),n("h3",il,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Title?(t(),n("h3",rl,w(e.legendItem.name),1)):e.legendItem.infoType===l(O).Text?(t(),n("p",dl,w(e.legendItem.content),1)):e.legendItem.infoType===l(O).Image?(t(),n("img",{key:3,src:e.legendItem.content,alt:"InfoType image not found :("},null,8,cl)):e.legendItem.infoType===l(O).Markdown?(t(),n("div",{key:4,class:"ramp-markdown",innerHTML:$(e.legendItem.content)},null,8,gl)):(t(),j(Ce(`${e.legendItem.uid}-info-section`),{key:5}))])):p("",!0),e.legendItem.type===l(b).Error&&A.value?(t(),n("div",ml,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:l(m)("legend.layer.controls.reload"),onMouseover:a[1]||(a[1]=x(()=>{},["stop"])),onClick:x(ue,["stop"]),"aria-label":l(m)("legend.layer.controls.reload")},a[15]||(a[15]=[o("div",{class:"flex p-8"},[o("svg",{class:"inline-block fill-current w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})])],-1)]),40,yl)),[[L,{placement:"top-start"}]])])):p("",!0),(e.legendItem.type===l(b).Item||e.legendItem.type===l(b).Placeholder&&l(z))&&e.legendItem instanceof l(v)?(t(),j(Ge,{key:7,class:M({invisible:e.legendItem.type===l(b).Placeholder}),legendItem:e.legendItem},null,8,["class","legendItem"])):p("",!0),e.legendItem.type!==l(b).Item&&e.legendItem instanceof l(v)?(t(),n("div",vl,[k((t(),n("button",{type:"button",class:"text-gray-500 hover:text-black",content:e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel"),onMouseover:a[2]||(a[2]=x(()=>{},["stop"])),onClick:x(be,["stop"]),"aria-label":e.legendItem.type===l(b).Error?l(m)("legend.layer.controls.remove"):l(m)("legend.layer.controls.cancel")},[o("div",ul,[e.legendItem.type===l(b).Placeholder?(t(),n("svg",Il,a[16]||(a[16]=[o("path",{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},null,-1)]))):(t(),n("svg",bl,a[17]||(a[17]=[o("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"},null,-1)])))])],40,pl)),[[L,{placement:"top-start"}]])])):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?k((t(),n("div",{key:9,class:"relative p-4 cursor-default",content:l(m)("legend.layer.offscale"),onMouseover:a[3]||(a[3]=x(()=>{},["stop"])),onClick:a[4]||(a[4]=x(()=>{},["stop"])),"focus-icon":""},a[18]||(a[18]=[o("svg",{class:"inline-block fill-gray-400 w-18 h-18",viewBox:"0 0 24 24"},[o("path",{d:"M19.81 14.99l1.19-.92-1.43-1.43-1.19.92 1.43 1.43zm-.45-4.72L21 9l-9-7-2.91 2.27 7.87 7.88 2.4-1.88zM3.27 1L2 2.27l4.22 4.22L3 9l1.63 1.27L12 16l2.1-1.63 1.43 1.43L12 18.54l-7.37-5.73L3 14.07l9 7 4.95-3.85L20.73 21 22 19.73 3.27 1z"})],-1)]),40,hl)),[[L,{placement:"top-start"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&!e.legendItem.layer?.mapLayer?k((t(),n("div",{key:10,class:"relative p-4 cursor-default",content:l(m)("legend.layer.data.only"),onMouseover:a[5]||(a[5]=x(()=>{},["stop"])),onClick:a[6]||(a[6]=x(()=>{},["stop"])),"focus-icon":""},a[19]||(a[19]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 -960 960 960",width:"18",class:"inline-block fill-gray-400"},[o("path",{d:"m776.109-63.565-73.435-69.196q-51.302 32.573-106.091 59.145-54.788 26.572-116.255 26.572-88.94 0-167.803-33.893-78.862-33.894-138.052-93.239-59.19-59.346-93.19-138.205-34-78.86-34-167.619 0-64.607 19.12-125.521Q85.521-666.435 120-719.674l-50.848-50.848 68.761-68.761L844.87-132.326l-68.761 68.76Zm-345.392-92.653v-72.5l-52.25-52.086v-50.009l-219.01-218.752q-3 17.015-5 34.031-2 17.015-2 35.136 0 124.449 78.826 214.674 78.826 90.224 199.434 109.506Zm410.392-85.412-76.739-77.74q21.288-37.275 32.35-77.847 11.062-40.572 11.062-84.059 0-95.003-56.304-169.853-56.304-74.849-145.391-108.893v.522l-174.413 76.087v31.348L241.87-842.109q52.483-34.989 113.387-52.918 60.903-17.93 125.159-17.93 89.709 0 168.127 33.869 78.418 33.868 137.435 93.28 59.016 59.413 92.997 137.683 33.982 78.269 33.982 167.993 0 64.203-18.43 125.111-18.429 60.907-53.418 113.391Z"})],-1)]),40,fl)),[[L,{placement:"top-end"}]]):p("",!0),e.legendItem.type===l(b).Item&&e.legendItem instanceof l(v)&&e.legendItem.layerOffscale?(t(),n("div",Ll,[k((t(),n("button",{type:"button",class:"p-4",content:l(m)("legend.layer.zoomToVisible"),onMouseover:a[7]||(a[7]=x(()=>{},["stop"])),onClick:a[8]||(a[8]=x(g=>e.legendItem.layer.zoomToVisibleScale(),["stop"]))},a[20]||(a[20]=[o("svg",{class:"m-auto",xmlns:"http://www.w3.org/2000/svg",height:"18",viewBox:"0 0 24 24",width:"18"},[o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})],-1)]),40,xl)),[[L,{placement:"top-start"}]])])):e.legendItem.type===l(b).Item&&f(l(_).Visibility)?(t(),j(le,{key:12,checked:e.legendItem.visibility,value:e.legendItem,isRadio:e.legendItem.parent&&e.legendItem.parent.exclusive,legendItem:e.legendItem,disabled:e.legendItem instanceof l(v)&&!e.legendItem.layerControlAvailable(l(u).Visibility),label:c.value?"Group":"Layer"},null,8,["checked","value","isRadio","legendItem","disabled","label"])):p("",!0)],42,Je)),[[K,"show-truncate"],[L,{placement:"top-start",trigger:"manual focus",aria:"describedby"}]]),e.legendItem.type===l(b).Placeholder||e.legendItem instanceof l(v)&&e.legendItem.layerRedrawing&&e.legendItem.visibility?(t(),n("div",kl,a[21]||(a[21]=[o("div",{class:"progress-line"},null,-1)]))):p("",!0)]),e.legendItem instanceof l(v)&&e.legendItem.symbologyExpanded?k((t(),n("div",wl,[V.value.length>0?(t(),n("div",Ml,[e.legendItem instanceof l(v)&&e.legendItem.description?(t(),n("p",Cl,w(e.legendItem.description),1)):p("",!0),(t(!0),n(te,null,ae(V.value,g=>(t(),n("div",{class:"m-5",key:g.uid},[g.imgUrl&&e.legendItem.symbologyRenderStyle==="images"||!g.imgUrl&&R.value==="ogc-wms"?(t(),n("div",Tl,[g.imgUrl?(t(),n("div",zl,[o("img",{class:"max-w-full",src:g.imgUrl},null,8,Sl)])):g.imgHeight?(t(),n("div",{key:1,class:"symbologyIcon w-full p-5",innerHTML:pe(g)},null,8,Hl)):p("",!0),g.label?k((t(),n("div",El,[o("span",null,w(g.label),1),!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause?(t(),j(le,{key:0,class:"float-right",value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)])),[[T]]):p("",!0)])):(t(),n("div",Vl,[g.imgUrl?(t(),n("div",Al,[o("img",{class:"w-32 h-32",src:g.imgUrl},null,8,Zl)])):g.svgcode?(t(),n("div",Bl,[o("span",{innerHTML:g.svgcode},null,8,_l)])):p("",!0),k((t(),n("div",jl,[Z(w(g.label),1)])),[[T]]),J.value&&e.legendItem.layer.supportsFeatures&&(!g.imgUrl&&V.value.length>1||g.imgUrl&&g.definitionClause)?(t(),j(le,{key:2,value:g,legendItem:e.legendItem,checked:g.visibility,disabled:!f(l(u).Visibility),label:"Symbol"},null,8,["value","legendItem","checked","disabled"])):p("",!0)]))]))),128))])):p("",!0),N.value?p("",!0):(t(),n("div",Ul,[k((t(),n("div",$l,[S.value?(t(),n("div",Gl)):p("",!0),k((t(),n("div",Pl,[o("span",null,w(l(m)("legend.symbology.loading")),1)])),[[T]])])),[[T]])]))])),[[K]]):p("",!0),e.legendItem.expanded?(t(),n("div",Rl,[(t(!0),n(te,null,ae(e.legendItem.children,g=>(t(),j(h,{legendItem:g,key:g.uid},null,8,["legendItem"]))),128))])):p("",!0)]))}}}),Fl=oe(Ol,[["__scopeId","data-v-b1261e08"]]);export{Fl as default}; diff --git a/custom-toc-highlight/assets/jsonContext-BA8GHqVk-CWQlLGSw.js b/custom-toc-highlight/assets/jsonContext-BA8GHqVk-BsXRY5es.js similarity index 86% rename from custom-toc-highlight/assets/jsonContext-BA8GHqVk-CWQlLGSw.js rename to custom-toc-highlight/assets/jsonContext-BA8GHqVk-BsXRY5es.js index c7f29bf0..5854c46c 100644 --- a/custom-toc-highlight/assets/jsonContext-BA8GHqVk-CWQlLGSw.js +++ b/custom-toc-highlight/assets/jsonContext-BA8GHqVk-BsXRY5es.js @@ -1 +1 @@ -import{a as o,r as n}from"./story-BfX8CRfG.js";function s(t,r){return{...a(t,r),readResourcePaths:[]}}function u(t,r,l){const e=o(t.itemUrl);return{...a(t,r),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:e?{rootPath:e.path,writtenUrls:[]}:null,resources:l?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function a(t,r){return{origin:r,url:o(t.itemUrl),portal:t.portal||n.getDefault(),portalItem:t}}export{s as a,u as i}; +import{a as o,r as n}from"./story-Doly9N9p.js";function s(t,r){return{...a(t,r),readResourcePaths:[]}}function u(t,r,l){const e=o(t.itemUrl);return{...a(t,r),messages:[],writtenProperties:[],blockedRelativeUrls:[],verifyItemRelativeUrls:e?{rootPath:e.path,writtenUrls:[]}:null,resources:l?{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}:null}}function a(t,r){return{origin:r,url:o(t.itemUrl),portal:t.portal||n.getDefault(),portalItem:t}}export{s as a,u as i}; diff --git a/custom-toc-highlight/assets/jsonUtils-C64Zfu7c-CitE8NjK.js b/custom-toc-highlight/assets/jsonUtils-C64Zfu7c-BtrwAD3_.js similarity index 95% rename from custom-toc-highlight/assets/jsonUtils-C64Zfu7c-CitE8NjK.js rename to custom-toc-highlight/assets/jsonUtils-C64Zfu7c-BtrwAD3_.js index b1cc8bfa..cd324178 100644 --- a/custom-toc-highlight/assets/jsonUtils-C64Zfu7c-CitE8NjK.js +++ b/custom-toc-highlight/assets/jsonUtils-C64Zfu7c-BtrwAD3_.js @@ -1 +1 @@ -import{P as a,d7 as O,v as t,S as s,ac as X,i as j,ar as w,ad as ae,d_ as G,d$ as ue,bz as L,bB as pe,aa as K,e as T,dN as W,e0 as ee,aq as ye,a1 as M,ct as de,b0 as ce,aU as he,ca as me,cb as fe,f as Y,dW as ge,o as be,e1 as ve,e2 as we,dU as Se,dX as xe}from"./story-BfX8CRfG.js";import{$ as A,h as _e,E as R,L as je,A as Ie,d as te,o as ie,a as Ve,G as Ee,B as Re}from"./UniqueValueRenderer-fS5V0Ej1-CUpMaRxc.js";import{b as De}from"./LRUCache-C3erQTWv-0wD6drRf.js";import{m as Ne}from"./Version-CoKzbupV-9-gg6ENz.js";import{o as Me}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{c as Pe}from"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import{V as $e,v as Te}from"./utils-SPbpQbmm-B3hR8LxB.js";import{d as qe,y as Ce,c as Oe}from"./heatmapUtils-seiMkkkR-Cj1KmweL.js";import{w as Le}from"./RendererLegendOptions-K3md58-X-Dj9JPZ6J.js";import"./main-ugzBrWNm.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./colorRamps-q0bZVhs2-DQZn2xZS.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-23qzp7zg.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./styleUtils-BtpNqZyT-D2Hj1Rgz.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./colorUtils-Cthpxcks-ZRnr1H1b.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";const Z="esri.renderers.support.DictionaryLoader",Ae={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let se=class{constructor(e,i,r){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new De(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=e,this.config=i,this.fieldMap=r}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,i){let r;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{r=await this._dictionaryPromise}catch(y){if(he(y))return this._dictionaryPromise=null,null}const o=this._dictionaryVersion?.greaterEqual(4,0),u={};if(this.fieldMap)for(const y of this._symbolFields){const c=$e(this.fieldMap[y],this._fieldIndex);if(c){const n=e.attributes[c];u[y]=o?n:n!=null?""+e.attributes[c]:""}else u[y]=""}let l=null;try{l=r?.(u,i)}catch{return null}if(!l||typeof l!="string"||l==="invalid")return null;const d=l.split(";"),b=[],f=[];for(let y=0;yNumber(v));else if(_==="Color"){const v=new w(g).toRgba();g=[v[0],v[1],v[2],255*v[3]]}else g=Number(g);f.push({primitiveName:x,propertyName:_,value:g,defaultValue:null})}}else if(c.includes("|")){for(const n of c.split("|"))if(this._itemNames.has(n)){b.push(n);break}}else if(this._itemNames.has(c))b.push(c);else if(y===0){b.length=0;let n="Invalid_P";e.geometry!=null&&(me(e.geometry)?n="Invalid_A":fe(e.geometry)&&(n="Invalid_L")),b.push(n);break}}}const D=e.geometry==null||!e.geometry.hasZ&&e.geometry.type==="point";return this._cimPartsToCIMSymbol(e,b,f,D,i)}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void M.getLogger(Z).error("no valid URL!");const i=Y(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:e!=null?e.signal:null}),[{data:r}]=await Promise.all([i,ge()]);if(!r)throw this._dictionaryPromise=null,new be("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:o,dictionary_version:u,expression:l,itemsNames:d}=r,b=l;let f=!1;u&&(this._dictionaryVersion=Ne.parse(u),f=this._dictionaryVersion.greaterEqual(4,0)),this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(d),this._symbolFields=o.symbol;const D={};if(this.config){const n=this.config;for(const x in n)D[x]=n[x]}if(o.configuration)for(const n of o.configuration)D.hasOwnProperty(n.name)||(D[n.name]=n.value);const y=[];if(e?.fields&&this.fieldMap)for(const n in this.fieldMap){const x=this.fieldMap[n],_=e.fields.filter(g=>g.name.toLowerCase()===x?.toLowerCase());_.length>0&&y.push({..._[0],type:f?_[0].type:"esriFieldTypeString"})}y.length>0&&(this._fieldIndex=new Me(y));const c=ve(b,e!=null?e.spatialReference:null,y,D).then(n=>{const x={scale:0};return(_,g)=>{if(n==null)return null;const P=n.repurposeFeature({geometry:null,attributes:_});return x.scale=g!=null?g.scale??void 0:void 0,n.evaluate({$feature:P,$view:x},n.services)}}).catch(n=>(M.getLogger(Z).error("Creating dictionary expression failed:",n),null));return this._dictionaryPromise=c,c}async _cimPartsToCIMSymbol(e,i,r,o,u){const l=new Array(i.length);for(let f=0;fl.data);const o=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,e),u=Y(o,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(e,u),u.finally(()=>this._ongoingRequests.delete(e));try{const l=await u;return this._symbolCache.put(e,l.data),l.data}catch(l){throw l}}};function Fe(e,i,r){if(!e||e.length===0)return null;const o={...e[0]};if(e.length>1){o.effects=null,o.symbolLayers=[];for(const u of e){const l=u;if(l.effects!=null)for(const d of l.symbolLayers)d.effects==null?d.effects=l.effects:d.effects.unshift(...l.effects);o.symbolLayers.unshift(...l.symbolLayers)}}return r&&(o.callout=Ae),{type:"CIMSymbolReference",symbol:o,primitiveOverrides:i}}var F;let S=F=class extends A(R){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 se(this.url,this.config,this.fieldMap)}writeData(e,i){e&&(i.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,i,r,o){o?.origin||super.writeVisualVariables(e,i,r,o)}clone(){return new F({config:a(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:a(this.fieldMap),url:a(this.url),visualVariables:a(this.visualVariables)})}async getSymbolAsync(e,i){return this._loader.getSymbolAsync(e,i)}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i),this.scaleExpression&&await O(e,i,this.scaleExpression);for(const r in this.fieldMap){const o=this.fieldMap[r];i.has(o)&&e.add(o)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};t([s({type:se})],S.prototype,"_loader",null),t([s({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],S.prototype,"config",void 0),t([s({type:Object,json:{write:!0}})],S.prototype,"fieldMap",void 0),t([s({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],S.prototype,"scaleExpression",void 0),t([X("scaleExpression")],S.prototype,"writeData",null),t([s({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],S.prototype,"scaleExpressionTitle",void 0),t([s({type:String,json:{write:!0}})],S.prototype,"url",void 0),t([X("visualVariables")],S.prototype,"writeVisualVariables",null),S=F=t([j("esri.renderers.DictionaryRenderer")],S);const He=S;var H;let I=H=class extends T{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"?(M.getLogger(this).error(".field: field must be a string value"),null):Se(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new H({color:this.color?.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:w,json:{type:[Number],write:!0}})],I.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"field",void 0),t([ae("field")],I.prototype,"castField",null),t([s({type:String,json:{write:!0}})],I.prototype,"label",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpression",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpressionTitle",void 0),I=H=t([j("esri.renderers.support.AttributeColorInfo")],I);const re=I;var k;let q=k=class extends T{constructor(){super(...arguments),this.unit=null}clone(){return new k({unit:this.unit})}};t([s({type:String,json:{write:!0}})],q.prototype,"unit",void 0),q=k=t([j("esri.renderers.support.DotDensityLegendOptions")],q);const ke=q;var z;let h=z=class extends A(R){constructor(e){super(e),this.attributes=null,this.backgroundColor=new w([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new G,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(this.referenceScale==null)return this.dotValue;const i=e/this.referenceScale*this.dotValue;return i<1?1:i}getSymbol(){return new ue({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new z({attributes:a(this.attributes),backgroundColor:a(this.backgroundColor),dotBlendingEnabled:a(this.dotBlendingEnabled),dotShape:a(this.dotShape),dotSize:a(this.dotSize),dotValue:a(this.dotValue),legendOptions:a(this.legendOptions),outline:a(this.outline),referenceScale:a(this.referenceScale),seed:a(this.seed),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}getControllerHash(){return`${this.attributes?.map(e=>e.field||e.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes??[])r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],h.prototype,"attributes",void 0),t([s({type:w,json:{write:!0}})],h.prototype,"backgroundColor",void 0),t([s({type:Boolean,json:{write:!0}})],h.prototype,"dotBlendingEnabled",void 0),t([s({type:String,json:{write:!1}})],h.prototype,"dotShape",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotSize",void 0),t([s({type:ke,json:{write:!0}})],h.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],h.prototype,"outline",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotValue",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"referenceScale",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"seed",void 0),t([L({dotDensity:"dot-density"})],h.prototype,"type",void 0),h=z=t([j("esri.renderers.DotDensityRenderer")],h);const ze=h;var B;let $=B=class extends T{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new B({color:this.color&&this.color.clone(),ratio:this.ratio})}};t([s({type:w,json:{type:[pe],default:null,write:!0}})],$.prototype,"color",void 0),t([s({type:Number,json:{write:!0}})],$.prototype,"ratio",void 0),$=B=t([j("esri.renderers.support.HeatmapColorStop")],$);const C=$;let N=class extends K(T){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};t([s({type:String,json:{write:!0}})],N.prototype,"minLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"maxLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"title",void 0),N=t([j("esri.renderers.support.HeatmapLegendOptions")],N);var J;function Q(e){if(e!=null){const{maxDensity:i,minDensity:r,radius:o}=e;if(i!=null||r!=null||o!=null){const{blurRadius:u,maxPixelIntensity:l,minPixelIntensity:d,...b}=e;return b}}return e}let p=J=class extends R{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new C({ratio:0,color:new w("rgba(255, 140, 0, 0)")}),new C({ratio:.75,color:new w("rgba(255, 140, 0, 1)")}),new C({ratio:.9,color:new w("rgba(255, 0, 0, 1)")})],this.field=null,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null}normalizeCtorArgs(e){return Q(e)}get blurRadius(){return qe(this.radius)}set blurRadius(e){const i=this.maxPixelIntensity,r=this.minPixelIntensity;this._set("radius",Ce(e)),this._set("maxDensity",i*this._pixelIntensityToDensity),this._set("minDensity",r*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity)}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity)}get _pixelIntensityToDensity(){return 24/(Oe**2*this.blurRadius**4)}read(e,i){e=Q(e),super.read(e,i)}getSymbol(){return new ee}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,i){const r=this.field,o=this.valueExpression;r&&typeof r=="string"&&xe(e,i,r),o&&typeof o=="string"&&await O(e,i,o)}getAttributeHash(){return""}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new J({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:a(this.colorStops),field:this.field,legendOptions:a(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:_e,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],p.prototype,"authoringInfo",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"blurRadius",null),t([s({type:[C],json:{write:!0}})],p.prototype,"colorStops",void 0),t([s({type:String,json:{write:!0}})],p.prototype,"field",void 0),t([s({type:N,json:{write:!0}})],p.prototype,"legendOptions",void 0),t([s({type:Number,json:{write:!0}})],p.prototype,"maxDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"maxPixelIntensity",null),t([s({type:Number,json:{write:!0}})],p.prototype,"minDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"minPixelIntensity",null),t([s({type:Number,cast:W,json:{write:!0}})],p.prototype,"radius",void 0),t([s({type:Number,range:{min:0},json:{default:0,write:!0}})],p.prototype,"referenceScale",void 0),t([L({heatmap:"heatmap"})],p.prototype,"type",void 0),t([s({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"valueExpression",void 0),t([s({type:String})],p.prototype,"valueExpressionTitle",void 0),t([s({readOnly:!0})],p.prototype,"_pixelIntensityToDensity",null),p=J=t([j("esri.renderers.HeatmapRenderer")],p);const oe=p;let E=class extends K(T){constructor(){super(...arguments),this.color=new w([0,0,0,0]),this.label=null,this.threshold=0}};t([s({type:w,json:{write:!0}})],E.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],E.prototype,"label",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],E.prototype,"threshold",void 0),E=t([j("esri.renderers.support.OthersCategory")],E);const Be={base:Ve,key:"type",typeMap:{size:Ee,opacity:Re}};let m=class extends A(K(R)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new w([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new E,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart",this.visualVariables=null}getSymbol(){return new ee({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(ye)}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes)r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],m.prototype,"attributes",void 0),t([s(je)],m.prototype,"backgroundFillSymbol",void 0),t([s({type:w,json:{write:!0}})],m.prototype,"defaultColor",void 0),t([s({type:String,json:{write:!0}})],m.prototype,"defaultLabel",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],m.prototype,"holePercentage",void 0),t([s({type:E,json:{write:!0}})],m.prototype,"othersCategory",void 0),t([s({type:Le,json:{write:!0}})],m.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],m.prototype,"outline",void 0),t([s({type:Number,cast:W,json:{write:!0}})],m.prototype,"size",void 0),t([L({pieChart:"pie-chart"})],m.prototype,"type",void 0),t([s({types:[Be]})],m.prototype,"visualVariables",void 0),m=t([j("esri.renderers.PieChartRenderer")],m);const Je=m;var U;let V=U=class extends A(R){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,i){await Promise.all([this.collectSymbolFields(e,i),this.collectVVRequiredFields(e,i)])}async collectSymbolFields(e,i){await Promise.all(this.getSymbols().map(r=>r.collectRequiredFields(e,i)))}getSymbol(e,i){return this.symbol}async getSymbolAsync(e,i){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new U({description:this.description,label:this.label,symbol:a(this.symbol),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}};t([s({type:String,json:{write:!0}})],V.prototype,"description",void 0),t([s({type:String,json:{write:!0}})],V.prototype,"label",void 0),t([s(Ie)],V.prototype,"symbol",void 0),t([L({simple:"simple"})],V.prototype,"type",void 0),V=U=t([j("esri.renderers.SimpleRenderer")],V);const ne=V,Ue={key:"type",base:R,typeMap:{heatmap:oe,simple:ne,"unique-value":te,"class-breaks":ie,"dot-density":ze,dictionary:He,"pie-chart":Je},errorContext:"renderer"},_t={key:"type",base:R,typeMap:{simple:ne,"unique-value":te,"class-breaks":ie,heatmap:oe},errorContext:"renderer",validate:Ge};function Ge(e){switch(e.type){case"simple":return Ke(e);case"unique-value":return Xe(e);case"class-breaks":return Ye(e);case"heatmap":return e}}function Ke(e){if(e.symbol)return e;M.getLogger("esri.renderers.support.types").error("Removed invalid 'simple' renderer without a symbol from web scene.")}function Xe(e){const i=e.uniqueValueInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid unique value info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.uniqueValueInfos=r),e}function Ye(e){const i=e.classBreakInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid class break info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.classBreakInfos=r),e}function Ze(e,i){return le(e,null,i)}const Qe=de({types:Ue});function le(e,i,r){return e?e&&(e.styleName||e.styleUrl)&&e.type!=="uniqueValue"?(r?.messages&&r.messages.push(new ce("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):Qe(e,i,r):null}const jt=Object.freeze(Object.defineProperty({__proto__:null,fromJSON:Ze,read:le},Symbol.toStringTag,{value:"Module"}));export{jt as j,C as l,Ue as m,le as o,ne as p,Ze as t,_t as u}; +import{P as a,d7 as O,v as t,S as s,ac as X,i as j,ar as w,ad as ae,d_ as G,d$ as ue,bz as L,bB as pe,aa as K,e as T,dN as W,e0 as ee,aq as ye,a1 as M,ct as de,b0 as ce,aU as he,ca as me,cb as fe,f as Y,dW as ge,o as be,e1 as ve,e2 as we,dU as Se,dX as xe}from"./story-Doly9N9p.js";import{$ as A,h as _e,E as R,L as je,A as Ie,d as te,o as ie,a as Ve,G as Ee,B as Re}from"./UniqueValueRenderer-fS5V0Ej1-BOT7Gqon.js";import{b as De}from"./LRUCache-C3erQTWv-grHgYSP-.js";import{m as Ne}from"./Version-CoKzbupV-BDyz4v43.js";import{o as Me}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{c as Pe}from"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import{V as $e,v as Te}from"./utils-SPbpQbmm-CiwW7WzR.js";import{d as qe,y as Ce,c as Oe}from"./heatmapUtils-seiMkkkR-CrSLbaQx.js";import{w as Le}from"./RendererLegendOptions-K3md58-X-JLOOdHLz.js";import"./main-QGPoLsvl.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./colorRamps-q0bZVhs2-BnivlaV9.js";import"./sizeVariableUtils-t52KcLLi-D0hbQF8b.js";import"./visualVariableUtils-D3kZJRyn-tyrXoPjU.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./styleUtils-BtpNqZyT-Bnq2S5kK.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./colorUtils-Cthpxcks-cHaMZbaf.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./enums-CpSG_SL3-BMD3Tb1v.js";const Z="esri.renderers.support.DictionaryLoader",Ae={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};let se=class{constructor(e,i,r){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new De(100),this._dictionaryVersion=null,this._fieldIndex=null,this._dictionaryPromise=null,this.url=e,this.config=i,this.fieldMap=r}getSymbolFields(){return this._symbolFields}async getSymbolAsync(e,i){let r;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{r=await this._dictionaryPromise}catch(y){if(he(y))return this._dictionaryPromise=null,null}const o=this._dictionaryVersion?.greaterEqual(4,0),u={};if(this.fieldMap)for(const y of this._symbolFields){const c=$e(this.fieldMap[y],this._fieldIndex);if(c){const n=e.attributes[c];u[y]=o?n:n!=null?""+e.attributes[c]:""}else u[y]=""}let l=null;try{l=r?.(u,i)}catch{return null}if(!l||typeof l!="string"||l==="invalid")return null;const d=l.split(";"),b=[],f=[];for(let y=0;yNumber(v));else if(_==="Color"){const v=new w(g).toRgba();g=[v[0],v[1],v[2],255*v[3]]}else g=Number(g);f.push({primitiveName:x,propertyName:_,value:g,defaultValue:null})}}else if(c.includes("|")){for(const n of c.split("|"))if(this._itemNames.has(n)){b.push(n);break}}else if(this._itemNames.has(c))b.push(c);else if(y===0){b.length=0;let n="Invalid_P";e.geometry!=null&&(me(e.geometry)?n="Invalid_A":fe(e.geometry)&&(n="Invalid_L")),b.push(n);break}}}const D=e.geometry==null||!e.geometry.hasZ&&e.geometry.type==="point";return this._cimPartsToCIMSymbol(e,b,f,D,i)}async fetchResources(e){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void M.getLogger(Z).error("no valid URL!");const i=Y(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:e!=null?e.signal:null}),[{data:r}]=await Promise.all([i,ge()]);if(!r)throw this._dictionaryPromise=null,new be("esri.renderers.DictionaryRenderer","Bad dictionary data!");const{authoringInfo:o,dictionary_version:u,expression:l,itemsNames:d}=r,b=l;let f=!1;u&&(this._dictionaryVersion=Ne.parse(u),f=this._dictionaryVersion.greaterEqual(4,0)),this._refSymbolUrlTemplate=this.url+"/"+r.cimRefTemplateUrl,this._itemNames=new Set(d),this._symbolFields=o.symbol;const D={};if(this.config){const n=this.config;for(const x in n)D[x]=n[x]}if(o.configuration)for(const n of o.configuration)D.hasOwnProperty(n.name)||(D[n.name]=n.value);const y=[];if(e?.fields&&this.fieldMap)for(const n in this.fieldMap){const x=this.fieldMap[n],_=e.fields.filter(g=>g.name.toLowerCase()===x?.toLowerCase());_.length>0&&y.push({..._[0],type:f?_[0].type:"esriFieldTypeString"})}y.length>0&&(this._fieldIndex=new Me(y));const c=ve(b,e!=null?e.spatialReference:null,y,D).then(n=>{const x={scale:0};return(_,g)=>{if(n==null)return null;const P=n.repurposeFeature({geometry:null,attributes:_});return x.scale=g!=null?g.scale??void 0:void 0,n.evaluate({$feature:P,$view:x},n.services)}}).catch(n=>(M.getLogger(Z).error("Creating dictionary expression failed:",n),null));return this._dictionaryPromise=c,c}async _cimPartsToCIMSymbol(e,i,r,o,u){const l=new Array(i.length);for(let f=0;fl.data);const o=this._refSymbolUrlTemplate.replaceAll(/\{itemName\}/gi,e),u=Y(o,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(e,u),u.finally(()=>this._ongoingRequests.delete(e));try{const l=await u;return this._symbolCache.put(e,l.data),l.data}catch(l){throw l}}};function Fe(e,i,r){if(!e||e.length===0)return null;const o={...e[0]};if(e.length>1){o.effects=null,o.symbolLayers=[];for(const u of e){const l=u;if(l.effects!=null)for(const d of l.symbolLayers)d.effects==null?d.effects=l.effects:d.effects.unshift(...l.effects);o.symbolLayers.unshift(...l.symbolLayers)}}return r&&(o.callout=Ae),{type:"CIMSymbolReference",symbol:o,primitiveOverrides:i}}var F;let S=F=class extends A(R){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 se(this.url,this.config,this.fieldMap)}writeData(e,i){e&&(i.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,i,r,o){o?.origin||super.writeVisualVariables(e,i,r,o)}clone(){return new F({config:a(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:a(this.fieldMap),url:a(this.url),visualVariables:a(this.visualVariables)})}async getSymbolAsync(e,i){return this._loader.getSymbolAsync(e,i)}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i),this.scaleExpression&&await O(e,i,this.scaleExpression);for(const r in this.fieldMap){const o=this.fieldMap[r];i.has(o)&&e.add(o)}}get arcadeRequired(){return!0}getSymbol(){return null}getSymbols(){return[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return`${this.url}-${JSON.stringify(this.fieldMap)}`}getSymbolFields(){return this._loader.getSymbolFields()}};t([s({type:se})],S.prototype,"_loader",null),t([s({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],S.prototype,"config",void 0),t([s({type:Object,json:{write:!0}})],S.prototype,"fieldMap",void 0),t([s({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],S.prototype,"scaleExpression",void 0),t([X("scaleExpression")],S.prototype,"writeData",null),t([s({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],S.prototype,"scaleExpressionTitle",void 0),t([s({type:String,json:{write:!0}})],S.prototype,"url",void 0),t([X("visualVariables")],S.prototype,"writeVisualVariables",null),S=F=t([j("esri.renderers.DictionaryRenderer")],S);const He=S;var H;let I=H=class extends T{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"?(M.getLogger(this).error(".field: field must be a string value"),null):Se(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new H({color:this.color?.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:w,json:{type:[Number],write:!0}})],I.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"field",void 0),t([ae("field")],I.prototype,"castField",null),t([s({type:String,json:{write:!0}})],I.prototype,"label",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpression",void 0),t([s({type:String,json:{write:!0}})],I.prototype,"valueExpressionTitle",void 0),I=H=t([j("esri.renderers.support.AttributeColorInfo")],I);const re=I;var k;let q=k=class extends T{constructor(){super(...arguments),this.unit=null}clone(){return new k({unit:this.unit})}};t([s({type:String,json:{write:!0}})],q.prototype,"unit",void 0),q=k=t([j("esri.renderers.support.DotDensityLegendOptions")],q);const ke=q;var z;let h=z=class extends A(R){constructor(e){super(e),this.attributes=null,this.backgroundColor=new w([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new G,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(this.referenceScale==null)return this.dotValue;const i=e/this.referenceScale*this.dotValue;return i<1?1:i}getSymbol(){return new ue({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new z({attributes:a(this.attributes),backgroundColor:a(this.backgroundColor),dotBlendingEnabled:a(this.dotBlendingEnabled),dotShape:a(this.dotShape),dotSize:a(this.dotSize),dotValue:a(this.dotValue),legendOptions:a(this.legendOptions),outline:a(this.outline),referenceScale:a(this.referenceScale),seed:a(this.seed),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}getControllerHash(){return`${this.attributes?.map(e=>e.field||e.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes??[])r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],h.prototype,"attributes",void 0),t([s({type:w,json:{write:!0}})],h.prototype,"backgroundColor",void 0),t([s({type:Boolean,json:{write:!0}})],h.prototype,"dotBlendingEnabled",void 0),t([s({type:String,json:{write:!1}})],h.prototype,"dotShape",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotSize",void 0),t([s({type:ke,json:{write:!0}})],h.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],h.prototype,"outline",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"dotValue",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"referenceScale",void 0),t([s({type:Number,json:{write:!0}})],h.prototype,"seed",void 0),t([L({dotDensity:"dot-density"})],h.prototype,"type",void 0),h=z=t([j("esri.renderers.DotDensityRenderer")],h);const ze=h;var B;let $=B=class extends T{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new B({color:this.color&&this.color.clone(),ratio:this.ratio})}};t([s({type:w,json:{type:[pe],default:null,write:!0}})],$.prototype,"color",void 0),t([s({type:Number,json:{write:!0}})],$.prototype,"ratio",void 0),$=B=t([j("esri.renderers.support.HeatmapColorStop")],$);const C=$;let N=class extends K(T){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};t([s({type:String,json:{write:!0}})],N.prototype,"minLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"maxLabel",void 0),t([s({type:String,json:{write:!0}})],N.prototype,"title",void 0),N=t([j("esri.renderers.support.HeatmapLegendOptions")],N);var J;function Q(e){if(e!=null){const{maxDensity:i,minDensity:r,radius:o}=e;if(i!=null||r!=null||o!=null){const{blurRadius:u,maxPixelIntensity:l,minPixelIntensity:d,...b}=e;return b}}return e}let p=J=class extends R{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new C({ratio:0,color:new w("rgba(255, 140, 0, 0)")}),new C({ratio:.75,color:new w("rgba(255, 140, 0, 1)")}),new C({ratio:.9,color:new w("rgba(255, 0, 0, 1)")})],this.field=null,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null}normalizeCtorArgs(e){return Q(e)}get blurRadius(){return qe(this.radius)}set blurRadius(e){const i=this.maxPixelIntensity,r=this.minPixelIntensity;this._set("radius",Ce(e)),this._set("maxDensity",i*this._pixelIntensityToDensity),this._set("minDensity",r*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity)}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity)}get _pixelIntensityToDensity(){return 24/(Oe**2*this.blurRadius**4)}read(e,i){e=Q(e),super.read(e,i)}getSymbol(){return new ee}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,i){const r=this.field,o=this.valueExpression;r&&typeof r=="string"&&xe(e,i,r),o&&typeof o=="string"&&await O(e,i,o)}getAttributeHash(){return""}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new J({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:a(this.colorStops),field:this.field,legendOptions:a(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};t([s({type:_e,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],p.prototype,"authoringInfo",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"blurRadius",null),t([s({type:[C],json:{write:!0}})],p.prototype,"colorStops",void 0),t([s({type:String,json:{write:!0}})],p.prototype,"field",void 0),t([s({type:N,json:{write:!0}})],p.prototype,"legendOptions",void 0),t([s({type:Number,json:{write:!0}})],p.prototype,"maxDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"maxPixelIntensity",null),t([s({type:Number,json:{write:!0}})],p.prototype,"minDensity",void 0),t([s({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],p.prototype,"minPixelIntensity",null),t([s({type:Number,cast:W,json:{write:!0}})],p.prototype,"radius",void 0),t([s({type:Number,range:{min:0},json:{default:0,write:!0}})],p.prototype,"referenceScale",void 0),t([L({heatmap:"heatmap"})],p.prototype,"type",void 0),t([s({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],p.prototype,"valueExpression",void 0),t([s({type:String})],p.prototype,"valueExpressionTitle",void 0),t([s({readOnly:!0})],p.prototype,"_pixelIntensityToDensity",null),p=J=t([j("esri.renderers.HeatmapRenderer")],p);const oe=p;let E=class extends K(T){constructor(){super(...arguments),this.color=new w([0,0,0,0]),this.label=null,this.threshold=0}};t([s({type:w,json:{write:!0}})],E.prototype,"color",void 0),t([s({type:String,json:{write:!0}})],E.prototype,"label",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],E.prototype,"threshold",void 0),E=t([j("esri.renderers.support.OthersCategory")],E);const Be={base:Ve,key:"type",typeMap:{size:Ee,opacity:Re}};let m=class extends A(K(R)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new w([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new E,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart",this.visualVariables=null}getSymbol(){return new ee({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(ye)}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}async collectRequiredFields(e,i){await this.collectVVRequiredFields(e,i);for(const r of this.attributes)r.valueExpression&&await O(e,i,r.valueExpression),r.field&&e.add(r.field)}};t([s({type:[re],json:{write:!0}})],m.prototype,"attributes",void 0),t([s(je)],m.prototype,"backgroundFillSymbol",void 0),t([s({type:w,json:{write:!0}})],m.prototype,"defaultColor",void 0),t([s({type:String,json:{write:!0}})],m.prototype,"defaultLabel",void 0),t([s({type:Number,range:{min:0,max:1},json:{write:!0}})],m.prototype,"holePercentage",void 0),t([s({type:E,json:{write:!0}})],m.prototype,"othersCategory",void 0),t([s({type:Le,json:{write:!0}})],m.prototype,"legendOptions",void 0),t([s({type:G,json:{default:null,write:!0}})],m.prototype,"outline",void 0),t([s({type:Number,cast:W,json:{write:!0}})],m.prototype,"size",void 0),t([L({pieChart:"pie-chart"})],m.prototype,"type",void 0),t([s({types:[Be]})],m.prototype,"visualVariables",void 0),m=t([j("esri.renderers.PieChartRenderer")],m);const Je=m;var U;let V=U=class extends A(R){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.type="simple"}async collectRequiredFields(e,i){await Promise.all([this.collectSymbolFields(e,i),this.collectVVRequiredFields(e,i)])}async collectSymbolFields(e,i){await Promise.all(this.getSymbols().map(r=>r.collectRequiredFields(e,i)))}getSymbol(e,i){return this.symbol}async getSymbolAsync(e,i){return this.symbol}getSymbols(){return this.symbol?[this.symbol]:[]}getAttributeHash(){return this.visualVariables?.reduce((e,i)=>e+i.getAttributeHash(),"")??""}getMeshHash(){return this.getSymbols().reduce((e,i)=>e+JSON.stringify(i),"")}get arcadeRequired(){return this.arcadeRequiredForVisualVariables}clone(){return new U({description:this.description,label:this.label,symbol:a(this.symbol),visualVariables:a(this.visualVariables),authoringInfo:a(this.authoringInfo)})}};t([s({type:String,json:{write:!0}})],V.prototype,"description",void 0),t([s({type:String,json:{write:!0}})],V.prototype,"label",void 0),t([s(Ie)],V.prototype,"symbol",void 0),t([L({simple:"simple"})],V.prototype,"type",void 0),V=U=t([j("esri.renderers.SimpleRenderer")],V);const ne=V,Ue={key:"type",base:R,typeMap:{heatmap:oe,simple:ne,"unique-value":te,"class-breaks":ie,"dot-density":ze,dictionary:He,"pie-chart":Je},errorContext:"renderer"},_t={key:"type",base:R,typeMap:{simple:ne,"unique-value":te,"class-breaks":ie,heatmap:oe},errorContext:"renderer",validate:Ge};function Ge(e){switch(e.type){case"simple":return Ke(e);case"unique-value":return Xe(e);case"class-breaks":return Ye(e);case"heatmap":return e}}function Ke(e){if(e.symbol)return e;M.getLogger("esri.renderers.support.types").error("Removed invalid 'simple' renderer without a symbol from web scene.")}function Xe(e){const i=e.uniqueValueInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid unique value info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.uniqueValueInfos=r),e}function Ye(e){const i=e.classBreakInfos,r=i?.filter(({symbol:o,label:u},l)=>(o||M.getLogger("esri.renderers.support.types").error(`Removed invalid class break info ([${l}] ${u}) without a symbol from web scene.`),!!o));return r?.length!==i?.length&&(e.classBreakInfos=r),e}function Ze(e,i){return le(e,null,i)}const Qe=de({types:Ue});function le(e,i,r){return e?e&&(e.styleName||e.styleUrl)&&e.type!=="uniqueValue"?(r?.messages&&r.messages.push(new ce("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:r})),null):Qe(e,i,r):null}const jt=Object.freeze(Object.defineProperty({__proto__:null,fromJSON:Ze,read:le},Symbol.toStringTag,{value:"Module"}));export{jt as j,C as l,Ue as m,le as o,ne as p,Ze as t,_t as u}; diff --git a/custom-toc-highlight/assets/jsonUtils-wIllKWI4-DrGIvCCq.js b/custom-toc-highlight/assets/jsonUtils-wIllKWI4-MQQ-E5fj.js similarity index 91% rename from custom-toc-highlight/assets/jsonUtils-wIllKWI4-DrGIvCCq.js rename to custom-toc-highlight/assets/jsonUtils-wIllKWI4-MQQ-E5fj.js index 05fc8466..010da7f4 100644 --- a/custom-toc-highlight/assets/jsonUtils-wIllKWI4-DrGIvCCq.js +++ b/custom-toc-highlight/assets/jsonUtils-wIllKWI4-MQQ-E5fj.js @@ -1 +1 @@ -import{dK as f,o}from"./story-BfX8CRfG.js";import{c as u,a as i}from"./parser-DyDJ-rlI-C9jRH52J.js";function $(t,n,e){try{return p(t)}catch(a){e?.messages?.push(a)}return null}function y(t,n,e,a){try{const s=l(t);f(e,s,n)}catch(s){a.messages&&a.messages.push(s)}}function l(t){const n=u(t);return n?i(n)?n.map(e=>e.toJSON()):n.map(({scale:e,effects:a})=>({scale:e,value:a.map(s=>s.toJSON())})):null}function p(t){if(!t||t.length===0)return null;if(m(t)){const n=[];for(const e of t)n.push({scale:e.scale,value:c(e.value)});return n}return c(t)}function m(t){const n=t[0];return!!n&&"scale"in n}function c(t){if(!t?.length)return"";const n=[];for(const e of t){let a=[];switch(e.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":a=[r(e,"amount")];break;case"blur":a=[r(e,"radius","pt")];break;case"hue-rotate":a=[r(e,"angle","deg")];break;case"drop-shadow":a=[r(e,"xoffset","pt"),r(e,"yoffset","pt"),r(e,"blurRadius","pt"),h(e,"color")];break;case"bloom":a=[r(e,"strength"),r(e,"radius","pt"),r(e,"threshold")]}const s=`${e.type}(${a.filter(Boolean).join(" ")})`;u(s),n.push(s)}return n.join(" ")}function r(t,n,e){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});return e?t[n]+e:""+t[n]}function h(t,n){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});const e=t[n];return`rgba(${e[0]||0}, ${e[1]||0}, ${e[2]||0}, ${e[3]/255||0})`}export{$ as l,y as p}; +import{dK as f,o}from"./story-Doly9N9p.js";import{c as u,a as i}from"./parser-DyDJ-rlI-CvOs11Ip.js";function $(t,n,e){try{return p(t)}catch(a){e?.messages?.push(a)}return null}function y(t,n,e,a){try{const s=l(t);f(e,s,n)}catch(s){a.messages&&a.messages.push(s)}}function l(t){const n=u(t);return n?i(n)?n.map(e=>e.toJSON()):n.map(({scale:e,effects:a})=>({scale:e,value:a.map(s=>s.toJSON())})):null}function p(t){if(!t||t.length===0)return null;if(m(t)){const n=[];for(const e of t)n.push({scale:e.scale,value:c(e.value)});return n}return c(t)}function m(t){const n=t[0];return!!n&&"scale"in n}function c(t){if(!t?.length)return"";const n=[];for(const e of t){let a=[];switch(e.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":a=[r(e,"amount")];break;case"blur":a=[r(e,"radius","pt")];break;case"hue-rotate":a=[r(e,"angle","deg")];break;case"drop-shadow":a=[r(e,"xoffset","pt"),r(e,"yoffset","pt"),r(e,"blurRadius","pt"),h(e,"color")];break;case"bloom":a=[r(e,"strength"),r(e,"radius","pt"),r(e,"threshold")]}const s=`${e.type}(${a.filter(Boolean).join(" ")})`;u(s),n.push(s)}return n.join(" ")}function r(t,n,e){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});return e?t[n]+e:""+t[n]}function h(t,n){if(t[n]==null)throw new o("effect:missing-parameter",`Missing parameter '${n}' in ${t.type} effect`,{effect:t});const e=t[n];return`rgba(${e[0]||0}, ${e[1]||0}, ${e[2]||0}, ${e[3]/255||0})`}export{$ as l,y as p}; diff --git a/custom-toc-highlight/assets/jszip.min-C61Pcz7i-B7gysC6o.js b/custom-toc-highlight/assets/jszip.min-C61Pcz7i-CEwjNmOq.js similarity index 99% rename from custom-toc-highlight/assets/jszip.min-C61Pcz7i-B7gysC6o.js rename to custom-toc-highlight/assets/jszip.min-C61Pcz7i-CEwjNmOq.js index bba2eb94..f256d273 100644 --- a/custom-toc-highlight/assets/jszip.min-C61Pcz7i-B7gysC6o.js +++ b/custom-toc-highlight/assets/jszip.min-C61Pcz7i-CEwjNmOq.js @@ -1,2 +1,2 @@ -import{c0 as Bt,c1 as vt}from"./story-BfX8CRfG.js";import{o as yt}from"./_commonjs-dynamic-modules-BpilXLfW-CQY1QSED.js";import"./main-ugzBrWNm.js";function Rt(dt,wt){for(var _=0;_U[w]})}}}return Object.freeze(Object.defineProperty(dt,Symbol.toStringTag,{value:"Module"}))}var St={exports:{}},Et;function Ft(){return Et||(Et=1,function(dt,wt){(function(_){dt.exports=_()})(function(){return function _(U,w,h){function o(g,v){if(!w[g]){if(!U[g]){var m=typeof yt=="function"&&yt;if(!v&&m)return m(g,!0);if(n)return n(g,!0);var b=new Error("Cannot find module '"+g+"'");throw b.code="MODULE_NOT_FOUND",b}var i=w[g]={exports:{}};U[g][0].call(i.exports,function(c){var r=U[g][1][c];return o(r||c)},i,i.exports,_,U,w,h)}return w[g].exports}for(var n=typeof yt=="function"&&yt,u=0;u>2,i=(3&g)<<4|v>>4,c=1>6:64,r=2>4,v=(15&b)<<4|(i=n.indexOf(u.charAt(r++)))>>2,m=(3&i)<<6|(c=n.indexOf(u.charAt(r++))),d[l++]=g,i!==64&&(d[l++]=v),c!==64&&(d[l++]=m);return d}},{"./support":30,"./utils":32}],2:[function(_,U,w){var h=_("./external"),o=_("./stream/DataWorker"),n=_("./stream/Crc32Probe"),u=_("./stream/DataLengthProbe");function g(v,m,b,i,c){this.compressedSize=v,this.uncompressedSize=m,this.crc32=b,this.compression=i,this.compressedContent=c}g.prototype={getContentWorker:function(){var v=new o(h.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),m=this;return v.on("end",function(){if(this.streamInfo.data_length!==m.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),v},getCompressedWorker:function(){return new o(h.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(v,m,b){return v.pipe(new n).pipe(new u("uncompressedSize")).pipe(m.compressWorker(b)).pipe(new u("compressedSize")).withStreamInfo("compression",m)},U.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(_,U,w){var h=_("./stream/GenericWorker");w.STORE={magic:"\0\0",compressWorker:function(){return new h("STORE compression")},uncompressWorker:function(){return new h("STORE decompression")}},w.DEFLATE=_("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(_,U,w){var h=_("./utils"),o=function(){for(var n,u=[],g=0;g<256;g++){n=g;for(var v=0;v<8;v++)n=1&n?3988292384^n>>>1:n>>>1;u[g]=n}return u}();U.exports=function(n,u){return n!==void 0&&n.length?h.getTypeOf(n)!=="string"?function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v[r])];return-1^g}(0|u,n,n.length,0):function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v.charCodeAt(r))];return-1^g}(0|u,n,n.length,0):0}},{"./utils":32}],5:[function(_,U,w){w.base64=!1,w.binary=!1,w.dir=!1,w.createFolders=!0,w.date=null,w.compression=null,w.compressionOptions=null,w.comment=null,w.unixPermissions=null,w.dosPermissions=null},{}],6:[function(_,U,w){var h=null;h=typeof Promise<"u"?Promise:_("lie"),U.exports={Promise:h}},{lie:37}],7:[function(_,U,w){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=_("pako"),n=_("./utils"),u=_("./stream/GenericWorker"),g=h?"uint8array":"array";function v(m,b){u.call(this,"FlateWorker/"+m),this._pako=null,this._pakoAction=m,this._pakoOptions=b,this.meta={}}w.magic="\b\0",n.inherits(v,u),v.prototype.processChunk=function(m){this.meta=m.meta,this._pako===null&&this._createPako(),this._pako.push(n.transformTo(g,m.data),!1)},v.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var m=this;this._pako.onData=function(b){m.push({data:b,meta:m.meta})}},w.compressWorker=function(m){return new v("Deflate",m)},w.uncompressWorker=function(){return new v("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(_,U,w){function h(i,c){var r,l="";for(r=0;r>>=8;return l}function o(i,c,r,l,a,d){var y,z,x=i.file,D=i.compression,I=d!==g.utf8encode,j=n.transformTo("string",d(x.name)),C=n.transformTo("string",g.utf8encode(x.name)),W=x.comment,q=n.transformTo("string",d(W)),p=n.transformTo("string",g.utf8encode(W)),B=C.length!==x.name.length,e=p.length!==W.length,F="",X="",N="",$=x.dir,L=x.date,H={crc32:0,compressedSize:0,uncompressedSize:0};c&&!r||(H.crc32=i.crc32,H.compressedSize=i.compressedSize,H.uncompressedSize=i.uncompressedSize);var A=0;c&&(A|=8),I||!B&&!e||(A|=2048);var E=0,J=0;$&&(E|=16),a==="UNIX"?(J=798,E|=function(G,nt){var ot=G;return G||(ot=nt?16893:33204),(65535&ot)<<16}(x.unixPermissions,$)):(J=20,E|=function(G){return 63&(G||0)}(x.dosPermissions)),y=L.getUTCHours(),y<<=6,y|=L.getUTCMinutes(),y<<=5,y|=L.getUTCSeconds()/2,z=L.getUTCFullYear()-1980,z<<=4,z|=L.getUTCMonth()+1,z<<=5,z|=L.getUTCDate(),B&&(X=h(1,1)+h(v(j),4)+C,F+="up"+h(X.length,2)+X),e&&(N=h(1,1)+h(v(q),4)+p,F+="uc"+h(N.length,2)+N);var K="";return K+=` +import{c0 as Bt,c1 as vt}from"./story-Doly9N9p.js";import{o as yt}from"./_commonjs-dynamic-modules-BpilXLfW-CQY1QSED.js";import"./main-QGPoLsvl.js";function Rt(dt,wt){for(var _=0;_U[w]})}}}return Object.freeze(Object.defineProperty(dt,Symbol.toStringTag,{value:"Module"}))}var St={exports:{}},Et;function Ft(){return Et||(Et=1,function(dt,wt){(function(_){dt.exports=_()})(function(){return function _(U,w,h){function o(g,v){if(!w[g]){if(!U[g]){var m=typeof yt=="function"&&yt;if(!v&&m)return m(g,!0);if(n)return n(g,!0);var b=new Error("Cannot find module '"+g+"'");throw b.code="MODULE_NOT_FOUND",b}var i=w[g]={exports:{}};U[g][0].call(i.exports,function(c){var r=U[g][1][c];return o(r||c)},i,i.exports,_,U,w,h)}return w[g].exports}for(var n=typeof yt=="function"&&yt,u=0;u>2,i=(3&g)<<4|v>>4,c=1>6:64,r=2>4,v=(15&b)<<4|(i=n.indexOf(u.charAt(r++)))>>2,m=(3&i)<<6|(c=n.indexOf(u.charAt(r++))),d[l++]=g,i!==64&&(d[l++]=v),c!==64&&(d[l++]=m);return d}},{"./support":30,"./utils":32}],2:[function(_,U,w){var h=_("./external"),o=_("./stream/DataWorker"),n=_("./stream/Crc32Probe"),u=_("./stream/DataLengthProbe");function g(v,m,b,i,c){this.compressedSize=v,this.uncompressedSize=m,this.crc32=b,this.compression=i,this.compressedContent=c}g.prototype={getContentWorker:function(){var v=new o(h.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),m=this;return v.on("end",function(){if(this.streamInfo.data_length!==m.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),v},getCompressedWorker:function(){return new o(h.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(v,m,b){return v.pipe(new n).pipe(new u("uncompressedSize")).pipe(m.compressWorker(b)).pipe(new u("compressedSize")).withStreamInfo("compression",m)},U.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(_,U,w){var h=_("./stream/GenericWorker");w.STORE={magic:"\0\0",compressWorker:function(){return new h("STORE compression")},uncompressWorker:function(){return new h("STORE decompression")}},w.DEFLATE=_("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(_,U,w){var h=_("./utils"),o=function(){for(var n,u=[],g=0;g<256;g++){n=g;for(var v=0;v<8;v++)n=1&n?3988292384^n>>>1:n>>>1;u[g]=n}return u}();U.exports=function(n,u){return n!==void 0&&n.length?h.getTypeOf(n)!=="string"?function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v[r])];return-1^g}(0|u,n,n.length,0):function(g,v,m,b){var i=o,c=b+m;g^=-1;for(var r=b;r>>8^i[255&(g^v.charCodeAt(r))];return-1^g}(0|u,n,n.length,0):0}},{"./utils":32}],5:[function(_,U,w){w.base64=!1,w.binary=!1,w.dir=!1,w.createFolders=!0,w.date=null,w.compression=null,w.compressionOptions=null,w.comment=null,w.unixPermissions=null,w.dosPermissions=null},{}],6:[function(_,U,w){var h=null;h=typeof Promise<"u"?Promise:_("lie"),U.exports={Promise:h}},{lie:37}],7:[function(_,U,w){var h=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=_("pako"),n=_("./utils"),u=_("./stream/GenericWorker"),g=h?"uint8array":"array";function v(m,b){u.call(this,"FlateWorker/"+m),this._pako=null,this._pakoAction=m,this._pakoOptions=b,this.meta={}}w.magic="\b\0",n.inherits(v,u),v.prototype.processChunk=function(m){this.meta=m.meta,this._pako===null&&this._createPako(),this._pako.push(n.transformTo(g,m.data),!1)},v.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var m=this;this._pako.onData=function(b){m.push({data:b,meta:m.meta})}},w.compressWorker=function(m){return new v("Deflate",m)},w.uncompressWorker=function(){return new v("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(_,U,w){function h(i,c){var r,l="";for(r=0;r>>=8;return l}function o(i,c,r,l,a,d){var y,z,x=i.file,D=i.compression,I=d!==g.utf8encode,j=n.transformTo("string",d(x.name)),C=n.transformTo("string",g.utf8encode(x.name)),W=x.comment,q=n.transformTo("string",d(W)),p=n.transformTo("string",g.utf8encode(W)),B=C.length!==x.name.length,e=p.length!==W.length,F="",X="",N="",$=x.dir,L=x.date,H={crc32:0,compressedSize:0,uncompressedSize:0};c&&!r||(H.crc32=i.crc32,H.compressedSize=i.compressedSize,H.uncompressedSize=i.uncompressedSize);var A=0;c&&(A|=8),I||!B&&!e||(A|=2048);var E=0,J=0;$&&(E|=16),a==="UNIX"?(J=798,E|=function(G,nt){var ot=G;return G||(ot=nt?16893:33204),(65535&ot)<<16}(x.unixPermissions,$)):(J=20,E|=function(G){return 63&(G||0)}(x.dosPermissions)),y=L.getUTCHours(),y<<=6,y|=L.getUTCMinutes(),y<<=5,y|=L.getUTCSeconds()/2,z=L.getUTCFullYear()-1980,z<<=4,z|=L.getUTCMonth()+1,z<<=5,z|=L.getUTCDate(),B&&(X=h(1,1)+h(v(j),4)+C,F+="up"+h(X.length,2)+X),e&&(N=h(1,1)+h(v(q),4)+p,F+="uc"+h(N.length,2)+N);var K="";return K+=` \0`,K+=h(A,2),K+=D.magic,K+=h(y,2),K+=h(z,2),K+=h(H.crc32,4),K+=h(H.compressedSize,4),K+=h(H.uncompressedSize,4),K+=h(j.length,2),K+=h(F.length,2),{fileRecord:m.LOCAL_FILE_HEADER+K+j+F,dirRecord:m.CENTRAL_FILE_HEADER+h(J,2)+K+h(q.length,2)+"\0\0\0\0"+h(E,4)+h(l,4)+j+F+q}}var n=_("../utils"),u=_("../stream/GenericWorker"),g=_("../utf8"),v=_("../crc32"),m=_("../signature");function b(i,c,r,l){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=c,this.zipPlatform=r,this.encodeFileName=l,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}n.inherits(b,u),b.prototype.push=function(i){var c=i.meta.percent||0,r=this.entriesCount,l=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,u.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:r?(c+100*(r-l-1))/r:100}}))},b.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var c=this.streamFiles&&!i.file.dir;if(c){var r=o(i,c,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},b.prototype.closedSource=function(i){this.accumulate=!1;var c=this.streamFiles&&!i.file.dir,r=o(i,c,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),c)this.push({data:function(l){return m.DATA_DESCRIPTOR+h(l.crc32,4)+h(l.compressedSize,4)+h(l.uncompressedSize,4)}(i),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},b.prototype.flush=function(){for(var i=this.bytesWritten,c=0;c=this.index;u--)g=(g<<8)+this.byteAt(u);return this.index+=n,g},readString:function(n){return h.transformTo("string",this.readData(n))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var n=this.readInt(4);return new Date(Date.UTC(1980+(n>>25&127),(n>>21&15)-1,n>>16&31,n>>11&31,n>>5&63,(31&n)<<1))}},U.exports=o},{"../utils":32}],19:[function(_,U,w){var h=_("./Uint8ArrayReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(_,U,w){var h=_("./DataReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.byteAt=function(n){return this.data.charCodeAt(this.zero+n)},o.prototype.lastIndexOfSignature=function(n){return this.data.lastIndexOf(n)-this.zero},o.prototype.readAndCheckSignature=function(n){return n===this.readData(4)},o.prototype.readData=function(n){this.checkOffset(n);var u=this.data.slice(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./DataReader":18}],21:[function(_,U,w){var h=_("./ArrayReader");function o(n){h.call(this,n)}_("../utils").inherits(o,h),o.prototype.readData=function(n){if(this.checkOffset(n),n===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+n);return this.index+=n,u},U.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(_,U,w){var h=_("../utils"),o=_("../support"),n=_("./ArrayReader"),u=_("./StringReader"),g=_("./NodeBufferReader"),v=_("./Uint8ArrayReader");U.exports=function(m){var b=h.getTypeOf(m);return h.checkSupport(b),b!=="string"||o.uint8array?b==="nodebuffer"?new g(m):o.uint8array?new v(h.transformTo("uint8array",m)):new n(h.transformTo("array",m)):new u(m)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(_,U,w){w.LOCAL_FILE_HEADER="PK",w.CENTRAL_FILE_HEADER="PK",w.CENTRAL_DIRECTORY_END="PK",w.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",w.ZIP64_CENTRAL_DIRECTORY_END="PK",w.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(_,U,w){var h=_("./GenericWorker"),o=_("../utils");function n(u){h.call(this,"ConvertWorker to "+u),this.destType=u}o.inherits(n,h),n.prototype.processChunk=function(u){this.push({data:o.transformTo(this.destType,u.data),meta:u.meta})},U.exports=n},{"../utils":32,"./GenericWorker":28}],25:[function(_,U,w){var h=_("./GenericWorker"),o=_("../crc32");function n(){h.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}_("../utils").inherits(n,h),n.prototype.processChunk=function(u){this.streamInfo.crc32=o(u.data,this.streamInfo.crc32||0),this.push(u)},U.exports=n},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(_,U,w){var h=_("../utils"),o=_("./GenericWorker");function n(u){o.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}h.inherits(n,o),n.prototype.processChunk=function(u){if(u){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+u.data.length}o.prototype.processChunk.call(this,u)},U.exports=n},{"../utils":32,"./GenericWorker":28}],27:[function(_,U,w){var h=_("../utils"),o=_("./GenericWorker");function n(u){o.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,u.then(function(v){g.dataIsReady=!0,g.data=v,g.max=v&&v.length||0,g.type=h.getTypeOf(v),g.isPaused||g._tickAndRepeat()},function(v){g.error(v)})}h.inherits(n,o),n.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},n.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,h.delay(this._tickAndRepeat,[],this)),!0)},n.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(h.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},n.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var u=null,g=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,g);break;case"uint8array":u=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":u=this.data.slice(this.index,g)}return this.index=g,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},U.exports=n},{"../utils":32,"./GenericWorker":28}],28:[function(_,U,w){function h(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}h.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,n){return this._listeners[o].push(n),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,n){if(this._listeners[o])for(var u=0;u "+o:o}},U.exports=h},{}],29:[function(_,U,w){var h=_("../utils"),o=_("./ConvertWorker"),n=_("./GenericWorker"),u=_("../base64"),g=_("../support"),v=_("../external"),m=null;if(g.nodestream)try{m=_("../nodejs/NodejsStreamOutputAdapter")}catch{}function b(c,r){return new v.Promise(function(l,a){var d=[],y=c._internalType,z=c._outputType,x=c._mimeType;c.on("data",function(D,I){d.push(D),r&&r(I)}).on("error",function(D){d=[],a(D)}).on("end",function(){try{var D=function(I,j,C){switch(I){case"blob":return h.newBlob(h.transformTo("arraybuffer",j),C);case"base64":return u.encode(j);default:return h.transformTo(I,j)}}(z,function(I,j){var C,W=0,q=null,p=0;for(C=0;C"u")w.blob=!1;else{var h=new ArrayBuffer(0);try{w.blob=new Blob([h],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(h),w.blob=o.getBlob("application/zip").size===0}catch{w.blob=!1}}}try{w.nodestream=!!_("readable-stream").Readable}catch{w.nodestream=!1}},{"readable-stream":16}],31:[function(_,U,w){for(var h=_("./utils"),o=_("./support"),n=_("./nodejsUtils"),u=_("./stream/GenericWorker"),g=new Array(256),v=0;v<256;v++)g[v]=252<=v?6:248<=v?5:240<=v?4:224<=v?3:192<=v?2:1;g[254]=g[254]=1;function m(){u.call(this,"utf-8 decode"),this.leftOver=null}function b(){u.call(this,"utf-8 encode")}w.utf8encode=function(i){return o.nodebuffer?n.newBufferFrom(i,"utf-8"):function(c){var r,l,a,d,y,z=c.length,x=0;for(d=0;d>>6:(l<65536?r[y++]=224|l>>>12:(r[y++]=240|l>>>18,r[y++]=128|l>>>12&63),r[y++]=128|l>>>6&63),r[y++]=128|63&l);return r}(i)},w.utf8decode=function(i){return o.nodebuffer?h.transformTo("nodebuffer",i).toString("utf-8"):function(c){var r,l,a,d,y=c.length,z=new Array(2*y);for(r=l=0;r>10&1023,z[l++]=56320|1023&a)}return z.length!==l&&(z.subarray?z=z.subarray(0,l):z.length=l),h.applyFromCharCode(z)}(i=h.transformTo(o.uint8array?"uint8array":"array",i))},h.inherits(m,u),m.prototype.processChunk=function(i){var c=h.transformTo(o.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var r=c;(c=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),c.set(r,this.leftOver.length)}else c=this.leftOver.concat(c);this.leftOver=null}var l=function(d,y){var z;for((y=y||d.length)>d.length&&(y=d.length),z=y-1;0<=z&&(192&d[z])==128;)z--;return z<0||z===0?y:z+g[d[z]]>y?z:y}(c),a=c;l!==c.length&&(o.uint8array?(a=c.subarray(0,l),this.leftOver=c.subarray(l,c.length)):(a=c.slice(0,l),this.leftOver=c.slice(l,c.length))),this.push({data:w.utf8decode(a),meta:i.meta})},m.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:w.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},w.Utf8DecodeWorker=m,h.inherits(b,u),b.prototype.processChunk=function(i){this.push({data:w.utf8encode(i.data),meta:i.meta})},w.Utf8EncodeWorker=b},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(_,U,w){var h=_("./support"),o=_("./base64"),n=_("./nodejsUtils"),u=_("./external");function g(r){return r}function v(r,l){for(var a=0;a>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=h(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var c,r,l,a=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4>>6:(i<65536?b[l++]=224|i>>>12:(b[l++]=240|i>>>18,b[l++]=128|i>>>12&63),b[l++]=128|i>>>6&63),b[l++]=128|63&i);return b},w.buf2binstring=function(m){return v(m,m.length)},w.binstring2buf=function(m){for(var b=new h.Buf8(m.length),i=0,c=b.length;i>10&1023,d[c++]=56320|1023&r)}return v(d,c)},w.utf8border=function(m,b){var i;for((b=b||m.length)>m.length&&(b=m.length),i=b-1;0<=i&&(192&m[i])==128;)i--;return i<0||i===0?b:i+u[m[i]]>b?i:b}},{"./common":41}],43:[function(_,U,w){U.exports=function(h,o,n,u){for(var g=65535&h|0,v=h>>>16&65535|0,m=0;n!==0;){for(n-=m=2e3>>1:o>>>1;n[u]=o}return n}();U.exports=function(o,n,u,g){var v=h,m=g+u;o^=-1;for(var b=g;b>>8^v[255&(o^n[b])];return-1^o}},{}],46:[function(_,U,w){var h,o=_("../utils/common"),n=_("./trees"),u=_("./adler32"),g=_("./crc32"),v=_("./messages"),m=0,b=4,i=0,c=-2,r=-1,l=4,a=2,d=8,y=9,z=286,x=30,D=19,I=2*z+1,j=15,C=3,W=258,q=W+C+1,p=42,B=113,e=1,F=2,X=3,N=4;function $(t,R){return t.msg=v[R],R}function L(t){return(t<<1)-(4t.avail_out&&(O=t.avail_out),O!==0&&(o.arraySet(t.output,R.pending_buf,R.pending_out,O,t.next_out),t.next_out+=O,R.pending_out+=O,t.total_out+=O,t.avail_out-=O,R.pending-=O,R.pending===0&&(R.pending_out=0))}function E(t,R){n._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,R),t.block_start=t.strstart,A(t.strm)}function J(t,R){t.pending_buf[t.pending++]=R}function K(t,R){t.pending_buf[t.pending++]=R>>>8&255,t.pending_buf[t.pending++]=255&R}function G(t,R){var O,f,s=t.max_chain_length,k=t.strstart,T=t.prev_length,P=t.nice_match,S=t.strstart>t.w_size-q?t.strstart-(t.w_size-q):0,Z=t.window,Y=t.w_mask,M=t.prev,V=t.strstart+W,rt=Z[k+T-1],tt=Z[k+T];t.prev_length>=t.good_match&&(s>>=2),P>t.lookahead&&(P=t.lookahead);do if(Z[(O=R)+T]===tt&&Z[O+T-1]===rt&&Z[O]===Z[k]&&Z[++O]===Z[k+1]){k+=2,O++;do;while(Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&Z[++k]===Z[++O]&&kS&&--s!=0);return T<=t.lookahead?T:t.lookahead}function nt(t){var R,O,f,s,k,T,P,S,Z,Y,M=t.w_size;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=M+(M-q)){for(o.arraySet(t.window,t.window,M,M,0),t.match_start-=M,t.strstart-=M,t.block_start-=M,R=O=t.hash_size;f=t.head[--R],t.head[R]=M<=f?f-M:0,--O;);for(R=O=M;f=t.prev[--R],t.prev[R]=M<=f?f-M:0,--O;);s+=M}if(t.strm.avail_in===0)break;if(T=t.strm,P=t.window,S=t.strstart+t.lookahead,Z=s,Y=void 0,Y=T.avail_in,Z=C)for(k=t.strstart-t.insert,t.ins_h=t.window[k],t.ins_h=(t.ins_h<=C&&(t.ins_h=(t.ins_h<=C)if(f=n._tr_tally(t,t.strstart-t.match_start,t.match_length-C),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=C){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<=C&&(t.ins_h=(t.ins_h<=C&&t.match_length<=t.prev_length){for(s=t.strstart+t.lookahead-C,f=n._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-C),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=s&&(t.ins_h=(t.ins_h<t.pending_buf_size-5&&(O=t.pending_buf_size-5);;){if(t.lookahead<=1){if(nt(t),t.lookahead===0&&R===m)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var f=t.block_start+O;if((t.strstart===0||t.strstart>=f)&&(t.lookahead=t.strstart-f,t.strstart=f,E(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-q&&(E(t,!1),t.strm.avail_out===0))return e}return t.insert=0,R===b?(E(t,!0),t.strm.avail_out===0?X:N):(t.strstart>t.block_start&&(E(t,!1),t.strm.avail_out),e)}),new et(4,4,8,4,ot),new et(4,5,16,8,ot),new et(4,6,32,32,ot),new et(4,4,16,16,Q),new et(8,16,32,32,Q),new et(8,16,128,128,Q),new et(8,32,128,256,Q),new et(32,128,258,1024,Q),new et(32,258,258,4096,Q)],w.deflateInit=function(t,R){return ut(t,R,d,15,8,0)},w.deflateInit2=ut,w.deflateReset=lt,w.deflateResetKeep=it,w.deflateSetHeader=function(t,R){return t&&t.state?t.state.wrap!==2?c:(t.state.gzhead=R,i):c},w.deflate=function(t,R){var O,f,s,k;if(!t||!t.state||5>8&255),J(f,f.gzhead.time>>16&255),J(f,f.gzhead.time>>24&255),J(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),J(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(J(f,255&f.gzhead.extra.length),J(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(t.adler=g(t.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(J(f,0),J(f,0),J(f,0),J(f,0),J(f,0),J(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),J(f,3),f.status=B);else{var T=d+(f.w_bits-8<<4)<<8;T|=(2<=f.strategy||f.level<2?0:f.level<6?1:f.level===6?2:3)<<6,f.strstart!==0&&(T|=32),T+=31-T%31,f.status=B,K(f,T),f.strstart!==0&&(K(f,t.adler>>>16),K(f,65535&t.adler)),t.adler=1}if(f.status===69)if(f.gzhead.extra){for(s=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending!==f.pending_buf_size));)J(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(f.status===73)if(f.gzhead.name){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending===f.pending_buf_size)){k=1;break}k=f.gzindexs&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),k===0&&(f.gzindex=0,f.status=91)}else f.status=91;if(f.status===91)if(f.gzhead.comment){s=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>s&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),A(t),s=f.pending,f.pending===f.pending_buf_size)){k=1;break}k=f.gzindexs&&(t.adler=g(t.adler,f.pending_buf,f.pending-s,s)),k===0&&(f.status=103)}else f.status=103;if(f.status===103&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&A(t),f.pending+2<=f.pending_buf_size&&(J(f,255&t.adler),J(f,t.adler>>8&255),t.adler=0,f.status=B)):f.status=B),f.pending!==0){if(A(t),t.avail_out===0)return f.last_flush=-1,i}else if(t.avail_in===0&&L(R)<=L(O)&&R!==b)return $(t,-5);if(f.status===666&&t.avail_in!==0)return $(t,-5);if(t.avail_in!==0||f.lookahead!==0||R!==m&&f.status!==666){var P=f.strategy===2?function(S,Z){for(var Y;;){if(S.lookahead===0&&(nt(S),S.lookahead===0)){if(Z===m)return e;break}if(S.match_length=0,Y=n._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++,Y&&(E(S,!1),S.strm.avail_out===0))return e}return S.insert=0,Z===b?(E(S,!0),S.strm.avail_out===0?X:N):S.last_lit&&(E(S,!1),S.strm.avail_out===0)?e:F}(f,R):f.strategy===3?function(S,Z){for(var Y,M,V,rt,tt=S.window;;){if(S.lookahead<=W){if(nt(S),S.lookahead<=W&&Z===m)return e;if(S.lookahead===0)break}if(S.match_length=0,S.lookahead>=C&&0S.lookahead&&(S.match_length=S.lookahead)}if(S.match_length>=C?(Y=n._tr_tally(S,1,S.match_length-C),S.lookahead-=S.match_length,S.strstart+=S.match_length,S.match_length=0):(Y=n._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++),Y&&(E(S,!1),S.strm.avail_out===0))return e}return S.insert=0,Z===b?(E(S,!0),S.strm.avail_out===0?X:N):S.last_lit&&(E(S,!1),S.strm.avail_out===0)?e:F}(f,R):h[f.level].func(f,R);if(P!==X&&P!==N||(f.status=666),P===e||P===X)return t.avail_out===0&&(f.last_flush=-1),i;if(P===F&&(R===1?n._tr_align(f):R!==5&&(n._tr_stored_block(f,0,0,!1),R===3&&(H(f.head),f.lookahead===0&&(f.strstart=0,f.block_start=0,f.insert=0))),A(t),t.avail_out===0))return f.last_flush=-1,i}return R!==b?i:f.wrap<=0?1:(f.wrap===2?(J(f,255&t.adler),J(f,t.adler>>8&255),J(f,t.adler>>16&255),J(f,t.adler>>24&255),J(f,255&t.total_in),J(f,t.total_in>>8&255),J(f,t.total_in>>16&255),J(f,t.total_in>>24&255)):(K(f,t.adler>>>16),K(f,65535&t.adler)),A(t),0=O.w_size&&(k===0&&(H(O.head),O.strstart=0,O.block_start=0,O.insert=0),Z=new o.Buf8(O.w_size),o.arraySet(Z,R,Y-O.w_size,O.w_size,0),R=Z,Y=O.w_size),T=t.avail_in,P=t.next_in,S=t.input,t.avail_in=Y,t.next_in=0,t.input=R,nt(O);O.lookahead>=C;){for(f=O.strstart,s=O.lookahead-(C-1);O.ins_h=(O.ins_h<>>=C=j>>>24,y-=C,(C=j>>>16&255)===0)F[v++]=65535&j;else{if(!(16&C)){if(!(64&C)){j=z[(65535&j)+(d&(1<>>=C,y-=C),y<15&&(d+=e[u++]<>>=C=j>>>24,y-=C,!(16&(C=j>>>16&255))){if(!(64&C)){j=x[(65535&j)+(d&(1<>>=C,y-=C,(C=v-m)>3,d&=(1<<(y-=W<<3))-1,h.next_in=u,h.next_out=v,h.avail_in=u>>24&255)+(p>>>8&65280)+((65280&p)<<8)+((255&p)<<24)}function d(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new h.Buf16(320),this.work=new h.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y(p){var B;return p&&p.state?(B=p.state,p.total_in=p.total_out=B.total=0,p.msg="",B.wrap&&(p.adler=1&B.wrap),B.mode=c,B.last=0,B.havedict=0,B.dmax=32768,B.head=null,B.hold=0,B.bits=0,B.lencode=B.lendyn=new h.Buf32(r),B.distcode=B.distdyn=new h.Buf32(l),B.sane=1,B.back=-1,b):i}function z(p){var B;return p&&p.state?((B=p.state).wsize=0,B.whave=0,B.wnext=0,y(p)):i}function x(p,B){var e,F;return p&&p.state?(F=p.state,B<0?(e=0,B=-B):(e=1+(B>>4),B<48&&(B&=15)),B&&(B<8||15=N.wsize?(h.arraySet(N.window,B,e-N.wsize,N.wsize,0),N.wnext=0,N.whave=N.wsize):(F<(X=N.wsize-N.wnext)&&(X=F),h.arraySet(N.window,B,e-F,X,N.wnext),(F-=X)?(h.arraySet(N.window,B,e-F,F,0),N.wnext=F,N.whave=N.wsize):(N.wnext+=X,N.wnext===N.wsize&&(N.wnext=0),N.whave>>8&255,e.check=n(e.check,k,2,0),E=A=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&A)<<8)+(A>>8))%31){p.msg="incorrect header check",e.mode=30;break}if((15&A)!=8){p.msg="unknown compression method",e.mode=30;break}if(E-=4,t=8+(15&(A>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){p.msg="invalid window size",e.mode=30;break}e.dmax=1<>8&1),512&e.flags&&(k[0]=255&A,k[1]=A>>>8&255,e.check=n(e.check,k,2,0)),E=A=0,e.mode=3;case 3:for(;E<32;){if(L===0)break t;L--,A+=F[N++]<>>8&255,k[2]=A>>>16&255,k[3]=A>>>24&255,e.check=n(e.check,k,4,0)),E=A=0,e.mode=4;case 4:for(;E<16;){if(L===0)break t;L--,A+=F[N++]<>8),512&e.flags&&(k[0]=255&A,k[1]=A>>>8&255,e.check=n(e.check,k,2,0)),E=A=0,e.mode=5;case 5:if(1024&e.flags){for(;E<16;){if(L===0)break t;L--,A+=F[N++]<>>8&255,e.check=n(e.check,k,2,0)),E=A=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(L<(G=e.length)&&(G=L),G&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),h.arraySet(e.head.extra,F,N,G,t)),512&e.flags&&(e.check=n(e.check,F,G,N)),L-=G,N+=G,e.length-=G),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(L===0)break t;for(G=0;t=F[N+G++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&G>9&1,e.head.done=!0),p.adler=e.check=0,e.mode=12;break;case 10:for(;E<32;){if(L===0)break t;L--,A+=F[N++]<>>=7&E,E-=7&E,e.mode=27;break}for(;E<3;){if(L===0)break t;L--,A+=F[N++]<>>=1)){case 0:e.mode=14;break;case 1:if(W(e),e.mode=20,B!==6)break;A>>>=2,E-=2;break t;case 2:e.mode=17;break;case 3:p.msg="invalid block type",e.mode=30}A>>>=2,E-=2;break;case 14:for(A>>>=7&E,E-=7&E;E<32;){if(L===0)break t;L--,A+=F[N++]<>>16^65535)){p.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&A,E=A=0,e.mode=15,B===6)break t;case 15:e.mode=16;case 16:if(G=e.length){if(L>>=5,E-=5,e.ndist=1+(31&A),A>>>=5,E-=5,e.ncode=4+(15&A),A>>>=4,E-=4,286>>=3,E-=3}for(;e.have<19;)e.lens[T[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,O={bits:e.lenbits},R=g(0,e.lens,0,19,e.lencode,0,e.work,O),e.lenbits=O.bits,R){p.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=Q,E-=Q,e.lens[e.have++]=st;else{if(st===16){for(f=Q+2;E>>=Q,E-=Q,e.have===0){p.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],G=3+(3&A),A>>>=2,E-=2}else if(st===17){for(f=Q+3;E>>=Q)),A>>>=3,E-=3}else{for(f=Q+7;E>>=Q)),A>>>=7,E-=7}if(e.have+G>e.nlen+e.ndist){p.msg="invalid bit length repeat",e.mode=30;break}for(;G--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){p.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,O={bits:e.lenbits},R=g(v,e.lens,0,e.nlen,e.lencode,0,e.work,O),e.lenbits=O.bits,R){p.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,O={bits:e.distbits},R=g(m,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,O),e.distbits=O.bits,R){p.msg="invalid distances set",e.mode=30;break}if(e.mode=20,B===6)break t;case 20:e.mode=21;case 21:if(6<=L&&258<=H){p.next_out=$,p.avail_out=H,p.next_in=N,p.avail_in=L,e.hold=A,e.bits=E,u(p,K),$=p.next_out,X=p.output,H=p.avail_out,N=p.next_in,F=p.input,L=p.avail_in,A=e.hold,E=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;et=(s=e.lencode[A&(1<>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=it,E-=it,e.back+=it}if(A>>>=Q,E-=Q,e.back+=Q,e.length=st,et===0){e.mode=26;break}if(32&et){e.back=-1,e.mode=12;break}if(64&et){p.msg="invalid literal/length code",e.mode=30;break}e.extra=15&et,e.mode=22;case 22:if(e.extra){for(f=e.extra;E>>=e.extra,E-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;et=(s=e.distcode[A&(1<>>16&255,st=65535&s,!((Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>it)])>>>16&255,st=65535&s,!(it+(Q=s>>>24)<=E);){if(L===0)break t;L--,A+=F[N++]<>>=it,E-=it,e.back+=it}if(A>>>=Q,E-=Q,e.back+=Q,64&et){p.msg="invalid distance code",e.mode=30;break}e.offset=st,e.extra=15&et,e.mode=24;case 24:if(e.extra){for(f=e.extra;E>>=e.extra,E-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){p.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(H===0)break t;if(G=K-H,e.offset>G){if((G=e.offset-G)>e.whave&&e.sane){p.msg="invalid distance too far back",e.mode=30;break}nt=G>e.wnext?(G-=e.wnext,e.wsize-G):e.wnext-G,G>e.length&&(G=e.length),ot=e.window}else ot=X,nt=$-e.offset,G=e.length;for(HI?(C=nt[ot+l[B]],E[J+l[B]]):(C=96,0),d=1<>$)+(y-=d)]=j<<24|C<<16|W|0,y!==0;);for(d=1<>=1;if(d!==0?(A&=d-1,A+=d):A=0,B++,--K[p]==0){if(p===F)break;p=m[b+l[B]]}if(X>>7)]}function J(s,k){s.pending_buf[s.pending++]=255&k,s.pending_buf[s.pending++]=k>>>8&255}function K(s,k,T){s.bi_valid>a-T?(s.bi_buf|=k<>a-s.bi_valid,s.bi_valid+=T-a):(s.bi_buf|=k<>>=1,T<<=1,0<--k;);return T>>>1}function ot(s,k,T){var P,S,Z=new Array(l+1),Y=0;for(P=1;P<=l;P++)Z[P]=Y=Y+T[P-1]<<1;for(S=0;S<=k;S++){var M=s[2*S+1];M!==0&&(s[2*S]=nt(Z[M]++,M))}}function Q(s){var k;for(k=0;k>1;1<=T;T--)it(s,Z,T);for(S=V;T=s.heap[1],s.heap[1]=s.heap[s.heap_len--],it(s,Z,1),P=s.heap[1],s.heap[--s.heap_max]=T,s.heap[--s.heap_max]=P,Z[2*S]=Z[2*T]+Z[2*P],s.depth[S]=(s.depth[T]>=s.depth[P]?s.depth[T]:s.depth[P])+1,Z[2*T+1]=Z[2*P+1]=S,s.heap[1]=S++,it(s,Z,1),2<=s.heap_len;);s.heap[--s.heap_max]=s.heap[1],function(tt,ht){var pt,ft,mt,at,gt,kt,ct=ht.dyn_tree,xt=ht.max_code,Ot=ht.stat_desc.static_tree,Ct=ht.stat_desc.has_stree,It=ht.stat_desc.extra_bits,zt=ht.stat_desc.extra_base,_t=ht.stat_desc.max_length,bt=0;for(at=0;at<=l;at++)tt.bl_count[at]=0;for(ct[2*tt.heap[tt.heap_max]+1]=0,pt=tt.heap_max+1;pt>=7;S>>=1)if(1&rt&&M.dyn_ltree[2*V]!==0)return o;if(M.dyn_ltree[18]!==0||M.dyn_ltree[20]!==0||M.dyn_ltree[26]!==0)return n;for(V=32;V>>3,(Z=s.static_len+3+7>>>3)<=S&&(S=Z)):S=Z=T+5,T+4<=S&&k!==-1?f(s,k,T,P):s.strategy===4||Z===S?(K(s,2+(P?1:0),3),lt(s,q,p)):(K(s,4+(P?1:0),3),function(M,V,rt,tt){var ht;for(K(M,V-257,5),K(M,rt-1,5),K(M,tt-4,4),ht=0;ht>>8&255,s.pending_buf[s.d_buf+2*s.last_lit+1]=255&k,s.pending_buf[s.l_buf+s.last_lit]=255&T,s.last_lit++,k===0?s.dyn_ltree[2*T]++:(s.matches++,k--,s.dyn_ltree[2*(e[T]+m+1)]++,s.dyn_dtree[2*E(k)]++),s.last_lit===s.lit_bufsize-1},w._tr_align=function(s){K(s,2,3),G(s,y,q),function(k){k.bi_valid===16?(J(k,k.bi_buf),k.bi_buf=0,k.bi_valid=0):8<=k.bi_valid&&(k.pending_buf[k.pending++]=255&k.bi_buf,k.bi_buf>>=8,k.bi_valid-=8)}(s)}},{"../utils/common":41}],53:[function(_,U,w){U.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(_,U,w){(function(h){(function(o,n){if(!o.setImmediate){var u,g,v,m,b=1,i={},c=!1,r=o.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(o);l=l&&l.setTimeout?l:o,u={}.toString.call(o.process)==="[object process]"?function(z){process.nextTick(function(){d(z)})}:function(){if(o.postMessage&&!o.importScripts){var z=!0,x=o.onmessage;return o.onmessage=function(){z=!1},o.postMessage("","*"),o.onmessage=x,z}}()?(m="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",y,!1):o.attachEvent("onmessage",y),function(z){o.postMessage(m+z,"*")}):o.MessageChannel?((v=new MessageChannel).port1.onmessage=function(z){d(z.data)},function(z){v.port2.postMessage(z)}):r&&"onreadystatechange"in r.createElement("script")?(g=r.documentElement,function(z){var x=r.createElement("script");x.onreadystatechange=function(){d(z),x.onreadystatechange=null,g.removeChild(x),x=null},g.appendChild(x)}):function(z){setTimeout(d,0,z)},l.setImmediate=function(z){typeof z!="function"&&(z=new Function(""+z));for(var x=new Array(arguments.length-1),D=0;D"u"?h===void 0?this:h:self)}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})}(St)),St.exports}var At=Ft();const Dt=Bt(At),Nt=Rt({__proto__:null,default:Dt},[At]);export{Nt as j}; diff --git a/custom-toc-highlight/assets/kmlUtils-C5oIEoOy-BsvzFJRs.js b/custom-toc-highlight/assets/kmlUtils-C5oIEoOy-CPvy9nME.js similarity index 93% rename from custom-toc-highlight/assets/kmlUtils-C5oIEoOy-BsvzFJRs.js rename to custom-toc-highlight/assets/kmlUtils-C5oIEoOy-CPvy9nME.js index 11d21f6c..3fa7010d 100644 --- a/custom-toc-highlight/assets/kmlUtils-C5oIEoOy-BsvzFJRs.js +++ b/custom-toc-highlight/assets/kmlUtils-C5oIEoOy-CPvy9nME.js @@ -1 +1 @@ -import{P as m,V as I,y as b,C as w,f as k,gU as G,gX as S,j9 as p,gY as d,ja as x,J as v,bL as E}from"./story-BfX8CRfG.js";import{t as O}from"./jsonUtils-C64Zfu7c-CitE8NjK.js";import{O as M}from"./FeatureSet-BkVNthuN-CwS44--W.js";const j={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function T(r){const s=r.folders||[],t=s.slice(),e=new Map,n=new Map,i=new Map,f=new Map,c=new Map,u={esriGeometryPoint:n,esriGeometryPolyline:i,esriGeometryPolygon:f};(r.featureCollection?.layers||[]).forEach(o=>{const y=m(o);y.featureSet.features=[];const a=o.featureSet.geometryType;e.set(a,y);const g=o.layerDefinition.objectIdField;a==="esriGeometryPoint"?h(n,g,o.featureSet.features):a==="esriGeometryPolyline"?h(i,g,o.featureSet.features):a==="esriGeometryPolygon"&&h(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=F(y,o.id,r.networkLinks);a&&t.push(a)})}),t.forEach(o=>{if(o.featureInfos){o.points=m(e.get("esriGeometryPoint")),o.polylines=m(e.get("esriGeometryPolyline")),o.polygons=m(e.get("esriGeometryPolygon")),o.mapImages=[];for(const y of o.featureInfos)switch(y.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const a=u[y.type].get(y.id);a&&o[j[y.type]]?.featureSet.features.push(a);break}case"GroundOverlay":{const a=c.get(y.id);a&&o.mapImages.push(a);break}}o.fullExtent=P([o])}});const l=P(t);return{folders:s,sublayers:t,extent:l}}function q(r,s,t,e){const n=I?.findCredential(r);r=b(r,{token:n?.token});const i=w.kmlServiceUrl;return k(i,{query:{url:r,model:"simple",folders:"",refresh:t!==0||void 0,outSR:JSON.stringify(s)},responseType:"json",signal:e})}function U(r,s,t=null,e=[]){const n=[],i={},f=s.sublayers,c=new Set(s.folders.map(u=>u.id));return f.forEach(u=>{const l=new r;if(t?l.read(u,t):l.read(u),e.length&&c.has(l.id)&&(l.visible=e.includes(l.id)),i[u.id]=l,u.parentFolderId!=null&&u.parentFolderId!==-1){const o=i[u.parentFolderId];o.sublayers||(o.sublayers=[]),o.sublayers?.unshift(l)}else n.unshift(l)}),n}function h(r,s,t){t.forEach(e=>{r.set(e.attributes[s],e)})}function C(r,s){let t;return s.some(e=>e.id===r&&(t=e,!0)),t}function F(r,s,t){const e=C(r,t);return e&&(e.parentFolderId=s,e.networkLink=e),e}async function z(r){const s=M.fromJSON(r.featureSet).features,t=r.layerDefinition,e=O(t.drawingInfo.renderer),n=E.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 P(r){const s=G(S),t=G(S);for(const e of r){if(e.polygons?.featureSet?.features)for(const n of e.polygons.featureSet.features)p(s,n.geometry),d(t,s);if(e.polylines?.featureSet?.features)for(const n of e.polylines.featureSet.features)p(s,n.geometry),d(t,s);if(e.points?.featureSet?.features)for(const n of e.points.featureSet.features)p(s,n.geometry),d(t,s);if(e.mapImages)for(const n of e.mapImages)p(s,n.extent),d(t,s)}return x(t,S)?void 0:{xmin:t[0],ymin:t[1],zmin:t[2],xmax:t[3],ymax:t[4],zmax:t[5],spatialReference:v.WGS84}}export{P as G,z as L,U as N,T,q as j}; +import{P as m,V as I,y as b,C as w,f as k,gU as G,gX as S,j9 as p,gY as d,ja as x,J as v,bL as E}from"./story-Doly9N9p.js";import{t as O}from"./jsonUtils-C64Zfu7c-BtrwAD3_.js";import{O as M}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";const j={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function T(r){const s=r.folders||[],t=s.slice(),e=new Map,n=new Map,i=new Map,f=new Map,c=new Map,u={esriGeometryPoint:n,esriGeometryPolyline:i,esriGeometryPolygon:f};(r.featureCollection?.layers||[]).forEach(o=>{const y=m(o);y.featureSet.features=[];const a=o.featureSet.geometryType;e.set(a,y);const g=o.layerDefinition.objectIdField;a==="esriGeometryPoint"?h(n,g,o.featureSet.features):a==="esriGeometryPolyline"?h(i,g,o.featureSet.features):a==="esriGeometryPolygon"&&h(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=F(y,o.id,r.networkLinks);a&&t.push(a)})}),t.forEach(o=>{if(o.featureInfos){o.points=m(e.get("esriGeometryPoint")),o.polylines=m(e.get("esriGeometryPolyline")),o.polygons=m(e.get("esriGeometryPolygon")),o.mapImages=[];for(const y of o.featureInfos)switch(y.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const a=u[y.type].get(y.id);a&&o[j[y.type]]?.featureSet.features.push(a);break}case"GroundOverlay":{const a=c.get(y.id);a&&o.mapImages.push(a);break}}o.fullExtent=P([o])}});const l=P(t);return{folders:s,sublayers:t,extent:l}}function q(r,s,t,e){const n=I?.findCredential(r);r=b(r,{token:n?.token});const i=w.kmlServiceUrl;return k(i,{query:{url:r,model:"simple",folders:"",refresh:t!==0||void 0,outSR:JSON.stringify(s)},responseType:"json",signal:e})}function U(r,s,t=null,e=[]){const n=[],i={},f=s.sublayers,c=new Set(s.folders.map(u=>u.id));return f.forEach(u=>{const l=new r;if(t?l.read(u,t):l.read(u),e.length&&c.has(l.id)&&(l.visible=e.includes(l.id)),i[u.id]=l,u.parentFolderId!=null&&u.parentFolderId!==-1){const o=i[u.parentFolderId];o.sublayers||(o.sublayers=[]),o.sublayers?.unshift(l)}else n.unshift(l)}),n}function h(r,s,t){t.forEach(e=>{r.set(e.attributes[s],e)})}function C(r,s){let t;return s.some(e=>e.id===r&&(t=e,!0)),t}function F(r,s,t){const e=C(r,t);return e&&(e.parentFolderId=s,e.networkLink=e),e}async function z(r){const s=M.fromJSON(r.featureSet).features,t=r.layerDefinition,e=O(t.drawingInfo.renderer),n=E.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 P(r){const s=G(S),t=G(S);for(const e of r){if(e.polygons?.featureSet?.features)for(const n of e.polygons.featureSet.features)p(s,n.geometry),d(t,s);if(e.polylines?.featureSet?.features)for(const n of e.polylines.featureSet.features)p(s,n.geometry),d(t,s);if(e.points?.featureSet?.features)for(const n of e.points.featureSet.features)p(s,n.geometry),d(t,s);if(e.mapImages)for(const n of e.mapImages)p(s,n.extent),d(t,s)}return x(t,S)?void 0:{xmin:t[0],ymin:t[1],zmin:t[2],xmax:t[3],ymax:t[4],zmax:t[5],spatialReference:v.WGS84}}export{P as G,z as L,U as N,T,q as j}; diff --git a/custom-toc-highlight/assets/knowledgeGraphService-DOJz0fzA-DDr_20o0.js b/custom-toc-highlight/assets/knowledgeGraphService-DOJz0fzA-BlihQLi8.js similarity index 99% rename from custom-toc-highlight/assets/knowledgeGraphService-DOJz0fzA-DDr_20o0.js rename to custom-toc-highlight/assets/knowledgeGraphService-DOJz0fzA-BlihQLi8.js index 37a48299..2b382e56 100644 --- a/custom-toc-highlight/assets/knowledgeGraphService-DOJz0fzA-DDr_20o0.js +++ b/custom-toc-highlight/assets/knowledgeGraphService-DOJz0fzA-BlihQLi8.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./arcgis-knowledge-client-core-simd-DZTbC5f4-C6CRtEVF.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./arcgis-knowledge-client-core-D-fKfQYy-DEjt1DBv.js"])))=>i.map(i=>d[i]); -import{_ as Ee}from"./main-ugzBrWNm.js";import{v as i,S as l,i as m,J as U,j as q,e as D,f as O,o as d,V as Ze,a1 as V,K as Je,bw as Ge,d as ye,G as Me,w as Ce,m as he,l as fe}from"./story-BfX8CRfG.js";import{w as Oe,b as je,x as Xe,k as et}from"./Relationship-Db9GUmYx-Cq6n6OX7.js";let x=class extends q{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1}};i([l()],x.prototype,"headerKeys",void 0),i([l()],x.prototype,"outSpatialReference",void 0),i([l()],x.prototype,"exceededTransferLimit",void 0),x=i([m("esri.rest.knowledgeGraph.GraphQueryResultHeader")],x);const X=x;let F=class extends q{constructor(e){super(e),this.resultRows=[],this.resultHeader=new X}};i([l()],F.prototype,"resultRows",void 0),i([l()],F.prototype,"resultHeader",void 0),F=i([m("esri.rest.knowledgeGraph.GraphQueryResult")],F);const Ie=F;let A=class extends q{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new X}};i([l()],A.prototype,"resultRowsStream",void 0),i([l()],A.prototype,"resultHeader",void 0),A=i([m("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],A);const Se=A;let R=class extends D{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};i([l({type:String,json:{write:!0}})],R.prototype,"name",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"unique",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"ascending",void 0),i([l({type:String,json:{write:!0}})],R.prototype,"description",void 0),i([l({type:[String],json:{write:!0}})],R.prototype,"fieldNames",void 0),R=i([m("esri.rest.knowledgeGraph.FieldIndex")],R);const Fe=R;let _=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};i([l({type:String,json:{write:!0}})],_.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"fieldType",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"geometryType",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasM",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasZ",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"required",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"defaultVisibility",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"systemMaintained",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"role",void 0),i([l({json:{write:!0}})],_.prototype,"defaultValue",void 0),_=i([m("esri.rest.knowledgeGraph.GraphProperty")],_);const Ae=_;let S=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null,this.type=null}};i([l({type:String,json:{write:!0}})],S.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"role",void 0),i([l({type:Boolean,json:{write:!0}})],S.prototype,"strict",void 0),i([l({type:[Ae],json:{write:!0}})],S.prototype,"properties",void 0),i([l({type:[Fe],json:{write:!0}})],S.prototype,"fieldIndexes",void 0),S=i([m("esri.rest.knowledgeGraph.GraphObjectType")],S);const Ne=S;let re=class extends Ne{constructor(e){super(e),this.type="entity"}};re=i([m("esri.rest.knowledgeGraph.EntityType")],re);const ne=re;let B=class extends Ne{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};i([l()],B.prototype,"endPoints",void 0),B=i([m("esri.rest.knowledgeGraph.RelationshipType")],B);const Le=B;let N=class extends D{constructor(e){super(e),this.value=null,this.behavior=null}};i([l({type:String,json:{write:!0}})],N.prototype,"value",void 0),i([l({type:String,json:{write:!0}})],N.prototype,"behavior",void 0),N=i([m("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],N);const ze=N;let w=class extends D{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null,this.metaEntityTypes=null,this.provenanceSourceTypeValues=null}};i([l({type:Date,json:{type:Number,write:{writer:(e,r)=>{r.timestamp=e?.getTime()}}}})],w.prototype,"timestamp",void 0),i([l({type:U,json:{write:!0}})],w.prototype,"spatialReference",void 0),i([l({type:Boolean,json:{write:!0}})],w.prototype,"strict",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"objectIdField",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"globalIdField",void 0),i([l()],w.prototype,"arcgisManaged",void 0),i([l()],w.prototype,"identifierInfo",void 0),i([l()],w.prototype,"searchIndexes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"entityTypes",void 0),i([l({type:[Le],json:{write:!0}})],w.prototype,"relationshipTypes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"metaEntityTypes",void 0),i([l({type:[ze],json:{write:!0}})],w.prototype,"provenanceSourceTypeValues",void 0),w=i([m("esri.rest.knowledgeGraph.DataModel")],w);const Ue=w;let f=class extends D{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1,this.supportsProvenance=!1}};i([l({type:[String],json:{write:!0}})],f.prototype,"capabilities",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsSearch",void 0),i([l({type:[String],json:{write:!0}})],f.prototype,"supportedQueryFormats",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"allowGeometryUpdates",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"searchMaxRecordCount",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"serviceCapabilities",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"maxRecordCount",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"description",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"copyrightText",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"units",void 0),i([l({type:U,json:{write:!0}})],f.prototype,"spatialReference",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"currentVersion",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"dateFieldsTimeReference",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"serviceItemId",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsDocuments",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"dataEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"schemaEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsProvenance",void 0),f=i([m("esri.rest.knowledgeGraph.ServiceDefinition")],f);const qe=f;let M=class extends D{constructor(e){super(e),this.dataModel=null,this.serviceDefinition=null}};i([l({type:String,json:{write:!0}})],M.prototype,"url",void 0),i([l({type:Ue,json:{write:!0}})],M.prototype,"dataModel",void 0),i([l({type:qe,json:{write:!0}})],M.prototype,"serviceDefinition",void 0),M=i([m("esri.rest.knowledgeGraph.KnowledgeGraph")],M);const tt=M;function b(e,r,t){if(e.error_code!==0)throw new d(r,t,{errorCode:e.error_code,errorMessage:e.error_message})}function rt(e,r,t,n=!1){const o=new t.ClientDataFetchRequestEncoder;o.deleteLater();for(const s of e){const p=nt(s,r,t,n);o.add_client_data_fetch_request_parameter(p)}o.encode();const a=o.get_encoding_result();return b(a.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(a.get_byte_buffer())}function nt(e,r,t,n){const o=new t.ClientDataKey;o.deleteLater(),o.key_string=e;const a=new t.ClientDataFetchRequestParameter;a.deleteLater(),a.set_key(o);const s=r.get(e);return s&&!n&&(a.v_tag={v_tag:s.version}),a}const Re="esri/rest/knowledgeGraph/wasmInterface/";let ee;async function I(){const e=ee;if(e)return e;const r=!!Je("wasm-simd");return ee=ot(r),ee}async function ot(e){if(e){const{default:t}=await Ee(()=>import("./arcgis-knowledge-client-core-simd-DZTbC5f4-C6CRtEVF.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.a);return t({locateFile:n=>Ge(Re+n)})}const{default:r}=await Ee(()=>import("./arcgis-knowledge-client-core-D-fKfQYy-DEjt1DBv.js"),__vite__mapDeps([2,1]),import.meta.url).then(t=>t.a);return r({locateFile:t=>Ge(Re+t)})}var k,be,oe;(function(e){e[e.OBJECT=0]="OBJECT",e[e.ENTITY=1]="ENTITY",e[e.RELATIONSHIP=2]="RELATIONSHIP",e[e.PATH=3]="PATH",e[e.ARRAY=4]="ARRAY"})(k||(k={})),function(e){e[e.view=0]="view",e[e.edit=1]="edit"}(be||(be={})),function(e){e[e.exclude=0]="exclude",e[e.include=1]="include"}(oe||(oe={}));function Ye(e,r){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}function He(e,r){const t=new r.ObjectValue;t.deleteLater();for(const[n,o]of Object.entries(e))t.set_key_value(n,_e(o,r));return t}function ge(e,r){if(e instanceof Me)return pt(e,r);if(e instanceof Ce)return dt(e,r);if(e instanceof he||e instanceof fe)return lt(e,r);throw new d("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function it(e,r){r.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function at(e,r,t){if(!e.extent)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);r.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:t.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}function st(e,r){r.provenance_behavior={value:oe[e]}}function _e(e,r){if(e==null)return"";if(typeof e!="object"||e instanceof Date)return e;if(e instanceof ye)return ge(e,r);if(Array.isArray(e)){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}return He(e,r)}function lt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];let a=[];e instanceof he?(t.geometry_type=r.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof fe&&(t.geometry_type=r.esriGeometryType.esriGeometryPolygon,a=e.rings);let s=0,p=0;return a.forEach(u=>{let c=0;u.forEach(y=>{c++,y.forEach(h=>{n[p]=h,p++})}),o[s]=c,s++}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function pt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=t.geometry_type=r.esriGeometryType.esriGeometryMultipoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let a=0;return e.points.forEach(s=>{s.forEach(p=>{n[a]=p,a++})}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function dt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=r.esriGeometryType.esriGeometryPoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let a=2;return e.hasZ&&(n[a]=e.z,a++),e.hasM&&(n[a]=e.m,a++),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function H(e,r){if(!e.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof Oe){const t=new r.EntityValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),t}if(e instanceof je){const t=new r.RelationshipValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),e.originId&&e.destinationId&&t.set_related_entity_ids(e.originId,e.destinationId),t}throw new d("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function ut(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function Pe(e,r){return e==null?null:typeof e!="object"||e instanceof Date?e:e instanceof ye?ge(e,r):null}var ie,ke,W,ae;(function(e){e[e.ClientDataKeyTypeUNSPECIFIED=0]="ClientDataKeyTypeUNSPECIFIED",e[e.ClientDataKeyTypeString=1]="ClientDataKeyTypeString"})(ie||(ie={})),function(e){e[e.ClientDataTypeUNSPECIFIED=0]="ClientDataTypeUNSPECIFIED",e[e.ClientDataTypeString=1]="ClientDataTypeString"}(ke||(ke={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.ClientData=1]="ClientData",e[e.NotModified=2]="NotModified"}(W||(W={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Error=1]="Error",e[e.ClientDataValue=2]="ClientDataValue"}(ae||(ae={}));function ct(e,r,t,n=!1){const o=new Map;for(let a=0;a{const c=[];for(let y=0;yV.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),xt={decodedWasmObjToQueryResponseObj:(e,r,t)=>{if(e==null)return null;if(typeof e!="object"||"getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case E.ESRI_GEOMETRY_POINT:return Pt(e,t);case E.ESRI_GEOMETRY_MULTIPOINT:return bt(e,t);case E.ESRI_GEOMETRY_POLYLINE:return kt(e,t);case E.ESRI_GEOMETRY_POLYGON:return Dt(e,t);case E.ESRI_GEOMETRY_ENVELOPE:case E.ESRI_GEOMETRY_MULTI_PATCH:return K().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case E.ESRI_GEOMETRY_NULL:case E.ESRI_GEOMETRY_ANY:default:return K().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return K().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case k.OBJECT:return Ct(e,r,t);case k.ENTITY:return Be(e,r,t);case k.RELATIONSHIP:return Ve(e,r,t);case k.PATH:return Ot(e,r,t);case k.ARRAY:return Mt(e,r,t);default:return K().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function Mt(e,r,t){const n=[],o=e.count();for(let a=0;anew Map(z.entries()),T={fetchKnowledgeGraph:async e=>{const r=new tt({url:e}),t=[];return t.push(Y(r)),t.push(We(r)),await Promise.all(t),r},refreshDataModel:async e=>{e.dataModel=await $e(e)},refreshServiceDefinition:async e=>{const r=(await O(e.url,{query:{f:"json"}})).data;return r.capabilities=r?.capabilities?.split(","),r.supportedQueryFormats=r?.supportedQueryFormats?.split(","),e.serviceDefinition=new qe(r),e.serviceDefinition},executeQueryStreaming:async(e,r,t)=>{const n="include",o=`${e.url}/graph/query`;await te(e);const a=await Q(o,t);if(!e.serviceDefinition?.supportsProvenance&&r.provenanceBehavior===n)throw new d("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");a.data.body=await $t(r,e);const s=await L(a.data.url,a.data);if(e.dataModel){const p=await xe(s,e.dataModel);return new Se({resultRowsStream:p.readableStream,resultHeader:p.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,r,t)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new d("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await te(e);const o=await Q(n,t);return o.data.body=await Wt(r,e),Jt(await L(o.data.url,o.data))},executeQuery:async(e,r,t)=>{const n=`${e.url}/graph/query`,o=await O(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:r.openCypherQuery,...t?.query},signal:t?.signal,timeout:t?.timeout}),a=o.getHeader?.("content-type"),s=o.data;if(a?.includes("application/x-protobuf")){const p=new(await I()).GraphQueryDecoder;if(p.deleteLater(),e.dataModel){const u=ce(p,s,e.dataModel);return new Ie({resultRows:u.resultRows,resultHeader:u.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:a,data:o.data})},executeSearch:async(e,r,t)=>{const n=r.typeCategoryFilter,o=`${e.url}/graph/search`,a=await O(o,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${r.searchQuery}"`,typeCategoryFilter:n,...t?.query},signal:t?.signal,timeout:t?.timeout}),s=a.getHeader?.("content-type"),p=a.data;if(s?.includes("application/x-protobuf")){const u=new(await I()).GraphQueryDecoder;if(u.deleteLater(),e.dataModel){const c=ce(u,p,e.dataModel);return new Ie({resultRows:c.resultRows,resultHeader:c.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:a.data})},executeSearchStreaming:async(e,r,t)=>{const n=`${e.url}/graph/search`;await te(e);const o=await Q(n,t);o.data.body=await Zt(r);const a=await L(o.data.url,o.data);if(e.dataModel){const s=await xe(a,e.dataModel);return new Se({resultRowsStream:s.readableStream,resultHeader:s.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,r,t={ignoreCache:!1})=>{if(!r.length)return new Map;let n=z.get(e.url||"");n||(n=new Map,z.set(e.url||"",n));const o=new Map(n.entries()),a=`${e.url}/clientData/fetch`;r=Array.from(new Set(r));const s=await I(),p=rt(r,n,s,t.ignoreCache),u=await Q(a,t.requestOptions);u.data.body=p;const c=await L(u.data.url,u.data),y=c.headers.get("content-type");if(y?.includes("application/x-protobuf")){const h=new s.ClientDataFetchResponseDecoder;h.deleteLater();const G=await c.arrayBuffer();return h.decode(new Uint8Array(G)),h.has_error()&&b(h.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),ct(h,n,o,t.ignoreCache)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:y,data:c})},fetchAllClientDataKeys:async(e,r)=>{const t=`${e.url}/clientData`,n=await O(t,{responseType:"array-buffer",query:{f:"pbf"},signal:r?.signal,timeout:r?.timeout}),o=n.getHeader?.("content-type"),a=n.data;if(o?.includes("application/x-protobuf")){const s=new(await I()).ClientDataKeysResponseDecoder;return s.deleteLater(),s.decode(new Uint8Array(a)),s.has_error()&&b(s.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),yt(s)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})},clearClientDataCache:()=>z.clear(),_fetchWrapper:async(e,r)=>fetch(e,r)};async function Lt(e,r,t){return T.executeApplyEdits(e,r,t)}async function zt(e,r,t){return T.executeQuery(e,r,t)}async function Ut(e,r,t){return T.executeQueryStreaming(e,r,t)}async function qt(e,r,t){return T.executeSearch(e,r,t)}async function Yt(e,r,t){return T.executeSearchStreaming(e,r,t)}function Ht(e,r){return T.fetchAllClientDataKeys(e,r)}function Kt(e,r,t){return T.fetchClientDataAtKeys(e,r,t)}async function Qt(e){return T.fetchKnowledgeGraph(e)}async function Y(e){return T.refreshDataModel(e)}async function We(e){return T.refreshServiceDefinition(e)}function Bt(){return T.clearClientDataCache()}async function L(e,r){return T._fetchWrapper(e,r)}async function te(e){Ze?.findCredential(e.url)||(e.dataModel?await $e(e):await Y(e))}function Vt(e,r,t,n){r==null?t.set_param_key_value(e,""):typeof r!="object"||r instanceof Date?t.set_param_key_value(e,r):r instanceof ye?t.set_param_key_value(e,ge(r,n)):Array.isArray(r)?t.set_param_key_value(e,Ye(r,n)):t.set_param_key_value(e,He(r,n))}async function Wt(e,r){if(r.dataModel||await Y(r),!r.dataModel)throw new d("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const t=await I(),n=!!e.options?.cascadeDelete,o=new t.GraphApplyEditsEncoder(t.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?ut(e.options?.inputQuantizationParameters):t.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n;try{let s;e.entityAdds?.forEach(p=>{s=o.add_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(p=>{if(!p.originId||!p.destinationId)throw new d("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");s=o.add_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!0);u.deleteLater(),p.ids?.forEach(c=>{u.delete_by_id(c)})}),e.relationshipDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!1);p.ids?.forEach(c=>{u.delete_by_id(c)})}),o.encode()}catch(s){throw new d("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:s})}const a=o.get_encoding_result();return b(a.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(a.get_byte_buffer())}async function $t(e,r){const t=await I(),n=new t.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=t.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[a,s]of Object.entries(e.bindParameters))Vt(a,s,n,t);if(e.bindGeometryQuantizationParameters)it(e.bindGeometryQuantizationParameters,n);else{if(r.dataModel||await Y(r),r.dataModel?.spatialReference?.wkid!==4326)throw new d("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=t.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&at(e.outputQuantizationParameters,n,t),e.provenanceBehavior&&st(e.provenanceBehavior,n);try{n.encode()}catch(a){throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:a})}const o=n.get_encoding_result();if(o.error.error_code!==0)throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function Zt(e){const r=await I(),t=new r.GraphSearchRequestEncoder;if(t.deleteLater(),t.search_query=e.searchQuery,t.type_category_filter=r.esriNamedTypeCategory[e.typeCategoryFilter],e.returnSearchContext===!0&&(t.return_search_context=e.returnSearchContext),e.start!=null&&e.start>0&&(t.start_index=e.start),e.num!=null&&(t.max_num_results=e.num),e.idsFilter!=null&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{t.set_ids_filter(Ye(e.idsFilter,r))}catch(o){throw new d("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:o})}e.namedTypesFilter?.forEach(o=>{t.add_named_type_filter(o)});try{t.encode()}catch(o){throw new d("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:o})}const n=t.get_encoding_result();if(n.error.error_code!==0)throw new d("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return structuredClone(n.get_byte_buffer())}async function Q(e,r){return O(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r?.signal,timeout:r?.timeout})}async function Jt(e){const r=e.headers.get("content-type");if(r?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),n=new(await I()).GraphApplyEditsDecoder;return n.deleteLater(),n.decode(new Uint8Array(t)),At(n)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}function ce(e,r,t,n){e.push_buffer(new Uint8Array(r));const o=[];let a,s,p=0;for(;e.next_row();){a&&s||(a=n??jt(e),s=a.outSpatialReference??new U({wkid:4326})),p||(p=e.get_header_keys().size());const u=new Array(p);for(let c=0;c{s=y,p=h});let c=!1;return{readableStream:new ReadableStream({async start(y){try{return h()}catch(G){n?.releaseLock(),y.error(new d("knowledge-graph:stream-decoding-error","The server returned a valid response, but there was an error decoding the response stream",{error:G})),y.close()}function h(){return n?.read().then(({done:G,value:v})=>{try{if(G){let j;if(o.has_error()?j=new d("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:o.error.error_code,errorMessage:o.error.error_message}):c||s(new X),n.releaseLock(),j)throw y.error(j),p(j),j;return void y.close()}const g=ce(o,v,r,a),Te=g.resultRows;return Te.length>0&&y.enqueue(Te),!a&&g.resultHeader&&(a=g.resultHeader,s(g.resultHeader),c=!0),h()}catch(g){throw V.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(g),p(g),new d("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:g})}})}}}),resultHeader:await u}}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:t,data:e.text()})}async function $e(e){const r=`${e.url}/dataModel/queryDataModel`,t=await O(r,{responseType:"array-buffer",query:{f:"pbf"}}),n=t.getHeader?.("content-type"),o=t.data;if(n?.includes("application/x-protobuf")){const a=(await I()).decode_data_model_from_protocol_buffer(new Uint8Array(o));if(!a)throw new d("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return ft(a)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:t.data})}const rr=Object.freeze(Object.defineProperty({__proto__:null,_fetchWrapper:L,_getClientDataCacheCopy:Nt,clearClientDataCache:Bt,clientDataCache:z,executeApplyEdits:Lt,executeQuery:zt,executeQueryStreaming:Ut,executeSearch:qt,executeSearchStreaming:Yt,fetchAllClientDataKeys:Ht,fetchClientDataAtKeys:Kt,fetchKnowledgeGraph:Qt,kgRestServices:T,refreshDataModel:Y,refreshServiceDefinition:We},Symbol.toStringTag,{value:"Module"}));export{Qt as F,Ut as M,Kt as W,rr as k,I as r}; +import{_ as Ee}from"./main-QGPoLsvl.js";import{v as i,S as l,i as m,J as U,j as q,e as D,f as O,o as d,V as Ze,a1 as V,K as Je,bw as Ge,d as ye,G as Me,w as Ce,m as he,l as fe}from"./story-Doly9N9p.js";import{w as Oe,b as je,x as Xe,k as et}from"./Relationship-Db9GUmYx-B84JspfN.js";let x=class extends q{constructor(e){super(e),this.headerKeys=[],this.outSpatialReference=null,this.exceededTransferLimit=!1}};i([l()],x.prototype,"headerKeys",void 0),i([l()],x.prototype,"outSpatialReference",void 0),i([l()],x.prototype,"exceededTransferLimit",void 0),x=i([m("esri.rest.knowledgeGraph.GraphQueryResultHeader")],x);const X=x;let F=class extends q{constructor(e){super(e),this.resultRows=[],this.resultHeader=new X}};i([l()],F.prototype,"resultRows",void 0),i([l()],F.prototype,"resultHeader",void 0),F=i([m("esri.rest.knowledgeGraph.GraphQueryResult")],F);const Ie=F;let A=class extends q{constructor(e){super(e),this.resultRowsStream=new ReadableStream,this.resultHeader=new X}};i([l()],A.prototype,"resultRowsStream",void 0),i([l()],A.prototype,"resultHeader",void 0),A=i([m("esri.rest.knowledgeGraph.GraphQueryStreamingResult")],A);const Se=A;let R=class extends D{constructor(e){super(e),this.name=null,this.unique=null,this.ascending=null,this.description=null,this.fieldNames=null}};i([l({type:String,json:{write:!0}})],R.prototype,"name",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"unique",void 0),i([l({type:Boolean,json:{write:!0}})],R.prototype,"ascending",void 0),i([l({type:String,json:{write:!0}})],R.prototype,"description",void 0),i([l({type:[String],json:{write:!0}})],R.prototype,"fieldNames",void 0),R=i([m("esri.rest.knowledgeGraph.FieldIndex")],R);const Fe=R;let _=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.fieldType=null,this.geometryType=null,this.hasM=null,this.hasZ=null,this.nullable=null,this.editable=null,this.required=null,this.defaultVisibility=null,this.systemMaintained=null,this.role=null,this.defaultValue=null}};i([l({type:String,json:{write:!0}})],_.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"fieldType",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"geometryType",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasM",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"hasZ",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"nullable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"editable",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"required",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"defaultVisibility",void 0),i([l({type:Boolean,json:{write:!0}})],_.prototype,"systemMaintained",void 0),i([l({type:String,json:{write:!0}})],_.prototype,"role",void 0),i([l({json:{write:!0}})],_.prototype,"defaultValue",void 0),_=i([m("esri.rest.knowledgeGraph.GraphProperty")],_);const Ae=_;let S=class extends D{constructor(e){super(e),this.name=null,this.alias=null,this.role=null,this.strict=null,this.properties=null,this.fieldIndexes=null,this.type=null}};i([l({type:String,json:{write:!0}})],S.prototype,"name",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"alias",void 0),i([l({type:String,json:{write:!0}})],S.prototype,"role",void 0),i([l({type:Boolean,json:{write:!0}})],S.prototype,"strict",void 0),i([l({type:[Ae],json:{write:!0}})],S.prototype,"properties",void 0),i([l({type:[Fe],json:{write:!0}})],S.prototype,"fieldIndexes",void 0),S=i([m("esri.rest.knowledgeGraph.GraphObjectType")],S);const Ne=S;let re=class extends Ne{constructor(e){super(e),this.type="entity"}};re=i([m("esri.rest.knowledgeGraph.EntityType")],re);const ne=re;let B=class extends Ne{constructor(e){super(e),this.endPoints=[],this.type="relationship"}};i([l()],B.prototype,"endPoints",void 0),B=i([m("esri.rest.knowledgeGraph.RelationshipType")],B);const Le=B;let N=class extends D{constructor(e){super(e),this.value=null,this.behavior=null}};i([l({type:String,json:{write:!0}})],N.prototype,"value",void 0),i([l({type:String,json:{write:!0}})],N.prototype,"behavior",void 0),N=i([m("esri.rest.knowledgeGraph.SourceTypeValueBehavior")],N);const ze=N;let w=class extends D{constructor(e){super(e),this.timestamp=null,this.spatialReference=null,this.strict=null,this.objectIdField=null,this.globalIdField=null,this.arcgisManaged=null,this.identifierInfo=null,this.searchIndexes=null,this.entityTypes=null,this.relationshipTypes=null,this.metaEntityTypes=null,this.provenanceSourceTypeValues=null}};i([l({type:Date,json:{type:Number,write:{writer:(e,r)=>{r.timestamp=e?.getTime()}}}})],w.prototype,"timestamp",void 0),i([l({type:U,json:{write:!0}})],w.prototype,"spatialReference",void 0),i([l({type:Boolean,json:{write:!0}})],w.prototype,"strict",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"objectIdField",void 0),i([l({type:String,json:{write:!0}})],w.prototype,"globalIdField",void 0),i([l()],w.prototype,"arcgisManaged",void 0),i([l()],w.prototype,"identifierInfo",void 0),i([l()],w.prototype,"searchIndexes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"entityTypes",void 0),i([l({type:[Le],json:{write:!0}})],w.prototype,"relationshipTypes",void 0),i([l({type:[ne],json:{write:!0}})],w.prototype,"metaEntityTypes",void 0),i([l({type:[ze],json:{write:!0}})],w.prototype,"provenanceSourceTypeValues",void 0),w=i([m("esri.rest.knowledgeGraph.DataModel")],w);const Ue=w;let f=class extends D{constructor(e){super(e),this.capabilities=[],this.supportsSearch=!1,this.supportedQueryFormats=[],this.allowGeometryUpdates=!1,this.searchMaxRecordCount=null,this.serviceCapabilities=null,this.maxRecordCount=null,this.description="",this.copyrightText="",this.units="",this.spatialReference=null,this.currentVersion=null,this.dateFieldsTimeReference=null,this.serviceItemId="",this.supportsDocuments=!1,this.dataEditingNotSupported=!1,this.schemaEditingNotSupported=!1,this.supportsProvenance=!1}};i([l({type:[String],json:{write:!0}})],f.prototype,"capabilities",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsSearch",void 0),i([l({type:[String],json:{write:!0}})],f.prototype,"supportedQueryFormats",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"allowGeometryUpdates",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"searchMaxRecordCount",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"serviceCapabilities",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"maxRecordCount",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"description",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"copyrightText",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"units",void 0),i([l({type:U,json:{write:!0}})],f.prototype,"spatialReference",void 0),i([l({type:Number,json:{write:!0}})],f.prototype,"currentVersion",void 0),i([l({type:Object,json:{write:!0}})],f.prototype,"dateFieldsTimeReference",void 0),i([l({type:String,json:{write:!0}})],f.prototype,"serviceItemId",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsDocuments",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"dataEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"schemaEditingNotSupported",void 0),i([l({type:Boolean,json:{write:!0}})],f.prototype,"supportsProvenance",void 0),f=i([m("esri.rest.knowledgeGraph.ServiceDefinition")],f);const qe=f;let M=class extends D{constructor(e){super(e),this.dataModel=null,this.serviceDefinition=null}};i([l({type:String,json:{write:!0}})],M.prototype,"url",void 0),i([l({type:Ue,json:{write:!0}})],M.prototype,"dataModel",void 0),i([l({type:qe,json:{write:!0}})],M.prototype,"serviceDefinition",void 0),M=i([m("esri.rest.knowledgeGraph.KnowledgeGraph")],M);const tt=M;function b(e,r,t){if(e.error_code!==0)throw new d(r,t,{errorCode:e.error_code,errorMessage:e.error_message})}function rt(e,r,t,n=!1){const o=new t.ClientDataFetchRequestEncoder;o.deleteLater();for(const s of e){const p=nt(s,r,t,n);o.add_client_data_fetch_request_parameter(p)}o.encode();const a=o.get_encoding_result();return b(a.error,"knowledge-graph:fetchClientDataAtKeys-encoding-failed","Attempting to encode the fetchClientDataAtKeys failed"),structuredClone(a.get_byte_buffer())}function nt(e,r,t,n){const o=new t.ClientDataKey;o.deleteLater(),o.key_string=e;const a=new t.ClientDataFetchRequestParameter;a.deleteLater(),a.set_key(o);const s=r.get(e);return s&&!n&&(a.v_tag={v_tag:s.version}),a}const Re="esri/rest/knowledgeGraph/wasmInterface/";let ee;async function I(){const e=ee;if(e)return e;const r=!!Je("wasm-simd");return ee=ot(r),ee}async function ot(e){if(e){const{default:t}=await Ee(()=>import("./arcgis-knowledge-client-core-simd-DZTbC5f4-C6CRtEVF.js"),__vite__mapDeps([0,1]),import.meta.url).then(n=>n.a);return t({locateFile:n=>Ge(Re+n)})}const{default:r}=await Ee(()=>import("./arcgis-knowledge-client-core-D-fKfQYy-DEjt1DBv.js"),__vite__mapDeps([2,1]),import.meta.url).then(t=>t.a);return r({locateFile:t=>Ge(Re+t)})}var k,be,oe;(function(e){e[e.OBJECT=0]="OBJECT",e[e.ENTITY=1]="ENTITY",e[e.RELATIONSHIP=2]="RELATIONSHIP",e[e.PATH=3]="PATH",e[e.ARRAY=4]="ARRAY"})(k||(k={})),function(e){e[e.view=0]="view",e[e.edit=1]="edit"}(be||(be={})),function(e){e[e.exclude=0]="exclude",e[e.include=1]="include"}(oe||(oe={}));function Ye(e,r){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}function He(e,r){const t=new r.ObjectValue;t.deleteLater();for(const[n,o]of Object.entries(e))t.set_key_value(n,_e(o,r));return t}function ge(e,r){if(e instanceof Me)return pt(e,r);if(e instanceof Ce)return dt(e,r);if(e instanceof he||e instanceof fe)return lt(e,r);throw new d("knowledge-graph:unsupported-geometry","Only Point, Multipoint, Polyline, and Polygon geometry are supported by ArcGIS Knowledge",{geometry:e})}function it(e,r){r.input_quantization_parameters={xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function at(e,r,t){if(!e.extent)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization provided to the encoder had an illegal value as part of its extent",e.extent);if(!e.quantizeMode)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal mode setting",e.quantizeMode);if(!e.tolerance)throw new d("knowledge-graph:illegal-output-quantization","The Output quantization contained an illegal tolerance setting",e.quantizeMode);r.output_quantization_parameters={extent:{xmax:e.extent.xmax,ymax:e.extent.ymax,xmin:e.extent.xmin,ymin:e.extent.ymin},quantize_mode:t.esriQuantizeMode[e.quantizeMode],tolerance:e.tolerance}}function st(e,r){r.provenance_behavior={value:oe[e]}}function _e(e,r){if(e==null)return"";if(typeof e!="object"||e instanceof Date)return e;if(e instanceof ye)return ge(e,r);if(Array.isArray(e)){const t=new r.ArrayValue;return t.deleteLater(),e.forEach(n=>{t.add_value(_e(n,r))}),t}return He(e,r)}function lt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];let a=[];e instanceof he?(t.geometry_type=r.esriGeometryType.esriGeometryPolyline,a=e.paths):e instanceof fe&&(t.geometry_type=r.esriGeometryType.esriGeometryPolygon,a=e.rings);let s=0,p=0;return a.forEach(u=>{let c=0;u.forEach(y=>{c++,y.forEach(h=>{n[p]=h,p++})}),o[s]=c,s++}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function pt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=t.geometry_type=r.esriGeometryType.esriGeometryMultipoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=e.points.length;let a=0;return e.points.forEach(s=>{s.forEach(p=>{n[a]=p,a++})}),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function dt(e,r){const t=new r.GeometryValue;t.deleteLater(),t.geometry_type=r.esriGeometryType.esriGeometryPoint,t.has_z=e.hasZ,t.has_m=e.hasM;const n=[],o=[];o[0]=1,n[0]=e.x,n[1]=e.y;let a=2;return e.hasZ&&(n[a]=e.z,a++),e.hasM&&(n[a]=e.m,a++),t.coords=new Float64Array(n),t.lengths=new Uint32Array(o),t}function H(e,r){if(!e.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits");if(e instanceof Oe){const t=new r.EntityValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),t}if(e instanceof je){const t=new r.RelationshipValue;t.deleteLater(),t.type_name=e.typeName;for(const[n,o]of Object.entries(e.properties))t.set_key_value(n,Pe(o,r));return e.id&&t.set_id(e.id),e.originId&&e.destinationId&&t.set_related_entity_ids(e.originId,e.destinationId),t}throw new d("knowledge-graph:applyEdits-encoding-failure","Could not determine the type of a named graph object passed to the encoder")}function ut(e){return{xy_resolution:e.xyResolution,x_false_origin:e.xFalseOrigin,y_false_origin:e.yFalseOrigin,z_resolution:e.zResolution,z_false_origin:e.zFalseOrigin,m_resolution:e.mResolution,m_false_origin:e.mFalseOrigin}}function Pe(e,r){return e==null?null:typeof e!="object"||e instanceof Date?e:e instanceof ye?ge(e,r):null}var ie,ke,W,ae;(function(e){e[e.ClientDataKeyTypeUNSPECIFIED=0]="ClientDataKeyTypeUNSPECIFIED",e[e.ClientDataKeyTypeString=1]="ClientDataKeyTypeString"})(ie||(ie={})),function(e){e[e.ClientDataTypeUNSPECIFIED=0]="ClientDataTypeUNSPECIFIED",e[e.ClientDataTypeString=1]="ClientDataTypeString"}(ke||(ke={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.ClientData=1]="ClientData",e[e.NotModified=2]="NotModified"}(W||(W={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Error=1]="Error",e[e.ClientDataValue=2]="ClientDataValue"}(ae||(ae={}));function ct(e,r,t,n=!1){const o=new Map;for(let a=0;a{const c=[];for(let y=0;yV.getLogger("esri.rest.knowledgeGraph.WasmToQueryResponseObjConstructors"),xt={decodedWasmObjToQueryResponseObj:(e,r,t)=>{if(e==null)return null;if(typeof e!="object"||"getDate"in e)return e;if("geometry_type"in e)switch(e.geometry_type.value){case null:return null;case E.ESRI_GEOMETRY_POINT:return Pt(e,t);case E.ESRI_GEOMETRY_MULTIPOINT:return bt(e,t);case E.ESRI_GEOMETRY_POLYLINE:return kt(e,t);case E.ESRI_GEOMETRY_POLYGON:return Dt(e,t);case E.ESRI_GEOMETRY_ENVELOPE:case E.ESRI_GEOMETRY_MULTI_PATCH:return K().warnOnce("Envelope and Multipatch are not supported on knowledge entities, but one of those geometry types was detected. Result interpreted as null"),null;case E.ESRI_GEOMETRY_NULL:case E.ESRI_GEOMETRY_ANY:default:return K().warnOnce("Unknown or blank geometry type returned - Result interpreted as null"),null}else{if(!("object_value_type"in e))return K().warnOnce("A decoded value came back of a type that is not supported. Result interpreted as null"),null;switch(e.object_value_type.value){case k.OBJECT:return Ct(e,r,t);case k.ENTITY:return Be(e,r,t);case k.RELATIONSHIP:return Ve(e,r,t);case k.PATH:return Ot(e,r,t);case k.ARRAY:return Mt(e,r,t);default:return K().warnOnce("Unknown graph object type detected! Result interpreted as null"),null}}}};function Mt(e,r,t){const n=[],o=e.count();for(let a=0;anew Map(z.entries()),T={fetchKnowledgeGraph:async e=>{const r=new tt({url:e}),t=[];return t.push(Y(r)),t.push(We(r)),await Promise.all(t),r},refreshDataModel:async e=>{e.dataModel=await $e(e)},refreshServiceDefinition:async e=>{const r=(await O(e.url,{query:{f:"json"}})).data;return r.capabilities=r?.capabilities?.split(","),r.supportedQueryFormats=r?.supportedQueryFormats?.split(","),e.serviceDefinition=new qe(r),e.serviceDefinition},executeQueryStreaming:async(e,r,t)=>{const n="include",o=`${e.url}/graph/query`;await te(e);const a=await Q(o,t);if(!e.serviceDefinition?.supportsProvenance&&r.provenanceBehavior===n)throw new d("knowledge-graph:provenance-not-supported","The Knowledge Graph Service definition indicated that provenance is not supported");a.data.body=await $t(r,e);const s=await L(a.data.url,a.data);if(e.dataModel){const p=await xe(s,e.dataModel);return new Se({resultRowsStream:p.readableStream,resultHeader:p.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},executeApplyEdits:async(e,r,t)=>{if(e.serviceDefinition?.dataEditingNotSupported)throw new d("knowledge-graph:data-editing-not-supported","The Knowledge Graph Service definition indicated that data editing is not supported");const n=`${e.url}/graph/applyEdits`;await te(e);const o=await Q(n,t);return o.data.body=await Wt(r,e),Jt(await L(o.data.url,o.data))},executeQuery:async(e,r,t)=>{const n=`${e.url}/graph/query`,o=await O(n,{responseType:"array-buffer",query:{f:"pbf",openCypherQuery:r.openCypherQuery,...t?.query},signal:t?.signal,timeout:t?.timeout}),a=o.getHeader?.("content-type"),s=o.data;if(a?.includes("application/x-protobuf")){const p=new(await I()).GraphQueryDecoder;if(p.deleteLater(),e.dataModel){const u=ce(p,s,e.dataModel);return new Ie({resultRows:u.resultRows,resultHeader:u.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:a,data:o.data})},executeSearch:async(e,r,t)=>{const n=r.typeCategoryFilter,o=`${e.url}/graph/search`,a=await O(o,{responseType:"array-buffer",query:{f:"pbf",searchQuery:`"${r.searchQuery}"`,typeCategoryFilter:n,...t?.query},signal:t?.signal,timeout:t?.timeout}),s=a.getHeader?.("content-type"),p=a.data;if(s?.includes("application/x-protobuf")){const u=new(await I()).GraphQueryDecoder;if(u.deleteLater(),e.dataModel){const c=ce(u,p,e.dataModel);return new Ie({resultRows:c.resultRows,resultHeader:c.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:s,data:a.data})},executeSearchStreaming:async(e,r,t)=>{const n=`${e.url}/graph/search`;await te(e);const o=await Q(n,t);o.data.body=await Zt(r);const a=await L(o.data.url,o.data);if(e.dataModel){const s=await xe(a,e.dataModel);return new Se({resultRowsStream:s.readableStream,resultHeader:s.resultHeader})}throw new d("knowledge-graph:undefined-data-model","The KnowledgeGraph supplied did not have a data model")},fetchClientDataAtKeys:async(e,r,t={ignoreCache:!1})=>{if(!r.length)return new Map;let n=z.get(e.url||"");n||(n=new Map,z.set(e.url||"",n));const o=new Map(n.entries()),a=`${e.url}/clientData/fetch`;r=Array.from(new Set(r));const s=await I(),p=rt(r,n,s,t.ignoreCache),u=await Q(a,t.requestOptions);u.data.body=p;const c=await L(u.data.url,u.data),y=c.headers.get("content-type");if(y?.includes("application/x-protobuf")){const h=new s.ClientDataFetchResponseDecoder;h.deleteLater();const G=await c.arrayBuffer();return h.decode(new Uint8Array(G)),h.has_error()&&b(h.error,"knowledge-graph:fetchClientDataAtKeys-decoding-error","An error occurred while decoding the client data keys response"),ct(h,n,o,t.ignoreCache)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response when fetching client data",{responseType:y,data:c})},fetchAllClientDataKeys:async(e,r)=>{const t=`${e.url}/clientData`,n=await O(t,{responseType:"array-buffer",query:{f:"pbf"},signal:r?.signal,timeout:r?.timeout}),o=n.getHeader?.("content-type"),a=n.data;if(o?.includes("application/x-protobuf")){const s=new(await I()).ClientDataKeysResponseDecoder;return s.deleteLater(),s.decode(new Uint8Array(a)),s.has_error()&&b(s.error,"knowledge-graph:fetchAllClientDataKeys-decoding-error","An error occurred while decoding the client data keys response"),yt(s)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:o,data:n.data})},clearClientDataCache:()=>z.clear(),_fetchWrapper:async(e,r)=>fetch(e,r)};async function Lt(e,r,t){return T.executeApplyEdits(e,r,t)}async function zt(e,r,t){return T.executeQuery(e,r,t)}async function Ut(e,r,t){return T.executeQueryStreaming(e,r,t)}async function qt(e,r,t){return T.executeSearch(e,r,t)}async function Yt(e,r,t){return T.executeSearchStreaming(e,r,t)}function Ht(e,r){return T.fetchAllClientDataKeys(e,r)}function Kt(e,r,t){return T.fetchClientDataAtKeys(e,r,t)}async function Qt(e){return T.fetchKnowledgeGraph(e)}async function Y(e){return T.refreshDataModel(e)}async function We(e){return T.refreshServiceDefinition(e)}function Bt(){return T.clearClientDataCache()}async function L(e,r){return T._fetchWrapper(e,r)}async function te(e){Ze?.findCredential(e.url)||(e.dataModel?await $e(e):await Y(e))}function Vt(e,r,t,n){r==null?t.set_param_key_value(e,""):typeof r!="object"||r instanceof Date?t.set_param_key_value(e,r):r instanceof ye?t.set_param_key_value(e,ge(r,n)):Array.isArray(r)?t.set_param_key_value(e,Ye(r,n)):t.set_param_key_value(e,He(r,n))}async function Wt(e,r){if(r.dataModel||await Y(r),!r.dataModel)throw new d("knowledge-graph:data-model-undefined","Encoding could not proceed because a data model was not provided and it could not be determined from the service");const t=await I(),n=!!e.options?.cascadeDelete,o=new t.GraphApplyEditsEncoder(t.SpatialReferenceUtil.WGS84(),e.options?.inputQuantizationParameters?ut(e.options?.inputQuantizationParameters):t.InputQuantizationUtil.WGS84_lossless());o.deleteLater(),o.cascade_delete=n;try{let s;e.entityAdds?.forEach(p=>{s=o.add_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipAdds?.forEach(p=>{if(!p.originId||!p.destinationId)throw new d("knowledge-graph:relationship-origin-destination-missing","When adding a new relationship, you must provide both an origin and destination id on the appropriate class property");s=o.add_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:entity-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_entity(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - an entity failed to be added to the encoder")}),e.relationshipUpdates?.forEach(p=>{if(!p.id)throw new d("knowledge-graph:relationship-id-missing","When updating an entity or relationship, you must specify the id on the class level property");s=o.update_relationship(H(p,t)),b(s,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits - a relationship failed to be added to the encoder")}),e.entityDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!0);u.deleteLater(),p.ids?.forEach(c=>{u.delete_by_id(c)})}),e.relationshipDeletes?.forEach(p=>{if(!p.typeName)throw new d("knowledge-graph:no-type-name","You must indicate the entity/relationship named object type to apply edits - delete");const u=o.make_delete_helper(p.typeName,!1);p.ids?.forEach(c=>{u.delete_by_id(c)})}),o.encode()}catch(s){throw new d("knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed",{error:s})}const a=o.get_encoding_result();return b(a.error,"knowledge-graph:applyEdits-encoding-failed","Attempting to encode the applyEdits failed"),structuredClone(a.get_byte_buffer())}async function $t(e,r){const t=await I(),n=new t.GraphQueryRequestEncoder;if(n.deleteLater(),e.outputSpatialReference?n.output_spatial_reference={wkid:e.outputSpatialReference.wkid,latestWkid:e.outputSpatialReference.latestWkid,vcsWkid:e.outputSpatialReference.vcsWkid,latestVcsWkid:e.outputSpatialReference.latestVcsWkid,wkt:e.outputSpatialReference.wkt??""}:n.output_spatial_reference=t.SpatialReferenceUtil.WGS84(),n.open_cypher_query=e.openCypherQuery,e.bindParameters)for(const[a,s]of Object.entries(e.bindParameters))Vt(a,s,n,t);if(e.bindGeometryQuantizationParameters)it(e.bindGeometryQuantizationParameters,n);else{if(r.dataModel||await Y(r),r.dataModel?.spatialReference?.wkid!==4326)throw new d("knowledge-graph:SR-quantization-mismatch","If the DataModel indicates a coordinate system other than WGS84, inputQuantizationParameters must be provided to the query encoder");n.input_quantization_parameters=t.InputQuantizationUtil.WGS84_lossless()}e.outputQuantizationParameters&&at(e.outputQuantizationParameters,n,t),e.provenanceBehavior&&st(e.provenanceBehavior,n);try{n.encode()}catch(a){throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{error:a})}const o=n.get_encoding_result();if(o.error.error_code!==0)throw new d("knowledge-graph:query-encoding-failed","Attempting to encode the query failed",{errorCode:o.error.error_code,errorMessage:o.error.error_message});return structuredClone(o.get_byte_buffer())}async function Zt(e){const r=await I(),t=new r.GraphSearchRequestEncoder;if(t.deleteLater(),t.search_query=e.searchQuery,t.type_category_filter=r.esriNamedTypeCategory[e.typeCategoryFilter],e.returnSearchContext===!0&&(t.return_search_context=e.returnSearchContext),e.start!=null&&e.start>0&&(t.start_index=e.start),e.num!=null&&(t.max_num_results=e.num),e.idsFilter!=null&&Array.isArray(e.idsFilter)&&e.idsFilter.length>0)try{t.set_ids_filter(Ye(e.idsFilter,r))}catch(o){throw new d("knowledge-graph:ids-format-error","Attempting to set ids filter failed. This is usually caused by an incorrectly formatted UUID string",{error:o})}e.namedTypesFilter?.forEach(o=>{t.add_named_type_filter(o)});try{t.encode()}catch(o){throw new d("knowledge-graph:search-encoding-failed","Attempting to encode the search failed",{error:o})}const n=t.get_encoding_result();if(n.error.error_code!==0)throw new d("knowledge-graph:search-encoding-failed","Attempting to get encoding result from the query failed",{errorCode:n.error.error_code,errorMessage:n.error.error_message});return structuredClone(n.get_byte_buffer())}async function Q(e,r){return O(e,{responseType:"native-request-init",method:"post",query:{f:"pbf",...r?.query},body:"x",headers:{"Content-Type":"application/octet-stream"},signal:r?.signal,timeout:r?.timeout})}async function Jt(e){const r=e.headers.get("content-type");if(r?.includes("application/x-protobuf")){const t=await e.arrayBuffer(),n=new(await I()).GraphApplyEditsDecoder;return n.deleteLater(),n.decode(new Uint8Array(t)),At(n)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:r,data:e.text()})}function ce(e,r,t,n){e.push_buffer(new Uint8Array(r));const o=[];let a,s,p=0;for(;e.next_row();){a&&s||(a=n??jt(e),s=a.outSpatialReference??new U({wkid:4326})),p||(p=e.get_header_keys().size());const u=new Array(p);for(let c=0;c{s=y,p=h});let c=!1;return{readableStream:new ReadableStream({async start(y){try{return h()}catch(G){n?.releaseLock(),y.error(new d("knowledge-graph:stream-decoding-error","The server returned a valid response, but there was an error decoding the response stream",{error:G})),y.close()}function h(){return n?.read().then(({done:G,value:v})=>{try{if(G){let j;if(o.has_error()?j=new d("knowledge-graph:stream-decoding-error","One or more result rows were not successfully decoded - query stream done",{errorCode:o.error.error_code,errorMessage:o.error.error_message}):c||s(new X),n.releaseLock(),j)throw y.error(j),p(j),j;return void y.close()}const g=ce(o,v,r,a),Te=g.resultRows;return Te.length>0&&y.enqueue(Te),!a&&g.resultHeader&&(a=g.resultHeader,s(g.resultHeader),c=!0),h()}catch(g){throw V.getLogger("esri.rest.knowledgeGraph.knowledgeGraphService").error(g),p(g),new d("knowledge-graph:unexpected-server-response","Error inside streaming data return parsing",{error:g})}})}}}),resultHeader:await u}}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:t,data:e.text()})}async function $e(e){const r=`${e.url}/dataModel/queryDataModel`,t=await O(r,{responseType:"array-buffer",query:{f:"pbf"}}),n=t.getHeader?.("content-type"),o=t.data;if(n?.includes("application/x-protobuf")){const a=(await I()).decode_data_model_from_protocol_buffer(new Uint8Array(o));if(!a)throw new d("knowledge-graph:data-model-decode-failure","The server responded to the data model query, but the response failed to be decoded. This typically occurs when the Knowledge JS API (4.26 or later) is used with an unsupported backend (11.0 or earlier)");return ft(a)}throw new d("knowledge-graph:unexpected-server-response","server returned an unexpected response",{responseType:n,data:t.data})}const rr=Object.freeze(Object.defineProperty({__proto__:null,_fetchWrapper:L,_getClientDataCacheCopy:Nt,clearClientDataCache:Bt,clientDataCache:z,executeApplyEdits:Lt,executeQuery:zt,executeQueryStreaming:Ut,executeSearch:qt,executeSearchStreaming:Yt,fetchAllClientDataKeys:Ht,fetchClientDataAtKeys:Kt,fetchKnowledgeGraph:Qt,kgRestServices:T,refreshDataModel:Y,refreshServiceDefinition:We},Symbol.toStringTag,{value:"Module"}));export{Qt as F,Ut as M,Kt as W,rr as k,I as r}; diff --git a/custom-toc-highlight/assets/knowledgegraph-Dt7zfNlJ-BeekZJr0.js b/custom-toc-highlight/assets/knowledgegraph-Dt7zfNlJ-CqBwig9B.js similarity index 72% rename from custom-toc-highlight/assets/knowledgegraph-Dt7zfNlJ-BeekZJr0.js rename to custom-toc-highlight/assets/knowledgegraph-Dt7zfNlJ-CqBwig9B.js index 5011f200..39f09864 100644 --- a/custom-toc-highlight/assets/knowledgegraph-Dt7zfNlJ-BeekZJr0.js +++ b/custom-toc-highlight/assets/knowledgegraph-Dt7zfNlJ-CqBwig9B.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./knowledgeGraphService-DOJz0fzA-DDr_20o0.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-BfX8CRfG.js","./story-D5JOvNzl.css","./Relationship-Db9GUmYx-Cq6n6OX7.js"])))=>i.map(i=>d[i]); -import{_ as D}from"./main-ugzBrWNm.js";import{r as _,C as E,J as $,d as k,d6 as N,b7 as j}from"./story-BfX8CRfG.js";import{t as q,N as I}from"./arcadeUtils-DpP0k7IY-BXaTThTL.js";import{w as P,T as c,n as l,M as T,y as w,F as J,g as M,C as S,e as O,S as C,d as b,c as V,h as K,a as L,R as A,ak as Q}from"./languageUtils-BYxF9hRA-BBstOXAc.js";import{n as U}from"./portalUtils-CKN9iXwH-B2zCer9u.js";import{_ as z,W as B,K as H}from"./projection-BA9M1R7d-BYoCXVXt.js";import X from"./PortalItem-CctGdnxF-C7IJrZYq.js";import{f as Y,j as Z}from"./project-DQKhruav-DBiiXhMD.js";import{j as tt,w as nt,x as rt,b as et,k as it}from"./Relationship-Db9GUmYx-Cq6n6OX7.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./number-eRKYXfX9-eI8aiR_7.js";import"./shared-D1w-26bA-B8KlJvO_.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";let u=null;async function ot(t){const n=E.geometryServiceUrl??"";if(!n){z()||await B();for(const r of t)r.container[r.indexer]=H(r.container[r.indexer],$.WGS84);return}const e=t.map(r=>r.container[r.indexer]),o=new Y({geometries:e,outSpatialReference:$.WGS84}),s=await Z(n,o);for(let r=0;rimport("./knowledgeGraphService-DOJz0fzA-DDr_20o0.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(o=>o.k)),await u.fetchKnowledgeGraph(e.url)}function R(t,n,e,o,s){if(t===null)return null;if(w(t)||C(t))return t;if(b(t)||b(t))return t.toJSDate();if(V(t))return t.toStorageFormat();if(K(t))return t.toStorageString();if(L(t)){const r={};for(const i of t.keys())r[i]=R(t.field(i),n,e,o,s),r[i]instanceof k&&s.push({container:r,indexer:i});return r}if(S(t)){const r=t.map(i=>R(i,n,e,o,s));for(let i=0;im(e,n)):t instanceof nt?{graphTypeName:t.typeName,id:t.id,graphType:"entity",properties:v(t.properties,n)}:t instanceof rt?{graphType:"object",properties:v(t.properties,n)}:t instanceof et?{graphTypeName:t.typeName,id:t.id,graphType:"relationship",originId:t.originId??null,destinationId:t.destinationId??null,properties:v(t.properties,n)}:t instanceof it?{graphType:"path",path:t.path?t.path.map(e=>m(e,n)):null}:A(t)?at(t,n):w(t)||C(t)||Q(t)?t:null}function At(t){t.mode==="async"&&(t.functions.knowledgegraphbyportalitem=function(n,e){return t.standardFunctionAsync(n,e,(o,s,r)=>{if(P(r,2,2,n,e),r[0]===null)throw new c(n,l.PortalRequired,e);if(r[0]instanceof q){const d=T(r[1]);let f;return f=n.services?.portal?n.services.portal:_.getDefault(),W(U(r[0],f),d)}if(w(r[0])===!1)throw new c(n,l.InvalidParameter,e);const i=T(r[0]);return W(n.services?.portal??_.getDefault(),i)})},t.signatures.push({name:"knowledgegraphbyportalitem",min:2,max:2}),t.functions.querygraph=function(n,e){return t.standardFunctionAsync(n,e,async(o,s,r)=>{P(r,2,4,n,e);const i=r[0];if(!J(i))throw new c(n,l.InvalidParameter,e);const d=r[1];if(!w(d))throw new c(n,l.InvalidParameter,e);u===null&&(u=await D(()=>import("./knowledgeGraphService-DOJz0fzA-DDr_20o0.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(a=>a.k));let f=null;const h=M(r[2],null);if(!(h instanceof I||h===null))throw new c(n,l.InvalidParameter,e);if(h){let a=[];f=R(h,!0,!1,n,a),a=a.filter(p=>!p.container[p.indexer].spatialReference.isWGS84),a.length>0&&await ot(a)}const x=new tt({openCypherQuery:d,bindParameters:f});(i?.serviceDefinition?.currentVersion??11.3)>11.2&&(x.outputSpatialReference=n.spatialReference);const F=(await u.executeQueryStreaming(i,x)).resultRowsStream.getReader(),y=[];try{for(;;){const{done:a,value:p}=await F.read();if(a)break;if(S(p))for(const g of p)y.push(m(g,n));else{const g=[];for(const G of p)g.push(m(p[G],n));y.push(g)}}}catch(a){throw a}return I.convertJsonToArcade(y,O(n),!1,!0)})},t.signatures.push({name:"querygraph",min:2,max:4}))}export{At as registerFunctions}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./knowledgeGraphService-DOJz0fzA-BlihQLi8.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-Doly9N9p.js","./story-DbFhYdqg.css","./Relationship-Db9GUmYx-B84JspfN.js"])))=>i.map(i=>d[i]); +import{_ as D}from"./main-QGPoLsvl.js";import{r as _,C as E,J as $,d as k,d6 as N,b7 as j}from"./story-Doly9N9p.js";import{t as q,N as I}from"./arcadeUtils-DpP0k7IY-C-RKTwge.js";import{w as P,T as c,n as l,M as T,y as w,F as J,g as M,C as S,e as O,S as C,d as b,c as V,h as K,a as L,R as A,ak as Q}from"./languageUtils-BYxF9hRA-DnySuvAL.js";import{n as U}from"./portalUtils-CKN9iXwH-BDO5uTJS.js";import{_ as z,W as B,K as H}from"./projection-BA9M1R7d-CAbqHZiw.js";import X from"./PortalItem-CctGdnxF-CfFOGshS.js";import{f as Y,j as Z}from"./project-DQKhruav-CyFgbMSU.js";import{j as tt,w as nt,x as rt,b as et,k as it}from"./Relationship-Db9GUmYx-B84JspfN.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./number-eRKYXfX9-bCdnHRN-.js";import"./shared-D1w-26bA-BBIRhcUQ.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";let u=null;async function ot(t){const n=E.geometryServiceUrl??"";if(!n){z()||await B();for(const r of t)r.container[r.indexer]=H(r.container[r.indexer],$.WGS84);return}const e=t.map(r=>r.container[r.indexer]),o=new Y({geometries:e,outSpatialReference:$.WGS84}),s=await Z(n,o);for(let r=0;rimport("./knowledgeGraphService-DOJz0fzA-BlihQLi8.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(o=>o.k)),await u.fetchKnowledgeGraph(e.url)}function R(t,n,e,o,s){if(t===null)return null;if(w(t)||C(t))return t;if(b(t)||b(t))return t.toJSDate();if(V(t))return t.toStorageFormat();if(K(t))return t.toStorageString();if(L(t)){const r={};for(const i of t.keys())r[i]=R(t.field(i),n,e,o,s),r[i]instanceof k&&s.push({container:r,indexer:i});return r}if(S(t)){const r=t.map(i=>R(i,n,e,o,s));for(let i=0;im(e,n)):t instanceof nt?{graphTypeName:t.typeName,id:t.id,graphType:"entity",properties:v(t.properties,n)}:t instanceof rt?{graphType:"object",properties:v(t.properties,n)}:t instanceof et?{graphTypeName:t.typeName,id:t.id,graphType:"relationship",originId:t.originId??null,destinationId:t.destinationId??null,properties:v(t.properties,n)}:t instanceof it?{graphType:"path",path:t.path?t.path.map(e=>m(e,n)):null}:A(t)?at(t,n):w(t)||C(t)||Q(t)?t:null}function At(t){t.mode==="async"&&(t.functions.knowledgegraphbyportalitem=function(n,e){return t.standardFunctionAsync(n,e,(o,s,r)=>{if(P(r,2,2,n,e),r[0]===null)throw new c(n,l.PortalRequired,e);if(r[0]instanceof q){const d=T(r[1]);let f;return f=n.services?.portal?n.services.portal:_.getDefault(),W(U(r[0],f),d)}if(w(r[0])===!1)throw new c(n,l.InvalidParameter,e);const i=T(r[0]);return W(n.services?.portal??_.getDefault(),i)})},t.signatures.push({name:"knowledgegraphbyportalitem",min:2,max:2}),t.functions.querygraph=function(n,e){return t.standardFunctionAsync(n,e,async(o,s,r)=>{P(r,2,4,n,e);const i=r[0];if(!J(i))throw new c(n,l.InvalidParameter,e);const d=r[1];if(!w(d))throw new c(n,l.InvalidParameter,e);u===null&&(u=await D(()=>import("./knowledgeGraphService-DOJz0fzA-BlihQLi8.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url).then(a=>a.k));let f=null;const h=M(r[2],null);if(!(h instanceof I||h===null))throw new c(n,l.InvalidParameter,e);if(h){let a=[];f=R(h,!0,!1,n,a),a=a.filter(p=>!p.container[p.indexer].spatialReference.isWGS84),a.length>0&&await ot(a)}const x=new tt({openCypherQuery:d,bindParameters:f});(i?.serviceDefinition?.currentVersion??11.3)>11.2&&(x.outputSpatialReference=n.spatialReference);const F=(await u.executeQueryStreaming(i,x)).resultRowsStream.getReader(),y=[];try{for(;;){const{done:a,value:p}=await F.read();if(a)break;if(S(p))for(const g of p)y.push(m(g,n));else{const g=[];for(const G of p)g.push(m(p[G],n));y.push(g)}}}catch(a){throw a}return I.convertJsonToArcade(y,O(n),!1,!0)})},t.signatures.push({name:"querygraph",min:2,max:4}))}export{At as registerFunctions}; diff --git a/custom-toc-highlight/assets/labelUtils-BW14kBqX-BkXd4VJn.js b/custom-toc-highlight/assets/labelUtils-BW14kBqX-Tk7uOiPw.js similarity index 96% rename from custom-toc-highlight/assets/labelUtils-BW14kBqX-BkXd4VJn.js rename to custom-toc-highlight/assets/labelUtils-BW14kBqX-Tk7uOiPw.js index ac8efe10..222922f1 100644 --- a/custom-toc-highlight/assets/labelUtils-BW14kBqX-BkXd4VJn.js +++ b/custom-toc-highlight/assets/labelUtils-BW14kBqX-Tk7uOiPw.js @@ -1 +1 @@ -import{c2 as p}from"./story-BfX8CRfG.js";const s="__begin__",l="__end__",u=new RegExp(s,"ig"),c=new RegExp(l,"ig"),t=new RegExp("^"+s,"i"),o=new RegExp(l+"$","i"),r='"',x=r+" + ",f=" + "+r;function g(n){return n.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function y(n){return n.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function i(n){const e={expression:"",type:"none"};return n.labelExpressionInfo?n.labelExpressionInfo.value?(e.expression=n.labelExpressionInfo.value,e.type="conventional"):n.labelExpressionInfo.expression&&(e.expression=n.labelExpressionInfo.expression,e.type="arcade"):n.labelExpression!=null&&(e.expression=g(n.labelExpression),e.type="conventional"),e}function A(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return E(e.expression);case"arcade":return e.expression}return null}function I(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return $(e.expression);case"arcade":return _(e.expression)}return null}function E(n){let e;return n?(e=p(n,a=>s+'$feature["'+a+'"]'+l),e=t.test(e)?e.replace(t,""):r+e,e=o.test(e)?e.replace(o,""):e+r,e=e.replaceAll(u,x).replaceAll(c,f)):e='""',e}const w=/^\s*\{([^}]+)\}\s*$/i;function $(n){return n?.match(w)?.[1].trim()||null}const b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,m=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,R=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function _(n){if(!n)return null;let e=b.exec(n)||m.exec(n);return e?e[1]||e[3]:(e=R.exec(n),e?e[2]:null)}export{y as $,A as b,g as i,I as m,E as p,i as t,_ as u}; +import{c2 as p}from"./story-Doly9N9p.js";const s="__begin__",l="__end__",u=new RegExp(s,"ig"),c=new RegExp(l,"ig"),t=new RegExp("^"+s,"i"),o=new RegExp(l+"$","i"),r='"',x=r+" + ",f=" + "+r;function g(n){return n.replaceAll(new RegExp("\\[","g"),"{").replaceAll(new RegExp("\\]","g"),"}")}function y(n){return n.replaceAll(new RegExp("\\{","g"),"[").replaceAll(new RegExp("\\}","g"),"]")}function i(n){const e={expression:"",type:"none"};return n.labelExpressionInfo?n.labelExpressionInfo.value?(e.expression=n.labelExpressionInfo.value,e.type="conventional"):n.labelExpressionInfo.expression&&(e.expression=n.labelExpressionInfo.expression,e.type="arcade"):n.labelExpression!=null&&(e.expression=g(n.labelExpression),e.type="conventional"),e}function A(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return E(e.expression);case"arcade":return e.expression}return null}function I(n){const e=i(n);if(!e)return null;switch(e.type){case"conventional":return $(e.expression);case"arcade":return _(e.expression)}return null}function E(n){let e;return n?(e=p(n,a=>s+'$feature["'+a+'"]'+l),e=t.test(e)?e.replace(t,""):r+e,e=o.test(e)?e.replace(o,""):e+r,e=e.replaceAll(u,x).replaceAll(c,f)):e='""',e}const w=/^\s*\{([^}]+)\}\s*$/i;function $(n){return n?.match(w)?.[1].trim()||null}const b=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*$/i,m=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])(.+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,R=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(.+)(\1)\s*\));?\s*$/i;function _(n){if(!n)return null;let e=b.exec(n)||m.exec(n);return e?e[1]||e[3]:(e=R.exec(n),e?e[2]:null)}export{y as $,A as b,g as i,I as m,E as p,i as t,_ as u}; diff --git a/custom-toc-highlight/assets/labelingInfo-DGVNul26-zkvIaBlq.js b/custom-toc-highlight/assets/labelingInfo-DGVNul26-BDBqWm17.js similarity index 98% rename from custom-toc-highlight/assets/labelingInfo-DGVNul26-zkvIaBlq.js rename to custom-toc-highlight/assets/labelingInfo-DGVNul26-BDBqWm17.js index dc19044b..06138064 100644 --- a/custom-toc-highlight/assets/labelingInfo-DGVNul26-zkvIaBlq.js +++ b/custom-toc-highlight/assets/labelingInfo-DGVNul26-BDBqWm17.js @@ -1 +1 @@ -import{v as i,S as s,a0 as x,ac as u,i as S,aK as C,dN as j,ee as I,ef as B,eg as h,e as P,eh as N,ei as $,P as d,o as D,a1 as G}from"./story-BfX8CRfG.js";import{p as g,$ as M,u as O,t as V,b as z,m as J}from"./labelUtils-BW14kBqX-BkXd4VJn.js";var m;let p=m=class extends P{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,r){return r.value?g(r.value):e}writeExpression(e,r,n){this.value!=null&&(e=g(this.value)),e!=null&&(r[n]=e)}clone(){return new m({expression:this.expression,title:this.title,value:this.value})}};i([s({type:String,json:{write:{writerEnsuresNonNull:!0}}})],p.prototype,"expression",void 0),i([x("expression",["expression","value"])],p.prototype,"readExpression",null),i([u("expression")],p.prototype,"writeExpression",null),i([s({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],p.prototype,"title",void 0),i([s({json:{read:!1,write:!1}})],p.prototype,"value",void 0),p=m=i([S("esri.layers.support.LabelExpressionInfo")],p);const L=p;var f;const v=new C({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 w(e,r,n){return{enabled:!N(n?.layer)}}function E(e){return!e||e.origin!=="service"&&e.layer?.type!=="map-image"}function R(e){return e?.type==="map-image"}function A(e){return!!R(e)&&!!e.capabilities?.exportMap?.supportsArcadeExpressionForLabeling}function U(e){return E(e)||A(e?.layer)}let l=f=class extends P{static evaluateWhere(e,r){const n=(t,o,a)=>{switch(o){case"=":return t==a;case"<>":return t!=a;case">":return t>a;case">=":return t>=a;case"<":return tU(n)?{allowNull:!0}:{enabled:!1}}}})],l.prototype,"labelExpressionInfo",void 0),i([u("labelExpressionInfo")],l.prototype,"writeLabelExpressionInfo",null),i([s({type:v.apiValues,json:{type:v.jsonValues,read:v.read,write:v.write}})],l.prototype,"labelPlacement",void 0),i([s({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],l.prototype,"labelPosition",void 0),i([s({type:Number})],l.prototype,"maxScale",void 0),i([u("maxScale")],l.prototype,"writeMaxScale",null),i([s({type:Number})],l.prototype,"minScale",void 0),i([u("minScale")],l.prototype,"writeMinScale",null),i([s({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabel",void 0),i([s({type:Number,cast:j,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabelDistance",void 0),i([s({types:I,json:{origins:{"web-scene":{types:B,write:h,default:null}},write:h,default:null}})],l.prototype,"symbol",void 0),i([s({type:Boolean,json:{write:!0}})],l.prototype,"useCodedValues",void 0),i([s({type:String,json:{write:!0}})],l.prototype,"where",void 0),l=f=i([S("esri.layers.support.LabelClass")],l);const Z=l,y=()=>G.getLogger("esri.layers.support.labelingInfo"),F=/\[([^[\]]+)\]/gi;function q(e,r,n){return e?e.map(t=>{const o=new Z;if(o.read(t,n),o.labelExpression){const a=r.fields||r.layerDefinition?.fields||this.fields;o.labelExpression=o.labelExpression.replaceAll(F,(c,b)=>`[${k(b,a)}]`)}return o}):null}function k(e,r){if(!r)return e;const n=e.toLowerCase();for(let t=0;t{switch(o){case"=":return t==a;case"<>":return t!=a;case">":return t>a;case">=":return t>=a;case"<":return tU(n)?{allowNull:!0}:{enabled:!1}}}})],l.prototype,"labelExpressionInfo",void 0),i([u("labelExpressionInfo")],l.prototype,"writeLabelExpressionInfo",null),i([s({type:v.apiValues,json:{type:v.jsonValues,read:v.read,write:v.write}})],l.prototype,"labelPlacement",void 0),i([s({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],l.prototype,"labelPosition",void 0),i([s({type:Number})],l.prototype,"maxScale",void 0),i([u("maxScale")],l.prototype,"writeMaxScale",null),i([s({type:Number})],l.prototype,"minScale",void 0),i([u("minScale")],l.prototype,"writeMinScale",null),i([s({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabel",void 0),i([s({type:Number,cast:j,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:{overridePolicy:w}}}}})],l.prototype,"repeatLabelDistance",void 0),i([s({types:I,json:{origins:{"web-scene":{types:B,write:h,default:null}},write:h,default:null}})],l.prototype,"symbol",void 0),i([s({type:Boolean,json:{write:!0}})],l.prototype,"useCodedValues",void 0),i([s({type:String,json:{write:!0}})],l.prototype,"where",void 0),l=f=i([S("esri.layers.support.LabelClass")],l);const Z=l,y=()=>G.getLogger("esri.layers.support.labelingInfo"),F=/\[([^[\]]+)\]/gi;function q(e,r,n){return e?e.map(t=>{const o=new Z;if(o.read(t,n),o.labelExpression){const a=r.fields||r.layerDefinition?.fields||this.fields;o.labelExpression=o.labelExpression.replaceAll(F,(c,b)=>`[${k(b,a)}]`)}return o}):null}function k(e,r){if(!r)return e;const n=e.toLowerCase();for(let t=0;tthis.fn(e,{preparsed:!0,arguments:r})}call(e,r){return this.fn(e,r)}marshalledCall(e,r,t,a){return a(e,r,(s,l,u)=>{u=u.map(c=>c instanceof R&&!(c instanceof Y)?un(c,e,a):c);const p=this.call(t,{args:u});return kn(p)?p.then(c=>un(c,t,a)):p})}}class Y extends R{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,r){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}marshalledCall(e,r,t){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}}class O extends F{constructor(e,r,t,a,s,l){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=r,this._hasZ=t,this._hasM=a,this._cacheId=s,this._partId=l}get(e){if(this._lazyPt[e]===void 0){const r=this._elements[e];if(r===void 0)return;const t=this._hasZ,a=this._hasM;let s;s=t&&!a?new M(r[0],r[1],r[2],void 0,this._spRef):a&&!t?new M(r[0],r[1],void 0,r[2],this._spRef):t&&a?new M(r[0],r[1],r[2],r[3],this._spRef):new M(r[0],r[1],this._spRef),s.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=s}return this._lazyPt[e]}equalityTest(e){return e===this||e!==null&&e instanceof O&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}class nn extends F{constructor(e,r,t,a,s){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=t,this._hasM=a,this._spRef=r,this._cacheId=s}get(e){if(this._lazyPath[e]===void 0){const r=this._elements[e];if(r===void 0)return;this._lazyPath[e]=new O(r,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||e!==null&&e instanceof nn&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}class Bn{constructor(e){this.value=e}}class Gn{constructor(e){this.value=e}}const g={type:"VOID"},Yn=Symbol("BREAK"),qn=Symbol("CONTINUE");function w(n,e,r){return e===""||e==null||e===r||e===r?n:n=n.split(e).join(r)}function J(n){return n instanceof R}function en(n){return n instanceof fn}function L(n){return!!y(n)||!!N(n)||!!f(n)||!!m(n)||!!h(n)||!!b(n)||n===null||n===g||typeof n=="number"}function Hn(n,e){return n===void 0?e:n}function Kn(n){return n==null?"":C(n)||Z(n)?"Array":f(n)?"Date":h(n)?"Time":m(n)?"DateOnly":y(n)?"String":b(n)?"Boolean":N(n)?"Number":n?.declaredClass==="esri.arcade.Attachment"?"Attachment":n?.declaredClass==="esri.arcade.Portal"?"Portal":n?.declaredClass==="esri.arcade.Dictionary"?"Dictionary":Nn(n)?"KnowledgeGraph":n instanceof fn?"Module":yn(n)?"Feature":n instanceof M?"Point":n instanceof V?"Polygon":n instanceof W?"Polyline":n instanceof Q?"Multipoint":n instanceof X?"Extent":J(n)?"Function":gn(n)?"FeatureSet":bn(n)?"FeatureSetCollection":n===g?"":typeof n=="number"&&isNaN(n)?"Number":"Unrecognized Type"}function y(n){return typeof n=="string"||n instanceof String}function b(n){return typeof n=="boolean"}function N(n){return typeof n=="number"}function Vn(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n}function Wn(n){return n instanceof k}function C(n){return Array.isArray(n)}function yn(n){return n?.arcadeDeclaredClass==="esri.arcade.Feature"}function Qn(n){return n?.declaredClass==="esri.Graphic"}function Xn(n){return n instanceof zn}function gn(n){return n?.declaredRootClass==="esri.arcade.featureset.support.FeatureSet"}function $n(n){return n?.declaredClass==="esri.arcade.Dictionary"}function bn(n){return n?.declaredRootClass==="esri.arcade.featureSetCollection"}function Nn(n){return n?.declaredClass==="esri.rest.knowledgeGraph.KnowledgeGraph"}function Z(n){return n instanceof F}function f(n){return n instanceof I}function m(n){return n instanceof _n}function h(n){return n instanceof vn}function q(n){return n!=null&&typeof n=="object"}function P(n){return n instanceof Date}function ne(n,e,r,t,a){if(n.lengthr)throw new T(t,o.WrongNumberOfParameters,a)}function ee(n){return n<0?-Math.round(-n):Math.round(n)}function rn(n,e){return isNaN(n)||e==null||e===""?n.toString():(e=w(e,"‰",""),e=w(e,"¤",""),Ln(n,{pattern:e}))}function j(n,e){return e==null||e===""?n.toISOString(!0):n.toFormat(Sn(e),{locale:cn(),numberingSystem:"latn"})}function Sn(n,e=!1){n=n.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let r="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|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?|Z{1,5}|.)/g;for(const a of n.match(t)||[])switch(a){case"D":r+="d";break;case"DD":r+="dd";break;case"DDD":r+="o";break;case"d":r+="c";break;case"ddd":r+="ccc";break;case"dddd":r+="cccc";break;case"M":r+="L";break;case"MM":r+="LL";break;case"MMM":r+="LLL";break;case"MMMM":r+="LLLL";break;case"YY":r+="yy";break;case"Y":case"YYYY":r+="yyyy";break;case"Q":r+="q";break;case"Z":r+="Z";break;case"ZZ":r+="ZZ";break;case"ZZZ":r+="ZZZ";break;case"ZZZZ":r+=e?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":r+=e?"[ZZZZZ]":"ZZZZZ";break;case"S":r+="'S'";break;case"SS":r+="'SS'";break;case"SSS":r+="u";break;case"A":case"a":r+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":r+=a;break;default:a.length>=2&&a.slice(0,1)==="["&&a.slice(-1)==="]"?r+=`'${a.slice(1,-1)}'`:r+=`'${a}'`}return r}function i(n,e,r){switch(r){case">":return n>e;case"<":return n=":return n>=e;case"<=":return n<=e}return!1}function re(n,e,r){if(n===null){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}if(n===g){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}else if(N(n)){if(N(e))return i(n,e,r);if(b(e))return i(n,d(e),r);if(e===null||e===g)return i(n,0,r);if(y(e))return i(n,d(e),r);if(f(e)||h(e)||m(e))return i(n,e.toNumber(),r)}else if(y(n)){if(y(e))return i(x(n),x(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(N(e))return i(d(n),e,r);if(e===null||e===g)return i(d(n),0,r);if(b(e))return i(d(n),d(e),r)}else if(f(n)){if(f(e))return n.timeZone!==e.timeZone&&(n.isUnknownTimeZone?n=I.arcadeDateAndZoneToArcadeDate(n,e.timeZone):e.isUnknownTimeZone&&(e=I.arcadeDateAndZoneToArcadeDate(e,n.timeZone))),i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(b(n)){if(b(e))return i(n,e,r);if(N(e))return i(d(n),d(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(e===null||e===g)return i(d(n),0,r);if(y(e))return i(d(n),d(e),r)}else if(m(n)){if(f(e))return i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(h(n)){if(f(e))throw new T(null,o.CannotCompareDateAndTime,null);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))return i(n.toNumber(),e.toNumber(),r);if(m(e))throw new T(null,o.CannotCompareDateAndTime,null)}return!!Cn(n,e)&&(r==="<="||r===">=")}function Cn(n,e){if(n===e||n===null&&e===g||e===null&&n===g)return!0;if(f(n)&&f(e)||h(n)&&h(e)||m(n)&&m(e))return n.equals(e);if(n instanceof nn||n instanceof O)return n.equalityTest(e);if(n instanceof M&&e instanceof M){const r=n.cache._arcadeCacheId,t=e.cache._arcadeCacheId;if(r!=null)return r===t}return!!(q(n)&&q(e)&&(n._arcadeCacheId===e._arcadeCacheId&&n._arcadeCacheId!==void 0&&n._arcadeCacheId!==null||n._underlyingGraphic===e._underlyingGraphic&&n._underlyingGraphic!==void 0&&n._underlyingGraphic!==null))}function x(n,e){if(y(n))return n;if(n===null)return"";if(N(n))return rn(n,e);if(b(n))return n.toString();if(f(n))return j(n,e);if(h(n)||m(n))return n.toFormat(e);if(n instanceof k)return JSON.stringify(n.toJSON());if(C(n)){const r=[];for(let t=0;tt.key===a.key?0:t.key==="spatialReference"?1:a.key==="spatialReference"||t.keya.key?1:0);if(C(n)){const t=[];for(let a=0;a0)return n;return null}if(n instanceof W){if(n.paths.length===0)return null;for(const e of n.paths)if(e.length>0)return n;return null}return n instanceof Q?n.points.length===0?null:n:n instanceof X?n.xmin==="NaN"||n.xmin===null||isNaN(n.xmin)?null:n:null}function Tn(n,e){if(!n||!n.domain)return e;let r=null,t=null;if(f(e))r=e.toNumber();else if(m(e))r=e.toString();else if(h(e))r=e.toStorageString();else if(n.field.type==="string"||n.field.type==="esriFieldTypeString")r=x(e);else{if(e==null)return null;if(e==="")return e;r=d(e)}for(let a=0;aS[p]===t&&(a=S.domains?.[l.name],a&&a.type==="inherited"&&(a=ln(l.name,e),s=!0),!0)),s||a||(a=ln(n,e)),{field:l,domain:a}}function ln(n,e){let r;return e.fields.some(t=>(t.name.toLowerCase()===n.toLowerCase()&&(r=t.domain),!!r)),r}function H(n,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const r=typeof e.cycles=="boolean"&&e.cycles,t=e.cmp&&(a=e.cmp,function(l){return function(u,p){const c={key:u,value:l[u]},S={key:p,value:l[p]};return a(c,S)}});var a;const s=[];return function l(u){if(u?.toJSON&&typeof u.toJSON=="function"&&(u=u.toJSON()),u===void 0)return;if(typeof u=="number")return isFinite(u)?""+u:"null";if(typeof u!="object")return JSON.stringify(u);let p,c;if(Array.isArray(u)){for(c="[",p=0;p0&&(s=n[0].spatialReference,r=n[0].hasZ,t=n[0].hasM)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else{if(!Z(n))throw new T(null,o.InvalidParameter,null);for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:(Dn(a)||(a=a.slice().reverse()),new V({rings:[a],spatialReference:s,hasZ:r,hasM:t}))}return n}function de(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new W({paths:[a],spatialReference:s,hasZ:r,hasM:t})}return n}function pe(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new Q({points:a,spatialReference:s,hasZ:r,hasM:t})}return n}function me(n,e=!1){const r=[];if(n===null)return r;if(C(n)===!0){for(let t=0;t{setTimeout(()=>{e(n)},0)})):n}function ye(n,e,r){switch(r){case"&":return n&e;case"|":return n|e;case"^":return n^e;case"<<":return n<>":return n>>e;case">>>":return n>>>e}}function _(n,e=null){return n==null?null:b(n)||N(n)||y(n)?n:n instanceof k?e?.keepGeometryType===!0?n:n.toJSON():n instanceof F?n.toArray().map(r=>_(r,e)):Array.isArray(n)?n.map(r=>_(r,e)):P(n)?n:f(n)?n.toJSDate():h(n)?n.toString():m(n)?n.toJSDate():n!==null&&typeof n=="object"&&n.castAsJson!==void 0?n.castAsJson(e):null}async function ge(n,e,r,t,a){const s=await Mn(n,e,r);a[t]=s}async function Mn(n,e=null,r=null){if(n instanceof F&&(n=n.toArray()),n==null)return null;if(L(n)||n instanceof k||P(n)||f(n))return _(n,r);if(Array.isArray(n)){const t=[],a=[];for(const s of n)s===null||L(s)||s instanceof k||P(s)||f(s)?a.push(_(s,r)):(a.push(null),t.push(ge(s,e,r,a.length-1,a)));return t.length>0&&await Promise.all(t),a}return n!==null&&typeof n=="object"&&n.castAsJsonAsync!==void 0?n.castAsJsonAsync(e,r):null}function v(n){return xn(n)?n.parent:n}function xn(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.support.SubtypeSublayer"}function be(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.SubtypeGroupLayer"}function Ne(n,e,r){const t=v(n.fullSchema());return t===null||!t.fields?null:B(e,t,n,r)}function Se(n){const e=v(n.fullSchema());return e===null?null:e.fields?e.subtypeField?{subtypeField:e.subtypeField,subtypes:e.subtypes?e.subtypes.map(r=>({name:r.name,code:r.code})):[]}:e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(r=>({name:r.name,code:r.id})):[]}:null:null}function Ce(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;const s=B(e,a,n,t);if(r===void 0)try{r=n.field(e)}catch{return null}return Tn(s,r)}function Ae(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;if(r===void 0){try{r=n.field(e)}catch{return null}return r}return Fn(B(e,a,n,t),r)}function Te(n){return n?.timeZone??"system"}function Fe(n){const e=v(n.fullSchema());if(e===null||!e.fields)return null;const r=[];for(const t of e.fields)r.push(En(t));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField??"",geometryType:sn[e.geometryType]===void 0?"":sn[e.geometryType],fields:r}}function Me(n,e){return n==="system"&&(n=I.systemTimeZoneCanonicalName),{version:Zn,engineVersion:In,timeZone:n,spatialReference:e instanceof Rn?e.toJSON():e,application:wn.applicationName??"",engine:"web",locale:cn()}}const Zn="1.28",ve=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:Gn,ReturnResult:Bn,absRound:ee,arcadeVersion:Zn,autoCastArrayOfPointsToMultiPoint:pe,autoCastArrayOfPointsToPolygon:fe,autoCastArrayOfPointsToPolyline:de,autoCastFeatureToGeometry:ce,binaryOperator:ye,breakResult:Yn,castAsJson:_,castAsJsonAsync:Mn,continueResult:qn,defaultExecutingContext:Me,defaultTimeZone:Te,defaultUndefined:Hn,equalityTest:Cn,featureDomainCodeLookup:Ae,featureDomainValueLookup:Ce,featureFullDomain:Ne,featureSchema:Fe,featureSubtypes:Se,fixNullGeometry:le,fixSpatialReference:ue,formatDate:j,formatNumber:rn,getDomain:B,getDomainCode:Fn,getDomainValue:Tn,getType:Kn,greaterThanLessThan:re,isArray:C,isBoolean:b,isDate:f,isDateOnly:m,isDictionary:$n,isFeature:yn,isFeatureSet:gn,isFeatureSetCollection:bn,isFunctionParameter:J,isGeometry:Wn,isGraphic:Qn,isImmutableArray:Z,isInteger:Vn,isJsDate:P,isKnowledgeGraph:Nn,isModule:en,isNumber:N,isObject:q,isQuery:Xn,isSimpleType:L,isString:y,isSubtypeGrouplayer:be,isSubtypeSublayer:xn,isTime:h,multiReplace:w,parseGeometryFromJson:ie,pcCheck:ne,stableStringify:H,standardiseDateFormat:Sn,tick:he,toBoolean:se,toDate:ae,toNumber:d,toNumberArray:te,toString:x,toStringArray:me,toStringExplicit:An,voidOperation:g},Symbol.toStringTag,{value:"Module"}));export{Se as $,Me as A,_e as B,C,bn as D,L as E,Nn as F,nn as G,fn as H,Kn as I,ce as J,pe as K,se as L,x as M,we as N,Vn as O,ae as P,Ce as Q,Wn as R,N as S,T,J as U,re as V,Ne as W,Ae as X,fe as Y,Z,ee as _,$n as a,ye as a0,pn as a1,hn as a2,E as a3,Y as a4,Bn as a5,Yn as a6,qn as a7,Qn as a8,Gn as a9,ve as aa,Re as ab,R as ac,un as ad,he as ae,xn as af,me as ag,B as ah,Tn as ai,Fn as aj,P as ak,b,m as c,f as d,Te as e,d as f,Hn as g,h,Sn as i,le as j,O as k,g as l,Mn as m,o as n,Cn as o,de as p,w as q,gn as r,te as s,yn as t,An as u,_ as v,ne as w,Fe as x,y,ue as z}; +import{c2 as K,t as kn,w as M,l as V,m as W,G as Q,n as X,d as k,h as cn,F as on,g as On,D as Dn,c8 as In,J as Rn,C as wn}from"./story-Doly9N9p.js";import{r as I,O as _n,m as vn,u as Un}from"./TimeOnly-DSMefxKy-BHvJbNji.js";import{n as F}from"./ImmutableArray-CiJxhY8_-Kqx7aWRu.js";import{b as En,h as sn}from"./shared-D1w-26bA-BBIRhcUQ.js";import{z as Ln,M as Pn}from"./number-eRKYXfX9-bCdnHRN-.js";import{b as zn}from"./Query-BrwMGK8U-BPr0_G9t.js";let fn=class{};var o;(function(n){n.AsyncNotEnabled="AsyncNotEnabled",n.ModulesNotSupported="ModulesNotSupported",n.CircularModules="CircularModules",n.CannotCompareDateAndTime="CannotCompareDateAndTime",n.NeverReach="NeverReach",n.UnsupportedHashType="UnsupportedHashType",n.InvalidParameter="InvalidParameter",n.FeatureSetDoesNotHaveSubtypes="FeatureSetDoesNotHaveSubtypes",n.UnexpectedToken="UnexpectedToken",n.Unrecognized="Unrecognized",n.UnrecognizedType="UnrecognizedType",n.MaximumCallDepth="MaximumCallDepth",n.BooleanConditionRequired="BooleanConditionRequired",n.TypeNotAllowedInFeature="TypeNotAllowedInFeature",n.KeyMustBeString="KeyMustBeString",n.WrongNumberOfParameters="WrongNumberOfParameters",n.CallNonFunction="CallNonFunction",n.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",n.NoFunctionInDictionary="NoFunctionInDictionary",n.NoFunctionInArray="NoFunctionInArray",n.AssignModuleFunction="AssignModuleFunction",n.LogicExpressionOrAnd="LogicExpressionOrAnd",n.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",n.FunctionNotFound="FunctionNotFound",n.InvalidMemberAccessKey="InvalidMemberAccessKey",n.UnsupportedUnaryOperator="UnsupportUnaryOperator",n.InvalidIdentifier="InvalidIdentifier",n.MemberOfNull="MemberOfNull",n.UnsupportedOperator="UnsupportedOperator",n.Cancelled="Cancelled",n.ModuleAccessorMustBeString="ModuleAccessorMustBeString",n.ModuleExportNotFound="ModuleExportNotFound",n.Immutable="Immutable",n.OutOfBounds="OutOfBounds",n.IllegalResult="IllegalResult",n.FieldNotFound="FieldNotFound",n.PortalRequired="PortalRequired",n.LogicError="LogicError",n.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",n.KeyAccessorMustBeString="KeyAccessorMustBeString",n.WrongSpatialReference="WrongSpatialReference",n.CannotChangeTimeZoneTime="CannotChangeTimeZoneTime",n.CannotChangeTimeZoneDateOnly="CannotChangeTimeZoneDateOnly"})(o||(o={}));const dn={[o.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[o.LogicError]:"Logic error - {reason}",[o.CannotCompareDateAndTime]:"Cannot compare date or dateonly with timeonly types",[o.NeverReach]:"Encountered unreachable logic",[o.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[o.ModuleAccessorMustBeString]:"Module accessor must be a string",[o.ModuleExportNotFound]:"Module has no export with provided identifier",[o.ModulesNotSupported]:"Current profile does not support modules",[o.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[o.FunctionNotFound]:"Function not found",[o.FieldNotFound]:"Key not found - {key}",[o.CircularModules]:"Circular module dependencies are not allowed",[o.Cancelled]:"Execution cancelled",[o.UnsupportedHashType]:"Type not supported in hash function",[o.IllegalResult]:"Value is not a supported return type",[o.PortalRequired]:"Portal is required",[o.InvalidParameter]:"Invalid parameter",[o.WrongNumberOfParameters]:"Call with wrong number of parameters",[o.Unrecognized]:"Unrecognized code structure",[o.UnrecognizedType]:"Unrecognized type",[o.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[o.BooleanConditionRequired]:"Conditions must use booleans",[o.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[o.NoFunctionInArray]:"Arrays cannot contain functions.",[o.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[o.KeyAccessorMustBeString]:"Accessor must be a string",[o.KeyMustBeString]:"Object keys must be a string",[o.Immutable]:"Object is immutable",[o.UnexpectedToken]:"Unexpected token",[o.MemberOfNull]:"Cannot access property of null object",[o.MaximumCallDepth]:"Exceeded maximum function depth",[o.OutOfBounds]:"Out of bounds",[o.InvalidIdentifier]:"Identifier not recognized",[o.CallNonFunction]:"Expression is not a function",[o.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[o.AssignModuleFunction]:"Cannot assign function to module variable",[o.UnsupportedUnaryOperator]:"Unsupported unary operator",[o.UnsupportedOperator]:"Unsupported operator",[o.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[o.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&",[o.CannotChangeTimeZoneTime]:"Cannot change the timezone of a Time",[o.CannotChangeTimeZoneDateOnly]:"Cannot change the timezone of a DateOnly",[o.FeatureSetDoesNotHaveSubtypes]:"FeatureSet does not have subtypes"};let Jn=class extends Error{constructor(...n){super(...n)}};class U extends Jn{constructor(e,r){super($(r)+e.message,{cause:e}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,U),r?.loc&&(this.loc=r.loc)}}class T extends Error{constructor(e,r,t,a){super("Execution error - "+$(t)+K(dn[r],a)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,T),t?.loc&&(this.loc=t.loc)}}function $(n){return n&&n.loc?`Line : ${n.loc.start?.line}, ${n.loc.start?.column}: `:""}class pn extends Error{constructor(e,r,t,a){super("Compilation error - "+$(t)+K(dn[r],a)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,pn),t?.loc&&(this.loc=t.loc)}}let Re=class mn extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,mn)}};function we(n,e,r){return r.declaredRootClass==="esri.arcade.arcadeexecutionerror"||r.declaredRootClass==="esri.arcade.arcadecompilationerror"?r.loc===null&&e?.loc?new U(r,{cause:r}):r:(r.declaredRootClass==="esri.arcade.featureset.support.featureseterror"||r.declaredRootClass==="esri.arcade.featureset.support.sqlerror"||r.declaredRootClass,e?.loc?new U(r,{cause:r}):r)}var E;(function(n){n.UnrecognizedUri="UnrecognizedUri",n.UnsupportedUriProtocol="UnsupportedUriProtocol"})(E||(E={}));const jn={[E.UnrecognizedUri]:"Unrecognized uri - {uri}",[E.UnsupportedUriProtocol]:"Unrecognized uri protocol"};class hn extends Error{constructor(e,r){super(K(jn[e],r)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,hn)}}class R{constructor(){}}function un(n,e,r){if(n instanceof R&&!(n instanceof Y)){const t=new Y;return t.fn=n,t.parameterEvaluator=r,t.context=e,t}return n}class _e extends R{constructor(e){super(),this.fn=e}createFunction(e){return(...r)=>this.fn(e,{preparsed:!0,arguments:r})}call(e,r){return this.fn(e,r)}marshalledCall(e,r,t,a){return a(e,r,(s,l,u)=>{u=u.map(c=>c instanceof R&&!(c instanceof Y)?un(c,e,a):c);const p=this.call(t,{args:u});return kn(p)?p.then(c=>un(c,t,a)):p})}}class Y extends R{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,r){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}marshalledCall(e,r,t){return this.fn.marshalledCall(e,r,this.context,this.parameterEvaluator)}}class O extends F{constructor(e,r,t,a,s,l){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=r,this._hasZ=t,this._hasM=a,this._cacheId=s,this._partId=l}get(e){if(this._lazyPt[e]===void 0){const r=this._elements[e];if(r===void 0)return;const t=this._hasZ,a=this._hasM;let s;s=t&&!a?new M(r[0],r[1],r[2],void 0,this._spRef):a&&!t?new M(r[0],r[1],void 0,r[2],this._spRef):t&&a?new M(r[0],r[1],r[2],r[3],this._spRef):new M(r[0],r[1],this._spRef),s.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=s}return this._lazyPt[e]}equalityTest(e){return e===this||e!==null&&e instanceof O&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}class nn extends F{constructor(e,r,t,a,s){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=t,this._hasM=a,this._spRef=r,this._cacheId=s}get(e){if(this._lazyPath[e]===void 0){const r=this._elements[e];if(r===void 0)return;this._lazyPath[e]=new O(r,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||e!==null&&e instanceof nn&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}class Bn{constructor(e){this.value=e}}class Gn{constructor(e){this.value=e}}const g={type:"VOID"},Yn=Symbol("BREAK"),qn=Symbol("CONTINUE");function w(n,e,r){return e===""||e==null||e===r||e===r?n:n=n.split(e).join(r)}function J(n){return n instanceof R}function en(n){return n instanceof fn}function L(n){return!!y(n)||!!N(n)||!!f(n)||!!m(n)||!!h(n)||!!b(n)||n===null||n===g||typeof n=="number"}function Hn(n,e){return n===void 0?e:n}function Kn(n){return n==null?"":C(n)||Z(n)?"Array":f(n)?"Date":h(n)?"Time":m(n)?"DateOnly":y(n)?"String":b(n)?"Boolean":N(n)?"Number":n?.declaredClass==="esri.arcade.Attachment"?"Attachment":n?.declaredClass==="esri.arcade.Portal"?"Portal":n?.declaredClass==="esri.arcade.Dictionary"?"Dictionary":Nn(n)?"KnowledgeGraph":n instanceof fn?"Module":yn(n)?"Feature":n instanceof M?"Point":n instanceof V?"Polygon":n instanceof W?"Polyline":n instanceof Q?"Multipoint":n instanceof X?"Extent":J(n)?"Function":gn(n)?"FeatureSet":bn(n)?"FeatureSetCollection":n===g?"":typeof n=="number"&&isNaN(n)?"Number":"Unrecognized Type"}function y(n){return typeof n=="string"||n instanceof String}function b(n){return typeof n=="boolean"}function N(n){return typeof n=="number"}function Vn(n){return typeof n=="number"&&isFinite(n)&&Math.floor(n)===n}function Wn(n){return n instanceof k}function C(n){return Array.isArray(n)}function yn(n){return n?.arcadeDeclaredClass==="esri.arcade.Feature"}function Qn(n){return n?.declaredClass==="esri.Graphic"}function Xn(n){return n instanceof zn}function gn(n){return n?.declaredRootClass==="esri.arcade.featureset.support.FeatureSet"}function $n(n){return n?.declaredClass==="esri.arcade.Dictionary"}function bn(n){return n?.declaredRootClass==="esri.arcade.featureSetCollection"}function Nn(n){return n?.declaredClass==="esri.rest.knowledgeGraph.KnowledgeGraph"}function Z(n){return n instanceof F}function f(n){return n instanceof I}function m(n){return n instanceof _n}function h(n){return n instanceof vn}function q(n){return n!=null&&typeof n=="object"}function P(n){return n instanceof Date}function ne(n,e,r,t,a){if(n.lengthr)throw new T(t,o.WrongNumberOfParameters,a)}function ee(n){return n<0?-Math.round(-n):Math.round(n)}function rn(n,e){return isNaN(n)||e==null||e===""?n.toString():(e=w(e,"‰",""),e=w(e,"¤",""),Ln(n,{pattern:e}))}function j(n,e){return e==null||e===""?n.toISOString(!0):n.toFormat(Sn(e),{locale:cn(),numberingSystem:"latn"})}function Sn(n,e=!1){n=n.replaceAll(/LTS|LT|L{1,4}|l{1,4}/g,"[$&]");let r="";const t=/(\[[^[]*\])|(\\)?([Hh]mm(ss)?|Mo|M{1,4}|Do|DDDo|D{1,4}|d{2,4}|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?|Z{1,5}|.)/g;for(const a of n.match(t)||[])switch(a){case"D":r+="d";break;case"DD":r+="dd";break;case"DDD":r+="o";break;case"d":r+="c";break;case"ddd":r+="ccc";break;case"dddd":r+="cccc";break;case"M":r+="L";break;case"MM":r+="LL";break;case"MMM":r+="LLL";break;case"MMMM":r+="LLLL";break;case"YY":r+="yy";break;case"Y":case"YYYY":r+="yyyy";break;case"Q":r+="q";break;case"Z":r+="Z";break;case"ZZ":r+="ZZ";break;case"ZZZ":r+="ZZZ";break;case"ZZZZ":r+=e?"[ZZZZ]":"ZZZZ";break;case"ZZZZZ":r+=e?"[ZZZZZ]":"ZZZZZ";break;case"S":r+="'S'";break;case"SS":r+="'SS'";break;case"SSS":r+="u";break;case"A":case"a":r+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":r+=a;break;default:a.length>=2&&a.slice(0,1)==="["&&a.slice(-1)==="]"?r+=`'${a.slice(1,-1)}'`:r+=`'${a}'`}return r}function i(n,e,r){switch(r){case">":return n>e;case"<":return n=":return n>=e;case"<=":return n<=e}return!1}function re(n,e,r){if(n===null){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}if(n===g){if(e===null||e===g)return i(null,null,r);if(N(e))return i(0,e,r);if(y(e)||b(e))return i(0,d(e),r);if(f(e))return i(0,e.toNumber(),r);if(h(e)||m(e))return i(n,e.toNumber(),r)}else if(N(n)){if(N(e))return i(n,e,r);if(b(e))return i(n,d(e),r);if(e===null||e===g)return i(n,0,r);if(y(e))return i(n,d(e),r);if(f(e)||h(e)||m(e))return i(n,e.toNumber(),r)}else if(y(n)){if(y(e))return i(x(n),x(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(N(e))return i(d(n),e,r);if(e===null||e===g)return i(d(n),0,r);if(b(e))return i(d(n),d(e),r)}else if(f(n)){if(f(e))return n.timeZone!==e.timeZone&&(n.isUnknownTimeZone?n=I.arcadeDateAndZoneToArcadeDate(n,e.timeZone):e.isUnknownTimeZone&&(e=I.arcadeDateAndZoneToArcadeDate(e,n.timeZone))),i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(b(n)){if(b(e))return i(n,e,r);if(N(e))return i(d(n),d(e),r);if(f(e)||h(e)||m(e))return i(d(n),e.toNumber(),r);if(e===null||e===g)return i(d(n),0,r);if(y(e))return i(d(n),d(e),r)}else if(m(n)){if(f(e))return i(n.toNumber(),e.toNumber(),r);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))throw new T(null,o.CannotCompareDateAndTime,null);if(m(e))return i(n.toNumber(),e.toNumber(),r)}else if(h(n)){if(f(e))throw new T(null,o.CannotCompareDateAndTime,null);if(e===null||e===g)return i(n.toNumber(),0,r);if(N(e))return i(n.toNumber(),e,r);if(b(e)||y(e))return i(n.toNumber(),d(e),r);if(h(e))return i(n.toNumber(),e.toNumber(),r);if(m(e))throw new T(null,o.CannotCompareDateAndTime,null)}return!!Cn(n,e)&&(r==="<="||r===">=")}function Cn(n,e){if(n===e||n===null&&e===g||e===null&&n===g)return!0;if(f(n)&&f(e)||h(n)&&h(e)||m(n)&&m(e))return n.equals(e);if(n instanceof nn||n instanceof O)return n.equalityTest(e);if(n instanceof M&&e instanceof M){const r=n.cache._arcadeCacheId,t=e.cache._arcadeCacheId;if(r!=null)return r===t}return!!(q(n)&&q(e)&&(n._arcadeCacheId===e._arcadeCacheId&&n._arcadeCacheId!==void 0&&n._arcadeCacheId!==null||n._underlyingGraphic===e._underlyingGraphic&&n._underlyingGraphic!==void 0&&n._underlyingGraphic!==null))}function x(n,e){if(y(n))return n;if(n===null)return"";if(N(n))return rn(n,e);if(b(n))return n.toString();if(f(n))return j(n,e);if(h(n)||m(n))return n.toFormat(e);if(n instanceof k)return JSON.stringify(n.toJSON());if(C(n)){const r=[];for(let t=0;tt.key===a.key?0:t.key==="spatialReference"?1:a.key==="spatialReference"||t.keya.key?1:0);if(C(n)){const t=[];for(let a=0;a0)return n;return null}if(n instanceof W){if(n.paths.length===0)return null;for(const e of n.paths)if(e.length>0)return n;return null}return n instanceof Q?n.points.length===0?null:n:n instanceof X?n.xmin==="NaN"||n.xmin===null||isNaN(n.xmin)?null:n:null}function Tn(n,e){if(!n||!n.domain)return e;let r=null,t=null;if(f(e))r=e.toNumber();else if(m(e))r=e.toString();else if(h(e))r=e.toStorageString();else if(n.field.type==="string"||n.field.type==="esriFieldTypeString")r=x(e);else{if(e==null)return null;if(e==="")return e;r=d(e)}for(let a=0;aS[p]===t&&(a=S.domains?.[l.name],a&&a.type==="inherited"&&(a=ln(l.name,e),s=!0),!0)),s||a||(a=ln(n,e)),{field:l,domain:a}}function ln(n,e){let r;return e.fields.some(t=>(t.name.toLowerCase()===n.toLowerCase()&&(r=t.domain),!!r)),r}function H(n,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const r=typeof e.cycles=="boolean"&&e.cycles,t=e.cmp&&(a=e.cmp,function(l){return function(u,p){const c={key:u,value:l[u]},S={key:p,value:l[p]};return a(c,S)}});var a;const s=[];return function l(u){if(u?.toJSON&&typeof u.toJSON=="function"&&(u=u.toJSON()),u===void 0)return;if(typeof u=="number")return isFinite(u)?""+u:"null";if(typeof u!="object")return JSON.stringify(u);let p,c;if(Array.isArray(u)){for(c="[",p=0;p0&&(s=n[0].spatialReference,r=n[0].hasZ,t=n[0].hasM)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else{if(!Z(n))throw new T(null,o.InvalidParameter,null);for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:(Dn(a)||(a=a.slice().reverse()),new V({rings:[a],spatialReference:s,hasZ:r,hasM:t}))}return n}function de(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new W({paths:[a],spatialReference:s,hasZ:r,hasM:t})}return n}function pe(n,e){if(C(n)||Z(n)){let r=!1,t=!1,a=[],s=e;if(C(n)){for(const l of n)D(a,l);a.length>0&&(s=n[0].spatialReference,r=n[0].hasZ===!0,t=n[0].hasM===!0)}else if(n instanceof O)a=n._elements,a.length>0&&(r=n._hasZ,t=n._hasM,s=n.get(0).spatialReference);else if(Z(n)){for(const l of n.toArray())D(a,l);a.length>0&&(s=n.get(0).spatialReference,r=n.get(0).hasZ===!0,t=n.get(0).hasM===!0)}return a.length===0?null:new Q({points:a,spatialReference:s,hasZ:r,hasM:t})}return n}function me(n,e=!1){const r=[];if(n===null)return r;if(C(n)===!0){for(let t=0;t{setTimeout(()=>{e(n)},0)})):n}function ye(n,e,r){switch(r){case"&":return n&e;case"|":return n|e;case"^":return n^e;case"<<":return n<>":return n>>e;case">>>":return n>>>e}}function _(n,e=null){return n==null?null:b(n)||N(n)||y(n)?n:n instanceof k?e?.keepGeometryType===!0?n:n.toJSON():n instanceof F?n.toArray().map(r=>_(r,e)):Array.isArray(n)?n.map(r=>_(r,e)):P(n)?n:f(n)?n.toJSDate():h(n)?n.toString():m(n)?n.toJSDate():n!==null&&typeof n=="object"&&n.castAsJson!==void 0?n.castAsJson(e):null}async function ge(n,e,r,t,a){const s=await Mn(n,e,r);a[t]=s}async function Mn(n,e=null,r=null){if(n instanceof F&&(n=n.toArray()),n==null)return null;if(L(n)||n instanceof k||P(n)||f(n))return _(n,r);if(Array.isArray(n)){const t=[],a=[];for(const s of n)s===null||L(s)||s instanceof k||P(s)||f(s)?a.push(_(s,r)):(a.push(null),t.push(ge(s,e,r,a.length-1,a)));return t.length>0&&await Promise.all(t),a}return n!==null&&typeof n=="object"&&n.castAsJsonAsync!==void 0?n.castAsJsonAsync(e,r):null}function v(n){return xn(n)?n.parent:n}function xn(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.support.SubtypeSublayer"}function be(n){return n&&"declaredClass"in n&&n.declaredClass==="esri.layers.SubtypeGroupLayer"}function Ne(n,e,r){const t=v(n.fullSchema());return t===null||!t.fields?null:B(e,t,n,r)}function Se(n){const e=v(n.fullSchema());return e===null?null:e.fields?e.subtypeField?{subtypeField:e.subtypeField,subtypes:e.subtypes?e.subtypes.map(r=>({name:r.name,code:r.code})):[]}:e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(r=>({name:r.name,code:r.id})):[]}:null:null}function Ce(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;const s=B(e,a,n,t);if(r===void 0)try{r=n.field(e)}catch{return null}return Tn(s,r)}function Ae(n,e,r,t){const a=v(n.fullSchema());if(a===null||!a.fields)return null;if(r===void 0){try{r=n.field(e)}catch{return null}return r}return Fn(B(e,a,n,t),r)}function Te(n){return n?.timeZone??"system"}function Fe(n){const e=v(n.fullSchema());if(e===null||!e.fields)return null;const r=[];for(const t of e.fields)r.push(En(t));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField??"",geometryType:sn[e.geometryType]===void 0?"":sn[e.geometryType],fields:r}}function Me(n,e){return n==="system"&&(n=I.systemTimeZoneCanonicalName),{version:Zn,engineVersion:In,timeZone:n,spatialReference:e instanceof Rn?e.toJSON():e,application:wn.applicationName??"",engine:"web",locale:cn()}}const Zn="1.28",ve=Object.freeze(Object.defineProperty({__proto__:null,ImplicitResult:Gn,ReturnResult:Bn,absRound:ee,arcadeVersion:Zn,autoCastArrayOfPointsToMultiPoint:pe,autoCastArrayOfPointsToPolygon:fe,autoCastArrayOfPointsToPolyline:de,autoCastFeatureToGeometry:ce,binaryOperator:ye,breakResult:Yn,castAsJson:_,castAsJsonAsync:Mn,continueResult:qn,defaultExecutingContext:Me,defaultTimeZone:Te,defaultUndefined:Hn,equalityTest:Cn,featureDomainCodeLookup:Ae,featureDomainValueLookup:Ce,featureFullDomain:Ne,featureSchema:Fe,featureSubtypes:Se,fixNullGeometry:le,fixSpatialReference:ue,formatDate:j,formatNumber:rn,getDomain:B,getDomainCode:Fn,getDomainValue:Tn,getType:Kn,greaterThanLessThan:re,isArray:C,isBoolean:b,isDate:f,isDateOnly:m,isDictionary:$n,isFeature:yn,isFeatureSet:gn,isFeatureSetCollection:bn,isFunctionParameter:J,isGeometry:Wn,isGraphic:Qn,isImmutableArray:Z,isInteger:Vn,isJsDate:P,isKnowledgeGraph:Nn,isModule:en,isNumber:N,isObject:q,isQuery:Xn,isSimpleType:L,isString:y,isSubtypeGrouplayer:be,isSubtypeSublayer:xn,isTime:h,multiReplace:w,parseGeometryFromJson:ie,pcCheck:ne,stableStringify:H,standardiseDateFormat:Sn,tick:he,toBoolean:se,toDate:ae,toNumber:d,toNumberArray:te,toString:x,toStringArray:me,toStringExplicit:An,voidOperation:g},Symbol.toStringTag,{value:"Module"}));export{Se as $,Me as A,_e as B,C,bn as D,L as E,Nn as F,nn as G,fn as H,Kn as I,ce as J,pe as K,se as L,x as M,we as N,Vn as O,ae as P,Ce as Q,Wn as R,N as S,T,J as U,re as V,Ne as W,Ae as X,fe as Y,Z,ee as _,$n as a,ye as a0,pn as a1,hn as a2,E as a3,Y as a4,Bn as a5,Yn as a6,qn as a7,Qn as a8,Gn as a9,ve as aa,Re as ab,R as ac,un as ad,he as ae,xn as af,me as ag,B as ah,Tn as ai,Fn as aj,P as ak,b,m as c,f as d,Te as e,d as f,Hn as g,h,Sn as i,le as j,O as k,g as l,Mn as m,o as n,Cn as o,de as p,w as q,gn as r,te as s,yn as t,An as u,_ as v,ne as w,Fe as x,y,ue as z}; diff --git a/custom-toc-highlight/assets/layerViewUtils-DURAPenP-CfS78eqb.js b/custom-toc-highlight/assets/layerViewUtils-DURAPenP-BGA3o1Pf.js similarity index 83% rename from custom-toc-highlight/assets/layerViewUtils-DURAPenP-CfS78eqb.js rename to custom-toc-highlight/assets/layerViewUtils-DURAPenP-BGA3o1Pf.js index e218ff23..6d1f526b 100644 --- a/custom-toc-highlight/assets/layerViewUtils-DURAPenP-CfS78eqb.js +++ b/custom-toc-highlight/assets/layerViewUtils-DURAPenP-BGA3o1Pf.js @@ -1 +1 @@ -import"./story-BfX8CRfG.js";function r(t){return t&&typeof t.highlight=="function"}function i(t,n,u){return t==null||t>=u&&(n===0||t<=n)}function a(t,n){if(n&&t){const{minScale:u,maxScale:e}=t;if(c(u,e))return i(n,u,e)}return!0}function c(t,n){return t!=null&&t>0||n!=null&&n>0}function o(t){return!t?.minScale||!t.maxScale||t.minScale>=t.maxScale}export{r as a,a as e,o as l}; +import"./story-Doly9N9p.js";function r(t){return t&&typeof t.highlight=="function"}function i(t,n,u){return t==null||t>=u&&(n===0||t<=n)}function a(t,n){if(n&&t){const{minScale:u,maxScale:e}=t;if(c(u,e))return i(n,u,e)}return!0}function c(t,n){return t!=null&&t>0||n!=null&&n>0}function o(t){return!t?.minScale||!t.maxScale||t.minScale>=t.maxScale}export{r as a,a as e,o as l}; diff --git a/custom-toc-highlight/assets/layersCreator-CW56kDKc-BGMnYi1N.js b/custom-toc-highlight/assets/layersCreator-CW56kDKc-CkfoFLoQ.js similarity index 90% rename from custom-toc-highlight/assets/layersCreator-CW56kDKc-BGMnYi1N.js rename to custom-toc-highlight/assets/layersCreator-CW56kDKc-CkfoFLoQ.js index 96dcf973..e114d238 100644 --- a/custom-toc-highlight/assets/layersCreator-CW56kDKc-BGMnYi1N.js +++ b/custom-toc-highlight/assets/layersCreator-CW56kDKc-CkfoFLoQ.js @@ -1 +1 @@ -import{ag as f}from"./story-BfX8CRfG.js";import{L as M,e as A}from"./portalLayers-Bh9bAhk4-BP6A8Lj4.js";import{p as n}from"./fetchService-DbaKmJhP-W7rGyykJ.js";import d from"./PortalItem-CctGdnxF-C7IJrZYq.js";import{g as b}from"./styleUtils-ChrJTYIw-BfDrXrWd.js";import"./main-ugzBrWNm.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";function w(e){return p(e,"notes")}function v(e){return p(e,"markup")}function h(e){return p(e,"route")}function p(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function C(e,r,y){if(!r)return;const a=r.map(t=>U(t,y)),i=await Promise.allSettled(a);for(const t of i)t.status==="rejected"||t.value&&e.add(t.value)}const F={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},W={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},O={ArcGISFeatureLayer:"FeatureLayer"},V={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},I={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},g={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},m={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},k={...I,LinkChartLayer:"LinkChartLayer"},B={...g},D={...m};async function U(e,r){return E(await x(e,r),e,r)}async function E(e,r,y){const a=new e;return a.read(r,y.context),a.type==="group"&&(r.layerType==="GroupLayer"?await K(a,r,y):u(r)?N(a,r,y.context):T(r)&&await $(a,r,y.context)),await b(a,y.context),a}async function x(e,r){const y=r.context,a=R(y);let i=e.layerType||e.type;!i&&r?.defaultLayerType&&(i=r.defaultLayerType);const t=a[i];let L=t?n[t]:n.UnknownLayer;if(u(e)){const l=y?.portal;if(e.itemId){const o=new d({id:e.itemId,portal:l});await o.load();const s=(await M(o,new A)).className||"UnknownLayer";L=n[s]}}else i==="ArcGISFeatureLayer"?w(e)||v(e)?L=n.MapNotesLayer:h(e)?L=n.RouteLayer:T(e)&&(L=n.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?L=n.WMTSLayer:i==="WFS"&&e.wfsInfo?.version!=="2.0.0"&&(L=n.UnsupportedLayer);return L()}function T(e){return e.layerType!=="ArcGISFeatureLayer"||u(e)?!1:(e.featureCollection?.layers?.length??0)>1}function u(e){return e.type==="Feature Collection"}function R(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=V;break;case"ground":r=W;break;case"tables":r=O;break;default:r=F}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=D;break;case"tables":r=B;break;default:r=k}break;default:switch(e.layerContainerType){case"basemap":r=m;break;case"tables":r=g;break;default:r=I}}return r}async function K(e,r,y){const a=new f,i=C(a,Array.isArray(r.layers)?r.layers:[],y);try{try{if(await i,e.type==="group")return e.layers.addMany(a),e}catch(t){e.destroy();for(const L of a)L.destroy();throw t}}catch(t){throw t}}function N(e,r,y){r.itemId&&(e.portalItem=new d({id:r.itemId,portal:y?.portal}),e.when(()=>{const a=i=>{const t=i.layerId;G(i,e,r,t,y);const L=r.featureCollection?.layers?.[t];L&&i.read(L,y)};e.layers?.forEach(a),e.tables?.forEach(a)}))}async function $(e,r,y){const a=n.FeatureLayer,i=await a(),t=r.featureCollection,L=t?.showLegend,l=t?.layers?.map((o,s)=>{const c=new i;c.read(o,y);const S={...y,ignoreDefaults:!0};return G(c,e,r,s,S),L!=null&&c.read({showLegend:L},S),c});e.layers.addMany(l??[])}function G(e,r,y,a,i){e.read({id:`${r.id}-sublayer-${a}`,visibility:y.visibleLayers?.includes(a)??!0},i)}export{K as populateGroupLayer,C as populateOperationalLayers}; +import{ag as f}from"./story-Doly9N9p.js";import{L as M,e as A}from"./portalLayers-Bh9bAhk4-Y1T2RWf3.js";import{p as n}from"./fetchService-DbaKmJhP-Ccg-phWf.js";import d from"./PortalItem-CctGdnxF-CfFOGshS.js";import{g as b}from"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import"./main-QGPoLsvl.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";function w(e){return p(e,"notes")}function v(e){return p(e,"markup")}function h(e){return p(e,"route")}function p(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function C(e,r,y){if(!r)return;const a=r.map(t=>U(t,y)),i=await Promise.allSettled(a);for(const t of i)t.status==="rejected"||t.value&&e.add(t.value)}const F={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},W={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},O={ArcGISFeatureLayer:"FeatureLayer"},V={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},I={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},g={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"UnsupportedLayer"},m={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",DefaultTileLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},k={...I,LinkChartLayer:"LinkChartLayer"},B={...g},D={...m};async function U(e,r){return E(await x(e,r),e,r)}async function E(e,r,y){const a=new e;return a.read(r,y.context),a.type==="group"&&(r.layerType==="GroupLayer"?await K(a,r,y):u(r)?N(a,r,y.context):T(r)&&await $(a,r,y.context)),await b(a,y.context),a}async function x(e,r){const y=r.context,a=R(y);let i=e.layerType||e.type;!i&&r?.defaultLayerType&&(i=r.defaultLayerType);const t=a[i];let L=t?n[t]:n.UnknownLayer;if(u(e)){const l=y?.portal;if(e.itemId){const o=new d({id:e.itemId,portal:l});await o.load();const s=(await M(o,new A)).className||"UnknownLayer";L=n[s]}}else i==="ArcGISFeatureLayer"?w(e)||v(e)?L=n.MapNotesLayer:h(e)?L=n.RouteLayer:T(e)&&(L=n.GroupLayer):e.wmtsInfo?.url&&e.wmtsInfo.layerIdentifier?L=n.WMTSLayer:i==="WFS"&&e.wfsInfo?.version!=="2.0.0"&&(L=n.UnsupportedLayer);return L()}function T(e){return e.layerType!=="ArcGISFeatureLayer"||u(e)?!1:(e.featureCollection?.layers?.length??0)>1}function u(e){return e.type==="Feature Collection"}function R(e){let r;switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap":r=V;break;case"ground":r=W;break;case"tables":r=O;break;default:r=F}break;case"link-chart":switch(e.layerContainerType){case"basemap":r=D;break;case"tables":r=B;break;default:r=k}break;default:switch(e.layerContainerType){case"basemap":r=m;break;case"tables":r=g;break;default:r=I}}return r}async function K(e,r,y){const a=new f,i=C(a,Array.isArray(r.layers)?r.layers:[],y);try{try{if(await i,e.type==="group")return e.layers.addMany(a),e}catch(t){e.destroy();for(const L of a)L.destroy();throw t}}catch(t){throw t}}function N(e,r,y){r.itemId&&(e.portalItem=new d({id:r.itemId,portal:y?.portal}),e.when(()=>{const a=i=>{const t=i.layerId;G(i,e,r,t,y);const L=r.featureCollection?.layers?.[t];L&&i.read(L,y)};e.layers?.forEach(a),e.tables?.forEach(a)}))}async function $(e,r,y){const a=n.FeatureLayer,i=await a(),t=r.featureCollection,L=t?.showLegend,l=t?.layers?.map((o,s)=>{const c=new i;c.read(o,y);const S={...y,ignoreDefaults:!0};return G(c,e,r,s,S),L!=null&&c.read({showLegend:L},S),c});e.layers.addMany(l??[])}function G(e,r,y,a,i){e.read({id:`${r.id}-sublayer-${a}`,visibility:y.visibleLayers?.includes(a)??!0},i)}export{K as populateGroupLayer,C as populateOperationalLayers}; diff --git a/custom-toc-highlight/assets/layersLoader-CYI-LpLl-CLVN0BVs.js b/custom-toc-highlight/assets/layersLoader-CYI-LpLl-CUvaEb6F.js similarity index 87% rename from custom-toc-highlight/assets/layersLoader-CYI-LpLl-CLVN0BVs.js rename to custom-toc-highlight/assets/layersLoader-CYI-LpLl-CUvaEb6F.js index 42dd9719..d5ac7646 100644 --- a/custom-toc-highlight/assets/layersLoader-CYI-LpLl-CLVN0BVs.js +++ b/custom-toc-highlight/assets/layersLoader-CYI-LpLl-CUvaEb6F.js @@ -1 +1 @@ -import{o as p,r as S}from"./story-BfX8CRfG.js";import{i as T}from"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import{o as L,p as v,d as F}from"./fetchService-DbaKmJhP-W7rGyykJ.js";import{l as y,a as $,o as M,u as m,t as f,c as P,n as x,i as D,e as w}from"./portalLayers-Bh9bAhk4-BP6A8Lj4.js";import{populateGroupLayer as G}from"./layersCreator-CW56kDKc-BGMnYi1N.js";import{a as h}from"./jsonContext-BA8GHqVk-CWQlLGSw.js";import{o as k}from"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import{g as E}from"./styleUtils-ChrJTYIw-BfDrXrWd.js";import"./main-ugzBrWNm.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";async function oe(t,a){const r=t.instance.portalItem;if(r?.id)return await r.load(a),O(t),t.validateItem&&t.validateItem(r),R(t,a)}function O(t){const a=t.instance.portalItem;if(!a?.type||!t.supportedTypes.includes(a.type))throw new p("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:a?.type,expectedType:t.supportedTypes.join(", ")})}async function R(t,a){const r=t.instance,e=r.portalItem;if(!e)return;const{url:o,title:s}=e,n=h(e,"portal-item");if(r.type==="group")return j(r,n,t);o&&r.type!=="media"&&r.read({url:o},n);const l=new w,i=await I(t,l,a);return i&&r.read(i,n),r.resourceReferences={portalItem:e,paths:n.readResourcePaths??[]},r.type!=="subtype-group"&&r.read({title:s},n),E(r,n)}async function j(t,a,r){const e=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:o,type:s}=e;if(s==="Group Layer"){if(!k(e,"Map"))throw new p("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return A(t)}return t.read({title:o},a),C(t,r)}async function A(t){const a=t.portalItem,r=await a.fetchData("json");if(!r)return;const e=h(a,"web-map");t.read(r,e),await G(t,r,{context:e}),t.resourceReferences={portalItem:a,paths:e.readResourcePaths??[]}}async function C(t,a){let r;const{portalItem:e}=t;if(!e)return;const o=e.type,s=a.layerModuleTypeMap;switch(o){case"Feature Service":case"Feature Collection":r=s.FeatureLayer;break;case"Stream Service":r=s.StreamLayer;break;case"Scene Service":r=s.SceneLayer;break;default:throw new p("portal:unsupported-item-type-as-group",`The item type '${o}' is not supported as a 'IGroupLayer'`)}const n=new w;let[l,i]=await Promise.all([r(),I(a,n)]),c=()=>l;if(o==="Feature Service"){const g=y(i)?.customParameters;i=e.url?await $(i,e.url,n):{},c=await K(i,s)||c;const b=await H(e.url,{customParameters:g,loadContext:n});return await u(t,c,i,b)}return o==="Scene Service"&&e.url&&(i=await M(e,i,n)),m(i)>0?await u(t,c,i):await J(t,c)}async function J(t,a){const{portalItem:r}=t;if(!r?.url)return;const e=await L(r.url);e&&u(t,a,{layers:e.layers?.map(f),tables:e.tables?.map(f)})}async function u(t,a,r,e){let o=r.layers||[];const s=r.tables||[];if(t.portalItem?.type==="Feature Collection"?(o.forEach((n,l)=>{n.id=l,n?.layerDefinition?.type==="Table"&&s.push(n)}),o=o.filter(n=>n?.layerDefinition?.type!=="Table")):(o.reverse(),s.reverse()),o.forEach(n=>{const l=e?.(n);if(l||!e){const i=d(t,a(n),r,n,l);t.add(i)}}),s.length){const n=await v.FeatureLayer();s.forEach(l=>{const i=e?.(l);if(i||!e){const c=d(t,n,r,l,i);t.tables.add(c)}})}}function d(t,a,r,e,o){const s=t.portalItem,n={portalItem:s.clone(),layerId:e.id};e.url!=null&&(n.url=e.url);const l=new a(n);if("sourceJSON"in l&&(l.sourceJSON=o),l.type!=="subtype-group"&&l.type!=="catalog"&&(l.sublayerTitleMode="service-name"),s.type==="Feature Collection"){const i={origin:"portal-item",portal:s.portal||S.getDefault()};l.read(e,i);const c=r.showLegend;c!=null&&l.read({showLegend:c},i)}return l}async function I(t,a,r){if(t.supportsData===!1)return;const e=t.instance,o=e.portalItem;if(!o)return;let s=null;try{s=await o.fetchData("json",r)}catch{}if(z(e)){let n=null;const l=await N(o,s,a);if((s?.layers||s?.tables)&&l>0){if(e.layerId==null){const i=P(e.type),c=i?x(s,i)[0]:y(s);c&&(e.layerId=c.id)}n=q(s,e),n?.layerType==="OrientedImageryLayer"&&e.type==="oriented-imagery"&&e.supportedSourceTypes.add("Feature Layer"),n&&s.showLegend!=null&&(n.showLegend=s.showLegend)}return l>1&&"sublayerTitleMode"in e&&e.sublayerTitleMode!=="service-name"&&(e.sublayerTitleMode="item-title-and-service-name"),n}return s}async function N(t,a,r){if(a?.layers&&a?.tables)return m(a);const e=T(t.url);if(!e)return 1;const o=await r.fetchServiceMetadata(e.url.path,{customParameters:y(a)?.customParameters}).catch(()=>null);return(a?.layers?.length??o?.layers?.length??0)+(a?.tables?.length??o?.tables?.length??0)}function q(t,a){const{layerId:r}=a,e=t.layers?.find(o=>o.id===r)||t.tables?.find(o=>o.id===r);return e&&B(e,a)?e:null}function z(t){return t.type!=="stream"&&"layerId"in t}function B(t,a){const r="layerType"in t&&t.layerType,{type:e}=a;return!(e==="feature"&&r&&t.layerType!=="ArcGISFeatureLayer"||e==="catalog"&&!r||e==="oriented-imagery"&&!r||e==="subtype-group"&&!r)}async function H(t,a){const{layersJSON:r}=await F(t,a);if(!r)return null;const e=[...r.layers,...r.tables];return o=>e.find(s=>s.id===o.id)}async function K(t,a){const{layers:r}=t;if(!r?.length)return;const e=new Set,o=[];for(const{layerType:l}of r){const i=l??"ArcGISFeatureLayer";if(e.has(i))continue;e.add(i);const c=a[D(i)];o.push(c())}const s=await Promise.all(o),n=new Map;return Array.from(e).forEach((l,i)=>{n.set(l,s[i])}),({layerType:l})=>{const i=l??"ArcGISFeatureLayer";return n.get(i)}}export{oe as load}; +import{o as p,r as S}from"./story-Doly9N9p.js";import{i as T}from"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import{o as L,p as v,d as F}from"./fetchService-DbaKmJhP-Ccg-phWf.js";import{l as y,a as $,o as M,u as m,t as f,c as P,n as x,i as D,e as w}from"./portalLayers-Bh9bAhk4-Y1T2RWf3.js";import{populateGroupLayer as G}from"./layersCreator-CW56kDKc-CkfoFLoQ.js";import{a as h}from"./jsonContext-BA8GHqVk-BsXRY5es.js";import{o as k}from"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import{g as E}from"./styleUtils-ChrJTYIw-C6xq7Jeu.js";import"./main-QGPoLsvl.js";import"./associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";async function oe(t,a){const r=t.instance.portalItem;if(r?.id)return await r.load(a),O(t),t.validateItem&&t.validateItem(r),R(t,a)}function O(t){const a=t.instance.portalItem;if(!a?.type||!t.supportedTypes.includes(a.type))throw new p("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:a?.type,expectedType:t.supportedTypes.join(", ")})}async function R(t,a){const r=t.instance,e=r.portalItem;if(!e)return;const{url:o,title:s}=e,n=h(e,"portal-item");if(r.type==="group")return j(r,n,t);o&&r.type!=="media"&&r.read({url:o},n);const l=new w,i=await I(t,l,a);return i&&r.read(i,n),r.resourceReferences={portalItem:e,paths:n.readResourcePaths??[]},r.type!=="subtype-group"&&r.read({title:s},n),E(r,n)}async function j(t,a,r){const e=t.portalItem;if(!t.sourceIsPortalItem)return;const{title:o,type:s}=e;if(s==="Group Layer"){if(!k(e,"Map"))throw new p("portal:invalid-layer-item-typekeyword","'Group Layer' item without 'Map' type keyword is not supported");return A(t)}return t.read({title:o},a),C(t,r)}async function A(t){const a=t.portalItem,r=await a.fetchData("json");if(!r)return;const e=h(a,"web-map");t.read(r,e),await G(t,r,{context:e}),t.resourceReferences={portalItem:a,paths:e.readResourcePaths??[]}}async function C(t,a){let r;const{portalItem:e}=t;if(!e)return;const o=e.type,s=a.layerModuleTypeMap;switch(o){case"Feature Service":case"Feature Collection":r=s.FeatureLayer;break;case"Stream Service":r=s.StreamLayer;break;case"Scene Service":r=s.SceneLayer;break;default:throw new p("portal:unsupported-item-type-as-group",`The item type '${o}' is not supported as a 'IGroupLayer'`)}const n=new w;let[l,i]=await Promise.all([r(),I(a,n)]),c=()=>l;if(o==="Feature Service"){const g=y(i)?.customParameters;i=e.url?await $(i,e.url,n):{},c=await K(i,s)||c;const b=await H(e.url,{customParameters:g,loadContext:n});return await u(t,c,i,b)}return o==="Scene Service"&&e.url&&(i=await M(e,i,n)),m(i)>0?await u(t,c,i):await J(t,c)}async function J(t,a){const{portalItem:r}=t;if(!r?.url)return;const e=await L(r.url);e&&u(t,a,{layers:e.layers?.map(f),tables:e.tables?.map(f)})}async function u(t,a,r,e){let o=r.layers||[];const s=r.tables||[];if(t.portalItem?.type==="Feature Collection"?(o.forEach((n,l)=>{n.id=l,n?.layerDefinition?.type==="Table"&&s.push(n)}),o=o.filter(n=>n?.layerDefinition?.type!=="Table")):(o.reverse(),s.reverse()),o.forEach(n=>{const l=e?.(n);if(l||!e){const i=d(t,a(n),r,n,l);t.add(i)}}),s.length){const n=await v.FeatureLayer();s.forEach(l=>{const i=e?.(l);if(i||!e){const c=d(t,n,r,l,i);t.tables.add(c)}})}}function d(t,a,r,e,o){const s=t.portalItem,n={portalItem:s.clone(),layerId:e.id};e.url!=null&&(n.url=e.url);const l=new a(n);if("sourceJSON"in l&&(l.sourceJSON=o),l.type!=="subtype-group"&&l.type!=="catalog"&&(l.sublayerTitleMode="service-name"),s.type==="Feature Collection"){const i={origin:"portal-item",portal:s.portal||S.getDefault()};l.read(e,i);const c=r.showLegend;c!=null&&l.read({showLegend:c},i)}return l}async function I(t,a,r){if(t.supportsData===!1)return;const e=t.instance,o=e.portalItem;if(!o)return;let s=null;try{s=await o.fetchData("json",r)}catch{}if(z(e)){let n=null;const l=await N(o,s,a);if((s?.layers||s?.tables)&&l>0){if(e.layerId==null){const i=P(e.type),c=i?x(s,i)[0]:y(s);c&&(e.layerId=c.id)}n=q(s,e),n?.layerType==="OrientedImageryLayer"&&e.type==="oriented-imagery"&&e.supportedSourceTypes.add("Feature Layer"),n&&s.showLegend!=null&&(n.showLegend=s.showLegend)}return l>1&&"sublayerTitleMode"in e&&e.sublayerTitleMode!=="service-name"&&(e.sublayerTitleMode="item-title-and-service-name"),n}return s}async function N(t,a,r){if(a?.layers&&a?.tables)return m(a);const e=T(t.url);if(!e)return 1;const o=await r.fetchServiceMetadata(e.url.path,{customParameters:y(a)?.customParameters}).catch(()=>null);return(a?.layers?.length??o?.layers?.length??0)+(a?.tables?.length??o?.tables?.length??0)}function q(t,a){const{layerId:r}=a,e=t.layers?.find(o=>o.id===r)||t.tables?.find(o=>o.id===r);return e&&B(e,a)?e:null}function z(t){return t.type!=="stream"&&"layerId"in t}function B(t,a){const r="layerType"in t&&t.layerType,{type:e}=a;return!(e==="feature"&&r&&t.layerType!=="ArcGISFeatureLayer"||e==="catalog"&&!r||e==="oriented-imagery"&&!r||e==="subtype-group"&&!r)}async function H(t,a){const{layersJSON:r}=await F(t,a);if(!r)return null;const e=[...r.layers,...r.tables];return o=>e.find(s=>s.id===o.id)}async function K(t,a){const{layers:r}=t;if(!r?.length)return;const e=new Set,o=[];for(const{layerType:l}of r){const i=l??"ArcGISFeatureLayer";if(e.has(i))continue;e.add(i);const c=a[D(i)];o.push(c())}const s=await Promise.all(o),n=new Map;return Array.from(e).forEach((l,i)=>{n.set(l,s[i])}),({layerType:l})=>{const i=l??"ArcGISFeatureLayer";return n.get(i)}}export{oe as load}; diff --git a/custom-toc-highlight/assets/lengthUtils-DKpMe5qR-C2NPRwwl.js b/custom-toc-highlight/assets/lengthUtils-DKpMe5qR-CsqJSDh_.js similarity index 87% rename from custom-toc-highlight/assets/lengthUtils-DKpMe5qR-C2NPRwwl.js rename to custom-toc-highlight/assets/lengthUtils-DKpMe5qR-CsqJSDh_.js index 1563129e..48b54fe8 100644 --- a/custom-toc-highlight/assets/lengthUtils-DKpMe5qR-C2NPRwwl.js +++ b/custom-toc-highlight/assets/lengthUtils-DKpMe5qR-CsqJSDh_.js @@ -1 +1 @@ -import{di as e,dj as s,dk as t}from"./story-BfX8CRfG.js";const r={unknown:1,inches:e(1,"meters","inches"),feet:e(1,"meters","feet"),"us-feet":e(1,"meters","us-feet"),yards:e(1,"meters","yards"),miles:e(1,"meters","miles"),"nautical-miles":e(1,"meters","nautical-miles"),millimeters:e(1,"meters","millimeters"),centimeters:e(1,"meters","centimeters"),decimeters:e(1,"meters","decimeters"),meters:e(1,"meters","meters"),kilometers:e(1,"meters","kilometers"),"decimal-degrees":1/s(1,"meters",t.radius)};export{r as m}; +import{di as e,dj as s,dk as t}from"./story-Doly9N9p.js";const r={unknown:1,inches:e(1,"meters","inches"),feet:e(1,"meters","feet"),"us-feet":e(1,"meters","us-feet"),yards:e(1,"meters","yards"),miles:e(1,"meters","miles"),"nautical-miles":e(1,"meters","nautical-miles"),millimeters:e(1,"meters","millimeters"),centimeters:e(1,"meters","centimeters"),decimeters:e(1,"meters","decimeters"),meters:e(1,"meters","meters"),kilometers:e(1,"meters","kilometers"),"decimal-degrees":1/s(1,"meters",t.radius)};export{r as m}; diff --git a/custom-toc-highlight/assets/lineSegment-CcqvCARM-CF4YE8GC.js b/custom-toc-highlight/assets/lineSegment-CcqvCARM-CDEWcAzV.js similarity index 66% rename from custom-toc-highlight/assets/lineSegment-CcqvCARM-CF4YE8GC.js rename to custom-toc-highlight/assets/lineSegment-CcqvCARM-CDEWcAzV.js index e4ae7879..93bfd2ce 100644 --- a/custom-toc-highlight/assets/lineSegment-CcqvCARM-CF4YE8GC.js +++ b/custom-toc-highlight/assets/lineSegment-CcqvCARM-CDEWcAzV.js @@ -1 +1 @@ -import{i8 as v,dg as m,ae as a}from"./story-BfX8CRfG.js";import{X as y}from"./sphere-BenPORjV-DaZ5Vv8x.js";import{r as u,y as c,L as s,v as d,j as A,A as q}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{f as g}from"./plane-Dt8R0KeE-CVSP2GQG.js";function p(o){return o?{origin:v(o.origin),vector:v(o.vector)}:{origin:m(),vector:m()}}function b(o,r,t=p()){return q(t.origin,o),u(t.vector,r,o),t}function h(o,r){const t=u(g.get(),r,o.origin),f=c(o.vector,t),i=c(o.vector,o.vector),n=a(f/i,0,1),e=u(g.get(),s(g.get(),o.vector,n),t);return c(e,e)}function k(o,r,t){return w(o,r,0,1,t)}function w(o,r,t,f,i){const{vector:n,origin:e}=o,j=u(g.get(),r,e),x=c(n,j)/d(n);return s(i,n,a(x,t,f)),A(i,i,o.origin)}new y(()=>p());export{w as j,b as q,p as u,h as x,k as y}; +import{i8 as v,dg as m,ae as a}from"./story-Doly9N9p.js";import{X as y}from"./sphere-BenPORjV-B4uz1SYF.js";import{r as u,y as c,L as s,v as d,j as A,A as q}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{f as g}from"./plane-Dt8R0KeE-Bqc6oVGz.js";function p(o){return o?{origin:v(o.origin),vector:v(o.vector)}:{origin:m(),vector:m()}}function b(o,r,t=p()){return q(t.origin,o),u(t.vector,r,o),t}function h(o,r){const t=u(g.get(),r,o.origin),f=c(o.vector,t),i=c(o.vector,o.vector),n=a(f/i,0,1),e=u(g.get(),s(g.get(),o.vector,n),t);return c(e,e)}function k(o,r,t){return w(o,r,0,1,t)}function w(o,r,t,f,i){const{vector:n,origin:e}=o,j=u(g.get(),r,e),x=c(n,j)/d(n);return s(i,n,a(x,t,f)),A(i,i,o.origin)}new y(()=>p());export{w as j,b as q,p as u,h as x,k as y}; diff --git a/custom-toc-highlight/assets/loadAll-e978YItg-CdtGGDtb.js b/custom-toc-highlight/assets/loadAll-e978YItg-4pMG3qU7.js similarity index 87% rename from custom-toc-highlight/assets/loadAll-e978YItg-CdtGGDtb.js rename to custom-toc-highlight/assets/loadAll-e978YItg-4pMG3qU7.js index 00b3efae..6b08e78d 100644 --- a/custom-toc-highlight/assets/loadAll-e978YItg-CdtGGDtb.js +++ b/custom-toc-highlight/assets/loadAll-e978YItg-4pMG3qU7.js @@ -1 +1 @@ -import{cC as c,ag as e,aB as f,b6 as u}from"./story-BfX8CRfG.js";async function p(n,t){return await n.load(),y(n,t)}async function y(n,t){const i=[],l=(...o)=>{for(const a of o)a!=null&&(Array.isArray(a)?l(...a):e.isCollection(a)?a.forEach(s=>l(s)):f.isLoadable(a)&&i.push(a))};t(l);let r=null;if(await c(i,async o=>{const a=await u(d(o)?o.loadAll():o.load());a.ok!==!1||r||(r=a)}),r)throw r.error;return n}function d(n){return"loadAll"in n&&typeof n.loadAll=="function"}export{y as s,p as y}; +import{cC as c,ag as e,aB as f,b6 as u}from"./story-Doly9N9p.js";async function p(n,t){return await n.load(),y(n,t)}async function y(n,t){const i=[],l=(...o)=>{for(const a of o)a!=null&&(Array.isArray(a)?l(...a):e.isCollection(a)?a.forEach(s=>l(s)):f.isLoadable(a)&&i.push(a))};t(l);let r=null;if(await c(i,async o=>{const a=await u(d(o)?o.loadAll():o.load());a.ok!==!1||r||(r=a)}),r)throw r.error;return n}function d(n){return"loadAll"in n&&typeof n.loadAll=="function"}export{y as s,p as y}; diff --git a/custom-toc-highlight/assets/loadGLTFMesh-C3-0Tu0H-B2ltp3ha.js b/custom-toc-highlight/assets/loadGLTFMesh-C3-0Tu0H-DZasI2OI.js similarity index 77% rename from custom-toc-highlight/assets/loadGLTFMesh-C3-0Tu0H-B2ltp3ha.js rename to custom-toc-highlight/assets/loadGLTFMesh-C3-0Tu0H-DZasI2OI.js index c0e5cdcc..c7d5bb77 100644 --- a/custom-toc-highlight/assets/loadGLTFMesh-C3-0Tu0H-B2ltp3ha.js +++ b/custom-toc-highlight/assets/loadGLTFMesh-C3-0Tu0H-DZasI2OI.js @@ -1,4 +1,4 @@ -import{o as G,f as P,an as j,ar as C,hf as R,hZ as L,B as U}from"./story-BfX8CRfG.js";import{U as z,P as k}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as S}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{e as D}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{G as V,m as q,z as N,V as K}from"./Mesh-DLzjDUIO-COeC-iS-.js";import{o as Q}from"./MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js";import{x as $}from"./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js";import{X as F,L as I,C as X,g as A,l as O,M as Z,m as H,p as J}from"./BufferView-PQoE3GL7-Duht5lAO.js";import{q as W,v as Y,R as tt,x as E}from"./vec3-BazNroeq-PdcGTXFi.js";import{T as et,k as rt,A as M}from"./vec4-DWDdg1fj-BagfV9qf.js";import{c as ot}from"./types-ChhhI6OU-Cxh6dPlX.js";import{loadGLTF as nt}from"./loader-CkLCe-E_-QWQrU9Z8.js";import{U as st,E as it,h as at,g as b,m as lt,_ as ut,b as ct,B as ft,k as mt}from"./DefaultMaterial_COLOR_GAMMA-D0o2czi9-9voYmtHA.js";import{b as pt}from"./vertexSpaceConversion-CiKaVq_u-D2kQTb17.js";import{f as dt}from"./resourceUtils-Ds65naCv-jCWWLIQy.js";import{G as v}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./main-ugzBrWNm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./MeshTransform-C--IG09w-DoQndDth.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BrXZAXDf.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-BuNk6xPZ.js";import"./plane-Dt8R0KeE-CVSP2GQG.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./deduplicate-D2d-E5Pw-CQcmF3ab.js";import"./projectPointToVector-B2UUY9SE-BChPjj6-.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import"./External-D_wl4XAw-P7VLSnKi.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function xt(t,e,r){const l=t.typedBuffer,n=t.typedBufferStride,i=e.typedBuffer,c=e.typedBufferStride,a=r?r.count:e.count;let s=(r?.dstIndex??0)*n,m=(r?.srcIndex??0)*c;for(let u=0;uc.set(h,bt(g))),n.materials.forEach((g,h)=>a.set(h,vt(g,c)));const s=ht(i);for(const g of s.parts)wt(s,g,a);const{position:m,normal:u,tangent:o,color:f,texCoord0:p}=s.vertexAttributes,d=$(t,r),w=t.spatialReference.isGeographic?$(t):d,B=pt({vertexAttributes:{position:m.typedBuffer,normal:u?.typedBuffer,tangent:o?.typedBuffer},vertexSpace:w,spatialReference:t.spatialReference},d,{allowBufferReuse:!0,sourceUnit:r?.unitConversionDisabled?void 0:"meters"});if(!B)throw new G("load-gltf-mesh:vertex-space-projection",`Failed to load mesh from glTF because we could not convert the vertex space from ${w.type} to ${d.type}`);return{transform:null,vertexSpace:d,components:s.components,spatialReference:t.spatialReference,vertexAttributes:new Q({...B,color:f?.typedBuffer,uv:p?.typedBuffer})}}function yt(t){const e=t?.resolveFile;return e?{busy:!1,request:async(r,l,n)=>{const i=e?.(r)??r;return(await P(i,{responseType:l==="image"?"image":l==="binary"||l==="image+type"?"array-buffer":"json",signal:n?.signal,timeout:0})).data}}:null}function T(t,e){if(t==null)return"-";const r=t.typedBuffer;return`${j(e,r.buffer,()=>e.size)}/${r.byteOffset}/${r.byteLength}`}function Tt(t){return t!=null?t.toString():"-"}function ht(t){let e=0;const r={color:!1,tangent:!1,normal:!1,texCoord0:!1},l=new Map,n=new Map,i=[];for(const c of t.parts){const{attributes:{position:a,normal:s,color:m,tangent:u,texCoord0:o}}=c,f=` +import{o as G,f as P,an as j,ar as C,hf as R,hZ as L,B as U}from"./story-Doly9N9p.js";import{U as z,P as k}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as S}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{e as D}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{G as V,m as q,z as N,V as K}from"./Mesh-DLzjDUIO-BwXS6N6_.js";import{o as Q}from"./MeshVertexAttributes-CbNpPur2-c8zcl8rF.js";import{x as $}from"./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js";import{X as F,L as I,C as X,g as A,l as O,M as Z,m as H,p as J}from"./BufferView-PQoE3GL7-B9DLdqO9.js";import{q as W,v as Y,R as tt,x as E}from"./vec3-BazNroeq-CRjQH4Pj.js";import{T as et,k as rt,A as M}from"./vec4-DWDdg1fj-BHg6FqkT.js";import{c as ot}from"./types-ChhhI6OU-Cxh6dPlX.js";import{loadGLTF as nt}from"./loader-CkLCe-E_-BkhKaKBj.js";import{U as st,E as it,h as at,g as b,m as lt,_ as ut,b as ct,B as ft,k as mt}from"./DefaultMaterial_COLOR_GAMMA-D0o2czi9-k4xDAsKM.js";import{b as pt}from"./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js";import{f as dt}from"./resourceUtils-Ds65naCv-PY5SfRMU.js";import{G as v}from"./enums-DBi1-Mm2-CUS1pvQe.js";import"./main-QGPoLsvl.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./MeshTransform-C--IG09w-Bbqagf1g.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BQk2dgMZ.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-cFTwC5-9.js";import"./plane-Dt8R0KeE-Bqc6oVGz.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./deduplicate-D2d-E5Pw-CTlujluz.js";import"./projectPointToVector-B2UUY9SE-BIKNGLey.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js";import"./External-D_wl4XAw-DrOy4LUr.js";import"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function xt(t,e,r){const l=t.typedBuffer,n=t.typedBufferStride,i=e.typedBuffer,c=e.typedBufferStride,a=r?r.count:e.count;let s=(r?.dstIndex??0)*n,m=(r?.srcIndex??0)*c;for(let u=0;uc.set(h,bt(g))),n.materials.forEach((g,h)=>a.set(h,vt(g,c)));const s=ht(i);for(const g of s.parts)wt(s,g,a);const{position:m,normal:u,tangent:o,color:f,texCoord0:p}=s.vertexAttributes,d=$(t,r),w=t.spatialReference.isGeographic?$(t):d,B=pt({vertexAttributes:{position:m.typedBuffer,normal:u?.typedBuffer,tangent:o?.typedBuffer},vertexSpace:w,spatialReference:t.spatialReference},d,{allowBufferReuse:!0,sourceUnit:r?.unitConversionDisabled?void 0:"meters"});if(!B)throw new G("load-gltf-mesh:vertex-space-projection",`Failed to load mesh from glTF because we could not convert the vertex space from ${w.type} to ${d.type}`);return{transform:null,vertexSpace:d,components:s.components,spatialReference:t.spatialReference,vertexAttributes:new Q({...B,color:f?.typedBuffer,uv:p?.typedBuffer})}}function yt(t){const e=t?.resolveFile;return e?{busy:!1,request:async(r,l,n)=>{const i=e?.(r)??r;return(await P(i,{responseType:l==="image"?"image":l==="binary"||l==="image+type"?"array-buffer":"json",signal:n?.signal,timeout:0})).data}}:null}function T(t,e){if(t==null)return"-";const r=t.typedBuffer;return`${j(e,r.buffer,()=>e.size)}/${r.byteOffset}/${r.byteLength}`}function Tt(t){return t!=null?t.toString():"-"}function ht(t){let e=0;const r={color:!1,tangent:!1,normal:!1,texCoord0:!1},l=new Map,n=new Map,i=[];for(const c of t.parts){const{attributes:{position:a,normal:s,color:m,tangent:u,texCoord0:o}}=c,f=` ${T(a,l)}/ ${T(s,l)}/ ${T(m,l)}/ diff --git a/custom-toc-highlight/assets/loadable-DbNDKH4r-D4CSNQAA.js b/custom-toc-highlight/assets/loadable-DbNDKH4r-CSXrQx_7.js similarity index 80% rename from custom-toc-highlight/assets/loadable-DbNDKH4r-D4CSNQAA.js rename to custom-toc-highlight/assets/loadable-DbNDKH4r-CSXrQx_7.js index 3b9afe38..d7da2054 100644 --- a/custom-toc-highlight/assets/loadable-DbNDKH4r-D4CSNQAA.js +++ b/custom-toc-highlight/assets/loadable-DbNDKH4r-CSXrQx_7.js @@ -1 +1 @@ -import{c as a,n as i}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";const t=new WeakMap,r=new WeakMap;function s(e){r.set(e,new Promise(n=>t.set(e,n)))}function f(e){t.get(e)()}function o(e){return r.get(e)}async function u(e){if(await o(e),!!a())return i(e),new Promise(n=>requestAnimationFrame(()=>n()))}export{u as f,s as o,f as r}; +import{c as a,n as i}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";const t=new WeakMap,r=new WeakMap;function s(e){r.set(e,new Promise(n=>t.set(e,n)))}function f(e){t.get(e)()}function o(e){return r.get(e)}async function u(e){if(await o(e),!!a())return i(e),new Promise(n=>requestAnimationFrame(()=>n()))}export{u as f,s as o,f as r}; diff --git a/custom-toc-highlight/assets/loader-Ch7Jr16w-DUAf9YhQ.js b/custom-toc-highlight/assets/loader-Ch7Jr16w-CF4bv9QO.js similarity index 97% rename from custom-toc-highlight/assets/loader-Ch7Jr16w-DUAf9YhQ.js rename to custom-toc-highlight/assets/loader-Ch7Jr16w-CF4bv9QO.js index b3e01398..713a29cd 100644 --- a/custom-toc-highlight/assets/loader-Ch7Jr16w-DUAf9YhQ.js +++ b/custom-toc-highlight/assets/loader-Ch7Jr16w-CF4bv9QO.js @@ -1 +1 @@ -import{p as z,b as _,a,D as x}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{i as w}from"./guid-Dls486Er-CBh637k4.js";import{K as P,q as C}from"./locale-Cn_GDVD_-Ar3RKmd3.js";const t={loader:"loader",loaderParts:"loader__svgs",loaderPart:"loader__svg",loaderPartId:e=>`${t.loaderPart}--${e}`,loaderText:"loader__text",loaderPercentage:"loader__percentage"},$='@charset "UTF-8";@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{position:relative;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-color-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2 / var(--calcite-internal-duration-factor)) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem);will-change:contents}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--3);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem;--calcite-internal-loader-value-line-height:0.625rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem;--calcite-internal-loader-value-line-height:1.375rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem;--calcite-internal-loader-value-line-height:1.71875rem}:host([no-padding]){padding-block:0px}:host{display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{display:block;text-align:center;color:var(--calcite-color-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);line-height:var(--calcite-internal-loader-value-line-height);align-self:center}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.66 / var(--calcite-internal-duration-factor));animation-name:loader-clockwise;display:flex}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear}.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}:host([type=determinate]),:host([type=determinate-value]){animation:none;stroke:var(--calcite-color-border-3)}:host([type=determinate]) .loader__svgs,:host([type=determinate-value]) .loader__svgs{animation:none}:host([type=determinate]) .loader__svg--3,:host([type=determinate-value]) .loader__svg--3{animation:none;stroke:var(--calcite-color-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-color-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 4.8 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-83.7757333333}100%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:-279.2524444444}}.loader__svg--2{stroke-dasharray:55.8504888889 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.4 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-97.7383555556}100%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:-279.2524444444}}.loader__svg--3{stroke-dasharray:13.9626222222 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 7.734 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-76.7944222222}100%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:-279.2524444444}}@keyframes loader-color-shift{0%{stroke:var(--calcite-color-brand)}33%{stroke:var(--calcite-color-brand-press)}66%{stroke:var(--calcite-color-brand-hover)}100%{stroke:var(--calcite-color-brand)}}@keyframes loader-clockwise{100%{transform:rotate(360deg)}}:host([hidden]){display:none}[hidden]{display:none}',H=$,L=z(class extends _{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.formatValue=()=>this.type!=="determinate-value"?`${this.value}`:this.formatter.format(this.value/100),this.complete=!1,this.inline=!1,this.label=void 0,this.scale="m",this.type="indeterminate",this.value=0,this.text="",this.effectiveLocale=""}valueChangeHandler(){this.complete=this.type.startsWith("determinate")&&this.value===100}connectedCallback(){P(this),this.updateFormatter()}disconnectedCallback(){C(this)}componentWillLoad(){requestAnimationFrame(()=>this.valueChangeHandler())}render(){const{el:e,inline:f,label:v,scale:n,text:l,type:h,value:s}=this,g=e.id||w(),u=.45,i=f?this.getInlineSize(n):this.getSize(n),c=i*u,p=`0 0 ${i} ${i}`,r=h.startsWith("determinate"),d=2*c*Math.PI,m=s/100*d,k=d-m,y=Math.floor(s),b={"stroke-dasharray":`${m} ${k}`};return a(x,{key:"8272bdfae9fff51b19ed8fa66197eb93b53feb4c","aria-label":v,"aria-valuemax":r?"100":void 0,"aria-valuemin":r?"0":void 0,"aria-valuenow":r?y.toString():void 0,id:g,role:"progressbar"},a("div",{key:"3d410c178af39bb57cc478bdd06c0392f6ba71a3",class:t.loaderParts},[1,2,3].map(o=>a("svg",{"aria-hidden":"true",class:{[t.loaderPart]:!0,[t.loaderPartId(o)]:!0},key:o,style:r&&o===3?b:void 0,viewBox:p},a("circle",{cx:i/2,cy:i/2,r:c}))),r&&a("div",{key:"4ccc633930dee031bf769908d712df39e0677bbb",class:t.loaderPercentage},this.formatValue())),l&&a("div",{key:"6d0d51988bdfafee2a19faed9e14d3bda06d79b5",class:t.loaderText},l))}formatterPropsChange(){this.updateFormatter()}getSize(e){return{s:32,m:56,l:80}[e]}getInlineSize(e){return{s:12,m:16,l:20}[e]}updateFormatter(){this.type!=="determinate-value"||this.formatter?.resolvedOptions().locale===this.effectiveLocale||(this.formatter=new Intl.NumberFormat(this.effectiveLocale,{style:"percent"}))}get el(){return this}static get watchers(){return{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}}static get style(){return H}},[1,"calcite-loader",{complete:[1540],inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1],effectiveLocale:[32]},void 0,{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}]);function S(){typeof customElements>"u"||["calcite-loader"].forEach(e=>{switch(e){case"calcite-loader":customElements.get(e)||customElements.define(e,L);break}})}S();export{L as f,S as v}; +import{p as z,b as _,a,D as x}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{i as w}from"./guid-Dls486Er-CBh637k4.js";import{K as P,q as C}from"./locale-Cn_GDVD_-CCUxSwPB.js";const t={loader:"loader",loaderParts:"loader__svgs",loaderPart:"loader__svg",loaderPartId:e=>`${t.loaderPart}--${e}`,loaderText:"loader__text",loaderPercentage:"loader__percentage"},$='@charset "UTF-8";@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0}}:host{position:relative;margin-inline:auto;display:none;align-items:center;justify-content:center;opacity:1;min-block-size:var(--calcite-loader-size);font-size:var(--calcite-loader-font-size);stroke:var(--calcite-color-brand);stroke-width:3;fill:none;transform:scale(1, 1);animation:loader-color-shift calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 2 / var(--calcite-internal-duration-factor)) alternate-reverse infinite linear;padding-block:var(--calcite-loader-padding, 4rem);will-change:contents}:host([scale=s]){--calcite-loader-font-size:var(--calcite-font-size--3);--calcite-loader-size:2rem;--calcite-loader-size-inline:0.75rem;--calcite-internal-loader-value-line-height:0.625rem}:host([scale=m]){--calcite-loader-font-size:var(--calcite-font-size-0);--calcite-loader-size:4rem;--calcite-loader-size-inline:1rem;--calcite-internal-loader-value-line-height:1.375rem}:host([scale=l]){--calcite-loader-font-size:var(--calcite-font-size-2);--calcite-loader-size:6rem;--calcite-loader-size-inline:1.5rem;--calcite-internal-loader-value-line-height:1.71875rem}:host([no-padding]){padding-block:0px}:host{display:flex}.loader__text{display:block;text-align:center;font-size:var(--calcite-font-size--2);line-height:1rem;color:var(--calcite-color-text-1);margin-block-start:calc(var(--calcite-loader-size) + 1.5rem)}.loader__percentage{display:block;text-align:center;color:var(--calcite-color-text-1);font-size:var(--calcite-loader-font-size);inline-size:var(--calcite-loader-size);line-height:var(--calcite-internal-loader-value-line-height);align-self:center}.loader__svgs{position:absolute;overflow:visible;opacity:1;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);inset-inline-start:50%;margin-inline-start:calc(var(--calcite-loader-size) / 2 * -1);animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.66 / var(--calcite-internal-duration-factor));animation-name:loader-clockwise;display:flex}.loader__svg{position:absolute;inset-block-start:0px;transform-origin:center;overflow:visible;inset-inline-start:0;inline-size:var(--calcite-loader-size);block-size:var(--calcite-loader-size);animation-iteration-count:infinite;animation-timing-function:linear}.loader__svg--1{animation-name:loader-offset-1}.loader__svg--2{animation-name:loader-offset-2}.loader__svg--3{animation-name:loader-offset-3}:host([type=determinate]),:host([type=determinate-value]){animation:none;stroke:var(--calcite-color-border-3)}:host([type=determinate]) .loader__svgs,:host([type=determinate-value]) .loader__svgs{animation:none}:host([type=determinate]) .loader__svg--3,:host([type=determinate-value]) .loader__svg--3{animation:none;stroke:var(--calcite-color-brand);stroke-dasharray:150.79632;transform:rotate(-90deg);transition:all var(--calcite-internal-animation-timing-fast) linear}:host([inline]){position:relative;margin:0px;animation:none;stroke:currentColor;stroke-width:2;padding-block:0px;block-size:var(--calcite-loader-size-inline);min-block-size:var(--calcite-loader-size-inline);inline-size:var(--calcite-loader-size-inline);margin-inline-end:calc(var(--calcite-loader-size-inline) * 0.5);vertical-align:calc(var(--calcite-loader-size-inline) * -1 * 0.2)}:host([inline]) .loader__svgs{inset-block-start:0px;margin:0px;inset-inline-start:0;inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([inline]) .loader__svg{inline-size:var(--calcite-loader-size-inline);block-size:var(--calcite-loader-size-inline)}:host([complete]){opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity var(--calcite-internal-animation-timing-medium) linear 1000ms, transform var(--calcite-internal-animation-timing-medium) linear 1000ms}:host([complete]) .loader__svgs{opacity:0;transform:scale(0.75, 0.75);transform-origin:center;transition:opacity calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms, transform calc(180ms * var(--calcite-internal-duration-factor)) linear 800ms}:host([complete]) .loader__percentage{color:var(--calcite-color-brand);transform:scale(1.05, 1.05);transform-origin:center;transition:color var(--calcite-internal-animation-timing-medium) linear, transform var(--calcite-internal-animation-timing-medium) linear}.loader__svg--1{stroke-dasharray:27.9252444444 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 4.8 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-1{0%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-83.7757333333}100%{stroke-dasharray:27.9252444444 251.3272;stroke-dashoffset:-279.2524444444}}.loader__svg--2{stroke-dasharray:55.8504888889 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 6.4 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-2{0%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-97.7383555556}100%{stroke-dasharray:55.8504888889 223.4019555556;stroke-dashoffset:-279.2524444444}}.loader__svg--3{stroke-dasharray:13.9626222222 139.6262222222;animation-duration:calc(var(--calcite-internal-animation-timing-slow) / var(--calcite-internal-duration-factor) * 7.734 / var(--calcite-internal-duration-factor))}@keyframes loader-offset-3{0%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:0}50%{stroke-dasharray:139.6262222222 139.6262222222;stroke-dashoffset:-76.7944222222}100%{stroke-dasharray:13.9626222222 265.2898222222;stroke-dashoffset:-279.2524444444}}@keyframes loader-color-shift{0%{stroke:var(--calcite-color-brand)}33%{stroke:var(--calcite-color-brand-press)}66%{stroke:var(--calcite-color-brand-hover)}100%{stroke:var(--calcite-color-brand)}}@keyframes loader-clockwise{100%{transform:rotate(360deg)}}:host([hidden]){display:none}[hidden]{display:none}',H=$,L=z(class extends _{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.formatValue=()=>this.type!=="determinate-value"?`${this.value}`:this.formatter.format(this.value/100),this.complete=!1,this.inline=!1,this.label=void 0,this.scale="m",this.type="indeterminate",this.value=0,this.text="",this.effectiveLocale=""}valueChangeHandler(){this.complete=this.type.startsWith("determinate")&&this.value===100}connectedCallback(){P(this),this.updateFormatter()}disconnectedCallback(){C(this)}componentWillLoad(){requestAnimationFrame(()=>this.valueChangeHandler())}render(){const{el:e,inline:f,label:v,scale:n,text:l,type:h,value:s}=this,g=e.id||w(),u=.45,i=f?this.getInlineSize(n):this.getSize(n),c=i*u,p=`0 0 ${i} ${i}`,r=h.startsWith("determinate"),d=2*c*Math.PI,m=s/100*d,k=d-m,y=Math.floor(s),b={"stroke-dasharray":`${m} ${k}`};return a(x,{key:"8272bdfae9fff51b19ed8fa66197eb93b53feb4c","aria-label":v,"aria-valuemax":r?"100":void 0,"aria-valuemin":r?"0":void 0,"aria-valuenow":r?y.toString():void 0,id:g,role:"progressbar"},a("div",{key:"3d410c178af39bb57cc478bdd06c0392f6ba71a3",class:t.loaderParts},[1,2,3].map(o=>a("svg",{"aria-hidden":"true",class:{[t.loaderPart]:!0,[t.loaderPartId(o)]:!0},key:o,style:r&&o===3?b:void 0,viewBox:p},a("circle",{cx:i/2,cy:i/2,r:c}))),r&&a("div",{key:"4ccc633930dee031bf769908d712df39e0677bbb",class:t.loaderPercentage},this.formatValue())),l&&a("div",{key:"6d0d51988bdfafee2a19faed9e14d3bda06d79b5",class:t.loaderText},l))}formatterPropsChange(){this.updateFormatter()}getSize(e){return{s:32,m:56,l:80}[e]}getInlineSize(e){return{s:12,m:16,l:20}[e]}updateFormatter(){this.type!=="determinate-value"||this.formatter?.resolvedOptions().locale===this.effectiveLocale||(this.formatter=new Intl.NumberFormat(this.effectiveLocale,{style:"percent"}))}get el(){return this}static get watchers(){return{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}}static get style(){return H}},[1,"calcite-loader",{complete:[1540],inline:[516],label:[1],scale:[513],type:[513],value:[2],text:[1],effectiveLocale:[32]},void 0,{value:["valueChangeHandler"],effectiveLocale:["formatterPropsChange"],type:["formatterPropsChange"]}]);function S(){typeof customElements>"u"||["calcite-loader"].forEach(e=>{switch(e){case"calcite-loader":customElements.get(e)||customElements.define(e,L);break}})}S();export{L as f,S as v}; diff --git a/custom-toc-highlight/assets/loader-CkLCe-E_-QWQrU9Z8.js b/custom-toc-highlight/assets/loader-CkLCe-E_-BkhKaKBj.js similarity index 97% rename from custom-toc-highlight/assets/loader-CkLCe-E_-QWQrU9Z8.js rename to custom-toc-highlight/assets/loader-CkLCe-E_-BkhKaKBj.js index 7c7ba1fe..732eee1f 100644 --- a/custom-toc-highlight/assets/loader-CkLCe-E_-QWQrU9Z8.js +++ b/custom-toc-highlight/assets/loader-CkLCe-E_-BkhKaKBj.js @@ -1 +1 @@ -import{a1 as N,o as i,cw as Q,dG as W,k7 as Z,an as ee,Y as te,bf as B}from"./story-BfX8CRfG.js";import{t as $,o as A}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{M as E,G as O,I as u,T as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{m as k}from"./Version-CoKzbupV-9-gg6ENz.js";import{L as re,B as oe,H as se,V as ne,N as ae}from"./mat4-DX7gBViE-DVqdGrVU.js";import{j as ie}from"./quat-BODLR7mS-BrXZAXDf.js";import{e as ue}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{p as Y,P as le,x as ce,j as fe,S as de,I as pe,N as me,w as he,O as Te,l as R,X as P,L as we,C as ge,g as xe,M as be}from"./BufferView-PQoE3GL7-Duht5lAO.js";import{h as ye,d as _e,l as Se,f as Ne}from"./resourceUtils-Ds65naCv-jCWWLIQy.js";import"./main-ugzBrWNm.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function S(o,e){const r=o.count;e||(e=new o.TypedArrayConstructor(r));for(let t=0;t{const e={...K,...o.pbrMetallicRoughness},r=Ce({...Ae,...o.extras});return{...Re,...o,pbrMetallicRoughness:e,extras:r}};function Ce(o){switch(o.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:o.ESRI_externalColorMixMode="tint"}return o}const ve={magFilter:E.LINEAR,minFilter:E.LINEAR_MIPMAP_LINEAR,wrapS:O.REPEAT,wrapT:O.REPEAT},Ie=o=>({...ve,...o});function Me(o){let e,r;return o.replace(/^(.*\/)?([^/]*)$/,(t,s,n)=>(e=s||"",r=n||"","")),{dirPart:e,filePart:r}}const y={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class h{constructor(e,r,t,s){if(this._context=e,this.uri=r,this.json=t,this._glbBuffer=s,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._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform"],this._baseUri=Me(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.scenes==null)throw new i("gltf-loader-unsupported-feature","Scenes must be defined.");if(t.meshes==null)throw new i("gltf-loader-unsupported-feature","Meshes must be defined");if(t.nodes==null)throw new i("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,r,t){if(Q(r)){const a=W(r);if(a&&a.mediaType!=="model/gltf-binary")try{const f=JSON.parse(a.isBase64?atob(a.data):a.data);return new h(e,r,f)}catch{}const c=Z(r);if(h._isGLBData(c))return this._fromGLBData(e,r,c)}if(Pe.test(r)||t?.expectedType==="gltf"){const a=await e.loadJSON(r,t);return new h(e,r,a)}const s=await e.loadBinary(r,t);if(h._isGLBData(s))return this._fromGLBData(e,r,s);if(Ge.test(r)||t?.expectedType==="glb")throw new i("gltf-loader-invalid-glb","This is not a valid glb file.");const n=await e.loadJSON(r,t);return new h(e,r,n)}static _isGLBData(e){if(e==null)return!1;const r=new G(e);return r.remainingBytes()>=4&&r.readUint32()===y.MAGIC}static async _fromGLBData(e,r,t){const s=await h._parseGLBData(t);return new h(e,r,s.json,s.binaryData)}static async _parseGLBData(e){const r=new G(e);if(r.remainingBytes()<12)throw new i("gltf-loader-error","glb binary data is insufficiently large.");const t=r.readUint32(),s=r.readUint32(),n=r.readUint32();if(t!==y.MAGIC)throw new i("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength=8;){const d=r.readUint32(),p=r.readUint32();if(f===0){if(p!==y.CHUNK_TYPE_JSON)throw new i("gltf-loader-error","First glb chunk must be JSON.");if(d<0)throw new i("gltf-loader-error","No JSON data found.");a=await ye(r.readUint8Array(d))}else if(f===1){if(p!==y.CHUNK_TYPE_BIN)throw new i("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");c=r.readUint8Array(d)}else N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");f+=1}if(!a)throw new i("gltf-loader-error","No glb JSON chunk detected.");return{json:a,binaryData:c}}async getBuffer(e,r){const t=this.json.buffers[e];if(t.uri==null){if(this._glbBuffer==null)throw new i("gltf-loader-error","glb buffer not present");return this._glbBuffer}const s=await this._getBufferLoader(e,r);if(s.byteLength!==t.byteLength)throw new i("gltf-loader-error","Buffer byte lengths should match.");return s}async _getBufferLoader(e,r){const t=this._bufferLoaders.get(e);if(t)return t;const s=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(s),r).then(a=>new Uint8Array(a));return this._bufferLoaders.set(e,n),n}async getAccessor(e,r){if(!this.json.accessors)throw new i("gltf-loader-unsupported-feature","Accessors missing.");const t=this.json.accessors[e];if(t?.bufferView==null)throw new i("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(t.type in[b.MAT2,b.MAT3,b.MAT4])throw new i("gltf-loader-unsupported-feature",`AttributeType ${t.type} is not supported`);const s=this.json.bufferViews[t.bufferView],n=await this.getBuffer(s.buffer,r),a=Ue[t.type],c=De[t.componentType],f=a*c,d=s.byteStride||f;return{raw:n.buffer,byteStride:d,byteOffset:n.byteOffset+(s.byteOffset||0)+(t.byteOffset||0),entryCount:t.count,isDenselyPacked:d===f,componentCount:a,componentByteSize:c,componentType:t.componentType,min:t.min,max:t.max,normalized:!!t.normalized}}async getIndexData(e,r){if(e.indices==null)return;const t=await this.getAccessor(e.indices,r);if(t.isDenselyPacked)switch(t.componentType){case u.UNSIGNED_BYTE:return new Uint8Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_SHORT:return new Uint16Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_INT:return new Uint32Array(t.raw,t.byteOffset,t.entryCount)}else switch(t.componentType){case u.UNSIGNED_BYTE:return S(m(Te,t));case u.UNSIGNED_SHORT:return S(m(he,t));case u.UNSIGNED_INT:return S(m(me,t))}}async getPositionData(e,r){if(e.attributes.POSITION==null)throw new i("gltf-loader-unsupported-feature","No POSITION vertex data found.");const t=await this.getAccessor(e.attributes.POSITION,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getNormalData(e,r){if(e.attributes.NORMAL==null)throw new i("gltf-loader-error","No NORMAL vertex data found.");const t=await this.getAccessor(e.attributes.NORMAL,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getTangentData(e,r){if(e.attributes.TANGENT==null)throw new i("gltf-loader-error","No TANGENT vertex data found.");const t=await this.getAccessor(e.attributes.TANGENT,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==4)throw new i("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+t.componentCount.toFixed());return m(P,t)}async getTextureCoordinates(e,r){if(e.attributes.TEXCOORD_0==null)throw new i("gltf-loader-error","No TEXCOORD_0 vertex data found.");const t=await this.getAccessor(e.attributes.TEXCOORD_0,r);if(t.componentCount!==2)throw new i("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+t.componentCount.toFixed());if(t.componentType===u.FLOAT)return m(Y,t);if(!t.normalized)throw new i("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return Be(t)}async getVertexColors(e,r){if(e.attributes.COLOR_0==null)throw new i("gltf-loader-error","No COLOR_0 vertex data found.");const t=await this.getAccessor(e.attributes.COLOR_0,r);if(t.componentCount!==4&&t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+t.componentCount.toFixed());if(t.componentCount===4){if(t.componentType===u.FLOAT)return m(P,t);if(t.componentType===u.UNSIGNED_BYTE)return m(we,t);if(t.componentType===u.UNSIGNED_SHORT)return m(ge,t)}else if(t.componentCount===3){if(t.componentType===u.FLOAT)return m(R,t);if(t.componentType===u.UNSIGNED_BYTE)return m(xe,t);if(t.componentType===u.UNSIGNED_SHORT)return m(be,t)}throw new i("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+u[t.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,r,t){let s=e.material?this._materialCache.get(e.material):void 0;if(!s){const n=e.material!=null?H(this.json.materials[e.material]):H(),a=n.pbrMetallicRoughness,c=this.hasVertexColors(e),f=this.getTexture(a.baseColorTexture,r),d=this.getTexture(n.normalTexture,r),p=t?this.getTexture(n.occlusionTexture,r):void 0,l=t?this.getTexture(n.emissiveTexture,r):void 0,w=t?this.getTexture(a.metallicRoughnessTexture,r):void 0,T=e.material!=null?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:a.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await f,normalTexture:await d,name:n.name,id:T,occlusionTexture:await p,emissiveTexture:await l,emissiveFactor:n.emissiveFactor,metallicFactor:a.metallicFactor,roughnessFactor:a.roughnessFactor,metallicRoughnessTexture:await w,hasVertexColors:c,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:a?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:a?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:n.extras.ESRI_receiveAmbientOcclusion,receiveShadows:n.extras.ESRI_receiveShadows}}return s}async getTexture(e,r){if(!e)return;if((e.texCoord||0)!==0)throw new i("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const t=e.index,s=this.json.textures[t],n=Ie(s.sampler!=null?this.json.samplers[s.sampler]:{}),a=V(s),c=this.json.images[a],f=await this._loadTextureImageData(t,s,r);return ee(this._textureCache,t,()=>{const d=l=>l===33071||l===33648||l===10497,p=l=>{throw new i("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${l}`)};return{data:f,wrapS:d(n.wrapS)?n.wrapS:p(n.wrapS),wrapT:d(n.wrapT)?n.wrapT:p(n.wrapT),minFilter:n.minFilter,name:c.name,id:t}})}getNodeTransform(e){if(e===void 0)return Le;let r=this._nodeTransformCache.get(e);if(!r){const t=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?r=oe($(),t,s.matrix):s.translation||s.rotation||s.scale?(r=A(t),s.translation&&se(r,r,s.translation),s.rotation&&(_[3]=ie(_,s.rotation),ne(r,r,_[3],_)),s.scale&&ae(r,r,s.scale)):r=A(t),this._nodeTransformCache.set(e,r)}return r}_resolveUri(e){return te(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=k.parse(this.json.asset.version,"glTF");Fe.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(r=>this._supportedExtensions.includes(r)))throw new i("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,r)=>{e.children&&e.children.forEach(t=>{this._nodeParentMap.set(t,r)})})}async _loadTextureImageData(e,r,t){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(r,t);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,r){const t=V(e),s=this.json.images[t];if(s.uri){if(s.uri.endsWith(".ktx2")){const f=await this._context.loadBinary(this._resolveUri(s.uri),r);return new _e(new Uint8Array(f))}return this._context.loadImage(this._resolveUri(s.uri),r)}if(s.bufferView==null)throw new i("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(s.mimeType==null)throw new i("gltf-loader-unsupported-feature","Image mimeType must be defined.");const n=this.json.bufferViews[s.bufferView],a=await this.getBuffer(n.buffer,r);if(n.byteStride!=null)throw new i("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const c=a.byteOffset+(n.byteOffset||0);return Se(new Uint8Array(a.buffer,c,n.byteLength),s.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await B(Array.from(this._bufferLoaders.values())),r=await B(Array.from(this._textureLoaders.values()));return e.reduce((t,s)=>t+(s?.byteLength??0),0)+r.reduce((t,s)=>t+(s?Ne(s)?s.data.byteLength:s.width*s.height*4:0),0)}}const Le=re($(),Math.PI/2),Fe=new k(2,0,"glTF"),_=ue(),Ue={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},De={[u.BYTE]:1,[u.UNSIGNED_BYTE]:1,[u.SHORT]:2,[u.UNSIGNED_SHORT]:2,[u.HALF_FLOAT]:2,[u.FLOAT]:4,[u.INT]:4,[u.UNSIGNED_INT]:4};function Be(o){switch(o.componentType){case u.BYTE:return new pe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_BYTE:return new de(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.SHORT:return new fe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_SHORT:return new ce(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_INT:return new le(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.FLOAT:return new Y(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount)}}function m(o,e){return new o(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*(e.entryCount-1)+e.componentByteSize*e.componentCount)}function V(o){if(o.extensions?.KHR_texture_basisu!=null)return o.extensions.KHR_texture_basisu.source;if(o.source!==null)return o.source;throw new i("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const Pe=/\.gltf$/i,Ge=/\.glb$/i;let je=0;async function ut(o,e,r={},t=!0){const s=await h.load(o,e,r),n="gltf_"+je++,a={lods:[],materials:new Map,textures:new Map,meta:He(s)},c=!(!s.json.asset.extras||s.json.asset.extras.ESRI_type!=="symbolResource"),f=s.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,d=new Map;await Ve(s,async(l,w,T,C)=>{const v=d.get(T)??0;d.set(T,v+1);const g=l.mode!==void 0?l.mode:x.TRIANGLES,I=g===x.TRIANGLES||g===x.TRIANGLE_STRIP||g===x.TRIANGLE_FAN?g:null;if(I==null)return void N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+x[g]+"). Skipping primitive.");if(!s.hasPositions(l))return void N.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const z=s.getPositionData(l,r),J=s.getMaterial(l,r,t),M=s.hasNormals(l)?s.getNormalData(l,r):null,L=s.hasTangents(l)?s.getTangentData(l,r):null,F=s.hasTextureCoordinates(l)?s.getTextureCoordinates(l,r):null,U=s.hasVertexColors(l)?s.getVertexColors(l,r):null,X=s.getIndexData(l,r),q={name:C,transform:A(w),attributes:{position:await z,normal:M?await M:null,texCoord0:F?await F:null,color:U?await U:null,tangent:L?await L:null},indices:await X,primitiveType:I,material:ke(a,await J,n)};let D=null;a.meta?.ESRI_lod!=null&&a.meta.ESRI_lod.metric==="screenSpaceRadius"&&(D=a.meta.ESRI_lod.thresholds[T]),a.lods[T]=a.lods[T]||{parts:[],name:C,lodThreshold:D},a.lods[T].parts[v]=q});for(const l of a.lods)l.parts=l.parts.filter(w=>!!w);const p=await s.getLoadedBuffersSize();return{model:a,meta:{isEsriSymbolResource:c,uri:s.uri,ESRI_webstyle:f},customMeta:{},size:p}}function He(o){const e=o.json;let r=null;return e.nodes.forEach(t=>{const s=t.extras;s!=null&&(s.ESRI_proxyEllipsoid||s.ESRI_lod)&&(r=s)}),r}async function Ve(o,e){const r=o.json,t=r.scenes[r.scene||0].nodes,s=t.length>1,n=[];for(const c of t){const f=r.nodes[c];n.push(a(c,0)),$e(f)&&!s&&f.extensions.MSFT_lod.ids.forEach((d,p)=>a(d,p+1))}async function a(c,f){const d=r.nodes[c],p=o.getNodeTransform(c);if(d.weights!=null&&N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),d.mesh!=null){const l=r.meshes[d.mesh];for(const w of l.primitives)n.push(e(w,p,f,l.name))}for(const l of d.children||[])n.push(a(l,f))}await Promise.all(n)}function $e(o){return o.extensions?.MSFT_lod&&Array.isArray(o.extensions.MSFT_lod.ids)}function ke(o,e,r){const t=n=>{const a=`${r}_tex_${n&&n.id}${n?.name?"_"+n.name:""}`;if(n&&!o.textures.has(a)){const c=Oe(n.data,{wrap:{s:n.wrapS,t:n.wrapT},mipmap:Ye.has(n.minFilter),noUnpackFlip:!0});o.textures.set(a,c)}return a},s=`${r}_mat_${e.id}_${e.name}`;if(!o.materials.has(s)){const n=Ee({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?t(e.colorTexture):void 0,textureNormal:e.normalTexture?t(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?t(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?t(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?t(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,receiveShadows:e.receiveShadows,receiveAmbientOcclustion:e.receiveAmbientOcclusion});o.materials.set(s,n)}return s}const Ye=new Set([E.LINEAR_MIPMAP_LINEAR,E.LINEAR_MIPMAP_NEAREST]);export{ut as loadGLTF}; +import{a1 as N,o as i,cw as Q,dG as W,k7 as Z,an as ee,Y as te,bf as B}from"./story-Doly9N9p.js";import{t as $,o as A}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{M as E,G as O,I as u,T as x}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{m as k}from"./Version-CoKzbupV-BDyz4v43.js";import{L as re,B as oe,H as se,V as ne,N as ae}from"./mat4-DX7gBViE-6clJxb1Q.js";import{j as ie}from"./quat-BODLR7mS-BQk2dgMZ.js";import{e as ue}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{p as Y,P as le,x as ce,j as fe,S as de,I as pe,N as me,w as he,O as Te,l as R,X as P,L as we,C as ge,g as xe,M as be}from"./BufferView-PQoE3GL7-B9DLdqO9.js";import{h as ye,d as _e,l as Se,f as Ne}from"./resourceUtils-Ds65naCv-PY5SfRMU.js";import"./main-QGPoLsvl.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";function S(o,e){const r=o.count;e||(e=new o.TypedArrayConstructor(r));for(let t=0;t{const e={...K,...o.pbrMetallicRoughness},r=Ce({...Ae,...o.extras});return{...Re,...o,pbrMetallicRoughness:e,extras:r}};function Ce(o){switch(o.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:o.ESRI_externalColorMixMode="tint"}return o}const ve={magFilter:E.LINEAR,minFilter:E.LINEAR_MIPMAP_LINEAR,wrapS:O.REPEAT,wrapT:O.REPEAT},Ie=o=>({...ve,...o});function Me(o){let e,r;return o.replace(/^(.*\/)?([^/]*)$/,(t,s,n)=>(e=s||"",r=n||"","")),{dirPart:e,filePart:r}}const y={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class h{constructor(e,r,t,s){if(this._context=e,this.uri=r,this.json=t,this._glbBuffer=s,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._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform"],this._baseUri=Me(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.scenes==null)throw new i("gltf-loader-unsupported-feature","Scenes must be defined.");if(t.meshes==null)throw new i("gltf-loader-unsupported-feature","Meshes must be defined");if(t.nodes==null)throw new i("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,r,t){if(Q(r)){const a=W(r);if(a&&a.mediaType!=="model/gltf-binary")try{const f=JSON.parse(a.isBase64?atob(a.data):a.data);return new h(e,r,f)}catch{}const c=Z(r);if(h._isGLBData(c))return this._fromGLBData(e,r,c)}if(Pe.test(r)||t?.expectedType==="gltf"){const a=await e.loadJSON(r,t);return new h(e,r,a)}const s=await e.loadBinary(r,t);if(h._isGLBData(s))return this._fromGLBData(e,r,s);if(Ge.test(r)||t?.expectedType==="glb")throw new i("gltf-loader-invalid-glb","This is not a valid glb file.");const n=await e.loadJSON(r,t);return new h(e,r,n)}static _isGLBData(e){if(e==null)return!1;const r=new G(e);return r.remainingBytes()>=4&&r.readUint32()===y.MAGIC}static async _fromGLBData(e,r,t){const s=await h._parseGLBData(t);return new h(e,r,s.json,s.binaryData)}static async _parseGLBData(e){const r=new G(e);if(r.remainingBytes()<12)throw new i("gltf-loader-error","glb binary data is insufficiently large.");const t=r.readUint32(),s=r.readUint32(),n=r.readUint32();if(t!==y.MAGIC)throw new i("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength=8;){const d=r.readUint32(),p=r.readUint32();if(f===0){if(p!==y.CHUNK_TYPE_JSON)throw new i("gltf-loader-error","First glb chunk must be JSON.");if(d<0)throw new i("gltf-loader-error","No JSON data found.");a=await ye(r.readUint8Array(d))}else if(f===1){if(p!==y.CHUNK_TYPE_BIN)throw new i("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");c=r.readUint8Array(d)}else N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");f+=1}if(!a)throw new i("gltf-loader-error","No glb JSON chunk detected.");return{json:a,binaryData:c}}async getBuffer(e,r){const t=this.json.buffers[e];if(t.uri==null){if(this._glbBuffer==null)throw new i("gltf-loader-error","glb buffer not present");return this._glbBuffer}const s=await this._getBufferLoader(e,r);if(s.byteLength!==t.byteLength)throw new i("gltf-loader-error","Buffer byte lengths should match.");return s}async _getBufferLoader(e,r){const t=this._bufferLoaders.get(e);if(t)return t;const s=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(s),r).then(a=>new Uint8Array(a));return this._bufferLoaders.set(e,n),n}async getAccessor(e,r){if(!this.json.accessors)throw new i("gltf-loader-unsupported-feature","Accessors missing.");const t=this.json.accessors[e];if(t?.bufferView==null)throw new i("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(t.type in[b.MAT2,b.MAT3,b.MAT4])throw new i("gltf-loader-unsupported-feature",`AttributeType ${t.type} is not supported`);const s=this.json.bufferViews[t.bufferView],n=await this.getBuffer(s.buffer,r),a=Ue[t.type],c=De[t.componentType],f=a*c,d=s.byteStride||f;return{raw:n.buffer,byteStride:d,byteOffset:n.byteOffset+(s.byteOffset||0)+(t.byteOffset||0),entryCount:t.count,isDenselyPacked:d===f,componentCount:a,componentByteSize:c,componentType:t.componentType,min:t.min,max:t.max,normalized:!!t.normalized}}async getIndexData(e,r){if(e.indices==null)return;const t=await this.getAccessor(e.indices,r);if(t.isDenselyPacked)switch(t.componentType){case u.UNSIGNED_BYTE:return new Uint8Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_SHORT:return new Uint16Array(t.raw,t.byteOffset,t.entryCount);case u.UNSIGNED_INT:return new Uint32Array(t.raw,t.byteOffset,t.entryCount)}else switch(t.componentType){case u.UNSIGNED_BYTE:return S(m(Te,t));case u.UNSIGNED_SHORT:return S(m(he,t));case u.UNSIGNED_INT:return S(m(me,t))}}async getPositionData(e,r){if(e.attributes.POSITION==null)throw new i("gltf-loader-unsupported-feature","No POSITION vertex data found.");const t=await this.getAccessor(e.attributes.POSITION,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getNormalData(e,r){if(e.attributes.NORMAL==null)throw new i("gltf-loader-error","No NORMAL vertex data found.");const t=await this.getAccessor(e.attributes.NORMAL,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+t.componentCount.toFixed());return m(R,t)}async getTangentData(e,r){if(e.attributes.TANGENT==null)throw new i("gltf-loader-error","No TANGENT vertex data found.");const t=await this.getAccessor(e.attributes.TANGENT,r);if(t.componentType!==u.FLOAT)throw new i("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+u[t.componentType]);if(t.componentCount!==4)throw new i("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+t.componentCount.toFixed());return m(P,t)}async getTextureCoordinates(e,r){if(e.attributes.TEXCOORD_0==null)throw new i("gltf-loader-error","No TEXCOORD_0 vertex data found.");const t=await this.getAccessor(e.attributes.TEXCOORD_0,r);if(t.componentCount!==2)throw new i("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+t.componentCount.toFixed());if(t.componentType===u.FLOAT)return m(Y,t);if(!t.normalized)throw new i("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return Be(t)}async getVertexColors(e,r){if(e.attributes.COLOR_0==null)throw new i("gltf-loader-error","No COLOR_0 vertex data found.");const t=await this.getAccessor(e.attributes.COLOR_0,r);if(t.componentCount!==4&&t.componentCount!==3)throw new i("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+t.componentCount.toFixed());if(t.componentCount===4){if(t.componentType===u.FLOAT)return m(P,t);if(t.componentType===u.UNSIGNED_BYTE)return m(we,t);if(t.componentType===u.UNSIGNED_SHORT)return m(ge,t)}else if(t.componentCount===3){if(t.componentType===u.FLOAT)return m(R,t);if(t.componentType===u.UNSIGNED_BYTE)return m(xe,t);if(t.componentType===u.UNSIGNED_SHORT)return m(be,t)}throw new i("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+u[t.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,r,t){let s=e.material?this._materialCache.get(e.material):void 0;if(!s){const n=e.material!=null?H(this.json.materials[e.material]):H(),a=n.pbrMetallicRoughness,c=this.hasVertexColors(e),f=this.getTexture(a.baseColorTexture,r),d=this.getTexture(n.normalTexture,r),p=t?this.getTexture(n.occlusionTexture,r):void 0,l=t?this.getTexture(n.emissiveTexture,r):void 0,w=t?this.getTexture(a.metallicRoughnessTexture,r):void 0,T=e.material!=null?e.material:-1;s={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:a.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await f,normalTexture:await d,name:n.name,id:T,occlusionTexture:await p,emissiveTexture:await l,emissiveFactor:n.emissiveFactor,metallicFactor:a.metallicFactor,roughnessFactor:a.roughnessFactor,metallicRoughnessTexture:await w,hasVertexColors:c,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:a?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:a?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:n.extras.ESRI_receiveAmbientOcclusion,receiveShadows:n.extras.ESRI_receiveShadows}}return s}async getTexture(e,r){if(!e)return;if((e.texCoord||0)!==0)throw new i("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const t=e.index,s=this.json.textures[t],n=Ie(s.sampler!=null?this.json.samplers[s.sampler]:{}),a=V(s),c=this.json.images[a],f=await this._loadTextureImageData(t,s,r);return ee(this._textureCache,t,()=>{const d=l=>l===33071||l===33648||l===10497,p=l=>{throw new i("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${l}`)};return{data:f,wrapS:d(n.wrapS)?n.wrapS:p(n.wrapS),wrapT:d(n.wrapT)?n.wrapT:p(n.wrapT),minFilter:n.minFilter,name:c.name,id:t}})}getNodeTransform(e){if(e===void 0)return Le;let r=this._nodeTransformCache.get(e);if(!r){const t=this.getNodeTransform(this._getNodeParent(e)),s=this.json.nodes[e];s.matrix?r=oe($(),t,s.matrix):s.translation||s.rotation||s.scale?(r=A(t),s.translation&&se(r,r,s.translation),s.rotation&&(_[3]=ie(_,s.rotation),ne(r,r,_[3],_)),s.scale&&ae(r,r,s.scale)):r=A(t),this._nodeTransformCache.set(e,r)}return r}_resolveUri(e){return te(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=k.parse(this.json.asset.version,"glTF");Fe.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(r=>this._supportedExtensions.includes(r)))throw new i("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,r)=>{e.children&&e.children.forEach(t=>{this._nodeParentMap.set(t,r)})})}async _loadTextureImageData(e,r,t){const s=this._textureLoaders.get(e);if(s)return s;const n=this._createTextureLoader(r,t);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,r){const t=V(e),s=this.json.images[t];if(s.uri){if(s.uri.endsWith(".ktx2")){const f=await this._context.loadBinary(this._resolveUri(s.uri),r);return new _e(new Uint8Array(f))}return this._context.loadImage(this._resolveUri(s.uri),r)}if(s.bufferView==null)throw new i("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(s.mimeType==null)throw new i("gltf-loader-unsupported-feature","Image mimeType must be defined.");const n=this.json.bufferViews[s.bufferView],a=await this.getBuffer(n.buffer,r);if(n.byteStride!=null)throw new i("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const c=a.byteOffset+(n.byteOffset||0);return Se(new Uint8Array(a.buffer,c,n.byteLength),s.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await B(Array.from(this._bufferLoaders.values())),r=await B(Array.from(this._textureLoaders.values()));return e.reduce((t,s)=>t+(s?.byteLength??0),0)+r.reduce((t,s)=>t+(s?Ne(s)?s.data.byteLength:s.width*s.height*4:0),0)}}const Le=re($(),Math.PI/2),Fe=new k(2,0,"glTF"),_=ue(),Ue={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},De={[u.BYTE]:1,[u.UNSIGNED_BYTE]:1,[u.SHORT]:2,[u.UNSIGNED_SHORT]:2,[u.HALF_FLOAT]:2,[u.FLOAT]:4,[u.INT]:4,[u.UNSIGNED_INT]:4};function Be(o){switch(o.componentType){case u.BYTE:return new pe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_BYTE:return new de(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.SHORT:return new fe(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_SHORT:return new ce(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.UNSIGNED_INT:return new le(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount);case u.FLOAT:return new Y(o.raw,o.byteOffset,o.byteStride,o.byteOffset+o.byteStride*o.entryCount)}}function m(o,e){return new o(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*(e.entryCount-1)+e.componentByteSize*e.componentCount)}function V(o){if(o.extensions?.KHR_texture_basisu!=null)return o.extensions.KHR_texture_basisu.source;if(o.source!==null)return o.source;throw new i("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const Pe=/\.gltf$/i,Ge=/\.glb$/i;let je=0;async function ut(o,e,r={},t=!0){const s=await h.load(o,e,r),n="gltf_"+je++,a={lods:[],materials:new Map,textures:new Map,meta:He(s)},c=!(!s.json.asset.extras||s.json.asset.extras.ESRI_type!=="symbolResource"),f=s.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,d=new Map;await Ve(s,async(l,w,T,C)=>{const v=d.get(T)??0;d.set(T,v+1);const g=l.mode!==void 0?l.mode:x.TRIANGLES,I=g===x.TRIANGLES||g===x.TRIANGLE_STRIP||g===x.TRIANGLE_FAN?g:null;if(I==null)return void N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+x[g]+"). Skipping primitive.");if(!s.hasPositions(l))return void N.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const z=s.getPositionData(l,r),J=s.getMaterial(l,r,t),M=s.hasNormals(l)?s.getNormalData(l,r):null,L=s.hasTangents(l)?s.getTangentData(l,r):null,F=s.hasTextureCoordinates(l)?s.getTextureCoordinates(l,r):null,U=s.hasVertexColors(l)?s.getVertexColors(l,r):null,X=s.getIndexData(l,r),q={name:C,transform:A(w),attributes:{position:await z,normal:M?await M:null,texCoord0:F?await F:null,color:U?await U:null,tangent:L?await L:null},indices:await X,primitiveType:I,material:ke(a,await J,n)};let D=null;a.meta?.ESRI_lod!=null&&a.meta.ESRI_lod.metric==="screenSpaceRadius"&&(D=a.meta.ESRI_lod.thresholds[T]),a.lods[T]=a.lods[T]||{parts:[],name:C,lodThreshold:D},a.lods[T].parts[v]=q});for(const l of a.lods)l.parts=l.parts.filter(w=>!!w);const p=await s.getLoadedBuffersSize();return{model:a,meta:{isEsriSymbolResource:c,uri:s.uri,ESRI_webstyle:f},customMeta:{},size:p}}function He(o){const e=o.json;let r=null;return e.nodes.forEach(t=>{const s=t.extras;s!=null&&(s.ESRI_proxyEllipsoid||s.ESRI_lod)&&(r=s)}),r}async function Ve(o,e){const r=o.json,t=r.scenes[r.scene||0].nodes,s=t.length>1,n=[];for(const c of t){const f=r.nodes[c];n.push(a(c,0)),$e(f)&&!s&&f.extensions.MSFT_lod.ids.forEach((d,p)=>a(d,p+1))}async function a(c,f){const d=r.nodes[c],p=o.getNodeTransform(c);if(d.weights!=null&&N.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),d.mesh!=null){const l=r.meshes[d.mesh];for(const w of l.primitives)n.push(e(w,p,f,l.name))}for(const l of d.children||[])n.push(a(l,f))}await Promise.all(n)}function $e(o){return o.extensions?.MSFT_lod&&Array.isArray(o.extensions.MSFT_lod.ids)}function ke(o,e,r){const t=n=>{const a=`${r}_tex_${n&&n.id}${n?.name?"_"+n.name:""}`;if(n&&!o.textures.has(a)){const c=Oe(n.data,{wrap:{s:n.wrapS,t:n.wrapT},mipmap:Ye.has(n.minFilter),noUnpackFlip:!0});o.textures.set(a,c)}return a},s=`${r}_mat_${e.id}_${e.name}`;if(!o.materials.has(s)){const n=Ee({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?t(e.colorTexture):void 0,textureNormal:e.normalTexture?t(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?t(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?t(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?t(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,receiveShadows:e.receiveShadows,receiveAmbientOcclustion:e.receiveAmbientOcclusion});o.materials.set(s,n)}return s}const Ye=new Set([E.LINEAR_MIPMAP_LINEAR,E.LINEAR_MIPMAP_NEAREST]);export{ut as loadGLTF}; diff --git a/custom-toc-highlight/assets/locale-Cn_GDVD_-Ar3RKmd3.js b/custom-toc-highlight/assets/locale-Cn_GDVD_-CCUxSwPB.js similarity index 99% rename from custom-toc-highlight/assets/locale-Cn_GDVD_-Ar3RKmd3.js rename to custom-toc-highlight/assets/locale-Cn_GDVD_-CCUxSwPB.js index ac3eda4b..0d7b711c 100644 --- a/custom-toc-highlight/assets/locale-Cn_GDVD_-Ar3RKmd3.js +++ b/custom-toc-highlight/assets/locale-Cn_GDVD_-CCUxSwPB.js @@ -1 +1 @@ -import{v as A,T as v}from"./dom-N58V0tYi-DBU3jlah.js";import{e as I}from"./key-CZySMiwx-kmS7VeUz.js";import{c as D}from"./observers-BigwqTsw-BNRQivHR.js";const _=new RegExp("\\.(0+)?$"),y=new RegExp("0+$");class s{constructor(e){if(e instanceof s)return e;const[n,r]=T(e).split(".").concat("");this.value=BigInt(n+r.padEnd(s.DECIMALS,"0").slice(0,s.DECIMALS))+BigInt(s.ROUNDED&&r[s.DECIMALS]>="5"),this.isNegative=e.charAt(0)==="-"}getIntegersAndDecimals(){const e=this.value.toString().replace("-","").padStart(s.DECIMALS+1,"0"),n=e.slice(0,-s.DECIMALS),r=e.slice(-s.DECIMALS).replace(y,"");return{integers:n,decimals:r}}toString(){const{integers:e,decimals:n}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${e}${n.length?"."+n:""}`}formatToParts(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=e.numberFormatter.formatToParts(BigInt(n));return this.isNegative&&i.unshift({type:"minusSign",value:e.minusSign}),r.length&&(i.push({type:"decimal",value:e.decimal}),r.split("").forEach(a=>i.push({type:"fraction",value:a}))),i}format(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=`${this.isNegative?e.minusSign:""}${e.numberFormatter.format(BigInt(n))}`,a=r.length?`${e.decimal}${r.split("").map(g=>e.numberFormatter.format(Number(g))).join("")}`:"";return`${i}${a}`}add(e){return s.fromBigInt(this.value+new s(e).value)}subtract(e){return s.fromBigInt(this.value-new s(e).value)}multiply(e){return s._divRound(this.value*new s(e).value,s.SHIFT)}divide(e){return s._divRound(this.value*s.SHIFT,new s(e).value)}}s.DECIMALS=100,s.ROUNDED=!0,s.SHIFT=BigInt("1"+"0".repeat(s.DECIMALS)),s._divRound=(t,e)=>s.fromBigInt(t/e+(s.ROUNDED?t*BigInt(2)/e%BigInt(2):BigInt(0))),s.fromBigInt=t=>Object.assign(Object.create(s.prototype),{value:t,isNegative:t{let n=!1;const r=e.split("").filter((i,a)=>i.match(/\./g)&&!n?(n=!0,!0):i.match(/-/g)&&a===0?!0:I.includes(i)).join("");return d(r)?new s(r).toString():""})}const S=/^([-0])0+(?=\d)/,C=/(?!^\.)\.$/,B=/(?!^-)-/g,R=/^-\b0\b\.?0*$/,x=/0*$/,Q=t=>h(t,e=>{const n=e.replace(B,"").replace(C,"").replace(S,"$1");return d(n)?R.test(n)?n:z(n):e});function z(t){const e=t.split(".")[1],n=new s(t).toString(),[r,i]=n.split(".");return e&&i!==e?`${r}.${e}`:n}function h(t,e){if(!t)return t;const n=t.toLowerCase().indexOf("e")+1;return n?t.replace(/[eE]*$/g,"").substring(0,n).concat(t.slice(n).replace(/[eE]/g,"")).split(/[eE]/).map((r,i)=>e(i===1?r.replace(/\./g,""):r)).join("e").replace(/^e/,"1e"):e(t)}function T(t){const e=t.split(/[eE]/);if(e.length===1)return t;const n=+t;if(Number.isSafeInteger(n))return`${n}`;const r=t.charAt(0)==="-",i=+e[1],a=e[0].split("."),g=(r?a[0].substring(1):a[0])||"",f=a[1]||"",O=(o,l)=>{const c=Math.abs(l)-o.length,$=c>0?`${"0".repeat(c)}${o}`:o;return`${$.slice(0,l)}.${$.slice(l)}`},N=(o,l)=>{const c=l>o.length?`${o}${"0".repeat(l-o.length)}`:o;return`${c.slice(0,l)}.${c.slice(l)}`},b=i>0?`${g}${N(f,i)}`:`${O(g,i)}${f}`;return`${r?"-":""}${b.charAt(0)==="."?"0":""}${b.replace(_,"").replace(S,"")}`}function L(t){return I.some(e=>t.includes(e))}function V(t,e,n){const r=e.split(".")[1];if(r){const i=r.match(x)[0];if(i&&n.delocalize(t).length!==e.length&&r.indexOf("e")===-1){const a=n.decimal;return t=t.includes(a)?t:`${t}${a}`,t.padEnd(t.length+i.length,n.localize("0"))}}return t}const u="en",M=["ar","bg","bs","ca","cs","da","de","el",u,"es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","no","nl","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],j=["ar","bg","bs","ca","cs","da","de","de-AT","de-CH","el",u,"en-AU","en-CA","en-GB","es","es-MX","et","fi","fr","fr-CH","he","hi","hr","hu","id","it","it-CH","ja","ko","lt","lv","mk","no","nl","pl","pt","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],k=["arab","arabext","latn"],E=t=>k.includes(t),p=new Intl.NumberFormat().resolvedOptions().numberingSystem,F=p==="arab"||!E(p)?"latn":p,H=t=>E(t)?t:F;function G(t,e="cldr"){const n=e==="cldr"?j:M;return t?n.includes(t)?t:(t=t.toLowerCase(),t==="nb"?"no":e==="t9n"&&t==="pt"?"pt-BR":(t.includes("-")&&(t=t.replace(/(\w+)-(\w+)/,(r,i,a)=>`${i}-${a.toUpperCase()}`),n.includes(t)||(t=t.split("-")[0])),t==="zh"?"zh-CN":n.includes(t)?t:(console.warn(`Translations for the "${t}" locale are not available and will fall back to the default, English (en).`),u))):u}const m=new Set;function Y(t){P(t),m.size===0&&w?.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}),m.add(t)}function P(t){t.effectiveLocale=U(t)}function Z(t){m.delete(t),m.size===0&&w.disconnect()}const w=D("mutation",t=>{t.forEach(e=>{const n=e.target;m.forEach(r=>{if(!A(n,r.el))return;const i=v(r.el,"[lang]");if(!i){r.effectiveLocale=u;return}const a=i.lang;r.effectiveLocale=i.hasAttribute("lang")&&a===""?u:a})})});function U(t){return t.el.lang||v(t.el,"[lang]")?.lang||document.documentElement.lang||u}class J{constructor(){this.delocalize=e=>this._numberFormatOptions?h(e,n=>n.replace(new RegExp(`[${this._minusSign}]`,"g"),"-").replace(new RegExp(`[${this._group}]`,"g"),"").replace(new RegExp(`[${this._decimal}]`,"g"),".").replace(new RegExp(`[${this._digits.join("")}]`,"g"),this._getDigitIndex)):e,this.localize=e=>this._numberFormatOptions?h(e,n=>d(n.trim())?new s(n.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):n):e}get group(){return this._group}get decimal(){return this._decimal}get minusSign(){return this._minusSign}get digits(){return this._digits}get numberFormatter(){return this._numberFormatter}get numberFormatOptions(){return this._numberFormatOptions}set numberFormatOptions(e){if(e.locale=G(e?.locale),e.numberingSystem=H(e?.numberingSystem),!this._numberFormatOptions&&e.locale===u&&e.numberingSystem===F&&Object.keys(e).length===2||JSON.stringify(this._numberFormatOptions)===JSON.stringify(e))return;this._numberFormatOptions=e,this._numberFormatter=new Intl.NumberFormat(this._numberFormatOptions.locale,this._numberFormatOptions),this._digits=[...new Intl.NumberFormat(this._numberFormatOptions.locale,{useGrouping:!1,numberingSystem:this._numberFormatOptions.numberingSystem}).format(9876543210)].reverse();const n=new Map(this._digits.map((i,a)=>[i,a])),r=new Intl.NumberFormat(this._numberFormatOptions.locale,{numberingSystem:this._numberFormatOptions.numberingSystem}).formatToParts(-123456789e-1);this._actualGroup=r.find(i=>i.type==="group").value,this._group=this._actualGroup.trim().length===0||this._actualGroup==" "?" ":this._actualGroup,this._decimal=r.find(i=>i.type==="decimal").value,this._minusSign=r.find(i=>i.type==="minusSign").value,this._getDigitIndex=i=>n.get(i)}}const tt=new J;export{q as B,V as H,Y as K,Q as T,tt as X,d as h,Z as q,s,G as w}; +import{v as A,T as v}from"./dom-N58V0tYi-DBU3jlah.js";import{e as I}from"./key-CZySMiwx-kmS7VeUz.js";import{c as D}from"./observers-BigwqTsw-CfIXp3Nz.js";const _=new RegExp("\\.(0+)?$"),y=new RegExp("0+$");class s{constructor(e){if(e instanceof s)return e;const[n,r]=T(e).split(".").concat("");this.value=BigInt(n+r.padEnd(s.DECIMALS,"0").slice(0,s.DECIMALS))+BigInt(s.ROUNDED&&r[s.DECIMALS]>="5"),this.isNegative=e.charAt(0)==="-"}getIntegersAndDecimals(){const e=this.value.toString().replace("-","").padStart(s.DECIMALS+1,"0"),n=e.slice(0,-s.DECIMALS),r=e.slice(-s.DECIMALS).replace(y,"");return{integers:n,decimals:r}}toString(){const{integers:e,decimals:n}=this.getIntegersAndDecimals();return`${this.isNegative?"-":""}${e}${n.length?"."+n:""}`}formatToParts(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=e.numberFormatter.formatToParts(BigInt(n));return this.isNegative&&i.unshift({type:"minusSign",value:e.minusSign}),r.length&&(i.push({type:"decimal",value:e.decimal}),r.split("").forEach(a=>i.push({type:"fraction",value:a}))),i}format(e){const{integers:n,decimals:r}=this.getIntegersAndDecimals(),i=`${this.isNegative?e.minusSign:""}${e.numberFormatter.format(BigInt(n))}`,a=r.length?`${e.decimal}${r.split("").map(g=>e.numberFormatter.format(Number(g))).join("")}`:"";return`${i}${a}`}add(e){return s.fromBigInt(this.value+new s(e).value)}subtract(e){return s.fromBigInt(this.value-new s(e).value)}multiply(e){return s._divRound(this.value*new s(e).value,s.SHIFT)}divide(e){return s._divRound(this.value*s.SHIFT,new s(e).value)}}s.DECIMALS=100,s.ROUNDED=!0,s.SHIFT=BigInt("1"+"0".repeat(s.DECIMALS)),s._divRound=(t,e)=>s.fromBigInt(t/e+(s.ROUNDED?t*BigInt(2)/e%BigInt(2):BigInt(0))),s.fromBigInt=t=>Object.assign(Object.create(s.prototype),{value:t,isNegative:t{let n=!1;const r=e.split("").filter((i,a)=>i.match(/\./g)&&!n?(n=!0,!0):i.match(/-/g)&&a===0?!0:I.includes(i)).join("");return d(r)?new s(r).toString():""})}const S=/^([-0])0+(?=\d)/,C=/(?!^\.)\.$/,B=/(?!^-)-/g,R=/^-\b0\b\.?0*$/,x=/0*$/,Q=t=>h(t,e=>{const n=e.replace(B,"").replace(C,"").replace(S,"$1");return d(n)?R.test(n)?n:z(n):e});function z(t){const e=t.split(".")[1],n=new s(t).toString(),[r,i]=n.split(".");return e&&i!==e?`${r}.${e}`:n}function h(t,e){if(!t)return t;const n=t.toLowerCase().indexOf("e")+1;return n?t.replace(/[eE]*$/g,"").substring(0,n).concat(t.slice(n).replace(/[eE]/g,"")).split(/[eE]/).map((r,i)=>e(i===1?r.replace(/\./g,""):r)).join("e").replace(/^e/,"1e"):e(t)}function T(t){const e=t.split(/[eE]/);if(e.length===1)return t;const n=+t;if(Number.isSafeInteger(n))return`${n}`;const r=t.charAt(0)==="-",i=+e[1],a=e[0].split("."),g=(r?a[0].substring(1):a[0])||"",f=a[1]||"",O=(o,l)=>{const c=Math.abs(l)-o.length,$=c>0?`${"0".repeat(c)}${o}`:o;return`${$.slice(0,l)}.${$.slice(l)}`},N=(o,l)=>{const c=l>o.length?`${o}${"0".repeat(l-o.length)}`:o;return`${c.slice(0,l)}.${c.slice(l)}`},b=i>0?`${g}${N(f,i)}`:`${O(g,i)}${f}`;return`${r?"-":""}${b.charAt(0)==="."?"0":""}${b.replace(_,"").replace(S,"")}`}function L(t){return I.some(e=>t.includes(e))}function V(t,e,n){const r=e.split(".")[1];if(r){const i=r.match(x)[0];if(i&&n.delocalize(t).length!==e.length&&r.indexOf("e")===-1){const a=n.decimal;return t=t.includes(a)?t:`${t}${a}`,t.padEnd(t.length+i.length,n.localize("0"))}}return t}const u="en",M=["ar","bg","bs","ca","cs","da","de","el",u,"es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","no","nl","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],j=["ar","bg","bs","ca","cs","da","de","de-AT","de-CH","el",u,"en-AU","en-CA","en-GB","es","es-MX","et","fi","fr","fr-CH","he","hi","hr","hu","id","it","it-CH","ja","ko","lt","lv","mk","no","nl","pl","pt","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],k=["arab","arabext","latn"],E=t=>k.includes(t),p=new Intl.NumberFormat().resolvedOptions().numberingSystem,F=p==="arab"||!E(p)?"latn":p,H=t=>E(t)?t:F;function G(t,e="cldr"){const n=e==="cldr"?j:M;return t?n.includes(t)?t:(t=t.toLowerCase(),t==="nb"?"no":e==="t9n"&&t==="pt"?"pt-BR":(t.includes("-")&&(t=t.replace(/(\w+)-(\w+)/,(r,i,a)=>`${i}-${a.toUpperCase()}`),n.includes(t)||(t=t.split("-")[0])),t==="zh"?"zh-CN":n.includes(t)?t:(console.warn(`Translations for the "${t}" locale are not available and will fall back to the default, English (en).`),u))):u}const m=new Set;function Y(t){P(t),m.size===0&&w?.observe(document.documentElement,{attributes:!0,attributeFilter:["lang"],subtree:!0}),m.add(t)}function P(t){t.effectiveLocale=U(t)}function Z(t){m.delete(t),m.size===0&&w.disconnect()}const w=D("mutation",t=>{t.forEach(e=>{const n=e.target;m.forEach(r=>{if(!A(n,r.el))return;const i=v(r.el,"[lang]");if(!i){r.effectiveLocale=u;return}const a=i.lang;r.effectiveLocale=i.hasAttribute("lang")&&a===""?u:a})})});function U(t){return t.el.lang||v(t.el,"[lang]")?.lang||document.documentElement.lang||u}class J{constructor(){this.delocalize=e=>this._numberFormatOptions?h(e,n=>n.replace(new RegExp(`[${this._minusSign}]`,"g"),"-").replace(new RegExp(`[${this._group}]`,"g"),"").replace(new RegExp(`[${this._decimal}]`,"g"),".").replace(new RegExp(`[${this._digits.join("")}]`,"g"),this._getDigitIndex)):e,this.localize=e=>this._numberFormatOptions?h(e,n=>d(n.trim())?new s(n.trim()).format(this).replace(new RegExp(`[${this._actualGroup}]`,"g"),this._group):n):e}get group(){return this._group}get decimal(){return this._decimal}get minusSign(){return this._minusSign}get digits(){return this._digits}get numberFormatter(){return this._numberFormatter}get numberFormatOptions(){return this._numberFormatOptions}set numberFormatOptions(e){if(e.locale=G(e?.locale),e.numberingSystem=H(e?.numberingSystem),!this._numberFormatOptions&&e.locale===u&&e.numberingSystem===F&&Object.keys(e).length===2||JSON.stringify(this._numberFormatOptions)===JSON.stringify(e))return;this._numberFormatOptions=e,this._numberFormatter=new Intl.NumberFormat(this._numberFormatOptions.locale,this._numberFormatOptions),this._digits=[...new Intl.NumberFormat(this._numberFormatOptions.locale,{useGrouping:!1,numberingSystem:this._numberFormatOptions.numberingSystem}).format(9876543210)].reverse();const n=new Map(this._digits.map((i,a)=>[i,a])),r=new Intl.NumberFormat(this._numberFormatOptions.locale,{numberingSystem:this._numberFormatOptions.numberingSystem}).formatToParts(-123456789e-1);this._actualGroup=r.find(i=>i.type==="group").value,this._group=this._actualGroup.trim().length===0||this._actualGroup==" "?" ":this._actualGroup,this._decimal=r.find(i=>i.type==="decimal").value,this._minusSign=r.find(i=>i.type==="minusSign").value,this._getDigitIndex=i=>n.get(i)}}const tt=new J;export{q as B,V as H,Y as K,Q as T,tt as X,d as h,Z as q,s,G as w}; diff --git a/custom-toc-highlight/assets/main-ugzBrWNm.js b/custom-toc-highlight/assets/main-QGPoLsvl.js similarity index 99% rename from custom-toc-highlight/assets/main-ugzBrWNm.js rename to custom-toc-highlight/assets/main-QGPoLsvl.js index e6e3e09b..fba0a90c 100644 --- a/custom-toc-highlight/assets/main-ugzBrWNm.js +++ b/custom-toc-highlight/assets/main-QGPoLsvl.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./story-BfX8CRfG.js","./story-D5JOvNzl.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./story-Doly9N9p.js","./story-DbFhYdqg.css"])))=>i.map(i=>d[i]); function yp(t,e){for(var i=0;in[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function i(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(r){if(r.ep)return;r.ep=!0;const s=i(r);fetch(r.href,s)}})();/** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -29,7 +29,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * vue-router v4.4.3 * (c) 2024 Eduardo San Martin Morote * @license MIT - */const rn=typeof document<"u";function Ty(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const Nt=Object.assign;function go(t,e){const i={};for(const n in e){const r=e[n];i[n]=Ve(r)?r.map(t):t(r)}return i}const ir=()=>{},Ve=Array.isArray,Uf=/#/g,Oy=/&/g,Ay=/\//g,Py=/=/g,ky=/\?/g,Wf=/\+/g,Ly=/%5B/g,My=/%5D/g,Gf=/%5E/g,Iy=/%60/g,$f=/%7B/g,Ry=/%7C/g,Xf=/%7D/g,Ny=/%20/g;function Ya(t){return encodeURI(""+t).replace(Ry,"|").replace(Ly,"[").replace(My,"]")}function Dy(t){return Ya(t).replace($f,"{").replace(Xf,"}").replace(Gf,"^")}function Jo(t){return Ya(t).replace(Wf,"%2B").replace(Ny,"+").replace(Uf,"%23").replace(Oy,"%26").replace(Iy,"`").replace($f,"{").replace(Xf,"}").replace(Gf,"^")}function jy(t){return Jo(t).replace(Py,"%3D")}function Fy(t){return Ya(t).replace(Uf,"%23").replace(ky,"%3F")}function By(t){return t==null?"":Fy(t).replace(Ay,"%2F")}function mr(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const Hy=/\/$/,Vy=t=>t.replace(Hy,"");function mo(t,e,i="/"){let n,r={},s="",o="";const c=e.indexOf("#");let l=e.indexOf("?");return c=0&&(l=-1),l>-1&&(n=e.slice(0,l),s=e.slice(l+1,c>-1?c:e.length),r=t(s)),c>-1&&(n=n||e.slice(0,c),o=e.slice(c,e.length)),n=$y(n??e,i),{fullPath:n+(s&&"?")+s+o,path:n,query:r,hash:mr(o)}}function Uy(t,e){const i=e.query?t(e.query):"";return e.path+(i&&"?")+i+(e.hash||"")}function rc(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Wy(t,e,i){const n=e.matched.length-1,r=i.matched.length-1;return n>-1&&n===r&&_n(e.matched[n],i.matched[r])&&Yf(e.params,i.params)&&t(e.query)===t(i.query)&&e.hash===i.hash}function _n(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Yf(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!Gy(t[i],e[i]))return!1;return!0}function Gy(t,e){return Ve(t)?sc(t,e):Ve(e)?sc(e,t):t===e}function sc(t,e){return Ve(e)?t.length===e.length&&t.every((i,n)=>i===e[n]):t.length===1&&t[0]===e}function $y(t,e){if(t.startsWith("/"))return t;if(!t)return e;const i=e.split("/"),n=t.split("/"),r=n[n.length-1];(r===".."||r===".")&&n.push("");let s=i.length-1,o,c;for(o=0;o1&&s--;else break;return i.slice(0,s).join("/")+"/"+n.slice(o).join("/")}const vi={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var vr;(function(t){t.pop="pop",t.push="push"})(vr||(vr={}));var nr;(function(t){t.back="back",t.forward="forward",t.unknown=""})(nr||(nr={}));function Xy(t){if(!t)if(rn){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),Vy(t)}const Yy=/^[^#]+#/;function zy(t,e){return t.replace(Yy,"#")+e}function Ky(t,e){const i=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{behavior:e.behavior,left:n.left-i.left-(e.left||0),top:n.top-i.top-(e.top||0)}}const $s=()=>({left:window.scrollX,top:window.scrollY});function qy(t){let e;if("el"in t){const i=t.el,n=typeof i=="string"&&i.startsWith("#"),r=typeof i=="string"?n?document.getElementById(i.slice(1)):document.querySelector(i):i;if(!r)return;e=Ky(r,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function oc(t,e){return(history.state?history.state.position-e:-1)+t}const Qo=new Map;function Zy(t,e){Qo.set(t,e)}function Jy(t){const e=Qo.get(t);return Qo.delete(t),e}let Qy=()=>location.protocol+"//"+location.host;function zf(t,e){const{pathname:i,search:n,hash:r}=e,s=t.indexOf("#");if(s>-1){let c=r.includes(t.slice(s))?t.slice(s).length:1,l=r.slice(c);return l[0]!=="/"&&(l="/"+l),rc(l,"")}return rc(i,t)+n+r}function t0(t,e,i,n){let r=[],s=[],o=null;const c=({state:E})=>{const b=zf(t,location),P=i.value,m=e.value;let T=0;if(E){if(i.value=b,e.value=E,o&&o===P){o=null;return}T=m?E.position-m.position:0}else n(b);r.forEach(k=>{k(i.value,P,{delta:T,type:vr.pop,direction:T?T>0?nr.forward:nr.back:nr.unknown})})};function l(){o=i.value}function O(E){r.push(E);const b=()=>{const P=r.indexOf(E);P>-1&&r.splice(P,1)};return s.push(b),b}function _(){const{history:E}=window;E.state&&E.replaceState(Nt({},E.state,{scroll:$s()}),"")}function v(){for(const E of s)E();s=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",_)}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",_,{passive:!0}),{pauseListeners:l,listen:O,destroy:v}}function ac(t,e,i,n=!1,r=!1){return{back:t,current:e,forward:i,replaced:n,position:window.history.length,scroll:r?$s():null}}function e0(t){const{history:e,location:i}=window,n={value:zf(t,i)},r={value:e.state};r.value||s(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function s(l,O,_){const v=t.indexOf("#"),E=v>-1?(i.host&&document.querySelector("base")?t:t.slice(v))+l:Qy()+t+l;try{e[_?"replaceState":"pushState"](O,"",E),r.value=O}catch(b){console.error(b),i[_?"replace":"assign"](E)}}function o(l,O){const _=Nt({},e.state,ac(r.value.back,l,r.value.forward,!0),O,{position:r.value.position});s(l,_,!0),n.value=l}function c(l,O){const _=Nt({},r.value,e.state,{forward:l,scroll:$s()});s(_.current,_,!0);const v=Nt({},ac(n.value,l,null),{position:_.position+1},O);s(l,v,!1),n.value=l}return{location:n,state:r,push:c,replace:o}}function i0(t){t=Xy(t);const e=e0(t),i=t0(t,e.state,e.location,e.replace);function n(s,o=!0){o||i.pauseListeners(),history.go(s)}const r=Nt({location:"",base:t,go:n,createHref:zy.bind(null,t)},e,i);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function n0(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),i0(t)}function r0(t){return typeof t=="string"||t&&typeof t=="object"}function Kf(t){return typeof t=="string"||typeof t=="symbol"}const qf=Symbol("");var lc;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(lc||(lc={}));function wn(t,e){return Nt(new Error,{type:t,[qf]:!0},e)}function ni(t,e){return t instanceof Error&&qf in t&&(e==null||!!(t.type&e))}const cc="[^/]+?",s0={sensitive:!1,strict:!1,start:!0,end:!0},o0=/[.+*?^${}()[\]/\\]/g;function a0(t,e){const i=Nt({},s0,e),n=[];let r=i.start?"^":"";const s=[];for(const O of t){const _=O.length?[]:[90];i.strict&&!O.length&&(r+="/");for(let v=0;ve.length?e.length===1&&e[0]===80?1:-1:0}function Zf(t,e){let i=0;const n=t.score,r=e.score;for(;i0&&e[e.length-1]<0}const c0={type:0,value:""},u0=/[a-zA-Z0-9_]/;function h0(t){if(!t)return[[]];if(t==="/")return[[c0]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(b){throw new Error(`ERR (${i})/"${O}": ${b}`)}let i=0,n=i;const r=[];let s;function o(){s&&r.push(s),s=[]}let c=0,l,O="",_="";function v(){O&&(i===0?s.push({type:0,value:O}):i===1||i===2||i===3?(s.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${O}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:O,regexp:_,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),O="")}function E(){O+=l}for(;c{o(y)}:ir}function o(v){if(Kf(v)){const E=n.get(v);E&&(n.delete(v),i.splice(i.indexOf(E),1),E.children.forEach(o),E.alias.forEach(o))}else{const E=i.indexOf(v);E>-1&&(i.splice(E,1),v.record.name&&n.delete(v.record.name),v.children.forEach(o),v.alias.forEach(o))}}function c(){return i}function l(v){const E=v0(v,i);i.splice(E,0,v),v.record.name&&!fc(v)&&n.set(v.record.name,v)}function O(v,E){let b,P={},m,T;if("name"in v&&v.name){if(b=n.get(v.name),!b)throw wn(1,{location:v});T=b.record.name,P=Nt(hc(E.params,b.keys.filter(y=>!y.optional).concat(b.parent?b.parent.keys.filter(y=>y.optional):[]).map(y=>y.name)),v.params&&hc(v.params,b.keys.map(y=>y.name))),m=b.stringify(P)}else if(v.path!=null)m=v.path,b=i.find(y=>y.re.test(m)),b&&(P=b.parse(m),T=b.record.name);else{if(b=E.name?n.get(E.name):i.find(y=>y.re.test(E.path)),!b)throw wn(1,{location:v,currentLocation:E});T=b.record.name,P=Nt({},E.params,v.params),m=b.stringify(P)}const k=[];let M=b;for(;M;)k.unshift(M.record),M=M.parent;return{name:T,path:m,params:P,matched:k,meta:m0(k)}}t.forEach(v=>s(v));function _(){i.length=0,n.clear()}return{addRoute:s,resolve:O,removeRoute:o,clearRoutes:_,getRoutes:c,getRecordMatcher:r}}function hc(t,e){const i={};for(const n of e)n in t&&(i[n]=t[n]);return i}function p0(t){return{path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:void 0,beforeEnter:t.beforeEnter,props:g0(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}}}function g0(t){const e={},i=t.props||!1;if("component"in t)e.default=i;else for(const n in t.components)e[n]=typeof i=="object"?i[n]:i;return e}function fc(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function m0(t){return t.reduce((e,i)=>Nt(e,i.meta),{})}function dc(t,e){const i={};for(const n in t)i[n]=n in e?e[n]:t[n];return i}function v0(t,e){let i=0,n=e.length;for(;i!==n;){const s=i+n>>1;Zf(t,e[s])<0?n=s:i=s+1}const r=y0(t);return r&&(n=e.lastIndexOf(r,n-1)),n}function y0(t){let e=t;for(;e=e.parent;)if(Jf(e)&&Zf(t,e)===0)return e}function Jf({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function x0(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;rs&&Jo(s)):[n&&Jo(n)]).forEach(s=>{s!==void 0&&(e+=(e.length?"&":"")+i,s!=null&&(e+="="+s))})}return e}function b0(t){const e={};for(const i in t){const n=t[i];n!==void 0&&(e[i]=Ve(n)?n.map(r=>r==null?null:""+r):n==null?n:""+n)}return e}const _0=Symbol(""),gc=Symbol(""),za=Symbol(""),Ka=Symbol(""),ta=Symbol("");function Vn(){let t=[];function e(n){return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}function i(){t=[]}return{add:e,list:()=>t.slice(),reset:i}}function Ci(t,e,i,n,r,s=o=>o()){const o=n&&(n.enterCallbacks[r]=n.enterCallbacks[r]||[]);return()=>new Promise((c,l)=>{const O=E=>{E===!1?l(wn(4,{from:i,to:e})):E instanceof Error?l(E):r0(E)?l(wn(2,{from:e,to:E})):(o&&n.enterCallbacks[r]===o&&typeof E=="function"&&o.push(E),c())},_=s(()=>t.call(n&&n.instances[r],e,i,O));let v=Promise.resolve(_);t.length<3&&(v=v.then(O)),v.catch(E=>l(E))})}function vo(t,e,i,n,r=s=>s()){const s=[];for(const o of t)for(const c in o.components){let l=o.components[c];if(!(e!=="beforeRouteEnter"&&!o.instances[c]))if(w0(l)){const _=(l.__vccOpts||l)[e];_&&s.push(Ci(_,i,n,o,c,r))}else{let O=l();s.push(()=>O.then(_=>{if(!_)return Promise.reject(new Error(`Couldn't resolve component "${c}" at "${o.path}"`));const v=Ty(_)?_.default:_;o.components[c]=v;const b=(v.__vccOpts||v)[e];return b&&Ci(b,i,n,o,c,r)()}))}}return s}function w0(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function mc(t){const e=Oe(za),i=Oe(Ka),n=$t(()=>{const l=Be(t.to);return e.resolve(l)}),r=$t(()=>{const{matched:l}=n.value,{length:O}=l,_=l[O-1],v=i.matched;if(!_||!v.length)return-1;const E=v.findIndex(_n.bind(null,_));if(E>-1)return E;const b=vc(l[O-2]);return O>1&&vc(_)===b&&v[v.length-1].path!==b?v.findIndex(_n.bind(null,l[O-2])):E}),s=$t(()=>r.value>-1&&T0(i.params,n.value.params)),o=$t(()=>r.value>-1&&r.value===i.matched.length-1&&Yf(i.params,n.value.params));function c(l={}){return S0(l)?e[Be(t.replace)?"replace":"push"](Be(t.to)).catch(ir):Promise.resolve()}return{route:n,href:$t(()=>n.value.href),isActive:s,isExactActive:o,navigate:c}}const E0=Ue({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:mc,setup(t,{slots:e}){const i=qi(mc(t)),{options:n}=Oe(za),r=$t(()=>({[yc(t.activeClass,n.linkActiveClass,"router-link-active")]:i.isActive,[yc(t.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:i.isExactActive}));return()=>{const s=e.default&&e.default(i);return t.custom?s:Se("a",{"aria-current":i.isExactActive?t.ariaCurrentValue:null,href:i.href,onClick:i.navigate,class:r.value},s)}}}),C0=E0;function S0(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function T0(t,e){for(const i in e){const n=e[i],r=t[i];if(typeof n=="string"){if(n!==r)return!1}else if(!Ve(r)||r.length!==n.length||n.some((s,o)=>s!==r[o]))return!1}return!0}function vc(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const yc=(t,e,i)=>t??e??i,O0=Ue({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:i}){const n=Oe(ta),r=$t(()=>t.route||n.value),s=Oe(gc,0),o=$t(()=>{let O=Be(s);const{matched:_}=r.value;let v;for(;(v=_[O])&&!v.components;)O++;return O}),c=$t(()=>r.value.matched[o.value]);Qn(gc,$t(()=>o.value+1)),Qn(_0,c),Qn(ta,r);const l=Yt();return le(()=>[l.value,c.value,t.name],([O,_,v],[E,b,P])=>{_&&(_.instances[v]=O,b&&b!==_&&O&&O===E&&(_.leaveGuards.size||(_.leaveGuards=b.leaveGuards),_.updateGuards.size||(_.updateGuards=b.updateGuards))),O&&_&&(!b||!_n(_,b)||!E)&&(_.enterCallbacks[v]||[]).forEach(m=>m(O))},{flush:"post"}),()=>{const O=r.value,_=t.name,v=c.value,E=v&&v.components[_];if(!E)return xc(i.default,{Component:E,route:O});const b=v.props[_],P=b?b===!0?O.params:typeof b=="function"?b(O):b:null,T=Se(E,Nt({},P,e,{onVnodeUnmounted:k=>{k.component.isUnmounted&&(v.instances[_]=null)},ref:l}));return xc(i.default,{Component:T,route:O})||T}}});function xc(t,e){if(!t)return null;const i=t(e);return i.length===1?i[0]:i}const A0=O0;function P0(t){const e=d0(t.routes,t),i=t.parseQuery||x0,n=t.stringifyQuery||pc,r=t.history,s=Vn(),o=Vn(),c=Vn(),l=In(vi);let O=vi;rn&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const _=go.bind(null,G=>""+G),v=go.bind(null,By),E=go.bind(null,mr);function b(G,J){let C,U;return Kf(G)?(C=e.getRecordMatcher(G),U=J):U=G,e.addRoute(U,C)}function P(G){const J=e.getRecordMatcher(G);J&&e.removeRoute(J)}function m(){return e.getRoutes().map(G=>G.record)}function T(G){return!!e.getRecordMatcher(G)}function k(G,J){if(J=Nt({},J||l.value),typeof G=="string"){const F=mo(i,G,J.path),X=e.resolve({path:F.path},J),st=r.createHref(F.fullPath);return Nt(F,X,{params:E(X.params),hash:mr(F.hash),redirectedFrom:void 0,href:st})}let C;if(G.path!=null)C=Nt({},G,{path:mo(i,G.path,J.path).path});else{const F=Nt({},G.params);for(const X in F)F[X]==null&&delete F[X];C=Nt({},G,{params:v(F)}),J.params=v(J.params)}const U=e.resolve(C,J),B=G.hash||"";U.params=_(E(U.params));const tt=Uy(n,Nt({},G,{hash:Dy(B),path:U.path})),D=r.createHref(tt);return Nt({fullPath:tt,hash:B,query:n===pc?b0(G.query):G.query||{}},U,{redirectedFrom:void 0,href:D})}function M(G){return typeof G=="string"?mo(i,G,l.value.path):Nt({},G)}function y(G,J){if(O!==G)return wn(8,{from:J,to:G})}function a(G){return A(G)}function S(G){return a(Nt(M(G),{replace:!0}))}function w(G){const J=G.matched[G.matched.length-1];if(J&&J.redirect){const{redirect:C}=J;let U=typeof C=="function"?C(G):C;return typeof U=="string"&&(U=U.includes("?")||U.includes("#")?U=M(U):{path:U},U.params={}),Nt({query:G.query,hash:G.hash,params:U.path!=null?{}:G.params},U)}}function A(G,J){const C=O=k(G),U=l.value,B=G.state,tt=G.force,D=G.replace===!0,F=w(C);if(F)return A(Nt(M(F),{state:typeof F=="object"?Nt({},B,F.state):B,force:tt,replace:D}),J||C);const X=C;X.redirectedFrom=J;let st;return!tt&&Wy(n,U,C)&&(st=wn(16,{to:X,from:U}),H(U,U,!0,!1)),(st?Promise.resolve(st):g(X,U)).catch(ot=>ni(ot)?ni(ot,2)?ot:it(ot):$(ot,X,U)).then(ot=>{if(ot){if(ni(ot,2))return A(Nt({replace:D},M(ot.to),{state:typeof ot.to=="object"?Nt({},B,ot.to.state):B,force:tt}),J||X)}else ot=x(X,U,!0,D,B);return h(X,U,ot),ot})}function f(G,J){const C=y(G,J);return C?Promise.reject(C):Promise.resolve()}function u(G){const J=N.values().next().value;return J&&typeof J.runWithContext=="function"?J.runWithContext(G):G()}function g(G,J){let C;const[U,B,tt]=k0(G,J);C=vo(U.reverse(),"beforeRouteLeave",G,J);for(const F of U)F.leaveGuards.forEach(X=>{C.push(Ci(X,G,J))});const D=f.bind(null,G,J);return C.push(D),K(C).then(()=>{C=[];for(const F of s.list())C.push(Ci(F,G,J));return C.push(D),K(C)}).then(()=>{C=vo(B,"beforeRouteUpdate",G,J);for(const F of B)F.updateGuards.forEach(X=>{C.push(Ci(X,G,J))});return C.push(D),K(C)}).then(()=>{C=[];for(const F of tt)if(F.beforeEnter)if(Ve(F.beforeEnter))for(const X of F.beforeEnter)C.push(Ci(X,G,J));else C.push(Ci(F.beforeEnter,G,J));return C.push(D),K(C)}).then(()=>(G.matched.forEach(F=>F.enterCallbacks={}),C=vo(tt,"beforeRouteEnter",G,J,u),C.push(D),K(C))).then(()=>{C=[];for(const F of o.list())C.push(Ci(F,G,J));return C.push(D),K(C)}).catch(F=>ni(F,8)?F:Promise.reject(F))}function h(G,J,C){c.list().forEach(U=>u(()=>U(G,J,C)))}function x(G,J,C,U,B){const tt=y(G,J);if(tt)return tt;const D=J===vi,F=rn?history.state:{};C&&(U||D?r.replace(G.fullPath,Nt({scroll:D&&F&&F.scroll},B)):r.push(G.fullPath,B)),l.value=G,H(G,J,C,D),it()}let d;function p(){d||(d=r.listen((G,J,C)=>{if(!V.listening)return;const U=k(G),B=w(U);if(B){A(Nt(B,{replace:!0}),U).catch(ir);return}O=U;const tt=l.value;rn&&Zy(oc(tt.fullPath,C.delta),$s()),g(U,tt).catch(D=>ni(D,12)?D:ni(D,2)?(A(D.to,U).then(F=>{ni(F,20)&&!C.delta&&C.type===vr.pop&&r.go(-1,!1)}).catch(ir),Promise.reject()):(C.delta&&r.go(-C.delta,!1),$(D,U,tt))).then(D=>{D=D||x(U,tt,!1),D&&(C.delta&&!ni(D,8)?r.go(-C.delta,!1):C.type===vr.pop&&ni(D,20)&&r.go(-1,!1)),h(U,tt,D)}).catch(ir)}))}let R=Vn(),I=Vn(),j;function $(G,J,C){it(G);const U=I.list();return U.length?U.forEach(B=>B(G,J,C)):console.error(G),Promise.reject(G)}function et(){return j&&l.value!==vi?Promise.resolve():new Promise((G,J)=>{R.add([G,J])})}function it(G){return j||(j=!G,p(),R.list().forEach(([J,C])=>G?C(G):J()),R.reset()),G}function H(G,J,C,U){const{scrollBehavior:B}=t;if(!rn||!B)return Promise.resolve();const tt=!C&&Jy(oc(G.fullPath,0))||(U||!C)&&history.state&&history.state.scroll||null;return Nn().then(()=>B(G,J,tt)).then(D=>D&&qy(D)).catch(D=>$(D,G,J))}const z=G=>r.go(G);let L;const N=new Set,V={currentRoute:l,listening:!0,addRoute:b,removeRoute:P,clearRoutes:e.clearRoutes,hasRoute:T,getRoutes:m,resolve:k,options:t,push:a,replace:S,go:z,back:()=>z(-1),forward:()=>z(1),beforeEach:s.add,beforeResolve:o.add,afterEach:c.add,onError:I.add,isReady:et,install(G){const J=this;G.component("RouterLink",C0),G.component("RouterView",A0),G.config.globalProperties.$router=J,Object.defineProperty(G.config.globalProperties,"$route",{enumerable:!0,get:()=>Be(l)}),rn&&!L&&l.value===vi&&(L=!0,a(r.location).catch(B=>{}));const C={};for(const B in vi)Object.defineProperty(C,B,{get:()=>l.value[B],enumerable:!0});G.provide(za,J),G.provide(Ka,Sa(C)),G.provide(ta,l);const U=G.unmount;N.add(G),G.unmount=function(){N.delete(G),N.size<1&&(O=vi,d&&d(),d=null,l.value=vi,L=!1,j=!1),U()}}};function K(G){return G.reduce((J,C)=>J.then(()=>u(C)),Promise.resolve())}return V}function k0(t,e){const i=[],n=[],r=[],s=Math.max(e.matched.length,t.matched.length);for(let o=0;o_n(O,c))?n.push(c):i.push(c));const l=t.matched[o];l&&(e.matched.find(O=>_n(O,l))||r.push(l))}return[i,n,r]}function w1(t){return Oe(Ka)}const L0=[{path:"/",component:()=>po(()=>import("./story-BfX8CRfG.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:uid",component:()=>po(()=>import("./story-BfX8CRfG.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:lang/:uid",component:()=>po(()=>import("./story-BfX8CRfG.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)}],M0=P0({routes:L0,history:n0(),scrollBehavior:function(t){if(t.hash)return{el:decodeURIComponent(t.hash),behavior:"smooth",top:(document.getElementById("h-navbar")?.clientHeight||0)+(document.getElementById("story-header")?.clientHeight||0)}}});/*! + */const rn=typeof document<"u";function Ty(t){return t.__esModule||t[Symbol.toStringTag]==="Module"}const Nt=Object.assign;function go(t,e){const i={};for(const n in e){const r=e[n];i[n]=Ve(r)?r.map(t):t(r)}return i}const ir=()=>{},Ve=Array.isArray,Uf=/#/g,Oy=/&/g,Ay=/\//g,Py=/=/g,ky=/\?/g,Wf=/\+/g,Ly=/%5B/g,My=/%5D/g,Gf=/%5E/g,Iy=/%60/g,$f=/%7B/g,Ry=/%7C/g,Xf=/%7D/g,Ny=/%20/g;function Ya(t){return encodeURI(""+t).replace(Ry,"|").replace(Ly,"[").replace(My,"]")}function Dy(t){return Ya(t).replace($f,"{").replace(Xf,"}").replace(Gf,"^")}function Jo(t){return Ya(t).replace(Wf,"%2B").replace(Ny,"+").replace(Uf,"%23").replace(Oy,"%26").replace(Iy,"`").replace($f,"{").replace(Xf,"}").replace(Gf,"^")}function jy(t){return Jo(t).replace(Py,"%3D")}function Fy(t){return Ya(t).replace(Uf,"%23").replace(ky,"%3F")}function By(t){return t==null?"":Fy(t).replace(Ay,"%2F")}function mr(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const Hy=/\/$/,Vy=t=>t.replace(Hy,"");function mo(t,e,i="/"){let n,r={},s="",o="";const c=e.indexOf("#");let l=e.indexOf("?");return c=0&&(l=-1),l>-1&&(n=e.slice(0,l),s=e.slice(l+1,c>-1?c:e.length),r=t(s)),c>-1&&(n=n||e.slice(0,c),o=e.slice(c,e.length)),n=$y(n??e,i),{fullPath:n+(s&&"?")+s+o,path:n,query:r,hash:mr(o)}}function Uy(t,e){const i=e.query?t(e.query):"";return e.path+(i&&"?")+i+(e.hash||"")}function rc(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Wy(t,e,i){const n=e.matched.length-1,r=i.matched.length-1;return n>-1&&n===r&&_n(e.matched[n],i.matched[r])&&Yf(e.params,i.params)&&t(e.query)===t(i.query)&&e.hash===i.hash}function _n(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function Yf(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!Gy(t[i],e[i]))return!1;return!0}function Gy(t,e){return Ve(t)?sc(t,e):Ve(e)?sc(e,t):t===e}function sc(t,e){return Ve(e)?t.length===e.length&&t.every((i,n)=>i===e[n]):t.length===1&&t[0]===e}function $y(t,e){if(t.startsWith("/"))return t;if(!t)return e;const i=e.split("/"),n=t.split("/"),r=n[n.length-1];(r===".."||r===".")&&n.push("");let s=i.length-1,o,c;for(o=0;o1&&s--;else break;return i.slice(0,s).join("/")+"/"+n.slice(o).join("/")}const vi={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var vr;(function(t){t.pop="pop",t.push="push"})(vr||(vr={}));var nr;(function(t){t.back="back",t.forward="forward",t.unknown=""})(nr||(nr={}));function Xy(t){if(!t)if(rn){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),Vy(t)}const Yy=/^[^#]+#/;function zy(t,e){return t.replace(Yy,"#")+e}function Ky(t,e){const i=document.documentElement.getBoundingClientRect(),n=t.getBoundingClientRect();return{behavior:e.behavior,left:n.left-i.left-(e.left||0),top:n.top-i.top-(e.top||0)}}const $s=()=>({left:window.scrollX,top:window.scrollY});function qy(t){let e;if("el"in t){const i=t.el,n=typeof i=="string"&&i.startsWith("#"),r=typeof i=="string"?n?document.getElementById(i.slice(1)):document.querySelector(i):i;if(!r)return;e=Ky(r,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}function oc(t,e){return(history.state?history.state.position-e:-1)+t}const Qo=new Map;function Zy(t,e){Qo.set(t,e)}function Jy(t){const e=Qo.get(t);return Qo.delete(t),e}let Qy=()=>location.protocol+"//"+location.host;function zf(t,e){const{pathname:i,search:n,hash:r}=e,s=t.indexOf("#");if(s>-1){let c=r.includes(t.slice(s))?t.slice(s).length:1,l=r.slice(c);return l[0]!=="/"&&(l="/"+l),rc(l,"")}return rc(i,t)+n+r}function t0(t,e,i,n){let r=[],s=[],o=null;const c=({state:E})=>{const b=zf(t,location),P=i.value,m=e.value;let T=0;if(E){if(i.value=b,e.value=E,o&&o===P){o=null;return}T=m?E.position-m.position:0}else n(b);r.forEach(k=>{k(i.value,P,{delta:T,type:vr.pop,direction:T?T>0?nr.forward:nr.back:nr.unknown})})};function l(){o=i.value}function O(E){r.push(E);const b=()=>{const P=r.indexOf(E);P>-1&&r.splice(P,1)};return s.push(b),b}function _(){const{history:E}=window;E.state&&E.replaceState(Nt({},E.state,{scroll:$s()}),"")}function v(){for(const E of s)E();s=[],window.removeEventListener("popstate",c),window.removeEventListener("beforeunload",_)}return window.addEventListener("popstate",c),window.addEventListener("beforeunload",_,{passive:!0}),{pauseListeners:l,listen:O,destroy:v}}function ac(t,e,i,n=!1,r=!1){return{back:t,current:e,forward:i,replaced:n,position:window.history.length,scroll:r?$s():null}}function e0(t){const{history:e,location:i}=window,n={value:zf(t,i)},r={value:e.state};r.value||s(n.value,{back:null,current:n.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function s(l,O,_){const v=t.indexOf("#"),E=v>-1?(i.host&&document.querySelector("base")?t:t.slice(v))+l:Qy()+t+l;try{e[_?"replaceState":"pushState"](O,"",E),r.value=O}catch(b){console.error(b),i[_?"replace":"assign"](E)}}function o(l,O){const _=Nt({},e.state,ac(r.value.back,l,r.value.forward,!0),O,{position:r.value.position});s(l,_,!0),n.value=l}function c(l,O){const _=Nt({},r.value,e.state,{forward:l,scroll:$s()});s(_.current,_,!0);const v=Nt({},ac(n.value,l,null),{position:_.position+1},O);s(l,v,!1),n.value=l}return{location:n,state:r,push:c,replace:o}}function i0(t){t=Xy(t);const e=e0(t),i=t0(t,e.state,e.location,e.replace);function n(s,o=!0){o||i.pauseListeners(),history.go(s)}const r=Nt({location:"",base:t,go:n,createHref:zy.bind(null,t)},e,i);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function n0(t){return t=location.host?t||location.pathname+location.search:"",t.includes("#")||(t+="#"),i0(t)}function r0(t){return typeof t=="string"||t&&typeof t=="object"}function Kf(t){return typeof t=="string"||typeof t=="symbol"}const qf=Symbol("");var lc;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(lc||(lc={}));function wn(t,e){return Nt(new Error,{type:t,[qf]:!0},e)}function ni(t,e){return t instanceof Error&&qf in t&&(e==null||!!(t.type&e))}const cc="[^/]+?",s0={sensitive:!1,strict:!1,start:!0,end:!0},o0=/[.+*?^${}()[\]/\\]/g;function a0(t,e){const i=Nt({},s0,e),n=[];let r=i.start?"^":"";const s=[];for(const O of t){const _=O.length?[]:[90];i.strict&&!O.length&&(r+="/");for(let v=0;ve.length?e.length===1&&e[0]===80?1:-1:0}function Zf(t,e){let i=0;const n=t.score,r=e.score;for(;i0&&e[e.length-1]<0}const c0={type:0,value:""},u0=/[a-zA-Z0-9_]/;function h0(t){if(!t)return[[]];if(t==="/")return[[c0]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(b){throw new Error(`ERR (${i})/"${O}": ${b}`)}let i=0,n=i;const r=[];let s;function o(){s&&r.push(s),s=[]}let c=0,l,O="",_="";function v(){O&&(i===0?s.push({type:0,value:O}):i===1||i===2||i===3?(s.length>1&&(l==="*"||l==="+")&&e(`A repeatable param (${O}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:O,regexp:_,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):e("Invalid state to consume buffer"),O="")}function E(){O+=l}for(;c{o(y)}:ir}function o(v){if(Kf(v)){const E=n.get(v);E&&(n.delete(v),i.splice(i.indexOf(E),1),E.children.forEach(o),E.alias.forEach(o))}else{const E=i.indexOf(v);E>-1&&(i.splice(E,1),v.record.name&&n.delete(v.record.name),v.children.forEach(o),v.alias.forEach(o))}}function c(){return i}function l(v){const E=v0(v,i);i.splice(E,0,v),v.record.name&&!fc(v)&&n.set(v.record.name,v)}function O(v,E){let b,P={},m,T;if("name"in v&&v.name){if(b=n.get(v.name),!b)throw wn(1,{location:v});T=b.record.name,P=Nt(hc(E.params,b.keys.filter(y=>!y.optional).concat(b.parent?b.parent.keys.filter(y=>y.optional):[]).map(y=>y.name)),v.params&&hc(v.params,b.keys.map(y=>y.name))),m=b.stringify(P)}else if(v.path!=null)m=v.path,b=i.find(y=>y.re.test(m)),b&&(P=b.parse(m),T=b.record.name);else{if(b=E.name?n.get(E.name):i.find(y=>y.re.test(E.path)),!b)throw wn(1,{location:v,currentLocation:E});T=b.record.name,P=Nt({},E.params,v.params),m=b.stringify(P)}const k=[];let M=b;for(;M;)k.unshift(M.record),M=M.parent;return{name:T,path:m,params:P,matched:k,meta:m0(k)}}t.forEach(v=>s(v));function _(){i.length=0,n.clear()}return{addRoute:s,resolve:O,removeRoute:o,clearRoutes:_,getRoutes:c,getRecordMatcher:r}}function hc(t,e){const i={};for(const n of e)n in t&&(i[n]=t[n]);return i}function p0(t){return{path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:void 0,beforeEnter:t.beforeEnter,props:g0(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}}}function g0(t){const e={},i=t.props||!1;if("component"in t)e.default=i;else for(const n in t.components)e[n]=typeof i=="object"?i[n]:i;return e}function fc(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function m0(t){return t.reduce((e,i)=>Nt(e,i.meta),{})}function dc(t,e){const i={};for(const n in t)i[n]=n in e?e[n]:t[n];return i}function v0(t,e){let i=0,n=e.length;for(;i!==n;){const s=i+n>>1;Zf(t,e[s])<0?n=s:i=s+1}const r=y0(t);return r&&(n=e.lastIndexOf(r,n-1)),n}function y0(t){let e=t;for(;e=e.parent;)if(Jf(e)&&Zf(t,e)===0)return e}function Jf({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function x0(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;rs&&Jo(s)):[n&&Jo(n)]).forEach(s=>{s!==void 0&&(e+=(e.length?"&":"")+i,s!=null&&(e+="="+s))})}return e}function b0(t){const e={};for(const i in t){const n=t[i];n!==void 0&&(e[i]=Ve(n)?n.map(r=>r==null?null:""+r):n==null?n:""+n)}return e}const _0=Symbol(""),gc=Symbol(""),za=Symbol(""),Ka=Symbol(""),ta=Symbol("");function Vn(){let t=[];function e(n){return t.push(n),()=>{const r=t.indexOf(n);r>-1&&t.splice(r,1)}}function i(){t=[]}return{add:e,list:()=>t.slice(),reset:i}}function Ci(t,e,i,n,r,s=o=>o()){const o=n&&(n.enterCallbacks[r]=n.enterCallbacks[r]||[]);return()=>new Promise((c,l)=>{const O=E=>{E===!1?l(wn(4,{from:i,to:e})):E instanceof Error?l(E):r0(E)?l(wn(2,{from:e,to:E})):(o&&n.enterCallbacks[r]===o&&typeof E=="function"&&o.push(E),c())},_=s(()=>t.call(n&&n.instances[r],e,i,O));let v=Promise.resolve(_);t.length<3&&(v=v.then(O)),v.catch(E=>l(E))})}function vo(t,e,i,n,r=s=>s()){const s=[];for(const o of t)for(const c in o.components){let l=o.components[c];if(!(e!=="beforeRouteEnter"&&!o.instances[c]))if(w0(l)){const _=(l.__vccOpts||l)[e];_&&s.push(Ci(_,i,n,o,c,r))}else{let O=l();s.push(()=>O.then(_=>{if(!_)return Promise.reject(new Error(`Couldn't resolve component "${c}" at "${o.path}"`));const v=Ty(_)?_.default:_;o.components[c]=v;const b=(v.__vccOpts||v)[e];return b&&Ci(b,i,n,o,c,r)()}))}}return s}function w0(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function mc(t){const e=Oe(za),i=Oe(Ka),n=$t(()=>{const l=Be(t.to);return e.resolve(l)}),r=$t(()=>{const{matched:l}=n.value,{length:O}=l,_=l[O-1],v=i.matched;if(!_||!v.length)return-1;const E=v.findIndex(_n.bind(null,_));if(E>-1)return E;const b=vc(l[O-2]);return O>1&&vc(_)===b&&v[v.length-1].path!==b?v.findIndex(_n.bind(null,l[O-2])):E}),s=$t(()=>r.value>-1&&T0(i.params,n.value.params)),o=$t(()=>r.value>-1&&r.value===i.matched.length-1&&Yf(i.params,n.value.params));function c(l={}){return S0(l)?e[Be(t.replace)?"replace":"push"](Be(t.to)).catch(ir):Promise.resolve()}return{route:n,href:$t(()=>n.value.href),isActive:s,isExactActive:o,navigate:c}}const E0=Ue({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:mc,setup(t,{slots:e}){const i=qi(mc(t)),{options:n}=Oe(za),r=$t(()=>({[yc(t.activeClass,n.linkActiveClass,"router-link-active")]:i.isActive,[yc(t.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:i.isExactActive}));return()=>{const s=e.default&&e.default(i);return t.custom?s:Se("a",{"aria-current":i.isExactActive?t.ariaCurrentValue:null,href:i.href,onClick:i.navigate,class:r.value},s)}}}),C0=E0;function S0(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function T0(t,e){for(const i in e){const n=e[i],r=t[i];if(typeof n=="string"){if(n!==r)return!1}else if(!Ve(r)||r.length!==n.length||n.some((s,o)=>s!==r[o]))return!1}return!0}function vc(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const yc=(t,e,i)=>t??e??i,O0=Ue({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:i}){const n=Oe(ta),r=$t(()=>t.route||n.value),s=Oe(gc,0),o=$t(()=>{let O=Be(s);const{matched:_}=r.value;let v;for(;(v=_[O])&&!v.components;)O++;return O}),c=$t(()=>r.value.matched[o.value]);Qn(gc,$t(()=>o.value+1)),Qn(_0,c),Qn(ta,r);const l=Yt();return le(()=>[l.value,c.value,t.name],([O,_,v],[E,b,P])=>{_&&(_.instances[v]=O,b&&b!==_&&O&&O===E&&(_.leaveGuards.size||(_.leaveGuards=b.leaveGuards),_.updateGuards.size||(_.updateGuards=b.updateGuards))),O&&_&&(!b||!_n(_,b)||!E)&&(_.enterCallbacks[v]||[]).forEach(m=>m(O))},{flush:"post"}),()=>{const O=r.value,_=t.name,v=c.value,E=v&&v.components[_];if(!E)return xc(i.default,{Component:E,route:O});const b=v.props[_],P=b?b===!0?O.params:typeof b=="function"?b(O):b:null,T=Se(E,Nt({},P,e,{onVnodeUnmounted:k=>{k.component.isUnmounted&&(v.instances[_]=null)},ref:l}));return xc(i.default,{Component:T,route:O})||T}}});function xc(t,e){if(!t)return null;const i=t(e);return i.length===1?i[0]:i}const A0=O0;function P0(t){const e=d0(t.routes,t),i=t.parseQuery||x0,n=t.stringifyQuery||pc,r=t.history,s=Vn(),o=Vn(),c=Vn(),l=In(vi);let O=vi;rn&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const _=go.bind(null,G=>""+G),v=go.bind(null,By),E=go.bind(null,mr);function b(G,J){let C,U;return Kf(G)?(C=e.getRecordMatcher(G),U=J):U=G,e.addRoute(U,C)}function P(G){const J=e.getRecordMatcher(G);J&&e.removeRoute(J)}function m(){return e.getRoutes().map(G=>G.record)}function T(G){return!!e.getRecordMatcher(G)}function k(G,J){if(J=Nt({},J||l.value),typeof G=="string"){const F=mo(i,G,J.path),X=e.resolve({path:F.path},J),st=r.createHref(F.fullPath);return Nt(F,X,{params:E(X.params),hash:mr(F.hash),redirectedFrom:void 0,href:st})}let C;if(G.path!=null)C=Nt({},G,{path:mo(i,G.path,J.path).path});else{const F=Nt({},G.params);for(const X in F)F[X]==null&&delete F[X];C=Nt({},G,{params:v(F)}),J.params=v(J.params)}const U=e.resolve(C,J),B=G.hash||"";U.params=_(E(U.params));const tt=Uy(n,Nt({},G,{hash:Dy(B),path:U.path})),D=r.createHref(tt);return Nt({fullPath:tt,hash:B,query:n===pc?b0(G.query):G.query||{}},U,{redirectedFrom:void 0,href:D})}function M(G){return typeof G=="string"?mo(i,G,l.value.path):Nt({},G)}function y(G,J){if(O!==G)return wn(8,{from:J,to:G})}function a(G){return A(G)}function S(G){return a(Nt(M(G),{replace:!0}))}function w(G){const J=G.matched[G.matched.length-1];if(J&&J.redirect){const{redirect:C}=J;let U=typeof C=="function"?C(G):C;return typeof U=="string"&&(U=U.includes("?")||U.includes("#")?U=M(U):{path:U},U.params={}),Nt({query:G.query,hash:G.hash,params:U.path!=null?{}:G.params},U)}}function A(G,J){const C=O=k(G),U=l.value,B=G.state,tt=G.force,D=G.replace===!0,F=w(C);if(F)return A(Nt(M(F),{state:typeof F=="object"?Nt({},B,F.state):B,force:tt,replace:D}),J||C);const X=C;X.redirectedFrom=J;let st;return!tt&&Wy(n,U,C)&&(st=wn(16,{to:X,from:U}),H(U,U,!0,!1)),(st?Promise.resolve(st):g(X,U)).catch(ot=>ni(ot)?ni(ot,2)?ot:it(ot):$(ot,X,U)).then(ot=>{if(ot){if(ni(ot,2))return A(Nt({replace:D},M(ot.to),{state:typeof ot.to=="object"?Nt({},B,ot.to.state):B,force:tt}),J||X)}else ot=x(X,U,!0,D,B);return h(X,U,ot),ot})}function f(G,J){const C=y(G,J);return C?Promise.reject(C):Promise.resolve()}function u(G){const J=N.values().next().value;return J&&typeof J.runWithContext=="function"?J.runWithContext(G):G()}function g(G,J){let C;const[U,B,tt]=k0(G,J);C=vo(U.reverse(),"beforeRouteLeave",G,J);for(const F of U)F.leaveGuards.forEach(X=>{C.push(Ci(X,G,J))});const D=f.bind(null,G,J);return C.push(D),K(C).then(()=>{C=[];for(const F of s.list())C.push(Ci(F,G,J));return C.push(D),K(C)}).then(()=>{C=vo(B,"beforeRouteUpdate",G,J);for(const F of B)F.updateGuards.forEach(X=>{C.push(Ci(X,G,J))});return C.push(D),K(C)}).then(()=>{C=[];for(const F of tt)if(F.beforeEnter)if(Ve(F.beforeEnter))for(const X of F.beforeEnter)C.push(Ci(X,G,J));else C.push(Ci(F.beforeEnter,G,J));return C.push(D),K(C)}).then(()=>(G.matched.forEach(F=>F.enterCallbacks={}),C=vo(tt,"beforeRouteEnter",G,J,u),C.push(D),K(C))).then(()=>{C=[];for(const F of o.list())C.push(Ci(F,G,J));return C.push(D),K(C)}).catch(F=>ni(F,8)?F:Promise.reject(F))}function h(G,J,C){c.list().forEach(U=>u(()=>U(G,J,C)))}function x(G,J,C,U,B){const tt=y(G,J);if(tt)return tt;const D=J===vi,F=rn?history.state:{};C&&(U||D?r.replace(G.fullPath,Nt({scroll:D&&F&&F.scroll},B)):r.push(G.fullPath,B)),l.value=G,H(G,J,C,D),it()}let d;function p(){d||(d=r.listen((G,J,C)=>{if(!V.listening)return;const U=k(G),B=w(U);if(B){A(Nt(B,{replace:!0}),U).catch(ir);return}O=U;const tt=l.value;rn&&Zy(oc(tt.fullPath,C.delta),$s()),g(U,tt).catch(D=>ni(D,12)?D:ni(D,2)?(A(D.to,U).then(F=>{ni(F,20)&&!C.delta&&C.type===vr.pop&&r.go(-1,!1)}).catch(ir),Promise.reject()):(C.delta&&r.go(-C.delta,!1),$(D,U,tt))).then(D=>{D=D||x(U,tt,!1),D&&(C.delta&&!ni(D,8)?r.go(-C.delta,!1):C.type===vr.pop&&ni(D,20)&&r.go(-1,!1)),h(U,tt,D)}).catch(ir)}))}let R=Vn(),I=Vn(),j;function $(G,J,C){it(G);const U=I.list();return U.length?U.forEach(B=>B(G,J,C)):console.error(G),Promise.reject(G)}function et(){return j&&l.value!==vi?Promise.resolve():new Promise((G,J)=>{R.add([G,J])})}function it(G){return j||(j=!G,p(),R.list().forEach(([J,C])=>G?C(G):J()),R.reset()),G}function H(G,J,C,U){const{scrollBehavior:B}=t;if(!rn||!B)return Promise.resolve();const tt=!C&&Jy(oc(G.fullPath,0))||(U||!C)&&history.state&&history.state.scroll||null;return Nn().then(()=>B(G,J,tt)).then(D=>D&&qy(D)).catch(D=>$(D,G,J))}const z=G=>r.go(G);let L;const N=new Set,V={currentRoute:l,listening:!0,addRoute:b,removeRoute:P,clearRoutes:e.clearRoutes,hasRoute:T,getRoutes:m,resolve:k,options:t,push:a,replace:S,go:z,back:()=>z(-1),forward:()=>z(1),beforeEach:s.add,beforeResolve:o.add,afterEach:c.add,onError:I.add,isReady:et,install(G){const J=this;G.component("RouterLink",C0),G.component("RouterView",A0),G.config.globalProperties.$router=J,Object.defineProperty(G.config.globalProperties,"$route",{enumerable:!0,get:()=>Be(l)}),rn&&!L&&l.value===vi&&(L=!0,a(r.location).catch(B=>{}));const C={};for(const B in vi)Object.defineProperty(C,B,{get:()=>l.value[B],enumerable:!0});G.provide(za,J),G.provide(Ka,Sa(C)),G.provide(ta,l);const U=G.unmount;N.add(G),G.unmount=function(){N.delete(G),N.size<1&&(O=vi,d&&d(),d=null,l.value=vi,L=!1,j=!1),U()}}};function K(G){return G.reduce((J,C)=>J.then(()=>u(C)),Promise.resolve())}return V}function k0(t,e){const i=[],n=[],r=[],s=Math.max(e.matched.length,t.matched.length);for(let o=0;o_n(O,c))?n.push(c):i.push(c));const l=t.matched[o];l&&(e.matched.find(O=>_n(O,l))||r.push(l))}return[i,n,r]}function w1(t){return Oe(Ka)}const L0=[{path:"/",component:()=>po(()=>import("./story-Doly9N9p.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:uid",component:()=>po(()=>import("./story-Doly9N9p.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)},{path:"/:lang/:uid",component:()=>po(()=>import("./story-Doly9N9p.js").then(t=>t.kq),__vite__mapDeps([0,1]),import.meta.url)}],M0=P0({routes:L0,history:n0(),scrollBehavior:function(t){if(t.hash)return{el:decodeURIComponent(t.hash),behavior:"smooth",top:(document.getElementById("h-navbar")?.clientHeight||0)+(document.getElementById("story-header")?.clientHeight||0)}}});/*! * shared v9.14.0 * (c) 2024 kazuya kawaguchi * Released under the MIT License. diff --git a/custom-toc-highlight/assets/mapViewDeps-CUVU8gUp-Ccomlwj9.js b/custom-toc-highlight/assets/mapViewDeps-CUVU8gUp-CjUjdWc1.js similarity index 94% rename from custom-toc-highlight/assets/mapViewDeps-CUVU8gUp-Ccomlwj9.js rename to custom-toc-highlight/assets/mapViewDeps-CUVU8gUp-CjUjdWc1.js index add7443c..5e201538 100644 --- a/custom-toc-highlight/assets/mapViewDeps-CUVU8gUp-Ccomlwj9.js +++ b/custom-toc-highlight/assets/mapViewDeps-CUVU8gUp-CjUjdWc1.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MapView-BGOJJ8ch-DcHA1w96.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-BfX8CRfG.js","./story-D5JOvNzl.css","./Cyclical-C_9rKUUQ-Dl9v9oo8.js","./CollectionFlattener-DkHuHn5E-BKutaakg.js","./workers-PiCjreoO-idkDTJa3.js","./projection-BA9M1R7d-BYoCXVXt.js","./projectBuffer-CvCBvJ6W-dLD7ajBt.js","./TileInfo-CWIRDhZl-BkCC-9e9.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-3_GiOEs2.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./UpdatingHandles-CUu3u1ms-CruZWJRY.js","./signal-CETehA7D-DhpyJ8yp.js","./Map-1zd11DKO-D2wK6924.js","./Basemap-BEqqSTw9-B5O9ub1-.js","./loadAll-e978YItg-CdtGGDtb.js","./PortalItem-CctGdnxF-C7IJrZYq.js","./writeUtils-D5qlLkwk-xd5TEmf9.js","./compilerUtils-CV1QYWI8-C9dYdAV0.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-DVqdGrVU.js","./common-CYWrYyJl-E8-sukrT.js","./TablesMixin-C8RojhYs-AdFcW_TR.js","./Layer-ChoECxvZ-CQTFmFQa.js","./TimeExtent-Cn0Jofqr-D2z4zFxu.js","./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js","./HeightModelInfo-C5vFqzyF-CupKpfDx.js","./ReactiveMap-CFk6jPfN-Du1XE-2a.js","./Query-BrwMGK8U-DoFNfkjX.js","./Field-C6hA1tZj-CpGOU6Y4.js","./fieldType-CD2CL2hr-CMChCO5s.js","./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec2-tHZ6OaOy-xCj1obDt.js","./Tile-D75RMC64-Dj1SOP3K.js","./TileKey-C5IL-JBr-CJMvJ-lJ.js","./QueueProcessor-DbfV9fLy-CxiRQqTa.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./normalizeUtils-Bxmy9MNI-BT8FD-bF.js","./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js","./utils-9sQxfkoa-KicvrT8N.js","./utils-Bq23Xwmj--_SaacS5.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DQCcMKpm.js","./vec32-D9GsKZ1t-BjayBdwt.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-hC4XzHg_.js","./imageUtils-BA2D6Uf1-DgLNtmEY.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-9-gg6ENz.js","./ColorBackground-gVZldRLm-C2pKGijH.js"])))=>i.map(i=>d[i]); -import{_ as Te}from"./main-ugzBrWNm.js";import{K,aZ as xr,o as fe,al as dt,au as rr,aA as rt,aW as Mr,ah as _e,aL as Ke,ay as Sr,f as ge,di as Pr,aC as pt,bj as Je,hm as ir,P as sr,et as se,I as Cr,bo as Or,L as Tr,hT as z,ae as mt,iV as Rr,$ as it,aY as Er,p as _t,J as ft,w as gt,d6 as yt,m as zr,a1 as st,aU as vt,C as Fr,b as kr,cW as Ar,dg as Be,hX as Ir,es as Br,E as Dr,aS as Lr,bt as Nr}from"./story-BfX8CRfG.js";import{o as Ur}from"./signal-CETehA7D-DhpyJ8yp.js";import{y as Vr,e as Fe,E as W,u as Gr,A as we,v as $r,w as Hr,x as bt}from"./MapView-BGOJJ8ch-DcHA1w96.js";import{x as Wr}from"./colorUtils-Cthpxcks-ZRnr1H1b.js";import{B as qr,k as le,D as at,l as Ce,H as jr,m as Xr,n as Yr,o as Kr,p as Jr,q as Qr,r as Zr}from"./UpdateTracking2D-Du_WIf4G-CsaWDyks.js";import{q as ei,$ as ti,M as ri,T as ot,s as nt,t as wt}from"./FeatureCommandQueue-DzV-HBIG-BApspUo_.js";import{Y as ii,T as N,g as ar,N as si,l as xe,n as S,k as De,O as Le,i as ne,E as xt,A as ai,G as Mt,m as oi,M as ni,y as li,C as hi,R as ci,x as ui,P as O,a as St,w as R,D as or,Q as di}from"./utils-SPbpQbmm-B3hR8LxB.js";import{r as Re,c as Qe,s as nr}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{Y as Ze,H as Pt,E as pi,V as mi,K as _i}from"./SDFHelper-B6k8Ig6R-BNeqNf2Z.js";import{c as de}from"./OverrideHelper-DWRbVlj1-BZq72sbX.js";import{Y as Ct}from"./PieChartMeshWriter-C5yLDFwp-CqRHPq7x.js";import{R as fi,y as et,H as Ne,m as gi,F as Ot,Q as yi,s as vi,h as Tt,j as bi,k as wi,q as xi,a as Rt,M as Mi,J as Si,I as Et,n as Z,N as Pi,p as pe,u as Ci}from"./definitions-DJSdSb77-DkoRHaVx.js";import{x as Oi,T as lr}from"./Container-BcuL1ZEG-DxXVQv25.js";import{G as Ti,t as Ri,e as Ei,i as zi}from"./Tile-D75RMC64-Dj1SOP3K.js";import{m as Fi,n as ki,F as ye,s as zt,R as Ft}from"./WGLContainer-LxgEo4I_-C81rKEy3.js";import{N as U}from"./enums-qHpGJ28Q-CmnLAccm.js";import{d as Ee,c as Ai}from"./ProgramTemplate-DQOm6Omy-Qewg1YCG.js";import{glslifyDefineMap as ke}from"./webglDeps-Bgavuh0h-CPBMgmjx.js";import{d as Ii,E as Bi,r as Di,a as kt,b as Li,t as Ni,T as Ui,c as Vi,m as Gi}from"./GridShader-75bC4UUM-nIA27cle.js";import{j as Al,F as Il}from"./GridShader-75bC4UUM-nIA27cle.js";import{r as hr}from"./BufferObject-BM_7mcDb-Dq7c9k7y.js";import{G as F,B as $i,H as lt,U as A,F as ht,M as q,L as tt,A as w,N as At,C as Ue,T as Oe,n as cr,D as Ve,I as It}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as ur}from"./VertexArrayObject-M4iRGGoi-THP-veuo.js";import{U as Hi,p as Wi}from"./RenderingContext-DbCVbtGZ-rMiiZHPo.js";import{T as qi}from"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import{z as ji,D as Xi}from"./rasterizingUtils-BmlDdKBf-CpGlbhM3.js";import{a as H}from"./Rect-DD6XS68q-D_hsV3ag.js";import{H as k,V as J,G as Yi}from"./Texture-BCt2hphT-hC4XzHg_.js";import{o as Bt}from"./pbf-D-y3_eZO-DQKnyfOm.js";import{l as Ki}from"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import{X as Ji,$ as Qi,W as Zi}from"./LabelMetric-BeluzH3o-C3fDXNzp.js";import{T as es}from"./utils-Dcs650Ic--a87iok1.js";import{k as ts}from"./QueueProcessor-DbfV9fLy-CxiRQqTa.js";import{r as rs}from"./common-CYWrYyJl-E8-sukrT.js";import{J as is,C as dr,D as pr,H as ss,I as as,G as Dt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{o as os,e as ns}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{_ as Ge}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{n as Lt}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{G as X,E as ct,a as ls}from"./Program-DLVwTiPA-C1hIaFuM.js";import{d as hs}from"./MeshWriterRegistry-CIC9Yk_f-CqQZshM0.js";import{X as Dl}from"./GraphicsView2D-C4wYE2ut-DMrrhOCh.js";import{d as Nl}from"./GraphicContainer-DuOHUciE-sEoQdKXZ.js";import{i as cs}from"./UpdatingHandles-CUu3u1ms-CruZWJRY.js";import{r as Nt}from"./requestImageUtils-Ut4YcoNU-BtID-_Ic.js";import{m as Ut,T as us,v as $e,P as He}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{f as We}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{B as ds,K as ps}from"./projection-BA9M1R7d-BYoCXVXt.js";import{c as ms,D as _s}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{f as fs}from"./scaleUtils-DxsfQwK1-D7ZZd5W4.js";import{P as gs,c as ys}from"./geodesicUtils-B8mFUfTk-DkviSp9u.js";import"./Cyclical-C_9rKUUQ-Dl9v9oo8.js";import"./CollectionFlattener-DkHuHn5E-BKutaakg.js";import"./workers-PiCjreoO-idkDTJa3.js";import"./TileInfo-CWIRDhZl-BkCC-9e9.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-3_GiOEs2.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Map-1zd11DKO-D2wK6924.js";import"./Basemap-BEqqSTw9-B5O9ub1-.js";import"./loadAll-e978YItg-CdtGGDtb.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./writeUtils-D5qlLkwk-xd5TEmf9.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./TablesMixin-C8RojhYs-AdFcW_TR.js";import"./Layer-ChoECxvZ-CQTFmFQa.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./GraphicsCollection-CWTXNZOX-Bo9O0MYR.js";import"./HeightModelInfo-C5vFqzyF-CupKpfDx.js";import"./ReactiveMap-CFk6jPfN-Du1XE-2a.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DQCcMKpm.js";import"./TileKey-C5IL-JBr-CJMvJ-lJ.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-9-gg6ENz.js";import"./ColorBackground-gVZldRLm-C2pKGijH.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DrtZFKub.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./quantizationUtils-bJy1cRwp-B-lEhyoX.js";import"./TurboLine-CIlsAy5m-Cxo-QeJ4.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./parser-DyDJ-rlI-C9jRH52J.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-DBs2wvPw.js";import"./AttributeStore-DjyP9U7y-CD_qG3Wh.js";import"./TimeOnly-DSMefxKy-BU7RNYWc.js";import"./UnknownTimeZone-C--TOcPG-D3CAoWPX.js";import"./timeSupport-jPViR5jn-GyoVmGVI.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-BkXd4VJn.js";import"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import"./diffUtils-Cz3Fi8Xb-BE5g3Qm4.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import"./grouping-RwmXkHDc-Binxobs4.js";import"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";import"./AGraphicContainer-LUCT6Gle-Dvv0TF4N.js";import"./TechniqueInstance-DGTKoOL6-ftnhwAAz.js";import"./TileContainer-D48pXXgL-CdMiwPkS.js";function Me(r,e,t){return{transform:Ps(r,e,t.transform),fromColor:Cs(r,e,t.fromColor),toColor:Os(r,e,t.toColor),colorMix:Ts(r,e,t.colorMix),toOpacity:Rs(r,e,t.toOpacity),opacityMix:Es(r,e,t.opacityMix),hasAnimations:t.hasAnimations||!!e.animations&&e.animations.length>0}}function mr(r){return!wt.forceStaticPath&&(wt.forceAnimatedPath||r.hasAnimations)}function vs(r,e,t){if(e.type==="CIMCharacterMarker")return st.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),t;const s=O(r,e,"OffsetX"),i=O(r,e,"OffsetY");if(e.type==="CIMPictureMarker")return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:P([s,i]),rotation:P(0),scale:P(O(r,e,"Size")),parent:t.transform}};const a=e.frame,o=a.ymax-a.ymin;return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:P([s,i]),rotation:P(0),scale:P({type:"Process",op:"Divide",left:O(r,e,"Size"),right:o}),parent:t.transform}}}function _r(r,e){let t=0,s=0;const i=r.anchorPointUnits!=="Absolute";return r.anchorPoint&&(t=-r.anchorPoint.x,s=-r.anchorPoint.y),{...e,transform:{type:"AnimatedTransform",relativeTranslation:i,absoluteScale:!1,translation:P([t,s]),rotation:P(0),scale:P(1),parent:e.transform}}}function bs(r,e){return r.anchorPointUnits==="Absolute"?e:_r(r,e)}function ws(r,e){return r.anchorPointUnits!=="Absolute"?e:_r(r,e)}function xs(r,e,t){return{...r,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:P([e,t]),rotation:P(0),scale:P(1),parent:r.transform}}}function Ms(r,e){const t=e?.5*-(e.xmin+e.xmax):0,s=e?.5*-(e.ymin+e.ymax):0;let i=0,a=0;if("x"in r&&"y"in r)i=r.x+t,a=r.y+s;else{const o=Ze(r);o&&(i=(o[0]+o[2])/2+t,a=(o[1]+o[3])/2+s)}return[i,a]}function Ss(r,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return O(r,e,"Rotation")}return 0}function fr(r,e){switch(e.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return O(r,e,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return O(r,e,"TintColor")}return[1,1,1,1]}function Ps(r,e,t){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:Fs(r,e),rotation:ks(r,e),scale:zs(r,e),parent:t}}function Cs(r,e,t){return{type:"AnimatedColor",color:P(fr(r,e)),opacity:P(1),parent:t}}function Os(r,e,t){const{animations:s}=e;let i=fr(r,e);const a=s?.filter(o=>o.type==="CIMSymbolAnimationColor")[0];return a&&(i=O(r,a,"ToColor")),{type:"AnimatedColor",color:P(i),opacity:P(1),parent:t}}function Ts(r,e,t){const{animations:s}=e,i=s?.filter(a=>a.type==="CIMSymbolAnimationColor")[0];return i?{type:"AnimatedColor",color:P([1,1,1,1]),opacity:{from:0,to:1,timing:he(r,i?.animatedSymbolProperties)},parent:[1,1,1,1]}:t}function Rs(r,e,t){const{animations:s}=e;let i=P(1);const a=s?.filter(o=>o.type==="CIMSymbolAnimationTransparency")[0];return a&&(i=P({type:"Process",op:"Transparency",value:O(r,a,"ToTransparency")})),{type:"AnimatedColor",color:P([1,1,1,1]),opacity:i,parent:t}}function Es(r,e,t){const{animations:s}=e,i=s?.filter(a=>a.type==="CIMSymbolAnimationTransparency")[0];return i?{type:"AnimatedColor",color:P([1,1,1,1]),opacity:{from:0,to:1,timing:he(r,i?.animatedSymbolProperties)},parent:[1,1,1,1]}:t}function he(r,e){if(!e)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:Ce.Local,repeatType:Qe.Loop,easing:nr.Linear,playAnimation:1,reverseAnimation:0};const t=O(r,e,"Duration");let s;O(r,e,"RandomizeStartTime")?s={type:"Process",op:"Random",min:0,max:t,seed:O(r,e,"RandomizeStartSeed")}:s=O(r,e,"StartTimeOffset");const i=O(r,e,"RepeatDelay"),a=O(r,e,"PlayAnimation"),o=O(r,e,"ReverseAnimation"),n=St(e.repeatType,R.CIMAnimatedSymbolProperties.repeattype);return{duration:t,startTimeOffset:s,repeatDelay:i,timeOriginSelector:n===Qe.None?Ce.Local:Ce.Global,repeatType:n,easing:St(e.easing,R.CIMAnimatedSymbolProperties.easing),playAnimation:a,reverseAnimation:o}}function zs(r,e){const{animations:t}=e;if(e.type!=="CIMPictureMarker"&&e.type!=="CIMVectorMarker"&&e.type!=="CIMPointSymbol")return P(1);let s;s=e.type==="CIMPictureMarker"||e.type==="CIMVectorMarker"?O(r,e,"Size"):ar(e)||10;const i=t?.filter(a=>a.type==="CIMSymbolAnimationScale")[0];if(!i){const a=t?.filter(o=>o.type==="CIMSymbolAnimationSize")[0];return a?{from:1,to:{type:"Process",op:"Divide",left:O(r,a,"ToSize"),right:s},timing:he(r,a.animatedSymbolProperties)}:P(1)}return{from:1,to:O(r,i,"ScaleFactor"),timing:he(r,i.animatedSymbolProperties)}}function Fs(r,e){const{animations:t}=e,s=t?.filter(i=>i.type==="CIMSymbolAnimationOffset")[0];return s?{from:[0,0],to:[O(r,s,"OffsetX"),O(r,s,"OffsetY")],timing:he(r,s.animatedSymbolProperties)}:P([0,0])}function ks(r,e){const{animations:t}=e,s=Ss(r,e),i=t?.filter(a=>a.type==="CIMSymbolAnimationRotation")[0];return i?{from:s,to:O(r,i,"ToRotation"),timing:he(r,i.animatedSymbolProperties)}:P(s)}function P(r){return{from:r,to:r,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:Ce.Local,repeatType:Qe.Loop,easing:nr.Linear,playAnimation:1,reverseAnimation:0}}}function gr(r){if(r==null||typeof r!="object")return!1;if(r.animations&&Array.isArray(r.animations)&&r.animations.length>0)return!0;for(const e in r)if(gr(r[e]))return!0;return!1}const As=()=>st.getLogger("esri.symbols.cim.cimAnalyzer");function Is(r){const e=r.markerPlacement;return e&&e.angleToLine?Re.MAP:Re.SCREEN}class Bs{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],e&&(this._resourceManager=e)}analyzeSymbolReference(e,t,s){if(this._cimLayers=s??[],!e)return this._cimLayers;if(this._reset(),e.primitiveOverrides){this._primitiveOverrides=e.primitiveOverrides;for(const i of this._primitiveOverrides){const a=i.valueExpressionInfo;if(a)this._setPoMap(i.primitiveName,i.propertyName,a);else if(i.value!=null){let o=i.value;i.propertyName.includes("Color")&&(Wr(o)&&(o=ii(o)),o=N(o)),this._setPoMap(i.primitiveName,i.propertyName,o)}}}return this._analyzeSymbol(e.symbol,t),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const s=e?.symbolLayers;if(!s)return;const i=e.effects;let a=Re.SCREEN;const o=ar(e)??0;e.type==="CIMPointSymbol"&&e.angleAlignment==="Map"&&(a=Re.MAP);let n={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],hasAnimations:gr(e)};n=Me(this._poMap,e,n);const l=e.type==="CIMPolygonSymbol";let h=s.length;for(;h--;){const c=s[h];if(!c||c.enable===!1)continue;let u;i?.length&&(u=[...i]);const d=c.effects;d?.length&&(i?u.push(...d):u=[...d]);let p=null;if(u){p=[];for(const m of u){const y=de.findEffectOverrides(m,this._primitiveOverrides);y&&p.push(y)}}const _=[];switch(de.findApplicableOverrides(c,this._primitiveOverrides,_),c.type){case"CIMSolidFill":this._analyzeSolidFill(c,p);break;case"CIMPictureFill":this._analyzePictureFill(c,p);break;case"CIMHatchFill":this._analyzeHatchFill(c,p);break;case"CIMGradientFill":this._analyzeGradientFill(c,p);break;case"CIMSolidStroke":this._analyzeSolidStroke(c,p,l,o);break;case"CIMPictureStroke":this._analyzePictureStroke(c,p,l,o);break;case"CIMGradientStroke":this._analyzeGradientStroke(c,p,l,o);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{e.type!=="CIMLineSymbol"&&e.type!=="CIMPolygonSymbol"||(a=Is(c));const m=[],y=c.primitiveName;y&&m.push(y);const g=l&&si(c.markerPlacement);this._analyzeMarker(c,p,null,m,a,o,t,[],n,!1,g);break}default:As().error("Cannot analyze CIM layer",c.type)}}}_analyzeSolidFill(e,t){const{primitiveName:s,type:i}=e,a=N(e.color);this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(i,s,"Color",a),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1})}_analyzePictureFill(e,t){const{primitiveName:s,type:i}=e,a=xe(e),o=S(e.height,R.CIMPictureFill.height);let n=S(e.scaleX,1);if("width"in e&&typeof e.width=="number"){const h=e.width;let c=1;const u=this._resourceManager.getResource(e.url);u!=null&&(c=u.width/u.height),n/=c*(o/h)}const l={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(s,i)};this._cimLayers.push({type:"fill",spriteRasterizationParam:l,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(i,s,"TintColor",a),height:this._getValueOrOverrideExpression(i,s,"Height",o),scaleX:this._getValueOrOverrideExpression(i,s,"ScaleX",n),angle:this._getValueOrOverrideExpression(i,s,"Rotation",S(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,s,"OffsetX",S(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,s,"OffsetY",S(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(e,t){const{primitiveName:s,type:i}=e,a=this._analyzeMaterialOverrides(s,["Rotation","OffsetX","OffsetY"]),o=De(a);let n=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const c of e.lineSymbol.symbolLayers){if(c.type!=="CIMSolidStroke")continue;const u=c.primitiveName??s;l||!u||c.colorLocked||this._poMap[u]?.Color==null&&this._poMap[u]?.StrokeColor==null||(n=N(c.color),n=this._maybeGetValueOrOverrideExpression(u,"StrokeColor")??this._getValueOrOverrideExpression(i,u,"Color",n),l=!0);const d=this._maybeGetValueOrOverrideExpression(u,"StrokeWidth");if(d){let p=null,_=null;typeof d=="number"?p=d:_=d.valueExpressionInfo;let m=o.find(y=>y.propertyName==="strokeWidth");m?m.propertyName="width":(m={type:"CIMPrimitiveOverride",primitiveName:u,propertyName:"width",valueExpressionInfo:_,value:p,defaultValue:Le(i,"width")},o.push(m))}}const h={type:"sprite-rasterization-param",resource:e,overrides:o};this._cimLayers.push({type:"fill",spriteRasterizationParam:h,colorLocked:!!e.colorLocked,effects:t,color:n,height:this._getValueOrOverrideExpression(i,s,"Separation",S(e.separation,R.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,s,"Rotation",S(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,s,"OffsetX",S(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,s,"OffsetY",S(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,t){this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeSolidStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=N(e.color),l=S(e.width,R.CIMSolidStroke.width),h=ne(e.capStyle,R.CIMSolidStroke.capstyle),c=ne(e.joinStyle,R.CIMSolidStroke.joinstyle),u=e.miterLimit;let d,p,_,m,y=[];if(this._analyzePrimitiveOverrides(a,t,null,null)&&(y=this._getPrimitiveMaterialOverrides(a,o)),t&&Array.isArray(t)&&t.length>0){const f=t[t.length-1].effect;f&&f.type==="CIMGeometricEffectDashes"&&f.lineDashEnding==="NoConstraint"&&(d=f.dashTemplate,p=f.scaleDash,_=f.offsetAlongLine,m=f.primitiveName,(t=[...t]).pop())}m!=null&&y.push(...this._getPrimitiveMaterialOverrides(m,o).filter(f=>f.propertyName==="dashTemplate"));const g=d!==void 0?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:d,primitiveName:m},overrides:y}:null;this._cimLayers.push({type:"line",spriteRasterizationParam:g,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,"Color",n),width:this._getValueOrOverrideExpression(o,a,"Width",l),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",h),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",c),miterLimit:u&&this._getValueOrOverrideExpression(o,a,"MiterLimit",u),referenceWidth:i,zOrder:qe(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(m,"DashTemplate")??d,offsetAlongLine:this._getValueOrOverrideExpression(o,m,"OffsetAlongLine",_??0),scaleDash:p,sampleAlphaOnly:!0})}_analyzePictureStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=xe(e),l=S(e.width,R.CIMPictureStroke.width),h=ne(e.capStyle,R.CIMPictureStroke.capstyle),c=ne(e.joinStyle,R.CIMPictureStroke.joinstyle),u=e.miterLimit,d={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(a,o)};this._cimLayers.push({type:"line",spriteRasterizationParam:d,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,"TintColor",n),width:this._getValueOrOverrideExpression(o,a,"Width",l),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",h),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",c),miterLimit:u&&this._getValueOrOverrideExpression(o,a,"MiterLimit",u),referenceWidth:i,zOrder:qe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=S(e.width,R.CIMSolidStroke.width),l=ne(e.capStyle,R.CIMGradientStroke.capstyle),h=ne(e.joinStyle,R.CIMGradientStroke.joinstyle),c=e.miterLimit;this._cimLayers.push({type:"line",spriteRasterizationParam:null,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],width:this._getValueOrOverrideExpression(o,a,"Width",n),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",l),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",h),miterLimit:c&&this._getValueOrOverrideExpression(o,a,"MiterLimit",c),referenceWidth:i,zOrder:qe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,t,s,i,a,o,n,l,h,c=!1,u=!1){if(c||=!!e.colorLocked,this._analyzeMarkerInsidePolygon(e,t,c))return;const d=S(e.size,R.CIMVectorMarker.size),p=S(e.rotation),_=S(e.offsetX),m=S(e.offsetY),{primitiveName:y,type:g}=e,f=this._getValueOrOverrideExpression(g,y,"Size",d),x=this._getValueOrOverrideExpression(g,y,"Rotation",p),b=this._getValueOrOverrideExpression(g,y,"OffsetX",_),v=this._getValueOrOverrideExpression(g,y,"OffsetY",m);let M=h;switch(M=ws(e,M),M=vs(this._poMap,e,M),M=bs(e,M),M=Me(this._poMap,e,M),e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,s,i,a,o,f,x,b,v,l,M,c,u);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,s,i,a,o,f,x,b,v,l,M,n,c,u)}}_analyzeMarkerInsidePolygon(e,t,s){const{markerPlacement:i,type:a}=e;if(!i||i.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(a==="CIMVectorMarker"||a==="CIMPictureMarker"){const d=e.primitiveName;if(d&&this._analyzePrimitiveOverrides([d],t,null,null))return!1;const p=i.primitiveName;if(p&&this._analyzePrimitiveOverrides([p],t,null,null))return!1;if(a==="CIMVectorMarker"){const{markerGraphics:_}=e;if(_)for(const m of _){const{symbol:y}=m;if(y?.type==="CIMPolygonSymbol"&&y.symbolLayers){const{symbolLayers:g}=y;for(const f of g)if(f.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:_}=e;if(_)return!1}}const o=Math.abs(i.stepX),n=Math.abs(i.stepY);if(o===0||n===0)return!0;let l,h;if(i.gridType==="Random"){const d=Br(Mi),p=Math.max(Math.floor(d/o),1);l=n*Math.max(Math.floor(d/n),1),h=p*o/l}else i.shiftOddRows?(l=2*n,h=o/n*.5):(l=n,h=o/n);const c=xe(e),u=e.type==="CIMCharacterMarker"?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:u,colorLocked:s,effects:t,color:c,height:l,scaleX:h,angle:i.gridAngle,offsetX:S(i.offsetX),offsetY:S(i.offsetY),applyRandomOffset:i.gridType==="Random",sampleAlphaOnly:e.type!=="CIMPictureMarker",hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,s,i,a,o,n,l,h,c,u,d,p,_){const{animatedSymbolProperties:m,primitiveName:y,type:g}=e;let f=S(e.scaleX,1);const x=xe(e);s||(s=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const b=this._createGIFAnimatedSymbolPropertiesOverrideExpression(m),v=e.anchorPoint??{x:0,y:0};if("width"in e&&typeof e.width=="number"){const B=e.width;let $=1;const I=this._resourceManager.getResource(e.url);I!=null&&($=I.width/I.height),f/=$*(S(e.size)/B)}const M=[...i];let C;e.primitiveName&&M.push(e.primitiveName),m||b?C={type:"animated",url:e.url,urlHash:"H"+ir(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(C=sr(e),C.markerPlacement=null);const T={type:"sprite-rasterization-param",resource:C,overrides:this._getMaterialOverrides(M,g)};b&&T.overrides.push(...b.overrides);const G=n;this._cimLayers.push({type:"marker",spriteRasterizationParam:T,colorLocked:p,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(g,y,"ScaleX",f),rotation:l,offsetX:h,offsetY:c,transform:{type:"cim-marker-transform-param",params:u},color:this._getValueOrOverrideExpression(g,y,"TintColor",x),anchorPoint:{x:v.x,y:v.y},isAbsoluteAnchorPoint:e.anchorPointUnits!=="Relative",outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:o,sizeRatio:1,isOutline:_,markerPlacement:s,animationParams:je(d),baseSize:G})}_analyzeVectorMarker(e,t,s,i,a,o,n,l,h,c,u,d,p,_,m){const y=e.markerGraphics;if(!y)return;const g=e.frame;let f=0;f=g?g.ymax-g.ymin:o;const x=!!e.scaleSymbolsProportionally;if(f){const b={offsetX:h,offsetY:c,rotation:l,size:n,frameHeight:f,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:x};u=[...u,b]}s||(s=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const b of y)if(b){const v=b.symbol;if(!v)continue;const M=b.primitiveName;M&&i.push(M);let C,T=d;if((v.type==="CIMPointSymbol"||v.type==="CIMTextSymbol")&&g){let I=0,E=0;const Y=b.geometry;"x"in Y&&"y"in Y&&(I+=Y.x-.5*(g.xmin+g.xmax),E+=Y.y-.5*(g.ymin+g.ymax));const D=e.anchorPoint;let ee=!1;D&&(e.anchorPointUnits==="Absolute"?(I-=D.x,E-=D.y,ee=!0):g&&(I-=(g.xmax-g.xmin)*D.x,E-=(g.ymax-g.ymin)*D.y));const ae={offsetX:I,offsetY:E,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:ee,scaleSymbolsProportionally:x};C=[...u,ae]}const G=b.geometry,[B,$]=Ms(G,g);switch(B===0&&$===0||(T=xs(T,B,$)),v.type==="CIMPointSymbol"&&(T=Me(this._poMap,v,T)),v.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":p||Ns(v)?(T={...T,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:P([0,0]),rotation:P(0),scale:P(f),parent:d.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,s,b,i,a,o,C??u,T,f,_,m)):this._analyzeMultiLayerGraphic(e,t,s,b,i,a,o,C??u,T,f,_,m);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,s,b,i,a,o,C??u,_)}M&&i.pop()}}_analyzeMultiLayerGraphic(e,t,s,i,a,o,n,l,h,c,u,d){const p=i.symbol,_=p.symbolLayers;if(!_)return;let m=_.length;if(Ls(_)&&!mr(h))return void this._analyzeCompositeMarkerGraphic(e,t,s,i,_,o,n,l,c,u,d);const y=this._resourceManager.geometryEngine,g=Ct.applyEffects(p.effects,i.geometry,y);if(g)for(;m--;){const f=_[m];if(!f||f.enable===!1)continue;const x=f.primitiveName;switch(x&&a.push(x),f.type){case"CIMSolidFill":case"CIMSolidStroke":{const b=Ct.applyEffects(f.effects,g,y),v=Ze(b);if(!v)continue;const M=e.anchorPointUnits!=="Relative",C=xt(f)??0,{frameSizeRatio:T,anchorX:G,anchorY:B,widthRatio:$,sdfPaddingRatio:I}=Pt(v,e.frame,e.size,e.anchorPoint,M,C,e.scaleSymbolsProportionally),E=f.type==="CIMSolidFill",Y={type:"sdf",geom:b,sdfPaddingRatio:I,asFill:E},{path:D}=f,ee=E?N(ai(f)):D==null?N(Mt(f)):[0,0,0,0],ae=E?[0,0,0,0]:N(Mt(f));if(!E&&!C)break;const oe=i.primitiveName;let ce=null;E&&!f.colorLocked&&(ce=this._maybeGetValueOrOverrideExpression(oe,"FillColor"));let ue=null;E||f.colorLocked||(ue=this._maybeGetValueOrOverrideExpression(oe,"StrokeColor"));const ve=ce??this._getValueOrOverrideExpression(f.type,x,"Color",ee),Ae=ue??this._getValueOrOverrideExpression(f.type,x,"Color",ae),be=this._maybeGetValueOrOverrideExpression(oe,"StrokeWidth")??this._getValueOrOverrideExpression(f.type,x,"Width",C),Ie=D?{type:"sprite-rasterization-param",resource:{type:"path",path:D,asFill:E},overrides:[]}:{type:"sprite-rasterization-param",resource:Y,overrides:[]},L=Me(this._poMap,f,h),j=S(e.size,R.CIMVectorMarker.size),Q=this._getValueOrOverrideExpression(e.type,e.primitiveName,"Size",j);this._cimLayers.push({type:"marker",spriteRasterizationParam:Ie,colorLocked:!!f.colorLocked||!!u,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:G,y:B},isAbsoluteAnchorPoint:M,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:c,widthRatio:$,rotateClockwise:!1,referenceSize:n,sizeRatio:T,color:ve,outlineColor:Ae,outlineWidth:be,isOutline:d,markerPlacement:s,animationParams:je(L),isStroke:f.type!=="CIMSolidFill",baseSize:Q,...pi(b,I)});break}case"CIMPictureMarker":case"CIMVectorMarker":f.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,!!f.colorLocked||!!u,d):this._analyzeMarker(f,t,s,a,o,n,!1,l,h,u,d);break;default:this._analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,!!f.colorLocked||!!u,d)}x&&a.pop()}}_analyzeTextGraphic(e,t,s,i,a,o,n,l){const h=[];de.findApplicableOverrides(s,this._primitiveOverrides,h);const c=s.geometry;if(!("x"in c)||!("y"in c))return;const u=s.symbol,d=oi(u),p=ni(u.fontStyleName),_=qr(u.fontFamilyName);u.font={family:_,decoration:d,...p};const m=S(u.height,R.CIMTextSymbol.height),y=S(u.angle),g=S(u.offsetX),f=S(u.offsetY),{haloSymbol:x}=u,b=S(u.haloSize,0);let v=[0,0,0,0];if(x?.symbolLayers?.length){const L=x.symbolLayers;for(const j of L)if(j.color){v=this._getValueOrOverrideExpression(u?.haloSymbol?.type??"CIMPolygonSymbol",j.primitiveName,"Color",N(j.color));break}}const M=s.primitiveName;let C=[0,0,0,1],T=[0,0,0,0],G=0,B=!1;if(u.symbol?.symbolLayers)for(const L of u.symbol.symbolLayers){const j=L.primitiveName;if(L.type==="CIMSolidStroke")T=this._getValueOrOverrideExpression("CIMSolidStroke",j,"Color",N(L.color)),G=this._getValueOrOverrideExpression("CIMSolidStroke",j,"Width",xt(L)??0);else if(L.type==="CIMSolidFill"){const Q=N(L.color);B=B??!!L.colorLocked,C=this._getValueOrOverrideExpression("CIMSolidFill",j??M,"Color",Q)}}let $=null,I=null,E=null,Y=null,D=null;M&&($=this._maybeGetValueOrOverrideExpression(M,"TextSize"),I=this._maybeGetValueOrOverrideExpression(M,"TextAngle"),E=this._maybeGetValueOrOverrideExpression(M,"TextOffsetX"),Y=this._maybeGetValueOrOverrideExpression(M,"TextOffsetY"),B||(D=this._maybeGetValueOrOverrideExpression(M,"FillColor")));const ee=D??C;let ae=null,oe=null,ce=0;if(u.callout&&u.callout.type==="CIMBackgroundCallout"){const L=u.callout;if(L.backgroundSymbol){const j=L.backgroundSymbol.symbolLayers;if(j)for(const Q of j)Q.type==="CIMSolidFill"?ae=N(Q.color):Q.type==="CIMSolidStroke"&&(oe=N(Q.color),ce=S(Q.width,R.CIMSolidStroke.width))}}const ue=this._getValueOrOverrideExpression(u.type,s.primitiveName,"TextString",s.textString??"");if(ue==null)return;const{fontStyleName:ve}=u,Ae=_+(ve?"-"+ve.toLowerCase():"-regular"),be=this._getMaterialOverrides(i,u.type);be.push(...this._getPrimitiveMaterialOverrides(s.primitiveName,u.type));const Ie={type:"text-rasterization-param",resource:{type:"text",textString:s.textString??"",font:u.font,symbol:u,primitiveName:s.primitiveName},overrides:be};this._cimLayers.push({type:"text",lineWidth:u.lineWidth,textRasterizationParam:Ie,colorLocked:!!l||!!B,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:Ae,decoration:d,haloSize:b,haloColor:v,weight:p.weight,style:p.style,size:$??m,angle:I??y,offsetX:E??g,offsetY:Y??f,transform:{type:"cim-marker-transform-param",params:n},horizontalAlignment:li(u.horizontalAlignment),verticalAlignment:hi(u.verticalAlignment),text:ue,color:ee,outlineColor:T,outlineSize:G,backgroundColor:ae,borderLineColor:oe,borderLineWidth:ce,referenceSize:o,sizeRatio:1,markerPlacement:t})}_analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,u,d){const p=Ds(e,i),_=e.primitiveName,m=this._analyzeMaterialOverrides(_,["Rotation","OffsetX","OffsetY"]),y=De(m),[g,f,x]=le.getTextureAnchor(p,this._resourceManager),b=this._getMaterialOverrides(a,e.type);b.push(...y);const v={type:"sprite-rasterization-param",resource:{...p,avoidSDFRasterization:!0},overrides:b},M=S(e.size,R.CIMVectorMarker.size),C=this._getValueOrOverrideExpression(e.type,_,"Size",M);this._cimLayers.push({type:"marker",spriteRasterizationParam:v,colorLocked:u,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:g,y:f},isAbsoluteAnchorPoint:!1,size:c,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:l},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:c,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:n,sizeRatio:x/se(e.size),isOutline:d,markerPlacement:s,animationParams:je(h),baseSize:C})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return de.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-param",placement:e,overrides:Vt(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return de.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-gif-animation-params",animation:e,overrides:Vt(t)}}_analyzeCompositeMarkerGraphic(e,t,s,i,a,o,n,l,h,c,u){const d=i.geometry,p=a[0],_=a[1],m=Ze(d);if(!m)return;const y=e.anchorPointUnits!=="Relative",g=S(p.width,R.CIMSolidStroke.width),{frameSizeRatio:f,anchorX:x,anchorY:b,widthRatio:v,sdfPaddingRatio:M}=Pt(m,e.frame,e.size,e.anchorPoint,y,g,e.scaleSymbolsProportionally),{path:C}=_,T=_.primitiveName,G=p.primitiveName,B=i.primitiveName;let $=null;_.colorLocked||c||($=this._maybeGetValueOrOverrideExpression(B,"FillColor"));const I=$??this._getValueOrOverrideExpression(_.type,T,"Color",N(_.color));let E=null;p.colorLocked||c||(E=this._maybeGetValueOrOverrideExpression(B,"StrokeColor"));const Y=E??this._getValueOrOverrideExpression(p.type,G,"Color",N(p.color)),D=this._maybeGetValueOrOverrideExpression(B,"StrokeWidth")??this._getValueOrOverrideExpression(p.type,G,"Width",g),ee={type:"sprite-rasterization-param",resource:C?{type:"path",path:C,asFill:!0}:{type:"sdf",geom:d,sdfPaddingRatio:M,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:ee,colorLocked:c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x,y:b},isAbsoluteAnchorPoint:y,size:h,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:h,widthRatio:v,rotateClockwise:!1,referenceSize:n,sizeRatio:f,color:I,outlineColor:Y,outlineWidth:D,isOutline:u,markerPlacement:s})}_setPoMap(e,t,s){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[t]=s}_maybeGetValueOrOverrideExpression(e,t,s){return this._getValueOrOverrideExpression("",e,t,s,!1)}_getValueOrOverrideExpression(e,t,s,i,a=!0){if(a&&!ci(i)&&(i=Le(e,s.toLowerCase())),t==null)return i;const o=this._poMap[t];if(o==null)return i;const n=o[s];return typeof n=="string"||typeof n=="number"||Array.isArray(n)?n:n?{valueExpressionInfo:n,defaultValue:i}:i}_analyzePrimitiveOverrides(e,t,s,i){if(e==null)return!1;typeof e=="string"&&(e=[e]);for(const a of this._primitiveOverrides)if(e.includes(a.primitiveName)&&a.valueExpressionInfo)return!0;if(t!=null){for(const a of t)if(a?.overrides.length>0)return!0}if(s!=null){for(const a of s)if(a?.overrides.length>0)return!0}if(i!=null){for(const a of i)if(a?.overrides.length>0)return!0}return!1}_getMaterialOverrides(e,t){if(!e)return[];const s=[];for(const i of e)s.push(...this._getPrimitiveMaterialOverrides(i,t));return s}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const s=De(this._primitiveOverrides.filter(i=>i.primitiveName===e));return s.forEach(i=>i.defaultValue=Le(t,i.propertyName.toLowerCase())),s}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(s=>s.primitiveName!==e||!t.includes(s.propertyName))}}function Ds(r,e){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:[e],scaleSymbolsProportionally:r.scaleSymbolsProportionally,respectFrame:r.respectFrame,clippingPath:r.clippingPath}}function qe(r){if(r&&r.indexOf("Level_")===0){const e=parseInt(r.slice(6),10);if(!isNaN(e))return e}return 0}const Ls=r=>r&&r.length===2&&r[0].enable&&r[1].enable&&r[0].type==="CIMSolidStroke"&&r[1].type==="CIMSolidFill"&&r[0].path==null&&r[1].path==null&&!r[0].effects&&!r[1].effects&&!r[0].animations&&!r[1].animations;function Ns(r){const e=r.symbolLayers;if(!e)return!1;const t=e.find(i=>i.effects?.find(a=>a.type==="CIMGeometricEffectDashes"&&a.dashTemplate!=null)),s=e.find(i=>i.effects?.find(a=>a.type==="CIMGeometricEffectAddControlPoints"));return!!t||!!s}function Vt(r){return sr(r).map(e=>({...e,propertyName:ui(e.propertyName)}))}function je(r){return mr(r)?{type:"animation-params",params:r}:null}let Us=class{constructor(r){this.events=new Cr,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const e={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0,powerPreference:"high-performance"};r.appendChild(this._canvas);let t=this._canvas.getContext("webgl2",e);t||(t=this._canvas.getContext("webgl2",{...e,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=t,this._handles=Or([Tr(this._canvas,"webglcontextlost",s=>this.events.emit("webgl-context-lost",s))])}destroy(){this._canvas.parentNode?.removeChild(this._canvas),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}render(r,e){if(this._hasMajorPerformanceCaveat||K("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=K("esri-performance-mode-frames-between-render")&&(e(),this._lastRenderViewState=r.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[t,s,i,a,o,n]=this._computeViewTransform(this._lastRenderViewState,r.state);this._canvas.style.transform=`matrix(${t}, ${s}, ${i}, ${a}, ${o}, ${n})`}}else e()}resize(r){const e=this._canvas,t=e.style,{state:{size:s},pixelRatio:i}=r,a=s[0],o=s[1],n=Math.round(a*i),l=Math.round(o*i);e.width===n&&e.height===l||(e.width=n,e.height=l),t.width=a+"px",t.height=o+"px"}_computeViewTransform(r,e){const[t,s]=r.center,[i,a]=e.center,[o,n]=r.toScreen([0,0],i,a),[l,h]=r.toScreen([0,0],t,s),c=l-o,u=h-n,d=r.scale/e.scale,p=e.rotation-r.rotation,_=Gr();return Ti(_),Ri(_,_,[d,d]),Ei(_,_,Je(p)),zi(_,_,[c,u]),_}};const Vs={background:{"background.frag":`#ifdef PATTERN +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MapView-BGOJJ8ch-CJtpe3RS.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-Doly9N9p.js","./story-DbFhYdqg.css","./Cyclical-C_9rKUUQ-DyGueJyk.js","./CollectionFlattener-DkHuHn5E-dp3hDI2N.js","./workers-PiCjreoO-Dc6Tqm-o.js","./projection-BA9M1R7d-CAbqHZiw.js","./projectBuffer-CvCBvJ6W-KqAd8Vef.js","./TileInfo-CWIRDhZl-RqA7tkOZ.js","./TileKey-B_6qmYK--BtZdR-Xy.js","./themeUtils-YjM7iIiX-DGrOr3vp.js","./uuid-Dj9mdEVg-BaKSCiyT.js","./UpdatingHandles-CUu3u1ms-DHvcjtvD.js","./signal-CETehA7D-DQA5V72u.js","./Map-1zd11DKO-Bme1mjOQ.js","./Basemap-BEqqSTw9-yGsB1EL7.js","./loadAll-e978YItg-4pMG3qU7.js","./PortalItem-CctGdnxF-CfFOGshS.js","./writeUtils-D5qlLkwk-enZap9KW.js","./compilerUtils-CV1QYWI8-VdY86_Y-.js","./mat4f32-CiZjBg9k-CUm34GoR.js","./mat4-DX7gBViE-6clJxb1Q.js","./common-CYWrYyJl-E8-sukrT.js","./TablesMixin-C8RojhYs-LCBvmsnP.js","./Layer-ChoECxvZ-BmDHBjO8.js","./TimeExtent-Cn0Jofqr-BcCXKjqL.js","./GraphicsCollection-CWTXNZOX-BdlDfR8M.js","./HeightModelInfo-C5vFqzyF-BH6aliHn.js","./ReactiveMap-CFk6jPfN-CSefy1PZ.js","./Query-BrwMGK8U-BPr0_G9t.js","./Field-C6hA1tZj-CkWoRbmp.js","./fieldType-CD2CL2hr-Do9kp-dx.js","./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js","./ViewingMode-CyR_b1T8-_s7_Gbsk.js","./vec2f64-CeODonrJ-CkkJCdRC.js","./vec2-tHZ6OaOy-xCj1obDt.js","./Tile-D75RMC64-g8Sx5TPr.js","./TileKey-C5IL-JBr-BGwa3-Dg.js","./QueueProcessor-DbfV9fLy-2F5OgLgJ.js","./quickselect-DHTstthl-Ds_Aj0x5.js","./normalizeUtils-Bxmy9MNI-fHOpXwKi.js","./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js","./utils-9sQxfkoa-D8FX0sO8.js","./utils-Bq23Xwmj-CKlS81kz.js","./mat3-CC4Foazl-BWjyqE2v.js","./vec2f32-CVhmN3Me-DxoqVD7C.js","./unitBezier-CGtWxaCq-BRwEDigF.js","./Scheduler-B7UX7Wr5-DriQgzLZ.js","./vec32-D9GsKZ1t-BPSFE14A.js","./definitions-DJSdSb77-DkoRHaVx.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Texture-BCt2hphT-Dk2JyWCy.js","./imageUtils-BA2D6Uf1-CYx0DlwL.js","./capabilities-agoTWNzb-CtsNgRyk.js","./Version-CoKzbupV-BDyz4v43.js","./ColorBackground-gVZldRLm-Dca2T4QI.js"])))=>i.map(i=>d[i]); +import{_ as Te}from"./main-QGPoLsvl.js";import{K,aZ as xr,o as fe,al as dt,au as rr,aA as rt,aW as Mr,ah as _e,aL as Ke,ay as Sr,f as ge,di as Pr,aC as pt,bj as Je,hm as ir,P as sr,et as se,I as Cr,bo as Or,L as Tr,hT as z,ae as mt,iV as Rr,$ as it,aY as Er,p as _t,J as ft,w as gt,d6 as yt,m as zr,a1 as st,aU as vt,C as Fr,b as kr,cW as Ar,dg as Be,hX as Ir,es as Br,E as Dr,aS as Lr,bt as Nr}from"./story-Doly9N9p.js";import{o as Ur}from"./signal-CETehA7D-DQA5V72u.js";import{y as Vr,e as Fe,E as W,u as Gr,A as we,v as $r,w as Hr,x as bt}from"./MapView-BGOJJ8ch-CJtpe3RS.js";import{x as Wr}from"./colorUtils-Cthpxcks-cHaMZbaf.js";import{B as qr,k as le,D as at,l as Ce,H as jr,m as Xr,n as Yr,o as Kr,p as Jr,q as Qr,r as Zr}from"./UpdateTracking2D-Du_WIf4G-a2xUHmYe.js";import{q as ei,$ as ti,M as ri,T as ot,s as nt,t as wt}from"./FeatureCommandQueue-DzV-HBIG-D5TUlYWp.js";import{Y as ii,T as N,g as ar,N as si,l as xe,n as S,k as De,O as Le,i as ne,E as xt,A as ai,G as Mt,m as oi,M as ni,y as li,C as hi,R as ci,x as ui,P as O,a as St,w as R,D as or,Q as di}from"./utils-SPbpQbmm-CiwW7WzR.js";import{r as Re,c as Qe,s as nr}from"./enums-CpSG_SL3-BMD3Tb1v.js";import{Y as Ze,H as Pt,E as pi,V as mi,K as _i}from"./SDFHelper-B6k8Ig6R-CgiA_-9V.js";import{c as de}from"./OverrideHelper-DWRbVlj1-BnPmqHJ3.js";import{Y as Ct}from"./PieChartMeshWriter-C5yLDFwp-5CAejpYY.js";import{R as fi,y as et,H as Ne,m as gi,F as Ot,Q as yi,s as vi,h as Tt,j as bi,k as wi,q as xi,a as Rt,M as Mi,J as Si,I as Et,n as Z,N as Pi,p as pe,u as Ci}from"./definitions-DJSdSb77-DkoRHaVx.js";import{x as Oi,T as lr}from"./Container-BcuL1ZEG-DVZvemLA.js";import{G as Ti,t as Ri,e as Ei,i as zi}from"./Tile-D75RMC64-g8Sx5TPr.js";import{m as Fi,n as ki,F as ye,s as zt,R as Ft}from"./WGLContainer-LxgEo4I_-uPdq0FyK.js";import{N as U}from"./enums-qHpGJ28Q-CmnLAccm.js";import{d as Ee,c as Ai}from"./ProgramTemplate-DQOm6Omy-yxBgwK3o.js";import{glslifyDefineMap as ke}from"./webglDeps-Bgavuh0h-31Q0Fngh.js";import{d as Ii,E as Bi,r as Di,a as kt,b as Li,t as Ni,T as Ui,c as Vi,m as Gi}from"./GridShader-75bC4UUM-BeEFXp4m.js";import{j as Al,F as Il}from"./GridShader-75bC4UUM-BeEFXp4m.js";import{r as hr}from"./BufferObject-BM_7mcDb-EYaqMhmk.js";import{G as F,B as $i,H as lt,U as A,F as ht,M as q,L as tt,A as w,N as At,C as Ue,T as Oe,n as cr,D as Ve,I as It}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{c as ur}from"./VertexArrayObject-M4iRGGoi-BvRnjYBj.js";import{U as Hi,p as Wi}from"./RenderingContext-DbCVbtGZ-Bdgqeuyk.js";import{T as qi}from"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import{z as ji,D as Xi}from"./rasterizingUtils-BmlDdKBf-BP52xgN-.js";import{a as H}from"./Rect-DD6XS68q-D_hsV3ag.js";import{H as k,V as J,G as Yi}from"./Texture-BCt2hphT-Dk2JyWCy.js";import{o as Bt}from"./pbf-D-y3_eZO-CpHdkhuD.js";import{l as Ki}from"./floatRGBA-4pIJN00G-Cz2BV8ih.js";import{X as Ji,$ as Qi,W as Zi}from"./LabelMetric-BeluzH3o-Br-5CSAC.js";import{T as es}from"./utils-Dcs650Ic-LHpLlTO1.js";import{k as ts}from"./QueueProcessor-DbfV9fLy-2F5OgLgJ.js";import{r as rs}from"./common-CYWrYyJl-E8-sukrT.js";import{J as is,C as dr,D as pr,H as ss,I as as,G as Dt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{o as os,e as ns}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{_ as Ge}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{n as Lt}from"./VertexElementDescriptor-BAy1DPb3-BOhpDZGx.js";import{G as X,E as ct,a as ls}from"./Program-DLVwTiPA-DI0GKSfI.js";import{d as hs}from"./MeshWriterRegistry-CIC9Yk_f-7OXlu7fG.js";import{X as Dl}from"./GraphicsView2D-C4wYE2ut-DdVMjjMv.js";import{d as Nl}from"./GraphicContainer-DuOHUciE-XlTfJEn3.js";import{i as cs}from"./UpdatingHandles-CUu3u1ms-DHvcjtvD.js";import{r as Nt}from"./requestImageUtils-Ut4YcoNU-CZnNufeN.js";import{m as Ut,T as us,v as $e,P as He}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{f as We}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{B as ds,K as ps}from"./projection-BA9M1R7d-CAbqHZiw.js";import{c as ms,D as _s}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{f as fs}from"./scaleUtils-DxsfQwK1-CzyfErWH.js";import{P as gs,c as ys}from"./geodesicUtils-B8mFUfTk-BNOCxMeb.js";import"./Cyclical-C_9rKUUQ-DyGueJyk.js";import"./CollectionFlattener-DkHuHn5E-dp3hDI2N.js";import"./workers-PiCjreoO-Dc6Tqm-o.js";import"./TileInfo-CWIRDhZl-RqA7tkOZ.js";import"./TileKey-B_6qmYK--BtZdR-Xy.js";import"./themeUtils-YjM7iIiX-DGrOr3vp.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./Map-1zd11DKO-Bme1mjOQ.js";import"./Basemap-BEqqSTw9-yGsB1EL7.js";import"./loadAll-e978YItg-4pMG3qU7.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./writeUtils-D5qlLkwk-enZap9KW.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./mat4f32-CiZjBg9k-CUm34GoR.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./TablesMixin-C8RojhYs-LCBvmsnP.js";import"./Layer-ChoECxvZ-BmDHBjO8.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./GraphicsCollection-CWTXNZOX-BdlDfR8M.js";import"./HeightModelInfo-C5vFqzyF-BH6aliHn.js";import"./ReactiveMap-CFk6jPfN-CSefy1PZ.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./unitBezier-CGtWxaCq-BRwEDigF.js";import"./Scheduler-B7UX7Wr5-DriQgzLZ.js";import"./TileKey-C5IL-JBr-BGwa3-Dg.js";import"./capabilities-agoTWNzb-CtsNgRyk.js";import"./Version-CoKzbupV-BDyz4v43.js";import"./ColorBackground-gVZldRLm-Dca2T4QI.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./quickselect-DHTstthl-Ds_Aj0x5.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./BidiEngine-Bdqv5H5j-Dyqh9XG-.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./GeometryUtils-NHgB9gGQ-DtpzGERq.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./Util-BjGjeg6f-08Szkf4F.js";import"./constants-Bqe1QJ4u-F8oTIn7N.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./quantizationUtils-bJy1cRwp-DFYZs_ns.js";import"./TurboLine-CIlsAy5m-C6Kc2De-.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./parser-DyDJ-rlI-CvOs11Ip.js";import"./vec3f32-BS0cezmI-B_madU1n.js";import"./StyleDefinition-Ct4HIk9T-B82pTf0h.js";import"./config-nuMERBvb-MDUrh2eL.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import"./CircularArray-DaQg3PQl-BXS52LZy.js";import"./testSVGPremultipliedAlpha-DoZe_f0d-BwcxFsN9.js";import"./AttributeStore-DjyP9U7y-Cmhm9XHS.js";import"./TimeOnly-DSMefxKy-BHvJbNji.js";import"./UnknownTimeZone-C--TOcPG-9of9030I.js";import"./timeSupport-jPViR5jn-7bshRI7L.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./labelUtils-BW14kBqX-Tk7uOiPw.js";import"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import"./diffUtils-Cz3Fi8Xb-Cwe8AFcX.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import"./grouping-RwmXkHDc-CCFLL7L_.js";import"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";import"./AGraphicContainer-LUCT6Gle-C3Sb_Sy7.js";import"./TechniqueInstance-DGTKoOL6-CABoCcdk.js";import"./TileContainer-D48pXXgL-BzDz3Uqo.js";function Me(r,e,t){return{transform:Ps(r,e,t.transform),fromColor:Cs(r,e,t.fromColor),toColor:Os(r,e,t.toColor),colorMix:Ts(r,e,t.colorMix),toOpacity:Rs(r,e,t.toOpacity),opacityMix:Es(r,e,t.opacityMix),hasAnimations:t.hasAnimations||!!e.animations&&e.animations.length>0}}function mr(r){return!wt.forceStaticPath&&(wt.forceAnimatedPath||r.hasAnimations)}function vs(r,e,t){if(e.type==="CIMCharacterMarker")return st.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),t;const s=O(r,e,"OffsetX"),i=O(r,e,"OffsetY");if(e.type==="CIMPictureMarker")return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:P([s,i]),rotation:P(0),scale:P(O(r,e,"Size")),parent:t.transform}};const a=e.frame,o=a.ymax-a.ymin;return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:P([s,i]),rotation:P(0),scale:P({type:"Process",op:"Divide",left:O(r,e,"Size"),right:o}),parent:t.transform}}}function _r(r,e){let t=0,s=0;const i=r.anchorPointUnits!=="Absolute";return r.anchorPoint&&(t=-r.anchorPoint.x,s=-r.anchorPoint.y),{...e,transform:{type:"AnimatedTransform",relativeTranslation:i,absoluteScale:!1,translation:P([t,s]),rotation:P(0),scale:P(1),parent:e.transform}}}function bs(r,e){return r.anchorPointUnits==="Absolute"?e:_r(r,e)}function ws(r,e){return r.anchorPointUnits!=="Absolute"?e:_r(r,e)}function xs(r,e,t){return{...r,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:P([e,t]),rotation:P(0),scale:P(1),parent:r.transform}}}function Ms(r,e){const t=e?.5*-(e.xmin+e.xmax):0,s=e?.5*-(e.ymin+e.ymax):0;let i=0,a=0;if("x"in r&&"y"in r)i=r.x+t,a=r.y+s;else{const o=Ze(r);o&&(i=(o[0]+o[2])/2+t,a=(o[1]+o[3])/2+s)}return[i,a]}function Ss(r,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return O(r,e,"Rotation")}return 0}function fr(r,e){switch(e.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return O(r,e,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return O(r,e,"TintColor")}return[1,1,1,1]}function Ps(r,e,t){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:Fs(r,e),rotation:ks(r,e),scale:zs(r,e),parent:t}}function Cs(r,e,t){return{type:"AnimatedColor",color:P(fr(r,e)),opacity:P(1),parent:t}}function Os(r,e,t){const{animations:s}=e;let i=fr(r,e);const a=s?.filter(o=>o.type==="CIMSymbolAnimationColor")[0];return a&&(i=O(r,a,"ToColor")),{type:"AnimatedColor",color:P(i),opacity:P(1),parent:t}}function Ts(r,e,t){const{animations:s}=e,i=s?.filter(a=>a.type==="CIMSymbolAnimationColor")[0];return i?{type:"AnimatedColor",color:P([1,1,1,1]),opacity:{from:0,to:1,timing:he(r,i?.animatedSymbolProperties)},parent:[1,1,1,1]}:t}function Rs(r,e,t){const{animations:s}=e;let i=P(1);const a=s?.filter(o=>o.type==="CIMSymbolAnimationTransparency")[0];return a&&(i=P({type:"Process",op:"Transparency",value:O(r,a,"ToTransparency")})),{type:"AnimatedColor",color:P([1,1,1,1]),opacity:i,parent:t}}function Es(r,e,t){const{animations:s}=e,i=s?.filter(a=>a.type==="CIMSymbolAnimationTransparency")[0];return i?{type:"AnimatedColor",color:P([1,1,1,1]),opacity:{from:0,to:1,timing:he(r,i?.animatedSymbolProperties)},parent:[1,1,1,1]}:t}function he(r,e){if(!e)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:Ce.Local,repeatType:Qe.Loop,easing:nr.Linear,playAnimation:1,reverseAnimation:0};const t=O(r,e,"Duration");let s;O(r,e,"RandomizeStartTime")?s={type:"Process",op:"Random",min:0,max:t,seed:O(r,e,"RandomizeStartSeed")}:s=O(r,e,"StartTimeOffset");const i=O(r,e,"RepeatDelay"),a=O(r,e,"PlayAnimation"),o=O(r,e,"ReverseAnimation"),n=St(e.repeatType,R.CIMAnimatedSymbolProperties.repeattype);return{duration:t,startTimeOffset:s,repeatDelay:i,timeOriginSelector:n===Qe.None?Ce.Local:Ce.Global,repeatType:n,easing:St(e.easing,R.CIMAnimatedSymbolProperties.easing),playAnimation:a,reverseAnimation:o}}function zs(r,e){const{animations:t}=e;if(e.type!=="CIMPictureMarker"&&e.type!=="CIMVectorMarker"&&e.type!=="CIMPointSymbol")return P(1);let s;s=e.type==="CIMPictureMarker"||e.type==="CIMVectorMarker"?O(r,e,"Size"):ar(e)||10;const i=t?.filter(a=>a.type==="CIMSymbolAnimationScale")[0];if(!i){const a=t?.filter(o=>o.type==="CIMSymbolAnimationSize")[0];return a?{from:1,to:{type:"Process",op:"Divide",left:O(r,a,"ToSize"),right:s},timing:he(r,a.animatedSymbolProperties)}:P(1)}return{from:1,to:O(r,i,"ScaleFactor"),timing:he(r,i.animatedSymbolProperties)}}function Fs(r,e){const{animations:t}=e,s=t?.filter(i=>i.type==="CIMSymbolAnimationOffset")[0];return s?{from:[0,0],to:[O(r,s,"OffsetX"),O(r,s,"OffsetY")],timing:he(r,s.animatedSymbolProperties)}:P([0,0])}function ks(r,e){const{animations:t}=e,s=Ss(r,e),i=t?.filter(a=>a.type==="CIMSymbolAnimationRotation")[0];return i?{from:s,to:O(r,i,"ToRotation"),timing:he(r,i.animatedSymbolProperties)}:P(s)}function P(r){return{from:r,to:r,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:Ce.Local,repeatType:Qe.Loop,easing:nr.Linear,playAnimation:1,reverseAnimation:0}}}function gr(r){if(r==null||typeof r!="object")return!1;if(r.animations&&Array.isArray(r.animations)&&r.animations.length>0)return!0;for(const e in r)if(gr(r[e]))return!0;return!1}const As=()=>st.getLogger("esri.symbols.cim.cimAnalyzer");function Is(r){const e=r.markerPlacement;return e&&e.angleToLine?Re.MAP:Re.SCREEN}class Bs{constructor(e){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[],e&&(this._resourceManager=e)}analyzeSymbolReference(e,t,s){if(this._cimLayers=s??[],!e)return this._cimLayers;if(this._reset(),e.primitiveOverrides){this._primitiveOverrides=e.primitiveOverrides;for(const i of this._primitiveOverrides){const a=i.valueExpressionInfo;if(a)this._setPoMap(i.primitiveName,i.propertyName,a);else if(i.value!=null){let o=i.value;i.propertyName.includes("Color")&&(Wr(o)&&(o=ii(o)),o=N(o)),this._setPoMap(i.primitiveName,i.propertyName,o)}}}return this._analyzeSymbol(e.symbol,t),this._cimLayers}_reset(){this._cimLayers=[],this._poMap={},this._primitiveOverrides=[]}_analyzeSymbol(e,t){switch(e?.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this._analyzeMultiLayerSymbol(e,t)}}_analyzeMultiLayerSymbol(e,t){const s=e?.symbolLayers;if(!s)return;const i=e.effects;let a=Re.SCREEN;const o=ar(e)??0;e.type==="CIMPointSymbol"&&e.angleAlignment==="Map"&&(a=Re.MAP);let n={transform:[0,0,0,1],fromColor:[1,1,1,1],toColor:[1,1,1,1],colorMix:[0,0,0,0],toOpacity:[1,1,1,1],opacityMix:[0,0,0,0],hasAnimations:gr(e)};n=Me(this._poMap,e,n);const l=e.type==="CIMPolygonSymbol";let h=s.length;for(;h--;){const c=s[h];if(!c||c.enable===!1)continue;let u;i?.length&&(u=[...i]);const d=c.effects;d?.length&&(i?u.push(...d):u=[...d]);let p=null;if(u){p=[];for(const m of u){const y=de.findEffectOverrides(m,this._primitiveOverrides);y&&p.push(y)}}const _=[];switch(de.findApplicableOverrides(c,this._primitiveOverrides,_),c.type){case"CIMSolidFill":this._analyzeSolidFill(c,p);break;case"CIMPictureFill":this._analyzePictureFill(c,p);break;case"CIMHatchFill":this._analyzeHatchFill(c,p);break;case"CIMGradientFill":this._analyzeGradientFill(c,p);break;case"CIMSolidStroke":this._analyzeSolidStroke(c,p,l,o);break;case"CIMPictureStroke":this._analyzePictureStroke(c,p,l,o);break;case"CIMGradientStroke":this._analyzeGradientStroke(c,p,l,o);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":{e.type!=="CIMLineSymbol"&&e.type!=="CIMPolygonSymbol"||(a=Is(c));const m=[],y=c.primitiveName;y&&m.push(y);const g=l&&si(c.markerPlacement);this._analyzeMarker(c,p,null,m,a,o,t,[],n,!1,g);break}default:As().error("Cannot analyze CIM layer",c.type)}}}_analyzeSolidFill(e,t){const{primitiveName:s,type:i}=e,a=N(e.color);this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,color:this._getValueOrOverrideExpression(i,s,"Color",a),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!1})}_analyzePictureFill(e,t){const{primitiveName:s,type:i}=e,a=xe(e),o=S(e.height,R.CIMPictureFill.height);let n=S(e.scaleX,1);if("width"in e&&typeof e.width=="number"){const h=e.width;let c=1;const u=this._resourceManager.getResource(e.url);u!=null&&(c=u.width/u.height),n/=c*(o/h)}const l={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(s,i)};this._cimLayers.push({type:"fill",spriteRasterizationParam:l,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(i,s,"TintColor",a),height:this._getValueOrOverrideExpression(i,s,"Height",o),scaleX:this._getValueOrOverrideExpression(i,s,"ScaleX",n),angle:this._getValueOrOverrideExpression(i,s,"Rotation",S(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,s,"OffsetX",S(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,s,"OffsetY",S(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeHatchFill(e,t){const{primitiveName:s,type:i}=e,a=this._analyzeMaterialOverrides(s,["Rotation","OffsetX","OffsetY"]),o=De(a);let n=[255,255,255,1],l=!1;if(e.lineSymbol?.symbolLayers)for(const c of e.lineSymbol.symbolLayers){if(c.type!=="CIMSolidStroke")continue;const u=c.primitiveName??s;l||!u||c.colorLocked||this._poMap[u]?.Color==null&&this._poMap[u]?.StrokeColor==null||(n=N(c.color),n=this._maybeGetValueOrOverrideExpression(u,"StrokeColor")??this._getValueOrOverrideExpression(i,u,"Color",n),l=!0);const d=this._maybeGetValueOrOverrideExpression(u,"StrokeWidth");if(d){let p=null,_=null;typeof d=="number"?p=d:_=d.valueExpressionInfo;let m=o.find(y=>y.propertyName==="strokeWidth");m?m.propertyName="width":(m={type:"CIMPrimitiveOverride",primitiveName:u,propertyName:"width",valueExpressionInfo:_,value:p,defaultValue:Le(i,"width")},o.push(m))}}const h={type:"sprite-rasterization-param",resource:e,overrides:o};this._cimLayers.push({type:"fill",spriteRasterizationParam:h,colorLocked:!!e.colorLocked,effects:t,color:n,height:this._getValueOrOverrideExpression(i,s,"Separation",S(e.separation,R.CIMHatchFill.separation)),scaleX:1,angle:this._getValueOrOverrideExpression(i,s,"Rotation",S(e.rotation)),offsetX:this._getValueOrOverrideExpression(i,s,"OffsetX",S(e.offsetX)),offsetY:this._getValueOrOverrideExpression(i,s,"OffsetY",S(e.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0,hasUnresolvedReplacementColor:!l})}_analyzeGradientFill(e,t){this._cimLayers.push({type:"fill",spriteRasterizationParam:null,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1,hasUnresolvedReplacementColor:!1})}_analyzeSolidStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=N(e.color),l=S(e.width,R.CIMSolidStroke.width),h=ne(e.capStyle,R.CIMSolidStroke.capstyle),c=ne(e.joinStyle,R.CIMSolidStroke.joinstyle),u=e.miterLimit;let d,p,_,m,y=[];if(this._analyzePrimitiveOverrides(a,t,null,null)&&(y=this._getPrimitiveMaterialOverrides(a,o)),t&&Array.isArray(t)&&t.length>0){const f=t[t.length-1].effect;f&&f.type==="CIMGeometricEffectDashes"&&f.lineDashEnding==="NoConstraint"&&(d=f.dashTemplate,p=f.scaleDash,_=f.offsetAlongLine,m=f.primitiveName,(t=[...t]).pop())}m!=null&&y.push(...this._getPrimitiveMaterialOverrides(m,o).filter(f=>f.propertyName==="dashTemplate"));const g=d!==void 0?{type:"sprite-rasterization-param",resource:{type:"dash",dashTemplate:d,primitiveName:m},overrides:y}:null;this._cimLayers.push({type:"line",spriteRasterizationParam:g,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,"Color",n),width:this._getValueOrOverrideExpression(o,a,"Width",l),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",h),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",c),miterLimit:u&&this._getValueOrOverrideExpression(o,a,"MiterLimit",u),referenceWidth:i,zOrder:qe(e.name),dashTemplate:this._maybeGetValueOrOverrideExpression(m,"DashTemplate")??d,offsetAlongLine:this._getValueOrOverrideExpression(o,m,"OffsetAlongLine",_??0),scaleDash:p,sampleAlphaOnly:!0})}_analyzePictureStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=xe(e),l=S(e.width,R.CIMPictureStroke.width),h=ne(e.capStyle,R.CIMPictureStroke.capstyle),c=ne(e.joinStyle,R.CIMPictureStroke.joinstyle),u=e.miterLimit,d={type:"sprite-rasterization-param",resource:e,overrides:this._getPrimitiveMaterialOverrides(a,o)};this._cimLayers.push({type:"line",spriteRasterizationParam:d,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:this._getValueOrOverrideExpression(o,a,"TintColor",n),width:this._getValueOrOverrideExpression(o,a,"Width",l),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",h),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",c),miterLimit:u&&this._getValueOrOverrideExpression(o,a,"MiterLimit",u),referenceWidth:i,zOrder:qe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeGradientStroke(e,t,s,i){const{primitiveName:a,type:o}=e,n=S(e.width,R.CIMSolidStroke.width),l=ne(e.capStyle,R.CIMGradientStroke.capstyle),h=ne(e.joinStyle,R.CIMGradientStroke.joinstyle),c=e.miterLimit;this._cimLayers.push({type:"line",spriteRasterizationParam:null,isOutline:s,colorLocked:!!e.colorLocked,effects:t,color:[128,128,128,1],width:this._getValueOrOverrideExpression(o,a,"Width",n),cap:this._getValueOrOverrideExpression(o,a,"CapStyle",l),join:this._getValueOrOverrideExpression(o,a,"JoinStyle",h),miterLimit:c&&this._getValueOrOverrideExpression(o,a,"MiterLimit",c),referenceWidth:i,zOrder:qe(e.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}_analyzeMarker(e,t,s,i,a,o,n,l,h,c=!1,u=!1){if(c||=!!e.colorLocked,this._analyzeMarkerInsidePolygon(e,t,c))return;const d=S(e.size,R.CIMVectorMarker.size),p=S(e.rotation),_=S(e.offsetX),m=S(e.offsetY),{primitiveName:y,type:g}=e,f=this._getValueOrOverrideExpression(g,y,"Size",d),x=this._getValueOrOverrideExpression(g,y,"Rotation",p),b=this._getValueOrOverrideExpression(g,y,"OffsetX",_),v=this._getValueOrOverrideExpression(g,y,"OffsetY",m);let M=h;switch(M=ws(e,M),M=vs(this._poMap,e,M),M=bs(e,M),M=Me(this._poMap,e,M),e.type){case"CIMPictureMarker":this._analyzePictureMarker(e,t,s,i,a,o,f,x,b,v,l,M,c,u);break;case"CIMVectorMarker":this._analyzeVectorMarker(e,t,s,i,a,o,f,x,b,v,l,M,n,c,u)}}_analyzeMarkerInsidePolygon(e,t,s){const{markerPlacement:i,type:a}=e;if(!i||i.type!=="CIMMarkerPlacementInsidePolygon")return!1;if(a==="CIMVectorMarker"||a==="CIMPictureMarker"){const d=e.primitiveName;if(d&&this._analyzePrimitiveOverrides([d],t,null,null))return!1;const p=i.primitiveName;if(p&&this._analyzePrimitiveOverrides([p],t,null,null))return!1;if(a==="CIMVectorMarker"){const{markerGraphics:_}=e;if(_)for(const m of _){const{symbol:y}=m;if(y?.type==="CIMPolygonSymbol"&&y.symbolLayers){const{symbolLayers:g}=y;for(const f of g)if(f.type==="CIMSolidStroke")return!1}}}else{const{animatedSymbolProperties:_}=e;if(_)return!1}}const o=Math.abs(i.stepX),n=Math.abs(i.stepY);if(o===0||n===0)return!0;let l,h;if(i.gridType==="Random"){const d=Br(Mi),p=Math.max(Math.floor(d/o),1);l=n*Math.max(Math.floor(d/n),1),h=p*o/l}else i.shiftOddRows?(l=2*n,h=o/n*.5):(l=n,h=o/n);const c=xe(e),u=e.type==="CIMCharacterMarker"?null:{type:"sprite-rasterization-param",resource:e,overrides:[]};return this._cimLayers.push({type:"fill",spriteRasterizationParam:u,colorLocked:s,effects:t,color:c,height:l,scaleX:h,angle:i.gridAngle,offsetX:S(i.offsetX),offsetY:S(i.offsetY),applyRandomOffset:i.gridType==="Random",sampleAlphaOnly:e.type!=="CIMPictureMarker",hasUnresolvedReplacementColor:!0}),!0}_analyzePictureMarker(e,t,s,i,a,o,n,l,h,c,u,d,p,_){const{animatedSymbolProperties:m,primitiveName:y,type:g}=e;let f=S(e.scaleX,1);const x=xe(e);s||(s=this._createMarkerPlacementOverrideExpression(e.markerPlacement));const b=this._createGIFAnimatedSymbolPropertiesOverrideExpression(m),v=e.anchorPoint??{x:0,y:0};if("width"in e&&typeof e.width=="number"){const B=e.width;let $=1;const I=this._resourceManager.getResource(e.url);I!=null&&($=I.width/I.height),f/=$*(S(e.size)/B)}const M=[...i];let C;e.primitiveName&&M.push(e.primitiveName),m||b?C={type:"animated",url:e.url,urlHash:"H"+ir(e.url),playAnimation:e.animatedSymbolProperties?.playAnimation,reverseAnimation:e.animatedSymbolProperties?.reverseAnimation,randomizeStartTime:e.animatedSymbolProperties?.randomizeStartTime,randomizeStartSeed:e.animatedSymbolProperties?.randomizeStartSeed,startTimeOffset:e.animatedSymbolProperties?.startTimeOffset,duration:e.animatedSymbolProperties?.duration,repeatType:e.animatedSymbolProperties?.repeatType,repeatDelay:e.animatedSymbolProperties?.repeatDelay}:(C=sr(e),C.markerPlacement=null);const T={type:"sprite-rasterization-param",resource:C,overrides:this._getMaterialOverrides(M,g)};b&&T.overrides.push(...b.overrides);const G=n;this._cimLayers.push({type:"marker",spriteRasterizationParam:T,colorLocked:p,effects:t,scaleSymbolsProportionally:!1,alignment:a,size:n,scaleX:this._getValueOrOverrideExpression(g,y,"ScaleX",f),rotation:l,offsetX:h,offsetY:c,transform:{type:"cim-marker-transform-param",params:u},color:this._getValueOrOverrideExpression(g,y,"TintColor",x),anchorPoint:{x:v.x,y:v.y},isAbsoluteAnchorPoint:e.anchorPointUnits!=="Relative",outlineColor:[0,0,0,0],outlineWidth:0,frameHeight:0,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:o,sizeRatio:1,isOutline:_,markerPlacement:s,animationParams:je(d),baseSize:G})}_analyzeVectorMarker(e,t,s,i,a,o,n,l,h,c,u,d,p,_,m){const y=e.markerGraphics;if(!y)return;const g=e.frame;let f=0;f=g?g.ymax-g.ymin:o;const x=!!e.scaleSymbolsProportionally;if(f){const b={offsetX:h,offsetY:c,rotation:l,size:n,frameHeight:f,rotateClockWise:!!e.rotateClockwise,absoluteAnchorPoint:!1,scaleSymbolsProportionally:x};u=[...u,b]}s||(s=this._createMarkerPlacementOverrideExpression(e.markerPlacement));for(const b of y)if(b){const v=b.symbol;if(!v)continue;const M=b.primitiveName;M&&i.push(M);let C,T=d;if((v.type==="CIMPointSymbol"||v.type==="CIMTextSymbol")&&g){let I=0,E=0;const Y=b.geometry;"x"in Y&&"y"in Y&&(I+=Y.x-.5*(g.xmin+g.xmax),E+=Y.y-.5*(g.ymin+g.ymax));const D=e.anchorPoint;let ee=!1;D&&(e.anchorPointUnits==="Absolute"?(I-=D.x,E-=D.y,ee=!0):g&&(I-=(g.xmax-g.xmin)*D.x,E-=(g.ymax-g.ymin)*D.y));const ae={offsetX:I,offsetY:E,rotation:0,size:0,frameHeight:0,rotateClockWise:!1,absoluteAnchorPoint:ee,scaleSymbolsProportionally:x};C=[...u,ae]}const G=b.geometry,[B,$]=Ms(G,g);switch(B===0&&$===0||(T=xs(T,B,$)),v.type==="CIMPointSymbol"&&(T=Me(this._poMap,v,T)),v.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":p||Ns(v)?(T={...T,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:P([0,0]),rotation:P(0),scale:P(f),parent:d.transform}},this._analyzeMultiLayerGraphicNonSDF(e,t,s,b,i,a,o,C??u,T,f,_,m)):this._analyzeMultiLayerGraphic(e,t,s,b,i,a,o,C??u,T,f,_,m);break;case"CIMTextSymbol":this._analyzeTextGraphic(t,s,b,i,a,o,C??u,_)}M&&i.pop()}}_analyzeMultiLayerGraphic(e,t,s,i,a,o,n,l,h,c,u,d){const p=i.symbol,_=p.symbolLayers;if(!_)return;let m=_.length;if(Ls(_)&&!mr(h))return void this._analyzeCompositeMarkerGraphic(e,t,s,i,_,o,n,l,c,u,d);const y=this._resourceManager.geometryEngine,g=Ct.applyEffects(p.effects,i.geometry,y);if(g)for(;m--;){const f=_[m];if(!f||f.enable===!1)continue;const x=f.primitiveName;switch(x&&a.push(x),f.type){case"CIMSolidFill":case"CIMSolidStroke":{const b=Ct.applyEffects(f.effects,g,y),v=Ze(b);if(!v)continue;const M=e.anchorPointUnits!=="Relative",C=xt(f)??0,{frameSizeRatio:T,anchorX:G,anchorY:B,widthRatio:$,sdfPaddingRatio:I}=Pt(v,e.frame,e.size,e.anchorPoint,M,C,e.scaleSymbolsProportionally),E=f.type==="CIMSolidFill",Y={type:"sdf",geom:b,sdfPaddingRatio:I,asFill:E},{path:D}=f,ee=E?N(ai(f)):D==null?N(Mt(f)):[0,0,0,0],ae=E?[0,0,0,0]:N(Mt(f));if(!E&&!C)break;const oe=i.primitiveName;let ce=null;E&&!f.colorLocked&&(ce=this._maybeGetValueOrOverrideExpression(oe,"FillColor"));let ue=null;E||f.colorLocked||(ue=this._maybeGetValueOrOverrideExpression(oe,"StrokeColor"));const ve=ce??this._getValueOrOverrideExpression(f.type,x,"Color",ee),Ae=ue??this._getValueOrOverrideExpression(f.type,x,"Color",ae),be=this._maybeGetValueOrOverrideExpression(oe,"StrokeWidth")??this._getValueOrOverrideExpression(f.type,x,"Width",C),Ie=D?{type:"sprite-rasterization-param",resource:{type:"path",path:D,asFill:E},overrides:[]}:{type:"sprite-rasterization-param",resource:Y,overrides:[]},L=Me(this._poMap,f,h),j=S(e.size,R.CIMVectorMarker.size),Q=this._getValueOrOverrideExpression(e.type,e.primitiveName,"Size",j);this._cimLayers.push({type:"marker",spriteRasterizationParam:Ie,colorLocked:!!f.colorLocked||!!u,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:G,y:B},isAbsoluteAnchorPoint:M,size:c,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:c,widthRatio:$,rotateClockwise:!1,referenceSize:n,sizeRatio:T,color:ve,outlineColor:Ae,outlineWidth:be,isOutline:d,markerPlacement:s,animationParams:je(L),isStroke:f.type!=="CIMSolidFill",baseSize:Q,...pi(b,I)});break}case"CIMPictureMarker":case"CIMVectorMarker":f.markerPlacement?this._analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,!!f.colorLocked||!!u,d):this._analyzeMarker(f,t,s,a,o,n,!1,l,h,u,d);break;default:this._analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,!!f.colorLocked||!!u,d)}x&&a.pop()}}_analyzeTextGraphic(e,t,s,i,a,o,n,l){const h=[];de.findApplicableOverrides(s,this._primitiveOverrides,h);const c=s.geometry;if(!("x"in c)||!("y"in c))return;const u=s.symbol,d=oi(u),p=ni(u.fontStyleName),_=qr(u.fontFamilyName);u.font={family:_,decoration:d,...p};const m=S(u.height,R.CIMTextSymbol.height),y=S(u.angle),g=S(u.offsetX),f=S(u.offsetY),{haloSymbol:x}=u,b=S(u.haloSize,0);let v=[0,0,0,0];if(x?.symbolLayers?.length){const L=x.symbolLayers;for(const j of L)if(j.color){v=this._getValueOrOverrideExpression(u?.haloSymbol?.type??"CIMPolygonSymbol",j.primitiveName,"Color",N(j.color));break}}const M=s.primitiveName;let C=[0,0,0,1],T=[0,0,0,0],G=0,B=!1;if(u.symbol?.symbolLayers)for(const L of u.symbol.symbolLayers){const j=L.primitiveName;if(L.type==="CIMSolidStroke")T=this._getValueOrOverrideExpression("CIMSolidStroke",j,"Color",N(L.color)),G=this._getValueOrOverrideExpression("CIMSolidStroke",j,"Width",xt(L)??0);else if(L.type==="CIMSolidFill"){const Q=N(L.color);B=B??!!L.colorLocked,C=this._getValueOrOverrideExpression("CIMSolidFill",j??M,"Color",Q)}}let $=null,I=null,E=null,Y=null,D=null;M&&($=this._maybeGetValueOrOverrideExpression(M,"TextSize"),I=this._maybeGetValueOrOverrideExpression(M,"TextAngle"),E=this._maybeGetValueOrOverrideExpression(M,"TextOffsetX"),Y=this._maybeGetValueOrOverrideExpression(M,"TextOffsetY"),B||(D=this._maybeGetValueOrOverrideExpression(M,"FillColor")));const ee=D??C;let ae=null,oe=null,ce=0;if(u.callout&&u.callout.type==="CIMBackgroundCallout"){const L=u.callout;if(L.backgroundSymbol){const j=L.backgroundSymbol.symbolLayers;if(j)for(const Q of j)Q.type==="CIMSolidFill"?ae=N(Q.color):Q.type==="CIMSolidStroke"&&(oe=N(Q.color),ce=S(Q.width,R.CIMSolidStroke.width))}}const ue=this._getValueOrOverrideExpression(u.type,s.primitiveName,"TextString",s.textString??"");if(ue==null)return;const{fontStyleName:ve}=u,Ae=_+(ve?"-"+ve.toLowerCase():"-regular"),be=this._getMaterialOverrides(i,u.type);be.push(...this._getPrimitiveMaterialOverrides(s.primitiveName,u.type));const Ie={type:"text-rasterization-param",resource:{type:"text",textString:s.textString??"",font:u.font,symbol:u,primitiveName:s.primitiveName},overrides:be};this._cimLayers.push({type:"text",lineWidth:u.lineWidth,textRasterizationParam:Ie,colorLocked:!!l||!!B,effects:e,alignment:a,anchorPoint:{x:0,y:0},isAbsoluteAnchorPoint:!1,fontName:Ae,decoration:d,haloSize:b,haloColor:v,weight:p.weight,style:p.style,size:$??m,angle:I??y,offsetX:E??g,offsetY:Y??f,transform:{type:"cim-marker-transform-param",params:n},horizontalAlignment:li(u.horizontalAlignment),verticalAlignment:hi(u.verticalAlignment),text:ue,color:ee,outlineColor:T,outlineSize:G,backgroundColor:ae,borderLineColor:oe,borderLineWidth:ce,referenceSize:o,sizeRatio:1,markerPlacement:t})}_analyzeMultiLayerGraphicNonSDF(e,t,s,i,a,o,n,l,h,c,u,d){const p=Ds(e,i),_=e.primitiveName,m=this._analyzeMaterialOverrides(_,["Rotation","OffsetX","OffsetY"]),y=De(m),[g,f,x]=le.getTextureAnchor(p,this._resourceManager),b=this._getMaterialOverrides(a,e.type);b.push(...y);const v={type:"sprite-rasterization-param",resource:{...p,avoidSDFRasterization:!0},overrides:b},M=S(e.size,R.CIMVectorMarker.size),C=this._getValueOrOverrideExpression(e.type,_,"Size",M);this._cimLayers.push({type:"marker",spriteRasterizationParam:v,colorLocked:u,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x:g,y:f},isAbsoluteAnchorPoint:!1,size:c,rotation:0,offsetX:0,offsetY:0,transform:{type:"cim-marker-transform-param",params:l},color:[255,255,255,1],outlineColor:[0,0,0,0],outlineWidth:0,scaleX:1,frameHeight:c,widthRatio:1,rotateClockwise:!!e.rotateClockwise,referenceSize:n,sizeRatio:x/se(e.size),isOutline:d,markerPlacement:s,animationParams:je(h),baseSize:C})}_createMarkerPlacementOverrideExpression(e){if(!e)return null;const t=[];return de.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-marker-placement-param",placement:e,overrides:Vt(t)}}_createGIFAnimatedSymbolPropertiesOverrideExpression(e){if(!e)return null;const t=[];return de.findApplicableOverrides(e,this._primitiveOverrides,t),{type:"cim-gif-animation-params",animation:e,overrides:Vt(t)}}_analyzeCompositeMarkerGraphic(e,t,s,i,a,o,n,l,h,c,u){const d=i.geometry,p=a[0],_=a[1],m=Ze(d);if(!m)return;const y=e.anchorPointUnits!=="Relative",g=S(p.width,R.CIMSolidStroke.width),{frameSizeRatio:f,anchorX:x,anchorY:b,widthRatio:v,sdfPaddingRatio:M}=Pt(m,e.frame,e.size,e.anchorPoint,y,g,e.scaleSymbolsProportionally),{path:C}=_,T=_.primitiveName,G=p.primitiveName,B=i.primitiveName;let $=null;_.colorLocked||c||($=this._maybeGetValueOrOverrideExpression(B,"FillColor"));const I=$??this._getValueOrOverrideExpression(_.type,T,"Color",N(_.color));let E=null;p.colorLocked||c||(E=this._maybeGetValueOrOverrideExpression(B,"StrokeColor"));const Y=E??this._getValueOrOverrideExpression(p.type,G,"Color",N(p.color)),D=this._maybeGetValueOrOverrideExpression(B,"StrokeWidth")??this._getValueOrOverrideExpression(p.type,G,"Width",g),ee={type:"sprite-rasterization-param",resource:C?{type:"path",path:C,asFill:!0}:{type:"sdf",geom:d,sdfPaddingRatio:M,asFill:!0},overrides:[]};this._cimLayers.push({type:"marker",spriteRasterizationParam:ee,colorLocked:c,effects:t,scaleSymbolsProportionally:!!e.scaleSymbolsProportionally,alignment:o,anchorPoint:{x,y:b},isAbsoluteAnchorPoint:y,size:h,rotation:0,offsetX:0,offsetY:0,scaleX:1,transform:{type:"cim-marker-transform-param",params:l},frameHeight:h,widthRatio:v,rotateClockwise:!1,referenceSize:n,sizeRatio:f,color:I,outlineColor:Y,outlineWidth:D,isOutline:u,markerPlacement:s})}_setPoMap(e,t,s){let i;this._poMap[e]?i=this._poMap[e]:(i={},this._poMap[e]=i),i[t]=s}_maybeGetValueOrOverrideExpression(e,t,s){return this._getValueOrOverrideExpression("",e,t,s,!1)}_getValueOrOverrideExpression(e,t,s,i,a=!0){if(a&&!ci(i)&&(i=Le(e,s.toLowerCase())),t==null)return i;const o=this._poMap[t];if(o==null)return i;const n=o[s];return typeof n=="string"||typeof n=="number"||Array.isArray(n)?n:n?{valueExpressionInfo:n,defaultValue:i}:i}_analyzePrimitiveOverrides(e,t,s,i){if(e==null)return!1;typeof e=="string"&&(e=[e]);for(const a of this._primitiveOverrides)if(e.includes(a.primitiveName)&&a.valueExpressionInfo)return!0;if(t!=null){for(const a of t)if(a?.overrides.length>0)return!0}if(s!=null){for(const a of s)if(a?.overrides.length>0)return!0}if(i!=null){for(const a of i)if(a?.overrides.length>0)return!0}return!1}_getMaterialOverrides(e,t){if(!e)return[];const s=[];for(const i of e)s.push(...this._getPrimitiveMaterialOverrides(i,t));return s}_getPrimitiveMaterialOverrides(e,t){if(!e)return[];const s=De(this._primitiveOverrides.filter(i=>i.primitiveName===e));return s.forEach(i=>i.defaultValue=Le(t,i.propertyName.toLowerCase())),s}_analyzeMaterialOverrides(e,t){return this._primitiveOverrides.filter(s=>s.primitiveName!==e||!t.includes(s.propertyName))}}function Ds(r,e){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:[e],scaleSymbolsProportionally:r.scaleSymbolsProportionally,respectFrame:r.respectFrame,clippingPath:r.clippingPath}}function qe(r){if(r&&r.indexOf("Level_")===0){const e=parseInt(r.slice(6),10);if(!isNaN(e))return e}return 0}const Ls=r=>r&&r.length===2&&r[0].enable&&r[1].enable&&r[0].type==="CIMSolidStroke"&&r[1].type==="CIMSolidFill"&&r[0].path==null&&r[1].path==null&&!r[0].effects&&!r[1].effects&&!r[0].animations&&!r[1].animations;function Ns(r){const e=r.symbolLayers;if(!e)return!1;const t=e.find(i=>i.effects?.find(a=>a.type==="CIMGeometricEffectDashes"&&a.dashTemplate!=null)),s=e.find(i=>i.effects?.find(a=>a.type==="CIMGeometricEffectAddControlPoints"));return!!t||!!s}function Vt(r){return sr(r).map(e=>({...e,propertyName:ui(e.propertyName)}))}function je(r){return mr(r)?{type:"animation-params",params:r}:null}let Us=class{constructor(r){this.events=new Cr,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,this._canvas=document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const e={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0,powerPreference:"high-performance"};r.appendChild(this._canvas);let t=this._canvas.getContext("webgl2",e);t||(t=this._canvas.getContext("webgl2",{...e,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=t,this._handles=Or([Tr(this._canvas,"webglcontextlost",s=>this.events.emit("webgl-context-lost",s))])}destroy(){this._canvas.parentNode?.removeChild(this._canvas),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}render(r,e){if(this._hasMajorPerformanceCaveat||K("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=K("esri-performance-mode-frames-between-render")&&(e(),this._lastRenderViewState=r.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[t,s,i,a,o,n]=this._computeViewTransform(this._lastRenderViewState,r.state);this._canvas.style.transform=`matrix(${t}, ${s}, ${i}, ${a}, ${o}, ${n})`}}else e()}resize(r){const e=this._canvas,t=e.style,{state:{size:s},pixelRatio:i}=r,a=s[0],o=s[1],n=Math.round(a*i),l=Math.round(o*i);e.width===n&&e.height===l||(e.width=n,e.height=l),t.width=a+"px",t.height=o+"px"}_computeViewTransform(r,e){const[t,s]=r.center,[i,a]=e.center,[o,n]=r.toScreen([0,0],i,a),[l,h]=r.toScreen([0,0],t,s),c=l-o,u=h-n,d=r.scale/e.scale,p=e.rotation-r.rotation,_=Gr();return Ti(_),Ri(_,_,[d,d]),Ei(_,_,Je(p)),zi(_,_,[c,u]),_}};const Vs={background:{"background.frag":`#ifdef PATTERN uniform lowp float u_opacity; uniform lowp sampler2D u_texture; varying mediump vec4 v_tlbr; @@ -435,4 +435,4 @@ float rgba2float(vec4 rgba) { return dot(rgba, rgba2float_factors); }`,"util.glsl":`float nextPOT(in float x) { return pow(2.0, ceil(log2(abs(x)))); -}`}};function Gs(r){let e=Vs;return r.split("/").forEach(t=>{e&&(e=e[t])}),e}const $s=new Ai(Gs);function V(r){return $s.resolveIncludes(r)}const Gt=r=>ke({PATTERN:r.pattern}),Hs={shaders:r=>({vertexShader:Gt(r)+V("background/background.vert"),fragmentShader:Gt(r)+V("background/background.frag")})},Ws={shaders:r=>({vertexShader:V("circle/circle.vert"),fragmentShader:V("circle/circle.frag")})},$t=r=>ke({PATTERN:r.pattern}),qs={shaders:r=>({vertexShader:$t(r)+V("fill/fill.vert"),fragmentShader:$t(r)+V("fill/fill.frag")})},js={shaders:r=>({vertexShader:V("outline/outline.vert"),fragmentShader:V("outline/outline.frag")})},Ht=r=>ke({SDF:r.sdf}),Xs={shaders:r=>({vertexShader:Ht(r)+V("icon/icon.vert"),fragmentShader:Ht(r)+V("icon/icon.frag")})},Wt=r=>ke({PATTERN:r.pattern,SDF:r.sdf}),Ys={shaders:r=>({vertexShader:Wt(r)+V("line/line.vert"),fragmentShader:Wt(r)+V("line/line.frag")})},Ks={shaders:r=>({vertexShader:V("text/text.vert"),fragmentShader:V("text/text.frag")})};let Js=class{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(r=>r.dispose()),this._programByKey.clear()}getMaterialProgram(r,e,t){const s=e.key<<3|this._getMaterialOptionsValue(e.type,t);if(this._programByKey.has(s))return this._programByKey.get(s);const i=this._getProgramTemplate(e.type),{shaders:a}=i,{vertexShader:o,fragmentShader:n}=a(t),l=e.getShaderHeader(),h=e.getShaderMain(),c=o.replace("#pragma header",l).replace("#pragma main",h),u=r.programCache.acquire(c,n,e.getAttributeLocations());return this._programByKey.set(s,u),u}_getMaterialOptionsValue(r,e){switch(r){case U.BACKGROUND:return(e.pattern?1:0)<<1;case U.FILL:return(e.pattern?1:0)<<1;case U.OUTLINE:return 0;case U.LINE:{const t=e;return(t.sdf?1:0)<<2|(t.pattern?1:0)<<1}case U.ICON:return(e.sdf?1:0)<<1;case U.CIRCLE:case U.TEXT:default:return 0}}_getProgramTemplate(r){switch(r){case U.BACKGROUND:return Hs;case U.CIRCLE:return Ws;case U.FILL:return qs;case U.ICON:return Xs;case U.LINE:return Ys;case U.OUTLINE:return js;case U.TEXT:return Ks;default:return null}}},yr=class{constructor(){this._initialized=!1}dispose(){this._program=z(this._program),this._vertexArrayObject=z(this._vertexArrayObject)}render(r,e,t,s){r&&(this._initialized||this._initialize(r),r.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),r.bindVAO(this._vertexArrayObject),r.useProgram(this._program),e.setSamplingMode(t),r.bindTexture(e,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",s),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindTexture(null,0),r.bindVAO())}_initialize(r){if(this._initialized)return!0;const e=Ee(r,kt);if(!e)return!1;const t=new Int8Array(16);t[0]=-1,t[1]=-1,t[2]=0,t[3]=0,t[4]=1,t[5]=-1,t[6]=1,t[7]=0,t[8]=-1,t[9]=1,t[10]=0,t[11]=1,t[12]=1,t[13]=1,t[14]=1,t[15]=1;const s=kt.attributes,i=new ur(r,s,ki,new Map([["geometry",hr.createVertex(r,cr.STATIC_DRAW,t)]]));return this._program=e,this._vertexArrayObject=i,this._initialized=!0,!0}};class Qs{constructor(e){this._rctx=e,this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getProgram(e,t=[]){const s=e.vsPath+"."+e.fsPath+JSON.stringify(t);if(this._programByKey.has(s))return this._programByKey.get(s);const i={...t.map(c=>typeof c=="string"?{name:c,value:!0}:c).reduce((c,u)=>({...c,[u.name]:u.value}),{})},{vsPath:a,fsPath:o,attributes:n}=e,l=Wi(a,o,n,i),h=this._rctx.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!h)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(s,h),h}}let Zs=class{constructor(){this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null,this.geometryEnginePromise=null}destroy(){this._inFlightResourceMap.clear(),this._resourceMap.clear()}getResource(r){return this._resourceMap.get(r)??null}async fetchResource(r,e){const t=this._resourceMap.get(r);if(t)return{width:t.width,height:t.height};let s=this._inFlightResourceMap.get(r);return s?s.then(i=>({width:i.width,height:i.height})):(s=qi(r,e),this._inFlightResourceMap.set(r,s),s.then(i=>(this._inFlightResourceMap.delete(r),this._resourceMap.set(r,i),{width:i.width,height:i.height}),()=>({width:0,height:0})))}deleteResource(r){this._inFlightResourceMap.delete(r),this._resourceMap.delete(r)}loadFont(r){return Yr(r)}};const ea=512;let ta=class{constructor(r){this._resourceManager=r,this._cachedRasterizationCanvas=null}dispose(){this._cachedRasterizationCanvas=null}get _canvas(){return this._cachedRasterizationCanvas||(this._cachedRasterizationCanvas=document.createElement("canvas")),this._cachedRasterizationCanvas}rasterizeJSONResource(r){switch(r.type){case"dash":{const e=or(r.dashTemplate),[t,s,i]=Xi(e);return{size:[s,i],image:new Uint32Array(t.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0}}case"fill-style":{const[e,t,s,i]=ji(this._canvas,r,Et);return{size:[t,s],image:new Uint32Array(e.buffer),sdf:!1,simplePattern:!0,anchorX:0,anchorY:0,rasterizationScale:i}}case"sdf":return qt(r);case"CIMHatchFill":case"CIMVectorMarker":case"CIMPictureMarker":return this._rasterizeCIMJSONResource(r)}}_rasterizeCIMJSONResource(r){switch(r.type){case"CIMHatchFill":{const e=le.fromCIMHatchFill(r,Et);return this._rasterizeCIMVectorMarker(e)}case"CIMPictureMarker":{const e=le.fromCIMInsidePolygon(r);return this._rasterizeCIMVectorMarker(e)}case"CIMVectorMarker":{if(r.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon"){const t=le.fromCIMInsidePolygon(r);return this._rasterizeCIMVectorMarker(t)}const e=mi(r);return e&&!r.avoidSDFRasterization?qt(e):this._rasterizeCIMVectorMarker(r,!1,Si)}}}_rasterizeCIMVectorMarker(r,e=!0,t){const s=e?Kr.fromExtent(r.frame):null,[i,a,o,n,l]=le.rasterize(this._canvas,r,s,this._resourceManager,!0,t);return i?{size:[a,o],image:new Uint32Array(i.buffer),sdf:!1,simplePattern:!1,anchorX:n,anchorY:l}:null}rasterizeImageResource(r,e,t,s){this._canvas.width=r,this._canvas.height=e;const i=this._canvas.getContext("2d",{willReadFrequently:!0});t instanceof ImageData?i.putImageData(t,0,0):(t.setAttribute("width",`${r}px`),t.setAttribute("height",`${e}px`),i.drawImage(t,0,0,r,e));const a=i.getImageData(0,0,r,e),o=new Uint8Array(a.data);if(s){for(const d of s)if(d&&d.oldColor&&d.oldColor.length===4&&d.newColor&&d.newColor.length===4){const[p,_,m,y]=d.oldColor,[g,f,x,b]=d.newColor;if(p===g&&_===f&&m===x&&y===b)continue;for(let v=0;v=u||c>=u){const d=h/c;d>1?(h=u,c=Math.round(u/d)):(c=u,h=Math.round(u*d)),l=new Uint8Array(4*h*c);const p=new Uint8ClampedArray(l.buffer);di(o,r,e,p,h,c,!1)}return{size:[h,c],image:new Uint32Array(l.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}};function qt(r){if(!r)return null;const{data:e,width:t,height:s,sdfPaddingRatio:i,sdfDecodeCoeff:a}=_i(r);return e?{size:[t,s],image:new Uint32Array(e.buffer),sdf:!0,simplePattern:!0,sdfPaddingRatio:i,sdfDecodeCoeff:a,anchorX:0,anchorY:0}:null}let ze=class{constructor(r,e){this._width=0,this._height=0,this._free=[],this._width=r,this._height=e,this._free.push(new H(0,0,r,e))}get width(){return this._width}get height(){return this._height}allocate(r,e){if(r>this._width||e>this._height)return new H;let t=null,s=-1;for(let i=0;ir&&this._free.push(new H(t.x+r,t.y,t.width-r,e)),t.height>e&&this._free.push(new H(t.x,t.y+e,t.width,t.height-e))):(t.width>r&&this._free.push(new H(t.x+r,t.y,t.width-r,t.height)),t.height>e&&this._free.push(new H(t.x,t.y+e,r,t.height-e))),new H(t.x,t.y,r,e))}release(r){for(let e=0;eMath.floor(r/256);function sa(r){const e=new Set;for(const t of r)e.add(ia(t));return e}function aa(r,e,t){return r.has(e)||r.set(e,t().then(()=>{r.delete(e)}).catch(s=>{r.delete(e),Nr(s)})),r.get(e)}const oa=r=>({rect:new H(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:r,sdf:!0});let na=class{constructor(r,e,t){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=r,this.height=e,this._glyphSource=t,this._binPack=new ze(r-4,e-4),this._glyphData.push(new Uint8Array(r*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const r of this._textures)r&&r.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyphs(){const r=[117,149,181,207,207,181,149,117],e=[],t=[];for(let a=0;a=3&&a<5&&n>=3&&n<8?255:0;e.push(o),t.push(l)}}const s={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(e)},i={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(t)};this._recordGlyph(s),this._recordGlyph(i)}getTexture(r,e){if(!this._textures[e]){const t=new k;t.pixelFormat=A.ALPHA,t.wrapMode=F.CLAMP_TO_EDGE,t.width=this.width,t.height=this.height,this._textures[e]=new J(r,t,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._glyphData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(r,e,t){const s=this._getGlyphCache(r);return await this._fetchRanges(r,e,t),e.map(i=>this._getMosaicItem(s,r,i))}bind(r,e,t,s){const i=this.getTexture(r,t);i.setSamplingMode(e),r.bindTexture(i,s)}preloadASCIIGlyphCache(r){const e=this._preloadCache[r];if(e!=null)return e;const t=this._glyphSource.preloadASCIIRange(r).then(()=>{const s=this._getGlyphCache(r);for(let i=0;i<256;i++)this._getMosaicItem(s,r,i)});return this._preloadCache[r]=t,t}_getGlyphCache(r){return this._glyphCache[r]||(this._glyphCache[r]={}),this._glyphCache[r]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(r,e,t){const s=sa(e),i=[];s.forEach(a=>{i.push(this._fetchRange(r,a,t))}),await Promise.all(i)}async _fetchRange(r,e,t){if(e>ra)return;const s=r+e;return aa(this._rangePromises,s,()=>this._glyphSource.getRange(r,e,t))}_getMosaicItem(r,e,t){if(!r[t]){const s=this._glyphSource.getGlyph(e,t);if(!s?.metrics)return oa(t);const i=this._recordGlyph(s),a=this._currentPage,o=s.metrics;r[t]={rect:i,page:a,metrics:o,code:t,sdf:!0},this._invalidate()}return r[t]}_recordGlyph(r){const e=r.metrics;let t;if(e.width===0)t=new H(0,0,0,0);else{const s=e.width+6,i=e.height+2*3;t=this._binPack.allocate(s,i),t.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(null),this._initDecorationGlyphs(),this._binPack=new ze(this.width-4,this.height-4),t=this._binPack.allocate(s,i));const a=this._glyphData[this._currentPage],o=r.bitmap;let n,l;if(o)for(let h=0;h{s.addRange(e,new jt(new Bt(new Uint8Array(n.data),new DataView(n.data))))})}async preloadASCIIRange(r){const e=this._getFontStack(r),t=0,s=255,i=this._baseURL.replace("{fontstack}",r).replace("{range}",t+"-"+s),a=await ge(i,{responseType:"array-buffer"}),o=new jt(new Bt(new Uint8Array(a.data),new DataView(a.data)));for(let n=t;n<=s;n++)e.getRange(n)||e.addRange(n,o)}getGlyph(r,e){const t=this._getFontStack(r);if(!t)return;const s=Math.floor(e/256),i=t.getRange(s);return i?{metrics:i.getMetrics(e),bitmap:i.getBitmap(e)}:void 0}_getFontStack(r){let e=this._glyphInfo[r];return e||(e=this._glyphInfo[r]=new la),e}};const me=1e20;let ca=class{constructor(r,e=2){this._textureSize=r,this._rasterizationScale=e,this._canvasSize=this._textureSize*this._rasterizationScale,this._svg=null;const{_canvasSize:t}=this,s=document.createElement("canvas");s.width=s.height=t,this._context=s.getContext("2d",{willReadFrequently:!1}),this._gridOuter=new Float64Array(t*t),this._gridInner=new Float64Array(t*t),this._f=new Float64Array(t),this._d=new Float64Array(t),this._z=new Float64Array(t+1),this._v=new Int16Array(t)}dispose(){this._context=this._gridOuter=this._gridInner=this._f=this._d=this._z=this._v=null,this._svg=Jr(this._svg)}draw(r,e,t){const{_canvasSize:s,_textureSize:i,_rasterizationScale:a}=this,o=i/4;this._initSVG();const n=this.createSVGString(r,e);return new Promise((l,h)=>{const c=new Image;c.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(n),c.onload=()=>{c.onload=null,this._context.clearRect(0,0,s,s),this._context.drawImage(c,0,0,s,s);const d=this._context.getImageData(0,0,s,s),p=new Uint8Array(i*i*4);for(let _=0;_h(Lr()))})}_initSVG(){return this._svg||(this._svg=Qr()),this._svg}createSVGString(r,e){const t=this._initSVG(),s=Zr("path");s.setAttribute("d",r),t.appendChild(s);const i=s.getBBox(),a=i.width/i.height,o=this._canvasSize/2;let n,l,h;if(a>1){n=o/i.width;const p=o*(1/a);l=this._canvasSize/4,h=o-p/2}else n=o/i.height,l=o-o*a/2,h=this._canvasSize/4;const c=-i.x*n+l,u=-i.y*n+h;s.setAttribute("style",`transform: matrix(${n}, 0, 0, ${n}, ${c}, ${u})`),s.setAttribute("stroke-width",""+.5/n);const d=`${t.innerHTML}`;return t.removeChild(s),d}_edt(r,e,t){const s=this._f,i=this._d,a=this._v,o=this._z;for(let n=0;n0&&(this._maxItemSize=s),this.pixelRatio=window.devicePixelRatio||1,this._binPack=new ze(this._pageWidth,this._pageHeight);const i=Math.floor(this._pageWidth),a=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(i*a)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getWidth(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[0]}getHeight(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[1]}getPageTexture(e){return e=this._mosaicPages.length)return;const t=this._mosaicPages[e.page],s=t.mosaicsData;if(!te(t.mosaicsData))throw new fe("mapview-invalid-resource","unsuitable data type!");const i=e.spriteData,a=s.data;vr._copyBits(i,e.spriteSize[0],0,0,a,e.pageSize[0],e.rect.x+Z,e.rect.y+Z,e.spriteSize[0],e.spriteSize[1],e.repeat),t.dirty=!0}_allocateImage(e,t){e+=2*Z,t+=2*Z;const s=Math.max(e,t);if(this._maxItemSize&&this._maxItemSize{this._frameData=a,e.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._playHandle=es(this._animation,t,s,i)}destroy(){this._playHandle.remove()}loadFrame(r){const e=this._frameData;if(e==null)return;const t="width"in e?e.width:e.codedWidth,s="height"in e?e.height:e.codedHeight;r.updateData(0,Z,Z,t,s,e),this._frameData=null}},ma=class{constructor(){this._entries=new fa,this._nodes=new Map,this._book=new ga}add(r){let e=this._entries.get(r);if(!e){const t=this._book.add(r),s=new Object;e={location:t,references:0,handle:s};const i=this._entries.set(r,e);this._nodes.set(s,i)}return e.references++,e}remove(r){const e=this._nodes.get(r.handle);e&&e.payload&&(e.payload.references--,e.payload.references===0&&(this._book.remove(e.payload.location),this._entries.delete(e),this._nodes.delete(r.handle)))}getTexture(r,e){return this._book.getTexture(r,e)}destroy(){this._book.destroy()}},_a=class br{constructor(e,t){this.parent=e,this.key=t,this.payload=null,this._children=new Map}get(e){return this._children.get(e)}ensure(e){let t=this._children.get(e);return t||(t=new br(this,e),this._children.set(e,t)),t}delete(e){this._children.delete(e)}},fa=class{constructor(){this._root=new _a(null,NaN)}set(r,e){let t=this._root;for(const s of r)for(const i of s)t=t.ensure(i);return t.payload=e,t}delete(r){r.parent?.delete(r.key)}get(r){let e=this._root;for(const t of r)for(const s of t){const i=e.get(s);if(!i)return;e=i}return e.payload||void 0}},ga=class{constructor(){this._pages=[]}add(r){this._pages.length===0&&this._pages.push(new Yt);let e=this._pages.length-1,t=this._pages[e].add(r);if(t||(this._pages.push(new Yt),e=this._pages.length-1,t=this._pages[e].add(r)),!t)throw new Error("Data allocation failed.");return{...t,page:e}}remove(r){this._pages[r.page].remove(r)}getTexture(r,e){return this._pages[e].getTexture(r)}destroy(){}},Yt=class{constructor(){this._cursor={row:0,column:0},this._columns=1024,this._rows=1024,this._data=new Float32Array(this._columns*this._rows*4),this._texture=null,this._textureCursor={row:0,column:0}}add(r){if(r.length>this._columns)throw new Error(`The maximum allocation size is ${this._columns} texels.`);const e={...this._cursor};if(e.column+=r.length,e.column>=this._columns&&(e.column=r.length,e.row++),e.row>=this._rows)return null;this._cursor=e;const t={...this._cursor};t.column-=r.length;let s=4*(t.row*this._columns+t.column);for(let i=0;ist.getLogger("esri.views.2d.engine.webgl.TextureManager"),re=(r,e,t)=>ya().error(new fe(r,e,t));let va=class wr{static fromMosaic(e,t){return new wr(e,t.page,t.sdf)}constructor(e,t,s){this.mosaicType=e,this.page=t,this.sdf=s}};class ba{constructor(e){this._requestRender=e,this._resourceManager=new Zs,this._invalidFontsMap=new Map,this._sdfConverter=new ca(Ne),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new ts({concurrency:10,process:async(t,s)=>{it(s);try{return await ge(t,{responseType:"image",signal:s})}catch(i){throw vt(i)?i:new fe("mapview-invalid-resource",`Could not fetch requested resource at ${t}`,i)}}}),this.animationStore=new ma,this._spriteMosaic=new ua(2048,2048,500),this._glyphSource=new ha(`${Fr.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new na(1024,1024,this._glyphSource),this._rasterizer=new ta(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(e==null)return re("mapview-null-resource","Unable to rasterize null resource"),null;if(e.type==="animation-info"){const{resource:a}=e,o=this.animationStore.add(a),{location:n}=o;return{rect:new H(n.column,n.row,a.length,1),page:n.page,type:"sprite",width:a.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,sdfDecodeCoeff:1,simplePattern:!1}}if(e.type!=="cim-rasterization-info")return re("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:s}=e;if(s.type==="text"){const a=await this._rasterizeText(s,t);for(const o of a.glyphs)this._setTextureBinding(we.GLYPH,o);return a}const i=await this._rasterizeSprite(s,t);return i&&this._setTextureBinding(we.SPRITE,i),i}getMosaicInfo(e,t,s=!1){const i=this._getTextureBindingInfo(e,t,s);return i?{size:i.size,texture:{texture:i.texture,unit:i.type==="sprite"?gi:Ot}}:(re("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(e,t,s){const i=this._bindingInfos[t-1],a=i.page,o=s?q.LINEAR_MIPMAP_LINEAR:q.LINEAR;switch(i.mosaicType){case we.SPRITE:{const n=[this.sprites.getWidth(a),this.sprites.getHeight(a)],l=this._spriteMosaic.getTexture(e,a);return l.setSamplingMode(o),{type:"sprite",texture:l,size:n}}case we.GLYPH:{const n=[this.glyphs.width,this.glyphs.height],l=this._glyphMosaic.getTexture(e,a);return this._glyphMosaic.bind(e,o,a,Ot),l.setSamplingMode(o),{type:"glyph",texture:l,size:n}}default:return re("mapview-texture-manager",`Cannot handle unknown type ${i.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|t.page<<3}_setTextureBinding(e,t){const s=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(s)){const i=va.fromMosaic(e,t),a=this._bindingInfos.length+1;this._hashToBindingIndex.set(s,a),this._bindingInfos.push(i)}t.textureBinding=this._hashToBindingIndex.get(s)}async _rasterizeText(e,t){const{font:s,textString:i}=e,a=jr(s),o=this._invalidFontsMap.has(a),[n,l]=Xr(i),h=Ji(n);try{const c=o?Kt:a;return K("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(c),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(c,h,t),isRightToLeft:l}}catch{return re("mapview-invalid-resource",`Couldn't find font ${a}. Falling back to Arial Unicode MS Regular`),this._invalidFontsMap.set(a,!0),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(Kt,h,t),isRightToLeft:l}}}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${or(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geom)}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(Qi(e));case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const s=ir(this._hashSpriteResource(e));if(this._spriteMosaic.has(s))return this._spriteMosaic.getSpriteItem(s);if("url"in e&&e.url||e.type==="CIMPictureFill"||e.type==="CIMPictureStroke"||e.type==="CIMPictureMarker"||e.type==="CIMVectorMarker"){const i=[];le.fetchResources({type:"CIMPointSymbol",symbolLayers:[e]},this._resourceManager,i),i.length>0&&await Promise.all(i)}switch(e.type){case"CIMPictureMarker":return e.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon"?this._rasterizeJSONResource(s,e):this._handleAsyncResource(s,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(s,e,t);case"sdf":case"dash":case"fill-style":case"CIMVectorMarker":case"CIMHatchFill":return this._rasterizeJSONResource(s,e)}}_rasterizeJSONResource(e,t){const s=this._rasterizer.rasterizeJSONResource(t);if(s){const{size:i,image:a,sdf:o,simplePattern:n,rasterizationScale:l,sdfPaddingRatio:h,sdfDecodeCoeff:c}=s;return this._addItemToMosaic(e,i,{type:"static",data:a},Se(t),o,n,l,h,c)}return null}async _handleAsyncResource(e,t,s){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let i;return i=t.type==="path"?this._handleSVG(t,e,s):this._handleImage(t,e,s),this._ongoingRasterizations.set(e,i),i.finally(()=>this._ongoingRasterizations.delete(e)),i}async _handleSVG(e,t,s){const i=[Ne,Ne],{asFill:a}=e,o=await this._sdfConverter.draw(e.path,a,s);return this._addItemToMosaic(t,i,{type:"static",data:new Uint32Array(o.buffer)},!1,!0,!0)}async _handleGIFOrPNG(e,t,s){const i=e.url,a=this.resourceManager.getResource(i);if(a==null)return null;const{width:o,height:n}=a;if(a instanceof HTMLImageElement){if(e.type==="animated")return re("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const d="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:p,sdf:_,image:m}=this._rasterizer.rasterizeImageResource(o,n,a,d);return this._addItemToMosaic(t,p,{type:"static",data:m},Se(e),_,!1)}let l,h,c;e.type==="animated"?(l=!1,h={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},c=e.startGroup||0):(l=Se(e),h={type:"CIMAnimatedSymbolProperties"},c=0);const u=new pa(a,this._requestRender,h,c);return this._addItemToMosaic(t,[u.width,u.height],{type:"animated",data:u},l,!1,!1)}async _handleImage(e,t,s){const i=e.url;if(xa(i)||Sa(i))return this._handleGIFOrPNG(e,t,s);if(e.type==="animated")return re("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let a;const o=this.resourceManager.getResource(i);if(o!=null&&o instanceof HTMLImageElement)a=o;else{const{data:p}=await this._imageRequestQueue.push(i,{...s});a=p}if(Zi(i)){if("width"in e&&"height"in e)a.width=se(e.width),a.height=se(e.height);else if("cim"in e){const p=e;a.width=se(p.width??p.scaleX*p.size),a.height=se(p.size)}}if(!a.width||!a.height)return null;const n=a.width,l=a.height,h="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:c,sdf:u,image:d}=this._rasterizer.rasterizeImageResource(n,l,a,h);return this._addItemToMosaic(t,c,{type:"static",data:d},Se(e),u,!1)}catch(a){throw vt(a)?a:new fe("mapview-invalid-resource",`Could not fetch requested resource at ${i}. ${a.message}`)}}_addItemToMosaic(e,t,s,i,a,o,n,l,h){return this._spriteMosaic.addSpriteItem(e,t,s,i,a,o,n,l,h)}}function Se(r){switch(r.type){case"CIMVectorMarker":case"CIMPictureMarker":return Pa(r);default:return!0}}const wa=r=>r!=null&&r.startsWith("data:image/gif"),xa=r=>r&&(r.includes(".gif")||wa(r)),Ma=r=>r!=null&&r.startsWith("data:image/png"),Sa=r=>r&&(r.includes(".png")||Ma(r)),Pa=r=>r&&"markerPlacement"in r&&r.markerPlacement&&r.markerPlacement.type==="CIMMarkerPlacementInsidePolygon";let Ca=class{constructor(r){this._queue=[],this._refreshable=r}destroy(){this._queue=[]}enqueueTextureUpdate(r,e){const t=kr(),s=r,i=Pi,a=Math.ceil(s.height/i);it(e);for(let o=0;ot.reject(o)),t.promise}upload(){let r=0;for(;this._queue.length;){const e=performance.now(),t=this._queue.shift();if(t){if(t.options.signal!=null&&t.options.signal.aborted)continue;switch(t.type){case"chunk":this._uploadChunk(t);break;case"no-chunk":this._uploadNoChunk(t)}const s=performance.now()-e;if(r+=s,r+s>=yi)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(r){const{request:e,resolver:t,chunkOffset:s,chunkIsLast:i,destHeight:a}=r,{data:o,texture:n,width:l}=e;o!=null&&(n.updateData(0,0,s,l,a,o,s),i&&t.resolve())}_uploadNoChunk(r){const{request:e,resolver:t}=r,{data:s,texture:i}=e;i.setData(s),t.resolve()}};const Oa=ns(-.5,-.5);class Ta{constructor(){this._centerNdc=Be(),this._pxToNdc=Be(),this._worldDimensionsPx=Be(),this._mat3=Fe(),this._initialized=!1}dispose(){this._program=z(this._program),this._quad=z(this._quad)}render(e,t,s){const{context:i}=e,a=this._updateGeometry(e,s);if(t!=null){const{r:o,g:n,b:l,a:h}=t;i.setClearColor(h*o/255,h*n/255,h*l/255,h)}else i.setClearColor(0,0,0,0);if(i.setStencilFunction(tt.ALWAYS,0,255),i.setStencilWriteMask(255),!a)return i.setClearStencil(et),void i.clear(i.gl.STENCIL_BUFFER_BIT|i.gl.COLOR_BUFFER_BIT);i.setClearStencil(vi),i.clear(i.gl.STENCIL_BUFFER_BIT|i.gl.COLOR_BUFFER_BIT),this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(Ve.KEEP,Ve.KEEP,Ve.REPLACE),i.setStencilFunction(tt.ALWAYS,et,255),i.setStencilTestEnabled(!0),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.bind(),this._quad.draw(),this._quad.unbind()}_initialize(e){if(this._initialized)return;const t=Ee(e,Li);t&&(this._program=t,this._quad=new ye(e,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(e,t){const{state:s,pixelRatio:i}=e,{size:a,rotation:o}=s,n=Math.round(a[0]*i),l=Math.round(a[1]*i);if(!s.spatialReference.isWrappable)return!1;const h=rs(o),c=Math.abs(Math.cos(h)),u=Math.abs(Math.sin(h)),d=Math.round(n*c+l*u),p=Math.round(i*s.worldScreenWidth);if(d<=p)return!1;const _=n*u+l*c,m=(t.left-t.right)*i/n,y=(t.bottom-t.top)*i/l;Ge(this._worldDimensionsPx,p,_,1),Ge(this._pxToNdc,2/n,-2/l,1),Ge(this._centerNdc,m,y,1);const g=this._mat3;return as(g,this._centerNdc),Dt(g,g,this._pxToNdc),o!==0&&pr(g,g,h),Dt(g,g,this._worldDimensionsPx),dr(g,g,Oa),!0}}let Ra=class extends ot{constructor(){super(...arguments),this.type=at.Blend,this._backBufferTexture=null,this.shaders={blend:new Ni,opacity:new Ui}}shutdown(){super.shutdown(),this._backBufferTexture!==null&&(this._backBufferTexture.dispose(),this._backBufferTexture=null)}render(r,e){const{context:t,state:s,pixelRatio:i,inFadeTransition:a,painter:o}=r,{size:n}=s,l=t.getBoundFramebufferObject();let h,c;l!=null?(h=l.width,c=l.height):(h=Math.round(i*n[0]),c=Math.round(i*n[1]));const{blendMode:u}=e;if(u==="normal"){const y={shader:this.shaders.opacity,uniforms:{config:{layerTexture:{texture:e.colorTexture,unit:0},opacity:e.config.opacity}},defines:null,optionalAttributes:null,useComputeBuffer:!1};return o.setPipelineState(nt),void o.submitDrawMesh(t,y,o.quadMesh)}const d=this._createOrResizeTexture(r,h,c);l.copyToTexture(0,0,h,c,0,0,d);const p={color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:w.ONE,dstRGB:w.ZERO,srcAlpha:w.ONE,dstAlpha:w.ZERO}},depth:!1,stencil:!1};o.setPipelineState(p);const _={backbufferTexture:{texture:d,unit:0},layerTexture:{texture:e.colorTexture,unit:1},inFadeOpacity:a?1:0,...e.config},m={shader:this.shaders.blend,uniforms:{config:_},defines:{blendMode:u},optionalAttributes:null,useComputeBuffer:!1};o.submitDrawMesh(t,m,o.quadMesh)}_createOrResizeTexture(r,e,t){const{context:s}=r;if(this._backBufferTexture!==null&&this._backBufferTexture.descriptor?.width===e&&this._backBufferTexture.descriptor?.height===t)return this._backBufferTexture;if(this._backBufferTexture===null){const i=new k;i.internalFormat=A.RGBA,i.wrapMode=F.CLAMP_TO_EDGE,i.width=e,i.height=t,this._backBufferTexture=new J(s,i)}else this._backBufferTexture.resize(e,t);return this._backBufferTexture}},Ea=class{constructor(){this._blendTechnique=new Ra}dispose(r){this._blendTechnique?.shutdown()}draw(r,e,t,s,i){this._blendTechnique.render(r,{colorTexture:e,config:{opacity:i,samplingMode:t},blendMode:s})}},ut=class{constructor(){this.name=this.constructor.name}createOptions(r,e){return null}},Jt=class extends ut{constructor(r){super(),this.name=this.constructor.name,this.defines=[r]}dispose(){}bind({context:r,painter:e}){this._prev=r.getBoundFramebufferObject();const t=e.getFbos().effect0;r.bindFramebuffer(t),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.clear(r.gl.COLOR_BUFFER_BIT)}unbind(){}draw(r,e){const{context:t,painter:s}=r,i=s.getPostProcessingEffects(e),a=t.getBoundFramebufferObject();for(const{postProcessingEffect:o,effect:n}of i)o.draw(r,a,n);t.bindFramebuffer(this._prev),t.setStencilTestEnabled(!1),s.blitTexture(t,a.colorTexture,q.NEAREST),t.setStencilTestEnabled(!0)}},za=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.quadGeometry.dispose(),this._resources.quadVAO.dispose(),this._resources.highlightProgram.dispose(),this._resources.blurProgram.dispose(),this._resources=null)}preBlur(r,e){r.bindTexture(e,pe),r.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[1,0,1/this._width,0]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",$r),r.bindVAO(this._resources.quadVAO),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}finalBlur(r,e){r.bindTexture(e,pe),r.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[0,1,0,1/this._height]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",Hr),r.bindVAO(this._resources.quadVAO),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}renderHighlight(r,e,t){r.bindTexture(e,pe),r.useProgram(this._resources.highlightProgram),t.applyHighlightOptions(r,this._resources.highlightProgram),r.bindVAO(this._resources.quadVAO),r.setBlendingEnabled(!0),r.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}_initialize(r,e,t){this._width=e,this._height=t;const s=hr.createVertex(r,cr.STATIC_DRAW,new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]).buffer),i=new ur(r,new Map([["a_position",0],["a_texcoord",1]]),new Map([["geometry",[new Lt("a_position",2,It.BYTE,0,4),new Lt("a_texcoord",2,It.UNSIGNED_BYTE,2,4)]]]),new Map([["geometry",s]])),a=Ee(r,Vi),o=Ee(r,Gi);r.useProgram(a),a.setUniform1i("u_texture",pe),a.setUniform1i("u_shade",Ci),a.setUniform1f("u_sigma",bt),r.useProgram(o),o.setUniform1i("u_texture",pe),o.setUniform1f("u_sigma",bt),this._resources={quadGeometry:s,quadVAO:i,highlightProgram:a,blurProgram:o}}setup(r,e,t){this._resources?(this._width=e,this._height=t):this._initialize(r,e,t)}};function Qt(r,e,t){const s=new k(e,t);return s.wrapMode=F.CLAMP_TO_EDGE,new X(r,s,new ct(lt.STENCIL_INDEX8,e,t))}let Fa=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)}_initialize(r,e,t){this._width=e,this._height=t;const s=Qt(r,e,t),i=Qt(r,e,t);this._resources={sharedBlur1Fbo:s,sharedBlur2Fbo:i}}setup(r,e,t){!this._resources||this._width===e&&this._height===t||this.dispose(),this._resources||this._initialize(r,e,t)}get sharedBlur1Tex(){return this._resources.sharedBlur1Fbo.colorTexture}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Fbo.colorTexture}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}};const ie=4,Pe=4/ie;let ka=class extends ut{constructor(){super(...arguments),this.defines=["highlight"],this._hlRenderer=new za,this._width=void 0,this._height=void 0,this._boundFBO=null,this._hlSurfaces=new Fa,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._blitRenderer=new yr}dispose(){this._hlSurfaces?.dispose(),this._hlRenderer?.dispose(),this._boundFBO=null}bind(r){const{context:e,painter:t}=r,{width:s,height:i}=e.getViewport(),a=t.getFbos().effect0;this.setup(r,s,i),e.bindFramebuffer(a),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT)}unbind(){}setup({context:r},e,t){this._width=e,this._height=t;const s=e%ie,i=t%ie;e+=sl.resolve([]));const a=i.getFBO(t),o=new Uint8Array(a.width*a.height*4);try{await a.readPixelsAsync(0,0,a.width,a.height,A.RGBA,ht.UNSIGNED_BYTE,o)}catch{return void e.forEach(l=>l.resolve([]))}const n=[];for(let l=0;ll.resolve(n))}};const Xe=5,Ia=[1,0],Ba=[0,1],Da=[1,.8,.6,.4,.2],La=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];let Na=class{constructor(){this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(Xe),this._nMips=Xe,this._kernelSizeArray=[3,5,7,9,11],this._size=[0,0],this._programDesc={luminosityHighPass:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/luminosityHighPass",attributes:new Map([["a_position",0]])},gaussianBlur:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/composite",attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){if(this._quad=z(this._quad),this._intensityFBO=z(this._intensityFBO),this._compositeFBO=z(this._compositeFBO),this._mipsFBOs){for(let r=0;rnew $a,blur:()=>new Ga,bloom:()=>new Na,opacity:()=>new ja,"drop-shadow":()=>new qa};let Ka=class{constructor(){this._effectMap=new Map}dispose(){this._effectMap.forEach(r=>r.dispose()),this._effectMap.clear()}getPostProcessingEffects(r){if(!r||r.length===0)return[];const e=[];for(const t of r){const s=Xa(t.type);let i=this._effectMap.get(s);i||(i=Ya[s](),this._effectMap.set(s,i)),e.push({postProcessingEffect:i,effect:t})}return e}},Ja=class{constructor(r,e){this.brushes=r,this.name=e.name,this.drawPhase=e.drawPhase||W.MAP,this._targetFn=e.target,this.effects=e.effects||[],this.enableDefaultDraw=e.enableDefaultDraw??(()=>!0),this.forceDrawByDisplayOrder=!!e.forceDrawByDisplayOrder}render(r){const{context:e,profiler:t}=r,s=this._targetFn(),i=this.drawPhase&r.drawPhase;if(t.recordPassStart(this.name),i){this.enableDefaultDraw()&&this._doRender(r,s),t.recordPassEnd();for(const a of this.effects){if(!a.enable())continue;const o=a.apply,n=a.args?.(),l=e.getViewport(),h=e.getBoundFramebufferObject(),c=r.passOptions;this._bindEffect(r,o,n),this._doRender(r,s,o.defines),this._drawAndUnbindEffect(r,o,l,h,c,n)}}}_doRender(r,e,t){if(e==null)return;const{profiler:s,context:i}=r;for(const a of this.brushes){if(s.recordBrushStart(a.name),a.brushEffect!=null){const o=i.getViewport(),n=i.getBoundFramebufferObject(),l=r.passOptions;this._bindEffect(r,a.brushEffect),this._drawWithBrush(a,r,e,t),this._drawAndUnbindEffect(r,a.brushEffect,o,n,l)}else this._drawWithBrush(a,r,e,t);s.recordBrushEnd()}}_drawWithBrush(r,e,t,s){Ir(t)?(r.prepareState(e,s),r.drawMany(e,t,s)):t.visible&&(r.prepareState(e,s),r.draw(e,t,s))}_bindEffect(r,e,t){const{profiler:s}=r;s.recordPassStart(this.name+"."+e.name),e.bind(r,t);const i=e.createOptions(r,t);r.passOptions=i}_drawAndUnbindEffect(r,e,t,s,i,a){const{profiler:o,context:n}=r;r.passOptions=i,o.recordBrushStart(e.name),e.draw(r,a),e.unbind(r,a),n.bindFramebuffer(s);const{x:l,y:h,width:c,height:u}=t;n.setViewport(l,h,c,u),o.recordBrushEnd(),o.recordPassEnd()}};class Zt{constructor(){this._programCache=new Map}destroy(){for(const e of this._programCache.values())e.destroy();this._programCache.clear()}getProgram(e,t,s,i,a){const o=e.getShaderKey(t,s,i,a);let n=this._programCache.get(o);return n||(n=e.getProgram(t,s,i,a),this._programCache.set(o,n)),n}}let Qa=class{constructor(r,e){this.context=r,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new yr,this._worldExtentRenderer=new Ta,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new Js,this._blendEffect=new Ea,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new ka,hittest:new Aa,insideEffect:new Jt("inside"),outsideEffect:new Jt("outside")},this._programCache=new Zt,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new Qs(r),this.textureManager=new ba(e),this.textureUploadManager=new Ca(e),this._effectsManager=new Ka,this._quadMesh=ri.fromVertexStream(r,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=z(this._blitRenderer),this._worldExtentRenderer=z(this._worldExtentRenderer),this._quadMesh=rt(this._quadMesh),this._brushCache&&(this._brushCache.forEach(r=>r.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos){let r;for(r in this._fbos)this._fbos[r]&&this._fbos[r].dispose()}for(const r of this._fboPool)r.dispose();if(this._fboPool.length=0,this.effects){let r;for(r in this.effects)this.effects[r]&&this.effects[r].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=z(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new Zt}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(r,e){let t;if(this._fboPool.length>0)t=this._fboPool.pop();else{const s=new k(r,e);s.samplingMode=q.NEAREST,s.wrapMode=F.CLAMP_TO_EDGE,t=new X(this.context,s,this._stencilBuf)}return t.width===r&&t.height===e||t.resize(r,e),t}releaseFbo(r){this._fboPool.push(r)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(r,e,t){const{context:s}=r;this._worldExtentRenderer.render(r,e,t);const{width:i,height:a}=s.getViewport();if(this.updateFBOs(i,a),this._prevFBO=s.getBoundFramebufferObject(),s.bindFramebuffer(this.getFbos().output),s.setColorMask(!0,!0,!0,!0),e!=null){const{r:o,g:n,b:l,a:h}=e;s.setClearColor(h*o/255,h*n/255,h*l/255,h)}else s.setClearColor(0,0,0,0);s.setDepthWriteEnabled(!0),s.setClearDepth(1),s.clear(s.gl.COLOR_BUFFER_BIT|s.gl.DEPTH_BUFFER_BIT),s.setDepthWriteEnabled(!1)}afterRenderPhases(r){const{context:e}=r;e.bindFramebuffer(this._prevFBO),e.setStencilFunction(tt.EQUAL,et,255),e.setStencilTestEnabled(!0),e.setDepthTestEnabled(!1),this.blitTexture(e,this.getFbos().output.colorTexture,q.NEAREST)}beforeRenderLayer(r,e,t){const{context:s,blendMode:i,effects:a,drawPhase:o,requireFBO:n}=r;if(n||er(o,i,a,t)){const l=s.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(l);const{width:h,height:c}=s.getViewport(),u=this.acquireFbo(h,c);s.bindFramebuffer(u),s.setColorMask(!0,!0,!0,!0),s.setClearColor(0,0,0,0),s.setDepthWriteEnabled(!0),s.setClearDepth(1),s.clear(s.gl.COLOR_BUFFER_BIT|s.gl.DEPTH_BUFFER_BIT),s.setDepthWriteEnabled(!1)}s.setDepthWriteEnabled(!1),s.setDepthTestEnabled(!1),s.setStencilTestEnabled(!0),s.setClearStencil(e),s.setStencilWriteMask(255),s.clear(s.gl.STENCIL_BUFFER_BIT)}afterRenderLayer(r,e){const{context:t,blendMode:s,effects:i,requireFBO:a,drawPhase:o}=r;if(a||er(o,s,i,e)){const n=t.getBoundFramebufferObject();i!=null&&i.length>0&&o===W.MAP&&(t.setColorMask(!0,!0,!0,!0),this._applyEffects(r,i,n)),t.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),t.setStencilTestEnabled(!1),t.setStencilWriteMask(0),t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0);const l=s==null||o===W.HIGHLIGHT||o===W.LABEL?"normal":s;this._blendEffect.draw(r,n.colorTexture,q.NEAREST,l,e),this.releaseFbo(n)}}renderObject(r,e,t,s){const i=zt[t];if(!i)return;let a=this._brushCache.get(i);a===void 0&&(a=new i,this._brushCache.set(i,a)),a.prepareState(r),a.draw(r,e,s)}renderObjects(r,e,t,s){const i=zt[t];if(!i)return;let a=this._brushCache.get(i);a===void 0&&(a=new i,this._brushCache.set(i,a)),a.drawMany(r,e,s)}registerRenderPass(r){const e=r.brushes.map(t=>(this._brushCache.has(t)||this._brushCache.set(t,new t),this._brushCache.get(t)));return new Ja(e,r)}blitTexture(r,e,t,s=1){r.setBlendingEnabled(!0),r.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(r,e,t,s),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(r){return this._effectsManager.getPostProcessingEffects(r)}updateFBOs(r,e){if(r!==this._lastWidth||e!==this._lastHeight){if(this._lastWidth=r,this._lastHeight=e,this._fbos){let i;for(i in this._fbos)this._fbos[i].resize(r,e);return}const t=new k(r,e);t.samplingMode=q.NEAREST,t.wrapMode=F.CLAMP_TO_EDGE;const s=new ct(lt.DEPTH_STENCIL,r,e);this._stencilBuf=new ls(this.context,s),this._fbos={output:new X(this.context,t,this._stencilBuf),effect0:new X(this.context,t,this._stencilBuf)}}}_applyEffects(r,e,t){const{context:s}=r,i=this._effectsManager.getPostProcessingEffects(e);for(const{postProcessingEffect:a,effect:o}of i)s.bindFramebuffer(t),a.draw(r,t,o);this._currentPipelineStateNeedsUpdate=!0}setShader(r){this._shaderState.shader=r.shader,this._shaderState.uniforms=r.uniforms,this._shaderState.defines=r.defines,this._shaderState.optionalAttributes=r.optionalAttributes,this._shaderState.useComputeBuffer=r.useComputeBuffer??!1}setPipelineState(r){r!==this._currentPipelineState&&(this._currentPipelineState=r,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(r,e){const{shader:t,uniforms:s,defines:i,optionalAttributes:a}=this._shaderState,o=r.context,n=e.getAttributePrecisionPackFactors(),l=this._programCache.getProgram(t,n,s,i??{},a??{});return l.setUniforms(s),l.bind(o),this.updatePipelineState(o),this.setStencilRef(o,e),e.draw(r,t.locationInfo),l.cleanupTemporaryTextures(),{vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}submitDrawMesh(r,e,t,s){this.submitDrawMeshUntyped(r,e,t,s)}submitDrawMeshUntyped(r,e,t,s){this.setShader(e);const{shader:i,uniforms:a,defines:o,optionalAttributes:n}=this._shaderState,l=this._programCache.getProgram(i,{},a,o??{},n??{});if(l.setUniforms(a),l.bind(r),this.updatePipelineState(r),s)for(const h of s)t.bind(r,h),t.draw(r);else for(let h=0;h0)}let Za=class{constructor(){this._candidateTiles=[]}schedule(r){this._candidateTiles.includes(r)||this._candidateTiles.push(r)}reshuffle(r){const e=[];for(const t of this._candidateTiles)r>0?(t.reshuffle(),r--):e.push(t);this._candidateTiles=e}};const eo=2e3;class Rl extends Oi{constructor(e,t){super(),this.meshWriterRegistry=new hs,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=Ur(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new Za,this._canvas=new Us(e),this.context=new Hi(this._canvas.gl,t.contextOptions??{}),this.painter=new Qa(this.context,this),this._cimAnalyzer=new Bs(this.painter.textureManager.resourceManager),K("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),e.appendChild(this._debugOutput));const s=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:t.timeline||new Vr,renderingOptions:t.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new Ii(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return s()},reshuffleManager:this._reshuffleManager,backgroundColor:t.backgroundColor},this._taskHandle=xr({render:i=>this.renderFrame(i)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",i=>this.emit("webgl-error",{error:new fe("webgl-context-lost",i.statusMessage)})),this._bufferPool=new Fi,ei()}destroy(){ti(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=dt(this._taskHandle),this._lostWebGLContextHandle=dt(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=eo,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:Fe()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(fi),this._canvas.render(e,()=>this._renderChildren(this.children,e));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const s=this.context;this.painter.textureUploadManager.upload(),s.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=W.MAP;for(const i of e)i.processRender(t);if(this.children.some(i=>i.hasHighlight)){t.drawPhase=W.HIGHLIGHT;for(const i of e)i.processRender(t)}if(this.children.some(i=>i.hasLabels)){t.drawPhase=W.LABEL;for(const i of e)i.processRender(t)}if(K("esri-tiles-debug")){t.drawPhase=W.DEBUG;for(const i of e)i.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),s.logInfo()}doRender(e){const t=this.context,{state:s,pixelRatio:i}=e;this._canvas.resize(e),t.setViewport(0,0,i*s.size[0],i*s.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,s,i){const a=Math.round(this.state.size[0]*e.resolutionScale),o=Math.round(this.state.size[1]*e.resolutionScale),n=e.resolutionScale,l=this.context,h=this._state.clone();if(i!=null){const f=h.viewpoint;h.viewpoint.rotation=i,h.viewpoint=f}const c={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:n,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:s},u=new k(a,o);u.wrapMode=F.CLAMP_TO_EDGE,u.internalFormat=$i.RGBA8,u.isImmutable=!0;const d=new X(l,u,new ct(lt.DEPTH_STENCIL,a,o)),p=l.getBoundFramebufferObject(),_=l.getViewport();l.bindFramebuffer(d),l.setViewport(0,0,a,o),this._renderChildren(t??this.children,c);const m=this._readbackScreenshot(d,{...e.cropArea,y:o-(e.cropArea.y+e.cropArea.height)});l.bindFramebuffer(p),l.setViewport(_.x,_.y,_.width,_.height),this.requestRender();const y=await m;let g;return e.outputScale===1?g=y:(g=new ImageData(Math.round(y.width*e.outputScale),Math.round(y.height*e.outputScale)),(await Te(()=>import("./MapView-BGOJJ8ch-DcHA1w96.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]),import.meta.url).then(f=>f.U)).resampleHermite(y,g,!0)),d.dispose(),g}async _readbackScreenshot(e,t){const s=(await Te(()=>import("./MapView-BGOJJ8ch-DcHA1w96.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]),import.meta.url).then(i=>i.U)).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,A.RGBA,ht.UNSIGNED_BYTE,new Uint8Array(s.data.buffer)),s}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}let to=class extends ot{constructor(){super(...arguments),this.type=at.Magnifier,this._resourcePixelRatio=1,this._position=[0,0,0,0],this.shaders={magnifier:new Bi}}updateResources(r,e,t,s){r.pixelRatio!==this._resourcePixelRatio&&this._destroyResources(),this._readbackTexture||this._initializeResources(r,e,t,s);const{context:i,pixelRatio:a}=r,{factor:o,offset:n,position:l}=s,{size:h}=r.state,c=s.size*a,u=1/o,d=Math.ceil(u*c);this._readbackTexture.resize(d,d);const p=a*h[0],_=a*h[1],m=.5*d,y=.5*d,g=mt(a*l.x,m,p-m-1),f=mt(_-a*l.y,y,_-y-1),x=g-m,b=f-y,v=this._readbackTexture;i.bindTexture(v,0),i.gl.copyTexImage2D(v.descriptor.target,0,v.descriptor.pixelFormat,x,b,d,d,0);const M=(g+n.x*a)/p*2-1,C=(f-n.y*a)/_*2-1,T=c/p*2,G=c/_*2;this._position[0]=M,this._position[1]=C,this._position[2]=T,this._position[3]=G}render(r,e){const{context:t,painter:s}=r;s.setPipelineState(nt);const i={readbackTexture:{texture:this._readbackTexture,unit:0},maskTexture:{texture:this._maskTexture,unit:7},overlayTexture:{texture:this._overlayTexture,unit:6},drawPos:this._position,...e};s.submitDrawMesh(t,{shader:this.shaders.magnifier,uniforms:{config:i},defines:null,optionalAttributes:null,useComputeBuffer:!1},s.quadMesh)}shutdown(){this._destroyResources()}_initializeResources(r,e,t,s){const i=r.context;this._resourcePixelRatio=r.pixelRatio;const a=Math.ceil(s.size*r.pixelRatio);t.width=a,t.height=a;const o=new k;o.internalFormat=A.RGBA,o.wrapMode=F.CLAMP_TO_EDGE,o.samplingMode=q.NEAREST,o.flipped=!0,o.preMultiplyAlpha=!Rr(t.src)||!r.context.driverTest.svgPremultipliesAlpha.result,this._overlayTexture=new J(i,o,t),e.width=a,e.height=a,o.pixelFormat=o.internalFormat=A.ALPHA,this._maskTexture=new J(i,o,e);const n=1/s.factor;o.pixelFormat=o.internalFormat=A.RGBA,o.width=o.height=Math.ceil(n*a),o.samplingMode=q.LINEAR,o.flipped=!1,this._readbackTexture=new J(i,o)}_destroyResources(){z(this._maskTexture),z(this._overlayTexture),z(this._readbackTexture)}};async function ro(r){const e=Te(()=>import("./mask-svg-DxA9o6hM-cNit2NTT.js"),[],import.meta.url),t=Te(()=>import("./overlay-svg-C7fxD_NX-DioSRl-7.js"),[],import.meta.url),s=Nt((await e).default,{signal:r}),i=Nt((await t).default,{signal:r}),a={mask:await s,overlay:await i};return it(r),a}class El extends lr{constructor(){super(),this._handles=new rr,this._magnifierTechnique=new to,this.updatingHandles=new cs,this.visible=!1}destroy(){this._handles=rt(this._handles),this._magnifierTechnique.shutdown(),this._resourcesTask=Mr(this._resourcesTask)}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){this._backgroundColor=e,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(e){this._magnifier=e,this._handles.removeAll(),this._handles.add([_e(()=>e.version,()=>{this.visible=e.visible&&e.position!=null&&e.size>0,this.requestRender()},Ke),_e(()=>[e.maskUrl,e.overlayUrl],()=>this._reloadResources()),_e(()=>e.size,()=>{this._magnifierTechnique.shutdown(),this.requestRender()})])}_createTransforms(){return{displayViewScreenMat3:Fe()}}doRender(e){if(!this._resourcesTask)return void this._reloadResources();if(e.drawPhase!==W.MAP||!this._canRender())return;const t=this._magnifier;if(t.position==null)return;this._magnifierTechnique.updateResources(e,this._mask,this._overlay,t);const s=this.backgroundColor,i=s?[s.a*s.r/255,s.a*s.g/255,s.a*s.b/255,s.a]:[1,1,1,1];this._magnifierTechnique.render(e,{background:i,maskEnabled:t.maskEnabled?1:0,overlayEnabled:t.overlayEnabled?1:0})}_canRender(){return this._mask&&this._overlay&&this._magnifier!=null}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const e=this._magnifier!=null?this._magnifier.maskUrl:null,t=this._magnifier!=null?this._magnifier.overlayUrl:null;this._resourcesTask=Sr(async s=>{const i=e==null||t==null?ro(s):null,a=e!=null?ge(e,{responseType:"image",signal:s}).then(h=>h.data):i.then(h=>h.mask),o=t!=null?ge(t,{responseType:"image",signal:s}).then(h=>h.data):i.then(h=>h.overlay),[n,l]=await Promise.all([a,o]);this._mask=n,this._overlay=l,this._magnifierTechnique.shutdown(),this.requestRender()}),this.updatingHandles.addPromise(this._resourcesTask.promise)}}class io extends ot{constructor(){super(...arguments),this.type=at.Grid,this.shaders={grid:new Di}}render(e,t){const{context:s,painter:i}=e;i.setPipelineState(nt),i.submitDrawMesh(s,{shader:this.shaders.grid,uniforms:t,defines:null,optionalAttributes:null,useComputeBuffer:!1},i.quadMesh)}}const so=50,ao=5;function oo(r,e){return Math.log(r)/Math.log(e)}function no(r,e,t){const s=r===1?10:r;return s**(t?Math.round(oo(so/e,s)):0)}function lo(r){const{isGeographic:e,isWebMercator:t}=r;return!e&&!t}function ho(r,e,t){const s=typeof r=="number"?null:r,i=s?.spatialReference;if(i==null||!Er(i)||lo(i))return _t(i);let a=s?.x??r,o=s?.y??e;const n=1/Math.sqrt(2);let l=a+n,h=o+n;const{isWebMercator:c,isGeographic:u}=i;let d=u&&!gs(i)?ft.WGS84:i;if(c){let y=new gt({x:a,y:o,spatialReference:i});yt(y,!0,y),a=y.x,o=y.y,y=new gt({x:l,y:h,spatialReference:i}),yt(y,!0,y),l=y.x,h=y.y,d=ft.WGS84}const p=new zr({paths:[[[a,o],[l,h]]],spatialReference:d}),_=_s(p,10);let m;try{[m]=ys([_],"meters")}catch{return _t(i)}return m}const Ye=os();class zl extends lr{constructor(){super(),this._handles=new rr,this._projectedCenter=null,this._metersPerSRUnit=null,this._technique=new io,this._grid=null,this.visible=!0}destroy(){this._handles=rt(this._handles),this._technique.shutdown()}get grid(){return this._grid}set grid(e){this._grid=e,this._handles.removeAll(),this._handles.add([_e(()=>e?.center,()=>{this._projectedCenter=null},Ke),_e(()=>[e?.center,e?.dynamicScaling,e?.majorLineColor,e?.majorLineInterval,e?.minorLineColor,e?.rotateWithMap,e?.rotation,e?.spacing,e?.units],()=>this.requestRender(),Ke)])}_createTransforms(){return{displayViewScreenMat3:Fe()}}doRender(e){if(e.drawPhase!==W.MAP||this.grid==null||!this.visible)return;const{spacing:t,units:s,majorLineInterval:i,dynamicScaling:a,majorLineColor:o,minorLineColor:n}=this.grid;if(t===0||(this._updateDerivedValues(e),this._projectedCenter==null||this._metersPerSRUnit==null))return;const{scale:l,spatialReference:h}=e.state,c=Pr(t,s,"meters"),u=this._metersPerSRUnit*fs(l,h),d=c/u;if(!a&&da/255);return[e*i,t*i,s*i,i]}export{Nl as GraphicContainer,Dl as GraphicsView2D,zl as GridView2D,Al as LabelManager,El as MagnifierView2D,Il as MapViewNavigation,Rl as Stage}; +}`}};function Gs(r){let e=Vs;return r.split("/").forEach(t=>{e&&(e=e[t])}),e}const $s=new Ai(Gs);function V(r){return $s.resolveIncludes(r)}const Gt=r=>ke({PATTERN:r.pattern}),Hs={shaders:r=>({vertexShader:Gt(r)+V("background/background.vert"),fragmentShader:Gt(r)+V("background/background.frag")})},Ws={shaders:r=>({vertexShader:V("circle/circle.vert"),fragmentShader:V("circle/circle.frag")})},$t=r=>ke({PATTERN:r.pattern}),qs={shaders:r=>({vertexShader:$t(r)+V("fill/fill.vert"),fragmentShader:$t(r)+V("fill/fill.frag")})},js={shaders:r=>({vertexShader:V("outline/outline.vert"),fragmentShader:V("outline/outline.frag")})},Ht=r=>ke({SDF:r.sdf}),Xs={shaders:r=>({vertexShader:Ht(r)+V("icon/icon.vert"),fragmentShader:Ht(r)+V("icon/icon.frag")})},Wt=r=>ke({PATTERN:r.pattern,SDF:r.sdf}),Ys={shaders:r=>({vertexShader:Wt(r)+V("line/line.vert"),fragmentShader:Wt(r)+V("line/line.frag")})},Ks={shaders:r=>({vertexShader:V("text/text.vert"),fragmentShader:V("text/text.frag")})};let Js=class{constructor(){this._programByKey=new Map}dispose(){this._programByKey.forEach(r=>r.dispose()),this._programByKey.clear()}getMaterialProgram(r,e,t){const s=e.key<<3|this._getMaterialOptionsValue(e.type,t);if(this._programByKey.has(s))return this._programByKey.get(s);const i=this._getProgramTemplate(e.type),{shaders:a}=i,{vertexShader:o,fragmentShader:n}=a(t),l=e.getShaderHeader(),h=e.getShaderMain(),c=o.replace("#pragma header",l).replace("#pragma main",h),u=r.programCache.acquire(c,n,e.getAttributeLocations());return this._programByKey.set(s,u),u}_getMaterialOptionsValue(r,e){switch(r){case U.BACKGROUND:return(e.pattern?1:0)<<1;case U.FILL:return(e.pattern?1:0)<<1;case U.OUTLINE:return 0;case U.LINE:{const t=e;return(t.sdf?1:0)<<2|(t.pattern?1:0)<<1}case U.ICON:return(e.sdf?1:0)<<1;case U.CIRCLE:case U.TEXT:default:return 0}}_getProgramTemplate(r){switch(r){case U.BACKGROUND:return Hs;case U.CIRCLE:return Ws;case U.FILL:return qs;case U.ICON:return Xs;case U.LINE:return Ys;case U.OUTLINE:return js;case U.TEXT:return Ks;default:return null}}},yr=class{constructor(){this._initialized=!1}dispose(){this._program=z(this._program),this._vertexArrayObject=z(this._vertexArrayObject)}render(r,e,t,s){r&&(this._initialized||this._initialize(r),r.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),r.bindVAO(this._vertexArrayObject),r.useProgram(this._program),e.setSamplingMode(t),r.bindTexture(e,0),this._program.setUniform1i("u_tex",0),this._program.setUniform1f("u_opacity",s),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindTexture(null,0),r.bindVAO())}_initialize(r){if(this._initialized)return!0;const e=Ee(r,kt);if(!e)return!1;const t=new Int8Array(16);t[0]=-1,t[1]=-1,t[2]=0,t[3]=0,t[4]=1,t[5]=-1,t[6]=1,t[7]=0,t[8]=-1,t[9]=1,t[10]=0,t[11]=1,t[12]=1,t[13]=1,t[14]=1,t[15]=1;const s=kt.attributes,i=new ur(r,s,ki,new Map([["geometry",hr.createVertex(r,cr.STATIC_DRAW,t)]]));return this._program=e,this._vertexArrayObject=i,this._initialized=!0,!0}};class Qs{constructor(e){this._rctx=e,this._programByKey=new Map}dispose(){this._programByKey.forEach(e=>e.dispose()),this._programByKey.clear()}getProgram(e,t=[]){const s=e.vsPath+"."+e.fsPath+JSON.stringify(t);if(this._programByKey.has(s))return this._programByKey.get(s);const i={...t.map(c=>typeof c=="string"?{name:c,value:!0}:c).reduce((c,u)=>({...c,[u.name]:u.value}),{})},{vsPath:a,fsPath:o,attributes:n}=e,l=Wi(a,o,n,i),h=this._rctx.programCache.acquire(l.shaders.vertexShader,l.shaders.fragmentShader,l.attributes);if(!h)throw new Error("Unable to get program for key: ${key}");return this._programByKey.set(s,h),h}}let Zs=class{constructor(){this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null,this.geometryEnginePromise=null}destroy(){this._inFlightResourceMap.clear(),this._resourceMap.clear()}getResource(r){return this._resourceMap.get(r)??null}async fetchResource(r,e){const t=this._resourceMap.get(r);if(t)return{width:t.width,height:t.height};let s=this._inFlightResourceMap.get(r);return s?s.then(i=>({width:i.width,height:i.height})):(s=qi(r,e),this._inFlightResourceMap.set(r,s),s.then(i=>(this._inFlightResourceMap.delete(r),this._resourceMap.set(r,i),{width:i.width,height:i.height}),()=>({width:0,height:0})))}deleteResource(r){this._inFlightResourceMap.delete(r),this._resourceMap.delete(r)}loadFont(r){return Yr(r)}};const ea=512;let ta=class{constructor(r){this._resourceManager=r,this._cachedRasterizationCanvas=null}dispose(){this._cachedRasterizationCanvas=null}get _canvas(){return this._cachedRasterizationCanvas||(this._cachedRasterizationCanvas=document.createElement("canvas")),this._cachedRasterizationCanvas}rasterizeJSONResource(r){switch(r.type){case"dash":{const e=or(r.dashTemplate),[t,s,i]=Xi(e);return{size:[s,i],image:new Uint32Array(t.buffer),sdf:!0,simplePattern:!0,anchorX:0,anchorY:0}}case"fill-style":{const[e,t,s,i]=ji(this._canvas,r,Et);return{size:[t,s],image:new Uint32Array(e.buffer),sdf:!1,simplePattern:!0,anchorX:0,anchorY:0,rasterizationScale:i}}case"sdf":return qt(r);case"CIMHatchFill":case"CIMVectorMarker":case"CIMPictureMarker":return this._rasterizeCIMJSONResource(r)}}_rasterizeCIMJSONResource(r){switch(r.type){case"CIMHatchFill":{const e=le.fromCIMHatchFill(r,Et);return this._rasterizeCIMVectorMarker(e)}case"CIMPictureMarker":{const e=le.fromCIMInsidePolygon(r);return this._rasterizeCIMVectorMarker(e)}case"CIMVectorMarker":{if(r.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon"){const t=le.fromCIMInsidePolygon(r);return this._rasterizeCIMVectorMarker(t)}const e=mi(r);return e&&!r.avoidSDFRasterization?qt(e):this._rasterizeCIMVectorMarker(r,!1,Si)}}}_rasterizeCIMVectorMarker(r,e=!0,t){const s=e?Kr.fromExtent(r.frame):null,[i,a,o,n,l]=le.rasterize(this._canvas,r,s,this._resourceManager,!0,t);return i?{size:[a,o],image:new Uint32Array(i.buffer),sdf:!1,simplePattern:!1,anchorX:n,anchorY:l}:null}rasterizeImageResource(r,e,t,s){this._canvas.width=r,this._canvas.height=e;const i=this._canvas.getContext("2d",{willReadFrequently:!0});t instanceof ImageData?i.putImageData(t,0,0):(t.setAttribute("width",`${r}px`),t.setAttribute("height",`${e}px`),i.drawImage(t,0,0,r,e));const a=i.getImageData(0,0,r,e),o=new Uint8Array(a.data);if(s){for(const d of s)if(d&&d.oldColor&&d.oldColor.length===4&&d.newColor&&d.newColor.length===4){const[p,_,m,y]=d.oldColor,[g,f,x,b]=d.newColor;if(p===g&&_===f&&m===x&&y===b)continue;for(let v=0;v=u||c>=u){const d=h/c;d>1?(h=u,c=Math.round(u/d)):(c=u,h=Math.round(u*d)),l=new Uint8Array(4*h*c);const p=new Uint8ClampedArray(l.buffer);di(o,r,e,p,h,c,!1)}return{size:[h,c],image:new Uint32Array(l.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}};function qt(r){if(!r)return null;const{data:e,width:t,height:s,sdfPaddingRatio:i,sdfDecodeCoeff:a}=_i(r);return e?{size:[t,s],image:new Uint32Array(e.buffer),sdf:!0,simplePattern:!0,sdfPaddingRatio:i,sdfDecodeCoeff:a,anchorX:0,anchorY:0}:null}let ze=class{constructor(r,e){this._width=0,this._height=0,this._free=[],this._width=r,this._height=e,this._free.push(new H(0,0,r,e))}get width(){return this._width}get height(){return this._height}allocate(r,e){if(r>this._width||e>this._height)return new H;let t=null,s=-1;for(let i=0;ir&&this._free.push(new H(t.x+r,t.y,t.width-r,e)),t.height>e&&this._free.push(new H(t.x,t.y+e,t.width,t.height-e))):(t.width>r&&this._free.push(new H(t.x+r,t.y,t.width-r,t.height)),t.height>e&&this._free.push(new H(t.x,t.y+e,r,t.height-e))),new H(t.x,t.y,r,e))}release(r){for(let e=0;eMath.floor(r/256);function sa(r){const e=new Set;for(const t of r)e.add(ia(t));return e}function aa(r,e,t){return r.has(e)||r.set(e,t().then(()=>{r.delete(e)}).catch(s=>{r.delete(e),Nr(s)})),r.get(e)}const oa=r=>({rect:new H(0,0,0,0),page:0,metrics:{left:0,width:0,height:0,advance:0,top:0},code:r,sdf:!0});let na=class{constructor(r,e,t){this.width=0,this.height=0,this._dirties=[],this._glyphData=[],this._currentPage=0,this._glyphCache={},this._textures=[],this._rangePromises=new Map,this._preloadCache={},this.width=r,this.height=e,this._glyphSource=t,this._binPack=new ze(r-4,e-4),this._glyphData.push(new Uint8Array(r*e)),this._dirties.push(!0),this._textures.push(null),this._initDecorationGlyphs()}dispose(){this._binPack=null;for(const r of this._textures)r&&r.dispose();this._textures.length=0,this._glyphData.length=0}_initDecorationGlyphs(){const r=[117,149,181,207,207,181,149,117],e=[],t=[];for(let a=0;a=3&&a<5&&n>=3&&n<8?255:0;e.push(o),t.push(l)}}const s={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(e)},i={metrics:{width:5,height:2,left:0,top:0,advance:0},bitmap:new Uint8Array(t)};this._recordGlyph(s),this._recordGlyph(i)}getTexture(r,e){if(!this._textures[e]){const t=new k;t.pixelFormat=A.ALPHA,t.wrapMode=F.CLAMP_TO_EDGE,t.width=this.width,t.height=this.height,this._textures[e]=new J(r,t,new Uint8Array(this.width*this.height))}return this._dirties[e]&&(this._textures[e].setData(this._glyphData[e]),this._dirties[e]=!1),this._textures[e]}async getGlyphItems(r,e,t){const s=this._getGlyphCache(r);return await this._fetchRanges(r,e,t),e.map(i=>this._getMosaicItem(s,r,i))}bind(r,e,t,s){const i=this.getTexture(r,t);i.setSamplingMode(e),r.bindTexture(i,s)}preloadASCIIGlyphCache(r){const e=this._preloadCache[r];if(e!=null)return e;const t=this._glyphSource.preloadASCIIRange(r).then(()=>{const s=this._getGlyphCache(r);for(let i=0;i<256;i++)this._getMosaicItem(s,r,i)});return this._preloadCache[r]=t,t}_getGlyphCache(r){return this._glyphCache[r]||(this._glyphCache[r]={}),this._glyphCache[r]}_invalidate(){this._dirties[this._currentPage]=!0}async _fetchRanges(r,e,t){const s=sa(e),i=[];s.forEach(a=>{i.push(this._fetchRange(r,a,t))}),await Promise.all(i)}async _fetchRange(r,e,t){if(e>ra)return;const s=r+e;return aa(this._rangePromises,s,()=>this._glyphSource.getRange(r,e,t))}_getMosaicItem(r,e,t){if(!r[t]){const s=this._glyphSource.getGlyph(e,t);if(!s?.metrics)return oa(t);const i=this._recordGlyph(s),a=this._currentPage,o=s.metrics;r[t]={rect:i,page:a,metrics:o,code:t,sdf:!0},this._invalidate()}return r[t]}_recordGlyph(r){const e=r.metrics;let t;if(e.width===0)t=new H(0,0,0,0);else{const s=e.width+6,i=e.height+2*3;t=this._binPack.allocate(s,i),t.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(null),this._initDecorationGlyphs(),this._binPack=new ze(this.width-4,this.height-4),t=this._binPack.allocate(s,i));const a=this._glyphData[this._currentPage],o=r.bitmap;let n,l;if(o)for(let h=0;h{s.addRange(e,new jt(new Bt(new Uint8Array(n.data),new DataView(n.data))))})}async preloadASCIIRange(r){const e=this._getFontStack(r),t=0,s=255,i=this._baseURL.replace("{fontstack}",r).replace("{range}",t+"-"+s),a=await ge(i,{responseType:"array-buffer"}),o=new jt(new Bt(new Uint8Array(a.data),new DataView(a.data)));for(let n=t;n<=s;n++)e.getRange(n)||e.addRange(n,o)}getGlyph(r,e){const t=this._getFontStack(r);if(!t)return;const s=Math.floor(e/256),i=t.getRange(s);return i?{metrics:i.getMetrics(e),bitmap:i.getBitmap(e)}:void 0}_getFontStack(r){let e=this._glyphInfo[r];return e||(e=this._glyphInfo[r]=new la),e}};const me=1e20;let ca=class{constructor(r,e=2){this._textureSize=r,this._rasterizationScale=e,this._canvasSize=this._textureSize*this._rasterizationScale,this._svg=null;const{_canvasSize:t}=this,s=document.createElement("canvas");s.width=s.height=t,this._context=s.getContext("2d",{willReadFrequently:!1}),this._gridOuter=new Float64Array(t*t),this._gridInner=new Float64Array(t*t),this._f=new Float64Array(t),this._d=new Float64Array(t),this._z=new Float64Array(t+1),this._v=new Int16Array(t)}dispose(){this._context=this._gridOuter=this._gridInner=this._f=this._d=this._z=this._v=null,this._svg=Jr(this._svg)}draw(r,e,t){const{_canvasSize:s,_textureSize:i,_rasterizationScale:a}=this,o=i/4;this._initSVG();const n=this.createSVGString(r,e);return new Promise((l,h)=>{const c=new Image;c.src="data:image/svg+xml; charset=utf8, "+encodeURIComponent(n),c.onload=()=>{c.onload=null,this._context.clearRect(0,0,s,s),this._context.drawImage(c,0,0,s,s);const d=this._context.getImageData(0,0,s,s),p=new Uint8Array(i*i*4);for(let _=0;_h(Lr()))})}_initSVG(){return this._svg||(this._svg=Qr()),this._svg}createSVGString(r,e){const t=this._initSVG(),s=Zr("path");s.setAttribute("d",r),t.appendChild(s);const i=s.getBBox(),a=i.width/i.height,o=this._canvasSize/2;let n,l,h;if(a>1){n=o/i.width;const p=o*(1/a);l=this._canvasSize/4,h=o-p/2}else n=o/i.height,l=o-o*a/2,h=this._canvasSize/4;const c=-i.x*n+l,u=-i.y*n+h;s.setAttribute("style",`transform: matrix(${n}, 0, 0, ${n}, ${c}, ${u})`),s.setAttribute("stroke-width",""+.5/n);const d=`${t.innerHTML}`;return t.removeChild(s),d}_edt(r,e,t){const s=this._f,i=this._d,a=this._v,o=this._z;for(let n=0;n0&&(this._maxItemSize=s),this.pixelRatio=window.devicePixelRatio||1,this._binPack=new ze(this._pageWidth,this._pageHeight);const i=Math.floor(this._pageWidth),a=Math.floor(this._pageHeight);this._mosaicPages.push({mosaicsData:{type:"static",data:new Uint32Array(i*a)},size:[this._pageWidth,this._pageHeight],dirty:!0,texture:void 0})}getWidth(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[0]}getHeight(e){return e>=this._mosaicPages.length?-1:this._mosaicPages[e].size[1]}getPageTexture(e){return e=this._mosaicPages.length)return;const t=this._mosaicPages[e.page],s=t.mosaicsData;if(!te(t.mosaicsData))throw new fe("mapview-invalid-resource","unsuitable data type!");const i=e.spriteData,a=s.data;vr._copyBits(i,e.spriteSize[0],0,0,a,e.pageSize[0],e.rect.x+Z,e.rect.y+Z,e.spriteSize[0],e.spriteSize[1],e.repeat),t.dirty=!0}_allocateImage(e,t){e+=2*Z,t+=2*Z;const s=Math.max(e,t);if(this._maxItemSize&&this._maxItemSize{this._frameData=a,e.requestRender()};this.frameCount=this._animation.frameDurations.length,this.width=this._animation.width,this.height=this._animation.height,this._playHandle=es(this._animation,t,s,i)}destroy(){this._playHandle.remove()}loadFrame(r){const e=this._frameData;if(e==null)return;const t="width"in e?e.width:e.codedWidth,s="height"in e?e.height:e.codedHeight;r.updateData(0,Z,Z,t,s,e),this._frameData=null}},ma=class{constructor(){this._entries=new fa,this._nodes=new Map,this._book=new ga}add(r){let e=this._entries.get(r);if(!e){const t=this._book.add(r),s=new Object;e={location:t,references:0,handle:s};const i=this._entries.set(r,e);this._nodes.set(s,i)}return e.references++,e}remove(r){const e=this._nodes.get(r.handle);e&&e.payload&&(e.payload.references--,e.payload.references===0&&(this._book.remove(e.payload.location),this._entries.delete(e),this._nodes.delete(r.handle)))}getTexture(r,e){return this._book.getTexture(r,e)}destroy(){this._book.destroy()}},_a=class br{constructor(e,t){this.parent=e,this.key=t,this.payload=null,this._children=new Map}get(e){return this._children.get(e)}ensure(e){let t=this._children.get(e);return t||(t=new br(this,e),this._children.set(e,t)),t}delete(e){this._children.delete(e)}},fa=class{constructor(){this._root=new _a(null,NaN)}set(r,e){let t=this._root;for(const s of r)for(const i of s)t=t.ensure(i);return t.payload=e,t}delete(r){r.parent?.delete(r.key)}get(r){let e=this._root;for(const t of r)for(const s of t){const i=e.get(s);if(!i)return;e=i}return e.payload||void 0}},ga=class{constructor(){this._pages=[]}add(r){this._pages.length===0&&this._pages.push(new Yt);let e=this._pages.length-1,t=this._pages[e].add(r);if(t||(this._pages.push(new Yt),e=this._pages.length-1,t=this._pages[e].add(r)),!t)throw new Error("Data allocation failed.");return{...t,page:e}}remove(r){this._pages[r.page].remove(r)}getTexture(r,e){return this._pages[e].getTexture(r)}destroy(){}},Yt=class{constructor(){this._cursor={row:0,column:0},this._columns=1024,this._rows=1024,this._data=new Float32Array(this._columns*this._rows*4),this._texture=null,this._textureCursor={row:0,column:0}}add(r){if(r.length>this._columns)throw new Error(`The maximum allocation size is ${this._columns} texels.`);const e={...this._cursor};if(e.column+=r.length,e.column>=this._columns&&(e.column=r.length,e.row++),e.row>=this._rows)return null;this._cursor=e;const t={...this._cursor};t.column-=r.length;let s=4*(t.row*this._columns+t.column);for(let i=0;ist.getLogger("esri.views.2d.engine.webgl.TextureManager"),re=(r,e,t)=>ya().error(new fe(r,e,t));let va=class wr{static fromMosaic(e,t){return new wr(e,t.page,t.sdf)}constructor(e,t,s){this.mosaicType=e,this.page=t,this.sdf=s}};class ba{constructor(e){this._requestRender=e,this._resourceManager=new Zs,this._invalidFontsMap=new Map,this._sdfConverter=new ca(Ne),this._bindingInfos=new Array,this._hashToBindingIndex=new Map,this._ongoingRasterizations=new Map,this._imageRequestQueue=new ts({concurrency:10,process:async(t,s)=>{it(s);try{return await ge(t,{responseType:"image",signal:s})}catch(i){throw vt(i)?i:new fe("mapview-invalid-resource",`Could not fetch requested resource at ${t}`,i)}}}),this.animationStore=new ma,this._spriteMosaic=new ua(2048,2048,500),this._glyphSource=new ha(`${Fr.fontsUrl}/{fontstack}/{range}.pbf`),this._glyphMosaic=new na(1024,1024,this._glyphSource),this._rasterizer=new ta(this.resourceManager)}dispose(){this._spriteMosaic.dispose(),this._glyphMosaic.dispose(),this._rasterizer.dispose(),this._sdfConverter.dispose(),this._spriteMosaic=null,this._glyphMosaic=null,this._sdfConverter=null,this._hashToBindingIndex.clear(),this._hashToBindingIndex=null,this._bindingInfos=null,this._ongoingRasterizations.clear(),this._ongoingRasterizations=null,this._imageRequestQueue.clear(),this._imageRequestQueue=null,this._resourceManager.destroy(),this.animationStore.destroy()}get sprites(){return this._spriteMosaic}get glyphs(){return this._glyphMosaic}get resourceManager(){return this._resourceManager}async rasterizeItem(e,t){if(e==null)return re("mapview-null-resource","Unable to rasterize null resource"),null;if(e.type==="animation-info"){const{resource:a}=e,o=this.animationStore.add(a),{location:n}=o;return{rect:new H(n.column,n.row,a.length,1),page:n.page,type:"sprite",width:a.length,height:1,rasterizationScale:1,sdfPaddingRatio:.5,sdfDecodeCoeff:1,simplePattern:!1}}if(e.type!=="cim-rasterization-info")return re("mapview-unexpected-resource","Unable to rasterize resource"),null;const{resource:s}=e;if(s.type==="text"){const a=await this._rasterizeText(s,t);for(const o of a.glyphs)this._setTextureBinding(we.GLYPH,o);return a}const i=await this._rasterizeSprite(s,t);return i&&this._setTextureBinding(we.SPRITE,i),i}getMosaicInfo(e,t,s=!1){const i=this._getTextureBindingInfo(e,t,s);return i?{size:i.size,texture:{texture:i.texture,unit:i.type==="sprite"?gi:Ot}}:(re("mapview-invalid-resource",`Unable to find resource for ${t}`),{size:[0,0],texture:{texture:null,unit:0}})}_getTextureBindingInfo(e,t,s){const i=this._bindingInfos[t-1],a=i.page,o=s?q.LINEAR_MIPMAP_LINEAR:q.LINEAR;switch(i.mosaicType){case we.SPRITE:{const n=[this.sprites.getWidth(a),this.sprites.getHeight(a)],l=this._spriteMosaic.getTexture(e,a);return l.setSamplingMode(o),{type:"sprite",texture:l,size:n}}case we.GLYPH:{const n=[this.glyphs.width,this.glyphs.height],l=this._glyphMosaic.getTexture(e,a);return this._glyphMosaic.bind(e,o,a,Ot),l.setSamplingMode(o),{type:"glyph",texture:l,size:n}}default:return re("mapview-texture-manager",`Cannot handle unknown type ${i.mosaicType}`),null}}_hashMosaic(e,t){return 1|e<<1|(t.sdf?1:0)<<2|t.page<<3}_setTextureBinding(e,t){const s=this._hashMosaic(e,t);if(!this._hashToBindingIndex.has(s)){const i=va.fromMosaic(e,t),a=this._bindingInfos.length+1;this._hashToBindingIndex.set(s,a),this._bindingInfos.push(i)}t.textureBinding=this._hashToBindingIndex.get(s)}async _rasterizeText(e,t){const{font:s,textString:i}=e,a=jr(s),o=this._invalidFontsMap.has(a),[n,l]=Xr(i),h=Ji(n);try{const c=o?Kt:a;return K("esri-2d-stabilize-glyphs")&&await this._glyphMosaic.preloadASCIIGlyphCache(c),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(c,h,t),isRightToLeft:l}}catch{return re("mapview-invalid-resource",`Couldn't find font ${a}. Falling back to Arial Unicode MS Regular`),this._invalidFontsMap.set(a,!0),{type:"glyphs",glyphs:await this._glyphMosaic.getGlyphItems(Kt,h,t),isRightToLeft:l}}}_hashSpriteResource(e){switch(e.type){case"path":return`path:${e.path}.${e.asFill?1:0}`;case"CIMPictureMarker":return`${e.type}:${e.url}:${e.size}`;case"CIMPictureFill":return`${e.type}:${e.url}:${e.height}`;case"CIMPictureStroke":return`${e.type}:${e.url}:${e.width}`;case"dash":return`dash:${e.capStyle}.${or(e.dashTemplate).join("")}`;case"sdf":return`sdf:${JSON.stringify(e.geom)}.${e.asFill?1:0}`;case"fill-style":return`fill_style:${e.style}`;case"animated":return JSON.stringify(Qi(e));case"CIMHatchFill":case"CIMVectorMarker":return JSON.stringify(e)}}async _rasterizeSprite(e,t){if(!e)return null;const s=ir(this._hashSpriteResource(e));if(this._spriteMosaic.has(s))return this._spriteMosaic.getSpriteItem(s);if("url"in e&&e.url||e.type==="CIMPictureFill"||e.type==="CIMPictureStroke"||e.type==="CIMPictureMarker"||e.type==="CIMVectorMarker"){const i=[];le.fetchResources({type:"CIMPointSymbol",symbolLayers:[e]},this._resourceManager,i),i.length>0&&await Promise.all(i)}switch(e.type){case"CIMPictureMarker":return e.markerPlacement?.type==="CIMMarkerPlacementInsidePolygon"?this._rasterizeJSONResource(s,e):this._handleAsyncResource(s,e,t);case"animated":case"CIMPictureFill":case"CIMPictureStroke":case"path":return this._handleAsyncResource(s,e,t);case"sdf":case"dash":case"fill-style":case"CIMVectorMarker":case"CIMHatchFill":return this._rasterizeJSONResource(s,e)}}_rasterizeJSONResource(e,t){const s=this._rasterizer.rasterizeJSONResource(t);if(s){const{size:i,image:a,sdf:o,simplePattern:n,rasterizationScale:l,sdfPaddingRatio:h,sdfDecodeCoeff:c}=s;return this._addItemToMosaic(e,i,{type:"static",data:a},Se(t),o,n,l,h,c)}return null}async _handleAsyncResource(e,t,s){if(this._ongoingRasterizations.has(e))return this._ongoingRasterizations.get(e);let i;return i=t.type==="path"?this._handleSVG(t,e,s):this._handleImage(t,e,s),this._ongoingRasterizations.set(e,i),i.finally(()=>this._ongoingRasterizations.delete(e)),i}async _handleSVG(e,t,s){const i=[Ne,Ne],{asFill:a}=e,o=await this._sdfConverter.draw(e.path,a,s);return this._addItemToMosaic(t,i,{type:"static",data:new Uint32Array(o.buffer)},!1,!0,!0)}async _handleGIFOrPNG(e,t,s){const i=e.url,a=this.resourceManager.getResource(i);if(a==null)return null;const{width:o,height:n}=a;if(a instanceof HTMLImageElement){if(e.type==="animated")return re("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;const d="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:p,sdf:_,image:m}=this._rasterizer.rasterizeImageResource(o,n,a,d);return this._addItemToMosaic(t,p,{type:"static",data:m},Se(e),_,!1)}let l,h,c;e.type==="animated"?(l=!1,h={type:"CIMAnimatedSymbolProperties",playAnimation:e.playAnimation,reverseAnimation:e.reverseAnimation,randomizeStartTime:e.randomizeStartTime,randomizeStartSeed:e.randomizeStartSeed,startTimeOffset:e.startTimeOffset,duration:e.duration,repeatType:e.repeatType,repeatDelay:e.repeatDelay},c=e.startGroup||0):(l=Se(e),h={type:"CIMAnimatedSymbolProperties"},c=0);const u=new pa(a,this._requestRender,h,c);return this._addItemToMosaic(t,[u.width,u.height],{type:"animated",data:u},l,!1,!1)}async _handleImage(e,t,s){const i=e.url;if(xa(i)||Sa(i))return this._handleGIFOrPNG(e,t,s);if(e.type==="animated")return re("mapview-unexpected-resource","Attempt to configure animations for a non-animated image."),null;try{let a;const o=this.resourceManager.getResource(i);if(o!=null&&o instanceof HTMLImageElement)a=o;else{const{data:p}=await this._imageRequestQueue.push(i,{...s});a=p}if(Zi(i)){if("width"in e&&"height"in e)a.width=se(e.width),a.height=se(e.height);else if("cim"in e){const p=e;a.width=se(p.width??p.scaleX*p.size),a.height=se(p.size)}}if(!a.width||!a.height)return null;const n=a.width,l=a.height,h="colorSubstitutions"in e?e.colorSubstitutions:void 0,{size:c,sdf:u,image:d}=this._rasterizer.rasterizeImageResource(n,l,a,h);return this._addItemToMosaic(t,c,{type:"static",data:d},Se(e),u,!1)}catch(a){throw vt(a)?a:new fe("mapview-invalid-resource",`Could not fetch requested resource at ${i}. ${a.message}`)}}_addItemToMosaic(e,t,s,i,a,o,n,l,h){return this._spriteMosaic.addSpriteItem(e,t,s,i,a,o,n,l,h)}}function Se(r){switch(r.type){case"CIMVectorMarker":case"CIMPictureMarker":return Pa(r);default:return!0}}const wa=r=>r!=null&&r.startsWith("data:image/gif"),xa=r=>r&&(r.includes(".gif")||wa(r)),Ma=r=>r!=null&&r.startsWith("data:image/png"),Sa=r=>r&&(r.includes(".png")||Ma(r)),Pa=r=>r&&"markerPlacement"in r&&r.markerPlacement&&r.markerPlacement.type==="CIMMarkerPlacementInsidePolygon";let Ca=class{constructor(r){this._queue=[],this._refreshable=r}destroy(){this._queue=[]}enqueueTextureUpdate(r,e){const t=kr(),s=r,i=Pi,a=Math.ceil(s.height/i);it(e);for(let o=0;ot.reject(o)),t.promise}upload(){let r=0;for(;this._queue.length;){const e=performance.now(),t=this._queue.shift();if(t){if(t.options.signal!=null&&t.options.signal.aborted)continue;switch(t.type){case"chunk":this._uploadChunk(t);break;case"no-chunk":this._uploadNoChunk(t)}const s=performance.now()-e;if(r+=s,r+s>=yi)break}}this._queue.length&&this._refreshable.requestRender()}_uploadChunk(r){const{request:e,resolver:t,chunkOffset:s,chunkIsLast:i,destHeight:a}=r,{data:o,texture:n,width:l}=e;o!=null&&(n.updateData(0,0,s,l,a,o,s),i&&t.resolve())}_uploadNoChunk(r){const{request:e,resolver:t}=r,{data:s,texture:i}=e;i.setData(s),t.resolve()}};const Oa=ns(-.5,-.5);class Ta{constructor(){this._centerNdc=Be(),this._pxToNdc=Be(),this._worldDimensionsPx=Be(),this._mat3=Fe(),this._initialized=!1}dispose(){this._program=z(this._program),this._quad=z(this._quad)}render(e,t,s){const{context:i}=e,a=this._updateGeometry(e,s);if(t!=null){const{r:o,g:n,b:l,a:h}=t;i.setClearColor(h*o/255,h*n/255,h*l/255,h)}else i.setClearColor(0,0,0,0);if(i.setStencilFunction(tt.ALWAYS,0,255),i.setStencilWriteMask(255),!a)return i.setClearStencil(et),void i.clear(i.gl.STENCIL_BUFFER_BIT|i.gl.COLOR_BUFFER_BIT);i.setClearStencil(vi),i.clear(i.gl.STENCIL_BUFFER_BIT|i.gl.COLOR_BUFFER_BIT),this._initialized||this._initialize(i),i.setDepthWriteEnabled(!1),i.setDepthTestEnabled(!1),i.setColorMask(!1,!1,!1,!1),i.setBlendingEnabled(!1),i.setStencilOp(Ve.KEEP,Ve.KEEP,Ve.REPLACE),i.setStencilFunction(tt.ALWAYS,et,255),i.setStencilTestEnabled(!0),i.useProgram(this._program),this._program.setUniformMatrix3fv("u_worldExtent",this._mat3),this._quad.bind(),this._quad.draw(),this._quad.unbind()}_initialize(e){if(this._initialized)return;const t=Ee(e,Li);t&&(this._program=t,this._quad=new ye(e,[0,0,1,0,0,1,1,1]),this._initialized=!0)}_updateGeometry(e,t){const{state:s,pixelRatio:i}=e,{size:a,rotation:o}=s,n=Math.round(a[0]*i),l=Math.round(a[1]*i);if(!s.spatialReference.isWrappable)return!1;const h=rs(o),c=Math.abs(Math.cos(h)),u=Math.abs(Math.sin(h)),d=Math.round(n*c+l*u),p=Math.round(i*s.worldScreenWidth);if(d<=p)return!1;const _=n*u+l*c,m=(t.left-t.right)*i/n,y=(t.bottom-t.top)*i/l;Ge(this._worldDimensionsPx,p,_,1),Ge(this._pxToNdc,2/n,-2/l,1),Ge(this._centerNdc,m,y,1);const g=this._mat3;return as(g,this._centerNdc),Dt(g,g,this._pxToNdc),o!==0&&pr(g,g,h),Dt(g,g,this._worldDimensionsPx),dr(g,g,Oa),!0}}let Ra=class extends ot{constructor(){super(...arguments),this.type=at.Blend,this._backBufferTexture=null,this.shaders={blend:new Ni,opacity:new Ui}}shutdown(){super.shutdown(),this._backBufferTexture!==null&&(this._backBufferTexture.dispose(),this._backBufferTexture=null)}render(r,e){const{context:t,state:s,pixelRatio:i,inFadeTransition:a,painter:o}=r,{size:n}=s,l=t.getBoundFramebufferObject();let h,c;l!=null?(h=l.width,c=l.height):(h=Math.round(i*n[0]),c=Math.round(i*n[1]));const{blendMode:u}=e;if(u==="normal"){const y={shader:this.shaders.opacity,uniforms:{config:{layerTexture:{texture:e.colorTexture,unit:0},opacity:e.config.opacity}},defines:null,optionalAttributes:null,useComputeBuffer:!1};return o.setPipelineState(nt),void o.submitDrawMesh(t,y,o.quadMesh)}const d=this._createOrResizeTexture(r,h,c);l.copyToTexture(0,0,h,c,0,0,d);const p={color:{write:[!0,!0,!0,!0],blendMode:"custom",blendParameters:{srcRGB:w.ONE,dstRGB:w.ZERO,srcAlpha:w.ONE,dstAlpha:w.ZERO}},depth:!1,stencil:!1};o.setPipelineState(p);const _={backbufferTexture:{texture:d,unit:0},layerTexture:{texture:e.colorTexture,unit:1},inFadeOpacity:a?1:0,...e.config},m={shader:this.shaders.blend,uniforms:{config:_},defines:{blendMode:u},optionalAttributes:null,useComputeBuffer:!1};o.submitDrawMesh(t,m,o.quadMesh)}_createOrResizeTexture(r,e,t){const{context:s}=r;if(this._backBufferTexture!==null&&this._backBufferTexture.descriptor?.width===e&&this._backBufferTexture.descriptor?.height===t)return this._backBufferTexture;if(this._backBufferTexture===null){const i=new k;i.internalFormat=A.RGBA,i.wrapMode=F.CLAMP_TO_EDGE,i.width=e,i.height=t,this._backBufferTexture=new J(s,i)}else this._backBufferTexture.resize(e,t);return this._backBufferTexture}},Ea=class{constructor(){this._blendTechnique=new Ra}dispose(r){this._blendTechnique?.shutdown()}draw(r,e,t,s,i){this._blendTechnique.render(r,{colorTexture:e,config:{opacity:i,samplingMode:t},blendMode:s})}},ut=class{constructor(){this.name=this.constructor.name}createOptions(r,e){return null}},Jt=class extends ut{constructor(r){super(),this.name=this.constructor.name,this.defines=[r]}dispose(){}bind({context:r,painter:e}){this._prev=r.getBoundFramebufferObject();const t=e.getFbos().effect0;r.bindFramebuffer(t),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.clear(r.gl.COLOR_BUFFER_BIT)}unbind(){}draw(r,e){const{context:t,painter:s}=r,i=s.getPostProcessingEffects(e),a=t.getBoundFramebufferObject();for(const{postProcessingEffect:o,effect:n}of i)o.draw(r,a,n);t.bindFramebuffer(this._prev),t.setStencilTestEnabled(!1),s.blitTexture(t,a.colorTexture,q.NEAREST),t.setStencilTestEnabled(!0)}},za=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.quadGeometry.dispose(),this._resources.quadVAO.dispose(),this._resources.highlightProgram.dispose(),this._resources.blurProgram.dispose(),this._resources=null)}preBlur(r,e){r.bindTexture(e,pe),r.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[1,0,1/this._width,0]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",$r),r.bindVAO(this._resources.quadVAO),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}finalBlur(r,e){r.bindTexture(e,pe),r.useProgram(this._resources.blurProgram),this._resources.blurProgram.setUniform4fv("u_direction",[0,1,0,1/this._height]),this._resources.blurProgram.setUniformMatrix4fv("u_channelSelector",Hr),r.bindVAO(this._resources.quadVAO),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}renderHighlight(r,e,t){r.bindTexture(e,pe),r.useProgram(this._resources.highlightProgram),t.applyHighlightOptions(r,this._resources.highlightProgram),r.bindVAO(this._resources.quadVAO),r.setBlendingEnabled(!0),r.setBlendFunction(w.ONE,w.ONE_MINUS_SRC_ALPHA),r.drawArrays(Oe.TRIANGLE_STRIP,0,4),r.bindVAO()}_initialize(r,e,t){this._width=e,this._height=t;const s=hr.createVertex(r,cr.STATIC_DRAW,new Int8Array([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]).buffer),i=new ur(r,new Map([["a_position",0],["a_texcoord",1]]),new Map([["geometry",[new Lt("a_position",2,It.BYTE,0,4),new Lt("a_texcoord",2,It.UNSIGNED_BYTE,2,4)]]]),new Map([["geometry",s]])),a=Ee(r,Vi),o=Ee(r,Gi);r.useProgram(a),a.setUniform1i("u_texture",pe),a.setUniform1i("u_shade",Ci),a.setUniform1f("u_sigma",bt),r.useProgram(o),o.setUniform1i("u_texture",pe),o.setUniform1f("u_sigma",bt),this._resources={quadGeometry:s,quadVAO:i,highlightProgram:a,blurProgram:o}}setup(r,e,t){this._resources?(this._width=e,this._height=t):this._initialize(r,e,t)}};function Qt(r,e,t){const s=new k(e,t);return s.wrapMode=F.CLAMP_TO_EDGE,new X(r,s,new ct(lt.STENCIL_INDEX8,e,t))}let Fa=class{constructor(){this._width=void 0,this._height=void 0,this._resources=null}dispose(){this._resources&&(this._resources.sharedBlur1Fbo.dispose(),this._resources.sharedBlur2Fbo.dispose(),this._resources=null)}_initialize(r,e,t){this._width=e,this._height=t;const s=Qt(r,e,t),i=Qt(r,e,t);this._resources={sharedBlur1Fbo:s,sharedBlur2Fbo:i}}setup(r,e,t){!this._resources||this._width===e&&this._height===t||this.dispose(),this._resources||this._initialize(r,e,t)}get sharedBlur1Tex(){return this._resources.sharedBlur1Fbo.colorTexture}get sharedBlur1Fbo(){return this._resources.sharedBlur1Fbo}get sharedBlur2Tex(){return this._resources.sharedBlur2Fbo.colorTexture}get sharedBlur2Fbo(){return this._resources.sharedBlur2Fbo}};const ie=4,Pe=4/ie;let ka=class extends ut{constructor(){super(...arguments),this.defines=["highlight"],this._hlRenderer=new za,this._width=void 0,this._height=void 0,this._boundFBO=null,this._hlSurfaces=new Fa,this._adjustedWidth=void 0,this._adjustedHeight=void 0,this._blitRenderer=new yr}dispose(){this._hlSurfaces?.dispose(),this._hlRenderer?.dispose(),this._boundFBO=null}bind(r){const{context:e,painter:t}=r,{width:s,height:i}=e.getViewport(),a=t.getFbos().effect0;this.setup(r,s,i),e.bindFramebuffer(a),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.clear(e.gl.COLOR_BUFFER_BIT)}unbind(){}setup({context:r},e,t){this._width=e,this._height=t;const s=e%ie,i=t%ie;e+=sl.resolve([]));const a=i.getFBO(t),o=new Uint8Array(a.width*a.height*4);try{await a.readPixelsAsync(0,0,a.width,a.height,A.RGBA,ht.UNSIGNED_BYTE,o)}catch{return void e.forEach(l=>l.resolve([]))}const n=[];for(let l=0;ll.resolve(n))}};const Xe=5,Ia=[1,0],Ba=[0,1],Da=[1,.8,.6,.4,.2],La=[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];let Na=class{constructor(){this._intensityFBO=null,this._compositeFBO=null,this._mipsFBOs=new Array(Xe),this._nMips=Xe,this._kernelSizeArray=[3,5,7,9,11],this._size=[0,0],this._programDesc={luminosityHighPass:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/luminosityHighPass",attributes:new Map([["a_position",0]])},gaussianBlur:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/gaussianBlur",attributes:new Map([["a_position",0]])},composite:{vsPath:"post-processing/pp",fsPath:"post-processing/bloom/composite",attributes:new Map([["a_position",0]])},blit:{vsPath:"post-processing/pp",fsPath:"post-processing/blit",attributes:new Map([["a_position",0]])}}}dispose(){if(this._quad=z(this._quad),this._intensityFBO=z(this._intensityFBO),this._compositeFBO=z(this._compositeFBO),this._mipsFBOs){for(let r=0;rnew $a,blur:()=>new Ga,bloom:()=>new Na,opacity:()=>new ja,"drop-shadow":()=>new qa};let Ka=class{constructor(){this._effectMap=new Map}dispose(){this._effectMap.forEach(r=>r.dispose()),this._effectMap.clear()}getPostProcessingEffects(r){if(!r||r.length===0)return[];const e=[];for(const t of r){const s=Xa(t.type);let i=this._effectMap.get(s);i||(i=Ya[s](),this._effectMap.set(s,i)),e.push({postProcessingEffect:i,effect:t})}return e}},Ja=class{constructor(r,e){this.brushes=r,this.name=e.name,this.drawPhase=e.drawPhase||W.MAP,this._targetFn=e.target,this.effects=e.effects||[],this.enableDefaultDraw=e.enableDefaultDraw??(()=>!0),this.forceDrawByDisplayOrder=!!e.forceDrawByDisplayOrder}render(r){const{context:e,profiler:t}=r,s=this._targetFn(),i=this.drawPhase&r.drawPhase;if(t.recordPassStart(this.name),i){this.enableDefaultDraw()&&this._doRender(r,s),t.recordPassEnd();for(const a of this.effects){if(!a.enable())continue;const o=a.apply,n=a.args?.(),l=e.getViewport(),h=e.getBoundFramebufferObject(),c=r.passOptions;this._bindEffect(r,o,n),this._doRender(r,s,o.defines),this._drawAndUnbindEffect(r,o,l,h,c,n)}}}_doRender(r,e,t){if(e==null)return;const{profiler:s,context:i}=r;for(const a of this.brushes){if(s.recordBrushStart(a.name),a.brushEffect!=null){const o=i.getViewport(),n=i.getBoundFramebufferObject(),l=r.passOptions;this._bindEffect(r,a.brushEffect),this._drawWithBrush(a,r,e,t),this._drawAndUnbindEffect(r,a.brushEffect,o,n,l)}else this._drawWithBrush(a,r,e,t);s.recordBrushEnd()}}_drawWithBrush(r,e,t,s){Ir(t)?(r.prepareState(e,s),r.drawMany(e,t,s)):t.visible&&(r.prepareState(e,s),r.draw(e,t,s))}_bindEffect(r,e,t){const{profiler:s}=r;s.recordPassStart(this.name+"."+e.name),e.bind(r,t);const i=e.createOptions(r,t);r.passOptions=i}_drawAndUnbindEffect(r,e,t,s,i,a){const{profiler:o,context:n}=r;r.passOptions=i,o.recordBrushStart(e.name),e.draw(r,a),e.unbind(r,a),n.bindFramebuffer(s);const{x:l,y:h,width:c,height:u}=t;n.setViewport(l,h,c,u),o.recordBrushEnd(),o.recordPassEnd()}};class Zt{constructor(){this._programCache=new Map}destroy(){for(const e of this._programCache.values())e.destroy();this._programCache.clear()}getProgram(e,t,s,i,a){const o=e.getShaderKey(t,s,i,a);let n=this._programCache.get(o);return n||(n=e.getProgram(t,s,i,a),this._programCache.set(o,n)),n}}let Qa=class{constructor(r,e){this.context=r,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new yr,this._worldExtentRenderer=new Ta,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new Js,this._blendEffect=new Ea,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new ka,hittest:new Aa,insideEffect:new Jt("inside"),outsideEffect:new Jt("outside")},this._programCache=new Zt,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new Qs(r),this.textureManager=new ba(e),this.textureUploadManager=new Ca(e),this._effectsManager=new Ka,this._quadMesh=ri.fromVertexStream(r,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=z(this._blitRenderer),this._worldExtentRenderer=z(this._worldExtentRenderer),this._quadMesh=rt(this._quadMesh),this._brushCache&&(this._brushCache.forEach(r=>r.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos){let r;for(r in this._fbos)this._fbos[r]&&this._fbos[r].dispose()}for(const r of this._fboPool)r.dispose();if(this._fboPool.length=0,this.effects){let r;for(r in this.effects)this.effects[r]&&this.effects[r].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=z(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new Zt}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(r,e){let t;if(this._fboPool.length>0)t=this._fboPool.pop();else{const s=new k(r,e);s.samplingMode=q.NEAREST,s.wrapMode=F.CLAMP_TO_EDGE,t=new X(this.context,s,this._stencilBuf)}return t.width===r&&t.height===e||t.resize(r,e),t}releaseFbo(r){this._fboPool.push(r)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(r,e,t){const{context:s}=r;this._worldExtentRenderer.render(r,e,t);const{width:i,height:a}=s.getViewport();if(this.updateFBOs(i,a),this._prevFBO=s.getBoundFramebufferObject(),s.bindFramebuffer(this.getFbos().output),s.setColorMask(!0,!0,!0,!0),e!=null){const{r:o,g:n,b:l,a:h}=e;s.setClearColor(h*o/255,h*n/255,h*l/255,h)}else s.setClearColor(0,0,0,0);s.setDepthWriteEnabled(!0),s.setClearDepth(1),s.clear(s.gl.COLOR_BUFFER_BIT|s.gl.DEPTH_BUFFER_BIT),s.setDepthWriteEnabled(!1)}afterRenderPhases(r){const{context:e}=r;e.bindFramebuffer(this._prevFBO),e.setStencilFunction(tt.EQUAL,et,255),e.setStencilTestEnabled(!0),e.setDepthTestEnabled(!1),this.blitTexture(e,this.getFbos().output.colorTexture,q.NEAREST)}beforeRenderLayer(r,e,t){const{context:s,blendMode:i,effects:a,drawPhase:o,requireFBO:n}=r;if(n||er(o,i,a,t)){const l=s.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(l);const{width:h,height:c}=s.getViewport(),u=this.acquireFbo(h,c);s.bindFramebuffer(u),s.setColorMask(!0,!0,!0,!0),s.setClearColor(0,0,0,0),s.setDepthWriteEnabled(!0),s.setClearDepth(1),s.clear(s.gl.COLOR_BUFFER_BIT|s.gl.DEPTH_BUFFER_BIT),s.setDepthWriteEnabled(!1)}s.setDepthWriteEnabled(!1),s.setDepthTestEnabled(!1),s.setStencilTestEnabled(!0),s.setClearStencil(e),s.setStencilWriteMask(255),s.clear(s.gl.STENCIL_BUFFER_BIT)}afterRenderLayer(r,e){const{context:t,blendMode:s,effects:i,requireFBO:a,drawPhase:o}=r;if(a||er(o,s,i,e)){const n=t.getBoundFramebufferObject();i!=null&&i.length>0&&o===W.MAP&&(t.setColorMask(!0,!0,!0,!0),this._applyEffects(r,i,n)),t.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),t.setStencilTestEnabled(!1),t.setStencilWriteMask(0),t.setBlendingEnabled(!0),t.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0);const l=s==null||o===W.HIGHLIGHT||o===W.LABEL?"normal":s;this._blendEffect.draw(r,n.colorTexture,q.NEAREST,l,e),this.releaseFbo(n)}}renderObject(r,e,t,s){const i=zt[t];if(!i)return;let a=this._brushCache.get(i);a===void 0&&(a=new i,this._brushCache.set(i,a)),a.prepareState(r),a.draw(r,e,s)}renderObjects(r,e,t,s){const i=zt[t];if(!i)return;let a=this._brushCache.get(i);a===void 0&&(a=new i,this._brushCache.set(i,a)),a.drawMany(r,e,s)}registerRenderPass(r){const e=r.brushes.map(t=>(this._brushCache.has(t)||this._brushCache.set(t,new t),this._brushCache.get(t)));return new Ja(e,r)}blitTexture(r,e,t,s=1){r.setBlendingEnabled(!0),r.setBlendFunctionSeparate(w.ONE,w.ONE_MINUS_SRC_ALPHA,w.ONE,w.ONE_MINUS_SRC_ALPHA),r.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(r,e,t,s),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(r){return this._effectsManager.getPostProcessingEffects(r)}updateFBOs(r,e){if(r!==this._lastWidth||e!==this._lastHeight){if(this._lastWidth=r,this._lastHeight=e,this._fbos){let i;for(i in this._fbos)this._fbos[i].resize(r,e);return}const t=new k(r,e);t.samplingMode=q.NEAREST,t.wrapMode=F.CLAMP_TO_EDGE;const s=new ct(lt.DEPTH_STENCIL,r,e);this._stencilBuf=new ls(this.context,s),this._fbos={output:new X(this.context,t,this._stencilBuf),effect0:new X(this.context,t,this._stencilBuf)}}}_applyEffects(r,e,t){const{context:s}=r,i=this._effectsManager.getPostProcessingEffects(e);for(const{postProcessingEffect:a,effect:o}of i)s.bindFramebuffer(t),a.draw(r,t,o);this._currentPipelineStateNeedsUpdate=!0}setShader(r){this._shaderState.shader=r.shader,this._shaderState.uniforms=r.uniforms,this._shaderState.defines=r.defines,this._shaderState.optionalAttributes=r.optionalAttributes,this._shaderState.useComputeBuffer=r.useComputeBuffer??!1}setPipelineState(r){r!==this._currentPipelineState&&(this._currentPipelineState=r,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(r,e){const{shader:t,uniforms:s,defines:i,optionalAttributes:a}=this._shaderState,o=r.context,n=e.getAttributePrecisionPackFactors(),l=this._programCache.getProgram(t,n,s,i??{},a??{});return l.setUniforms(s),l.bind(o),this.updatePipelineState(o),this.setStencilRef(o,e),e.draw(r,t.locationInfo),l.cleanupTemporaryTextures(),{vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}submitDrawMesh(r,e,t,s){this.submitDrawMeshUntyped(r,e,t,s)}submitDrawMeshUntyped(r,e,t,s){this.setShader(e);const{shader:i,uniforms:a,defines:o,optionalAttributes:n}=this._shaderState,l=this._programCache.getProgram(i,{},a,o??{},n??{});if(l.setUniforms(a),l.bind(r),this.updatePipelineState(r),s)for(const h of s)t.bind(r,h),t.draw(r);else for(let h=0;h0)}let Za=class{constructor(){this._candidateTiles=[]}schedule(r){this._candidateTiles.includes(r)||this._candidateTiles.push(r)}reshuffle(r){const e=[];for(const t of this._candidateTiles)r>0?(t.reshuffle(),r--):e.push(t);this._candidateTiles=e}};const eo=2e3;class Rl extends Oi{constructor(e,t){super(),this.meshWriterRegistry=new hs,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=Ur(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new Za,this._canvas=new Us(e),this.context=new Hi(this._canvas.gl,t.contextOptions??{}),this.painter=new Qa(this.context,this),this._cimAnalyzer=new Bs(this.painter.textureManager.resourceManager),K("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),e.appendChild(this._debugOutput));const s=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:t.timeline||new Vr,renderingOptions:t.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new Ii(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return s()},reshuffleManager:this._reshuffleManager,backgroundColor:t.backgroundColor},this._taskHandle=xr({render:i=>this.renderFrame(i)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",i=>this.emit("webgl-error",{error:new fe("webgl-context-lost",i.statusMessage)})),this._bufferPool=new Fi,ei()}destroy(){ti(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=dt(this._taskHandle),this._lostWebGLContextHandle=dt(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=eo,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:Fe()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(fi),this._canvas.render(e,()=>this._renderChildren(this.children,e));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const s=this.context;this.painter.textureUploadManager.upload(),s.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=W.MAP;for(const i of e)i.processRender(t);if(this.children.some(i=>i.hasHighlight)){t.drawPhase=W.HIGHLIGHT;for(const i of e)i.processRender(t)}if(this.children.some(i=>i.hasLabels)){t.drawPhase=W.LABEL;for(const i of e)i.processRender(t)}if(K("esri-tiles-debug")){t.drawPhase=W.DEBUG;for(const i of e)i.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),s.logInfo()}doRender(e){const t=this.context,{state:s,pixelRatio:i}=e;this._canvas.resize(e),t.setViewport(0,0,i*s.size[0],i*s.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,s,i){const a=Math.round(this.state.size[0]*e.resolutionScale),o=Math.round(this.state.size[1]*e.resolutionScale),n=e.resolutionScale,l=this.context,h=this._state.clone();if(i!=null){const f=h.viewpoint;h.viewpoint.rotation=i,h.viewpoint=f}const c={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:n,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:s},u=new k(a,o);u.wrapMode=F.CLAMP_TO_EDGE,u.internalFormat=$i.RGBA8,u.isImmutable=!0;const d=new X(l,u,new ct(lt.DEPTH_STENCIL,a,o)),p=l.getBoundFramebufferObject(),_=l.getViewport();l.bindFramebuffer(d),l.setViewport(0,0,a,o),this._renderChildren(t??this.children,c);const m=this._readbackScreenshot(d,{...e.cropArea,y:o-(e.cropArea.y+e.cropArea.height)});l.bindFramebuffer(p),l.setViewport(_.x,_.y,_.width,_.height),this.requestRender();const y=await m;let g;return e.outputScale===1?g=y:(g=new ImageData(Math.round(y.width*e.outputScale),Math.round(y.height*e.outputScale)),(await Te(()=>import("./MapView-BGOJJ8ch-CJtpe3RS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]),import.meta.url).then(f=>f.U)).resampleHermite(y,g,!0)),d.dispose(),g}async _readbackScreenshot(e,t){const s=(await Te(()=>import("./MapView-BGOJJ8ch-CJtpe3RS.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57]),import.meta.url).then(i=>i.U)).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,A.RGBA,ht.UNSIGNED_BYTE,new Uint8Array(s.data.buffer)),s}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}let to=class extends ot{constructor(){super(...arguments),this.type=at.Magnifier,this._resourcePixelRatio=1,this._position=[0,0,0,0],this.shaders={magnifier:new Bi}}updateResources(r,e,t,s){r.pixelRatio!==this._resourcePixelRatio&&this._destroyResources(),this._readbackTexture||this._initializeResources(r,e,t,s);const{context:i,pixelRatio:a}=r,{factor:o,offset:n,position:l}=s,{size:h}=r.state,c=s.size*a,u=1/o,d=Math.ceil(u*c);this._readbackTexture.resize(d,d);const p=a*h[0],_=a*h[1],m=.5*d,y=.5*d,g=mt(a*l.x,m,p-m-1),f=mt(_-a*l.y,y,_-y-1),x=g-m,b=f-y,v=this._readbackTexture;i.bindTexture(v,0),i.gl.copyTexImage2D(v.descriptor.target,0,v.descriptor.pixelFormat,x,b,d,d,0);const M=(g+n.x*a)/p*2-1,C=(f-n.y*a)/_*2-1,T=c/p*2,G=c/_*2;this._position[0]=M,this._position[1]=C,this._position[2]=T,this._position[3]=G}render(r,e){const{context:t,painter:s}=r;s.setPipelineState(nt);const i={readbackTexture:{texture:this._readbackTexture,unit:0},maskTexture:{texture:this._maskTexture,unit:7},overlayTexture:{texture:this._overlayTexture,unit:6},drawPos:this._position,...e};s.submitDrawMesh(t,{shader:this.shaders.magnifier,uniforms:{config:i},defines:null,optionalAttributes:null,useComputeBuffer:!1},s.quadMesh)}shutdown(){this._destroyResources()}_initializeResources(r,e,t,s){const i=r.context;this._resourcePixelRatio=r.pixelRatio;const a=Math.ceil(s.size*r.pixelRatio);t.width=a,t.height=a;const o=new k;o.internalFormat=A.RGBA,o.wrapMode=F.CLAMP_TO_EDGE,o.samplingMode=q.NEAREST,o.flipped=!0,o.preMultiplyAlpha=!Rr(t.src)||!r.context.driverTest.svgPremultipliesAlpha.result,this._overlayTexture=new J(i,o,t),e.width=a,e.height=a,o.pixelFormat=o.internalFormat=A.ALPHA,this._maskTexture=new J(i,o,e);const n=1/s.factor;o.pixelFormat=o.internalFormat=A.RGBA,o.width=o.height=Math.ceil(n*a),o.samplingMode=q.LINEAR,o.flipped=!1,this._readbackTexture=new J(i,o)}_destroyResources(){z(this._maskTexture),z(this._overlayTexture),z(this._readbackTexture)}};async function ro(r){const e=Te(()=>import("./mask-svg-DxA9o6hM-cNit2NTT.js"),[],import.meta.url),t=Te(()=>import("./overlay-svg-C7fxD_NX-DioSRl-7.js"),[],import.meta.url),s=Nt((await e).default,{signal:r}),i=Nt((await t).default,{signal:r}),a={mask:await s,overlay:await i};return it(r),a}class El extends lr{constructor(){super(),this._handles=new rr,this._magnifierTechnique=new to,this.updatingHandles=new cs,this.visible=!1}destroy(){this._handles=rt(this._handles),this._magnifierTechnique.shutdown(),this._resourcesTask=Mr(this._resourcesTask)}get backgroundColor(){return this._backgroundColor}set backgroundColor(e){this._backgroundColor=e,this.requestRender()}get magnifier(){return this._magnifier}set magnifier(e){this._magnifier=e,this._handles.removeAll(),this._handles.add([_e(()=>e.version,()=>{this.visible=e.visible&&e.position!=null&&e.size>0,this.requestRender()},Ke),_e(()=>[e.maskUrl,e.overlayUrl],()=>this._reloadResources()),_e(()=>e.size,()=>{this._magnifierTechnique.shutdown(),this.requestRender()})])}_createTransforms(){return{displayViewScreenMat3:Fe()}}doRender(e){if(!this._resourcesTask)return void this._reloadResources();if(e.drawPhase!==W.MAP||!this._canRender())return;const t=this._magnifier;if(t.position==null)return;this._magnifierTechnique.updateResources(e,this._mask,this._overlay,t);const s=this.backgroundColor,i=s?[s.a*s.r/255,s.a*s.g/255,s.a*s.b/255,s.a]:[1,1,1,1];this._magnifierTechnique.render(e,{background:i,maskEnabled:t.maskEnabled?1:0,overlayEnabled:t.overlayEnabled?1:0})}_canRender(){return this._mask&&this._overlay&&this._magnifier!=null}_reloadResources(){this._resourcesTask&&this._resourcesTask.abort();const e=this._magnifier!=null?this._magnifier.maskUrl:null,t=this._magnifier!=null?this._magnifier.overlayUrl:null;this._resourcesTask=Sr(async s=>{const i=e==null||t==null?ro(s):null,a=e!=null?ge(e,{responseType:"image",signal:s}).then(h=>h.data):i.then(h=>h.mask),o=t!=null?ge(t,{responseType:"image",signal:s}).then(h=>h.data):i.then(h=>h.overlay),[n,l]=await Promise.all([a,o]);this._mask=n,this._overlay=l,this._magnifierTechnique.shutdown(),this.requestRender()}),this.updatingHandles.addPromise(this._resourcesTask.promise)}}class io extends ot{constructor(){super(...arguments),this.type=at.Grid,this.shaders={grid:new Di}}render(e,t){const{context:s,painter:i}=e;i.setPipelineState(nt),i.submitDrawMesh(s,{shader:this.shaders.grid,uniforms:t,defines:null,optionalAttributes:null,useComputeBuffer:!1},i.quadMesh)}}const so=50,ao=5;function oo(r,e){return Math.log(r)/Math.log(e)}function no(r,e,t){const s=r===1?10:r;return s**(t?Math.round(oo(so/e,s)):0)}function lo(r){const{isGeographic:e,isWebMercator:t}=r;return!e&&!t}function ho(r,e,t){const s=typeof r=="number"?null:r,i=s?.spatialReference;if(i==null||!Er(i)||lo(i))return _t(i);let a=s?.x??r,o=s?.y??e;const n=1/Math.sqrt(2);let l=a+n,h=o+n;const{isWebMercator:c,isGeographic:u}=i;let d=u&&!gs(i)?ft.WGS84:i;if(c){let y=new gt({x:a,y:o,spatialReference:i});yt(y,!0,y),a=y.x,o=y.y,y=new gt({x:l,y:h,spatialReference:i}),yt(y,!0,y),l=y.x,h=y.y,d=ft.WGS84}const p=new zr({paths:[[[a,o],[l,h]]],spatialReference:d}),_=_s(p,10);let m;try{[m]=ys([_],"meters")}catch{return _t(i)}return m}const Ye=os();class zl extends lr{constructor(){super(),this._handles=new rr,this._projectedCenter=null,this._metersPerSRUnit=null,this._technique=new io,this._grid=null,this.visible=!0}destroy(){this._handles=rt(this._handles),this._technique.shutdown()}get grid(){return this._grid}set grid(e){this._grid=e,this._handles.removeAll(),this._handles.add([_e(()=>e?.center,()=>{this._projectedCenter=null},Ke),_e(()=>[e?.center,e?.dynamicScaling,e?.majorLineColor,e?.majorLineInterval,e?.minorLineColor,e?.rotateWithMap,e?.rotation,e?.spacing,e?.units],()=>this.requestRender(),Ke)])}_createTransforms(){return{displayViewScreenMat3:Fe()}}doRender(e){if(e.drawPhase!==W.MAP||this.grid==null||!this.visible)return;const{spacing:t,units:s,majorLineInterval:i,dynamicScaling:a,majorLineColor:o,minorLineColor:n}=this.grid;if(t===0||(this._updateDerivedValues(e),this._projectedCenter==null||this._metersPerSRUnit==null))return;const{scale:l,spatialReference:h}=e.state,c=Pr(t,s,"meters"),u=this._metersPerSRUnit*fs(l,h),d=c/u;if(!a&&da/255);return[e*i,t*i,s*i,i]}export{Nl as GraphicContainer,Dl as GraphicsView2D,zl as GridView2D,Al as LabelManager,El as MagnifierView2D,Il as MapViewNavigation,Rl as Stage}; diff --git a/custom-toc-highlight/assets/mat4-DX7gBViE-DVqdGrVU.js b/custom-toc-highlight/assets/mat4-DX7gBViE-6clJxb1Q.js similarity index 99% rename from custom-toc-highlight/assets/mat4-DX7gBViE-DVqdGrVU.js rename to custom-toc-highlight/assets/mat4-DX7gBViE-6clJxb1Q.js index 38bafca1..eb65948e 100644 --- a/custom-toc-highlight/assets/mat4-DX7gBViE-DVqdGrVU.js +++ b/custom-toc-highlight/assets/mat4-DX7gBViE-6clJxb1Q.js @@ -1 +1 @@ -import{dg as C}from"./story-BfX8CRfG.js";import{n as Z}from"./common-CYWrYyJl-E8-sukrT.js";function E(n,s){return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[8]=s[8],n[9]=s[9],n[10]=s[10],n[11]=s[11],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15],n}function G(n,s,e,o,M,h,u,c,f,i,b,r,l,m,p,d,x){return n[0]=s,n[1]=e,n[2]=o,n[3]=M,n[4]=h,n[5]=u,n[6]=c,n[7]=f,n[8]=i,n[9]=b,n[10]=r,n[11]=l,n[12]=m,n[13]=p,n[14]=d,n[15]=x,n}function k(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function H(n,s){if(n===s){const e=s[1],o=s[2],M=s[3],h=s[6],u=s[7],c=s[11];n[1]=s[4],n[2]=s[8],n[3]=s[12],n[4]=e,n[6]=s[9],n[7]=s[13],n[8]=o,n[9]=h,n[11]=s[14],n[12]=M,n[13]=u,n[14]=c}else n[0]=s[0],n[1]=s[4],n[2]=s[8],n[3]=s[12],n[4]=s[1],n[5]=s[5],n[6]=s[9],n[7]=s[13],n[8]=s[2],n[9]=s[6],n[10]=s[10],n[11]=s[14],n[12]=s[3],n[13]=s[7],n[14]=s[11],n[15]=s[15];return n}function J(n,s){return N(n,s)||k(n),n}function N(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=s[4],c=s[5],f=s[6],i=s[7],b=s[8],r=s[9],l=s[10],m=s[11],p=s[12],d=s[13],x=s[14],q=s[15],v=e*c-o*u,y=e*f-M*u,g=e*i-h*u,S=o*f-M*c,R=o*i-h*c,_=M*i-h*f,P=b*d-r*p,T=b*x-l*p,D=b*q-m*p,j=r*x-l*d,A=r*q-m*d,w=l*q-m*x;let I=v*w-y*A+g*j+S*D-R*T+_*P;return I?(I=1/I,n[0]=(c*w-f*A+i*j)*I,n[1]=(M*A-o*w-h*j)*I,n[2]=(d*_-x*R+q*S)*I,n[3]=(l*R-r*_-m*S)*I,n[4]=(f*D-u*w-i*T)*I,n[5]=(e*w-M*D+h*T)*I,n[6]=(x*g-p*_-q*y)*I,n[7]=(b*_-l*g+m*y)*I,n[8]=(u*A-c*D+i*P)*I,n[9]=(o*D-e*A-h*P)*I,n[10]=(p*R-d*g+q*v)*I,n[11]=(r*g-b*R-m*v)*I,n[12]=(c*T-u*j-f*P)*I,n[13]=(e*j-o*T+M*P)*I,n[14]=(d*y-p*S-x*v)*I,n[15]=(b*S-r*y+l*v)*I,n):null}function K(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=s[4],c=s[5],f=s[6],i=s[7],b=s[8],r=s[9],l=s[10],m=s[11],p=s[12],d=s[13],x=s[14],q=s[15];return n[0]=c*(l*q-m*x)-r*(f*q-i*x)+d*(f*m-i*l),n[1]=-(o*(l*q-m*x)-r*(M*q-h*x)+d*(M*m-h*l)),n[2]=o*(f*q-i*x)-c*(M*q-h*x)+d*(M*i-h*f),n[3]=-(o*(f*m-i*l)-c*(M*m-h*l)+r*(M*i-h*f)),n[4]=-(u*(l*q-m*x)-b*(f*q-i*x)+p*(f*m-i*l)),n[5]=e*(l*q-m*x)-b*(M*q-h*x)+p*(M*m-h*l),n[6]=-(e*(f*q-i*x)-u*(M*q-h*x)+p*(M*i-h*f)),n[7]=e*(f*m-i*l)-u*(M*m-h*l)+b*(M*i-h*f),n[8]=u*(r*q-m*d)-b*(c*q-i*d)+p*(c*m-i*r),n[9]=-(e*(r*q-m*d)-b*(o*q-h*d)+p*(o*m-h*r)),n[10]=e*(c*q-i*d)-u*(o*q-h*d)+p*(o*i-h*c),n[11]=-(e*(c*m-i*r)-u*(o*m-h*r)+b*(o*i-h*c)),n[12]=-(u*(r*x-l*d)-b*(c*x-f*d)+p*(c*l-f*r)),n[13]=e*(r*x-l*d)-b*(o*x-M*d)+p*(o*l-M*r),n[14]=-(e*(c*x-f*d)-u*(o*x-M*d)+p*(o*f-M*c)),n[15]=e*(c*l-f*r)-u*(o*l-M*r)+b*(o*f-M*c),n}function L(n){const s=n[0],e=n[1],o=n[2],M=n[3],h=n[4],u=n[5],c=n[6],f=n[7],i=n[8],b=n[9],r=n[10],l=n[11],m=n[12],p=n[13],d=n[14],x=n[15];return(s*u-e*h)*(r*x-l*d)-(s*c-o*h)*(b*x-l*p)+(s*f-M*h)*(b*d-r*p)+(e*c-o*u)*(i*x-l*m)-(e*f-M*u)*(i*d-r*m)+(o*f-M*c)*(i*p-b*m)}function V(n,s,e){const o=s[0],M=s[1],h=s[2],u=s[3],c=s[4],f=s[5],i=s[6],b=s[7],r=s[8],l=s[9],m=s[10],p=s[11],d=s[12],x=s[13],q=s[14],v=s[15];let y=e[0],g=e[1],S=e[2],R=e[3];return n[0]=y*o+g*c+S*r+R*d,n[1]=y*M+g*f+S*l+R*x,n[2]=y*h+g*i+S*m+R*q,n[3]=y*u+g*b+S*p+R*v,y=e[4],g=e[5],S=e[6],R=e[7],n[4]=y*o+g*c+S*r+R*d,n[5]=y*M+g*f+S*l+R*x,n[6]=y*h+g*i+S*m+R*q,n[7]=y*u+g*b+S*p+R*v,y=e[8],g=e[9],S=e[10],R=e[11],n[8]=y*o+g*c+S*r+R*d,n[9]=y*M+g*f+S*l+R*x,n[10]=y*h+g*i+S*m+R*q,n[11]=y*u+g*b+S*p+R*v,y=e[12],g=e[13],S=e[14],R=e[15],n[12]=y*o+g*c+S*r+R*d,n[13]=y*M+g*f+S*l+R*x,n[14]=y*h+g*i+S*m+R*q,n[15]=y*u+g*b+S*p+R*v,n}function U(n,s,e){const o=e[0],M=e[1],h=e[2];if(s===n)n[12]=s[0]*o+s[4]*M+s[8]*h+s[12],n[13]=s[1]*o+s[5]*M+s[9]*h+s[13],n[14]=s[2]*o+s[6]*M+s[10]*h+s[14],n[15]=s[3]*o+s[7]*M+s[11]*h+s[15];else{const u=s[0],c=s[1],f=s[2],i=s[3],b=s[4],r=s[5],l=s[6],m=s[7],p=s[8],d=s[9],x=s[10],q=s[11];n[0]=u,n[1]=c,n[2]=f,n[3]=i,n[4]=b,n[5]=r,n[6]=l,n[7]=m,n[8]=p,n[9]=d,n[10]=x,n[11]=q,n[12]=u*o+b*M+p*h+s[12],n[13]=c*o+r*M+d*h+s[13],n[14]=f*o+l*M+x*h+s[14],n[15]=i*o+m*M+q*h+s[15]}return n}function W(n,s,e){const o=e[0],M=e[1],h=e[2];return n[0]=s[0]*o,n[1]=s[1]*o,n[2]=s[2]*o,n[3]=s[3]*o,n[4]=s[4]*M,n[5]=s[5]*M,n[6]=s[6]*M,n[7]=s[7]*M,n[8]=s[8]*h,n[9]=s[9]*h,n[10]=s[10]*h,n[11]=s[11]*h,n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15],n}function $(n,s,e,o){let M=o[0],h=o[1],u=o[2],c=Math.sqrt(M*M+h*h+u*u);if(c<=Z())return void E(n,s);c=1/c,M*=c,h*=c,u*=c;const f=Math.sin(e),i=Math.cos(e),b=1-i,r=s[0],l=s[1],m=s[2],p=s[3],d=s[4],x=s[5],q=s[6],v=s[7],y=s[8],g=s[9],S=s[10],R=s[11],_=M*M*b+i,P=h*M*b+u*f,T=u*M*b-h*f,D=M*h*b-u*f,j=h*h*b+i,A=u*h*b+M*f,w=M*u*b+h*f,I=h*u*b-M*f,F=u*u*b+i;n[0]=r*_+d*P+y*T,n[1]=l*_+x*P+g*T,n[2]=m*_+q*P+S*T,n[3]=p*_+v*P+R*T,n[4]=r*D+d*j+y*A,n[5]=l*D+x*j+g*A,n[6]=m*D+q*j+S*A,n[7]=p*D+v*j+R*A,n[8]=r*w+d*I+y*F,n[9]=l*w+x*I+g*F,n[10]=m*w+q*I+S*F,n[11]=p*w+v*I+R*F,s!==n&&(n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15])}function a(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[4],u=s[5],c=s[6],f=s[7],i=s[8],b=s[9],r=s[10],l=s[11];return s!==n&&(n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[4]=h*M+i*o,n[5]=u*M+b*o,n[6]=c*M+r*o,n[7]=f*M+l*o,n[8]=i*M-h*o,n[9]=b*M-u*o,n[10]=r*M-c*o,n[11]=l*M-f*o,n}function t(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[0],u=s[1],c=s[2],f=s[3],i=s[8],b=s[9],r=s[10],l=s[11];return s!==n&&(n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[0]=h*M-i*o,n[1]=u*M-b*o,n[2]=c*M-r*o,n[3]=f*M-l*o,n[8]=h*o+i*M,n[9]=u*o+b*M,n[10]=c*o+r*M,n[11]=f*o+l*M,n}function n1(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[0],u=s[1],c=s[2],f=s[3],i=s[4],b=s[5],r=s[6],l=s[7];return s!==n&&(n[8]=s[8],n[9]=s[9],n[10]=s[10],n[11]=s[11],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[0]=h*M+i*o,n[1]=u*M+b*o,n[2]=c*M+r*o,n[3]=f*M+l*o,n[4]=i*M-h*o,n[5]=b*M-u*o,n[6]=r*M-c*o,n[7]=l*M-f*o,n}function s1(n,s){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=s[0],n[13]=s[1],n[14]=s[2],n[15]=1,n}function o1(n,s){return n[0]=s[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=s[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function e1(n,s,e){if(s===0)return k(n);let o=e[0],M=e[1],h=e[2],u=Math.sqrt(o*o+M*M+h*h);if(u<=Z())return null;u=1/u,o*=u,M*=u,h*=u;const c=Math.sin(s),f=Math.cos(s),i=1-f;return n[0]=o*o*i+f,n[1]=M*o*i+h*c,n[2]=h*o*i-M*c,n[3]=0,n[4]=o*M*i-h*c,n[5]=M*M*i+f,n[6]=h*M*i+o*c,n[7]=0,n[8]=o*h*i+M*c,n[9]=M*h*i-o*c,n[10]=h*h*i+f,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function M1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=o,n[6]=e,n[7]=0,n[8]=0,n[9]=-e,n[10]=o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function h1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=o,n[1]=0,n[2]=-e,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=e,n[9]=0,n[10]=o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function u1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=o,n[1]=e,n[2]=0,n[3]=0,n[4]=-e,n[5]=o,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Y(n,s,e){const o=s[0],M=s[1],h=s[2],u=s[3],c=o+o,f=M+M,i=h+h,b=o*c,r=o*f,l=o*i,m=M*f,p=M*i,d=h*i,x=u*c,q=u*f,v=u*i;return n[0]=1-(m+d),n[1]=r+v,n[2]=l-q,n[3]=0,n[4]=r-v,n[5]=1-(b+d),n[6]=p+x,n[7]=0,n[8]=l+q,n[9]=p-x,n[10]=1-(b+m),n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function i1(n,s){const e=c1,o=-s[0],M=-s[1],h=-s[2],u=s[3],c=s[4],f=s[5],i=s[6],b=s[7],r=o*o+M*M+h*h+u*u;return r>0?(e[0]=2*(c*u+b*o+f*h-i*M)/r,e[1]=2*(f*u+b*M+i*o-c*h)/r,e[2]=2*(i*u+b*h+c*M-f*o)/r):(e[0]=2*(c*u+b*o+f*h-i*M),e[1]=2*(f*u+b*M+i*o-c*h),e[2]=2*(i*u+b*h+c*M-f*o)),Y(n,s,e),n}const c1=C();function f1(n,s){return n[0]=s[12],n[1]=s[13],n[2]=s[14],n}function r1(n,s){const e=s[0],o=s[1],M=s[2],h=s[4],u=s[5],c=s[6],f=s[8],i=s[9],b=s[10];return n[0]=Math.sqrt(e*e+o*o+M*M),n[1]=Math.sqrt(h*h+u*u+c*c),n[2]=Math.sqrt(f*f+i*i+b*b),n}function b1(n,s){const e=s[0]+s[5]+s[10];let o=0;return e>0?(o=2*Math.sqrt(e+1),n[3]=.25*o,n[0]=(s[6]-s[9])/o,n[1]=(s[8]-s[2])/o,n[2]=(s[1]-s[4])/o):s[0]>s[5]&&s[0]>s[10]?(o=2*Math.sqrt(1+s[0]-s[5]-s[10]),n[3]=(s[6]-s[9])/o,n[0]=.25*o,n[1]=(s[1]+s[4])/o,n[2]=(s[8]+s[2])/o):s[5]>s[10]?(o=2*Math.sqrt(1+s[5]-s[0]-s[10]),n[3]=(s[8]-s[2])/o,n[0]=(s[1]+s[4])/o,n[1]=.25*o,n[2]=(s[6]+s[9])/o):(o=2*Math.sqrt(1+s[10]-s[0]-s[5]),n[3]=(s[1]-s[4])/o,n[0]=(s[8]+s[2])/o,n[1]=(s[6]+s[9])/o,n[2]=.25*o),n}function l1(n,s,e,o){const M=s[0],h=s[1],u=s[2],c=s[3],f=M+M,i=h+h,b=u+u,r=M*f,l=M*i,m=M*b,p=h*i,d=h*b,x=u*b,q=c*f,v=c*i,y=c*b,g=o[0],S=o[1],R=o[2];return n[0]=(1-(p+x))*g,n[1]=(l+y)*g,n[2]=(m-v)*g,n[3]=0,n[4]=(l-y)*S,n[5]=(1-(r+x))*S,n[6]=(d+q)*S,n[7]=0,n[8]=(m+v)*R,n[9]=(d-q)*R,n[10]=(1-(r+p))*R,n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function m1(n,s,e,o,M){const h=s[0],u=s[1],c=s[2],f=s[3],i=h+h,b=u+u,r=c+c,l=h*i,m=h*b,p=h*r,d=u*b,x=u*r,q=c*r,v=f*i,y=f*b,g=f*r,S=o[0],R=o[1],_=o[2],P=M[0],T=M[1],D=M[2],j=(1-(d+q))*S,A=(m+g)*S,w=(p-y)*S,I=(m-g)*R,F=(1-(l+q))*R,Q=(x+v)*R,X=(p+y)*_,O=(x-v)*_,z=(1-(l+d))*_;return n[0]=j,n[1]=A,n[2]=w,n[3]=0,n[4]=I,n[5]=F,n[6]=Q,n[7]=0,n[8]=X,n[9]=O,n[10]=z,n[11]=0,n[12]=e[0]+P-(j*P+I*T+X*D),n[13]=e[1]+T-(A*P+F*T+O*D),n[14]=e[2]+D-(w*P+Q*T+z*D),n[15]=1,n}function x1(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=e+e,c=o+o,f=M+M,i=e*u,b=o*u,r=o*c,l=M*u,m=M*c,p=M*f,d=h*u,x=h*c,q=h*f;return n[0]=1-r-p,n[1]=b+q,n[2]=l-x,n[3]=0,n[4]=b-q,n[5]=1-i-p,n[6]=m+d,n[7]=0,n[8]=l+x,n[9]=m-d,n[10]=1-i-r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function d1(n,s,e,o,M,h,u){const c=1/(e-s),f=1/(M-o),i=1/(h-u);return n[0]=2*h*c,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=2*h*f,n[6]=0,n[7]=0,n[8]=(e+s)*c,n[9]=(M+o)*f,n[10]=(u+h)*i,n[11]=-1,n[12]=0,n[13]=0,n[14]=u*h*2*i,n[15]=0,n}function q1(n,s,e,o,M){const h=1/Math.tan(s/2);let u;return n[0]=h/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=h,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,M!=null&&M!==1/0?(u=1/(o-M),n[10]=(M+o)*u,n[14]=2*M*o*u):(n[10]=-1,n[14]=-2*o),n}function p1(n,s,e,o){const M=Math.tan(s.upDegrees*Math.PI/180),h=Math.tan(s.downDegrees*Math.PI/180),u=Math.tan(s.leftDegrees*Math.PI/180),c=Math.tan(s.rightDegrees*Math.PI/180),f=2/(u+c),i=2/(M+h);return n[0]=f,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=i,n[6]=0,n[7]=0,n[8]=-(u-c)*f*.5,n[9]=(M-h)*i*.5,n[10]=o/(e-o),n[11]=-1,n[12]=0,n[13]=0,n[14]=o*e/(e-o),n[15]=0,n}function g1(n,s,e,o,M,h,u){const c=1/(s-e),f=1/(o-M),i=1/(h-u);return n[0]=-2*c,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*f,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*i,n[11]=0,n[12]=(s+e)*c,n[13]=(M+o)*f,n[14]=(u+h)*i,n[15]=1,n}function y1(n,s,e,o){const M=s[0],h=s[1],u=s[2];let c=M-e[0],f=h-e[1],i=u-e[2];const b=Z();if(Math.abs(c)0&&(m=1/Math.sqrt(m),b*=m,r*=m,l*=m);let p=f*l-i*r,d=i*b-c*l,x=c*r-f*b;return m=p*p+d*d+x*x,m>0&&(m=1/Math.sqrt(m),p*=m,d*=m,x*=m),n[0]=p,n[1]=d,n[2]=x,n[3]=0,n[4]=r*x-l*d,n[5]=l*p-b*x,n[6]=b*d-r*p,n[7]=0,n[8]=b,n[9]=r,n[10]=l,n[11]=0,n[12]=M,n[13]=h,n[14]=u,n[15]=1,n}function R1(n){return"mat4("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9]+", "+n[10]+", "+n[11]+", "+n[12]+", "+n[13]+", "+n[14]+", "+n[15]+")"}function v1(n){return Math.sqrt(n[0]**2+n[1]**2+n[2]**2+n[3]**2+n[4]**2+n[5]**2+n[6]**2+n[7]**2+n[8]**2+n[9]**2+n[10]**2+n[11]**2+n[12]**2+n[13]**2+n[14]**2+n[15]**2)}function I1(n,s,e){return n[0]=s[0]+e[0],n[1]=s[1]+e[1],n[2]=s[2]+e[2],n[3]=s[3]+e[3],n[4]=s[4]+e[4],n[5]=s[5]+e[5],n[6]=s[6]+e[6],n[7]=s[7]+e[7],n[8]=s[8]+e[8],n[9]=s[9]+e[9],n[10]=s[10]+e[10],n[11]=s[11]+e[11],n[12]=s[12]+e[12],n[13]=s[13]+e[13],n[14]=s[14]+e[14],n[15]=s[15]+e[15],n}function B(n,s,e){return n[0]=s[0]-e[0],n[1]=s[1]-e[1],n[2]=s[2]-e[2],n[3]=s[3]-e[3],n[4]=s[4]-e[4],n[5]=s[5]-e[5],n[6]=s[6]-e[6],n[7]=s[7]-e[7],n[8]=s[8]-e[8],n[9]=s[9]-e[9],n[10]=s[10]-e[10],n[11]=s[11]-e[11],n[12]=s[12]-e[12],n[13]=s[13]-e[13],n[14]=s[14]-e[14],n[15]=s[15]-e[15],n}function O1(n,s,e){return n[0]=s[0]*e,n[1]=s[1]*e,n[2]=s[2]*e,n[3]=s[3]*e,n[4]=s[4]*e,n[5]=s[5]*e,n[6]=s[6]*e,n[7]=s[7]*e,n[8]=s[8]*e,n[9]=s[9]*e,n[10]=s[10]*e,n[11]=s[11]*e,n[12]=s[12]*e,n[13]=s[13]*e,n[14]=s[14]*e,n[15]=s[15]*e,n}function P1(n,s,e,o){return n[0]=s[0]+e[0]*o,n[1]=s[1]+e[1]*o,n[2]=s[2]+e[2]*o,n[3]=s[3]+e[3]*o,n[4]=s[4]+e[4]*o,n[5]=s[5]+e[5]*o,n[6]=s[6]+e[6]*o,n[7]=s[7]+e[7]*o,n[8]=s[8]+e[8]*o,n[9]=s[9]+e[9]*o,n[10]=s[10]+e[10]*o,n[11]=s[11]+e[11]*o,n[12]=s[12]+e[12]*o,n[13]=s[13]+e[13]*o,n[14]=s[14]+e[14]*o,n[15]=s[15]+e[15]*o,n}function T1(n,s){return n[0]===s[0]&&n[1]===s[1]&&n[2]===s[2]&&n[3]===s[3]&&n[4]===s[4]&&n[5]===s[5]&&n[6]===s[6]&&n[7]===s[7]&&n[8]===s[8]&&n[9]===s[9]&&n[10]===s[10]&&n[11]===s[11]&&n[12]===s[12]&&n[13]===s[13]&&n[14]===s[14]&&n[15]===s[15]}function D1(n,s){if(n===s)return!0;const e=n[0],o=n[1],M=n[2],h=n[3],u=n[4],c=n[5],f=n[6],i=n[7],b=n[8],r=n[9],l=n[10],m=n[11],p=n[12],d=n[13],x=n[14],q=n[15],v=s[0],y=s[1],g=s[2],S=s[3],R=s[4],_=s[5],P=s[6],T=s[7],D=s[8],j=s[9],A=s[10],w=s[11],I=s[12],F=s[13],Q=s[14],X=s[15],O=Z();return Math.abs(e-v)<=O*Math.max(1,Math.abs(e),Math.abs(v))&&Math.abs(o-y)<=O*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(M-g)<=O*Math.max(1,Math.abs(M),Math.abs(g))&&Math.abs(h-S)<=O*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-R)<=O*Math.max(1,Math.abs(u),Math.abs(R))&&Math.abs(c-_)<=O*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(f-P)<=O*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(i-T)<=O*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(b-D)<=O*Math.max(1,Math.abs(b),Math.abs(D))&&Math.abs(r-j)<=O*Math.max(1,Math.abs(r),Math.abs(j))&&Math.abs(l-A)<=O*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(m-w)<=O*Math.max(1,Math.abs(m),Math.abs(w))&&Math.abs(p-I)<=O*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(d-F)<=O*Math.max(1,Math.abs(d),Math.abs(F))&&Math.abs(x-Q)<=O*Math.max(1,Math.abs(x),Math.abs(Q))&&Math.abs(q-X)<=O*Math.max(1,Math.abs(q),Math.abs(X))}function _1(n){const s=Z(),e=n[0],o=n[1],M=n[2],h=n[4],u=n[5],c=n[6],f=n[8],i=n[9],b=n[10];return Math.abs(1-(e*e+h*h+f*f))<=s&&Math.abs(1-(o*o+u*u+i*i))<=s&&Math.abs(1-(M*M+c*c+b*b))<=s}function j1(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[4]===0&&n[5]===1&&n[6]===0&&n[8]===0&&n[9]===0&&n[10]===1}const A1=V,w1=B;Object.freeze(Object.defineProperty({__proto__:null,add:I1,adjoint:K,copy:E,determinant:L,equals:D1,exactEquals:T1,frob:v1,fromQuat:x1,fromQuat2:i1,fromRotation:e1,fromRotationTranslation:Y,fromRotationTranslationScale:l1,fromRotationTranslationScaleOrigin:m1,fromScaling:o1,fromTranslation:s1,fromXRotation:M1,fromYRotation:h1,fromZRotation:u1,frustum:d1,getRotation:b1,getScaling:r1,getTranslation:f1,hasIdentityRotation:j1,identity:k,invert:N,invertOrIdentity:J,isOrthoNormal:_1,lookAt:y1,mul:A1,multiply:V,multiplyScalar:O1,multiplyScalarAndAdd:P1,ortho:g1,perspective:q1,perspectiveFromFieldOfView:p1,rotate:$,rotateX:a,rotateY:t,rotateZ:n1,scale:W,set:G,str:R1,sub:w1,subtract:B,targetTo:S1,translate:U,transpose:H},Symbol.toStringTag,{value:"Module"}));export{r1 as $,V as B,G as E,H as G,U as H,s1 as J,e1 as K,M1 as L,D1 as M,W as N,$ as V,f1 as W,k as Z,d1 as a,_1 as c,j1 as i,E as k,y1 as n,l1 as o,b1 as s,m1 as t,T1 as u,N as z}; +import{dg as C}from"./story-Doly9N9p.js";import{n as Z}from"./common-CYWrYyJl-E8-sukrT.js";function E(n,s){return n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[8]=s[8],n[9]=s[9],n[10]=s[10],n[11]=s[11],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15],n}function G(n,s,e,o,M,h,u,c,f,i,b,r,l,m,p,d,x){return n[0]=s,n[1]=e,n[2]=o,n[3]=M,n[4]=h,n[5]=u,n[6]=c,n[7]=f,n[8]=i,n[9]=b,n[10]=r,n[11]=l,n[12]=m,n[13]=p,n[14]=d,n[15]=x,n}function k(n){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function H(n,s){if(n===s){const e=s[1],o=s[2],M=s[3],h=s[6],u=s[7],c=s[11];n[1]=s[4],n[2]=s[8],n[3]=s[12],n[4]=e,n[6]=s[9],n[7]=s[13],n[8]=o,n[9]=h,n[11]=s[14],n[12]=M,n[13]=u,n[14]=c}else n[0]=s[0],n[1]=s[4],n[2]=s[8],n[3]=s[12],n[4]=s[1],n[5]=s[5],n[6]=s[9],n[7]=s[13],n[8]=s[2],n[9]=s[6],n[10]=s[10],n[11]=s[14],n[12]=s[3],n[13]=s[7],n[14]=s[11],n[15]=s[15];return n}function J(n,s){return N(n,s)||k(n),n}function N(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=s[4],c=s[5],f=s[6],i=s[7],b=s[8],r=s[9],l=s[10],m=s[11],p=s[12],d=s[13],x=s[14],q=s[15],v=e*c-o*u,y=e*f-M*u,g=e*i-h*u,S=o*f-M*c,R=o*i-h*c,_=M*i-h*f,P=b*d-r*p,T=b*x-l*p,D=b*q-m*p,j=r*x-l*d,A=r*q-m*d,w=l*q-m*x;let I=v*w-y*A+g*j+S*D-R*T+_*P;return I?(I=1/I,n[0]=(c*w-f*A+i*j)*I,n[1]=(M*A-o*w-h*j)*I,n[2]=(d*_-x*R+q*S)*I,n[3]=(l*R-r*_-m*S)*I,n[4]=(f*D-u*w-i*T)*I,n[5]=(e*w-M*D+h*T)*I,n[6]=(x*g-p*_-q*y)*I,n[7]=(b*_-l*g+m*y)*I,n[8]=(u*A-c*D+i*P)*I,n[9]=(o*D-e*A-h*P)*I,n[10]=(p*R-d*g+q*v)*I,n[11]=(r*g-b*R-m*v)*I,n[12]=(c*T-u*j-f*P)*I,n[13]=(e*j-o*T+M*P)*I,n[14]=(d*y-p*S-x*v)*I,n[15]=(b*S-r*y+l*v)*I,n):null}function K(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=s[4],c=s[5],f=s[6],i=s[7],b=s[8],r=s[9],l=s[10],m=s[11],p=s[12],d=s[13],x=s[14],q=s[15];return n[0]=c*(l*q-m*x)-r*(f*q-i*x)+d*(f*m-i*l),n[1]=-(o*(l*q-m*x)-r*(M*q-h*x)+d*(M*m-h*l)),n[2]=o*(f*q-i*x)-c*(M*q-h*x)+d*(M*i-h*f),n[3]=-(o*(f*m-i*l)-c*(M*m-h*l)+r*(M*i-h*f)),n[4]=-(u*(l*q-m*x)-b*(f*q-i*x)+p*(f*m-i*l)),n[5]=e*(l*q-m*x)-b*(M*q-h*x)+p*(M*m-h*l),n[6]=-(e*(f*q-i*x)-u*(M*q-h*x)+p*(M*i-h*f)),n[7]=e*(f*m-i*l)-u*(M*m-h*l)+b*(M*i-h*f),n[8]=u*(r*q-m*d)-b*(c*q-i*d)+p*(c*m-i*r),n[9]=-(e*(r*q-m*d)-b*(o*q-h*d)+p*(o*m-h*r)),n[10]=e*(c*q-i*d)-u*(o*q-h*d)+p*(o*i-h*c),n[11]=-(e*(c*m-i*r)-u*(o*m-h*r)+b*(o*i-h*c)),n[12]=-(u*(r*x-l*d)-b*(c*x-f*d)+p*(c*l-f*r)),n[13]=e*(r*x-l*d)-b*(o*x-M*d)+p*(o*l-M*r),n[14]=-(e*(c*x-f*d)-u*(o*x-M*d)+p*(o*f-M*c)),n[15]=e*(c*l-f*r)-u*(o*l-M*r)+b*(o*f-M*c),n}function L(n){const s=n[0],e=n[1],o=n[2],M=n[3],h=n[4],u=n[5],c=n[6],f=n[7],i=n[8],b=n[9],r=n[10],l=n[11],m=n[12],p=n[13],d=n[14],x=n[15];return(s*u-e*h)*(r*x-l*d)-(s*c-o*h)*(b*x-l*p)+(s*f-M*h)*(b*d-r*p)+(e*c-o*u)*(i*x-l*m)-(e*f-M*u)*(i*d-r*m)+(o*f-M*c)*(i*p-b*m)}function V(n,s,e){const o=s[0],M=s[1],h=s[2],u=s[3],c=s[4],f=s[5],i=s[6],b=s[7],r=s[8],l=s[9],m=s[10],p=s[11],d=s[12],x=s[13],q=s[14],v=s[15];let y=e[0],g=e[1],S=e[2],R=e[3];return n[0]=y*o+g*c+S*r+R*d,n[1]=y*M+g*f+S*l+R*x,n[2]=y*h+g*i+S*m+R*q,n[3]=y*u+g*b+S*p+R*v,y=e[4],g=e[5],S=e[6],R=e[7],n[4]=y*o+g*c+S*r+R*d,n[5]=y*M+g*f+S*l+R*x,n[6]=y*h+g*i+S*m+R*q,n[7]=y*u+g*b+S*p+R*v,y=e[8],g=e[9],S=e[10],R=e[11],n[8]=y*o+g*c+S*r+R*d,n[9]=y*M+g*f+S*l+R*x,n[10]=y*h+g*i+S*m+R*q,n[11]=y*u+g*b+S*p+R*v,y=e[12],g=e[13],S=e[14],R=e[15],n[12]=y*o+g*c+S*r+R*d,n[13]=y*M+g*f+S*l+R*x,n[14]=y*h+g*i+S*m+R*q,n[15]=y*u+g*b+S*p+R*v,n}function U(n,s,e){const o=e[0],M=e[1],h=e[2];if(s===n)n[12]=s[0]*o+s[4]*M+s[8]*h+s[12],n[13]=s[1]*o+s[5]*M+s[9]*h+s[13],n[14]=s[2]*o+s[6]*M+s[10]*h+s[14],n[15]=s[3]*o+s[7]*M+s[11]*h+s[15];else{const u=s[0],c=s[1],f=s[2],i=s[3],b=s[4],r=s[5],l=s[6],m=s[7],p=s[8],d=s[9],x=s[10],q=s[11];n[0]=u,n[1]=c,n[2]=f,n[3]=i,n[4]=b,n[5]=r,n[6]=l,n[7]=m,n[8]=p,n[9]=d,n[10]=x,n[11]=q,n[12]=u*o+b*M+p*h+s[12],n[13]=c*o+r*M+d*h+s[13],n[14]=f*o+l*M+x*h+s[14],n[15]=i*o+m*M+q*h+s[15]}return n}function W(n,s,e){const o=e[0],M=e[1],h=e[2];return n[0]=s[0]*o,n[1]=s[1]*o,n[2]=s[2]*o,n[3]=s[3]*o,n[4]=s[4]*M,n[5]=s[5]*M,n[6]=s[6]*M,n[7]=s[7]*M,n[8]=s[8]*h,n[9]=s[9]*h,n[10]=s[10]*h,n[11]=s[11]*h,n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15],n}function $(n,s,e,o){let M=o[0],h=o[1],u=o[2],c=Math.sqrt(M*M+h*h+u*u);if(c<=Z())return void E(n,s);c=1/c,M*=c,h*=c,u*=c;const f=Math.sin(e),i=Math.cos(e),b=1-i,r=s[0],l=s[1],m=s[2],p=s[3],d=s[4],x=s[5],q=s[6],v=s[7],y=s[8],g=s[9],S=s[10],R=s[11],_=M*M*b+i,P=h*M*b+u*f,T=u*M*b-h*f,D=M*h*b-u*f,j=h*h*b+i,A=u*h*b+M*f,w=M*u*b+h*f,I=h*u*b-M*f,F=u*u*b+i;n[0]=r*_+d*P+y*T,n[1]=l*_+x*P+g*T,n[2]=m*_+q*P+S*T,n[3]=p*_+v*P+R*T,n[4]=r*D+d*j+y*A,n[5]=l*D+x*j+g*A,n[6]=m*D+q*j+S*A,n[7]=p*D+v*j+R*A,n[8]=r*w+d*I+y*F,n[9]=l*w+x*I+g*F,n[10]=m*w+q*I+S*F,n[11]=p*w+v*I+R*F,s!==n&&(n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15])}function a(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[4],u=s[5],c=s[6],f=s[7],i=s[8],b=s[9],r=s[10],l=s[11];return s!==n&&(n[0]=s[0],n[1]=s[1],n[2]=s[2],n[3]=s[3],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[4]=h*M+i*o,n[5]=u*M+b*o,n[6]=c*M+r*o,n[7]=f*M+l*o,n[8]=i*M-h*o,n[9]=b*M-u*o,n[10]=r*M-c*o,n[11]=l*M-f*o,n}function t(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[0],u=s[1],c=s[2],f=s[3],i=s[8],b=s[9],r=s[10],l=s[11];return s!==n&&(n[4]=s[4],n[5]=s[5],n[6]=s[6],n[7]=s[7],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[0]=h*M-i*o,n[1]=u*M-b*o,n[2]=c*M-r*o,n[3]=f*M-l*o,n[8]=h*o+i*M,n[9]=u*o+b*M,n[10]=c*o+r*M,n[11]=f*o+l*M,n}function n1(n,s,e){const o=Math.sin(e),M=Math.cos(e),h=s[0],u=s[1],c=s[2],f=s[3],i=s[4],b=s[5],r=s[6],l=s[7];return s!==n&&(n[8]=s[8],n[9]=s[9],n[10]=s[10],n[11]=s[11],n[12]=s[12],n[13]=s[13],n[14]=s[14],n[15]=s[15]),n[0]=h*M+i*o,n[1]=u*M+b*o,n[2]=c*M+r*o,n[3]=f*M+l*o,n[4]=i*M-h*o,n[5]=b*M-u*o,n[6]=r*M-c*o,n[7]=l*M-f*o,n}function s1(n,s){return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=s[0],n[13]=s[1],n[14]=s[2],n[15]=1,n}function o1(n,s){return n[0]=s[0],n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=s[1],n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=s[2],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function e1(n,s,e){if(s===0)return k(n);let o=e[0],M=e[1],h=e[2],u=Math.sqrt(o*o+M*M+h*h);if(u<=Z())return null;u=1/u,o*=u,M*=u,h*=u;const c=Math.sin(s),f=Math.cos(s),i=1-f;return n[0]=o*o*i+f,n[1]=M*o*i+h*c,n[2]=h*o*i-M*c,n[3]=0,n[4]=o*M*i-h*c,n[5]=M*M*i+f,n[6]=h*M*i+o*c,n[7]=0,n[8]=o*h*i+M*c,n[9]=M*h*i-o*c,n[10]=h*h*i+f,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function M1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=o,n[6]=e,n[7]=0,n[8]=0,n[9]=-e,n[10]=o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function h1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=o,n[1]=0,n[2]=-e,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=e,n[9]=0,n[10]=o,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function u1(n,s){const e=Math.sin(s),o=Math.cos(s);return n[0]=o,n[1]=e,n[2]=0,n[3]=0,n[4]=-e,n[5]=o,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function Y(n,s,e){const o=s[0],M=s[1],h=s[2],u=s[3],c=o+o,f=M+M,i=h+h,b=o*c,r=o*f,l=o*i,m=M*f,p=M*i,d=h*i,x=u*c,q=u*f,v=u*i;return n[0]=1-(m+d),n[1]=r+v,n[2]=l-q,n[3]=0,n[4]=r-v,n[5]=1-(b+d),n[6]=p+x,n[7]=0,n[8]=l+q,n[9]=p-x,n[10]=1-(b+m),n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function i1(n,s){const e=c1,o=-s[0],M=-s[1],h=-s[2],u=s[3],c=s[4],f=s[5],i=s[6],b=s[7],r=o*o+M*M+h*h+u*u;return r>0?(e[0]=2*(c*u+b*o+f*h-i*M)/r,e[1]=2*(f*u+b*M+i*o-c*h)/r,e[2]=2*(i*u+b*h+c*M-f*o)/r):(e[0]=2*(c*u+b*o+f*h-i*M),e[1]=2*(f*u+b*M+i*o-c*h),e[2]=2*(i*u+b*h+c*M-f*o)),Y(n,s,e),n}const c1=C();function f1(n,s){return n[0]=s[12],n[1]=s[13],n[2]=s[14],n}function r1(n,s){const e=s[0],o=s[1],M=s[2],h=s[4],u=s[5],c=s[6],f=s[8],i=s[9],b=s[10];return n[0]=Math.sqrt(e*e+o*o+M*M),n[1]=Math.sqrt(h*h+u*u+c*c),n[2]=Math.sqrt(f*f+i*i+b*b),n}function b1(n,s){const e=s[0]+s[5]+s[10];let o=0;return e>0?(o=2*Math.sqrt(e+1),n[3]=.25*o,n[0]=(s[6]-s[9])/o,n[1]=(s[8]-s[2])/o,n[2]=(s[1]-s[4])/o):s[0]>s[5]&&s[0]>s[10]?(o=2*Math.sqrt(1+s[0]-s[5]-s[10]),n[3]=(s[6]-s[9])/o,n[0]=.25*o,n[1]=(s[1]+s[4])/o,n[2]=(s[8]+s[2])/o):s[5]>s[10]?(o=2*Math.sqrt(1+s[5]-s[0]-s[10]),n[3]=(s[8]-s[2])/o,n[0]=(s[1]+s[4])/o,n[1]=.25*o,n[2]=(s[6]+s[9])/o):(o=2*Math.sqrt(1+s[10]-s[0]-s[5]),n[3]=(s[1]-s[4])/o,n[0]=(s[8]+s[2])/o,n[1]=(s[6]+s[9])/o,n[2]=.25*o),n}function l1(n,s,e,o){const M=s[0],h=s[1],u=s[2],c=s[3],f=M+M,i=h+h,b=u+u,r=M*f,l=M*i,m=M*b,p=h*i,d=h*b,x=u*b,q=c*f,v=c*i,y=c*b,g=o[0],S=o[1],R=o[2];return n[0]=(1-(p+x))*g,n[1]=(l+y)*g,n[2]=(m-v)*g,n[3]=0,n[4]=(l-y)*S,n[5]=(1-(r+x))*S,n[6]=(d+q)*S,n[7]=0,n[8]=(m+v)*R,n[9]=(d-q)*R,n[10]=(1-(r+p))*R,n[11]=0,n[12]=e[0],n[13]=e[1],n[14]=e[2],n[15]=1,n}function m1(n,s,e,o,M){const h=s[0],u=s[1],c=s[2],f=s[3],i=h+h,b=u+u,r=c+c,l=h*i,m=h*b,p=h*r,d=u*b,x=u*r,q=c*r,v=f*i,y=f*b,g=f*r,S=o[0],R=o[1],_=o[2],P=M[0],T=M[1],D=M[2],j=(1-(d+q))*S,A=(m+g)*S,w=(p-y)*S,I=(m-g)*R,F=(1-(l+q))*R,Q=(x+v)*R,X=(p+y)*_,O=(x-v)*_,z=(1-(l+d))*_;return n[0]=j,n[1]=A,n[2]=w,n[3]=0,n[4]=I,n[5]=F,n[6]=Q,n[7]=0,n[8]=X,n[9]=O,n[10]=z,n[11]=0,n[12]=e[0]+P-(j*P+I*T+X*D),n[13]=e[1]+T-(A*P+F*T+O*D),n[14]=e[2]+D-(w*P+Q*T+z*D),n[15]=1,n}function x1(n,s){const e=s[0],o=s[1],M=s[2],h=s[3],u=e+e,c=o+o,f=M+M,i=e*u,b=o*u,r=o*c,l=M*u,m=M*c,p=M*f,d=h*u,x=h*c,q=h*f;return n[0]=1-r-p,n[1]=b+q,n[2]=l-x,n[3]=0,n[4]=b-q,n[5]=1-i-p,n[6]=m+d,n[7]=0,n[8]=l+x,n[9]=m-d,n[10]=1-i-r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}function d1(n,s,e,o,M,h,u){const c=1/(e-s),f=1/(M-o),i=1/(h-u);return n[0]=2*h*c,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=2*h*f,n[6]=0,n[7]=0,n[8]=(e+s)*c,n[9]=(M+o)*f,n[10]=(u+h)*i,n[11]=-1,n[12]=0,n[13]=0,n[14]=u*h*2*i,n[15]=0,n}function q1(n,s,e,o,M){const h=1/Math.tan(s/2);let u;return n[0]=h/e,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=h,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[11]=-1,n[12]=0,n[13]=0,n[15]=0,M!=null&&M!==1/0?(u=1/(o-M),n[10]=(M+o)*u,n[14]=2*M*o*u):(n[10]=-1,n[14]=-2*o),n}function p1(n,s,e,o){const M=Math.tan(s.upDegrees*Math.PI/180),h=Math.tan(s.downDegrees*Math.PI/180),u=Math.tan(s.leftDegrees*Math.PI/180),c=Math.tan(s.rightDegrees*Math.PI/180),f=2/(u+c),i=2/(M+h);return n[0]=f,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=i,n[6]=0,n[7]=0,n[8]=-(u-c)*f*.5,n[9]=(M-h)*i*.5,n[10]=o/(e-o),n[11]=-1,n[12]=0,n[13]=0,n[14]=o*e/(e-o),n[15]=0,n}function g1(n,s,e,o,M,h,u){const c=1/(s-e),f=1/(o-M),i=1/(h-u);return n[0]=-2*c,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=-2*f,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=2*i,n[11]=0,n[12]=(s+e)*c,n[13]=(M+o)*f,n[14]=(u+h)*i,n[15]=1,n}function y1(n,s,e,o){const M=s[0],h=s[1],u=s[2];let c=M-e[0],f=h-e[1],i=u-e[2];const b=Z();if(Math.abs(c)0&&(m=1/Math.sqrt(m),b*=m,r*=m,l*=m);let p=f*l-i*r,d=i*b-c*l,x=c*r-f*b;return m=p*p+d*d+x*x,m>0&&(m=1/Math.sqrt(m),p*=m,d*=m,x*=m),n[0]=p,n[1]=d,n[2]=x,n[3]=0,n[4]=r*x-l*d,n[5]=l*p-b*x,n[6]=b*d-r*p,n[7]=0,n[8]=b,n[9]=r,n[10]=l,n[11]=0,n[12]=M,n[13]=h,n[14]=u,n[15]=1,n}function R1(n){return"mat4("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+", "+n[6]+", "+n[7]+", "+n[8]+", "+n[9]+", "+n[10]+", "+n[11]+", "+n[12]+", "+n[13]+", "+n[14]+", "+n[15]+")"}function v1(n){return Math.sqrt(n[0]**2+n[1]**2+n[2]**2+n[3]**2+n[4]**2+n[5]**2+n[6]**2+n[7]**2+n[8]**2+n[9]**2+n[10]**2+n[11]**2+n[12]**2+n[13]**2+n[14]**2+n[15]**2)}function I1(n,s,e){return n[0]=s[0]+e[0],n[1]=s[1]+e[1],n[2]=s[2]+e[2],n[3]=s[3]+e[3],n[4]=s[4]+e[4],n[5]=s[5]+e[5],n[6]=s[6]+e[6],n[7]=s[7]+e[7],n[8]=s[8]+e[8],n[9]=s[9]+e[9],n[10]=s[10]+e[10],n[11]=s[11]+e[11],n[12]=s[12]+e[12],n[13]=s[13]+e[13],n[14]=s[14]+e[14],n[15]=s[15]+e[15],n}function B(n,s,e){return n[0]=s[0]-e[0],n[1]=s[1]-e[1],n[2]=s[2]-e[2],n[3]=s[3]-e[3],n[4]=s[4]-e[4],n[5]=s[5]-e[5],n[6]=s[6]-e[6],n[7]=s[7]-e[7],n[8]=s[8]-e[8],n[9]=s[9]-e[9],n[10]=s[10]-e[10],n[11]=s[11]-e[11],n[12]=s[12]-e[12],n[13]=s[13]-e[13],n[14]=s[14]-e[14],n[15]=s[15]-e[15],n}function O1(n,s,e){return n[0]=s[0]*e,n[1]=s[1]*e,n[2]=s[2]*e,n[3]=s[3]*e,n[4]=s[4]*e,n[5]=s[5]*e,n[6]=s[6]*e,n[7]=s[7]*e,n[8]=s[8]*e,n[9]=s[9]*e,n[10]=s[10]*e,n[11]=s[11]*e,n[12]=s[12]*e,n[13]=s[13]*e,n[14]=s[14]*e,n[15]=s[15]*e,n}function P1(n,s,e,o){return n[0]=s[0]+e[0]*o,n[1]=s[1]+e[1]*o,n[2]=s[2]+e[2]*o,n[3]=s[3]+e[3]*o,n[4]=s[4]+e[4]*o,n[5]=s[5]+e[5]*o,n[6]=s[6]+e[6]*o,n[7]=s[7]+e[7]*o,n[8]=s[8]+e[8]*o,n[9]=s[9]+e[9]*o,n[10]=s[10]+e[10]*o,n[11]=s[11]+e[11]*o,n[12]=s[12]+e[12]*o,n[13]=s[13]+e[13]*o,n[14]=s[14]+e[14]*o,n[15]=s[15]+e[15]*o,n}function T1(n,s){return n[0]===s[0]&&n[1]===s[1]&&n[2]===s[2]&&n[3]===s[3]&&n[4]===s[4]&&n[5]===s[5]&&n[6]===s[6]&&n[7]===s[7]&&n[8]===s[8]&&n[9]===s[9]&&n[10]===s[10]&&n[11]===s[11]&&n[12]===s[12]&&n[13]===s[13]&&n[14]===s[14]&&n[15]===s[15]}function D1(n,s){if(n===s)return!0;const e=n[0],o=n[1],M=n[2],h=n[3],u=n[4],c=n[5],f=n[6],i=n[7],b=n[8],r=n[9],l=n[10],m=n[11],p=n[12],d=n[13],x=n[14],q=n[15],v=s[0],y=s[1],g=s[2],S=s[3],R=s[4],_=s[5],P=s[6],T=s[7],D=s[8],j=s[9],A=s[10],w=s[11],I=s[12],F=s[13],Q=s[14],X=s[15],O=Z();return Math.abs(e-v)<=O*Math.max(1,Math.abs(e),Math.abs(v))&&Math.abs(o-y)<=O*Math.max(1,Math.abs(o),Math.abs(y))&&Math.abs(M-g)<=O*Math.max(1,Math.abs(M),Math.abs(g))&&Math.abs(h-S)<=O*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(u-R)<=O*Math.max(1,Math.abs(u),Math.abs(R))&&Math.abs(c-_)<=O*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(f-P)<=O*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(i-T)<=O*Math.max(1,Math.abs(i),Math.abs(T))&&Math.abs(b-D)<=O*Math.max(1,Math.abs(b),Math.abs(D))&&Math.abs(r-j)<=O*Math.max(1,Math.abs(r),Math.abs(j))&&Math.abs(l-A)<=O*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(m-w)<=O*Math.max(1,Math.abs(m),Math.abs(w))&&Math.abs(p-I)<=O*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(d-F)<=O*Math.max(1,Math.abs(d),Math.abs(F))&&Math.abs(x-Q)<=O*Math.max(1,Math.abs(x),Math.abs(Q))&&Math.abs(q-X)<=O*Math.max(1,Math.abs(q),Math.abs(X))}function _1(n){const s=Z(),e=n[0],o=n[1],M=n[2],h=n[4],u=n[5],c=n[6],f=n[8],i=n[9],b=n[10];return Math.abs(1-(e*e+h*h+f*f))<=s&&Math.abs(1-(o*o+u*u+i*i))<=s&&Math.abs(1-(M*M+c*c+b*b))<=s}function j1(n){return n[0]===1&&n[1]===0&&n[2]===0&&n[4]===0&&n[5]===1&&n[6]===0&&n[8]===0&&n[9]===0&&n[10]===1}const A1=V,w1=B;Object.freeze(Object.defineProperty({__proto__:null,add:I1,adjoint:K,copy:E,determinant:L,equals:D1,exactEquals:T1,frob:v1,fromQuat:x1,fromQuat2:i1,fromRotation:e1,fromRotationTranslation:Y,fromRotationTranslationScale:l1,fromRotationTranslationScaleOrigin:m1,fromScaling:o1,fromTranslation:s1,fromXRotation:M1,fromYRotation:h1,fromZRotation:u1,frustum:d1,getRotation:b1,getScaling:r1,getTranslation:f1,hasIdentityRotation:j1,identity:k,invert:N,invertOrIdentity:J,isOrthoNormal:_1,lookAt:y1,mul:A1,multiply:V,multiplyScalar:O1,multiplyScalarAndAdd:P1,ortho:g1,perspective:q1,perspectiveFromFieldOfView:p1,rotate:$,rotateX:a,rotateY:t,rotateZ:n1,scale:W,set:G,str:R1,sub:w1,subtract:B,targetTo:S1,translate:U,transpose:H},Symbol.toStringTag,{value:"Module"}));export{r1 as $,V as B,G as E,H as G,U as H,s1 as J,e1 as K,M1 as L,D1 as M,W as N,$ as V,f1 as W,k as Z,d1 as a,_1 as c,j1 as i,E as k,y1 as n,l1 as o,b1 as s,m1 as t,T1 as u,N as z}; diff --git a/custom-toc-highlight/assets/mediaLayerUtils-CasWezAG-eGCMpSgm.js b/custom-toc-highlight/assets/mediaLayerUtils-CasWezAG-xuUSkW-V.js similarity index 59% rename from custom-toc-highlight/assets/mediaLayerUtils-CasWezAG-eGCMpSgm.js rename to custom-toc-highlight/assets/mediaLayerUtils-CasWezAG-xuUSkW-V.js index e49372b8..e6484405 100644 --- a/custom-toc-highlight/assets/mediaLayerUtils-CasWezAG-eGCMpSgm.js +++ b/custom-toc-highlight/assets/mediaLayerUtils-CasWezAG-xuUSkW-V.js @@ -1 +1 @@ -import{C as c,D as y}from"./utils-BVWK2jiA-Btpo3M9u.js";import{i as f}from"./jsonContext-BA8GHqVk-CWQlLGSw.js";import{S as d,l as v,E as x}from"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import{T as o}from"./resourceUtils-BmW6QqlX-B1DAUGNs.js";import"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-C7IJrZYq.js";import"./saveUtils-CIYk-dsQ-VGcOewby.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-BROWZCZ1.js";const i="Media Layer",E="media-layer-save",T="media-layer-save-as",s=["media-layer:unsupported-source"];function n(e){return{isValid:e.type==="media",errorMessage:"Layer.type should be 'media'"}}function m(e){return f(e,"portal-item",!0)}function p(e){return Promise.resolve(e.layerJSON)}async function u(e,r){r.extent=e.fullExtent?await d(e.fullExtent):null}async function I(e,r){r.title||=e.title,await u(e,r),v(r,x.METADATA)}async function b(e,r){return c({layer:e,itemType:i,validateLayer:n,createJSONContext:t=>m(t),createItemData:p,errorNamePrefix:E,supplementalUnsupportedErrors:s,setItemProperties:u,saveResources:(t,a)=>o(e.resourceReferences,a)},r)}async function g(e,r,t){return y({layer:e,itemType:i,validateLayer:n,createJSONContext:a=>m(a),createItemData:p,errorNamePrefix:T,supplementalUnsupportedErrors:s,newItem:r,setItemProperties:I,saveResources:(a,l)=>o(e.resourceReferences,l)},t)}export{b as save,g as saveAs}; +import{C as c,D as y}from"./utils-BVWK2jiA-i-Dn2Ad8.js";import{i as f}from"./jsonContext-BA8GHqVk-BsXRY5es.js";import{S as d,l as v,E as x}from"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import{T as o}from"./resourceUtils-BmW6QqlX-D_AxNrCI.js";import"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";import"./originUtils-BLsWtgV9-B4sclfuf.js";import"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import"./PortalItem-CctGdnxF-CfFOGshS.js";import"./saveUtils-CIYk-dsQ-Br9QCJTX.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./uuid-Dj9mdEVg-BaKSCiyT.js";import"./resourceUtils-rTM6Iemx-GPPQBysx.js";const i="Media Layer",E="media-layer-save",T="media-layer-save-as",s=["media-layer:unsupported-source"];function n(e){return{isValid:e.type==="media",errorMessage:"Layer.type should be 'media'"}}function m(e){return f(e,"portal-item",!0)}function p(e){return Promise.resolve(e.layerJSON)}async function u(e,r){r.extent=e.fullExtent?await d(e.fullExtent):null}async function I(e,r){r.title||=e.title,await u(e,r),v(r,x.METADATA)}async function b(e,r){return c({layer:e,itemType:i,validateLayer:n,createJSONContext:t=>m(t),createItemData:p,errorNamePrefix:E,supplementalUnsupportedErrors:s,setItemProperties:u,saveResources:(t,a)=>o(e.resourceReferences,a)},r)}async function g(e,r,t){return y({layer:e,itemType:i,validateLayer:n,createJSONContext:a=>m(a),createItemData:p,errorNamePrefix:T,supplementalUnsupportedErrors:s,newItem:r,setItemProperties:I,saveResources:(a,l)=>o(e.resourceReferences,l)},t)}export{b as save,g as saveAs}; diff --git a/custom-toc-highlight/assets/meshFeatureAttributes-BwKR5odo-BBs3r8iT.js b/custom-toc-highlight/assets/meshFeatureAttributes-BwKR5odo-DaS-LG48.js similarity index 82% rename from custom-toc-highlight/assets/meshFeatureAttributes-BwKR5odo-BBs3r8iT.js rename to custom-toc-highlight/assets/meshFeatureAttributes-BwKR5odo-DaS-LG48.js index 6879d80a..d85b0af1 100644 --- a/custom-toc-highlight/assets/meshFeatureAttributes-BwKR5odo-BBs3r8iT.js +++ b/custom-toc-highlight/assets/meshFeatureAttributes-BwKR5odo-DaS-LG48.js @@ -1 +1 @@ -import{w as n}from"./story-BfX8CRfG.js";import{V as r}from"./MeshTransform-C--IG09w-DoQndDth.js";function l(t,a,i=o){return new n({x:t[i.originX],y:t[i.originY],z:t[i.originZ],spatialReference:a})}function c(t,a=o){return new r({translation:[t[a.translationX],-t[a.translationZ],t[a.translationY]],rotationAxis:[t[a.rotationX],-t[a.rotationZ],t[a.rotationY]],rotationAngle:t[a.rotationDeg],scale:[t[a.scaleX],t[a.scaleZ],t[a.scaleY]]})}const o={originX:"originX",originY:"originY",originZ:"originZ",translationX:"translationX",translationY:"translationY",translationZ:"translationZ",scaleX:"scaleX",scaleY:"scaleY",scaleZ:"scaleZ",rotationX:"rotationX",rotationY:"rotationY",rotationZ:"rotationZ",rotationDeg:"rotationDeg"};export{c as e,l as s}; +import{w as n}from"./story-Doly9N9p.js";import{V as r}from"./MeshTransform-C--IG09w-Bbqagf1g.js";function l(t,a,i=o){return new n({x:t[i.originX],y:t[i.originY],z:t[i.originZ],spatialReference:a})}function c(t,a=o){return new r({translation:[t[a.translationX],-t[a.translationZ],t[a.translationY]],rotationAxis:[t[a.rotationX],-t[a.rotationZ],t[a.rotationY]],rotationAngle:t[a.rotationDeg],scale:[t[a.scaleX],t[a.scaleZ],t[a.scaleY]]})}const o={originX:"originX",originY:"originY",originZ:"originZ",translationX:"translationX",translationY:"translationY",translationZ:"translationZ",scaleX:"scaleX",scaleY:"scaleY",scaleZ:"scaleZ",rotationX:"rotationX",rotationY:"rotationY",rotationZ:"rotationZ",rotationDeg:"rotationDeg"};export{c as e,l as s}; diff --git a/custom-toc-highlight/assets/meshFeatureSet-zeR2pNmE-C8YqWSZl.js b/custom-toc-highlight/assets/meshFeatureSet-zeR2pNmE-Cmclz5Cy.js similarity index 56% rename from custom-toc-highlight/assets/meshFeatureSet-zeR2pNmE-C8YqWSZl.js rename to custom-toc-highlight/assets/meshFeatureSet-zeR2pNmE-Cmclz5Cy.js index 6c6b4196..4f5472f7 100644 --- a/custom-toc-highlight/assets/meshFeatureSet-zeR2pNmE-C8YqWSZl.js +++ b/custom-toc-highlight/assets/meshFeatureSet-zeR2pNmE-Cmclz5Cy.js @@ -1 +1 @@ -import{J as S,bi as d,n as y,an as l,a1 as F}from"./story-BfX8CRfG.js";import{F as h}from"./Mesh-DLzjDUIO-COeC-iS-.js";import{v as N,i as g}from"./External-D_wl4XAw-P7VLSnKi.js";import{b as D}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{O as M}from"./FeatureSet-BkVNthuN-CwS44--W.js";import{s as O,e as T}from"./meshFeatureAttributes-BwKR5odo-BBs3r8iT.js";import"./main-ugzBrWNm.js";import"./MeshTransform-C--IG09w-DoQndDth.js";import"./mat4-DX7gBViE-DVqdGrVU.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BrXZAXDf.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-BjayBdwt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./imageUtils-BA2D6Uf1-DgLNtmEY.js";import"./MeshVertexAttributes-CbNpPur2-C0l0vJ9G.js";import"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";import"./meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-BuNk6xPZ.js";import"./plane-Dt8R0KeE-CVSP2GQG.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-CQcmF3ab.js";import"./projectPointToVector-B2UUY9SE-BChPjj6-.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./vertexSpaceConversion-CiKaVq_u-D2kQTb17.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import"./vec3-BazNroeq-PdcGTXFi.js";import"./BufferView-PQoE3GL7-Duht5lAO.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-BagfV9qf.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";const L=()=>F.getLogger("esri.rest.support.meshFeatureSet");function dt(t,o,r){const e=r.features;r.features=[],delete r.geometryType;const s=M.fromJSON(r);if(s.geometryType="mesh",!r.assetMaps)return s;const n=I(o,r.assetMaps),a=t.sourceSpatialReference??S.WGS84,u=r.globalIdFieldName,{outFields:i}=t,f=i!=null&&i.length>0?b(i.includes("*")?null:new Set(i)):()=>({});for(const m of e){const p=w(m,u,a,o,n);s.features.push(new d({geometry:p,attributes:f(m)}))}return s}function b(t){return({attributes:o})=>{if(!o)return{};if(!t)return o;for(const r in o)t.has(r)||delete o[r];return o}}function w(t,o,r,e,s){const n=t.attributes[o],a=s.get(n);if(a==null||!t.geometry)return null;const u=O(t.attributes,r,e.transformFieldRoles),i=y.fromJSON(t.geometry);i.spatialReference=r;const f=T(t.attributes,e.transformFieldRoles),m=r.isGeographic?"local":"georeferenced",p=v(a);return p?h.createWithExternalSource(u,p,{extent:i,transform:f,vertexSpace:m,unitConversionDisabled:!0}):h.createIncomplete(u,{extent:i,transform:f,vertexSpace:m})}var c;function I(t,o){const r=new Map;for(const e of o){const s=e.parentGlobalId;if(s==null)continue;const n=e.assetName,a=e.assetType,u=e.assetHash,i=e.assetURL,f=e.conversionStatus,m=e.seqNo,p=D(a,t.supportedFormats);if(!p){L().error("mesh-feature-set:unknown-format",`Service returned an asset of type ${a}, but it does not list it as a supported type`);continue}const E=l(r,s,()=>({files:new Map}));l(E.files,n,()=>({name:n,type:a,mimeType:p,status:P(f),parts:[]})).parts[m]={hash:u,url:i}}return r}function v(t){const o=Array.from(t.files.values()),r=new Array;for(const e of o){if(e.status!==c.COMPLETED)return null;const s=new Array;for(const n of e.parts){if(!n)return null;s.push(new N(n.url,n.hash))}r.push(new g(e.name,e.mimeType,s))}return r}function P(t){switch(t){case"COMPLETED":case"SUBMITTED":return c.COMPLETED;case"INPROGRESS":return c.PENDING;default:return c.FAILED}}(function(t){t[t.FAILED=0]="FAILED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"})(c||(c={}));export{I as assetMapFromAssetMapsJSON,w as extractMesh,dt as meshFeatureSetFromJSON}; +import{J as S,bi as d,n as y,an as l,a1 as F}from"./story-Doly9N9p.js";import{F as h}from"./Mesh-DLzjDUIO-BwXS6N6_.js";import{v as N,i as g}from"./External-D_wl4XAw-DrOy4LUr.js";import{b as D}from"./infoFor3D-DIuYZyyK-BtH19JJ7.js";import{O as M}from"./FeatureSet-BkVNthuN-DPQqwkNN.js";import{s as O,e as T}from"./meshFeatureAttributes-BwKR5odo-DaS-LG48.js";import"./main-QGPoLsvl.js";import"./MeshTransform-C--IG09w-Bbqagf1g.js";import"./mat4-DX7gBViE-6clJxb1Q.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./mat4f64-Dn1WEGBx-C99QVUMW.js";import"./quat-BODLR7mS-BQk2dgMZ.js";import"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./vec32-D9GsKZ1t-BPSFE14A.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./imageUtils-BA2D6Uf1-CYx0DlwL.js";import"./MeshVertexAttributes-CbNpPur2-c8zcl8rF.js";import"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";import"./meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js";import"./earcut-XDcq3zAf-BcwyrT7l.js";import"./Indices-DEr2HrWx-cFTwC5-9.js";import"./plane-Dt8R0KeE-Bqc6oVGz.js";import"./vec2f64-CeODonrJ-CkkJCdRC.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./deduplicate-D2d-E5Pw-CTlujluz.js";import"./projectPointToVector-B2UUY9SE-BIKNGLey.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./vertexSpaceConversion-CiKaVq_u-BlKMsg2c.js";import"./mat3-CC4Foazl-BWjyqE2v.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js";import"./vec3-BazNroeq-CRjQH4Pj.js";import"./BufferView-PQoE3GL7-B9DLdqO9.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./vec4-DWDdg1fj-BHg6FqkT.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";const L=()=>F.getLogger("esri.rest.support.meshFeatureSet");function dt(t,o,r){const e=r.features;r.features=[],delete r.geometryType;const s=M.fromJSON(r);if(s.geometryType="mesh",!r.assetMaps)return s;const n=I(o,r.assetMaps),a=t.sourceSpatialReference??S.WGS84,u=r.globalIdFieldName,{outFields:i}=t,f=i!=null&&i.length>0?b(i.includes("*")?null:new Set(i)):()=>({});for(const m of e){const p=w(m,u,a,o,n);s.features.push(new d({geometry:p,attributes:f(m)}))}return s}function b(t){return({attributes:o})=>{if(!o)return{};if(!t)return o;for(const r in o)t.has(r)||delete o[r];return o}}function w(t,o,r,e,s){const n=t.attributes[o],a=s.get(n);if(a==null||!t.geometry)return null;const u=O(t.attributes,r,e.transformFieldRoles),i=y.fromJSON(t.geometry);i.spatialReference=r;const f=T(t.attributes,e.transformFieldRoles),m=r.isGeographic?"local":"georeferenced",p=v(a);return p?h.createWithExternalSource(u,p,{extent:i,transform:f,vertexSpace:m,unitConversionDisabled:!0}):h.createIncomplete(u,{extent:i,transform:f,vertexSpace:m})}var c;function I(t,o){const r=new Map;for(const e of o){const s=e.parentGlobalId;if(s==null)continue;const n=e.assetName,a=e.assetType,u=e.assetHash,i=e.assetURL,f=e.conversionStatus,m=e.seqNo,p=D(a,t.supportedFormats);if(!p){L().error("mesh-feature-set:unknown-format",`Service returned an asset of type ${a}, but it does not list it as a supported type`);continue}const E=l(r,s,()=>({files:new Map}));l(E.files,n,()=>({name:n,type:a,mimeType:p,status:P(f),parts:[]})).parts[m]={hash:u,url:i}}return r}function v(t){const o=Array.from(t.files.values()),r=new Array;for(const e of o){if(e.status!==c.COMPLETED)return null;const s=new Array;for(const n of e.parts){if(!n)return null;s.push(new N(n.url,n.hash))}r.push(new g(e.name,e.mimeType,s))}return r}function P(t){switch(t){case"COMPLETED":case"SUBMITTED":return c.COMPLETED;case"INPROGRESS":return c.PENDING;default:return c.FAILED}}(function(t){t[t.FAILED=0]="FAILED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"})(c||(c={}));export{I as assetMapFromAssetMapsJSON,w as extractMesh,dt as meshFeatureSetFromJSON}; diff --git a/custom-toc-highlight/assets/meshSpatialReferenceScaleUtils-B1zR72Os-D-3pcUSm.js b/custom-toc-highlight/assets/meshSpatialReferenceScaleUtils-B1zR72Os-ndChBRyc.js similarity index 92% rename from custom-toc-highlight/assets/meshSpatialReferenceScaleUtils-B1zR72Os-D-3pcUSm.js rename to custom-toc-highlight/assets/meshSpatialReferenceScaleUtils-B1zR72Os-ndChBRyc.js index 902ff2d7..97bd12fa 100644 --- a/custom-toc-highlight/assets/meshSpatialReferenceScaleUtils-B1zR72Os-D-3pcUSm.js +++ b/custom-toc-highlight/assets/meshSpatialReferenceScaleUtils-B1zR72Os-ndChBRyc.js @@ -1 +1 @@ -import{o as e,p as u}from"./story-BfX8CRfG.js";import{V as p}from"./MeshTransform-C--IG09w-DoQndDth.js";const t="upload-assets",r=()=>new Error;class c extends e{constructor(){super(`${t}:unsupported`,"Layer does not support asset uploads.",r())}}let l=class extends e{constructor(){super(`${t}:no-glb-support`,"Layer does not support glb.",r())}};class i extends e{constructor(){super(`${t}:no-supported-source`,"No supported external source found",r())}}class m extends e{constructor(){super(`${t}:not-base-64`,"Expected gltf data in base64 format after conversion.",r())}}class f extends e{constructor(){super(`${t}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",r())}}class $ extends e{constructor(o,n){super(`${t}:bad-response`,`Bad response. Uploaded ${o} items and received ${n} results.`,r())}}class x extends e{constructor(o,n){super(`${t}-layer:upload-failed`,`Failed to upload mesh file ${o}. Error code: ${n?.code??"-1"}. Error message: ${n?.messages??"unknown"}`,r())}}class b extends e{constructor(o){super(`${t}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${o}, but it does not list it in its supported formats.`,r())}}class v extends e{constructor(){super(`${t}:convert3D-failed`,"convert3D failed.")}}class g extends e{constructor(){super("invalid-input:no-model","No supported model found")}}class w extends e{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}function y(s){const o=1/u(s,1);return o!==1?new p({scale:[o,o,o]}):void 0}export{b as $,g as b,i as c,l as d,x as f,y as g,f as i,m as l,$ as m,c as p,w as v,v as x}; +import{o as e,p as u}from"./story-Doly9N9p.js";import{V as p}from"./MeshTransform-C--IG09w-Bbqagf1g.js";const t="upload-assets",r=()=>new Error;class c extends e{constructor(){super(`${t}:unsupported`,"Layer does not support asset uploads.",r())}}let l=class extends e{constructor(){super(`${t}:no-glb-support`,"Layer does not support glb.",r())}};class i extends e{constructor(){super(`${t}:no-supported-source`,"No supported external source found",r())}}class m extends e{constructor(){super(`${t}:not-base-64`,"Expected gltf data in base64 format after conversion.",r())}}class f extends e{constructor(){super(`${t}:unable-to-prepare-options`,"Unable to prepare uploadAsset request options.",r())}}class $ extends e{constructor(o,n){super(`${t}:bad-response`,`Bad response. Uploaded ${o} items and received ${n} results.`,r())}}class x extends e{constructor(o,n){super(`${t}-layer:upload-failed`,`Failed to upload mesh file ${o}. Error code: ${n?.code??"-1"}. Error message: ${n?.messages??"unknown"}`,r())}}class b extends e{constructor(o){super(`${t}-layer:unsupported-format`,`The service allowed us to upload an asset of FormatID ${o}, but it does not list it in its supported formats.`,r())}}class v extends e{constructor(){super(`${t}:convert3D-failed`,"convert3D failed.")}}class g extends e{constructor(){super("invalid-input:no-model","No supported model found")}}class w extends e{constructor(){super("invalid-input:multiple-models","Multiple supported models found")}}function y(s){const o=1/u(s,1);return o!==1?new p({scale:[o,o,o]}):void 0}export{b as $,g as b,i as c,l as d,x as f,y as g,f as i,m as l,$ as m,c as p,w as v,v as x}; diff --git a/custom-toc-highlight/assets/meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js b/custom-toc-highlight/assets/meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js similarity index 82% rename from custom-toc-highlight/assets/meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js rename to custom-toc-highlight/assets/meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js index ce8809ea..d20c1ad4 100644 --- a/custom-toc-highlight/assets/meshVertexSpaceUtils-B4l_Zo0M-BycZC2QZ.js +++ b/custom-toc-highlight/assets/meshVertexSpaceUtils-B4l_Zo0M-8zfZX5Xb.js @@ -1 +1 @@ -import{w as p,hl as u,a1 as l}from"./story-BfX8CRfG.js";import{R as s}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{d as f,y as d}from"./MeshLocalVertexSpace-BqgocsoS-Dycut332.js";function c(){return l.getLogger("esri.geometry.Mesh")}function a(e){return e.origin!=null}function w(e){return a(e.vertexSpace)}function S(e,n){if(!a(e))return null;const[r,i,o]=e.origin;return new p({x:r,y:i,z:o,spatialReference:n})}function R(e,n){const{x:r,y:i,z:o,spatialReference:g}=e,t=[r,i,o??0];return n?.geographic!==void 0&&(u(c(),"option: geographic",{replacement:"Use the `vertexSpace` option instead.",version:"4.29",warnOnce:!0}),n.vertexSpace&&c().warn("Deprecated geographic flag ignored since vertexSpace option is provided.")),(n?.vertexSpace??m(n?.geographic)??h(g))==="local"?new f({origin:t}):new d({origin:t})}function h(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}function m(e){return e==null?void 0:e?"local":"georeferenced"}function z(e,n){return e.type===n.type&&(e.origin===n.origin||e.origin!=null&&n.origin!=null&&s(e.origin,n.origin))}export{z as S,w as d,S as m,a as t,R as x}; +import{w as p,hl as u,a1 as l}from"./story-Doly9N9p.js";import{R as s}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{d as f,y as d}from"./MeshLocalVertexSpace-BqgocsoS-DyrmB_Np.js";function c(){return l.getLogger("esri.geometry.Mesh")}function a(e){return e.origin!=null}function w(e){return a(e.vertexSpace)}function S(e,n){if(!a(e))return null;const[r,i,o]=e.origin;return new p({x:r,y:i,z:o,spatialReference:n})}function R(e,n){const{x:r,y:i,z:o,spatialReference:g}=e,t=[r,i,o??0];return n?.geographic!==void 0&&(u(c(),"option: geographic",{replacement:"Use the `vertexSpace` option instead.",version:"4.29",warnOnce:!0}),n.vertexSpace&&c().warn("Deprecated geographic flag ignored since vertexSpace option is provided.")),(n?.vertexSpace??m(n?.geographic)??h(g))==="local"?new f({origin:t}):new d({origin:t})}function h(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}function m(e){return e==null?void 0:e?"local":"georeferenced"}function z(e,n){return e.type===n.type&&(e.origin===n.origin||e.origin!=null&&n.origin!=null&&s(e.origin,n.origin))}export{z as S,w as d,S as m,a as t,R as x}; diff --git a/custom-toc-highlight/assets/multidimensionalUtils-BwTugeu7-BTG9Of02.js b/custom-toc-highlight/assets/multidimensionalUtils-BwTugeu7-C75LYPc9.js similarity index 99% rename from custom-toc-highlight/assets/multidimensionalUtils-BwTugeu7-BTG9Of02.js rename to custom-toc-highlight/assets/multidimensionalUtils-BwTugeu7-C75LYPc9.js index 92d240a4..8cf78d92 100644 --- a/custom-toc-highlight/assets/multidimensionalUtils-BwTugeu7-BTG9Of02.js +++ b/custom-toc-highlight/assets/multidimensionalUtils-BwTugeu7-C75LYPc9.js @@ -1 +1 @@ -import{v as d,S as v,eD as h,i as x,e as U,P as k,aq as Y}from"./story-BfX8CRfG.js";var y;let c=y=class extends U{constructor(e){super(e),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new y({variableName:this.variableName,dimensionName:this.dimensionName,values:k(this.values),isSlice:this.isSlice})}};d([v({type:String,json:{write:!0}})],c.prototype,"variableName",void 0),d([v({type:String,json:{write:!0}})],c.prototype,"dimensionName",void 0),d([v({type:h.array(h.oneOf([h.native(Number),h.array(h.native(Number))])),json:{write:!0}})],c.prototype,"values",void 0),d([v({type:Boolean,json:{write:!0}})],c.prototype,"isSlice",void 0),c=y=d([x("esri.layers.support.DimensionalDefinition")],c);const D=c;function p(e,n,i){const s=n.shift();if(i.length===0){const t=[];i.push({sliceId:-1,multidimensionalDefinition:t})}const a=i.length;for(let t=0;t{i.push({sliceId:-1,multidimensionalDefinition:[...r,{variableName:e,dimensionName:s.name,values:[l]}]})})}n.length&&p(e,n,i)}function j(e,n){const i=[];let s=0;return(n?e.variables.filter(a=>a.name.toLowerCase()===n.toLowerCase()):[...e.variables].sort((a,t)=>a.name>t.name?1:-1)).forEach(a=>{const t=[],r=[...a.dimensions].sort((l,m)=>l.name>m.name?-1:1);p(a.name,r,t),t.forEach(l=>{i.push({...l,sliceId:s++})})}),i}function L(e,n,i){let s=e;if(n&&(n=[...n].sort((a,t)=>a.dimensionName{t.length&&(s=s.filter(l=>{const m=l.multidimensionalDefinition.find(o=>o.dimensionName===a);if(m==null)return!1;const u=m.values[0];return typeof u=="number"?typeof t[0]=="number"?t.includes(u):t.some(o=>o[0]<=u&&o[1]>=u):typeof t[0]=="number"?t.some(o=>u[0]<=o&&u[1]>=o):r?t.some(o=>o[0]===u[0]&&o[0]===u[1]):t.some(o=>o[0]>=u[0]&&o[0]<=u[1]||o[1]>=u[0]&&o[1]<=u[1]||o[0]u[1])}))}),s.length&&i?.start!=null&&i.end!=null){const a=i.start.getTime(),t=i.end.getTime(),r=s[0].multidimensionalDefinition.findIndex(l=>l.dimensionName==="StdTime");r>-1&&(s=s.filter(l=>{const m=l.multidimensionalDefinition[r].values[0];return a<=m&&t>=m}))}return s.map(a=>a.sliceId)}function w(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 A(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 M(e){return e.length===1?[e[0],e[0]]:[e[0],e[e.length-1]]}function S(e,n,i){if(!n?.subsetDefinitions?.length)return e;let s;if(i){const{variables:r}=n;if(r.length&&!r.includes(i))return null;const l=n.subsetDefinitions.find(m=>m.dimensionName===e.name&&m.variableName===i);if(!l?.values?.length)return e;s=M(l.values)}else s=n.dimensions.find(({name:r})=>r===e.name)?.extent;const a=s;if(!a?.length)return e;const t=e.values.filter(r=>w(r,a));return{...e,extent:[...a],values:t}}function C(e,n,i){if(!n?.subsetDefinitions?.length)return!1;const{variables:s}=n;if(s.length&&e.some(({variableName:a})=>a&&!s.includes(a)))return!0;for(let a=0;a(t.variableName===""||l.variableName===t.variableName)&&l.dimensionName===t.dimensionName);if(r?.values.length){const l=M(r.values);if(!t.isSlice&&t.values.length===2&&!Array.isArray(t.values[0])&&t.values[0]!==t.values[1]&&i){if(!A(t.values,l))return!0}else if(t.values.some(m=>!w(m,l)))return!0}}return!1}function R(e,n){if(e==null)return{isOutside:!1};const{geometry:i,timeExtent:s,multidimensionalDefinition:a}=n;let t=null;if(s!=null&&(t=F(e,s),t==null))return{isOutside:!0};const{areaOfInterest:r}=e;if(r&&i){const l=i.type==="point"?i:i.type==="extent"?i.center:i.type==="polygon"?i.centroid:null;if(l&&!r.contains(l))return{isOutside:!0}}return a!=null&&a.length&&C(a,e,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:i,timeExtent:t,multidimensionalDefinition:a}}}function F(e,n){const i=e.dimensions.find(({name:r})=>r==="StdTime");if(i==null||n.start==null&&n.end==null)return n;n=n.clone();const{start:s,end:a}=n.toJSON(),t=s===a?[s]:s!=null&&a!=null?[s,a]:[s??a];return t.length===2&&i?.extent.length&&(t[0]=Math.max(t[0],i.extent[0]),t[1]=Math.min(t[1],i.extent[1]??i.extent[0]),t[1]t.variables.includes(o))),m?u.find(({name:o})=>o===m)??u[0]:u[0]}function z(e,n={}){const i=I(e,n);if(!i)return null;const s=[],{dimensions:a,name:t}=i;if(a.length===0)return[new D({variableName:t,dimensionName:"",values:[],isSlice:!0})];for(let r=0;r{if(n.values==null)return!0;const i=n.values.length;return i===0||i>1||!n.isSlice&&Array.isArray(n.values[0])})}function J(e,n){if(n==null||e==null)return null;let i=n.variables.map(s=>({...s}));return e?.variables?.length&&(i=i.filter(({name:s})=>e.variables.includes(s)),i.forEach(s=>{s.dimensions=s.dimensions.map(a=>S(a,e,s.name)).filter(Y)})),i}function O(e,n){const{values:i}=n;if(i?.length){const l=Array.isArray(i[0]),m=Array.isArray(e);return l!==m?-1:l&&m?i.findIndex(u=>u[0]===e[0]&&u[1]===e[1]):i.indexOf(e)}const{extent:s}=n;if(Array.isArray(e)||!s||es[1])return-1;const a=n.interval||1;if(n.unit!=="ISO8601")return Math.round((e-s[0])/a);const t=s[0];let r=-1;switch(n.intervalUnit?.toLowerCase()||"days"){case"seconds":r=Math.round((e-t)/1e3/a);break;case"minutes":r=Math.round((e-t)/6e4/a);break;case"hours":r=Math.round((e-t)/36e5/a);break;case"days":r=Math.round((e-t)/864e5/a);break;case"months":{const l=new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear(),m=new Date(t).getUTCMonth(),u=new Date(e).getUTCMonth();r=l===0?u-m:u+11-m+12*(l-1)}break;case"years":r=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/a);break;case"decades":r=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/10/a)}return r}function N(e){let n=e.values?.length;if(n)return n;const{extent:i,unit:s}=e,a=e.interval||1,t=i?i[1]-i[0]:0;if(s!=="ISO8601")return Math.round(t/a);switch(e.intervalUnit?.toLowerCase()??"seconds"){case"seconds":n=Math.round(t/1e3/a);break;case"minutes":n=Math.round(t/6e4/a);break;case"hours":n=Math.round(t/36e5/a);break;case"days":n=Math.round(t/864e5/a);break;case"months":if(i){const r=new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear(),l=new Date(i[0]).getUTCMonth(),m=new Date(i[1]).getUTCMonth();n=r===0?m-l+1:m+11-l+12*(r-1)+1}else n=0;break;case"years":n=i?Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/a):0;break;case"decades":n=i?Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/10/a):0;break;default:n=0}return n}function P(e,n){let i=0;const s=e[0].variableName,a=[...n.variables].sort((t,r)=>t.name>r.name?1:-1);for(let t=0;to.name>f.name?-1:1);if(r.name!==s){i+=l.map(o=>N(o)).reduce((o,f)=>o*f);continue}const m=l.map(o=>N(o)),u=l.length;for(let o=0;ob.dimensionName===l[o].name);if(f==null)return null;const g=O(f.values[0],l[o]);if(g===-1)return null;m.shift(),i+=o===u-1?g:g*m.reduce((b,T)=>b*T)}break}return i}export{R as E,L as I,P as J,B as R,I as T,j as Y,D as g,z as j,C as p,J as z}; +import{v as d,S as v,eD as h,i as x,e as U,P as k,aq as Y}from"./story-Doly9N9p.js";var y;let c=y=class extends U{constructor(e){super(e),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new y({variableName:this.variableName,dimensionName:this.dimensionName,values:k(this.values),isSlice:this.isSlice})}};d([v({type:String,json:{write:!0}})],c.prototype,"variableName",void 0),d([v({type:String,json:{write:!0}})],c.prototype,"dimensionName",void 0),d([v({type:h.array(h.oneOf([h.native(Number),h.array(h.native(Number))])),json:{write:!0}})],c.prototype,"values",void 0),d([v({type:Boolean,json:{write:!0}})],c.prototype,"isSlice",void 0),c=y=d([x("esri.layers.support.DimensionalDefinition")],c);const D=c;function p(e,n,i){const s=n.shift();if(i.length===0){const t=[];i.push({sliceId:-1,multidimensionalDefinition:t})}const a=i.length;for(let t=0;t{i.push({sliceId:-1,multidimensionalDefinition:[...r,{variableName:e,dimensionName:s.name,values:[l]}]})})}n.length&&p(e,n,i)}function j(e,n){const i=[];let s=0;return(n?e.variables.filter(a=>a.name.toLowerCase()===n.toLowerCase()):[...e.variables].sort((a,t)=>a.name>t.name?1:-1)).forEach(a=>{const t=[],r=[...a.dimensions].sort((l,m)=>l.name>m.name?-1:1);p(a.name,r,t),t.forEach(l=>{i.push({...l,sliceId:s++})})}),i}function L(e,n,i){let s=e;if(n&&(n=[...n].sort((a,t)=>a.dimensionName{t.length&&(s=s.filter(l=>{const m=l.multidimensionalDefinition.find(o=>o.dimensionName===a);if(m==null)return!1;const u=m.values[0];return typeof u=="number"?typeof t[0]=="number"?t.includes(u):t.some(o=>o[0]<=u&&o[1]>=u):typeof t[0]=="number"?t.some(o=>u[0]<=o&&u[1]>=o):r?t.some(o=>o[0]===u[0]&&o[0]===u[1]):t.some(o=>o[0]>=u[0]&&o[0]<=u[1]||o[1]>=u[0]&&o[1]<=u[1]||o[0]u[1])}))}),s.length&&i?.start!=null&&i.end!=null){const a=i.start.getTime(),t=i.end.getTime(),r=s[0].multidimensionalDefinition.findIndex(l=>l.dimensionName==="StdTime");r>-1&&(s=s.filter(l=>{const m=l.multidimensionalDefinition[r].values[0];return a<=m&&t>=m}))}return s.map(a=>a.sliceId)}function w(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 A(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 M(e){return e.length===1?[e[0],e[0]]:[e[0],e[e.length-1]]}function S(e,n,i){if(!n?.subsetDefinitions?.length)return e;let s;if(i){const{variables:r}=n;if(r.length&&!r.includes(i))return null;const l=n.subsetDefinitions.find(m=>m.dimensionName===e.name&&m.variableName===i);if(!l?.values?.length)return e;s=M(l.values)}else s=n.dimensions.find(({name:r})=>r===e.name)?.extent;const a=s;if(!a?.length)return e;const t=e.values.filter(r=>w(r,a));return{...e,extent:[...a],values:t}}function C(e,n,i){if(!n?.subsetDefinitions?.length)return!1;const{variables:s}=n;if(s.length&&e.some(({variableName:a})=>a&&!s.includes(a)))return!0;for(let a=0;a(t.variableName===""||l.variableName===t.variableName)&&l.dimensionName===t.dimensionName);if(r?.values.length){const l=M(r.values);if(!t.isSlice&&t.values.length===2&&!Array.isArray(t.values[0])&&t.values[0]!==t.values[1]&&i){if(!A(t.values,l))return!0}else if(t.values.some(m=>!w(m,l)))return!0}}return!1}function R(e,n){if(e==null)return{isOutside:!1};const{geometry:i,timeExtent:s,multidimensionalDefinition:a}=n;let t=null;if(s!=null&&(t=F(e,s),t==null))return{isOutside:!0};const{areaOfInterest:r}=e;if(r&&i){const l=i.type==="point"?i:i.type==="extent"?i.center:i.type==="polygon"?i.centroid:null;if(l&&!r.contains(l))return{isOutside:!0}}return a!=null&&a.length&&C(a,e,!0)?{isOutside:!0}:{isOutside:!1,intersection:{geometry:i,timeExtent:t,multidimensionalDefinition:a}}}function F(e,n){const i=e.dimensions.find(({name:r})=>r==="StdTime");if(i==null||n.start==null&&n.end==null)return n;n=n.clone();const{start:s,end:a}=n.toJSON(),t=s===a?[s]:s!=null&&a!=null?[s,a]:[s??a];return t.length===2&&i?.extent.length&&(t[0]=Math.max(t[0],i.extent[0]),t[1]=Math.min(t[1],i.extent[1]??i.extent[0]),t[1]t.variables.includes(o))),m?u.find(({name:o})=>o===m)??u[0]:u[0]}function z(e,n={}){const i=I(e,n);if(!i)return null;const s=[],{dimensions:a,name:t}=i;if(a.length===0)return[new D({variableName:t,dimensionName:"",values:[],isSlice:!0})];for(let r=0;r{if(n.values==null)return!0;const i=n.values.length;return i===0||i>1||!n.isSlice&&Array.isArray(n.values[0])})}function J(e,n){if(n==null||e==null)return null;let i=n.variables.map(s=>({...s}));return e?.variables?.length&&(i=i.filter(({name:s})=>e.variables.includes(s)),i.forEach(s=>{s.dimensions=s.dimensions.map(a=>S(a,e,s.name)).filter(Y)})),i}function O(e,n){const{values:i}=n;if(i?.length){const l=Array.isArray(i[0]),m=Array.isArray(e);return l!==m?-1:l&&m?i.findIndex(u=>u[0]===e[0]&&u[1]===e[1]):i.indexOf(e)}const{extent:s}=n;if(Array.isArray(e)||!s||es[1])return-1;const a=n.interval||1;if(n.unit!=="ISO8601")return Math.round((e-s[0])/a);const t=s[0];let r=-1;switch(n.intervalUnit?.toLowerCase()||"days"){case"seconds":r=Math.round((e-t)/1e3/a);break;case"minutes":r=Math.round((e-t)/6e4/a);break;case"hours":r=Math.round((e-t)/36e5/a);break;case"days":r=Math.round((e-t)/864e5/a);break;case"months":{const l=new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear(),m=new Date(t).getUTCMonth(),u=new Date(e).getUTCMonth();r=l===0?u-m:u+11-m+12*(l-1)}break;case"years":r=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/a);break;case"decades":r=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/10/a)}return r}function N(e){let n=e.values?.length;if(n)return n;const{extent:i,unit:s}=e,a=e.interval||1,t=i?i[1]-i[0]:0;if(s!=="ISO8601")return Math.round(t/a);switch(e.intervalUnit?.toLowerCase()??"seconds"){case"seconds":n=Math.round(t/1e3/a);break;case"minutes":n=Math.round(t/6e4/a);break;case"hours":n=Math.round(t/36e5/a);break;case"days":n=Math.round(t/864e5/a);break;case"months":if(i){const r=new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear(),l=new Date(i[0]).getUTCMonth(),m=new Date(i[1]).getUTCMonth();n=r===0?m-l+1:m+11-l+12*(r-1)+1}else n=0;break;case"years":n=i?Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/a):0;break;case"decades":n=i?Math.round((new Date(i[1]).getUTCFullYear()-new Date(i[0]).getUTCFullYear())/10/a):0;break;default:n=0}return n}function P(e,n){let i=0;const s=e[0].variableName,a=[...n.variables].sort((t,r)=>t.name>r.name?1:-1);for(let t=0;to.name>f.name?-1:1);if(r.name!==s){i+=l.map(o=>N(o)).reduce((o,f)=>o*f);continue}const m=l.map(o=>N(o)),u=l.length;for(let o=0;ob.dimensionName===l[o].name);if(f==null)return null;const g=O(f.values[0],l[o]);if(g===-1)return null;m.shift(),i+=o===u-1?g:g*m.reduce((b,T)=>b*T)}break}return i}export{R as E,L as I,P as J,B as R,I as T,j as Y,D as g,z as j,C as p,J as z}; diff --git a/custom-toc-highlight/assets/normalizeUtils-Bxmy9MNI-BT8FD-bF.js b/custom-toc-highlight/assets/normalizeUtils-Bxmy9MNI-fHOpXwKi.js similarity index 96% rename from custom-toc-highlight/assets/normalizeUtils-Bxmy9MNI-BT8FD-bF.js rename to custom-toc-highlight/assets/normalizeUtils-Bxmy9MNI-fHOpXwKi.js index ea834ae5..7be4d318 100644 --- a/custom-toc-highlight/assets/normalizeUtils-Bxmy9MNI-BT8FD-bF.js +++ b/custom-toc-highlight/assets/normalizeUtils-Bxmy9MNI-fHOpXwKi.js @@ -1 +1 @@ -import{C as _,aG as D,m as P,b7 as O,bM as X,bK as k,f as H,g as B,a as G,l as z,a1 as K,d6 as V,o as Z}from"./story-BfX8CRfG.js";import{f as L,t as A,p as R,u as U}from"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import{y as E}from"./utils-9sQxfkoa-KicvrT8N.js";import{p as Q,f as Y}from"./utils-Bq23Xwmj--_SaacS5.js";async function $(e,t,l,s){const n=E(e),i=t[0].spatialReference,r={...s,responseType:"json",query:{...n.query,f:"json",sr:X(i),target:JSON.stringify({geometryType:k(t[0]),geometries:t}),cutter:JSON.stringify(l)}},o=await H(n.path+"/cut",r),{cutIndexes:c,geometries:a=[]}=o.data;return{cutIndexes:c,geometries:a.map(u=>{const m=B(u);return m.spatialReference=i,m})}}async function ee(e,t,l){const s=typeof e=="string"?G(e):e,n=t[0].spatialReference,i=k(t[0]),r={...l,query:{...s.query,f:"json",sr:X(n),geometries:JSON.stringify(Q(t))}},{data:o}=await H(s.path+"/simplify",r);return Y(o.geometries,i,n)}const W=()=>K.getLogger("esri.geometry.support.normalizeUtils");function ne(e){return e.type==="polygon"}function te(e){return e[0].type==="polygon"}function se(e){return e[0].type==="polyline"}function C(e){const t=[];let l=0,s=0;for(let n=0;n1){for(let N=1;N<=g-1;N++){const S=N*t,f=d*S+o,h=p*S+c;i.push([f,h])}const b=(m+Math.floor(g-1)*t)/2,j=d*b+o,F=p*b+c;i.push([j,F])}i.push([a,u])}}return ne(e)?new z({rings:s,spatialReference:e.spatialReference}):new P({paths:s,spatialReference:e.spatialReference})}function J(e,t,l){if(t){const s=oe(e,1e6);e=V(s,!0)}return l&&(e=U(e,l)),e}function T(e,t,l){if(Array.isArray(e)){const s=e[0];if(s>t){const n=R(s,t);e[0]=s+n*(-2*t)}else if(st){const n=R(s,t);e=e.clone().offset(n*(-2*t),0)}else if(s{if(a[0]<180)return!0;{let u=0;for(let p=0;pu?d:u}u=Number(u.toFixed(9));const m=-360*R(u,180);for(let p=0;pT(x,o,c)),g.push(h)}else if(f.type==="extent"){const h=f.clone()._normalize(!1,!1,i);g.push(h.rings?new z(h):h)}else if(f.extent){const h=f.extent,x=R(h.xmin,c)*(2*o);let M=x===0?f.clone():U(f.clone(),x);h.offset(x,0);let{xmin:w,xmax:y}=h;w=Number(w.toFixed(9)),y=Number(y.toFixed(9)),h.intersects(u)&&y!==o?(p=y>p?y:p,M=J(M,r),d.push(M),g.push("cut")):h.intersects(m)&&w!==c?(p=y*(2*o)>p?y*(2*o):p,M=J(M,r,360),d.push(M),g.push("cut")):g.push(M)}else g.push(f.clone());else g.push(f);else g.push(f);let b=R(p,o),j=-90;const F=b,N=new P;for(;b>0;){const f=360*b-180;N.addPath([[f,j],[f,-1*j]]),j*=-1,b--}if(d.length>0&&F>0){const f=re(d,await $(s,d,N,l)),h=[],x=[];for(let y=0;y1&&I.rings.length>=v.rings.length?(h.push(I),x.push("simplify")):x.push(r?O(I):I)}}if(!h.length)return x;const M=await ee(s,h,l),w=[];for(let y=0;yi||cn)return t;switch(e.type){case"polygon":if(!(e.rings.length>1))return t;o=C(e.rings);break;case"polyline":if(!(e.paths.length>1))return t;o=C(e.paths);break;case"multipoint":o=e.points}const u=t.clone();for(let m=0;mi?o=Math.ceil(Math.abs(t-i)/r):ti?c=Math.ceil(Math.abs(e-i)/r):ei?a-=r:un)for(;e>n;)e-=i}return e}export{ie as B,oe as D,ue as a,pe as c,he as l}; +import{C as _,aG as D,m as P,b7 as O,bM as X,bK as k,f as H,g as B,a as G,l as z,a1 as K,d6 as V,o as Z}from"./story-Doly9N9p.js";import{f as L,t as A,p as R,u as U}from"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import{y as E}from"./utils-9sQxfkoa-D8FX0sO8.js";import{p as Q,f as Y}from"./utils-Bq23Xwmj-CKlS81kz.js";async function $(e,t,l,s){const n=E(e),i=t[0].spatialReference,r={...s,responseType:"json",query:{...n.query,f:"json",sr:X(i),target:JSON.stringify({geometryType:k(t[0]),geometries:t}),cutter:JSON.stringify(l)}},o=await H(n.path+"/cut",r),{cutIndexes:c,geometries:a=[]}=o.data;return{cutIndexes:c,geometries:a.map(u=>{const m=B(u);return m.spatialReference=i,m})}}async function ee(e,t,l){const s=typeof e=="string"?G(e):e,n=t[0].spatialReference,i=k(t[0]),r={...l,query:{...s.query,f:"json",sr:X(n),geometries:JSON.stringify(Q(t))}},{data:o}=await H(s.path+"/simplify",r);return Y(o.geometries,i,n)}const W=()=>K.getLogger("esri.geometry.support.normalizeUtils");function ne(e){return e.type==="polygon"}function te(e){return e[0].type==="polygon"}function se(e){return e[0].type==="polyline"}function C(e){const t=[];let l=0,s=0;for(let n=0;n1){for(let N=1;N<=g-1;N++){const S=N*t,f=d*S+o,h=p*S+c;i.push([f,h])}const b=(m+Math.floor(g-1)*t)/2,j=d*b+o,F=p*b+c;i.push([j,F])}i.push([a,u])}}return ne(e)?new z({rings:s,spatialReference:e.spatialReference}):new P({paths:s,spatialReference:e.spatialReference})}function J(e,t,l){if(t){const s=oe(e,1e6);e=V(s,!0)}return l&&(e=U(e,l)),e}function T(e,t,l){if(Array.isArray(e)){const s=e[0];if(s>t){const n=R(s,t);e[0]=s+n*(-2*t)}else if(st){const n=R(s,t);e=e.clone().offset(n*(-2*t),0)}else if(s{if(a[0]<180)return!0;{let u=0;for(let p=0;pu?d:u}u=Number(u.toFixed(9));const m=-360*R(u,180);for(let p=0;pT(x,o,c)),g.push(h)}else if(f.type==="extent"){const h=f.clone()._normalize(!1,!1,i);g.push(h.rings?new z(h):h)}else if(f.extent){const h=f.extent,x=R(h.xmin,c)*(2*o);let M=x===0?f.clone():U(f.clone(),x);h.offset(x,0);let{xmin:w,xmax:y}=h;w=Number(w.toFixed(9)),y=Number(y.toFixed(9)),h.intersects(u)&&y!==o?(p=y>p?y:p,M=J(M,r),d.push(M),g.push("cut")):h.intersects(m)&&w!==c?(p=y*(2*o)>p?y*(2*o):p,M=J(M,r,360),d.push(M),g.push("cut")):g.push(M)}else g.push(f.clone());else g.push(f);else g.push(f);let b=R(p,o),j=-90;const F=b,N=new P;for(;b>0;){const f=360*b-180;N.addPath([[f,j],[f,-1*j]]),j*=-1,b--}if(d.length>0&&F>0){const f=re(d,await $(s,d,N,l)),h=[],x=[];for(let y=0;y1&&I.rings.length>=v.rings.length?(h.push(I),x.push("simplify")):x.push(r?O(I):I)}}if(!h.length)return x;const M=await ee(s,h,l),w=[];for(let y=0;yi||cn)return t;switch(e.type){case"polygon":if(!(e.rings.length>1))return t;o=C(e.rings);break;case"polyline":if(!(e.paths.length>1))return t;o=C(e.paths);break;case"multipoint":o=e.points}const u=t.clone();for(let m=0;mi?o=Math.ceil(Math.abs(t-i)/r):ti?c=Math.ceil(Math.abs(e-i)/r):ei?a-=r:un)for(;e>n;)e-=i}return e}export{ie as B,oe as D,ue as a,pe as c,he as l}; diff --git a/custom-toc-highlight/assets/normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js b/custom-toc-highlight/assets/normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js similarity index 92% rename from custom-toc-highlight/assets/normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js rename to custom-toc-highlight/assets/normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js index 08708bc7..6def3101 100644 --- a/custom-toc-highlight/assets/normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js +++ b/custom-toc-highlight/assets/normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js @@ -1 +1 @@ -import{m as t,J as a,ca as o}from"./story-BfX8CRfG.js";const f={102100:{maxX:20037508342788905e-9,minX:-20037508342788905e-9,plus180Line:new t({paths:[[[20037508342788905e-9,-20037508342788905e-9],[20037508342788905e-9,20037508342788905e-9]]],spatialReference:a.WebMercator}),minus180Line:new t({paths:[[[-20037508342788905e-9,-20037508342788905e-9],[-20037508342788905e-9,20037508342788905e-9]]],spatialReference:a.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new t({paths:[[[180,-180],[180,180]]],spatialReference:a.WGS84}),minus180Line:new t({paths:[[[-180,-180],[-180,180]]],spatialReference:a.WGS84})}};function u(e,n){return Math.ceil((e-n)/(2*n))}function m(e,n){const r=c(e);for(const s of r)for(const i of s)i[0]+=n;return e}function c(e){return o(e)?e.rings:e.paths}export{f,u as p,c as t,m as u}; +import{m as t,J as a,ca as o}from"./story-Doly9N9p.js";const f={102100:{maxX:20037508342788905e-9,minX:-20037508342788905e-9,plus180Line:new t({paths:[[[20037508342788905e-9,-20037508342788905e-9],[20037508342788905e-9,20037508342788905e-9]]],spatialReference:a.WebMercator}),minus180Line:new t({paths:[[[-20037508342788905e-9,-20037508342788905e-9],[-20037508342788905e-9,20037508342788905e-9]]],spatialReference:a.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new t({paths:[[[180,-180],[180,180]]],spatialReference:a.WGS84}),minus180Line:new t({paths:[[[-180,-180],[-180,180]]],spatialReference:a.WGS84})}};function u(e,n){return Math.ceil((e-n)/(2*n))}function m(e,n){const r=c(e);for(const s of r)for(const i of s)i[0]+=n;return e}function c(e){return o(e)?e.rings:e.paths}export{f,u as p,c as t,m as u}; diff --git a/custom-toc-highlight/assets/normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js b/custom-toc-highlight/assets/normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js similarity index 97% rename from custom-toc-highlight/assets/normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js rename to custom-toc-highlight/assets/normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js index 5504291e..60213c14 100644 --- a/custom-toc-highlight/assets/normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js +++ b/custom-toc-highlight/assets/normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js @@ -1 +1 @@ -import{bh as H,aG as X,co as G,dd as N,c9 as W,cc as $,eQ as j,ca as z,cb as b,g_ as J,j0 as K}from"./story-BfX8CRfG.js";import{f as T,u as Q,p}from"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";function D(t){return k(t,!0)}function E(t){return k(t,!1)}function k(t,s){if(t==null)return null;const i=t.spatialReference,n=X(i),e=G(t)?t.toJSON():t;if(!n)return e;const h=N(i)?102100:4326,u=T[h].maxX,x=T[h].minX;if(W(e))return S(e,u,x);if($(e))return e.points=e.points.map(o=>S(o,u,x)),e;if(j(e))return R(e,n);if(z(e)||b(e)){const o=J(Y,e),_={xmin:o[0],ymin:o[1],xmax:o[2],ymax:o[3]},r=p(_.xmin,x)*(2*u),m=r===0?e:Q(e,r);return _.xmin+=r,_.xmax+=r,_.xmax>u?L(m,u,s):_.xminn.extent);return i.length<2?i[0]||t:i.length>2?(t.xmin=s.valid[0],t.xmax=s.valid[1],t):{rings:i.map(n=>[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]])}}function S(t,s,i){if(Array.isArray(t)){const n=t[0];if(n>s){const e=p(n,s);t[0]=n+e*(-2*s)}else if(ns){const e=p(n,s);t.x+=e*(-2*s)}else if(n0;if(x>2*_){const v={xmin:hc||A?i.push(new l({xmin:r,ymin:n,xmax:_,ymax:e},[m]),new l({xmin:o,ymin:n,xmax:c,ymax:e},[a])):i.push(new l({xmin:r,ymin:n,xmax:c,ymax:e},[m]));return i}function w(t,s){const[i,n]=s.valid,e=2*n;let h,u=0;return t>n?(h=Math.ceil(Math.abs(t-n)/e),t-=h*e,u=h):t=t.xmin&&s<=t.xmax&&i>=t.ymin&&i<=t.ymax}function L(t,s,i=!0){const n=!b(t);if(n&&K(t),i)return new Z().cut(t,s);const e=n?t.rings:t.paths,h=n?4:2,u=e.length,x=-2*s;for(let o=0;o=h){const r=[];for(const m of _)r.push([m[0]+x,m[1]]);e.push(r)}}return n?t.rings=e:t.paths=e,t}class l{constructor(s,i){this.extent=s,this.frameIds=i}}const Y=H();class Z{constructor(){this._linesIn=[],this._linesOut=[]}cut(s,i){let n;if(this._xCut=i,s.rings)this._closed=!0,n=s.rings,this._minPts=4;else{if(!s.paths)return null;this._closed=!1,n=s.paths,this._minPts=2}for(const h of n){if(!h||h.length=this._minPts&&n.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;n.push(h)}return this._closed?s.rings=n:s.paths=n,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 i=this._side(s[0]);if(i*this._prevSide==-1){const n=this._intersect(this._prevPt,s);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(s[0],s[1],i)}else this._lineTo(s[0],s[1],i);this._prevSide=i,this._prevPt=s}close(){const s=this._firstPt,i=this._prevPt;s[0]===i[0]&&s[1]===i[1]||this.lineTo(s),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(s,i,n){this._closed?(this._lineIn.push([n<=0?s:this._xCut,i]),this._lineOut.push([n>=0?s:this._xCut,i])):(n<=0&&this._lineIn.push([s,i]),n>=0&&this._lineOut.push([s,i]))}_lineTo(s,i,n){this._closed?(M(this._lineIn,n<=0?s:this._xCut,i),M(this._lineOut,n>=0?s:this._xCut,i)):n<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([s,i])):n>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([s,i])):this._prevSide<0?(this._lineIn.push([s,i]),this._lineOut.push([s,i])):this._prevSide>0&&(this._lineOut.push([s,i]),this._lineIn.push([s,i]))}_checkClosingPt(s){const i=s.length;i>3&&s[0][0]===this._xCut&&s[i-2][0]===this._xCut&&s[1][0]===this._xCut&&(s[0][1]=s[i-2][1],s.pop())}_side(s){return sthis._xCut?1:0}_intersect(s,i){const n=(this._xCut-s[0])/(i[0]-s[0]);return s[1]+n*(i[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=[]}}function M(t,s,i){const n=t.length;n>1&&t[n-1][0]===s&&t[n-2][0]===s?t[n-1][1]=i:t.push([s,i])}export{D as G,E as H}; +import{bh as H,aG as X,co as G,dd as N,c9 as W,cc as $,eQ as j,ca as z,cb as b,g_ as J,j0 as K}from"./story-Doly9N9p.js";import{f as T,u as Q,p}from"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";function D(t){return k(t,!0)}function E(t){return k(t,!1)}function k(t,s){if(t==null)return null;const i=t.spatialReference,n=X(i),e=G(t)?t.toJSON():t;if(!n)return e;const h=N(i)?102100:4326,u=T[h].maxX,x=T[h].minX;if(W(e))return S(e,u,x);if($(e))return e.points=e.points.map(o=>S(o,u,x)),e;if(j(e))return R(e,n);if(z(e)||b(e)){const o=J(Y,e),_={xmin:o[0],ymin:o[1],xmax:o[2],ymax:o[3]},r=p(_.xmin,x)*(2*u),m=r===0?e:Q(e,r);return _.xmin+=r,_.xmax+=r,_.xmax>u?L(m,u,s):_.xminn.extent);return i.length<2?i[0]||t:i.length>2?(t.xmin=s.valid[0],t.xmax=s.valid[1],t):{rings:i.map(n=>[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]])}}function S(t,s,i){if(Array.isArray(t)){const n=t[0];if(n>s){const e=p(n,s);t[0]=n+e*(-2*s)}else if(ns){const e=p(n,s);t.x+=e*(-2*s)}else if(n0;if(x>2*_){const v={xmin:hc||A?i.push(new l({xmin:r,ymin:n,xmax:_,ymax:e},[m]),new l({xmin:o,ymin:n,xmax:c,ymax:e},[a])):i.push(new l({xmin:r,ymin:n,xmax:c,ymax:e},[m]));return i}function w(t,s){const[i,n]=s.valid,e=2*n;let h,u=0;return t>n?(h=Math.ceil(Math.abs(t-n)/e),t-=h*e,u=h):t=t.xmin&&s<=t.xmax&&i>=t.ymin&&i<=t.ymax}function L(t,s,i=!0){const n=!b(t);if(n&&K(t),i)return new Z().cut(t,s);const e=n?t.rings:t.paths,h=n?4:2,u=e.length,x=-2*s;for(let o=0;o=h){const r=[];for(const m of _)r.push([m[0]+x,m[1]]);e.push(r)}}return n?t.rings=e:t.paths=e,t}class l{constructor(s,i){this.extent=s,this.frameIds=i}}const Y=H();class Z{constructor(){this._linesIn=[],this._linesOut=[]}cut(s,i){let n;if(this._xCut=i,s.rings)this._closed=!0,n=s.rings,this._minPts=4;else{if(!s.paths)return null;this._closed=!1,n=s.paths,this._minPts=2}for(const h of n){if(!h||h.length=this._minPts&&n.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;n.push(h)}return this._closed?s.rings=n:s.paths=n,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 i=this._side(s[0]);if(i*this._prevSide==-1){const n=this._intersect(this._prevPt,s);this._lineTo(this._xCut,n,0),this._prevSide=0,this._lineTo(s[0],s[1],i)}else this._lineTo(s[0],s[1],i);this._prevSide=i,this._prevPt=s}close(){const s=this._firstPt,i=this._prevPt;s[0]===i[0]&&s[1]===i[1]||this.lineTo(s),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(s,i,n){this._closed?(this._lineIn.push([n<=0?s:this._xCut,i]),this._lineOut.push([n>=0?s:this._xCut,i])):(n<=0&&this._lineIn.push([s,i]),n>=0&&this._lineOut.push([s,i]))}_lineTo(s,i,n){this._closed?(M(this._lineIn,n<=0?s:this._xCut,i),M(this._lineOut,n>=0?s:this._xCut,i)):n<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([s,i])):n>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([s,i])):this._prevSide<0?(this._lineIn.push([s,i]),this._lineOut.push([s,i])):this._prevSide>0&&(this._lineOut.push([s,i]),this._lineIn.push([s,i]))}_checkClosingPt(s){const i=s.length;i>3&&s[0][0]===this._xCut&&s[i-2][0]===this._xCut&&s[1][0]===this._xCut&&(s[0][1]=s[i-2][1],s.pop())}_side(s){return sthis._xCut?1:0}_intersect(s,i){const n=(this._xCut-s[0])/(i[0]-s[0]);return s[1]+n*(i[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=[]}}function M(t,s,i){const n=t.length;n>1&&t[n-1][0]===s&&t[n-2][0]===s?t[n-1][1]=i:t.push([s,i])}export{D as G,E as H}; diff --git a/custom-toc-highlight/assets/number-eRKYXfX9-eI8aiR_7.js b/custom-toc-highlight/assets/number-eRKYXfX9-bCdnHRN-.js similarity index 98% rename from custom-toc-highlight/assets/number-eRKYXfX9-eI8aiR_7.js rename to custom-toc-highlight/assets/number-eRKYXfX9-bCdnHRN-.js index ca87310a..d820ae40 100644 --- a/custom-toc-highlight/assets/number-eRKYXfX9-eI8aiR_7.js +++ b/custom-toc-highlight/assets/number-eRKYXfX9-bCdnHRN-.js @@ -1 +1 @@ -import{h as N,c6 as S}from"./story-BfX8CRfG.js";const h={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function b(e=N()){let n=(e=e.toLowerCase())in h;if(!n){const s=e.split("-");s.length>1&&s[0]in h&&(e=s[0],n=!0),n||(e="en")}const[t,r,l="#,##0.###"]=h[e];return{decimal:t,group:r,pattern:l}}function M(e,n){const t=b((n={...n}).locale);n.customs=t;const r=n.pattern||t.pattern;return isNaN(e)||Math.abs(e)===1/0?null:E(e,r,n)}const w=/[#0,]*[#0](?:\.0*#*)?/;function E(e,n,t){const r=(t=t||{}).customs.group,l=t.customs.decimal,s=n.split(";"),a=s[0];if((n=s[e<0?1:0]||"-"+a).includes("%"))e*=100;else if(n.includes("‰"))e*=1e3;else{if(n.includes("¤"))throw new Error("currency notation not supported");if(n.includes("E"))throw new Error("exponential notation not supported")}const d=w,f=a.match(d);if(!f)throw new Error("unable to find a number expression in pattern: "+n);return t.fractional===!1&&(t.places=0),n.replace(d,z(e,f[0],{decimal:l,group:r,places:t.places,round:t.round}))}function z(e,n,t){(t=t||{}).places===!0&&(t.places=0),t.places===1/0&&(t.places=6);const r=n.split("."),l=typeof t.places=="string"&&t.places.indexOf(",");let s=t.places;l?s=t.places.slice(l+1):+s>=0||(s=(r[1]||[]).length),t.round<0||(e=Number(e.toFixed(Number(s))));const a=String(Math.abs(e)).split("."),d=a[1]||"";if(r[1]||t.places){l&&(t.places=t.places.slice(0,Math.max(0,l)));const o=t.places!==void 0?t.places:r[1]&&r[1].lastIndexOf("0")+1;+o>d.length&&(a[1]=d.padEnd(Number(o),"0")),+sa[0].length&&(a[0]=a[0].padStart(i,"0")),f.includes("#")||(a[0]=a[0].slice(-i)));let p,c,u=r[0].lastIndexOf(",");if(u!==-1){p=r[0].length-u-1;const o=r[0].slice(0,u);u=o.lastIndexOf(","),u!==-1&&(c=o.length-u-1)}const m=[];for(let o=a[0];o;){const x=o.length-p;m.push(x>0?o.slice(Math.max(0,x)):o),o=x>0?o.slice(0,x):"",c&&(p=c,c=void 0)}return a[0]=m.reverse().join(t.group||","),a.join(t.decimal||".")}function v(e){const n=b((e=e||{}).locale),t=e.pattern||n.pattern,r=n.group,l=n.decimal;let s=1;if(t.includes("%"))s/=100;else if(t.includes("‰"))s/=1e3;else if(t.includes("¤"))throw new Error("currency notation not supported");const a=t.split(";");return a.length===1&&a.push("-"+a[0]),{regexp:g(a,d=>(d="(?:"+S(d,".")+")").replace(w,f=>{const i={signed:!1,separator:e.strict?r:[r,""],fractional:e.fractional,decimal:l,exponent:!1},p=f.split(".");let c=e.places;p.length===1&&s!==1&&(p[1]="###"),p.length===1||c===0?i.fractional=!1:(c===void 0&&(c=e.pattern?p[1].lastIndexOf("0")+1:1/0),c&&e.fractional==null&&(i.fractional=!0),!e.places&&+c1&&(i.groupSize=u.pop().length,u.length>1&&(i.groupSize2=u.pop().length)),"("+y(i)+")"}),!0).replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:l,factor:s}}function j(e,n){const t=v(n),r=new RegExp("^"+t.regexp+"$").exec(e);if(!r)return NaN;let l=r[1];if(!r[1]){if(!r[2])return NaN;l=r[2],t.factor*=-1}return l=l.replaceAll(new RegExp("["+t.group+"\\s\\xa0]","g"),"").replace(t.decimal,"."),Number(l)*t.factor}function y(e){"places"in(e=e||{})||(e.places=1/0),typeof e.decimal!="string"&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const n=A(e),t=g(e.fractional,l=>{let s="";return l&&e.places!==0&&(s="\\"+e.decimal,e.places===1/0?s="(?:"+s+"\\d+)?":s+="\\d{"+e.places+"}"),s},!0);let r=n+t;return t&&(r="(?:(?:"+r+")|(?:"+t+"))"),r+g(e.exponent,l=>l?"([eE]"+A({signed:e.eSigned})+")":"")}function A(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",g(e.signed,n=>n?"[-+]":"",!0)+g(e.separator,n=>{if(!n)return"(?:\\d+)";(n=S(n))===" "?n="\\s":n===" "&&(n="\\s\\xa0");const t=e.groupSize,r=e.groupSize2;if(r){const l="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+n+"]\\d{"+r+"})*["+n+"]\\d{"+t+"})";return t-r>0?"(?:"+l+"|(?:0|[1-9]\\d{0,"+(t-1)+"}))":l}return"(?:0|[1-9]\\d{0,"+(t-1)+"}(?:["+n+"]\\d{"+t+"})*)"},!0)}const g=(e,n,t)=>{if(!Array.isArray(e))return n(e);const r=[];for(let l=0;l"("+(n?"?:":"")+e+")";export{j as M,v as N,M as z}; +import{h as N,c6 as S}from"./story-Doly9N9p.js";const h={ar:[".",","],bg:[","," "],bs:[",","."],ca:[",","."],cs:[","," "],da:[",","."],de:[",","."],"de-ch":[".","’"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[","," "],fi:[","," "],fr:[","," "],"fr-ch":[","," "],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[","," "],id:[",","."],it:[",","."],"it-ch":[".","’"],ja:[".",","],ko:[".",","],lt:[","," "],lv:[","," "],mk:[",","."],nb:[","," "],nl:[",","."],pl:[","," "],pt:[",","."],"pt-pt":[","," "],ro:[",","."],ru:[","," "],sk:[","," "],sl:[",","."],sr:[",","."],sv:[","," "],th:[".",","],tr:[",","."],uk:[","," "],vi:[",","."],zh:[".",","]};function b(e=N()){let n=(e=e.toLowerCase())in h;if(!n){const s=e.split("-");s.length>1&&s[0]in h&&(e=s[0],n=!0),n||(e="en")}const[t,r,l="#,##0.###"]=h[e];return{decimal:t,group:r,pattern:l}}function M(e,n){const t=b((n={...n}).locale);n.customs=t;const r=n.pattern||t.pattern;return isNaN(e)||Math.abs(e)===1/0?null:E(e,r,n)}const w=/[#0,]*[#0](?:\.0*#*)?/;function E(e,n,t){const r=(t=t||{}).customs.group,l=t.customs.decimal,s=n.split(";"),a=s[0];if((n=s[e<0?1:0]||"-"+a).includes("%"))e*=100;else if(n.includes("‰"))e*=1e3;else{if(n.includes("¤"))throw new Error("currency notation not supported");if(n.includes("E"))throw new Error("exponential notation not supported")}const d=w,f=a.match(d);if(!f)throw new Error("unable to find a number expression in pattern: "+n);return t.fractional===!1&&(t.places=0),n.replace(d,z(e,f[0],{decimal:l,group:r,places:t.places,round:t.round}))}function z(e,n,t){(t=t||{}).places===!0&&(t.places=0),t.places===1/0&&(t.places=6);const r=n.split("."),l=typeof t.places=="string"&&t.places.indexOf(",");let s=t.places;l?s=t.places.slice(l+1):+s>=0||(s=(r[1]||[]).length),t.round<0||(e=Number(e.toFixed(Number(s))));const a=String(Math.abs(e)).split("."),d=a[1]||"";if(r[1]||t.places){l&&(t.places=t.places.slice(0,Math.max(0,l)));const o=t.places!==void 0?t.places:r[1]&&r[1].lastIndexOf("0")+1;+o>d.length&&(a[1]=d.padEnd(Number(o),"0")),+sa[0].length&&(a[0]=a[0].padStart(i,"0")),f.includes("#")||(a[0]=a[0].slice(-i)));let p,c,u=r[0].lastIndexOf(",");if(u!==-1){p=r[0].length-u-1;const o=r[0].slice(0,u);u=o.lastIndexOf(","),u!==-1&&(c=o.length-u-1)}const m=[];for(let o=a[0];o;){const x=o.length-p;m.push(x>0?o.slice(Math.max(0,x)):o),o=x>0?o.slice(0,x):"",c&&(p=c,c=void 0)}return a[0]=m.reverse().join(t.group||","),a.join(t.decimal||".")}function v(e){const n=b((e=e||{}).locale),t=e.pattern||n.pattern,r=n.group,l=n.decimal;let s=1;if(t.includes("%"))s/=100;else if(t.includes("‰"))s/=1e3;else if(t.includes("¤"))throw new Error("currency notation not supported");const a=t.split(";");return a.length===1&&a.push("-"+a[0]),{regexp:g(a,d=>(d="(?:"+S(d,".")+")").replace(w,f=>{const i={signed:!1,separator:e.strict?r:[r,""],fractional:e.fractional,decimal:l,exponent:!1},p=f.split(".");let c=e.places;p.length===1&&s!==1&&(p[1]="###"),p.length===1||c===0?i.fractional=!1:(c===void 0&&(c=e.pattern?p[1].lastIndexOf("0")+1:1/0),c&&e.fractional==null&&(i.fractional=!0),!e.places&&+c1&&(i.groupSize=u.pop().length,u.length>1&&(i.groupSize2=u.pop().length)),"("+y(i)+")"}),!0).replaceAll(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:l,factor:s}}function j(e,n){const t=v(n),r=new RegExp("^"+t.regexp+"$").exec(e);if(!r)return NaN;let l=r[1];if(!r[1]){if(!r[2])return NaN;l=r[2],t.factor*=-1}return l=l.replaceAll(new RegExp("["+t.group+"\\s\\xa0]","g"),"").replace(t.decimal,"."),Number(l)*t.factor}function y(e){"places"in(e=e||{})||(e.places=1/0),typeof e.decimal!="string"&&(e.decimal="."),"fractional"in e&&!String(e.places).startsWith("0")||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const n=A(e),t=g(e.fractional,l=>{let s="";return l&&e.places!==0&&(s="\\"+e.decimal,e.places===1/0?s="(?:"+s+"\\d+)?":s+="\\d{"+e.places+"}"),s},!0);let r=n+t;return t&&(r="(?:(?:"+r+")|(?:"+t+"))"),r+g(e.exponent,l=>l?"([eE]"+A({signed:e.eSigned})+")":"")}function A(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",g(e.signed,n=>n?"[-+]":"",!0)+g(e.separator,n=>{if(!n)return"(?:\\d+)";(n=S(n))===" "?n="\\s":n===" "&&(n="\\s\\xa0");const t=e.groupSize,r=e.groupSize2;if(r){const l="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+n+"]\\d{"+r+"})*["+n+"]\\d{"+t+"})";return t-r>0?"(?:"+l+"|(?:0|[1-9]\\d{0,"+(t-1)+"}))":l}return"(?:0|[1-9]\\d{0,"+(t-1)+"}(?:["+n+"]\\d{"+t+"})*)"},!0)}const g=(e,n,t)=>{if(!Array.isArray(e))return n(e);const r=[];for(let l=0;l"("+(n?"?:":"")+e+")";export{j as M,v as N,M as z}; diff --git a/custom-toc-highlight/assets/objectResourceUtils-CelAKRU2-D0g6fjBV.js b/custom-toc-highlight/assets/objectResourceUtils-CelAKRU2-CPIFq_KQ.js similarity index 88% rename from custom-toc-highlight/assets/objectResourceUtils-CelAKRU2-D0g6fjBV.js rename to custom-toc-highlight/assets/objectResourceUtils-CelAKRU2-CPIFq_KQ.js index cc5c0ea2..3ecf88c8 100644 --- a/custom-toc-highlight/assets/objectResourceUtils-CelAKRU2-D0g6fjBV.js +++ b/custom-toc-highlight/assets/objectResourceUtils-CelAKRU2-CPIFq_KQ.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loader-CkLCe-E_-QWQrU9Z8.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./mat4f64-Dn1WEGBx-C99QVUMW.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Version-CoKzbupV-9-gg6ENz.js","./mat4-DX7gBViE-DVqdGrVU.js","./common-CYWrYyJl-E8-sukrT.js","./quat-BODLR7mS-BrXZAXDf.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-BjayBdwt.js","./vec42-D8CJyqHG-DnfLTeQH.js","./BufferView-PQoE3GL7-Duht5lAO.js","./vec2-tHZ6OaOy-xCj1obDt.js","./resourceUtils-Ds65naCv-jCWWLIQy.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js"])))=>i.map(i=>d[i]); -import{_ as Mt}from"./main-ugzBrWNm.js";import{m as _t}from"./devEnvironmentUtils-CxrVv3RG-CX5aoxVE.js";import{is as dt,it as W,hf as st,k3 as Ot,b6 as ft,f as Rt,W as pt,o as Bt,il as it,dg as U,a1 as Pt,hB as Ct}from"./story-BfX8CRfG.js";import{U as Et,P as St,E as ot}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as gt,o as J}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{z as Lt}from"./mat4-DX7gBViE-DVqdGrVU.js";import{t as Nt,u as nt,o as Ft}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{l as Ut}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{Y as tt,r as Gt,x as at,b as $t,l as kt,X as qt,_ as L,j as C,L as N,B as jt}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{ab as Dt,ac as Ht,g as X,ad as Vt,a3 as zt,aa as H,s as Wt,ae as V,a9 as Xt,a4 as Qt,p as xt}from"./AttributeArray-BWXEft_i-ZluJi335.js";import{X as Kt,L as bt,C as Zt,l as yt,g as Jt,M as Yt}from"./BufferView-PQoE3GL7-Duht5lAO.js";import{b as te,z as ee,O as ut,j as lt}from"./vec3-BazNroeq-PdcGTXFi.js";import{L as re,P as ct}from"./vec4-DWDdg1fj-BagfV9qf.js";import{U as se,k as $,E as ie,c as oe,y as ne,d as ae}from"./DefaultMaterial_COLOR_GAMMA-D0o2czi9-9voYmtHA.js";import{f as Y}from"./resourceUtils-Ds65naCv-jCWWLIQy.js";import{f as ue,l as le}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{s as ce}from"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import{m as wt}from"./Version-CoKzbupV-9-gg6ENz.js";import{w as me,A as vt}from"./Indices-DEr2HrWx-BuNk6xPZ.js";import{r as he}from"./requestImageUtils-Ut4YcoNU-BtID-_Ic.js";import{M as q}from"./orientedBoundingBox-oHezdpWm-BCiifXla.js";import{N as O,s as de,e as et,u as fe}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{_ as pe}from"./triangle-hqU-Tc1X-DLjOhwz3.js";import{h as ge}from"./Util-BjGjeg6f-08Szkf4F.js";import{T}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{G as mt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{t as ht}from"./NormalAttribute.glsl-axtNsUxo-CtBQgPZb.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Texture-BCt2hphT-hC4XzHg_.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./InterleavedLayout-DXzw3B2n-iCEii9j9.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./compilerUtils-CV1QYWI8-C9dYdAV0.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./boundedPlane-DlvE0eNx-dpkNyaGh.js";import"./sphere-BenPORjV-DaZ5Vv8x.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./plane-Dt8R0KeE-CVSP2GQG.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./lineSegment-CcqvCARM-CF4YE8GC.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import"./lengthUtils-DKpMe5qR-C2NPRwwl.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./quat-BODLR7mS-BrXZAXDf.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";function xe(i,t){if(!i)return!1;const{size:e,data:r,indices:l}=i;L(t,0,0,0),L(v,0,0,0);let u=0,o=0;for(let a=0;a1&&N(t,t,1/o),o>0}function ye(i,t,e){if(!i)return!1;L(e,0,0,0),L(v,0,0,0);let r=0,l=0;const{size:u,data:o,indices:a}=i,c=a.length-1,s=c+(t?2:0);for(let n=0;n0?(C(e,e,N(g,g,h)),r+=h):r===0&&(C(v,v,g),l++)}return r!==0?(N(e,e,1/r),!0):l!==0&&(N(e,v,1/l),!0)}const g=U(),E=U(),z=U(),v=U();class we{constructor(){this.uid=Ct()}}class ve extends we{constructor(t){super(),this.highlightGroupName=t,this.channel=fe.Highlight}}class Q extends Wt{constructor(t,e,r=null,l=V.Mesh,u=null,o=-1){super(),this.material=t,this.mapPositions=r,this.type=l,this.objectAndLayerIdColor=u,this.edgeIndicesLength=o,this.highlights=new Set,this._highlightGroupCounts=new Map,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[a,c]of e)this._attributes.set(a,{...c,indices:me(c.indices)}),a===T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(a).indices.length:this.edgeIndicesLength)}instantiate(t={}){const e=new Q(t.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((r,l)=>{r.exclusive=!1,e._attributes.set(l,r)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}get attributes(){return this._attributes}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:Xt(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const r=this._attributes.get(t);r&&this._attributes.set(t,{...r,exclusive:!0,data:e})}get indexCount(){return this._attributes.values().next().value.indices?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo==null&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(t){return!!(this.type===V.Mesh?this._computeAttachmentOriginTriangles(t):this.type===V.Line?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(this._transformation!=null&&tt(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){const e=this.attributes.get(T.POSITION);return xe(e,t)}_computeAttachmentOriginLines(t){const e=this.attributes.get(T.POSITION);return ye(e,Te(this.material.parameters,e),t)}_computeAttachmentOriginPoints(t){const e=this.attributes.get(T.POSITION);return be(e,t)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const t=this.attributes.get(T.POSITION);if(!t||t.indices.length===0)return null;const e=this.type===V.Mesh?3:1;ge(t.indices.length%e==0,"Indexing error: "+t.indices.length+" not divisible by "+e);const r=vt(t.indices.length/e);return new Qt(r,e,t)}get transformation(){return this._transformation??nt}set transformation(t){this._transformation=t&&t!==nt?Ft(t):null}get highlightGroups(){return this._highlightGroupCounts}get hasHighlights(){return this._highlightGroupCounts.size>0}foreachHighlightGroup(t){this._highlightGroupCounts.forEach((e,r)=>t(r))}allocateIdAndHighlight(t){const e=new ve(t);return this.addHighlight(e)}addHighlight(t){this.highlights.add(t);const{highlightGroupName:e}=t,r=(this._highlightGroupCounts.get(e)??0)+1;return this._highlightGroupCounts.set(e,r),t}removeHighlight(t){if(this.highlights.delete(t)){const{highlightGroupName:e}=t,r=this._highlightGroupCounts.get(e)??0;r<=1?this._highlightGroupCounts.delete(e):this._highlightGroupCounts.set(e,r-1)}}}function Te(i,t){return!(!("isClosed"in i)||!i.isClosed)&&t.indices.length>2}function j(i){if(i==null)return null;const t=i.offset!=null?i.offset:ue,e=i.rotation!=null?i.rotation:0,r=i.scale!=null?i.scale:le,l=J(1,0,0,0,1,0,t[0],t[1],1),u=J(Math.cos(e),-Math.sin(e),0,Math.sin(e),Math.cos(e),0,0,0,1),o=J(r[0],0,0,0,r[1],0,0,0,1),a=gt();return ot(a,u,o),ot(a,l,a),a}class Ie{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class Ae{constructor(t,e,r){this.name=t,this.lodThreshold=e,this.pivotOffset=r,this.stageResources=new Ie,this.numberOfVertices=0}}const P=()=>Pt.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");async function Me(i,t){const e=await _e(i,t),r=await Ce(e.textureDefinitions??{},t);let l=0;for(const u in r)if(r.hasOwnProperty(u)){const o=r[u];l+=o?.image?o.image.width*o.image.height*4:0}return{resource:e,textures:r,size:l+Ot(e)}}async function _e(i,t){const e=t?.streamDataRequester;if(e)return Oe(i,e,t);const r=await ft(Rt(i,t));if(r.ok===!0)return r.value.data;pt(r.error),Tt(r.error)}async function Oe(i,t,e){const r=await ft(t.request(i,"json",e));if(r.ok===!0)return r.value;pt(r.error),Tt(r.error.details.url)}function Tt(i){throw new Bt("",`Request for object resource failed: ${i}`)}function Re(i){const t=i.params,e=t.topology;let r=!0;switch(t.vertexAttributes||(P().warn("Geometry must specify vertex attributes"),r=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const u=t.faces;if(u){if(t.vertexAttributes)for(const o in t.vertexAttributes){const a=u[o];a?.values?(a.valueType!=null&&a.valueType!=="UInt32"&&(P().warn(`Unsupported indexed geometry indices type '${a.valueType}', only UInt32 is currently supported`),r=!1),a.valuesPerElement!=null&&a.valuesPerElement!==1&&(P().warn(`Unsupported indexed geometry values per element '${a.valuesPerElement}', only 1 is currently supported`),r=!1)):(P().warn(`Indexed geometry does not specify face indices for '${o}' attribute`),r=!1)}}else P().warn("Indexed geometries must specify faces"),r=!1;break}default:P().warn(`Unsupported topology '${e}'`),r=!1}i.params.material||(P().warn("Geometry requires material"),r=!1);const l=i.params.vertexAttributes;for(const u in l)l[u].values||(P().warn("Geometries with externally defined attributes are not yet supported"),r=!1);return r}function Be(i,t){const e=new Array,r=new Array,l=new Array,u=new ce,o=i.resource,a=wt.parse(o.version||"1.0","wosr");Se.validate(a);const c=o.model.name,s=o.model.geometries,n=o.materialDefinitions??{},m=i.textures;let d=0;const f=new Map;for(let h=0;h{if(p.params.topology==="PerAttributeArray")return null;const _=p.params.faces;for(const B in _)if(B===x)return _[B].values;return null},G=I[T.POSITION],D=G.values.length/G.valuesPerElement;for(const x in I){const _=I[x],B=_.values,Z=A(x)??vt(D);M.push([x,new q(B,Z,_.valuesPerElement,!0)])}const R=b.texture,y=m&&m[R];if(y&&!f.has(R)){const{image:x,parameters:_}=y,B=new xt(x,_);r.push(B),f.set(R,B)}const F=f.get(R),K=F?F.id:void 0,S=b.material;let w=u.get(S,R);if(w==null){const x=n[S.slice(S.lastIndexOf("/")+1)].params;x.transparency===1&&(x.transparency=0);const _=y&&y.alphaChannelUsage,B=x.transparency>0||_==="transparency"||_==="maskAndTransparency",Z=y?It(y.alphaChannelUsage):void 0,rt={ambient:it(x.diffuse),diffuse:it(x.diffuse),opacity:1-(x.transparency||0),transparent:B,textureAlphaMode:Z,textureAlphaCutoff:.33,textureId:K,initTextureTransparent:!0,doubleSided:!0,cullFace:et.None,colorMixMode:x.externalColorMixMode||"tint",textureAlphaPremultiplied:y?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(rt,t.materialParameters),w=new X(rt,t),u.set(S,R,w)}l.push(w);const At=new Q(w,M);d+=M.find(x=>x[0]===T.POSITION)?.[1]?.indices.length??0,e.push(At)}return{engineResources:[{name:c,stageResources:{textures:r,materials:l,geometries:e},pivotOffset:o.model.pivotOffset,numberOfVertices:d,lodThreshold:null}],referenceBoundingBox:Pe(e)}}function Pe(i){const t=dt();return i.forEach(e=>{const r=e.boundingInfo;r!=null&&(W(t,r.bbMin),W(t,r.bbMax))}),t}async function Ce(i,t){const e=new Array;for(const u in i){const o=i[u],a=o.images[0].data;if(!a){P().warn("Externally referenced texture data is not yet supported");continue}const c=o.encoding+";base64,"+a,s="/textureDefinitions/"+u,n=o.channels==="rgba"?o.alphaChannelUsage||"transparency":"none",m={noUnpackFlip:!0,wrap:{s:mt.REPEAT,t:mt.REPEAT},preMultiplyAlpha:It(n)!==O.Opaque},d=t?.disableTextures?Promise.resolve(null):he(c,t);e.push(d.then(f=>({refId:s,image:f,parameters:m,alphaChannelUsage:n})))}const r=await Promise.all(e),l={};for(const u of r)l[u.refId]=u;return l}function It(i){switch(i){case"mask":return O.Mask;case"maskAndTransparency":return O.MaskBlend;case"none":return O.Opaque;default:return O.Blend}}function Ee(i){const t=i.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Se=new wt(1,2,"wosr");async function Ur(i,t){const e=Le(_t(i));if(e.fileType==="wosr"){const m=await(t.cache?t.cache.loadWOSR(e.url,t):Me(e.url,t)),{engineResources:d,referenceBoundingBox:f}=Be(m,t);return{lods:d,referenceBoundingBox:f,isEsriSymbolResource:!1,isWosr:!0}}let r;if(t.cache)r=await t.cache.loadGLTF(e.url,t,!!t.usePBR);else{const{loadGLTF:m}=await Mt(()=>import("./loader-CkLCe-E_-QWQrU9Z8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);r=await m(new se(t.streamDataRequester),e.url,t,t.usePBR)}const l=r.model.meta?.ESRI_proxyEllipsoid,u=r.meta.isEsriSymbolResource&&l!=null&&r.meta.ESRI_webstyle==="EsriRealisticTreesStyle";u&&!r.customMeta.esriTreeRendering&&(r.customMeta.esriTreeRendering=!0,$e(r,l));const o=!!t.usePBR,a=r.meta.isEsriSymbolResource?{usePBR:o,isSchematic:!1,treeRendering:u,mrrFactors:Dt}:{usePBR:o,isSchematic:!1,treeRendering:!1,mrrFactors:Ht},c={...t.materialParameters,treeRendering:u},{engineResources:s,referenceBoundingBox:n}=Ne(r,a,c,t,e.specifiedLodIndex);return{lods:s,referenceBoundingBox:n,isEsriSymbolResource:r.meta.isEsriSymbolResource,isWosr:!1}}function Le(i){const t=i.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:t[4]!=null?Number(t[4]):null}:i.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:i,specifiedLodIndex:null}:{fileType:"unknown",url:i,specifiedLodIndex:null}}function Ne(i,t,e,r,l){const u=i.model,o=new Array,a=new Map,c=new Map,s=u.lods.length,n=dt();return u.lods.forEach((m,d)=>{const f=r.skipHighLods===!0&&(s>1&&d===0||s>3&&d===1)||r.skipHighLods===!1&&l!=null&&d!==l;if(f&&d!==0)return;const h=new Ae(m.name,m.lodThreshold,[0,0,0]);m.parts.forEach(p=>{const b=f?new X({},r):Fe(u,p,h,t,e,a,c,r),{geometry:I,vertexCount:M}=Ue(p,b??new X({},r)),A=I.boundingInfo;A!=null&&d===0&&(W(n,A.bbMin),W(n,A.bbMax)),b!=null&&(h.stageResources.geometries.push(I),h.numberOfVertices+=M)}),f||o.push(h)}),{engineResources:o,referenceBoundingBox:n}}function Fe(i,t,e,r,l,u,o,a){const c=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),s=i.materials.get(t.material),n=t.attributes.texCoord0!=null,m=t.attributes.normal!=null;if(s==null)return null;const d=Ge(s.alphaMode);if(!u.has(c)){if(n){const y=(F,K=!1)=>{if(F!=null&&!o.has(F)){const S=i.textures.get(F);if(S!=null){const w=S.data;o.set(F,new xt(Y(w)?w.data:w,{...S.parameters,preMultiplyAlpha:!Y(w)&&K,encoding:Y(w)&&w.encoding!=null?w.encoding:void 0}))}}};y(s.textureColor,d!==O.Opaque),y(s.textureNormal),y(s.textureOcclusion),y(s.textureEmissive),y(s.textureMetallicRoughness)}const h=s.color[0]**(1/$),p=s.color[1]**(1/$),b=s.color[2]**(1/$),I=s.emissiveFactor[0]**(1/$),M=s.emissiveFactor[1]**(1/$),A=s.emissiveFactor[2]**(1/$),G=s.textureColor!=null&&n?o.get(s.textureColor):null,D=Vt({normalTexture:s.textureNormal,metallicRoughnessTexture:s.textureMetallicRoughness,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,emissiveTexture:s.textureEmissive,emissiveFactor:s.emissiveFactor,occlusionTexture:s.textureOcclusion}),R=s.normalTextureTransform?.scale!=null?s.normalTextureTransform?.scale:Ut;u.set(c,new X({...r,transparent:d===O.Blend,customDepthTest:de.Lequal,textureAlphaMode:d,textureAlphaCutoff:s.alphaCutoff,diffuse:[h,p,b],ambient:[h,p,b],opacity:s.opacity,doubleSided:s.doubleSided,doubleSidedType:"winding-order",cullFace:s.doubleSided?et.None:et.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?ht.Attribute:ht.ScreenDerivative,castShadows:!0,receiveShadows:s.receiveShadows,receiveAmbientOcclusion:s.receiveAmbientOcclustion,textureId:G?.id,colorMixMode:s.colorMixMode,normalTextureId:s.textureNormal!=null&&n?o.get(s.textureNormal).id:void 0,textureAlphaPremultiplied:G!=null&&!!G.parameters.preMultiplyAlpha,occlusionTextureId:s.textureOcclusion!=null&&n?o.get(s.textureOcclusion).id:void 0,emissiveTextureId:s.textureEmissive!=null&&n?o.get(s.textureEmissive).id:void 0,metallicRoughnessTextureId:s.textureMetallicRoughness!=null&&n?o.get(s.textureMetallicRoughness).id:void 0,emissiveFactor:[I,M,A],mrrFactors:D?zt:[s.metallicFactor,s.roughnessFactor,r.mrrFactors[2]],isSchematic:D,colorTextureTransformMatrix:j(s.colorTextureTransform),normalTextureTransformMatrix:j(s.normalTextureTransform),scale:[R[0],R[1]],occlusionTextureTransformMatrix:j(s.occlusionTextureTransform),emissiveTextureTransformMatrix:j(s.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:j(s.metallicRoughnessTextureTransform),...l},a))}const f=u.get(c);if(e.stageResources.materials.push(f),n){const h=p=>{p!=null&&e.stageResources.textures.push(o.get(p))};h(s.textureColor),h(s.textureNormal),h(s.textureOcclusion),h(s.textureEmissive),h(s.textureMetallicRoughness)}return f}function Ue(i,t){const e=i.attributes.position.count,r=ie(i.indices||e,i.primitiveType),l=H(3*e),{typedBuffer:u,typedBufferStride:o}=i.attributes.position;te(l,u,i.transform,3,o);const a=[[T.POSITION,new q(l,r,3,!0)]];if(i.attributes.normal!=null){const s=H(3*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.normal;Et(k,i.transform),ee(s,n,k,3,m),st(k)&&ut(s,s),a.push([T.NORMAL,new q(s,r,3,!0)])}if(i.attributes.tangent!=null){const s=H(4*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.tangent;St(k,i.transform),re(s,n,k,4,m),st(k)&&ut(s,s,4),a.push([T.TANGENT,new q(s,r,4,!0)])}if(i.attributes.texCoord0!=null){const s=H(2*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.texCoord0;oe(s,n,2,m),a.push([T.UV0,new q(s,r,2,!0)])}const c=i.attributes.color;if(c!=null){const s=new Uint8Array(4*e);c.elementCount===4?c instanceof Kt?ct(s,c,255):c instanceof bt?ne(s,c):c instanceof Zt&&ct(s,c,1/256):(s.fill(255),c instanceof yt?lt(s,c.typedBuffer,255,4,c.typedBufferStride):i.attributes.color instanceof Jt?ae(s,c.typedBuffer,4,i.attributes.color.typedBufferStride):i.attributes.color instanceof Yt&<(s,c.typedBuffer,1/256,4,c.typedBufferStride)),a.push([T.COLOR,new q(s,r,4,!0)])}return{geometry:new Q(t,a),vertexCount:e}}const k=gt();function Ge(i){switch(i){case"BLEND":return O.Blend;case"MASK":return O.Mask;case"OPAQUE":case null:case void 0:return O.Opaque}}function $e(i,t){for(let e=0;e1&&qt(n,n,c,I>-1?.2:Math.min(-4*I-3.8,1)),d[h]=n[0],d[h+1]=n[1],d[h+2]=n[2],h+=3,m[p]=255*A,m[p+1]=255*A,m[p+2]=255*A,m[p+3]=255,p+=4}l.attributes.normal=new yt(d),l.attributes.color=new bt(m)}}}export{Ur as fetch,Le as parseUrl}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./loader-CkLCe-E_-BkhKaKBj.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./mat4f64-Dn1WEGBx-C99QVUMW.js","./enums-DBi1-Mm2-CUS1pvQe.js","./Version-CoKzbupV-BDyz4v43.js","./mat4-DX7gBViE-6clJxb1Q.js","./common-CYWrYyJl-E8-sukrT.js","./quat-BODLR7mS-BQk2dgMZ.js","./mat3f64-Dh9_zhFu-BIT-k8Dm.js","./quatf64-C16JxGFv-BKWK1F8U.js","./vec32-D9GsKZ1t-BPSFE14A.js","./vec42-D8CJyqHG-DnfLTeQH.js","./BufferView-PQoE3GL7-B9DLdqO9.js","./vec2-tHZ6OaOy-xCj1obDt.js","./resourceUtils-Ds65naCv-PY5SfRMU.js","./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js"])))=>i.map(i=>d[i]); +import{_ as Mt}from"./main-QGPoLsvl.js";import{m as _t}from"./devEnvironmentUtils-CxrVv3RG-CX5aoxVE.js";import{is as dt,it as W,hf as st,k3 as Ot,b6 as ft,f as Rt,W as pt,o as Bt,il as it,dg as U,a1 as Pt,hB as Ct}from"./story-Doly9N9p.js";import{U as Et,P as St,E as ot}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as gt,o as J}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{z as Lt}from"./mat4-DX7gBViE-6clJxb1Q.js";import{t as Nt,u as nt,o as Ft}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{l as Ut}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{Y as tt,r as Gt,x as at,b as $t,l as kt,X as qt,_ as L,j as C,L as N,B as jt}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{ab as Dt,ac as Ht,g as X,ad as Vt,a3 as zt,aa as H,s as Wt,ae as V,a9 as Xt,a4 as Qt,p as xt}from"./AttributeArray-BWXEft_i-lURl2Jp5.js";import{X as Kt,L as bt,C as Zt,l as yt,g as Jt,M as Yt}from"./BufferView-PQoE3GL7-B9DLdqO9.js";import{b as te,z as ee,O as ut,j as lt}from"./vec3-BazNroeq-CRjQH4Pj.js";import{L as re,P as ct}from"./vec4-DWDdg1fj-BHg6FqkT.js";import{U as se,k as $,E as ie,c as oe,y as ne,d as ae}from"./DefaultMaterial_COLOR_GAMMA-D0o2czi9-k4xDAsKM.js";import{f as Y}from"./resourceUtils-Ds65naCv-PY5SfRMU.js";import{f as ue,l as le}from"./vec2f32-CVhmN3Me-DxoqVD7C.js";import{s as ce}from"./NestedMap-Ddo7BfvO-BpVPk8mz.js";import{m as wt}from"./Version-CoKzbupV-BDyz4v43.js";import{w as me,A as vt}from"./Indices-DEr2HrWx-cFTwC5-9.js";import{r as he}from"./requestImageUtils-Ut4YcoNU-CZnNufeN.js";import{M as q}from"./orientedBoundingBox-oHezdpWm-ilptOsP0.js";import{N as O,s as de,e as et,u as fe}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";import{_ as pe}from"./triangle-hqU-Tc1X-CaBFJROi.js";import{h as ge}from"./Util-BjGjeg6f-08Szkf4F.js";import{T}from"./VertexAttribute-DqD5S0a2-3q90nikV.js";import{G as mt}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{t as ht}from"./NormalAttribute.glsl-axtNsUxo-AnJqZKLx.js";import"./common-CYWrYyJl-E8-sukrT.js";import"./Texture-BCt2hphT-Dk2JyWCy.js";import"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import"./InterleavedLayout-DXzw3B2n-BlOPeZMB.js";import"./types-ChhhI6OU-Cxh6dPlX.js";import"./compilerUtils-CV1QYWI8-VdY86_Y-.js";import"./interfaces-DN2-jsJC-DzMTiT5R.js";import"./BindType-9iOk18Ed-CRW1cdX4.js";import"./AlphaCutoff-ZPx1GqOi-UcccL64p.js";import"./boundedPlane-DlvE0eNx-BQ9Xop25.js";import"./sphere-BenPORjV-B4uz1SYF.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import"./plane-Dt8R0KeE-Bqc6oVGz.js";import"./quatf64-C16JxGFv-BKWK1F8U.js";import"./lineSegment-CcqvCARM-CDEWcAzV.js";import"./renderState-Dap0WV9P-D4IHxyei.js";import"./doublePrecisionUtils-BJbYwoii-kIP-tL_t.js";import"./lengthUtils-DKpMe5qR-CsqJSDh_.js";import"./vec2-tHZ6OaOy-xCj1obDt.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./quat-BODLR7mS-BQk2dgMZ.js";import"./spatialReferenceEllipsoidUtils-DUrKTvup-Dp2A9xKW.js";import"./computeTranslationToOriginAndRotation-wF0y9WQG-CNvG_ff4.js";function xe(i,t){if(!i)return!1;const{size:e,data:r,indices:l}=i;L(t,0,0,0),L(v,0,0,0);let u=0,o=0;for(let a=0;a1&&N(t,t,1/o),o>0}function ye(i,t,e){if(!i)return!1;L(e,0,0,0),L(v,0,0,0);let r=0,l=0;const{size:u,data:o,indices:a}=i,c=a.length-1,s=c+(t?2:0);for(let n=0;n0?(C(e,e,N(g,g,h)),r+=h):r===0&&(C(v,v,g),l++)}return r!==0?(N(e,e,1/r),!0):l!==0&&(N(e,v,1/l),!0)}const g=U(),E=U(),z=U(),v=U();class we{constructor(){this.uid=Ct()}}class ve extends we{constructor(t){super(),this.highlightGroupName=t,this.channel=fe.Highlight}}class Q extends Wt{constructor(t,e,r=null,l=V.Mesh,u=null,o=-1){super(),this.material=t,this.mapPositions=r,this.type=l,this.objectAndLayerIdColor=u,this.edgeIndicesLength=o,this.highlights=new Set,this._highlightGroupCounts=new Map,this.visible=!0,this._attributes=new Map,this._boundingInfo=null;for(const[a,c]of e)this._attributes.set(a,{...c,indices:me(c.indices)}),a===T.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._attributes.get(a).indices.length:this.edgeIndicesLength)}instantiate(t={}){const e=new Q(t.material||this.material,[],this.mapPositions,this.type,this.objectAndLayerIdColor,this.edgeIndicesLength);return this._attributes.forEach((r,l)=>{r.exclusive=!1,e._attributes.set(l,r)}),e._boundingInfo=this._boundingInfo,e.transformation=t.transformation||this.transformation,e}get attributes(){return this._attributes}getMutableAttribute(t){let e=this._attributes.get(t);return e&&!e.exclusive&&(e={...e,exclusive:!0,data:Xt(e.data)},this._attributes.set(t,e)),e}setAttributeData(t,e){const r=this._attributes.get(t);r&&this._attributes.set(t,{...r,exclusive:!0,data:e})}get indexCount(){return this._attributes.values().next().value.indices?.length??0}get faceCount(){return this.indexCount/3}get boundingInfo(){return this._boundingInfo==null&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(t){return!!(this.type===V.Mesh?this._computeAttachmentOriginTriangles(t):this.type===V.Line?this._computeAttachmentOriginLines(t):this._computeAttachmentOriginPoints(t))&&(this._transformation!=null&&tt(t,t,this._transformation),!0)}_computeAttachmentOriginTriangles(t){const e=this.attributes.get(T.POSITION);return xe(e,t)}_computeAttachmentOriginLines(t){const e=this.attributes.get(T.POSITION);return ye(e,Te(this.material.parameters,e),t)}_computeAttachmentOriginPoints(t){const e=this.attributes.get(T.POSITION);return be(e,t)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const t=this.attributes.get(T.POSITION);if(!t||t.indices.length===0)return null;const e=this.type===V.Mesh?3:1;ge(t.indices.length%e==0,"Indexing error: "+t.indices.length+" not divisible by "+e);const r=vt(t.indices.length/e);return new Qt(r,e,t)}get transformation(){return this._transformation??nt}set transformation(t){this._transformation=t&&t!==nt?Ft(t):null}get highlightGroups(){return this._highlightGroupCounts}get hasHighlights(){return this._highlightGroupCounts.size>0}foreachHighlightGroup(t){this._highlightGroupCounts.forEach((e,r)=>t(r))}allocateIdAndHighlight(t){const e=new ve(t);return this.addHighlight(e)}addHighlight(t){this.highlights.add(t);const{highlightGroupName:e}=t,r=(this._highlightGroupCounts.get(e)??0)+1;return this._highlightGroupCounts.set(e,r),t}removeHighlight(t){if(this.highlights.delete(t)){const{highlightGroupName:e}=t,r=this._highlightGroupCounts.get(e)??0;r<=1?this._highlightGroupCounts.delete(e):this._highlightGroupCounts.set(e,r-1)}}}function Te(i,t){return!(!("isClosed"in i)||!i.isClosed)&&t.indices.length>2}function j(i){if(i==null)return null;const t=i.offset!=null?i.offset:ue,e=i.rotation!=null?i.rotation:0,r=i.scale!=null?i.scale:le,l=J(1,0,0,0,1,0,t[0],t[1],1),u=J(Math.cos(e),-Math.sin(e),0,Math.sin(e),Math.cos(e),0,0,0,1),o=J(r[0],0,0,0,r[1],0,0,0,1),a=gt();return ot(a,u,o),ot(a,l,a),a}class Ie{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class Ae{constructor(t,e,r){this.name=t,this.lodThreshold=e,this.pivotOffset=r,this.stageResources=new Ie,this.numberOfVertices=0}}const P=()=>Pt.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");async function Me(i,t){const e=await _e(i,t),r=await Ce(e.textureDefinitions??{},t);let l=0;for(const u in r)if(r.hasOwnProperty(u)){const o=r[u];l+=o?.image?o.image.width*o.image.height*4:0}return{resource:e,textures:r,size:l+Ot(e)}}async function _e(i,t){const e=t?.streamDataRequester;if(e)return Oe(i,e,t);const r=await ft(Rt(i,t));if(r.ok===!0)return r.value.data;pt(r.error),Tt(r.error)}async function Oe(i,t,e){const r=await ft(t.request(i,"json",e));if(r.ok===!0)return r.value;pt(r.error),Tt(r.error.details.url)}function Tt(i){throw new Bt("",`Request for object resource failed: ${i}`)}function Re(i){const t=i.params,e=t.topology;let r=!0;switch(t.vertexAttributes||(P().warn("Geometry must specify vertex attributes"),r=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const u=t.faces;if(u){if(t.vertexAttributes)for(const o in t.vertexAttributes){const a=u[o];a?.values?(a.valueType!=null&&a.valueType!=="UInt32"&&(P().warn(`Unsupported indexed geometry indices type '${a.valueType}', only UInt32 is currently supported`),r=!1),a.valuesPerElement!=null&&a.valuesPerElement!==1&&(P().warn(`Unsupported indexed geometry values per element '${a.valuesPerElement}', only 1 is currently supported`),r=!1)):(P().warn(`Indexed geometry does not specify face indices for '${o}' attribute`),r=!1)}}else P().warn("Indexed geometries must specify faces"),r=!1;break}default:P().warn(`Unsupported topology '${e}'`),r=!1}i.params.material||(P().warn("Geometry requires material"),r=!1);const l=i.params.vertexAttributes;for(const u in l)l[u].values||(P().warn("Geometries with externally defined attributes are not yet supported"),r=!1);return r}function Be(i,t){const e=new Array,r=new Array,l=new Array,u=new ce,o=i.resource,a=wt.parse(o.version||"1.0","wosr");Se.validate(a);const c=o.model.name,s=o.model.geometries,n=o.materialDefinitions??{},m=i.textures;let d=0;const f=new Map;for(let h=0;h{if(p.params.topology==="PerAttributeArray")return null;const _=p.params.faces;for(const B in _)if(B===x)return _[B].values;return null},G=I[T.POSITION],D=G.values.length/G.valuesPerElement;for(const x in I){const _=I[x],B=_.values,Z=A(x)??vt(D);M.push([x,new q(B,Z,_.valuesPerElement,!0)])}const R=b.texture,y=m&&m[R];if(y&&!f.has(R)){const{image:x,parameters:_}=y,B=new xt(x,_);r.push(B),f.set(R,B)}const F=f.get(R),K=F?F.id:void 0,S=b.material;let w=u.get(S,R);if(w==null){const x=n[S.slice(S.lastIndexOf("/")+1)].params;x.transparency===1&&(x.transparency=0);const _=y&&y.alphaChannelUsage,B=x.transparency>0||_==="transparency"||_==="maskAndTransparency",Z=y?It(y.alphaChannelUsage):void 0,rt={ambient:it(x.diffuse),diffuse:it(x.diffuse),opacity:1-(x.transparency||0),transparent:B,textureAlphaMode:Z,textureAlphaCutoff:.33,textureId:K,initTextureTransparent:!0,doubleSided:!0,cullFace:et.None,colorMixMode:x.externalColorMixMode||"tint",textureAlphaPremultiplied:y?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(rt,t.materialParameters),w=new X(rt,t),u.set(S,R,w)}l.push(w);const At=new Q(w,M);d+=M.find(x=>x[0]===T.POSITION)?.[1]?.indices.length??0,e.push(At)}return{engineResources:[{name:c,stageResources:{textures:r,materials:l,geometries:e},pivotOffset:o.model.pivotOffset,numberOfVertices:d,lodThreshold:null}],referenceBoundingBox:Pe(e)}}function Pe(i){const t=dt();return i.forEach(e=>{const r=e.boundingInfo;r!=null&&(W(t,r.bbMin),W(t,r.bbMax))}),t}async function Ce(i,t){const e=new Array;for(const u in i){const o=i[u],a=o.images[0].data;if(!a){P().warn("Externally referenced texture data is not yet supported");continue}const c=o.encoding+";base64,"+a,s="/textureDefinitions/"+u,n=o.channels==="rgba"?o.alphaChannelUsage||"transparency":"none",m={noUnpackFlip:!0,wrap:{s:mt.REPEAT,t:mt.REPEAT},preMultiplyAlpha:It(n)!==O.Opaque},d=t?.disableTextures?Promise.resolve(null):he(c,t);e.push(d.then(f=>({refId:s,image:f,parameters:m,alphaChannelUsage:n})))}const r=await Promise.all(e),l={};for(const u of r)l[u.refId]=u;return l}function It(i){switch(i){case"mask":return O.Mask;case"maskAndTransparency":return O.MaskBlend;case"none":return O.Opaque;default:return O.Blend}}function Ee(i){const t=i.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const Se=new wt(1,2,"wosr");async function Ur(i,t){const e=Le(_t(i));if(e.fileType==="wosr"){const m=await(t.cache?t.cache.loadWOSR(e.url,t):Me(e.url,t)),{engineResources:d,referenceBoundingBox:f}=Be(m,t);return{lods:d,referenceBoundingBox:f,isEsriSymbolResource:!1,isWosr:!0}}let r;if(t.cache)r=await t.cache.loadGLTF(e.url,t,!!t.usePBR);else{const{loadGLTF:m}=await Mt(()=>import("./loader-CkLCe-E_-BkhKaKBj.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]),import.meta.url);r=await m(new se(t.streamDataRequester),e.url,t,t.usePBR)}const l=r.model.meta?.ESRI_proxyEllipsoid,u=r.meta.isEsriSymbolResource&&l!=null&&r.meta.ESRI_webstyle==="EsriRealisticTreesStyle";u&&!r.customMeta.esriTreeRendering&&(r.customMeta.esriTreeRendering=!0,$e(r,l));const o=!!t.usePBR,a=r.meta.isEsriSymbolResource?{usePBR:o,isSchematic:!1,treeRendering:u,mrrFactors:Dt}:{usePBR:o,isSchematic:!1,treeRendering:!1,mrrFactors:Ht},c={...t.materialParameters,treeRendering:u},{engineResources:s,referenceBoundingBox:n}=Ne(r,a,c,t,e.specifiedLodIndex);return{lods:s,referenceBoundingBox:n,isEsriSymbolResource:r.meta.isEsriSymbolResource,isWosr:!1}}function Le(i){const t=i.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:t[4]!=null?Number(t[4]):null}:i.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:i,specifiedLodIndex:null}:{fileType:"unknown",url:i,specifiedLodIndex:null}}function Ne(i,t,e,r,l){const u=i.model,o=new Array,a=new Map,c=new Map,s=u.lods.length,n=dt();return u.lods.forEach((m,d)=>{const f=r.skipHighLods===!0&&(s>1&&d===0||s>3&&d===1)||r.skipHighLods===!1&&l!=null&&d!==l;if(f&&d!==0)return;const h=new Ae(m.name,m.lodThreshold,[0,0,0]);m.parts.forEach(p=>{const b=f?new X({},r):Fe(u,p,h,t,e,a,c,r),{geometry:I,vertexCount:M}=Ue(p,b??new X({},r)),A=I.boundingInfo;A!=null&&d===0&&(W(n,A.bbMin),W(n,A.bbMax)),b!=null&&(h.stageResources.geometries.push(I),h.numberOfVertices+=M)}),f||o.push(h)}),{engineResources:o,referenceBoundingBox:n}}function Fe(i,t,e,r,l,u,o,a){const c=t.material+(t.attributes.normal?"_normal":"")+(t.attributes.color?"_color":"")+(t.attributes.texCoord0?"_texCoord0":"")+(t.attributes.tangent?"_tangent":""),s=i.materials.get(t.material),n=t.attributes.texCoord0!=null,m=t.attributes.normal!=null;if(s==null)return null;const d=Ge(s.alphaMode);if(!u.has(c)){if(n){const y=(F,K=!1)=>{if(F!=null&&!o.has(F)){const S=i.textures.get(F);if(S!=null){const w=S.data;o.set(F,new xt(Y(w)?w.data:w,{...S.parameters,preMultiplyAlpha:!Y(w)&&K,encoding:Y(w)&&w.encoding!=null?w.encoding:void 0}))}}};y(s.textureColor,d!==O.Opaque),y(s.textureNormal),y(s.textureOcclusion),y(s.textureEmissive),y(s.textureMetallicRoughness)}const h=s.color[0]**(1/$),p=s.color[1]**(1/$),b=s.color[2]**(1/$),I=s.emissiveFactor[0]**(1/$),M=s.emissiveFactor[1]**(1/$),A=s.emissiveFactor[2]**(1/$),G=s.textureColor!=null&&n?o.get(s.textureColor):null,D=Vt({normalTexture:s.textureNormal,metallicRoughnessTexture:s.textureMetallicRoughness,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,emissiveTexture:s.textureEmissive,emissiveFactor:s.emissiveFactor,occlusionTexture:s.textureOcclusion}),R=s.normalTextureTransform?.scale!=null?s.normalTextureTransform?.scale:Ut;u.set(c,new X({...r,transparent:d===O.Blend,customDepthTest:de.Lequal,textureAlphaMode:d,textureAlphaCutoff:s.alphaCutoff,diffuse:[h,p,b],ambient:[h,p,b],opacity:s.opacity,doubleSided:s.doubleSided,doubleSidedType:"winding-order",cullFace:s.doubleSided?et.None:et.Back,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:m?ht.Attribute:ht.ScreenDerivative,castShadows:!0,receiveShadows:s.receiveShadows,receiveAmbientOcclusion:s.receiveAmbientOcclustion,textureId:G?.id,colorMixMode:s.colorMixMode,normalTextureId:s.textureNormal!=null&&n?o.get(s.textureNormal).id:void 0,textureAlphaPremultiplied:G!=null&&!!G.parameters.preMultiplyAlpha,occlusionTextureId:s.textureOcclusion!=null&&n?o.get(s.textureOcclusion).id:void 0,emissiveTextureId:s.textureEmissive!=null&&n?o.get(s.textureEmissive).id:void 0,metallicRoughnessTextureId:s.textureMetallicRoughness!=null&&n?o.get(s.textureMetallicRoughness).id:void 0,emissiveFactor:[I,M,A],mrrFactors:D?zt:[s.metallicFactor,s.roughnessFactor,r.mrrFactors[2]],isSchematic:D,colorTextureTransformMatrix:j(s.colorTextureTransform),normalTextureTransformMatrix:j(s.normalTextureTransform),scale:[R[0],R[1]],occlusionTextureTransformMatrix:j(s.occlusionTextureTransform),emissiveTextureTransformMatrix:j(s.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:j(s.metallicRoughnessTextureTransform),...l},a))}const f=u.get(c);if(e.stageResources.materials.push(f),n){const h=p=>{p!=null&&e.stageResources.textures.push(o.get(p))};h(s.textureColor),h(s.textureNormal),h(s.textureOcclusion),h(s.textureEmissive),h(s.textureMetallicRoughness)}return f}function Ue(i,t){const e=i.attributes.position.count,r=ie(i.indices||e,i.primitiveType),l=H(3*e),{typedBuffer:u,typedBufferStride:o}=i.attributes.position;te(l,u,i.transform,3,o);const a=[[T.POSITION,new q(l,r,3,!0)]];if(i.attributes.normal!=null){const s=H(3*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.normal;Et(k,i.transform),ee(s,n,k,3,m),st(k)&&ut(s,s),a.push([T.NORMAL,new q(s,r,3,!0)])}if(i.attributes.tangent!=null){const s=H(4*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.tangent;St(k,i.transform),re(s,n,k,4,m),st(k)&&ut(s,s,4),a.push([T.TANGENT,new q(s,r,4,!0)])}if(i.attributes.texCoord0!=null){const s=H(2*e),{typedBuffer:n,typedBufferStride:m}=i.attributes.texCoord0;oe(s,n,2,m),a.push([T.UV0,new q(s,r,2,!0)])}const c=i.attributes.color;if(c!=null){const s=new Uint8Array(4*e);c.elementCount===4?c instanceof Kt?ct(s,c,255):c instanceof bt?ne(s,c):c instanceof Zt&&ct(s,c,1/256):(s.fill(255),c instanceof yt?lt(s,c.typedBuffer,255,4,c.typedBufferStride):i.attributes.color instanceof Jt?ae(s,c.typedBuffer,4,i.attributes.color.typedBufferStride):i.attributes.color instanceof Yt&<(s,c.typedBuffer,1/256,4,c.typedBufferStride)),a.push([T.COLOR,new q(s,r,4,!0)])}return{geometry:new Q(t,a),vertexCount:e}}const k=gt();function Ge(i){switch(i){case"BLEND":return O.Blend;case"MASK":return O.Mask;case"OPAQUE":case null:case void 0:return O.Opaque}}function $e(i,t){for(let e=0;e1&&qt(n,n,c,I>-1?.2:Math.min(-4*I-3.8,1)),d[h]=n[0],d[h+1]=n[1],d[h+2]=n[2],h+=3,m[p]=255*A,m[p+1]=255*A,m[p+2]=255*A,m[p+3]=255,p+=4}l.attributes.normal=new yt(d),l.attributes.color=new bt(m)}}}export{Ur as fetch,Le as parseUrl}; diff --git a/custom-toc-highlight/assets/observers-BigwqTsw-BNRQivHR.js b/custom-toc-highlight/assets/observers-BigwqTsw-CfIXp3Nz.js similarity index 90% rename from custom-toc-highlight/assets/observers-BigwqTsw-BNRQivHR.js rename to custom-toc-highlight/assets/observers-BigwqTsw-CfIXp3Nz.js index 16c4120a..939d7e4f 100644 --- a/custom-toc-highlight/assets/observers-BigwqTsw-BNRQivHR.js +++ b/custom-toc-highlight/assets/observers-BigwqTsw-CfIXp3Nz.js @@ -1 +1 @@ -import{c as i}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";function a(t,n,o){if(!i())return;const e=c(t);return new e(n,o)}function c(t){class n extends window.MutationObserver{constructor(e){super(e),this.observedEntry=[],this.callback=e}observe(e,r){return this.observedEntry.push({target:e,options:r}),super.observe(e,r)}unobserve(e){const r=this.observedEntry.filter(s=>s.target!==e);this.observedEntry=[],this.callback(super.takeRecords(),this),this.disconnect(),r.forEach(s=>this.observe(s.target,s.options))}}return function(){return t==="intersection"?window.IntersectionObserver:t==="mutation"?n:window.ResizeObserver}()}export{a as c}; +import{c as i}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";function a(t,n,o){if(!i())return;const e=c(t);return new e(n,o)}function c(t){class n extends window.MutationObserver{constructor(e){super(e),this.observedEntry=[],this.callback=e}observe(e,r){return this.observedEntry.push({target:e,options:r}),super.observe(e,r)}unobserve(e){const r=this.observedEntry.filter(s=>s.target!==e);this.observedEntry=[],this.callback(super.takeRecords(),this),this.disconnect(),r.forEach(s=>this.observe(s.target,s.options))}}return function(){return t==="intersection"?window.IntersectionObserver:t==="mutation"?n:window.ResizeObserver}()}export{a as c}; diff --git a/custom-toc-highlight/assets/ogcFeatureUtils-Bs12bZY3-BXRrRRmn.js b/custom-toc-highlight/assets/ogcFeatureUtils-Bs12bZY3-bQ3aM3rZ.js similarity index 94% rename from custom-toc-highlight/assets/ogcFeatureUtils-Bs12bZY3-BXRrRRmn.js rename to custom-toc-highlight/assets/ogcFeatureUtils-Bs12bZY3-bQ3aM3rZ.js index 717f499c..e2b0272a 100644 --- a/custom-toc-highlight/assets/ogcFeatureUtils-Bs12bZY3-BXRrRRmn.js +++ b/custom-toc-highlight/assets/ogcFeatureUtils-Bs12bZY3-bQ3aM3rZ.js @@ -1 +1 @@ -import{o as j,Y as q,y as ee,f as x,cl as ne,J as k,b8 as J,eS as te,a as A,a1 as ie}from"./story-BfX8CRfG.js";import{U as ae,n as se,z as re}from"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import{t as oe}from"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import{X as le,Y as ce,_ as ue}from"./geojson-CNt_qtQf-B9F87hyc.js";import{d as de}from"./clientSideDefaults-BqqayPct-B-0mBem3.js";import{F as fe}from"./sourceUtils-BMeqkJ5g-DxP4qerC.js";import{o as z}from"./FieldsIndex-HmzMbJQG-DZuFWLvd.js";import{i as me}from"./fieldType-CD2CL2hr-CMChCO5s.js";const G=()=>ie.getLogger("esri.layers.ogc.ogcFeatureUtils"),U="startindex",ge=new Set([U,"offset"]),Y="http://www.opengis.net/def/crs/",Oe=`${Y}OGC/1.3/CRS84`;var l;async function $e(e,t,n={},i=5){const{links:a}=e,o=g(a,"items",l.geojson)||g(a,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(o==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:u,customParameters:d,signal:m}=n,p=q(o.href,e.landingPage.url),T={limit:i,...d,token:u},S=ee(p,T),W={accept:l.geojson},{data:v}=await x(S,{signal:m,headers:W}),N=Ie(S,i,v.links)??U;le(v);const f=ce(v,{geometryType:t.geometryType}),h=t.fields||f.fields||[],R=t.hasZ!=null?t.hasZ:f.hasZ,y=f.geometryType,w=t.objectIdField||f.objectIdFieldName||"OBJECTID";let r=t.timeInfo;const P=h.find(({name:s})=>s===w);if(P)P.editable=!1,P.nullable=!1;else{if(!f.objectIdFieldType)throw new j("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");h.unshift({name:w,alias:w,type:f.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(w!==f.objectIdFieldName){const s=h.find(({name:c})=>c===f.objectIdFieldName);s&&(s.type="esriFieldTypeInteger")}h===f.fields&&f.unknownFields.length>0&&G().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:f.unknownFields}});for(const s of h){if(s.name==null&&(s.name=s.alias),s.alias==null&&(s.alias=s.name),s.type!=="esriFieldTypeOID"&&s.type!=="esriFieldTypeGlobalID"&&(s.editable=s.editable==null||!!s.editable,s.nullable=s.nullable==null||!!s.nullable),!s.name)throw new j("ogc-feature-layer:invalid-field-name","field name is missing",{field:s});if(!me.jsonValues.includes(s.type))throw new j("ogc-feature-layer:invalid-field-type",`invalid type for field "${s.name}"`,{field:s})}if(r){const s=new z(h);if(r.startTimeField){const c=s.get(r.startTimeField);c?(r.startTimeField=c.name,c.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const c=s.get(r.endTimeField);c?(r.endTimeField=c.name,c.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const c=s.get(r.trackIdField);c?r.trackIdField=c.name:(r.trackIdField=null,G().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.timeReference||={timeZoneIANA:ne},r.startTimeField||r.endTimeField||(G().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:r}}),r=void 0)}return{drawingInfo:y?de(y):null,extent:Fe(e),geometryType:y,fields:h,hasZ:!!R,objectIdField:w,paginationParameter:N,timeInfo:r}}async function qe(e,t={}){const{links:n,url:i}=e,a=g(n,"data",l.json)||g(n,"http://www.opengis.net/def/rel/ogc/1.0/data",l.json);if(a==null)throw new j("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.json},query:{...u,token:o}});for(const T of p.collections)T.landingPage=e;return p}async function Ce(e,t={}){const{links:n,url:i}=e,a=g(n,"conformance",l.json)||g(n,"http://www.opengis.net/def/rel/ogc/1.0/conformance",l.json);if(a==null)throw new j("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.json},query:{...u,token:o}});return p}async function Ge(e,t={}){const{apiKey:n,customParameters:i,signal:a}=t,{data:o}=await x(e,{signal:a,headers:{accept:l.json},query:{...i,token:n}});return o.url=e,o}async function We(e,t={}){const{links:n,url:i}=e,a=g(n,"service-desc",l.openapi);if(a==null)return G().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.openapi},query:{...u,token:o}});return p}function Re(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(e),n=t?.groups;if(!n)return null;const{authority:i,code:a}=n;switch(i.toLowerCase()){case"ogc":switch(a.toLowerCase()){case"crs27":return k.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return k.WGS84.wkid;default:return null}case"esri":case"epsg":{const o=Number.parseInt(a,10);return Number.isNaN(o)?null:o}default:return null}}async function De(e,t,n){const i=await pe(e,t,n);return ae(i)}async function pe(e,t,n){const{collection:{links:i,landingPage:{url:a}},layerDefinition:o,maxRecordCount:u,queryParameters:{apiKey:d,customParameters:m},spatialReference:p,supportedCrs:T}=e,S=g(i,"items",l.geojson)||g(i,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(S==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:W,num:v,start:N,timeExtent:f,where:h}=t;if(t.objectIds)throw new j("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const R=k.fromJSON(p),y=t.outSpatialReference??R,w=y.isWGS84?null:E(y,T),r=he(W,T),P=we(f),s=be(h),c=v??(N==null?u:10),Q=N===0?void 0:N,{fields:K,geometryType:C,hasZ:D,objectIdField:O,paginationParameter:V}=o,X=q(S.href,a),{data:L}=await x(X,{...n,query:{...m,...r,crs:w,datetime:P,query:s,limit:c,[V]:Q,token:d},headers:{accept:l.geojson}}),$=ue(L,{geometryType:C,hasZ:D,objectIdField:O}),B=$.length===c&&!!g(L.links??[],"next",l.geojson),_=new z(K);for(const b of $){const I={};fe(_,I,b.attributes,!0);for(const M of _.fields)M.nullable&&!(M.name in I)&&(I[M.name]=null);I[O]=b.attributes[O],b.attributes=I}if(!w&&y.isWebMercator){for(const b of $)if(b.geometry!=null&&C!=null){const I=se(b.geometry,C,D,!1);I.spatialReference=k.WGS84,b.geometry=re(J(I,y))}}for(const b of $)b.objectId=b.attributes[O];const H=w||!w&&y.isWebMercator?y.toJSON():te,F=new oe;return F.exceededTransferLimit=B,F.features=$,F.fields=K,F.geometryType=C,F.hasZ=D,F.objectIdFieldName=O,F.spatialReference=H,F}function ye(e){return e!=null&&e.type==="extent"}function E(e,t){const{isWebMercator:n,wkid:i}=e;if(!i)return null;const a=n?t[3857]??t[102100]??t[102113]??t[900913]:t[e.wkid];return a?`${Y}${a}`:null}function Z(e){if(e==null)return"";const{xmin:t,ymin:n,xmax:i,ymax:a}=e;return`${t},${n},${i},${a}`}function we(e){if(e==null)return null;const{start:t,end:n}=e;return`${t!=null?t.toISOString():".."}/${n!=null?n.toISOString():".."}`}function be(e){return e!=null&&e&&e!=="1=1"?e:null}function he(e,t){if(!ye(e))return null;const{spatialReference:n}=e;if(!n||n.isWGS84)return{bbox:Z(e)};const i=E(n,t);return i!=null?{bbox:Z(e),"bbox-crs":i}:n.isWebMercator?{bbox:Z(J(e,k.WGS84))}:null}function Fe(e){const t=e.extent?.spatial;if(!t)return null;const n=t.bbox[0],i=n.length===4,[a,o]=n,u=i?void 0:n[2];return{xmin:a,ymin:o,xmax:i?n[2]:n[3],ymax:i?n[3]:n[4],zmin:u,zmax:i?void 0:n[5],spatialReference:k.WGS84.toJSON()}}function g(e,t,n){return e.find(({rel:i,type:a})=>i===t&&a===n)??e.find(({rel:i,type:a})=>i===t&&!a)}function Ie(e,t,n){if(!n)return;const i=g(n,"next",l.geojson),a=A(i?.href)?.query;if(!a)return;const o=A(e).query,u=Object.keys(o??{});return Object.entries(a).filter(([d])=>!u.includes(d)).find(([d,m])=>ge.has(d.toLowerCase())&&Number.parseInt(m,10)===t)?.[0]}(function(e){e.json="application/json",e.geojson="application/geo+json",e.openapi="application/vnd.oai.openapi+json;version=3.0"})(l||(l={}));export{We as F,Ge as I,Y as M,De as T,pe as _,qe as b,Ce as h,Re as j,$e as w,Oe as y}; +import{o as j,Y as q,y as ee,f as x,cl as ne,J as k,b8 as J,eS as te,a as A,a1 as ie}from"./story-Doly9N9p.js";import{U as ae,n as se,z as re}from"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import{t as oe}from"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import{X as le,Y as ce,_ as ue}from"./geojson-CNt_qtQf-X0105Nc8.js";import{d as de}from"./clientSideDefaults-BqqayPct-Vv2Kv9CL.js";import{F as fe}from"./sourceUtils-BMeqkJ5g-DcR3VPl5.js";import{o as z}from"./FieldsIndex-HmzMbJQG-Du7S47uJ.js";import{i as me}from"./fieldType-CD2CL2hr-Do9kp-dx.js";const G=()=>ie.getLogger("esri.layers.ogc.ogcFeatureUtils"),U="startindex",ge=new Set([U,"offset"]),Y="http://www.opengis.net/def/crs/",Oe=`${Y}OGC/1.3/CRS84`;var l;async function $e(e,t,n={},i=5){const{links:a}=e,o=g(a,"items",l.geojson)||g(a,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(o==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{apiKey:u,customParameters:d,signal:m}=n,p=q(o.href,e.landingPage.url),T={limit:i,...d,token:u},S=ee(p,T),W={accept:l.geojson},{data:v}=await x(S,{signal:m,headers:W}),N=Ie(S,i,v.links)??U;le(v);const f=ce(v,{geometryType:t.geometryType}),h=t.fields||f.fields||[],R=t.hasZ!=null?t.hasZ:f.hasZ,y=f.geometryType,w=t.objectIdField||f.objectIdFieldName||"OBJECTID";let r=t.timeInfo;const P=h.find(({name:s})=>s===w);if(P)P.editable=!1,P.nullable=!1;else{if(!f.objectIdFieldType)throw new j("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");h.unshift({name:w,alias:w,type:f.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(w!==f.objectIdFieldName){const s=h.find(({name:c})=>c===f.objectIdFieldName);s&&(s.type="esriFieldTypeInteger")}h===f.fields&&f.unknownFields.length>0&&G().warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:f.unknownFields}});for(const s of h){if(s.name==null&&(s.name=s.alias),s.alias==null&&(s.alias=s.name),s.type!=="esriFieldTypeOID"&&s.type!=="esriFieldTypeGlobalID"&&(s.editable=s.editable==null||!!s.editable,s.nullable=s.nullable==null||!!s.nullable),!s.name)throw new j("ogc-feature-layer:invalid-field-name","field name is missing",{field:s});if(!me.jsonValues.includes(s.type))throw new j("ogc-feature-layer:invalid-field-type",`invalid type for field "${s.name}"`,{field:s})}if(r){const s=new z(h);if(r.startTimeField){const c=s.get(r.startTimeField);c?(r.startTimeField=c.name,c.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const c=s.get(r.endTimeField);c?(r.endTimeField=c.name,c.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const c=s.get(r.trackIdField);c?r.trackIdField=c.name:(r.trackIdField=null,G().warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.timeReference||={timeZoneIANA:ne},r.startTimeField||r.endTimeField||(G().warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:r}}),r=void 0)}return{drawingInfo:y?de(y):null,extent:Fe(e),geometryType:y,fields:h,hasZ:!!R,objectIdField:w,paginationParameter:N,timeInfo:r}}async function qe(e,t={}){const{links:n,url:i}=e,a=g(n,"data",l.json)||g(n,"http://www.opengis.net/def/rel/ogc/1.0/data",l.json);if(a==null)throw new j("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.json},query:{...u,token:o}});for(const T of p.collections)T.landingPage=e;return p}async function Ce(e,t={}){const{links:n,url:i}=e,a=g(n,"conformance",l.json)||g(n,"http://www.opengis.net/def/rel/ogc/1.0/conformance",l.json);if(a==null)throw new j("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.json},query:{...u,token:o}});return p}async function Ge(e,t={}){const{apiKey:n,customParameters:i,signal:a}=t,{data:o}=await x(e,{signal:a,headers:{accept:l.json},query:{...i,token:n}});return o.url=e,o}async function We(e,t={}){const{links:n,url:i}=e,a=g(n,"service-desc",l.openapi);if(a==null)return G().warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:o,customParameters:u,signal:d}=t,m=q(a.href,i),{data:p}=await x(m,{signal:d,headers:{accept:l.openapi},query:{...u,token:o}});return p}function Re(e){const t=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(e),n=t?.groups;if(!n)return null;const{authority:i,code:a}=n;switch(i.toLowerCase()){case"ogc":switch(a.toLowerCase()){case"crs27":return k.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return k.WGS84.wkid;default:return null}case"esri":case"epsg":{const o=Number.parseInt(a,10);return Number.isNaN(o)?null:o}default:return null}}async function De(e,t,n){const i=await pe(e,t,n);return ae(i)}async function pe(e,t,n){const{collection:{links:i,landingPage:{url:a}},layerDefinition:o,maxRecordCount:u,queryParameters:{apiKey:d,customParameters:m},spatialReference:p,supportedCrs:T}=e,S=g(i,"items",l.geojson)||g(i,"http://www.opengis.net/def/rel/ogc/1.0/items",l.geojson);if(S==null)throw new j("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:W,num:v,start:N,timeExtent:f,where:h}=t;if(t.objectIds)throw new j("ogc-feature-layer:query-by-objectids-not-supported","Queries with object ids are not supported");const R=k.fromJSON(p),y=t.outSpatialReference??R,w=y.isWGS84?null:E(y,T),r=he(W,T),P=we(f),s=be(h),c=v??(N==null?u:10),Q=N===0?void 0:N,{fields:K,geometryType:C,hasZ:D,objectIdField:O,paginationParameter:V}=o,X=q(S.href,a),{data:L}=await x(X,{...n,query:{...m,...r,crs:w,datetime:P,query:s,limit:c,[V]:Q,token:d},headers:{accept:l.geojson}}),$=ue(L,{geometryType:C,hasZ:D,objectIdField:O}),B=$.length===c&&!!g(L.links??[],"next",l.geojson),_=new z(K);for(const b of $){const I={};fe(_,I,b.attributes,!0);for(const M of _.fields)M.nullable&&!(M.name in I)&&(I[M.name]=null);I[O]=b.attributes[O],b.attributes=I}if(!w&&y.isWebMercator){for(const b of $)if(b.geometry!=null&&C!=null){const I=se(b.geometry,C,D,!1);I.spatialReference=k.WGS84,b.geometry=re(J(I,y))}}for(const b of $)b.objectId=b.attributes[O];const H=w||!w&&y.isWebMercator?y.toJSON():te,F=new oe;return F.exceededTransferLimit=B,F.features=$,F.fields=K,F.geometryType=C,F.hasZ=D,F.objectIdFieldName=O,F.spatialReference=H,F}function ye(e){return e!=null&&e.type==="extent"}function E(e,t){const{isWebMercator:n,wkid:i}=e;if(!i)return null;const a=n?t[3857]??t[102100]??t[102113]??t[900913]:t[e.wkid];return a?`${Y}${a}`:null}function Z(e){if(e==null)return"";const{xmin:t,ymin:n,xmax:i,ymax:a}=e;return`${t},${n},${i},${a}`}function we(e){if(e==null)return null;const{start:t,end:n}=e;return`${t!=null?t.toISOString():".."}/${n!=null?n.toISOString():".."}`}function be(e){return e!=null&&e&&e!=="1=1"?e:null}function he(e,t){if(!ye(e))return null;const{spatialReference:n}=e;if(!n||n.isWGS84)return{bbox:Z(e)};const i=E(n,t);return i!=null?{bbox:Z(e),"bbox-crs":i}:n.isWebMercator?{bbox:Z(J(e,k.WGS84))}:null}function Fe(e){const t=e.extent?.spatial;if(!t)return null;const n=t.bbox[0],i=n.length===4,[a,o]=n,u=i?void 0:n[2];return{xmin:a,ymin:o,xmax:i?n[2]:n[3],ymax:i?n[3]:n[4],zmin:u,zmax:i?void 0:n[5],spatialReference:k.WGS84.toJSON()}}function g(e,t,n){return e.find(({rel:i,type:a})=>i===t&&a===n)??e.find(({rel:i,type:a})=>i===t&&!a)}function Ie(e,t,n){if(!n)return;const i=g(n,"next",l.geojson),a=A(i?.href)?.query;if(!a)return;const o=A(e).query,u=Object.keys(o??{});return Object.entries(a).filter(([d])=>!u.includes(d)).find(([d,m])=>ge.has(d.toLowerCase())&&Number.parseInt(m,10)===t)?.[0]}(function(e){e.json="application/json",e.geojson="application/geo+json",e.openapi="application/vnd.oai.openapi+json;version=3.0"})(l||(l={}));export{We as F,Ge as I,Y as M,De as T,pe as _,qe as b,Ce as h,Re as j,$e as w,Oe as y}; diff --git a/custom-toc-highlight/assets/openCloseComponent-BGQ6h7vg-COvbZ7sG.js b/custom-toc-highlight/assets/openCloseComponent-BGQ6h7vg-BO0gc3O8.js similarity index 80% rename from custom-toc-highlight/assets/openCloseComponent-BGQ6h7vg-COvbZ7sG.js rename to custom-toc-highlight/assets/openCloseComponent-BGQ6h7vg-BO0gc3O8.js index c37dd588..259dc34d 100644 --- a/custom-toc-highlight/assets/openCloseComponent-BGQ6h7vg-COvbZ7sG.js +++ b/custom-toc-highlight/assets/openCloseComponent-BGQ6h7vg-BO0gc3O8.js @@ -1 +1 @@ -import{A as o}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{F as r}from"./dom-N58V0tYi-DBU3jlah.js";const t=o;function e(n){return"opened"in n?n.opened:n.open}function s(n){t(()=>{n.transitionEl&&r(n.transitionEl,n.openTransitionProp,()=>{e(n)?n.onBeforeOpen():n.onBeforeClose()},()=>{e(n)?n.onOpen():n.onClose()})})}export{s as p}; +import{A as o}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{F as r}from"./dom-N58V0tYi-DBU3jlah.js";const t=o;function e(n){return"opened"in n?n.opened:n.open}function s(n){t(()=>{n.transitionEl&&r(n.transitionEl,n.openTransitionProp,()=>{e(n)?n.onBeforeOpen():n.onBeforeClose()},()=>{e(n)?n.onOpen():n.onClose()})})}export{s as p}; diff --git a/custom-toc-highlight/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js b/custom-toc-highlight/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js similarity index 84% rename from custom-toc-highlight/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js rename to custom-toc-highlight/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js index b927d334..a20934ce 100644 --- a/custom-toc-highlight/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-DzcIpi-6.js +++ b/custom-toc-highlight/assets/optimizedFeatureQueryEngineAdapter-DFdaawxC-BTfsw2OK.js @@ -1 +1 @@ -import{n as r}from"./timeSupport-jPViR5jn-GyoVmGVI.js";import{i as o,c as i}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";const s={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new o(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>(t.centroid==null&&(t.centroid=r(new i,t.geometry,e.hasZ,e.hasM)),t.centroid)};export{s}; +import{n as r}from"./timeSupport-jPViR5jn-7bshRI7L.js";import{i as o,c as i}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";const s={getObjectId:t=>t.objectId,getAttributes:t=>t.attributes,getAttribute:(t,e)=>t.attributes[e],cloneWithGeometry:(t,e)=>new o(e,t.attributes,null,t.objectId),getGeometry:t=>t.geometry,getCentroid:(t,e)=>(t.centroid==null&&(t.centroid=r(new i,t.geometry,e.hasZ,e.hasM)),t.centroid)};export{s}; diff --git a/custom-toc-highlight/assets/orientedBoundingBox-oHezdpWm-BCiifXla.js b/custom-toc-highlight/assets/orientedBoundingBox-oHezdpWm-ilptOsP0.js similarity index 96% rename from custom-toc-highlight/assets/orientedBoundingBox-oHezdpWm-BCiifXla.js rename to custom-toc-highlight/assets/orientedBoundingBox-oHezdpWm-ilptOsP0.js index 5f8683e0..d4d7b18a 100644 --- a/custom-toc-highlight/assets/orientedBoundingBox-oHezdpWm-BCiifXla.js +++ b/custom-toc-highlight/assets/orientedBoundingBox-oHezdpWm-ilptOsP0.js @@ -1 +1 @@ -import{K as $t,G as Jt}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as Kt,o as Ut}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{t as ta}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{T as aa,v as U,_ as sa}from"./quat-BODLR7mS-BrXZAXDf.js";import{n as Zt,e as xt}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{_ as k,w,I as mt,C as At,G as ia,Z as na,j as lt,k as Rt,E as ra,L as nt,D as ea,b as Ct,N as gt,P as oa,q as ha}from"./vec32-D9GsKZ1t-BjayBdwt.js";import{h_ as ca,dp as vt,dg as u,h$ as ua,i0 as fa,hZ as zt,i1 as Gt}from"./story-BfX8CRfG.js";import{D as da}from"./vec42-D8CJyqHG-DnfLTeQH.js";import{o as ma}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";import{x as _t}from"./spatialReferenceEllipsoidUtils-DUrKTvup-CO-vCbEW.js";import{G as la}from"./computeTranslationToOriginAndRotation-wF0y9WQG-DmaZSUt2.js";import{n as St,G as Bt}from"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import{f as Ft,i as _a,N as It}from"./plane-Dt8R0KeE-CVSP2GQG.js";import{l as ga}from"./ViewingMode-CyR_b1T8-_s7_Gbsk.js";import{o as ba}from"./vec2f64-CeODonrJ-CkkJCdRC.js";class yt{constructor(t,a,s=a){this.data=t,this.size=a,this.stride=s}}class ss extends yt{constructor(t,a,s,r=!1,n=s){super(t,s,n),this.indices=a,this.exclusive=r}}const rt=1e-6,et=u(),bt=u();function Ma(i,t){const{data:a,size:s}=i,r=a.length/s;if(r<=0)return;const n=new qa(i);qt(et,n.minProj,n.maxProj),ft(et,et,.5),y(bt,n.maxProj,n.minProj);const h=Nt(bt),e=new wa;e.quality=h,r<14&&(i=new yt(new Float64Array(n.buffer,112,42),3));const o=u(),f=u(),b=u(),l=u(),z=u(),A=u(),M=u();switch(Pa(n,i,M,o,f,b,l,z,A,e)){case 1:return void Yt(et,bt,t);case 2:return void $a(i,l,t)}ja(i,M,o,f,b,l,z,A,e),Ot(i,e.b0,e.b1,e.b2,at,st);const E=u();y(E,st,at),e.quality=Nt(E),e.qualitys&&(s=h,r=n)}p(t,i.minVert[r]),p(a,i.maxVert[r])}const q=[0,0,0];function Sa(i,t,a,s){const{data:r,size:n}=i;let h=Number.NEGATIVE_INFINITY,e=0;for(let o=0;oh&&(h=l,e=o)}return p(s,r,e),h}const _=ba();function pa(i,t,a,s,r){Ia(i,t,_,r,s);const n=Lt(a,t);_[1]-rt<=n&&(s[0]=void 0),_[0]+rt>=n&&(r[0]=void 0)}const Tt=u(),Et=u(),Qt=u(),L=u(),X=u(),Mt=u();function W(i,t,a,s,r,n){if(kt(t)a[1]&&(a[1]=o,p(r,n,e))}}function Yt(i,t,a){a.center=i,a.halfSize=nt(t,t,.5),a.quaternion=Zt}const Q=u(),J=u(),ct=u(),at=u(),st=u(),Dt=u();function $a(i,t,a){p(Q,t),Math.abs(t[0])>Math.abs(t[1])&&Math.abs(t[0])>Math.abs(t[2])?Q[0]=0:Math.abs(t[1])>Math.abs(t[2])?Q[1]=0:Q[2]=0,kt(Q)this.maxProj[0]&&(this.maxProj[0]=o,r[0]=e),o=n[e+1],othis.maxProj[1]&&(this.maxProj[1]=o,r[1]=e),o=n[e+2],othis.maxProj[2]&&(this.maxProj[2]=o,r[2]=e),o=n[e]+n[e+1]+n[e+2],othis.maxProj[3]&&(this.maxProj[3]=o,r[3]=e),o=n[e]+n[e+1]-n[e+2],othis.maxProj[4]&&(this.maxProj[4]=o,r[4]=e),o=n[e]-n[e+1]+n[e+2],othis.maxProj[5]&&(this.maxProj[5]=o,r[5]=e),o=n[e]-n[e+1]-n[e+2],othis.maxProj[6]&&(this.maxProj[6]=o,r[6]=e)}for(let e=0;e0){const s=1/Math.sqrt(a);i[0]=t[0]*s,i[1]=t[1]*s,i[2]=t[2]*s}}function kt(i){return i[0]*i[0]+i[1]*i[1]+i[2]*i[2]}function wt(i,t){const a=t[0]-i[0],s=t[1]-i[1],r=t[2]-i[2];return a*a+s*s+r*r}function Lt(i,t){return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]}function ya(i,t){const a=t[0]+t[4]+t[8];if(a>0){let s=Math.sqrt(a+1);i[3]=.5*s,s=.5/s,i[0]=(t[5]-t[7])*s,i[1]=(t[6]-t[2])*s,i[2]=(t[1]-t[3])*s}else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[3*s+s]&&(s=2);const r=(s+1)%3,n=(s+2)%3;let h=Math.sqrt(t[3*s+s]-t[3*r+r]-t[3*n+n]+1);i[s]=.5*h,h=.5/h,i[3]=(t[3*r+n]-t[3*n+r])*h,i[r]=(t[3*r+s]+t[3*s+r])*h,i[n]=(t[3*n+s]+t[3*s+n])*h}return i}class dt{constructor(t=ca,a=Ya,s=Zt){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],s[0],s[1],s[2],s[3]]}clone(){const t=new dt;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new dt;return a._data=t.slice(),a}static fromJSON(t){return new dt(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return k(Ft.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,s){this._data[0]=t,this._data[1]=a,this._data[2]=s}get halfSize(){return k(Ft.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return aa(_a.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=m,s=this._data;a[0]=s[6],a[1]=s[7],a[2]=s[8],a[3]=s[9];for(let r=0;r<8;++r){const n=t[r];n[0]=(1&r?-1:1)*s[3],n[1]=(2&r?-1:1)*s[4],n[2]=(4&r?-1:1)*s[5],w(n,n,a),n[0]+=s[0],n[1]+=s[1],n[2]+=s[2]}}doesIntersectFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],s=this._data[5];return Math.sqrt(t*t+a*a+s*s)}intersectSphere(t){c[0]=this._data[0]-t[0],c[1]=this._data[1]-t[1],c[2]=this._data[2]-t[2];const a=this.getQuaternion(D);return U(m,a),w(c,c,m),mt(c,c),Y[0]=Math.min(c[0],this._data[3]),Y[1]=Math.min(c[1],this._data[4]),Y[2]=Math.min(c[2],this._data[5]),At(Y,c)n*n)&&(m[0]=-s[6],m[1]=-s[7],m[2]=-s[8],m[3]=s[9],w(c,c,m),mt(c,c),Y[0]=Math.min(c[0],s[3]),Y[1]=Math.min(c[1],s[4]),Y[2]=Math.min(c[2],s[5]),At(Y,c)s?1:a<-s?-1:0}intersectRay(t,a,s=0){const r=this._data,n=m;n[0]=-r[6],n[1]=-r[7],n[2]=-r[8],n[3]=r[9],c[0]=t[0]-r[0],c[1]=t[1]-r[1],c[2]=t[2]-r[2];const h=w(c,c,m),e=w(Y,a,m);let o=-1/0,f=1/0;const b=this.getHalfSize(it);for(let l=0;l<3;l++){const z=h[l],A=e[l],M=b[l]+s;if(Math.abs(A)>1e-6){const E=(M-z)/A,P=(-M-z)/A;o=Math.max(o,Math.min(E,P)),f=Math.min(f,Math.max(E,P))}else if(z>M||z<-M)return!1}return o<=f}projectedArea(t,a,s,r){const n=this.getQuaternion(D);U(m,n),c[0]=t[0]-this._data[0],c[1]=t[1]-this._data[1],c[2]=t[2]-this._data[2],w(c,c,m);const h=this.getHalfSize(it),e=c[0]<-h[0]?-1:c[0]>h[0]?1:0,o=c[1]<-h[1]?-1:c[1]>h[1]?1:0,f=c[2]<-h[2]?-1:c[2]>h[2]?1:0,b=Math.abs(e)+Math.abs(o)+Math.abs(f);if(b===0)return 1/0;const l=b===1?4:6,z=6*(e+3*o+9*f+13);$t(K,n),Jt(K,K,h);const A=this.getCenter(G);for(let P=0;P>1)-1),na(c,c,K),lt(O,A,c),O[3]=1,da(O,O,a);const Vt=1/Math.max(1e-6,O[3]);C[2*P]=O[0]*Vt,C[2*P+1]=O[1]*Vt}const M=2*l-2;let E=C[0]*(C[3]-C[M+1])+C[M]*(C[1]-C[M-1]);for(let P=2;P{const i=new Int8Array(162);let t=0;const a=s=>{for(let r=0;r0?1+t/f:1,l=o>0?1+a/o:1,z=(l+b)/2,A=(l-b)/2;nt(S,v,A),r.halfSize=gt(S,S,e,z),nt(S,v,z),gt(S,S,e,A),oa(d,d),ha(d,S,d);const M=i.getQuaternion(Va);r.center=w(d,d,M)}}else{r.center=gt(d,h,Gt,(a+t)/2);const o=w(d,Gt,m);mt(o,o),r.halfSize=gt(v,e,o,(a-t)/2)}return r}function va(i,t,a,s,r){t.getCenter(G),G[2]+=r;const n=_t(a);St(G,i,0,G,n,0),Xt(n,t,G,a,s)}function Ga(i,t,a,s,r){t.getCenter(G),G[2]+=r,Xt(i,t,G,a,s)}function Xt(i,t,a,s,r){const n=t.getQuaternion(D),h=$t(K,n),e=t.getHalfSize(it);for(let o=0;o<8;++o){for(let f=0;f<3;++f)T[f]=e[f]*(o&1<s&&(s=h,r=n)}p(t,i.minVert[r]),p(a,i.maxVert[r])}const q=[0,0,0];function Sa(i,t,a,s){const{data:r,size:n}=i;let h=Number.NEGATIVE_INFINITY,e=0;for(let o=0;oh&&(h=l,e=o)}return p(s,r,e),h}const _=ba();function pa(i,t,a,s,r){Ia(i,t,_,r,s);const n=Lt(a,t);_[1]-rt<=n&&(s[0]=void 0),_[0]+rt>=n&&(r[0]=void 0)}const Tt=u(),Et=u(),Qt=u(),L=u(),X=u(),Mt=u();function W(i,t,a,s,r,n){if(kt(t)a[1]&&(a[1]=o,p(r,n,e))}}function Yt(i,t,a){a.center=i,a.halfSize=nt(t,t,.5),a.quaternion=Zt}const Q=u(),J=u(),ct=u(),at=u(),st=u(),Dt=u();function $a(i,t,a){p(Q,t),Math.abs(t[0])>Math.abs(t[1])&&Math.abs(t[0])>Math.abs(t[2])?Q[0]=0:Math.abs(t[1])>Math.abs(t[2])?Q[1]=0:Q[2]=0,kt(Q)this.maxProj[0]&&(this.maxProj[0]=o,r[0]=e),o=n[e+1],othis.maxProj[1]&&(this.maxProj[1]=o,r[1]=e),o=n[e+2],othis.maxProj[2]&&(this.maxProj[2]=o,r[2]=e),o=n[e]+n[e+1]+n[e+2],othis.maxProj[3]&&(this.maxProj[3]=o,r[3]=e),o=n[e]+n[e+1]-n[e+2],othis.maxProj[4]&&(this.maxProj[4]=o,r[4]=e),o=n[e]-n[e+1]+n[e+2],othis.maxProj[5]&&(this.maxProj[5]=o,r[5]=e),o=n[e]-n[e+1]-n[e+2],othis.maxProj[6]&&(this.maxProj[6]=o,r[6]=e)}for(let e=0;e0){const s=1/Math.sqrt(a);i[0]=t[0]*s,i[1]=t[1]*s,i[2]=t[2]*s}}function kt(i){return i[0]*i[0]+i[1]*i[1]+i[2]*i[2]}function wt(i,t){const a=t[0]-i[0],s=t[1]-i[1],r=t[2]-i[2];return a*a+s*s+r*r}function Lt(i,t){return i[0]*t[0]+i[1]*t[1]+i[2]*t[2]}function ya(i,t){const a=t[0]+t[4]+t[8];if(a>0){let s=Math.sqrt(a+1);i[3]=.5*s,s=.5/s,i[0]=(t[5]-t[7])*s,i[1]=(t[6]-t[2])*s,i[2]=(t[1]-t[3])*s}else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[3*s+s]&&(s=2);const r=(s+1)%3,n=(s+2)%3;let h=Math.sqrt(t[3*s+s]-t[3*r+r]-t[3*n+n]+1);i[s]=.5*h,h=.5/h,i[3]=(t[3*r+n]-t[3*n+r])*h,i[r]=(t[3*r+s]+t[3*s+r])*h,i[n]=(t[3*n+s]+t[3*s+n])*h}return i}class dt{constructor(t=ca,a=Ya,s=Zt){this._data=[t[0],t[1],t[2],a[0],a[1],a[2],s[0],s[1],s[2],s[3]]}clone(){const t=new dt;return t._data=this._data.slice(),t}invalidate(){this._data[3]=-1}get isValid(){return this._data[3]>=0}static fromData(t){const a=new dt;return a._data=t.slice(),a}static fromJSON(t){return new dt(t.center,t.halfSize,t.quaternion)}copy(t){this._data=t.data.slice()}get center(){return k(Ft.get(),this._data[0],this._data[1],this._data[2])}get centerX(){return this._data[0]}get centerY(){return this._data[1]}get centerZ(){return this._data[2]}getCenter(t){return t[0]=this._data[0],t[1]=this._data[1],t[2]=this._data[2],t}set center(t){this._data[0]=t[0],this._data[1]=t[1],this._data[2]=t[2]}setCenter(t,a,s){this._data[0]=t,this._data[1]=a,this._data[2]=s}get halfSize(){return k(Ft.get(),this._data[3],this._data[4],this._data[5])}get halfSizeX(){return this._data[3]}get halfSizeY(){return this._data[4]}get halfSizeZ(){return this._data[5]}getHalfSize(t){return t[0]=this._data[3],t[1]=this._data[4],t[2]=this._data[5],t}set halfSize(t){this._data[3]=t[0],this._data[4]=t[1],this._data[5]=t[2]}get quaternion(){return aa(_a.get(),this._data[6],this._data[7],this._data[8],this._data[9])}getQuaternion(t){return t[0]=this._data[6],t[1]=this._data[7],t[2]=this._data[8],t[3]=this._data[9],t}set quaternion(t){this._data[6]=t[0],this._data[7]=t[1],this._data[8]=t[2],this._data[9]=t[3]}get data(){return this._data}getCorners(t){const a=m,s=this._data;a[0]=s[6],a[1]=s[7],a[2]=s[8],a[3]=s[9];for(let r=0;r<8;++r){const n=t[r];n[0]=(1&r?-1:1)*s[3],n[1]=(2&r?-1:1)*s[4],n[2]=(4&r?-1:1)*s[5],w(n,n,a),n[0]+=s[0],n[1]+=s[1],n[2]+=s[2]}}doesIntersectFrustumConservativeApproximation(t){return this.intersectPlane(t[0])<=0&&this.intersectPlane(t[1])<=0&&this.intersectPlane(t[2])<=0&&this.intersectPlane(t[3])<=0&&this.intersectPlane(t[4])<=0&&this.intersectPlane(t[5])<=0}get radius(){const t=this._data[3],a=this._data[4],s=this._data[5];return Math.sqrt(t*t+a*a+s*s)}intersectSphere(t){c[0]=this._data[0]-t[0],c[1]=this._data[1]-t[1],c[2]=this._data[2]-t[2];const a=this.getQuaternion(D);return U(m,a),w(c,c,m),mt(c,c),Y[0]=Math.min(c[0],this._data[3]),Y[1]=Math.min(c[1],this._data[4]),Y[2]=Math.min(c[2],this._data[5]),At(Y,c)n*n)&&(m[0]=-s[6],m[1]=-s[7],m[2]=-s[8],m[3]=s[9],w(c,c,m),mt(c,c),Y[0]=Math.min(c[0],s[3]),Y[1]=Math.min(c[1],s[4]),Y[2]=Math.min(c[2],s[5]),At(Y,c)s?1:a<-s?-1:0}intersectRay(t,a,s=0){const r=this._data,n=m;n[0]=-r[6],n[1]=-r[7],n[2]=-r[8],n[3]=r[9],c[0]=t[0]-r[0],c[1]=t[1]-r[1],c[2]=t[2]-r[2];const h=w(c,c,m),e=w(Y,a,m);let o=-1/0,f=1/0;const b=this.getHalfSize(it);for(let l=0;l<3;l++){const z=h[l],A=e[l],M=b[l]+s;if(Math.abs(A)>1e-6){const E=(M-z)/A,P=(-M-z)/A;o=Math.max(o,Math.min(E,P)),f=Math.min(f,Math.max(E,P))}else if(z>M||z<-M)return!1}return o<=f}projectedArea(t,a,s,r){const n=this.getQuaternion(D);U(m,n),c[0]=t[0]-this._data[0],c[1]=t[1]-this._data[1],c[2]=t[2]-this._data[2],w(c,c,m);const h=this.getHalfSize(it),e=c[0]<-h[0]?-1:c[0]>h[0]?1:0,o=c[1]<-h[1]?-1:c[1]>h[1]?1:0,f=c[2]<-h[2]?-1:c[2]>h[2]?1:0,b=Math.abs(e)+Math.abs(o)+Math.abs(f);if(b===0)return 1/0;const l=b===1?4:6,z=6*(e+3*o+9*f+13);$t(K,n),Jt(K,K,h);const A=this.getCenter(G);for(let P=0;P>1)-1),na(c,c,K),lt(O,A,c),O[3]=1,da(O,O,a);const Vt=1/Math.max(1e-6,O[3]);C[2*P]=O[0]*Vt,C[2*P+1]=O[1]*Vt}const M=2*l-2;let E=C[0]*(C[3]-C[M+1])+C[M]*(C[1]-C[M-1]);for(let P=2;P{const i=new Int8Array(162);let t=0;const a=s=>{for(let r=0;r0?1+t/f:1,l=o>0?1+a/o:1,z=(l+b)/2,A=(l-b)/2;nt(S,v,A),r.halfSize=gt(S,S,e,z),nt(S,v,z),gt(S,S,e,A),oa(d,d),ha(d,S,d);const M=i.getQuaternion(Va);r.center=w(d,d,M)}}else{r.center=gt(d,h,Gt,(a+t)/2);const o=w(d,Gt,m);mt(o,o),r.halfSize=gt(v,e,o,(a-t)/2)}return r}function va(i,t,a,s,r){t.getCenter(G),G[2]+=r;const n=_t(a);St(G,i,0,G,n,0),Xt(n,t,G,a,s)}function Ga(i,t,a,s,r){t.getCenter(G),G[2]+=r,Xt(i,t,G,a,s)}function Xt(i,t,a,s,r){const n=t.getQuaternion(D),h=$t(K,n),e=t.getHalfSize(it);for(let o=0;o<8;++o){for(let f=0;f<3;++f)T[f]=e[f]*(o&1<{const a=b("panel-screen");return f(),i(a,{panel:t.panel},{header:s(()=>e[2]||(e[2]=[o(" Gazebo/Panel 2/Screen A ")])),content:s(()=>[o(r(u(p)("gz.hello"))+" ",1),n("div",m,[n("button",{type:"button",onClick:e[0]||(e[0]=l=>t.panel.show({screen:"p-2-screen-2",props:{greeting:"Howdy?"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16 m-2"}," Go back to B "),n("button",{type:"button",onClick:e[1]||(e[1]=l=>t.panel.show("p-2-screen-3")),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," Go to C ")]),n("p",h,r(t.greeting),1)]),_:1},8,["panel"])}}});export{w as default}; +import{eT as c,eX as g,e_ as b,e$ as f,f0 as i,f1 as s,fG as o,fg as r,f4 as u,f2 as n}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";const m={class:"flex flex-row justify-center items-center mt-16"},h={class:"mt-16"},w=c({__name:"p2-screen-1",props:{panel:{type:Object,required:!0},greeting:{type:String}},setup(t){const{t:p}=g();return(x,e)=>{const a=b("panel-screen");return f(),i(a,{panel:t.panel},{header:s(()=>e[2]||(e[2]=[o(" Gazebo/Panel 2/Screen A ")])),content:s(()=>[o(r(u(p)("gz.hello"))+" ",1),n("div",m,[n("button",{type:"button",onClick:e[0]||(e[0]=l=>t.panel.show({screen:"p-2-screen-2",props:{greeting:"Howdy?"}})),class:"bg-green-500 hover:bg-green-700 text-white font-bold py-8 px-16 m-2"}," Go back to B "),n("button",{type:"button",onClick:e[1]||(e[1]=l=>t.panel.show("p-2-screen-3")),class:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-8 px-16 m-2"}," Go to C ")]),n("p",h,r(t.greeting),1)]),_:1},8,["panel"])}}});export{w as default}; diff --git a/custom-toc-highlight/assets/panel-DET9aFON.js b/custom-toc-highlight/assets/panel-DET9aFON.js new file mode 100644 index 00000000..8f5a4e17 --- /dev/null +++ b/custom-toc-highlight/assets/panel-DET9aFON.js @@ -0,0 +1 @@ +import{_ as m}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";export{m as default}; diff --git a/custom-toc-highlight/assets/panel-DRUEhsxp-Bbd7sTo9.js b/custom-toc-highlight/assets/panel-DRUEhsxp-KxESJ732.js similarity index 95% rename from custom-toc-highlight/assets/panel-DRUEhsxp-Bbd7sTo9.js rename to custom-toc-highlight/assets/panel-DRUEhsxp-KxESJ732.js index f628d161..73f6b301 100644 --- a/custom-toc-highlight/assets/panel-DRUEhsxp-Bbd7sTo9.js +++ b/custom-toc-highlight/assets/panel-DRUEhsxp-KxESJ732.js @@ -1,4 +1,4 @@ -import{p as k,b as E,W as b,a as t,D as w}from"./themeUtils-YjM7iIiX-3_GiOEs2.js";import{G as r,V as C,g as z,A as x}from"./dom-N58V0tYi-DBU3jlah.js";import{l as H,p as F}from"./interactive-DqhNilgd-BPt2o3jA.js";import{o as B,r as P,f as T}from"./loadable-DbNDKH4r-D4CSNQAA.js";import{c as M}from"./observers-BigwqTsw-BNRQivHR.js";import{_ as L,K as D,O,w as I}from"./action-menu-DTIJuZNc-C8BNxu3_.js";import{K as j,q as K}from"./locale-Cn_GDVD_-Ar3RKmd3.js";import{d as $,h as N,M as R,l as W}from"./t9n-C_hcZMZJ-D4zmKT16.js";import{$ as _}from"./floating-ui-DKFFlLv3--KXNPa_R.js";import{m as U}from"./action-GCQoufcz-CK-V5fzo.js";import{m as q}from"./icon-BXFbBbop-BUyrjp8g.js";import{v as G}from"./loader-Ch7Jr16w-DUAf9YhQ.js";import{c as V}from"./scrim-BscQh4v9-DU79ospE.js";const n={actionBarContainer:"action-bar-container",backButton:"back-button",container:"container",contentBottom:"content-bottom",contentTop:"content-top",header:"header",headerContainer:"header-container",headerContainerBorderEnd:"header-container--border-end",heading:"heading",summary:"summary",description:"description",headerContent:"header-content",headerActions:"header-actions",headerActionsEnd:"header-actions--end",headerActionsStart:"header-actions--start",contentWrapper:"content-wrapper",fabContainer:"fab-container",footer:"footer",footerContent:"footer-content",footerActions:"footer-actions",footerStart:"footer-start",footerEnd:"footer-end"},S={close:"close",collapse:"collapse"},g={close:"x",menu:"ellipsis",backLeft:"chevron-left",backRight:"chevron-right",expand:"chevron-down",collapse:"chevron-up"},s={actionBar:"action-bar",alerts:"alerts",contentBottom:"content-bottom",contentTop:"content-top",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerEnd:"footer-end",footerStart:"footer-start",footerActions:"footer-actions"},X=`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;overflow:hidden;--calcite-min-header-height:calc(var(--calcite-icon-size) * 3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-color-text-2);color:var(--calcite-color-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}:host([scale=s]){--calcite-internal-panel-default-padding:var(--calcite-spacing-sm);--calcite-internal-panel-header-vertical-padding:10px}:host([scale=s]) .header-content .heading{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=s]) .header-content .description{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]){--calcite-internal-panel-default-padding:var(--calcite-spacing-md);--calcite-internal-panel-header-vertical-padding:var(--calcite-spacing-lg)}:host([scale=m]) .header-content .heading{font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m]) .header-content .description{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){--calcite-internal-panel-default-padding:var(--calcite-spacing-xl);--calcite-internal-panel-header-vertical-padding:var(--calcite-spacing-xxl)}:host([scale=l]) .header-content .heading{font-size:var(--calcite-font-size-1);line-height:1.5rem}:host([scale=l]) .header-content .description{font-size:var(--calcite-font-size-0);line-height:1.25rem}.content-top,.content-bottom{display:flex;align-items:flex-start;align-self:stretch;border-block-start:1px solid var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.container{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;background-color:var(--calcite-color-background);padding:0px;transition:max-block-size var(--calcite-animation-timing), inline-size var(--calcite-animation-timing)}.container[hidden]{display:none}.header{z-index:var(--calcite-z-index-header);display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1);border-block-end:var(--calcite-panel-header-border-block-end, 1px solid var(--calcite-color-border-3))}.header-container{display:flex;inline-size:100%;flex-direction:row;align-items:stretch;justify-content:flex-start;flex:0 0 auto}.header-container--border-end{border-block-end:1px solid var(--calcite-color-border-3)}.action-bar-container{inline-size:100%}.action-bar-container ::slotted(calcite-action-bar){inline-size:100%}.header-content{display:flex;flex-direction:column;overflow:hidden;padding-inline:0.75rem;padding-block:0.875rem;margin-inline-end:auto}.header-content .heading,.header-content .description{display:block;overflow-wrap:break-word;padding:0px}.header-content .heading{margin-inline:0px;margin-block:0px 0.25rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.header-content .heading:only-child{margin-block-end:0px}.header-content .description{color:var(--calcite-color-text-2)}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}.header-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch}.header-actions--end{margin-inline-start:auto}.content-wrapper{display:flex;block-size:100%;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;overflow:auto;outline-color:transparent;padding:var(--calcite-panel-content-space, 0);background:var(--calcite-panel-background-color, var(--calcite-color-background))}.content-wrapper:focus-visible{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( +import{p as k,b as E,W as b,a as t,D as w}from"./themeUtils-YjM7iIiX-DGrOr3vp.js";import{G as r,V as C,g as z,A as x}from"./dom-N58V0tYi-DBU3jlah.js";import{l as H,p as F}from"./interactive-DqhNilgd-BbTDbq0n.js";import{o as B,r as P,f as T}from"./loadable-DbNDKH4r-CSXrQx_7.js";import{c as M}from"./observers-BigwqTsw-CfIXp3Nz.js";import{_ as L,K as D,O,w as I}from"./action-menu-DTIJuZNc-DnQvHied.js";import{K as j,q as K}from"./locale-Cn_GDVD_-CCUxSwPB.js";import{d as $,h as N,M as R,l as W}from"./t9n-C_hcZMZJ-Du2NPCXI.js";import{$ as _}from"./floating-ui-DKFFlLv3-8lk8tQD2.js";import{m as U}from"./action-GCQoufcz-DQvoWHlv.js";import{m as q}from"./icon-BXFbBbop-Bq4Zv26A.js";import{v as G}from"./loader-Ch7Jr16w-CF4bv9QO.js";import{c as V}from"./scrim-BscQh4v9-CloQFru7.js";const n={actionBarContainer:"action-bar-container",backButton:"back-button",container:"container",contentBottom:"content-bottom",contentTop:"content-top",header:"header",headerContainer:"header-container",headerContainerBorderEnd:"header-container--border-end",heading:"heading",summary:"summary",description:"description",headerContent:"header-content",headerActions:"header-actions",headerActionsEnd:"header-actions--end",headerActionsStart:"header-actions--start",contentWrapper:"content-wrapper",fabContainer:"fab-container",footer:"footer",footerContent:"footer-content",footerActions:"footer-actions",footerStart:"footer-start",footerEnd:"footer-end"},S={close:"close",collapse:"collapse"},g={close:"x",menu:"ellipsis",backLeft:"chevron-left",backRight:"chevron-right",expand:"chevron-down",collapse:"chevron-up"},s={actionBar:"action-bar",alerts:"alerts",contentBottom:"content-bottom",contentTop:"content-top",headerActionsStart:"header-actions-start",headerActionsEnd:"header-actions-end",headerMenuActions:"header-menu-actions",headerContent:"header-content",fab:"fab",footer:"footer",footerEnd:"footer-end",footerStart:"footer-start",footerActions:"footer-actions"},X=`:host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:flex;block-size:100%;inline-size:100%;flex:1 1 auto;overflow:hidden;--calcite-min-header-height:calc(var(--calcite-icon-size) * 3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-color-text-2);color:var(--calcite-color-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}:host([scale=s]){--calcite-internal-panel-default-padding:var(--calcite-spacing-sm);--calcite-internal-panel-header-vertical-padding:10px}:host([scale=s]) .header-content .heading{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=s]) .header-content .description{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]){--calcite-internal-panel-default-padding:var(--calcite-spacing-md);--calcite-internal-panel-header-vertical-padding:var(--calcite-spacing-lg)}:host([scale=m]) .header-content .heading{font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m]) .header-content .description{font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]){--calcite-internal-panel-default-padding:var(--calcite-spacing-xl);--calcite-internal-panel-header-vertical-padding:var(--calcite-spacing-xxl)}:host([scale=l]) .header-content .heading{font-size:var(--calcite-font-size-1);line-height:1.5rem}:host([scale=l]) .header-content .description{font-size:var(--calcite-font-size-0);line-height:1.25rem}.content-top,.content-bottom{display:flex;align-items:flex-start;align-self:stretch;border-block-start:1px solid var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.container{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;background-color:var(--calcite-color-background);padding:0px;transition:max-block-size var(--calcite-animation-timing), inline-size var(--calcite-animation-timing)}.container[hidden]{display:none}.header{z-index:var(--calcite-z-index-header);display:flex;flex-direction:column;background-color:var(--calcite-color-foreground-1);border-block-end:var(--calcite-panel-header-border-block-end, 1px solid var(--calcite-color-border-3))}.header-container{display:flex;inline-size:100%;flex-direction:row;align-items:stretch;justify-content:flex-start;flex:0 0 auto}.header-container--border-end{border-block-end:1px solid var(--calcite-color-border-3)}.action-bar-container{inline-size:100%}.action-bar-container ::slotted(calcite-action-bar){inline-size:100%}.header-content{display:flex;flex-direction:column;overflow:hidden;padding-inline:0.75rem;padding-block:0.875rem;margin-inline-end:auto}.header-content .heading,.header-content .description{display:block;overflow-wrap:break-word;padding:0px}.header-content .heading{margin-inline:0px;margin-block:0px 0.25rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.header-content .heading:only-child{margin-block-end:0px}.header-content .description{color:var(--calcite-color-text-2)}.back-button{border-width:0px;border-style:solid;border-color:var(--calcite-color-border-3);border-inline-end-width:1px}.header-actions{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch}.header-actions--end{margin-inline-start:auto}.content-wrapper{display:flex;block-size:100%;flex:1 1 auto;flex-direction:column;flex-wrap:nowrap;align-items:stretch;overflow:auto;outline-color:transparent;padding:var(--calcite-panel-content-space, 0);background:var(--calcite-panel-background-color, var(--calcite-color-background))}.content-wrapper:focus-visible{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc( -2px * calc( 1 - diff --git a/custom-toc-highlight/assets/panel-DyBVvGsg.js b/custom-toc-highlight/assets/panel-DyBVvGsg.js deleted file mode 100644 index 4d01c25e..00000000 --- a/custom-toc-highlight/assets/panel-DyBVvGsg.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as m}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";export{m as default}; diff --git a/custom-toc-highlight/assets/parser-DyDJ-rlI-C9jRH52J.js b/custom-toc-highlight/assets/parser-DyDJ-rlI-CvOs11Ip.js similarity index 98% rename from custom-toc-highlight/assets/parser-DyDJ-rlI-C9jRH52J.js rename to custom-toc-highlight/assets/parser-DyDJ-rlI-CvOs11Ip.js index 58f1f9ac..8e6bebc2 100644 --- a/custom-toc-highlight/assets/parser-DyDJ-rlI-C9jRH52J.js +++ b/custom-toc-highlight/assets/parser-DyDJ-rlI-CvOs11Ip.js @@ -1,4 +1,4 @@ -import{o as b,ew as Te,ex as De,ey as Ze,ez as Be,es as He,eA as Le}from"./story-BfX8CRfG.js";import{o as $t}from"./mat4f32-CiZjBg9k-CUm34GoR.js";import{E as J,G as P}from"./mat4-DX7gBViE-DVqdGrVU.js";const Ue=(r,n)=>{const u=J(r,n,0,0,0,0,n,0,0,0,0,n,0,0,0,0,1);return P(u,u)},Qe=(r,n)=>{const u=J(r,n,0,0,.5-.5*n,0,n,0,.5-.5*n,0,0,n,.5-.5*n,0,0,0,1);return P(u,u)},Ve=(r,n)=>{const u=1-n,e=J(r,.2126+.7874*u,.7152-.7152*u,.0722-.0722*u,0,.2126-.2126*u,.7152+.2848*u,.0722-.0722*u,0,.2126-.2126*u,.7152-.7152*u,.0722+.9278*u,0,0,0,0,1);return P(e,e)},We=(r,n)=>{const u=Math.sin(n*Math.PI/180),e=Math.cos(n*Math.PI/180),f=J(r,.213+.787*e-.213*u,.715-.715*e-.715*u,.072-.072*e+.928*u,0,.213-.213*e+.143*u,.715+.285*e+.14*u,.072-.072*e-.283*u,0,.213-.213*e-.787*u,.715-.715*e+.715*u,.072+.928*e+.072*u,0,0,0,0,1);return P(f,f)},Ke=(r,n)=>{const u=1-2*n,e=J(r,u,0,0,n,0,u,0,n,0,0,u,n,0,0,0,1);return P(e,e)},tr=(r,n)=>{const u=J(r,.213+.787*n,.715-.715*n,.072-.072*n,0,.213-.213*n,.715+.285*n,.072-.072*n,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,1);return P(u,u)},er=(r,n)=>{const u=1-n,e=J(r,.393+.607*u,.769-.769*u,.189-.189*u,0,.349-.349*u,.686+.314*u,.168-.168*u,0,.272-.272*u,.534-.534*u,.131+.869*u,0,0,0,0,1);return P(e,e)};class B{constructor(n,u,e){this.strength=n,this.radius=u,this.threshold=e,this.type="bloom"}interpolate(n,u,e){this.strength=M(n.strength,u.strength,e),this.radius=M(n.radius,u.radius,e),this.threshold=M(n.threshold,u.threshold,e)}clone(){return new B(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:z(this.radius),strength:this.strength,threshold:this.threshold}}}let Ft=class Ct{constructor(n){this.radius=n,this.type="blur"}interpolate(n,u,e){this.radius=Math.round(M(n.radius,u.radius,e))}clone(){return new Ct(this.radius)}toJSON(){return{type:"blur",radius:z(this.radius)}}};class G{constructor(n,u){this.type=n,this.amount=u,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(n,u,e){this.amount=M(n.amount,u.amount,e),this._updateMatrix()}clone(){return new G(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const n=this._colorMatrix||$t();switch(this.type){case"brightness":this._colorMatrix=Ue(n,this.amount);break;case"contrast":this._colorMatrix=Qe(n,this.amount);break;case"grayscale":this._colorMatrix=Ve(n,this.amount);break;case"invert":this._colorMatrix=Ke(n,this.amount);break;case"saturate":this._colorMatrix=tr(n,this.amount);break;case"sepia":this._colorMatrix=er(n,this.amount)}}}let Et=class Ot{constructor(n,u,e,f){this.offsetX=n,this.offsetY=u,this.blurRadius=e,this.color=f,this.type="drop-shadow"}interpolate(n,u,e){this.offsetX=M(n.offsetX,u.offsetX,e),this.offsetY=M(n.offsetY,u.offsetY,e),this.blurRadius=M(n.blurRadius,u.blurRadius,e),this.color[0]=Math.round(M(n.color[0],u.color[0],e)),this.color[1]=Math.round(M(n.color[1],u.color[1],e)),this.color[2]=Math.round(M(n.color[2],u.color[2],e)),this.color[3]=M(n.color[3],u.color[3],e)}clone(){return new Ot(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const n=[...this.color];return n[3]*=255,{type:"drop-shadow",xoffset:z(this.offsetX),yoffset:z(this.offsetY),blurRadius:z(this.blurRadius),color:n}}},_t=class Rt{constructor(n){this.angle=n,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(n,u,e){this.angle=M(n.angle,u.angle,e),this._updateMatrix()}clone(){return new Rt(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const n=this._colorMatrix||$t();this._colorMatrix=We(n,this.angle)}};class H{constructor(n){this.amount=n,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(n,u,e){this.amount=M(n.amount,u.amount,e)}clone(){return new H(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}}function M(r,n,u){return r+(n-r)*u}function z(r){return Math.round(1e3*He(r))/1e3}function rr(r){switch(r.type){case"grayscale":case"sepia":case"invert":return new G(r.type,0);case"saturate":case"brightness":case"contrast":return new G(r.type,1);case"opacity":return new H(1);case"hue-rotate":return new _t(0);case"blur":return new Ft(0);case"drop-shadow":return new Et(0,0,0,[...Le("transparent")]);case"bloom":return new B(0,0,1)}}function nr(r,n){const u=r.length>n.length?r:n;return(r.length>n.length?n:r).every((e,f)=>e.type===u[f].type)}function or(r,n){const u=r.length>n.length?r:n,e=r.length>n.length?n:r;for(let f=e.length;fn?r:(n-=r.length,r+(u+=u.repeat(n)).slice(0,n))}function ar(r,n){var u,e={},f=(n=n!==void 0?n:{}).grammarSource,F={start:bt},k=bt,N="none",Y=")",p=",",d="(",C="%",v="px",et="cm",rt="mm",nt="in",ot="pt",ut="pc",at="deg",st="rad",it="grad",ct="turn",kt="#",Nt=".",Jt="e",lt=/^[ \t\n\r]/,ft=/^[a-z\-]/,ht=/^[0-9a-fA-F]/,pt=/^[+\-]/,R=/^[0-9]/,Pt=_("none"),Yt=w("none",!1),It=w(")",!1),mt=w(",",!1),Xt=_("whitespace"),gt=q([" "," ",` +import{o as b,ew as Te,ex as De,ey as Ze,ez as Be,es as He,eA as Le}from"./story-Doly9N9p.js";import{o as $t}from"./mat4f32-CiZjBg9k-CUm34GoR.js";import{E as J,G as P}from"./mat4-DX7gBViE-6clJxb1Q.js";const Ue=(r,n)=>{const u=J(r,n,0,0,0,0,n,0,0,0,0,n,0,0,0,0,1);return P(u,u)},Qe=(r,n)=>{const u=J(r,n,0,0,.5-.5*n,0,n,0,.5-.5*n,0,0,n,.5-.5*n,0,0,0,1);return P(u,u)},Ve=(r,n)=>{const u=1-n,e=J(r,.2126+.7874*u,.7152-.7152*u,.0722-.0722*u,0,.2126-.2126*u,.7152+.2848*u,.0722-.0722*u,0,.2126-.2126*u,.7152-.7152*u,.0722+.9278*u,0,0,0,0,1);return P(e,e)},We=(r,n)=>{const u=Math.sin(n*Math.PI/180),e=Math.cos(n*Math.PI/180),f=J(r,.213+.787*e-.213*u,.715-.715*e-.715*u,.072-.072*e+.928*u,0,.213-.213*e+.143*u,.715+.285*e+.14*u,.072-.072*e-.283*u,0,.213-.213*e-.787*u,.715-.715*e+.715*u,.072+.928*e+.072*u,0,0,0,0,1);return P(f,f)},Ke=(r,n)=>{const u=1-2*n,e=J(r,u,0,0,n,0,u,0,n,0,0,u,n,0,0,0,1);return P(e,e)},tr=(r,n)=>{const u=J(r,.213+.787*n,.715-.715*n,.072-.072*n,0,.213-.213*n,.715+.285*n,.072-.072*n,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,1);return P(u,u)},er=(r,n)=>{const u=1-n,e=J(r,.393+.607*u,.769-.769*u,.189-.189*u,0,.349-.349*u,.686+.314*u,.168-.168*u,0,.272-.272*u,.534-.534*u,.131+.869*u,0,0,0,0,1);return P(e,e)};class B{constructor(n,u,e){this.strength=n,this.radius=u,this.threshold=e,this.type="bloom"}interpolate(n,u,e){this.strength=M(n.strength,u.strength,e),this.radius=M(n.radius,u.radius,e),this.threshold=M(n.threshold,u.threshold,e)}clone(){return new B(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:z(this.radius),strength:this.strength,threshold:this.threshold}}}let Ft=class Ct{constructor(n){this.radius=n,this.type="blur"}interpolate(n,u,e){this.radius=Math.round(M(n.radius,u.radius,e))}clone(){return new Ct(this.radius)}toJSON(){return{type:"blur",radius:z(this.radius)}}};class G{constructor(n,u){this.type=n,this.amount=u,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(n,u,e){this.amount=M(n.amount,u.amount,e),this._updateMatrix()}clone(){return new G(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const n=this._colorMatrix||$t();switch(this.type){case"brightness":this._colorMatrix=Ue(n,this.amount);break;case"contrast":this._colorMatrix=Qe(n,this.amount);break;case"grayscale":this._colorMatrix=Ve(n,this.amount);break;case"invert":this._colorMatrix=Ke(n,this.amount);break;case"saturate":this._colorMatrix=tr(n,this.amount);break;case"sepia":this._colorMatrix=er(n,this.amount)}}}let Et=class Ot{constructor(n,u,e,f){this.offsetX=n,this.offsetY=u,this.blurRadius=e,this.color=f,this.type="drop-shadow"}interpolate(n,u,e){this.offsetX=M(n.offsetX,u.offsetX,e),this.offsetY=M(n.offsetY,u.offsetY,e),this.blurRadius=M(n.blurRadius,u.blurRadius,e),this.color[0]=Math.round(M(n.color[0],u.color[0],e)),this.color[1]=Math.round(M(n.color[1],u.color[1],e)),this.color[2]=Math.round(M(n.color[2],u.color[2],e)),this.color[3]=M(n.color[3],u.color[3],e)}clone(){return new Ot(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const n=[...this.color];return n[3]*=255,{type:"drop-shadow",xoffset:z(this.offsetX),yoffset:z(this.offsetY),blurRadius:z(this.blurRadius),color:n}}},_t=class Rt{constructor(n){this.angle=n,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(n,u,e){this.angle=M(n.angle,u.angle,e),this._updateMatrix()}clone(){return new Rt(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const n=this._colorMatrix||$t();this._colorMatrix=We(n,this.angle)}};class H{constructor(n){this.amount=n,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(n,u,e){this.amount=M(n.amount,u.amount,e)}clone(){return new H(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}}function M(r,n,u){return r+(n-r)*u}function z(r){return Math.round(1e3*He(r))/1e3}function rr(r){switch(r.type){case"grayscale":case"sepia":case"invert":return new G(r.type,0);case"saturate":case"brightness":case"contrast":return new G(r.type,1);case"opacity":return new H(1);case"hue-rotate":return new _t(0);case"blur":return new Ft(0);case"drop-shadow":return new Et(0,0,0,[...Le("transparent")]);case"bloom":return new B(0,0,1)}}function nr(r,n){const u=r.length>n.length?r:n;return(r.length>n.length?n:r).every((e,f)=>e.type===u[f].type)}function or(r,n){const u=r.length>n.length?r:n,e=r.length>n.length?n:r;for(let f=e.length;fn?r:(n-=r.length,r+(u+=u.repeat(n)).slice(0,n))}function ar(r,n){var u,e={},f=(n=n!==void 0?n:{}).grammarSource,F={start:bt},k=bt,N="none",Y=")",p=",",d="(",C="%",v="px",et="cm",rt="mm",nt="in",ot="pt",ut="pc",at="deg",st="rad",it="grad",ct="turn",kt="#",Nt=".",Jt="e",lt=/^[ \t\n\r]/,ft=/^[a-z\-]/,ht=/^[0-9a-fA-F]/,pt=/^[+\-]/,R=/^[0-9]/,Pt=_("none"),Yt=w("none",!1),It=w(")",!1),mt=w(",",!1),Xt=_("whitespace"),gt=q([" "," ",` `,"\r"],!1,!1),jt=_("function"),qt=w("(",!1),zt=_("identifier"),dt=q([["a","z"],"-"],!1,!1),Gt=_("percentage"),Tt=w("%",!1),Dt=_("length"),Zt=w("px",!1),Bt=w("cm",!1),Ht=w("mm",!1),Lt=w("in",!1),Ut=w("pt",!1),Qt=w("pc",!1),Vt=_("angle"),Wt=w("deg",!1),Kt=w("rad",!1),te=w("grad",!1),ee=w("turn",!1),re=_("number"),ne=_("color"),oe=w("#",!1),yt=q([["0","9"],["a","f"],["A","F"]],!1,!1),vt=q(["+","-"],!1,!1),S=q([["0","9"]],!1,!1),ue=w(".",!1),ae=w("e",!1),se=function(){return[]},ie=function(t,a){return{type:"function",name:t,parameters:a||[]}},ce=function(t,a){return a.length>0?Ge(t,a,3):[t]},le=function(t){return{type:"quantity",value:t.value,unit:t.unit}},fe=function(t){return{type:"color",colorType:t.type,value:t.value}},he=function(t){return t},pe=function(){return Z()},me=function(t){return{value:t,unit:"%"}},ge=function(t){return{value:t,unit:"px"}},de=function(t){return{value:t,unit:"cm"}},ye=function(t){return{value:t,unit:"mm"}},ve=function(t){return{value:t,unit:"in"}},we=function(t){return{value:t,unit:"pt"}},xe=function(t){return{value:t,unit:"pc"}},be=function(t){return{value:t,unit:"deg"}},Ae=function(t){return{value:t,unit:"rad"}},Me=function(t){return{value:t,unit:"grad"}},$e=function(t){return{value:t,unit:"turn"}},Fe=function(t){return{value:t,unit:null}},Ce=function(){return{type:"hex",value:Z()}},Ee=function(t){return{type:"function",value:t}},Oe=function(){return{type:"named",value:Z()}},_e=function(){return parseFloat(Z())},o=0|n.peg$currPos,m=o,I=[{line:1,column:1}],E=o,D=n.peg$maxFailExpected||[],i=0|n.peg$silentFails;if(n.startRule){if(!(n.startRule in F))throw new Error(`Can't start parsing from rule "`+n.startRule+'".');k=F[n.startRule]}function Z(){return r.substring(m,o)}function w(t,a){return{type:"literal",text:t,ignoreCase:a}}function q(t,a,s){return{type:"class",parts:t,inverted:a,ignoreCase:s}}function Re(){return{type:"end"}}function _(t){return{type:"other",description:t}}function wt(t){var a,s=I[t];if(s)return s;if(t>=I.length)a=I.length-1;else for(a=t;!I[--a];);for(s={line:(s=I[a]).line,column:s.column};aE&&(E=o,D=[]),D.push(t))}function Se(t,a,s){return new X(X.buildMessage(t,a),t,a,s)}function bt(){var t;return(t=ke())===e&&(t=Ne()),t}function ke(){var t,a;return i++,t=o,x(),r.substr(o,4)===N?(a=N,o+=4):(a=e,i===0&&l(Yt)),a!==e?(x(),m=t,t=se()):(o=t,t=e),i--,t===e&&i===0&&l(Pt),t}function Ne(){var t,a;if(t=[],(a=U())!==e)for(;a!==e;)t.push(a),a=U();else t=e;return t}function U(){var t,a,s,c;return t=o,x(),(a=Pe())!==e?(x(),(s=Je())===e&&(s=null),x(),r.charCodeAt(o)===41?(c=Y,o++):(c=e,i===0&&l(It)),c!==e?(x(),m=t,t=ie(a,s)):(o=t,t=e)):(o=t,t=e),t}function Je(){var t,a,s,c,h,g,y,A;if(t=o,(a=Q())!==e){for(s=[],c=o,h=x(),r.charCodeAt(o)===44?(g=p,o++):(g=e,i===0&&l(mt)),g===e&&(g=null),y=x(),(A=Q())!==e?c=h=[h,g,y,A]:(o=c,c=e);c!==e;)s.push(c),c=o,h=x(),r.charCodeAt(o)===44?(g=p,o++):(g=e,i===0&&l(mt)),g===e&&(g=null),y=x(),(A=Q())!==e?c=h=[h,g,y,A]:(o=c,c=e);m=t,t=ce(a,s)}else o=t,t=e;return t}function Q(){var t,a;return t=o,(a=Ye())===e&&(a=Ie())===e&&(a=Xe())===e&&(a=je()),a!==e&&(m=t,a=le(a)),(t=a)===e&&(t=o,(a=qe())!==e&&(m=t,a=fe(a)),t=a),t}function x(){var t,a;for(i++,t=[],a=r.charAt(o),lt.test(a)?o++:(a=e,i===0&&l(gt));a!==e;)t.push(a),a=r.charAt(o),lt.test(a)?o++:(a=e,i===0&&l(gt));return i--,a=e,i===0&&l(Xt),t}function Pe(){var t,a,s;return i++,t=o,(a=At())!==e?(r.charCodeAt(o)===40?(s=d,o++):(s=e,i===0&&l(qt)),s!==e?(m=t,t=he(a)):(o=t,t=e)):(o=t,t=e),i--,t===e&&(a=e,i===0&&l(jt)),t}function At(){var t,a,s;if(i++,t=o,a=[],s=r.charAt(o),ft.test(s)?o++:(s=e,i===0&&l(dt)),s!==e)for(;s!==e;)a.push(s),s=r.charAt(o),ft.test(s)?o++:(s=e,i===0&&l(dt));else a=e;return a!==e&&(m=t,a=pe()),i--,(t=a)===e&&(a=e,i===0&&l(zt)),t}function Ye(){var t,a,s;return i++,t=o,x(),(a=$())!==e?(r.charCodeAt(o)===37?(s=C,o++):(s=e,i===0&&l(Tt)),s!==e?(m=t,t=me(a)):(o=t,t=e)):(o=t,t=e),i--,t===e&&i===0&&l(Gt),t}function Ie(){var t,a,s;return i++,t=o,x(),(a=$())!==e?(r.substr(o,2)===v?(s=v,o+=2):(s=e,i===0&&l(Zt)),s!==e?(m=t,t=ge(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===et?(s=et,o+=2):(s=e,i===0&&l(Bt)),s!==e?(m=t,t=de(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===rt?(s=rt,o+=2):(s=e,i===0&&l(Ht)),s!==e?(m=t,t=ye(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===nt?(s=nt,o+=2):(s=e,i===0&&l(Lt)),s!==e?(m=t,t=ve(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===ot?(s=ot,o+=2):(s=e,i===0&&l(Ut)),s!==e?(m=t,t=we(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,x(),(a=$())!==e?(r.substr(o,2)===ut?(s=ut,o+=2):(s=e,i===0&&l(Qt)),s!==e?(m=t,t=xe(a)):(o=t,t=e)):(o=t,t=e)))))),i--,t===e&&i===0&&l(Dt),t}function Xe(){var t,a,s;return i++,t=o,(a=$())!==e?(r.substr(o,3)===at?(s=at,o+=3):(s=e,i===0&&l(Wt)),s!==e?(m=t,t=be(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,(a=$())!==e?(r.substr(o,3)===st?(s=st,o+=3):(s=e,i===0&&l(Kt)),s!==e?(m=t,t=Ae(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,(a=$())!==e?(r.substr(o,4)===it?(s=it,o+=4):(s=e,i===0&&l(te)),s!==e?(m=t,t=Me(a)):(o=t,t=e)):(o=t,t=e),t===e&&(t=o,(a=$())!==e?(r.substr(o,4)===ct?(s=ct,o+=4):(s=e,i===0&&l(ee)),s!==e?(m=t,t=$e(a)):(o=t,t=e)):(o=t,t=e)))),i--,t===e&&(a=e,i===0&&l(Vt)),t}function je(){var t,a;return i++,t=o,x(),(a=$())!==e?(m=t,t=Fe(a)):(o=t,t=e),i--,t===e&&i===0&&l(re),t}function qe(){var t,a,s,c;if(i++,t=o,r.charCodeAt(o)===35?(a=kt,o++):(a=e,i===0&&l(oe)),a!==e){if(s=[],c=r.charAt(o),ht.test(c)?o++:(c=e,i===0&&l(yt)),c!==e)for(;c!==e;)s.push(c),c=r.charAt(o),ht.test(c)?o++:(c=e,i===0&&l(yt));else s=e;s!==e?(m=t,t=Ce()):(o=t,t=e)}else o=t,t=e;return t===e&&(t=o,(a=U())!==e&&(m=t,a=Ee(a)),(t=a)===e&&(t=o,(a=At())!==e&&(m=t,a=Oe()),t=a)),i--,t===e&&(a=e,i===0&&l(ne)),t}function $(){var t,a,s,c,h,g,y,A;for(t=o,a=r.charAt(o),pt.test(a)?o++:(a=e,i===0&&l(vt)),a===e&&(a=null),s=o,c=[],h=r.charAt(o),R.test(h)?o++:(h=e,i===0&&l(S));h!==e;)c.push(h),h=r.charAt(o),R.test(h)?o++:(h=e,i===0&&l(S));if(r.charCodeAt(o)===46?(h=Nt,o++):(h=e,i===0&&l(ue)),h!==e){if(g=[],y=r.charAt(o),R.test(y)?o++:(y=e,i===0&&l(S)),y!==e)for(;y!==e;)g.push(y),y=r.charAt(o),R.test(y)?o++:(y=e,i===0&&l(S));else g=e;g!==e?s=c=[c,h,g]:(o=s,s=e)}else o=s,s=e;if(s===e)if(s=[],c=r.charAt(o),R.test(c)?o++:(c=e,i===0&&l(S)),c!==e)for(;c!==e;)s.push(c),c=r.charAt(o),R.test(c)?o++:(c=e,i===0&&l(S));else s=e;if(s!==e){if(c=o,r.charCodeAt(o)===101?(h=Jt,o++):(h=e,i===0&&l(ae)),h!==e){if(g=r.charAt(o),pt.test(g)?o++:(g=e,i===0&&l(vt)),g===e&&(g=null),y=[],A=r.charAt(o),R.test(A)?o++:(A=e,i===0&&l(S)),A!==e)for(;A!==e;)y.push(A),A=r.charAt(o),R.test(A)?o++:(A=e,i===0&&l(S));else y=e;y!==e?c=h=[h,g,y]:(o=c,c=e)}else o=c,c=e;c===e&&(c=null),m=t,t=_e()}else o=t,t=e;return t}function ze(t,a){return t.map(function(s){return s[a]})}function Ge(t,a,s){return[t].concat(ze(a,s))}if(u=k(),n.peg$library)return{peg$result:u,peg$currPos:o,peg$FAILED:e,peg$maxFailExpected:D,peg$maxFailPos:E};if(u!==e&&o===r.length)return u;throw u!==e&&o{if(!Number.isFinite(u.scale)||u.scale<=0)throw new b("effect:invalid-scale","scale must be finite and greater than 0",{stop:u});return{scale:u.scale,effects:Mt(u.value)}});n.sort((u,e)=>e.effects.length-u.effects.length);for(let u=0;ue.scale-u.scale),n}function Mt(r){let n;if(!r)return[];try{n=ar(r)}catch(u){throw new b("effect:invalid-syntax","Invalid effect syntax",{value:r,error:u})}return n.map(u=>sr(u))}function sr(r){try{switch(r.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return ir(r);case"opacity":return cr(r);case"hue-rotate":return lr(r);case"blur":return fr(r);case"drop-shadow":return hr(r);case"bloom":return pr(r)}}catch(n){throw n.details.filter=r,n}throw new b("effect:unknown-effect",`Effect '${r.name}' is not supported`,{effect:r})}function ir(r){let n=1;return j(r.parameters,1),r.parameters.length===1&&(n=O(r.parameters[0])),new G(r.name,n)}function cr(r){let n=1;return j(r.parameters,1),r.parameters.length===1&&(n=O(r.parameters[0])),new H(n)}function lr(r){let n=0;return j(r.parameters,1),r.parameters.length===1&&(n=wr(r.parameters[0])),new _t(n)}function fr(r){let n=0;return j(r.parameters,1),r.parameters.length===1&&(n=tt(r.parameters[0]),T(n,r.parameters[0])),new Ft(n)}function hr(r){const n=[];let u=null;for(const e of r.parameters)if(e.type==="color"){if(n.length&&Object.freeze(n),u)throw new b("effect:type-error","Accepts only one color",{});u=xr(e)}else{const f=tt(e);if(Object.isFrozen(n))throw new b("effect:type-error"," parameters not consecutive",{lengths:n});n.push(f),n.length===3&&T(f,e)}if(n.length<2||n.length>3)throw new b("effect:type-error",`Expected {2,3}, Actual: {${n.length}}`,{lengths:n});return new Et(n[0],n[1],n[2]||0,u||St("black"))}function pr(r){let n=1,u=0,e=0;return j(r.parameters,3),r.parameters[0]&&(n=O(r.parameters[0])),r.parameters[1]&&(u=tt(r.parameters[1]),T(u,r.parameters[1])),r.parameters[2]&&(e=O(r.parameters[2])),new B(n,u,e)}function j(r,n){if(r.length>n)throw new b("effect:type-error",`Function supports up to ${n} parameters, Actual: ${r.length}`,{parameters:r})}function L(r){if(r.type==="color")return"";if(r.unit){if(r.unit in K)return"";if(r.unit in W)return"";if(r.unit==="%")return""}return""}function T(r,n){if(r<0)throw new b("effect:type-error",`Negative values are not allowed, Actual: ${r}`,{term:n})}function mr(r){if(r.type!=="quantity"||r.unit!==null)throw new b("effect:type-error",`Expected , Actual: ${L(r)}`,{term:r})}function gr(r){if(r.type!=="quantity"||r.unit!==null&&r.unit!=="%")throw new b("effect:type-error",`Expected or , Actual: ${L(r)}`,{term:r})}ur(X,Error),X.prototype.format=function(r){var n="Error: "+this.message;if(this.location){var u,e=null;for(u=0;u `+k+` `+Y+` | diff --git a/custom-toc-highlight/assets/pbf-D-y3_eZO-DQKnyfOm.js b/custom-toc-highlight/assets/pbf-D-y3_eZO-CpHdkhuD.js similarity index 98% rename from custom-toc-highlight/assets/pbf-D-y3_eZO-DQKnyfOm.js rename to custom-toc-highlight/assets/pbf-D-y3_eZO-CpHdkhuD.js index d78995b2..1f390062 100644 --- a/custom-toc-highlight/assets/pbf-D-y3_eZO-DQKnyfOm.js +++ b/custom-toc-highlight/assets/pbf-D-y3_eZO-CpHdkhuD.js @@ -1 +1 @@ -import{K as d,dB as g}from"./story-BfX8CRfG.js";var h;(function(n){n[n.varint=0]="varint",n[n.fixed64=1]="fixed64",n[n.delimited=2]="delimited",n[n.fixed32=5]="fixed32",n[n.unknown=99]="unknown"})(h||(h={}));const p=4294967296,u=new TextDecoder("utf-8"),c=d("safari")||d("ios")?6:d("ff")?12:32;class o{constructor(t,e,i=0,s=t?t.byteLength:0){this._tag=0,this._dataType=h.unknown,this._init(t,e,i,s)}_init(t,e,i,s){this._data=t,this._dataView=e,this._pos=i,this._end=s}asUnsafe(){return this}clone(){return new o(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(t){this._pos=t}nextTag(t){for(;;){if(this._pos===this._end)return!1;const e=this._decodeVarint();if(this._tag=e>>3,this._dataType=7&e,!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;if(t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128||(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)||(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128))return t;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();return t>>>1^-(1&t)}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,e=this._pos,i=t.getUint32(e,!0)+t.getUint32(e+4,!0)*p;return this._skip(8),i}getSFixed64(){const t=this._dataView,e=this._pos,i=t.getUint32(e,!0)+t.getInt32(e+4,!0)*p;return this._skip(8),i}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(),e=this._pos,i=this._toString(this._data,e,e+t);return this._skip(t),i}getBytes(){const t=this._getLength(),e=this._pos,i=this._toBytes(this._data,e,e+t);return this._skip(t),i}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,e,i,s){const r=this.getMessage(),a=t(r,e,i,s);return r.release(),a}processMessage(t){const e=this.getMessage(),i=t(e);return e.release(),i}getMessage(){const t=this._getLength(),e=o.pool.acquire();return e._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),e}release(){o.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case h.varint:this._decodeVarint();break;case h.fixed64:this._skip(8);break;case h.delimited:this._skip(this._getLength());break;case h.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 e=this._pos,i=0,s=0;if(this._end-e>=10)do{if(s=t[e++],i|=127&s,!(128&s)||(s=t[e++],i|=(127&s)<<7,!(128&s))||(s=t[e++],i|=(127&s)<<14,!(128&s))||(s=t[e++],i|=(127&s)<<21,!(128&s))||(s=t[e++],i+=268435456*(127&s),!(128&s))||(s=t[e++],i+=34359738368*(127&s),!(128&s))||(s=t[e++],i+=4398046511104*(127&s),!(128&s))||(s=t[e++],i+=562949953421312*(127&s),!(128&s))||(s=t[e++],i+=72057594037927940*(127&s),!(128&s))||(s=t[e++],i+=9223372036854776e3*(127&s),!(128&s)))break;throw new Error("Varint too long!")}while(!1);else{let r=1;for(;e!==this._end&&(s=t[e],128&s);)++e,i+=(127&s)*r,r*=128;if(e===this._end)throw new Error("Varint overrun!");++e,i+=s*r}return this._pos=e,i}_decodeSVarint(){const t=this._data;let e,i=0,s=0;const r=1&t[this._pos];if(s=t[this._pos++],i|=127&s,!(128&s)||(s=t[this._pos++],i|=(127&s)<<7,!(128&s))||(s=t[this._pos++],i|=(127&s)<<14,!(128&s))||(s=t[this._pos++],i|=(127&s)<<21,!(128&s))||(s=t[this._pos++],i+=268435456*(127&s),!(128&s))||(s=t[this._pos++],i+=34359738368*(127&s),!(128&s))||(s=t[this._pos++],i+=4398046511104*(127&s),!(128&s)))return r?-(i+1)/2:i/2;if(e=BigInt(i),s=t[this._pos++],e+=0x2000000000000n*BigInt(127&s),!(128&s)||(s=t[this._pos++],e+=0x100000000000000n*BigInt(127&s),!(128&s))||(s=t[this._pos++],e+=0x8000000000000000n*BigInt(127&s),!(128&s)))return Number(r?-(e+1n)/2n:e/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==h.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(t,e,i){if((i=Math.min(this._end,i))-e>c){const a=t.subarray(e,i);return u.decode(a)}let s="",r="";for(let a=e;a{n._data=null,n._dataView=null});export{o}; +import{K as d,dB as g}from"./story-Doly9N9p.js";var h;(function(n){n[n.varint=0]="varint",n[n.fixed64=1]="fixed64",n[n.delimited=2]="delimited",n[n.fixed32=5]="fixed32",n[n.unknown=99]="unknown"})(h||(h={}));const p=4294967296,u=new TextDecoder("utf-8"),c=d("safari")||d("ios")?6:d("ff")?12:32;class o{constructor(t,e,i=0,s=t?t.byteLength:0){this._tag=0,this._dataType=h.unknown,this._init(t,e,i,s)}_init(t,e,i,s){this._data=t,this._dataView=e,this._pos=i,this._end=s}asUnsafe(){return this}clone(){return new o(this._data,this._dataView,this._pos,this._end)}pos(){return this._pos}move(t){this._pos=t}nextTag(t){for(;;){if(this._pos===this._end)return!1;const e=this._decodeVarint();if(this._tag=e>>3,this._dataType=7&e,!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;if(t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128||(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128)||(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128)||(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128))return t;throw new Error("Varint overflow")}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();return t>>>1^-(1&t)}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,e=this._pos,i=t.getUint32(e,!0)+t.getUint32(e+4,!0)*p;return this._skip(8),i}getSFixed64(){const t=this._dataView,e=this._pos,i=t.getUint32(e,!0)+t.getInt32(e+4,!0)*p;return this._skip(8),i}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(),e=this._pos,i=this._toString(this._data,e,e+t);return this._skip(t),i}getBytes(){const t=this._getLength(),e=this._pos,i=this._toBytes(this._data,e,e+t);return this._skip(t),i}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,e,i,s){const r=this.getMessage(),a=t(r,e,i,s);return r.release(),a}processMessage(t){const e=this.getMessage(),i=t(e);return e.release(),i}getMessage(){const t=this._getLength(),e=o.pool.acquire();return e._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),e}release(){o.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case h.varint:this._decodeVarint();break;case h.fixed64:this._skip(8);break;case h.delimited:this._skip(this._getLength());break;case h.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 e=this._pos,i=0,s=0;if(this._end-e>=10)do{if(s=t[e++],i|=127&s,!(128&s)||(s=t[e++],i|=(127&s)<<7,!(128&s))||(s=t[e++],i|=(127&s)<<14,!(128&s))||(s=t[e++],i|=(127&s)<<21,!(128&s))||(s=t[e++],i+=268435456*(127&s),!(128&s))||(s=t[e++],i+=34359738368*(127&s),!(128&s))||(s=t[e++],i+=4398046511104*(127&s),!(128&s))||(s=t[e++],i+=562949953421312*(127&s),!(128&s))||(s=t[e++],i+=72057594037927940*(127&s),!(128&s))||(s=t[e++],i+=9223372036854776e3*(127&s),!(128&s)))break;throw new Error("Varint too long!")}while(!1);else{let r=1;for(;e!==this._end&&(s=t[e],128&s);)++e,i+=(127&s)*r,r*=128;if(e===this._end)throw new Error("Varint overrun!");++e,i+=s*r}return this._pos=e,i}_decodeSVarint(){const t=this._data;let e,i=0,s=0;const r=1&t[this._pos];if(s=t[this._pos++],i|=127&s,!(128&s)||(s=t[this._pos++],i|=(127&s)<<7,!(128&s))||(s=t[this._pos++],i|=(127&s)<<14,!(128&s))||(s=t[this._pos++],i|=(127&s)<<21,!(128&s))||(s=t[this._pos++],i+=268435456*(127&s),!(128&s))||(s=t[this._pos++],i+=34359738368*(127&s),!(128&s))||(s=t[this._pos++],i+=4398046511104*(127&s),!(128&s)))return r?-(i+1)/2:i/2;if(e=BigInt(i),s=t[this._pos++],e+=0x2000000000000n*BigInt(127&s),!(128&s)||(s=t[this._pos++],e+=0x100000000000000n*BigInt(127&s),!(128&s))||(s=t[this._pos++],e+=0x8000000000000000n*BigInt(127&s),!(128&s)))return Number(r?-(e+1n)/2n:e/2n);throw new Error("Varint too long!")}_getLength(){if(this._dataType!==h.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(t,e,i){if((i=Math.min(this._end,i))-e>c){const a=t.subarray(e,i);return u.decode(a)}let s="",r="";for(let a=e;a{n._data=null,n._dataView=null});export{o}; diff --git a/custom-toc-highlight/assets/pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js b/custom-toc-highlight/assets/pbfQueryUtils-F4ZE8-K8-vP84FrXE.js similarity index 98% rename from custom-toc-highlight/assets/pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js rename to custom-toc-highlight/assets/pbfQueryUtils-F4ZE8-K8-vP84FrXE.js index 9515508c..cafbcc9b 100644 --- a/custom-toc-highlight/assets/pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js +++ b/custom-toc-highlight/assets/pbfQueryUtils-F4ZE8-K8-vP84FrXE.js @@ -1 +1 @@ -import{aC as k,dh as u,o as m}from"./story-BfX8CRfG.js";import{o as T}from"./pbf-D-y3_eZO-DQKnyfOm.js";import{a as q,i as F,c as l}from"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import{t as I}from"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";const b=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"];let j=class{constructor(r){this._options=r,this.geometryTypes=b,this._coordinatePtr=0,this._vertexDimension=0}createFeatureResult(){return new I}prepareFeatures(r){this._vertexDimension=2,r.hasZ&&this._vertexDimension++,r.hasM&&this._vertexDimension++}finishFeatureResult(r){if(!r?.features||!r.hasZ||!this._options.sourceSpatialReference||!r.spatialReference||k(r.spatialReference,this._options.sourceSpatialReference)||r.spatialReference.vcsWkid)return;const e=u(this._options.sourceSpatialReference)/u(r.spatialReference);if(e!==1)for(const t of r.features){if(!q(t))continue;const s=t.geometry.coords;for(let a=2;ae+t,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(r,e){r.coords[this._coordinatePtr++]=e}addCoordinatePoint(r,e){r.coords.push(e)}addLength(r,e){r.lengths.push(e)}addQueryGeometry(r,e){r.queryGeometry=e.queryGeometry,r.queryGeometryType=e.queryGeometryType}createPointGeometry(){return new l}};const g=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],p=["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"],y=["upperLeft","lowerLeft"];function f(r){return r>=g.length?null:g[r]}function w(r){return r>=p.length?null:p[r]}function d(r){return r>=y.length?null:y[r]}function h(r,e){return e>=r.geometryTypes.length?null:r.geometryTypes[e]}function S(r,e,t){const s=r.asUnsafe(),a=e.createPointGeometry(t);for(;s.next();)switch(s.tag()){case 3:{const n=s.getUInt32(),o=s.pos()+n;let i=0;for(;s.pos()e+t,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(r,e){r.coords[this._coordinatePtr++]=e}addCoordinatePoint(r,e){r.coords.push(e)}addLength(r,e){r.lengths.push(e)}addQueryGeometry(r,e){r.queryGeometry=e.queryGeometry,r.queryGeometryType=e.queryGeometryType}createPointGeometry(){return new l}};const g=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeBigInteger","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],p=["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"],y=["upperLeft","lowerLeft"];function f(r){return r>=g.length?null:g[r]}function w(r){return r>=p.length?null:p[r]}function d(r){return r>=y.length?null:y[r]}function h(r,e){return e>=r.geometryTypes.length?null:r.geometryTypes[e]}function S(r,e,t){const s=r.asUnsafe(),a=e.createPointGeometry(t);for(;s.next();)switch(s.tag()){case 3:{const n=s.getUInt32(),o=s.pos()+n;let i=0;for(;s.pos(){const r=Y(e,o,n);for(const c of t){const i=I(o,c,n);for(const s in r)i[s]=r[s]}}}function Y(e,t,o){if(e?.type==="resource")return k(e,t,o);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:n,write:r}=C;return{read:n,write:r}}}}function k(e,t,o){const n=$(t,o);return{type:String,read:(r,c,i)=>{const s=N(r,c,i);return n.type===String?s:typeof n.type=="function"?new n.type({url:s}):void 0},write:{writer(r,c,i,s){if(!s?.resources)return typeof r=="string"?void(c[i]=h(r,s)):void(c[i]=r.write({},s));const p=E(r),a=h(p,{...s,verifyItemRelativeUrls:s?.verifyItemRelativeUrls?{writtenUrls:s.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},b.NO),d=n.type!==String&&(!J(this)||s?.origin&&this.originIdOf(o)>A(s.origin)),u={object:this,propertyName:o,value:r,targetUrl:a,dest:c,targetPropertyName:i,context:s,params:e};s?.portalItem&&a&&!O(a)?d&&e?.contentAddressed?g(u):d?q(u):z(u):s?.portalItem&&(a==null||P(a)!=null||v(a)||d)?g(u):c[i]=a}}}}function g(e){const{targetUrl:t,params:o,value:n,context:r,dest:c,targetPropertyName:i}=e;if(!r.portalItem)return;const s=x(t),p=U(n,t,r);if(o?.contentAddressed&&p.type!=="json")return void r.messages?.push(new S("persistable:contentAddressingUnsupported",`Property "${i}" is trying to serializing a resource with content of type ${p.type} with content addressing. Content addressing is only supported for json resources.`,{content:p}));const a=o?.contentAddressed&&p.type==="json"?D(p.jsonString):s?.filename??K(),d=R(o?.prefix??s?.prefix,a),u=`${d}.${y(p)}`;if(o?.contentAddressed&&r.resources&&p.type==="json"){const f=r.resources.toKeep.find(({resource:m})=>m.path===u)??r.resources.toAdd.find(({resource:m})=>m.path===u);if(f)return void(c[i]=f.resource.itemRelativeUrl)}const l=r.portalItem.resourceFromPath(u);v(t)&&r.resources&&r.resources.pendingOperations.push(B(t).then(f=>{l.path=`${d}.${y({type:"blob",blob:f})}`,c[i]=l.itemRelativeUrl}).catch(()=>{}));const w=o?.compress??!1;r.resources&&j({...e,resource:l,content:p,compress:w,updates:r.resources.toAdd}),c[i]=l.itemRelativeUrl}function q(e){const{context:t,targetUrl:o,params:n,value:r,dest:c,targetPropertyName:i}=e;if(!t.portalItem)return;const s=t.portalItem.resourceFromPath(o),p=U(r,o,t),a=y(p),d=F(s.path),u=n?.compress??!1;a===d?(t.resources&&j({...e,resource:s,content:p,compress:u,updates:t.resources.toUpdate}),c[i]=o):g(e)}function z({context:e,targetUrl:t,dest:o,targetPropertyName:n}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),o[n]=t)}function j({object:e,propertyName:t,updates:o,resource:n,content:r,compress:c}){const i=s=>{G(e,t,s)};o.push({resource:n,content:r,compress:c,finish:i})}function U(e,t,o){return typeof e=="string"?{type:"url",url:t}:{type:"json",jsonString:JSON.stringify(e.toJSON(o))}}function E(e){return e==null?null:typeof e=="string"?e:e.url}function G(e,t,o){typeof e[t]=="string"?e[t]=o.url:e[t].url=o.url}export{L as C}; +import{jA as I,jB as $,jy as N,dY as h,jC as b,bO as A,cx as O,jD as P,cO as v,jE as x,o as S,bX as R,jF as B,gF as F,jG as C}from"./story-Doly9N9p.js";import{k as D}from"./MD5-CHHr-oed-SuyrCYQ0.js";import{n as J}from"./multiOriginJSONSupportUtils-DGETddQl-BrWaY9_8.js";import{r as K}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{e as y}from"./resourceExtension-CdQvIDKV-DCvzsrJt.js";function L(e){const t=e?.origins??[void 0];return(o,n)=>{const r=Y(e,o,n);for(const c of t){const i=I(o,c,n);for(const s in r)i[s]=r[s]}}}function Y(e,t,o){if(e?.type==="resource")return k(e,t,o);switch(e?.type??"other"){case"other":return{read:!0,write:!0};case"url":{const{read:n,write:r}=C;return{read:n,write:r}}}}function k(e,t,o){const n=$(t,o);return{type:String,read:(r,c,i)=>{const s=N(r,c,i);return n.type===String?s:typeof n.type=="function"?new n.type({url:s}):void 0},write:{writer(r,c,i,s){if(!s?.resources)return typeof r=="string"?void(c[i]=h(r,s)):void(c[i]=r.write({},s));const p=E(r),a=h(p,{...s,verifyItemRelativeUrls:s?.verifyItemRelativeUrls?{writtenUrls:s.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},b.NO),d=n.type!==String&&(!J(this)||s?.origin&&this.originIdOf(o)>A(s.origin)),u={object:this,propertyName:o,value:r,targetUrl:a,dest:c,targetPropertyName:i,context:s,params:e};s?.portalItem&&a&&!O(a)?d&&e?.contentAddressed?g(u):d?q(u):z(u):s?.portalItem&&(a==null||P(a)!=null||v(a)||d)?g(u):c[i]=a}}}}function g(e){const{targetUrl:t,params:o,value:n,context:r,dest:c,targetPropertyName:i}=e;if(!r.portalItem)return;const s=x(t),p=U(n,t,r);if(o?.contentAddressed&&p.type!=="json")return void r.messages?.push(new S("persistable:contentAddressingUnsupported",`Property "${i}" is trying to serializing a resource with content of type ${p.type} with content addressing. Content addressing is only supported for json resources.`,{content:p}));const a=o?.contentAddressed&&p.type==="json"?D(p.jsonString):s?.filename??K(),d=R(o?.prefix??s?.prefix,a),u=`${d}.${y(p)}`;if(o?.contentAddressed&&r.resources&&p.type==="json"){const f=r.resources.toKeep.find(({resource:m})=>m.path===u)??r.resources.toAdd.find(({resource:m})=>m.path===u);if(f)return void(c[i]=f.resource.itemRelativeUrl)}const l=r.portalItem.resourceFromPath(u);v(t)&&r.resources&&r.resources.pendingOperations.push(B(t).then(f=>{l.path=`${d}.${y({type:"blob",blob:f})}`,c[i]=l.itemRelativeUrl}).catch(()=>{}));const w=o?.compress??!1;r.resources&&j({...e,resource:l,content:p,compress:w,updates:r.resources.toAdd}),c[i]=l.itemRelativeUrl}function q(e){const{context:t,targetUrl:o,params:n,value:r,dest:c,targetPropertyName:i}=e;if(!t.portalItem)return;const s=t.portalItem.resourceFromPath(o),p=U(r,o,t),a=y(p),d=F(s.path),u=n?.compress??!1;a===d?(t.resources&&j({...e,resource:s,content:p,compress:u,updates:t.resources.toUpdate}),c[i]=o):g(e)}function z({context:e,targetUrl:t,dest:o,targetPropertyName:n}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),o[n]=t)}function j({object:e,propertyName:t,updates:o,resource:n,content:r,compress:c}){const i=s=>{G(e,t,s)};o.push({resource:n,content:r,compress:c,finish:i})}function U(e,t,o){return typeof e=="string"?{type:"url",url:t}:{type:"json",jsonString:JSON.stringify(e.toJSON(o))}}function E(e){return e==null?null:typeof e=="string"?e:e.url}function G(e,t,o){typeof e[t]=="string"?e[t]=o.url:e[t].url=o.url}export{L as C}; diff --git a/custom-toc-highlight/assets/perspectiveUtils-Bu88xlbg-DGihQXe_.js b/custom-toc-highlight/assets/perspectiveUtils-Bu88xlbg-Cn6YpKwC.js similarity index 84% rename from custom-toc-highlight/assets/perspectiveUtils-Bu88xlbg-DGihQXe_.js rename to custom-toc-highlight/assets/perspectiveUtils-Bu88xlbg-Cn6YpKwC.js index 18cc3abc..46090cac 100644 --- a/custom-toc-highlight/assets/perspectiveUtils-Bu88xlbg-DGihQXe_.js +++ b/custom-toc-highlight/assets/perspectiveUtils-Bu88xlbg-Cn6YpKwC.js @@ -1 +1 @@ -import{v as l,S as s,i as R,j as S,gH as p,l as k,dg as D}from"./story-BfX8CRfG.js";import{V as G}from"./projection-BA9M1R7d-BYoCXVXt.js";import{G as H}from"./normalizeUtilsSync-CBU7m8rm-DxyEIjGF.js";import{V as g,E as y,w as z,Q as d}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as m}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as a}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{_ as x,Z as h}from"./vec32-D9GsKZ1t-BjayBdwt.js";let e=class extends S{constructor(o){super(o)}get bounds(){const o=this.coords;return o?.extent==null?null:p(o.extent)}get coords(){const o=this.element.georeference?.coords;return G(o,this.spatialReference).geometry}get normalizedCoords(){return k.fromJSON(H(this.coords))}get normalizedBounds(){const o=this.normalizedCoords!=null?this.normalizedCoords.extent:null;return o!=null?p(o):null}};l([s()],e.prototype,"spatialReference",void 0),l([s()],e.prototype,"element",void 0),l([s()],e.prototype,"bounds",null),l([s()],e.prototype,"coords",null),l([s()],e.prototype,"normalizedCoords",null),l([s()],e.prototype,"normalizedBounds",null),e=l([R("esri.layers.support.MediaElementView")],e);const t=D(),i=m(),u=m(),c=m();function $(o,r,n){return x(t,r[0],r[1],1),h(t,t,g(i,n)),t[2]===0?a(o,t[0],t[1]):a(o,t[0]/t[2],t[1]/t[2])}function q(o,r,n){return f(u,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]),f(c,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),y(o,z(u,u),c),o[8]!==0&&(o[0]/=o[8],o[1]/=o[8],o[2]/=o[8],o[3]/=o[8],o[4]/=o[8],o[5]/=o[8],o[6]/=o[8],o[7]/=o[8],o[8]/=o[8]),o}function f(o,r,n,v,C,j,B,V,b){d(o,r,v,j,n,C,B,1,1,1),x(t,V,b,1),z(i,o);const[w,E,M]=h(t,t,g(i,i));return d(i,w,0,0,0,E,0,0,0,M),y(o,i,o)}export{$ as K,q as M,e as o}; +import{v as l,S as s,i as R,j as S,gH as p,l as k,dg as D}from"./story-Doly9N9p.js";import{V as G}from"./projection-BA9M1R7d-CAbqHZiw.js";import{G as H}from"./normalizeUtilsSync-CBU7m8rm-BXXPEsd8.js";import{V as g,E as y,w as z,Q as d}from"./mat3-CC4Foazl-BWjyqE2v.js";import{n as m}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{m as a}from"./vec2-tHZ6OaOy-xCj1obDt.js";import{_ as x,Z as h}from"./vec32-D9GsKZ1t-BPSFE14A.js";let e=class extends S{constructor(o){super(o)}get bounds(){const o=this.coords;return o?.extent==null?null:p(o.extent)}get coords(){const o=this.element.georeference?.coords;return G(o,this.spatialReference).geometry}get normalizedCoords(){return k.fromJSON(H(this.coords))}get normalizedBounds(){const o=this.normalizedCoords!=null?this.normalizedCoords.extent:null;return o!=null?p(o):null}};l([s()],e.prototype,"spatialReference",void 0),l([s()],e.prototype,"element",void 0),l([s()],e.prototype,"bounds",null),l([s()],e.prototype,"coords",null),l([s()],e.prototype,"normalizedCoords",null),l([s()],e.prototype,"normalizedBounds",null),e=l([R("esri.layers.support.MediaElementView")],e);const t=D(),i=m(),u=m(),c=m();function $(o,r,n){return x(t,r[0],r[1],1),h(t,t,g(i,n)),t[2]===0?a(o,t[0],t[1]):a(o,t[0]/t[2],t[1]/t[2])}function q(o,r,n){return f(u,r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7]),f(c,n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7]),y(o,z(u,u),c),o[8]!==0&&(o[0]/=o[8],o[1]/=o[8],o[2]/=o[8],o[3]/=o[8],o[4]/=o[8],o[5]/=o[8],o[6]/=o[8],o[7]/=o[8],o[8]/=o[8]),o}function f(o,r,n,v,C,j,B,V,b){d(o,r,v,j,n,C,B,1,1,1),x(t,V,b,1),z(i,o);const[w,E,M]=h(t,t,g(i,i));return d(i,w,0,0,0,E,0,0,0,M),y(o,i,o)}export{$ as K,q as M,e as o}; diff --git a/custom-toc-highlight/assets/pieChart-qcxaoQkv-D93Sy6JQ.js b/custom-toc-highlight/assets/pieChart-qcxaoQkv-jYI0rZLi.js similarity index 98% rename from custom-toc-highlight/assets/pieChart-qcxaoQkv-D93Sy6JQ.js rename to custom-toc-highlight/assets/pieChart-qcxaoQkv-jYI0rZLi.js index 524e82a5..77c2c4c6 100644 --- a/custom-toc-highlight/assets/pieChart-qcxaoQkv-D93Sy6JQ.js +++ b/custom-toc-highlight/assets/pieChart-qcxaoQkv-jYI0rZLi.js @@ -1 +1 @@ -import{k0 as Q}from"./story-BfX8CRfG.js";import{B as Te,U as Le,A as je,u as Ie,n as M}from"./Tick-DUHqbpyB-DY4eRS4C.js";import{m as Ne,ap as Ce,V as Oe,at as v,am as Re,n as ae,ax as Me,aw as F,ay as pe,az as ye,ao as me,c as A,aA as H,aB as S,aC as ve,ai as Se,H as be,aD as Be,U as we,B as re,ar as Fe,s as He}from"./Theme-rblUnB2V-D2UsCNGl.js";import{i as Ve}from"./ColorSet-DkIwOmgs-C-GAktW1.js";import{o as Ye}from"./DefaultTheme-Bt5OI-Ht-Dfb13wye.js";import"./main-ugzBrWNm.js";class te extends Ne{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeRadialText("",this.textStyle)})}_afterNew(){super._afterNew()}_beforeChanged(){super._beforeChanged(),this._display.clear(),this.isDirty("textType")&&(this._display.textType=this.get("textType"),this.markDirtyBounds()),this.isDirty("radius")&&(this._display.radius=this.get("radius"),this.markDirtyBounds()),this.isDirty("startAngle")&&(this._display.startAngle=(this.get("startAngle",0)+90)*ve,this.markDirtyBounds()),this.isDirty("inside")&&(this._display.inside=this.get("inside"),this.markDirtyBounds()),this.isDirty("orientation")&&(this._display.orientation=this.get("orientation"),this.markDirtyBounds()),this.isDirty("kerning")&&(this._display.kerning=this.get("kerning"),this.markDirtyBounds())}}Object.defineProperty(te,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialText"}),Object.defineProperty(te,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ne.classNames.concat([te.className])});class ie extends Ce{constructor(){super(...arguments),Object.defineProperty(this,"_flipped",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._textKeys.push("textType","kerning"),super._afterNew()}_makeText(){this._text=this.children.push(te.new(this._root,{}))}baseRadius(){const t=this.getPrivate("radius",0),e=this.getPrivate("innerRadius",0),i=this.get("baseRadius",0);return e+F(i,t-e)}radius(){const t=this.get("inside",!1);return this.baseRadius()+this.get("radius",0)*(t?-1:1)}_updateChildren(){if(super._updateChildren(),this.isDirty("baseRadius")||this.isPrivateDirty("radius")||this.isPrivateDirty("innerRadius")||this.isDirty("labelAngle")||this.isDirty("radius")||this.isDirty("inside")||this.isDirty("orientation")||this.isDirty("textType")){const t=this.get("textType","adjusted"),e=this.get("inside",!1),i=this.get("orientation");let s=Se(this.get("labelAngle",0));this._text.set("startAngle",this.get("labelAngle",0)),this._text.set("inside",e);const r=S(s),l=H(s);let a=this.baseRadius(),y=this.radius();if(this._display.angle=0,t=="circular")this.setAll({paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}),this.setRaw("x",void 0),this.setRaw("y",void 0),this._text.set("orientation",i),this._text.set("radius",y);else{a==0&&(s=0,y=0);let o=y*l,n=y*r;t=="radial"?(this.setRaw("x",o),this.setRaw("y",n),s<90||s>270||i!="auto"?(this._display.angle=s,this._flipped=!1):(this._display.angle=s+180,this._flipped=!0),this._dirty.rotation=!1):t=="adjusted"?(this.setRaw("centerX",v),this.setRaw("centerY",v),this.setRaw("x",o),this.setRaw("y",n)):t=="regular"&&(this.setRaw("x",o),this.setRaw("y",n))}this.markDirtyPosition(),this.markDirtyBounds()}}_updatePosition(){const t=this.get("textType","regular"),e=this.get("inside",!1);let i=0,s=0,r=this.get("labelAngle",0),l=this.localBounds(),a=l.right-l.left,y=l.bottom-l.top;if(t=="radial"){if(this._flipped){let o=this.get("centerX");o instanceof ae&&(a*=1-2*o.value),i=a*H(r),s=a*S(r)}}else e||t!="adjusted"||(i=a/2*H(r),s=y/2*S(r));this.setRaw("dx",i),this.setRaw("dy",s),super._updatePosition()}get text(){return this._text}}Object.defineProperty(ie,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialLabel"}),Object.defineProperty(ie,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ce.classNames.concat([ie.className])});const Ae=Math.abs,_=Math.atan2,B=Math.cos,Xe=Math.max,fe=Math.min,C=Math.sin,q=Math.sqrt,x=1e-12,K=Math.PI,ne=K/2,ze=2*K;function We(d){return d>1?0:d<-1?K:Math.acos(d)}function Pe(d){return d>=1?ne:d<=-1?-ne:Math.asin(d)}function qe(d){return d.innerRadius}function Ee(d){return d.outerRadius}function Ue(d){return d.startAngle}function Ke(d){return d.endAngle}function $e(d){return d&&d.padAngle}function Ze(d,t,e,i,s,r,l,a){var y=e-d,o=i-t,n=l-s,g=a-r,c=g*y-n*o;if(!(c*cD*D+X*X&&(j=V,I=Y),{cx:j,cy:I,x01:-n,y01:-g,x11:j*(s/T-1),y11:I*(s/T-1)}}function Ge(){var d=qe,t=Ee,e=M(0),i=null,s=Ue,r=Ke,l=$e,a=null,y=Ie(o);function o(){var n,g,c=+d.apply(this,arguments),h=+t.apply(this,arguments),m=s.apply(this,arguments)-ne,f=r.apply(this,arguments)-ne,P=Ae(f-m),b=f>m;if(a||(a=n=y()),hx)if(P>ze-x)a.moveTo(h*B(m),h*C(m)),a.arc(0,0,h,m,f,!b),c>x&&(a.moveTo(c*B(f),c*C(f)),a.arc(0,0,c,f,m,b));else{var u,p,R=m,T=f,w=m,L=f,j=P,I=P,V=l.apply(this,arguments)/2,Y=V>x&&(i?+i.apply(this,arguments):q(c*c+h*h)),N=fe(Ae(h-c)/2,+e.apply(this,arguments)),k=N,D=N;if(Y>x){var X=Pe(Y/c*C(V)),le=Pe(Y/h*C(V));(j-=2*X)>x?(w+=X*=b?1:-1,L-=X):(j=0,w=L=(m+f)/2),(I-=2*le)>x?(R+=le*=b?1:-1,T-=le):(I=0,R=T=(m+f)/2)}var z=h*B(R),W=h*C(R),$=c*B(L),Z=c*C(L);if(N>x){var O,G=h*B(T),J=h*C(T),oe=c*B(w),ue=c*C(w);if(Px?D>x?(u=ee(oe,ue,z,W,h,D,b),p=ee(G,J,$,Z,h,D,b),a.moveTo(u.cx+u.x01,u.cy+u.y01),Dx&&j>x?k>x?(u=ee($,Z,G,J,c,-k,b),p=ee(z,W,oe,ue,c,-k,b),a.lineTo(u.cx+u.x01,u.cy+u.y01),k=360&&l==0&&(i=0,s=0),{x:i,y:s}}_beforeChanged(){super._beforeChanged(),(this.isDirty("radius")||this.isDirty("arc")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("dRadius")||this.isDirty("dInnerRadius")||this.isDirty("cornerRadius")||this.isDirty("shiftRadius"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){let t=this.get("startAngle",0),e=this.get("arc",0);const i=this._generator;e<0&&(t+=e,e*=-1),e>.1&&i.cornerRadius(this.get("cornerRadius",0)),i.context(this._display);let s=this.get("radius",0),r=this.get("innerRadius",0);s+=this.get("dRadius",0),r+=this.get("dInnerRadius",0),r<0&&(r=s+r),i({innerRadius:r,outerRadius:s,startAngle:(t+90)*ve,endAngle:(t+e+90)*ve});let l=t+e/2;this.ix=H(l),this.iy=S(l);const a=this.get("shiftRadius",0);this.setRaw("dx",this.ix*a),this.setRaw("dy",this.iy*a),this.markDirtyPosition()}}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Slice"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Oe.classNames.concat([se.className])});class Je extends Fe{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,e=this.rule.bind(this);e("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:Ve.new(this._root,{}),width:we,height:we}),e("PieChart").setAll({radius:He(80),startAngle:-90,endAngle:270}),e("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),e("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),e("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),e("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),e("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),e("Slice",["pie"]).states.create("hover",{scale:1.04}),e("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),e("Tick",["pie"]).setAll({location:1}),e("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),e("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),e("FunnelSlice").setAll({interactive:!0,expandDistance:0}),e("FunnelSlice").states.create("hover",{expandDistance:.15}),e("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["funnel","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["funnel"]).setAll({location:1}),e("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),e("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),e("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),e("PyramidSeries").setAll({valueIs:"area"}),e("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),e("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),e("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),e("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),e("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),e("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pyramid","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["pyramid"]).setAll({location:1}),e("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),e("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pictorial","vertical"]).setAll({centerY:v,centerX:0}),e("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),e("Tick",["pictorial"]).setAll({location:.5});{const i=e("Graphics",["pictorial","background"]);i.setAll({fillOpacity:.2}),Ye(i,"fill",t,"alternativeBackground")}}}class E extends Te{_afterNew(){this._defaultThemes.push(Je.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(t){super._processSeries(t),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentChart"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([E.className])});class U extends Le{constructor(){super(...arguments),Object.defineProperty(this,"slicesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"ticksContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"_lLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_rLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_hLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeSlices())}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeLabels())}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeTicks())})}makeSlice(t){const e=this.slicesContainer.children.push(this.slices.make());return e.on("fill",()=>{this.updateLegendMarker(t)}),e.on("fillPattern",()=>{this.updateLegendMarker(t)}),e.on("stroke",()=>{this.updateLegendMarker(t)}),e._setDataItem(t),t.set("slice",e),this.slices.push(e),e}makeLabel(t){const e=this.labelsContainer.children.push(this.labels.make());return e._setDataItem(t),t.set("label",e),this.labels.push(e),e}_shouldMakeBullet(t){return t.get("value")!=null}makeTick(t){const e=this.ticksContainer.children.push(this.ticks.make());return e._setDataItem(t),t.set("tick",e),this.ticks.push(e),e}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){const t=this.get("colors");t&&t.reset();const e=this.get("patterns");e&&e.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let t=0,e=0,i=0,s=1/0,r=0;A(this._dataItems,l=>{let a=l.get("valueWorking",0);t+=a,e+=Math.abs(a)}),A(this._dataItems,l=>{let a=l.get("valueWorking",0);a>i&&(i=a),asuper.show}});return Q(this,void 0,void 0,function*(){let i=[];i.push(e.show.call(this,t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)})}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return Q(this,void 0,void 0,function*(){let i=[];i.push(e.hide.call(this,t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)})}_updateChildren(){super._updateChildren(),this._valuesDirty&&A(this._dataItems,t=>{t.get("label").text.markDirtyText()}),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&A(this._dataItems,t=>{this.updateLegendValue(t)}),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),A(this.dataItems,t=>{this._updateTick(t)})}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(t){if(super.processDataItem(t),t.get("fill")==null){let e=this.get("colors");e&&t.setRaw("fill",e.next())}if(t.get("fillPattern")==null){let e=this.get("patterns");e&&t.setRaw("fillPattern",e.next())}}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return Q(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)];re(e)||(e=this.get("stateAnimationDuration",0));const r=this.get("stateAnimationEasing");let l=t.get("value");const a=t.animate({key:"valueWorking",to:l,duration:e,easing:r});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.show(e));const o=t.get("label");o&&s.push(o.show(e));const n=t.get("slice");n&&s.push(n.show(e)),n.get("active")&&n.states.applyAnimate("active"),yield Promise.all(s)})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return Q(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],r=this.states.create("hidden",{});re(e)||(e=r.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const l=r.get("stateAnimationEasing",this.get("stateAnimationEasing")),a=t.animate({key:"valueWorking",to:0,duration:e,easing:l});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.hide(e));const o=t.get("label");o&&s.push(o.hide(e));const n=t.get("slice");n.hideTooltip(),n&&s.push(n.hide(e)),yield Promise.all(s)})}disposeDataItem(t){super.disposeDataItem(t);let e=t.get("label");e&&(this.labels.removeValue(e),e.dispose());let i=t.get("tick");i&&(this.ticks.removeValue(i),i.dispose());let s=t.get("slice");s&&(this.slices.removeValue(s),s.dispose())}hoverDataItem(t){const e=t.get("slice");e&&!e.isHidden()&&e.hover()}unhoverDataItem(t){const e=t.get("slice");e&&e.unhover()}updateLegendMarker(t){if(t){const e=t.get("slice");if(e){const i=t.get("legendDataItem");if(i){const s=i.get("markerRectangle");A(Be,r=>{e.get(r)!=null&&s.set(r,e.get(r))})}}}}_arrangeDown(t){if(t){let e=this._getNextDown();t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.top;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.bottom;i.y+r>e&&(i.y=e-r),i.label.set("y",i.y),e=i.y+s.top})}}_arrangeRight(t){if(t){let e=0;t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.left;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.right;i.y+r>e&&(i.y=e-r),i.label.set("x",i.y),e=i.y+s.left})}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(t){}_dispose(){super._dispose();const t=this.chart;t&&t.series.removeValue(this)}}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentSeries"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Le.classNames.concat([U.className])});class _e extends E{constructor(){super(...arguments),Object.defineProperty(this,"_maxRadius",{enumerable:!0,configurable:!0,writable:!0,value:1})}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:v,y:v})}_prepareChildren(){super._prepareChildren();const t=this.chartContainer,e=t.innerWidth(),i=t.innerHeight(),s=this.get("startAngle",0),r=this.get("endAngle",0),l=this.get("innerRadius");let a=Re(0,0,s,r,1);const y=e/(a.right-a.left),o=i/(a.bottom-a.top);let n={left:0,right:0,top:0,bottom:0};if(l instanceof ae){let h=l.value,m=Math.min(y,o);h=Math.max(m*h,m-Math.min(i,e))/m,n=Re(0,0,s,r,h),this.setPrivateRaw("irModifyer",h/l.value)}a=Me([a,n]);const g=this._maxRadius;this._maxRadius=Math.min(y,o);const c=F(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-c*(a.bottom+a.top)/2,dx:-c*(a.right+a.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||g!=this._maxRadius)&&this.series.each(h=>{h._markDirtyKey("startAngle")}),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each(h=>{h._markDirtyKey("innerRadius")})}radius(t){let e=F(this.get("radius",0),this._maxRadius),i=F(this.get("innerRadius",0),e);if(t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("radius");return l!=null?i+F(l,e-i):i+(e-i)/r*(s+1)}return e}innerRadius(t){const e=this.radius();let i=F(this.get("innerRadius",0),e);if(i<0&&(i=e+i),t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("innerRadius");return l!=null?i+F(l,e-i):i+(e-i)/r*s}return i}_updateSize(){super._updateSize(),this.markDirtyKey("radius")}}Object.defineProperty(_e,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieChart"}),Object.defineProperty(_e,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([_e.className])});class xe extends U{_makeSlices(){return new pe(ye.new({}),()=>se._new(this._root,{themeTags:me(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template]))}_makeLabels(){return new pe(ye.new({}),()=>ie._new(this._root,{themeTags:me(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template]))}_makeTicks(){return new pe(ye.new({}),()=>je._new(this._root,{themeTags:me(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template]))}processDataItem(t){super.processDataItem(t);const e=this.makeSlice(t);e.on("scale",()=>{this._updateTick(t)}),e.on("shiftRadius",()=>{this._updateTick(t)}),e.events.on("positionchanged",()=>{this._updateTick(t)});const i=this.makeLabel(t);i.events.on("positionchanged",()=>{this._updateTick(t)}),this.makeTick(t),e.events.on("positionchanged",()=>{i.markDirty()})}_getNextUp(){const t=this.chart;return t?t._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){const t=this.chart;return t?-t._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();const t=this.chart;if(t){if(this.isDirty("alignLabels")){let e=this.labels.template;if(this.get("alignLabels"))e.set("textType","aligned");else{let i=e.get("textType");i!=null&&i!="aligned"||e.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();const e=this.get("startAngle",t.get("startAngle",-90)),i=this.get("endAngle",t.get("endAngle",270))-e;let s=e;const r=t.radius(this);this.setPrivateRaw("radius",r);let l=t.innerRadius(this)*t.getPrivate("irModifyer",1);l<0&&(l=r+l),A(this._dataItems,a=>{this.updateLegendValue(a);let y=i*a.get("valuePercentTotal")/100;const o=a.get("slice");if(o){o.set("radius",r),o.set("innerRadius",l),o.set("startAngle",s),o.set("arc",y);const c=a.get("fill");o._setDefault("fill",c),o._setDefault("stroke",c);const h=a.get("fillPattern");o._setDefault("fillPattern",h)}let n=Se(s+y/2);const g=a.get("label");if(g&&(g.setPrivate("radius",r),g.setPrivate("innerRadius",l),g.set("labelAngle",n),g.get("textType")=="aligned")){let c=r+g.get("radius",0),h=r*S(n);n>90&&n<=270?(g.isHidden()||g.isHiding()||this._lLabels.push({label:g,y:h}),c*=-1,c-=this.labelsContainer.get("paddingLeft",0),g.set("centerX",we),g.setPrivateRaw("left",!0)):(g.isHidden()||g.isHiding()||this._rLabels.push({label:g,y:h}),c+=this.labelsContainer.get("paddingRight",0),g.set("centerX",0),g.setPrivateRaw("left",!1)),g.set("x",c),g.set("y",r*S(n))}s+=y,this._updateTick(a)})}}}_updateTick(t){const e=t.get("tick"),i=t.get("label"),s=t.get("slice"),r=e.get("location",1);if(e&&i&&s){const l=(s.get("shiftRadius",0)+s.get("radius",0))*s.get("scale",1)*r,a=i.get("labelAngle",0),y=H(a),o=S(a),n=this.labelsContainer,g=n.get("paddingLeft",0),c=n.get("paddingRight",0);let h=0,m=0;h=i.x(),m=i.y();let f=[];if(h!=0||m!=0){if(i.get("textType")=="circular"){const b=i.radius()-i.get("paddingBottom",0),u=i.get("labelAngle",0);h=b*H(u),m=b*S(u)}let P=-c;i.getPrivate("left")&&(P=g),f=[{x:s.x()+l*y,y:s.y()+l*o},{x:h+P,y:m},{x:h,y:m}]}e.set("points",f)}}_positionBullet(t){const e=t.get("sprite");if(e){const i=e.dataItem.get("slice");if(i){const s=i.get("innerRadius",0),r=i.get("radius",0),l=i.get("startAngle",0)+i.get("arc",0)*t.get("locationX",.5),a=s+(r-s)*t.get("locationY",.5);e.setAll({x:H(l)*a,y:S(l)*a})}}}}Object.defineProperty(xe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieSeries"}),Object.defineProperty(xe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([xe.className])});export{_e as PieChartAm5,xe as PieSeriesAm5}; +import{k0 as Q}from"./story-Doly9N9p.js";import{B as Te,U as Le,A as je,u as Ie,n as M}from"./Tick-DUHqbpyB-Dd2p6esB.js";import{m as Ne,ap as Ce,V as Oe,at as v,am as Re,n as ae,ax as Me,aw as F,ay as pe,az as ye,ao as me,c as A,aA as H,aB as S,aC as ve,ai as Se,H as be,aD as Be,U as we,B as re,ar as Fe,s as He}from"./Theme-rblUnB2V-Dc7wtY6B.js";import{i as Ve}from"./ColorSet-DkIwOmgs-Bdz0YXw-.js";import{o as Ye}from"./DefaultTheme-Bt5OI-Ht-BKAw1o4a.js";import"./main-QGPoLsvl.js";class te extends Ne{constructor(){super(...arguments),Object.defineProperty(this,"_display",{enumerable:!0,configurable:!0,writable:!0,value:this._root._renderer.makeRadialText("",this.textStyle)})}_afterNew(){super._afterNew()}_beforeChanged(){super._beforeChanged(),this._display.clear(),this.isDirty("textType")&&(this._display.textType=this.get("textType"),this.markDirtyBounds()),this.isDirty("radius")&&(this._display.radius=this.get("radius"),this.markDirtyBounds()),this.isDirty("startAngle")&&(this._display.startAngle=(this.get("startAngle",0)+90)*ve,this.markDirtyBounds()),this.isDirty("inside")&&(this._display.inside=this.get("inside"),this.markDirtyBounds()),this.isDirty("orientation")&&(this._display.orientation=this.get("orientation"),this.markDirtyBounds()),this.isDirty("kerning")&&(this._display.kerning=this.get("kerning"),this.markDirtyBounds())}}Object.defineProperty(te,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialText"}),Object.defineProperty(te,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ne.classNames.concat([te.className])});class ie extends Ce{constructor(){super(...arguments),Object.defineProperty(this,"_flipped",{enumerable:!0,configurable:!0,writable:!0,value:!1})}_afterNew(){this._textKeys.push("textType","kerning"),super._afterNew()}_makeText(){this._text=this.children.push(te.new(this._root,{}))}baseRadius(){const t=this.getPrivate("radius",0),e=this.getPrivate("innerRadius",0),i=this.get("baseRadius",0);return e+F(i,t-e)}radius(){const t=this.get("inside",!1);return this.baseRadius()+this.get("radius",0)*(t?-1:1)}_updateChildren(){if(super._updateChildren(),this.isDirty("baseRadius")||this.isPrivateDirty("radius")||this.isPrivateDirty("innerRadius")||this.isDirty("labelAngle")||this.isDirty("radius")||this.isDirty("inside")||this.isDirty("orientation")||this.isDirty("textType")){const t=this.get("textType","adjusted"),e=this.get("inside",!1),i=this.get("orientation");let s=Se(this.get("labelAngle",0));this._text.set("startAngle",this.get("labelAngle",0)),this._text.set("inside",e);const r=S(s),l=H(s);let a=this.baseRadius(),y=this.radius();if(this._display.angle=0,t=="circular")this.setAll({paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}),this.setRaw("x",void 0),this.setRaw("y",void 0),this._text.set("orientation",i),this._text.set("radius",y);else{a==0&&(s=0,y=0);let o=y*l,n=y*r;t=="radial"?(this.setRaw("x",o),this.setRaw("y",n),s<90||s>270||i!="auto"?(this._display.angle=s,this._flipped=!1):(this._display.angle=s+180,this._flipped=!0),this._dirty.rotation=!1):t=="adjusted"?(this.setRaw("centerX",v),this.setRaw("centerY",v),this.setRaw("x",o),this.setRaw("y",n)):t=="regular"&&(this.setRaw("x",o),this.setRaw("y",n))}this.markDirtyPosition(),this.markDirtyBounds()}}_updatePosition(){const t=this.get("textType","regular"),e=this.get("inside",!1);let i=0,s=0,r=this.get("labelAngle",0),l=this.localBounds(),a=l.right-l.left,y=l.bottom-l.top;if(t=="radial"){if(this._flipped){let o=this.get("centerX");o instanceof ae&&(a*=1-2*o.value),i=a*H(r),s=a*S(r)}}else e||t!="adjusted"||(i=a/2*H(r),s=y/2*S(r));this.setRaw("dx",i),this.setRaw("dy",s),super._updatePosition()}get text(){return this._text}}Object.defineProperty(ie,"className",{enumerable:!0,configurable:!0,writable:!0,value:"RadialLabel"}),Object.defineProperty(ie,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Ce.classNames.concat([ie.className])});const Ae=Math.abs,_=Math.atan2,B=Math.cos,Xe=Math.max,fe=Math.min,C=Math.sin,q=Math.sqrt,x=1e-12,K=Math.PI,ne=K/2,ze=2*K;function We(d){return d>1?0:d<-1?K:Math.acos(d)}function Pe(d){return d>=1?ne:d<=-1?-ne:Math.asin(d)}function qe(d){return d.innerRadius}function Ee(d){return d.outerRadius}function Ue(d){return d.startAngle}function Ke(d){return d.endAngle}function $e(d){return d&&d.padAngle}function Ze(d,t,e,i,s,r,l,a){var y=e-d,o=i-t,n=l-s,g=a-r,c=g*y-n*o;if(!(c*cD*D+X*X&&(j=V,I=Y),{cx:j,cy:I,x01:-n,y01:-g,x11:j*(s/T-1),y11:I*(s/T-1)}}function Ge(){var d=qe,t=Ee,e=M(0),i=null,s=Ue,r=Ke,l=$e,a=null,y=Ie(o);function o(){var n,g,c=+d.apply(this,arguments),h=+t.apply(this,arguments),m=s.apply(this,arguments)-ne,f=r.apply(this,arguments)-ne,P=Ae(f-m),b=f>m;if(a||(a=n=y()),hx)if(P>ze-x)a.moveTo(h*B(m),h*C(m)),a.arc(0,0,h,m,f,!b),c>x&&(a.moveTo(c*B(f),c*C(f)),a.arc(0,0,c,f,m,b));else{var u,p,R=m,T=f,w=m,L=f,j=P,I=P,V=l.apply(this,arguments)/2,Y=V>x&&(i?+i.apply(this,arguments):q(c*c+h*h)),N=fe(Ae(h-c)/2,+e.apply(this,arguments)),k=N,D=N;if(Y>x){var X=Pe(Y/c*C(V)),le=Pe(Y/h*C(V));(j-=2*X)>x?(w+=X*=b?1:-1,L-=X):(j=0,w=L=(m+f)/2),(I-=2*le)>x?(R+=le*=b?1:-1,T-=le):(I=0,R=T=(m+f)/2)}var z=h*B(R),W=h*C(R),$=c*B(L),Z=c*C(L);if(N>x){var O,G=h*B(T),J=h*C(T),oe=c*B(w),ue=c*C(w);if(Px?D>x?(u=ee(oe,ue,z,W,h,D,b),p=ee(G,J,$,Z,h,D,b),a.moveTo(u.cx+u.x01,u.cy+u.y01),Dx&&j>x?k>x?(u=ee($,Z,G,J,c,-k,b),p=ee(z,W,oe,ue,c,-k,b),a.lineTo(u.cx+u.x01,u.cy+u.y01),k=360&&l==0&&(i=0,s=0),{x:i,y:s}}_beforeChanged(){super._beforeChanged(),(this.isDirty("radius")||this.isDirty("arc")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("dRadius")||this.isDirty("dInnerRadius")||this.isDirty("cornerRadius")||this.isDirty("shiftRadius"))&&(this._clear=!0)}_changed(){if(super._changed(),this._clear){let t=this.get("startAngle",0),e=this.get("arc",0);const i=this._generator;e<0&&(t+=e,e*=-1),e>.1&&i.cornerRadius(this.get("cornerRadius",0)),i.context(this._display);let s=this.get("radius",0),r=this.get("innerRadius",0);s+=this.get("dRadius",0),r+=this.get("dInnerRadius",0),r<0&&(r=s+r),i({innerRadius:r,outerRadius:s,startAngle:(t+90)*ve,endAngle:(t+e+90)*ve});let l=t+e/2;this.ix=H(l),this.iy=S(l);const a=this.get("shiftRadius",0);this.setRaw("dx",this.ix*a),this.setRaw("dy",this.iy*a),this.markDirtyPosition()}}}Object.defineProperty(se,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Slice"}),Object.defineProperty(se,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Oe.classNames.concat([se.className])});class Je extends Fe{setupDefaultRules(){super.setupDefaultRules();const t=this._root.interfaceColors,e=this.rule.bind(this);e("PercentSeries").setAll({legendLabelText:"{category}",legendValueText:"{valuePercentTotal.formatNumber('0.00p')}",colors:Ve.new(this._root,{}),width:we,height:we}),e("PieChart").setAll({radius:He(80),startAngle:-90,endAngle:270}),e("PieSeries").setAll({alignLabels:!0,startAngle:-90,endAngle:270}),e("PieSeries").states.create("hidden",{endAngle:-90,opacity:0}),e("Slice",["pie"]).setAll({position:"absolute",isMeasured:!1,x:0,y:0,toggleKey:"active",tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}",strokeWidth:1,strokeOpacity:1,role:"figure",lineJoin:"round"}),e("Slice",["pie"]).states.create("active",{shiftRadius:20,scale:1}),e("Slice",["pie"]).states.create("hoverActive",{scale:1.04}),e("Slice",["pie"]).states.create("hover",{scale:1.04}),e("RadialLabel",["pie"]).setAll({textType:"aligned",radius:10,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",paddingTop:5,paddingBottom:5,populateText:!0}),e("Tick",["pie"]).setAll({location:1}),e("SlicedChart").setAll({paddingLeft:10,paddingRight:10,paddingTop:10,paddingBottom:10}),e("FunnelSeries").setAll({startLocation:0,endLocation:1,orientation:"vertical",alignLabels:!0,sequencedInterpolation:!0}),e("FunnelSlice").setAll({interactive:!0,expandDistance:0}),e("FunnelSlice").states.create("hover",{expandDistance:.15}),e("Label",["funnel"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["funnel","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["funnel","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["funnel"]).setAll({location:1}),e("FunnelSlice",["funnel","link"]).setAll({fillOpacity:.5,strokeOpacity:0,expandDistance:-.1}),e("FunnelSlice",["funnel","link","vertical"]).setAll({height:10}),e("FunnelSlice",["funnel","link","horizontal"]).setAll({width:10}),e("PyramidSeries").setAll({valueIs:"area"}),e("FunnelSlice",["pyramid","link"]).setAll({fillOpacity:.5}),e("FunnelSlice",["pyramid","link","vertical"]).setAll({height:0}),e("FunnelSlice",["pyramid","link","horizontal"]).setAll({width:0}),e("FunnelSlice",["pyramid"]).setAll({interactive:!0,expandDistance:0}),e("FunnelSlice",["pyramid"]).states.create("hover",{expandDistance:.15}),e("Label",["pyramid"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pyramid","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pyramid","vertical"]).setAll({centerY:v,centerX:0}),e("Tick",["pyramid"]).setAll({location:1}),e("FunnelSlice",["pictorial"]).setAll({interactive:!0,tooltipText:"{category}: {valuePercentTotal.formatNumber('0.00p')}"}),e("Label",["pictorial"]).setAll({populateText:!0,text:"{category}: {valuePercentTotal.formatNumber('0.00p')}",centerY:v}),e("Label",["pictorial","horizontal"]).setAll({centerX:0,centerY:v,rotation:-90}),e("Label",["pictorial","vertical"]).setAll({centerY:v,centerX:0}),e("FunnelSlice",["pictorial","link"]).setAll({fillOpacity:.5,width:0,height:0}),e("Tick",["pictorial"]).setAll({location:.5});{const i=e("Graphics",["pictorial","background"]);i.setAll({fillOpacity:.2}),Ye(i,"fill",t,"alternativeBackground")}}}class E extends Te{_afterNew(){this._defaultThemes.push(Je.new(this._root)),super._afterNew(),this.chartContainer.children.push(this.seriesContainer),this.seriesContainer.children.push(this.bulletsContainer)}_processSeries(t){super._processSeries(t),this.seriesContainer.children.moveValue(this.bulletsContainer,this.seriesContainer.children.length-1)}}Object.defineProperty(E,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentChart"}),Object.defineProperty(E,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Te.classNames.concat([E.className])});class U extends Le{constructor(){super(...arguments),Object.defineProperty(this,"slicesContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"labelsContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"ticksContainer",{enumerable:!0,configurable:!0,writable:!0,value:this.children.push(be.new(this._root,{position:"absolute",isMeasured:!1}))}),Object.defineProperty(this,"_lLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_rLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_hLabels",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"slices",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeSlices())}),Object.defineProperty(this,"labels",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeLabels())}),Object.defineProperty(this,"ticks",{enumerable:!0,configurable:!0,writable:!0,value:this.addDisposer(this._makeTicks())})}makeSlice(t){const e=this.slicesContainer.children.push(this.slices.make());return e.on("fill",()=>{this.updateLegendMarker(t)}),e.on("fillPattern",()=>{this.updateLegendMarker(t)}),e.on("stroke",()=>{this.updateLegendMarker(t)}),e._setDataItem(t),t.set("slice",e),this.slices.push(e),e}makeLabel(t){const e=this.labelsContainer.children.push(this.labels.make());return e._setDataItem(t),t.set("label",e),this.labels.push(e),e}_shouldMakeBullet(t){return t.get("value")!=null}makeTick(t){const e=this.ticksContainer.children.push(this.ticks.make());return e._setDataItem(t),t.set("tick",e),this.ticks.push(e),e}_afterNew(){this.fields.push("category","fill"),super._afterNew()}_onDataClear(){const t=this.get("colors");t&&t.reset();const e=this.get("patterns");e&&e.reset()}_prepareChildren(){if(super._prepareChildren(),this._lLabels=[],this._rLabels=[],this._hLabels=[],this._valuesDirty){let t=0,e=0,i=0,s=1/0,r=0;A(this._dataItems,l=>{let a=l.get("valueWorking",0);t+=a,e+=Math.abs(a)}),A(this._dataItems,l=>{let a=l.get("valueWorking",0);a>i&&(i=a),asuper.show}});return Q(this,void 0,void 0,function*(){let i=[];i.push(e.show.call(this,t)),i.push(this._sequencedShowHide(!0,t)),yield Promise.all(i)})}hide(t){const e=Object.create(null,{hide:{get:()=>super.hide}});return Q(this,void 0,void 0,function*(){let i=[];i.push(e.hide.call(this,t)),i.push(this._sequencedShowHide(!1,t)),yield Promise.all(i)})}_updateChildren(){super._updateChildren(),this._valuesDirty&&A(this._dataItems,t=>{t.get("label").text.markDirtyText()}),(this.isDirty("legendLabelText")||this.isDirty("legendValueText"))&&A(this._dataItems,t=>{this.updateLegendValue(t)}),this._arrange()}_arrange(){this._arrangeDown(this._lLabels),this._arrangeUp(this._lLabels),this._arrangeDown(this._rLabels),this._arrangeUp(this._rLabels),this._arrangeLeft(this._hLabels),this._arrangeRight(this._hLabels),A(this.dataItems,t=>{this._updateTick(t)})}_afterChanged(){super._afterChanged(),this._arrange()}processDataItem(t){if(super.processDataItem(t),t.get("fill")==null){let e=this.get("colors");e&&t.setRaw("fill",e.next())}if(t.get("fillPattern")==null){let e=this.get("patterns");e&&t.setRaw("fillPattern",e.next())}}showDataItem(t,e){const i=Object.create(null,{showDataItem:{get:()=>super.showDataItem}});return Q(this,void 0,void 0,function*(){const s=[i.showDataItem.call(this,t,e)];re(e)||(e=this.get("stateAnimationDuration",0));const r=this.get("stateAnimationEasing");let l=t.get("value");const a=t.animate({key:"valueWorking",to:l,duration:e,easing:r});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.show(e));const o=t.get("label");o&&s.push(o.show(e));const n=t.get("slice");n&&s.push(n.show(e)),n.get("active")&&n.states.applyAnimate("active"),yield Promise.all(s)})}hideDataItem(t,e){const i=Object.create(null,{hideDataItem:{get:()=>super.hideDataItem}});return Q(this,void 0,void 0,function*(){const s=[i.hideDataItem.call(this,t,e)],r=this.states.create("hidden",{});re(e)||(e=r.get("stateAnimationDuration",this.get("stateAnimationDuration",0)));const l=r.get("stateAnimationEasing",this.get("stateAnimationEasing")),a=t.animate({key:"valueWorking",to:0,duration:e,easing:l});a&&s.push(a.waitForStop());const y=t.get("tick");y&&s.push(y.hide(e));const o=t.get("label");o&&s.push(o.hide(e));const n=t.get("slice");n.hideTooltip(),n&&s.push(n.hide(e)),yield Promise.all(s)})}disposeDataItem(t){super.disposeDataItem(t);let e=t.get("label");e&&(this.labels.removeValue(e),e.dispose());let i=t.get("tick");i&&(this.ticks.removeValue(i),i.dispose());let s=t.get("slice");s&&(this.slices.removeValue(s),s.dispose())}hoverDataItem(t){const e=t.get("slice");e&&!e.isHidden()&&e.hover()}unhoverDataItem(t){const e=t.get("slice");e&&e.unhover()}updateLegendMarker(t){if(t){const e=t.get("slice");if(e){const i=t.get("legendDataItem");if(i){const s=i.get("markerRectangle");A(Be,r=>{e.get(r)!=null&&s.set(r,e.get(r))})}}}}_arrangeDown(t){if(t){let e=this._getNextDown();t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.top;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.bottom;i.y+r>e&&(i.y=e-r),i.label.set("y",i.y),e=i.y+s.top})}}_arrangeRight(t){if(t){let e=0;t.sort((i,s)=>i.y>s.y?1:i.y{const s=i.label.adjustedLocalBounds();let r=s.left;i.y+ri.ys.y?-1:0),A(t,i=>{const s=i.label.adjustedLocalBounds();let r=s.right;i.y+r>e&&(i.y=e-r),i.label.set("x",i.y),e=i.y+s.left})}}_updateSize(){super._updateSize(),this.markDirty()}_updateTick(t){}_dispose(){super._dispose();const t=this.chart;t&&t.series.removeValue(this)}}Object.defineProperty(U,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PercentSeries"}),Object.defineProperty(U,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:Le.classNames.concat([U.className])});class _e extends E{constructor(){super(...arguments),Object.defineProperty(this,"_maxRadius",{enumerable:!0,configurable:!0,writable:!0,value:1})}_afterNew(){super._afterNew(),this.seriesContainer.setAll({x:v,y:v})}_prepareChildren(){super._prepareChildren();const t=this.chartContainer,e=t.innerWidth(),i=t.innerHeight(),s=this.get("startAngle",0),r=this.get("endAngle",0),l=this.get("innerRadius");let a=Re(0,0,s,r,1);const y=e/(a.right-a.left),o=i/(a.bottom-a.top);let n={left:0,right:0,top:0,bottom:0};if(l instanceof ae){let h=l.value,m=Math.min(y,o);h=Math.max(m*h,m-Math.min(i,e))/m,n=Re(0,0,s,r,h),this.setPrivateRaw("irModifyer",h/l.value)}a=Me([a,n]);const g=this._maxRadius;this._maxRadius=Math.min(y,o);const c=F(this.get("radius",0),this._maxRadius);this.seriesContainer.setAll({dy:-c*(a.bottom+a.top)/2,dx:-c*(a.right+a.left)/2}),(this.isDirty("startAngle")||this.isDirty("endAngle")||g!=this._maxRadius)&&this.series.each(h=>{h._markDirtyKey("startAngle")}),(this.isDirty("innerRadius")||this.isDirty("radius"))&&this.series.each(h=>{h._markDirtyKey("innerRadius")})}radius(t){let e=F(this.get("radius",0),this._maxRadius),i=F(this.get("innerRadius",0),e);if(t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("radius");return l!=null?i+F(l,e-i):i+(e-i)/r*(s+1)}return e}innerRadius(t){const e=this.radius();let i=F(this.get("innerRadius",0),e);if(i<0&&(i=e+i),t){let s=this.series.indexOf(t),r=this.series.length,l=t.get("innerRadius");return l!=null?i+F(l,e-i):i+(e-i)/r*s}return i}_updateSize(){super._updateSize(),this.markDirtyKey("radius")}}Object.defineProperty(_e,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieChart"}),Object.defineProperty(_e,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:E.classNames.concat([_e.className])});class xe extends U{_makeSlices(){return new pe(ye.new({}),()=>se._new(this._root,{themeTags:me(this.slices.template.get("themeTags",[]),["pie","series"])},[this.slices.template]))}_makeLabels(){return new pe(ye.new({}),()=>ie._new(this._root,{themeTags:me(this.labels.template.get("themeTags",[]),["pie","series"])},[this.labels.template]))}_makeTicks(){return new pe(ye.new({}),()=>je._new(this._root,{themeTags:me(this.ticks.template.get("themeTags",[]),["pie","series"])},[this.ticks.template]))}processDataItem(t){super.processDataItem(t);const e=this.makeSlice(t);e.on("scale",()=>{this._updateTick(t)}),e.on("shiftRadius",()=>{this._updateTick(t)}),e.events.on("positionchanged",()=>{this._updateTick(t)});const i=this.makeLabel(t);i.events.on("positionchanged",()=>{this._updateTick(t)}),this.makeTick(t),e.events.on("positionchanged",()=>{i.markDirty()})}_getNextUp(){const t=this.chart;return t?t._maxRadius:this.labelsContainer.maxHeight()/2}_getNextDown(){const t=this.chart;return t?-t._maxRadius:-this.labelsContainer.maxHeight()/2}_prepareChildren(){super._prepareChildren();const t=this.chart;if(t){if(this.isDirty("alignLabels")){let e=this.labels.template;if(this.get("alignLabels"))e.set("textType","aligned");else{let i=e.get("textType");i!=null&&i!="aligned"||e.set("textType","adjusted")}}if(this._valuesDirty||this.isDirty("radius")||this.isDirty("innerRadius")||this.isDirty("startAngle")||this.isDirty("endAngle")||this.isDirty("alignLabels")){this.markDirtyBounds();const e=this.get("startAngle",t.get("startAngle",-90)),i=this.get("endAngle",t.get("endAngle",270))-e;let s=e;const r=t.radius(this);this.setPrivateRaw("radius",r);let l=t.innerRadius(this)*t.getPrivate("irModifyer",1);l<0&&(l=r+l),A(this._dataItems,a=>{this.updateLegendValue(a);let y=i*a.get("valuePercentTotal")/100;const o=a.get("slice");if(o){o.set("radius",r),o.set("innerRadius",l),o.set("startAngle",s),o.set("arc",y);const c=a.get("fill");o._setDefault("fill",c),o._setDefault("stroke",c);const h=a.get("fillPattern");o._setDefault("fillPattern",h)}let n=Se(s+y/2);const g=a.get("label");if(g&&(g.setPrivate("radius",r),g.setPrivate("innerRadius",l),g.set("labelAngle",n),g.get("textType")=="aligned")){let c=r+g.get("radius",0),h=r*S(n);n>90&&n<=270?(g.isHidden()||g.isHiding()||this._lLabels.push({label:g,y:h}),c*=-1,c-=this.labelsContainer.get("paddingLeft",0),g.set("centerX",we),g.setPrivateRaw("left",!0)):(g.isHidden()||g.isHiding()||this._rLabels.push({label:g,y:h}),c+=this.labelsContainer.get("paddingRight",0),g.set("centerX",0),g.setPrivateRaw("left",!1)),g.set("x",c),g.set("y",r*S(n))}s+=y,this._updateTick(a)})}}}_updateTick(t){const e=t.get("tick"),i=t.get("label"),s=t.get("slice"),r=e.get("location",1);if(e&&i&&s){const l=(s.get("shiftRadius",0)+s.get("radius",0))*s.get("scale",1)*r,a=i.get("labelAngle",0),y=H(a),o=S(a),n=this.labelsContainer,g=n.get("paddingLeft",0),c=n.get("paddingRight",0);let h=0,m=0;h=i.x(),m=i.y();let f=[];if(h!=0||m!=0){if(i.get("textType")=="circular"){const b=i.radius()-i.get("paddingBottom",0),u=i.get("labelAngle",0);h=b*H(u),m=b*S(u)}let P=-c;i.getPrivate("left")&&(P=g),f=[{x:s.x()+l*y,y:s.y()+l*o},{x:h+P,y:m},{x:h,y:m}]}e.set("points",f)}}_positionBullet(t){const e=t.get("sprite");if(e){const i=e.dataItem.get("slice");if(i){const s=i.get("innerRadius",0),r=i.get("radius",0),l=i.get("startAngle",0)+i.get("arc",0)*t.get("locationX",.5),a=s+(r-s)*t.get("locationY",.5);e.setAll({x:H(l)*a,y:S(l)*a})}}}}Object.defineProperty(xe,"className",{enumerable:!0,configurable:!0,writable:!0,value:"PieSeries"}),Object.defineProperty(xe,"classNames",{enumerable:!0,configurable:!0,writable:!0,value:U.classNames.concat([xe.className])});export{_e as PieChartAm5,xe as PieSeriesAm5}; diff --git a/custom-toc-highlight/assets/plane-Dt8R0KeE-CVSP2GQG.js b/custom-toc-highlight/assets/plane-Dt8R0KeE-Bqc6oVGz.js similarity index 97% rename from custom-toc-highlight/assets/plane-Dt8R0KeE-CVSP2GQG.js rename to custom-toc-highlight/assets/plane-Dt8R0KeE-Bqc6oVGz.js index 1c1bded4..939ce22f 100644 --- a/custom-toc-highlight/assets/plane-Dt8R0KeE-CVSP2GQG.js +++ b/custom-toc-highlight/assets/plane-Dt8R0KeE-Bqc6oVGz.js @@ -1 +1 @@ -import{cY as G,dg as N,ha as x,ae as H}from"./story-BfX8CRfG.js";import{y as I,b as L,S as $,L as d,r as _,j as y,R as V,l as M,_ as p}from"./vec32-D9GsKZ1t-BjayBdwt.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import{n as J}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{t as K}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{e as Y}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{o as k}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{o as z}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";function X(t,r){return I(t,r)/L(t)}function _t(t,r){const e=I(t,r)/(L(t)*L(r));return-x(e)}function Mt(t,r,e){M(C,t),M(v,r);const c=I(C,v),i=x(c),n=$(C,C,v);return I(n,e)<0?2*Math.PI-i:i}const C=N(),v=N();let S=class E{constructor(r){this._create=r,this._items=new Array,this._itemsPtr=0}get(){return this._itemsPtr===0&&G(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const r=2*this._itemsPtr;this._items.length>r&&(this._items.length=r),this._itemsPtr=0}static createVec2f64(){return new E(k)}static createVec3f64(){return new E(N)}static createVec4f64(){return new E(z)}static createMat3f64(){return new E(J)}static createMat4f64(){return new E(K)}static createQuatf64(){return new E(Y)}get test(){}};const St=S.createVec2f64(),f=S.createVec3f64(),W=S.createVec4f64();S.createMat3f64();const mt=S.createMat4f64(),gt=S.createQuatf64();function Ot(t){const r=t[0]*t[0]+t[4]*t[4]+t[8]*t[8],e=t[1]*t[1]+t[5]*t[5]+t[9]*t[9],c=t[2]*t[2]+t[6]*t[6]+t[10]*t[10];return Math.sqrt(Math.max(r,e,c))}function Dt(t,r){const e=Math.sqrt(r[0]*r[0]+r[4]*r[4]+r[8]*r[8]),c=Math.sqrt(r[1]*r[1]+r[5]*r[5]+r[9]*r[9]),i=Math.sqrt(r[2]*r[2]+r[6]*r[6]+r[10]*r[10]);return p(t,e,c,i),t}function Z(t,r,e){Math.abs(t[0])>Math.abs(t[1])?p(r,0,1,0):p(r,1,0,0),$(e,t,r),$(r,e,t),M(e,e),M(r,r)}function Q(t=O){return[t[0],t[1],t[2],t[3]]}function lt(t=O[0],r=O[1],e=O[2],c=O[3]){return B(t,r,e,c,W.get())}function tt(t,r){return B(r[0],r[1],r[2],r[3],t)}function Ct(t){return t}function B(t,r,e,c,i=Q()){return i[0]=t,i[1]=r,i[2]=e,i[3]=c,i}function rt(t,r,e){const c=r[0]*r[0]+r[1]*r[1]+r[2]*r[2],i=Math.abs(c-1)>1e-5&&c>1e-12?1/Math.sqrt(c):1;return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=-(e[0]*t[0]+e[1]*t[1]+e[2]*t[2]),e}function et(t,r,e,c=Q()){const i=e[0]-r[0],n=e[1]-r[1],a=e[2]-r[2],o=t[0]-r[0],D=t[1]-r[1],l=t[2]-r[2],m=n*l-a*D,F=a*o-i*l,b=i*D-n*o,w=m*m+F*F+b*b,q=Math.abs(w-1)>1e-5&&w>1e-12?1/Math.sqrt(w):1;return c[0]=m*q,c[1]=F*q,c[2]=b*q,c[3]=-(c[0]*t[0]+c[1]*t[1]+c[2]*t[2]),c}function ct(t,r,e,c=0,i=Math.floor(e*(1/3)),n=Math.floor(e*(2/3))){if(e<3)return!1;r(g,c);let a=i,o=!1;for(;a=0}function bt(t,r,e){const c=d(f.get(),t,-t[3]),i=ot(t,_(f.get(),r,c),f.get());return y(e,i,c),e}function wt(t,r,e,c){const i=t,n=f.get(),a=f.get();Z(i,n,a);const o=_(f.get(),e,r),D=X(n,o),l=X(a,o),m=X(i,o);return p(c,D,l,m)}function ot(t,r,e){const c=d(f.get(),t,I(t,r));return _(e,r,c),e}function qt(t,r){return Math.abs(j(t,r))}function j(t,r){return I(t,r)+t[3]}var s;function A(t){return t===s.INTERSECTS_INSIDE_OUT||t===s.INTERSECTS_OUTSIDE_IN}function R(t,r,e,c,i){const n=I(t,e),a=j(t,r);if(n===0)return a>=0?s.INSIDE:s.OUTSIDE;let o=-a/n;return c&u.CLAMP&&(o=H(o,0,1)),!(c&u.INFINITE_MIN)&&o<0||!(c&u.INFINITE_MAX)&&o>1?a>=0?s.INSIDE:s.OUTSIDE:(y(i,r,d(i,e,o)),a>=0?s.INTERSECTS_INSIDE_OUT:s.INTERSECTS_OUTSIDE_IN)}(function(t){t[t.INTERSECTS_INSIDE_OUT=0]="INTERSECTS_INSIDE_OUT",t[t.INTERSECTS_OUTSIDE_IN=1]="INTERSECTS_OUTSIDE_IN",t[t.INSIDE=2]="INSIDE",t[t.OUTSIDE=3]="OUTSIDE"})(s||(s={}));const O=[0,0,1,0];var u;(function(t){t[t.NONE=0]="NONE",t[t.CLAMP=1]="CLAMP",t[t.INFINITE_MIN=4]="INFINITE_MIN",t[t.INFINITE_MAX=8]="INFINITE_MAX"})(u||(u={}));const at=u.INFINITE_MIN|u.INFINITE_MAX,nt=u.INFINITE_MAX;export{Z as $,rt as B,bt as D,et as G,B as H,Dt as I,W as J,ct as K,pt as M,Ct as N,wt as O,qt as P,At as S,Ut as T,$t as _,lt as a,St as c,_t as e,f,Ft as g,Pt as h,gt as i,tt as j,X as l,Rt as m,mt as o,Mt as r,Ot as u,j as w,Q as y}; +import{cY as G,dg as N,ha as x,ae as H}from"./story-Doly9N9p.js";import{y as I,b as L,S as $,L as d,r as _,j as y,R as V,l as M,_ as p}from"./vec32-D9GsKZ1t-BPSFE14A.js";import"./vec42-D8CJyqHG-DnfLTeQH.js";import{n as J}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{t as K}from"./mat4f64-Dn1WEGBx-C99QVUMW.js";import{e as Y}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{o as k}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{o as z}from"./vec4f64-hf2nxvhQ-CaAr8PTM.js";function X(t,r){return I(t,r)/L(t)}function _t(t,r){const e=I(t,r)/(L(t)*L(r));return-x(e)}function Mt(t,r,e){M(C,t),M(v,r);const c=I(C,v),i=x(c),n=$(C,C,v);return I(n,e)<0?2*Math.PI-i:i}const C=N(),v=N();let S=class E{constructor(r){this._create=r,this._items=new Array,this._itemsPtr=0}get(){return this._itemsPtr===0&&G(()=>this._reset()),this._itemsPtr>=this._items.length&&this._items.push(this._create()),this._items[this._itemsPtr++]}_reset(){const r=2*this._itemsPtr;this._items.length>r&&(this._items.length=r),this._itemsPtr=0}static createVec2f64(){return new E(k)}static createVec3f64(){return new E(N)}static createVec4f64(){return new E(z)}static createMat3f64(){return new E(J)}static createMat4f64(){return new E(K)}static createQuatf64(){return new E(Y)}get test(){}};const St=S.createVec2f64(),f=S.createVec3f64(),W=S.createVec4f64();S.createMat3f64();const mt=S.createMat4f64(),gt=S.createQuatf64();function Ot(t){const r=t[0]*t[0]+t[4]*t[4]+t[8]*t[8],e=t[1]*t[1]+t[5]*t[5]+t[9]*t[9],c=t[2]*t[2]+t[6]*t[6]+t[10]*t[10];return Math.sqrt(Math.max(r,e,c))}function Dt(t,r){const e=Math.sqrt(r[0]*r[0]+r[4]*r[4]+r[8]*r[8]),c=Math.sqrt(r[1]*r[1]+r[5]*r[5]+r[9]*r[9]),i=Math.sqrt(r[2]*r[2]+r[6]*r[6]+r[10]*r[10]);return p(t,e,c,i),t}function Z(t,r,e){Math.abs(t[0])>Math.abs(t[1])?p(r,0,1,0):p(r,1,0,0),$(e,t,r),$(r,e,t),M(e,e),M(r,r)}function Q(t=O){return[t[0],t[1],t[2],t[3]]}function lt(t=O[0],r=O[1],e=O[2],c=O[3]){return B(t,r,e,c,W.get())}function tt(t,r){return B(r[0],r[1],r[2],r[3],t)}function Ct(t){return t}function B(t,r,e,c,i=Q()){return i[0]=t,i[1]=r,i[2]=e,i[3]=c,i}function rt(t,r,e){const c=r[0]*r[0]+r[1]*r[1]+r[2]*r[2],i=Math.abs(c-1)>1e-5&&c>1e-12?1/Math.sqrt(c):1;return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=-(e[0]*t[0]+e[1]*t[1]+e[2]*t[2]),e}function et(t,r,e,c=Q()){const i=e[0]-r[0],n=e[1]-r[1],a=e[2]-r[2],o=t[0]-r[0],D=t[1]-r[1],l=t[2]-r[2],m=n*l-a*D,F=a*o-i*l,b=i*D-n*o,w=m*m+F*F+b*b,q=Math.abs(w-1)>1e-5&&w>1e-12?1/Math.sqrt(w):1;return c[0]=m*q,c[1]=F*q,c[2]=b*q,c[3]=-(c[0]*t[0]+c[1]*t[1]+c[2]*t[2]),c}function ct(t,r,e,c=0,i=Math.floor(e*(1/3)),n=Math.floor(e*(2/3))){if(e<3)return!1;r(g,c);let a=i,o=!1;for(;a=0}function bt(t,r,e){const c=d(f.get(),t,-t[3]),i=ot(t,_(f.get(),r,c),f.get());return y(e,i,c),e}function wt(t,r,e,c){const i=t,n=f.get(),a=f.get();Z(i,n,a);const o=_(f.get(),e,r),D=X(n,o),l=X(a,o),m=X(i,o);return p(c,D,l,m)}function ot(t,r,e){const c=d(f.get(),t,I(t,r));return _(e,r,c),e}function qt(t,r){return Math.abs(j(t,r))}function j(t,r){return I(t,r)+t[3]}var s;function A(t){return t===s.INTERSECTS_INSIDE_OUT||t===s.INTERSECTS_OUTSIDE_IN}function R(t,r,e,c,i){const n=I(t,e),a=j(t,r);if(n===0)return a>=0?s.INSIDE:s.OUTSIDE;let o=-a/n;return c&u.CLAMP&&(o=H(o,0,1)),!(c&u.INFINITE_MIN)&&o<0||!(c&u.INFINITE_MAX)&&o>1?a>=0?s.INSIDE:s.OUTSIDE:(y(i,r,d(i,e,o)),a>=0?s.INTERSECTS_INSIDE_OUT:s.INTERSECTS_OUTSIDE_IN)}(function(t){t[t.INTERSECTS_INSIDE_OUT=0]="INTERSECTS_INSIDE_OUT",t[t.INTERSECTS_OUTSIDE_IN=1]="INTERSECTS_OUTSIDE_IN",t[t.INSIDE=2]="INSIDE",t[t.OUTSIDE=3]="OUTSIDE"})(s||(s={}));const O=[0,0,1,0];var u;(function(t){t[t.NONE=0]="NONE",t[t.CLAMP=1]="CLAMP",t[t.INFINITE_MIN=4]="INFINITE_MIN",t[t.INFINITE_MAX=8]="INFINITE_MAX"})(u||(u={}));const at=u.INFINITE_MIN|u.INFINITE_MAX,nt=u.INFINITE_MAX;export{Z as $,rt as B,bt as D,et as G,B as H,Dt as I,W as J,ct as K,pt as M,Ct as N,wt as O,qt as P,At as S,Ut as T,$t as _,lt as a,St as c,_t as e,f,Ft as g,Pt as h,gt as i,tt as j,X as l,Rt as m,mt as o,Mt as r,Ot as u,j as w,Q as y}; diff --git a/custom-toc-highlight/assets/popupUtils-B0uZcXX0-DtBp-byj.js b/custom-toc-highlight/assets/popupUtils-B0uZcXX0-DHyOz1jC.js similarity index 96% rename from custom-toc-highlight/assets/popupUtils-B0uZcXX0-DtBp-byj.js rename to custom-toc-highlight/assets/popupUtils-B0uZcXX0-DHyOz1jC.js index 03610b0c..9324a55c 100644 --- a/custom-toc-highlight/assets/popupUtils-B0uZcXX0-DtBp-byj.js +++ b/custom-toc-highlight/assets/popupUtils-B0uZcXX0-DHyOz1jC.js @@ -1 +1 @@ -import{bL as u,ej as f,ek as m,el as p,em as o,en as b,eo as g,ep as F,eq as w}from"./story-BfX8CRfG.js";function D({displayField:e,editFieldsInfo:i,fields:t,objectIdField:s,title:l},n){if(!t)return null;const a=h({editFieldsInfo:i,fields:t,objectIdField:s},n);if(!a.length)return null;const r=N({titleBase:l,fields:t,displayField:e}),c=C();return new u({title:r,content:c,fieldInfos:a})}function T(e){const{title:i,graphic:t}=e??{},{attributes:s,sourceLayer:l}=t??{},n=l&&"displayField"in l?l.displayField:null,a=n?s?.[n]:null,r=t?.getObjectId()?.toString();return i||a||r||""}const y=(e,i)=>i.visibleFieldNames?i.visibleFieldNames.has(e.name):w(e,i);function L({fields:e,ignoreFieldTypes:i,sortDisabled:t}){const s=e;return i&&(e=e.filter(l=>!i.includes(l.type))),e===s&&(e=e.slice()),t!==!0&&e.sort(I),e}function I(e,i){return e.type==="oid"?-1:i.type==="oid"?1:d(e)?-1:d(i)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((i.alias||i.name).toLocaleLowerCase())}function h(e,i){const t=i?.visibleFieldNames;return L({fields:e.fields??[],ignoreFieldTypes:i?.ignoreFieldTypes||S,sortDisabled:i?.sortDisabled}).map(s=>new f({fieldName:s.name,isEditable:m(s,e),label:s.alias,format:v(s),visible:y(s,{...e,visibleFieldNames:t})}))}function v(e){switch(e.type){case"small-integer":case"integer":case"single":return new o({digitSeparator:!0,places:0});case"double":return new o({digitSeparator:!0,places:2});case"string":return p(e.name)?new o({digitSeparator:!0,places:0}):void 0;default:return}}function C(){return[new b,new g]}function N(e){const i=F(e),{titleBase:t}=e;return i?`${t}: {${i.trim()}}`:t??""}function d(e){return(e.name&&e.name.toLowerCase())==="name"?!0:e.alias?.toLowerCase()==="name"}const S=["geometry","blob","raster","guid","xml"];export{T as L,D as w}; +import{bL as u,ej as f,ek as m,el as p,em as o,en as b,eo as g,ep as F,eq as w}from"./story-Doly9N9p.js";function D({displayField:e,editFieldsInfo:i,fields:t,objectIdField:s,title:l},n){if(!t)return null;const a=h({editFieldsInfo:i,fields:t,objectIdField:s},n);if(!a.length)return null;const r=N({titleBase:l,fields:t,displayField:e}),c=C();return new u({title:r,content:c,fieldInfos:a})}function T(e){const{title:i,graphic:t}=e??{},{attributes:s,sourceLayer:l}=t??{},n=l&&"displayField"in l?l.displayField:null,a=n?s?.[n]:null,r=t?.getObjectId()?.toString();return i||a||r||""}const y=(e,i)=>i.visibleFieldNames?i.visibleFieldNames.has(e.name):w(e,i);function L({fields:e,ignoreFieldTypes:i,sortDisabled:t}){const s=e;return i&&(e=e.filter(l=>!i.includes(l.type))),e===s&&(e=e.slice()),t!==!0&&e.sort(I),e}function I(e,i){return e.type==="oid"?-1:i.type==="oid"?1:d(e)?-1:d(i)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((i.alias||i.name).toLocaleLowerCase())}function h(e,i){const t=i?.visibleFieldNames;return L({fields:e.fields??[],ignoreFieldTypes:i?.ignoreFieldTypes||S,sortDisabled:i?.sortDisabled}).map(s=>new f({fieldName:s.name,isEditable:m(s,e),label:s.alias,format:v(s),visible:y(s,{...e,visibleFieldNames:t})}))}function v(e){switch(e.type){case"small-integer":case"integer":case"single":return new o({digitSeparator:!0,places:0});case"double":return new o({digitSeparator:!0,places:2});case"string":return p(e.name)?new o({digitSeparator:!0,places:0}):void 0;default:return}}function C(){return[new b,new g]}function N(e){const i=F(e),{titleBase:t}=e;return i?`${t}: {${i.trim()}}`:t??""}function d(e){return(e.name&&e.name.toLowerCase())==="name"?!0:e.alias?.toLowerCase()==="name"}const S=["geometry","blob","raster","guid","xml"];export{T as L,D as w}; diff --git a/custom-toc-highlight/assets/popupUtils-nV1O8RUO-DAL58cHP.js b/custom-toc-highlight/assets/popupUtils-nV1O8RUO-BYG2KoFf.js similarity index 91% rename from custom-toc-highlight/assets/popupUtils-nV1O8RUO-DAL58cHP.js rename to custom-toc-highlight/assets/popupUtils-nV1O8RUO-BYG2KoFf.js index 64b4d4b0..cdab2eb8 100644 --- a/custom-toc-highlight/assets/popupUtils-nV1O8RUO-DAL58cHP.js +++ b/custom-toc-highlight/assets/popupUtils-nV1O8RUO-BYG2KoFf.js @@ -1 +1 @@ -import{j1 as r,ed as c}from"./story-BfX8CRfG.js";async function m(e,d=e.popupTemplate){if(d==null)return[];const s=await d.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:i}=d,{objectIdField:p,typeIdField:n,globalIdField:u,relationships:a}=e;if(s.includes("*"))return["*"];const o=i?r(e):[],l=c(e.fieldsIndex,[...s,...o]);return n&&l.push(n),l&&p&&e.fieldsIndex?.has(p)&&!l.includes(p)&&l.push(p),l&&u&&e.fieldsIndex?.has(u)&&!l.includes(u)&&l.push(u),a&&a.forEach(f=>{const{keyField:t}=f;l&&t&&e.fieldsIndex?.has(t)&&!l.includes(t)&&l.push(t)}),l}function I(e,d){return e.popupTemplate?e.popupTemplate:d!=null&&d.defaultPopupTemplateEnabled&&e.defaultPopupTemplate!=null?e.defaultPopupTemplate:null}export{m as h,I as m}; +import{j1 as r,ed as c}from"./story-Doly9N9p.js";async function m(e,d=e.popupTemplate){if(d==null)return[];const s=await d.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:i}=d,{objectIdField:p,typeIdField:n,globalIdField:u,relationships:a}=e;if(s.includes("*"))return["*"];const o=i?r(e):[],l=c(e.fieldsIndex,[...s,...o]);return n&&l.push(n),l&&p&&e.fieldsIndex?.has(p)&&!l.includes(p)&&l.push(p),l&&u&&e.fieldsIndex?.has(u)&&!l.includes(u)&&l.push(u),a&&a.forEach(f=>{const{keyField:t}=f;l&&t&&e.fieldsIndex?.has(t)&&!l.includes(t)&&l.push(t)}),l}function I(e,d){return e.popupTemplate?e.popupTemplate:d!=null&&d.defaultPopupTemplateEnabled&&e.defaultPopupTemplate!=null?e.defaultPopupTemplate:null}export{m as h,I as m}; diff --git a/custom-toc-highlight/assets/portalItemUtils-B8bw6SAG-CuS3mZw4.js b/custom-toc-highlight/assets/portalItemUtils-B8bw6SAG-DF460C0Y.js similarity index 90% rename from custom-toc-highlight/assets/portalItemUtils-B8bw6SAG-CuS3mZw4.js rename to custom-toc-highlight/assets/portalItemUtils-B8bw6SAG-DF460C0Y.js index 4074bdca..41d335ef 100644 --- a/custom-toc-highlight/assets/portalItemUtils-B8bw6SAG-CuS3mZw4.js +++ b/custom-toc-highlight/assets/portalItemUtils-B8bw6SAG-DF460C0Y.js @@ -1 +1 @@ -import{N as u,K as l}from"./projection-BA9M1R7d-BYoCXVXt.js";import{d6 as E,J as f}from"./story-BfX8CRfG.js";async function d(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return E(e);const n=f.WGS84;return await u(t,n),l(e,n)}function p(e,t){if(!c(e,t)){const n=e.typeKeywords;n?n.push(t):e.typeKeywords=[t]}}function c(e,t){return!!e.typeKeywords?.includes(t)}function L(e){return c(e,y.HOSTED_SERVICE)}function A(e,t){const n=e.typeKeywords;if(n){const r=n.indexOf(t);r>-1&&n.splice(r,1)}}function m(e,t,n){n?p(e,t):A(e,t)}async function R(e){const t=e.clone().normalize();let n;if(t.length>1)for(const r of t)n?r.width>n.width&&(n=r):n=r;else n=t[0];return d(n)}const y={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer"};function M(e){const{portal:t,isOrgItem:n,itemControl:r}=e,i=t.user?.privileges;let o=!i||i.includes("features:user:edit"),s=!!n&&!!i?.includes("features:user:fullEdit");const a=r==="update"||r==="admin";return a?s=o=!0:s&&(o=!0),{features:{edit:o,fullEdit:s},content:{updateItem:a}}}export{y as E,L as I,m as L,R as S,A as l,M as m,c as o,p as u}; +import{N as u,K as l}from"./projection-BA9M1R7d-CAbqHZiw.js";import{d6 as E,J as f}from"./story-Doly9N9p.js";async function d(e){const t=e.spatialReference;if(t.isWGS84)return e.clone();if(t.isWebMercator)return E(e);const n=f.WGS84;return await u(t,n),l(e,n)}function p(e,t){if(!c(e,t)){const n=e.typeKeywords;n?n.push(t):e.typeKeywords=[t]}}function c(e,t){return!!e.typeKeywords?.includes(t)}function L(e){return c(e,y.HOSTED_SERVICE)}function A(e,t){const n=e.typeKeywords;if(n){const r=n.indexOf(t);r>-1&&n.splice(r,1)}}function m(e,t,n){n?p(e,t):A(e,t)}async function R(e){const t=e.clone().normalize();let n;if(t.length>1)for(const r of t)n?r.width>n.width&&(n=r):n=r;else n=t[0];return d(n)}const y={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table",HOSTED_SERVICE:"Hosted Service",LOCAL_SCENE:"ViewingMode-Local",TILED_IMAGERY:"Tiled Imagery",GROUP_LAYER_MAP:"Map",ORIENTED_IMAGERY_LAYER:"OrientedImageryLayer"};function M(e){const{portal:t,isOrgItem:n,itemControl:r}=e,i=t.user?.privileges;let o=!i||i.includes("features:user:edit"),s=!!n&&!!i?.includes("features:user:fullEdit");const a=r==="update"||r==="admin";return a?s=o=!0:s&&(o=!0),{features:{edit:o,fullEdit:s},content:{updateItem:a}}}export{y as E,L as I,m as L,R as S,A as l,M as m,c as o,p as u}; diff --git a/custom-toc-highlight/assets/portalLayers-Bh9bAhk4-BP6A8Lj4.js b/custom-toc-highlight/assets/portalLayers-Bh9bAhk4-Y1T2RWf3.js similarity index 93% rename from custom-toc-highlight/assets/portalLayers-Bh9bAhk4-BP6A8Lj4.js rename to custom-toc-highlight/assets/portalLayers-Bh9bAhk4-Y1T2RWf3.js index 164340b7..92223d3a 100644 --- a/custom-toc-highlight/assets/portalLayers-Bh9bAhk4-BP6A8Lj4.js +++ b/custom-toc-highlight/assets/portalLayers-Bh9bAhk4-Y1T2RWf3.js @@ -1 +1 @@ -import{o as b,gG as f}from"./story-BfX8CRfG.js";import{b as S}from"./associatedFeatureServiceUtils-Bu76-Sxs-_75cAlaq.js";import{p as I,g as h,o as v}from"./fetchService-DbaKmJhP-W7rGyykJ.js";import w from"./PortalItem-CctGdnxF-C7IJrZYq.js";import{o as p}from"./portalItemUtils-B8bw6SAG-CuS3mZw4.js";import"./main-ugzBrWNm.js";import"./arcgisLayerUrl-HNYh8jvG-CxSAVuJD.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";class M{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(t,a){const r=this._serviceMetadatas.get(t);if(r)return r;const s=await v(t,a);return this._serviceMetadatas.set(t,s),s}async fetchItemData(t){const{id:a}=t;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const s=await t.fetchData();return r.set(a,s),s}async fetchCustomParameters(t,a){const r=await this.fetchItemData(t);return r&&typeof r=="object"&&(a?a(r):r.customParameters)||null}}function l(e){const t={id:e.id,name:e.name},a=h(e.type);return a!=="FeatureLayer"&&(t.layerType=a),t}async function P(e,t,a){if(e?.layers==null||e?.tables==null){const r=await a.fetchServiceMetadata(t,{customParameters:o(e)?.customParameters});(e=e||{}).layers=e.layers||r?.layers?.map(l),e.tables=e.tables||r?.tables?.map(l)}return e}function o(e){if(!e)return null;const{layers:t,tables:a}=e;return t?.length?t[0]:a?.length?a[0]:null}function T(e,t){return t==null?null:[...e.layers||[],...e.tables||[]].find(a=>a.id===t)}function ue(e,t){return[...e.layers||[],...e.tables||[]].filter(({layerType:a})=>a?a===t:t==="ArcGISFeatureLayer")}function L(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function ie(e){switch(e){case"catalog":return"CatalogLayer";case"feature":return"ArcGISFeatureLayer";case"oriented-imagery":return"OrientedImageryLayer";case"subtype-group":return"SubtypeGroupLayer"}return null}function G(e){switch(e){case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":return"SubtypeGroupLayer"}return"FeatureLayer"}async function C(e,t,a){if(!e?.url)return t??{};if(t??={},!t.layers){const n=await a.fetchServiceMetadata(e.url);t.layers=n.layers?.map(l)}const{serverUrl:r,portalItem:s}=await S(e.url,{sceneLayerItem:e,customParameters:o(t)?.customParameters}).catch(()=>({serverUrl:null,portalItem:null}));if(r==null)return t.tables=[],t;if(!t.tables&&s){const n=await s.fetchData().catch(()=>null);if(n?.tables)t.tables=n.tables.map(l);else{const c=await a.fetchServiceMetadata(r,{customParameters:o(n)?.customParameters}).catch(()=>null);t.tables=c?.tables?.map(l)}}if(t.tables)for(const n of t.tables)n.url=`${r}/${n.id}`;return t}async function F(e){let{portalItem:t}=e;!t||t instanceof w||(t=new w(t));const a=await D(t);return new a.constructor({portalItem:t,...a.properties})}async function D(e){await e.load();const t=new M;return $(await g(e,t))}async function g(e,t){switch(e.type){case"3DTiles Service":return x();case"CSV":return A();case"Feature Collection":return K(e);case"Feature Service":return j(e,t);case"Feed":return q();case"GeoJson":return k();case"Group Layer":return B();case"Image Service":return V(e,t);case"KML":return U();case"Knowledge Graph Layer":return E();case"Map Service":return O(e,t);case"Media Layer":return H();case"Scene Service":return _(e,t);case"Stream Service":return W();case"Vector Tile Service":return J();case"WFS":return R();case"WMS":return z();case"WMTS":return Z();default:throw new b("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function $(e){const t=e.className,a=I[t];return{constructor:await a(),properties:e.properties}}async function O(e,t){return await Q(e,t)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function j(e,t){const a=await N(e,t);if(typeof a=="object"){const{sourceJSON:r,className:s}=a,n={sourceJSON:r};return a.id!=null&&(n.layerId=a.id),{className:s||"FeatureLayer",properties:n}}return{className:"GroupLayer"}}async function _(e,t){const a=await N(e,t,async()=>{try{if(!e.url)return[];const{serverUrl:r}=await S(e.url,{sceneLayerItem:e});return(await t.fetchServiceMetadata(r))?.tables??[]}catch{return[]}});if(typeof a=="object"){const r={};let s;if(a.id!=null?(r.layerId=a.id,s=`${e.url}/layers/${a.id}`):s=e.url,e.typeKeywords?.length){for(const c of Object.keys(f))if(e.typeKeywords.includes(c))return{className:f[c]}}const n=await t.fetchServiceMetadata(s,{customParameters:await t.fetchCustomParameters(e,c=>o(c)?.customParameters)});return{className:f[n?.layerType]||"SceneLayer",properties:r}}return a===!1&&(await t.fetchServiceMetadata(e.url))?.layerType==="Voxel"?{className:"VoxelLayer"}:{className:"GroupLayer"}}async function K(e){await e.load();const t=p(e,"Map Notes"),a=p(e,"Markup");if(t||a)return{className:"MapNotesLayer"};if(p(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return L(r)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function V(e,t){await e.load();const a=e.typeKeywords?.map(m=>m.toLowerCase())??[];if(a.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(a.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await t.fetchItemData(e),s=r?.layerType;if(s==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(s==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const n=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)}),c=n.cacheType?.toLowerCase(),y=n.capabilities?.toLowerCase().includes("tilesonly"),u=n.tileInfo?.format?.toLowerCase()??"",i=c==null&&["jpg","jpeg","png","png8","png24","png32","mixed"].includes(u);return c==="map"||i||y?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function W(){return{className:"StreamLayer"}}function J(){return{className:"VectorTileLayer"}}function k(){return{className:"GeoJSONLayer"}}function x(){return{className:"IntegratedMesh3DTilesLayer"}}function A(){return{className:"CSVLayer"}}function U(){return{className:"KMLLayer"}}function E(){return{className:"KnowledgeGraphLayer"}}function R(){return{className:"WFSLayer"}}function z(){return{className:"WMSLayer"}}function Z(){return{className:"WMTSLayer"}}function q(){return{className:"StreamLayer"}}function B(){return{className:"GroupLayer"}}function H(){return{className:"MediaLayer"}}async function Q(e,t){const{tileInfo:a}=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)});return a}async function N(e,t,a){const{url:r,type:s}=e,n=s==="Feature Service";if(!r)return{};if(/\/\d+$/.test(r)){if(n){const u=await t.fetchServiceMetadata(r,{customParameters:await t.fetchCustomParameters(e,i=>o(i)?.customParameters)});return{id:u.id,className:h(u.type),sourceJSON:u}}return{}}await e.load();let c=await t.fetchItemData(e);if(n){const u=await P(c,r,t),i=d(u);if(typeof i=="object"){const m=T(u,i.id);i.className=G(m?.layerType)}return i}if(s==="Scene Service"&&(c=await C(e,c,t)),L(c)>0)return d(c);const y=await t.fetchServiceMetadata(r);return a&&(y.tables=await a()),d(y)}function d(e){return L(e)===1&&{id:o(e)?.id}}Object.freeze(Object.defineProperty({__proto__:null,fromItem:F,selectLayerClassPath:g},Symbol.toStringTag,{value:"Module"}));export{g as L,P as a,ie as c,M as e,G as i,o as l,ue as n,C as o,l as t,L as u}; +import{o as b,gG as f}from"./story-Doly9N9p.js";import{b as S}from"./associatedFeatureServiceUtils-Bu76-Sxs-Bf7NsKUj.js";import{p as I,g as h,o as v}from"./fetchService-DbaKmJhP-Ccg-phWf.js";import w from"./PortalItem-CctGdnxF-CfFOGshS.js";import{o as p}from"./portalItemUtils-B8bw6SAG-DF460C0Y.js";import"./main-QGPoLsvl.js";import"./arcgisLayerUrl-HNYh8jvG-C9dO8cs9.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";class M{constructor(){this._serviceMetadatas=new Map,this._itemDatas=new Map}async fetchServiceMetadata(t,a){const r=this._serviceMetadatas.get(t);if(r)return r;const s=await v(t,a);return this._serviceMetadatas.set(t,s),s}async fetchItemData(t){const{id:a}=t;if(!a)return null;const{_itemDatas:r}=this;if(r.has(a))return r.get(a);const s=await t.fetchData();return r.set(a,s),s}async fetchCustomParameters(t,a){const r=await this.fetchItemData(t);return r&&typeof r=="object"&&(a?a(r):r.customParameters)||null}}function l(e){const t={id:e.id,name:e.name},a=h(e.type);return a!=="FeatureLayer"&&(t.layerType=a),t}async function P(e,t,a){if(e?.layers==null||e?.tables==null){const r=await a.fetchServiceMetadata(t,{customParameters:o(e)?.customParameters});(e=e||{}).layers=e.layers||r?.layers?.map(l),e.tables=e.tables||r?.tables?.map(l)}return e}function o(e){if(!e)return null;const{layers:t,tables:a}=e;return t?.length?t[0]:a?.length?a[0]:null}function T(e,t){return t==null?null:[...e.layers||[],...e.tables||[]].find(a=>a.id===t)}function ue(e,t){return[...e.layers||[],...e.tables||[]].filter(({layerType:a})=>a?a===t:t==="ArcGISFeatureLayer")}function L(e){return(e?.layers?.length??0)+(e?.tables?.length??0)}function ie(e){switch(e){case"catalog":return"CatalogLayer";case"feature":return"ArcGISFeatureLayer";case"oriented-imagery":return"OrientedImageryLayer";case"subtype-group":return"SubtypeGroupLayer"}return null}function G(e){switch(e){case"CatalogLayer":return"CatalogLayer";case"OrientedImageryLayer":return"OrientedImageryLayer";case"SubtypeGroupLayer":return"SubtypeGroupLayer"}return"FeatureLayer"}async function C(e,t,a){if(!e?.url)return t??{};if(t??={},!t.layers){const n=await a.fetchServiceMetadata(e.url);t.layers=n.layers?.map(l)}const{serverUrl:r,portalItem:s}=await S(e.url,{sceneLayerItem:e,customParameters:o(t)?.customParameters}).catch(()=>({serverUrl:null,portalItem:null}));if(r==null)return t.tables=[],t;if(!t.tables&&s){const n=await s.fetchData().catch(()=>null);if(n?.tables)t.tables=n.tables.map(l);else{const c=await a.fetchServiceMetadata(r,{customParameters:o(n)?.customParameters}).catch(()=>null);t.tables=c?.tables?.map(l)}}if(t.tables)for(const n of t.tables)n.url=`${r}/${n.id}`;return t}async function F(e){let{portalItem:t}=e;!t||t instanceof w||(t=new w(t));const a=await D(t);return new a.constructor({portalItem:t,...a.properties})}async function D(e){await e.load();const t=new M;return $(await g(e,t))}async function g(e,t){switch(e.type){case"3DTiles Service":return x();case"CSV":return A();case"Feature Collection":return K(e);case"Feature Service":return j(e,t);case"Feed":return q();case"GeoJson":return k();case"Group Layer":return B();case"Image Service":return V(e,t);case"KML":return U();case"Knowledge Graph Layer":return E();case"Map Service":return O(e,t);case"Media Layer":return H();case"Scene Service":return _(e,t);case"Stream Service":return W();case"Vector Tile Service":return J();case"WFS":return R();case"WMS":return z();case"WMTS":return Z();default:throw new b("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type})}}async function $(e){const t=e.className,a=I[t];return{constructor:await a(),properties:e.properties}}async function O(e,t){return await Q(e,t)?{className:"TileLayer"}:{className:"MapImageLayer"}}async function j(e,t){const a=await N(e,t);if(typeof a=="object"){const{sourceJSON:r,className:s}=a,n={sourceJSON:r};return a.id!=null&&(n.layerId=a.id),{className:s||"FeatureLayer",properties:n}}return{className:"GroupLayer"}}async function _(e,t){const a=await N(e,t,async()=>{try{if(!e.url)return[];const{serverUrl:r}=await S(e.url,{sceneLayerItem:e});return(await t.fetchServiceMetadata(r))?.tables??[]}catch{return[]}});if(typeof a=="object"){const r={};let s;if(a.id!=null?(r.layerId=a.id,s=`${e.url}/layers/${a.id}`):s=e.url,e.typeKeywords?.length){for(const c of Object.keys(f))if(e.typeKeywords.includes(c))return{className:f[c]}}const n=await t.fetchServiceMetadata(s,{customParameters:await t.fetchCustomParameters(e,c=>o(c)?.customParameters)});return{className:f[n?.layerType]||"SceneLayer",properties:r}}return a===!1&&(await t.fetchServiceMetadata(e.url))?.layerType==="Voxel"?{className:"VoxelLayer"}:{className:"GroupLayer"}}async function K(e){await e.load();const t=p(e,"Map Notes"),a=p(e,"Markup");if(t||a)return{className:"MapNotesLayer"};if(p(e,"Route Layer"))return{className:"RouteLayer"};const r=await e.fetchData();return L(r)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function V(e,t){await e.load();const a=e.typeKeywords?.map(m=>m.toLowerCase())??[];if(a.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(a.includes("tiled imagery"))return{className:"ImageryTileLayer"};const r=await t.fetchItemData(e),s=r?.layerType;if(s==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(s==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const n=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)}),c=n.cacheType?.toLowerCase(),y=n.capabilities?.toLowerCase().includes("tilesonly"),u=n.tileInfo?.format?.toLowerCase()??"",i=c==null&&["jpg","jpeg","png","png8","png24","png32","mixed"].includes(u);return c==="map"||i||y?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function W(){return{className:"StreamLayer"}}function J(){return{className:"VectorTileLayer"}}function k(){return{className:"GeoJSONLayer"}}function x(){return{className:"IntegratedMesh3DTilesLayer"}}function A(){return{className:"CSVLayer"}}function U(){return{className:"KMLLayer"}}function E(){return{className:"KnowledgeGraphLayer"}}function R(){return{className:"WFSLayer"}}function z(){return{className:"WMSLayer"}}function Z(){return{className:"WMTSLayer"}}function q(){return{className:"StreamLayer"}}function B(){return{className:"GroupLayer"}}function H(){return{className:"MediaLayer"}}async function Q(e,t){const{tileInfo:a}=await t.fetchServiceMetadata(e.url,{customParameters:await t.fetchCustomParameters(e)});return a}async function N(e,t,a){const{url:r,type:s}=e,n=s==="Feature Service";if(!r)return{};if(/\/\d+$/.test(r)){if(n){const u=await t.fetchServiceMetadata(r,{customParameters:await t.fetchCustomParameters(e,i=>o(i)?.customParameters)});return{id:u.id,className:h(u.type),sourceJSON:u}}return{}}await e.load();let c=await t.fetchItemData(e);if(n){const u=await P(c,r,t),i=d(u);if(typeof i=="object"){const m=T(u,i.id);i.className=G(m?.layerType)}return i}if(s==="Scene Service"&&(c=await C(e,c,t)),L(c)>0)return d(c);const y=await t.fetchServiceMetadata(r);return a&&(y.tables=await a()),d(y)}function d(e){return L(e)===1&&{id:o(e)?.id}}Object.freeze(Object.defineProperty({__proto__:null,fromItem:F,selectLayerClassPath:g},Symbol.toStringTag,{value:"Module"}));export{g as L,P as a,ie as c,M as e,G as i,o as l,ue as n,C as o,l as t,L as u}; diff --git a/custom-toc-highlight/assets/portalUtils-CKN9iXwH-B2zCer9u.js b/custom-toc-highlight/assets/portalUtils-CKN9iXwH-B2zCer9u.js deleted file mode 100644 index f4c926c1..00000000 --- a/custom-toc-highlight/assets/portalUtils-CKN9iXwH-B2zCer9u.js +++ /dev/null @@ -1 +0,0 @@ -import{r as u}from"./story-BfX8CRfG.js";function f(r,n){return r===null?n:new u({url:r.field("url")})}export{f as n}; diff --git a/custom-toc-highlight/assets/portalUtils-CKN9iXwH-BDO5uTJS.js b/custom-toc-highlight/assets/portalUtils-CKN9iXwH-BDO5uTJS.js new file mode 100644 index 00000000..cfcba7b7 --- /dev/null +++ b/custom-toc-highlight/assets/portalUtils-CKN9iXwH-BDO5uTJS.js @@ -0,0 +1 @@ +import{r as u}from"./story-Doly9N9p.js";function f(r,n){return r===null?n:new u({url:r.field("url")})}export{f as n}; diff --git a/custom-toc-highlight/assets/project-DQKhruav-DBiiXhMD.js b/custom-toc-highlight/assets/project-DQKhruav-CyFgbMSU.js similarity index 89% rename from custom-toc-highlight/assets/project-DQKhruav-DBiiXhMD.js rename to custom-toc-highlight/assets/project-DQKhruav-CyFgbMSU.js index 0aa53cf5..f81fcea1 100644 --- a/custom-toc-highlight/assets/project-DQKhruav-DBiiXhMD.js +++ b/custom-toc-highlight/assets/project-DQKhruav-CyFgbMSU.js @@ -1 +1 @@ -import{v as s,S as i,i as l,bG as d,e as S,bM as n,bK as f,f as y}from"./story-BfX8CRfG.js";import{y as g,a as R}from"./utils-9sQxfkoa-KicvrT8N.js";import{f as w}from"./utils-Bq23Xwmj--_SaacS5.js";let e=class extends S{constructor(o){super(o),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const o=this.geometries.map(a=>a.toJSON()),t=this.geometries[0],r={};return r.outSR=n(this.outSpatialReference),r.inSR=n(t.spatialReference),r.geometries=JSON.stringify({geometryType:f(t),geometries:o}),this.transformation&&(r.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(r.transformForward=this.transformForward),r}};s([i()],e.prototype,"geometries",void 0),s([i({json:{read:{source:"outSR"}}})],e.prototype,"outSpatialReference",void 0),s([i()],e.prototype,"transformation",void 0),s([i()],e.prototype,"transformForward",void 0),e=s([l("esri.rest.support.ProjectParameters")],e);const O=e,j=d(O);async function N(o,t,r){t=j(t);const a=g(o),m={...a.query,f:"json",...t.toJSON()},p=t.outSpatialReference,u=f(t.geometries[0]),c=R(m,r);return y(a.path+"/project",c).then(({data:{geometries:h}})=>w(h,u,p))}export{O as f,N as j}; +import{v as s,S as i,i as l,bG as d,e as S,bM as n,bK as f,f as y}from"./story-Doly9N9p.js";import{y as g,a as R}from"./utils-9sQxfkoa-D8FX0sO8.js";import{f as w}from"./utils-Bq23Xwmj-CKlS81kz.js";let e=class extends S{constructor(o){super(o),this.geometries=[],this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const o=this.geometries.map(a=>a.toJSON()),t=this.geometries[0],r={};return r.outSR=n(this.outSpatialReference),r.inSR=n(t.spatialReference),r.geometries=JSON.stringify({geometryType:f(t),geometries:o}),this.transformation&&(r.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(r.transformForward=this.transformForward),r}};s([i()],e.prototype,"geometries",void 0),s([i({json:{read:{source:"outSR"}}})],e.prototype,"outSpatialReference",void 0),s([i()],e.prototype,"transformation",void 0),s([i()],e.prototype,"transformForward",void 0),e=s([l("esri.rest.support.ProjectParameters")],e);const O=e,j=d(O);async function N(o,t,r){t=j(t);const a=g(o),m={...a.query,f:"json",...t.toJSON()},p=t.outSpatialReference,u=f(t.geometries[0]),c=R(m,r);return y(a.path+"/project",c).then(({data:{geometries:h}})=>w(h,u,p))}export{O as f,N as j}; diff --git a/custom-toc-highlight/assets/projectBuffer-CvCBvJ6W-dLD7ajBt.js b/custom-toc-highlight/assets/projectBuffer-CvCBvJ6W-KqAd8Vef.js similarity index 98% rename from custom-toc-highlight/assets/projectBuffer-CvCBvJ6W-dLD7ajBt.js rename to custom-toc-highlight/assets/projectBuffer-CvCBvJ6W-KqAd8Vef.js index 6421a551..7e7d25fc 100644 --- a/custom-toc-highlight/assets/projectBuffer-CvCBvJ6W-dLD7ajBt.js +++ b/custom-toc-highlight/assets/projectBuffer-CvCBvJ6W-KqAd8Vef.js @@ -1 +1 @@ -import{dk as O,dl as m,dm as K,B as R0,ae as u0,bj as l0,dn as C0,aC as f0,p as _0,db as A0,dc as P0,dd as S0,dp as O0,dq as s0,dr as M0,ds as N0,dt as i0,du as r0,dv as c0}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";const x0=Math.PI/180,v0=/(?:SPHEROID|ELLIPSOID)\[([^\]]+)]/i,N=O.radius,S=O.eccentricitySquared,L0={a1:N*S,a2:N*S*N*S,a3:N*S*S/2,a4:N*S*N*S*2.5,a5:N*S+N*S*S/2,a6:1-S},D0={4267:{a:63782064e-1,f:1/294.9786982},4269:{a:6378137,f:1/298.257222101},4326:{a:O.radius,f:O.flattening},4490:{a:6378137,f:1/298.257222101},104900:{a:2439700,f:0},104901:{a:6051e3,f:0},104902:{a:6051800,f:0},104903:{a:m.radius,f:m.flattening},104904:{a:3393400,f:1/192.0430107526882},104905:{a:K.radius,f:K.flattening},104906:{a:6200,f:0},104907:{a:11100,f:0},104908:{a:71492e3,f:.06487439154031222},104909:{a:8200,f:0},104910:{a:83500,f:0},104911:{a:1e4,f:0},104912:{a:2409300,f:0},104913:{a:15e3,f:0},104914:{a:4e4,f:0},104915:{a:1562090,f:0},104916:{a:2632345,f:0},104917:{a:85e3,f:0},104918:{a:1821460,f:0},104919:{a:5e3,f:0},104920:{a:12e3,f:0},104921:{a:3e4,f:3},104922:{a:18e3,f:0},104923:{a:14e3,f:0},104924:{a:49300,f:0},104925:{a:60268e3,f:1/10.2079945799458},104926:{a:16e3,f:0},104927:{a:9500,f:0},104928:{a:56e4,f:0},104929:{a:249400,f:0},104930:{a:59500,f:0},104931:{a:16e3,f:0},104932:{a:133e3,f:0},104933:{a:718e3,f:0},104934:{a:888e3,f:0},104935:{a:1986300,f:0},104936:{a:1e4,f:0},104937:{a:41900,f:0},104938:{a:11e4,f:0},104939:{a:50100,f:0},104940:{a:764e3,f:0},104941:{a:11e3,f:0},104942:{a:529800,f:0},104943:{a:2575e3,f:0},104944:{a:25559e3,f:1/43.61604095563141},104945:{a:578900,f:0},104946:{a:33e3,f:0},104947:{a:21e3,f:0},104948:{a:13e3,f:0},104949:{a:31e3,f:0},104950:{a:27e3,f:0},104951:{a:42e3,f:0},104952:{a:235800,f:0},104953:{a:761400,f:0},104954:{a:15e3,f:0},104955:{a:54e3,f:0},104956:{a:77e3,f:0},104957:{a:27e3,f:0},104958:{a:788900,f:0},104959:{a:584700,f:0},104960:{a:24764e3,f:.01708124697141011},104961:{a:74e3,f:0},104962:{a:79e3,f:0},104963:{a:104e3,f:.14423076923076922},104964:{a:29e3,f:0},104965:{a:17e4,f:0},104966:{a:208e3,f:0},104967:{a:4e4,f:0},104968:{a:1352600,f:0},104969:{a:1195e3,f:0},104970:{a:593e3,f:0},104971:{a:K.radius,f:0},104972:{a:47e4,f:0},104973:{a:255e3,f:0},104974:{a:2439400,f:0}};var a;(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.SPHERICAL_MARS_PCPF=6]="SPHERICAL_MARS_PCPF",e[e.GCSMARS2000=7]="GCSMARS2000",e[e.SPHERICAL_MOON_PCPF=8]="SPHERICAL_MOON_PCPF",e[e.GCSMOON2000=9]="GCSMOON2000",e[e.LON_LAT=10]="LON_LAT",e[e.PLATE_CARREE=11]="PLATE_CARREE"})(a||(a={}));const o0={[a.WGS84]:{[a.CGCS2000]:l,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:l,[a.SPHERICAL_ECEF]:j,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:I,[a.PLATE_CARREE]:W,[a.WGS84]:l,[a.WGS84_ECEF]:H},[a.CGCS2000]:{[a.CGCS2000]:l,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:l,[a.SPHERICAL_ECEF]:j,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:I,[a.PLATE_CARREE]:W,[a.WGS84]:l,[a.WGS84_ECEF]:H},[a.GCSMARS2000]:{[a.CGCS2000]:null,[a.GCSMARS2000]:l,[a.GCSMOON2000]:null,[a.LON_LAT]:l,[a.SPHERICAL_ECEF]:null,[a.SPHERICAL_MARS_PCPF]:Z,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:null,[a.PLATE_CARREE]:null,[a.WGS84]:null,[a.WGS84_ECEF]:null},[a.GCSMOON2000]:{[a.CGCS2000]:null,[a.GCSMARS2000]:null,[a.GCSMOON2000]:l,[a.LON_LAT]:l,[a.SPHERICAL_ECEF]:null,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:Y,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:null,[a.PLATE_CARREE]:null,[a.WGS84]:null,[a.WGS84_ECEF]:null},[a.WEB_MERCATOR]:{[a.CGCS2000]:B,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:B,[a.SPHERICAL_ECEF]:I0,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:l,[a.PLATE_CARREE]:d0,[a.WGS84]:B,[a.WGS84_ECEF]:W0},[a.WGS84_ECEF]:{[a.CGCS2000]:T,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:T,[a.SPHERICAL_ECEF]:q0,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:m0,[a.PLATE_CARREE]:H0,[a.WGS84]:T,[a.WGS84_ECEF]:l},[a.SPHERICAL_ECEF]:{[a.CGCS2000]:d,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:d,[a.SPHERICAL_ECEF]:l,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:K0,[a.PLATE_CARREE]:T0,[a.WGS84]:d,[a.WGS84_ECEF]:B0},[a.SPHERICAL_MARS_PCPF]:{[a.CGCS2000]:null,[a.GCSMARS2000]:a0,[a.GCSMOON2000]:null,[a.LON_LAT]:a0,[a.SPHERICAL_ECEF]:null,[a.SPHERICAL_MARS_PCPF]:l,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:null,[a.PLATE_CARREE]:null,[a.WGS84]:null,[a.WGS84_ECEF]:null},[a.SPHERICAL_MOON_PCPF]:{[a.CGCS2000]:null,[a.GCSMARS2000]:null,[a.GCSMOON2000]:$,[a.LON_LAT]:$,[a.SPHERICAL_ECEF]:null,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:l,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:null,[a.PLATE_CARREE]:null,[a.WGS84]:null,[a.WGS84_ECEF]:null},[a.UNKNOWN]:{[a.CGCS2000]:null,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:null,[a.SPHERICAL_ECEF]:null,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:l,[a.WEB_MERCATOR]:null,[a.PLATE_CARREE]:null,[a.WGS84]:null,[a.WGS84_ECEF]:null},[a.LON_LAT]:{[a.CGCS2000]:l,[a.GCSMARS2000]:l,[a.GCSMOON2000]:l,[a.LON_LAT]:l,[a.SPHERICAL_ECEF]:j,[a.SPHERICAL_MARS_PCPF]:Z,[a.SPHERICAL_MOON_PCPF]:Y,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:I,[a.PLATE_CARREE]:W,[a.WGS84]:l,[a.WGS84_ECEF]:H},[a.PLATE_CARREE]:{[a.CGCS2000]:F,[a.GCSMARS2000]:null,[a.GCSMOON2000]:null,[a.LON_LAT]:F,[a.SPHERICAL_ECEF]:p0,[a.SPHERICAL_MARS_PCPF]:null,[a.SPHERICAL_MOON_PCPF]:null,[a.UNKNOWN]:null,[a.WEB_MERCATOR]:h0,[a.PLATE_CARREE]:l,[a.WGS84]:F,[a.WGS84_ECEF]:U0}};function G0(e,t,n=E0()){return e==null||t==null?null:k0(e,t,n).projector}function X(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=_0(e,1)),A0(e)?t.spatialReferenceId=a.SPHERICAL_ECEF:P0(e)?t.spatialReferenceId=a.WGS84:S0(e)?t.spatialReferenceId=a.WEB_MERCATOR:O0(e)?t.spatialReferenceId=a.PLATE_CARREE:e.wkt===s0.wkt?t.spatialReferenceId=a.WGS84_ECEF:e.wkid===M0.CGCS2000?t.spatialReferenceId=a.CGCS2000:e.wkt===N0.wkt?t.spatialReferenceId=a.SPHERICAL_MARS_PCPF:e.wkt===i0.wkt?t.spatialReferenceId=a.SPHERICAL_MOON_PCPF:r0(e)?t.spatialReferenceId=a.GCSMARS2000:c0(e)?t.spatialReferenceId=a.GCSMOON2000:t.spatialReferenceId=a.UNKNOWN):a.UNKNOWN}function l(e,t,n,E){e!==n&&(n[E++]=e[t++],n[E++]=e[t++],n[E]=e[t])}function B(e,t,n,E){n[E]=h*(e[t]/c),n[E+1]=h*(t0-2*Math.atan(Math.exp(-e[t+1]/c))),n[E+2]=e[t+2]}function I0(e,t,n,E){const u=e[t]/c,C=t0-2*Math.atan(Math.exp(-e[t+1]/c)),f=c+e[t+2],R=Math.cos(C)*f;n[E]=Math.cos(u)*R,n[E+1]=Math.sin(u)*R,n[E+2]=Math.sin(C)*f}function W0(e,t,n,E){B(e,t,n,E),H(n,E,n,E)}function F0(e,t,n,E,u){const C=.4999999*k,f=u0(p*e[t+1],-C,C),R=Math.sin(f);n[E++]=p*e[t]*u.radius,n[E++]=u.halfSemiMajorAxis*Math.log((1+R)/(1-R)),n[E]=e[t+2]}function I(e,t,n,E){F0(e,t,n,E,O)}function W(e,t,n,E){n[E]=e[t]*e0,n[E+1]=e[t+1]*e0,n[E+2]=e[t+2]}function F(e,t,n,E){n[E]=e[t]*n0,n[E+1]=e[t+1]*n0,n[E+2]=e[t+2]}function d0(e,t,n,E){B(e,t,n,E),W(n,E,n,E)}function H0(e,t,n,E){T(e,t,n,E),W(n,E,n,E)}function T0(e,t,n,E){d(e,t,n,E),W(n,E,n,E)}function p0(e,t,n,E){F(e,t,n,E),j(n,E,n,E)}function h0(e,t,n,E){F(e,t,n,E),I(n,E,n,E)}function U0(e,t,n,E){F(e,t,n,E),H(n,E,n,E)}function z(e,t,n,E,u){const C=u+e[t+2],f=p*e[t+1],R=p*e[t],_=Math.cos(f)*C;n[E]=Math.cos(R)*_,n[E+1]=Math.sin(R)*_,n[E+2]=Math.sin(f)*C}function Y(e,t,n,E){z(e,t,n,E,m.radius)}function Z(e,t,n,E){z(e,t,n,E,K.radius)}function j(e,t,n,E){z(e,t,n,E,O.radius)}function V(e,t,n,E,u){const C=e[t],f=e[t+1],R=e[t+2],_=Math.sqrt(C*C+f*f+R*R),P=C0(R/(_===0?1:_)),A=Math.atan2(f,C);n[E++]=h*A,n[E++]=h*P,n[E]=_-u}function $(e,t,n,E){V(e,t,n,E,m.radius)}function a0(e,t,n,E){V(e,t,n,E,K.radius)}function d(e,t,n,E){V(e,t,n,E,O.radius)}function K0(e,t,n,E){d(e,t,n,E),I(n,E,n,E)}function B0(e,t,n,E){d(e,t,n,E),H(n,E,n,E)}function j0(e,t,n,E,u){const C=p*e[t],f=p*e[t+1],R=e[t+2],_=Math.sin(f),P=Math.cos(f),A=u.radius/Math.sqrt(1-u.eccentricitySquared*_*_);n[E++]=(A+R)*P*Math.cos(C),n[E++]=(A+R)*P*Math.sin(C),n[E++]=(A*(1-u.eccentricitySquared)+R)*_}function H(e,t,n,E){j0(e,t,n,E,O)}function T(e,t,n,E){const u=L0,C=e[t],f=e[t+1],R=e[t+2];let _,P,A,i,r,w,q,s,M,U,y,b,g,L,o,x,v,D,G,J,Q;_=Math.abs(R),P=C*C+f*f,A=Math.sqrt(P),i=P+R*R,r=Math.sqrt(i),J=Math.atan2(f,C),w=R*R/i,q=P/i,L=u.a2/r,o=u.a3-u.a4/r,q>.3?(s=_/r*(1+q*(u.a1+L+w*o)/r),G=Math.asin(s),U=s*s,M=Math.sqrt(1-U)):(M=A/r*(1-w*(u.a5-L-q*o)/r),G=Math.acos(M),U=1-M*M,s=Math.sqrt(U)),y=1-O.eccentricitySquared*U,b=O.radius/Math.sqrt(y),g=u.a6*b,L=A-b*M,o=_-g*s,v=M*L+s*o,x=M*o-s*L,D=x/(g/y+v),G+=D,Q=v+x*D/2,R<0&&(G=-G),n[E++]=h*J,n[E++]=h*G,n[E]=Q}function q0(e,t,n,E){T(e,t,n,E),j(n,E,n,E)}function m0(e,t,n,E){T(e,t,n,E),I(n,E,n,E)}function k0(e,t,n){if(e==null||t==null||n.source.spatialReference===e&&n.dest.spatialReference===t)return n;const E=X(e,n.source),u=X(t,n.dest);return E===a.UNKNOWN&&u===a.UNKNOWN?f0(e,t)?n.projector=l:n.projector=null:n.projector=o0[E][u],n}function E0(){return{source:{spatialReference:null,spatialReferenceId:a.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:a.UNKNOWN,metersPerUnit:1},projector:l}}const z0={spatialReference:null,spatialReferenceId:a.UNKNOWN},V0={spatialReference:null,spatialReferenceId:a.UNKNOWN},w0=E0(),p=l0(1),h=R0(1),k=Math.PI,t0=.5*k,c=O.radius,e0=c*k/180,n0=180/(c*k);function y0(e,t,n,E,u,C,f=Math.floor(e.length/3)){const R=G0(t,u,w0);if(R==null)return!1;if(R===l){if(e===E&&n===C)return!0;const P=n+3*f;for(let A=n,i=C;A.3?(s=_/r*(1+q*(u.a1+L+w*o)/r),G=Math.asin(s),U=s*s,M=Math.sqrt(1-U)):(M=A/r*(1-w*(u.a5-L-q*o)/r),G=Math.acos(M),U=1-M*M,s=Math.sqrt(U)),y=1-O.eccentricitySquared*U,b=O.radius/Math.sqrt(y),g=u.a6*b,L=A-b*M,o=_-g*s,v=M*L+s*o,x=M*o-s*L,D=x/(g/y+v),G+=D,Q=v+x*D/2,R<0&&(G=-G),n[E++]=h*J,n[E++]=h*G,n[E]=Q}function q0(e,t,n,E){T(e,t,n,E),j(n,E,n,E)}function m0(e,t,n,E){T(e,t,n,E),I(n,E,n,E)}function k0(e,t,n){if(e==null||t==null||n.source.spatialReference===e&&n.dest.spatialReference===t)return n;const E=X(e,n.source),u=X(t,n.dest);return E===a.UNKNOWN&&u===a.UNKNOWN?f0(e,t)?n.projector=l:n.projector=null:n.projector=o0[E][u],n}function E0(){return{source:{spatialReference:null,spatialReferenceId:a.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:a.UNKNOWN,metersPerUnit:1},projector:l}}const z0={spatialReference:null,spatialReferenceId:a.UNKNOWN},V0={spatialReference:null,spatialReferenceId:a.UNKNOWN},w0=E0(),p=l0(1),h=R0(1),k=Math.PI,t0=.5*k,c=O.radius,e0=c*k/180,n0=180/(c*k);function y0(e,t,n,E,u,C,f=Math.floor(e.length/3)){const R=G0(t,u,w0);if(R==null)return!1;if(R===l){if(e===E&&n===C)return!0;const P=n+3*f;for(let A=n,i=C;Ai.map(i=>d[i]); -import{_ as C}from"./main-ugzBrWNm.js";import{cV as U,d9 as ln,$ as an,da as un,db as V,J as A,aC as x,aY as m,o as cn,dc as K,dd as B,de as $,c_ as N,w as fn,n as hn,l as pn,m as dn,G as mn,df as g,dg as Y,dh as q,cU as gn,b1 as wn}from"./story-BfX8CRfG.js";import{G as _n,n as O,E as yn}from"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";function D(e,t,n,s,i,r){return M[0]=e,M[1]=t,M[2]=n,O(M,s,0,i,r,0)}const M=Y();let S=0;class k{static fromGE(t){const n=new k;return n._wkt=t.wkt,n._wkid=t.wkid,n._isInverse=t.isInverse,n}constructor(t){this.uid=S++,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)}get wkt(){return this._wkt}set wkt(t){this._wkt=t,this.uid=S++}get wkid(){return this._wkid}set wkid(t){this._wkid=t,this.uid=S++}get isInverse(){return this._isInverse}set isInverse(t){this._isInverse=t,this.uid=S++}getInverse(){const t=new k;return t._wkt=this.wkt,t._wkid=this._wkid,t._isInverse=!this.isInverse,t}}let Z=class v{static cacheKey(t,n){return[t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??"",n.wkid?.toString()??"-1",n.wkt?.toString()??"",n.wkt2?.toString()??""].join()}static fromGE(t){const n=new v;let s="";for(const i of t.steps){const r=k.fromGE(i);n.steps.push(r),s+=r.uid.toString()+","}return n._cachedProjection={},n._gtlistentry=null,n._chain=s,n}constructor(t){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,t?.steps)for(const n of t.steps)n instanceof k?this.steps.push(n):this.steps.push(new k({wkid:n.wkid,wkt:n.wkt,isInverse:n.isInverse}))}getInverse(){const t=new v;t.steps=[];for(let n=this.steps.length-1;n>=0;n--){const s=this.steps[n];t.steps.push(s.getInverse())}return t}getGTListEntry(){let t="";for(const n of this.steps)t+=n.uid.toString()+",";return t!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=t),this._gtlistentry}assignCachedGe(t,n,s){this._cachedProjection[v.cacheKey(t,n)]=s}getCachedGeTransformation(t,n){let s="";for(const r of this.steps)s+=r.uid.toString()+",";s!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=s);const i=this._cachedProjection[v.cacheKey(t,n)];return i===void 0?null:i}};function kn(e,t,n){if(t==null||n==null||n.vcsWkid||x(t,n)||g(t)||g(n))return null;const s=q(t)/q(n);if(s===1)return null;switch(e){case"point":case"esriGeometryPoint":return i=>vn(i,s);case"polyline":case"esriGeometryPolyline":return i=>xn(i,s);case"polygon":case"esriGeometryPolygon":return i=>Rn(i,s);case"multipoint":case"esriGeometryMultipoint":return i=>jn(i,s);case"extent":case"esriGeometryEnvelope":return i=>Pn(i,s);default:return null}}function vn(e,t){e?.z!=null&&(e.z*=t)}function Rn(e,t){if(e)for(const n of e.rings)for(const s of n)s.length>2&&(s[2]*=t)}function xn(e,t){if(e)for(const n of e.paths)for(const s of n)s.length>2&&(s[2]*=t)}function jn(e,t){if(e)for(const n of e.points)n.length>2&&(n[2]*=t)}function Pn(e,t){e&&e.zmin!=null&&e.zmax!=null&&(e.zmin*=t,e.zmax*=t)}let d=null,w=null,R=null,E={};const b=new gn;function z(){return!!d&&wn()}function J(){return!!z()||(U(b),j(),!1)}function zn(e,t){return!e||!t||_(e,t)||J()}function Gn(e,t){return!_(e,t)&&!z()}function j(e){return R==null&&(R=Promise.all([ln(),C(()=>import("./geometryEngineBase-DueYg7ux-CCeespPx.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.g),C(()=>import("./hydrated-CplJC1Fs-BIb5_ysY.js"),__vite__mapDeps([2,3,4,5,6]),import.meta.url)])),R.then(([,t,{hydratedAdapter:n}])=>{an(e),w=n,d=t.default,d._enableProjection(un),b.notify()})}function F(e,t,n=null,s=null){return Array.isArray(e)?e.length===0?[]:W(w,e,e[0].spatialReference,t,n,s):W(w,[e],e.spatialReference,t,n,s)[0]}function W(e,t,n,s,i=null,r=null){if(n==null||s==null)return t;if(_(n,s,i))return t.map(o=>L(o,n,s));if(i==null&&V(n))return t.map(o=>L(o,n,A.WGS84)).map(o=>P(o,s));if(i==null&&V(s))return t.map(o=>P(o,A.WGS84)).map(o=>L(o,A.WGS84,s));if(i==null){const o=Z.cacheKey(n,s);E[o]!==void 0?i=E[o]:((i=Q(n,s,void 0))==null&&(i=new Z),E[o]=i)}if(d==null||e==null)throw new T;return r!=null?d._project(e,t,n,s,i,r):d._project(e,t,n,s,i)}function In(e,t){const n=H([e],t);return n.pending!=null?{pending:n.pending,geometry:null}:n.geometries!=null?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function H(e,t){if(!z()){for(const n of e)if(n!=null&&!x(n.spatialReference,t)&&m(n.spatialReference)&&m(t)&&!_(n.spatialReference,t))return U(b),{pending:j(),geometries:null}}return{pending:null,geometries:e.map(n=>n==null?null:x(n.spatialReference,t)?n:m(n.spatialReference)&&m(t)?P(n,t):null)}}function Q(e,t,n=null){if(e==null||t==null)return null;if(d==null||w==null)throw new T;const s=d._getTransformation(w,e,t,n,n?.spatialReference);return s!==null?Z.fromGE(s):null}function Mn(e,t,n=null){if(d==null||w==null)throw new T;const s=d._getTransformationBySuitability(w,e,t,n,n?.spatialReference);if(s!==null){const i=[];for(const r of s)i.push(Z.fromGE(r));return i}return[]}class T extends cn{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function Sn(){d=null,w=null,R=null,E={}}const En={get loadPromise(){return R}};function P(e,t){try{const n=F(e,t);return n==null?null:("xmin"in e&&"xmin"in n&&(n.zmin=e.zmin,n.zmax=e.zmax),kn(n.type,e.spatialReference,t)?.(n),n)}catch(n){if(!(n instanceof T))throw n;return null}}async function Ln(e,t,n){const s=e.spatialReference;return s!=null&&t!=null&&await X(s,t,null,n),P(e,t)}function _(e,t,n){return!n&&(!!x(e,t)||m(e)&&m(t)&&!!_n(e,t,yn))}function Zn(e,t){if(x(e,t))return!0;if(!m(e)||!m(t))return!1;const n=K(e)||B(e)||$(e),s=K(t)||B(t)||$(t);return n&&s}async function X(e,t,n,s){if(z())return N(s);if(Array.isArray(e)){for(const{source:i,dest:r,geographicTransformation:o}of e)if(i&&r&&!_(i,r,o))return j(s)}else if(e&&t&&!_(e,t,n))return j(s);return N(s)}function L(e,t,n){return e?"x"in e?nn(e,t,new fn,n,0):"xmin"in e?rn(e,t,new hn,n,0):"rings"in e?sn(e,t,new pn,n,0):"paths"in e?en(e,t,new dn,n,0):"points"in e?tn(e,t,new mn,n,0):null:null}function On(e,t,n=t.spatialReference,s=0){return n!=null&&e.spatialReference!=null&&nn(e,e.spatialReference,t,n,s)!=null}function nn(e,t,n,s,i){u[0]=e.x,u[1]=e.y;const r=e.z;return u[2]=r!==void 0?r:i,O(u,t,0,u,s,0)?(n.x=u[0],n.y=u[1],n.spatialReference=s,r!==void 0||g(s)?(n.z=u[2],n.hasZ=!0):(n.z=void 0,n.hasZ=!1),e.m===void 0?(n.m=void 0,n.hasM=!1):(n.m=e.m,n.hasM=!0),n):null}function Tn(e,t,n=t.spatialReference,s=0){return e.spatialReference!=null&&n!=null&&tn(e,e.spatialReference,t,n,s)!=null}function tn(e,t,n,s,i){const{points:r,hasZ:o,hasM:a}=e,l=[],h=r.length,p=[];for(const c of r)p.push(c[0],c[1],o?c[2]:i);if(!O(p,t,0,p,s,0,h))return null;const f=o||g(s);for(let c=0;ci.map(i=>d[i]); +import{_ as C}from"./main-QGPoLsvl.js";import{cV as U,d9 as ln,$ as an,da as un,db as V,J as A,aC as x,aY as m,o as cn,dc as K,dd as B,de as $,c_ as N,w as fn,n as hn,l as pn,m as dn,G as mn,df as g,dg as Y,dh as q,cU as gn,b1 as wn}from"./story-Doly9N9p.js";import{G as _n,n as O,E as yn}from"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";function D(e,t,n,s,i,r){return M[0]=e,M[1]=t,M[2]=n,O(M,s,0,i,r,0)}const M=Y();let S=0;class k{static fromGE(t){const n=new k;return n._wkt=t.wkt,n._wkid=t.wkid,n._isInverse=t.isInverse,n}constructor(t){this.uid=S++,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)}get wkt(){return this._wkt}set wkt(t){this._wkt=t,this.uid=S++}get wkid(){return this._wkid}set wkid(t){this._wkid=t,this.uid=S++}get isInverse(){return this._isInverse}set isInverse(t){this._isInverse=t,this.uid=S++}getInverse(){const t=new k;return t._wkt=this.wkt,t._wkid=this._wkid,t._isInverse=!this.isInverse,t}}let Z=class v{static cacheKey(t,n){return[t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??"",n.wkid?.toString()??"-1",n.wkt?.toString()??"",n.wkt2?.toString()??""].join()}static fromGE(t){const n=new v;let s="";for(const i of t.steps){const r=k.fromGE(i);n.steps.push(r),s+=r.uid.toString()+","}return n._cachedProjection={},n._gtlistentry=null,n._chain=s,n}constructor(t){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,t?.steps)for(const n of t.steps)n instanceof k?this.steps.push(n):this.steps.push(new k({wkid:n.wkid,wkt:n.wkt,isInverse:n.isInverse}))}getInverse(){const t=new v;t.steps=[];for(let n=this.steps.length-1;n>=0;n--){const s=this.steps[n];t.steps.push(s.getInverse())}return t}getGTListEntry(){let t="";for(const n of this.steps)t+=n.uid.toString()+",";return t!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=t),this._gtlistentry}assignCachedGe(t,n,s){this._cachedProjection[v.cacheKey(t,n)]=s}getCachedGeTransformation(t,n){let s="";for(const r of this.steps)s+=r.uid.toString()+",";s!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=s);const i=this._cachedProjection[v.cacheKey(t,n)];return i===void 0?null:i}};function kn(e,t,n){if(t==null||n==null||n.vcsWkid||x(t,n)||g(t)||g(n))return null;const s=q(t)/q(n);if(s===1)return null;switch(e){case"point":case"esriGeometryPoint":return i=>vn(i,s);case"polyline":case"esriGeometryPolyline":return i=>xn(i,s);case"polygon":case"esriGeometryPolygon":return i=>Rn(i,s);case"multipoint":case"esriGeometryMultipoint":return i=>jn(i,s);case"extent":case"esriGeometryEnvelope":return i=>Pn(i,s);default:return null}}function vn(e,t){e?.z!=null&&(e.z*=t)}function Rn(e,t){if(e)for(const n of e.rings)for(const s of n)s.length>2&&(s[2]*=t)}function xn(e,t){if(e)for(const n of e.paths)for(const s of n)s.length>2&&(s[2]*=t)}function jn(e,t){if(e)for(const n of e.points)n.length>2&&(n[2]*=t)}function Pn(e,t){e&&e.zmin!=null&&e.zmax!=null&&(e.zmin*=t,e.zmax*=t)}let d=null,w=null,R=null,E={};const b=new gn;function z(){return!!d&&wn()}function J(){return!!z()||(U(b),j(),!1)}function zn(e,t){return!e||!t||_(e,t)||J()}function Gn(e,t){return!_(e,t)&&!z()}function j(e){return R==null&&(R=Promise.all([ln(),C(()=>import("./geometryEngineBase-DueYg7ux-CCeespPx.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.g),C(()=>import("./hydrated-CplJC1Fs-McBHp1Y5.js"),__vite__mapDeps([2,3,4,5,6]),import.meta.url)])),R.then(([,t,{hydratedAdapter:n}])=>{an(e),w=n,d=t.default,d._enableProjection(un),b.notify()})}function F(e,t,n=null,s=null){return Array.isArray(e)?e.length===0?[]:W(w,e,e[0].spatialReference,t,n,s):W(w,[e],e.spatialReference,t,n,s)[0]}function W(e,t,n,s,i=null,r=null){if(n==null||s==null)return t;if(_(n,s,i))return t.map(o=>L(o,n,s));if(i==null&&V(n))return t.map(o=>L(o,n,A.WGS84)).map(o=>P(o,s));if(i==null&&V(s))return t.map(o=>P(o,A.WGS84)).map(o=>L(o,A.WGS84,s));if(i==null){const o=Z.cacheKey(n,s);E[o]!==void 0?i=E[o]:((i=Q(n,s,void 0))==null&&(i=new Z),E[o]=i)}if(d==null||e==null)throw new T;return r!=null?d._project(e,t,n,s,i,r):d._project(e,t,n,s,i)}function In(e,t){const n=H([e],t);return n.pending!=null?{pending:n.pending,geometry:null}:n.geometries!=null?{pending:null,geometry:n.geometries[0]}:{pending:null,geometry:null}}function H(e,t){if(!z()){for(const n of e)if(n!=null&&!x(n.spatialReference,t)&&m(n.spatialReference)&&m(t)&&!_(n.spatialReference,t))return U(b),{pending:j(),geometries:null}}return{pending:null,geometries:e.map(n=>n==null?null:x(n.spatialReference,t)?n:m(n.spatialReference)&&m(t)?P(n,t):null)}}function Q(e,t,n=null){if(e==null||t==null)return null;if(d==null||w==null)throw new T;const s=d._getTransformation(w,e,t,n,n?.spatialReference);return s!==null?Z.fromGE(s):null}function Mn(e,t,n=null){if(d==null||w==null)throw new T;const s=d._getTransformationBySuitability(w,e,t,n,n?.spatialReference);if(s!==null){const i=[];for(const r of s)i.push(Z.fromGE(r));return i}return[]}class T extends cn{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function Sn(){d=null,w=null,R=null,E={}}const En={get loadPromise(){return R}};function P(e,t){try{const n=F(e,t);return n==null?null:("xmin"in e&&"xmin"in n&&(n.zmin=e.zmin,n.zmax=e.zmax),kn(n.type,e.spatialReference,t)?.(n),n)}catch(n){if(!(n instanceof T))throw n;return null}}async function Ln(e,t,n){const s=e.spatialReference;return s!=null&&t!=null&&await X(s,t,null,n),P(e,t)}function _(e,t,n){return!n&&(!!x(e,t)||m(e)&&m(t)&&!!_n(e,t,yn))}function Zn(e,t){if(x(e,t))return!0;if(!m(e)||!m(t))return!1;const n=K(e)||B(e)||$(e),s=K(t)||B(t)||$(t);return n&&s}async function X(e,t,n,s){if(z())return N(s);if(Array.isArray(e)){for(const{source:i,dest:r,geographicTransformation:o}of e)if(i&&r&&!_(i,r,o))return j(s)}else if(e&&t&&!_(e,t,n))return j(s);return N(s)}function L(e,t,n){return e?"x"in e?nn(e,t,new fn,n,0):"xmin"in e?rn(e,t,new hn,n,0):"rings"in e?sn(e,t,new pn,n,0):"paths"in e?en(e,t,new dn,n,0):"points"in e?tn(e,t,new mn,n,0):null:null}function On(e,t,n=t.spatialReference,s=0){return n!=null&&e.spatialReference!=null&&nn(e,e.spatialReference,t,n,s)!=null}function nn(e,t,n,s,i){u[0]=e.x,u[1]=e.y;const r=e.z;return u[2]=r!==void 0?r:i,O(u,t,0,u,s,0)?(n.x=u[0],n.y=u[1],n.spatialReference=s,r!==void 0||g(s)?(n.z=u[2],n.hasZ=!0):(n.z=void 0,n.hasZ=!1),e.m===void 0?(n.m=void 0,n.hasM=!1):(n.m=e.m,n.hasM=!0),n):null}function Tn(e,t,n=t.spatialReference,s=0){return e.spatialReference!=null&&n!=null&&tn(e,e.spatialReference,t,n,s)!=null}function tn(e,t,n,s,i){const{points:r,hasZ:o,hasM:a}=e,l=[],h=r.length,p=[];for(const c of r)p.push(c[0],c[1],o?c[2]:i);if(!O(p,t,0,p,s,0,h))return null;const f=o||g(s);for(let c=0;c{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,w(n,o[2])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,m(n,o[2])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,w(n,o[2]),m(n,o[3])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,w(n,o[2])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,m(n,o[2])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;s{const t=new Array(r.length);if(!r.length)return t;const o=r[0];let e=P(n,o[0]),l=p(n,o[1]);t[0]=[e,l,w(n,o[2]),m(n,o[3])];const{scale:i,originPosition:a}=n,u=i[0],c=a==="lowerLeft"?i[1]:-i[1];for(let s=1;sE()?(r[0]=o[0]/s,r[1]=o[1]/s,r[2]=o[2]/s):(r[0]=1,r[1]=0,r[2]=0),a}function O(r,o,a){const s=o[0],t=o[1],c=o[2],i=o[3],u=a[0],n=a[1],e=a[2],h=a[3];return r[0]=s*h+i*u+t*e-c*n,r[1]=t*h+i*n+c*u-s*e,r[2]=c*h+i*e+s*n-t*u,r[3]=i*h-s*u-t*n-c*e,r}function K(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n+i*u,r[1]=t*n+c*u,r[2]=c*n-t*u,r[3]=i*n-s*u,r}function Q(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n-c*u,r[1]=t*n+i*u,r[2]=c*n+s*u,r[3]=i*n-t*u,r}function U(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n+t*u,r[1]=t*n-s*u,r[2]=c*n+i*u,r[3]=i*n-c*u,r}function V(r,o){const a=o[0],s=o[1],t=o[2];return r[0]=a,r[1]=s,r[2]=t,r[3]=Math.sqrt(Math.abs(1-a*a-s*s-t*t)),r}function d(r,o,a,s){const t=o[0],c=o[1],i=o[2],u=o[3];let n,e,h,f,l,m=a[0],p=a[1],q=a[2],g=a[3];return e=t*m+c*p+i*q+u*g,e<0&&(e=-e,m=-m,p=-p,q=-q,g=-g),1-e>E()?(n=Math.acos(e),h=Math.sin(n),f=Math.sin((1-s)*n)/h,l=Math.sin(s*n)/h):(f=1-s,l=s),r[0]=f*t+l*m,r[1]=f*c+l*p,r[2]=f*i+l*q,r[3]=f*u+l*g,r}function rr(r){const o=z,a=o(),s=o(),t=o(),c=Math.sqrt(1-a),i=Math.sqrt(a);return r[0]=c*Math.sin(2*Math.PI*s),r[1]=c*Math.cos(2*Math.PI*s),r[2]=i*Math.sin(2*Math.PI*t),r[3]=i*Math.cos(2*Math.PI*t),r}function or(r,o){const a=o[0],s=o[1],t=o[2],c=o[3],i=a*a+s*s+t*t+c*c,u=i?1/i:0;return r[0]=-a*u,r[1]=-s*u,r[2]=-t*u,r[3]=c*u,r}function sr(r,o){return r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=o[3],r}function S(r,o){const a=o[0]+o[4]+o[8];let s;if(a>0)s=Math.sqrt(a+1),r[3]=.5*s,s=.5/s,r[0]=(o[5]-o[7])*s,r[1]=(o[6]-o[2])*s,r[2]=(o[1]-o[3])*s;else{let t=0;o[4]>o[0]&&(t=1),o[8]>o[3*t+t]&&(t=2);const c=(t+1)%3,i=(t+2)%3;s=Math.sqrt(o[3*t+t]-o[3*c+c]-o[3*i+i]+1),r[t]=.5*s,s=.5/s,r[3]=(o[3*c+i]-o[3*i+c])*s,r[c]=(o[3*c+t]+o[3*t+c])*s,r[i]=(o[3*i+t]+o[3*t+i])*s}return r}function tr(r,o,a,s){const t=.5*Math.PI/180;o*=t,a*=t,s*=t;const c=Math.sin(o),i=Math.cos(o),u=Math.sin(a),n=Math.cos(a),e=Math.sin(s),h=Math.cos(s);return r[0]=c*n*h-i*u*e,r[1]=i*u*h+c*n*e,r[2]=i*n*e-c*u*h,r[3]=i*n*h+c*u*e,r}function ar(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}const cr=Z,ir=w,ur=F,nr=O,er=N,hr=R,Mr=W,b=k,fr=b,j=B,lr=j,A=C,mr=D,pr=G;function qr(r,o,a){const s=T(o,a);return s<-.999999?(x(M,gr,o),X(M)<1e-6&&x(M,dr,o),Y(M,M),L(r,M,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(x(M,o,a),r[0]=M[0],r[1]=M[1],r[2]=M[2],r[3]=1+s,A(r,r))}const M=v(),gr=_(1,0,0),dr=_(0,1,0);function xr(r,o,a,s,t,c){return d(P,o,t,c),d(y,a,s,c),d(r,P,y,2*c*(1-c)),r}const P=I(),y=I();function Ar(r,o,a,s){const t=Pr;return t[0]=a[0],t[3]=a[1],t[6]=a[2],t[1]=s[0],t[4]=s[1],t[7]=s[2],t[2]=-o[0],t[5]=-o[1],t[8]=-o[2],A(r,S(r,t))}const Pr=$();Object.freeze(Object.defineProperty({__proto__:null,add:ur,calculateW:V,conjugate:sr,copy:cr,dot:hr,equals:pr,exactEquals:mr,fromEuler:tr,fromMat3:S,getAxisAngle:J,identity:H,invert:or,len:fr,length:b,lerp:Mr,mul:nr,multiply:O,normalize:A,random:rr,rotateX:K,rotateY:Q,rotateZ:U,rotationTo:qr,scale:er,set:ir,setAxes:Ar,setAxisAngle:L,slerp:d,sqlerp:xr,sqrLen:lr,squaredLength:j,str:ar},Symbol.toStringTag,{value:"Module"}));export{L as A,or as L,tr as O,ir as T,mr as X,qr as Y,O as _,J as j,sr as v}; +import{n as $}from"./mat3f64-Dh9_zhFu-BIT-k8Dm.js";import{e as I}from"./quatf64-C16JxGFv-BKWK1F8U.js";import{dg as v,hZ as _}from"./story-Doly9N9p.js";import{n as E,o as z}from"./common-CYWrYyJl-E8-sukrT.js";import{y as T,S as x,F as X,l as Y}from"./vec32-D9GsKZ1t-BPSFE14A.js";import{p as Z,y as w,g as F,o as N,w as R,A as W,x as k,q as B,L as C,E as D,O as G}from"./vec42-D8CJyqHG-DnfLTeQH.js";function H(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function L(r,o,a){a*=.5;const s=Math.sin(a);return r[0]=s*o[0],r[1]=s*o[1],r[2]=s*o[2],r[3]=Math.cos(a),r}function J(r,o){const a=2*Math.acos(o[3]),s=Math.sin(a/2);return s>E()?(r[0]=o[0]/s,r[1]=o[1]/s,r[2]=o[2]/s):(r[0]=1,r[1]=0,r[2]=0),a}function O(r,o,a){const s=o[0],t=o[1],c=o[2],i=o[3],u=a[0],n=a[1],e=a[2],h=a[3];return r[0]=s*h+i*u+t*e-c*n,r[1]=t*h+i*n+c*u-s*e,r[2]=c*h+i*e+s*n-t*u,r[3]=i*h-s*u-t*n-c*e,r}function K(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n+i*u,r[1]=t*n+c*u,r[2]=c*n-t*u,r[3]=i*n-s*u,r}function Q(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n-c*u,r[1]=t*n+i*u,r[2]=c*n+s*u,r[3]=i*n-t*u,r}function U(r,o,a){a*=.5;const s=o[0],t=o[1],c=o[2],i=o[3],u=Math.sin(a),n=Math.cos(a);return r[0]=s*n+t*u,r[1]=t*n-s*u,r[2]=c*n+i*u,r[3]=i*n-c*u,r}function V(r,o){const a=o[0],s=o[1],t=o[2];return r[0]=a,r[1]=s,r[2]=t,r[3]=Math.sqrt(Math.abs(1-a*a-s*s-t*t)),r}function d(r,o,a,s){const t=o[0],c=o[1],i=o[2],u=o[3];let n,e,h,f,l,m=a[0],p=a[1],q=a[2],g=a[3];return e=t*m+c*p+i*q+u*g,e<0&&(e=-e,m=-m,p=-p,q=-q,g=-g),1-e>E()?(n=Math.acos(e),h=Math.sin(n),f=Math.sin((1-s)*n)/h,l=Math.sin(s*n)/h):(f=1-s,l=s),r[0]=f*t+l*m,r[1]=f*c+l*p,r[2]=f*i+l*q,r[3]=f*u+l*g,r}function rr(r){const o=z,a=o(),s=o(),t=o(),c=Math.sqrt(1-a),i=Math.sqrt(a);return r[0]=c*Math.sin(2*Math.PI*s),r[1]=c*Math.cos(2*Math.PI*s),r[2]=i*Math.sin(2*Math.PI*t),r[3]=i*Math.cos(2*Math.PI*t),r}function or(r,o){const a=o[0],s=o[1],t=o[2],c=o[3],i=a*a+s*s+t*t+c*c,u=i?1/i:0;return r[0]=-a*u,r[1]=-s*u,r[2]=-t*u,r[3]=c*u,r}function sr(r,o){return r[0]=-o[0],r[1]=-o[1],r[2]=-o[2],r[3]=o[3],r}function S(r,o){const a=o[0]+o[4]+o[8];let s;if(a>0)s=Math.sqrt(a+1),r[3]=.5*s,s=.5/s,r[0]=(o[5]-o[7])*s,r[1]=(o[6]-o[2])*s,r[2]=(o[1]-o[3])*s;else{let t=0;o[4]>o[0]&&(t=1),o[8]>o[3*t+t]&&(t=2);const c=(t+1)%3,i=(t+2)%3;s=Math.sqrt(o[3*t+t]-o[3*c+c]-o[3*i+i]+1),r[t]=.5*s,s=.5/s,r[3]=(o[3*c+i]-o[3*i+c])*s,r[c]=(o[3*c+t]+o[3*t+c])*s,r[i]=(o[3*i+t]+o[3*t+i])*s}return r}function tr(r,o,a,s){const t=.5*Math.PI/180;o*=t,a*=t,s*=t;const c=Math.sin(o),i=Math.cos(o),u=Math.sin(a),n=Math.cos(a),e=Math.sin(s),h=Math.cos(s);return r[0]=c*n*h-i*u*e,r[1]=i*u*h+c*n*e,r[2]=i*n*e-c*u*h,r[3]=i*n*h+c*u*e,r}function ar(r){return"quat("+r[0]+", "+r[1]+", "+r[2]+", "+r[3]+")"}const cr=Z,ir=w,ur=F,nr=O,er=N,hr=R,Mr=W,b=k,fr=b,j=B,lr=j,A=C,mr=D,pr=G;function qr(r,o,a){const s=T(o,a);return s<-.999999?(x(M,gr,o),X(M)<1e-6&&x(M,dr,o),Y(M,M),L(r,M,Math.PI),r):s>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(x(M,o,a),r[0]=M[0],r[1]=M[1],r[2]=M[2],r[3]=1+s,A(r,r))}const M=v(),gr=_(1,0,0),dr=_(0,1,0);function xr(r,o,a,s,t,c){return d(P,o,t,c),d(y,a,s,c),d(r,P,y,2*c*(1-c)),r}const P=I(),y=I();function Ar(r,o,a,s){const t=Pr;return t[0]=a[0],t[3]=a[1],t[6]=a[2],t[1]=s[0],t[4]=s[1],t[7]=s[2],t[2]=-o[0],t[5]=-o[1],t[8]=-o[2],A(r,S(r,t))}const Pr=$();Object.freeze(Object.defineProperty({__proto__:null,add:ur,calculateW:V,conjugate:sr,copy:cr,dot:hr,equals:pr,exactEquals:mr,fromEuler:tr,fromMat3:S,getAxisAngle:J,identity:H,invert:or,len:fr,length:b,lerp:Mr,mul:nr,multiply:O,normalize:A,random:rr,rotateX:K,rotateY:Q,rotateZ:U,rotationTo:qr,scale:er,set:ir,setAxes:Ar,setAxisAngle:L,slerp:d,sqlerp:xr,sqrLen:lr,squaredLength:j,str:ar},Symbol.toStringTag,{value:"Module"}));export{L as A,or as L,tr as O,ir as T,mr as X,qr as Y,O as _,J as j,sr as v}; diff --git a/custom-toc-highlight/assets/query-BAUG6dav-B_Pyr3t8.js b/custom-toc-highlight/assets/query-BAUG6dav-B_Pyr3t8.js new file mode 100644 index 00000000..6c1a8afa --- /dev/null +++ b/custom-toc-highlight/assets/query-BAUG6dav-B_Pyr3t8.js @@ -0,0 +1 @@ +import"./story-Doly9N9p.js";import"./Query-BrwMGK8U-BPr0_G9t.js";import{u as O,s as S}from"./executeQueryJSON-CcHnccia-M-vnTvKl.js";import{g as P,T as b}from"./executeQueryPBF-o8010HS9-B7Z-YQyg.js";import"./FeatureSet-BkVNthuN-DPQqwkNN.js";import"./AttachmentInfo-D9RFO8W2-CMU9-WNo.js";import"./RelationshipQuery-DJsz3K0U-BKFa46R1.js";import{executeBinsQuery as k}from"./executeBinsQuery-26-59HNS-DKYB7wBm.js";import{i as v,e as z}from"./executeForIds-Z1gkLduF-CrWEksFG.js";import{executeRelationshipQuery as D,executeRelationshipQueryForCount as G}from"./executeRelationshipQuery-BlX9_g4g-QPs1Jx7X.js";import{executeTopFeaturesQuery as K}from"./executeTopFeaturesQuery-CjTd36wS-CcVA1k2F.js";import{executeForTopIds as M}from"./executeForTopIds-BWxBZygF-D-DeY4Tc.js";import{executeForTopExtents as V}from"./executeForTopExtents-3NOTiZTn-7q7qEr0x.js";import{executeForTopCount as X}from"./executeForTopCount-Dx1gCDe1-BVXGJFEi.js";import"./main-QGPoLsvl.js";import"./Field-C6hA1tZj-CkWoRbmp.js";import"./fieldType-CD2CL2hr-Do9kp-dx.js";import"./TimeExtent-Cn0Jofqr-BcCXKjqL.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./query-DFW9-NG_-C3TyGmiM.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";import"./featureConversionUtils-D6hFQ4Af-qxGGE-I8.js";import"./BinsQuery-DjwQZqB8-Ch0CPJ5I.js";import"./queryUtils-Brxu6254-CDiE0zms.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./queryTopFeatures-IbhAPJlP-DZGdrKJR.js";import"./TopFeaturesQuery-Ckj_IYM7-C2k1I1bi.js";export{k as executeBinsQuery,v as executeForCount,P as executeForExtent,z as executeForIds,X as executeForTopCount,V as executeForTopExtents,M as executeForTopIds,O as executeQueryJSON,S as executeRawQueryJSON,b as executeRawQueryPBF,D as executeRelationshipQuery,G as executeRelationshipQueryForCount,K as executeTopFeaturesQuery}; diff --git a/custom-toc-highlight/assets/query-BAUG6dav-DJjDADlE.js b/custom-toc-highlight/assets/query-BAUG6dav-DJjDADlE.js deleted file mode 100644 index 12200bc1..00000000 --- a/custom-toc-highlight/assets/query-BAUG6dav-DJjDADlE.js +++ /dev/null @@ -1 +0,0 @@ -import"./story-BfX8CRfG.js";import"./Query-BrwMGK8U-DoFNfkjX.js";import{u as O,s as S}from"./executeQueryJSON-CcHnccia-BW7_NQxl.js";import{g as P,T as b}from"./executeQueryPBF-o8010HS9-BgTBXvCY.js";import"./FeatureSet-BkVNthuN-CwS44--W.js";import"./AttachmentInfo-D9RFO8W2-DYgfjXim.js";import"./RelationshipQuery-DJsz3K0U-yAwL-qLW.js";import{executeBinsQuery as k}from"./executeBinsQuery-26-59HNS-BdRaQbV5.js";import{i as v,e as z}from"./executeForIds-Z1gkLduF-D8DZG8qZ.js";import{executeRelationshipQuery as D,executeRelationshipQueryForCount as G}from"./executeRelationshipQuery-BlX9_g4g-CUgaAeUL.js";import{executeTopFeaturesQuery as K}from"./executeTopFeaturesQuery-CjTd36wS-B31_Gdx0.js";import{executeForTopIds as M}from"./executeForTopIds-BWxBZygF-myXyOtDE.js";import{executeForTopExtents as V}from"./executeForTopExtents-3NOTiZTn-K-9KTgQh.js";import{executeForTopCount as X}from"./executeForTopCount-Dx1gCDe1-JhF_sU0m.js";import"./main-ugzBrWNm.js";import"./Field-C6hA1tZj-CpGOU6Y4.js";import"./fieldType-CD2CL2hr-CMChCO5s.js";import"./TimeExtent-Cn0Jofqr-D2z4zFxu.js";import"./utils-9sQxfkoa-KicvrT8N.js";import"./query-DFW9-NG_-gbjlxRZk.js";import"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import"./normalizeUtilsCommon-CRJlkfEA-D0uk_F2q.js";import"./utils-Bq23Xwmj--_SaacS5.js";import"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import"./pbf-D-y3_eZO-DQKnyfOm.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B5UMbu5B.js";import"./projection-BA9M1R7d-BYoCXVXt.js";import"./projectBuffer-CvCBvJ6W-dLD7ajBt.js";import"./featureConversionUtils-D6hFQ4Af-C2GV38KQ.js";import"./BinsQuery-DjwQZqB8-DL4eLh1p.js";import"./queryUtils-Brxu6254-PPvpiP5X.js";import"./json-BI97KiBB-Ce5cWfI2.js";import"./queryTopFeatures-IbhAPJlP-DYmbt-VV.js";import"./TopFeaturesQuery-Ckj_IYM7-DcxQU3dQ.js";export{k as executeBinsQuery,v as executeForCount,P as executeForExtent,z as executeForIds,X as executeForTopCount,V as executeForTopExtents,M as executeForTopIds,O as executeQueryJSON,S as executeRawQueryJSON,b as executeRawQueryPBF,D as executeRelationshipQuery,G as executeRelationshipQueryForCount,K as executeTopFeaturesQuery}; diff --git a/custom-toc-highlight/assets/query-DFW9-NG_-gbjlxRZk.js b/custom-toc-highlight/assets/query-DFW9-NG_-C3TyGmiM.js similarity index 93% rename from custom-toc-highlight/assets/query-DFW9-NG_-gbjlxRZk.js rename to custom-toc-highlight/assets/query-DFW9-NG_-C3TyGmiM.js index d96424ab..a4a7fc96 100644 --- a/custom-toc-highlight/assets/query-DFW9-NG_-gbjlxRZk.js +++ b/custom-toc-highlight/assets/query-DFW9-NG_-C3TyGmiM.js @@ -1 +1 @@ -import{a as p,f as S,bX as x,bM as f,bK as E}from"./story-BfX8CRfG.js";import{B as O}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{v as g}from"./pbfQueryUtils-F4ZE8-K8-Bro2SuOq.js";import{n as R}from"./queryZScale-BiYV6Pr6-B5UMbu5B.js";function m(r){const e={};for(const i in r){if(i==="declaredClass")continue;const t=r[i];if(t!=null&&typeof t!="function")if(Array.isArray(t)){e[i]=[];for(let n=0;ne.data.attachmentGroups)}async function Q(r,t,o){const{objectIds:n}=t,e=[];for(const a of n)e.push(p(r.path+"/"+a+"/attachments",o));return Promise.all(e).then(a=>n.map((c,s)=>({parentObjectId:c,attachmentInfos:a[s].data.attachmentInfos})))}export{N as executeAttachmentQuery,Q as fetchAttachments,J as processAttachmentQueryResult}; +import{bZ as f,jo as u,f as p}from"./story-Doly9N9p.js";import{f as d}from"./query-DFW9-NG_-C3TyGmiM.js";import{h as y}from"./AttachmentInfo-D9RFO8W2-CMU9-WNo.js";import"./main-QGPoLsvl.js";import"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import"./normalizeUtilsCommon-CRJlkfEA-QNLP9y_F.js";import"./utils-9sQxfkoa-D8FX0sO8.js";import"./utils-Bq23Xwmj-CKlS81kz.js";import"./pbfQueryUtils-F4ZE8-K8-vP84FrXE.js";import"./pbf-D-y3_eZO-CpHdkhuD.js";import"./OptimizedFeature-EIithYlr-Cq64mIT3.js";import"./OptimizedFeatureSet-DfZGBuxJ-C08BOAgi.js";import"./queryZScale-BiYV6Pr6-B7zp5L1G.js";import"./projection-BA9M1R7d-CAbqHZiw.js";import"./projectBuffer-CvCBvJ6W-KqAd8Vef.js";function I(r){const t=r.toJSON();return t.attachmentTypes&&(t.attachmentTypes=t.attachmentTypes.join(",")),t.keywords&&(t.keywords=t.keywords.join(",")),t.globalIds&&(t.globalIds=t.globalIds.join(",")),t.objectIds&&(t.objectIds=t.objectIds.join(",")),t.size&&(t.size=t.size.join(",")),t}function J(r,t){const o={};for(const n of t){const{parentObjectId:e,parentGlobalId:a,attachmentInfos:c}=n;for(const s of c){const{id:i}=s,h=f(u(`${r.path}/${e}/attachments/${i}`)),m=y.fromJSON(s);m.set({url:h,parentObjectId:e,parentGlobalId:a}),o[e]?o[e].push(m):o[e]=[m]}}return o}function N(r,t,o){let n={query:d({...r.query,f:"json",...I(t)})};return o&&(n={...o,...n,query:{...o.query,...n.query}}),p(r.path+"/queryAttachments",n).then(e=>e.data.attachmentGroups)}async function Q(r,t,o){const{objectIds:n}=t,e=[];for(const a of n)e.push(p(r.path+"/"+a+"/attachments",o));return Promise.all(e).then(a=>n.map((c,s)=>({parentObjectId:c,attachmentInfos:a[s].data.attachmentInfos})))}export{N as executeAttachmentQuery,Q as fetchAttachments,J as processAttachmentQueryResult}; diff --git a/custom-toc-highlight/assets/queryTopFeatures-IbhAPJlP-DYmbt-VV.js b/custom-toc-highlight/assets/queryTopFeatures-IbhAPJlP-DZGdrKJR.js similarity index 88% rename from custom-toc-highlight/assets/queryTopFeatures-IbhAPJlP-DYmbt-VV.js rename to custom-toc-highlight/assets/queryTopFeatures-IbhAPJlP-DZGdrKJR.js index 783ae4c6..5f147051 100644 --- a/custom-toc-highlight/assets/queryTopFeatures-IbhAPJlP-DYmbt-VV.js +++ b/custom-toc-highlight/assets/queryTopFeatures-IbhAPJlP-DZGdrKJR.js @@ -1 +1 @@ -import{a as p,f as c,bX as F,bK as f,bM as d}from"./story-BfX8CRfG.js";import{B as E}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{f as x}from"./query-DFW9-NG_-gbjlxRZk.js";import{n as j}from"./queryZScale-BiYV6Pr6-B5UMbu5B.js";const a="Layer does not support extent calculation.";function O(o,r){const n=o.geometry,t=o.toJSON(),e=t;if(n!=null&&(e.geometry=JSON.stringify(n),e.geometryType=f(n),e.inSR=d(n.spatialReference)),t.topFilter?.groupByFields&&(e.topFilter.groupByFields=t.topFilter.groupByFields.join(",")),t.topFilter?.orderByFields&&(e.topFilter.orderByFields=t.topFilter.orderByFields.join(",")),t.topFilter&&(e.topFilter=JSON.stringify(e.topFilter)),t.objectIds&&(e.objectIds=t.objectIds.join(",")),t.orderByFields&&(e.orderByFields=t.orderByFields.join(",")),t.outFields&&!(r?.returnCountOnly||r?.returnExtentOnly||r?.returnIdsOnly)?t.outFields.includes("*")?e.outFields="*":e.outFields=t.outFields.join(","):delete e.outFields,t.outSR?e.outSR=d(t.outSR):n&&t.returnGeometry&&(e.outSR=e.inSR),t.returnGeometry&&delete t.returnGeometry,t.timeExtent){const l=t.timeExtent,{start:i,end:u}=l;i==null&&u==null||(e.time=i===u?i:`${i??"null"},${u??"null"}`),delete t.timeExtent}return e}async function b(o,r,n,t){const e=await s(o,r,"json",t);return j(r,n,e.data),e}async function h(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?{data:{objectIds:[]}}:s(o,r,"json",n,{returnIdsOnly:!0})}async function w(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?{data:{count:0,extent:null}}:s(o,r,"json",n,{returnExtentOnly:!0,returnCountOnly:!0}).then(t=>{const e=t.data;if(e.hasOwnProperty("extent"))return t;if(e.features)throw new Error(a);if(e.hasOwnProperty("count"))throw new Error(a);return t})}function I(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):s(o,r,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function s(o,r,n,t={},e={}){const l=typeof o=="string"?p(o):o,i=r.geometry?[r.geometry]:[];return t.responseType="json",E(i,null,t).then(u=>{const y=u?.[0];y!=null&&((r=r.clone()).geometry=y);const m=x({...l.query,f:n,...e,...O(r,e)});return c(F(l.path,"queryTopFeatures"),{...t,query:{...m,...t.query}})})}export{h as B,w as R,I as S,b as g}; +import{a as p,f as c,bX as F,bK as f,bM as d}from"./story-Doly9N9p.js";import{B as E}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{f as x}from"./query-DFW9-NG_-C3TyGmiM.js";import{n as j}from"./queryZScale-BiYV6Pr6-B7zp5L1G.js";const a="Layer does not support extent calculation.";function O(o,r){const n=o.geometry,t=o.toJSON(),e=t;if(n!=null&&(e.geometry=JSON.stringify(n),e.geometryType=f(n),e.inSR=d(n.spatialReference)),t.topFilter?.groupByFields&&(e.topFilter.groupByFields=t.topFilter.groupByFields.join(",")),t.topFilter?.orderByFields&&(e.topFilter.orderByFields=t.topFilter.orderByFields.join(",")),t.topFilter&&(e.topFilter=JSON.stringify(e.topFilter)),t.objectIds&&(e.objectIds=t.objectIds.join(",")),t.orderByFields&&(e.orderByFields=t.orderByFields.join(",")),t.outFields&&!(r?.returnCountOnly||r?.returnExtentOnly||r?.returnIdsOnly)?t.outFields.includes("*")?e.outFields="*":e.outFields=t.outFields.join(","):delete e.outFields,t.outSR?e.outSR=d(t.outSR):n&&t.returnGeometry&&(e.outSR=e.inSR),t.returnGeometry&&delete t.returnGeometry,t.timeExtent){const l=t.timeExtent,{start:i,end:u}=l;i==null&&u==null||(e.time=i===u?i:`${i??"null"},${u??"null"}`),delete t.timeExtent}return e}async function b(o,r,n,t){const e=await s(o,r,"json",t);return j(r,n,e.data),e}async function h(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?{data:{objectIds:[]}}:s(o,r,"json",n,{returnIdsOnly:!0})}async function w(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?{data:{count:0,extent:null}}:s(o,r,"json",n,{returnExtentOnly:!0,returnCountOnly:!0}).then(t=>{const e=t.data;if(e.hasOwnProperty("extent"))return t;if(e.features)throw new Error(a);if(e.hasOwnProperty("count"))throw new Error(a);return t})}function I(o,r,n){return r.timeExtent!=null&&r.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):s(o,r,"json",n,{returnIdsOnly:!0,returnCountOnly:!0})}function s(o,r,n,t={},e={}){const l=typeof o=="string"?p(o):o,i=r.geometry?[r.geometry]:[];return t.responseType="json",E(i,null,t).then(u=>{const y=u?.[0];y!=null&&((r=r.clone()).geometry=y);const m=x({...l.query,f:n,...e,...O(r,e)});return c(F(l.path,"queryTopFeatures"),{...t,query:{...m,...t.query}})})}export{h as B,w as R,I as S,b as g}; diff --git a/custom-toc-highlight/assets/queryUtils-Brxu6254-PPvpiP5X.js b/custom-toc-highlight/assets/queryUtils-Brxu6254-CDiE0zms.js similarity index 94% rename from custom-toc-highlight/assets/queryUtils-Brxu6254-PPvpiP5X.js rename to custom-toc-highlight/assets/queryUtils-Brxu6254-CDiE0zms.js index d0c50d58..d6b4fdbe 100644 --- a/custom-toc-highlight/assets/queryUtils-Brxu6254-PPvpiP5X.js +++ b/custom-toc-highlight/assets/queryUtils-Brxu6254-CDiE0zms.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngineJSON-CGn_tfx8-D3N6SheD.js","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./json-BI97KiBB-Ce5cWfI2.js"])))=>i.map(i=>d[i]); -import{_ as F}from"./main-ugzBrWNm.js";import{eM as O,eN as U,aK as A,aq as j,aY as h,aC as m,eO as _,dd as u,b as N,eP as P,g as T,eQ as g,ca as q,cb as B,eR as I,cZ as E,eS as p}from"./story-BfX8CRfG.js";import{N as J,O as R,J as L}from"./projection-BA9M1R7d-BYoCXVXt.js";import{B as Q}from"./normalizeUtils-Bxmy9MNI-BT8FD-bF.js";import{a as S}from"./json-BI97KiBB-Ce5cWfI2.js";const c=[0,0];function d(e,n){if(!n)return null;if("x"in n){const i={x:0,y:0};return[i.x,i.y]=e(n.x,n.y,c),n.z!=null&&(i.z=n.z),n.m!=null&&(i.m=n.m),i}if("xmin"in n){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(n.xmin,n.ymin,c),[i.xmax,i.ymax]=e(n.xmax,n.ymax,c),n.hasZ&&(i.zmin=n.zmin,i.zmax=n.zmax,i.hasZ=!0),n.hasM&&(i.mmin=n.mmin,i.mmax=n.mmax,i.hasM=!0),i}return"rings"in n?{rings:x(n.rings,e),hasM:n.hasM,hasZ:n.hasZ}:"paths"in n?{paths:x(n.paths,e),hasM:n.hasM,hasZ:n.hasZ}:"points"in n?{points:w(n.points,e),hasM:n.hasM,hasZ:n.hasZ}:null}function x(e,n){const i=[];for(const t of e)i.push(w(t,n));return i}function w(e,n){const i=[];for(const t of e){const a=n(t[0],t[1],[0,0]);i.push(a),t.length>2&&a.push(t[2]),t.length>3&&a.push(t[3])}return i}async function b(e,n){if(!e||!n)return;const i=Array.isArray(e)?e.map(t=>t.geometry!=null?t.geometry.spatialReference:null).filter(j):[e];await J(i.map(t=>({source:t,dest:n})))}const M=d.bind(null,O),z=d.bind(null,U);function v(e,n,i,t){if(!e||(i||(i=n,n=e.spatialReference),!h(n)||!h(i)||m(n,i)))return e;if(_(n,i)){const a=u(i)?M(e):z(e);return a.spatialReference=i,a}return R(S,[e],n,i,null,t)[0]}class Y{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(n,i,t,a){if(!n?.length||!i||!t||m(i,t))return n;const s={geometries:n,inSpatialReference:i,outSpatialReference:t,geographicTransformation:a,resolve:N()};return this._jobs.push(s),this._timer??=setTimeout(this._process,10),s.resolve.promise}_process(){this._timer=null;const n=this._jobs.shift();if(!n)return;const{geometries:i,inSpatialReference:t,outSpatialReference:a,resolve:s,geographicTransformation:o}=n;_(t,a)?u(a)?s(i.map(M)):s(i.map(z)):s(R(S,i,t,a,o,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const $=new Y;function ne(e,n,i,t){return $.push(e,n,i,t)}const C=new A({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),y=Object.freeze({});async function ie(e,n,i){const{outFields:t,orderByFields:a,groupByFieldsForStatistics:s,outStatistics:o}=e;if(t)for(let r=0;rv(t,p));return(await k())(o.spatialReference,o,n,s)}async function k(){return(await F(()=>import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>e.g)).geodesicBuffer}export{ne as C,ie as D,C as Z,b as f,v as h,y as p,D as v}; +import{_ as F}from"./main-QGPoLsvl.js";import{eM as O,eN as U,aK as A,aq as j,aY as h,aC as m,eO as _,dd as u,b as N,eP as P,g as T,eQ as g,ca as q,cb as B,eR as I,cZ as E,eS as p}from"./story-Doly9N9p.js";import{N as J,O as R,J as L}from"./projection-BA9M1R7d-CAbqHZiw.js";import{B as Q}from"./normalizeUtils-Bxmy9MNI-fHOpXwKi.js";import{a as S}from"./json-BI97KiBB-Ce5cWfI2.js";const c=[0,0];function d(e,n){if(!n)return null;if("x"in n){const i={x:0,y:0};return[i.x,i.y]=e(n.x,n.y,c),n.z!=null&&(i.z=n.z),n.m!=null&&(i.m=n.m),i}if("xmin"in n){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(n.xmin,n.ymin,c),[i.xmax,i.ymax]=e(n.xmax,n.ymax,c),n.hasZ&&(i.zmin=n.zmin,i.zmax=n.zmax,i.hasZ=!0),n.hasM&&(i.mmin=n.mmin,i.mmax=n.mmax,i.hasM=!0),i}return"rings"in n?{rings:x(n.rings,e),hasM:n.hasM,hasZ:n.hasZ}:"paths"in n?{paths:x(n.paths,e),hasM:n.hasM,hasZ:n.hasZ}:"points"in n?{points:w(n.points,e),hasM:n.hasM,hasZ:n.hasZ}:null}function x(e,n){const i=[];for(const t of e)i.push(w(t,n));return i}function w(e,n){const i=[];for(const t of e){const a=n(t[0],t[1],[0,0]);i.push(a),t.length>2&&a.push(t[2]),t.length>3&&a.push(t[3])}return i}async function b(e,n){if(!e||!n)return;const i=Array.isArray(e)?e.map(t=>t.geometry!=null?t.geometry.spatialReference:null).filter(j):[e];await J(i.map(t=>({source:t,dest:n})))}const M=d.bind(null,O),z=d.bind(null,U);function v(e,n,i,t){if(!e||(i||(i=n,n=e.spatialReference),!h(n)||!h(i)||m(n,i)))return e;if(_(n,i)){const a=u(i)?M(e):z(e);return a.spatialReference=i,a}return R(S,[e],n,i,null,t)[0]}class Y{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(n,i,t,a){if(!n?.length||!i||!t||m(i,t))return n;const s={geometries:n,inSpatialReference:i,outSpatialReference:t,geographicTransformation:a,resolve:N()};return this._jobs.push(s),this._timer??=setTimeout(this._process,10),s.resolve.promise}_process(){this._timer=null;const n=this._jobs.shift();if(!n)return;const{geometries:i,inSpatialReference:t,outSpatialReference:a,resolve:s,geographicTransformation:o}=n;_(t,a)?u(a)?s(i.map(M)):s(i.map(z)):s(R(S,i,t,a,o,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const $=new Y;function ne(e,n,i,t){return $.push(e,n,i,t)}const C=new A({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),y=Object.freeze({});async function ie(e,n,i){const{outFields:t,orderByFields:a,groupByFieldsForStatistics:s,outStatistics:o}=e;if(t)for(let r=0;rv(t,p));return(await k())(o.spatialReference,o,n,s)}async function k(){return(await F(()=>import("./geometryEngineJSON-CGn_tfx8-D3N6SheD.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>e.g)).geodesicBuffer}export{ne as C,ie as D,C as Z,b as f,v as h,y as p,D as v}; diff --git a/custom-toc-highlight/assets/queryZScale-BiYV6Pr6-B5UMbu5B.js b/custom-toc-highlight/assets/queryZScale-BiYV6Pr6-B7zp5L1G.js similarity index 71% rename from custom-toc-highlight/assets/queryZScale-BiYV6Pr6-B5UMbu5B.js rename to custom-toc-highlight/assets/queryZScale-BiYV6Pr6-B7zp5L1G.js index aa3597b7..c7b8e39e 100644 --- a/custom-toc-highlight/assets/queryZScale-BiYV6Pr6-B5UMbu5B.js +++ b/custom-toc-highlight/assets/queryZScale-BiYV6Pr6-B7zp5L1G.js @@ -1 +1 @@ -import{o as n}from"./projection-BA9M1R7d-BYoCXVXt.js";function s(r,f,e){if(!e?.features||!e.hasZ)return;const o=n(e.geometryType,f,r.outSpatialReference);if(o!=null)for(const t of e.features)o(t.geometry)}export{s as n}; +import{o as n}from"./projection-BA9M1R7d-CAbqHZiw.js";function s(r,f,e){if(!e?.features||!e.hasZ)return;const o=n(e.geometryType,f,r.outSpatialReference);if(o!=null)for(const t of e.features)o(t.geometry)}export{s as n}; diff --git a/custom-toc-highlight/assets/rasterProjectionHelper-Calp0o_1-DktPwJyi.js b/custom-toc-highlight/assets/rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js similarity index 96% rename from custom-toc-highlight/assets/rasterProjectionHelper-Calp0o_1-DktPwJyi.js rename to custom-toc-highlight/assets/rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js index ecc4d892..1dc9782e 100644 --- a/custom-toc-highlight/assets/rasterProjectionHelper-Calp0o_1-DktPwJyi.js +++ b/custom-toc-highlight/assets/rasterProjectionHelper-Calp0o_1-DLz-N_Wv.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-zj0NdzY3.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-BIb5_ysY.js"])))=>i.map(i=>d[i]); -import{_ as Nn}from"./main-ugzBrWNm.js";import{n as Y,p as O,aq as En,l as tn,w as N,aG as _n,o as gn,i3 as T,i4 as v,i5 as an,i6 as vn,i7 as Tn,J as yn}from"./story-BfX8CRfG.js";import{_ as B,W as Cn,K as W,J as Wn,Y as rn}from"./projection-BA9M1R7d-BYoCXVXt.js";var nn;function dn(n,t,i){return!Wn(n,t,i)}function z(n,t,i){const o=dn(n,t,i);if(o&&!B())throw new gn("rasterprojectionhelper-project","projection engine is not loaded");return o}(function(n){n[n.None=0]="None",n[n.North=1]="North",n[n.South=2]="South",n[n.Both=3]="Both"})(nn||(nn={}));const ln=(n,t,i,o=0)=>{if(i[0]===1)return[0,0];let a=1,e=-1,s=1,c=-1;for(let f=0;fn[f]?n[f]:a,e=e>n[f]?e:n[f],s=s>n[f+1]?n[f+1]:s,c=c>n[f+1]?c:n[f+1]);const{cols:l,rows:r}=t,u=(e-a)/l/i[0],w=(c-s)/r/i[1],g=2*o;let x=0,h=!1,m=[0,0];for(let f=0;fx&&(x=R+b,m=[R,b]),g&&x>g){h=!0;break}}if(h)break}return m},zn={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},F=32,J=4,$=J,Z=new Map,H=new Map,K=500;let X=null;async function Dn(){X&&B()||(B()||await Cn(),X=await Nn(()=>import("./geometryEngine-CdPoFSE4-zj0NdzY3.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url))}function Ln(n,t,i){return z(n.spatialReference,t),i?rn(t,n.spatialReference,n):rn(n.spatialReference,t,n)}function Qn(n,t,i,o=null){const a=n.spatialReference;if(!a||!t||a.equals(t))return n;z(a,t,o);const e=i.center,s=new Y({xmin:e.x-n.x/2,xmax:e.x+n.x/2,ymin:e.y-n.y/2,ymax:e.y+n.y/2,spatialReference:a}),c=W(s,t,o),l=E(t);return c==null||l!=null&&c.width>=l?q(n,a,t):{x:c.width,y:c.height}}function q(n,t,i){const o=O(t)/O(i);return{x:n.x*o,y:n.y*o}}function cn(n,t,i){const{spatialReference:o}=i;if(!o||!t||o.equals(t))return n;if(o.isGeographic&&t.isGeographic)return q(n,o,t);if(z(o,t),!X)throw new gn("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:a,y:e}=n;const s=(a+e)/2*O(o);let c=1;s>30&&(c=30/s,a*=c,e*=c);const l=256,r=a*l/2,u=e*l/2,{x:w,y:g}=i.center,x=[];for(let S=0;S<=l;S++)x.push([w-r,g-u+S*e]);for(let S=1;S<=l;S++)x.push([w-r+S*a,g+u]);for(let S=1;S<=l;S++)x.push([w+r,g+u-S*e]);for(let S=1;S=M)return q(n,o,t);const y=X.planarArea(m),p=a*e*l*l,d=Math.sqrt(y/p)/c,R={x:f.width/c/l,y:f.height/c/l},b={x:a*d,y:e*d},G=R.x*R.y;return Math.abs(G-b.x*b.y)/G<.1?R:b}function k(n,t=.01){return O(n)?t/O(n):0}function fn(n,t,i=null,o=!0){const a=n.spatialReference;if(a.equals(t))return n;z(a,t,i);const e=W(n,t,i);return o&&e&&wn([n],[e],a,t),e}function wn(n,t,i,o){const a=D(i,!0),e=D(o,!0),s=k(i,K),c=k(o,K);if(s&&a!=null&&e!=null)for(let l=0;l=e[1]-c&&Math.abs(u-a[0])new N(c[0],c[1],i)),s=W(e,o,a);return a&&wn(e,s,i,o),s.map(c=>c?[c.x,c.y]:[NaN,NaN])}function jn(n){const{inSR:t,outSR:i,datumTransformation:o}=n,a=I(t),{points:e,mask:s}=en(n,a);if(!t.isGeographic){const l=t.wkid?T.coordsys(t.wkid):T.fromString(t.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,t.wkt2||t.wkt);an.projToGeog(l,e.length,e)}if(o!=null&&o.steps.length){let l;if(i.isGeographic&&(l=e.map(([r])=>r>179.9955?1:r<-179.9955?-1:0)),o.steps.forEach(r=>{const u=r.wkid?T.geogtran(r.wkid):T.fromString(v.PE_TYPE_GEOGTRAN,r.wkt);vn.geogToGeog(u,e.length,e,null,r.isInverse?v.PE_TRANSFORM_2_TO_1:v.PE_TRANSFORM_1_TO_2)}),l)for(let r=0;r179.9955?1:w<-179.9955?-1:0;u&&g&&u!==g&&(e[r][0]=u>0?w+360:w-360)}}if(!i.isGeographic){const l=I(i,!0),r=l!=null&&l.isEnvelope?[l.bbox[1],l.bbox[3]]:[-90,90];Yn(e,r);const u=i.wkid?T.coordsys(i.wkid):T.fromString(i.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,i.wkt2||i.wkt);an.geogToProj(u,e.length,e)}let c=e;if(s&&e.length!==s.length){c=[];for(let l=0,r=0;lf.getInclusive()===1&&f.getKind()===1);if(!s){if(s=a.find(f=>f.getInclusive()===1&&f.getKind()===0),!s)return null;e=!0}const c=i?0:(o.getNorthPoleLocation()===2?1:0)|(o.getSouthPoleLocation()===2?2:0),l=o.isPannableRectangle(),r=s.getCoord();if(e)return{isEnvelope:e,isPannable:l,vertices:r,coef:null,bbox:[r[0][0]-t,r[0][1]-t,r[1][0]+t,r[1][1]+t],poleLocation:c};let u=0;const w=[];let[g,x]=r[0],[h,m]=r[0];for(let f=0,M=r.length;fy?h:y,m=m>p?m:p}return{isEnvelope:!1,isPannable:l,vertices:r,coef:w,bbox:[g,x,h,m],poleLocation:c}}function en(n,t){const i=[],{cols:o,rows:a,xres:e,yres:s,usePixelCenter:c}=n;let{xmin:l,ymax:r}=n;if(c&&(l+=e/2,r-=s/2),t==null){for(let x=0;x=x&&p<=m;for(let R=0;R=h&&b<=f&&(i.push([p,b]),u[y]=1)}}return{points:i,mask:u}}const w=t.coef,g=[];for(let x=0;x=R&&h<=b){const S=p*h+d;m.push(S),f.push(G)}}let M=m;if(m.length>2){let y=f[0]===2?0:f[0],p=m[0];M=[];for(let d=1;dd-R)}else m[0]>m[1]&&(M=[m[1],m[0]]);g.push(M)}for(let x=0,h=0;x=y[0]&&m<=y[1]&&(i.push([m,M]),u[h]=1);else if(y.length>2){let p=!1;for(let d=0;d=y[d]&&m<=y[d+1]){p=!0;break}p&&(i.push([m,M]),u[h]=1)}}}return{points:i,mask:u}}function Yn(n,t){const[i,o]=t;for(let a=0;ao)&&(n[a]=[NaN,NaN])}}function Mn(n,t){const i=E(n[0].spatialReference);if(n.length<2||i==null||(t=t??k(n[0].spatialReference),(n=n.filter(c=>c.width>t)).length===1))return n[0];let{xmin:o,xmax:a,ymin:e,ymax:s}=n[0];for(let c=1;ck(a)){const{xmin:r,xmax:u}=n;for(let w=0;w<=e;w++){const g=w===0?r:-s/2,x=w===e?u-s*w:s/2;l[w]=new Y({xmin:g,xmax:x,ymin:n.ymin,ymax:n.ymax,spatialReference:a})}}return Mn(l.map(r=>xn(r,t,i,o)).filter(En))}function Un(n,t,i){if(n.type==="extent"){const{xmin:o,ymin:a,xmax:e,ymax:s,spatialReference:c}=n;n=new tn({rings:[[[o,s],[e,s],[e,a],[o,a],[o,s]]],spatialReference:c})}return n.spatialReference.equals(t)?n:(z(n.spatialReference,t,i),W(n,t,i))}function qn(n,t){const i=E(t);if(i==null)return null;let{xmin:o,ymin:a,xmax:e,ymax:s}=n;const c=n.spatialReference,l=new tn({spatialReference:c,rings:[[[o,a],[e,a],[e,s],[o,s],[o,a]]]}),r=W(l,t);if(r.rings.length!==2||!r.rings[0].length||!r.rings[1].length)return null;const{rings:u}=r,w=k(c),g=new Y({spatialReference:t});for(let x=0;x<2;x++){o=e=u[x][0][0],a=s=u[x][0][1];for(let h=0;hu[x][h][0]?u[x][h][0]:o,e=eu[x][h][1]?u[x][h][1]:a,s=s=s.ymax))return null;if(!o||!s)return s;const c=D(e,!0),l=D(t,!0);if(c==null||l==null)return s;const r=k(e,.001),u=k(e,K),w=k(t,.001);if(Math.abs(s.xmin-l[0])u){s.xmin=l[0];const h=[];h.push(new N(n.xmax,n.ymin,e)),h.push(new N(n.xmax,(n.ymin+n.ymax)/2,e)),h.push(new N(n.xmax,n.ymax,e));const m=h.map(f=>fn(f,t,i)).filter(f=>!isNaN(f?.x)).map(f=>f.x);s.xmax=Math.max.apply(null,m)}if(xu){s.xmax=l[1];const h=[];h.push(new N(n.xmin,n.ymin,e)),h.push(new N(n.xmin,(n.ymin+n.ymax)/2,e)),h.push(new N(n.xmin,n.ymax,e));const m=h.map(f=>fn(f,t,i)).filter(f=>!isNaN(f?.x)).map(f=>f.x);s.xmin=Math.min.apply(null,m)}}else{const g=k(t,.001);Math.abs(s.xmin-l[0])0&&o.outofBoundPointCount$)&&(dn(l,r,n.datumTransformation)&&(l.isGeographic||I(l)),i=[J,J],o=V({...n,spacing:i}),a={cols:o.size[0]+1,rows:o.size[1]+1},s=ln(o.offsets,a,i,$)),o.error=s,i[0]>1&&(o.coefficients=mn(o.offsets,a,e)),n.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(r.isGeographic)o.gcsGrid={offsets:o.offsets,coefficients:o.coefficients,spacing:i};else{const u=I(l);if(u!=null&&!u.isEnvelope){const w=Bn(l),g=Rn(n.projectedExtent,w),{offsets:x}=V({...n,srcBufferExtent:g,spacing:i}),h=mn(x,a,e);o.gcsGrid={offsets:x,coefficients:h,spacing:i}}}return o}function V(n){const{projectedExtent:t,srcBufferExtent:i,pixelSize:o,datumTransformation:a,rasterTransform:e}=n,s=t.spatialReference,c=i.spatialReference,l=z(s,c),{xmin:r,ymin:u,xmax:w,ymax:g}=t,x=E(c),h=x!=null&&(n.hasWrapAround||e?.type==="gcs-shift"),m=n.spacing||[F,F],f=m[0]*o.x,M=m[1]*o.y,y=m[0]===1,p=Math.ceil((w-r)/f-.1/m[0])+(y?0:1),d=Math.ceil((g-u)/M-.1/m[1])+(y?0:1),R=On({cols:p,rows:d,xmin:r,ymax:g,xres:f,yres:M,inSR:s,outSR:c,datumTransformation:a,preferPE:m[0]<=J,usePixelCenter:y}),b=[];let G,S=0;const _=y?-1:NaN,{xmin:L,xmax:j,ymax:Q,width:bn,height:Pn}=i,Gn=k(c,K),kn=x!=null&&L>0&&j>x/2;let on=!1;if(l){const C=I(s);on=C!=null&&C.poleLocation>0}for(let C=0;Cj&&P[0]>x/2-Gn?P[0]-=x:h&&C===0&&P[0]<0&&kn&&!e&&(P[0]+=x),!P||isNaN(P[0])||isNaN(P[1]))b.push(_),b.push(_),U.push(null),S++;else{if(e){const sn=e.inverseTransform(new N({x:P[0],y:P[1],spatialReference:c}));P=[sn.x,sn.y]}U.push(P),C>0&&h&&G[A]&&P[0]j&&P[0]>x&&(P[0]-=x)),b.push((P[0]-L)/bn),b.push((Q-P[1])/Pn)}}G=U}return{offsets:b,error:null,coefficients:null,outofBoundPointCount:S,spacing:m,size:y?[p,d]:[p-1,d-1]}}function mn(n,t,i){const{cols:o,rows:a}=t,e=new Float32Array((o-1)*(a-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),c=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;la){const c=n.xmin-a;s=-Math.ceil(c/e)}return new Y({spatialReference:n.spatialReference,xmin:n.xmin+s*e,ymin:n.ymin,xmax:n.xmax+s*e,ymax:n.ymax})}function Vn(n,t,i){const{storageInfo:o,pixelSize:a}=t;let e=0,s=!1;const{pyramidResolutions:c}=o,l=o.tileInfo.format?.toLowerCase()==="mixed"?Math.max(1,Math.min(3,o.tileInfo.dpi/96)):1,r=(n.x+n.y)/2/l;if(c!=null&&c.length){const h=c[c.length-1],m=(h.x+h.y)/2,f=(a.x+a.y)/2;if(r<=f)e=0;else if(r>=m)e=c.length,s=r/m>8;else{let y,p=f;for(let d=1;d<=c.length;d++){if(y=(c[d-1].x+c[d-1].y)/2,r<=y){r===y?e=d:i==="down"?(e=d-1,s=r/p>8):e=i==="up"||r-p>y-r||r/p>2?d:d-1;break}p=y}}const M=e===0?a:c[e-1];return s&&Math.min(M.x,M.y)*O(t.spatialReference)>19567&&(s=!1),{pyramidLevel:e,pyramidResolution:new N({x:M.x,y:M.y,spatialReference:t.spatialReference}),excessiveReading:s}}const u=Math.log(n.x/a.x)/Math.LN2,w=Math.log(n.y/a.y)/Math.LN2,g=t.storageInfo.maximumPyramidLevel||0;e=i==="down"?Math.floor(Math.min(u,w)):i==="up"?Math.ceil(Math.max(u,w)):Math.round((u+w)/2),e<0?e=0:e>g&&(s=e>g+3,e=g);const x=2**e;return{pyramidLevel:e,pyramidResolution:new N({x:x*t.nativePixelSize.x,y:x*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:s}}function pn(n,t){const{pixelSize:i,extent:o}=n,a=Ln(o,t,!1);return Rn(Fn(o,(i.x+i.y)/16),t,a)}function nt(n,t,i){const o=i?.tileSize,a=i?.alignGlobalDatasetWithAGOL,{extent:e,spatialReference:s,pixelSize:c}=n,l=cn(c,t,e);if(l==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const r=(l.x+l.y)/2,u=O(t),w=r*u*96*39.37,g=t.isGeographic?256/o*2958287637958547e-7:256/o*591657527591555e-6;let x=n.dataType==="vector-magdir"||n.dataType==="vector-uv";const h=pn(n,t),m=Math.min(Math.ceil(Math.log(Math.min(n.width,n.height)/32)/Math.LN2),Math.ceil(Math.log(g/2/w)/Math.LN2));if(!x&&a&&(t.isGeographic||t.isWebMercator)){const S=E(t);if(x=Sn(h)>0||S!=null&&h.width>S/4,!x&&S!=null){let _=-1;if(m<3)_=2**m*r*o;else if(n.storageInfo){const{maximumPyramidLevel:j=0,pyramidScalingFactor:Q=2}=n.storageInfo;_=Q**j*r*o}const L=Math.ceil(S/_);x=L===1||L===2&&S/2-h.xmax<_}}let f,M=w;const y=1.001,p=Math.min(2,Math.max(1.414,n.storageInfo?.pyramidScalingFactor||2));if(x){M=g;const S=t.isGeographic?1341104507446289e-21:.29858214164761665,_=S*(96*u*39.37),L=t.isGeographic?4326:3857;f=cn({x:S,y:S},s,pn(n,new yn({wkid:L}))),f.x*=M/_,f.y*=M/_}else{f={x:c.x,y:c.y};let S=0;for(;M=G;)M/=p,f.x/=p,f.y/=p,d.push(M),R.push({x:f.x,y:f.y});return{projectedPixelSize:l,scales:d,srcResolutions:R,isCustomTilingScheme:!x}}export{dn as $,Un as F,Zn as K,Dn as L,Vn as Q,nt as U,Qn as W,Hn as X,$n as Y,E as k,fn as n,Rn as o,Ln as p,pn as r,Sn as s}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./geometryEngine-CdPoFSE4-ChEr_3ja.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css","./geometryEngineBase-DueYg7ux-CCeespPx.js","./_commonjsHelpers-BITg13Vk-KnjfkSck.js","./hydrated-CplJC1Fs-McBHp1Y5.js"])))=>i.map(i=>d[i]); +import{_ as Nn}from"./main-QGPoLsvl.js";import{n as Y,p as O,aq as En,l as tn,w as N,aG as _n,o as gn,i3 as T,i4 as v,i5 as an,i6 as vn,i7 as Tn,J as yn}from"./story-Doly9N9p.js";import{_ as B,W as Cn,K as W,J as Wn,Y as rn}from"./projection-BA9M1R7d-CAbqHZiw.js";var nn;function dn(n,t,i){return!Wn(n,t,i)}function z(n,t,i){const o=dn(n,t,i);if(o&&!B())throw new gn("rasterprojectionhelper-project","projection engine is not loaded");return o}(function(n){n[n.None=0]="None",n[n.North=1]="North",n[n.South=2]="South",n[n.Both=3]="Both"})(nn||(nn={}));const ln=(n,t,i,o=0)=>{if(i[0]===1)return[0,0];let a=1,e=-1,s=1,c=-1;for(let f=0;fn[f]?n[f]:a,e=e>n[f]?e:n[f],s=s>n[f+1]?n[f+1]:s,c=c>n[f+1]?c:n[f+1]);const{cols:l,rows:r}=t,u=(e-a)/l/i[0],w=(c-s)/r/i[1],g=2*o;let x=0,h=!1,m=[0,0];for(let f=0;fx&&(x=R+b,m=[R,b]),g&&x>g){h=!0;break}}if(h)break}return m},zn={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},F=32,J=4,$=J,Z=new Map,H=new Map,K=500;let X=null;async function Dn(){X&&B()||(B()||await Cn(),X=await Nn(()=>import("./geometryEngine-CdPoFSE4-ChEr_3ja.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url))}function Ln(n,t,i){return z(n.spatialReference,t),i?rn(t,n.spatialReference,n):rn(n.spatialReference,t,n)}function Qn(n,t,i,o=null){const a=n.spatialReference;if(!a||!t||a.equals(t))return n;z(a,t,o);const e=i.center,s=new Y({xmin:e.x-n.x/2,xmax:e.x+n.x/2,ymin:e.y-n.y/2,ymax:e.y+n.y/2,spatialReference:a}),c=W(s,t,o),l=E(t);return c==null||l!=null&&c.width>=l?q(n,a,t):{x:c.width,y:c.height}}function q(n,t,i){const o=O(t)/O(i);return{x:n.x*o,y:n.y*o}}function cn(n,t,i){const{spatialReference:o}=i;if(!o||!t||o.equals(t))return n;if(o.isGeographic&&t.isGeographic)return q(n,o,t);if(z(o,t),!X)throw new gn("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:a,y:e}=n;const s=(a+e)/2*O(o);let c=1;s>30&&(c=30/s,a*=c,e*=c);const l=256,r=a*l/2,u=e*l/2,{x:w,y:g}=i.center,x=[];for(let S=0;S<=l;S++)x.push([w-r,g-u+S*e]);for(let S=1;S<=l;S++)x.push([w-r+S*a,g+u]);for(let S=1;S<=l;S++)x.push([w+r,g+u-S*e]);for(let S=1;S=M)return q(n,o,t);const y=X.planarArea(m),p=a*e*l*l,d=Math.sqrt(y/p)/c,R={x:f.width/c/l,y:f.height/c/l},b={x:a*d,y:e*d},G=R.x*R.y;return Math.abs(G-b.x*b.y)/G<.1?R:b}function k(n,t=.01){return O(n)?t/O(n):0}function fn(n,t,i=null,o=!0){const a=n.spatialReference;if(a.equals(t))return n;z(a,t,i);const e=W(n,t,i);return o&&e&&wn([n],[e],a,t),e}function wn(n,t,i,o){const a=D(i,!0),e=D(o,!0),s=k(i,K),c=k(o,K);if(s&&a!=null&&e!=null)for(let l=0;l=e[1]-c&&Math.abs(u-a[0])new N(c[0],c[1],i)),s=W(e,o,a);return a&&wn(e,s,i,o),s.map(c=>c?[c.x,c.y]:[NaN,NaN])}function jn(n){const{inSR:t,outSR:i,datumTransformation:o}=n,a=I(t),{points:e,mask:s}=en(n,a);if(!t.isGeographic){const l=t.wkid?T.coordsys(t.wkid):T.fromString(t.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,t.wkt2||t.wkt);an.projToGeog(l,e.length,e)}if(o!=null&&o.steps.length){let l;if(i.isGeographic&&(l=e.map(([r])=>r>179.9955?1:r<-179.9955?-1:0)),o.steps.forEach(r=>{const u=r.wkid?T.geogtran(r.wkid):T.fromString(v.PE_TYPE_GEOGTRAN,r.wkt);vn.geogToGeog(u,e.length,e,null,r.isInverse?v.PE_TRANSFORM_2_TO_1:v.PE_TRANSFORM_1_TO_2)}),l)for(let r=0;r179.9955?1:w<-179.9955?-1:0;u&&g&&u!==g&&(e[r][0]=u>0?w+360:w-360)}}if(!i.isGeographic){const l=I(i,!0),r=l!=null&&l.isEnvelope?[l.bbox[1],l.bbox[3]]:[-90,90];Yn(e,r);const u=i.wkid?T.coordsys(i.wkid):T.fromString(i.isGeographic?v.PE_TYPE_GEOGCS:v.PE_TYPE_PROJCS,i.wkt2||i.wkt);an.geogToProj(u,e.length,e)}let c=e;if(s&&e.length!==s.length){c=[];for(let l=0,r=0;lf.getInclusive()===1&&f.getKind()===1);if(!s){if(s=a.find(f=>f.getInclusive()===1&&f.getKind()===0),!s)return null;e=!0}const c=i?0:(o.getNorthPoleLocation()===2?1:0)|(o.getSouthPoleLocation()===2?2:0),l=o.isPannableRectangle(),r=s.getCoord();if(e)return{isEnvelope:e,isPannable:l,vertices:r,coef:null,bbox:[r[0][0]-t,r[0][1]-t,r[1][0]+t,r[1][1]+t],poleLocation:c};let u=0;const w=[];let[g,x]=r[0],[h,m]=r[0];for(let f=0,M=r.length;fy?h:y,m=m>p?m:p}return{isEnvelope:!1,isPannable:l,vertices:r,coef:w,bbox:[g,x,h,m],poleLocation:c}}function en(n,t){const i=[],{cols:o,rows:a,xres:e,yres:s,usePixelCenter:c}=n;let{xmin:l,ymax:r}=n;if(c&&(l+=e/2,r-=s/2),t==null){for(let x=0;x=x&&p<=m;for(let R=0;R=h&&b<=f&&(i.push([p,b]),u[y]=1)}}return{points:i,mask:u}}const w=t.coef,g=[];for(let x=0;x=R&&h<=b){const S=p*h+d;m.push(S),f.push(G)}}let M=m;if(m.length>2){let y=f[0]===2?0:f[0],p=m[0];M=[];for(let d=1;dd-R)}else m[0]>m[1]&&(M=[m[1],m[0]]);g.push(M)}for(let x=0,h=0;x=y[0]&&m<=y[1]&&(i.push([m,M]),u[h]=1);else if(y.length>2){let p=!1;for(let d=0;d=y[d]&&m<=y[d+1]){p=!0;break}p&&(i.push([m,M]),u[h]=1)}}}return{points:i,mask:u}}function Yn(n,t){const[i,o]=t;for(let a=0;ao)&&(n[a]=[NaN,NaN])}}function Mn(n,t){const i=E(n[0].spatialReference);if(n.length<2||i==null||(t=t??k(n[0].spatialReference),(n=n.filter(c=>c.width>t)).length===1))return n[0];let{xmin:o,xmax:a,ymin:e,ymax:s}=n[0];for(let c=1;ck(a)){const{xmin:r,xmax:u}=n;for(let w=0;w<=e;w++){const g=w===0?r:-s/2,x=w===e?u-s*w:s/2;l[w]=new Y({xmin:g,xmax:x,ymin:n.ymin,ymax:n.ymax,spatialReference:a})}}return Mn(l.map(r=>xn(r,t,i,o)).filter(En))}function Un(n,t,i){if(n.type==="extent"){const{xmin:o,ymin:a,xmax:e,ymax:s,spatialReference:c}=n;n=new tn({rings:[[[o,s],[e,s],[e,a],[o,a],[o,s]]],spatialReference:c})}return n.spatialReference.equals(t)?n:(z(n.spatialReference,t,i),W(n,t,i))}function qn(n,t){const i=E(t);if(i==null)return null;let{xmin:o,ymin:a,xmax:e,ymax:s}=n;const c=n.spatialReference,l=new tn({spatialReference:c,rings:[[[o,a],[e,a],[e,s],[o,s],[o,a]]]}),r=W(l,t);if(r.rings.length!==2||!r.rings[0].length||!r.rings[1].length)return null;const{rings:u}=r,w=k(c),g=new Y({spatialReference:t});for(let x=0;x<2;x++){o=e=u[x][0][0],a=s=u[x][0][1];for(let h=0;hu[x][h][0]?u[x][h][0]:o,e=eu[x][h][1]?u[x][h][1]:a,s=s=s.ymax))return null;if(!o||!s)return s;const c=D(e,!0),l=D(t,!0);if(c==null||l==null)return s;const r=k(e,.001),u=k(e,K),w=k(t,.001);if(Math.abs(s.xmin-l[0])u){s.xmin=l[0];const h=[];h.push(new N(n.xmax,n.ymin,e)),h.push(new N(n.xmax,(n.ymin+n.ymax)/2,e)),h.push(new N(n.xmax,n.ymax,e));const m=h.map(f=>fn(f,t,i)).filter(f=>!isNaN(f?.x)).map(f=>f.x);s.xmax=Math.max.apply(null,m)}if(xu){s.xmax=l[1];const h=[];h.push(new N(n.xmin,n.ymin,e)),h.push(new N(n.xmin,(n.ymin+n.ymax)/2,e)),h.push(new N(n.xmin,n.ymax,e));const m=h.map(f=>fn(f,t,i)).filter(f=>!isNaN(f?.x)).map(f=>f.x);s.xmin=Math.min.apply(null,m)}}else{const g=k(t,.001);Math.abs(s.xmin-l[0])0&&o.outofBoundPointCount$)&&(dn(l,r,n.datumTransformation)&&(l.isGeographic||I(l)),i=[J,J],o=V({...n,spacing:i}),a={cols:o.size[0]+1,rows:o.size[1]+1},s=ln(o.offsets,a,i,$)),o.error=s,i[0]>1&&(o.coefficients=mn(o.offsets,a,e)),n.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(r.isGeographic)o.gcsGrid={offsets:o.offsets,coefficients:o.coefficients,spacing:i};else{const u=I(l);if(u!=null&&!u.isEnvelope){const w=Bn(l),g=Rn(n.projectedExtent,w),{offsets:x}=V({...n,srcBufferExtent:g,spacing:i}),h=mn(x,a,e);o.gcsGrid={offsets:x,coefficients:h,spacing:i}}}return o}function V(n){const{projectedExtent:t,srcBufferExtent:i,pixelSize:o,datumTransformation:a,rasterTransform:e}=n,s=t.spatialReference,c=i.spatialReference,l=z(s,c),{xmin:r,ymin:u,xmax:w,ymax:g}=t,x=E(c),h=x!=null&&(n.hasWrapAround||e?.type==="gcs-shift"),m=n.spacing||[F,F],f=m[0]*o.x,M=m[1]*o.y,y=m[0]===1,p=Math.ceil((w-r)/f-.1/m[0])+(y?0:1),d=Math.ceil((g-u)/M-.1/m[1])+(y?0:1),R=On({cols:p,rows:d,xmin:r,ymax:g,xres:f,yres:M,inSR:s,outSR:c,datumTransformation:a,preferPE:m[0]<=J,usePixelCenter:y}),b=[];let G,S=0;const _=y?-1:NaN,{xmin:L,xmax:j,ymax:Q,width:bn,height:Pn}=i,Gn=k(c,K),kn=x!=null&&L>0&&j>x/2;let on=!1;if(l){const C=I(s);on=C!=null&&C.poleLocation>0}for(let C=0;Cj&&P[0]>x/2-Gn?P[0]-=x:h&&C===0&&P[0]<0&&kn&&!e&&(P[0]+=x),!P||isNaN(P[0])||isNaN(P[1]))b.push(_),b.push(_),U.push(null),S++;else{if(e){const sn=e.inverseTransform(new N({x:P[0],y:P[1],spatialReference:c}));P=[sn.x,sn.y]}U.push(P),C>0&&h&&G[A]&&P[0]j&&P[0]>x&&(P[0]-=x)),b.push((P[0]-L)/bn),b.push((Q-P[1])/Pn)}}G=U}return{offsets:b,error:null,coefficients:null,outofBoundPointCount:S,spacing:m,size:y?[p,d]:[p-1,d-1]}}function mn(n,t,i){const{cols:o,rows:a}=t,e=new Float32Array((o-1)*(a-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),c=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;la){const c=n.xmin-a;s=-Math.ceil(c/e)}return new Y({spatialReference:n.spatialReference,xmin:n.xmin+s*e,ymin:n.ymin,xmax:n.xmax+s*e,ymax:n.ymax})}function Vn(n,t,i){const{storageInfo:o,pixelSize:a}=t;let e=0,s=!1;const{pyramidResolutions:c}=o,l=o.tileInfo.format?.toLowerCase()==="mixed"?Math.max(1,Math.min(3,o.tileInfo.dpi/96)):1,r=(n.x+n.y)/2/l;if(c!=null&&c.length){const h=c[c.length-1],m=(h.x+h.y)/2,f=(a.x+a.y)/2;if(r<=f)e=0;else if(r>=m)e=c.length,s=r/m>8;else{let y,p=f;for(let d=1;d<=c.length;d++){if(y=(c[d-1].x+c[d-1].y)/2,r<=y){r===y?e=d:i==="down"?(e=d-1,s=r/p>8):e=i==="up"||r-p>y-r||r/p>2?d:d-1;break}p=y}}const M=e===0?a:c[e-1];return s&&Math.min(M.x,M.y)*O(t.spatialReference)>19567&&(s=!1),{pyramidLevel:e,pyramidResolution:new N({x:M.x,y:M.y,spatialReference:t.spatialReference}),excessiveReading:s}}const u=Math.log(n.x/a.x)/Math.LN2,w=Math.log(n.y/a.y)/Math.LN2,g=t.storageInfo.maximumPyramidLevel||0;e=i==="down"?Math.floor(Math.min(u,w)):i==="up"?Math.ceil(Math.max(u,w)):Math.round((u+w)/2),e<0?e=0:e>g&&(s=e>g+3,e=g);const x=2**e;return{pyramidLevel:e,pyramidResolution:new N({x:x*t.nativePixelSize.x,y:x*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:s}}function pn(n,t){const{pixelSize:i,extent:o}=n,a=Ln(o,t,!1);return Rn(Fn(o,(i.x+i.y)/16),t,a)}function nt(n,t,i){const o=i?.tileSize,a=i?.alignGlobalDatasetWithAGOL,{extent:e,spatialReference:s,pixelSize:c}=n,l=cn(c,t,e);if(l==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const r=(l.x+l.y)/2,u=O(t),w=r*u*96*39.37,g=t.isGeographic?256/o*2958287637958547e-7:256/o*591657527591555e-6;let x=n.dataType==="vector-magdir"||n.dataType==="vector-uv";const h=pn(n,t),m=Math.min(Math.ceil(Math.log(Math.min(n.width,n.height)/32)/Math.LN2),Math.ceil(Math.log(g/2/w)/Math.LN2));if(!x&&a&&(t.isGeographic||t.isWebMercator)){const S=E(t);if(x=Sn(h)>0||S!=null&&h.width>S/4,!x&&S!=null){let _=-1;if(m<3)_=2**m*r*o;else if(n.storageInfo){const{maximumPyramidLevel:j=0,pyramidScalingFactor:Q=2}=n.storageInfo;_=Q**j*r*o}const L=Math.ceil(S/_);x=L===1||L===2&&S/2-h.xmax<_}}let f,M=w;const y=1.001,p=Math.min(2,Math.max(1.414,n.storageInfo?.pyramidScalingFactor||2));if(x){M=g;const S=t.isGeographic?1341104507446289e-21:.29858214164761665,_=S*(96*u*39.37),L=t.isGeographic?4326:3857;f=cn({x:S,y:S},s,pn(n,new yn({wkid:L}))),f.x*=M/_,f.y*=M/_}else{f={x:c.x,y:c.y};let S=0;for(;M=G;)M/=p,f.x/=p,f.y/=p,d.push(M),R.push({x:f.x,y:f.y});return{projectedPixelSize:l,scales:d,srcResolutions:R,isCustomTilingScheme:!x}}export{dn as $,Un as F,Zn as K,Dn as L,Vn as Q,nt as U,Qn as W,Hn as X,$n as Y,E as k,fn as n,Rn as o,Ln as p,pn as r,Sn as s}; diff --git a/custom-toc-highlight/assets/rasterUtils-DqAu9qES-Du-esSHL.js b/custom-toc-highlight/assets/rasterUtils-DqAu9qES-Be2s-rDn.js similarity index 98% rename from custom-toc-highlight/assets/rasterUtils-DqAu9qES-Du-esSHL.js rename to custom-toc-highlight/assets/rasterUtils-DqAu9qES-Be2s-rDn.js index 8eb06d6a..4603594a 100644 --- a/custom-toc-highlight/assets/rasterUtils-DqAu9qES-Du-esSHL.js +++ b/custom-toc-highlight/assets/rasterUtils-DqAu9qES-Be2s-rDn.js @@ -1 +1 @@ -import{s as E}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{B as C,F as A,M as _,G as T,c as s,U as M}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as h,V as O}from"./Texture-BCt2hphT-hC4XzHg_.js";function w(e,t,n="nearest",i=!1){const r=!(i&&t.pixelType==="u8"),u=r?A.FLOAT:A.UNSIGNED_BYTE,a=t.pixels==null||t.pixels.length===0?null:r?t.getAsRGBAFloat():t.getAsRGBA(),f=e.capabilities.textureFloatLinear,o=new h;return o.width=t.width,o.height=t.height,o.internalFormat=r?C.RGBA32F:M.RGBA,o.samplingMode=!f||n!=="bilinear"&&n!=="cubic"?_.NEAREST:_.LINEAR,o.dataType=u,o.wrapMode=T.CLAMP_TO_EDGE,new O(e,o,a)}function L(e,t){const{spacing:n,offsets:i,coefficients:r,size:[u,a]}=t,f=n[0]>1,o=new h;o.width=f?4*u:u,o.height=a,o.internalFormat=C.RGBA32F,o.dataType=A.FLOAT,o.samplingMode=_.NEAREST,o.wrapMode=T.CLAMP_TO_EDGE;const l=new Float32Array(f?u*a*16:2*i.length);if(f&&r!=null)for(let c=0,m=0;c{const r=t.get(i)||t.get(i+"[0]");r&&U(e,i,n[i],r)})}function R(e,t,n,i){n.length===i.length&&(i.some(r=>r==null)||n.some(r=>r==null)||n.forEach((r,u)=>{t.setUniform1i(r,u),e.bindTexture(i[u],u)}))}function U(e,t,n,i){if(i===null||n==null)return!1;const{info:r}=i;switch(r.type){case s.FLOAT:r.size>1?e.setUniform1fv(t,n):e.setUniform1f(t,n);break;case s.FLOAT_VEC2:e.setUniform2fv(t,n);break;case s.FLOAT_VEC3:e.setUniform3fv(t,n);break;case s.FLOAT_VEC4:e.setUniform4fv(t,n);break;case s.FLOAT_MAT3:e.setUniformMatrix3fv(t,n);break;case s.FLOAT_MAT4:e.setUniformMatrix4fv(t,n);break;case s.INT:r.size>1?e.setUniform1iv(t,n):e.setUniform1i(t,n);break;case s.BOOL:e.setUniform1i(t,n?1:0);break;case s.INT_VEC2:case s.BOOL_VEC2:e.setUniform2iv(t,n);break;case s.INT_VEC3:case s.BOOL_VEC3:e.setUniform3iv(t,n);break;case s.INT_VEC4:case s.BOOL_VEC4:e.setUniform4iv(t,n);break;default:return!1}return!0}export{k as F,v as G,w as L,L as M,R as N,x as U,B as V,V as b,I as k,G as w,N as x}; +import{s as E}from"./vec2f64-CeODonrJ-CkkJCdRC.js";import{B as C,F as A,M as _,G as T,c as s,U as M}from"./enums-DBi1-Mm2-CUS1pvQe.js";import{H as h,V as O}from"./Texture-BCt2hphT-Dk2JyWCy.js";function w(e,t,n="nearest",i=!1){const r=!(i&&t.pixelType==="u8"),u=r?A.FLOAT:A.UNSIGNED_BYTE,a=t.pixels==null||t.pixels.length===0?null:r?t.getAsRGBAFloat():t.getAsRGBA(),f=e.capabilities.textureFloatLinear,o=new h;return o.width=t.width,o.height=t.height,o.internalFormat=r?C.RGBA32F:M.RGBA,o.samplingMode=!f||n!=="bilinear"&&n!=="cubic"?_.NEAREST:_.LINEAR,o.dataType=u,o.wrapMode=T.CLAMP_TO_EDGE,new O(e,o,a)}function L(e,t){const{spacing:n,offsets:i,coefficients:r,size:[u,a]}=t,f=n[0]>1,o=new h;o.width=f?4*u:u,o.height=a,o.internalFormat=C.RGBA32F,o.dataType=A.FLOAT,o.samplingMode=_.NEAREST,o.wrapMode=T.CLAMP_TO_EDGE;const l=new Float32Array(f?u*a*16:2*i.length);if(f&&r!=null)for(let c=0,m=0;c{const r=t.get(i)||t.get(i+"[0]");r&&U(e,i,n[i],r)})}function R(e,t,n,i){n.length===i.length&&(i.some(r=>r==null)||n.some(r=>r==null)||n.forEach((r,u)=>{t.setUniform1i(r,u),e.bindTexture(i[u],u)}))}function U(e,t,n,i){if(i===null||n==null)return!1;const{info:r}=i;switch(r.type){case s.FLOAT:r.size>1?e.setUniform1fv(t,n):e.setUniform1f(t,n);break;case s.FLOAT_VEC2:e.setUniform2fv(t,n);break;case s.FLOAT_VEC3:e.setUniform3fv(t,n);break;case s.FLOAT_VEC4:e.setUniform4fv(t,n);break;case s.FLOAT_MAT3:e.setUniformMatrix3fv(t,n);break;case s.FLOAT_MAT4:e.setUniformMatrix4fv(t,n);break;case s.INT:r.size>1?e.setUniform1iv(t,n):e.setUniform1i(t,n);break;case s.BOOL:e.setUniform1i(t,n?1:0);break;case s.INT_VEC2:case s.BOOL_VEC2:e.setUniform2iv(t,n);break;case s.INT_VEC3:case s.BOOL_VEC3:e.setUniform3iv(t,n);break;case s.INT_VEC4:case s.BOOL_VEC4:e.setUniform4iv(t,n);break;default:return!1}return!0}export{k as F,v as G,w as L,L as M,R as N,x as U,B as V,V as b,I as k,G as w,N as x}; diff --git a/custom-toc-highlight/assets/rasterizingUtils-BmlDdKBf-CpGlbhM3.js b/custom-toc-highlight/assets/rasterizingUtils-BmlDdKBf-BP52xgN-.js similarity index 94% rename from custom-toc-highlight/assets/rasterizingUtils-BmlDdKBf-CpGlbhM3.js rename to custom-toc-highlight/assets/rasterizingUtils-BmlDdKBf-BP52xgN-.js index 74116d5f..e8ae8b52 100644 --- a/custom-toc-highlight/assets/rasterizingUtils-BmlDdKBf-CpGlbhM3.js +++ b/custom-toc-highlight/assets/rasterizingUtils-BmlDdKBf-BP52xgN-.js @@ -1 +1 @@ -import{l as v}from"./floatRGBA-4pIJN00G-BsIUaPaZ.js";import{iW as y}from"./story-BfX8CRfG.js";import{t as F,c as A,o as C}from"./constants-Bqe1QJ4u-F8oTIn7N.js";const D=a=>a==="vertical"||a==="horizontal"||a==="cross"||a==="esriSFSCross"||a==="esriSFSVertical"||a==="esriSFSHorizontal";function $(a,d,M){const i=d.style,h=y(Math.ceil(M)),t=D(i)?8*h:16*h,o=2*h;a.width=t,a.height=t;const e=a.getContext("2d");e.strokeStyle="#ffffff",e.lineWidth=h,e.beginPath(),i!=="vertical"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSVertical"||(e.moveTo(t/2,-o),e.lineTo(t/2,t+o)),i!=="horizontal"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSHorizontal"||(e.moveTo(-o,t/2),e.lineTo(t+o,t/2)),i!=="backward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"&&i!=="esriSFSBackwardDiagonal"||(e.moveTo(-o,-o),e.lineTo(t+o,t+o),e.moveTo(t-o,-o),e.lineTo(t+o,o),e.moveTo(-o,t-o),e.lineTo(o,t+o)),i!=="forward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSForwardDiagonal"&&i!=="esriSFSDiagonalCross"||(e.moveTo(t+o,-o),e.lineTo(-o,t+o),e.moveTo(o,-o),e.lineTo(-o,o),e.moveTo(t+o,t-o),e.lineTo(t-o,t+o)),e.stroke();const m=e.getImageData(0,0,a.width,a.height),s=new Uint8Array(m.data);let c;for(let n=0;nn+l,0),M=Math.round(d*F),i=1,h=new Float32Array(M*i);let t=0,o=0,e=.5,m=!0;for(const n of a){for(t=o,o+=n*F;e<=o;){const l=e-.5,r=Math.min(Math.abs(e-t),Math.abs(e-o));h[l]=m?-r:r,e++}m=!m}const s=h.length,c=new Uint8Array(4*s);for(let n=0;na==="vertical"||a==="horizontal"||a==="cross"||a==="esriSFSCross"||a==="esriSFSVertical"||a==="esriSFSHorizontal";function $(a,d,M){const i=d.style,h=y(Math.ceil(M)),t=D(i)?8*h:16*h,o=2*h;a.width=t,a.height=t;const e=a.getContext("2d");e.strokeStyle="#ffffff",e.lineWidth=h,e.beginPath(),i!=="vertical"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSVertical"||(e.moveTo(t/2,-o),e.lineTo(t/2,t+o)),i!=="horizontal"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSHorizontal"||(e.moveTo(-o,t/2),e.lineTo(t+o,t/2)),i!=="backward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"&&i!=="esriSFSBackwardDiagonal"||(e.moveTo(-o,-o),e.lineTo(t+o,t+o),e.moveTo(t-o,-o),e.lineTo(t+o,o),e.moveTo(-o,t-o),e.lineTo(o,t+o)),i!=="forward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSForwardDiagonal"&&i!=="esriSFSDiagonalCross"||(e.moveTo(t+o,-o),e.lineTo(-o,t+o),e.moveTo(o,-o),e.lineTo(-o,o),e.moveTo(t+o,t-o),e.lineTo(t-o,t+o)),e.stroke();const m=e.getImageData(0,0,a.width,a.height),s=new Uint8Array(m.data);let c;for(let n=0;nn+l,0),M=Math.round(d*F),i=1,h=new Float32Array(M*i);let t=0,o=0,e=.5,m=!0;for(const n of a){for(t=o,o+=n*F;e<=o;){const l=e-.5,r=Math.min(Math.abs(e-t),Math.abs(e-o));h[l]=m?-r:r,e++}m=!m}const s=h.length,c=new Uint8Array(4*s);for(let n=0;n{let i,s,l,u,r;if(e.data)if(e.data instanceof ArrayBuffer){if(!(t!=="json"&&t!=="text"&&t!=="blob"||(i=new Blob([e.data]),t!=="json"&&t!=="text"||(u=await i.text(),t!=="json")))){try{s=JSON.parse(u||null)}catch(n){const b={...n,url:o,requestOptions:a};throw new p("request:server",n.message,b)}if(s.error){const n={...s.error,url:o,requestOptions:a};throw new p("request:server",s.error.message,n)}}}else t==="native"&&(e.data.signal=c,l=await fetch(e.data.url,e.data),e.httpStatus=l.status);switch(t){case"blob":r=i;break;case"json":r=s;break;case"native":r=l;break;case"text":r=u;break;default:r=e.data}return{data:r,httpStatus:e.httpStatus,requestOptions:a,ssl:e.ssl,url:o}})}export{h as execute}; +import{o as p}from"./story-Doly9N9p.js";import"./main-QGPoLsvl.js";function h(o,a){let t=a.responseType;t?t!=="array-buffer"&&t!=="blob"&&t!=="json"&&t!=="native"&&t!=="native-request-init"&&t!=="text"&&(t="text"):t="json",a.responseType=t;const c=a.signal;return delete a.signal,globalThis.invokeStaticMessage("request",{url:o,options:a},{signal:c}).then(async e=>{let i,s,l,u,r;if(e.data)if(e.data instanceof ArrayBuffer){if(!(t!=="json"&&t!=="text"&&t!=="blob"||(i=new Blob([e.data]),t!=="json"&&t!=="text"||(u=await i.text(),t!=="json")))){try{s=JSON.parse(u||null)}catch(n){const b={...n,url:o,requestOptions:a};throw new p("request:server",n.message,b)}if(s.error){const n={...s.error,url:o,requestOptions:a};throw new p("request:server",s.error.message,n)}}}else t==="native"&&(e.data.signal=c,l=await fetch(e.data.url,e.data),e.httpStatus=l.status);switch(t){case"blob":r=i;break;case"json":r=s;break;case"native":r=l;break;case"text":r=u;break;default:r=e.data}return{data:r,httpStatus:e.httpStatus,requestOptions:a,ssl:e.ssl,url:o}})}export{h as execute}; diff --git a/custom-toc-highlight/assets/requestImageUtils-Ut4YcoNU-BtID-_Ic.js b/custom-toc-highlight/assets/requestImageUtils-Ut4YcoNU-CZnNufeN.js similarity index 54% rename from custom-toc-highlight/assets/requestImageUtils-Ut4YcoNU-BtID-_Ic.js rename to custom-toc-highlight/assets/requestImageUtils-Ut4YcoNU-CZnNufeN.js index d6c885e6..e401d34f 100644 --- a/custom-toc-highlight/assets/requestImageUtils-Ut4YcoNU-BtID-_Ic.js +++ b/custom-toc-highlight/assets/requestImageUtils-Ut4YcoNU-CZnNufeN.js @@ -1 +1 @@ -import{f as r}from"./story-BfX8CRfG.js";async function o(a,e){const{data:n}=await r(a,{responseType:"image",...e});return n}export{o as r}; +import{f as r}from"./story-Doly9N9p.js";async function o(a,e){const{data:n}=await r(a,{responseType:"image",...e});return n}export{o as r}; diff --git a/custom-toc-highlight/assets/resourceExtension-CdQvIDKV-BNH6JkTz.js b/custom-toc-highlight/assets/resourceExtension-CdQvIDKV-DCvzsrJt.js similarity index 88% rename from custom-toc-highlight/assets/resourceExtension-CdQvIDKV-BNH6JkTz.js rename to custom-toc-highlight/assets/resourceExtension-CdQvIDKV-DCvzsrJt.js index 240f1358..2cec6fea 100644 --- a/custom-toc-highlight/assets/resourceExtension-CdQvIDKV-BNH6JkTz.js +++ b/custom-toc-highlight/assets/resourceExtension-CdQvIDKV-DCvzsrJt.js @@ -1 +1 @@ -import{gF as o}from"./story-BfX8CRfG.js";function c(p){return i[e(p)]||l}function e(p){return p.type==="json"?"application/json":p.type==="blob"?p.blob.type:g(p.url)}function g(p){const a=o(p);return t[a]||n}const i={},n="text/plain",l=i[n],t={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 p in t)i[t[p]]=p;export{c as e}; +import{gF as o}from"./story-Doly9N9p.js";function c(p){return i[e(p)]||l}function e(p){return p.type==="json"?"application/json":p.type==="blob"?p.blob.type:g(p.url)}function g(p){const a=o(p);return t[a]||n}const i={},n="text/plain",l=i[n],t={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 p in t)i[t[p]]=p;export{c as e}; diff --git a/custom-toc-highlight/assets/resourceUtils-BmW6QqlX-B1DAUGNs.js b/custom-toc-highlight/assets/resourceUtils-BmW6QqlX-D_AxNrCI.js similarity index 82% rename from custom-toc-highlight/assets/resourceUtils-BmW6QqlX-B1DAUGNs.js rename to custom-toc-highlight/assets/resourceUtils-BmW6QqlX-D_AxNrCI.js index 232f2a31..6456d1b4 100644 --- a/custom-toc-highlight/assets/resourceUtils-BmW6QqlX-B1DAUGNs.js +++ b/custom-toc-highlight/assets/resourceUtils-BmW6QqlX-D_AxNrCI.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./resourceUtils-rTM6Iemx-BROWZCZ1.js","./story-BfX8CRfG.js","./main-ugzBrWNm.js","./main-Cypivj38.css","./story-D5JOvNzl.css"])))=>i.map(i=>d[i]); -import{_}from"./main-ugzBrWNm.js";import{jx as y,$ as S,o as v,iF as E}from"./story-BfX8CRfG.js";import{r as F}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{getSiblingOfSameTypeI as O,contentToBlob as m}from"./resourceUtils-rTM6Iemx-BROWZCZ1.js";async function b(s,t,r){const o=await w(s,t,r);await I(o,t,r)}async function x(s,t,r,o,a){const c=await w(r,o,a);await s.update({data:t}),await I(c,o,a)}async function w(s,t,r){if(!t?.resources)return;const o=t.portalItem===s.portalItem?new Set(s.paths):new Set;s.paths.length=0,s.portalItem=t.portalItem;const a=new Set(t.resources.toKeep.map(e=>e.resource.path)),c=new Set,f=[];a.forEach(e=>{o.delete(e),s.paths.push(e)});const p=[],h=[],u=[];for(const e of t.resources.toUpdate)if(o.delete(e.resource.path),a.has(e.resource.path)||c.has(e.resource.path)){const{resource:n,content:g,finish:d}=e,i=O(n,F());s.paths.push(i.path),p.push({resource:i,content:await m(g),compress:e.compress}),d&&u.push(()=>d(i))}else{s.paths.push(e.resource.path),h.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&u.push(()=>n(e.resource)),c.add(e.resource.path)}for(const e of t.resources.toAdd)if(s.paths.push(e.resource.path),o.has(e.resource.path))o.delete(e.resource.path);else{p.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&u.push(()=>n(e.resource))}if(p.length||h.length){const{addOrUpdateResources:e}=await _(()=>import("./resourceUtils-rTM6Iemx-BROWZCZ1.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);await e(t.portalItem,p,"add",r),await e(t.portalItem,h,"update",r)}if(u.forEach(e=>e()),f.length===0)return o;const l=await y(f);if(S(r),l.length>0)throw new v("save:resources","Failed to save one or more resources",{errors:l});return o}async function I(s,t,r){if(!s||!t.portalItem)return;const o=[];for(const a of s){const c=t.portalItem.resourceFromPath(a);o.push(c.portalItem.removeResource(c,r))}await E(o)}export{x as F,b as T}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./resourceUtils-rTM6Iemx-GPPQBysx.js","./story-Doly9N9p.js","./main-QGPoLsvl.js","./main-Cypivj38.css","./story-DbFhYdqg.css"])))=>i.map(i=>d[i]); +import{_}from"./main-QGPoLsvl.js";import{jx as y,$ as S,o as v,iF as E}from"./story-Doly9N9p.js";import{r as F}from"./uuid-Dj9mdEVg-BaKSCiyT.js";import{getSiblingOfSameTypeI as O,contentToBlob as m}from"./resourceUtils-rTM6Iemx-GPPQBysx.js";async function b(s,t,r){const o=await w(s,t,r);await I(o,t,r)}async function x(s,t,r,o,a){const c=await w(r,o,a);await s.update({data:t}),await I(c,o,a)}async function w(s,t,r){if(!t?.resources)return;const o=t.portalItem===s.portalItem?new Set(s.paths):new Set;s.paths.length=0,s.portalItem=t.portalItem;const a=new Set(t.resources.toKeep.map(e=>e.resource.path)),c=new Set,f=[];a.forEach(e=>{o.delete(e),s.paths.push(e)});const p=[],h=[],u=[];for(const e of t.resources.toUpdate)if(o.delete(e.resource.path),a.has(e.resource.path)||c.has(e.resource.path)){const{resource:n,content:g,finish:d}=e,i=O(n,F());s.paths.push(i.path),p.push({resource:i,content:await m(g),compress:e.compress}),d&&u.push(()=>d(i))}else{s.paths.push(e.resource.path),h.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&u.push(()=>n(e.resource)),c.add(e.resource.path)}for(const e of t.resources.toAdd)if(s.paths.push(e.resource.path),o.has(e.resource.path))o.delete(e.resource.path);else{p.push({resource:e.resource,content:await m(e.content),compress:e.compress});const n=e.finish;n&&u.push(()=>n(e.resource))}if(p.length||h.length){const{addOrUpdateResources:e}=await _(()=>import("./resourceUtils-rTM6Iemx-GPPQBysx.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url);await e(t.portalItem,p,"add",r),await e(t.portalItem,h,"update",r)}if(u.forEach(e=>e()),f.length===0)return o;const l=await y(f);if(S(r),l.length>0)throw new v("save:resources","Failed to save one or more resources",{errors:l});return o}async function I(s,t,r){if(!s||!t.portalItem)return;const o=[];for(const a of s){const c=t.portalItem.resourceFromPath(a);o.push(c.portalItem.removeResource(c,r))}await E(o)}export{x as F,b as T}; diff --git a/custom-toc-highlight/assets/resourceUtils-Ds65naCv-jCWWLIQy.js b/custom-toc-highlight/assets/resourceUtils-Ds65naCv-PY5SfRMU.js similarity index 92% rename from custom-toc-highlight/assets/resourceUtils-Ds65naCv-jCWWLIQy.js rename to custom-toc-highlight/assets/resourceUtils-Ds65naCv-PY5SfRMU.js index 69b2dad9..83f7d46b 100644 --- a/custom-toc-highlight/assets/resourceUtils-Ds65naCv-jCWWLIQy.js +++ b/custom-toc-highlight/assets/resourceUtils-Ds65naCv-PY5SfRMU.js @@ -1 +1 @@ -import{K as L}from"./story-BfX8CRfG.js";import{D as i}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";class h{constructor(r){this.data=r,this.type="encoded-mesh-texture",this.encoding=i.KTX2_ENCODING}}function v(t){return t?.type==="encoded-mesh-texture"}async function w(t){const r=new Blob([t]),o=await r.text();return JSON.parse(o)}async function p(t,r){if(r===i.KTX2_ENCODING)return new h(t);const o=new Blob([t],{type:r}),n=URL.createObjectURL(o),e=new Image;if(L("esri-iPhone"))return new Promise((d,m)=>{const c=()=>{a(),d(e)},s=u=>{a(),m(u)},a=()=>{URL.revokeObjectURL(n),e.removeEventListener("load",c),e.removeEventListener("error",s)};e.addEventListener("load",c),e.addEventListener("error",s),e.src=n});try{e.src=n,await e.decode()}catch{console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(n),e}export{h as d,v as f,w as h,p as l}; +import{K as L}from"./story-Doly9N9p.js";import{D as i}from"./basicInterfaces-Dsf65ICa-DkQ9Rsnx.js";class h{constructor(r){this.data=r,this.type="encoded-mesh-texture",this.encoding=i.KTX2_ENCODING}}function v(t){return t?.type==="encoded-mesh-texture"}async function w(t){const r=new Blob([t]),o=await r.text();return JSON.parse(o)}async function p(t,r){if(r===i.KTX2_ENCODING)return new h(t);const o=new Blob([t],{type:r}),n=URL.createObjectURL(o),e=new Image;if(L("esri-iPhone"))return new Promise((d,m)=>{const c=()=>{a(),d(e)},s=u=>{a(),m(u)},a=()=>{URL.revokeObjectURL(n),e.removeEventListener("load",c),e.removeEventListener("error",s)};e.addEventListener("load",c),e.addEventListener("error",s),e.src=n});try{e.src=n,await e.decode()}catch{console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(n),e}export{h as d,v as f,w as h,p as l}; diff --git a/custom-toc-highlight/assets/resourceUtils-rTM6Iemx-BROWZCZ1.js b/custom-toc-highlight/assets/resourceUtils-rTM6Iemx-GPPQBysx.js similarity index 94% rename from custom-toc-highlight/assets/resourceUtils-rTM6Iemx-BROWZCZ1.js rename to custom-toc-highlight/assets/resourceUtils-rTM6Iemx-GPPQBysx.js index 1d179d07..21cc46dd 100644 --- a/custom-toc-highlight/assets/resourceUtils-rTM6Iemx-BROWZCZ1.js +++ b/custom-toc-highlight/assets/resourceUtils-rTM6Iemx-GPPQBysx.js @@ -1 +1 @@ -import{bX as f,o as m,gF as v,f as b}from"./story-BfX8CRfG.js";import"./main-ugzBrWNm.js";async function I(e,t={},s){await e.load(s);const r=f(e.itemUrl,"resources"),{start:c=1,num:d=10,sortOrder:l="asc",sortField:u="resource"}=t,i={query:{start:c,num:d,sortOrder:l,sortField:u,token:e.apiKey},signal:s?.signal},a=await e.portal.request(r,i);return{total:a.total,nextStart:a.nextStart,resources:a.resources.map(({created:n,size:p,resource:o})=>({created:new Date(n),size:p,resource:e.resourceFromPath(o)}))}}async function P(e,t,s,r){const c=new Map;for(const{resource:l,content:u,compress:i,access:a}of t){if(!l.hasPath())throw new m(`portal-item-resource-${s}:invalid-path`,"Resource does not have a valid path");const[n,p]=h(l.path),o=`${n}/${i??""}/${a??""}`;c.has(o)||c.set(o,{prefix:n,compress:i,access:a,files:[]}),c.get(o).files.push({fileName:p,content:u})}await e.load(r);const d=f(e.userItemUrl,s==="add"?"addResources":"updateResources");for(const{prefix:l,compress:u,access:i,files:a}of c.values())for(let n=0;n({created:new Date(n),size:p,resource:e.resourceFromPath(o)}))}}async function P(e,t,s,r){const c=new Map;for(const{resource:l,content:u,compress:i,access:a}of t){if(!l.hasPath())throw new m(`portal-item-resource-${s}:invalid-path`,"Resource does not have a valid path");const[n,p]=h(l.path),o=`${n}/${i??""}/${a??""}`;c.has(o)||c.set(o,{prefix:n,compress:i,access:a,files:[]}),c.get(o).files.push({fileName:p,content:u})}await e.load(r);const d=f(e.userItemUrl,s==="add"?"addResources":"updateResources");for(const{prefix:l,compress:u,access:i,files:a}of c.values())for(let n=0;nr==="error").map(({name:r,message:a,details:p})=>new l(r,a,p));if(t.blockedRelativeUrls&&(e=e.concat(t.blockedRelativeUrls.map(r=>new l("url:unsupported",`Relative url '${r}' is not supported`)))),o){const{ignoreUnsupported:r,supplementalUnsupportedErrors:a=[],requiredPropertyChecksDisabled:p}=o;r&&(e=e.filter(({name:n})=>!(i.has(n)||a.includes(n)))),p&&(e=e.filter(n=>n.name!=="web-document-write:property-required"))}if(e.length>0)throw new l(s.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}export{f as d,d as i}; +import{o as l}from"./story-Doly9N9p.js";async function d(t){const s=[];for(const o of t.allLayers)if("beforeSave"in o&&typeof o.beforeSave=="function"){const e=o.beforeSave();e&&s.push(e)}await Promise.allSettled(s)}const i=new Set(["layer:unsupported","property:unsupported","symbol:unsupported","symbol-layer:unsupported","url:unsupported"]);function f(t,s,o){let e=(t.messages??[]).filter(({type:r})=>r==="error").map(({name:r,message:a,details:p})=>new l(r,a,p));if(t.blockedRelativeUrls&&(e=e.concat(t.blockedRelativeUrls.map(r=>new l("url:unsupported",`Relative url '${r}' is not supported`)))),o){const{ignoreUnsupported:r,supplementalUnsupportedErrors:a=[],requiredPropertyChecksDisabled:p}=o;r&&(e=e.filter(({name:n})=>!(i.has(n)||a.includes(n)))),p&&(e=e.filter(n=>n.name!=="web-document-write:property-required"))}if(e.length>0)throw new l(s.errorName,"Failed to save due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:e})}export{f as d,d as i}; diff --git a/custom-toc-highlight/assets/scaleUtils-DxsfQwK1-D7ZZd5W4.js b/custom-toc-highlight/assets/scaleUtils-DxsfQwK1-CzyfErWH.js similarity index 81% rename from custom-toc-highlight/assets/scaleUtils-DxsfQwK1-D7ZZd5W4.js rename to custom-toc-highlight/assets/scaleUtils-DxsfQwK1-CzyfErWH.js index 8262247f..e84f6f71 100644 --- a/custom-toc-highlight/assets/scaleUtils-DxsfQwK1-D7ZZd5W4.js +++ b/custom-toc-highlight/assets/scaleUtils-DxsfQwK1-CzyfErWH.js @@ -1 +1 @@ -import{p as c,eJ as o,eK as r}from"./story-BfX8CRfG.js";const i=96;function p(n,t){const e=n.extent,u=n.width,f=c(e?.spatialReference);return e&&u?e.width/u*f*o*i:0}function m(n,t){return n/(c(t)*o*i)}function w(n,t,e){return a(n,t)&&s(n,e)}function a(n,t){return t===0||r(n,t)||nt}export{w as b,p as c,m as f}; +import{p as c,eJ as o,eK as r}from"./story-Doly9N9p.js";const i=96;function p(n,t){const e=n.extent,u=n.width,f=c(e?.spatialReference);return e&&u?e.width/u*f*o*i:0}function m(n,t){return n/(c(t)*o*i)}function w(n,t,e){return a(n,t)&&s(n,e)}function a(n,t){return t===0||r(n,t)||nt}export{w as b,p as c,m as f}; diff --git a/custom-toc-highlight/assets/screen-BGsID61t-Co1xWElA.js b/custom-toc-highlight/assets/screen-BGsID61t-BTqeBZJo.js similarity index 99% rename from custom-toc-highlight/assets/screen-BGsID61t-Co1xWElA.js rename to custom-toc-highlight/assets/screen-BGsID61t-BTqeBZJo.js index 095d2e9c..e3ec0ad7 100644 --- a/custom-toc-highlight/assets/screen-BGsID61t-Co1xWElA.js +++ b/custom-toc-highlight/assets/screen-BGsID61t-BTqeBZJo.js @@ -1,4 +1,4 @@ -import{c0 as pe,eT as ht,eU as Ot,f6 as Z,fY as tt,f7 as Et,f9 as At,e$ as Q,fb as dt,f2 as B,fG as Pt,fg as G,fo as ct,f4 as $,eX as Tt,gc as me,gb as ve,fu as xt,f0 as Ht,fn as ye,eY as ge,f8 as be,eV as ut,e_ as ke,f1 as It,gy as St}from"./story-BfX8CRfG.js";import{o as xe}from"./vue.esm-bundler-D2erd_gM-D0q3-bhf.js";import{Z as Se}from"./toggle-switch-control-B4JzuvHa-xR5vylCb.js";import"./main-ugzBrWNm.js";var Dt={exports:{}},we=Dt.exports,Nt;function Pe(){return Nt||(Nt=1,function(V,L){(function(j,y){V.exports=y(xe)})(typeof self<"u"?self:we,function(j){return function(){var y={388:function(l,d){var s,i,c;(function(S,E){i=[],s=E,c=typeof s=="function"?s.apply(d,i):s,c===void 0||(l.exports=c)})(typeof self<"u"&&self,function(){function S(){var E=Object.getOwnPropertyDescriptor(document,"currentScript");if(!E&&"currentScript"in document&&document.currentScript||E&&E.get!==S&&document.currentScript)return document.currentScript;try{throw new Error}catch(q){var A,F,T,f=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,x=/@([^@]*):(\d+):(\d+)\s*$/gi,m=f.exec(q.stack)||x.exec(q.stack),K=m&&m[1]||!1,et=m&&m[2]||!1,J=document.location.href.replace(document.location.hash,""),R=document.getElementsByTagName("script");K===J&&(A=document.documentElement.outerHTML,F=new RegExp("(?:[^\\n]+?\\n){0,"+(et-2)+"}[^<]* - + diff --git a/custom-toc-highlight/index-ca-fr.html b/custom-toc-highlight/index-ca-fr.html index 6587ddd7..a283097f 100644 --- a/custom-toc-highlight/index-ca-fr.html +++ b/custom-toc-highlight/index-ca-fr.html @@ -15,7 +15,7 @@ src="https://www.canada.ca/etc/designs/canada/cdts/gcweb/v5_0_2/cdts/compiled/wet-fr.js" data-cdts-setup='{"cdnEnv": "prod"}' > - + diff --git a/custom-toc-highlight/index.html b/custom-toc-highlight/index.html index 0af96d3a..0c66efc0 100644 --- a/custom-toc-highlight/index.html +++ b/custom-toc-highlight/index.html @@ -8,7 +8,7 @@ RAMP Storylines - +